1"use strict";(()=>{var jl=Object.defineProperty;var p=(n,e)=>()=>(n&&(e=n(n=0)),e);var M=(n,e)=>{for(var t in e)jl(n,t,{get:e[t],enumerable:!0})};var k=p(()=>{"use strict"});var K,ft=p(()=>{"use strict";K=class{static report(e){try{this.errors.unshift({...e,data:e.data?this.safeClone(e.data):void 0}),this.errors.length>this.MAX_ERRORS&&this.errors.pop()}catch(t){try{console.error("Error in error reporter:",t)}catch{}}}static getErrors(){try{return this.safeClone(this.errors)}catch{return[]}}static clearErrors(){try{this.errors=[]}catch{}}static safeClone(e){try{return JSON.parse(JSON.stringify(e))}catch{if(typeof e=="object"&&e!==null){let t={};for(let i in e){let r=e[i];typeof r!="object"||r===null?t[i]=r:t[i]="[Object]"}return t}return e}}static safeStringify(e){try{return JSON.stringify(e)}catch{return"[Object]"}}};K.errors=[],K.MAX_ERRORS=10});function W(n){return{success:!0,value:n,unwrap(){return this.value},unwrapOr(){return this.value}}}function Ne(n){return{success:!1,error:n,unwrap(){throw this.error},unwrapOr(e){return e}}}var pt=p(()=>{"use strict"});function c(n,e){try{return n()}catch{return e}}function E(n,e){try{return W(n())}catch(t){let i=t instanceof Error?t.message:String(t),r={...e,message:`${e.message}: ${i}`};try{K.report(r)}catch{try{console.error("Failed to handle error:",i)}catch{}}return Ne(r)}}async function b(n,e){try{return W(await n())}catch(t){let i=t instanceof Error?t.message:String(t),r=t==null?void 0:t.statusCode,o={...e,...typeof r=="number"?{statusCode:r}:{},message:`${e.message}: ${i}`};try{K.report(o)}catch{try{console.error("Failed to handle async error:",i)}catch{}}return Ne(o)}}var m=p(()=>{"use strict";ft();pt()});var N,yn=p(()=>{"use strict";N=class{static ensureInitialized(){this.initialized||(this.initialized=!0)}static get(){this.ensureInitialized();try{return!this.config.enabled||!this.staticData?null:{...this.staticData}}catch{return null}}static set(e){this.ensureInitialized();try{if(!this.config.enabled)return;this.staticData={...e},this.logCacheStats()}catch{}}static clear(){try{let e=this.staticData!==null;this.staticData=null,this.stats.lastClearTime=Date.now()}catch{this.staticData=null}}static invalidateArticleData(){try{if(this.staticData){let e=this.staticData.ex_articleData!==void 0;this.staticData={...this.staticData,ex_articleData:void 0}}}catch{}}static invalidateUserData(){try{if(this.staticData){let e=this.staticData.ex_userData!==void 0;this.staticData={...this.staticData,ex_userData:void 0}}}catch{}}static updateArticleData(e){try{if(!this.config.enabled)return;this.staticData&&(this.staticData={...this.staticData,ex_articleData:e})}catch{}}static updateUserData(e){try{if(!this.config.enabled)return;this.staticData&&(this.staticData={...this.staticData,ex_userData:e})}catch{}}static getStats(){return{...this.stats}}static setEnabled(e){try{let t=this.config.enabled;this.config.enabled=e,t!==e&&this.logCacheStats(),!e&&this.staticData!==null&&this.clear()}catch{}}static isEnabled(){return this.config.enabled}static recordHit(e){try{this.stats.hits++,this.stats.timeSavedMs+=e}catch{}}static recordMiss(){try{this.stats.misses++}catch{}}static resetStats(){this.stats={hits:0,misses:0,timeSavedMs:0,lastClearTime:Date.now()}}static logCacheStats(){try{let e=this.stats.hits+this.stats.misses>0?(this.stats.hits/(this.stats.hits+this.stats.misses)*100).toFixed(1):"0.0"}catch{}}};N.staticData=null,N.config={enabled:!0},N.stats={hits:0,misses:0,timeSavedMs:0,lastClearTime:Date.now()},N.initialized=!1});function jo(n){let e={...be,...n||{}};return{...e,enabled:e.enabled===!0,mock:e.mock===!0,containerSelector:zo(e.containerSelector,be.containerSelector),unitSelector:zo(e.unitSelector,be.unitSelector),excludeSelectors:Array.isArray(e.excludeSelectors)?e.excludeSelectors.filter(t=>typeof t=="string"&&t.trim().length>0):[],includeOutbound:e.includeOutbound===!0,preserveQueryParams:Array.isArray(e.preserveQueryParams)?e.preserveQueryParams.filter(t=>typeof t=="string"&&t.length>0):[],window:e.window==="5m"||e.window==="30m"||e.window==="24h"?e.window:be.window,pollIntervalMs:Yi(e.pollIntervalMs,1e3,be.pollIntervalMs),chunkSize:Math.min(200,Yi(e.chunkSize,1,be.chunkSize)),staleAfterMs:Yi(e.staleAfterMs,1e3,be.staleAfterMs)}}function zo(n,e){return typeof n=="string"&&n.trim().length>0?n:e}function Yi(n,e,t){return typeof n!="number"||!Number.isFinite(n)?t:Math.max(e,Math.floor(n))}var be,Go=p(()=>{"use strict";be={enabled:!1,containerSelector:"body",unitSelector:"article",excludeSelectors:[],includeOutbound:!1,preserveQueryParams:[],window:"30m",pollIntervalMs:3e4,staleAfterMs:9e4,chunkSize:100,mock:!1}});var Qi,bn,Xi,Ji,Zi,er,qo,tr,Gl,nr,ir,d,w=p(()=>{"use strict";k();m();yn();Go();Qi={hiddenPageTimeout:3e4,enableSPATracking:!1,enableVisibilityTracking:!0,trackHashChanges:!1},bn={enabled:!0,ping_interval_seconds:15,send_on_visibility_change:!0,min_active_time_for_visibility_ping:3,visibility_debounce_ms:1e3,enable_spa_tracking:!1,ping_decay_schedule:[],ping_sampling_rate:1},Xi={enabled:!0,maxEvents:100,ttlHours:24,maxAttempts:3},Ji={enabled:!1,report_interval_seconds:300},Zi={trackInertClicks:!1,inertClickSamplingRate:1,internalHosts:[]},er={enabled:!1,samplingRate:1,rawHtmlCheck:!1,rawHtmlCheckSamplingRate:.01,maxChecksPayloadBytes:2048},qo={enabled:!1,persist:!1,maxAgeDays:395,identityLawfulBasis:"consent"},tr={enabled:!0,articleDetection:"auto",articlePaths:[],wordCount:"auto"},Gl="dataLayer",nr={enabled:!1,cookieName:"naviga_ab_session",variantCookiePrefix:"naviga_ab_variant_",tokenQueryParam:"naviga_ab_token",previewQueryParam:"naviga_ab_preview",headlineSelectors:["h1","h2","h3"],experimentTTLSeconds:60,variantCookieDays:30,exposureGating:!0,stickinessMode:"session"},ir={treatReplaceStateAsNavigation:!1},d=class{static set(e){c(()=>{this.config={...this.config,...e},e.enableEventDataCaching!==void 0&&N.setEnabled(e.enableEventDataCaching),this.validateEncryptionConfig()},void 0)}static get(){return c(()=>({...this.config}),{organisation_name:"",publication_name:"",publication_id:"",api_base_url:"",api_key:"",loggingEnabled:!1,sdk_health_enabled:!1,preload:!1})}static isSdkHealthEnabled(){return c(()=>this.config.sdk_health_enabled===!0,!1)}static disable_set(e){c(()=>{this.disable_config={...this.disable_config,...e}},void 0)}static disable_get(){return c(()=>this.disable_config,{DisableOption:!1})}static getValue(e){return c(()=>this.config[e],void 0)}static getArticleDetails(){return E(()=>{let e=this.config.articleDetailsMapping;if(!e||!e.variableName)return{};let t=this.getGlobalVariable(e.variableName,e.path);return t||{}}
1,{message:"Failed to get article details",severity:"medium",source:"ConfigManager.getArticleDetails",configKey:"articleDetailsMapping"})}static getUserDetails(){return E(()=>{let e=this.config.userDetailsMapping;if(!e||!e.variableName)return{};let t=this.getGlobalVariable(e.variableName,e.path);return t||{}},{message:"Failed to get user details",severity:"medium",source:"ConfigManager.getUserDetails",configKey:"userDetailsMapping"})}static getCustomEventCommonDetails(){return c(()=>{var i;let e=(i=this.config.customEvents)==null?void 0:i.commonDetailsMapping;if(!e||!e.variableName)return{};let t=this.getGlobalVariable(e.variableName,e.path);return!t||typeof t!="object"||Array.isArray(t)?{}:{...t}},{})}static getCustomEventExcludeKeys(){var e;return this.normalizeKeyList((e=this.config.customEvents)==null?void 0:e.excludeKeys)}static getCrossDomainLinkerHosts(){return c(()=>{var t;let e=(t=this.config.customEvents)==null?void 0:t.linkerHosts;return e===void 0?[".subscriberconcierge.com"]:Array.isArray(e)?e.filter(i=>typeof i=="string").map(i=>i.trim().toLowerCase()).filter(i=>i!==""):[]},[".subscriberconcierge.com"])}static getCustomEventBindings(){return c(()=>{var t;let e=(t=this.config.customEvents)==null?void 0:t.bindings;return Array.isArray(e)?e.filter(i=>i&&typeof i=="object"&&(i.sourceType==="dom"||i.sourceType==="knockout")&&typeof i.sourceEventName=="string"&&i.sourceEventName.trim()!==""&&typeof i.targetEventName=="string"&&i.targetEventName.trim()!==""&&(i.payloadMapper===void 0||typeof i.payloadMapper=="function")):[]},[])}static normalizeKeyList(e){return c(()=>{if(!Array.isArray(e))return[];let t=e.filter(i=>typeof i=="string").map(i=>i.trim()).filter(i=>i.length>0);return Array.from(new Set(t))},[])}static resolveMappedGlobal(e){return c(()=>!e||!e.variableName?null:this.getGlobalVariable(e.variableName,e.path),null)}static getGlobalVariable(e,t){return c(()=>{let i=window[e];return i?t?t.split(".").reduce((r,o)=>r&&r[o]!==void 0?r[o]:null,i):i:null},null)}static setPageLeaveConfig(e){c(()=>{this.pageLeaveConfig={...Qi,...e}},void 0)}static getPageLeaveConfig(){return c(()=>({...this.pageLeaveConfig}),{...Qi})}static setHeartbeatConfig(e){c(()=>{let t={};if(e.enabled!==void 0&&(t.enabled=e.enabled),e.ping_interval_seconds!==void 0&&(t.ping_interval_seconds=e.ping_interval_seconds),e.send_on_visibility_change!==void 0&&(t.send_on_visibility_change=e.send_on_visibility_change),e.min_active_time_for_visibility_ping!==void 0&&(t.min_active_time_for_visibility_ping=e.min_active_time_for_visibility_ping),e.visibility_debounce_ms!==void 0&&(t.visibility_debounce_ms=e.visibility_debounce_ms),e.enable_spa_tracking!==void 0&&(t.enable_spa_tracking=e.enable_spa_tracking),e.ping_decay_schedule!==void 0&&(t.ping_decay_schedule=e.ping_decay_schedule),e.ping_sampling_rate!==void 0&&(t.ping_sampling_rate=e.ping_sampling_rate),t.ping_decay_schedule!==void 0){let i=Array.isArray(t.ping_decay_schedule)?t.ping_decay_schedule:[],r=i.filter(o=>o&&Number.isFinite(o.after_seconds)&&Number.isFinite(o.interval_seconds)&&o.after_seconds>=0).map(o=>({after_seconds:Math.floor(o.after_seconds),interval_seconds:Math.min(300,Math.max(5,Math.floor(o.interval_seconds)))})).sort((o,s)=>o.after_seconds-s.after_seconds);r.length,i.length,t.ping_decay_schedule=r}if(t.ping_sampling_rate!==void 0){let i=t.ping_sampling_rate;(!Number.isFinite(i)||i<0||i>1)&&(t.ping_sampling_rate=1)}t.ping_interval_seconds!==void 0&&(t.ping_interval_seconds<5||t.ping_interval_seconds>60)&&(t.ping_interval_seconds=bn.ping_interval_seconds),this.heartbeatConfig={...bn,...t}},void 0)}static getHeartbeatConfig(){return c(()=>({...this.heartbeatConfig}),{...bn})}static setABConfig(e){c(()=>
1{this.abTestingConfig={...nr,...e}},void 0)}static getABConfig(){return c(()=>({...this.abTestingConfig}),{...nr})}static setEventQueueConfig(e){c(()=>{this.eventQueueConfig={...Xi,...e}},void 0)}static getEventQueueConfig(){return c(()=>({...this.eventQueueConfig}),{...Xi})}static setTelemetryConfig(e){c(()=>{this.telemetryConfig={...Ji,...e}},void 0)}static getTelemetryConfig(){return c(()=>({...this.telemetryConfig}),{...Ji})}static setClickTrackingConfig(e){c(()=>{let t={...Zi};if(e&&e.trackInertClicks!==void 0&&(t.trackInertClicks=e.trackInertClicks===!0),e&&e.inertClickSamplingRate!==void 0){let i=e.inertClickSamplingRate;!Number.isFinite(i)||i<0||i>1||(t.inertClickSamplingRate=i)}e&&e.internalHosts!==void 0&&(t.internalHosts=this.normalizeKeyList(e.internalHosts).map(i=>i.toLowerCase())),this.clickTrackingConfig=t},void 0)}static getClickTrackingConfig(){return c(()=>({...this.clickTrackingConfig}),{...Zi})}static setContentReadinessConfig(e){c(()=>{this.contentReadinessConfig={...er,...e}},void 0)}static getContentReadinessConfig(){return c(()=>({...this.contentReadinessConfig}),{...er})}static setLinkStatsConfig(e){c(()=>{this.linkStatsConfig=jo(e)},void 0)}static getLinkStatsConfig(){return c(()=>({...this.linkStatsConfig}),{...be})}static setConsentConfig(e){c(()=>{this.consentConfig={...this.consentConfig,...e}},void 0)}static setSpaNavigationConfig(e){c(()=>{let t={...ir};e&&e.treatReplaceStateAsNavigation!==void 0&&(t.treatReplaceStateAsNavigation=e.treatReplaceStateAsNavigation===!0),this.spaNavigationConfig=t},void 0)}static getConsentConfig(){return c(()=>({...this.consentConfig}),{...qo})}static getSpaNavigationConfig(){return c(()=>({...this.spaNavigationConfig}),{...ir})}static setAutoContextConfig(e){c(()=>{let t={...tr};if(e&&e.enabled!==void 0&&(t.enabled=e.enabled),e&&e.articleDetection!==void 0&&(t.articleDetection=e.articleDetection),e&&e.articlePaths!==void 0&&(t.articlePaths=Array.isArray(e.articlePaths)?[...e.articlePaths]:[]),e&&e.wordCount!==void 0&&(t.wordCount=e.wordCount),e&&e.dataLayerMapping!==void 0){let i=e.dataLayerMapping;i&&typeof i=="object"&&(t.dataLayerMapping={variableName:typeof i.variableName=="string"&&i.variableName.trim()!==""?i.variableName:Gl,fields:i.fields&&typeof i.fields=="object"?{...i.fields}:{}})}e&&e.profile!==void 0&&e.profile&&typeof e.profile=="object"&&(t.profile={...e.profile}),e&&e.pageClasses!==void 0&&(t.pageClasses=this.sanitizePageClasses(e.pageClasses)),this.autoContextConfig=t},void 0)}static getAutoContextConfig(){return c(()=>({...this.autoContextConfig}),{...tr})}static sanitizePageClasses(e){return c(()=>{if(!e||typeof e!="object"||Array.isArray(e))return;let t={};for(let[i,r]of Object.entries(e)){if(!r||typeof r!="object"||Array.isArray(r))continue;let o={},{hosts:s,paths:a}=r;Array.isArray(s)&&(o.hosts=[...s]),Array.isArray(a)&&(o.paths=[...a]),t[i]=o}return t},void 0)}static validateEncryptionConfig(){c(()=>{let{enableEncryption:e,publicKey:t,encryptionKeys:i}=this.config;if(i!==void 0){if(!Array.isArray(i))return;i.forEach((o,s)=>{typeof o!="string"||o.trim()===""||this.hasInvalidFieldPathCharacters(o)})}t!==void 0&&t!==""&&this.isValidPEMFormat(t),e===!0&&(!t||t.trim());let r=Array.isArray(i)&&i.some(o=>typeof o=="string"&&o.trim()!=="")},void 0)}static isValidPEMFormat(e){return c(()=>{let t=e.trim();return t.includes("-----BEGIN")&&t.includes("-----END")},!1)}static hasInvalidFieldPathCharacters(e){return c(()=>!/^[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)*$/.test(e),!1)}static getEncryptionConfig(){return c(()=>{let{enableEncryption:e,encryptionKeys:t,publicKey:i}=this.config;return{enabled:e===!0,keys:Array.isArray(t)?t.filter(r=>typeof r=="string"&&r.trim()!==""):[],publicKey:i&&i.trim()!==""?i:void 0}},{enabled:!1,keys:[],publicKey:void 0})}};d.config={organisation_name:"",publication_name:"",publication_id:"",api_base_url:"",bff_base_url:"",api_key:"",loggingEnabled:!1,sdk_health_enabled:!1,preload:!0},d.pageLeaveConfig={...Qi},d.heartbeatConfig={...bn},d.abTestingConfig={...nr},d.eventQueueConfig={...Xi},d.telemetryConfig={...Ji},d.clickTrackingConfig={...Zi},d.contentReadinessConfig={...er},d.linkStatsConfig={...be},d.consentConfig={...qo},d.spaNavigationConfig={...ir},d.autoContextConfig={...tr},d.disable_config={DisableOption:!1}});var ql,Oe,Cn=p(()=>{"use strict";ql={page_title:"",article_section:"",article_section_uuid:"",article_title:"",author_uuid:"",author_name:"",article_url:"",article_uuid:"",article_publication_date:"",article_is_premium:"",additional_info:{}
1,article_concept_uuid:"",article_concept_name:"",article_publication:"",article_content:""},Oe=ql});function $l(n){if(typeof n!="string")return null;let e=n.trim();if(e==="")return null;let t=Math.min(e.indexOf("?")===-1?e.length:e.indexOf("?"),e.indexOf("#")===-1?e.length:e.indexOf("#"));return e=e.slice(0,t),e===""?null:e.startsWith("/")?e:`/${e}`}function Yo(n){if(typeof n!="string")return null;let e=n.trim();if(e===""||e.length>Wl)return null;let t=e.endsWith("*")?e.slice(0,-1):e;return t.includes("*")||t===""?null:t.startsWith("/")?t:`/${t}`}function Yl(n,e){if(!n.startsWith(e))return!1;if(e.endsWith("/"))return!0;let t=n.charAt(e.length);return t===""||t==="/"}function Ot(n,e){return c(()=>{if(!Array.isArray(e)||e.length===0)return!1;let t=$l(n);if(t===null)return!1;for(let i of e.slice(0,$o)){let r=Yo(i);if(r!==null&&Yl(t,r))return!0}return!1},!1)}function gt(n){return c(()=>Array.isArray(n)?n.slice(0,$o).some(e=>Yo(e)!==null):!1,!1)}var $o,Wl,_n=p(()=>{"use strict";m();$o=50,Wl=256});function En(n,e){let t=(n||"").toLowerCase();return t?e.some(i=>i.startsWith(".")?t===i.slice(1)||t.endsWith(i):t===i):!1}var rr=p(()=>{"use strict"});function Ft(n){return!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(n)&&!n.startsWith("//")}function or(n){for(let t of Ql)if(n.has(t))return!0;let e=n.get("error");return!!(e!==null&&Xl.has(e))}function sr(n){return or(n)||n.has("code")&&n.has("state")}function Qo(n){return typeof n!="string"||n.indexOf("?")===-1?null:new URL(n,Ft(n)?Ut:void 0).searchParams}function ar(n){return c(()=>{let e=Qo(n);return e!==null&&or(e)},!1)}function Xo(n){return c(()=>{let e=Qo(n);return e!==null&&sr(e)&&!or(e)},!1)}var Ql,Xl,Ut,cr=p(()=>{"use strict";m();Ql=["access_token","id_token","id_token_hint","refresh_token","code_verifier","code_challenge","client_secret","session_state","error_description","error_uri","response_type","grant_type","token_type","redirect_uri"],Xl=new Set(["invalid_request","unauthorized_client","access_denied","unsupported_response_type","invali
1d_scope","server_error","temporarily_unavailable","interaction_required","login_required","account_selection_required","consent_required","invalid_request_uri","invalid_request_object","request_not_supported","request_uri_not_supported","registration_not_supported"]),Ut="http://relative.invalid"});function Zo(){try{let n=window;return n[Jo]===!0?!1:(n[Jo]=!0,!0)}catch{return!0}}function dr(n){try{n()}catch{}}function wn(n){if(Bt){dr(n);return}lr.push(n)}function es(n=ur,e){Bt||mt!==null||(mt=setTimeout(()=>{mt=null,e&&dr(e),fr("grace period elapsed without init()")},n))}function fr(n){if(Bt)return;Bt=!0,mt!==null&&(clearTimeout(mt),mt=null);let e=lr;lr=[],e.length>0;for(let t of e)dr(t)}function Sn(){return Bt}var Jo,ur,Bt,lr,mt,An=p(()=>{"use strict";Jo="__navigaAnalyticsInstalled";ur=250,Bt=!1,lr=[],mt=null});function tu(){return c(()=>{var e;if(typeof performance=="undefined"||typeof performance.getEntriesByType!="function")return null;let n=performance.getEntriesByType("navigation");return!Array.isArray(n)||n.length===0?null:(e=n[0])!=null?e:null},null)}function nu(n){return c(()=>{let e=n.name;return typeof e!="string"||e===""||typeof window=="undefined"||!window.location?!1:new URL(e).pathname===window.location.pathname},!1)}function iu(){return c(()=>{let n=tu();if(n===null||!nu(n))return null;let e=n.responseStatus;return typeof e!="number"||!Number.isFinite(e)?null:e>=Jl&&e<=Zl?e:null},null)}function ru(){return c(()=>{if(typeof document=="undefined"||!document.body)return!1;let n=document.body.classList;return!n||typeof n.contains!="function"?!1:eu.some(e=>n.contains(e))},!1)}function ts(){return c(()=>iu()!==null||ru(),!1)}var Jl,Zl,eu,ns=p(()=>{"use strict";m();Jl=400,Zl=599,eu=["error404","error-404","error_404"]});function is(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&e.trim()!==""):[]}function su(n,e){if(!n)return!1;let t=n.toLowerCase();return is(e).some(i=>i.toLowerCase()===t)}function rs(n){return c(()=>{if(!n||typeof n!="object")return!1;let{hosts:e,paths:t}=n;return is(e).length>0||gt(t)},!1)}function ss(n){return c(()=>new URL(n,Ft(n)?Ut:void 0),null)}function au(){return c(()=>{if(typeof performance=="undefined"||typeof performance.getEntriesByType!="function")return null;let n=performance.getEntriesByType("navigation"),e=Array.isArray(n)&&n.length>0?n[0].name:"";return typeof e!="string"||e.trim()===""||ss(e)===null?null:e},null)}function as(){var n;kn===null&&(kn=(n=au())!=null?n:c(()=>typeof window!="undefined"?window.location.href:"",""))}function pr(){return!os&&kn?kn:null}function cu(){var e,t;let n=pr();return n===null?null:(t=(e=ss(n))==null?void 0:e.pathname)!=null?t:null}function cs(){return c(()=>{let n=pr();return n===null?null:Xo(n)?lu:null},null)}var Vt,ou,kn,os,J,lu,ht=p(()=>{"use strict";w();rr();cr();m();An();ns();_n();Vt=["transit","commerce","content"],ou=new Set(["content","commerce","transit","error","unknown"]);kn=null,os=!1;J=class{static resolve(){if(this.decision)return{...this.decision};let e=c(()=>this.classify(),{pageClass:"unknown",source:"default"});return(this.apiOverride!==null||Sn())&&(this.decision=e),{...e}}static setPageClass(e){c(()=>{if(ou.has(e)&&(this.apiOverride=e,this.decision)){let t=this.decision;this.decision={pageClass:e,source:"api"};return}},void 0)}static reset(){this.decision=null,this.apiOverride=null,os=!0}static isDecided(){return this.decision!==null}static classify(){if(this.apiOverride)return{pageClass:this.apiOverride,source:"api"};if(ts())return{pageClass:"error",source:"heuristic"};let e=this.resolveFromConfig();if(e)return{pageClass:e,source:"config"};let t=this.resolveFromHeuristic();return t?{pageClass:t,source:"heuristic"}:{pageClass:"unknown",source:"default"}}static resolveFromConfig(){var e,t;return(t=(e=this.resolveDeclaredPageClass())!=null?e:this.resolveFromConfigPatterns())!=null?t:this.resolveFromLinkerHosts()}static resolveDeclaredPageClass(){let e=d.getValue("pageClass");return typeof e=="string"&&Vt.includes(e)?e:null}static resolveFromConfigPatterns(){var s;let e=d.getAutoContextConfig().pageClasses;if(!e||typeof e!="object")return null;let t=c(()=>window.location.pathname,""),i=c(()=>window.location.hostname,""),r=cu(),o=r!==null&&r!==t?r:null;for(let a of Vt){let l=e[a];if(!l||typeof l!="object")continue;let u=(s=l.paths)!=null?s:[];if(su(i,l.hosts)||Ot(t,u)||o!==null&&Ot(o,u))return a}return null}static resolveFromLinkerHosts(){let e=d.getCrossDomainLinkerHosts();if(e.length===0)return null;let t=c(()=>window.location.hostname,"");return En(t,e)?"commerce":null}static resolveFromHeuristic(){let e=c(()=>window.location.href,"");if(e&&ar(e))return"transit";let t=pr();return t!==null&&ar(t)?"transit":null}};J.decision=null,J.apiOverride=null;lu="oauth_url_shape"});var $,Je=p(()=>{$={SDK_VERSION:"1.8.0",API_BASE_URL:"",Session:{session_key:"naviga-analytics-session",timeout_ms:18e5},DeviceId:{storage_key:"naviga-analytics-device-id"},ARTICLE_READING_SPEED_WPM:225,Heartbeat:{enabled:!0,ping_interval_seconds:15,send_on_visibility_change:!0,min_active_time_for_visibility_ping:3,visibility_debounce_ms:1e3,enable_spa_tracking:!1}}});var Ce,Tn=p(()=>{"use strict";m();Ce=class{constructor(e,t){this.loadPromise=null;this.loader=e,this.errorDetails=t}async get(){return this.loadPromise||(this.loadPromise=b(this.loader,this.errorDetails)),this.loadPromise}isLoaded(){return this.loadPromise!==null}preload(){this.loadPromise||(this.loadPromise=b(this.loader,this.errorDetails))}}});function ps(n){return hu.replace(/[xy]/g,e=>{let t=n();return(e==="x"?t:t&3|8).toString(16)})}function Ue(){if(typeof crypto!="undefined"&&crypto&&typeof crypto.randomUUID=="function")try{return crypto.randomUUID()}catch{}if(typeof crypto!="undefined"&&crypto&&typeof crypto.getRandomValues=="function")try{return ps(()=>crypto.getRandomValues(new Uint8Array(1))[0]%16)}catch{}return ps(()=>Math.random()*16|0)}var hu,Kt=p(()=>{"use strict";hu="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"});var zt,jt,Gt,gs,qt=p(()=>{"use strict";zt="ab_experiment_view",jt="ab_experiment_click",Gt="ab_experiment_qualified_click",gs="session"});function Y(n){return n===gr}function vt(n,e){return e&&Object.prototype.hasOwnProperty.call(e,n)&&e[n].length>0?[...e[n]]:Object.prototype.hasOwnProperty.call(ms,n)?[...ms[n]]:[...vu]}function hs(n){return typeof n!="number"||!Number.isInteger(n)?!1:yu.indexOf(n)!==-1}var z,gr,vu,ms,Rn,yu,_e=p(()=>{"use strict";qt();z=["necessary","functional","analytics","marketing"],gr="necessary";vu=["analytics"],ms={page_view:["analytics"],page_leave:["analytics"],engagement_ping:["analytics"],click:["analytics"],sdk_health:["necessary"],content_readiness:["functional"],identify:["functional","analytics"],[zt]:["functional","analytics"],[jt]:["functional","analytics"],[Gt]:["functional","analytics"]};Rn={1:"functional",2:"marketing",3:"marketing",4:"marketing",5:"marketing",6:"marketing",7:"analytics",8:"analytics",9:"analytics",10:"analytics",11:"functional"},yu=[2,7,8,9,10,11]});function mr(n,e,t){let i={},r={};for(let s of z){let a=t?t[s]:void 0;i[s]=vs(a)?a:"unknown",r[s]=Number.NEGATIVE_INFINITY}let o=Array.isArray(n)?n:[];for(let s of o){if(!s||typeof s!="object")continue;let{snapshot:a,precedence:l,regions:u}=s;if(!a||typeof a!="object"||a.regionApplies===!1||!hr(u,e))continue;let f=a.categories;if(!f||typeof f!="object")continue;let g=typeof l=="number"&&Number.isFinite(l)?l:0;for(let v of z){let y=f[v];vs(y)&&g>r[v]&&(i[v]=y,r[v]=g)}}return i[gr]="granted",i}function hr(n,e){return!Array.isArray(n)||n.length===0?!0:n.some(t=>t===e||t==="GLOBAL")}function vs(n){return n==="granted"||n==="denied"||n==="unknown"}var ys=p(()=>{"use strict";_e()});function vr(){let n={};for(let e of z)n[e]="unknown";return n}
1var S,Ze=p(()=>{"use strict";m();w();ys();_e();S=class{static register(e){c(()=>{if(!e||typeof e.id!="string")return;let t=this.providers.get(e.id),i=t?t.snapshot:null;t&&t.provider!==e&&(this.providers.delete(e.id),c(()=>t.provider.teardown(),void 0)),this.providers.set(e.id,{provider:e,snapshot:i});let r=o=>{c(()=>{var l,u;let s=this.providers.get(e.id);if(!s)return;let a=(u=(l=s.snapshot)==null?void 0:l.categories)!=null?u:{};s.snapshot={...o,categories:{...a,...o.categories}},this.recompute()},void 0)};c(()=>{let o=e.init(r);o&&typeof o.catch=="function"&&o.catch(s=>{})},void 0)},void 0)}static refresh(){return this.recompute()}static getState(){return c(()=>(this.state||this.recompute(),this.state?{...this.state}:vr()),this.state?{...this.state}:vr())}static hasAnySignal(){return c(()=>{for(let e of this.providers.values())if(e.snapshot)return!0;return!1},!1)}static hasDecisionFor(e){return c(()=>{if(Y(e))return!0;let t=this.getState()[e];return t==="granted"||t==="denied"},!1)}static assertedCategories(){return c(()=>{let e=mr(this.resolvableSnapshots(),this.resolveActiveRegion(),{}),t=new Set;for(let i of z){if(Y(i))continue;let r=e[i];(r==="granted"||r==="denied")&&t.add(i)}return t},new Set)}static getStampState(){return c(()=>{let e=this.getState(),t=[];for(let i of this.providers.values())i.snapshot&&t.push(i.provider.id);return{...e,_src:t,_region:this.resolveActiveRegion()}},{...vr(),_src:[],_region:"GLOBAL"})}static onChange(e){return c(()=>(this.listeners.add(e),()=>{this.listeners.delete(e)}),()=>{})}static resolvableSnapshots(){let e=[];for(let t of this.providers.values())t.snapshot&&e.push({snapshot:t.snapshot,precedence:t.provider.precedence,regions:t.provider.regions});return e}static recompute(){return c(()=>{let e=this.resolveActiveRegion(),t=this.resolvableSnapshots();for(let a of this.providers.values())this.warnIfRegionExcluded(a,e);let i=d.getConsentConfig(),r=i.defaults&&i.defaults[e]||{},o=mr(t,e,r),s=!this.state||!this.statesEqual(this.state,o);return this.state=o,s&&this.notify(o),s},!1)}static warnIfRegionExcluded(e,t){if(!e.snapshot||hr(e.provider.regions,t))return;let i=Array.isArray(e.provider.regions)?e.provider.regions.join(", "):""}static resolveActiveRegion(){return c(()=>{let e=d.getConsentConfig().region;if(typeof e=="function"){let t=e();return typeof t=="string"&&t?t:"GLOBAL"}return typeof e=="string"&&e?e:"GLOBAL"},"GLOBAL")}static notify(e){for(let t of this.listeners)c(()=>t({...e}),void 0)}static statesEqual(e,t){for(let i of z)if(e[i]!==t[i])return!1;return!0}static reset(){c(()=>{let e=Array.from(this.providers.values());this.providers.clear(),this.listeners.clear(),this.state=null;for(let t of e)c(()=>t.provider.teardown(),void 0)},void 0)}static teardown(){this.reset()}};S.providers=new Map,S.state=null,S.listeners=new Set});var bu,xn,Cu,Fe,yr=p(()=>{"use strict";bu="naviga_analytics_v1",xn="event_queue",Cu=1,Fe=class{constructor(){this.db=null}static isSupported(){return typeof indexedDB!="undefined"}async open(){if(!this.db)return new Promise((e,t)=>{let i=indexedDB.open(bu,Cu);i.onupgradeneeded=()=>{let r=i.result;r.objectStoreNames.contains(xn)||r.createObjectStore(xn,{keyPath:"id",autoIncrement:!0})},i.onsuccess=()=>{this.db=i.result,e()},i.onerror=()=>t(i.error||new Error("IDB open failed")),i.onblocked=()=>t(new Error("IDB open blocked by another tab"))})}async tx(e,t){return await this.open(),new Promise((i,r)=>{let o=this.db.transaction(xn,e),s=o.objectStore(xn),a=t(s);a.onsuccess=()=>i(a.result),a.onerror=()=>r(a.error),o.onabort=()=>r(o.error||new Error("IDB transaction aborted")),o.onerror=()=>r(o.error||new Error("IDB transaction failed"))})}async add(e){return await this.tx("readwrite",i=>i.add(e))}async update(e){await this.tx("readwrite",t=>t.put(e))}async getAll(){return await this.tx("readonly",e=>e.getAll())}async remove(e){await this.tx("readwrite",t=>t.delete(e))}async count(){return await this.tx("readonly",e=>e.count())}async clear(){await this.tx("readwrite",e=>e.clear())}}});function bs(n){return{get(e){return c(()=>n().getItem(e),null)},set(e,t,i){c(()=>{n().setItem(e,t)},void 0)},remove(e){c(()=>{n().removeItem(e)},void 0)},keys(){return c(()=>Object.keys(n()),[])}}}function wu(n){if(typeof document=="undefined"||!document.cookie)return null;let e=encodeURIComponent(n)+"=",t=document.cookie.split(";");for(let i of t){let r=i.trim();if(r.startsWith(e))return decodeURIComponent(r.substring(e.length))}return null}function Cr(n){return encodeURIComponent(n)}function Su(n,e,t){if(typeof document=="undefined")return;let i=typeof location!="undefined"&&location.protocol==="https:",r=(t==null?void 0:t.domain)===null?void 0:(t==null?void 0:t.domain)||d.getABConfig().cookieDomain,o=`${encodeURIComponent(n)}=${Cr(e)}; path=/; SameSite=Lax`;r&&(o+=`; Domain=${r}`),i&&(o+="; Secure"),t!=null&&t.days&&t.days>0&&(o+=`; Max-Age=${Math.floor(t.days*86400)}`),document.cookie=o}function Au(){return typeof document=="undefined"||!document.cookie?[]:document.cookie.split(";").map(n=>n.trim()).filter(n=>n.length>0).map(n=>{let e=n.indexOf("="),t=e===-1?n:n.substring(0,e);return c(()=>decodeURIComponent(t),t)})}function ku(n){if(typeof document=="undefined")return;let e=d.getABConfig().cookieDomain,t=e?`; Domain=${e}`:"";document.cookie=`${encodeURIComponent(n)}=; path=/${t}; Max-Age=0; SameSite=Lax`}function Cs(n){br=n}function Wt(n){return xu[n]}var _u,Eu,Tu,br,Ru,xu,Pn=p(()=>{"use strict";m();w();
1yr();_u=bs(()=>localStorage),Eu=bs(()=>sessionStorage);Tu={get(n){return c(()=>wu(n),null)},set(n,e,t){c(()=>Su(n,e,t),void 0)},remove(n){c(()=>ku(n),void 0)},keys(){return c(()=>Au(),[])}},br=null;Ru={get(){return null},set(n,e,t){},remove(){if(br){try{let n=br();n&&typeof n.catch=="function"&&n.catch(e=>{})}catch{}return}if(Fe.isSupported())try{new Fe().clear().catch(n=>{})}catch{}},keys(){return[]}},xu={local:_u,session:Eu,cookie:Tu,idb:Ru}});function Lu(){try{return typeof process!="undefined"&&!!process.env&&!1}catch{return!1}}function Du(n){let e=d.getABConfig(),t=e.cookieName||"naviga_ab_session";if(n===t||n===`${t}_exp`)return{category:"necessary",store:"cookie"};let i=e.variantCookiePrefix||"naviga_ab_variant_";return n.startsWith(i)?{category:"functional",store:"cookie",prefix:!0}:null}function _r(n){if(Object.prototype.hasOwnProperty.call(yt,n))return yt[n];for(let e of Object.keys(yt)){let t=yt[e];if(t.prefix&&n.startsWith(e))return t}return Du(n)}function _s(n){return Y(n)||d.getConsentConfig().enabled!==!0?!0:S.getState()[n]==="granted"}var Pu,Iu,yt,h,F=p(()=>{"use strict";m();w();Ze();_e();Pn();Je();Pu=$.Session.session_key,Iu=$.DeviceId.storage_key,yt={[Pu]:{category:"analytics",store:"local"},[Iu]:{category:"analytics",store:"local"},"naviga-analytics-user-identity":{category:"functional",store:"local"},"naviga-analytics-last-page-view":{category:"analytics",store:"session"},"naviga-analytics-utm-session":{category:"analytics",store:"session"},"naviga-analytics-utm-first":{category:"analytics",store:"local"},naviga_visitor_seen:{category:"analytics",store:"local"},anonDeviceId:{category:"analytics",store:"cookie"},auth0_sub:{category:"analytics",store:"cookie"},"naviga-analytics-journey-session":{category:"analytics",store:"session"},naviga_ab_qualified_click_queue:{category:"analytics",store:"session"},naviga_ab_variant_:{category:"functional",store:"cookie",prefix:!0},"naviga-cr-audit:":{category:"functional",store:"local",prefix:!0},"naviga-cr-lock:":{category:"functional",store:"local",prefix:!0},"naviga-consent-record":{category:"necessary",store:"cookie"},naviga_ab_session:{category:"necessary",store:"cookie"},naviga_ab_session_exp:{category:"necessary",store:"cookie"},naviga_ab_admin:{category:"necessary",store:"local"},naviga_ab_selector_mode:{category:"necessary",store:"local"},naviga_ab_stats_mode:{category:"necessary",store:"local"},naviga_ab_stats_window:{category:"necessary",store:"local"},naviga_analytics_v1:{category:"analytics",store:"idb"}};h=class{static handleUnregistered(e){if(Lu())throw new Error(`[ConsentedStorage] Unregistered key "${e}" \u2014 add it to KEY_REGISTRY before use.`)}static get(e){let t=_r(e);return t?c(()=>_s(t.category)?Wt(t.store).get(e):null,null):(this.handleUnregistered(e),null)}static set(e,t,i){let r=_r(e);if(!r){this.handleUnregistered(e);return}c(()=>{_s(r.category)&&Wt(r.store).set(e,t,i)},void 0)}static remove(e){let t=_r(e);if(!t){this.handleUnregistered(e);return}c(()=>{Wt(t.store).remove(e)},void 0)}static purgeUnconsented(e){c(()=>{for(let t of Object.keys(yt)){let i=yt[t];if(Y(i.category)||e[i.category]==="granted")continue;let r=Wt(i.store);c(()=>{r.remove(t)},void 0),i.prefix&&c(()=>{for(let o of r.keys())o.startsWith(t)&&r.remove(o)},void 0)}},void 0)}}});var et,Es,ue,ws=p(()=>{"use strict";m();k();Kt();Je();F();et=$.DeviceId.storage_key,Es="anonymous-"+Math.random().toString(36).substring(2,15),ue=class{static getPersistentUUID(){return E(()=>{let e=h.get(et);return e||(e=Ue(),h.set(et,e)),e},{message:"Failed to get persistent UUID",severity:"high",source:"UUIDDeviceIdentifier.getPersistentUUID"}).unwrapOr(Es)}static getCurrentDeviceId(){return E(()=>h.get(et),{message:"Failed to get current device ID",severity:"low",source:"UUIDDeviceIdentifier.getCurrentDeviceId"}).unwrapOr(null)}static hasStoredDeviceId(){return E(()=>{let e=h.get(et);return e!=null},{message:"Failed to check stored device ID",severity:"low",source:"UUIDDeviceIdentifier.hasStoredDeviceId"}).unwrapOr(!1)}static clearDeviceId(){E(()=>{h.remove(et)},{message:"Failed to clear device ID",severity:"low",source:"UUIDDeviceIdentifier.clearDeviceId"})}static regenerateDeviceId(){return this.clearDeviceId(),this.getPersistentUUID()}static getDeviceIdStats(){return E(()=>{let e=this.getCurrentDeviceId(),t=this.hasStoredDeviceId();return{storageKey:et,uuidDeviceId:e?e.substring(0,8)+"...":null,hasStoredUUI
1D:t,fallbackId:Es.substring(0,8)+"..."}},{message:"Failed to get UUID device ID statistics",severity:"low",source:"UUIDDeviceIdentifier.getDeviceIdStats"}).unwrapOr({})}static isValidUUID(e){return E(()=>/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e),{message:"Failed to validate UUID format",severity:"low",source:"UUIDDeviceIdentifier.isValidUUID"}).unwrapOr(!1)}static getStorageKey(){return et}static getUUIDCapabilities(){return E(()=>({hasCryptoRandomUUID:typeof crypto!="undefined"&&typeof crypto.randomUUID=="function",hasCryptoGetRandomValues:typeof crypto!="undefined"&&typeof crypto.getRandomValues=="function",hasLocalStorage:typeof localStorage!="undefined",mathRandomFallback:!0}),{message:"Failed to get UUID capabilities",severity:"low",source:"UUIDDeviceIdentifier.getUUIDCapabilities"}).unwrapOr({hasCryptoRandomUUID:!1,hasCryptoGetRandomValues:!1,hasLocalStorage:!1,mathRandomFallback:!0})}}});function In(n,e){try{return n()}catch{return e}}var Um,Ln,Ss,As,Dn=p(()=>{"use strict";Um=In(()=>"split","single"),Ln=In(()=>"analytics.abtesting.hud.1.8.0.min.js",""),Ss=In(()=>"",""),As=In(()=>!1,!0)});var ks={};M(ks,{load:()=>Mu});function Mu(){return Promise.reject(new Error("fingerprintjs is not bundled in this build (BUNDLE_MODE=split). Rebuild with INCLUDE_FINGERPRINT=1 if a site requires anonymousIdProcessor: 'fingerprint'."))}var Ts=p(()=>{});var Er,Be,Mn=p(()=>{"use strict";m();Tn();w();k();ws();ft();Dn();Er=new Ce(()=>Promise.resolve().then(()=>(Ts(),ks)).then(n=>n.load()),{message:"Failed to load fingerprint library",severity:"high",source:"DeviceIdentifier.loadFingerprint",moduleName:"@fingerprintjs/fingerprintjs"}),Be=class{static async getVisitorId(){return await b(async()=>d.get().anonymousIdProcessor==="fingerprint"?As?await this.getFingerprintId():(K.report({message:"Site config requests anonymousIdProcessor 'fingerprint' but fingerprintjs is not bundled in this build \u2014 falling back to persistent UUID, which changes this site's device_id strategy. Rebuild with INCLUDE_FINGERPRINT=1.",severity:"high",source:"DeviceIdentifier.fingerprintNotBundled"}),ue.getPersistentUUID()):ue.getPersistentUUID(),{message:"Failed to generate visitor ID",severity:"high",source:"DeviceIdentifier.getVisitorId",fallbackUsed:!0})}static async getFingerprintId(){try{let e=await Er.get();if(!e.success)return ue.getPersistentUUID();let t=e.value;return t?(await t.get()).visitorId:ue.getPersistentUUID()}catch{return ue.getPersistentUUID()}}static getCurrentDeviceId(){return E(()=>d.get().anonymousIdProcessor==="fingerprint"?null:ue.getCurrentDeviceId(),{message:"Failed to get current device ID",severity:"low",source:"DeviceIdentifier.getCurrentDeviceId"}).unwrapOr(null)}static hasStoredDeviceId(){return E(()=>d.get().anonymousIdProcessor==="fingerprint"?!1:ue.hasStoredDeviceId(),{message:"Failed to check stored device ID",severity:"low",source:"DeviceIdentifier.hasStoredDeviceId"}).unwrapOr(!1)}static getDeviceIdType(){return E(()=>{let t=d.get().anonymousIdProcessor;return t==="fingerprint"?"fingerprint":"uuid"},{message:"Failed to get device ID type",severity:"low",source:"DeviceIdentifier.getDeviceIdType"}).unwrapOr("unknown")}static getDeviceIdStats(){return E(()=>{let e=this.getCurrentDeviceId(),t=this.hasStoredDeviceId(),i=this.getDeviceIdType(),r={currentDeviceId:e?e.substring(0,8)+"...":null,hasStoredId:t,idType:i,fingerprintLoaded:Er.isLoaded()};return i==="uuid"?{...r,...ue.getDeviceIdStats()}:r},{message:"Failed to get device ID statistics",severity:"low",source:"DeviceIdentifier.getDeviceIdStats"}).unwrapOr({})}static preload(){d.get().anonymousIdProcessor==="fingerprint"&&Er.preload()}}});var Nn,On,Rs,de,$t=p(()=>{"use strict";k();m();Tn();pt();On={detectPlatformType(){let n=navigator.userAgent.toLowerCase(),e=/ipad|android(?!.*mobile)|tablet|kindle|playbook/.test(n)||navigator.maxTouchPoints>1&&screen.width>=768&&screen.width<=1024;return/iphone|ipod|android.*mobile|blackberry|phone/.test(n)||navigator.maxTouchPoints>1&&screen.width<768?"mobile":e?"tablet":"desktop"},isIOSSafari(){let n=navigator.userAgent,e=/iPad|iPhone|iPod/.test(n),t=/Safari/.test(n)&&!/Chrome|CriOS|FxiOS|EdgiOS/.test(n);return e&&t},isIOS(){return/iPad|iPhone|iPod/.test(navigator.userAgent)},isDesktop(){return this.detectPlatformType()==="desktop"},detectPlatformModel(){let n=navigator.userAgent,e=[{pattern:/Edg\//i,name:"Edge"},{pattern:/Edge\//i,name:"Edge"},{pattern:/Arc\//i,name:"Arc"},{pattern:/Atlas\//i,name:"Atlas"},{pattern:/Comet\//i,name:"Comet"},{pattern:/Brave\//i,name:"Brave"},{pattern:/Vivaldi\//i,name:"Vivaldi"},{pattern:/OPR\//i,name:"Opera"},{pattern:/Opera/i,name:"Opera"},{pattern:/SamsungBrowser\//i,name:"Samsung Internet"},{pattern:/UCBrowser\//i,name:"UC Browser"},{pattern:/DuckDuckGo\//i,name:"DuckDuckGo"},{pattern:/Yandex\//i,name:"Yandex"},{pattern:/Chrome\//i,name:"Chrome"},{pattern:/Firefox\//i,name:"Firefox"},{pattern:/Safari\//i,name:"Safari"}];for(let{pattern:t,name:i}of e)if(t.test(n))return i;return"unknown"},detectPlatformVersion(){let n=navigator.userAgent,e=[{pattern:/Edg\/([\d.]+)/,name:"Edge"},{pattern:/Edge\/([\d.]+)/,name:"Edge"},{pattern:/Arc\/([\d.]+)/,name:"Arc"},{pattern:/Atlas\/([\d.]+)/,name:"Atlas"},{pattern:/Comet\/([\d.]+)/,name:"Comet"},{pattern:/Brave\/([\d.]+)/,name:"Brave"},{pattern:/Vivaldi\/([\d.]+)/,name:"Vivaldi"},{pattern:/OPR\/([\d.]+)/,name:"Opera"},{pattern:/Opera\/([\d.]+)/,name:"Opera"},{pattern:/SamsungBrowser\/([\d.]+)/,name:"Samsung Internet"},{pattern:/UCBrowser\/([\d.]+)/,name:"UC Browser"},{pattern:/DuckDuckGo\/([\d.]+)/,name:"DuckDuckGo"},{pattern:/Yandex\/([\d.]+)/,name:"Yandex"},{pattern:/Chrome\/([\d.]+)/,name:"Chrome"},{pattern:/Version\/([\d.]+)/,name:"Safari"},{pattern:/Firefox\/([\d.]+)/,name:"Firefox"}];for(let{pattern:t}of e){let i=n.match(t);if(i)return i[1]}return"unknown"},detectPlatformOS(){if(typeof navigator=="undefined")return"unknown";let n=navigator.userAgent;return/Android/i.test(n)?/Mobile/i.test(n)?"Android Phone":"Android Tablet":/iPhone|iPod/i.test(n)?"iOS Phone":/iPad/i.test(n)?"iOS Tablet":/Win|Windows/i.test(n)?"Windows":/Mac/i.test(n)&&!/iPhone|iPod|iPad/i.test(n)?"macOS":/CrOS/i.test(n)?"ChromeOS":/Linux/i.test(n)&&!/Android/i.test(n)?"Linux":"unknown"}},Rs=new Ce(async()=>On,{message:"Failed to load platform detection",severity:"medium",s
1ource:"PlatformDetector.load",moduleName:"PlatformDetection"}),de=class{static async getPlatformInfo(){return Nn?W(Nn):await b(async()=>{let e=await Rs.get();if(!e.success)throw new Error("Failed to load platform detection module");let t=e.value;return Nn={type:t.detectPlatformType(),model:t.detectPlatformModel(),version:t.detectPlatformVersion(),os:t.detectPlatformOS()},Nn},{message:"Failed to detect platform information",severity:"medium",source:"PlatformDetector.getPlatformInfo"})}static preload(){Rs.preload()}static isIOSSafari(){return typeof navigator=="undefined"?!1:On.isIOSSafari()}static isIOS(){return typeof navigator=="undefined"?!1:On.isIOS()}static isDesktop(){return typeof navigator=="undefined"?!1:On.isDesktop()}}});var wr,Ve,xs=p(()=>{"use strict";F();wr="naviga-analytics-user-identity",Ve=class{static set(e,t){if(!(typeof e!="string"||e.length===0)&&typeof localStorage!="undefined")try{let i={userId:e,traits:t&&typeof t=="object"?t:void 0,identifiedAt:Date.now()};h.set(wr,JSON.stringify(i))}catch{}}static clear(){typeof localStorage!="undefined"&&h.remove(wr)}static getUserId(){var e,t;return(t=(e=this.read())==null?void 0:e.userId)!=null?t:null}static getTraits(){var e,t;return(t=(e=this.read())==null?void 0:e.traits)!=null?t:null}static hasIdentity(){return this.read()!==null}static identifiedAt(){var e,t;return(t=(e=this.read())==null?void 0:e.identifiedAt)!=null?t:null}static read(){if(typeof localStorage=="undefined")return null;try{let e=h.get(wr);if(!e)return null;let t=JSON.parse(e);return typeof(t==null?void 0:t.userId)!="string"||t.userId.length===0?null:t}catch{return null}}}});var se,Sr=p(()=>{"use strict";xs();Ze();se=class{static hold(e,t){this.held={userId:e,traits:t,persisted:!1},this.ensureSubscribed(),this.tryPersist()}static getUserId(){return this.held?this.held.userId:Ve.getUserId()}static getTraits(){var e;return this.held?(e=this.held.traits)!=null?e:null:Ve.getTraits()}static clear(){this.held=null,Ve.clear()}static reset(){this.held=null,this.unsubscribe&&this.unsubscribe(),this.unsubscribe=null}static ensureSubscribed(){this.unsubscribe||(this.unsubscribe=S.onChange(e=>{this.held&&this.held.persisted&&e.functional!=="granted"&&(this.held.persisted=!1),this.tryPersist()}))}static tryPersist(){if(!(!this.held||this.held.persisted||this.persisting)){this.persisting=!0;try{let{userId:e,traits:t}=this.held;Ve.set(e,t),this.held&&Ve.getUserId()===e&&(this.held.persisted=!0)}finally{this.persisting=!1}}}};se.held=null,se.unsubscribe=null,se.persisting=!1});var He,Yt=p(()=>{"use strict";He={explicit:100,gpc:75,tcf:50,persisted:10}});function Fu(){try{let n=document.currentScript,e=n&&n.src;if(!e)return"";let t=new URL(e,window.location.href);return`${t.origin}${t.pathname.replace(/[^/]*$/,"")}`}catch{return""}}function Ds(){Hn===null&&(Hn=Fu())}function Ms(){return Hn||""}function Ns(n){if(!n)return"";let e=Hn||""||Ss;return e?`${e.replace(/\/*$/,"/")}${n}`:""}var Hn,Ar=p(()=>{"use strict";Dn();Hn=null});var Bu,Ee,Kn=p(()=>{"use strict";m();Bu=new Set(["granted","metered","blocked"]),Ee=class{static set(e){c(()=>{Bu.has(e)&&(this.access=e)},void 0)}static get(){return this.access}static reset(){this.access=null}};Ee.access=null});var we,Gn=p(()=>{"use strict";m();w();we=class{static merge(e){c(()=>{for(let[t,i]of Object.entries(e))i==null||i===""||(this.context[t]=i)},void 0)}static resolveSubscriptionData(){return c(()=>{if(typeof window=="undefined")return null;let e=window,t=e.Connext||e.CnnXt;if(!t||typeof t.GetAccountData!="function")return null;let i=t.GetAccountData();if(!i||typeof i!="object")return null;let r={};return Array.isArray(i.OwnedSubscriptions)&&i.OwnedSubscriptions.length>0&&(r.engage_subscriptions=i.OwnedSubscriptions),i.MasterId&&(r.engage_master_id=i.MasterId),i.DigitalAccess&&typeof i.DigitalAccess=="object"&&i.DigitalAccess.AccessLevel&&(r.engage_access_level=i.DigitalAccess.AccessLevel),Object.keys(r).length>0?r:null},null)}static getContext(){return c(()=>{var i,r;let e={...this.context},t=this.resolveSubscriptionData();if(t)for(let[o,s]of Object.entries(t))(e[o]===void 0||e[o]===null||e[o]==="")&&(e[o]=s);if(typeof window!="undefined"){let o=(r=(i=d.get())==null?void 0:i.customEvents)==null?void 0:r.commonDetailsMapping,s=o!=null&&o.variableName?d.resolveMappedGlobal(o
1):window.navigaEngageDetails;if(s&&typeof s=="object"&&!Array.isArray(s))for(let[a,l]of Object.entries(s))l==null||l===""||(e[a]===void 0||e[a]===null||e[a]==="")&&(e[a]=l)}return e},{})}static reset(){this.context={}}};we.context={}});var Qn,js,Ke,Xn=p(()=>{"use strict";m();Kt();Je();k();F();Qn=$.Session.session_key,js=$.Session.timeout_ms,Ke=class{static isValidSession(e){return!!(e&&typeof e.id=="string"&&e.id.length>0&&typeof e.timestamp=="number"&&Number.isFinite(e.timestamp))}static getSessionId(){return E(()=>{let e=Date.now(),t=h.get(Qn),i=null;if(t)try{i=JSON.parse(t)}catch{i=null}this.isValidSession(i)||(i=null);let r=!i||e-i.timestamp>js;return!i||r?i={id:Ue(),timestamp:e}:i.timestamp=e,h.set(Qn,JSON.stringify(i)),i.id},{message:"Failed to manage session",severity:"high",source:"SessionStorage.getSessionId"})}static touchSession(){try{let e=h.get(Qn);if(!e)return;let t=JSON.parse(e);if(!this.isValidSession(t))return;let i=Date.now();if(i-t.timestamp>js)return;t.timestamp=i,h.set(Qn,JSON.stringify(t))}catch{}}}});var _t,Gs=p(()=>{"use strict";m();k();_t=class{static async encryptValue(e,t){return await b(async()=>{if(typeof crypto=="undefined"||!crypto.subtle)throw new Error("Web Crypto API not available");let i=await this.importRsaPublicKey(t),r=await this.encryptWithRSA(e,i);return{encryptedValue:this.arrayBufferToBase64(r)}},{message:"Failed to encrypt field value",severity:"high",source:"PayloadEncryption.encryptValue"})}static async encryptWithRSA(e,t){let i=new TextEncoder().encode(e);return await crypto.subtle.encrypt({name:this.RSA_ALGORITHM},t,i)}static async importRsaPublicKey(e){let t=e.replace(/-----BEGIN PUBLIC KEY-----/,"").replace(/-----END PUBLIC KEY-----/,"").replace(/\s/g,""),i=this.base64ToArrayBuffer(t);return await crypto.subtle.importKey("spki",i,{name:this.RSA_ALGORITHM,hash:"SHA-256"},!1,["encrypt"])}static arrayBufferToBase64(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),i="";for(let r=0;r<t.byteLength;r++)i+=String.fromCharCode(t[r]);return btoa(i)}static base64ToArrayBuffer(e){let t=atob(e),i=new Uint8Array(t.length);for(let r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return i.buffer}static isSupported(){return typeof crypto!="undefined"&&typeof crypto.subtle!="undefined"&&typeof crypto.subtle.encrypt=="function"}};_t.RSA_ALGORITHM="RSA-OAEP"});var Et,Lr=p(()=>{"use strict";pt();k();Gs();Et=class{static async preparePayload(e,t){var i;try{if(!t.enabled||!((i=t.keys)!=null&&i.length)||!t.publicKey||!_t.isSupported())return W({data:e,encrypted:!1});let r=await this.encryptFields(e,t.keys,t.publicKey);if(!r.success)return Ne(r.error);let{encryptedData:o,metadata:s}=r.value;if(s.fields.length===0)return W({data:e,encrypted:!1});let a={...o,_encryption:s};return W({data:a,encrypted:!0})}catch(r){let o={message:`Failed to prepare payload: ${r instanceof Error?r.message:String(r)}`,severity:"high",source:"PayloadGenerator.preparePayload",data:{error:r}};return Ne(o)}}static async encryptFields(e,t,i){try{let r={...e},o=[];for(let a of t){let l=this.getFieldValue(r,a);if(l===void 0)continue;let u=typeof l=="string"?l:JSON.stringify(l),f=await _t.encryptValue(u,i);if(!f.success){let v={message:`Failed to encrypt field "${a}": ${f.error.message}`,severity:"high",source:"PayloadGenerator.encryptFields",data:{fieldPath:a,originalError:f.error}};return Ne(v)}let{encryptedValue:g}=f.value;this.setFieldValue(r,a,g),o.push(a)}return o.length===0?W({encryptedData:r,metadata:{fields:[],algorithm:"RSA-OAEP"}}):W({encryptedData:r,metadata:{fields:o,algorithm:"RSA-OAEP"}})}catch(r){let o={message:`Failed to encrypt fields: ${r instanceof Error?r.message:String(r)}`,severity:"high",source:"PayloadGenerator.encryptFields",data:{error:r}};return Ne(o)}}static getFieldValue(e,t){return t.split(".").reduce((i,r)=>i==null?void 0:i[r],e)}static setFieldValue(e,t,i){let r=t.split("."),o=r.pop(),s=e;for(let a of r){let l=s[a];if(!l||typeof l!="object")return;s[a]=Array.isArray(l)?[...l]:{...l},s=s[a]}s[o]=i}}});function Mr(n){let e=new AbortController,t=typeof(n==null?void 0:n.timeoutMs)=="number"&&n.timeoutMs>0?n.timeoutMs:qu,i=setTimeout(()=>e.abort(),t),r=n==null?void 0:n.signal,o=()=>e.abort();return r&&(r.aborted?e.abort():r.addEventListener("abort",o,{once:!0})),{signal:e.signal,dispose:()=>{clearTimeout(i),r==null||r.removeEventListener("abort",o)}}}var Dr,qu,j,Qt=p(()=>{"use strict";m();k();w();Lr();Dr=typeof window!="undefined"&&typeof fetch!="undefined",qu=5e3;j=class{static resolveBaseUrl(e){let t=d.getValue("api_base_url")||"";return e==="bff"&&d.getValue("bff_base_url")||t}static async post(e,t,i,r="api",o){return await b(async()=>
1{if(!Dr)throw new Error("Not in browser environment");let s=this.resolveBaseUrl(r);if(!s)throw new Error("API configuration missing");let a=d.getEncryptionConfig(),l=await Et.preparePayload(t,a);if(!l.success)throw new Error("Failed to prepare payload: "+l.error.message);let{data:u}=l.value,f=JSON.stringify(u),g={"Content-Type":"application/json",...i||{}},v=s+e,y=Mr(o);try{let C=await fetch(v,{method:"POST",headers:g,body:f,signal:y.signal});if(!C.ok)throw Object.assign(new Error(`HTTP error! status: ${C.status}`),{statusCode:C.status});return await C.json()}finally{y.dispose()}},{message:"Failed to make API request",severity:"medium",source:"ApiClient.post",endpoint:this.resolveBaseUrl(r)+e,statusCode:0})}static async patch(e,t,i,r="api"){return await b(async()=>{if(!Dr)throw new Error("Not in browser environment");let o=this.resolveBaseUrl(r);if(!o)throw new Error("API configuration missing");let s={"Content-Type":"application/json",...i||{}},a=o+e,l=Mr();try{let u=await fetch(a,{method:"PATCH",headers:s,body:JSON.stringify(t),signal:l.signal});if(!u.ok)throw new Error(`HTTP error! status: ${u.status}`);return await u.json()}finally{l.dispose()}},{message:"Failed to make API PATCH request",severity:"medium",source:"ApiClient.patch",endpoint:this.resolveBaseUrl(r)+e,statusCode:0})}static async get(e,t,i="api",r){return await b(async()=>{if(!Dr)throw new Error("Not in browser environment");let o=this.resolveBaseUrl(i);if(!o)throw new Error("API configuration missing");let s={Accept:"application/json",...t||{}},a=o+e,l=Mr(r);try{let u=await fetch(a,{method:"GET",headers:s,signal:l.signal});if(!u.ok)throw new Error(`HTTP error! status: ${u.status}`);return await u.json()}finally{l.dispose()}},{message:"Failed to make API GET request",severity:"medium",source:"ApiClient.get",endpoint:this.resolveBaseUrl(i)+e,statusCode:0})}}});var Jn,qs=p(()=>{"use strict";m();w();k();Qt();Jn=class{static async getTimezoneData(){return await b(async()=>{let e=d.get(),t=e.organisation_name,i=e.publication_name;if(!t||!i)throw new Error("Organization name and publication name are required");let r=await j.post("/eventsConfig",{orgName:t,pubName:i});if(!r.success)throw new Error(r.error.message);return r.value},{message:"Failed to fetch timezone data from API",severity:"low",source:"TimezoneService.getTimezoneData"})}}});function Se(n){var e;try{if(!n||n.indexOf("?")===-1)return n;let t=new Set(Wu),i=(e=d.getABConfig())==null?void 0:e.tokenQueryParam;typeof i=="string"&&i.trim()!==""&&t.add(i);let r=!1;for(let l of t)if(n.indexOf(l+"=")!==-1){r=!0;break}if(!r){for(let l of Ws)if(n.indexOf(l+"=")!==-1){r=!0;break}}if(!r)return n;let o=Ft(n),s=new URL(n,o?Ut:void 0);if(sr(s.searchParams))for(let l of Ws)t.add(l);let a=!1;for(let l of t)s.searchParams.has(l)&&(s.searchParams.delete(l),a=!0);return a?o?s.pathname+s.search+s.hash:s.href:n}catch{return n}}var Wu,Ws,Zn=p(()=>{"use strict";w();cr();Wu=["naviga_ab_token","access_token","id_token","id_token_hint","refresh_token","code_verifier","client_secret","session_state"],Ws=["code","state"]});var Xt,$s=p(()=>{"use strict";Xt=class{constructor(){this.records=new Map;this.nextId=1}async add(e){let t=this.nextId++;return this.records.set(t,{id:t,...e}),t}async update(e){this.records.has(e.id)&&this.records.set(e.id,e)}async getAll(){return Array.from(this.records.values()).sort((e,t)=>e.id-t.id)}async remove(e){this.records.delete(e)}async count(){return this.records.size}async clear(){this.records.clear(),this.nextId=1}}});var ei,Ys,tt,Nr=p(()=>{"use strict";m();w();Ze();_e();ei={action:"drop"},Ys={action:"allow"},tt=class{static evaluate(e){return c(()=>
1{let t=d.getConsentConfig().categoryMap,i=vt(e,t);if(i.length===0)return ei;if(i.length>0&&i.every(Y))return Ys;let r=S.getState();if(!r||typeof r!="object")return ei;for(let o of i)if(r[o]!=="granted")return ei;return Ys},ei)}}});var Qs={};M(Qs,{EventQueue:()=>G});var G,ti=p(()=>{"use strict";m();w();k();Qt();yr();$s();Pn();Jt();Nr();Ze();_e();St();G=class{static async init(){if(!d.getEventQueueConfig().enabled)return this.teardown(),!1;if(this.storage)return!0;if(this.initPromise)return this.initPromise;this.initPromise=this.doInit();try{return await this.initPromise}finally{this.initPromise=null}}static async doInit(){if(this.purgeHookRegistered||(this.purgeHookRegistered=!0,Cs(()=>this.purgeAll())),Fe.isSupported()){let e=new Fe;try{await e.open(),this.storage=e}catch{this.storage=new Xt}}else this.storage=new Xt;if(this.preInitBuffer.length>0){let e=this.preInitBuffer.splice(0);for(let t of e)await this.enqueue(t)}return await this.prune(),this.drain(),typeof window!="undefined"&&(this.onlineHandler||(this.onlineHandler=()=>void this.drain(),window.addEventListener("online",this.onlineHandler)),this.drainTimer||(this.drainTimer=setInterval(()=>void this.drain(),3e4))),!0}static async enqueue(e){let t=d.getEventQueueConfig();if(t.enabled&&!A.isHealthEvent(e==null?void 0:e.event_name)){if(!this.storage){this.preInitBuffer.length<this.PRE_INIT_BUFFER_MAX&&this.preInitBuffer.push(e);return}if(this.consentGatingEnabled()){let i=this.consentCategoryKey(e==null?void 0:e.event_name);if(tt.evaluate(i).action==="drop")return}await b(async()=>{let i=Date.now(),r=await this.storage.count();if(r>=t.maxEvents){let o=await this.storage.getAll(),s=r-t.maxEvents+1,a=o.slice(0,s);for(let l of a)await this.storage.remove(l.id)}await this.storage.add({event:e,attemptCount:0,firstAttemptAt:i,lastAttemptAt:i})},{message:"EventQueue.enqueue failed",severity:"low",source:"EventQueue.enqueue"})}}static async drain(){var i,r;let e=this.storage;if(!e||this.draining)return;let t=d.getEventQueueConfig();if(t.enabled){this.draining=!0;try{await this.prune();let o=await e.getAll();for(let s of o){let a=(i=s.event)==null?void 0:i.event_name;if(A.isHealthEvent(a)){await e.remove(s.id);continue}if(s.attemptCount>=t.maxAttempts){await e.remove(s.id),A.recordDropped(a);continue}if(this.consentGatingEnabled()){let f=this.consentCategoryKey(a);if(tt.evaluate(f).action==="drop"){if(!this.consentDecidedForAll(f))continue;await e.remove(s.id);continue}}s.attemptCount+=1,s.lastAttemptAt=Date.now(),await e.update(s);let l=!1,u=!1;try{let f=await j.post("/event",this.markAsReplay(s.event,s.attemptCount));if(l=f.success,!f.success){let g=(r=f.error)==null?void 0:r.statusCode;u=typeof g=="number"&&g>=400&&g<500&&g!==408&&g!==429}}catch{l=!1}l?(await e.remove(s.id),A.recordReplayDelivered(a)):u&&(await e.remove(s.id),A.recordDropped(a))}}finally{this.draining=!1}}}static consentDecidedForAll(e){return c(()=>
1{let t=d.getConsentConfig().categoryMap;for(let i of vt(e,t))if(!S.hasDecisionFor(i))return!1;return!0},!1)}static consentGatingEnabled(){return d.getConsentConfig().enabled===!0}static consentCategoryKey(e){if(!e||typeof e!="string"||e.indexOf(wt)!==0)return e;let t=e.slice(wt.length);return nt.has(t)?t:e}static markAsReplay(e,t){try{let i={};if(typeof e.additional_info=="string"&&e.additional_info)try{i=JSON.parse(e.additional_info)}catch{i={}}else e.additional_info&&typeof e.additional_info=="object"&&(i={...e.additional_info});return i.retry_attempt=t,{...e,additional_info:JSON.stringify(i)}}catch{return e}}static async prune(){let e=this.storage;if(!e)return;let t=d.getEventQueueConfig(),i=Date.now()-t.ttlHours*60*60*1e3,r=await e.getAll(),o=0;for(let s of r)s.firstAttemptAt<i&&(await e.remove(s.id),o++);o>0}static async purgeAll(){await b(async()=>{this.preInitBuffer.length=0,this.storage&&await this.storage.clear()},{message:"EventQueue.purgeAll failed",severity:"low",source:"EventQueue.purgeAll"})}static setStorageForTesting(e){this.storage=e}static getStorageForTesting(){return this.storage}static teardown(){this.storage=null,this.preInitBuffer=[],this.purgeHookRegistered=!1,this.draining=!1,this.drainTimer&&(clearInterval(this.drainTimer),this.drainTimer=null),this.onlineHandler&&typeof window!="undefined"&&(window.removeEventListener("online",this.onlineHandler),this.onlineHandler=null)}};G.storage=null,G.draining=!1,G.drainTimer=null,G.onlineHandler=null,G.initPromise=null,G.preInitBuffer=[],G.PRE_INIT_BUFFER_MAX=50,G.purgeHookRegistered=!1});var Or={};M(Or,{BeaconSender:()=>fe});var fe,it=p(()=>{"use strict";m();k();w();Lr();St();ti();Jt();fe=class{static async send(e,t){return await b(async()=>{let i=t.event_name;if(!Xs.has(i))return A.recordFailed(i),A.recordEnqueued(i),G.enqueue(t),{success:!1,method:"failed",error:"Event not in BeaconSender allow-list"};let r=d.getValue("api_base_url");if(!r)throw new Error("API configuration missing: api_base_url not set");let o=d.getEncryptionConfig(),s=await Et.preparePayload(t,o);if(!s.success)throw new Error("Failed to prepare payload: "+s.error.message);let{data:a}=s.value,l=r+e;if(A.recordAttempt(i),this.isBeaconSupported()&&this.sendViaBeacon(l,a))return A.recordDelivered(i,"beacon"),{success:!0,method:"beacon"};try{if(await this.sendViaFetchKeepalive(l,a))return A.recordDelivered(i,"fetch-keepalive"),{success:!0,method:"fetch-keepalive"}}catch{}return A.recordFailed(i),A.recordEnqueued(i),G.enqueue(t),{success:!1,method:"failed",error:"All transmission methods failed"}},{message:"Failed to send event via BeaconSender",severity:"medium",source:"BeaconSender.send",endpoint:e,statusCode:0})}static isBeaconSupported(){return typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function"}static sendViaBeacon(e,t){try{let i=new Blob([JSON.stringify(t)],{type:"application/json"}),r=navigator.sendBeacon(e,i);return r}catch{return!1}}static async sendViaFetchKeepalive(e,t){try{return typeof fetch=="undefined"?!1:(await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0})).ok}catch{return!1}}}});var Zt={};M(Zt,{EventSender:()=>ae});var ae,Pe=p(()=>{"use strict";m();k();Qt();ti();Jt();ae=class{static async send(e){return await b(async()=>{let t=e.event_name;if(typeof t!="string"||t.trim()==="")return!0;A.recordAttempt(t);let i=await j.post("/event",e);if(i.success)return A.recordDelivered(t),!0;throw A.recordFailed(t),A.recordEnqueued(t),G.enqueue(e),new Error(i.error.message)},{message:"Failed to send analytics event",severity:"medium",source:"EventSender.send",endpoint:"/event",statusCode:0})}}});function Ur(){return{attempted:0,delivered:0,failed:0,enqueued:0,replay_delivered:0,dropped:0,delivered_via_beacon:0,delivered_via_fetch_keepalive:0,delivered_via_xhr_sync:0}}var ni,A,Jt=p(()=>{"use strict";w();ni="sdk_health",A=class{static isHealthEvent(e){return e===ni}static isEnabled(){try{return d.isSdkHealthEnabled()}catch{return!1}}static record(e){if(this.isEnabled())try{e(this.counters),this.dirty=!0,this.ensureStarted()}catch{}}static recordAttempt(e){this.isHealthEvent(e)||this.record(t=>{t.attempted++})}static recordDelivered(e,t){this.isHealthEvent(e)||this.record(i=>{i.delivered++,t==="beacon"?i.delivered_via_beacon++:t==="fetch-keepalive"&&i.delivered_via_fetch_keepalive++})}static recordFailed(e){this.isHealthEvent(e)||this.record(t=>{t.failed++})}static recordEnqueued(e){this.isHealthEvent(e)||this.record(t=>{t.enqueued++})}static recordReplayDelivered(e){this.isHealthEvent(e)||this.record(t=>{t.replay_delivered++})}static recordDropped(e){this.isHealthEvent(e)||this.record(t=>{t.dropped++})}static ensureStarted(){if(this.started||typeof window=="undefined")return;this.started=!0;let e=d.getTelemetryConfig().report_interval_seconds;this.flushTimer=setInterval(()=>{this.flush("interval")},Math.max(30,e)*1e3),this.beforeUnloadListener=()=>{this.flush("beforeunload")},window.addEventListener("beforeunload",this.beforeUnloadListener),this.pageHideListener=()=>{this.flush("pagehide")},window.addEventListener("pagehide",this.pageHideListener),Promise.all([Promise.resolve().then(()=>
1(pe(),en)),Promise.resolve().then(()=>(it(),Or)),Promise.resolve().then(()=>(Pe(),Zt))]).then(([t,i,r])=>{this.modules.EventFactory=t.EventFactory,this.modules.BeaconSender=i.BeaconSender,this.modules.EventSender=r.EventSender}).catch(()=>{})}static async flush(e){var i,r,o;if(!this.dirty||this.flushing||!this.isEnabled())return;this.flushing=!0;let t=this.counters;this.counters=Ur(),this.dirty=!1;try{let s=t.attempted,a={...t,delivery_rate_percent:s>0?Math.round(t.delivered/s*100):100,report_trigger:e},u=await((i=this.modules.EventFactory)!=null?i:(await Promise.resolve().then(()=>(pe(),en))).EventFactory).createEvent(ni,a);if(!u.success||u.value===null)return;e==="pagehide"||e==="beforeunload"?await((r=this.modules.BeaconSender)!=null?r:(await Promise.resolve().then(()=>(it(),Or))).BeaconSender).send("/event",u.value):await((o=this.modules.EventSender)!=null?o:(await Promise.resolve().then(()=>(Pe(),Zt))).EventSender).send(u.value)}catch{}finally{this.flushing=!1}}static getCountersForTesting(){return{...this.counters}}static resetForTesting(){this.counters=Ur(),this.dirty=!1,this.flushing=!1,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),this.pageHideListener&&typeof window!="undefined"&&(window.removeEventListener("pagehide",this.pageHideListener),this.pageHideListener=null),this.beforeUnloadListener&&typeof window!="undefined"&&(window.removeEventListener("beforeunload",this.beforeUnloadListener),this.beforeUnloadListener=null),this.started=!1}};A.counters=Ur(),A.dirty=!1,A.started=!1,A.flushTimer=null,A.pageHideListener=null,A.beforeUnloadListener=null,A.flushing=!1,A.modules={}});function Fr(n){return`${wt}${n}`}function Br(n){return nt.has(n)?new Set([n,Fr(n)]):new Set([n])}var Xs,nt,wt,St=p(()=>{"use strict";Jt();Xs=new Set(["page_leave","engagement_ping","click","article_page_view","article_page_leave","article_engagement_ping","ab_experiment_click",ni]),nt=new Set(["page_view","page_leave","engagement_ping"]),wt="article_"});function Qu(n){let e=new Map;for(let[t,i]of Object.entries(n)){let r=new Set(i);e.set(t,r),nt.has(t)&&e.set(Fr(t),r)}return e}function Js(){return c(()=>{let n=d.get()[$u];return n==="enforce"?"enforce":"observe"},"observe")}function Zs(n,e={}){return c(()=>{if(Zu(e))return!1;let t=Xu.get(n);if(!t)return!1;let{pageClass:i}=J.resolve();return!(!t.has(i)||Ju(i)&&Js()!=="enforce")},!1)}function Ju(n){return n!=="error"}function Zu(n){return n.skipArticleContext===!0}function ea(){return c(()=>Js()!=="enforce"?!1:J.resolve().pageClass==="transit",!1)}var $u,Yu,Xu,Vr=p(()=>{"use strict";w();St();m();ht();$u="pageClassEnforcement",Yu={page_view:["transit"],engagement_ping:["commerce","transit","error"],page_leave:["commerce","transit","error"],click:["transit"]};Xu=Qu(Yu)});var Kr={};M(Kr,{PageViewContext:()=>te});var tn,Hr,q,te,ze=p(()=>{"use strict";Zn();F();Kt();Vr();tn={uuid:"",url:"",title:""},Hr="naviga-analytics-last-page-view",q=class q{static recordPageView(e,t){let i=Se(e!=null?e:q.readWindowUrl()),r=t!=null?t:q.readDocumentTitle();this.current&&this.current.url===i||this.rotateTo(i,r)}static rotateForRestore(){this.rotateTo(Se(q.readWindowUrl()),q.readDocumentTitle())}static correctCurrentUrl(e){if(!this.current)return;let t=Se(e!=null?e:q.readWindowUrl());this.current.url!==t&&(this.current={...this.current,url:t},this.currentIsHiddenFromTrail||q.writeStoredView(this.current))}static rotateTo(e,t){this.current&&this.currentIsHiddenFromTrail||(this.current?this.previous={...this.current}:this.previous=q.readStoredView()),this.current={uuid:Ue(),url:e,title:t},this.currentIsHiddenFromTrail=ea(),this.currentIsHiddenFromTrail||q.writeStoredView(this.current)}static getEventFields(){this.current||this.rotateTo(Se(q.readWindowUrl()),q.readDocumentTitle());let e=this.current;return{page_view_uuid:e.uuid,page_view_url:e.url,page_title:e.title,previous_page_view_uuid:this.previous.uuid,previous_page_view_url:this.previous.url}}static reset(){this.current=null,this.previous=tn,this.currentIsHiddenFromTrail=!1,q.clearStoredView()}static readStoredView(){try{let e=h.get(Hr);if(!e)return tn;let t=JSON.parse(e);return!t||typeof t.uuid!="string"||t.uuid===""?tn:{uuid:t.uuid,url:typeof t.url=="string"?Se(t.url):"",title:typeof t.title=="string"?t.title:""}}catch{return tn}}static writeStoredView(e){try{h.set(Hr,JSON.stringify(e))}catch{}}static clearStoredView(){try{h.remove(Hr)}catch{}}static readWindowUrl(){return typeof window!="undefined"?window.location.href:""}static readDocumentTitle(){return typeof document!="undefined"?document.title:""}};q.current=null,q.previous=tn,q.currentIsHiddenFromTrail=!1;te=q});var ed,rt,zr=p(()=>{"use strict";ed=/Googlebot|Bingbot|DuckDuckBot|Slackbot|Twitterbot|facebookexternalhit|LinkedInBot|WhatsApp|Discordbot|TelegramBot|Applebot|YandexBot|Baiduspider|HeadlessChrome|PhantomJS|puppeteer|playwright|GPTBot|OAI-SearchBot|ChatGPT-User|ClaudeBot|Claude-User|Claude-SearchBot|PerplexityBot|Perplexity-User|Google-Extended|GoogleOther|CCBot|Amazonbot|meta-externalagent|Bytespider|Applebot-Extended|MistralAI-User|DuckAssistBot/i,rt=class{static isSuspected(){return this.cached!==null?this.cached:(this.cached=this.compute(),this.cached)}static reset(){this.cached=null}static compute(){if(typeof navigator=="undefined")return!1;if(navigator.webdriver===!0)return!0;let e=navigator.userAgent||"";return ed.test(e)}};rt.cached=null});var td,ta,ot,na=p(()=>{"use strict";td=/Electron|HeadlessChrome| Atlas\/|ChatGPT-Atlas|Comet\/|Claude-User|ChatGPT-User/i,ta=/SwiftShader|llvmpipe|softw
1are rasterizer|Mesa OffScreen|VirtualBox Graphics|VMware SVGA/i,ot=class{static isSuspected(){return this.cachedSuspected!==null?this.cachedSuspected:(this.compute(),this.cachedSuspected)}static getSignals(){return this.cachedSignals!==null?this.cachedSignals:(this.compute(),this.cachedSignals)}static reset(){this.cachedSuspected=null,this.cachedSignals=null}static compute(){let e=[];if(typeof navigator!="undefined"){navigator.webdriver===!0&&e.push("webdriver");let t=navigator.userAgent||"";td.test(t)&&e.push("ua_agent_marker"),Array.isArray(navigator.languages)&&navigator.languages.length===0&&e.push("no_languages")}if(typeof window!="undefined"){try{(window.__playwright__binding__!==void 0||window.__pwInitScripts!==void 0||window.cdc_adoQpoasnfa76pfcZLmcfl_Array!==void 0)&&e.push("cdp_artifact")}catch{}try{typeof window.outerWidth=="number"&&typeof window.outerHeight=="number"&&window.outerWidth===0&&window.outerHeight===0&&typeof window.innerWidth=="number"&&window.innerWidth>0&&e.push("headless_dimensions")}catch{}}if(typeof document!="undefined"&&typeof document.createElement=="function")try{let t=document.createElement("canvas");if(typeof t.getContext=="function"){let i=this.getWebGLContext(t);if(i&&typeof i.getExtension=="function"){let r=i.getExtension("WEBGL_debug_renderer_info");if(r){let o=i.getParameter(r.UNMASKED_RENDERER_WEBGL)||"",s=i.getParameter(r.UNMASKED_VENDOR_WEBGL)||"";(ta.test(o)||ta.test(s))&&e.push("webgl_software_renderer")}}}}catch{}this.cachedSuspected=e.length>0,this.cachedSignals=e.join(",")}static getWebGLContext(e){try{return e.getContext("webgl")||e.getContext("experimental-webgl")||e.getContext("webgl2")}catch{return null}}};ot.cachedSuspected=null,ot.cachedSignals=null});var Gr,nd,ia,jr,ii,ri,ra=p(()=>{"use strict";F();Gr=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],nd=["gclid","fbclid","msclkid"],ia=[...Gr,...nd],jr="naviga-analytics-utm-session",ii="naviga-analytics-utm-first",ri=class{static getAttribution(){let e=this.parseCurrentUrl();this.hasAnyKey(e)&&(this.writeSession(e),this.writeFirstTouchIfUnset(e));let t=this.readSession(),i=this.readFirstTouch();return this.toEventFields(t,i)}static reset(){typeof sessionStorage!="undefined"&&h.remove(jr),typeof localStorage!="undefined"&&h.remove(ii)}static parseCurrentUrl(){if(typeof window=="undefined"||typeof window.location=="undefined")return{};try{let e=new URLSearchParams(window.location.search),t={};for(let i of ia){let r=e.get(i);r&&r.length>0&&(t[i]=r)}return t}catch{return{}}}static hasAnyKey(e){return Object.keys(e).length>0}static writeSession(e){if(typeof sessionStorage!="undefined")try{h.set(jr,JSON.stringify(e))}catch{}}static readSession(){if(typeof sessionStorage=="undefined")return{};try{let e=h.get(jr);if(!e)return{};let t=JSON.parse(e);return typeof t=="object"&&t!==null?t:{}}catch{return{}}}static writeFirstTouchIfUnset(e){if(typeof localStorage!="undefined")try{if(h.get(ii))return;let i={};for(let r of Gr)e[r]&&(i[r]=e[r]);if(Object.keys(i).length===0)return;h.set(ii,JSON.stringify(i))}catch{}}static readFirstTouch(){if(typeof localStorage=="undefined")return{};try{let e=h.get(ii);if(!e)return{};let t=JSON.parse(e);return typeof t=="object"&&t!==null?t:{}}catch{return{}}}static toEventFields(e,t){let i={};for(let r of ia)i[r]=e[r]||"";for(let r of Gr)i[`first_touch_${r}`]=t[r]||"";return i}}});var id,At,oa=p(()=>{"use strict";m();id={"chatgpt.com":"chatgpt",chatgpt:"chatgpt",perplexity:"perplexity","perplexity.ai":"perplexity",copilot:"copilot",gemini:"gemini","claude.ai":"claude",deepseek:"deepseek"},At=class{static resolve(e,t){let i=`${e}\0${t}`;if(this.cached!==null&&this.cached.key===i)return this.cached.value;let r=this.compute(e,t);return this.cached={key:i,value:r},r}static isAiReferrer(e){return this.resolve(e,"")!==""}static reset(){this.cached=null}static compute(e,t){let i=this.classifyReferrer(e);return i!==""?i:this.classifyUtm(t)}static classifyReferrer(e){return e?E(()=>{let t=new URL(e),i=t.hostname.toLowerCase(),r=t.pathname.toLowerCase(),o=s=>i===s||i.endsWith("."+s);return o("chatgpt.com")||o("chat.openai.com")?"chatgpt":o("perplexity.ai")||o("pplx.ai")?"perplexity":o("gemini.google.com")||o("bard.google.com")?"gemini":o("claude.ai")?"claude":o("copilot.microsoft.com")||o("bing.com")&&r.startsWith("/chat")?"copilot":o("meta.ai")?"meta":o("grok.com")||o("grok.x.ai")?"grok":o("deepseek.com")?"deepseek":o("you.com")||o("huggingface.co")&&r.startsWith("/chat")||o("mistral.ai")&&r.startsWith("/chat")||o("kagi.c
1om")&&r.startsWith("/assistant")?"other_ai":""},{message:"AiSourceResolver: referrer URL parse failed",severity:"LOW",source:"AiSourceResolver.classifyReferrer"}).unwrapOr(""):""}static classifyUtm(e){var i;if(!e)return"";let t=e.toLowerCase().trim();return(i=id[t])!=null?i:""}};At.cached=null});var ne,je,qr=p(()=>{"use strict";k();m();Mn();$t();Xn();w();Je();qs();yn();ze();Zn();zr();na();Sr();ra();oa();pt();ne=class ne{static generateSessionNonce(){try{if(typeof crypto!="undefined"&&typeof crypto.randomUUID=="function")return crypto.randomUUID().replace(/-/g,"").substring(0,12)}catch{}return(Date.now().toString(36)+Math.random().toString(36).substring(2,10)).substring(0,12)}static async getCommonEventData(){return await b(async()=>{let e=performance.now(),t=ri.getAttribution(),i=N.get();if(i){let U=await this.generateDynamicData(i.ex_timezone),T=performance.now();return N.recordHit(T-e),{...i,...U,...t}}N.recordMiss();let[r,o,s,a]=await Promise.all([Be.getVisitorId(),Ke.getSessionId(),de.getPlatformInfo(),Jn.getTimezoneData()]);if(!r.success)throw new Error("Failed to get visitor ID");if(!o.success)throw new Error("Failed to get session ID");if(!s.success)throw new Error("Failed to get platform info");let l=r.value,u=o.value,f=s.value,g=Se(document.referrer||""),v=ne.getReferrerType(g).unwrapOr("unknown"),y=At.resolve(g,t.utm_source||""),C={device_id:l,session_id:u,platform_type:f.type,platform_model:f.model.toLowerCase(),platform_name:"web",platform_version:f.version,platform_os_name:f.os||"unknown",organisation_name:d.getValue("organisation_name")||"",publication_name:d.getValue("publication_name")||"",publication_id:d.getValue("publication_id")||"",sdk_version:$.SDK_VERSION,referrer_url:g,referrer_type:v,bot_suspected:rt.isSuspected(),agent_suspected:ot.isSuspected(),agent_signals:ot.getSignals(),ai_source:y,ex_timezone:a.success?a.value.timezone:void 0,ex_timezone_offset:a.success?a.value.offset:void 0};N.set(C);let _=await this.generateDynamicData(C.ex_timezone);return{...C,..._,...t}},{message:"Failed to build common event data",severity:"high",source:"EventDataBuilder.getCommonEventData"})}static async generateDynamicData(e){let t=ne.generateEventId().unwrapOr(`${Date.now().toString(36)}-${ne.sessionNonce}-fb${(ne.eventIdCounter++).toString(36)}`),i=new Date,r,o,s,a;if(e)try{let v=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(i),y=Object.fromEntries(v.map(C=>[C.type,C.value]));r=parseInt(y.year),o=parseInt(y.month),s=parseInt(y.day),a=Math.floor(i.getTime()/1e3).toString()}catch{r=i.getUTCFullYear(),o=i.getUTCMonth()+1,s=i.getUTCDate(),a=Math.floor(i.getTime()/1e3).toString()}else r=i.getUTCFullYear(),o=i.getUTCMonth()+1,s=i.getUTCDate(),a=Math.floor(i.getTime()/1e3).toString();let l=ne.padStart(o,2,"0").unwrapOr(String(o).padStart(2,"0")),u=ne.padStart(s,2,"0").unwrapOr(String(s).padStart(2,"0")),f=`${r}-${l}-${u}`;return{event_id:t,event_time_epoc:a,event_create_year:r.toString(),event_create_month:l,event_create_date:u,event_timestamp_utc:i.toISOString().split(".")[0].replace("T"," ")+" +0000",event_creation_date:f}}static generateEventId(){return E(()=>{let e=Date.now().toString(36),t=(ne.eventIdCounter++).toString(36);return`${e}-${ne.sessionNonce}-${t}`},{message:"Failed to generate event ID",severity:"low",source:"EventDataBuilder.generateEventId"})}static getPageViewContextData(){return E(()=>te.getEventFields(),{message:"Failed to read page view context",severity:"low",source:"EventDataBuilder.getPageViewContextData"})}static getArticleEventData(){let e=d.getArticleDetails();return e.success&&Object.keys(e.value).length>0&&N.updateArticleData(e.value),e}static getUserEventData(){let e=d.getUserDetails(),t=e.success?e.value:{},i=se.getUserId(),r=se.getTraits(),o={...t,...r||{}};return i?(o.user_id=i,(o.is_logged_in===void 0||o.is_logged_in==="")&&(o.is_logged_in="true")):(o.is_logged_in===void 0||o.is_logged_in==="")&&(o.is_logged_in="false"),Object.keys(o).length>0&&N.updateUserData(o),W(o)}static getReferrerType(e){return E(()=>
1{if(!e||e.trim()==="")return"direct";let t=e.toLowerCase(),i=[/^https?:\/\/(www\.)?facebook\.com/i,/^https?:\/\/([a-zA-Z0-9-]+\.)?facebook\.com/i,/^https?:\/\/(www\.)?fb\.com/i,/^https?:\/\/(www\.)?m\.facebook\.com/i,/^https?:\/\/(www\.)?facebook\.com\.\w{2,3}/i,/^https?:\/\/fb\.me/i,/^fb:\/\//i,/^facebook:\/\//i,/^android-app:\/\/com\.facebook[.\w]*/i],r=[/^https?:\/\/(www\.)?twitter\.com/i,/^https?:\/\/(www\.)?x\.com/i,/^https?:\/\/(www\.)?mobile\.twitter\.com/i,/^https?:\/\/t\.co/i,/^https?:\/\/(www\.)?twitter\.com/i,/^t\.co/i,/^twitter:\/\//i,/^x:\/\//i,/^android-app:\/\/com\.twitter[.\w]*/i],o=[/^https?:\/\/(www\.)?linkedin\.com/i,/^https?:\/\/(www\.)?lnkd\.in/i,/^https?:\/\/(www\.)?business\.linkedin\.com/i,/^https?:\/\/(www\.)?learning\.linkedin\.com/i,/^linkedin:\/\//i,/^li:\/\//i,/^android-app:\/\/com\.linkedin[.\w]*/i],s=[/^https?:\/\/(www\.)?instagram\.com/i,/^https?:\/\/(www\.)?instagr\.am/i,/^https?:\/\/(www\.)?business\.instagram\.com/i];if(i.some(l=>l.test(t))||r.some(l=>l.test(t))||o.some(l=>l.test(t))||s.some(l=>l.test(t)))return"social";if(At.isAiReferrer(e))return"ai_assistant";if([/^https?:\/\/(www\.)?google\.com/i,/^https?:\/\/(www\.)?bing\.com/i,/^https?:\/\/(www\.)?yahoo\.com/i,/^https?:\/\/(www\.)?duckduckgo\.com/i,/^https?:\/\/(www\.)?baidu\.com/i,/^https?:\/\/(www\.)?yandex\.com/i].some(l=>l.test(t)))return"organic";try{let l=window.location.hostname.toLowerCase(),f=new URL(t).hostname.toLowerCase();if(f!=l||t.includes(l)&&t.split(l+"/")[1])return"referral";if(f===l)return"direct"}catch{}return"direct"},{message:"Failed to determine referrer type",severity:"low",source:"EventDataBuilder.getReferrerType"})}static padStart(e,t,i){return E(()=>{let r=e.toString();return r.length>=t?r:i.repeat(t-r.length)+r},{message:"Failed to pad string",severity:"low",source:"EventDataBuilder.padStart"})}};ne.eventIdCounter=0,ne.sessionNonce=ne.generateSessionNonce();je=ne});function kt(n){if(typeof n=="boolean")return n;if(n===1)return!0;if(n===0)return!1;if(typeof n=="string"){let e=n.trim().toLowerCase();if(rd.has(e))return!0;if(od.has(e))return!1}return null}function aa(n){return n?"true":"false"}function dd(n){let e=n.trim();if(!sd.test(e))return null;let t=e.replace(/\//g,"-");return ad.test(t)?`${t}T00:00:00Z`:(t=t.replace(cd,"$1T"),t=t.replace(ld,"$1$2:$3"),ud.test(t)||(t+="Z"),t)}function fd(n){return`${n.toISOString().split(".")[0].replace("T"," ")} +0000`}function pd(n){let e=kt(n);return e===null?null:aa(!e)}function gd(n){let e=kt(n);return e===null?null:aa(e)}function hd(n){var t;if(typeof n!="string")return null;let e=n.trim().toLowerCase();return(t=md[e])!=null?t:null}function vd(n){let e=Array.isArray(n)?n:[n],t=[],i=new Set;for(let r of e){if(typeof r!="string")continue;let o=r.trim();o===""||i.has(o)||(i.add(o),t.push(o))}return t.length>0?t.join(", "):null}function yd(n){let e;if(n instanceof Date)e=n;else if(typeof n=="string"){let i=dd(n);if(i===null)return null;e=new Date(i)}else return null;let t=e.getTime();return Number.isFinite(t)?fd(e):null}function Cd(n){var e;return n===void 0?sa:(e=bd[n])!=null?e:sa}function oi(n,e){return c(()=>Cd(n)(e),null)}var rd,od,sd,ad,cd,ld,ud,md,bd,sa,nn=p(()=>{"use strict";m();rd=new Set(["true","yes","1"]),od=new Set(["false","no","0"]);sd=/^\d{4}[-/]\d{2}[-/]\d{2}/,ad=/^\d{4}-\d{2}-\d{2}$/,cd=/^(\d{4}-\d{2}-\d{2}) /,ld=/\s*([+-])(\d{2})(\d{2})$/,ud=/(Z|[+-]\d{2}:\d{2})$/;md={free:"false",locked:"true",metered:"true"};bd=Object.freeze({invert:pd,toBoolString:gd,tierToBool:hd,joinList:vd,isoDate:yd}),sa=n=>n});function si(n){switch(typeof n){case"string":{if(n.length>Wr)return null;let e=n.trim();return e===""?null:e}case"number":return Number.isFinite(n)?n:null;case"boolean":return n;default:return null}}function Z(n){return c(()=>{let e=[];for(let t of n){if(e.length>=ie)break;let i=si(t);i!==null&&e.push(i)}return e.length===0?null:e.length===1?e[0]:e},null)}function ai(n){return Array.isArray(n)?Z(n):si(n)}var Wr,ie,Ae=p(()=>{"use strict";m();Wr=4096,ie=50});function rn(n){if(typeof n!="string"||n===""||n.length>_d)return null;try{return new RegExp(n)}catch{return null}}function ca(n){let e=typeof n=="string"?n:String(n);return e.length>Ed?null:e}function ci(n,e){let t=ca(e);if(t===null)return!1;try{return n.test(t)}catch{return!1}}function la(n,e){let t=ca(e);if(t===null)return null;let i;try{i=n.exec(t)}catch{return null}if(i===null)return null;let r=i[1];if(typeof r!="string")return null;let o=r.trim();return o===""?null:o}var _d,Ed,$r=p(()=>{"use strict";Ae();_d=512,Ed=Wr});function ua(n,e){let t=e?" i":"";return`meta[name="${n}"${t}], meta[property="${n}"${t}]`}function da(n,e=document){return c(()=>
1{if(typeof n!="string")return[];let t=n.trim();if(t===""||!wd.test(t))return[];let i;try{i=e.querySelectorAll(ua(t,!0))}catch{i=e.querySelectorAll(ua(t,!1))}let r=[];return i.forEach(o=>{let s=c(()=>o.getAttribute("content"),null);if(typeof s!="string")return;let a=s.trim();a!==""&&r.push(a)}),r},[])}var wd,fa=p(()=>{"use strict";m();wd=/^[A-Za-z0-9_.:-]+$/});function pa(n,e=document){return c(()=>Z(da(n,e)),null)}var ga=p(()=>{"use strict";fa();m();Ae()});function Ge(n){if(typeof n!="string")return null;let e=n.trim();if(e==="")return null;let t=e.split(".");if(t.length>Yr)return null;for(let i of t)if(!Sd.test(i)||Ad.has(i))return null;return t}function kd(n,e){if(!(typeof n!="object"||n===null)&&Object.prototype.hasOwnProperty.call(n,e))return c(()=>n[e],void 0)}function ma(n){let e=[];for(let t of n)Array.isArray(t)?e.push(...t):e.push(t);return e}function Tt(n,e,t){return c(()=>{let i=[n];for(let r of e){let o=t.fanOutArrays?ma(i):i,s=[];for(let a of o){let l=kd(a,r);l!==void 0&&s.push(l)}if(s.length===0)return[];i=s}return t.fanOutArrays?ma(i):i},[])}var Yr,Sd,Ad,on=p(()=>{"use strict";m();Yr=8,Sd=/^[A-Za-z0-9_@:-]+$/,Ad=new Set(["__proto__","constructor","prototype"])});function ha(n){return n.trim().toLowerCase().replace(/^https?:\/\//,"").replace(/\/+$/,"")}function va(n,e){if(e===void 0)return[n];let t=ha(e);return t===""?[]:c(()=>Array.from(n.querySelectorAll("[itemtype]")).filter(i=>{var o;return((o=i.getAttribute("itemtype"))!=null?o:"").split(/\s+/).some(s=>s!==""&&ha(s)===t)}),[])}function ya(n,e=document){return c(()=>typeof n!="string"||n.trim()===""?!1:va(e,n).length>0,!1)}function Rd(n,e){if(n.nodeType===9)return!0;let t=e.parentElement;for(;t!==null;){if(t===n)return!0;if(t.hasAttribute("itemscope"))return!1;t=t.parentElement}return!1}function xd(n,e){return c(()=>Array.from(n.querySelectorAll(`[itemprop~="${e}"]`)).filter(i=>Rd(n,i)).slice(0,Td),[])}function Id(n){return c(()=>{if(n.hasAttribute("itemscope"))return null;let e=n.tagName.toLowerCase();if(e==="time"){let i=n.getAttribute("datetime");return i!==null?i:n.textContent}let t=Pd[e];return t!==void 0?n.getAttribute(t):n.textContent},null)}function ba(n,e=void 0,t=document){return c(()=>{let i=Ge(n);if(i===null)return null;let r=[];for(let o of va(t,e)){if(r.length>=ie)break;Ca(o,i,r)}return Z(r)},null)}function Ca(n,e,t){let[i,...r]=e;for(let o of xd(n,i)){if(t.length>=ie)return;if(r.length===0){let s=Id(o);s!==null&&t.push(s);continue}Ca(o,r,t)}}var Td,Pd,Qr=p(()=>{"use strict";m();Ae();on();Td=50;Pd={meta:"content",a:"href",area:"href",link:"href",audio:"src",embed:"src",iframe:"src",img:"src",source:"src",track:"src",video:"src",object:"data",data:"value",meter:"value"}});function Md(n){return typeof n=="string"?[n]:Array.isArray(n)?n.filter(e=>typeof e=="string"):[]}function Nd(n){return Md(n["@type"]).some(t=>Dd.has(t))}function Od(n){if(typeof n.headline!="string"||n.headline.trim()==="")return!1;let e=n.image;if(e==null||Array.isArray(e)&&e.length===0||typeof n.datePublished!="string"||n.datePublished.trim()===""||typeof n.dateModified!="string"||n.dateModified.trim()==="")return!1;let t=n.author;if(!t)return!1;if(!(typeof t=="string"&&t.trim()!==""))if(typeof t=="object"&&!Array.isArray(t)){if(typeof t.name!="string")return!1}else if(Array.isArray(t)){if(t.length===0||!t.every(o=>typeof o=="object"&&o!==null&&typeof o.name=="string"))return!1}else return!1;let i=n.publisher;return!(!i||typeof i!="object"||Array.isArray(i)||typeof i.name!="string")}function Xr(n){return n.replace(/\s+[|–—]\s+.*$/,"").toLowerCase().trim().replace(/\s+/g," ")}function Ud(n,e){if(n===e||n.includes(e)||e.includes(n))return!0;let t=n.length<=e.length?n:e,i=n.length<=e.length?e:n,r=Math.ceil(t.length*.8);return!!(r>0&&i.startsWith(t.slice(0,r)))}function Fd(n){let e=n.querySelector("h1");if(e&&e.textContent&&e.textContent.trim()!=="")return Xr(e.textContent);let t=n.querySelector('meta[property="og:title"]');if(t){let i=t.getAttribute("content");if(i&&i.trim()!=="")return Xr(i)}return null}function Bd(n,e){if(!e)return!0;let t=n.isAccessibleForFree;if(!(t===!1||typeof t=="string"&&t.toLowerCase()==="false"))return!1;let r=n.hasPart;return(Array.isArray(r)?r:r?[r]:[]).some(s=>{if(typeof s!="object"||s===null)return!1;let a=s;return typeof a.cssSelector=="string"&&a.cssSelector.trim()!==""})}var Ld,Dd,Ie,li=p(()=>{"use strict";Ld=1e5,Dd=new Set(["NewsArticle","Article","ReportageNewsArticle","AnalysisNewsArticle","Backgroun
1dNewsArticle","OpinionNewsArticle","ReviewNewsArticle","LiveBlogPosting","BlogPosting"]);Ie=class n{static collect(e){var r;let t=Array.from(e.querySelectorAll('script[type="application/ld+json"]')),i=[];for(let o of t){let s=(r=o.textContent)!=null?r:"";if(s.length>Ld)continue;let a;try{a=JSON.parse(s)}catch{continue}if(Array.isArray(a))for(let l of a)typeof l=="object"&&l!==null&&i.push(l);else if(typeof a=="object"&&a!==null){let l=a;if(Array.isArray(l["@graph"]))for(let u of l["@graph"])typeof u=="object"&&u!==null&&i.push(u);else i.push(l)}}return i}static runChecks(e,t){let i=n.collect(e),r=i.length>0,o=i.find(g=>typeof g=="object"&&g!==null&&Nd(g)),s=o!==void 0,a=s,l=s&&Od(o),u=!1;if(s&&typeof o.headline=="string"){let g=Xr(o.headline),v=Fd(e);v!==null&&(u=Ud(g,v))}let f=s?Bd(o,t):!t;return[{id:"jsonld_present",audience:"A",pass:r},{id:"jsonld_newsarticle",audience:"B",pass:a},{id:"jsonld_required_props",audience:"B",pass:l},{id:"schema_dom_consistency",audience:"B",pass:u},{id:"paywall_markup",audience:"B",pass:f}]}}});function _a(n){return n.trim().toLowerCase().replace(/^https?:\/\//,"").replace(/^schema\.org\//,"").replace(/^schema:/,"")}function Ea(n,e){if(e===void 0||e.length===0)return!0;let t=n["@type"],i=Array.isArray(t)?t:[t],r=new Set(i.filter(o=>typeof o=="string").map(_a));return e.some(o=>typeof o=="string"&&r.has(_a(o)))}function wa(n,e=document){return c(()=>c(()=>Ie.collect(e),[]).some(i=>Ea(i,n)),!1)}function Sa(n,e=void 0,t=document){return c(()=>{let i=Ge(n);if(i===null)return null;let r=c(()=>Ie.collect(t),[]),o=[];for(let s of r){if(o.length>=ie)break;let a=s;Ea(a,e)&&o.push(...Tt(a,i,{fanOutArrays:!0}))}return Z(o)},null)}var Jr=p(()=>{"use strict";li();m();Ae();on()});function Aa(n,e,t=document){return c(()=>{if(typeof n!="string"||typeof e!="string")return null;let r=c(()=>Array.from(t.querySelectorAll(n)).slice(0,ie),[]).map(o=>c(()=>o.getAttribute(e),null));return Z(r)},null)}var ka=p(()=>{"use strict";m();Ae()});function Ta(n,e=document){return c(()=>{if(typeof n!="string")return null;let i=c(()=>Array.from(e.querySelectorAll(n)).slice(0,ie),[]).map(r=>c(()=>r.textContent,null));return Z(i)},null)}var Ra=p(()=>{"use strict";m();Ae()});function sn(){return c(()=>typeof window!="undefined"?window:{},{})}function xa(n,e=sn()){return c(()=>{let t=Ge(n);if(t===null)return null;let i=Tt(e,t,{fanOutArrays:!1});if(i.length===0)return null;let[r]=i;return Array.isArray(r)?Z(r):Z(i)},null)}var Zr=p(()=>{"use strict";m();Ae();on()});function Pa(n){let e=0,t=n.parentElement;for(;t!==null;)e++,t=t.parentElement;return e}function zd(n){return n.querySelector("article")===null}function jd(n){for(let e of Vd){let t=c(()=>Array.from(n.querySelectorAll(e)).filter(zd),[]);if(t.length!==0)return t.reduce((i,r)=>Pa(r)>Pa(i)?r:i)}for(let e of Hd){let t=c(()=>n.querySelector(e),null);if(t!==null)return t}return null}function Gd(n){var t;let e=((t=n.textContent)!=null?t:"").trim();return e===""?0:e.split(/\s+/).length}function Ia(n=document){return c(()=>{let e=jd(n);if(e===null)return 0;let t=c(()=>e.cloneNode(!0),e);return t!==e&&c(()=>{t.querySelectorAll(Kd).forEach(i=>i.remove())},void 0),Gd(t)},0)}var Vd,Hd,Kd,La=p(()=>{"use strict";m();Vd=['[itemprop="articleBody"]',".article-body, .entry-content","main article","article"],Hd=["main","body"],Kd=["nav","aside","footer","figcaption",'[class*="related"]','[class*="recommend"]',"[data-related]"].join(", ")});function Da(n,e=document){return c(()=>{if(n!=="wordCount")return null;let t=Ia(e);return Number.isFinite(t)&&t>0?t:null},null)}var Ma=p(()=>{"use strict";La();m()});function Wd(n){if(n.length===0)return!1;for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);if(t<48||t>57)return!1}return!0}function $d(n){if(typeof n!="object"||n===null||Array.isArray(n))return!1;for(let e of Object.keys(n))if(e===qd||Wd(e))return!1;return!0}function Ua(n){if(typeof n!="object"||n===null||Array.isArray(n))return!1;let e=Object.getPrototypeOf(n);return e===Object.prototype||e===null}function eo(n,e,t,i){for(let r of Object.keys(e)){let o=c(()=>e[r],Oa);if(o===Oa)continue;i.remaining--;let s=n[r];i.remaining>0&&t<Yd&&Ua(s)&&Ua(o)?n[r]=eo(Xd(s,i),o,t+1,i):n[r]=o}return n}function Xd(n,e){return eo(Object.create(null),n,0,e)}function Jd(n){let e=Object.create(null),t={remaining:Qd};for(let i of n)$d(i)&&eo(e,i,0,t);return e}function Zd(n,e){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];let t=Ge(e);if(t===null)return;let i=Tt(n,t,{fanOutArrays:!1});return i.length===0?void 0:i[0]}function Fa(n,e=sn(),t=Na){return c(()=>{let i=typeof t=="string"&&t.trim()!==""?t.trim():Na;if(typeof e!="object"||e===null||!Object.prototype.hasOwnProperty.call(e,i))return null;let r=c(()=>e[i],void 0);if(!Array.isArray(r))return null;
1let o=Zd(Jd(r),n);if(Array.isArray(o)){let s=o.length>ie?o.slice(0,ie):o.slice();return ai(oi("joinList",s))}return si(o)},null)}var Na,qd,Oa,Yd,Qd,Ba=p(()=>{"use strict";m();nn();Ae();on();Zr();Na="dataLayer",qd="event",Oa=Symbol("unreadable");Yd=Yr,Qd=2e4});function to(){return{doc:document,globalScope:sn()}}function ke(n){return typeof n=="string"&&n.trim()!==""?n:null}function ef(n,e){var f;let t=n,i=ke(t.meta);if(i!==null)return pa(i,e.doc);let r=ke(t.microdata);if(r!==null)return ba(r,(f=ke(t.type))!=null?f:void 0,e.doc);let o=ke(t.jsonld);if(o!==null){let g=Array.isArray(t.type)?t.type.filter(v=>typeof v=="string"):void 0;return Sa(o,g,e.doc)}if(Array.isArray(t.attr)){let g=ke(t.attr[0]),v=ke(t.attr[1]);return g===null||v===null?null:Aa(g,v,e.doc)}let s=ke(t.text);if(s!==null)return Ta(s,e.doc);let a=ke(t.global);if(a!==null)return xa(a,e.globalScope);let l=ke(t.datalayer);if(l!==null)return Fa(l,e.globalScope,e.dataLayerName);let u=ke(t.computed);return u!==null?Da(u,e.doc):null}function tf(n,e){let t=Array.isArray(n)?n:[n];if(e.matches!==void 0){let i=rn(e.matches);if(i===null)return null;t=t.filter(r=>ci(i,r))}if(e.extract!==void 0){let i=rn(e.extract);if(i===null)return null;let r=[];for(let o of t){let s=la(i,o);s!==null&&r.push(s)}t=r}return t.length===0?null:t}function nf(n,e){return!e||n.length===1?n[0]:n}function no(n,e=to()){return c(()=>{if(typeof n!="object"||n===null)return null;let t=ef(n,e);if(t===null)return null;let i=tf(t,n);if(i===null)return null;let r=nf(i,n.all===!0);return n.transform===void 0?r:ai(oi(n.transform,r))},null)}var Va=p(()=>{"use strict";nn();m();Ae();$r();ga();Qr();Jr();ka();Ra();Zr();Ma();Ba()});function io(){return{...to(),path:c(()=>window.location.pathname,"")}}function af(n){let e=n==null?void 0:n.articleDetection;if(e==null)return"auto";if(e==="auto"||e==="paths"||e==="off")return e;let t=typeof e=="string"?`"${e}"`:`a ${typeof e}`;return"auto"}function cf(n){let e=n==null?void 0:n.articlePaths;return Array.isArray(e)?e:[]}function lf(n,e){return c(()=>{var a,l;let t={verdict:Array.isArray(n==null?void 0:n.verdict)?n.verdict:[],fields:n!=null&&n.fields&&typeof n.fields=="object"?n.fields:{}},i=e==null?void 0:e.profile,r=Array.isArray(i==null?void 0:i.verdict)?i.verdict:t.verdict,o={...t.fields};if(i!=null&&i.fields&&typeof i.fields=="object")for(let[u,f]of Object.entries(i.fields))Array.isArray(f)&&(o[u]=f);let s=(a=e==null?void 0:e.dataLayerMapping)==null?void 0:a.fields;if(s&&typeof s=="object")for(let[u,f]of Object.entries(s))typeof f!="string"||f.trim()===""||(o[u]=[{datalayer:f.trim()},...(l=o[u])!=null?l:[]]);return{verdict:r,fields:o}},{verdict:[],fields:{}})}function uf(n){return(n==null?void 0:n.path)===!0}function df(n,e,t){return c(()=>{if(typeof n!="object"||n===null)return null;let i=n;if(i.path===!0)return gt(t)?Ot(e.path,t):null;if(typeof i.meta=="string"&&i.meta.trim()!=="")return ff(i,e);let r=Ha(i.microdata);if(r!==null)return typeof r=="string"?ya(r,e.doc):null;let o=Ha(i.jsonld);if(o!==null){let s=Array.isArray(o)?o.filter(a=>typeof a=="string"&&a.trim()!==""):[];return s.length===0?null:wa(s,e.doc)}return typeof i.bodyClass=="string"&&i.bodyClass.trim()!==""?pf(i.bodyClass,e.doc):null},null)}function Ha(n){if(n==null||typeof n!="object")return null;let e=n.type;return e===void 0?null:e}function ff(n,e){let t=no({meta:n.meta,all:!0},e);if(t===null)return!1;if(!Array.isArray(n.equals))return!0;let i=n.equals.filter(o=>typeof o=="string");return i.length===0?!0:(Array.isArray(t)?t:[t]).some(o=>i.includes(String(o)))}function pf(n,e){let t=rn(n);if(t===null)return!1;let i=c(()=>{var r,o;return(o=(r=e.body)==null?void 0:r.getAttribute("class"))!=null?o:""},"");return i===""?!1:ci(t,i)}function gf(n,e,t){return c(()=>{let i=af(e);if(i==="off"||!Array.isArray(n)||n.length===0)return"no-opinion";let r=cf(e),o=(i==="paths"?n.filter(uf):n).slice(0,sf),s=0;for(let a of o){let l=df(a,t,r);if(l!==null&&(s+=1,l))return"article"}return s===0?"no-opinion":"not-article"},"no-opinion")}function mf(n,e){return c(()=>{let t={};if(!n||typeof n!="object")return t;for(let[i,r]of Object.entries(n).slice(0,rf))if(Array.isArray(r))for(let o of r.slice(0,of)){let s=c(()=>no(o,e),null);if(s!==null){t[i]=s;break}}return t},{})}function Ka(n,e={},t=io(),i=!1){return c(()=>{let r=lf(n,e),o=gf(r.verdict,e,t),a=o==="article"||o==="no-opinion"&&i===!0?mf(r.fields,t):{};return{verdict:o,fields:a}},{verdict:"no-opinion",fields:{}})}var rf,of,sf,za=p(()=>{"use strict";Va();$r();Qr();Jr();_n();m();rf=64,of=32,sf=32});function Ga(n){if(n===null||typeof n!="object")return n;for(let e of Object.values(n))Ga(e);return Object.freeze(n)}var ja,hf,an,cn,qa=p(()=>{"use strict";ja="^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$",hf="https://schema.org/NewsArticle",an=[];cn=Ga({verdict:[{path:!0},{meta:"og:type",equals:["article","news article"]},{microdata:{type:hf}},{jsonld:{type:["NewsArticle","Article","ReportageNewsArticle","OpinionNewsArticle","BlogPosting"]}},{meta:"article:published_time",nonEmpty:!0},{bodyClass:"\\bsingle-(post|article)\\b"}],fields:{article_title:[{meta:"parsely-title"},{microdata:"headline"},{jsonld:"headline"},{meta:"article:title"},{meta:"headline"},{meta:"og:title"},{text:'main[itemtype*="NewsArticle"] h1'},{text:"article h1"}],article_url:[{meta:"parsely-link"},{attr:["link[rel=canonical]","href"]},{jsonld:"url"},{meta:"og:url"}],article_uuid:[{meta:"parsely-post-id"},{attr:['main[itemtype*="NewsArticle"] article',"data-uuid"]},{attr:['main[itemtype*="NewsArticle"] article',"id"]},{attr:["article","data-uuid"],matches:ja},{attr:["article","id"],matches:ja},{jsonld:"identifier"},{jsonld:"@id"}],article_section:[{meta:"parsely-section"},{microdata:"articleSection"},{meta:"article:section"},{meta:"article:mainsection"},{jsonld:"articleSection"}],author_name:[{meta:"parsely-author",all:!0,transform:"joinList"},{microdata:"creator.name",all:!0,transform:"joinList"},{microdata:"author.name",all:!0,transform:"joinList"},{jsonld:"author.name",all:!0,transform:"joinList"},{jsonld:"creator",all:!0,transform:"joinList"},{meta:"article:author",all:!0,transform:"joinList"},{meta:"docauthor"},{meta:"author"}],article_publication_date:[{meta:"parsely-pub-date",transform:"isoDate"},{microdata:"datePublished",transform:"isoDate"},{jsonld:"datePublished",transform:"isoDate"},{meta:"article:published_time",transform:"isoDate"},{meta:"pubdate",transform:"isoDate"},{attr:["time[itemprop=datePublished]","datetime"],transform:"isoDate"}],article_is_premium:[{jsonld:"isAccessibleForFree",transform:"invert"},{meta:"article:content_tier",transform:"tierToBool"}
1],article_concept_name:[{microdata:"keywords",all:!0,transform:"joinList"},{attr:["article","data-categories"]},{meta:"article:tag",all:!0,transform:"joinList"}],total_word_count:[{computed:"wordCount"}],article_section_uuid:an,author_uuid:an,article_concept_uuid:an,article_publication:an,article_content:an}})});function ro(n){return c(()=>(n==null?void 0:n.enabled)!==!1,!0)}function yf(n){return c(()=>(n==null?void 0:n.wordCount)!=="off",!0)}function bf(n){return n.filter(e=>(e==null?void 0:e.computed)===void 0)}function Wa(n){let e={};for(let[t,i]of Object.entries(n))e[t]=Array.isArray(i)?bf(i):i;return e}function Cf(n){let e=n.profile;return!e||typeof e!="object"||!e.fields||typeof e.fields!="object"?n:{...n,profile:{...e,fields:Wa(e.fields)}}}function $a(n={}){return c(()=>{if(!ro(n))return vf;let e=n&&typeof n=="object"?n:{};return yf(e)?{profile:cn,config:e}:{profile:{verdict:cn.verdict,fields:Wa(cn.fields)},config:Cf(e)}},_f)}var vf,_f,Ya=p(()=>{"use strict";qa();m();vf=Object.freeze({profile:Object.freeze({verdict:[],fields:{}}),config:Object.freeze({articleDetection:"off"})});_f=Object.freeze({profile:cn,config:Object.freeze({})})});function oo(){return{isArticle:!1,data:{}}}var Ef,wf,ln,Qa,ge,so=p(()=>{"use strict";w();m();za();Ya();nn();Ef=3e3,wf=100,ln="article_is_premium",Qa=Object.freeze({verdict:"no-opinion",fields:Object.freeze({})}),ge=class{static async resolve(){return(await this.resolveContext()).data}static async resolveContext(){if(this.ensureUnloadListeners(),this.decision)return this.currentContext();if(this.pending)return await this.pending,this.currentContext();let e=this.readLive();if(Object.keys(e).length>0)return this.latch(!0,e),this.currentContext();if(!this.isMappingConfigured()||this.unloadStarted)return this.latch(!1,{}),this.currentContext();this.pending=this.waitForArticleData();try{await this.pending}finally{this.pending=null}return this.currentContext()}static reset(){this.decision=null,this.pending=null}static isDecided(){return this.decision!==null}static currentContext(){let e=this.decision;if(!e||!e.isArticle)return oo();let t=this.readLive(),i=Object.keys(t).length>0?t:e.data,r={...e.markupFields,...i};return Object.prototype.hasOwnProperty.call(i,ln)&&kt(i[ln])===null&&Object.prototype.hasOwnProperty.call(e.markupFields,ln)&&(r[ln]=e.markupFields[ln]),{isArticle:!0,data:r}}static latch(e,t){let i=this.resolveMarkup(e),r=e||i.verdict==="article";this.decision={isArticle:r,data:t,markupFields:i.fields}}static resolveMarkup(e){return c(()=>{let t=d.getAutoContextConfig();if(!ro(t))return Qa;let{profile:i,config:r}=$a(t);return Ka(i,r,this.resolverContext(r),e)},Qa)}static resolverContext(e){var r;let t=io(),i=(r=e==null?void 0:e.dataLayerMapping)==null?void 0:r.variableName;return typeof i=="string"&&i.trim()!==""&&(t.dataLayerName=i.trim()),t}static readLive(){let e=d.getArticleDetails();return e.success&&e.value?e.value:{}}static isMappingConfigured(){let e=d.getValue("articleDetailsMapping");return!!(e&&e.variableName)}static readyTimeoutMs(){let e=d.getValue("articleDetailsMapping"),t=e&&typeof e.readyTimeoutMs=="number"?e.readyTimeoutMs:Ef;return Math.max(0,Math.min(t,3e4))}static waitForArticleData(){let e=this.readyTimeoutMs(),t=Date.now();return new Promise(i=>{let r=(s,a,l)=>{this.decision||this.latch(s,a),i(this.decision)},o=()=>{let s=this.readLive();if(Object.keys(s).length>0){r(!0,s,"found");return}if(this.unloadStarted){r(!1,{},"unload started");return}if(Date.now()-t>=e){r(!1,{},`timeout ${e}ms`);return}setTimeout(o,wf)};o()})}static ensureUnloadListeners(){if(this.listenersInstalled||typeof window=="undefined")return;this.listenersInstalled=!0;let e=()=>{this.unloadStarted=!0};window.addEventListener("beforeunload",e),window.addEventListener("pagehide",e),window.addEventListener("pageshow",()=>{this.unloadStarted=!1})}};ge.decision=null,ge.pending=null,ge.unloadStarted=!1,ge.listenersInstalled=!1});var Sf,ui,ao=p(()=>{"use strict";Sf={event_id:"",publication_id:"",organisation_id:"",organisation_name:"",publication_name:"",event_time_epoc:"",event_create_year:"",event_create_month:"",event_create_date:"",platform_type:"",platform_model:"",platform_name:"",platform_version:"",platform_os_name:"",referrer_url:"",referrer_type:"",event_timestamp_utc:"",sdk_version:"",event_creation_date:"",device_id:"",session_id:"",page_view_uuid:"",page_view_url:"",page_title:"",previous_page_view_uuid:"",previous_page_view_url:"",bot_suspected:!1,agent_suspected:!1,agent_signals:"",utm_source:"",utm_medium:"",utm_campaign:"",utm_content:"",utm_term:"",gclid:"",fbclid:"",msclkid:"",first_touch_utm_source:"",first_touch_utm_medium:"",first_touch_utm_campaign:"",first_touch_utm_content:"",first_touch_utm_term:"",event_name:"",ai_source:""},ui=Sf});var Af,di,co=p(()=>{"use strict";Af={user_id:"",is_logged_in:"",user_subscription:""},di=Af});var kf,Xa,Ja=p(()=>{"use strict";kf={scroll_depth_percent:"",time_spent_seconds:"",size_category:"",engaged_reading_depth_percentage:""},Xa=kf});var Tf,Za,ec=p(()=>{"use strict";Tf={click_type:"",click_action:"",article_uuid:"",element_text:"",element_tag:"",element_url:""},Za=Tf});var Rf,tc,nc=p(()=>{"use strict";Rf={},tc=Rf});var xf,ic,rc=p(()=>{"use strict";xf={page_session_id:"",ping_sequence:"",ping_type:"",ping_interval_seconds:"",total_time_seconds:"",scroll_depth_percent:"",total_hidden_time_seconds:"",interval_active_seconds:"",interval_total_seconds:"",interval_hidden_seconds:"",is_visible:"",visibility_changes_count:"",has_scrolled:"",has_clicked:"",has_typed:"",page_load_time_epoc:"",time_since_page_load_seconds:"",time_spent_seconds:"",size_category:"",engaged_reading_depth_percentage:""},ic=xf});var Pf,oc,sc=p(()=>{"use strict";Pf={experiment_id:"",experiment_name:"",variant:"",is_control:"",variant_source:"",variant_title:"",original_title:"",target_selector:"",target_url:"",target_type:""},oc=Pf});var If,ac,cc=p(()=>{"use strict";If={click_target_tag:"",click_target_href:"",click_position:"",time_since_view_ms:""},ac=If});var Lf,lc,uc=p(()=>{"use strict";Lf={click_id:"",original_click_at:"",qualified_at:"",active_seconds_observed:""},lc=Lf});var un,dc=p(()=>{"use strict";k();m();Je();un=class{static calculateEngageReadingDepth(e,t,i={}){return E(()=>
1{if(e<0||t<0)throw new Error("Word count and time spent must be non-negative values");let o=(i.avgReadingSpeedPerMinute||this.DEFAULT_READING_SPEED)/60,s=t*o,a=0;return e>0&&(a=s/e*100,a=Math.min(100,Math.ceil(a))),{totalReadingDepthPercentage:a,totalWordReadingCapacity:s,avgReadingSpeedPerSecond:o}},{message:"Failed to calculate engage reading depth percentage",severity:"low",source:"EngageReadingDepthCalculator.calculateScrollDepth"})}static calculateEngageReadingDepthWithCustomSpeed(e,t,i){return this.calculateEngageReadingDepth(e,t,{avgReadingSpeedPerMinute:i})}};un.DEFAULT_READING_SPEED=$.ARTICLE_READING_SPEED_WPM});function lo(n){return n==="click"||n.includes("_click")}var Df,Mf,fi,fc=p(()=>{"use strict";k();m();ao();Cn();co();Ja();ec();nc();rc();sc();cc();uc();St();dc();Df=Br("page_leave"),Mf=Br("engagement_ping");fi=class n{static toIntegerString(e){if(e==null||e==="")return"0";let t=Number(e);return isNaN(t)?"0":Math.floor(t).toString()}static toBooleanString(e){if(e==null||e==="")return"false";if(typeof e=="string"){let t=e.trim().toLowerCase();if(t==="false"||t==="0")return"false"}return(!!e).toString()}static normalize(e){return E(()=>{let t=Df.has(e.event_name),i=Mf.has(e.event_name),r=e.event_name==="article_engagement_ping",o=e.event_name.startsWith("ab_experiment_"),s=e.event_name==="ab_experiment_qualified_click",a=e.event_name==="ab_experiment_click",l=!o&&lo(e.event_name),u=e.event_name==="page_view"||e.event_name==="page_leave",f={...ui,...l&&!u?Za:{},...!l&&!o&&!u&&!i?Oe:{},...!l&&!o&&u?tc:{},...!r&&i?{page_title:""}:{},...r?Oe:{},...di,...t?Xa:{},...i?ic:{},...o?oc:{},...a?ac:{},...s?lc:{}};if(e.event_name==="article_page_leave"||e.event_name==="article_engagement_ping"){let _=e.total_word_count||0,U=e.time_spent_seconds||e.total_time_seconds||0,T=un.calculateEngageReadingDepth(_,U);if(T.success){let x=T.value;e.engaged_reading_depth_percentage=x.totalReadingDepthPercentage.toString()}else e.engaged_reading_depth_percentage="0";let X="",oe=e.total_word_count;if(oe!=null&&!isNaN(Number(oe))){let x=Number(oe);x<=500?X="Small":x>500&&x<=1200?X="Medium":x>1200&&(X="Large"),e.size_category=X}}e.scroll_depth_percent;let v=new Set(Object.keys(f));v.add("consent_state");let y={...f},C={};if(typeof e.additional_info=="string")try{C=JSON.parse(e.additional_info)}catch{C={}}else typeof e.additional_info=="object"&&e.additional_info!==null&&(C=e.additional_info);for(let _ of Object.keys(e))if(!_.startsWith("ex_")&&_!=="additional_info"){if(_==="total_word_count"){(t||i)&&(C[_]=e[_]);continue}v.has(_)?y[_]=e[_]:C[_]=e[_]}if(y.additional_info=JSON.stringify(C),i){let _=["ping_sequence","time_spent_seconds","total_time_seconds","total_hidden_time_seconds","interval_total_seconds","interval_active_seconds","interval_hidden_seconds","time_since_page_load_seconds","visibility_changes_count","scroll_depth_percent","page_load_time_epoc","ping_interval_seconds"];for(let T of _)T in y&&(y[T]=n.toIntegerString(y[T]));let U=["is_visible","has_scrolled","has_clicked","has_typed"];for(let T of U)T in y&&(y[T]=n.toBooleanString(y[T]))}return y},{message:"Failed to normalize event data",severity:"medium",source:"EventNormalizer.normalize"})}}});function uo(n){let e={};for(let t of Object.keys(n))Nf.has(t)&&(e[t]=n[t]);return e}var Nf,pc=p(()=>{"use strict";Nf=new Set(["organisation_name","publication_name","publication_id","sdk_version","event_id","event_time_epoc","event_create_year","event_create_month","event_create_date","event_timestamp_utc","event_creation_date","platform_type","platform_model","platform_name","platform_version","platform_os_name","bot_suspected","agent_suspected","agent_signals","event_name","organisation_id","consent_state"])});var en={};M(en,{CONDITIONAL_STAMP_KEYS:()=>gc,EventFactory:()=>B});var gc,B,pe=p(()=>{"use strict";k();m();qr();so();fc();w();St();Nr();Ze();_e();pc();ht();Vr();Kn();gc=["content_access","page_class_signals"],B=class{static async createEvent(e,t={},i={}){return await b(async()=>{if(d.disable_get().DisableOption===!0||Zs(e,i))return null;let r=null,o=!1;if(d.getConsentConfig().enabled===!0){if(tt.evaluate(e).action==="drop")return null;
1r=S.getStampState(),o=vt(e,d.getConsentConfig().categoryMap).every(Y)}let[s,a,l]=await Promise.all([je.getCommonEventData(),i.skipArticleContext?Promise.resolve(oo()):ge.resolveContext(),je.getUserEventData()]),u=lo(e),f=!nt.has(e),g=u?{}:a.data,v=je.getPageViewContextData(),y=v.success?v.value:{};if(!s.success)throw new Error("Failed to get common event data");let C=s.value,_=l.success?l.value:{},U=a.isArticle&&!f?`${wt}${e}`:e;(!_.user_id||_.user_id==="false")&&(_.user_id=C.device_id);let T=c(()=>J.resolve(),{pageClass:"unknown",source:"default"}),X=a.isArticle?Ee.get():null,oe=c(()=>cs(),null),x={event_name:U,organisation_id:d.getValue("organisation_name"),...r?{consent_state:JSON.stringify(r)}:{},page_class:T.pageClass,page_class_source:T.source,...X!==null?{content_access:X}:{},...oe!==null?{page_class_signals:oe}:{}},Me=o?uo(x):x,Dt={...o?uo(C):C,...o?{}:g,...o?{}:_,...o?{}:y,...t,...Me};if(o)for(let Nt of[...Object.keys(x),...gc])Nt in Me||delete Dt[Nt];let Mt=fi.normalize(Dt);if(!Mt.success)throw new Error("Failed to normalize event data");return Mt.value},{message:`Failed to create ${e} event`,severity:"medium",source:"EventFactory.createEvent"})}}});var gi={};M(gi,{PageViewTracker:()=>pi});var pi,mi=p(()=>{"use strict";m();pe();Pe();k();ze();pi=class{static async track(){return this.hasTrackedView?!1:(await b(async()=>{te.recordPageView();let t=await B.createEvent("page_view");if(!t.success)throw new Error("Failed to create page view event");if(t.value===null)return!1;let r=(await ae.send(t.value)).unwrapOr(!1);return r&&(this.hasTrackedView=!0),r},{message:"Failed to track page view",severity:"medium",source:"PageViewTracker.track",eventName:"page_view"})).unwrapOr(!1)}static reset(){this.hasTrackedView=!1}};pi.hasTrackedView=!1});var L,dn=p(()=>{"use strict";hi();L=class{static initialize(e={}){this.config={...this.config,...e},typeof document!="undefined"&&(this.state.isVisible=document.visibilityState==="visible",this.state.isVisible?this.state.visibleAt=Date.now():this.state.hiddenAt=Date.now())}static handleVisibilityChange(e){if(typeof document=="undefined")return;e&&(this.onHiddenTimeoutCallback=e);let t=document.visibilityState==="visible";t&&!this.state.isVisible?this.handlePageVisible():!t&&this.state.isVisible&&this.handlePageHidden()}static handlePageVisible(){if(this.hiddenTimer&&(clearTimeout(this.hiddenTimer),this.hiddenTimer=null),this.state.hiddenAt!==null){let e=Date.now()-this.state.hiddenAt;this.state.totalHiddenTime+=e}this.state.isVisible=!0,this.state.visibleAt=Date.now(),this.state.hiddenAt=null,po()}static handlePageHidden(){fo(),this.state.isVisible=!1,this.state.hiddenAt=Date.now(),this.state.visibleAt=null,this.hiddenTimer=setTimeout(()=>{this.onHiddenTimeoutCallback&&this.onHiddenTimeoutCallback(),this.hiddenTimer=null},this.config.hiddenPageTimeout)}static getState(){return{...this.state}}static isHiddenTooLong(){return this.state.hiddenAt?Date.now()-this.state.hiddenAt>=this.config.hiddenPageTimeout:!1}static reset(){this.hiddenTimer&&(clearTimeout(this.hiddenTimer),this.hiddenTimer=null),this.state={isVisible:typeof document!="undefined"?document.visibilityState==="visible":!0,hiddenAt:null,visibleAt:null,totalHiddenTime:0},this.onHiddenTimeoutCallback=null}static getTotalHiddenTime(){let e=this.state.totalHiddenTime;return this.state.hiddenAt!==null&&(e+=Date.now()-this.state.hiddenAt),e}static getTotalHiddenTimeSeconds(){return Math.round(this.getTotalHiddenTime()/1e3)}};L.state={isVisible:typeof document!="undefined"?document.visibilityState==="visible":!0,hiddenAt:null,visibleAt:null,totalHiddenTime:0},L.hiddenTimer=null,L.config={hiddenPageTimeout:3e4},L.onHiddenTimeoutCallback=null});function re(n,e){return t=>{try{n(t)}catch(i){try{let r=i instanceof Error?i.message:String(i);console.error(`[${e}] Event listener error:`,r),i instanceof Error&&i.stack&&console.error(`[${e}] Stack trace:`,i.stack)}catch{}}}}function me(n,e){return()=>{try{n()}catch(t){try{let i=t instanceof Error?t.message:String(t);console.error(`[${e}] Callback error:`,i),t instanceof Error&&t.stack&&console.error(`[${e}] Stack trace:`,t.stack)}catch{}}}}var qe=p(()=>{"use strict"});function vi(){let n=window.scrollY||document.documentElement.scrollTop,e=window.innerHeight||document.documentElement.clientHeight,t=document.documentElement.scrollHeight;return Math.min(Math.ceil((n+e)/t*100),100)}var yi=p(()=>{"use strict"});function Ei(){return typeof performance!="undefined"?performance.now():Date.now()}function hc(){st&&(bi+=Ei()-_i,st=!1)}function Uf(){st||(_i=Ei(),st=!0)}function go(){return st?bi+(Ei()-_i):bi}function vc(){if(Te.length===0)return;let n=go();for(let e=Te.length-1;e>=0;e--){let t=Te[e];if(n>=t.thresholdMs){Te.splice(e,1);try{t.callback()}catch{}}}
1Te.length===0&&ce&&(clearInterval(ce),ce=null)}function Ff(){if(ce||typeof setInterval=="undefined")return;ce=setInterval(()=>{st&&vc()},Of);let n=ce;typeof(n==null?void 0:n.unref)=="function"&&n.unref()}function yc(){Uf(),Le&&clearTimeout(Le),Le=setTimeout(()=>{hc()},5e3),vc()}var Of,bi,_i,st,Le,Te,ce,mc,We,mo=p(()=>{"use strict";qe();yi();Of=250,bi=0,_i=typeof performance!="undefined"?performance.now():0,st=!0,Le=null,Te=[],ce=null;mc=me(yc,"ActiveTimeMonitor.onUserActivity");typeof window!="undefined"&&(["scroll","mousemove","keydown","mousedown","touchstart"].forEach(n=>window.addEventListener(n,mc,{passive:!0})),mc());We={pause(){hc(),Le&&(clearTimeout(Le),Le=null)},resume(){yc()},getActiveSecondsSincePageLoad(){return Math.round(go()/1e3)},subscribeToThreshold(n,e){let t={thresholdMs:Math.max(0,n)*1e3,callback:e};if(go()>=t.thresholdMs){try{e()}catch{}return()=>{}}return Te.push(t),Ff(),()=>{let i=Te.indexOf(t);i>=0&&Te.splice(i,1),Te.length===0&&ce&&(clearInterval(ce),ce=null)}},__resetForTests(){bi=0,_i=Ei(),st=!0,Le&&(clearTimeout(Le),Le=null),Te.length=0,ce&&(clearInterval(ce),ce=null)}}});var bc={};M(bc,{LeavePageTracker:()=>$e,pauseEngagementTimer:()=>fo,resumeEngagementTimer:()=>po});function fo(){We.pause()}function po(){We.resume()}var wi,$e,hi=p(()=>{"use strict";k();m();pe();it();dn();qe();mo();yi();Zn();wi=0;if(typeof window!="undefined"){let n=me(()=>{let e=vi();e>wi&&(wi=e)},"LeavePageTracker.updateScrollDepth");window.addEventListener("scroll",n)}$e=class n{static resetForNewView(){wi=0}static async track(e){return(await b(async()=>{let i={scroll_depth_percent:n.getScrollDepthPercent().toString(),time_spent_seconds:n.getTimeSpentSeconds().toString()};e&&(i.exit_reason=n.getExitReasonString(e),e.destinationUrl&&(i.destination_url=Se(e.destinationUrl)));let r=L.getState();i.total_hidden_time_seconds=L.getTotalHiddenTimeSeconds().toString(),i.was_visible_at_exit=r.isVisible.toString();let o=await B.createEvent("page_leave",i);if(!o.success)throw new Error("Failed to create page leave event");if(o.value===null)return!1;let s=await fe.send("/event",o.value);return s.success?s.value.success:!1},{message:"Failed to track page leave",severity:"medium",source:"LeavePageTracker.track",eventName:"page_leave"})).unwrapOr(!1)}static getScrollDepthPercent(){return wi}static getTimeSpentSeconds(){return We.getActiveSecondsSincePageLoad()}static getExitReasonString(e){return e.type}}});var Ec={};M(Ec,{ClickTracker:()=>vo});var Cc,Bf,Vf,Hf,Kf,_c,zf,jf,ho,Gf,qf,Wf,$f,V,vo,wc=p(()=>{"use strict";k();m();pe();Pe();it();qr();w();Xn();Cc=new Set(["ad","ads","advert","advertisement","advertising","banner"]),Bf=new Set(["share","youtube","social","facebook","twitter","linkedin","instagram","whatsapp","pinterest","mail","gmail","telegram","reddit"]),Vf=new Set(["player","media","video"]),Hf=/googlesyndication|doubleclick|googleadservices/,Kf=[/twitter\.com\/intent\//i,/\bx\.com\/intent\//i,/facebook\.com\/(sharer|dialog\/(share|feed))/i,/linkedin\.com\/(shareArticle|sharing\/share-offsite)/i,/pinterest\.[a-z.]+\/pin\/create/i,/reddit\.com\/submit/i,/(api|web)\.whatsapp\.com\/send/i,/\bwa\.me\//i,/t\.me\/share/i,/tumblr\.com\/(share|widgets\/share)/i,/service\.weibo\.com\/share/i,/telegram\.me\/share/i,/^mailto:\?(subject|body)=/i],_c=200,zf=150,jf=/\.(pdf|zip|doc|docx|xls|xlsx|ppt|pptx|csv|mp3|mp4|mov|avi|wmv|tar|gz|7z|rar|exe|dmg|apk|epub)(?:[?#]|$)/i,ho=/^(mailto|tel|sms):/i,Gf=new Set(["button","select","textarea","input","option","label","summary","details"]),qf=new Set(["button","link","checkbox","radio","switch","tab","menuitem","menuitemcheckbox","menuitemradio","option","treeitem","combobox","listbox","slider","spinbutton","searchbox","textbox"]),Wf=["onclick","aria-expanded","aria-controls","aria-haspopup"],$f=5,V=class V{static async trackClick(e,t=!1,i){let r=t||e.wasRightClicked===!0,o=V.getEventTypeFromClick(e),s=V.resolveClickAction(r,i);if(V.isSyntheticLabelClick(e)||o==="inert"&&s==="left"&&!V.shouldTrackInertClick())return!1;Ke.touchSession();let a=await V.extractClickInfo(e);return(await b(async()=>{let u=await B.createEvent("click",{click_type:o,click_action:s,...a});if(!u.success)throw new Error("Failed to create click event");
1if(u.value===null)return!1;if(V.NAVIGATING_CLICK_TYPES.has(o)&&s==="left"){let g=await fe.send("/event",u.value);return g.success&&g.value.success}return(await ae.send(u.value)).unwrapOr(!1)},{message:"Failed to track click event",severity:"low",source:"ClickTracker.trackClick",eventName:"click"})).unwrapOr(!1)}static resolveClickAction(e,t){return e?"right":t?t.button===2?"right":t.button===1?"middle":t.ctrlKey||t.metaKey||t.shiftKey?"new_tab":"left":"left"}static isSyntheticLabelClick(e){var t;try{let i=Date.now(),r=V.lastLabelControl;if(e.tagName&&e.tagName.toLowerCase()==="label"){let o=e,s=(t=o.control)!=null?t:null;return!s&&o.htmlFor&&(s=document.getElementById(o.htmlFor)),V.lastLabelControl={control:s,at:i},!1}return r&&r.control===e&&i-r.at<=zf?(V.lastLabelControl=null,!0):!1}catch{return!1}}static shouldTrackInertClick(){try{let e=d.getClickTrackingConfig();if(e.trackInertClicks!==!0)return!1;let t=e.inertClickSamplingRate;return t>=1?!0:t<=0?!1:Math.random()<t}catch{return!1}}static async extractClickInfo(e){var u;let[t]=await Promise.all([je.getArticleEventData()]),{tag:i,text:r,href:o,iframeSrc:s,imgSrc:a}=this.normalizeTargetAttributes(e),l="";return i==="img"?l=a:i==="i"||i==="a"||o?l=o:l=s!=null?s:o,{article_uuid:t.success&&(u=t.value.article_uuid)!=null?u:"",element_tag:i,element_text:r,element_url:l}}static normalizeTargetAttributes(e){let t=e.tagName.toLowerCase(),i=V.normalizeElementText(e.textContent),r=(e.className||"").toLowerCase(),o=(e.id||"").toLowerCase(),s=e.href||e.getAttribute("href")||"";if(!s){let g=e.closest("a[href]");g&&(s=g.href||g.getAttribute("href")||"")}let a=s.toLowerCase(),l=`${r} ${o}`,u=this.getIframeSrc(e),f="";if(t==="img")f=e.src||"";else{let g=e.querySelector("img");g&&(f=g.src||"")}return{tag:t,text:i,classes:r,classIdText:l,id:o,href:s,hrefLower:a,iframeSrc:u,imgSrc:f}}static normalizeElementText(e){let t=(e||"").replace(/\s+/g," ").trim();return t.length>_c?t.slice(0,_c):t}static getIframeSrc(e){if(e.tagName.toLowerCase()==="iframe")return e.src||e.getAttribute("src")||"";let i=[".plyr",".flowplayer-embed-container",".video-container",".ew-embed",".article__iframe"];for(let o of i){let s=e.closest(o);if(s){let a=s.querySelector("iframe");if(a)return a.getAttribute("src")||a.src||""}}let r=e.querySelector("iframe");return(r==null?void 0:r.getAttribute("src"))||(r==null?void 0:r.src)||""}static getEventTypeFromClick(e){let{tag:t,classIdText:i,href:r,hrefLower:o,iframeSrc:s,imgSrc:a}=this.normalizeTargetAttributes(e),l=i.split(/[\W_]+/).filter(Boolean);return this.isAd(e,l,a,s)?"ad":this.isShare(l,o)?"share":t==="img"||t==="video"||t==="audio"||t==="iframe"||s||this.matchesAnyToken(l,Vf)?"media":this.isMailtoTel(o)?"mailto_tel":this.isDownload(o)?"download":this.isOutbound(o)?"outbound":t==="a"||r?"link":this.isInteractiveClick(e)?"interactive":"inert"}static isInteractiveClick(e){try{let t=e,i=0;for(;t&&i<$f;){if(V.isInteractiveElement(t))return!0;t=t.parentElement,i++}return!1}catch{return!1}}static isInteractiveElement(e){let t=e.tagName?e.tagName.toLowerCase():"";if(Gf.has(t)||t==="a"&&e.hasAttribute("href"))return!0;let i=(e.getAttribute("role")||"").trim().toLowerCase();if(i&&qf.has(i))return!0;for(let o of Wf)if(e.hasAttribute(o))return!0;let r=e.getAttribute("tabindex");return r!==null&&r.trim()!==""&&Number(r)>=0||e.isContentEditable?!0:V.hasPointerCursor(e)}static hasPointerCursor(e){try{return typeof window=="undefined"||typeof window.getComputedStyle!="function"?!1:window.getComputedStyle(e).cursor==="pointer"}catch{return!1}}static isMailtoTel(e){return e?ho.test(e):!1}static isDownload(e){return!e||ho.test(e)?!1:jf.test(e)}static isOutbound(e){if(!e||e.startsWith("#")||e.startsWith("?")||e.startsWith("/")&&!e.startsWith("//")||ho.test(e))return!1;try{let t=e.startsWith("//")?"https:"+e:e,i=new URL(t);return i.protocol!=="http:"&&i.protocol!=="https:"||typeof window=="undefined"||!window.location?!1:!V.isInternalHost(i.hostname.toLowerCase(),window.location.hostname.toLowerCase())}catch{return!1}}static isInternalHost(e,t){if(!e)return!1;let i=s=>s.startsWith("www.")?s.slice(4):s,r=i(e),o=i(t);if(r===o||r.endsWith("."+o)||o.endsWith("."+r))return!0;try{for(let s of d.getClickTrackingConfig().internalHosts){let a=String(s||"").trim().toLowerCase();if(a){if(a.startsWith(".")){if(e===a.slice(1)||e.endsWith(a))return!0}else if(e===a||i(a)===r)return!0}}}catch{}return!1}static isShare(e,t){return this.matchesAnyToken(e,Bf)?!0:t?Kf.some(i=>i.test(t)):!1}static matchesAnyToken(e,t){for(let i of e)if(t.has(i))return!0;return!1}static isAd(e,t,i,r){if(this.matchesAnyToken(t,Cc)||e.hasAttribute("data-ad")||e.hasAttribute("data-google-ad")||typeof e.id=="string"&&e.id.startsWith("google_ads_"))return!0;let o=`${i} ${r}`.toLowerCase();if(!o.trim())return!1;
1let s=o.split(/[\W_]+/).filter(Boolean);return this.matchesAnyToken(s,Cc)?!0:Hf.test(o)}};V.NAVIGATING_CLICK_TYPES=new Set(["outbound","download","mailto_tel"]),V.lastLabelControl=null;vo=V});var kc={};M(kc,{TcfProvider:()=>yo,mapTcDataToSnapshot:()=>Ac});function Si(n,e){if(!n||typeof n!="object")return{};let t=n[e];return!t||typeof t!="object"?{}:t}function Sc(n){return typeof n!="number"||!Number.isInteger(n)||n<=0?null:n}function Ac(n,e=Rn,t={}){return c(()=>{let i=n&&typeof n=="object"?n:{},r=i.gdprApplies===!0,o=t&&typeof t=="object"?t:{},s=o.allowLegitimateInterest===!0,a=Sc(o.vendorId),l=Si(i.purpose,"consents"),u=s?Si(i.purpose,"legitimateInterests"):{},f=a===null?!0:Si(i.vendor,"consents")[String(a)]===!0,g=a===null?!0:Si(i.vendor,"legitimateInterests")[String(a)]===!0,v=e&&typeof e=="object"?e:Rn,y={};for(let C of z){let _=0,U=!1;for(let T of Object.keys(v)){let X=Number(T);if(v[X]!==C)continue;let oe=l[T],x=typeof oe=="boolean",Me=oe===!0&&f,Dt=s&&hs(X),Mt=Dt?u[T]:void 0,Nt=Dt&&typeof Mt=="boolean",Ko=Mt===!0&&g;!x&&!Nt||(_+=1,!Me&&!Ko&&(U=!0))}_!==0&&(y[C]=U?"denied":"granted")}return{source:"tcf",regionApplies:r,categories:y,raw:n,ts:Date.now()}},{source:"tcf",regionApplies:!1,categories:{},raw:n,ts:Date.now()})}var Yf,Qf,Xf,yo,Tc=p(()=>{"use strict";m();_e();Yt();Yf=3e3,Qf=100,Xf=["tcloaded","useractioncomplete"];yo=class{constructor(e={}){this.id="tcf";this.precedence=He.tcf;this.regions=["EU"];this.emit=null;this.listenerId=null;this.listener=null;this.pollTimer=null;this.torndown=!1;this.waitForCmpMs=typeof e.waitForCmpMs=="number"&&e.waitForCmpMs>=0?e.waitForCmpMs:Yf,this.purposeMap=e.purposeMap&&typeof e.purposeMap=="object"?e.purposeMap:Rn;let t=Sc(e.vendorId);e.vendorId,this.legalBasis={allowLegitimateInterest:e.allowLegitimateInterest===!0,...t!==null?{vendorId:t}:{}}}async init(e){this.emit=e,this.torndown=!1;let t=await this.waitForTcfApi();this.torndown||t&&c(()=>{this.listener=(i,r)=>this.onTcData(i,r),t("addEventListener",2,(i,r)=>{let o=i&&typeof i=="object"?i.listenerId:void 0;typeof o=="number"&&this.listenerId===null&&(this.listenerId=o),this.listener&&this.listener(i,r)})},void 0)}teardown(){this.torndown=!0,this.pollTimer!==null&&(clearInterval(this.pollTimer),this.pollTimer=null),c(()=>{let e=this.getTcfApi();e&&this.listenerId!==null&&this.listener&&e("removeEventListener",2,this.listener,this.listenerId)},void 0),this.listener=null,this.listenerId=null,this.emit=null}onTcData(e,t){c(()=>{if(this.torndown||!this.emit||t!==!0)return;let i=e&&typeof e=="object"?e.eventStatus:void 0;if(typeof i=="string"&&Xf.indexOf(i)===-1)return;let r=Ac(e,this.purposeMap,this.legalBasis);this.emit(r)},void 0)}getTcfApi(){return c(()=>{let e=typeof window!="undefined"?window.__tcfapi:void 0;return typeof e=="function"?e:null},null)}waitForTcfApi(){return new Promise(e=>{let t=this.getTcfApi();if(t){e(t);return}let i=Date.now()+this.waitForCmpMs;this.pollTimer=setInterval(()=>{if(this.torndown){this.pollTimer!==null&&clearInterval(this.pollTimer),this.pollTimer=null,e(null);return}let r=this.getTcfApi();(r||Date.now()>=i)&&(this.pollTimer!==null&&clearInterval(this.pollTimer),this.pollTimer=null,e(r))},Qf)})}}});var ee,Ai=p(()=>{"use strict";w();qe();m();ze();ee=class{static subscribe(e,t={}){return typeof window=="undefined"||typeof history=="undefined"?()=>{}:(t.trackHashChanges&&!this.config.trackHashChanges&&(this.config.trackHashChanges=!0,this.isInitialized&&this.setupHashChangeListener()),this.ensureInstalled(),this.subscribers.add(e),()=>{this.subscribers.delete(e)})}static initialize(e,t={}){this.subscribe(e,t)}static ensureInstalled(){this.isInitialized||(this.lastUrl=window.location.href,this.wrapPushState(),this.wrapReplaceState(),this.setupPopStateListener(),this.config.trackHashChanges&&this.setupHashChangeListener(),this.isInitialized=!0)}static wrapPushState(){this.originalPushState=history.pushState,history.pushState=(e,t,i)=>{this.originalPushState.call(history,e,t,i),this.hasUrlChanged()&&this.handleNavigation("pushState")}}static wrapReplaceState(){this.originalReplaceState=history.replaceState,history.replaceState=(e,t,i)=>{this.originalReplaceState.call(history,e,t,i),this.hasUrlChanged()&&(d.getSpaNavigationConfig().treatReplaceStateAsNavigation?this.handleNavigation("replaceState"):this.handleUrlCorrection())}}static handleUrlCorrection(){if(typeof window=="undefined")return;let e=window.location.href,t=this.lastUrl;this.lastUrl=e,c(()=>{te.correctCurrentUrl(e)},void 0)}static setupPopStateListener(){this.popstateListener=re(e=>{this.handlePopState(e)},"SPANavigationDetector.popstate"),window.addEventListener("popstate",this.popstateListener)}static handlePopState(e){this.hasUrlChanged()&&this.handleNavigation("popstate")}static setupHashChangeListener(){this.hashchangeListener||(this.hashchangeListener=re(e=>{this.handleHashChange(e)},"SPANavigationDetector.hashchange"),window.addEventListener("hashchange",this.hashchangeListener))}static handleHashChange(e){this.hasUrlChanged()&&this.handleNavigation("hashchange")}static hasUrlChanged(){return typeof window=="undefined"?!1:window.location.href!==this.lastUrl}static handleNavigation(e){if(typeof window=="undefined")return;let t=window.location.href,r={from:this.lastUrl,to:t,timestamp:Date.now(),method:e};
1this.lastUrl=t,this.subscribers.forEach(o=>{try{o(r)}catch{}})}static cleanup(){this.isInitialized&&(this.originalPushState&&(history.pushState=this.originalPushState),this.originalReplaceState&&(history.replaceState=this.originalReplaceState),this.popstateListener&&(window.removeEventListener("popstate",this.popstateListener),this.popstateListener=null),this.hashchangeListener&&(window.removeEventListener("hashchange",this.hashchangeListener),this.hashchangeListener=null),this.subscribers.clear(),this.lastUrl="",this.isInitialized=!1)}static getCurrentUrl(){return typeof window!="undefined"?window.location.href:""}static getIsInitialized(){return this.isInitialized}};ee.lastUrl="",ee.subscribers=new Set,ee.config={trackHashChanges:!1},ee.isInitialized=!1,ee.popstateListener=null,ee.hashchangeListener=null});var he,ki=p(()=>{"use strict";qe();he=class{static subscribe(e){return typeof window=="undefined"?()=>{}:(this.ensureInstalled(),this.subscribers.add(e),()=>{this.subscribers.delete(e)})}static ensureInstalled(){this.isInitialized||(this.pageshowListener=re(e=>{this.handlePageShow(e)},"BfcacheRestoreDetector.pageshow"),window.addEventListener("pageshow",this.pageshowListener),this.isInitialized=!0)}static handlePageShow(e){e.persisted&&this.subscribers.forEach(t=>{try{t()}catch{}})}static cleanup(){this.isInitialized&&(this.pageshowListener&&(window.removeEventListener("pageshow",this.pageshowListener),this.pageshowListener=null),this.subscribers.clear(),this.isInitialized=!1)}static getIsInitialized(){return this.isInitialized}static getSubscriberCount(){return this.subscribers.size}};he.subscribers=new Set,he.isInitialized=!1,he.pageshowListener=null});var Rc={};M(Rc,{PageLeaveCoordinator:()=>le});var le,xc=p(()=>{"use strict";dn();Ai();ki();hi();m();k();$t();qe();le=class{static initialize(e){this.isInitialized||typeof window!="undefined"&&(this.config={...this.config,...e},this.state.lastUrl=window.location.href,this.config.enableVisibilityTracking&&L.initialize({hiddenPageTimeout:this.config.hiddenPageTimeout}),this.config.enableSPATracking&&(this.spaUnsubscribe=ee.subscribe(t=>this.handleSPANavigation(t),{trackHashChanges:this.config.trackHashChanges})),this.setupEventListeners(),this.isInitialized=!0)}static setupEventListeners(){this.beforeUnloadListener=re(e=>{this.handleBeforeUnload(e)},"PageLeaveCoordinator.beforeunload"),window.addEventListener("beforeunload",this.beforeUnloadListener),this.pageHideListener=re(e=>{this.handlePageHide(e)},"PageLeaveCoordinator.pagehide"),window.addEventListener("pagehide",this.pageHideListener),this.bfcacheUnsubscribe=he.subscribe(()=>{this.handleBfcacheRestore()}),this.config.enableVisibilityTracking&&(this.visibilityChangeListener=re(e=>{this.handleVisibilityChange()},"PageLeaveCoordinator.visibilitychange"),document.addEventListener("visibilitychange",this.visibilityChangeListener))}static handleBeforeUnload(e){let t={type:"navigation",timestamp:Date.now()};this.triggerPageLeave(t,"beforeunload")}static handlePageHide(e){let t="browser_close";this.config.enableVisibilityTracking&&typeof document!="undefined"&&document.visibilityState==="hidden"&&(t="tab_switch");let i={type:t,timestamp:Date.now()};this.triggerPageLeave(i,"pagehide")}static handleBfcacheRestore(){this.reset(),$e.resetForNewView(),this.state.isRestoredFromCache=!0,(async()=>{try{let[e,t]=await Promise.all([Promise.resolve().then(()=>(ze(),Kr)),Promise.resolve().then(()=>(mi(),gi))]);e.PageViewContext.rotateForRestore(),t.PageViewTracker.reset(),await t.PageViewTracker.track()}catch{}})()}static handleVisibilityChange(){typeof document!="undefined"&&(this.config.enableVisibilityTracking&&L.handleVisibilityChange(()=>{let e={type:"timeout",timestamp:Date.now()};this.triggerPageLeave(e,"visibilitychange-timeout")}),document.visibilityState)}static async handleSPANavigation(e){let t={type:"spa_navigation",timestamp:e.timestamp,destinationUrl:e.to};if(this.shouldSendPageLeave("spa_navigation")){this.currentExitReason=t,this.markAsLeft();try{await $e.track(t)}catch{}}this.reset(),$e.resetForNewView(),this.state.lastUrl=e.to;try{let[i,r]=await Promise.all([Promise.resolve().then(()=>(ze(),Kr)),Promise.resolve().then(()=>(mi(),gi))]);i.PageViewContext.recordPageView(e.to),r.PageViewTracker.reset(),await r.PageViewTracker.track()}catch{}}static shouldProcessEvent(e){if(this.state.eventsFired.add(e),de.isIOSSafari()){if(this.state.eventsFired.has("pagehide")){let t=e==="pagehide";return t}return!0}if(de.isDesktop()){if(this.state.eventsFired.has("visibilitychange-timeout")){let t=e==="visibilitychange-timeout";return t}return!0}return!0}
1static shouldSendPageLeave(e){return!(!this.shouldProcessEvent(e)||this.state.hasLeft||this.state.leaveEventSentAt!==null&&Date.now()-this.state.leaveEventSentAt<100)}static markAsLeft(){this.state.hasLeft=!0,this.state.leaveEventSentAt=Date.now()}static getExitReason(){return this.currentExitReason}static reset(){this.state.hasLeft=!1,this.state.leaveEventSentAt=null,this.state.isRestoredFromCache=!1,this.state.eventsFired.clear(),this.currentExitReason=null,this.config.enableVisibilityTracking&&L.reset()}static triggerPageLeave(e,t){b(async()=>{this.shouldSendPageLeave(t)&&(this.currentExitReason=e,this.markAsLeft(),await $e.track(e))},{message:"Failed to trigger page leave event",severity:"medium",source:"PageLeaveCoordinator.triggerPageLeave",eventName:"page_leave"})}static cleanup(){this.isInitialized&&(this.beforeUnloadListener&&(window.removeEventListener("beforeunload",this.beforeUnloadListener),this.beforeUnloadListener=null),this.pageHideListener&&(window.removeEventListener("pagehide",this.pageHideListener),this.pageHideListener=null),this.visibilityChangeListener&&(document.removeEventListener("visibilitychange",this.visibilityChangeListener),this.visibilityChangeListener=null),this.spaUnsubscribe&&(this.spaUnsubscribe(),this.spaUnsubscribe=null),this.bfcacheUnsubscribe&&(this.bfcacheUnsubscribe(),this.bfcacheUnsubscribe=null),this.reset(),this.isInitialized=!1)}static getState(){return{...this.state}}static getIsInitialized(){return this.isInitialized}};le.state={hasLeft:!1,leaveEventSentAt:null,currentSessionId:"",lastUrl:typeof window!="undefined"?window.location.href:"",isRestoredFromCache:!1,eventsFired:new Set},le.config={hiddenPageTimeout:3e4,enableSPATracking:!1,enableVisibilityTracking:!0,trackHashChanges:!1},le.isInitialized=!1,le.currentExitReason=null,le.beforeUnloadListener=null,le.pageHideListener=null,le.visibilityChangeListener=null,le.spaUnsubscribe=null,le.bfcacheUnsubscribe=null});function Ye(){return typeof performance!="undefined"&&performance.now?performance.now():(Pc||(Pc=!0),Date.now())}var Pc,P,bo=p(()=>{"use strict";dn();qe();yi();Pc=!1;P=class{static initialize(){if(this.isInitialized||typeof window=="undefined")return;this.state.pageStartTime=Ye(),this.state.lastActiveTime=Ye(),L.getState().isVisible||(this.state.isActive=!1),this.setupActivityListeners(),this.setupScrollDepthTracking(),this.setupActiveTimeTracking(),this.isInitialized=!0}static setupActivityListeners(){this.scrollListener=me(()=>{this.state.hasScrolled=!0},"EngagementMetrics.onScroll"),window.addEventListener("scroll",this.scrollListener,{passive:!0}),this.clickListener=me(()=>{this.state.hasClicked=!0},"EngagementMetrics.onClick"),window.addEventListener("click",this.clickListener,{passive:!0}),this.mousedownListener=me(()=>{this.state.hasClicked=!0},"EngagementMetrics.onMousedown"),window.addEventListener("mousedown",this.mousedownListener,{passive:!0}),this.keydownListener=me(()=>{this.state.hasTyped=!0},"EngagementMetrics.onKeydown"),window.addEventListener("keydown",this.keydownListener,{passive:!0})}static setupScrollDepthTracking(){this.scrollDepthListener=me(()=>{let e=vi();e>this.state.maxScrollDepth&&(this.state.maxScrollDepth=e)},"EngagementMetrics.updateScrollDepth"),window.addEventListener("scroll",this.scrollDepthListener,{passive:!0}),this.scrollDepthListener(new Event("scroll"))}static setupActiveTimeTracking(){let t=me(()=>{this.resumeActiveTimer(),this.state.inactivityTimeout&&clearTimeout(this.state.inactivityTimeout),this.state.inactivityTimeout=setTimeout(()=>{this.pauseActiveTimer()},5e3)},"EngagementMetrics.onUserActivity");["scroll","mousemove","keydown","mousedown","touchstart"].forEach(r=>{let o=t;window.addEventListener(r,o,{passive:!0}),this.activityListeners.push({event:r,listener:o})}),t()}static pauseActiveTimer(){this.state.isActive&&(this.state.accumulatedActiveTime+=Ye()-this.state.lastActiveTime,this.state.isActive=!1)}static resumeActiveTimer(){this.state.isActive||(this.state.lastActiveTime=Ye(),this.state.isActive=!0)}static peekActiveTimeSeconds(){try{return this.isInitialized?this.getActiveTimeSeconds():0}
1catch{return 0}}static getActiveTimeSeconds(){let e=this.state.accumulatedActiveTime;return this.state.isActive&&(e+=Ye()-this.state.lastActiveTime),Math.round(e/1e3)}static getTotalTimeSeconds(){let e=Ye()-this.state.pageStartTime;return Math.round(e/1e3)}static getScrollDepthPercent(){return this.state.maxScrollDepth}static getTotalHiddenTimeSeconds(){return L.getTotalHiddenTimeSeconds()}static getVisibilityChangesCount(){return this.state.visibilityChangesCount}static isVisible(){return L.getState().isVisible}static calculateIntervalMetrics(e,t,i){let r=Math.max(0,e-this.state.previousActiveTime),o=Math.max(0,t-this.state.previousTotalTime),s=Math.max(0,i-this.state.previousHiddenTime);return{active:r,total:o,hidden:s}}static resetActivitySignals(){this.state.hasScrolled=!1,this.state.hasClicked=!1,this.state.hasTyped=!1}static getSnapshot(){try{this.isInitialized||this.initialize();let e=this.getActiveTimeSeconds(),t=this.getTotalTimeSeconds(),i=this.getScrollDepthPercent(),r=this.getTotalHiddenTimeSeconds(),o=this.getVisibilityChangesCount(),s=this.isVisible(),a=this.calculateIntervalMetrics(e,t,r),l=this.state.hasScrolled,u=this.state.hasClicked,f=this.state.hasTyped,g={time_spent_seconds:e,total_time_seconds:t,scroll_depth_percent:i,total_hidden_time_seconds:r,visibility_changes_count:o,is_visible:s,interval_active_seconds:a.active,interval_total_seconds:a.total,interval_hidden_seconds:a.hidden,has_scrolled:l,has_clicked:u,has_typed:f};return this.state.previousActiveTime=e,this.state.previousTotalTime=t,this.state.previousHiddenTime=r,this.resetActivitySignals(),g}catch(e){throw new Error(`Failed to generate engagement snapshot: ${e instanceof Error?e.message:String(e)}`)}}static incrementVisibilityChanges(){this.state.visibilityChangesCount++}static pause(){this.pauseActiveTimer(),this.state.inactivityTimeout&&(clearTimeout(this.state.inactivityTimeout),this.state.inactivityTimeout=null)}static resume(){this.resumeActiveTimer(),this.state.inactivityTimeout&&clearTimeout(this.state.inactivityTimeout),this.state.inactivityTimeout=setTimeout(()=>{this.pauseActiveTimer()},5e3)}static reset(){this.state.inactivityTimeout&&clearTimeout(this.state.inactivityTimeout);let e=0;try{e=L.getTotalHiddenTimeSeconds()}catch{e=0}this.state={hasScrolled:!1,hasClicked:!1,hasTyped:!1,previousActiveTime:0,previousTotalTime:0,previousHiddenTime:e,visibilityChangesCount:0,accumulatedActiveTime:0,lastActiveTime:Ye(),isActive:!0,inactivityTimeout:null,maxScrollDepth:0,pageStartTime:Ye()},this.isInitialized&&(this.removeActivityListeners(),this.setupActiveTimeTracking())}static removeActivityListeners(){typeof window!="undefined"&&(this.activityListeners.forEach(({event:e,listener:t})=>{window.removeEventListener(e,t)}),this.activityListeners=[])}static cleanup(){typeof window!="undefined"&&(this.state.inactivityTimeout&&(clearTimeout(this.state.inactivityTimeout),this.state.inactivityTimeout=null),this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener),this.scrollListener=null),this.clickListener&&(window.removeEventListener("click",this.clickListener),this.clickListener=null),this.mousedownListener&&(window.removeEventListener("mousedown",this.mousedownListener),this.mousedownListener=null),this.keydownListener&&(window.removeEventListener("keydown",this.keydownListener),this.keydownListener=null),this.scrollDepthListener&&(window.removeEventListener("scroll",this.scrollDepthListener),this.scrollDepthListener=null),this.removeActivityListeners(),this.isInitialized=!1)}};P.isInitialized=!1,P.state={hasScrolled:!1,hasClicked:!1,hasTyped:!1,previousActiveTime:0,previousTotalTime:0,previousHiddenTime:0,visibilityChangesCount:0,accumulatedActiveTime:0,lastActiveTime:0,isActive:!0,inactivityTimeout:null,maxScrollDepth:0,pageStartTime:0},P.scrollListener=null,P.clickListener=null,P.mousedownListener=null,P.keydownListener=null,P.activityListeners=[],P.scrollDepthListener=null});function Lc(){return typeof performance!="undefined"&&performance.now?performance.now():(Ic||(Ic=!0),Date.now())}var Ic,H,Co=p(()=>{"use strict";Kt();Ic=!1;H=class{static generateNewSession(){return this.currentPageSessionId=Ue(),this.pageLoadTime=Math.floor(Date.now()/1e3),this.elapsedBaseline=Lc(),this.currentPageSessionId}static getCurrentPageSessionId(){return this.currentPageSessionId?this.currentPageSessionId:this.generateNewSession()}static getPageLoadTimeEpoc(){return this.pageLoadTime}static getTimeSincePageLoad(){if(this.pageLoadTime===0)return 0;let e=Lc()-this.elapsedBaseline;return Math.max(0,Math.floor(e/1e3))}static reset(){this.currentPageSessionId=null,this.pageLoadTime=0,this.elapsedBaseline=0}};H.currentPageSessionId=null,H.pageLoadTime=0,H.elapsedBaseline=0});var D,Dc=p(()=>{"use strict";bo();Co();pe();it();Xn();D=class{static initialize(e){this.isInitialized||typeof window!="undefined"&&(this.config=this.validateConfig(e||{}),this.isInitialized=!0)}static validateConfig(e){let t={enabled:e.enabled!==void 0?e.enabled:!0,firstPingDelaySeconds:2,pingIntervalSeconds:15,minEngagementThreshold:2,sendOnVisibilityChange:e.sendOnVisibilityChange!==void 0?e.sendOnVisibilityChange:!0,minActiveTimeForVisibilityPing:e.minActiveTimeForVisibilityPing!==void 0?e.minActiveTimeForVisibilityPing:3,visibilityDebounceMs:e.visibilityDebounceMs!==void 0?e.visibilityDebounceMs:1e3,sendClosingPing:e.sendClosingPing!==void 0?e.sendClosingPing:!0,minActiveTimeForClosingPing:e.minActiveTimeForClosingPing!==void 0?e.minActiveTimeForClosingPing:2,pingDecaySchedule:Array.isArray(e.pingDecaySchedule)?e.pingDecaySchedule:[],pingSamplingRate:e.pingSamplingRate!==void 0&&Number.isFinite(e.pingSamplingRate)&&e.pingSamplingRate>=0&&e.pingSamplingRate<=1?e.pingSamplingRate:1};return e.firstPingDelaySeconds!==void 0&&(e.firstPingDelaySeconds<2||e.firstPingDelaySeconds>60?t.firstPingDelaySeconds=2:t.firstPingDelaySeconds=e.firstPingDelaySeconds),e.pingIntervalSeconds!==void 0&&(e.pingIntervalSeconds<5||e.pingIntervalSeconds>60?t.pingIntervalSeconds=15:t.pingIntervalSeconds=e.pingIntervalSeconds),e.minEngagementThreshold!==void 0&&(e.minEngagementThreshold<0||e.minEngagementThreshold>60?t.minEngagementThreshold=2:t.minEngagementThreshold=e.minEngagementThreshold),e.minActiveTimeForClosingPing!==void 0&&(e.minActiveTimeForClosingPing<0||e.minActiveTimeForClosingPing>60?t.minActiveTimeForClosingPing=2:t.minActiveTimeForClosingPing=e.minActiveTimeForClosingPing),t}
1static start(){if(!this.isInitialized||!this.config.enabled||this.state.isRunning||(this.state.sampledOut=this.config.pingSamplingRate<1&&Math.random()>=this.config.pingSamplingRate,this.state.sampledOut))return;this.state.isRunning=!0;let e=this.config.firstPingDelaySeconds*1e3;this.state.firstPingTimerId=setTimeout(()=>{this.sendFirstPing().catch(t=>{})},e)}static async sendFirstPing(){try{if(this.state.pageLeaveInitiated){this.startRegularInterval();return}P.peekActiveTimeSeconds()>=this.config.minEngagementThreshold&&(await this.sendPing("timer"),this.state.firstPingSent=!0),this.startRegularInterval()}catch{this.startRegularInterval()}}static currentIntervalSeconds(){let e=this.config.pingDecaySchedule,t=this.config.pingIntervalSeconds;if(e&&e.length>0){let i=H.getTimeSincePageLoad();for(let r of e)if(i>=r.afterSeconds)t=r.intervalSeconds;else break}return t}static startRegularInterval(){this.state.isRunning&&(this.state.timerId&&(clearTimeout(this.state.timerId),this.state.timerId=null),this.scheduleNextPing(),this.state.lastPingTime=Date.now())}static scheduleNextPing(){if(!this.state.isRunning)return;let e=this.currentIntervalSeconds()*1e3;this.state.timerId=setTimeout(()=>{if(this.state.pageLeaveInitiated){this.scheduleNextPing();return}this.sendPing("timer").catch(t=>{}).finally(()=>{this.scheduleNextPing()})},e)}static stop(){this.state.isRunning&&(this.state.firstPingTimerId&&(clearTimeout(this.state.firstPingTimerId),this.state.firstPingTimerId=null),this.state.timerId&&(clearTimeout(this.state.timerId),this.state.timerId=null),this.state.isRunning=!1)}static pause(){this.state.isRunning&&(this.state.firstPingTimerId&&(clearTimeout(this.state.firstPingTimerId),this.state.firstPingTimerId=null),this.state.timerId&&(clearTimeout(this.state.timerId),this.state.timerId=null))}static resume(){if(!(!this.isInitialized||!this.config.enabled)&&this.state.isRunning)if(this.state.firstPingTimerId&&(clearTimeout(this.state.firstPingTimerId),this.state.firstPingTimerId=null),this.state.timerId&&(clearTimeout(this.state.timerId),this.state.timerId=null),this.state.firstPingSent)this.scheduleNextPing();else{let e=this.config.firstPingDelaySeconds*1e3;this.state.firstPingTimerId=setTimeout(()=>{this.sendFirstPing().catch(t=>{})},e)}}static handleVisibilityChange(){!this.isInitialized||!this.config.enabled||this.state.pageLeaveInitiated||this.state.sampledOut||this.config.sendOnVisibilityChange&&this.shouldSendVisibilityPing()&&(this.state.lastVisibilityChangeTime=Date.now(),this.sendPing("visibility_change").catch(e=>{}))}static shouldSendVisibilityPing(){return!(Date.now()-this.state.lastVisibilityChangeTime<this.config.visibilityDebounceMs||P.peekActiveTimeSeconds()<this.config.minActiveTimeForVisibilityPing)}static async sendPing(e){try{if(this.state.pageLeaveInitiated&&e!=="page_leave")return;e!=="page_leave"&&this.state.pingSequence++;let t;try{t=P.getSnapshot()}catch{t={time_spent_seconds:0,total_time_seconds:0,scroll_depth_percent:0,total_hidden_time_seconds:0,visibility_changes_count:0,is_visible:!0,interval_active_seconds:0,interval_total_seconds:0,interval_hidden_seconds:0,has_scrolled:!1,has_clicked:!1,has_typed:!1}}(t.interval_active_seconds>0||t.has_scrolled||t.has_clicked||t.has_typed)&&Ke.touchSession();let i,r,o;try{i=H.getCurrentPageSessionId(),r=H.getPageLoadTimeEpoc(),o=H.getTimeSincePageLoad()}catch{return}let s={page_session_id:i,ping_sequence:this.state.pingSequence,ping_type:e,ping_interval_seconds:this.currentIntervalSeconds(),ping_sample_rate:this.config.pingSamplingRate,time_spent_seconds:t.time_spent_seconds,total_time_seconds:t.total_time_seconds,scroll_depth_percent:t.scroll_depth_percent,total_hidden_time_seconds:t.total_hidden_time_seconds,interval_active_seconds:t.interval_active_seconds,interval_total_seconds:t.interval_total_seconds,interval_hidden_seconds:t.interval_hidden_seconds,is_visible:t.is_visible,visibility_changes_count:t.visibility_changes_count,has_scrolled:t.has_scrolled,has_clicked:t.has_clicked,has_typed:t.has_typed,page_load_time_epoc:r,time_since_page_load_seconds:o},a;try{a=await B.createEvent("engagement_ping",s)}catch{return}if(!a.success)return;let l=a.value;if(l===null)return;let u;
1try{u=await fe.send("/event",l)}catch{return}if(!u.success)return;this.state.lastPingTime=Date.now()}catch{}}static reset(){this.stop(),this.state={pingSequence:0,isRunning:!1,timerId:null,firstPingTimerId:null,lastVisibilityChangeTime:0,lastPingTime:0,firstPingSent:!1,pageLeaveInitiated:!1,sampledOut:!1}}static cleanup(){this.stop(),this.isInitialized=!1}static getPingSequence(){return this.state.pingSequence}static getConfig(){return{...this.config}}static isTrackerInitialized(){return this.isInitialized}static isTrackerRunning(){return this.state.isRunning}static async sendClosingPing(){if(!(!this.isInitialized||!this.config.enabled)&&(this.state.pageLeaveInitiated=!0,!this.state.sampledOut&&this.config.sendClosingPing&&this.shouldSendClosingPing()))try{await this.sendPing("page_leave")}catch{}}static shouldSendClosingPing(){try{return!(P.peekActiveTimeSeconds()<this.config.minActiveTimeForClosingPing)}catch{return!1}}};D.state={pingSequence:0,isRunning:!1,timerId:null,firstPingTimerId:null,lastVisibilityChangeTime:0,lastPingTime:0,firstPingSent:!1,pageLeaveInitiated:!1,sampledOut:!1},D.config={enabled:!0,firstPingDelaySeconds:2,pingIntervalSeconds:15,minEngagementThreshold:2,sendOnVisibilityChange:!0,minActiveTimeForVisibilityPing:3,visibilityDebounceMs:1e3,sendClosingPing:!0,minActiveTimeForClosingPing:2,pingDecaySchedule:[],pingSamplingRate:1},D.isInitialized=!1});var Mc={};M(Mc,{HeartbeatPingCoordinator:()=>ve});var ve,Nc=p(()=>{"use strict";Dc();bo();Co();Ai();ki();dn();qe();ve=class{static initialize(e){if(this.isInitialized||typeof window=="undefined"||(this.config=this.validateConfig(e||{}),!this.config.enabled))return;H.generateNewSession(),P.initialize();let t={enabled:this.config.enabled,pingIntervalSeconds:this.config.pingIntervalSeconds,sendOnVisibilityChange:this.config.sendOnVisibilityChange,minActiveTimeForVisibilityPing:this.config.minActiveTimeForVisibilityPing,visibilityDebounceMs:this.config.visibilityDebounceMs,pingDecaySchedule:this.config.pingDecaySchedule,pingSamplingRate:this.config.pingSamplingRate};D.initialize(t),this.setupEventListeners(),this.config.enableSPATracking&&this.setupSPATracking(),this.isInitialized=!0}static validateConfig(e){return{enabled:e.enabled!==void 0?e.enabled:!0,pingIntervalSeconds:e.pingIntervalSeconds!==void 0?e.pingIntervalSeconds:15,sendOnVisibilityChange:e.sendOnVisibilityChange!==void 0?e.sendOnVisibilityChange:!0,minActiveTimeForVisibilityPing:e.minActiveTimeForVisibilityPing!==void 0?e.minActiveTimeForVisibilityPing:3,visibilityDebounceMs:e.visibilityDebounceMs!==void 0?e.visibilityDebounceMs:1e3,enableSPATracking:e.enableSPATracking!==void 0?e.enableSPATracking:!1,pingDecaySchedule:Array.isArray(e.pingDecaySchedule)?e.pingDecaySchedule:[],pingSamplingRate:e.pingSamplingRate!==void 0?e.pingSamplingRate:1}}static setupEventListeners(){this.visibilityChangeListener=re(e=>{this.handleVisibilityChange()},"HeartbeatPingCoordinator.visibilitychange"),document.addEventListener("visibilitychange",this.visibilityChangeListener),this.bfcacheUnsubscribe=he.subscribe(()=>{this.handleBfcacheRestore()}),this.beforeUnloadListener=re(e=>{this.handlePageLeave()},"HeartbeatPingCoordinator.beforeunload"),window.addEventListener("beforeunload",this.beforeUnloadListener),this.pageHideListener=re(e=>{this.handlePageLeave()},"HeartbeatPingCoordinator.pagehide"),window.addEventListener("pagehide",this.pageHideListener)}static setupSPATracking(){this.spaUnsubscribe=ee.subscribe(e=>{this.handleSPANavigation(e)},{trackHashChanges:!1})}static handleVisibilityChange(){L.handleVisibilityChange(),P.incrementVisibilityChanges(),document.visibilityState==="hidden"?(P.pause(),D.handleVisibilityChange(),D.pause()):(P.resume(),D.resume())}static handleBfcacheRestore(){this.resetForBfcache()}static handleSPANavigation(e){this.resetForNavigation()}static handlePageLeave(){this.pageLeaveTriggered||(this.pageLeaveTriggered=!0,D.sendClosingPing().catch(e=>{}),D.stop())}static start(){this.isInitialized&&this.config.enabled&&D.start()}static stop(){this.isInitialized&&D.stop()}static resetForNavigation(){D.stop(),H.reset(),H.generateNewSession(),P.reset(),D.reset(),D.start()}static resetForBfcache(){H.reset(),H.generateNewSession(),P.reset(),D.reset(),this.pageLeaveTriggered=!1,D.start()}static cleanup(){this.isInitialized&&(this.visibilityChangeListener&&(document.removeEventListener("visibilitychange",this.visibilityChangeListener),this.visibilityChangeListener=null),this.beforeUnloadListener&&(window.removeEventListener("beforeunload",this.beforeUnloadListener),this.beforeUnloadListener=null),this.pageHideListener&&(window.removeEventListener("pagehide",this.pageHideListener),this.pageHideListener=null),this.spaUnsubscribe&&(this.spaUnsubscribe(),this.spaUnsubscribe=null),this.bfcacheUnsubscribe&&(this.bfcacheUnsubscribe(),this.bfcacheUnsubscribe=null),D.cleanup(),P.cleanup(),H.reset(),this.isInitialized=!1,this.pageLeaveTriggered=!1)}static isEnabled(){return this.isInitialized&&this.config.enabled}static getConfig(){return{...this.config}}};ve.config={enabled:!0,pingIntervalSeconds:15,sendOnVisibilityChange:!0,minActiveTimeForVisibilityPing:3,visibilityDebounceMs:1e3,enableSPATracking:!1,pingDecaySchedule:[],pingSamplingRate:1},ve.isInitialized=!1,ve.visibilityChangeListener=null,ve.beforeUnloadListener=null,ve.pageHideListener=null,ve.pageLeaveTriggered=!1,ve.spaUnsubscribe=null,ve.bfcacheUnsubscribe=null});var fn,Oc=p(()=>{"use strict";m();fn=class{static extract(e){return c(()=>
1{if(typeof window=="undefined"||!window.location)return null;let i=new URL(window.location.href).searchParams.get(e);return i&&i.length>0?i:null},null)}static stripFromURL(e){c(()=>{if(typeof window=="undefined"||!window.history||!window.location)return;let t=new URL(window.location.href);if(!t.searchParams.has(e))return;t.searchParams.delete(e);let i=t.pathname+(t.search?t.search:"")+(t.hash?t.hash:"");window.history.replaceState(window.history.state,"",i)},void 0)}}});function Jf(){h.set(Ti,"true")}function Uc(){h.remove(Ti)}var Ti,De,Fc=p(()=>{"use strict";F();Ti="naviga_ab_admin";De=class{static onUnauthorised(){Uc()}static clearAdminFlag(){Uc()}static markAdminFlagFromCookie(){Jf()}}});function pn(n){if(!n)return null;let e=n.split(".");if(e.length!==3)return null;try{let t=decodeURIComponent(atob(e[1].replace(/-/g,"+").replace(/_/g,"/")).split("").map(s=>"%"+("00"+s.charCodeAt(0).toString(16)).slice(-2)).join("")),i=JSON.parse(t),r=typeof i.exp=="number"?i.exp:void 0,o=Array.isArray(i.permissions)?i.permissions:void 0;return{exp:r,permissions:o}}catch{return null}}function Bc(n){let e=pn(n);if(!(e!=null&&e.permissions))return!1;let t=e.permissions.find(i=>(i==null?void 0:i.id)===4);return(t==null?void 0:t.write)===!0}var Vc=p(()=>{"use strict"});var at,gn,Hc=p(()=>{"use strict";Qt();pt();w();F();at="/ab",gn=class{static async get(e,t){return j.get(at+e,this.buildHeaders(t),"bff")}static async post(e,t,i){return j.post(at+e,t,this.buildHeaders(i),"bff")}static async patchExperiment(e,t,i){let r=d.get(),o={org_name:r.organisation_name,publication_name:r.publication_name,...t};return j.patch(`${at}/experiments/${encodeURIComponent(e)}`,o,this.buildHeaders(i),"bff")}static async getExperiments(){let e=this.buildOrgPubQueryString(),t=await j.get(`${at}/experiments${e}`,this.publicHeaders());return this.normalizeExperimentsResult(t)}static async getTests(){let e=this.buildOrgPubQueryString();return j.get(`${at}/test${e}`,this.publicHeaders())}static async getExperimentMetrics(e,t){let i=this.buildOrgPubQueryString();return j.get(`${at}/experiments/${encodeURIComponent(e)}/metrics${i}`,this.buildHeaders(t),"bff")}static async getConcludedExperiments(e){let t=this.buildOrgPubQueryString(),i=await j.get(`${at}/experiments${t}&status=concluded`,this.buildHeaders(e),"bff");return this.normalizeExperimentsResult(i)}static normalizeExperimentsResult(e){var r;if(!e.success)return e;let t=e.value,i=Array.isArray((r=t==null?void 0:t.response)==null?void 0:r.records)?t.response.records:Array.isArray(t==null?void 0:t.experiments)?t.experiments:[];return W({experiments:i})}static buildOrgPubQueryString(){let e=d.getValue("organisation_name"),t=d.getValue("publication_name");return`?org_name=${encodeURIComponent(e||"")}&publication_name=${encodeURIComponent(t||"")}`}static publicHeaders(){}static buildHeaders(e){let t=d.getABConfig().cookieName||"naviga_ab_session",i=e||h.get(t);if(i)return{Authorization:`Bearer ${i}`}}}});var ep,Qe,_o=p(()=>{"use strict";m();k();w();Hc();qt();ep=15e3,Qe=class{static async loadActive(){return b(async()=>{var s,a;let t=((s=d.getABConfig().experimentTTLSeconds)!=null?s:60)*1e3,i=Date.now();if(this.cache&&i-this.cache.at<t)return this.cache.experiments;if(this.failure&&i-this.failure.at<ep)throw new Error(this.failure.message);let[r]=await Promise.all([gn.getExperiments()]);if(!r.success)throw this.failure={at:i,message:r.error.message},new Error(r.error.message);let o=Array.isArray((a=r.value)==null?void 0:a.experiments)?r.value.experiments:[];return this.cache={at:i,experiments:o},this.failure=null,o},{message:"Failed to load experiments",severity:"medium",source:"ExperimentLoader.loadActive"})}static invalidate(){this.cache=null,this.failure=null}static async loadConcluded(){return b(async()=>{var i;let e=await gn.getConcludedExperiments();if(!e.success)throw new Error(e.error.message);return Array.isArray((i=e.value)==null?void 0:i.experiments)?e.value.experiments:[]},{message:"Failed to load concluded experiments",severity:"low",source:"ExperimentLoader.loadConcluded"})}};Qe.cache=null,Qe.failure=null});var Ri,Kc=p(()=>{"use strict";m();w();Ri=class{static match(e){return c(()=>{var l,u;if(typeof document=="undefined"||!e||e.length===0)return[];let t=typeof window!="undefined"?window.location.pathname:"/",i=d.getABConfig().headlineSelectors||["h1","h2","h3"],o=[...e.filter(f=>this.isWithinSchedule(f))].sort((f,g)=>{var U,T;let v=(U=f.priority)!=null?U:0,y=(T=g.priority)!=null?T:0;if(y!==v)return y-v;let C=Date.parse(f.updatedAt||"")||0;return(Date.parse(g.updatedAt||"")||0)-C}),s=new WeakSet,a=[];for(let f of o){if(!f.target)continue;let g=[],v="path",y=((u=(l=f.variants)==null?void 0:l[0])==null?void 0:u.name)||"";if(f.target.type==="selector")g=this.querySelectorAll(f.target.value),v="selector";else if(f.target.type==="path"){if(!this.pathMatches(t,f.target.value))continue;let _=f.target.elementSelector||i.join(", ");g=this.queryAndFilterByText(_,y),v="path"}else if(f.target.type==="headline"){let _=f.target.elementSelector||i.join(", ");g=this.queryAndFilterByText(_,f.target.value),v="headline"}if(g.length===0)continue;let C=g.filter(_=>!s.has(_));C.length!==0&&(C.forEach(_=>s.add(_)),a.push({experiment:f,elements:C,matchedBy:v}))}return a},[])}static isWithinSchedule(e){return c(()=>{let t=Date.now();if(e.startAt){let i=Date.parse(e.startAt);if(!isNaN(i)&&i>t)return!1}if(e.endAt){let i=Date.parse(e.endAt);if(!isNaN(i)&&i<t)return!1}return!0},!0)}static querySelectorAll(e){return c(()=>{let t=document.querySelectorAll(e),i=[];return t.forEach(r=>{r instanceof HTMLElement&&i.push(r)}),i},[])}static queryAndFilterByText(e,t){let i=this.querySelectorAll(e);return t?i.filter(r=>this.isSimilar(r.textContent||"",t)):i}static pathMatches(e,t){return t==="*"||t==="/*"?!0:t.endsWith("*")?e.startsWith(t.slice(0,-1)):e===t}static isSimilar(e,t){let i=g=>g.toLowerCase().replace(/[^\p{L}\p{N}
1\s]/gu," ").replace(/\s+/g," ").trim(),r=i(e),o=i(t);if(!r||!o)return!1;if(r===o)return!0;let s=r.split(" "),a=o.split(" "),l=(g,v)=>v.length>=3&&g.length>=15;if(r.includes(o)&&l(o,a)||o.includes(r)&&l(r,s))return!0;if(s.length<3||a.length<3)return!1;let u=new Set(s);return a.filter(g=>u.has(g)).length/Math.max(u.size,a.length)>=.7}}});function np(n,e=0){let t=3735928559^e,i=1103547991^e;for(let r=0;r<n.length;r++){let o=n.charCodeAt(r);t=Math.imul(t^o,2654435761),i=Math.imul(i^o,1597334677)}return t=Math.imul(t^t>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&i)+(t>>>0)}function ip(n){return np(n)/9007199254740992}var xi,zc=p(()=>{"use strict";m();w();F();qt();Mn();xi=class{static assign(e){var g;let t=e.variants||[];if(t.length===0)return{variantKey:"",source:"pinned"};if(e.activeVariant!=="RANDOM"){let v=t.find(y=>y.key===e.activeVariant);if(v)return{variantKey:v.key,source:"pinned"}}let i=d.getABConfig(),o=(i.variantCookiePrefix||"naviga_ab_variant_")+e.id,s=h.get(o);if(s&&t.some(v=>v.key===s))return{variantKey:s,source:"random-cookie"};let a=Be.getCurrentDeviceId(),l=this.rollByWeight(t,a?`${a}:${e.id}`:null),f=(i.stickinessMode||gs)==="persistent"?(g=i.variantCookieDays)!=null?g:30:0;return h.set(o,l,{days:f}),{variantKey:l,source:"random-assigned"}}static rollByWeight(e,t){var i;return c(()=>{let r=e.map(u=>typeof u.weight=="number"&&u.weight>0?u.weight:u.weight===void 0?1:0),o=r.reduce((u,f)=>u+f,0),s=t!=null?ip(t):Math.random();if(o<=0){let u=Math.floor(s*e.length);return e[Math.min(u,e.length-1)].key}let a=s*o,l=0;for(let u=0;u<e.length;u++)if(l+=r[u],a<l)return e[u].key;return e[e.length-1].key},((i=e[0])==null?void 0:i.key)||"")}}});var jc,Gc=p(()=>{"use strict";jc="#abt-selection-hud, #abt-hud-launcher, #abt-headline-styles, .abt-headline-badge, .abt-modal-overlay, .abt-stats-pin, .abt-stats-card"});function qc(n){return n.matches(jc)}function rp(n){return Array.from(n.children).filter(e=>!qc(e))}function mn(n){let e="";return n.childNodes.forEach(t=>{if(t.nodeType===Node.TEXT_NODE){e+=t.textContent||"";return}if(t.nodeType!==Node.ELEMENT_NODE)return;let i=t;qc(i)||(e+=mn(i))}),e}function op(n){let e=n;for(let t=0;t<10;t++){let i=mn(e).trim(),r=rp(e);if(r.length!==1||i.length===0)return e;let o=r[0];if(mn(o).trim()!==i)return e;e=o}return e}function Pi(n,e){let t=op(n),i=!1;for(let r of Array.from(t.childNodes))r.nodeType===Node.TEXT_NODE&&(!i&&(r.textContent||"").trim().length>0?(r.textContent=e,i=!0):r.textContent="");i||t.insertBefore(document.createTextNode(e),t.firstChild)}var Wc=p(()=>{"use strict";Gc()});var Eo,Ii,$c=p(()=>{"use strict";m();Wc();Eo="navigaAbExperimentId",Ii=class{static apply(e,t,i){let r=e.variants||[],o=r[0],s=r.find(f=>f.key===i)||o,a=!!s&&!!o&&s.key===o.key,l=(o==null?void 0:o.name)||(t[0]?mn(t[0]).trim():""),u=(s==null?void 0:s.name)||l;for(let f of t)c(()=>{f.dataset.navigaAbOriginal||(f.dataset.navigaAbOriginal=l),f.dataset.navigaAbExperimentId=e.id,f.dataset.navigaAbVariant=i,f.dataset.navigaAbVariantText=u,!a&&typeof u=="string"&&u.length>0&&Pi(f,u)},void 0);return{variantTitle:u,originalTitle:l}}static restoreAllOriginals(){typeof document!="undefined"&&c(()=>{document.querySelectorAll("[data-naviga-ab-original]").forEach(t=>{if(t instanceof HTMLElement){let i=t.dataset.navigaAbOriginal;i&&Pi(t,i)}})},void 0)}static reapplyAllVariants(){typeof document!="undefined"&&c(()=>{document.querySelectorAll("[data-naviga-ab-variant-text]").forEach(t=>{if(t instanceof HTMLElement){let i=t.dataset.navigaAbVariantText,r=t.dataset.navigaAbVariant;r&&r!=="control"&&i&&Pi(t,i)}})},void 0)}}});function Di(n){if(!n)return"";try{let e=new URL(n),t=e.protocol.toLowerCase(),i=e.hostname.toLowerCase(),r=e.port;(t==="http:"&&r==="80"||t==="https:"&&r==="443")&&(r="");let o=e.pathname||"/";o.length>1&&o.endsWith("/")&&(o=o.slice(0,-1));let s=r?`:${r}`:"";return`${t}//${i}${s}${o}`}catch{return n}}function wo(){return c(()=>{let n=h.get(Li);if(!n)return[];let e=JSON.parse(n);return Array.isArray(e)?e.filter(sp):[]},[])}function So(n){c(()=>
1{if(n.length===0){h.remove(Li);return}h.set(Li,JSON.stringify(n))},void 0)}function sp(n){return!!n&&typeof n.experimentId=="string"&&typeof n.variantKey=="string"&&typeof n.clickId=="string"&&typeof n.clickAt=="number"&&typeof n.targetHref=="string"&&typeof n.qualityActiveSeconds=="number"}var Li,Yc,Rt,Ao=p(()=>{"use strict";m();F();Li="naviga_ab_qualified_click_queue",Yc=24*60*60*1e3;Rt=class{static enqueue(e){c(()=>{let t={...e,targetHref:Di(e.targetHref)},i=this.purgeStale(Yc,wo());i.push(t),So(i)},void 0)}static dequeueMatching(e){return c(()=>{let t=Di(e);if(!t)return[];let i=this.purgeStale(Yc,wo()),r=[],o=[];for(let s of i)s.targetHref===t?r.push(s):o.push(s);return So(o),r},[])}static purgeStale(e,t){return c(()=>{let i=t!=null?t:wo(),r=Date.now()-e,o=i.filter(s=>s.clickAt>=r);return t||So(o),o},t!=null?t:[])}static __clearForTests(){h.remove(Li)}}});var ye,Mi=p(()=>{"use strict";m();k();pe();Pe();it();qt();Ao();ye=class n{static async trackView(e){e.source!=="preview"&&await b(async()=>{let t={experiment_id:e.experiment.id,experiment_name:e.experiment.name,variant:e.variantKey,is_control:String(this.isControl(e)),variant_source:e.source,variant_title:e.variantTitle,original_title:e.originalTitle,target_selector:this.elementSelector(e.match.elements[0]),target_url:this.currentUrl(),target_type:e.match.matchedBy},i=await B.createEvent(zt,t);if(!i.success)throw new Error("Failed to create ab_experiment_view event");if(i.value===null)return;(await ae.send(i.value)).success},{message:"Failed to track ab_experiment_view",severity:"medium",source:"ABEventTracker.trackView",eventName:zt})}static async trackClick(e,t,i){e.source!=="preview"&&await b(async()=>{var u,f;let r=t instanceof HTMLAnchorElement?t.href:(u=t.closest("a"))==null?void 0:u.href,o=n.makeClickId();r&&Rt.enqueue({experimentId:e.experiment.id,experimentName:e.experiment.name,variantKey:e.variantKey,isControl:this.isControl(e),clickId:o,clickAt:Date.now(),targetHref:Di(r),qualityActiveSeconds:(f=e.experiment.qualityActiveSeconds)!=null?f:15});let s={experiment_id:e.experiment.id,experiment_name:e.experiment.name,variant:e.variantKey,is_control:String(this.isControl(e)),variant_title:e.variantTitle,original_title:e.originalTitle,target_selector:this.elementSelector(t),target_url:this.currentUrl(),click_target_tag:t.tagName,click_target_href:r||null,click_position:{x:i.clientX,y:i.clientY},click_id:o,time_since_view_ms:Math.max(0,Date.now()-e.viewedAt)},a=await B.createEvent(jt,s);if(!a.success)throw new Error("Failed to create ab_experiment_click event");if(a.value===null)return;let l=await fe.send("/event",a.value);!l.success||l.value.success},{message:"Failed to track ab_experiment_click",severity:"low",source:"ABEventTracker.trackClick",eventName:jt})}static async trackQualifiedClick(e){await b(async()=>{let t={experiment_id:e.experimentId,experiment_name:e.experimentName,variant:e.variantKey,is_control:e.isControl,click_id:e.clickId,original_click_at:Math.floor(e.originalClickAt/1e3),qual
1ified_at:Math.floor(e.qualifiedAt/1e3),active_seconds_observed:e.activeSecondsObserved,target_url:this.currentUrl()},i=await B.createEvent(Gt,t);if(!i.success)throw new Error("Failed to create ab_experiment_qualified_click event");if(i.value===null)return;(await ae.send(i.value)).success},{message:"Failed to track ab_experiment_qualified_click",severity:"low",source:"ABEventTracker.trackQualifiedClick",eventName:Gt})}static makeClickId(){try{let t=globalThis.crypto;if(t&&typeof t.randomUUID=="function")return t.randomUUID()}catch{}let e=()=>Math.floor(Math.random()*4294967295).toString(16).padStart(8,"0");return`${e()}${e()}-${e()}-${e()}`}static isControl(e){var i,r;let t=(r=(i=e.experiment.variants)==null?void 0:i[0])==null?void 0:r.key;return!!t&&t===e.variantKey}static elementSelector(e){if(!e)return"";let t=e.id?`#${e.id}`:"",i=e.className&&typeof e.className=="string"?"."+e.className.trim().split(/\s+/).join("."):"";return`${e.tagName.toLowerCase()}${t}${i}`}static currentUrl(){try{return window.location.href}catch{return""}}}});var Ni,Qc=p(()=>{"use strict";m();w();Mi();Ni=class{static track(e){c(()=>{let t=d.getABConfig().exposureGating!==!1,i=typeof window!="undefined"&&typeof window.IntersectionObserver!="undefined";if(!t||!i){ye.trackView(e);return}let r=e.match.elements[0];if(!r){ye.trackView(e);return}if(this.isMostlyVisible(r)){ye.trackView(e);return}let o=new IntersectionObserver(s=>{for(let a of s)if(a.isIntersecting&&a.intersectionRatio>=.5){ye.trackView(e),o.disconnect();return}},{threshold:.5});o.observe(r)},void 0)}static isMostlyVisible(e){try{let t=e.getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight||0,r=window.innerWidth||document.documentElement.clientWidth||0;if(t.width===0||t.height===0)return!1;let o=Math.max(0,Math.min(t.bottom,i)-Math.max(t.top,0)),s=Math.max(0,Math.min(t.right,r)-Math.max(t.left,0)),a=o*s,l=t.width*t.height;return a/l>=.5}catch{return!1}}}});var Xc,Oi,Jc=p(()=>{"use strict";m();F();Xc="naviga_visitor_seen",Oi=class{static classify(){return c(()=>h.get(Xc)?"returning":(h.set(Xc,new Date().toISOString()),"new"),"returning")}}});var xt,Zc=p(()=>{"use strict";$t();Jc();xt=class{static async matches(e){if(!e)return!0;if(e.devices&&e.devices.length>0){let t=await this.getDeviceType();if(!t||!e.devices.includes(t))return!1}return!(e.visitorType&&this.getVisitorType()!==e.visitorType||e.urlPattern&&!this.urlMatches(e.urlPattern))}static async getDeviceType(){if(this.cachedDeviceType)return this.cachedDeviceType;try{let e=await de.getPlatformInfo();if(!e.success)return null;let t=e.value.type;return t==="mobile"||t==="tablet"||t==="desktop"?(this.cachedDeviceType=t,t):null}catch{return null}}static getVisitorType(){return this.cachedVisitorType?this.cachedVisitorType:(this.cachedVisitorType=Oi.classify(),this.cachedVisitorType)}static urlMatches(e){if(typeof window=="undefined")return!1;try{return new RegExp(e).test(window.location.pathname||"")}catch{return!1}}};xt.cachedDeviceType=null,xt.cachedVisitorType=null});var Ui,el=p(()=>{"use strict";m();w();Ui=class{static read(){return c(()=>{if(typeof window=="undefined")return new Map;let e=d.getABConfig().previewQueryParam||"naviga_ab_preview",t=window.location.search||"";if(!t)return new Map;let r=new URLSearchParams(t).get(e);return r?this.parse(r):new Map},new Map)}static parse(e){let t=new Map;if(!e||typeof e!="string")return t;let i=e.split(",");for(let r of i){let o=r.trim();if(!o)continue;let s=o.indexOf(":");if(s<=0||s===o.length-1)continue;let a=o.slice(0,s).trim(),l=o.slice(s+1).trim();!a||!l||t.set(a,l)}return t}}});var Pt,tl=p(()=>{"use strict";m();mo();Mi();Ao();Pt=class{static start(){this.started||c(()=>{this.started=!0;let e=this.getCurrentUrl();if(!e)return;let t=Rt.dequeueMatching(e);if(t.length!==0)for(let i of t)this.armSubscription(i)},void 0)}static armSubscription(e){let t=We.getActiveSecondsSincePageLoad();We.subscribeToThreshold(e.qualityActiveSeconds,()=>{let i=We.getActiveSecondsSincePageLoad()-t;ye.trackQualifiedClick({experimentId:e.experimentId,experimentName:e.experimentName,variantKey:e.variantKey,isControl:e.isControl,clickId:e.clickId,originalClickAt:e.clickAt,qualifiedAt:Date.now(),activeSecondsObserved:i})})}static getCurrentUrl(){try{return typeof window!="undefined"&&window.location?window.location.href:""}catch{return""}}static __resetForTests(){this.started=!1}};Pt.started=!1});var Xe,nl=p(()=>{"use strict";m();k();_o();Kc();zc();$c();Mi();Qc();Zc();el();tl();
1Xe=class{static async runQualifiedClickWatcher(){this.qualifiedClickStarted||(this.qualifiedClickStarted=!0,Pt.start())}static async run(){this.started||(this.started=!0,typeof document!="undefined"&&document.readyState==="loading"&&await new Promise(e=>{document.addEventListener("DOMContentLoaded",()=>e(),{once:!0})}),await b(async()=>{Pt.start();let e=await Qe.loadActive();if(!e.success)return;let t=Ri.match(e.value);if(t.length===0)return;let i=Ui.read();for(let r of t){if(!await xt.matches(r.experiment.audience))continue;let s=this.resolveAssignment(r.experiment,i);if(!s.variantKey)continue;let{variantTitle:a,originalTitle:l}=Ii.apply(r.experiment,r.elements,s.variantKey),u={experiment:r.experiment,match:r,variantKey:s.variantKey,source:s.source,variantTitle:a,originalTitle:l,viewedAt:Date.now()};this.contexts.set(r.experiment.id,u),await Ni.track(u)}this.attachClickListener()},{message:"Failed to run variant orchestrator",severity:"medium",source:"VariantOrchestrator.run"}))}static resolveAssignment(e,t){let i=t.get(e.id);return i&&e.variants.some(r=>r.key===i)?{variantKey:i,source:"preview"}:xi.assign(e)}static attachClickListener(){typeof document!="undefined"&&document.addEventListener("click",e=>{let t=e.target;if(!t||!t.closest)return;let i=`[data-${this.kebab(Eo)}]`,r=t.closest(i);if(!r)return;let o=r.dataset[Eo];if(!o)return;let s=this.contexts.get(o);s&&ye.trackClick(s,r,e)},{capture:!0})}static kebab(e){return e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}};Xe.started=!1,Xe.qualifiedClickStarted=!1,Xe.contexts=new Map});var il,rl=p(()=>{"use strict";il="__navigaAbAdminEditor"});function Fi(n,e){K.report({message:`Admin A/B editor failed to load from ${e||"(no url could be resolved)"}: ${n}. Reader-side A/B is unaffected; only the editor is unavailable.`,severity:"medium",source:"AdminEditorLoader.remote",data:{url:e,reason:n,filename:Ln,capturedBase:Ms()}})}function sl(){let n=window[il];return n||null}function ko(){let n=sl();if(n)return Promise.resolve(n);if(ct)return ct;let e=Ns(Ln);return e?(ct=new Promise((t,i)=>{let r=document.createElement("script");r.src=e,r.async=!0;let o=!1,s=l=>{o||(o=!0,window.clearTimeout(a),l())},a=window.setTimeout(()=>{s(()=>{ct=null,Fi(`timed out after ${ol}ms`,e),i(new Error("admin editor load timed out"))})},ol);r.onload=()=>{let l=sl();s(l?()=>t(l):()=>{ct=null,Fi("script loaded but registered no editor global",e),i(new Error("admin editor did not register"))})},r.onerror=()=>{s(()=>{ct=null,Fi("network or CSP error fetching the script",e),i(new Error("admin editor script failed to load"))})},document.head.appendChild(r)}),ct):(Fi(Ln?"no base URL could be resolved (currentScript unavailable and no baked fallback)":"this build has no editor artifact",""),Promise.reject(new Error("admin editor URL could not be resolved")))}var ol,ct,al=p(()=>{rl();ft();k();Dn();Ar();ol=1e4,ct=null});var Re,cl=p(()=>{"use strict";m();k();w();F();Oc();Fc();Vc();nl();al();Re=class{static async start(){this.started||(this.started=!0,await b(async()=>{var i;let e=d.getABConfig();if(!e.enabled)return;if(await Xe.runQualifiedClickWatcher(),(i=e.excludedPathPrefixes)!=null&&i.length&&typeof window!="undefined"){let r=window.location.pathname;if(e.excludedPathPrefixes.some(s=>r.startsWith(s)))return}await Xe.run(),await this.evaluateToken();let t=d.getABConfig().cookieName||"naviga_ab_session";this.attachLogoutListener(t),this.checkAdminFlag()&&(this.initializeHUD(),this.watchSessionExpiry(t))},{message:"Failed to start AB coordinator",severity:"medium",source:"ABTestingCoordinator.start"}))}static expiryKey(e){return`${e}_exp`}static async evaluateToken(){let e=d.getABConfig(),t=e.tokenQueryParam||"naviga_ab_token",i=e.cookieName||"naviga_ab_session",r=fn.extract(t);if(r){fn.stripFromURL(t);let l=pn(r);l&&typeof l.exp=="number"&&(this.persistSession(i,{session:r,expiresAt:l.exp}),De.markAdminFlagFromCookie());return}let o=h.get(i);if(!o){De.clearAdminFlag();return}let s=pn(o),a=Math.floor(Date.now()/1e3);s&&typeof s.exp=="number"&&s.exp>a?De.markAdminFlagFromCookie():(h.remove(i),h.remove(this.expiryKey(i)),De.clearAdminFlag())}static persistSession(e,t){h.set(e,t.session,{days:0}),h.set(this.expiryKey(e),String(t.expiresAt),{days:0})}static checkAdminFlag(){try{if(h.get(Ti)!=="true")return!1;let e=d.getABConfig().cookieName||"naviga_ab_session";return h.get(e)?!0:(De.clearAdminFlag(),!1)}catch{return!1}}static canWrite(){try{let e=d.getABConfig().cookieName||"naviga_ab_session",t=h.get(e);return Bc(t)}catch{return!1}}static initializeHUD(){this.hudInitialized||(this.hudInitialized=!0,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>this.openHeadlineSelector()):this.openHeadlineSelector())}static async openHeadlineSelector(){try{(await ko()).initialize(!0)}catch{}}static watchSessionExpiry(e){this.expiryInterval||(this.expiryInterval=setInterval(()=>{this.checkSessionValid(e)},this.EXPIRY_POLL_MS),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.checkSessionValid(e)}))}static attachLogoutListener(e){this.logoutListenerAttached||(this.logoutListenerAttached=!0,window.addEventListener("message",t=>{var i;((i=t.data)==null?void 0:i.type)==="naviga_ab_logout"&&this.handleSessionExpired(e,"logout")}))}static checkSessionValid(e){let t=h.get(e);if(!t){this.handleSessionExpired(e);return}let i=pn(t),r=Math.floor(Date.now()/1e3);(!i||typeof i.exp!="number"||i.exp<=r)&&this.handleSessionExpired(e)}static handleSessionExpired(e,t="expired"){if(this.expiryInterval&&(clearInterval(this.expiryInterval),this.expiryInterval=null),h.remove(e),h.remove(this.expiryKey(e)),De.clearAdminFlag(),!this.hudInitialized)return;this.hudInitialized=!1;let i=t==="logout"?'You were logged out of the dashboard \u2014 relaunch "Launch Console" to continue.':"A/B HUD session expired \u2014 relaunch from the dashboard to continue.";ko().then(r=>{r.teardown(),r.notify(i)}).catch(()=>{})}};Re.started=!1,Re.hudInitialized=!1,Re.expiryInterval=null,Re.logoutListenerAttached=!1,Re.EXPIRY_POLL_MS=3e4});function ll(n){try{window[cp]=n}catch{}}var cp,ul=p(()=>{"use strict";cp="__navigaAnalyticsCoreInternals"});var dl={};M(dl,{ABTesting:()=>lp});var lp,fl=p(()=>{"use strict";cl();w();ft();_o();F();ul();lp={start:()=>(ll({ConfigManager:d,ErrorReporter:K,ABTestingCoordinator:Re,ExperimentLoader:Qe,ConsentedStorage:h}),Re.start())}});function To(n){var e,t;return(t=(e=n.querySelector("article"))!=null?e:n.querySelector("main"))!=null?t:n.body}function up(n){return Array.from(n.querySelectorAll("h1,h2,h3,h4,h5,h6"))}function dp(n){var t;let e=((t=n.textContent)!=null?t:"").trim();return e?e.split(/\s+/).length:0}function fp(n){var i;let e=!!((i=n.querySelector("article"))!=null?i:n.querySelector("main")),t=n.querySelectorAll("h1").length;return{id:"semantic_structure",audience:"A",pass:e&&t===1}}function pp(n){var r;let e=n.querySelector('link[rel="canonical"]'),t=(r=e==null?void 0:e.getAttribute("href"))!=null?r:"";return{id:"canonical_present",audience:"B",pass:/^https?:\/\//i.test(t)}}
1function gp(n){return{id:"robots_not_noindex",audience:"B",pass:!Array.from(n.querySelectorAll('meta[name="robots" i], meta[name="googlebot" i]')).some(i=>{var r;return/\bnoindex\b/i.test((r=i.getAttribute("content"))!=null?r:"")})}}function mp(n){return{id:"og_tags_complete",audience:"B",pass:["og:title","og:description","og:image"].every(i=>{var o;let r=n.querySelector(`meta[property="${i}"]`);return!!((o=r==null?void 0:r.getAttribute("content"))!=null&&o.trim())})}}function hp(n){var r,o;let e=n.querySelector('meta[name="description"]'),t=(o=(r=e==null?void 0:e.getAttribute("content"))==null?void 0:r.trim())!=null?o:"";return{id:"meta_description",audience:"B",pass:t.length>0&&t.length<=350}}function vp(n){if(n.querySelectorAll("h1").length!==1)return{id:"headline_hierarchy",audience:"B",pass:!1};let t=To(n),i=up(t);if(i.length===0)return{id:"headline_hierarchy",audience:"B",pass:!0};let r=parseInt(i[0].tagName[1],10);for(let o=1;o<i.length;o++){let s=parseInt(i[o].tagName[1],10);if(s>r+1)return{id:"headline_hierarchy",audience:"B",pass:!1};r=s}return{id:"headline_hierarchy",audience:"B",pass:!0}}function yp(n){let e=To(n),i=Array.from(e.querySelectorAll("img")).filter(s=>!(s.getAttribute("role")==="presentation"||s.getAttribute("aria-hidden")==="true"));return i.length===0?{id:"image_alt_coverage",audience:"C",pass:!0}:{id:"image_alt_coverage",audience:"C",pass:i.filter(s=>{var a;return((a=s.getAttribute("alt"))!=null?a:"").trim()!==""}).length/i.length>=.9}}function bp(n){var i;let e=n.querySelector('meta[name="viewport"]');
1return{id:"viewport_meta",audience:"C",pass:!!((i=e==null?void 0:e.getAttribute("content"))!=null&&i.trim())}}function Cp(n){let e=To(n);return{id:"word_count_sane",audience:"C",pass:dp(e)>50}}var _p,Bi,Ep,pl=p(()=>{"use strict";_p=[{id:"semantic_structure",fn:fp},{id:"canonical_present",fn:pp},{id:"robots_not_noindex",fn:gp},{id:"og_tags_complete",fn:mp},{id:"meta_description",fn:hp},{id:"headline_hierarchy",fn:vp},{id:"image_alt_coverage",fn:yp},{id:"viewport_meta",fn:bp},{id:"word_count_sane",fn:Cp}],Bi=class{static runChecks(e){return _p.map(({id:t,fn:i})=>{var r;try{return i(e)}catch{let s=(r=Ep[t])!=null?r:"C";return{id:t,audience:s,pass:!1}}})}},Ep={semantic_structure:"A",canonical_present:"B",robots_not_noindex:"B",og_tags_complete:"B",meta_description:"B",headline_hierarchy:"B",image_alt_coverage:"C",viewport_meta:"C",word_count_sane:"C"}});var wp,I,lt,Ro=p(()=>{"use strict";wp=2500,I=class I{static start(){if(I.observer===null)try{I.observer=new PerformanceObserver(e=>{let t=e.getEntries();t.length>0&&(I.latestLcpMs=t[t.length-1].startTime)}),I.observer.observe({type:"largest-contentful-paint",buffered:!0}),I.supported=!0}
1catch{I.observer=null,I.supported=!1}}static getProvisionalLcpMs(){return I.latestLcpMs}static toCheckResult(){return!I.supported||I.latestLcpMs===null?null:{id:"cwv_lcp",audience:"C",pass:I.latestLcpMs<wp}}static reset(){if(I.observer)try{I.observer.disconnect()}catch{}I.observer=null,I.latestLcpMs=null,I.supported=!1}};I.latestLcpMs=null,I.observer=null,I.supported=!1;lt=I});function kp(n){return!(n.origin!==window.location.origin||n.protocol!=="http:"&&n.protocol!=="https:")}function ml(n){return n.toLowerCase().replace(/\s+/g," ").trim()}function Tp(n){var i,r,o;let e=(r=(i=n.querySelector("article"))!=null?i:n.querySelector("main"))!=null?r:n.body,t=((o=e==null?void 0:e.textContent)!=null?o:"").trim();return t?t.split(/\s+/).length:0}var gl,Sp,Ap,Vi,hl=p(()=>{"use strict";w();li();gl=2e6,Sp=5e3,Ap=150;Vi=class{static async run(e){var g,v;let t={result:null,checked:!1},i=d.getContentReadinessConfig();if(!i.rawHtmlCheck||Math.random()>=i.rawHtmlCheckSamplingRate)return t;let r=navigator.connection;if(r&&(r.saveData===!0||typeof r.effectiveType=="string"&&r.effectiveType.includes("2g")))return t;let o;try{o=new URL(window.location.href)}catch{return t}if(!kp(o))return t;let s=new AbortController,a=setTimeout(()=>s.abort(),Sp),l;try{let y=await fetch(o.toString(),{credentials:"omit",redirect:"follow",signal:s.signal});if(!y.ok)return t;l=await y.text()}catch{return t}finally{clearTimeout(a)}l.length>gl&&(l=l.slice(0,gl));let u=new DOMParser().parseFromString(l,"text/html"),f;if(e.isPremium){let C=Ie.runChecks(u,!0).find(_=>_.id==="paywall_markup");f=(C==null?void 0:C.pass)===!0}else{let{headlineText:y}=e;if(y===null)f=!1;else{u.querySelectorAll("script, style, noscript, template").forEach(X=>X.remove());let C=ml(y),_=ml((v=(g=u.body)==null?void 0:g.textContent)!=null?v:""),U=C.length>0&&_.includes(C),T=Tp(u);f=U&&T>=Ap}}return{result:{id:"ssr_article_body",audience:"A",pass:f},checked:!0}}}});function Pp(n){var i,r,o;let e=(r=(i=n.querySelector("article"))!=null?i:n.querySelector("main"))!=null?r:n.body,t=((o=e==null?void 0:e.textContent)!=null?o:"").trim();return t?t.split(/\s+/).length:0}var Rp,xp,hn,vl=p(()=>{"use strict";li();pl();Ro();hl();w();nn();Rp=.2,xp=5;hn=class{async run(){var a,l;let e=[],t=!1,i=null;try{let u=d.getArticleDetails();if(u.success){let f=u.value;t=kt(f.article_is_premium)===!0;let g=f.total_word_count;if(typeof g=="number"&&g>0)i=g;else if(typeof g=="string"){let v=parseInt(g,10);!isNaN(v)&&v>0&&(i=v)}}}catch{}try{let u=Ie.runChecks(document,t);e.push(...u)}catch{}try{let u=Bi.runChecks(document);e.push(...u)}catch{}if(i!==null)try{let u=Pp(document),f=i*Rp,g=i*xp,v=u>=f&&u<=g;
1e.push({id:"word_count_sane_mapped",audience:"C",pass:v})}catch{}let r=!1;try{let u=document.querySelector("h1"),f=(l=(a=u==null?void 0:u.textContent)==null?void 0:a.trim())!=null?l:null,g=await Vi.run({isPremium:t,headlineText:f});r=g.checked,g.result!==null&&e.push(g.result)}catch{}let o=lt.toCheckResult();o!==null&&e.push(o);let s=lt.getProvisionalLcpMs();return{results:e,rawHtmlChecked:r,lcpMs:s}}}});function bl(n){let e={A:{weightPassed:0,weightRun:0},B:{weightPassed:0,weightRun:0},C:{weightPassed:0,weightRun:0}};for(let i of n){let r=Ip[i.id];if(!r)continue;let o=e[r.audience];o.weightRun+=r.weight,i.pass&&(o.weightPassed+=r.weight)}let t=i=>i.weightRun===0?-1:Math.round(100*i.weightPassed/i.weightRun);return{abc_agent_score:t(e.A),abc_bot_score:t(e.B),abc_consumer_score:t(e.C)}}var yl,Ip,Cl=p(()=>{"use strict";yl="1",Ip={jsonld_present:{audience:"A",weight:1},jsonld_newsarticle:{audience:"B",weight:2},jsonld_required_props:{audience:"B",weight:2},schema_dom_consistency:{audience:"B",weight:1},paywall_markup:{audience:"B",weight:2},semantic_structure:{audience:"A",weight:1},canonical_present:{audience:"B",weight:1},robots_not_noindex:{audience:"B",weight:1},og_tags_complete:{audience:"B",weight:1},meta_description:{audience:"B",weight:1},headline_hierarchy:{audience:"B",weight:1},image_alt_coverage:{audience:"C",weight:1},viewport_meta:{audience:"C",weight:1},word_count_sane:{audience:"C",weight:1},cwv_lcp:{audience:"C",weight:1},word_count_sane_mapped:{audience:"C",weight:1},ssr_article_body:{audience:"A",weight:2}}});var El={};M(El,{ContentReadinessAuditor:()=>xo});var _l,Lp,Dp,O,xo,wl=p(()=>{"use strict";zr();ze();w();F();pe();Pe();vl();Ro();Cl();_l="naviga-cr-audit:",Lp="naviga-cr-lock:",Dp=60,O=class O{static initialize(e){var u;if(!e||e.enabled!==!0||typeof window=="undefined"||typeof document=="undefined"||this.initialized)return;try{if(window.self!==window.top)return}catch{return}if(rt.isSuspected())return;let t=(u=e.samplingRate)!=null?u:1;if(Math.random()>=t)return;let i=O.resolveArticleKey(),r=O.todayString(),o=_l+i;if(h.get(o)===r)return;let a=Lp+i,l=h.get(a);if(l){let f=parseInt(l,10);if((Date.now()-f)/1e3<Dp)return}h.set(a,String(Date.now())),this.initialized=!0,this.config=e,lt.start(),O.scheduleRun(i,r,a)}static setCheckRunner(e){O.runner=e}static reset(){O.initialized=!1,O.runner=new hn,O.config=null}static scheduleRun(e,t,i){let r=()=>O.run(e,t,i),o=()=>{typeof window.requestIdleCallback=="function"?window.requestIdleCallback(r,{timeout:1e4}):setTimeout(r,3e3)};document.readyState==="complete"?o():window.addEventListener("load",o,{once:!0})}static async run(e,t,i){var f,g;let r=O.config;if(!r)return;let s=(f=te.getEventFields().page_view_uuid)!=null?f:"",a=[],l=!1,u=null;try{let v=await O.runner.run();a=v.results,l=v.rawHtmlChecked,u=(g=v.lcpMs)!=null?g:null}catch{O.releaseLock(i);return}h.set(_l+e,t),O.releaseLock(i),a.length!==0&&await O.emit(a,s,r,l,u)}static async emit(e,t,i,r=!1,o=null){let{abc_agent_score:s,abc_bot_score:a,abc_consumer_score:l}=bl(e),u=e.filter(y=>!y.pass).map(y=>y.id),f=u;if(JSON.stringify(u).length>i.maxChecksPayloadBytes){let y=[];for(let C of u){if(JSON.stringify([...y,C,"truncated"]).length>i.maxChecksPayloadBytes)break;y.push(C)}y.push("truncated"),f=y}let v={abc_agent_score:s,abc_bot_score:a,abc_consumer_score:l,abc_failed_checks:f,abc_checks_run:e.length,abc_validator_version:yl,abc_lcp_ms:o,abc_raw_html_checked:r,page_view_uuid:t};try{let y=await B.createEvent("content_readiness",v);if(!y.success||y.value===null)return;await ae.send(y.value)}catch{}}static resolveArticleKey(){var e;try{let t=d.getArticleDetails();if(t.success){let i=(e=t.value)==null?void 0:e.article_uuid;if(i&&typeof i=="string"&&i.trim()!=="")return i.trim()}}catch{}try{return window.location.pathname.replace(/\/+$/,"")||"/"}catch{return"unknown"}}static todayString(){let e=new Date,t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${r}`}static releaseLock(e){h.remove(e)}};O.initialized=!1,O.runner=new hn,O.config=null;xo=O});var Po,Mp,Hi,Np,Op,Up,Sl,Fp,Io,Ki,Al=p(()=>{"use strict";m();F();Po="g2i_",Mp=new Set(["ofrgp_id","sp_offergroupid","returnurl","naviga_jid","campaignid","campaignname","conversationid","conversationname","conversationcode","meterlevel","meterlevelid"]),Hi={campaignid:"campaignId",campaignname:"campaignName",conversationid:"conversationId",conversationname:"conversationName",conversationcode:"conversationCode",meterlevel:"meterLevel",meterlevelid:"meterLevelId"},Np=new Set(["campaignId","conversationId","meterLevelId"]),Op=2048,Up=24,Sl=new Set(["g2i_actionid","ofrgp_id","returnurl","naviga_jid","campaignid","conversationid","meterlevelid"]),Fp=[["anonDeviceId","aui"],["auth0_sub","auth0Id"]],Io="naviga-analytics-journey-session",Ki=class{static getContext(){let e={...c(()=>this.getUrlParams(),{}),...c(()=>this.getCookieFields(),{})},t={};for(let[i,r]of Object.entries(e))if(Np.has(i)&&typeof r=="string"){let o=Number(r);t[i]=isNaN(o)?r:o}else t[i]=r;if(t.ofrgp_id&&!t.sp_offerGroupId){let i=Number(t.ofrgp_id);t.sp_offerGroupId=isNaN(i)?t.ofrgp_id:i}return t}static reset(){try{h.remove(Io)}catch{}}static getUrlParams(){let e=this.parseCurrentUrl();return Object.keys(e).length>0&&this.writeSession(e),{...e,...this.readSession()}}static getCookieFields(){let e={};for(let[t,i]of Fp){let r=h.get(t);r&&(e[i]=r)}return e}static parseCurrentUrl(){try{if(typeof window=="undefined"||typeof window.location=="undefined")return{};let e=new URLSearchParams(window.location.search),t={};return e.forEach((i,r)=>{let o=r.toLowerCase();if(!o.startsWith(Po)&&!Mp.has(o)||!i||i.length>Op||Object.keys(t).length>=Up)return;let s=r,a=o.startsWith(Po)?o.slice(Po.length):o;Hi[a]?s=Hi[a]:Hi[o]&&(s=Hi[o]),t[s]=i}),t}catch{return{}}}static writeSession(e){try{let t=this.readSession(),i=this.isNewJourney(t,e)?{}:t;h.set(Io,JSON.stringify({...i,...e}))}catch{}}static readSession(){try{let e=h.get(Io);if(!e)return{};let t=JSON.parse(e);return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:{}}catch{return{}}}static isNewJourney(e,t){let i=new Map;for(let[r,o]of Object.entries(e)){let s=r.toLowerCase();Sl.has(s)&&i.set(s,o)}for(let[r,o]of Object.entries(t)){let s=r.toLowerCase();if(!Sl.has(s))continue;let a=i.get(s);if(a!==void 0&&a!==o)return!0}return!1}}});var Do={};M(Do,{CustomEventPayload:()=>vn});var Lo,Bp,Vp,Hp,vn,zi=p(()=>{"use strict";w();m();Al();Gn();Cn();ao();co();Lo=new Set(["event_id","event_name","event_time_epoc","platform_name","platform_type","device_id","session_id","organisation_id","organisation_name","publication_id","publication_name","bot_suspected","agent_suspected","event_creation_date","event_create_year","event_create_month","event_create_date","page_view_uuid","consent_state","page_class","page_class_source","page_class_signals"]),Bp=new Set(Object.keys(Oe).filter(n=>n!=="page_title"&&n!=="additional_info")),Vp=new Set([...Object.keys(ui),...Object.keys(Oe),...Object.keys(di)]),Hp="src_",vn=class{static withoutRe
1servedKeys(e,t){let i={},r=[];for(let[o,s]of Object.entries(e)){if(Lo.has(o)){r.push(o);continue}i[o]=s}return r.length>0,i}static namespaceAutoTrackedKeys(e){return this.namespaceCollidingKeys(e,"auto-tracked payload")}static namespaceCollidingKeys(e,t){let i={},r=[];for(let[o,s]of Object.entries(e)){if(Vp.has(o)||Lo.has(o)){i[`${Hp}${o}`]=s,r.push(o);continue}i[o]=s}return r.length>0,i}static journeyFields(){return c(()=>this.namespaceCollidingKeys(Ki.getContext(),"journey context"),{})}static engageFields(){return c(()=>this.namespaceCollidingKeys(we.getContext(),"engage context"),{})}static withCommonProperties(e){let t=this.withoutReservedKeys(e||{},"track() properties"),i={...this.engageFields(),...this.journeyFields()},r=c(()=>d.getCustomEventCommonDetails(),{}),s={...Object.keys(r).length===0?{}:this.withoutReservedKeys(r,"customEvents.commonDetailsMapping"),...t};for(let[a,l]of Object.entries(i)){let u=s[a];(u==null||u==="")&&(s[a]=l)}return s}static stripArticleFields(e){return c(()=>{let t=Object.keys(e).filter(r=>Bp.has(r));if(t.length===0)return e;let i={...e};for(let r of t)delete i[r];return i},e)}static applyExclusions(e){return c(()=>{let t=d.getCustomEventExcludeKeys();if(t.length===0)return e;let i=t.filter(o=>!Lo.has(o));if(i.length===0)return e;let r={...e};for(let o of i)delete r[o];if(typeof r.additional_info=="string"&&r.additional_info){let o=null;try{let s=JSON.parse(r.additional_info);o=s&&typeof s=="object"&&!Array.isArray(s)?s:null}catch{o=null}if(o){let s=!1;for(let a of i)a in o&&(delete o[a],s=!0);s&&(r.additional_info=JSON.stringify(o))}}return r},e)}}});var Mo={};M(Mo,{CustomEventTracker:()=>ji});var ji,No=p(()=>{"use strict";w();m();zi();ji=class{static bindingKey(e){return`${e.sourceType}|${e.sourceEventName}|${e.targetEventName}`}static dispatch({binding:e,active:t},i,r,o){if(t)try{let s=e.payloadMapper?e.payloadMapper(i):r();s!=null&&o(e.targetEventName,vn.namespaceAutoTrackedKeys(s))}catch{}}static initBindings(e,t){let i=t!=null?t:d.getCustomEventBindings();if(!i||i.length===0)return;let r=[];for(let a of i){let l=this.bindingKey(a);if(this.bound.has(l))continue;let u={binding:a,active:!0};this.bound.set(l,u),r.push(u)}if(r.length===0)return;let o=r.filter(a=>a.binding.sourceType==="dom"),s=r.filter(a=>a.binding.sourceType==="knockout");o.length>0&&this.initDomBindings(o,e),s.length>0&&this.initKnockoutBindings(s,e)}static unbindBindings(e){for(let t of e){let i=this.bindingKey(t),r=this.bound.get(i);r&&(r.active=!1,r.off&&c(r.off,void 0),this.bound.delete(i))}}static initDomBindings(e,t){e.forEach(i=>{let{binding:r}=i;c(()=>{let o=s=>{this.dispatch(i,s,()=>{let a=s.detail;return a==null?{}:typeof a=="object"?{...a}:{value:a}},t)};document.addEventListener(r.sourceEventName,o),i.off=()=>document.removeEventListener(r.sourceEventName,o)},void 0)})}static initKnockoutBindings(e,t){c(()=>{let i=window;if(i.ko&&i.ko.postbox&&typeof i.ko.postbox.subscribe=="function"){this.subscribeKnockoutEvents(e,t);return}let r=0,o=100,s=setInterval(()=>{r++,i.ko&&i.ko.postbox&&typeof i.ko.postbox.subscribe=="function"?(clearInterval(s),this.subscribeKnockoutEvents(e,t)):r>=o&&(clearInterval(s),this.subscribeKnockoutEventsAsDomEvents(e,t))},100)},void 0)}static subscribeKnockoutEventsAsDomEvents(e,t){e.forEach(i=>{let{binding:r}=i;i.active&&c(()=>{let o=s=>{let a=s.detail;this.dispatch(i,a,()=>typeof a=="object"&&a!==null?{...a}:{value:a},t)};document.addEventListener(r.sourceEventName,o),i.off=()=>document.removeEventListener(r.sourceEventName,o)},void 0)})}static subscribeKnockoutEvents(e,t){let i=window;e.forEach(r=>{let{binding:o}=r;r.active&&c(()=>{let s=i.ko.postbox.subscribe(o.sourceEventName,a=>{this.dispatch(r,a,()=>typeof a=="object"&&a!==null?{...a}:{value:a},t)});s&&typeof s.dispose=="function"&&(r.off=()=>s.dispose())},void 0)})}};ji.bound=new Map});var Uo={};M(Uo,{CrossDomainLinker:()=>Gi,LINKER_PARAM:()=>Oo});var Oo,Kp,Gi,Fo=p(()=>{"use strict";w();rr();m();ze();Gn();Oo="naviga_jid",Kp=["campaignId","campaignName","conversationId","conversationName","conversationCode","meterLevel","meterLevelId"],Gi=class{static install(){c(()=>{this.installed||typeof document!="undefined"&&this.linkerHosts().length!==0&&(document.addEventListener("click",e=>this.onClick(e),!0),this.installed=!0)},void 0)}static reset(){this.installed=!1}static onClick(e){c(()=>{let t=this.anchorFor(e.target);if(!t)return;let i=t.getAttribute("href");if(!i)return;let r=this.decorate(i);r&&r!==i&&t.setAttribute("href",r)},void 0)}static decorate(e){return c(()=>
1{if(typeof window=="undefined")return null;let t=new URL(e,window.location.href);if(!this.isLinkerHost(t.hostname))return null;let i=this.journeyId();i&&!t.searchParams.has(Oo)&&t.searchParams.set(Oo,i);let r=we.getContext();for(let o of Kp){let s=r[o];s!=null&&s!==""&&!t.searchParams.has(o)&&t.searchParams.set(o,String(s))}return t.toString()},null)}static journeyId(){let e=te.getEventFields(),t=e&&e.page_view_uuid;return typeof t=="string"&&t!==""?t:null}static anchorFor(e){let t=e;for(;t&&t!==document.body;){if(t.tagName&&t.tagName.toLowerCase()==="a")return t;t=t.parentElement}return null}static isLinkerHost(e){return En(e,this.linkerHosts())}static linkerHosts(){return c(()=>d.getCrossDomainLinkerHosts(),[])}};Gi.installed=!1});var kl={};M(kl,{CacheInvalidationManager:()=>It});var It,Tl=p(()=>{"use strict";yn();so();ht();Kn();Ai();ki();It=class{static initialize(){this.isInitialized||typeof window!="undefined"&&(this.setupSPANavigationListener(),this.setupBFCacheListener(),this.isInitialized=!0)}static setupSPANavigationListener(){try{this.spaUnsubscribe=ee.subscribe(e=>{N.clear(),ge.reset(),J.reset(),Ee.reset()},{trackHashChanges:!1})}catch{}}static setupBFCacheListener(){try{this.bfcacheUnsubscribe=he.subscribe(()=>{N.clear(),ge.reset(),J.reset(),Ee.reset()})}catch{}}static cleanup(){if(this.isInitialized)try{this.spaUnsubscribe&&(this.spaUnsubscribe(),this.spaUnsubscribe=null),this.bfcacheUnsubscribe&&(this.bfcacheUnsubscribe(),this.bfcacheUnsubscribe=null),this.isInitialized=!1}catch{}}static getIsInitialized(){return this.isInitialized}};It.isInitialized=!1,It.bfcacheUnsubscribe=null,It.spaUnsubscribe=null});k();w();w();w();m();var Wo=typeof window!="undefined"&&typeof console!="undefined",xe=class{static logMessage(e,...t){c(()=>{try{if(!d.get().loggingEnabled||!Wo)return;console[e]("[NavigaAnalytics]",...t)}catch{}},void 0)}static warnAlways(...e){c(()=>{try{if(!Wo)return;console.warn("[NavigaAnalytics]",...e)}catch{}},void 0)}static log(...e){this.logMessage("log",...e)}static info(...e){this.logMessage("info",...e)}static warn(...e){this.logMessage("warn",...e)}static error(...e){this.logMessage("error",...e)}};m();Cn();_n();ht();var ls=new Set([...Object.keys(Oe),"total_word_count"]),uu=2048,du=["email","phone","mobile","msisdn","ipaddress","latitude","longitude","geolocation","postcode","postalcode","zipcode","address","city","firstname","lastname","fullname","username","birth","gender","ssn","password","creditcard","subscriber","subscription","household"],fu=["ip","lat","lng","lon","zip","dob","gps"],Ht=class{static validate(e){c(()=>{let t=d.get();this.checkRoutingKeys(t),this.checkIneffectiveKeys(e),this.checkMappingVariableName("articleDetailsMapping",t.articleDetailsMapping),this.checkMappingVariableName("userDetailsMapping",t.userDetailsMapping),this.checkArticleMappingContents(t.articleDetailsMapping),this.checkAutoContextArticlePaths(e),this.checkPageClass(e),this.checkPageClassEnforcement(e),this.checkPageClassPatternRules(e),this.checkSpaNavigationConfig(e)},void 0)}static checkRoutingKeys(e){c(()=>{let t=[];this.isNonEmptyString(e.organisation_name)||t.push("organisation_name"),this.isNonEmptyString(e.publication_name)||t.push("publication_name"),t.length!==0&&xe.warnAlways(`[ConfigValidator] Missing required config: ${t.join(" and ")}. Every event from this page will be unroutable and will NOT reach the warehouse \u2014 ingestion routes on organisation_name#publication_name#event_name. Set these in Analytics.init().`)},void 0)}static checkIneffectiveKeys(e){c(()=>{if(!(!e||typeof e!="object"))for(let t of this.INEFFECTIVE_KEYS){let[i,r]=t.split("."),o=r?e[i]:e;!o||typeof o!="object"||(r!=null?r:i)in o}},void 0)}static checkMappingVariableName(e,t){c(()=>{let i=t&&t.variableName;this.isNonEmptyString(i)&&i.includes(".")&&xe.warnAlways(`[ConfigValidator] ${e}.variableName "${i}" will never resolve \u2014 the SDK looks the name up directly on window, it does not walk a dotted path. Use { ${this.suggestMappingFix(i)} } instead.`)},void 0)}static checkArticleMappingContents(e){c(()=>{if(!e||!this.isNonEmptyString(e.variableName)||typeof window=="undefined")return;let t=d.resolveMappedGlobal(e);if(!t||typeof t!="object"||Array.isArray(t))return;let i=Object.keys(t);if(i.length===0)return;let r=i.filter(f=>!ls.has(f)),o=i.length-r.length;o===0&&xe.warnAlways(`[ConfigValidator] articleDetailsMapping resolved "${e.variableName}" but none of its ${i.length} keys are article fields the SDK recognises \u2014 every value is being swept into additional_info instead of its own column. Expected keys include ${this.sampleRecognisedKeys().join(", ")}. Check the mapping points at the right object, or rename the keys to match.`);let s=this.serialisedSize(t,r),a=r.filter(f=>this.looksPersonal(f)).length,l=s>uu,u=o===0&&a>0},void 0)}static checkAutoContextArticlePaths(e){c(()=>{var r;let t=e==null?void 0:e.autoContext;if(!t)return;let i=(r=t.articleDetection)!=null?r:"auto";i!=="paths"&&!this.verdictIsPathsOnly(t)||gt(t.articlePaths)||xe.warnAlways(`[ConfigValidator] autoContext has no usable articlePaths, and the only article test configured is the URL path one (articleDetection: '${i}'). No page's markup will ever classify it as an article, so article context will only be attached where your own declared article data supplies it \u2014 pages relying on the markup get none. List the URL path prefixes that identify articles, e.g. articlePaths: ['/news/', '/sport/'].`)},void 0)}static verdictIsPathsOnly(e){return c(()=>{var i;let t=(i=e==null?void 0:e.profile)==null?void 0:i.verdict;return!Array.isArray(t)||t.length===0?!1:t.every(r=>(r==null?void 0:r.path)===!0)},!1)}static checkPageClass(e){c(()=>{let t=e==null?void 0:e.pageClass;t!==void 0&&Vt.includes(t)},void 0)}static checkPageClassEnforcement(e){c(()=>{let t=e==null?void 0:e.pageClassEnforcement},void 0)}static checkPageClassPatternRules(e){c(()=>{var i;let t=(i=e==null?void 0:e.autoContext)==null?void 0:i.pageClasses;if(!(!t||typeof t!="object"))for(let r of Vt)r in t&&rs(t[r])},void 0)}static checkSpaNavigationConfig(e){c(()=>{var i;let t=(i=e==null?void 0:e.spaNavigation)==null?void 0:i.treatReplaceStateAsNavigation},void 0)}static suggestMappingFix(e){return c(()=>{let t=e.replace(/^window\./,""),i=t.indexOf(".");return i===-1||i===t.length-1?`variableName: '${t.replace(/\.$/,"")}'`:`variableName: '${t.slice(0,i)}', path: '${t.slice(i+1)}'`},`variableName: '${e}'`)}static sampleRecognisedKeys(){return c(()=>Array.from(ls).filter(e=>e!=="additional_info"&&!e.endsWith("_uuid")).slice(0,4),[])}static serialisedSize(e,t){return c(()=>{let i={};for(let r of t)i[r]=e[r];return JSON.stringify(i).length},0)}static looksPersonal(e){return c(()=>{let t=e.toLowerCase().replace(/[^a-z0-9]/g,"");return t===""?!1:fu.includes(t)?!0:du.some(i=>t.includes(i))},!1)}static isNonEmptyString(e){return typeof e=="string"&&e.trim()!==""}};Ht.INEFFECTIVE_KEYS=["api_key","enableBotFiltering","organisation_id","telemetry.enabled","abTesting.dashboardUrl","abTesting.loggingEnabled","heartbeatConfig.send_closing_ping","heartbeatConfig.min_active_time_for_closing_ping"];m();function pu(n){return c(()=>
1{if(typeof n!="string")return null;let e=n.trim().split("/");if(e.length!==2)return null;let t=e[0].trim(),i=e[1].trim();return t===""||i===""?null:{organisation_name:t,publication_name:i}},null)}function ds(n){return c(()=>{let e={notices:[]};if(!n||typeof n!="object"||n.site===void 0)return e;let t=pu(n.site);return t?(us(n,e,"organisation_name",t.organisation_name),us(n,e,"publication_name",t.publication_name),e):(e.notices.push(`[SiteShorthand] site: ${JSON.stringify(n.site)} is not of the form 'organisation/publication' (exactly one '/', neither half blank). It has been ignored \u2014 organisation_name and publication_name are left exactly as passed.`),e)},{notices:[]})}function us(n,e,t,i){let r=n[t];if(typeof r=="string"&&r.trim()!==""){r!==i&&e.notices.push(`[SiteShorthand] ${t} '${r}' disagrees with site '${n.site}', which expands to '${i}'. The explicit ${t} wins. One of the two is wrong \u2014 events will be filed under the explicit value.`);return}e[t]=i}Je();ft();m();function fs(n){return new Proxy(n,{get(e,t){let i=Reflect.get(e,t);return typeof i=="function"?mu(i.bind(e)):i}})}function mu(n){return(...e)=>{try{let t=n(...e);return t instanceof Promise?t.catch(()=>{}):t}catch{return}}}Tn();Mn();$t();Sr();Ze();m();Yt();var Un=class{constructor(){this.id="explicit";this.precedence=He.explicit;this.regions=["GLOBAL"];this.emit=null}async init(e){this.emit=e}setConsent(e){c(()=>{if(!e||typeof e!="object")return;let t={};for(let r of Object.keys(e)){let o=this.coerce(e[r]);o&&(t[r]=o)}let i={source:this.id,regionApplies:!0,categories:t,ts:Date.now()};this.emit&&this.emit(i)},void 0)}teardown(){this.emit=null}coerce(e){return e===!0?"granted":e===!1?"denied":e==="granted"||e==="denied"||e==="unknown"?e:null}};m();Yt();function Nu(){return c(()=>{if(!(typeof navigator=="undefined"||!navigator))return navigator.globalPrivacyControl},void 0)}var Fn=class{constructor(){this.id="gpc";this.precedence=He.gpc;this.regions=["GLOBAL"];this.emit=null}async init(e){if(this.emit=e,Nu()!==!0)return;let t={source:this.id,regionApplies:!0,categories:{analytics:"denied",marketing:"denied"},ts:Date.now()};this.emit&&this.emit(t)}teardown(){this.emit=null}};_e();Yt();var Bn=class{constructor(e){this.record=e;this.id="persisted";this.precedence=He.persisted;this.regions=["GLOBAL"];this.emit=null}async init(e){this.emit=e;let t=this.record;if(!t)return;let i={};for(let o of z){if(Y(o))continue;let s=t.resolved[o];(s==="granted"||s==="denied")&&(i[o]=s)}if(Object.keys(i).length===0)return;let r={source:this.id,regionApplies:!0,categories:i,ts:t.ts};this.emit&&this.emit(r)}teardown(){this.emit=null}};m();w();F();Pn();var Ps="naviga-consent-record",Vn=1,Is=395,Ou=5*60*1e3,Uu=3072;function Ls(){return c(()=>{let n=d.getConsentConfig().maxAgeDays;return typeof n=="number"&&Number.isFinite(n)&&n>0?n:Is},Is)}var bt=class{static save(e){c(()=>{let t=JSON.stringify(e);typeof t!="string"||Cr(t).length>Uu||h.set(Ps,t,{days:Ls(),domain:d.getConsentConfig().cookieDomain||null})},void 0)}static load(){return c(()=>{let e=h.get(Ps);if(typeof e!="string"||e.length===0)return null;let t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return null;let i=t;if(i.v!==Vn)return null;let r=i.ts;if(typeof r!="number"||!Number.isFinite(r))return null;let o=Date.now();if(r>o+Ou||o-r>Ls()*864e5)return null;let s=i.resolved;return!s||typeof s!="object"||Array.isArray(s)?null:{v:Vn,ts:r,region:typeof i.region=="string"?i.region:"GLOBAL",resolved:s,src:Array.isArray(i.src)?i.src.filter(a=>typeof a=="string"):[]}},null)}};_e();F();An();Ar();ht();Kn();An();var Vu=50,zn=[],kr=!1,Os=!1;function jn(n,e){return(t,i)=>{if(Sn()){(!e||e())&&n(t,i);return}if(zn.length>=Vu){Os||(Os=!0);return}zn.push({eventName:t,properties:i,track:n,shouldSend:e}),kr||(kr=!0,wn(()=>{let r=zn;zn=[],kr=!1;for(let o of r)try{if(o.shouldSend&&!o.shouldSend())continue;o.track(o.eventName,o.properties)}catch{}}))}}w();Gn();function qn(n){var r,o,s;we.merge(n);let e=window,t=(s=(o=(r=d.get())==null?void 0:r.customEvents)==null?void 0:o.commonDetailsMapping)==null?void 0:s.variableName,i=typeof t=="string"&&t.trim()!==""?t.trim():"navigaEngageDetails";e[i]=e[i]||{},Object.assign(e[i],n)}function Tr(n){var i,r,o,s,a,l,u,f,g,v,y;let e=(o=(r=(i=n.OfferId)!=null?i:n.offerId)!=null?r:n.Id)!=null?o:n.id,t=(s=n.Type)!=null?s:n.type;return{id:e!=null?String(e):"",planName:(f=(u=(l=(a=n.Name)!=null?a:n.name)!=null?l:n.PlanName)!=null?u:n.planName)!=null?f:"",price:(y=(v=(g=n.TotalPrice)!=null?g:n.totalPrice)!=null?v:n.Amount)!=null?y:n.Price,type:n.IsPrint&&n.IsDigital?"Both":n.IsDigital?"Digital":n.IsPrint?"Print":t!=null?t:""}}function Us(n){let e=Array.prototype.map.call(n,t=>
1t&&t.pid).filter(Boolean);return e.length>0?e.join(","):void 0}function Hu(n){let e={};if(n.promotionsList){let t=Us(n.promotionsList);t!==void 0&&(e.sp_pid=t)}if(n.params&&n.params.presentationName&&(e.sp_presentationName=n.params.presentationName),n.offer){let{id:t,planName:i,price:r,type:o}=Tr(n.offer);e.sp_offerId=t,e.sp_offerPlanName=i,r!==void 0&&(e.sp_offerPrice=r),e.sp_offerType=o}return n.internalSessionId&&(e.internalSessionId=n.internalSessionId),e}function Rr(n){let e={};return n.offerGroupId!=null&&(e.sp_offerGroupId=n.offerGroupId),n.siteCode&&(e.sp_siteCode=n.siteCode),n.clientCode&&(e.sp_clientCode=n.clientCode),n.zipCode&&(e.sp_zipCode=n.zipCode),n.url&&(e.sp_url=n.url),n.MG2Fingerprint&&(e.sp_mg2Fingerprint=n.MG2Fingerprint),e}function Ct(n){return{...Hu(n),...Rr(n)}}var Wn=[{sourceType:"dom",sourceEventName:"onMeterLevelSet",targetEventName:"ignored",payloadMapper:n=>{let e=n.detail||{},t={};return e.MeterLevelId!=null&&(t.meterLevelId=e.MeterLevelId),e.MeterLevel!=null&&(t.meterLevel=e.MeterLevel),e.CampaignId!=null&&(t.campaignId=e.CampaignId),e.CampaignName!=null&&(t.campaignName=e.CampaignName),qn(t),null}},{sourceType:"dom",sourceEventName:"onConversationDetermined",targetEventName:"ignored",payloadMapper:n=>{let e=n.detail||{},t={},i=e.Conversation||{},r=i.Props||i.Properties||{};return e.CampaignId!=null&&(t.campaignId=e.CampaignId),i.Id!=null&&(t.conversationId=i.Id),i.Code!=null&&(t.conversationCode=i.Code),i.Name!=null&&(t.conversationName=i.Name),r.Views!=null&&(t.conversationViews=r.Views),r.ArticleLeft!=null&&(t.conversationArticleLeft=r.ArticleLeft),r.Date&&(r.Date.Started!=null&&(t.conversationDateStarted=r.Date.Started),r.Date.Ended!=null&&(t.conversationDateEnded=r.Date.Ended),r.Date.Expiration!=null&&(t.conversationDateExpiry=r.Date.Expiration)),qn(t),null}},{sourceType:"dom",sourceEventName:"onFinish",targetEventName:"on_finish",payloadMapper:n=>{let e=n.detail||{};if(e.MG2AccountData&&typeof e.MG2AccountData=="object"){let t=e.MG2AccountData,i={};Array.isArray(t.OwnedSubscriptions)&&t.OwnedSubscriptions.length>0&&(i.engage_subscriptions=t.OwnedSubscriptions),t.MasterId&&(i.engage_master_id=t.MasterId),t.DigitalAccess&&typeof t.DigitalAccess=="object"&&t.DigitalAccess.AccessLevel&&(i.engage_access_level=t.DigitalAccess.AccessLevel),Object.keys(i).length>0&&qn(i)}return{...e||{},_sdk_auto_tracked:!0}}},{sourceType:"dom",sourceEventName:"RegistrationSuccess",targetEventName:"user_registered",payloadMapper:n=>{let e=n&&n.detail!==void 0?n.detail:n||{},i=(e.EventData||{}).RegistrationContext||e.RegistrationContext||{},r={_sdk_auto_tracked:!0},o=new Set(["email","emailaddress","useremail","e-mail"]);if(typeof i=="object"&&i!==null)for(let[f,g]of Object.entries(i))o.has(f.toLowerCase())||g!=null&&g!==""&&(r[f]=g);let s=e.auth0Id||e.auth0_id||i.auth0Id||i.auth0_id;s&&(r.auth0Id=s,r.auth0_id=s);let a=e.siteCode||i.siteCode;a&&(r.siteCode=a);let l=e.clientCode||i.clientCode;l&&(r.clientCode=l);let u=e.source||i.source;return u&&(r.source=u),r}},{sourceType:"dom",sourceEventName:"onActionShown",targetEventName:"action_shown",payloadMapper:n=>{let t=(n.detail||{}).EventData||{},i={1:"Paywall",2:"Newsletter",3:"Registration",4:"Redirect",5:"InArticle",6:"Custom"},r=null;try{t.UserDefinedData&&(r=JSON.parse(t.UserDefinedData))}catch{r=t.UserDefinedData}return(t.Id||t.Name)&&qn({actionId:t.Id,actionName:t.Name,ActionId:t.Id,ActionName:t.Name}),{actionId:t.Id,actionName:t.Name,actionDescription:t.Description,actionType:t.ActionType||i[t.ActionTypeId]||"",userDefinedData:JSON.stringify(r),_sdk_auto_tracked:!0}}},{sourceType:"dom",sourceEventName:"click",targetEventName:"click_action",payloadMapper:n=>{let e=n.target;if(!e)return null;let t=e,i=null;for(;t&&t!==document.body;){if(t.hasAttribute("data-mg2-action")){i=t.getAttribute("data-mg2-action");break}t=t.parentElement}if(!i||["login","activation","register","logout","subscribe","click"].indexOf(i.toLowerCase())===-1)return null;let s={login:"Login",activation:"Activate",register:"Register",logout:"Logout",subscribe:"Subscribe",click:"CheckoutStart"}[i.toLowerCase()]||i,a=null,l=null,u=null,f=t;for(;f&&f!==document.body;){let x=f.getAttribute&&f.getAttribute("href");if(x&&x!=="#"){a=x;try{let Me=new URL(x,window.location.href).searchParams;l=Me.get("G2I_ActionId"),u=Me.get("ofrgp_id")}catch{}break}f=f.parentElement}let g=null,v=null,y=window,C=y.CnnXt||y.Connext;if(C){if(C.GetCurrentConversation){let x=C.GetCurrentConversation();x&&(g=x.Name)}if(C.GetCurrentConversationViewCount){let x=C.GetCurrentConversationViewCount();x!==null&&(v=x+"")}}let _=we.getContext(),U=g||_.conversationName||null,T=v||(_.conversationViews!=null?String(_.conversationViews):null),X=_.actionName||_.ActionName||null,oe=l||_.actionId||_.ActionId||null;return{ClickAction:s,ActionName:X,ActionId:oe,ButtonText:(e.textContent||e.innerText||"").replace(/\s+/g," ").trim(),ConversationName:U,ArticleViews:T,ClickDestination:a,DestinationActionId:l,DestinationOfferGroupId:u,_sdk_auto_tracked:!0}}},{sourceType:"knockout",sourceEventName:"presentation_loaded_e",targetEventName:"checkout_started",payloadMapper:n=>{let e={...Rr(n||{}),_sdk_auto_tracked:!0};if(n&&n.promotionsList){let t=Us(n.promotionsList);t!==void 0&&(e.sp_pid=t)}return n&&n.params&&n.params.presentationName&&(e.sp_presentationName=n.params.presentationName),n&&n.internalSessionId&&(e.internalSessionId=n.internalSessionId),e}},{sourceType:"knockout",sourceEventName:"offers_presented_e",targetEventName:"offers_presented",payloadMapper:n=>{let e={...Rr(n||{}),_sdk_auto_tracked:!0},t=n&&n.offers?n.offers:[],i=[],r=[],o=[];return t.forEach(s=>{let{id:a,planName:l}=Tr(s);i.push(a),r.push(l),o.push(a+":"+l)}),e.sp_offerIds=i.toString(),e.sp_offerPlanNames=r.toString(),e.sp_offerPlanConcat=o.toString(),n&&n.params&&n.params.presentationName&&(e.sp_presentationName=n.params.presentationName),n&&n.internalSessionId&&(e.internalSessionId=n.internalSessionId),e}},{sourceType:"knockout",sourceEventName:"offer_selected_e",targetEventName:"offer_selected",payloadMapper:n=>({...Ct(n||{}),_sdk_auto_tracked:!0})},{sourceType:"knockout",sourceEventName:"created_new_user_e",targetEventName:"new_registration",payloadMapper:n=>({...Ct(n||{}),_sdk_auto_tracked:!0})},{sourceType:"knockout",sourceEventName:"user_info_completed_e",targetEventName:"user_info_completed",payloadMapper:n=>({...Ct(n||{}),_sdk_auto_tracked:!0})},{sourceType:"knockout",sourceEventName:"delivery_address_completed_e",targetEventName:"delivery_address_completed",payloadMapper:n=>({...Ct(n||{}),_sdk_auto_tracked:!0})},{sourceType:"knockout",sourceEventName:"billing_address_completed_e",targetEventName:"billing_address_completed",payloadMapper:n=>({...Ct(n||{}),_sdk_auto_tracked:!0})},{sourceType:"knockout",sourceEventName:"add_subscription_success_e",targetEventName:"subscription_success",payloadMapper:n=>{let e=n||{},t=e.offer||{},i=e.subscription||{},{id:r,planName:o,price:s,type:a}=Tr(t),l={sp_offerId:r,sp_offerPlanName:o,sp_offerType:a,_sdk_auto_tracked:!0};return s!==void 0&&(l.sp_offerPrice=s),i.EventId&&(l.sp_subEventId=i.EventId),i.AccountNumber&&(l.sp_accountNumber=i.AccountNumber),i.PaymentAuthorizationCode&&(l.sp_paymentAuthorizationCode=i.PaymentAuthorizationCode),i.SubscriptionID&&(l.sp_subSubscriptionId=i.SubscriptionID),i.SubscriberID&&(l.sp_subSubscriberId=i.SubscriberID),i.RedirectUrl&&(l.sp_redirectUrl=i.RedirectUrl),e.params&&e.params.presentationName&&(l.sp_presentationName=e.params.presentationName),e.internalSessionId&&(l.internalSessionId=e.internalSessionId),l}},...["credit_card","bank_account","bill_me","apple_pay","paypal"].map(n=>({sourceType:"knockout",sourceEventName:`${n}_completed_e`,targetEventName:"payment_completed",payloadMapper:e=>{let t={credit_card:"Credit Card",bank_account:"Bank Account",bill_me:"Bill Me",apple_pay:"Apple Pay",paypal:"Paypal"},i=Ct(e||{});return i.sp_paymentType=t[n]||"",i._sdk_auto_tracked=!0,i}}))];var xr={"naviga-relay":Wn};function Bs(){return[].concat(...Object.values(xr))}var Fs=new Set;function $n(n){return typeof n=="string"&&/^\s*(none|off)\s*$/i.test(n)}
1function Pr(n){try{if(typeof n!="string")return[];let e=n.trim();if(e===""||$n(e))return[];let t=xr[e];return t||(Fs.has(e)||(Fs.add(e),xe.warnAlways(`[Analytics] Unknown custom-event preset '${e}' \u2014 no auto-tracking bindings were registered. Known presets: ${Object.keys(xr).join(", ")}.`)),[])}catch{return[]}}var Ku=",",Hs="naviga-data-attributes";function zu(n){if(n===null)return null;try{let e=JSON.parse(n);return!e||typeof e!="object"||Array.isArray(e)?null:e}catch{return null}}function ju(n){return n.split(Ku).map(e=>e.trim()).filter(e=>e!=="")}function Gu(n){try{if(!n||typeof n.getAttribute!="function")return null;let e={},t=n.getAttribute("data-site");t!==null&&(e.site=t);let i=n.getAttribute("data-api-base-url");i!==null&&(e.api_base_url=i);let r=n.getAttribute("data-preset");r!==null&&(e.preset=r);let o=zu(n.getAttribute("data-auto-context")),s=n.getAttribute("data-article-paths");if(s!==null){let v=o!=null?o:{};v.articlePaths=ju(s),e.autoContext=v}else o&&(e.autoContext=o);let a=n.getAttribute("data-publication-id");a!==null&&(e.publication_id=a);let l=n.getAttribute("data-organisation-name");l!==null&&(e.organisation_name=l);let u=n.getAttribute("data-publication-name");u!==null&&(e.publication_name=u);let f=n.getAttribute("data-organisation-id");f!==null&&(e.organisation_id=f);let g=n.getAttribute("data-page-class");return g!==null&&(e.pageClass=g),Object.keys(e).length>0?e:null}catch{return null}}var Yn=null,Vs=!1;function Ks(){if(!Vs){Vs=!0;try{Yn=Gu(document.currentScript)}catch{Yn=null}}}function Ir(){return Yn}function zs(n){let e=Yn;if(!e)return n;let t=n&&typeof n=="object"?{...n}:{};for(let i of Object.keys(e))t[i]===void 0&&(t[i]=e[i]);return t}var Q=typeof window!="undefined"&&typeof document!="undefined";Q&&(Ds(),as());var Rl=new Ce(()=>Promise.resolve().then(()=>(mi(),gi)),{message:"Failed to load PageViewTracker module",severity:"medium",source:"LazyLoad.PageViewTracker"}),zp=new Ce(()=>Promise.resolve().then(()=>(hi(),bc)),{message:"Failed to load LeavePageTracker module",severity:"medium",source:"LazyLoad.LeavePageTracker"}),qi=new Ce(()=>Promise.resolve().then(()=>(wc(),Ec)),{message:"Failed to load ClickTracker module",severity:"low",source:"LazyLoad.ClickTracker"}),Wi=null,xl=null,Pl=null,Il=null,Ll=!1,Bo=!1,$i=!1,Dl=null,Ml=!1,Nl=null;function Vo(n){return z.map(e=>`${e}=${n[e]}`).join(";")}function jp(n){c(()=>{let e=Vo(n);e!==Nl&&(Nl=e)},void 0)}function Kl(n){S.hasAnySignal()&&(h.purgeUnconsented(n),jp(n))}function Ol(n){d.getConsentConfig().enabled===!0&&(Kl(n),Gp(n))}var Ul=null;function Gp(n){c(()=>{if(d.getConsentConfig().persist!==!0||!S.hasAnySignal())return;let e=S.getStampState(),t=Array.isArray(e._src)?e._src:[],i=t.filter(y=>y!=="persisted");if(i.length===0)return;let r=S.assertedCategories(),o={};for(let y of z){if(!r.has(y))continue;let C=n[y];(C==="granted"||C==="denied")&&(o[y]=C)}if(Object.keys(o).length===0)return;let s=e._region,a=Vo(o),l=bt.load(),u=t.includes("persisted")&&l?l.src:[],f=Array.from(new Set([...i,...u])),g=`${a}|${s}|${f.join(",")}`;if(g===Ul)return;Ul=g;let v=l!==null&&Vo(l.resolved)===a;bt.save({v:Vn,ts:v?l.ts:Date.now(),region:s,resolved:o,src:f})},void 0)}var Ho=!1;function DA(){Ho=!1}var Fl=typeof $.API_BASE_URL=="string"?$.API_BASE_URL.trim():"";function qp(n,e){return c(()=>{var a,l;let t={...n},i=[],r=ds(n);i.push(...r.notices),r.organisation_name!==void 0&&(t.organisation_name=r.organisation_name),r.publication_name!==void 0&&(t.publication_name=r.publication_name),n.publication_id===void 0&&typeof t.publication_name=="string"&&t.publication_name.trim()!==""&&(t.publication_id=t.publication_name),(typeof n.api_base_url=="string"?n.api_base_url.trim():"")===""&&Fl!==""&&(t.api_base_url=Fl),$p(t.api_base_url,i);let s=t.customEvents?{...t.customEvents}:{};if(!e){let u=(l=(a=t.preset)!=null?a:s.preset)!=null?l:"naviga-relay",f=Pr(u);if(f.length>0){let g=Array.isArray(s.bindings)?s.bindings:[];s.bindings=[...g,...f]}s.commonDetailsMapping===void 0&&(s.commonDetailsMapping={variableName:"navigaEngageDetails"})}return s.linkerHosts===void 0&&(s.linkerHosts=[".subscriberconcierge.com"]),t.customEvents=s,{config:t,notices:i}},{config:n,notices:[]})}var dt=!1,Bl=!1;function Vl(n){let e=n==null?void 0:n.customEvents,t=[n==null?void 0:n.preset,e==null?void 0:e.preset];if(t.some($n)||(e==null?void 0:e.enabled)===!1)return!0;
1if(t.some(i=>typeof i=="string"&&i.trim()!=="")||(e==null?void 0:e.enabled)===!0)return!1}function Wp(n,e){var t;return(t=Vl(n))!=null?t:dt||Vl(e)===!0}function $p(n,e){c(()=>{if(typeof n!="string"||n.trim()==="")return;let t=null;try{t=new URL(n)}catch{t=null}if(!t){e.push(`[Analytics] api_base_url '${n}' is not an absolute URL \u2014 every request the SDK makes will fail. Expected e.g. 'https://ingest.example.com'.`);return}t.protocol!=="https:"&&e.push(`[Analytics] api_base_url '${n}' is not https. Using it as given (http is expected for local development), but production traffic should be https.`)},void 0)}var ut={init:n=>{E(()=>{let e=zs(n.initOptions);dt=Wp(n.initOptions,e);let t=qp(e,dt);d.set(t.config),t.notices.forEach(r=>{});let i=e.pageLeaveTracking||e.pageLeaveConfig;if(i&&d.setPageLeaveConfig(i),e.heartbeatConfig&&d.setHeartbeatConfig(e.heartbeatConfig),e.abTesting&&d.setABConfig(e.abTesting),e.contentReadiness&&d.setContentReadinessConfig(e.contentReadiness),e.linkStats&&d.setLinkStatsConfig(e.linkStats),e.eventQueue&&d.setEventQueueConfig(e.eventQueue),e.clickTracking&&d.setClickTrackingConfig(e.clickTracking),e.autoContext&&d.setAutoContextConfig(e.autoContext),e.spaNavigation&&d.setSpaNavigationConfig(e.spaNavigation),e.telemetry&&d.setTelemetryConfig(e.telemetry),n.initOptions.consent&&(d.setConsentConfig(n.initOptions.consent),d.getConsentConfig().enabled===!0)){Bo=!0;try{!Ml&&d.getConsentConfig().persist===!0&&(Ml=!0,Dl=bt.load()),Wi=new Un,S.register(Wi),Ll||(Ll=!0,S.onChange(a=>{if(Bo){$i=!0;return}$i=!1,Ol(a)}),Q&&window.addEventListener("storage",()=>{c(()=>{d.getConsentConfig().enabled===!0&&Kl(S.getState())},void 0)})),xl=new Fn,S.register(xl),d.getConsentConfig().persist===!0&&(Pl=new Bn(Dl),S.register(Pl))}finally{Bo=!1}S.refresh(),$i&&($i=!1,Ol(S.getState()));let r=S.getState();if(z.filter(a=>!Y(a)&&r[a]==="unknown").length>0&&S.hasAnySignal()){let a=S.getStampState()._region}let s=d.getConsentConfig().tcf;(s==null?void 0:s.enabled)===!0&&Promise.resolve().then(()=>(Tc(),kc)).then(a=>{Il=new a.TcfProvider({waitForCmpMs:s.waitForCmpMs,purposeMap:s.purposeMap,allowLegitimateInterest:s.allowLegitimateInterest,vendorId:s.vendorId}),S.register(Il)}).catch(a=>{})}e.articleDetailsMapping,e.userDetailsMapping,Ht.validate(e),Q&&e.preload!==!1&&setTimeout(()=>{Be.preload(),de.preload(),Rl.preload(),zp.preload(),qi.preload()},1e3),Q&&Promise.resolve().then(()=>(ti(),Qs)).then(r=>r.EventQueue.init()).catch(r=>{}),ut.initializeHeartbeatTracking(),ut.initializeABTesting(),ut.initializeContentReadiness(),ut.initializeCustomEventBindings(),ut.initializeCrossDomainLinker(),fr("init() completed")},{message:"Failed to initialize analytics",severity:"high",source:"Analytics.init"})},disableEvents:n=>{E(()=>{d.disable_set({DisableOption:n.DisableOption})},{message:"Failed to disable analytics",severity:"high",source:"Analytics.disableEvents"})},setConsent:n=>{E(()=>{Wi&&Wi.setConsent(n)},{message:"Failed to set consent",severity:"low",source:"Analytics.setConsent"})},revokeConsent:()=>{let n={};for(let e of z)Y(e)||(n[e]="denied");ut.setConsent(n)},getConsent:()=>c(()=>({...S.getState(),_gated:d.getConsentConfig().enabled===!0}),{_gated:!1}),onConsentChange:n=>c(()=>S.onChange(n),()=>{}),track:(n,e={})=>{Q&&(typeof n!="string"||n.trim()===""||Hl(n,{...e||{}}))},identify:(n,e={})=>{if(!Q||typeof n!="string"||n.trim()==="")return;c(()=>se.hold(n,e||{}),void 0);let t={...e||{}};jn((i,r)=>Yp(r),()=>se.getUserId()===n)("identify",t)},reset:()=>{c(()=>se.clear(),void 0)},setPageClass:n=>{c(()=>J.setPageClass(n),void 0)},setContentAccess:n=>{c(()=>Ee.set(n),void 0)},getConfig:()=>c(()=>d.get(),{organisation_name:"",publication_name:"",publication_id:"",api_base_url:"",api_key:""}),trackPageView:()=>{if(!Q)return;let n=()=>{b(async()=>{let e=await Rl.get();if(!e.success)throw new Error("Failed to load PageViewTracker module");return await e.value.PageViewTracker.track()},{message:"Failed to track page view",severity:"medium",source:"Analytics.trackPageView"})};document.readyState==="complete"?n():window.addEventListener("load",n)},initializeLeavePageTracking:()=>{Q&&E(()=>{let n=d.getPageLeaveConfig();Promise.resolve().then(()=>(xc(),Rc)).then(e=>{e.PageLeaveCoordinator.initialize({hiddenPageTimeout:n.hiddenPageTimeout,enableSPATracking:n.enableSPATracking,enableVisibilityTracking:n.enableVisibilityTracking,trackHashChanges:n.trackHashChanges})}).catch(e=>{})},{message:"Failed to initialize page leave tracking",severity:"medium",s
1ource:"Analytics.initializeLeavePageTracking"})},initializeHeartbeatTracking:()=>{Q&&E(()=>{let n=d.getHeartbeatConfig();Promise.resolve().then(()=>(Nc(),Mc)).then(e=>{e.HeartbeatPingCoordinator.initialize({enabled:n.enabled,pingIntervalSeconds:n.ping_interval_seconds,sendOnVisibilityChange:n.send_on_visibility_change,minActiveTimeForVisibilityPing:n.min_active_time_for_visibility_ping,visibilityDebounceMs:n.visibility_debounce_ms,enableSPATracking:n.enable_spa_tracking,pingDecaySchedule:(n.ping_decay_schedule||[]).map(t=>({afterSeconds:t.after_seconds,intervalSeconds:t.interval_seconds})),pingSamplingRate:n.ping_sampling_rate}),n.enabled&&e.HeartbeatPingCoordinator.start()}).catch(e=>{})},{message:"Failed to initialize heartbeat tracking",severity:"medium",source:"Analytics.initializeHeartbeatTracking"})},trackClickEvents:()=>{if(!Q)return;let n=()=>{Ho||(Ho=!0,document.addEventListener("click",e=>{let t=e.target;if(!t||e.button===1)return;let i={button:e.button,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey};b(async()=>{let r=await qi.get();if(!r.success)throw new Error("Failed to load ClickTracker module");return await r.value.ClickTracker.trackClick(t,!1,i)},{message:"Failed to handle click event",severity:"low",source:"Analytics.handleClick"})}),document.addEventListener("auxclick",e=>{let t=e.target;if(!t||e.button!==1)return;let i={button:e.button,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey};b(async()=>{let r=await qi.get();if(!r.success)throw new Error("Failed to load ClickTracker module");return await r.value.ClickTracker.trackClick(t,!1,i)},{message:"Failed to handle middle-click event",severity:"low",source:"Analytics.handleMiddleClick"})}),document.addEventListener("contextmenu",e=>{let t=e.target;t&&b(async()=>{let i=await qi.get();if(!i.success)throw new Error("Failed to load ClickTracker module");return await i.value.ClickTracker.trackClick(t,!0)},{message:"Failed to handle right-click event",severity:"low",source:"Analytics.handleRightClick"})}))};document.readyState==="complete"?n():window.addEventListener("load",n)},initializeABTesting:()=>{Q&&d.getABConfig().enabled&&E(()=>{Promise.resolve().then(()=>(fl(),dl)).then(n=>n.ABTesting.start()).catch(n=>{})},{message:"Failed to initialize A/B testing",severity:"low",source:"Analytics.initializeABTesting"})},initializeContentReadiness:()=>{Q&&d.getContentReadinessConfig().enabled&&E(()=>{let n=d.getContentReadinessConfig();Promise.resolve().then(()=>(wl(),El)).then(e=>e.ContentReadinessAuditor.initialize(n)).catch(e=>{})},{message:"Failed to initialize content readiness auditor",severity:"low",source:"Analytics.initializeContentReadiness"})},initializeCustomEventBindings:()=>{Q&&E(()=>{let n=d.getCustomEventBindings(),e=dt&&!Bl;Bl=dt,(e||n&&n.length>0)&&Promise.resolve().then(()=>(No(),Mo)).then(t=>{e&&t.CustomEventTracker.unbindBindings(Bs()),t.CustomEventTracker.initBindings(Hl)}).catch(t=>{})},{message:"Failed to initialize custom event bindings",severity:"low",source:"Analytics.initializeCustomEventBindings"})},initializeCrossDomainLinker:()=>{Q&&E(()=>{d.getCrossDomainLinkerHosts().length!==0&&Promise.resolve().then(()=>(Fo(),Uo)).then(n=>n.CrossDomainLinker.install()).catch(n=>{})},{message:"Failed to initialize cross-domain linker",severity:"low",source:"Analytics.initializeCrossDomainLinker"})},getErrorLogs:()=>c(()=>K.getErrors(),[]),clearErrorLogs:()=>{c(()=>K.clearErrors(),void 0)}},Lt=fs(ut);function zl(n,e){typeof n!="string"||n.trim()===""||b(async()=>{let[{EventFactory:t},{EventSender:i},{CustomEventPayload:r}]=await Promise.all([Promise.resolve().then(()=>(pe(),en)),Promise.resolve().then(()=>(Pe(),Zt)),Promise.resolve().then(()=>(zi(),Do))]),o=r.withCommonProperties(e||{}),s=await t.createEvent(n.trim(),o,{skipArticleContext:!0});if(!s.success)throw new Error(`Failed to create custom event ${n}`);if(s.value===null)return!1;let a=r.stripArticleFields(s.value);return await i.send(r.applyExclusions(a)),!0},{message:`Failed to track custom event ${n}`,severity:"low",source:"Analytics.track"})}function Yp(n){b(async()=>{let[{EventFactory:e},{EventSender:t},{CustomEventPayload:i}]=await Promise.all([Promise.resolve().then(()=>
1(pe(),en)),Promise.resolve().then(()=>(Pe(),Zt)),Promise.resolve().then(()=>(zi(),Do))]),r=await e.createEvent("identify",n||{},{skipArticleContext:!0});if(!r.success)throw new Error("Failed to create identify event");return r.value===null?!1:(await t.send(i.stripArticleFields(r.value)),!0)},{message:"Failed to identify user",severity:"low",source:"Analytics.identify"})}var Hl=jn(zl),Qp=jn(zl,()=>!dt);function Xp(){Ir()&&Lt.init({name:Hs,initOptions:{}})}Q&&Zo()&&(E(()=>{Ks()},{message:"Failed to read data-* configuration from the script tag",severity:"low",source:"Analytics.captureScriptData"}),E(()=>{var i;let n=(i=Ir())==null?void 0:i.preset;if($n(n))return;let t=Pr(n||"naviga-relay");t.length!==0&&Promise.resolve().then(()=>(No(),Mo)).then(r=>{dt||r.CustomEventTracker.initBindings(Qp,t)}).catch(r=>{})},{message:"Failed to register default custom event bindings",severity:"low",source:"Analytics.presetBindings"}),E(()=>{typeof document!="undefined"&&Promise.resolve().then(()=>(Fo(),Uo)).then(n=>n.CrossDomainLinker.install()).catch(n=>{})},{message:"Failed to pre-install cross-domain linker",severity:"low",source:"Analytics.preInstallLinker"}),E(()=>{Promise.resolve().then(()=>(Tl(),kl)).then(n=>{n.CacheInvalidationManager.initialize()}).catch(n=>{})},{message:"Failed to initialize cache invalidation",severity:"low",source:"Analytics.initCacheInvalidation"}),E(()=>{wn(()=>{Lt.trackPageView(),Lt.initializeLeavePageTracking(),Lt.trackClickEvents()}),es(ur,Xp)},{message:"Failed to initialize automatic tracking",severity:"medium",source:"Analytics.autoInit"}),E(()=>{window.NavigaAnalytics=Lt,Lt.NavigaRelayPreset=Wn},{message:"Failed to expose Analytics globally",severity:"low",source:"global.expose"}));})();
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.