1(()=>{"use strict";const t=function(t){const e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:window).document.cookie.match(`(^|;) ?${t}=([^;]*)(;|$)`);return e?e[2]:null},e={CAPTURE_EXCEPTION_EVENT:"com.consumeraffairs.styleguide.logger.captureException",CAPTURE_MESSAGE_EVENT:"com.consumeraffairs.styleguide.logger.captureMessage"};class i{static get CSRF_COOKIE_NAME(){return window.CSRF_COOKIE_NAME||"csrftoken"}static get FORM_CONTENT_TYPE(){return"application/x-www-form-urlencoded"}constructor(t){if(!t)throw new Error("APIClient called without a model!");this.model=t}fetch(){const{contentType:t,data:e,method:n,url:s}=this.model,a={method:n?n.toUpperCase():"GET",headers:this._getHeaders(),credentials:"include"};let r=s;return Object.keys(e).length>0&&("GET"===a.method?r+=`?${new URLSearchParams(e).toString()}`:a.body=JSON.stringify(e)),this._logRequest({contentType:t,data:e,url:r,parameters:a,through:"fetch"}),window.fetch(r,a).then(t=>{if(t.ok){const e=t.json();return e&&"function"==typeof e.catch?e.catch(t=>{if(t instanceof SyntaxError)return{};throw t}):e}return t.text().then(e=>{let i;try{i=e&&e.trim()?JSON.parse(e):{}}catch{i={_raw:e}}const n=new Error("Request error");throw n.status=t.status,n.response=Promise.resolve(i),n})}).then(e=>t===i.FORM_CONTENT_TYPE?e:JSON.stringify(e))}sendBeacon(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};const{data:e,url:i}=this.model;if(navigator.sendBeacon){const t=this._setBeaconDataContentType(e);return this._logRequest({data:t,url:i,through:"beacon"}),navigator.sendBeacon(i,t)}return this.fetch().catch(t),!0}_getHeaders(){const{contentType:e}=this.model;return{"Content-Type":e,"X-CSRFToken":t(i.CSRF_COOKIE_NAME)||"",...this._getCustomHeaders()}}_getCustomHeaders(){const{headers:t}=this.model;return t.reduce((t,e)=>({...t,[e.key]:e.value}),{})}_setBeaconDataContentType(t){return new Blob([JSON.stringify(t)],{type:"application/json"})}_logRequest(t){if(!window.caEnableHttpRequestsLogging)return;const i=new CustomEvent(e.CAPTURE_MESSAGE_EVENT,{detail:{message:"[APIClientV2] HTTP request sent",level:"debug",context:t}});window.dispatchEvent(i)}}class n{constructor(){this._headers=[],this._url="",this._method="GET",this._data={},this._contentType="application/json",this._csrfToken=!1}get headers(){return[...window.APIClient&&window.APIClient.headers?window.APIClient.headers:[],...this._headers]}set headers(t){Array.isArray(t)&&t.every(t=>t.key&&t.value)&&(this._headers=t)}get url(){return this._url}set url(t){this._url=t}get method(){return this._method}set method(t){this._method=t}get data(){return this._data}set data(t){this._data=t}get contentType(){return this._contentType}set contentType(t){this._contentType=t}get csrfToken(){return this._csrfToken}set csrfToken(t){this._csrfToken=t}}class s{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;this._window=t}getEndpoint(t){const{origin:e}=this._window.location;return`${e}${t}`}isProxy(){return Boolean(this._window.CAUApi?.isProxy)}}class a{constructor(){this.reset()}get category(){return this._category}set category(t){this._category=t}get name(){return this._name}set name(t){this._name=t}get data(){return this._data}set data(t){this._data=t}get ts(){return this._ts}set ts(t){this._ts=t}get sd(){return this._sd}set sd(t){this._sd=t}_isGAEnabled(){return!!(window.ga&&"function"==typeof window.ga&&window.ga.loaded&&Object.keys(window.ga).length>5&&window.ga.q)}_experimentData(){return"experiment"===this._category&&"enrollment"===this._name&&this._data.third_party_source?{third_party_experiments:{[this._data.third_party_source]:{[this._data.id]:{campaign_id:this._data.third_party_campaign_id,variation_id:this._data.third_party_variant,experiment_id:this._data.third_party_id,holdout_experiment_id:this._data.third_party_holdout_experiment_id,in_global_holdout:this._data.third_party_in_global_holdout,experiment_slug:this._data.third_party_slug,variant_slug:this._data.third_party_variant_slug}}}}:{}}reset(){this._data={},this._category="page interaction",this._name="",this._ts="",this._sd={}}get payload(){return{category:this._category,name:this._name,data:this._data,...this._ts?{ts:this._ts}:{},sd:{ga_enabled:this._isGAEnabled(),...this._experimentData(),...this._sd}}}}class r{static get PROXY_ENDPOINT(){return"/api/uapi/ep/"}static get NON_PROXY_ENDPOINT(){return"/api/uapi/e/"}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;this._window=t,this._endpointHelper=new s(this._window),this._apiClientModel=new n,this._apiClientModel.csrfToken=!0;const e=this._endpointHelper.isProxy()?r.PROXY_ENDPOINT:r.NON_PROXY_ENDPOINT;this._apiClientModel.url=this._endpointHelper.getEndpoint(e),this._apiClientModel.method="POST",this._apiClient=new i(this._apiClientModel),this._model=new a,this._handleError=this._handleError.bind(this)}_getPageType(){const t=this._window.CDPData?.page_type;return t&&"string"==typeof t&&""!==t.trim()?t.trim():"n/a"}_handleError(t){const i=new CustomEvent(e.CAPTURE_EXCEPTION_EVENT,{detail:{message:`[CAUserDB Tracker]: Error on network request. ${t}`}});window.dispatchEvent(i)}sendEvent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._model.reset();
1["name","data","category","sd","ts"].forEach(e=>{e in t&&(this._model[e]=t[e])});const e=this._model.data&&this._model.data.page_type;this._model.data={...this._model.data,page_type:e||this._getPageType()},this._apiClientModel.data=this._model.payload,this._apiClient.sendBeacon(this._handleError)}sendEventsCollection(t){t&&Array.isArray(t)&&(this._model.reset(),this._apiClientModel.data=t,this._apiClient.sendBeacon(this._handleError))}}class o{static get BIND_CLICKS_EVENT(){return"com.consumeraffairs.uapi.linkTracker"}static get LINK_TRACKER_ATTRIBUTE(){return"data-uapi-link"}static get LINK_TRACKER_DATA_ATTRIBUTE(){return"data-uapi-link-payload"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;this._window=e,this._storageModel=t,this._clickTrackedLinksHandler=this._clickTrackedLinksHandler.bind(this),this._mousedownEventHandler=this._mousedownEventHandler.bind(this),this._bindEvents(),this._init()}_prepareLocalStorageData(t,e){const i={elementLabel:t,actionTimestamp:(new Date).getTime(),querystring:this._window.location.search,path:this._window.location.pathname,rawPath:this._window.location.pathname+this._window.location.search,referer:this._window.document.referrer,...e?{extraData:e}:{}};return JSON.stringify(i)}_saveEventData(t){const e=t.currentTarget.getAttribute(o.LINK_TRACKER_ATTRIBUTE),i=t.currentTarget.getAttribute(o.LINK_TRACKER_DATA_ATTRIBUTE)||"",n=this._prepareLocalStorageData(e,i);try{this._window.localStorage.setItem(this._storageModel.STORAGE_KEY,n)}catch{}}_mousedownEventHandler(t){this._saveEventData(t)}_bindElements(t){const e=t.detail&&t.detail.container;if(!e)return;e.querySelectorAll(`[${o.LINK_TRACKER_ATTRIBUTE}]`).forEach(t=>{t.addEventListener("mousedown",this._mousedownEventHandler)})}_clickTrackedLinksHandler(t){this._bindElements(t)}_bindEvents(){this._window.addEventListener(o.BIND_CLICKS_EVENT,this._clickTrackedLinksHandler)}_init(){const t={container:document},e=new CustomEvent(o.BIND_CLICKS_EVENT,{detail:t});this._window.dispatchEvent(e)}}class d extends r{static get EVENT_NAME(){return"cta click"}static get EVENT_NAME_ATTR(){return"data-uapi-event-name"}static get EVENT_DATA_ATTR(){return"data-uapi-event"}static get EVENT_BINDED_ATTR(){return"data-uapi-event-binded"}static get EVENT_WRAPPER_DATA_ATTRIBUTE(){return`[${d.EVENT_DATA_ATTR}]`}static get EVENT_BINDED_DATA_ATTRIBUTE(){return`[${d.EVENT_BINDED_ATTR}]`}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window),this._window.CAUApiEvent={},this._window.CAUApiEvent.refreshTargets=this._refreshTargets.bind(this),this._window.CAUApiEvent.cleanupEventBindedAttr=this._cleanupEventBindedAttr.bind(this),this._bindEvents()}_bindEvents(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._window.document).querySelectorAll(`\n ${d.EVENT_WRAPPER_DATA_ATTRIBUTE}:not(${d.EVENT_BINDED_DATA_ATTRIBUTE})\n `).forEach(t=>{t.setAttribute(d.EVENT_BINDED_ATTR,!0),t.addEventListener("click",this._elementClickHandler.bind(this,t))})}_elementClickHandler(t){const e=t.getAttribute(d.EVENT_NAME_ATTR)||d.EVENT_NAME;let i=null;try{i=JSON.parse(t.getAttribute(d.EVENT_DATA_ATTR))}catch(t){throw new Error("Not valid JSON",t)}this.sendEvent({name:e,data:i})}_refreshTargets(t){this._bindEvents(t);const e=new CustomEvent(o.BIND_CLICKS_EVENT,{detail:{container:t}});this._window.dispatchEvent(e)}_cleanupEventBindedAttr(t){if(!t)return;t.querySelectorAll(d.EVENT_BINDED_DATA_ATTRIBUTE).forEach(t=>{t.removeAttribute(d.EVENT_BINDED_ATTR)})}}const _="custom event",h="com.consumeraffairs.uapi";class c extends r{static get KEY_TIME_LIMIT(){return 12e4}constructor(t){super(arguments.length>1&&void 0!==arguments[1]?arguments[1]:window),this._storageModel=t;let e=null;try{e=this._window.localStorage.getItem(this._storageModel.STORAGE_KEY)}catch{return}e&&(this._data=this._getParsedLocalStorageData(e),this._data&&(this._validateRequiredKeys(),this._validateEventTimeFrame()))}_validateRequiredKeys(){if(!this._storageModel.REQUIRED_KEYS.every(t=>t in this._data)){this._removeStoredTrackedItem();
1const t={requiredKeys:this._storageModel.REQUIRED_KEYS,receivedPayload:this._data},i=new CustomEvent(e.CAPTURE_EXCEPTION_EVENT,{detail:{message:"Missing required keys on localStorage.",context:t}});this._window.dispatchEvent(i)}}_getParsedLocalStorageData(t){try{return JSON.parse(t)}catch(i){this._removeStoredTrackedItem();const n=new CustomEvent(e.CAPTURE_EXCEPTION_EVENT,{detail:{message:"Not possible to parse localStorageData on stored tracker sender.",context:{error:i,localStorageData:t}}});return this._window.dispatchEvent(n),null}}_removeStoredTrackedItem(){try{this._window.localStorage.removeItem(this._storageModel.STORAGE_KEY)}catch{}}_validateEventTimeFrame(){const t=(new Date).getTime()-this._data.actionTimestamp,i=t<c.KEY_TIME_LIMIT;if(i)this._sendEvent();else{this._removeStoredTrackedItem();const n={localStorageEvent:i,expirationEvaluation:`${t} < ${c.KEY_TIME_LIMIT}`,data:this._data},s=new CustomEvent(e.CAPTURE_MESSAGE_EVENT,{detail:{message:"Stored tracker has expired.",level:"info",context:n}});this._window.dispatchEvent(s)}}_validateParsedExtraData(t){if(!t)return{};try{return JSON.parse(t)}catch(i){this._removeStoredTrackedItem();const n=new CustomEvent(e.CAPTURE_EXCEPTION_EVENT,{detail:{message:"ExtraData is not a valid json.",context:{error:i,extraData:t}}});return this._window.dispatchEvent(n),null}}_sendEvent(){const{extraData:t}=this._data;this.sendEvent({name:this._storageModel.EVENT_NAME,data:this._storageModel.getEventData(this._data,this._validateParsedExtraData(t)),ts:new Date(this._data.actionTimestamp).toJSON()}),this._removeStoredTrackedItem()}}class l{validate(t){const{name:e,value:i}=t;return this._errors=[],this._name(e),this._value(i),!(this._errors.length>0)||(this._logErrors(),!1)}_name(t){if(!(t&&"string"==typeof t&&t.trim().length>0)){const e=`"${t}" is not a valid cookie name`;this._errors.push(e)}}_value(t){if(!t){const e=`"${t}" is not a valid cookie value`;this._errors.push(e)}}_logErrors(){this._errors.forEach(t=>{const i=new CustomEvent(e.CAPTURE_EXCEPTION_EVENT,{detail:{message:`[CACookieUtil]: ${t}`}});window.dispatchEvent(i)})}}class E{checkExistenceOf(t){return document.cookie.split(";").some(e=>e.trim().startsWith(`${t}=`))}deleteCookie(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";return!!this.checkExistenceOf(t)&&(document.cookie=`${t}=; path=${e}; expires=Thu, 01 Jan 1970 00:00:00 GMT`,!0)}getValueOf(t){const e=new RegExp(`(?:(?:^|.*;\\s*)${t}\\s*\\=\\s*([^;]*).*$)|^.*$`);return document.cookie.replace(e,"$1")||void 0}setCookie(t){if((new l).validate(t)){const e=this.stringifyValues(t);return document.cookie=e,!0}return!1}updateCookie(t){return!!this.checkExistenceOf(t.name)&&this.setCookie(t)}stringifyValues(t){let e=`${t.name}=${t.value};`;return Object.keys(t).forEach(i=>{"name"!==i&&"value"!==i&&(e+=`${i}=${t[i]};`)}),e}}class u extends r{static get EVENT_NAME(){return"ping"}static get CATEGORY_NAME(){return"metrics"}static get PING_INTERVALS(){return{INIT:15e3,MAINTENANCE:6e4,SLEEP:36e5}}static get INIT_PING_QTY(){return 6}static get BOUNCE_PING_TIMEOUT(){return 5e3}static get MAINTENANCE_PING_QTY(){return 66}static get BOUNCE_COOKIE_NAME(){return"bounceCookie"}static get BOUNCE_ELEMENT_NAME(){return"quick-bounce-ping-5"}get _initPingIsOver(){return this._pingCount>=u.INIT_PING_QTY&&this._pingCount<u.MAINTENANCE_PING_QTY}get _maintenancePingIsOver(){return this._pingCount>=u.MAINTENANCE_PING_QTY}get _shouldUpdateInterval(){return!this._sleepPingIsActive&&(this._initPingIsOver&&!this._maintenancePingIsActive||this._maintenancePingIsOver)}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window),this._pingCount=0,this._maintenancePingIsActive=!1,this._sleepPingIsActive=!1,this._cookieUtil=new E,this._bindMethods(),this._bindEvents(),this._isFirstPageVisited=this._checkFirstPageVisited(),this._executeProgrammaticPings(),this._executeBouncePing()}_bindMethods(){this._executePing=this._executePing.bind(this),this._onVisibilityChangeHandler=this._onVisibilityChangeHandler.bind(this)}_bindEvents(){this._window.document.addEventListener("visibilitychange",this._onVisibilityChangeHandler,!1)}
1_setBounceCookie(){const t={domain:".consumeraffairs.com",name:u.BOUNCE_COOKIE_NAME,value:"true",path:"/"};this._cookieUtil.setCookie(t)}_checkFirstPageVisited(){return!this._cookieUtil.checkExistenceOf(u.BOUNCE_COOKIE_NAME)&&(this._setBounceCookie(),!0)}_executeBouncePing(){this._isFirstPageVisited&&setTimeout(()=>{this._sendEvent({element:u.BOUNCE_ELEMENT_NAME})},u.BOUNCE_PING_TIMEOUT)}_getPingInterval(){let t;return t=this._initPingIsOver?u.PING_INTERVALS.MAINTENANCE:this._maintenancePingIsOver?u.PING_INTERVALS.SLEEP:u.PING_INTERVALS.INIT,t}_executePing(){this._sendEvent(),this._pingCount+=1,this._shouldUpdateInterval&&this._setInterval()}_sendEvent(t){const e={context:t};t||delete e.context,this.sendEvent({name:u.EVENT_NAME,category:u.CATEGORY_NAME,data:e})}_onVisibilityChangeHandler(){this._executeProgrammaticPings()}_executeProgrammaticPings(){const t=this._window.document.visibilityState;"visible"===t&&(this._executePing(),this._setInterval()),"hidden"===t&&this._clearInterval()}_setInterval(){this._clearInterval(),this._intervalID=this._window.setInterval(this._executePing,this._getPingInterval()),this._maintenancePingIsActive=this._getPingInterval()===u.PING_INTERVALS.MAINTENANCE,this._sleepPingIsActive=this._getPingInterval()===u.PING_INTERVALS.SLEEP}_clearInterval(){this._window.clearInterval(this._intervalID)}}const g="com.consumeraffairs.uapi.storedEvent";class T extends r{static get EVENT_NAME(){return"visibility_change"}static get CATEGORY_NAME(){return"page state"}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window),this._bindMethods(),this._initListeners()}_bindMethods(){this._onVisibilityChange=this._onVisibilityChange.bind(this)}_initListeners(){this._window.addEventListener("visibilitychange",this._onVisibilityChange)}_onVisibilityChange(){"visible"!==this._window.document.visibilityState?this._sendEvent(this._window.document.visibilityState):setTimeout(()=>this._sendEvent(this._window.document.visibilityState),100)}_sendEvent(t){this.sendEvent({name:T.EVENT_NAME,category:T.CATEGORY_NAME,data:{state:t}})}}const m="data-uapi-event-name",w="data-details-tracker-binded";const v=new class{get STORAGE_KEY(){return"trackedCTALink"}get REQUIRED_KEYS(){return["querystring","path","rawPath","elementLabel","actionTimestamp","referer"]}get EVENT_NAME(){return"cta click"}getEventData(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{querystring:i,path:n,rawPath:s,referer:a}=t;return{element:t.elementLabel,type:"link",target_url:window.location.host+window.location.pathname+window.location.search,path:n,raw_path:s,querystring:i,referer:a,...e}}},p=new class{get STORAGE_KEY(){return"trackedCustomStorage"}get REQUIRED_KEYS(){return["element","name","term","result_url","actionTimestamp"]}get EVENT_NAME(){return"site-search"}getEventData(t){const{element:e,name:i,term:n,result_url:s}=t;return{element:e,name:i,term:n,result_url:s}}};new c(v,window),new c(p,window),new class{constructor(t){this._storageModel=t,this._bindCustomEvent()}_bindCustomEvent(){window.addEventListener(g,this._handleCustomSaveEvent.bind(this))}_handleCustomSaveEvent(t){let{detail:e}=t;if(!e)return;const{eventData:i}=e;i&&this._saveEventData(JSON.stringify(i))}_saveEventData(t){try{window.localStorage.setItem(this._storageModel.STORAGE_KEY,t)}catch{}}}(p),new o(v,window),new d(window),new class extends r{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window),this._bindMethods(),this._bindEvents()}_bindMethods(){this._customEventHandler=this._customEventHandler.bind(this)}_bindEvents(){this._window.addEventListener(h,this._customEventHandler)}_customEventHandler(t){let{detail:{category:e,name:i,data:n,sd:s}}=t;this.sendEvent({category:e||"page interaction",name:i||_,data:n,sd:s})}}(window),new u(window),new T(window),new class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;this.window=t,this.document=this.window.document,this.userGestured=new WeakSet,this.observer=new MutationObserver(this.getDOMChanges.bind(this)),this.observer.observe(this.document.body,{childList:!0,attributes:!1,subtree:!0}),this.bindEvents(),this.bindInitializer()}rebindEvents(t){this.bindEvents(t.detail.context)}bindInitializer(){this.window.addEventListener("com.consumeraffairs.styleguide.detailsTracker.init",this.rebindEvents.bind(this))}getDOMChanges(t){t.forEach(t=>
1{t.addedNodes.forEach(t=>{"childNodes"in t&&t.childNodes.length>0&&this.bindEvents(t)})})}_getDisclosure(t){return"DETAILS"===t.tagName?t:"SUMMARY"===t.tagName?t.closest("details"):null}_markUserGesture(t){this.userGestured.add(t)}_toggleHandler(t,e){if(!e.open)return;if(!this.userGestured.has(e))return;const i=t.getAttribute("data-uapi-details-event");if(!i)return;let n;try{n=JSON.parse(i)}catch(t){return}const s=t.getAttribute(m);this.window.dispatchEvent(new CustomEvent("com.consumeraffairs.uapi",{detail:{name:s,data:n}}))}bindEvents(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.document;const e=t.querySelectorAll(`[${m}]`);(t.matches?.(`[${m}]`)?[t,...e]:e).forEach(t=>{if("content toggle"!==t.getAttribute(m))return;const e=this._getDisclosure(t);if(!e)return;if(e.hasAttribute(w))return;e.setAttribute(w,!0),e.addEventListener("toggle",()=>this._toggleHandler(t,e));const i=()=>this._markUserGesture(e);e.addEventListener("pointerdown",i),e.addEventListener("keydown",i),e.addEventListener("click",i)})}}(window)})();
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.