;
(self.AMP=self.AMP||[]).push({m:1,v:"2601162341000",n:"amp-consent",ev:"0.1",l:!0,f:function(t,n){(()=>{var n;function e(){return n||(n=Promise.resolve(void 0))}var i=class{constructor(){this.promise=new Promise(((t,n)=>{this.resolve=t,this.reject=n}))}},{isArray:s}=Array;function o(t,n){const e=t.length-n.length;return e>=0&&t.indexOf(n,e)==e}var r,{hasOwnProperty:h,toString:c}=Object.prototype;function a(t){return"[object Object]"===c.call(t)}function l(t){const n=Object.create(null);return t&&Object.assign(n,t),n}function u(t,n){return h.call(t,n)}function p(t,n,e=10){const i=[],s=[];for(s.push({t:t,s:n,d:0});s.length>0;){const{d:t,s:n,t:o}=s.shift();if(i.includes(n))throw new Error("Source object has a circular reference.");if(i.push(n),o!==n)if(t>e)Object.assign(o,n);else for(const e of Object.keys(n)){const i=n[e];if(u(o,e)){const n=o[e];if(a(i)&&a(n)){s.push({t:n,s:i,d:t+1});continue}}o[e]=i}}return t}function d(t,n,e,i,s,o,r,h,c,a,l){return t}function f(t,n){return t.replace(/^|,/g,`$&${n} `)}function m(t){d(/^[\w-]+$/.test(t))}var _=["Webkit","webkit","Moz","moz","ms","O","o"];function P(t){const n=t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()));return _.some((t=>n.startsWith(t+"-")))?`-${n}`:n}function g(t,n,e){if(n.startsWith("--"))return n;r||(r=l());let i=r[n];if(!i||e){if(i=n,void 0===t[n]){const e=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(n),s=function(t,n){for(let e=0;e<_.length;e++){const i=_[e]+n;if(void 0!==t[i])return i}return""}(t,e);void 0!==t[s]&&(i=s)}e||(r[n]=i)}return i}function v(t,n,e,i,s){const o=g(t.style,n,s);if(!o)return;const r=i?e+i:e;t.style.setProperty(P(o),r)}function A(t,n){for(const e in n)v(t,e,n[e])}function I(t,n){void 0===n&&(n=t.hasAttribute("hidden")),n?t.removeAttribute("hidden"):t.setAttribute("hidden","")}function b(t,n,e=5){if(!isFinite(e)||e<0)throw new Error("Invalid depth: "+e);if(t===n)return!0;const i=[{a:t,b:n,depth:e}];for(;i.length>0;){const{a:t,b:n,depth:e}=i.shift();if(e>0){if(typeof t!=typeof n)return!1;if(s(t)&&s(n)){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)i.push({a:t[s],b:n[s],depth:e-1});continue}if(t&&n&&"object"==typeof t&&"object"==typeof n){const s=Object.keys(t),o=Object.keys(n);if(s.length!==o.length)return!1;for(const o of s)i.push({a:t[o],b:n[o],depth:e-1});continue}}if(t!==n)return!1}return!0}function y(t){var n;null===(n=t.parentElement)||void 0===n||n.removeChild(t)}function R(t,n){t.insertBefore(n,t.firstChild)}function E(t){try{t.focus()}catch(t){}}var M=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function C(t,n=""){try{return decodeURIComponent(t)}catch(t){return n}}function T(t){const n=l();if(!t)return n;let e;for(;e=M.exec(t);){const t=C(e[1],e[1]),i=e[2]?C(e[2].replace(/\+/g," "),e[2]):"";n[t]=i}return n}function w(t){const{location:n}=t||self;return T(n.originalHash||n.hash)}var V="";function k(t){var n;return V||(V=(null===(n=t.AMP_CONFIG)||void 0===n?void 0:n.v)||"012601162341000"),V}function S(t,n){const e=n||w(t);return["1","actions","amp","amp4ads","amp4email"].includes(e.development)||!!t.AMP_DEV_MODE}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var O=self.__AMP_LOG;function x(t,n){throw new Error("failed to call initLogConstructor")}function U(t){return O.user||(O.user=j()),function(t,n){return n&&n.ownerDocument.defaultView!=t}(O.user.win,t)?O.userForEmbed||(O.userForEmbed=j()):O.user}function j(t){return x()}function D(){return O.dev||(O.dev=x())}function N(t,n,e,i,s,o,r,h,c,a,l){return t}function L(t,n,e,i,s,o,r,h,c,a,l){return U().assert(t,n,e,i,s,o,r,h,c,a,l)}function H(t,n){return W(t=function(t){return t.__AMP_TOP||(t.__AMP_TOP=t)}(t),n)}function F(t,n){return W(z(B(t)),n)}function q(t,n){const e=z(B(t));return Q(e,n)?W(e,n):null}function G(t,n){return function(t,n){const e=J(t,n);if(e)return e;const s=K(t);return s[n]=function(){const t=new i,{promise:n,reject:e,resolve:s}=t;return n.catch((()=>{})),{obj:null,promise:n,resolve:s,reject:e,context:null,ctor:null}}(),s[n].promise}(z(t),n)}function $(t,n){return J(z(t),n)}function B(t){return t.nodeType?(e=t,n=(e.ownerDocument||e).defaultView,H(n,"ampdoc")).getAmpDoc(t):t;var n,e}function z(t){const n=B(t);return n.isSingleDoc()?n.win:n}function W(t,n){N(Q(t,n));const e=K(t)[n];return e.obj||(N(e.ctor),N(e.context),e.obj=new e.ctor(e.context),N(e.obj),e.context=null,e.resolve&&e.resolve(e.obj)),e.obj}function J(t,n){const e=K(t)[n];return e?e.promise?e.promise:(W(t,n),e.promise=Promise.resolve(e.obj)):null}function K(t){let n=t.__AMP_SERVICES;return n||(n=t.__AMP_SERVICES={}),n}function Q(t,n){const e=t.__AMP_SERVICES&&t.__AMP_SERVICES[n];return!(!e||!e.ctor)}var Y=t=>F(t,"owners"),Z=t=>q(t,"url-replace"),X=t=>H(t,"xhr"),tt="notificationUIManager";function nt(t){return t.data}function et(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function it(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,i)}return e}function st(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?it(Object(e),!0).forEach((function(n){et(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):it(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}var ot={};function rt(t){const n=new Uint8Array(t.length);for(let e=0;e<t.length;e++){const i=t.charCodeAt(e);d(i<=255),n[e]=i}return n}function ht(t){const n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=String.fromCharCode(t[e]);return n.join("")}ot.appconsent={"consentInstanceId":"appconsent","checkConsentHref":"https://collector.appconsent.io/amp/check-consent","promptUISrc":"https://cdn.appconsent.io/loader.html"},ot.ConsentManager={"consentInstanceId":"ConsentManager","checkConsentHref":"https://delivery.consentmanager.net/delivery/ampcheck.php","promptUISrc":"https://delivery.consentmanager.net/delivery/ampui.php"},ot.didomi={"consentInstanceId":"didomi","checkConsentHref":"https://api.privacy-center.org/amp/check-consent","promptUISrc":"https://sdk-amp.privacy-center.org/loader.html"},ot.iubenda={"consentInstanceId":"iubenda","checkConsentHref":"https://amp.iubenda.com/checkConsent","promptUISrc":"https://www.iubenda.com/en/help/22135-cookie-solution-amp"},ot.sirdata={"consentInstanceId":"sirdata","checkConsentHref":"https://choices.consentframework.com/api/v1/public/amp/check","promptUISrc":"https://ui.consentframework.com/amp/loader.html"},ot.Marfeel={"consentInstanceId":"Marfeel","checkConsentHref":"https://live.mrf.io/cmp/marfeel/amp/check-consent","promptUISrc":"https://live.mrf.io/cmp/marfeel/amp/index.html"},ot.Ogury={"consentInstanceId":"Ogury","checkConsentHref":"https://api.ogury.mgr.consensu.org/v1/check-for-consent","promptUISrc":"https://www.ogury.mgr.consensu.org/amp.html"},ot.onetrust={"consentInstanceId":"onetrust","checkConsentHref":"https://cdn.cookielaw.org/amp/consent/check","promptUISrc":" https://amp.onetrust.mgr.consensu.org/"},ot.opencmp={"consentInstanceId":"opencmp","checkConsentHref":"https://amp.opencmp.net/consent/check","promptUISrc":"https://cdn.opencmp.net/tcf-v2/amp/cmp.html"},ot.pubtech={"consentInstanceId":"pubtech","checkConsentHref":"https://amp.pubtech.it/cmp-amp-check-consent","promptUISrc":"https://cdn.pubtech.ai/amp/index.html"},ot.quantcast={"consentInstanceId":"quantcast","checkConsentHref":"https://apis.quantcast.mgr.consensu.org/amp/check-consent","promptUISrc":"https://quantcast.mgr.consensu.org/tcfv2/amp.html"},ot.SourcePoint={"consentInstanceId":"SourcePoint","checkConsentHref":"https://sourcepoint.mgr.consensu.org/consent/v2/amp","promptUISrc":"https://amp.pm.sourcepoint.mgr.consensu.org/"},ot.UniConsent={"consentInstanceId":"UniConsent","checkConsentHref":"https://edge.uniconsent.com/amp/check-consent","promptUISrc":"https://cmp.uniconsent.com/amp/index.html"},ot.Usercentrics={"consentInstanceId":"Usercentrics","checkConsentHref":"https://consents.usercentrics.eu/amp/checkConsent","promptUISrc":"https://amp.usercentrics.eu/amp.html"},ot.LiveRamp={"consentInstanceId":"LiveRamp","checkConsentHref":"https://api.privacymanager.io/amp/check-consent","promptUISrc":"https://amp-consent-tool.privacymanager.io/1/index.html"},ot.googlefc={"consentInstanceId":"googlefc","checkConsentHref":"https://fundingchoicesmessages.google.com/amp/consent/check?pvid=PAGE_VIEW_ID_64&anonid=CONSENT_PAGE_VIEW_ID_64&href=SOURCE_URL","promptUISrc":"https://fundingchoicesmessages.google.com/amp/consent/message?pvid=PAGE_VIEW_ID_64&anonid=CONSENT_PAGE_VIEW_ID_64&href=SOURCE_URL&clientConfig=CONSENT_INFO(clientConfig)","xssiPrefix":")]}'","uiConfig":{"overlay":!0},"clearDirtyBitOnResponse_dontUseThisItMightBeRemoved":!0};var ct,at={"-":"+","_":"/",".":"="},lt={"+":"-","/":"_","=":"."},ut=(()=>self.AMP.config.urls)(),pt=new Set(["c","v","a","ad"]),dt=t=>"string"==typeof t?ft(t):t;function ft(t,n){return ct||(ct=self.document.createElement("a")),function(t,n,e){return t.href="",new URL(n,t.href)}(ct,t)}function mt(t,n,e="source"){var i;return L(null!=t,"%s %s must be available",n,e),L("https:"==(i=dt(i=t)).protocol||"localhost"==i.hostname||"127.0.0.1"==i.hostname||o(i.hostname,".localhost")||/^\/\//.test(t),'%s %s must start with "https://" or "//" or be relative and served from either https or from localhost. Invalid value: %s',n,e,t),t}function _t(t){return ut.cdnProxyRegex.test(dt(t).origin)}function Pt(t){if(!_t(t=dt(t)))return t.href;const n=t.pathname.split("/"),e=n[1];L(pt.has(e),"Unknown path prefix in url %s",t.href);const i=n[2],s="s"==i?"https://"+decodeURIComponent(n[3]):"http://"+decodeURIComponent(i);return L(s.indexOf(".")>0,"Expected a . in origin %s",s),n.splice(1,"s"==i?3:2),s+n.join("/")+function(t,n){if(!t||"?"==t)return"";const e=new RegExp("[?&](amp_(js[^&=]*|gsa|r|kit)|usqp)\\b[^&]*","g"),i=t.replace(e,"").replace(/^[?&]/,"");return i?"?"+i:""}(t.search)+(t.hash||"")}var gt=class{static getTop(t){return t.top}static getLocation(t){return t.location}static getDocumentReferrer(t){return t.document.referrer}static getHostname(t){return t.location.hostname}static getUserAgent(t){return t.navigator.userAgent}static getUserLanguage(t){return t.navigator.userLanguage||t.navigator.language}static getDevicePixelRatio(){return self.devicePixelRatio||1}static getSendBeacon(t){if(t.navigator.sendBeacon)return t.navigator.sendBeacon.bind(t.navigator)}static getXMLHttpRequest(t){return t.XMLHttpRequest}static getImage(t){return t.Image}},vt=(()=>self.AMP.config.urls)(),At="-test-amp-cookie-tmp";function It(t,n){const e=function(t){try{return t.document.cookie}catch(t){return""}}(t);if(!e)return null;const i=e.split(";");for(let t=0;t<i.length;t++){const e=i[t].trim(),s=e.indexOf("=");if(-1!=s&&C(e.substring(0,s).trim())==n){const t=e.substring(s+1).trim();return C(t,t)}}return null}function bt(t,n,e,i,s,o,r){"ampproject.org"==s&&(e="delete",i=0);const h=encodeURIComponent(n)+"="+encodeURIComponent(e)+"; path=/"+(s?"; domain="+s:"")+"; expires="+new Date(i).toUTCString()+function(t,n){return n?`; SameSite=${n}`:""}(0,o)+(r?"; Secure":"");try{t.document.cookie=h}catch(t){}}var yt=31536e6;var Rt="removeEventListener";function Et(t){return!!t&&!(!u(t,"isDirty")||1!=t.isDirty)}function Mt(t){return 1==t||2!=t&&null}function Ct(t,n,e){if(!t&&!n)return!0;if(t&&n){const i=Mt(t.consentState)===Mt(n.consentState),s=(t.consentString||"")===(n.consentString||"");let o;o=e?!!t.isDirty==!!e:!!t.isDirty==!!n.isDirty;const r=b(t.consentMetadata,n.consentMetadata),h=b(t.purposeConsents,n.purposeConsents),c=t.tcfPolicyVersion==n.tcfPolicyVersion;return i&&s&&r&&h&&o&&c}return!1}function Tt(t,n,e,i,s,o){return{"consentState":t,"consentString":n,"consentMetadata":e,"purposeConsents":i,"isDirty":s,"tcfPolicyVersion":o}}function wt(t,n,e,i,s){return{"consentStringType":t,"additionalConsent":n,"gdprApplies":e,"purposeOne":i,"gppSectionId":s}}function Vt(t){return!0===t||1===t?1:!1===t||0===t?2:5}function kt(t){return!!t.consentString||1===t.consentState||2===t.consentState}function St(t){return 1===t?"accepted":2===t?"rejected":"unknown"}var Ot="CONSENT-STATE-MANAGER";function xt(t){return G(t,"consentStateManager")}var Ut="amp-consent/consent-config",jt="amp-story-consent",Dt={"promptUI":!0,"checkConsentHref":!0,"promptIfUnknownForGeoGroup":!0,"onUpdateHref":!0},Nt={"CANONICAL_URL":!0,"PAGE_VIEW_ID":!0,"PAGE_VIEW_ID_64":!0,"SOURCE_URL":!0};function Lt(t,n,e){const i=st({"CLIENT_ID":Ht(t),"CONSENT_PAGE_VIEW_ID_64":()=>xt(t).then((t=>t.consentPageViewId64()))},e);return Z(t).expandUrlAsync(n,i,st(st({},i),Nt))}function Ht(t){return(n=t,G(n,"cid")).then((t=>t.get({scope:"AMP-CONSENT",createCookieIfNotPresent:!0},e())));var n}var Ft,qt="consent-policy-manager",Gt={"default":!0,"_till_responded":!0,"_till_accepted":!0,"_auto_reject":!0};function $t(t){const n=t.tagName;return n.startsWith("AMP-")&&!("AMP-STICKY-AD-TOP-PADDING"==n||"AMP-BODY"==n)}function Bt(t){return function(t,n){if(d(1===n.length),d(Array.isArray(n)||u(n,"raw")),self.trustedTypes&&self.trustedTypes.createPolicy){const e=self.trustedTypes.createPolicy("static-template#createNode",{createHTML:function(t){return n[0]}});t.innerHTML=e.createHTML("ignored")}else t.innerHTML=n[0];const e=t.firstElementChild;return d(e),d(!e.nextElementSibling),t.removeChild(e),e}(Ft,t)}var zt=['<svg viewBox="0 0 40 40"><defs><linearGradient id=grad><stop stop-color="rgb(105, 105, 105)"></stop><stop offset=100% stop-color="rgb(105, 105, 105)" stop-opacity=0></stop></linearGradient></defs><path d="M11,4.4 A18,18, 0,1,0, 38,20" stroke=url(#grad)></path></svg>'],Wt="amp-consent-ui",Jt=["allow-popups-to-escape-sandbox","allow-top-navigation-by-user-activation"],Kt=["geolocation","payment"],Qt="i-amphtml-consent-ui-iframe-fullscreen",Yt="i-amphtml-consent-ui-iframe-active",Zt="i-amphtml-consent-ui-modal",Xt="i-amphtml-consent-ui-in",tn="i-amphtml-consent-ui-loading",nn="i-amphtml-consent-ui-border-enabled",en=class{constructor(t,n,e){this.UB=t,this.Fnt=!1,this.Qnt=!1,this._s=!1,this.Xnt=!1,this.cb=!1,this.pet=null,this.fet=n.uiConfig&&!0===n.uiConfig.overlay,this.met=n.captions&&n.captions.consentPromptCaption||"User Consent Prompt",this._et=n.captions&&n.captions.buttonActionCaption||"Focus Prompt",this.Pet=!1,this.vet=!0,this.RH=null,this.Aet=null,this.Iet=null,this.zi=t.getAmpDoc(),this.Il=F(this.zi,"viewport"),this.yn=(t=>F(this.zi,"viewer"))(),this.ei=t.element,this.i=t.win,this.Bo=this.i.document,this.bet=null,this.yb=!1,this.yet=null,this.Lg=null,this.Ret="30vh",this.Eet=!0,this.Met=!1,this.Cet=!1,this.Tet=this.wet.bind(this),this.sA=n,this.sl(n,e)}sl(t,n){if(n){const t=this.zi.getElementById(n);return t||U().error(Wt,"postPromptUI element with id=%s not found",n),this.pet=t,void(this.Qnt=!0)}const e=t.promptUI,i=t.promptUISrc;if(e){const t=this.zi.getElementById(e);t&&this.ei.contains(t)||U().error(Wt,"child element of <amp-consent> with promptUI id %s not found",e),this.pet=t}else i&&(this.Fnt=!0,mt(i,this.ei),this.pet=this.Vet(i),this.Lg=this.ket(),this.yet=t.clientConfig||null)}show(t){if(!this.pet)return;if(this.Qnt&&!this.ei.contains(this.pet))return void I(this.pet,!0);I(this.ei,!0);const{classList:n}=this.ei;if(n.add("amp-active"),n.remove("amp-hidden"),this.UB.getViewport().addToFixedLayer(this.ei,!0),this.Fnt)this.Cet=t,this.Oet().then((()=>{this.UB.mutateElement((()=>{this.Qnt||(this.Iet=this.Bo.activeElement),this.xet(),this.Uet(),this.jet()}))}));else{const t=()=>{this.pet&&(I(this.pet,!0),this.Qnt||(this.Iet=this.Bo.activeElement,this.xet(),this.resume(),this.pet.focus()))};$t(this.pet)?function(t){if(d($t(t)),t.createdCallback)return Promise.resolve(t);if(!t.__AMP_UPG_PRM){const n=new i;t.__AMP_UPG_PRM=n.promise,t.__AMP_UPG_RES=n.resolve}const n=t.__AMP_UPG_PRM;return d(n),n}(this.pet).then((()=>this.pet.build())).then((()=>t())):t()}this._s=!0}hide(){this.pet&&(this.pause(),this.UB.mutateElement((()=>{if(this.Fnt&&this.Det(),!this.Qnt){const{classList:t}=this.ei;t.remove("amp-active"),t.add("amp-hidden")}this.Net(),this.Let(),this.Het(),this.Fet(),this.UB.getViewport().removeFromFixedLayer(this.ei),I(this.pet,!1),this._s=!1,this.Iet?(this.Iet.focus(),this.Iet=null):this.i.document.body.children.length>0&&this.i.document.body.children[0].focus()})))}pause(){this.pet&&Y(this.UB.element).schedulePause(this.UB.element,this.pet)}resume(){this.pet&&(Y(this.UB.element).scheduleLayout(this.UB.element,this.pet),Y(this.UB.element).scheduleResume(this.UB.element,this.pet))}qet(t){if(this.Ret="30vh",this.Eet=!0,this.Met=!1,t.initialHeight)if("string"==typeof t.initialHeight&&t.initialHeight.indexOf("vh")>=0){const n=parseInt(t.initialHeight,10);this.Ret=n>=80?"80vh":this.Ret,n>=10&&n<=80?(this.Ret=`${n}vh`,this.Met=n>60,this.fet=this.Met||this.fet):U().error(Wt,`Inavlid initial height: ${t.initialHeight}.Minimum: 10vh. Maximum: 80vh.`)}else U().error(Wt,`Inavlid initial height: ${t.initialHeight}.Must be a string in "vh" units.`);!1!==t.border||this.Met||(this.Eet=!1),this.bet.resolve()}Get(){if(!this.pet||!this._s||this.cb)return;this.Fet(),this.$et("requestFullOverlay");const{classList:t}=this.ei;t.add(Qt),this.sZ(),this.cb=!0}$et(t){this.yn.sendMessage(t,{},!0)}Vet(t){const n=this.ei.ownerDocument.createElement("iframe"),e=this.Bet(t);n.setAttribute("title",this.ei.title||"Consent Banner"),n.setAttribute("sandbox",e),n.setAttribute("allow",Kt.join("; "));const{classList:i}=n;return i.add("i-amphtml-consent-ui-fill"),n}Bet(t){const n=["allow-scripts","allow-popups"];this.zet(t)&&n.push("allow-same-origin");const e=this.Wet();return Array.prototype.push.apply(n,e),n.join(" ")}zet(t){const n=q(this.ei,"url"),e=n.parse(t),i=n.parse(this.zi.getUrl());return e.origin!=i.origin}Wet(){return(this.sA.sandbox||"").split(" ").filter(Boolean).filter((t=>{const n=-1!==Jt.indexOf(t);return n||U().error(Wt,`The sandbox attribute "${t}" is not allowed`),n}))}ket(){const t=this.ei.ownerDocument.createElement("placeholder");I(t,!1),t.classList.add("i-amphtml-consent-ui-placeholder");const n=function(t){const n=t.ownerDocument||t;return Ft&&Ft.ownerDocument===n||(Ft=n.createElement("div")),Bt}(t)(zt);return t.appendChild(n),t}Jet(){return xt(this.zi).then((t=>t.getLastConsentInstanceInfo().then((t=>({"clientConfig":this.yet,"consentState":St(t.consentState),"consentStateValue":St(t.consentState),"tcfPolicyVersion":t.tcfPolicyVersion,"consentMetadata":t.consentMetadata,"consentString":t.consentString,"promptTrigger":this.Cet?"action":"load","isDirty":!!t.isDirty,"purposeConsents":t.purposeConsents})))))}Oet(){this.bet=new i;const{classList:t}=this.ei;var n;n=this.ei,m("placeholder"),n.querySelector("placeholder")||R(this.ei,this.Lg),t.add(tn),I(this.pet,!1),this.yb=!1;const e=this.Jet().then((t=>Lt(this.ei,this.sA.promptUISrc,{"CONSENT_INFO":n=>JSON.stringify(t[n])}).then((n=>{this.pet.src=n,this.pet.setAttribute("name",JSON.stringify(t)),this.i.addEventListener("message",this.Tet),R(this.ei,this.pet)}))));return Promise.all([e,this.bet.promise,this.UB.mutateElement((()=>{I(this.Lg,!0)}))])}jet(){const{classList:t}=this.ei;t.add(Yt),I(this.Lg,!1),I(this.pet,!0),this.Met&&(t.add(Zt),E(this.pet)),this.Fet(),this.UB.mutateElement((()=>{t.remove(tn),this.UB.mutateElement((()=>{t.add(Xt),this.Xnt=!0,this.Ket()}))}))}Det(){const{classList:t}=this.ei;t.remove(Yt),t.remove(Zt),t.remove(nn),this.i.removeEventListener("message",this.Tet),t.remove(Qt),this.cb?this.$et("cancelFullOverlay"):this.Met&&this.Il.leaveLightboxMode(),this.cb=!1,t.remove(Xt),this.Xnt=!1,this.pet.removeAttribute("name"),I(this.Lg,!1),this.yb=!0,this.i.setTimeout((()=>{this.yb&&y(this.pet)}),1e3)}Uet(){if(this.Pet||this.Met)return;const t=this.Bo.createElement("div"),n=this.Bo.createElement("button"),e=this.Bo.createElement("div");t.setAttribute("role","alertdialog"),e.textContent=this.met,n.textContent=this._et,n.onclick=()=>{E(this.pet)},t.appendChild(e),t.appendChild(n);const{classList:i}=t;i.add("i-amphtml-consent-alertdialog"),this.UB.element.appendChild(t),E(n),this.Pet=!0,this.Aet=t}Let(){this.Aet&&(y(this.Aet),delete this.Aet)}Fet(){A(this.ei,{transform:"",transition:""})}Ket(){const{classList:t}=this.ei;this.pet&&A(this.pet,{height:this.Ret}),function(t,n){const{style:e}=t;for(const t in n)e.setProperty(P(g(e,t)),String(n[t]),"important")}(this.ei,{"--i-amphtml-modal-height":`${this.Ret}`}),t.add("i-amphtml-consent-ui-iframe-transform"),(this.Eet||this.Met)&&t.add(nn),this.Met&&this.Il.enterLightboxMode()}xet(){if(this.fet){if(!this.RH){const t=this.i.document.createElement("div");t.classList.add("i-amphtml-consent-ui-mask"),this.ei.ownerDocument.body.appendChild(t),this.RH=t}I(this.RH,!0),this.sZ()}}Net(){this.fet&&(this.RH&&I(this.RH,!1),this.Het())}sZ(){this.vet&&(this.Il.enterOverlayMode(),this.vet=!1)}Het(){this.vet||(this.Il.leaveOverlayMode(),this.vet=!0)}wet(t){if(this.pet.contentWindow!==t.source)return;const n=nt(t);if(!n||"consent-ui"!=n.type)return;const e=n.action,i=n.type;if("ready"===e&&this.qet(n),"enter-fullscreen"===e){if(!this.Xnt||this.Met||this.Bo.activeElement!==this.pet&&!this.Cet)return void this.Qet(i,e,!0);this.Qet(i,e),this.UB.mutateElement((()=>{this.Get()}))}}Qet(t,n,e=!1){this.Yet("amp-consent-response",t,n,e?"error":"success",e?"Could not enter fullscreen. Fullscreen is only supported when the iframe is visible as a bottom sheet and after user interaction.":"Entering fullscreen.")}Yet(t,n,e,i,s){const o=this.pet.contentWindow;o&&o.postMessage({type:t,requestType:n,requestAction:e,state:i,info:s},"*")}},sn=null,on="*",rn=/^[a-zA-Z0-9\-_.]+$/,hn="amp-analytics/linker";function cn(t,n){const e=n||0;return function(t){sn||(sn=function(){const t=new Array(256);for(let n=0;n<256;n++){let e=n;for(let t=0;t<8;t++)1&e?e=e>>>1^3988292384:e>>>=1;t[n]=e}return t}());const n=(e=t,"undefined"!=typeof TextEncoder?(new TextEncoder).encode(e):rt(unescape(encodeURIComponent(e))));var e;let i=-1>>>0;for(let t=0;t<n.length;t++){const e=255&(i^n[t]);i=i>>>8^sn[e]}return(-1^i)>>>0}([function(){const t=(new Date).getTimezoneOffset(),n=gt.getUserLanguage(window);return[gt.getUserAgent(window),t,n].join(on)}(),Math.floor(Date.now()/6e4)-e,t].join(on)).toString(36)}function an(t){return function(t){const n=function(t){return rt(atob(t.replace(/[-_.]/g,(t=>at[t]))))}(t);return function(t){if("undefined"!=typeof TextDecoder)return new TextDecoder("utf-8").decode(t);const n=ht(new Uint8Array(t.buffer||t));return decodeURIComponent(escape(n))}(n)}(String(t))}var ln="amp-consent/cookie-writer",un={"referrerDomains":!0,"enabled":!0,"cookiePath":!0,"cookieMaxAge":!0,"cookieSecure":!0,"cookieDomain":!0},pn={"LINKER_PARAM":!0},dn="amp-consent",fn="loaded",mn=t=>"accept"===t||"reject"===t||"dismiss"===t,_n="consentStateManager",Pn="consentPolicyManager",gn="amp-consent",vn="accept",An="reject",In="dismiss",bn=class extends t.BaseElement{constructor(t){super(t),this.Zet=null,this.Xet=null,this.tst=null,this.nst=null,this.est=null,this.rV=null,this.ist=null,this.sst=null,this.ost=null,this.rst=!1,this.hst=!1,this.ast=!1,this.Xr=this.getVsync(),this.lst=null,this.ust=null,this.pst=null,this.dst=null}getConsentPolicy(){return null}buildCallback(){L(this.element.getAttribute("id"),"amp-consent should have an id");const t=new class{constructor(t){this.yf=t,this.pst=null,this.Lb=null}getConsentConfigPromise(){return this.Lb||(this.Lb=this.fst()),this.Lb}getMatchedGeoGroup(){return this.pst}mst(t){const n=t.consents;if(!t.consents)return t;const e=Object.keys(n);if(L(e.length<=1,"%s: only single consent instance is supported",Ut),e.length>0){t.consentInstanceId=e[0];const n=t.consents[e[0]],i=Object.keys(n);for(let e=0;e<i.length;e++){const s=i[e];!t[s]&&Dt[s]&&(t[i[e]]=n[i[e]])}}return delete t.consents,t}fst(){const t=this.mst(L(this.jnt(),"%s: Inline config not found")),n=p(this._st()||{},t||{},1);if(L(n.consentInstanceId,"%s: consentInstanceId to store consent info is required",Ut),n.policy){const t=Object.keys(n.policy);for(let e=0;e<t.length;e++)"default"!=t[e]&&delete n.policy[t[e]]}const e=n.promptIfUnknownForGeoGroup;return"string"==typeof e?(n.consentRequired=!1,n.geoOverride={[e]:{"consentRequired":!0}}):void 0===n.consentRequired&&n.checkConsentHref&&(n.consentRequired="remote"),this.Pst(n).then((t=>this.gst(t))).then((t=>this.vst(t)))}Pst(t){return t.geoOverride?(n=this.yf,function(t,n,e,i){const s=$(t,n);if(s)return s;const o=B(t);return o.whenExtensionsKnown().then((()=>{const t=o.getExtensionVersion(e);return t?H(o.win,"extensions").waitForExtension(e,t):null})).then((e=>e?$(t,n):null))}(n,"geo","amp-geo")).then((n=>{L(n,"%s: requires <amp-geo> to use `geoOverride`",Ut);const e=l(t),i=Object.keys(t.geoOverride);for(let s=0;s<i.length;s++)if(2===n.isInCountryGroup(i[s])){const n=t.geoOverride[i[s]];u(n,"consentInstanceId")&&(U().error(Ut,"consentInstanceId cannot be overriden in geoGroup:",i[s]),delete n.consentInstanceId),p(e,n,1),this.pst=i[s];break}return delete e.geoOverride,e})):Promise.resolve(t);var n}gst(t){const n=t.consentRequired;return L("boolean"==typeof n||"remote"===n,"`consentRequired` is required",Ut),"remote"===n&&L(t.checkConsentHref,"%s: `checkConsentHref` must be specified if `consentRequired` is remote",Ut),t}vst(t){return n=this.yf,m(jt),"> amp-story-consent",n.querySelector(f("> amp-story-consent",":scope"))&&L(!t.promptUISrc,"%s: `promptUiSrc` cannot be specified while using %s.",Ut,jt),t;var n}jnt(){try{return function(t){const n=(i=t,m("script"),i.querySelectorAll(f("> script",":scope"))),{length:e}=n;var i;if(1!==e)throw new Error(`Found ${e} <script> children. Expected 1.`);const s=n[0];if(!function(t){var n;return"SCRIPT"==t.tagName&&"APPLICATION/JSON"==(null===(n=t.getAttribute("type"))||void 0===n?void 0:n.toUpperCase())}(s))throw new Error('<script> child must have type="application/json"');try{var o;return r=null!==(o=s.textContent)&&void 0!==o?o:"",JSON.parse(r)}catch(t){throw new Error("Failed to parse <script> contents. Is it valid JSON?")}var r}(this.yf)}catch(t){throw U(this.yf).createError(Ut,t)}}_st(){const t=this.yf.getAttribute("type");if(!t)return null;L(ot[t],"%s: invalid CMP type %s",Ut,t);const n=ot[t];return this.Ast(n),n}Ast(t){const n=["consentInstanceId","checkConsentHref","promptUISrc"];for(let e=0;e<n.length;e++)N(t[n[e]])}}(this.element);return t.getConsentConfigPromise().then((n=>{this.pst=t.getMatchedGeoGroup(),this.Ze(n)}))}pauseCallback(){this.est&&this.est.pause()}resumeCallback(){this.est&&this.est.resume()}Ze(t){this.rV=t,this.ust=this.rV.consentInstanceId,this.rV.postPromptUI&&(this.sst=new en(this,{},this.rV.postPromptUI));const n=this.rV.policy||{};this.ist=function(t,n){const e={};e[n]=void 0;const i={"waitFor":e},s=[4,1,2,3],o={"waitFor":e,"unblockOn":s},r={"waitFor":e,"timeout":{"seconds":0,"fallbackAction":"reject"},"unblockOn":s};return t._till_responded=o,t._till_accepted=i,t._auto_reject=r,t&&t.default||(t.default=i),t}(n,this.ust);const i=function(t,n){const e=[];for(let n=t.firstElementChild;n;n=n.nextElementSibling)!(function(t){let n;var e;return"string"==typeof t?n=t:1==(null==(e=t)?void 0:e.nodeType)&&(n=t.tagName),!!n&&n.toLowerCase().startsWith("i-")}(i=n)||i.nodeType===Node.ELEMENT_NODE&&(i.hasAttribute("placeholder")||i.hasAttribute("fallback")||i.hasAttribute("overflow")))&&e.push(n);var i;return e}(this.element);for(let t=0;t<i.length;t++){const n=i[t];I(n,!1),Y(this.element).setOwner(n,this.element)}const s=G(this.getAmpDoc(),Pn).then((t=>{this.Xet=t,this.Xet.setLegacyConsentInstanceId(this.ust);const n=Object.keys(this.ist);for(let t=0;t<n.length;t++)this.Xet.registerConsentPolicyInstance(n[t],this.ist[n[t]])})),r=G(this.getAmpDoc(),_n).then((t=>{t.registerConsentInstance(this.ust,this.rV),this.Zet=t})),h=G(this.getAmpDoc(),tt).then((t=>{this.nst=t})),c=this.rV.cookies?new class{constructor(t,n,e){this.i=t,this.yf=n,this.Ist=null,this.sA=e,this.bst=new class{constructor(t){this.i=t,this.yst={}}get(t,n){return t&&n?(u(this.yst,t)||(this.yst[t]=this.Rst(t)),this.yst[t]&&this.yst[t][n]?this.yst[t][n]:null):(U().error("amp-consent/linker-reader","LINKER_PARAM requires two params, name and id"),null)}Rst(t){const n=T(this.i.location.search);return u(n,t)?function(t){const n=function(t){const n=t.split(on),e=n.length%2==0;if(n.length<4||!e)return U().error(hn,`Invalid linker_param value ${t}`),null;const i=Number(n.shift());return 1!==i?(U().error(hn,`Invalid version number ${i}`),null):{checksum:n.shift(),serializedIds:n.join(on)}}(t);if(!n)return null;const{checksum:e,serializedIds:i}=n;return function(t,n){for(let e=0;e<=1;e++)if(cn(t,e)==n)return!0;return!1}(i,e)?function(t){const n={},e=t.split(on);for(let t=0;t<e.length;t+=2){const i=e[t];if(!rn.test(i)){U().error(hn,`Invalid linker key ${i}, value ignored`);continue}const s=an(e[t+1]);n[i]=s}return n}(i):(U().error(hn,"LINKER_PARAM value checksum not valid"),null)}(n[t]):null}}(t)}write(){return this.Ist||(this.Ist=this.sl()),this.Ist}sl(){if(!this.Est(this.i,this.yf))return e();if(!u(this.sA,"cookies"))return e();if(!a(this.sA.cookies))return U().error(ln,"cookies config must be an object"),e();const t=this.sA.cookies;if(!1===t.enabled)return e();const n=this.Mst(t),i=Object.keys(t),s=[];for(let e=0;e<i.length;e++){const o=i[e],r=t[o];this.Cst(o,r)&&s.push(this.Tst(o,r.value,n))}return Promise.all(s)}Mst(t){if(!u(t,"cookieMaxAge"))return yt;const n=Number(t.cookieMaxAge);return n||0===n?1e3*n:(U().error(ln,"invalid cookieMaxAge %s, falling back to default value (1 year)",t.cookieMaxAge),yt)}Cst(t,n){return!(un[t]||(a(n)?!u(n,"value")&&(U().error(ln,"value is required in the cookieValue object"),1):(U().error(ln,"cookieValue must be configured in an object"),1)))}Tst(t,n,e){return Z(this.yf).expandStringAsync(n,{"LINKER_PARAM":(t,n)=>this.bst.get(t,n)},pn).then((n=>{if(n){const i=Date.now()+e;!function(t,n,e,i,s={}){let r;!function(t,n,e){if(n.allowOnProxyOrigin)return void L(!n.highestAvailableDomain,"Could not support highestAvailable Domain on proxy origin, specify domain explicitly");L(!_t(t.location.href),`Should never attempt to set cookie on proxy origin: ${e}`);const i=ft(t.location.href).hostname.toLowerCase(),s=ft(vt.cdn).hostname.toLowerCase();L(!(i==s||o(i,"."+s)),"Should never attempt to set cookie on proxy origin. (in depth check): "+e)}(t,s,n),s.domain?r=s.domain:s.highestAvailableDomain&&(r=function(t){const n=t.document.head&&t.document.head.querySelector("meta[name='amp-cookie-scope']");if(n){const e=n.getAttribute("content")||"",i=ft(Pt(t.location.href)).origin;return o(i,"."+e)?e:i.split("://")[1]}if(!_t(t.location.href)){const n=t.location.hostname.split(".");let e=n[n.length-1];const i=function(t){let n=At,e=0;for(;It(t,n);)n=At+e++;return n}(t);for(let s=n.length-2;s>=0;s--)if(e=n[s]+"."+e,bt(t,i,"delete",Date.now()+1e3,e),"delete"==It(t,i))return bt(t,i,"delete",Date.now()-1e3,e),e}return null}(t)),bt(t,n,e,i,r,s.sameSite,s.secure)}(this.i,t,n,i,{highestAvailableDomain:!0})}})).catch((t=>{U().error(ln,"Error expanding cookie string",t)}))}Est(){return!((t=this.yf).classList.contains("i-amphtml-fie")||function(t,n){return t.closest(".i-amphtml-fie")}(t)||_t(this.i.location)||"inabox"==function(t){const n=t||self;return n.__AMP_MODE?n.__AMP_MODE:n.__AMP_MODE=function(t){return{localDev:!1,development:S(t,w(t)),esm:!0,test:!1,rtvVersion:k(t),ssrReady:!1}}(n)}(this.i).runtime);var t}}(this.win,this.element,this.rV).write():e();Promise.all([r,h,s,c]).then((()=>{this.sl()}))}wst(){this.registerAction("accept",(t=>{this.Vst(vn,t)})),this.registerAction("reject",(t=>{this.Vst(An,t)})),this.registerAction("dismiss",(()=>{this.Vst(In)})),this.registerAction("setPurpose",(t=>{this.kst(t)})),this.registerAction("prompt",(t=>this.Sst(t))),this.Ost()}Vst(t,n){this.xst()&&this.Ust(t,n).then((()=>{this.mH(t)}))}Ost(){this.win.addEventListener("message",(t=>{if(!this.rst)return;let n,e,i;const s=nt(t);if(!s||"consent-response"!=s.type)return;if(!s.action)return void U().error(gn,"consent-response message missing required info");void 0!==s.info&&("string"!=typeof s.info&&(U().error(gn,"consent-response info only supports string, %s, treated as undefined",s.info),s.info=void 0),s.action===In&&(s.info&&this.user().error(gn,"Consent string value %s not applicable on user dismiss, stored value will be kept and used",s.info),s.info=void 0),n=s.info,e=this.jst(s.tcfPolicyVersion),i=this.Dst(s.consentMetadata));const o=this.element.querySelectorAll("iframe");for(let r=0;r<o.length;r++)if(o[r].contentWindow===t.source){const{action:t,purposeConsents:o}=s;if(!mn(t)||!this.xst())continue;o&&Object.keys(o).length&&t!==In&&(this.Nst(o),this.Zet.updateConsentInstancePurposes(o)),this.mH(t,n,i,e)}}))}Lst(t){this.nst||D().error(gn,"notification ui manager not found"),this.ast||this.est&&(this.ast=!0,this.nst.registerUI(this.bY.bind(this,t)))}bY(t){this.rst&&D().error(gn,"Attempt to show an already displayed prompt UI"),this.Xr.mutate((()=>{this.est.show(t),this.rst=!0}));const n=new i;return this.ost=n.resolve,n.promise}M5(){this.rst||D().error(gn,"%s no consent ui to hide"),this.est.hide(),this.rst=!1,this.ost&&(this.ost(),this.ost=null),this.ast=!1}xst(){return this.Zet?this.rst:(D().error(gn,"No consent state manager"),!1)}mH(t,n,i,s){(mn(t)&&this.rV.clearDirtyBitOnResponse_dontUseThisItMightBeRemoved?this.Zet.setDirtyBit(!1):e()).then((()=>{this.Hst(t,n,i,s)}))}Hst(t,n,e,i){this.hst=!0,t==vn?this.Zet.updateConsentInstanceState(1,n,e,i):t==An?this.Zet.updateConsentInstanceState(2,n,e,i):t==In&&this.Zet.updateConsentInstanceState(3),this.M5()}Ust(t,n){var i;return"boolean"!=typeof(null==n||null===(i=n.args)||void 0===i?void 0:i.purposeConsentDefault)?e():t===In?(D.warn(gn,"Dismiss cannot have a `purposeConsentDefault` parameter."),e()):this.Fst().then((t=>{if(!t||!t.length)return;const e={},i=n.args.purposeConsentDefault;t.forEach((t=>{e[t]=i})),this.Zet.updateConsentInstancePurposes(e,!0)}))}Sst(t){const{args:n}=t;(!0===(null==n?void 0:n.expireCache)?this.Zet.setDirtyBit():e()).then((()=>{this.Lst(!0)}))}kst(t){if(!t||!t.args||!Object.keys(t.args).length)return void D().error(gn,"Must have arugments for `setPurpose`.");const{args:n}=t;this.xst()&&(this.Nst(n),this.Zet.updateConsentInstancePurposes(n))}sl(){this.qst(),this.Gst(),this.$st(),this.Bst().then((t=>this.zst(t))).then((t=>{t&&this.Wst(),this.Xet.enableTimeout()})).catch((t=>{})),this.wst()}Bst(){return this.Zet.getConsentInstanceInfo().then((t=>{if(kt(t))return Promise.resolve(!0);const n=this.rV.consentRequired;return"boolean"==typeof n?Promise.resolve(n):this.Jst().then((t=>!!t&&(void 0!==t.consentRequired?!!t.consentRequired:!!t.promptIfUnknown)))}))}qst(){const t=this.Jst().then((t=>t&&void 0!==t.sharedData?t.sharedData:null));this.Zet.setConsentInstanceSharedData(t)}Gst(){this.Jst().then((t=>{t&&((t.expireCache||t.forcePromptOnNext)&&this.Zet.setDirtyBit(),t.consentRequired&&!this.hst&&this.Kst(t.consentStateValue,t.consentString||void 0,t.consentMetadata,t.purposeConsents,t.tcfPolicyVersion))}))}Kst(t,n,e,i,s){const o="accepted"===(r=t)?1:"rejected"===r?2:"unknown"===r?5:null;var r;null!==o&&(i&&a(i)&&Object.keys(i).length&&(this.Nst(i),this.Zet.updateConsentInstancePurposes(i)),this.Zet.updateConsentInstanceState(o,n,this.Dst(e),s))}Jst(){if(this.lst)return this.lst;const{"checkConsentHref":t}=this.rV;if(t){const n=this.Zet.getLastConsentInstanceInfo();this.lst=n.then((n=>{const e={credentials:"include",method:"POST",body:{"consentInstanceId":this.ust,"consentStateValue":St(n.consentState),"consentMetadata":n.consentMetadata,"consentString":n.consentString,"tcfPolicyVersion":n.tcfPolicyVersion,"isDirty":!!n.isDirty,"matchedGeoGroup":this.pst,"purposeConsents":n.purposeConsents,"clientConfig":this.rV.clientConfig}};mt(t,this.element);const i=this.getAmpDoc(),s=Pt(i.getUrl()),o=(h=t,c=dt(c=s),new URL(h,c.href).toString()),r=X(this.win);var h,c;return i.whenFirstVisible().then((()=>Lt(this.element,o).then((t=>r.fetchJson(t,e).then((t=>r.xssiJson(t,this.rV.xssiPrefix).catch((t=>{U().error(gn,"Could not parse the `checkConsentHref` response.",t)}))))))))}))}else this.lst=Promise.resolve(null);return this.lst}Qst(t){return this.Fst().then((n=>{if(null==n||!n.length)return this.Zet.hasAllPurposeConsents(),!0;const e=t.purposeConsents;if(!e||Object.keys(e).length<n.length)return!1;for(let t=0;t<n.length;t++)if(!u(e,n[t]))return!1;return this.Zet.hasAllPurposeConsents(),!0}))}Fst(){if(this.dst)return this.dst;const t=this.rV.purposeConsentRequired;return s(t)?this.dst=Promise.resolve(t):this.dst=this.Jst().then((t=>t&&s(t.purposeConsentRequired)?t.purposeConsentRequired:null)),this.dst}Yst(){return this.Zet.getConsentInstanceInfo().then((t=>kt(t)?this.Qst(t):Promise.resolve(!1)))}zst(t){return this.est=new en(this,N(this.rV)),this.Yst().then((n=>!!n||(t?(this.Lst(!1),!0):(this.Zet.updateConsentInstanceState(4),!1))))}Wst(){this.sst&&(this.nst.onQueueEmpty((()=>{this.Xr.mutate((()=>{this.sst.show(!1)}))})),this.nst.onQueueNotEmpty((()=>{this.Xr.mutate((()=>{this.sst.hide()}))})))}getConsentStateManagerForTesting(){return this.Zet}getConsentRequiredPromiseForTesting(){return this.Bst()}getIsPromptUiOnForTesting(){return this.rst}Nst(t){Object.keys(t).forEach((n=>{t[n]}))}jst(t){if("number"==typeof t){if(!(isNaN(t)||!isFinite(t)||t.toString().split(".").length>1))return t;U().error(gn,"CMP tcfPolicyVersion must be a valid number (integer).")}}Dst(t){if(t){if(a(t))return function(t){const n=t.consentStringType,e=t.additionalConsent,i=t.gdprApplies,s=t.purposeOne,o=t.gppSectionId,r=[];var h;n&&1!==(h=n)&&2!==h&&3!==h&&4!==h&&(delete t.consentStringType,r.push("consentStringType")),e&&"string"!=typeof e&&(delete t.additionalConsent,r.push("additionalConsent")),i&&"boolean"!=typeof i&&(delete t.gdprApplies,r.push("gdprApplies")),s&&"boolean"!=typeof s&&(delete t.purposeOne,r.push("purposeOne")),o&&"string"!=typeof o&&(delete t.gppSectionId,r.push("gppSectionId"));for(let t=0;t<r.length;t++)U().error("amp-consent",'Consent metadata value "%s" is invalid.',r[t])}(t),wt(t.consentStringType,t.additionalConsent,t.gdprApplies,t.purposeOne,t.gppSectionId);U().error(gn,"CMP metadata is not an object.")}}$st(){if(!this.rV.exposesTcfApi)return;if(this.win.frames.__tcfapiLocator)return;this.tst=new class{constructor(t){this.Zst=t,this.Xst=l(),this.tot=null,this.not=0,t.setOnPolicyChange((()=>{this.eot()}))}handleTcfCommand(t,n){if(!this.iot(t.__tcfapiCall))return;const e=t.__tcfapiCall,{command:i}=e;switch(i){case"ping":this.sot(e,n);break;case"getTCData":this.oot(e,n);break;case"addEventListener":this.rot(e,n);break;case Rt:this.hot(e,n);break;default:return}}rot(t,n){this.Xst[this.not]||(this.Xst[this.not]={payload:t,win:n},this.not++)}hot(t,n){const{callId:e,parameter:i}=t,s=!!this.Xst[i];s&&delete this.Xst[i],this.cot(n,void 0,e,s)}eot(){Object.keys(this.Xst).length&&this.aot().then((t=>{const n=t[2];if(!n||n===this.tot)return;this.tot=n;const e=Object.keys(this.Xst);for(let i=0;i<e.length;i++){const s=Number(e[i]);if(!u(this.Xst,s))continue;const{payload:o,win:r}=this.Xst[s],{callId:h}=o,c=this.lot(t[0],t[1],n,s,t[3]);this.cot(r,c,h,!0)}}))}aot(){const t=this.Zst.getConsentStringInfo("default"),n=this.Zst.getConsentMetadataInfo("default"),e=this.Zst.getMergedSharedData("default"),i=this.Zst.getTcfPolicyVersion("default");return Promise.all([n,e,t,i])}oot(t,n){this.aot().then((e=>{const i=this.lot(e[0],e[1],e[2],void 0,e[3]),{callId:s}=t;this.cot(n,i,s,!0)}))}lot(t,n,e,i,s){const o=t?t.purposeOne:void 0,r=t?t.gdprApplies:void 0,h=t?t.additionalConsent:void 0,c=st(st({},n),{},{additionalConsent:h});return{tcfPolicyVersion:"number"==typeof s?s:2,gdprApplies:r,tcString:e,listenerId:i,cmpStatus:fn,eventStatus:"tcloaded",purposeOneTreatment:o,additionalData:c}}sot(t,n){const e=this.Zst.getConsentMetadataInfo("default"),i=this.Zst.getTcfPolicyVersion("default");Promise.all([e,i]).then((e=>{const i=this.uot(e[0],e[1]),{callId:s}=t;this.cot(n,i,s)}))}uot(t,n){return{gdprApplies:t?t.gdprApplies:void 0,cmpLoaded:!0,cmpStatus:fn,tcfPolicyVersion:"number"==typeof n?n:2}}cot(t,n,e,i){if(!t)return;const s={returnValue:n,callId:e,success:i};t.postMessage({__tcfapiReturn:s},"*")}iot(t){if(!a(t))return U().error(dn,`"tcfapiCall" is not an object: ${t}`),!1;const{command:n,parameter:e,version:i}=t;return"getTCData"!==(s=n)&&"ping"!==s&&"addEventListener"!==s&&"removeEventListener"!==s?(U().error(dn,`Unsupported command found in "tcfapiCall": ${n}`),!1):e&&n!=Rt?(U().error(dn,`Unsupported parameter found in "tcfapiCall": ${e}`),!1):2==i||(U().error(dn,`Found incorrect version in "tcfapiCall": ${i}`),!1);var s}getMinimalPingReturnForTesting(t,n){return this.uot(t,n)}getMinimalTcDataForTesting(t,n,e,i,s){return this.lot(t,n,e,i,s)}}(this.Xet),this.win.addEventListener("message",(t=>this.pot(t)));const t=this.element.ownerDocument.createElement("iframe");t.setAttribute("name","__tcfapiLocator"),t.setAttribute("aria-hidden","true"),I(t,!1),this.element.appendChild(t)}pot(t){const n=nt(t);n&&n.__tcfapiCall&&this.tst.handleTcfCommand(n,t.source)}};t.registerElement("amp-consent",bn,"amp-consent{position:fixed!important;bottom:0;left:0;overflow:hidden!important;background:hsla(0,0%,100%,.7);width:100%;z-index:2147483645}amp-consent[i-amphtml-notbuilt]>*{display:none!important}amp-consent>*{max-height:100vh!important}amp-consent.amp-active{visibility:visible}amp-consent.amp-hidden{visibility:hidden}@keyframes amp-consent-ui-placeholder-spin{0%{transform:rotate(0deg)}to{transform:rotate(360deg)}}.i-amphtml-consent-ui-placeholder{width:100%;height:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.i-amphtml-consent-ui-placeholder>svg{width:30px;height:30px;fill:none;stroke-width:1.5px;transform-origin:50% 50%;animation:amp-consent-ui-placeholder-spin 1000ms linear infinite}.i-amphtml-consent-alertdialog{overflow:hidden;position:absolute;height:1px;width:1px;top:auto;left:auto}.i-amphtml-consent-ui-fill{position:absolute;top:0;left:0;width:100%}iframe.i-amphtml-consent-ui-fill{border:none}amp-consent.i-amphtml-consent-ui-iframe-active{width:100%!important;height:100%!important;padding:0px!important;margin:0px!important;overflow:auto!important;transform:translate3d(0px,100vh,0px)!important}amp-consent.i-amphtml-consent-ui-iframe-active.i-amphtml-consent-ui-modal{box-sizing:border-box;top:0;right:0;animation:i-amphtml-modal-appear 0.5s;animation-fill-mode:forwards;height:var(--i-amphtml-modal-height)!important;width:90vw!important;margin:auto!important;max-width:760px}amp-consent.i-amphtml-consent-ui-border-enabled{border-top-left-radius:8px!important;border-top-right-radius:8px!important;box-shadow:0 0 5px 0 rgba(0,0,0,.2)!important}amp-consent.i-amphtml-consent-ui-modal.i-amphtml-consent-ui-border-enabled{border-radius:8px!important;box-shadow:0 0 5px 0 rgba(0,0,0,.2)!important}amp-consent.i-amphtml-consent-ui-iframe-active.i-amphtml-consent-ui-iframe-transform{transform:translate3d(0px,calc(100% - var(--i-amphtml-modal-height)),0px)!important}amp-consent.i-amphtml-consent-ui-iframe-active.i-amphtml-consent-ui-in{transition:transform 0.5s ease-out!important}amp-consent.i-amphtml-consent-ui-iframe-active.i-amphtml-consent-ui-in.i-amphtml-consent-ui-iframe-fullscreen{top:0px!important;transform:translateZ(0px)!important;border-top-left-radius:0px!important;border-top-right-radius:0px!important}amp-consent.i-amphtml-consent-ui-in.i-amphtml-consent-ui-iframe-fullscreen>.i-amphtml-consent-ui-fill{height:100%!important}@keyframes i-amphtml-consent-ui-mask{0%{opacity:0.0}to{opacity:0.2}}@keyframes i-amphtml-modal-appear{0%{transform:translateY(100vh);opacity:0}to{transform:translate(0);opacity:1}}.i-amphtml-consent-ui-mask{position:fixed!important;top:0!important;left:0!important;width:100vw!important;height:100vh!important;opacity:0.2;animation:i-amphtml-consent-ui-mask 0.25s ease-in;background-image:none!important;background-color:#000;z-index:2147483644}\n/*# sourceURL=/extensions/amp-consent/0.1/amp-consent.css*/"),t.registerServiceForDoc(tt,class{constructor(){this.dot=0,this.fot=e(),this.mot=()=>{},this._ot=()=>{}}onQueueEmpty(t){this.mot=t,0==this.dot&&t()}onQueueNotEmpty(t){this._ot=t,this.dot>0&&t()}registerUI(t){0==this.dot&&this._ot(),this.dot++;const n=this.fot.then((()=>t().then((()=>{this.dot--,0==this.dot&&this.mot()}))));return this.fot=n,n}}),t.registerServiceForDoc(_n,class{constructor(t){this.zi=t,this.Pot=null,this.got=null,this.vot=null,this.Aot=null,this.Iot=null,this.bot=void 0;const n=new i;this.yot=n.resolve,this.Rot=n.promise,this.consentPageViewId64=function(t){let n=!1,e=null,i=t;return(...t)=>(n||(e=i.apply(self,t),n=!0,i=null),e)}((()=>function(t){const n=function(t){const n=function(t,n){let{crypto:e}=t;const i=new Uint8Array(16);return e.getRandomValues(i),i}(t);return n||String(t.location.href+Date.now()+t.Math.random()+t.screen.width+t.screen.height)}(t);if("string"==typeof n)return(e=t,H(e,"crypto")).sha384Base64(n);var e,i;{const t=n;return i=()=>function(t){const n=ht(t);return btoa(n).replace(/[+/=]/g,(t=>lt[t]))}(t).replace(/\.+$/,""),new Promise((t=>{t(i())}))}}(this.zi.win)))}registerConsentInstance(t,n){this.got?D().error(Ot,"Cannot register consent instance %s, instance %s has already been registered.",t,this.Pot):(this.Pot=t,this.got=new class{constructor(t,n,e){this.zi=t,this.Ei=n,this.sharedDataPromise=null,this.Eot=(t=>{const n=B(t),e=H(n.win,"ampdoc"),i=e.isSingleDoc()?e.getSingleDoc():null;return G(i&&i.win==n.win?i:n,"storage")})(t),this.Mot=null,this.Cot=null,this.Tot="amp-consent:"+n,this.wot=e.onUpdateHref||null,this.wot&&mt(this.wot,"AMP-CONSENT"),this.Vot=void 0}setDirtyBit(t=!0){return this.Vot=t,this.get().then((n=>{Et(n)!==t&&this.update(n.consentState,n.consentString,n.purposeConsents,n.consentMetadata,t)}))}update(t,n,e,i,s,o){const r=(c=this.Mot&&this.Mot.consentState,1!==(a=h=t)&&2!==a&&3!==a&&4!==a&&5!==a&&(h=5),3==h?c||5:4==h&&c&&5!=c?c:h);var h,c,a,l,u,p,d;if(3===t)return void(this.Mot=Tt(r,null===(l=this.Mot)||void 0===l?void 0:l.consentString,null===(u=this.Mot)||void 0===u?void 0:u.consentMetadata,null===(p=this.Mot)||void 0===p?void 0:p.purposeConsents,void 0,null===(d=this.Mot)||void 0===d?void 0:d.tcfPolicyVersion));const f=this.Mot;s&&Et(f)?this.Mot=Tt(r,n,i,e,!0,o):this.Mot=Tt(r,n,i,e,void 0,o);const m=Tt(r,n,i,e,this.Vot,o);Ct(m,this.Cot)||this.kot(m)}kot(t){this.Eot.then((n=>{if(!Ct(t,this.Mot,this.Vot))return;if(5===t.consentState)return void n.remove(this.Tot);const e=function(t){const n=l(),e=t.consentState;if(1==e)n.s=1;else{if(2!=e)return null;n.s=0}return t.consentString&&(n.r=t.consentString),t.tcfPolicyVersion&&(n.e=t.tcfPolicyVersion),!0===t.isDirty&&(n.d=1),t.consentMetadata&&(n.m=function(t){const n=l();return t.consentStringType&&(n.cst=t.consentStringType),t.additionalConsent&&(n.ac=t.additionalConsent),null!=t.gdprApplies&&(n.ga=t.gdprApplies),null!=t.purposeOne&&(n.po=t.purposeOne),null!=t.gppSectionId&&(n.gsi=t.gppSectionId),n}(t.consentMetadata)),t.purposeConsents&&(n.pc=t.purposeConsents),0==Object.keys(n)?null:n}(t);null!=e&&(this.Cot=t,n.setNonBoolean(this.Tot,e),this.Sot(t))}))}get(){if(this.Mot)return Promise.resolve(this.Mot);let t;return this.Eot.then((n=>(t=n,t.get(this.Tot)))).then((n=>{if(this.Mot)return this.Mot;const e=function(t){if(void 0===t)return Tt(5);if("boolean"==typeof t)return function(t){return Tt(Vt(t))}(t);if(!a(t))throw D().createError("Invalid stored consent value");return Tt(Vt(t.s),t.r,(n=t.m)?wt(n.cst,n.ac,n.ga,n.po,n.gsi):wt(),t.pc,t.d&&1===t.d,t.e);var n}(n);return this.Cot=e,Et(e)&&(this.Sot(Tt(5)),t.remove(this.Tot),this.Cot=null),this.Mot=e,this.Mot})).catch((t=>(D().error(Ot,"Failed to read storage",t),Tt(5))))}Sot(t){if(!this.wot)return;if(Et(t))return;const n=Mt(t.consentState);Ht(this.zi).then((e=>{const i={"consentInstanceId":this.Ei,"ampUserId":e};null!=n&&(i.consentState=n),i.consentStateValue=St(t.consentState),t.consentString&&(i.consentString=t.consentString),t.consentMetadata&&(i.consentMetadata=t.consentMetadata),t.purposeConsents&&(i.purposeConsents=t.purposeConsents),t.tcfPolicyVersion&&(i.tcfPolicyVersion=t.tcfPolicyVersion);const s={credentials:"include",method:"POST",body:i,ampCors:!1};this.zi.whenFirstVisible().then((()=>{Lt(this.zi.getHeadNode(),this.wot).then((t=>{X(this.zi.win).fetchJson(t,s)}))}))}))}}(this.zi,t,n),this.Iot&&(this.Iot(),this.Iot=null))}updateConsentInstanceState(t,n,e,i){this.got?(this.got.update(t,n,this.bot,e,!1,i),this.vot&&(this.vot(Tt(t,n,e,this.bot,void 0,i)),this.hasAllPurposeConsents())):D().error(Ot,"instance not registered")}updateConsentInstancePurposes(t,n=!1){this.bot||(this.bot={}),Object.keys(t).forEach((e=>{if(n&&u(this.bot,e))return;const i=t[e]?1:2;this.bot[e]=i}))}getLastConsentInstanceInfo(){return N(this.got),this.got.get()}getConsentInstanceInfo(){return N(this.got),this.got.get().then((t=>Et(t)?Tt(5):t))}onConsentStateChange(t){N(this.got),N(!this.vot),this.vot=t,this.getConsentInstanceInfo().then((n=>{t(n)}))}setConsentInstanceSharedData(t){N(this.got),this.got.sharedDataPromise=t}hasAllPurposeConsents(){this.yot()}whenHasAllPurposeConsents(){return this.Rot}setDirtyBit(t=!0){return this.got.setDirtyBit(t)}getConsentInstanceSharedData(){return N(this.got),this.got.sharedDataPromise}whenConsentReady(){if(this.got)return e();if(!this.Aot){const t=new i;this.Aot=t.promise,this.Iot=t.resolve}return this.Aot}getSavedInstanceForTesting(){return this.got.Cot}}),t.registerServiceForDoc(Pn,class{constructor(t){this.zi=t,this.Oot=l(),this.xot=l(),this.Uot=G(this.zi,"consentStateManager"),this.jot=new i;const n=new i;this.Dot=n.promise,this.Not=n.resolve,this.Lot=new class{constructor(){this.ut=null}add(t){return this.ut||(this.ut=[]),this.ut.push(t),()=>{this.remove(t)}}remove(t){this.ut&&function(t,n){const e=t.indexOf(n);-1!=e&&t.splice(e,1)}(this.ut,t)}removeAll(){this.ut&&(this.ut.length=0)}fire(t){if(this.ut)for(const n of this.ut.slice())n(t)}getHandlerCount(){var t,n;return null!==(t=null===(n=this.ut)||void 0===n?void 0:n.length)&&void 0!==t?t:0}},this.Hot=null,this.wy=null,this.Ty=null,this.Fot=null,this.zy=null,this.bot=null,this.qot=null}setLegacyConsentInstanceId(t){this.Hot=t,this.sl()}registerConsentPolicyInstance(t,n){if(this.xot[t])return;const e=Object.keys(n.waitFor||{});if(1!==e.length||e[0]!==this.Hot)return void U().error(qt,"invalid waitFor value, consent policy will never resolve");const s=new class{constructor(t){this.sA=t;const n=new i;this.pi=n.promise,this.vi=n.resolve,this.Got=4,this.$ot=t.unblockOn||[1,3]}startTimeout(t){const n=this.sA.timeout;let e,i=null;var s;null!=n&&(a(n)?(n.fallbackAction&&"reject"==n.fallbackAction?e=2:n.fallbackAction&&"dismiss"!=n.fallbackAction&&U().error(qt,"unsupported fallbackAction %s",n.fallbackAction),i=n.seconds):i=n,L("number"==typeof(s=i)&&isFinite(s),"invalid timeout value %s",i)),null!=i&&t.setTimeout((()=>{e=e||5,this.evaluate(e,!0)}),1e3*i)}evaluate(t,n=!1){t&&(n&&!this.vi||(this.Got=1===t?1:2===t?2:4===t?3:4,this.vi&&(this.vi(),this.vi=null)))}getReadyPromise(){return this.pi}getCurrentPolicyStatus(){return this.Got}shouldUnblock(){return this.$ot.indexOf(this.Got)>-1}}(n);this.xot[t]=s,this.Oot[t]&&(this.Oot[t].resolve(),this.Oot[t]=null),this.Dot.then((()=>{this.wy&&s.evaluate(this.wy),this.Lot.add((t=>{s.evaluate(t)})),this.jot.promise.then((()=>{s.startTimeout(this.zi.win)}))}))}sl(){this.Uot.then((t=>{t.whenConsentReady().then((()=>{t.onConsentStateChange((t=>{this.Bot(t),this.Not&&(this.Not(),this.Not=null)}))}))}))}enableTimeout(){this.jot.resolve()}Bot(t){const n=t.consentState,e=t.consentString,i=t.tcfPolicyVersion,s=t.consentMetadata,o=t.purposeConsents,{zy:r,Ty:h,bot:c,Fot:a}=this;this.Ty=e,this.Fot=i,this.zy=s,this.bot=o,5!==n&&(4==n?1!=this.wy&&2!=this.wy&&(this.wy=4):3==n?(null===this.wy&&(this.wy=5),this.Ty=h,this.Fot=a,this.zy=r,this.bot=c):this.wy=n,this.Lot.fire(this.wy),this.qot&&this.qot())}setOnPolicyChange(t){this.qot||(this.qot=t)}whenPolicyResolved(t){return Gt[t]?this.zot(t).then((()=>this.xot[t].getReadyPromise().then((()=>this.xot[t].getCurrentPolicyStatus())))):(U().error(qt,"can not find policy %s, only predefined policies are supported",t),Promise.resolve(4))}whenPolicyUnblock(t){return Gt[t]?this.zot(t).then((()=>this.xot[t].getReadyPromise().then((()=>this.xot[t].shouldUnblock())))):(U().error(qt,"can not find policy %s, only predefined policies are supported",t),Promise.resolve(!1))}getMergedSharedData(t){return this.whenPolicyResolved(t).then((()=>this.Uot)).then((t=>t.getConsentInstanceSharedData()))}getConsentStringInfo(t){return this.whenPolicyResolved(t).then((()=>this.Ty))}getTcfPolicyVersion(t){return this.whenPolicyResolved(t).then((()=>this.Fot))}getConsentMetadataInfo(t){return this.whenPolicyResolved(t).then((()=>this.zy))}whenPurposesUnblock(t){return this.Uot.then((t=>t.whenHasAllPurposeConsents())).then((()=>!!this.bot&&t.every((t=>u(this.bot,t)&&1===this.bot[t]))))}zot(t){return this.xot[t]?e():(this.Oot[t]||(this.Oot[t]=new i),this.Oot[t].promise)}})})();
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */}});
//# sourceMappingURL=amp-consent-0.1.mjs.map