// ABMNZN SDK 2024-03-20-4sqcqk55
if (window.amazon == null || window.amazon.Login == null) {
(function() {
var l,m,n,q,t,w,x,y,A;function aa(a,b){if(null===a||void 0===a)a={};for(var c=1;c'),a.appendChild(c));c.setAttribute("id",b);return b}function G(){this.a=[]}G.prototype.wait=function(a,b){this.a.push({za:a,persist:!!b})};
G.prototype.b=function(a){var b=this.a;this.a=[];for(var c=0;c=f;)d()}function c(){var a,b="",c;if('"'===f)for(;d();){if('"'===f)return d(),b;if("\\"===f)if(d(),"u"===f){for(a=c=0;4>a;a+=1){var e=parseInt(d(),16);if(!isFinite(e))break;c=16*c+e}b+=String.fromCharCode(c)}else if("string"===typeof h[f])b+=h[f];else break;else b+=
f}g("Bad string")}function e(){var a="";"-"===f&&(a="-",d("-"));for(;"0"<=f&&"9">=f;)a+=f,d();if("."===f)for(a+=".";d()&&"0"<=f&&"9">=f;)a+=f;if("e"===f||"E"===f){a+=f;d();if("-"===f||"+"===f)a+=f,d();for(;"0"<=f&&"9">=f;)a+=f,d()}a=+a;if(isFinite(a))return a;g("Bad number")}function d(a){a&&a!==f&&g("Expected '"+a+"' instead of '"+f+"'");f=p.charAt(k);k+=1;return f}function g(a){throw{name:"SyntaxError",message:a,La:k,text:p};}var k,f,h={'"':'"',"\\":"\\","/":"/",u:"\b",H:"\f",n:"\n",r:"\r",t:"\t"},
p;var u=function(){b();switch(f){case "{":a:{var k={};if("{"===f){d("{");b();if("}"===f){d("}");var h=k;break a}for(;f;){h=c();b();d(":");Object.hasOwnProperty.call(k,h)&&g('Duplicate key "'+h+'"');k[h]=u();b();if("}"===f){d("}");h=k;break a}d(",");b()}}g("Bad object");h=void 0}return h;case "[":a:{h=[];if("["===f){d("[");b();if("]"===f){d("]");break a}for(;f;){h.push(u());b();if("]"===f){d("]");break a}d(",");b()}}g("Bad array");h=void 0}return h;case '"':return c();case "-":return e();default:return"0"<=
f&&"9">=f?e():a()}};return function(a,c){p=a;k=0;f=" ";a=u();b();f&&g("Syntax error");return"function"===typeof c?function r(a,b){var d,e=a[b];if(e&&"object"===typeof e)for(d in e)if(Object.prototype.hasOwnProperty.call(e,d)){var f=r(e,d);void 0!==f?e[d]=f:delete e[d]}return c.call(a,b,e)}({"":a},""):a}}(),J=function(){function a(a){return 10>a?"0"+a:a}function b(a){e.lastIndex=0;return e.test(a)?'"'+a.replace(e,function(a){var b=k[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+
'"':'"'+a+'"'}function c(a,e){var k=d,h=e[a];h&&"object"===typeof h&&"function"===typeof h.toJSON&&(h=h.toJSON(a));"function"===typeof f&&(h=f.call(e,a,h));switch(typeof h){case "string":return b(h);case "number":return isFinite(h)?String(h):"null";case "boolean":case "null":return String(h);case "object":if(!h)return"null";d+=g;var p=[];if("[object Array]"===Object.prototype.toString.apply(h)){var z=h.length;for(a=0;a
(new Date).getTime())?(a.scope=new m(a.scope),a):null},S:function(){n.C.removeItem("amazon_Login_state_cache")}};function M(){return window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest||"undefined"!==typeof window.XDomainRequest?!0:!1}
function P(a,b,c,e,d,g){this.j=new Q(a,b,c);"string"==typeof e&&e||B("missing or invalid path: %s",e);this.i=e;"object"==typeof d&&(d=K(d));d&&"string"!=typeof d&&B("invalid query: %s",d);this.b=d||"";"object"==typeof g&&(g=K(g));g&&"string"!=typeof g&&B("invalid fragment: %s",g);this.a=g||""}
function L(a){var b=function(){var b=document.createElement("div");b.innerHTML="";b.firstChild.href=a;b.innerHTML=b.innerHTML;return b.firstChild}();""==b.host&&(b.href=b.href);return new P(b.protocol,b.hostname,function(){var a=b.port;a&&"0"!=a||(a=null);return a}(),function(){var a=b.pathname;a?"/"!=a[0]&&(a="/"+a):a="/";return a}(),b.search.substring(1),b.href.split("#")[1]||"")}l=P.prototype;l.scheme=function(){return this.j.scheme()};l.host=function(){return this.j.host()};l.port=function(){return this.j.port()};
l.path=function(){return this.i};l.query=function(){return this.b};l.v=function(){return this.a};function la(a){var b="http"==a.j.scheme();a=a.j.host();return b&&("localhost"==a||"127.0.0.1"==a)}l.toString=function(){var a=this.j.toString();a+=this.i;a+=this.b?"?"+this.b:"";return a+=this.a?"#"+this.a:""};
function na(a,b){return new P(void 0!==b.scheme?b.scheme:a.scheme(),void 0!==b.host?b.host:a.host(),void 0!==b.port?b.port:a.port(),void 0!==b.path?b.path:a.path(),void 0!==b.query?b.query:a.query(),void 0!==b.v?b.v:a.v())}
function Q(a,b,c){var e;"string"==typeof a&&(e=a.match(/^(https?)(:(\/\/)?)?$/i))||B("missing or invalid scheme: %s",a);this.a="http"==e[1]?"http":"https";if(a="string"==typeof b&&b)"string"==typeof b&&b||B("missing or invalid input: %s",b),a=0!=b.replace(/^\s+|\s+$/g,"").length;a||B("missing or invalid host: %s",b);this.i=b;c&&((c+"").match(/^\d+$/)||B("invalid port: %s",c),80==c&&"http"==this.a||443==c&&"https"==this.a)&&(c=null);this.b=c?c+"":null}Q.prototype.scheme=function(){return this.a};
Q.prototype.host=function(){return this.i};Q.prototype.port=function(){return this.b};Q.prototype.toString=function(){var a=this.a+"://";a+=this.i;return a+=this.b?":"+this.b:""};function R(a,b,c,e){return new P(a.a,a.i,a.b,b,c,e)}function ka(a){for(var b="",c=0;cb?0:b,0>c?0:c,800,540);N=window.open(a.toString(),"amazonloginpopup",b)}function h(){null!=N&&("function"==typeof N.close&&N.close(),N=null)}function p(a,b,c){var d={client_id:W,redirect_uri:b,response_type:a.response_type,language:sa,ui_locales:ta};a["com.amazon.oauth2.options"]&&(d["com.amazon.oauth2.options"]=a["com.amazon.oauth2.options"]);a.response_mode&&(d.response_mode=a.response_mode);a.scope&&(d.scope=a.scope.toString());a.direct_post_uri&&(d.direct_post_uri=a.direct_post_uri);a.scope_data&&
(d.scope_data=a.scope_data);fa&&(d.sandbox=!0);a.state&&(d.state=a.state);c&&(d.exac=c);a.delegated_requests&&(d.delegated_requests=J(a.delegated_requests));if((c=d.scope)&&-1!==c.indexOf("payments:widget")){c=d.sandbox;var e=d.scope_data;try{var f=e&&""!==e?JSON.parse(e):{}}catch(Ha){f={}}Ea(f,c,b);-1===JSON.stringify(f).indexOf("payments:widget")&&(f={},Ea(f,c,b));b=JSON.stringify(f);d.scope_data=b}a[r.m]&&(d[r.m]=a[r.m],d[r.N]=a[r.N]);!0!==a[r.w]||a[r.m]||(d[r.m]=w.Ba(d.client_id,d.redirect_uri),
d[r.N]="S256");a=R(O,"/ap/oa",d);if(8196=c?c:c-Math.min(Math.floor(.1*c),300);q.wa(a,b,c);t.na()?n.h.setItem(t.o,a.access_token,c):n.h.removeItem(t.o)};D.prototype.oa=function(a){this.W=a;aa(this.b,a);this.Y(Y.Z);for(a=0;aarguments.length&&B("authorize expects two arguments (options, next)");a&&"object"!=typeof a&&B("authorize expects options parameter to be an object");null!=b&&"function"!=typeof b&&"string"!=typeof b&&B("authorize expects next parameter to be a function or a string");a=c(a);var d=new D(a),e=d.b;d.Y(Y.pa);if(null!=b)e.onComplete(b);a.popup||"string"==typeof b?z(d):B("next must be redirect URI if !options.popup");
return e}})();
(function(){function a(a,c){try{var b=H(a)}catch(d){b=null}b&&b.error?(a={success:!1},a.error=C("%s: %s",b.error,b.error_description||"An unknown error occurred"),c(a)):b&&b.user_id?(a={success:!0},a.profile={PrimaryEmail:b.email,CustomerId:b.user_id,Name:b.name},c(a)):(a={success:!1,error:"UnknownError: Incomprehensible response from profile endpoint"},c(a))}x={ka:function(b,c){if(null==c&&"function"==typeof b)c=b,t.aa({scope:"profile"},function(a){null==a.error?x.ka(a.access_token,c):c({success:!1,
error:a.error})});else if(F("accessToken",b,"string"),F("callback",c,"function"),M()){b=R(t.T(),"/user/profile",{access_token:b},"").toString();if(window.XDomainRequest){var e=new window.XDomainRequest;e.onload=function(){a(e.responseText,c)}}else{var d=!1;e=new window.XMLHttpRequest;e.onreadystatechange=function(){d||4!=e.readyState||(d=!0,a(e.responseText,c))}}e.open("GET",b,!0);e.send()}else c({success:!1,error:"UnsupportedOperation: Cannot retrieve profile in this browser"})}}})();
(function(){function a(a,b,c){try{var d=H(a);n.h.removeItem(w.D)}catch(h){d=null}a={};d&&d.Error?(a.success=!1,a.error=C("%s: %s",d.Error.Code||"UnknownError",d.Error.Message||"An unknown error occurred")):d&&d.access_token?(a.success=!0,a.access_token=d.access_token,a.token_type=d.token_type,a.expires_in=d.expires_in,(b=q.Aa(b))&&t.ba(d,b)):(a.success=!1,a.error="UnknownError: Incomprehensible response from token endpoint");c(a)}function b(a,b){a={grant_type:"authorization_code",client_id:a.client_id,
redirect_uri:decodeURIComponent(a.redirect_uri),code_verifier:a.code_verifier,code:b};return J(a)}function c(){var a=n.h.getItem(w.D);return a?H(a):null}function e(){var a=q.U();return a?{success:!0,access_token:a.access_token,token_type:"bearer",expires_in:Math.floor((a.expiration_date-(new Date).getTime())/1E3),scope:a.scope.toString()}:null}w={D:"amazon_Login_pkce_params",ra:240,Ba:function(a,b){var d,e=c();e&&(e.client_id!=a?n.h.removeItem(w.D):e.code_verifier&&(d=e.code_verifier));if(!d){d="";
for(e=128;0>>e:a[b/32|0]>>>e)&(1<>b-1,1));
return a},B:function(a,b,c){return 32===a?b:(c?b|0:b<<32-a)+1099511627776*a},V:function(a){return Math.round(a/1099511627776)||32},Ra:function(a,b){if(Z.g.A(a)!==Z.g.A(b))return!1;var c=0,e;for(e=0;e>>b),c=a[d]<<32-b;d=a.length?a[a.length-1]:0;a=Z.g.V(d);e.push(Z.g.B(b+a&31,32>>24|c>>>8&65280|(c&65280)<<8|c<<24}return a}}};Z.l.Ka={I:function(a){var b="",c=Z.g.A(a),e,d;for(e=0;e>>8>>>8>>>8),d<<=8;return decodeURIComponent(escape(b))},L:function(a){a=unescape(encodeURIComponent(a));var b=[],c,e=0;for(c=0;c>>d)>>>26),6>d?(k=a[c]<<6-d,d+=26,c++):(k<<=6,d-=6);for(;e.length&3&&!b;)e+="=";return e},L:function(a,b){a=a.replace(/\s|=/g,"");var c=[],e=0,d=Z.l.F.ea,g=0;b&&(d=d.substr(0,62)+"-_");for(b=0;bk)throw new Z.da.ia("this isn't base64!");26>>e),g=k<<32-e):(e+=6,g^=k<<32-e)}e&56&&c.push(Z.g.B(e&56,g,1));return c}};Z.l.ua={I:function(a){return Z.l.F.I(a,1,1)},L:function(a){return Z.l.F.L(a,1)}};Z.hash.K=function(a){this.H[0]||Fa(this);a?(this.G=a.G.slice(0),this.u=a.u.slice(0),this.s=a.s):this.reset()};Z.hash.K.hash=function(a){a=(new Z.hash.K).update(a);var b,c=a.u,e=a.G;c=Z.g.concat(c,[Z.g.B(1,1)]);for(b=c.length+2;b&15;b++)c.push(0);c.push(Math.floor(a.s/4294967296));for(c.push(a.s|0);c.length;)Ga(a,c.splice(0,16));a.reset();return e};
Z.hash.K.prototype={reset:function(){this.G=this.ga.slice(0);this.u=[];this.s=0;return this},update:function(a){"string"===typeof a&&(a=Z.l.Ka.L(a));var b=this.u=Z.g.concat(this.u,a);var c=this.s;a=this.s=c+Z.g.A(a);if(9007199254740991a;a++)16>a?c=b[a]:(c=b[a+1&15],e=b[a+14&15],c=b[a&15]=(c>>>7^c>>>18^c>>>3^c<<25^c<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+b[a&15]+b[a+9&15]|0),c=c+z+(u>>>6^u>>>11^u>>>25^u<<26^u<<21^u<<7)+(D^u&(I^D))+g[a],z=D,D=I,I=u,u=p+c|0,p=h,h=f,f=k,k=c+(f&h^p&(f^h))+(f>>>2^f>>>13^f>>>22^f<<30^f<<19^f<<10)|0;d[0]=d[0]+k|0;d[1]=d[1]+f|0;d[2]=d[2]+h|0;d[3]=d[3]+p|0;d[4]=d[4]+u|0;d[5]=d[5]+I|0;d[6]=d[6]+D|0;d[7]=
d[7]+z|0}function Fa(a){function b(a){return 4294967296*(a-Math.floor(a))|0}for(var c=0,e=2,d,g;64>c;e++){g=!0;for(d=2;d*d<=e;d++)if(0===e%d){g=!1;break}g&&(8>c&&(a.ga[c]=b(Math.pow(e,.5))),a.H[c]=b(Math.pow(e,1/3)),c++)}}"undefined"!==typeof module&&module.ya&&(module.ya=Z);"function"===typeof define&&define([],function(){return Z});
})();
}