diff --git a/dist/amp-client.min.js b/dist/amp-client.min.js index cca7cef..6fe82d9 100644 --- a/dist/amp-client.min.js +++ b/dist/amp-client.min.js @@ -1 +1 @@ -var AMPClientFactory;(()=>{var t={6384:(t,e,n)=>{var r=n(7040),i=n(4125),o=n(2117),a=n(7518),u=n(4705);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e{var r=n(5639).Uint8Array;t.exports=r},6874:t=>{t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},9932:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n{var r=n(9465),i=n(7813);t.exports=function(t,e,n){(void 0!==n&&!i(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},4865:(t,e,n)=>{var r=n(9465),i=n(7813),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];o.call(t,e)&&i(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},8470:(t,e,n)=>{var r=n(7813);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},9465:(t,e,n)=>{var r=n(8777);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},3118:(t,e,n)=>{var r=n(3218),i=Object.create,o=function(){function t(){}return function(e){if(!r(e))return{};if(i)return i(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=o},8483:(t,e,n)=>{var r=n(5063)();t.exports=r},4239:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},2980:(t,e,n)=>{var r=n(6384),i=n(6556),o=n(8483),a=n(9783),u=n(3218),c=n(1704),l=n(6390);t.exports=function t(e,n,s,f,p){e!==n&&o(n,(function(o,c){if(p||(p=new r),u(o))a(e,n,c,s,t,f,p);else{var y=f?f(l(e,c),o,c+"",e,n,p):void 0;void 0===y&&(y=o),i(e,c,y)}}),c)}},9783:(t,e,n)=>{var r=n(6556),i=n(4626),o=n(7133),a=n(278),u=n(8517),c=n(5694),l=n(1469),s=n(9246),f=n(4144),p=n(3560),y=n(3218),v=n(8630),b=n(6719),h=n(6390),d=n(9881);t.exports=function(t,e,n,m,w,g,S){var E=h(t,n),T=h(e,n),j=S.get(T);if(j)r(t,n,j);else{var k=g?g(E,T,n+"",t,e,S):void 0,O=void 0===k;if(O){var _=l(T),N=!_&&f(T),A=!_&&!N&&b(T);k=T,_||N||A?l(E)?k=E:s(E)?k=a(E):N?(O=!1,k=i(T,!0)):A?(O=!1,k=o(T,!0)):k=[]:v(T)||c(T)?(k=E,c(E)?k=d(E):y(E)&&!p(E)||(k=u(T))):O=!1}O&&(S.set(T,k),w(k,T,m,g,S),S.delete(T)),r(t,n,k)}}},8674:t=>{t.exports=function(t){return function(e){return null==t?void 0:t[e]}}},5976:(t,e,n)=>{var r=n(6557),i=n(5357),o=n(61);t.exports=function(t,e){return o(i(t,e,r),t+"")}},7415:(t,e,n)=>{var r=n(9932);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},4318:(t,e,n)=>{var r=n(1149);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},4626:(t,e,n)=>{t=n.nmd(t);var r=n(5639),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,a=o&&o.exports===i?r.Buffer:void 0,u=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=u?u(n):new t.constructor(n);return t.copy(r),r}},7133:(t,e,n)=>{var r=n(4318);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},278:t=>{t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n{var r=n(4865),i=n(9465);t.exports=function(t,e,n,o){var a=!n;n||(n={});for(var u=-1,c=e.length;++u{var r=n(5976),i=n(6612);t.exports=function(t){return r((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,u=o>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,u&&i(n[0],n[1],u)&&(a=o<3?void 0:a,o=1),e=Object(e);++r{t.exports=function(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),u=a.length;u--;){var c=a[t?u:++i];if(!1===n(o[c],c,o))break}return e}}},3833:(t,e,n)=>{var r=n(7813),i=Object.prototype,o=i.hasOwnProperty;t.exports=function(t,e,n,a){return void 0===t||r(t,i[n])&&!o.call(a,n)?e:t}},8777:(t,e,n)=>{var r=n(852),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},9464:(t,e,n)=>{var r=n(8674)({"&":"&","<":"<",">":">",'"':""","'":"'"});t.exports=r},1994:t=>{var e={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};t.exports=function(t){return"\\"+e[t]}},1957:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},852:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},5924:(t,e,n)=>{var r=n(5569)(Object.getPrototypeOf,Object);t.exports=r},8517:(t,e,n)=>{var r=n(3118),i=n(5924),o=n(5726);t.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:r(i(t))}},6612:t=>{t.exports=function(){return!1}},5726:t=>{t.exports=function(){return!1}},7040:t=>{t.exports=function(){this.__data__=[],this.size=0}},4125:(t,e,n)=>{var r=n(8470),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():i.call(e,n,1),--this.size,!0)}},2117:(t,e,n)=>{var r=n(8470);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},7518:(t,e,n)=>{var r=n(8470);t.exports=function(t){return r(this.__data__,t)>-1}},4705:(t,e,n)=>{var r=n(8470);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},5569:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},5357:(t,e,n)=>{var r=n(6874),i=Math.max;t.exports=function(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,a=-1,u=i(o.length-e,0),c=Array(u);++a{t.exports=/<%-([\s\S]+?)%>/g},6051:t=>{t.exports=/<%([\s\S]+?)%>/g},5712:t=>{t.exports=/<%=([\s\S]+?)%>/g},5639:(t,e,n)=>{var r=n(1957),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},6390:t=>{t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},61:t=>{t.exports=function(t){return t}},9018:(t,e,n)=>{var r=n(8363),i=n(1463),o=n(1704),a=i((function(t,e,n,i){r(e,o(e),t,i)}));t.exports=a},9591:(t,e,n)=>{var r=n(6874),i=n(5976),o=n(4647),a=i((function(t,e){try{return r(t,void 0,e)}catch(t){return o(t)?t:new Error(t)}}));t.exports=a},7813:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},7187:(t,e,n)=>{var r=n(9464),i=n(9833),o=/[&<>"']/g,a=RegExp(o.source);t.exports=function(t){return(t=i(t))&&a.test(t)?t.replace(o,r):t}},6557:t=>{t.exports=function(t){return t}},5694:t=>{t.exports=function(){return!1}},1469:t=>{var e=Array.isArray;t.exports=e},8612:(t,e,n)=>{var r=n(3560),i=n(1780);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},9246:(t,e,n)=>{var r=n(8612),i=n(7005);t.exports=function(t){return i(t)&&r(t)}},4144:t=>{t.exports=function(){return!1}},4647:(t,e,n)=>{var r=n(4239),i=n(7005),o=n(8630);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Error]"==e||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!o(t)}},3560:(t,e,n)=>{var r=n(4239),i=n(3218);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},1780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},3218:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},8630:(t,e,n)=>{var r=n(4239),i=n(5924),o=n(7005),a=Function.prototype,u=Object.prototype,c=a.toString,l=u.hasOwnProperty,s=c.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=l.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==s}},6719:t=>{t.exports=function(){return!1}},3674:(t,e,n)=>{var r=n(5569)(Object.keys,Object);t.exports=r},1704:t=>{t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},2492:(t,e,n)=>{var r=n(2980),i=n(1463)((function(t,e,n){r(t,e,n)}));t.exports=i},1106:(t,e,n)=>{var r=n(9018),i=n(9591),o=n(7415),a=n(3833),u=n(1994),c=n(4647),l=n(6612),s=n(3674),f=n(5712),p=n(5835),y=n(9833),v=/\b__p \+= '';/g,b=/\b(__p \+=) '' \+/g,h=/(__e\(.*?\)|\b__t\)) \+\n'';/g,d=/[()=,{}\[\]\/\s]/,m=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,w=/($^)/,g=/['\n\r\u2028\u2029\\]/g,S=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var E=p.imports._.templateSettings||p;n&&l(t,e,n)&&(e=void 0),t=y(t),e=r({},e,E,a);var T,j,k=r({},e.imports,E.imports,a),O=s(k),_=o(k,O),N=0,A=e.interpolate||w,P="__p += '",R=RegExp((e.escape||w).source+"|"+A.source+"|"+(A===f?m:w).source+"|"+(e.evaluate||w).source+"|$","g"),I=S.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(R,(function(e,n,r,i,o,a){return r||(r=i),P+=t.slice(N,a).replace(g,u),n&&(T=!0,P+="' +\n__e("+n+") +\n'"),o&&(j=!0,P+="';\n"+o+";\n__p += '"),r&&(P+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),N=a+e.length,e})),P+="';\n";var C=S.call(e,"variable")&&e.variable;if(C){if(d.test(C))throw new Error("Invalid `variable` option passed into `_.template`")}else P="with (obj) {\n"+P+"\n}\n";P=(j?P.replace(v,""):P).replace(b,"$1").replace(h,"$1;"),P="function("+(C||"obj")+") {\n"+(C?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(T?", __e = _.escape":"")+(j?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+P+"return __p\n}";var M=i((function(){return Function(O,I+"return "+P).apply(void 0,_)}));if(M.source=P,c(M))throw M;return M}},5835:(t,e,n)=>{var r=n(7187),i={escape:n(9865),evaluate:n(6051),interpolate:n(5712),variable:"",imports:{_:{escape:r}}};t.exports=i},9881:(t,e,n)=>{var r=n(8363),i=n(1704);t.exports=function(t){return r(t,i(t))}},9833:t=>{t.exports=function(t){return t}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,loaded:!1,exports:{}};return t[r](o,o.exports,n),o.loaded=!0,o.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};(()=>{"use strict";n.d(r,{default:()=>hl});var t={};n.r(t),n.d(t,{exclude:()=>G,extract:()=>L,parse:()=>F,parseUrl:()=>z,pick:()=>H,stringify:()=>U,stringifyUrl:()=>$});const e=JSON.parse('{"i8":"1.7.0-beta.2"}');function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t,e){for(var n=0;n\n\n <% if(\'img\' === data.content.type) { %>\n target="<%- data.content.target %>"<% } %>>\n \n <% (data.content.sources || []).forEach(function(source) { %>\n \n <% }); %>\n <%- data.content.alt %>width="<%- banner.positionData.dimensions.width %>"<% } %>\n <% if(null !== banner.positionData.dimensions.height) { %>height="<%- banner.positionData.dimensions.height %>"<% } %>\n <% if(\'\' !== data.content.title) { %>title="<%- data.content.title %>"<% } %>\n <% var loading; if(loading = banner.options.evaluate(\'loading\', 0)) { %>loading="<%- loading %>"<% } %>\n <% var fetchPriority; if(fetchPriority = banner.options.evaluate(\'fetchpriority\', 0)) { %>fetchpriority="<%- fetchPriority %>"<% } %>>\n \n \n <% } else if (\'html\' === data.content.type) { %>\n
\n <%= data.content.html %>\n
\n <% } %>\n\n \n',random:'\n \n',multiple:'\n \n'};function b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,u=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull==t,R=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),I=Symbol("encodeFragmentIdentifier");function C(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function M(t,e){return e.encode?e.strict?R(t):encodeURIComponent(t):t}function x(t,e){return e.decode?_(t):t}function D(t){return Array.isArray(t)?t.sort():"object"==typeof t?D(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function B(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function W(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function L(t){const e=(t=B(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function F(t,e){C((e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e}).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"colon-list-separator":return(t,n,r)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{const i="string"==typeof n&&n.includes(t.arrayFormatSeparator),o="string"==typeof n&&!i&&x(n,t).includes(t.arrayFormatSeparator);n=o?x(n,t):n;const a=i||o?n.split(t.arrayFormatSeparator).map((e=>x(e,t))):null===n?n:x(n,t);r[e]=a};case"bracket-separator":return(e,n,r)=>{const i=/(\[])$/.test(e);if(e=e.replace(/\[]$/,""),!i)return void(r[e]=n?x(n,t):n);const o=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>x(e,t)));void 0!==r[e]?r[e]=[...r[e],...o]:r[e]=o};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[...[n[t]].flat(),e]:n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t)return r;if(!(t=t.trim().replace(/^[?#&]/,"")))return r;for(const i of t.split("&")){if(""===i)continue;const t=e.decode?i.replace(/\+/g," "):i;let[o,a]=N(t,"=");void 0===o&&(o=t),a=void 0===a?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:x(a,e),n(x(o,e),a,r)}for(const[t,n]of Object.entries(r))if("object"==typeof n&&null!==n)for(const[t,r]of Object.entries(n))n[t]=W(r,e);else r[t]=W(n,e);return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{const n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=D(n):t[e]=n,t}),Object.create(null))}function U(t,e){if(!t)return"";C((e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e}).arrayFormatSeparator);const n=n=>e.skipNull&&P(t[n])||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{const i=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[M(e,t),"[",i,"]"].join("")]:[...n,[M(e,t),"[",M(i,t),"]=",M(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[M(e,t),"[]"].join("")]:[...n,[M(e,t),"[]=",M(r,t)].join("")];case"colon-list-separator":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[M(e,t),":list="].join("")]:[...n,[M(e,t),":list=",M(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[M(n,t),e,M(i,t)].join("")]:[[r,M(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,M(e,t)]:[...n,[M(e,t),"=",M(r,t)].join("")]}}(e),i={};for(const[e,r]of Object.entries(t))n(e)||(i[e]=r);const o=Object.keys(i);return!1!==e.sort&&o.sort(e.sort),o.map((n=>{const i=t[n];return void 0===i?"":null===i?M(n,e):Array.isArray(i)?0===i.length&&"bracket-separator"===e.arrayFormat?M(n,e)+"[]":i.reduce(r(n),[]).join("&"):M(n,e)+"="+M(i,e)})).filter((t=>t.length>0)).join("&")}function z(t,e){e={decode:!0,...e};let[n,r]=N(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:F(L(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:x(r,e)}:{}}}function $(t,e){e={encode:!0,strict:!0,[I]:!0,...e};const n=B(t.url).split("?")[0]||"";let r=U({...F(L(t.url),{sort:!1}),...t.query},e);r&&(r=`?${r}`);let i=function(t){let e="";const n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(t.url);if(t.fragmentIdentifier){const r=new URL(n);r.hash=t.fragmentIdentifier,i=e[I]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${i}`}function H(t,e,n){n={parseFragmentIdentifier:!0,[I]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=z(t,n);return $({url:r,query:A(i,e),fragmentIdentifier:o},n)}function G(t,e,n){return H(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const V=t;function q(t){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(t)}function Y(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return K(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nr.status?e(t):n(t)},r.onerror=function(){n({status:"error",data:{code:r.status,error:r.statusText||"unknown"}})};var i=t.endpoint;"GET"===t.method&&(i+="?".concat(V.stringify(t.parameters))),r.open(t.method,i,!0),r.overrideMimeType("application/json"),r.setRequestHeader("Accept","application/json");var o,a=Y(t.headers);try{for(a.s();!(o=a.n()).done;){var u=o.value;r.setRequestHeader(u.name,u.value)}}catch(t){a.e(t)}finally{a.f()}r.send("POST"===t.method?JSON.stringify(t.parameters):null)}}])&&J(e.prototype,n),r&&J(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(S);function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function nt(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ht(this,gt,{writable:!0,value:void 0}),ht(this,St,{writable:!0,value:void 0}),ht(this,Et,{writable:!0,value:void 0}),ht(this,Tt,{writable:!0,value:void 0}),ht(this,jt,{writable:!0,value:void 0}),ht(this,kt,{writable:!0,value:void 0}),ht(this,Ot,{writable:!0,value:function(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var i=t[n][r].value.filter((function(t){return""!==t}));i.length&&(e[n][r]=i)}return e}}),mt(this,gt,e),mt(this,St,n),mt(this,Et,r),mt(this,Tt,{}),mt(this,jt,i),mt(this,kt,o)}var e,n,r;return e=t,n=[{key:"addPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=dt(this,Tt);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,dt(this,jt)),this.addPositionResources(t,e)}},{key:"addPositionResources",value:function(t,e){for(var n in e)this.addPositionResource(t,e[n])}},{key:"addPositionResource",value:function(t,e){if(!(e instanceof pt))throw new TypeError("Argument resource must be instance of Resource class.");var n=dt(this,Tt);if(!(t in n))throw new Error('Missing position "'+t+'".');var r=n[t];e.name in r?r[e.name]=r[e.name].withValues(e.value):r[e.name]=e}},{key:"method",get:function(){return dt(this,gt)}},{key:"endpoint",get:function(){return dt(this,St)}},{key:"locale",get:function(){return dt(this,Et)}},{key:"parameters",get:function(){var t=dt(this,Ot).call(this,dt(this,Tt)),e={query:"GET"===this.method?JSON.stringify(t):t};return null!==this.locale&&(e.locale=this.locale),e}},{key:"headers",get:function(){return dt(this,kt)}}],n&&bt(e.prototype,n),r&&bt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Nt(t){return Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(t)}function At(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var i in"1"!==(r["omit-default-resources"]||"0").toString()?e=function(t){for(var e=1;e]+)>/g,(function(t,e){var n=o[e];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof i){var a=this;return t[Symbol.replace].call(this,n,(function(){var t=arguments;return"object"!=ce(t[t.length-1])&&(t=[].slice.call(t)).push(r(t,a)),i.apply(this,t)}))}return t[Symbol.replace].call(this,n,i)},le.apply(this,arguments)}function se(t,e){return se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},se(t,e)}var fe=le(/^(?:(\d+)\x2D(\d+):|(\d+):|<(\d+):|<=(\d+):|>(\d+):|>=(\d+):)?([^:\s]+)$/,{INTERVAL_FROM:1,INTERVAL_TO:2,EQ:3,LT:4,LTE:5,GT:6,GTE:7,VALUE:8}),pe={};function ye(t,e){var n=function(t){if(t in pe)return pe[t];for(var e=t.split(",").map((function(t){return t.trim()})),n=[],r=0;r=this.from&&t<=this.to}};break;case void 0!==i.groups.EQ:o={eq:parseInt(i.groups.EQ),matches:function(t){return t===this.eq}};break;case void 0!==i.groups.LT:o={lt:parseInt(i.groups.LT),matches:function(t){return tthis.gt}};break;case void 0!==i.groups.GTE:o={gte:parseInt(i.groups.GTE),matches:function(t){return t>=this.gte}};break;default:o={matches:function(){return!0}}}o&&(o.matches=o.matches.bind(o),o.value=i.groups.VALUE,n.push(o))}}var a={rules:n,cache:{}};return a.evaluate=function(t){Number.isInteger(t)||(t=parseInt(t));var e="i_".concat(t);if(e in this.cache)return this.cache[e];for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}},{key:"evaluate",value:function(t,e){return void 0===this.options[t]?null:ye(this.options[t],e)}},{key:"override",value:function(t){this.options=he(he({},this.options),Se(this,Ee,je).call(this,he({},t)))}}],n&&me(e.prototype,n),r&&me(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function je(t){if("loading-offset"in t){var e=t["loading-offset"],n="loading"in t?t.loading:"loading"in this.options?this.options.loading:null,r=null!==n?">=".concat(e,":").concat(n):null,i='AMP deprecation warning: The banner option "loading-offset" is deprecated and will be removed in some future release.';null!==r&&(i+=' Instead of options {"loading": "'.concat(n,'", "loading-offset": "').concat(e,'"} use an expression based option {"loading": "').concat(r,'"}.')),console.warn(i),delete t["loading-offset"],null!==r&&(t.loading=r)}return t}function ke(t){return ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ke(t)}function Oe(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";if(-1===this.STATE.STATES.indexOf(t))throw new TypeError("".concat(t," is not valid state."));Ae(this,Me,t),Ae(this,xe,e.toString()),Ne(this,De)[t]=(Ne(this,De)[t]||0)+1,this._eventBus.dispatch(ie.ON_BANNER_STATE_CHANGED,{banner:this})}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t.startsWith("amp:banner:"))throw new Error('Unable to attach listener on event "'.concat(t,'" through a banner.'));return this._eventBus.subscribe(t,(function(t){t.banner===this&&(null!==n?e.call(n,t):e(t))}),this)}},{key:"getCurrentBreakpoint",value:function(t){return null}},{key:"overrideOptions",value:function(t){Ne(this,Ce).override(t)}},{key:"redrawIfNeeded",value:function(){}},{key:"isManaged",value:function(){return!1}},{key:"isExternal",value:function(){return!1}},{key:"isEmbed",value:function(){return!1}}],n&&Oe(e.prototype,n),r&&Oe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function We(t){return We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},We(t)}function Le(t,e){for(var n=0;n=c&&(null===o||oc))&&(i=u,o=c,tn(t,cn)[n]=c)):r=u})),null===i&&null===r)throw new Error("Unable to resolve content, no contents found.");a.sort((function(t,e){return t-e})),"min"===n?a.unshift(null):a.push(null);var u=a.indexOf(o);return"max"===n&&u-1 in a&&(tn(this,cn).min=a[u-1]),"min"===n&&u+1 in a&&(tn(this,cn).max=a[u+1]),en(this,un,null!==i?i:r)}},{key:"needRedraw",value:function(){if(null===tn(this,un))return!0;var t=tn(this,rn).width;return null!==tn(this,cn).min&&ttn(this,cn).max}}])&&Qe(e.prototype,n),r&&Qe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fn(t,e){for(var n in t)e(t[n],n)}function pn(t){return pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pn(t)}function yn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return vn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function vn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"weight",n={},r=0,i=0;i0;)u-=n[a],a++;return t[--a]?t[a]:t[0]}}],(n=null)&&Cn(e.prototype,n),r&&Cn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function xn(t){return xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xn(t)}function Dn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Bn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n6&&void 0!==arguments[6]?arguments[6]:{},s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};for(var f in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),$n(Un(c=i.call(this,n,r,a,u,s)),ir),$n(Un(c),rr),Hn(Un(c),Jn,{writable:!0,value:void 0}),Hn(Un(c),Qn,{writable:!0,value:void 0}),Hn(Un(c),Xn,{writable:!0,value:[]}),Hn(Un(c),Zn,{writable:!0,value:void 0}),Hn(Un(c),tr,{writable:!0,value:!1}),Hn(Un(c),er,{writable:!0,value:null}),Hn(Un(c),nr,{writable:!0,value:[]}),Yn(Un(c),Jn,t),Yn(Un(c),Qn,e),Yn(Un(c),Zn,l),l)qn(Un(c),Xn).push(new pt(f,l[f]));return c.setState(c.STATE.NEW,"Banner created."),c}return e=o,(n=[{key:"html",set:function(t){this.element.innerHTML=t}},{key:"resources",get:function(){return qn(this,Xn)}},{key:"rawResources",get:function(){return qn(this,Zn)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new Rn(this)}},{key:"fingerprints",get:function(){var t;try{t=this.bannerData}catch(t){return[]}return null===t?[]:(this.positionData.isMultiple()||(t=[t]),t.map((function(t){return t.fingerprint})))}},{key:"bannerData",get:function(){if(null!==qn(this,er))return qn(this,er);if(!qn(this,nr).length)return null;var t=null,e=this.positionData,n=function(t){return Fe.createFromProperties({bannerId:t.id,bannerName:t.name,positionId:e.id,positionCode:e.code,positionName:e.name,campaignId:t.campaignId,campaignCode:t.campaignCode,campaignName:t.campaignName})};switch(!0){case e.isSingle():(t=qn(this,nr).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=Mn.randomByWeights(qn(this,nr),"score")).fingerprint=n(t);break;case e.isMultiple():var r,i=Dn(t=qn(this,nr).sort((function(t,e){return e.score-t.score})));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.fingerprint=n(o)}}catch(t){i.e(t)}finally{i.f()}break;default:throw new Error("Invalid display type ".concat(this.displayType,"."))}return Yn(this,er,t),t}},{key:"unsetFingerprint",value:function(t){var e=t.bannerId,n=this.positionData;if(qn(this,nr).filter((function(t){return t.id===e}))[0]){switch(!0){case n.isSingle():Yn(this,nr,[]),Yn(this,er,null);break;case n.isRandom():qn(this,er)&&qn(this,er).id===e?(Yn(this,nr,[]),Yn(this,er,null)):Yn(this,nr,qn(this,nr).filter((function(t){return t.id!==e})));break;case n.isMultiple():Yn(this,nr,qn(this,nr).filter((function(t){return t.id!==e}))),qn(this,er)&&Yn(this,er,qn(this,er).filter((function(t){return t.id!==e})))}0>=qn(this,nr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):n.isRandom()&&this.redrawIfNeeded()}}},{key:"setResponseData",value:function(t){if(qn(this,tr))throw new Error("Data for banner on position ".concat(this.position," is already set."));this._positionData=new ue({id:t.position_id||null,code:this._positionData.code,name:t.position_name||null,rotationSeconds:t.rotation_seconds,displayType:t.display_type,breakpointType:t.breakpoint_type,dimensions:t.dimensions||{width:null,height:null}}),"options"in t&&this.overrideOptions(t.options);var e=[];for(var n in t.banners||[])e.push(new Tn(t.banners[n],t.breakpoint_type,qn(this,Jn)));Yn(this,nr,e),Yn(this,tr,!0),0>=qn(this,nr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):Vn(this,rr,ar).call(this,"Banner was successfully rendered.")}},{key:"getCurrentBreakpoint",value:function(t){var e=this.bannerData,n=(e=(Array.isArray(e)?e:e?[e]:[]).find((function(e){return e.id===t})))&&e.content?e.content.breakpoint:null;return null===n?null:parseInt(n)}},{key:"isManaged",value:function(){return!0}},{key:"redrawIfNeeded",value:function(){Vn(this,ir,ur).call(this)&&Vn(this,rr,ar).call(this,"Banner was successfully redrawn.")}}])&&Wn(e.prototype,n),r&&Wn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(Be);function ar(t){try{this.html=qn(this,Qn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function ur(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function cr(t){return cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cr(t)}function lr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return sr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function br(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=Er(this,kr).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){var e=Er(this,Or)[t]||null;if(null===e)return null;if(Er(this,_r))return e.content?e.content.breakpoint:null;var n,r=vr(e.contents);try{for(r.s();!(n=r.n()).done;){var i=n.value;if("none"!==getComputedStyle(i.data).display)return i.breakpoint}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"isExternal",value:function(){return!0}},{key:"delegateResponsiveBehaviour",value:function(){if(!Er(this,_r)){Tr(this,_r,!0);var t,e=vr(this.element.querySelectorAll("style"));try{for(e.s();!(t=e.n()).done;)t.value.remove()}catch(t){e.e(t)}finally{e.f()}this.redrawIfNeeded()}}},{key:"redrawIfNeeded",value:function(){if(Er(this,_r))for(var t in Er(this,Or)){var e=Er(this,Or)[t];if(e.needRedraw()){var n,r=e.content,i=vr(e.contents);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.data.style.display=o===r?"block":"none"}}catch(t){i.e(t)}finally{i.f()}}}}}])&&hr(e.prototype,n),r&&hr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(Be);function Ar(t){return Ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ar(t)}function Pr(t,e){for(var n=0;n=Dr(this,Fr).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){throw new Error("Method EmbedBanner.getCurrentBreakpoint() is not readable.")}},{key:"isEmbed",value:function(){return!0}},{key:"updatePositionData",value:function(t){for(var e=this.positionData,n=0,r=["id","name","rotationSeconds","displayType","breakpointType","dimensions"];n0&&void 0!==arguments[0]?arguments[0]:1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Hr(this,qr,{writable:!0,value:void 0}),Gr(this,qr,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return Gr(this,qr,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,Vr(e,qr,"get")),++t))}}])&&$r(e.prototype,n),r&&$r(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Kr(t,e){if(t instanceof e.HTMLElement)return t;if("string"!=typeof t)throw new TypeError("Element must be instance of HTMLElement or String");var n;if(!((n="#"===t.charAt(0)?document.getElementById(t.slice(1)):document.querySelector(t))instanceof e.HTMLElement))throw new TypeError("Selector "+t+" is invalid.");return n}function Jr(t){return Jr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jr(t)}function Qr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Xr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Xr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ti(this,ii,{writable:!0,value:void 0}),ti(this,oi,{writable:!0,value:void 0}),ti(this,ai,{writable:!0,value:void 0}),ti(this,ui,{writable:!0,value:void 0}),ti(this,ci,{writable:!0,value:[]}),ni(this,ii,e),ni(this,oi,n),ni(this,ai,r),ni(this,ui,new Yr),this.STATE=ee}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){(t=Kr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:window)).setAttribute("data-amp-attached","");var e=new Nr(ei(this,oi),ei(this,ii),ei(this,ui).getNextIdentifier(),t);return ei(this,ci).push(e),e}},{key:"addManagedBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;if(null===ei(this,ai))throw new Error("Unable to add managed banner, renderer is not provided.");(t=Kr(t,i)).setAttribute("data-amp-attached","");var o=new or(ei(this,oi),ei(this,ai),ei(this,ii),ei(this,ui).getNextIdentifier(),t,e,n,r);return ei(this,ci).push(o),o}},{key:"addEmbedBanner",value:function(t,e,n,r){t=Kr(t,window),e=Kr(e,window),t.setAttribute("data-amp-attached","");var i=new Ur(ei(this,ii),ei(this,ui).getNextIdentifier(),t,e,n,r);return ei(this,ci).push(i),i}},{key:"removeBanner",value:function(t){var e=ei(this,ci).length;return ni(this,ci,ei(this,ci).filter((function(e){return e!==t}))),e!==ei(this,ci).length}},{key:"getBannersByState",value:function(t){var e=t.state,n=t.managed,r=void 0===n||n,i=t.external,o=void 0===i||i,a=t.embed,u=void 0===a||a;return ei(this,ci).filter((function(t){return t instanceof Be&&t.state===e&&!(t instanceof or&&!r||t instanceof Nr&&!o||t instanceof Ur&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Fe?t.value:t,r=Qr(ei(this,ci));try{for(r.s();!(e=r.n()).done;){var i=e.value;if(!(i instanceof Ur)){var o,a=Qr(i.fingerprints);try{for(a.s();!(o=a.n()).done;)if(o.value.value===n)return i}catch(t){a.e(t)}finally{a.f()}}}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"getBannerByUid",value:function(t){var e,n=Qr(ei(this,ci));try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.uid===t)return r}}catch(t){n.e(t)}finally{n.f()}return null}}],n&&Zr(e.prototype,n),r&&Zr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function si(t){return si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},si(t)}function fi(t,e){for(var n=0;nEi(this,Ni)&&n.splice(n.length-Ei(this,Ni)),Ti(this,Ai,n),ki(this,Ri,xi).call(this))}},{key:"isClosed",value:function(t){return-1!==ki(this,Pi,Mi).call(this).indexOf(t)}}])&&mi(e.prototype,n),r&&mi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Mi(){if(null!==Ei(this,Ai))return Ei(this,Ai);var t=Ei(this,Oi).getItem(Ei(this,_i)),e=null!==t&&""!==t?t.split(","):[];return Ti(this,Ai,e)}function xi(){null!==Ei(this,Ai)&&Ei(this,Oi).setItem(Ei(this,_i),Ei(this,Ai).join(","))}function Di(){var t={items:{}};return t.setItem=function(t,e){this.items[t]=e}.bind(t),t.getItem=function(t){return t in this.items?this.items[t]:null}.bind(t),t}function Bi(t){return Bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bi(t)}function Wi(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Ji(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("function"!=typeof e)throw new TypeError("Listener must be of type function.");var o="idx_"+Zi(this,no).getNextIdentifier();return Zi(this,ro)[t]=Zi(this,ro)[t]||{},Zi(this,ro)[t][o]={callback:e,scope:r,priority:i},t in Zi(this,io)&&delete Zi(this,io)[t],function(){t in Zi(n,ro)&&o in Zi(n,ro)[t]&&delete Zi(n,ro)[t][o]}}},{key:"dispatch",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;re.priority?-1:t.priority=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Ao(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=u.pixels)return u.ratio}}catch(t){o.e(t)}finally{o.f()}return r};return new IntersectionObserver((function(r){var i,a=[],u={},l={},s=No(r);try{for(s.s();!(i=s.n()).done;){var f=i.value,p=f.target.dataset.ampBannerFingerprint,y=t.getBannerByFingerprint(p);if(y){var v=n[p];if(v){var b={fingerprint:v.fingerprint,element:f.target,banner:y};if(a.push(Oo(Oo({},b),{},{entry:f})),!v.alreadySeen){var h=f.intersectionRatio>=c(f.target);u[p]=!(p in u)||!u[p].isIntersecting&&h?{fingerprintArgs:b,fingerprintMetadata:v,isIntersecting:h}:u[p]}if(!v.alreadyFullySeen){var d=.99<=f.intersectionRatio;l[p]=!(p in l)||!l[p].isFullyIntersecting&&d?{fingerprintArgs:b,fingerprintMetadata:v,isFullyIntersecting:d}:l[p]}}}}}catch(t){s.e(t)}finally{s.f()}for(var m=function(){var t=g[w],n=t.fingerprintArgs,r=t.fingerprintMetadata,i=t.isIntersecting;i&&!r.alreadySeen&&null===r.firstTimeSeenTimeoutId?r.firstTimeSeenTimeoutId=setTimeout((function(){r.alreadySeen=!0,e.dispatch(ie.ON_BANNER_FIRST_TIME_SEEN,n)}),o):i||null===r.firstTimeSeenTimeoutId||(clearTimeout(r.firstTimeSeenTimeoutId),r.firstTimeSeenTimeoutId=null)},w=0,g=Object.values(u);w=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function xo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function aa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=":"<=").concat(i);var o={};return o[e.params.channel_code]=fa(a,ha),o[e.params.banner_id]=n.bannerId,o[e.params.banner_name]=n.bannerName,o[e.params.position_id]=n.positionId,o[e.params.position_code]=n.positionCode,o[e.params.position_name]=n.positionName,o[e.params.campaign_id]=n.campaignId,o[e.params.campaign_code]=n.campaignCode,o[e.params.campaign_name]=n.campaignName,o[e.params.breakpoint]=i,o}}),pa(this,va,e),pa(this,ba,n),pa(this,ha,r),pa(this,da,!1)}var e,n,r;return e=t,(n=[{key:"collectBeforeAttach",value:function(){var t=this;if(!fa(this,ma).started&&!fa(this,da)){fa(this,ma).started=!0;var e=fa(this,ba),n=new ra({});fa(this,ma).cleanup.push(e.subscribe(ie.ON_BANNER_STATE_CHANGED,(function(e){var r=e.banner;if(!r.isEmbed()&&ee.RENDERED===r.state&&1===r.stateCounter){var i,o=oa(r.fingerprints);try{for(o.s();!(i=o.n()).done;){var a=i.value;fa(t,ma).events.push({name:Zo.BANNER_LOADED,params:fa(t,wa).call(t,{config:n,fingerprint:a,banner:r})})}}catch(t){o.e(t)}finally{o.f()}}}))),fa(this,ma).cleanup.push(e.subscribe(ie.ON_BANNER_FIRST_TIME_SEEN,(function(e){var r=e.fingerprint,i=e.banner;fa(t,ma).events.push({name:Zo.BANNER_DISPLAYED,params:fa(t,wa).call(t,{config:n,fingerprint:r,banner:i})})}))),fa(this,ma).cleanup.push(e.subscribe(ie.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(e){var r=e.fingerprint,i=e.banner;fa(t,ma).events.push({name:Zo.BANNER_FULLY_DISPLAYED,params:fa(t,wa).call(t,{config:n,fingerprint:r,banner:i})})}))),fa(this,ma).cleanup.push(e.subscribe(ie.ON_BANNER_LINK_CLICKED,(function(e){var r=e.fingerprint,i=e.banner,o=e.target,a=fa(t,wa).call(t,{config:n,fingerprint:r,banner:i});a[n.params.link]=o.href||"",fa(t,ma).events.push({name:Zo.BANNER_CLICKED,params:a})}))),fa(this,ma).cleanup.push(e.subscribe(ie.ON_BANNER_AFTER_CLOSE,(function(e){var r=e.fingerprint,i=e.banner;fa(t,ma).events.push({name:Zo.BANNER_CLOSED,params:fa(t,wa).call(t,{config:n,fingerprint:r,banner:i})})})))}}},{key:"attach",value:function(t){var e=this;if(!fa(this,da)){pa(this,da,!0);var n=fa(this,ba),r=fa(this,va);if(r.hasAnyReceiver()){var i=t.events[Zo.BANNER_LOADED],o=t.events[Zo.BANNER_DISPLAYED],a=t.events[Zo.BANNER_FULLY_DISPLAYED],u=t.events[Zo.BANNER_CLICKED],c=t.events[Zo.BANNER_CLOSED];if(fa(this,ma).started){for(var l in fa(this,ma).events){var s=fa(this,ma).events[l],f=s.name,p=s.params;if(!1!==t.events[f]){var y={};for(var v in p)y[t.params[v]]=p[v];r.send(t.events[f],y)}}sa(this,ga,Ea).call(this)}!1!==i&&n.subscribe(ie.ON_BANNER_STATE_CHANGED,(function(n){var o=n.banner;if(!o.isEmbed()&&ee.RENDERED===o.state&&1===o.stateCounter){var a,u=oa(o.fingerprints);try{for(u.s();!(a=u.n()).done;){var c=a.value;r.send(i,fa(e,wa).call(e,{config:t,fingerprint:c,banner:o}))}}catch(t){u.e(t)}finally{u.f()}}})),!1!==o&&n.subscribe(ie.ON_BANNER_FIRST_TIME_SEEN,(function(n){var i=n.fingerprint,a=n.banner;r.send(o,fa(e,wa).call(e,{config:t,fingerprint:i,banner:a}))})),!1!==a&&n.subscribe(ie.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(n){var i=n.fingerprint,o=n.banner;r.send(a,fa(e,wa).call(e,{config:t,fingerprint:i,banner:o}))})),!1!==u&&n.subscribe(ie.ON_BANNER_LINK_CLICKED,(function(n){var i=n.fingerprint,o=n.banner,a=n.target,c=fa(e,wa).call(e,{config:t,fingerprint:i,banner:o});c[t.params.link]=a.href||"",r.send(u,c)})),!1!==c&&n.subscribe(ie.ON_BANNER_AFTER_CLOSE,(function(n){var i=n.fingerprint,o=n.banner;r.send(c,fa(e,wa).call(e,{config:t,fingerprint:i,banner:o}))}))}else sa(this,ga,Ea).call(this)}}}])&&ua(e.prototype,n),r&&ua(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ea(){for(var t in fa(this,ma).cleanup)fa(this,ma).cleanup[t]();fa(this,ma).events=[],fa(this,ma).cleanup=[]}var Ta=!1;const ja=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!Ta&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(Ta=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var ka=!1;const Oa=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!ka&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(ka=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function _a(t){return _a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_a(t)}function Na(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Aa(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==_a(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==_a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===_a(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Pa=!1;const Ra=function(t,e){if(!("dataLayer"in window))return!Pa&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(Pa=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.dataLayer.push(function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function xa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:"*";t.postMessage({message:e,data:n},r)}},{key:"listen",value:function(){var t=this;window.addEventListener("message",(function(e){if(!(0=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function tu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Iu(t,e){if(t){if("string"==typeof t)return Cu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cu(t,e):void 0}}function Cu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1f||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==d(e.metrics))throw new Error('The option "metrics" must be an object of the format { receiver: null|string|function|array, events: object{ *: string|false }, params: object{ *: string } }, '.concat(e.metrics," passed."));if(null!==e.metrics.receiver&&-1===["string","function"].indexOf(d(e.metrics.receiver))&&!Array.isArray(e.metrics.receiver))throw new Error('The option "metrics.receiver" must be a null or a string or a function or an array of strings|functions, "'.concat(e.metrics.receiver,'" passed.'));if(Array.isArray(e.metrics.receiver)){for(var p in e.metrics.receiver)if(-1===["string","function"].indexOf(d(e.metrics.receiver[p])))throw new Error('The option "metrics.receiver.'.concat(p,'" must be a string or a function, "').concat(e.metrics.receiver[p],'" passed.'))}else e.metrics.receiver=null!==e.metrics.receiver?[e.metrics.receiver]:[];if("object"!==d(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==d(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==d(e.closing)||"string"!=typeof e.closing.storage||"string"!=typeof e.closing.key||!Number.isInteger(e.closing.maxItems)||1>e.closing.maxItems)throw new Error('The option "closing" must be an object of the format { storage: "memoryStorage"|"localStorage"|"sessionStorage", key: string, maxItems: integer<1, max> }, '.concat(JSON.stringify(e.closing)," passed."));return e}(n)),Wu(this,zu,new oo),Wu(this,$u,new Lt(n.method,n.url,n.version,n.channel)),Wu(this,Hu,new Xt(n.url,n.version,n.channel)),Wu(this,Vu,new li(Bu(this,zu),hi.fromCurrentWindow(),new To(n.template))),Wu(this,qu,new Ko(Bu(this,Vu),Bu(this,zu),n.interaction)),Wu(this,Ku,za.createFromReceivers(n.metrics.receiver)),Wu(this,Ju,new Sa(Bu(this,Ku),Bu(this,zu),n.channel)),Wu(this,Qu,new Tu({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction,metrics:{events:n.metrics.events,params:n.metrics.params}}},bannerManager:Bu(this,Vu),metricsSender:Bu(this,Ku)})),Wu(this,Yu,new qi({bannerManager:Bu(this,Vu),eventBus:Bu(this,zu),config:{storage:n.closing.storage,key:n.closing.key,maxItems:n.closing.maxItems},frameMessenger:Bu(this,Qu)})),this.setLocale(n.locale),Bu(this,$u).origin=n.origin,n.resources)Bu(this,$u).addDefaultResource(a,n.resources[a]),Bu(this,Hu).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=Ru(Bu(o,Vu).getBannersByState({state:Bu(o,Vu).STATE.RENDERED,managed:!0,external:!0,embed:!1}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}})),Bu(this,Qu).listen(),Bu(this,Ju).attach(new ra({events:n.metrics.events,params:n.metrics.params})),Bu(this,qu).start(),Bu(this,Yu).attachUi()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Bu(this,Fu)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Bu(this,zu).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Bu(this,$u).locale=t,Bu(this,Hu).locale=t}},{key:"setGateway",value:function(t){if(!function(t){return t instanceof S}(t))throw new TypeError("Argument gateway mut be instance of AbstractGateway.");Wu(this,Gu,t)}},{key:"getGateway",value:function(){return null===Bu(this,Gu)&&this.setGateway(new tt),Bu(this,Gu)}},{key:"createBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"managed",o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:window;if(t=Kr(t,o),"embed"===i){var a=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,Xu,tc).call(this,t,e,n,r),u=Bu(this,Vu).addEmbedBanner(t,a,e,r);return Bu(this,Qu).connectBanner(u),t.insertAdjacentElement("beforeend",a),u}return Bu(this,Vu).addManagedBanner(t,e,n,r,o)}},{key:"closeBanner",value:function(t){Bu(this,Yu).closeBanner(t)}},{key:"attachBanners",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,r=Ru(e.querySelectorAll("[data-amp-banner]:not([data-amp-attached])"));try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.dataset.ampBanner;if(o){var a=void 0;if("ampBannerExternal"in i.dataset)a=Bu(this,Vu).addExternalBanner(i,n);else{var u=pr.parseResources(i),c=pr.parseOptions(i),l=i.dataset.ampMode||"managed";a=this.createBanner(i,o,u,c,l,n)}Bu(this,zu).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:a})}else console.warn("Unable to attach a banner to the element ",i,' because the attribute "data-amp-banner" has an empty value.')}}catch(t){r.e(t)}finally{r.f()}}},{key:"fetch",value:function(){var t=this,e=Bu(this,Vu).getBannersByState({state:Bu(this,Vu).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Bu(this,$u).create(),i=Ru(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r.addPosition(o.position,o.resources,"1"!==o.options.get("omit-default-resources","0").toString())}}catch(t){i.e(t)}finally{i.f()}Bu(this,zu).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,i=n.data,o=Ru(e);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.position in i&&"banners"in i[a.position]&&Object.values(i[a.position].banners).length){for(var u=i[a.position],c=Array.isArray(u.banners)?u.banners:Object.values(u.banners),l=[],s=0;st.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1a||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==rc(e.metrics))throw new Error('The option "metrics" must be an object of the format { events: object{ *: string|false }, params: object{ *: string } }, '.concat(JSON.stringify(e.metrics)," passed."));if("object"!==rc(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==rc(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));return e}function ac(t){return ac="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ac(t)}function uc(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return cc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cc(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function cc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Uc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;return qc(this,Zc).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(qc(this,al))throw new Error("Method attachBanner() should be called only once.");var t=document.querySelector("[data-amp-banner]:not([data-amp-attached])");if(t){var e=qc(this,tl).addExternalBanner(t);Yc(this,al,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),qc(this,Zc).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:e})}else console.warn("No banner found in the embed client.")}}],n&&zc(e.prototype,n),r&&zc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fl(t,e){qc(this,el).sendToParent("metrics",{eventName:t,eventArgs:e})}function pl(){var t,e=Fc(qc(this,tl).getBannersByState({state:ee.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function yl(t){return yl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yl(t)}function vl(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new Zu(new p(bl,"standard@".concat(bl)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new sl(new p(bl,"embed@".concat(bl)),t)}},{key:"version",get:function(){return bl}}],(n=null)&&vl(e.prototype,n),r&&vl(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()})(),AMPClientFactory=r.default})(); \ No newline at end of file +var AMPClientFactory;(()=>{var t={6384:(t,e,n)=>{var r=n(7040),o=n(4125),i=n(2117),a=n(7518),u=n(4705);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e{var r=n(5639).Uint8Array;t.exports=r},6874:t=>{t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},9932:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n{var r=n(9465),o=n(7813);t.exports=function(t,e,n){(void 0!==n&&!o(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},4865:(t,e,n)=>{var r=n(9465),o=n(7813),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];i.call(t,e)&&o(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},8470:(t,e,n)=>{var r=n(7813);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},9465:(t,e,n)=>{var r=n(8777);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},3118:(t,e,n)=>{var r=n(3218),o=Object.create,i=function(){function t(){}return function(e){if(!r(e))return{};if(o)return o(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=i},8483:(t,e,n)=>{var r=n(5063)();t.exports=r},4239:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},2980:(t,e,n)=>{var r=n(6384),o=n(6556),i=n(8483),a=n(9783),u=n(3218),c=n(1704),l=n(6390);t.exports=function t(e,n,s,f,p){e!==n&&i(n,(function(i,c){if(p||(p=new r),u(i))a(e,n,c,s,t,f,p);else{var y=f?f(l(e,c),i,c+"",e,n,p):void 0;void 0===y&&(y=i),o(e,c,y)}}),c)}},9783:(t,e,n)=>{var r=n(6556),o=n(4626),i=n(7133),a=n(278),u=n(8517),c=n(5694),l=n(1469),s=n(9246),f=n(4144),p=n(3560),y=n(3218),v=n(8630),b=n(6719),h=n(6390),m=n(9881);t.exports=function(t,e,n,d,w,g,S){var E=h(t,n),j=h(e,n),O=S.get(j);if(O)r(t,n,O);else{var T=g?g(E,j,n+"",t,e,S):void 0,k=void 0===T;if(k){var _=l(j),P=!_&&f(j),N=!_&&!P&&b(j);T=j,_||P||N?l(E)?T=E:s(E)?T=a(E):P?(k=!1,T=o(j,!0)):N?(k=!1,T=i(j,!0)):T=[]:v(j)||c(j)?(T=E,c(E)?T=m(E):y(E)&&!p(E)||(T=u(j))):k=!1}k&&(S.set(j,T),w(T,j,d,g,S),S.delete(j)),r(t,n,T)}}},8674:t=>{t.exports=function(t){return function(e){return null==t?void 0:t[e]}}},5976:(t,e,n)=>{var r=n(6557),o=n(5357),i=n(61);t.exports=function(t,e){return i(o(t,e,r),t+"")}},7415:(t,e,n)=>{var r=n(9932);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},4318:(t,e,n)=>{var r=n(1149);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},4626:(t,e,n)=>{t=n.nmd(t);var r=n(5639),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o?r.Buffer:void 0,u=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=u?u(n):new t.constructor(n);return t.copy(r),r}},7133:(t,e,n)=>{var r=n(4318);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},278:t=>{t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n{var r=n(4865),o=n(9465);t.exports=function(t,e,n,i){var a=!n;n||(n={});for(var u=-1,c=e.length;++u{var r=n(5976),o=n(6612);t.exports=function(t){return r((function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,u=i>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,u&&o(n[0],n[1],u)&&(a=i<3?void 0:a,i=1),e=Object(e);++r{t.exports=function(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===n(i[c],c,i))break}return e}}},3833:(t,e,n)=>{var r=n(7813),o=Object.prototype,i=o.hasOwnProperty;t.exports=function(t,e,n,a){return void 0===t||r(t,o[n])&&!i.call(a,n)?e:t}},8777:(t,e,n)=>{var r=n(852),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},9464:(t,e,n)=>{var r=n(8674)({"&":"&","<":"<",">":">",'"':""","'":"'"});t.exports=r},1994:t=>{var e={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};t.exports=function(t){return"\\"+e[t]}},1957:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},852:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},5924:(t,e,n)=>{var r=n(5569)(Object.getPrototypeOf,Object);t.exports=r},8517:(t,e,n)=>{var r=n(3118),o=n(5924),i=n(5726);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:r(o(t))}},6612:t=>{t.exports=function(){return!1}},5726:t=>{t.exports=function(){return!1}},7040:t=>{t.exports=function(){this.__data__=[],this.size=0}},4125:(t,e,n)=>{var r=n(8470),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():o.call(e,n,1),--this.size,!0)}},2117:(t,e,n)=>{var r=n(8470);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},7518:(t,e,n)=>{var r=n(8470);t.exports=function(t){return r(this.__data__,t)>-1}},4705:(t,e,n)=>{var r=n(8470);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},5569:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},5357:(t,e,n)=>{var r=n(6874),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,u=o(i.length-e,0),c=Array(u);++a{t.exports=/<%-([\s\S]+?)%>/g},6051:t=>{t.exports=/<%([\s\S]+?)%>/g},5712:t=>{t.exports=/<%=([\s\S]+?)%>/g},5639:(t,e,n)=>{var r=n(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},6390:t=>{t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},61:t=>{t.exports=function(t){return t}},9018:(t,e,n)=>{var r=n(8363),o=n(1463),i=n(1704),a=o((function(t,e,n,o){r(e,i(e),t,o)}));t.exports=a},9591:(t,e,n)=>{var r=n(6874),o=n(5976),i=n(4647),a=o((function(t,e){try{return r(t,void 0,e)}catch(t){return i(t)?t:new Error(t)}}));t.exports=a},7813:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},7187:(t,e,n)=>{var r=n(9464),o=n(9833),i=/[&<>"']/g,a=RegExp(i.source);t.exports=function(t){return(t=o(t))&&a.test(t)?t.replace(i,r):t}},6557:t=>{t.exports=function(t){return t}},5694:t=>{t.exports=function(){return!1}},1469:t=>{var e=Array.isArray;t.exports=e},8612:(t,e,n)=>{var r=n(3560),o=n(1780);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)}},9246:(t,e,n)=>{var r=n(8612),o=n(7005);t.exports=function(t){return o(t)&&r(t)}},4144:t=>{t.exports=function(){return!1}},4647:(t,e,n)=>{var r=n(4239),o=n(7005),i=n(8630);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Error]"==e||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!i(t)}},3560:(t,e,n)=>{var r=n(4239),o=n(3218);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},1780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},3218:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},8630:(t,e,n)=>{var r=n(4239),o=n(5924),i=n(7005),a=Function.prototype,u=Object.prototype,c=a.toString,l=u.hasOwnProperty,s=c.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return!1;var e=o(t);if(null===e)return!0;var n=l.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==s}},6719:t=>{t.exports=function(){return!1}},3674:(t,e,n)=>{var r=n(5569)(Object.keys,Object);t.exports=r},1704:t=>{t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},2492:(t,e,n)=>{var r=n(2980),o=n(1463)((function(t,e,n){r(t,e,n)}));t.exports=o},1106:(t,e,n)=>{var r=n(9018),o=n(9591),i=n(7415),a=n(3833),u=n(1994),c=n(4647),l=n(6612),s=n(3674),f=n(5712),p=n(5835),y=n(9833),v=/\b__p \+= '';/g,b=/\b(__p \+=) '' \+/g,h=/(__e\(.*?\)|\b__t\)) \+\n'';/g,m=/[()=,{}\[\]\/\s]/,d=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,w=/($^)/,g=/['\n\r\u2028\u2029\\]/g,S=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var E=p.imports._.templateSettings||p;n&&l(t,e,n)&&(e=void 0),t=y(t),e=r({},e,E,a);var j,O,T=r({},e.imports,E.imports,a),k=s(T),_=i(T,k),P=0,N=e.interpolate||w,A="__p += '",R=RegExp((e.escape||w).source+"|"+N.source+"|"+(N===f?d:w).source+"|"+(e.evaluate||w).source+"|$","g"),I=S.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(R,(function(e,n,r,o,i,a){return r||(r=o),A+=t.slice(P,a).replace(g,u),n&&(j=!0,A+="' +\n__e("+n+") +\n'"),i&&(O=!0,A+="';\n"+i+";\n__p += '"),r&&(A+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),P=a+e.length,e})),A+="';\n";var C=S.call(e,"variable")&&e.variable;if(C){if(m.test(C))throw new Error("Invalid `variable` option passed into `_.template`")}else A="with (obj) {\n"+A+"\n}\n";A=(O?A.replace(v,""):A).replace(b,"$1").replace(h,"$1;"),A="function("+(C||"obj")+") {\n"+(C?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(j?", __e = _.escape":"")+(O?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+A+"return __p\n}";var x=o((function(){return Function(k,I+"return "+A).apply(void 0,_)}));if(x.source=A,c(x))throw x;return x}},5835:(t,e,n)=>{var r=n(7187),o={escape:n(9865),evaluate:n(6051),interpolate:n(5712),variable:"",imports:{_:{escape:r}}};t.exports=o},9881:(t,e,n)=>{var r=n(8363),o=n(1704);t.exports=function(t){return r(t,o(t))}},9833:t=>{t.exports=function(t){return t}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r](i,i.exports,n),i.loaded=!0,i.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};(()=>{"use strict";n.d(r,{default:()=>Ol});var t={};n.r(t),n.d(t,{exclude:()=>G,extract:()=>L,parse:()=>F,parseUrl:()=>z,pick:()=>H,stringify:()=>U,stringifyUrl:()=>$});const e=JSON.parse('{"i8":"1.7.0-beta.3"}');function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){for(var n=0;n\n\n <% if(\'img\' === data.content.type) { %>\n target="<%- data.content.target %>"<% } %>>\n \n <% (data.content.sources || []).forEach(function(source) { %>\n \n <% }); %>\n <%- data.content.alt %>width="<%- data.content.dimensions.width %>"<% } %>\n <% if(null !== data.content.dimensions.height) { %>height="<%- data.content.dimensions.height %>"<% } %>\n <% if(\'\' !== data.content.title) { %>title="<%- data.content.title %>"<% } %>\n <% var loading; if(loading = banner.options.evaluate(\'loading\', 0)) { %>loading="<%- loading %>"<% } %>\n <% var fetchPriority; if(fetchPriority = banner.options.evaluate(\'fetchpriority\', 0)) { %>fetchpriority="<%- fetchPriority %>"<% } %>>\n \n \n <% } else if (\'html\' === data.content.type) { %>\n
\n <%= data.content.html %>\n
\n <% } %>\n\n \n',random:'\n \n',multiple:'\n \n'};function b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull==t,R=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),I=Symbol("encodeFragmentIdentifier");function C(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function x(t,e){return e.encode?e.strict?R(t):encodeURIComponent(t):t}function M(t,e){return e.decode?_(t):t}function D(t){return Array.isArray(t)?t.sort():"object"==typeof t?D(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function B(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function W(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function L(t){const e=(t=B(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function F(t,e){C((e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e}).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"colon-list-separator":return(t,n,r)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{const o="string"==typeof n&&n.includes(t.arrayFormatSeparator),i="string"==typeof n&&!o&&M(n,t).includes(t.arrayFormatSeparator);n=i?M(n,t):n;const a=o||i?n.split(t.arrayFormatSeparator).map((e=>M(e,t))):null===n?n:M(n,t);r[e]=a};case"bracket-separator":return(e,n,r)=>{const o=/(\[])$/.test(e);if(e=e.replace(/\[]$/,""),!o)return void(r[e]=n?M(n,t):n);const i=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>M(e,t)));void 0!==r[e]?r[e]=[...r[e],...i]:r[e]=i};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[...[n[t]].flat(),e]:n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t)return r;if(!(t=t.trim().replace(/^[?#&]/,"")))return r;for(const o of t.split("&")){if(""===o)continue;const t=e.decode?o.replace(/\+/g," "):o;let[i,a]=P(t,"=");void 0===i&&(i=t),a=void 0===a?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:M(a,e),n(M(i,e),a,r)}for(const[t,n]of Object.entries(r))if("object"==typeof n&&null!==n)for(const[t,r]of Object.entries(n))n[t]=W(r,e);else r[t]=W(n,e);return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{const n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=D(n):t[e]=n,t}),Object.create(null))}function U(t,e){if(!t)return"";C((e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e}).arrayFormatSeparator);const n=n=>e.skipNull&&A(t[n])||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{const o=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[x(e,t),"[",o,"]"].join("")]:[...n,[x(e,t),"[",x(o,t),"]=",x(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[x(e,t),"[]"].join("")]:[...n,[x(e,t),"[]=",x(r,t)].join("")];case"colon-list-separator":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[x(e,t),":list="].join("")]:[...n,[x(e,t),":list=",x(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||t.skipNull&&null===o||t.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[x(n,t),e,x(o,t)].join("")]:[[r,x(o,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,x(e,t)]:[...n,[x(e,t),"=",x(r,t)].join("")]}}(e),o={};for(const[e,r]of Object.entries(t))n(e)||(o[e]=r);const i=Object.keys(o);return!1!==e.sort&&i.sort(e.sort),i.map((n=>{const o=t[n];return void 0===o?"":null===o?x(n,e):Array.isArray(o)?0===o.length&&"bracket-separator"===e.arrayFormat?x(n,e)+"[]":o.reduce(r(n),[]).join("&"):x(n,e)+"="+x(o,e)})).filter((t=>t.length>0)).join("&")}function z(t,e){e={decode:!0,...e};let[n,r]=P(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:F(L(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:M(r,e)}:{}}}function $(t,e){e={encode:!0,strict:!0,[I]:!0,...e};const n=B(t.url).split("?")[0]||"";let r=U({...F(L(t.url),{sort:!1}),...t.query},e);r&&(r=`?${r}`);let o=function(t){let e="";const n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(t.url);if(t.fragmentIdentifier){const r=new URL(n);r.hash=t.fragmentIdentifier,o=e[I]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${o}`}function H(t,e,n){n={parseFragmentIdentifier:!0,[I]:!1,...n};const{url:r,query:o,fragmentIdentifier:i}=z(t,n);return $({url:r,query:N(o,e),fragmentIdentifier:i},n)}function G(t,e,n){return H(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const V=t;function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function q(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return K(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nr.status?e(t):n(t)},r.onerror=function(){n({status:"error",data:{code:r.status,error:r.statusText||"unknown"}})};var o=t.endpoint;"GET"===t.method&&(o+="?".concat(V.stringify(t.parameters))),r.open(t.method,o,!0),r.overrideMimeType("application/json"),r.setRequestHeader("Accept","application/json");var i,a=q(t.headers);try{for(a.s();!(i=a.n()).done;){var u=i.value;r.setRequestHeader(u.name,u.value)}}catch(t){a.e(t)}finally{a.f()}r.send("POST"===t.method?JSON.stringify(t.parameters):null)}}])&&J(e.prototype,n),r&&J(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(S);function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function nt(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ht(this,gt,{writable:!0,value:void 0}),ht(this,St,{writable:!0,value:void 0}),ht(this,Et,{writable:!0,value:void 0}),ht(this,jt,{writable:!0,value:void 0}),ht(this,Ot,{writable:!0,value:void 0}),ht(this,Tt,{writable:!0,value:void 0}),ht(this,kt,{writable:!0,value:function(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var o=t[n][r].value.filter((function(t){return""!==t}));o.length&&(e[n][r]=o)}return e}}),dt(this,gt,e),dt(this,St,n),dt(this,Et,r),dt(this,jt,{}),dt(this,Ot,o),dt(this,Tt,i)}var e,n,r;return e=t,n=[{key:"addPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=mt(this,jt);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,mt(this,Ot)),this.addPositionResources(t,e)}},{key:"addPositionResources",value:function(t,e){for(var n in e)this.addPositionResource(t,e[n])}},{key:"addPositionResource",value:function(t,e){if(!(e instanceof pt))throw new TypeError("Argument resource must be instance of Resource class.");var n=mt(this,jt);if(!(t in n))throw new Error('Missing position "'+t+'".');var r=n[t];e.name in r?r[e.name]=r[e.name].withValues(e.value):r[e.name]=e}},{key:"method",get:function(){return mt(this,gt)}},{key:"endpoint",get:function(){return mt(this,St)}},{key:"locale",get:function(){return mt(this,Et)}},{key:"parameters",get:function(){var t=mt(this,kt).call(this,mt(this,jt)),e={query:"GET"===this.method?JSON.stringify(t):t};return null!==this.locale&&(e.locale=this.locale),e}},{key:"headers",get:function(){return mt(this,Tt)}}],n&&bt(e.prototype,n),r&&bt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Pt(t){return Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pt(t)}function Nt(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var o in"1"!==(r["omit-default-resources"]||"0").toString()?e=function(t){for(var e=1;e]+)>/g,(function(t,e){var n=i[e];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof o){var a=this;return t[Symbol.replace].call(this,n,(function(){var t=arguments;return"object"!=ce(t[t.length-1])&&(t=[].slice.call(t)).push(r(t,a)),o.apply(this,t)}))}return t[Symbol.replace].call(this,n,o)},le.apply(this,arguments)}function se(t,e){return se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},se(t,e)}var fe=le(/^(?:(\d+)\x2D(\d+):|(\d+):|<(\d+):|<=(\d+):|>(\d+):|>=(\d+):)?([^:\s]+)$/,{INTERVAL_FROM:1,INTERVAL_TO:2,EQ:3,LT:4,LTE:5,GT:6,GTE:7,VALUE:8}),pe={};function ye(t,e){var n=function(t){if(t in pe)return pe[t];for(var e=t.split(",").map((function(t){return t.trim()})),n=[],r=0;r=this.from&&t<=this.to}};break;case void 0!==o.groups.EQ:i={eq:parseInt(o.groups.EQ),matches:function(t){return t===this.eq}};break;case void 0!==o.groups.LT:i={lt:parseInt(o.groups.LT),matches:function(t){return tthis.gt}};break;case void 0!==o.groups.GTE:i={gte:parseInt(o.groups.GTE),matches:function(t){return t>=this.gte}};break;default:i={matches:function(){return!0}}}i&&(i.matches=i.matches.bind(i),i.value=o.groups.VALUE,n.push(i))}}var a={rules:n,cache:{}};return a.evaluate=function(t){Number.isInteger(t)||(t=parseInt(t));var e="i_".concat(t);if(e in this.cache)return this.cache[e];for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}},{key:"evaluate",value:function(t,e){return void 0===this.options[t]?null:ye(this.options[t],e)}},{key:"override",value:function(t){this.options=he(he({},this.options),Se(this,Ee,Oe).call(this,he({},t)))}}],n&&de(e.prototype,n),r&&de(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Oe(t){if("loading-offset"in t){var e=t["loading-offset"],n="loading"in t?t.loading:"loading"in this.options?this.options.loading:null,r=null!==n?">=".concat(e,":").concat(n):null,o='AMP deprecation warning: The banner option "loading-offset" is deprecated and will be removed in some future release.';null!==r&&(o+=' Instead of options {"loading": "'.concat(n,'", "loading-offset": "').concat(e,'"} use an expression based option {"loading": "').concat(r,'"}.')),console.warn(o),delete t["loading-offset"],null!==r&&(t.loading=r)}return t}function Te(t){return Te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Te(t)}function ke(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";if(-1===this.STATE.STATES.indexOf(t))throw new TypeError("".concat(t," is not valid state."));Ne(this,xe,t),Ne(this,Me,e.toString()),Pe(this,De)[t]=(Pe(this,De)[t]||0)+1,this._eventBus.dispatch(oe.ON_BANNER_STATE_CHANGED,{banner:this})}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t.startsWith("amp:banner:"))throw new Error('Unable to attach listener on event "'.concat(t,'" through a banner.'));return this._eventBus.subscribe(t,(function(t){t.banner===this&&(null!==n?e.call(n,t):e(t))}),this)}},{key:"getCurrentBreakpoint",value:function(t){return null}},{key:"overrideOptions",value:function(t){Pe(this,Ce).override(t)}},{key:"redrawIfNeeded",value:function(){}},{key:"isManaged",value:function(){return!1}},{key:"isExternal",value:function(){return!1}},{key:"isEmbed",value:function(){return!1}}],n&&ke(e.prototype,n),r&&ke(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function We(t){return We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},We(t)}function Le(t,e){for(var n=0;n=c&&(null===i||ic))&&(o=u,i=c,tn(t,cn)[n]=c)):r=u})),null===o&&null===r)throw new Error("Unable to resolve content, no contents found.");a.sort((function(t,e){return t-e})),"min"===n?a.unshift(null):a.push(null);var u=a.indexOf(i);return"max"===n&&u-1 in a&&(tn(this,cn).min=a[u-1]),"min"===n&&u+1 in a&&(tn(this,cn).max=a[u+1]),en(this,un,null!==o?o:r)}},{key:"needRedraw",value:function(){if(null===tn(this,un))return!0;var t=tn(this,rn).width;return null!==tn(this,cn).min&&ttn(this,cn).max}}])&&Qe(e.prototype,n),r&&Qe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fn(t,e){for(var n in t)e(t[n],n)}function pn(t){return pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pn(t)}function yn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return vn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function vn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"weight",n={},r=0,o=0;o0;)u-=n[a],a++;return t[--a]?t[a]:t[0]}}],(n=null)&&Cn(e.prototype,n),r&&Cn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Mn(t){return Mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mn(t)}function Dn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Bn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n6&&void 0!==arguments[6]?arguments[6]:{},s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};for(var f in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),$n(Un(c=o.call(this,n,r,a,u,s)),or),$n(Un(c),rr),Hn(Un(c),Jn,{writable:!0,value:void 0}),Hn(Un(c),Qn,{writable:!0,value:void 0}),Hn(Un(c),Xn,{writable:!0,value:[]}),Hn(Un(c),Zn,{writable:!0,value:void 0}),Hn(Un(c),tr,{writable:!0,value:!1}),Hn(Un(c),er,{writable:!0,value:null}),Hn(Un(c),nr,{writable:!0,value:[]}),qn(Un(c),Jn,t),qn(Un(c),Qn,e),qn(Un(c),Zn,l),l)Yn(Un(c),Xn).push(new pt(f,l[f]));return c.setState(c.STATE.NEW,"Banner created."),c}return e=i,(n=[{key:"html",set:function(t){this.element.innerHTML=t}},{key:"resources",get:function(){return Yn(this,Xn)}},{key:"rawResources",get:function(){return Yn(this,Zn)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new Rn(this)}},{key:"fingerprints",get:function(){var t;try{t=this.bannerData}catch(t){return[]}return null===t?[]:(this.positionData.isMultiple()||(t=[t]),t.map((function(t){return t.fingerprint})))}},{key:"bannerData",get:function(){if(null!==Yn(this,er))return Yn(this,er);if(!Yn(this,nr).length)return null;var t=null,e=this.positionData,n=function(t){return Fe.createFromProperties({bannerId:t.id,bannerName:t.name,positionId:e.id,positionCode:e.code,positionName:e.name,campaignId:t.campaignId,campaignCode:t.campaignCode,campaignName:t.campaignName})};switch(!0){case e.isSingle():(t=Yn(this,nr).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=xn.randomByWeights(Yn(this,nr),"score")).fingerprint=n(t);break;case e.isMultiple():var r,o=Dn(t=Yn(this,nr).sort((function(t,e){return e.score-t.score})));try{for(o.s();!(r=o.n()).done;){var i=r.value;i.fingerprint=n(i)}}catch(t){o.e(t)}finally{o.f()}break;default:throw new Error("Invalid display type ".concat(this.displayType,"."))}return qn(this,er,t),t}},{key:"unsetFingerprint",value:function(t){var e=t.bannerId,n=this.positionData;if(Yn(this,nr).filter((function(t){return t.id===e}))[0]){switch(!0){case n.isSingle():qn(this,nr,[]),qn(this,er,null);break;case n.isRandom():Yn(this,er)&&Yn(this,er).id===e?(qn(this,nr,[]),qn(this,er,null)):qn(this,nr,Yn(this,nr).filter((function(t){return t.id!==e})));break;case n.isMultiple():qn(this,nr,Yn(this,nr).filter((function(t){return t.id!==e}))),Yn(this,er)&&qn(this,er,Yn(this,er).filter((function(t){return t.id!==e})))}0>=Yn(this,nr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):n.isRandom()&&this.redrawIfNeeded()}}},{key:"setResponseData",value:function(t){if(Yn(this,tr))throw new Error("Data for banner on position ".concat(this.position," is already set."));this._positionData=new ue({id:t.position_id||null,code:this._positionData.code,name:t.position_name||null,rotationSeconds:t.rotation_seconds,displayType:t.display_type,breakpointType:t.breakpoint_type}),"options"in t&&this.overrideOptions(t.options);var e=[];for(var n in t.banners||[])e.push(new jn(t.banners[n],t.breakpoint_type,Yn(this,Jn)));qn(this,nr,e),qn(this,tr,!0),0>=Yn(this,nr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):Vn(this,rr,ar).call(this,"Banner was successfully rendered.")}},{key:"getCurrentBreakpoint",value:function(t){var e=this.bannerData,n=(e=(Array.isArray(e)?e:e?[e]:[]).find((function(e){return e.id===t})))&&e.content?e.content.breakpoint:null;return null===n?null:parseInt(n)}},{key:"isManaged",value:function(){return!0}},{key:"redrawIfNeeded",value:function(){Vn(this,or,ur).call(this)&&Vn(this,rr,ar).call(this,"Banner was successfully redrawn.")}}])&&Wn(e.prototype,n),r&&Wn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(Be);function ar(t){try{this.html=Yn(this,Qn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function ur(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function cr(t){return cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cr(t)}function lr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return sr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function br(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=Er(this,Tr).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){var e=Er(this,kr)[t]||null;if(null===e)return null;if(Er(this,_r))return e.content?e.content.breakpoint:null;var n,r=vr(e.contents);try{for(r.s();!(n=r.n()).done;){var o=n.value;if("none"!==getComputedStyle(o.data).display)return o.breakpoint}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"isExternal",value:function(){return!0}},{key:"delegateResponsiveBehaviour",value:function(){if(!Er(this,_r)){jr(this,_r,!0);var t,e=vr(this.element.querySelectorAll("style"));try{for(e.s();!(t=e.n()).done;)t.value.remove()}catch(t){e.e(t)}finally{e.f()}this.redrawIfNeeded()}}},{key:"redrawIfNeeded",value:function(){if(Er(this,_r))for(var t in Er(this,kr)){var e=Er(this,kr)[t];if(e.needRedraw()){var n,r=e.content,o=vr(e.contents);try{for(o.s();!(n=o.n()).done;){var i=n.value;i.data.style.display=i===r?"block":"none"}}catch(t){o.e(t)}finally{o.f()}}}}}])&&hr(e.prototype,n),r&&hr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(Be);function Nr(t){return Nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nr(t)}function Ar(t,e){for(var n=0;n=Dr(this,Fr).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){throw new Error("Method EmbedBanner.getCurrentBreakpoint() is not readable.")}},{key:"isEmbed",value:function(){return!0}},{key:"updatePositionData",value:function(t){for(var e=this.positionData,n=0,r=["id","name","rotationSeconds","displayType","breakpointType","dimensions"];n0&&void 0!==arguments[0]?arguments[0]:1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Hr(this,Yr,{writable:!0,value:void 0}),Gr(this,Yr,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return Gr(this,Yr,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,Vr(e,Yr,"get")),++t))}}])&&$r(e.prototype,n),r&&$r(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Kr(t,e){if(t instanceof e.HTMLElement)return t;if("string"!=typeof t)throw new TypeError("Element must be instance of HTMLElement or String");var n;if(!((n="#"===t.charAt(0)?document.getElementById(t.slice(1)):document.querySelector(t))instanceof e.HTMLElement))throw new TypeError("Selector "+t+" is invalid.");return n}function Jr(t){return Jr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jr(t)}function Qr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Xr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Xr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),to(this,oo,{writable:!0,value:void 0}),to(this,io,{writable:!0,value:void 0}),to(this,ao,{writable:!0,value:void 0}),to(this,uo,{writable:!0,value:void 0}),to(this,co,{writable:!0,value:[]}),no(this,oo,e),no(this,io,n),no(this,ao,r),no(this,uo,new qr),this.STATE=ee}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){(t=Kr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:window)).setAttribute("data-amp-attached","");var e=new Pr(eo(this,io),eo(this,oo),eo(this,uo).getNextIdentifier(),t);return eo(this,co).push(e),e}},{key:"addManagedBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;if(null===eo(this,ao))throw new Error("Unable to add managed banner, renderer is not provided.");(t=Kr(t,o)).setAttribute("data-amp-attached","");var i=new ir(eo(this,io),eo(this,ao),eo(this,oo),eo(this,uo).getNextIdentifier(),t,e,n,r);return eo(this,co).push(i),i}},{key:"addEmbedBanner",value:function(t,e,n,r){t=Kr(t,window),e=Kr(e,window),t.setAttribute("data-amp-attached","");var o=new Ur(eo(this,oo),eo(this,uo).getNextIdentifier(),t,e,n,r);return eo(this,co).push(o),o}},{key:"removeBanner",value:function(t){var e=eo(this,co).length;return no(this,co,eo(this,co).filter((function(e){return e!==t}))),e!==eo(this,co).length}},{key:"getBannersByState",value:function(t){var e=t.state,n=t.managed,r=void 0===n||n,o=t.external,i=void 0===o||o,a=t.embed,u=void 0===a||a;return eo(this,co).filter((function(t){return t instanceof Be&&t.state===e&&!(t instanceof ir&&!r||t instanceof Pr&&!i||t instanceof Ur&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Fe?t.value:t,r=Qr(eo(this,co));try{for(r.s();!(e=r.n()).done;){var o=e.value;if(!(o instanceof Ur)){var i,a=Qr(o.fingerprints);try{for(a.s();!(i=a.n()).done;)if(i.value.value===n)return o}catch(t){a.e(t)}finally{a.f()}}}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"getBannerByUid",value:function(t){var e,n=Qr(eo(this,co));try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.uid===t)return r}}catch(t){n.e(t)}finally{n.f()}return null}}],n&&Zr(e.prototype,n),r&&Zr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function so(t){return so="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},so(t)}function fo(t,e){for(var n=0;njo(this,No)&&n.splice(n.length-jo(this,No)),Oo(this,Ao,n),ko(this,Io,Do).call(this))}},{key:"isClosed",value:function(t){return-1!==ko(this,Ro,Mo).call(this).indexOf(t)}}])&&wo(e.prototype,n),r&&wo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Mo(){if(null!==jo(this,Ao))return jo(this,Ao);var t=jo(this,_o).getItem(jo(this,Po)),e=null!==t&&""!==t?t.split(","):[];return Oo(this,Ao,e)}function Do(){null!==jo(this,Ao)&&jo(this,_o).setItem(jo(this,Po),jo(this,Ao).join(","))}function Bo(){var t={items:{}};return t.setItem=function(t,e){this.items[t]=e}.bind(t),t.getItem=function(t){return t in this.items?this.items[t]:null}.bind(t),t}function Wo(t){return Wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wo(t)}function Lo(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Qo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("function"!=typeof e)throw new TypeError("Listener must be of type function.");var i="idx_"+ti(this,ri).getNextIdentifier();return ti(this,oi)[t]=ti(this,oi)[t]||{},ti(this,oi)[t][i]={callback:e,scope:r,priority:o},t in ti(this,ii)&&delete ti(this,ii)[t],function(){t in ti(n,oi)&&i in ti(n,oi)[t]&&delete ti(n,oi)[t][i]}}},{key:"dispatch",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;re.priority?-1:t.priority=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ni(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=u.pixels)return u.ratio}}catch(t){i.e(t)}finally{i.f()}return r};return new IntersectionObserver((function(r){var o,a=[],u={},l={},s=Pi(r);try{for(s.s();!(o=s.n()).done;){var f=o.value,p=f.target.dataset.ampBannerFingerprint,y=t.getBannerByFingerprint(p);if(y){var v=n[p];if(v){var b={fingerprint:v.fingerprint,element:f.target,banner:y};if(a.push(ki(ki({},b),{},{entry:f})),!v.alreadySeen){var h=f.intersectionRatio>=c(f.target);u[p]=!(p in u)||!u[p].isIntersecting&&h?{fingerprintArgs:b,fingerprintMetadata:v,isIntersecting:h}:u[p]}if(!v.alreadyFullySeen){var m=.99<=f.intersectionRatio;l[p]=!(p in l)||!l[p].isFullyIntersecting&&m?{fingerprintArgs:b,fingerprintMetadata:v,isFullyIntersecting:m}:l[p]}}}}}catch(t){s.e(t)}finally{s.f()}for(var d=function(){var t=g[w],n=t.fingerprintArgs,r=t.fingerprintMetadata,o=t.isIntersecting;o&&!r.alreadySeen&&null===r.firstTimeSeenTimeoutId?r.firstTimeSeenTimeoutId=setTimeout((function(){r.alreadySeen=!0,e.dispatch(oe.ON_BANNER_FIRST_TIME_SEEN,n)}),i):o||null===r.firstTimeSeenTimeoutId||(clearTimeout(r.firstTimeSeenTimeoutId),r.firstTimeSeenTimeoutId=null)},w=0,g=Object.values(u);w=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Mi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function sa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=":"<=").concat(o);var i={};return i[e.params.channel_code]=wa(a,Oa),i[e.params.banner_id]=n.bannerId,i[e.params.banner_name]=n.bannerName,i[e.params.position_id]=n.positionId,i[e.params.position_code]=n.positionCode,i[e.params.position_name]=n.positionName,i[e.params.campaign_id]=n.campaignId,i[e.params.campaign_code]=n.campaignCode,i[e.params.campaign_name]=n.campaignName,i[e.params.breakpoint]=o,pa(pa({},i),e.extraParams)}}),ga(this,Ea,e),ga(this,ja,n),ga(this,Oa,r),ga(this,Ta,!1)}var e,n,r;return e=t,(n=[{key:"collectBeforeAttach",value:function(){var t=this;if(!wa(this,ka).started&&!wa(this,Ta)){wa(this,ka).started=!0;var e=wa(this,ja),n=new ua({}),r=n.events[Zi.BANNER_LOADED],o=n.events[Zi.BANNER_DISPLAYED],i=n.events[Zi.BANNER_FULLY_DISPLAYED],a=n.events[Zi.BANNER_CLICKED],u=n.events[Zi.BANNER_CLOSED];wa(this,ka).cleanup.push(e.subscribe(oe.ON_BANNER_STATE_CHANGED,(function(e){var n=e.banner;if(!n.isEmbed()&&ee.RENDERED===n.state&&1===n.stateCounter){var o,i=la(n.fingerprints);try{for(i.s();!(o=i.n()).done;){var a=o.value;wa(t,ka).events.push({name:Zi.BANNER_LOADED,params:wa(t,_a).call(t,{event:r,fingerprint:a,banner:n})})}}catch(t){i.e(t)}finally{i.f()}}}))),wa(this,ka).cleanup.push(e.subscribe(oe.ON_BANNER_FIRST_TIME_SEEN,(function(e){var n=e.fingerprint,r=e.banner;wa(t,ka).events.push({name:Zi.BANNER_DISPLAYED,params:wa(t,_a).call(t,{event:o,fingerprint:n,banner:r})})}))),wa(this,ka).cleanup.push(e.subscribe(oe.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(e){var n=e.fingerprint,r=e.banner;wa(t,ka).events.push({name:Zi.BANNER_FULLY_DISPLAYED,params:wa(t,_a).call(t,{event:i,fingerprint:n,banner:r})})}))),wa(this,ka).cleanup.push(e.subscribe(oe.ON_BANNER_LINK_CLICKED,(function(e){var n=e.fingerprint,r=e.banner,o=e.target,i=wa(t,_a).call(t,{event:a,fingerprint:n,banner:r});i[a.params.link]=o.href||"",wa(t,ka).events.push({name:Zi.BANNER_CLICKED,params:i})}))),wa(this,ka).cleanup.push(e.subscribe(oe.ON_BANNER_AFTER_CLOSE,(function(e){var n=e.fingerprint,r=e.banner;wa(t,ka).events.push({name:Zi.BANNER_CLOSED,params:wa(t,_a).call(t,{event:u,fingerprint:n,banner:r})})})))}}},{key:"attach",value:function(t){var e=this;if(!wa(this,Ta)){ga(this,Ta,!0);var n=wa(this,ja),r=wa(this,Ea);if(r.hasAnyReceiver()){var o=t.events[Zi.BANNER_LOADED],i=t.events[Zi.BANNER_DISPLAYED],a=t.events[Zi.BANNER_FULLY_DISPLAYED],u=t.events[Zi.BANNER_CLICKED],c=t.events[Zi.BANNER_CLOSED];if(wa(this,ka).started){for(var l in wa(this,ka).events){var s=wa(this,ka).events[l],f=s.name,p=s.params,y=t.events[f];if(y.enabled){var v={};for(var b in p)v[y.params[b]]=p[b];r.send(y.name,pa(pa({},v),y.extraParams))}}da(this,Pa,Aa).call(this)}o.enabled&&n.subscribe(oe.ON_BANNER_STATE_CHANGED,(function(t){var n=t.banner;if(!n.isEmbed()&&ee.RENDERED===n.state&&1===n.stateCounter){var i,a=la(n.fingerprints);try{for(a.s();!(i=a.n()).done;){var u=i.value;r.send(o.name,wa(e,_a).call(e,{event:o,fingerprint:u,banner:n}))}}catch(t){a.e(t)}finally{a.f()}}})),i.enabled&&n.subscribe(oe.ON_BANNER_FIRST_TIME_SEEN,(function(t){var n=t.fingerprint,o=t.banner;r.send(i.name,wa(e,_a).call(e,{event:i,fingerprint:n,banner:o}))})),a.enabled&&n.subscribe(oe.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var n=t.fingerprint,o=t.banner;r.send(a.name,wa(e,_a).call(e,{event:a,fingerprint:n,banner:o}))})),u.enabled&&n.subscribe(oe.ON_BANNER_LINK_CLICKED,(function(t){var n=t.fingerprint,o=t.banner,i=t.target,a=wa(e,_a).call(e,{event:u,fingerprint:n,banner:o});a[u.params.link]=i.href||"",r.send(u.name,a)})),c.enabled&&n.subscribe(oe.ON_BANNER_AFTER_CLOSE,(function(t){var n=t.fingerprint,o=t.banner;r.send(c.name,wa(e,_a).call(e,{event:c,fingerprint:n,banner:o}))}))}else da(this,Pa,Aa).call(this)}}}])&&va(e.prototype,n),r&&va(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Aa(){for(var t in wa(this,ka).cleanup)wa(this,ka).cleanup[t]();wa(this,ka).events=[],wa(this,ka).cleanup=[]}var Ra=!1;const Ia=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!Ra&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(Ra=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var Ca=!1;const xa=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!Ca&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(Ca=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function Ma(t){return Ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ma(t)}function Da(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ba(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Ma(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==Ma(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ma(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Wa=!1;const La=function(t,e){if(!("dataLayer"in window))return!Wa&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(Wa=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.dataLayer.push(function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function $a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:"*";t.postMessage({message:e,data:n},r)}},{key:"listen",value:function(){var t=this;window.addEventListener("message",(function(e){if(!(0=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function cu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Fu(t,e){if(t){if("string"==typeof t)return Uu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Uu(t,e):void 0}}function Uu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1f||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==m(e.metrics))throw new Error('The option "metrics" must be an object of the format { receiver: null|string|function|array, events: object, params: object }, '.concat(e.metrics," passed."));if(null!==e.metrics.receiver&&-1===["string","function"].indexOf(m(e.metrics.receiver))&&!Array.isArray(e.metrics.receiver))throw new Error('The option "metrics.receiver" must be a null or a string or a function or an array of strings|functions, "'.concat(e.metrics.receiver,'" passed.'));if(Array.isArray(e.metrics.receiver)){for(var p in e.metrics.receiver)if(-1===["string","function"].indexOf(m(e.metrics.receiver[p])))throw new Error('The option "metrics.receiver.'.concat(p,'" must be a string or a function, "').concat(e.metrics.receiver[p],'" passed.'))}else e.metrics.receiver=null!==e.metrics.receiver?[e.metrics.receiver]:[];if("object"!==m(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false|{ name?: string, params?: { *: string }, extraParams?: { *: scalar } } }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==m(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==m(e.metrics.extraParams))throw new Error('The option "metrics.extraParams" must be an object of the format { *: scalar }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==m(e.closing)||"string"!=typeof e.closing.storage||"string"!=typeof e.closing.key||!Number.isInteger(e.closing.maxItems)||1>e.closing.maxItems)throw new Error('The option "closing" must be an object of the format { storage: "memoryStorage"|"localStorage"|"sessionStorage", key: string, maxItems: integer<1, max> }, '.concat(JSON.stringify(e.closing)," passed."));return e}(n)),Vu(this,Ju,new ai),Vu(this,Qu,new Lt(n.method,n.url,n.version,n.channel)),Vu(this,Xu,new Xt(n.url,n.version,n.channel)),Vu(this,tc,new lo(Gu(this,Ju),ho.fromCurrentWindow(),new ji(n.template))),Vu(this,ec,new Ki(Gu(this,tc),Gu(this,Ju),n.interaction)),Vu(this,rc,Ja.createFromReceivers(n.metrics.receiver)),Vu(this,oc,new Na(Gu(this,rc),Gu(this,Ju),n.channel)),Vu(this,ic,new Ru({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction,metrics:{events:n.metrics.events,params:n.metrics.params}}},bannerManager:Gu(this,tc),metricsSender:Gu(this,rc)})),Vu(this,nc,new qo({bannerManager:Gu(this,tc),eventBus:Gu(this,Ju),config:{storage:n.closing.storage,key:n.closing.key,maxItems:n.closing.maxItems},frameMessenger:Gu(this,ic)})),this.setLocale(n.locale),Gu(this,Qu).origin=n.origin,n.resources)Gu(this,Qu).addDefaultResource(a,n.resources[a]),Gu(this,Xu).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=Lu(Gu(i,tc).getBannersByState({state:Gu(i,tc).STATE.RENDERED,managed:!0,external:!0,embed:!1}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}})),Gu(this,ic).listen(),Gu(this,oc).attach(new ua({events:n.metrics.events,params:n.metrics.params,extraParams:n.metrics.extraParams})),Gu(this,ec).start(),Gu(this,nc).attachUi()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Gu(this,qu)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Gu(this,Ju).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Gu(this,Qu).locale=t,Gu(this,Xu).locale=t}},{key:"setGateway",value:function(t){if(!function(t){return t instanceof S}(t))throw new TypeError("Argument gateway mut be instance of AbstractGateway.");Vu(this,Zu,t)}},{key:"getGateway",value:function(){return null===Gu(this,Zu)&&this.setGateway(new tt),Gu(this,Zu)}},{key:"createBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"managed",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:window;if(t=Kr(t,i),"embed"===o){var a=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,ac,cc).call(this,t,e,n,r),u=Gu(this,tc).addEmbedBanner(t,a,e,r);return Gu(this,ic).connectBanner(u),t.insertAdjacentElement("beforeend",a),u}return Gu(this,tc).addManagedBanner(t,e,n,r,i)}},{key:"closeBanner",value:function(t){Gu(this,nc).closeBanner(t)}},{key:"attachBanners",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,r=Lu(e.querySelectorAll("[data-amp-banner]:not([data-amp-attached])"));try{for(r.s();!(t=r.n()).done;){var o=t.value,i=o.dataset.ampBanner;if(i){var a=void 0;if("ampBannerExternal"in o.dataset)a=Gu(this,tc).addExternalBanner(o,n);else{var u=pr.parseResources(o),c=pr.parseOptions(o),l=o.dataset.ampMode||"managed";a=this.createBanner(o,i,u,c,l,n)}Gu(this,Ju).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:a})}else console.warn("Unable to attach a banner to the element ",o,' because the attribute "data-amp-banner" has an empty value.')}}catch(t){r.e(t)}finally{r.f()}}},{key:"fetch",value:function(){var t=this,e=Gu(this,tc).getBannersByState({state:Gu(this,tc).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Gu(this,Qu).create(),o=Lu(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;r.addPosition(i.position,i.resources,"1"!==i.options.get("omit-default-resources","0").toString())}}catch(t){o.e(t)}finally{o.f()}Gu(this,Ju).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,o=n.data,i=Lu(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.position in o&&"banners"in o[a.position]&&Object.values(o[a.position].banners).length){for(var u=o[a.position],c=Array.isArray(u.banners)?u.banners:Object.values(u.banners),l=[],s=0;st.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1a||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==fc(e.metrics))throw new Error('The option "metrics" must be an object of the format { events: object, params: object }, '.concat(JSON.stringify(e.metrics)," passed."));if("object"!==fc(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false|{ name?: string, params?: { *: string }, extraParams?: { *: scalar } } }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==fc(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==fc(e.metrics.extraParams))throw new Error('The option "metrics.extraParams" must be an object of the format { *: scalar }, '.concat(JSON.stringify(e.metrics.params)," passed."));return e}function vc(t){return vc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vc(t)}function bc(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return hc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hc(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function hc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Kc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;return el(this,ul).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(el(this,vl))throw new Error("Method attachBanner() should be called only once.");var t=document.querySelector("[data-amp-banner]:not([data-amp-attached])");if(t){var e=el(this,cl).addExternalBanner(t);nl(this,vl,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),el(this,ul).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:e})}else console.warn("No banner found in the embed client.")}}],n&&Jc(e.prototype,n),r&&Jc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function wl(t,e){el(this,ll).sendToParent("metrics",{eventName:t,eventArgs:e})}function gl(){var t,e=qc(el(this,cl).getBannersByState({state:ee.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function Sl(t){return Sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sl(t)}function El(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new uc(new p(jl,"standard@".concat(jl)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new dl(new p(jl,"embed@".concat(jl)),t)}},{key:"version",get:function(){return jl}}],(n=null)&&El(e.prototype,n),r&&El(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()})(),AMPClientFactory=r.default})(); \ No newline at end of file diff --git a/dist/amp-client.standalone.min.js b/dist/amp-client.standalone.min.js index 1916d79..aa29631 100644 --- a/dist/amp-client.standalone.min.js +++ b/dist/amp-client.standalone.min.js @@ -1 +1 @@ -var AMPClientFactory;(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.d(e,{default:()=>ml});var n={};t.r(n),t.d(n,{exclude:()=>V,extract:()=>F,parse:()=>U,parseUrl:()=>$,pick:()=>G,stringify:()=>z,stringifyUrl:()=>H});const r=JSON.parse('{"i8":"1.7.0-beta.2"}');function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t,e){for(var n=0;n\n\n <% if(\'img\' === data.content.type) { %>\n target="<%- data.content.target %>"<% } %>>\n \n <% (data.content.sources || []).forEach(function(source) { %>\n \n <% }); %>\n <%- data.content.alt %>width="<%- banner.positionData.dimensions.width %>"<% } %>\n <% if(null !== banner.positionData.dimensions.height) { %>height="<%- banner.positionData.dimensions.height %>"<% } %>\n <% if(\'\' !== data.content.title) { %>title="<%- data.content.title %>"<% } %>\n <% var loading; if(loading = banner.options.evaluate(\'loading\', 0)) { %>loading="<%- loading %>"<% } %>\n <% var fetchPriority; if(fetchPriority = banner.options.evaluate(\'fetchpriority\', 0)) { %>fetchpriority="<%- fetchPriority %>"<% } %>>\n \n \n <% } else if (\'html\' === data.content.type) { %>\n
\n <%= data.content.html %>\n
\n <% } %>\n\n \n',random:'\n \n',multiple:'\n \n'};function b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,u=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull==t,I=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),C=Symbol("encodeFragmentIdentifier");function M(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function D(t,e){return e.encode?e.strict?I(t):encodeURIComponent(t):t}function B(t,e){return e.decode?N(t):t}function W(t){return Array.isArray(t)?t.sort():"object"==typeof t?W(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function x(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function L(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function F(t){const e=(t=x(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function U(t,e){M((e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e}).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"colon-list-separator":return(t,n,r)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{const i="string"==typeof n&&n.includes(t.arrayFormatSeparator),o="string"==typeof n&&!i&&B(n,t).includes(t.arrayFormatSeparator);n=o?B(n,t):n;const a=i||o?n.split(t.arrayFormatSeparator).map((e=>B(e,t))):null===n?n:B(n,t);r[e]=a};case"bracket-separator":return(e,n,r)=>{const i=/(\[])$/.test(e);if(e=e.replace(/\[]$/,""),!i)return void(r[e]=n?B(n,t):n);const o=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>B(e,t)));void 0!==r[e]?r[e]=[...r[e],...o]:r[e]=o};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[...[n[t]].flat(),e]:n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t)return r;if(!(t=t.trim().replace(/^[?#&]/,"")))return r;for(const i of t.split("&")){if(""===i)continue;const t=e.decode?i.replace(/\+/g," "):i;let[o,a]=A(t,"=");void 0===o&&(o=t),a=void 0===a?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:B(a,e),n(B(o,e),a,r)}for(const[t,n]of Object.entries(r))if("object"==typeof n&&null!==n)for(const[t,r]of Object.entries(n))n[t]=L(r,e);else r[t]=L(n,e);return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{const n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=W(n):t[e]=n,t}),Object.create(null))}function z(t,e){if(!t)return"";M((e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e}).arrayFormatSeparator);const n=n=>e.skipNull&&R(t[n])||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{const i=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[D(e,t),"[",i,"]"].join("")]:[...n,[D(e,t),"[",D(i,t),"]=",D(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[D(e,t),"[]"].join("")]:[...n,[D(e,t),"[]=",D(r,t)].join("")];case"colon-list-separator":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[D(e,t),":list="].join("")]:[...n,[D(e,t),":list=",D(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[D(n,t),e,D(i,t)].join("")]:[[r,D(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,D(e,t)]:[...n,[D(e,t),"=",D(r,t)].join("")]}}(e),i={};for(const[e,r]of Object.entries(t))n(e)||(i[e]=r);const o=Object.keys(i);return!1!==e.sort&&o.sort(e.sort),o.map((n=>{const i=t[n];return void 0===i?"":null===i?D(n,e):Array.isArray(i)?0===i.length&&"bracket-separator"===e.arrayFormat?D(n,e)+"[]":i.reduce(r(n),[]).join("&"):D(n,e)+"="+D(i,e)})).filter((t=>t.length>0)).join("&")}function $(t,e){e={decode:!0,...e};let[n,r]=A(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:U(F(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:B(r,e)}:{}}}function H(t,e){e={encode:!0,strict:!0,[C]:!0,...e};const n=x(t.url).split("?")[0]||"";let r=z({...U(F(t.url),{sort:!1}),...t.query},e);r&&(r=`?${r}`);let i=function(t){let e="";const n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(t.url);if(t.fragmentIdentifier){const r=new URL(n);r.hash=t.fragmentIdentifier,i=e[C]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${i}`}function G(t,e,n){n={parseFragmentIdentifier:!0,[C]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=$(t,n);return H({url:r,query:P(i,e),fragmentIdentifier:o},n)}function V(t,e,n){return G(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const q=n;function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function K(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return J(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nr.status?e(t):n(t)},r.onerror=function(){n({status:"error",data:{code:r.status,error:r.statusText||"unknown"}})};var i=t.endpoint;"GET"===t.method&&(i+="?".concat(q.stringify(t.parameters))),r.open(t.method,i,!0),r.overrideMimeType("application/json"),r.setRequestHeader("Accept","application/json");var o,a=K(t.headers);try{for(a.s();!(o=a.n()).done;){var u=o.value;r.setRequestHeader(u.name,u.value)}}catch(t){a.e(t)}finally{a.f()}r.send("POST"===t.method?JSON.stringify(t.parameters):null)}}])&&Q(e.prototype,n),r&&Q(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(S);function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function rt(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),mt(this,St,{writable:!0,value:void 0}),mt(this,Et,{writable:!0,value:void 0}),mt(this,Tt,{writable:!0,value:void 0}),mt(this,kt,{writable:!0,value:void 0}),mt(this,jt,{writable:!0,value:void 0}),mt(this,Ot,{writable:!0,value:void 0}),mt(this,Nt,{writable:!0,value:function(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var i=t[n][r].value.filter((function(t){return""!==t}));i.length&&(e[n][r]=i)}return e}}),wt(this,St,e),wt(this,Et,n),wt(this,Tt,r),wt(this,kt,{}),wt(this,jt,i),wt(this,Ot,o)}var e,n,r;return e=t,n=[{key:"addPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=dt(this,kt);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,dt(this,jt)),this.addPositionResources(t,e)}},{key:"addPositionResources",value:function(t,e){for(var n in e)this.addPositionResource(t,e[n])}},{key:"addPositionResource",value:function(t,e){if(!(e instanceof yt))throw new TypeError("Argument resource must be instance of Resource class.");var n=dt(this,kt);if(!(t in n))throw new Error('Missing position "'+t+'".');var r=n[t];e.name in r?r[e.name]=r[e.name].withValues(e.value):r[e.name]=e}},{key:"method",get:function(){return dt(this,St)}},{key:"endpoint",get:function(){return dt(this,Et)}},{key:"locale",get:function(){return dt(this,Tt)}},{key:"parameters",get:function(){var t=dt(this,Nt).call(this,dt(this,kt)),e={query:"GET"===this.method?JSON.stringify(t):t};return null!==this.locale&&(e.locale=this.locale),e}},{key:"headers",get:function(){return dt(this,Ot)}}],n&&ht(e.prototype,n),r&&ht(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Pt(t){return Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pt(t)}function _t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var i in"1"!==(r["omit-default-resources"]||"0").toString()?e=function(t){for(var e=1;e]+)>/g,(function(t,e){var n=o[e];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof i){var a=this;return t[Symbol.replace].call(this,n,(function(){var t=arguments;return"object"!=le(t[t.length-1])&&(t=[].slice.call(t)).push(r(t,a)),i.apply(this,t)}))}return t[Symbol.replace].call(this,n,i)},se.apply(this,arguments)}function fe(t,e){return fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fe(t,e)}var pe=se(/^(?:(\d+)\x2D(\d+):|(\d+):|<(\d+):|<=(\d+):|>(\d+):|>=(\d+):)?([^:\s]+)$/,{INTERVAL_FROM:1,INTERVAL_TO:2,EQ:3,LT:4,LTE:5,GT:6,GTE:7,VALUE:8}),ye={};function ve(t,e){var n=function(t){if(t in ye)return ye[t];for(var e=t.split(",").map((function(t){return t.trim()})),n=[],r=0;r=this.from&&t<=this.to}};break;case void 0!==i.groups.EQ:o={eq:parseInt(i.groups.EQ),matches:function(t){return t===this.eq}};break;case void 0!==i.groups.LT:o={lt:parseInt(i.groups.LT),matches:function(t){return tthis.gt}};break;case void 0!==i.groups.GTE:o={gte:parseInt(i.groups.GTE),matches:function(t){return t>=this.gte}};break;default:o={matches:function(){return!0}}}o&&(o.matches=o.matches.bind(o),o.value=i.groups.VALUE,n.push(o))}}var a={rules:n,cache:{}};return a.evaluate=function(t){Number.isInteger(t)||(t=parseInt(t));var e="i_".concat(t);if(e in this.cache)return this.cache[e];for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}},{key:"evaluate",value:function(t,e){return void 0===this.options[t]?null:ve(this.options[t],e)}},{key:"override",value:function(t){this.options=me(me({},this.options),Ee(this,Te,je).call(this,me({},t)))}}],n&&we(e.prototype,n),r&&we(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function je(t){if("loading-offset"in t){var e=t["loading-offset"],n="loading"in t?t.loading:"loading"in this.options?this.options.loading:null,r=null!==n?">=".concat(e,":").concat(n):null,i='AMP deprecation warning: The banner option "loading-offset" is deprecated and will be removed in some future release.';null!==r&&(i+=' Instead of options {"loading": "'.concat(n,'", "loading-offset": "').concat(e,'"} use an expression based option {"loading": "').concat(r,'"}.')),console.warn(i),delete t["loading-offset"],null!==r&&(t.loading=r)}return t}function Oe(t){return Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oe(t)}function Ne(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";if(-1===this.STATE.STATES.indexOf(t))throw new TypeError("".concat(t," is not valid state."));_e(this,De,t),_e(this,Be,e.toString()),Pe(this,We)[t]=(Pe(this,We)[t]||0)+1,this._eventBus.dispatch(oe.ON_BANNER_STATE_CHANGED,{banner:this})}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t.startsWith("amp:banner:"))throw new Error('Unable to attach listener on event "'.concat(t,'" through a banner.'));return this._eventBus.subscribe(t,(function(t){t.banner===this&&(null!==n?e.call(n,t):e(t))}),this)}},{key:"getCurrentBreakpoint",value:function(t){return null}},{key:"overrideOptions",value:function(t){Pe(this,Me).override(t)}},{key:"redrawIfNeeded",value:function(){}},{key:"isManaged",value:function(){return!1}},{key:"isExternal",value:function(){return!1}},{key:"isEmbed",value:function(){return!1}}],n&&Ne(e.prototype,n),r&&Ne(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Le(t){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(t)}function Fe(t,e){for(var n=0;n=c&&(null===o||oc))&&(i=u,o=c,en(t,ln)[n]=c)):r=u})),null===i&&null===r)throw new Error("Unable to resolve content, no contents found.");a.sort((function(t,e){return t-e})),"min"===n?a.unshift(null):a.push(null);var u=a.indexOf(o);return"max"===n&&u-1 in a&&(en(this,ln).min=a[u-1]),"min"===n&&u+1 in a&&(en(this,ln).max=a[u+1]),nn(this,cn,null!==i?i:r)}},{key:"needRedraw",value:function(){if(null===en(this,cn))return!0;var t=en(this,on).width;return null!==en(this,ln).min&&ten(this,ln).max}}])&&Xe(e.prototype,n),r&&Xe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pn(t,e){for(var n in t)e(t[n],n)}function yn(t){return yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yn(t)}function vn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return bn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"weight",n={},r=0,i=0;i0;)u-=n[a],a++;return t[--a]?t[a]:t[0]}}],(n=null)&&Mn(e.prototype,n),r&&Mn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Bn(t){return Bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bn(t)}function Wn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return xn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n6&&void 0!==arguments[6]?arguments[6]:{},s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};for(var f in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),Hn(zn(c=i.call(this,n,r,a,u,s)),or),Hn(zn(c),ir),Gn(zn(c),Qn,{writable:!0,value:void 0}),Gn(zn(c),Xn,{writable:!0,value:void 0}),Gn(zn(c),Zn,{writable:!0,value:[]}),Gn(zn(c),tr,{writable:!0,value:void 0}),Gn(zn(c),er,{writable:!0,value:!1}),Gn(zn(c),nr,{writable:!0,value:null}),Gn(zn(c),rr,{writable:!0,value:[]}),Kn(zn(c),Qn,t),Kn(zn(c),Xn,e),Kn(zn(c),tr,l),l)Yn(zn(c),Zn).push(new yt(f,l[f]));return c.setState(c.STATE.NEW,"Banner created."),c}return e=o,(n=[{key:"html",set:function(t){this.element.innerHTML=t}},{key:"resources",get:function(){return Yn(this,Zn)}},{key:"rawResources",get:function(){return Yn(this,tr)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new In(this)}},{key:"fingerprints",get:function(){var t;try{t=this.bannerData}catch(t){return[]}return null===t?[]:(this.positionData.isMultiple()||(t=[t]),t.map((function(t){return t.fingerprint})))}},{key:"bannerData",get:function(){if(null!==Yn(this,nr))return Yn(this,nr);if(!Yn(this,rr).length)return null;var t=null,e=this.positionData,n=function(t){return Ue.createFromProperties({bannerId:t.id,bannerName:t.name,positionId:e.id,positionCode:e.code,positionName:e.name,campaignId:t.campaignId,campaignCode:t.campaignCode,campaignName:t.campaignName})};switch(!0){case e.isSingle():(t=Yn(this,rr).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=Dn.randomByWeights(Yn(this,rr),"score")).fingerprint=n(t);break;case e.isMultiple():var r,i=Wn(t=Yn(this,rr).sort((function(t,e){return e.score-t.score})));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.fingerprint=n(o)}}catch(t){i.e(t)}finally{i.f()}break;default:throw new Error("Invalid display type ".concat(this.displayType,"."))}return Kn(this,nr,t),t}},{key:"unsetFingerprint",value:function(t){var e=t.bannerId,n=this.positionData;if(Yn(this,rr).filter((function(t){return t.id===e}))[0]){switch(!0){case n.isSingle():Kn(this,rr,[]),Kn(this,nr,null);break;case n.isRandom():Yn(this,nr)&&Yn(this,nr).id===e?(Kn(this,rr,[]),Kn(this,nr,null)):Kn(this,rr,Yn(this,rr).filter((function(t){return t.id!==e})));break;case n.isMultiple():Kn(this,rr,Yn(this,rr).filter((function(t){return t.id!==e}))),Yn(this,nr)&&Kn(this,nr,Yn(this,nr).filter((function(t){return t.id!==e})))}0>=Yn(this,rr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):n.isRandom()&&this.redrawIfNeeded()}}},{key:"setResponseData",value:function(t){if(Yn(this,er))throw new Error("Data for banner on position ".concat(this.position," is already set."));this._positionData=new ce({id:t.position_id||null,code:this._positionData.code,name:t.position_name||null,rotationSeconds:t.rotation_seconds,displayType:t.display_type,breakpointType:t.breakpoint_type,dimensions:t.dimensions||{width:null,height:null}}),"options"in t&&this.overrideOptions(t.options);var e=[];for(var n in t.banners||[])e.push(new kn(t.banners[n],t.breakpoint_type,Yn(this,Qn)));Kn(this,rr,e),Kn(this,er,!0),0>=Yn(this,rr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):qn(this,ir,ur).call(this,"Banner was successfully rendered.")}},{key:"getCurrentBreakpoint",value:function(t){var e=this.bannerData,n=(e=(Array.isArray(e)?e:e?[e]:[]).find((function(e){return e.id===t})))&&e.content?e.content.breakpoint:null;return null===n?null:parseInt(n)}},{key:"isManaged",value:function(){return!0}},{key:"redrawIfNeeded",value:function(){qn(this,or,cr).call(this)&&qn(this,ir,ur).call(this,"Banner was successfully redrawn.")}}])&&Ln(e.prototype,n),r&&Ln(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(xe);function ur(t){try{this.html=Yn(this,Xn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function cr(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function lr(t){return lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lr(t)}function sr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return fr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function fr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function hr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=Tr(this,Or).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){var e=Tr(this,Nr)[t]||null;if(null===e)return null;if(Tr(this,Ar))return e.content?e.content.breakpoint:null;var n,r=br(e.contents);try{for(r.s();!(n=r.n()).done;){var i=n.value;if("none"!==getComputedStyle(i.data).display)return i.breakpoint}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"isExternal",value:function(){return!0}},{key:"delegateResponsiveBehaviour",value:function(){if(!Tr(this,Ar)){kr(this,Ar,!0);var t,e=br(this.element.querySelectorAll("style"));try{for(e.s();!(t=e.n()).done;)t.value.remove()}catch(t){e.e(t)}finally{e.f()}this.redrawIfNeeded()}}},{key:"redrawIfNeeded",value:function(){if(Tr(this,Ar))for(var t in Tr(this,Nr)){var e=Tr(this,Nr)[t];if(e.needRedraw()){var n,r=e.content,i=br(e.contents);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.data.style.display=o===r?"block":"none"}}catch(t){i.e(t)}finally{i.f()}}}}}])&&mr(e.prototype,n),r&&mr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(xe);function _r(t){return _r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_r(t)}function Rr(t,e){for(var n=0;n=Wr(this,Ur).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){throw new Error("Method EmbedBanner.getCurrentBreakpoint() is not readable.")}},{key:"isEmbed",value:function(){return!0}},{key:"updatePositionData",value:function(t){for(var e=this.positionData,n=0,r=["id","name","rotationSeconds","displayType","breakpointType","dimensions"];n0&&void 0!==arguments[0]?arguments[0]:1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Gr(this,Yr,{writable:!0,value:void 0}),Vr(this,Yr,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return Vr(this,Yr,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,qr(e,Yr,"get")),++t))}}])&&Hr(e.prototype,n),r&&Hr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Jr(t,e){if(t instanceof e.HTMLElement)return t;if("string"!=typeof t)throw new TypeError("Element must be instance of HTMLElement or String");var n;if(!((n="#"===t.charAt(0)?document.getElementById(t.slice(1)):document.querySelector(t))instanceof e.HTMLElement))throw new TypeError("Selector "+t+" is invalid.");return n}function Qr(t){return Qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qr(t)}function Xr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Zr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Zr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ei(this,oi,{writable:!0,value:void 0}),ei(this,ai,{writable:!0,value:void 0}),ei(this,ui,{writable:!0,value:void 0}),ei(this,ci,{writable:!0,value:void 0}),ei(this,li,{writable:!0,value:[]}),ri(this,oi,e),ri(this,ai,n),ri(this,ui,r),ri(this,ci,new Kr),this.STATE=ne}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){(t=Jr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:window)).setAttribute("data-amp-attached","");var e=new Pr(ni(this,ai),ni(this,oi),ni(this,ci).getNextIdentifier(),t);return ni(this,li).push(e),e}},{key:"addManagedBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;if(null===ni(this,ui))throw new Error("Unable to add managed banner, renderer is not provided.");(t=Jr(t,i)).setAttribute("data-amp-attached","");var o=new ar(ni(this,ai),ni(this,ui),ni(this,oi),ni(this,ci).getNextIdentifier(),t,e,n,r);return ni(this,li).push(o),o}},{key:"addEmbedBanner",value:function(t,e,n,r){t=Jr(t,window),e=Jr(e,window),t.setAttribute("data-amp-attached","");var i=new zr(ni(this,oi),ni(this,ci).getNextIdentifier(),t,e,n,r);return ni(this,li).push(i),i}},{key:"removeBanner",value:function(t){var e=ni(this,li).length;return ri(this,li,ni(this,li).filter((function(e){return e!==t}))),e!==ni(this,li).length}},{key:"getBannersByState",value:function(t){var e=t.state,n=t.managed,r=void 0===n||n,i=t.external,o=void 0===i||i,a=t.embed,u=void 0===a||a;return ni(this,li).filter((function(t){return t instanceof xe&&t.state===e&&!(t instanceof ar&&!r||t instanceof Pr&&!o||t instanceof zr&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Ue?t.value:t,r=Xr(ni(this,li));try{for(r.s();!(e=r.n()).done;){var i=e.value;if(!(i instanceof zr)){var o,a=Xr(i.fingerprints);try{for(a.s();!(o=a.n()).done;)if(o.value.value===n)return i}catch(t){a.e(t)}finally{a.f()}}}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"getBannerByUid",value:function(t){var e,n=Xr(ni(this,li));try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.uid===t)return r}}catch(t){n.e(t)}finally{n.f()}return null}}],n&&ti(e.prototype,n),r&&ti(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fi(t){return fi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fi(t)}function pi(t,e){for(var n=0;nTi(this,Pi)&&n.splice(n.length-Ti(this,Pi)),ki(this,_i,n),Oi(this,Ii,Bi).call(this))}},{key:"isClosed",value:function(t){return-1!==Oi(this,Ri,Di).call(this).indexOf(t)}}])&&wi(e.prototype,n),r&&wi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Di(){if(null!==Ti(this,_i))return Ti(this,_i);var t=Ti(this,Ni).getItem(Ti(this,Ai)),e=null!==t&&""!==t?t.split(","):[];return ki(this,_i,e)}function Bi(){null!==Ti(this,_i)&&Ti(this,Ni).setItem(Ti(this,Ai),Ti(this,_i).join(","))}function Wi(){var t={items:{}};return t.setItem=function(t,e){this.items[t]=e}.bind(t),t.getItem=function(t){return t in this.items?this.items[t]:null}.bind(t),t}function xi(t){return xi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xi(t)}function Li(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Qi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("function"!=typeof e)throw new TypeError("Listener must be of type function.");var o="idx_"+to(this,ro).getNextIdentifier();return to(this,io)[t]=to(this,io)[t]||{},to(this,io)[t][o]={callback:e,scope:r,priority:i},t in to(this,oo)&&delete to(this,oo)[t],function(){t in to(n,io)&&o in to(n,io)[t]&&delete to(n,io)[t][o]}}},{key:"dispatch",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;re.priority?-1:t.priority=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function _o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=u.pixels)return u.ratio}}catch(t){o.e(t)}finally{o.f()}return r};return new IntersectionObserver((function(r){var i,a=[],u={},l={},s=Po(r);try{for(s.s();!(i=s.n()).done;){var f=i.value,p=f.target.dataset.ampBannerFingerprint,y=t.getBannerByFingerprint(p);if(y){var v=n[p];if(v){var b={fingerprint:v.fingerprint,element:f.target,banner:y};if(a.push(No(No({},b),{},{entry:f})),!v.alreadySeen){var h=f.intersectionRatio>=c(f.target);u[p]=!(p in u)||!u[p].isIntersecting&&h?{fingerprintArgs:b,fingerprintMetadata:v,isIntersecting:h}:u[p]}if(!v.alreadyFullySeen){var m=.99<=f.intersectionRatio;l[p]=!(p in l)||!l[p].isFullyIntersecting&&m?{fingerprintArgs:b,fingerprintMetadata:v,isFullyIntersecting:m}:l[p]}}}}}catch(t){s.e(t)}finally{s.f()}for(var d=function(){var t=g[w],n=t.fingerprintArgs,r=t.fingerprintMetadata,i=t.isIntersecting;i&&!r.alreadySeen&&null===r.firstTimeSeenTimeoutId?r.firstTimeSeenTimeoutId=setTimeout((function(){r.alreadySeen=!0,e.dispatch(oe.ON_BANNER_FIRST_TIME_SEEN,n)}),o):i||null===r.firstTimeSeenTimeoutId||(clearTimeout(r.firstTimeSeenTimeoutId),r.firstTimeSeenTimeoutId=null)},w=0,g=Object.values(u);w=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Bo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function ua(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=":"<=").concat(i);var o={};return o[e.params.channel_code]=pa(a,ma),o[e.params.banner_id]=n.bannerId,o[e.params.banner_name]=n.bannerName,o[e.params.position_id]=n.positionId,o[e.params.position_code]=n.positionCode,o[e.params.position_name]=n.positionName,o[e.params.campaign_id]=n.campaignId,o[e.params.campaign_code]=n.campaignCode,o[e.params.campaign_name]=n.campaignName,o[e.params.breakpoint]=i,o}}),ya(this,ba,e),ya(this,ha,n),ya(this,ma,r),ya(this,da,!1)}var e,n,r;return e=t,(n=[{key:"collectBeforeAttach",value:function(){var t=this;if(!pa(this,wa).started&&!pa(this,da)){pa(this,wa).started=!0;var e=pa(this,ha),n=new ia({});pa(this,wa).cleanup.push(e.subscribe(oe.ON_BANNER_STATE_CHANGED,(function(e){var r=e.banner;if(!r.isEmbed()&&ne.RENDERED===r.state&&1===r.stateCounter){var i,o=aa(r.fingerprints);try{for(o.s();!(i=o.n()).done;){var a=i.value;pa(t,wa).events.push({name:ta.BANNER_LOADED,params:pa(t,ga).call(t,{config:n,fingerprint:a,banner:r})})}}catch(t){o.e(t)}finally{o.f()}}}))),pa(this,wa).cleanup.push(e.subscribe(oe.ON_BANNER_FIRST_TIME_SEEN,(function(e){var r=e.fingerprint,i=e.banner;pa(t,wa).events.push({name:ta.BANNER_DISPLAYED,params:pa(t,ga).call(t,{config:n,fingerprint:r,banner:i})})}))),pa(this,wa).cleanup.push(e.subscribe(oe.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(e){var r=e.fingerprint,i=e.banner;pa(t,wa).events.push({name:ta.BANNER_FULLY_DISPLAYED,params:pa(t,ga).call(t,{config:n,fingerprint:r,banner:i})})}))),pa(this,wa).cleanup.push(e.subscribe(oe.ON_BANNER_LINK_CLICKED,(function(e){var r=e.fingerprint,i=e.banner,o=e.target,a=pa(t,ga).call(t,{config:n,fingerprint:r,banner:i});a[n.params.link]=o.href||"",pa(t,wa).events.push({name:ta.BANNER_CLICKED,params:a})}))),pa(this,wa).cleanup.push(e.subscribe(oe.ON_BANNER_AFTER_CLOSE,(function(e){var r=e.fingerprint,i=e.banner;pa(t,wa).events.push({name:ta.BANNER_CLOSED,params:pa(t,ga).call(t,{config:n,fingerprint:r,banner:i})})})))}}},{key:"attach",value:function(t){var e=this;if(!pa(this,da)){ya(this,da,!0);var n=pa(this,ha),r=pa(this,ba);if(r.hasAnyReceiver()){var i=t.events[ta.BANNER_LOADED],o=t.events[ta.BANNER_DISPLAYED],a=t.events[ta.BANNER_FULLY_DISPLAYED],u=t.events[ta.BANNER_CLICKED],c=t.events[ta.BANNER_CLOSED];if(pa(this,wa).started){for(var l in pa(this,wa).events){var s=pa(this,wa).events[l],f=s.name,p=s.params;if(!1!==t.events[f]){var y={};for(var v in p)y[t.params[v]]=p[v];r.send(t.events[f],y)}}fa(this,Sa,Ta).call(this)}!1!==i&&n.subscribe(oe.ON_BANNER_STATE_CHANGED,(function(n){var o=n.banner;if(!o.isEmbed()&&ne.RENDERED===o.state&&1===o.stateCounter){var a,u=aa(o.fingerprints);try{for(u.s();!(a=u.n()).done;){var c=a.value;r.send(i,pa(e,ga).call(e,{config:t,fingerprint:c,banner:o}))}}catch(t){u.e(t)}finally{u.f()}}})),!1!==o&&n.subscribe(oe.ON_BANNER_FIRST_TIME_SEEN,(function(n){var i=n.fingerprint,a=n.banner;r.send(o,pa(e,ga).call(e,{config:t,fingerprint:i,banner:a}))})),!1!==a&&n.subscribe(oe.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(n){var i=n.fingerprint,o=n.banner;r.send(a,pa(e,ga).call(e,{config:t,fingerprint:i,banner:o}))})),!1!==u&&n.subscribe(oe.ON_BANNER_LINK_CLICKED,(function(n){var i=n.fingerprint,o=n.banner,a=n.target,c=pa(e,ga).call(e,{config:t,fingerprint:i,banner:o});c[t.params.link]=a.href||"",r.send(u,c)})),!1!==c&&n.subscribe(oe.ON_BANNER_AFTER_CLOSE,(function(n){var i=n.fingerprint,o=n.banner;r.send(c,pa(e,ga).call(e,{config:t,fingerprint:i,banner:o}))}))}else fa(this,Sa,Ta).call(this)}}}])&&ca(e.prototype,n),r&&ca(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ta(){for(var t in pa(this,wa).cleanup)pa(this,wa).cleanup[t]();pa(this,wa).events=[],pa(this,wa).cleanup=[]}var ka=!1;const ja=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!ka&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(ka=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var Oa=!1;const Na=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!Oa&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(Oa=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function Aa(t){return Aa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Aa(t)}function Pa(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _a(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Aa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==Aa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Aa(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ra=!1;const Ia=function(t,e){if(!("dataLayer"in window))return!Ra&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(Ra=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.dataLayer.push(function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Ba(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:"*";t.postMessage({message:e,data:n},r)}},{key:"listen",value:function(){var t=this;window.addEventListener("message",(function(e){if(!(0=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function eu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Cu(t,e){if(t){if("string"==typeof t)return Mu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mu(t,e):void 0}}function Mu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1f||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==m(e.metrics))throw new Error('The option "metrics" must be an object of the format { receiver: null|string|function|array, events: object{ *: string|false }, params: object{ *: string } }, '.concat(e.metrics," passed."));if(null!==e.metrics.receiver&&-1===["string","function"].indexOf(m(e.metrics.receiver))&&!Array.isArray(e.metrics.receiver))throw new Error('The option "metrics.receiver" must be a null or a string or a function or an array of strings|functions, "'.concat(e.metrics.receiver,'" passed.'));if(Array.isArray(e.metrics.receiver)){for(var p in e.metrics.receiver)if(-1===["string","function"].indexOf(m(e.metrics.receiver[p])))throw new Error('The option "metrics.receiver.'.concat(p,'" must be a string or a function, "').concat(e.metrics.receiver[p],'" passed.'))}else e.metrics.receiver=null!==e.metrics.receiver?[e.metrics.receiver]:[];if("object"!==m(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==m(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==m(e.closing)||"string"!=typeof e.closing.storage||"string"!=typeof e.closing.key||!Number.isInteger(e.closing.maxItems)||1>e.closing.maxItems)throw new Error('The option "closing" must be an object of the format { storage: "memoryStorage"|"localStorage"|"sessionStorage", key: string, maxItems: integer<1, max> }, '.concat(JSON.stringify(e.closing)," passed."));return e}(n)),Lu(this,$u,new ao),Lu(this,Hu,new Ft(n.method,n.url,n.version,n.channel)),Lu(this,Gu,new Zt(n.url,n.version,n.channel)),Lu(this,qu,new si(xu(this,$u),mi.fromCurrentWindow(),new ko(n.template))),Lu(this,Yu,new Jo(xu(this,qu),xu(this,$u),n.interaction)),Lu(this,Ju,$a.createFromReceivers(n.metrics.receiver)),Lu(this,Qu,new Ea(xu(this,Ju),xu(this,$u),n.channel)),Lu(this,Xu,new ku({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction,metrics:{events:n.metrics.events,params:n.metrics.params}}},bannerManager:xu(this,qu),metricsSender:xu(this,Ju)})),Lu(this,Ku,new Yi({bannerManager:xu(this,qu),eventBus:xu(this,$u),config:{storage:n.closing.storage,key:n.closing.key,maxItems:n.closing.maxItems},frameMessenger:xu(this,Xu)})),this.setLocale(n.locale),xu(this,Hu).origin=n.origin,n.resources)xu(this,Hu).addDefaultResource(a,n.resources[a]),xu(this,Gu).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=Iu(xu(o,qu).getBannersByState({state:xu(o,qu).STATE.RENDERED,managed:!0,external:!0,embed:!1}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}})),xu(this,Xu).listen(),xu(this,Qu).attach(new ia({events:n.metrics.events,params:n.metrics.params})),xu(this,Yu).start(),xu(this,Ku).attachUi()}var e,n,r;return e=t,n=[{key:"version",get:function(){return xu(this,Uu)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return xu(this,$u).subscribe(t,e,n)}},{key:"setLocale",value:function(t){xu(this,Hu).locale=t,xu(this,Gu).locale=t}},{key:"setGateway",value:function(t){if(!function(t){return t instanceof S}(t))throw new TypeError("Argument gateway mut be instance of AbstractGateway.");Lu(this,Vu,t)}},{key:"getGateway",value:function(){return null===xu(this,Vu)&&this.setGateway(new et),xu(this,Vu)}},{key:"createBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"managed",o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:window;if(t=Jr(t,o),"embed"===i){var a=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,Zu,ec).call(this,t,e,n,r),u=xu(this,qu).addEmbedBanner(t,a,e,r);return xu(this,Xu).connectBanner(u),t.insertAdjacentElement("beforeend",a),u}return xu(this,qu).addManagedBanner(t,e,n,r,o)}},{key:"closeBanner",value:function(t){xu(this,Ku).closeBanner(t)}},{key:"attachBanners",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,r=Iu(e.querySelectorAll("[data-amp-banner]:not([data-amp-attached])"));try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.dataset.ampBanner;if(o){var a=void 0;if("ampBannerExternal"in i.dataset)a=xu(this,qu).addExternalBanner(i,n);else{var u=yr.parseResources(i),c=yr.parseOptions(i),l=i.dataset.ampMode||"managed";a=this.createBanner(i,o,u,c,l,n)}xu(this,$u).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:a})}else console.warn("Unable to attach a banner to the element ",i,' because the attribute "data-amp-banner" has an empty value.')}}catch(t){r.e(t)}finally{r.f()}}},{key:"fetch",value:function(){var t=this,e=xu(this,qu).getBannersByState({state:xu(this,qu).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=xu(this,Hu).create(),i=Iu(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r.addPosition(o.position,o.resources,"1"!==o.options.get("omit-default-resources","0").toString())}}catch(t){i.e(t)}finally{i.f()}xu(this,$u).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,i=n.data,o=Iu(e);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.position in i&&"banners"in i[a.position]&&Object.values(i[a.position].banners).length){for(var u=i[a.position],c=Array.isArray(u.banners)?u.banners:Object.values(u.banners),l=[],s=0;st.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1a||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==ic(e.metrics))throw new Error('The option "metrics" must be an object of the format { events: object{ *: string|false }, params: object{ *: string } }, '.concat(JSON.stringify(e.metrics)," passed."));if("object"!==ic(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==ic(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));return e}function uc(t){return uc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uc(t)}function cc(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return lc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lc(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function lc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function zc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;return Yc(this,tl).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(Yc(this,ul))throw new Error("Method attachBanner() should be called only once.");var t=document.querySelector("[data-amp-banner]:not([data-amp-attached])");if(t){var e=Yc(this,el).addExternalBanner(t);Kc(this,ul,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),Yc(this,tl).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:e})}else console.warn("No banner found in the embed client.")}}],n&&$c(e.prototype,n),r&&$c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pl(t,e){Yc(this,nl).sendToParent("metrics",{eventName:t,eventArgs:e})}function yl(){var t,e=Uc(Yc(this,el).getBannersByState({state:ne.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function vl(t){return vl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vl(t)}function bl(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new tc(new p(hl,"standard@".concat(hl)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new fl(new p(hl,"embed@".concat(hl)),t)}},{key:"version",get:function(){return hl}}],(n=null)&&bl(e.prototype,n),r&&bl(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();AMPClientFactory=e.default})(); \ No newline at end of file +var AMPClientFactory;(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.d(e,{default:()=>Ol});var n={};t.r(n),t.d(n,{exclude:()=>V,extract:()=>F,parse:()=>U,parseUrl:()=>$,pick:()=>G,stringify:()=>z,stringifyUrl:()=>H});const r=JSON.parse('{"i8":"1.7.0-beta.3"}');function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t,e){for(var n=0;n\n\n <% if(\'img\' === data.content.type) { %>\n target="<%- data.content.target %>"<% } %>>\n \n <% (data.content.sources || []).forEach(function(source) { %>\n \n <% }); %>\n <%- data.content.alt %>width="<%- data.content.dimensions.width %>"<% } %>\n <% if(null !== data.content.dimensions.height) { %>height="<%- data.content.dimensions.height %>"<% } %>\n <% if(\'\' !== data.content.title) { %>title="<%- data.content.title %>"<% } %>\n <% var loading; if(loading = banner.options.evaluate(\'loading\', 0)) { %>loading="<%- loading %>"<% } %>\n <% var fetchPriority; if(fetchPriority = banner.options.evaluate(\'fetchpriority\', 0)) { %>fetchpriority="<%- fetchPriority %>"<% } %>>\n \n \n <% } else if (\'html\' === data.content.type) { %>\n
\n <%= data.content.html %>\n
\n <% } %>\n\n \n',random:'\n \n',multiple:'\n \n'};function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,u=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return m(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nnull==t,I=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),C=Symbol("encodeFragmentIdentifier");function M(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function D(t,e){return e.encode?e.strict?I(t):encodeURIComponent(t):t}function B(t,e){return e.decode?N(t):t}function W(t){return Array.isArray(t)?t.sort():"object"==typeof t?W(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function x(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function L(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function F(t){const e=(t=x(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function U(t,e){M((e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e}).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,r)=>{e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return(t,n,r)=>{e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"colon-list-separator":return(t,n,r)=>{e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),e?void 0!==r[t]?r[t]=[...r[t],n]:r[t]=[n]:r[t]=n};case"comma":case"separator":return(e,n,r)=>{const i="string"==typeof n&&n.includes(t.arrayFormatSeparator),o="string"==typeof n&&!i&&B(n,t).includes(t.arrayFormatSeparator);n=o?B(n,t):n;const a=i||o?n.split(t.arrayFormatSeparator).map((e=>B(e,t))):null===n?n:B(n,t);r[e]=a};case"bracket-separator":return(e,n,r)=>{const i=/(\[])$/.test(e);if(e=e.replace(/\[]$/,""),!i)return void(r[e]=n?B(n,t):n);const o=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>B(e,t)));void 0!==r[e]?r[e]=[...r[e],...o]:r[e]=o};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[...[n[t]].flat(),e]:n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t)return r;if(!(t=t.trim().replace(/^[?#&]/,"")))return r;for(const i of t.split("&")){if(""===i)continue;const t=e.decode?i.replace(/\+/g," "):i;let[o,a]=P(t,"=");void 0===o&&(o=t),a=void 0===a?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:B(a,e),n(B(o,e),a,r)}for(const[t,n]of Object.entries(r))if("object"==typeof n&&null!==n)for(const[t,r]of Object.entries(n))n[t]=L(r,e);else r[t]=L(n,e);return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{const n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=W(n):t[e]=n,t}),Object.create(null))}function z(t,e){if(!t)return"";M((e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e}).arrayFormatSeparator);const n=n=>e.skipNull&&R(t[n])||e.skipEmptyString&&""===t[n],r=function(t){switch(t.arrayFormat){case"index":return e=>(n,r)=>{const i=n.length;return void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[D(e,t),"[",i,"]"].join("")]:[...n,[D(e,t),"[",D(i,t),"]=",D(r,t)].join("")]};case"bracket":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[D(e,t),"[]"].join("")]:[...n,[D(e,t),"[]=",D(r,t)].join("")];case"colon-list-separator":return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,[D(e,t),":list="].join("")]:[...n,[D(e,t),":list=",D(r,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[D(n,t),e,D(i,t)].join("")]:[[r,D(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:null===r?[...n,D(e,t)]:[...n,[D(e,t),"=",D(r,t)].join("")]}}(e),i={};for(const[e,r]of Object.entries(t))n(e)||(i[e]=r);const o=Object.keys(i);return!1!==e.sort&&o.sort(e.sort),o.map((n=>{const i=t[n];return void 0===i?"":null===i?D(n,e):Array.isArray(i)?0===i.length&&"bracket-separator"===e.arrayFormat?D(n,e)+"[]":i.reduce(r(n),[]).join("&"):D(n,e)+"="+D(i,e)})).filter((t=>t.length>0)).join("&")}function $(t,e){e={decode:!0,...e};let[n,r]=P(t,"#");return void 0===n&&(n=t),{url:n?.split("?")?.[0]??"",query:U(F(t),e),...e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:B(r,e)}:{}}}function H(t,e){e={encode:!0,strict:!0,[C]:!0,...e};const n=x(t.url).split("?")[0]||"";let r=z({...U(F(t.url),{sort:!1}),...t.query},e);r&&(r=`?${r}`);let i=function(t){let e="";const n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(t.url);if(t.fragmentIdentifier){const r=new URL(n);r.hash=t.fragmentIdentifier,i=e[C]?r.hash:`#${t.fragmentIdentifier}`}return`${n}${r}${i}`}function G(t,e,n){n={parseFragmentIdentifier:!0,[C]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=$(t,n);return H({url:r,query:A(i,e),fragmentIdentifier:o},n)}function V(t,e,n){return G(t,Array.isArray(e)?t=>!e.includes(t):(t,n)=>!e(t,n),n)}const Y=n;function q(t){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(t)}function K(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return J(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nr.status?e(t):n(t)},r.onerror=function(){n({status:"error",data:{code:r.status,error:r.statusText||"unknown"}})};var i=t.endpoint;"GET"===t.method&&(i+="?".concat(Y.stringify(t.parameters))),r.open(t.method,i,!0),r.overrideMimeType("application/json"),r.setRequestHeader("Accept","application/json");var o,a=K(t.headers);try{for(a.s();!(o=a.n()).done;){var u=o.value;r.setRequestHeader(u.name,u.value)}}catch(t){a.e(t)}finally{a.f()}r.send("POST"===t.method?JSON.stringify(t.parameters):null)}}])&&Q(e.prototype,n),r&&Q(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(S);function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function rt(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ht(this,St,{writable:!0,value:void 0}),ht(this,Et,{writable:!0,value:void 0}),ht(this,Tt,{writable:!0,value:void 0}),ht(this,kt,{writable:!0,value:void 0}),ht(this,Ot,{writable:!0,value:void 0}),ht(this,jt,{writable:!0,value:void 0}),ht(this,Nt,{writable:!0,value:function(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var i=t[n][r].value.filter((function(t){return""!==t}));i.length&&(e[n][r]=i)}return e}}),wt(this,St,e),wt(this,Et,n),wt(this,Tt,r),wt(this,kt,{}),wt(this,Ot,i),wt(this,jt,o)}var e,n,r;return e=t,n=[{key:"addPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=dt(this,kt);if(t in r)throw new Error('Position "'+t+'" already exists.');r[t]={},n&&this.addPositionResources(t,dt(this,Ot)),this.addPositionResources(t,e)}},{key:"addPositionResources",value:function(t,e){for(var n in e)this.addPositionResource(t,e[n])}},{key:"addPositionResource",value:function(t,e){if(!(e instanceof yt))throw new TypeError("Argument resource must be instance of Resource class.");var n=dt(this,kt);if(!(t in n))throw new Error('Missing position "'+t+'".');var r=n[t];e.name in r?r[e.name]=r[e.name].withValues(e.value):r[e.name]=e}},{key:"method",get:function(){return dt(this,St)}},{key:"endpoint",get:function(){return dt(this,Et)}},{key:"locale",get:function(){return dt(this,Tt)}},{key:"parameters",get:function(){var t=dt(this,Nt).call(this,dt(this,kt)),e={query:"GET"===this.method?JSON.stringify(t):t};return null!==this.locale&&(e.locale=this.locale),e}},{key:"headers",get:function(){return dt(this,jt)}}],n&&mt(e.prototype,n),r&&mt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function At(t){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(t)}function _t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(var i in"1"!==(r["omit-default-resources"]||"0").toString()?e=function(t){for(var e=1;e]+)>/g,(function(t,e){var n=o[e];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof i){var a=this;return t[Symbol.replace].call(this,n,(function(){var t=arguments;return"object"!=le(t[t.length-1])&&(t=[].slice.call(t)).push(r(t,a)),i.apply(this,t)}))}return t[Symbol.replace].call(this,n,i)},se.apply(this,arguments)}function fe(t,e){return fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fe(t,e)}var pe=se(/^(?:(\d+)\x2D(\d+):|(\d+):|<(\d+):|<=(\d+):|>(\d+):|>=(\d+):)?([^:\s]+)$/,{INTERVAL_FROM:1,INTERVAL_TO:2,EQ:3,LT:4,LTE:5,GT:6,GTE:7,VALUE:8}),ye={};function be(t,e){var n=function(t){if(t in ye)return ye[t];for(var e=t.split(",").map((function(t){return t.trim()})),n=[],r=0;r=this.from&&t<=this.to}};break;case void 0!==i.groups.EQ:o={eq:parseInt(i.groups.EQ),matches:function(t){return t===this.eq}};break;case void 0!==i.groups.LT:o={lt:parseInt(i.groups.LT),matches:function(t){return tthis.gt}};break;case void 0!==i.groups.GTE:o={gte:parseInt(i.groups.GTE),matches:function(t){return t>=this.gte}};break;default:o={matches:function(){return!0}}}o&&(o.matches=o.matches.bind(o),o.value=i.groups.VALUE,n.push(o))}}var a={rules:n,cache:{}};return a.evaluate=function(t){Number.isInteger(t)||(t=parseInt(t));var e="i_".concat(t);if(e in this.cache)return this.cache[e];for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:void 0;return this.options[t]||e}},{key:"evaluate",value:function(t,e){return void 0===this.options[t]?null:be(this.options[t],e)}},{key:"override",value:function(t){this.options=he(he({},this.options),Ee(this,Te,Oe).call(this,he({},t)))}}],n&&we(e.prototype,n),r&&we(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Oe(t){if("loading-offset"in t){var e=t["loading-offset"],n="loading"in t?t.loading:"loading"in this.options?this.options.loading:null,r=null!==n?">=".concat(e,":").concat(n):null,i='AMP deprecation warning: The banner option "loading-offset" is deprecated and will be removed in some future release.';null!==r&&(i+=' Instead of options {"loading": "'.concat(n,'", "loading-offset": "').concat(e,'"} use an expression based option {"loading": "').concat(r,'"}.')),console.warn(i),delete t["loading-offset"],null!==r&&(t.loading=r)}return t}function je(t){return je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},je(t)}function Ne(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";if(-1===this.STATE.STATES.indexOf(t))throw new TypeError("".concat(t," is not valid state."));_e(this,De,t),_e(this,Be,e.toString()),Ae(this,We)[t]=(Ae(this,We)[t]||0)+1,this._eventBus.dispatch(oe.ON_BANNER_STATE_CHANGED,{banner:this})}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t.startsWith("amp:banner:"))throw new Error('Unable to attach listener on event "'.concat(t,'" through a banner.'));return this._eventBus.subscribe(t,(function(t){t.banner===this&&(null!==n?e.call(n,t):e(t))}),this)}},{key:"getCurrentBreakpoint",value:function(t){return null}},{key:"overrideOptions",value:function(t){Ae(this,Me).override(t)}},{key:"redrawIfNeeded",value:function(){}},{key:"isManaged",value:function(){return!1}},{key:"isExternal",value:function(){return!1}},{key:"isEmbed",value:function(){return!1}}],n&&Ne(e.prototype,n),r&&Ne(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Le(t){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(t)}function Fe(t,e){for(var n=0;n=c&&(null===o||oc))&&(i=u,o=c,en(t,ln)[n]=c)):r=u})),null===i&&null===r)throw new Error("Unable to resolve content, no contents found.");a.sort((function(t,e){return t-e})),"min"===n?a.unshift(null):a.push(null);var u=a.indexOf(o);return"max"===n&&u-1 in a&&(en(this,ln).min=a[u-1]),"min"===n&&u+1 in a&&(en(this,ln).max=a[u+1]),nn(this,cn,null!==i?i:r)}},{key:"needRedraw",value:function(){if(null===en(this,cn))return!0;var t=en(this,on).width;return null!==en(this,ln).min&&ten(this,ln).max}}])&&Xe(e.prototype,n),r&&Xe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pn(t,e){for(var n in t)e(t[n],n)}function yn(t){return yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yn(t)}function bn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return vn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function vn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:"weight",n={},r=0,i=0;i0;)u-=n[a],a++;return t[--a]?t[a]:t[0]}}],(n=null)&&Mn(e.prototype,n),r&&Mn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Bn(t){return Bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bn(t)}function Wn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return xn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n6&&void 0!==arguments[6]?arguments[6]:{},s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{};for(var f in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),Hn(zn(c=i.call(this,n,r,a,u,s)),or),Hn(zn(c),ir),Gn(zn(c),Qn,{writable:!0,value:void 0}),Gn(zn(c),Xn,{writable:!0,value:void 0}),Gn(zn(c),Zn,{writable:!0,value:[]}),Gn(zn(c),tr,{writable:!0,value:void 0}),Gn(zn(c),er,{writable:!0,value:!1}),Gn(zn(c),nr,{writable:!0,value:null}),Gn(zn(c),rr,{writable:!0,value:[]}),Kn(zn(c),Qn,t),Kn(zn(c),Xn,e),Kn(zn(c),tr,l),l)qn(zn(c),Zn).push(new yt(f,l[f]));return c.setState(c.STATE.NEW,"Banner created."),c}return e=o,(n=[{key:"html",set:function(t){this.element.innerHTML=t}},{key:"resources",get:function(){return qn(this,Zn)}},{key:"rawResources",get:function(){return qn(this,tr)}},{key:"data",get:function(){return console.warn("Usage of deprecated property `ManagedBanner.data`. Please use property `positionData` for accessing information about a position."),new In(this)}},{key:"fingerprints",get:function(){var t;try{t=this.bannerData}catch(t){return[]}return null===t?[]:(this.positionData.isMultiple()||(t=[t]),t.map((function(t){return t.fingerprint})))}},{key:"bannerData",get:function(){if(null!==qn(this,nr))return qn(this,nr);if(!qn(this,rr).length)return null;var t=null,e=this.positionData,n=function(t){return Ue.createFromProperties({bannerId:t.id,bannerName:t.name,positionId:e.id,positionCode:e.code,positionName:e.name,campaignId:t.campaignId,campaignCode:t.campaignCode,campaignName:t.campaignName})};switch(!0){case e.isSingle():(t=qn(this,rr).reduce((function(t,e){return t.score>=e.score?t:e}))).fingerprint=n(t);break;case e.isRandom():(t=Dn.randomByWeights(qn(this,rr),"score")).fingerprint=n(t);break;case e.isMultiple():var r,i=Wn(t=qn(this,rr).sort((function(t,e){return e.score-t.score})));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.fingerprint=n(o)}}catch(t){i.e(t)}finally{i.f()}break;default:throw new Error("Invalid display type ".concat(this.displayType,"."))}return Kn(this,nr,t),t}},{key:"unsetFingerprint",value:function(t){var e=t.bannerId,n=this.positionData;if(qn(this,rr).filter((function(t){return t.id===e}))[0]){switch(!0){case n.isSingle():Kn(this,rr,[]),Kn(this,nr,null);break;case n.isRandom():qn(this,nr)&&qn(this,nr).id===e?(Kn(this,rr,[]),Kn(this,nr,null)):Kn(this,rr,qn(this,rr).filter((function(t){return t.id!==e})));break;case n.isMultiple():Kn(this,rr,qn(this,rr).filter((function(t){return t.id!==e}))),qn(this,nr)&&Kn(this,nr,qn(this,nr).filter((function(t){return t.id!==e})))}0>=qn(this,rr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):n.isRandom()&&this.redrawIfNeeded()}}},{key:"setResponseData",value:function(t){if(qn(this,er))throw new Error("Data for banner on position ".concat(this.position," is already set."));this._positionData=new ce({id:t.position_id||null,code:this._positionData.code,name:t.position_name||null,rotationSeconds:t.rotation_seconds,displayType:t.display_type,breakpointType:t.breakpoint_type}),"options"in t&&this.overrideOptions(t.options);var e=[];for(var n in t.banners||[])e.push(new kn(t.banners[n],t.breakpoint_type,qn(this,Qn)));Kn(this,rr,e),Kn(this,er,!0),0>=qn(this,rr).length?this.setState(this.STATE.CLOSED,"Banner has empty data."):Yn(this,ir,ur).call(this,"Banner was successfully rendered.")}},{key:"getCurrentBreakpoint",value:function(t){var e=this.bannerData,n=(e=(Array.isArray(e)?e:e?[e]:[]).find((function(e){return e.id===t})))&&e.content?e.content.breakpoint:null;return null===n?null:parseInt(n)}},{key:"isManaged",value:function(){return!0}},{key:"redrawIfNeeded",value:function(){Yn(this,or,cr).call(this)&&Yn(this,ir,ur).call(this,"Banner was successfully redrawn.")}}])&&Ln(e.prototype,n),r&&Ln(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(xe);function ur(t){try{this.html=qn(this,Xn).render(this)}catch(t){return void this.setState(this.STATE.ERROR,"Render error: "+t.message)}this.setState(this.STATE.RENDERED,t)}function cr(){var t=this.bannerData;for(var e in Array.isArray(t)||(t=[t]),t)if(t[e].needRedraw())return!0;return!1}function lr(t){return lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lr(t)}function sr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return fr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function fr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function mr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=Tr(this,jr).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){var e=Tr(this,Nr)[t]||null;if(null===e)return null;if(Tr(this,Pr))return e.content?e.content.breakpoint:null;var n,r=vr(e.contents);try{for(r.s();!(n=r.n()).done;){var i=n.value;if("none"!==getComputedStyle(i.data).display)return i.breakpoint}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"isExternal",value:function(){return!0}},{key:"delegateResponsiveBehaviour",value:function(){if(!Tr(this,Pr)){kr(this,Pr,!0);var t,e=vr(this.element.querySelectorAll("style"));try{for(e.s();!(t=e.n()).done;)t.value.remove()}catch(t){e.e(t)}finally{e.f()}this.redrawIfNeeded()}}},{key:"redrawIfNeeded",value:function(){if(Tr(this,Pr))for(var t in Tr(this,Nr)){var e=Tr(this,Nr)[t];if(e.needRedraw()){var n,r=e.content,i=vr(e.contents);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.data.style.display=o===r?"block":"none"}}catch(t){i.e(t)}finally{i.f()}}}}}])&&hr(e.prototype,n),r&&hr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),o}(xe);function _r(t){return _r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_r(t)}function Rr(t,e){for(var n=0;n=Wr(this,Ur).length&&this.setState(this.STATE.CLOSED,"Banner has empty data.")}},{key:"getCurrentBreakpoint",value:function(t){throw new Error("Method EmbedBanner.getCurrentBreakpoint() is not readable.")}},{key:"isEmbed",value:function(){return!0}},{key:"updatePositionData",value:function(t){for(var e=this.positionData,n=0,r=["id","name","rotationSeconds","displayType","breakpointType","dimensions"];n0&&void 0!==arguments[0]?arguments[0]:1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Gr(this,qr,{writable:!0,value:void 0}),Vr(this,qr,e-1)}var e,n,r;return e=t,(n=[{key:"getNextIdentifier",value:function(){var t,e;return Vr(this,qr,(t=function(t,e){return e.get?e.get.call(t):e.value}(e=this,Yr(e,qr,"get")),++t))}}])&&Hr(e.prototype,n),r&&Hr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Jr(t,e){if(t instanceof e.HTMLElement)return t;if("string"!=typeof t)throw new TypeError("Element must be instance of HTMLElement or String");var n;if(!((n="#"===t.charAt(0)?document.getElementById(t.slice(1)):document.querySelector(t))instanceof e.HTMLElement))throw new TypeError("Selector "+t+" is invalid.");return n}function Qr(t){return Qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qr(t)}function Xr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Zr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Zr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ei(this,oi,{writable:!0,value:void 0}),ei(this,ai,{writable:!0,value:void 0}),ei(this,ui,{writable:!0,value:void 0}),ei(this,ci,{writable:!0,value:void 0}),ei(this,li,{writable:!0,value:[]}),ri(this,oi,e),ri(this,ai,n),ri(this,ui,r),ri(this,ci,new Kr),this.STATE=ne}var e,n,r;return e=t,n=[{key:"addExternalBanner",value:function(t){(t=Jr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:window)).setAttribute("data-amp-attached","");var e=new Ar(ni(this,ai),ni(this,oi),ni(this,ci).getNextIdentifier(),t);return ni(this,li).push(e),e}},{key:"addManagedBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;if(null===ni(this,ui))throw new Error("Unable to add managed banner, renderer is not provided.");(t=Jr(t,i)).setAttribute("data-amp-attached","");var o=new ar(ni(this,ai),ni(this,ui),ni(this,oi),ni(this,ci).getNextIdentifier(),t,e,n,r);return ni(this,li).push(o),o}},{key:"addEmbedBanner",value:function(t,e,n,r){t=Jr(t,window),e=Jr(e,window),t.setAttribute("data-amp-attached","");var i=new zr(ni(this,oi),ni(this,ci).getNextIdentifier(),t,e,n,r);return ni(this,li).push(i),i}},{key:"removeBanner",value:function(t){var e=ni(this,li).length;return ri(this,li,ni(this,li).filter((function(e){return e!==t}))),e!==ni(this,li).length}},{key:"getBannersByState",value:function(t){var e=t.state,n=t.managed,r=void 0===n||n,i=t.external,o=void 0===i||i,a=t.embed,u=void 0===a||a;return ni(this,li).filter((function(t){return t instanceof xe&&t.state===e&&!(t instanceof ar&&!r||t instanceof Ar&&!o||t instanceof zr&&!u)}))}},{key:"getBannerByFingerprint",value:function(t){var e,n=t instanceof Ue?t.value:t,r=Xr(ni(this,li));try{for(r.s();!(e=r.n()).done;){var i=e.value;if(!(i instanceof zr)){var o,a=Xr(i.fingerprints);try{for(a.s();!(o=a.n()).done;)if(o.value.value===n)return i}catch(t){a.e(t)}finally{a.f()}}}}catch(t){r.e(t)}finally{r.f()}return null}},{key:"getBannerByUid",value:function(t){var e,n=Xr(ni(this,li));try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.uid===t)return r}}catch(t){n.e(t)}finally{n.f()}return null}}],n&&ti(e.prototype,n),r&&ti(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fi(t){return fi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fi(t)}function pi(t,e){for(var n=0;nTi(this,Ai)&&n.splice(n.length-Ti(this,Ai)),ki(this,_i,n),ji(this,Ii,Bi).call(this))}},{key:"isClosed",value:function(t){return-1!==ji(this,Ri,Di).call(this).indexOf(t)}}])&&wi(e.prototype,n),r&&wi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Di(){if(null!==Ti(this,_i))return Ti(this,_i);var t=Ti(this,Ni).getItem(Ti(this,Pi)),e=null!==t&&""!==t?t.split(","):[];return ki(this,_i,e)}function Bi(){null!==Ti(this,_i)&&Ti(this,Ni).setItem(Ti(this,Pi),Ti(this,_i).join(","))}function Wi(){var t={items:{}};return t.setItem=function(t,e){this.items[t]=e}.bind(t),t.getItem=function(t){return t in this.items?this.items[t]:null}.bind(t),t}function xi(t){return xi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xi(t)}function Li(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Qi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("function"!=typeof e)throw new TypeError("Listener must be of type function.");var o="idx_"+to(this,ro).getNextIdentifier();return to(this,io)[t]=to(this,io)[t]||{},to(this,io)[t][o]={callback:e,scope:r,priority:i},t in to(this,oo)&&delete to(this,oo)[t],function(){t in to(n,io)&&o in to(n,io)[t]&&delete to(n,io)[t][o]}}},{key:"dispatch",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;re.priority?-1:t.priority=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function _o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=u.pixels)return u.ratio}}catch(t){o.e(t)}finally{o.f()}return r};return new IntersectionObserver((function(r){var i,a=[],u={},l={},s=Ao(r);try{for(s.s();!(i=s.n()).done;){var f=i.value,p=f.target.dataset.ampBannerFingerprint,y=t.getBannerByFingerprint(p);if(y){var b=n[p];if(b){var v={fingerprint:b.fingerprint,element:f.target,banner:y};if(a.push(No(No({},v),{},{entry:f})),!b.alreadySeen){var m=f.intersectionRatio>=c(f.target);u[p]=!(p in u)||!u[p].isIntersecting&&m?{fingerprintArgs:v,fingerprintMetadata:b,isIntersecting:m}:u[p]}if(!b.alreadyFullySeen){var h=.99<=f.intersectionRatio;l[p]=!(p in l)||!l[p].isFullyIntersecting&&h?{fingerprintArgs:v,fingerprintMetadata:b,isFullyIntersecting:h}:l[p]}}}}}catch(t){s.e(t)}finally{s.f()}for(var d=function(){var t=g[w],n=t.fingerprintArgs,r=t.fingerprintMetadata,i=t.isIntersecting;i&&!r.alreadySeen&&null===r.firstTimeSeenTimeoutId?r.firstTimeSeenTimeoutId=setTimeout((function(){r.alreadySeen=!0,e.dispatch(oe.ON_BANNER_FIRST_TIME_SEEN,n)}),o):i||null===r.firstTimeSeenTimeoutId||(clearTimeout(r.firstTimeSeenTimeoutId),r.firstTimeSeenTimeoutId=null)},w=0,g=Object.values(u);w=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Bo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function fa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=":"<=").concat(i);var o={};return o[e.params.channel_code]=ga(a,Oa),o[e.params.banner_id]=n.bannerId,o[e.params.banner_name]=n.bannerName,o[e.params.position_id]=n.positionId,o[e.params.position_code]=n.positionCode,o[e.params.position_name]=n.positionName,o[e.params.campaign_id]=n.campaignId,o[e.params.campaign_code]=n.campaignCode,o[e.params.campaign_name]=n.campaignName,o[e.params.breakpoint]=i,ya(ya({},o),e.extraParams)}}),Sa(this,Ta,e),Sa(this,ka,n),Sa(this,Oa,r),Sa(this,ja,!1)}var e,n,r;return e=t,(n=[{key:"collectBeforeAttach",value:function(){var t=this;if(!ga(this,Na).started&&!ga(this,ja)){ga(this,Na).started=!0;var e=ga(this,ka),n=new ca({}),r=n.events[ta.BANNER_LOADED],i=n.events[ta.BANNER_DISPLAYED],o=n.events[ta.BANNER_FULLY_DISPLAYED],a=n.events[ta.BANNER_CLICKED],u=n.events[ta.BANNER_CLOSED];ga(this,Na).cleanup.push(e.subscribe(oe.ON_BANNER_STATE_CHANGED,(function(e){var n=e.banner;if(!n.isEmbed()&&ne.RENDERED===n.state&&1===n.stateCounter){var i,o=sa(n.fingerprints);try{for(o.s();!(i=o.n()).done;){var a=i.value;ga(t,Na).events.push({name:ta.BANNER_LOADED,params:ga(t,Pa).call(t,{event:r,fingerprint:a,banner:n})})}}catch(t){o.e(t)}finally{o.f()}}}))),ga(this,Na).cleanup.push(e.subscribe(oe.ON_BANNER_FIRST_TIME_SEEN,(function(e){var n=e.fingerprint,r=e.banner;ga(t,Na).events.push({name:ta.BANNER_DISPLAYED,params:ga(t,Pa).call(t,{event:i,fingerprint:n,banner:r})})}))),ga(this,Na).cleanup.push(e.subscribe(oe.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(e){var n=e.fingerprint,r=e.banner;ga(t,Na).events.push({name:ta.BANNER_FULLY_DISPLAYED,params:ga(t,Pa).call(t,{event:o,fingerprint:n,banner:r})})}))),ga(this,Na).cleanup.push(e.subscribe(oe.ON_BANNER_LINK_CLICKED,(function(e){var n=e.fingerprint,r=e.banner,i=e.target,o=ga(t,Pa).call(t,{event:a,fingerprint:n,banner:r});o[a.params.link]=i.href||"",ga(t,Na).events.push({name:ta.BANNER_CLICKED,params:o})}))),ga(this,Na).cleanup.push(e.subscribe(oe.ON_BANNER_AFTER_CLOSE,(function(e){var n=e.fingerprint,r=e.banner;ga(t,Na).events.push({name:ta.BANNER_CLOSED,params:ga(t,Pa).call(t,{event:u,fingerprint:n,banner:r})})})))}}},{key:"attach",value:function(t){var e=this;if(!ga(this,ja)){Sa(this,ja,!0);var n=ga(this,ka),r=ga(this,Ta);if(r.hasAnyReceiver()){var i=t.events[ta.BANNER_LOADED],o=t.events[ta.BANNER_DISPLAYED],a=t.events[ta.BANNER_FULLY_DISPLAYED],u=t.events[ta.BANNER_CLICKED],c=t.events[ta.BANNER_CLOSED];if(ga(this,Na).started){for(var l in ga(this,Na).events){var s=ga(this,Na).events[l],f=s.name,p=s.params,y=t.events[f];if(y.enabled){var b={};for(var v in p)b[y.params[v]]=p[v];r.send(y.name,ya(ya({},b),y.extraParams))}}wa(this,Aa,Ra).call(this)}i.enabled&&n.subscribe(oe.ON_BANNER_STATE_CHANGED,(function(t){var n=t.banner;if(!n.isEmbed()&&ne.RENDERED===n.state&&1===n.stateCounter){var o,a=sa(n.fingerprints);try{for(a.s();!(o=a.n()).done;){var u=o.value;r.send(i.name,ga(e,Pa).call(e,{event:i,fingerprint:u,banner:n}))}}catch(t){a.e(t)}finally{a.f()}}})),o.enabled&&n.subscribe(oe.ON_BANNER_FIRST_TIME_SEEN,(function(t){var n=t.fingerprint,i=t.banner;r.send(o.name,ga(e,Pa).call(e,{event:o,fingerprint:n,banner:i}))})),a.enabled&&n.subscribe(oe.ON_BANNER_FIRST_TIME_FULLY_SEEN,(function(t){var n=t.fingerprint,i=t.banner;r.send(a.name,ga(e,Pa).call(e,{event:a,fingerprint:n,banner:i}))})),u.enabled&&n.subscribe(oe.ON_BANNER_LINK_CLICKED,(function(t){var n=t.fingerprint,i=t.banner,o=t.target,a=ga(e,Pa).call(e,{event:u,fingerprint:n,banner:i});a[u.params.link]=o.href||"",r.send(u.name,a)})),c.enabled&&n.subscribe(oe.ON_BANNER_AFTER_CLOSE,(function(t){var n=t.fingerprint,i=t.banner;r.send(c.name,ga(e,Pa).call(e,{event:c,fingerprint:n,banner:i}))}))}else wa(this,Aa,Ra).call(this)}}}])&&va(e.prototype,n),r&&va(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ra(){for(var t in ga(this,Na).cleanup)ga(this,Na).cleanup[t]();ga(this,Na).events=[],ga(this,Na).cleanup=[]}var Ia=!1;const Ca=function(t,e){if(!("plausible"in window)||"function"!=typeof window.plausible)return!Ia&&console.warn("Unable to send metrics to Plausible because the function plausible() does not occur in the window."),void(Ia=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.plausible(t,{props:e})};var Ma=!1;const Da=function(t,e){if(!("gtag"in window)||"function"!=typeof window.gtag)return!Ma&&console.warn("Unable to send metrics to Google Analytics because the function gtag() does not occur in the window."),void(Ma=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.gtag("event",t,e)};function Ba(t){return Ba="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ba(t)}function Wa(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function xa(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Ba(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==Ba(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ba(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var La=!1;const Fa=function(t,e){if(!("dataLayer"in window))return!La&&console.warn("Unable to send metrics to GTM because the dataLayer does not occur in the window."),void(La=!0);Object.keys(e).forEach((function(t){return null===e[t]&&delete e[t]})),window.dataLayer.push(function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Ha(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n3&&void 0!==arguments[3]?arguments[3]:"*";t.postMessage({message:e,data:n},r)}},{key:"listen",value:function(){var t=this;window.addEventListener("message",(function(e){if(!(0=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function lu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Uu(t,e){if(t){if("string"==typeof t)return zu(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zu(t,e):void 0}}function zu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1f||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==h(e.metrics))throw new Error('The option "metrics" must be an object of the format { receiver: null|string|function|array, events: object, params: object }, '.concat(e.metrics," passed."));if(null!==e.metrics.receiver&&-1===["string","function"].indexOf(h(e.metrics.receiver))&&!Array.isArray(e.metrics.receiver))throw new Error('The option "metrics.receiver" must be a null or a string or a function or an array of strings|functions, "'.concat(e.metrics.receiver,'" passed.'));if(Array.isArray(e.metrics.receiver)){for(var p in e.metrics.receiver)if(-1===["string","function"].indexOf(h(e.metrics.receiver[p])))throw new Error('The option "metrics.receiver.'.concat(p,'" must be a string or a function, "').concat(e.metrics.receiver[p],'" passed.'))}else e.metrics.receiver=null!==e.metrics.receiver?[e.metrics.receiver]:[];if("object"!==h(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false|{ name?: string, params?: { *: string }, extraParams?: { *: scalar } } }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==h(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==h(e.metrics.extraParams))throw new Error('The option "metrics.extraParams" must be an object of the format { *: scalar }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==h(e.closing)||"string"!=typeof e.closing.storage||"string"!=typeof e.closing.key||!Number.isInteger(e.closing.maxItems)||1>e.closing.maxItems)throw new Error('The option "closing" must be an object of the format { storage: "memoryStorage"|"localStorage"|"sessionStorage", key: string, maxItems: integer<1, max> }, '.concat(JSON.stringify(e.closing)," passed."));return e}(n)),Yu(this,Qu,new ao),Yu(this,Xu,new Ft(n.method,n.url,n.version,n.channel)),Yu(this,Zu,new Zt(n.url,n.version,n.channel)),Yu(this,ec,new si(Vu(this,Qu),hi.fromCurrentWindow(),new ko(n.template))),Yu(this,nc,new Jo(Vu(this,ec),Vu(this,Qu),n.interaction)),Yu(this,ic,Qa.createFromReceivers(n.metrics.receiver)),Yu(this,oc,new _a(Vu(this,ic),Vu(this,Qu),n.channel)),Yu(this,ac,new Iu({origin:n.url,connectionData:{extendedConfig:{interaction:n.interaction,metrics:{events:n.metrics.events,params:n.metrics.params}}},bannerManager:Vu(this,ec),metricsSender:Vu(this,ic)})),Yu(this,rc,new qi({bannerManager:Vu(this,ec),eventBus:Vu(this,Qu),config:{storage:n.closing.storage,key:n.closing.key,maxItems:n.closing.maxItems},frameMessenger:Vu(this,ac)})),this.setLocale(n.locale),Vu(this,Xu).origin=n.origin,n.resources)Vu(this,Xu).addDefaultResource(a,n.resources[a]),Vu(this,Zu).addDefaultResource(a,n.resources[a]);window.addEventListener("resize",(function(){var t,e=Fu(Vu(o,ec).getBannersByState({state:Vu(o,ec).STATE.RENDERED,managed:!0,external:!0,embed:!1}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}})),Vu(this,ac).listen(),Vu(this,oc).attach(new ca({events:n.metrics.events,params:n.metrics.params,extraParams:n.metrics.extraParams})),Vu(this,nc).start(),Vu(this,rc).attachUi()}var e,n,r;return e=t,n=[{key:"version",get:function(){return Vu(this,Ku)}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Vu(this,Qu).subscribe(t,e,n)}},{key:"setLocale",value:function(t){Vu(this,Xu).locale=t,Vu(this,Zu).locale=t}},{key:"setGateway",value:function(t){if(!function(t){return t instanceof S}(t))throw new TypeError("Argument gateway mut be instance of AbstractGateway.");Yu(this,tc,t)}},{key:"getGateway",value:function(){return null===Vu(this,tc)&&this.setGateway(new et),Vu(this,tc)}},{key:"createBanner",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"managed",o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:window;if(t=Jr(t,o),"embed"===i){var a=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,uc,lc).call(this,t,e,n,r),u=Vu(this,ec).addEmbedBanner(t,a,e,r);return Vu(this,ac).connectBanner(u),t.insertAdjacentElement("beforeend",a),u}return Vu(this,ec).addManagedBanner(t,e,n,r,o)}},{key:"closeBanner",value:function(t){Vu(this,rc).closeBanner(t)}},{key:"attachBanners",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,r=Fu(e.querySelectorAll("[data-amp-banner]:not([data-amp-attached])"));try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.dataset.ampBanner;if(o){var a=void 0;if("ampBannerExternal"in i.dataset)a=Vu(this,ec).addExternalBanner(i,n);else{var u=yr.parseResources(i),c=yr.parseOptions(i),l=i.dataset.ampMode||"managed";a=this.createBanner(i,o,u,c,l,n)}Vu(this,Qu).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:a})}else console.warn("Unable to attach a banner to the element ",i,' because the attribute "data-amp-banner" has an empty value.')}}catch(t){r.e(t)}finally{r.f()}}},{key:"fetch",value:function(){var t=this,e=Vu(this,ec).getBannersByState({state:Vu(this,ec).STATE.NEW,managed:!0,external:!1,embed:!1});if(e.length){var n,r=Vu(this,Xu).create(),i=Fu(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r.addPosition(o.position,o.resources,"1"!==o.options.get("omit-default-resources","0").toString())}}catch(t){i.e(t)}finally{i.f()}Vu(this,Qu).dispatch(this.EVENTS.ON_BEFORE_FETCH),this.getGateway().fetch(r,(function(n){var r,i=n.data,o=Fu(e);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.position in i&&"banners"in i[a.position]&&Object.values(i[a.position].banners).length){for(var u=i[a.position],c=Array.isArray(u.banners)?u.banners:Object.values(u.banners),l=[],s=0;st.length)&&(e=t.length);for(var n=0,r=new Array(e);ne.interaction.defaultIntersectionRatio||1a||1e.interaction.firstTimeSeenTimeout)throw new Error('The option "interaction.firstTimeSeenTimeout" must be a int with a minimum value of 500, "'.concat(e.interaction.firstTimeSeenTimeout,'" passed.'));if("object"!==pc(e.metrics))throw new Error('The option "metrics" must be an object of the format { events: object, params: object }, '.concat(JSON.stringify(e.metrics)," passed."));if("object"!==pc(e.metrics.events))throw new Error('The option "metrics.event" must be an object of the format { *: string|false|{ name?: string, params?: { *: string }, extraParams?: { *: scalar } } }, '.concat(JSON.stringify(e.metrics.events)," passed."));if("object"!==pc(e.metrics.params))throw new Error('The option "metrics.params" must be an object of the format { *: string }, '.concat(JSON.stringify(e.metrics.params)," passed."));if("object"!==pc(e.metrics.extraParams))throw new Error('The option "metrics.extraParams" must be an object of the format { *: scalar }, '.concat(JSON.stringify(e.metrics.params)," passed."));return e}function vc(t){return vc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vc(t)}function mc(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return hc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hc(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function hc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Jc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&void 0!==arguments[2]?arguments[2]:null;return nl(this,cl).subscribe(t,e,n)}},{key:"attachBanner",value:function(){if(nl(this,vl))throw new Error("Method attachBanner() should be called only once.");var t=document.querySelector("[data-amp-banner]:not([data-amp-attached])");if(t){var e=nl(this,ll).addExternalBanner(t);rl(this,vl,!0),window.self!==window.top&&e.delegateResponsiveBehaviour(),nl(this,cl).dispatch(this.EVENTS.ON_BANNER_ATTACHED,{banner:e})}else console.warn("No banner found in the embed client.")}}],n&&Qc(e.prototype,n),r&&Qc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function gl(t,e){nl(this,sl).sendToParent("metrics",{eventName:t,eventArgs:e})}function Sl(){var t,e=Kc(nl(this,ll).getBannersByState({state:ne.RENDERED}));try{for(e.s();!(t=e.n()).done;){t.value.redrawIfNeeded()}}catch(t){e.e(t)}finally{e.f()}}function El(t){return El="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},El(t)}function Tl(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return new cc(new p(kl,"standard@".concat(kl)),t)}},{key:"createEmbed",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new wl(new p(kl,"embed@".concat(kl)),t)}},{key:"version",get:function(){return kl}}],(n=null)&&Tl(e.prototype,n),r&&Tl(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();AMPClientFactory=e.default})(); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 955e505..5ef377b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@68publishers/amp-client", - "version": "1.7.0-beta.2", + "version": "1.7.0-beta.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@68publishers/amp-client", - "version": "1.7.0-beta.2", + "version": "1.7.0-beta.3", "license": "ISC", "dependencies": { "lodash": "^4.17.21", diff --git a/package.json b/package.json index 64f21c7..c5cd8c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@68publishers/amp-client", - "version": "1.7.0-beta.2", + "version": "1.7.0-beta.3", "description": "JS Client for 68publishers/amp", "homepage": "http://www.68publishers.io/", "main": "index.mjs",