;
(self.AMP=self.AMP||[]).push({m:1,v:"2603032146000",n:"amp-story-auto-ads",ev:"0.1",l:!0,f:function(t,i){(()=>{var i;function n(){return i||(i=Promise.resolve(void 0))}var s="ini-load";function e(t,i,n){return i in t?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t}function r(t,i){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);i&&(s=s.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.push.apply(n,s)}return n}function o(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?r(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))}))}return t}var{isArray:a}=Array;function h(t,i){for(let n=0;n<t.length;n++)if(i(t[n],n,t))return n;return-1}var{hasOwnProperty:c,toString:l}=Object.prototype;function u(t){return"[object Object]"===l.call(t)}function p(t){const i=Object.create(null);return t&&Object.assign(i,t),i}function m(t,i){return c.call(t,i)}function d(t,i,n,s,e,r,o,a,h,c,l){return t}function f(t){return JSON.parse(t)}function A(t,i,n=5){if(!isFinite(n)||n<0)throw new Error("Invalid depth: "+n);if(t===i)return!0;const s=[{a:t,b:i,depth:n}];for(;s.length>0;){const{a:t,b:i,depth:n}=s.shift();if(n>0){if(typeof t!=typeof i)return!1;if(a(t)&&a(i)){if(t.length!==i.length)return!1;for(let e=0;e<t.length;e++)s.push({a:t[e],b:i[e],depth:n-1});continue}if(t&&i&&"object"==typeof t&&"object"==typeof i){const e=Object.keys(t),r=Object.keys(i);if(e.length!==r.length)return!1;for(const r of e)s.push({a:t[r],b:i[r],depth:n-1});continue}}if(t!==i)return!1}return!0}var _=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function g(t,i=""){try{return decodeURIComponent(t)}catch(t){return i}}function P(t){const i=p();if(!t)return i;let n;for(;n=_.exec(t);){const t=g(n[1],n[1]),s=n[2]?g(n[2].replace(/\+/g," "),n[2]):"";i[t]=s}return i}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var E=self.__AMP_LOG;function T(t,i){throw new Error("failed to call initLogConstructor")}function v(t){return E.user||(E.user=y()),function(t,i){return i&&i.ownerDocument.defaultView!=t}(E.user.win,t)?E.userForEmbed||(E.userForEmbed=y()):E.user}function y(t){return T()}function b(){return E.dev||(E.dev=T())}function S(t,i,n,s,e,r,o,a,h,c,l){return t}function I(t,i,n,s,e,r,o,a,h,c,l){return v().assert(t,i,n,s,e,r,o,a,h,c,l)}function O(t){return(t.ownerDocument||t).defaultView}function R(t,i){return D(t=V(t),i)}function w(t,i){return j(t,i)}function M(t,i){return D(C(k(t)),i)}function N(t,i){return U(C(t),i)}function x(t,i){return j(C(t),i)}function V(t){return t.__AMP_TOP||(t.__AMP_TOP=t)}function k(t){return t.nodeType?(i=O(t),R(i,"ampdoc")).getAmpDoc(t):t;var i}function C(t){const i=k(t);return i.isSingleDoc()?i.win:i}function D(t,i){S(B(t,i));const n=z(t)[i];return n.obj||(S(n.ctor),S(n.context),n.obj=new n.ctor(n.context),S(n.obj),n.context=null,n.resolve&&n.resolve(n.obj)),n.obj}function L(t,i,n,s,e,r){const o=z(t);let a=o[n];a||(a=o[n]={obj:null,promise:null,resolve:null,reject:null,context:null,ctor:null,sharedInstance:r||!1}),!e&&a.ctor||(a.ctor=s,a.context=i,a.sharedInstance=r||!1,a.resolve&&D(t,n))}function U(t,i){const n=j(t,i);if(n)return n;const s=z(t);return s[i]=function(){const t=new class{constructor(){this.promise=new Promise(((t,i)=>{this.resolve=t,this.reject=i}))}},{promise:i,reject:n,resolve:s}=t;return i.catch((()=>{})),{obj:null,promise:i,resolve:s,reject:n,context:null,ctor:null}}(),s[i].promise}function j(t,i){const n=z(t)[i];return n?n.promise?n.promise:(D(t,i),n.promise=Promise.resolve(n.obj)):null}function z(t){let i=t.__AMP_SERVICES;return i||(i=t.__AMP_SERVICES={}),i}function B(t,i){const n=t.__AMP_SERVICES&&t.__AMP_SERVICES[i];return!(!n||!n.ctor)}var G="amp-experiment-toggles",H="__AMP__EXPERIMENT_TOGGLES";function J(t,i){return!!W(t)[i]}function W(t){var i,n,s,e,r;if(t[H])return t[H];t[H]=p();const h=t[H];d(h);const c=o(o({},null!==(i=t.AMP_CONFIG)&&void 0!==i?i:{}),null!==(n=t.AMP_EXP)&&void 0!==n?n:f((null===(s=t.__AMP_EXP)||void 0===s?void 0:s.textContent)||"{}"));for(const t in c){const i=c[t];"number"==typeof i&&i>=0&&i<=1&&(h[t]=Math.random()<i)}const l=null===(e=t.AMP_CONFIG)||void 0===e?void 0:e["allow-doc-opt-in"];if(a(l)&&l.length){const i=t.document.head.querySelector('meta[name="amp-experiments-opt-in"]');if(i){var u;const t=(null===(u=i.getAttribute("content"))||void 0===u?void 0:u.split(","))||[];for(const i of t)l.includes(i)&&(h[i]=!0)}}Object.assign(h,Y(t));const m=null===(r=t.AMP_CONFIG)||void 0===r?void 0:r["allow-url-opt-in"];if(a(m)&&m.length){const i=P(t.location.originalHash||t.location.hash);for(const t of m){const n=i[`e-${t}`];"1"==n&&(h[t]=!0),"0"==n&&(h[t]=!1)}}return h}function Y(t){var i;let n="";try{var s;"localStorage"in t&&(n=null!==(s=t.localStorage.getItem(G))&&void 0!==s?s:"")}catch(t){}const e=(null===(i=n)||void 0===i?void 0:i.split(/\s*,\s*/g))||[],r=p();for(const t of e)t&&("-"==t[0]?r[t.substr(1)]=!1:r[t]=!0);return r}function F(t){const i=Math.random();return t[Math.floor(i*t.length)]||null}function $(t,i){return t.__AMP_EXPERIMENT_BRANCHES?t.__AMP_EXPERIMENT_BRANCHES[i]:null}var K="story-ad-placements",X="31060567",q="31060568",Z="31060817",Q="31060569",tt="story-ad-auto-advance",it="31067116",nt="31067118",st="31067119";function et(t,i){return d(/^[\w-]+$/.test(i)),t.querySelector(i)}function rt(t,i,n){return function(t,i){for(const n in i)t.setAttribute(n,i[n]);return t}(t.createElement(i),n)}function ot(t){var i;return"SCRIPT"==t.tagName&&"APPLICATION/JSON"==(null===(i=t.getAttribute("type"))||void 0===i?void 0:i.toUpperCase())}function at(t,i,n){const s=t.hasAttribute(i),e=void 0!==n?n:!s;return e!==s&&(e?t.setAttribute(i,""):t.removeAttribute(i)),e}function ht(t){if(!t)return null;const i=t.match(/^(.*)\/(.*)-([0-9.]+|latest)(\.max)?\.(?:js|mjs)(?:\?ssr-css=[0|1])?$/i),n=i?i[2]:void 0,s=i?i[3]:void 0;return n&&s?{extensionId:n,extensionVersion:s}:null}var ct=t=>R(t,"extensions"),lt=t=>M(t,"viewer"),ut=class{constructor(){this.un=null}add(t){return this.un||(this.un=[]),this.un.push(t),()=>{this.remove(t)}}remove(t){this.un&&function(t,i){const n=t.indexOf(i);-1!=n&&t.splice(n,1)}(this.un,t)}removeAll(){this.un&&(this.un.length=0)}fire(t){if(this.un)for(const i of this.un.slice())i(t)}getHandlerCount(){var t,i;return null!==(t=null===(i=this.un)||void 0===i?void 0:i.length)&&void 0!==t?t:0}},pt="default",mt=/\w+/gi;function dt(t,i,n){for(const e of i){var s;const i=null===(s=t[e])||void 0===s?void 0:s[n];if(null!=i)return i.string||i}return null}var ft=JSON.parse('{"39":"الاشتراك الآن","40":"حجز","41":"شراء التذاكر","42":"تنزيل","43":"استكشاف","44":"تنزيل المحتوى الآن","45":"تثبيت الآن","46":"مزيد من المعلومات","47":"استماع","48":"المزيد","49":"فتح التطبيق","50":"إرسال طلب الآن","51":"تشغيل","52":"قراءة","53":"تسوق","54":"عرض","55":"مواعيد العرض","56":"اشتراك","57":"الاشتراك الآن","58":"استخدام التطبيق","59":"عرض","60":"المشاهدة","61":"مشاهدة الحلقة"}'),At=JSON.parse('{"39":"Jetzt bewerben","40":"Reservieren","41":"Tickets kaufen","42":"Herunterladen","43":"Erkunden","44":"Jetzt herunterladen","45":"Jetzt installieren","46":"Weitere Informationen","47":"Anhören","48":"Mehr","49":"App öffnen","50":"Jetzt bestellen","51":"Abspielen","52":"Lesen","53":"Einkaufen","54":"Anzeigen","55":"Vorführungszeiten","56":"Anmelden","57":"Jetzt abonnieren","58":"Zur App","59":"Ansehen","60":"Ansehen","61":"Folge ansehen"}'),_t=JSON.parse('{"39":"Apply Now","40":"Book","41":"Buy Tickets","42":"Download","43":"Explore","44":"Get Now","45":"Install Now","46":"Learn More","47":"Listen","48":"More","49":"Open App","50":"Order Now","51":"Play","52":"Read","53":"Shop Now","54":"Show","55":"Performance times","56":"Sign Up","57":"Subscribe Now","58":"Use App","59":"View","60":"Watch","61":"Watch Episode"}'),gt=JSON.parse('{"39":"Apply Now","40":"Book","41":"Buy Tickets","42":"Download","43":"Explore","44":"Get Now","45":"Install Now","46":"Learn More","47":"Listen","48":"More","49":"Open App","50":"Order Now","51":"Play","52":"Read","53":"Shop Now","54":"Show","55":"Showtimes","56":"Sign Up","57":"Subscribe Now","58":"Use App","59":"View","60":"Watch","61":"Watch Episode"}'),Pt=JSON.parse('{"39":"Enviar solicitud ahora","40":"Reservar","41":"Comprar entradas","42":"Descargar","43":"Explorar","44":"Obtener ahora","45":"Instalar ahora","46":"Más información","47":"Escuchar","48":"Más","49":"Abrir app","50":"Pedir ahora","51":"Reproducir","52":"Leer","53":"Comprar","54":"Mostrar","55":"Horarios","56":"Registrarse","57":"Suscribirse ahora","58":"Usar app","59":"Ver","60":"Mirar","61":"Mirar episodio"}'),Et=JSON.parse('{"39":"Solicítalo ahora","40":"Reserva","41":"Compra entradas","42":"Descargar","43":"Consultar","44":"Descargar ahora","45":"Instalar ahora","46":"Consulta más información","47":"Escuchar","48":"Más","49":"Abrir la aplicación","50":"Haz el pedido ahora","51":"Reproducir","52":"Leer","53":"Comprar","54":"Mostrar","55":"Consulta los horarios","56":"Regístrate","57":"Suscríbete ahora","58":"Usa la aplicación","59":"Ver","60":"Visualízalo","61":"Ver episodio"}'),Tt=JSON.parse('{"39":"Inscrivez-vous dès maintenant","40":"Réserver","41":"Acheter des billets","42":"Télécharger","43":"Découvrir","44":"Obtenir","45":"Installer","46":"En savoir plus","47":"Écouter","48":"Plus","49":"Ouvrir l\'application","50":"Commander","51":"Lire","52":"Lire","53":"Acheter","54":"Afficher","55":"Horaires des séances","56":"S\'inscrire","57":"S\'abonner","58":"Utiliser l\'application","59":"Afficher","60":"Regarder","61":"Regarder l\'épisode"}'),vt=JSON.parse('{"39":"अभी आवेदन करें","40":"बुक करें","41":"टिकट खरीदें","42":"डाउनलोड करें","43":"और जानें","44":"अभी पाएं","45":"अभी इंस्टॉल करें","46":"ज़्यादा जानें","47":"सुनें","48":"दूसरी सामग्री","49":"ऐप्लिकेशन खोलें","50":"अभी ऑर्डर करें","51":"चलाएं","52":"पढ़ें","53":"खरीदारी करें","54":"दिखाएं","55":"शो का समय","56":"साइन अप करें","57":"अभी सदस्य बनें","58":"ऐप्लिकेशन इस्तेमाल करें","59":"देखें","60":"देखें","61":"एपिसोड देखें"}'),yt=JSON.parse('{"39":"Daftarkan Sekarang","40":"Reservasi","41":"Beli Tiket","42":"Download","43":"Jelajahi","44":"Dapatkan Sekarang","45":"Instal Sekarang","46":"Pelajari Lebih Lanjut","47":"Dengarkan","48":"Lainnya","49":"Buka Aplikasi","50":"Pesan Sekarang","51":"Putar","52":"Baca","53":"Beli","54":"Tampilkan","55":"Jam Tayang","56":"Daftar","57":"Berlangganan Sekarang","58":"Gunakan Aplikasi","59":"Lihat","60":"Tonton","61":"Tonton Episode"}'),bt=JSON.parse('{"39":"Richiedi ora","40":"Prenota","41":"Acquista biglietti","42":"Scarica","43":"Esplora","44":"Scarica ora","45":"Installa ora","46":"Ulteriori informazioni","47":"Ascolta","48":"Altro","49":"Apri app","50":"Ordina ora","51":"Riproduci","52":"Leggi","53":"Acquista","54":"Mostra","55":"Orari di programmazione","56":"Registrati","57":"Abbonati ora","58":"Usa app","59":"Visualizza","60":"Guarda","61":"Guarda la puntata"}'),St=JSON.parse('{"39":"今すぐお申し込み","40":"予約","41":"チケットを購入","42":"ダウンロード","43":"探す","44":"今すぐ入手","45":"今すぐインストール","46":"詳細","47":"聴く","48":"もっと見る","49":"アプリを開く","50":"今すぐ注文","51":"再生","52":"読む","53":"購入","54":"表示","55":"上映時間","56":"登録","57":"今すぐ登録","58":"アプリを使用","59":"表示","60":"見る","61":"エピソードを見る"}'),It=JSON.parse('{"39":"신청하기","40":"예약","41":"티켓 구매","42":"다운로드","43":"탐색","44":"받기","45":"지금 설치","46":"자세히 알아보기","47":"듣기","48":"더보기","49":"앱 열기","50":"지금 주문","51":"재생","52":"읽기","53":"쇼핑하기","54":"표시","55":"상영일정","56":"가입","57":"지금 구독","58":"앱 사용","59":"보기","60":"보기","61":"에피소드 보기"}'),Ot=JSON.parse('{"39":"Nu toepassen","40":"Boeken","41":"Kaartjes kopen","42":"Downloaden","43":"Verkennen","44":"Nu ophalen","45":"Nu installeren","46":"Meer informatie","47":"Luisteren","48":"Meer","49":"App openen","50":"Nu bestellen","51":"Afspelen","52":"Lezen","53":"Winkelen","54":"Weergeven","55":"Aanvangstijden","56":"Aanmelden","57":"Nu abonneren","58":"App gebruiken","59":"Bekijken","60":"Bekijken","61":"Aflevering bekijken"}'),Rt=JSON.parse('{"39":"Søk nå","40":"Bestill","41":"Kjøp billetter","42":"Last ned","43":"Utforsk","44":"Skaff deg nå","45":"Installer nå","46":"Finn ut mer","47":"Lytt","48":"Mer","49":"Åpne appen","50":"Bestill nå","51":"Spill av","52":"Les","53":"Kjøp","54":"Vis","55":"Kinotider","56":"Registrer deg","57":"Abonner nå","58":"Bruk app","59":"Se","60":"Se","61":"Se episoden"}'),wt=JSON.parse('{"39":"Inscreva-se agora","40":"Agendar","41":"Comprar ingressos","42":"Download","43":"Descobrir","44":"Adquirir agora","45":"Instalar agora","46":"Saiba mais","47":"Ouvir","48":"Mais","49":"Abrir app","50":"Comprar agora","51":"Reproduzir","52":"Ler","53":"Comprar","54":"Mostrar","55":"Horários de exibição","56":"Inscreva-se","57":"Assinar","58":"Usar app","59":"Ver","60":"Assistir","61":"Assistir episódio"}'),Mt=JSON.parse('{"39":"Candidate-se agora","40":"Reservar","41":"Comprar bilhetes","42":"Transferir","43":"Explorar","44":"Obter agora","45":"Instalar agora","46":"Saiba mais","47":"Ouvir","48":"Mais","49":"Abrir aplicação","50":"Encomendar agora","51":"Reproduzir","52":"Ler","53":"Comprar","54":"Mostrar","55":"Sessões","56":"Inscrever-se","57":"Subscrever agora","58":"Utilizar aplicação","59":"Ver","60":"Ver","61":"Ver episódio"}'),Nt=JSON.parse('{"39":"Подать заявку","40":"Забронировать","41":"Купить билеты","42":"Скачать","43":"Изучить","44":"Скачать","45":"Установить","46":"Подробнее","47":"Слушать","48":"Ещё","49":"Открыть приложение","50":"Заказать","51":"Воспроизвести","52":"Читать","53":"Купить","54":"Показать","55":"Время сеансов","56":"Зарегистрироваться","57":"Подписаться","58":"Использовать приложение","59":"Смотреть","60":"Смотреть","61":"Смотреть серию"}'),xt=JSON.parse('{"39":"Hemen Başvur","40":"Kitap","41":"Bilet Satın Al","42":"İndir","43":"Keşfet","44":"Hemen Al","45":"Şimdi Yükle","46":"Daha Fazla Bilgi","47":"Dinle","48":"Diğer","49":"Uygulamayı Aç","50":"Şimdi Sipariş Et","51":"Oynat","52":"Oku","53":"Satın al","54":"Göster","55":"Gösterim zamanları","56":"Kaydol","57":"Şimdi Abone Ol","58":"Uygulama Kullan","59":"Göster","60":"İzle","61":"Bölümü İzle"}'),Vt=JSON.parse('{"39":"Đăng ký ngay bây giờ","40":"Sách","41":"Mua Vé","42":"Tải xuống","43":"Khám phá","44":"Nhận ngay","45":"Cài đặt ngay","46":"Tìm hiểu thêm","47":"Nghe","48":"Thêm","49":"Mở ứng dụng","50":"Đặt hàng ngay bây giờ","51":"Phát","52":"Đọc","53":"Mua sắm","54":"Hiển thị","55":"Thời gian chiếu","56":"Đăng ký","57":"Đăng ký ngay","58":"Sử dụng ứng dụng","59":"Xem","60":"Xem","61":"Xem tập"}'),kt=JSON.parse('{"39":"立即申请","40":"预订","41":"买票","42":"下载","43":"探索","44":"立即获取","45":"立即安装","46":"了解详情","47":"收听","48":"更多","49":"打开应用","50":"立即订购","51":"播放","52":"阅读","53":"选购","54":"显示","55":"放映时间","56":"注册","57":"立即订阅","58":"使用应用","59":"查看","60":"观看","61":"观看剧集"}'),Ct=JSON.parse('{"39":"立即申請","40":"預訂","41":"買票","42":"下載","43":"探索","44":"立即取得","45":"立即安裝","46":"瞭解詳情","47":"聆聽","48":"顯示更多","49":"開啟應用程式","50":"立刻訂購","51":"播放","52":"閱讀","53":"購物","54":"顯示","55":"放映時間","56":"註冊","57":"立即訂閱","58":"使用應用程式","59":"查看","60":"觀看","61":"觀看劇集"}'),Dt={APPLY_NOW:"39",BOOK_NOW:"40",BUY_TICKETS:"41",DOWNLOAD:"42",EXPLORE:"43",GET_NOW:"44",INSTALL:"45",LEARN_MORE:"46",LISTEN:"47",MORE:"48",OPEN_APP:"49",ORDER_NOW:"50",PLAY:"51",READ:"52",SHOP:"53",SHOW:"54",SHOWTIMES:"55",SIGN_UP:"56",SUBSCRIBE:"57",USE_APP:"58",VIEW:"59",WATCH:"60",WATCH_EPISODE:"61"},Lt=t=>{let i=(t=>function(t,i){const n=C(k(t));return B(n,i)?D(n,i):null}(t,"localization"))(t);return i||(i=new class{constructor(t){this.el=t,this.Sy=lt(t).getParam("lang"),this.Oy={},this.Cy=new ut}getLanguageCodesForElement(t){const i=function(t,i,n){let s;for(s=t;s&&void 0!==s;s=s.parentElement)if(i(s))return s;return null}(t,(t=>t.hasAttribute("lang"))),n=function(t){if(!t)return["en",pt];const i=t.match(mt)||[];return i.reduce(((t,n,s)=>{const e=i.slice(0,s+1).join("-").toLowerCase();return t.unshift(e),t}),[pt])}((i?i.getAttribute("lang"):null)||"");return this.Sy&&n.unshift(this.Sy),n}registerLocalizedStringBundles(t){Object.keys(t).forEach((i=>{const n=i.toLowerCase();this.Oy[n]||(this.Oy[n]={}),Object.assign(this.Oy[n],t[i])})),this.Cy.fire()}getLocalizedString(t,i=this.el){const n=this.getLanguageCodesForElement(i);return dt(this.Oy,n,t)}getLocalizedStringAsync(t){const i=this.getLanguageCodesForElement(this.el),n=dt(this.Oy,i,t);return null!==n?Promise.resolve(n):new Promise((n=>{const s=this.Cy.add((()=>{const e=dt(this.Oy,i,t);e&&(s(),n(e))}))}))}}(t),function(t,n,s,e){const r=k(t);L(C(r),r,"localization",(function(){return i}))}(t)),i};function Ut(t){const i=function(t,i){let{crypto:n}=t;const s=new Uint8Array(16);return n.getRandomValues(s),s}(t);return i?i.join(""):String(t.location.href+Date.now()+t.Math.random()+t.screen.width+t.screen.height)}var jt,zt,Bt,Gt,Ht="story-ad-analytics",Jt="adIndex",Wt=["Webkit","webkit","Moz","moz","ms","O","o"];function Yt(t,i,n,s,e){const r=function(t,i,n){if(i.startsWith("--"))return i;jt||(jt=p());let s=jt[i];if(!s||n){if(s=i,void 0===t[i]){const n=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(i),e=function(t,i){for(let n=0;n<Wt.length;n++){const s=Wt[n]+i;if(void 0!==t[s])return s}return""}(t,n);void 0!==t[e]&&(s=e)}n||(jt[i]=s)}return s}(t.style,i,e);if(!r)return;const o=s?n+s:n;t.style.setProperty(function(t){const i=t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()));return Wt.some((t=>i.startsWith(t+"-")))?`-${i}`:i}(r),o)}function Ft(t){return`${t}px`}function $t(t,i,n="source"){var s;return I(null!=t,"%s %s must be available",i,n),I("https:"==(s=(t=>"string"==typeof t?function(t,i){return Gt||(Gt=self.document.createElement("a")),function(t,i,n){return t.href="",new URL(i,t.href)}(Gt,t)}(t):t)(s=t)).protocol||"localhost"==s.hostname||"127.0.0.1"==s.hostname||function(t,i){const n=t.length-i.length;return n>=0&&t.indexOf(i,n)==n}(s.hostname,".localhost")||/^\/\//.test(t),'%s %s must start with "https://" or "//" or be relative and served from either https or from localhost. Invalid value: %s',i,n,t),t}var Kt,Xt,qt="amp-story",Zt=t=>{let i=(t=>function(t,i){return B(t=V(t),i)?D(t,i):null}(t,"story-store"))(t);return i||(i=new ii(t),function(t,n,s,e){L(t=V(t),t,"story-store",(function(){return i}))}(t)),i},Qt={CAN_INSERT_AUTOMATIC_AD:1,CAN_SHOW_AUDIO_UI:2,CAN_SHOW_NAVIGATION_OVERLAY_HINT:3,CAN_SHOW_PAGINATION_BUTTONS:4,CAN_SHOW_PREVIOUS_PAGE_HELP:5,CAN_SHOW_SHARING_UIS:6,CAN_SHOW_STORY_URL_INFO:7,CAN_SHOW_SYSTEM_LAYER_BUTTONS:8,VIEWER_CUSTOM_CONTROLS:9,AD_STATE:10,PAGE_ATTACHMENT_STATE:11,EDUCATION_STATE:12,GYROSCOPE_PERMISSION_STATE:13,INFO_DIALOG_STATE:14,INTERACTIVE_COMPONENT_STATE:15,INTERACTIVE_REACT_STATE:16,KEYBOARD_ACTIVE_STATE:17,MUTED_STATE:18,PAGE_HAS_AUDIO_STATE:19,PAGE_HAS_CAPTION_STATE:20,CAPTIONS_STATE:21,PAGE_HAS_ELEMENTS_WITH_PLAYBACK_STATE:22,PANNING_MEDIA_STATE:23,PAUSED_STATE:24,PREVIEW_STATE:25,RTL_STATE:26,SHARE_MENU_STATE:27,SHOPPING_DATA:28,STORY_HAS_BACKGROUND_AUDIO_STATE:29,STORY_HAS_PLAYBACK_UI_STATE:30,SYSTEM_UI_IS_VISIBLE_STATE:31,UI_STATE:32,DESKTOP_ASPECT_RATIO:33,ACTIONS_ALLOWLIST:34,CONSENT_ID:35,CURRENT_PAGE_ID:36,CURRENT_PAGE_INDEX:37,ADVANCEMENT_MODE:38,NAVIGATION_PATH:39,NEW_PAGE_AVAILABLE_ID:40,PAGE_IDS:41,PAGE_SIZE:42,SUBSCRIPTIONS_DIALOG_UI_STATE:43,SUBSCRIPTIONS_STATE:44,SUBSCRIPTIONS_PAGE_INDEX:45},ti={[Qt.ACTIONS_ALLOWLIST]:(t,i)=>t.length!==i.length,[Qt.INTERACTIVE_COMPONENT_STATE]:(t,i)=>t.element!==i.element||t.state!==i.state,[Qt.NAVIGATION_PATH]:(t,i)=>t.length!==i.length,[Qt.PAGE_IDS]:(t,i)=>t.length!==i.length,[Qt.PAGE_SIZE]:(t,i)=>null===t||null===i||t.width!==i.width||t.height!==i.height,[Qt.PANNING_MEDIA_STATE]:(t,i)=>null===t||null===i||!A(t,i,2),[Qt.SHOPPING_DATA]:(t,i)=>null===t||null===i||!A(t,i,2),[Qt.INTERACTIVE_REACT_STATE]:(t,i)=>!A(t,i,3)},ii=class{constructor(t){this.i=t,this.ht={},this.Mi=o(o({},this.Ay()),this.Py())}get(t){if(m(this.Mi,t))return this.Mi[t];b().error(qt,"Unknown state %s.",t)}subscribe(t,i,n=!1){m(this.Mi,t)?(this.ht[t]||(this.ht[t]=new ut),this.ht[t].add(i),n&&i(this.get(t))):b().error(qt,"Can't subscribe to unknown state %s.",t)}dispatch(t,i){const n=o({},this.Mi);let s;this.Mi=((t,i,n)=>{switch(i){case 1:return o(o({},t),{},{[Qt.INTERACTIVE_REACT_STATE]:o(o({},t[Qt.INTERACTIVE_REACT_STATE]),{},{[n.interactiveId]:n})});case 2:return o(o({},t),{},{[Qt.NEW_PAGE_AVAILABLE_ID]:n});case 3:const s=o(o({},t[Qt.PANNING_MEDIA_STATE]),n);return o(o({},t),{},{[Qt.PANNING_MEDIA_STATE]:s});case 4:const e=o(o({},t[Qt.SHOPPING_DATA]),n);return o(o({},t),{},{[Qt.SHOPPING_DATA]:e});case 5:const r=[].concat(t[Qt.ACTIONS_ALLOWLIST],n);return o(o({},t),{},{[Qt.ACTIONS_ALLOWLIST]:r});case 22:return o(o({},t),{},{[Qt.PAGE_ATTACHMENT_STATE]:!!n});case 16:return o(o({},t),{},{[Qt.AD_STATE]:!!n});case 17:return o(o({},t),{},{[Qt.EDUCATION_STATE]:!!n});case 19:return o(o({},t),{},{[Qt.PAUSED_STATE]:1===n.state,[Qt.SYSTEM_UI_IS_VISIBLE_STATE]:!0,[Qt.INTERACTIVE_COMPONENT_STATE]:n});case 18:return o(o({},t),{},{[Qt.INFO_DIALOG_STATE]:!!n,[Qt.PAUSED_STATE]:!!n});case 31:return o(o({},t),{},{[Qt.STORY_HAS_PLAYBACK_UI_STATE]:!!n});case 30:return o(o({},t),{},{[Qt.STORY_HAS_BACKGROUND_AUDIO_STATE]:!!n});case 21:return o(o({},t),{},{[Qt.MUTED_STATE]:!!n});case 23:return o(o({},t),{},{[Qt.PAGE_HAS_AUDIO_STATE]:!!n});case 24:return o(o({},t),{},{[Qt.PAGE_HAS_CAPTIONS_STATE]:!!n});case 25:return o(o({},t),{},{[Qt.CAPTIONS_STATE]:!!n});case 26:return o(o({},t),{},{[Qt.PAGE_HAS_ELEMENTS_WITH_PLAYBACK_STATE]:!!n});case 27:return o(o({},t),{},{[Qt.PAUSED_STATE]:!!n});case 28:return o(o({},t),{},{[Qt.RTL_STATE]:!!n});case 20:return o(o({},t),{},{[Qt.KEYBOARD_ACTIVE_STATE]:!!n});case 29:return o(o({},t),{},{[Qt.PAUSED_STATE]:!!n,[Qt.SHARE_MENU_STATE]:!!n});case 34:return o(o({},t),{},{[Qt.SYSTEM_UI_IS_VISIBLE_STATE]:!!n});case 35:return 3===t[Qt.UI_STATE]&&3!==n?(b().error(qt,"Cannot switch away from UIType_Enum.VERTICAL"),t):o(o({},t),{},{[Qt.UI_STATE]:n});case 9:return o(o({},t),{},{[Qt.GYROSCOPE_PERMISSION_STATE]:n});case 8:return o(o({},t),{},{[Qt.CONSENT_ID]:n});case 6:return o(o({},t),{},{[Qt.CURRENT_PAGE_ID]:n.id,[Qt.CURRENT_PAGE_INDEX]:n.index});case 7:return o(o({},t),{},{[Qt.ADVANCEMENT_MODE]:n});case 10:return o(o({},t),{},{[Qt.NAVIGATION_PATH]:n});case 11:return o(o({},t),{},{[Qt.PAGE_IDS]:n});case 12:return o(o({},t),{},{[Qt.PAGE_SIZE]:n});case 13:return o(o({},t),{},{[Qt.VIEWER_CUSTOM_CONTROLS]:n});case 14:return o(o({},t),{},{[Qt.SUBSCRIPTIONS_PAGE_INDEX]:n});case 32:return o(o({},t),{},{[Qt.SUBSCRIPTIONS_DIALOG_UI_STATE]:!!n,[Qt.PAUSED_STATE]:!!n});case 33:return o(o({},t),{},{[Qt.SUBSCRIPTIONS_STATE]:n});case 15:return o(o({},t),{},{[Qt.DESKTOP_ASPECT_RATIO]:n});default:return b().error(qt,"Unknown action %s.",i),t}})(this.Mi,t,i),Object.keys(this.ht).forEach((t=>{s=ti[t],(s?s(n[t],this.Mi[t]):n[t]!==this.Mi[t])&&this.ht[t].fire(this.Mi[t])}))}Ay(){return{[Qt.CAN_INSERT_AUTOMATIC_AD]:!0,[Qt.CAN_SHOW_AUDIO_UI]:!0,[Qt.CAN_SHOW_NAVIGATION_OVERLAY_HINT]:!0,[Qt.CAN_SHOW_PREVIOUS_PAGE_HELP]:!0,[Qt.CAN_SHOW_PAGINATION_BUTTONS]:!0,[Qt.CAN_SHOW_SHARING_UIS]:!0,[Qt.CAN_SHOW_STORY_URL_INFO]:!0,[Qt.CAN_SHOW_SYSTEM_LAYER_BUTTONS]:!0,[Qt.VIEWER_CUSTOM_CONTROLS]:[],[Qt.AD_STATE]:!1,[Qt.EDUCATION_STATE]:!1,[Qt.GYROSCOPE_PERMISSION_STATE]:"",[Qt.INFO_DIALOG_STATE]:!1,[Qt.INTERACTIVE_COMPONENT_STATE]:{state:0},[Qt.INTERACTIVE_REACT_STATE]:{},[Qt.KEYBOARD_ACTIVE_STATE]:!1,[Qt.MUTED_STATE]:!0,[Qt.PAGE_ATTACHMENT_STATE]:!1,[Qt.PAGE_HAS_AUDIO_STATE]:!1,[Qt.PAGE_HAS_CAPTIONS_STATE]:!1,[Qt.CAPTIONS_STATE]:!0,[Qt.PAGE_HAS_ELEMENTS_WITH_PLAYBACK_STATE]:!1,[Qt.PANNING_MEDIA_STATE]:{},[Qt.PAUSED_STATE]:!1,[Qt.RTL_STATE]:!1,[Qt.SHARE_MENU_STATE]:!1,[Qt.SHOPPING_DATA]:{},[Qt.STORY_HAS_BACKGROUND_AUDIO_STATE]:!1,[Qt.STORY_HAS_PLAYBACK_UI_STATE]:!1,[Qt.SYSTEM_UI_IS_VISIBLE_STATE]:!0,[Qt.UI_STATE]:0,[Qt.ACTIONS_ALLOWLIST]:[],[Qt.CONSENT_ID]:null,[Qt.CURRENT_PAGE_ID]:"",[Qt.CURRENT_PAGE_INDEX]:0,[Qt.ADVANCEMENT_MODE]:"",[Qt.NEW_PAGE_AVAILABLE_ID]:"",[Qt.NAVIGATION_PATH]:[],[Qt.PAGE_IDS]:[],[Qt.PAGE_SIZE]:null,[Qt.PREVIEW_STATE]:!1,[Qt.SUBSCRIPTIONS_DIALOG_UI_STATE]:!1,[Qt.SUBSCRIPTIONS_STATE]:0,[Qt.SUBSCRIPTIONS_PAGE_INDEX]:-1,[Qt.DESKTOP_ASPECT_RATIO]:0}}Py(){switch(function(t){const i=P(t).embedMode,n=parseInt(i,10);return 0===(s=n)||1===s||2===s||3===s||4===s?n:0;var s}(this.i.location.hash)){case 1:return{[Qt.CAN_INSERT_AUTOMATIC_AD]:!1,[Qt.CAN_SHOW_NAVIGATION_OVERLAY_HINT]:!1,[Qt.CAN_SHOW_PAGINATION_BUTTONS]:!1,[Qt.CAN_SHOW_PREVIOUS_PAGE_HELP]:!0,[Qt.CAN_SHOW_SYSTEM_LAYER_BUTTONS]:!1,[Qt.MUTED_STATE]:!1};case 2:return{[Qt.CAN_SHOW_SHARING_UIS]:!1};case 3:return{[Qt.PREVIEW_STATE]:!0,[Qt.CAN_INSERT_AUTOMATIC_AD]:!1,[Qt.CAN_SHOW_NAVIGATION_OVERLAY_HINT]:!1,[Qt.CAN_SHOW_PAGINATION_BUTTONS]:!1,[Qt.CAN_SHOW_PREVIOUS_PAGE_HELP]:!1,[Qt.CAN_SHOW_SYSTEM_LAYER_BUTTONS]:!1};case 4:return{[Qt.CAN_SHOW_AUDIO_UI]:!1,[Qt.CAN_SHOW_SHARING_UIS]:!1,[Qt.CAN_SHOW_STORY_URL_INFO]:!1};default:return{}}}},ni="none",si="v0";function ei(t){return void 0===Kt&&(i=t||Element,Kt=i.prototype.attachShadow?"v1":i.prototype.createShadowRoot?si:ni),Kt;var i}function ri(t,i,n){var s="";return t&&Array.prototype.forEach.call(t,(function(t){if(t.selectorText&&t.style&&void 0!==t.style.cssText)s+=function(t,i,n){var s=[];return t.split(",").forEach((function(t){t=t.trim(),n&&(t=n(t)),function(t,i){var n=function(t){return t=t.replace(/\[/g,"\\[").replace(/\]/g,"\\]"),new RegExp("^("+t+")"+hi,"m")}(i);return!t.match(n)}(t,i)&&(t=function(t,i){return function(t,i){return t.match(li)?(t=t.replace(ci,i)).replace(li,i+" "):i+" "+t}(t,i)}(t,i)),s.push(t)})),s.join(", ")}(t.selectorText,i,n)+" {\n\t",s+=function(t){var i=t.style.cssText;t.style.content&&!t.style.content.match(/['"]+|attr/)&&(i=i.replace(/content:[^;]*;/g,"content: '"+t.style.content+"';"));var n=t.style;for(var s in n)"initial"===n[s]&&(i+=s+": initial; ");return i}(t)+"\n}\n\n";else if(t.type===CSSRule.MEDIA_RULE)s+="@media "+t.media.mediaText+" {\n",s+=ri(t.cssRules,i),s+="\n}\n\n";else try{t.cssText&&(s+=t.cssText+"\n\n")}catch(t){}})),s}var oi="-shadowcsshost",ai=")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)",hi=(new RegExp("("+oi+ai,"gim"),new RegExp("(-shadowcsscontext"+ai,"gim"),"([>\\s~+[.,{:][\\s\\S]*)?$"),ci=oi+"-no-combinator",li=new RegExp(oi,"gim");new RegExp("-shadowcsscontext","gim");var ui=/[^\.\-\_0-9a-zA-Z]/,pi=/[^\-\_0-9a-zA-Z]/;function mi(t){const i=O(t),n=t.shadowRoot||t.__AMP_SHADOW_ROOT;if(n){if(self.trustedTypes&&self.trustedTypes.createPolicy){const t=self.trustedTypes.createPolicy("shadow-embed#createShadowRoot",{createHTML:function(t){return""}});n.innerHTML=t.createHTML("")}else n.innerHTML="";return n}let s;const e=ei();if("v1"==e?(s=t.attachShadow({mode:"open"}),s.styleSheets||Object.defineProperty(s,"styleSheets",{get:function(){const t=[];return s.childNodes.forEach((i=>{"STYLE"===i.tagName&&t.push(i.sheet)})),t}})):s=e==si?t.createShadowRoot():function(t){const i=t.ownerDocument;t.classList.add("i-amphtml-shadow-host-polyfill");const n=i.createElement("style");n.textContent=".i-amphtml-shadow-host-polyfill>:not(i-amphtml-shadow-root){display:none!important}",t.appendChild(n);const s=i.createElement("i-amphtml-shadow-root");return t.appendChild(s),t.__AMP_SHADOW_ROOT=s,Object.defineProperty(t,"shadowRoot",{enumerable:!0,configurable:!0,value:s}),s.host=t,s.getElementById=function(t){const i=(n=t,CSS.escape(n));var n;return s.querySelector(`#${i}`)},Object.defineProperty(s,"styleSheets",{get:()=>{return i.styleSheets?(t=i.styleSheets,t?Array.prototype.slice.call(t):[]).filter((t=>s.contains(t.ownerNode))):[];var t}}),s}(t),!function(){if(void 0!==Xt)return Xt;if(ei()==ni)Xt=!1;else{const i=ei()===si?self.document.createElement("div").createShadowRoot():self.document.createElement("div").attachShadow({mode:"open"});t=ShadowRoot,Xt=!!t&&-1!=t.toString().indexOf("[native code]")&&i instanceof ShadowRoot}var t;return Xt}()){const t=`i-amphtml-sd-${i.Math.floor(1e4*i.Math.random())}`;s.id=t,s.host.classList.add(t),r=t=>function(t,i){return function(t,i){const n=S(t.id),s=t.ownerDocument;let e=null;try{e=Ai(s.implementation.createHTMLDocument(""),i)}catch(t){}if(!e)try{e=Ai(s,i)}catch(t){}return e?ri(e,`.${n}`,di):i}(t,i)}(s,t),s.__AMP_CSS_TR=r}var r;return s}function di(t){return t.replace(/(html|body)/g,fi)}function fi(t,i,n,s){const e=s.charAt(n-1),r=s.charAt(n+t.length);return e&&!ui.test(e)||r&&!pi.test(r)?t:"amp-"+t}function Ai(t,i){const n=t.createElement("style");n.textContent=i;try{return(t.head||t.documentElement).appendChild(n),n.sheet?n.sheet.cssRules:null}finally{n.parentNode&&n.parentNode.removeChild(n)}}function _i(t,i,n){const s=self.document.createElement("style");s.textContent=n;const e=mi(t);return e.appendChild(s),e.appendChild(i),t}var gi="amp4ads-vars-",Pi="cta-url",Ei=["cta-accent-color","cta-accent-element","cta-image","theme"],Ti="__AMP_Gestures",vi=class t{static get(i,n=!1,s=!1){let e=i[Ti];return e||(e=new t(i,n,s),i[Ti]=e),e}constructor(t,i=!1,n=!1){this.el=t,this.qM=[],this.t_=[],this.gi=[],this.ZM=[],this.XM=null;const s=function(t){if(void 0!==Bt)return Bt;Bt=!1;try{const i={get passive(){return Bt=!0,!1}};t.addEventListener("test-options",null,i),t.removeEventListener("test-options",null,i)}catch(t){}return Bt}(t.ownerDocument.defaultView);this.KM=i||s,this.JM=n,this.QM=!1,this.Be=new class{constructor(t,i,n){this.ke=D(t,"timer"),this.Ne=i,this.De=n||0,this.Le=-1,this.Ue=0,this.$e=!1,this.Fe=()=>{this.Be()}}isPending(){return-1!=this.Le}schedule(t){let i=t||this.De;this.$e&&i<10&&(i=10);const n=Date.now()+i;return(!this.isPending()||n-this.Ue<-10)&&(this.cancel(),this.Ue=n,this.Le=this.ke.delay(this.Fe,i),!0)}Be(){this.Le=-1,this.Ue=0,this.$e=!0,this.Ne(),this.$e=!1}cancel(){this.isPending()&&(this.ke.cancel(this.Le),this.Le=-1)}}(O(t),this.Im.bind(this)),this.aw=new ut,this.hw=Object.create(null),this.lw=this.hp.bind(this),this.pw=this.cp.bind(this),this.mw=this.lp.bind(this),this.cw=this.h_.bind(this),this.el.addEventListener("touchstart",this.lw,!!s&&{passive:!0}),this.el.addEventListener("touchend",this.pw),this.el.addEventListener("touchmove",this.mw,!!s&&{passive:!0}),this.el.addEventListener("touchcancel",this.cw),this.uw=!1}cleanup(){this.el.removeEventListener("touchstart",this.lw),this.el.removeEventListener("touchend",this.pw),this.el.removeEventListener("touchmove",this.mw),this.el.removeEventListener("touchcancel",this.cw),delete this.el[Ti],this.Be.cancel()}onGesture(t,i){const n=new t(this),s=n.getType();let e=this.hw[s];return e||(this.qM.push(n),e=new ut,this.hw[s]=e),e.add(i)}removeGesture(t){const i=new t(this).getType(),n=this.hw[i];if(n){n.removeAll();const t=h(this.qM,(t=>t.getType()==i));return!(t<0||(this.qM.splice(t,1),this.gi.splice(t,1),this.ZM.splice(t,1),this.t_.splice(t,1),delete this.hw[i],0))}return!1}onPointerDown(t){return this.aw.add(t)}hp(t){const i=Date.now();this.QM=!1,this.aw.fire(t);for(let n=0;n<this.qM.length;n++)this.gi[n]||(this.ZM[n]&&this.ZM[n]<i&&this.o_(n),this.qM[n].onTouchStart(t)&&this.u_(n));this.dw(t)}lp(t){const i=Date.now();for(let n=0;n<this.qM.length;n++)this.t_[n]&&(this.ZM[n]&&this.ZM[n]<i?this.o_(n):this.qM[n].onTouchMove(t)||this.o_(n));this.dw(t)}cp(t){const i=Date.now();for(let n=0;n<this.qM.length;n++){if(!this.t_[n])continue;if(this.ZM[n]&&this.ZM[n]<i){this.o_(n);continue}this.qM[n].onTouchEnd(t);const s=!this.ZM[n],e=this.ZM[n]<i;this.XM==this.qM[n]||!s&&!e||this.o_(n)}this.dw(t)}h_(t){for(let t=0;t<this.qM.length;t++)this.fw(t);this.dw(t)}ep(t,i){if(this.XM)return void t.acceptCancel();const n=Date.now();for(let s=0;s<this.qM.length;s++)this.qM[s]==t&&(this.gi[s]=n+i,this.ZM[s]=0);this.uw=!0}_w(t,i){if(this.XM)return void t.acceptCancel();const n=Date.now();for(let s=0;s<this.qM.length;s++)this.qM[s]==t&&(this.ZM[s]=n+i)}gw(t){this.XM==t&&(this.XM=null,this.QM=!0)}yw(t,i,n){d(this.XM==t);const s=this.hw[t.getType()];s&&s.fire(new class{constructor(t,i,n,s){this.type=t,this.data=i,this.time=n,this.event=s}}(t.getType(),i,Date.now(),n))}dw(t){let i=!!this.XM||this.QM;if(this.QM=!1,!i){const t=Date.now();for(let n=0;n<this.qM.length;n++)if(this.gi[n]||this.ZM[n]&&this.ZM[n]>=t){i=!0;break}}i?(t.stopPropagation(),this.KM||t.preventDefault()):this.JM&&t.stopPropagation(),this.uw&&(this.uw=!1,this.Im())}Im(){const t=Date.now();let i=-1;for(let n=0;n<this.qM.length;n++)this.gi[n]?(-1==i||this.gi[n]>this.gi[i])&&(i=n):this.ZM[n]&&this.ZM[n]<t&&this.o_(n);if(-1==i)return;let n=0;for(let i=0;i<this.qM.length;i++)!this.gi[i]&&this.t_[i]&&(n=Math.max(n,this.ZM[i]-t));n<2?this.Aw(i):this.Be.schedule(n)}Aw(t){const i=this.qM[t];for(let i=0;i<this.qM.length;i++)i!=t&&this.fw(i);this.gi[t]=0,this.ZM[t]=0,this.XM=i,i.acceptStart()}u_(t){this.t_[t]=!0,this.ZM[t]=0}o_(t){this.t_[t]=!1,this.ZM[t]=0,this.gi[t]||this.qM[t].acceptCancel()}fw(t){this.gi[t]=0,this.o_(t)}};function yi(t,i,n){i<1&&(i=1);const s=t/i,e=.5+Math.min(i/33.34,.5);return s*e+n*(1-e)}Math.round(-16.67/Math.log(.95));var bi=(o(o({},{"bg":"https://tpc.googlesyndication.com/b4a/b4a-runner.html","moat":"https://z.moatads.com/ampanalytics093284/iframe.html"}),{},{"bg":"https://tpc.googlesyndication.com/b4a/experimental/b4a-runner.html"}),"beacon");function Si(t,i,n){if(I("string"==typeof i.finalUrl,"finalUrl of target '%s' must be a string",t),i.filters&&i.filters.forEach((t=>{I(n.filters[t],"filter '%s' not defined",t)})),i.vars){const t=/^_[a-zA-Z0-9_-]+$/;for(const n in i.vars)I(t.test(n),"'%s' must match the pattern '%s'",n,t)}}var Ii="amp-story-visible",Oi="amp-story-auto-ads:config",Ri={"height":!0,"layout":!0,"width":!0},wi={"adsense":!0,"custom":!0,"doubleclick":!0,"fake":!0,"nws":!0,"mgid":!0},Mi="amp-story-auto-ads",Ni={[it]:tt,31067117:tt,[nt]:tt,[st]:tt},xi={AD_SHOWING:"ad-showing",DESKTOP_FULLBLEED:"desktop-fullbleed",DESKTOP_ONE_PANEL:"desktop-one-panel",DIR:"dir",PAUSED:"paused"},Vi=class extends t.BaseElement{constructor(t){super(t),this.hf=this.win.document,this.hV=null,this.Npt=null,this.lk={},this.JU=null,this.Dpt=null,this.Ey=null,this.Upt=null,this.Bpt=null,this.Gpt=J(this.win,"story-ad-allow-fullbleed")}buildCallback(){return this.Hpt(),(t=this.win,function(t,i,n,s,e){return w(t,i)||function(t,i,n,s,e){return(r=t.document,new Promise((t=>function(t,i){!function(t,i,n){if(i())n();else{const s=new(O(t).MutationObserver)((()=>{i()&&(s.disconnect(),n())}));s.observe(t,{childList:!0})}}(t.documentElement,(()=>!!t.body),i)}(r,t)))).then((()=>{const i=R(t,"extensions");return function(t,i,n){return function(t){if(!t)return[];const i=t.querySelectorAll("script[custom-element],script[custom-template]"),n=[];for(let t=0;t<i.length;t++){const s=i[t],e=s.getAttribute("custom-element")||s.getAttribute("custom-template"),r=ht(s.src);e&&r&&n.push({script:s,extensionId:e,extensionVersion:r.extensionVersion})}return n}(t.document.head).some((({extensionId:t,extensionVersion:s})=>i==t&&n==s))}(i.win,n,s)?i.waitForExtension(n,s):null})).then((n=>n?e?w(t,i):function(t,i){return U(t,i)}(t,i):null));var r}(t,i,n,s,e)}(t,"story-store","amp-story","1.0")).then((t=>{if(S(t),this.Ey=t,!this.Jpt())return;const i=this.element.parentElement;I("AMP-STORY"===i.tagName,`<${Mi}> should be child of <amp-story>`);const n=this.getAmpDoc();return ct(this.win).installExtensionForDoc(n,"amp-ad"),i.getImpl().then((t=>{this.hV=t}))}));var t}isLayoutSupported(){return!0}layoutCallback(){return this.Jpt()?this.hV.signals().whenSignal(s).then((()=>this.Wpt())).then((()=>{this.Bpt=new class{constructor(t,i){this.hV=t,this.lk=i,this.ji=t.getAmpDoc(),this.JU=N(this.ji,Ht),this.Qot=new class{constructor(t){this.Ypt=t,this.Qot=null}getLocalizedString(t){return this.Qot||this.Yu(),this.Qot.getLocalizedString(t)}Yu(){this.Qot=Lt(this.Ypt);const t=function(t,i){const n=function(t){return f(JSON.stringify(t))}(t);return Object.keys(n).forEach((i=>{const s=i,e=t[s];n[s]=`[${e.string||e} one two]`})),n}(gt);this.Qot.registerLocalizedStringBundles({"default":gt,"ar":ft,"de":At,"en":gt,"en-GB":_t,"es":Et,"es-419":Pt,"fr":Tt,"hi":vt,"id":yt,"it":bt,"ja":St,"ko":It,"nl":Ot,"no":Rt,"pt-PT":Mt,"pt-BR":wt,"ru":Nt,"tr":xt,"vi":Vt,"zh-cn":kt,"zh-TW":Ct,"en-xa":t})}}(this.hV.element),this.Fpt=new class{constructor(t){this.$c=M(t,"mutator"),this.hf=t.win.document,this.pg=this.hf.createElement("div"),this.$c.mutateElement(this.pg,(()=>{this.hf.body.appendChild(this.pg),function(t,i){for(const n in i)Yt(t,n,i[n])}(this.pg,{position:"absolute",top:0,left:0,zIndex:1,visibility:"hidden","font-weight":"bold","letter-spacing":"0.2px"})}))}fit(t,i,n){let s=!1;return this.$c.mutateElement(i,(()=>{this.pg.textContent=n;const e=function(t,i,n,s,e){for(let i=14;i>=12;i--){Yt(t,"fontSize",Ft(i));const s=t.offsetHeight,e=t.offsetWidth;if(s<32&&e<n)return i}return 11}(this.pg,0,this.mg(t));e>=12&&(this.gg(i,e),s=!0)})).then((()=>s))}mg(t){return t.offsetWidth-84}gg(t,i){Yt(t,"fontSize",Ft(i))}}(this.ji),this.II={},this.Ey=Zt(this.ji.win),this.Kpt=0,this.Xpt=[]}hasUnusedAdPage(){return this.Kpt<this.Xpt.length}getUnusedAdPage(){const t=this.Xpt[this.Kpt];return S(t),this.II[t]}discardCurrentAd(){this.Kpt++,this.uZ("story-ad-discard",{[Jt]:this.Kpt,discardTime:Date.now()})}numberOfAdsCreated(){return this.Xpt.length}createAdPage(){const t=this.Xpt.length+1,i=new class{constructor(t,i,n,s,e,r){this.lk=i,this.je=n,this.Qot=s,this.vi=`i-amphtml-ad-page-${this.je}`,this.i=t.win,this.hf=this.i.document,this.JU=N(t,Ht),this.Zpt=null,this.Qpt=null,this.rC=null,this.tdt=null,this.idt=null,this.ndt=null,this.sdt=null,this.W_=!1,this.edt=[],this.Fpt=e,this.rdt=!1,this.Ey=r,this.odt=!1}getAdDoc(){return this.sdt}getId(){return this.vi}hasTimedOut(){return!!this.Zpt&&Date.now()-this.Zpt>1e4}isLoaded(){return this.W_}hasBeenViewed(){return this.rdt}getPageElement(){return this.Qpt}registerLoadCallback(t){this.edt.push(t)}toggleVisibility(){if(this.rdt=!0,this.ndt&&at(this.ndt,"cta-active"),this.sdt){at(this.sdt.body,Ii);const t=this.sdt.querySelector("#x-a4a-former-body");t&&at(t,Ii)}}build(){this.Zpt=Date.now(),this.Qpt=this.adt(),this.rC=this.cC();const t=this.hf.createElement("div");t.classList.add("i-amphtml-glass-pane");const i=this.hf.createElement("amp-story-grid-layer");i.setAttribute("template","fill");const n=i.cloneNode(!1);return i.appendChild(this.rC),n.appendChild(t),this.Qpt.appendChild(i),this.Qpt.appendChild(n),this.hdt(),this.cdt(),this.uZ("story-ad-request",{requestTime:Date.now()}),this.Qpt}maybeCreateCta(){return n().then((()=>{var t;if(this.odt)return!0;const i=p(),n=(null!==(t=this.sdt)&&void 0!==t?t:this.rC).querySelectorAll("meta[name]");var s;return this.sdt?Object.assign(i,function(t){const i=p();return t.forEach((t=>{const{content:n,name:s}=t;if(s.startsWith("amp-cta-")){const t=s.split("amp-")[1];i[t]=n}else if(s.startsWith(gi)){const t=s.split(gi)[1];i[t]=n}})),i}(n),this.ldt()):Object.assign(i,function(t){const i=t.getAttribute("data-vars-ctaurl");return{"cta-type":t.getAttribute("data-vars-ctatype"),[Pi]:i}}(S(this.rC))),!!((s=i)["cta-type"]&&s["cta-url"]||(v().error("amp-story-auto-ads:ui","Both CTA Type & CTA Url are required in ad response."),0))&&(i["cta-type"]=function(t,i){if(Dt[t]){const n=Dt[t];return i.getLocalizedString(n)}return t}(i["cta-type"],this.Qot)||i["cta-type"],this.JU.then((t=>{t.setVar(this.je,"ctaType",i["cta-type"]);for(const[i,s]of Object.entries(function(t){const i=p();return t.forEach((t=>{const{content:n,name:s}=t;/^[a-zA-Z0-9\-_]+$/.test(s)&&(i[s]=n)})),i}(n)))t.setVar(this.je,`STORY_AD_META_${i}`,s)})),(this.idt=function(t,i,n){const s=t.document;try{const e=i["attribution-url"],r=i["attribution-icon"];if(!e||!r)return null;$t(e,n,"amp-story-auto-ads attribution url"),$t(r,n,"amp-story-auto-ads attribution icon");const o=rt(s,"div",{"role":"button","class":"i-amphtml-attribution-host"}),a=rt(s,"img",{"class":"i-amphtml-story-ad-attribution","src":r});return a.addEventListener("click",(i=>function(t,i){!function(t,i,n,s){let e;try{e=t.open(i,n,void 0)}catch(t){b().error("DOM","Failed to open url on target: ",n,t)}var r;!e&&("number"!=typeof r&&(r=0),r+"noopener".length>"".length||-1==="".indexOf("noopener",r))&&(e=t.open(i,"_top"))}(t,i,"_blank")}(t,e))),_i(o,a,".i-amphtml-story-ad-attribution{position:absolute;bottom:0!important;left:0!important;max-height:15px!important;z-index:4!important}.i-amphtml-story-ad-fullbleed.i-amphtml-story-ad-attribution{bottom:12.5vh!important;left:50%!important;transform:translateX(-22.5vh)!important}\n/*# sourceURL=/extensions/amp-story-auto-ads/0.1/amp-story-auto-ads-attribution.css*/"),n.appendChild(o),a}catch(t){return null}}(this.i,i,S(this.Qpt)))&&this.Ey.subscribe(Qt.UI_STATE,(t=>{this.GE(t)}),!0),this.udt(i))}))}adt(){const t={"ad":"","aria-hidden":!0,"distance":"2","i-amphtml-loading":"","id":this.vi},i=$(this.i,tt);i&&i!=it&&(t["auto-advance-after"]="10s");const n=rt(this.hf,"amp-story-page",t);return Yt(n,"background-color","#212125"),n}cC(){return"fake"===this.lk.type&&(this.lk.id=`i-amphtml-demo-${this.je}`),rt(this.hf,"amp-ad",this.lk)}hdt(){this.rC.signals().whenSignal(s).then((()=>this.pdt()));const t=function(t,i,n,s){let e=t,r=n,o=t=>{try{return r(t)}catch(t){var i,n;throw null===(i=(n=self).__AMP_REPORT_ERROR)||void 0===i||i.call(n,t),t}};const a=function(){if(void 0!==zt)return zt;zt=!1;try{const t={get capture(){return zt=!0,!1}};self.addEventListener("test-options",null,t),self.removeEventListener("test-options",null,t)}catch(t){}return zt}();return e.addEventListener(i,o,!!a&&s),()=>{null==e||e.removeEventListener(i,o,!!a&&s),r=null,e=null,o=null}}(this.i,"message",(i=>{"amp-story-ad-load"===i.data&&this.mdt()&&i.source===this.tdt.contentWindow&&(this.odt=!0,this.Qpt.setAttribute("xdomain-ad",""),this.pdt(),t())}),void 0)}cdt(){const t=vi.get(this.Qpt,!0,!1);t.onGesture(class extends class extends class{constructor(t,i){this.UR=t,this.Nv=i}getType(){return this.UR}signalReady(t){this.Nv.ep(this,t)}signalPending(t){this.Nv._w(this,t)}signalEnd(){this.Nv.gw(this)}signalEmit(t,i){this.Nv.yw(this,t,i)}acceptStart(){}acceptCancel(){}onTouchStart(t){return!1}onTouchMove(t){return!1}onTouchEnd(t){}}{constructor(t,i,n,s){super(t,i),this.$R=n,this.jR=s,this.XM=!1,this.FR=0,this.HR=0,this.BR=0,this.YR=0,this.GR=0,this.WR=0,this.Ir=0,this.qR=0,this.ZR=0,this.XR=0,this.KR=0}onTouchStart(t){const{touches:i}=t;return!!(this.XM&&i&&i.length>1)||!(!i||1!=i.length)&&(this.Ir=Date.now(),this.FR=i[0].clientX,this.HR=i[0].clientY,!0)}onTouchMove(t){const{touches:i}=t;if(i&&i.length>=1){const{clientX:n,clientY:s}=i[0];if(this.BR=n,this.YR=s,this.XM)this.JR(!1,!1,t);else{const t=Math.abs(n-this.FR),i=Math.abs(s-this.HR);if(this.$R&&this.jR)(t>=8||i>=8)&&this.signalReady(-10);else if(this.$R){if(t>=8&&t>i)this.signalReady(-10);else if(i>=8)return!1}else{if(!this.jR)return!1;if(i>=8&&i>t)this.signalReady(-10);else if(t>=8)return!1}}return!0}return!1}onTouchEnd(t){const{touches:i}=t;i&&0==i.length&&this.QR(t)}acceptStart(){this.XM=!0,this.GR=this.FR,this.WR=this.HR,this.ZR=this.Ir,this.FR=this.BR,this.HR=this.YR,this.JR(!0,!1,null)}acceptCancel(){this.XM=!1}JR(t,i,n){this.qR=Date.now();const s=this.qR-this.ZR;if(!i&&s>4||i&&s>16){const t=yi(this.BR-this.GR,s,this.XR),n=yi(this.YR-this.WR,s,this.KR);(!i||s>32||0!=t||0!=n)&&(this.XR=Math.abs(t)>1e-4?t:0,this.KR=Math.abs(n)>1e-4?n:0),this.GR=this.BR,this.WR=this.YR,this.ZR=this.qR}this.signalEmit({first:t,last:i,time:this.qR,deltaX:this.BR-this.FR,deltaY:this.YR-this.HR,startX:this.FR,startY:this.HR,lastX:this.BR,lastY:this.YR,velocityX:this.XR,velocityY:this.KR},n)}QR(t){this.XM&&(this.XM=!1,this.JR(!1,!0,t),this.signalEnd())}}{constructor(t){super("swipe-x",t,!0,!1)}},(()=>{this.uZ("story-ad-swipe",{swipeTime:Date.now()}),t.cleanup()}))}mdt(){return this.tdt?this.tdt:this.tdt=et(S(this.Qpt),"iframe")}pdt(){var t;this.Qpt.getImpl().then((t=>t.delegateVideoAutoplay())),this.Qpt.removeAttribute("i-amphtml-loading"),this.uZ("story-ad-load",{loadTime:Date.now()}),this.mdt()&&!this.odt&&(this.sdt=(t=this.tdt).contentDocument||t.contentWindow.document),J(this.i,"story-ad-allow-fullbleed")&&this.Qpt.classList.add("i-amphtml-fullbleed-ad"),this.W_=!0,this.edt.forEach((t=>t()))}udt(t){return function(t,i,n,s){const e=s["cta-url"],r=s["cta-type"],o=rt(t,"a",{"class":"i-amphtml-story-ad-link","target":"_blank","href":e});return i.fit(n,o,r).then((i=>{if(!i)return null;if(o.href=e,o.textContent=r,"https:"!==o.protocol&&"http:"!==o.protocol)return null;const a=$(t.defaultView,tt);return a==nt||a==st?function(t,i,n){const s=t.createElement("amp-story-page-outlink");s.setAttribute("layout","nodisplay");const e=rt(t,"a",{"class":"i-amphtml-story-ad-link","target":"_top","href":i["cta-url"]});e.textContent=i["cta-type"],s.appendChild(e);for(const t of Ei)i[t]&&s.setAttribute(t,i[t]);return ct(O(t)).installExtensionForDoc(k(t),"amp-story-page-attachment","0.1"),s.className="i-amphtml-story-page-outlink-container",n.appendChild(s),e}(t,s,n):function(t,i,n){const s=i.createElement("amp-story-cta-layer");s.className="i-amphtml-cta-container";const e=rt(i,"div",{"class":"i-amphtml-story-ad-link-root","role":"button"});return _i(e,t,".i-amphtml-story-ad-link{background-color:#fff!important;border-radius:20px!important;box-sizing:border-box!important;bottom:32px!important;box-shadow:0px 2px 12px rgba(0,0,0,.16)!important;color:#4285f4!important;font-family:Roboto,sans-serif!important;font-weight:700!important;height:36px!important;letter-spacing:0.2px!important;line-height:36px!important;overflow:hidden!important;opacity:0;padding:0 10px!important;position:absolute!important;text-align:center!important;text-decoration:none!important;min-width:120px!important;max-width:calc(100vw - 64px)}[cta-active].i-amphtml-story-ad-link{animation-delay:100ms!important;animation-duration:300ms!important;animation-timing-function:cubic-bezier(0.4,0,0.2,1)!important;animation-fill-mode:forwards!important;animation-name:ad-cta!important}@keyframes ad-cta{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}\n/*# sourceURL=/extensions/amp-story-auto-ads/0.1/amp-story-auto-ads-cta-button.css*/"),s.appendChild(e),n.appendChild(s),t}(o,t,n)}))}(this.hf,S(this.Fpt),this.Qpt,t).then((t=>!!t&&(this.ndt=t,t.addEventListener("click",(()=>{const t={clickTime:Date.now()};this.uZ("story-ad-click",t)})),!0)))}ldt(){const t=et(this.sdt.body,"amp-ad-exit");if(t)try{const{children:i}=t;I(1==i.length,"The tag should contain exactly one <script> child.");const n=i[0];I(ot(n),'The amp-ad-exit config should be inside a <script> tag with type="application/json"');const s=function(t){return I("object"==typeof t),t.filters?function(t){const i=["clickDelay","clickLocation","inactiveElement"];for(const n in t)I("object"==typeof t[n],"Filter specification '%s' is malformed",n),I(-1!=i.indexOf(t[n].type),"Supported filters: "+i.join(", "))}(t.filters):t.filters={},t.transport?function(t){for(const i in t)I(i==bi||"image"==i,`Unknown transport option: '${i}'`),I("boolean"==typeof t[i])}(t.transport):t.transport={},function(t,i){I("object"==typeof t,"'targets' must be an object");for(const n in t)Si(n,t[n],i)}(t.targets,t),t}(f(n.textContent)),e=s.targets&&Object.keys(s.targets)&&s.targets[Object.keys(s.targets)[0]],r=e&&e.finalUrl;return e?{[Pi]:r}:{}}catch(t){return b().error("amp-story-auto-ads:page",t),{}}}GE(t){this.idt&&this.idt.classList.toggle("i-amphtml-story-ad-fullbleed",2===t)}uZ(t,i){this.JU.then((n=>n.fireEvent(this.Qpt,this.je,t,i)))}}(this.ji,this.lk,t,this.Qot,S(this.Fpt),S(this.Ey)),e=i.build(),r=i.getId();return this.II[r]=i,this.Xpt.push(r),this.hV.element.appendChild(e),e.getImpl().then((t=>{this.hV.addPage(t)})),i}hasId(t){return!!this.II[t]}getAdPageById(t){return this.II[t]}getIndexById(t){return h(this.Xpt,(i=>i===t))+1}maybeInsertPageAfter(t,i){const n=this.hV.getPageById(t),s=this.hV.getNextPage(n);return s?this.ddt(n)||n.isAd()||s.isAd()?Promise.resolve(0):i.maybeCreateCta().then((n=>n?this.fdt(i,t):(this.discardCurrentAd(),1))):Promise.resolve(0)}fdt(t,i){const n=t.getId();this.hV.insertPage(i,n);const s=this.getIndexById(n),e=this.hV.getPageIndexById(i);return this.JU.then((t=>t.setVar(s,"position",e+1))),this.Adt(),2}Adt(){this.Kpt++,this.uZ("story-ad-insert",{[Jt]:this.Kpt,insertTime:Date.now()})}ddt(t){return t.element.hasAttribute("next-page-no-ad")}uZ(t,i){this.JU.then((n=>n.fireEvent(this.hV.element,i.adIndex,t,i)))}}(this.hV,this.lk),function(t,i){t.__AMP_EXPERIMENT_BRANCHES=t.__AMP_EXPERIMENT_BRANCHES||{};const n={};for(const e of i){var s;const i=e.experimentId;m(t.__AMP_EXPERIMENT_BRANCHES,i)?n[i]=t.__AMP_EXPERIMENT_BRANCHES[i]:null!==(s=e.isTrafficEligible)&&void 0!==s&&s.call(e,t)?!t.__AMP_EXPERIMENT_BRANCHES[i]&&J(t,i)&&(t.__AMP_EXPERIMENT_BRANCHES[i]=F(e.branches),n[i]=t.__AMP_EXPERIMENT_BRANCHES[i]):t.__AMP_EXPERIMENT_BRANCHES[i]=null}}(this.win,[{experimentId:K,isTrafficEligible:()=>!0,branches:[X,q,Z,Q]}]),this.Upt=function(t,i,n){const s=$(t,K);return s&&s!==X?new class{constructor(t,i,n){this._dt=i,this.gdt=this.Pdt(n),this.Edt=t.get(Qt.PAGE_IDS),this.Tdt=[],this.vdt=0}isStoryEligible(){return this.Edt.length>4}initializePages(){const t=this.Edt.length,i=function(t,i){const n=Math.floor(t/i),s=Math.random()<t%i/i?1:0;return Math.min(n+s,4)}(t,this.gdt);return this.Tdt=function(t,i){if(!i)return[];const n=Math.ceil(t/(i+1)),s=t-n,e=[n],r=Math.ceil(s/i);for(let t=1;t<i;t++){const i=n+r*t;e.push(i)}return e}(t,i),i?[this.ydt()]:[]}ydt(){const t=this.Tdt[this.vdt],i=this._dt.createAdPage();return i.registerLoadCallback((()=>{this._dt.maybeInsertPageAfter(this.Edt[t-1],i)})),this.vdt++,i}onPageChange(t){}onNewAdView(t){this.vdt<this.Tdt.length&&this.ydt()}Pdt(t){return t===q?8:t===Z?10:t===Q?12:void 0}}(i,n,s):new class{constructor(t,i){this.Ey=t,this._dt=i,this.bdt=p(),this.Sdt=1,this.Idt=!1,this.Odt=!1}isStoryEligible(){return this.Ey.get(Qt.PAGE_IDS).length>7}initializePages(){return[this._dt.createAdPage()]}onPageChange(t){m(this.bdt,t)||(this.bdt[t]=!0,this.Sdt++),!this.Idt&&!this.Odt&&this.Rdt()&&this._dt.hasUnusedAdPage()&&(this.Odt=!0,this.wdt(t))}onNewAdView(t){this.Idt=!1,this.Sdt=0,this.Mdt(t)&&this._dt.createAdPage()}Mdt(t){return this.Ey.get(Qt.PAGE_IDS).length-t>7}Rdt(){return this.Sdt>=7}wdt(t){const i=this._dt.getUnusedAdPage();i.isLoaded()||!i.hasTimedOut()?i.isLoaded()&&this._dt.maybeInsertPageAfter(t,i).then((t=>{this.Odt=!1,2===t&&(this.Idt=!0)})):this._dt.discardCurrentAd()}}(i,n)}(this.win,this.Ey,this.Bpt),this.Upt.isStoryEligible()&&(this.JU=N(this.element,Ht),this.Ndt(),this.xy(),this.eV())})):n()}Hpt(){const t=lt(this.hf);t.isEmbedded()&&t.sendMessageAwaitResponse("playerExperiments").then((t=>{const i=null==t?void 0:t.experimentIds;i&&i.forEach((t=>{const i=Ni[t];var n,s,e;i&&(n=this.win,s=i,e=t.toString(),n.__AMP_EXPERIMENT_BRANCHES=n.__AMP_EXPERIMENT_BRANCHES||{},function(t,i,n,s){const e=J(t,i),r=null!=n?n:!e;if(r!=e&&(W(t)[i]=r,0)){const n=Y(t);n[i]=r,function(t,i){const n=[];for(const t in i)n.push((!1===i[t]?"-":"")+t);try{var s;null===(s=t.localStorage)||void 0===s||s.setItem(G,n.join(","))}catch(t){v().error("EXPERIMENTS","Failed to save experiments to localStorage.")}}(t,n)}}(n,s,!!e),n.__AMP_EXPERIMENT_BRANCHES[s]=e)}))})).catch((t=>{b().expectedError(Mi,"Player does not support `playerExperiments` message",t)}))}xdt(t){const i=this.Ey.get(Qt.CURRENT_PAGE_ID);t.registerLoadCallback((()=>this.Bpt.maybeInsertPageAfter(i,t).then((()=>this.Vdt(t)))))}Vdt(t){const i=t.getPageElement();i.setAttribute("distance","1"),function(t,i,n,s,e){const r=function(t,i,n,s){const e={detail:n};return Object.assign(e,s),new t.CustomEvent("ampstory:switchpage",e)}(t,0,{"targetPageId":"i-amphtml-ad-page-1","direction":"next"},{bubbles:!0});i.dispatchEvent(r)}(this.win,i)}Wpt(){return new class{constructor(t,i){this.el=t,this.i=i}getConfig(){return(this.el.hasAttribute("src")?this.kdt():this.Ltt(this.el.firstElementChild)).then((t=>this.Cdt(t)))}Cdt(t){const i=t["ad-attributes"];I(i,`${Oi} Error reading config. Top level JSON should have an "ad-attributes" key`),this.Ddt(i.type);for(const t in i){const n=i[t];u(n)&&(i[t]=JSON.stringify(n)),Ri[t]&&delete i[t]}return o(o({},i),{class:"i-amphtml-story-ad",layout:"fill","amp-story":""})}Ltt(t){I(t&&ot(t),`The ${Oi} should be inside a <script> tag with type="application/json"`);const i=f(t.textContent);return Promise.resolve(i)}kdt(){return(t=this.i,R(t,"xhr")).fetchJson(this.el.getAttribute("src")).then((t=>t.json())).catch((t=>{v().error(Oi,"error determining if remote config is valid json: bad url or bad json",t)}));var t}Ddt(t){if(I(!!wi[t],`${Oi} "${t}" ad type is missing or not supported`),"fake"===t){const{id:t}=this.el;I(t&&t.startsWith("i-amphtml-demo-"),`${Oi} id must start with i-amphtml-demo- to use fake ads`)}}}(this.element,this.win).getConfig().then((t=>(this.lk=t,"custom"===t.type&&ct(this.win).installExtensionForDoc(this.element.getAmpDoc(),"amp-mustache","latest"),t)))}Jpt(){return!!this.Ey.get(Qt.CAN_INSERT_AUTOMATIC_AD)}xy(){this.Ey.subscribe(Qt.AD_STATE,(t=>{this.zw(t)})),this.Ey.subscribe(Qt.RTL_STATE,(t=>{this.fM(t)}),!0),this.Ey.subscribe(Qt.UI_STATE,(t=>{this.GE(t)}),!0),this.Ey.subscribe(Qt.CURRENT_PAGE_ID,(t=>{const i=this.Ey.get(Qt.CURRENT_PAGE_INDEX);this.Ldt(i,t)}))}zw(t){this.mutateElement((()=>{t?this.Dpt.setAttribute(xi.AD_SHOWING,""):this.Dpt.removeAttribute(xi.AD_SHOWING)}))}fM(t){this.mutateElement((()=>{t?this.Dpt.setAttribute(xi.DIR,"rtl"):this.Dpt.removeAttribute(xi.DIR)}))}GE(t){this.mutateElement((()=>{const{DESKTOP_FULLBLEED:i,DESKTOP_ONE_PANEL:n}=xi;this.Dpt.removeAttribute(i),this.Dpt.removeAttribute(n),2!==t||this.Gpt||this.Dpt.setAttribute(i,""),4===t&&this.Dpt.setAttribute(n,"")}))}Ndt(){const t=this.hf.createElement("div");t.className="i-amphtml-ad-overlay-host",this.Dpt=this.hf.createElement("aside"),this.Dpt.className="i-amphtml-ad-overlay-container";const i=this.hf.createElement("div");i.className="i-amphtml-story-ad-badge",this.Dpt.appendChild(i),_i(t,this.Dpt,'.i-amphtml-ad-overlay-container{-ms-flex-align:center!important;align-items:center!important;display:-ms-flexbox!important;display:flex!important;height:48px!important;left:0!important;-ms-flex-pack:center!important;justify-content:center!important;pointer-events:none!important;position:absolute!important;top:0!important;width:48px!important;z-index:100001!important}.i-amphtml-ad-overlay-container[dir=rtl]{left:auto!important;right:0!important}.i-amphtml-ad-overlay-container[desktop-fullbleed]{left:calc(50vw - 22.5vh)!important;top:12.5vh!important}.i-amphtml-story-ad-badge-svg{top:50%!important;left:50%!important;position:relative!important;transform:translate(-50%,-50%)!important}.i-amphtml-story-ad-badge{opacity:0!important;width:29px!important;height:20px!important;background:no-repeat 50% url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="29" height="20" fill="none"><path fill="%23fff" d="M9.05 5.2h2.02l3.5 9.3h-1.94l-.78-2.22H8.28L7.5 14.5H5.57zm2.22 5.46-1.21-3.45-1.22 3.45zm5.33 3.61c-2.09-1.4-2.1-4.76 0-6.15 1.15-.69 2.85-.64 3.64.56V5.19h1.68v9.31h-1.58v-.8c-.73 1.22-2.66 1.2-3.74.57m1.93-1.13c1.07 0 1.8-.94 1.8-1.96s-.75-1.93-1.8-1.93c-1.06 0-1.8.93-1.8 1.94 0 1 .75 1.95 1.8 1.95"/></svg>\'),#0003;border-radius:6px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);visibility:hidden!important}[dir=rtl] .i-amphtml-story-ad-badge{margin-left:0px!important;margin-right:16px!important}[ad-showing] .i-amphtml-story-ad-badge{visibility:visible!important;opacity:1!important}.i-amphtml-ad-overlay-container[desktop-one-panel]{top:var(--i-amphtml-story-desktop-one-panel-responsive-margin)!important;left:calc(50vw - var(--i-amphtml-story-desktop-one-panel-width)/2)!important}\n/*# sourceURL=/extensions/amp-story-auto-ads/0.1/amp-story-auto-ads-ad-badge.css*/'),this.hV.element.appendChild(t)}eV(){const t=this.Upt.initializePages();this.Udt(S(t[0]))}Udt(t){this.element.hasAttribute("development")&&"fake"===this.lk.type&&this.xdt(t)}Ldt(t,i){0!==this.Bpt.numberOfAdsCreated()&&(this.Bpt.hasId(i)||this.Upt.onPageChange(i),this.Npt&&this.jdt(),this.Bpt.hasId(i)&&this.zdt(t,i))}jdt(){const t=this.Npt.getId(),i=this.Bpt.getIndexById(t);this.Bdt(),this.uZ("story-ad-exit",{exitTime:Date.now(),[Jt]:i})}zdt(t,i){const n=this.Bpt.getAdPageById(i),s=this.Bpt.getIndexById(i);n.hasBeenViewed()||this.Upt.onNewAdView(t),this.Gdt(n),this.uZ("story-ad-view",{viewTime:Date.now(),[Jt]:s})}Gdt(t){this.mutateElement((()=>{t.toggleVisibility(),this.Npt=t,this.Gpt&&this.Dpt.removeAttribute(xi.DESKTOP_FULLBLEED)}))}Bdt(){this.mutateElement((()=>{this.Npt&&(this.Npt.toggleVisibility(),this.Npt=null)}))}uZ(t,i){this.JU.then((n=>n.fireEvent(this.element,i.adIndex,t,i)))}};t.registerElement("amp-story-auto-ads",Vi,".i-amphtml-story-desktop-fullbleed .i-amphtml-cta-container{bottom:12.5vh!important;top:67.5%!important}.i-amphtml-glass-pane{height:100%!important;width:100%!important;z-index:1!important;pointer-events:auto!important}amp-story-page[xdomain-ad] .i-amphtml-glass-pane{height:80%!important}amp-story-page amp-ad iframe{width:100%;height:100%}amp-story-page amp-ad[data-a4a-upgrade-type=amp-ad-network-doubleclick-impl],amp-story-page amp-ad[type=adsense]{top:0!important;left:0!important;transform:translate(0)!important}.i-amphtml-story-desktop-fullbleed amp-story-grid-layer[template=fill]>amp-ad{left:50%!important;right:auto!important;margin:auto!important;min-height:75vh!important;max-height:75vh!important;min-width:45vh!important;max-width:45vh!important;transform:translateX(-50%)!important}.i-amphtml-story-desktop-fullbleed .i-amphtml-fullbleed-ad amp-story-grid-layer[template=fill]>amp-ad{min-width:100%!important;max-width:100%!important;min-height:100%!important;max-height:100%!important}.i-amphtml-story-desktop-fullbleed .i-amphtml-fullbleed-ad iframe{width:100%!important;height:100%!important}.i-amphtml-story-desktop-fullbleed .i-amphtml-fullbleed-ad .i-amphtml-cta-container{bottom:0!important;top:0!important}\n/*# sourceURL=/extensions/amp-story-auto-ads/0.1/amp-story-auto-ads.css*/.i-amphtml-story-ad-link-root{all:initial!important;color:initial!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-direction:column!important;flex-direction:column!important;-ms-flex-align:center!important;align-items:center!important}\n/*# sourceURL=/extensions/amp-story-auto-ads/0.1/amp-story-auto-ads-shared.css*/"),t.registerServiceForDoc(Ht,class{constructor(t){this.i=t.win,this.Hdt={}}fireEvent(t,i,n,s){this.Jdt(i),Object.assign(this.Hdt[i],s),function(t,i,n={},s=!0){(t=>function(t,i,n,s){const e=x(t,i);if(e)return e;const r=k(t);return r.whenExtensionsKnown().then((()=>{const t=r.getExtensionVersion(n);return t?R(r.win,"extensions").waitForExtension(n,t):null})).then((n=>n?N(t,i):null))}(t,"amp-analytics-instrumentation","amp-analytics"))(t).then((e=>{e&&e.triggerEventForTarget(t,i,n,s)}))}(t,n,this.Hdt[i])}setVar(t,i,n){this.Jdt(t),this.Hdt[t][i]=n}Jdt(t){this.Hdt[t]||(this.Hdt[t]={[Jt]:t,adUniqueId:Ut(this.i)})}})})();
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
/**
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file or at
* https://developers.google.com/open-source/licenses/bsd
*/}});
//# sourceMappingURL=amp-story-auto-ads-0.1.mjs.map