(self.AMP=self.AMP||[]).push({n:"amp-access",ev:"0.1",l:true,v:"2107030008001",m:1,f:function(AMP,_){let aa;function t(){return aa?aa:aa=Promise.resolve(void 0)}class ba{constructor(){this.promise=new Promise(((a,b)=>{this.resolve=a;this.reject=b}))}}let B=Array.isArray;function ca(a,b){let c=[];let d=0;for(let e=0;e""!==y));null===(e=(f=self).__AMP_REPORT_ERROR)||void 0===e?void 0:e.call(f,c);throw c}}let ja=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function oa(a,b=""){try{return decodeURIComponent(a)}catch(c){return b}}function pa(a){let b=Object.create(null);if(!a)return b;for(var c;c=ja.exec(a);){let d=oa(c[1],c[1]);c=c[2]?oa(c[2].replace(/\+/g," "),c[2]):"";b[d]=c}return b}let E=self.AMP_CONFIG||{},qa=("string"==typeof E.cdnProxyRegex?new RegExp(E.cdnProxyRegex):E.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/;function ra(a){if(!self.document||!self.document.head||self.location&&qa.test(self.location.origin))return null;let b=self.document.head.querySelector(`meta[name="${a}"]`);return b&&b.getAttribute("content")||null}let sa={thirdParty:E.thirdPartyUrl||"https://3p.ampproject.net",thirdPartyFrameHost:E.thirdPartyFrameHost||"ampproject.net",thirdPartyFrameRegex:("string"==typeof E.thirdPartyFrameRegex?new RegExp(E.thirdPartyFrameRegex):E.thirdPartyFrameRegex)||/^d-\d+\.ampproject\.net$/,cdn:E.cdnUrl||ra("runtime-host")||"https://cdn.ampproject.org",cdnProxyRegex:qa,localhostRegex:/^https?:\/\/localhost(:\d+)?$/,errorReporting:E.errorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r",betaErrorReporting:E.betaErrorReportingUrl||"https://us-central1-amp-error-reporting.cloudfunctions.net/r-beta",localDev:E.localDev||!1,trustedViewerHosts:[/(^|\.)google\.(com?|[a-z]{2}|com?\.[a-z]{2}|cat)$/,/(^|\.)gmail\.(com|dev)$/],geoApi:E.geoApiUrl||ra("amp-geo-api")};self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};let ta=self.__AMP_LOG;function G(){if(!ta.user)throw Error("failed to call initLogConstructor");return ta.user}function H(){if(ta.dev)return ta.dev;throw Error("failed to call initLogConstructor")}function J(a,b,c,d,e){return G().assert(a,b,c,d,e,void 0,void 0,void 0,void 0,void 0,void 0)}function M(a,b){a=a.__AMP_TOP||(a.__AMP_TOP=a);return N(a,b)}function O(a){return N(a,"timer")}function ua(a){a=a.__AMP_TOP||(a.__AMP_TOP=a);return va(a,"performance")?N(a,"performance"):null}function P(a,b){var c=wa(a);c=S(c);return N(c,b)}function xa(a,b){a=wa(a);a=S(a);return va(a,b)?N(a,b):null}function wa(a){return a.nodeType?M((a.ownerDocument||a).defaultView,"ampdoc").getAmpDoc(a):a}function S(a){a=wa(a);return a.isSingleDoc()?a.win:a}function N(a,b){va(a,b);a=ya(a)[b];a.obj||(a.obj=new a.ctor(a.context),a.context=null,a.resolve&&a.resolve(a.obj));return a.obj}function Ca(a,b){let c=Da(a,b);if(c)return c;a=ya(a);a[b]=Ea();return a[b].promise}function Da(a,b){let c=ya(a)[b];if(c){if(c.promise)return c.promise;N(a,b);return c.promise=Promise.resolve(c.obj)}return null}function ya(a){let b=a.__AMP_SERVICES;b||(b=a.__AMP_SERVICES={});return b}function va(a,b){a=a.__AMP_SERVICES&&a.__AMP_SERVICES[b];return!(!a||!a.ctor)}function Ea(){let a=new ba,b=a.promise,c=a.reject,d=a.resolve;b.catch((()=>{}));return{obj:null,promise:b,resolve:d,reject:c,context:null,ctor:null}}function Fa(a,b){ia("​​​",a,"Object expected: %s",b,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)} /* https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ function Ga(a,b,c=null){c?a.insertBefore(b,c.nextSibling):a.insertBefore(b,a.firstChild)}function Ha(a){var b;return"SCRIPT"==a.tagName&&"APPLICATION/JSON"==(null===(b=a.getAttribute("type"))||void 0===b?void 0:b.toUpperCase())}function Ia(a){let b=Da(S(a),"amp-analytics-instrumentation");if(b)return b;let c=wa(a);return c.whenExtensionsKnown().then((()=>{let d=c.getExtensionVersion("amp-analytics");return d?M(c.win,"extensions").waitForExtension("amp-analytics",d):null})).then((d=>d?Ca(S(a),"amp-analytics-instrumentation"):null))}let Ja=new Set(["c","v","a","ad"]);let Ka;let La=a=>"string"==typeof a?T(a):a;function T(a){Ka||(Ka=self.document.createElement("a"));var b=Ka;b.href="";return new URL(a,b.href)}function Ma(a,b){return`${encodeURIComponent(a)}=${encodeURIComponent(b)}`}function Na(a){let b=[];for(let d in a){var c=a[d];if(null!=c){c=B(c)?c:[c];for(let e=0;ethis.C.timeoutPromise(this.pa,this.$.fetchJson(a,{credentials:"include"})).then((b=>b.json()))))}isPingbackEnabled(){return this.V}pingback(){return this.F.buildUrl(this.la,!0).then((a=>this.$.sendSignal(a,{method:"POST",credentials:"include",headers:C({"Content-Type":"application/x-www-form-urlencoded"}),body:""})))}postAction(){}}function Ra(a){a.O&&!a.za&&(a.za="function"==typeof a.ya?a.ya():a.ya);return a.za}function Sa(a,b,c,d){let e=a.getTarget();a="connect"==c?null!=a.o?a.o:"*":a.getTargetOrigin();e.postMessage({sentinel:"__AMP__",_rsvp:b,cmd:c,payload:d||null},a)}class Ta{constructor(a,b,c){this.Ua=a;this.ya=b;this.o=c;this.O=this.za=null;this.Ga=this.ab.bind(this);this.ib=0;this.Ca={}}connect(a){if(this.O)throw Error("already connected");this.O=a;this.Ua.addEventListener("message",this.Ga)}disconnect(){this.O&&(this.O=null,this.Ua.removeEventListener("message",this.Ga))}isConnected(){return null!=this.o}getTarget(){let a=Ra(this);if(!a)throw Error("not connected");return a}getTargetOrigin(){if(null==this.o)throw Error("not connected");return this.o}sendCommand(a,b){Sa(this,void 0,a,b)}sendCommandRsvp(a,b){let c=String(++this.ib);let d=null;let e=new Promise((f=>{d=f}));this.Ca[c]={promise:e,resolver:d};Sa(this,c,a,b);return e}ab(a){let b=a.data;if(b&&"__AMP__"==b.sentinel){var c=a.origin,d=b.cmd,e=b.payload||null;null==this.o&&"start"==d&&(this.o=c);null==this.o&&a.source&&Ra(this)==a.source&&(this.o=c);if(c==this.o){var f=b._rsvp,h=!!f&&"rsvp"!=d;a=this.sa(f,d,e);h&&Promise.resolve(a).then((m=>{Sa(this,f,"rsvp",{result:m})}),(m=>{Sa(this,f,"rsvp",{error:String(m)})}))}}}sa(a,b,c){if("rsvp"==b){let d=a&&this.Ca[a];d&&("error"in c?d.resolver(Promise.reject(Error(c.error))):d.resolver(c.result),delete this.Ca[a])}else return this.O(b,c)}}function Ua(a,b){try{return JSON.parse(a)}catch(c){return null===b||void 0===b?void 0:b(c),null}}function Va(a){var b=!1;void 0===b&&(b=a.hasAttribute("hidden"));b?a.removeAttribute("hidden"):a.setAttribute("hidden","")}function Wa(a){return a.C.promise(3e3).then((()=>Xa(a)||a.Xa))}function Ya(a){return a.connect().then((()=>a.W.sendCommandRsvp("authorize",{}))).then((b=>{b&&t().then((()=>Za(a,b)));return b}))}function Za(a,b){var c=a.ampdoc.win;if(c=c.sessionStorage||c.localStorage)try{b?c.setItem("amp-access-iframe",JSON.stringify(C({t:a.ampdoc.win.Date.now(),d:b}))):c.removeItem("amp-access-iframe")}catch(d){H().error("amp-access-iframe","failed to store access response: ",d)}}function $a(a){return new Promise((b=>{let c=JSON.parse(JSON.stringify(a.Wa));if(a.T){let d=a.T.join("&"),e=a.F.collectUrlVars(d,!1);b(e.then((f=>{c.iframeVars=f;return c})))}else b(c)}))}function Xa(a){let b=a.ampdoc.win,c=b.sessionStorage||b.localStorage;if(!c)return null;try{let d=c.getItem("amp-access-iframe");if(!d)return null;let e=JSON.parse(d);return e.t+6048e5this.U.contentWindow),this.o);this.Ia=null}disconnect(){this.W.disconnect();this.ampdoc.getBody().removeChild(this.U)}getConfig(){return{iframeSrc:this.ga,iframeVars:this.T}}isAuthorizationEnabled(){return!0}authorize(){return Promise.race([Wa(this),Ya(this)])}isPingbackEnabled(){return!0}pingback(){return this.connect().then((()=>this.W.sendCommandRsvp("pingback",{})))}postAction(){Za(this,null)}connect(){if(!this.qa){let a=new ba;this.qa=a.promise;this.ca=a.resolve;this.Ia=$a(this);this.W.connect(this.sa.bind(this));this.ampdoc.getBody().appendChild(this.U);this.U.src=this.ga}return this.qa}sa(a){"connect"==a&&this.Ia.then((b=>{this.W.sendCommandRsvp("start",{protocol:"amp-access",config:b}).then((()=>{this.ca&&(this.ca(),this.ca=null)}))}))}}class bb{constructor(a,b,c){this.ampdoc=a;this.F=c;this.oa=b.authorizationFallbackResponse||null;this.I=V(a.win.location)}getConfig(){return{authorizationResponse:this.oa}}isAuthorizationEnabled(){return!!this.oa&&!this.I}authorize(){return Promise.resolve(this.oa)}isPingbackEnabled(){return!1}pingback(){return t()}postAction(){}}function cb(a,b,c){b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c;return a}cb["default"]=cb;cb.__esModule=!0;function W(a){for(var b=1;b=w&&(h[v]=Math.random(){let h=f[1];c[String(f[0]).toLowerCase()]=String(h)}));e.status&&(d.status=parseInt(e.status,10));e.statusText&&(d.statusText=String(e.statusText))}return new Response(a.body?String(a.body):"",d)}function hb(a,b,c,d){if(!b)return t();let e=d.prerenderSafe?t():b.whenFirstVisible(),f=P(b,"viewer"),h=V(c),m=f.hasCapability("xhrInterceptor"),p=d.bypassInterceptorForDev&&!1;return h||!m||p||!b.getRootNode().documentElement.hasAttribute("allow-xhr-interception")?e:e.then((()=>f.isTrustedViewer())).then((r=>{if(r||X(a)["untrusted-xhr-interception"]){var y=C({originalRequest:fb(c,d)});return f.sendMessageAwaitResponse("xhr",y).then((v=>gb(v,d.responseType)))}}))}function nb(a,b,c){!1!==c.ampCors&&(c=T(b),c=pa(c.search),J(!("__amp_source_origin"in c),"Source origin is not allowed in %s",b),a=T(Pa(a.location.href)).origin,a=Ma("__amp_source_origin",a))&&(b=b.split("#",2),c=b[0].split("?",2),a=c[0]+(c[1]?`?${c[1]}&${a}`:`?${a}`),b=a+=b[1]?`#${b[1]}`:"");return b}function ob(a){a=a||{};var b=a.method;void 0===b?b="GET":(b=b.toUpperCase(),eb.includes(b));a.method=b;a.headers=a.headers||C({});a.headers.Accept="text/html";return a}function pb(a,b,c){c=c||{};let d=a.origin||T(a.location.href).origin;a=T(b).origin;d==a&&(c.headers=c.headers||{},c.headers["AMP-Same-Origin"]="true");return c}function qb(a){return new Promise((b=>{if(a.ok)return b(a);b=a.status;let c=G().createError(`HTTP error ${b}`);c.retriable=415==b||500<=b&&600>b;c.response=a;throw c}))}function rb(a,b,c){let d=ob(c);d=pb(a,b,d);b=nb(a,b,d);c=M(a,"ampdoc");c=c.isSingleDoc()?c.getSingleDoc():null;d.responseType="document";return hb(a,c,b,d).then((e=>e?e.text().then((f=>(new DOMParser).parseFromString(f,"text/html"))):sb(b,d).then((f=>f.xhr.responseXML))))}function sb(a,b){return new Promise(((c,d)=>{let e=new XMLHttpRequest;e.open(b.method||"GET",a,!0);e.withCredentials="include"==b.credentials;e.responseType="document";for(let f in b.headers)e.setRequestHeader(f,b.headers[f]);e.onreadystatechange=()=>{if(!(2>e.readyState))if(100>e.status||599({response:h,xhr:e})));c(f)}};e.onerror=()=>{d(G().createExpectedError("Request failure"))};e.onabort=()=>{d(G().createExpectedError("Request aborted"))};"POST"==b.method?e.send(b.body):e.send()}))}function tb(a){let b=C({});a.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(c){var d=c.split(":");let e=d.shift().trim();e&&(d=d.join(":").trim(),b[e]=d)}));return b}class ub{constructor(a,b,c){this.ampdoc=a;this.F=c;this.A=new Qa(a,b,c);this.$=M(a.win,"xhr");this.C=O(a.win);this.P=M(a.win,"vsync");this.K=a.getMetaByName("i-amphtml-access-state");let d=!!X(a.win)["amp-access-server"];this.I=V(a.win.location)||d;this.xa=(d?a.getParam("serverAccessService"):null)||Oa(a.win.location.href)}getConfig(){return{client:this.A.getConfig(),proxy:this.I,serverState:this.K}}isAuthorizationEnabled(){return!0}authorize(){return this.I&&this.K?this.F.collectUrlVars(this.A.getAuthorizationUrl(),!1).then((a=>{let b={};for(let c in a)null!=a[c]&&(b[c]=String(a[c]));a=C({url:Oa(this.ampdoc.win.location.href),state:this.K,vars:b});return this.C.timeoutPromise(this.A.getAuthorizationTimeout(),rb(this.ampdoc.win,this.xa,{method:"POST",body:"request="+encodeURIComponent(JSON.stringify(a)),headers:C({"Content-Type":"application/x-www-form-urlencoded"})}))})).then((a=>{let b=a.querySelector('script[id="amp-access-data"]').textContent,c=JSON.parse(b);return this.wa(a).then((()=>c))})):this.A.authorize()}isPingbackEnabled(){return this.A.isPingbackEnabled()}pingback(){return this.A.pingback()}postAction(){}wa(a){let b=a.querySelectorAll("[i-amphtml-access-id]");return this.P.mutatePromise((()=>{for(let c=0;cxb[c])));return wb(b)}function zb(a){function b(){throw Error(`Invalid token: "${a}"`)}let c=a.split(".");3!=c.length&&b();let d=yb(c[0]),e=yb(c[1]);return{header:Ua(vb(d),b),payload:Ua(vb(e),b),verifiable:`${c[0]}.${c[1]}`,sig:c[2]}}function Ab(a,b){return b.then((c=>{var d=a.na,e=d.importKey;c=c.trim().replace(/^-+BEGIN[^-]*-+/,"").replace(/-+END[^-]*-+$/,"").replace(/[\r\n]/g,"").trim();c=wb(atob(c));return e.call(d,"spki",c,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"])}))}class Bb{constructor(a){this.win=a;this.na=a.crypto&&(a.crypto.subtle||a.crypto.webkitSubtle)||null}decode(a){return zb(a).payload}isVerificationSupported(){return!!this.na}decodeAndVerify(a,b){if(!this.na)throw Error("Crypto is not supported on this platform");return new Promise((c=>c(zb(a)))).then((c=>{let d=c.header.alg;if(!d||"RS256"!=d)throw Error("Only alg=RS256 is supported");return Ab(this,b).then((e=>{let f=yb(c.sig);return this.na.verify({name:"RSASSA-PKCS1-v1_5"},e,f,wb(c.verifiable))})).then((e=>{if(e)return c.payload;throw Error("Signature verification failed")}))}))}}function Cb(a){return Db(a).then((b=>{let c=b.encoded,d=b.jwt.amp_authdata;b=Na(C({url:Oa(a.ampdoc.win.location.href),state:a.K,jwt:c}));return a.C.timeoutPromise(3e3,rb(a.ampdoc.win,a.xa,{method:"POST",body:b,headers:C({"Content-Type":"application/x-www-form-urlencoded"})})).then((e=>a.wa(e))).then((()=>d))}))}function Eb(a){return Db(a).then((b=>b.jwt.amp_authdata))}function Db(a){return a.F.buildUrl(a.A.getAuthorizationUrl(),!1).then((b=>a.C.timeoutPromise(3e3,a.$.fetchText(b,{credentials:"include"})))).then((b=>b.text())).then((b=>{let c=a.cb.decode(b);J(c.amp_authdata,'"amp_authdata" must be present in JWT');return{encoded:b,jwt:c}})).catch((b=>{throw G().createError("JWT fetch or validation failed: ",b)}))}class Fb{constructor(a,b,c){this.ampdoc=a;this.F=c;this.A=new Qa(a,b,c);this.$=M(a.win,"xhr");this.C=O(a.win);this.P=M(a.win,"vsync");this.K=a.getMetaByName("i-amphtml-access-state");c=!!X(a.win)["amp-access-server-jwt"];this.I=V(a.win.location)||c;this.xa=(c?a.getParam("serverAccessService"):null)||Oa(a.win.location.href);this.Ka=b.publicKey||null;this.ha=b.publicKeyUrl||null;J(this.Ka||this.ha,'"publicKey" or "publicKeyUrl" must be specified');this.ha&&U(this.ha,'"publicKeyUrl"');this.cb=new Bb(a.win)}getConfig(){return{client:this.A.getConfig(),proxy:this.I,serverState:this.K,publicKey:this.Ka,publicKeyUrl:this.ha}}isAuthorizationEnabled(){return!0}authorize(){return this.I&&this.K?Cb(this):Eb(this)}isPingbackEnabled(){return this.A.isPingbackEnabled()}pingback(){return this.A.pingback()}postAction(){}wa(a){let b=a.querySelectorAll("[i-amphtml-access-id]");return this.P.mutatePromise((()=>{for(let d=0;da.authorize()))}isPingbackEnabled(){return this.V}pingback(){return this.Sa.then((a=>a.pingback()))}postAction(){}}let Y;function Hb(a,b,c){let d=a,e=c,f=m=>{try{return e(m)}catch(y){var p,r;null===(p=(r=self).__AMP_REPORT_ERROR)||void 0===p?void 0:p.call(r,y);throw y}};let h=Ib();d.addEventListener(b,f,h?void 0:!1);return()=>{var m;null===(m=d)||void 0===m?void 0:m.removeEventListener(b,f,h?void 0:!1);f=d=e=null}}function Ib(){if(void 0!==Y)return Y;Y=!1;try{let a={get capture(){Y=!0}};self.addEventListener("test-options",null,a);self.removeEventListener("test-options",null,a)}catch(a){}return Y}function Jb(a,b){return Hb(a,"message",b)}function Kb(a,b){let c=b;let d=Hb(a,"click",(e=>{try{c(e)}finally{c=null,d()}}));return d}function Lb(a,b,c){let d;try{d=a.open(b,"_blank",c)}catch(h){H().error("DOM","Failed to open url on target: ","_blank",h)}var e;if(!(e=d||!1)){e=c||"";var f;"number"!==typeof f&&(f=0);e=f+8>e.length?!1:-1!==e.indexOf("noopener",f)}e||(d=a.open(b,"_top"));return d}let Mb=/RETURN_URL/;function Nb(a,b){let c=P(a,"viewer");return parseInt(a.getParam("dialog"),10)?new Ob(c,b):new Pb(a.win,c,b)}function Qb(a,b){return Nb(a,b).open()}class Ob{constructor(a,b){this.viewer=a;this.urlOrPromise=b}getLoginUrl(){return("string"==typeof this.urlOrPromise?Promise.resolve(this.urlOrPromise):this.urlOrPromise).then((a=>Rb(a,"RETURN_URL")))}open(){return this.getLoginUrl().then((a=>this.viewer.sendMessageAwaitResponse("openDialog",C({url:a}))))}}function Sb(a){var b=a.win.screen,c=Math.floor(Math.min(700,.9*b.width));let d=Math.floor(Math.min(450,.9*b.height));b=`${`height=${d},width=${c},left=${Math.floor((b.width-c)/2)},top=${Math.floor((b.height-d)/2)}`},resizable=yes,scrollbars=yes`;let e=Tb(a);a.R=null;"string"==typeof a.urlOrPromise?(c=Rb(a.urlOrPromise,e),a.B=Lb(a.win,c,b),a.B&&(a.R=t())):(a.B=Lb(a.win,"",b),a.B&&(a.R=a.urlOrPromise.then((f=>{f=Rb(f,e);a.B.location.replace(f)}),(f=>{throw Error("failed to resolve url: "+f)}))));a.R?a.R.then((()=>{Ub(a,e)}),(f=>{Vb(a,null,f)})):Vb(a,null,Error("failed to open dialog"))}function Wb(a){a.Y=null;a.va=null;if(a.B){try{a.B.close()}catch(b){}a.B=null}a.M&&(a.win.clearInterval(a.M),a.M=null);a.ja&&(a.ja(),a.ja=null)}function Tb(a){let b=a.viewer.getResolvedViewerUrl();return`${sa.cdn}/v0/amp-login-done-0.1.html?url=`+encodeURIComponent(b)}function Ub(a,b){let c=T(b).origin;a.M=a.win.setInterval((()=>{a.B.closed&&(a.win.clearInterval(a.M),a.M=null,a.win.setTimeout((()=>{Vb(a,"")}),3e3))}),500);a.ja=Jb(a.win,(d=>{d.origin==c&&d.data&&"amp"==d.data.sentinel&&"result"==d.data.type&&(a.B&&a.B.postMessage(C({sentinel:"amp",type:"result-ack"}),c),Vb(a,d.data.result))}))}function Vb(a,b,c){a.Y&&(c?a.va(c):a.Y(b),Wb(a))}class Pb{constructor(a,b,c){this.win=a;this.viewer=b;this.urlOrPromise=c;this.ja=this.M=this.R=this.B=this.va=this.Y=null}open(){J(!this.Y,"Dialog already opened");return new Promise(((a,b)=>{this.Y=a;this.va=b;Sb(this)})).then((a=>{Wb(this);return a}),(a=>{Wb(this);throw a}))}getLoginUrl(){return("string"==typeof this.urlOrPromise?Promise.resolve(this.urlOrPromise):this.urlOrPromise).then((a=>Rb(a,Tb(this))))}}function Rb(a,b){return Mb.test(a)?a.replace(Mb,encodeURIComponent(b)):a+(-1==a.indexOf("?")?"?":"&")+"return="+encodeURIComponent(b)}function Xb(a,b,c={}){Ia(a).then((d=>{d&&d.triggerEventForTarget(a,b,c,!1)}))}function Yb(a,b){let c={buildUrl:a.buildUrl.bind(a),collectUrlVars:a.collectUrlVars.bind(a)},d=a.bb&&!0===b.jwt;switch(a.Aa){case"client":return d?new Fb(a.ampdoc,b,c):new Qa(a.ampdoc,b,c);case"iframe":return new ab(a.ampdoc,b,c);case"server":return d?new Fb(a.ampdoc,b,c):new ub(a.ampdoc,b,c);case"vendor":return new Gb(a.ampdoc,b);case"other":return new bb(a.ampdoc,b,c)}throw H().createError("Unsupported access type: ",a.Aa)}function Zb(a){if(0!=Object.keys(a.ia).length){var b=[];for(let c in a.ia)b.push(a.buildUrl(a.ia[c],!0).then((d=>{a.Na[c]=d;return{type:c,url:d}})));Promise.all(b)}}function $b(a,b){return a.ea().then((c=>{let d={READER_ID:c,ACCESS_READER_ID:c};b&&(d.AUTHDATA=e=>{if(a.aa)return fa(a.aa,e)});return d}))}function ac(a,b,c){let d=Date.now();if(a.J&&1e3>d-a.Ma)return a.J;bc(a,c,"started");let e=a.hb(b).then((f=>{a.J=null;f=pa(f).success;let h="true"==f||"yes"==f||"1"==f;h?bc(a,c,"success"):bc(a,c,"rejected");if(h||!f){a.L.postAction();let m=a.runAuthorization(!0);a.ta(m);return m.then((()=>{a.ma(0)}))}})).catch((f=>{bc(a,c,"failed");a.J==e&&(a.J=null);throw f}));a.J=e;a.Ma=d;return a.J}function bc(a,b,c){a.G(`access-login-${c}`);b&&a.G(`access-login-${b}-${c}`)}class cc{constructor(a,b,c,d,e,f){this.ampdoc=a;this.ea=c;this.ma=d;this.ta=e;this.H=f;this.Ja=!!X(a.win)["amp-access-server"];this.bb=!!X(a.win)["amp-access-jwt"];var{type:h}=b;J(!h||"client"===h||"iframe"===h||"server"===h||"vendor"===h||"other"===h,`Unknown access type: ${h}`);h||(h=b.vendor?"vendor":"client");"server"!=h||this.Ja||(h="client");"client"==h&&this.Ja&&(h="server");this.Aa=h;h=b.login;let m={};if(h)if("string"==typeof h)m[""]=h;else if("[object Object]"===ea.call(h))for(let p in h)m[p]=h[p];else J(!1,'"login" must be either a single URL or a map of URLs');for(let p in m)U(m[p],this.H);this.ia=m;this.Fa=b.authorizationFallbackResponse;this.fb=b.namespace||null;this.L=Yb(this,b);this.Qa=xa(f,"url-replace");this.hb=Qb.bind(null,a);this.aa=null;a=new ba;this.Za=a.promise;this.ra=a.resolve;this.Na={};this.J=null;this.Ma=0}getNamespace(){return this.fb}getType(){return this.Aa}getAdapter(){return this.L}getAuthResponse(){return this.aa}getAdapterConfig(){return this.L.getConfig()}whenFirstAuthorized(){return this.Za}fa(){let a=this.ampdoc.getRootNode();return a.documentElement||a.body||a}G(a){Xb(this.fa(),a,void 0)}start(){Zb(this)}buildUrl(a,b){return $b(this,b).then((c=>this.Qa.expandUrlAsync(a,c)))}collectUrlVars(a,b){return $b(this,b).then((c=>this.Qa.collectVars(a,c)))}runAuthorization(a){return this.L.isAuthorizationEnabled()?this.L.authorize().catch((b=>{this.G("access-authorization-failed");if(this.Fa&&!a)return G().error("amp-access","Authorization failed: ",b),this.Fa;throw b})).then((b=>{this.aa=b;this.ra();Zb(this);return b})).catch((b=>{G().error("amp-access","Authorization failed: ",b);this.ra();throw b})):(this.ra(),t())}reportViewToServer(){return this.L.pingback().then((()=>{this.G("access-pingback-sent")})).catch((a=>{this.G("access-pingback-failed");throw G().createError("Pingback failed: ",a)}))}getLoginUrl(a){return Nb(this.ampdoc,a).getLoginUrl()}loginWithType(a){J(this.ia[a],"Login URL is not configured: %s",a);let b=J(this.Na[a],"Login URL is not ready: %s",a);return ac(this,b,a)}loginWithUrl(a,b=""){return ac(this,a,b)}}var dc=function(){function a(g,u,q,n){q=q||{};for(n=g.length;n--;q[g[n]]=u);return q}function b(){this.yy={}}var c=[1,3],d=[1,4],e=[1,18],f=[1,19],h=[1,14],m=[1,15],p=[1,16],r=[1,17],y=[1,21],v=[1,22],w=[5,6,7,10],F=[5,6,7,10,15,16,17,18,19,20,21],ka=[5,6,7,10,15,16,17,18,19,20,21,25,27],Ba={trace:function(){},yy:{},jb:{error:2,result:3,search_condition:4,EOF:5,OR:6,AND:7,NOT:8,"(":9,")":10,predicate:11,comparison_predicate:12,truthy_predicate:13,scalar_exp:14,EQ:15,DEQ:16,NEQ:17,LT:18,LTE:19,GT:20,GTE:21,atom:22,field_ref:23,literal:24,DOT:25,field_name:26,"[":27,string:28,"]":29,NAME:30,STRING:31,NUMERIC:32,TRUE:33,FALSE:34,NULL:35,$accept:0,$end:1},Z:{2:"error",5:"EOF",6:"OR",7:"AND",8:"NOT",9:"(",10:")",15:"EQ",16:"DEQ",17:"NEQ",18:"LT",19:"LTE",20:"GT",21:"GTE",25:"DOT",27:"[",29:"]",30:"NAME",31:"STRING",32:"NUMERIC",33:"TRUE",34:"FALSE",35:"NULL"},Oa:[0,[3,2],[4,3],[4,3],[4,2],[4,3],[4,1],[11,1],[11,1],[12,3],[12,3],[12,3],[12,3],[12,3],[12,3],[12,3],[13,1],[14,1],[14,1],[22,1],[23,3],[23,4],[23,1],[26,1],[28,1],[24,1],[24,1],[24,1],[24,1],[24,1]],performAction:function(g,u,q,n,A,k){var l=k.length-1;switch(A){case 1:return k[l-1];case 2:this.h=k[l-2]||k[l];break;case 3:this.h=k[l-2]&&k[l];break;case 4:this.h=!k[l];break;case 5:this.h=k[l-1];break;case 6:case 7:case 8:case 17:case 18:case 19:this.h=k[l];break;case 9:this.h=k[l-2]===k[l];break;case 10:throw Error('"==" is not allowed, use "="');case 11:this.h=k[l-2]!==k[l];break;case 12:this.h=typeof k[l-2]==typeof k[l]&&k[l-2]k[l];break;case 15:this.h=typeof k[l-2]==typeof k[l]&&k[l-2]>=k[l];break;case 16:this.h=void 0!==k[l]&&null!==k[l]&&""!==k[l]&&0!==k[l]&&!1!==k[l];break;case 20:this.h="[object Object]"==Object.prototype.toString.call(k[l-2])&&k[l-2].hasOwnProperty(k[l])?k[l-2][k[l]]:null;break;case 21:this.h="[object Object]"==Object.prototype.toString.call(k[l-3])&&k[l-3].hasOwnProperty(k[l-1])?k[l-3][k[l-1]]:null;break;case 22:this.h=void 0!==n[k[l]]?n[k[l]]:null;break;case 23:this.h=g;break;case 24:this.h=g.substring(1,g.length-1);break;case 26:this.h=Number(g);break;case 27:this.h=!0;break;case 28:this.h=!1;break;case 29:this.h=null}},table:[{3:1,4:2,8:c,9:d,11:5,12:6,13:7,14:8,22:9,23:10,24:11,26:12,28:13,30:e,31:f,32:h,33:m,34:p,35:r},{1:[3]},{5:[1,20],6:y,7:v},{4:23,8:c,9:d,11:5,12:6,13:7,14:8,22:9,23:10,24:11,26:12,28:13,30:e,31:f,32:h,33:m,34:p,35:r},{4:24,8:c,9:d,11:5,12:6,13:7,14:8,22:9,23:10,24:11,26:12,28:13,30:e,31:f,32:h,33:m,34:p,35:r},a(w,[2,6]),a(w,[2,7]),a(w,[2,8]),a(w,[2,16],{15:[1,25],16:[1,26],17:[1,27],18:[1,28],19:[1,29],20:[1,30],21:[1,31]}),a(F,[2,17]),a(F,[2,18],{25:[1,32],27:[1,33]}),a(F,[2,19]),a(ka,[2,22]),a(F,[2,25]),a(F,[2,26]),a(F,[2,27]),a(F,[2,28]),a(F,[2,29]),a(ka,[2,23]),a([5,6,7,10,15,16,17,18,19,20,21,29],[2,24]),{1:[2,1]},{4:34,8:c,9:d,11:5,12:6,13:7,14:8,22:9,23:10,24:11,26:12,28:13,30:e,31:f,32:h,33:m,34:p,35:r},{4:35,8:c,9:d,11:5,12:6,13:7,14:8,22:9,23:10,24:11,26:12,28:13,30:e,31:f,32:h,33:m,34:p,35:r},a(w,[2,4]),{6:y,7:v,10:[1,36]},{14:37,22:9,23:10,24:11,26:12,28:13,30:e,31:f,32:h,33:m,34:p,35:r},{14:38,22:9,23:10,24:11,26:12,28:13,30:e,31:f,32:h,33:m,34:p,35:r},{14:39,22:9,23:10,24:11,26:12,28:13,30:e,31:f,32:h,33:m,34:p,35:r},{14:40,22:9,23:10,24:11,26:12,28:13,30:e,31:f,32:h,33:m,34:p,35:r},{14:41,22:9,23:10,24:11,26:12,28:13,30:e,31:f,32:h,33:m,34:p,35:r},{14:42,22:9,23:10,24:11,26:12,28:13,30:e,31:f,32:h,33:m,34:p,35:r},{14:43,22:9,23:10,24:11,26:12,28:13,30:e,31:f,32:h,33:m,34:p,35:r},{26:44,30:e},{28:45,31:f},a([5,6,10],[2,2],{7:v}),a(w,[2,3]),a(w,[2,5]),a(w,[2,9]),a(w,[2,10]),a(w,[2,11]),a(w,[2,12]),a(w,[2,13]),a(w,[2,14]),a(w,[2,15]),a(ka,[2,20]),{29:[1,46]},a(ka,[2,21])],defaultActions:{20:[2,1]},parseError:function(g,u){if(u.recoverable)this.trace(g);else throw g=Error(g),g.hash=u,g},parse:function(g){function u(){var Z=x.lex()||1;"number"!==typeof Z&&(Z=q.jb[Z]||Z);return Z}var q=this,n=[0],A=[null],k=[],l=this.table,ib="",la=0,jb=0,kb=0,mc=k.slice.call(arguments,1),x=Object.create(this.lexer),K={yy:{}};for(Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(K.yy[Q]=this.yy[Q]);x.setInput(g,K.yy);K.yy.lexer=x;K.yy.parser=this;"undefined"==typeof x.yylloc&&(x.yylloc={});var za=x.yylloc;k.push(za);var nc=x.options&&x.options.ranges;this.parseError="function"===typeof K.yy.parseError?K.yy.parseError:Object.getPrototypeOf(this).parseError;for(var z,Aa,L,D,ma,I,lb,na,R={};;){L=n[n.length-1];if(this.defaultActions[L])D=this.defaultActions[L];else{if(null===z||"undefined"==typeof z)z=u();D=l[L]&&l[L][z]}if("undefined"===typeof D||!D.length||!D[0]){var mb="";na=[];for(ma in l[L])this.Z[ma]&&2g.length&&(g+=this._input.substr(0,20-g.length));return(g.substr(0,20)+(20n[0].length)){var n=g;var A=q;if(this.options.backtrack_lexer){n=this.test_match(g,u[q]);if(!1!==n)return n;if(this._backtrack)n=!1;else return!1}else if(!this.options.flex)break}return n?(n=this.test_match(n,u[A]),!1!==n?n:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var g=this.next();return g?g:this.lex()},begin:function(g){this.conditionStack.push(g)},popState:function(){return 0=)/,/^(?:>)/,/^(?:!=)/,/^(?:==)/,/^(?:=)/,/^(?:-?[0-9]+(\.[0-9]+)?\b)/,/^(?:[a-zA-Z_][a-zA-Z0-9_]*)/,/^(?:'[^']*')/,/^(?:"[^"]*")/,/^(?:\.)/,/^(?:.)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27],inclusive:!0}}}}();Ba.lexer=oc;b.prototype=Ba;Ba.Parser=b;return new b}();class ec{constructor(){this.La=this.cache=null}evaluate(a,b){this.La!==b&&(this.La=b,this.cache=Object.create(null));if(!da.call(this.cache,a)){var c=this.cache;a:{try{dc.yy=b;var d=!!dc.parse(a);break a}finally{dc.yy=null}d=void 0}c[a]=d}return this.cache[a]}}class fc{constructor(){this.D=null}add(a){this.D||(this.D=[]);this.D.push(a);return()=>{this.remove(a)}}remove(a){if(this.D){var b=this.D;a=b.indexOf(a);-1!=a&&b.splice(a,1)}}removeAll(){this.D&&(this.D.length=0)}fire(a){if(this.D)for(let b of this.D)b(a)}getHandlerCount(){var a,b;return null!==(a=null===(b=this.D)||void 0===b?void 0:b.length)&&void 0!==a?a:0}}function gc(a,b){let c=a.getHeadNode(),d=hc(c,ic(c));if(b){let f=a.getRootNode();if(jc(f,d))b(d);else var e=setInterval((()=>{jc(f,d)&&(clearInterval(e),b(d))}),4)}}function hc(a,b){let c=a.__AMP_CSS_SM;c||(c=a.__AMP_CSS_SM=Object.create(null));let d=kc(a,c,"amp-extension=amp-access");if(d)return d.textContent!==b&&(d.textContent=b),d;let e=(a.ownerDocument||a).createElement("style");e.textContent=b;let f=null;e.setAttribute("amp-extension","amp-access");f=kc(a,c,"amp-runtime");Ga(a,e,f);return c["amp-extension=amp-access"]=e}function kc(a,b,c){return b[c]?b[c]:(a=a.querySelector(`style[${c}]`))?b[c]=a:null}function ic(a){return(a=a.__AMP_CSS_TR)?a("\n/*# sourceURL=/extensions/amp-access/0.1/amp-access.css*/"):"\n/*# sourceURL=/extensions/amp-access/0.1/amp-access.css*/"}function jc(a,b){let c=a.styleSheets;for(a=0;a tag with type="application/json"');let b=Ua(a.H.textContent,(h=>{throw G().createError('Failed to parse "amp-access" JSON: '+h)})),c={};if(B(b))for(let h=0;hnew cc(a.ampdoc,c[h],d,e,f,a.H)))}function pc(a,b,c){b=b.querySelectorAll("[amp-access]");let d=[];for(let e=0;e{a.Ea.fire()}))}function rc(a){sc(a,"amp-access-loading",!0);let b=a.ampdoc.whenFirstVisible().then((()=>Promise.all(a.j.map((c=>tc(a,c)))))).then((()=>{sc(a,"amp-access-loading",!1);return a.ampdoc.whenReady().then((()=>{let c=a.ampdoc.getRootNode(),d=a.combinedResponses();return pc(a,c,d)}))}));a.N=b}function uc(a){a.Ta.onBroadcast((b=>{"amp-access-reauthorize"==b.type&&b.origin==a.Pa&&rc(a)}))}function sc(a,b,c){a.P.mutate((()=>{a.fa().classList.toggle(b,c)}))}function tc(a,b){return b.runAuthorization().catch((()=>{sc(a,"amp-access-error",!0)}))}function qc(a,b,c){let d=b.getAttribute("amp-access");let e=!1;try{e=a.Ya.evaluate(d,c)}catch(f){G().error("amp-access",f)}if(e){let f=vc(a,b,c);if(f)return f.then((()=>wc(a,b,e)))}return wc(a,b,e)}function vc(a,b,c){let d=[],e=b.querySelectorAll("[amp-access-template]");if(0{H().error("amp-access","Template failed: ",m,e[f],b)}));d.push(h)}return 0{c?b.removeAttribute("amp-access-hide"):b.setAttribute("amp-access-hide","")}))}function xc(a,b,c){let d=b,e=null;"TEMPLATE"!=d.tagName&&(e=d,d=e.__AMP_ACCESS__TEMPLATE);return d?a.kb.renderTemplate(d,c).then((f=>a.P.mutatePromise((()=>{f.setAttribute("amp-access-template","");f.__AMP_ACCESS__TEMPLATE=d;d.parentElement?d.parentElement.replaceChild(f,d):e&&e.parentElement&&e.parentElement.replaceChild(f,e)})))):Promise.reject(Error("template not found"))}function yc(a,b){a.X||(a.X=zc(a,b).then((()=>a.N)).then((()=>{a.G("access-viewed");let c=[];for(let d=0;d{a.X=null;throw c})),a.X.then(a.Ha.bind(a)))}function zc(a,b){if(0==b)return t();let c=[];return new Promise(((d,e)=>{c.push(a.ampdoc.onVisibilityChanged((()=>{a.ampdoc.isVisible()||e(Error("CANCELLED"))})));let f=a.C.delay(d,b);c.push((()=>a.C.cancel(f)));c.push(a.mb.onScroll(d));c.push(Kb(a.ampdoc.getRootNode(),d))})).then((()=>{c.forEach((d=>d()))}),(d=>{c.forEach((e=>e()));throw d}))}function Ac(a,b){let c=b.indexOf("-"),d=1==a.j.length,e=-1h.getNamespace()==e));f.length?(a=-1{}));var b=a.getElementById("amp-access");if(this.S=!!b)this.H=b,this.Pa=T(Pa(a.win.location)).origin,this.C=O(a.win),this.P=M(a.win,"vsync"),this.Va=Ca(S(a),"cid"),this.Ta=P(a,"viewer"),this.mb=P(a,"viewport"),this.kb=P(a,"templates"),this.eb=P(a,"mutator"),this.ka=ua(a.win),this.ua=null,this.Ya=new ec,this.j=lc(this),b=this.j.map((c=>c.whenFirstAuthorized())),this.da=!1,this.N=Promise.all(b),this.X=null,this.Ea=new fc,this.N.then((()=>{this.da=!0;this.G("access-authorization-received");this.ka&&(this.ka.tick("aaa"),this.ka.tickSinceVisible("aaav"),this.ka.flush())})),a.getRootNode().addEventListener("amp:dom-update",this.gb.bind(this))}getAccessReaderId(){return this.S?this.ea():null}ea(){if(!this.ua){let a=t();this.ua=this.Va.then((b=>b.get({scope:"amp-access",createCookieIfNotPresent:!0},a)))}return this.ua}areFirstAuthorizationsCompleted(){return this.da}onApplyAuthorizations(a){this.Ea.add(a)}gb(a){if(this.da){let b=a.target;return this.N.then((()=>{let c=this.combinedResponses();pc(this,b,c)}))}}getVendorSource(a){for(let b=0;b{this.da&&this.N.then((()=>{this.ampdoc.whenReady().then((()=>{let b=this.ampdoc.getRootNode(),c=this.combinedResponses();return pc(this,b,c)}))}))}))}Ha(){this.Ta.broadcast(C({type:"amp-access-reauthorize",origin:this.Pa}))}getAuthdataField(a){return this.S?this.N.then((()=>{var b=this.combinedResponses();b=fa(b,a);return void 0!==b?b:null})):null}ma(a){this.j.some((b=>b.getAdapter().isPingbackEnabled()))&&(this.X=null,this.ampdoc.whenReady().then((()=>{this.ampdoc.isVisible()&&yc(this,a);this.ampdoc.onVisibilityChanged((()=>{this.ampdoc.isVisible()&&yc(this,a)}))})))}$a(a){if(!a.satisfiesTrust(2))return null;"login"==a.method?(a.event&&a.event.preventDefault(),Ac(this,"")):a.method.startsWith("login-")?(a.event&&a.event.preventDefault(),Ac(this,a.method.substring(6))):"refresh"==a.method&&(a.event&&a.event.preventDefault(),rc(this));return null}getSource(a){J(0<=a&&aa[b.getNamespace()]=b.getAuthResponse()));return a}}(function(a){a.registerServiceForDoc("access",(function(b){b=new Bc(b);if(b.S){xa(b.H,"action").installActionHandler(b.H,b.$a.bind(b));for(let c=0;c