var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opens = _____WB$wombat$assign$function_____("opens");
(self.AMP=self.AMP||[]).push({m:0,v:"2111060251009",n:"amp-auto-ads",ev:"0.1",l:true,f:function(AMP,_){"use strict";var f;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function m(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}var ba="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b};function ca(a){for(var b=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global],c=0;c<b.length;++c){var d=b[c];if(d&&d.Math==Math)return}(function(){throw Error("Cannot find global object")})()}ca(this);"function"===typeof Symbol&&Symbol("x");var n;if("function"==typeof Object.setPrototypeOf)n=Object.setPrototypeOf;else{var r;a:{var da={a:!0},t={};try{t.__proto__=da;r=t.a;break a}catch(a){}r=!1}n=r?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var x,w=n;function ea(){var a=this;this.promise=new Promise((function(b,c){a.resolve=b;a.reject=c}))}function fa(a){return new Promise((function(b){b(a())}))}var ha=Object.prototype.toString;function y(a){return a||{}}var A=Array.isArray;function B(a,b){var c=a.length-b.length;return 0<=c&&a.indexOf(b,c)==c}var ia=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function C(a,b){var c=b=void 0===b?"":b;try{return decodeURIComponent(a)}catch(d){return c}}function E(a){var b=Object.create(null);if(!a)return b;for(var c;c=ia.exec(a);){var d=C(c[1],c[1]);c=c[2]?C(c[2].replace(/\+/g," "),c[2]):"";b[d]=c}return b}var F=self.AMP_CONFIG||{},ja=("string"==typeof F.cdnProxyRegex?new RegExp(F.cdnProxyRegex):F.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/;function G(a){if(self.document&&self.document.head&&(!self.location||!ja.test(self.location.origin))){var b=self.document.head.querySelector('meta[name="'+a+'"]');b&&b.getAttribute("content")}}F.cdnUrl||G("runtime-host");F.geoApiUrl||G("amp-geo-api");self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var I=self.__AMP_LOG;function J(){throw Error("failed to call initLogConstructor")}function K(){I.user||(I.user=J());return I.user}function ka(a,b){K().assert(a,b,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}function L(a,b){a=a.__AMP_TOP||(a.__AMP_TOP=a);return la(a,b)}function M(a,b){var c=ma(a);c=ma(c);c=c.isSingleDoc()?c.win:c;return la(c,b)}function ma(a){return a.nodeType?L((a.ownerDocument||a).defaultView,"ampdoc").getAmpDoc(a):a}function la(a,b){var c=a.__AMP_SERVICES;c||(c=a.__AMP_SERVICES={});a=c[b];a.obj||(a.obj=new a.ctor(a.context),a.context=null,a.resolve&&a.resolve(a.obj));return a.obj}function na(a){if(a.__AMP__EXPERIMENT_TOGGLES)return a.__AMP__EXPERIMENT_TOGGLES;a.__AMP__EXPERIMENT_TOGGLES=Object.create(null);var c,d,e,h,b=a.__AMP__EXPERIMENT_TOGGLES,g=Object.assign({},null!=(d=a.AMP_CONFIG)?d:{},null!=(e=a.AMP_EXP)?e:JSON.parse((null==(c=a.__AMP_EXP)?void 0:c.textContent)||"{}"));for(h in g){var k=g[h];"number"===typeof k&&0<=k&&1>=k&&(b[h]=Math.random()<k)}var l,p=null==(l=a.AMP_CONFIG)?void 0:l["allow-doc-opt-in"];if(A(p)&&p.length){var u=a.document.head.querySelector('meta[name="amp-experiments-opt-in"]');if(u){var z=u.getAttribute("content").split(",");d=m(z);for(c=d.next();!c.done;c=d.next()){var H=c.value;p.includes(H)&&(b[H]=!0)}}}c=Object;d=c.assign;e="";try{"localStorage"in a&&(e=a.localStorage.getItem("amp-experiment-toggles"))}catch(Za){(I.dev||(I.dev=J())).warn("EXPERIMENTS","Failed to retrieve experiments from localStorage.")}var q;e=(null==(q=e)?void 0:q.split(/\s*,\s*/g))||[];q=Object.create(null);e=m(e);for(h=e.next();!h.done;h=e.next())(h=h.value)&&("-"==h[0]?q[h.substr(1)]=!1:q[h]=!0);d.call(c,b,q);var v,D=null==(v=a.AMP_CONFIG)?void 0:v["allow-url-opt-in"];if(A(D)&&D.length)for(a=E(a.location.originalHash||a.location.hash),v=m(D),c=v.next();!c.done;c=v.next())q=c.value,c=a["e-"+q],"1"==c&&(b[q]=!0),"0"==c&&(b[q]=!1);return b}
/* https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
var N;function oa(a,b){if(void 0!==N)var c=N;else{try{var d=a.ownerDocument,e=d.createElement("div"),g=d.createElement("div");e.appendChild(g);c=e.querySelector(":scope div")===g}catch(h){c=!1}c=N=c}c?a=a.querySelectorAll(b.replace(/^|,/g,"$&:scope ")):(a.classList.add("i-amphtml-scoped"),b=b.replace(/^|,/g,"$&.i-amphtml-scoped "),b=a.querySelectorAll(b),a.classList.remove("i-amphtml-scoped"),a=b);return a}function pa(a,b){for(;a&&void 0!==a;a=a.parentElement)if(b(a))return a;return null}function qa(a,b){return a.closest?a.closest(b):pa(a,(function(c){var d=c.matches||c.webkitMatchesSelector||c.mozMatchesSelector||c.msMatchesSelector||c.oMatchesSelector;return d?d.call(c,b):!1}))}function O(a,b,c){a=a.createElement(b);for(var d in c)a.setAttribute(d,c[d]);return a}function P(a){return M(a,"documentInfo").get()}function Q(a){return M(a,"viewport")}function R(a,b){for(var c=[],d=4096-a.length,e=Object.keys(b),g=0;g<e.length;g++){var h=e[g],k=b[h];if(null!=k&&""!==k){var l=encodeURIComponent(h)+"=",p=encodeURIComponent(String(k)),u=l.length+p.length+1;if(u>d){var z=p.substr(0,d-l.length-1).replace(/%\w?$/,"");z&&c.push(l+z);break}c.push(l+p);d-=u}}return c.length?a+"?"+c.join("&"):a}function S(){this.P=100;this.G=this.I=0;this.F=Object.create(null)}S.prototype.has=function(a){return!!this.F[a]};S.prototype.get=function(a){var b=this.F[a];if(b)return b.access=++this.G,b.payload};S.prototype.put=function(a,b){this.has(a)||this.I++;this.F[a]={payload:b,access:this.G};if(!(this.I<=this.P)){a=this.F;var d,c=this.G+1;for(d in a){var e=a[d].access;if(e<c){c=e;var g=d}}void 0!==g&&(delete a[g],this.I--)}};new Set(["c","v","a","ad"]);var T,ra;function sa(a){T||(T=self.document.createElement("a"),ra=self.__AMP_URL_CACHE||(self.__AMP_URL_CACHE=new S));var b=T,c=ra;if(c&&c.has(a))a=c.get(a);else{b.href=a;b.protocol||(b.href=b.href);var d={href:b.href,protocol:b.protocol,host:b.host,hostname:b.hostname,port:"0"==b.port?"":b.port,pathname:b.pathname,search:b.search,hash:b.hash,origin:null};"/"!==d.pathname[0]&&(d.pathname="/"+d.pathname);if("http:"==d.protocol&&80==d.port||"https:"==d.protocol&&443==d.port)d.port="",d.host=d.hostname;d.origin=b.origin&&"null"!=b.origin?b.origin:"data:"!=d.protocol&&d.host?d.protocol+"//"+d.host:d.href;c&&c.put(a,d);a=d}return a}function ta(a){this.j=a}f=ta.prototype;f.isEnabled=function(){return!0};f.isResponsiveEnabled=function(){return!0};f.getConfigUrl=function(){var a=P(this.j),b=sa(a.canonicalUrl).hostname;var c=this.j;c=(c.ownerDocument||c).defaultView;return R("https://pagead2.googlesyndication.com/getconfig/ama",{client:this.j.getAttribute("data-ad-client"),plah:b,ama_t:"amp",url:a.canonicalUrl,debug_experiment_id:(/(?:#|,)deid=([\d,]+)/i.exec(c.location.hash)||[])[1]||null})};f.getAttributes=function(){var a=y({type:"adsense","data-ad-client":this.j.getAttribute("data-ad-client")}),b=this.j.getAttribute("data-ad-host"),c=this.j.getAttribute("data-ad-host-channel");b&&(a["data-ad-host"]=b,c&&(a["data-ad-host-channel"]=c));return a};f.getDefaultAdConstraints=function(){var a=Q(this.j).getSize().height;return{initialMinSpacing:a,subsequentMinSpacing:[{adCount:3,spacing:2*a},{adCount:6,spacing:3*a}],maxAdCount:8}};f.getSizing=function(){return{}};function ua(a){this.j=a}f=ua.prototype;f.isEnabled=function(){return!0};f.isResponsiveEnabled=function(){return!1};f.getConfigUrl=function(){var a=P(this.j),b=this.j.getAttribute("data-publisher-id"),c=this.j.getAttribute("data-page-type"),d=this.j.getAttribute("data-content-category")||"";return R("https://analytics.alright.network/amp/",{p:b,t:c,c:d,u:a.canonicalUrl,w:window.screen.width,h:window.screen.height})};f.getAttributes=function(){return y({width:300,height:250,layout:"responsive","data-multi-size-validation":"false",type:"doubleclick","data-ad":"alright"})};f.getDefaultAdConstraints=function(){var a=Q(this.j).getSize().height;return{initialMinSpacing:a,subsequentMinSpacing:[{adCount:3,spacing:2*a},{adCount:6,spacing:3*a}],maxAdCount:8}};f.getSizing=function(){return{width:300,height:250}};function va(a){this.j=a}f=va.prototype;f.isEnabled=function(){return!0};f.isResponsiveEnabled=function(){return!0};f.getConfigUrl=function(){var a=P(this.j),b=this.j.getAttribute("data-account-id");if(b)return R("https://v3.denakop.com/ad-request",{a:b,v:"amp",u:a.canonicalUrl});var c=this.j.getAttribute("data-publisher-id"),d=this.j.getAttribute("data-tag-id");return R("https://v2.denakop.com/ad-request/amp",{p:c,t:d,u:a.canonicalUrl})};f.getAttributes=function(){return y({"data-multi-size-validation":"false",type:"doubleclick","data-ad":"denakop",style:"position:relative !important"})};f.getDefaultAdConstraints=function(){var a=Q(this.j).getSize().height;return{initialMinSpacing:a,subsequentMinSpacing:[{adCount:4,spacing:2*a},{adCount:8,spacing:3*a}],maxAdCount:20}};f.getSizing=function(){return{}};function wa(a){this.j=a}f=wa.prototype;f.isEnabled=function(){return!0};f.isResponsiveEnabled=function(){return!1};f.getConfigUrl=function(){var a=P(this.j),b=sa(a.canonicalUrl).hostname;return R("https://pagead2.googlesyndication.com/getconfig/ama",{client:this.j.getAttribute("data-ad-legacy-client"),plah:b,ama_t:"amp",url:a.canonicalUrl})};f.getAttributes=function(){return y({type:"doubleclick","data-slot":this.j.getAttribute("data-slot"),json:this.j.getAttribute("data-json")})};f.getDefaultAdConstraints=function(){var a=Q(this.j).getSize().height;return{initialMinSpacing:a,subsequentMinSpacing:[{adCount:3,spacing:2*a},{adCount:6,spacing:3*a}],maxAdCount:8}};f.getSizing=function(){var a=this.j.getAttribute("data-experiment");try{var b=JSON.parse(a)}catch(d){b=null}var c=b;return c?{height:c.height?Number(c.height):250,width:c.width?Number(c.width):void 0}:{}};function xa(a){this.j=a;this.pvid64=0}f=xa.prototype;f.isEnabled=function(){return!0};f.isResponsiveEnabled=function(){return!1};f.getConfigUrl=function(){var a=this,b=0;P(this.j).pageViewId64.then((function(D){a.pvid64=D}));var c=window.location,d=c.host,e=c.pathname,g=c.search;c=Object.assign(E(c.hash),E(g));g=P(this.j);var h=e.match(/amp\/fi\/(\d+)\//);null!=h&&2==h.length&&(b=h[1]);var k=c.fi_reveal,l=c.fi_demand,p=c.fi_geo,u=c.disable_fi,z=c.fi_cdnhost||(b?d:"cdn.firstimpression.io"),H=c.fi_cdnpath||(b?"/amp-preview.php":"/delivery/amp.php"),q=this.j.getAttribute("data-website-id"),v=this.j.getAttribute("data-targeting");e={id:q,url:g.canonicalUrl,w:window.screen.width,h:window.screen.height};v&&(e.targeting=v);void 0!==k&&(e.fi_reveal=k);void 0!==l&&(e.fi_demand=l);p&&(e.fi_geo=p);u&&(e.disable_fi=u);b&&(e.preview_id=b);return R("https://"+z+H,e)};f.getAttributes=function(){return y({type:"firstimpression","data-pvid64":this.pvid64})};f.getDefaultAdConstraints=function(){var a=Q(this.j).getSize().height;return{initialMinSpacing:a,subsequentMinSpacing:[{adCount:3,spacing:2*a},{adCount:6,spacing:3*a}],maxAdCount:8}};f.getSizing=function(){return{height:1}};function ya(a){this.j=a}f=ya.prototype;f.isEnabled=function(){return!0};f.isResponsiveEnabled=function(){return!1};f.getConfigUrl=function(){var a=this.j.dataset;return R((a.host||"https://tags.premiumads.com.br")+"/autoads/"+a.publisher,{})};f.getAttributes=function(){var a=this.j.dataset;return y({type:"doubleclick","data-ad":"premiumads",layout:a.layout||"fixed",style:a.style||"margin: 15px auto; position: relative !important; display: block !important;"})};f.getDefaultAdConstraints=function(){var a=Q(this.j).getSize().height;return{initialMinSpacing:a,subsequentMinSpacing:[{adCount:3,spacing:2*a},{adCount:6,spacing:3*a}],maxAdCount:8}};f.getSizing=function(){return{}};function za(a){this.j=a}f=za.prototype;f.isEnabled=function(){var a=this.j.getAttribute("data-website-id");return!(!a||!a.match(/^[0-9]+$/))};f.isResponsiveEnabled=function(){return!0};f.getConfigUrl=function(){var a=P(this.j),b=this.j.getAttribute("data-website-id");return R("https://api.bounceexchange.com/bounce/amp",{w_id:b,calling_url:a.sourceUrl})};f.getAttributes=function(){return y({type:"wunderkind","data-ad":"wunderkind",layout:"responsive",height:"250",width:"250"})};f.getDefaultAdConstraints=function(){var a=Q(this.j).getSize().height;return{initialMinSpacing:a,subsequentMinSpacing:[{adCount:3,spacing:2*a},{adCount:6,spacing:3*a}],maxAdCount:8}};f.getSizing=function(){return{}};function Aa(a,b){return"adsense"==a?new ta(b):"alright"==a?new ua(b):"denakop"==a?new va(b):"doubleclick"==a?new wa(b):"firstimpression.io"==a?new xa(b):"premiumads"==a?new ya(b):"wunderkind"==a?new za(b):null}function Ba(a){a.tagName.startsWith("AMP-");if(a.createdCallback)return Promise.resolve(a);if(!a.__AMP_UPG_PRM){var b=new ea;a.__AMP_UPG_PRM=b.promise;a.__AMP_UPG_RES=b.resolve}return a.__AMP_UPG_PRM}var Ca={type:!0,"rtc-config":!0,layout:!0,height:!0,width:!0,sticky:!0};function U(a,b){if(!a[b])return{};if("[object Object]"!==ha.call(a[b])||A(a[b]))return K().warn("amp-auto-ads",b+" property not an object"),{};b=a[b];var d,c={};for(d in b)if(Ca[d]||d.startsWith("data-")){var e=typeof b[d];"number"!=e&&"string"!=e&&"boolean"!=e?K().warn("amp-auto-ads","Attribute type not supported: "+e):c[d]=String(b[d])}else K().warn("amp-auto-ads","Attribute not whitlisted: "+d);return c}function Da(a){return L((a.ownerDocument||a).defaultView,"vsync").measurePromise((function(){for(var b=a.ownerDocument.body,c=0,d=0,e=a;e&&e!=b;e=e.offsetParent)c+=e.offsetLeft,d+=e.offsetTop;b=a.offsetWidth;e=a.offsetHeight;return{left:c,top:d,width:b,height:e,bottom:d+e,right:c+b,x:c,y:d}}))}var Ea=["AMP-SIDEBAR","AMP-APP-BANNER"],Fa={1:function(a,b){a.parentNode.insertBefore(b,a)},4:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},2:function(a,b){a.insertBefore(b,a.firstChild)},3:function(a,b){a.appendChild(b)}};function V(a,b,c,d,e,g){this.ampdoc=a;this.Y=M(b,"mutator");this.H=b;this.Z=c;this.U=d;this.L=e;this.W=g;this.J=null;this.o=0}V.prototype.getAdElement=function(){return this.J};V.prototype.getEstimatedPosition=function(){var a=this;return Da(this.H).then((function(b){a:switch(a.Z){case 1:case 2:b=b.top;break a;case 3:case 4:b=b.bottom;break a;default:throw Error("Unknown position")}return b}))};V.prototype.placeAd=function(a,b,c,d){var e=this;return this.getEstimatedPosition().then((function(g){return e.ampdoc.win.scrollY>g?(e.o=0,e.o):c.isTooNearAnAd(g).then((function(h){if(h)return e.o=3,e.o;var k=d&&488>Q(e.H).getSize().width;e.J=k?Ga(e,a):Ha(e,a,b.width);e.U(e.H,e.getAdElement());return k?Ba(e.getAdElement()).then((function(){return e.getAdElement().build()})).then((function(){var l=!e.getAdElement().classList.contains("i-amphtml-layout-awaiting-size");e.o=l?2:1;return e.o})):Promise.resolve({height:b.height||250,margins:e.W}).then((function(l){return Ba(e.getAdElement()).then((function(){return e.getAdElement().build()})).then((function(){return e.Y.requestChangeSize(e.getAdElement(),l.height,l.width,l.margins)})).then((function(){e.o=2;return e.o}),(function(){e.o=1;return e.o}))}))}))}))};function Ha(a,b,c){b=Object.assign(y({layout:c?"fixed":"fixed-height",height:"0",width:c?c:"auto","class":"i-amphtml-layout-awaiting-size"}),b,a.L);return O(a.ampdoc.win.document,"amp-ad",b)}function Ga(a,b){b=Object.assign(y({width:"100vw",height:"0",layout:"fixed","class":"i-amphtml-layout-awaiting-size","data-auto-format":"rspv","data-full-width":""}),b,a.L);return O(a.ampdoc.win.document,"amp-ad",b)}function Ia(a,b){var c=b.placements;if(!c)return K().info("amp-auto-ads","No placements in config"),[];var d=[];c.forEach((function(e){Ja(a,e,d)}));return d}function Ja(a,b,c){var d=Fa[b.pos];if(d){var e=b.anchor;if(e){var g=Ka(a.getRootNode(),e);if(g.length){var h=void 0;if(b.style){var k=parseInt(b.style.top_m,10),l=parseInt(b.style.bot_m,10);if(k||l)h={top:k||void 0,bottom:l||void 0}}g.forEach((function(p){if(La(p,b.pos)){var u=U(b,"attributes");c.push(new V(a,p,b.pos,d,u,h))}}))}else K().warn("amp-auto-ads","No anchor element found")}else K().warn("amp-auto-ads","No anchor in placement")}else K().warn("amp-auto-ads","No injector for position")}function Ka(a,b){var c=b.selector;if(!c)return K().warn("amp-auto-ads","No selector in anchor"),[];c=[].slice.call(oa(a.documentElement||a,c));var d=b.min_c||0;0<d&&(c=c.filter((function(g){return g.textContent.length>=d})));"number"!=typeof b.index&&b.all||(c=(c=c[b.index||0])?[c]:[]);if(0==c.length)return[];if(b.sub){var e=[];c.forEach((function(g){e=e.concat(Ka(g,b.sub))}));return e}return c}function La(a,b){var c=1==b||4==b?a.parentElement:a;return c?!Ea.some((function(d){return qa(c,d)?(K().warn("amp-auto-ads","Placement inside denylisted ancestor: "+d),!0):!1})):(K().warn("amp-auto-ads","Parentless anchor with BEFORE/AFTER position."),!1)}function Ma(a,b,c,d,e){var g=void 0===e?!1:e;this.O=a.slice(0);this.B=b;this.$=c;this.C=d;this.K=0;this.V=g}Ma.prototype.run=function(){var a=this;return this.C.isMaxAdCountReached()?fa((function(){return Na(a)})):Oa(this).then((function(b){return b?a.run():Na(a)}))};function Na(a){return{adsPlaced:a.K,totalAdsOnPage:a.C.getAdCount()}}function Oa(a){var b=a.O.shift();return b?b.placeAd(a.B,a.$,a.C,a.V).then((function(c){return 2==c?(a.C.addAd(b.getAdElement()),a.K++,!0):Oa(a)})):(K().info("amp-auto-ads","unable to fulfill ad strategy"),Promise.resolve(!1))}function W(a,b){this.D=a;this.T=b.initialMinSpacing;this.N=b.subsequentMinSpacing.slice(0).sort((function(c,d){return c.adCount-d.adCount}));this.X=b.maxAdCount;this.M=Pa(this)}W.prototype.addAd=function(a){this.D.push(a);this.M=Pa(this)};W.prototype.getAdCount=function(){return this.D.length};W.prototype.isMaxAdCountReached=function(){return this.getAdCount()>=this.X};W.prototype.isTooNearAnAd=function(a){return Qa(this,a,0)};function Qa(a,b,c){return c>=a.D.length?Promise.resolve(!1):Ra(b,a.D[c]).then((function(d){return d<a.M?!0:Qa(a,b,c+1)}))}function Ra(a,b){return Da(b).then((function(c){return a>=c.top&&a<=c.bottom?0:Math.min(Math.abs(a-c.top),Math.abs(a-c.bottom))}))}function Pa(a){for(var b=a.getAdCount(),c=a.T,d=0;d<a.N.length;d++){var e=a.N[d];e.adCount<=b&&(c=e.spacing)}return c}function Sa(a){return[].slice.call(a.getRootNode().querySelectorAll("AMP-AD")).filter((function(b){return b.parentElement&&"AMP-STICKY-AD"==b.parentElement.tagName?!1:!0}))}function Ta(a,b){b=b.adConstraints;if(!b)return null;var c=Q(a).getHeight(),d=Ua(b.initialMinSpacing,c);if(null==d)return K().warn("amp-auto-ads","Invalid initial min spacing"),null;var e=(b.subsequentMinSpacing||[]).map((function(g){var h=g.adCount;if(null==h)return K().warn("amp-auto-ads","No subsequentMinSpacing adCount specified"),null;g=Ua(g.spacing,c);return null==g?(K().warn("amp-auto-ads","Invalid subsequent min spacing"),null):{adCount:h,spacing:g}}));return-1!=e.indexOf(null)?null:null==b.maxAdCount?(K().warn("amp-auto-ads","No maxAdCount specified"),null):{initialMinSpacing:d,subsequentMinSpacing:e,maxAdCount:b.maxAdCount}}function Ua(a,b){if(!a)return null;var c=parseFloat(a);return isNaN(c)||0>c?null:B(a,"px")?c:B(a,"vp")?c*b:null}function Va(a,b,c){this.ampdoc=a;this.B=b;this.R=c}Va.prototype.run=function(){if(this.ampdoc.getRootNode().querySelector("amp-sticky-ad, amp-ad[sticky]"))return K().warn("amp-auto-ads","Auto ads may not work because of already existing <amp-sticky-ad>."),Promise.resolve(!1);if(!K().assertArray(this.R.optInStatus||[]).includes(2))return Promise.resolve(!1);if("top"===this.B.sticky){L(this.ampdoc.win,"extensions").installExtensionForDoc(this.ampdoc,"amp-ad","0.1");var a=Q(this.ampdoc).getWidth();a=Object.assign({},this.B,y({width:String(a),height:this.B.height||"100"}));a=O(this.ampdoc.win.document,"amp-ad",a);var b=this.ampdoc.getBody();b.insertBefore(a,b.firstChild)}else L(this.ampdoc.win,"extensions").installExtensionForDoc(this.ampdoc,"amp-sticky-ad","1.0"),a=this.B,b=Q(this.ampdoc).getWidth(),b=Object.assign({},a,y({width:String(b),height:a.height||"100"})),a=this.ampdoc.win.document,b=O(a,"amp-ad",b),a=O(a,"amp-sticky-ad",y({layout:"nodisplay"})),a.appendChild(b),b=this.ampdoc.getBody(),b.insertBefore(a,b.firstChild);return Promise.resolve(!0)};function X(){return AMP.BaseElement.apply(this,arguments)||this}var Y=AMP.BaseElement;X.prototype=ba(Y.prototype);X.prototype.constructor=X;if(w)w(X,Y);else for(var Z in Y)if("prototype"!=Z)if(Object.defineProperties){var Wa=Object.getOwnPropertyDescriptor(Y,Z);Wa&&Object.defineProperty(X,Z,Wa)}else X[Z]=Y[Z];X.aa=Y.prototype;X.prototype.buildCallback=function(){var a=this,b=this.element.getAttribute("type");ka(b,"Missing type attribute");this.A=Aa(b,this.element);ka(this.A,"No AdNetworkConfig for type: "+b);this.A.isEnabled(this.win)&&(b=this.getAmpDoc(),L(this.win,"extensions").installExtensionForDoc(b,"amp-ad"),this.S=this.getAmpDoc().whenFirstVisible().then((function(){return Xa(a,a.A.getConfigUrl())})),na(this.win)["auto-ads-layout-callback"]||Ya(this))};X.prototype.isLayoutSupported=function(){return!0};X.prototype.layoutCallback=function(){if(na(this.win)["auto-ads-layout-callback"])var a=Ya(this);else x||(x=Promise.resolve(void 0)),a=x;return a};function Xa(a,b){return L(a.win,"xhr").fetchJson(b,{mode:"cors",method:"GET",credentials:"omit"}).then((function(c){return c.json()})).catch((function(c){a.user().error("amp-auto-ads","amp-auto-ads config xhr failed: "+c);return null}))}function Ya(a){var b=a.getAmpDoc();return a.S.then((function(c){if(c){var d=c.noConfigReason;d&&a.user().warn("amp-auto-ads",d);var e=Ia(b,c),g=Object.assign(y({}),a.A.getAttributes(),U(c,"attributes")),h=a.A.getSizing(),k=Ta(b,c)||a.A.getDefaultAdConstraints();k=new W(Sa(b),k);new Ma(e,g,h,k,a.A.isResponsiveEnabled()).run();var l=Object.assign(y({}),g,U(c,"stickyAdAttributes"));new Va(b,l,c).run()}}))}AMP.registerElement("amp-auto-ads",X)}});//# sourceMappingURL=amp-auto-ads-0.1.js.map
}