(function(){var e,aa="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b};function ba(a){for(var b=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global],c=0;c<b.length;++c){var d=b[c];if(d&&d.Math==Math)return}(function(){throw Error("Cannot find global object");})()}ba(this);"function"===typeof Symbol&&Symbol("x");var ca;
if("function"==typeof Object.setPrototypeOf)ca=Object.setPrototypeOf;else{var da;a:{var ea={a:!0},fa={};try{fa.__proto__=ea;da=fa.a;break a}catch(a){}da=!1}ca=da?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ha=ca;function ia(a,b){b=void 0===b?0:b;for(var c=this.length,d=0<=b?b:Math.max(c+b,0);d<c;d++){var f=this[d];if(f===a||a!==a&&f!==f)return!0}return!1};function ja(a,b){if(void 0===b?this.contains(a):!b)return this.remove(a),!1;this.add(a);return!0};function ka(a){return a==this||this.documentElement.contains(a)};function la(a){return(a=Number(a))?0<a?1:-1:a};var ma=Object.prototype.hasOwnProperty;function na(a,b){if(null==a)throw new TypeError("Cannot convert undefined or null to object");for(var c=Object(a),d=1;d<arguments.length;d++){var f=arguments[d];if(null!=f)for(var g in f)ma.call(f,g)&&(c[g]=f[g])}return c};var oa=Object.prototype.hasOwnProperty;function pa(a){if(null==a)throw new TypeError("Cannot convert undefined or null to object");var b=[],c;for(c in a)oa.call(a,c)&&b.push(a[c]);return b};function n(a){if(!(this instanceof n))throw new TypeError("Constructor Promise requires `new`");if(!ra(a))throw new TypeError("Must pass resolver function");this._state=sa;this._value=[];this._isChainEnd=!0;ta(this,ua(this,va),ua(this,wa),{then:a})}n.prototype.then=function(a,b){a=ra(a)?a:void 0;b=ra(b)?b:void 0;if(a||b)this._isChainEnd=!1;return this._state(this._value,a,b)};n.prototype.catch=function(a){return this.then(void 0,a)};
function xa(a){return a===Object(a)&&a instanceof this?a:new this(function(b){b(a)})}function ya(a){return new this(function(b,c){c(a)})}function za(a){var b=this;return new b(function(c,d){var f=a.length,g=Array(f);if(0===f)return c(g);Aa(a,function(h,k){b.resolve(h).then(function(l){g[k]=l;0===--f&&c(g)},d)})})}function Ba(a){var b=this;return new b(function(c,d){for(var f=0;f<a.length;f++)b.resolve(a[f]).then(c,d)})}
function va(a,b,c,d){if(!b){if(b=d)b=b.promise,b._state=va,b._value=a;return this}d||(d=new Ca(this.constructor));Da(Ea(d,b,a));return d.promise}function wa(a,b,c,d){if(!c)return d&&(b=d.promise,b._state=wa,b._value=a),this;d||(d=new Ca(this.constructor));Da(Ea(d,c,a));return d.promise}function sa(a,b,c,d){if(!d){if(!b&&!c)return this;d=new Ca(this.constructor)}a.push({deferred:d,onFulfilled:b||d.resolve,onRejected:c||d.reject});return d.promise}
function Ca(a){var b=this;this.promise=new a(function(c,d){b.resolve=c;b.reject=d});return b}function Fa(a,b,c,d){var f=a._value;a._state=b;a._value=c;d&&b===sa&&d._state(c,void 0,void 0,{promise:a,resolve:void 0,reject:void 0});for(var g=0;g<f.length;g++){var h=f[g];a._state(c,h.onFulfilled,h.onRejected,h.deferred)}f.length=0;d&&(d._isChainEnd=!1);b===wa&&a._isChainEnd&&setTimeout(function(){if(a._isChainEnd)throw c;},0)}function ua(a,b){return function(c){Fa(a,b,c)}}function Ga(){}
function ra(a){return"function"===typeof a}function Aa(a,b){for(var c=0;c<a.length;c++)b(a[c],c)}function Ea(a,b,c){var d=a.promise,f=a.resolve,g=a.reject;return function(){try{var h=b(c);ta(d,f,g,h,h)}catch(k){g(k)}}}
var Da=function(){function a(){for(var f=0;f<d;f++){var g=c[f];c[f]=null;g()}d=0}if("undefined"!==typeof window&&window.postMessage){window.addEventListener("message",a);var b=function(){window.postMessage("macro-task","*")}}else b=function(){setTimeout(a,0)};var c=Array(16),d=0;return function(f){0===d&&b();c[d++]=f}}();
function ta(a,b,c,d,f){var g=c,h;try{if(d===a)throw new TypeError("Cannot fulfill promise with itself");var k=d===Object(d);if(k&&d instanceof a.constructor)Fa(a,d._state,d._value,d);else if(k&&(h=d.then)&&ra(h)){var l=function(m){l=g=Ga;ta(a,b,c,m,m)};g=function(m){l=g=Ga;c(m)};h.call(f,function(m){l(m)},function(m){g(m)})}else b(d)}catch(m){g(m)}};(function(a){/Trident|MSIE|IEMobile/i.test(a.navigator.userAgent)&&a.DOMTokenList&&a.Object.defineProperty(a.DOMTokenList.prototype,"toggle",{enumerable:!1,configurable:!0,writable:!0,value:ja})})(self);(function(a){a.Math.sign||a.Object.defineProperty(a.Math,"sign",{enumerable:!1,configurable:!0,writable:!0,value:la})})(self);(function(a){a.Object.assign||a.Object.defineProperty(a.Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:na})})(self);
(function(a){a.Object.values||a.Object.defineProperty(a.Object,"values",{enumerable:!1,configurable:!0,writable:!0,value:pa})})(self);(function(a){a.Promise||(a.Promise=n,n.default&&(a.Promise=n.default),a.Promise.resolve=xa,a.Promise.reject=ya,a.Promise.all=za,a.Promise.race=Ba)})(self);(function(a){a.HTMLDocument.prototype.contains||a.Object.defineProperty(a.HTMLDocument.prototype,"contains",{enumerable:!1,configurable:!0,writable:!0,value:ka})})(self);
(function(a){a.Array.prototype.includes||a.Object.defineProperty(Array.prototype,"includes",{enumerable:!1,configurable:!0,writable:!0,value:ia})})(self);function p(){}e=p.prototype;e.getElement=function(){};e.init=function(){};e.resized=function(){};e.whenComplete=function(){};e.shouldFadeBody=function(){};e.hasLoadingIndicator=function(){};function Ha(a,b,c,d){return a.acceptResult().then(function(f){if(f.origin!=b||c&&!f.originVerified||d&&!f.secureChannel)throw Error("channel mismatch");return f.data})};function Ia(a){if(/swg.debug=1/.test(self.location.hash)){var b=Array.prototype.slice.call(arguments,0);b.unshift("[Subscriptions]");t.apply(t,b)}}function t(a){console.log.apply(console,arguments)}function u(a){console.warn.apply(console,arguments)}
function v(a,b,c){var d;if(!a){var f=(b||"Assertion failed").split("%s"),g=f.shift(),h=g,k=[];""!=g&&k.push(g);for(g=2;g<arguments.length;g++){var l=arguments[g];l&&l.tagName&&(d=l);var m=f.shift();k.push(l);var r=m.trim();""!=r&&k.push(r);r=h;var q=(q=l)&&1==q.nodeType?q.tagName.toLowerCase()+(q.id?"#"+q.id:""):q;h=r+(q+m)}g=Error(h);g.fromAssert=!0;g.associatedElement=d;g.messageArray=k;throw g;}};function Ja(a,b){if(!a)return null;var c=a.length||0;if(0<c)for(var d=0;d<c;d++){var f=a[d];if(b(f,d,a))return f}return null};var Ka={"-":"+",_:"/"},La={"+":"-","/":"_","=":""};function Ma(a){for(var b=new Uint8Array(a.length),c=0;c<a.length;c++){var d=a.charCodeAt(c);v(255>=d,"Characters must be in range [0,255]");b[c]=d}return b}function Na(a){for(var b=Array(a.length),c=0;c<a.length;c++)b[c]=String.fromCharCode(a[c]);return b.join("")}function Oa(a){if("undefined"!==typeof TextDecoder)return(new TextDecoder("utf-8")).decode(a);var b=Na(new Uint8Array(a));return decodeURIComponent(escape(b))}
function Pa(a){return"undefined"!==typeof TextEncoder?(new TextEncoder("utf-8")).encode(a):Ma(unescape(encodeURIComponent(a)))}function Qa(a){var b=atob(a.replace(/[-_]/g,function(c){return Ka[c]}));return Ma(b)}function Ra(a){a=Na(a);return btoa(a).replace(/[+/=]/g,function(b){return La[b]})};function Sa(){var a=Date.now().toString(16),b=a.substring(a.length-8).toUpperCase()+"-",c=0;a=new Uint8Array(23);var d=self.msCrypto?self.msCrypto:self.crypto;if(d&&d.getRandomValues)for(d.getRandomValues(a),d=a.length-1;-1<d;d--)a[d]%=16;else for(d=a.length-1;-1<d;d--)a[d]=Math.floor(16*Math.random());for(d=9;36>d;d++)switch(d){case 13:case 18:case 23:b+="-";break;case 14:b+="4";break;case 19:b+="0123456789ABCDEF"[a[c++]&3|8];break;default:b+="0123456789ABCDEF"[a[c++]]}return b}
function Ta(a){return(self.crypto||self.msCrypto).subtle.digest("SHA-512",Pa(a)).then(function(b){for(var c=[],d=new DataView(b),f=0;f<d.byteLength;f+=4){var g=d.getUint32(f).toString(16);c.push(("00000000"+g).slice(-8))}return c.join("")})};var Ua,Va="Webkit webkit Moz moz ms O o".split(" "),Wa={"align-content":"normal",animation:"none","align-items":"normal","align-self":"auto","alignment-baseline":"auto","backface-visibility":"hidden","background-clip":"border-box","background-image":"none","baseline-shift":"0","block-size":"auto",border:"none","border-collapse":"separate",bottom:"0","box-sizing":"border-box","break-after":"auto","break-before":"auto","break-inside":"auto","buffered-rendering":"auto","caption-side":"top","caret-color":"rgb(51, 51, 51)",
clear:"none",color:"rgb(51, 51, 51)","color-rendering":"auto","column-count":"auto","column-fill":"balance","column-gap":"normal","column-rule-color":"rgb(51, 51, 51)","column-rule-style":"none","column-rule-width":"0","column-span":"none","column-width":"auto",contain:"none","counter-increment":"none","counter-reset":"none",cursor:"auto",direction:"inherit",display:"block","empty-cells":"show",filter:"none",flex:"none","flex-flow":"row nowrap","float":"none","flood-color":"rgb(0, 0, 0)","flood-opacity":"1",
font:"none","font-size":"medium","font-family":"",height:"auto",hyphens:"manual","image-rendering":"auto","inline-size":"",isolation:"auto","justify-content":"normal","justify-items":"normal","justify-self":"auto","letter-spacing":"normal","lighting-color":"rgb(255, 255, 255)","line-break":"auto","line-height":"normal","margin-bottom":"0",mask:"none","max-block-size":"none","max-height":"none","max-inline-size":"none","max-width":"none","min-block-size":"none","min-height":"0","min-inline-size":"0",
"min-width":"0","mix-blend-mode":"normal","object-fit":"fill","offset-distance":"none","offset-path":"none","offset-rotate":"auto 0deg",opacity:"1",order:"0",orphans:"2",outline:"none","overflow-anchor":"auto","overflow-wrap":"normal",overflow:"visible",padding:"0",page:"",perspective:"none","pointer-events":"auto",position:"static",quotes:"",resize:"none",right:"0","scroll-behavior":"auto","tab-size":"8","table-layout":"auto","text-align":"start","text-align-last":"auto","text-anchor":"start","text-combine-upright":"none",
"text-decoration":"none","text-indent":"0","text-orientation":"mixed","text-overflow":"clip","text-rendering":"auto","text-shadow":"none","text-size-adjust":"auto","text-transform":"none","text-underline-position":"auto",top:"auto","touch-action":"auto",transform:"none",transition:"none 0s ease 0s","unicode-bidi":"normal","user-select":"auto","vector-effect":"none","vertical-align":"baseline",visibility:"visible","white-space":"normal",widows:"2","word-break":"normal","word-spacing":"0","word-wrap":"normal",
"writing-mode":"horizontal-tb",zoom:"1","z-index":"auto"};function Xa(a,b,c){if(2>b.length?0:0==b.lastIndexOf("--",0))return b;Ua||(Ua=Object.create(null));var d=Ua[b];if(!d||c){d=b;if(void 0===a[b]){var f=b.charAt(0).toUpperCase()+b.slice(1);a:{for(var g=0;g<Va.length;g++){var h=Va[g]+f;if(void 0!==a[h]){f=h;break a}}f=""}var k=f;void 0!==a[k]&&(d=k)}c||(Ua[b]=d)}return d}function w(a,b){for(var c in b)a.style.setProperty(Xa(b,c),b[c].toString(),"important")}
function Ya(a,b,c){(b=Xa(a.style,b,void 0))&&(a.style[b]=c)}function Za(a,b){for(var c in b)Ya(a,c,b[c])}function $a(a){var b={};["height"].forEach(function(c){b[c]=null});Za(a,b)};function x(a,b,c){b=a.createElement(b);for(var d in c)"style"==d?Za(b,c[d]):b.setAttribute(d,c[d]);return b}function ab(a,b){var c=x(a.getWin().document,"style",{type:"text/css"});c.textContent=b;a.getHead().appendChild(c)}function bb(a){var b=a.navigator;return/Edge/i.test(b&&b.userAgent)};/*

 Copyright 2017 The Web Activities Authors. All Rights Reserved.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS-IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
function y(a){return a&&"object"==typeof a?"AbortError"===a.name:!1}function cb(a,b){b="AbortError"+(b?": "+b:"");var c=null;if("function"==typeof a.DOMException){var d=a.DOMException;try{c=new d(b,"AbortError")}catch(f){}}c||(c=Error(b),c.name="AbortError",c.code=20);return c}function db(a,b,c,d,f,g){this.code=a;this.data="ok"==a?b:null;this.mode=c;this.origin=d;this.originVerified=f;this.secureChannel=g;this.ok="ok"==a;this.error="failed"==a?Error(String(b)||""):null}var eb;
function fb(a){eb||(eb=document.createElement("a"));eb.href=a;return eb}function gb(a){if(a.origin)return a.origin;var b=a.protocol,c=a.host;"https:"==b&&c.indexOf(":443")==c.length-4?c=c.replace(":443",""):"http:"==b&&c.indexOf(":80")==c.length-3&&(c=c.replace(":80",""));return b+"//"+c}function hb(a){var b=a.indexOf("#");return-1==b?a:a.substring(0,b)}
function ib(a){return a?(/^[?#]/.test(a)?a.slice(1):a).split("&").reduce(function(b,c){var d=c.split("=");c=decodeURIComponent(d[0]||"");d=decodeURIComponent(d[1]||"");c&&(b[c]=d);return b},{}):{}}function jb(a){var b={requestId:a.requestId,returnUrl:a.returnUrl,args:a.args};void 0!==a.origin&&(b.origin=a.origin);void 0!==a.originVerified&&(b.originVerified=a.originVerified);return JSON.stringify(b)}function kb(a,b,c){b.ok?c(b):(a=b.error||cb(a),a.activityResult=b,c(Promise.reject(a)))}
function lb(a){a=a.navigator;return/Trident|MSIE|IEMobile/i.test(a&&a.userAgent)}function mb(a){a=a.navigator;return/Edge/i.test(a&&a.userAgent)}function nb(a){setTimeout(function(){throw a;})}function ob(a,b,c){this.g=a;this.Hc=b;this.N=c;this.Rd=!0;this.Ic=null;this.Pc=!1;this.aa=this.dc=this.da=this.v=null;this.Sc=this.zd.bind(this)}e=ob.prototype;e.connect=function(a){if(this.da)throw Error("already connected");this.da=a;this.g.addEventListener("message",this.Sc)};
e.disconnect=function(){if(this.da&&(this.da=null,this.v&&(pb(this.v),this.v=null),this.g.removeEventListener("message",this.Sc),this.aa)){for(var a in this.aa){var b=this.aa[a];b.port1&&pb(b.port1);b.port2&&pb(b.port2)}this.aa=null}};e.isConnected=function(){return null!=this.N};e.getTarget=function(){var a=qb(this);if(!a)throw Error("not connected");return a};function qb(a){a.da&&!a.Ic&&(a.Ic="function"==typeof a.Hc?a.Hc():a.Hc);return a.Ic}
e.getTargetOrigin=function(){if(null==this.N)throw Error("not connected");return this.N};e.sendConnectCommand=function(){var a=lb(this.g)||mb(this.g);this.sendCommand("connect",{acceptsChannel:a})};e.sendStartCommand=function(a){var b=null;this.Pc&&"function"==typeof this.g.MessageChannel&&(b=new this.g.MessageChannel);b?(this.sendCommand("start",a,[b.port2]),rb(this,b.port1)):this.sendCommand("start",a)};
e.sendCommand=function(a,b,c){var d={sentinel:"__ACTIVITIES__",cmd:a,payload:b||null};if(this.v)this.v.postMessage(d,c||void 0);else{var f=this.getTarget(),g="connect"==a?null!=this.N?this.N:"*":this.getTargetOrigin();f.postMessage(d,g,c||void 0)}};e.customMessage=function(a){this.sendCommand("msg",a)};e.onCustomMessage=function(a){this.dc=a};
e.startChannel=function(a){a=a||"";var b=sb(this,a);if(!b.port1){var c=new this.g.MessageChannel;b.port1=c.port1;b.port2=c.port2;b.resolver(b.port1)}b.port2&&(this.sendCommand("cnset",{name:a},[b.port2]),b.port2=null);return b.promise};e.askChannel=function(a){a=a||"";var b=sb(this,a);b.port1||this.sendCommand("cnget",{name:a});return b.promise};
function sb(a,b){a.aa||(a.aa={});var c=a.aa[b];if(!c){var d;c=new Promise(function(f){d=f});c={port1:null,port2:null,resolver:d,promise:c};a.aa[b]=c}return c}function rb(a,b){a.v&&pb(a.v);a.v=b;a.v.onmessage=function(c){var d=c.data,f=d&&d.cmd;d=d&&d.payload||null;f&&a.ya(f,d,c)}}
e.zd=function(a){if(!this.Rd||qb(this)==a.source){var b=a.data;if(b&&"__ACTIVITIES__"==b.sentinel){var c=b.cmd;if(!this.v||"connect"==c||"start"==c){var d=a.origin;b=b.payload||null;null==this.N&&"start"==c&&(this.N=d);null==this.N&&a.source&&qb(this)==a.source&&(this.N=d);d==this.N&&this.ya(c,b,a)}}}};
e.ya=function(a,b,c){"connect"==a?(this.v&&(pb(this.v),this.v=null),this.Pc=b&&b.acceptsChannel||!1,this.da(a,b)):"start"==a?((c=c.ports&&c.ports[0])&&rb(this,c),this.da(a,b)):"msg"==a?null!=this.dc&&null!=b&&this.dc(b):"cnget"==a?this.startChannel(b.name):"cnset"==a?(a=c.ports[0],b=sb(this,b.name),b.port1=a,b.resolver(a)):this.da(a,b)};function pb(a){try{a.close()}catch(b){}}
function tb(a,b,c){var d=this;this.s=a;this.ha=b;this.T=c||null;this.g=this.s.ownerDocument.defaultView;this.N=gb(fb(b));this.Fb=!1;this.Ha=null;this.Eb=new Promise(function(f){d.Ha=f});this.ob=null;this.nb=new Promise(function(f){d.ob=f});this.R=null;this.rb=new Promise(function(f){d.R=f});this.qb=this.ec=null;this.A=new ob(this.g,function(){return d.s.contentWindow},this.N)}e=tb.prototype;e.getMode=function(){return"iframe"};
e.connect=function(){var a=this.s;if("isConnected"in a)a=a.isConnected;else{var b=a.ownerDocument&&a.ownerDocument.documentElement;a=b&&b.contains(a)||!1}if(!a)throw Error("iframe must be in DOM");this.A.connect(this.ya.bind(this));this.s.src=this.ha;return this.Eb};e.disconnect=function(){this.Fb=!1;this.A.disconnect()};e.acceptResult=function(){return this.rb};e.getTargetWin=function(){return this.s.contentWindow||null};e.message=function(a){this.A.customMessage(a)};e.onMessage=function(a){this.A.onCustomMessage(a)};
e.messageChannel=function(a){return this.A.askChannel(a)};e.whenReady=function(){return this.nb};e.onResizeRequest=function(a){var b=this;this.ec=a;Promise.resolve().then(function(){null!=b.qb&&a(b.qb)})};e.resized=function(){this.Fb&&this.A.sendCommand("resized",{height:this.s.offsetHeight})};
e.ya=function(a,b){"connect"==a?(this.Fb=!0,this.A.sendStartCommand(this.T),this.Ha()):"result"==a?this.R&&(a=b.code,b=new db(a,"failed"==a?Error(b.data||""):b.data,"iframe",this.A.getTargetOrigin(),!0,!0),kb(this.g,b,this.R),this.R=null,this.A.sendCommand("close"),this.disconnect()):"ready"==a?this.ob&&(this.ob(),this.ob=null):"resize"==a&&(this.qb=b.height,this.ec&&this.ec(this.qb))};
function ub(a,b,c,d,f,g){var h=this;if(!d||"_blank"!=d&&"_top"!=d&&"_"==d[0])throw Error('The only allowed targets are "_blank", "_top" and name targets');this.g=a;this.Qd=b;this.ha=c;this.dd=d;this.T=f||null;this.B=g||{};this.Ha=null;this.Eb=new Promise(function(k){h.Ha=k});this.R=null;this.rb=new Promise(function(k){h.R=k});this.A=this.oa=this.fa=null}e=ub.prototype;e.getMode=function(){return"_top"==this.dd?"redirect":"popup"};e.open=function(){return vb(this)};e.whenConnected=function(){return this.Eb};
e.disconnect=function(){this.oa&&(this.g.clearInterval(this.oa),this.oa=null);this.A&&(this.A.disconnect(),this.A=null);if(this.fa){try{this.fa.close()}catch(a){}this.fa=null}this.R=null};e.getTargetWin=function(){return this.fa};e.acceptResult=function(){return this.rb};e.message=function(a){this.A.customMessage(a)};e.onMessage=function(a){this.A.onCustomMessage(a)};e.messageChannel=function(a){return this.A.askChannel(a)};
function vb(a){var b=wb(a),c=a.ha;if(!a.B.skipRequestInUrl){var d=a.B.returnUrl||hb(a.g.location.href),f=jb({requestId:a.Qd,returnUrl:d,args:a.T});c=c+(-1==c.indexOf("#")?"#":"&")+encodeURIComponent("__WA__")+"="+encodeURIComponent(f)}var g=a.dd;"_top"!=g&&lb(a.g)&&(g="_top");try{var h=a.g.open(c,g,b)}catch(k){}if(!h&&"_top"!=g&&!a.B.disableRedirectFallback){g="_top";try{h=a.g.open(c,g)}catch(k){}}h?(a.fa=h,"_top"!=g&&xb(a)):yb(a,Error("failed to open window"));return a.rb.catch(function(){})}
function wb(a){var b=a.g.screen,c=b.availWidth||b.width,d=b.availHeight||b.height,f=a.g==a.g.top,g=mb(a.g),h=Math.max(c-(f&&a.g.outerWidth>a.g.innerWidth?Math.min(100,a.g.outerWidth-a.g.innerWidth):g?100:0),.5*c),k=Math.max(d-(f&&a.g.outerHeight>a.g.innerHeight?Math.min(100,a.g.outerHeight-a.g.innerHeight):g?100:0),.5*d),l=Math.floor(Math.min(600,.9*h)),m=Math.floor(Math.min(600,.9*k));a.B.width&&(l=Math.min(a.B.width,h));a.B.height&&(m=Math.min(a.B.height,k));a=Math.floor((b.width-l)/2);b=Math.floor((b.height-
m)/2);l={height:m,width:l,resizable:"yes",scrollbars:"yes"};g||(l.left=a,l.top=b);m="";for(var r in l)m&&(m+=","),m+=r+"="+l[r];return m}function xb(a){a.oa=a.g.setInterval(function(){zb(a,!0)},500);a.A=new ob(a.g,a.fa,null);a.A.connect(a.ya.bind(a))}function zb(a,b){if(!a.fa||a.fa.closed)a.oa&&(a.g.clearInterval(a.oa),a.oa=null),a.g.setTimeout(function(){try{Ab(a,"canceled",null)}catch(c){yb(a,c)}},b?3E3:0)}function yb(a,b){a.R&&a.R(Promise.reject(b));a.disconnect()}
function Ab(a,b,c){if(a.R){var d=a.A.isConnected();b=new db(b,c,"popup",d?a.A.getTargetOrigin():gb(fb(a.ha)),d,d);kb(a.g,b,a.R);a.R=null}a.A&&a.A.sendCommand("close");a.disconnect()}e.ya=function(a,b){var c=this;"connect"==a?(this.A.sendStartCommand(this.T),this.Ha()):"result"==a?(a=b.code,Ab(this,a,"failed"==a?Error(b.data||""):b.data)):"check"==a&&this.g.setTimeout(function(){return zb(c)},200)};function Bb(a,b,c,d,f){this.g=a;this.qd=b;this.vd=c;this.N=d;this.Vd=f}Bb.prototype.getMode=function(){return"redirect"};
Bb.prototype.acceptResult=function(){var a=this,b=new db(this.qd,this.vd,"redirect",this.N,this.Vd,!1);return new Promise(function(c){kb(a.g,b,c)})};function Cb(a){var b=this;this.version="1.24";this.g=a;this.Wc=a.location.hash;this.rc={};this.M={};this.jd=null;this.Pd=new Promise(function(c){b.jd=c})}e=Cb.prototype;e.openIframe=function(a,b,c){var d=new tb(a,b,c);return d.connect().then(function(){return d})};e.open=function(a,b,c,d,f){return{targetWin:Db(this,a,b,c,d,f).getTargetWin()}};
e.openWithMessaging=function(a,b,c,d,f){var g=Db(this,a,b,c,d,f);return g.whenConnected().then(function(){return g})};
e.onResult=function(a,b){var c=this.rc[a];c||(c=[],this.rc[a]=c);c.push(b);var d=this.M[a];if(!d&&this.Wc){try{var f=this.g,g=ib(this.Wc).__WA_RES__;if(g){var h=JSON.parse(g);if(h&&h.requestId==a){var k=f.location.hash;if(k){var l=encodeURIComponent("__WA_RES__")+"=";g=-1;do if(g=k.indexOf(l,g),-1!=g){var m=0<g?k.substring(g-1,g):"";if(""==m||"?"==m||"#"==m||"&"==m){var r=k.indexOf("&",g+1);-1==r&&(r=k.length);k=k.substring(0,g)+k.substring(r+1)}else g++}while(-1!=g&&g<k.length)}var q=k;q=q||"";if(q!=
f.location.hash&&f.history&&f.history.replaceState)try{f.history.replaceState(f.history.state,"",q)}catch(qa){}var E=h.code,B=h.data,D=h.origin,W=f.document.referrer&&gb(fb(f.document.referrer));d=new Bb(f,E,B,D,D==W)}else d=null}else d=null}catch(qa){nb(qa),this.jd(qa)}d&&(this.M[a]=d)}(a=d)&&Eb(a,b)};e.onRedirectError=function(a){this.Pd.then(a)};function Db(a,b,c,d,f,g){var h=new ub(a.g,b,c,d,f,g);h.open().then(function(){Fb(a,b,h)});return h}
function Eb(a,b){Promise.resolve().then(function(){b(a)})}function Fb(a,b,c){var d=a.rc[b];d&&d.forEach(function(f){Eb(c,f)});a.M[b]=c};function Gb(a){setTimeout(function(){throw a;})};var Hb={frameborder:"0",scrolling:"no"};function z(a,b,c,d,f,g){f=void 0===f?!1:f;g=void 0===g?!1:g;var h=this;this.g=a;this.j=this.g.document;this.s=x(this.j,"iframe",Hb);this.m=b;this.Ua=c;this.T=d||{};this.Td=f;this.Cd=g;this.ed=this.v=null;this.kb=new Promise(function(k){h.ed=k})}z.prototype=aa(p.prototype);z.prototype.constructor=z;
if(ha)ha(z,p);else for(var Ib in p)if("prototype"!=Ib)if(Object.defineProperties){var Jb=Object.getOwnPropertyDescriptor(p,Ib);Jb&&Object.defineProperty(z,Ib,Jb)}else z[Ib]=p[Ib];z.ee=p.prototype;e=z.prototype;e.getElement=function(){return this.s};e.init=function(a){var b=this;return this.m.openIframe(this.s,this.Ua,this.T).then(function(c){return Kb(b,c,a)})};e.shouldFadeBody=function(){return this.Td};e.hasLoadingIndicator=function(){return this.Cd};
function Kb(a,b,c){a.v=b;a.ed(b);a.v.onResizeRequest(function(d){c.resizeView(a,d)});return a.v.whenReady()}e.on=function(a,b){this.kb.then(function(c){c.on(a,b)})};e.execute=function(a){this.kb.then(function(b){b.execute(a)})};e.acceptResult=function(){return this.kb.then(function(a){return a.acceptResult()})};e.acceptResultAndVerify=function(a,b,c){return this.kb.then(function(d){return Ha(d,a,b,c)})};e.whenComplete=function(){return this.acceptResult()};
e.onCancel=function(a){this.acceptResult().catch(function(b){y(b)&&a();throw b;})};e.resized=function(){this.v&&this.v.resized()};var Lb={UNKNOWN:0,IMPRESSION_PAYWALL:1,IMPRESSION_AD:2,IMPRESSION_OFFERS:3,IMPRESSION_SUBSCRIBE_BUTTON:4,IMPRESSION_SMARTBOX:5,IMPRESSION_SWG_BUTTON:6,IMPRESSION_CLICK_TO_SHOW_OFFERS:7,IMPRESSION_CLICK_TO_SHOW_OFFERS_OR_ALREADY_SUBSCRIBED:8,IMPRESSION_SUBSCRIPTION_COMPLETE:9,IMPRESSION_ACCOUNT_CHANGED:10,IMPRESSION_PAGE_LOAD:11,IMPRESSION_LINK:12,IMPRESSION_SAVE_SUBSCR_TO_GOOGLE:13,IMPRESSION_GOOGLE_UPDATED:14,IMPRESSION_SHOW_OFFERS_SMARTBOX:15,IMPRESSION_SHOW_OFFERS_SWG_BUTTON:16,IMPRESSION_SELECT_OFFER_SMARTBOX:17,
IMPRESSION_SELECT_OFFER_SWG_BUTTON:18,IMPRESSION_SHOW_CONTRIBUTIONS_SWG_BUTTON:19,IMPRESSION_SELECT_CONTRIBUTION_SWG_BUTTON:20,IMPRESSION_METER_TOAST:21,IMPRESSION_REGWALL:22,IMPRESSION_SHOWCASE_REGWALL:23,IMPRESSION_SWG_SUBSCRIPTION_MINI_PROMPT:24,IMPRESSION_SWG_CONTRIBUTION_MINI_PROMPT:25,IMPRESSION_CONTRIBUTION_OFFERS:26,ACTION_SUBSCRIBE:1E3,ACTION_PAYMENT_COMPLETE:1001,ACTION_ACCOUNT_CREATED:1002,ACTION_ACCOUNT_ACKNOWLEDGED:1003,ACTION_SUBSCRIPTIONS_LANDING_PAGE:1004,ACTION_PAYMENT_FLOW_STARTED:1005,
ACTION_OFFER_SELECTED:1006,ACTION_SWG_BUTTON_CLICK:1007,ACTION_VIEW_OFFERS:1008,ACTION_ALREADY_SUBSCRIBED:1009,ACTION_NEW_DEFERRED_ACCOUNT:1010,ACTION_LINK_CONTINUE:1011,ACTION_LINK_CANCEL:1012,ACTION_GOOGLE_UPDATED_CLOSE:1013,ACTION_USER_CANCELED_PAYFLOW:1014,ACTION_SAVE_SUBSCR_TO_GOOGLE_CONTINUE:1015,ACTION_SAVE_SUBSCR_TO_GOOGLE_CANCEL:1016,ACTION_SWG_BUTTON_SHOW_OFFERS_CLICK:1017,ACTION_SWG_BUTTON_SELECT_OFFER_CLICK:1018,ACTION_SWG_BUTTON_SHOW_CONTRIBUTIONS_CLICK:1019,ACTION_SWG_BUTTON_SELECT_CONTRIBUTION_CLICK:1020,
ACTION_USER_CONSENT_DEFERRED_ACCOUNT:1021,ACTION_USER_DENY_DEFERRED_ACCOUNT:1022,ACTION_DEFERRED_ACCOUNT_REDIRECT:1023,ACTION_GET_ENTITLEMENTS:1024,ACTION_METER_TOAST_SUBSCRIBE_CLICK:1025,ACTION_METER_TOAST_EXPANDED:1026,ACTION_METER_TOAST_CLOSED_BY_ARTICLE_INTERACTION:1027,ACTION_METER_TOAST_CLOSED_BY_SWIPE_DOWN:1028,ACTION_METER_TOAST_CLOSED_BY_X_CLICKED:1029,ACTION_SWG_SUBSCRIPTION_MINI_PROMPT_CLICK:1030,ACTION_SWG_CONTRIBUTION_MINI_PROMPT_CLICK:1031,ACTION_SWG_SUBSCRIPTION_MINI_PROMPT_CLOSE:1032,
ACTION_SWG_CONTRIBUTION_MINI_PROMPT_CLOSE:1033,ACTION_CONTRIBUTION_OFFER_SELECTED:1034,EVENT_PAYMENT_FAILED:2E3,EVENT_CUSTOM:3E3,EVENT_CONFIRM_TX_ID:3001,EVENT_CHANGED_TX_ID:3002,EVENT_GPAY_NO_TX_ID:3003,EVENT_GPAY_CANNOT_CONFIRM_TX_ID:3004,EVENT_GOOGLE_UPDATED:3005,EVENT_NEW_TX_ID:3006,EVENT_UNLOCKED_BY_SUBSCRIPTION:3007,EVENT_UNLOCKED_BY_METER:3008,EVENT_NO_ENTITLEMENTS:3009,EVENT_HAS_METERING_ENTITLEMENTS:3010,EVENT_OFFERED_METER:3011,EVENT_UNLOCKED_FREE_PAGE:3012,EVENT_SUBSCRIPTION_STATE:4E3},
Mb={UNKNOWN_CLIENT:0,SWG_CLIENT:1,AMP_CLIENT:2,PROPENSITY_CLIENT:3,SWG_SERVER:4,PUBLISHER_CLIENT:5,SHOWCASE_CLIENT:6};function A(a,b){a=void 0===a?[]:a;var c=(b=void 0===b?!0:b)?1:0;this.O=null==a[c]?null:a[c]}A.prototype.getComplete=function(){return this.O};A.prototype.setComplete=function(a){this.O=a};A.prototype.toArray=function(a){a=void 0===a?!0:a;var b=[this.O];a&&b.unshift(this.label());return b};A.prototype.label=function(){return"AccountCreationRequest"};
function Nb(a,b){a=void 0===a?[]:a;b=void 0===b||b?1:0;this.Ec=null==a[b]?null:a[b];this.Wb=null==a[1+b]?null:a[1+b]}e=Nb.prototype;e.getSubscriberOrMember=function(){return this.Ec};e.setSubscriberOrMember=function(a){this.Ec=a};e.getLinkRequested=function(){return this.Wb};e.setLinkRequested=function(a){this.Wb=a};e.toArray=function(a){var b=[this.Ec,this.Wb];(void 0===a||a)&&b.unshift(this.label());return b};e.label=function(){return"AlreadySubscribedResponse"};
function Ob(a,b){a=void 0===a?[]:a;b=void 0===b||b?1:0;this.Hb=null==a[b]?null:a[b];this.Jc=null==a[1+b]?null:a[1+b];this.qc=null==a[2+b]?null:a[2+b];this.Oc=null==a[3+b]?null:a[3+b];this.Mc=null==a[4+b]?null:a[4+b];this.Nc=null==a[5+b]?null:a[5+b];this.H=null==a[6+b]?null:a[6+b];this.oc=null==a[7+b]?null:a[7+b];this.La=a[8+b]||[];this.Bb=null==a[9+b]?null:a[9+b];this.ha=null==a[10+b]?null:a[10+b]}e=Ob.prototype;e.getEmbedderOrigin=function(){return this.Hb};
e.setEmbedderOrigin=function(a){this.Hb=a};e.getTransactionId=function(){return this.Jc};e.setTransactionId=function(a){this.Jc=a};e.getReferringOrigin=function(){return this.qc};e.setReferringOrigin=function(a){this.qc=a};e.getUtmSource=function(){return this.Oc};e.setUtmSource=function(a){this.Oc=a};e.getUtmCampaign=function(){return this.Mc};e.setUtmCampaign=function(a){this.Mc=a};e.getUtmMedium=function(){return this.Nc};e.setUtmMedium=function(a){this.Nc=a};e.getSku=function(){return this.H};
e.setSku=function(a){this.H=a};e.getReadyToPay=function(){return this.oc};e.setReadyToPay=function(a){this.oc=a};e.getLabelList=function(){return this.La};e.setLabelList=function(a){this.La=a};e.getClientVersion=function(){return this.Bb};e.setClientVersion=function(a){this.Bb=a};e.getUrl=function(){return this.ha};e.setUrl=function(a){this.ha=a};
e.toArray=function(a){var b=[this.Hb,this.Jc,this.qc,this.Oc,this.Mc,this.Nc,this.H,this.oc,this.La,this.Bb,this.ha];(void 0===a||a)&&b.unshift(this.label());return b};e.label=function(){return"AnalyticsContext"};function Pb(a,b){a=void 0===a?[]:a;b=void 0===b||b?1:0;this.Lb=null==a[b]?null:a[b];this.Sb=null==a[1+b]?null:a[1+b]}e=Pb.prototype;e.getEventOriginator=function(){return this.Lb};e.setEventOriginator=function(a){this.Lb=a};e.getIsFromUserAction=function(){return this.Sb};
e.setIsFromUserAction=function(a){this.Sb=a};e.toArray=function(a){var b=[this.Lb,this.Sb];(void 0===a||a)&&b.unshift(this.label());return b};e.label=function(){return"AnalyticsEventMeta"};function Qb(a,b){a=void 0===a?[]:a;var c=(b=void 0===b?!0:b)?1:0;this.G=null==a[c]||void 0==a[c]?null:new Ob(a[c],b);this.Mb=null==a[1+c]?null:a[1+c];this.fb=null==a[2+c]||void 0==a[2+c]?null:new Pb(a[2+c],b);this.hb=null==a[3+c]||void 0==a[3+c]?null:new C(a[3+c],b)}e=Qb.prototype;e.getContext=function(){return this.G};
e.setContext=function(a){this.G=a};e.getEvent=function(){return this.Mb};e.setEvent=function(a){this.Mb=a};e.getMeta=function(){return this.fb};e.setMeta=function(a){this.fb=a};e.getParams=function(){return this.hb};e.setParams=function(a){this.hb=a};e.toArray=function(a){a=void 0===a?!0:a;var b=[this.G?this.G.toArray(a):[],this.Mb,this.fb?this.fb.toArray(a):[],this.hb?this.hb.toArray(a):[]];a&&b.unshift(this.label());return b};e.label=function(){return"AnalyticsRequest"};
function Rb(a,b){a=void 0===a?[]:a;b=void 0===b||b?1:0;this.ra=null==a[b]?null:a[b];this.Bc=null==a[1+b]?null:a[1+b]}e=Rb.prototype;e.getJwt=function(){return this.ra};e.setJwt=function(a){this.ra=a};e.getSource=function(){return this.Bc};e.setSource=function(a){this.Bc=a};e.toArray=function(a){var b=[this.ra,this.Bc];(void 0===a||a)&&b.unshift(this.label());return b};e.label=function(){return"EntitlementJwt"};
function Sb(a,b){a=void 0===a?[]:a;var c=(b=void 0===b?!0:b)?1:0;this.vb=null==a[c]||void 0==a[c]?null:new Rb(a[c],b);this.Za=null==a[1+c]||void 0==a[1+c]?null:new Tb(a[1+c],b);this.Jb=null==a[2+c]?null:a[2+c];this.Ib=null==a[3+c]?null:a[3+c];this.ua=null==a[4+c]?null:a[4+c];this.qa=null==a[5+c]?null:a[5+c]}e=Sb.prototype;e.getUsedEntitlement=function(){return this.vb};e.setUsedEntitlement=function(a){this.vb=a};e.getClientEventTime=function(){return this.Za};
e.setClientEventTime=function(a){this.Za=a};e.getEntitlementSource=function(){return this.Jb};e.setEntitlementSource=function(a){this.Jb=a};e.getEntitlementResult=function(){return this.Ib};e.setEntitlementResult=function(a){this.Ib=a};e.getToken=function(){return this.ua};e.setToken=function(a){this.ua=a};e.getIsUserRegistered=function(){return this.qa};e.setIsUserRegistered=function(a){this.qa=a};
e.toArray=function(a){a=void 0===a?!0:a;var b=[this.vb?this.vb.toArray(a):[],this.Za?this.Za.toArray(a):[],this.Jb,this.Ib,this.ua,this.qa];a&&b.unshift(this.label());return b};e.label=function(){return"EntitlementsRequest"};function Ub(a,b){a=void 0===a?[]:a;b=void 0===b||b?1:0;this.ra=null==a[b]?null:a[b];this.Gc=null==a[1+b]?null:a[1+b]}e=Ub.prototype;e.getJwt=function(){return this.ra};e.setJwt=function(a){this.ra=a};e.getSwgUserToken=function(){return this.Gc};
e.setSwgUserToken=function(a){this.Gc=a};e.toArray=function(a){var b=[this.ra,this.Gc];(void 0===a||a)&&b.unshift(this.label());return b};e.label=function(){return"EntitlementsResponse"};function C(a,b){a=void 0===a?[]:a;b=void 0===b||b?1:0;this.Ac=null==a[b]?null:a[b];this.Pb=null==a[1+b]?null:a[1+b];this.Qb=null==a[2+b]?null:a[2+b];this.H=null==a[3+b]?null:a[3+b];this.cc=null==a[4+b]?null:a[4+b];this.qa=null==a[5+b]?null:a[5+b];this.Fc=null==a[6+b]?null:a[6+b]}e=C.prototype;
e.getSmartboxMessage=function(){return this.Ac};e.setSmartboxMessage=function(a){this.Ac=a};e.getGpayTransactionId=function(){return this.Pb};e.setGpayTransactionId=function(a){this.Pb=a};e.getHadLogged=function(){return this.Qb};e.setHadLogged=function(a){this.Qb=a};e.getSku=function(){return this.H};e.setSku=function(a){this.H=a};e.getOldTransactionId=function(){return this.cc};e.setOldTransactionId=function(a){this.cc=a};e.getIsUserRegistered=function(){return this.qa};
e.setIsUserRegistered=function(a){this.qa=a};e.getSubscriptionFlow=function(){return this.Fc};e.setSubscriptionFlow=function(a){this.Fc=a};e.toArray=function(a){var b=[this.Ac,this.Pb,this.Qb,this.H,this.cc,this.qa,this.Fc];(void 0===a||a)&&b.unshift(this.label());return b};e.label=function(){return"EventParams"};function Vb(a,b){a=void 0===a?[]:a;b=void 0===b||b?1:0;this.O=null==a[b]?null:a[b];this.Kb=null==a[1+b]?null:a[1+b]}e=Vb.prototype;e.getComplete=function(){return this.O};
e.setComplete=function(a){this.O=a};e.getError=function(){return this.Kb};e.setError=function(a){this.Kb=a};e.toArray=function(a){var b=[this.O,this.Kb];(void 0===a||a)&&b.unshift(this.label());return b};e.label=function(){return"FinishedLoggingResponse"};function Wb(a,b){a=void 0===a?[]:a;b=void 0===b||b?1:0;this.xb=null==a[b]?null:a[b];this.ua=null==a[1+b]?null:a[1+b]}e=Wb.prototype;e.getAuthCode=function(){return this.xb};e.setAuthCode=function(a){this.xb=a};e.getToken=function(){return this.ua};
e.setToken=function(a){this.ua=a};e.toArray=function(a){var b=[this.xb,this.ua];(void 0===a||a)&&b.unshift(this.label());return b};e.label=function(){return"LinkSaveTokenRequest"};function F(a,b){a=void 0===a?[]:a;b=void 0===b||b?1:0;this.tc=null==a[b]?null:a[b]}F.prototype.getRequested=function(){return this.tc};F.prototype.setRequested=function(a){this.tc=a};F.prototype.toArray=function(a){var b=[this.tc];(void 0===a||a)&&b.unshift(this.label());return b};F.prototype.label=function(){return"LinkingInfoResponse"};
function Xb(a,b){a=void 0===a?[]:a;b=void 0===b||b?1:0;this.H=null==a[b]?null:a[b];this.bc=null==a[1+b]?null:a[1+b];this.hc=null==a[2+b]?null:a[2+b];this.kc=null==a[3+b]?null:a[3+b];this.ac=null==a[4+b]?null:a[4+b]}e=Xb.prototype;e.getSku=function(){return this.H};e.setSku=function(a){this.H=a};e.getOldSku=function(){return this.bc};e.setOldSku=function(a){this.bc=a};e.getOneTime=function(){return this.hc};e.setOneTime=function(a){this.hc=a};e.getPlayOffer=function(){return this.kc};
e.setPlayOffer=function(a){this.kc=a};e.getOldPlayOffer=function(){return this.ac};e.setOldPlayOffer=function(a){this.ac=a};e.toArray=function(a){var b=[this.H,this.bc,this.hc,this.kc,this.ac];(void 0===a||a)&&b.unshift(this.label());return b};e.label=function(){return"SkuSelectedResponse"};function G(a,b){a=void 0===a?[]:a;b=void 0===b||b?1:0;this.Rb=null==a[b]?null:a[b]}G.prototype.getIsClicked=function(){return this.Rb};G.prototype.setIsClicked=function(a){this.Rb=a};
G.prototype.toArray=function(a){var b=[this.Rb];(void 0===a||a)&&b.unshift(this.label());return b};G.prototype.label=function(){return"SmartBoxMessage"};function H(a,b){a=void 0===a?[]:a;b=void 0===b||b?1:0;this.Dc=null==a[b]?null:a[b]}H.prototype.getSubscribe=function(){return this.Dc};H.prototype.setSubscribe=function(a){this.Dc=a};H.prototype.toArray=function(a){var b=[this.Dc];(void 0===a||a)&&b.unshift(this.label());return b};H.prototype.label=function(){return"SubscribeResponse"};
function Tb(a,b){a=void 0===a?[]:a;b=void 0===b||b?1:0;this.xc=null==a[b]?null:a[b];this.Zb=null==a[1+b]?null:a[1+b]}e=Tb.prototype;e.getSeconds=function(){return this.xc};e.setSeconds=function(a){this.xc=a};e.getNanos=function(){return this.Zb};e.setNanos=function(a){this.Zb=a};e.toArray=function(a){var b=[this.xc,this.Zb];(void 0===a||a)&&b.unshift(this.label());return b};e.label=function(){return"Timestamp"};function Yb(a,b){a=void 0===a?[]:a;b=void 0===b||b?1:0;this.wa=null==a[b]?null:a[b]}
Yb.prototype.getClose=function(){return this.wa};Yb.prototype.setClose=function(a){this.wa=a};Yb.prototype.toArray=function(a){var b=[this.wa];(void 0===a||a)&&b.unshift(this.label());return b};Yb.prototype.label=function(){return"ToastCloseRequest"};function I(a,b){a=void 0===a?[]:a;b=void 0===b||b?1:0;this.$b=null==a[b]?null:a[b]}I.prototype.getNative=function(){return this.$b};I.prototype.setNative=function(a){this.$b=a};
I.prototype.toArray=function(a){var b=[this.$b];(void 0===a||a)&&b.unshift(this.label());return b};I.prototype.label=function(){return"ViewSubscriptionsResponse"};
var Zb={AccountCreationRequest:A,AlreadySubscribedResponse:Nb,AnalyticsContext:Ob,AnalyticsEventMeta:Pb,AnalyticsRequest:Qb,EntitlementJwt:Rb,EntitlementsRequest:Sb,EntitlementsResponse:Ub,EventParams:C,FinishedLoggingResponse:Vb,LinkSaveTokenRequest:Wb,LinkingInfoResponse:F,SkuSelectedResponse:Xb,SmartBoxMessage:G,SubscribeResponse:H,Timestamp:Tb,ToastCloseRequest:Yb,ViewSubscriptionsResponse:I};function $b(a){return JSON.parse(a)}function ac(a,b){try{return $b(a)}catch(c){b&&b(c)}}function bc(a){var b=ac(a);return b&&b.productId||null};function cc(){}cc.prototype.decode=function(a){return dc(a).payload};function dc(a){function b(){throw Error('Invalid token: "'+a+'"');}var c=a.split(".");3!=c.length&&b();var d=Qa(c[0]),f=Qa(c[1]);return{header:ac(Oa(d),b),payload:ac(Oa(f),b),verifiable:c[0]+"."+c[1],sig:c[2]}};function fc(a,b,c,d,f,g,h,k){this.service=a;this.raw=b;this.entitlements=c;this.isReadyToPay=h||!1;this.decryptedDocumentKey=k||null;this.nc=d;this.Qc=f;this.Uc=g}e=fc.prototype;e.clone=function(){return new fc(this.service,this.raw,this.entitlements.map(function(a){return a.clone()}),this.nc,this.Qc,this.Uc,this.isReadyToPay,this.decryptedDocumentKey)};e.json=function(){return{service:this.service,entitlements:this.entitlements.map(function(a){return a.json()}),isReadyToPay:this.isReadyToPay}};
e.enablesThisWithCacheableEntitlements=function(){var a=this.getEntitlementForThis();return!!a&&"google:metering"!==a.source};e.enablesThisWithGoogleMetering=function(){var a=this.getEntitlementForThis();return!!a&&"google:metering"===a.source};e.enablesThis=function(a){return this.enables(this.nc,a)};e.enablesAny=function(a){for(var b=0;b<this.entitlements.length;b++)if(0<this.entitlements[b].products.length&&(!a||a==this.entitlements[b].source))return!0;return!1};
e.enables=function(a,b){return a?!!this.getEntitlementFor(a,b):!1};e.getEntitlementForThis=function(a){return this.getEntitlementFor(this.nc,a)};
e.getEntitlementFor=function(a,b){if(!a)return u("SwG needs this article to define a product ID (e.g. example.com:premium). Articles can define a product ID using JSON+LD. SwG can check entitlements after this article defines a product ID."),null;var c=this.entitlements.filter(function(g){return g.enables(a)&&(!b||b===g.source)}),d=Ja(c,function(g){return"google:metering"!==g.source}),f=Ja(c,function(g){return"google:metering"===g.source});return d||f||null};
e.getEntitlementForSource=function(a){if(0<this.entitlements.length)for(var b=0;b<this.entitlements.length;b++)if(this.entitlements[b].subscriptionToken&&a==this.entitlements[b].source)return this.entitlements[b];return null};e.ack=function(){this.Qc(this)};e.consume=function(a){this.Uc(this,a)};function gc(a,b,c){this.source=a;this.products=b;this.subscriptionToken=c}gc.prototype.clone=function(){return new gc(this.source,this.products.slice(0),this.subscriptionToken)};
gc.prototype.json=function(){return{source:this.source,products:this.products,subscriptionToken:this.subscriptionToken}};gc.prototype.enables=function(a){if(!a)return!1;var b=a.indexOf(":");return-1!=b&&this.products.includes(a.substring(0,b+1)+"*")?!0:this.products.includes(a)};function hc(a){return(Array.isArray(a)?a:[a]).map(function(b){b||(b={});return new gc(b.source||"",b.products||[],b.subscriptionToken)})}
gc.prototype.getSku=function(){if("google"!==this.source)return null;var a=bc(this.subscriptionToken)||null;a||u("Unable to retrieve SKU from SwG subscription token");return a};function ic(a,b){this.idToken=a;this.data=b;this.id=b.sub;this.email=b.email;this.emailVerified=b.email_verified;this.name=b.name;this.givenName=b.given_name;this.familyName=b.family_name;this.pictureUrl=b.picture}ic.prototype.clone=function(){return new ic(this.idToken,this.data)};ic.prototype.json=function(){return{id:this.id,email:this.email,emailVerified:this.emailVerified,name:this.name,givenName:this.givenName,familyName:this.familyName,pictureUrl:this.pictureUrl}};function jc(a,b,c,d,f,g,h,k,l){h=void 0===h?null:h;k=void 0===k?null:k;l=void 0===l?null:l;this.raw=a;this.purchaseData=b;this.userData=c;this.entitlements=d;this.productType=f;this.Fa=g;this.oldSku=h;this.swgUserToken=k;this.paymentRecurrence=l}jc.prototype.clone=function(){return new jc(this.raw,this.purchaseData,this.userData,this.entitlements,this.productType,this.Fa,this.oldSku,this.swgUserToken)};
jc.prototype.json=function(){return{purchaseData:this.purchaseData.json(),userData:this.userData?this.userData.json():null,entitlements:this.entitlements?this.entitlements.json():null,oldSku:this.oldSku,productType:this.productType,swgUserToken:this.swgUserToken}};jc.prototype.complete=function(){return this.Fa()};function kc(a,b){this.data=this.raw=a;this.signature=b}kc.prototype.clone=function(){return new kc(this.raw,this.signature)};kc.prototype.json=function(){return{data:this.raw,signature:this.signature}};function lc(a,b,c,d){this.entitlements=a;this.userData=b;this.purchaseDataList=c;this.purchaseData=c[0];this.Fa=d}lc.prototype.clone=function(){return new lc(this.entitlements,this.userData,this.purchaseDataList,this.Fa)};lc.prototype.json=function(){return{entitlements:this.entitlements.json(),userData:this.userData.json(),purchaseDataList:this.purchaseDataList.map(function(a){return a.json()}),purchaseData:this.purchaseData.json()}};lc.prototype.complete=function(){return this.Fa()};var mc={UNKNOWN:"unknown",NON_SUBSCRIBER:"non_subscriber",SUBSCRIBER:"subscriber",PAST_SUBSCRIBER:"past_subscriber"},nc={IMPRESSION_PAYWALL:"paywall",IMPRESSION_AD:"ad_shown",IMPRESSION_OFFERS:"offers_shown",ACTION_SUBSCRIPTIONS_LANDING_PAGE:"subscriptions_landing_page",ACTION_OFFER_SELECTED:"offer_selected",ACTION_PAYMENT_FLOW_STARTED:"payment_flow_start",ACTION_PAYMENT_COMPLETED:"payment_complete",EVENT_CUSTOM:"custom"};var oc={GENERAL:"general",PAYWALL:"paywall"};var pc=/(^|\.)google\.(com?|[a-z]{2}|com?\.[a-z]{2}|cat)$/,qc,rc;
function sc(a){qc||(qc=self.document.createElement("a"),rc=self.UrlCache||(self.UrlCache=Object.create(null)));var b=rc[a];if(b)return b;var c=qc;c.href=a;c.protocol||(c.href=c.href);var d={href:c.href,protocol:c.protocol,host:c.host,hostname:c.hostname,port:"0"==c.port?"":c.port,pathname:c.pathname,search:c.search,hash:c.hash,origin:""};"/"!==d.pathname[0]&&(d.pathname="/"+d.pathname);if("http:"==d.protocol&&80==d.port||"https:"==d.protocol&&443==d.port)d.port="",d.host=d.hostname;d.origin=c.origin&&
"null"!=c.origin?c.origin:"data:"!=d.protocol&&d.host?d.protocol+"//"+d.host:d.href;return rc[a]=d}function tc(a){return a?(/^[?#]/.test(a)?a.slice(1):a).split("&").reduce(function(b,c){c=c.split("=");try{var d=decodeURIComponent(c[0]||""),f=decodeURIComponent(c[1]||"");d&&(b[d]=f)}catch(g){u("SwG could not parse a URL query param: "+c[0])}return b},{}):{}}
function J(a,b,c){var d=a.indexOf("?"),f=a.indexOf("#"),g="";-1!=f&&(g=a.substring(f),a=a.substring(0,f));-1==d?a+="?":d<a.length-1&&(a+="&");a+=encodeURIComponent(b)+"="+encodeURIComponent(c);return a+g}function uc(a){return(a=a.getRootNode().querySelector("link[rel='canonical']"))&&a.href||""}var vc=sc(self.window.location.href),wc=sc(self.document.referrer);function xc(a){a=a||vc;return"https"===a.protocol||"https:"===a.protocol};var yc={nocache:1,hr1:36E5,hr12:432E5};function zc(){return sc("https://news.google.com").origin}function Ac(a){return"https://news.google.com/swg/_/api/v1"+a}function K(a,b){a=J("https://news.google.com"+(void 0===b?"":b)+"/swg/_/ui/v1"+a,"_",Bc());var c=tc(self.location.hash)["swg.boqjsmode"];void 0!==c&&(a=J(a,"jsmode",c));for(var d in void 0)a=J(a,d,(void 0)[d]);return a}function L(a){return Object.assign(a,{_client:"SwG 0.1.22.166"})}
function Bc(){var a=yc.hr1;null==a&&(a=1);if(0===a)return"_";var b=Date.now();return String(1>=a?b:Math.floor(b/a))};var Cc={IMMEDIATE_WITH_TIME_PRORATION:1},Dc={AUTO:1,ONE_TIME:2};function Ec(a,b){b=void 0===b?null:b;return new C([,,,,a,,,b])}function Fc(a,b,c){c=void 0===c?"SUBSCRIPTION":c;this.h=a;this.jc=a.payClient();this.P=a.pageConfig();this.o=a.dialogManager();this.Ba=b;this.gd=c;this.W=a.analytics();this.u=a.eventManager();this.X=a.clientConfigManager()}
Fc.prototype.start=function(){var a=this;return this.X.getClientConfig().then(function(b){var c=b.paySwgVersion,d={skuId:a.Ba.skuId,publicationId:a.P.getPublicationId()};c&&(d.swgVersion=c);if(a.Ba.oldSku){d.oldSku=a.Ba.oldSku;var f=a.Ba.replaceSkuProrationMode;d.replaceSkuProrationMode=f?Cc[f]:Cc.IMMEDIATE_WITH_TIME_PRORATION;a.W.setSku(d.oldSku)}a.Ba.oneTime&&(d.paymentRecurrence=Dc.ONE_TIME);f="UI_CONTRIBUTION"==a.gd?"contribute":"subscribe";a.h.callbacks().triggerFlowStarted(f,a.Ba);a.u.logSwgEvent(1005,
!0,Ec(d.skuId));Gc=!0;a.jc.start({apiVersion:1,allowedPaymentMethods:["CARD"],environment:"PRODUCTION",playEnvironment:"PROD",swg:d,i:{startTimeMs:Date.now(),productType:a.gd}},{forceRedirect:"redirect"==a.h.config().windowOpenMode,forceDisableNative:"2"==c});Promise.resolve()})};function Hc(a){this.g=a.win();this.h=a;this.m=a.activities();this.o=a.dialogManager();this.nb=this.ja=null;this.W=a.analytics();this.u=a.eventManager();this.X=a.clientConfigManager();this.H=null}
function Ic(a){var b=a.eventManager();a.payClient().onResponse(function(c){a.entitlementsManager().blockNextNotification();var d=new Hc(a),f=Jc(a,c,d.complete.bind(d));a.callbacks().triggerPaymentResponse(f);return f.then(function(g){var h=bc(g.purchaseData.raw)||null;a.analytics().setSku(h||"");b.logSwgEvent(1001,!0,Ec(h||"","UI_CONTRIBUTION"==g.productType?"contribute":"subscribe"));d.start(g)},function(g){if(y(g))g="UI_CONTRIBUTION"==g.productType?"contribute":"subscribe",a.callbacks().triggerFlowCanceled(g),
a.eventManager().logSwgEvent(1014,!0);else throw a.eventManager().logSwgEvent(2E3,!1),a.jserror().error("Pay failed",g),g;})})}
Hc.prototype.start=function(a){var b=this;this.H=bc(a.purchaseData.raw)||null;this.u.logSwgEvent(10,!0,Ec(this.H||""));this.h.entitlementsManager().reset(!0);var c={publicationId:this.h.pageConfig().getPublicationId(),productType:a.productType,isSubscriptionUpdate:!!a.oldSku,isOneTime:!!a.paymentRecurrence};a.userData&&a.entitlements?(c.idToken=a.userData.idToken,this.h.entitlementsManager().pushNextEntitlements(a.entitlements.raw),a.swgUserToken&&this.h.storage().set("USER_TOKEN",a.swgUserToken,
!0)):c.loginHint=a.userData&&a.userData.email;return this.ja=this.X.getClientConfig().then(function(d){c.useUpdatedConfirmUi=d.useUpdatedOfferFlows;return new z(b.g,b.m,K("/payconfirmiframe"),L(c),!0)}).then(function(d){d.on(Ub,b.yd.bind(b));d.acceptResult().then(function(){b.o.completeView(d)});b.nb=b.o.openView(d);return d})};Hc.prototype.yd=function(a){var b=a.getJwt();b&&this.h.entitlementsManager().pushNextEntitlements(b)};
Hc.prototype.complete=function(){var a=this;this.u.logSwgEvent(1002,!0,Ec(this.H||""));this.h.entitlementsManager().unblockNextNotification();return Promise.all([this.ja,this.nb]).then(function(b){b=b[0];var c=new A;c.setComplete(!0);b.execute(c);return b.acceptResult().catch(function(){}).then(function(){a.u.logSwgEvent(1003,!0,Ec(a.H||""));a.h.entitlementsManager().setToastShown(!0)})})};var Gc=!1;
function Jc(a,b,c){var d=!Gc;Gc=!1;return b.then(function(f){var g=void 0;if("object"===typeof f&&f.googleTransactionId){var h=a.analytics().getTransactionId(),k=f.googleTransactionId;if(d){a.analytics().setTransactionId(k);var l=3004}else h===k?l=3001:(g=new C,g.setGpayTransactionId(k),l=3002)}else g=new C,g.setHadLogged(!d),l=3003;a.eventManager().logSwgEvent(l,!0,g);var m=l=null,r="SUBSCRIPTION",q=null,E=null;f&&("string"==typeof f?m=f:("swgCallbackData"in f?l=f.swgCallbackData:"integratorClientCallbackData"in
f&&(m=f.integratorClientCallbackData),"paymentRequest"in f&&(q=(f.paymentRequest.swg||{}).oldSku,E=(f.paymentRequest.swg||{}).paymentRecurrence,r=(f.paymentRequest.i||{}).productType||"SUBSCRIPTION")));m&&!l&&(m=atob(m))&&(l=$b(m).swgCallbackData);if(!l)throw Error("unexpected payment response");f=m=JSON.stringify(l);m=new kc(l.purchaseData,l.purchaseDataSignature);var B;if(B=l.idToken){var D=(new cc).decode(B);B=new ic(B,D)}else B=null;D=l;D=D.signedEntitlements?a.entitlementsManager().parseEntitlements(D):
null;return new jc(f,m,B,D,r,c,q,E,l.swgUserToken)})};function Kc(a,b){var c=this;this.h=a;this.g=a.win();this.m=a.activities();this.o=a.dialogManager();this.u=a.eventManager();this.X=a.clientConfigManager();this.l=null;var d=b&&b.isClosable;void 0==d&&(d=!1);var f=a.activities().addDefaultArguments({showNative:a.callbacks().hasSubscribeRequestCallback(),productType:"SUBSCRIPTION",list:b&&b.list||"default",skus:b&&b.skus||null,isClosable:d});if(b&&b.oldSku){f.oldSku=b.oldSku;v(f.skus,"Need a sku list if old sku is provided!");var g=f.skus,h=f.oldSku;
g=g.filter(function(l){return l!==h});v(0<g.length,"Sku list only contained offer user already has");f.skus=g}if(f.skus&&1===f.skus.length&&(a=f.skus[0],b=f.oldSku)){var k=new Xb;k.setSku(a);k.setOldSku(b);this.sb(k);return}this.Ud=f.skus||["*"];this.ja=this.Ob(this.X.getClientConfig()).then(function(l){return new z(c.g,c.m,K(l),f,!0)})}e=Kc.prototype;
e.sb=function(a){var b=a.getSku();if(b){var c={skuId:b};if(a=a.getOldSku())c.oldSku=a,this.h.analytics().setSku(a);this.u.logSwgEvent(1006,!0,new C([,,,,b]));(new Fc(this.h,c)).start()}};e.Ka=function(a){a.getSubscriberOrMember()&&(this.u.logSwgEvent(1009,!0),this.h.callbacks().triggerLoginRequest({linkRequested:!!a.getLinkRequested()}))};e.Cc=function(a){a.getNative()&&this.h.callbacks().triggerSubscribeRequest()};
e.start=function(){var a=this;return this.ja?this.ja.then(function(b){a.h.callbacks().triggerFlowStarted("showOffers",{skus:a.Ud,source:"SwG"});b.onCancel(function(){a.h.callbacks().triggerFlowCanceled("showOffers")});b.on(Xb,a.sb.bind(a));b.on(Nb,a.Ka.bind(a));b.on(I,a.Cc.bind(a));a.l=b;return a.o.openView(a.l)}):Promise.resolve()};e.Ob=function(a){return a.then(function(b){return b.useUpdatedOfferFlows?"/subscriptionoffersiframe":"/offersiframe"})};
e.showNoEntitlementFoundToast=function(){this.l&&this.l.execute(new Ub)};function Lc(a,b){this.h=a;this.B=b;this.m=a.activities();this.o=a.dialogManager();this.u=a.eventManager();this.l=new z(a.win(),this.m,K("/optionsiframe"),L({publicationId:a.pageConfig().getPublicationId(),productId:a.pageConfig().getProductId(),list:b&&b.list||"default",skus:b&&b.skus||null,isClosable:!0}),!1)}
Lc.prototype.start=function(){var a=this;this.h.callbacks().triggerFlowStarted("showSubscribeOption");this.l.onCancel(function(){a.h.callbacks().triggerFlowCanceled("showSubscribeOption")});this.l.on(H,this.bd.bind(this));this.l.acceptResult().then(function(b){b=b.data;var c=new H;b.subscribe&&c.setSubscribe(!0);a.bd(c)},function(b){a.o.completeView(a.l);throw b;});this.u.logSwgEvent(7);return this.o.openView(this.l)};
Lc.prototype.bd=function(a){a.getSubscribe()&&(a=this.B||{},void 0==a.isClosable&&(a.isClosable=!0),this.u.logSwgEvent(1008,!0),(new Kc(this.h,a)).start())};
function Mc(a,b){b=void 0===b?{}:b;this.h=a;this.B=b;this.g=a.win();this.m=a.activities();this.o=a.dialogManager();this.u=a.eventManager();this.l=new z(this.g,this.m,K("/abbrvofferiframe"),L({publicationId:a.pageConfig().getPublicationId(),productId:a.pageConfig().getProductId(),showNative:a.callbacks().hasSubscribeRequestCallback(),list:b&&b.list||"default",skus:b&&b.skus||null,isClosable:!0}),!1)}Mc.prototype.Ka=function(a){a.getSubscriberOrMember()&&(this.u.logSwgEvent(1009,!0),this.h.callbacks().triggerLoginRequest({linkRequested:!!a.getLinkRequested()}))};
Mc.prototype.start=function(){var a=this;this.h.callbacks().triggerFlowStarted("showAbbrvOffer");this.l.onCancel(function(){a.h.callbacks().triggerFlowCanceled("showAbbrvOffer")});this.l.on(Nb,this.Ka.bind(this));this.l.acceptResult().then(function(b){b.data.viewOffers?(b=a.B||{},void 0==b.isClosable&&(b.isClosable=!0),a.u.logSwgEvent(1008,!0),(new Kc(a.h,b)).start()):b.data["native"]&&(a.h.callbacks().triggerSubscribeRequest(),a.o.completeView(a.l))});this.u.logSwgEvent(8);return this.o.openView(this.l)};function Nc(a){this.v=a}Nc.prototype.acceptResult=function(){return this.v.acceptResult()};function Oc(a,b,c,d){this.$=new tb(a,b,d);this.yb={};this.h=c}e=Oc.prototype;e.whenReady=function(){return this.$.whenReady()};
e.connect=function(){var a=this;return this.$.connect().then(function(){a.$.onMessage(function(b){if(b=b&&b.RESPONSE){var c=a.yb[b[0]];if(c){a:{var d=b?b[0]:null;if(d&&(d=Zb[d])){b=new d(b);break a}throw Error("Deserialization failed for "+b);}c(b)}}});if(a.h&&a.h.eventManager())a.on(Qb,function(b){a.h.eventManager().logEvent({eventType:b.getEvent(),eventOriginator:4,isFromUserAction:b.getMeta().getIsFromUserAction(),additionalParameters:b.getParams()})})})};e.disconnect=function(){this.$.disconnect()};
e.getMode=function(){return this.$.getMode()};e.acceptResult=function(){return this.$.acceptResult()};e.onResizeRequest=function(a){return this.$.onResizeRequest(a)};e.execute=function(a){this.$.message({REQUEST:a.toArray()})};e.on=function(a,b){var c=null;try{c=(new a).label()}catch(d){c=null}if(!c)throw Error("Invalid data type");if(this.yb[c])throw Error("Invalid type or duplicate callback for ",c);this.yb[c]=b};e.resized=function(){this.$.resized()};
function Pc(a){this.h=a;this.m=new Cb(a.win())}e=Pc.prototype;e.addDefaultArguments=function(a){var b=this.h,c=b.pageConfig();b=b.analytics().getContext();return Object.assign({analyticsContext:b.toArray(),publicationId:c.getPublicationId(),productId:c.getProductId(),_client:"SwG 0.1.22.166",supportsEventManager:!0},a||{})};function Qc(a,b,c,d){var f=new Oc(b,c,a.h,d);return f.connect().then(function(){return f})}
e.openIframe=function(a,b,c,d){(d=void 0===d?!1:d)&&(c=this.addDefaultArguments(c));return Qc(this,a,b,c)};e.open=function(a,b,c,d,f,g){(void 0===g?0:g)&&(d=this.addDefaultArguments(d));return this.m.open(a,b,c,d,f)};e.onResult=function(a,b){this.m.onResult(a,function(c){b(new Nc(c))})};e.onRedirectError=function(a){this.m.onRedirectError(a)};e.getOriginalWebActivityPorts=function(){return this.m};function M(a){return"[object Object]"===Object.prototype.toString.call(a)}function Rc(a,b){for(var c in a)if(a[c]===b)return!0;return!1}function Sc(a){return"boolean"===typeof a};function Tc(a,b){return"Event has an invalid "+a+"("+b+")"}
function Uc(a){if(!M(a))throw Error("Event must be a valid object");if(!Rc(Lb,a.eventType))throw Error(Tc("eventType",a.eventType));if(!Rc(Mb,a.eventOriginator))throw Error(Tc("eventOriginator",a.eventOriginator));if(!M(a.additionalParameters)&&null!=a.additionalParameters)throw Error(Tc("additionalParameters",a.additionalParameters));if(null!=a.isFromUserAction&&!Sc(a.isFromUserAction))throw Error(Tc("isFromUserAction",a.isFromUserAction));}
function Vc(a){this.Xb=[];this.Nb=[];this.Tb=null;this.Xc=a}e=Vc.prototype;e.registerEventListener=function(a){if("function"!==typeof a)throw Error("Event manager listeners must be a function");this.Xb.push(a)};e.registerEventFilterer=function(a){if("function"!==typeof a)throw Error("Event manager filterers must be a function");this.Nb.push(a)};
e.logEvent=function(a){var b=this;Uc(a);this.Tb=this.Xc.then(function(){for(var c=0;c<b.Nb.length;c++)try{if(1===b.Nb[c](a))return Promise.resolve()}catch(d){t(d)}for(c=0;c<b.Xb.length;c++)try{b.Xb[c](a)}catch(d){t(d)}return Promise.resolve()})};e.logSwgEvent=function(a,b,c){b=void 0===b?!1:b;this.logEvent({eventType:a,eventOriginator:1,isFromUserAction:b,additionalParameters:void 0===c?null:c})};e.getReadyPromise=function(){return this.Xc};var Wc=null;
function Xc(a){if(!Wc){Wc={};var b="replace-subscription,update-google-transaction-id,smartbox,pay-client-redirect";try{var c=tc(a.location.hash)["swg.experiments"];c&&(b+=","+c)}catch(d){Gb(d)}b.split(",").forEach(function(d){if(d=d.trim())try{var f=d;d=Wc;var g=!1,h=f.indexOf(":");if(-1==h){var k=f;var l=100;g=!1}else k=f.substring(0,h).trim(),f=f.substring(h+1),"c"==f.substring(f.length-1)&&(g=!0,f=f.substring(0,f.length-1)),l=parseInt(f,10);if(isNaN(l))throw Error("invalid fraction");if(99<l)var m=!0;else if(1>l)m=!1;else if(a.sessionStorage){g=g&&20>=l;try{h=
"subscribe.google.com:e:"+k+":"+l+(g?"c":"");var r=a.sessionStorage.getItem(h);var q="e"==r?"e":"c"==r?"c":null;!q&&100*a.Math.random()<=l*(g?2:1)&&(q=(g?.5>=a.Math.random():1)?"e":"c",a.sessionStorage.setItem(h,q));m=!!q;"c"==q&&(k="c-"+k)}catch(E){m=!1,Gb(E)}}else m=!1;d[k]=m}catch(E){Gb(E)}})}return Wc}function Yc(a,b){return Xc(a)[b]||!1}function Zc(a){a=Xc(a);var b=[],c;for(c in a)a[c]&&b.push(c);return b};var $c={opacity:"0",position:"absolute",top:"-10px",left:"-10px",height:"1px",width:"1px"};function ad(a){var b=new Vb;b.setComplete(!1);b.setError(a);return b}
function bd(a,b){this.D=b;this.j=a.doc();this.h=a;this.m=a.activities();this.s=x(this.j.getWin().document,"iframe",{});w(this.s,$c);this.j.getBody().appendChild(this.getElement());this.Vc=!1;var c=this.G=new Ob;Yc(this.j.getWin(),"update-google-transaction-id")?c.setTransactionId(Sa()+".swg"):c.setTransactionId(Sa());c.setReferringOrigin(sc(this.j.getWin().document.referrer).origin);c.setClientVersion("SwG 0.1.22.166");c.setUrl(uc(this.j));var d=tc(this.j.getWin().location.search),f=
d.utm_campaign,g=d.utm_medium;d=d.utm_source;f&&c.setUtmCampaign(f);g&&c.setUtmMedium(g);d&&c.setUtmSource(d);this.Tb=this.yc=null;this.u=a.eventManager();this.u.registerEventListener(this.Ja.bind(this));this.ub=0;this.mb=this.eb=null;this.Yb=!1;this.Va=null}e=bd.prototype;e.setTransactionId=function(a){var b=this.G.getTransactionId();this.G.setTransactionId(a);if(null!=b&&b!=a){var c=new C;c.setOldTransactionId(b);this.u.logSwgEvent(3006,!0,c)}};e.getTransactionId=function(){return this.G.getTransactionId()};
e.getSku=function(){return this.G.getSku()};e.setSku=function(a){this.G.setSku(a)};e.setUrl=function(a){this.G.setUrl(a)};e.addLabels=function(a){if(a&&0<a.length){var b=[].concat(this.G.getLabelList());a.forEach(function(c){-1==b.indexOf(c)&&b.push(c)});this.G.setLabelList(b)}};e.getElement=function(){return this.s};
e.start=function(){var a=this;this.yc||(this.addLabels(Zc(this.j.getWin())),this.yc=this.m.openIframe(this.s,K("/serviceiframe"),null,!0).then(function(b){b.on(Vb,a.wb.bind(a));return b.whenReady().then(function(){a.addLabels(Zc(a.j.getWin()));return b})},function(b){a.Yb=!0;a.wb(ad("Could not connect ["+b+"]"))}));return this.yc};e.setReadyToPay=function(a){this.G.setReadyToPay(a)};e.close=function(){this.j.getBody().removeChild(this.getElement())};e.getContext=function(){return this.G};
e.Ja=function(a){var b=this;4E3!==a.eventType&&6!==a.eventOriginator&&(3!==a.eventOriginator&&5!==a.eventOriginator&&2!==a.eventOriginator||!0===this.h.config().enableSwgAnalytics||11===a.eventType&&2===a.eventOriginator)&&(this.ub++,this.Tb=this.start().then(function(c){var d=new Pb;d.setEventOriginator(a.eventOriginator);d.setIsFromUserAction(!!a.isFromUserAction);var f=new Qb;f.setEvent(a.eventType);f.setContext(b.G);f.setMeta(d);a.additionalParameters instanceof C&&f.setParams(a.additionalParameters);
c.execute(f);Yc(b.j.getWin(),"logging-beacon")&&(c=encodeURIComponent(b.h.pageConfig().getPublicationId()),c=Ac("/publication/"+c+"/clientlogs"),b.D.sendBeacon(c,f))}))};
e.wb=function(a){var b=a&&a.getComplete()||!1;a=a&&a.getError()||"Unknown logging Error";var c="AnalyticsService timed out waiting for a response"===a;b||t("Error when logging: "+a);this.ub--;c||(this.Vc=!0);null!==this.eb&&(0===this.ub||this.Yb||c)&&(null!==this.Va&&(clearTimeout(this.Va),this.Va=null),this.eb(b),this.eb=this.mb=null)};
e.getLoggingPromise=function(){var a=this;if(0===this.ub||this.Yb)return Promise.resolve(!0);if(null===this.mb){this.mb=new Promise(function(c){a.eb=c});var b=this.wb.bind(this);this.Va=setTimeout(function(){a.Va=null;b(ad("AnalyticsService timed out waiting for a response"))},this.Vc?200:500)}return this.mb};var cd={en:"Subscribe with Google",ar:"Google \u0627\u0634\u062a\u0631\u0643\u00a0\u0645\u0639",de:"Abonnieren mit Google",es:"Suscr\u00edbete con Google","es-latam":"Suscr\u00edbete con Google","es-latn":"Suscr\u00edbete con Google",fr:"S'abonner avec Google",hi:"Google \u0915\u0947 \u095b\u0930\u093f\u092f\u0947 \u0938\u0926\u0938\u094d\u092f\u0924\u093e",id:"Berlangganan dengan Google",it:"Abbonati con Google",jp:"Google \u3067\u8cfc\u8aad",ko:"Google \uc744 \ud1b5\ud55c\uad6c\ub3c5",ms:"Langgan dengan Google",
nl:"Abonneren via Google",no:"Abonner med Google",pl:"Subskrybuj z Google",pt:"Subscrever com o Google","pt-br":"Assine com o Google",ru:"\u041f\u043e\u0434\u043f\u0438c\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 Google",se:"Prenumerera med Google",th:"\u0e2a\u0e21\u0e31\u0e04\u0e23\u0e1f\u0e32\u0e19 Google",tr:"Google ile Abone Ol",uk:"\u041f\u0456\u0434\u043f\u0438\u0441\u0430\u0442\u0438\u0441\u044f \u0447\u0435\u0440\u0435\u0437 Google","zh-tw":"\u900f\u904e Google \u8a02\u95b1"},dd={en:"Contribute with Google",
ar:"\u0627\u0644\u0645\u0633\u0627\u0647\u0645\u0629 \u0628\u0627\u0633\u062a\u062e\u062f\u0627\u0645 Google",de:"Mit Google beitragen",es:"\tContribuye con Google","es-latam":"Contribuir con Google","es-latn":"Contribuye con Google",fr:"Contribuer avec Google",hi:"Google \u0916\u093e\u0924\u0947 \u0915\u0940 \u092e\u0926\u0926 \u0938\u0947 \u092f\u094b\u0917\u0926\u093e\u0928 \u0915\u0930\u0947\u0902",id:"Berkontribusi dengan Google",it:"Contribuisci con Google",jp:"Google \u3092\u4ecb\u3057\u3066\u8cc7\u91d1\u63d0\u4f9b",
ko:"Google\uc744 \ud1b5\ud574 \ucc38\uc5ec\ud558\uae30",ms:"Sumbangkan dengan Google",nl:"Bijdragen met Google",no:"Bidra med Google",pl:"Wesprzyj publikacj\u0119 przez Google",pt:"Contribuir com o Google","pt-br":"Contribua com o Google",ru:"\u0412\u043d\u0435\u0441\u0442\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0447\u0435\u0440\u0435\u0437 Google",se:"Bidra med Google",th:"\u0e21\u0e35\u0e2a\u0e48\u0e27\u0e19\u0e23\u0e48\u0e27\u0e21\u0e1c\u0e48\u0e32\u0e19 Google",tr:"Google ile Katk\u0131da Bulun",
uk:"\u0417\u0440\u043e\u0431\u0438\u0442\u0438 \u0432\u043d\u0435\u0441\u043e\u043a \u0447\u0435\u0440\u0435\u0437 Google","zh-tw":"\u900f\u904e Google \u6350\u6b3e"};var ed={frameborder:"0",scrolling:"no"};function fd(a,b,c,d){this.h=a;this.g=a.win();this.j=this.g.document;this.m=a.activities();this.s=x(this.j,"iframe",ed);this.od=b;this.B=c;this.S=d;this.Ua=K("/smartboxiframe");var f={productId:this.h.pageConfig().getProductId(),publicationId:this.h.pageConfig().getPublicationId(),theme:this.B&&this.B.theme||"light",lang:this.B&&this.B.lang||"en"},g=this.B&&this.B.messageTextColor;g&&(f.messageTextColor=g);this.T=L(f)}
fd.prototype.Bd=function(a){if(a&&a.getIsClicked()){if(!this.S)throw Error("No callback!");this.S()}};fd.prototype.start=function(){var a=this;w(this.s,{opacity:1,position:"absolute",top:0,bottom:0,left:0,height:"100%",right:0,width:"100%"});this.od.appendChild(this.s);var b=this.m.addDefaultArguments(this.T);this.m.openIframe(this.s,this.Ua,b).then(function(c){c.on(G,a.Bd.bind(a))});return this.s};function gd(a,b){var c=a.en;if("object"!==typeof a||!b)return c;var d="string"===typeof b?b:b.lang?b.lang:b.ownerDocument&&b.ownerDocument.documentElement.lang?b.ownerDocument.documentElement.lang:"en";d=d.toLowerCase();d=d.replace(/_/g,"-");for(var f=d.split("-");f.length;){var g=f.join("-");if(g in a)return a[g];f.pop()}return c};function hd(a,b){this.j=a;this.td=b}e=hd.prototype;e.init=function(){var a=this.j.getHead();a&&(a.querySelector('link[href="https://news.google.com/swg/js/v1/swg-button.css"]')||a.appendChild(x(this.j.getWin().document,"link",{rel:"stylesheet",type:"text/css",href:"https://news.google.com/swg/js/v1/swg-button.css"})))};e.create=function(a,b){var c=x(this.j.getWin().document,"button",{});return this.attach(c,a,b)};
e.attach=function(a,b,c){b=id(this,a,1007,b,c).options;a.classList.add("swg-button-"+b.theme);a.setAttribute("role","button");b.lang&&a.setAttribute("lang",b.lang);a.setAttribute("title",gd(cd,a)||"");jd(this,6);return a};
e.attachSubscribeButton=function(a,b,c){b=id(this,a,1017,b,c).options;c=b.theme;a.classList.add("swg-button-v2-"+c);a.setAttribute("role","button");b.lang&&a.setAttribute("lang",b.lang);b.enable&&(a.disabled=!1);a.innerHTML='<img class="swg-button-v2-icon-$theme$"></div>$textContent$'.replace("$theme$",c).replace("$textContent$",gd(cd,a)||"");jd(this,16);return a};
e.attachContributeButton=function(a,b,c){b=id(this,a,1019,b,c).options;c=b.theme;a.classList.add("swg-button-v2-"+c);a.setAttribute("role","button");b.lang&&a.setAttribute("lang",b.lang);b.enable&&(a.disabled=!1);a.innerHTML='<img class="swg-button-v2-icon-$theme$"></div>$textContent$'.replace("$theme$",c).replace("$textContent$",gd(dd,a)||"");jd(this,19);return a};
e.attachButtonsWithAttribute=function(a,b,c,d){var f=this;b.forEach(function(g){for(var h=f.j.getRootNode().querySelectorAll("button["+a+'="'+g+'"]'),k=0;k<h.length;k++)"subscription"===g?f.attachSubscribeButton(h[k],c,d[g]):"contribution"===g&&f.attachContributeButton(h[k],c,d[g])})};function jd(a,b,c){a.td.then(function(d){d.eventManager().logSwgEvent(b,c)})}function kd(a){a=a&&"function"!=typeof a?a:{theme:"light"};var b=a.theme;"light"!==b&&"dark"!==b&&(a.theme="light");return a}
function id(a,b,c,d,f){function g(l){jd(a,c,!0);"function"===typeof k&&k(l)}var h=kd(d),k=("function"==typeof d?d:null)||f;b.addEventListener("click",g);return{options:h,clickFun:g}}e.attachSmartButton=function(a,b,c,d){c=id(this,b,1007,c,d);b.classList.add("swg-smart-button");return(new fd(a,b,c.options,c.clickFun)).start()};function ld(){this.C={};this.M={};this.Md=null}e=ld.prototype;e.setOnEntitlementsResponse=function(a){N(this,1,a)};e.triggerEntitlementsResponse=function(a){return O(this,1,a.then(function(b){return b.clone()}))};e.hasEntitlementsResponsePending=function(){return!!this.M[1]};e.setOnLoginRequest=function(a){N(this,4,a)};e.triggerLoginRequest=function(a){return O(this,4,a)};e.setOnLinkProgress=function(a){N(this,5,a)};e.triggerLinkProgress=function(){return O(this,5,!0)};
e.resetLinkProgress=function(){5 in this.M&&delete this.M[5]};e.setOnLinkComplete=function(a){N(this,6,a)};e.triggerLinkComplete=function(){return O(this,6,!0)};e.hasLinkCompletePending=function(){return!!this.M[6]};e.setOnSubscribeRequest=function(a){N(this,2,a)};e.triggerSubscribeRequest=function(){return O(this,2,!0)};e.hasSubscribeRequestCallback=function(){return!!this.C[2]};
e.setOnSubscribeResponse=function(a){u("[swg.js:setOnSubscribeResponse]: This method has been deprecated, please switch usages to 'setOnPaymentResponse'");N(this,3,a)};e.setOnContributionResponse=function(a){u("[swg.js:setOnContributionResponse]: This method has been deprecated, please switch usages to 'setOnPaymentResponse'");N(this,3,a)};e.setOnPaymentResponse=function(a){N(this,3,a)};
e.triggerPaymentResponse=function(a){var b=this;this.Md=a.then(function(c){O(b,3,Promise.resolve(c.clone()))},function(c){if(!y(c))throw c;});return!!this.C[3]};e.hasPaymentResponsePending=function(){return!!this.M[3]};e.setOnFlowStarted=function(a){N(this,7,a)};e.triggerFlowStarted=function(a,b){b=void 0===b?{}:b;return O(this,7,{flow:a,data:b})};e.setOnFlowCanceled=function(a){N(this,8,a)};e.triggerFlowCanceled=function(a,b){b=void 0===b?{}:b;return O(this,8,{flow:a,data:b})};
function N(a,b,c){a.C[b]&&u("[swg.js]: You have registered multiple callbacks for the same response.");a.C[b]=c;b in a.M&&md(a,b,c,a.M[b])}function O(a,b,c){a.M[b]=c;var d=a.C[b];d&&md(a,b,d,c);return!!d}function md(a,b,c,d){Promise.resolve().then(function(){c(d);b in a.M&&delete a.M[b]})};function nd(a,b,c,d,f){this.maxImpressionsPerWeek=a;this.clientDisplayTrigger=new od(b);this.explicitDismissalConfig=new pd(c,d,f)}function od(a){this.displayDelaySeconds=a}function pd(a,b,c){this.backoffSeconds=a;this.maxDismissalsPerWeek=b;this.maxDismissalsResultingHideSeconds=c}function qd(a,b){this.canDisplayAutoPrompt=a;this.canDisplayButton=b};function rd(a,b,c,d){this.autoPromptConfig=a;this.paySwgVersion=b;this.useUpdatedOfferFlows=c||!1;this.uiPredicates=d};function sd(a,b){this.Ab={};this.K=a;this.D=b;this.L=null}e=sd.prototype;e.fetchClientConfig=function(){if(!this.K)throw Error("fetchClientConfig requires publicationId");this.L||(this.L=this.na());return this.L};e.getClientConfig=function(){return this.L||Promise.resolve(new rd)};e.getAutoPromptConfig=function(){this.L||this.fetchClientConfig();return this.L.then(function(a){return a.autoPromptConfig})};e.getLanguage=function(){return this.Ab.lang||"en"};
e.getTheme=function(){return this.Ab.theme||"light"};e.shouldEnableButton=function(){if(this.Ab.disableButton)return Promise.resolve(!1);this.L||this.fetchClientConfig();return this.L.then(function(a){var b;return(null==(b=a.uiPredicates)?0:b.canDisplayButton)?!0:!1})};
e.na=function(){var a=Ac("/publication/"+encodeURIComponent(this.K)+"/clientconfiguration");return this.D.fetchCredentialedJson(a).then(function(b){b.errorMessages&&0<b.errorMessages.length&&b.errorMessages.forEach(function(c){u("SwG ClientConfigManager: "+c)});return td(b)})};
function td(a){var b=a.paySwgVersion,c=a.autoPromptConfig,d=void 0;if(c){var f,g,h,k;d=new nd(c.maxImpressionsPerWeek,null==(f=c.clientDisplayTrigger)?void 0:f.displayDelaySeconds,null==(g=c.explicitDismissalConfig)?void 0:g.backoffSeconds,null==(h=c.explicitDismissalConfig)?void 0:h.maxDismissalsPerWeek,null==(k=c.explicitDismissalConfig)?void 0:k.maxDismissalsResultingHideSeconds)}var l=a.uiPredicates;f=void 0;l&&(f=new qd(l.canDisplayAutoPrompt,l.canDisplayButton));return new rd(d,b,a.useUpdatedOfferFlows,
f)};function ud(a,b){var c=this;this.h=a;this.B=b;this.g=a.win();this.X=a.clientConfigManager();this.m=a.activities();this.o=a.dialogManager();this.l=null;var d=b&&b.isClosable||!0;this.ja=this.Ob(this.X.getClientConfig()).then(function(f){return new z(c.g,c.m,K(f),L({productId:a.pageConfig().getProductId(),publicationId:a.pageConfig().getPublicationId(),productType:"UI_CONTRIBUTION",list:b&&b.list||"default",skus:b&&b.skus||null,isClosable:d,supportsEventManager:!0}),!0)})}e=ud.prototype;
e.Ka=function(a){a.getSubscriberOrMember()&&this.h.callbacks().triggerLoginRequest({linkRequested:!!a.getLinkRequested()})};e.sb=function(a){var b=a.getSku(),c=a.getOneTime();if(b){var d={skuId:b};c&&(d.oneTime=c);(new Fc(this.h,d,"UI_CONTRIBUTION")).start()}};
e.start=function(){var a=this;return this.ja.then(function(b){a.h.callbacks().triggerFlowStarted("showContributionOptions");b.onCancel(function(){a.h.callbacks().triggerFlowCanceled("showContributionOptions")});b.on(Nb,a.Ka.bind(a));b.on(Xb,a.sb.bind(a));a.l=b;return a.o.openView(a.l)})};e.Ob=function(a){return a.then(function(b){return b.useUpdatedOfferFlows?"/contributionoffersiframe":"/contributionsiframe"})};e.showNoEntitlementFoundToast=function(){this.l&&this.l.execute(new Ub)};function vd(a,b){this.h=a;this.g=a.win();this.m=a.activities();this.o=a.dialogManager();this.ea=this.l=null;this.B=Object.assign({entitlements:null,consent:!0},b||{})}
vd.prototype.start=function(){var a=this,b=this.B.entitlements;if(!b||!b.getEntitlementForSource("google"))throw Error('No entitlements with "google" source');this.h.callbacks().triggerFlowStarted("completeDeferredAccountCreation");this.l=new z(this.g,this.m,K("/recoveriframe"),L({publicationId:this.h.pageConfig().getPublicationId(),productId:this.h.pageConfig().getProductId(),entitlements:b&&b.raw||null,consent:this.B.consent}),!0);this.ea=this.o.openView(this.l);return this.l.acceptResult().then(function(c){return wd(a,
c.data)},function(c){y(c)?a.h.callbacks().triggerFlowCanceled("completeDeferredAccountCreation"):a.o.completeView(a.l);throw c;})};
function wd(a,b){a.h.entitlementsManager().blockNextNotification();var c=b.entitlements,d=b.idToken,f=b.productType,g=a.h.entitlementsManager().parseEntitlements({signedEntitlements:c});d=new ic(d,(new cc).decode(d));b=b.purchaseDataList?b.purchaseDataList.map(function(l){return new kc(l.data,l.signature)}):[new kc(b.purchaseData.data,b.purchaseData.signature)];var h=new Hc(a.h),k=h.complete.bind(h);k=new lc(g,d,b,k);a.h.eventManager().logSwgEvent(1010,!0);h.start(new jc("",b[0],d,g,f,function(){return Promise.resolve()}));
return k};var xd={frameborder:0,scrolling:"no",src:"about:blank"};function yd(a){var b={"class":"swg-dialog"},c=this;b=void 0===b?{}:b;var d=Object.assign({},xd,b);this.s=x(a,"iframe",d);w(this.s,Wa);this.pb=new Promise(function(f){c.s.onload=f})}e=yd.prototype;e.whenReady=function(){return this.pb};e.getElement=function(){return this.s};
e.getDocument=function(){var a=this.getElement().contentDocument||this.getElement().contentWindow&&this.getElement().contentWindow.document;if(!a)throw Error("not loaded");return a};e.getBody=function(){return this.getDocument().body};e.isConnected=function(){var a=this.getElement();if("isConnected"in a)a=a.isConnected;else{var b=a.ownerDocument&&a.ownerDocument.documentElement;a=b&&b.contains(a)||!1}return a};function P(a,b,c){var d=a.ownerDocument.defaultView,f=a.style.transition||"";return(new Promise(function(g){d.setTimeout(function(){d.setTimeout(g,c);var h=c+"ms ease-out";w(a,Object.assign({transition:"transform "+h+", opacity "+h},b))})})).then(function(){w(a,{transition:f})})};function zd(a,b){this.j=a;this.V=this.j.getWin().document.createElement("swg-popup-background");w(this.V,{"z-index":b,display:"none",position:"fixed",top:0,right:0,bottom:0,left:0,"background-color":"rgba(32, 33, 36, .6)"})}e=zd.prototype;e.getElement=function(){return this.V};e.isAttached=function(){return!!this.V.parentNode};e.attach=function(){this.j.getBody().appendChild(this.V)};e.destroy=function(){this.j.getBody().removeChild(this.V)};
e.show=function(a){a=void 0===a?!0:a;w(this.V,{display:"block",opacity:a?0:1});if(a)return P(this.V,{opacity:1},300)};e.hide=function(a){var b=this;if(void 0===a||a)return P(this.V,{opacity:0},300).then(function(){w(b.V,{display:"none"})});w(this.V,{display:"none"})};function Ad(a){this.j=a;this.Ma=x(this.j,"swg-loading-container",{});this.ad=x(this.j,"swg-loading",{});this.Ma.appendChild(this.ad);this.Ma.style.setProperty("display","none","important");var b=this.ad;a=x(this.j,"swg-loading-animate",{});b.appendChild(a);b=x(this.j,"swg-loading-image",{});a.appendChild(b)}Ad.prototype.getElement=function(){return this.Ma};Ad.prototype.show=function(){this.Ma.style.removeProperty("display")};
Ad.prototype.hide=function(){this.Ma.style.setProperty("display","none","important")};function Bd(a){var b=a.readyState;return"loading"!=b&&"uninitialized"!=b}function Cd(a,b){if(Bd(a))b(a);else{var c=!1,d=function(){Bd(a)&&!c&&(b(a),c=!0,a.removeEventListener("readystatechange",d))};a.addEventListener("readystatechange",d)}}function Dd(a){return new Promise(function(b){Cd(a,b)})};function Ed(a){var b=!!a.document;this.g=b?a:a.defaultView;this.j=b?a.document:a}e=Ed.prototype;e.getWin=function(){return this.g};e.getRootNode=function(){return this.j};e.getRootElement=function(){return this.j.documentElement};e.getHead=function(){return this.j.head};e.getBody=function(){return this.j.body};e.isReady=function(){return Bd(this.j)};e.whenReady=function(){return Dd(this.j)};e.addToFixedLayer=function(){return Promise.resolve()};
function Fd(a){return 9===a.nodeType||a.document?new Ed(a):a};var Gd={"min-height":"50px",border:"none",display:"block",position:"fixed","z-index":2147483647,"box-sizing":"border-box"},Hd={position:"absolute",top:"0",left:"0",right:"0",bottom:"0",opacity:0,height:0,"max-height":"100%","max-width":"100%","min-height":"100%","min-width":"100%",width:0};
function Id(a){var b=void 0===b?{}:b;var c=void 0===c?{}:c;this.j=a;this.s=new yd(a.getWin().document);this.ca=new zd(a,2147483646);var d=Object.assign({},Gd,b);w(this.s.getElement(),d);Za(this.s.getElement(),c);this.la=this.Ca=this.ab=this.Na=null;this.cb=!1;this.lb=null}e=Id.prototype;
e.open=function(a){var b=this;a=void 0===a?!1:a;var c=this.s;if(c.isConnected())throw Error("already opened");this.j.getBody().appendChild(c.getElement());this.ca.attach();a?(w(c.getElement(),{visibility:"hidden",opacity:0}),this.cb=a):Jd(this);return c.whenReady().then(function(){var d=b.s.getBody(),f=b.s.getDocument();ab(Fd(f),"body{margin:0;padding:0}swg-container,swg-loading,swg-loading-animate,swg-loading-image{display:block}swg-loading-container{-ms-flex-align:center!important;-ms-flex-pack:center!important;align-items:center!important;bottom:0!important;display:-ms-flexbox!important;display:flex!important;height:100%!important;justify-content:center!important;margin-top:5px!important;min-height:148px!important;width:100%!important;z-index:2147483647!important}@media (min-height:630px),(min-width:630px){swg-loading-container{background-color:#fff!important;border-top-left-radius:8px!important;border-top-right-radius:8px!important;box-shadow:0 1px 1px rgba(60,64,67,.3),0 1px 4px 1px rgba(60,64,67,.15)!important;margin-left:35px!important;width:560px!important}}swg-loading{animation:mspin-rotate 1568.63ms linear infinite;height:36px;overflow:hidden;width:36px;z-index:2147483647!important}swg-loading-animate{animation:mspin-revrot 5332ms steps(4) infinite}swg-loading-image{animation:swg-loading-film 5332ms steps(324) infinite;background-image:url(https://news.google.com/swg/js/v1/loader.svg);background-size:100%;height:36px;width:11664px}@keyframes swg-loading-film{0%{transform:translateX(0)}to{transform:translateX(-11664px)}}@keyframes mspin-rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes mspin-revrot{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}\n/*# sourceURL=/./src/ui/ui.css*/");
b.Na=new Ad(f);d.appendChild(b.Na.getElement());b.ab=x(f,"swg-container",{});d.appendChild(b.ab);w(b.getElement(),{bottom:0});return b})};e.close=function(a){var b=this;return(void 0===a||a?this.ka(function(){b.ca.hide(!0);return P(b.getElement(),{transform:"translateY(100%)"},300)}):Promise.resolve()).then(function(){var c=b.s.getElement();c.parentNode.removeChild(c);b.j.getRootElement().style.removeProperty("padding-bottom");b.ca.destroy()})};
e.getContainer=function(){if(!this.ab)throw Error("not opened yet");return this.ab};e.getIframe=function(){return this.s};e.getElement=function(){return this.s.getElement()};e.getLoadingView=function(){return this.Na};e.getCurrentView=function(){return this.Ca};
e.openView=function(a){var b=this;w(a.getElement(),Hd);this.Ca&&this.Ca.hasLoadingIndicator()?this.lb=this.Ca:(this.getContainer().textContent="",this.Na.show());this.Ca=a;this.getContainer().appendChild(a.getElement());a.shouldFadeBody()&&!this.cb&&this.ca.show(!0);return a.init(this).then(function(){w(a.getElement(),{opacity:1});b.cb&&(a.shouldFadeBody()&&b.ca.show(!0),Jd(b));if(b.lb){var c=b.lb.getElement();c.parentElement&&c.parentElement.removeChild(c);b.lb=null}else b.Na.hide()})};
function Jd(a){a.ka(function(){w(a.getElement(),{transform:"translateY(100%)",opactiy:1,visibility:"visible"});return P(a.getElement(),{transform:"translateY(0)",opacity:1,visibility:"visible"},300)});a.cb=!1}
e.resizeView=function(a,b,c){var d=this;c=void 0===c?!0:c;if(this.Ca!=a)return null;var f=Math.min(b,.9*this.j.getWin().innerHeight);if(c){var g=this.getElement().offsetHeight;c=f>=g?this.ka(function(){w(d.getElement(),{height:f+"px",transform:"translateY("+(f-g)+"px)"});return P(d.getElement(),{transform:"translateY(0)"},300)}):this.ka(function(){return P(d.getElement(),{transform:"translateY("+(g-f)+"px)"},300).then(function(){w(d.getElement(),{height:f+"px",transform:"translateY(0)"})})})}else w(this.getElement(),
{height:f+"px"}),c=Promise.resolve();return c.then(function(){var h=b+20,k=d.j.getRootElement();w(k,{"padding-bottom":h+"px"});a.resized()})};e.ka=function(a){var b=this;return this.la=(this.la||Promise.resolve()).then(function(){return a()},function(){}).then(function(){b.la=null})};function Kd(a){var b=this;this.j=a;this.ea=this.ba=null;this.sa=new zd(a,2147483647);this.ib=null;this.sa.getElement().addEventListener("click",function(){if(b.ib)try{b.ib.focus()}catch(c){}})}e=Kd.prototype;e.openDialog=function(a){a=void 0===a?!1:a;this.ea||(this.ba=new Id(this.j),this.ea=this.ba.open(a));return this.ea};e.openView=function(a,b){b=void 0===b?!1:b;this.handleCancellations(a);return this.openDialog(b).then(function(c){return c.openView(a)})};
e.handleCancellations=function(a){var b=this;return a.whenComplete().catch(function(c){y(c)&&b.completeView(a);throw c;})};e.completeView=function(a){var b=this;setTimeout(function(){b.ba&&b.ba.getCurrentView()==a&&b.wa()},100)};e.completeAll=function(){this.ba&&this.wa();this.sa.isAttached()&&this.sa.destroy()};e.getDialog=function(){return this.ba};e.wa=function(){this.ba.close();this.ea=this.ba=null};e.popupOpened=function(a){this.ib=a||null;this.sa.isAttached()||this.sa.attach();this.sa.show()};
e.popupClosed=function(){this.ib=null;try{this.sa.hide()}catch(a){}};function Ld(a){var b=this;this.h=a;this.g=a.win();this.m=a.activities();this.o=a.dialogManager();var c=this.m.addDefaultArguments({isClosable:!0,hasSubscriptionCallback:a.callbacks().hasSubscribeRequestCallback()});this.l=new z(this.g,this.m,K("/metertoastiframe"),c,!1);this.Pa=null;this.Oa=!1;this.ta=function(){var d=new Yb;d.setClose(!0);b.l.execute(d);b.removeCloseEventListener();b.h.eventManager().logSwgEvent(1027,!0);b.Pa&&!b.Oa&&(b.Oa=!0,b.Pa())};this.wc=null}
Ld.prototype.start=function(){var a=this;this.h.callbacks().triggerFlowStarted("showMeterToast");this.l.on(I,this.Cc.bind(this));this.h.callbacks().hasSubscribeRequestCallback()||u("[swg.js]: `setOnNativeSubscribeRequest` has not been set before starting the metering flow, so users will not be able to subscribe from the metering dialog directly. Please call `setOnNativeSubscribeRequest` with a subscription flow callback before starting metering.");this.o.handleCancellations(this.l).catch(function(b){a.Pa&&
!a.Oa&&(a.Oa=!0,a.Pa());if(!y(b))throw console.error("[swg.js]: Error occurred during meter toast handling: "+b),b;});return this.o.openDialog().then(function(b){Md(a);Nd(a);return b.openView(a.l).then(function(){a.g.addEventListener("click",a.ta);a.g.addEventListener("touchstart",a.ta);a.g.addEventListener("mousedown",a.ta);if(Od(a))Ya(a.g.document.body,"overflow","hidden");else{var c,d;a.wc=function(){c=c||a.g.pageYOffset;a.g.clearTimeout(d);d=a.g.setTimeout(function(){100<Math.abs(a.g.pageYOffset-
c)&&a.ta()},100)};a.g.addEventListener("scroll",a.wc)}a.h.eventManager().logSwgEvent(21);a.h.eventManager().logSwgEvent(3011)})})};Ld.prototype.setOnConsumeCallback=function(a){this.Pa=a};Ld.prototype.removeCloseEventListener=function(){this.g.removeEventListener("click",this.ta);this.g.removeEventListener("touchstart",this.ta);this.g.removeEventListener("mousedown",this.ta);Od(this)?Ya(this.g.document.body,"overflow","visible"):this.g.removeEventListener("scroll",this.wc)};
function Md(a){var b=a.g.matchMedia("(max-width: 640px), (max-height: 640px)"),c=a.o.getDialog().getElement();b.matches&&w(c,{"box-shadow":"rgba(60, 64, 67, 0.3) 0px -2px 5px, rgba(60, 64, 67, 0.15) 0px -5px 5px"});b.addListener(function(d){d.matches?w(c,{"box-shadow":"rgba(60, 64, 67, 0.3) 0px -2px 5px, rgba(60, 64, 67, 0.15) 0px -5px 5px"}):w(c,{"box-shadow":""})})}
function Nd(a){a.g.matchMedia("(min-width: 640px) and (min-height: 640px)").matches&&(a=a.o.getDialog().getLoadingView().getElement(),w(a,{width:"420px",margin:"auto"}))}Ld.prototype.Cc=function(a){a.getNative()&&(this.removeCloseEventListener(),this.Oa=!0,this.h.callbacks().triggerSubscribeRequest())};function Od(a){return!!a.g.navigator.userAgent.match(/Android|iPhone|iPad|iPod|BlackBerry|IEMobile/i)};var Pd={height:0},Qd={frameborder:"0",scrolling:"no","class":"swg-toast"};function Rd(a,b,c){var d=this;this.j=a.doc();this.m=a.activities();this.Ua=b;this.T=c||{};this.la=null;this.s=x(this.j.getWin().document,"iframe",Qd);w(this.s,Pd);this.pb=new Promise(function(f){d.s.onload=f})}Rd.prototype.getElement=function(){return this.s};Rd.prototype.open=function(){this.j.getBody().appendChild(this.s);return Sd(this)};
function Sd(a){return a.m.openIframe(a.s,a.Ua,a.T).then(function(b){return b.whenReady()}).then(function(){$a(a.s);a.ka(function(){w(a.s,{transform:"translateY(100%)",opactiy:1,visibility:"visible"});return P(a.s,{transform:"translateY(0)",opacity:1,visibility:"visible"},400)});a.j.getWin().setTimeout(function(){a.close()},8E3)})}Rd.prototype.ka=function(a){var b=this;return this.la=(this.la||Promise.resolve()).then(function(){return a()}).catch(function(){}).then(function(){b.la=null})};
Rd.prototype.close=function(){var a=this;return this.ka(function(){a.j.getWin().setTimeout(function(){a.j.getBody().removeChild(a.s);return Promise.resolve()},500);return P(a.s,{transform:"translateY(100%)",opacity:1,visibility:"visible"},400)})};var Q={},Td=(Q.paywall=1,Q.ad_shown=2,Q.offers_shown=3,Q.subscriptions_landing_page=1004,Q.offer_selected=1006,Q.payment_flow_start=1005,Q.payment_complete=1001,Q.custom=3E3,Q),R={},Ud=(R[0]=null,R[1]="paywall",R[2]="ad_shown",R[3]="offers_shown",R[4]=null,R[5]=null,R[1E3]=null,R[1001]="payment_complete",R[1002]=null,R[1003]=null,R[1004]="subscriptions_landing_page",R[1005]="payment_flow_start",R[1006]="offer_selected",R[2E3]=null,R[3E3]="custom",R),S={},Vd=(S.EVENT_SHOWCASE_METER_OFFERED=[3010,3011],
S.EVENT_SHOWCASE_UNLOCKED_BY_SUBSCRIPTION=[3007],S.EVENT_SHOWCASE_UNLOCKED_BY_METER=[3010,3008],S.EVENT_SHOWCASE_UNLOCKED_FREE_PAGE=[3012],S.EVENT_SHOWCASE_NO_ENTITLEMENTS_REGWALL=[3009,22,23],S.EVENT_SHOWCASE_NO_ENTITLEMENTS_PAYWALL=[3009,1],S.EVENT_SHOWCASE_INELIGIBLE_PAYWALL=[1],S),Wd={},Xd=(Wd[22]=2001,Wd[3008]=1003,Wd[3007]=1001,Wd[3012]=1002,Wd[1]=2002,Wd);function T(a,b,c,d){return{eventCategory:a,eventAction:b,eventLabel:c,nonInteraction:d}}
var U={},Yd=(U[3]=T("NTG paywall","paywall modal impression","",!0),U[26]=T("NTG membership","offer impressions","",!0),U[1006]=T("NTG paywall","click","",!1),U[1030]=T("NTG subscription","marketing modal click","",!1),U[24]=T("NTG subscription","marketing modal impression","",!0),U[1031]=T("NTG membership","marketing modal click","",!1),U[25]=T("NTG membership","membership modal impression","",!0),U),Zd={},$d=(Zd[1001]=T("NTG subscription","submit","success",!1),Zd),ae={},be=(ae[1001]=T("NTG membership",
"submit","success",!1),ae);function ce(a){a=tc(a);if(!(a.gaa_at&&a.gaa_n&&a.gaa_sig&&a.gaa_ts)||"na"===a.gaa_at)return!1;var b=parseInt(a.gaa_ts,16),c=Date.now()/1E3;return b<c?!1:!0};function de(a,b,c,d){this.g=a;this.P=b;this.K=this.P.getPublicationId();this.D=c;this.h=d;this.Zc=new cc;this.L=null;this.za=0;this.Ya=!1;this.bb=null;this.F=d.storage();this.W=d.analytics();this.U=d.config();this.h.eventManager().registerEventListener(this.Nd.bind(this))}e=de.prototype;e.reset=function(a){this.L=null;this.za=Math.max(this.za,a?3:0);a&&(this.F.remove("ents"),this.F.remove("isreadytopay"))};
e.clear=function(){this.L=null;this.za=0;this.unblockNextNotification();this.F.remove("ents");this.F.remove("toast");this.F.remove("isreadytopay")};
e.getEntitlements=function(a){var b=this;"string"===typeof a&&(1600289016959<Date.now()&&u("[swg.js:getEntitlements]: If present, the first param of getEntitlements() should be an object of type GetEntitlementsParamsExternalDef."),a={encryption:{encryptedDocumentKey:a}});this.L||(this.L=ee(this,a));return this.L.then(function(c){null!=c.isReadyToPay&&b.W.setReadyToPay(c.isReadyToPay);return c})};
e.pushNextEntitlements=function(a,b){return(b=fe(this,a,!0,b))&&b.enablesThis()?(this.F.set("ents",a),!0):!1};e.Nd=function(a){if(ce(this.g.location.search)){var b=Xd[a.eventType];if(b){switch(a.eventOriginator){case 6:var c=3001;break;case 1:case 4:if(1003==b)return;c=1001;break;default:return}var d=tc(this.g.location.search).gaa_n,f,g,h=null==a?void 0:null==(f=a.additionalParameters)?void 0:null==(g=f.getIsUserRegistered)?void 0:g.call(f);ge(this,new Rb,b,c,d,h)}}};
function ge(a,b,c,d,f,g){f=void 0===f?"":f;g=void 0===g?null:g;var h=new Sb;h.setUsedEntitlement(b);var k=h.setClientEventTime;var l=Date.now();l=new Tb([Math.floor(l/1E3),l%1E3*1E6],!1);k.call(h,l);h.setEntitlementResult(c);h.setEntitlementSource(d);h.setToken(f);"boolean"===typeof g&&h.setIsUserRegistered(g);k="/publication/"+encodeURIComponent(a.K)+"/entitlements";a.bb&&(k=J(k,"encodedParams",a.bb));a.D.sendPost(Ac(k),h)}
function ee(a,b){return he(a,b).then(function(c){var d=a.Ya;a.Ya=!1;d||(a.h.callbacks().triggerEntitlementsResponse(Promise.resolve(c)),(d=c.getEntitlementForThis())?ie(a,d):a.h.eventManager().logSwgEvent(3009,!1));return c})}
function he(a,b){return Promise.all([a.F.get("ents"),a.F.get("isreadytopay")]).then(function(c){var d=c[0],f=c[1],g=!(!b||!b.encryption);if(d&&!g){var h=fe;a:{switch(f){case "true":var k=!0;break a;case "false":k=!1;break a}k=void 0}var l=h(a,d,!0,k);if(l&&l.enablesThis())return a.za=0,l}return je(a,b).then(function(m){m&&m.enablesThisWithCacheableEntitlements()&&m.raw&&a.F.set("ents",m.raw);return m})})}
function je(a,b){function c(){d--;return a.na(b).then(function(f){return f.enablesThis()||0>=d?f:new Promise(function(g){a.g.setTimeout(function(){g(c())},550)})})}var d=a.za;a.za=0;return c()}e.setToastShown=function(a){this.F.set("toast",a?"1":"0")};e.blockNextNotification=function(){this.Ya=!0};e.unblockNextNotification=function(){this.Ya=!1};
e.parseEntitlements=function(a){var b=a.isReadyToPay;null==b?this.F.remove("isreadytopay"):this.F.set("isreadytopay",String(b));var c=a.signedEntitlements,d=a.decryptedDocumentKey,f=a.swgUserToken;if(c){if(a=fe(this,c,!1,b,d))return f&&this.F.set("USER_TOKEN",f,!0),a}else{var g=a.entitlements;if(g)return f&&this.F.set("USER_TOKEN",f,!0),ke(this,"",g,b,d)}return ke(this,"",[],b)};
function fe(a,b,c,d,f){try{var g=a.Zc.decode(b);if(c){var h=Date.now();if(1E3*parseFloat(g.exp)<h)return null}var k=g.entitlements;return k&&ke(a,b,k,d,f)||null}catch(l){a.g.setTimeout(function(){throw l;})}return null}function ke(a,b,c,d,f){return new fc("subscribe.google.com",b,hc(c),a.P.getProductId(),a.nd.bind(a),a.ud.bind(a),d,f)}
function ie(a,b){"google:metering"===b.source?(a.h.eventManager().logSwgEvent(3010,!1),Promise.resolve()):(a.h.eventManager().logSwgEvent(3007,!1),a.F.get("toast").then(function(c){if("1"!==c)return c=b.source||"google:metering",(new Rd(a.h,K("/toastiframe"),L({publicationId:a.K,source:c}))).open()}))}e.nd=function(a){a.getEntitlementForThis()&&this.setToastShown(!0)};
e.ud=function(a,b){var c=this;if(a.enablesThisWithGoogleMetering()){var d=function(){b&&b();var g=a.getEntitlementForThis();if(g&&"google:metering"===g.source&&ce(c.g.location.search)){c.h.eventManager().logSwgEvent(3008,!1);var h=tc(c.g.location.search).gaa_n,k=new Rb;k.setSource(g.source);k.setJwt(g.subscriptionToken);ge(c,k,1003,2001,h)}};if(!1===le(this,a))return d();var f=new Ld(this.h);f.setOnConsumeCallback(d);return f.start()}};
function le(a,b){if((b=b.getEntitlementForThis())&&"google:metering"===b.source)try{var c=a.Zc.decode(b.subscriptionToken);return c.metering&&c.metering.showToast}catch(d){}}
e.na=function(a){var b=this,c,d=null==a?void 0:null==(c=a.encryption)?void 0:c.swgUserToken,f=d?Promise.resolve(d):this.F.get("USER_TOKEN",!0),g="/publication/"+encodeURIComponent(this.K)+"/entitlements";return Promise.all([Ta(uc(this.h.doc())),f]).then(function(h){var k=h[0];h=h[1];if(null==a?0:a.encryption)g=J(g,"crypt",a.encryption.encryptedDocumentKey);h&&(g=J(g,"sut",h));var l;if(b.K&&(null==a?0:null==(l=a.metering)?0:l.state)){var m=a.metering.state.id;if("string"===typeof m&&0<m.length){var r=
function(E){var B=E.attributes,D=E.category;B&&Object.keys(B).forEach(function(W){var qa=D+"_"+W,ec=Number(B[W].timestamp),Nf=ec>Date.now()/1E3*2;ec&&!Nf||u('SwG Entitlements: Please specify a Unix timestamp, in seconds, for the "'+W+'" '+D+" attribute. The timestamp you passed ("+B[W].timestamp+") looks invalid.");q.metering.state.attributes.push({name:qa,timestamp:ec})})},q={metering:{clientTypes:[1],owner:b.K,resource:{hashedCanonicalUrl:k},state:{id:m,attributes:[]}}};r({attributes:a.metering.state.standardAttributes,
category:"standard"});r({attributes:a.metering.state.customAttributes,category:"custom"});b.bb=Ra(Pa(JSON.stringify(q)));g=J(g,"encodedParams",b.bb)}else u("SwG Entitlements: Please specify a metering state ID string, ideally a hash to avoid PII.")}return Ac(g)}).then(function(h){b.h.eventManager().logSwgEvent(1024,!1);return b.D.fetchCredentialedJson(h)}).then(function(h){h.errorMessages&&0<h.errorMessages.length&&h.errorMessages.forEach(function(k){u("SwG Entitlements: "+k)});return b.parseEntitlements(h)})};var me=["GET","POST"],ne={document:1,text:2};function oe(a){this.win=a}oe.prototype.na=function(a,b){v("string"==typeof a,"Only URL supported: %s",a);var c=b.credentials;v(void 0===c||"include"==c||"omit"==c,"Only credentials=include|omit support: %s",c);return"document"==b.responseType?pe(a,b):(this.win.fetch||pe).apply(null,arguments)};
oe.prototype.fetch=function(a,b){b=qe(b);return this.na(a,b).catch(function(c){var d=sc(a).origin;throw Error("XHR Failed fetching ("+d+"/...): (Note: a CORS error above may indicate that this domain is not configured for Subscribe with Google)",c&&c.message);}).then(function(c){return re(c)})};
function qe(a){var b=a=a||{};var c=a.method;void 0===c?c="GET":(c=c.toUpperCase(),v(me.includes(c),"Only one of %s is currently allowed. Got %s",me.join(", "),c));b.method=c;a.headers=a.headers||{};return a}
function pe(a,b){return new Promise(function(c,d){var f=se(b.method||"GET",a);"include"==b.credentials&&(f.withCredentials=!0);b.responseType in ne&&(f.responseType=b.responseType);b.headers&&Object.keys(b.headers).forEach(function(g){f.setRequestHeader(g,b.headers[g])});f.onreadystatechange=function(){2>f.readyState||(100>f.status||599<f.status?(f.onreadystatechange=null,d(Error("Unknown HTTP status "+f.status))):4==f.readyState&&c(new te(f)))};f.onerror=function(){d(Error("Network failure"))};f.onabort=
function(){d(Error("Request aborted"))};"POST"==b.method?f.send(b.body):f.send()})}function se(a,b){var c=new XMLHttpRequest;if("withCredentials"in c)c.open(a,b,!0);else throw Error("CORS is not supported");return c}function re(a){return new Promise(function(b){if(a.ok)return b(a);b=a.status;var c=Error("HTTP error "+b);c.retriable=415==b||500<=b&&600>b;c.response=a;throw c;})}
function te(a){this.ia=a;this.status=this.ia.status;this.ok=200<=this.status&&300>this.status;this.headers=new ue(a);this.bodyUsed=!1;this.body=null}te.prototype.clone=function(){v(!this.bodyUsed,"Body already used");return new te(this.ia)};function ve(a){v(!a.bodyUsed,"Body already used");a.bodyUsed=!0;return Promise.resolve(a.ia.responseText)}te.prototype.text=function(){return ve(this)};te.prototype.json=function(){return ve(this).then($b)};te.prototype.arrayBuffer=function(){return ve(this).then(Pa)};
function ue(a){this.ia=a}ue.prototype.get=function(a){return this.ia.getResponseHeader(a)};ue.prototype.has=function(a){return null!=this.ia.getResponseHeader(a)};function we(a){this.ia=new oe(a)}we.prototype.fetchCredentialedJson=function(a){return this.fetch(a,{method:"GET",headers:{Accept:"text/plain, application/json"},credentials:"include"}).then(function(b){return b.text().then(function(c){var d=c.replace(/^(\)\]\}'\n)/,"");return $b(d)})})};
we.prototype.sendPost=function(a,b){b={method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},credentials:"include",body:"f.req="+JSON.stringify(b.toArray(!1))};return this.fetch(a,b).then(function(c){return c&&c.json()||{}})};we.prototype.fetch=function(a,b){return this.ia.fetch(a,b)};
we.prototype.sendBeacon=function(a,b){navigator.sendBeacon?(b=new Blob(["f.req="+JSON.stringify(b.toArray(!1))],{type:"application/x-www-form-urlencoded;charset=UTF-8"}),navigator.sendBeacon(a,b)):this.sendPost(a,b)};function xe(a){this.g=a.win();this.u=a.eventManager()}xe.prototype.start=function(){this.u.registerEventListener(this.Ja.bind(this))};xe.prototype.Ja=function(a){if("function"==typeof this.g.ga){var b="";a.additionalParameters&&(b=a.additionalParameters.subscriptionFlow||a.additionalParameters.getSubscriptionFlow());a=a.eventType;var c=null;b&&("subscribe"==b?c=$d[a]:"contribute"==b&&(c=be[a]));(b=c||Yd[a])&&this.g.ga("send","event",b)}};function ye(a){this.j=a;this.Hd=Promise.resolve()}ye.prototype.error=function(a){var b=this,c=Array.prototype.slice.call(arguments,0);return this.Hd.then(function(){var d=ze.apply(null,c);d.reported||(b.j.getWin().document.createElement("img").src="https://news.google.com/_/SubscribewithgoogleClientUi/jserror?error="+encodeURIComponent(String(d))+"&script="+encodeURIComponent("https://news.google.com/swg/js/v1/swg.js")+"&line="+(d.lineNumber||1)+"&trace="+encodeURIComponent(d.stack),d.reported=!0)})};
function ze(a){for(var b=null,c="",d=0;d<arguments.length;d++){var f=arguments[d];if(f instanceof Error&&!b){b=void 0;var g=Object.getOwnPropertyDescriptor(f,"message");if(g&&g.writable)b=f;else{g=f.stack;var h=Error(f.message);for(b in f)h[b]=f[b];h.stack=g;b=h}}else c&&(c+=" "),c+=f}b?c&&(b.message=c+": "+b.message):b=Error(c);return b};function Ae(a){this.h=a;this.m=a.activities();this.P=a.pageConfig();this.o=a.dialogManager()}
Ae.prototype.start=function(a){a=void 0===a?{}:a;this.h.callbacks().triggerFlowStarted("linkAccount");var b="redirect"==this.h.config().windowOpenMode;a=a.ampReaderId?L({publicationId:this.P.getPublicationId(),ampReaderId:a.ampReaderId}):L({publicationId:this.P.getPublicationId()});var c=this.m.open("swg-link",K("/linkbackstart"),b?"_top":"_blank",a,{});this.h.eventManager().logSwgEvent(12);this.o.popupOpened(c&&c.targetWin);return Promise.resolve()};
function Be(a,b){var c=this;this.h=a;this.g=a.win();this.m=a.activities();this.o=a.dialogManager();this.Z=a.entitlementsManager();this.C=a.callbacks();this.l=new z(this.g,this.m,K("/linkconfirmiframe","/u/"+(b&&b.index||"0")),L({productId:a.pageConfig().getProductId(),publicationId:a.pageConfig().getPublicationId()}),!0);this.Tc=null;this.rd=new Promise(function(d){c.Tc=d})}
function Ce(a){a.activities().onResult("swg-link",function(b){a.entitlementsManager().blockNextNotification();a.callbacks().triggerLinkProgress();a.dialogManager().popupClosed();return Ha(b,zc(),!1,!1).then(function(c){a.eventManager().logSwgEvent(1011,!0);(new Be(a,c)).start()},function(c){y(c)?(a.eventManager().logSwgEvent(1012,!0),a.callbacks().triggerFlowCanceled("linkAccount")):a.eventManager().logSwgEvent(1011,!0)})})}
Be.prototype.start=function(){var a=this;this.l.acceptResultAndVerify(zc(),!0,!0).then(function(b){a.O(b)}).catch(function(b){setTimeout(function(){throw b;})}).then(function(){a.o.completeView(a.l)});this.h.eventManager().logSwgEvent(3005,!0);this.h.eventManager().logSwgEvent(14,!0);return this.o.openView(this.l)};
Be.prototype.O=function(a){this.h.eventManager().logSwgEvent(1013,!0);this.C.triggerLinkComplete();this.C.resetLinkProgress();this.Z.setToastShown(!0);this.Z.unblockNextNotification();this.Z.reset(a&&a.success||!1);a&&a.entitlements&&this.Z.pushNextEntitlements(a.entitlements);this.Tc()};Be.prototype.whenComplete=function(){return this.rd};function De(a,b){this.g=a.win();this.h=a;this.m=a.activities();this.o=a.dialogManager();this.S=b;this.l=this.ea=this.ld=null}De.prototype.getRequestPromise=function(){return this.ld};
De.prototype.O=function(){this.o.completeView(this.l)};function Ee(a,b){a.O();var c=null;if(b.linked){a.o.popupClosed();a.h.callbacks().triggerFlowStarted("linkAccount");c=new Be(a.h,b);var d=c.start()}else d=Promise.reject(cb(a.g,"not linked"));return d.then(function(){a.h.callbacks().triggerLinkProgress();return c.whenComplete()}).then(function(){return!0})}
De.prototype.Sd=function(a){var b=this;a&&a.getRequested()&&(this.ld=(new Promise(function(c){return c(b.S())})).then(function(c){var d=new Wb;if(c&&c.token){if(c.authCode)throw Error("Both authCode and token are available");d.setToken(c.token)}else if(c&&c.authCode)d.setAuthCode(c.authCode);else throw Error("Neither token or authCode is available");b.l.execute(d);return c}).catch(function(c){b.O();throw c;}))};
De.prototype.start=function(){var a=this,b=this.m.addDefaultArguments({isClosable:!0});this.l=new z(this.g,this.m,K("/linksaveiframe"),b,!1,!0);this.l.on(F,this.Sd.bind(this));this.ea=this.o.openView(this.l,!0);this.h.eventManager().logSwgEvent(13);return this.l.acceptResultAndVerify(zc(),!0,!0).then(function(c){return Ee(a,c)}).catch(function(c){a.O();if(y(c))return a.h.eventManager().logSwgEvent(1016,!0),a.h.callbacks().triggerFlowCanceled("linkAccount"),!1;throw c;})};function Fe(a){this.u=a.eventManager()}Fe.prototype.sendSubscriptionState=function(a,b){if(!Rc(mc,a))throw Error("Invalid subscription state provided");if(("subscriber"==a||"past_subscriber"==a)&&!b)throw Error("Entitlements must be provided for users with active or expired subscriptions");if(b&&!M(b))throw Error("Entitlements must be an Object");var c=null;b&&(c=JSON.stringify(b));this.u.logEvent({eventType:4E3,eventOriginator:5,isFromUserAction:null,additionalParameters:{state:a,productsOrSkus:c}})};
Fe.prototype.sendEvent=function(a){var b=null;if(!Rc(nc,a.name)||!Td[a.name])throw Error("Invalid user event provided("+a.name+")");if(a.data)if(M(a.data))b=Object.assign({},b,a.data);else throw Error("Event data must be an Object("+a.data+")");if(Sc(a.active))b||(b={}),Object.assign(b,{is_active:a.active});else if(null!=a.active)throw Error("Event active must be a boolean");this.u.logEvent({eventType:Td[a.name],eventOriginator:5,isFromUserAction:a.active,additionalParameters:b})};function Ge(a){this.h=a;this.g=a.win();this.m=a.activities();this.o=a.dialogManager();this.Qa=null;this.l=new z(this.g,this.m,K("/loginiframe"),L({publicationId:a.pageConfig().getPublicationId(),productId:a.pageConfig().getProductId(),userConsent:!1}),!0)}
Ge.prototype.start=function(){var a=this;this.h.callbacks().triggerFlowStarted("showLoginNotification");this.Qa=this.o.openView(this.l);return this.l.acceptResult().then(function(){a.o.completeView(a.l)},function(b){a.o.completeView(a.l);throw b;})};function He(a){this.h=a;this.g=a.win();this.m=a.activities();this.o=a.dialogManager();this.Qa=null;this.l=new z(this.g,this.m,K("/loginiframe"),L({publicationId:a.pageConfig().getPublicationId(),productId:a.pageConfig().getProductId(),userConsent:!0}),!0)}
He.prototype.start=function(){var a=this;this.h.callbacks().triggerFlowStarted("showLoginPrompt");this.Qa=this.o.openView(this.l);return this.l.acceptResult().then(function(){a.o.completeView(a.l)},function(b){y(b)?a.h.callbacks().triggerFlowCanceled("showLoginPrompt"):a.o.completeView(a.l);throw b;})};function Ie(a,b){this.U=a;this.D=b}Ie.prototype.getOffers=function(a){a=void 0===a?this.U.getProductId():a;if(!a)throw Error("getOffers requires productId in config or arguments");return this.na(a)};Ie.prototype.na=function(a){a=Ac("/publication/"+encodeURIComponent(this.U.getPublicationId())+"/offers?label="+encodeURIComponent(a));return this.D.fetchCredentialedJson(a).then(function(b){return b.offers||[]})};function Je(a){for(var b=null,c="",d=0;d<arguments.length;d++){var f=arguments[d];if(f instanceof Error&&!b){b=void 0;var g=Object.getOwnPropertyDescriptor(f,"message");if(g&&g.writable)b=f;else{g=f.stack;var h=Error(f.message);for(b in f)h[b]=f[b];h.stack=g;b=h}}else c&&(c+=" "),c+=f}b?c&&(b.message=c+": "+b.message):b=Error(c);return b}function Ke(a){this.tb=a=void 0===a?"":a}function Le(a,b){a.tb&&(b.message?-1===b.message.indexOf(a.tb)&&(b.message=a.tb):b.message=a.tb)}
Ke.prototype.createError=function(a){var b=Je.apply(null,Array.prototype.slice.call(arguments));Le(this,b);return b};Ke.prototype.createExpectedError=function(a){var b=Je.apply(null,Array.prototype.slice.call(arguments));Le(this,b);b.expected=!0;return b};Ke.prototype.error=function(a){throw this.createError.apply(this,arguments);};Ke.prototype.expectedError=function(a){throw this.createExpectedError.apply(this,arguments);};var Me=new Ke(self.__AMP_TOP?"\u200b\u200b\u200b":"");new Ke;function V(a,b){var c=a.indexOf(":");if(-1!=c){var d=a;a=d.substring(0,c);var f=d.substring(c+1);"*"==f&&Me.expectedError("wildcard disallowed")}else f=d=null;this.K=a;this.Aa=d;this.La=f;this.Ed=b}V.prototype.getPublicationId=function(){return this.K};V.prototype.getProductId=function(){return this.Aa};V.prototype.getLabel=function(){return this.La};V.prototype.isLocked=function(){return this.Ed};var Ne="CreativeWork Article NewsArticle Blog Comment Course HowTo Message Review WebPage".split(" "),Oe=new RegExp(Ne.join("|"));function Pe(a){var b=this;this.j=Fd(a);this.xa=null;this.sd=new Promise(function(c){b.xa=c});this.Gd=new Qe(this.j);this.Dd=new Re(this.j);this.Id=new Se(this.j)}Pe.prototype.resolveConfig=function(){Promise.resolve().then(this.check.bind(this));this.j.whenReady().then(this.check.bind(this));return this.sd};
Pe.prototype.check=function(){if(!this.xa)return null;var a=this.Gd.check();a||(a=this.Dd.check());a||(a=this.Id.check());a?(this.xa(a),this.xa=null):this.j.isReady()&&(this.xa(Promise.reject(Me.createError("No config could be discovered in the page"))),this.xa=null);Ia(a);return a};function Te(){}Te.prototype.checkValue=function(a,b){if(a){var c=this.checkArray;a=Array.isArray(a)?a:[a];c=c.call(this,a,b)}else c=!1;return c};
Te.prototype.checkString=function(a,b){return a?this.checkArray(a.split(/\s+/),b):!1};Te.prototype.checkArray=function(a,b){var c=!1;a.forEach(function(d){c=c||b.includes(d.replace(/^http:\/\/schema.org\//i,""))});return c};function Qe(a){this.j=a}
Qe.prototype.check=function(){if(!this.j.getBody())return null;var a=Ue(this.j.getRootNode(),"subscriptions-product-id");if(!a)return null;var b=Ue(this.j.getRootNode(),"subscriptions-accessible-for-free"),c=!(!b||"false"!==b.toLowerCase());return new V(a,c)};function Re(a){this.j=a;this.Ea=new Te}
Re.prototype.check=function(){if(!this.j.getBody())return null;for(var a=this.j.isReady(),b=this.j.getRootNode().querySelectorAll('script[type="application/ld+json"]'),c=0;c<b.length;c++){var d=b[c],f;if((f=!d["__SWG-SEEN__"]&&d.textContent)&&!(f=a))a:{f=d;do if(f.nextSibling){f=!0;break a}while((f=f.parentNode)&&void 0!=f);f=!1}if(f&&(d["__SWG-SEEN__"]=!0,Oe.test(d.textContent))){var g=this.Kc(d);if(g)return g}}return null};
Re.prototype.Kc=function(a){var b=ac(a.textContent);if(!b)return null;Array.isArray(b)||(b=[b]);for(var c=b,d=0;d<c.length;d++){var f=c[d];if(this.Ea.checkValue(f["@type"],Ne)){a=null;var g=Ve(f,"isPartOf");if(g)for(var h=0;h<g.length&&!(a=this.Gb(g[h]));h++);if(a)return d=We(f,"isAccessibleForFree"),d=null==d||""===d?!0:"boolean"==typeof d?d:"string"==typeof d&&"false"==d.toLowerCase()?!1:!0,new V(a,!d)}}return null};
Re.prototype.Gb=function(a){return this.Ea.checkValue(a["@type"],["Product"])?We(a,"productID"):null};function Ve(a,b){a=a[b];return null==a||""===a?null:Array.isArray(a)?a:[a]}function We(a,b){var c=Ve(a,b);a=c&&c[0];return null==a||""===a?null:a}function Se(a){this.j=a;this.Aa=this.Xa=null;this.Ea=new Te}
function Xe(a,b){var c=b.querySelectorAll("[itemprop='isAccessibleForFree']");for(b=0;c[b];b++){var d=c[b],f=d.getAttribute("content")||d.textContent;if(f&&Ye(a,d,"alreadySeenForAccessInfo")){var g=null;"true"==f.toLowerCase()?g=!0:"false"==f.toLowerCase()&&(g=!1);return g}}return null}function Ye(a,b,c){for(var d=b;d&&!d[c];d=d.parentNode)if(d[c]=!0,d.hasAttribute&&d.hasAttribute("itemscope"))return d=d.getAttribute("itemtype"),a.Ea.checkString(d,Ne);return!1}
Se.prototype.Gb=function(a){a=a.querySelectorAll('[itemprop="productID"]');for(var b=0;a[b];b++){var c=a[b],d=c.getAttribute("content")||c.textContent;c=c.closest("[itemtype][itemscope]");if(!(-1>=c.getAttribute("itemtype").indexOf("http://schema.org/Product"))&&Ye(this,c.parentElement,"alreadySeenForProductInfo"))return d}return null};function Ze(a){var b=null;null!=a.Xa?b=!a.Xa:a.j.isReady()&&(b=!1);return null!=a.Aa&&null!=b?new V(a.Aa,b):null}
Se.prototype.Kc=function(){var a=this,b=Ze(this);if(b)return b;for(var c=Array.prototype.slice.call(this.j.getRootNode().querySelectorAll("[itemscope][itemtype]")).filter(function(f){return a.Ea.checkString(f.getAttribute("itemtype"),Ne)}),d=0;c[d]&&null==b;d++)b=c[d],null==this.Xa&&(this.Xa=Xe(this,b)),this.Aa||(this.Aa=this.Gb(b)),b=Ze(this);return b};Se.prototype.check=function(){return this.j.getBody()?this.Kc():null};
function Ue(a,b){return(a=a.querySelector('meta[name="'+b+'"]'))?a.getAttribute("content"):null};/*

 Copyright 2018 Google Inc. All Rights Reserved.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS-IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
var $e={LOCAL:"LOCAL",PREPROD:"PREPROD",PRODUCTION:"PRODUCTION",SANDBOX:"SANDBOX",TEST:"TEST",TIN:"TIN"},af={CARD:"CARD",TOKENIZED_CARD:"TOKENIZED_CARD",UPI:"UPI"},bf={CRYPTOGRAM_3DS:"CRYPTOGRAM_3DS",PAN_ONLY:"PAN_ONLY"},cf={ESTIMATED:"ESTIMATED",FINAL:"FINAL",NOT_CURRENTLY_KNOWN:"NOT_CURRENTLY_KNOWN"};function df(){this.Xd=X.contentWindow}df.prototype.postMessage=function(a,b){this.Xd.postMessage(a,b)};var X=null,ef=null,ff=null,gf=null,hf=Date.now(),jf=null,kf=!1,lf=[];
function mf(){X||(ff=(window.gpayInitParams||{}).environment||"PRODUCTION",X=document.createElement("iframe"),X.src="https://pay"+("PREPROD"==ff?"-preprod.sandbox":"SANDBOX"==ff?".sandbox":"")+".google.com/gp/p/ui/payframe?origin="+window.location.origin+"&mid=%{merchantId}",Y({eventType:15,clientLatencyStartMs:Date.now()}),X.height="0",X.width="0",X.style.display="none",X.style.visibility="hidden",X.onload=function(){Y({eventType:17,clientLatencyStartMs:Date.now()});nf()},document.body?(document.body.appendChild(X),
ef=new df):document.addEventListener("DOMContentLoaded",function(){document.body.appendChild(X);ef=new df}))}function of(a,b){function c(f){f.data.isReadyToPayResponse&&(b(f),window.removeEventListener("message",c))}window.addEventListener("message",c);var d=Object.assign({eventType:6},a);Y(d)}
function Y(a){if(kf){a=Object.assign({buyFlowActivityMode:jf,googleTransactionId:gf,originTimeMs:hf},a);var b=ef,c=b.postMessage,d="https://pay";"SANDBOX"==ff?d+=".sandbox":"PREPROD"==ff&&(d+="-preprod.sandbox");c.call(b,a,d+".google.com")}else lf.push(a)}function nf(){kf=!0;lf.forEach(function(a){Y(a)});lf.length=0};function pf(a){this.I=a;this.S=null}pf.prototype.onResult=function(a){this.S=a};
pf.prototype.isReadyToPay=function(a){var b=qf(a);return new Promise(function(c){b.canMakePayment().then(function(d){window.sessionStorage.setItem("google.payments.api.storage.isreadytopay.result",d.toString());var f={result:d};2<=a.apiVersion&&a.existingPaymentMethodRequired&&(f.paymentMethodPresent=d);c(f)}).catch(function(){window.sessionStorage.getItem("google.payments.api.storage.isreadytopay.result")?c({result:"true"==window.sessionStorage.getItem("google.payments.api.storage.isreadytopay.result")}):
c({result:!1})})})};pf.prototype.prefetchPaymentData=function(a){qf(a,this.I,a.transactionInfo.currencyCode,a.transactionInfo.totalPrice)};pf.prototype.loadPaymentData=function(a){rf(this,a)};
function qf(a,b,c,d){var f={};a&&(f=JSON.parse(JSON.stringify(a)));f.apiVersion||(f.apiVersion=1);f.swg&&(f.allowedPaymentMethods=["CARD"]);b&&"TEST"==b&&(f.environment=b);return new PaymentRequest([{supportedMethods:["https://google.com/pay"],data:f}],{total:{label:"Estimated Total Price",amount:{currency:c||"USD",value:d||"0"}}})}
function rf(a,b){b=qf(b,a.I,b.transactionInfo&&b.transactionInfo.currencyCode||void 0,b.transactionInfo&&b.transactionInfo.totalPrice||void 0);a.S(b.show().then(function(c){c.complete("success");return c.details}).catch(function(c){c.statusCode="CANCELED";throw c;}))};function sf(){var a=window.document,b=this;this.j=a;this.Y=a.createElement("gpay-graypane");tf(this.Y,{"z-index":2147483647,display:"none",position:"fixed",top:0,right:0,bottom:0,left:0,"background-color":"rgba(32, 33, 36, .6)"});this.jb=null;this.Y.addEventListener("click",function(){if(b.jb)try{b.jb.focus()}catch(c){}})}sf.prototype.show=function(a){this.jb=a||null;this.j.body.appendChild(this.Y);tf(this.Y,{display:"block",opacity:0});return uf(this.Y,{opacity:1})};
sf.prototype.hide=function(){var a=this;this.jb=null;if(this.Y.parentElement)return uf(this.Y,{opacity:0}).then(function(){tf(a.Y,{display:"none"});a.j.body.removeChild(a.Y)})};function tf(a,b){for(var c in b)a.style.setProperty(c,b[c].toString(),"important")}
function uf(a,b){var c=a.ownerDocument.defaultView,d=a.style.transition||"";return(new Promise(function(f){c.setTimeout(function(){c.setTimeout(f,300);tf(a,Object.assign({transition:"transform 300ms ease-out, opacity 300ms ease-out"},b))})})).then(function(){tf(a,Object.assign({transition:d},b))})};function vf(){if(-1!=window.navigator.userAgent.indexOf("OPR/"))return!1;var a=window.navigator.userAgent.match(/Android/i),b=window.navigator.userAgent.match(/Chrome\/([0-9]+)\./i);return null!=a&&"PaymentRequest"in window&&"Google Inc."==window.navigator.vendor&&null!=b&&59<=Number(b[1])}function wf(a){if(2<=a.apiVersion){var b=xf(a);if(b&&1==b.length&&"CRYPTOGRAM_3DS"==b[0])return!0}return 1==a.allowedPaymentMethods.length&&"TOKENIZED_CARD"==a.allowedPaymentMethods[0]}
function yf(a,b){return 2<=a.apiVersion&&(a=xf(a))&&a.includes(b)?!0:!1}function zf(){return window.location.hostname.endsWith(".google.com")||void 0===window.isSecureContext?null:window.isSecureContext?null:"Google Pay APIs should be called in secure context!"}function Af(a){if(a.environment&&!Object.values($e).includes(a.environment))throw Error("Parameter environment in PaymentOptions can optionally be set to PRODUCTION, otherwise it defaults to TEST. "+a.environment);}
function Bf(a){if(!a)return"isReadyToPayRequest must be set!";if(2<=a.apiVersion){if(!("apiVersionMinor"in a))return"apiVersionMinor must be set!";if(!a.allowedPaymentMethods||!Array.isArray(a.allowedPaymentMethods)||0==a.allowedPaymentMethods.length)return"for v2 allowedPaymentMethods must be set to an array containing a list of accepted payment methods";for(var b=0;b<a.allowedPaymentMethods.length;b++){var c=a.allowedPaymentMethods[b];if("CARD"==c.type){if(!c.parameters)return"Field parameters must be setup in each allowedPaymentMethod";
var d=c.parameters.allowedCardNetworks;if(!d||!Array.isArray(d)||0==d.length)return"allowedCardNetworks must be setup in parameters for type CARD";var f=c.parameters.allowedAuthMethods;if(!f||!Array.isArray(f)||0==f.length||!f.every(Cf))return"allowedAuthMethods must be setup in parameters for type 'CARD'  and must contain 'CRYPTOGRAM_3DS' and/or 'PAN_ONLY'"}}}else if(!a.allowedPaymentMethods||!Array.isArray(a.allowedPaymentMethods)||0==a.allowedPaymentMethods.length||!a.allowedPaymentMethods.every(Df))return"allowedPaymentMethods must be set to an array containing 'CARD' and/or 'TOKENIZED_CARD'!";
return null}function Df(a){return Object.values(af).includes(a)}function Cf(a){return Object.values(bf).includes(a)}
function Ef(a){if(!a)return"paymentDataRequest must be set!";if(a.swg)return(a=a.swg)?a.skuId&&a.publicationId?null:"Both skuId and publicationId must be provided":"Swg parameters must be provided";if(a.transactionInfo)if(a.transactionInfo.currencyCode){if(!a.transactionInfo.totalPriceStatus||!Object.values(cf).includes(a.transactionInfo.totalPriceStatus))return"totalPriceStatus in transactionInfo must be set to one of NOT_CURRENTLY_KNOWN, ESTIMATED or FINAL!";if("NOT_CURRENTLY_KNOWN"!==a.transactionInfo.totalPriceStatus&&
!a.transactionInfo.totalPrice)return"totalPrice in transactionInfo must be set when totalPriceStatus is ESTIMATED or FINAL!"}else return"currencyCode in transactionInfo must be set!";else return"transactionInfo must be set!";var b=Ff(a);if(b){if(!b.parameters)return"parameters must be set in allowedPaymentMethod!";b=b.parameters;if(b.payeeVpa)if(b.payeeName)if(b.referenceUrl){if(!b.mcc)return"mcc in allowedPaymentMethod parameters must be set!";if(!b.transactionReferenceId)return"transactionReferenceId in allowedPaymentMethod parameters must be set!"}else return"referenceUrl in allowedPaymentMethod parameters must be set!";
else return"payeeName in allowedPaymentMethod parameters must be set!";else return"payeeVpa in allowedPaymentMethod parameters must be set!";if("INR"!==a.transactionInfo.currencyCode)return"currencyCode in transactionInfo must be set to INR!";if("FINAL"!==a.transactionInfo.totalPriceStatus)return"totalPriceStatus in transactionInfo must be set to FINAL!";if(!a.transactionInfo.transactionNote)return"transactionNote in transactionInfo must be set!"}return null}
function Ff(a){return!vf()||2>a.apiVersion||!a.allowedPaymentMethods?null:Gf(a,"UPI")}function xf(a){return a.allowedPaymentMethods&&(a=Gf(a,"CARD"))&&a.parameters?a.parameters.allowedAuthMethods:null}function Gf(a,b){for(var c=0;c<a.allowedPaymentMethods.length;c++){var d=a.allowedPaymentMethods[c];if(d.type==b)return d}return null};function Hf(a,b,c){var d=If;this.I=a;this.activities=b||new Cb(window);this.ca=new sf;this.be=this.S=null;this.zc=!1;this.wd=this.v=null;this.Zd=d;this.kd=c||null;this.Ta=null}e=Hf.prototype;e.onResult=function(a){this.S||(this.S=a,this.activities.onResult("GPAY",this.Kd.bind(this)))};
e.Kd=function(a){var b=this;this.ca.hide();this.S(a.acceptResult().then(function(c){if(c.origin!=Jf(b))throw Error("channel mismatch");var d=c.data;if(d.redirectEncryptedCallbackData)return jf=3,Kf(b,d.redirectEncryptedCallbackData).then(function(f){var g=Object.assign({},d);delete g.redirectEncryptedCallbackData;return Object.assign(g,f)});if(!c.originVerified||!c.secureChannel)throw Error("channel mismatch");return d},function(c){var d=c.message,f=c.message;try{f=JSON.parse(d.substring(7))}catch(g){}f.statusCode&&
-1==["DEVELOPER_ERROR","MERCHANT_ACCOUNT_ERROR"].indexOf(f.statusCode)&&(f={statusCode:"CANCELED"});"AbortError"==f&&(f={statusCode:"CANCELED"});return Promise.reject(f)}))};
function Kf(a,b){return new Promise(function(c,d){var f=Lf(a),g=new XMLHttpRequest;g.open("POST",f,!0);"withCredentials"in g&&(g.withCredentials=!0);g.onreadystatechange=function(){if(!(2>g.readyState))if(100>g.status||599<g.status)g.onreadystatechange=null,d(Error("Unknown HTTP status "+g.status));else if(4==g.readyState)try{c(JSON.parse(g.responseText))}catch(h){d(h)}};g.onerror=function(){d(Error("Network failure"))};g.onabort=function(){d(Error("Request aborted"))};g.send(b)})}
e.isReadyToPay=function(a){var b=this;return new Promise(function(c){if(wf(a))c({result:!1});else{var d=window.navigator.userAgent;if(0<d.indexOf("GSA/")&&0<d.indexOf("Safari"))c({result:!1});else if(0<d.indexOf("FxiOS"))c({result:!1});else{var f=0<d.indexOf("Chrome")||0<d.indexOf("Firefox")||0<d.indexOf("Safari");f&&2<=a.apiVersion&&a.existingPaymentMethodRequired?(a.environment=b.I,of(a,function(g){var h={result:f};a.existingPaymentMethodRequired&&(h.paymentMethodPresent="READY_TO_PAY"==g.data.isReadyToPayResponse);
c(h)})):c({result:f})}}})};e.prefetchPaymentData=function(){};e.loadPaymentData=function(a){a.swg||a.apiVersion||(a.apiVersion=1);a.environment=this.I;jf=a.forceRedirect?3:2;a=this.activities.open("GPAY","TIN"==this.I?"/ui/pay":Jf(this)+"/gp/p/ui/pay",a.forceRedirect?"_top":"gp-js-popup",a,{width:600,height:600});this.ca.show(a&&a.targetWin)};function Jf(a){return"LOCAL"==a.I?"":"https://"+("PREPROD"==a.I?"pay-preprod.sandbox":"SANDBOX"==a.I?"pay.sandbox":"pay")+".google.com"}
function Lf(a){var b=Jf(a)+"/gp/p/apis/buyflow/process";a.kd&&(b+="?rk="+encodeURIComponent(a.kd));return b}e.getIframeUrl=function(a,b){var c="https://pay.google.com/gp/p/ui/pay?origin="+b;if("SANDBOX"==a||"PREPROD"==a)c="https://pay'+  (environment == Constants.Environment.PREPROD ? '-preprod' : '')+  '.sandbox.google.com/gp/p/ui/pay?origin="+b;return c};function Mf(a,b){Of(b,"all 250ms ease 0s");b.height="0px";setTimeout(function(){a.parentNode&&a.parentNode.removeChild(a)},250)}
e.$d=function(){var a=document.createElement("div");a.classList.add("google-payments-dialogContainer");var b=document.createElement("div");b.classList.add("iframeContainer");var c=document.createElement("iframe");c.classList.add("google-payments-dialog");c.setAttribute("frameborder","0");c.setAttribute("scrolling","no");b.appendChild(c);a.appendChild(b);document.body.appendChild(a);a={container:a,iframe:c};b=a.iframe;c=a.container;c.addEventListener("click",this.pd.bind(this,a));c.style.display="none";
b.style.display="none";b.height="0px";Of(b,"all 250ms ease 0s");this.zc=!1;return a};e.Yd=function(a){a.container.parentNode&&(this.wd(Promise.reject({errorCode:"CANCELED"})),Mf(a.container,a.iframe),this.v&&this.v.disconnect())};e.pd=function(a){a.container.parentNode&&history.back()};
e.ce=function(a,b){var c=this;a.style.display="block";b.style.display="block";setTimeout(function(){b.height="280px";setTimeout(function(){c.zc=!0;c.Ta&&(Of(b,c.Ta.transition),b.height=c.Ta.height,c.Ta=null)},250)},1)};function Of(a,b){a.style.setProperty("transition",b);a.style.setProperty("-webkit-transition",b)}
e.ae=function(a,b,c){var d=this;c.swg||c.apiVersion||(c.apiVersion=1);c.environment=this.I;var f,g=this.getIframeUrl(this.I,window.location.origin);return this.activities.openIframe(b,g,c).then(function(h){d.v=h;h.onMessage(function(k){"resize"===k.type&&d.zc?(f||(f=Date.now()),Date.now()<f+250?Of(b,k.transition+", height 250ms"):Of(b,k.transition),b.height=k.height):d.Ta={height:k.height,transition:k.transition}});return h.acceptResult()}).then(function(h){Mf(a,b);history.back();return h.data},function(h){Mf(a,
b);history.back();return Promise.reject(h)})};function Pf(){}Pf.prototype.isUpiRequest=function(a){return!!Ff(a)};Pf.prototype.isReadyToPay=function(a){if(Ff(a))return a.existingPaymentMethodRequired?Promise.resolve({result:!0,paymentMethodPresent:!0}):Promise.resolve({result:!0});throw Error("No Upi payment method found in handler");};
Pf.prototype.loadPaymentData=function(a,b,c){var d=b.parameters,f=a.transactionInfo,g=[{supportedMethods:["https://tez.google.com/pay"],data:{pa:d.payeeVpa,pn:d.payeeName,tr:d.transactionReferenceId,url:d.referenceUrl,mc:d.mcc,tn:f.transactionNote}}];d.transactionId&&(g[0].data.tid=d.transactionId);var h=new PaymentRequest(g,{total:{label:"Total",amount:{currency:f.currencyCode,value:f.totalPrice}},displayItems:[{label:"Original Amount",amount:{currency:f.currencyCode,value:f.totalPrice}}]});c(Qf(h).then(function(k){k?
k=Rf(h):(window.location.replace("https://play.google.com/store/apps/details?id=com.google.android.apps.nbu.paisa.user"),k=Promise.reject({errorMessage:"Cannot redirect to Tez page in Google Play."}));return k}).then(function(k){var l=JSON.parse(k.tezResponse);if("FAILURE"===l.Status){switch(l.responseCode){case "ZM":l={errorCode:3,errorMessage:"Payment failure due to invalid MPIN."};break;case "Z9":l={errorCode:3,errorMessage:"Payment failure due to insufficient funds."};break;case "91":l={errorCode:1,
errorMessage:"Payment failure due to transaction timeout or connection issue."};break;default:l={errorMessage:"Payment cancelled."}}l=Promise.reject(l)}else l=Promise.resolve({apiVersion:a.apiVersion,apiVersionMinor:a.apiVersionMinor,paymentMethodData:{type:b.type,tokenizationData:{type:"DIRECT",token:{protocolVersion:"ECv1",signature:"",signedMessage:{paymentMethodType:"UPI",payeeVpa:b.parameters.payeeVpa,status:l.Status,transactionReferenceId:b.parameters.transactionReferenceId,transactionId:b.parameters.transactionId?
b.parameters.transactionId:l.txnId,transactionInfo:a.transactionInfo}}}}});return l}).catch(function(k){k.statusCode="CANCELED";return Promise.reject(k)}))};function Rf(a){return a.show().then(function(b){b.complete("success");return b.details})}
function Qf(a){var b=window.sessionStorage.getItem("google.payments.api.storage.upi.canMakePaymentCache");return b?Promise.resolve("true"===b):a.canMakePayment?a.canMakePayment().then(function(c){c&&window.sessionStorage.setItem("google.payments.api.storage.upi.canMakePaymentCache",c.toString());return c}):Promise.resolve(!0)};/*

Math.uuid.js (v1.4)
http://www.broofa.com
mailto:robert@broofa.com
Copyright (c) 2010 Robert Kieffer
Dual licensed under the MIT and GPL licenses.
*/
var Sf="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");function Tf(a){for(var b=Array(36),c=0,d,f=0;36>f;f++)8==f||13==f||18==f||23==f?b[f]="-":14==f?b[f]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[f]=Sf[19==f?d&3|8:d]);return b.join("")+"."+a};var Uf="actions.google.com amp-actions.sandbox.google.com amp-actions-staging.sandbox.google.com amp-actions-autopush.sandbox.google.com payments.developers.google.com payments.google.com".split(" ");
function Vf(a,b,c){this.cd=b;Af(a);this.$c=null;this.I=a.environment||"TEST";If||(If=-1!=Uf.indexOf(window.location.hostname)&&a.i&&a.i.googleTransactionId?a.i.googleTransactionId:Tf(this.I));this.Ld=a;this.va=new Hf(this.I,c,a.i&&a.i.redirectKey);this.Da=5;var d=vf();this.Ia=d?new pf(this.I):this.va;this.Lc=new Pf;this.va.onResult(this.fc.bind(this));this.Ia.onResult(this.fc.bind(this));mf();d&&(jf=4);gf=If;Y({eventType:9,clientLatencyStartMs:Date.now()});window.addEventListener("message",function(f){-1!=
Uf.indexOf(window.location.hostname)&&"logPaymentData"===f.data.name&&Y(f.data.data)})}var If;e=Vf.prototype;e.isReadyToPay=function(a){a&&(a=Object.assign({},this.Ld,a));var b=Date.now(),c=zf()||Bf(a);if(c)return new Promise(function(f,g){Wf("isReadyToPay",c);Y({eventType:0,error:2});g({statusCode:"DEVELOPER_ERROR",statusMessage:c})});var d=Xf(this,a);d.then(function(f){Y({eventType:0,clientLatencyStartMs:b,isReadyToPayApiResponse:f});return f});return d};
function Xf(a,b){if(a.Lc.isUpiRequest(b))return a.Lc.isReadyToPay(b);if(vf()&&!Yf(b)){if(2<=b.apiVersion)return Zf(a,b);var c=a.va.isReadyToPay(b),d=a.Ia.isReadyToPay(b);return wf(b)?d:d.then(function(){return c})}return a.va.isReadyToPay(b)}
function Zf(a,b){var c=Promise.resolve({result:!1});b.existingPaymentMethodRequired&&(c=Promise.resolve({result:!1,paymentMethodPresent:!1}));var d=c;if(yf(b,"CRYPTOGRAM_3DS")){var f=JSON.parse(JSON.stringify(b));for(d=0;d<f.allowedPaymentMethods.length;d++)"CARD"==f.allowedPaymentMethods[d].type&&(f.allowedPaymentMethods[d].parameters.allowedAuthMethods=["CRYPTOGRAM_3DS"]);d=a.Ia.isReadyToPay(f)}var g=c;yf(b,"PAN_ONLY")&&(g=a.va.isReadyToPay(b));return d.then(function(h){return 1==(h&&h.result)?
h:g})}e.prefetchPaymentData=function(a){var b=zf()||Ef(a);b?Wf("prefetchPaymentData",b):($f(a),vf()&&!Yf(a)?this.Ia.prefetchPaymentData(a):this.va.prefetchPaymentData(a))};
e.loadPaymentData=function(a){var b=this;Y({eventType:5});var c=zf()||Ef(a);this.Da=a&&a.swg?6:5;if(c)this.cd(new Promise(function(f,g){Y({eventType:1,error:2,buyFlowMode:b.Da});Wf("loadPaymentData",c);g({statusCode:"DEVELOPER_ERROR",statusMessage:c})}));else{var d=Ff(a);d?this.Lc.loadPaymentData(a,d,this.fc.bind(this)):(this.$c=Date.now(),$f(a),Yf(a)?this.va.loadPaymentData(a):this.Ia.loadPaymentData(a))}};function Wf(a,b){console.error("DEVELOPER_ERROR in "+a+" : "+b)}
e.createButton=function(){var a=Date.now();Y({eventType:2,clientLatencyStartMs:a});return null};e.fc=function(a){var b=this;a.then(function(){Y({eventType:1,clientLatencyStartMs:b.$c,buyFlowMode:b.Da})}).catch(function(c){c.errorCode?Y({eventType:1,error:c.errorCode,buyFlowMode:b.Da}):Y({eventType:1,error:6,buyFlowMode:b.Da})});this.cd(a)};function $f(a){var b={startTimeMs:Date.now(),googleTransactionId:If};a.i=a.i?Object.assign(b,a.i):b}function Yf(a){return!0===(a.i&&a.i.disableNative)};function ag(a){this.j=a}ag.prototype.preconnect=function(a){bg(this,a,"preconnect")};ag.prototype.dnsPrefetch=function(a){bg(this,a,"dns-prefetch")};ag.prototype.prefetch=function(a){bg(this,a,"preconnect prefetch")};ag.prototype.preload=function(a,b){bg(this,a,"preconnect preload",b)};function bg(a,b,c,d){var f=x(a.j,"link",{rel:c,href:b});d&&f.setAttribute("as",d);a.j.head.appendChild(f)};var cg={PRODUCTION:"https://pay.google.com",SANDBOX:"https://pay.sandbox.google.com"};function dg(a){this.g=a.win();this.m=a.activities();this.vc=this.sc=this.uc=null;this.Rc=a.analytics();this.pc=new eg(this.g);this.$a=null;this.fd=new ag(this.g.document);var b;if(b=Yc(this.g,"pay-client-redirect")){var c=this.g.location.hash;b=/redirectEncryptedCallbackData/.test(c);c=/swgRequest/.test(c);b=b&&c}b&&(this.preconnect(this.fd),fg(this));this.pc.prepare();this.u=a.eventManager()}e=dg.prototype;
e.preconnect=function(a){a.prefetch(J(cg.PRODUCTION+"/gp/p/ui/pay","_",Bc()));a.prefetch("https://payments.google.com/payments/v4/js/integrator.js?ss=md");a.prefetch("https://clients2.google.com/gr/gr_full_2.0.6.js")};function fg(a){var b={environment:"PRODUCTION",i:{redirectKey:a.pc.restoreKey()}};var c=a.Rc.getTransactionId(),d=a.Ad.bind(a);If=c;b=new Vf(b,d,a.m.getOriginalWebActivityPorts());a.$a=b}e.getType=function(){return"PAYJS"};
e.start=function(a,b){var c=this;b=void 0===b?{}:b;this.sc=a;this.$a||(this.preconnect(this.fd),fg(this));b.forceRedirect&&(a=Object.assign(a,{forceRedirect:b.forceRedirect||!1}));gg(a,"disableNative",b.forceDisableNative||this.g!=this.g.top);var d=null,f=new Promise(function(g){return d=g});this.pc.useVerifier(function(g){g&&gg(a,"redirectVerifier",g);if(b.forceRedirect){var h=c.$a;c.u.getReadyPromise().then(function(){c.Rc.getLoggingPromise().then(function(){h.loadPaymentData(a);d(!0)})})}else c.$a.loadPaymentData(a),
d(!0)});return f};e.onResponse=function(a){var b=this;this.uc=a;var c=this.vc;c&&Promise.resolve().then(function(){c&&a(hg(b,c,b.sc))})};e.Ad=function(a){this.vc=a;this.uc&&this.uc(hg(this,this.vc,this.sc))};function hg(a,b,c){return b.then(function(d){c&&(d.paymentRequest=c);return d}).catch(function(d){return"object"==typeof d&&"CANCELED"==d.statusCode?(d=cb(a.g,void 0),d.productType=c?c.i.productType:null,Promise.reject(d)):Promise.reject(d)})}
function eg(a){this.g=a;this.gb=!1;this.Sa=this.ic=null}eg.prototype.prepare=function(){return ig(this,function(){})};eg.prototype.useVerifier=function(a){var b=this;ig(this,function(c){if(c)try{b.g.localStorage.setItem("subscribe.google.com:rk",c.key)}catch(d){c=null}a(c&&c.verifier||null)})};eg.prototype.restoreKey=function(){try{return this.g.localStorage&&this.g.localStorage.getItem("subscribe.google.com:rk")||null}catch(a){return null}};
function ig(a,b){jg(a);a.gb?b(a.ic):a.Sa&&a.Sa.then(function(c){return b(c)});return a.Sa}
function jg(a){if(!a.gb&&!a.Sa){try{var b=!!a.g.localStorage}catch(d){b=!1}var c=a.g.crypto;b&&c&&c.getRandomValues&&c.subtle&&c.subtle.digest?a.Sa=(new Promise(function(d,f){var g=new Uint8Array(16);c.getRandomValues(g);var h=btoa(Na(g));c.subtle.digest({name:"SHA-384"},Ma(h)).then(function(k){k=btoa(Na(new Uint8Array(k)));d({key:h,verifier:k})},function(k){f(k)})})).catch(function(){return null}).then(function(d){a.gb=!0;return a.ic=d}):(a.gb=!0,a.ic=null)}}
function gg(a,b,c){var d={};a.i=Object.assign(a.i||{},(d[b]=c,d))};function kg(a,b,c){this.g=a;this.h=b;this.K=this.h.pageConfig().getPublicationId();this.zb=null;this.D=c;this.Wd=1;this.h.eventManager().registerEventListener(this.Ja.bind(this))}function lg(a,b){b=J(b,"u_tz","240");b=J(b,"v",String(a.Wd));if(!a.zb){var c=a.g.document.cookie.match("(^|;)\\s*__gads\\s*=\\s*([^;]+)");a.zb=c&&encodeURIComponent(c.pop())}(c=a.zb)&&(b=J(b,"cookie",c));return b=J(b,"cdm",a.g.location.hostname)}
kg.prototype.sendSubscriptionState=function(a,b){a=J("https://pubads.g.doubleclick.net/subopt/data","states",this.K+":"+a);b&&(a=J(a,"extrainfo",b));return this.D.fetch(lg(this,a),{method:"GET",credentials:"include"})};
kg.prototype.Ja=function(a){if(6!==a.eventOriginator&&(this.h.config().enablePropensity||3===a.eventOriginator))if(4E3===a.eventType)this.sendSubscriptionState(a.additionalParameters.state,a.additionalParameters.productsOrSkus);else{var b=Ud[a.eventType];if(null!=b){var c=a.additionalParameters;c instanceof C&&(c=void 0);Sc(a.isFromUserAction)&&(M(c)||(c={}),c.is_active=a.isFromUserAction);a=JSON.stringify(c);var d=J("https://pubads.g.doubleclick.net/subopt/data","events",this.K+":"+b);a&&(d=J(d,"extrainfo",a));this.D.fetch(lg(this,
d),{method:"GET",credentials:"include"})}}};
kg.prototype.getPropensity=function(a,b){return this.D.fetch(lg(this,"https://pubads.g.doubleclick.net/subopt/pts?products="+this.K+"&type="+b+"&ref="+a),{method:"GET",credentials:"include"}).then(function(c){return c.json()}).then(function(c){var d={};if(c.header)if(c.header.ok){var f=c.scores;c=[];for(var g=0;g<f.length;g++){var h=f[g];c.push(h.score?{product:h.product,score:{value:h.score,bucketed:2==h.score_type}}:{product:h.product,error:h.error_message})}c&&(d={header:{ok:!0},body:{scores:c}})}else d={header:{ok:!1},
body:{error:c.error}};else d={header:{ok:!1},body:{error:"No valid response"}};return d})};function mg(a,b,c){this.g=a;this.hd=new kg(a,b,c);this.u=b.eventManager()}mg.prototype.sendSubscriptionState=function(a,b){if(!Object.values(mc).includes(a))throw Error("Invalid subscription state provided");if(("subscriber"==a||"past_subscriber"==a)&&!b)throw Error("Entitlements must be provided for users with active or expired subscriptions");if(b&&!M(b))throw Error("Entitlements must be an Object");var c=null;b&&(c=JSON.stringify(b));this.hd.sendSubscriptionState(a,c)};
mg.prototype.getPropensity=function(a){if(a&&!Object.values(oc).includes(a))throw Error("Invalid propensity type requested");a||(a="general");return this.hd.getPropensity(this.g.document.referrer,a)};
mg.prototype.sendEvent=function(a){var b=Td[a.name],c=null;if(!Rc(nc,a.name)||!b)throw Error("Invalid user event provided("+a.name+")");if(a.data)if(M(a.data))c={},Object.assign(c,a.data);else throw Error("Event data must be an Object("+a.data+")");if(Sc(a.active))c||(c={}),Object.assign(c,{is_active:a.active});else if(null!=a.active)throw Error("Event active must be a boolean");this.u.logEvent({eventType:b,eventOriginator:3,isFromUserAction:a.active,additionalParameters:c})};function ng(a){this.g=a;this.Wa={}}ng.prototype.get=function(a,b){var c=this;b=void 0===b?!1:b;this.Wa[a]||(this.Wa[a]=new Promise(function(d){var f=b?c.g.localStorage:c.g.sessionStorage;if(f)try{d(f.getItem(og(a)))}catch(g){d(null)}else d(null)}));return this.Wa[a]};ng.prototype.set=function(a,b,c){var d=this;c=void 0===c?!1:c;this.Wa[a]=Promise.resolve(b);return new Promise(function(f){var g=c?d.g.localStorage:d.g.sessionStorage;if(g)try{g.setItem(og(a),b)}catch(h){}f()})};
ng.prototype.remove=function(a,b){var c=this;b=void 0===b?!1:b;delete this.Wa[a];return new Promise(function(d){var f=b?c.g.localStorage:c.g.sessionStorage;if(f)try{f.removeItem(og(a))}catch(g){}d()})};function og(a){return"subscribe.google.com:"+a};function pg(a,b){this.h=a;this.g=a.win();this.m=a.activities();this.o=a.dialogManager();this.Qa=null;this.md=b||Promise.reject("No account promise provided");this.l=new z(this.g,this.m,K("/waitforsubscriptionlookupiframe"),L({publicationId:a.pageConfig().getPublicationId(),productId:a.pageConfig().getProductId()}),!0,!0)}
pg.prototype.start=function(){var a=this;this.Qa=this.o.openView(this.l);return this.md.then(function(b){a.o.completeView(a.l);return b},function(b){a.o.completeView(a.l);throw b;})};function qg(a){var b=this;this.g=a;this.j=Fd(a);this.pb=Promise.resolve();this.lc=null;this.U={};this.Cb=!1;this.Ga=null;this.Db=new Promise(function(c){b.Ga=c});this.Ra=null;this.ma=new hd(this.j,this.Db);this.ma.init()}e=qg.prototype;e.whenReady=function(){return this.pb};
function Z(a,b){if(!a.Cb&&b){a.Cb=!0;if(a.lc)var c=Promise.resolve(new V(a.lc,!1));else a.Ra=new Pe(a.j),c=a.Ra.resolveConfig().then(function(d){a.Ra=null;return d});c.then(function(d){a.Ga(new rg(a.j,d,{configPromise:a.Db},a.U));a.Ga=null},function(d){a.Ga(Promise.reject(d));a.Ga=null})}else b&&a.Ra&&a.Ra.check();return a.Db}
e.startSubscriptionsFlowIfNeeded=function(){var a=this.g.document;var b=Ue(a,"subscriptions-control");a=b?b:(a=a.querySelector("script[subscriptions-control]"))?a.getAttribute("subscriptions-control"):null;Ia(a,"mode");return"manual"==a?null:this.start()};e.init=function(a){v(!this.Cb,"already configured");this.lc=a;Z(this,!0)};e.configure=function(a){Object.assign(this.U,a);return Z(this,!1).then(function(b){return b.configure(a)})};e.start=function(){return Z(this,!0).then(function(a){return a.start()})};
e.reset=function(){return Z(this,!0).then(function(a){return a.reset()})};e.clear=function(){return Z(this,!0).then(function(a){return a.clear()})};e.getEntitlements=function(a){return Z(this,!0).then(function(b){return b.getEntitlements(a)})};e.setOnEntitlementsResponse=function(a){return Z(this,!1).then(function(b){return b.setOnEntitlementsResponse(a)})};e.getOffers=function(a){return Z(this,!0).then(function(b){return b.getOffers(a)})};e.showOffers=function(a){return Z(this,!0).then(function(b){return b.showOffers(a)})};
e.showUpdateOffers=function(a){return Z(this,!0).then(function(b){return b.showUpdateOffers(a)})};e.showSubscribeOption=function(a){return Z(this,!0).then(function(b){return b.showSubscribeOption(a)})};e.showAbbrvOffer=function(a){return Z(this,!0).then(function(b){return b.showAbbrvOffer(a)})};e.showContributionOptions=function(a){return Z(this,!0).then(function(b){return b.showContributionOptions(a)})};e.waitForSubscriptionLookup=function(a){return Z(this,!0).then(function(b){return b.waitForSubscriptionLookup(a)})};
e.setOnNativeSubscribeRequest=function(a){return Z(this,!1).then(function(b){return b.setOnNativeSubscribeRequest(a)})};e.setOnSubscribeResponse=function(a){return Z(this,!1).then(function(b){return b.setOnSubscribeResponse(a)})};e.subscribe=function(a){return Z(this,!0).then(function(b){return b.subscribe(a)})};e.updateSubscription=function(a){return Z(this,!0).then(function(b){return b.updateSubscription(a)})};e.setOnContributionResponse=function(a){return Z(this,!1).then(function(b){return b.setOnContributionResponse(a)})};
e.setOnPaymentResponse=function(a){return Z(this,!1).then(function(b){return b.setOnPaymentResponse(a)})};e.contribute=function(a){return Z(this,!0).then(function(b){return b.contribute(a)})};e.completeDeferredAccountCreation=function(a){return Z(this,!0).then(function(b){return b.completeDeferredAccountCreation(a)})};e.setOnLoginRequest=function(a){return Z(this,!1).then(function(b){return b.setOnLoginRequest(a)})};e.triggerLoginRequest=function(a){return Z(this,!1).then(function(b){return b.triggerLoginRequest(a)})};
e.setOnLinkComplete=function(a){return Z(this,!1).then(function(b){return b.setOnLinkComplete(a)})};e.linkAccount=function(a){a=void 0===a?{}:a;return Z(this,!0).then(function(b){return b.linkAccount(a)})};e.setOnFlowStarted=function(a){return Z(this,!1).then(function(b){return b.setOnFlowStarted(a)})};e.setOnFlowCanceled=function(a){return Z(this,!1).then(function(b){return b.setOnFlowCanceled(a)})};e.saveSubscription=function(a){return Z(this,!0).then(function(b){return b.saveSubscription(a)})};
e.showLoginPrompt=function(){return Z(this,!0).then(function(a){return a.showLoginPrompt()})};e.showLoginNotification=function(){return Z(this,!0).then(function(a){return a.showLoginNotification()})};e.createButton=function(a,b){return this.ma.create(a,b)};e.attachSmartButton=function(a,b,c){return Z(this,!0).then(function(d){return d.attachSmartButton(a,b,c)})};e.attachButton=function(a,b,c){return this.ma.attach(a,b,c)};e.getPropensityModule=function(){return Z(this,!0).then(function(a){return a.getPropensityModule()})};
e.getLogger=function(){return Z(this,!0).then(function(a){return a.getLogger()})};e.getEventManager=function(){return Z(this,!0).then(function(a){return a.getEventManager()})};e.setShowcaseEntitlement=function(a){return Z(this,!0).then(function(b){return b.setShowcaseEntitlement(a)})};e.consumeShowcaseEntitlementJwt=function(a,b){return Z(this,!0).then(function(c){return c.consumeShowcaseEntitlementJwt(a,b)})};e.showBestAudienceAction=function(){u("Not implemented yet")};
function rg(a,b,c,d){var f=this;c=c||{};c.configPromise=c.configPromise||Promise.resolve();this.u=new Vc(c.configPromise);this.j=Fd(a);this.g=this.j.getWin();this.U={windowOpenMode:"auto",analyticsMode:0,enableSwgAnalytics:!1,enablePropensity:!1};bb(this.g)&&(this.U.windowOpenMode="redirect");d&&sg(this,d);this.P=b;this.J=this.j.whenReady();this.Yc=new ye(this.j);this.D=c.fetcher||new we(this.g);this.F=new ng(this.g);this.o=new Kd(this.j);this.C=new ld;this.Ub=this.Vb=null;c.enableGoogleAnalytics&&
(this.xd=new xe(this),this.xd.start());this.m=new Pc(this);this.W=new bd(this,this.D);this.W.start();this.jc=new dg(this);this.Fd=new Fe(this);this.Z=new de(this.g,this.P,this.D,this);this.X=new sd(b.getPublicationId(),this.D);this.Od=new mg(this.g,this,this.D);this.u.logSwgEvent(11,!1);this.Jd=new Ie(this.P,this.D);this.ma=new hd(this.j,Promise.resolve(this));var g=new ag(this.g.document);g.prefetch("https://news.google.com/swg/js/v1/loader.svg");g.preconnect("https://www.gstatic.com/");g.preconnect("https://fonts.googleapis.com/");
g.preconnect("https://www.google.com/");Ce(this);Ic(this);ab(this.j,".swg-dialog,.swg-toast{background-color:#fff!important;box-sizing:border-box}.swg-toast{border:none!important;bottom:0!important;max-height:46px!important;position:fixed!important;z-index:2147483647!important}@media (max-height:640px),(max-width:640px){.swg-dialog,.swg-toast{border-top-left-radius:8px!important;border-top-right-radius:8px!important;box-shadow:0 1px 1px rgba(60,64,67,.3),0 1px 4px 1px rgba(60,64,67,.15)!important;left:-240px!important;margin-left:50vw!important;width:480px!important}}@media (min-width:640px) and (min-height:640px){.swg-dialog{background-color:transparent!important;border:none!important;left:-315px!important;margin-left:50vw!important;width:630px!important}.swg-toast{left:0!important}}@media (max-width:480px){.swg-dialog,.swg-toast{left:0!important;margin-left:0!important;right:0!important;width:100%!important}}\n/*# sourceURL=/./src/components/dialog.css*/");
this.m.onRedirectError(function(h){f.W.addLabels(["redirect"]);f.u.logSwgEvent(2E3,!1);f.Yc.error("Redirect error",h)})}e=rg.prototype;e.doc=function(){return this.j};e.win=function(){return this.g};e.pageConfig=function(){return this.P};e.jserror=function(){return this.Yc};e.activities=function(){return this.m};e.payClient=function(){return this.jc};e.dialogManager=function(){return this.o};e.entitlementsManager=function(){return this.Z};e.callbacks=function(){return this.C};e.storage=function(){return this.F};
e.clientConfigManager=function(){return this.X};e.analytics=function(){return this.W};e.init=function(){};e.configure=function(a){sg(this,a)};
function sg(a,b){var c="",d;for(d in b){var f=b[d];switch(d){case "windowOpenMode":"auto"!=f&&"redirect"!=f&&(c="Unknown windowOpenMode: "+f);break;case "experiments":f.forEach(function(g){Xc(a.g)[g]=!0});a.analytics()&&a.analytics().addLabels(f);break;case "analyticsMode":0!=f&&1!=f&&(c="Unknown analytics mode: "+f);break;case "enableSwgAnalytics":Sc(f)||(c="Unknown enableSwgAnalytics value: "+f);break;case "enablePropensity":Sc(f)||(c="Unknown enablePropensity value: "+f);break;default:c="Unknown config property: "+
d}}v(!c,c||void 0);Object.assign(a.U,b)}e.config=function(){return this.U};e.reset=function(){this.Z.reset();this.closeDialog()};e.clear=function(){this.Z.clear();this.closeDialog()};e.closeDialog=function(){this.o.completeAll()};e.start=function(){if(!this.P.getProductId()||!this.P.isLocked())return Promise.resolve();this.getEntitlements()};
e.getEntitlements=function(a){var b=this;return this.Z.getEntitlements(a).then(function(c){if(c)try{var d=c.entitlements.map(function(f){return f.getSku()||"unknown subscriptionToken"});0<d.length&&b.W.setSku(d.join(","))}catch(f){}return c.clone()})};e.setOnEntitlementsResponse=function(a){this.C.setOnEntitlementsResponse(a)};e.getOffers=function(a){return this.Jd.getOffers(a&&a.productId)};
e.showOffers=function(a){var b=this;return this.J.then(function(){v(a?!a.oldSku:!0,"The showOffers() method cannot be used to update a subscription. Use the showUpdateOffers() method instead.");b.Vb=new Kc(b,a);return b.Vb.start()})};
e.showUpdateOffers=function(a){var b=this;v(Yc(this.g,"replace-subscription"),"Not yet launched!");return this.J.then(function(){v(a?!!a.oldSku:!1,"The showUpdateOffers() method cannot be used for new subscribers. Use the showOffers() method instead.");return(new Kc(b,a)).start()})};e.showSubscribeOption=function(a){var b=this;return this.J.then(function(){return(new Lc(b,a)).start()})};e.showAbbrvOffer=function(a){var b=this;return this.J.then(function(){return(new Mc(b,a)).start()})};
e.showContributionOptions=function(a){var b=this;return this.J.then(function(){b.Ub=new ud(b,a);return b.Ub.start()})};e.getLastContributionsFlow=function(){return this.Ub};e.waitForSubscriptionLookup=function(a){var b=this;return this.J.then(function(){return(new pg(b,a)).start()})};e.setOnLoginRequest=function(a){this.C.setOnLoginRequest(a)};e.triggerLoginRequest=function(a){this.C.triggerLoginRequest(a)};e.setOnLinkComplete=function(a){this.C.setOnLinkComplete(a)};
e.linkAccount=function(a){var b=this;a=void 0===a?{}:a;return this.J.then(function(){return(new Ae(b)).start(a)})};e.saveSubscription=function(a){var b=this;return this.J.then(function(){return(new De(b,a)).start()})};e.showLoginPrompt=function(){var a=this;return this.J.then(function(){return(new He(a)).start()})};e.showLoginNotification=function(){var a=this;return this.J.then(function(){return(new Ge(a)).start()})};e.setOnNativeSubscribeRequest=function(a){this.C.setOnSubscribeRequest(a)};
e.setOnSubscribeResponse=function(a){this.C.setOnSubscribeResponse(a)};e.setOnPaymentResponse=function(a){this.C.setOnPaymentResponse(a)};e.subscribe=function(a){var b=this;v("string"===typeof a,"The subscribe() method can only take a sku as its parameter; for subscription updates please use the updateSubscription() method");return this.J.then(function(){return(new Fc(b,{skuId:a})).start()})};
e.updateSubscription=function(a){var b=this;v(Yc(this.g,"replace-subscription"),"Not yet launched!");v(a?a.oldSku:!1,"The updateSubscription() method should be used for subscription updates; for new subscriptions please use the subscribe() method");return this.J.then(function(){return(new Fc(b,a)).start()})};e.setOnContributionResponse=function(a){this.C.setOnContributionResponse(a)};
e.contribute=function(a){var b=this,c="string"==typeof a?{skuId:a}:a;return this.J.then(function(){return(new Fc(b,c,"UI_CONTRIBUTION")).start()})};e.completeDeferredAccountCreation=function(a){var b=this;return this.J.then(function(){return(new vd(b,a||null)).start()})};e.setOnFlowStarted=function(a){this.C.setOnFlowStarted(a)};e.setOnFlowCanceled=function(a){this.C.setOnFlowCanceled(a)};e.createButton=function(a,b){return this.ma.create(a,b)};e.attachButton=function(a,b,c){this.ma.attach(a,b,c)};
e.attachSmartButton=function(a,b,c){v(Yc(this.g,"smartbox"),"Not yet launched!");this.ma.attachSmartButton(this,a,b,c)};e.getPropensityModule=function(){return Promise.resolve(this.Od)};e.eventManager=function(){return this.u};e.getLastOffersFlow=function(){return this.Vb};e.getEventManager=function(){return Promise.resolve(this.u)};e.getLogger=function(){return Promise.resolve(this.Fd)};
e.setShowcaseEntitlement=function(a){var b;if(b=a&&xc(this.win().location)){b=(b=sc(this.win().document.referrer))||wc;var c;if(c=xc(b))b=b||vc,c=pc.test(b.hostname);b=c}if(!b||!ce(this.win().location.search))return Promise.resolve();var d=Vd[a.entitlement]||[];b=new C;b.setIsUserRegistered(a.isUserRegistered);for(a=0;a<d.length;a++)this.eventManager().logEvent({eventType:d[a],eventOriginator:6,isFromUserAction:!1,additionalParameters:b});return Promise.resolve()};
e.consumeShowcaseEntitlementJwt=function(a,b){this.entitlementsManager().parseEntitlements({signedEntitlements:a}).consume(b)};e.showBestAudienceAction=function(){u("Not implemented yet")};
function tg(a){return{init:a.init.bind(a),configure:a.configure.bind(a),start:a.start.bind(a),reset:a.reset.bind(a),clear:a.clear.bind(a),getEntitlements:a.getEntitlements.bind(a),linkAccount:a.linkAccount.bind(a),showLoginPrompt:a.showLoginPrompt.bind(a),showLoginNotification:a.showLoginNotification.bind(a),getOffers:a.getOffers.bind(a),showOffers:a.showOffers.bind(a),showUpdateOffers:a.showUpdateOffers.bind(a),showAbbrvOffer:a.showAbbrvOffer.bind(a),showSubscribeOption:a.showSubscribeOption.bind(a),
showContributionOptions:a.showContributionOptions.bind(a),waitForSubscriptionLookup:a.waitForSubscriptionLookup.bind(a),subscribe:a.subscribe.bind(a),updateSubscription:a.updateSubscription.bind(a),contribute:a.contribute.bind(a),completeDeferredAccountCreation:a.completeDeferredAccountCreation.bind(a),setOnEntitlementsResponse:a.setOnEntitlementsResponse.bind(a),setOnLoginRequest:a.setOnLoginRequest.bind(a),triggerLoginRequest:a.triggerLoginRequest.bind(a),setOnLinkComplete:a.setOnLinkComplete.bind(a),
setOnNativeSubscribeRequest:a.setOnNativeSubscribeRequest.bind(a),setOnPaymentResponse:a.setOnPaymentResponse.bind(a),setOnSubscribeResponse:a.setOnSubscribeResponse.bind(a),setOnContributionResponse:a.setOnContributionResponse.bind(a),setOnFlowStarted:a.setOnFlowStarted.bind(a),setOnFlowCanceled:a.setOnFlowCanceled.bind(a),saveSubscription:a.saveSubscription.bind(a),createButton:a.createButton.bind(a),attachButton:a.attachButton.bind(a),attachSmartButton:a.attachSmartButton.bind(a),getPropensityModule:a.getPropensityModule.bind(a),
getLogger:a.getLogger.bind(a),getEventManager:a.getEventManager.bind(a),setShowcaseEntitlement:a.setShowcaseEntitlement.bind(a),consumeShowcaseEntitlementJwt:a.consumeShowcaseEntitlementJwt.bind(a),showBestAudienceAction:a.showBestAudienceAction.bind(a)}};t("Subscriptions Runtime: 0.1.22.166");(function(a){function b(f){f&&c.whenReady().then(function(){f(d)})}if(!a.SWG||Array.isArray(a.SWG)){var c=new qg(a),d=tg(c);[].concat(a.SWG,a.SUBSCRIPTIONS).forEach(b);a.SWG=a.SUBSCRIPTIONS={push:b};c.startSubscriptionsFlowIfNeeded()}})(self);}).call(this);

//# sourceMappingURL=swg.js.map
