@google-psat/cli 1.0.0-1 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see amp-viewer-integration-0.1.js.LICENSE.txt */
2
- (self.AMP=self.AMP||[]).push({m:0,v:"2410292120000",n:"amp-viewer-integration",ev:"0.1",l:!0,p:"high",f:function(t,e){!function(){function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function n(t,n){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,n){if(t){if("string"==typeof t)return e(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?e(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){i&&(t=i);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i;function r(){return i||(i=Promise.resolve(void 0))}var o=function(){var t=this;this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))};function s(t,e){var n=t.length-e.length;return n>=0&&t.indexOf(e,n)==n}Array.isArray;var a=Object.prototype;function u(t){var e=Object.create(null);return t&&Object.assign(e,t),e}function h(t,e,n,i,r,o,s,a,u,h,c){return t}a.hasOwnProperty,a.toString;var c=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function l(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";try{return decodeURIComponent(t)}catch(t){return e}}function f(t){var e=Object.getOwnPropertyDescriptor(t,"message");if(null!=e&&e.writable)return t;var n=t.message,i=t.stack,r=new Error(n);for(var o in t)r[o]=t[o];return r.stack=i,r}function d(t){for(var e,i=null,r="",o=n(arguments,!0);!(e=o()).done;){var s=e.value;s instanceof Error&&!i?i=f(s):(r&&(r+=" "),r+=s)}return i?r&&(i.message=r+": "+i.message):i=new Error(r),i}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var v=self.__AMP_LOG;function p(t,e){throw new Error("failed to call initLogConstructor")}function m(t){return v.user||(v.user=g()),function(t,e){return e&&e.ownerDocument.defaultView!=t}(v.user.win,t)?v.userForEmbed||(v.userForEmbed=g()):v.user}function g(t){return p()}function I(){return v.dev||(v.dev=p())}function y(t,e,n,i,r,o,s,a,u,h,c){return t}function w(t,e,n,i,r,o,s,a,u,h,c){return m().assert(t,e,n,i,r,o,s,a,u,h,c)}function b(t,e){return A(t=function(t){return t.__AMP_TOP||(t.__AMP_TOP=t)}(t),e)}function _(t,e){return A(E(x(t)),e)}function x(t){return t.nodeType?(n=t,e=(n.ownerDocument||n).defaultView,b(e,"ampdoc")).getAmpDoc(t):t;var e,n}function E(t){var e=x(t);return e.isSingleDoc()?e.win:e}function A(t,e){y(S(t,e));var n=function(t){var e=t.__AMP_SERVICES;return e||(e=t.__AMP_SERVICES={}),e}(t)[e];return n.obj||(y(n.ctor),y(n.context),n.obj=new n.ctor(n.context),y(n.obj),n.context=null,n.resolve&&n.resolve(n.obj)),n.obj}function S(t,e){var n=t.__AMP_SERVICES&&t.__AMP_SERVICES[e];return!(!n||!n.ctor)}var C,k=function(t){return b(t,"platform")},M=function(t){return _(t,"viewer")},P=function(t){return _(t,"viewport")},T=["Webkit","webkit","Moz","moz","ms","O","o"],O={getPropertyPriority:function(){return""},getPropertyValue:function(){return""}};function R(t){var e=t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()}));return T.some((function(t){return e.startsWith(t+"-")}))?"-".concat(e):e}function N(t,e,n){if(H(e))return e;C||(C=u());var i=C[e];if(!i||n){if(i=e,void 0===t[e]){var r=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(e),o=function(t,e){for(var n=0;n<T.length;n++){var i=T[n]+e;if(void 0!==t[i])return i}return""}(t,r);void 0!==t[o]&&(i=o)}n||(C[e]=i)}return i}function L(t,e){var n=t.style;for(var i in e)n.setProperty(R(N(n,i)),String(e[i]),"important")}function q(t,e,n,i,r){var o=N(t.style,e,r);if(o){var s=i?n+i:n;t.style.setProperty(R(o),s)}}function F(t,e,n){var i=N(t.style,e,n);if(i)return H(i)?t.style.getPropertyValue(i):t.style[i]}function V(t,e){for(var n in e)q(t,n,e[n])}function D(t,e){var n=t.style;h(""!==e&&"none"!==e),h(!n.display),n.display=e}function U(t,e){return t.getComputedStyle(e)||O}function j(t,e){for(var n=0;n<e.length;n++)q(t,e[n],null)}function H(t){return t.startsWith("--")}var X=function(){function t(){}return t.solveYValueFromXValue=function(e,n,i,r,o,s,a,u,h){return t.Qd(t.Zd(e,n,r,s,u),i,o,a,h)},t.Zd=function(e,n,i,r,o){var s=1e-6,a=(e-n)/(o-n);if(a<=0)return 0;if(a>=1)return 1;for(var u=0,h=1,c=0,l=0;l<8;l++){c=t.tm(a,n,i,r,o);var f=(t.tm(a+s,n,i,r,o)-c)/s;if(Math.abs(c-e)<s)return a;if(Math.abs(f)<s)break;c<e?u=a:h=a,a-=(c-e)/f}for(var d=0;Math.abs(c-e)>s&&d<8;d++)c<e?(u=a,a=(a+h)/2):(h=a,a=(a+u)/2),c=t.tm(a,n,i,r,o);return a},t.tm=function(e,n,i,r,o){if(0==e)return n;if(1==e)return o;var s=t.im(n,i,e),a=t.im(i,r,e),u=t.im(r,o,e);return s=t.im(s,a,e),a=t.im(a,u,e),t.im(s,a,e)},t.Qd=function(e,n,i,r,o){if(0==e)return n;if(1==e)return o;var s=t.im(n,i,e),a=t.im(i,r,e),u=t.im(r,o,e);return s=t.im(s,a,e),a=t.im(a,u,e),t.im(s,a,e)},t.im=function(t,e,n){return t+n*(e-t)},t}(),Q={LINEAR:function(t){return t},EASE:function(t){return X.solveYValueFromXValue(t,0,0,.25,.1,.25,1,1,1)},EASE_IN:function(t){return X.solveYValueFromXValue(t,0,0,.42,0,1,1,1,1)},EASE_OUT:function(t){return X.solveYValueFromXValue(t,0,0,0,0,.58,1,1,1)},EASE_IN_OUT:function(t){return X.solveYValueFromXValue(t,0,0,.42,0,.58,1,1,1)}},z={linear:Q.LINEAR,ease:Q.EASE,"ease-in":Q.EASE_IN,"ease-out":Q.EASE_OUT,"ease-in-out":Q.EASE_IN_OUT};function G(t){if(!t)return null;if("string"==typeof t){if(-1!=t.indexOf("cubic-bezier")){var e=t.match(/cubic-bezier\((.+)\)/);if(e){var n=e[1].split(",").map(parseFloat);if(4==n.length){for(var i=0;i<4;i++)if(isNaN(n[i]))return null;return r=n[0],o=n[1],s=n[2],a=n[3],function(t){return X.solveYValueFromXValue(t,0,0,r,o,s,a,1,1)}}}return null}return z[t]}var r,o,s,a;return t}var Y="Animation",K=function(){},Z=function(){function t(t,e){this.nm=t,this.Gc=e||b(self,"vsync"),this.rm=null,this.sm=[]}t.animate=function(e,n,i,r){return new t(e).setCurve(r).add(0,n,1).start(i)};var e=t.prototype;return e.setCurve=function(t){return t&&(this.rm=G(t)),this},e.add=function(t,e,n,i){return this.sm.push({delay:t,func:e,duration:n,curve:G(i)}),this},e.start=function(t){return new B(this.Gc,this.nm,this.sm,this.rm,t)},t}(),B=function(){function t(t,e,n,i,r){this.Gc=t,this.nm=e,this.sm=[];for(var s=0;s<n.length;s++){var a=n[s];this.sm.push({delay:a.delay,func:a.func,duration:a.duration,curve:a.curve||i,started:!1,completed:!1})}this.om=r,this.ka=Date.now(),this.es=!0,this.Ke={};var u=new o;this.um=u.promise,this.Fe=u.resolve,this.hm=u.reject,this.am=this.Gc.createAnimTask(this.nm,{mutate:this.fm.bind(this)}),this.Gc.canAnimate(this.nm)?this.am(this.Ke):(I().warn(Y,"cannot animate"),this.lm(!1,0))}var e=t.prototype;return e.then=function(t,e){return t||e?this.um.then(t,e):this.um},e.thenAlways=function(t){var e=t||K;return this.then(e,e)},e.halt=function(t){this.lm(!1,t||0)},e.lm=function(t,e){if(this.es){if(this.es=!1,0!=e){this.sm.length>1&&this.sm.sort((function(t,e){return t.delay+t.duration-(e.delay+e.duration)}));try{if(e>0)for(var n=0;n<this.sm.length;n++)this.sm[n].func(1,!0);else for(var i=this.sm.length-1;i>=0;i--)this.sm[i].func(0,!1)}catch(e){I().error(Y,"completion failed: "+e,e),t=!1}}t?this.Fe():this.hm()}},e.fm=function(t){if(this.es){for(var e=Date.now(),n=Math.min((e-this.ka)/this.om,1),i=0;i<this.sm.length;i++){var r=this.sm[i];!r.started&&n>=r.delay&&(r.started=!0)}for(var o=0;o<this.sm.length;o++){var s=this.sm[o];s.started&&!s.completed&&this.vm(s,n)}1==n?this.lm(!0,0):this.Gc.canAnimate(this.nm)?this.am(this.Ke):(I().warn(Y,"cancel animation"),this.lm(!1,0))}},e.vm=function(t,e){var n,i;if(t.duration>0){if(i=n=Math.min((e-t.delay)/t.duration,1),t.curve&&1!=i)try{i=t.curve(n)}catch(t){return I().error(Y,"step curve failed: "+t,t),void this.lm(!1,0)}}else n=1,i=1;1==n&&(t.completed=!0);try{t.func(i,t.completed)}catch(t){return I().error(Y,"step mutate failed: "+t,t),void this.lm(!1,0)}},t}(),W=function(){function t(t,e,n){var i=this;this.Xo=A(t,"timer"),this.Jo=e,this.Qo=n||0,this.Zo=-1,this.rs=0,this.es=!1,this.us=function(){i.os()}}var e=t.prototype;return e.isPending=function(){return-1!=this.Zo},e.schedule=function(t){var e=t||this.Qo;this.es&&e<10&&(e=10);var n=Date.now()+e;return(!this.isPending()||n-this.rs<-10)&&(this.cancel(),this.rs=n,this.Zo=this.Xo.delay(this.us,e),!0)},e.os=function(){this.Zo=-1,this.rs=0,this.es=!0,this.Jo(),this.es=!1},e.cancel=function(){this.isPending()&&(this.Xo.cancel(this.Zo),this.Zo=-1)},t}(),J="FixedLayer",$="i-amphtml-lightbox",tt="i-amphtml-lightbox-element";function et(t){return-1!==t.tagName.indexOf("LIGHTBOX")}var nt,it=function(){function t(t,e,n,i,r){var o=this;this.ampdoc=t,this.Gc=e,this.tI=n,this.ym=i,this.nI=i,this.iI=r&&t.isSingleDoc(),this.rI=null,this.eI=0,this.Qt=[],this.sI=new W(t.win,(function(){return o.update()})),this.oI=null,this.uI=[],this.hI=[]}var e=t.prototype;return e.enterLightbox=function(t,e){var n=this,i=this.aI();i&&i.setLightboxMode(!0),t&&e&&e.then((function(){return n.fI(t,!0)}))},e.leaveLightbox=function(){var t=this.aI();t&&t.setLightboxMode(!1);var e=function(t){for(var e=[],n=0,i=0;i<t.length;i++){var r=t[i];r.lightboxed?e.push(r):(n<i&&(t[n]=r),n++)}return n<t.length&&(t.length=n),e}(this.Qt);this.cI(e),this.Qt.length||this.vI()},e.setup=function(){if(!M(this.ampdoc).isEmbedded())return!1;var t=this.ampdoc.getRootNode(),e=t.styleSheets;if(!e)return!0;this.uI.length=0,this.hI.length=0;for(var n=0;n<e.length;n++){var i=e[n];if(!i)return I().error(J,"Aborting setup due to null stylesheet."),!0;var r=i.disabled,o=i.ownerNode;r||!o||"STYLE"!=o.tagName||o.hasAttribute("amp-boilerplate")||o.hasAttribute("amp-runtime")||o.hasAttribute("amp-extension")||this.lI(i.cssRules)}this.fI(t),this.Qt.length>0&&this.observeHiddenMutations();var s=k(this.ampdoc.win);return this.Qt.length>0&&!this.iI&&s.isIos()&&m().warn(J,"Please test this page inside of an AMP Viewer such as Google's because the fixed or sticky positioning might have slightly different layout."),!0},e.fI=function(t,e){this.dI(t,e),this.pI(),this.update()},e.observeHiddenMutations=function(){this.mI()},e.vI=function(){this.sI.cancel();var t=this.oI;t&&(t(),this.oI=null)},e.mI=function(){var t=this;if(!this.oI){var e=this.ampdoc.getRootNode(),n=function(t){return e="hidden-observer",S(n=E(x(t)),e)?A(n,e):null;var e,n}(e.documentElement||e);this.oI=n.add((function(){t.sI.isPending()||t.sI.schedule(16)}))}},e.updatePaddingTop=function(t,e){this.ym=t,e||(this.nI=t),this.update()},e.transformMutate=function(t){t?this.Qt.forEach((function(e){e.fixedNow&&e.top&&(q(e.element,"transition","none"),e.transform&&"none"!=e.transform?q(e.element,"transform",e.transform+" "+t):q(e.element,"transform",t))})):this.Qt.forEach((function(t){t.fixedNow&&t.top&&V(t.element,{transform:"",transition:""})}))},e.addElement=function(t,e){return this.yI(t,"*","fixed",e)?(this.pI(),this.observeHiddenMutations(),this.update()):r()},e.removeElement=function(t){var e=this.gI(t);this.cI(e)},e.cI=function(t){var e=this;t.length>0&&this.rI&&this.Gc.mutate((function(){for(var n=0;n<t.length;n++){var i=t[n];"fixed"==i.position&&e.rI.returnFrom(i)}}))},e.isDeclaredFixed=function(t){return!!t.__AMP_DECLFIXED},e.isDeclaredSticky=function(t){return!!t.__AMP_DECLSTICKY},e.update=function(){var t=this;if(this.Qt.filter((function(e){return!t.ampdoc.contains(e.element)})).forEach((function(e){return t.gI(e.element)})),0==this.Qt.length)return r();this.sI.cancel();var e=!1;return this.Gc.runPromise({measure:function(n){for(var i=t.Qt,r=[],o=t.ampdoc.win,a=0;a<i.length;a++)L(i[a].element,{top:"",bottom:"-9999vh",transition:"none"});for(var u=0;u<i.length;u++)r.push(U(o,i[u].element).top);for(var h=0;h<i.length;h++)q(i[h].element,"bottom","");for(var c=0;c<i.length;c++){var l=i[c],f=l.element,d=l.forceTransfer,v=U(o,f),p=f.offsetHeight,m=f.offsetTop,g=f.offsetWidth,I=v.bottom,y=v.display,w=void 0===y?"":y,b=v.position,_=void 0===b?"":b,x=v.zIndex,E=parseFloat(v.opacity),A=v[N(v,"transform")],S=v.top,C="fixed"===_&&(d||g>0&&p>0),k=s(_,"sticky");if("none"!==w&&(C||k)){"auto"!==S&&r[c]===S||(S=C&&m===t.nI+t.tI?"0px":"");var M=!1;C&&(M=!0===d||!1!==d&&E>0&&p<300&&!(!S&&!I)),M&&(e=!0),n[l.id]={fixed:C,sticky:k,transferrable:M,top:S,zIndex:x,transform:A}}else n[l.id]={fixed:!1,sticky:!1,transferrable:!1,top:"",zIndex:""}}},mutate:function(n){e&&t.iI&&t.aI().update();for(var i=t.Qt,r=0;r<i.length;r++){var o=i[r],s=n[o.id];q(o.element,"transition","none"),q(o.element,"transition",""),s&&t.wI(o,r,s)}}},{}).catch((function(t){I().error(J,"Failed to mutate fixed elements:",t)}))},e.dI=function(t,e){try{this.bI(t,e)}catch(t){I().error(J,"Failed to setup fixed elements:",t)}},e.bI=function(t,e){for(var n=0;n<this.uI.length;n++)for(var i=this.uI[n],r=t.querySelectorAll(i),o=0;o<r.length&&!(this.Qt.length>10);o++)this.yI(r[o],i,"fixed",void 0,e);for(var s=0;s<this.hI.length;s++)for(var a=this.hI[s],u=t.querySelectorAll(a),h=0;h<u.length;h++)this.yI(u[h],a,"sticky",void 0,e)},e.xI=function(t){t.hasAttribute("style")&&(F(t,"top")||F(t,"bottom"))&&m().error(J,"Inline styles with `top`, `bottom` and other CSS rules are not supported yet for fixed or sticky elements (#14186). Unexpected behavior may occur.",t)},e.yI=function(t,e,n,i,r){if(i||this.xI(t),et(t))return!1;var o=function(t,e){var n;for(n=t;n&&void 0!==n;n=n.parentElement)if(e(n))return n;return null}(t,et);if(!r&&o)return!1;for(var s=this.Qt,a=[],u=0;u<s.length;u++){var h=s[u].element;if(h===t)break;if(h.contains(t))return!1;t.contains(h)&&a.push(h)}for(var c=0;c<a.length;c++)this.removeElement(a[c]);for(var l=null,f=0;f<s.length;f++){var d=s[f];if(d.element==t&&d.position==n){l=d;break}}var v="fixed"==n;if(l)l.selectors.includes(e)||l.selectors.push(e);else{var p="F"+this.eI++;t.setAttribute("i-amphtml-fixedid",p),v?t.__AMP_DECLFIXED=!0:t.__AMP_DECLSTICKY=!0,l={id:p,element:t,position:n,selectors:[e],fixedNow:!1,stickyNow:!1,lightboxed:!!o},s.push(l)}return l.forceTransfer=!!v&&i,!0},e.gI=function(t){for(var e=[],n=0;n<this.Qt.length;n++){var i=this.Qt[n];i.element===t&&(i.lightboxed||this.Gc.mutate((function(){q(t,"top","")})),this.Qt.splice(n,1),e.push(i))}return this.Qt.length||this.vI(),e},e.pI=function(){this.Qt.sort((function(t,e){return(n=t.element)===(i=e.element)?0:n.compareDocumentPosition(i)&(Node.DOCUMENT_POSITION_PRECEDING|Node.DOCUMENT_POSITION_CONTAINS)?1:-1;var n,i}))},e.wI=function(t,e,n){var i=t.element,r=t.fixedNow;t.fixedNow=n.fixed,t.stickyNow=n.sticky,t.top=n.fixed||n.sticky?n.top:"",t.transform=n.transform,!r||n.fixed&&n.transferrable||!this.rI||this.rI.returnFrom(t),n.top&&(n.fixed||n.sticky)&&!t.lightboxed&&(n.fixed||!this.iI?q(i,"top","calc(".concat(n.top," + ").concat(this.ym,"px)")):this.nI===this.ym?q(i,"top",n.top):q(i,"top","calc(".concat(n.top," - ").concat(this.nI,"px)"))),this.iI&&n.fixed&&n.transferrable&&this.aI().transferTo(t,e,n)},e.aI=function(){if(!this.iI||this.rI)return this.rI;var t=this.ampdoc.win.document;return this.rI=new rt(t,this.Gc),this.rI},e.lI=function(t){for(var e=0;e<t.length;e++){var n=t[e];if(4!=n.type&&12!=n.type){if(1==n.type){var i=n.selectorText,r=n.style.position;if("*"===i||!r)continue;"fixed"===r?this.uI.push(i):s(r,"sticky")&&this.hI.push(i)}}else this.lI(n.cssRules)}},e.animateFixedElements=function(t,e,n,i,o){var s=this;return this.updatePaddingTop(t,o),n<=0?r():Z.animate(this.ampdoc.getRootNode(),(function(n){var i=function(n){return e-t+(t-e)*n}(n);s.transformMutate("translateY(".concat(i,"px)"))}),n,i).thenAlways((function(){s.transformMutate(null)}))},t}(),rt=function(){function t(t,e){var n;this.si=t,this.Gc=e,this.kI=t.body.cloneNode(!1),this.kI.removeAttribute("style"),V(this.kI,("display"in(n={position:"absolute",top:0,left:0,height:0,width:0,pointerEvents:"none",overflow:"hidden",animation:"none",background:"none",border:"none",borderImage:"none",boxSizing:"border-box",boxShadow:"none",float:"none",margin:0,opacity:1,outline:"none",padding:"none",transform:"none",transition:"none"})&&function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var r=d.apply(null,n);r.name=t||r.name,function(t){var e,n;null===(e=(n=self).__AMP_REPORT_ERROR)||void 0===e||e.call(n,t)}(r)}("STYLE","`display` style detected. You must use toggle instead."),n)),D(this.kI,"block"),t.documentElement.appendChild(this.kI)}var e=t.prototype;return e.getRoot=function(){return this.kI},e.setLightboxMode=function(t){var e=this;this.Gc.mutate((function(){var n=e.getRoot();t?n.setAttribute($,""):n.removeAttribute($)}))},e.update=function(){for(var t=this.si.body,e=this.kI,n=t.attributes,i=e.attributes,r=0;r<n.length;r++){var o=n[r];"style"!==o.name&&i.setNamedItem(o.cloneNode(!1))}for(var s=0;s<i.length;s++){var a=i[s].name;"style"===a||a===$||t.hasAttribute(a)||(e.removeAttribute(a),s--)}},e.transferTo=function(t,e,n){var i=this,r=t.element;if(r.parentElement!=this.kI){if(I().fine(J,"transfer to fixed:",t.id,t.element),m().warn(J,"In order to improve scrolling performance in Safari, we now move the element to a fixed positioning layer:",t.element),!t.placeholder){q(r,"pointer-events","initial");var o=t.placeholder=this.si.createElement("i-amphtml-fpa");!function(t,e){void 0===e&&(e=t.hasAttribute("hidden")),e?t.removeAttribute("hidden"):t.setAttribute("hidden","")}(o,!1),o.setAttribute("i-amphtml-fixedid",t.id)}q(r,"zIndex","calc(".concat(1e4+e," + ").concat(n.zIndex||0,")")),t.lightboxed&&r.classList.add(tt),r.parentElement.replaceChild(t.placeholder,r),this.kI.appendChild(r),t.selectors.some((function(t){return i.EI(r,t)}))||(m().warn(J,"Failed to move the element to the fixed position layer. This is most likely due to the compound CSS selector:",t.element),this.returnFrom(t))}},e.returnFrom=function(t){if(t.placeholder&&this.si.contains(t.placeholder)){var e=t.element,n=t.placeholder;I().fine(J,"return from fixed:",t.id,e),t.lightboxed&&e.classList.remove(tt),this.si.contains(e)?(q(t.element,"zIndex",""),n.parentElement.replaceChild(e,n)):n.parentElement.removeChild(n)}},e.EI=function(t,e){try{return function(t,e){var n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector;return!!n&&n.call(t,e)}(t,e)}catch(t){return I().error(J,"Failed to test query match:",t),!1}},t}();function ot(t,e,n,i){var r=t,o=n,s=function(t){try{return o(t)}catch(t){var e,n;throw null===(e=(n=self).__AMP_REPORT_ERROR)||void 0===e||e.call(n,t),t}},a=function(){if(void 0!==nt)return nt;nt=!1;try{var t={get capture(){return nt=!0,!1}};self.addEventListener("test-options",null,t),self.removeEventListener("test-options",null,t)}catch(t){}return nt}(),u=!(null==i||!i.capture);return r.addEventListener(e,s,a?i:u),function(){null==r||r.removeEventListener(e,s,a?i:u),o=null,r=null,s=null}}function st(t,e,n,i){return ot(t,e,n,i)}function at(t){return t.data}function ut(t,e,n,i){var r=n,o=ot(t,e,(function(t){try{r(t)}finally{r=null,o()}}),i);return o}var ht=function(){function t(t,e){this.win=t,this.H=e,this.SI()}var e=t.prototype;return e.SI=function(){st(this.win.document,"focusin",this.AI.bind(this),{capture:!1})},e.AI=function(t){t.defaultPrevented||this.H.sendRequest(t.type,{focusTargetRect:t.target.getBoundingClientRect()},!1)},t}();function ct(t){return"loading"!=t.readyState&&"uninitialized"!=t.readyState}function lt(t,e,n){return 0==e&&0==n||0==t.width&&0==t.height?t:{left:i=t.left+e,top:r=t.top+n,width:o=t.width,height:s=t.height,bottom:r+s,right:i+o,x:i,y:r};var i,r,o,s}var ft=function(){function t(t){this.II=t,this._I=[],this.dr=0}var e=t.prototype;return e.push=function(t){this._I[this.dr]=t,this.dr=(this.dr+1)%this.II},e.get=function(t){return this._I.length>=this.II&&(t=(this.dr+t)%this.II),this._I[t]},e.size=function(){return this._I.length},t}();function dt(t){return t.node.wholeText[t.offset]}var vt=/[,.\s\u2022()]/;function pt(t){return"’"==t||"‘"==t?"'":"“"==t||"”"==t?'"':t.toLowerCase()}function mt(t){for(var e=[],n=0;n<t.length;n++){var i=t[n];vt.test(i)||e.push(pt(i))}return e.join("")}var gt=function(){function t(t,e){this.MI=t,this.OI=e,this.matches=[],this.CI={},this.TI=t.length-1;for(var n=0;n<t.length;n++){var i=t[n];this.CI[i]=t.length-1-n}}return t.prototype.update=function(){if(this.TI>0)this.TI--;else{for(var t=this.OI,e=this.MI,n=t.size(),i=0;i<e.length;i++){var r=pt(dt(t.get(n-1-i).pos));if(e[e.length-1-i]!=r){var o=this.CI[r];return null==o&&(o=e.length),(o-=i)<1&&(o=1),void(this.TI=o-1)}}var s=t.get(n-1),a=s.pos;this.matches.push({start:t.get(n-e.length),end:{pos:{node:a.node,offset:a.offset+1},idx:s.idx+1}})}},t}();function It(t,e,n,i){for(var r=n;r<i.length;r++){var o=i[r];if(t.node!=o.start.node)return;if(o.start.node=e,o.start.offset-=t.offset,t.node!=o.end.node)return;o.end.node=e,o.end.offset-=t.offset}}function yt(t,e,n,i,r,o){for(;;){if(e.node==n.node){var s=wt(t,e.node,e.offset,n.offset,o);return void(s&&It(n,s,r+1,i))}var a=bt(t,e.node);if(wt(t,e.node,e.offset,e.node.wholeText.length,o),!a)break;e={node:a,offset:0}}}function wt(t,e,n,i,r){if(n>=i)return null;var o=t.document,s=e.parentNode,a=e.wholeText;n>0&&s.insertBefore(o.createTextNode(a.substring(0,n)),e);var u=o.createElement("span");u.appendChild(o.createTextNode(a.substring(n,i))),s.insertBefore(u,e),r.push(u);var h=null;return i<a.length&&(h=o.createTextNode(a.substring(i)),s.insertBefore(h,e)),s.removeChild(e),h}function bt(t,e){for(var n=!0,i=e;;){if(null==i)return null;if(n){var r=i.nextSibling;r?(i=r,n=!1):i=i.parentNode}else{if(i instanceof t.Text)return i;i.firstChild?i=i.firstChild:n=!0}}}var _t=function(){function t(e,n){if(this.t=e,this.NI=n,this.RI=-1,this.UI=null,n instanceof e.Text)this.RI=0;else if(n instanceof e.Element){if("none"==U(e,n).display)return;var i=n.firstChild;null!=i&&(this.UI=new t(e,i))}}var e=t.prototype;return e.next=function(){if(this.RI>=0)return this.jI();for(;null!=this.UI;){var e=this.UI.next();if(null!=e)return e;var n=this.UI.NI.nextSibling;this.UI=null!=n?new t(this.t,n):null}return null},e.jI=function(){var t=this.NI.wholeText;if(this.RI<t.length){var e=this.RI;return this.RI++,{node:this.NI,offset:e}}return null},t}(),xt=function(){function t(t,e){var n=this;this.vu=t,this.yh=M(t),this.Th=P(this.vu),this.qI=null;var i,r=k(this.vu.win);"fragmentDirective"in document&&r.isChrome()&&r.getMajorVersion()>=93?t.whenFirstVisible().then((function(){return n.zI(e)})):(i=t.win.document,new Promise((function(t){!function(t,e){!function(t,e,n){var i=e(t);i?n(t):t.addEventListener("readystatechange",(function r(){e(t)&&(i||(i=!0,n(t)),t.removeEventListener("readystatechange",r))}))}(t,ct,e)}(i,t)}))).then((function(){n.LI(e)}))}var e=t.prototype;return e.zI=function(t){var e=t.sentences;if(null!=e&&e.length){var n=e.map((function(t){return"text="+encodeURIComponent(t)})).join("&");this.YI(n)}},e.YI=function(t){var e=this.vu.win.location.hash;e?this.vu.win.location.replace(e+":~:"+t):this.vu.win.location.replace("#:~:"+t)},e.FI=function(t,e){var n={state:t};for(var i in e)n[i]=e[i];this.yh.sendMessage("highlightState",n)},e.KI=function(t){var e=this.vu.win,n=function(t,e,n){if(n=function(t){for(var e=[],n=0;n<t.length;n++){var i=mt(t[n]);i&&e.push(i)}return e}(n),n.length<=0)return null;for(var i=new _t(t,e),r=new ft(n.map((function(t){return t.length})).reduce((function(t,e){return Math.max(t,e)}))),o=[new gt(n[0],r)],s=-1;;){s++;var a=i.next();if(null==a)return null;if(!vt.test(dt(a))){r.push({pos:a,idx:s});for(var u=0;u<o.length;u++)o[u].update();if(0!=o[o.length-1].matches.length){if(o.length==n.length)break;o.push(new gt(n[o.length],r))}}}var h=[];t:for(var c=n.length-1;c>=0;c--){var l=o[c].matches;if(0!=h.length){for(var f=h[h.length-1],d=l.length-1;d>=0;d--){var v=l[d];if(f.start.idx>=v.end.idx){h.push(v);continue t}}y(!1)}else h.push(l[l.length-1])}for(var p=[],m=h.length-1;m>=0;m--){var g=h[m];p.push({start:g.start.pos,end:g.end.pos})}return p}(e,this.vu.getBody(),t.sentences);if(n){var i=function(t,e){e=function(t){for(var e=[],n=null,i=0;i<t.length;i++){var r=t[i];n&&n.end.node==r.start.node&&n.end.offset==r.start.offset?n.end=r.end:(n=r,e.push(r))}return e}(e);for(var n=[],i=0;i<e.length;i++){var r=e[i];yt(t,r.start,r.end,e,i,n)}return n}(e,n);i&&0!=i.length&&(this.qI=i)}},e.onVisibleOnce=function(t){var e,n,i,r=this;e=!1,n=null,i=t,t=function(){if(!e){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];n=i.apply(self,r),e=!0,i=null}return n},this.vu.onVisibilityChanged((function(){"visible"==r.vu.getVisibilityState()&&t()}))},e.LI=function(t){var e=this;if(this.vu.win.document.querySelector('script[id="amp-access"]'))this.FI("has_amp_access");else if(this.KI(t),this.qI){var n=this.XI();if(this.FI("found",{scroll:n}),!t.skipRendering){for(var i=0;i<this.qI.length;i++)V(this.qI[i],{backgroundColor:"#fcff00",color:"#000"});var r=this.vu.getVisibilityState();t.skipScrollAnimation?"visible"==r?this.DI(n):(this.Th.setScrollTop(n),this.onVisibleOnce((function(){e.DI(e.XI())}))):"visible"==r?this.VI(n):(this.HI(n),this.onVisibleOnce((function(){e.VI(e.XI())}))),ut(this.vu.getBody(),"click",this.JI.bind(this))}}else this.FI("not_found")},e.XI=function(){var t=this.qI;if(!t)return 0;for(var e=this.Th,n=Number.MAX_VALUE,i=0,r=e.getPaddingTop(),o=0;o<t.length;o++){var s=lt(e.getLayoutRect(t[o]),0,-r),a=s.bottom,u=s.top;n=Math.min(n,u),i=Math.max(i,a)}if(n>=i)return 0;var h=(i+n-(e.getHeight()-r))/2;return h>n-80&&(h=n-80),h>0?h:0},e.DI=function(t){this.FI("auto_scroll"),this.Th.setScrollTop(t),this.FI("shown")},e.HI=function(t){var e=Math.max(0,t-500);this.Th.setScrollTop(e)},e.BI=function(t){var e=this.XI(),n=this.Th.getScrollTop();if(n==e&&n==t)return null;var i={};return n!=e&&(this.Th.setScrollTop(e),i.nd=n-e),n!=t&&(i.od=n-t),i},e.VI=function(t){var e=this;this.HI(t);var n=this.vu.win.document.createElement("div");D(n,"block"),V(n,{position:"absolute",top:Math.floor(t)+"px",height:"1px",left:"0",width:"1px","pointer-events":"none"});var i=this.vu.getBody();i.appendChild(n),this.FI("auto_scroll"),this.Th.animateScrollIntoView(n).then((function(){i.removeChild(n),e.FI("shown",e.BI(t))}))},e.setupMessaging=function(t){t.registerHandler("highlightDismiss",this.JI.bind(this))},e.JI=function(){if(this.qI)for(var t=0;t<this.qI.length;t++)j(this.qI[t],["backgroundColor","color"])},t}(),Et=["key","code","location","ctrlKey","shiftKey","altKey","metaKey","repeat","isComposing","charCode","keyCode","which"],At=function(){function t(t,e){this.win=t,this.H=e,this.GI()}var e=t.prototype;return e.GI=function(){var t=this.WI.bind(this);st(this.win,"keydown",t),st(this.win,"keypress",t),st(this.win,"keyup",t)},e.WI=function(t){(function(t){if(t.defaultPrevented)return!0;if("Escape"==t.key)return!1;switch(t.target.nodeName){case"INPUT":return"checkbox"!=t.target.type||" "==t.key;case"TEXTAREA":case"BUTTON":case"SELECT":case"OPTION":return!0}return t.target.hasAttribute&&t.target.hasAttribute("contenteditable")})(t)||this.AI(t)},e.AI=function(t){this.H.sendRequest(t.type,function(t){var e={};return Et.forEach((function(n){void 0!==t[n]&&(e[n]=t[n])})),e}(t),!1)},t}(),St="amp-viewer-messaging",Ct="channelOpen",kt="__AMPHTML__";function Mt(t){if("string"!=typeof t)return t;if("{"!=t.charAt(0))return null;try{return JSON.parse(t)}catch(t){return null}}var Pt,Tt,Ot=function(){function t(t,e,n){this.t=t,this.i=e,this.h=n}var e=t.prototype;return e.addEventListener=function(t,e){var n=this;this.t.addEventListener("message",(function(t){t.origin==n.i&&t.source==n.h&&e(t)}))},e.postMessage=function(t){var e="null"===this.i?"*":this.i;this.h.postMessage(t,e)},e.start=function(){},t}(),Rt=function(){function t(t,e,n,i,r){this.t=t,this.o=e,this.u=!!n,this.l=i||null,this.v=!!r,this.p=0,this.g={},this.m={},this.q=null,this.o.addEventListener("message",this._.bind(this)),this.o.start()}t.initiateHandshakeWithDocument=function(e,n){return new Promise((function(i){var r=setInterval((function(){var o=new MessageChannel,s={app:kt,name:"handshake-poll"};e.postMessage(s,"*",[o.port2]);var a=o.port1;a.addEventListener("message",(function e(o){var s=Mt(o.data);if(s&&s.app===kt&&s.name===Ct){clearInterval(r),a.removeEventListener("message",e);var u=new t(null,a,!1,n,!0);u.M(s.requestid,Ct,null),i(u)}})),a.start()}),1e3)}))},t.waitForHandshakeFromDocument=function(e,n,i,r,o){return new Promise((function(s){e.addEventListener("message",(function a(u){var h=Mt(u.data);if(h&&(u.origin==i||o&&o.test(u.origin))&&(!u.source||u.source==n)&&h.app===kt&&h.name===Ct){e.removeEventListener("message",a);var c=new t(null,new Ot(e,u.origin,n),!1,r,!0);c.M(h.requestid,Ct,null),s(c)}}))}))};var e=t.prototype;return e.registerHandler=function(t,e){this.m[t]=e},e.unregisterHandler=function(t){delete this.m[t]},e.setDefaultHandler=function(t){this.q=t},e._=function(t){var e=Mt(t.data);e&&e.app===kt&&(this.l&&this.v&&e.messagingToken!==this.l?this.O(St+": handleMessage_ error: ","invalid token"):"q"===e.type?this.P(e):"s"===e.type&&this.R(e))},e.sendRequest=function(t,e,n){var i=this,r=++this.p,o=void 0;return n&&(o=new Promise((function(t,e){i.g[r]={resolve:t,reject:e}}))),this.S({app:kt,requestid:r,type:"q",name:t,data:e,rsvp:n}),o},e.M=function(t,e,n){this.S({app:kt,requestid:t,type:"s",name:e,data:n})},e.k=function(t,e,n){var i=this.j(n);this.O(St+": sendResponseError_, message name: "+e,i),this.S({app:kt,requestid:t,type:"s",name:e,data:null,error:i})},e.S=function(t){var e=Object.assign(t,{});this.l&&!this.v&&(e.messagingToken=this.l),this.o.postMessage(this.u?JSON.stringify(e):e)},e.P=function(t){var e=this,n=this.m[t.name];if(n||(n=this.q),!n){var i=new Error("Cannot handle request because no default handler is set!");throw i.args=t.name,i}var r=n(t.name,t.data,!!t.rsvp);if(t.rsvp){var o=t.requestid;if(!r)throw this.k(o,t.name,new Error("no response")),new Error("expected response but none given: "+t.name);r.then((function(n){e.M(o,t.name,n)}),(function(n){e.k(o,t.name,n)}))}},e.R=function(t){var e=t.requestid,n=this.g[e];n&&(delete this.g[e],t.error?(this.O(St+": handleResponse_ error: ",t.error),n.reject(new Error("Request ".concat(t.name," failed: ").concat(t.error)))):n.resolve(t.data))},e.O=function(t,e){if(this.t){var n="amp-messaging-error-logger: "+t;n+=" data: "+this.j(e),this.t.viewerState=n}},e.j=function(t){return t?t.message?t.message:String(t):"unknown error"},t}(),Nt=["altKey","charCode","ctrlKey","detail","eventPhase","key","layerX","layerY","metaKey","pageX","pageY","returnValue","shiftKey","timeStamp","type","which"],Lt=["clientX","clientY","force","identifier","pageX","pageY","radiusX","radiusY","screenX","screenY"],qt=function(){function t(t,e){this.win=t,this.H=e,this.ZI=!1,this.$I=[],e.registerHandler("scrollLock",this.QI.bind(this)),this.E_()}var e=t.prototype;return e.E_=function(){var t=this.WI.bind(this),e=this.win.document,n={capture:!1,passive:!this.ZI};this.$I.push(st(e,"touchstart",t,n),st(e,"touchend",t,n),st(e,"touchmove",t,n))},e.rg=function(){this.$I.forEach((function(t){return t()})),this.$I.length=0},e.WI=function(t){switch(t.type){case"touchstart":case"touchend":case"touchmove":this.I_(t);break;default:return}},e.I_=function(t){if(null!=t&&t.shouldViewerCancelPropagation)t.stopImmediatePropagation();else{if(t&&t.type){var e=this.__(t);this.H.sendRequest(t.type,e,!1)}this.ZI&&t.cancelable&&t.preventDefault()}},e.__=function(t){var e=this.M_(t,Nt);return t.touches&&(e.touches=this.O_(t.touches)),t.changedTouches&&(e.changedTouches=this.O_(t.changedTouches)),e},e.O_=function(t){for(var e=[],n=0;n<t.length;n++)e.push(this.M_(t[n],Lt));return e},e.M_=function(t,e){for(var n={},i=0;i<e.length;i++){var r=e[i];void 0!==t[r]&&(n[r]=t[r])}return n},e.QI=function(t,e,n){return this.ZI=!!e,this.rg(),this.E_(),n?Promise.resolve({}):void 0},t}(),Ft=function(){function t(t){this.zt=t,this.It=0,this.Ct=0,this.Ot=u()}var e=t.prototype;return e.has=function(t){return!!this.Ot[t]},e.get=function(t){var e=this.Ot[t];if(e)return e.access=++this.Ct,e.payload},e.put=function(t,e){this.has(t)||this.It++,this.Ot[t]={payload:e,access:this.Ct},this.qt()},e.qt=function(){if(!(this.It<=this.zt)){var t,e=this.Ot,n=this.Ct+1;for(var i in e){var r=e[i].access;r<n&&(n=r,t=i)}void 0!==t&&(delete e[t],this.It--)}},t}(),Vt=self.AMP.config.urls,Dt=new Set(["c","v","a","ad"]),Ut=function(t){return"string"==typeof t?function(t){return Pt||(Pt=self.document.createElement("a"),Tt=self.__AMP_URL_CACHE||(self.__AMP_URL_CACHE=new Ft(100))),function(t,e,n){if(n&&n.has(e))return n.get(e);t.href=e,t.protocol||(t.href=t.href);var i,r={href:t.href,protocol:t.protocol,host:t.host,hostname:t.hostname,port:"0"==t.port?"":t.port,pathname:t.pathname,search:t.search,hash:t.hash,origin:null};"/"!==r.pathname[0]&&(r.pathname="/"+r.pathname),("http:"==r.protocol&&80==r.port||"https:"==r.protocol&&443==r.port)&&(r.port="",r.host=r.hostname),i=t.origin&&"null"!=t.origin?t.origin:"data:"!=r.protocol&&r.host?r.protocol+"//"+r.host:r.href,r.origin=i;var o=r;return n&&n.put(e,o),o}(Pt,t,Tt)}(t):t},jt="amp-viewer-integration";new(function(){function t(t){this.win=t,this.C_=!1,this.P_=!1,this.N_=null}var e=t.prototype;return e.init=function(){var t=this;I().fine(jt,"handshake init()");var e=x(this.win.document),n=M(e);this.C_="1"==n.getParam("webview"),this.P_=n.hasCapability("handshakepoll");var i,o=n.getParam("messagingToken"),s=n.getParam("origin")||"";if(!this.C_&&!s)return r();if(P(e).createFixedLayer(it),this.C_||this.P_){var a=(i=this.win).parent&&i.parent!=i?this.win.parent:null;return this.R_(a,s).then((function(i){return t.U_(n,e,s,new Rt(t.win,i,t.C_,o))}))}var h=function(t){var e=function(t){var e,n=u();if(!t)return n;for(;e=c.exec(t);){var i=l(e[1],e[1]),r=e[2]?l(e[2].replace(/\+/g," "),e[2]):"";n[i]=r}return n}(t.win.location.hash).highlight;if(!e||e.length>102400)return null;var n,i=(n=e,JSON.parse(n)),r=i.s;if(!(r instanceof Array)||r.length>15)return null;for(var o=0,s=0;s<r.length;s++){var a=r[s];if("string"!=typeof a||!a)return null;if((o+=a.length)>1500)return null}var h=!1;i.n&&(h=!0);var f=!1;return i.na&&(f=!0),{sentences:r,skipScrollAnimation:f,skipRendering:h}}(e);h&&(this.N_=new xt(e,h));var f=new Ot(this.win,s,this.win.parent);return this.U_(n,e,s,new Rt(this.win,f,this.C_,o))},e.R_=function(t,e){var n=this;return new Promise((function(i){var r=st(n.win,"message",(function(o){I().fine(jt,"AMPDOC got a pre-handshake message:",o.type,at(o));var s=Mt(at(o));if(s&&o.origin===e&&o.source===t&&"__AMPHTML__"==s.app&&"handshake-poll"==s.name){if(n.C_&&(!o.ports||!o.ports.length))throw new Error("Did not receive communication port from the Viewer!");var a=o.ports&&o.ports.length>0?o.ports[0]:new Ot(n.win,e,n.win.parent);i(a),r()}}))}))},e.U_=function(t,e,n,i){var r=this;I().fine(jt,"Send a handshake request");var o=e.getUrl(),s=function(t){if(!function(t){return Vt.cdnProxyRegex.test(Ut(t).origin)}(t=Ut(t)))return t.href;var e=t.pathname.split("/"),n=e[1];w(Dt.has(n),"Unknown path prefix in url %s",t.href);var i=e[2],r="s"==i?"https://"+decodeURIComponent(e[3]):"http://"+decodeURIComponent(i);return w(r.indexOf(".")>0,"Expected a . in origin %s",r),e.splice(1,"s"==i?3:2),r+e.join("/")+function(t){if(!t||"?"==t)return"";var e=new RegExp("[?&]".concat("(amp_(js[^&=]*|gsa|r|kit)|usqp)","\\b[^&]*"),"g"),n=t.replace(e,"").replace(/^[?&]/,"");return n?"?"+n:""}(t.search)+(t.hash||"")}(o);return i.sendRequest("channelOpen",{url:o,sourceUrl:s},!0).then((function(){I().fine(jt,"Channel has been opened!"),r.Am(i,t,n)}))},e.Am=function(t,e,n){t.setDefaultHandler((function(t,n,i){return e.receiveMessage(t,n,i)})),e.setMessageDeliverer(t.sendRequest.bind(t),n),ut(this.win,"unload",this.j_.bind(this,t)),(e.hasCapability("swipe")||e.hasCapability("touch"))&&this.q_(t),e.hasCapability("keyboard")&&this.z_(t),e.hasCapability("focus-rect")&&this.L_(t),null!=this.N_&&this.N_.setupMessaging(t)},e.j_=function(t){return t.sendRequest("unloaded",{},!0)},e.L_=function(t){new ht(this.win,t)},e.q_=function(t){new qt(this.win,t)},e.z_=function(t){new At(this.win,t)},t}())(t.win).init()}()}});
2
+ (self.AMP=self.AMP||[]).push({m:0,v:"2410292120000",n:"amp-viewer-integration",ev:"0.1",l:!0,p:"high",f:function(t,e){!function(){function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function n(t,n){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,n){if(t){if("string"==typeof t)return e(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?e(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){i&&(t=i);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i;function r(){return i||(i=Promise.resolve(void 0))}var o=function(){var t=this;this.promise=new Promise(function(e,n){t.resolve=e,t.reject=n})};function s(t,e){var n=t.length-e.length;return n>=0&&t.indexOf(e,n)==n}Array.isArray;var a=Object.prototype;function u(t){var e=Object.create(null);return t&&Object.assign(e,t),e}function h(t,e,n,i,r,o,s,a,u,h,c){return t}a.hasOwnProperty,a.toString;var c=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function l(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";try{return decodeURIComponent(t)}catch(t){return e}}function f(t){var e=Object.getOwnPropertyDescriptor(t,"message");if(null!=e&&e.writable)return t;var n=t.message,i=t.stack,r=new Error(n);for(var o in t)r[o]=t[o];return r.stack=i,r}function d(t){for(var e,i=null,r="",o=n(arguments,!0);!(e=o()).done;){var s=e.value;s instanceof Error&&!i?i=f(s):(r&&(r+=" "),r+=s)}return i?r&&(i.message=r+": "+i.message):i=new Error(r),i}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var v=self.__AMP_LOG;function p(t,e){throw new Error("failed to call initLogConstructor")}function m(t){return v.user||(v.user=g()),function(t,e){return e&&e.ownerDocument.defaultView!=t}(v.user.win,t)?v.userForEmbed||(v.userForEmbed=g()):v.user}function g(t){return p()}function I(){return v.dev||(v.dev=p())}function y(t,e,n,i,r,o,s,a,u,h,c){return t}function w(t,e,n,i,r,o,s,a,u,h,c){return m().assert(t,e,n,i,r,o,s,a,u,h,c)}function b(t,e){return A(t=function(t){return t.__AMP_TOP||(t.__AMP_TOP=t)}(t),e)}function _(t,e){return A(E(x(t)),e)}function x(t){return t.nodeType?(n=t,e=(n.ownerDocument||n).defaultView,b(e,"ampdoc")).getAmpDoc(t):t;var e,n}function E(t){var e=x(t);return e.isSingleDoc()?e.win:e}function A(t,e){y(S(t,e));var n=function(t){var e=t.__AMP_SERVICES;return e||(e=t.__AMP_SERVICES={}),e}(t)[e];return n.obj||(y(n.ctor),y(n.context),n.obj=new n.ctor(n.context),y(n.obj),n.context=null,n.resolve&&n.resolve(n.obj)),n.obj}function S(t,e){var n=t.__AMP_SERVICES&&t.__AMP_SERVICES[e];return!(!n||!n.ctor)}var C,k=function(t){return b(t,"platform")},M=function(t){return _(t,"viewer")},P=function(t){return _(t,"viewport")},T=["Webkit","webkit","Moz","moz","ms","O","o"],O={getPropertyPriority:function(){return""},getPropertyValue:function(){return""}};function R(t){var e=t.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()});return T.some(function(t){return e.startsWith(t+"-")})?"-".concat(e):e}function N(t,e,n){if(H(e))return e;C||(C=u());var i=C[e];if(!i||n){if(i=e,void 0===t[e]){var r=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(e),o=function(t,e){for(var n=0;n<T.length;n++){var i=T[n]+e;if(void 0!==t[i])return i}return""}(t,r);void 0!==t[o]&&(i=o)}n||(C[e]=i)}return i}function L(t,e){var n=t.style;for(var i in e)n.setProperty(R(N(n,i)),String(e[i]),"important")}function q(t,e,n,i,r){var o=N(t.style,e,r);if(o){var s=i?n+i:n;t.style.setProperty(R(o),s)}}function F(t,e,n){var i=N(t.style,e,n);if(i)return H(i)?t.style.getPropertyValue(i):t.style[i]}function V(t,e){for(var n in e)q(t,n,e[n])}function D(t,e){var n=t.style;h(""!==e&&"none"!==e),h(!n.display),n.display=e}function U(t,e){return t.getComputedStyle(e)||O}function j(t,e){for(var n=0;n<e.length;n++)q(t,e[n],null)}function H(t){return t.startsWith("--")}var X=function(){function t(){}return t.solveYValueFromXValue=function(e,n,i,r,o,s,a,u,h){return t.Qd(t.Zd(e,n,r,s,u),i,o,a,h)},t.Zd=function(e,n,i,r,o){var s=1e-6,a=(e-n)/(o-n);if(a<=0)return 0;if(a>=1)return 1;for(var u=0,h=1,c=0,l=0;l<8;l++){c=t.tm(a,n,i,r,o);var f=(t.tm(a+s,n,i,r,o)-c)/s;if(Math.abs(c-e)<s)return a;if(Math.abs(f)<s)break;c<e?u=a:h=a,a-=(c-e)/f}for(var d=0;Math.abs(c-e)>s&&d<8;d++)c<e?(u=a,a=(a+h)/2):(h=a,a=(a+u)/2),c=t.tm(a,n,i,r,o);return a},t.tm=function(e,n,i,r,o){if(0==e)return n;if(1==e)return o;var s=t.im(n,i,e),a=t.im(i,r,e),u=t.im(r,o,e);return s=t.im(s,a,e),a=t.im(a,u,e),t.im(s,a,e)},t.Qd=function(e,n,i,r,o){if(0==e)return n;if(1==e)return o;var s=t.im(n,i,e),a=t.im(i,r,e),u=t.im(r,o,e);return s=t.im(s,a,e),a=t.im(a,u,e),t.im(s,a,e)},t.im=function(t,e,n){return t+n*(e-t)},t}(),Q={LINEAR:function(t){return t},EASE:function(t){return X.solveYValueFromXValue(t,0,0,.25,.1,.25,1,1,1)},EASE_IN:function(t){return X.solveYValueFromXValue(t,0,0,.42,0,1,1,1,1)},EASE_OUT:function(t){return X.solveYValueFromXValue(t,0,0,0,0,.58,1,1,1)},EASE_IN_OUT:function(t){return X.solveYValueFromXValue(t,0,0,.42,0,.58,1,1,1)}},z={linear:Q.LINEAR,ease:Q.EASE,"ease-in":Q.EASE_IN,"ease-out":Q.EASE_OUT,"ease-in-out":Q.EASE_IN_OUT};function G(t){if(!t)return null;if("string"==typeof t){if(-1!=t.indexOf("cubic-bezier")){var e=t.match(/cubic-bezier\((.+)\)/);if(e){var n=e[1].split(",").map(parseFloat);if(4==n.length){for(var i=0;i<4;i++)if(isNaN(n[i]))return null;return r=n[0],o=n[1],s=n[2],a=n[3],function(t){return X.solveYValueFromXValue(t,0,0,r,o,s,a,1,1)}}}return null}return z[t]}var r,o,s,a;return t}var Y="Animation",K=function(){},Z=function(){function t(t,e){this.nm=t,this.Gc=e||b(self,"vsync"),this.rm=null,this.sm=[]}t.animate=function(e,n,i,r){return new t(e).setCurve(r).add(0,n,1).start(i)};var e=t.prototype;return e.setCurve=function(t){return t&&(this.rm=G(t)),this},e.add=function(t,e,n,i){return this.sm.push({delay:t,func:e,duration:n,curve:G(i)}),this},e.start=function(t){return new B(this.Gc,this.nm,this.sm,this.rm,t)},t}(),B=function(){function t(t,e,n,i,r){this.Gc=t,this.nm=e,this.sm=[];for(var s=0;s<n.length;s++){var a=n[s];this.sm.push({delay:a.delay,func:a.func,duration:a.duration,curve:a.curve||i,started:!1,completed:!1})}this.om=r,this.ka=Date.now(),this.es=!0,this.Ke={};var u=new o;this.um=u.promise,this.Fe=u.resolve,this.hm=u.reject,this.am=this.Gc.createAnimTask(this.nm,{mutate:this.fm.bind(this)}),this.Gc.canAnimate(this.nm)?this.am(this.Ke):(I().warn(Y,"cannot animate"),this.lm(!1,0))}var e=t.prototype;return e.then=function(t,e){return t||e?this.um.then(t,e):this.um},e.thenAlways=function(t){var e=t||K;return this.then(e,e)},e.halt=function(t){this.lm(!1,t||0)},e.lm=function(t,e){if(this.es){if(this.es=!1,0!=e){this.sm.length>1&&this.sm.sort(function(t,e){return t.delay+t.duration-(e.delay+e.duration)});try{if(e>0)for(var n=0;n<this.sm.length;n++)this.sm[n].func(1,!0);else for(var i=this.sm.length-1;i>=0;i--)this.sm[i].func(0,!1)}catch(e){I().error(Y,"completion failed: "+e,e),t=!1}}t?this.Fe():this.hm()}},e.fm=function(t){if(this.es){for(var e=Date.now(),n=Math.min((e-this.ka)/this.om,1),i=0;i<this.sm.length;i++){var r=this.sm[i];!r.started&&n>=r.delay&&(r.started=!0)}for(var o=0;o<this.sm.length;o++){var s=this.sm[o];s.started&&!s.completed&&this.vm(s,n)}1==n?this.lm(!0,0):this.Gc.canAnimate(this.nm)?this.am(this.Ke):(I().warn(Y,"cancel animation"),this.lm(!1,0))}},e.vm=function(t,e){var n,i;if(t.duration>0){if(i=n=Math.min((e-t.delay)/t.duration,1),t.curve&&1!=i)try{i=t.curve(n)}catch(t){return I().error(Y,"step curve failed: "+t,t),void this.lm(!1,0)}}else n=1,i=1;1==n&&(t.completed=!0);try{t.func(i,t.completed)}catch(t){return I().error(Y,"step mutate failed: "+t,t),void this.lm(!1,0)}},t}(),W=function(){function t(t,e,n){var i=this;this.Xo=A(t,"timer"),this.Jo=e,this.Qo=n||0,this.Zo=-1,this.rs=0,this.es=!1,this.us=function(){i.os()}}var e=t.prototype;return e.isPending=function(){return-1!=this.Zo},e.schedule=function(t){var e=t||this.Qo;this.es&&e<10&&(e=10);var n=Date.now()+e;return(!this.isPending()||n-this.rs<-10)&&(this.cancel(),this.rs=n,this.Zo=this.Xo.delay(this.us,e),!0)},e.os=function(){this.Zo=-1,this.rs=0,this.es=!0,this.Jo(),this.es=!1},e.cancel=function(){this.isPending()&&(this.Xo.cancel(this.Zo),this.Zo=-1)},t}(),J="FixedLayer",$="i-amphtml-lightbox",tt="i-amphtml-lightbox-element";function et(t){return-1!==t.tagName.indexOf("LIGHTBOX")}var nt,it=function(){function t(t,e,n,i,r){var o=this;this.ampdoc=t,this.Gc=e,this.tI=n,this.ym=i,this.nI=i,this.iI=r&&t.isSingleDoc(),this.rI=null,this.eI=0,this.Qt=[],this.sI=new W(t.win,function(){return o.update()}),this.oI=null,this.uI=[],this.hI=[]}var e=t.prototype;return e.enterLightbox=function(t,e){var n=this,i=this.aI();i&&i.setLightboxMode(!0),t&&e&&e.then(function(){return n.fI(t,!0)})},e.leaveLightbox=function(){var t=this.aI();t&&t.setLightboxMode(!1);var e=function(t){for(var e=[],n=0,i=0;i<t.length;i++){var r=t[i];r.lightboxed?e.push(r):(n<i&&(t[n]=r),n++)}return n<t.length&&(t.length=n),e}(this.Qt);this.cI(e),this.Qt.length||this.vI()},e.setup=function(){if(!M(this.ampdoc).isEmbedded())return!1;var t=this.ampdoc.getRootNode(),e=t.styleSheets;if(!e)return!0;this.uI.length=0,this.hI.length=0;for(var n=0;n<e.length;n++){var i=e[n];if(!i)return I().error(J,"Aborting setup due to null stylesheet."),!0;var r=i.disabled,o=i.ownerNode;r||!o||"STYLE"!=o.tagName||o.hasAttribute("amp-boilerplate")||o.hasAttribute("amp-runtime")||o.hasAttribute("amp-extension")||this.lI(i.cssRules)}this.fI(t),this.Qt.length>0&&this.observeHiddenMutations();var s=k(this.ampdoc.win);return this.Qt.length>0&&!this.iI&&s.isIos()&&m().warn(J,"Please test this page inside of an AMP Viewer such as Google's because the fixed or sticky positioning might have slightly different layout."),!0},e.fI=function(t,e){this.dI(t,e),this.pI(),this.update()},e.observeHiddenMutations=function(){this.mI()},e.vI=function(){this.sI.cancel();var t=this.oI;t&&(t(),this.oI=null)},e.mI=function(){var t=this;if(!this.oI){var e=this.ampdoc.getRootNode(),n=function(t){return e="hidden-observer",S(n=E(x(t)),e)?A(n,e):null;var e,n}(e.documentElement||e);this.oI=n.add(function(){t.sI.isPending()||t.sI.schedule(16)})}},e.updatePaddingTop=function(t,e){this.ym=t,e||(this.nI=t),this.update()},e.transformMutate=function(t){t?this.Qt.forEach(function(e){e.fixedNow&&e.top&&(q(e.element,"transition","none"),e.transform&&"none"!=e.transform?q(e.element,"transform",e.transform+" "+t):q(e.element,"transform",t))}):this.Qt.forEach(function(t){t.fixedNow&&t.top&&V(t.element,{transform:"",transition:""})})},e.addElement=function(t,e){return this.yI(t,"*","fixed",e)?(this.pI(),this.observeHiddenMutations(),this.update()):r()},e.removeElement=function(t){var e=this.gI(t);this.cI(e)},e.cI=function(t){var e=this;t.length>0&&this.rI&&this.Gc.mutate(function(){for(var n=0;n<t.length;n++){var i=t[n];"fixed"==i.position&&e.rI.returnFrom(i)}})},e.isDeclaredFixed=function(t){return!!t.__AMP_DECLFIXED},e.isDeclaredSticky=function(t){return!!t.__AMP_DECLSTICKY},e.update=function(){var t=this;if(this.Qt.filter(function(e){return!t.ampdoc.contains(e.element)}).forEach(function(e){return t.gI(e.element)}),0==this.Qt.length)return r();this.sI.cancel();var e=!1;return this.Gc.runPromise({measure:function(n){for(var i=t.Qt,r=[],o=t.ampdoc.win,a=0;a<i.length;a++)L(i[a].element,{top:"",bottom:"-9999vh",transition:"none"});for(var u=0;u<i.length;u++)r.push(U(o,i[u].element).top);for(var h=0;h<i.length;h++)q(i[h].element,"bottom","");for(var c=0;c<i.length;c++){var l=i[c],f=l.element,d=l.forceTransfer,v=U(o,f),p=f.offsetHeight,m=f.offsetTop,g=f.offsetWidth,I=v.bottom,y=v.display,w=void 0===y?"":y,b=v.position,_=void 0===b?"":b,x=v.zIndex,E=parseFloat(v.opacity),A=v[N(v,"transform")],S=v.top,C="fixed"===_&&(d||g>0&&p>0),k=s(_,"sticky");if("none"!==w&&(C||k)){"auto"!==S&&r[c]===S||(S=C&&m===t.nI+t.tI?"0px":"");var M=!1;C&&(M=!0===d||!1!==d&&E>0&&p<300&&!(!S&&!I)),M&&(e=!0),n[l.id]={fixed:C,sticky:k,transferrable:M,top:S,zIndex:x,transform:A}}else n[l.id]={fixed:!1,sticky:!1,transferrable:!1,top:"",zIndex:""}}},mutate:function(n){e&&t.iI&&t.aI().update();for(var i=t.Qt,r=0;r<i.length;r++){var o=i[r],s=n[o.id];q(o.element,"transition","none"),q(o.element,"transition",""),s&&t.wI(o,r,s)}}},{}).catch(function(t){I().error(J,"Failed to mutate fixed elements:",t)})},e.dI=function(t,e){try{this.bI(t,e)}catch(t){I().error(J,"Failed to setup fixed elements:",t)}},e.bI=function(t,e){for(var n=0;n<this.uI.length;n++)for(var i=this.uI[n],r=t.querySelectorAll(i),o=0;o<r.length&&!(this.Qt.length>10);o++)this.yI(r[o],i,"fixed",void 0,e);for(var s=0;s<this.hI.length;s++)for(var a=this.hI[s],u=t.querySelectorAll(a),h=0;h<u.length;h++)this.yI(u[h],a,"sticky",void 0,e)},e.xI=function(t){t.hasAttribute("style")&&(F(t,"top")||F(t,"bottom"))&&m().error(J,"Inline styles with `top`, `bottom` and other CSS rules are not supported yet for fixed or sticky elements (#14186). Unexpected behavior may occur.",t)},e.yI=function(t,e,n,i,r){if(i||this.xI(t),et(t))return!1;var o=function(t,e){var n;for(n=t;n&&void 0!==n;n=n.parentElement)if(e(n))return n;return null}(t,et);if(!r&&o)return!1;for(var s=this.Qt,a=[],u=0;u<s.length;u++){var h=s[u].element;if(h===t)break;if(h.contains(t))return!1;t.contains(h)&&a.push(h)}for(var c=0;c<a.length;c++)this.removeElement(a[c]);for(var l=null,f=0;f<s.length;f++){var d=s[f];if(d.element==t&&d.position==n){l=d;break}}var v="fixed"==n;if(l)l.selectors.includes(e)||l.selectors.push(e);else{var p="F"+this.eI++;t.setAttribute("i-amphtml-fixedid",p),v?t.__AMP_DECLFIXED=!0:t.__AMP_DECLSTICKY=!0,l={id:p,element:t,position:n,selectors:[e],fixedNow:!1,stickyNow:!1,lightboxed:!!o},s.push(l)}return l.forceTransfer=!!v&&i,!0},e.gI=function(t){for(var e=[],n=0;n<this.Qt.length;n++){var i=this.Qt[n];i.element===t&&(i.lightboxed||this.Gc.mutate(function(){q(t,"top","")}),this.Qt.splice(n,1),e.push(i))}return this.Qt.length||this.vI(),e},e.pI=function(){this.Qt.sort(function(t,e){return(n=t.element)===(i=e.element)?0:n.compareDocumentPosition(i)&(Node.DOCUMENT_POSITION_PRECEDING|Node.DOCUMENT_POSITION_CONTAINS)?1:-1;var n,i})},e.wI=function(t,e,n){var i=t.element,r=t.fixedNow;t.fixedNow=n.fixed,t.stickyNow=n.sticky,t.top=n.fixed||n.sticky?n.top:"",t.transform=n.transform,!r||n.fixed&&n.transferrable||!this.rI||this.rI.returnFrom(t),n.top&&(n.fixed||n.sticky)&&!t.lightboxed&&(n.fixed||!this.iI?q(i,"top","calc(".concat(n.top," + ").concat(this.ym,"px)")):this.nI===this.ym?q(i,"top",n.top):q(i,"top","calc(".concat(n.top," - ").concat(this.nI,"px)"))),this.iI&&n.fixed&&n.transferrable&&this.aI().transferTo(t,e,n)},e.aI=function(){if(!this.iI||this.rI)return this.rI;var t=this.ampdoc.win.document;return this.rI=new rt(t,this.Gc),this.rI},e.lI=function(t){for(var e=0;e<t.length;e++){var n=t[e];if(4!=n.type&&12!=n.type){if(1==n.type){var i=n.selectorText,r=n.style.position;if("*"===i||!r)continue;"fixed"===r?this.uI.push(i):s(r,"sticky")&&this.hI.push(i)}}else this.lI(n.cssRules)}},e.animateFixedElements=function(t,e,n,i,o){var s=this;return this.updatePaddingTop(t,o),n<=0?r():Z.animate(this.ampdoc.getRootNode(),function(n){var i=function(n){return e-t+(t-e)*n}(n);s.transformMutate("translateY(".concat(i,"px)"))},n,i).thenAlways(function(){s.transformMutate(null)})},t}(),rt=function(){function t(t,e){var n;this.si=t,this.Gc=e,this.kI=t.body.cloneNode(!1),this.kI.removeAttribute("style"),V(this.kI,("display"in(n={position:"absolute",top:0,left:0,height:0,width:0,pointerEvents:"none",overflow:"hidden",animation:"none",background:"none",border:"none",borderImage:"none",boxSizing:"border-box",boxShadow:"none",float:"none",margin:0,opacity:1,outline:"none",padding:"none",transform:"none",transition:"none"})&&function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var r=d.apply(null,n);r.name=t||r.name,function(t){var e,n;null===(e=(n=self).__AMP_REPORT_ERROR)||void 0===e||e.call(n,t)}(r)}("STYLE","`display` style detected. You must use toggle instead."),n)),D(this.kI,"block"),t.documentElement.appendChild(this.kI)}var e=t.prototype;return e.getRoot=function(){return this.kI},e.setLightboxMode=function(t){var e=this;this.Gc.mutate(function(){var n=e.getRoot();t?n.setAttribute($,""):n.removeAttribute($)})},e.update=function(){for(var t=this.si.body,e=this.kI,n=t.attributes,i=e.attributes,r=0;r<n.length;r++){var o=n[r];"style"!==o.name&&i.setNamedItem(o.cloneNode(!1))}for(var s=0;s<i.length;s++){var a=i[s].name;"style"===a||a===$||t.hasAttribute(a)||(e.removeAttribute(a),s--)}},e.transferTo=function(t,e,n){var i=this,r=t.element;if(r.parentElement!=this.kI){if(I().fine(J,"transfer to fixed:",t.id,t.element),m().warn(J,"In order to improve scrolling performance in Safari, we now move the element to a fixed positioning layer:",t.element),!t.placeholder){q(r,"pointer-events","initial");var o=t.placeholder=this.si.createElement("i-amphtml-fpa");!function(t,e){void 0===e&&(e=t.hasAttribute("hidden")),e?t.removeAttribute("hidden"):t.setAttribute("hidden","")}(o,!1),o.setAttribute("i-amphtml-fixedid",t.id)}q(r,"zIndex","calc(".concat(1e4+e," + ").concat(n.zIndex||0,")")),t.lightboxed&&r.classList.add(tt),r.parentElement.replaceChild(t.placeholder,r),this.kI.appendChild(r),t.selectors.some(function(t){return i.EI(r,t)})||(m().warn(J,"Failed to move the element to the fixed position layer. This is most likely due to the compound CSS selector:",t.element),this.returnFrom(t))}},e.returnFrom=function(t){if(t.placeholder&&this.si.contains(t.placeholder)){var e=t.element,n=t.placeholder;I().fine(J,"return from fixed:",t.id,e),t.lightboxed&&e.classList.remove(tt),this.si.contains(e)?(q(t.element,"zIndex",""),n.parentElement.replaceChild(e,n)):n.parentElement.removeChild(n)}},e.EI=function(t,e){try{return function(t,e){var n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector;return!!n&&n.call(t,e)}(t,e)}catch(t){return I().error(J,"Failed to test query match:",t),!1}},t}();function ot(t,e,n,i){var r=t,o=n,s=function(t){try{return o(t)}catch(t){var e,n;throw null===(e=(n=self).__AMP_REPORT_ERROR)||void 0===e||e.call(n,t),t}},a=function(){if(void 0!==nt)return nt;nt=!1;try{var t={get capture(){return nt=!0,!1}};self.addEventListener("test-options",null,t),self.removeEventListener("test-options",null,t)}catch(t){}return nt}(),u=!(null==i||!i.capture);return r.addEventListener(e,s,a?i:u),function(){null==r||r.removeEventListener(e,s,a?i:u),o=null,r=null,s=null}}function st(t,e,n,i){return ot(t,e,n,i)}function at(t){return t.data}function ut(t,e,n,i){var r=n,o=ot(t,e,function(t){try{r(t)}finally{r=null,o()}},i);return o}var ht=function(){function t(t,e){this.win=t,this.H=e,this.SI()}var e=t.prototype;return e.SI=function(){st(this.win.document,"focusin",this.AI.bind(this),{capture:!1})},e.AI=function(t){t.defaultPrevented||this.H.sendRequest(t.type,{focusTargetRect:t.target.getBoundingClientRect()},!1)},t}();function ct(t){return"loading"!=t.readyState&&"uninitialized"!=t.readyState}function lt(t,e,n){return 0==e&&0==n||0==t.width&&0==t.height?t:{left:i=t.left+e,top:r=t.top+n,width:o=t.width,height:s=t.height,bottom:r+s,right:i+o,x:i,y:r};var i,r,o,s}var ft=function(){function t(t){this.II=t,this._I=[],this.dr=0}var e=t.prototype;return e.push=function(t){this._I[this.dr]=t,this.dr=(this.dr+1)%this.II},e.get=function(t){return this._I.length>=this.II&&(t=(this.dr+t)%this.II),this._I[t]},e.size=function(){return this._I.length},t}();function dt(t){return t.node.wholeText[t.offset]}var vt=/[,.\s\u2022()]/;function pt(t){return"’"==t||"‘"==t?"'":"“"==t||"”"==t?'"':t.toLowerCase()}function mt(t){for(var e=[],n=0;n<t.length;n++){var i=t[n];vt.test(i)||e.push(pt(i))}return e.join("")}var gt=function(){function t(t,e){this.MI=t,this.OI=e,this.matches=[],this.CI={},this.TI=t.length-1;for(var n=0;n<t.length;n++){var i=t[n];this.CI[i]=t.length-1-n}}return t.prototype.update=function(){if(this.TI>0)this.TI--;else{for(var t=this.OI,e=this.MI,n=t.size(),i=0;i<e.length;i++){var r=pt(dt(t.get(n-1-i).pos));if(e[e.length-1-i]!=r){var o=this.CI[r];return null==o&&(o=e.length),(o-=i)<1&&(o=1),void(this.TI=o-1)}}var s=t.get(n-1),a=s.pos;this.matches.push({start:t.get(n-e.length),end:{pos:{node:a.node,offset:a.offset+1},idx:s.idx+1}})}},t}();function It(t,e,n,i){for(var r=n;r<i.length;r++){var o=i[r];if(t.node!=o.start.node)return;if(o.start.node=e,o.start.offset-=t.offset,t.node!=o.end.node)return;o.end.node=e,o.end.offset-=t.offset}}function yt(t,e,n,i,r,o){for(;;){if(e.node==n.node){var s=wt(t,e.node,e.offset,n.offset,o);return void(s&&It(n,s,r+1,i))}var a=bt(t,e.node);if(wt(t,e.node,e.offset,e.node.wholeText.length,o),!a)break;e={node:a,offset:0}}}function wt(t,e,n,i,r){if(n>=i)return null;var o=t.document,s=e.parentNode,a=e.wholeText;n>0&&s.insertBefore(o.createTextNode(a.substring(0,n)),e);var u=o.createElement("span");u.appendChild(o.createTextNode(a.substring(n,i))),s.insertBefore(u,e),r.push(u);var h=null;return i<a.length&&(h=o.createTextNode(a.substring(i)),s.insertBefore(h,e)),s.removeChild(e),h}function bt(t,e){for(var n=!0,i=e;;){if(null==i)return null;if(n){var r=i.nextSibling;r?(i=r,n=!1):i=i.parentNode}else{if(i instanceof t.Text)return i;i.firstChild?i=i.firstChild:n=!0}}}var _t=function(){function t(e,n){if(this.t=e,this.NI=n,this.RI=-1,this.UI=null,n instanceof e.Text)this.RI=0;else if(n instanceof e.Element){if("none"==U(e,n).display)return;var i=n.firstChild;null!=i&&(this.UI=new t(e,i))}}var e=t.prototype;return e.next=function(){if(this.RI>=0)return this.jI();for(;null!=this.UI;){var e=this.UI.next();if(null!=e)return e;var n=this.UI.NI.nextSibling;this.UI=null!=n?new t(this.t,n):null}return null},e.jI=function(){var t=this.NI.wholeText;if(this.RI<t.length){var e=this.RI;return this.RI++,{node:this.NI,offset:e}}return null},t}(),xt=function(){function t(t,e){var n=this;this.vu=t,this.yh=M(t),this.Th=P(this.vu),this.qI=null;var i,r=k(this.vu.win);"fragmentDirective"in document&&r.isChrome()&&r.getMajorVersion()>=93?t.whenFirstVisible().then(function(){return n.zI(e)}):(i=t.win.document,new Promise(function(t){!function(t,e){!function(t,e,n){var i=e(t);i?n(t):t.addEventListener("readystatechange",function r(){e(t)&&(i||(i=!0,n(t)),t.removeEventListener("readystatechange",r))})}(t,ct,e)}(i,t)})).then(function(){n.LI(e)})}var e=t.prototype;return e.zI=function(t){var e=t.sentences;if(null!=e&&e.length){var n=e.map(function(t){return"text="+encodeURIComponent(t)}).join("&");this.YI(n)}},e.YI=function(t){var e=this.vu.win.location.hash;e?this.vu.win.location.replace(e+":~:"+t):this.vu.win.location.replace("#:~:"+t)},e.FI=function(t,e){var n={state:t};for(var i in e)n[i]=e[i];this.yh.sendMessage("highlightState",n)},e.KI=function(t){var e=this.vu.win,n=function(t,e,n){if(n=function(t){for(var e=[],n=0;n<t.length;n++){var i=mt(t[n]);i&&e.push(i)}return e}(n),n.length<=0)return null;for(var i=new _t(t,e),r=new ft(n.map(function(t){return t.length}).reduce(function(t,e){return Math.max(t,e)})),o=[new gt(n[0],r)],s=-1;;){s++;var a=i.next();if(null==a)return null;if(!vt.test(dt(a))){r.push({pos:a,idx:s});for(var u=0;u<o.length;u++)o[u].update();if(0!=o[o.length-1].matches.length){if(o.length==n.length)break;o.push(new gt(n[o.length],r))}}}var h=[];t:for(var c=n.length-1;c>=0;c--){var l=o[c].matches;if(0!=h.length){for(var f=h[h.length-1],d=l.length-1;d>=0;d--){var v=l[d];if(f.start.idx>=v.end.idx){h.push(v);continue t}}y(!1)}else h.push(l[l.length-1])}for(var p=[],m=h.length-1;m>=0;m--){var g=h[m];p.push({start:g.start.pos,end:g.end.pos})}return p}(e,this.vu.getBody(),t.sentences);if(n){var i=function(t,e){e=function(t){for(var e=[],n=null,i=0;i<t.length;i++){var r=t[i];n&&n.end.node==r.start.node&&n.end.offset==r.start.offset?n.end=r.end:(n=r,e.push(r))}return e}(e);for(var n=[],i=0;i<e.length;i++){var r=e[i];yt(t,r.start,r.end,e,i,n)}return n}(e,n);i&&0!=i.length&&(this.qI=i)}},e.onVisibleOnce=function(t){var e,n,i,r=this;e=!1,n=null,i=t,t=function(){if(!e){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];n=i.apply(self,r),e=!0,i=null}return n},this.vu.onVisibilityChanged(function(){"visible"==r.vu.getVisibilityState()&&t()})},e.LI=function(t){var e=this;if(this.vu.win.document.querySelector('script[id="amp-access"]'))this.FI("has_amp_access");else if(this.KI(t),this.qI){var n=this.XI();if(this.FI("found",{scroll:n}),!t.skipRendering){for(var i=0;i<this.qI.length;i++)V(this.qI[i],{backgroundColor:"#fcff00",color:"#000"});var r=this.vu.getVisibilityState();t.skipScrollAnimation?"visible"==r?this.DI(n):(this.Th.setScrollTop(n),this.onVisibleOnce(function(){e.DI(e.XI())})):"visible"==r?this.VI(n):(this.HI(n),this.onVisibleOnce(function(){e.VI(e.XI())})),ut(this.vu.getBody(),"click",this.JI.bind(this))}}else this.FI("not_found")},e.XI=function(){var t=this.qI;if(!t)return 0;for(var e=this.Th,n=Number.MAX_VALUE,i=0,r=e.getPaddingTop(),o=0;o<t.length;o++){var s=lt(e.getLayoutRect(t[o]),0,-r),a=s.bottom,u=s.top;n=Math.min(n,u),i=Math.max(i,a)}if(n>=i)return 0;var h=(i+n-(e.getHeight()-r))/2;return h>n-80&&(h=n-80),h>0?h:0},e.DI=function(t){this.FI("auto_scroll"),this.Th.setScrollTop(t),this.FI("shown")},e.HI=function(t){var e=Math.max(0,t-500);this.Th.setScrollTop(e)},e.BI=function(t){var e=this.XI(),n=this.Th.getScrollTop();if(n==e&&n==t)return null;var i={};return n!=e&&(this.Th.setScrollTop(e),i.nd=n-e),n!=t&&(i.od=n-t),i},e.VI=function(t){var e=this;this.HI(t);var n=this.vu.win.document.createElement("div");D(n,"block"),V(n,{position:"absolute",top:Math.floor(t)+"px",height:"1px",left:"0",width:"1px","pointer-events":"none"});var i=this.vu.getBody();i.appendChild(n),this.FI("auto_scroll"),this.Th.animateScrollIntoView(n).then(function(){i.removeChild(n),e.FI("shown",e.BI(t))})},e.setupMessaging=function(t){t.registerHandler("highlightDismiss",this.JI.bind(this))},e.JI=function(){if(this.qI)for(var t=0;t<this.qI.length;t++)j(this.qI[t],["backgroundColor","color"])},t}(),Et=["key","code","location","ctrlKey","shiftKey","altKey","metaKey","repeat","isComposing","charCode","keyCode","which"],At=function(){function t(t,e){this.win=t,this.H=e,this.GI()}var e=t.prototype;return e.GI=function(){var t=this.WI.bind(this);st(this.win,"keydown",t),st(this.win,"keypress",t),st(this.win,"keyup",t)},e.WI=function(t){(function(t){if(t.defaultPrevented)return!0;if("Escape"==t.key)return!1;switch(t.target.nodeName){case"INPUT":return"checkbox"!=t.target.type||" "==t.key;case"TEXTAREA":case"BUTTON":case"SELECT":case"OPTION":return!0}return t.target.hasAttribute&&t.target.hasAttribute("contenteditable")})(t)||this.AI(t)},e.AI=function(t){this.H.sendRequest(t.type,function(t){var e={};return Et.forEach(function(n){void 0!==t[n]&&(e[n]=t[n])}),e}(t),!1)},t}(),St="amp-viewer-messaging",Ct="channelOpen",kt="__AMPHTML__";function Mt(t){if("string"!=typeof t)return t;if("{"!=t.charAt(0))return null;try{return JSON.parse(t)}catch(t){return null}}var Pt,Tt,Ot=function(){function t(t,e,n){this.t=t,this.i=e,this.h=n}var e=t.prototype;return e.addEventListener=function(t,e){var n=this;this.t.addEventListener("message",function(t){t.origin==n.i&&t.source==n.h&&e(t)})},e.postMessage=function(t){var e="null"===this.i?"*":this.i;this.h.postMessage(t,e)},e.start=function(){},t}(),Rt=function(){function t(t,e,n,i,r){this.t=t,this.o=e,this.u=!!n,this.l=i||null,this.v=!!r,this.p=0,this.g={},this.m={},this.q=null,this.o.addEventListener("message",this._.bind(this)),this.o.start()}t.initiateHandshakeWithDocument=function(e,n){return new Promise(function(i){var r=setInterval(function(){var o=new MessageChannel,s={app:kt,name:"handshake-poll"};e.postMessage(s,"*",[o.port2]);var a=o.port1;a.addEventListener("message",function e(o){var s=Mt(o.data);if(s&&s.app===kt&&s.name===Ct){clearInterval(r),a.removeEventListener("message",e);var u=new t(null,a,!1,n,!0);u.M(s.requestid,Ct,null),i(u)}}),a.start()},1e3)})},t.waitForHandshakeFromDocument=function(e,n,i,r,o){return new Promise(function(s){e.addEventListener("message",function a(u){var h=Mt(u.data);if(h&&(u.origin==i||o&&o.test(u.origin))&&(!u.source||u.source==n)&&h.app===kt&&h.name===Ct){e.removeEventListener("message",a);var c=new t(null,new Ot(e,u.origin,n),!1,r,!0);c.M(h.requestid,Ct,null),s(c)}})})};var e=t.prototype;return e.registerHandler=function(t,e){this.m[t]=e},e.unregisterHandler=function(t){delete this.m[t]},e.setDefaultHandler=function(t){this.q=t},e._=function(t){var e=Mt(t.data);e&&e.app===kt&&(this.l&&this.v&&e.messagingToken!==this.l?this.O(St+": handleMessage_ error: ","invalid token"):"q"===e.type?this.P(e):"s"===e.type&&this.R(e))},e.sendRequest=function(t,e,n){var i=this,r=++this.p,o=void 0;return n&&(o=new Promise(function(t,e){i.g[r]={resolve:t,reject:e}})),this.S({app:kt,requestid:r,type:"q",name:t,data:e,rsvp:n}),o},e.M=function(t,e,n){this.S({app:kt,requestid:t,type:"s",name:e,data:n})},e.k=function(t,e,n){var i=this.j(n);this.O(St+": sendResponseError_, message name: "+e,i),this.S({app:kt,requestid:t,type:"s",name:e,data:null,error:i})},e.S=function(t){var e=Object.assign(t,{});this.l&&!this.v&&(e.messagingToken=this.l),this.o.postMessage(this.u?JSON.stringify(e):e)},e.P=function(t){var e=this,n=this.m[t.name];if(n||(n=this.q),!n){var i=new Error("Cannot handle request because no default handler is set!");throw i.args=t.name,i}var r=n(t.name,t.data,!!t.rsvp);if(t.rsvp){var o=t.requestid;if(!r)throw this.k(o,t.name,new Error("no response")),new Error("expected response but none given: "+t.name);r.then(function(n){e.M(o,t.name,n)},function(n){e.k(o,t.name,n)})}},e.R=function(t){var e=t.requestid,n=this.g[e];n&&(delete this.g[e],t.error?(this.O(St+": handleResponse_ error: ",t.error),n.reject(new Error("Request ".concat(t.name," failed: ").concat(t.error)))):n.resolve(t.data))},e.O=function(t,e){if(this.t){var n="amp-messaging-error-logger: "+t;n+=" data: "+this.j(e),this.t.viewerState=n}},e.j=function(t){return t?t.message?t.message:String(t):"unknown error"},t}(),Nt=["altKey","charCode","ctrlKey","detail","eventPhase","key","layerX","layerY","metaKey","pageX","pageY","returnValue","shiftKey","timeStamp","type","which"],Lt=["clientX","clientY","force","identifier","pageX","pageY","radiusX","radiusY","screenX","screenY"],qt=function(){function t(t,e){this.win=t,this.H=e,this.ZI=!1,this.$I=[],e.registerHandler("scrollLock",this.QI.bind(this)),this.E_()}var e=t.prototype;return e.E_=function(){var t=this.WI.bind(this),e=this.win.document,n={capture:!1,passive:!this.ZI};this.$I.push(st(e,"touchstart",t,n),st(e,"touchend",t,n),st(e,"touchmove",t,n))},e.rg=function(){this.$I.forEach(function(t){return t()}),this.$I.length=0},e.WI=function(t){switch(t.type){case"touchstart":case"touchend":case"touchmove":this.I_(t);break;default:return}},e.I_=function(t){if(null!=t&&t.shouldViewerCancelPropagation)t.stopImmediatePropagation();else{if(t&&t.type){var e=this.__(t);this.H.sendRequest(t.type,e,!1)}this.ZI&&t.cancelable&&t.preventDefault()}},e.__=function(t){var e=this.M_(t,Nt);return t.touches&&(e.touches=this.O_(t.touches)),t.changedTouches&&(e.changedTouches=this.O_(t.changedTouches)),e},e.O_=function(t){for(var e=[],n=0;n<t.length;n++)e.push(this.M_(t[n],Lt));return e},e.M_=function(t,e){for(var n={},i=0;i<e.length;i++){var r=e[i];void 0!==t[r]&&(n[r]=t[r])}return n},e.QI=function(t,e,n){return this.ZI=!!e,this.rg(),this.E_(),n?Promise.resolve({}):void 0},t}(),Ft=function(){function t(t){this.zt=t,this.It=0,this.Ct=0,this.Ot=u()}var e=t.prototype;return e.has=function(t){return!!this.Ot[t]},e.get=function(t){var e=this.Ot[t];if(e)return e.access=++this.Ct,e.payload},e.put=function(t,e){this.has(t)||this.It++,this.Ot[t]={payload:e,access:this.Ct},this.qt()},e.qt=function(){if(!(this.It<=this.zt)){var t,e=this.Ot,n=this.Ct+1;for(var i in e){var r=e[i].access;r<n&&(n=r,t=i)}void 0!==t&&(delete e[t],this.It--)}},t}(),Vt=self.AMP.config.urls,Dt=new Set(["c","v","a","ad"]),Ut=function(t){return"string"==typeof t?function(t){return Pt||(Pt=self.document.createElement("a"),Tt=self.__AMP_URL_CACHE||(self.__AMP_URL_CACHE=new Ft(100))),function(t,e,n){if(n&&n.has(e))return n.get(e);t.href=e,t.protocol||(t.href=t.href);var i,r={href:t.href,protocol:t.protocol,host:t.host,hostname:t.hostname,port:"0"==t.port?"":t.port,pathname:t.pathname,search:t.search,hash:t.hash,origin:null};"/"!==r.pathname[0]&&(r.pathname="/"+r.pathname),("http:"==r.protocol&&80==r.port||"https:"==r.protocol&&443==r.port)&&(r.port="",r.host=r.hostname),i=t.origin&&"null"!=t.origin?t.origin:"data:"!=r.protocol&&r.host?r.protocol+"//"+r.host:r.href,r.origin=i;var o=r;return n&&n.put(e,o),o}(Pt,t,Tt)}(t):t},jt="amp-viewer-integration";new(function(){function t(t){this.win=t,this.C_=!1,this.P_=!1,this.N_=null}var e=t.prototype;return e.init=function(){var t=this;I().fine(jt,"handshake init()");var e=x(this.win.document),n=M(e);this.C_="1"==n.getParam("webview"),this.P_=n.hasCapability("handshakepoll");var i,o=n.getParam("messagingToken"),s=n.getParam("origin")||"";if(!this.C_&&!s)return r();if(P(e).createFixedLayer(it),this.C_||this.P_){var a=(i=this.win).parent&&i.parent!=i?this.win.parent:null;return this.R_(a,s).then(function(i){return t.U_(n,e,s,new Rt(t.win,i,t.C_,o))})}var h=function(t){var e=function(t){var e,n=u();if(!t)return n;for(;e=c.exec(t);){var i=l(e[1],e[1]),r=e[2]?l(e[2].replace(/\+/g," "),e[2]):"";n[i]=r}return n}(t.win.location.hash).highlight;if(!e||e.length>102400)return null;var n,i=(n=e,JSON.parse(n)),r=i.s;if(!(r instanceof Array)||r.length>15)return null;for(var o=0,s=0;s<r.length;s++){var a=r[s];if("string"!=typeof a||!a)return null;if((o+=a.length)>1500)return null}var h=!1;i.n&&(h=!0);var f=!1;return i.na&&(f=!0),{sentences:r,skipScrollAnimation:f,skipRendering:h}}(e);h&&(this.N_=new xt(e,h));var f=new Ot(this.win,s,this.win.parent);return this.U_(n,e,s,new Rt(this.win,f,this.C_,o))},e.R_=function(t,e){var n=this;return new Promise(function(i){var r=st(n.win,"message",function(o){I().fine(jt,"AMPDOC got a pre-handshake message:",o.type,at(o));var s=Mt(at(o));if(s&&o.origin===e&&o.source===t&&"__AMPHTML__"==s.app&&"handshake-poll"==s.name){if(n.C_&&(!o.ports||!o.ports.length))throw new Error("Did not receive communication port from the Viewer!");var a=o.ports&&o.ports.length>0?o.ports[0]:new Ot(n.win,e,n.win.parent);i(a),r()}})})},e.U_=function(t,e,n,i){var r=this;I().fine(jt,"Send a handshake request");var o=e.getUrl(),s=function(t){if(!function(t){return Vt.cdnProxyRegex.test(Ut(t).origin)}(t=Ut(t)))return t.href;var e=t.pathname.split("/"),n=e[1];w(Dt.has(n),"Unknown path prefix in url %s",t.href);var i=e[2],r="s"==i?"https://"+decodeURIComponent(e[3]):"http://"+decodeURIComponent(i);return w(r.indexOf(".")>0,"Expected a . in origin %s",r),e.splice(1,"s"==i?3:2),r+e.join("/")+function(t){if(!t||"?"==t)return"";var e=new RegExp("[?&]".concat("(amp_(js[^&=]*|gsa|r|kit)|usqp)","\\b[^&]*"),"g"),n=t.replace(e,"").replace(/^[?&]/,"");return n?"?"+n:""}(t.search)+(t.hash||"")}(o);return i.sendRequest("channelOpen",{url:o,sourceUrl:s},!0).then(function(){I().fine(jt,"Channel has been opened!"),r.Am(i,t,n)})},e.Am=function(t,e,n){t.setDefaultHandler(function(t,n,i){return e.receiveMessage(t,n,i)}),e.setMessageDeliverer(t.sendRequest.bind(t),n),ut(this.win,"unload",this.j_.bind(this,t)),(e.hasCapability("swipe")||e.hasCapability("touch"))&&this.q_(t),e.hasCapability("keyboard")&&this.z_(t),e.hasCapability("focus-rect")&&this.L_(t),null!=this.N_&&this.N_.setupMessaging(t)},e.j_=function(t){return t.sendRequest("unloaded",{},!0)},e.L_=function(t){new ht(this.win,t)},e.q_=function(t){new qt(this.win,t)},e.z_=function(t){new At(this.win,t)},t}())(t.win).init()}()}});