(self.AMP=self.AMP||[]).push({n:"amp-analytics",v:"2005012256000",f:(function(AMP,_){
var h,aa="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},ba;if("function"==typeof Object.setPrototypeOf)ba=Object.setPrototypeOf;else{var ca;a:{var da={a:!0},fa={};try{fa.__proto__=da;ca=fa.a;break a}catch(a){}ca=!1}ba=ca?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ha=ba;
function p(a,b){a.prototype=aa(b.prototype);a.prototype.constructor=a;if(ha)ha(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.Kd=b.prototype}
function ia(a){for(var b=["object"==typeof globalThis&&globalThis,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global,a],c=0;c<b.length;++c){var d=b[c];if(d&&d.Math==Math)return d}return function(){throw Error("Cannot find global object");}()}var ja=ia(this),ka;function q(){return ka?ka:ka=Promise.resolve(void 0)};function u(){var a,b;this.promise=new Promise(function(c,d){a=c;b=d});this.resolve=a;this.reject=b}function la(a){return new Promise(function(b){b(a())})};function ma(a,b){b=void 0===b?"":b;try{return decodeURIComponent(a)}catch(c){return b}};var na=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function v(a){var b=Object.create(null);if(!a)return b;for(var c;c=na.exec(a);){var d=ma(c[1],c[1]),e=c[2]?ma(c[2].replace(/\+/g," "),c[2]):"";b[d]=e}return b};var oa="";
function w(a){var b=a||self;if(b.__AMP_MODE)var c=b.__AMP_MODE;else{c=b;var d=self.AMP_CONFIG||{},e=!!d.test||!1,f=v(c.location.originalHash||c.location.hash);d=d.spt;var g=v(c.location.search);oa||(oa=c.AMP_CONFIG&&c.AMP_CONFIG.v?c.AMP_CONFIG.v:"012005012256000");c={localDev:!1,development:!!(0<=["1","actions","amp","amp4ads","amp4email"].indexOf(f.development)||c.AMP_DEV_MODE),examiner:"2"==f.development,esm:!1,geoOverride:f["amp-geo"],minified:!0,lite:void 0!=g.amp_lite,test:e,log:f.log,version:"2005012256000",
rtvVersion:oa,singlePassType:d};c=b.__AMP_MODE=c}return c};var qa=Object.prototype.toString;function x(a){return Array.isArray(a)}function y(a){return"[object Object]"===qa.call(a)}function z(a){return"number"===typeof a&&isFinite(a)}function ra(a){var b=sa,c;for(c in b)if(b[c]===a)return!0;return!1};var A=self.AMP_CONFIG||{},ta=("string"==typeof A.cdnProxyRegex?new RegExp(A.cdnProxyRegex):A.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/;function ua(a){if(!self.document||!self.document.head||self.location&&ta.test(self.location.origin))return null;var b=self.document.head.querySelector('meta[name="'+a+'"]');return b&&b.getAttribute("content")||null}
var va={thirdParty:A.thirdPartyUrl||"https://3p.ampproject.net",thirdPartyFrameHost:A.thirdPartyFrameHost||"ampproject.net",thirdPartyFrameRegex:("string"==typeof A.thirdPartyFrameRegex?new RegExp(A.thirdPartyFrameRegex):A.thirdPartyFrameRegex)||/^d-\d+\.ampproject\.net$/,cdn:A.cdnUrl||ua("runtime-host")||"https://cdn.ampproject.org",cdnProxyRegex:ta,localhostRegex:/^https?:\/\/localhost(:\d+)?$/,errorReporting:A.errorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r",betaErrorReporting:A.betaErrorReportingUrl||
"https://us-central1-amp-error-reporting.cloudfunctions.net/r-beta",localDev:A.localDev||!1,trustedViewerHosts:[/(^|\.)google\.(com?|[a-z]{2}|com?\.[a-z]{2}|cat)$/,/(^|\.)gmail\.(com|dev)$/],geoApi:A.geoApiUrl||ua("amp-geo-api")};function wa(a){for(var b=null,c="",d=0;d<arguments.length;d++){var e=arguments[d];if(e instanceof Error&&!b){b=void 0;var f=Object.getOwnPropertyDescriptor(e,"message");if(f&&f.writable)b=e;else{f=e.stack;var g=Error(e.message);for(b in e)g[b]=e[b];g.stack=f;b=g}}else c&&(c+=" "),c+=e}b?c&&(b.message=c+": "+b.message):b=Error(c);return b}function xa(a){var b=wa.apply(null,arguments);setTimeout(function(){self.__AMP_REPORT_ERROR(b);throw b;})}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};
var ya=self.__AMP_LOG;function B(){if(!ya.user)throw Error("failed to call initLogConstructor");return ya.user}function C(){if(ya.dev)return ya.dev;throw Error("failed to call initLogConstructor");}function D(a,b,c,d,e,f){return B().assert(a,b,c,d,e,f,void 0,void 0,void 0,void 0,void 0)};var za=Object.prototype.hasOwnProperty;function Aa(){var a,b=Object.create(null);a&&Object.assign(b,a);return b}function E(a){return a||{}}function F(a,b){return za.call(a,b)}
function Ba(a,b){var c=void 0===c?10:c;var d=[],e=[];e.push({t:a,s:b,d:0});for(a={};0<e.length;){b=e.shift();a.aa=b.t;a.S=b.s;a.Ra=b.d;if(d.includes(a.S))throw Error("Source object has a circular reference.");d.push(a.S);a.aa!==a.S&&(a.Ra>c?Object.assign(a.aa,a.S):Object.keys(a.S).forEach(function(a){return function(b){var c=a.S[b];if(F(a.aa,b)){var d=a.aa[b];if(y(c)&&y(d)){e.push({t:d,s:c,d:a.Ra+1});return}}a.aa[b]=c}}(a)));a={S:a.S,aa:a.aa,Ra:a.Ra}}};function Ca(){var a=100;this.Vc=a;this.xb=this.Ub=0;this.Va=Object.create(null)}Ca.prototype.has=function(a){return!!this.Va[a]};Ca.prototype.get=function(a){var b=this.Va[a];if(b)return b.access=++this.xb,b.payload};Ca.prototype.put=function(a,b){this.has(a)||this.Ub++;this.Va[a]={payload:b,access:this.xb};if(!(this.Ub<=this.Vc)){C().warn("lru-cache","Trimming LRU cache");a=this.Va;var c=this.xb+1,d;for(d in a){var e=a[d].access;if(e<c){c=e;var f=d}}void 0!==f&&(delete a[f],this.Ub--)}};function Da(a,b){var c=a.length-b.length;return 0<=c&&a.indexOf(b,c)==c}function G(a,b){return b.length>a.length?!1:0==a.lastIndexOf(b,0)}function Ea(a,b){for(var c=5,d=c||1,e={},f=0;f<d&&(e.Sa=0,a=a.replace(/\${([^}]*)}/g,function(a){return function(c,d){a.Sa++;return b(d)}}(e)),e.Sa);e={Sa:e.Sa},f++);return a}
function Fa(a,b){var c=/\${([^}]*)}/g;if("string"===typeof b)return Promise.resolve(a.replace(c,b));var d=[],e=0;a.replace(c,function(c){var f=arguments[arguments.length-2];d.push(a.slice(e,f));e=f+c.length;var k=b.apply(null,arguments);d.push(k)});d.push(a.slice(e));return Promise.all(d).then(function(a){return a.join("")})};var Ga=E({c:!0,v:!0,a:!0,ad:!0,action:!0}),Ha,Ia,Ja=/[?&]amp_js[^&]*/,Ka=/[?&]amp_gsa[^&]*/,La=/[?&]amp_r[^&]*/,Ma=/[?&]amp_kit[^&]*/,Na=/[?&]usqp[^&]*/;
function H(a){var b;Ha||(Ha=self.document.createElement("a"),Ia=self.__AMP_URL_CACHE||(self.__AMP_URL_CACHE=new Ca));var c=b?null:Ia,d=Ha;if(c&&c.has(a))a=c.get(a);else{d.href=a;d.protocol||(d.href=d.href);var e={href:d.href,protocol:d.protocol,host:d.host,hostname:d.hostname,port:"0"==d.port?"":d.port,pathname:d.pathname,search:d.search,hash:d.hash,origin:null};"/"!==e.pathname[0]&&(e.pathname="/"+e.pathname);if("http:"==e.protocol&&80==e.port||"https:"==e.protocol&&443==e.port)e.port="",e.host=
e.hostname;e.origin=d.origin&&"null"!=d.origin?d.origin:"data:"!=e.protocol&&e.host?e.protocol+"//"+e.host:e.href;d=w().test&&Object.freeze?Object.freeze(e):e;c&&c.put(a,d);a=d}return a}function Oa(a,b,c){if(!b)return a;var d=a.split("#",2),e=d[0].split("?",2),f=e[0]+(e[1]?c?"?"+b+"&"+e[1]:"?"+e[1]+"&"+b:"?"+b);return f+=d[1]?"#"+d[1]:""}
function Pa(a){var b=[],c;for(c in a){var d=a[c];if(null!=d)if(x(d))for(var e=0;e<d.length;e++){var f=d[e];b.push(encodeURIComponent(c)+"="+encodeURIComponent(f))}else e=d,b.push(encodeURIComponent(c)+"="+encodeURIComponent(e))}return b.join("&")}
function Qa(a,b){var c=void 0===c?"source":c;D(null!=a,"%s %s must be available",b,c);var d=a;a=d;"string"==typeof a&&(a=H(a));a="https:"==a.protocol||"localhost"==a.hostname||"127.0.0.1"==a.hostname||Da(a.hostname,".localhost");D(a||/^(\/\/)/.test(d),'%s %s must start with "https://" or "//" or be relative and served from either https or from localhost. Invalid value: %s',b,c,d)}function Ra(a){"string"==typeof a&&(a=H(a));return va.cdnProxyRegex.test(a.origin)};function I(a,b){if(a.__AMP__EXPERIMENT_TOGGLES)var c=a.__AMP__EXPERIMENT_TOGGLES;else{a.__AMP__EXPERIMENT_TOGGLES=Object.create(null);c=a.__AMP__EXPERIMENT_TOGGLES;if(a.AMP_CONFIG)for(var d in a.AMP_CONFIG){var e=a.AMP_CONFIG[d];"number"===typeof e&&0<=e&&1>=e&&(c[d]=Math.random()<e)}if(a.AMP_CONFIG&&Array.isArray(a.AMP_CONFIG["allow-doc-opt-in"])&&0<a.AMP_CONFIG["allow-doc-opt-in"].length&&(d=a.AMP_CONFIG["allow-doc-opt-in"],e=a.document.head.querySelector('meta[name="amp-experiments-opt-in"]'))){e=
e.getAttribute("content").split(",");for(var f=0;f<e.length;f++)-1!=d.indexOf(e[f])&&(c[e[f]]=!0)}Object.assign(c,Sa(a));if(a.AMP_CONFIG&&Array.isArray(a.AMP_CONFIG["allow-url-opt-in"])&&0<a.AMP_CONFIG["allow-url-opt-in"].length)for(d=a.AMP_CONFIG["allow-url-opt-in"],a=v(a.location.originalHash||a.location.hash),e=0;e<d.length;e++)f=a["e-"+d[e]],"1"==f&&(c[d[e]]=!0),"0"==f&&(c[d[e]]=!1)}var g=c;return!!g[b]}
function Sa(a){var b="";try{"localStorage"in a&&(b=a.localStorage.getItem("amp-experiment-toggles"))}catch(e){C().warn("EXPERIMENTS","Failed to retrieve experiments from localStorage.")}var c=b?b.split(/\s*,\s*/g):[];a=Object.create(null);for(var d=0;d<c.length;d++)0!=c[d].length&&("-"==c[d][0]?a[c[d].substr(1)]=!1:a[c[d]]=!0);return a};var Ta={},Ua=(Ta["ampdoc-fie"]={isTrafficEligible:function(){return!0},branches:[["21065001"],["21065002"]]},Ta);function Wa(a,b){var c=a.ownerDocument.defaultView,d=Xa(c),e=c!=d;var f=d;if(I(f,"ampdoc-fie")){f.__AMP_EXPERIMENT_BRANCHES=f.__AMP_EXPERIMENT_BRANCHES||{};for(var g in Ua)if(F(Ua,g)&&!F(f.__AMP_EXPERIMENT_BRANCHES,g))if(Ua[g].isTrafficEligible&&Ua[g].isTrafficEligible(f)){if(!f.__AMP_EXPERIMENT_BRANCHES[g]&&I(f,g)){var k=Ua[g].branches;f.__AMP_EXPERIMENT_BRANCHES[g]=k[Math.floor(Math.random()*k.length)]||null}}else f.__AMP_EXPERIMENT_BRANCHES[g]=null;f="21065002"===(f.__AMP_EXPERIMENT_BRANCHES?f.__AMP_EXPERIMENT_BRANCHES["ampdoc-fie"]:
null)}else f=!1;var l=f;e&&!l?b=Ya(c,b)?Za(c,b):null:(a=J(a),a=K(a),b=Ya(a,b)?Za(a,b):null);return b}function L(a,b){a=Xa(a);return Za(a,b)}function M(a,b){var c=J(a);c=K(c);return Za(c,b)}function $a(a,b){return ab(K(a),b)}function Xa(a){return a.__AMP_TOP||(a.__AMP_TOP=a)}function bb(a,b){var c=(a.ownerDocument||a).defaultView;a=b||Xa(c);if(c&&c!=a&&Xa(c)==a)try{return c.frameElement}catch(d){}return null}
function J(a){return a.nodeType?L((a.ownerDocument||a).defaultView,"ampdoc").getAmpDoc(a):a}function K(a){a=J(a);return a.isSingleDoc()?a.win:a}function Za(a,b){Ya(a,b);var c=cb(a);a=c[b];a.obj||(a.obj=new a.ctor(a.context),a.ctor=null,a.context=null,a.resolve&&a.resolve(a.obj));return a.obj}function db(a,b,c,d){var e,f=cb(a),g=f[c];g||(g=f[c]={obj:null,promise:null,resolve:null,reject:null,context:null,ctor:null});if(e||!g.ctor&&!g.obj)g.ctor=d,g.context=b,g.resolve&&Za(a,c)}
function eb(a,b){var c=ab(a,b);if(c)return c;a=cb(a);a[b]=fb();return a[b].promise}function ab(a,b){var c=cb(a)[b];if(c){if(c.promise)return c.promise;Za(a,b);return c.promise=Promise.resolve(c.obj)}return null}function cb(a){var b=a.__AMP_SERVICES;b||(b=a.__AMP_SERVICES={});return b}function Ya(a,b){a=a.__AMP_SERVICES&&a.__AMP_SERVICES[b];return!(!a||!a.ctor&&!a.obj)}
function fb(){var a=new u,b=a,c=b.promise,d=b.resolve;b=b.reject;c.catch(function(){});return{obj:null,promise:c,resolve:d,reject:b,context:null,ctor:null}};/*
 https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
var gb;function hb(a){try{var b=a.ownerDocument,c=b.createElement("div"),d=b.createElement("div");c.appendChild(d);return c.querySelector(":scope div")===d}catch(e){return!1}};function ib(a,b,c){a=a.createElement(b);for(var d in c)a.setAttribute(d,c[d]);return a}function jb(a,b){for(var c;a&&a!==c;a=a.parentElement)if(b(a))return a;return null}function kb(a,b){return a.closest?a.closest(b):jb(a,function(a){return lb(a,b)})}function mb(a,b){for(a=a.lastElementChild;a;a=a.previousElementSibling)if(b(a))return a;return null}function lb(a,b){var c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector;return c?c.call(a,b):!1}
function nb(a,b){var c="i-amphtml-scoped";a.classList.add(c);var d=b.replace(/^|,/g,"$&."+c+" "),e=a.querySelectorAll(d);a.classList.remove(c);return e}function ob(a){var b=void 0,c=pb,d=b||function(a){return a},e=a.dataset;a={};var f=c?c:/^param(.+)/,g;for(g in e){var k=g.match(f);if(k){var l=k[1][0].toLowerCase()+k[1].substr(1);a[d(l)]=e[g]}}return a};function qb(a){return rb(a,"userNotificationManager","amp-user-notification",void 0).then(function(a){return D(a,"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","amp-user-notification","amp-user-notification","amp-user-notification")})}
function rb(a,b,c,d){var e=$a(a,b);if(e)return e;var f=J(a);return f.waitForBodyOpen().then(function(){var a=f.win;var b=f.win.document.head;if(b){var d={};b=b.querySelectorAll("script[custom-element],script[custom-template]");for(var e=0;e<b.length;e++){var n=b[e];n=n.getAttribute("custom-element")||n.getAttribute("custom-template");d[n]=!0}d=Object.keys(d)}else d=[];a=d.includes(c)?L(a,"extensions").waitForExtension(a,c):q();return a}).then(function(){if(d)var e=$a(a,b);else e=f.win,e=e.__AMP_EXTENDED_ELEMENTS&&
e.__AMP_EXTENDED_ELEMENTS[c]?eb(K(a),b):null;return e})};function sb(a){return M(a,"resources")}function N(a){return Wa(a,"url-replace")}function O(a){return M(a,"viewport")};var tb;function ub(a,b,c,d){var e=a,f=c;var g=function(a){try{return f(a)}catch(n){throw self.__AMP_REPORT_ERROR(n),n;}};var k=vb(),l=!1;d&&(l=d.capture);e.addEventListener(b,g,k?d:l);return function(){e&&e.removeEventListener(b,g,k?d:l);g=e=f=null}}function vb(){if(void 0!==tb)return tb;tb=!1;try{var a={get capture(){tb=!0}};self.addEventListener("test-options",null,a);self.removeEventListener("test-options",null,a)}catch(b){}return tb};function wb(a,b,c,d){var e=c,f=ub(a,b,function(a){try{e(a)}finally{e=null,f()}},d);return f}function xb(a){return!!(a.complete||"complete"==a.readyState||yb(a)&&0<a.readyState||a.document&&"complete"==a.document.readyState)}
function zb(a){var b,c;if(xb(a))return Promise.resolve(a);var d=yb(a);if(d&&a.__AMP_MEDIA_LOAD_FAILURE_SRC===a.currentSrc)return Promise.reject(a);var e=new Promise(function(e,g){b=d?wb(a,"loadedmetadata",e,{capture:!0}):wb(a,"load",e);if(a.tagName){var f=a;if(d&&!a.hasAttribute("src")&&(f=mb(a,function(a){return"SOURCE"===a.tagName}),!f))return g(Error("Media has no source."));c=wb(f,"error",g)}});return e.then(function(){c&&c();return a},function(){b&&b();yb(a)&&(a.__AMP_MEDIA_LOAD_FAILURE_SRC=
a.currentSrc||!0);var c=a;c&&c.src&&(c=c.src);throw B().createError("Failed to load:",c);})}function yb(a){return"AUDIO"===a.tagName||"VIDEO"===a.tagName};function Ab(a,b){var c=0;"active"===a.type&&(c=5);return Math.min(b-a.time,c)}function Bb(){this.Vb=0;this.ra=void 0}Bb.prototype.push=function(a){this.ra&&this.ra.time<a.time&&(this.Vb+=Ab(this.ra,a.time));this.ra=a};Bb.prototype.getTotalEngagedTime=function(a){var b=0;void 0!==this.ra&&(b=this.Vb+Ab(this.ra,a));return b};var Cb=["mousedown","mouseup","mousemove","keydown","keyup"],Db=["mouseleave"];
function Eb(a){this.ampdoc=a;this.Sc=this.Ed.bind(this);this.cc=this.Eb.bind(this);this.Pc=this.nc.bind(this);this.Qc=this.ld.bind(this);this.Ma={};this.va=[];this.fb=this.eb=!1;this.Zb=new Bb;this.F=O(this.ampdoc);this.ampdoc.whenFirstVisible().then(this.Dd.bind(this))}h=Eb.prototype;
h.Dd=function(){this.X=Date.now();this.Eb();for(var a=this.ampdoc.getRootNode(),b=this.cc,c=0;c<Cb.length;c++)this.va.push(ub(a,Cb[c],b,void 0));a=this.ampdoc.getRootNode();b=this.Pc;for(c=0;c<Db.length;c++)this.va.push(ub(a,Db[c],b,void 0));this.va.push(this.ampdoc.onVisibilityChanged(this.Qc));this.F.onScroll(this.cc)};function Fb(a){var b=Date.now()-a.X;return 0<b?b:0}h.Ed=function(){this.fb=this.eb=!1};h.Eb=function(){this.eb||(this.eb=!0,this.fb=!1,Gb(this,"active"))};
h.nc=function(){this.fb||(this.fb=!0,this.eb=!1,Gb(this,"inactive"))};function Gb(a,b){var c=Fb(a),d=Math.floor(c/1E3),e=1E3-c%1E3;setTimeout(a.Sc,e);a.Zb.push({type:b,time:d})}h.ld=function(){this.ampdoc.isVisible()?this.Eb():this.nc()};h.Xb=function(){for(var a=0;a<this.va.length;a++){var b=this.va[a];"function"===typeof b&&b()}this.va=[]};h.Jd=function(){this.Xb()};h.getTotalEngagedTime=function(){var a=Math.floor(Fb(this)/1E3);return this.Zb.getTotalEngagedTime(a)};
h.getIncrementalEngagedTime=function(a,b){b=void 0===b?!0:b;if(!F(this.Ma,a))return b&&(this.Ma[a]=this.getTotalEngagedTime()),this.getTotalEngagedTime();var c=this.Ma[a];if(!1===b)return this.getTotalEngagedTime()-c;this.Ma[a]=this.getTotalEngagedTime();return this.Ma[a]-c};function Hb(a,b){try{return JSON.parse(a)}catch(c){return b&&b(c),null}};var Ib=JSON.parse('{"default":{"transport":{"beacon":true,"xhrpost":true,"image":true},"vars":{"accessReaderId":"ACCESS_READER_ID","ampdocHost":"AMPDOC_HOST","ampdocHostname":"AMPDOC_HOSTNAME","ampdocUrl":"AMPDOC_URL","ampGeo":"AMP_GEO","ampState":"AMP_STATE","ampVersion":"AMP_VERSION","authdata":"AUTHDATA","availableScreenHeight":"AVAILABLE_SCREEN_HEIGHT","availableScreenWidth":"AVAILABLE_SCREEN_WIDTH","backgroundState":"BACKGROUND_STATE","browserLanguage":"BROWSER_LANGUAGE","canonicalHost":"CANONICAL_HOST","canonicalHostname":"CANONICAL_HOSTNAME","canonicalPath":"CANONICAL_PATH","canonicalUrl":"CANONICAL_URL","clientId":"CLIENT_ID","consentState":"CONSENT_STATE","contentLoadTime":"CONTENT_LOAD_TIME","cookie":"COOKIE","counter":"COUNTER","documentCharset":"DOCUMENT_CHARSET","documentReferrer":"DOCUMENT_REFERRER","domainLookupTime":"DOMAIN_LOOKUP_TIME","domInteractiveTime":"DOM_INTERACTIVE_TIME","externalReferrer":"EXTERNAL_REFERRER","firstContentfulPaint":"FIRST_CONTENTFUL_PAINT","firstViewportReady":"FIRST_VIEWPORT_READY","fragmentParam":"FRAGMENT_PARAM","makeBodyVisible":"MAKE_BODY_VISIBLE","htmlAttr":"HTML_ATTR","incrementalEngagedTime":"INCREMENTAL_ENGAGED_TIME","navRedirectCount":"NAV_REDIRECT_COUNT","navTiming":"NAV_TIMING","navType":"NAV_TYPE","pageDownloadTime":"PAGE_DOWNLOAD_TIME","pageLoadTime":"PAGE_LOAD_TIME","pageViewId":"PAGE_VIEW_ID","queryParam":"QUERY_PARAM","random":"RANDOM","redirectTime":"REDIRECT_TIME","resourceTiming":"RESOURCE_TIMING","screenColorDepth":"SCREEN_COLOR_DEPTH","screenHeight":"SCREEN_HEIGHT","screenWidth":"SCREEN_WIDTH","scrollHeight":"SCROLL_HEIGHT","scrollLeft":"SCROLL_LEFT","scrollTop":"SCROLL_TOP","scrollWidth":"SCROLL_WIDTH","serverResponseTime":"SERVER_RESPONSE_TIME","sourceUrl":"SOURCE_URL","sourceHost":"SOURCE_HOST","sourceHostname":"SOURCE_HOSTNAME","sourcePath":"SOURCE_PATH","tcpConnectTime":"TCP_CONNECT_TIME","timestamp":"TIMESTAMP","timezone":"TIMEZONE","timezoneCode":"TIMEZONE_CODE","title":"TITLE","totalEngagedTime":"TOTAL_ENGAGED_TIME","userAgent":"USER_AGENT","viewer":"VIEWER","viewportHeight":"VIEWPORT_HEIGHT","viewportWidth":"VIEWPORT_WIDTH"}}}');function Jb(a){return"undefined"!==typeof TextEncoder?(new TextEncoder("utf-8")).encode(a):Kb(unescape(encodeURIComponent(a)))}function Kb(a){for(var b=new Uint8Array(a.length),c=0;c<a.length;c++){var d=a.charCodeAt(c);b[c]=d}return b}function Lb(a){for(var b=Array(a.length),c=0;c<a.length;c++)b[c]=String.fromCharCode(a[c]);return b.join("")};var Mb={"-":"+",_:"/",".":"="},Nb={"+":"-","/":"_","=":"."};function Ob(a){var b=atob(a.replace(/[-_.]/g,function(a){return Mb[a]}));return Kb(b)}function Pb(a){a=Lb(a);return btoa(a).replace(/[+/=]/g,function(a){return Nb[a]})}function Qb(a){a=Jb(a);return Pb(a)};function Rb(a,b){var c=Sb(a);if(!c)return null;var d=c.split(";");for(a=0;a<d.length;a++){var e=d[a].trim(),f=e.indexOf("="),g;if(g=-1!=f)g=e.substring(0,f).trim(),g=ma(g,void 0)==b;if(g)return b=e.substring(f+1).trim(),ma(b,b)}return null}function Sb(a){try{return a.document.cookie}catch(b){return""}}
function Tb(a){var b=a.document.head&&a.document.head.querySelector("meta[name='amp-cookie-scope']");if(b){var c=b.getAttribute("content")||"";a=a.location.href;"string"==typeof a&&(a=H(a));if(Ra(a)){var d=a.pathname.split("/");D(Ga[d[1]],"Unknown path prefix in url %s",a.href);var e=d[2],f="s"==e?"https://"+decodeURIComponent(d[3]):"http://"+decodeURIComponent(e);D(0<f.indexOf("."),"Expected a . in origin %s",f);d.splice(1,"s"==e?3:2);d=f+d.join("/");e=(e=a.search)&&"?"!=e?(e=e.replace(Ja,"").replace(Ka,
"").replace(La,"").replace(Ma,"").replace(Na,"").replace(/^[?&]/,""))?"?"+e:"":"";a=d+e+(a.hash||"")}else a=a.href;a=H(a).origin;return Da(a,"."+c)?c:a.split("://")[1]}if(!Ra(a.location.href)){d=a.location.hostname.split(".");e=d[d.length-1];for(f="-test-amp-cookie-tmp";Rb(a,f);)f="-test-amp-cookie-tmp0";var g=f;for(f=d.length-2;0<=f;f--)if(e=d[f]+"."+e,Ub(a,g,"delete",Date.now()+1E3,e),"delete"==Rb(a,g))return Ub(a,g,"delete",Date.now()-1E3,e),e}return null}
function Ub(a,b,c,d,e,f,g){"ampproject.org"==e&&(c="delete",d=0);b=encodeURIComponent(b)+"="+encodeURIComponent(c)+"; path=/"+(e?"; domain="+e:"")+"; expires="+(new Date(d)).toUTCString();c=f;try{a.document.cookie=b+(c?"; SameSite="+c:"")+(g?"; Secure":"")}catch(k){}};function Vb(a){if(!Wb(a))return null;var b=a.indexOf("{");try{return JSON.parse(a.substr(b))}catch(c){return C().error("MESSAGING","Failed to parse message: "+a,c),null}}function Wb(a){return"string"==typeof a&&0==a.indexOf("amp-")&&-1!=a.indexOf("{")};function Xb(a,b){for(var c=[],d=0,e=0;e<a.length;e++){var f=a[e];b(f,e,a)?c.push(f):(d<e&&(a[d]=f),d++)}d<a.length&&(a.length=d)}function Yb(a,b){for(var c=0;c<a.length;c++)if(b(a[c],c,a))return c;return-1};var Zb,$b="Webkit webkit Moz moz ms O o".split(" ");function ac(a){var b=!1;void 0===b&&(b=a.hasAttribute("hidden"));b?a.removeAttribute("hidden"):a.setAttribute("hidden","")};function bc(a,b,c){var d=a.listeningFors;!d&&c&&(d=a.listeningFors=Object.create(null));a=d||null;if(!a)return a;var e=a[b];!e&&c&&(e=a[b]=[]);return e||null}function cc(a,b,c){var d=c?b.getAttribute("data-amp-3p-sentinel"):"amp";a=bc(a,d,!0);for(d=0;d<a.length;d++){var e=a[d];if(e.frame===b){var f=e;break}}f||(f={frame:b,events:Object.create(null)},a.push(f));return f.events}
function dc(a){for(var b=E({sentinel:"unlisten"}),c=a.length-1;0<=c;c--){var d=a[c];if(!d.frame.contentWindow){a.splice(c,1);d=d.events;for(var e in d)d[e].splice(0,Infinity).forEach(function(a){a(b)})}}}
function ec(a){if(!a.listeningFors){var b=function(b){if(b.data){var c=fc(b.data);if(c&&c.sentinel){var e=b.source;var f=bc(a,c.sentinel);if(f){for(var g,k=0;k<f.length;k++){var l=f[k],m=l.frame.contentWindow;if(m){var n;if(!(n=e==m))b:{for(n=e;n&&n!=n.parent;n=n.parent)if(n==m){n=!0;break b}n=!1}if(n){g=l;break}}else setTimeout(dc,0,f)}e=g?g.events:null}else e=f;var r=e;if(r){var t=r[c.type];if(t)for(t=t.slice(),e=0;e<t.length;e++)(0,t[e])(c,b.source,b.origin,b)}}}};a.addEventListener("message",
b)}}function gc(a,b,c,d){function e(c,e,f,k){if("amp"==c.sentinel){if(e!=a.contentWindow)return;var m="null"==f&&g;if(l!=f&&!m)return}if(d||e==a.contentWindow)"unlisten"==c.sentinel?n():b(c,e,f,k)}var f="send-iframe-transport-events",g,k=a.ownerDocument.defaultView;ec(k);c=cc(k,a,c);var l=H(a.src).origin,m=c[f]||(c[f]=[]),n;m.push(e);return n=function(){if(e){var a=m.indexOf(e);-1<a&&m.splice(a,1);b=m=e=null}}}
function hc(a,b,c,d,e){if(a.contentWindow)for(d.type=c,d.sentinel=e?a.getAttribute("data-amp-3p-sentinel"):"amp",a=d,e&&(a="amp-"+JSON.stringify(d)),d=0;d<b.length;d++)e=b[d],e.win.postMessage(a,e.origin)}function fc(a){"string"==typeof a&&(a="{"==a.charAt(0)?Hb(a,function(a){C().warn("IFRAME-HELPER","Postmessage could not be parsed. Is it in a valid JSON format?",a)})||null:Wb(a)?Vb(a):null);return a}
function ic(a,b){var c=!0,d=this;this.pc=a;this.Hb=c;this.za=[];this.Xb=gc(this.pc,function(a,c,g){d.za.some(function(a){return a.win==c})||d.za.push({win:c,origin:g});b(a,c,g)},this.Hb,this.Hb)}ic.prototype.send=function(a,b){Xb(this.za,function(a){return!a.win.parent});hc(this.pc,this.za,a,b,this.Hb)};ic.prototype.destroy=function(){this.Xb();this.za.length=0};function jc(a){return a.classList.contains("i-amphtml-fie")||!!kb(a,".i-amphtml-fie")};function kc(a,b){return!jc(b)&&!Ra(a.location)&&"inabox"!=w(a).runtime};function lc(a){var b=void 0===b?"default":b;return rb(a,"consentPolicyManager","amp-consent").then(function(a){return a?a.whenPolicyResolved(b):null})};var mc=null;var nc=/^[a-zA-Z0-9\-_.]+$/;function oc(a){var b=pc(a);if(""===b)return"";var c=qc(b);return["1",c,b].join("*")}
function qc(a,b){var c=(new Date).getTimezoneOffset(),d=window,e=[window.navigator.userAgent,c,d.navigator.userLanguage||d.navigator.language].join("*");c=b||0;var f=Math.floor(Date.now()/6E4)-c;a=[e,f,a].join("*");if(!mc){c=Array(256);for(d=0;256>d;d++){for(var g=d,k=0;8>k;k++)g=g&1?g>>>1^3988292384:g>>>1;c[d]=g}mc=c}a=Jb(a);c=4294967295;for(d=0;d<a.length;d++)c=c>>>8^mc[(c^a[d])&255];return((c^-1)>>>0).toString(36)}
function pc(a){return a?Object.keys(a).filter(function(a){var b=nc.test(a);b||B().error("amp-analytics/linker","Invalid linker key: "+a);return b}).map(function(b){return b+"*"+Qb(String(a[b]))}).join("*"):""};function rc(a){this.l=a;this.Ea={}}
rc.prototype.get=function(a,b){if(!a||!b)return B().error("amp-analytics/linker-reader","LINKER_PARAM requires two params, name and id"),null;if(!F(this.Ea,a)){var c=this.Ea;var d=H(this.l.location.href);var e=v(d.search);if(F(e,a)){e=e[a];if(this.l.history.replaceState){var f;f=(f=d.search)&&"?"!=f?(f=f.replace(new RegExp("[?&]"+a+"=[^&]*","g"),"").replace(/^[?&]/,""))?"?"+f:"":"";this.l.history.replaceState(null,"",d.origin+d.pathname+f+(d.hash||""))}d=e.split("*");f=0==d.length%2;4>d.length||!f?
(B().error("amp-analytics/linker","Invalid linker_param value "+e),e=null):(e=Number(d.shift()),1!==e?(B().error("amp-analytics/linker","Invalid version number "+e),e=null):(e=d.shift(),d=d.join("*"),e={checksum:e,serializedIds:d}));if(e){d=e.serializedIds;c:{e=e.checksum;for(f=0;1>=f;f++)if(qc(d,f)==e){e=!0;break c}e=!1}if(e)for(e={},d=d.split("*"),f=0;f<d.length;f+=2){var g=d[f];if(nc.test(g)){var k=Ob(String(d[f+1]));"undefined"!==typeof TextDecoder?k=(new TextDecoder("utf-8")).decode(k):(k=Lb(new Uint8Array(k.buffer||
k)),k=decodeURIComponent(escape(k)));e[g]=k}else B().error("amp-analytics/linker","Invalid linker key "+g+", value ignored")}else B().error("amp-analytics/linker","LINKER_PARAM value checksum not valid"),e=null}else e=null}else e=null;c[a]=e}return this.Ea[a]&&this.Ea[a][b]?this.Ea[a][b]:null};var sc=/^(?:([^\s]*)(\([^)]*\))|[^]+)$/,tc={1:"sufficient",2:"insufficient",3:"not_required",4:"unknown"};function P(a,b,c){this.vars=a;this.iterations=void 0===b?2:b;this.noEncode=!!c;this.freezeVars={}}P.prototype.freezeVar=function(a){this.freezeVars[a]=!0};P.prototype.getVar=function(a){a=this.vars[a];null==a&&(a="");return a};
function uc(a,b,c){b=Number(b);var d=a.length;D(z(b),"Start index "+b+"in substr macro should be a number");c&&(d=Number(c),D(z(d),"Length "+d+" in substr macro should be a number"));return a.substr(b,d)}function vc(a,b){return a&&a.length?a:b}function wc(a,b,c){b||B().warn("amp-analytics/variables","REPLACE macro must have two or more arguments");c||(c="");return a.replace(new RegExp(b,"g"),c)}
function xc(a,b,c){b||B().warn("amp-analytics/variables","MATCH macro must have two or more arguments");var d=0;c&&(d=parseInt(c,10),0!=d&&!d||0>d)&&(B().error("amp-analytics/variables","Third argument in MATCH macro must be a number >= 0"),d=0);return(a=a.match(new RegExp(b)))&&a[d]?a[d]:""}
function yc(a){var b=this;this.m=a;this.oa=E({});this.qd=L(this.m.win,"amp-analytics-linker-reader");this.oa.$DEFAULT=vc;this.oa.$SUBSTR=uc;Q(this,"$TRIM",function(a){return a.trim()});Q(this,"$TOLOWERCASE",function(a){return a.toLowerCase()});Q(this,"$TOUPPERCASE",function(a){return a.toUpperCase()});Q(this,"$NOT",function(a){return String(!a)});Q(this,"$BASE64",function(a){return Qb(a)});Q(this,"$HASH",this.nd.bind(this));Q(this,"$IF",function(a,b,e){return zc(a)?b:e});this.oa.$REPLACE=wc;this.oa.$MATCH=
xc;Q(this,"$EQUALS",function(a,b){return a===b});Q(this,"LINKER_PARAM",function(a,d){return b.qd.get(a,d)});Q(this,"TIMEZONE_CODE",function(){var a="";"Intl"in b.m.win&&"DateTimeFormat"in b.m.win.Intl&&(a=(new b.m.win.Intl.DateTimeFormat).resolvedOptions().timeZone);return a});Q(this,"SCROLL_TOP",function(){return O(b.m).getScrollTop()});Q(this,"SCROLL_LEFT",function(){return O(b.m).getScrollLeft()});Q(this,"FIRST_CONTENTFUL_PAINT",function(){return L(b.m.win,"performance").getFirstContentfulPaint()});
Q(this,"FIRST_VIEWPORT_READY",function(){return L(b.m.win,"performance").getFirstViewportReady()});Q(this,"MAKE_BODY_VISIBLE",function(){return L(b.m.win,"performance").getMakeBodyVisible()})}yc.prototype.getMacros=function(a){var b=this,c={COOKIE:function(c){var d=b.m.win;return kc(d,a)?Rb(d,c):null},CONSENT_STATE:Ac(a)},d=Object.assign({},this.oa,c);return d};function Q(a,b,c){a.oa[b]=c}
yc.prototype.expandTemplate=function(a,b,c,d,e){var f=this;return Fa(a,function(a,k){if(0>b.iterations)return B().error("amp-analytics/variables","Maximum depth reached while expanding variables. Please ensure that the variables are not recursive."),a;if(!k)return"";var g=Bc(k);k=g.name;g=g.argList;if(b.freezeVars[k])return a;a=b.getVar(k);var m=N(c);if("string"==typeof a)a=Cc(f,a,b,c,m,d,e,g);else if(x(a)){for(k=0;k<a.length;k++)a[k]="string"==typeof a[k]?Cc(f,a[k],b,c,m,d,e):a[k];a=Promise.all(a)}return Promise.resolve(a).then(function(a){return b.noEncode?
a:Dc(a)})})};function Cc(a,b,c,d,e,f,g,k){return a.expandTemplate(b,new P(c.vars,c.iterations-1,!0),d,f,g).then(function(b){return e.expandStringAsync(k?b+k:b,f||a.getMacros(d),g)})}yc.prototype.nd=function(a){return L(this.m.win,"crypto").sha384Base64(a)};function Dc(a){if(null==a)return"";if(x(a))return a.map(Dc).join(",");var b=Bc(String(a)),c=b.argList;return encodeURIComponent(b.name)+c}
function Bc(a){if(!a)return{name:"",argList:""};var b=a.match(sc);D(b,"Variable with invalid format found: "+a);return{name:b[1]||b[0],argList:b[2]||""}}function Ec(a){return M(a,"amp-analytics-variables")}function Ac(a){return lc(a).then(function(a){return a?tc[a]:null})}function zc(a){return"false"!==a&&""!==a&&"0"!==a&&"null"!==a&&"NaN"!==a&&"undefined"!==a};function Fc(a){this.j=a;this.l=null;this.mb=Ib;this.h={};this.sa={};this.V=!1}h=Fc.prototype;h.loadConfig=function(){var a=this;this.l=this.j.ownerDocument.defaultView;this.V=this.j.hasAttribute("sandbox");return Promise.all([Gc(this),Hc(this)]).then(this.zd.bind(this)).then(this.Wc.bind(this)).then(function(){return a.h})};
function Ic(a,b){a=a.l.location;if(w().localDev){var c=a.protocol+"//"+a.host;"about:"==a.protocol&&(c="");a=c+"/dist"}else a=va.cdn;if(c="bg"===b)c=self,c=!(!c.AMP_CONFIG||!c.AMP_CONFIG.canary);var d=c?".canary":"";return a+"/rtv/"+w().rtvVersion+"/v0/analytics-vendors/"+b+d+".json"}
function Hc(a){var b=a.j.getAttribute("type");if(!b)return q();var c=Ic(a,b),d=a.w();return L(a.l,"xhr").fetchJson(c,{ampCors:!1}).then(function(a){return a.json()}).then(function(c){a.mb[b]=c},function(a){B().error(d,"Error loading vendor config: ",c,a)})}
function Gc(a){var b=a.j.getAttribute("config");if(!b||a.V)return q();Qa(b,a.j);var c=a.w(),d={};a.j.hasAttribute("data-credentials")&&(d.credentials=a.j.getAttribute("data-credentials"));return N(a.j).expandUrlAsync(b).then(function(c){b=c;return L(a.l,"xhr").fetchJson(b,d)}).then(function(a){return a.json()}).then(function(b){a.sa=b},function(a){B().error(c,"Error loading remote config: ",b,a)})}
h.zd=function(){var a=(Jc(this).configRewriter||{}).url,b=E({});if(this.j.CONFIG)var c=this.j.CONFIG;else{c={};var d=this.w();try{var e=this.j.children;if(1==e.length){var f=this.j;/^[\w-]+$/.test("script");var g=(void 0!==gb?gb:gb=hb(f))?f.querySelectorAll("> script".replace(/^|,/g,"$&:scope ")):nb(f,"> script");if(1!==g.length)throw Error("Found "+g.length+" <script> children. Expected 1.");var k=g[0];if("SCRIPT"!=k.tagName||!k.hasAttribute("type")||"APPLICATION/JSON"!=k.getAttribute("type").toUpperCase())throw Error('<script> child must have type="application/json"');
try{c=JSON.parse(k.textContent)}catch(m){throw Error("Failed to parse <script> contents. Is it valid JSON?");}}else 1<e.length&&B().error(d,"The tag should contain only one <script> child.")}catch(m){B().error(d,m.message)}}var l=c;c=l;d=this.j.getAttribute("type");this.mb[d]&&(c.transport||this.sa.transport)&&(d=this.w(),B().error(d,"Inline or remote config should not overwrite vendor transport settings"));c.transport&&c.transport.iframe&&(B().error("amp-analytics/config","Inline configs are not allowed to specify transport iframe"),
!w().localDev||w().test)&&(c.transport.iframe=void 0);this.sa.transport&&this.sa.transport.iframe&&(B().error("amp-analytics/config","Remote configs are not allowed to specify transport iframe"),this.sa.transport.iframe=void 0);R(l,b);R(this.sa,b);return!a||this.V?(this.h=Kc(this,b),q()):Lc(this,b,a)};
function Lc(a,b,c){Qa(c,a.j);var d=a.w();return Nc(a,b).then(function(){var e={method:"POST",body:b};a.j.hasAttribute("data-credentials")&&(e.credentials=a.j.getAttribute("data-credentials"));return N(a.j).expandUrlAsync(c).then(function(b){return L(a.l,"xhr").fetchJson(b,e)}).then(function(a){return a.json()}).then(function(b){a.h=Kc(a,b)},function(a){B().error(d,"Error rewriting configuration: ",c,a)})})}
h.Wc=function(){if(this.h.warningMessage){var a=this.w(),b=this.j.getAttribute("type"),c=this.j.getAttribute("config");B().warn(a,"Warning from analytics vendor%s%s: %s",b?" "+b:"",c?" with remote config url "+c:"",String(this.h.warningMessage));delete this.h.warningMessage}};
function Nc(a,b){var c=b.configRewriter,d=c&&c.varGroups,e=(Jc(a).configRewriter||{}).varGroups;if(!d&&!e)return q();if(d&&!e){var f=a.w();B().warn(f,"This analytics provider does not currently support varGroups");return q()}b.configRewriter=b.configRewriter||{};var g=b.configRewriter;g.vars=E({});var k=[],l=d||{};Ba(l,e);Object.keys(l).forEach(function(b){var c=l[b];if(c.enabled){var d=a.shallowExpandObject(a.j,c).then(function(a){delete a.enabled;Object.assign(g.vars,a)});k.push(d)}});return Promise.all(k).then(function(){if(!Object.keys(g.vars).length)return delete b.configRewriter;
d&&delete g.varGroups})}function Kc(a,b){var c=E({vars:{requestCount:0}}),d=a.mb["default"]||{};R(Oc(d),c);R(Oc(Jc(a)),c,!0);R(Oc(b),c,!0);return c}function Jc(a){var b=a.j.getAttribute("type");return a.mb[b]||{}}h.w=function(){return"AmpAnalytics "+(this.j.getAttribute("id")||"<unknown id>")};
h.shallowExpandObject=function(a,b){var c={},d=[],e=[],f=N(a),g=Ec(a).getMacros(a);Object.keys(b).forEach(function(a){d.push(a);var c=f.expandStringAsync(b[a],g);e.push(c)});return Promise.all(e).then(function(a){d.forEach(function(b,d){return c[b]=a[d]});return c})};
function R(a,b,c){if(null===b||void 0===b)b={};D(c||!a||!a.optout||"_gaUserPrefs.ioo"==a.optout||"__gaOptOutExtension"==a.optoutElementId,"optout property is only available to vendor config.");for(var d in a)D(c||"iframePing"!=d,"iframePing config is only available to vendor config."),F(a,d)&&(x(a[d])?(x(b[d])||(b[d]=[]),b[d]=R(a[d],b[d],c)):y(a[d])?(y(b[d])||(b[d]={}),b[d]=R(a[d],b[d],c)):b[d]=a[d]);return b}
function Oc(a){if(!a.requests)return a;for(var b in a.requests)if(F(a.requests,b)){var c=a.requests;var d=a.requests[b];d=y(d)?d:{baseUrl:d};c[b]=d}if(F(a,"requests")&&F(a,"requestOrigin")){b=a.requestOrigin;for(var e in a.requests)F(a.requests[e],"origin")||(a.requests[e].origin=b)}return a};function S(){this.H=null}h=S.prototype;h.add=function(a){var b=this;this.H||(this.H=[]);this.H.push(a);return function(){b.remove(a)}};h.remove=function(a){this.H&&(a=this.H.indexOf(a),-1<a&&this.H.splice(a,1))};h.removeAll=function(){this.H&&(this.H.length=0)};h.fire=function(a){if(this.H)for(var b=this.H,c=0;c<b.length;c++)(0,b[c])(a)};h.getHandlerCount=function(){return this.H?this.H.length:0};var Pc={ENDED:"video-ended",PAUSE:"video-pause",PLAY:"video-play",SESSION:"video-session",SESSION_VISIBLE:"video-session-visible",SECONDS_PLAYED:"video-seconds-played",CUSTOM:"video-hosted-custom",PERCENTAGE_PLAYED:"video-percentage-played",AD_START:"video-ad-start",AD_END:"video-ad-end"};var pb=/^vars(.+)/;function Qc(){}
var sa={CLICK:"click",CUSTOM:"custom",HIDDEN:"hidden",INI_LOAD:"ini-load",RENDER_START:"render-start",SCROLL:"scroll",STORY:"story",TIMER:"timer",VIDEO:"video",VISIBLE:"visible"},T=["ampdoc","embed"],U={},Zc=Object.freeze((U.click={name:"click",allowedFor:T.concat(["timer"]),klass:function(a){return new Rc(a)}},U.custom={name:"custom",allowedFor:T.concat(["timer"]),klass:function(a){return new V(a)}},U.hidden={name:"visible",allowedFor:T.concat(["timer"]),klass:function(a){return new Sc(a)}},U["ini-load"]=
{name:"ini-load",allowedFor:T.concat(["timer","visible"]),klass:function(a){return new Tc(a)}},U["render-start"]={name:"render-start",allowedFor:T.concat(["timer","visible"]),klass:function(a){return new Uc(a)}},U.scroll={name:"scroll",allowedFor:T.concat(["timer"]),klass:function(a){return new Vc(a)}},U.story={name:"story",allowedFor:T,klass:function(a){return new Wc(a)}},U.timer={name:"timer",allowedFor:T,klass:function(a){return new Xc(a)}},U.video={name:"video",allowedFor:T.concat(["timer"]),
klass:function(a){return new Yc(a)}},U.visible={name:"visible",allowedFor:T.concat(["timer"]),klass:function(a){return new Sc(a)}},U));function $c(a){return G(a,"video")?"video":G(a,"story")?"story":ra(a)?F(Zc,a)?Zc[a].name:a:"custom"}function ad(a){var b={};Object.keys(Zc).forEach(function(c){F(Zc,c)&&-1!=Zc[c].allowedFor.indexOf(a)&&(b[c]=Zc[c].klass)},this);return b}function W(a,b,c){this.target=a;this.type=b;this.vars=c||{}}function X(a){this.root=a}X.prototype.dispose=function(){};
X.prototype.add=function(){};function V(a){this.root=a;var b=this;this.O={};this.C={};this.ga={};setTimeout(function(){b.C=void 0},1E4)}p(V,X);V.prototype.dispose=function(){this.ga=this.C=void 0;for(var a in this.O)this.O[a].removeAll()};
V.prototype.add=function(a,b,c,d){var e=this,f=c.selector;f||(f=":root");var g=c.selectionMethod||null,k=this.root.getElement(a,f,g),l=G(b,"sandbox-"),m=l?this.ga&&this.ga[b]:this.C&&this.C[b];if(m){var n=m.length;k.then(function(a){setTimeout(function(){for(var c=0;c<n;c++){var f=m[c];a.contains(f.target)&&d(f)}l&&(e.ga[b]=void 0)},1)})}var r=this.O[b];r||(r=new S,this.O[b]=r);return this.O[b].add(function(a){k.then(function(b){b.contains(a.target)&&d(a)})})};
V.prototype.trigger=function(a){var b=a.type,c=G(b,"sandbox-"),d=this.O[b];if(d&&(d.fire(a),c))return;c?(this.ga[b]=this.ga[b]||[],this.ga[b].push(a)):this.C&&(this.C[b]=this.C[b]||[],this.C[b].push(a))};function Wc(a){V.call(this,a)}p(Wc,V);Wc.prototype.add=function(a,b,c,d){var e=this.root.getRootElement();if(a=this.C&&this.C[b])for(var f=a.length,g=0;g<f;g++)bd(a[g],e,c,d);a=this.O[b];a||(a=new S,this.O[b]=a);return this.O[b].add(function(a){bd(a,e,c,d)})};
function bd(a,b,c,d){var e=a.type;a=a.vars;var f=c.storySpec||{},g=void 0===f.repeat?!0:f.repeat,k=a.eventDetails;(c=c.tagName)&&k.tagName&&c.toLowerCase()!==k.tagName||!1===g&&k.repeated||d(new W(b,e,a))}Wc.prototype.trigger=function(a){var b=a.type,c=this.O[b];c&&c.fire(a);this.C&&(this.C[b]=this.C[b]||[],this.C[b].push(a))};function Rc(a){this.root=a;this.Wa=new S;this.dc=this.Wa.fire.bind(this.Wa);this.root.getRoot().addEventListener("click",this.dc)}p(Rc,X);
Rc.prototype.dispose=function(){this.root.getRoot().removeEventListener("click",this.dc);this.Wa.removeAll()};Rc.prototype.add=function(a,b,c,d){b=D(c.selector,"Missing required selector on click trigger");c=c.selectionMethod||null;return this.Wa.add(this.root.createSelectiveListener(this.fd.bind(this,d),a.parentElement||a,b,c))};Rc.prototype.fd=function(a,b){var c=ob(b);a(new W(b,"click",c))};function Vc(a){this.D=this.root=a;this.ya=null}p(Vc,X);
Vc.prototype.dispose=function(){null!==this.ya&&(this.D.getScrollManager().removeScrollHandler(this.ya),this.ya=null)};
Vc.prototype.add=function(a,b,c,d){if(!c.scrollSpec)return B().error("amp-analytics/events","Missing scrollSpec on scroll trigger."),Qc;if(!Array.isArray(c.scrollSpec.verticalBoundaries)&&!Array.isArray(c.scrollSpec.horizontalBoundaries))return B().error("amp-analytics/events","Boundaries are required for the scroll trigger to work."),Qc;var e=cd(c.scrollSpec.verticalBoundaries),f=cd(c.scrollSpec.horizontalBoundaries),g=!!c.scrollSpec.useInitialPageSize;this.ya=this.Cd.bind(this,f,e,g,d);return this.D.getScrollManager().addScrollHandler(this.ya)};
Vc.prototype.Cd=function(a,b,c,d,e){c=c?e.initialSize:e;var f=c.scrollWidth,g=c.scrollHeight;dd(this,b,100*(e.top+e.height)/g,"verticalScrollBoundary",d);dd(this,a,100*(e.left+e.width)/f,"horizontalScrollBoundary",d)};function cd(a){var b=E({});if(!a||!Array.isArray(a))return b;for(var c=0;c<a.length;c++){var d=a[c];if("number"!==typeof d||!isFinite(d)){B().error("amp-analytics/events","Scroll trigger boundaries must be finite.");break}d=Math.min(5*Math.round(d/5),100);b[d]=!1}return b}
function dd(a,b,c,d,e){if(c)for(var f in b)if(F(b,f)){var g=parseInt(f,10);g>c||b[g]||(b[g]=!0,g={},g[d]=f,e(new W(a.D.getRootElement(),"scroll",g)))}}function Uc(a){this.root=a}p(Uc,X);Uc.prototype.dispose=function(){};
Uc.prototype.add=function(a,b,c,d){var e=this,f=c.selector||":root";if(":root"==f||":host"==f){var g=this.root.getRootElement();var k=this.getRootSignal(b)}else k=this.root.getAmpElement(a.parentElement||a,f,c.selectionMethod).then(function(a){g=a;return e.getElementSignal(b,g)});k.then(function(){d(new W(g,b))});return Qc};Uc.prototype.getRootSignal=function(a){return this.root.signals().whenSignal(a)};Uc.prototype.getElementSignal=function(a,b){return"function"!=typeof b.signals?q():b.signals().whenSignal(a)};
function Tc(a){this.root=a}p(Tc,X);Tc.prototype.dispose=function(){};Tc.prototype.add=function(a,b,c,d){var e=this,f=c.selector||":root";if(":root"==f||":host"==f){var g=this.root.getRootElement();a=this.getRootSignal()}else a=this.root.getAmpElement(a.parentElement||a,f,c.selectionMethod).then(function(a){g=a;return e.getElementSignal("ini-load",g)});a.then(function(){d(new W(g,b))});return Qc};Tc.prototype.getRootSignal=function(){return this.root.whenIniLoaded()};
Tc.prototype.getElementSignal=function(a,b){if("function"!=typeof b.signals)return q();var c=b.signals();return Promise.race([c.whenSignal("ini-load"),c.whenSignal("load-end")])};
function ed(a,b,c){this.hb=void 0;D("interval"in a,"Timer interval specification required");this.vc=Number(a.interval)||0;D(.5<=this.vc,"Bad timer interval specification");this.yc="maxTimerLength"in a?Number(a.maxTimerLength):7200;D(0<this.yc,"Bad maxTimerLength specification");this.rd="maxTimerLength"in a;this.Uc="immediate"in a?!!a.immediate:!0;this.ia=this.Z=this.Gb=null;this.La=b||null;this.tb=c||null;this.jb=this.X=void 0}h=ed.prototype;
h.init=function(a){this.La?this.La&&(this.Z=this.La()):a()};h.dispose=function(){this.ia&&(this.ia(),this.ia=null);this.Z&&(this.Z(),this.Z=null)};h.isRunning=function(){return!!this.hb};
h.startIntervalInWindow=function(a,b,c){if(!this.isRunning()&&(this.X=Date.now(),this.jb=void 0,this.Gb=b,this.hb=a.setInterval(function(){b()},1E3*this.vc),(!this.tb||this.tb&&this.rd)&&a.setTimeout(function(){c()},1E3*this.yc),this.Z&&(this.Z(),this.Z=null),this.Uc&&b(),this.tb))try{this.ia=this.tb()}catch(d){throw this.dispose(),d;}};h.ub=function(a){this.isRunning()&&(this.Gb(),this.Gb=null,a.clearInterval(this.hb),this.jb=this.hb=void 0,this.ia&&(this.ia(),this.ia=null),this.La&&(this.Z=this.La()))};
h.getTimerVars=function(){var a=0;this.isRunning()&&(a=this.X?Date.now()-(this.jb||this.X):0,this.jb=Date.now());return E({timerDuration:a,timerStart:this.X||0})};function Xc(a){this.root=a;this.B={};this.Gd=1}p(Xc,X);h=Xc.prototype;h.getTrackedTimerKeys=function(){return Object.keys(this.B)};h.dispose=function(){var a=this;this.getTrackedTimerKeys().forEach(function(b){a.Pb(b)})};
h.add=function(a,b,c,d){var e=this;c=c.timerSpec;D(c&&"object"==typeof c,"Bad timer specification");var f="startSpec"in c?c.startSpec:null;D(!f||"object"==typeof f,"Bad timer start specification");var g="stopSpec"in c?c.stopSpec:null;D(!f&&!g||"object"==typeof g,"Bad timer stop specification");var k=++this.Gd;if(f){var l=fd(this,f);D(l,"Cannot track timer start");var m=l.add.bind(l,a,f.on,f,this.oc.bind(this,k,b,d))}if(g){var n=fd(this,g);D(n,"Cannot track timer stop");var r=n.add.bind(n,a,g.on,g,
this.oc.bind(this,k,b,d))}var t=new ed(c,m,r);this.B[k]=t;t.init(this.Ic.bind(this,k,b,d));return function(){e.Pb(k)}};function fd(a,b){b=B().assertString(b.on);var c=$c(b);return a.root.getTrackerForWhitelist(c,ad("timer"))}h.oc=function(a,b,c){var d=this.B[a];d&&(d.isRunning()?this.ub(a):this.Ic(a,b,c))};h.Ic=function(a,b,c){var d=this;this.B[a].startIntervalInWindow(this.root.ampdoc.win,function(){var e=new W(d.root.getRootElement(),b,d.B[a].getTimerVars());c(e)},this.Pb.bind(this,a))};h.ub=function(a){this.B[a].ub(this.root.ampdoc.win)};
h.Pb=function(a){this.B[a]&&(this.ub(a),this.B[a].dispose(),delete this.B[a])};function Yc(a){this.root=a;var b=this;this.sb=new S;this.Ab=this.sb.fire.bind(this.sb);Object.keys(Pc).forEach(function(a){b.root.getRoot().addEventListener(Pc[a],b.Ab)})}p(Yc,X);Yc.prototype.dispose=function(){var a=this,b=this.root.getRoot();Object.keys(Pc).forEach(function(c){b.removeEventListener(Pc[c],a.Ab)});this.sb=this.Ab=null};
Yc.prototype.add=function(a,b,c,d){var e=c.videoSpec||{},f=this.root.getElement(a,c.selector||e.selector,c.selectionMethod||null),g=e["end-session-when-invisible"],k=e["exclude-autoplay"],l=e.interval,m=e.percentages,n=c.on,r=5,t=0,ea=0;return this.sb.add(function(a){var b=a.type,c=a.data,e="video-session-visible"==b?"video-session":"video-hosted-custom"==b?c["__amp:eventType"]:b;if(e===n)if("video-seconds-played"!==e||l){if("video-seconds-played"===e&&(t++,0!==t%l))return;if("video-percentage-played"===
e){if(!m){B().error("amp-analytics/events","video-percentage-played requires percentages spec.");return}for(var pa=0;pa<m.length;pa++){var Mc=m[pa];if(0>=Mc||0!=Mc%r){B().error("amp-analytics/events","Percentages must be set in increments of %s with non-zero values",r);return}}var te=c.normalizedPercentage,Va=parseInt(te,10);z(Va);if(ea==Va||0>m.indexOf(Va))return;ea=Va}if("video-session-visible"!==b||g)if(!k||"playing_auto"!==c.state){var ue=a.target;f.then(function(a){if(a.contains(ue)){if(c){var b=
Object.assign({},c);delete b["__amp:eventType"]}else b=c;var f=b;d(new W(a,e,f))}})}}else B().error("amp-analytics/events","video-seconds-played requires interval spec with non-zero value")})};function Sc(a){this.root=a;this.Mc={}}p(Sc,X);h=Sc.prototype;h.dispose=function(){};
h.add=function(a,b,c,d){var e=this,f=c.visibilitySpec||{},g=c.selector||f.selector,k=f.waitFor,l=f.reportWhen,m=null,n=[];l&&D(!f.repeat,"reportWhen and repeat are mutually exclusive.");"hidden"===b&&(l&&B().error("amp-analytics/events",'ReportWhen should not be defined when eventType is "hidden"'),l="documentHidden");var r=this.root.isUsingHostAPI().then(function(a){if(a){var b=l;D(!g||":root"==g||":host"==g,"Element %s that is not root is not supported with host API",g);D("documentExit"!==b,"reportWhen : documentExit is not supported with host API")}return e.root.getVisibilityManager()});
"documentHidden"==l?m=this.Yc.bind(this):"documentExit"==l?m=this.Xc.bind(this):D(!l,'reportWhen value "%s" not supported.',l);if(g&&":root"!=g&&":host"!=g){c=c.selectionMethod||f.selectionMethod;var t=k||"ini-load";gd(g);this.root.getAmpElements(a.parentElement||a,g,c).then(function(a){for(var c={$:0};c.$<a.length;c={$:c.$},c.$++)n.push(r.then(function(c){return function(g){return g.listenElement(a[c.$],f,e.getReadyPromise(t,a[c.$]),m,e.zc.bind(e,b,d,a[c.$]))}}(c),function(){}))})}else t=k||(g?"ini-load":
null),n.push(r.then(function(a){return a.listenRoot(f,e.getReadyPromise(t),m,e.zc.bind(e,b,d,e.root.getRootElement()))},function(){}));return function(){return Promise.all(n).then(function(a){for(var b=0;b<a.length;b++)a[b]()})}};function gd(a){if(x(a))for(var b={},c=0;c<a.length;c++)D(!b[a[c]],"Cannot have duplicate selectors in selectors list: %s",a),b[a[c]]=a[c]}
h.Yc=function(){var a=this.root.ampdoc;return a.isVisible()?new Promise(function(b){a.onVisibilityChanged(function(){a.isVisible()||b()})}):q()};h.Xc=function(){var a=new u,b=this.root.ampdoc.win,c,d;"onpagehide"in this.root.ampdoc.win||b.addEventListener("unload",c=function(){b.removeEventListener("unload",c);a.resolve()});b.addEventListener("pagehide",d=function(){b.removeEventListener("pagehide",d);a.resolve()});return a.promise};
h.getReadyPromise=function(a,b){if(!a)return null;var c=ad("visible");D("none"==a||void 0!==c[a],"waitFor value %s not supported",a);var d=this.Mc[a]||this.root.getTrackerForWhitelist(a,c);if(d)this.Mc[a]=d;else return null;return b?d.getElementSignal(a,b):d.getRootSignal(a)};h.zc=function(a,b,c,d){var e=ob(c),f;for(f in e)d[f]=e[f];b(new W(c,a,d))};var hd=!1;function id(){this.I=[]}id.prototype.peek=function(){var a=this.I.length;return a?this.I[a-1].item:null};id.prototype.enqueue=function(a,b){if(isNaN(b))throw Error("Priority must not be NaN.");for(var c=b,d=-1,e=0,f=this.I.length;e<=f;){d=Math.floor((e+f)/2);if(d===this.I.length)break;if(this.I[d].priority<c)e=d+1;else if(0<d&&this.I[d-1].priority>=c)f=d-1;else break}this.I.splice(d,0,{item:a,priority:b})};id.prototype.forEach=function(a){for(var b=this.I.length;b--;)a(this.I[b].item)};
id.prototype.dequeue=function(){return this.I.length?this.I.pop().item:null};ja.Object.defineProperties(id.prototype,{length:{configurable:!0,enumerable:!0,get:function(){return this.I.length}}});var jd=/nochunking=1/.test(self.location.hash),kd=q();function ld(a,b,c){if(jd)kd.then(b);else{var d=md,e=J(a),f=K(e);db(f,e,"chunk",d);M(a,"chunk").run(b,c)}}function Y(a){this.state="not_run";this.Db=a}function nd(a,b){if("run"!=a.state){a.state="run";try{a.Db(b)}catch(c){throw a.Bc(),c;}}}Y.prototype.w=function(){return this.Db.displayName||this.Db.name};Y.prototype.Bc=function(){};Y.prototype.qc=function(){return!1};Y.prototype.Lc=function(){return!1};
function od(a,b,c){Y.call(this,a);this.fc=c}p(od,Y);
od.prototype.Bc=function(){var a=self.document;if(!hd){hd=!0;a=a.body;var b={opacity:1,visibility:"visible",animation:"none"},c;for(c in b){var d=a,e=b[c];var f=d.style;var g=c;if(G(g,"--"))f=g;else{Zb||(Zb=Aa());var k=Zb[g];if(!k){k=g;if(void 0===f[g]){var l=g;l=l.charAt(0).toUpperCase()+l.slice(1);b:{for(var m=0;m<$b.length;m++){var n=$b[m]+l;if(void 0!==f[n]){l=n;break b}}l=""}void 0!==f[l]&&(k=l)}Zb[g]=k}f=k}f&&(G(f,"--")?d.style.setProperty(f,e):d.style[f]=e)}}};od.prototype.qc=function(){return this.fc.ampdoc.isVisible()};
od.prototype.Lc=function(){return this.fc.ic};function md(a){var b=this;this.ampdoc=a;this.l=a.win;this.ua=new id;this.bc=this.lc.bind(this);this.Aa=0;this.rb=!1;this.Oc=this.l.document.documentElement.hasAttribute("i-amphtml-no-boilerplate");this.l.addEventListener("message",function(a){"amp-macro-task"==a.data&&b.lc(null)});this.ic=!1;eb(K(a),"viewer").then(function(){b.ic=!0});a.onVisibilityChanged(function(){a.isVisible()&&pd(b)})}
md.prototype.run=function(a,b){var c=new Y(a);this.ua.enqueue(c,b);pd(this)};md.prototype.runForStartup=function(a){a=new od(a,this.l,this);this.ua.enqueue(a,Number.POSITIVE_INFINITY);pd(this)};function qd(a,b){for(var c=a.ua.peek();c&&"not_run"!==c.state;)a.ua.dequeue(),c=a.ua.peek();c&&b&&a.ua.dequeue();return c}
md.prototype.lc=function(a){var b=this,c=qd(this,!0);if(!c)return this.rb=!1,this.Aa=0,!1;try{var d=Date.now();nd(c,a)}finally{kd.then().then().then().then().then().then().then().then().then(function(){b.rb=!1;b.Aa+=Date.now()-d;pd(b)})}return!0};function rd(a){a.Oc&&5<a.Aa?(a.Aa=0,sd(a)):kd.then(function(){a.bc(null)})}function pd(a){if(!a.rb){var b=qd(a);b&&(b.qc()?(a.rb=!0,rd(a)):b.Lc()&&a.l.requestIdleCallback?td(a.l,a.bc):sd(a))}}function sd(a){a.l.postMessage("amp-macro-task","*")}
function td(a,b){function c(f){if(f.timeRemaining()<d){var g=2E3-(Date.now()-e);0>=g||f.didTimeout?b(f):a.requestIdleCallback(c,{timeout:g})}else b(f)}var d=15,e=Date.now();a.requestIdleCallback(c,{timeout:2E3})};var ud={referrerDomains:!0,enabled:!0,cookiePath:!0,cookieMaxAge:!0,cookieSecure:!0,cookieDomain:!0};function vd(a,b,c){this.l=a;this.j=b;this.Na=N(b);this.vb=null;this.h=c;this.Nc=Ec(b).getMacros(b)}vd.prototype.write=function(){var a=this;if(!this.vb){this.vb=new u;var b=function(){a.vb.resolve(wd(a))};I(this.l,"analytics-chunks")?ld(this.j,b,10):b()}return this.vb.promise};
function wd(a){if(!kc(a.l,a.j)||!F(a.h,"cookies"))return q();if(!y(a.h.cookies))return B().error("amp-analytics/cookie-writer","cookies config must be an object"),q();var b=a.h.cookies;if(!1===b.enabled)return q();var c=b;if(F(c,"cookieMaxAge")){var d=Number(c.cookieMaxAge);d||0===d?(0>=d&&B().warn("amp-analytics/cookie-writer","cookieMaxAge %s less than or equal to 0, cookie will immediately expire",c.cookieMaxAge),c=1E3*d):(B().error("amp-analytics/cookie-writer","invalid cookieMaxAge %s, falling back to default value (1 year)",
c.cookieMaxAge),c=31536E6)}else c=31536E6;var e=c;c=Object.keys(b);d=[];for(var f=0;f<c.length;f++){var g=c[f],k=b[g];var l=k;ud[g]?l=!1:y(l)?F(l,"value")?l=!0:(B().error("amp-analytics/cookie-writer","value is required in the cookieValue object"),l=!1):(B().error("amp-analytics/cookie-writer","cookieValue must be configured in an object"),l=!1);l&&d.push(xd(a,g,k.value,e))}return Promise.all(d)}
function xd(a,b,c,d){return a.Na.expandStringAsync(c,a.Nc).then(function(c){if(c){var e=Date.now()+d,g=a.l,k={highestAvailableDomain:!0};k=void 0===k?{}:k;if(k.allowOnProxyOrigin)D(!k.highestAvailableDomain,"Could not support highestAvailable Domain on proxy origin, specify domain explicitly");else{D(!Ra(g.location.href),"Should never attempt to set cookie on proxy origin: "+b);var l=H(g.location.href).hostname.toLowerCase(),m=H(va.cdn).hostname.toLowerCase();D(!(l==m||Da(l,"."+m)),"Should never attempt to set cookie on proxy origin. (in depth check): "+
b)}l=void 0;k.domain?l=k.domain:k.highestAvailableDomain&&(l=Tb(g));Ub(g,b,c,e,l,k.sameSite,k.secure)}}).catch(function(a){B().error("amp-analytics/cookie-writer","Error expanding cookie string",a)})};function yd(a){this.F=O(a.ampdoc);this.sd=M(a.ampdoc,"mutator");this.ka=null;this.ta=new S;this.D=a.getRootElement();this.gb=null}yd.prototype.dispose=function(){this.ta.removeAll();this.ka&&(this.ka(),this.ka=null)};yd.prototype.removeScrollHandler=function(a){this.ta.remove(a);0>=this.ta.getHandlerCount()&&this.ka&&(this.ka(),this.ka=null)};
yd.prototype.addScrollHandler=function(a){var b=this,c=this.F.getSize();(this.gb||zd(this)).then(function(d){var e=d,f=e.top,g=e.left,k=e.width;e=e.height;var l={top:b.F.getScrollTop()-f,left:b.F.getScrollLeft()-g,width:c.width,height:c.height,scrollHeight:e,scrollWidth:k,initialSize:{scrollHeight:e,scrollWidth:k}};a(l)});0===this.ta.getHandlerCount()&&(this.ka=this.F.onChanged(this.vd.bind(this)));return this.ta.add(a)};
yd.prototype.vd=function(a){var b=this;return Promise.all([this.gb||zd(this),zd(this)]).then(function(c){var d=c[0],e=d.height,f=d.width;d=c[1];b.ta.fire({top:a.top-d.top,left:a.left-d.left,width:a.width,height:a.height,scrollWidth:d.width,scrollHeight:d.height,initialSize:{scrollHeight:e,scrollWidth:f}})})};function zd(a){var b=a.sd.measureElement(function(){return a.F.getLayoutRect(a.D)});a.gb=a.gb||b;return b};function Ad(a,b){var c,d=this;this.Jc=L(a,"timer");this.md=b;this.bd=c||0;this.Ja=-1;this.Ob=0;this.Tb=!1;this.Rc=function(){d.Ja=-1;d.Ob=0;d.Tb=!0;d.md();d.Tb=!1}}Ad.prototype.isPending=function(){return-1!=this.Ja};Ad.prototype.schedule=function(a){var b=a||this.bd;this.Tb&&10>b&&(b=10);var c=Date.now()+b;return!this.isPending()||-10>c-this.Ob?(this.cancel(),this.Ob=c,this.Ja=this.Jc.delay(this.Rc,b),!0):!1};Ad.prototype.cancel=function(){this.isPending()&&(this.Jc.cancel(this.Ja),this.Ja=-1)};function Bd(a,b,c,d){return{left:a,top:b,width:c,height:d,bottom:b+d,right:a+c,x:a,y:b}}function Cd(a){for(var b=-Infinity,c=Infinity,d=-Infinity,e=Infinity,f=0;f<arguments.length;f++){var g=arguments[f];if(g&&(b=Math.max(b,g.left),c=Math.min(c,g.left+g.width),d=Math.max(d,g.top),e=Math.min(e,g.top+g.height),c<b||e<d))return null}return Infinity==c?null:Bd(b,d,c-b,e-d)}
function Dd(a,b,c){c={top:c,bottom:c+b.getHeight(),left:0,right:b.getWidth()};var d=Bd(Number(c.left),Number(c.top),Number(c.width),Number(c.height));c=a;var e=d;c.top<=e.bottom&&e.top<=c.bottom&&c.left<=e.right&&e.left<=c.right?c="inside":(c=a,e=d,c=c.top<e.top?"top":c.bottom>e.bottom?"bottom":"inside");return c}function Ed(a,b,c){return 0==b&&0==c||0==a.width&&0==a.height?a:Bd(a.left+b,a.top+c,a.width,a.height)};var Fd=[0,.05,.1,.15,.2,.25,.3,.35,.4,.45,.5,.55,.6,.65,.7,.75,.8,.85,.9,.95,1],Gd=Date.now();function Hd(a){return"IntersectionObserver"in a&&"IntersectionObserverEntry"in a&&"intersectionRatio"in a.IntersectionObserverEntry.prototype}function Id(a){var b={threshold:Fd};this.ec=a;var c=b&&b.threshold;c=c?x(c)?c:[c]:[0];for(a=0;a<c.length;a++)z(c[a]);this.Fd=c.sort();this.Lb=null;this.P=[];this.qa=this.Ba=null}h=Id.prototype;h.disconnect=function(){this.P.length=0;Jd(this)};
h.observe=function(a){for(var b=0;b<this.P.length;b++)if(this.P[b].element===a){C().warn("INTERSECTION-OBSERVER","should observe same element once");return}var c={element:a,currentThresholdSlot:0};this.Lb&&(b=Kd(this,c,this.Lb))&&this.ec([b]);b=J(a);if(b.win.MutationObserver&&!this.Ba){this.qa=new Ad(b.win,this.kd.bind(this,a));var d=Wa(a,"hidden-observer");this.Ba=d.add(this.jd.bind(this))}this.P.push(c)};
h.unobserve=function(a){for(var b=0;b<this.P.length;b++)if(this.P[b].element===a){this.P.splice(b,1);0>=this.P.length&&Jd(this);return}C().warn("INTERSECTION-OBSERVER","unobserve non-observed element")};h.tick=function(a){this.Lb=a;for(var b=[],c=0;c<this.P.length;c++){var d=Kd(this,this.P[c],a);d&&b.push(d)}b.length&&this.ec(b)};
function Kd(a,b,c){var d=b.element,e=d.getLayoutBox(),f=d.getOwner(),g=f&&f.getLayoutBox(),k=Cd(e,g,c)||Bd(0,0,0,0),l=k;f=e;l=l.width*l.height;f=f.width*f.height;f=0===f?0:l/f;a=a.Fd;l=0;var m=a.length;if(0==f)a=0;else{for(var n=(l+m)/2|0;l<n;)f<a[n]?m=n:l=n,n=(l+m)/2|0;a=m}var r=a;if(r==b.currentThresholdSlot)return null;b.currentThresholdSlot=r;b=k;a=e;if(l=c)b=Ed(b,-c.left,-c.top),a=Ed(a,-c.left,-c.top),l=Ed(l,-c.left,-c.top);var t={time:"undefined"!==typeof performance&&performance.now?performance.now():
Date.now()-Gd,rootBounds:l,boundingClientRect:a,intersectionRect:b,intersectionRatio:f,target:d};return t}h.jd=function(){this.qa.isPending()||this.qa.schedule(16)};h.kd=function(a){var b=this,c=O(a);sb(a).onNextPass(function(){b.tick(c.getRect())})};function Jd(a){a.Ba&&a.Ba();a.Ba=null;a.qa&&a.qa.cancel();a.qa=null};function Ld(a,b){var c=this;this.Tc=b;this.N=E({visiblePercentageMin:Number(a.visiblePercentageMin)/100||0,visiblePercentageMax:Number(a.visiblePercentageMax)/100||1,totalTimeMin:Number(a.totalTimeMin)||0,totalTimeMax:Number(a.totalTimeMax)||Infinity,continuousTimeMin:Number(a.continuousTimeMin)||0,continuousTimeMax:Number(a.continuousTimeMax)||Infinity});"0"===String(a.visiblePercentageMax).trim()&&(this.N.visiblePercentageMax=0);this.od=void 0!==a.reportWhen;this.Ec=!0===a.repeat;this.fa=new S;
var d=new u;this.Ya=d.promise;this.na=d.resolve;this.Ya.then(function(){c.fa.fire()});this.ja=[];this.Zc=Date.now();this.Qb=this.Cc=!0;this.J=this.Xa=null;this.Cb=this.pa=!1;this.sc=this.Ca=this.lb=this.Fa=this.Mb=this.kb=this.ab=this.Jb=this.$a=this.R=this.W=this.T=0;this.Yb=this.rc=!1;this.qb=null}h=Ld.prototype;
h.ob=function(){var a=this,b=new u;this.Ya=b.promise;this.na=b.resolve;this.Ya.then(function(){a.fa.fire()});this.qb=null;this.pa=this.Cb=!1;this.Ca=this.lb=this.Fa=this.kb=this.Jb=this.$a=this.ab=this.R=this.W=this.T=0;this.Yb=!1};h.maybeDispose=function(){this.Ec||this.dispose()};h.dispose=function(){this.J&&(clearTimeout(this.J),this.J=null);this.qb&&(clearTimeout(this.qb),this.qb=null);this.ja.forEach(function(a){a()});this.ja.length=0;this.na=null;this.fa&&(this.fa.removeAll(),this.fa=null)};
h.unsubscribe=function(a){this.ja.push(a)};h.onTriggerEvent=function(a){this.fa&&this.fa.add(a);this.Ya&&!this.na&&a()};h.setReady=function(a){this.Cc=a;this.update()};h.setReportReady=function(a){this.Qb=!1;this.Xa=a};h.update=function(){Md(this,this.Cc?this.Tc():0)};
h.getState=function(a){return E({firstSeenTime:Nd(this.$a,a),lastSeenTime:Nd(this.Jb,a),lastVisibleTime:Nd(this.kb,a),firstVisibleTime:Nd(this.ab,a),maxContinuousVisibleTime:this.W,totalVisibleTime:this.R,loadTimeVisibility:100*this.Mb||0,minVisiblePercentage:100*this.Fa,maxVisiblePercentage:100*this.lb})};
function Md(a,b){if(a.Yb)Od(a,b)||a.ob();else if(a.na){var c=Pd(a,b)||a.od;if(c)if(a.J&&(clearTimeout(a.J),a.J=null),a.Qb)a.na(),a.na=null,a.Ec&&(a.Yb=!0,a.T=0);else{if(a.Xa){var d=a.Xa();a.Xa=null;d.then(function(){a.Qb=!0;a.update()})}}else if(a.pa&&!a.J){var e=Qd(a);0<e&&(a.J=setTimeout(function(){a.J=null;a.update()},e))}else!a.pa&&a.J&&(clearTimeout(a.J),a.J=null)}}
function Od(a,b){return 1==a.N.visiblePercentageMin?1==b:0==a.N.visiblePercentageMax?0==b:b>a.N.visiblePercentageMin&&b<=a.N.visiblePercentageMax}
function Pd(a,b){var c=Date.now();0<b&&(a.$a=a.$a||c,a.Jb=c,!a.Mb&&300>c-a.Zc&&(a.Mb=b));var d=a.pa,e=a.Ca?c-a.Ca:0;a.pa=Od(a,b);a.pa?(a.Cb=!0,d?(a.R+=e,a.T+=e,a.W=Math.max(a.W,a.T)):a.ab=a.ab||c,a.Ca=c,a.Fa=0<a.Fa?Math.min(a.Fa,b):b,a.lb=Math.max(a.lb,b),a.kb=c):d&&(a.W=Math.max(a.W,a.T+e),a.Ca=0,a.R+=e,a.T=0,a.kb=c);return a.Cb&&a.R>=a.N.totalTimeMin&&a.R<=a.N.totalTimeMax&&a.W>=a.N.continuousTimeMin&&a.W<=a.N.continuousTimeMax}
h.maybeSetInitialScrollDepth=function(a){this.rc||(this.sc=a,this.rc=!0)};h.getInitialScrollDepth=function(){return this.sc};function Qd(a){var b=Math.max(a.N.continuousTimeMin-a.T,0),c=Math.max(a.N.totalTimeMin-a.R,0),d=Math.max(b,c);return Math.min(d,b||Infinity,c||Infinity)}function Nd(a,b){return a>=b?a-b:0};function Rd(a){var b=a.parentElement,c=[];if(b){var d=b;c.push(d);for(var e=0;50>e;e++)if((b=d.parentNode||d.parentElement)&&1==b.nodeType)d=b,c.push(d);else if(b&&9==b.nodeType)if((b=d.ownerDocument.defaultView.frameElement)&&1==b.nodeType)d=b,c.push(d);else break;else break}var f=c;f.push(a);var g=1;for(a=0;a<f.length;a++){if(c=f[a])if(c=window.getComputedStyle(c)||Aa(),b=c.opacity,"hidden"===c.visibility)var k=0;else c=""===b?1:parseFloat(b),k=isNaN(c)?1:c;else k=1;k<g&&(g=k);if(0===g)break}return g}
;var Sd=1;function Td(a){var b=a.__AMP_VIS_ID;b||(b=++Sd,a.__AMP_VIS_ID=b);return b}function Ud(a){if(!a.__AMP_VIS){var b=J(a);var c=bb(a),d=c&&c.__AMP_EMBED__,e;if(e=c)if(Node.prototype.getRootNode)e=c.getRootNode()||c;else{for(;c.parentNode&&(!c||"I-AMPHTML-SHADOW-ROOT"!=c.tagName&&(11!=c.nodeType||"[object ShadowRoot]"!==Object.prototype.toString.call(c)));c=c.parentNode);e=c}c=e;b=d&&c?new Vd(Ud(c),d):new Wd(b);a.__AMP_VIS=b}return a.__AMP_VIS}
function Z(a,b){var c=this;this.parent=a;this.ampdoc=b;this.Bd=sb(b);this.Sb=0;this.ea=[];this.G=null;this.ja=[];this.Nb=0;this.parent&&Xd(this.parent,this);var d=O(this.ampdoc);d.onChanged(function(){c.maybeUpdateMaxScrollDepth(d.getScrollTop())})}function Xd(a,b){a.G||(a.G=[]);a.G.push(b)}function Yd(a,b){a.G&&(b=a.G.indexOf(b),-1!=b&&a.G.splice(b,1))}h=Z.prototype;
h.dispose=function(){this.setRootVisibility(0);for(var a=this.ea.length-1;0<=a;a--)this.ea[a].dispose();this.ja.forEach(function(a){a()});this.ja.length=0;this.parent&&Yd(this.parent,this);if(this.G)for(a=0;a<this.G.length;a++)this.G[a].dispose()};h.unsubscribe=function(a){this.ja.push(a)};h.getStartTime=function(){};h.isBackgrounded=function(){};h.isBackgroundedAtStart=function(){};h.getRootMinOpacity=function(){};h.getRootLayoutBox=function(){};
h.getRootVisibility=function(){return this.parent?0<this.parent.getRootVisibility()?this.Sb:0:this.Sb};h.setRootVisibility=function(a){this.Sb=a;Zd(this);if(this.G)for(a=0;a<this.G.length;a++)Zd(this.G[a])};h.maybeUpdateMaxScrollDepth=function(a){a>this.Nb&&(this.Nb=a)};h.getMaxScrollDepth=function(){return this.Nb};function Zd(a){for(var b=0;b<a.ea.length;b++)a.ea[b].update()}h.listenRoot=function(a,b,c,d){var e=this.getRootVisibility.bind(this);return $d(this,e,a,b,c,d)};
h.listenElement=function(a,b,c,d,e){var f=this.getElementVisibility.bind(this,a);return $d(this,f,b,c,d,e,a)};
function $d(a,b,c,d,e,f,g){if(c.visiblePercentageThresholds&&void 0==c.visiblePercentageMin&&void 0==c.visiblePercentageMax){var k=[],l=c.visiblePercentageThresholds;if(!l||!x(l))return B().error("amp-analytics/visibility-manager","invalid visiblePercentageThresholds"),function(){};for(var m=0;m<l.length;m++){var n=l[m];if(x(n)&&2==n.length)if(z(n[0])&&z(n[1])){var r=Number(n[0]),t=Number(n[1]);if(0>r||100<t||r>t||r==t&&100!=r&&0!=t)B().error("amp-analytics/visibility-manager","visiblePercentageThresholds entry invalid min/max value");
else{var ea=c;ea.visiblePercentageMin=r;ea.visiblePercentageMax=t;var pa=new Ld(ea,b);k.push(ae(a,pa,d,e,f,g))}}else B().error("amp-analytics/visibility-manager","visiblePercentageThresholds entry is not valid number");else B().error("amp-analytics/visibility-manager","visiblePercentageThresholds entry length is not 2")}return function(){k.forEach(function(a){return a()})}}var de=new Ld(c,b);return ae(a,de,d,e,f,g)}
function ae(a,b,c,d,e,f){d&&b.setReportReady(d);var g=O(a.ampdoc),k=g.getScrollTop();a.maybeUpdateMaxScrollDepth(k);c?(b.setReady(!1),c.then(function(){b.setReady(!0);b.maybeSetInitialScrollDepth(k)})):b.maybeSetInitialScrollDepth(k);b.onTriggerEvent(function(){var c=a.getStartTime(),d=b.getState(c);d.backgrounded=a.isBackgrounded()?1:0;d.backgroundedAtStart=a.isBackgroundedAtStart()?1:0;d.totalTime=Date.now()-c;if(f){d.elementId=f.id;d.opacity=Rd(f);var k=a.Bd.getResourceForElementOptional(f);c=
k?k.getLayoutBox():g.getLayoutRect(f);var r=a.getElementVisibility(f),t=a.getElementIntersectionRect(f);Object.assign(d,E({intersectionRatio:r,intersectionRect:JSON.stringify(t)}))}else d.opacity=a.getRootMinOpacity(),d.intersectionRatio=a.getRootVisibility(),c=a.getRootLayoutBox();b.maybeDispose();c&&(Object.assign(d,E({elementX:c.left,elementY:c.top,elementWidth:c.width,elementHeight:c.height})),d.initialScrollDepth=Dd(c,g,b.getInitialScrollDepth()),d.maxScrollDepth=Dd(c,g,a.getMaxScrollDepth()));
e(d)});a.ea.push(b);b.unsubscribe(function(){var c=a.ea.indexOf(b);-1!=c&&a.ea.splice(c,1)});f&&b.unsubscribe(a.observe(f,function(){return b.update()}));b.update();return function(){b.dispose()}}h.observe=function(){};h.getElementVisibility=function(){};h.getElementIntersectionRect=function(){};
function Wd(a){Z.call(this,null,a);var b=this;this.F=O(a);this.ac=!a.isVisible();this.xa=this.isBackgrounded();this.ha=Aa();this.da=null;if("inabox"==w(this.ampdoc.win).runtime){a=this.ampdoc.getRootNode();var c=a.documentElement||a.body||a;this.unsubscribe(this.observe(c,this.setRootVisibility.bind(this)))}else this.setRootVisibility(this.ampdoc.isVisible()?1:0),this.unsubscribe(this.ampdoc.onVisibilityChanged(function(){var a=b.ampdoc.isVisible();a||(b.ac=!0);b.setRootVisibility(a?1:0)}))}
p(Wd,Z);h=Wd.prototype;h.dispose=function(){Z.prototype.dispose.call(this);this.da&&(this.da.disconnect(),this.da=null)};h.getStartTime=function(){return this.ampdoc.getFirstVisibleTime()};h.isBackgrounded=function(){return this.ac};h.isBackgroundedAtStart=function(){return this.xa};h.getRootMinOpacity=function(){var a=this.ampdoc.getRootNode();return Rd(a.documentElement||a.body||a)};
h.getRootLayoutBox=function(){var a=this.ampdoc.getRootNode();return this.F.getLayoutRect(a.documentElement||a.body||a)};
h.observe=function(a,b){var c=this;be(this,a);var d=Td(a),e=this.ha[d];e?0<e.intersectionRatio&&b(e.intersectionRatio):(e={element:a,intersectionRatio:0,intersectionRect:null,listeners:[]},this.ha[d]=e);e.listeners.push(b);this.da||(this.da=ce(this));this.da.observe(a);return function(){var e=c.ha[d];if(e){var g=e.listeners.indexOf(b);-1!=g&&e.listeners.splice(g,1);0==e.listeners.length&&(c.da.unobserve(a),delete c.ha[d])}}};
h.getElementVisibility=function(a){if(0==this.getRootVisibility())return 0;a=Td(a);return(a=this.ha[a])&&a.intersectionRatio||0};h.getElementIntersectionRect=function(a){if(0>=this.getElementVisibility(a))return null;a=Td(a);return(a=this.ha[a])?a.intersectionRect:null};
function ce(a){function b(){d.tick(a.F.getRect())}var c=a.ampdoc.win;if(Hd(c))return new c.IntersectionObserver(a.Ac.bind(a),{threshold:Fd});var d=new Id(a.Ac.bind(a));a.unsubscribe(a.F.onScroll(b));a.unsubscribe(a.F.onChanged(b));setTimeout(b);return d}function be(a,b){Hd(a.ampdoc.win)||"function"==typeof b.getLayoutBox||(b.getLayoutBox=function(){return a.F.getLayoutRect(b)},b.getOwner=function(){return null})}
h.Ac=function(a){var b=this;a.forEach(function(a){var c=a.intersectionRect;c=Bd(Number(c.left),Number(c.top),Number(c.width),Number(c.height));var e=a.intersectionRatio;e=Math.min(Math.max(e,0),1);a=Td(a.target);if(a=b.ha[a])for(a.intersectionRatio=e,a.intersectionRect=c,c=0;c<a.listeners.length;c++)a.listeners[c](e)})};function Vd(a,b){Z.call(this,a,a.ampdoc);this.embed=b;this.xa=this.parent.isBackgrounded();this.unsubscribe(this.parent.observe(b.host,this.setRootVisibility.bind(this)))}p(Vd,Z);
h=Vd.prototype;h.getStartTime=function(){return this.embed.getStartTime()};h.isBackgrounded=function(){return this.parent.isBackgrounded()};h.isBackgroundedAtStart=function(){return this.xa};h.getRootMinOpacity=function(){return Rd(this.embed.iframe)};h.getRootLayoutBox=function(){var a=this.embed.iframe;return O(this.ampdoc).getLayoutRect(a)};h.observe=function(a,b){return this.parent.observe(a,b)};h.getElementVisibility=function(a){return 0==this.getRootVisibility()?0:this.parent.getElementVisibility(a)};
h.getElementIntersectionRect=function(a){return 0==this.getRootVisibility()?null:this.parent.getElementIntersectionRect(a)};function ee(a,b){Z.call(this,null,a);this.Id=b;this.xa=!a.isVisible();this.uc=null;this.kc=!1;this.Id.onVisibilityChange(this.wd.bind(this))}p(ee,Z);h=ee.prototype;h.dispose=function(){Z.prototype.dispose.call(this);this.kc=!0};h.getStartTime=function(){return this.ampdoc.getFirstVisibleTime()};h.isBackgrounded=function(){return!this.ampdoc.isVisible()};h.isBackgroundedAtStart=function(){return this.xa};
h.getRootMinOpacity=function(){var a=this.ampdoc.getRootNode();return Rd(a.documentElement||a.body||a)};h.listenElement=function(){return function(){}};h.getRootLayoutBox=function(){return this.uc};h.wd=function(a){if(!this.kc){var b=a.visibleRatio;b=Math.min(Math.max(0,b),1);this.setRootVisibility(b);this.uc=a.visibleRect}};h.observe=function(){return function(){}};h.getElementVisibility=function(){return 0};
h.getElementIntersectionRect=function(){C().error("amp-analytics/visibility-manager","element level visibility not supported, getElementIntersectionRect should not be called in VisibilityManager for mApp");return E({})};var fe=["AMP-AD","AMP-ANALYTICS","AMP-PIXEL","AMP-AD-EXIT"];function ge(a,b,c){var d;a=J(a);return he(a,b,function(a){return!a.isDisplayed()||!a.overlaps(c)&&!a.isFixed()||d&&!a.prerenderAllowed()?!1:!0}).then(function(a){var b=[];a.forEach(function(a){fe.includes(a.element.tagName)||b.push(a.loadedOnce())});return Promise.all(b)})}
function he(a,b,c){return a.signals().whenSignal("ready-scan").then(function(){var c=[];sb(a).get().forEach(function(a){a.hasBeenMeasured()||a.hostWin!=b||a.hasOwner()||c.push(a.getPageLayoutBoxAsync())});return Promise.all(c)}).then(function(){return sb(a).get().filter(function(a){return a.hostWin==b&&!a.hasOwner()&&a.hasBeenMeasured()&&c(a)})})};function ie(a){this.ampdoc=a;this.B=Aa();this.Fb=this.Oa=this.Ka=this.Pa=null}h=ie.prototype;h.isUsingHostAPI=function(){var a=this;if(this.Oa)return this.Oa;J(this.ampdoc).getHeadNode().querySelector("script[host-service]")?this.Oa=eb(K(this.ampdoc),"host-visibility").then(function(b){a.Fb=b;return!0}).catch(function(a){if(a.fallback)return!1;throw B().createError("Host Visibility Service Error");}):this.Oa=Promise.resolve(!1);return this.Oa};
h.dispose=function(){for(var a in this.B)this.B[a].dispose(),delete this.B[a];this.Pa&&this.Pa.dispose();this.Ka&&this.Ka.dispose()};h.getType=function(){};h.getRoot=function(){};h.getViewer=function(){return M(this.ampdoc,"viewer")};h.getRootElement=function(){var a=this.getRoot();return a.host||a.documentElement||a.body||a};h.getHostElement=function(){};h.signals=function(){};h.contains=function(a){return this.getRoot().contains(a)};h.getElementById=function(){};
h.getTrackerForWhitelist=function(a,b){var c=b[a];return c?this.getTracker(a,c):null};h.getTracker=function(a,b){var c=this.B[a];c||(c=new b(this),this.B[a]=c);return c};h.getTrackerOptional=function(a){return this.B[a]||null};
h.getElement=function(a,b,c){var d=this;c=void 0===c?null:c;return":root"==b?la(function(){return d.getRootElement()}):":host"==b?new Promise(function(a){a(B().assertElement(d.getHostElement(),'Element "'+b+'" not found'))}):this.ampdoc.whenReady().then(function(){var e=null;try{if("scope"==c)if(void 0!==gb?gb:gb=hb(a))var f=a.querySelector(b.replace(/^|,/g,"$&:scope "));else{var g=nb(a,b);f=void 0===g[0]?null:g[0]}else f="closest"==c?kb(a,b):d.getRoot().querySelector(b);var k=f}catch(l){D(!1,"Invalid query selector "+
b)}k&&d.contains(k)&&(e=k);return B().assertElement(e,'Element "'+b+'" not found')})};function je(a,b){return a.ampdoc.whenReady().then(function(){for(var c=[],d=0;d<b.length;d++){var e=void 0,f=[],g=b[d];try{e=a.getRoot().querySelectorAll(g)}catch(l){D(!1,"Invalid query selector "+g)}for(var k=0;k<e.length;k++)a.contains(e[k])&&f.push(e[k]);D(f.length,'Element "'+g+'" not found');ke(f,g);c=c.concat(f)}return c.filter(function(a,b){return c.indexOf(a)===b})})}
h.getAmpElement=function(a,b,c){return this.getElement(a,b,c).then(function(a){ke([a],b);return a})};h.getAmpElements=function(a,b,c){return I(this.ampdoc.win,"visibility-trigger-improvements")&&x(b)?(D(!c,"Cannot have selectionMethod %s defined with an array selector.",c),je(this,b)):this.getAmpElement(a,b,c).then(function(a){return[a]})};function ke(a,b){for(var c=0;c<a.length;c++)D(a[c].classList.contains("i-amphtml-element"),'Element "%s" is required to be an AMP element',b)}
h.createSelectiveListener=function(a,b,c,d){var e=this;d=void 0===d?null:d;return function(f){if(":host"!=c)for(var g=e.getRootElement(),k="*"==c,l=":root"==c,m=f.target;m&&e.contains(m)&&("scope"!=d||l||b.contains(m));){if("closest"!=d||m.contains(b))if(k||l&&m==g||le(m,c)){a(m,f);break}m=m.parentElement}}};h.whenIniLoaded=function(){};h.getVisibilityManager=function(){this.Pa||(this.Pa=this.Fb?new ee(this.ampdoc,this.Fb):Ud(this.getRoot()));return this.Pa};
h.getScrollManager=function(){this.Ka||(this.Ka=new yd(this));return this.Ka};function me(a){ie.call(this,a)}p(me,ie);h=me.prototype;h.getType=function(){return"ampdoc"};h.getRoot=function(){return this.ampdoc.getRootNode()};h.getHostElement=function(){return null};h.signals=function(){return this.ampdoc.signals()};h.getElementById=function(a){return this.ampdoc.getElementById(a)};
h.whenIniLoaded=function(){var a=O(this.ampdoc);"inabox"==w(this.ampdoc.win).runtime?a=a.getLayoutRect(this.getRootElement()):(a=a.getSize(),a=Bd(0,0,a.width,a.height));return ge(this.ampdoc,this.ampdoc.win,a)};function ne(a,b){ie.call(this,a);this.embed=b}p(ne,ie);h=ne.prototype;h.getType=function(){return"embed"};h.getRoot=function(){return this.embed.win.document};h.getHostElement=function(){return this.embed.iframe};h.signals=function(){return this.embed.signals()};h.getElementById=function(a){return this.embed.win.document.getElementById(a)};
h.whenIniLoaded=function(){return this.embed.whenIniLoaded()};function le(a,b){try{return lb(a,b)}catch(c){return B().error("amp-analytics/analytics-root","Bad query selector.",b,c),!1}};function oe(a,b){this.D=a;this.$b=b;this.xc=[];this.Wb=0;this.l=b.ownerDocument.defaultView}oe.prototype.dispose=function(){this.xc.forEach(function(a){a()})};
oe.prototype.addTrigger=function(a,b){function c(){l=k.add(d.$b,e,a,b);d.xc.push(l);m.resolve()}var d=this,e=a.on,f=$c(e),g=ad(this.D.getType()),k=this.D.getTrackerForWhitelist(f,g);D(!!k,'Trigger type "%s" is not allowed in the %s',e,this.D.getType());var l,m=new u;1>this.Wb||!I(this.l,"analytics-chunks")?c():ld(this.$b,c,3>this.Wb?20:10);this.Wb++;return m.promise};function pe(a){this.ampdoc=a;this.D=qe(this,a.getRootNode())}pe.prototype.dispose=function(){this.D.dispose()};pe.prototype.getAnalyticsRoot=function(a){return qe(this,a)};pe.prototype.createAnalyticsGroup=function(a){var b=qe(this,a);return new oe(b,a)};function re(a){switch(a){case "story":return Wc;default:return V}}pe.prototype.triggerEventForTarget=function(a,b,c){c=new W(a,b,c);a=qe(this,a);b=$c(b);a.getTracker(b,re(b)).trigger(c)};
function qe(a,b){var c=J(b),d=(b=bb(b))&&b.__AMP_EMBED__;return c==a.ampdoc&&!d&&a.D?a.D:se(d||c,function(){return d?new ne(c,d):new me(c)})}function se(a,b){var c=a.__AMP_AN_ROOT;c||(c=b(),a.__AMP_AN_ROOT=c);return c};function ve(a,b,c,d){this.m=a;this.h=b.linkers;this.Hd=b.vars||{};this.K=c;this.j=d;this.pb={};this.wa=Wa(this.j,"url");this.cd=eb(K(a),"form-submit-service");this.bb=null;this.L=Ec(this.m);this.cb=null}
ve.prototype.init=function(){var a=this;if(!y(this.h))return q();this.cb=Tb(this.m.win);this.h=we(this,this.h);var b=Object.keys(this.h).map(function(b){var c=a.h[b].ids,d=Object.keys(c),g=d.map(function(b){var d=new P(a.Hd,void 0,!0);return a.Za(c[b],d)});return Promise.all(g).then(function(c){var e={};c.forEach(function(a,b){a&&(e[d[b]]=a)});return a.pb[b]=e})});if(b.length){var c=M(this.m,"navigation");c.registerAnchorMutator(function(b,c){b.href&&"click"===c.type&&(b.href=xe(a,b.href))},2);c.registerNavigateToMutator(function(b){return xe(a,
b)},2)}ye(this);return Promise.all(b)};ve.prototype.dispose=function(){this.bb&&this.bb()};
function we(a,b){var c={},d={enabled:ze(a)&&Ae(a)},e=Object.keys(b).filter(function(a){var c=b[a],e=y(c);e||(d[a]=c);return e}),f=a.wa.isProxyOrigin(a.m.win.location);e.forEach(function(a){var e=Object.assign({},d,b[a]);if(!0!==e.enabled)B().info("amp-analytics/linker-manager","linker config for %s is not enabled and will be ignored.",a);else if(f||!1===e.proxyOnly)e.ids?c[a]=e:B().error("amp-analytics/linker-manager",'"ids" is a required field for use of "linkers".')});return c}
ve.prototype.Za=function(a,b){var c=this,d=this.L.getMacros(this.j);return this.L.expandTemplate(a,b,this.j).then(function(a){return N(c.j).expandUrlAsync(a,d)})};
function ze(a){if("googleanalytics"!==a.K||"googleanalytics"!==a.m.getMetaByName("amp-google-client-id-api"))return!1;var b=a.m.getHeadNode(),c=b instanceof ShadowRoot?a.m.getBody():b.querySelector('meta[name="amp-google-client-id-api"][content="googleanalytics"]');if(c.hasAttribute("i-amphtml-linker-created"))return!1;c.setAttribute("i-amphtml-linker-created","");return!0}function Ae(a){a=L(a.m.win,"platform");return a.isSafari()&&12<=a.getMajorVersion()}
function xe(a,b){var c=a.h,d;for(d in c)if(a.pb[d]){var e=a,f=d;if(Be(e,b,f,c[d].destinationDomains)){var g=oc(e.pb[f]);if(g){e={};e[f]=g;f=e;e=H(b);e=v(e.search);g=E({});for(var k=Object.keys(f),l=0;l<k.length;l++)F(e,k[l])||(g[k[l]]=f[k[l]]);b=Oa(b,Pa(g))}}}return b}
function Be(a,b,c,d){var e=a.wa.parse(b).hostname;if(d&&!Array.isArray(d))return B().warn("amp-analytics/linker-manager","%s destinationDomains must be an array.",c),!1;if(d)return Ce(d,e);var f=a.m.win.location.hostname;if(f===e)return!1;b=M(a.m,"documentInfo").get();var g=b.sourceUrl,k=a.wa.parse(b.canonicalUrl).hostname,l=De(k)===De(e);if(a.cb){var m=[a.cb,"*"+a.cb];return Ce(m,e)||l}a=a.wa.parse(g).hostname;return De(a)===De(e)||l}
function Ce(a,b){for(var c=0;c<a.length;c++){var d=a[c],e;!(e=d===b)&&(e=-1!==d.indexOf("*"))&&(e=b,d=d.replace(/[-\/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*"),e=(new RegExp("^"+d+"$")).test(e));if(e)return!0}return!1}function ye(a){a.bb||a.cd.then(function(b){a.bb=b.beforeSubmit(a.hd.bind(a))})}
ve.prototype.hd=function(a){var b=a.form,c=a.actionXhrMutator,d;for(d in this.h){a=this.h[d].destinationDomains;var e=b.getAttribute("action-xhr")||b.getAttribute("action");if(Be(this,e,d,a)&&(a=d,e=this.pb[a])){var f=oc(e);(e=b.getAttribute("action-xhr"))?(a=encodeURIComponent(a)+"="+encodeURIComponent(f),a=Oa(e,a,void 0),c(a)):(a=E({type:"hidden",name:a,value:f}),a=ib(b.ownerDocument,"input",a),b.appendChild(a))}}};function De(a){return a.replace(/^(?:www\.|m\.|amp\.)+/,"")};function Ee(){}Ee.prototype.generateRequest=function(a,b,c){return(c=void 0===c?!1:c)?{url:a.replace("${extraUrlParams}",""),payload:JSON.stringify(b.extraUrlParams)}:{url:Fe(a,[b])}};Ee.prototype.generateBatchRequest=function(a,b,c){return(void 0===c?0:c)?{url:a.replace("${extraUrlParams}",""),payload:JSON.stringify(b.map(function(a){return a.extraUrlParams}))}:{url:Fe(a,b)}};var Ge={"default":new Ee};
function Fe(a,b){var c=b.map(function(a){return Pa(a.extraUrlParams)}).filter(function(a){return!!a}).join("&"),d;return d=0<=a.indexOf("${extraUrlParams}")?a.replace("${extraUrlParams}",c):Oa(a,c)};var He={RANDOM:!0,CANONICAL_URL:!0,CANONICAL_HOST:!0,CANONICAL_HOSTNAME:!0,CANONICAL_PATH:!0,AMPDOC_URL:!0,AMPDOC_HOST:!0,AMPDOC_HOSTNAME:!0,SOURCE_URL:!0,SOURCE_HOST:!0,SOURCE_HOSTNAME:!0,SOURCE_PATH:!0,TIMESTAMP:!0,TIMEZONE:!0,TIMEZONE_CODE:!0,VIEWPORT_HEIGHT:!0,VIEWPORT_WIDTH:!0,SCREEN_WIDTH:!0,SCREEN_HEIGHT:!0,AVAILABLE_SCREEN_HEIGHT:!0,AVAILABLE_SCREEN_WIDTH:!0,SCREEN_COLOR_DEPTH:!0,DOCUMENT_CHARSET:!0,BROWSER_LANGUAGE:!0,AMP_VERSION:!0,BACKGROUND_STATE:!0,USER_AGENT:!0,FIRST_CONTENTFUL_PAINT:!0,
FIRST_VIEWPORT_READY:!0,MAKE_BODY_VISIBLE:!0};function Ie(a){return new Promise(function(b){setTimeout(function(){return b(a())})})}
function Je(a){return y(a.resources)?a.encoding&&a.encoding.entry&&a.encoding.delim?2>a.encoding.base||36<a.encoding.base?(B().warn("ANALYTICS","resource timing variables only supports bases between 2 and 36"),!1):null!=a.responseAfter&&"number"!=typeof a.responseAfter?(B().warn("ANALYTICS",'resourceTimingSpec["responseAfter"] must be a number'),!1):!0:(B().warn("ANALYTICS","resourceTimingSpec is missing or has incomplete encoding options"),!1):(B().warn("ANALYTICS",'resourceTimingSpec missing "resources" field'),
!1)}function Ke(a,b){var c=H(a.name);for(a=0;a<b.length;++a){var d=b[a],e=d.hostPattern;d=d.resources;if(e.test(c.host)){var f=Yb(d,function(a){return a.pathPattern.test(c.pathname)&&a.queryPattern.test(c.search)});if(-1!=f)return d[f].name}}return null}
function Le(a){var b={},c;for(c in a){var d=a[c].host||"",e={name:c,pathPattern:new RegExp(a[c].path||""),queryPattern:new RegExp(a[c].query||"")};b[d]?b[d].resources.push(e):b[d]={hostPattern:new RegExp(d),resources:[e]}}var f=[],g;for(g in b)f.push(b[g]);return f}function Me(a,b){var c=Le(b),d=[];a.forEach(function(a){var b=Ke(a,c);b&&d.push({entry:a,name:b})});return d}
function Ne(a,b,c){function d(a,b){b=void 0===b?0:b;return Math.round(a-b).toString(f.base||10)}var e=b.resources,f=b.encoding,g=Ec(c);a=Me(a,e).map(function(a){var b=a,c=b.entry;b={key:b.name,startTime:d(c.startTime),redirectTime:d(c.redirectEnd,c.redirectStart),domainLookupTime:d(c.domainLookupEnd,c.domainLookupStart),tcpConnectTime:d(c.connectEnd,c.connectStart),serverResponseTime:d(c.responseStart,c.requestStart),networkTransferTime:d(c.responseEnd,c.responseStart),transferSize:d(c.transferSize||
0),encodedBodySize:d(c.encodedBodySize||0),decodedBodySize:d(c.decodedBodySize||0),duration:d(c.duration),initiatorType:c.initiatorType};return new P(b,1)}).map(function(a){return g.expandTemplate(f.entry,a,c)});return Promise.all(a).then(function(a){return a.join(f.delim)})}
function Oe(a,b){var c=a.getAmpDoc().win;if(b.done||!c.performance||!c.performance.now||!c.performance.getEntriesByType||!Je(b))return b.done=!0,Promise.resolve("");var d=c.performance.getEntriesByType("resource");150<=d.length&&(b.done=!0);var e=b.responseAfter||0;b.responseAfter=Math.max(e,c.performance.now());d=d.filter(function(a){return a.startTime+a.duration>=e});return d.length?Ie(function(){return Ne(d,b,a)}):Promise.resolve("")}
function Pe(a,b,c){return b&&Date.now()<c+6E4?Oe(a,b):Promise.resolve("")};function Qe(a,b,c,d,e){this.j=a;this.m=a.getAmpDoc();this.win=this.m.win;this.Hc=b.origin;this.baseUrl=b.baseUrl;this.A=b.batchInterval;this.Gc=Number(b.reportWindow)||null;this.yb=null;this.L=Ec(a);this.Na=N(a);this.wa=Wa(a,"url");this.Rb=this.Ua=this.Ta=null;this.zb=[];this.yd=c;this.Y=d;this.Qa=e?He:void 0;this.nb=this.ba=null;this.Fc=!0;this.Kb=null;this.Ha=0;this.X=Date.now();Re(this);if(this.A){this.A=x(this.A)?this.A:[this.A];for(a=0;a<this.A.length;a++)b=this.A[a],D(z(b),"Invalid batchInterval value: %s",
this.A),b=1E3*Number(b),D(200<=b,"Invalid batchInterval value: %s, interval value must be greater than %s ms.",this.A,200),this.A[a]=b;this.yb=0;Se(this)}}
Qe.prototype.send=function(a,b,c){var d=this,e=!0===b.important;if(this.Fc||e){this.Ha++;this.Kb=b;var f=this.L.getMacros(this.j);f.RESOURCE_TIMING=Pe(this.j,b.resourceTimingSpec,this.X);this.Ta||(c.freezeVar("extraUrlParams"),this.Ua=this.L.expandTemplate(this.baseUrl,c,this.j,f,this.Qa),this.Ta=this.Ua.then(function(a){return d.Na.expandUrlAsync(a,f,d.Qa)}));if(!this.Rb&&this.Hc){var g=new P(c.vars,c.iterations,!0);this.Rb=this.L.expandTemplate(this.Hc,g,this.j,f,this.Qa).then(function(a){return d.Na.expandUrlAsync(a,
f,d.Qa,!0)})}var k=Object.assign({},a,b.extraUrlParams),l=this.win.Date.now(),m=Te(this.L,this.Na,k,c,f,this.j,this.Qa).then(function(a){return E({trigger:b.on,timestamp:l,extraUrlParams:a})});this.zb.push(m);0==this.Ha||!e&&this.A||Ue(this)}};Qe.prototype.dispose=function(){this.ob();this.ba&&(this.win.clearTimeout(this.ba),this.ba=null);this.nb&&(this.win.clearTimeout(this.nb),this.nb=null)};
function Ue(a){var b=a.Rb,c=a.Ua,d=a.Ta,e=a.zb,f=a.Kb;a.ob();var g=b?b:c;g.then(function(b){a.yd.url(a.m,b,!0)});Promise.all([d,Promise.all(e),b]).then(function(b){var c=b[0];var d=b[2];c=d?a.wa.parse(d).origin+c:c;b=b[1];0!==b.length&&(f.iframePing?(D("visible"==f.on,"iframePing is only available on page view requests."),a.Y.sendRequestUsingIframe(c,b[0])):a.Y.sendRequest(c,b,!!a.A))})}Qe.prototype.ob=function(){this.Ha=0;this.Ua=this.Ta=null;this.zb=[];this.Kb=null};
function Re(a){a.Gc&&(a.nb=a.win.setTimeout(function(){0!=a.Ha&&Ue(a);a.Fc=!1;a.ba&&(a.win.clearTimeout(a.ba),a.ba=null)},1E3*a.Gc))}function Se(a){var b=a.yb<a.A.length?a.A[a.yb++]:a.A[a.A.length-1];a.ba=a.win.setTimeout(function(){0!=a.Ha&&Ue(a);Se(a)},b)}
function Ve(a,b,c,d,e,f){var g=Ec(a),k=N(f),l=g.getMacros(f);e.freezeVar("extraUrlParams");var m=g.expandTemplate(b,e,f).then(function(a){return k.expandStringAsync(a,l)});return 0>b.indexOf("${extraUrlParams}")?m:m.then(function(a){var b=Object.assign({},c,d.extraUrlParams);return Te(g,k,b,e,l,f).then(function(b){return Fe(a,[E({extraUrlParams:b})])})})}
function Te(a,b,c,d,e,f,g){function k(c,d){var n=c[d];if("string"===typeof n){var r=a.expandTemplate(n,m,f).then(function(a){return b.expandStringAsync(a,e,g)}).then(function(a){return c[d]=a});l.push(r)}else x(n)?n.forEach(function(a,b){return k(n,b)}):y(n)&&null!==n&&Object.keys(n).forEach(function(a){return k(n,a)})}var l=[],m=new P(d.vars,d.iterations,!0);Object.keys(c).forEach(function(a){return k(c,a)});return Promise.all(l).then(function(){return c})};function We(a){var b=this;this.ed=a;this.wc=!1;this.Ga=[];this.xd=new ic(this.ed,function(){b.setIsReady()})}We.prototype.isReady=function(){return this.wc};We.prototype.setIsReady=function(){this.wc=!0;Xe(this)};We.prototype.queueSize=function(){return this.Ga.length};We.prototype.enqueue=function(a){this.Ga.push(a);100<=this.queueSize()&&(C().warn("amp-analytics/iframe-transport-message-queue","Exceeded maximum size of queue for: "+a.creativeId),this.Ga.shift());Xe(this)};
function Xe(a){a.isReady()&&a.queueSize()&&(a.xd.send("iframe-transport-events",{events:a.Ga}),a.Ga=[])};function Ye(a){return!!a.PerformanceObserver&&!!a.TaskAttributionTiming&&"containerName"in a.TaskAttributionTiming.prototype};function Ze(a){return(w().localDev||w().test)&&a.parent&&a.parent.location?(a=a.parent.location,a.protocol+"//"+a.host+"/dist/iframe-transport-client-lib.js"):va.thirdParty+"/2005012256000/iframe-transport-client-v0.js"}function $e(a,b,c,d){this.la=a;this.K=b;this.jc=d;this.mc=c.iframe;this.ud=0;this.processCrossDomainIframe()}h=$e.prototype;h.detach=function(){var a=this.la.document,b=this.K,c=af[b];--c.usageCount||(a.body.removeChild(c.frame),delete af[b],bf[b]&&(bf[b].disconnect(),bf[b]=null))};
h.processCrossDomainIframe=function(){if(F(af,this.K)){var a=af[this.K];++a.usageCount}else a=this.createCrossDomainIframe(),this.la.document.body.appendChild(a.frame),cf(this)};h.createCrossDomainIframe=function(){var a=String(++df),b=JSON.stringify({scriptSrc:Ze(this.la),sentinel:a,type:this.K}),c=ib(this.la.document,"iframe",{sandbox:"allow-scripts allow-same-origin",name:b,"data-amp-3p-sentinel":a});c.sentinel=a;ac(c);c.src=this.mc;a={frame:c,usageCount:1,queue:new We(c)};return af[this.K]=a};
function cf(a){Ye(a.la)&&(bf[a.K]=new a.la.PerformanceObserver(function(b){b&&b.getEntries().forEach(function(b){b&&"longtask"==b.entryType&&"cross-origin-descendant"==b.name&&b.attribution&&b.attribution.forEach(function(b){a.mc==b.containerSrc&&0==++a.ud%5&&B().error("amp-analytics/iframe-transport",'Long Task: Vendor: "'+a.K+'"')})})}),bf[a.K].observe({entryTypes:["longtask"]}))}h.sendRequest=function(a){af[this.K].queue.enqueue({creativeId:this.jc,message:a})};h.getCreativeId=function(){return this.jc};
h.getType=function(){return this.K};var af={},df=0,bf={};function ef(a,b,c){c&&"no-referrer"!==c&&B().error("pixel","Unsupported referrerPolicy: %s",c);return"no-referrer"===c?ff(a,b):gf(a,b)}function ff(a,b){if("referrerPolicy"in Image.prototype)return gf(a,b,!0);var c=ib(a.document,"iframe",E({src:"about:blank",style:"display:none"}));c.onload=function(){gf(c.contentWindow,b)};a.document.body.appendChild(c);return c}function gf(a,b,c){c=void 0===c?!1:c;a=new a.Image;c&&(a.referrerPolicy="no-referrer");a.src=b;return a};function hf(a,b){try{var c=bb(a,b).parentElement;if("AMP-AD"==c.nodeName)return String(c.getResourceId())}catch(d){}return null};function jf(a,b){b=void 0===b?{}:b;this.l=a;this.M=b;this.Dc=this.M.referrerPolicy;"no-referrer"===this.Dc&&(this.M.beacon=!1,this.M.xhrpost=!1);this.Kc=!!this.M.useBody;this.ca=null;this.ib="inabox"==w(a).runtime}
jf.prototype.sendRequest=function(a,b,c){function d(d){d=c?e.generateBatchRequest(a,b,d):e.generateRequest(a,b[0],d);Qa(d.url,"amp-analytics request");var f=d.url,g=H(f);g=v(g.search);D(!("__amp_source_origin"in g),"Source origin is not allowed in %s",f);return d}if(a&&0!==b.length){var e=Ge["default"],f=kf(d);if(this.M.iframe)this.ca?this.ca.sendRequest(f(!1).url):C().error("amp-analytics/transport","iframe transport was inadvertently deleted");else if(!this.M.beacon||!lf(this.l,f(this.Kc)))if(!this.M.xhrpost||
!mf(this.l,f(this.Kc))){var g=this.M.image;if(g){var k="object"==typeof g&&g.suppressWarnings;nf(this.l,f(!1),k,this.Dc)}else B().warn("amp-analytics/transport","Failed to send request",a,this.M)}}else C().info("amp-analytics/transport","Empty request not sent: ",a)};
jf.prototype.maybeInitIframeTransport=function(a){if(this.M.iframe&&!this.ca){var b=Xa(a.ownerDocument.defaultView),c=a.getAttribute("type"),d=this.ib?"1":B().assertString(hf(a,b),"No friendly amp-ad ancestor element was found for amp-analytics tag with iframe transport.");this.ca=new $e(b,c,this.M,d)}};jf.prototype.deleteIframeTransport=function(){this.ca&&(this.ca.detach(),this.ca=null)};
jf.prototype.sendRequestUsingIframe=function(a,b){var c=this;if(a=Fe(a,[b])){Qa(a,"amp-analytics request");D(H(a).origin!=H(this.l.location.href).origin,"Origin of iframe request must not be equal to the document origin. See https://github.com/ampproject/amphtml/blob/master/spec/amp-iframe-origin-policy.md for details.");var d=this.l.document.createElement("iframe");ac(d);d.onload=d.onerror=function(){L(c.l,"timer").delay(function(){d.parentElement&&d.parentElement.removeChild(d)},5E3)};d.setAttribute("amp-analytics",
"");d.setAttribute("sandbox","allow-scripts allow-same-origin");d.src=a;this.l.document.body.appendChild(d)}else B().error("amp-analytics/transport","Request not sent. Contents empty.")};function nf(a,b,c,d){a&&(a=ef(a,b.url,d),zb(a).then(function(){}).catch(function(){c||B().warn("amp-analytics/transport","Response unparseable or failed to send image request",b.url)}))}
function lf(a,b){a=a.navigator.sendBeacon?a.navigator.sendBeacon.bind(a.navigator):void 0;var c=a;return c?c(b.url,b.payload||""):!1}function mf(a,b){a=a.XMLHttpRequest;if(!a)return!1;var c=new a;if(!("withCredentials"in c))return!1;c.open("POST",b.url,!0);c.withCredentials=!0;c.setRequestHeader("Content-Type","text/plain");c.onreadystatechange=function(){};c.send(b.payload||"");return!0}function kf(a){var b={};return function(c){var d=String(c);void 0===b[d]&&(b[d]=a(c));return b[d]}};var of=["visible","hidden"];function pf(a){a=AMP.BaseElement.call(this,a)||this;a.hc=q();a.Bb=null;a.V=!1;a.Ia={};a.h={};a.tc=null;a.ma=null;a.L=null;a.$c=L(a.win,"crypto");a.U=null;a.Y=null;a.ib="inabox"==w(a.win).runtime;a.Da=null;a.Ib=null;return a}p(pf,AMP.BaseElement);h=pf.prototype;h.getLayoutPriority=function(){return this.ib?0:1};h.isAlwaysFixed=function(){return!jc(this.element)};h.isLayoutSupported=function(){return!0};
h.buildCallback=function(){var a=this;this.V=this.element.hasAttribute("sandbox");this.element.setAttribute("aria-hidden","true");this.Bb=this.element.getAttribute("data-consent-notification-id");null!=this.Bb&&(this.hc=qb(this.element).then(function(b){return b.get(a.Bb)}));"immediate"==this.element.getAttribute("trigger")&&qf(this)};h.layoutCallback=function(){return qf(this)};
h.detachedCallback=function(){this.ma&&(this.ma.dispose(),this.ma=null);this.Da&&(this.Da.dispose(),this.Da=null);for(var a in this.Ia)this.Ia[a].dispose(),delete this.Ia[a]};h.resumeCallback=function(){var a=this;this.U&&this.U.then(function(){a.Y.maybeInitIframeTransport(a.element)})};h.unlayoutCallback=function(){var a=this;if(this.getAmpDoc().isVisible())return!1;this.U&&this.U.then(function(){a.Y.deleteIframeTransport()});return AMP.BaseElement.prototype.unlayoutCallback.call(this)};
function qf(a){if(a.U)return a.U;ac(a.element);a.U=a.getAmpDoc().whenFirstVisible().then(function(){return L(a.win,"timer").promise(1)}).then(function(){return a.hc}).then(function(){return L(a.win,"ampdoc")}).then(function(b){return b.getAmpDoc(a.element)}).then(function(a){return Promise.all([eb(K(a),"amp-analytics-instrumentation"),eb(K(a),"amp-analytics-variables")])}).then(function(b){function c(){var b=(new Fc(a.element)).loadConfig();d.resolve(b)}a.tc=b[0];a.L=b[1];var d=new u;I(a.win,"analytics-chunks")?
ld(a.element,c,20):c();return d.promise}).then(function(b){a.h=b;return(new vd(a.win,a.element,a.h)).write()}).then(function(){a.Y=new jf(a.win,a.h.transport||{})}).then(a.Ad.bind(a)).then(a.pd.bind(a));return a.U}function rf(a){if(a.ib)return!0;null==a.Ib&&(a.Ib=jc(a.element));return a.Ib}
h.Ad=function(){var a=this;if(sf(this))return this.w(),q();tf(this);if(!this.h.triggers){var b=this.w();this.user().error(b,"No triggers were found in the config. No analytics data will be sent.");return q()}uf(this,this.h.extraUrlParams,this.h.extraUrlParamsReplaceMap);this.ma=this.tc.createAnalyticsGroup(this.element);this.Y.maybeInitIframeTransport(this.element);b=[];var c={},d;for(d in this.h.triggers){a:if(F(this.h.triggers,d)){c.o=this.h.triggers[d];c.wb=vf(this,E({}),c.o,void 0,!0);var e=this.w();
if(c.o){var f=c.o.request||c.o.parentPostMessage&&rf(this);if(c.o.on&&f){if(this.V){var g=c.o.on;if(ra(g)&&!of.includes(g)){this.user().error(e,g+" is not supported for amp-analytics in scope");break a}}uf(this,c.o.extraUrlParams,this.h.extraUrlParamsReplaceMap);b.push(wf(this,c.o).then(function(b){return function(c){if(c)if(a.V){if(a.element.parentElement)return b.o.selector=a.element.parentElement.tagName,b.o.selectionMethod="closest",xf(a,b.o)}else return b.o.selector&&G(b.o.selector,"${")&&Da(b.o.selector,
"}")?a.L.expandTemplate(b.o.selector,b.wb,a.element).then(function(c){b.o.selector=c;return xf(a,b.o)}):xf(a,b.o)}}(c)))}else{var k=rf(this)?'/"parentPostMessage"':"";this.user().error(e,'"on" and "request"'+k+" attributes are required for data to be collected.")}}else this.user().error(e,"Trigger should be an object: ",d)}c={o:c.o,wb:c.wb}}return Promise.all(b)};h.preload=function(a,b){L(this.win,"preconnect").preload(this.getAmpDoc(),a,b)};
function xf(a,b){if(!a.ma)return q();try{return a.ma.addTrigger(b,a.gd.bind(a,b))}catch(c){return a=a.w(),xa(a,'Failed to process trigger "'+b.on+'"',c),q()}}function uf(a,b,c){if(b&&c){var d=0,e;for(e in c){if(16<++d){b=a.w();a.user().error(b,"More than 16 extraUrlParamsReplaceMap rules aren't allowed; Skipping the rest");break}for(var f in b){var g=f.replace(e,c[e]);if(f!=g){var k=b[f];delete b[f];b[g]=k}}}}}
function sf(a){var b=a.h.optoutElementId;if(b&&a.win.document.getElementById(b))return!0;if(!a.h.optout)return!1;var c=a.h.optout.split(".");a=a.win;for(var d=0;d<c.length;d++){if(!a)return!1;a=a[c[d]]}return a()}
function tf(a){if(!a.h.requests){if(!rf(a)){var b=a.w();a.user().error(b,"No request strings defined. Analytics data will not be sent from this page.")}}else if(a.h.requests){for(var c in a.h.requests)F(a.h.requests,c)&&!a.h.requests[c].baseUrl&&(a.user().error("amp-analytics","request must have a baseUrl"),delete a.h.requests[c]);for(var d in a.h.requests)a.h.requests[d].baseUrl=Ea(a.h.requests[d].baseUrl,function(b){var c=a.h.requests[b];return c&&c.baseUrl||"${"+b+"}"});c={};for(b in a.h.requests)F(a.h.requests,
b)&&(c[b]=new Qe(a.element,a.h.requests[b],L(a.win,"preconnect"),a.Y,a.V));a.Ia=c}}h.pd=function(){function a(){b.Da.init()}var b=this,c=this.element.getAttribute("type");this.Da=new ve(this.getAmpDoc(),this.h,c,this.element);I(this.win,"analytics-chunks")?ld(this.element,a,10):a()};h.gd=function(a,b){for(var c=x(a.request)?a.request:[a.request],d=0;d<c.length;d++)yf(this,c[d],a,b)};
function yf(a,b,c,d){if(!a.element.ownerDocument.defaultView){var e=a.w();C().warn(e,"request against destroyed embed: ",c.on)}var f=a.Ia[b],g=rf(a)&&c.parentPostMessage;if(void 0!=b&&!f&&(b=a.w(),a.user().error(b,"Ignoring request for event. Request string not found: ",c.request),!g))return;zf(a,c,d).then(function(b){b&&(f&&(a.h.vars.requestCount++,b=vf(a,d,c),f.send(a.h.extraUrlParams,c,b)),Af(a,c,d))})}
function Af(a,b,c){var d=b.parentPostMessage;d&&rf(a)&&(c=vf(a,c,b),Ve(a.getAmpDoc(),d,a.h.extraUrlParams,b,c,a.element).then(function(b){var c=a.win;c.parent&&c.parent!=c&&a.win.parent.postMessage(b,"*")}))}
function wf(a,b){var c=b.sampleSpec,d=a.w();if(!c)return Promise.resolve(!0);var e=c.sampleOn;if(!e)return a.user().error(d,"Invalid sampleOn value."),Promise.resolve(!0);var f=parseFloat(c.threshold);if(0<=f&&100>=f){var g=new u,k=function(){var c=vf(a,E({}),b),d=a.Za(e,c).then(function(b){return a.$c.uniform(b)}).then(function(a){return 100*a<f});g.resolve(d)};I(a.win,"analytics-chunks")?ld(a.element,k,10):k();return g.promise}B().error(d,"Invalid threshold for sampling.");return Promise.resolve(!0)}
function zf(a,b,c){c=vf(a,c,b);var d=Bf(a,a.h.enabled,c),e=Bf(a,b.enabled,c);return Promise.all([d,e]).then(function(a){return a[0]&&a[1]})}function Bf(a,b,c){return void 0===b?Promise.resolve(!0):"boolean"===typeof b?Promise.resolve(b):a.Za(b,c).then(function(a){return zc(a)})}h.Za=function(a,b){var c=this;return this.L.expandTemplate(a,b,this.element).then(function(a){return N(c.element).expandUrlAsync(a,c.L.getMacros(c.element))})};
h.w=function(){return"AmpAnalytics "+(this.element.getAttribute("id")||"<unknown id>")};function vf(a,b,c,d,e){var f={};R(a.h.vars,f);R(c.vars,f);R(b.vars,f);return new P(f,d,e)}(function(a){a.registerServiceForDoc("amp-analytics-instrumentation",pe);a.registerServiceForDoc("activity",Eb);var b=a.win;b=Xa(b);db(b,b,"amp-analytics-linker-reader",rc);a.registerServiceForDoc("amp-analytics-variables",yc);a.registerElement("amp-analytics",pf)})(self.AMP);
})});

//# sourceMappingURL=amp-analytics-0.1.js.map
