Advertisement
Chriser_

amp-bind-0.1.js

Jun 10th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (self.AMP=self.AMP||[]).push({n:"amp-bind",v:"1528391646530",f:(function(AMP){var x;function ca(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}var da=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a}(this);function ea(a,b){b=void 0===b?"":b;try{return decodeURIComponent(a)}catch(c){return b}};var fa=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function pa(a){var b=Object.create(null);if(!a)return b;for(var c;c=fa.exec(a);){var d=ea(c[1],c[1]),e=c[2]?ea(c[2],c[2]):"";b[d]=e}return b};var qa="";function va(){var a,b=a||self,c;if(b.AMP_MODE)c=b.AMP_MODE;else{c=b;var d=pa(c.location.originalHash||c.location.hash),e=pa(c.location.search);qa||(qa=c.AMP_CONFIG&&c.AMP_CONFIG.v?c.AMP_CONFIG.v:"011528391646530");c=b.AMP_MODE={localDev:!1,development:!("1"!=d.development&&!c.AMP_DEV_MODE),examiner:"2"==d.development,filter:d.filter,geoOverride:d["amp-geo"],minified:!0,lite:void 0!=e.amp_lite,test:!1,log:d.log,version:"1528391646530",rtvVersion:qa}}return c};var wa=Object.prototype.toString;function xa(a){if(!a)return[];for(var b=Array(a.length),c=0;c<a.length;c++)b[c]=a[c];return b}function ya(a){return"[object Object]"===wa.call(a)};function Aa(a){var b=a.message,c=String(Math.random());a.message=c;if(a.message===c)return a.message=b,a;var b=Error(a.message),d;for(d in a)b[d]=a[d];b.stack=a.stack;return b}function Ba(a){for(var b=null,c="",d=0;d<arguments.length;d++){var e=arguments[d];e instanceof Error&&!b?b=Aa(e):(c&&(c+=" "),c+=e)}b?c&&(b.message=c+": "+b.message):b=Error(c);return b}function Ca(a){var b=Ba.apply(null,arguments);setTimeout(function(){self.reportError(b);throw b;})}self.log=self.log||{user:null,dev:null,userForEmbed:null};
  2. var Da=self.log;function z(){if(!Da.user)throw Error("failed to call initLogConstructor");return Da.user}function Ea(){if(Da.dev)return Da.dev;throw Error("failed to call initLogConstructor");};var Fa=Object.prototype.hasOwnProperty;function Ga(a){var b=Object.create(null);a&&Object.assign(b,a);return b}function Ha(a){return a||{}}function Ia(a,b){if(Fa.call(a,b))return a[b]}
  3. function Ja(a,b){var c=10,c=void 0===c?10:c,d=[],e=[];e.push({t:a,s:b,d:0});for(a={};0<e.length;){b=e.shift();a.t=b.t;a.s=b.s;a.d=b.d;if(d.includes(a.s))throw Error("Source object has a circular reference.");d.push(a.s);a.t!==a.s&&(a.d>c?Object.assign(a.t,a.s):(Object.keys(a.s).forEach(function(a){return function(b){var c=a.s[b];if(Fa.call(a.t,b)){var d=a.t[b];if(ya(c)&&ya(d)){e.push({t:d,s:c,d:a.d+1});return}}a.t[b]=c}}(a)),a={s:a.s,t:a.t,d:a.d}))}};function I(a,b){return b.length>a.length?!1:0==a.lastIndexOf(b,0)};var Ka=self.AMP_CONFIG||{},La=Ka.cdnUrl||"https://cdn.ampproject.org",Ma=("string"==typeof Ka.cdnProxyRegex?new RegExp(Ka.cdnProxyRegex):Ka.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/,Na=Ka.errorReportingUrl||"https://amp-error-reporting.appspot.com/r";function Oa(a){this.wa=a;this.Z=this.fa=0;this.V=Object.create(null)}Oa.prototype.has=function(a){return!!this.V[a]};Oa.prototype.get=function(a){var b=this.V[a];if(b)return b.access=++this.Z,b.payload};Oa.prototype.put=function(a,b){this.has(a)||this.fa++;this.V[a]={payload:b,access:this.Z};if(!(this.fa<=this.wa)){Ea().warn("lru-cache","Trimming LRU cache");a=this.V;var c=this.Z+1,d,e;for(e in a){var f=a[e].access;f<c&&(c=f,d=e)}void 0!==d&&(delete a[d],this.fa--)}};var Qa=Ha({c:!0,v:!0,a:!0,ad:!0}),Ra,Sa,Ta=/[?&]amp_js[^&]*/,Ua=/[?&]amp_gsa[^&]*/,Va=/[?&]usqp[^&]*/;
  4. function J(a){var b;Ra||(Ra=self.document.createElement("a"),Sa=self.UrlCache||(self.UrlCache=new Oa(100)));var c=b?null:Sa,d=Ra;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;
  5. e.origin=d.origin&&"null"!=d.origin?d.origin:"data:"!=e.protocol&&e.host?e.protocol+"//"+e.host:e.href;c&&c.put(a,e);a=e}return a}function Wa(a){"string"==typeof a&&(a=J(a));var b;(b="https:"==a.protocol||"localhost"==a.hostname)||(a=a.hostname,b=a.length-10,b=0<=b&&a.indexOf(".localhost",b)==b);return b}
  6. function Xa(a,b){var c;c=void 0===c?"source":c;z().assert(null!=a,"%s %s must be available",b,c);var d=a;z().assert(Wa(d)||/^(\/\/)/.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);return d}function Ya(a){"string"==typeof a&&(a=J(a));return Ma.test(a.origin)}
  7. function Za(a){"string"==typeof a&&(a=J(a));if(!Ya(a))return a.href;var b=a.pathname.split("/"),c=b[1];z().assert(Qa[c],"Unknown path prefix in url %s",a.href);var d=b[2],e="s"==d?"https://"+decodeURIComponent(b[3]):"http://"+decodeURIComponent(d);z().assert(0<e.indexOf("."),"Expected a . in origin %s",e);b.splice(1,"s"==d?3:2);b=e+b.join("/");c=(c=a.search)&&"?"!=c?(c=c.replace(Ta,"").replace(Ua,"").replace(Va,"").replace(/^[?&]/,""))?"?"+c:"":"";return b+c+(a.hash||"")}
  8. function $a(a,b){"string"==typeof b&&(b=J(b));var c;if("function"==typeof URL)c=(new URL(a,b.href)).toString();else{c=a;var d=b;"string"==typeof d&&(d=J(d));c=c.replace(/\\/g,"/");var e=J(c);c=I(c.toLowerCase(),e.protocol)?e.href:I(c,"//")?d.protocol+c:I(c,"/")?d.origin+c:d.origin+d.pathname.replace(/\/[^/]*$/,"/")+c}return c}function ab(a){var b=J(a),c=pa(b.search);z().assert(!("__amp_source_origin"in c),"Source origin is not allowed in %s",a)};function bb(){var a,b;this.promise=new Promise(function(c,d){a=c;b=d});this.resolve=a;this.reject=b};function cb(a,b,c){if(a.nodeType){var d=db((a.ownerDocument||a).defaultView,b);if(d)return d}return!a.nodeType||c?M(a,b):null}function eb(a,b){var c=fb(a);db(a,"bind");gb(a,a,"bind",function(){return b});hb(a,"bind")}function db(a,b){var c=fb(a);return a!=c&&ib(a,b)?hb(a,b):null}function jb(a,b){a=fb(a);return hb(a,b)}function M(a,b){a=kb(a);a=lb(a);return hb(a,b)}function fb(a){return a.__AMP_TOP||a}function kb(a){return a.nodeType?jb((a.ownerDocument||a).defaultView,"ampdoc").getAmpDoc(a):a}
  9. function lb(a){a=kb(a);return a.isSingleDoc()?a.win:a}function hb(a,b){ib(a,b);var c=mb(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 gb(a,b,c,d){var e=mb(a),f=e[c];f||(f=e[c]={obj:null,promise:null,resolve:null,context:null,ctor:null});f.ctor||f.obj||(f.ctor=d,f.context=b,f.resolve&&hb(a,c))}
  10. function nb(a,b){var c=ob(a,b);if(c)return c;var d=new bb,e=d,f=e.promise,e=e.resolve;mb(a)[b]={obj:null,promise:f,resolve:e,context:null,ctor:null};return f}function ob(a,b){var c=mb(a)[b];if(c){if(c.promise)return c.promise;hb(a,b);return c.promise=Promise.resolve(c.obj)}return null}function mb(a){var b=a.services;b||(b=a.services={});return b}function ib(a,b){a=a.services&&a.services[b];return!(!a||!a.ctor&&!a.obj)};/*
  11.  https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
  12. function pb(a,b,c){if(b(a))c();else{var d=a.ownerDocument.defaultView;if(d.MutationObserver){var e=new d.MutationObserver(function(){b(a)&&(e.disconnect(),c())});e.observe(a,{childList:!0})}else var f=d.setInterval(function(){b(a)&&(d.clearInterval(f),c())},5)}}function qb(a,b){pb(a.documentElement,function(){return!!a.body},b)}function rb(a){return new Promise(function(b){qb(a,b)})}
  13. function sb(a){var b;return(b="function"===typeof a.getElementsByTagName?a.getElementsByTagName("title"):a.querySelectorAll("title"))&&b[0]||null}function tb(a,b){for(var c=0,d;void 0!==(d=a[c]);c++)b(d,c)}function ub(a){return"SCRIPT"==a.tagName&&"APPLICATION/JSON"==a.getAttribute("type").toUpperCase()};var vb=[];function wb(a){var b=kb(a),c=ob(lb(a),"bind");return c?c:b.whenBodyAvailable().then(function(){return xb(b.win)}).then(function(){var c=b.win;return c.ampExtendedElements&&c.ampExtendedElements["amp-bind"]?nb(lb(a),"bind"):null})}function yb(a){var b=cb(a,"bind");if(b)return Promise.resolve(b);if(a.nodeType){var b=(a.ownerDocument||a).defaultView,c=fb(b);return b!==c?zb(b):wb(a)}return Promise.resolve(null)}
  14. function xb(a){return Promise.resolve().then(function(){if(vb.includes("amp-bind")){var b=jb(a,"extensions");return b.waitForExtension(a,"amp-bind")}})}function zb(a){return rb(a.document).then(function(){return xb(a)}).then(function(){return a.ampExtendedElements&&a.ampExtendedElements["amp-bind"]?nb(a,"bind"):null})};function Ab(a,b){if("."==b)return a;b=b.split(".");for(var c=0;c<b.length;c++){var d=b[c];if(d&&a&&void 0!==a[d]&&(null==a||"object"!=typeof a?0:Object.prototype.hasOwnProperty.call(a,d)))a=a[d];else{a=void 0;break}}return a}function Bb(a,b){try{return JSON.parse(a)}catch(c){b&&b(c)}}
  15. function Cb(a,b,c){c=void 0===c?3:c;if(!isFinite(c))throw Error("depth arg must be finite: "+c);if(a===b)return!0;if(1>c||typeof a!==typeof b)return!1;if(Array.isArray(a)&&Array.isArray(b)){if(a.length!==b.length)return!1;for(var d=0;d<a.length;d++)if(!Cb(a[d],b[d],c-1))return!1;return!0}if(a&&b&&"object"===typeof a&&"object"===typeof b){var e=Object.keys(a),f=Object.keys(b);if(e.length!==f.length)return!1;for(d=0;d<e.length;d++){var g=e[d],k=a[g],h=b[g];if(!Cb(k,h,c-1))return!1}return!0}return!1}
  16. ;function Db(){var a=Eb();return function(b){return setTimeout(b,a())}}function Eb(){var a=0;return function(){var b=Math.pow(1.5,a++),c;c=b*(c||.3)*Math.random();.5<Math.random()&&(c*=-1);b+=c;return 1E3*b}};var Fb,Gb="Webkit webkit Moz moz ms O o".split(" ");function Hb(a,b){var c=void 0;if(I(b,"--"))return b;Fb||(Fb=Ga());var d=Fb[b];if(!d||c){d=b;if(void 0===a[b]){var e=b.charAt(0).toUpperCase()+b.slice(1);a:{for(var f=0;f<Gb.length;f++){var g=Gb[f]+e;if(void 0!==a[g]){e=g;break a}}e=""}var k=e;void 0!==a[k]&&(d=k)}c||(Fb[b]=d)}return d}function Ib(a,b,c){var d;(b=Hb(a.style,b))&&(a.style[b]=d?c+d:c)}
  17. function Jb(a){var b=!1;if(void 0===b){var c;c=(c=Hb(a.style,"display"))?a.style[c]:void 0;b="none"==c}Ib(a,"display",b?"":"none")};var Kb={"amp-dynamic-css-classes":"[custom-element=amp-dynamic-css-classes]",variant:"amp-experiment","amp-story":"amp-story[standalone]"};function Lb(a){var b=Mb(a).map(function(b){return jb(a,"timer").timeoutPromise(3E3,nb(a,b),"Render timeout waiting for service "+b+" to be ready.")});return Promise.all(b)}function Mb(a){var b=a.document;return Object.keys(Kb).filter(function(a){return b.querySelector(Kb[a])})};function Nb(a){var b,c=a.defaultView;if(!c.__AMP_BODY_VISIBLE){var d=function(){c.__AMP_BODY_VISIBLE=!0;var b=a.body,d={opacity:1,visibility:"visible",animation:"none"},g;for(g in d)Ib(b,g,d[g]);try{M(a,"resources").renderStarted()}catch(k){}};try{qb(a,function(){c.__AMP_BODY_VISIBLE||(c.__AMP_BODY_VISIBLE=!0,b?Lb(c).catch(function(a){Ca(a);return[]}).then(function(b){d();0<b.length&&M(a,"resources").schedulePass(1,!0);try{var e=jb(c,"performance");e.tick("mbv");e.flush()}catch(g){}}):d())})}catch(e){d(),
  18. Ca(e)}}};var Ob=self.AMPErrors||[];self.AMPErrors=Ob;function Pb(a){Pb=Db();return Pb(a)}function Tb(a){try{return JSON.stringify(a)}catch(b){return String(a)}}var Ub;
  19. function Vb(a,b){try{var c;if(a)if(void 0!==a.message)a=Aa(a),c=!0;else{var d=a;a=Error(Tb(d));a.origError=d}else a=Error("Unknown error");if(!a.reported){a.reported=!0;var e=b||a.associatedElement;e&&e.classList&&(e.classList.add("i-amphtml-error"),va().development&&(e.classList.add("i-amphtml-element-error"),e.setAttribute("error-message",a.message)));if(self.console){var f=console.error||console.log;a.messageArray?f.apply(console,a.messageArray):e?f.call(console,a.message,e):f.call(console,a.message)}e&&
  20. e.ya&&e.ya("amp:error",a.message);Wb.call(void 0,void 0,void 0,void 0,void 0,a)}}catch(g){setTimeout(function(){throw g;})}}function Wb(a,b,c,d,e){this&&this.document&&Nb(this.document);if(!va().development){var f=!1;try{f=Xb()}catch(k){}if(!(f&&.01<Math.random())){var g=Yb(a,b,c,d,e,f);g&&(Zb(this,g),Pb(function(){var a=new XMLHttpRequest;a.open("POST",Na,!0);a.send(JSON.stringify(g))}))}}}
  21. function Zb(a,b){var c=jb(a,"ampdoc");if(c.isSingleDoc()){var d=c.getAmpDoc(),e=d.getRootNode().documentElement,f=e.hasAttribute("report-errors-to-viewer");if(f){var g=M(d,"viewer");g.hasCapability("errorReporter")?g.isTrustedViewer().then(function(a){if(!a)return!1;g.sendMessage("error",b);return!0}):Promise.resolve(!1)}else Promise.resolve(!1)}else Promise.resolve(!1)}
  22. function Yb(a,b,c,d,e,f){var g=!1;e&&(a=e.message?e.message:String(e),e.expected&&(g=!0));a||(a="Unknown error");if(!/_reported_/.test(a)&&"CANCELLED"!=a){var k=Math.random();if(-1!=a.indexOf("Failed to load:")||"Script error."==a)if(g=!0,.001<k)return;var h=0<=a.indexOf("\u200b\u200b\u200b");if(!(h&&.1<k)){var l=Object.create(null);l.v=va().rtvVersion;l.noAmp=f?"1":"0";l.m=a.replace("\u200b\u200b\u200b","");l.a=h?"1":"0";l.ex=g?"1":"0";var p="1p";self.context&&self.context.location?(l["3p"]="1",
  23. p="3p"):va().runtime&&(p=va().runtime);l.rt=p;f=self;l.ca=f.AMP_CONFIG&&f.AMP_CONFIG.canary?"1":"0";f=self;l.bt=f.AMP_CONFIG&&f.AMP_CONFIG.type?f.AMP_CONFIG.type:"unknown";self.location.ancestorOrigins&&self.location.ancestorOrigins[0]&&(l.or=self.location.ancestorOrigins[0]);self.viewerState&&(l.vs=self.viewerState);self.parent&&self.parent!=self&&(l.iem="1");if(self.AMP&&self.AMP.viewer){var n=self.AMP.viewer.getResolvedViewerUrl(),r=self.AMP.viewer.maybeGetMessagingOrigin();n&&(l.rvu=n);r&&(l.mso=
  24. r)}Ub||(Ub=$b());l.jse=Ub;var v=[];f=self.__AMP__EXPERIMENT_TOGGLES||null;for(var t in f)v.push(t+"="+(f[t]?"1":"0"));l.exps=v.join(",");e?(l.el=e.associatedElement?e.associatedElement.tagName:"u",e.args&&(l.args=JSON.stringify(e.args)),h||e.ignoreStack||!e.stack||(l.s=e.stack),e.message+=" _reported_"):(l.f=b||"",l.l=c||"",l.c=d||"");l.r=self.document.referrer;l.ae=Ob.join(",");l.fr=self.location.originalHash||self.location.hash;25<=Ob.length&&Ob.splice(0,Ob.length-25+1);Ob.push(a);return l}}}
  25. function Xb(){for(var a=self.document.querySelectorAll("script[src]"),b=0;b<a.length;b++)if(!Ya(a[b].src.toLowerCase()))return!0;return!1}function $b(){function a(){}a.prototype.t=function(){throw Error("message");};var b=new a;try{b.t()}catch(e){var c=e.stack;if(I(c,"t@"))return"Safari";if(-1<c.indexOf(".prototype.t@"))return"Firefox";var d=c.split("\n").pop();if(/\bat .* \(/i.test(d))return"IE";if(I(c,"Error: message"))return"Chrome"}return"unknown"};function ac(){this.K=Ga();this.w=null}x=ac.prototype;x.get=function(a){return this.K[a]||null};x.whenSignal=function(a){var b=this.w&&this.w[a];if(!b){var c=this.K[a];null!=c?b={promise:"number"==typeof c?Promise.resolve(c):Promise.reject(c)}:(c=new bb,b={promise:c.promise,resolve:c.resolve,reject:c.reject});this.w||(this.w=Ga());this.w[a]=b}return b.promise};
  26. x.signal=function(a,b){if(null==this.K[a]){var c=b||Date.now();this.K[a]=c;(a=this.w&&this.w[a])&&a.resolve&&(a.resolve(c),a.resolve=void 0,a.reject=void 0)}};x.rejectSignal=function(a,b){null==this.K[a]&&(this.K[a]=b,(a=this.w&&this.w[a])&&a.reject&&(a.reject(b),a.resolve=void 0,a.reject=void 0))};x.reset=function(a){this.K[a]&&delete this.K[a];var b=this.w&&this.w[a];b&&!b.resolve&&delete this.w[a]};function bc(a,b){function c(){d=0;var g=5E3-(a.Date.now()-e);if(0<g)d=a.setTimeout(c,g);else{var k=f;f=null;b.apply(null,k)}}var d=0,e=0,f=null;return function(b){for(var g=[],h=0;h<arguments.length;++h)g[h-0]=arguments[h];e=a.Date.now();f=g;d||(d=a.setTimeout(c,5E3))}};function cc(a,b){for(var c=[],d=0,e=0;e<a.length;e++){var f=a[e];b(f,e,a)?(d<e&&(a[d]=f),d++):c.push(f)}d<a.length&&(a.length=d)};function dc(a){return AMP.BaseElement.apply(this,arguments)||this}ca(dc,AMP.BaseElement);x=dc.prototype;x.getLayoutPriority=function(){return 1};x.isAlwaysFixed=function(){return!0};x.isLayoutSupported=function(){return!0};x.renderOutsideViewport=function(){return!0};x.R=function(){return"<amp-bind-macro> "+(this.element.getAttribute("id")||"<unknown id>")};function ec(a,b,c){var d=void 0,d=void 0===d?".":d;c=void 0===c?0:c;var e=Xa(b.getAttribute("src"),b),f=cb(a,"url-replace",!0),g=1<=c?f.expandUrlAsync(e):Promise.resolve(e);return g.then(function(d){if(1==c){var e=f.collectUnwhitelistedVarsSync(b);if(0<e.length)throw z().createError("URL variable substitutions in CORS fetches from dynamic URLs (e.g. via amp-bind) require opt-in. "+('Please add data-amp-replace="'+e.join(" ")+'" to the ')+("<"+b.tagName+"> element. See https://bit.ly/amp-var-subs."));
  27. }var g={};b.hasAttribute("credentials")?g.credentials=b.getAttribute("credentials"):g.requireAmpResponseSourceOrigin=!1;return jb(a.win,"batched-xhr").fetchJson(d,g)}).then(function(a){return a.json()}).then(function(a){if(null==a)throw Error("Response is undefined.");return Ab(a,d||".")})};function fc(a){return AMP.BaseElement.apply(this,arguments)||this}ca(fc,AMP.BaseElement);x=fc.prototype;x.getLayoutPriority=function(){return 1};x.isAlwaysFixed=function(){return!0};x.isLayoutSupported=function(){return!0};x.activate=function(){var a=this.R();this.user().error(a,'Please use AMP.setState() action explicitly, e.g. on="submit-success:AMP.setState({myAmpState: event.response})"')};
  28. x.buildCallback=function(){var a=this;Jb(this.element);this.element.setAttribute("aria-hidden","true");M(this.getAmpDoc(),"viewer").whenFirstVisible().then(function(){return a.ba()})};x.mutatedAttributesCallback=function(a){if(M(this.getAmpDoc(),"viewer").isVisible())void 0!==a.src&&gc(this,!1);else{var b=this.R();Ea().error(b,"Viewer must be visible before mutation.")}};x.renderOutsideViewport=function(){return!0};
  29. x.ba=function(){var a=this;this.element.hasAttribute("overridable")&&yb(this.element).then(function(b){b.makeStateKeyOverridable(a.element.getAttribute("id"))});0<this.element.children.length&&hc(this);this.element.hasAttribute("src")&&gc(this,!0)};
  30. function hc(a){var b=a.R(),c=a.element.children;if(1!=c.length)a.user().error(b,"Should contain exactly one <script> child.");else{var d=c[0];ub(d)?(c=Bb(d.textContent,function(c){a.user().error(b,"Failed to parse state. Is it valid JSON?",c)}),ic(a,c,!0)):a.user().error(b,'State should be in a <script> tag with type="application/json".')}}function jc(a,b,c){var d=b.getAttribute("src"),e=1;if(c||J(Za(d)).origin==J(Za(a.win.location)).origin)e=2;return ec(a,b,e)}
  31. function gc(a,b){var c=a.getAmpDoc();jc(c,a.element,b).then(function(c){ic(a,c,b)})}function ic(a,b,c){if(void 0!==b&&null!==b){var d=z().assert(a.element.id,"<amp-state> must have an id."),e=Ga();e[d]=b;yb(a.element).then(function(a){a.setState(e,c,!c)})}}x.R=function(){return"<amp-state> "+(this.element.getAttribute("id")||"<unknown id>")};function W(a,b,c){this.type=a;this.args=b;this.value=c};(function(){function a(a,b,c){var d;c=c||{};for(d=a.length;d--;c[a[d]]=b);return c}function b(){this.yy={}}var c=[1,7],d=[1,10],e=[1,11],f=[1,12],g=[1,13],k=[1,23],h=[1,17],l=[1,18],p=[1,19],n=[1,20],r=[1,21],v=[1,22],t=[1,26],w=[1,25],u=[1,27],y=[1,28],q=[1,29],E=[1,30],F=[1,31],A=[1,32],G=[1,33],H=[1,34],K=[1,35],N=[1,36],O=[1,37],R=[1,38],D=[1,39],C=[1,41],B=[5,10,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,31,35,38,39,49],sa=[2,39],T=[1,47],ja=[1,52],S=[1,54],X=[5,10,14,15,16,17,18,19,20,21,
  32. 22,23,24,25,26,27,28,35,39,49],Q=[1,75],ka=[35,49],ta=[10,35,39],la=[5,10,14,15,19,20,21,22,23,24,25,26,27,28,35,39,49],aa=[5,10,19,20,21,22,23,24,25,26,27,28,35,39,49],ga=[5,10,19,20,25,26,27,28,35,39,49],ua=[10,35],na={trace:function P(){},yy:{},Ea:{error:2,result:3,expr:4,EOF:5,operation:6,invocation:7,member_access:8,"(":9,")":10,variable:11,literal:12,"!":13,"-":14,"+":15,"*":16,"/":17,"%":18,"&&":19,"||":20,"<=":21,"<":22,">=":23,">":24,"!=":25,"==":26,"?":27,":":28,NAME:29,args:30,".":31,arrow_function:32,
  33. "=>":33,params:34,",":35,array:36,member:37,"[":38,"]":39,primitive:40,object_literal:41,array_literal:42,STRING:43,NUMBER:44,TRUE:45,FALSE:46,NULL:47,"{":48,"}":49,object:50,key_value:51,key:52,$accept:0,$end:1},U:{2:"error",5:"EOF",9:"(",10:")",13:"!",14:"-",15:"+",16:"*",17:"/",18:"%",19:"&&",20:"||",21:"<=",22:"<",23:">=",24:">",25:"!=",26:"==",27:"?",28:":",29:"NAME",31:".",33:"=>",35:",",38:"[",39:"]",43:"STRING",44:"NUMBER",45:"TRUE",46:"FALSE",47:"NULL",48:"{",49:"}"},pa:[0,[3,2],[3,1],[4,
  34. 1],[4,1],[4,1],[4,3],[4,1],[4,1],[6,2],[6,2],[6,2],[6,3],[6,3],[6,3],[6,3],[6,3],[6,3],[6,3],[6,3],[6,3],[6,3],[6,3],[6,3],[6,3],[6,5],[7,2],[7,4],[7,6],[32,4],[32,3],[32,5],[34,3],[34,3],[30,2],[30,3],[8,2],[37,2],[37,3],[11,1],[12,1],[12,1],[12,1],[40,1],[40,1],[40,1],[40,1],[40,1],[42,2],[42,3],[42,4],[36,1],[36,3],[41,2],[41,3],[41,4],[50,1],[50,3],[51,3],[52,1],[52,1],[52,3]],performAction:function ha(a,b,c,d,e,f){var m=f.length-1;switch(e){case 1:return f[m-1];case 2:return"";case 3:case 4:case 5:case 7:case 8:this.h=
  35. f[m];break;case 6:this.h=f[m-1];break;case 9:this.h=new W(12,[f[m]]);break;case 10:this.h=new W(13,[f[m]]);break;case 11:this.h=new W(14,[f[m]]);break;case 12:this.h=new W(15,[f[m-2],f[m]]);break;case 13:this.h=new W(16,[f[m-2],f[m]]);break;case 14:this.h=new W(17,[f[m-2],f[m]]);break;case 15:this.h=new W(18,[f[m-2],f[m]]);break;case 16:this.h=new W(19,[f[m-2],f[m]]);break;case 17:this.h=new W(20,[f[m-2],f[m]]);break;case 18:this.h=new W(21,[f[m-2],f[m]]);break;case 19:this.h=new W(22,[f[m-2],f[m]]);
  36. break;case 20:this.h=new W(23,[f[m-2],f[m]]);break;case 21:this.h=new W(24,[f[m-2],f[m]]);break;case 22:this.h=new W(25,[f[m-2],f[m]]);break;case 23:this.h=new W(26,[f[m-2],f[m]]);break;case 24:this.h=new W(27,[f[m-2],f[m]]);break;case 25:this.h=new W(28,[f[m-4],f[m-2],f[m]]);break;case 26:this.h=new W(1,[void 0,f[m]],f[m-1]);break;case 27:this.h=new W(1,[f[m-3],f[m]],f[m-1]);break;case 28:this.h=new W(1,[f[m-5],f[m-1]],f[m-3]);break;case 29:this.h=new W(29,[void 0,f[m]]);break;case 30:var u=new W(6,
  37. null,[f[m-2]]);this.h=new W(29,[u,f[m]]);break;case 31:this.h=new W(29,[f[m-3],f[m]]);break;case 32:this.h=new W(6,null,[f[m-2],f[m]]);break;case 33:this.h=f[m-2];this.h.value.push(f[m]);break;case 34:this.h=new W(2,[]);break;case 35:this.h=new W(2,[f[m-1]]);break;case 36:this.h=new W(3,[f[m-1],f[m]]);break;case 37:this.h=new W(4,null,f[m]);break;case 38:this.h=new W(4,[f[m-1]]);break;case 39:this.h=new W(5,null,f[m]);break;case 40:case 41:case 42:case 60:this.h=f[m];break;case 43:f=a.substr(1,b-
  38. 2);this.h=new W(6,null,f);break;case 44:this.h=new W(6,null,Number(a));break;case 45:this.h=new W(6,null,!0);break;case 46:this.h=new W(6,null,!1);break;case 47:this.h=new W(6,null,null);break;case 48:this.h=new W(7,[]);break;case 49:this.h=new W(7,[f[m-1]]);break;case 50:this.h=new W(7,[f[m-2]]);break;case 51:this.h=new W(8,[f[m]]);break;case 52:case 57:this.h=f[m-2];this.h.args.push(f[m]);break;case 53:this.h=new W(9,[]);break;case 54:this.h=new W(9,[f[m-1]]);break;case 55:this.h=new W(9,[f[m-2]]);
  39. break;case 56:this.h=new W(10,[f[m]]);break;case 58:this.h=new W(11,[f[m-2],f[m]]);break;case 59:this.h=new W(6,null,f[m]);break;case 61:this.h=f[m-1]}},table:[{3:1,4:2,5:[1,3],6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{1:[3]},{5:[1,24],14:t,15:w,16:u,17:y,18:q,19:E,20:F,21:A,22:G,23:H,24:K,25:N,26:O,27:R,31:D,37:40,38:C},{1:[2,2]},a(B,[2,3]),a(B,[2,4]),a(B,[2,5]),{4:42,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,
  40. 44:l,45:p,46:n,47:r,48:v},a(B,[2,7]),a(B,[2,8]),{4:43,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:44,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:45,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},a(B,sa,{30:46,9:T}),a(B,[2,40]),a(B,[2,41]),a(B,[2,42]),a(B,[2,43]),a(B,[2,44]),a(B,[2,45]),a(B,[2,46]),a(B,[2,47]),{29:ja,38:S,40:53,43:h,
  41. 44:l,45:p,46:n,47:r,49:[1,48],50:49,51:50,52:51},{4:57,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,36:56,38:k,39:[1,55],40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{1:[2,1]},{4:58,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:59,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:60,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:61,
  42. 6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:62,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:63,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:64,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:65,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,
  43. 45:p,46:n,47:r,48:v},{4:66,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:67,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:68,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:69,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:70,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,
  44. 40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:71,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{29:[1,72]},a(B,[2,36]),{4:73,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{10:[1,74],14:t,15:w,16:u,17:y,18:q,19:E,20:F,21:A,22:G,23:H,24:K,25:N,26:O,27:R,31:D,37:40,38:C},a(X,[2,9],{37:40,31:D,38:C}),a(X,[2,10],{37:40,31:D,38:C}),a(X,[2,11],{37:40,31:D,38:C}),a(B,[2,26]),{4:57,6:4,7:5,8:6,
  45. 9:c,10:Q,11:8,12:9,13:d,14:e,15:f,29:g,36:76,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},a(B,[2,53]),{35:[1,78],49:[1,77]},a(ka,[2,56]),{28:[1,79]},{28:[2,59]},{28:[2,60]},{4:80,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},a(B,[2,48]),{35:[1,82],39:[1,81]},a(ta,[2,51],{37:40,14:t,15:w,16:u,17:y,18:q,19:E,20:F,21:A,22:G,23:H,24:K,25:N,26:O,27:R,31:D,38:C}),a(la,[2,12],{37:40,16:u,17:y,18:q,31:D,38:C}),a(la,[2,13],{37:40,16:u,17:y,18:q,
  46. 31:D,38:C}),a(X,[2,14],{37:40,31:D,38:C}),a(X,[2,15],{37:40,31:D,38:C}),a(X,[2,16],{37:40,31:D,38:C}),a([5,10,19,20,27,28,35,39,49],[2,17],{37:40,14:t,15:w,16:u,17:y,18:q,21:A,22:G,23:H,24:K,25:N,26:O,31:D,38:C}),a([5,10,20,27,28,35,39,49],[2,18],{37:40,14:t,15:w,16:u,17:y,18:q,19:E,21:A,22:G,23:H,24:K,25:N,26:O,31:D,38:C}),a(aa,[2,19],{37:40,14:t,15:w,16:u,17:y,18:q,31:D,38:C}),a(aa,[2,20],{37:40,14:t,15:w,16:u,17:y,18:q,31:D,38:C}),a(aa,[2,21],{37:40,14:t,15:w,16:u,17:y,18:q,31:D,38:C}),a(aa,[2,
  47. 22],{37:40,14:t,15:w,16:u,17:y,18:q,31:D,38:C}),a(ga,[2,23],{37:40,14:t,15:w,16:u,17:y,18:q,21:A,22:G,23:H,24:K,31:D,38:C}),a(ga,[2,24],{37:40,14:t,15:w,16:u,17:y,18:q,21:A,22:G,23:H,24:K,31:D,38:C}),{14:t,15:w,16:u,17:y,18:q,19:E,20:F,21:A,22:G,23:H,24:K,25:N,26:O,27:R,28:[1,83],31:D,37:40,38:C},a(B,[2,37],{30:84,9:[1,85]}),{14:t,15:w,16:u,17:y,18:q,19:E,20:F,21:A,22:G,23:H,24:K,25:N,26:O,27:R,31:D,37:40,38:C,39:[1,86]},a(B,[2,6]),a(B,[2,34]),{10:[1,87],35:[1,88]},a(B,[2,54]),{29:ja,38:S,40:53,43:h,
  48. 44:l,45:p,46:n,47:r,49:[1,89],51:90,52:51},{4:91,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{14:t,15:w,16:u,17:y,18:q,19:E,20:F,21:A,22:G,23:H,24:K,25:N,26:O,27:R,31:D,37:40,38:C,39:[1,92]},a(B,[2,49]),{4:94,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,39:[1,93],40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:95,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},a(B,[2,27]),{4:57,6:4,
  49. 7:5,8:6,9:[1,97],10:Q,11:8,12:9,13:d,14:e,15:f,29:[1,98],32:96,36:76,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},a(B,[2,38]),a(B,[2,35]),{4:94,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},a(B,[2,55]),a(ka,[2,57]),a(ka,[2,58],{37:40,14:t,15:w,16:u,17:y,18:q,19:E,20:F,21:A,22:G,23:H,24:K,25:N,26:O,27:R,31:D,38:C}),{28:[2,61]},a(B,[2,50]),a(ta,[2,52],{37:40,14:t,15:w,16:u,17:y,18:q,19:E,20:F,21:A,22:G,23:H,24:K,25:N,26:O,27:R,31:D,38:C}),
  50. a([5,10,28,35,39,49],[2,25],{37:40,14:t,15:w,16:u,17:y,18:q,19:E,20:F,21:A,22:G,23:H,24:K,25:N,26:O,27:R,31:D,38:C}),{10:[1,99]},{4:42,6:4,7:5,8:6,9:c,10:[1,100],11:8,12:9,13:d,14:e,15:f,29:[1,102],34:101,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},a([10,14,15,16,17,18,19,20,21,22,23,24,25,26,27,31,35,38],sa,{30:46,9:T,33:[1,103]}),a(B,[2,28]),{33:[1,104]},{10:[1,105],35:[1,106]},a([10,14,15,16,17,18,19,20,21,22,23,24,25,26,27,31,38],sa,{30:46,9:T,35:[1,107]}),{4:108,6:4,7:5,8:6,9:c,11:8,
  51. 12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{4:109,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,44:l,45:p,46:n,47:r,48:v},{33:[1,110]},{29:[1,111]},{29:[1,112]},{10:[2,30],14:t,15:w,16:u,17:y,18:q,19:E,20:F,21:A,22:G,23:H,24:K,25:N,26:O,27:R,31:D,37:40,38:C},{10:[2,29],14:t,15:w,16:u,17:y,18:q,19:E,20:F,21:A,22:G,23:H,24:K,25:N,26:O,27:R,31:D,37:40,38:C},{4:113,6:4,7:5,8:6,9:c,11:8,12:9,13:d,14:e,15:f,29:g,38:k,40:14,41:15,42:16,43:h,
  52. 44:l,45:p,46:n,47:r,48:v},a(ua,[2,33]),a(ua,[2,32]),{10:[2,31],14:t,15:w,16:u,17:y,18:q,19:E,20:F,21:A,22:G,23:H,24:K,25:N,26:O,27:R,31:D,37:40,38:C}],defaultActions:{3:[2,2],24:[2,1],52:[2,59],53:[2,60],92:[2,61]},parseError:function ia(a,b){if(b.recoverable)this.trace(a);else throw a=Error(a),a.hash=b,a;},parse:function L(a){function b(a){d.length-=2*a;f.length-=a;m.length-=a}var c=this,d=[0],e=[],f=[null],m=[],u=this.table,g="",h=0,Rb=0,za=0,p=2,l=1,k=m.slice.call(arguments,1),n=Object.create(this.lexer),
  53. y={yy:{}},q;for(q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,q)&&(y.yy[q]=this.yy[q]);n.setInput(a,y.yy);y.yy.lexer=n;y.yy.parser=this;"undefined"==typeof n.yylloc&&(n.yylloc={});var r=n.yylloc;m.push(r);var E=n.options&&n.options.ranges;this.parseError="function"===typeof y.yy.parseError?y.yy.parseError:Object.getPrototypeOf(this).parseError;var v=function(){var a;a=n.lex()||l;"number"!==typeof a&&(a=c.Ea[a]||a);return a};for(var A,t,F,w={},B,G,D,C;;){q=d[d.length-1];if(this.defaultActions[q])F=
  54. this.defaultActions[q];else{if(null===A||"undefined"==typeof A)A=v();F=u[q]&&u[q][A]}if("undefined"===typeof F||!F.length||!F[0]){var H="";C=[];for(B in u[q])this.U[B]&&B>p&&C.push("'"+this.U[B]+"'");H=n.showPosition?"Parse error on line "+(h+1)+":\n"+n.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.U[A]||A)+"'":"Parse error on line "+(h+1)+": Unexpected "+(A==l?"end of input":"'"+(this.U[A]||A)+"'");this.parseError(H,{text:n.match,token:this.U[A]||A,line:n.yylineno,loc:r,expected:C})}if(F[0]instanceof
  55. Array&&1<F.length)throw Error("Parse Error: multiple actions possible at state: "+q+", token: "+A);switch(F[0]){case 1:d.push(A);f.push(n.yytext);m.push(n.yylloc);d.push(F[1]);A=null;t?(A=t,t=null):(Rb=n.yyleng,g=n.yytext,h=n.yylineno,r=n.yylloc,0<za&&za--);break;case 2:G=this.pa[F[1]][1];w.h=f[f.length-G];w.ha={first_line:m[m.length-(G||1)].first_line,last_line:m[m.length-1].last_line,first_column:m[m.length-(G||1)].first_column,last_column:m[m.length-1].last_column};E&&(w.ha.range=[m[m.length-(G||
  56. 1)].range[0],m[m.length-1].range[1]]);q=this.performAction.apply(w,[g,Rb,h,y.yy,F[1],f,m].concat(k));if("undefined"!==typeof q)return q;G&&(d=d.slice(0,-2*G),f=f.slice(0,-1*G),m=m.slice(0,-1*G));d.push(this.pa[F[1]][0]);f.push(w.h);m.push(w.ha);D=u[d[d.length-2]][d[d.length-1]];d.push(D);break;case 3:return!0}}}},oa=function(){return{EOF:1,parseError:function(a,b){if(this.yy.parser)this.yy.parser.parseError(a,b);else throw Error(a);},setInput:function(a,b){this.yy=b||this.yy||{};this._input=a;this._more=
  57. this._backtrack=this.done=!1;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};this.options.ranges&&(this.yylloc.range=[0,0]);this.offset=0;return this},input:function(){var a=this._input[0];this.yytext+=a;this.yyleng++;this.offset++;this.match+=a;this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++;this.options.ranges&&
  58. this.yylloc.range[1]++;this._input=this._input.slice(1);return a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-b);this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);c.length-1&&(this.yylineno-=c.length-1);a=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+
  59. 1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b};this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-b]);this.yyleng=this.yytext.length;return this},more:function(){this._more=!0;return this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+
  60. this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(20<a.length?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;20>a.length&&(a+=this._input.substr(0,20-a.length));return(a.substr(0,20)+(20<a.length?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=Array(a.length+1).join("-");
  61. return a+this.upcomingInput()+"\n"+b+"^"},test_match:function(a,b){var c,d;this.options.backtrack_lexer&&(d={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&
  62. (d.yylloc.range=this.yylloc.range.slice(0)));if(c=a[0].match(/(?:\r\n?|\n).*/g))this.yylineno+=c.length;this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length};this.yytext+=a[0];this.match+=a[0];this.matches=a;this.yyleng=this.yytext.length;this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]);this._backtrack=
  63. this._more=!1;this._input=this._input.slice(a[0].length);this.matched+=a[0];a=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]);this.done&&this._input&&(this.done=!1);if(a)return a;if(this._backtrack)for(var f in d)this[f]=d[f];return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c;this._more||(this.match=this.yytext="");for(var d=this._currentRules(),f=0;f<d.length;f++)if((b=this._input.match(this.rules[d[f]]))&&(!a||
  64. b[0].length>a[0].length))if(a=b,c=f,this.options.backtrack_lexer){a=this.test_match(b,d[f]);if(!1!==a)return a;if(this._backtrack)a=!1;else return!1}else if(!this.options.flex)break;return a?(a=this.test_match(a,d[c]),!1!==a?a:!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 a=this.next();return a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},
  65. popState:function m(){return 0<this.conditionStack.length-1?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function U(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function V(a){a=this.conditionStack.length-1-Math.abs(a||0);return 0<=a?this.conditionStack[a]:"INITIAL"},pushState:function ba(a){this.begin(a)},stateStackSize:function ma(){return this.conditionStack.length},
  66. options:{},performAction:function(a,b,c,d){var f=d;switch(c){case 1:return 47;case 2:return 45;case 3:return 46;case 4:return 44;case 5:return 29;case 6:return 43;case 7:return 43;case 8:return 33;case 9:return 15;case 10:return 14;case 11:return 16;case 12:return 17;case 13:return 19;case 14:return 20;case 15:return 25;case 16:return 26;case 17:return 21;case 18:return 22;case 19:return 23;case 20:return 24;case 21:return 13;case 22:return 27;case 23:return 28;case 24:return 18;case 25:return 38;
  67. case 26:return 39;case 27:return 48;case 28:return 49;case 29:return 9;case 30:return 10;case 31:return 35;case 32:return 31;case 33:return"INVALID";case 34:return 5}},rules:[/^(?:\s+)/,/^(?:null\b)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:[0-9]+(\.[0-9]+)?\b)/,/^(?:[a-zA-Z_][a-zA-Z0-9_]*)/,/^(?:'[^\']*')/,/^(?:"[^\"]*")/,/^(?:=>)/,/^(?:\+)/,/^(?:-)/,/^(?:\*)/,/^(?:\/)/,/^(?:&&)/,/^(?:\|\|)/,/^(?:!=)/,/^(?:==)/,/^(?:<=)/,/^(?:<)/,/^(?:>=)/,/^(?:>)/,/^(?:!)/,/^(?:\?)/,/^(?::)/,/^(?:%)/,/^(?:\[)/,/^(?:\])/,
  68. /^(?:\{)/,/^(?:\})/,/^(?:\()/,/^(?:\))/,/^(?:,)/,/^(?:\.)/,/^(?:.)/,/^(?:$)/],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,28,29,30,31,32,33,34],inclusive:!0}}}}();na.lexer=oa;b.prototype=na;na.Parser=b;return new b})();var kc=/(\S+)(?:\s+(?:(-?\d+(?:\.\d+)?)([a-zA-Z]*)))?\s*(?:,|$)/g;function lc(a){for(var b=[],c;c=kc.exec(a);){var d=c[1],e=void 0,f;if(c[2]){var g=c[3].toLowerCase();if("w"==g)e=parseInt(c[2],10);else if("x"==g)f=parseFloat(c[2]);else continue}else f=1;b.push({url:d,width:e,dpr:f})}return new mc(b)}
  69. function mc(a){z().assert(0<a.length,"Srcset must have at least one source");this.S=a;for(var b=!1,c=!1,d=0;d<a.length;d++)var e=a[d],b=b||!!e.width,c=c||!!e.dpr;z().assert(!!(b^c),"Srcset must have width or dpr sources, but not both");a.sort(b?nc:oc);this.ta=b}
  70. mc.prototype.select=function(a,b){if(this.ta){b*=a;a=this.S;for(var c=0,d=Infinity,e=Infinity,f=0;f<a.length;f++){var g=a[f].width,k=Math.abs(g-b);if(k<=1.1*d||1.2<b/e)c=f,d=k,e=g;else break}}else for(a=this.S,c=0,d=Infinity,e=0;e<a.length;e++)if(f=Math.abs(a[e].dpr-b),f<=d)c=e,d=f;else break;b=c;return this.S[b].url};mc.prototype.getUrls=function(){return this.S.map(function(a){return a.url})};
  71. mc.prototype.stringify=function(a){for(var b=[],c=this.S,d=0;d<c.length;d++){var e=c[d],f=e.url;a&&(f=a(f));f=this.ta?f+(" "+e.width+"w"):f+(" "+e.dpr+"x");b.push(f)}return b.join(", ")};function nc(a,b){z().assert(a.width!=b.width,"Duplicate width: %s",a.width);return a.width-b.width}function oc(a,b){z().assert(a.dpr!=b.dpr,"Duplicate dpr: %s",a.dpr);return a.dpr-b.dpr};var pc={"class":{blacklistedValueRegex:"(^|\\W)i-amphtml-"},hidden:null,text:null},qc={width:null,height:null},rc={"AMP-BRIGHTCOVE":{"data-account":null,"data-embed":null,"data-player":null,"data-player-id":null,"data-playlist-id":null,"data-video-id":null},"AMP-CAROUSEL":{slide:null},"AMP-IFRAME":{src:null},"AMP-IMG":{alt:null,attribution:null,src:{allowedProtocols:{data:!0,http:!0,https:!0}},srcset:{alternativeName:"src"}},"AMP-LIST":{src:{allowedProtocols:{https:!0}},state:null},"AMP-SELECTOR":{disabled:null,
  72. selected:null},"AMP-STATE":{src:{allowedProtocols:{https:!0}}},"AMP-VIDEO":{alt:null,attribution:null,controls:null,loop:null,poster:null,preload:null,src:{allowedProtocols:{https:!0}}},"AMP-YOUTUBE":{"data-videoid":null},A:{href:{allowedProtocols:{ftp:!0,http:!0,https:!0,mailto:!0,"fb-messenger":!0,intent:!0,skype:!0,sms:!0,snapchat:!0,tel:!0,tg:!0,threema:!0,twitter:!0,viber:!0,whatsapp:!0}}},BUTTON:{disabled:null,type:null,value:null},FIELDSET:{disabled:null},INPUT:{accept:null,accesskey:null,
  73. autocomplete:null,checked:null,disabled:null,height:null,inputmode:null,max:null,maxlength:null,min:null,minlength:null,multiple:null,pattern:null,placeholder:null,readonly:null,required:null,selectiondirection:null,size:null,spellcheck:null,step:null,type:{blacklistedValueRegex:"(^|\\s)(button|image|)(\\s|$)"},value:null,width:null},OPTION:{disabled:null,label:null,selected:null,value:null},OPTGROUP:{disabled:null,label:null},SELECT:{autofocus:null,disabled:null,multiple:null,required:null,size:null},
  74. SOURCE:{src:{allowedProtocols:{https:!0}},type:null},TRACK:{label:null,src:{allowedProtocols:{https:!0}},srclang:null},TEXTAREA:{autocomplete:null,autofocus:null,cols:null,disabled:null,maxlength:null,minlength:null,placeholder:null,readonly:null,required:null,rows:null,selectiondirection:null,selectionend:null,selectionstart:null,spellcheck:null,wrap:null}},sc={src:!0,srcset:!0,href:!0};function tc(){}tc.prototype.canBind=function(a,b){return void 0!==uc(a,b)};
  75. tc.prototype.isResultValid=function(a,b,c){var d=uc(a,b);d&&d.alternativeName&&(d=uc(a,d.alternativeName));if(void 0===d)return!1;if(null===d)return!0;if(c&&Ia(sc,b)){var e;if("srcset"===b){var f;try{f=lc(c)}catch(l){return z().error("amp-bind","Failed to parse srcset: ",l),!1}e=f.getUrls()}else e=[c];for(a=0;a<e.length;a++){a:{var g=e[a];if((b=d.allowedProtocols)&&g&&(g=/^([^:\/?#.]+):[\s\S]*$/.exec(g),null!==g&&(g=g[1].toLowerCase().trim(),!b.hasOwnProperty(g)))){b=!1;break a}b=!0}if(!b)return!1}}var k=
  76. d.blacklistedValueRegex;if(c&&k){var h=new RegExp(k,"i");if(h.test(c))return!1}return!0};function uc(a,b){if(I(b,"aria-"))return null;var c=Ia(pc,b);if(void 0!==c)return c;var d=Ia(qc,b);if(I(a,"AMP-")&&void 0!==d)return d;var e=Ia(rc,a);if(e)return e[b]};function vc(){this.D=[]}vc.prototype.peek=function(){var a=this.D.length;return a?this.D[a-1].item:null};vc.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.D.length;e<=f;){d=Math.floor((e+f)/2);if(d===this.D.length)break;if(this.D[d].priority<c)e=d+1;else if(0<d&&this.D[d-1].priority>=c)f=d-1;else break}this.D.splice(d,0,{item:a,priority:b})};vc.prototype.dequeue=function(){return this.D.length?this.D.pop().item:null};
  77. da.Object.defineProperties(vc.prototype,{length:{configurable:!0,enumerable:!0,get:function(){return this.D.length}}});var wc=/nochunking=1/.test(self.location.hash),xc=Promise.resolve();function yc(a,b){if(wc)xc.then(b);else{var c=zc,d=kb(a),e=lb(d);gb(e,d,"chunk",c);M(a,"chunk").run(b,10)}}function Ac(a){this.state="not_run";this.aa=a}function Bc(a,b){if("run"!=a.state){a.state="run";try{a.aa(b)}catch(c){throw a.na(c),c;}}}Ac.prototype.R=function(){return this.aa.displayName||this.aa.name};Ac.prototype.na=function(){};Ac.prototype.ma=function(){return!1};Ac.prototype.sa=function(){return!0};
  78. function Cc(a,b,c){Ac.call(this,a);var d=this;this.o=b;this.F=null;c.then(function(a){d.F=a;d.F.isVisible()&&Bc(d,null);d.F.onVisibilityChanged(function(){d.F.isVisible()&&Bc(d,null)})})}ca(Cc,Ac);Cc.prototype.na=function(){Nb(self.document)};Cc.prototype.ma=function(){return this.F?this.F.isVisible():this.o.document.hidden?!1:!/visibilityState=(hidden|prerender)/.test(this.o.location.hash)};Cc.prototype.sa=function(){return!!this.F};
  79. function zc(a){var b=this;this.o=a.win;this.T=new vc;this.ia=this.ja.bind(this);this.Ha=nb(lb(a),"viewer");this.o.addEventListener("message",function(a){"amp-macro-task"==a.data&&b.ja(null)})}zc.prototype.run=function(a,b){var c=new Ac(a);Dc(this,c,b)};zc.prototype.runForStartup=function(a){a=new Cc(a,this.o,this.Ha);Dc(this,a,Number.POSITIVE_INFINITY)};function Dc(a,b,c){a.T.enqueue(b,c);xc.then(function(){Ec(a)})}
  80. function Fc(a,b){for(var c=a.T.peek();c&&"not_run"!==c.state;)a.T.dequeue(),c=a.T.peek();c&&b&&a.T.dequeue();return c}zc.prototype.ja=function(a){var b=this,c=Fc(this,!0);if(!c)return!1;var d=Date.now();Bc(c,a);xc.then(function(){Ec(b)});return!0};function Gc(a){xc.then(function(){a.ia(null)})}function Ec(a){var b=Fc(a);b&&(b.ma()?Gc(a):b.sa()&&a.o.requestIdleCallback?Hc(a.o,a.ia):a.o.postMessage("amp-macro-task","*"))}
  81. function Hc(a,b){var c=15,d=2E3;function e(g){if(g.timeRemaining()<c){var k=d-(Date.now()-f);0>=k||g.didTimeout?b(g):a.requestIdleCallback(e,{timeout:k})}else b(g)}var f=Date.now();a.requestIdleCallback(e,{timeout:d})};function Ic(a,b,c){var d="ww";a=b?a.protocol+"//"+a.host+"/dist":La;return c?a+"/rtv/"+va().rtvVersion+"/"+d+".js":a+"/"+d+".js"};function Jc(a){var b=this;this.o=a;this.Ia=jb(a,"xhr");var c=a.location,d=!1,e=!d,f=Ic(c,d,e);this.ga=null;this.ka=this.Ia.fetchText(f,{ampCors:!1}).then(function(a){return a.text()}).then(function(c){c=new a.Blob([c],{type:"text/javascript"});var d=a.URL.createObjectURL(c);b.ga=new a.Worker(d);b.ga.onmessage=b.Da.bind(b)});this.X={};this.xa=0;this.ua=[a]}
  82. function Kc(a,b,c,d){return a.ka.then(function(){return new Promise(function(e,f){var g=a.xa++;a.X[g]={method:b,resolve:e,reject:f};e=d||a.o;f=a.ua.indexOf(e);e=0<=f?f:a.ua.push(e)-1;a.ga.postMessage({method:b,args:c,scope:e,id:g})})})}Jc.prototype.Da=function(a){var b=a.data;a=b.method;var c=b.returnValue,b=b.id,d=this.X[b];d?(d.resolve(c),delete this.X[b]):Ea().error("web-worker","Received unexpected message ("+a+", "+b+") from worker.")};Jc.prototype.hasPendingMessages=function(){return 0<Object.keys(this.X).length};
  83. Jc.prototype.Ja=function(){return this.ka};var Lc="a abbr acronym address area article aside audio b bdi bdo big blink blockquote body br button canvas caption center cite code col colgroup content data datalist dd decorator del details dfn dir div dl dt element em fieldset figcaption figure font footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i img input ins kbd label legend li main map mark marquee menu menuitem meter nav nobr ol optgroup option output p pre progress q rp rt ruby s samp section select shadow small source spacer span strike strong style sub summary sup table tbody td template textarea tfoot th thead time tr track tt u ul var video wbr".split(" "),
  84. Mc="svg a altglyph altglyphdef altglyphitem animatecolor animatemotion animatetransform audio canvas circle clippath defs desc ellipse filter font g glyph glyphref hkern image line lineargradient marker mask metadata mpath path pattern polygon polyline radialgradient rect stop style switch symbol text textpath title tref tspan video view vkern".split(" "),Nc="feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence".split(" "),
  85. Oc="math menclose merror mfenced mfrac mglyph mi mlabeledtr mmuliscripts mn mo mover mpadded mphantom mroot mrow ms mpspace msqrt mystyle msub msup msubsup mtable mtd mtext mtr munder munderover".split(" "),Pc=["#text"],Qc="accept action align alt autocomplete background bgcolor border cellpadding cellspacing checked cite class clear color cols colspan coords crossorigin datetime default dir disabled download enctype face for headers height hidden high href hreflang id integrity ismap label lang list loop low max maxlength media method min multiple name noshade novalidate nowrap open optimum pattern placeholder poster preload pubdate radiogroup readonly rel required rev reversed role rows rowspan spellcheck scope selected shape size sizes span srclang start src srcset step style summary tabindex title type usemap valign value width xmlns".split(" "),
  86. Rc="accent-height accumulate additivive alignment-baseline ascent attributename attributetype azimuth basefrequency baseline-shift begin bias by class clip clip-path clip-rule color color-interpolation color-interpolation-filters color-profile color-rendering cx cy d dx dy diffuseconstant direction display divisor dur edgemode elevation end fill fill-opacity fill-rule filter flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight fx fy g1 g2 glyph-name glyphref gradientunits gradienttransform height href id image-rendering in in2 k k1 k2 k3 k4 kerning keypoints keysplines keytimes lang lengthadjust letter-spacing kernelmatrix kernelunitlength lighting-color local marker-end marker-mid marker-start markerheight markerunits markerwidth maskcontentunits maskunits max mask media method mode min name numoctaves offset operator opacity order orient orientation origin overflow paint-order path pathlength patterncontentunits patterntransform patternunits points preservealpha preserveaspectratio r rx ry radius refx refy repeatcount repeatdur restart result rotate scale seed shape-rendering specularconstant specularexponent spreadmethod stddeviation stitchtiles stop-color stop-opacity stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke stroke-width style surfacescale tabindex targetx targety transform text-anchor text-decoration text-rendering textlength type u1 u2 unicode values viewbox visibility vert-adv-y vert-origin-x vert-origin-y width word-spacing wrap writing-mode xchannelselector ychannelselector x x1 x2 xmlns y y1 y2 z zoomandpan".split(" "),
  87. Sc="accent accentunder align bevelled close columnsalign columnlines columnspan denomalign depth dir display displaystyle fence frame height href id largeop length linethickness lspace lquote mathbackground mathcolor mathsize mathvariant maxsize minsize movablelimits notation numalign open rowalign rowlines rowspacing rowspan rspace rquote scriptlevel scriptminsize scriptsizemultiplier selection separator separators stretchy subscriptshift supscriptshift symmetric voffset width xmlns".split(" "),
  88. Tc=["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"];function Y(a,b){for(var c=b.length;c--;)"string"===typeof b[c]&&(b[c]=b[c].toLowerCase()),a[b[c]]=!0;return a}function Uc(a){var b={},c=void 0;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b}
  89. var Vc=/\{\{[\s\S]*|[\s\S]*\}\}/gm,Wc=/<%[\s\S]*|[\s\S]*%>/gm,Xc=/^data-[\-\w.\u00B7-\uFFFF]/,Yc=/^aria-[\-\w]+$/,Zc=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,ed=/^(?:\w+script|data):/i,fd=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,gd="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};
  90. function hd(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}
  91. function id(){function a(a){var b,d,f=void 0,e,m,u;c("beforeSanitizeAttributes",a,null);if(m=a.attributes){var h={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q};for(u=m.length;u--;){b=m[u];d=b.name;b=b.value.trim();f=d.toLowerCase();h.attrName=f;h.attrValue=b;h.keepAttr=!0;c("uponSanitizeAttribute",a,h);b=h.attrValue;if("name"===f&&"IMG"===a.nodeName&&m.id)e=m.id,m=Array.prototype.slice.apply(m),k("id",a),k(d,a),m.indexOf(e)>u&&a.setAttribute("id",e.value);else if("INPUT"!==a.nodeName||
  92. "type"!==f||"file"!==b||!Q[f]&&la[f])"id"===d&&a.setAttribute(d,""),k(d,a);else continue;if(h.keepAttr&&(!U||"id"!==f&&"name"!==f||!(b in w||b in ad))){oa&&(b=b.replace(Vc," "),b=b.replace(Wc," "));if(!ga||!Xc.test(f))if(!aa||!Yc.test(f))if(!Q[f]||la[f])continue;else if(!(Qb[f]||ja.test(b.replace(fd,""))||("src"===f||"xlink:href"===f)&&0===b.indexOf("data:")&&$c[a.nodeName.toLowerCase()]||ua&&!ed.test(b.replace(fd,"")))&&b)continue;try{a.setAttribute(d,b),p.removed.pop()}catch(Ed){}}}c("afterSanitizeAttributes",
  93. a,null)}}function b(a){var b;c("beforeSanitizeElements",a,null);if(e(a))return h(a),!0;b=a.nodeName.toLowerCase();c("uponSanitizeElement",a,{tagName:b,allowedTags:S});if(!S[b]||ta[b]){if(V&&!ma[b]&&"function"===typeof a.insertAdjacentHTML)try{a.insertAdjacentHTML("AfterEnd",a.innerHTML)}catch(cd){}h(a);return!0}!na||a.firstElementChild||a.content&&a.content.firstElementChild||!/</g.test(a.textContent)||(p.removed.push({element:a.cloneNode()}),a.innerHTML=a.textContent.replace(/</g,"&lt;"));oa&&3===
  94. a.nodeType&&(b=a.textContent,b=b.replace(Vc," "),b=b.replace(Wc," "),a.textContent!==b&&(p.removed.push({element:a.cloneNode()}),a.textContent=b));c("afterSanitizeElements",a,null);return!1}function c(a,b,c){T[a]&&T[a].forEach(function(a){a.call(p,b,c,Pa)})}function d(a){return"object"===("undefined"===typeof y?"undefined":gd(y))?a instanceof y:a&&"object"===("undefined"===typeof a?"undefined":gd(a))&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName}function e(a){return a instanceof A||
  95. a instanceof G?!1:"string"===typeof a.nodeName&&"string"===typeof a.textContent&&"function"===typeof a.removeChild&&a.attributes instanceof F&&"function"===typeof a.removeAttribute&&"function"===typeof a.setAttribute?!1:!0}function f(a){return D.call(a.ownerDocument||a,a,q.SHOW_ELEMENT|q.SHOW_COMMENT|q.SHOW_TEXT,function(){return q.FILTER_ACCEPT},!1)}function g(a){var b=void 0,c;ha&&(a="<remove></remove>"+a);if(t){try{a=N(a)}catch(dd){}b=new K;b.responseType="document";b.open("GET","data:text/html;charset=utf-8,"+
  96. a,!1);b.send(null);b=b.response}if(v)try{b=(new H).parseFromString(a,"text/html")}catch(dd){}b&&b.documentElement||(b=R.createHTMLDocument(""),c=b.body,c.parentNode.removeChild(c.parentNode.firstElementChild),c.outerHTML=a);return C.call(b,ra?"html":"body")[0]}function k(a,b){try{p.removed.push({attribute:b.getAttributeNode(a),from:b})}catch(cd){p.removed.push({attribute:null,from:b})}b.removeAttribute(a)}function h(a){p.removed.push({element:a});try{a.parentNode.removeChild(a)}catch(za){a.outerHTML=
  97. ""}}function l(a){"object"!==("undefined"===typeof a?"undefined":gd(a))&&(a={});S="ALLOWED_TAGS"in a?Y({},a.ALLOWED_TAGS):X;Q="ALLOWED_ATTR"in a?Y({},a.ALLOWED_ATTR):ka;ta="FORBID_TAGS"in a?Y({},a.FORBID_TAGS):{};la="FORBID_ATTR"in a?Y({},a.FORBID_ATTR):{};ba="USE_PROFILES"in a?a.USE_PROFILES:!1;aa=!1!==a.ALLOW_ARIA_ATTR;ga=!1!==a.ALLOW_DATA_ATTR;ua=a.ALLOW_UNKNOWN_PROTOCOLS||!1;na=a.SAFE_FOR_JQUERY||!1;oa=a.SAFE_FOR_TEMPLATES||!1;ra=a.WHOLE_DOCUMENT||!1;ia=a.RETURN_DOM||!1;L=a.RETURN_DOM_FRAGMENT||
  98. !1;m=a.RETURN_DOM_IMPORT||!1;ha=a.FORCE_BODY||!1;U=!1!==a.SANITIZE_DOM;V=!1!==a.KEEP_CONTENT;ja=a.ALLOWED_URI_REGEXP||ja;oa&&(ga=!1);L&&(ia=!0);ba&&(S=Y({},[].concat(hd(Pc))),Q=[],!0===ba.html&&(Y(S,Lc),Y(Q,Qc)),!0===ba.svg&&(Y(S,Mc),Y(Q,Rc),Y(Q,Tc)),!0===ba.svgFilters&&(Y(S,Nc),Y(Q,Rc),Y(Q,Tc)),!0===ba.mathMl&&(Y(S,Oc),Y(Q,Sc),Y(Q,Tc)));a.ADD_TAGS&&(S===X&&(S=Uc(S)),Y(S,a.ADD_TAGS));a.ADD_ATTR&&(Q===ka&&(Q=Uc(Q)),Y(Q,a.ADD_ATTR));a.ADD_URI_SAFE_ATTR&&Y(Qb,a.ADD_URI_SAFE_ATTR);V&&(S["#text"]=!0);
  99. Object&&"freeze"in Object&&Object.freeze(a);Pa=a}function p(a){return id(a)}var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"undefined"===typeof window?null:window;p.version="1.0.4";p.removed=[];if(!n||!n.document||9!==n.document.nodeType)return p.isSupported=!1,p;var r=n.document,v=!1,t=!1,w=n.document,u=n.DocumentFragment,y=n.Node,q=n.NodeFilter,E=n.NamedNodeMap,F=void 0===E?n.NamedNodeMap||n.MozNamedAttrMap:E,A=n.Text,G=n.Comment,H=n.DOMParser,E=n.XMLHttpRequest,K=void 0===E?n.XMLHttpRequest:
  100. E,E=n.encodeURI,N=void 0===E?n.encodeURI:E;"function"===typeof n.HTMLTemplateElement&&(E=w.createElement("template"),E.content&&E.content.ownerDocument&&(w=E.content.ownerDocument));var O=w,R=O.implementation,D=O.createNodeIterator,C=O.getElementsByTagName,B=O.createDocumentFragment,sa=r.importNode,T={};p.isSupported=R&&"undefined"!==typeof R.createHTMLDocument&&9!==w.documentMode;var ja=Zc,S=null,X=Y({},[].concat(hd(Lc),hd(Mc),hd(Nc),hd(Oc),hd(Pc))),Q=null,ka=Y({},[].concat(hd(Qc),hd(Rc),hd(Sc),
  101. hd(Tc))),ta=null,la=null,aa=!0,ga=!0,ua=!1,na=!1,oa=!1,ra=!1,P=!1,ha=!1,ia=!1,L=!1,m=!1,U=!0,V=!0,ba={},ma=Y({},"audio head math script style template svg video".split(" ")),$c=Y({},["audio","video","img","source","image"]),Qb=Y({},"alt class for id label name pattern placeholder summary title value style xmlns".split(" ")),Pa=null,ad=w.createElement("form");p.isSupported&&function(){var a=g('<svg><g onload="this.parentNode.remove()"></g></svg>');a.querySelector("svg")||(t=!0);try{a=g('<svg><p><style><img src="</style><img src=x onerror=alert(1)//">'),
  102. a.querySelector("svg img")&&(v=!0)}catch(za){}}();var bd=function za(d){var e=void 0,m=f(d);for(c("beforeSanitizeShadowDOM",d,null);e=m.nextNode();)c("uponSanitizeShadowNode",e,null),b(e)||(e.content instanceof u&&za(e.content),a(e));c("afterSanitizeShadowDOM",d,null)};p.sanitize=function(c,e){var U=void 0,ma=void 0,k=void 0;c||(c="\x3c!--\x3e");if("string"!==typeof c&&!d(c)){if("function"!==typeof c.toString)throw new TypeError("toString is not a function");c=c.toString();if("string"!==typeof c)throw new TypeError("dirty is not a string, aborting");
  103. }if(!p.isSupported){if("object"===gd(n.toStaticHTML)||"function"===typeof n.toStaticHTML){if("string"===typeof c)return n.toStaticHTML(c);if(d(c))return n.toStaticHTML(c.outerHTML)}return c}P||l(e);p.removed=[];if(c instanceof y)e=g("\x3c!--\x3e"),U=e.ownerDocument.importNode(c,!0),1===U.nodeType&&"BODY"===U.nodeName?e=U:e.appendChild(U);else{if(!ia&&!ra&&-1===c.indexOf("<"))return c;e=g(c);if(!e)return ia?null:""}ha&&h(e.firstChild);for(var q=f(e);c=q.nextNode();)3===c.nodeType&&c===ma||b(c)||(c.content instanceof
  104. u&&bd(c.content),a(c),ma=c);if(ia){if(L)for(k=B.call(e.ownerDocument);e.firstChild;)k.appendChild(e.firstChild);else k=e;m&&(k=sa.call(r,k,!0));return k}return ra?e.outerHTML:e.innerHTML};p.setConfig=function(a){l(a);P=!0};p.clearConfig=function(){Pa=null;P=!1};p.addHook=function(a,b){"function"===typeof b&&(T[a]=T[a]||[],T[a].push(b))};p.removeHook=function(a){T[a]&&T[a].pop()};p.removeHooks=function(a){T[a]&&(T[a]=[])};p.removeAllHooks=function(){T={}};return p}id();var jd=function(){function a(a){var b=(""+a).match(v);return b?new h(l(b[1]),l(b[2]),l(b[3]),l(b[4]),l(b[5]),l(b[6]),l(b[7])):null}function b(a,b,f,g,n,p,k){a=new h(d(a,t),d(b,t),c(f),0<g?g.toString():null,d(n,w),null,c(k));p&&("string"===typeof p?a.setRawQuery(p.replace(/[^?&=0-9A-Za-z_\-~.%]/g,e)):a.setAllParameters(p));return a}function c(a){return"string"==typeof a?encodeURIComponent(a):null}function d(a,b){return"string"==typeof a?encodeURI(a).replace(b,e):null}function e(a){a=a.charCodeAt(0);
  105. return"%"+"0123456789ABCDEF".charAt(a>>4&15)+"0123456789ABCDEF".charAt(a&15)}function f(a){return a.replace(/(^|\/)\.(?:\/|$)/g,"$1").replace(/\/{2,}/g,"/")}function g(a){if(null===a)return null;a=f(a);for(var b=n,c;(c=a.replace(b,"$1"))!=a;a=c);return a}function k(a,b){var c=a.clone(),d=b.hasScheme();d?c.setRawScheme(b.getRawScheme()):d=b.hasCredentials();d?c.setRawCredentials(b.getRawCredentials()):d=b.hasDomain();d?c.setRawDomain(b.getRawDomain()):d=b.hasPort();var f=b.getRawPath(),e=g(f);if(d)c.setPort(b.getPort()),
  106. e=e&&e.replace(r,"");else if(d=!!f){if(47!==e.charCodeAt(0))var h=g(c.getRawPath()||"").replace(r,""),u=h.lastIndexOf("/")+1,e=g((u?h.substring(0,u):"")+g(f)).replace(r,"")}else e=e&&e.replace(r,""),e!==f&&c.setRawPath(e);d?c.setRawPath(e):d=b.hasQuery();d?c.setRawQuery(b.getRawQuery()):d=b.hasFragment();d&&c.setRawFragment(b.getRawFragment());return c}function h(a,b,c,d,e,f,h){this.J=a;this.G=b;this.H=c;this.L=d;this.C=e;this.B=f;this.I=h;this.j=null}function l(a){return"string"==typeof a&&0<a.length?
  107. a:null}var p=/(\/|^)(?:[^./][^/]*|\.{2,}(?:[^./][^/]*)|\.{3,}[^/]*)\/\.\.(?:\/|$)/,n=new RegExp(p),r=/^(?:\.\.\/)*(?:\.\.$)?/;h.prototype.toString=function(){var a=[];null!==this.J&&a.push(this.J,":");null!==this.H&&(a.push("//"),null!==this.G&&a.push(this.G,"@"),a.push(this.H),null!==this.L&&a.push(":",this.L.toString()));null!==this.C&&a.push(this.C);null!==this.B&&a.push("?",this.B);null!==this.I&&a.push("#",this.I);return a.join("")};h.prototype.clone=function(){return new h(this.J,this.G,this.H,
  108. this.L,this.C,this.B,this.I)};h.prototype.getScheme=function(){return this.J&&decodeURIComponent(this.J).toLowerCase()};h.prototype.getRawScheme=function(){return this.J};h.prototype.setScheme=function(a){this.J=d(a,t);return this};h.prototype.setRawScheme=function(a){this.J=a?a:null;return this};h.prototype.hasScheme=function(){return null!==this.J};h.prototype.getCredentials=function(){return this.G&&decodeURIComponent(this.G)};h.prototype.getRawCredentials=function(){return this.G};h.prototype.setCredentials=
  109. function(a){this.G=d(a,t);return this};h.prototype.setRawCredentials=function(a){this.G=a?a:null;return this};h.prototype.hasCredentials=function(){return null!==this.G};h.prototype.getDomain=function(){return this.H&&decodeURIComponent(this.H)};h.prototype.getRawDomain=function(){return this.H};h.prototype.setDomain=function(a){return this.setRawDomain(a&&encodeURIComponent(a))};h.prototype.setRawDomain=function(a){this.H=a?a:null;return this.setRawPath(this.C)};h.prototype.hasDomain=function(){return null!==
  110. this.H};h.prototype.getPort=function(){return this.L&&decodeURIComponent(this.L)};h.prototype.setPort=function(a){if(a){a=Number(a);if(a!==(a&65535))throw Error("Bad port number "+a);this.L=""+a}else this.L=null;return this};h.prototype.hasPort=function(){return null!==this.L};h.prototype.getPath=function(){return this.C&&decodeURIComponent(this.C)};h.prototype.getRawPath=function(){return this.C};h.prototype.setPath=function(a){return this.setRawPath(d(a,w))};h.prototype.setRawPath=function(a){a?
  111. (a=String(a),this.C=!this.H||/^\//.test(a)?a:"/"+a):this.C=null;return this};h.prototype.hasPath=function(){return null!==this.C};h.prototype.getQuery=function(){return this.B&&decodeURIComponent(this.B).replace(/\+/g," ")};h.prototype.getRawQuery=function(){return this.B};h.prototype.setQuery=function(a){this.j=null;this.B=c(a);return this};h.prototype.setRawQuery=function(a){this.j=null;this.B=a?a:null;return this};h.prototype.hasQuery=function(){return null!==this.B};h.prototype.setAllParameters=
  112. function(a){if("object"===typeof a&&!(a instanceof Array)&&(a instanceof Object||"[object Array]"!==Object.prototype.toString.call(a))){var b=[],c=-1,d;for(d in a){var e=a[d];"string"===typeof e&&(b[++c]=d,b[++c]=e)}a=b}this.j=null;for(var f=[],h="",g=0;g<a.length;)d=a[g++],e=a[g++],f.push(h,encodeURIComponent(d.toString())),h="&",e&&f.push("=",encodeURIComponent(e.toString()));this.B=f.join("");return this};h.prototype.P=function(){if(!this.j){var a=this.B;if(a){for(var b=a.split(/[&\?]/),a=[],c=
  113. -1,d=0;d<b.length;++d){var e=b[d].match(/^([^=]*)(?:=(.*))?$/);a[++c]=decodeURIComponent(e[1]).replace(/\+/g," ");a[++c]=decodeURIComponent(e[2]||"").replace(/\+/g," ")}this.j=a}else this.j=[]}};h.prototype.setParameterValues=function(a,b){"string"===typeof b&&(b=[b]);this.P();for(var c=0,d=this.j,e=[],f=0;f<d.length;f+=2)a===d[f]?c<b.length&&e.push(a,b[c++]):e.push(d[f],d[f+1]);for(;c<b.length;)e.push(a,b[c++]);this.setAllParameters(e);return this};h.prototype.removeParameter=function(a){return this.setParameterValues(a,
  114. [])};h.prototype.getAllParameters=function(){this.P();return this.j.slice(0,this.j.length)};h.prototype.getParameterValues=function(a){this.P();for(var b=[],c=0;c<this.j.length;c+=2)a===this.j[c]&&b.push(this.j[c+1]);return b};h.prototype.getParameterMap=function(){this.P();for(var a={},b=0;b<this.j.length;b+=2){var c=this.j[b++],d=this.j[b++];c in a?a[c].push(d):a[c]=[d]}return a};h.prototype.getParameterValue=function(a){this.P();for(var b=0;b<this.j.length;b+=2)if(a===this.j[b])return this.j[b+
  115. 1];return null};h.prototype.getFragment=function(){return this.I&&decodeURIComponent(this.I)};h.prototype.getRawFragment=function(){return this.I};h.prototype.setFragment=function(a){this.I=a?encodeURIComponent(a):null;return this};h.prototype.setRawFragment=function(a){this.I=a?a:null;return this};h.prototype.hasFragment=function(){return null!==this.I};var v=/^(?:([^:/?#]+):)?(?:\/\/(?:([^/?#]*)@)?([^/?#:@]*)(?::([0-9]+))?)?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/,t=/[#\/\?@]/g,w=/[\#\?]/g;h.parse=a;
  116. h.create=b;h.resolve=k;h.collapse_dots=g;h.utils={mimeTypeOf:function(b){var c=a(b);return/\.html$/.test(c.getPath())?"text/html":"application/javascript"},resolve:function(b,c){return b?k(a(b),a(c)).toString():""+c}};return h}(),Z={atype:{NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,HTML:12,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10,MEDIA_QUERY:13}};Z.atype=Z.atype;
  117. Z.ATTRIBS={"*::class":9,"*::dir":0,"*::draggable":0,"*::hidden":0,"*::id":4,"*::inert":0,"*::itemprop":0,"*::itemref":6,"*::itemscope":0,"*::lang":0,"*::onblur":2,"*::onchange":2,"*::onclick":2,"*::ondblclick":2,"*::onerror":2,"*::onfocus":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::onreset":2,"*::onscroll":2,"*::onselect":2,"*::onsubmit":2,"*::ontouchcancel":2,"*::ontouchend":2,"*::ontouchenter":2,
  118. "*::ontouchleave":2,"*::ontouchmove":2,"*::ontouchstart":2,"*::onunload":2,"*::spellcheck":0,"*::style":3,"*::tabindex":0,"*::title":0,"*::translate":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::shape":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::target":10,"audio::controls":0,"audio::loop":0,"audio::mediagroup":5,
  119. "audio::muted":0,"audio::preload":0,"audio::src":1,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,
  120. "command::checked":0,"command::command":5,"command::disabled":0,"command::icon":1,"command::label":0,"command::radiogroup":0,"command::type":0,"data::value":0,"del::cite":1,"del::datetime":0,"details::open":0,"dir::compact":0,"div::align":0,"dl::compact":0,"fieldset::disabled":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::novalidate":0,"form::onreset":2,"form::onsubmit":2,"form::target":10,
  121. "h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,
  122. "input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::inputmode":0,"input::ismap":0,"input::list":5,"input::max":0,"input::maxlength":0,"input::min":0,"input::multiple":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::pattern":0,"input::placeholder":0,"input::readonly":0,"input::required":0,"input::size":0,"input::src":1,"input::step":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,
  123. "label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"menu::label":0,"menu::type":0,"meter::high":0,"meter::low":0,"meter::max":0,"meter::min":0,"meter::optimum":0,"meter::value":0,"ol::compact":0,"ol::reversed":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"output::for":6,"output::name":8,"p::align":0,
  124. "pre::width":0,"progress::max":0,"progress::min":0,"progress::value":0,"q::cite":1,"select::autocomplete":0,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::required":0,"select::size":0,"source::src":1,"source::type":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,
  125. "tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"template::type":0,"textarea::accesskey":0,"textarea::autocomplete":0,"textarea::cols":0,"textarea::disabled":0,"textarea::inputmode":0,"textarea::name":8,"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::placeholder":0,
  126. "textarea::readonly":0,"textarea::required":0,"textarea::rows":0,"textarea::wrap":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,
  127. "track::default":0,"track::kind":0,"track::label":0,"track::srclang":0,"ul::compact":0,"ul::type":0,"video::controls":0,"video::height":0,"video::loop":0,"video::mediagroup":5,"video::muted":0,"video::poster":1,"video::preload":0,"video::src":1,"video::width":0};Z.ATTRIBS=Z.ATTRIBS;Z.eflags={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128,VIRTUALIZED:256};Z.eflags=Z.eflags;
  128. Z.ELEMENTS={a:0,abbr:0,acronym:0,address:0,applet:272,area:2,article:0,aside:0,audio:0,b:0,base:274,basefont:274,bdi:0,bdo:0,big:0,blockquote:0,body:305,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,command:2,data:0,datalist:0,dd:1,del:0,details:0,dfn:0,dialog:272,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,figcaption:0,figure:0,font:0,footer:0,form:0,frame:274,frameset:272,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:305,header:0,hgroup:0,hr:2,html:305,i:0,iframe:4,img:2,input:2,ins:0,
  129. isindex:274,kbd:0,keygen:274,label:0,legend:0,li:1,link:274,map:0,mark:0,menu:0,meta:274,meter:0,nav:0,nobr:0,noembed:276,noframes:276,noscript:276,object:272,ol:0,optgroup:0,option:1,output:0,p:1,param:274,pre:0,progress:0,q:0,s:0,samp:0,script:84,section:0,select:0,small:0,source:2,span:0,strike:0,strong:0,style:148,sub:0,summary:0,sup:0,table:0,tbody:1,td:1,template:4,textarea:8,tfoot:1,th:1,thead:1,time:0,title:280,tr:1,track:2,tt:0,u:0,ul:0,"var":0,video:0,wbr:2};Z.ELEMENTS=Z.ELEMENTS;
  130. Z.ELEMENT_DOM_INTERFACES={a:"HTMLAnchorElement",abbr:"HTMLElement",acronym:"HTMLElement",address:"HTMLElement",applet:"HTMLAppletElement",area:"HTMLAreaElement",article:"HTMLElement",aside:"HTMLElement",audio:"HTMLAudioElement",b:"HTMLElement",base:"HTMLBaseElement",basefont:"HTMLBaseFontElement",bdi:"HTMLElement",bdo:"HTMLElement",big:"HTMLElement",blockquote:"HTMLQuoteElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",
  131. center:"HTMLElement",cite:"HTMLElement",code:"HTMLElement",col:"HTMLTableColElement",colgroup:"HTMLTableColElement",command:"HTMLCommandElement",data:"HTMLElement",datalist:"HTMLDataListElement",dd:"HTMLElement",del:"HTMLModElement",details:"HTMLDetailsElement",dfn:"HTMLElement",dialog:"HTMLDialogElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",dt:"HTMLElement",em:"HTMLElement",fieldset:"HTMLFieldSetElement",figcaption:"HTMLElement",figure:"HTMLElement",font:"HTMLFontElement",
  132. footer:"HTMLElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",h2:"HTMLHeadingElement",h3:"HTMLHeadingElement",h4:"HTMLHeadingElement",h5:"HTMLHeadingElement",h6:"HTMLHeadingElement",head:"HTMLHeadElement",header:"HTMLElement",hgroup:"HTMLElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",i:"HTMLElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",ins:"HTMLModElement",isindex:"HTMLUnknownElement",kbd:"HTMLElement",
  133. keygen:"HTMLKeygenElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",map:"HTMLMapElement",mark:"HTMLElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",nav:"HTMLElement",nobr:"HTMLElement",noembed:"HTMLElement",noframes:"HTMLElement",noscript:"HTMLElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",
  134. pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",s:"HTMLElement",samp:"HTMLElement",script:"HTMLScriptElement",section:"HTMLElement",select:"HTMLSelectElement",small:"HTMLElement",source:"HTMLSourceElement",span:"HTMLSpanElement",strike:"HTMLElement",strong:"HTMLElement",style:"HTMLStyleElement",sub:"HTMLElement",summary:"HTMLElement",sup:"HTMLElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",td:"HTMLTableDataCellElement",template:"HTMLTemplateElement",textarea:"HTMLTextAreaElement",
  135. tfoot:"HTMLTableSectionElement",th:"HTMLTableHeaderCellElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",tt:"HTMLElement",u:"HTMLElement",ul:"HTMLUListElement","var":"HTMLElement",video:"HTMLVideoElement",wbr:"HTMLElement"};Z.ELEMENT_DOM_INTERFACES=Z.ELEMENT_DOM_INTERFACES;Z.ueffects={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2};Z.ueffects=Z.ueffects;
  136. Z.URIEFFECTS={"a::href":2,"area::href":2,"audio::src":1,"blockquote::cite":0,"command::icon":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0,"video::poster":1,"video::src":1};Z.URIEFFECTS=Z.URIEFFECTS;Z.ltypes={UNSANDBOXED:2,SANDBOXED:1,DATA:0};Z.ltypes=Z.ltypes;
  137. Z.LOADERTYPES={"a::href":2,"area::href":2,"audio::src":2,"blockquote::cite":2,"command::icon":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2,"video::poster":1,"video::src":2};Z.LOADERTYPES=Z.LOADERTYPES;
  138. (function(a){function b(a){if(B.hasOwnProperty(a))return B[a];var b=a.match(sa);return b?String.fromCharCode(parseInt(b[1],10)):(b=a.match(T))?String.fromCharCode(parseInt(b[1],16)):S&&ja.test(a)?(S.innerHTML="&"+a+";",b=S.textContent,B[a]=b):"&"+a+";"}function c(a,c){return b(c)}function d(a){return a.replace(X,"")}function e(a){return a.replace(Q,c)}function f(a){return(""+a).replace(ta,"&amp;").replace(aa,"&lt;").replace(ga,"&gt;").replace(ua,"&#34;")}function g(a){return a.replace(la,"&amp;$1").replace(aa,
  139. "&lt;").replace(ga,"&gt;")}function k(a){var b={cdata:a.cdata||a.cdata,comment:a.comment||a.comment,endDoc:a.endDoc||a.endDoc,endTag:a.endTag||a.endTag,pcdata:a.pcdata||a.pcdata,rcdata:a.rcdata||a.rcdata,startDoc:a.startDoc||a.startDoc,startTag:a.startTag||a.startTag};return function(a,c){var d=b,e=p(a);l(d,e,0,{noMoreGT:!1,noMoreEndComments:!1},c)}}function h(a,b,c,d,e){return function(){l(a,b,c,d,e)}}function l(b,c,d,e,f){try{b.startDoc&&0==d&&b.startDoc(f);for(var m,g,p,k=d,l=c.length;k<l;){var U=
  140. c[k++],V=c[k];switch(U){case "&":ka.test(V)?(b.pcdata&&b.pcdata("&"+V,f,P,h(b,c,k,e,f)),k++):b.pcdata&&b.pcdata("&amp;",f,P,h(b,c,k,e,f));break;case "</":(m=/^([-\w:]+)[^\'\"]*/.exec(V))?m[0].length===V.length&&">"===c[k+1]?(k+=2,p=m[1].toLowerCase(),b.endTag&&b.endTag(p,f,P,h(b,c,k,e,f))):k=n(c,k,b,f,P,e):b.pcdata&&b.pcdata("&lt;/",f,P,h(b,c,k,e,f));break;case "<":if(m=/^([-\w:]+)\s*\/?/.exec(V))if(m[0].length===V.length&&">"===c[k+1]){k+=2;p=m[1].toLowerCase();b.startTag&&b.startTag(p,[],f,P,h(b,
  141. c,k,e,f));var ma=a.ELEMENTS[p];ma&ra&&(k=v(c,{name:p,next:k,eflags:ma},b,f,P,e))}else k=r(c,k,b,f,P,e);else b.pcdata&&b.pcdata("&lt;",f,P,h(b,c,k,e,f));break;case "\x3c!--":if(!e.noMoreEndComments){for(g=k+1;g<l&&(">"!==c[g]||!/--$/.test(c[g-1]));g++);if(g<l){if(b.comment){var ba=c.slice(k,g).join("");b.comment(ba.substr(0,ba.length-2),f,P,h(b,c,g+1,e,f))}k=g+1}else e.noMoreEndComments=!0}e.noMoreEndComments&&b.pcdata&&b.pcdata("&lt;!--",f,P,h(b,c,k,e,f));break;case "<!":if(/^\w/.test(V)){if(!e.noMoreGT){for(g=
  142. k+1;g<l&&">"!==c[g];g++);g<l?k=g+1:e.noMoreGT=!0}e.noMoreGT&&b.pcdata&&b.pcdata("&lt;!",f,P,h(b,c,k,e,f))}else b.pcdata&&b.pcdata("&lt;!",f,P,h(b,c,k,e,f));break;case "<?":if(!e.noMoreGT){for(g=k+1;g<l&&">"!==c[g];g++);g<l?k=g+1:e.noMoreGT=!0}e.noMoreGT&&b.pcdata&&b.pcdata("&lt;?",f,P,h(b,c,k,e,f));break;case ">":b.pcdata&&b.pcdata("&gt;",f,P,h(b,c,k,e,f));break;case "":break;default:b.pcdata&&b.pcdata(U,f,P,h(b,c,k,e,f))}}b.endDoc&&b.endDoc(f)}catch(Sb){if(Sb!==P)throw Sb;}}function p(a){var b=/(<\/|<\!--|<[!?]|[&<>])/g;
  143. a+="";if(oa)return a.split(b);for(var c=[],d=0,e;null!==(e=b.exec(a));)c.push(a.substring(d,e.index)),c.push(e[0]),d=e.index+e[0].length;c.push(a.substring(d));return c}function n(a,b,c,d,e,f){var g=t(a,b);if(!g)return a.length;c.endTag&&c.endTag(g.name,d,e,h(c,a,b,f,d));return g.next}function r(a,b,c,d,e,f){b=t(a,b);if(!b)return a.length;c.startTag&&c.startTag(b.name,b.attrs,d,e,h(c,a,b.next,f,d));return b.eflags&ra?v(a,b,c,d,e,f):b.next}function v(b,c,d,e,f,k){var m=b.length;ha.hasOwnProperty(c.name)||
  144. (ha[c.name]=new RegExp("^"+c.name+"(?:[\\s\\/]|$)","i"));for(var p=ha[c.name],n=c.next,l=c.next+1;l<m&&("</"!==b[l-1]||!p.test(b[l]));l++);l<m&&--l;var r=b.slice(n,l).join("");if(c.eflags&a.eflags.CDATA)d.cdata&&d.cdata(r,e,f,h(d,b,l,k,e));else if(c.eflags&a.eflags.RCDATA)d.rcdata&&d.rcdata(g(r),e,f,h(d,b,l,k,e));else throw Error("bug");return l}function t(b,c){var d=/^([-\w:]+)/.exec(b[c]),e={};e.name=d[1].toLowerCase();e.eflags=a.ELEMENTS[e.name];var f=b[c].substr(d[0].length);c+=1;for(var g=b.length;c<
  145. g&&">"!==b[c];c++)f+=b[c];if(!(g<=c)){for(var h=[];""!==f;)if(d=na.exec(f))if(d[4]&&!d[5]||d[6]&&!d[7]){for(var m=d[4]||d[6],k=!1,p=[f,b[c++]];c<g;c++){if(k){if(">"===b[c])break}else 0<=b[c].indexOf(m)&&(k=!0);p.push(b[c])}if(g<=c)break;f=p.join("")}else{var l=d[1].toLowerCase(),n=d[2]?w(d[3]):"";h.push(l,n);f=f.substr(d[0].length)}else f=f.replace(/^[\s\S][^a-z\s]*/,"");e.attrs=h;e.next=c+1;return e}}function w(a){var b=a.charCodeAt(0);if(34===b||39===b)a=a.substr(1,a.length-2);return e(d(a))}function u(b){function c(a,
  146. b){e||b.push(a)}var d,e;return k({startDoc:function(){d=[];e=!1},startTag:function(c,g,h){if(!e&&a.ELEMENTS.hasOwnProperty(c)){var m=a.ELEMENTS[c];if(!(m&a.eflags.FOLDABLE)){var k=b(c,g);if(k){if("object"!==typeof k)throw Error("tagPolicy did not return object (old API?)");if("attribs"in k)g=k.attribs;else throw Error("tagPolicy gave no attribs");var p,l;"tagName"in k?(l=k.tagName,p=a.ELEMENTS[l]):(l=c,p=m);if(m&a.eflags.OPTIONAL_ENDTAG){var n=d[d.length-1];!n||n.orig!==c||n.rep===l&&c===l||h.push("</",
  147. n.rep,">")}m&a.eflags.EMPTY||d.push({orig:c,rep:l});h.push("<",l);for(var r=0,v=g.length;r<v;r+=2){var q=g[r],t=g[r+1];null!==t&&void 0!==t&&h.push(" ",q,'="',f(t),'"')}h.push(">");m&a.eflags.EMPTY&&!(p&a.eflags.EMPTY)&&h.push("</",l,">")}else e=!(m&a.eflags.EMPTY)}}},endTag:function(b,c){if(e)e=!1;else if(a.ELEMENTS.hasOwnProperty(b)){var f=a.ELEMENTS[b];if(!(f&(a.eflags.EMPTY|a.eflags.FOLDABLE))){if(f&a.eflags.OPTIONAL_ENDTAG)for(f=d.length;0<=--f;){var g=d[f].orig;if(g===b)break;if(!(a.ELEMENTS[g]&
  148. a.eflags.OPTIONAL_ENDTAG))return}else for(f=d.length;0<=--f&&d[f].orig!==b;);if(!(0>f)){for(var h=d.length;--h>f;){var m=d[h].rep;a.ELEMENTS[m]&a.eflags.OPTIONAL_ENDTAG||c.push("</",m,">")}f<d.length&&(b=d[f].rep);d.length=f;c.push("</",b,">")}}}},pcdata:c,rcdata:c,cdata:c,endDoc:function(a){for(;d.length;d.length--)a.push("</",d[d.length-1].rep,">")}})}function y(a,b,c,d,e){if(!e)return null;try{var f=jd.parse(""+a);if(f&&(!f.hasScheme()||ia.test(f.getScheme()))){var g=e(f,b,c,d);return g?g.toString():
  149. null}}catch(Pa){}return null}function q(a,b,c,d,f){c||a(b+" removed",{change:"removed",tagName:b});if(d!==f){var e="changed";d&&!f?e="removed":!d&&f&&(e="added");a(b+"."+c+" "+e,{change:e,tagName:b,attribName:c,oldValue:d,newValue:f})}}function E(a,b,c){var d;d=b+"::"+c;if(a.hasOwnProperty(d))return a[d];d="*::"+c;if(a.hasOwnProperty(d))return a[d]}function F(b,c){return E(a.ATTRIBS,b,c)}function A(b,c){return E(a.LOADERTYPES,b,c)}function G(b,c){return E(a.URIEFFECTS,b,c)}function H(b,c,d,f,e){for(var g=
  150. 0;g<c.length;g+=2){var h=c[g],k=c[g+1],l=k,p=null,m;if((m=b+"::"+h,a.ATTRIBS.hasOwnProperty(m))||(m="*::"+h,a.ATTRIBS.hasOwnProperty(m)))p=a.ATTRIBS[m];if(null!==p)switch(p){case a.atype.NONE:break;case a.atype.SCRIPT:k=null;e&&q(e,b,h,l,k);break;case a.atype.STYLE:if("undefined"===typeof R){k=null;e&&q(e,b,h,l,k);break}var n=[];R(k,{declaration:function(b,c){var e=b.toLowerCase();D(e,c,d?function(b){return y(b,a.ueffects.SAME_DOCUMENT,a.ltypes.SANDBOXED,{TYPE:"CSS",CSS_PROP:e},d)}:null);c.length&&
  151. n.push(e+": "+c.join(" "))}});k=0<n.length?n.join(" ; "):null;e&&q(e,b,h,l,k);break;case a.atype.ID:case a.atype.IDREF:case a.atype.IDREFS:case a.atype.GLOBAL_NAME:case a.atype.LOCAL_NAME:case a.atype.CLASSES:k=f?f(k):k;e&&q(e,b,h,l,k);break;case a.atype.URI:k=y(k,G(b,h),A(b,h),{TYPE:"MARKUP",XML_ATTR:h,XML_TAG:b},d);e&&q(e,b,h,l,k);break;case a.atype.URI_FRAGMENT:k&&"#"===k.charAt(0)?(k=k.substring(1),k=f?f(k):k,null!==k&&void 0!==k&&(k="#"+k)):k=null;e&&q(e,b,h,l,k);break;default:k=null,e&&q(e,
  152. b,h,l,k)}else k=null,e&&q(e,b,h,l,k);c[g+1]=k}return c}function K(b,c,d){return function(e,f){if(a.ELEMENTS[e]&a.eflags.UNSAFE)d&&q(d,e,void 0,void 0,void 0);else return{attribs:H(e,f,b,c,d)}}}function N(a,b){var c=[];u(b)(a,c);return c.join("")}function O(a,b,c,d){b=K(b,c,d);return N(a,b)}var R,D,C;"undefined"!==typeof window&&(R=window.parseCssDeclarations,D=window.sanitizeCssProperty,C=window.cssSchema);var B={lt:"<",LT:"<",gt:">",GT:">",amp:"&",AMP:"&",quot:'"',apos:"'",nbsp:"\u00a0"},sa=/^#(\d+)$/,
  153. T=/^#x([0-9A-Fa-f]+)$/,ja=/^[A-Za-z][A-Za-z0-9]+$/,S="undefined"!==typeof window&&window.document?window.document.createElement("textarea"):null,X=/\0/g,Q=/&(#[0-9]+|#[xX][0-9A-Fa-f]+|\w+);/g,ka=/^(#[0-9]+|#[xX][0-9A-Fa-f]+|\w+);/,ta=/&/g,la=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,aa=/[<]/g,ga=/>/g,ua=/\"/g,na=/^\s*(\[[-.:\w]+\]|[-.:\w]+)(?:\s*(=)\s*((")[^"]*("|$)|(')[^']*('|$)|(?=[a-z][-\w]*\s*=)|[^"'\s]*))?/i,oa=3==="a,b".split(/(,)/).length,ra=a.eflags.CDATA|a.eflags.RCDATA,P={},ha={},
  154. ia=/^(?:https?|geo|mailto|sms|tel)$/i,L={};L.escapeAttrib=L.escapeAttrib=f;L.makeHtmlSanitizer=L.makeHtmlSanitizer=u;L.makeSaxParser=L.makeSaxParser=k;L.makeTagPolicy=L.makeTagPolicy=K;L.normalizeRCData=L.normalizeRCData=g;L.sanitize=L.sanitize=O;L.sanitizeAttribs=L.sanitizeAttribs=H;L.sanitizeWithPolicy=L.sanitizeWithPolicy=N;L.unescapeEntities=L.unescapeEntities=e;return L})(Z);Ha({applet:!0,audio:!0,base:!0,embed:!0,frame:!0,frameset:!0,iframe:!0,img:!0,link:!0,meta:!0,object:!0,script:!0,style:!0,video:!0});Ha({br:!0,col:!0,hr:!0,img:!0,input:!0,source:!0,track:!0,wbr:!0,area:!0,base:!0,command:!0,embed:!0,keygen:!0,link:!0,meta:!0,param:!0});Ha({a:["rel","target"],div:["template"],form:["action-xhr","custom-validation-reporting","target"],template:["type"]});Ha({input:{type:/(?:image|button)/i}});var kd="form formaction formmethod formtarget formnovalidate formenctype".split(" ");
  155. Ha({input:kd,textarea:kd,select:kd});function ld(a,b,c){var d=self.location;ab(c);var e=Ya(d),f=J(Za(d));if("href"==b&&!I(c,"#"))return $a(c,f);if("src"==b)return"amp-img"==a?md(c,f,e):$a(c,f);if("srcset"==b){var g;try{g=lc(c)}catch(k){return z().error("sanitizer","Failed to parse srcset: ",k),c}return g.stringify(function(a){return md(a,f,e)})}return c}
  156. function md(a,b,c){a=J($a(a,b));return"data:"==a.protocol||Ya(a)||!c?a.href:La+"/i/"+("https:"==a.protocol?"s/":"")+encodeURIComponent(a.host)+a.pathname+(a.search||"")+(a.hash||"")};var nd=/^(i?-)?amp(html)?-/,od=Ga({"AMP-CAROUSEL":["slide"],"AMP-LIST":["state"],"AMP-SELECTOR":["selected"]});
  157. function pd(a,b){var c=this;this.ampdoc=a;this.o=a.win;this.da=b||a.win;this.$=[];this.za=bc(this.o,function(){c.$.length=0});this.M=[];this.va=this.Aa.bind(this);this.N=Ga();this.la=M(a,"history");this.oa=[];this.ea=1E3;this.qa=M(a,"resources");this.O=Ga();this.Fa=jb(this.o,"timer");this.Ga=new tc;this.F=M(this.ampdoc,"viewer");this.F.onMessageRespond("premutate",this.Ba.bind(this));var d=b?rb(b.document).then(function(){return b.document.body}):a.whenBodyAvailable();this.W=this.F.whenFirstVisible().then(function(){return d}).then(function(d){var e=
  158. b?b.document.head:a.getHeadNode();return c.ba(d,e&&sb(e))});this.Y=null;this.ra=new ac;AMP.printState=this.Ca.bind(this)}x=pd.prototype;x.adoptEmbedWindow=function(a){eb(a,new pd(this.ampdoc,a))};x.signals=function(){return this.ra};x.setState=function(a,b,c){var d=this;try{Ja(this.O,a)}catch(e){z().error("amp-bind","Failed to merge result from AMP.setState().",e)}return b?Promise.resolve():this.Y=this.W.then(function(){return qd(d)}).then(function(a){return rd(d,a,c)})};
  159. x.invoke=function(a){var b=a,c=b.args,d=b.event,e=b.method,f=b.sequenceId,g=b.tagOrTarget;if(this.$.includes(f))return z().error("amp-bind","One state action allowed per event."),Promise.resolve();this.$.push(f);this.za();if(b=c.__AMP_OBJECT_STRING__)switch(this.ra.signal("FIRST_MUTATE"),c={},d&&d.detail&&(c.event=d.detail),e){case "setState":return this.setStateWithExpression(b,c);case "pushState":return this.pushStateWithExpression(b,c);default:return Promise.reject(Ea().createError("Unrecognized method: "+
  160. ('"'+g+"."+e+'"')))}else z().error("AMP-BIND","Please use the object-literal syntax, e.g. \"AMP.setState({foo: 'bar'})\" instead of \"AMP.setState(foo='bar')\".");return Promise.resolve()};x.setStateWithExpression=function(a,b){var c=this;return this.Y=sd(this,a,b).then(function(a){return c.setState(a)})};
  161. x.pushStateWithExpression=function(a,b){var c=this;return sd(this,a,b).then(function(a){function b(){return c.setState(d)}var d=Ga();Object.keys(a).forEach(function(a){var b;a:{var e=c.O[a];if(void 0!==e)try{b=JSON.parse(JSON.stringify(e));break a}catch(l){Ea().error("amp-bind","Failed to copy JSON ("+e+") with error: "+l)}b=null}d[a]=b});c.la.push(b);return c.setState(a)})};
  162. x.scanAndApply=function(a,b,c){c=void 0===c?2E3:c;var d=this,e=td(this,b).then(function(){return ud(d,a)}).then(function(b){if(0<b)return qd(d).then(function(b){return vd(d,b,a)})});return this.Fa.timeoutPromise(c,e,"Timed out waiting for amp-bind to process rendered template.")};x.getStateValue=function(a){a=Ab(this.O,a);return ya(a)||Array.isArray(a)?JSON.stringify(a):String(a)};
  163. x.ba=function(a,b){var c=this,d=[a];b&&d.push(b);d=Promise.all([wd(this),ud(this,d)]).then(function(){a.addEventListener("amp:dom-update",c.va)});va().development&&(d=d.then(function(){return qd(c).then(function(a){return xd(c,a)})}));return d};x.numberOfBindings=function(){return this.M.reduce(function(a,b){return a+b.boundProperties.length},0)};x.Ma=function(a){this.ea=a};x.Ka=function(){return this.la};
  164. x.Ba=function(a){var b=this,c=[];return this.W.then(function(){Object.keys(a.state).forEach(function(d){b.oa.includes(d)||(delete a.state[d],c.push(d))});0<c.length&&z().warn("amp-bind","Some state keys could not be premutated because they are missing the overridable attribute: "+c.join(", "));return b.setState(a.state)})};x.makeStateKeyOverridable=function(a){this.oa.push(a)};
  165. function wd(a){var b=a.ampdoc.getBody().querySelectorAll("AMP-BIND-MACRO"),c=[];tb(b,function(a){var b=(a.getAttribute("arguments")||"").split(",").map(function(a){return a.trim()});c.push({id:a.getAttribute("id"),argumentNames:b,expressionString:a.getAttribute("expression")})});return 0==c.length?Promise.resolve(0):yd(a,"bind.addMacros",[c]).then(function(a){a.forEach(function(a,c){zd(a,"amp-bind: Parsing amp-bind-macro failed.",b[c])});return c.length})}
  166. function ud(a,b){var c=b.map(function(b){var c=a.ea-a.numberOfBindings();return Ad(a,b,c).then(function(b){var c=b.boundElements,d=b.bindings,e=b.expressionToElements,f=b.limitExceeded;a.M=a.M.concat(c);Object.assign(a.N,e);f&&Ea().expectedError("amp-bind","Maximum number of bindings reached "+("("+a.ea+"). Additional elements with ")+"bindings will be ignored.");return d})});return Promise.all(c).then(function(b){var c=Array.prototype.concat.apply([],b);return 0==c.length?c.length:yd(a,"bind.addBindings",
  167. [c]).then(function(b){Object.keys(b).forEach(function(c){var d=a.N[c];0<d.length&&zd(b[c],'amp-bind: Expression compile error in "'+c+'".',d[0])});return c.length})})}
  168. function td(a,b){va().development&&a.numberOfBindings();cc(a.M,function(a){for(var c=0;c<b.length;c++)if(b[c].contains(a.element))return!1;return!0});va().development&&a.numberOfBindings();var c=[],d;for(d in a.N){var e=a.N[d];cc(e,function(a){for(var c=0;c<b.length;c++)if(b[c].contains(a))return!1;return!0});0==e.length&&(c.push(d),delete a.N[d])}return 0<c.length?yd(a,"bind.removeBindingsWithExpressionStrings",[c]):Promise.resolve()}
  169. function Ad(a,b,c){function d(){var b=k.currentNode;if(!b)return!0;var d=b.tagName,n=Bd(a,b);f.length+n.length>c&&(n=n.slice(0,c-f.length),h=!0);0<n.length&&e.push({element:b,boundProperties:n});n.forEach(function(a){var c=a,e=c.expressionString;f.push({tagName:d,property:c.property,expressionString:e});g[e]||(g[e]=[]);g[e].push(b)});return!k.nextNode()||h}var e=[],f=[],g=Ga(),k=b.ownerDocument.createTreeWalker(b,NodeFilter.SHOW_ELEMENT,null,!1),h=!1;return new Promise(function(b){function c(k){var l=
  170. !1;if(k&&!k.didTimeout)for(;1<k.timeRemaining()&&!l;)l=d();else{var p=250;for(k=0;k<p&&!l;k++)l=d()}l?b({boundElements:e,bindings:f,expressionToElements:g,limitExceeded:h}):yc(a.ampdoc,c)}yc(a.ampdoc,c)})}
  171. function Bd(a,b){for(var c=[],d=b.attributes,e=0,f=d.length;e<f;e++){var g;a:{var k=void 0,h=a,l=d[e];g=b;var p=g.tagName,n=l.name;if(2<n.length&&"["===n[0]&&"]"===n[n.length-1])k=n.substr(1,n.length-2);else if(I(n,"data-amp-bind-")&&(k=n.substr(14),g.hasAttribute("["+k+"]"))){g=null;break a}if(k){if(h.Ga.canBind(p,k)){g={property:k,expressionString:l.value};break a}k=z().createError("amp-bind: Binding to ["+k+"] on <"+p+"> is not allowed.");Vb(k,g)}g=null}g&&c.push(g)}return c}
  172. function sd(a,b,c){return a.W.then(function(){Object.assign(c,a.O);return yd(a,"bind.evaluateExpression",[b,c])}).then(function(a){var b=a.result;if(a=a.error)throw zd(a,"amp-bind: Expression eval failed.");return b})}
  173. function qd(a){var b=yd(a,"bind.evaluateBindings",[a.O]);return b.then(function(b){var c=b.results,e=b.errors;Object.keys(e).forEach(function(b){var c=a.N[b];if(0<c.length){var d=e[b],f=z().createError('amp-bind: Expression evaluation error in "'+b+'". '+d.message);f.stack=d.stack;Vb(f,c[0])}});return c})}
  174. function xd(a,b){a.M.forEach(function(a){var c=a.element;a.boundProperties.forEach(function(a){var d=b[a.expressionString];if(void 0!==d){var e=a.property;a=a.expressionString;var k=c.tagName,h=od[k];if(!h||!h.includes(e)){switch(e){case "text":h=c.textContent;d=String(d);h=h.trim()===d.trim();break;case "class":for(var h=[],l=0;l<c.classList.length;l++){var p=c.classList[l];nd.test(p)||h.push(p)}l=[];Array.isArray(d)?l=d:"string"===typeof d?(p=d.trim(),0<p.length&&(l=p.split(" "))):(p=z().createError('amp-bind: "'+
  175. d+'" is not a valid result for [class].'),Vb(p,c));a:if(p=l,h.length!==p.length)h=!1;else{for(var l=(Array.isArray(h)?h:xa(h)).sort(),p=(Array.isArray(p)?p:xa(p)).sort(),n=0;n<h.length;n++)if(l[n]!==p[n]){h=!1;break a}h=!0}break;default:h=c.getAttribute(e),h=!0===d?""===h:!1===d?null===h:h===d}h||z().warn("amp-bind","Default value for <"+k+" ["+e+']="'+a+'"> '+("does not match first result ("+d+"). We recommend ")+"writing expressions with matching default values, but this can be safely ignored if intentional.")}}})})}
  176. function Cd(a,b){var c=[];a.forEach(function(a){var d=a.previousResult,f=b[a.expressionString];void 0===f||Cb(f,d,5)||(a.previousResult=f,c.push({boundProperty:a,newValue:f}))});return c}function rd(a,b,c){var d=a.M.map(function(d){return c&&"AMP-STATE"==d.element.tagName?Promise.resolve():Dd(a,b,d)});return Promise.all(d)}function vd(a,b,c){var d=[];a.M.forEach(function(e){c.forEach(function(c){c.contains(e.element)&&d.push(Dd(a,b,e))})});return Promise.all(d)}
  177. function Dd(a,b,c){var d=c.element,e=Cd(c.boundProperties,b);return 0===e.length?Promise.resolve():a.qa.mutateElement(d,function(){var b={},c,k;e.forEach(function(e){var f=e,h=f.boundProperty,f=f.newValue,g;a:{g=h.property;var l=d.tagName;switch(g){case "text":d.textContent=String(f);"TITLE"===l&&d.parentNode===a.da.document.head&&(a.da.document.title=String(f));"TEXTAREA"==l&&(d.value=String(f));break;case "class":g=[];for(var t=0;t<d.classList.length;t++)l=d.classList[t],nd.test(l)&&g.push(l);Array.isArray(f)||
  178. "string"===typeof f?d.setAttribute("class",g.concat(f).join(" ")):null===f?d.setAttribute("class",g.join(" ")):(g=z().createError('amp-bind: "'+f+'" is not a valid result for [class].'),Vb(g,d));break;default:var l="INPUT"==l&&g in d,w=d.getAttribute(g),u=!1;if("boolean"===typeof f)l&&d[g]!==f&&(d[g]=f,u=!0),f&&""!==w?(d.setAttribute(g,""),u=!0):f||null===w||(d.removeAttribute(g),u=!0);else if(f!==w){w=String(f);try{var y=d.tagName.toLowerCase(),q=g.toLowerCase(),E=y.toLowerCase(),F=q.toLowerCase(),
  179. A="src"==F||"href"==F||"srcset"==F?ld(E,F,w):w;if(Ya(self.location)&&"a"===y&&"href"===q){var G=d.getAttribute(q),H="#"===A[0],K=G&&"#"===G[0];H&&!K?(d.__AMP_ORIGINAL_TARGET_VALUE_||(d.__AMP_ORIGINAL_TARGET_VALUE_=d.getAttribute("target")),d.removeAttribute("target")):K&&!H&&d.setAttribute("target",d.__AMP_ORIGINAL_TARGET_VALUE_||"_top")}d.setAttribute(q,A);t=A}catch(O){y=z().createError('amp-bind: "'+w+'" is not a '+("valid result for ["+g+"]"),O),Vb(y,d)}t&&(l&&(d[g]=t),u=!0)}if(u){g={name:g,value:f};
  180. break a}}g=null}var N=g;N&&(b[N.name]=N.value,h=h.property,"width"==h?c="number"===typeof f&&isFinite(f)?Number(f):c:"height"==h&&(k="number"===typeof f&&isFinite(f)?Number(f):k))});void 0===c&&void 0===k||a.qa.changeSize(d,k,c);if("function"===typeof d.mutatedAttributesCallback)try{d.mutatedAttributesCallback(b)}catch(l){var h=z().createError("amp-bind: Applying expression "+("results ("+JSON.stringify(b)+") failed with error"),l);Vb(h,d)}})}
  181. x.Aa=function(a){var b=this,c=a.target;(a=c.parentNode)&&"AMP-LIST"==a.tagName?Ea().info("amp-bind","Skipping DOM_UPDATE rescan of:",c):td(this,[c]).then(function(){return ud(b,[c])}).then(function(){})};function yd(a,b,c){var d=a.o;a=a.da;if(d.Worker){var e;e=fb(d);gb(e,e,"amp-worker",Jc);d=jb(d,"amp-worker");b=Kc(d,b,c||[],a)}else b=Promise.reject("Worker not supported in window.");return b}function zd(a,b,c){b=z().createError(b+" "+a.message);b.stack=a.stack;Vb(b,c);return b}
  182. x.Ca=function(){var a=[],b=JSON.stringify(this.O,function(b,d){if(ya(d)){if(a.includes(d))return"[Circular]";a.push(d)}return d});z().info("amp-bind",b)};x.La=function(){return this.W};x.Na=function(){return this.Y};(function(a){a.registerServiceForDoc("bind",pd);a.registerElement("amp-state",fc);a.registerElement("amp-bind-macro",dc)})(self.AMP);
  183. })});
  184. //# sourceMappingURL=amp-bind-0.1.js.map
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement