!function(){"use strict";function t(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}function r(r){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=r.apply(e,n);function c(r){t(a,o,i,c,u,"next",r)}function u(r){t(a,o,i,c,u,"throw",r)}c(void 0)}))}}function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t,r,n){return(r=function(t){var r=function(t){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function o(t){return[...new Uint8Array(t)].map((t=>t.toString(16).padStart(2,"0"))).join("")}function i(){return(i=r((function*(t){var r,e,n=t.toLowerCase(),i=(new TextEncoder).encode(n+"+xp1myx6fqykn7"),a=o(yield crypto.subtle.digest("SHA-256",i)),c=(new TextEncoder).encode(n),u=o(yield crypto.subtle.digest("SHA-256",c)),d=function(t){var r=t.trim().toLowerCase();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r))throw new Error("Invalid email format");var[e,n]=r.split("@");if("gmail.com"===n){var o=e.replace(/\./g,"").split("+")[0];r="".concat(o,"@").concat(n)}return r}(t),s=(new TextEncoder).encode(d);return{hashedEmail:a,noSaltHashedEmail:u,normalizedEmailHashBase64:(r=yield crypto.subtle.digest("SHA-256",s),e=String.fromCharCode(...new Uint8Array(r)),btoa(e))}}))).apply(this,arguments)}var a=function(){var t=r((function*(){if(!window.crypto||!window.crypto.subtle)throw new Error("Crypto not supported");return yield window.crypto.subtle.importKey("raw",(new TextEncoder).encode("IN6H1akL63KYAE69bY6GSvTSc0qjip9m"),{name:"AES-GCM"},!1,["encrypt","decrypt"])}));return function(){return t.apply(this,arguments)}}(),c=function(){var t=r((function*(t){try{if(!window.crypto||!window.crypto.subtle)throw new Error("Crypto not supported");var r=crypto.getRandomValues(new Uint8Array(12)),e=yield window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},yield a(),(new TextEncoder).encode(JSON.stringify(t)));return{data:btoa(String.fromCharCode(...new Uint8Array(e))),iv:btoa(String.fromCharCode(...r))}}catch(r){return console.error("Aqfer Error encrypting data, falling back to base64:",r),{data:btoa(JSON.stringify(t)),iv:""}}}));return function(_x){return t.apply(this,arguments)}}(),u=function(){var t=r((function*(t){return btoa(JSON.stringify(yield c(t)))}));return function(r){return t.apply(this,arguments)}}(),d=function(){var t=r((function(t){var{data:r,iv:e}=t;return function*(){try{if(!window.crypto||!window.crypto.subtle)throw new Error("Crypto not supported");var t=yield window.crypto.subtle.decrypt({name:"AES-GCM",iv:new Uint8Array(Uint8Array.from(atob(e),(t=>t.charCodeAt(0))))},yield a(),new Uint8Array(Uint8Array.from(atob(r),(t=>t.charCodeAt(0)))));return JSON.parse((new TextDecoder).decode(t))}catch(t){return console.error("Aqfer Error decrypting data, falling back to base64:",t),JSON.parse(atob(r))}}()}));return function(r){return t.apply(this,arguments)}}(),s=function(){var t=r((function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function*(){try{var{data:e,iv:n}=JSON.parse(atob(t));return yield d({data:e,iv:n}).catch((()=>null))}catch(t){return r||console.error("Aqfer Error getting encrypted data/iv from string:",t),null}}()}));return function(r){return t.apply(this,arguments)}}(),l=function(){var t=r((function*(t){if(t.startsWith("{"))return JSON.parse(t)||{};try{return yield s(t)}catch(t){console.error("Aqfer Error decrypting data:",t)}return{}}));return function(_x){return t.apply(this,arguments)}}(),p=function(){var t=r((function*(t,r){var e,n="__cachedAqferData_".concat(r),o=null===(e=window.localStorage)||void 0===e?void 0:e.getItem(n);if(o){var{data:i,expiration:a}=(yield l(o))||{};if(i&&a&&a>(new Date).getTime())return i}var{nypAqfer:{aqferAccessToken:c=null,isProduction:d=!1}={}}=window;if(!c||!c.length)throw new Error("No aqferAccessToken found.");return fetch(t,{headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"}}).then((t=>t.json())).then((t=>{var r=(new Date).getTime(),e=r+6048e5;return t.error&&t.error.toLowerCase().includes("not found")&&(e=r+864e5),d||(e=r+3e5),u(JSON.stringify({data:t,expiration:e})).then((t=>{var r;null===(r=window.localStorage)||void 0===r||r.setItem(n,t)})),t}))}));return function(r,e){return t.apply(this,arguments)}}(),f=t=>{for(var r=document.cookie.split(";").map((t=>t.trim())),e=0;e{try{var t,r=JSON.parse((null===(t=window.localStorage)||void 0===t?void 0:t.getItem("zephr"))||"{}")||{};return r&&"object"==typeof r?r:{}}catch(t){return{}}},w=function(){var t=r((function*(t){if(!crypto)return t;var r=(new TextEncoder).encode(t);return crypto.subtle.digest("SHA-256",r).then((t=>Array.from(new Uint8Array(t)).map((t=>t.toString(16).padStart(2,"0"))).join("")))}));return function(_x){return t.apply(this,arguments)}}(),v=w,m=function(){var t=r((function(t){var{aut:r,nypId:e,email:n}=t;return function*(t){var o=[];e&&o.push({id:e,tag:"_nypid-sync",priority:1}),r&&o.push({id:r,tag:"_autid-sync",priority:2});var{user:{sessionId:i=null}={}}=y();if(!i&&n){var a=yield v(n);o.push({id:a,priority:0,tag:"email_sha256"})}o.length?(window.permutive||console.warn("Aqfer Permutive Error: window.permutive is not defined."),null===(t=window.permutive)||void 0===t||t.identify(o),console.log("Aqfer Permutive Identify:",o)):console.log("Aqfer Permutive Error: No IDs to identify.")}()}));return function(_x){return t.apply(this,arguments)}}();function g(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function h(t){for(var r=1;r{var{type:r,key:e}=t;o[r]||(o[r]=e)})),o.ny_post_id&&(e=o.ny_post_id,null===(n=window.localStorage)||void 0===n||n.setItem("nyp_id",o.ny_post_id),window.dispatchEvent(new CustomEvent("nyp-aqfer:nyp-id-ready",{detail:{nypId:e}})));var a=o.em||null;window.nypAqfer.featureFlags.aud4&&(a=a||o.aud4||null),a&&(c=a,f("uid2_identity")||(console.log("Aqfer: Fetching UID2 token for ".concat(c)),fetch("https://api.nypdev.com/ads/tradedesk/token",{body:JSON.stringify({email:c}),headers:{Authorization:"Basic QGxsZXk6dmZEVEJPM1Y3cnJ5","Content-Type":"application/json"},method:"POST"}).then((t=>t.ok?t.json():Promise.reject(t))).then((t=>{var{Message:{Data:r}={}}=t;r&&((t,r)=>{var e=new Date;e.setTime(e.getTime()+31536e6);var n="expires=".concat(e.toUTCString());document.cookie="".concat("uid2_identity","=").concat(r,";").concat(n,";path=/")})(0,JSON.stringify(r))})).catch((t=>console.error("Error fetching UID2 token",t)))),(t=>{var r=()=>{var r=window.atsenvelopemodule||window.ats||null;r&&t&&r.setAdditionalData&&r.setAdditionalData({type:"email",id:t})};window.atsenvelopemodule||window.ats?r():window.addEventListener("envelopeModuleReady",r)})(a),window.nypScripts=window.nypScripts||{},window.nypScripts.idHashes=h({},yield function(_x){return i.apply(this,arguments)}(a))),m({aut:t,nypId:e,email:a})}else console.error("Aqfer Neighbors Error","Invalid response from Aqfer.");var c}));return function(t){return n.apply(this,arguments)}}()).catch((t=>console.error("Aqfer Neighbors Error",t)))}));return function(r){return t.apply(this,arguments)}}(),A=t=>{window.ga4Dims=window.ga4Dims||{},window.ga4Dims.ga_aut_id=t,void 0!==window.gtag&&window.gtag("event","auttag",window.ga4Dims)},E=()=>{if(!document.cookie)return"";var t="";return document.cookie.split(";").forEach((r=>{r.includes("_autid=")&&(window.ga4Dims=window.ga4Dims||{},window.ga4Dims.ga_aut_id=r.split("=")[1]),r.includes("sailthru_visitor=")&&([,t]=r.split("="))})),t},_=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8e3,e=f("_autid");if(e)t(e);else{var n=!1,o=setTimeout((()=>{n||t(null)}),r);window.addEventListener("nyp-aqfer:aut-cookie-ready",(r=>{clearTimeout(o);var{detail:{aut:e=f("_autid")}={}}=r;n=!0,t(e),clearTimeout(o)}))}};r((function*(){var t,r,e=y(),{user:{account:{emailAddress:n=""}={},trackingId:o=""}={}}=e,{nypAqfer:{featureFlags:{tag:i=!1}={},root:a=""}={}}=window;i&&(null!==(t=window.localStorage)&&void 0!==t&&t.getItem("__cachedAqferResponse_neighbors")&&(null===(r=window.localStorage)||void 0===r||r.removeItem("__cachedAqferResponse_neighbors")),(()=>{var{root:t=""}=window.nypAqfer||{};window.addEventListener("message",(r=>{if(r.origin===t){var{data:e}=r;try{var n,o,i=JSON.parse(e),{message:a="",sub_autId:c="",sub_ipaddr:u=""}=i;"aut cookie ready"===a&&c&&window.dispatchEvent(new CustomEvent("nyp-aqfer:aut-cookie-ready",{detail:{aut:c}})),localStorage?(c&&(null===(n=localStorage)||void 0===n||n.setItem("_autId",c)),u&&(null===(o=localStorage)||void 0===o||o.setItem("ipaddr",u))):console.error("localStorage is not supported on this browser for ID5 Identity Resolution")}catch(t){console.log("Aqfer: Error parsing message for ID5 Identity Resolution",t)}}}))})(),_(S),_(A),(t=>{var{nypAqfer:{isProduction:r=!1}={}}=window,e=t;r||(e.cls="preprod"),console.log("Aqfer C057Data",e),window.c057Data=e,function(t,r,e,n){var o,i=[],a=t.tt.slice(-1),c={cdmn:1,lm:1,tt:1},u={cid:1,cls:1,dmn:1,pubid:1,evid:1,aq_m:1};for(o in t.dmn=(t.dmn||(e.top[n]===e[n]?""+e[n]:r.referrer).split("/")[2]).split(":")[0],t)(u[o]||("j"!=a||t.aq_m)&&!c[o])&&i.push(o+"="+t[o]);var d=r.createElement("f"==a?"img":"script");d.id=d.title="pxscrpt",d.async=d.defer=!0,d.src="//"+t.cdmn+"/1/"+t.lm+"/"+t.tt+"?"+i.join("&"),r.body.appendChild(d)}(e,document,window,"location")})({cdmn:a.replace("https://",""),lm:"e",tt:"tcs.dhj",aqet:"pv",v0:n,v1:E(),v2:o,v3:"",v4:"",v5:""}))}))()}();