/*! @amzn/apswebapstaglibrary - web-client-bundle - v25.313.1951 - 2025-03-13 19:51:51 */ !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 d(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 s=o.filter((function(t){return void 0!==t&&a>=Math.random()}));o.length=0,t.push.apply(t,d([],u(s),!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}(),b=new y;!function(t){t.postulate="postulate",t.genericError="error"}(h||(h={}));var g="25.313.1951";function k(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:g});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 E,_,I,S,x={S:setInterval,R:function(){var t;return null===(t=window[R])||void 0===t?void 0:t[j]},j: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"}}},A:k,C:function(t,n){return{eventTime:A((function(){return"".concat(Date.now())})),accountID:A((function(){return null==t?void 0:t.accountID})),libraryVersion:g,url:A((function(){return n().href})),hostname:A((function(){return n().hostname})),message:A((function(){return null==t?void 0:t.message})),condition:A((function(){return null==t?void 0:t.condition}))}},O:function(t,n){var e,i;try{(null!=n?n:k)(h.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:k)(h.genericError,"telemetry_core_failure")}}},R="_aps_telemetry",j="alarms";function A(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"}(E||(E={})),function(t){t.internal="internal",t.apstag="apstag",t.webpage="webpage",t.dtbm="dtbm"}(_||(_={})),function(t){t.completed="completed",t.waiting="waiting",t.cancelled="cancelled"}(I||(I={})),function(t){t.started="started",t.error="error",t.unknown="unknown",t.deactivated="deactivated",t.analytics="analytics"}(S||(S={}));var C=e(e({},I),S),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,I.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,I.completed]}))}))}]]),P="apstag/configuration/fetch",T=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,I.completed]}}))}))}]]),M="consent/isGPPListenerRegistered",N={key:"consent/isTCFAPIListenerRegistered",default:!1},D={key:"consent/TCData",default:void 0};function U(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 L(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(!U(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:L(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:L(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 U(t,n)}))}},z="consent/gppapi/attemptSync",V="consent/gppapi/didChange",B="consent/gppapi/syncData",F="consent/tcfapi/attemptSync",J="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(M)?[2,I.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(V,{eventListener:t,fromAddEvent:!0}).catch((function(t){}))})),n.write(M,"listenerRegistered"===(null==t?void 0:t.eventName)&&!0===(null==t?void 0:t.data)),[2,I.completed]}}))}))}],[V,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,I.completed]}}))}))}],[B,function(t){var n=t.account,i=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,r,a,d,s,c,l,v,f,p,h,m,w,y,b;return o(this,(function(o){return(null!==(h=null===(p=null===(f=null===(v=i.detail)||void 0===v?void 0:v.eventListener)||void 0===f?void 0:f.pingData)||void 0===p?void 0:p.gppString)&&void 0!==h?h:"").length>0?(t=null===(w=null===(m=i.detail)||void 0===m?void 0:m.eventListener)||void 0===w?void 0:w.pingData,d="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],d="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],d="getGPPData")),s={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:d,fromAddEvent:null===(b=i.detail)||void 0===b?void 0:b.fromAddEvent}},n.write("consent/GPPData",t),[2,{status:I.completed,analytics:s}]}))}))}],[F,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(N),void 0===n.globalContext.__tcfapi||t?[2,I.cancelled]:(n.globalContext.__tcfapi("addEventListener",2,(function(t,e){n.record(J,{tcData:t,success:e}).catch((function(t){}))})),[2,I.completed])}))}))}],[J,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(N,(function(n){return n||!0===t})),i=null===(a=e.detail)||void 0===a?void 0:a.tcData,n.update(D,(function(n){return void 0!==i||!0===t?i:n})),"object"!=typeof i?[2,I.completed]:[2,{status:I.completed,analytics:q(n,i)}]}))}))}]]);function H(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),'": Validator does not specify this object as modifiable'))},deleteProperty:function(t,n){throw new Error('Cannot delete property "'.concat(String(n),'": Validator does not specify this object as modifiable'))},defineProperty:function(t,n){throw new Error('Cannot define property "'.concat(String(n),'": Validator does not specify this object as modifiable'))},setPrototypeOf:function(t){throw new Error("Cannot set prototype: Validator does not specify this object 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("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 H(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){return H(t.apply(e,r),n,"".concat(i,"()"))}}},a=function(r){if(!1===r.verifiable)return t;if(t instanceof Set)return t.forEach((function(t){H(t,n,"".concat(i,".value"))})),t;if(t instanceof Map)return t.forEach((function(t,e){H(e,n,"".concat(i,".key")),H(t,n,"".concat(i,".value"))})),t;if(Array.isArray(t))return t.map((function(t){return H(t,n,"".concat(i,"[]"))}));if("function"==typeof t)return new Proxy(t,o.function);var a=e(e({},o.validating),(null==r?void 0:r.modifiable)?o.modifiable:o.nonModifiable);try{return new Proxy(t,a)}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[R]&&(r[R]={}),void 0===r[R][j]&&(r[R][j]=[]);var o=r[R][j],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+'"':t.toString()}catch(t){}throw new Error('Validation failed for "'.concat(i,'": ').concat(n.message," - Received: ").concat(a))}return null!=r?r:{}}());return a}var W=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")},$=function(t){if("boolean"!=typeof t)throw new Error("must be a boolean")},Q=function(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new Error("must be a standard object")},Y=function(t){if(!Array.isArray(t))throw new Error("must be an array")};function Z(t){return function(n){if(!1===t.includes(n))throw new Error("must be one of the following values: ".concat(JSON.stringify(t)))}}function X(t){return function(n,e){if(t===nt)throw new Error("isAny cannot be used within isOptional");null!=n&&t(n,e)}}var tt=function(t){if("function"!=typeof t)throw new Error("must be a function")},nt=function(){},et=function(){return{verifiable:!1}},it=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:H(i.customEvent.detail,null!==(r=null==n?void 0:n.detail)&&void 0!==r?r:{detail:nt},"detail"),context:H(i.account.globalContext,null!==(u=null==n?void 0:n.context)&&void 0!==u?u:{context:nt},"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 rt(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 ot="debugSession/end",at="prepend/events",ut="populator/ran",dt={key:"consent/hasPurposeOneConsent",default:!1},st=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}(),ct=["scope/objectName",ot,at];function lt(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(lt(n)),t}),[]):t instanceof Set?Array.from(t.values()).reduce((function(t,n){return t.add(lt(n)),t}),new Set):t instanceof Map?Array.from(t.entries()).reduce((function(t,n){return t.set(n[0],lt(n[1])),t}),new Map):t instanceof Object?Object.keys(t).reduce((function(n,e){return n[e]=lt(t[e]),n}),{}):t}var vt,ft=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:_.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:_.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 s=this.readLocalStorage(t,{usePrefix:!0});if(void 0!==s)return s}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,d([],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 lt(o)}catch(t){return b.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){b.logError(e(e({},t),{account:this}))},t.prototype.recordStatusChangeEvent=function(t){b.logFeature({id:t.id,account:this,feature:t.status,props:e({},t.props)})},t.prototype.recordGenericEvent=function(t){b.logFeature({id:t.id,account:this,feature:t.id,props:e({},t.props)})},t.prototype.isAllowedToAccessInfoOnDevice=function(){return this.updateUserConsent(),this.use(dt)},t.prototype.isAPStagAllowedToAccessInfoOnDevice=function(){return!0===this.globalContext.apstag._atsaaiod()},t.prototype.updateUserConsent=function(){try{var t=this.isAPStagAllowedToAccessInfoOnDevice();this.update(dt,(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||ct.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 st(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 st(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}(),pt="_system",ht=function(t){function e(n,e){return t.call(this,pt,{globalContext:n,rootName:e})||this}return n(e,t),e}(ft),mt=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(pt)&&(this.getAccounts().set(pt,{queue:[],store:new Map}),new ht(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;e150){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,d([],u(t.queue.filter((function(t){return void 0!==t.status&&Et.includes(t.status)}))),!1)),t.store.set(l,e)},t.prototype.bt=function(t){var n;(n=t.queue).splice.apply(n,d([0,t.queue.length],u(t.queue.filter((function(t){return void 0===t.status||!Et.includes(t.status)}))),!1))},t.prototype.gt=function(){var t=this;this.ht().forEach((function(n){t.yt(n),t.wt(n),t.bt(n)}))},t.prototype.kt=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)!==_.internal&&(null===(e=t.detail)||void 0===e?void 0:e.source)!==_.apstag&&t.status!==C.waiting}))},t.prototype.Et=function(t){var n,e=this.kt(t);return null!==(n=null==e?void 0:e.length)&&void 0!==n?n:0},t.prototype._t=function(t){var n=this.Et(t);this.G(f,n)},t.prototype.It=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 ht(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.It(),p()&&yt.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._t(u.events);var d=new ht(this.globalContext,this.rootName);this.ht().forEach((function(t){return a.lt(t,d,u)})),this.gt()}catch(t){throw new ht(this.globalContext,this.rootName).recordErrorEvent({id:"C.l.D.dis",error:t}),t}},t}(),It=function(){function t(t,n){this.globalContext=t,this.rootName=n}return t.prototype.subscribe=function(t){try{var n=new ht(this.globalContext,this.rootName),e=null!=n.store.get(c)?n.store.get(c):new Map;n.store.set(c,new Map(d(d([],u(e),!1),u(t),!1)))}catch(t){throw new ht(this.globalContext,this.rootName).recordErrorEvent({id:"Core.library.Subscriber.subscribe",error:t}),t}},t}(),St=function(){function t(t,n){this.globalContext=t,this.rootName=n}return t.prototype.populate=function(){try{var t=new ht(this.globalContext,this.rootName),n=!1;try{n=JSON.parse(t.read(ut))}catch(t){}if(n)return;t.write(ut,JSON.stringify(!0)),this.populateFromPrependStore(),this.populateFromQueryParams()}catch(t){new ht(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 ft(e,{globalContext:t.globalContext,rootName:t.rootName}),a=null!==(r=o.read(at,{persist:!0}))&&void 0!==r?r:"[]";o.write(at,JSON.stringify([]));try{var s=JSON.parse(a);if(0===s.length)return;(i=o.queue).push.apply(i,d([],u(s.map(Rt)),!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(pt);xt(i,"aps.trigger").forEach((function(t){o.queue.push(Rt(t))})),xt(i,"aps.triggerFor",!0).forEach((function(t){void 0!==t.accountId&&r.has(t.accountId)&&r.get(t.accountId).queue.push(Rt(t))}));var a=xt(i,"aps_event");r.forEach((function(t){a.forEach((function(n){t.queue.push(Rt(n))}))}))},t}(),xt=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},Rt=function(t){var n;return new CustomEvent(t.eventName,{detail:e({},null!==(n=t.eventDetail)&&void 0!==n?n:{})})},jt={globalContext:window,rootName:"_aps"},At=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 ht(this.globalContext,this.rootName).update(gt,(function(n){return n.delete(t.ID),n}))},t.prototype.recordListener=function(t,n){var e=this;new ht(this.globalContext,this.rootName).update(gt,(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}(),Ct=function(){function t(t,n){void 0===t&&(t=jt.globalContext),void 0===n&&(n=jt.rootName),this.dispatcher=new _t(t,n),this.equiper=new mt(t,n,this.dispatcher),this.subscriber=new It(t,n),this.populator=new St(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 ft(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:E.direct}}),this.populate()},t.prototype.registerEventSource=function(t){return this.equip(),new At(t,this.globalContext,this.rootName)},t}(),Ot="vnd_prx_segments",Pt="aps_targeting_comscore",Tt=new it({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:Mt(n)}]}))}))}}),Mt=function(t){var n=t.readSessionStorage(Pt);if(t.deleteSessionStorage(Pt),null==n)return I.cancelled;try{var e=JSON.parse(n)[Ot];if(null==e)throw new Error;return t.globalContext.googletag.pubads().getSlots().forEach((function(t){t.setTargeting(Ot,e)})),I.completed}catch(t){throw new Error("Malformed targeting object at ".concat(Pt))}},Nt="aps_targeting_ias",Dt=new it({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:Ut(n)}]}))}))}}),Ut=function(t){var n=t.readSessionStorage(Nt);if(t.deleteSessionStorage(Nt),null==n)return I.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),I.completed}catch(t){throw new Error("Malformed targeting object at ".concat(Nt))}},Lt="aps_targeting_illuma",qt=new it({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:zt(n)}]}))}))}}),zt=function(t){var n=t.readSessionStorage(Lt);if(t.deleteSessionStorage(Lt),null==n)return I.cancelled;var e=JSON.parse(n).results;if(null==e)throw new Error("Malformed targeting object at ".concat(Lt));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))})),I.completed},Vt=new it({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(Tt),n.recordListener(Dt),n.recordListener(qt)])];case 1:return t.sent(),[2,{status:I.completed}]}}))}))}}),Bt=rt([Tt,Vt,Dt,qt]),Ft={key:"customPlacement/hints",default:{}},Jt={key:"customPlacement/bidResponses",default:{}},Gt=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.St=i}return t.prototype.getTagStyle=function(t){var n=this.St.getElementsByTagName(t);if(n&&n[0]){var e=window.getComputedStyle(this.St.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.xt(t)},t.prototype.xt=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 d=this.slotProps.Rt;if(this.slotProps.location&&this.slotProps.id){var s=this.St.createElement("div");null===(i=this.St.getElementById(this.slotProps.id))||void 0===i||i.insertAdjacentElement(this.slotProps.location,s),d=s}if(!d)return!1;var c=this.St.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(d,c,u?"amznadm":"admi")},c.srcdoc=u||"",t&&t.clickPrefix&&(c.srcdoc=c.srcdoc.replace(this.CLICK_PREFIX_MACRO,t.clickPrefix)),d.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.Rt)||void 0===e||e.setAttribute("data-aps-custom-".concat(t),n)},t}(),Ht={key:"customPlacement/timings",default:[]},Wt=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{}}},Kt=function(t,n,e){t.update(Ht,(function(t){return t.push({time:performance.now(),key:"".concat(n,"/").concat(e)}),t}))},$t="customPlacements",Qt=new it({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;Kt(n,$t,"hint/process/".concat(t));var i=n.use(Ft),r=n.use(Jt);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 Gt({id:t,Rt:o},e,n.globalContext.document);Kt(n,$t,"widget/render/".concat(t)),a.render(i[t].hintMetadata)&&(e.isRendered=!0,i[t].isRendered=!0)}}})),n.update(Ft,(function(){return i})),n.update(Jt,(function(){return r})))},e=n.use(Ft),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:I.completed,analytics:{browserInfo:Wt(n.globalContext.document,null===(i=n.globalContext.navigator)||void 0===i?void 0:i.connection,n.globalContext.innerWidth,n.globalContext.innerHeight)}}]}))}))}}),Yt=new it({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,d,s;return o(this,(function(o){if(void 0===(null===(d=e.detail)||void 0===d?void 0:d.id))throw new Error("Hint `id` must be defined");return t=e.detail,i=t.id,r=t.isDefault,a=t.hintMetadata,Kt(n,$t,"hint/define/".concat(i)),(u=n.use(Ft))[i]={default:"default"===r,isRendered:!1,hintMetadata:null!=a?a:{}},n.update(Ft,(function(){return u})),n.recordListenerNonBlocking(Qt),[2,{status:I.completed,analytics:{browserInfo:Wt(n.globalContext.document,null===(s=n.globalContext.navigator)||void 0===s?void 0:s.connection,n.globalContext.innerWidth,n.globalContext.innerHeight)}}]}))}))}}),Zt={key:"customPlacement/placementResponseDispatched",default:!1},Xt={key:"customPlacement/placementResponse",default:void 0},tn={key:"customPlacement/contextURL",default:void 0},nn={key:"customPlacement/placementEndpoint",default:"https://c.aps.amazon-adsystem.com/e/placements"},en={key:"ad/context",default:void 0},rn=new it({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 Kt(n,$t,"placementFetch/start"),[4,an(n)];case 1:return t=i.sent(),Kt(n,$t,"placementFetch/end"),[2,{status:I.completed,value:{placementResponse:t},analytics:{browserInfo:Wt(n.globalContext.document,null===(e=n.globalContext.navigator)||void 0===e?void 0:e.connection,n.globalContext.innerWidth,n.globalContext.innerHeight)}}]}}))}))}});function on(t){var n=t.use(en);return void 0!==n&&"user"in n?(n.user,i(n,["user"])):n}function an(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:on(t)},e=t.use(tn),i=t.use(nn),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 un={key:"customPlacement/bidEndpoint",default:"c.aps.amazon-adsystem.com"},dn={key:"customPlacement/bidIsKey",default:"86355855cc6ed9e335d0382c8563aa10"},sn=new it({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=Wt(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:I.waiting,analytics:{browserInfo:t}}]:(Kt(n,$t,"fetchBids/start"),[4,cn(n)]);case 1:return e=o.sent(),Kt(n,$t,"fetchBids/end"),[2,{status:I.completed,value:{bidResponses:e},analytics:{browserInfo:t}}]}}))}))}});function cn(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(un),params:{program:"apscustom",is:t.use(dn)}},e={pubID:t.id,isSelfServePub:36===t.id.length,deals:!0},i=t.use(tn),[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 ln=new it({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 Kt(n,$t,"service/enable"),n.update(Zt,(function(){return!1})),[4,Promise.all([n.recordListener(rn).then((function(t){var e=t.placementResponse;vn(n,!0,e),n.update(Xt,(function(){return e}))})),n.recordListener(sn).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(Jt);a[r]=t,n.update(Jt,(function(){return a})),o=!0}vn(n,!1,{aps:[{active:o,dispatchEventOnValidBid:!0}]})}))})).then((function(){n.recordListenerNonBlocking(Qt)}))])];case 1:return e.sent(),[2,{status:I.completed,analytics:{browserInfo:Wt(n.globalContext.document,null===(t=n.globalContext.navigator)||void 0===t?void 0:t.connection,n.globalContext.innerWidth,n.globalContext.innerHeight)}}]}}))}))}});function vn(t,n,e){var i;if(!t.use(Zt)){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||(Kt(t,$t,"placementResponseEvent/dispatch"),t.record("customPlacement/placement/didRespond",e).catch((function(t){})),t.update(Zt,(function(){return!0})))}}var fn=new Map(d([],u(rt([Yt,sn,Qt,ln,rn])),!1)),pn=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),hn={key:"cxm/vendors",default:{}},mn={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 wn(t){var n=[],e={user:{ext:{eids:n}}};return Object.entries(mn).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 yn="cxm/liveintent/set",bn="cxm/arcspan/set",gn="cxm/anomymised/set",kn=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(yn),n.record(bn),n.record(gn)])];case 1:return t.sent(),[2,I.completed]}}))}))}],[yn,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 pn(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=wn(JSON.parse(i))}catch(t){r=wn(JSON.parse(decodeURIComponent(i)))}if(void 0!==r)return{data:{default:r}}}}(n)}catch(t){if(t instanceof pn)return[2,{status:I.cancelled,analytics:{statusReason:t.message}}];throw t}return void 0===t?[2,I.cancelled]:(n.update(hn,(function(n){var i;return e(e({},n),((i={}).liveintent=t,i))})),[2,I.completed])}))}))}],[bn,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=d([],u(new Set(d(d([],u(r),!1),u(n.page_iab_newcodes.text),!1))),!1)),void 0!==n.page_iab_newcodes.images&&(r=d([],u(new Set(d(d([],u(r),!1),u(n.page_iab_newcodes.images),!1))),!1));var s={name:"arcspan",segment:[],ext:{segtax:6}};r.forEach((function(t){s.segment=s.segment.concat({id:t})}));var c={data:[]};return c.data=c.data.concat(s),{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,I.cancelled]:(n.update(hn,(function(n){return e(e({},n),{arcspan:t})})),[2,I.completed])}))}))}],[gn,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 pn(t)}if("string"==typeof n){for(var e=JSON.parse(n),i="",r=0;r1}(n))?[2,I.completed]:function(t){var n=t.read(ot,{persist:!0});return void 0!==n&&new Date>=new Date(Number(n))}(n)?(function(t){t.delete(ot,{persist:!0}),function(t){var n;null===(n=t.globalContext.apstagDEBUG)||void 0===n||delete n.url}(t)}(n),[2,I.completed]):(function(t){t.record($e).catch((function(t){})),t.record(Ze).catch((function(t){}))}(n),[2,I.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=d([],u(t.entries()),!1),console.groupCollapsed("⌂ Listeners"),console.table(e),console.groupEnd(),[2,I.completed]}))}))}]]),ni=[Ke],ei=new Map(d(d([],u(ti),!1),u(rt(ni)),!1));!function(t){t[t.unspecifiedUnknown=0]="unspecifiedUnknown",t[t.lowEntropy=1]="lowEntropy",t[t.highEntropy=2]="highEntropy"}(re||(re={}));var ii=["brands","mobile","platform"],ri=["architecture","bitness","fullVersionList","model","platformVersion"];function oi(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(d(d([],u(ii),!1),u(ri),!1))];case 1:return i=r.sent(),t.write(n,JSON.stringify(ai(i)),{persist:!0}),[3,3];case 2:return r.sent(),[3,3];case 3:return[2,I.completed]}}))}))}function ai(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,ri.some((function(t){return i[t]}))?re.highEntropy:ii.some((function(t){return i[t]}))?re.lowEntropy:re.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 ui,di="deviceSignal/sua/set",si=new Map([[di,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(ai(e)))}(n,t,e),!1!==(null===(a=n.globalContext.apstag)||void 0===a?void 0:a.isGDPRRegion)?[2,I.completed]:"function"!=typeof(null==e?void 0:e.getHighEntropyValues)?[3,2]:[4,oi(n,t,e)];case 1:o.sent(),o.label=2;case 2:return[2,I.completed]}}))}))}]]),ci={key:"deviceSignal/cookieDeprecationLabel",default:void 0},li=new it({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:I.cancelled}]:[4,n.executeFuncWithConsent(t,t.getValue)];case 1:return void 0===(e=i.sent())||""===e?[2,{status:I.cancelled}]:(n.update(ci,(function(){return e})),[2,{status:I.completed,analytics:{gcdl:e}}])}}))}))}}),vi=rt([li]),fi={key:"_monitoring/statusesByEventIdentifier",default:new Map},pi=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(fi),r="".concat(e.type,":").concat(t),void 0!==(a=i.get(r))?[2,a]:[2,I.waiting]}))}))},hi=function(t){var n=t.account,e=t.customEvent;return r(void 0,void 0,void 0,(function(){var t,i,r,a,u,d;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 I))throw new Error("Invalid statusUpdate parameter. Expected one of ".concat(Object.values(I).join(", ")));if(void 0===(r=null===(d=e.detail)||void 0===d?void 0:d.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(fi,(function(t){return t.set(r,i)}))})),[2,I.completed]}))}))},mi=new Map([["_monitor/testing/only",pi],["_update/testing/only",hi],["_legacy/bidRequest/monitor",pi],["_legacy/bidRequest/didComplete",hi]]),wi=new it({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,d,s,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===(s=null===(d=i.detail)||void 0===d?void 0:d.config)||void 0===s?void 0:s.options)||void 0===c?void 0:c.accountID)?[2,{status:I.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"),yi(i.detail))]);case 1:return(r=o.sent()).ok?[2,{status:I.completed,analytics:t}]:[2,{status:I.cancelled,analytics:e(e({},t),{message:"Request failed: ".concat(r.status)})}]}}))}))}}),yi=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)}},bi={key:"prebid/config",default:void 0};!function(t){t.NotStarted="NOT STARTED",t.Loading="LOADING",t.Complete="COMPLETE"}(ui||(ui={}));var gi,ki,Ei={key:"prebid/configRequestState",default:ui.NotStarted},_i=new it({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,d,s,c,l,v;return o(this,(function(o){switch(o.label){case 0:if((t=n.use(Ei))===ui.Loading)return[2,{status:I.waiting}];if(r={metadata:null===(v=null==i?void 0:i.detail)||void 0===v?void 0:v.metadata},t===ui.Complete&&void 0!==(a=n.use(bi)))return[2,{status:I.completed,value:JSON.parse(a),analytics:r}];o.label=1;case 1:return o.trys.push([1,4,,5]),n.update(Ei,(function(){return ui.Loading})),u="".concat("https://c.amazon-adsystem.com/cdn/prod/config","?src=").concat(n.id),[4,n.globalContext.fetch(u)];case 2:return d=o.sent(),n.update(Ei,(function(){return ui.Complete})),d.ok?[4,d.json()]:[2,{status:I.cancelled,analytics:e(e({},r),{message:"Config request failed"})}];case 3:return s=o.sent(),c=Ii(n,s),n.update(bi,(function(){return JSON.stringify(c)}),{persist:!0}),[2,{status:I.completed,value:c,analytics:r}];case 4:return l=o.sent(),[2,{status:I.cancelled,analytics:e(e({},r),{message:l.message})}];case 5:return[2]}}))}))}}),Ii=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}}}},Si={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"}(ki||(ki={}));var xi=new Map([[Un,ki.Audigent],["id5",ki.ID5],[te,ki.Liveramp],[pe,ki.Lotame],[Se,ki.Pubcommon],[je,ki.Publink],[Pn,ki.ThirtyThree],[ze,ki.Yahoo]]),Ri=((gi={})[ki.Audigent]={source:"audigent.com",atype:1},gi[ki.ID5]={source:"id5-sync.com",atype:1},gi[ki.Liveramp]={source:"liveramp.com",atype:3},gi[ki.Lotame]={source:"crwdcntrl.net",atype:1},gi[ki.Pubcommon]={source:"pubcid.org",atype:1},gi[ki.Publink]={source:"epsilon.com",atype:3},gi[ki.ThirtyThree]={source:"33across.com",atype:1},gi[ki.Yahoo]={source:"yahoo.com",atype:3},gi),ji=new it({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:I.waiting}]:(n.update(Si,(function(){return JSON.stringify(e({},Ri))}),{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:I.completed,analytics:t}])}))}))}}),Ai=new Set(d(["CONTROL_HOLD_OUT","CLEAN"],u(xi.keys()),!1));var Ci,Oi={key:"prebid/ids",default:void 0},Pi=new it({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,d,s,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:I.waiting}]:(n.recordListenerNonBlocking(Je),void 0!==(t=n.use(En))&&(r=Object.fromEntries(Object.entries(t).map((function(t){var n=u(t,2),e=n[0],i=n[1];return[xi.get(e),i]})))),[4,n.recordListener(_i,{metadata:null===(l=null==i?void 0:i.detail)||void 0===l?void 0:l.metadata})]);case 1:return d=o.sent(),s={metadata:null===(v=null==i?void 0:i.detail)||void 0===v?void 0:v.metadata},null!==(f=d.idConfig.params.enabled)&&void 0!==f&&f?(null!=d.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&&Ai.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 d=u.value;if(i<=(r+=d.percent))return d.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={})[ki.APSSignalIQ]=n,i),o=xi.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,d.idConfig.params.treatments)),n.update(Oi,(function(){return r})),[2,{status:I.completed,value:r,analytics:s}]):[2,{status:I.cancelled,analytics:s}]}}))}))}}),Ti=rt([wi,_i,ji,Pi]),Mi=function(t){return t===Ci.noConsent?"AMZN-NoCookieConsent":"AMZN-Token"};!function(t){t[t.noConsent=0]="noConsent",t[t.token=1]="token"}(Ci||(Ci={}));var Ni,Di,Ui=function(t){t.setCookieStorage(Mi(Ci.token),"",0),t.setCookieStorage(Mi(Ci.noConsent),"",0)},Li=function(t){var n=t.account,e=t.hashedRecords,i=t.ttl,r=t.isGDPRRegion,o=t.tcString,a=t.setToken;return Ui(n),"boolean"!=typeof a&&(a=!0),qi({account:n,hashedRecords:e,ttl:i,isGDPRRegion:r,tcString:o}).then((function(t){var e=t.AIPToken,i=t.cookieExpiry;return zi({AIPToken:e,cookieExpiry:i,account:n,setToken:a})}))},qi=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(Vi({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()}))},zi=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(Mi(Ci.noConsent),"1",e),new Error("Empty token");(r||"boolean"!=typeof r)&&i.setCookieStorage(Mi(Ci.token),n,e)},Vi=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},Bi=new it({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:I.waiting}];if(!n.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return Ui(n),[2,{status:I.completed}]}))}))}}),Fi={detail:Q,"detail.setCookie":X($),"detail.config":Q,"detail.config.optOut":X($),"detail.config.ttl":X(W),"detail.config.gdpr":X(Q),"detail.config.gdpr.cmpTimeout":X(W),"detail.config.gdpr.enabled":X(nt),"detail.config.gdpr.consent":X(K),"detail.config.gdpr.cmpGlobal":X(K),"detail.config.gdpr.cmpGlobalv2":X(K),"detail.config.hashedRecords":Y,"detail.config.hashedRecords[]":Q,"detail.config.hashedRecords[].type":K,"detail.config.hashedRecords[].record":K,"detail.config.hashedRecords[].encrypted":X(W),"detail.config.hashedRecords[].toJSON":nt,"detail.config.hashedRecords[].$$typeof":nt,"detail.config.hashedRecords[].constructor":nt,"detail.config.hashedRecords[].tagName":nt,"detail.config.hashedRecords[].@@__IMMUTABLE_ITERABLE__@@":nt,"detail.config.hashedRecords[].@@__IMMUTABLE_RECORD__@@":nt},Ji=new it({scope:"ad",object:"record",action:"renew",validators:{detail:Fi,context:{context:Q}},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:I.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 t=n.globalContext.apstag.isGDPRRegion,i=n.use(D),[4,(a={account:n,hashedRecords:e.config.hashedRecords,ttl:e.config.ttl,isGDPRRegion:t,tcString:null==i?void 0:i.tcString},Li(a))];case 1:return o.sent(),[2,{status:I.completed}]}var a}))}))}});!function(t){t.email="email"}(Ni||(Ni={})),function(t){t.Display="display",t.Video="video",t.MultiFormat="multi-format"}(Di||(Di={}));var Gi,Hi=/^[0-9a-fA-F]{64}$/,Wi=function(t){return Hi.test(t||"")},Ki=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:""}))},$i=function(t,n){return"string"==typeof t&&(n===Ni.email?/\S+@\S+\.\S+/.test(t)||Wi(t):t.trim().length>0)},Qi=function(t,n,e){return n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement?$i(n.value,e)?Ki(t.globalContext.crypto.subtle.digest("SHA-256",(new t.globalContext.TextEncoder).encode(n.value||""))):Promise.resolve(""):$i(n.innerText,e)?Ki(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"}(Gi||(Gi={}));var Yi=function(t,n,e){var i,r;void 0===n&&(n={}),function(t){var n,e=((n={})[Gi.LOCAL_STORAGE]=5,n[Gi.URL]=4,n[Gi.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=[],d=function(n){var i=n.method,r=n.target,a=n.type,d="";switch(i){case Gi.LOCAL_STORAGE:d=function(t,n,e){var i=t.readLocalStorage(n);return i&&$i(i,e)?i:""}(t,r,a);break;case Gi.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&&Wi(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 Gi.CSS_SELECTOR:o=n}if(d.length>0)return e({value:d,type:a}),{value:void 0}};try{for(var s=a(n.methods||[]),c=s.next();!c.done;c=s.next()){var l=d(c.value);if("object"==typeof l)return l.value}}catch(t){i={error:t}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}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,d=u?"submit":o.event;if("string"==typeof d&&0!==d.length){var s=function(o){return function(t){var n,e=t.account,i=t.e,r=t.eventTarget,o=t.event,u=t.isGlobalSubmit,d=t.target,s=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 Qi(t,u[0],e);var d=[];try{for(var s=a(u),c=s.next();!c.done;c=s.next()){var l=c.value;d.push(Qi(t,l,e))}}catch(t){r={error:t}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return Promise.all(d).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,d,s,n).then((function(t){"function"==typeof l&&e.globalContext.removeEventListener(o,l),c(!(t.length<1)&&{value:t,type:s})}))):c(!1)}({account:t,e:o,event:d,eventTarget:n,isGlobalSubmit:u,target:i,type:r,onDone:e,listener:s})};t.globalContext.addEventListener(d,s)}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 Xi(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(D);return(!(null===(r=t.globalContext.apstag)||void 0===r?void 0:r.isGDPRRegion)||void 0!==a)&&(void 0===a||t.isAllowedToAccessInfoOnDevice()?(null===(o=Yi(t,n,(function(n){if(!1===n)return e("no retrieval");Li({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 tr,nr=new it({scope:"ad",object:"record",action:"rr",validators:{detail:{detail:Q,"detail.config":Q,"detail.config.constructor":nt,"detail.config.$$typeof":nt,"detail.config.tagName":nt,"detail.config.@@__IMMUTABLE_ITERABLE__@@":nt,"detail.config.@@__IMMUTABLE_RECORD__@@":nt,"detail.config.accountID":X(K),"detail.config.overrideLimit":X($),"detail.config.methods":Y,"detail.config.methods[].tagName":nt,"detail.config.methods[]":(tr=Q,function(t,n){var i=tr(t,n);return e({modifiable:!0},i)}),"detail.config.methods[].$$typeof":nt,"detail.config.methods[].constructor":nt,"detail.config.methods[].@@__IMMUTABLE_ITERABLE__@@":nt,"detail.config.methods[].@@__IMMUTABLE_RECORD__@@":nt,"detail.config.methods[].type":Z(Object.values(Ni)),"detail.config.methods[].method":Z(Object.values(Gi)),"detail.config.methods[].target":X(K),"detail.config.methods[].event":X(K),"detail.config.methods[].eventTarget":X(K),"detail.config.methods[].isGlobalSubmit":X($),"detail.config.methods[].priority":X(W)},context:{context:Q,"context.Promise":tt,"context.crypto":Q,"context.crypto.subtle":tt}},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:I.waiting}];if(!n.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return[4,Xi(n,e.config)];case 1:return t=r.sent(),[2,{status:I.completed,analytics:{rr:t}}]}}))}))}}),er=new it({scope:"ad",object:"record",action:"update",validators:{detail:Fi,context:{context:Q}},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:I.waiting}];if(!n.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return t=n.globalContext.apstag.isGDPRRegion,i=n.use(D),e.config.optOut?(Ui(n),[3,3]):[3,1];case 1:return[4,Li({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:I.completed}]}}))}))}}),ir=rt([Bi,Ji,nr,er]),rr=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"),d=null===(r=n.get("amznsz"))||void 0===r?void 0:r.split("x"),s=n.get("amzniid"),c=t;if(!(void 0===s||void 0===c||void 0===d||d.length<2)){u.style.marginLeft="0",u.style.marginTop="0",u.style.height="".concat(d[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 p=null===(a=null==u?void 0:u.contentWindow)||void 0===a?void 0:a.document;void 0!==p&&(p.open(),p.write('