; (self.AMP=self.AMP||[]).push({m:1,v:"2310061803000",n:"amp-analytics",ev:"0.1",l:!0,f:function(t,i){(()=>{var i;function s(){return i||(i=Promise.resolve(void 0))}var e=class{constructor(){this.promise=new Promise(((t,i)=>{this.resolve=t,this.reject=i}))}},{isArray:n}=Array;function r(t,i){for(let s=0;s=0&&t.indexOf(i,s)==s}function h(t,i,s){const e=s||1;for(let s=0;s(s++,i(e)))),!s)break}return t}var{hasOwnProperty:u,toString:c}=Object.prototype;function a(t){return"[object Object]"===c.call(t)}function l(t){const i=Object.create(null);return t&&Object.assign(i,t),i}function f(t,i){return u.call(t,i)}function d(t,i,s=10){const e=[],n=[];for(n.push({t:t,s:i,d:0});n.length>0;){const{d:t,s:i,t:r}=n.shift();if(e.includes(i))throw new Error("Source object has a circular reference.");if(e.push(i),r!==i)if(t>s)Object.assign(r,i);else for(const s of Object.keys(i)){const e=i[s];if(f(r,s)){const i=r[s];if(a(e)&&a(i)){n.push({t:i,s:e,d:t+1});continue}}r[s]=e}}return t}function _(t){return"number"==typeof t&&isFinite(t)}function m(t,i,s,e,n,r,o,h,u,c,a){return t}function A(t){return JSON.parse(t)}function P(t,i){try{return A(t)}catch(t){return null==i||i(t),null}}function p(t){return(t.ownerDocument||t).defaultView}function T(t,i){return t.replace(/^|,/g,`$&${i} `)}function E(t,i){return t.closest(i)}function g(t,i,s){return function(t,i){for(const s in i)t.setAttribute(s,i[s]);return t}(t.createElement(i),s)}function I(t,i,s){const e=i||(t=>t),{dataset:n}=t,r={},o=s||/^param(.+)/;for(const t in n){const i=t.match(o);i&&(r[e(i[1][0].toLowerCase()+i[1].substr(1))]=n[t])}return r}function v(t){return t.parent&&t.parent!=t}function R(t){const i=Object.getOwnPropertyDescriptor(t,"message");if(null!=i&&i.writable)return t;const{message:s,stack:e}=t,n=new Error(s);for(const i in t)n[i]=t[i];return n.stack=e,n}function M(t){let i=null,s="";for(const t of arguments)t instanceof Error&&!i?i=R(t):(s&&(s+=" "),s+=t);return i?s&&(i.message=s+": "+i.message):i=new Error(s),i}function b(t){var i,s;null===(i=(s=self).__AMP_REPORT_ERROR)||void 0===i||i.call(s,t)}function S(t){const i=M.apply(null,arguments);setTimeout((()=>{throw b(i),i}))}var y=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function w(t,i=""){try{return decodeURIComponent(t)}catch(t){return i}}function O(t){const i=l();if(!t)return i;let s;for(;s=y.exec(t);){const t=w(s[1],s[1]),e=s[2]?w(s[2].replace(/\+/g," "),s[2]):"";i[t]=e}return i}function V(t){const{location:i}=t||self;return O(i.originalHash||i.hash)}var N="";function C(t){const i=t||self;return i.__AMP_MODE?i.__AMP_MODE:i.__AMP_MODE=function(t){return{localDev:!1,development:L(t,V(t)),esm:!0,test:!1,rtvVersion:k(t),ssrReady:!1}}(i)}function k(t){var i;return N||(N=(null===(i=t.AMP_CONFIG)||void 0===i?void 0:i.v)||"012310061803000"),N}function L(t,i){const s=i||V(t);return["1","actions","amp","amp4ads","amp4email"].includes(s.development)||!!t.AMP_DEV_MODE}var D=(()=>self.AMP.config.urls)();self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var x=self.__AMP_LOG;function U(t,i){throw new Error("failed to call initLogConstructor")}function H(t){return x.user||(x.user=j()),function(t,i){return i&&i.ownerDocument.defaultView!=t}(x.user.win,t)?x.userForEmbed||(x.userForEmbed=j()):x.user}function j(t){return U()}function F(){return x.dev||(x.dev=U())}function q(t,i,s,e,n,r,o,h,u,c,a){return t}function $(t,i,s,e,n,r,o,h,u,c,a){return H().assert(t,i,s,e,n,r,o,h,u,c,a)}function B(t,i){return Q(t=K(t),i)}function G(t,i){return Q(Z(J(t)),i)}function W(t,i){const s=Z(J(t));return et(s,i)?Q(s,i):null}function z(t,i){return function(t,i){const s=it(t,i);if(s)return s;const n=st(t);return n[i]=function(){const t=new e,{promise:i,reject:s,resolve:n}=t;return i.catch((()=>{})),{obj:null,promise:i,resolve:n,reject:s,context:null,ctor:null}}(),n[i].promise}(Z(t),i)}function Y(t,i){return it(Z(t),i)}function K(t){return t.__AMP_TOP||(t.__AMP_TOP=t)}function X(t,i){const s=(t.ownerDocument||t).defaultView,e=i||K(s);if(s&&s!=e&&K(s)==e)try{return s.frameElement}catch(t){}return null}function J(t){return t.nodeType?(i=p(t),B(i,"ampdoc")).getAmpDoc(t):t;var i}function Z(t){const i=J(t);return i.isSingleDoc()?i.win:i}function Q(t,i){q(et(t,i));const s=st(t)[i];return s.obj||(q(s.ctor),q(s.context),s.obj=new s.ctor(s.context),q(s.obj),s.context=null,s.resolve&&s.resolve(s.obj)),s.obj}function tt(t,i,s,e,n,r){const o=st(t);let h=o[s];h||(h=o[s]={obj:null,promise:null,resolve:null,reject:null,context:null,ctor:null,sharedInstance:r||!1}),!n&&h.ctor||(h.ctor=e,h.context=i,h.sharedInstance=r||!1,h.resolve&&Q(t,s))}function it(t,i){const s=st(t)[i];return s?s.promise?s.promise:(Q(t,i),s.promise=Promise.resolve(s.obj)):null}function st(t){let i=t.__AMP_SERVICES;return i||(i=t.__AMP_SERVICES={}),i}function et(t,i){const s=t.__AMP_SERVICES&&t.__AMP_SERVICES[i];return!(!s||!s.ctor)}function nt(t,i,s,e){const n=Y(t,i);if(n)return n;const r=J(t);return r.whenExtensionsKnown().then((()=>{const t=r.getExtensionVersion(s);return t?B(r.win,"extensions").waitForExtension(s,t):null})).then((s=>s?e?Y(t,i):z(t,i):null))}var rt,ot=t=>J(t),ht=t=>B(t,"crypto"),ut=t=>B(t,"performance"),ct=t=>B(t,"preconnect"),at=t=>Q(t,"timer"),lt=t=>W(t,"url-replace"),ft=t=>nt(t,"consentPolicyManager","amp-consent"),dt=t=>W(t,"url"),_t=t=>G(t,"viewport"),mt=t=>B(t,"xhr");function At(t,i,s,e){let n=t,r=s,o=t=>{try{return r(t)}catch(t){var i,s;throw null===(i=(s=self).__AMP_REPORT_ERROR)||void 0===i||i.call(s,t),t}};const h=function(){if(void 0!==rt)return rt;rt=!1;try{const t={get capture(){return rt=!0,!1}};self.addEventListener("test-options",null,t),self.removeEventListener("test-options",null,t)}catch(t){}return rt}(),u=!(null==e||!e.capture);return n.addEventListener(i,o,h?e:u),()=>{null==n||n.removeEventListener(i,o,h?e:u),r=null,n=null,o=null}}function Pt(t,i,s,e){return At(t,i,s,e)}function pt(t){return t.data}function Tt(t,i,s,e){let n=s;const r=At(t,i,(t=>{try{n(t)}finally{n=null,r()}}),e);return r}function Et(t){return"AUDIO"===t.tagName||"VIDEO"===t.tagName}var gt="active";function It(t,i){let s=0;return t.type===gt&&(s=5),Math.min(i-t.time,s)}var vt=["mousedown","mouseup","mousemove","keydown","keyup"],Rt=["mouseleave"];function Mt(t,i,s){return i in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}function bt(t,i){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);i&&(e=e.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),s.push.apply(s,e)}return s}function St(t){for(var i=1;ikt[t]))}(Ot(t))}var Dt,xt=(()=>self.AMP.config.urls)(),Ut=new Set(["c","v","a","ad"]),Ht=t=>"string"==typeof t?jt(t):t;function jt(t,i){return Dt||(Dt=self.document.createElement("a")),function(t,i,s){return t.href="",new URL(i,t.href)}(Dt,t)}function Ft(t,i,s){if(!i)return t;const e=t.split("#",2),n=e[0].split("?",2);let r=n[0]+(n[1]?s?`?${i}&${n[1]}`:`?${n[1]}&${i}`:`?${i}`);return r+=e[1]?`#${e[1]}`:"",r}function qt(t,i){return`${encodeURIComponent(t)}=${encodeURIComponent(i)}`}function $t(t){const i=[];for(const e in t){let r=t[e];if(null!=r){r=n(s=r)?s:[s];for(let t=0;tself.AMP.config.urls)(),Kt="-test-amp-cookie-tmp",Xt="None";function Jt(t,i){const s=function(t){try{return t.document.cookie}catch(t){return""}}(t);if(!s)return null;const e=s.split(";");for(let t=0;t0,"Expected a . in origin %s",n),i.splice(1,"s"==e?3:2),n+i.join("/")+Wt(t.search,"(amp_(js[^&=]*|gsa|r|kit)|usqp)")+(t.hash||"")}(t.location.href)).origin;return o(e,"."+s)?s:e.split("://")[1]}if(!Gt(t.location.href)){const i=t.location.hostname.split(".");let s=i[i.length-1];const e=function(t){let i=Kt;for(;Jt(t,i);)i=Kt+0;return i}(t);for(let n=i.length-2;n>=0;n--)if(s=i[n]+"."+s,Qt(t,e,"delete",Date.now()+1e3,s),"delete"==Jt(t,e))return Qt(t,e,"delete",Date.now()-1e3,s),s}return null}function Qt(t,i,s,e,n,r,o){"ampproject.org"==n&&(s="delete",e=0);const h=encodeURIComponent(i)+"="+encodeURIComponent(s)+"; path=/"+(n?"; domain="+n:"")+"; expires="+new Date(e).toUTCString()+function(t,i){return i?`; SameSite=${i}`:""}(0,r)+(o?"; Secure":"");try{t.document.cookie=h}catch(t){}}function ti(t){return"string"==typeof t&&t.startsWith("amp-")&&-1!=t.indexOf("{")}var ii=["Webkit","webkit","Moz","moz","ms","O","o"],si={"getPropertyPriority":()=>"","getPropertyValue":()=>""};function ei(t,i,s){if(i.startsWith("--"))return i;zt||(zt=l());let e=zt[i];if(!e||s){if(e=i,void 0===t[i]){const s=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(i),n=function(t,i){for(let s=0;s"-"+t.toLowerCase()));return ii.some((t=>i.startsWith(t+"-")))?`-${i}`:i}(r),o)}function ri(t,i){void 0===i&&(i=t.hasAttribute("hidden")),i?t.removeAttribute("hidden"):t.setAttribute("hidden","")}var oi="unlisten";function hi(t,i,s){const e=function(t,i){let{listeningFors:s}=t;return!s&&i&&(s=t.listeningFors=Object.create(null)),s||null}(t,s);if(!e)return e;let n=e[i];return!n&&s&&(n=e[i]=[]),n||null}function ui(t,i){for(let s=i;s&&s!=s.parent;s=s.parent)if(s==t)return!0;return!1}function ci(t){const i={"sentinel":oi};for(let s=t.length-1;s>=0;s--){const e=t[s];if(!e.frame.contentWindow){t.splice(s,1);const{events:n}=e;for(const t in n)n[t].splice(0,1/0).forEach((t=>{t(i)}))}}}function ai(t,i){return i?t.getAttribute("data-amp-3p-sentinel"):"amp"}function li(t){return t.__AMP_EMBED__}function fi(t){return t.classList.contains("i-amphtml-fie")||!!E(t,".i-amphtml-fie")}function di(t,i){return!(fi(i)||Gt(t.location)||"inabox"==C(t).runtime)}var _i=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}},mi=null,Ai="*",Pi=/^[a-zA-Z0-9\-_.]+$/,pi="amp-analytics/linker";function Ti(t,i){const s=(e=i)?Object.keys(e).filter((t=>{const i=Pi.test(t);return i||H().error(pi,"Invalid linker key: "+t),i})).map((t=>{return t+Ai+(i=e[t],Lt(String(i)));var i})).join(Ai):"";var e;return""===s?"":[t,Ei(s),s].join(Ai)}function Ei(t,i){const s=i||0;return function(t){mi||(mi=function(){const t=new Array(256);for(let i=0;i<256;i++){let s=i;for(let t=0;t<8;t++)1&s?s=s>>>1^3988292384:s>>>=1;t[i]=s}return t}());const i=Ot(t);let s=-1>>>0;for(let t=0;t>>8^mi[e]}return(-1^s)>>>0}([function(){const t=(new Date).getTimezoneOffset(),i=_i.getUserLanguage(window);return[_i.getUserAgent(window),t,i].join(Ai)}(),Math.floor(Date.now()/6e4)-s,t].join(Ai)).toString(36)}function gi(t){return function(t){const i=function(t){return Vt(atob(t.replace(/[-_.]/g,(t=>Ct[t]))))}(t);return function(t){if("undefined"!=typeof TextDecoder)return new TextDecoder("utf-8").decode(t);const i=Nt(new Uint8Array(t.buffer||t));return decodeURIComponent(escape(i))}(i)}(String(t))}var Ii="visible",vi="amp-analytics/session-manager",Ri="sessionId",Mi="creationTimestamp",bi="accessTimestamp",Si="engaged",yi="eventTimestamp",wi="count";function Oi(t){return t.accessTimestamp+18e5t?t.getConsentStringInfo(i):null))}var Li="amp-analytics/variables",Di=/^(?:([^\s]*)(\([^)]*\))|[^]+)$/,xi={1:"sufficient",2:"insufficient",3:"not_required",4:"unknown"},Ui=class{constructor(t,i,s){this.vars=t,this.iterations=void 0===i?2:i,this.noEncode=!!s,this.freezeVars={}}freezeVar(t){this.freezeVars[t]=!0}getVar(t){let i=this.vars[t];return null==i&&(i=""),i}};function Hi(t,i,s){const e=Number(i);let{length:n}=t;return $(_(e),"Start index "+e+"in substr macro should be a number"),s&&(n=Number(s),$(_(n),"Length "+n+" in substr macro should be a number")),t.substr(e,n)}function ji(t,i){return t&&t.length?t:i}function Fi(t,i,s){s||(s="");const e=new RegExp(i,"g");return t.replace(e,s)}function qi(t,i,s){let e=0;s&&(e=parseInt(s,10),(0!=e&&!e||e<0)&&(H().error(Li,"Third argument in MATCH macro must be a number >= 0"),e=0));const n=new RegExp(i),r=t.match(n);return r&&r[e]?r[e]:""}function $i(t,i,s,e){const n=Number(t),r=Number(i);$(!isNaN(n),"CALC macro - left operand must be a number"),$(!isNaN(r),"CALC macro - right operand must be a number");let o=0;switch(s){case"add":o=n+r;break;case"subtract":o=n-r;break;case"multiply":o=n*r;break;case"divide":$(r,"CALC macro - cannot divide by 0"),o=n/r;break;default:H().error(Li,"CALC macro - Invalid operation")}return Ki(e)?Math.round(o):o}function Bi(t){if(null==t)return"";if(n(t))return t.map(Bi).join(",");const{argList:i,name:s}=Gi(String(t));return encodeURIComponent(s)+i}function Gi(t){if(!t)return{name:"",argList:""};const i=t.match(Di);return $(i,"Variable with invalid format found: "+t),{name:i[1]||i[0],argList:i[2]||""}}function Wi(t){return G(t,"amp-analytics-variables")}function zi(t){return z(t,"amp-analytics-variables")}function Yi(t){return function(t,i="default"){return ft(t).then((t=>t?t.whenPolicyResolved(i):null))}(t).then((t=>t?xi[t]:null))}function Ki(t){return"false"!==t&&""!==t&&"0"!==t&&"null"!==t&&"NaN"!==t&&"undefined"!==t}var Xi="amp-analytics/config";function Ji(t,i,s){null==i&&(i={}),$(s||!t||!t.optout||"_gaUserPrefs.ioo"==t.optout||"__gaOptOutExtension"==t.optoutElementId,"optout property is only available to vendor config.");for(const e in t)$(s||"iframePing"!=e,"iframePing config is only available to vendor config."),f(t,e)&&(n(t[e])?(n(i[e])||(i[e]=[]),i[e]=Ji(t[e],i[e],s)):a(t[e])?(a(i[e])||(i[e]={}),i[e]=Ji(t[e],i[e],s)):i[e]=t[e]);return i}function Zi(t){if(!t.requests)return t;for(const s in t.requests)f(t.requests,s)&&(t.requests[s]=a(i=t.requests[s])?i:{"baseUrl":i});var i;return function(t){if(f(t,"requests")&&f(t,"requestOrigin")){const i=t.requestOrigin;for(const s in t.requests)f(t.requests[s],"origin")||(t.requests[s].origin=i)}return t}(t)}var Qi=31536e6,ts=!1,is=/nochunking=1/.test(self.location.hash),ss=s();function es(t,i,s){is?ss.then(i):function(t){return function(t,i,s,e){const n=J(t);tt(Z(n),n,"chunk",s)}(t,0,hs),G(t,"chunk")}(t).run(i,s)}var ns="not_run",rs=class{constructor(t){this.state=ns,this.Oi=t}Ci(t){if("run"!=this.state){this.state="run";try{this.Oi(t)}catch(t){throw this.ki(t),t}}}Ni(){return this.Oi.displayName||this.Oi.name}ki(t){}Di(){return!1}Li(){return!1}},os=class extends rs{constructor(t,i,s){super(t),this.Ui=s}ki(t){var i;q((i=self.document).defaultView),ts||(ts=!0,function(t){!function(t,i){for(const s in i)ni(t,s,i[s])}(t.body,{opacity:1,visibility:"visible","animation":"none"})}(i))}Di(){return this.$i()}Li(){return this.Ui.Fi}$i(){return this.Ui.ampdoc.isVisible()}},hs=class{constructor(t){var i;this.ampdoc=t,this.i=t.win,this.Bi=new class{constructor(){this.Vi=[]}peek(){const t=this.length;return t?this.Vi[t-1].item:null}enqueue(t,i){if(isNaN(i))throw new Error("Priority must not be NaN.");const s=this.Si(i);this.Vi.splice(s,0,{item:t,priority:i})}Si(t){let i=-1,s=0,e=this.length;for(;s<=e&&(i=Math.floor((s+e)/2),i!==this.length);)if(this.Vi[i].priority0&&this.Vi[i-1].priority>=t))break;e=i-1}return i}forEach(t){let i=this.length;for(;i--;)t(this.Vi[i].item)}dequeue(){const t=this.Vi.pop();return t?t.item:null}get length(){return this.Vi.length}},this.Hi=this.ji.bind(this),this.zi=0,this.Gi=!(!this.i.navigator.scheduling||!this.i.navigator.scheduling.isInputPending),this.qi=!1,this.xi=this.i.document.documentElement.hasAttribute("i-amphtml-no-boilerplate"),this.i.addEventListener("message",(t=>{"amp-macro-task"==pt(t)&&this.ji(null)})),this.Fi=!1,(i=t,z(i,"viewer")).then((()=>{this.Fi=!0})),t.onVisibilityChanged((()=>{t.isVisible()&&this.Wi()}))}run(t,i){const s=new rs(t);this.Ki(s,i)}runForStartup(t){const i=new os(t,this.i,this);this.Ki(i,Number.POSITIVE_INFINITY)}Ki(t,i){this.Bi.enqueue(t,i),this.Wi()}Yi(t){let i=this.Bi.peek();for(;i&&i.state!==ns;)this.Bi.dequeue(),i=this.Bi.peek();return i&&t&&this.Bi.dequeue(),i}ji(t){const i=this.Yi(!0);if(!i)return this.qi=!1,this.zi=0,!1;let s;try{s=Date.now(),i.Ci(t)}finally{ss.then().then().then().then().then().then().then().then().then((()=>{this.qi=!1,this.zi+=Date.now()-s,this.Wi()}))}return!0}Ji(t){if(this.xi&&(this.Gi?this.i.navigator.scheduling.isInputPending():this.zi>5))return this.zi=0,void this.Qi();ss.then((()=>{this.Hi(t)}))}Wi(){if(this.qi)return;const t=this.Yi();return t?t.Di()?(this.qi=!0,void this.Ji(null)):void(t.Li()&&this.i.requestIdleCallback?function(t,i,s,e){const n=Date.now();t.requestIdleCallback((function i(s){if(s.timeRemaining()<15){const r=2e3-(Date.now()-n);r<=0||s.didTimeout?e(s):t.requestIdleCallback(i,{timeout:r})}else e(s)}),{timeout:2e3})}(this.i,0,0,this.Hi):this.Qi()):void 0}Qi(){this.i.postMessage("amp-macro-task","*")}},us="amp-analytics/cookie-writer",cs={"referrerDomains":!0,"enabled":!0,"cookiePath":!0,"cookieMaxAge":!0,"cookieSecure":!0,"cookieDomain":!0,"sameSite":!0,"SameSite":!0,"secure":!0},as=class{constructor(){this.Et=null}add(t){return this.Et||(this.Et=[]),this.Et.push(t),()=>{this.remove(t)}}remove(t){this.Et&&function(t,i){const s=t.indexOf(i);-1!=s&&t.splice(s,1)}(this.Et,t)}removeAll(){this.Et&&(this.Et.length=0)}fire(t){if(this.Et)for(const i of this.Et.slice())i(t)}getHandlerCount(){var t,i;return null!==(t=null===(i=this.Et)||void 0===i?void 0:i.length)&&void 0!==t?t:0}},ls="video-session-visible",fs="video-seconds-played",ds=["video-ended","video-pause","video-play","video-session","video-session-visible","video-seconds-played","video-hosted-custom","video-percentage-played","video-ad-start","video-ad-end"],_s=/^vars(.+)/,ms=function(){},As="amp-analytics/events",Ps="click",ps="browser-event",Ts="custom",Es="hidden",gs="ini-load",Is="render-start",vs="scroll",Rs="story",Ms="timer",bs="video",Ss="visible",ys=["ampdoc","embed"],ws=Object.freeze({[Ps]:{name:Ps,allowedFor:ys.concat(["timer"]),klass:function(t){return new Us(t)}},[ps]:{name:ps,allowedFor:ys.concat(["timer"]),klass:function(t){return new Ls(t)}},[Ts]:{name:Ts,allowedFor:ys.concat(["timer"]),klass:function(t){return new Ds(t)}},[Es]:{name:Ss,allowedFor:ys.concat(["timer"]),klass:function(t){return new Bs(t)}},[gs]:{name:gs,allowedFor:ys.concat(["timer","visible"]),klass:function(t){return new Fs(t)}},[Is]:{name:Is,allowedFor:ys.concat(["timer","visible"]),klass:function(t){return new js(t)}},[vs]:{name:vs,allowedFor:ys.concat(["timer"]),klass:function(t){return new Hs(t)}},[Rs]:{name:Rs,allowedFor:ys,klass:function(t){return new xs(t)}},[Ms]:{name:Ms,allowedFor:ys,klass:function(t){return new qs(t)}},[bs]:{name:bs,allowedFor:ys.concat(["timer"]),klass:function(t){return new $s(t)}},[Ss]:{name:Ss,allowedFor:ys.concat(["timer"]),klass:function(t){return new Bs(t)}}});function Os(t){$(!n(t)||new Set(t).size===t.length,"Cannot have duplicate selectors in selectors list: %s",t)}function Vs(t){return t.startsWith("video")?bs:"blur"===(i=t)||"change"===i?ps:t.startsWith("story")?Rs:function(t){return"click"===(i=t)||"browser-event"===i||"custom"===i||"hidden"===i||"ini-load"===i||"render-start"===i||"scroll"===i||"story"===i||"timer"===i||"video"===i||"visible"===i;var i}(t)?f(ws,t)?ws[t].name:t:Ts;var i}function Ns(t){const i={};return Object.keys(ws).forEach((s=>{f(ws,s)&&-1!=ws[s].allowedFor.indexOf(t)&&(i[s]=ws[s].klass)})),i}var Cs=class{constructor(t,i,s={},e=!0){this.target=t,this.type=i,this.vars=e?function(t,i){const s=I(t,void 0,_s);return d(s,i,0),s}(t,s):s}},ks=class{constructor(t){this.root=t}dispose(){}add(t,i,s,e){}},Ls=class extends ks{constructor(t){super(t),this.tTt=new as,this.iTt={},this.sTt=this.tTt.fire.bind(this.tTt),this.eTt=function(t,i,s){let e=0,n=0,r=null;function o(){e=0;const s=500-(t.Date.now()-n);var h;s>0?e=t.setTimeout(o,s):(h=r,r=null,i.apply(null,h))}return function(...i){n=t.Date.now(),r=i,e||(e=t.setTimeout(o,500))}}(this.root.ampdoc.win,this.sTt)}dispose(){const t=this.root.getRoot();Object.keys(this.iTt).forEach((i=>{t.removeEventListener(i,this.eTt)})),this.sTt=null,this.tTt=null}add(t,i,s,e){$(function(t,i){const s=function(t){var i,s,e,r,o;if(t[yt])return t[yt];t[yt]=l();const h=t[yt];m(h);const u=St(St({},null!==(i=t.AMP_CONFIG)&&void 0!==i?i:{}),null!==(s=t.AMP_EXP)&&void 0!==s?s:A((null===(e=t.__AMP_EXP)||void 0===e?void 0:e.textContent)||"{}"));for(const t in u){const i=u[t];"number"==typeof i&&i>=0&&i<=1&&(h[t]=Math.random(){t.type===r&&u.then((i=>{i.forEach((i=>{const s=t.target;i.contains(s)&&e(new Cs(i,r,{}))}))}))}))}},Ds=class extends ks{constructor(t){super(t),this.tTt={},this.nTt={},this.rTt={},setTimeout((()=>{this.nTt=void 0}),1e4)}dispose(){this.nTt=void 0,this.rTt=void 0;for(const t in this.tTt)this.tTt[t].removeAll()}add(t,i,s,e){let n=s.selector;n||(n=":root");const r=s.selectionMethod||null,o=this.root.getElement(t,n,r),h=i.startsWith("sandbox-"),u=h?this.rTt&&this.rTt[i]:this.nTt&&this.nTt[i];if(u){const t=u.length;o.then((s=>{setTimeout((()=>{for(let i=0;i{o.then((i=>{i.contains(t.target)&&e(t)}))}))}trigger(t){const i=t.type,s=i.startsWith("sandbox-"),e=this.tTt[i];e&&(e.fire(t),s)||(s?(this.rTt[i]=this.rTt[i]||[],this.rTt[i].push(t)):this.nTt&&(this.nTt[i]=this.nTt[i]||[],this.nTt[i].push(t)))}},xs=class extends Ds{constructor(t){super(t)}add(t,i,s,e){const n=this.root.getRootElement(),r=this.nTt&&this.nTt[i];if(r){const t=r.length;for(let i=0;i{this.oTt(t,n,s,e)}))}oTt(t,i,s,e){const n=t.type,r=t.vars,o=s.storySpec||{},h=void 0===o.repeat||o.repeat,u=r.eventDetails,c=s.tagName;c&&u.tagName&&c.toLowerCase()!==u.tagName||!1===h&&u.repeated||e(new Cs(i,n,r))}trigger(t){const i=t.type,s=this.tTt[i];s&&s.fire(t),this.nTt&&(this.nTt[i]=this.nTt[i]||[],this.nTt[i].push(t))}},Us=class extends ks{constructor(t){super(t),this.hTt=new as,this.uTt=this.hTt.fire.bind(this.hTt),this.root.getRoot().addEventListener("click",this.uTt)}dispose(){this.root.getRoot().removeEventListener("click",this.uTt),this.hTt.removeAll()}add(t,i,s,e){const n=$(s.selector,"Missing required selector on click trigger"),r=s.selectionMethod||null;return this.hTt.add(this.root.createSelectiveListener(this.Ec.bind(this,e),t.parentElement||t,n,r))}Ec(t,i,s){t(new Cs(i,"click"))}},Hs=class extends ks{constructor(t){super(t),this.Jo=t,this.cTt=null}dispose(){null!==this.cTt&&(this.Jo.getScrollManager().removeScrollHandler(this.cTt),this.cTt=null)}add(t,i,s,e){if(!s.scrollSpec)return H().error(As,"Missing scrollSpec on scroll trigger."),ms;if(!Array.isArray(s.scrollSpec.verticalBoundaries)&&!Array.isArray(s.scrollSpec.horizontalBoundaries))return H().error(As,"Boundaries are required for the scroll trigger to work."),ms;const n=this.aTt(s.scrollSpec.verticalBoundaries),r=this.aTt(s.scrollSpec.horizontalBoundaries),o=!!s.scrollSpec.useInitialPageSize;return this.cTt=this.Xa.bind(this,r,n,o,e),this.Jo.getScrollManager().addScrollHandler(this.cTt)}Xa(t,i,s,e,n){const{scrollHeight:r,scrollWidth:o}=s?n.initialSize:n;this.lTt(i,100*(n.top+n.height)/r,"verticalScrollBoundary",e),this.lTt(t,100*(n.left+n.width)/o,"horizontalScrollBoundary",e)}aTt(t){const i={};if(!t||!Array.isArray(t))return i;for(let s=0;si||t[r])continue;t[r]=!0;const o={};o[s]=n,e(new Cs(this.Jo.getRootElement(),vs,o,!1))}}},js=class extends ks{constructor(t){super(t)}dispose(){}add(t,i,s,e){let n,r;const o=s.selector||":root";if(":root"==o||":host"==o)n=this.root.getRootElement(),r=this.getRootSignal(i);else{const e=s.selectionMethod;r=this.root.getAmpElement(t.parentElement||t,o,e).then((t=>(n=t,this.getElementSignal(i,n))))}return r.then((()=>{e(new Cs(n,i))})),ms}getRootSignal(t){return this.root.signals().whenSignal(t)}getElementSignal(t,i){return"function"!=typeof i.signals?s():i.signals().whenSignal(t)}},Fs=class extends ks{constructor(t){super(t)}dispose(){}add(t,i,s,e){let n,r;const o=s.selector||":root";if(":root"==o||":host"==o)n=this.root.getRootElement(),r=this.getRootSignal();else{const i=s.selectionMethod;r=this.root.getAmpElement(t.parentElement||t,o,i).then((t=>(n=t,this.getElementSignal("ini-load",n))))}return r.then((()=>{e(new Cs(n,i))})),ms}getRootSignal(){return this.root.whenIniLoaded()}getElementSignal(t,i){if("function"!=typeof i.signals)return s();const e=i.signals();return Promise.race([e.whenSignal("ini-load"),e.whenSignal("load-end")])}},qs=class extends ks{constructor(t){super(t),this.fTt={},this.dTt=1}getTrackedTimerKeys(){return Object.keys(this.fTt)}dispose(){this.getTrackedTimerKeys().forEach((t=>{this._Tt(t)}))}add(t,i,s,e){const n=s.timerSpec;$(n&&"object"==typeof n,"Bad timer specification");const r="startSpec"in n?n.startSpec:null;$(!r||"object"==typeof r,"Bad timer start specification");const o="stopSpec"in n?n.stopSpec:null;$(!r&&!o||"object"==typeof o,"Bad timer stop specification");const h=this.mTt();let u,c;if(r){const s=this.ATt(r);$(s,"Cannot track timer start"),u=s.add.bind(s,t,r.on,r,this.PTt.bind(this,h,i,e))}if(o){const s=this.ATt(o);$(s,"Cannot track timer stop"),c=s.add.bind(s,t,o.on,o,this.PTt.bind(this,h,i,e))}const a=new class{constructor(t,i,s){this.pTt=void 0,$("interval"in t,"Timer interval specification required"),this.TTt=Number(t.interval)||0,$(this.TTt>=.5,"Bad timer interval specification"),this.ETt="maxTimerLength"in t?Number(t.maxTimerLength):7200,$(this.ETt>0,"Bad maxTimerLength specification"),this.gTt="maxTimerLength"in t,this.ITt=!("immediate"in t)||Boolean(t.immediate),this.vTt=null,this.RTt=null,this.MTt=null,this.bTt=i||null,this.STt=s||null,this.Mn=void 0,this.yTt=void 0}init(t){this.bTt?this.wTt():t()}dispose(){this.OTt(),this.VTt()}wTt(){this.bTt&&(this.RTt=this.bTt())}VTt(){this.RTt&&(this.RTt(),this.RTt=null)}NTt(){if(this.STt)try{this.MTt=this.STt()}catch(t){throw this.dispose(),t}}OTt(){this.MTt&&(this.MTt(),this.MTt=null)}isRunning(){return!!this.pTt}startIntervalInWindow(t,i,s){this.isRunning()||(this.Mn=Date.now(),this.yTt=void 0,this.vTt=i,this.pTt=t.setInterval((()=>{i()}),1e3*this.TTt),(!this.STt||this.STt&&this.gTt)&&t.setTimeout((()=>{s()}),1e3*this.ETt),this.VTt(),this.ITt&&i(),this.NTt())}CTt(t){this.isRunning()&&(this.vTt(),this.vTt=null,t.clearInterval(this.pTt),this.pTt=void 0,this.yTt=void 0,this.OTt(),this.wTt())}kTt(){return this.Mn?Date.now()-(this.yTt||this.Mn):0}getTimerVars(){let t=0;return this.isRunning()&&(t=this.kTt(),this.yTt=Date.now()),{"timerDuration":t,"timerStart":this.Mn||0}}}(n,u,c);return this.fTt[h]=a,a.init(this.LTt.bind(this,h,i,e)),()=>{this._Tt(h)}}mTt(){return++this.dTt}ATt(t){const i=Vs(H().assertString(t.on));return this.root.getTrackerForAllowlist(i,Ns("timer"))}PTt(t,i,s){const e=this.fTt[t];e&&(e.isRunning()?this.CTt(t):this.LTt(t,i,s))}LTt(t,i,s){this.fTt[t].startIntervalInWindow(this.root.ampdoc.win,(()=>{s(this.DTt(t,i))}),this._Tt.bind(this,t))}CTt(t){this.fTt[t].CTt(this.root.ampdoc.win)}DTt(t,i){return new Cs(this.root.getRootElement(),i,this.fTt[t].getTimerVars(),!1)}_Tt(t){this.fTt[t]&&(this.CTt(t),this.fTt[t].dispose(),delete this.fTt[t])}},$s=class extends ks{constructor(t){super(t),this.xTt=new as,this.sTt=this.xTt.fire.bind(this.xTt),ds.forEach((t=>{this.root.getRoot().addEventListener(t,this.sTt)}))}dispose(){const t=this.root.getRoot();ds.forEach((i=>{t.removeEventListener(i,this.sTt)})),this.sTt=null,this.xTt=null}add(t,i,s,e){const n=s.videoSpec||{},r=$(s.selector||n.selector,"Missing required selector on video trigger");$(r.length,"Missing required selector on video trigger"),Os(r);const o=s.selectionMethod||null,h=this.root.getElements(t,r,o,!1),u=n["end-session-when-invisible"],c=n["exclude-autoplay"],a=n.interval,l=n.percentages,f=s.on;let d=0,m=0;return this.xTt.add((t=>{const{type:i}=t,s=pt(t),n=function(t,i){return t==ls?"video-session":"video-hosted-custom"==t?i["__amp:eventType"]:t}(i,s);if(n!==f)return;if(n===fs&&!a)return void H().error(As,"video-seconds-played requires interval spec with non-zero value");if(n===fs&&(d++,d%a!=0))return;if("video-percentage-played"===n){if(!l)return void H().error(As,"video-percentage-played requires percentages spec.");for(let t=0;t1)return;if(l.indexOf(i)<0)return;m=i}if(i===ls&&!u)return;if(c&&"playing_auto"===s.state)return;const r=t.target;h.then((t=>{t.forEach((t=>{if(!t.contains(r))return;const i=function(t){if(!t)return{};const i=St({},t);return delete i["__amp:eventType"],i}(s);e(new Cs(t,n,i))}))}))}))}},Bs=class extends ks{constructor(t){super(t),this.UTt={}}dispose(){}add(t,i,s,e){const n=s.visibilitySpec||{},r=s.selector||n.selector,o=n.waitFor;let h=n.reportWhen,u=null;h&&$(!n.repeat,"reportWhen and repeat are mutually exclusive."),i===Es&&(h&&H().error(As,'ReportWhen should not be defined when eventType is "hidden"'),h="documentHidden");const c=this.root.getVisibilityManager();if("documentHidden"==h?u=this.HTt.bind(this):"documentExit"==h?u=this.jTt.bind(this):$(!h,'reportWhen value "%s" not supported.',h),!r||":root"==r||":host"==r){const t=o||(r?"ini-load":"none");return c.listenRoot(n,this.getReadyPromise(t),u,this.FTt.bind(this,i,e,this.root.getRootElement()))}const a=s.selectionMethod||n.selectionMethod;Os(r);const l=this.root.getElements(t.parentElement||t,r,a).then((t=>{const s=[];for(let r=0;r{for(let i=0;i{t.onVisibilityChanged((()=>{t.isVisible()||i()}))})):s()}jTt(){const t=new e,{win:i}=this.root.ampdoc;let s,n;return this.qTt()||i.addEventListener("unload",s=()=>{i.removeEventListener("unload",s),t.resolve()}),i.addEventListener("pagehide",n=()=>{i.removeEventListener("pagehide",n),t.resolve()}),t.promise}qTt(){return"onpagehide"in this.root.ampdoc.win}getReadyPromise(t,i){if(i&&(function(t){const i=t.tagName;return i.startsWith("AMP-")&&!("AMP-STICKY-AD-TOP-PADDING"==i||"AMP-BODY"==i)}(i)?t=t||"ini-load":$(!t||"none"==t,"waitFor for non-AMP elements must be none or null. Found %s",t)),!t||"none"==t)return null;const s=Ns("visible");$(void 0!==s[t],"waitFor value %s not supported",t);const e=this.UTt[t]||this.root.getTrackerForAllowlist(t,s);return e?(this.UTt[t]=e,i?e.getElementSignal(t,i):e.getRootSignal(t)):null}FTt(t,i,s,e){const n=I(s,void 0,_s);for(const t in n)e[t]=n[t];i(new Cs(s,t,e,!1))}},Gs="inside";function Ws(t,i,s,e){return{left:t,top:i,width:s,height:e,bottom:i+e,right:t+s,x:t,y:i}}function zs(t,i,s){const e=(n={top:s,bottom:s+i.getHeight(),left:0,right:i.getWidth()},Ws(Number(n.left),Number(n.top),Number(n.width),Number(n.height)));var n,r,o;return o=e,(r=t).top<=o.bottom&&o.top<=r.bottom&&r.left<=o.right&&o.left<=r.right?Gs:function(t,i){return t.topi.bottom?"bottom":Gs}(t,e)}function Ys(t){const i=function(t){const i=[];if(!t)return i;let s,e=t;i.push(e);for(let t=0;t<50;t++)if(s=e.parentNode||e.parentElement,s&&1==s.nodeType)e=s,i.push(e);else{if(!s||9!=s.nodeType)break;if(s=e.ownerDocument.defaultView.frameElement,!s||1!=s.nodeType)break;e=s,i.push(e)}return i}(t.parentElement);i.push(t);let s,e=1;for(let t=0;t{this.zTt.fire()})),this.XTt=[],this.JTt=Date.now(),this.Gt=!0,this.ZTt=!0,this.QTt=null,this.iEt=null,this.oEt=!1,this.hEt=!1,this.uEt=0,this.cEt=0,this.aEt=0,this.lEt=0,this.fEt=0,this.uu=0,this.Nt=0,this.dEt=0,this._Et=0,this.mEt=0,this.AEt=0,this.PEt=0,this.pEt=!1,this.TEt=!1,this.EEt=null}bs(){q(!this.KTt);const t=new e;this.YTt=t.promise,this.KTt=t.resolve,this.YTt.then((()=>{this.zTt.fire()})),this.EEt=null,this.hEt=!1,this.oEt=!1,this.uEt=0,this.cEt=0,this.aEt=0,this.uu=0,this.lEt=0,this.fEt=0,this.Nt=0,this._Et=0,this.mEt=0,this.AEt=0,this.TEt=!1}maybeDispose(){this.WTt||this.dispose()}dispose(){this.iEt&&(clearTimeout(this.iEt),this.iEt=null),this.EEt&&(clearTimeout(this.EEt),this.EEt=null),this.XTt.forEach((t=>{t()})),this.XTt.length=0,this.KTt=null,this.zTt&&(this.zTt.removeAll(),this.zTt=null)}unsubscribe(t){this.XTt.push(t)}onTriggerEvent(t){this.zTt&&this.zTt.add(t),this.YTt&&!this.KTt&&t()}setReady(t){this.Gt=t,this.update()}setReportReady(t){this.ZTt=!1,this.QTt=t}gEt(){return this.Gt?this.$Tt():0}update(){this.if(this.gEt())}getState(t){return{"firstSeenTime":Js(this.lEt,t),"lastSeenTime":Js(this.fEt,t),"lastVisibleTime":Js(this.Nt,t),"firstVisibleTime":Js(this.uu,t),"maxContinuousVisibleTime":this.cEt,"totalVisibleTime":this.aEt,"loadTimeVisibility":100*this.dEt||0,"minVisiblePercentage":100*this._Et,"maxVisiblePercentage":100*this.mEt}}if(t){if(this.TEt)this.IEt(t)||this.bs();else if(this.KTt)if(this.vEt(t)||this.GTt){if(this.iEt&&(clearTimeout(this.iEt),this.iEt=null),this.ZTt)this.KTt(),this.KTt=null,this.WTt&&(this.TEt=!0,this.uEt=0);else if(this.QTt){const t=this.QTt();this.QTt=null,t.then((()=>{this.ZTt=!0,this.update()}))}}else if(this.oEt&&!this.iEt){const t=this.REt();t>0&&(this.iEt=setTimeout((()=>{this.iEt=null,this.update()}),t))}else!this.oEt&&this.iEt&&(clearTimeout(this.iEt),this.iEt=null)}IEt(t){return q(t>=0&&t<=1),1==this.BTt.visiblePercentageMin?1==t:0==this.BTt.visiblePercentageMax?0==t:t>this.BTt.visiblePercentageMin&&t<=this.BTt.visiblePercentageMax}vEt(t){q(t>=0&&t<=1);const i=Date.now();t>0&&(this.lEt=this.lEt||i,this.fEt=i,!this.dEt&&i-this.JTt<300&&(this.dEt=t));const s=this.oEt,e=this.AEt?i-this.AEt:0;return this.oEt=this.IEt(t),this.oEt?(this.hEt=!0,s?(this.aEt+=e,this.uEt+=e,this.cEt=Math.max(this.cEt,this.uEt)):(q(!this.AEt),this.uu=this.uu||i),this.AEt=i,this._Et=this._Et>0?Math.min(this._Et,t):t,this.mEt=Math.max(this.mEt,t),this.Nt=i):s&&(q(this.AEt>0),this.cEt=Math.max(this.cEt,this.uEt+e),this.AEt=0,this.aEt+=e,this.uEt=0,this.Nt=i),this.hEt&&this.aEt>=this.BTt.totalTimeMin&&this.aEt<=this.BTt.totalTimeMax&&this.cEt>=this.BTt.continuousTimeMin&&this.cEt<=this.BTt.continuousTimeMax}maybeSetInitialScrollDepth(t){this.pEt||(this.PEt=t,this.pEt=!0)}getInitialScrollDepth(){return this.PEt}REt(){const t=Math.max(this.BTt.continuousTimeMin-this.uEt,0),i=Math.max(this.BTt.totalTimeMin-this.aEt,0),s=Math.max(t,i);return Math.min(s,t||1/0,i||1/0)}};function Js(t,i){return t>=i?t-i:0}var Zs="amp-analytics/visibility-manager",Qs="__AMP_VIS",te=[0,.05,.1,.15,.2,.25,.3,.35,.4,.45,.5,.55,.6,.65,.7,.75,.8,.85,.9,.95,1],ie=1;function se(t){let i=t.__AMP_VIS_ID;return i||(i=++ie,t.__AMP_VIS_ID=i),i}function ee(t){return t[Qs]||(t[Qs]=function(t){const i=ot(t),s=X(t),e=s&&li(s),n=s&&function(t){if(Node.prototype.getRootNode)return t.getRootNode();let i;for(i=t;i.parentNode&&(!(s=i)||"I-AMPHTML-SHADOW-ROOT"!=s.tagName&&(11!=s.nodeType||"[object ShadowRoot]"!==Object.prototype.toString.call(s)));i=i.parentNode);var s;return i}(s);return e&&n?new oe(ee(n),e):new re(i)}(t)),t[Qs]}var ne=class{constructor(t,i){this.parent=t,this.ampdoc=i,this.MEt=0,this.bEt=[],this.ZQ=null,this.XTt=[],this.SEt=0,this.parent&&this.parent.yEt(this);const s=_t(this.ampdoc);s.onChanged((()=>{this.maybeUpdateMaxScrollDepth(s.getScrollTop())}))}yEt(t){this.ZQ||(this.ZQ=[]),this.ZQ.push(t)}wEt(t){if(this.ZQ){const i=this.ZQ.indexOf(t);-1!=i&&this.ZQ.splice(i,1)}}dispose(){this.setRootVisibility(0);for(let t=this.bEt.length-1;t>=0;t--)this.bEt[t].dispose();if(this.XTt.forEach((t=>{t()})),this.XTt.length=0,this.parent&&this.parent.wEt(this),this.ZQ)for(let t=0;t0?this.MEt:0:this.MEt}setRootVisibility(t){if(this.MEt=t,this.OEt(),this.ZQ)for(let t=0;tthis.SEt&&(this.SEt=t)}getMaxScrollDepth(){return this.SEt}OEt(){for(let t=0;t{};for(let c=0;c100||l>f||l==f&&100!=l&&0!=f){H().error(Zs,"visiblePercentageThresholds entry invalid min/max value");continue}const d=i;d.visiblePercentageMin=l,d.visiblePercentageMax=f;const m=new Xs(d,t,_t(this.ampdoc));h.push(this.Bx(m,i,s,e,r,o))}return()=>{h.forEach((t=>t()))}}const h=new Xs(i,t,_t(this.ampdoc));return this.Bx(h,i,s,e,r,o)}Bx(t,i,s,e,n,r){e&&t.setReportReady(e);const o=_t(this.ampdoc),h=o.getScrollTop();return this.maybeUpdateMaxScrollDepth(h),s?(t.setReady(!1),s.then((()=>{t.setReady(!0),t.maybeSetInitialScrollDepth(h)}))):t.maybeSetInitialScrollDepth(h),t.onTriggerEvent((()=>{const i=this.getStartTime(),s=t.getState(i);let e;if(s.backgrounded=this.isBackgrounded()?1:0,s.backgroundedAtStart=this.isBackgroundedAtStart()?1:0,s.totalTime=Date.now()-i,r){s.elementId=r.id,s.opacity=Ys(r),e=o.getLayoutRect(r);const t=this.getElementVisibility(r),i=this.getElementIntersectionRect(r);Object.assign(s,{"intersectionRatio":t,"intersectionRect":JSON.stringify(i)})}else s.opacity=this.getRootMinOpacity(),s.intersectionRatio=this.getRootVisibility(),e=this.getRootLayoutBox();t.maybeDispose(),e&&(Object.assign(s,{"elementX":e.left,"elementY":e.top,"elementWidth":e.width,"elementHeight":e.height}),s.initialScrollDepth=zs(e,o,t.getInitialScrollDepth()),s.maxScrollDepth=zs(e,o,this.getMaxScrollDepth())),n(s)})),this.bEt.push(t),t.unsubscribe((()=>{const i=this.bEt.indexOf(t);-1!=i&&this.bEt.splice(i,1)})),r&&t.unsubscribe(this.observe(r,(()=>t.update()))),t.update(),function(){t.dispose()}}observe(t,i){}getElementVisibility(t){}getElementIntersectionRect(t){}},re=class extends ne{constructor(t){if(super(null,t),this.vu=_t(t),this.NEt=!t.isVisible(),this.CEt=this.isBackgrounded(),this.kEt=l(),this.hw=null,"inabox"==C(this.ampdoc.win).runtime){const t=this.ampdoc.getRootNode(),i=t.documentElement||t.body||t;this.unsubscribe(this.observe(i,this.setRootVisibility.bind(this)));const s=()=>{const t=se(i),s=this.kEt[t];s&&(this.ampdoc.win.innerHeight<1||this.ampdoc.win.innerWidth<1?s.isVisible=!1:s.isVisible=!0,this.setRootVisibility(s.isVisible?s.intersectionRatio:0))};this.ampdoc.win.addEventListener("resize",s),this.unsubscribe((()=>{this.ampdoc.win.removeEventListener("resize",s)}))}else this.setRootVisibility(this.ampdoc.isVisible()?1:0),this.unsubscribe(this.ampdoc.onVisibilityChanged((()=>{const t=this.ampdoc.isVisible();t||(this.NEt=!0),this.setRootVisibility(t?1:0)})))}dispose(){super.dispose(),this.hw&&(this.hw.disconnect(),this.hw=null)}getStartTime(){return this.ampdoc.getFirstVisibleTime()}isBackgrounded(){return this.NEt}isBackgroundedAtStart(){return this.CEt}getRootMinOpacity(){const t=this.ampdoc.getRootNode();return Ys(t.documentElement||t.body||t)}getRootLayoutBox(){const t=this.ampdoc.getRootNode(),i=t.documentElement||t.body||t;return this.vu.getLayoutRect(i)}observe(t,i){const s=se(t);let e=this.kEt[s];return e?e.intersectionRatio>0&&e.isVisible&&i(e.intersectionRatio):(e={element:t,intersectionRatio:0,intersectionRect:null,isVisible:!1,boundingClientRect:null,listeners:[]},this.kEt[s]=e),e.listeners.push(i),this.LEt().observe(t),()=>{const e=this.kEt[s];if(e){const n=e.listeners.indexOf(i);-1!=n&&e.listeners.splice(n,1),0==e.listeners.length&&(this.hw.unobserve(t),delete this.kEt[s])}}}getElementVisibility(t){if(0==this.getRootVisibility())return 0;const i=se(t),s=this.kEt[i];return s&&s.isVisible&&s.intersectionRatio||0}getElementIntersectionRect(t){if(this.getElementVisibility(t)<=0)return null;const i=se(t),s=this.kEt[i];return s?s.intersectionRect:null}LEt(){if(!this.hw){const{win:t}=this.ampdoc;this.hw=new t.IntersectionObserver(this.DEt.bind(this),{threshold:te})}return this.hw}DEt(t){t.forEach((t=>{let i=t.intersectionRect;i=Ws(Number(i.left),Number(i.top),Number(i.width),Number(i.height));let{boundingClientRect:s}=t;s=s&&Ws(Number(s.left),Number(s.top),Number(s.width),Number(s.height)),this.xEt(t.target,t.intersectionRatio,i,s)}))}xEt(t,i,s,e){i=Math.min(Math.max(i,0),1);const n=se(t),r=this.kEt[n];let o=!0;if((e.width<1||e.height<1)&&(o=!1),r){r.isVisible=o,r.intersectionRatio=i,r.intersectionRect=s,r.boundingClientRect=e;for(let t=0;tthis.getRootElement(),new Promise((t=>{t(e())}))):":host"==i?new Promise((t=>{t(H().assertElement(this.getHostElement(),`Element "${i}" not found`))})):this.ampdoc.whenReady().then((()=>{let e,n=null;try{e="scope"==s?function(t,i){return t.querySelector(T(i,":scope"))}(t,i):"closest"==s?E(t,i):this.getRoot().querySelector(i)}catch(t){$(!1,`Invalid query selector ${i}`)}return e&&this.contains(e)&&(n=e),H().assertElement(n,`Element "${i}" not found`)}));var e}jEt(t,i=!0){return this.ampdoc.whenReady().then((()=>{let s=[];for(let e=0;es.indexOf(t)===i))}))}FEt(t,i){const s=[];for(let i=0;i(this.qEt([t],i),t)))}getElements(t,i,s,e=!0){return n(i)?($(!s,"Cannot have selectionMethod %s defined with an array selector.",s),this.jEt(i,e)):this.getElement(t,i,s).then((t=>[t]))}qEt(t,i){for(let s=0;s{if(":host"==s)return;const r=this.getRootElement(),o="*"==s,h=":root"==s;let{target:u}=n;for(;u&&this.contains(u)&&("scope"!=e||h||i.contains(u));)if("closest"!=e||u.contains(i)){if(o||h&&u==r||fe(u,s)){t(u,n);break}u=u.parentElement}else u=u.parentElement}}whenIniLoaded(){}getVisibilityManager(){return this.UEt||(this.UEt=ee(this.getRoot())),this.UEt}getScrollManager(){return this.HEt||(this.HEt=new class{constructor(t){this.vu=_t(t.ampdoc),this.jl=G(t.ampdoc,"mutator"),this.$Et=null,this.sr=new as,this.Jo=t.getRootElement(),this.BEt=null}dispose(){this.sr.removeAll(),this.GEt()}removeScrollHandler(t){this.sr.remove(t),this.sr.getHandlerCount()<=0&&this.GEt()}addScrollHandler(t){const i=this.vu.getSize();return this.WEt().then((s=>{const{height:e,left:n,top:r,width:o}=s,h={top:this.vu.getScrollTop()-r,left:this.vu.getScrollLeft()-n,width:i.width,height:i.height,scrollHeight:e,scrollWidth:o,initialSize:{scrollHeight:e,scrollWidth:o}};t(h)})),0===this.sr.getHandlerCount()&&this.zEt(),this.sr.add(t)}R$(t){return Promise.all([this.WEt(),this.YEt()]).then((i=>{const{height:s,width:e}=i[0],{height:n,left:r,top:o,width:h}=i[1],u={top:t.top-o,left:t.left-r,width:t.width,height:t.height,scrollWidth:h,scrollHeight:n,initialSize:{scrollHeight:s,scrollWidth:e}};this.sr.fire(u)}))}GEt(){this.$Et&&(this.$Et(),this.$Et=null)}zEt(){this.$Et=this.vu.onChanged(this.R$.bind(this))}WEt(){return q(this.BEt||this.YEt())}YEt(){const t=this.jl.measureElement((()=>this.vu.getLayoutRect(this.Jo)));return this.BEt=this.BEt||t,t}}(this)),this.HEt}},ae=class extends ce{constructor(t){super(t)}getType(){return"ampdoc"}getRoot(){return this.ampdoc.getRootNode()}getHostElement(){return null}signals(){return this.ampdoc.signals()}getElementById(t){return this.ampdoc.getElementById(t)}whenIniLoaded(){const t=_t(this.ampdoc);let i;if("inabox"==C(this.ampdoc.win).runtime)i=t.getLayoutRect(this.getRootElement());else{const s=t.getSize();i=Ws(0,0,s.width,s.height)}return s=this.ampdoc,this.ampdoc.win,function(t,i){const s=ot(t);return s.signals().whenSignal("ready-scan").then((()=>{const t=(t=>G(t,"resources"))(s).get().filter((t=>!(i&&!t.prerenderAllowed()||he.includes(t.element.tagName)))).map((t=>t.element));return 0===t.length?Promise.resolve([]):new Promise((i=>{const{win:e}=s,n=new e.IntersectionObserver((t=>{n.disconnect();const s=[];for(let i=0;iPromise.all(t.map((t=>t.whenLoaded())))))}))}(s,e);var s,e}},le=class extends ce{constructor(t,i){super(t),this.embed=i}getType(){return"embed"}getRoot(){return this.embed.win.document}getHostElement(){return this.embed.iframe}signals(){return this.embed.signals()}getElementById(t){return this.embed.win.document.getElementById(t)}whenIniLoaded(){return this.embed.whenIniLoaded()}};function fe(t,i){try{return function(t,i){return t.matches(i)}(t,i)}catch(t){return H().error("amp-analytics/analytics-root","Bad query selector.",i,t),!1}}var de="__AMP_AN_ROOT";function _e(t,i){return me(t)===me(i)}function me(t){return t.replace(/^(?:www\.|m\.|amp\.)+/,"")}function Ae(t,i){const s=i.replace(/[-\/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");return new RegExp("^"+s+"$").test(t)}var Pe={"AMPDOC_HOST":!0,"AMPDOC_HOSTNAME":!0,"AMPDOC_URL":!0,"AMP_VERSION":!0,"AVAILABLE_SCREEN_HEIGHT":!0,"AVAILABLE_SCREEN_WIDTH":!0,"BACKGROUND_STATE":!0,"BROWSER_LANGUAGE":!0,"CANONICAL_HOST":!0,"CANONICAL_HOSTNAME":!0,"CANONICAL_PATH":!0,"CANONICAL_URL":!0,"DOCUMENT_CHARSET":!0,"FIRST_CONTENTFUL_PAINT":!0,"FIRST_VIEWPORT_READY":!0,"MAKE_BODY_VISIBLE":!0,"RANDOM":!0,"SCREEN_COLOR_DEPTH":!0,"SCREEN_HEIGHT":!0,"SCREEN_WIDTH":!0,"SOURCE_HOST":!0,"SOURCE_HOSTNAME":!0,"SOURCE_PATH":!0,"SOURCE_URL":!0,"TIMESTAMP":!0,"TIMEZONE":!0,"TIMEZONE_CODE":!0,"USER_AGENT":!0,"VIEWPORT_HEIGHT":!0,"VIEWPORT_WIDTH":!0},pe="${extraUrlParams}",Te={"default":new class{generateRequest(t,i,s=!1){return s?{url:t.replace(pe,""),payload:JSON.stringify(i.extraUrlParams)}:{url:Ee(t,[i])}}generateBatchRequest(t,i,s=!1){return s?{url:t.replace(pe,""),payload:JSON.stringify(i.map((t=>t.extraUrlParams)))}:{url:Ee(t,i)}}}};function Ee(t,i){const s=i.map((t=>$t(t.extraUrlParams))).filter(Boolean).join("&");let e;return e=t.indexOf(pe)>=0?t.replace(pe,s):Ft(t,s),e}var ge=class{constructor(t,i,s,e,n){this.za=t,this._i=t.getAmpDoc(),this.win=this._i.win,this.KEt=i.origin,this.baseUrl=q(i.baseUrl),this.XEt=i.batchInterval,this.JEt=Number(i.reportWindow)||null,this.ZEt=null,this.rT=Wi(t),this.vj=lt(t),this.wv=dt(t),this.QEt=null,this.tIt=null,this.iIt=[],this.sIt=s,this.aI=e,this.Sn=n?Pe:void 0,this.eIt=null,this.nIt=null,this.rIt=!0,this.oIt=null,this.Net=0,this.Mn=Date.now(),this.hIt(),this.uIt()}send(t,i,s){const e=!0===i.important;if(!this.rIt&&!e)return;this.Net++,this.oIt=i;const n=this.rT.getMacros(this.za);var o,h,u;if(n.RESOURCE_TIMING=(o=this.za,h=i.resourceTimingSpec,u=this.Mn,h&&Date.now()36||null!=e.responseAfter&&"number"!=typeof e.responseAfter)return i.done=!0,Promise.resolve("");var e;let n=function(t){return t.performance.getEntriesByType("resource")}(s);n.length>=150&&(i.done=!0);const o=i.responseAfter||0;return i.responseAfter=Math.max(o,s.performance.now()),n=n.filter((t=>t.startTime+t.duration>=o)),n.length?(h=()=>function(t,i,s){const e=i.resources,n=i.encoding,o=Wi(s),h=(t,i=0)=>Math.round(t-i).toString(n.base||10),u=function(t,i){const s=function(t){const i={};for(const s in t){const e=t[s].host||"",n=t[s].path||"",r=t[s].query||"",o={name:s,pathPattern:new RegExp(n),queryPattern:new RegExp(r)};i[e]?i[e].resources.push(o):i[e]={hostPattern:new RegExp(e),resources:[o]}}const s=[];for(const t in i)s.push(i[t]);return s}(i),e=[];return t.forEach((t=>{const i=function(t,i){const s=t.name;for(let t=0;tt.pathPattern.test(s.pathname)&&t.queryPattern.test(s.search)));if(-1!=o)return n[o].name}return null}(t,s);i&&e.push({entry:t,name:i})})),e}(t,e).map((t=>{const{entry:i,name:s}=t;return function(t,i,s){const e={"key":i,"startTime":s(t.startTime),"redirectTime":s(t.redirectEnd,t.redirectStart),"domainLookupTime":s(t.domainLookupEnd,t.domainLookupStart),"tcpConnectTime":s(t.connectEnd,t.connectStart),"serverResponseTime":s(t.responseStart,t.requestStart),"networkTransferTime":s(t.responseEnd,t.responseStart),"transferSize":s(t.transferSize||0),"encodedBodySize":s(t.encodedBodySize||0),"decodedBodySize":s(t.decodedBodySize||0),"duration":s(t.duration),"initiatorType":t.initiatorType};return new Ui(e,1)}(i,s,h)})).map((t=>o.expandTemplate(n.entry,t,s)));return Promise.all(u).then((t=>t.join(n.delim)))}(n,i,t),new Promise((t=>{setTimeout((()=>t(h())))}))):Promise.resolve("");var h}(o,h):Promise.resolve("")),this.QEt||(s.freezeVar("extraUrlParams"),this.QEt=this.cIt(this.baseUrl,s,n)),!this.tIt&&this.KEt){const t=new Ui(s.vars,s.iterations,!0);this.tIt=this.cIt(this.KEt,t,n)}const c=St(St({},t),i.extraUrlParams),l=this.win.Date.now(),f=Ie(this.rT,this.vj,c,s,n,this.za,this.Sn).then((t=>({"trigger":i.on,"timestamp":l,"extraUrlParams":t})));this.iIt.push(f),this.se(e||!this.XEt)}dispose(){this.bs(),this.eIt&&(this.win.clearTimeout(this.eIt),this.eIt=null),this.nIt&&(this.win.clearTimeout(this.nIt),this.nIt=null)}cIt(t,i,s){return this.rT.expandTemplate(t,i,this.za,s,this.Sn).then((t=>this.vj.expandUrlAsync(t,s,this.Sn).catch((i=>$(!1,`Could not expand URL "${t}": ${i.message}`)))))}se(t){0!=this.Net&&t&&this.aIt()}aIt(){const{QEt:t,iIt:i,tIt:s}=this,e=this.oIt;this.bs(),(s||t).then((t=>{this.sIt.url(this._i,t,!0)})),Promise.all([t,Promise.all(i),s]).then((t=>{const i=this.lIt(t[0],t[2]),s=t[1];0!==s.length&&(e.iframePing?($(e.on==Ss,"iframePing is only available on page view requests."),this.aI.sendRequestUsingIframe(i,s[0])):this.aI.sendRequest(i,s,!!this.XEt))}))}bs(){this.Net=0,this.QEt=null,this.iIt=[],this.oIt=null}uIt(){if(this.XEt){this.XEt=n(this.XEt)?this.XEt:[this.XEt];for(let t=0;t=200,"Invalid batchInterval value: %s, interval value must be greater than %s ms.",this.XEt,200),this.XEt[t]=i}this.ZEt=0,this.fIt()}}hIt(){this.JEt&&(this.nIt=this.win.setTimeout((()=>{this.se(!0),this.rIt=!1,this.eIt&&(this.win.clearTimeout(this.eIt),this.eIt=null)}),1e3*this.JEt))}fIt(){q(null!=this.ZEt);const t=this.ZEt{this.se(!0),this.fIt()}),t)}lIt(t,i){return i?this.wv.parse(i).origin+t:t}};function Ie(t,i,s,e,r,o,h){const u={},c=[],l=new Ui(e.vars,e.iterations,!0),f=(s,e,u)=>{const d=s[e];if("string"==typeof d){u[e]=void 0;const s=t.expandTemplate(d,l,o).then((t=>i.expandStringAsync(t,r,h))).then((t=>{u[e]=t}));c.push(s)}else if(n(d)){u[e]=[];for(let t=0;tu))}var ve=class{constructor(t,i){this.sft=i,this.qit=!1,this.dIt=[],this.bgt=new class{constructor(t,i,s,e){this.gv=t,this.dw=s,this.mw=[],this.my=function(t,i,s,e,n,r){q(t.src),q(!t.parentNode),q(s);const o=t.ownerDocument.defaultView;!function(t){t.listeningFors||t.addEventListener("message",(function(i){if(!pt(i))return;const s=function(t){return"string"==typeof t&&(t="{"==t.charAt(0)?P(t,(t=>{}))||null:ti(t)?function(t){if(!ti(t))return null;const i=t.indexOf("{");return m(-1!=i),P(t.substr(i),(i=>{S(new Error(`MESSAGING: Failed to parse message: ${t}\n${i.message}`))}))}(t):null),t}(pt(i));if(!s||!s.sentinel)return;const e=function(t,i,s,e){const n=hi(t,i);if(!n)return n;let r;for(let t=0;t-1&&a.splice(t,1),l=null,a=null,s=null}}}(this.gv,i,((t,i,s)=>{this.mw.some((t=>t.win==i))||this.mw.push({win:i,origin:s}),e(t,i,s)}),this.dw,this.dw)}send(t,i){(function(t,i){const s=[];let e=0;for(let i=0;i{this.setIsReady()}))}isReady(){return this.qit}setIsReady(){this.qit=!0,this._It()}queueSize(){return this.dIt.length}enqueue(t){q(t&&t.creativeId&&t.message),this.dIt.push(t),this.queueSize()>=100&&this.dIt.shift(),this._It()}_It(){this.isReady()&&this.queueSize()&&(this.bgt.send("iframe-transport-events",{events:this.dIt}),this.dIt=[])}},Re=(()=>self.AMP.config.urls)(),Me=class t{constructor(t,i,s,e){this.mIt=t,this.aO=i,this.AIt=e,q(s&&s.iframe),this.PIt=s.iframe,this.pIt=0,this.processCrossDomainIframe()}detach(){t.markCrossDomainIframeAsDone(this.mIt.document,this.aO)}processCrossDomainIframe(){let i;t.hasCrossDomainIframe(this.aO)?(i=t.getFrameData(this.aO),++i.usageCount):(i=this.createCrossDomainIframe(),this.mIt.document.body.appendChild(i.frame),this.rg()),q(i)}createCrossDomainIframe(){const i=t.TIt(),s=JSON.stringify({scriptSrc:(this.mIt,Re.thirdParty+"/2310061803000/iframe-transport-client-v0.js"),sentinel:i,type:this.aO}),e=g(this.mIt.document,"iframe",{sandbox:"allow-scripts allow-same-origin",name:s,"data-amp-3p-sentinel":i});e.sentinel=i,ri(e,!1),e.src=this.PIt;const n={frame:e,usageCount:1,queue:new ve(this.mIt,e)};return t.EIt[this.aO]=n,n}rg(){var i;(i=this.mIt).PerformanceObserver&&i.TaskAttributionTiming&&"containerName"in i.TaskAttributionTiming.prototype&&(t.gIt[this.aO]=new this.mIt.PerformanceObserver((t=>{t&&t.getEntries().forEach((t=>{t&&"longtask"==t.entryType&&"cross-origin-descendant"==t.name&&t.attribution&&t.attribution.forEach((t=>{this.PIt==t.containerSrc&&++this.pIt%5==0&&H().error("amp-analytics/iframe-transport",`Long Task: Vendor: "${this.aO}"`)}))}))})),t.gIt[this.aO].observe({entryTypes:["longtask"]}))}static markCrossDomainIframeAsDone(i,s){const e=t.getFrameData(s);q(e&&e.frame&&e.usageCount),--e.usageCount||(i.body.removeChild(e.frame),delete t.EIt[s],t.gIt[s]&&(t.gIt[s].disconnect(),t.gIt[s]=null))}static hasCrossDomainIframe(i){return f(t.EIt,i)}static TIt(){return String(++t.IIt)}sendRequest(i){const s=t.getFrameData(this.aO);q(s),q(s.queue),s.queue.enqueue({creativeId:this.AIt,message:i})}static getFrameData(i){return t.EIt[i]}static resetCrossDomainIframes(){t.EIt={}}getCreativeId(){return this.AIt}getType(){return this.aO}};function be(t,i,s=!1,e,n){const r=new(_i.getImage(t));s&&(r.referrerPolicy="no-referrer");let o=0;var h;return null!=e&&((null===(h=t.document.featurePolicy)||void 0===h?void 0:h.allowedFeatures().includes("attribution-reporting"))?(o=6,e=Se(t,o,n)(e),r.attributionSrc=e):o=5),i=Se(t,o,n)(i),r.src=i,r}function Se(t,i,s){const e={"ATTRIBUTION_REPORTING_STATUS":()=>i},n=lt(s||t.document),r={"ATTRIBUTION_REPORTING_STATUS":!0};return t=>n.expandUrlSync(t,e,r)}Me.EIt={},Me.IIt=0,Me.gIt={};var ye,we="amp-analytics/transport",Oe="amp-analytics",Ve=[Ss,Es,gs,Is],Ne=class extends t.BaseElement{constructor(t){super(t),this.vIt=s(),this.RIt=null,this.MIt=!1,this.NN={},this.MA={},this.bIt=null,this.SIt=null,this.rT=null,this.yIt=ht(this.win),this.wIt=null,this.aI=null,this.aO=this.element.getAttribute("type"),this.OIt="inabox"==C(this.win).runtime,this.VIt=null,this.NIt=null,this.CIt=null}getLayoutPriority(){return this.OIt?0:1}isAlwaysFixed(){return!fi(this.element)}isLayoutSupported(t){return!0}buildCallback(){var t;this.MIt=this.element.hasAttribute("sandbox"),this.element.setAttribute("aria-hidden","true"),this.RIt=this.element.getAttribute("data-consent-notification-id"),null!=this.RIt&&(this.vIt=(t=this.element,function(t,i,s,e){return nt(t,"userNotificationManager",s,void 0).then((t=>function(t,i,s){return $(t,"Service %s was requested to be provided through %s, but %s is not loaded in the current page. To fix this problem load the JavaScript file for %s in this page.","userNotificationManager",s,s,s)}(t,0,s)))}(t,0,"amp-user-notification")).then((t=>t.get(this.RIt)))),"immediate"==this.element.getAttribute("trigger")&&this.kIt()}layoutCallback(){return this.kIt()}detachedCallback(){this.SIt&&(this.SIt.dispose(),this.SIt=null),this.VIt&&(this.VIt.dispose(),this.VIt=null);for(const t in this.NN)this.NN[t].dispose(),delete this.NN[t]}resumeCallback(){this.wIt&&this.wIt.then((()=>{this.aI.maybeInitIframeTransport(this.element)}))}unlayoutCallback(){return!this.getAmpDoc().isVisible()&&(this.wIt&&this.wIt.then((()=>{this.aI.deleteIframeTransport()})),super.unlayoutCallback())}kIt(){if(this.wIt)return this.wIt;const t=this.getAmpDoc();return this.wIt=t.whenFirstVisible().then((()=>at(this.win).promise(1))).then((()=>this.vIt)).then((()=>{return Promise.all([(i=t,z(i,"amp-analytics-instrumentation")),zi(t)]);var i})).then((t=>{this.bIt=t[0],this.rT=t[1];const i=new e,n=()=>{const t=new class{constructor(t){this.za=t,this.i=null,this.LIt=wt||{},this.bAt={},this.MA={},this.DIt={},this.MIt=!1,this.rT=Wi(t)}loadConfig(){return this.i=this.za.ownerDocument.defaultView,this.MIt=this.za.hasAttribute("sandbox"),Promise.all([this.xIt(),this.UIt()]).then(this.HIt.bind(this)).then(this.jIt.bind(this)).then((()=>this.MA))}FIt(t){const i=(this.i.location,D.cdn),s="bg"===t&&null!==(e=self.AMP_CONFIG)&&void 0!==e&&e.canary?".canary":"";var e;return`${i}/rtv/${C().rtvVersion}/v0/analytics-vendors/${t}${s}.json`}UIt(){const t=this.za.getAttribute("type");if(!t)return s();const i=this.FIt(t),e=this.Ni();return mt(this.i).fetchJson(i,{ampCors:!1}).then((t=>t.json())).then((t=>{this.bAt=t||{}}),(t=>{H().error(e,"Error loading vendor config: ",i,t)}))}xIt(){let t=this.za.getAttribute("config");if(!t||this.MIt)return s();Bt(t,this.za);const i=this.Ni(),e={};return this.za.hasAttribute("data-credentials")&&(e.credentials=this.za.getAttribute("data-credentials")),lt(this.za).expandUrlAsync(t,this.rT.getMacros(this.za)).then((i=>(t=i,mt(this.i).fetchJson(t,e)))).then((t=>t.json())).then((t=>{this.DIt=t}),(s=>{H().error(i,"Error loading remote config: ",t,s)}))}HIt(){const t=this.qIt().url,i={},e=this.jnt();return this.$It(e),Ji(e,i),Ji(this.DIt,i),!t||this.MIt?(this.MA=this.BIt(i),s()):this.GIt(i,t)}GIt(t,i){Bt(i,this.za);const s=this.Ni();return this.WIt(t).then((()=>{const e={method:"POST",body:t};return this.za.hasAttribute("data-credentials")&&(e.credentials=this.za.getAttribute("data-credentials")),lt(this.za).expandUrlAsync(i).then((t=>mt(this.i).fetchJson(t,e))).then((t=>t.json())).then((t=>{this.MA=this.BIt(t)}),(t=>{H().error(s,"Error rewriting configuration: ",i,t)}))}))}jIt(){this.MA.warningMessage&&(this.Ni(),this.za.getAttribute("type"),this.za.getAttribute("config"),delete this.MA.warningMessage)}WIt(t){const i=t.configRewriter,e=i&&i.varGroups,n=this.qIt().varGroups;if(!e&&!n)return s();if(e&&!n)return this.Ni(),s();t.configRewriter=t.configRewriter||{};const r=t.configRewriter;r.vars={};const o=[],h=e||{};return d(h,n),Object.keys(h).forEach((t=>{const i=h[t];if(!i.enabled)return;const s=this.shallowExpandObject(this.za,i).then((t=>{delete t.enabled,Object.assign(r.vars,t)}));o.push(s)})),Promise.all(o).then((()=>{if(!Object.keys(r.vars).length)return delete t.configRewriter;e&&delete r.varGroups}))}BIt(t){const i={"vars":{"requestCount":0}};return Ji(Zi(this.LIt),i),Ji(Zi(this.bAt),i,!0),Ji(Zi(t),i,!0),i}qIt(){return this.bAt.configRewriter||{}}jnt(){if(this.za.CONFIG)return this.za.CONFIG;let t={};const i=this.Ni();try{const{children:s}=this.za;1==s.length?t=function(t){const i=(e=t,m(/^[\w-]+$/.test("script")),"> script",e.querySelectorAll(T("> script",":scope"))),{length:s}=i;var e;if(1!==s)throw new Error(`Found ${s}