/*! @amzn/apswebapstaglibrary - web-client-bundle - v25.618.1618 - 2025-06-18 16:18:01 */ !function(){"use strict";var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};function n(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var e=function(){return e=Object.assign||function(t){for(var n,e=1,i=arguments.length;e0&&r[r.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var i,r,o=e.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(r)throw r.error}}return a}function s(t,n,e){if(e||2===arguments.length)for(var i,r=0,o=n.length;r=0&&t<=1?t:1};"number"==typeof(null==t?void 0:t.error)&&this.v.set("error",n(t.error)),"number"==typeof(null==t?void 0:t.feat)&&this.v.set("feat",n(t.feat))},t.prototype.clearAndUpdateEventProcessingInterval=function(t){var n=this;"number"!=typeof t||t<=0||t!==this.m&&(clearInterval(this._),this._=setInterval((function(){try{n.processEventRecords()}catch(t){}}),t),this.m=t)},t.prototype.processEventRecords=function(){for(var t=[],n=Array.from(this.p.keys()),e=function(e){var r=n[e],o=i.p.get(r),a=i.v.get(r);if(void 0===o||o.length<=0)return"continue";if(void 0===a||0===a)return o.length>=i.l&&(o.length=0,i.logEvent({eventCategory:r,eventName:"queue limit reached"})),"continue";var d=o.filter((function(t){return void 0!==t&&a>=Math.random()}));o.length=0,t.push.apply(t,s([],u(d),!1))},i=this,r=0;rthis.STACK_MAX_LENGTH){return t.stack.substring(0,this.STACK_MAX_LENGTH-5)+"[...]"}return t.stack}catch(t){return"NO STACK: ERROR ON RETRIEVAL"}},t.prototype.getErrorName=function(t){var n="unknown";try{"string"==typeof t?n=t:void 0!==t.name&&(n=t.name)}catch(t){try{n="Client Error: ".concat(t.name.toString()," - ").concat(t.message)}catch(t){n="Client Error: Unable to provide more information"}}return n},t.prototype.getErrorMessage=function(t){var n="unknown";try{"string"==typeof t?n=t:void 0!==t.message&&(n=t.message)}catch(t){try{n="Client Error: ".concat(t.name.toString()," - ").concat(t.message)}catch(t){n="Client Error: Unable to provide more information"}}return n},t.prototype.getErrorContext=function(t){var n,e="unknown";try{"string"!=typeof t&&"context"in t&&(e=null!==(n=t.context)&&void 0!==n?n:"")}catch(t){try{e="Client Error: ".concat(t.name.toString()," - ").concat(t.message)}catch(t){e="Client Error: Unable to provide more information"}}return e},t}(),g=new y;!function(t){t.postulate="postulate",t.genericError="error"}(p||(p={}));var b="25.618.1618";function _(t,n,i){var r=new URL("https://prod.tahoe-analytics.publishers.advertising.a2z.com/logevent/putRecord"),o=t;try{"web-client-scenarios.aps.amazon.dev"===(null==i?void 0:i.hostname)?o=t+"-debug-only":window.Cypress&&(o=t+"-integration-test")}catch(t){}var a=e(e({},i),{eventSource:"aps_web_client_library",eventCategory:o,eventName:n,libraryVersion:b});Object.entries(a).forEach((function(t){var n=u(t,2),e=n[0],i=n[1];r.searchParams.append(e,i)})),fetch(r.toString(),{method:"GET",keepalive:!0,headers:{"x-api-key":"79db72eb0b5c7255afa54a253df24fb4a5ac916bf40b51c730df8850aa5665ca"}}).catch((function(){}))}var x,E,S,C,R={C:setInterval,R:function(){var t;return null===(t=window[k])||void 0===t?void 0:t[A]},A:function(t){var n;void 0===t&&(t=window);try{return(null===(n=t.top)||void 0===n?void 0:n.location)||{href:"unknown",hostname:"unknown"}}catch(t){return{href:"unknown",hostname:"unknown"}}},I:_,j:function(t,n){return{eventTime:I((function(){return"".concat(Date.now())})),accountID:I((function(){return null==t?void 0:t.accountID})),libraryVersion:b,url:I((function(){return n().href})),hostname:I((function(){return n().hostname})),message:I((function(){return null==t?void 0:t.message})),condition:I((function(){return null==t?void 0:t.condition}))}},O:function(t,n){var e,i;try{(null!=n?n:_)(p.genericError,"telemetry_core_failure",{errorName:null!==(e=null==t?void 0:t.name)&&void 0!==e?e:"unknown",errorMessage:null!==(i=null==t?void 0:t.message)&&void 0!==i?i:"unknown"})}catch(t){(null!=n?n:_)(p.genericError,"telemetry_core_failure")}}},k="_aps_telemetry",A="alarms";function I(t){var n;try{return null!==(n=t())&&void 0!==n?n:"undefined"}catch(t){return function(t){try{return t instanceof Error?"Access Error: ".concat(t.name," - ").concat(t.message):"Access Error: Unknown error type"}catch(t){return"Access Error: Unable to provide more information"}}(t)}}!function(t){t.push="push",t.listenerSuccess="listenerSuccess",t.direct="direct"}(x||(x={})),function(t){t.internal="internal",t.apstag="apstag",t.webpage="webpage",t.dtbm="dtbm"}(E||(E={})),function(t){t.completed="completed",t.waiting="waiting",t.cancelled="cancelled"}(S||(S={})),function(t){t.started="started",t.error="error",t.unknown="unknown",t.deactivated="deactivated",t.analytics="analytics"}(C||(C={}));var j=e(e({},S),C),O=new Map([["_config/config/didLoad",function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){return o(this,(function(t){return n.write("config/loaded",!0),[2,S.completed]}))}))}],["_config/requestViewerCountry/define",function(t){var n=t.account,e=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,i;return o(this,(function(r){if(void 0===(null===(i=e.detail)||void 0===i?void 0:i.code))throw new Error("Missing country code");if("string"!=typeof(t=e.detail.code)||0===t.trim().length)throw new Error('Invalid country code: "'.concat(t,'"'));return n.update(w,(function(){return t})),[2,S.completed]}))}))}]]),P="apstag/configuration/fetch",M=new Map([[P,function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return(t=n.globalContext.document.createElement("script")).setAttribute("src","".concat("https://config.aps.amazon-adsystem.com/configs/").concat(n.id)),t.setAttribute("type","text/javascript"),t.setAttribute("async","async"),n.globalContext.document.head.appendChild(t),[4,new Promise((function(n,e){t.addEventListener("load",(function(){n()})),t.addEventListener("error",(function(t){e(t)}))}))];case 1:return e.sent(),[2,S.completed]}}))}))}]]),T="consent/isGPPListenerRegistered",D={key:"consent/isTCFAPIListenerRegistered",default:!1},N={key:"consent/TCData",default:void 0};function L(t,n){var e,i;return"string"==typeof(null==n?void 0:n.tcString)&&(null==n?void 0:n.tcString.length)>0||!0===(null===(i=null===(e=null==t?void 0:t.globalContext)||void 0===e?void 0:e.apstag)||void 0===i?void 0:i.isGDPRRegion)||!0===(null==n?void 0:n.gdprApplies)}function U(t,n){var e,i,r,o,a;return!0===(null===(i=null===(e=t.vendor)||void 0===e?void 0:e.consents)||void 0===i?void 0:i[793])&&(o=n,a=null===(r=t.purpose)||void 0===r?void 0:r.consents,(null!=o?o:[]).reduce((function(t,n){return t&&!0===(null==a?void 0:a[n])}),!0))}var q=function(t,n){var i={tcData:n,consents:[1]},r=function(t){try{return t()}catch(t){return"error"}};return{tcT:r((function(){return t.isAPStagAllowedToAccessInfoOnDevice()})),tcCC:r((function(){return function(t){var n,e=t.account,i=t.tcData,r=t.consents;if(!L(e,i))return!0;if("object"!=typeof i)return!1;if((null!==(n=i.tcfPolicyVersion)&&void 0!==n?n:0)<2)return!1;if(i.useNonStandardStacks)return!1;if(!i.isServiceSpecific)return!1;var o=!1;return r.forEach((function(t){var n,e,a;switch(null===(a=null===(e=null===(n=i.publisher)||void 0===n?void 0:n.restrictions)||void 0===e?void 0:e[t])||void 0===a?void 0:a[793]){case 0:case 2:o=!0;break;default:U(i,r)||(o=!0)}})),!o}(e(e({},i),{account:t}))})),tcCF:r((function(){return 0===function(t){var n,e=t.tcData,i=t.consents;if(0===(null!=i?i:[]).length)return["No consents param passed"];var r=[];try{if("object"!=typeof e){var o="";try{o=JSON.stringify(e)}catch(t){}r.push("Invalid tcData: ".concat(o))}return!1===e.gdprApplies?[]:((null!==(n=e.tcfPolicyVersion)&&void 0!==n?n:0)<2&&r.push("tcData version not supported: ".concat(e.tcfPolicyVersion)),e.useNonStandardStacks&&r.push("tcData's useNonStandardStacks should not be true"),e.isServiceSpecific||r.push("tcData needs to be service specific"),i.forEach((function(t){var n,o,a;switch(null===(a=null===(o=null===(n=e.publisher)||void 0===n?void 0:n.restrictions)||void 0===o?void 0:o[t])||void 0===a?void 0:a[793]){case 0:r.push("Invalid publisher restrictions 0, consent ".concat(t));break;case 2:r.push("Invalid publisher restrictions 2, consent ".concat(t));break;default:U(e,i)||r.push("Invalid publisher restrictions default, consent ".concat(t))}})),r)}catch(t){if(r.length>0)return r;throw t}}(i).length})),PRA:r((function(){return L(t,n)}))}},z="consent/gppapi/attemptSync",F="consent/gppapi/didChange",B="consent/gppapi/syncData",J="consent/tcfapi/attemptSync",V="consent/tcfapi/didChange",G=new Map([[z,function(t){var n=t.account;return r(void 0,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return void 0===n.globalContext.__gpp||!0===n.read(T)?[2,S.cancelled]:[4,n.record(B)];case 1:return e.sent(),t=n.globalContext.__gpp("addEventListener",(function(t){"error"!==(null==t?void 0:t.eventName)&&n.record(F,{eventListener:t,fromAddEvent:!0}).catch((function(t){}))})),n.write(T,"listenerRegistered"===(null==t?void 0:t.eventName)&&!0===(null==t?void 0:t.data)),[2,S.completed]}}))}))}],[F,function(t){var n=t.account,e=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,i;return o(this,(function(r){switch(r.label){case 0:return[4,n.record(B,{eventListener:null===(t=e.detail)||void 0===t?void 0:t.eventListener,fromAddEvent:null===(i=e.detail)||void 0===i?void 0:i.fromAddEvent})];case 1:return r.sent(),[2,S.completed]}}))}))}],[B,function(t){var n=t.account,i=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,r,a,s,d,c,l,v,f,h,p,m,w,y,g;return o(this,(function(o){return(null!==(p=null===(h=null===(f=null===(v=i.detail)||void 0===v?void 0:v.eventListener)||void 0===f?void 0:f.pingData)||void 0===h?void 0:h.gppString)&&void 0!==p?p:"").length>0?(t=null===(w=null===(m=i.detail)||void 0===m?void 0:m.eventListener)||void 0===w?void 0:w.pingData,s="addEventListener"):(c=u(function(t){var n,e,i;try{var r=t.globalContext.__gpp("ping",(function(t,n){n&&"object"==typeof t&&(e=t)}));void 0===e&&(null!==(n=null==r?void 0:r.gppString)&&void 0!==n?n:"").length>0&&(e=r)}catch(t){i="E:ping: ".concat(t)}return[e,i]}(n),2),t=c[0],a=c[1],s="ping","object"!=typeof t&&(l=u(function(t){var n,i;try{var r=t.globalContext.__gpp("getGPPData");n=e(e({},r),r.pingData)}catch(t){i="E:getGPPData: ".concat(t)}return[n,i]}(n),2),t=l[0],r=l[1],s="getGPPData")),d={gpp:{gppLength:"string"==typeof(null==t?void 0:t.gppString)?t.gppString.length:void 0,isGPPTilde:(null!==(y=null==t?void 0:t.gppString)&&void 0!==y?y:"").includes("~"),error10:r,error:a,gppVersion:null==t?void 0:t.gppVersion,cmpId:null==t?void 0:t.cmpId,method:s,fromAddEvent:null===(g=i.detail)||void 0===g?void 0:g.fromAddEvent}},n.write("consent/GPPData",t),[2,{status:S.completed,analytics:d}]}))}))}],[J,function(t){var n=t.account;return r(void 0,void 0,void 0,(function(){var t;return o(this,(function(e){return t=n.use(D),void 0===n.globalContext.__tcfapi||t?[2,S.cancelled]:(n.globalContext.__tcfapi("addEventListener",2,(function(t,e){n.record(V,{tcData:t,success:e}).catch((function(t){}))})),[2,S.completed])}))}))}],[V,function(t){var n=t.account,e=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,i,r,a;return o(this,(function(o){return t=null===(r=e.detail)||void 0===r?void 0:r.success,n.update(D,(function(n){return n||!0===t})),i=null===(a=e.detail)||void 0===a?void 0:a.tcData,n.update(N,(function(n){return void 0!==i||!0===t?i:n})),"object"!=typeof i?[2,S.completed]:[2,{status:S.completed,analytics:q(n,i)}]}))}))}]]);var H=new WeakMap;function W(t,n,i,r){void 0===i&&(i="root"),void 0===r&&(r=".");var o={nonModifiable:{set:function(t,n){throw new Error('Cannot set property "'.concat(String(n),'": "').concat(i,'" is not marked as modifiable.'))},deleteProperty:function(t,n){throw new Error('Cannot delete property "'.concat(String(n),'": "').concat(i,'" is not marked as modifiable.'))},defineProperty:function(t,n){throw new Error('Cannot define property "'.concat(String(n),'": "').concat(i,'" is not marked as modifiable.'))},setPrototypeOf:function(t){throw new Error('Cannot set prototype: "'.concat(i,'" is not marked as modifiable.'))}},modifiable:{set:function(t,n,e,i){try{return Reflect.set(t,n,e,i)}catch(i){if("TypeError"===i.name)return t[n]=e,!0;throw i}}},validating:{get:function(t,e,o){if("__raw__"===e)return H.get(o)||t;if("symbol"==typeof e)return Reflect.get(t,e,o);if(function(t){if(["asymmetricMatch","nodeType"].includes(t))return!0}(e))return Reflect.get(t,e,o);var a;try{a=Reflect.get(t,e,o)}catch(n){if("TypeError"!==n.name)throw n;a=t[e]}return W(a,n,"".concat(i).concat(r).concat(String(e)))},ownKeys:function(t){return Reflect.ownKeys(t).filter((function(t){var e="".concat(i).concat(r).concat(String(t));return void 0!==n[e]}))}},function:{apply:function(t,e,r){var o=H.has(e)?H.get(e):e;return W(t.apply(o,r),n,"".concat(i,"()"))},get:function(t,n,e){return"__raw__"===n?H.get(e)||t:Reflect.get(t,n,e)}}},a=function(r){if(!1===r.verifiable)return t;if(t instanceof Set)return t.forEach((function(t){W(t,n,"".concat(i,".value"))})),t;if(t instanceof Map)return t.forEach((function(t,e){W(e,n,"".concat(i,".key")),W(t,n,"".concat(i,".value"))})),t;if(Array.isArray(t))return t.map((function(t){return W(t,n,"".concat(i,"[]"))}));if("function"==typeof t){var a=new Proxy(t,o.function);return H.set(a,t),a}var u=e(e({},o.validating),(null==r?void 0:r.modifiable)?o.modifiable:o.nonModifiable);try{var s=new Proxy(t,u);return H.set(s,t),s}catch(n){if("TypeError"===n.name)return t;throw n}}(function(){var r,o=n[i];if(void 0===o&&function(t,n){var i,r=function(){return!1};!function(t,n,i){var r=window;void 0===r[k]&&(r[k]={}),void 0===r[k][A]&&(r[k][A]=[]);var o=r[k][A],a=n.toString();o.push({hash:t,context:e(e({},i),{condition:a})})}(t,r,n);var o=null!==(i=null==n?void 0:n.message)&&void 0!==i?i:"Postulate violation: ".concat(t,", ").concat(r);throw new Error(o)}("ea3914",{message:'Unauthorized usage for "'.concat(i,'": No validator has been defined')}),null===o)return{verifiable:!1};try{r=o(t,i)}catch(n){var a="Error, could not convert to string";try{a="string"==typeof t?'"'+t+'"':null!=t&&"function"==typeof t.toString?t.toString():Object.prototype.toString.call(t)}catch(t){}throw new Error('Validation failed for "'.concat(i,'": ').concat(n.message," - Received: ").concat(a))}return null!=r?r:{}}());return a}var $=function(t){if("number"!=typeof t)throw new Error("must be a number")},K=function(t){if("string"!=typeof t)throw new Error("must be a string")},Q=function(t){if("boolean"!=typeof t)throw new Error("must be a boolean")},Z=function(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new Error("must be a standard object")},Y=function(t){return function(n){var e,i,r=!1;try{for(var o=a(t),u=o.next();!u.done;u=o.next()){var s=u.value;try{s(n),r=!0}catch(t){}}}catch(t){e={error:t}}finally{try{u&&!u.done&&(i=o.return)&&i.call(o)}finally{if(e)throw e.error}}if(!r)throw new Error("None of the validators passed")}},X=function(t){if(!Array.isArray(t))throw new Error("must be an array")};function tt(t){return function(n){if(!1===t.includes(n))throw new Error("must be one of the following values: ".concat(JSON.stringify(t)))}}function nt(t){return function(n,i){var r=t(n,i);return e({modifiable:!0},r)}}function et(t){return function(n,e){if(t===rt)throw new Error("isAny cannot be used within isOptional");if(null!=n)return t(n,e)}}var it=function(t){if("function"!=typeof t)throw new Error("must be a function")},rt=function(){},ot=function(){return{verifiable:!1}},at=function(){function t(t){var n=t.scope,e=t.object,i=t.action,r=t.validators,o=t.handler;this.throwIfInvalid(n,e,i),this.name="".concat(n,"/").concat(e,"/").concat(i),this.handler=this.wrapHandler(o,r)}return t.prototype.wrapHandler=function(t,n){var i=this;return function(a){return r(i,void 0,void 0,(function(){var i,r,u;return o(this,(function(o){switch(o.label){case 0:return i=e(e({},i=a),{detail:W(i.customEvent.detail,null!==(r=null==n?void 0:n.detail)&&void 0!==r?r:{detail:rt},"detail"),context:W(i.account.globalContext,null!==(u=null==n?void 0:n.context)&&void 0!==u?u:{context:rt},"context")}),[4,t(i)];case 1:return[2,o.sent()]}}))}))}},t.prototype.throwIfInvalid=function(t,n,e){var i=/^[a-z0-9][a-zA-Z0-9]*$/;if(!i.test(t)||!i.test(n)||!i.test(e))throw new Error("scope, object, and action must be alphanumeric and start with a lowercase. Received: ".concat(t,", ").concat(n,", ").concat(e));if(/[A-Z]/.test(e)&&!/^(will|did)/i.test(e))throw new Error("action must be a single verb (or a single verb prefixed by 'will' or 'did'). Received: ".concat(e))},t}();function ut(t){if(new Set(t.map((function(t){return t.name}))).size!==t.length)throw new Error("Duplicates found");return new Map(t.map((function(t){return[t.name,t.handler]})))}var st="debugSession/end",dt="prepend/events",ct="populator/ran",lt={key:"consent/hasPurposeOneConsent",default:!1},vt=function(){function t(t){var n=this;this.getItem=function(t){var e=n.globalContext.document.cookie.split("; ").reduce((function(n,e){var i=e.split("=");return i[0]===t?decodeURIComponent(i.slice(1).join("=")):n}),"");return e.length>0?e:null},this.removeItem=function(t,e){void 0===e&&(e="/"),n.setItem(t,"",0,e)},this.setItem=function(t,e,i,r){void 0===r&&(r="/");var o=new Date(i);if(!n.isValidDate(o))throw new Error("Invalid expiration date");n.globalContext.document.cookie="".concat(t,"=").concat(e,"; expires=").concat(o.toUTCString(),"; path=").concat(r,";")},this.globalContext=t}return t.prototype.isValidDate=function(t){return t instanceof Date&&!isNaN(t)},t}(),ft=["scope/objectName",st,dt];function ht(t){return null===t||"object"!=typeof t?t:t instanceof Date?new Date(t.getTime()):t instanceof Array?t.reduce((function(t,n){return t.push(ht(n)),t}),[]):t instanceof Set?Array.from(t.values()).reduce((function(t,n){return t.add(ht(n)),t}),new Set):t instanceof Map?Array.from(t.entries()).reduce((function(t,n){return t.set(n[0],ht(n[1])),t}),new Map):t instanceof Object?Object.keys(t).reduce((function(n,e){return n[e]=ht(t[e]),n}),{}):t}var pt,mt=function(){function t(t,n){var e=n.rootName;this.globalContext=n.globalContext;var i=this.globalContext[e].get(t);if(null==i)throw new Error('Missing "'.concat(t,'" account in userspace object'));this.id=t,this.store=i.store,this.queue=i.queue,this.store.has("listeners")||this.store.set("listeners",new Map)}return t.prototype.record=function(t,n){return r(this,void 0,void 0,(function(){var i=this;return o(this,(function(r){switch(r.label){case 0:return[4,new Promise((function(r,o){i.queue.push(new CustomEvent(t,{detail:e({resolve:r,reject:o,source:E.internal},n)}))}))];case 1:return[2,r.sent()]}}))}))},t.prototype.recordListener=function(t,n){return r(this,void 0,void 0,(function(){var i=this;return o(this,(function(r){switch(r.label){case 0:return[4,new Promise((function(r,o){i.queue.push(new CustomEvent(t.name,{detail:e({resolve:r,reject:o,source:E.internal},n)}))}))];case 1:return[2,r.sent()]}}))}))},t.prototype.recordListenerNonBlocking=function(t,n){this.recordListener(t,n).catch((function(t){}))},t.prototype.read=function(t,n){var e,i,r,o,a=this.store.get(t);if(void 0!==a)return a;if(void 0!==(null==n?void 0:n.persist)&&n.persist){var d=this.readLocalStorage(t,{usePrefix:!0});if(void 0!==d)return d}var c=null===(i=null===(e=null==n?void 0:n.default)||void 0===e?void 0:e.generators)||void 0===i?void 0:i.get(t);return void 0!==c?c.apply(void 0,s([],u(null!==(o=null===(r=null==n?void 0:n.default)||void 0===r?void 0:r.args)&&void 0!==o?o:[]),!1)):void 0},t.prototype.write=function(t,n,e){this.store.set(t,n),void 0!==(null==e?void 0:e.persist)&&e.persist&&this.writeLocalStorage(t,n,{usePrefix:!0})},t.prototype.use=function(t,n){var e,i=this.store.get(t.key);if(void 0!==i)e=i;else if(void 0!==(null==n?void 0:n.persist)&&n.persist){var r=this.readLocalStorage(t.key,{usePrefix:!0});null!=r&&(e=r)}var o=null!=e?e:t.default;if("function"==typeof o||!1===(null==n?void 0:n.structuredClone))return o;try{return structuredClone(o)}catch(t){try{return ht(o)}catch(t){return g.logCoreError({id:"Core.library.Account.use",account:null,error:t}),o}}},t.prototype.update=function(t,n,e){var i=n(this.use(t,e));if(void 0!==t.postProcessor&&(i=t.postProcessor(i)),this.store.set(t.key,i),void 0!==(null==e?void 0:e.persist)&&e.persist){if("string"!=typeof i)throw new Error("".concat(JSON.stringify(i)," must be a string to be writtable to browser storage"));this.writeLocalStorage(t.key,i,{usePrefix:!0})}},t.prototype.delete=function(t,n){this.store.delete(t),void 0!==(null==n?void 0:n.persist)&&n.persist&&this.deleteLocalStorage(t,{usePrefix:!0})},t.prototype.remove=function(t,n){this.store.delete(t.key),void 0!==(null==n?void 0:n.persist)&&n.persist&&this.deleteLocalStorage(t.key,{usePrefix:!0})},t.prototype.executeFuncWithConsent=function(t,n){if(!this.isAllowedToAccessInfoOnDevice())throw new Error("Invalid consent. API requires consent before execution.");return n.apply(t)},t.prototype.recordErrorEvent=function(t){g.logError(e(e({},t),{account:this}))},t.prototype.recordStatusChangeEvent=function(t){g.logFeature({id:t.id,account:this,feature:t.status,props:e({},t.props)})},t.prototype.recordGenericEvent=function(t){g.logFeature({id:t.id,account:this,feature:t.id,props:e({},t.props)})},t.prototype.isAllowedToAccessInfoOnDevice=function(){return this.updateUserConsent(),this.use(lt)},t.prototype.isAPStagAllowedToAccessInfoOnDevice=function(){return!0===this.globalContext.apstag._atsaaiod()},t.prototype.updateUserConsent=function(){try{var t=this.isAPStagAllowedToAccessInfoOnDevice();this.update(lt,(function(){return t}))}catch(t){}},t.prototype.getPersistedItemName=function(t){return"".concat("aps").concat(":").concat(this.id).concat(":").concat(t)},t.prototype.isBrowserStorageAllowed=function(t){var n=!1;try{n=this.isAllowedToAccessInfoOnDevice()}catch(t){}return n||ft.includes(t)},t.prototype.setCookieStorage=function(t,n,e,i){var r,o;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be set on cookie storage"));var a=null!==(r=null==i?void 0:i.usePrefix)&&void 0!==r&&r?this.getPersistedItemName(t):t;return new vt(this.globalContext).setItem(a,n,e,null!==(o=null==i?void 0:i.path)&&void 0!==o?o:"/")},t.prototype.readCookieStorage=function(t,n){var e;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be read from cookie storage"));var i=null!==(e=null==n?void 0:n.usePrefix)&&void 0!==e&&e?this.getPersistedItemName(t):t;return new vt(this.globalContext).getItem(i)},t.prototype.readLocalStorage=function(t,n){var e;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be read from browser storage"));var i=null!==(e=null==n?void 0:n.usePrefix)&&void 0!==e&&e?this.getPersistedItemName(t):t;if(i in this.globalContext.localStorage)return this.globalContext.localStorage.getItem(i)},t.prototype.writeLocalStorage=function(t,n,e){var i;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be written to browser storage"));if("string"!=typeof n)throw new Error("".concat(JSON.stringify(n)," must be a string to be writtable to browser storage"));var r=null!==(i=null==e?void 0:e.usePrefix)&&void 0!==i&&i?this.getPersistedItemName(t):t;this.globalContext.localStorage.setItem(r,n)},t.prototype.deleteLocalStorage=function(t,n){var e;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be touched/deleted in browser storage"));var i=null!==(e=null==n?void 0:n.usePrefix)&&void 0!==e&&e?this.getPersistedItemName(t):t;this.globalContext.localStorage.removeItem(i)},t.prototype.readSessionStorage=function(t,n){var e;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be read from browser storage"));var i=null!==(e=null==n?void 0:n.usePrefix)&&void 0!==e&&e?this.getPersistedItemName(t):t;if(i in this.globalContext.sessionStorage)return this.globalContext.sessionStorage.getItem(i)},t.prototype.writeSessionStorage=function(t,n,e){var i;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be written to browser storage"));if("string"!=typeof n)throw new Error("".concat(JSON.stringify(n)," must be a string to be writable to browser storage"));var r=null!==(i=null==e?void 0:e.usePrefix)&&void 0!==i&&i?this.getPersistedItemName(t):t;this.globalContext.sessionStorage.setItem(r,n)},t.prototype.deleteSessionStorage=function(t,n){var e;if(!this.isBrowserStorageAllowed(t))throw new Error("".concat(t," is not allowed to be touched/deleted in browser storage"));var i=null!==(e=null==n?void 0:n.usePrefix)&&void 0!==e&&e?this.getPersistedItemName(t):t;this.globalContext.sessionStorage.removeItem(i)},t}(),wt="_system",yt=function(t){function e(n,e){return t.call(this,wt,{globalContext:n,rootName:e})||this}return n(e,t),e}(mt),gt=function(){function t(t,n,e){this.globalContext=t,this.rootName=n,this.dispatcher=e}return t.prototype.getAccounts=function(){return this.globalContext[this.rootName]},t.prototype.createUserspaceRoot=function(){null==this.getAccounts()&&(this.globalContext[this.rootName]=new Map)},t.prototype.createSystemAccount=function(){!1===this.getAccounts().has(wt)&&(this.getAccounts().set(wt,{queue:[],store:new Map}),new yt(this.globalContext,this.rootName).store.set(v,Math.random()))},t.prototype.observeRootSet=function(){var t=this;this.getAccounts().set=function(n,e){Map.prototype.set.apply(this,[n,e]),t.equip()}},t.prototype.observeAccountQueuesPush=function(){var t=this;this.getAccounts().forEach((function(n){n.queue.push=function(){for(var n=[],e=0;e=1||Number.isNaN(t))&&(t<=0||Math.random()>=t)}var St={key:"_internal/eventSources",default:new Map},Ct={key:"_internal/processedEventSources",default:new Set},Rt=[j.completed,j.error,j.cancelled,j.analytics],kt=function(){function t(t,n){this.globalContext=t,this.rootName=n}return t.prototype.D=function(t){var n;return null!==(n=t.store.get("_config/events/deactivations"))&&void 0!==n?n:new Set},t.prototype.N=function(t,n){return!0===this.D(t).has(n.type)||function(t,n){var e,i,r,o,a,u;try{var s=null===(r=null===(i=null===(e=t.detail)||void 0===e?void 0:e.restrictions)||void 0===i?void 0:i.allow)||void 0===r?void 0:r.hostnames;if(void 0!==s&&!xt(s))return!0;var d=null===(u=null===(a=null===(o=t.detail)||void 0===o?void 0:o.restrictions)||void 0===a?void 0:a.block)||void 0===u?void 0:u.hostnames;if(void 0!==d&&xt(d))return!0}catch(t){return n.recordErrorEvent({id:"hostnames",error:new Error(t)}),!1}return!1}(n,t)||function(t){var n,e,i,r,o,a,u=null===(i=null===(e=null===(n=null==t?void 0:t.detail)||void 0===n?void 0:n.restrictions)||void 0===e?void 0:e.allow)||void 0===i?void 0:i.libraryVersions,s=null===(a=null===(o=null===(r=null==t?void 0:t.detail)||void 0===r?void 0:r.restrictions)||void 0===o?void 0:o.block)||void 0===a?void 0:a.libraryVersions;return!(!Array.isArray(s)||!s.includes(d))||!(!Array.isArray(u)||u.includes(d))}(n)||function(t,n){var e,i,r,o,a,u,s=null===(r=null===(i=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.restrictions)||void 0===i?void 0:i.allow)||void 0===r?void 0:r.accounts,d=null===(u=null===(a=null===(o=null==t?void 0:t.detail)||void 0===o?void 0:o.restrictions)||void 0===a?void 0:a.block)||void 0===u?void 0:u.accounts;return!(!Array.isArray(d)||!d.includes(n.id))||!(!Array.isArray(s)||s.includes(n.id))}(n,t)||function(t){var n,e,i,r,o,a,u,s,d=null!==(r=null===(i=null===(e=null===(n=null==t?void 0:t.detail)||void 0===n?void 0:n.restrictions)||void 0===e?void 0:e.allow)||void 0===i?void 0:i.rate)&&void 0!==r?r:1;return!(!Et(null!==(s=null===(u=null===(a=null===(o=null==t?void 0:t.detail)||void 0===o?void 0:o.restrictions)||void 0===a?void 0:a.block)||void 0===u?void 0:u.rate)&&void 0!==s?s:1)&&!Et(d))}(n)},t.prototype.L=function(){var t;return null!==(t=new yt(this.globalContext,this.rootName).store.get(c))&&void 0!==t?t:new Map},t.prototype.U=function(t){var n;return null!==(n=t.store.get("listeners"))&&void 0!==n?n:new Map},t.prototype.q=function(t,n){return this.L().get(n.type)||this.U(t).get(n.type)},t.prototype.F=function(t){var n=this.B(f);return(void 0===t.externalEventCount||t.externalEventCount150){var i=e.slice(-100);t.store.set(l,i)}}},t.prototype.yt=function(t){var n,e=null!==(n=t.store.get(l))&&void 0!==n?n:[];e.push.apply(e,s([],u(t.queue.filter((function(t){return void 0!==t.status&&Rt.includes(t.status)}))),!1)),t.store.set(l,e)},t.prototype.gt=function(t){var n;(n=t.queue).splice.apply(n,s([0,t.queue.length],u(t.queue.filter((function(t){return void 0===t.status||!Rt.includes(t.status)}))),!1))},t.prototype.bt=function(){var t=this;this.ht().forEach((function(n){t.yt(n),t.wt(n),t.gt(n)}))},t.prototype._t=function(t){return null==t?void 0:t.filter((function(t){var n,e;return(null===(n=t.detail)||void 0===n?void 0:n.source)!==E.internal&&(null===(e=t.detail)||void 0===e?void 0:e.source)!==E.apstag&&t.status!==j.waiting}))},t.prototype.xt=function(t){var n,e=this._t(t);return null!==(n=null==e?void 0:e.length)&&void 0!==n?n:0},t.prototype.Et=function(t){var n=this.xt(t);this.G(f,n)},t.prototype.St=function(){var t=this,n="_internal/recentDispatches";this.G(n,1);var e=this.B(n);if(e>1e4)throw new Error("Too many dispatches. Aborting");e%100==0&&new yt(this.globalContext,this.rootName).recordGenericEvent({id:"C.l.D.thr",props:{recentDispatchesCount:e}}),setTimeout((function(){t.H(n)}),100)},t.prototype.P=function(t){var n,e,i,r,o,a=this,u=t.reason;try{this.St(),h()&&_t.info('# Dispatch from method "'.concat(u.method,'" on event "').concat(null!==(e=null===(n=u.events)||void 0===n?void 0:n[0].type)&&void 0!==e?e:"undefined",'" with source "').concat(null!==(o=null===(r=null===(i=u.events)||void 0===i?void 0:i[0].detail)||void 0===r?void 0:r.source)&&void 0!==o?o:"undefined",'"\n_________________________________________')),this.Et(u.events);var s=new yt(this.globalContext,this.rootName);this.ht().forEach((function(t){return a.lt(t,s,u)})),this.bt()}catch(t){throw new yt(this.globalContext,this.rootName).recordErrorEvent({id:"C.l.D.dis",error:t}),t}},t}(),At=function(){function t(t,n){this.globalContext=t,this.rootName=n}return t.prototype.subscribe=function(t){try{var n=new yt(this.globalContext,this.rootName),e=null!=n.store.get(c)?n.store.get(c):new Map;n.store.set(c,new Map(s(s([],u(e),!1),u(t),!1)))}catch(t){throw new yt(this.globalContext,this.rootName).recordErrorEvent({id:"Core.library.Subscriber.subscribe",error:t}),t}},t}(),It=function(){function t(t,n){this.globalContext=t,this.rootName=n}return t.prototype.populate=function(){try{var t=new yt(this.globalContext,this.rootName),n=!1;try{n=JSON.parse(t.read(ct))}catch(t){}if(n)return;t.write(ct,JSON.stringify(!0)),this.populateFromPrependStore(),this.populateFromQueryParams()}catch(t){new yt(this.globalContext,this.rootName).recordErrorEvent({id:"Core.library.Populator.populate",error:t})}},t.prototype.populateFromPrependStore=function(){var t=this;this.globalContext[this.rootName].forEach((function(n,e){var i,r,o=new mt(e,{globalContext:t.globalContext,rootName:t.rootName}),a=null!==(r=o.read(dt,{persist:!0}))&&void 0!==r?r:"[]";o.write(dt,JSON.stringify([]));try{var d=JSON.parse(a);if(0===d.length)return;(i=o.queue).push.apply(i,s([],u(d.map(Ot)),!1))}catch(t){console.error("Error processing prepended events",t)}}))},t.prototype.populateFromQueryParams=function(){var t,n,e=null===(n=null===(t=this.globalContext)||void 0===t?void 0:t.location)||void 0===n?void 0:n.search,i=new URLSearchParams(e),r=this.globalContext[this.rootName],o=r.get(wt);jt(i,"aps.trigger").forEach((function(t){o.queue.push(Ot(t))})),jt(i,"aps.triggerFor",!0).forEach((function(t){void 0!==t.accountId&&r.has(t.accountId)&&r.get(t.accountId).queue.push(Ot(t))}));var a=jt(i,"aps_event");r.forEach((function(t){a.forEach((function(n){t.queue.push(Ot(n))}))}))},t}(),jt=function(t,n,e){void 0===e&&(e=!1);var i=t.getAll(n),r=[];return i.forEach((function(t){var n,i=t.split(",");e&&(n=i.shift());var o=i.shift();if(void 0!==o&&o.length>0){var a=decodeURIComponent(i.join(",")),u=void 0;if(a.length>0)try{u=JSON.parse(a)}catch(t){console.error("Error processing query param event",o,u)}r.push({eventName:o.replace(/_/g,"/"),eventDetail:u,accountId:n})}})),r},Ot=function(t){var n;return new CustomEvent(t.eventName,{detail:e({},null!==(n=t.eventDetail)&&void 0!==n?n:{})})},Pt={globalContext:window,rootName:"_aps"},Mt=function(){function t(t,n,e){this.ID=t,this.rootName=e,this.globalContext=n,this.clear()}return t.prototype.clear=function(){var t=this;new yt(this.globalContext,this.rootName).update(St,(function(n){return n.delete(t.ID),n}))},t.prototype.recordListener=function(t,n){var e=this;new yt(this.globalContext,this.rootName).update(St,(function(i){var r=i.get(e.ID);return void 0!==r?r.push([t.name,n]):i.set(e.ID,[[t.name,n]]),i}))},t}(),Tt=function(){function t(t,n){void 0===t&&(t=Pt.globalContext),void 0===n&&(n=Pt.rootName),this.dispatcher=new kt(t,n),this.equiper=new gt(t,n,this.dispatcher),this.subscriber=new At(t,n),this.populator=new It(t,n),this.globalContext=t,this.rootName=n}return t.prototype.createAccount=function(t){var n;if(void 0===t)throw new Error("accountID must be provided");this.globalContext[this.rootName]=null!==(n=this.globalContext[this.rootName])&&void 0!==n?n:new Map;var e=this.globalContext[this.rootName],i={store:new Map,queue:[]};return!1===e.has(t)&&e.set(t,i),new mt(t,{globalContext:this.globalContext,rootName:this.rootName})},t.prototype.subscribe=function(t){this.subscriber.subscribe(t)},t.prototype.equip=function(){this.equiper.equip()},t.prototype.dispatch=function(t){var n=t.reason;this.dispatcher.P({reason:n})},t.prototype.populate=function(){this.populator.populate()},t.prototype.load=function(t){var n=t.listeners;this.equip(),this.subscribe(n),this.dispatch({reason:{method:x.direct}}),this.populate()},t.prototype.registerEventSource=function(t){return this.equip(),new Mt(t,this.globalContext,this.rootName)},t}(),Dt="vnd_prx_segments",Nt="aps_targeting_comscore",Lt=new at({scope:"cxm",object:"comscore",action:"set",handler:function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){return o(this,(function(t){return[2,{status:Ut(n)}]}))}))}}),Ut=function(t){var n=t.readSessionStorage(Nt);if(t.deleteSessionStorage(Nt),null==n)return S.cancelled;try{var e=JSON.parse(n)[Dt];if(null==e)throw new Error;return t.globalContext.googletag.pubads().getSlots().forEach((function(t){t.setTargeting(Dt,e)})),S.completed}catch(t){throw new Error("Malformed targeting object at ".concat(Nt))}},qt="aps_targeting_ias",zt=new at({scope:"cxm",object:"ias",action:"set",handler:function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){return o(this,(function(t){return[2,{status:Ft(n)}]}))}))}}),Ft=function(t){var n=t.readSessionStorage(qt);if(t.deleteSessionStorage(qt),null==n)return S.cancelled;try{var e=JSON.parse(n),i=t.globalContext.googletag;i.pubads().getSlots().forEach((function(t){var n=e.targeting.slots[t.getSlotElementId()];null!=n&&Object.keys(n).forEach((function(e){t.setTargeting(e,n[e])}))}));var r=e.targeting,o=r.brandSafety,a=r.fr,u=r.custom;return null!=o&&Object.keys(o).forEach((function(t){i.pubads().setTargeting(t,o[t])})),null!=u&&Object.keys(u).forEach((function(t){var n=u[t];Array.isArray(n)?n.forEach((function(n){i.pubads().setTargeting(t,n)})):i.pubads().setTargeting(t,n)})),null!=a&&i.pubads().setTargeting("fr",a),S.completed}catch(t){throw new Error("Malformed targeting object at ".concat(qt))}},Bt="aps_targeting_illuma",Jt=new at({scope:"cxm",object:"illuma",action:"set",handler:function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){return o(this,(function(t){return[2,{status:Vt(n)}]}))}))}}),Vt=function(t){var n=t.readSessionStorage(Bt);if(t.deleteSessionStorage(Bt),null==n)return S.cancelled;var e=JSON.parse(n).results;if(null==e)throw new Error("Malformed targeting object at ".concat(Bt));var i=t.globalContext.googletag;return Object.keys(e).forEach((function(t){var n=e[t];i.pubads().setTargeting("".concat("illuma_").concat(t),JSON.stringify(n))})),S.completed},Gt=new at({scope:"cxm",object:"contextual",action:"set",handler:function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,Promise.all([n.recordListener(Lt),n.recordListener(zt),n.recordListener(Jt)])];case 1:return t.sent(),[2,{status:S.completed}]}}))}))}}),Ht=ut([Lt,Gt,zt,Jt]),Wt={key:"customPlacement/hints",default:{}},$t={key:"customPlacement/bidResponses",default:{}},Kt=function(){function t(t,n,i){var r=this;this.CLICK_PREFIX_MACRO="%%CLICK_URL_PREFIX%%",this.PROGRAM_CUSTOM_PLACEMENTS="customPlacements",this.getPageStyles=function(t){return void 0===t&&(t=["p","h1","h2"]),t.map(r.getTagStyle).filter((function(t){return Object.keys(t).length>0})).reduce((function(t,n){return e(e({},t),n)}),{})},this.getContainerStyles=function(t){try{if(!t)return{};var n=window.getComputedStyle(t),e="--aps-custom-container-",i=new Map;return i.set("".concat(e,"width"),n.width),i.set("".concat(e,"margin"),n.margin),i.set("".concat(e,"padding"),n.padding),Object.fromEntries(i.entries())}catch(t){return{}}},this.slotProps=t,this.rawResponse=n,this.Ct=i}return t.prototype.getTagStyle=function(t){var n=this.Ct.getElementsByTagName(t);if(n&&n[0]){var e=window.getComputedStyle(this.Ct.getElementsByTagName(t)[0]),i=new Map,r="--aps-custom-page-";return i.set("".concat(r).concat(t,"-color"),e.color),i.set("".concat(r).concat(t,"-fontFamily"),e.fontFamily),i.set("".concat(r).concat(t,"-fontSize"),e.fontSize),i.set("".concat(r).concat(t,"-fontWeight"),e.fontWeight),i.set("".concat(r).concat(t,"-lineHeight"),e.lineHeight),Object.fromEntries(i)}return{}},t.prototype.getDynamicFrameBodyHeight=function(t,n,i){var r;if(n){null==n||n.contentWindow;var o=(null==n?void 0:n.contentDocument)||(null===(r=null==n?void 0:n.contentWindow)||void 0===r?void 0:r.document),a=null==o?void 0:o.body.scrollHeight;n.style.height="".concat(a,"px");try{var u=e(e({},this.getPageStyles()),this.getContainerStyles(t));Object.keys(u).forEach((function(t){null==o||o.documentElement.style.setProperty(t,u[t])}))}catch(t){}}},t.prototype.render=function(t){return this.Rt(t)},t.prototype.Rt=function(t){var n,e,i,r=this;if(!this.rawResponse||!this.slotProps)return!1;try{var o=this.rawResponse.size.split("x"),a=(null===(n=this.rawResponse.targeting)||void 0===n?void 0:n.amzniid)||this.rawResponse.amzniid,u=(null===(e=this.rawResponse.targeting)||void 0===e?void 0:e.amznadm)||this.rawResponse.amznadm;if(!a)return!1;var s=this.slotProps.kt;if(this.slotProps.location&&this.slotProps.id){var d=this.Ct.createElement("div");null===(i=this.Ct.getElementById(this.slotProps.id))||void 0===i||i.insertAdjacentElement(this.slotProps.location,d),s=d}if(!s)return!1;var c=this.Ct.createElement("iframe");return c.style.marginLeft="0",c.style.marginTop="0",c.style.height="".concat(o[1],"px"),c.style.width="100%",c.setAttribute("data-testid","amzn-asr-ad"),c.setAttribute("scrolling","no"),c.setAttribute("frameborder","0"),c.onload=function(){return r.getDynamicFrameBodyHeight(s,c,u?"amznadm":"admi")},c.srcdoc=u||"",t&&t.clickPrefix&&(c.srcdoc=c.srcdoc.replace(this.CLICK_PREFIX_MACRO,t.clickPrefix)),s.appendChild(c),this.updateSlotAttribute("status","rendered"),!0}catch(t){throw new Error("CustomPlacements: Error while rendering")}},t.prototype.updateSlotAttribute=function(t,n){var e;null===(e=this.slotProps.kt)||void 0===e||e.setAttribute("data-aps-custom-".concat(t),n)},t}(),Qt={key:"customPlacement/timings",default:[]},Zt=function(t,n,e,i){void 0===e&&(e=0),void 0===i&&(i=0);try{var r={effectiveType:null==n?void 0:n.effectiveType,rtt:null==n?void 0:n.rtt,downlink:null==n?void 0:n.downlink},o=function(t,n,e){try{var i=isNaN(n)||0===n?t.body.clientWidth:n,r=isNaN(e)||0===e?t.body.clientHeight:e;return"".concat(i,"x").concat(r)}catch(t){}return"x"}(t,e,i);return{connection:r,screen:o}}catch(t){return{}}},Yt=function(t,n,e){t.update(Qt,(function(t){return t.push({time:performance.now(),key:"".concat(n,"/").concat(e)}),t}))},Xt="customPlacements",tn=new at({scope:"customPlacement",object:"hint",action:"process",validators:{},handler:function(t){var n=t.account;return t.detail,t.customEvent,r(void 0,void 0,void 0,(function(){var t,e,i;return o(this,(function(r){return t=function(t){var e;Yt(n,Xt,"hint/process/".concat(t));var i=n.use(Wt),r=n.use($t);null!==(e=i[t].isRendered)&&void 0!==e&&e||(Object.values(r).forEach((function(e){var r;if(null===(r=e.isRendered)||void 0===r||!r){var o=n.globalContext.document.getElementById(t);if(null!=o){var a=new Kt({id:t,kt:o},e,n.globalContext.document);Yt(n,Xt,"widget/render/".concat(t)),a.render(i[t].hintMetadata)&&(e.isRendered=!0,i[t].isRendered=!0)}}})),n.update(Wt,(function(){return i})),n.update($t,(function(){return r})))},e=n.use(Wt),Object.keys(e).filter((function(t){return e[t].default})).forEach(t),Object.keys(e).filter((function(t){return!e[t].default})).forEach(t),[2,{status:S.completed,analytics:{browserInfo:Zt(n.globalContext.document,null===(i=n.globalContext.navigator)||void 0===i?void 0:i.connection,n.globalContext.innerWidth,n.globalContext.innerHeight)}}]}))}))}}),nn=new at({scope:"customPlacement",object:"hint",action:"define",validators:{},handler:function(t){var n=t.account;t.detail;var e=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,i,r,a,u,s,d;return o(this,(function(o){if(void 0===(null===(s=e.detail)||void 0===s?void 0:s.id))throw new Error("Hint `id` must be defined");return t=e.detail,i=t.id,r=t.isDefault,a=t.hintMetadata,Yt(n,Xt,"hint/define/".concat(i)),(u=n.use(Wt))[i]={default:"default"===r,isRendered:!1,hintMetadata:null!=a?a:{}},n.update(Wt,(function(){return u})),n.recordListenerNonBlocking(tn),[2,{status:S.completed,analytics:{browserInfo:Zt(n.globalContext.document,null===(d=n.globalContext.navigator)||void 0===d?void 0:d.connection,n.globalContext.innerWidth,n.globalContext.innerHeight)}}]}))}))}}),en={key:"customPlacement/placementResponseDispatched",default:!1},rn={key:"customPlacement/placementResponse",default:void 0},on={key:"customPlacement/contextURL",default:void 0},an={key:"customPlacement/placementEndpoint",default:"https://c.aps.amazon-adsystem.com/e/placements"},un={key:"ad/context",default:void 0},sn=new at({scope:"customPlacement",object:"placement",action:"fetch",validators:{},handler:function(t){var n=t.account;return t.detail,t.customEvent,r(void 0,void 0,void 0,(function(){var t,e;return o(this,(function(i){switch(i.label){case 0:return Yt(n,Xt,"placementFetch/start"),[4,cn(n)];case 1:return t=i.sent(),Yt(n,Xt,"placementFetch/end"),[2,{status:S.completed,value:{placementResponse:t},analytics:{browserInfo:Zt(n.globalContext.document,null===(e=n.globalContext.navigator)||void 0===e?void 0:e.connection,n.globalContext.innerWidth,n.globalContext.innerHeight)}}]}}))}))}});function dn(t){var n=t.use(un);return void 0!==n&&"user"in n?(n.user,i(n,["user"])):n}function cn(t){return r(this,void 0,void 0,(function(){var n,e,i,r,a;return o(this,(function(o){switch(o.label){case 0:return n={ortb2:dn(t)},e=t.use(on),i=t.use(an),r=function(t,n){try{var e=null!=n?n:function(t){var n,e;try{if(void 0!==(null===(n=t.globalContext.top)||void 0===n?void 0:n.location.href))return null===(e=t.globalContext.top)||void 0===e?void 0:e.location.href}catch(t){}try{if(t.globalContext.top!==t.globalContext.self)return t.globalContext.document.referrer}catch(t){}}(t);if(void 0!==e)return encodeURIComponent(e)}catch(t){}return""}(t,e),a=encodeURIComponent(JSON.stringify(n)),[4,fetch("".concat(i,"?account=").concat(t.id,"&u=").concat(r,"&sg=").concat(a))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}}))}))}var ln={key:"customPlacement/bidEndpoint",default:"c.aps.amazon-adsystem.com"},vn={key:"customPlacement/bidIsKey",default:"86355855cc6ed9e335d0382c8563aa10"},fn=new at({scope:"customPlacement",object:"bids",action:"fetch",validators:{},handler:function(t){var n=t.account;return t.detail,t.customEvent,r(void 0,void 0,void 0,(function(){var t,e,i,r;return o(this,(function(o){switch(o.label){case 0:return t=Zt(n.globalContext.document,null===(i=n.globalContext.navigator)||void 0===i?void 0:i.connection,n.globalContext.innerWidth,n.globalContext.innerHeight),void 0===(null===(r=n.globalContext.apstag)||void 0===r?void 0:r.clientFetchBids)?[2,{status:S.waiting,analytics:{browserInfo:t}}]:(Yt(n,Xt,"fetchBids/start"),[4,hn(n)]);case 1:return e=o.sent(),Yt(n,Xt,"fetchBids/end"),[2,{status:S.completed,value:{bidResponses:e},analytics:{browserInfo:t}}]}}))}))}});function hn(t){return r(this,void 0,void 0,(function(){var n,e,i;return o(this,(function(r){switch(r.label){case 0:return n={slots:[{slotID:"93b7dd52-a8ce-11ed-afa1-0242ac120002:1",sizes:[[999,999]]}],timeout:6e4,_endpointDomain:t.use(ln),params:{program:"apscustom",is:t.use(vn)}},e={pubID:t.id,isSelfServePub:36===t.id.length,deals:!0},i=t.use(on),[4,new Promise((function(r){var o;null===(o=t.globalContext.apstag)||void 0===o||o.clientFetchBids(n,(function(t){r(t)}),{initConfig:e,contextURL:i})}))];case 1:return[2,r.sent()]}}))}))}var pn=new at({scope:"customPlacement",object:"service",action:"enable",validators:{},handler:function(t){var n=t.account;return t.detail,t.customEvent,r(void 0,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return Yt(n,Xt,"service/enable"),n.update(en,(function(){return!1})),[4,Promise.all([n.recordListener(sn).then((function(t){var e=t.placementResponse;mn(n,!0,e),n.update(rn,(function(){return e}))})),n.recordListener(fn).then((function(t){t.bidResponses.forEach((function(t){var e,i,r=null!==(i=null===(e=t.targeting)||void 0===e?void 0:e.amzniid)&&void 0!==i?i:t.amzniid,o=!1;if(""!==r){var a=n.use($t);a[r]=t,n.update($t,(function(){return a})),o=!0}mn(n,!1,{aps:[{active:o,dispatchEventOnValidBid:!0}]})}))})).then((function(){n.recordListenerNonBlocking(tn)}))])];case 1:return e.sent(),[2,{status:S.completed,analytics:{browserInfo:Zt(n.globalContext.document,null===(t=n.globalContext.navigator)||void 0===t?void 0:t.connection,n.globalContext.innerWidth,n.globalContext.innerHeight)}}]}}))}))}});function mn(t,n,e){var i;if(!t.use(en)){var r=null===(i=null==e?void 0:e.aps)||void 0===i?void 0:i.find((function(t){return t.dispatchEventOnValidBid}));n&&void 0!==r||(Yt(t,Xt,"placementResponseEvent/dispatch"),t.record("customPlacement/placement/didRespond",e).catch((function(t){})),t.update(en,(function(){return!0})))}}var wn=new Map(s([],u(ut([nn,fn,tn,pn,sn])),!1)),yn=function(t){function e(n){var e=t.call(this,n.message)||this;return e.message='Could not read vendor data because: "'.concat(n.message,'"'),e}return n(e,t),e}(Error),gn={key:"cxm/vendors",default:{}},bn={nonId:{noExtraDefaults:!0,source:"liveintent.com",atype:3},bidswitch:{source:"bidswitch.net",atype:3},openx:{source:"openx.net",atype:3},magnite:{source:"rubiconproject.com",atype:3},medianet:{source:"media.net",atype:3},pubmatic:{source:"pubmatic.com",atype:3},index:{source:"liveintent.indexexchange.com",atype:3},uid2:{source:"uidapi.com",atype:3},sovrn:{source:"liveintent.sovrn.com",atype:3},thetradedesk:{source:"adserver.org",atype:1},vidazoo:{source:"liveintent.vidazoo.com",atype:3},triplelift:{source:"liveintent.triplelift.com",atype:3},sharethrough:{source:"sharethrough.com",atype:3},sonobi:{source:"liveintent.sonobi.com",atype:3}};function _n(t){var n=[],e={user:{ext:{eids:n}}};return Object.entries(bn).forEach((function(e){var i=e[0],r=e[1];if(void 0!==t[i]){var o={source:r.source,uids:[{id:t[i],atype:r.atype}]};!0!==r.noExtraDefaults&&(o.uids[0].ext={provider:"liveintent.com"}),n.push(o)}})),e}var xn="cxm/liveintent/set",En="cxm/arcspan/set",Sn="cxm/anomymised/set",Cn=new Map([["cxm/vendors/set",function(t){var n=t.account;return r(void 0,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,Promise.all([n.record(xn),n.record(En),n.record(Sn)])];case 1:return t.sent(),[2,S.completed]}}))}))}],[xn,function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){var t;return o(this,(function(i){try{t=function(t){var n,e,i;try{i=t.readLocalStorage("__tamLIResolveResult")}catch(t){if(t instanceof Error)throw new yn(t)}if(null!=i&&(void 0===t.globalContext.liModuleEnabled&&(t.globalContext.liModuleEnabled=Math.random()<.95,null===(e=null===(n=t.globalContext)||void 0===n?void 0:n.googletag)||void 0===e||e.cmd.push((function(){t.globalContext.googletag.pubads().setTargeting("li-module-enabled",t.globalContext.liModuleEnabled?["on"]:["off"])}))),t.globalContext.liModuleEnabled)){var r=void 0;try{r=_n(JSON.parse(i))}catch(t){r=_n(JSON.parse(decodeURIComponent(i)))}if(void 0!==r)return{data:{default:r}}}}(n)}catch(t){if(t instanceof yn)return[2,{status:S.cancelled,analytics:{statusReason:t.message}}];throw t}return void 0===t?[2,S.cancelled]:(n.update(gn,(function(n){var i;return e(e({},n),((i={}).liveintent=t,i))})),[2,S.completed])}))}))}],[En,function(t){var n=t.account;return r(void 0,void 0,void 0,(function(){var t;return o(this,(function(i){return t=function(t){var n=t.globalContext.arcobj1,e=t.globalContext.arcobj2,i=[],r=[],o=[];if(void 0!==n){if(void 0!==n.page_iab_codes.text&&(i=i.concat(n.page_iab_codes.text)),void 0!==n.page_iab_codes.images&&(i=i.concat(n.page_iab_codes.images)),void 0!==n.page_keywords){var a="string"==typeof n.page_keywords?n.page_keywords.split(","):n.page_keywords;o=o.concat(a),void 0!==(null==e?void 0:e.compcohorts)&&(o=o.concat(e.compcohorts))}void 0!==n.page_iab_newcodes.text&&(r=s([],u(new Set(s(s([],u(r),!1),u(n.page_iab_newcodes.text),!1))),!1)),void 0!==n.page_iab_newcodes.images&&(r=s([],u(new Set(s(s([],u(r),!1),u(n.page_iab_newcodes.images),!1))),!1));var d={name:"arcspan",segment:[],ext:{segtax:6}};r.forEach((function(t){d.segment=d.segment.concat({id:t})}));var c={data:[]};return c.data=c.data.concat(d),{data:{default:{site:{name:"arcspan",cat:i,sectioncat:i,pagecat:i,keywords:o.toString(),content:c,domain:new URL(t.globalContext.location.href).hostname,page:t.globalContext.location.href,ref:t.globalContext.document.referrer}}}}}}(n),void 0===t?[2,S.cancelled]:(n.update(gn,(function(n){return e(e({},n),{arcspan:t})})),[2,S.completed])}))}))}],[Sn,function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){var t;return o(this,(function(i){try{t=function(t){var n;try{n=t.readLocalStorage("cohort_ids")}catch(t){if(t instanceof Error)throw new yn(t)}if("string"==typeof n){for(var e=JSON.parse(n),i="",r=0;r1500)throw new Error("Id length of ".concat(100*Math.ceil(e.length/100)," (normalized) exceeds ").concat(1500," character limit"));return null!=e?((n={})[Nn]=decodeURIComponent(e),n):null},qn="audigent",zn=new at({scope:"idVendors",object:"audigent",action:"get",handler:function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){return o(this,(function(t){return[2,An(Fn,n)]}))}))}}),Fn=function(t){var n,e,i=null!==(e=t.readLocalStorage("hadronId"))&&void 0!==e?e:t.readLocalStorage("auHadronId");return null!=i?((n={})[qn]=i,n):null},Bn=["cto_bidid"],Jn=new at({scope:"idVendors",object:"criteo",action:"get",handler:function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){return o(this,(function(t){return[2,An(new jn("criteo").using(On).fromLocalStorageKeys(Bn).forAccount(n).getRunner(),n)]}))}))}}),Vn="id5id",Gn=new at({scope:"idVendors",object:"id5",action:"get",handler:function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){return o(this,(function(t){return[2,An(Hn,n)]}))}))}}),Hn=function(t){var n,e=t.readLocalStorage(Vn);return null!=e?((n={}).id5=JSON.parse(decodeURIComponent(e)).universal_uid,n):null},Wn="liveRamp",$n="_lr_env",Kn="idl_env",Qn="apstagLiveRampTimestamp";!function(t){t[t.oldTimestamp=0]="oldTimestamp",t[t.newTimestamp=1]="newTimestamp",t[t.noTimestamp=2]="noTimestamp"}(Dn||(Dn={}));var Zn,Yn=new at({scope:"idVendors",object:"liveramp",action:"get",handler:function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){var t,e,i,r;return o(this,(function(o){return t=te(Xn(n),n),e=function(){var n;return null!=t?((n={})[Wn]=t.id,n):null},i=function(){var n;return null!=t?((n={})[Wn]=t.newGen,n):null},[2,(r=An(e,n)).status===S.completed?In(i,n):r]}))}))}}),Xn=function(t){var n=t.readLocalStorage($n);if(null!=n)return n;var e=t.readCookieStorage($n);if(null!=e)return e;var i=t.readLocalStorage(Kn);if(null!=i)return i;var r=t.readCookieStorage(Kn);return null!=r?r:null},te=function(t,n){if(null!=t&&""!==t)try{var e=JSON.parse(atob(decodeURIComponent(t))),i={id:e.envelope,newGen:Dn.noTimestamp};if(null!=e.timestamp){var r=n.readLocalStorage(Qn);null==r||r1}(n))?[2,S.completed]:function(t){var n=t.read(st,{persist:!0});return void 0!==n&&new Date>=new Date(Number(n))}(n)?(function(t){t.delete(st,{persist:!0}),function(t){var n;null===(n=t.globalContext.apstagDEBUG)||void 0===n||delete n.url}(t)}(n),[2,S.completed]):(function(t){t.record(Le).catch((function(t){})),t.record(ze).catch((function(t){}))}(n),[2,S.waiting])}))}))}],["debug/listeners/show",function(t){var n=t.systemAccount;return r(void 0,void 0,void 0,(function(){var t,e;return o(this,(function(i){return t=n.store.get(c),e=s([],u(t.entries()),!1),console.groupCollapsed("⌂ Listeners"),console.table(e),console.groupEnd(),[2,S.completed]}))}))}]]),Je=[Ne],Ve=new Map(s(s([],u(Be),!1),u(ut(Je)),!1));!function(t){t[t.unspecifiedUnknown=0]="unspecifiedUnknown",t[t.lowEntropy=1]="lowEntropy",t[t.highEntropy=2]="highEntropy"}(Zn||(Zn={}));var Ge=["brands","mobile","platform"],He=["architecture","bitness","fullVersionList","model","platformVersion"];function We(t,n,e){return r(this,void 0,void 0,(function(){var i;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e.getHighEntropyValues(s(s([],u(Ge),!1),u(He),!1))];case 1:return i=r.sent(),t.write(n,JSON.stringify($e(i)),{persist:!0}),[3,3];case 2:return r.sent(),[3,3];case 3:return[2,S.completed]}}))}))}function $e(t){var n,e,i,r={};return r.architecture=t.architecture,r.bitness=t.bitness,r.mobile=t.mobile?1:0,r.model=t.model,r.source=(i=t,He.some((function(t){return i[t]}))?Zn.highEntropy:Ge.some((function(t){return i[t]}))?Zn.lowEntropy:Zn.unspecifiedUnknown),"string"==typeof t.platform&&(r.platform={brand:t.platform,version:null===(n=t.platformVersion)||void 0===n?void 0:n.split(".")}),Array.isArray(t.fullVersionList)?e=t.fullVersionList:Array.isArray(t.brands)&&(e=t.brands),e instanceof Array&&(r.browsers=e.map((function(t){var n;return{brand:t.brand,version:null===(n=t.version)||void 0===n?void 0:n.split(".")}}))),r}var Ke,Qe="deviceSignal/sua/set",Ze=new Map([[Qe,function(t){var n=t.account;return r(void 0,void 0,void 0,(function(){var t,e,i,r,a;return o(this,(function(o){switch(o.label){case 0:return t="deviceSignal/sua",e=null===(r=n.globalContext.navigator)||void 0===r?void 0:r.userAgentData,"string"==typeof(i=n.read(t,{persist:!0}))?n.write(t,i):e instanceof Object&&function(t,n,e){t.write(n,JSON.stringify($e(e)))}(n,t,e),!1!==(null===(a=n.globalContext.apstag)||void 0===a?void 0:a.isGDPRRegion)?[2,S.completed]:"function"!=typeof(null==e?void 0:e.getHighEntropyValues)?[3,2]:[4,We(n,t,e)];case 1:o.sent(),o.label=2;case 2:return[2,S.completed]}}))}))}]]),Ye={key:"deviceSignal/cookieDeprecationLabel",default:void 0},Xe=new at({scope:"deviceSignal",object:"cookieDeprecationLabel",action:"set",handler:function(t){var n=t.account;return t.customEvent,r(void 0,void 0,void 0,(function(){var t,e;return o(this,(function(i){switch(i.label){case 0:return void 0===(null==(t=n.globalContext.navigator.cookieDeprecationLabel)?void 0:t.getValue)||"function"!=typeof t.getValue?[2,{status:S.cancelled}]:[4,n.executeFuncWithConsent(t,t.getValue)];case 1:return void 0===(e=i.sent())||""===e?[2,{status:S.cancelled}]:(n.update(Ye,(function(){return e})),[2,{status:S.completed,analytics:{gcdl:e}}])}}))}))}}),ti=ut([Xe]),ni={key:"_monitoring/statusesByEventIdentifier",default:new Map},ei=function(t){var n=t.account,e=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,i,r,a,u;return o(this,(function(o){if(void 0===(t=null===(u=e.detail)||void 0===u?void 0:u.eventIdentifier))throw new Error("Missing eventIdentifier parameter");return i=n.use(ni),r="".concat(e.type,":").concat(t),void 0!==(a=i.get(r))?[2,a]:[2,S.waiting]}))}))},ii=function(t){var n=t.account,e=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,i,r,a,u,s;return o(this,(function(o){if(void 0===(t=null===(a=e.detail)||void 0===a?void 0:a.eventIdentifier))throw new Error("Missing eventIdentifier parameter");if(void 0===(i=null===(u=e.detail)||void 0===u?void 0:u.statusUpdate))throw new Error("Missing statusUpdate parameter");if(!(i in S))throw new Error("Invalid statusUpdate parameter. Expected one of ".concat(Object.values(S).join(", ")));if(void 0===(r=null===(s=e.detail)||void 0===s?void 0:s.pairedEvents)||r.length<1||r.some((function(t){return"string"!=typeof t})))throw new Error("Parameter pairedEvents must be a non-empty array of string");return r.forEach((function(e){var r="".concat(e,":").concat(t);n.update(ni,(function(t){return t.set(r,i)}))})),[2,S.completed]}))}))},ri=new Map([["_monitor/testing/only",ei],["_update/testing/only",ii],["_legacy/bidRequest/monitor",ei],["_legacy/bidRequest/didComplete",ii]]),oi=new at({scope:"prebid",object:"analyticsEvent",action:"track",handler:function(t){var n=t.account,i=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,r,a,u,s,d,c;return o(this,(function(o){switch(o.label){case 0:return void 0===(null===(a=i.detail)||void 0===a?void 0:a.eventType)||void 0===(null===(u=i.detail)||void 0===u?void 0:u.eventArgs)||void 0===(null===(c=null===(d=null===(s=i.detail)||void 0===s?void 0:s.config)||void 0===d?void 0:d.options)||void 0===c?void 0:c.accountID)?[2,{status:S.cancelled}]:(t={eventType:i.detail.eventType,metadata:i.detail.metadata,config:i.detail.config},[4,n.globalContext.fetch("".concat("https://prod.us-east-1.cxm-bcn.publisher-services.amazon.dev/v1/events/prebid"),ai(i.detail))]);case 1:return(r=o.sent()).ok?[2,{status:S.completed,analytics:t}]:[2,{status:S.cancelled,analytics:e(e({},t),{message:"Request failed: ".concat(r.status)})}]}}))}))}}),ai=function(t){var n={accountId:t.config.options.accountID,events:[{eventArgs:t.eventArgs,eventType:t.eventType}]};return{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}},ui={key:"prebid/config",default:void 0};!function(t){t.NotStarted="NOT STARTED",t.Loading="LOADING",t.Complete="COMPLETE"}(Ke||(Ke={}));var si,di,ci={key:"prebid/configRequestState",default:Ke.NotStarted},li=new at({scope:"prebid",object:"config",action:"fetch",handler:function(t){var n=t.account,i=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,r,a,u,s,d,c,l,v;return o(this,(function(o){switch(o.label){case 0:if((t=n.use(ci))===Ke.Loading)return[2,{status:S.waiting}];if(r={metadata:null===(v=null==i?void 0:i.detail)||void 0===v?void 0:v.metadata},t===Ke.Complete&&void 0!==(a=n.use(ui)))return[2,{status:S.completed,value:JSON.parse(a),analytics:r}];o.label=1;case 1:return o.trys.push([1,4,,5]),n.update(ci,(function(){return Ke.Loading})),u="".concat("https://c.amazon-adsystem.com/cdn/prod/config","?src=").concat(n.id),[4,n.globalContext.fetch(u)];case 2:return s=o.sent(),n.update(ci,(function(){return Ke.Complete})),s.ok?[4,s.json()]:[2,{status:S.cancelled,analytics:e(e({},r),{message:"Config request failed"})}];case 3:return d=o.sent(),c=vi(n,d),n.update(ui,(function(){return JSON.stringify(c)}),{persist:!0}),[2,{status:S.completed,value:c,analytics:r}];case 4:return l=o.sent(),[2,{status:S.cancelled,analytics:e(e({},r),{message:l.message})}];case 5:return[2]}}))}))}}),vi=function(t,n){var e,i,r,o;return{analyticsConfig:{options:{accountID:t.id,sampling:null===(e=n.pbjs)||void 0===e?void 0:e.sampleRate},includeEvents:null===(i=n.pbjs)||void 0===i?void 0:i.allowedEvents},idConfig:{params:{accountID:t.id,enabled:null===(r=n.pbjs)||void 0===r?void 0:r.enabled,treatments:null===(o=n.pbjs)||void 0===o?void 0:o.treatments}}}},fi={key:"prebid/eidsConfig",default:"{}"};!function(t){t.APSSignalIQ="_apsIdTreatment",t.Audigent="hadronId",t.ID5="id5id",t.Liveramp="idl_env",t.Lotame="lotamePanoramaId",t.Pubcommon="pubcid",t.Publink="publinkId",t.ThirtyThree="33acrossId",t.Yahoo="connectId"}(di||(di={}));var hi=new Map([[qn,di.Audigent],["id5",di.ID5],[Wn,di.Liveramp],[ue,di.Lotame],[pe,di.Pubcommon],[ye,di.Publink],[Nn,di.ThirtyThree],[Ae,di.Yahoo]]),pi=((si={})[di.Audigent]={source:"audigent.com",atype:1},si[di.ID5]={source:"id5-sync.com",atype:1},si[di.Liveramp]={source:"liveramp.com",atype:3},si[di.Lotame]={source:"crwdcntrl.net",atype:1},si[di.Pubcommon]={source:"pubcid.org",atype:1},si[di.Publink]={source:"epsilon.com",atype:3},si[di.ThirtyThree]={source:"33across.com",atype:1},si[di.Yahoo]={source:"yahoo.com",atype:3},si),mi=new at({scope:"prebid",object:"eidsConfig",action:"get",handler:function(t){var n=t.account,i=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,r,a,u;return o(this,(function(o){return void 0===(null===(r=n.globalContext.apstag)||void 0===r?void 0:r._atsaaiod)?[2,{status:S.waiting}]:(n.update(fi,(function(){return JSON.stringify(e({},pi))}),{persist:!0}),t={metadata:null===(a=null==i?void 0:i.detail)||void 0===a?void 0:a.metadata,config:null===(u=null==i?void 0:i.detail)||void 0===u?void 0:u.config},[2,{status:S.completed,analytics:t}])}))}))}}),wi=new Set(s(["CONTROL_HOLD_OUT","CLEAN"],u(hi.keys()),!1));var yi,gi={key:"prebid/ids",default:void 0},bi=new at({scope:"prebid",object:"ids",action:"get",handler:function(t){var n=t.account,i=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,r,s,d,c,l,v,f;return o(this,(function(o){switch(o.label){case 0:return void 0===(null===(c=n.globalContext.apstag)||void 0===c?void 0:c._atsaaiod)?[2,{status:S.waiting}]:(n.recordListenerNonBlocking(Pe),void 0!==(t=n.use(Rn))&&(r=Object.fromEntries(Object.entries(t).map((function(t){var n=u(t,2),e=n[0],i=n[1];return[hi.get(e),i]})))),[4,n.recordListener(li,{metadata:null===(l=null==i?void 0:i.detail)||void 0===l?void 0:l.metadata})]);case 1:return s=o.sent(),d={metadata:null===(v=null==i?void 0:i.detail)||void 0===v?void 0:v.metadata},null!==(f=s.idConfig.params.enabled)&&void 0!==f&&f?(null!=s.idConfig.params.treatments&&(r=function(t,n){if(!function(t){var n=t.reduce((function(t,n){return t+n.percent}),0),e=100===n,i=t.reduce((function(t,n){var e=n.treatment;return t&&wi.has(e)}),!0);return e&&i}(n))return t;var i=function(t){var n,e,i=100*Math.random(),r=0;try{for(var o=a(t),u=o.next();!u.done;u=o.next()){var s=u.value;if(i<=(r+=s.percent))return s.treatment}}catch(t){n={error:t}}finally{try{u&&!u.done&&(e=o.return)&&e.call(o)}finally{if(n)throw n.error}}throw new Error("Invalid treatment percentages")}(n);return function(t,n){var i,r=((i={})[di.APSSignalIQ]=n,i),o=hi.get(n);switch(n){case"CONTROL_HOLD_OUT":return e(e({},t),r);case"CLEAN":return r;default:return void 0!==o&&void 0!==(null==t?void 0:t[o])&&(r[o]=t[o]),r}}(t,i)}(r,s.idConfig.params.treatments)),n.update(gi,(function(){return r})),[2,{status:S.completed,value:r,analytics:d}]):[2,{status:S.cancelled,analytics:d}]}}))}))}}),_i=ut([oi,li,mi,bi]),xi=function(t){return t===yi.noConsent?"AMZN-NoCookieConsent":"AMZN-Token"};!function(t){t[t.noConsent=0]="noConsent",t[t.token=1]="token"}(yi||(yi={}));var Ei,Si,Ci=function(t){t.setCookieStorage(xi(yi.token),"",0),t.setCookieStorage(xi(yi.noConsent),"",0)},Ri=function(t){var n=t.account,e=t.hashedRecords,i=t.ttl,r=t.isGDPRRegion,o=t.tcString,a=t.setToken;return Ci(n),"boolean"!=typeof a&&(a=!0),ki({account:n,hashedRecords:e,ttl:i,isGDPRRegion:r,tcString:o}).then((function(t){var e=t.AIPToken,i=t.cookieExpiry;return Ai({AIPToken:e,cookieExpiry:i,account:n,setToken:a})}))},ki=function(t){var n=t.account,e=t.hashedRecords,i=t.ttl,r=t.isGDPRRegion,o=t.tcString;return fetch("https://tk.amazon-adsystem.com/envelope",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ii({account:n,hashedRecords:e,ttl:i,isGDPRRegion:r,tcString:o}))}).then((function(t){if(!t.ok)throw new Error("Token http status error: ".concat(t.status));return t.json()}))},Ai=function(t){var n=t.AIPToken,e=t.cookieExpiry,i=t.account,r=t.setToken;if("string"!=typeof n||"number"!=typeof e)throw new Error("Invalid AIPES response");if(""===n)throw i.setCookieStorage(xi(yi.noConsent),"1",e),new Error("Empty token");(r||"boolean"!=typeof r)&&i.setCookieStorage(xi(yi.token),n,e)},Ii=function(t){var n=t.account,e=t.hashedRecords,i=t.ttl,r=t.isGDPRRegion,o=t.tcString,a={publisherId:n.id,hashedRecords:e};return void 0!==i&&(a.ttl=i),r?(a.gdpr=1,o&&(a.gdprConsent=o)):a.gdpr=0,a},ji=new at({scope:"ad",object:"record",action:"delete",handler:function(t){var n=t.account;return r(void 0,void 0,void 0,(function(){var t;return o(this,(function(e){if(!(null===(t=n.globalContext.apstag)||void 0===t?void 0:t._atsaaiod))return[2,{status:S.waiting}];if(!n.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return Ci(n),[2,{status:S.completed}]}))}))}}),Oi={detail:Z,"detail.setCookie":et(Q),"detail.config":Z,"detail.config.optOut":et(Q),"detail.config.ttl":et($),"detail.config.gdpr":et(Z),"detail.config.gdpr.cmpTimeout":et($),"detail.config.gdpr.enabled":et(rt),"detail.config.gdpr.consent":et(K),"detail.config.gdpr.cmpGlobal":et(K),"detail.config.gdpr.cmpGlobalv2":et(K),"detail.config.hashedRecords":X,"detail.config.hashedRecords[]":Z,"detail.config.hashedRecords[].type":K,"detail.config.hashedRecords[].record":K,"detail.config.hashedRecords[].encrypted":et($),"detail.config.hashedRecords[].toJSON":rt,"detail.config.hashedRecords[].$$typeof":rt,"detail.config.hashedRecords[].constructor":rt,"detail.config.hashedRecords[].tagName":rt,"detail.config.hashedRecords[].@@__IMMUTABLE_ITERABLE__@@":rt,"detail.config.hashedRecords[].@@__IMMUTABLE_RECORD__@@":rt},Pi=new at({scope:"ad",object:"record",action:"renew",validators:{detail:Oi,context:{context:Z}},handler:function(t){var n=t.account,e=t.detail;return r(void 0,void 0,void 0,(function(){var t,i,r,a;return o(this,(function(o){switch(o.label){case 0:if(!(null===(r=n.globalContext.apstag)||void 0===r?void 0:r._atsaaiod))return[2,{status:S.waiting}];if(void 0===(null==e?void 0:e.config))throw new Error("Missing tokenConfig object");if(!n.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return(null!==(a=n.readCookieStorage(xi(yi.token)))&&void 0!==a?a:"").length>0?[2,{status:S.cancelled}]:(t=n.globalContext.apstag.isGDPRRegion,i=n.use(N),[4,(u={account:n,hashedRecords:e.config.hashedRecords,ttl:e.config.ttl,isGDPRRegion:t,tcString:null==i?void 0:i.tcString},Ri(u))]);case 1:return o.sent(),[2,{status:S.completed}]}var u}))}))}});!function(t){t.email="email"}(Ei||(Ei={})),function(t){t.Display="display",t.Video="video",t.MultiFormat="multi-format"}(Si||(Si={}));var Mi,Ti=/^[0-9a-fA-F]{64}$/,Di=function(t){return Ti.test(t||"")},Ni=function(t){return t.then((function(t){return Array.from(new Uint8Array(t)).map((function(t){return t.toString(16).padStart(2,"0")})).join("")})).then((function(t){return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"!==t?t:""}))},Li=function(t,n){return"string"==typeof t&&(n===Ei.email?/\S+@\S+\.\S+/.test(t)||Di(t):t.trim().length>0)},Ui=function(t,n,e){return n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement?Li(n.value,e)?Ni(t.globalContext.crypto.subtle.digest("SHA-256",(new t.globalContext.TextEncoder).encode(n.value||""))):Promise.resolve(""):Li(n.innerText,e)?Ni(t.globalContext.crypto.subtle.digest("SHA-256",(new t.globalContext.TextEncoder).encode(n.innerText||""))):Promise.resolve("")};!function(t){t.LOCAL_STORAGE="LOCAL",t.CSS_SELECTOR="CSS",t.URL="URL"}(Mi||(Mi={}));var qi=function(t,n,e){var i,r;void 0===n&&(n={}),function(t){var n,e=((n={})[Mi.LOCAL_STORAGE]=5,n[Mi.URL]=4,n[Mi.CSS_SELECTOR]=3,n),i={};t.forEach((function(t){i[t.method]=(i[t.method]||0)+1,t.priority=i[t.method]})),t.sort((function(t,n){return t.method===n.method?(t.priority||0)>(n.priority||0)?1:-1:e[t.method]>e[n.method]?-1:1}))}(n.methods||[]);var o,u=[],s=function(n){var i=n.method,r=n.target,a=n.type,s="";switch(i){case Mi.LOCAL_STORAGE:s=function(t,n,e){var i=t.readLocalStorage(n);return i&&Li(i,e)?i:""}(t,r,a);break;case Mi.URL:u.push(function(t,n,e){e=null!=e?e:t.globalContext.location.href,n=n.replace(/[[\]]/g,"\\$&");var i=new RegExp("[?&#]"+n+"(=([^&#?]*)|&|#|$)").exec(e);return Array.isArray(i)&&"string"==typeof i[2]&&0!==decodeURIComponent(i[2].replace(/\+/g," ")).trim().length&&Di(decodeURIComponent(i[2].replace(/\+/g," ")))?Promise.resolve(decodeURIComponent(i[2].replace(/\+/g," "))):new Promise((function(t){return t("")}))}(t,r).then((function(t){return{type:a,value:t}})));break;case Mi.CSS_SELECTOR:o=n}if(s.length>0)return e({value:s,type:a}),{value:void 0}};try{for(var d=a(n.methods||[]),c=d.next();!c.done;c=d.next()){var l=s(c.value);if("object"==typeof l)return l.value}}catch(t){i={error:t}}finally{try{c&&!c.done&&(r=d.return)&&r.call(d)}finally{if(i)throw i.error}}var v=function(){if(o&&(!0===o.isGlobalSubmit||"string"==typeof o.eventTarget&&"string"==typeof o.event)){var n=o.eventTarget,i=o.target,r=o.type,u=o.isGlobalSubmit,s=u?"submit":o.event;if("string"==typeof s&&0!==s.length){var d=function(o){return function(t){var n,e=t.account,i=t.e,r=t.eventTarget,o=t.event,u=t.isGlobalSubmit,s=t.target,d=t.type,c=t.onDone,l=t.listener;u||"window"===r||i.target&&"function"==typeof i.target.matches&&"string"==typeof r&&i.target.matches(r)?(u&&i instanceof Event&&i.target&&(n=i.target.querySelectorAll('input[type="email"]')),function(t,n,e,i){var r,o,u=i||t.globalContext.document.querySelectorAll(n);if(0===u.length)return new Promise((function(t){return t("")}));if(1===u.length)return Ui(t,u[0],e);var s=[];try{for(var d=a(u),c=d.next();!c.done;c=d.next()){var l=c.value;s.push(Ui(t,l,e))}}catch(t){r={error:t}}finally{try{c&&!c.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}return Promise.all(s).then((function(t){var n,e,i=null;try{for(var r=a(t),o=r.next();!o.done;o=r.next()){var u=o.value;if(""!==u){if(null!==i&&("string"!=typeof i||i!==u))return"";i=u}}}catch(t){n={error:t}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(n)throw n.error}}return null!=i?i:""}))}(e,s,d,n).then((function(t){"function"==typeof l&&e.globalContext.removeEventListener(o,l),c(!(t.length<1)&&{value:t,type:d})}))):c(!1)}({account:t,e:o,event:s,eventTarget:n,isGlobalSubmit:u,target:i,type:r,onDone:e,listener:d})};t.globalContext.addEventListener(s,d)}else e(!1)}else e(!1)};if(0!==u.length)return Promise.all(u).then((function(t){var n,i;try{for(var r=a(t),o=r.next();!o.done;o=r.next()){var u=o.value;if(u.value.length>0)return void e(u)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}v()}));v()},zi={called:!1};function Fi(t,n){return new Promise((function(e,i){if(zi.called&&!n.overrideLimit)throw new Error("rr should only be called once per page load");zi.called=!0;var r=0,o=function(){var a=function(){var r,o,a=t.use(N);return(!(null===(r=t.globalContext.apstag)||void 0===r?void 0:r.isGDPRRegion)||void 0!==a)&&(void 0===a||t.isAllowedToAccessInfoOnDevice()?(null===(o=qi(t,n,(function(n){if(!1===n)return e("no retrieval");Ri({account:t,hashedRecords:[{type:n.type,record:n.value}],source:"rr",tcString:null==a?void 0:a.tcString}).then((function(){e("token generated")})).catch(i)})))||void 0===o||o.catch(i),!0):"canceled")}(),u=r>6400;if(a||u)return"canceled"===a&&i(new Error("tcf timeout")),void(u&&i(new Error("interval over")));setTimeout(o,r),r=0===r?200:2*r};o()}))}var Bi=new at({scope:"ad",object:"record",action:"rr",validators:{detail:{detail:Z,"detail.config":Z,"detail.config.constructor":rt,"detail.config.$$typeof":rt,"detail.config.tagName":rt,"detail.config.@@__IMMUTABLE_ITERABLE__@@":rt,"detail.config.@@__IMMUTABLE_RECORD__@@":rt,"detail.config.accountID":et(K),"detail.config.overrideLimit":et(Q),"detail.config.methods":X,"detail.config.methods[].tagName":rt,"detail.config.methods[]":nt(Z),"detail.config.methods[].$$typeof":rt,"detail.config.methods[].constructor":rt,"detail.config.methods[].@@__IMMUTABLE_ITERABLE__@@":rt,"detail.config.methods[].@@__IMMUTABLE_RECORD__@@":rt,"detail.config.methods[].type":tt(Object.values(Ei)),"detail.config.methods[].method":tt(Object.values(Mi)),"detail.config.methods[].target":et(K),"detail.config.methods[].event":et(K),"detail.config.methods[].eventTarget":et(K),"detail.config.methods[].isGlobalSubmit":et(Q),"detail.config.methods[].priority":et($)},context:{context:Z,"context.Promise":it,"context.crypto":Z,"context.crypto.subtle":it}},handler:function(t){var n=t.account,e=t.detail;return r(void 0,void 0,void 0,(function(){var t,i;return o(this,(function(r){switch(r.label){case 0:if(!(null===(i=n.globalContext.apstag)||void 0===i?void 0:i._atsaaiod))return[2,{status:S.waiting}];if(!n.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return[4,Fi(n,e.config)];case 1:return t=r.sent(),[2,{status:S.completed,analytics:{rr:t}}]}}))}))}}),Ji=new at({scope:"ad",object:"record",action:"update",validators:{detail:Oi,context:{context:Z}},handler:function(t){var n=t.account,e=t.detail;return r(void 0,void 0,void 0,(function(){var t,i,r;return o(this,(function(o){switch(o.label){case 0:if(!(null===(r=n.globalContext.apstag)||void 0===r?void 0:r._atsaaiod))return[2,{status:S.waiting}];if(!n.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return t=n.globalContext.apstag.isGDPRRegion,i=n.use(N),e.config.optOut?(Ci(n),[3,3]):[3,1];case 1:return[4,Ri({account:n,hashedRecords:e.config.hashedRecords,ttl:e.config.ttl,isGDPRRegion:t,tcString:null==i?void 0:i.tcString,setToken:null==e?void 0:e.setCookie})];case 2:o.sent(),o.label=3;case 3:return[2,{status:S.completed}]}}))}))}}),Vi=ut([ji,Pi,Bi,Ji]),Gi=new Map([["ad/ASRSlot/render",function(t){var n=t.account,e=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,i;return o(this,(function(r){if(void 0===(null===(t=e.detail)||void 0===t?void 0:t.id)||void 0===(null===(i=e.detail)||void 0===i?void 0:i.targeting))throw new Error("Missing event detail");return function(t,n,e,i){var r,o,a,u=e.globalContext.document.createElement("iframe"),s=null===(r=n.get("amznsz"))||void 0===r?void 0:r.split("x"),d=n.get("amzniid"),c=t;if(!(void 0===d||void 0===c||void 0===s||s.length<2)){u.style.marginLeft="0",u.style.marginTop="0",u.style.height="".concat(s[1],"px"),u.style.width="100%",u.setAttribute("scrolling","no"),u.setAttribute("frameborder","0");var l=e.globalContext.document.createElement("div"),v=null!==(o=null==i?void 0:i.location)&&void 0!==o?o:"afterend",f=e.globalContext.document.getElementById(c);if(null!=f){f.insertAdjacentElement(v,l),l.appendChild(u);var h=null===(a=null==u?void 0:u.contentWindow)||void 0===a?void 0:a.document;void 0!==h&&(h.open(),h.write('