1var e,t;!function(){var e=window.sophi&&window.sophi.demeter;if(e){var t=function(e,t){try{var n=e[t];return"string"==typeof n?n:""}catch(e){return""}},n=function(e,t,n){try{e[t]=n}catch(e){}},r=t(window,"sophiInitStatus")||t(e,"initStatus"),i=function(e,t){try{var n=Object.getOwnPropertyDescriptor(e,t);if(n&&!n.configurable)return;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return r},set:function(e){r="string"==typeof e?e:""}})}catch(e){}};i(window,"sophiInitStatus"),i(e,"initStatus"),n(window,"sophiInitStatus",r),n(e,"initStatus",r);var o=String(Math.floor(performance.now()/10)/100).replace(/^0\./,".");r=(r?r+",":"")+"x"+o,n(window,"sophiInitStatus",r),n(e,"initStatus",r)}}(),(e=>{const t=1e4;let n;const r={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function i(e){return e||n?{lang:e?.lang??void 0,message:e?.message,abortEarly:e?.abortEarly??void 0,abortPipeEarly:e?.abortPipeEarly??void 0}:r}function o(e){const t=typeof e;return"string"===t?`"${e}"`:"number"===t||"bigint"===t||"boolean"===t?`${e}`:"object"===t||"function"===t?(e&&Object.getPrototypeOf(e)?.constructor?.name)??"null":t}function s(e,t,n,r,i){const s=i&&"input"in i?i.input:n.value,a=i?.expected??e.expects??null,l=i?.received??o(s),c={kind:e.kind,type:e.type,input:s,expected:a,received:l,message:`Invalid ${t}: ${a?`Expected ${a} but r`:"R"}eceived ${l}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},u="schema"===e.kind,p=i?.message??e.message??(e.reference,void c.lang)??(u?void c.lang:null)??r.message??void c.lang;void 0!==p&&(c.message="function"==typeof p?p(c):p),u&&(n.typed=!1),n.issues?n.issues.push(c):n.issues=[c]}const a=new WeakMap;function l(e){let t=a.get(e);return t||(t={version:1,vendor:"valibot",validate:t=>e["~run"]({value:t},i())},a.set(e,t)),t}function c(e,t){const n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??"never"}var u=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}};function p(e,t){return{kind:"validation",type:"regex",reference:p,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&s(this,"format",e,t),e}}}function d(e){return{kind:"transformation",type:"transform",reference:d,async:!1,operation:e,"~run"(e){return e.value=this.operation(e.value),e}}}function y(e,t,n){return"function"==typeof e.fallback?e.fallback(t,n):e.fallback}function f(e,t,n){return"function"==typeof e.default?e.default(t,n):e.default}function h(e,t){return{kind:"schema",type:"array",reference:h,expects:"Array",async:!1,item:e,message:t,get"~standard"(){return l(this)},"~run"(e,t){const n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<n.length;r++){const i=n[r],o=this.item["~run"]({value:i},t);if(o.issues){const s={type:"array",origin:"value",input:n,key:r,value:i};for(const t of o.issues)t.path?t.path.unshift(s):t.path=[s],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}}else s(this,"type",e,t);return e}}}function m(e){return{kind:"schema",type:"boolean",reference:m,expects:"boolean",async:!1,message:e,get"~standard"(){return l(this)},"~run"(e,t){return"boolean"==typeof e.value?e.typed=!0:s(this,"type",e,t),e}}}function g(e,t){return{kind:"schema",type:"custom",reference:g,expects:"unknown",async:!1,check:e,message:t,get"~standard"(){return l(this)},"~run"(e,t){return this.check(e.value)?e.typed=!0:s(this,"type",e,t),e}}}function w(e,t){return{kind:"schema",type:"literal",reference:w,expects:o(e),async:!1,literal:e,message:t,get"~standard"(){return l(this)},"~run"(e,t){return e.value===this.literal?e.typed=!0:s(this,"type",e,t),e}}}function v(e){return{kind:"schema",type:"number",reference:v,expects:"number",async:!1,message:e,get"~standard"(){return l(this)},"~run"(e,t){return"number"!=typeof e.value||isNaN(e.value)?s(this,"type",e,t):e.typed=!0,e}}}function b(e,t){return{kind:"schema",type:"object",reference:b,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return l(this)},"~run"(e,t){const n=e.value;if(n&&"object"==typeof n){e.typed=!0,e.value={};for(const r in this.entries){const i=this.entries[r];if(r in n||("exact_optional"===i.type||"optional"===i.type||"nullish"===i.type)&&void 0!==i.default){const o=r in n?n[r]:f(i),s=i["~run"]({value:o},t);
1if(s.issues){const i={type:"object",origin:"value",input:n,key:r,value:o};for(const t of s.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[r]=s.value}else if(void 0!==i.fallback)e.value[r]=y(i);else if("exact_optional"!==i.type&&"optional"!==i.type&&"nullish"!==i.type&&(s(this,"key",e,t,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:n,key:r,value:n[r]}]}),t.abortEarly))break}}else s(this,"type",e,t);return e}}}function A(e,t){return{kind:"schema",type:"optional",reference:A,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return l(this)},"~run"(e,t){return void 0===e.value&&(void 0!==this.default&&(e.value=f(this,e,t)),void 0===e.value)?(e.typed=!0,e):this.wrapped["~run"](e,t)}}}function k(e,t){return{kind:"schema",type:"strict_object",reference:k,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return l(this)},"~run"(e,t){const n=e.value;if(n&&"object"==typeof n){e.typed=!0,e.value={};for(const r in this.entries){const i=this.entries[r];if(r in n||("exact_optional"===i.type||"optional"===i.type||"nullish"===i.type)&&void 0!==i.default){const o=r in n?n[r]:f(i),s=i["~run"]({value:o},t);if(s.issues){const i={type:"object",origin:"value",input:n,key:r,value:o};for(const t of s.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[r]=s.value}else if(void 0!==i.fallback)e.value[r]=y(i);else if("exact_optional"!==i.type&&"optional"!==i.type&&"nullish"!==i.type&&(s(this,"key",e,t,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:n,key:r,value:n[r]}]}),t.abortEarly))break}if(!e.issues||!t.abortEarly)for(const r in n)if(!(r in this.entries)){s(this,"key",e,t,{input:r,expected:"never",path:[{type:"object",origin:"key",input:n,key:r,value:n[r]}]});break}}else s(this,"type",e,t);return e}}}function P(e){return{kind:"schema",type:"string",reference:P,expects:"string",async:!1,message:e,get"~standard"(){return l(this)},"~run"(e,t){return"string"==typeof e.value?e.typed=!0:s(this,"type",e,t),e}}}function S(e){let t;if(e)for(const n of e)if(t)for(const e of n.issues)t.push(e);else t=n.issues;return t}function D(...e){return{...e[0],pipe:e,get"~standard"(){return l(this)},"~run"(t,n){for(const r of e)if("metadata"!==r.kind){if(t.issues&&("schema"===r.kind||"transformation"===r.kind)){t.typed=!1;break}t.issues&&(n.abortEarly||n.abortPipeEarly)||(t=r["~run"](t,n))}return t}}}var x={control:"control",variant:"variant",holdout:"holdout"},L={C:x.control,V:x.variant,H:x.holdout},E=/^.+_TEST\d-[CVH]$/,V=/[a-z:_-\d]*test(\d)_(a(?:a|b))$/;function _(e){return D(P(),"sdk"===e?g(e=>E.test(e)):p(E,"Invalid configuration: segment name is invalid"))}function C(e){return D(P(),p(V,"sdk"===e?e=>`Invalid configuration: "id" is required and must be a string ending in test1_ab or similar. Received: ${e}`:'Invalid configuration: "id" must be a string ending in test1_ab or similar'))}var T=function e(t,n){return{kind:"schema",type:"union",reference:e,expects:c(t.map(e=>e.expects),"|"),async:!1,options:t,message:n,get"~standard"(){return l(this)},"~run"(e,t){let n,r,i;for(const o of this.options){const s=o["~run"]({value:e.value},t);if(s.typed){if(!s.issues){n=s;break}r?r.push(s):r=[s]}else i?i.push(s):i=[s]}if(n)return n;if(r){if(1===r.length)return r[0];s(this,"type",e,t,{issues:S(r)}),e.typed=!0}else{if(1===i?.length)return i[0];s(this,"type",e,t,{issues:S(i)})}return e}}}([w("external"),w("internal")]);function $({profile:e,normalize:t}){const n=D(h(b({distributionPercent:v(),name:_(e)})),g(e=>{const t=e.reduce((e,t)=>e+t.distributionPercent,0);if(100!==t)throw new Error(`Invalid configuration: sum of distributionPercent must be 100. Received: ${t}`);return!0}),g(e=>{const t=e.map(e=>e.name);if(new Set(t).size!==t.length)throw new Error("Invalid configuration: segment names must be unique");return!0})),r=D(h(b({id:C(e),groups:n,type:T})),g(e=>{const t=e.map(e=>e.id);if(new Set(t).size!==t.length)throw new Error("Invalid configuration: experiment IDs must be unique");return!0}),g(e=>{const t={internal:0,external:0};for(const n of e)t[n.type]++;if(t.internal>1)throw new Error(`Invalid configuration: ${t.internal} internal tests found, only one is allowed`);if(t.external>1)throw new Error(`Invalid configuration: ${t.external} external tests found, only one is allowed`);return!0})),i=t?D(r,d(e=>(e.sort((e,t)=>
1"internal"===e.type&&"external"===t.type?-1:"external"===e.type&&"internal"===t.type?1:0),e))):r,o=b({id:b({name:P()})}),s=b({default:m()});return k({hostname:P(),experiments:i,cookies:t?A(o,{id:{name:"_ml_id"}}):A(o),consent:t?A(s,{default:!0}):A(s),subMarket:A(P())})}null&&$({profile:"bundler",normalize:!1});var B=$({profile:"sdk",normalize:!0});const j="sophi_abtest_config",O=e,W=new class{constructor(e){const t=function(e){return function(e,t,n){const r=e["~run"]({value:t},i(n));if(r.issues)throw new u(r.issues);return r.value}(B,e)}(e);this.cookies=t.cookies,this.hostname=t.hostname,this.experiments=t.experiments,this.baseConsent=t.consent}get consent(){const e=(()=>{if("undefined"==typeof sessionStorage)return null;const e=sessionStorage.getItem(j);if(null!==e)try{return JSON.parse(e)}catch(e){return null}return null})();return e?.consent??this.baseConsent}}(O),I=W,U=e=>e?(e^16*Math.random()>>e/4).toString(16):("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,U),R=(e,t)=>{try{localStorage?.setItem(e,t)}catch{}},M=e=>{try{return localStorage?.getItem(e)??null}catch{return null}},N=(e,t,n,r)=>{const i=[`${e}=${t}`,`expires=${n}`,`domain=.${r.hostname}`,"path=/","SameSite=None","Secure"].join(";");window.document.cookie=i},G=e=>{if(!document.cookie)return"";const t=document.cookie.split("; ").find(t=>0===t.indexOf(e));if(!t)return"";try{return decodeURIComponent(t.split("=")[1])}catch{return t.split("=")[1]}},q=e=>{const t=M(e)||G(e);return t&&"false"!==t?t:""},z=I.cookies.id.name,F=(e,n,r)=>((e,n,r)=>{const i=((e,n=t)=>{const r=e/2**32;return Math.floor(r*n)})(((e,t=1)=>function(e,t){var n,r,i,o,s,a,l,c;for(n=3&e.length,r=e.length-n,i=t,s=3432918353,a=461845907,c=0;c<r;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,i=(65535&(o=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+27492+(((o>>>16)+58964&65535)<<16);switch(l=0,n){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}(e,t))(`${n}-${r}`));return((e,t)=>{let n=null;return e.forEach(e=>{t>=e.range_start&&t<=e.range_end&&(n=e.id)}),n})(e,i)})((e=>{if(100!==e.map(e=>e.distributionPercent).reduce((e,t)=>e+t))throw new Error(`Total weight percentages must equal 100%`);let n=0;const r=[];return e.forEach(e=>{if(n==t)return;const i=n+e.distributionPercent*t/100,o={id:e.name,range_start:0===n?n:n+1,range_end:Math.min(i,t)};n=i,r.push(o)}),r})(e),n,r),Z="always-H",H="Sophi AB Test:",J={log:(...e)=>{console.log(H,...e)},warn:(...e)=>{console.warn(H,...e)},error:(...e)=>{console.error(H,...e)}},Y=J,K="sophi_abtest_group",X="sophi_abtest_id";window.sophi=window.sophi||{};let Q=I.consent.default;const ee=()=>{const e=(e=>{if(G(e))return q(e).split(".")[0];const t=new Date,n=new Date(t.setFullYear(t.getFullYear()+2)).toUTCString(),r=U(),i=Math.floor(t.getTime()/1e3);return((e,t,n,r)=>{R(e,t),N(e,t,n,r)})(e,[r,i,"0",i,i].join("."),n,I),r})(z),t=M("_matheriSegs")??"",n=t?t.split(",").filter(e=>E.test(e)):[],r=G("_matheriSegs"),i=(r?r.split(","):[]).filter(e=>e&&e!==Z&&!E.test(e)),o=[];for(const t of I.experiments){const r=t.groups.find(e=>n.includes(e.name));o.push(r?.name||F(t.groups,t.id,e))}const s=[...o.filter((e,t)=>"internal"===I.experiments[t].type),...o.filter((e,t)=>"external"===I.experiments[t].type)].join(","),a=((e,t)=>{let n=t;return e.some(e=>"external"===e.type)||(n+=`,${Z}`),n})(I.experiments,s),l=i.length?[...i,...a.split(",").filter(Boolean)].join(","):a;a!==t&&R("_matheriSegs",a),l!==r&&N("_matheriSegs",l,(()=>{const e=new Date;return e.setMonth(e.getMonth()+6),e.toUTCString()})(),I)},te=e=>{const t=e.charAt(e.length-1);return L[t]},ne=e=>{const t={...e};if(window.location.search){const n=new URLSearchParams(window.location.search);n.has(X)&&((e,t,n)=>{e?(t.experimentId=e.toLowerCase(),Y.log(`Test ID override. Original: ${n.experimentId}. Overridden by: ${e}.`)):Y.warn(`Invalid test ID override in URL parameter ${X}: ${e}`)})(n.get(X),t,e),n.has(K)&&((e,t,n)=>{e&&e.toLowerCase()in x?(t.assignedGroup=e,Y.log(`Test group override. Original: ${n.assignedGroup}. Overridden by: ${e}.`)):Y.warn(`Invalid test group override in URL parameter ${K}: ${e}`)})(n.get(K),t,e)}return t},re=function(){if(!Q)return[];const e=I.experiments,t=q("_matheriSegs").split(","),n=[];for(const r of e){const e=r.groups.find(e=>
1t.includes(e.name))?.name;if(!e)continue;const i=te(e),o={experimentId:r.id,assignedGroup:i,type:r.type};n.push(o)}return n};function ie(e="external"){return re().filter(t=>t.type===e).map(({type:e,...t})=>t).map("external"===e?ne:e=>e)}function oe(e){if(!Q)return;const t=re();let n="";if("string"!=typeof e)return;n=e.toLowerCase();const r=t.find(e=>e.experimentId.toLowerCase()===n);return void 0===r&&Y.warn(`Experiment ${e} not found`),r&&"external"===r.type?ne(r):r}if(Q)try{ee()}catch(t){Y.error("Error initializing storage:",t)}const se={getAllExperiments:async(e="external")=>ie(e),getAllExperimentsSync:(e="external")=>ie(e),getExperiment:async e=>oe(e),getExperimentSync:e=>oe(e),enableConsent:()=>{try{Q=!0,ee()}catch(e){Y.error("Error enabling consent:",e)}}};window.sophi.abTests=se,window.dispatchEvent(new Event("sophi.abTests:ready"))})(JSON.parse(/*__ABTEST_CONFIG__*/'{"hostname":"theglobeandmail.com","experiments":[{"id":"i:test3_ab","groups":[{"distributionPercent":50,"name":"INTERNAL_AB_TEST3-C"},{"distributionPercent":50,"name":"INTERNAL_AB_TEST3-V"},{"distributionPercent":0,"name":"INTERNAL_AB_TEST3-H"}],"type":"internal"}],"consent":{"default":true}}')),e=globalThis,t=()=>(()=>{var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};let n;e.d(t,{default:()=>Ya});const r={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function i(e){return e||n?{lang:e?.lang??void 0,message:e?.message,abortEarly:e?.abortEarly??void 0,abortPipeEarly:e?.abortPipeEarly??void 0}:r}function o(e){const t=typeof e;return"string"===t?`"${e}"`:"number"===t||"bigint"===t||"boolean"===t?`${e}`:"object"===t||"function"===t?(e&&Object.getPrototypeOf(e)?.constructor?.name)??"null":t}function s(e,t,n,r,i){const s=i&&"input"in i?i.input:n.value,a=i?.expected??e.expects??null,l=i?.received??o(s),c={kind:e.kind,type:e.type,input:s,expected:a,received:l,message:`Invalid ${t}: ${a?`Expected ${a} but r`:"R"}eceived ${l}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},u="schema"===e.kind,p=i?.message??e.message??(e.reference,void c.lang)??(u?void c.lang:null)??r.message??void c.lang;void 0!==p&&(c.message="function"==typeof p?p(c):p),u&&(n.typed=!1),n.issues?n.issues.push(c):n.issues=[c]}const a=new WeakMap;function l(e){let t=a.get(e);return t||(t={version:1,vendor:"valibot",validate:t=>e["~run"]({value:t},i())},a.set(e,t)),t}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&"__proto__"!==t&&"prototype"!==t&&"constructor"!==t}function u(e,t){const n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??"never"}function p(e){if(e.path){let t="";for(const n of e.path){if("string"!=typeof n.key&&"number"!=typeof n.key)return null;t+=t?`.${n.key}`:n.key}return t}return null}var d=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}};function y(e,t){return{kind:"validation",type:"check",reference:y,async:!1,expects:null,requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&s(this,"input",e,t),e}}}function f(e,t){return{kind:"validation",type:"min_length",reference:f,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length<this.requirement&&s(this,"length",e,t,{received:`${e.value.length}`}),e}}}function h(){return{kind:"transformation",type:"to_lower_case",reference:h,async:!1,"~run":e=>(e.value=e.value.toLowerCase(),e)}}function m(e){return{kind:"transformation",type:"transform",reference:m,async:!1,operation:e,"~run"(e){return e.value=this.operation(e.value),e}}}function g(){return{kind:"transformation",type:"trim",reference:g,async:!1,"~run":e=>(e.value=e.value.trim(),e)}}function w(e,t,n){return"function"==typeof e.fallback?e.fallback(t,n):e.fallback}function v(e,t,n){return"function"==typeof e.default?e.default(t,n):e.default}function b(){return{kind:"schema",type:"any",reference:b,expects:"any",async:!1,get"~standard"(){return l(this)},"~run":e=>(e.typed=!0,e)}}function A(e,t){return{kind:"schema",type:"array",reference:A,expects:"Array",async:!1,item:e,message:t,get"~standard"(){return l(this)},"~run"(e,t){const n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<n.length;r++){const i=n[r],o=this.item["~run"]({value:i},t);if(o.issues){const s={type:"array",origin:"value",input:n,key:r,value:i};for(const t of o.issues)t.path?t.path.unshift(s):t.path=[s],e.issues?.pu
1sh(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}}else s(this,"type",e,t);return e}}}function k(e){return{kind:"schema",type:"boolean",reference:k,expects:"boolean",async:!1,message:e,get"~standard"(){return l(this)},"~run"(e,t){return"boolean"==typeof e.value?e.typed=!0:s(this,"type",e,t),e}}}function P(e,t){return{kind:"schema",type:"custom",reference:P,expects:"unknown",async:!1,check:e,message:t,get"~standard"(){return l(this)},"~run"(e,t){return this.check(e.value)?e.typed=!0:s(this,"type",e,t),e}}}function S(e){return{kind:"schema",type:"date",reference:S,expects:"Date",async:!1,message:e,get"~standard"(){return l(this)},"~run"(e,t){return e.value instanceof Date?isNaN(e.value)?s(this,"type",e,t,{received:'"Invalid Date"'}):e.typed=!0:s(this,"type",e,t),e}}}function D(e,t){if(typeof e==typeof t){if(e===t||e instanceof Date&&t instanceof Date&&+e===+t)return{value:e};if(e&&t&&e.constructor===Object&&t.constructor===Object){const n={...e};for(const r in t)if(Object.prototype.hasOwnProperty.call(e,r)){const i=D(e[r],t[r]);if(i.issue)return i;n[r]=i.value}else n[r]=t[r];return{value:n}}if(Array.isArray(e)&&Array.isArray(t)&&e.length===t.length){const n=[...e];for(let r=0;r<e.length;r++){const i=D(e[r],t[r]);if(i.issue)return i;n[r]=i.value}return{value:n}}}return{issue:!0}}function x(e,t){return{kind:"schema",type:"intersect",reference:x,expects:u(e.map(e=>e.expects),"&"),async:!1,options:e,message:t,get"~standard"(){return l(this)},"~run"(e,t){if(this.options.length){const n=e.value;let r;e.typed=!0;for(const i of this.options){const o=i["~run"]({value:n},t);if(o.issues){if(e.issues)for(const t of o.issues)e.issues.push(t);else e.issues=o.issues;if(t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.typed&&(r?r.push(o.value):r=[o.value])}if(e.typed){e.value=r[0];for(let n=1;n<r.length;n++){const i=D(e.value,r[n]);if(i.issue){s(this,"type",e,t,{received:"unknown"});break}e.value=i.value}}}else s(this,"type",e,t);return e}}}function L(e,t){return{kind:"schema",type:"literal",reference:L,expects:o(e),async:!1,literal:e,message:t,get"~standard"(){return l(this)},"~run"(e,t){return e.value===this.literal?e.typed=!0:s(this,"type",e,t),e}}}function E(e,t){return{kind:"schema",type:"non_optional",reference:E,expects:"!undefined",async:!1,wrapped:e,message:t,get"~standard"(){return l(this)},"~run"(e,t){return void 0!==e.value&&(e=this.wrapped["~run"](e,t)),void 0===e.value&&s(this,"type",e,t),e}}}function V(e){return{kind:"schema",type:"null",reference:V,expects:"null",async:!1,message:e,get"~standard"(){return l(this)},"~run"(e,t){return null===e.value?e.typed=!0:s(this,"type",e,t),e}}}function _(e){return{kind:"schema",type:"number",reference:_,expects:"number",async:!1,message:e,get"~standard"(){return l(this)},"~run"(e,t){return"number"!=typeof e.value||isNaN(e.value)?s(this,"type",e,t):e.typed=!0,e}}}function C(e,t){return{kind:"schema",type:"object",reference:C,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return l(this)},"~run"(e,t){const n=e.value;if(n&&"object"==typeof n){e.typed=!0,e.value={};for(const r in this.entries){const i=this.entries[r];if(r in n||("exact_optional"===i.type||"optional"===i.type||"nullish"===i.type)&&void 0!==i.default){const o=r in n?n[r]:v(i),s=i["~run"]({value:o},t);if(s.issues){const i={type:"object",origin:"value",input:n,key:r,value:o};for(const t of s.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[r]=s.value}else if(void 0!==i.fallback)e.value[r]=w(i);else if("exact_optional"!==i.type&&"optional"!==i.type&&"nullish"!==i.type&&(s(this,"key",e,t,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:n,key:r,value:n[r]}]}),t.abortEarly))break}}else s(this,"type",e,t);return e}}}function T(e,t){return{kind:"schema",type:"optional",reference:T,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return l(this)},"~run"(e,t){return void 0===e.value&&(void 0!==this.default&&(e.value=v(this,e,t)),void 0===e.value)?(e.typed=!0,e):this.wrapped["~run"](e,t)}}}function $(e,t){return{kind:"schema",type:"picklist",reference:$,expects:u(e.map(o),"|"),async:!1,options:e,message:t,get"~standard"(){return l(this)},"~run"(e,t){return this.options.includes(e.value)?e.typed=!0:s(this,"type",e,t),e}}}function B(e,t,n){return{kind:"schema",type:"record",reference:B,expects:"Object",async:!1,key:e,value:t,message:n,get"~standard"(){return l(this)},"~run"(e,t){const n=e.value;if(n&&"object"==typeof n){e.typed=!0,e.value={};for(const r in n)if(c(n,r)){const i=n[r],o=this.key["~run"]({value:r},t);
1if(o.issues){const s={type:"object",origin:"key",input:n,key:r,value:i};for(const t of o.issues)t.path=[s],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}const s=this.value["~run"]({value:i},t);if(s.issues){const o={type:"object",origin:"value",input:n,key:r,value:i};for(const t of s.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}o.typed&&s.typed||(e.typed=!1),o.typed&&(e.value[o.value]=s.value)}}else s(this,"type",e,t);return e}}}function j(e,t){return{kind:"schema",type:"strict_object",reference:j,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return l(this)},"~run"(e,t){const n=e.value;if(n&&"object"==typeof n){e.typed=!0,e.value={};for(const r in this.entries){const i=this.entries[r];if(r in n||("exact_optional"===i.type||"optional"===i.type||"nullish"===i.type)&&void 0!==i.default){const o=r in n?n[r]:v(i),s=i["~run"]({value:o},t);if(s.issues){const i={type:"object",origin:"value",input:n,key:r,value:o};for(const t of s.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[r]=s.value}else if(void 0!==i.fallback)e.value[r]=w(i);else if("exact_optional"!==i.type&&"optional"!==i.type&&"nullish"!==i.type&&(s(this,"key",e,t,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:n,key:r,value:n[r]}]}),t.abortEarly))break}if(!e.issues||!t.abortEarly)for(const r in n)if(!(r in this.entries)){s(this,"key",e,t,{input:r,expected:"never",path:[{type:"object",origin:"key",input:n,key:r,value:n[r]}]});break}}else s(this,"type",e,t);return e}}}function O(e){return{kind:"schema",type:"string",reference:O,expects:"string",async:!1,message:e,get"~standard"(){return l(this)},"~run"(e,t){return"string"==typeof e.value?e.typed=!0:s(this,"type",e,t),e}}}function W(e){let t;if(e)for(const n of e)if(t)for(const e of n.issues)t.push(e);else t=n.issues;return t}function I(e,t){return{kind:"schema",type:"union",reference:I,expects:u(e.map(e=>e.expects),"|"),async:!1,options:e,message:t,get"~standard"(){return l(this)},"~run"(e,t){let n,r,i;for(const o of this.options){const s=o["~run"]({value:e.value},t);if(s.typed){if(!s.issues){n=s;break}r?r.push(s):r=[s]}else i?i.push(s):i=[s]}if(n)return n;if(r){if(1===r.length)return r[0];s(this,"type",e,t,{issues:W(r)}),e.typed=!0}else{if(1===i?.length)return i[0];s(this,"type",e,t,{issues:W(i)})}return e}}}function U(e,t,n){const r=e["~run"]({value:t},i(n));if(r.issues)throw new d(r.issues);return r.value}function R(...e){return{...e[0],pipe:e,get"~standard"(){return l(this)},"~run"(t,n){for(const r of e)if("metadata"!==r.kind){if(t.issues&&("schema"===r.kind||"transformation"===r.kind)){t.typed=!1;break}t.issues&&(n.abortEarly||n.abortPipeEarly)||(t=r["~run"](t,n))}return t}}}const M={any:b,array:A,boolean:k,check:y,custom:P,exactOptional:function e(t,n){return{kind:"schema",type:"exact_optional",reference:e,expects:t.expects,async:!1,wrapped:t,default:n,get"~standard"(){return l(this)},"~run"(e,t){return this.wrapped["~run"](e,t)}}},flatten:function(e){const t={};for(const n of e)if(n.path){const e=p(n);e?(t.nested||(t.nested={}),Object.prototype.hasOwnProperty.call(t.nested,e)?t.nested[e].push(n.message):t.nested[e]=[n.message]):t.other?t.other.push(n.message):t.other=[n.message]}else t.root?t.root.push(n.message):t.root=[n.message];return t},intersect:x,literal:L,maxValue:function e(t,n){return{kind:"validation",type:"max_value",reference:e,async:!1,expects:`<=${t instanceof Date?t.toJSON():o(t)}`,requirement:t,message:n,"~run"(e,t){return!e.typed||e.value<=this.requirement||s(this,"value",e,t,{received:e.value instanceof Date?e.value.toJSON():o(e.value)}),e}}},message:function(e,t){return{...e,get"~standard"(){return l(this)},"~run":(n,r)=>e["~run"](n,{...r,message:t})}},minLength:f,minValue:function e(t,n){return{kind:"validation",type:"min_value",reference:e,async:!1,expects:`>=${t instanceof Date?t.toJSON():o(t)}`,requirement:t,message:n,"~run"(e,t){return!e.typed||e.value>=this.requirement||s(this,"value",e,t,{received:e.value instanceof Date?e.value.toJSON():o(e.value)}),e}}},null_:V,number:_,object:C,optional:T,parse:U,partial:function(e,t){const n={};for(const r in e.entries)n[r]=!t||t.includes(r)?T(e.entries[r]):e.entries[r];return{...e,entries:n,get"~standard"(){return l(this)}}},picklist:$,pipe:R,record:B,required:function(e,t,n){const r=Array.isArray(t)?t:void 0,i=Array.isArray(t)?n:t,o={};for(const t in e.entries)o[t]=!r||r.includes(t)?E(e.entries[t],i):e.entries[t];return{...e,entries:o,get"~standard"(){return l(this)}}},safeParse:function(e,t,n){const r=e["~run"]({value:t},i(n));return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}},strictObject:j,string:O,transform:m,toLowerCase:h,trim:g,tuple:function e(t,n){return{kind:"schema",type:"tuple",reference:e,expects:"Array",async:!1,items:t,message:n,get"~standard"(){return l(this)},"~run"(e,t){const n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<this.items.length;r++){const i=n[r],o=this.items[r]["~run"]({value:i},t);if(o.issues){const s={type:"array",origin:"value",input:n,key:r,value:i};for(const t of o.issues)t.path?t.path.unshift(s):t.path=[s],e.issues?.pu
1sh(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}}else s(this,"type",e,t);return e}}},union:I,unwrap:function(e){return e.wrapped},url:function e(t){return{kind:"validation",type:"url",reference:e,async:!1,expects:null,requirement(e){try{return new URL(e),!0}catch{return!1}},message:t,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&s(this,"URL",e,t),e}}},ValiError:d,value:function e(t,n){return{kind:"validation",type:"value",reference:e,async:!1,expects:t instanceof Date?t.toJSON():o(t),requirement:t,message:n,"~run"(e,t){return!e.typed||this.requirement<=e.value&&this.requirement>=e.value||s(this,"value",e,t,{received:e.value instanceof Date?e.value.toJSON():o(e.value)}),e}}}},N=C({assignedGroup:$(["control","variant","holdout"]),experimentId:O()}),G={PAYWALL:"paywall",REGWALL:"regwall"},q="always",z="never",F="anonymous",Z="registered",H="subscribed",J=M.union([M.literal(F),M.literal(Z),M.literal(H)]),Y=M.picklist([G.REGWALL,G.PAYWALL]),K=M.picklist([q,z]),X={nowall:0,paywall:1,regwall:2},Q={always:1,never:0},ee={regwall:"b",paywall:"d",finalEnsemble:"z",onDevicePolicy:"v",contentPropensityTier:"q",userPropensityTier:"s"},te=M.object({wallVisibility:K,wallType:Y}),ne=M.object({...te.entries,score:M.number(),threshold:M.pipe(M.number(),M.minValue(0),M.maxValue(1))}),re=M.array(ne),ie=M.object({wallVisibility:M.literal(q),wallType:Y,outcomes:re}),oe=M.object({wallVisibility:M.literal(z),outcomes:re}),se=(M.union([ie,oe]),M.record(M.string(),M.union([M.string(),M.number(),M.boolean()]))),ae=M.optional(se),le=M.object({wallType:M.literal(G.REGWALL),wallTypeCode:M.literal(X.regwall),wallVisibility:M.literal(q),wallVisibilityCode:M.literal(Q.always),wallProperties:ae}),ce=M.object({wallType:M.literal(G.PAYWALL),wallTypeCode:M.literal(X.paywall),wallVisibility:M.literal(q),wallVisibilityCode:M.literal(Q.always),wallProperties:ae}),ue=M.object({wallVisibility:M.literal(z),wallVisibilityCode:M.literal(Q.never),wallProperties:ae}),pe=M.union([le,ce,ue]),de=M.object({id:M.string(),createdAt:M.string(),trace:M.string(),context:M.string(),inputs:M.string(),outcome:pe,searchParams:M.string(),userProperties:M.string(),wallProperties:M.optional(M.string()),paywallScore:M.optional(M.pipe(M.number(),M.minValue(0),M.maxValue(100))),contentProperties:M.optional(M.string(),""),experiment:M.union([M.null_(),N])}),ye=M.partial(M.object({id:M.string(),createdAt:M.string(),context:M.string(),trace:M.string(),inputs:M.string(),outcome:M.union([M.partial(le),M.partial(ce),M.partial(ue)]),searchParams:M.string(),userProperties:M.string(),wallProperties:M.string(),paywallScore:M.optional(M.pipe(M.number(),M.minValue(0),M.maxValue(100))),contentProperties:M.optional(M.string(),""),experiment:M.union([M.null_(),N])}));function fe(e){return function(e){const t=(new TextEncoder).encode(e);let n="";for(const e of t)n+=String.fromCharCode(e);return btoa(n)}(JSON.stringify(e))}function he(e){return JSON.parse(function(e){const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)n[e]=t.charCodeAt(e);return(new TextDecoder).decode(n)}(e))}const me=new class{constructor(){this.key="demeter"}get(){try{const e=sessionStorage.getItem(this.key);return null===e?e:he(e)}catch(e){return null}}set(e){try{return sessionStorage.setItem(this.key,fe(e))}catch(e){}}},ge=me,we="sophi_log_level",ve=M.union([M.literal("warn"),M.literal("info"),M.literal("debug")]),be=M.partial(M.object({logLevel:M.optional(ve),override:M.optional(ye)}));function Ae(e){ge.set({...ge.get()||{},logLevel:e})}const ke=new class{constructor(e={}){this.logLevel=e.logLevel||function(){const e=new URL(window.location.href).searchParams.get(we);if(e){const t=M.safeParse(ve,e);return t.success?(Ae(e),t.output):(De.warn(`Unknown log level found in URL: ${e}`),null)}return null}()||function(){const e=ge.get();if(e)return M.safeParse(ve,e.logLevel).success?e.logLevel:null}()||"warn",this.config=this.config.bind(this)}config(e){M.parse(be,e),e.logLevel&&(this.logLevel=e.logLevel,Ae(e.logLevel)),e.override&&(this.override=e.override),De.info("âï¸ Runtime config",JSON.stringify(e,null,2))}},Pe={error:0,warn:1,info:2,debug:3},Se=new class{constructor(){this.prefix="QuickStart:"}error(...e){console.log(this.prefix,"ð´",...e)}warn(...e){console.log(this.prefix,"ð ",...e)}info(...e){Pe[ke.logLevel]>=Pe.info&&console.log(this.prefix,...e)}debug(...e){Pe[ke.logLevel]>=Pe.debug&&console.log(this.prefix,"ð§",...e)}},De=Se,xe=document.currentScript,Le="script#sophi-loader";function Ee(e){const t=function(){const e=xe||document.querySelector(Le);if(!e)return De.debug("Loader script element not found"),null;const t=e.getAttribute("src");if(!t)return De.debug("Loader script has no src attribute"),null;try{return new URL(t,document.baseURI).searchParams}catch(e){return De.debug("Unable to parse loader script src URL",e),null}}();return t?t.get(e):null}var Ve="content.age",_e="content.ageInHours",Ce="content.section",Te="content.accessCategory",$e=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"],Be=$([...$e,"countryCode"]),je=$([...$e,"content.id",Ve,_e,Ce,Te]),Oe=I([O(),_(),k()]),We=(B(je,Oe),{gtmDataLayer:{dataLayerName:"dataLayer",listenToPast:!0}}),Ie=C({name:L("userProperties"),key:Be,path:R(O(),f(1))}),Ue=C({name:R(O(),f(1)),actions:A(Ie)}),Re=C({dataLayerName:T(O(),We.gtmDataLayer.dataLayerName),events:A(Ue),listenToPast:T(k(),We.gtmDataLayer.listenToPast)}),Me=C({gtmDataLayer:T(Re)}),Ne=e=>"enum"===e.type&&e.options||[],Ge=(e,t)=>
1"string"===t.type||"number"===t.type||"boolean"===t.type?typeof e===t.type:Ne(t).some(t=>Object.is(t,e)),qe=["content.id","visitor.type","modelTrace","experiment.id","experiment.assignedGroup"],ze=new Set(qe),Fe=31536e3,Ze={isEnabled:!0,name:"sophi_demeter",maxAge:Fe,includeOutcome:!1},He={isEnabled:!1},Je=2e3,Ye="https://paywall.sophi.io",Ke={},Xe={maxLength:12},Qe=!0,et={enabled:!1,key:"demeter_tracing"},tt={visitorType:!1,contentPropensityLevel:!1},nt=I([R(O(),g(),h(),y(e=>{if(0===e.length||e.startsWith(".")||e.endsWith(".")||e.includes("..")||e.includes(":"))return!1;try{return new URL("http://"+e).hostname===e}catch{return!1}},"Invalid hostname"))]),rt=R(O(),y(e=>{try{return new RegExp(e),!0}catch{return!1}},"Invalid regex pattern")),it=C({isEnabled:L(!0),name:T(O(),Ze.name),maxAge:T(_(),Fe),includeOutcome:T(k(),Ze.includeOutcome)}),ot=T(I([it,C({isEnabled:L(!1)})]),He),st=T(C({isEnabled:k()}),{isEnabled:!1}),at=C({type:I([L("client"),L("server")])}),lt=C({isDeviceAndLocationDataAllowed:L(!0),isUserBehaviorDataAllowed:L(!0)}),ct=C({isDeviceAndLocationDataAllowed:L(!1),isUserBehaviorDataAllowed:L(!1)}),ut=T(C({off:I([ct,lt]),on:lt}),{off:{isDeviceAndLocationDataAllowed:!1,isUserBehaviorDataAllowed:!1},on:{isDeviceAndLocationDataAllowed:!0,isUserBehaviorDataAllowed:!0}}),pt=C({name:I([L("contains"),L("regex"),L("toBoolean"),L("toNumber")]),args:T(B(O(),b()))}),dt=I([A(pt)]),yt=C({source:R(O(),h(),L("url")),expression:rt}),ft=C({source:R(O(),h(),L("dom")),selector:O(),attribute:O(),expression:T(rt)}),ht=I([yt,ft,C({source:R(O(),h(),L("window")),path:R(O(),f(1)),expression:T(rt)})]),mt=C({name:I([L("daysSince"),L("hoursSince"),L("toBoolean"),L("map")]),args:T(B(O(),b()))}),gt=A(x([ht,C({name:R(O(),g(),f(1)),handler:T(mt),type:I([L("string"),L("number"),L("boolean"),L("list")]),tracked:T(k())}),C({key:je})])),wt=$(["type","os","viewer"]),vt=$(["timeZone","referrer"]),bt=$(["todayPageViews","todayPageViewsByArticle","todayPageViewsByArticleWithPaywall","todayPageViewsByArticleWithRegwall","todayTopLevelSections","todayTopLevelSectionsByArticle","sevenDayPageViews","sevenDayPageViewsByArticle","sevenDayPageViewsByArticleWithPaywall","sevenDayPageViewsByArticleWithRegwall","sevenDayTopLevelSections","sevenDayTopLevelSectionsByArticle","sevenDayVisitCount","twentyEightDayPageViews","twentyEightDayPageViewsByArticle","twentyEightDayPageViewsByArticleWithPaywall","twentyEightDayPageViewsByArticleWithRegwall","twentyEightDayTopLevelSections","twentyEightDayTopLevelSectionsByArticle","twentyEightDayVisitCount","daysSinceLastVisit","hourOfDay","localDayOfWeek","localHourOfDay"]),At=I([C({source:L("device"),key:wt}),C({source:L("contentProperties"),key:je}),C({source:L("userProperties"),key:Be}),C({source:L("visit"),key:vt}),C({source:L("modelInputs"),key:bt})]),kt=C({host:R(O(),f(1)),url:T(O(),Ye),timeout:T(R(_(),y(e=>e>0)),Je),dataMap:R(T(B(O(),At),Ke),y(e=>!qe.some(t=>t in e),"dataMap must not include SDK-reserved parameters: content.id, visitor.type, modelTrace, experiment.id, experiment.assignedGroup"))}),Pt=I([C({selector:O()}),C({event:O()})]),St=R(O(),g(),f(1),y(e=>/^[A-Za-z0-9_-]+$/.test(e),"Wall property keys may only contain letters, numbers, underscores, and hyphens")),Dt=I([O(),_(),k()]),xt=C({key:Be,name:O(),type:L("number"),tracked:T(k(),Qe),handlers:T(dt)}),Lt=C({key:Be,name:O(),type:L("string"),minLength:T(_()),maxLength:T(_(),Xe.maxLength),tracked:T(k(),Qe),handlers:T(dt)}),Et=C({key:Be,name:O(),type:L("boolean"),tracked:T(k(),Qe),handlers:T(dt)}),Vt=I([L("string"),L("number"),L("boolean")]),_t=C({key:I([L("visitorType"),Be]),name:O(),type:Vt,minLength:T(_()),maxLength:T(_(),Xe.maxLength),tracked:T(k(),Qe),handlers:T(dt)}),Ct=A(I([x([_t,C({source:R(O(),h(),L("window")),path:R(O(),f(1)),expression:T(rt)})]),x([_t,C({source:R(O(),h(),L("dom")),selector:O(),attribute:O(),expression:T(rt)})]),x([_t,C({source:R(O(),h(),L("url")),expression:rt})]),x([_t,C({source:R(O(),h(),L("cookie")),path:R(O(),f(1)),expression:T(rt)})]),xt,Lt,Et])),Tt=C({key:St,name:O(),tracked:T(k(),!0)}),$t=I([C({type:L("string"),default:T(O())}),C({type:L("number"),default:T(_())}),C({type:L("boolean"),default:T(k())}),C({type:L("enum"),options:R(A(Dt),f(1)),default:T(Dt)})]),Bt=A(R(x([Tt,$t]),y(e=>void 0===e.default||Ge(e.default,e),"Wall property default must match its configured type"),y(e=>"enum"===e.type||!("options"in e&&void 0!==e.options),"options is only supported for wall properties with type 'enum'"))),jt=T(k(),!0),Ot=T(C({enabled:T(k(),et.enabled),key:T(O(),et.key)}),et),Wt=T(C({contentPropensityLevel:T(I([L(!1),ft]),tt.contentPropensityLevel),visitorType:T(I([L(!1),ft]),tt.visitorType)}),tt),It=R(O(),g(),f(1)),Ut=j({hostname:nt,metadataHost:T(nt),model:O(),analytics:O(),mainHost:T(nt),subMarket:T(O()),enableExperiment:T(k(),!0),cookie:ot,subdomains:T(A(nt),[]),mode:ut,paywallApi:T(kt),spa:T(Pt),userProperties:T(Ct),wallProperties:T(Bt),contentProperties:T(gt),generatePageviewOnWallHit:jt,wallGeneration:T(at,{type:"client"}),addTracingToLocalStorage:Ot,enableWallIndicators:T(k(),!1),holdInputEventsUntilConsent:T(k(),!1),newsletterCampaigns:T(A(O()),[]),metaValues:Wt,showPaywallScore:T(k(),!1),policy:T(C({evaluator:It,thresholds:T(It)}
1)),extensions:T(Me),stateCookie:st,tenant:O()}),Rt=R(P(e=>!e||"object"!=typeof e||!("analytics"in e)||"custom"===e.analytics,"Unsupported analytics module"),P(e=>{if(e&&"object"==typeof e&&"contentProperties"in e){if("enableWallIndicators"in e&&e.enableWallIndicators)return!1;if("wallGeneration"in e&&"object"==typeof e.wallGeneration&&null!==e.wallGeneration&&"type"in e.wallGeneration&&"server"===e.wallGeneration.type)return!1}return!0},"Content properties cannot be used with server-side wall generation or wall indicators"),P(e=>!e||"object"!=typeof e||!("paywallApi"in e)||!e.paywallApi||!(!("contentProperties"in e)||!Array.isArray(e.contentProperties))&&e.contentProperties.some(e=>e&&"object"==typeof e&&"key"in e&&"content.id"===e.key),'Paywall API requires contentProperties to include key "content.id"')),Mt=R(Ut,Rt,m(e=>({...e,mainHost:e.mainHost??e.hostname})));const Nt="sophi_demeter_config";class Gt{constructor(e){this.#e="isConsented",this.consentParameterValue=null,this.#t=e.off,this.#n=e.on,this.isDeviceAndLocationDataAllowed=this.#t.isDeviceAndLocationDataAllowed,this.isUserBehaviorDataAllowed=this.#t.isUserBehaviorDataAllowed,this.#r()}#t;#n;#e;getDefaultConsentValue(){return!0===this.#t.isDeviceAndLocationDataAllowed&&!0===this.#t.isUserBehaviorDataAllowed?"on":"off"}#r(){const e=Ee(this.#e);"true"===e?(this.on(),this.consentParameterValue=!0):"false"===e&&(this.off(),this.consentParameterValue=!1)}on(){this.isDeviceAndLocationDataAllowed=this.#n.isDeviceAndLocationDataAllowed,this.isUserBehaviorDataAllowed=this.#n.isUserBehaviorDataAllowed}off(){this.isDeviceAndLocationDataAllowed=!1,this.isUserBehaviorDataAllowed=!1}}function qt(e){return e?"selector"in e?`yes\n · observed DOM element: ${e.selector}`:`yes\n · listening for event: ${e.event}`:"no"}function zt(e){return!1===e?"disabled":Ft(e)}function Ft(e){return`enabled\n · selector: ${e.selector}\n · attribute: ${e.attribute}`}function Zt(e){return e&&0!==e.length?e.map(e=>`${e.key} - ${e.name}`).join(", "):"none"}const Ht=JSON.parse('{"tenant":"tgam","hostname":"theglobeandmail.com","metadataHost":"www.theglobeandmail.com","model":"theglobeandmail","policy":{"evaluator":"default"},"analytics":"custom","subdomains":[],"contentProperties":[{"key":"content.id","name":"Content ID","type":"string","source":"dom","selector":"meta[name=\'arc-id\']","attribute":"content","expression":".*","tracked":false},{"key":"1","name":"URL Pathname","type":"string","source":"url","expression":".*","tracked":false}],"enableExperiment":true,"holdInputEventsUntilConsent":false,"newsletterCampaigns":[],"userProperties":[{"key":"1","name":"last_newsletter_subscription","type":"string","source":"window","path":"tgam.datalayer.identity.newsletter","tracked":true,"maxLength":12},{"key":"2","name":"is_past_subscriber_registered","type":"boolean","source":"window","path":"tgam.datalayer.identity.registered","tracked":true,"maxLength":12},{"key":"3","name":"is_past_subscriber_prev_service","type":"boolean","source":"window","path":"tgam.datalayer.identity.previous_services.0","tracked":true,"maxLength":12},{"key":"4","name":"is_advisor","type":"boolean","source":"window","path":"tgam.datalayer.identity.advisor","tracked":true,"maxLength":12}],"generatePageviewOnWallHit":false,"mode":{"off":{"isDeviceAndLocationDataAllowed":false,"isUserBehaviorDataAllowed":false},"on":{"isDeviceAndLocationDataAllowed":true,"isUserBehaviorDataAllowed":true}},"showPaywallScore":false,"paywallApi":{"host":"www.theglobeandmail.com","dataMap":{"visitor.visit.referrer":{"source":"visit","key":"referrer"},"visitor.device.os":{"source":"device","key":"os"},"visitor.device.viewer":{"source":"device","key":"viewer"},"visitor.device.type":{"source":"device","key":"type"},"visitor.visit.timezone":{"source":"visit","key":"timeZone"}},"url":"https://paywall.sophi.io","timeout":2000},"wallGeneration":{"type":"client"}}'),Jt=function(e){return U(Mt,e)}((()=>{const e=sessionStorage.getItem(Nt);if(null!==e)try{return JSON.parse(e)}catch(e){return null}})()??Ht),Yt=new class{constructor(e){this.hostname=e.hostname,this.mainHost=e.mainHost,this.subMarket=e.subMarket,this.enableExperiment=e.enableExperiment,this.cookie=e.cookie,this.subdomains=e.subdomains,this.mode=new Gt(e.mode),this.paywallApi=e.paywallApi,this.spa=e.spa,this.userProperties=e.userProperties,this.wallProperties=e.wallProperties,this.contentProperties=e.contentProperties,this.generatePageviewOnWallHit=e.generatePageviewOnWallHit,this.wallGeneration=e.wallGeneration,this.addTracingToLocalStorage=e.addTracingToLocalStorage,this.enableWallIndicators=e.enableWallIndicators,this.holdInputEventsUntilConsent=e.holdInputEventsUntilConsent,this.newsletterCampaigns=e.newsletterCampaigns,this.metaValues=e.metaValues,this.showPaywallScore=e.showPaywallScore,this.stateCookie=e.stateCookie,function(e){const t=e.subdomains??[];0!==t.length&&t.includes(e.mainHost)&&De.warn(`Subdomains contain mainHost entry (${e.mainHost}).`)}(e),De.info(function(e){let t=`âï¸ Bundle settings\n · Host: ${e.hostname}\n · Main host: ${e.mainHost}\n · Subdomains: ${e.subdomains?.join(", ")||"none"}\n · Wall type: ${e.wallGeneration.type} side`;return t="debug"===ke.logLevel?`${t}\n · Experiments: ${e.enableExperiment?"enabled":"disabled"}\n · Cookie: ${e.cookie?.isEnabled?"enabled":"disabled"}\n · Paywall API: ${e.paywallApi?"enabled":"disabled"}\n · Default consent: ${e.mode.getDefaultConsentValue()}\n · Single Page Application: ${qt(e.spa)}\n · Wallhits generate pageviews: ${e.generatePageviewOnWallHit?"yes":"no"}\n · Wall indicators: ${e.enableWallIndicators?"enabled":"disabled"}\n · Visitor type detection: ${zt(e.metaValues.visitorType)}\n · Content propensity level detection: ${zt(e.metaValues.contentPropensityLevel)}\n · User properties: ${Zt(e.userProperties)}\n · Wall properties: ${Zt(e.wallProperties)}\n · Content properties: ${Zt(e.contentProperties)}`:`${t}\n ${function(e){return e.filter(e=>Boolean(e)).map(e=>`· ${e.label}: ${e.value}\n `).join("")}([e.enableExperiment&&{label:"Experiments",value:"enabled"},e.cookie?.isEnabled&&{label:"Cookie",value:"enabled"},e.paywallApi&&{label:"Paywall API",value:"enabled"},e.mode.getDefaultConsentValue()&&{label:"Default consent",value:e.mode.getDefaultConsentValue()},{label:"Single Page Application",value:qt(e.spa)},e.generatePageviewOnWallHit&&{label:"Wallhits generate pageviews",value:"yes"},e.enableWallIndicators&&{label:"Wall indicators",value:"enabled"},e.metaValues.visitorType&&{label:"Visitor type detection",value:Ft(e.metaValues.visitorType)},e.metaValues.contentPropensityLevel&&{label:"Content propensity level detection",value:zt(e.metaValues.contentPropensityLevel)}])}`,t}(this))}}(Jt),Kt=function(e){let t=null;if(Yt.enableExperiment&&window.sophi?.abTests&&!0===Yt.mode.isDeviceAndLocationDataAllowed&&!0===Yt.mode.isUserBehaviorDataAllowed){const n=window.sophi?.abTests.getAllExperimentsSync(e);n.length>0&&(t=n[0])}return t},Xt=()=>Kt("external"),Qt=()=>Kt("internal");Xt(),Qt();var en=(e=>(e["Initialized"]="i",e["Loading"]="l",e["Executing"]="x",e["StateInitial"]="si",e["StateCookie"]="sc",e["StateLocal"]="sl",e["TestAssigned"]="t",e["ApiInitiated"]="ai",e["ApiCompleted"]="ac",e["DecisionAvailable"]="d",e["DataLayerReady"]="dl",e["ScriptLoadError"]="xsl",e["ApiTimeout"]="xat",e["ApiNetworkError"]="xan",e["ModelEvalFailed"]="xme",e))(en||{});let tn=0;const nn=999.99;let rn="";const on=e=>"string"==typeof e?e:"",sn=(e,t)=>{try{return on(e[t])}catch{return""}},an=(e,t,n)=>{try{e[t]=n}catch{}},ln=(e,t)=>{try{const n=Object.getOwnPropertyDescriptor(e,t);if(n&&(!n.configurable||n.get&&n.set))return;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:()=>rn,set:e=>{rn=on(e)}})}catch{}};function cn(){const e=window.sophi?.demeter;if(!e)return;const t=window,n=e,r=sn(t,"sophiInitStatus"),i=sn(n,"initStatus");rn=r||i,ln(t,"sophiInitStatus"),ln(n,"initStatus"),an(t,"sophiInitStatus",rn),an(n,"initStatus",rn)}function un(e){const t=window.sophi?.demeter;if(!t)return;cn();const n=`${e}${(()=>{const e=performance.now()-tn,t=Math.min(Math.floor(e/10)/100,nn);return String(t).replace(/^0\./,".")})()}`;rn=rn?`${rn},${n}`:n;const r=window,i=t;an(r,"sophiInitStatus",rn),an(i,"initStatus",rn)}const pn="sophiDataLayerReady",dn={trace:"",context:"",inputs:"",experimentsCode:null,assignedGroup:null,userProperties:"",contentProperties:""},yn=()=>{window.sophi.dataLayer={...dn}},fn=()=>window.sophi.dataLayer;function hn(e){const t={};var n;
1return"context"in e&&(t.context=e.context),"inputs"in e&&(t.inputs=e.inputs),"trace"in e&&(t.trace=e.trace),"userProperties"in e&&(t.userProperties=e.userProperties),"wallProperties"in e&&(t.wallProperties=e.wallProperties),"contentProperties"in e&&(t.contentProperties=e.contentProperties),"experiment"in e&&e.experiment&&(t.experimentsCode=null===(n=e.experiment)?null:`${n.experimentId}${"="}${n.assignedGroup}`,t.assignedGroup=e.experiment.assignedGroup),t}function mn(e){window.sophi.dataLayer={...window.sophi.dataLayer,...hn(e)}}const gn=function(){un(en.DataLayerReady),window.dispatchEvent(new Event(pn))};var wn=(e=>(e["GetDecision"]="GetDecision",e["GetDecisionForArticleWallIndicators"]="GetDecisionForArticleWallIndicators",e["Init"]="Init",e["Pageview"]="pageview",e["Wall"]="wall",e["EnableAllFeatures"]="EnableAllFeatures",e["UserProperties"]="UserProperties",e["ContentProperties"]="ContentProperties",e))(wn||{});const vn=M.union([M.null_(),M.pipe(M.string(),M.trim(),M.toLowerCase())]),bn=M.object({article:M.boolean(),section:M.optional(vn)}),An=M.union([M.union([M.pipe(M.string(),M.trim(),M.literal("paywall")),M.pipe(M.string(),M.trim(),M.literal("regwall"))]),M.object({wallType:M.union([M.pipe(M.string(),M.trim(),M.literal("paywall")),M.pipe(M.string(),M.trim(),M.literal("regwall"))]),section:M.optional(vn)})]),kn=M.union([M.object({type:M.literal("pageview"),payload:bn}),M.object({type:M.literal("wall"),payload:An}),M.object({type:M.literal("UserProperties"),payload:M.any()})]),Pn=(M.union([kn,M.object({type:M.literal("GetDecision")}),M.object({type:M.literal("Init")}),M.object({type:M.literal("EnableAllFeatures")})]),(e,t,n)=>{const r=document.querySelector(e);if(null===r)return null;const i=r.getAttribute(t);return null===i?null:n?Ln(i,n):i}),Sn=e=>"__proto__"!==e&&"constructor"!==e&&"prototype"!==e,Dn=e=>{try{const t=e.split(".");if(t.length>10)return De.warn(`Window path exceeds maximum depth of 10: "${e}" (depth: ${t.length})`),null;let n=window;for(const r of t){if(null==n)return null;if(!Sn(r))return De.warn(`Unsafe path segment detected: "${r}" in path "${e}"`),null;n=n[r]}return void 0===n?null:n}catch(t){return De.warn(`Error extracting window path "${e}":`,t),null}},xn=(e,t,n,r)=>{const i=n?.minLength,o=n?.maxLength;return"number"==typeof i&&t.length<i?(De.warn(`${r} ${e} expected to have a minimum length of ${i} but got '${t}' with length ${t.length}, omitting.`),{isValid:!1,processedValue:t}):"number"==typeof o&&t.length>o?(De.warn(`${r} ${e} expected to have maximum length of ${o} but got '${t}' with length ${t.length}, truncating.`),{isValid:!0,processedValue:t.slice(0,o)}):{isValid:!0,processedValue:t}},Ln=(e,t)=>{try{const n=new RegExp(t),r=e.match(n);if(null===r)return null;const i=r[1]??r[0];return void 0===r[1]&&r[0]&&De.debug(`No capture group value, using full match: "${i}".`),i}catch(e){return De.warn(`Regex error "${t}":`,e),null}},En=(e,t)=>{try{const n=e+"=",r=document.cookie.split(";");for(const e of r){const r=e.trimStart();if(r.startsWith(n)){const e=r.substring(n.length);let i;try{i=decodeURIComponent(e)}catch{i=e}return t?Ln(i,t):i}}return null}catch{return null}},Vn=e=>null==e?null:String(e).toLowerCase();function _n(e){const t=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n=new Date,r=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate())-t,i=Math.floor(r/(1e3*60*60*24));return i<0?0:i}const Cn={0:"free access",1:"subscribers only",2:"metered views",3:"special package"},Tn=e=>{try{if("dom"===e.source)return Pn(e.selector,e.attribute,e.expression);if("url"===e.source){const t=new URL(location.href);return Ln(t.pathname,e.expression)}return null}catch{return null}},$n=new Set(["","0","false","n","no","none","null","off","undefined"]),Bn=(e,t)=>"string"==typeof e?!(e=>$n.has(e.trim().toLowerCase()))(e):Boolean(e),jn=(e,t)=>{const n=t.args;return"contains"===t.name&&n?((e,t)=>{if(!t||!Array.isArray(e))return null;const{value:n,caseSensitive:r=!0}=t;return(Array.isArray(n)?n:[n]).some(t=>r?e.includes(String(t)):e.some(e=>e.toLowerCase()===String(t).toLowerCase()))})(e,n):"regex"===t.name&&n?((e,{patterns:t})=>{if(!t||!Array.isArray(t))return null;const n="string"==typeof e?e:String(e??""),r=t;for(const e of r){const t=Ln(n,e);if(t)return t}return null})(e,n):"toBoolean"===t.name?Bn(e):"toNumber"===t.name?(e=>{if(null==e)return null;const t=Number(e);return Number.isNaN(t)?null:t})(e):null},On=(e,t)=>{let n=e;if(null==n||!t)return null;for(const e of t)n=jn(n,e);return n??null},Wn={values:null,analyticsString:null};function In(e){return null===Wn.values&&Un(e),Wn.values}function Un(e){let t={values:{},analyticsString:""};try{t=Kn(e)}catch(e){De.error("Error computing content properties:",e)}Wn.values=t.values,Wn.analyticsString=t.analyticsString}function Rn(e,t){const n=(t?.dateFormat||"iso").toLowerCase();let r;return r="iso"===n||"iso8601"===n?new Date(e):"unixseconds"===n?new Date(1e3*parseInt(e,10)):"unixmillis"===n?new Date(parseInt(e,10)):new Date(e),isNaN(r.getTime())?null:r}const Mn=new Set(["unixseconds","unixmillis"]),Nn=/^\d+$/;function Gn(e,t){const n=(t?.dateFormat||"iso").toLowerCase();return!Mn.has(n)||Nn.test(e.trim())}function qn(e,t){if(null==e)return null;if(!t)return e;switch(t.name){case"daysSince":{const n=function(e,t){try{if(!Gn(e,t))return null;const n=Rn(e,t);return n?_n(n):null}catch{return null}}(e,t.args);return null===n?null:n}case"hoursSince":{const n=function(e,t){try{if(!Gn(e,t))return null;const n=Rn(e,t);if(!n)return null;const r=Math.floor((Date.now()-n.getTime())/(1e3*60*60));return r<0?0:r}catch{return null}}(e,t.args);return null===n?null:n}case"toBoolean":return Bn(e);case"lowercase":return Vn(e);case"map":return function(e,t){return t&&"object"==typeof t&&e in t?t[e]:e}(e,t.args);default:return e}}function zn(e,t){let n=e;if("boolean"===t.type&&"dom"===t.source)n=null!==document.querySelector(t.selector);else if("number"===t.type&&"string"==typeof e){const t=Number(e.trim());n=isNaN(t)?null:t}else"list"===t.type&&null!==e&&(n=(r=e,r.split(",").map(e=>
1Vn(e)?.replace(/,/g,"").trim()).filter(Boolean)).join(" ")),t.handler&&(n=qn("string"==typeof n?n:String(n),t.handler));var r;return n}function Fn(e,t,n){if(e===Te){const e=qn(t,{name:"map",args:n.handler?.args});return Number(e)in Cn?Cn[e]:null}return e===Ve&&"string"==typeof t?qn(t,{name:"daysSince",args:n.handler?.args}):e===_e&&"string"==typeof t?qn(t,{name:"hoursSince",args:n.handler?.args}):t}function Zn(e,t,n){return"string"===n.type&&"string"==typeof t?xn(e,t,n,"Content property"):{isValid:!0,processedValue:t}}function Hn(e){return null==e||""===e}const Jn={[Ve]:"A",[Ce]:"B",[Te]:"C",[_e]:"D"},Yn=e=>e in Jn?Jn[e]:e,Kn=e=>{const t=e.contentProperties||[],n={},r=[],i=[],o=[];for(const e of t){const t=e.key,s=Tn(e);let a=null;if(a=t in Jn?Fn(t,s,e):zn(s,e),Hn(a)){i.push(e.name);continue}const{isValid:l,processedValue:c}=Zn(t,a,e);l&&(a=c,n[t]=a,o.push({label:e.name||t,value:a}),e.tracked&&r.push(`${Yn(t)}:${a}`))}return t.length>0&&function(e,t){e.length>0&&De.warn(`Some configured content properties were not found on this page: ${e.join(", ")}. Note: This is expected on homepages or section pages without article content.`);const n=t.map(e=>"Content Age"===e.label&&"number"==typeof e.value?` · ${e.label}: ${e.value} days`:"Content Age in Hours"===e.label&&"number"==typeof e.value?` · ${e.label}: ${e.value} hours`:"string"==typeof e.value?` · ${e.label}: "${e.value}"`:` · ${e.label}: ${JSON.stringify(e.value)}`);De.info("Content Properties Found\n\n"+n.join("\n"))}(i,o),{values:n,analyticsString:r.join(",")}};function Xn(e){return Object.entries(e)}const Qn=new class{constructor(){this.key="demeter"}get(){try{const e=localStorage.getItem(this.key);return null===e?e:he(e)}catch(e){return null}}set(e){try{return localStorage.setItem(this.key,fe(e))}catch(e){}}clear(){try{return localStorage.removeItem(this.key)}catch(e){}}},er=Qn,tr=M.array(M.string()),nr=M.object({pageViews:M.number(),pageViewsByArticle:M.number(),pageViewsByArticleWithPaywall:M.number(),pageViewsByArticleWithRegwall:M.number(),topLevelSections:tr,topLevelSectionsByArticle:tr}),rr=M.object({granted:M.boolean(),timestamp:M.string()}),ir=28;function or(){return(new Date).toISOString()}class sr{constructor(){this.pageViews=0,this.pageViewsByArticle=0,this.pageViewsByArticleWithPaywall=0,this.pageViewsByArticleWithRegwall=0,this.topLevelSections=[],this.topLevelSectionsByArticle=[]}}const ar=M.optional(M.array(kn),[]),lr=M.object({previous:M.partial(de),events:ar}),cr=M.object({previous:M.optional(de),events:ar,outcomes:M.optional(M.array(ne),[])}),ur=M.pipe(M.any(),M.transform(e=>{const t=M.safeParse(cr,e);if(t.success)return t.output;const n=M.safeParse(lr,e);return n.success?{events:n.output.events,previous:n.output.previous,outcomes:[]}:{events:[],previous:void 0,outcomes:[]}})),pr=M.object({today:nr,history:M.array(nr),lastSeen:M.string(),visitor:J,coldDataLayer:ur,consent:M.optional(rr)}),dr=M.tuple([M.number(),M.number(),M.number(),M.number(),tr,tr]),yr=M.object({lS:M.string(),v:J,t:dr,h:M.array(dr),cDL:ur,c:M.optional(M.tuple([M.boolean(),M.string()]))}),fr=e=>[e.pageViews,e.pageViewsByArticle,e.pageViewsByArticleWithPaywall,e.pageViewsByArticleWithRegwall,e.topLevelSections,e.topLevelSectionsByArticle],hr=e=>({pageViews:e[0],pageViewsByArticle:e[1],pageViewsByArticleWithPaywall:e[2],pageViewsByArticleWithRegwall:e[3],topLevelSections:e[4],topLevelSectionsByArticle:e[5]});class mr{constructor(){this.today={pageViews:0,pageViewsByArticle:0,pageViewsByArticleWithPaywall:0,pageViewsByArticleWithRegwall:0,topLevelSections:[],topLevelSectionsByArticle:[]},this.history=Array(ir).fill(void 0).map(()=>new sr),this.lastSeen="",this.visitor="anonymous",this.coldDataLayer={previous:void 0,events:[],outcomes:[]},this.consent=void 0}}let gr;const wr=new class{#i;constructor(){const e=er.get();this.#i=this.#o(this.#s(e))}#s(e){try{const t=M.safeParse(yr,e);return t.success?(e=>{const{lS:t,v:n,t:r,h:i,cDL:o,c:s}=e,a=i.map(hr);return{lastSeen:t,visitor:n,today:hr(r),history:a,coldDataLayer:o,consent:s?{granted:s[0],timestamp:s[1]}:void 0}})(t.output):M.parse(pr,e)}catch(e){return new mr}}getFromStored(){this.updateState(this.#s(er.get()))}updateState(e){this.#i=this.#o(e),er.set((e=>{const{today:t,history:n,lastSeen:r,visitor:i,coldDataLayer:o,consent:s}=e,a=n.map(fr);return{lS:r,v:i,t:fr(t),h:a,cDL:o,c:s?[s.granted,s.timestamp]:void 0}})(e));try{gr?.()}catch{}}getState(){return JSON.parse(JSON.stringify(this.#i))}clear(){er.clear(),this.#i=this.#o(this.#s(null))}getConsent(){return this.#i.consent}setConsent(e){const t=this.getState();t.consent={granted:e,timestamp:or()},this.updateState(t)}#o(e){if(!1===Yt.mode.isUserBehaviorDataAllowed)return e;const t=new Date(e.lastSeen),n=Math.max(0,_n(t));if(n>0){e.history.unshift(e.today);for(let t=0;t<n-1;t++)e.history.unshift((new mr).today);e.history=e.history.slice(0,ir),e.today=(new mr).today}return e.lastSeen=or(),e}},vr=wr,br=(e,t)=>{if(null==e)return null;try{switch(t){case"string":{const t=String(e);return""===t.trim()?null:t}case"number":{const t=Number(e);return isNaN(t)?null:t}case"boolean":if("boolean"==typeof e)return e;if("string"==typeof e){const t=e.toLowerCase();if("true"===t)return!0;
1if("false"===t)return!1}return Boolean(e);default:return null}}catch(e){return null}},Ar=e=>{const t=M.safeParse(J,e);return t.success?{isValid:!0,value:t.output}:(De.warn(`visitorType should be '${F}' or '${Z}', got '${e}'.`),{isValid:!1,value:null})},kr="userProperties.countryCode",Pr={countryCode:"A"},Sr=[{key:"visitorType",name:"Visitor type",type:"string"}],Dr=(e,t,n)=>"minLength"in n&&void 0!==n.minLength&&t.length<n.minLength?(De.warn(`User property ${e} expected to have a minimum length of ${n.minLength} but got '${t}' with length ${t.length}, omitting.`),{isValid:!1,processedValue:t}):"maxLength"in n&&void 0!==n.maxLength&&t.length>n.maxLength?(De.warn(`User property ${e} expected to have maximum length of ${n.maxLength} but got '${t}' with length ${t.length}, truncating.`),{isValid:!0,processedValue:t.slice(0,n.maxLength)}):{isValid:!0,processedValue:t},xr=(e,t)=>{if(!0!==e.mode.isDeviceAndLocationDataAllowed||!0!==e.mode.isUserBehaviorDataAllowed)return void De.debug("Discarding userProperties event");const{custom:n,reserved:r}=((e,t)=>{const n={},r={};if("object"!=typeof t||null===t)return De.warn(`User properties must be in an 'args' object. Received:`,t),{custom:n,reserved:r};const i=(e=>{const t=new Map;for(const e of Sr)t.set(e.key,e);for(const n of e)t.set(n.key,n);return t})(e.userProperties||[]);for(const e of Xn(t)){let[t,o]=e;const s=i.get(t);if(s){if("handlers"in s&&s.handlers){const e=On(o,s.handlers);if(void 0===e){De.debug(`User property ${t} handler returned undefined, omitting.`);continue}o=e}if(typeof o===s.type){if("string"==typeof o){const{isValid:e,processedValue:n}=Dr(t,o,s);if(!e)continue;o=n}if("visitorType"===s.key){const{isValid:e,value:t}=Ar(o);if(!e)continue;r[s.key]=t;continue}n[s.key]=o}else De.warn(`User property ${t} expected to be a ${s.type} but got ${typeof o}, omitting.`)}else De.warn(`User property ${t} is not configured, omitting.`)}return{custom:n,reserved:r}})(e,t);if(Object.keys(n).length>0&&De.debug("Setting user properties",n),Object.keys(r).length>0&&De.debug("Setting reserved properties",r),Object.keys(n).length>0&&Fa.update(e=>{Object.assign(e.userProperties,n)}),r.visitorType){const e=vr.getState(),t=r.visitorType;vr.updateState({...e,visitor:t})}},Lr=e=>{if(!e.userProperties||0===e.userProperties.length)return;(e=>{const t=Ee(kr);t&&(e.userProperties??[]).some(e=>"countryCode"===e.key)&&xr(e,{countryCode:t})})(e);const t=e.userProperties.filter(e=>"source"in e&&"window"===e.source);if(t.length>0){const n=(e=>{const t={},n=[];for(const r of e){const{key:e,path:i,name:o,type:s,handlers:a}=r,l=Dn(i);if(null===l){n.push(o);continue}if("visitorType"===e){const{isValid:r,value:i}=Ar(l);if(!r||!i){n.push(o);continue}t[e]=i;continue}const c=a?l:br(l,s);if(null!==c)if("string"==typeof c){const{isValid:i,processedValue:s}=xn(e,c,r,"User property");if(!i){n.push(o);continue}t[e]=s}else t[e]=c;else De.warn(`User property "${o}" could not be converted to type "${s}". Value: "${l}"`),n.push(o)}return n.length>0&&De.warn(`Some configured user properties were not found in window variables: ${n.join(", ")}`),t})(t);Object.keys(n).length>0&&(De.debug("Initializing user properties from window",n),xr(e,n))}const n=e.userProperties.filter(e=>"source"in e&&"cookie"===e.source);if(n.length>0){const t=(e=>{const t={},n=[];for(const r of e){const{key:e,path:i,name:o,type:s,handlers:a}=r,l=r.expression,c=En(i),u=null!==c&&l?Ln(c,l):c;if(null===u){n.push(o);continue}if("visitorType"===e){const{isValid:r,value:i}=Ar(u);if(!r||!i){n.push(o);continue}t[e]=i;continue}const p=a?u:br(u,s);if(null!==p)if("string"==typeof p){const{isValid:i,processedValue:s}=xn(e,p,r,"User property");if(!i){n.push(o);continue}t[e]=s}else t[e]=p;else De.warn(`User property "${o}" could not be converted to type "${s}". Value: "${u}"`),n.push(o)}return n.length>0&&De.warn(`Some configured user properties could not be extracted from cookies: ${n.join(", ")}`),t})(n);Object.keys(t).length>0&&(De.debug("Initializing user properties from cookies",t),xr(e,t))}},Er=xr,Vr=["utm_campaign","utm_medium","utm_source"],_r=function(e=window.location.href){try{const t=new URL(e),n={};
1return Vr.forEach(e=>{const r=t.searchParams.get(e);null!==r&&(n[e]=r.toLowerCase())}),n}catch(e){return De.error("Unable to extract query parameters.",e),{}}};var Cr={d:(e,t)=>{for(var n in t)Cr.o(t,n)&&!Cr.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},Tr={};Cr.d(Tr,{Ay:()=>Ir,Fo:()=>jr,LU:()=>Wr,Tk:()=>Br,VS:()=>$r,cr:()=>Or});const $r={campaign:0,direct:1,internal:2,search:3,social:4,other:5},Br={google:0,yahoo:1,duckduckgo:2,bing:3,facebook:4,instagram:5,x:6,linkedin:7,reddit:8,newsletter:9},jr={search:0,news:1,discover:2},Or=function(e,t,n,r){return Wr(e,t,n,r)?.medium},Wr=function(e,t,n,r,i){if("string"!=typeof e)throw new Error("locationHref should be a string");if("string"!=typeof t)throw new Error("documentReferrer should be a string");if("string"!=typeof n)throw new Error("locationHost should be a string");const o=t.toLowerCase().trim(),s=e.toLowerCase().trim(),a=n.toLowerCase().trim();let l;try{l=new URLSearchParams(new URL(s).search).get("utm_campaign")}catch{l=null}if(l){const e=i?.newsletterCampaigns;return{medium:"campaign",source:e?.includes(l)?"newsletter":void 0}}if(!o)return{medium:"direct"};const c=o.match(/^(?:.+:\/\/)?([^/]+)/i),u=c?c[1].replace(/^www\./i,""):"",p=a.replace(/^www\./i,"");if(u===p||u.endsWith(`.${p}`)&&u.length>p.length+1)return{medium:"internal"};if(/^[^\s.][^\s]*\.google\.android\.googlequicksearchbox\b/i.test(u))return{medium:"search",source:"google",channel:"discover"};if("string"==typeof r&&t.includes("google.com")&&r.includes("Safari")&&(r.includes("GSA")||r.includes("GNews"))&&(r.includes("604.1")||r.includes("605.1.15")))return{medium:"search",source:"google",channel:"discover"};if("news.google.com"===u)return{medium:"search",source:"google",channel:"news"};const d=[{source:"google",channel:"search"},{source:"yahoo"},{source:"duckduckgo"},{source:"bing"}],y=e=>{if(e.domains){const t=e.domains.map(e=>`(^|\\.)${e.replace(".","\\.")}$`).join("|");return new RegExp(t,"i")}return new RegExp(String.raw`(^|.*\.)${e.source}\.(?:[a-z]{2,63}|[a-z]{2,63}\.[a-z]{2})$`,"i")};for(const e of d)if(y(e).test(u))return"google"===e.source?{medium:"search",source:e.source,channel:e.channel}:{medium:"search",source:e.source};const f=[{source:"facebook"},{source:"instagram"},{source:"x",domains:["x.com","t.co"]},{source:"linkedin"},{source:"reddit"}];for(const e of f)if(y(e).test(u))return{medium:"social",source:e.source};return{medium:"other",source:u||void 0}},Ir=Or,Ur=Tr.Fo,Rr=Tr.VS,Mr=Tr.Tk,Nr=Tr.LU,Gr=function(){try{return Nr(window.location.href,document.referrer,window.location.host,navigator.userAgent,Yt)}catch(e){return De.error("Unable to determine referrer.",e),{medium:"",source:"",channel:""}}};var qr=Symbol.for("immer-nothing"),zr=Symbol.for("immer-draftable"),Fr=Symbol.for("immer-state");function Zr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Hr=Object.getPrototypeOf;function Jr(e){return!!e&&!!e[Fr]}function Yr(e){return!!e&&(Qr(e)||Array.isArray(e)||!!e[zr]||!!e.constructor?.[zr]||ii(e)||oi(e))}var Kr=Object.prototype.constructor.toString(),Xr=new WeakMap;function Qr(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);if(null===t||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if("function"!=typeof n)return!1;let r=Xr.get(n);return void 0===r&&(r=Function.toString.call(n),Xr.set(n,r)),r===Kr}function ei(e,t,n=!0){0===ti(e)?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ti(e){const t=e[Fr];return t?t.type_:Array.isArray(e)?1:ii(e)?2:oi(e)?3:0}function ni(e,t){return 2===ti(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ri(e,t,n){const r=ti(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function ii(e){return e instanceof Map}function oi(e){return e instanceof Set}function si(e){return e.copy_||e.base_}function ai(e,t){if(ii(e))return new Map(e);if(oi(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Qr(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[Fr];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const i=n[r],o=t[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Hr(e),t)}{const t=Hr(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function li(e,t=!1){return ui(e)||Jr(e)||!Yr(e)||(ti(e)>
vendor: 6,176 bytes, line 1
11&&Object.defineProperties(e,{set:ci,add:ci,clear:ci,delete:ci}),Object.freeze(e),t&&Object.values(e).forEach(e=>li(e,!0))),e}var ci={value:function(){Zr(2)}};function ui(e){return null===e||"object"!=typeof e||Object.isFrozen(e)}var pi,di={};function yi(e){const t=di[e];return t||Zr(0),t}function fi(){return pi}function hi(e,t){t&&(yi("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function mi(e){gi(e),e.drafts_.forEach(vi),e.drafts_=null}function gi(e){e===pi&&(pi=e.parent_)}function wi(e){return pi={drafts_:[],parent_:pi,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function vi(e){const t=e[Fr];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function bi(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[Fr].modified_&&(mi(t),Zr(4)),Yr(e)&&(e=Ai(t,e),t.parent_||Pi(t,e)),t.patches_&&yi("Patches").generateReplacementPatches_(n[Fr].base_,e,t.patches_,t.inversePatches_)):e=Ai(t,n,[]),mi(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==qr?e:void 0}function Ai(e,t,n){if(ui(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Fr];if(!i)return ei(t,(r,o)=>ki(e,i,t,r,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Pi(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const t=i.copy_;let o=t,s=!1;3===i.type_&&(o=new Set(t),t.clear(),s=!0),ei(o,(r,o)=>ki(e,i,t,r,o,n,s),r),Pi(e,t,!1),n&&e.patches_&&yi("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function ki(e,t,n,r,i,o,s){if(null==i)return;if("object"!=typeof i&&!s)return;const a=ui(i);if(!a||s){if(Jr(i)){const s=Ai(e,i,o&&t&&3!==t.type_&&!ni(t.assigned_,r)?o.concat(r):void 0);if(ri(n,r,s),!Jr(s))return;e.canAutoFreeze_=!1}else s&&n.add(i);if(Yr(i)&&!a){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;if(t&&t.base_&&t.base_[r]===i&&a)return;Ai(e,i),t&&t.scope_.parent_||"symbol"==typeof r||!(ii(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))||Pi(e,i)}}}function Pi(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&li(t,n)}var Si={get(e,t){if(t===Fr)return e;const n=si(e);if(!ni(n,t))return function(e,t,n){const r=Li(t,n);return r?`value`in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!Yr(r)?r:r===xi(e.base_,t)?(Vi(e),e.copy_[t]=_i(r,e)):r},has:(e,t)=>t in si(e),ownKeys:e=>Reflect.ownKeys(si(e)),set(e,t,n){const r=Li(si(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=xi(si(e),t),s=r?.[Fr];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((i=n)===(o=r)?0!==i||1/i==1/o:i!=i&&o!=o)&&(void 0!==n||ni(e.base_,t)))return!0;Vi(e),Ei(e)}var i,o;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==xi(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Vi(e),Ei(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=si(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){Zr(11)},getPrototypeOf:e=>Hr(e.base_),setPrototypeOf(){Zr(12)}},Di={};function xi(e,t){const n=e[Fr];return(n?si(n):e)[t]}function Li(e,t){if(!(t in e))return;let n=Hr(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Hr(n)}}function Ei(e){e.modified_||(e.modified_=!0,e.parent_&&Ei(e.parent_))}function Vi(e){e.copy_||(e.copy_=ai(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function _i(e,t){const n=ii(e)?yi("MapSet").proxyMap_(e,t):oi(e)?yi("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:fi(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=Si;n&&(i=[r],o=Di);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}(e,t);return(t?t.scope_:fi()).drafts_.push(n),n}function Ci(e){if(!Yr(e)||ui(e))return e;const t=e[Fr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ai(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=ai(e,!0);return ei(n,(e,t)=>{ri(n,e,Ci(t))},r),t&&(t.finalized_=!1),n}ei(Si,(e,t)=>{Di[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Di.deleteProperty=function(e,t){return Di.set.call(this,e,t,void 0)},Di.set=function(e,t,n){return Si.set.call(this,e[0],t,n,e[0])};var Ti=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}let r;if("function"!=typeof t&&Zr(6),void 0!==n&&"function"!=typeof n&&Zr(7),Yr(e)){const i=wi(this),o=_i(e,void 0);let s=!0;try{r=t(o),s=!1}finally{s?mi(i):gi(i)}return hi(i,n),bi(r,i)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===qr&&(r=void 0),this.autoFreeze_&&li(r,!0),n){const t=[],i=[];yi("Patches").generateReplacementPatches_(e,r,t,i),n(t,i)}return r}Zr(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;const i=this.produce(e,t,(e,t)=>{n=e,r=t});return[i,n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),"boolean"==typeof e?.useStrictIteration&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Yr(e)||Zr(8),Jr(e)&&(e=function(e){return Jr(e)||Zr(10),Ci(e)}(e));const t=wi(this),n=_i(e,void 0);return n[Fr].isManual_=!0,gi(t),n}finishDraft(e,t){const n=e&&e[Fr];n&&n.isManual_||Zr(9);const{scope_:r}=n;return hi(r,t),bi(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>
1-1&&(t=t.slice(n+1));const r=yi("Patches").applyPatches_;return Jr(e)?r(e,t):this.produce(e,e=>r(e,t))}},$i=Ti.produce;null&&Ti.produceWithPatches.bind(Ti),null&&Ti.setAutoFreeze.bind(Ti),null&&Ti.setUseStrictShallowCopy.bind(Ti),null&&Ti.setUseStrictIteration.bind(Ti),null&&Ti.applyPatches.bind(Ti),null&&Ti.createDraft.bind(Ti),null&&Ti.finishDraft.bind(Ti);const Bi="sophi_analytics",ji=I([O(),V()]),Oi=C({campaignName:ji,referrerDomain:ji,referrerMedium:ji,referrerSource:T(ji,null),referrerChannel:T(ji,null),queryParams:T(B(O(),O()),{}),timestamp:I([R(O(),m(e=>new Date(e)),S()),V()])}),Wi=C({session:Oi}),Ii=C({campaignName:ji,referrerDomain:ji,referrerMedium:ji,referrerSource:T(ji,null),referrerChannel:T(ji,null),queryParams:B(O(),O()),timestamp:I([S(),V()])}),Ui=C({session:Ii});class Ri{constructor(){this.campaignName=null,this.referrerDomain=null,this.referrerMedium=null,this.referrerSource=null,this.referrerChannel=null,this.queryParams={},this.timestamp=null}}const Mi=$(["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","countryCode"]),Ni=I([O(),_(),k()]),Gi=C({userProperties:B(Mi,Ni),visitor:Wi}),qi={userProperties:{},visitor:{session:new Ri}},zi=function(){document.hidden||this.update(()=>Fi(this.storage))},Fi=function(e){const t=e?.getItem(Bi);if(t)try{const e=JSON.parse(t);return U(Gi,e)}catch{return qi}return qi};class Zi{storage;state;#a;update=e=>{this.state=$i(this.state,e),this.storage&&this.storage.setItem(Bi,JSON.stringify(this.state));try{this.#a?.()}catch{}};constructor(e,t){this.storage=e,this.#a=t,this.state=$i(Fi(this.storage),()=>{}),document.addEventListener("visibilitychange",zi.bind(this))}}const Hi=30,Ji=()=>{Fa.update(e=>{e.visitor.session.timestamp=new Date})},Yi=()=>{null===(null===Fa.state.visitor.session.timestamp?null:((e,t)=>new Date(e.getTime()+6e4*t))(Fa.state.visitor.session.timestamp,Hi).toISOString()<(new Date).toISOString()?(Fa.update(e=>{e.visitor.session=new Ri}
1),null):Fa.state.visitor.session)?((()=>{const e=/^(?:https?:\/\/)?([^/]+)/i;if("string"==typeof document.referrer){const t=document.referrer.match(e);null!==t&&Fa.update(e=>{e.visitor.session.referrerDomain=t[1]})}})(),(()=>{try{const e=new URLSearchParams(window.location.search).get("utm_campaign");null!==e&&Fa.update(t=>{t.visitor.session.campaignName=e.toLowerCase()})}catch{}})(),(()=>{const{medium:e,source:t,channel:n}=Gr();Fa.update(r=>{r.visitor.session.referrerMedium=e,r.visitor.session.referrerSource=t??null,r.visitor.session.referrerChannel=n??null})})(),(()=>{const e=_r();Fa.update(t=>{t.visitor.session.queryParams=e})})(),Ji()):Ji()},Ki="sophiEventQueue",Xi=()=>{const e=Ki+"=",t=decodeURIComponent(document.cookie).split(";");for(let n=0;n<t.length;n++){let r=t[n].trimStart();if(r.startsWith(e)){const t=r.substring(e.length,r.length);try{return he(t)}catch(e){return[]}}}return[]},Qi=e=>e.trim().toLowerCase(),eo=new class{constructor(){this.serverWallDeferInputsToColdLayer=!0,this.isSubdomain=e=>{if(0===this.normalizedSubdomainAllowList.size)return!1;const t=window.location.hostname;return t!==this.normalizedMainHost&&this.normalizedSubdomainAllowList.has(t)},this.store=vr,this.heldInputEvents=[],this.normalizedMainHost=Qi(Yt.mainHost),this.normalizedSubdomainAllowList=new Set((Yt.subdomains??[]).map(Qi))}dispatch(e){switch(e.type){case wn.Init:this.handleInit();break;case wn.EnableAllFeatures:return this.handleEnableAllFeatures();case wn.GetDecision:this.handleGetDecision();break;case wn.GetDecisionForArticleWallIndicators:this.handleGetDecisionForArticleWallIndicators();break;case wn.Pageview:e.payload=M.parse(bn,e.payload);try{return this.handleSubdomainAwareEvent(e,this.handlePageview)}catch(e){De.debug("Error in pageview event handler",e)}break;case wn.Wall:M.parse(An,e.payload);try{return this.handleSubdomainAwareEvent(e,this.handleWallHit)}catch(e){De.debug("Error in wall event handler",e)}break;case wn.UserProperties:try{return this.handleSubdomainAwareEvent(e,this.handleUserProperties)}catch(e){De.debug("Error in userProperties event handler",e)}break;case wn.ContentProperties:try{this.handleContentProperties()}catch(e){De.debug("Error in contentProperties event handler",e)}break;default:throw new Error("Invalid event type")}}getDispatch(){return this.dispatch.bind(this)}finishServerWallInputBootstrap(){this.serverWallDeferInputsToColdLayer=!1}handleInit(){De.debug("init handler"),this.dispatch({type:wn.ContentProperties})}handleEnableAllFeatures(){if(De.info("âï¸ Received enableAllFeatures event"),Yt.mode.on(),this.store.setConsent(!0),window.sophi?.abTests?.enableConsent(),this.isSubdomain(Yt)&&!Yt.stateCookie.isEnabled)return!1;this.store.getFromStored();const e=this.processStoredEvents(),t=this.processHeldInputEvents();return Yi(),e||t}clearHeldInputEvents(){this.heldInputEvents=[]}processHeldInputEvents(){const e=this.heldInputEvents;return this.clearHeldInputEvents(),0!==e.length&&(e.forEach(e=>{De.debug("Event processed from in-memory queue",e),e.type===wn.Pageview&&this.handlePageview(e.payload),e.type===wn.Wall&&this.handleWallHit(e.payload),e.type===wn.UserProperties&&this.handleUserProperties(e.payload)}),!0)}handleGetDecision(){De.debug("getDecision event handler"),!0!==Yt.mode.isUserBehaviorDataAllowed||Yi()}handleGetDecisionForArticleWallIndicators(){De.debug("getDecisionForArticleWallIndicators event handler"),!0!==Yt.mode.isUserBehaviorDataAllowed||Yi()}handlePageview(e){De.info("ð§® Received pageview event",JSON.stringify(e,null,2));const{article:t,section:n}=e,r=this.store.getState();r.today.pageViews++,!0===t&&r.today.pageViewsByArticle++,"string"==typeof n&&n.length>0&&(!1===r.today.topLevelSections.includes(n)&&r.today.topLevelSections.push(n),!0===t&&!1===r.today.topLevelSectionsByArticle.includes(n)&&r.today.topLevelSectionsByArticle.push(n)),this.store.updateState(r)}handleWallHit(e){De.info("ð§® Received wall event",JSON.stringify(e,null,2));const t=this.store.getState(),n="string"==typeof e?e:e.wallType;"paywall"===n?t.today.pageViewsByArticleWithPaywall++:"regwall"===n&&t.today.pageViewsByArticleWithRegwall++,this.store.updateState(t),"object"==typeof e&&!0===Yt.generatePageviewOnWallHit&&(De.debug("Generating pageview from wall event"),this.handlePageview({article:!0,section:e.section}))}handleUserProperties(e){return Er(Yt,e)}handleContentProperties(){Un(Yt),Lr(Yt),De.debug("handleContentProperties handler",In(Yt))}processSubdomainEvents(){if(this.isSubdomain(Yt))return!1;const e=Xi();
1return 0!==e.length&&(e.forEach(e=>{De.debug("Event Processed from cookie",e),e.type===wn.Pageview?this.handlePageview(e.payload):e.type===wn.Wall?this.handleWallHit(e.payload):e.type===wn.UserProperties&&this.handleUserProperties(e.payload)}),document.cookie=`${Ki}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; domain=${Yt.hostname}; path=/`,!0)}processPreviousPageEvents(){let e=this.store.getState();const t=e.coldDataLayer.events;return 0!==t.length&&(t.forEach(e=>{De.debug("Event processed from storage",e),e.type===wn.Pageview&&this.handlePageview(e.payload),e.type===wn.Wall&&this.handleWallHit(e.payload),e.type===wn.UserProperties&&this.handleUserProperties(e.payload)}),e=this.store.getState(),this.store.updateState({...e,coldDataLayer:{...e.coldDataLayer,events:[]}}),!0)}processStoredEvents(){if(!1===Yt.mode.isUserBehaviorDataAllowed||!1===Yt.mode.isDeviceAndLocationDataAllowed)return!1;const e=this.processPreviousPageEvents();let t=!1;try{t=this.processSubdomainEvents()}catch(e){De.debug("Error processing subdomain events",e)}return e||t}handleSubdomainAwareEvent(e,t){if(this.isSubdomain(Yt)&&!Yt.stateCookie.isEnabled){try{const t=((e,t)=>{if(!0!==Yt.mode.isUserBehaviorDataAllowed)return!1;const n=Xi();return n.push({type:e,payload:t}),document.cookie=`${Ki}=${fe(n)}; domain=${Yt.hostname}; path=/; max-age=${Fe};`,!0})(e.type,e.payload);t&&De.debug(`Pushed ${e.type} event to cookie:`,e.payload)}catch(t){De.debug(`Error pushing ${e.type} event to cookie`,t)}return!1}return this.processOrStoreInputEvent(e,t)}storeInputEvent(e){const t=this.store.getState();return this.store.updateState({...t,coldDataLayer:{...t.coldDataLayer,events:[...t.coldDataLayer.events,e]}}),De.debug("Stored event",e),!0}processOrStoreInputEvent(e,t){return!0===Yt.mode.isUserBehaviorDataAllowed?(Yi(),"server"===Yt.wallGeneration.type&&this.serverWallDeferInputsToColdLayer?this.storeInputEvent(e):(t.call(this,e.payload),!0)):!0===Yt.holdInputEventsUntilConsent?(this.heldInputEvents.push(e),De.debug(`Holding ${e.type} event until consent`),!1):(De.debug(`Discarding ${e.type} event`),!1)}},to=eo;function no(e){return void 0!==e?{wallProperties:e}:{}}function ro(e){return e.replace(/[_-]+([a-zA-Z0-9])/g,(e,t)=>t.toUpperCase())}function io(e){if(void 0!==e.default&&Ge(e.default,e))return e.default}function oo(e){const t=Yt.wallProperties;if(void 0===t)return;const n=t.filter(e=>!1!==e.tracked).map(t=>{const n=e?.[ro(t.key)];return void 0===n?null:[t.key,n]}).filter(e=>null!==e);return 0===n.length?"":n.map(([e,t])=>`${e}:${t}`).join(",")}function so(e,t={}){if(void 0===Yt.wallProperties){const{wallProperties:t,outcome:n,...r}=e,{wallProperties:i,...o}=n;return{...r,outcome:o}}const n=function(){const e=new Map;for(const t of Yt.wallProperties||[])e.set(t.key,t),e.set(ro(t.key),t);return e}(),r={};for(const[t,i]of Object.entries(e.outcome.wallProperties??{})){const e=n.get(t);if(e){if(!Ge(i,e)){const n="enum"===e.type?`one of [${Ne(e).join(", ")}]`:e.type;De.debug(`Wall property ${t} expected ${n} but got ${typeof i}, omitting from outcome.`);continue}r[ro(e.key)]=i}else De.debug(`Wall property ${t} is not configured, omitting from outcome.`)}for(const[e,i]of Object.entries(t)){const t=n.get(e);if(t){if(!Ge(i,t)){const n="enum"===t.type?`one of [${Ne(t).join(", ")}]`:t.type;De.warn(`Wall property override ${e} expected ${n} but got ${typeof i}, omitting.`);continue}r[ro(t.key)]=i}else De.warn(`Wall property override ${e} is not configured, omitting.`)}return{...e,wallProperties:oo(r),outcome:{...e.outcome,wallProperties:r}}}const ao=.01,lo=1,co=e=>Math.min(Math.max(ao,e),lo),uo=e=>Math.round(100*e),po=`t005001`,yo="t006001",fo=/^t[01][012][234569]\d{3}$/,ho=/t[01][012]6001/;function mo(e){return ho.test(e)}const go=/t[01][012]([234569]\d{3})/g;function wo(e,t,n){return e.replace(go,(e,r)=>`t${t}${n}${r}`)}function vo(e){const t="wallType"in e?e.wallType:"paywall",n=ee[t],r=Q[e.wallVisibility];let i=0===r?X.nowall:X[t];const o=co(e.score),s=uo(o);let a=100===s?"xx":s.toString().padStart(2,"0");const l=uo(e.threshold);return`${n}${r}${i}${a}${100===l?"xx":l.toString().padStart(2,"0")}`}function bo(e){let t="";for(const n of e)t+=vo(n);return t}function Ao(e){if(void 0===e)return"--";const t=Math.round(100*e);return 100===t?"xx":t.toString().padStart(2,"0")}function ko(e,t,n,r){return`v${e}${t}${Ao(n)}${Ao(r)}`}function Po(e){return e.trim().toLowerCase().replace(/^www\./,"")}function So(e){return e.trim().toLowerCase()}function Do(e,t){const n=Po(t.hostname);return e.map((e,r)=>{const i=function(e){const t=e.trim();if(!t)return null;try{const e=new URL(/^[a-z][a-z\d+.-]*:\/\//i.test(t)?t:`https://${t}`);let n=e.search.slice(1);if(""!==e.pathname&&"/"!==e.pathname){if(n)return null;n=e.pathname.replace(/^\//,"")}return n?n.split("&").some(e=>e.indexOf("=")<=0)?null:{hostname:Po(e.hostname),parameters:Array.from(new URLSearchParams(n).entries())}:{hostname:Po(e.hostname),parameters:[]}}catch{return null}}(e.definition);return null!==i&&i.hostname===n&&function(e,t){return e.every(([e,n])=>{const r=t[e];if(void 0===r)return!1;const i=So(r);return n.split(",").some(e=>So(e)===i)})}(i.parameters,t.values)?{target:e,specificity:i.parameters.length,originalIndex:r}:null}).filter(e=>null!==e).sort((e,t)=>
vendor: 4,258 bytes, line 1
1t.specificity-e.specificity||t.originalIndex-e.originalIndex)}const xo="control";(new Date).toISOString();var Lo={724(e,t,n){var r;!function(i,o){var s="function",a="undefined",l="object",c="string",u="model",p="name",d="type",y="vendor",f="version",h="architecture",m="console",g="mobile",w="tablet",v="smarttv",b="wearable",A="embedded",k="Amazon",P="Apple",S="ASUS",D="BlackBerry",x="Browser",L="Chrome",E="Firefox",V="Google",_="Huawei",C="LG",T="Microsoft",$="Motorola",B="Opera",j="Samsung",O="Sharp",W="Sony",I="Xiaomi",U="Zebra",R="Facebook",M=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},N=function(e,t){return typeof e===c&&-1!==G(t).indexOf(G(e))},G=function(e){return e.toLowerCase()},q=function(e,t){if(typeof e===c)return e=e.replace(/^\s\s*/,""),typeof t===a?e:e.substring(0,350)},z=function(e,t){for(var n,r,i,a,c,u,p=0;p<t.length&&!c;){var d=t[p],y=t[p+1];for(n=r=0;n<d.length&&!c;)if(c=d[n++].exec(e))for(i=0;i<y.length;i++)u=c[++r],typeof(a=y[i])===l&&a.length>0?2===a.length?typeof a[1]==s?this[a[0]]=a[1].call(this,u):this[a[0]]=a[1]:3===a.length?typeof a[1]!==s||a[1].exec&&a[1].test?this[a[0]]=u?u.replace(a[1],a[2]):o:this[a[0]]=u?a[1].call(this,u,a[2]):o:4===a.length&&(this[a[0]]=u?a[3].call(this,u.replace(a[1],a[2])):o):this[a]=u||o;p+=2}},F=function(e,t){for(var n in t)if(typeof t[n]===l&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(N(t[n][r],e))return"?"===n?o:n}else if(N(t[n],e))return"?"===n?o:n;return e},Z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},H={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[p,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,f],[/opios[\/ ]+([\w\.]+)/i],[f,[p,B+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[p,B]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[p,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[p,"UC"+x]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[p,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[p,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[p,"IE"]],[/yabrowser\/([\w\.]+)/i],[f,[p,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure "+x],f],[/\bfocus\/([\w\.]+)/i],[f,[p,E+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[p,B+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[p,B+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[p,"MIUI "+x]],[/fxios\/([-\w\.]+)/i],[f,[p,E]],[/\bqihu|(qi?ho?o?|360)browser/i],[[p,"360 "+x]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 "+x],f],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[p,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,R],f],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[p,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[p,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[p,L+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,L+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[p,"Android "+x]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[p,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[f,F,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}
vendor: 4,513 bytes, line 1
1]],[/(webkit|khtml)\/([\w\.]+)/i],[p,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[p,E+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[p,f],[/(cobalt)\/([\w\.]+)/i],[p,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,G]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[h,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[h,"armhf"]],[/windows (ce|mobile); ppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[h,/ower/,"",G]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[h,G]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[y,j],[d,w]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[y,j],[d,g]],[/((ipod|iphone)\d+,\d+)/i],[u,[y,P],[d,g]],[/(ipad\d+,\d+)/i],[u,[y,P],[d,w]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[y,P],[d,g]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[y,P],[d,w]],[/(macintosh);/i],[u,[y,P]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[y,_],[d,w]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[y,_],[d,g]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[y,I],[d,g]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[y,I],[d,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[y,"OPPO"],[d,g]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[y,"Vivo"],[d,g]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[y,"Realme"],[d,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[y,$],[d,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[y,$],[d,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[y,C],[d,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[y,C],[d,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[y,"Lenovo"],[d,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[y,"Nokia"],[d,g]],[/(pixel c)\b/i],[u,[y,V],[d,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[y,V],[d,g]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[y,W],[d,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[y,W],[d,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[y,"OnePlus"],[d,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[y,k],[d,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[y,k],[d,g]],[/(playbook);[-\w\),; ]+(rim)/i],[u,y,[d,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[y,D],[d,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[y,S],[d,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[y,S],[d,g]],[/(nexus 9)/i],[u,[y,"HTC"],[d,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[y,[u,/_/g," "],[d,g]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[y,"Acer"],[d,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[y,"Meizu"],[d,g]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[y,O],[d,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asu
vendor: 4,378 bytes, line 1
1s)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[y,u,[d,g]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[y,u,[d,w]],[/(surface duo)/i],[u,[y,T],[d,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[y,"Fairphone"],[d,g]],[/(u304aa)/i],[u,[y,"AT&T"],[d,g]],[/\bsie-(\w*)/i],[u,[y,"Siemens"],[d,g]],[/\b(rct\w+) b/i],[u,[y,"RCA"],[d,w]],[/\b(venue[\d ]{2,7}) b/i],[u,[y,"Dell"],[d,w]],[/\b(q(?:mv|ta)\w+) b/i],[u,[y,"Verizon"],[d,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[y,"Barnes & Noble"],[d,w]],[/\b(tm\d{3}\w+) b/i],[u,[y,"NuVision"],[d,w]],[/\b(k88) b/i],[u,[y,"ZTE"],[d,w]],[/\b(nx\d{3}j) b/i],[u,[y,"ZTE"],[d,g]],[/\b(gen\d{3}) b.+49h/i],[u,[y,"Swiss"],[d,g]],[/\b(zur\d{3}) b/i],[u,[y,"Swiss"],[d,w]],[/\b((zeki)?tb.*\b) b/i],[u,[y,"Zeki"],[d,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[y,"Dragon Touch"],u,[d,w]],[/\b(ns-?\w{0,9}) b/i],[u,[y,"Insignia"],[d,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[y,"NextBook"],[d,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[y,"Voice"],u,[d,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[y,"LvTel"],u,[d,g]],[/\b(ph-1) /i],[u,[y,"Essential"],[d,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[y,"Envizen"],[d,w]],[/\b(trio[-\w\. ]+) b/i],[u,[y,"MachSpeed"],[d,w]],[/\btu_(1491) b/i],[u,[y,"Rotor"],[d,w]],[/(shield[\w ]+) b/i],[u,[y,"Nvidia"],[d,w]],[/(sprint) (\w+)/i],[y,u,[d,g]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[y,T],[d,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[y,U],[d,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[y,U],[d,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[y,u,[d,m]],[/droid.+; (shield) bui/i],[u,[y,"Nvidia"],[d,m]],[/(playstation [345portablevi]+)/i],[u,[y,W],[d,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[y,T],[d,m]],[/smart-tv.+(samsung)/i],[y,[d,v]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[y,j],[d,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[y,C],[d,v]],[/(apple) ?tv/i],[y,[u,P+" TV"],[d,v]],[/crkey/i],[[u,L+"cast"],[y,V],[d,v]],[/droid.+aft(\w)( bui|\))/i],[u,[y,k],[d,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[y,O],[d,v]],[/(bravia[\w ]+)( bui|\))/i],[u,[y,W],[d,v]],[/(mitv-\w{5}) bui/i],[u,[y,I],[d,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[y,q],[u,q],[d,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,v]],[/((pebble))app/i],[y,u,[d,b]],[/droid.+; (glass) \d/i],[u,[y,V],[d,b]],[/droid.+; (wt63?0{2,3})\)/i],[u,[y,U],[d,b]],[/(quest( 2)?)/i],[u,[y,R],[d,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[y,[d,A]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[d,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[d,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,g]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[y,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[p,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[p,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[p,[f,F,Z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,"Windows"],[f,F,Z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[p,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,"Mac OS"],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,p],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[p,f],[/\(bb(10);/i],[f,[p,D]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[p,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+);
1 rv:.+ gecko\/([\w\.]+)/i],[f,[p,E+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[p,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[p,L+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[p,"Chromium OS"],f],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,f],[/(sunos) ?([\w\.\d]*)/i],[[p,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[p,f]]},J=function(e,t){if(typeof e===l&&(t=e,e=o),!(this instanceof J))return new J(e,t).getResult();var n=e||(typeof i!==a&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),r=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(H,t):H;return this.getBrowser=function(){var e,t={};return t[p]=o,t[f]=o,z.call(t,n,r.browser),t.major=typeof(e=t.version)===c?e.replace(/[^\d\.]/g,"").split(".")[0]:o,t},this.getCPU=function(){var e={};return e[h]=o,z.call(e,n,r.cpu),e},this.getDevice=function(){var e={};return e[y]=o,e[u]=o,e[d]=o,z.call(e,n,r.device),e},this.getEngine=function(){var e={};return e[p]=o,e[f]=o,z.call(e,n,r.engine),e},this.getOS=function(){var e={};return e[p]=o,e[f]=o,z.call(e,n,r.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===c&&e.length>350?q(e,350):e,this},this.setUA(n),this};J.VERSION="0.7.33",J.BROWSER=M([p,f,"major"]),J.CPU=M([h]),J.DEVICE=M([u,y,d,m,g,v,w,b,A]),J.ENGINE=J.OS=M([p,f]),typeof t!==a?(e.exports&&(t=e.exports=J),t.UAParser=J):n.amdO?(r=function(){return J}.call(t,n,t,e))===o||(e.exports=r):typeof i!==a&&(i.UAParser=J);var Y=typeof i!==a&&(i.jQuery||i.Zepto);if(Y&&!Y.ua){var K=new J;Y.ua=K.getResult(),Y.ua.get=function(){return K.getUA()},Y.ua.set=function(e){K.setUA(e);var t=K.getResult();for(var n in t)Y.ua[n]=t[n]}}}("object"==typeof window?window:this)}},Eo={};function Vo(e){var t=Eo[e];if(void 0!==t)return t.exports;var n=Eo[e]={exports:{}};return Lo[e].call(n.exports,n,n.exports,Vo),n.exports}Vo.amdO={},Vo.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return Vo.d(t,{a:t}),t},Vo.d=(e,t)=>{for(var n in t)Vo.o(t,n)&&!Vo.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},Vo.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var _o={};Vo.d(_o,{Ay:()=>Oo,Hi:()=>Bo,Tc:()=>$o,vV:()=>jo});var Co=Vo(724),To=Vo.n(Co);const $o={console:0,mobile:1,tablet:2,smarttv:3,wearable:4,other:5},Bo=["type","os","viewer"],jo=function(e){try{const t=To()(e);return{viewer:void 0===t?.browser?.name?"":t.browser.name,type:void 0===t?.device?.type?"":t.device.type,os:void 0===t?.os?.name?"":t.os.name}}catch(e){return{viewer:"",type:"",os:""}}},Oo=jo,Wo=_o.Tc,Io=_o.Ay,Uo=function(){return Io(navigator.userAgent)};let Ro=()=>{};function Mo(){return function({hostname:e,subMarket:t,assignedGroup:n,isDeviceAndLocationDataAllowed:r,isUserBehaviorDataAllowed:i,getDevice:o,getCountryCode:s}){const a=e.trim().replace(/^www\./i,""),l={"experiment.assignedGroup":n??xo,"visitor.device.platform":"web"};if(r){const e=o();l["visitor.device.os"]=e.os,l["visitor.device.type"]=e.type,l["visitor.device.viewer"]=e.viewer}if(r&&i){const e=s();"string"==typeof e&&(l["userProperties.countryCode"]=e)}return{hostname:t?`${t.trim()}-${a}`:a,values:l}}({hostname:Yt.hostname,subMarket:Yt.subMarket,assignedGroup:Qt()?.assignedGroup,isDeviceAndLocationDataAllowed:!0===Yt.mode?.isDeviceAndLocationDataAllowed,isUserBehaviorDataAllowed:!0===Yt.mode?.isUserBehaviorDataAllowed,getDevice:Uo,getCountryCode:Ro})}const No=M.object({[G.PAYWALL]:M.number(),[G.REGWALL]:M.optional(M.number())}),Go=M.object({todayPageViews:M.number(),todayPageViewsByArticle:M.number(),todayPageViewsByArticleWithPaywall:M.number(),todayPageViewsByArticleWithRegwall:M.number(),todayTopLevelSections:M.number(),todayTopLevelSectionsByArticle:M.number(),sevenDayPageViews:M.number(),sevenDayPageViewsByArticle:M.number(),sevenDayPageViewsByArticleWithPaywall:M.number(),sevenDayPageViewsByArticleWithRegwall:M.number(),sevenDayTopLevelSections:M.number(),sevenDayTopLevelSectionsByArticle:M.number(),sevenDayVisitCount:M.number(),twentyEightDayPageViews:M.number(),twentyEightDayPageViewsByArticle:M.number(),twentyEightDayPageViewsByArticleWithPaywall:M.number(),twentyEightDayPageViewsByArticleWithRegwall:M.number(),twentyEightDayTopLevelSections:M.number(),twentyEightDayTopLevelSectionsByArticle:M.number(),twentyEightDayVisitCount:M.number(),daysSinceLastVisit:M.number(),timeZone:M.string(),referrer:M.string(),referrerData:M.object({medium:M.union([M.string(),M.null_()]),source:M.optional(M.union([M.string(),M.null_()])),channel:M.optional(M.union([M.string(),M.null_()])),queryParams:M.record(M.string(),M.string())}),hourOfDay:M.number(),localDayOfWeek:M.number(),localHourOfDay:M.number(),os:M.string(),type:M.string(),viewer:M.string(),visitorType:M.string(),visitor:Ui,userProperties:M.record(Mi,Ni),contentProperties:M.record(je,Oe)});function qo(e){return M.safeParse(Go,e).success}const zo=new class{constructor(){this.fallback={[G.PAYWALL]:0},this.errorTrace="",this.experiences=[]}setModels(e){this.experiences=e?.experiences??[]}getEvaluator(){const e=Mo(),t=Do(this.experiences,e),n=t.find(e=>e.specificity>0)?.target??t.find(e=>0===e.specificity)?.target;return n?.evaluator}evaluate(e){this.errorTrace="";try{let t;if(function(e){return"todayPageViews"in e}(e)){const n=this.getEvaluator();if(!n)throw new Error("No model evaluator matches the current experience.");t=n(e)}else t=function(){let e=Math.random();return e<=.1?e=.1:e>=1&&(e=.99),{[G.PAYWALL]:e}}();return M.parse(No,t)}catch(t){return De.debug("Model evaluator failed, using fallback.",e,t),un(en.ModelEvalFailed),this.errorTrace=yo,this.fallback}}},Fo=zo,Zo=M.object({id:M.string(),outcome:pe,createdAt:M.string(),trace:M.string()});function Ho(e){return null!=e&&("string"!=typeof e||""!==e)}function Jo(e,t){switch(e.source){case"device":case"visit":case"modelInputs":return t[e.key];case"contentProperties":return t.contentProperties[e.key];case"userProperties":return t.userProperties[e.key];default:return void De.warn(`Unknown dataMap source: ${e.source}`)}}const Yo={xhigh:5,high:4,medium:3,low:2,xlow:1,null:null}
1,Ko=(Array.from(Object.keys(Yo)),Array.from(Object.values(Yo))),Xo=(M.union([...Ko.filter(e=>null!==e).map(e=>M.literal(e)),M.null_()]),Ko.filter(e=>null!==e).reverse()),Qo=`Unknown content propensity level. Expected one of: ${Xo.join(", ")}.`,es=M.pipe(M.union([M.string(),M.number()]),M.transform(Number),M.number(),M.picklist(Xo));function ts(e){const t=e.find(e=>e.wallType===G.PAYWALL),n={[G.PAYWALL]:t?.score},r=e.find(e=>e.wallType===G.REGWALL);return void 0!==r&&(n[G.REGWALL]=r.score),n}const ns=M.object({paywall:M.object({anonymous:M.number(),registered:M.number()}),regwall:M.optional(M.number())}),rs=M.pipe(M.record(M.string(),M.number()),M.custom(e=>{const t=new Set(["1","2","3","4","5"]),n=Object.entries(e);if(0===n.length)return!1;for(const[e,r]of n){if(!t.has(e))return!1;if(r<0||r>1)return!1}return!0},"Invalid level mapping format. Expected an object with keys '1'-'5' and values between 0 and 1")),is=M.object({paywall:M.object({anonymous:rs,registered:rs}),regwall:M.optional(rs)}),os=M.union([M.object({userLevels:is}),M.object({user:ns}),M.object({userLevels:is,user:ns}),M.object({userFallback:ns}),M.object({user:ns,userFallback:ns}),M.object({userLevels:is,userFallback:ns}),M.object({userLevels:is,user:ns,userFallback:ns})]),ss=M.object({thresholds:os}),as=M.object({definition:M.string(),policy:ss});M.pipe(M.object({experiences:M.array(as)}),M.check(e=>e.experiences.length>0,"At least one experience is required"));var ls=(e=>(e["User"]="user",e["UserLevels"]="userLevels",e["UserFallback"]="userFallback",e))(ls||{});let cs;const us=Object.freeze({paywall:Object.freeze({anonymous:1,registered:1}),regwall:1});function ps(e,t){return Do(e,t).find(e=>e.specificity>0)?.target??null}function ds(e){const t=(cs?.experiences??[]).filter(t=>function(e,t){return t in e.policy.thresholds}(t,e)),n=Mo(),r=n.values["experiment.assignedGroup"];let i=ps(t,n);return null===i&&r!==xo&&(i=ps(t,{...n,values:{...n.values,"experiment.assignedGroup":xo}})),i??=function(e,t){return Do(e,t).find(e=>0===e.specificity)?.target??null}(t,n),null!==i?function(e,t){switch(t){case ls.UserLevels:return ls.UserLevels in e?e.userLevels:null;case ls.UserFallback:return ls.UserFallback in e?e.userFallback:null;case ls.User:return ls.User in e?e.user:null}}(i.policy.thresholds,e):e===ls.UserFallback?(De.warn("No userFallback thresholds found, using open-access defaults."),us):null}
1class ys extends Error{constructor(e){super(e),this.name="AbortError"}}async function fs(e,t){const n=function(e,t,n){const r=`/hosts/${e.host}/decisions/me`,i=new URL(e.url+r);return i.search=t.toString(),new Request(i,{signal:n})}(e,t,function(e){const t=new AbortController,n=t.signal;return setTimeout(()=>{t.abort(new ys(`Request exceeded ${e.toLocaleString()}ms`))},e),n}(e.timeout));try{return async function(e){!function(e){if(!e.ok)throw De.debug(`Response: ok: ${e.ok}, status: ${e.status}, status text: ${e.statusText}`),e}(e);const t=await e.json(),n=M.parse(Zo,t);return{id:n.id,createdAt:n.createdAt,trace:n.trace,outcome:n.outcome}}(await fetch(n))}catch(e){return function(e){throw e instanceof Error&&De.debug("Decision request error",e.name,e.message),De.debug({err:e}),e}(e)}}async function hs(e,t,n,r){try{const r=await async function(e,t,n){if(!e.paywallApi)throw new Error("Paywall API configuration is missing");const r=In(e)["content.id"];if(!r){const e=new Error("No value for 'content.id', aborting decision call");throw e.name="ContentIdError",e}const i=new URLSearchParams(n);if(i.append("content.id",String(r)),i.append("visitor.type",t.modelInputs.visitorType),qo(t.modelInputs)){const n=function(e,t){const n=new URLSearchParams;for(const[r,i]of Object.entries(e)){const e=Jo(i,t);Ho(e)?n.append(r,String(e)):De.debug(`Skipping dataMap parameter "${r}", value is: ${e}`)}return n}(e.paywallApi.dataMap,t.modelInputs);for(const[e,t]of n.entries())ze.has(e)||i.append(e,t)}return un(en.ApiInitiated),await fs(e.paywallApi,i)}(e,t,n.searchParams);un(en.ApiCompleted),void 0!==r.outcome.wallProperties&&void 0===n.outcome.wallProperties&&(Object.keys(r.outcome.wallProperties).length>0&&De.debug("Wall properties not configured but returned by API, discarding:",r.outcome.wallProperties),delete r.outcome.wallProperties);const i=void 0!==n.outcome.wallProperties||void 0!==r.outcome.wallProperties?{...n.outcome.wallProperties??{},...r.outcome.wallProperties??{}}:void 0,o={id:r.id,createdAt:r.createdAt,trace:r.trace,outcome:{...r.outcome,...no(i)}};return De.debug("Enhanced with server decision",o),o}catch(i){return function(e,t,n,r,i){e instanceof Error&&"AbortError"===e.name?un(en.ApiTimeout):e instanceof Error&&"TypeError"===e.name&&un(en.ApiNetworkError);let o="No server decision";if(e instanceof Error&&(o+=`: ${e.message}`),De.warn(o),De.debug({err:e}),!t.paywallApi)throw new Error("Paywall API configuration is missing");const s=function(e,t,n,r,i,o){const s=ds(ls.UserFallback);let a="";o&&void 0!==i&&(a=((e,t)=>{let n="t";return e instanceof Error&&"AbortError"===e.name?(n+="002",n+=Math.round(t/10)):e instanceof Error&&"TypeError"===e.name?n+="003001":e instanceof Error&&"ContentIdError"===e.name?n+="00401":e&&e instanceof Response?n+="003"+e.status:n+="009000",n=n.substring(0,7).padEnd(7,"0"),n})(o,i));const l=ts(n),c="subscribed"===(u=t.visitorType)?"registered":u;var u;const p=function(e,t,n){const r=e[G.PAYWALL],i=e[G.REGWALL],o=t.paywall[n],s=t.regwall;return r>=o?{wallType:G.PAYWALL,wallVisibility:q,wallVisibilityCode:Q.always,wallTypeCode:X.paywall}:void 0!==i&&void 0!==s&&i>=s?{wallType:G.REGWALL,wallVisibility:q,wallVisibilityCode:Q.always,wallTypeCode:X.regwall}:{wallVisibility:z,wallVisibilityCode:Q.never}}(l,s,c),d=[];for(const e of Object.values(G)){const t=l[e];if(void 0!==t){const n=e===G.PAYWALL?s.paywall[c]:s.regwall;if(void 0===n)continue;const r={score:t,threshold:n,wallVisibility:p.wallVisibility===q&&p.wallType===e?q:z,wallType:e};d.push(r)}}const y=bo(d),f=p.wallVisibilityCode,h="wallTypeCode"in p?p.wallTypeCode:X.nowall;let m,g;if("wallType"in p){const e=p.wallType;m=l[e],g=e===G.PAYWALL?s.paywall[c]:s.regwall}const w=ko(f,h,m,g),v={...e,trace:a+w+y,outcome:{...p,...no(e.outcome.wallProperties)}};return De.debug(`API fallback decision:`,v),v}(n,{visitorType:r.modelInputs.visitorType,assignedGroup:n.experiment?.assignedGroup},i,0,t.paywallApi.timeout,e);return{id:n.id,createdAt:n.createdAt,trace:s.trace,outcome:s.outcome}}(i,e,n,t,r.outcomes)}}class ms{constructor(){this.pageViews=0,this.pageViewsByArticle=0,this.pageViewsByArticleWithPaywall=0,this.pageViewsByArticleWithRegwall=0,this.topLevelSections=0,this.topLevelSectionsByArticle=0,this.visitCount=0}}function gs(e=new Date){return 2*Math.floor(e.getUTCHours()/2)}function ws(e=new Date){return 2*Math.floor(e.getHours()/2)}function vs(e=new Date){return e.getDay()}function bs(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return""}}const As=1,ks=8,Ps=29,Ss={todayPageViews:10,todayPageViewsByArticle:10,todayPageViewsByArticleWithPaywall:10,todayPageViewsByArticleWithRegwall:10,todayTopLevelSections:10,todayTopLevelSectionsByArticle:10,sevenDayPageViews:15,sevenDayPageViewsByArticle:15,sevenDayPageViewsByArticleWithPaywall:15,sevenDayPageViewsByArticleWithRegwall:15,sevenDayTopLevelSections:15,sevenDayTopLevelSectionsByArticle:15,sevenDayVisitCount:10,twentyEightDayPageViews:99,twentyEightDayPageViewsByArticle:60,twentyEightDayPageViewsByArticleWithPaywall:60,twentyEightDayPageViewsByArticleWithRegwall:60,twentyEightDayTopLevelSections:20,twentyEightDayTopLevelSectionsByArticle:20,twentyEightDayVisitCount:30,daysSinceLastVisit:5};function Ds(e,t){return Object.entries(e).reduce((e,[n,r])=>({...e,[`${t}${n[0].toUpperCase()}${n.slice(1)}`]:r}),{})}const xs=function(e,t,n){if(!1===Yt.mode.isDeviceAndLocationDataAllowed&&!1===Yt.mode.isDeviceAndLocationDataAllowed)return{visitorType:t.visitor};const{durations:[r,i,o],daysSinceLastVisit:s}=function(e,t){const n=[e.today,...e.history],r=n.length,i=Math.min(r,Math.max(...t));let o=[],s=new ms,a=0,l=new Set,c=new Set;for(let e=0;e<i;e++){const r=n[e];s.pageViews=s.pageViews+r.pageViews,s.pageViewsByArticle=s.pageViewsByArticle+r.pageViewsByArticle,s.pageViewsByArticleWithPaywall=s.pageViewsByArticleWithPaywall+r.pageViewsByArticleWithPaywall,s.pageViewsByArticleWithRegwall=s.pageViewsByArticleWithRegwall+r.pageViewsByArticleWithRegwall;for(const e of r.topLevelSections)l.has(e)||l.add(e);
1s.topLevelSections=l.size;for(const e of r.topLevelSectionsByArticle)c.has(e)||c.add(e);s.topLevelSectionsByArticle=c.size,r.pageViews>0&&(s.visitCount++,e>0&&0===a&&(a=e)),t.includes(e+1)&&(o.push({...s}),s=new ms,l=new Set,c=new Set)}if(o.length<t.length)for(let e=o.length;e<t.length;e++)o.push({...s});return{durations:o,daysSinceLastVisit:a}}(t,[As,ks,Ps]),{visitCount:a,...l}=r,c=n?.assignedGroup||null,u=Gr(),p=_r(),d=new Date,y=function(e,t={}){return Xn(e).reduce((e,[n,r])=>{if("number"==typeof r){const i=n in t?t[n]:null;e[n]="number"==typeof i?Math.min(r,i):r}else e[n]=r;return e},{})}({...Ds(l,"today"),...Ds(i,"sevenDay"),...Ds(o,"twentyEightDay"),...Uo(),timeZone:bs(),referrer:u.medium,referrerData:{...u,queryParams:p},daysSinceLastVisit:s,visitorType:t.visitor,hourOfDay:gs(d),localDayOfWeek:vs(d),localHourOfDay:ws(d),assignedGroup:c,userProperties:e.userProperties,contentProperties:In(Yt)},Ss);return y.visitor=e.visitor,y};function Ls(e){switch(e){case X.paywall:return{wallType:G.PAYWALL,wallTypeCode:e,wallVisibility:q,wallVisibilityCode:Q.always};case X.regwall:return{wallType:G.REGWALL,wallTypeCode:e,wallVisibility:q,wallVisibilityCode:Q.always};default:return{wallVisibility:z,wallVisibilityCode:Q.never}}}function Es(e,t,n,r){return{wallType:e,wallVisibility:t?q:z,score:n??0,threshold:r??0}}function Vs(e,t,n,r,i){const o=((e,t,n)=>e.trace&&!fo.test(e.trace)?{...e}:((e,t,n)=>{const r=ts(n),i=r[G.PAYWALL],o=r[G.REGWALL]??null,s=ds(ls.User);if(!s)return{...e,outcome:{...Ls(X.nowall),...no(e.outcome.wallProperties)},trace:po+ko(Q.never,X.nowall,i,void 0)};const a=t.visitorType===H?Z:t.visitorType,l=s.paywall[a],c=a===F?s.regwall:void 0,u=void 0!==c&&null!==o;let p;p=Ls(i>=l?X.paywall:u&&o>=c?X.regwall:X.nowall),p={...p,...no(e.outcome.wallProperties)};let d=e.trace;const y=[],f="wallType"in p&&p.wallType===G.PAYWALL,h="wallType"in p&&p.wallType===G.REGWALL;return u&&y.push(Es(G.REGWALL,h,o,c)),y.push(Es(G.PAYWALL,f,i,l)),d+=bo(y),{...e,outcome:p,trace:d}})(e,t,n))(e,t,n),s=mo(e.trace)&&!mo(o.trace)?yo+o.trace:o.trace,a=o.outcome.wallVisibilityCode,l="wallTypeCode"in o.outcome?o.outcome.wallTypeCode:X.nowall;return{...o,trace:wo(s,a,l)}}const _s={daysSinceLastVisit:"DA",todayPageViews:"AA",todayPageViewsByArticle:"AB",todayPageViewsByArticleWithPaywall:"AC",sevenDayPageViews:"BA",sevenDayPageViewsByArticle:"BB",sevenDayPageViewsByArticleWithPaywall:"BC",todayTopLevelSections:"AD",todayTopLevelSectionsByArticle:"AE",sevenDayTopLevelSections:"BD",sevenDayTopLevelSectionsByArticle:"BE",sevenDayVisitCount:"BF",todayPageViewsByArticleWithRegwall:"AF",sevenDayPageViewsByArticleWithRegwall:"BG",twentyEightDayPageViews:"CA",twentyEightDayPageViewsByArticle:"CB",twentyEightDayPageViewsByArticleWithPaywall:"CC",twentyEightDayTopLevelSections:"CD",twentyEightDayTopLevelSectionsByArticle:"CE",twentyEightDayVisitCount:"CF",twentyEightDayPageViewsByArticleWithRegwall:"CG"},Cs={experimentId:"HA",assignedGroup:"HB",visitorType:"FA",referrer:"DC",pageReferrerMedium:"DE",pageReferrerSource:"DF",pageReferrerChannel:"DG",os:"EA",type:"EB",viewer:"EC",hourOfDay:"DD",localDayOfWeek:"DH",localHourOfDay:"DI",timeZone:"DB",campaignName:"GA",referrerDomain:"GB",referrerMedium:"GC",referrerSource:"GD",referrerChannel:"GE"},Ts={medium:{alias:Cs.pageReferrerMedium,codes:Rr},source:{alias:Cs.pageReferrerSource,codes:Mr},channel:{alias:Cs.pageReferrerChannel,codes:Ur}};function $s(e){if("timeZone"in e){const t=e.timeZone;if(t)return[Cs.timeZone+":"+t]}return[]}function Bs(e){if("referrer"in e){const t=e.referrer;if(t){const e=Rr[t].toString().padStart(2,"0");return[Cs.referrer+":"+e]}}return[]}function js(e,t){return function(e,t,n,r){if("referrerData"in e&&e.referrerData&&t in e.referrerData){const i=e.referrerData[t];if(i&&i in r)return[n+":"+r[i].toString().padStart(2,"0")]}return[]}(e,t,Ts[t].alias,Ts[t].codes)}function Os(e){if("os"in e){const t=e.os;if(t)return[Cs.os+":"+t]}return[]}function Ws(e){if("type"in e){const t=e.type;if(t&&t in Wo){const e=Wo[t].toString().padStart(2,"0");return[Cs.type+":"+e]}}return[]}
1function Is(e){if("viewer"in e){const t=e.viewer;if(t)return[Cs.viewer+":"+t]}return[]}const Us={anonymous:0,registered:1,subscribed:2};function Rs(e){const t=e.visitorType;if(t&&t in Us){const e=Us[t].toString().padStart(2,"0");return[Cs.visitorType+":"+e]}return[]}function Ms(e){if("hourOfDay"in e){const t=e.hourOfDay;if(void 0!==t)return[Cs.hourOfDay+":"+t]}return[]}function Ns(e){if("localDayOfWeek"in e){const t=e.localDayOfWeek;if(void 0!==t)return[Cs.localDayOfWeek+":"+t]}return[]}function Gs(e){if("localHourOfDay"in e){const t=e.localHourOfDay;if(void 0!==t)return[Cs.localHourOfDay+":"+t]}return[]}function qs(e){if("visitor"in e){const t=e.visitor.session,n=["campaignName","referrerDomain","referrerMedium","referrerSource","referrerChannel"],r={referrerSource:Mr,referrerChannel:Ur};return Xn(t).reduce((e,[t,i])=>{let o;return o=t in r?function(e,t){return e in t?t[e].toString().padStart(2,"0"):null}(i,r[t]):i,o&&n.includes(t)&&e.push(Cs[t]+":"+o),e},[])}return[]}const zs={aa:"0",ab:"1"},Fs={control:"1",variant:"2",holdout:"3"};function Zs(e){if(e){const t=/[a-z:_-\d]*test(\d)_(a(?:a|b))$/,n=e.experimentId.match(t);let r="9",i="9",o=function(e){return Fs[e.assignedGroup]||"9"}(e);if(n){i=n[1];const e=n[2];r=zs[e]}return[Cs.experimentId+":"+r+i,Cs.assignedGroup+":"+o]}return[]}const Hs=new Uint8Array(16),Js=[];for(let e=0;e<256;++e)Js.push((e+256).toString(16).slice(1));const Ys=function(e,t,n){return t||e||!crypto.randomUUID?function(e,t,n){const r=(e=e||{}).random??e.rng?.()??crypto.getRandomValues(Hs);if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){if((n=n||0)<0||n+16>t.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(Js[e[t+0]]+Js[e[t+1]]+Js[e[t+2]]+Js[e[t+3]]+"-"+Js[e[t+4]]+Js[e[t+5]]+"-"+Js[e[t+6]]+Js[e[t+7]]+"-"+Js[e[t+8]]+Js[e[t+9]]+"-"+Js[e[t+10]]+Js[e[t+11]]+Js[e[t+12]]+Js[e[t+13]]+Js[e[t+14]]+Js[e[t+15]]).toLowerCase()}(r)}(e,t,n):crypto.randomUUID()},Ks=M.optional(M.object({visitor:M.optional(J)}));function Xs(e){if(!Yt.showPaywallScore)return;const t=e.outcomes[0];return t?uo(co(t.score)):void 0}function Qs(e){if(De.debug("Decision override:",ke.override),ke.override){De.debug("âï¸ Decision override",ke.override);let t=e.outcome;return ke.override.outcome&&(t={...t,...ke.override.outcome}),{...e,...ke.override,outcome:t}}return e}function ea(e){window.sophi=null===e?{...window.sophi,quickStart:{}}:{...window.sophi,quickStart:{decision:e}}}function ta(e,t){if(t.addTracingToLocalStorage.enabled&&e){const{inputs:n,context:r,trace:i}=e;localStorage.setItem(t.addTracingToLocalStorage.key,JSON.stringify({inputs:n,context:r,trace:i}))}}function na(e){return"always"===e.outcome.wallVisibility?"paywall"===e.outcome.wallType?"paywall":"regwall":"no-wall"}const ra=e=>{M.parse(Ks,e);const t=(e=>{try{if(!1===e.metaValues.visitorType)return null;const{selector:t,attribute:n,expression:r}=e.metaValues.visitorType,i=document.querySelector(t),o=i?.getAttribute(n)?.trim();if(!o)return null;const s=Pn(t,n,r),a=M.safeParse(J,s);return a.success?a.output:null}catch(e){return null}})(Yt),n=vr.getState().visitor,r=(({argsVisitor:e,metaVisitor:t,storedVisitor:n})=>e||t||n||"anonymous")({argsVisitor:e?.visitor,metaVisitor:t,storedVisitor:n});return vr.updateState({...vr.getState(),visitor:r}),{visitor:r}};function ia(e,t){return"registered"===e&&"always"===t.outcome.wallVisibility&&"regwall"===t.outcome.wallType&&(t.outcome={wallVisibility:"never",wallVisibilityCode:0,...no(t.outcome.wallProperties)}),t}async function oa(e,t,n){const{experiment:r,modelInputs:i,internalExperiment:o}=e;r&&De.info("𧪠Experiment",JSON.stringify(r,null,2)),De.debug("Model inputs",i);const s=function(e){let t="";if(qo(e)){const n={daysSinceLastVisit:e.daysSinceLastVisit,todayPageViews:e.todayPageViews,todayPageViewsByArticle:e.todayPageViewsByArticle,todayPageViewsByArticleWithPaywall:e.todayPageViewsByArticleWithPaywall,sevenDayPageViews:e.sevenDayPageViews,sevenDayPageViewsByArticle:e.sevenDayPageViewsByArticle,sevenDayPageViewsByArticleWithPaywall:e.sevenDayPageViewsByArticleWithPaywall,todayTopLevelSections:e.todayTopLevelSections,todayTopLevelSectionsByArticle:e.todayTopLevelSectionsByArticle,sevenDayTopLevelSections:e.sevenDayTopLevelSections,sevenDayTopLevelSectionsByArticle:e.sevenDayTopLevelSectionsByArticle,sevenDayVisitCount:e.sevenDayVisitCount,todayPageViewsByArticleWithRegwall:e.todayPageViewsByArticleWithRegwall,sevenDayPageViewsByArticleWithRegwall:e.sevenDayPageViewsByArticleWithRegwall,twentyEightDayPageViews:e.twentyEightDayPageViews,twentyEightDayPageViewsByArticle:e.twentyEightDayPageViewsByArticle,twentyEightDayPageViewsByArticleWithPaywall:e.twentyEightDayPageViewsByArticleWithPaywall,twentyEightDayTopLevelSections:e.twentyEightDayTopLevelSections,twentyEightDayTopLevelSectionsByArticle:e.twentyEightDayTopLevelSectionsByArticle,twentyEightDayVisitCount:e.twentyEightDayVisitCount,twentyEightDayPageViewsByArticleWithRegwall:e.twentyEightDayPageViewsByArticleWithRegwall};t=Object.keys(n).reduce((e,t)=>
1`${e}${_s[t]+n[t].toString().padStart(2,"0")}`,"")}return t}(i),a=function(e,t){return[...Zs(t),...Rs(e),...Bs(e),...js(e,"medium"),...js(e,"source"),...js(e,"channel"),...Os(e),...Ws(e),...Is(e),...Ms(e),...Ns(e),...Gs(e),...$s(e),...qs(e)].join("|")}(i,o),l=(e=>{if(!e||0===Object.keys(e).length)return"";const t=(Yt.userProperties||[]).filter(e=>!1!==e.tracked).map(e=>e.key);return 0===t.length?"":Xn(e).filter(([e])=>t.includes(e)).map(([e,t])=>`${(e=>Pr[e]||e)(e)}:${t}`).join(",")})(Fa.state.userProperties),c=function(){const e=Yt.wallProperties;if(void 0===e)return;const t={};for(const n of e){const e=io(n);void 0!==e&&(t[ro(n.key)]=e)}return t}(),u=oo(c),p=function(e){return e.contentProperties&&e.contentProperties.length>0?function(e){return null===Wn.analyticsString&&Un(e),Wn.analyticsString}(e):""}(t);n&&n({context:s,inputs:a,userProperties:l,contentProperties:p,...no(u),experiment:r});const d=Fo.evaluate(i),y=Fo.errorTrace;De.debug("Model output",d);const f=function(e,t){const n=new URLSearchParams;return e&&n.append("modelTrace",e),t&&(n.append("experiment.id",t.experimentId),n.append("experiment.assignedGroup",t.assignedGroup)),n.toString()}(function(e){const t="-";let n="";for(const r in e){const i=e[r],o=ee[r],s=t,a=t;if(void 0===i)continue;const l=Math.round(100*i);n+=`${o}${s}${a}${100===l?"xx":l.toString().padStart(2,"0")}${t+t}`}return n}(d),o);let h=Ys(),m=(new Date).toISOString();const g=function(e){return{wallVisibility:"never",outcomes:Object.values(G).filter(t=>t in e&&"number"==typeof e[t]).map(t=>({wallType:t,score:e[t],threshold:0,wallVisibility:"never"}))}}(d);let w=function(e,t){return"always"===e.wallVisibility?{wallType:e.wallType,wallTypeCode:X[e.wallType],wallVisibility:e.wallVisibility,wallVisibilityCode:Q[e.wallVisibility],...no(t)}:{wallVisibility:e.wallVisibility,wallVisibilityCode:Q[e.wallVisibility],...no(t)}}(g,c),v=y;if(t.paywallApi){const n=await hs(t,e,{id:h,createdAt:m,trace:v,context:s,inputs:a,outcome:w,searchParams:f,userProperties:l,...no(u),contentProperties:p,...void 0!==Xs(g)?{paywallScore:Xs(g)}:{},experiment:r},g);({id:h,createdAt:m,trace:v,outcome:w}=n),y&&!mo(v)&&(v=y+v)}const b=Xs(g),A={id:h,createdAt:m,trace:v,context:s,inputs:a,outcome:w,searchParams:f,userProperties:l,...no(u),contentProperties:p,...void 0!==b?{paywallScore:b}:{},experiment:r};return De.debug("Base decision made:",A),{decision:A,outcomes:g.outcomes}}const sa=new class{constructor({config:e}){this.config=e,this.onDevice=null,this.server=null,this.cold=null}async makeParams(){const e=await Xt(),t=await Qt();return{modelInputs:xs(Fa.state,vr.getState(),t),experiment:e,internalExperiment:t}}async getCached(){const e=await this.makeParams();return null===this.onDevice&&(this.onDevice=oa(e,this.config)),null===this.server&&(this.server=this.onDevice),(await this.server).decision}async updateCache(e){const t=await this.makeParams();return function(e){return Boolean(e.experiment||e.internalExperiment)}(t)&&un(en.TestAssigned),this.onDevice=oa(t,this.config,e),this.server=this.onDevice,await this.server}}({config:Yt});function aa(){window.sophi.quickStart.decision=void 0,yn(),Wn.values=null,Wn.analyticsString=null}function la(e){if(!to.isSubdomain(Yt)||Yt.stateCookie.isEnabled){const t=e.getState(),n=t.coldDataLayer,{previous:r,outcomes:i}=n;if(r&&Object.keys(r).length>1){const o=so(Vs(r,{visitorType:t.visitor,assignedGroup:r.experiment?.assignedGroup},i));return ea(o),ta(o,Yt),mn(o),e.updateState({...t,coldDataLayer:{...t.coldDataLayer,previous:void 0,outcomes:[]}}),n}}return null}function ca(e){return e&&(sa.cold=(async()=>({decision:e.previous,outcomes:e.outcomes||[]}))()),ra(),sa.updateCache(da).then(ha)}let ua=null,pa=!1;function da(e){if("client"===Yt.wallGeneration.type&&!Yt.enableWallIndicators){const{trace:t,...n}=e;mn(n)}return e}function ya(e,t,n){const r=e.getState();e.updateState({...r,coldDataLayer:{...r.coldDataLayer,previous:t,outcomes:n}}),function(e){if(!0===Yt.cookie.isEnabled&&!0===Yt.mode.isDeviceAndLocationDataAllowed&&!0===Yt.mode.isUserBehaviorDataAllowed&&(!to.isSubdomain(Yt)||Yt.stateCookie.isEnabled)){const t=Yt.cookie.name,n=Yt.hostname,r=Yt.cookie.maxAge,i="/";let o=e.searchParams;if(Yt.cookie.includeOutcome){o.length&&(o+="&"),o+="outcome.wallVisibility="+e.outcome.wallVisibility,"always"===e.outcome.wallVisibility&&(o+="&outcome.wallType="+e.outcome.wallType);const t=e.outcome.wallProperties;t&&Object.keys(t).length&&(o+=`&outcome.wallProperties=${encodeURIComponent(JSON.stringify(t))}`)}document.cookie=`${t}=${o}
1; domain=${n}; path=${i}; max-age=${r};`}}(t)}async function fa(e){e.clearHeldInputEvents(),function(){if(tn=performance.now(),!window.sophi?.demeter)return;cn(),rn="";const e=window,t=window.sophi.demeter;an(e,"sophiInitStatus",rn),an(t,"initStatus",rn)}(),aa(),e.dispatch({type:wn.ContentProperties});const t=la(vr);t&&gn(),e.processStoredEvents(),await ca(t)}const ha=e=>{const t=e.decision,{visitor:n}=ra(),r=so(Qs(ia(n,Vs(t,{visitorType:n,assignedGroup:t.experiment?.assignedGroup},e.outcomes))));return De.debug("Policy decision",r),"client"===Yt.wallGeneration.type&&!1===Yt.enableWallIndicators?(ea(r),ta(r,Yt),mn(r),gn()):"client"===Yt.wallGeneration.type&&!0===Yt.enableWallIndicators?(null===sa.cold&&(ea(r),ta(r,Yt),mn(r),gn()),ya(vr,r,e.outcomes)):"server"===Yt.wallGeneration.type&&(null===sa.cold&&(sa.cold=(async()=>({decision:await sa.getCached(),outcomes:e.outcomes}))(),gn()),ya(vr,r,e.outcomes)),un(en.DecisionAvailable),r},ma=async e=>{{De.info("𧮠Received getDecision event",e);const{visitor:t}=ra(e);to.dispatch({type:wn.GetDecision});const n=await(sa.cold?.then(e=>e.decision))||await sa.getCached(),r=(await sa.cold)?.outcomes??(await sa.server)?.outcomes,i=so(Qs(ia(t,Vs(n,{visitorType:t,assignedGroup:n.experiment?.assignedGroup},r))));return De.debug("Policy decision",i),De.info("𪧠Decision:",na(i)),i}};async function ga(e){!1===Yt.enableWallIndicators&&De.warn("getDecisionForArticleWallIndicators was called but wall indicators are not enabled. Using current decision."),De.info("𧮠Received getDecisionForArticleWallIndicators event",e),to.dispatch({type:wn.GetDecisionForArticleWallIndicators});const{visitor:t}=ra(),n=await sa.getCached();ia(t,n),(e=>{if(void 0===e)return null;const t=M.safeParse(es,e);t.success?t.output:De.warn(Qo,`Received:`,e)})(e?.contentPropensityLevel);const r=so(Qs(Vs(n,{visitorType:t,assignedGroup:n.experiment?.assignedGroup},(await sa.server).outcomes)));return De.info("𪧠Decision for next page:",na(r)),r}const wa=function(){const{context:e,inputs:t,trace:n,experimentsCode:r,assignedGroup:i}=fn(),o={context:e,inputs:t,trace:n,experimentsCode:r,assignedGroup:i};return De.debug("Sophi context",o),o},va=function(){const{context:e,inputs:t,trace:n,userProperties:r}=fn(),i={context:e,inputs:t,trace:n,userProperties:r};return De.info("𪧠Received getWallContext event",JSON.stringify(i,null,2)),i};function ba(){return"undefined"!=typeof CompressionStream&&"undefined"!=typeof DecompressionStream}const Aa=Math.max(Ss.twentyEightDayTopLevelSections,Ss.twentyEightDayTopLevelSectionsByArticle),ka=ks-1;function Pa(e,t){const n=e[4],r=e[5];return n.length<=t&&r.length<=t?e:[e[0],e[1],e[2],e[3],n.slice(0,t),r.slice(0,t)]}function Sa(e,t,n){let r=null;for(let i=0;i<e.length;i++){const o=e[i],s=!t.has(o),a=s&&t.size<n;s&&a&&t.add(o),a?null!==r&&r.push(o):null===r&&(r=e.slice(0,i))}return r??e}function Da(e){const t=Pa(e.t,Aa),n=e.h.slice(0,ka),r=e.h.slice(ka),i=[...n.map(e=>Pa(e,Aa)),...function(e,t){const n=new Set,r=new Set;return e.map(e=>{const i=Sa(e[4],n,t),o=Sa(e[5],r,t);return i===e[4]&&o===e[5]?e:[e[0],e[1],e[2],e[3],i,o]})}(r,Aa)];return{...e,t,h:i}}const xa="sophi_st",La=2592e3;let Ea=null;async function Va(e){const t=function(){const e=localStorage.getItem("demeter");if(!e)return null;try{return he(e)}catch{return null}}();if(!t)return;const n={d:Da(t),a:e},r=JSON.stringify(n),i=await async function(e){if(!ba())return null;const t=new TextEncoder,n=new Blob([t.encode(e)]).stream().pipeThrough(new CompressionStream("gzip")),r=await new Response(n).arrayBuffer(),i=new Uint8Array(r);let o="";for(let e=0;e<i.length;e++)o+=String.fromCharCode(i[e]);return btoa(o)}(r);if(null===i)return void(ba()||De.debug("State cookie skipped: CompressionStream not supported"));const o=Yt.hostname;document.cookie=`${xa}=${i}; domain=${o}; path=/; max-age=${La}; Secure; SameSite=Lax`}const _a="(root)";function Ca(e){return"string"==typeof e?.message?e.message:String(e?.message??"Invalid input")}function Ta(e,{maxIssues:t=20,mapMessage:n=Ca}={}){if(!Array.isArray(e)||!e.length)return[`${_a}: Invalid input`];const r=e.slice(0,t),i=r.map(e=>{const t=function(e){if(!Array.isArray(e)||!e.length)return _a;const t=[];for(const n of e){const e=n?.key;null!=e&&t.push("number"==typeof e?`[${e}
1]`:String(e))}return function(e){return Array.isArray(e)&&e.length&&e.reduce((e,t)=>"string"==typeof t&&t?t.startsWith("[")?`${e}${t}`:e?`${e}.${t}`:t:e,"")||_a}(t)}(e?.path),r="function"==typeof n?n(e):null;return`${t}: ${"string"==typeof r&&r.length>0?r:Ca(e)}`});return e.length>r.length&&i.push(`...and ${e.length-r.length} more issue(s)`),i}const $a=M.pipe(M.string(),M.trim(),M.string(),M.trim(),M.picklist(["pageview","wall","config","getDecision","getWallContext","getSophiContext","enableAllFeatures","userProperties","getDecisionForArticleWallIndicators","getExperiment"])),Ba=["pageview","wall","userProperties"],ja=["getDecision","getDecisionForArticleWallIndicators","getWallContext","getSophiContext","getExperiment"],Oa=["config"],Wa=["enableAllFeatures"],Ia=(e,t)=>{"function"==typeof e&&e(t)};async function Ua(e,t,n={}){const{resolve:r,reject:i}=n;let o=function(e){if(!e||"object"!=typeof e)return;const t=e.onError;return"function"==typeof t?t:void 0}(t);try{const{args:n,onSuccess:i,onError:s}=function(e){let t,n,r;if("object"==typeof e&&null!==e){if("args"in e==!1){const t=Object.keys(e).find(e=>"onSuccess"!==e&&"onError"!==e);t&&M.parse(M.object({[t]:M.pipe(M.any(),M.check(()=>!1,"Unexpected payload key"))}),e)}"args"in e&&void 0!==e.args&&(t=e.args),"onSuccess"in e&&"function"==typeof e.onSuccess&&(n=e.onSuccess),"onError"in e&&"function"==typeof e.onError&&(r=e.onError)}return{args:t,onSuccess:n,onError:r}}(t);o=s;const a=function(e){return M.parse($a,e)}(e),l=await Ra.call(this,a,n);return Ia(i,l),Ia(r,l),l}catch(e){const t=function(e){if(e instanceof M.ValiError){const t=function(e,t={}){return Ta(e,{maxIssues:t.maxIssues??20,mapMessage:e=>"string"==typeof e.message?e.message:String(e.message??"Invalid input")})}(e.issues).map(e=>`- ${e}`).join("\n");return De.error("InputError",`\n${t}`),new Error(`InputError\n${t}`,{cause:e})}return new Error("DecisionError",{cause:e})}(e);throw De.debug("Error",t),Ia(o,t),Ia(i,t),t}}function Ra(e,t){return this[e](t)}function Ma(e,t){const[[n,r]]=e[t],{resolve:i,reject:o}=function(e){let t,n;if(Array.isArray(e)){const[r,i,o]=e;"function"==typeof i&&(t=i),"function"==typeof o&&(n=o)}return{resolve:t,reject:n}}(e[t]);Ua.call(this,n,r,{resolve:i,reject:o}),e.splice(t,1)}function Na(e,t){for(let n=0;n<e.length;n++){const[[r]]=e[n];t.includes(r)&&(Ma.call(this,e,n),n--)}}const Ga=async function(e){var t,n;if(t=Yt.hostname,n=window.location?.hostname,t===n||new RegExp(`^(.*\\.)?${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`).test(n)||De.warn(`Bundle hostname mismatch: bundle is for "${Yt.hostname}", but loaded on "${window.location.hostname}"`),De.debug("Initializing"),Yt.stateCookie.isEnabled){let e="";try{const t=localStorage.getItem("demeter");t&&(e=he(t)?.lS??"")}catch{}const t=await async function(){const e=function(){const e=`${xa}=`,t=document.cookie.split(";");for(const n of t){const t=n.trim();if(t.startsWith(e))return t.substring(e.length)}return null}();if(!e)return null;const t=await async function(e){if(!ba())return null;const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);const r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip"));return await new Response(r).text()}(e);if(null===t)return null;try{const e=JSON.parse(t),n=(Ea||(Ea=M.object({d:yr,a:Gi})),Ea),r=M.safeParse(n,e);return r.success?r.output:null}catch{return null}}();if(t){const n=function(e,t){const n=e.d.lS;if(t&&n){if(new Date(t)>new Date(n))return!1}else if(t&&!n)return!1;try{localStorage.setItem("demeter",fe(e.d))}catch{return!1}try{const t=M.parse(Gi,e.a);localStorage.setItem(Bi,JSON.stringify(t))}catch{}return!0}(t,e);n?(this.store.getFromStored(),Fa.update(()=>Fi(localStorage)),un(en.StateCookie),De.debug("State initialized from cookie")):(un(en.StateLocal),De.debug("State cookie found but local state is newer"))}else e?(un(en.StateLocal),De.debug("No state cookie, using local state")):(un(en.StateInitial),De.debug("No state cookie or local state, fresh init"))}!function(e,t){if(null!==t.mode.consentParameterValue)!0===t.mode.consentParameterValue?(t.mode.on(),e.setConsent(!0),window.sophi?.abTests?.enableConsent()):!1===t.mode.consentParameterValue&&(t.mode.off(),e.setConsent(!1));else{const n=e.getConsent();void 0!==n&&(!0===n.granted&&(t.mode.on(),window.sophi?.abTests?.enableConsent()),!1===n.granted&&t.mode.off())}}(this.store,Yt),Na.call(this,e,Oa),Na.call(this,e,Wa);const r=la(this.store);r&&gn(),function(e){if(e&&("event"in e&&window.addEventListener(e.event,()=>{fa(to)}),"selector"in e)){const t=function(e){let t=null;try{t=document.querySelector(e)}catch(t){De.warn(`Invalid selector ${e}.`)}return null===t?(De.warn(`No node found using selector ${e}. Using document.body instead.`),document.body):t}(e.selector);let n=location.href;const r={subtree:!0,childList:!0};new MutationObserver(function(){location.href!==n&&(n=location.href,fa(to)),De.debug("MutationObserver callback checked for page change")}).observe(t,r)}}(Yt.spa),Yt.mode.isUserBehaviorDataAllowed&&Yi(),to.processStoredEvents(),to.dispatch({type:wn.Init}),"server"===Yt.wallGeneration.type&&(Na.call(this,e,Ba),to.processPreviousPageEvents()),await ca(r),"server"===Yt.wallGeneration.type&&to.finishServerWallInputBootstrap(),Na.call(this,e,ja),"client"===Yt.wallGeneration.type&&Na.call(this,e,Ba),this.ready=!0,window.demeter=Ua.bind(this);for(let t=0;t<e.length;t++)Ma.call(this,e,t),t--},qa={C:"control",V:"variant",H:"holdout"},za=e=>{if(!e||"sophivssophi"!==e.type?.toLowerCase())return null;if(window.sophi?.abTests){const e=window.sophi.abTests.getAllExperimentsSync("internal");if(e.length>0)return{assignedGroup:e[0].assignedGroup}}return function(){const e=document.cookie.split("; ");let t=null;for(const n of e){const[e,r]=n.split("=");
1if("_matheriSegs"===e){t=decodeURIComponent(r);break}}if(!t)return null;const n=t.split(",");for(const e of n){const t=e.match(/^INTERNAL_AB_TEST(\d+)-([CVH])$/);if(t)return{assignedGroup:qa[t[2]]}}return null}()},Fa=function(e){return new Zi(e.storage,e.onUpdate)}({storage:localStorage,onUpdate:()=>{Yt.stateCookie.isEnabled&&Yt.mode.isUserBehaviorDataAllowed&&Va(Fa.state).catch(()=>{})}});Ro=()=>Fa.state.userProperties.countryCode,gr=()=>{Yt.stateCookie.isEnabled&&Yt.mode.isUserBehaviorDataAllowed&&Va(Fa.state).catch(()=>{})};const Za=class{constructor(){this.ready=!1,this.store=vr;const e=to.getDispatch();this.init=Ga.bind(this);const t=e=>{if(this.ready&&!0===e)return"server"!==Yt.wallGeneration.type||!0===Yt.enableWallIndicators?Promise.resolve():(pa=!0,null===ua&&(ua=async function(){for(;pa;){pa=!1,to.processPreviousPageEvents();try{await ca(null)}catch(e){De.error("Create new decision failed",e)}}}().finally(()=>{ua=null})),ua)};return this.pageview=n=>t(e({type:wn.Pageview,payload:n})),this.wall=n=>t(e({type:wn.Wall,payload:n})),this.enableAllFeatures=()=>{const n=e({type:wn.EnableAllFeatures});return t(n)},this.userProperties=n=>t(e({type:wn.UserProperties,payload:n})),this.config=ke.config.bind(ke),this.getDecision=ma,this.getWallContext=va,this.getDecisionForArticleWallIndicators=ga,this.getSophiContext=wa,this.getExperiment=za,new Proxy(this,{get:function(e,t){return"function"==typeof e[t]&&"init"!==t?async(...n)=>{if(!e.ready)throw new Error(`InitError: ${String(t)}() was called before init(). Please initialize before using this function.`);return e[t](...n)}:e[t]}})}};let Ha=null,Ja=!1;const Ya=async function(e,t){return Ha||(Ha=new Za),Ja||(e||De.debug("Error loading 'thresholds' value."),function(e){e&&(cs=e)}(e),Fo.setModels(t),await async function(e){window.sophi=window.sophi||{},window.sophi.demeter=window.sophi.demeter||{actions:[]},window.sophi.demeter.actions=window.sophi.demeter.actions||[],cn(),window.sophi.quickStart=window.sophi.quickStart||{},window.sophi.dataLayer||yn(),e.init(window.sophi.demeter.actions)}(Ha),Ja=!0),Ha};return t["default"]})(),"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["createDemeter"]=t():e["createDemeter"]=t(),function(){var e=[],t=[],n=(()=>{var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o={};((e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})})(o,{default:()=>te});var s={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function a(t){return t||e?{lang:t?.lang??void 0,message:t?.message,abortEarly:t?.abortEarly??void 0,abortPipeEarly:t?.abortPipeEarly??void 0}:s}function l(e){const t=typeof e;return"string"===t?`"${e}"`:"number"===t||"bigint"===t||"boolean"===t?`${e}`:"object"===t||"function"===t?(e&&Object.getPrototypeOf(e)?.constructor?.name)??"null":t}function c(e,t,n,r,i){const o=i&&"input"in i?i.input:n.value,s=i?.expected??e.expects??null,a=i?.received??l(o),c={kind:e.kind,type:e.type,input:o,expected:s,received:a,message:`Invalid ${t}: ${s?`Expected ${s} but r`:"R"}eceived ${a}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},u="schema"===e.kind,p=i?.message??e.message??(e.reference,void c.lang)??(u?void c.lang:null)??r.message??void c.lang;void 0!==p&&(c.message="function"==typeof p?p(c):p),u&&(n.typed=!1),n.issues?n.issues.push(c):n.issues=[c]}var u=new WeakMap;function p(e){let t=u.get(e);return t||(t={version:1,vendor:"valibot",validate:t=>e["~run"]({value:t},a())},u.set(e,t)),t}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&"__proto__"!==t&&"prototype"!==t&&"constructor"!==t}function y(e,t){const n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??"never"}function f(e){if(e.path){let t="";for(const n of e.path){if("string"!=typeof n.key&&"number"!=typeof n.key)return null;t+=t?`.${n.key}`:n.key}return t}return null}var h=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}};function m(e,t,n){return"function"==typeof e.fallback?e.fallback(t,n):e.fallback}function g(e,t,n){return"function"==typeof e.default?e.default(t,n):e.default}function w(e,t){if(typeof e==typeof t){if(e===t||e instanceof Date&&t instanceof Date&&+e===+t)return{value:e};if(e&&t&&e.constructor===Object&&t.constructor===Object){const n={...e};for(const r in t)if(Object.prototype.hasOwnProperty.call(e,r)){const i=w(e[r],t[r]);if(i.issue)return i;n[r]=i.value}else n[r]=t[r];return{value:n}}if(Array.isArray(e)&&Array.isArray(t)&&e.length===t.length){const n=[...e];for(let r=0;r<e.length;r++){const i=w(e[r],t[r]);if(i.issue)return i;n[r]=i.value}return{value:n}}}return{issue:!0}}function v(e,t){return{kind:"schema",type:"non_optional",reference:v,expects:"!undefined",async:!1,wrapped:e,message:t,get"~standard"(){return p(this)},"~run"(e,t){return void 0!==e.value&&(e=this.wrapped["~run"](e,t)),void 0===e.value&&c(this,"type",e,t),e}}}function b(e,t){return{kind:"schema",type:"object",reference:b,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return p(this)},"~run"(e,t){const n=e.value;if(n&&"object"==typeof n){e.typed=!0,e.value={};for(const r in this.entries){const i=this.entries[r];if(r in n||("exact_optional"===i.type||"optional"===i.type||"nullish"===i.type)&&void 0!==i.default){const o=r in n?n[r]:g(i),s=i["~run"]({value:o},t);
1if(s.issues){const i={type:"object",origin:"value",input:n,key:r,value:o};for(const t of s.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[r]=s.value}else if(void 0!==i.fallback)e.value[r]=m(i);else if("exact_optional"!==i.type&&"optional"!==i.type&&"nullish"!==i.type&&(c(this,"key",e,t,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:n,key:r,value:n[r]}]}),t.abortEarly))break}}else c(this,"type",e,t);return e}}}function A(e,t){return{kind:"schema",type:"optional",reference:A,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return p(this)},"~run"(e,t){return void 0===e.value&&(void 0!==this.default&&(e.value=g(this,e,t)),void 0===e.value)?(e.typed=!0,e):this.wrapped["~run"](e,t)}}}function k(e,t){return{kind:"schema",type:"picklist",reference:k,expects:y(e.map(l),"|"),async:!1,options:e,message:t,get"~standard"(){return p(this)},"~run"(e,t){return this.options.includes(e.value)?e.typed=!0:c(this,"type",e,t),e}}}function P(e){return{kind:"schema",type:"string",reference:P,expects:"string",async:!1,message:e,get"~standard"(){return p(this)},"~run"(e,t){return"string"==typeof e.value?e.typed=!0:c(this,"type",e,t),e}}}function S(e){let t;if(e)for(const n of e)if(t)for(const e of n.issues)t.push(e);else t=n.issues;return t}var D={any:function e(){return{kind:"schema",type:"any",reference:e,expects:"any",async:!1,get"~standard"(){return p(this)},"~run":e=>(e.typed=!0,e)}},array:function e(t,n){return{kind:"schema",type:"array",reference:e,expects:"Array",async:!1,item:t,message:n,get"~standard"(){return p(this)},"~run"(e,t){const n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<n.length;r++){const i=n[r],o=this.item["~run"]({value:i},t);if(o.issues){const s={type:"array",origin:"value",input:n,key:r,value:i};for(const t of o.issues)t.path?t.path.unshift(s):t.path=[s],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}}else c(this,"type",e,t);return e}}},boolean:function e(t){return{kind:"schema",type:"boolean",reference:e,expects:"boolean",async:!1,message:t,get"~standard"(){return p(this)},"~run"(e,t){return"boolean"==typeof e.value?e.typed=!0:c(this,"type",e,t),e}}},check:function e(t,n){return{kind:"validation",type:"check",reference:e,async:!1,expects:null,requirement:t,message:n,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&c(this,"input",e,t),e}}},custom:function e(t,n){return{kind:"schema",type:"custom",reference:e,expects:"unknown",async:!1,check:t,message:n,get"~standard"(){return p(this)},"~run"(e,t){return this.check(e.value)?e.typed=!0:c(this,"type",e,t),e}}},exactOptional:function e(t,n){return{kind:"schema",type:"exact_optional",reference:e,expects:t.expects,async:!1,wrapped:t,default:n,get"~standard"(){return p(this)},"~run"(e,t){return this.wrapped["~run"](e,t)}}},flatten:function(e){const t={};for(const n of e)if(n.path){const e=f(n);e?(t.nested||(t.nested={}),Object.prototype.hasOwnProperty.call(t.nested,e)?t.nested[e].push(n.message):t.nested[e]=[n.message]):t.other?t.other.push(n.message):t.other=[n.message]}else t.root?t.root.push(n.message):t.root=[n.message];return t},intersect:function e(t,n){return{kind:"schema",type:"intersect",reference:e,expects:y(t.map(e=>e.expects),"&"),async:!1,options:t,message:n,get"~standard"(){return p(this)},"~run"(e,t){if(this.options.length){const n=e.value;let r;e.typed=!0;for(const i of this.options){const o=i["~run"]({value:n},t);if(o.issues){if(e.issues)for(const t of o.issues)e.issues.push(t);else e.issues=o.issues;if(t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.typed&&(r?r.push(o.value):r=[o.value])}if(e.typed){e.value=r[0];for(let n=1;n<r.length;n++){const i=w(e.value,r[n]);if(i.issue){c(this,"type",e,t,{received:"unknown"});break}e.value=i.value}}}else c(this,"type",e,t);return e}}},literal:function e(t,n){return{kind:"schema",type:"literal",reference:e,expects:l(t),async:!1,literal:t,message:n,get"~standard"(){return p(this)},"~run"(e,t){return e.value===this.literal?e.typed=!0:c(this,"type",e,t),e}}}
1,maxValue:function e(t,n){return{kind:"validation",type:"max_value",reference:e,async:!1,expects:`<=${t instanceof Date?t.toJSON():l(t)}`,requirement:t,message:n,"~run"(e,t){return!e.typed||e.value<=this.requirement||c(this,"value",e,t,{received:e.value instanceof Date?e.value.toJSON():l(e.value)}),e}}},message:function(e,t){return{...e,get"~standard"(){return p(this)},"~run":(n,r)=>e["~run"](n,{...r,message:t})}},minLength:function e(t,n){return{kind:"validation",type:"min_length",reference:e,async:!1,expects:`>=${t}`,requirement:t,message:n,"~run"(e,t){return e.typed&&e.value.length<this.requirement&&c(this,"length",e,t,{received:`${e.value.length}`}),e}}},minValue:function e(t,n){return{kind:"validation",type:"min_value",reference:e,async:!1,expects:`>=${t instanceof Date?t.toJSON():l(t)}`,requirement:t,message:n,"~run"(e,t){return!e.typed||e.value>=this.requirement||c(this,"value",e,t,{received:e.value instanceof Date?e.value.toJSON():l(e.value)}),e}}},null_:function e(t){return{kind:"schema",type:"null",reference:e,expects:"null",async:!1,message:t,get"~standard"(){return p(this)},"~run"(e,t){return null===e.value?e.typed=!0:c(this,"type",e,t),e}}},number:function e(t){return{kind:"schema",type:"number",reference:e,expects:"number",async:!1,message:t,get"~standard"(){return p(this)},"~run"(e,t){return"number"!=typeof e.value||isNaN(e.value)?c(this,"type",e,t):e.typed=!0,e}}},object:b,optional:A,parse:function(e,t,n){const r=e["~run"]({value:t},a(n));if(r.issues)throw new h(r.issues);return r.value},partial:function(e,t){const n={};for(const r in e.entries)n[r]=!t||t.includes(r)?A(e.entries[r]):e.entries[r];return{...e,entries:n,get"~standard"(){return p(this)}}},picklist:k,pipe:function(...e){return{...e[0],pipe:e,get"~standard"(){return p(this)},"~run"(t,n){for(const r of e)if("metadata"!==r.kind){if(t.issues&&("schema"===r.kind||"transformation"===r.kind)){t.typed=!1;break}t.issues&&(n.abortEarly||n.abortPipeEarly)||(t=r["~run"](t,n))}return t}}},record:function e(t,n,r){return{kind:"schema",type:"record",reference:e,expects:"Object",async:!1,key:t,value:n,message:r,get"~standard"(){return p(this)},"~run"(e,t){const n=e.value;if(n&&"object"==typeof n){e.typed=!0,e.value={};for(const r in n)if(d(n,r)){const i=n[r],o=this.key["~run"]({value:r},t);if(o.issues){const s={type:"object",origin:"key",input:n,key:r,value:i};for(const t of o.issues)t.path=[s],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}const s=this.value["~run"]({value:i},t);if(s.issues){const o={type:"object",origin:"value",input:n,key:r,value:i};for(const t of s.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}o.typed&&s.typed||(e.typed=!1),o.typed&&(e.value[o.value]=s.value)}}else c(this,"type",e,t);return e}}},required:function(e,t,n){const r=Array.isArray(t)?t:void 0,i=Array.isArray(t)?n:t,o={};for(const t in e.entries)o[t]=!r||r.includes(t)?v(e.entries[t],i):e.entries[t];return{...e,entries:o,get"~standard"(){return p(this)}}},safeParse:function(e,t,n){const r=e["~run"]({value:t},a(n));return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}},strictObject:function e(t,n){return{kind:"schema",type:"strict_object",reference:e,expects:"Object",async:!1,entries:t,message:n,get"~standard"(){return p(this)},"~run"(e,t){const n=e.value;if(n&&"object"==typeof n){e.typed=!0,e.value={};for(const r in this.entries){const i=this.entries[r];if(r in n||("exact_optional"===i.type||"optional"===i.type||"nullish"===i.type)&&void 0!==i.default){const o=r in n?n[r]:g(i),s=i["~run"]({value:o},t);if(s.issues){const i={type:"object",origin:"value",input:n,key:r,value:o};for(const t of s.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[r]=s.value}else if(void 0!==i.fallback)e.value[r]=m(i);else if("exact_optional"!==i.type&&"optional"!==i.type&&"nullish"!==i.type&&(c(this,"key",e,t,{input:void 0,expected:`"${r}
1"`,path:[{type:"object",origin:"key",input:n,key:r,value:n[r]}]}),t.abortEarly))break}if(!e.issues||!t.abortEarly)for(const r in n)if(!(r in this.entries)){c(this,"key",e,t,{input:r,expected:"never",path:[{type:"object",origin:"key",input:n,key:r,value:n[r]}]});break}}else c(this,"type",e,t);return e}}},string:P,transform:function e(t){return{kind:"transformation",type:"transform",reference:e,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}},toLowerCase:function e(){return{kind:"transformation",type:"to_lower_case",reference:e,async:!1,"~run":e=>(e.value=e.value.toLowerCase(),e)}},trim:function e(){return{kind:"transformation",type:"trim",reference:e,async:!1,"~run":e=>(e.value=e.value.trim(),e)}},tuple:function e(t,n){return{kind:"schema",type:"tuple",reference:e,expects:"Array",async:!1,items:t,message:n,get"~standard"(){return p(this)},"~run"(e,t){const n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<this.items.length;r++){const i=n[r],o=this.items[r]["~run"]({value:i},t);if(o.issues){const s={type:"array",origin:"value",input:n,key:r,value:i};for(const t of o.issues)t.path?t.path.unshift(s):t.path=[s],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}}else c(this,"type",e,t);return e}}},union:function e(t,n){return{kind:"schema",type:"union",reference:e,expects:y(t.map(e=>e.expects),"|"),async:!1,options:t,message:n,get"~standard"(){return p(this)},"~run"(e,t){let n,r,i;for(const o of this.options){const s=o["~run"]({value:e.value},t);if(s.typed){if(!s.issues){n=s;break}r?r.push(s):r=[s]}else i?i.push(s):i=[s]}if(n)return n;if(r){if(1===r.length)return r[0];c(this,"type",e,t,{issues:S(r)}),e.typed=!0}else{if(1===i?.length)return i[0];c(this,"type",e,t,{issues:S(i)})}return e}}},unwrap:function(e){return e.wrapped},url:function e(t){return{kind:"validation",type:"url",reference:e,async:!1,expects:null,requirement(e){try{return new URL(e),!0}catch{return!1}},message:t,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&c(this,"URL",e,t),e}}},ValiError:h,value:function e(t,n){return{kind:"validation",type:"value",reference:e,async:!1,expects:t instanceof Date?t.toJSON():l(t),requirement:t,message:n,"~run"(e,t){return!e.typed||this.requirement<=e.value&&this.requirement>=e.value||c(this,"value",e,t,{received:e.value instanceof Date?e.value.toJSON():l(e.value)}),e}}}},x=b({assignedGroup:k(["control","variant","holdout"]),experimentId:P()}),L={PAYWALL:"paywall",REGWALL:"regwall"},E="always",V="never",_="anonymous",C="registered",T="subscribed",$=(D.union([D.literal(_),D.literal(C),D.literal(T)]),D.picklist([L.REGWALL,L.PAYWALL])),B=D.picklist([E,V]),j=0,O=1,W=2,I=1,U=0,R=(L.PAYWALL,L.REGWALL,D.object({wallVisibility:B,wallType:$})),M=D.object({...R.entries,score:D.number(),threshold:D.pipe(D.number(),D.minValue(0),D.maxValue(1))}),N=D.array(M),G=D.object({wallVisibility:D.literal(E),wallType:$,outcomes:N}),q=D.object({wallVisibility:D.literal(V),outcomes:N}),z=(D.union([G,q]),D.record(D.string(),D.union([D.string(),D.number(),D.boolean()]))),F=D.optional(z),Z=D.object({wallType:D.literal(L.REGWALL),wallTypeCode:D.literal(W),wallVisibility:D.literal(E),wallVisibilityCode:D.literal(I),wallProperties:F}),H=D.object({wallType:D.literal(L.PAYWALL),wallTypeCode:D.literal(O),wallVisibility:D.literal(E),wallVisibilityCode:D.literal(I),wallProperties:F}),J=D.object({wallVisibility:D.literal(V),wallVisibilityCode:D.literal(U),wallProperties:F}),Y=D.union([Z,H,J]);D.object({id:D.string(),createdAt:D.string(),trace:D.string(),context:D.string(),inputs:D.string(),outcome:Y,searchParams:D.string(),userProperties:D.string(),wallProperties:D.optional(D.string()),paywallScore:D.optional(D.pipe(D.number(),D.minValue(0),D.maxValue(100))),contentProperties:D.optional(D.string(),""),experiment:D.union([D.null_(),x])}),D.partial(D.object({id:D.string(),createdAt:D.string(),context:D.string(),trace:D.string(),inputs:D.string(),outcome:D.union([D.partial(Z),D.partial(H),D.partial(J)]),searchParams:D.string(),userProperties:D.string(),wallProperties:D.string(),paywallScore:D.optional(D.pipe(D.number(),D.minValue(0),D.maxValue(100))),contentProperties:D.optional(D.str
1ing(),""),experiment:D.union([D.null_(),x])})),D.object({[L.PAYWALL]:D.number(),[L.REGWALL]:D.optional(D.number())});var K=!0;function X(e){let t=0,n=.13,r=0;r=K?Math.random():.5;let i=Math.round(10*e.todayPageViewsByArticleWithPaywall/e.todayPageViewsByArticle)/10,o=e.todayPageViewsByArticle+e.sevenDayPageViewsByArticle+e.twentyEightDayPageViewsByArticle,s=e.todayPageViews+e.sevenDayPageViews+e.twentyEightDayPageViews,a=e.visitor.session.timestamp?.getDay(),l="undefined";"number"==typeof a&&(l=["weekends","weekdays","weekdays","weekdays","weekdays","weekdays","weekends"][a]);let c=e.viewer.toLowerCase(),u=e.referrer.toLowerCase(),p=e.twentyEightDayVisitCount+e.sevenDayVisitCount,d=Math.max(e.twentyEightDayTopLevelSections,e.sevenDayTopLevelSections,e.todayTopLevelSections,0),y=e.visitor.session.referrerMedium+e.referrer;"string"==typeof y&&(y=y.toLowerCase());let f=Math.max(e.twentyEightDayTopLevelSectionsByArticle,e.sevenDayTopLevelSectionsByArticle,e.todayTopLevelSectionsByArticle,0);const h="zlzu!8!kqtb3y6@a"===new URLSearchParams(window.location.search).get("cu_id")?.toLowerCase();let m=e.type;""!==m&&null!==m||(m="other");let g=m+e.os;"string"==typeof g&&(g=g.toLowerCase());let w=e.os;"string"==typeof w&&(w=w.toLowerCase());let v="";"string"==typeof e.viewer&&(v=e.viewer.toLowerCase());let b=e.todayPageViewsByArticle,A=0;"othermac os"===g&&(A=1);let k=0;"mobileios"===g&&(k=1);let P=0;"mobileandroid"===g&&(P=1);let S=0;"mobilewindows"===g&&(S=1);let D=0;"internal"===u&&(D=1);let x=0;"search"===u&&(x=1);let E=0;"direct"===u&&(E=1);let V=0;"safari"===v&&(V=1);let _=0;"mobile safari"===v&&(_=1);let C=0;"chrome"===v&&(C=1);let T=0;"gsa"===v&&(T=1);let $=e.hourOfDay,B=0;"America/Toronto"===e.timeZone&&(B=1);let j=0;"America/Vancouver"===e.timeZone&&(j=1);let O=0;"America/Edmonton"===e.timeZone&&(O=1);let W=0;"America/New_York"===e.timeZone&&(W=1);let I=e.daysSinceLastVisit,U=e.twentyEightDayTopLevelSections,R=e.todayPageViews,M=e.sevenDayPageViewsByArticle,N=e.twentyEightDayPageViews,G=e.sevenDayTopLevelSections,q=e.twentyEightDayVisitCount,z=e.twentyEightDayPageViewsByArticleWithPaywall,F=e.sevenDayPageViews,Z=e.sevenDayVisitCount,H=e.sevenDayTopLevelSectionsByArticle,J=e.twentyEightDayPageViewsByArticle,Y=e.twentyEightDayTopLevelSectionsByArticle,X=Math.round(10*e.twentyEightDayPageViewsByArticleWithPaywall/e.twentyEightDayPageViewsByArticle)/10,Q=0,ee=0,te=e.visitor.session.referrerMedium;"string"==typeof te&&(te=te.toLowerCase()),"campaign"===te&&(Q=1),"search"===te&&(ee=1);let ne=0;"www.google.com"===e.visitor.session.referrerDomain&&(ne=1);let re=0;"news.google.com"===e.visitor.session.referrerDomain&&(re=1);let ie=0;ie="anonymous"===e.visitorType?P<=.5?T<=.5?re<=.5?U<=6.5?b<=.5?A<=.5?.08:.119:ne<=.5?.1:.24:F<=.5?.096:U<=22.5?.026:.002:V<=.5?B<=.5?_<=.5?.016:.042:k<=.5?.06:.015:$<=13?R<=3.5?.029:.012:j<=.5?.003:.018:D<=.5?U<=4.5?F<=1.5?O<=.5?.023:.009:$<=13?.053:.023:Y<=2.5?0:.022:B<=.5?.051:.079:x<=.5?Q<=.5?ne<=.5?C<=.5?$<=13?.027:.006:B<=.5?.027:.074:M<=.5?.019:.122:.118:ne<=.5?z<=1.5?Z<=.5?O<=.5?.009:.023:I<=.5?.028:.009:X<=.75?.021:Y<=2.5?.007:.001:M<=.5?C<=.5?.058:G<=.5?.026:.018:.072:U<=1.5?q<=2.5?J<=4.5?P<=.5?F<=4.5?E<=.5?.052:.08:H<=.5?0:.022:M<=.5?R<=4.5?.003:.018:$<=15?.048:.017:W<=.5?J<=72.5?S<=.5?.008:.029:U<=.5?.013:.043:.044:k<=.5?X<=.35?.136:J<=47.5?R<=2.5?.016:.073:M<=1.5?.125:.066:.023:U<=12.5?q<=6.5?N<=.5?U<=6.5?Z<=4.5?.027:.008:b<=.5?.006:.015:.07:.078:F<=2.5?C<=.5?.037:.005:Z<=4.5?X<=.05?R<=1.5?0:.029:ee<=.5?.009:0:x<=.5?0:.009;"anonymous"===e.visitorType&&(0===e.daysSinceLastVisit&&(t+=.06*n),1===e.daysSinceLastVisit&&(t+=-.32*n),2===e.daysSinceLastVisit&&(t+=-.4*n),3===e.daysSinceLastVisit&&(t+=-.48*n),4===e.daysSinceLastVisit&&(t+=-.68*n),5===e.daysSinceLastVisit&&(t+=-.64*n),0===e.hourOfDay&&(t+=-.1*n),2===e.hourOfDay&&(t+=-.14*n),4===e.hourOfDay&&(t+=-.06*n),6===e.hourOfDay&&(t+=.06*n),8===e.hourOfDay&&(t+=.05*n),10===e.hourOfDay&&(t+=-.02*n),12===e.hourOfDay&&(t+=.26*n),14===e.hourOfDay&&(t+=.17*n),16===e.hourOfDay&&(t+=.15*n),18===e.hourOfDay&&(t+=.13*n),20===e.hourOfDay&&(t+=-.05*n),22===e.hourOfDay&&(t+=-.15*n),"campaign"===e.referrer&&(t+=.48*n),"direct"===e.referrer&&(t+=.14*n),"internal"===e.referrer&&(t+=.32*n),"other"===e.referrer&&(t+=.1*n),"search"===e.referrer&&(t+=-.06*n),"social"===e.referrer&&(t+=-.17*n),"America/Chicago"===e.timeZone&&(t+=.13*n),"America/Denver"===e.timeZone&&(t+=.23*n),"America/Edmonton"===e.timeZone&&(t+=-.14*n),"America/Halifax"===e.timeZone&&(t+=.11*n),"America/Los_Angeles"===e.timeZone&&(t+=-.06*n),"America/Moncton"===e.timeZone&&(t+=-.52*n),"America/Ne
1w_York"===e.timeZone&&(t+=.22*n),"America/Phoenix"===e.timeZone&&(t+=-.09*n),"America/Regina"===e.timeZone&&(t+=-.28*n),"America/St_Johns"===e.timeZone&&(t+=-.2*n),"America/Toronto"===e.timeZone&&(t+=.07*n),"America/Vancouver"===e.timeZone&&(t+=-.05*n),"America/Winnipeg"===e.timeZone&&(t+=-.16*n),"Asia/Calcutta"===e.timeZone&&(t+=.34*n),"Asia/Shanghai"===e.timeZone&&(t+=-.85*n),"Asia/Singapore"===e.timeZone&&(t+=-.04*n),"Australia/Sydney"===e.timeZone&&(t+=-.31*n),"Europe/Berlin"===e.timeZone&&(t+=-.04*n),"Europe/Dublin"===e.timeZone&&(t+=-.59*n),"Europe/London"===e.timeZone&&(t+=-.08*n),"Europe/Madrid"===e.timeZone&&(t+=-.17*n),"Europe/Paris"===e.timeZone&&(t+=.48*n),"UTC"===e.timeZone&&(t+=-.99*n),0===e.todayPageViews&&(t+=.07*n),1===e.todayPageViews&&(t+=-.12*n),2===e.todayPageViews&&(t+=-.15*n),3===e.todayPageViews&&(t+=-.27*n),4===e.todayPageViews&&(t+=-.17*n),5===e.todayPageViews&&(t+=-.21*n),0===e.todayPageViewsByArticle&&(t+=-.04*n),1===e.todayPageViewsByArticle&&(t+=.3*n),2===e.todayPageViewsByArticle&&(t+=.46*n),3===e.todayPageViewsByArticle&&(t+=.48*n),4===e.todayPageViewsByArticle&&(t+=.44*n),5===e.todayPageViewsByArticle&&(t+=.53*n),e.todayPageViewsByArticle>=10&&e.todayPageViewsByArticle<=14&&(t+=-.33*n),"chrome"===c&&(t+=.2*n),"chrome webview"===c&&(t+=-.97*n),"edge"===c&&(t+=.67*n),"facebook"===c&&(t+=.04*n),"firefox"===c&&(t+=-.02*n),"gsa"===c&&(t+=-.54*n),"mobile safari"===c&&(t+=-.34*n),"safari"===c&&(t+=-.42*n),"samsung browser"===c&&(t+=-.17*n),"webkit"===c&&(t+=-.81*n),"android-app:"===e.visitor.session.referrerDomain&&(t+=-.02*n),"apple.news"===e.visitor.session.referrerDomain&&(t+=2.08*n),"flipboard.com"===e.visitor.session.referrerDomain&&(t+=-.9*n),"go.bsky.app"===e.visitor.session.referrerDomain&&(t+=.1*n),"m.facebook.com"===e.visitor.session.referrerDomain&&(t+=-.53*n),"news.google.com"===e.visitor.session.referrerDomain&&(t+=-.21*n),"other"===e.visitor.session.referrerDomain&&(t+=.17*n),"t.co"===e.visitor.session.referrerDomain&&(t+=-.21*n),"www.bing.com"===e.visitor.session.referrerDomain&&(t+=.61*n),"www.google.ca"===e.visitor.session.referrerDomain&&(t+=-.44*n),"www.google.com"===e.visitor.session.referrerDomain&&(t+=-.01*n),"www.linkedin.com"===e.visitor.session.referrerDomain&&(t+=.8*n),"www.reddit.com"===e.visitor.session.referrerDomain&&(t+=-.59*n),"www.theglobeandmail.com"===e.visitor.session.referrerDomain&&(t+=-.07*n),"campaign"===e.visitor.session.referrerMedium&&(t+=.41*n),"direct"===e.visitor.session.referrerMedium&&(t+=.12*n),"internal"===e.visitor.session.referrerMedium&&(t+=-.05*n),"other"===e.visitor.session.referrerMedium&&(t+=.16*n),"search"===e.visitor.session.referrerMedium&&(t+=-.03*n),"social"===e.visitor.session.referrerMedium&&(t+=-.16*n),0===o&&(t+=.06*n),1===o&&(t+=-.23*n),2===o&&(t+=-.41*n),3===o&&(t+=-.23*n),4===o&&(t+=-.28*n),5===o&&(t+=-.39*n),6===o&&(t+=-.12*n),7===o&&(t+=-.34*n),8===o&&(t+=-.08*n),9===o&&(t+=-.07*n),o>=10&&o<=14&&(t+=.11*n),o>=15&&o<=19&&(t+=.39*n),o>=20&&o<=24&&(t+=.3*n),o>=95&&o<=99&&(t+=-.29*n),0===s&&(t+=.03*n),1===s&&(t+=-.36*n),2===s&&(t+=-.29*n),3===s&&(t+=-.47*n),4===s&&(t+=-.72*n),0===d&&(t+=.12*n),1===d&&(t+=-.11*n),2===d&&(t+=-.23*n),3===d&&(t+=-.37*n),4===d&&(t+=-.34*n),5===d&&(t+=-.4*n),6===d&&(t+=-.65*n),7===d&&(t+=-.37*n),8===d&&(t+=-.48*n),9===d&&(t+=-.49*n),d>=10&&d<=14&&(t+=-.47*n),d>=15&&d<=19&&(t+=-.51*n),d>=20&&d<=24&&(t+=-.57*n),d>=60&&d<=64&&(t+=-.87*n),0===f&&(t+=.06*n),1===f&&(t+=-.24*n),2===f&&(t+=-.28*n),3===f&&(t+=-.22*n),4===f&&(t+=-.27*n),5===f&&(t+=-.07*n),6===f&&(t+=.09*n),f>=10&&f<=14&&(t+=-.03*n),0===p&&(t+=.06*n),1===p&&(t+=-.22*n),2===p&&(t+=-.35*n),3===p&&(t+=-.43*n),4===p&&(t+=-.44*n),5===p&&(t+=.21*n),p>=10&&p<=14&&(t+=-.33*n),0===X&&(t+=.05*n),.1===X&&(t+=-.4*n),.2===X&&(t+=.27*n),.3===X&&(t+=.39*n),.5===X&&(t+=.04*n),.6===X&&(t+=.51*n),.7===X&&(t+=.78*n),.8===X&&(t+=.48*n),1===X&&(t+=-.38*n),"weekdays"===l&&(t+=.01*n),"weekends"===l&&(t+=-.02*n),"campaigncampaign"===y&&(t+=.47*n),"campaigninternal"===y&&(t+=.28*n),"directdirect"===y&&(t+=.14*n),"directinternal"===y&&(t+=.01*n),"internalinternal"===y&&(t+=-.09*n),"otherother"===y&&(t+=.07*n),"searchdirect"===y&&(t+=.1*n),"searchinternal"===y&&(t+=.78*n),"searchsearch"===y&&(t+=-.07*n),"socialsocial"===y&&(t+=-.21*n),0===i&&(t+=.56*n),.5===i&&(t+=.06*n),1===i&&(t+=-.17*n),"mobileandroid"===g&&(t+=.1*n),"mobileios"===g&&(t+=-.46*n),"mobilemac os"===g&&(t+=1.45*n),"mobilewindows"===g&&(t+=3.9*n),"otherchromium os"===g&&(t+=2.04*n),"otherlinux"===g&&(t+=-.34*n),"othermac os"===g&&(t+=.11*n),"otherwindows"===g&&(t+=.37*n),"tabletandroid"===g&&(t+=-.03*n),"tabletios"===g&&(t+=-.56*n),"tabletmac os"===g&&(t+=-.48*n));let oe=.5+ie+0,se=.5+t;return K&&(oe+=.01*(r-.5)),K&&(se+=.01*(r-.5)),oe<=.01?oe=.01:oe>1&&(oe=1),se<=.01?se=.01:se>1&&(se=1),"search"===e.referrerData.medium&&"google"===e.referrerData.source&&"discover"===e.referrerData.channel&&oe<.5&&(oe=0),h&&(oe=0),{[L.PAYWALL]:oe,[L.REGWALL]:se}}var Q,ee=!0;function te(e){if(!function(e){return"todayPageViews"in e}(e))return function(){let e=Math.random();return e<=.1?e=.1:e>=1&&(e=.99),{[L.PAYWALL]:e}}();switch(e.assignedGroup||"control"){case"variant":return function(e){let t=.5,n=.13,r=0,i=.13,o=0;o=ee?Math.random():.5;let s=Math.round(10*e.todayPageViewsByArticleWithPaywall/e.todayPageViewsByArticle)/10,a=e.todayPageViewsByArticle+e.sevenDayPageViewsByArticle+e.twentyEightDayPageViewsByArticle,l=e.todayPageViews+e.sevenDayPageViews+e.twentyEightDayPageViews,c=e.visitor.session.timestamp?.getDay(),u="undefined";"number"==typeof c&&(u=["weekends","weekdays","weekdays","weekdays","weekdays","weekdays","weekends"][c]);let p=e.viewer.toLowerCase(),d=e.referrer.toLowerCase(),y=e.twentyEightDayVisitCount+e.sevenDayVisitCount,f=M
1ath.max(e.twentyEightDayTopLevelSections,e.sevenDayTopLevelSections,e.todayTopLevelSections,0),h=e.visitor.session.referrerMedium+e.referrer;"string"==typeof h&&(h=h.toLowerCase());let m=Math.max(e.twentyEightDayTopLevelSectionsByArticle,e.sevenDayTopLevelSectionsByArticle,e.todayTopLevelSectionsByArticle,0),g=e.type;""!==g&&null!==g||(g="other");let w=g+e.os;"string"==typeof w&&(w=w.toLowerCase());let v=e.os;"string"==typeof v&&(v=v.toLowerCase());const b="zlzu!8!kqtb3y6@a"===new URLSearchParams(window.location.search.toLowerCase()).get("cu_id");let A="";"string"==typeof e.viewer&&(A=e.viewer.toLowerCase());let k=e.userProperties["1"];"string"==typeof k&&(k=k.toLowerCase());let P=e.userProperties["2"];"string"==typeof P&&(P=P.toLowerCase());let S=e.userProperties["3"];"string"==typeof S&&(S=S.toLowerCase());let D=e.userProperties["4"];"string"==typeof D&&(D=D.toLowerCase());let x=e.todayPageViewsByArticle,E=0;"othermac os"===w&&(E=1);let V=0;"mobileios"===w&&(V=1);let _=0;"mobileandroid"===w&&(_=1);let C=0;"mobilewindows"===w&&(C=1);let T=0;"internal"===d&&(T=1);let $=0;"search"===d&&($=1);let B=0;"direct"===d&&(B=1);let j=0;"safari"===A&&(j=1);let O=0;"mobile safari"===A&&(O=1);let W=0;"chrome"===A&&(W=1);let I=0;"gsa"===A&&(I=1);let U=e.hourOfDay,R=0;"America/Toronto"===e.timeZone&&(R=1);let M=0;"America/Vancouver"===e.timeZone&&(M=1);let N=0;"America/Edmonton"===e.timeZone&&(N=1);let G=0;"America/New_York"===e.timeZone&&(G=1);let q=e.daysSinceLastVisit,z=e.twentyEightDayTopLevelSections,F=e.todayPageViews,Z=e.sevenDayPageViewsByArticle,H=e.twentyEightDayPageViews,J=e.sevenDayTopLevelSections,Y=e.twentyEightDayVisitCount,K=e.twentyEightDayPageViewsByArticleWithPaywall,X=e.sevenDayPageViews,Q=e.sevenDayVisitCount,te=e.sevenDayTopLevelSectionsByArticle,ne=e.twentyEightDayPageViewsByArticle,re=e.twentyEightDayTopLevelSectionsByArticle,ie=Math.round(10*e.twentyEightDayPageViewsByArticleWithPaywall/e.twentyEightDayPageViewsByArticle)/10,oe=0,se=0,ae=e.visitor.session.referrerMedium;"string"==typeof ae&&(ae=ae.toLowerCase()),"campaign"===ae&&(oe=1),"search"===ae&&(se=1);let le=0;"www.google.com"===e.visitor.session.referrerDomain&&(le=1);let ce=0;"news.google.com"===e.visitor.session.referrerDomain&&(ce=1);let ue=0;ue="anonymous"===e.visitorType?_<=.5?I<=.5?ce<=.5?z<=6.5?x<=.5?E<=.5?.08:.119:le
1<=.5?.1:.24:X<=.5?.096:z<=22.5?.026:.002:j<=.5?R<=.5?O<=.5?.016:.042:V<=.5?.06:.015:U<=13?F<=3.5?.029:.012:M<=.5?.003:.018:T<=.5?z<=4.5?X<=1.5?N<=.5?.023:.009:U<=13?.053:.023:re<=2.5?0:.022:R<=.5?.051:.079:$<=.5?oe<=.5?le<=.5?W<=.5?U<=13?.027:.006:R<=.5?.027:.074:Z<=.5?.019:.122:.118:le<=.5?K<=1.5?Q<=.5?N<=.5?.009:.023:q<=.5?.028:.009:ie<=.75?.021:re<=2.5?.007:.001:Z<=.5?W<=.5?.058:J<=.5?.026:.018:.072:z<=1.5?Y<=2.5?ne<=4.5?_<=.5?X<=4.5?B<=.5?.052:.08:te<=.5?0:.022:Z<=.5?F<=4.5?.003:.018:U<=15?.048:.017:G<=.5?ne<=72.5?C<=.5?.008:.029:z<=.5?.013:.043:.044:V<=.5?ie<=.35?.136:ne<=47.5?F<=2.5?.016:.073:Z<=1.5?.125:.066:.023:z<=12.5?Y<=6.5?H<=.5?z<=6.5?Q<=4.5?.027:.008:x<=.5?.006:.015:.07:.078:X<=2.5?W<=.5?.037:.005:Q<=4.5?ie<=.05?F<=1.5?0:.029:se<=.5?.009:0:$<=.5?0:.009;let pe=0;"false"===D&&(pe+=0*n),"false"===S&&(pe+=.4125*n),"true"===S&&(pe+=1.1875*n),"null"===S&&(pe+=-.00207*n),"false"===P&&(pe+=0*n),"not empty"===k&&(pe+=-.045*n),"null"===k&&(pe+=6e-4*n);let de,ye=0;"false"===D&&(ye+=-.00155*n),"true"===D&&(ye+=.0234*n),"false"===S&&(ye+=-.011*n),"true"===S&&(ye+=.029*n),"null"===S&&(ye+=.188*n),"true"===P&&(ye+=7e-4*n),"not empty"===k&&(ye+=-73e-5*n),"null"===k&&(ye+=37e-5*n),"anonymous"===e.visitorType&&(0===e.daysSinceLastVisit&&(r+=.06*i),1===e.daysSinceLastVisit&&(r+=-.32*i),2===e.daysSinceLastVisit&&(r+=-.4*i),3===e.daysSinceLastVisit&&(r+=-.48*i),4===e.daysSinceLastVisit&&(r+=-.68*i),5===e.daysSinceLastVisit&&(r+=-.64*i),0===e.hourOfDay&&(r+=-.1*i),2===e.hourOfDay&&(r+=-.14*i),4===e.hourOfDay&&(r+=-.06*i),6===e.hourOfDay&&(r+=.06*i),8===e.hourOfDay&&(r+=.05*i),10===e.hourOfDay&&(r+=-.02*i),12===e.hourOfDay&&(r+=.26*i),14===e.hourOfDay&&(r+=.17*i),16===e.hourOfDay&&(r+=.15*i),18===e.hourOfDay&&(r+=.13*i),20===e.hourOfDay&&(r+=-.05*i),22===e.hourOfDay&&(r+=-.15*i),"campaign"===e.referrer&&(r+=.48*i),"direct"===e.referrer&&(r+=.14*i),"internal"===e.referrer&&(r+=.32*i),"other"===e.referrer&&(r+=.1*i),"search"===e.referrer&&(r+=-.06*i),"social"===e.referrer&&(r+=-.17*i),"America/Chicago"===e.timeZone&&(r+=.13*i),"America/Denver"===e.timeZone&&(r+=.23*i),"America/Edmonton"===e.timeZone&&(r+=-.14*i),"America/Halifax"===e.timeZone&&(r+=.11*i),"America/Los_Angeles"===e.timeZone&&(r+=-.
106*i),"America/Moncton"===e.timeZone&&(r+=-.52*i),"America/New_York"===e.timeZone&&(r+=.22*i),"America/Phoenix"===e.timeZone&&(r+=-.09*i),"America/Regina"===e.timeZone&&(r+=-.28*i),"America/St_Johns"===e.timeZone&&(r+=-.2*i),"America/Toronto"===e.timeZone&&(r+=.07*i),"America/Vancouver"===e.timeZone&&(r+=-.05*i),"America/Winnipeg"===e.timeZone&&(r+=-.16*i),"Asia/Calcutta"===e.timeZone&&(r+=.34*i),"Asia/Shanghai"===e.timeZone&&(r+=-.85*i),"Asia/Singapore"===e.timeZone&&(r+=-.04*i),"Australia/Sydney"===e.timeZone&&(r+=-.31*i),"Europe/Berlin"===e.timeZone&&(r+=-.04*i),"Europe/Dublin"===e.timeZone&&(r+=-.59*i),"Europe/London"===e.timeZone&&(r+=-.08*i),"Europe/Madrid"===e.timeZone&&(r+=-.17*i),"Europe/Paris"===e.timeZone&&(r+=.48*i),"UTC"===e.timeZone&&(r+=-.99*i),0===e.todayPageViews&&(r+=.07*i),1===e.todayPageViews&&(r+=-.12*i),2===e.todayPageViews&&(r+=-.15*i),3===e.todayPageViews&&(r+=-.27*i),4===e.todayPageViews&&(r+=-.17*i),5===e.todayPageViews&&(r+=-.21*i),0===e.todayPageViewsByArticle&&(r+=-.04*i),1===e.todayPageViewsByArticle&&(r+=.3*i),2===e.todayPageViewsByArticle&&(r+=.46*i),3===e.todayPageViewsByArticle&&(r+=.48*i),4===e.todayPageViewsByArticle&&(r+=.44*i),5===e.todayPageViewsByArticle&&(r+=.53*i),e.todayPageViewsByArticle>=10&&e.todayPageViewsByArticle<=14&&(r+=-.33*i),"chrome"===p&&(r+=.2*i),"chrome webview"===p&&(r+=-.97*i),"edge"===p&&(r+=.67*i),"facebook"===p&&(r+=.04*i),"firefox"===p&&(r+=-.02*i),"gsa"===p&&(r+=-.54*i),"mobile safari"===p&&(r+=-.34*i),"safari"===p&&(r+=-.42*i),"samsung browser"===p&&(r+=-.17*i),"webkit"===p&&(r+=-.81*i),"android-app:"===e.visitor.session.referrerDomain&&(r+=-.02*i),"apple.news"===e.visitor.session.referrerDomain&&(r+=2.08*i),"flipboard.com"===e.visitor.session.referrerDomain&&(r+=-.9*i),"go.bsky.app"===e.visitor.session.referrerDomain&&(r+=.1*i),"m.facebook.com"===e.visitor.session.referrerDomain&&(r+=-.53*i),"news.google.com"===e.visitor.session.referrerDomain&&(r+=-.21*i),"other"===e.visitor.session.referrerDomain&&(r+=.17*i),"t.co"===e.visitor.session.referrerDomain&&(r+=-.21*i),"www.bing.com"===e.visitor.session.referrerDomain&&(r+=.61*i),"www.google.ca"===e.visitor.session.referrerDomain&&(r+=-.44*i),"www.google.com"===e.visitor.session.referrerDomain&&(r+=-.01*i),"www.linkedin.com"===e.visitor.session.referrerDomain&&(r+=.8*i),"www.reddit.com"===e.visitor.session.referrerDomain&&(r+=-.59*i),"www.theglobeandmail.com"===e.visitor.session.referrerDomain&&(r+=-.07*i),"campaign"===e.visitor.session.referrerMedium&&(r+=.41*i),"direct"===e.visitor.session.referrerMedium&&(r+=.12*i),"internal"===e.visitor.session.referrerMedium&&(r+=-.05*i),"other"===e.visitor.session.referrerMedium&&(r+=.16*i),"search"===e.visitor.session.referrerMedium&&(r+=-.03*i),"social"===e.visitor.session.referrerMedium&&(r+=-.16*i),0===a&&(r+=.06*i),1===a&&(r+=-.23*i),2===a&&(r+=-.41*i),3===a&&(r+=-.23*i),4===a&&(r+=-.28*i),5===a&&(r+=-.39*i),6===a&&(r+=-.12*i),7===a&&(r+=-.34*i),8===a&&(r+=-.08*i),9===a&&(r+=-.07*i),a>=10&&a<=14&&(r+=.11*i),a>=15&&a<=19&&(r+=.39*i),a>=20&&a<=24&&(r+=.3*i),a>=95&&a<=99&&(r+=-.29*i),0===l&&(r+=.03*i),1===l&&(r+=-.36*i),2===l&&(r+=-.29*i),3===l&&(r+=-.47*i),4===l&&(r+=-.72*i),0===f&&(r+=.12*i),1===f&&(r+=-.11*i),2===f&&(r+=-.23*i),3===f&&(r+=-.37*i),4===f&&(r+=-.34*i),5===f&&(r+=-.4*i),6===f&&(r+=-.65*i),7===f&&(r+=-.37*i),8===f&&(r+=-.48*i),9===f&&(r+=-.49*i),f>=10&&f<=14&&(r+=-.47*i),f>=15&&f<=19&&(r+=-.51*i),f>=20&&f<=24&&(r+=-.57*i),f>=60&&f<=64&&(r+=-.87*i),0===m&&(r+=.06*i),1===m&&(r+=-.24*i),2===m&&(r+=-.28*i),3===m&&(r+=-.22*i),4===m&&(r+=-.27*i),5===m&&(r+=-.
107*i),6===m&&(r+=.09*i),m>=10&&m<=14&&(r+=-.03*i),0===y&&(r+=.06*i),1===y&&(r+=-.22*i),2===y&&(r+=-.35*i),3===y&&(r+=-.43*i),4===y&&(r+=-.44*i),5===y&&(r+=.21*i),y>=10&&y<=14&&(r+=-.33*i),0===ie&&(r+=.05*i),.1===ie&&(r+=-.4*i),.2===ie&&(r+=.27*i),.3===ie&&(r+=.39*i),.5===ie&&(r+=.04*i),.6===ie&&(r+=.51*i),.7===ie&&(r+=.78*i),.8===ie&&(r+=.48*i),1===ie&&(r+=-.38*i),"weekdays"===u&&(r+=.01*i),"weekends"===u&&(r+=-.02*i),"campaigncampaign"===h&&(r+=.47*i),"campaigninternal"===h&&(r+=.28*i),"directdirect"===h&&(r+=.14*i),"directinternal"===h&&(r+=.01*i),"internalinternal"===h&&(r+=-.09*i),"otherother"===h&&(r+=.07*i),"searchdirect"===h&&(r+=.1*i),"searchinternal"===h&&(r+=.78*i),"searchsearch"===h&&(r+=-.07*i),"socialsocial"===h&&(r+=-.21*i),0===s&&(r+=.56*i),.5===s&&(r+=.06*i),1===s&&(r+=-.17*i),"mobileandroid"===w&&(r+=.1*i),"mobileios"===w&&(r+=-.46*i),"mobilemac os"===w&&(r+=1.45*i),"mobilewindows"===w&&(r+=3.9*i),"otherchromium os"===w&&(r+=2.04*i),"otherlinux"===w&&(r+=-.34*i),"othermac os"===w&&(r+=.11*i),"otherwindows"===w&&(r+=.37*i),"tabletandroid"===w&&(r+=-.03*i),"tabletios"===w&&(r+=-.56*i),"tabletmac os"===w&&(r+=-.48*i)),de="anonymous"===e.visitorType?t+ue+pe:t+ue+ye;let fe=.5+r;return ee&&(de+=.01*(o-.5)),ee&&(fe+=.01*(o-.5)),de<=.01?de=.01:de>1&&(de=1),fe<=.01?fe=.01:fe>1&&(fe=1),"search"===e.referrerData.medium&&"google"===e.referrerData.source&&"discover"===e.referrerData.channel&&de<.5&&(de=0),b&&(de=0),{[L.PAYWALL]:de,[L.REGWALL]:fe}}(e);case"holdout":return function(e){return X(e)}(e);default:return X(e)}}return Q=o,((e,o,s,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let l of r(o))i.call(e,l)||l===s||t(e,l,{get:()=>o[l],enumerable:!(a=n(o,l))||a.enumerable});return e})(t({},"__esModule",{value:!0}),Q)})();e.push(n.default),t.push({definition:"www.theglobeandmail.com",evaluator:e[0]}),t.push({definition:"www.theglobeandmail.com/experiment.assignedGroup=control",evaluator:e[0]}),t.push({definition:"www.theglobeandmail.com/experiment.assignedGroup=variant",evaluator:e[0]});var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this,i=r&&r.createDemeter;if("function"==typeof i){try{delete r.createDemeter}catch(e){r.createDemeter=void 0}try{var o=i({experiences:[{definition:"www.theglobeandmail.com",policy:{thresholds:{user:{paywall:{anonymous:.55,registered:.07},regwall:.01}}}},{definition:"www.theglobeandmail.com/experiment.assignedGroup=control",policy:{thresholds:{user:{paywall:{anonymous:.58,registered:.16},regwall:.01}}}},{definition:"www.theglobeandmail.com/experiment.assignedGroup=variant",policy:{thresholds:{user:{paywall:{anonymous:.57,registered:.14},regwall:.01}}}}]},{experiences:t});o&&"function"==typeof o.then&&o.catch(function(e){console.error("Error initializing SDK with thresholds",e)})}catch(e){console.error("Error initializing SDK with thresholds",e)}}else console.error("createDemeter is not defined on window/globalThis")}();
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.