New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

post-robot

Package Overview
Dependencies
Maintainers
2
Versions
246
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

post-robot - npm Package Compare versions

Comparing version 9.0.32 to 9.0.33

90

dist/module/serialize/function.js

@@ -17,5 +17,5 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

function addMethod(id, val, source, domain) {
function addMethod(id, val, name, source, domain) {
if (ProxyWindow.isProxyWindow(source)) {
proxyWindowMethods.set(id, { val: val, domain: domain, source: source });
proxyWindowMethods.set(id, { val: val, name: name, domain: domain, source: source });
} else {

@@ -27,3 +27,3 @@ proxyWindowMethods.del(id);

});
methods[id] = { domain: domain, val: val, source: source };
methods[id] = { domain: domain, name: name, val: val, source: source };
}

@@ -105,19 +105,16 @@ }

destination = ProxyWindow.unwrap(destination);
var name = val.__name__ || val.name || key;
if (ProxyWindow.isProxyWindow(destination)) {
addMethod(id, val, destination, domain);
addMethod(id, val, name, destination, domain);
// $FlowFixMe
destination.awaitWindow().then(function (win) {
addMethod(id, val, win, domain);
addMethod(id, val, name, win, domain);
});
} else {
// $FlowFixMe
var methods = methodStore.getOrSet(destination, function () {
return {};
});
methods[id] = { domain: domain, val: val };
addMethod(id, val, name, destination, domain);
}
return serializeType(SERIALIZATION_TYPE.CROSS_DOMAIN_FUNCTION, { id: id, name: val.name || key });
return serializeType(SERIALIZATION_TYPE.CROSS_DOMAIN_FUNCTION, { id: id, name: name });
}

@@ -129,50 +126,49 @@

function deserializedFunction(args) {
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var getDeserializedFunction = function getDeserializedFunction() {
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var originalStack = void 0;
function crossDomainFunctionWrapper() {
var _arguments = arguments;
if (__DEBUG__) {
originalStack = new Error('Original call to ' + name + '():').stack;
}
var originalStack = void 0;
return ProxyWindow.toProxyWindow(source).awaitWindow().then(function (win) {
var meth = lookupMethod(win, id);
if (__DEBUG__) {
originalStack = new Error('Original call to ' + name + '():').stack;
}
if (meth) {
var _meth$val;
return ProxyWindow.toProxyWindow(source).awaitWindow().then(function (win) {
var meth = lookupMethod(win, id);
return (_meth$val = meth.val).call.apply(_meth$val, [{ source: window, origin: getDomain() }].concat(args));
} else {
return global.send(win, MESSAGE_NAME.METHOD, { id: id, name: name, args: args }, _extends({ domain: origin }, opts)).then(function (_ref3) {
var data = _ref3.data;
return data.result;
});
}
})['catch'](function (err) {
// $FlowFixMe
if (__DEBUG__ && originalStack && err.stack) {
if (meth && meth.val !== crossDomainFunctionWrapper) {
return meth.val.apply({ source: window, origin: getDomain() }, _arguments);
} else {
return global.send(win, MESSAGE_NAME.METHOD, { id: id, name: name, args: Array.prototype.slice.call(_arguments) }, _extends({ domain: origin }, opts)).then(function (_ref3) {
var data = _ref3.data;
return data.result;
});
}
})['catch'](function (err) {
// $FlowFixMe
err.stack = err.stack + '\n\n' + originalStack;
}
throw err;
});
}
if (__DEBUG__ && originalStack && err.stack) {
// $FlowFixMe
err.stack = err.stack + '\n\n' + originalStack;
}
throw err;
});
}
function crossDomainFunctionWrapper() {
return deserializedFunction(Array.prototype.slice.call(arguments));
}
crossDomainFunctionWrapper.__name__ = name;
crossDomainFunctionWrapper.__origin__ = origin;
crossDomainFunctionWrapper.__source__ = source;
crossDomainFunctionWrapper.__id__ = id;
crossDomainFunctionWrapper.fireAndForget = function crossDomainFireAndForgetFunctionWrapper() {
return deserializedFunction(Array.prototype.slice.call(arguments), { fireAndForget: true });
crossDomainFunctionWrapper.origin = origin;
return crossDomainFunctionWrapper;
};
crossDomainFunctionWrapper.__name__ = name;
crossDomainFunctionWrapper.__origin__ = origin;
crossDomainFunctionWrapper.__source__ = source;
crossDomainFunctionWrapper.__id__ = id;
var crossDomainFunctionWrapper = getDeserializedFunction();
crossDomainFunctionWrapper.fireAndForget = getDeserializedFunction({ fireAndForget: true });
crossDomainFunctionWrapper.origin = origin;
return crossDomainFunctionWrapper;
}

@@ -1,2 +0,2 @@

!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("postRobot",[],e):"object"==typeof exports?exports.postRobot=e():n.postRobot=e()}("undefined"!=typeof self?self:this,function(){return function(n){var e={};function t(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:r})},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=13)}([function(n,e,t){"use strict";var r=t(14);t.d(e,"getActualDomain",function(){return r.a}),t.d(e,"getAncestor",function(){return r.b}),t.d(e,"getDomain",function(){return r.c}),t.d(e,"getDomainFromUrl",function(){return r.d}),t.d(e,"getFrameByName",function(){return r.e}),t.d(e,"getOpener",function(){return r.f}),t.d(e,"getParent",function(){return r.g}),t.d(e,"getUserAgent",function(){return r.h}),t.d(e,"isActuallySameDomain",function(){return r.i}),t.d(e,"isAncestor",function(){return r.j}),t.d(e,"isOpener",function(){return r.k}),t.d(e,"isSameDomain",function(){return r.l}),t.d(e,"isSameTopWindow",function(){return r.m}),t.d(e,"isWindow",function(){return r.n}),t.d(e,"isWindowClosed",function(){return r.o}),t.d(e,"linkFrameWindow",function(){return r.p}),t.d(e,"matchDomain",function(){return r.q}),t.d(e,"normalizeMockUrl",function(){return r.r}),t.d(e,"stringifyDomainPattern",function(){return r.s});var o=t(15);t.n(o),t.o(o,"WINDOW_TYPE")&&t.d(e,"WINDOW_TYPE",function(){return o.WINDOW_TYPE});var i=t(9);t.d(e,"WINDOW_TYPE",function(){return i.c})},function(n,e,t){"use strict";var r,o={REQUEST:"postrobot_message_request",RESPONSE:"postrobot_message_response",ACK:"postrobot_message_ack"},i={SUCCESS:"success",ERROR:"error"},a={METHOD:"postrobot_method",HELLO:"postrobot_hello",OPEN_TUNNEL:"postrobot_open_tunnel"},u={POSTROBOT:"__postRobot__"},c={POST_MESSAGE:"postrobot_post_message",BRIDGE:"postrobot_bridge",GLOBAL:"postrobot_global"},s={MOCK:"mock:",FILE:"file:"},f={CROSS_DOMAIN_ZALGO_PROMISE:"cross_domain_zalgo_promise",CROSS_DOMAIN_FUNCTION:"cross_domain_function",CROSS_DOMAIN_WINDOW:"cross_domain_window"},d={BRIDGE_TIMEOUT:5e3,CHILD_WINDOW_TIMEOUT:5e3,ACK_TIMEOUT:2e3,ACK_TIMEOUT_KNOWN:1e4,RES_TIMEOUT:-1,ALLOWED_POST_MESSAGE_METHODS:(r={},r[c.POST_MESSAGE]=!0,r[c.BRIDGE]=!0,r[c.GLOBAL]=!0,r)};t.d(e,"b",function(){return d}),t.d(e,"e",function(){return o}),t.d(e,"c",function(){return i}),t.d(e,"d",function(){return a}),t.d(e,"j",function(){return u}),t.d(e,"g",function(){return c}),t.d(e,"f",function(){return s}),t.d(e,"a",function(){return"__postrobot_bridge__"}),t.d(e,!1,function(){return"__postrobot_proxy__"}),t.d(e,"i",function(){return"*"}),t.d(e,"h",function(){return f})},function(n,e,t){"use strict";function r(n){try{if(!n)return!1;if("undefined"!=typeof Promise&&n instanceof Promise)return!0;if("undefined"!=typeof window&&window.Window&&n instanceof window.Window)return!1;if("undefined"!=typeof window&&window.constructor&&n instanceof window.constructor)return!1;var e={}.toString;if(e){var t=e.call(n);if("[object Window]"===t||"[object global]"===t||"[object DOMWindow]"===t)return!1}if("function"==typeof n.then)return!0}catch(n){return!1}return!1}function o(){var n=void 0;if("undefined"!=typeof window)n=window;else{if("undefined"==typeof window)throw new TypeError("Can not find global");n=window}var e=n.__zalgopromise__=n.__zalgopromise__||{};return e.flushPromises=e.flushPromises||[],e.activeCount=e.activeCount||0,e.possiblyUnhandledPromiseHandlers=e.possiblyUnhandledPromiseHandlers||[],e.dispatchedErrors=e.dispatchedErrors||[],e}var i=function(){function n(e){var t=this;if(function(e,t){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],e){var r=void 0,o=void 0,i=!1,a=!1,u=!1;try{e(function(n){u?t.resolve(n):(i=!0,r=n)},function(n){u?t.reject(n):(a=!0,o=n)})}catch(n){return void this.reject(n)}u=!0,i?this.resolve(r):a&&this.reject(o)}}return n.prototype.resolve=function(n){if(this.resolved||this.rejected)return this;if(r(n))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=n,this.dispatch(),this},n.prototype.reject=function(n){var e=this;if(this.resolved||this.rejected)return this;if(r(n))throw new Error("Can not reject promise with another promise");if(!n){var t=n&&"function"==typeof n.toString?n.toString():Object.prototype.toString.call(n);n=new Error("Expected reject to be called with Error, got "+t)}return this.rejected=!0,this.error=n,this.errorHandled||setTimeout(function(){e.errorHandled||function(n,e){if(-1===o().dispatchedErrors.indexOf(n)){o().dispatchedErrors.push(n),setTimeout(function(){throw n},1);for(var t=0;t<o().possiblyUnhandledPromiseHandlers.length;t++)o().possiblyUnhandledPromiseHandlers[t](n,e)}}(n,e)},1),this.dispatch(),this},n.prototype.asyncReject=function(n){return this.errorHandled=!0,this.reject(n),this},n.prototype.dispatch=function(){var e=this,t=this.dispatching,i=this.resolved,a=this.rejected,u=this.handlers;if(!t&&(i||a)){this.dispatching=!0,o().activeCount+=1;for(var c=function(t){var o=u[t],c=o.onSuccess,s=o.onError,f=o.promise,d=void 0;if(i)try{d=c?c(e.value):e.value}catch(n){return f.reject(n),"continue"}else if(a){if(!s)return f.reject(e.error),"continue";try{d=s(e.error)}catch(n){return f.reject(n),"continue"}}d instanceof n&&(d.resolved||d.rejected)?(d.resolved?f.resolve(d.value):f.reject(d.error),d.errorHandled=!0):r(d)?d instanceof n&&(d.resolved||d.rejected)?d.resolved?f.resolve(d.value):f.reject(d.error):d.then(function(n){f.resolve(n)},function(n){f.reject(n)}):f.resolve(d)},s=0;s<u.length;s++)c(s);u.length=0,this.dispatching=!1,o().activeCount-=1,0===o().activeCount&&n.flushQueue()}},n.prototype.then=function(e,t){if(e&&"function"!=typeof e&&!e.call)throw new Error("Promise.then expected a function for success handler");if(t&&"function"!=typeof t&&!t.call)throw new Error("Promise.then expected a function for error handler");var r=new n;return this.handlers.push({promise:r,onSuccess:e,onError:t}),this.errorHandled=!0,this.dispatch(),r},n.prototype.catch=function(n){return this.then(void 0,n)},n.prototype.finally=function(e){if(e&&"function"!=typeof e&&!e.call)throw new Error("Promise.finally expected a function");return this.then(function(t){return n.try(e).then(function(){return t})},function(t){return n.try(e).then(function(){throw t})})},n.prototype.timeout=function(n,e){var t=this;if(this.resolved||this.rejected)return this;var r=setTimeout(function(){t.resolved||t.rejected||t.reject(e||new Error("Promise timed out after "+n+"ms"))},n);return this.then(function(n){return clearTimeout(r),n})},n.prototype.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.resolve=function(e){return e instanceof n?e:r(e)?new n(function(n,t){return e.then(n,t)}):(new n).resolve(e)},n.reject=function(e){return(new n).reject(e)},n.asyncReject=function(e){return(new n).asyncReject(e)},n.all=function(e){var t=new n,o=e.length,i=[];if(!o)return t.resolve(i),t;for(var a=function(a){var u=e[a];if(u instanceof n){if(u.resolved)return i[a]=u.value,o-=1,"continue"}else if(!r(u))return i[a]=u,o-=1,"continue";n.resolve(u).then(function(n){i[a]=n,0==(o-=1)&&t.resolve(i)},function(n){t.reject(n)})},u=0;u<e.length;u++)a(u);return 0===o&&t.resolve(i),t},n.hash=function(e){var t={};return n.all(Object.keys(e).map(function(r){return n.resolve(e[r]).then(function(n){t[r]=n})})).then(function(){return t})},n.map=function(e,t){return n.all(e.map(t))},n.onPossiblyUnhandledException=function(n){return function(n){return o().possiblyUnhandledPromiseHandlers.push(n),{cancel:function(){o().possiblyUnhandledPromiseHandlers.splice(o().possiblyUnhandledPromiseHandlers.indexOf(n),1)}}}(n)},n.try=function(e,t,r){if(e&&"function"!=typeof e&&!e.call)throw new Error("Promise.try expected a function");var o=void 0;try{o=e.apply(t,r||[])}catch(e){return n.reject(e)}return n.resolve(o)},n.delay=function(e){return new n(function(n){setTimeout(n,e)})},n.isPromise=function(e){return!!(e&&e instanceof n)||r(e)},n.flush=function(){var e=new n;return o().flushPromises.push(e),0===o().activeCount&&n.flushQueue(),e},n.flushQueue=function(){var n=o().flushPromises;o().flushPromises=[];for(var e=0,t=null==n?0:n.length;e<t;e++)n[e].resolve()},n}();t.d(e,"a",function(){return i})},function(n,e,t){"use strict";t(10);var r=t(11);t.d(e,"addEventListener",function(){return r.a}),t(16),t(17),t(12);var o=t(6);t.d(e,"getOrSet",function(){return o.d}),t.d(e,"isRegex",function(){return o.f}),t.d(e,"memoizePromise",function(){return o.h}),t.d(e,"noop",function(){return o.i}),t.d(e,"once",function(){return o.j}),t.d(e,"safeInterval",function(){return o.m}),t.d(e,"stringifyError",function(){return o.o}),t.d(e,"uniqueID",function(){return o.q}),t.d(e,"weakMapMemoize",function(){return o.r}),t.d(e,"weakMapMemoizePromise",function(){return o.s}),t(18);var i=t(19);t.n(i),t(20),t(21),t(22)},function(n,e,t){"use strict";t.d(e,"a",function(){return a}),e.c=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;function t(n){return u.getOrSet(n,e)}return{has:function(e){return t(e).hasOwnProperty(n)},get:function(e,r){var o=t(e);return o.hasOwnProperty(n)?o[n]:r},set:function(e,r){return t(e)[n]=r,r},del:function(e){delete t(e)[n]},getOrSet:function(e,r){var o=t(e);if(o.hasOwnProperty(n))return o[n];var i=r();return o[n]=i,i}}},e.b=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,t=Object(o.getOrSet)(a,n,e);return{has:function(n){return t.hasOwnProperty(n)},get:function(n,e){return t.hasOwnProperty(n)?t[n]:e},set:function(n,e){return t[n]=e,e},del:function(n){delete t[n]},getOrSet:function(n,e){if(t.hasOwnProperty(n))return t[n];var r=e();return t[n]=r,r},reset:function(){t=e()},keys:function(){return Object.keys(t)}}},t(0);var r=t(8),o=t(3),i=t(1),a=window[i.j.POSTROBOT]=window[i.j.POSTROBOT]||{},u=a.windowStore=a.windowStore||new r.a,c=function(){return{}}},function(n,e,t){"use strict";var r=t(0),o=t(2),i=t(3),a=t(1),u=t(4);u.a.instanceID=u.a.instanceID||Object(i.uniqueID)();var c=Object(u.c)("helloPromises");function s(n){return c.getOrSet(n,function(){return new o.a})}var f=Object(i.once)(function(){u.a.on(a.d.HELLO,{domain:a.i},function(n){var e=n.source,t=n.origin;return s(e).resolve({win:e,domain:t}),{instanceID:u.a.instanceID}})});function d(n){return u.a.send(n,a.d.HELLO,{instanceID:u.a.instanceID},{domain:a.i,timeout:-1}).then(function(e){var t=e.origin,r=e.data.instanceID;return s(n).resolve({win:n,domain:t}),{win:n,domain:t,instanceID:r}})}var l=Object(i.weakMapMemoizePromise)(function(n){return d(n).then(function(n){return n.instanceID})});function w(){f();var n=Object(r.getAncestor)();n&&d(n).catch(i.noop)}function h(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Window",r=s(n);return-1!==e&&(r=r.timeout(e,new Error(t+" did not load after "+e+"ms"))),r}function m(){return!!Object(r.getUserAgent)(window).match(/MSIE|rv:11|trident|edge\/12|edge\/13/i)}var p=Object(u.c)("knownWindows");function g(n){p.set(n,!0)}function v(n){return p.get(n,!1)}t.d(e,"g",function(){return d}),t.d(e,"b",function(){return l}),t.d(e,"c",function(){return w}),t.d(e,"a",function(){return h}),t.d(e,"f",function(){return m}),t.d(e,"e",function(){return g}),t.d(e,"d",function(){return v})},function(n,e,t){"use strict";e.q=a,e.c=function(){if("undefined"!=typeof window)return window;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("No global found")},e.g=function(n){var e=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new o.a;function i(){for(var e=arguments.length,o=Array(e),i=0;i<e;i++)o[i]=arguments[i];var a=r.getOrSet(t.thisNamespace?this:n,function(){return{}}),u=c(o),s=t.time;if(a[u]&&s&&Date.now()-a[u].time<s&&delete a[u],a[u])return a[u].value;var f=Date.now(),d=n.apply(this,arguments);return a[u]={time:f,value:d},a[u].value}return i.reset=function(){r.delete(t.thisNamespace?e:n)},t.name&&(i.displayName=t.name+":memoized"),i},e.h=function(n){var e={};function t(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=c(r);return e.hasOwnProperty(i)?e[i]:(e[i]=n.apply(this,arguments).finally(function(){delete e[i]}),e[i])}return t.reset=function(){e={}},t},e.k=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};function t(){return r.a.try(n,this,arguments)}return e.name&&(t.displayName=e.name+":promisified"),t},e.e=function(n,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=n.__inline_memoize_cache__=n.__inline_memoize_cache__||{},o=c(t);return r.hasOwnProperty(o)?r[o]:r[o]=e.apply(void 0,t)},e.i=function(){},e.j=function(n){var e=!1;return function(){if(!e)return e=!0,n.apply(this,arguments)}},e.o=function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(t>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+Object.prototype.toString.call(e)+">";if("string"==typeof e)return e;if(e instanceof Error){var r=e&&e.stack,o=e&&e.message;if(r&&o)return-1!==r.indexOf(o)?r:o+"\n"+r;if(r)return r;if(o)return o}return"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)}catch(e){return"Error while stringifying error: "+n(e,t+1)}},e.n=function(n){return"string"==typeof n?n:n&&"function"==typeof n.toString?n.toString():Object.prototype.toString.call(n)},e.b=function(n,e){if(!e)return n;if(Object.assign)return Object.assign(n,e);for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n},e.m=function(n,e){var t=void 0;return function r(){t=setTimeout(function(){n(),r()},e)}(),{cancel:function(){clearTimeout(t)}}},e.a=function(n){return n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()},e.f=function(n){return"[object RegExp]"===Object.prototype.toString.call(n)},t.d(e,"r",function(){return s}),t.d(e,"s",function(){return f}),e.d=function(n,e,t){if(n.hasOwnProperty(e))return n[e];var r=t();return n[e]=r,r},e.p=function(n){var e=void 0,t=void 0;try{e=n()}catch(n){t=n}return{result:e,error:t}},e.l=function(n,e){var t=n.indexOf(e);-1!==t&&n.splice(t,1)};var r=t(2),o=t(8),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function a(){var n="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,function(){return n.charAt(Math.floor(Math.random()*n.length))})+"_"+function(n){if("function"==typeof btoa)return btoa(n);if("undefined"!=typeof Buffer)return Buffer.from(n,"utf8").toString("base64");throw new Error("Can not find window.btoa or Buffer")}((new Date).toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var u=void 0;function c(n){try{return JSON.stringify(Array.prototype.slice.call(n),function(n,e){return"function"==typeof e?"memoize["+function(n){if(u=u||new o.a,null===n||void 0===n||"object"!==(void 0===n?"undefined":i(n))&&"function"!=typeof n)throw new Error("Invalid object");var e=u.get(n);return e||(e=(void 0===n?"undefined":i(n))+":"+a(),u.set(n,e)),e}(e)+"]":e})}catch(n){throw new Error("Arguments not serializable -- can not be used to memoize")}}var s=function(n){var e=new o.a;return function(t){var r=this;return e.getOrSet(t,function(){return n.call(r,t)})}},f=function(n){var e=new o.a;return function(t){var r=this;return e.getOrSet(t,function(){return n.call(r,t).finally(function(){e.delete(t)})})}}},function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(2),o=t(0),i=t(3),a=t(1),u=t(4),c=Object(u.b)("tunnelWindows");function s(){return!!Object(o.getUserAgent)(window).match(/MSIE|trident|edge\/12|edge\/13/i)}function f(n){return!Object(o.isSameTopWindow)(window,n)}function d(n,e){if(n){if(Object(o.getDomain)()!==Object(o.getDomainFromUrl)(n))return!0}else if(e&&!Object(o.isSameDomain)(e))return!0;return!1}function l(n){var e=n.win,t=n.domain;return!(!s()||t&&!d(t,e)||e&&!f(e))}function w(n){var e=(n=n||Object(o.getDomainFromUrl)(n)).replace(/[^a-zA-Z0-9]+/g,"_");return a.a+"_"+e}function h(){return Boolean(window.name&&window.name===w(Object(o.getDomain)()))}u.a.openTunnelToParent=function(n){var e=n.name,t=n.source,r=n.canary,s=n.sendMessage,f=Object(o.getParent)(window);if(!f)throw new Error("No parent window found to open tunnel to");var d=function(n){var e=n.name,t=n.source,r=n.canary,a=n.sendMessage;!function(){for(var n=0,e=c.keys(),t=null==e?0:e.length;n<t;n++){var r=e[n],a=c[r];try{Object(i.noop)(a.source)}catch(n){c.del(r);continue}Object(o.isWindowClosed)(a.source)&&c.del(r)}}();var u=Object(i.uniqueID)();return c.set(u,{name:e,source:t,canary:r,sendMessage:a}),u}({name:e,source:t,canary:r,sendMessage:s});return u.a.send(f,a.d.OPEN_TUNNEL,{name:e,sendMessage:function(){var n=c.get(d);try{Object(i.noop)(n&&n.source)}catch(n){return void c.del(d)}if(n&&n.source&&!Object(o.isWindowClosed)(n.source)){try{n.canary()}catch(n){return}n.sendMessage.apply(this,arguments)}}},{domain:a.i})};var m=new r.a(function(n){if(window.document&&window.document.body)return n(window.document.body);var e=setInterval(function(){if(window.document&&window.document.body)return clearInterval(e),n(window.document.body)},10)}),p=Object(u.c)("remoteWindows");function g(n){p.getOrSet(n,function(){return new r.a})}function v(n){var e=p.get(n);if(!e)throw new Error("Remote window not found");return e}function y(n,e,t){v(n).resolve(function(r,i,a){if(r!==n)throw new Error("Remote window does not match window");if(!Object(o.matchDomain)(i,e))throw new Error("Remote domain "+i+" does not match domain "+e);t(a)})}function O(n,e){v(n).reject(e).catch(i.noop)}function b(n,e,t){var r=Object(o.isOpener)(window,n),i=Object(o.isOpener)(n,window);if(!r&&!i)throw new Error("Can only send messages to and from parent and popup windows");return v(n).then(function(r){return r(n,e,t)})}var E=Object(i.weakMapMemoize)(function(n){return r.a.try(function(){try{var e=Object(o.getFrameByName)(n,w(Object(o.getDomain)()));if(!e)return;return Object(o.isSameDomain)(e)&&e[a.j.POSTROBOT]?e:new r.a(function(n){var t=void 0,r=void 0;t=setInterval(function(){if(e&&Object(o.isSameDomain)(e)&&e[a.j.POSTROBOT])return clearInterval(t),clearTimeout(r),n(e)},100),r=setTimeout(function(){return clearInterval(t),n()},2e3)})}catch(n){}})});function j(){return r.a.try(function(){var n=Object(o.getOpener)(window);if(n&&l({win:n}))return g(n),E(n).then(function(e){return e?window.name?e[a.j.POSTROBOT].openTunnelToParent({name:window.name,source:window,canary:function(){},sendMessage:function(n){try{Object(i.noop)(window)}catch(n){return}if(window&&!window.closed)try{u.a.receiveMessage({data:n,origin:this.origin,source:this.source})}catch(n){r.a.reject(n)}}}).then(function(e){var t=e.source,r=e.origin,o=e.data;if(t!==n)throw new Error("Source does not match opener");y(t,r,o.sendMessage)}).catch(function(e){throw O(n,e),e}):O(n,new Error("Can not register with opener: window does not have a name")):O(n,new Error("Can not register with opener: no bridge found in opener"))})})}var _=t(5),S=Object(u.b)("bridges"),W=Object(u.b)("bridgeFrames"),D=Object(u.b)("popupWindowsByName"),T=Object(u.c)("popupWindowsByWin");function P(n,e){return S.has(e||Object(o.getDomainFromUrl)(n))}function I(n,e){return e=e||Object(o.getDomainFromUrl)(n),S.getOrSet(e,function(){return r.a.try(function(){if(Object(o.getDomain)()===e)throw new Error("Can not open bridge on the same domain as current domain: "+e);var t=w(e);if(Object(o.getFrameByName)(window,t))throw new Error("Frame with name "+t+" already exists on page");var i=function(n,e){var t=document.createElement("iframe");return t.setAttribute("name",n),t.setAttribute("id",n),t.setAttribute("style","display: none; margin: 0; padding: 0; border: 0px none; overflow: hidden;"),t.setAttribute("frameborder","0"),t.setAttribute("border","0"),t.setAttribute("scrolling","no"),t.setAttribute("allowTransparency","true"),t.setAttribute("tabindex","-1"),t.setAttribute("hidden","true"),t.setAttribute("title",""),t.setAttribute("role","presentation"),t.src=e,t}(t,n);return W.set(e,i),m.then(function(t){t.appendChild(i);var o=i.contentWindow;return function(n,e){u.a.on(a.d.OPEN_TUNNEL,{window:n,domain:e},function(n){var t=n.origin,o=n.data;if(t!==e)throw new Error("Domain "+e+" does not match origin "+t);if(!o.name)throw new Error("Register window expected to be passed window name");if(!o.sendMessage)throw new Error("Register window expected to be passed sendMessage method");if(!D.has(o.name))throw new Error("Window with name "+o.name+" does not exist, or was not opened by this window");if(!D.get(o.name).domain)throw new Error("We do not have a registered domain for window "+o.name);if(D.get(o.name).domain!==t)throw new Error("Message origin "+t+" does not matched registered window origin "+D.get(o.name).domain);return y(D.get(o.name).win,e,o.sendMessage),{sendMessage:function(n){if(window&&!window.closed){var e=D.get(o.name);if(e)try{u.a.receiveMessage({data:n,origin:e.domain,source:e.win})}catch(n){r.a.reject(n)}}}}})}(o,e),new r.a(function(n,e){i.onload=n,i.onerror=e}).then(function(){return Object(_.a)(o,a.b.BRIDGE_TIMEOUT,"Bridge "+n)}).then(function(){return o})})})})}function R(n){for(var e=n.win,t=n.name,r=n.domain,i=0,a=D.keys(),u=null==a?0:a.length;i<u;i++){var c=a[i];Object(o.isWindowClosed)(D.get(c).win)&&D.del(c)}var s=T.getOrSet(e,function(){return t?D.getOrSet(t,function(){return{win:e,name:t}}):{win:e}});if(s.win&&s.win!==e)throw new Error("Different window already linked for window: "+(t||"undefined"));if(t){if(s.name&&s.name!==t)throw new Error("Different window already linked for name "+t+": "+s.name);s.name=t,D.set(t,s)}return r&&(s.domain=r,g(e)),T.set(e,s),s}function A(n,e){R({win:n,domain:Object(o.getDomainFromUrl)(e)})}var M=window.open;function N(){for(var n=0,e=W.keys(),t=null==e?0:e.length;n<t;n++){var r=e[n],o=W.get(r);o&&o.parentNode&&o.parentNode.removeChild(o)}W.reset(),S.reset()}window.open=function(n,e,t,r){var i=M.call(this,Object(o.normalizeMockUrl)(n),e,t,r);return i?(R({win:i,name:e,domain:n?Object(o.getDomainFromUrl)(n):null}),i):i},t.d(e,"openTunnelToOpener",function(){return j}),t.d(e,"needsBridgeForBrowser",function(){return s}),t.d(e,"needsBridgeForWin",function(){return f}),t.d(e,"needsBridgeForDomain",function(){return d}),t.d(e,"needsBridge",function(){return l}),t.d(e,"getBridgeName",function(){return w}),t.d(e,"isBridge",function(){return h}),t.d(e,"documentBodyReady",function(){return m}),t.d(e,"registerRemoteWindow",function(){return g}),t.d(e,"findRemoteWindow",function(){return v}),t.d(e,"registerRemoteSendMessage",function(){return y}),t.d(e,"rejectRemoteSendMessage",function(){return O}),t.d(e,"sendBridgeMessage",function(){return b}),t.d(e,"hasBridge",function(){return P}),t.d(e,"openBridge",function(){return I}),t.d(e,"linkWindow",function(){return R}),t.d(e,"linkUrl",function(){return A}),t.d(e,"destroyBridges",function(){return N})},function(n,e,t){"use strict";t.d({},"WeakMap",function(){return u});var r=t(0);function o(n,e){for(var t=0;t<n.length;t++)try{if(n[t]===e)return t}catch(n){}return-1}var i=Object.defineProperty,a=Date.now()%1e9,u=function(){function n(){if(function(e,t){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this),a+=1,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__"+a,function(){if("undefined"==typeof WeakMap)return!1;if(void 0===Object.freeze)return!1;try{var n=new WeakMap,e={};return Object.freeze(e),n.set(e,"__testvalue__"),"__testvalue__"===n.get(e)}catch(n){return!1}}())try{this.weakmap=new WeakMap}catch(n){}this.keys=[],this.values=[]}return n.prototype._cleanupClosedWindows=function(){for(var n=this.weakmap,e=this.keys,t=0;t<e.length;t++){var o=e[t];if(Object(r.isWindow)(o)&&Object(r.isWindowClosed)(o)){if(n)try{n.delete(o)}catch(n){}e.splice(t,1),this.values.splice(t,1),t-=1}}},n.prototype.isSafeToReadWrite=function(n){if(Object(r.isWindow)(n))return!1;try{n&&n.self,n&&n[this.name]}catch(n){return!1}return!0},n.prototype.set=function(n,e){if(!n)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{t.set(n,e)}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n)){var r=this.name,a=n[r];a&&a[0]===n?a[1]=e:i(n,r,{value:[n,e],writable:!0})}else{this._cleanupClosedWindows();var u=this.keys,c=this.values,s=o(u,n);-1===s?(u.push(n),c.push(e)):c[s]=e}},n.prototype.get=function(n){if(!n)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{if(e.has(n))return e.get(n)}catch(n){delete this.weakmap}if(!this.isSafeToReadWrite(n)){this._cleanupClosedWindows();var t=o(this.keys,n);if(-1===t)return;return this.values[t]}var r=n[this.name];if(r&&r[0]===n)return r[1]},n.prototype.delete=function(n){if(!n)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{e.delete(n)}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n)){var t=n[this.name];t&&t[0]===n&&(t[0]=t[1]=void 0)}else{this._cleanupClosedWindows();var r=this.keys,i=o(r,n);-1!==i&&(r.splice(i,1),this.values.splice(i,1))}},n.prototype.has=function(n){if(!n)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{if(e.has(n))return!0}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n)){var t=n[this.name];return!(!t||t[0]!==n)}return this._cleanupClosedWindows(),-1!==o(this.keys,n)},n.prototype.getOrSet=function(n,e){if(this.has(n))return this.get(n);var t=e();return this.set(n,t),t},n}();t.d(e,"a",function(){return u})},function(n,e,t){"use strict";t.d(e,"a",function(){return r}),t.d(e,"b",function(){return o}),t.d(e,"c",function(){return i});var r={MOCK:"mock:",FILE:"file:",ABOUT:"about:"},o="*",i={IFRAME:"iframe",POPUP:"popup"}},function(n,e,t){"use strict";e.a=function(){return!!(window.navigator.mockUserAgent||window.navigator.userAgent).match(/Android|webOS|iPhone|iPad|iPod|bada|Symbian|Palm|CriOS|BlackBerry|IEMobile|WindowsMobile|Opera Mini/i)}},function(n,e,t){"use strict";t(2),t(0),t(8);var r=t(6);t(10),e.b=function n(){return Object(r.e)(n,function(){try{if("undefined"==typeof window)return!1;if(window.localStorage){var n=Math.random().toString();window.localStorage.setItem("__test__localStorage__",n);var e=window.localStorage.getItem("__test__localStorage__");if(window.localStorage.removeItem("__test__localStorage__"),n===e)return!0}}catch(n){}return!1})},e.a=function(n,e,t){return n.addEventListener(e,t),{cancel:function(){n.removeEventListener(e,t)}}},"function"==typeof Symbol&&Symbol.iterator,Object.assign,Object.create(Error.prototype)},function(n,e,t){"use strict";e.a=function n(e){var t=e.name,i=e.version,a=void 0===i?"latest":i,u=e.lifetime,c=void 0===u?3e5:u;return Object(r.e)(n,function(){var n="__"+t+"_"+a+"_storage__",e=void 0;function i(t){var i=Object(o.b)(),a=void 0;if(e&&(a=e),!a&&i){var u=window.localStorage.getItem(n);u&&(a=JSON.parse(u))}a||(a=Object(r.c)()[n]),a||(a={id:Object(r.q)()}),a.id||(a.id=Object(r.q)()),e=a;var c=t(a);return i?window.localStorage.setItem(n,JSON.stringify(a)):Object(r.c)()[n]=a,e=null,c}function u(n){return i(function(e){var t=e.__session__,o=Date.now();return t&&o-t.created>c&&(t=null),t||(t={guid:Object(r.q)(),created:o}),e.__session__=t,n(t)})}return{getState:i,getID:function(){return i(function(n){return n.id})},getSessionState:function(n){return u(function(e){return e.state=e.state||{},n(e.state)})},getSessionID:function(){return u(function(n){return n.guid})}}},[{name:t,version:a,lifetime:c}])};var r=t(6),o=t(11)},function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={};t.d(r,"markWindowKnown",function(){return i.e}),t.d(r,"serializeMessage",function(){return A}),t.d(r,"deserializeMessage",function(){return M}),t.d(r,"ProxyWindow",function(){return _}),t.d(r,"cleanUpWindow",function(){return mn}),t.d(r,"Promise",function(){return y.a}),t.d(r,"bridge",function(){return pn}),t.d(r,"parent",function(){return hn}),t.d(r,"send",function(){return on}),t.d(r,"requestPromises",function(){return tn}),t.d(r,"request",function(){return rn}),t.d(r,"sendToParent",function(){return an}),t.d(r,"client",function(){return un}),t.d(r,"on",function(){return fn}),t.d(r,"listen",function(){return sn}),t.d(r,"once",function(){return dn}),t.d(r,"listener",function(){return ln}),t.d(r,"CONFIG",function(){return c.b}),t.d(r,"disable",function(){return wn});var o,i=t(5),a=t(0),u=t(3),c=t(1),s={FUNCTION:"function",ERROR:"error",PROMISE:"promise",REGEX:"regex",DATE:"date",ARRAY:"array",OBJECT:"object",STRING:"string",NUMBER:"number",BOOLEAN:"boolean",NULL:"null",UNDEFINED:"undefined"},f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function d(n){return"object"===(void 0===n?"undefined":f(n))&&null!==n&&"string"==typeof n.__type__}function l(n){return void 0===n?s.UNDEFINED:null===n?s.NULL:Array.isArray(n)?s.ARRAY:"function"==typeof n?s.FUNCTION:"object"===(void 0===n?"undefined":f(n))?n instanceof Error?s.ERROR:"function"==typeof n.then?s.PROMISE:"[object RegExp]"===Object.prototype.toString.call(n)?s.REGEX:"[object Date]"===Object.prototype.toString.call(n)?s.DATE:s.OBJECT:"string"==typeof n?s.STRING:"number"==typeof n?s.NUMBER:"boolean"==typeof n?s.BOOLEAN:void 0}function w(n,e){return{__type__:n,__val__:e}}var h,m=((o={})[s.FUNCTION]=function(){},o[s.ERROR]=function(n){var e=n.message,t=n.stack,r=n.code;return w(s.ERROR,{message:e,stack:t,code:r})},o[s.PROMISE]=function(){},o[s.REGEX]=function(n){return w(s.REGEX,n.source)},o[s.DATE]=function(n){return w(s.DATE,n.toJSON())},o[s.ARRAY]=function(n){return n},o[s.OBJECT]=function(n){return n},o[s.STRING]=function(n){return n},o[s.NUMBER]=function(n){return n},o[s.BOOLEAN]=function(n){return n},o[s.NULL]=function(n){return n},o),p={},g=((h={})[s.FUNCTION]=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},h[s.ERROR]=function(n){var e=n.message,t=n.stack,r=n.code,o=new Error(e);return o.code=r,o.stack=t+"\n\n"+o.stack,o},h[s.PROMISE]=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},h[s.REGEX]=function(n){return new RegExp(n)},h[s.DATE]=function(n){return new Date(n)},h[s.ARRAY]=function(n){return n},h[s.OBJECT]=function(n){return n},h[s.STRING]=function(n){return n},h[s.NUMBER]=function(n){return n},h[s.BOOLEAN]=function(n){return n},h[s.NULL]=function(n){return n},h),v={},y=t(2),O=t(4),b=Object(O.c)("winToProxyWindow"),E=Object(O.b)("idToProxyWindow");function j(){for(var n=0,e=E.keys(),t=null==e?0:e.length;n<t;n++){var r=e[n];E.get(r).shouldClean()&&E.del(r)}}var _=function(){function n(e,t){!function(e,t){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.isProxyWindow=!0,this.serializedWindow=e,this.actualWindowPromise=new y.a,t&&this.setWindow(t),this.serializedWindow.getInstanceID=Object(u.memoizePromise)(this.serializedWindow.getInstanceID)}return n.prototype.getType=function(){return this.serializedWindow.type},n.prototype.isPopup=function(){return this.getType()===a.WINDOW_TYPE.POPUP},n.prototype.isIframe=function(){return this.getType()===a.WINDOW_TYPE.IFRAME},n.prototype.setLocation=function(n){var e=this;return y.a.try(function(){if(!e.actualWindow)return e.serializedWindow.setLocation(n);e.actualWindow.location=n}).then(function(){return e})},n.prototype.setName=function(n){var e=this;return y.a.try(function(){if(!e.actualWindow)return e.serializedWindow.setName(n);if(!Object(a.isSameDomain)(e.actualWindow))throw new Error("Can not set name for window on different domain");e.actualWindow.name=n,e.actualWindow.frameElement&&e.actualWindow.frameElement.setAttribute("name",n),(0,t(7).linkWindow)({win:e.actualWindow,name:n})}).then(function(){return e})},n.prototype.close=function(){var n=this;return y.a.try(function(){if(!n.actualWindow)return n.serializedWindow.close();n.actualWindow.close()}).then(function(){return n})},n.prototype.focus=function(){var n=this;return y.a.try(function(){return n.actualWindow&&n.actualWindow.focus(),n.serializedWindow.focus()}).then(function(){return n})},n.prototype.isClosed=function(){var n=this;return y.a.try(function(){return n.actualWindow?Object(a.isWindowClosed)(n.actualWindow):n.serializedWindow.isClosed()})},n.prototype.setWindow=function(n){this.actualWindow=n,this.actualWindowPromise.resolve(n)},n.prototype.matchWindow=function(n){var e=this;return y.a.try(function(){return e.actualWindow?n===e.actualWindow:y.a.all([e.getInstanceID(),Object(i.b)(n)]).then(function(t){var r=t[0]===t[1];return r&&e.setWindow(n),r})})},n.prototype.unwrap=function(){return this.actualWindow||this},n.prototype.awaitWindow=function(){return this.actualWindowPromise},n.prototype.getInstanceID=function(){return this.actualWindow?Object(i.b)(this.actualWindow):this.serializedWindow.getInstanceID()},n.prototype.serialize=function(){return this.serializedWindow},n.prototype.shouldClean=function(){return this.actualWindow&&Object(a.isWindowClosed)(this.actualWindow)},n.unwrap=function(e){return n.isProxyWindow(e)?e.unwrap():e},n.serialize=function(e){return j(),n.toProxyWindow(e).serialize()},n.deserialize=function(e){return j(),E.getOrSet(e.id,function(){return new n(e)})},n.isProxyWindow=function(n){return Boolean(n&&!Object(a.isWindow)(n)&&n.isProxyWindow)},n.toProxyWindow=function(e){return j(),n.isProxyWindow(e)?e:b.getOrSet(e,function(){var r=Object(u.uniqueID)();return E.set(r,new n({id:r,type:Object(a.getOpener)(e)?a.WINDOW_TYPE.POPUP:a.WINDOW_TYPE.IFRAME,getInstanceID:function(){return Object(i.b)(e)},close:function(){return y.a.try(function(){e.close()})},focus:function(){return y.a.try(function(){e.focus()})},isClosed:function(){return y.a.try(function(){return Object(a.isWindowClosed)(e)})},setLocation:function(n){return y.a.try(function(){if(Object(a.isSameDomain)(e))try{if(e.location&&"function"==typeof e.location.replace)return void e.location.replace(n)}catch(n){}e.location=n})},setName:function(n){return y.a.try(function(){(0,t(7).linkWindow)({win:e,name:n}),e.name=n})}},e))})},n}(),S=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},W=Object(O.c)("methodStore"),D=Object(O.b)("proxyWindowMethods");function T(n,e,t,r){_.isProxyWindow(t)?D.set(n,{val:e,domain:r,source:t}):(D.del(n),W.getOrSet(t,function(){return{}})[n]={domain:r,val:e,source:t})}function P(n,e){return W.getOrSet(n,function(){return{}})[e]||D.get(e)}O.a.listeningForFunctions=O.a.listeningForFunctions||!1;var I=Object(u.once)(function(){O.a.listeningForFunctions||(O.a.listeningForFunctions=!0,O.a.on(c.d.METHOD,{origin:c.i},function(n){var e=n.source,t=n.origin,r=n.data,o=r.id,i=r.name;return y.a.try(function(){var n=P(e,o);if(!n)throw new Error("Could not find method '"+r.name+"' with id: "+r.id+" in "+Object(a.getDomain)(window));var c=n.source,s=n.domain,f=n.val;return y.a.try(function(){if(!Object(a.matchDomain)(s,t))throw new Error("Method '"+r.name+"' domain "+JSON.stringify(Object(u.isRegex)(n.domain)?n.domain.source:n.domain)+" does not match origin "+t+" in "+Object(a.getDomain)(window));if(_.isProxyWindow(c))return c.matchWindow(e).then(function(n){if(!n)throw new Error("Method call '"+r.name+"' failed - proxy window does not match source in "+Object(a.getDomain)(window))})}).then(function(){return f.apply({source:e,origin:t},r.args)},function(n){return y.a.try(function(){if(f.onError)return f.onError(n)}).then(function(){throw n})}).then(function(n){return{result:n,id:o,name:i}})})}))});function R(n,e,t,r){I();var o=t.__id__||Object(u.uniqueID)();return n=_.unwrap(n),_.isProxyWindow(n)?(T(o,t,n,e),n.awaitWindow().then(function(n){T(o,t,n,e)})):W.getOrSet(n,function(){return{}})[o]={domain:e,val:t},w(c.h.CROSS_DOMAIN_FUNCTION,{id:o,name:t.name||r})}function A(n,e,t){var r;return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p,t=JSON.stringify(n,function(n){var t=this[n];if(d(this))return t;var r=l(t);if(!r)return t;var o=e[r]||m[r];return o?o(t,n):t});return void 0===t?s.UNDEFINED:t}(t,((r={})[s.PROMISE]=function(t,r){return function(n,e,t,r){return w(c.h.CROSS_DOMAIN_ZALGO_PROMISE,{then:R(n,e,function(n,e){return t.then(n,e)},r)})}(n,e,t,r)},r[s.FUNCTION]=function(t,r){return R(n,e,t,r)},r[s.OBJECT]=function(n){return Object(a.isWindow)(n)||_.isProxyWindow(n)?(e=n,w(c.h.CROSS_DOMAIN_WINDOW,_.serialize(e))):n;var e},r))}function M(n,e,t){var r;return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;if(n!==s.UNDEFINED)return JSON.parse(n,function(n,t){if(d(this))return t;var r=void 0,o=void 0;if(d(t)?(r=t.__type__,o=t.__val__):(r=l(t),o=t),!r)return o;var i=e[r]||g[r];return i?i(o,n):o})}(t,((r={})[c.h.CROSS_DOMAIN_ZALGO_PROMISE]=function(n){return e=n.then,new y.a(e);var e},r[c.h.CROSS_DOMAIN_FUNCTION]=function(t){return function(n,e,t){var r=t.id,o=t.name;function i(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _.toProxyWindow(n).awaitWindow().then(function(n){var u,s=P(n,r);return s?(u=s.val).call.apply(u,[{source:window,origin:Object(a.getDomain)()}].concat(t)):O.a.send(n,c.d.METHOD,{id:r,name:o,args:t},S({domain:e},i)).then(function(n){return n.data.result})}).catch(function(n){throw n})}function u(){return i(Array.prototype.slice.call(arguments))}return u.fireAndForget=function(){return i(Array.prototype.slice.call(arguments),{fireAndForget:!0})},u.__name__=o,u.__origin__=e,u.__source__=n,u.__id__=r,u.origin=e,u}(n,e,t)},r[c.h.CROSS_DOMAIN_WINDOW]=function(n){return e=n,_.deserialize(e);var e},r))}var N={};N[c.g.POST_MESSAGE]=function(n,e,t){(Array.isArray(t)?t:"string"==typeof t?[t]:[c.i]).map(function(e){if(0===e.indexOf(c.f.MOCK)){if(window.location.protocol===c.f.FILE)return c.i;if(!Object(a.isActuallySameDomain)(n))throw new Error("Attempting to send messsage to mock domain "+e+", but window is actually cross-domain");return Object(a.getActualDomain)(n)}return 0===e.indexOf(c.f.FILE)?c.i:e}).forEach(function(t){return n.postMessage(e,t)})};var C=t(7),x=C.sendBridgeMessage,k=C.needsBridgeForBrowser,B=C.isBridge;N[c.g.BRIDGE]=function(n,e,t){if(k()||B()){if(Object(a.isSameDomain)(n))throw new Error("Post message through bridge disabled between same domain windows");if(!1!==Object(a.isSameTopWindow)(window,n))throw new Error("Can only use bridge to communicate between two different windows, not between frames");return x(n,t,e)}},N[c.g.GLOBAL]=function(n,e){if(Object(i.f)()){if(!Object(a.isSameDomain)(n))throw new Error("Post message through global disabled between different domain windows");if(!1!==Object(a.isSameTopWindow)(window,n))throw new Error("Can only use global to communicate between two different windows, not between frames");var t=n[c.j.POSTROBOT];if(!t)throw new Error("Can not find postRobot global on foreign window");return t.receiveMessage({source:window,origin:Object(a.getDomain)(),data:e})}};var U=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n};function F(n,e,t){return y.a.try(function(){var r;if(Object(a.isWindowClosed)(n))throw new Error("Window is closed");var o=A(n,e,((r={})[c.j.POSTROBOT]=U({id:Object(u.uniqueID)()},t),r)),i=[];return y.a.map(Object.keys(N),function(t){return y.a.try(function(){if(!c.b.ALLOWED_POST_MESSAGE_METHODS[t])throw new Error("Strategy disallowed: "+t);return N[t](n,o,e)}).then(function(){return i.push(t+": success"),!0},function(n){return i.push(t+": "+Object(u.stringifyError)(n)+"\n"),!1})}).then(function(n){var e=n.some(Boolean),r=t.type+" "+t.name+" "+(e?"success":"error")+":\n - "+i.join("\n - ")+"\n";if(!e)throw new Error(r)})})}var L=Object(O.b)("responseListeners"),z=Object(O.c)("requestListeners"),q=Object(O.b)("erroredResponseListeners");O.a.WINDOW_WILDCARD=O.a.WINDOW_WILDCARD||new function(){};var H,G="__domain_regex__";function K(n){return L.get(n)}function J(n){L.del(n)}function Y(n){return q.has(n)}function Q(n){var e=n.name,t=n.win,r=n.domain;if(t===c.i&&(t=null),r===c.i&&(r=null),!e)throw new Error("Name required to get request listener");for(var o=0,i=[t,O.a.WINDOW_WILDCARD],u=null==i?0:i.length;o<u;o++){var s=i[o];if(s){var f=z.get(s);if(f){var d=f[e];if(d){if(r&&"string"==typeof r){if(d[r])return d[r];if(d[G])for(var l=0,w=d[G],h=null==w?0:w.length;l<h;l++){var m=w[l],p=m.regex,g=m.listener;if(Object(a.matchDomain)(p,r))return g}}if(d[c.i])return d[c.i]}}}}}var X=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Z=((H={})[c.e.REQUEST]=function(n,e,t){var r=Q({name:t.name,win:n,domain:e});function o(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.fireAndForget||Object(a.isWindowClosed)(n)?y.a.resolve():F(n,e,X({type:r,ack:o,hash:t.hash,name:t.name},i))}return t.name===c.d.METHOD&&t.data&&"string"==typeof t.data.name?t.data.name:t.name,y.a.all([o(c.e.ACK),y.a.try(function(){if(!r)throw new Error("No handler found for post message: "+t.name+" from "+e+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(a.matchDomain)(r.domain,e))throw new Error("Request origin "+e+" does not match domain "+r.domain.toString());var o=t.data;return r.handler({source:n,origin:e,data:o})}).then(function(n){return o(c.e.RESPONSE,c.c.SUCCESS,{data:n})},function(n){return o(c.e.RESPONSE,c.c.ERROR,{error:n})})]).then(u.noop).catch(function(n){if(r&&r.handleError)return r.handleError(n);throw n})},H[c.e.ACK]=function(n,e,t){if(!Y(t.hash)){var r=K(t.hash);if(!r)throw new Error("No handler found for post message ack for message: "+t.name+" from "+e+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(a.matchDomain)(r.domain,e))throw new Error("Ack origin "+e+" does not match domain "+r.domain.toString());r.ack=!0}},H[c.e.RESPONSE]=function(n,e,t){if(!Y(t.hash)){var r=K(t.hash);if(!r)throw new Error("No handler found for post message response for message: "+t.name+" from "+e+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(a.matchDomain)(r.domain,e))throw new Error("Response origin "+e+" does not match domain "+Object(a.stringifyDomainPattern)(r.domain));if(J(t.hash),t.ack===c.c.ERROR)return r.respond(t.error,null);if(t.ack===c.c.SUCCESS){var o=t.data;return r.respond(null,{source:n,origin:e,data:o})}}},H),V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},$=Object(O.b)("receivedMessages");function nn(n){if(!window||window.closed)throw new Error("Message recieved in closed window");try{if(!n.source)return}catch(n){return}var e=n.source,t=n.origin,r=function(n,e,t){var r=void 0;try{r=M(e,t,n)}catch(n){return}if(r&&"object"===(void 0===r?"undefined":V(r))&&null!==r&&(r=r[c.j.POSTROBOT])&&"object"===(void 0===r?"undefined":V(r))&&null!==r&&r.type&&"string"==typeof r.type&&Z[r.type])return r}(n.data,e,t);r&&(Object(i.e)(e),$.has(r.id)||($.set(r.id,!0),Object(a.isWindowClosed)(e)&&!r.fireAndForget||Z[r.type](e,t,r)))}function en(n){try{Object(u.noop)(n.source)}catch(n){return}var e={source:n.source||n.sourceElement,origin:n.origin||n.originalEvent&&n.originalEvent.origin,data:n.data};if(e.source){if(!e.origin)throw new Error("Post message did not have origin domain");nn(e)}}O.a.receiveMessage=nn;var tn=Object(O.c)("requestPromises");function rn(n){return y.a.try(function(){if(!n.name)throw new Error("Expected options.name");var e=n.name,t=void 0,r=void 0;if("string"==typeof n.window){var o=document.getElementById(n.window);if(!o)throw new Error("Expected options.window "+Object.prototype.toString.call(n.window)+" to be a valid element id");if("iframe"!==o.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(n.window)+" to be an iframe");if(!o.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");t=o.contentWindow}else if(n.window instanceof HTMLIFrameElement){if("iframe"!==n.window.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(n.window)+" to be an iframe");if(n.window&&!n.window.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");n.window&&n.window.contentWindow&&(t=n.window.contentWindow)}else t=n.window;if(!t)throw new Error("Expected options.window to be a window object, iframe, or iframe element id.");var s=t;r=n.domain||c.i;var f=n.name+"_"+Object(u.uniqueID)();if(Object(a.isWindowClosed)(s))throw new Error("Target window is closed");var d=!1,l=tn.getOrSet(s,function(){return[]}),w=y.a.try(function(){if(Object(a.isAncestor)(window,s))return Object(i.a)(s,n.timeout||c.b.CHILD_WINDOW_TIMEOUT)}).then(function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).domain;if(Object(u.isRegex)(r)&&!n)return Object(i.g)(s)}).then(function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).domain;if(Object(u.isRegex)(r)){if(!Object(a.matchDomain)(r,t))throw new Error("Remote window domain "+t+" does not match regex: "+r.toString());r=t}if("string"!=typeof r&&!Array.isArray(r))throw new TypeError("Expected domain to be a string or array");var o=r;return e===c.d.METHOD&&n.data&&"string"==typeof n.data.name&&n.data.name,new y.a(function(t,r){var u=void 0;if(n.fireAndForget||function(n,e){L.set(n,e)}(f,u={name:e,window:s,domain:o,respond:function(n,e){n||(d=!0,l.splice(l.indexOf(w,1))),n?r(n):t(e)}}),F(s,o,{type:c.e.REQUEST,hash:f,name:e,data:n.data,fireAndForget:Boolean(n.fireAndForget)}).catch(r),n.fireAndForget)return t();var h=Object(i.d)(s)?c.b.ACK_TIMEOUT_KNOWN:c.b.ACK_TIMEOUT,m=n.timeout||c.b.RES_TIMEOUT,p=h,g=m,v=100;setTimeout(function n(){if(!d){if(Object(a.isWindowClosed)(s))return u.ack?r(new Error("Window closed for "+e+" before response")):r(new Error("Window closed for "+e+" before ack"));if(p=Math.max(p-v,0),-1!==g&&(g=Math.max(g-v,0)),u.ack){if(-1===g)return;v=Math.min(g,2e3)}else{if(0===p)return r(new Error("No ack for postMessage "+e+" in "+Object(a.getDomain)()+" in "+h+"ms"));if(0===g)return r(new Error("No response for postMessage "+e+" in "+Object(a.getDomain)()+" in "+m+"ms"))}setTimeout(n,v)}},v)})});return w.catch(function(){!function(n){q.set(n,!0)}(f),J(f)}),l.push(w),w})}function on(n,e,t,r){return(r=r||{}).window=n,r.name=e,r.data=t,rn(r)}function an(n,e,t){var r=Object(a.getAncestor)();return r?on(r,n,e,t):new y.a(function(n,e){return e(new Error("Window does not have a parent"))})}function un(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!n.window)throw new Error("Expected options.window");var e=n.window;return{send:function(t,r){return on(e,t,r,n)}}}O.a.send=on;var cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function sn(n){if(!n.name)throw new Error("Expected options.name");if(!n.handler)throw new Error("Expected options.handler");var e=n.name,t=n.window,r=n.domain,o={handler:n.handler,handleError:n.errorHandler||function(n){throw n},window:t,domain:r||c.i,name:e},i=function n(e,t){var r=e.name,o=e.win,i=e.domain;if(!r||"string"!=typeof r)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var a=[],s=0,f=o,d=null==f?0:f.length;s<d;s++){var l=f[s];a.push(n({name:r,domain:i,win:l},t))}return{cancel:function(){for(var n=0,e=null==a?0:a.length;n<e;n++)a[n].cancel()}}}if(Array.isArray(i)){for(var w=[],h=0,m=i,p=null==m?0:m.length;h<p;h++){var g=m[h];w.push(n({name:r,win:o,domain:g},t))}return{cancel:function(){for(var n=0,e=null==w?0:w.length;n<e;n++)w[n].cancel()}}}var v=Q({name:r,win:o,domain:i});if(o&&o!==c.i||(o=O.a.WINDOW_WILDCARD),i=i||c.i,v)throw o&&i?new Error("Request listener already exists for "+r+" on domain "+i.toString()+" for "+(o===O.a.WINDOW_WILDCARD?"wildcard":"specified")+" window"):o?new Error("Request listener already exists for "+r+" for "+(o===O.a.WINDOW_WILDCARD?"wildcard":"specified")+" window"):i?new Error("Request listener already exists for "+r+" on domain "+i.toString()):new Error("Request listener already exists for "+r);var y=z.getOrSet(o,function(){return{}}),b=Object(u.getOrSet)(y,r,function(){return{}}),E=i.toString(),j=void 0,_=void 0;return Object(u.isRegex)(i)?(j=Object(u.getOrSet)(b,G,function(){return[]}),_={regex:i,listener:t},j.push(_)):b[E]=t,{cancel:function(){delete b[E],_&&(j.splice(j.indexOf(_,1)),j.length||delete b[G]),Object.keys(b).length||delete y[r],o&&!Object.keys(y).length&&z.del(o)}}}({name:e,win:t,domain:r},o);if(n.once){var s=o.handler;o.handler=Object(u.once)(function(){return i.cancel(),s.apply(this,arguments)})}if(o.window&&n.errorOnClose)var f=Object(u.safeInterval)(function(){t&&"object"===(void 0===t?"undefined":cn(t))&&Object(a.isWindowClosed)(t)&&(f.cancel(),o.handleError(new Error("Post message target window is closed")))},50);return{cancel:function(){i.cancel()}}}function fn(n,e,t){return"function"==typeof e&&(t=e,e={}),(e=e||{}).name=n,e.handler=t||e.handler,sn(e)}function dn(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments[2];"function"==typeof e&&(t=e,e={}),e=e||{},t=t||e.handler;var r=e.errorHandler,o=new y.a(function(o,i){(e=e||{}).name=n,e.once=!0,e.handler=function(n){if(o(n),t)return t(n)},e.errorHandler=function(n){if(i(n),r)return r(n)}}),i=sn(e);return o.cancel=i.cancel,o}function ln(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{on:function(e,t){return fn(e,n,t)}}}function wn(){delete window[c.j.POSTROBOT],window.removeEventListener("message",en)}O.a.on=fn;var hn=Object(a.getAncestor)();function mn(n){for(var e=0,t=tn.get(n,[]),r=null==t?0:t.length;e<r;e++)t[e].reject(new Error("Window cleaned up before response")).catch(u.noop)}var pn=t(23);O.a.initialized||(O.a.initialized=!0,Object(u.addEventListener)(window,"message",en),pn&&pn.openTunnelToOpener(),Object(i.c)()),t.d(e,"markWindowKnown",function(){return i.e}),t.d(e,"serializeMessage",function(){return A}),t.d(e,"deserializeMessage",function(){return M}),t.d(e,"ProxyWindow",function(){return _}),t.d(e,"cleanUpWindow",function(){return mn}),t.d(e,"Promise",function(){return y.a}),t.d(e,"bridge",function(){return pn}),t.d(e,"parent",function(){return hn}),t.d(e,"send",function(){return on}),t.d(e,"requestPromises",function(){return tn}),t.d(e,"request",function(){return rn}),t.d(e,"sendToParent",function(){return an}),t.d(e,"client",function(){return un}),t.d(e,"on",function(){return fn}),t.d(e,"listen",function(){return sn}),t.d(e,"once",function(){return dn}),t.d(e,"listener",function(){return ln}),t.d(e,"CONFIG",function(){return c.b}),t.d(e,"disable",function(){return wn}),e.default=r},function(n,e,t){"use strict";function r(n){return"[object RegExp]"===Object.prototype.toString.call(n)}var o=t(9);e.g=u,e.f=c,e.a=f,e.c=d,e.i=l,e.l=w,e.o=function(n){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(n===window)return!1}catch(n){return!0}try{if(!n)return!0}catch(n){return!0}try{if(n.closed)return!0}catch(n){return!n||n.message!==i}if(e&&w(n))try{if(n.mockclosed)return!0}catch(n){}try{if(!n.parent||!n.top)return!0}catch(n){}var t=function(n,e){for(var t=0;t<n.length;t++)try{if(n[t]===e)return t}catch(n){}return-1}(y,n);if(-1!==t){var r=O[t];if(r&&function(n){if(!n.contentWindow)return!0;if(!n.parentNode)return!0;var e=n.ownerDocument;return!(!e||!e.documentElement||e.documentElement.contains(n))}(r))return!0}return!1},e.p=function(n){if(function(){for(var n=0;n<y.length;n++){var e=!1;try{e=y[n].closed}catch(n){}e&&(O.splice(n,1),y.splice(n,1))}}(),n&&n.contentWindow)try{y.push(n.contentWindow),O.push(n)}catch(n){}},e.h=function(n){return(n=n||window).navigator.mockUserAgent||n.navigator.userAgent},e.e=function(n,e){for(var t=m(n),r=0,o=null==t?0:t.length;r<o;r++){var i=t[r];try{if(w(i)&&i.name===e&&-1!==t.indexOf(i))return i}catch(n){}}try{if(-1!==t.indexOf(n.frames[e]))return n.frames[e]}catch(n){}try{if(-1!==t.indexOf(n[e]))return n[e]}catch(n){}},e.k=function(n,e){return n===c(e)},e.b=b,e.j=function(n,e){var t=b(e);if(t)return t===n;if(e===n)return!1;if(g(e)===e)return!1;for(var r=0,o=m(n),i=null==o?0:o.length;r<i;r++)if(o[r]===e)return!0;return!1},e.m=function(n,e){var t=g(n)||n,r=g(e)||e;try{if(t&&r)return t===r}catch(n){}var o=v(n),i=v(e);if(E(o,i))return!0;var a=c(t),u=c(r);return!(a&&E(v(a),i)||(u&&E(v(u),o),1))},e.q=function n(e,t){if("string"==typeof e){if("string"==typeof t)return e===o.b||t===e;if(r(t))return!1;if(Array.isArray(t))return!1}return r(e)?r(t)?e.toString()===t.toString():!Array.isArray(t)&&Boolean(t.match(e)):!!Array.isArray(e)&&(Array.isArray(t)?JSON.stringify(e)===JSON.stringify(t):!r(t)&&e.some(function(e){return n(e,t)}))},e.s=function(n){return Array.isArray(n)?"("+n.join(" | ")+")":r(n)?"RegExp("+n.toString():n.toString()},e.d=j,e.n=function(n){try{if(n===window)return!0}catch(n){if(n&&n.message===i)return!0}try{if("[object Window]"===Object.prototype.toString.call(n))return!0}catch(n){if(n&&n.message===i)return!0}try{if(window.Window&&n instanceof window.Window)return!0}catch(n){if(n&&n.message===i)return!0}try{if(n&&n.self===n)return!0}catch(n){if(n&&n.message===i)return!0}try{if(n&&n.parent===n)return!0}catch(n){if(n&&n.message===i)return!0}try{if(n&&n.top===n)return!0}catch(n){if(n&&n.message===i)return!0}try{n&&n.__cross_domain_utils_window_check__}catch(n){return!0}return!1},e.r=function(n){if(0!==j(n).indexOf(o.a.MOCK))return n;throw new Error("Mock urls not supported out of test mode")};var i="Call was rejected by callee.\r\n";function a(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===o.a.ABOUT}function u(n){if(n)try{if(n.parent&&n.parent!==n)return n.parent}catch(n){}}function c(n){if(n&&!u(n))try{return n.opener}catch(n){}}function s(n){try{return n&&n.location&&n.location.href,!0}catch(n){}return!1}function f(n){var e=(n=n||window).location;if(!e)throw new Error("Can not read window location");var t=e.protocol;if(!t)throw new Error("Can not read window protocol");if(t===o.a.FILE)return o.a.FILE+"//";if(t===o.a.ABOUT){var r=u(n);return r&&s(r)?f(r):o.a.ABOUT+"//"}var i=e.host;if(!i)throw new Error("Can not read window host");return t+"//"+i}function d(n){var e=f(n=n||window);return e&&n.mockDomain&&0===n.mockDomain.indexOf(o.a.MOCK)?n.mockDomain:e}function l(n){try{if(n===window)return!0}catch(n){}try{var e=Object.getOwnPropertyDescriptor(n,"location");if(e&&!1===e.enumerable)return!1}catch(n){}try{if(a(n)&&s(n))return!0}catch(n){}try{if(f(n)===f(window))return!0}catch(n){}return!1}function w(n){if(!l(n))return!1;try{if(n===window)return!0;if(a(n)&&s(n))return!0;if(d(window)===d(n))return!0}catch(n){}return!1}function h(n,e){if(!n||!e)return!1;var t=u(e);return t?t===n:-1!==function(n){var e=[];try{for(;n.parent!==n;)e.push(n.parent),n=n.parent}catch(n){}return e}(e).indexOf(n)}function m(n){var e=[],t=void 0;try{t=n.frames}catch(e){t=n}var r=void 0;try{r=t.length}catch(n){}if(0===r)return e;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=t[o]}catch(n){continue}e.push(i)}return e}for(var a=0;a<100;a++){var u=void 0;try{u=t[a]}catch(n){return e}if(!u)return e;e.push(u)}return e}function p(n){for(var e=[],t=0,r=m(n),o=null==r?0:r.length;t<o;t++){var i=r[t];e.push(i);for(var a=0,u=p(i),c=null==u?0:u.length;a<c;a++){var s=u[a];e.push(s)}}return e}function g(n){if(n){try{if(n.top)return n.top}catch(n){}if(u(n)===n)return n;try{if(h(window,n)&&window.top)return window.top}catch(n){}try{if(h(n,window)&&window.top)return window.top}catch(n){}for(var e=0,t=p(n),r=null==t?0:t.length;e<r;e++){var o=t[e];try{if(o.top)return o.top}catch(n){}if(u(o)===o)return o}}}function v(n){var e=g(n);if(!e)throw new Error("Can not determine top window");return[].concat(p(e),[e])}var y=[],O=[];function b(n){return c(n=n||window)||u(n)||void 0}function E(n,e){for(var t=0,r=null==n?0:n.length;t<r;t++)for(var o=n[t],i=0,a=null==e?0:e.length;i<a;i++)if(o===e[i])return!0;return!1}function j(n){return n.match(/^(https?|mock|file):\/\//)?n.split("/").slice(0,3).join("/"):d()}},function(n,e){},function(n,e,t){"use strict";t(6),t(12)},function(n,e,t){"use strict";t(6)},function(n,e,t){"use strict";t(2),t(0)},function(n,e){},function(n,e,t){"use strict";t(6)},function(n,e,t){"use strict"},function(n,e,t){"use strict";t(2),t(6)},function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(7);t.d(e,"openBridge",function(){return r.openBridge}),t.d(e,"linkWindow",function(){return r.linkWindow}),t.d(e,"linkUrl",function(){return r.linkUrl}),t.d(e,"isBridge",function(){return r.isBridge}),t.d(e,"needsBridge",function(){return r.needsBridge}),t.d(e,"needsBridgeForBrowser",function(){return r.needsBridgeForBrowser}),t.d(e,"hasBridge",function(){return r.hasBridge}),t.d(e,"needsBridgeForWin",function(){return r.needsBridgeForWin}),t.d(e,"needsBridgeForDomain",function(){return r.needsBridgeForDomain}),t.d(e,"openTunnelToOpener",function(){return r.openTunnelToOpener}),t.d(e,"destroyBridges",function(){return r.destroyBridges})}])});
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("postRobot",[],e):"object"==typeof exports?exports.postRobot=e():n.postRobot=e()}("undefined"!=typeof self?self:this,function(){return function(n){var e={};function t(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:r})},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=13)}([function(n,e,t){"use strict";var r=t(14);t.d(e,"getActualDomain",function(){return r.a}),t.d(e,"getAncestor",function(){return r.b}),t.d(e,"getDomain",function(){return r.c}),t.d(e,"getDomainFromUrl",function(){return r.d}),t.d(e,"getFrameByName",function(){return r.e}),t.d(e,"getOpener",function(){return r.f}),t.d(e,"getParent",function(){return r.g}),t.d(e,"getUserAgent",function(){return r.h}),t.d(e,"isActuallySameDomain",function(){return r.i}),t.d(e,"isAncestor",function(){return r.j}),t.d(e,"isOpener",function(){return r.k}),t.d(e,"isSameDomain",function(){return r.l}),t.d(e,"isSameTopWindow",function(){return r.m}),t.d(e,"isWindow",function(){return r.n}),t.d(e,"isWindowClosed",function(){return r.o}),t.d(e,"linkFrameWindow",function(){return r.p}),t.d(e,"matchDomain",function(){return r.q}),t.d(e,"normalizeMockUrl",function(){return r.r}),t.d(e,"stringifyDomainPattern",function(){return r.s});var o=t(15);t.n(o),t.o(o,"WINDOW_TYPE")&&t.d(e,"WINDOW_TYPE",function(){return o.WINDOW_TYPE});var i=t(9);t.d(e,"WINDOW_TYPE",function(){return i.c})},function(n,e,t){"use strict";var r,o={REQUEST:"postrobot_message_request",RESPONSE:"postrobot_message_response",ACK:"postrobot_message_ack"},i={SUCCESS:"success",ERROR:"error"},a={METHOD:"postrobot_method",HELLO:"postrobot_hello",OPEN_TUNNEL:"postrobot_open_tunnel"},u={POSTROBOT:"__postRobot__"},c={POST_MESSAGE:"postrobot_post_message",BRIDGE:"postrobot_bridge",GLOBAL:"postrobot_global"},s={MOCK:"mock:",FILE:"file:"},f={CROSS_DOMAIN_ZALGO_PROMISE:"cross_domain_zalgo_promise",CROSS_DOMAIN_FUNCTION:"cross_domain_function",CROSS_DOMAIN_WINDOW:"cross_domain_window"},d={BRIDGE_TIMEOUT:5e3,CHILD_WINDOW_TIMEOUT:5e3,ACK_TIMEOUT:2e3,ACK_TIMEOUT_KNOWN:1e4,RES_TIMEOUT:-1,ALLOWED_POST_MESSAGE_METHODS:(r={},r[c.POST_MESSAGE]=!0,r[c.BRIDGE]=!0,r[c.GLOBAL]=!0,r)};t.d(e,"b",function(){return d}),t.d(e,"e",function(){return o}),t.d(e,"c",function(){return i}),t.d(e,"d",function(){return a}),t.d(e,"j",function(){return u}),t.d(e,"g",function(){return c}),t.d(e,"f",function(){return s}),t.d(e,"a",function(){return"__postrobot_bridge__"}),t.d(e,!1,function(){return"__postrobot_proxy__"}),t.d(e,"i",function(){return"*"}),t.d(e,"h",function(){return f})},function(n,e,t){"use strict";function r(n){try{if(!n)return!1;if("undefined"!=typeof Promise&&n instanceof Promise)return!0;if("undefined"!=typeof window&&window.Window&&n instanceof window.Window)return!1;if("undefined"!=typeof window&&window.constructor&&n instanceof window.constructor)return!1;var e={}.toString;if(e){var t=e.call(n);if("[object Window]"===t||"[object global]"===t||"[object DOMWindow]"===t)return!1}if("function"==typeof n.then)return!0}catch(n){return!1}return!1}function o(){var n=void 0;if("undefined"!=typeof window)n=window;else{if("undefined"==typeof window)throw new TypeError("Can not find global");n=window}var e=n.__zalgopromise__=n.__zalgopromise__||{};return e.flushPromises=e.flushPromises||[],e.activeCount=e.activeCount||0,e.possiblyUnhandledPromiseHandlers=e.possiblyUnhandledPromiseHandlers||[],e.dispatchedErrors=e.dispatchedErrors||[],e}var i=function(){function n(e){var t=this;if(function(e,t){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],e){var r=void 0,o=void 0,i=!1,a=!1,u=!1;try{e(function(n){u?t.resolve(n):(i=!0,r=n)},function(n){u?t.reject(n):(a=!0,o=n)})}catch(n){return void this.reject(n)}u=!0,i?this.resolve(r):a&&this.reject(o)}}return n.prototype.resolve=function(n){if(this.resolved||this.rejected)return this;if(r(n))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=n,this.dispatch(),this},n.prototype.reject=function(n){var e=this;if(this.resolved||this.rejected)return this;if(r(n))throw new Error("Can not reject promise with another promise");if(!n){var t=n&&"function"==typeof n.toString?n.toString():Object.prototype.toString.call(n);n=new Error("Expected reject to be called with Error, got "+t)}return this.rejected=!0,this.error=n,this.errorHandled||setTimeout(function(){e.errorHandled||function(n,e){if(-1===o().dispatchedErrors.indexOf(n)){o().dispatchedErrors.push(n),setTimeout(function(){throw n},1);for(var t=0;t<o().possiblyUnhandledPromiseHandlers.length;t++)o().possiblyUnhandledPromiseHandlers[t](n,e)}}(n,e)},1),this.dispatch(),this},n.prototype.asyncReject=function(n){return this.errorHandled=!0,this.reject(n),this},n.prototype.dispatch=function(){var e=this,t=this.dispatching,i=this.resolved,a=this.rejected,u=this.handlers;if(!t&&(i||a)){this.dispatching=!0,o().activeCount+=1;for(var c=function(t){var o=u[t],c=o.onSuccess,s=o.onError,f=o.promise,d=void 0;if(i)try{d=c?c(e.value):e.value}catch(n){return f.reject(n),"continue"}else if(a){if(!s)return f.reject(e.error),"continue";try{d=s(e.error)}catch(n){return f.reject(n),"continue"}}d instanceof n&&(d.resolved||d.rejected)?(d.resolved?f.resolve(d.value):f.reject(d.error),d.errorHandled=!0):r(d)?d instanceof n&&(d.resolved||d.rejected)?d.resolved?f.resolve(d.value):f.reject(d.error):d.then(function(n){f.resolve(n)},function(n){f.reject(n)}):f.resolve(d)},s=0;s<u.length;s++)c(s);u.length=0,this.dispatching=!1,o().activeCount-=1,0===o().activeCount&&n.flushQueue()}},n.prototype.then=function(e,t){if(e&&"function"!=typeof e&&!e.call)throw new Error("Promise.then expected a function for success handler");if(t&&"function"!=typeof t&&!t.call)throw new Error("Promise.then expected a function for error handler");var r=new n;return this.handlers.push({promise:r,onSuccess:e,onError:t}),this.errorHandled=!0,this.dispatch(),r},n.prototype.catch=function(n){return this.then(void 0,n)},n.prototype.finally=function(e){if(e&&"function"!=typeof e&&!e.call)throw new Error("Promise.finally expected a function");return this.then(function(t){return n.try(e).then(function(){return t})},function(t){return n.try(e).then(function(){throw t})})},n.prototype.timeout=function(n,e){var t=this;if(this.resolved||this.rejected)return this;var r=setTimeout(function(){t.resolved||t.rejected||t.reject(e||new Error("Promise timed out after "+n+"ms"))},n);return this.then(function(n){return clearTimeout(r),n})},n.prototype.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.resolve=function(e){return e instanceof n?e:r(e)?new n(function(n,t){return e.then(n,t)}):(new n).resolve(e)},n.reject=function(e){return(new n).reject(e)},n.asyncReject=function(e){return(new n).asyncReject(e)},n.all=function(e){var t=new n,o=e.length,i=[];if(!o)return t.resolve(i),t;for(var a=function(a){var u=e[a];if(u instanceof n){if(u.resolved)return i[a]=u.value,o-=1,"continue"}else if(!r(u))return i[a]=u,o-=1,"continue";n.resolve(u).then(function(n){i[a]=n,0==(o-=1)&&t.resolve(i)},function(n){t.reject(n)})},u=0;u<e.length;u++)a(u);return 0===o&&t.resolve(i),t},n.hash=function(e){var t={};return n.all(Object.keys(e).map(function(r){return n.resolve(e[r]).then(function(n){t[r]=n})})).then(function(){return t})},n.map=function(e,t){return n.all(e.map(t))},n.onPossiblyUnhandledException=function(n){return function(n){return o().possiblyUnhandledPromiseHandlers.push(n),{cancel:function(){o().possiblyUnhandledPromiseHandlers.splice(o().possiblyUnhandledPromiseHandlers.indexOf(n),1)}}}(n)},n.try=function(e,t,r){if(e&&"function"!=typeof e&&!e.call)throw new Error("Promise.try expected a function");var o=void 0;try{o=e.apply(t,r||[])}catch(e){return n.reject(e)}return n.resolve(o)},n.delay=function(e){return new n(function(n){setTimeout(n,e)})},n.isPromise=function(e){return!!(e&&e instanceof n)||r(e)},n.flush=function(){var e=new n;return o().flushPromises.push(e),0===o().activeCount&&n.flushQueue(),e},n.flushQueue=function(){var n=o().flushPromises;o().flushPromises=[];for(var e=0,t=null==n?0:n.length;e<t;e++)n[e].resolve()},n}();t.d(e,"a",function(){return i})},function(n,e,t){"use strict";t(10);var r=t(11);t.d(e,"addEventListener",function(){return r.a}),t(16),t(17),t(12);var o=t(6);t.d(e,"getOrSet",function(){return o.d}),t.d(e,"isRegex",function(){return o.f}),t.d(e,"memoizePromise",function(){return o.h}),t.d(e,"noop",function(){return o.i}),t.d(e,"once",function(){return o.j}),t.d(e,"safeInterval",function(){return o.m}),t.d(e,"stringifyError",function(){return o.o}),t.d(e,"uniqueID",function(){return o.q}),t.d(e,"weakMapMemoize",function(){return o.r}),t.d(e,"weakMapMemoizePromise",function(){return o.s}),t(18);var i=t(19);t.n(i),t(20),t(21),t(22)},function(n,e,t){"use strict";t.d(e,"a",function(){return a}),e.c=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;function t(n){return u.getOrSet(n,e)}return{has:function(e){return t(e).hasOwnProperty(n)},get:function(e,r){var o=t(e);return o.hasOwnProperty(n)?o[n]:r},set:function(e,r){return t(e)[n]=r,r},del:function(e){delete t(e)[n]},getOrSet:function(e,r){var o=t(e);if(o.hasOwnProperty(n))return o[n];var i=r();return o[n]=i,i}}},e.b=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c,t=Object(o.getOrSet)(a,n,e);return{has:function(n){return t.hasOwnProperty(n)},get:function(n,e){return t.hasOwnProperty(n)?t[n]:e},set:function(n,e){return t[n]=e,e},del:function(n){delete t[n]},getOrSet:function(n,e){if(t.hasOwnProperty(n))return t[n];var r=e();return t[n]=r,r},reset:function(){t=e()},keys:function(){return Object.keys(t)}}},t(0);var r=t(8),o=t(3),i=t(1),a=window[i.j.POSTROBOT]=window[i.j.POSTROBOT]||{},u=a.windowStore=a.windowStore||new r.a,c=function(){return{}}},function(n,e,t){"use strict";var r=t(0),o=t(2),i=t(3),a=t(1),u=t(4);u.a.instanceID=u.a.instanceID||Object(i.uniqueID)();var c=Object(u.c)("helloPromises");function s(n){return c.getOrSet(n,function(){return new o.a})}var f=Object(i.once)(function(){u.a.on(a.d.HELLO,{domain:a.i},function(n){var e=n.source,t=n.origin;return s(e).resolve({win:e,domain:t}),{instanceID:u.a.instanceID}})});function d(n){return u.a.send(n,a.d.HELLO,{instanceID:u.a.instanceID},{domain:a.i,timeout:-1}).then(function(e){var t=e.origin,r=e.data.instanceID;return s(n).resolve({win:n,domain:t}),{win:n,domain:t,instanceID:r}})}var l=Object(i.weakMapMemoizePromise)(function(n){return d(n).then(function(n){return n.instanceID})});function w(){f();var n=Object(r.getAncestor)();n&&d(n).catch(i.noop)}function h(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Window",r=s(n);return-1!==e&&(r=r.timeout(e,new Error(t+" did not load after "+e+"ms"))),r}function m(){return!!Object(r.getUserAgent)(window).match(/MSIE|rv:11|trident|edge\/12|edge\/13/i)}var p=Object(u.c)("knownWindows");function g(n){p.set(n,!0)}function v(n){return p.get(n,!1)}t.d(e,"g",function(){return d}),t.d(e,"b",function(){return l}),t.d(e,"c",function(){return w}),t.d(e,"a",function(){return h}),t.d(e,"f",function(){return m}),t.d(e,"e",function(){return g}),t.d(e,"d",function(){return v})},function(n,e,t){"use strict";e.q=a,e.c=function(){if("undefined"!=typeof window)return window;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("No global found")},e.g=function(n){var e=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new o.a;function i(){for(var e=arguments.length,o=Array(e),i=0;i<e;i++)o[i]=arguments[i];var a=r.getOrSet(t.thisNamespace?this:n,function(){return{}}),u=c(o),s=t.time;if(a[u]&&s&&Date.now()-a[u].time<s&&delete a[u],a[u])return a[u].value;var f=Date.now(),d=n.apply(this,arguments);return a[u]={time:f,value:d},a[u].value}return i.reset=function(){r.delete(t.thisNamespace?e:n)},t.name&&(i.displayName=t.name+":memoized"),i},e.h=function(n){var e={};function t(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=c(r);return e.hasOwnProperty(i)?e[i]:(e[i]=n.apply(this,arguments).finally(function(){delete e[i]}),e[i])}return t.reset=function(){e={}},t},e.k=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};function t(){return r.a.try(n,this,arguments)}return e.name&&(t.displayName=e.name+":promisified"),t},e.e=function(n,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=n.__inline_memoize_cache__=n.__inline_memoize_cache__||{},o=c(t);return r.hasOwnProperty(o)?r[o]:r[o]=e.apply(void 0,t)},e.i=function(){},e.j=function(n){var e=!1;return function(){if(!e)return e=!0,n.apply(this,arguments)}},e.o=function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(t>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+Object.prototype.toString.call(e)+">";if("string"==typeof e)return e;if(e instanceof Error){var r=e&&e.stack,o=e&&e.message;if(r&&o)return-1!==r.indexOf(o)?r:o+"\n"+r;if(r)return r;if(o)return o}return"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)}catch(e){return"Error while stringifying error: "+n(e,t+1)}},e.n=function(n){return"string"==typeof n?n:n&&"function"==typeof n.toString?n.toString():Object.prototype.toString.call(n)},e.b=function(n,e){if(!e)return n;if(Object.assign)return Object.assign(n,e);for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n},e.m=function(n,e){var t=void 0;return function r(){t=setTimeout(function(){n(),r()},e)}(),{cancel:function(){clearTimeout(t)}}},e.a=function(n){return n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()},e.f=function(n){return"[object RegExp]"===Object.prototype.toString.call(n)},t.d(e,"r",function(){return s}),t.d(e,"s",function(){return f}),e.d=function(n,e,t){if(n.hasOwnProperty(e))return n[e];var r=t();return n[e]=r,r},e.p=function(n){var e=void 0,t=void 0;try{e=n()}catch(n){t=n}return{result:e,error:t}},e.l=function(n,e){var t=n.indexOf(e);-1!==t&&n.splice(t,1)};var r=t(2),o=t(8),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function a(){var n="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,function(){return n.charAt(Math.floor(Math.random()*n.length))})+"_"+function(n){if("function"==typeof btoa)return btoa(n);if("undefined"!=typeof Buffer)return Buffer.from(n,"utf8").toString("base64");throw new Error("Can not find window.btoa or Buffer")}((new Date).toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var u=void 0;function c(n){try{return JSON.stringify(Array.prototype.slice.call(n),function(n,e){return"function"==typeof e?"memoize["+function(n){if(u=u||new o.a,null===n||void 0===n||"object"!==(void 0===n?"undefined":i(n))&&"function"!=typeof n)throw new Error("Invalid object");var e=u.get(n);return e||(e=(void 0===n?"undefined":i(n))+":"+a(),u.set(n,e)),e}(e)+"]":e})}catch(n){throw new Error("Arguments not serializable -- can not be used to memoize")}}var s=function(n){var e=new o.a;return function(t){var r=this;return e.getOrSet(t,function(){return n.call(r,t)})}},f=function(n){var e=new o.a;return function(t){var r=this;return e.getOrSet(t,function(){return n.call(r,t).finally(function(){e.delete(t)})})}}},function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(2),o=t(0),i=t(3),a=t(1),u=t(4),c=Object(u.b)("tunnelWindows");function s(){return!!Object(o.getUserAgent)(window).match(/MSIE|trident|edge\/12|edge\/13/i)}function f(n){return!Object(o.isSameTopWindow)(window,n)}function d(n,e){if(n){if(Object(o.getDomain)()!==Object(o.getDomainFromUrl)(n))return!0}else if(e&&!Object(o.isSameDomain)(e))return!0;return!1}function l(n){var e=n.win,t=n.domain;return!(!s()||t&&!d(t,e)||e&&!f(e))}function w(n){var e=(n=n||Object(o.getDomainFromUrl)(n)).replace(/[^a-zA-Z0-9]+/g,"_");return a.a+"_"+e}function h(){return Boolean(window.name&&window.name===w(Object(o.getDomain)()))}u.a.openTunnelToParent=function(n){var e=n.name,t=n.source,r=n.canary,s=n.sendMessage,f=Object(o.getParent)(window);if(!f)throw new Error("No parent window found to open tunnel to");var d=function(n){var e=n.name,t=n.source,r=n.canary,a=n.sendMessage;!function(){for(var n=0,e=c.keys(),t=null==e?0:e.length;n<t;n++){var r=e[n],a=c[r];try{Object(i.noop)(a.source)}catch(n){c.del(r);continue}Object(o.isWindowClosed)(a.source)&&c.del(r)}}();var u=Object(i.uniqueID)();return c.set(u,{name:e,source:t,canary:r,sendMessage:a}),u}({name:e,source:t,canary:r,sendMessage:s});return u.a.send(f,a.d.OPEN_TUNNEL,{name:e,sendMessage:function(){var n=c.get(d);try{Object(i.noop)(n&&n.source)}catch(n){return void c.del(d)}if(n&&n.source&&!Object(o.isWindowClosed)(n.source)){try{n.canary()}catch(n){return}n.sendMessage.apply(this,arguments)}}},{domain:a.i})};var m=new r.a(function(n){if(window.document&&window.document.body)return n(window.document.body);var e=setInterval(function(){if(window.document&&window.document.body)return clearInterval(e),n(window.document.body)},10)}),p=Object(u.c)("remoteWindows");function g(n){p.getOrSet(n,function(){return new r.a})}function v(n){var e=p.get(n);if(!e)throw new Error("Remote window not found");return e}function y(n,e,t){v(n).resolve(function(r,i,a){if(r!==n)throw new Error("Remote window does not match window");if(!Object(o.matchDomain)(i,e))throw new Error("Remote domain "+i+" does not match domain "+e);t(a)})}function O(n,e){v(n).reject(e).catch(i.noop)}function b(n,e,t){var r=Object(o.isOpener)(window,n),i=Object(o.isOpener)(n,window);if(!r&&!i)throw new Error("Can only send messages to and from parent and popup windows");return v(n).then(function(r){return r(n,e,t)})}var E=Object(i.weakMapMemoize)(function(n){return r.a.try(function(){try{var e=Object(o.getFrameByName)(n,w(Object(o.getDomain)()));if(!e)return;return Object(o.isSameDomain)(e)&&e[a.j.POSTROBOT]?e:new r.a(function(n){var t=void 0,r=void 0;t=setInterval(function(){if(e&&Object(o.isSameDomain)(e)&&e[a.j.POSTROBOT])return clearInterval(t),clearTimeout(r),n(e)},100),r=setTimeout(function(){return clearInterval(t),n()},2e3)})}catch(n){}})});function j(){return r.a.try(function(){var n=Object(o.getOpener)(window);if(n&&l({win:n}))return g(n),E(n).then(function(e){return e?window.name?e[a.j.POSTROBOT].openTunnelToParent({name:window.name,source:window,canary:function(){},sendMessage:function(n){try{Object(i.noop)(window)}catch(n){return}if(window&&!window.closed)try{u.a.receiveMessage({data:n,origin:this.origin,source:this.source})}catch(n){r.a.reject(n)}}}).then(function(e){var t=e.source,r=e.origin,o=e.data;if(t!==n)throw new Error("Source does not match opener");y(t,r,o.sendMessage)}).catch(function(e){throw O(n,e),e}):O(n,new Error("Can not register with opener: window does not have a name")):O(n,new Error("Can not register with opener: no bridge found in opener"))})})}var _=t(5),S=Object(u.b)("bridges"),W=Object(u.b)("bridgeFrames"),D=Object(u.b)("popupWindowsByName"),T=Object(u.c)("popupWindowsByWin");function P(n,e){return S.has(e||Object(o.getDomainFromUrl)(n))}function I(n,e){return e=e||Object(o.getDomainFromUrl)(n),S.getOrSet(e,function(){return r.a.try(function(){if(Object(o.getDomain)()===e)throw new Error("Can not open bridge on the same domain as current domain: "+e);var t=w(e);if(Object(o.getFrameByName)(window,t))throw new Error("Frame with name "+t+" already exists on page");var i=function(n,e){var t=document.createElement("iframe");return t.setAttribute("name",n),t.setAttribute("id",n),t.setAttribute("style","display: none; margin: 0; padding: 0; border: 0px none; overflow: hidden;"),t.setAttribute("frameborder","0"),t.setAttribute("border","0"),t.setAttribute("scrolling","no"),t.setAttribute("allowTransparency","true"),t.setAttribute("tabindex","-1"),t.setAttribute("hidden","true"),t.setAttribute("title",""),t.setAttribute("role","presentation"),t.src=e,t}(t,n);return W.set(e,i),m.then(function(t){t.appendChild(i);var o=i.contentWindow;return function(n,e){u.a.on(a.d.OPEN_TUNNEL,{window:n,domain:e},function(n){var t=n.origin,o=n.data;if(t!==e)throw new Error("Domain "+e+" does not match origin "+t);if(!o.name)throw new Error("Register window expected to be passed window name");if(!o.sendMessage)throw new Error("Register window expected to be passed sendMessage method");if(!D.has(o.name))throw new Error("Window with name "+o.name+" does not exist, or was not opened by this window");if(!D.get(o.name).domain)throw new Error("We do not have a registered domain for window "+o.name);if(D.get(o.name).domain!==t)throw new Error("Message origin "+t+" does not matched registered window origin "+D.get(o.name).domain);return y(D.get(o.name).win,e,o.sendMessage),{sendMessage:function(n){if(window&&!window.closed){var e=D.get(o.name);if(e)try{u.a.receiveMessage({data:n,origin:e.domain,source:e.win})}catch(n){r.a.reject(n)}}}}})}(o,e),new r.a(function(n,e){i.onload=n,i.onerror=e}).then(function(){return Object(_.a)(o,a.b.BRIDGE_TIMEOUT,"Bridge "+n)}).then(function(){return o})})})})}function R(n){for(var e=n.win,t=n.name,r=n.domain,i=0,a=D.keys(),u=null==a?0:a.length;i<u;i++){var c=a[i];Object(o.isWindowClosed)(D.get(c).win)&&D.del(c)}var s=T.getOrSet(e,function(){return t?D.getOrSet(t,function(){return{win:e,name:t}}):{win:e}});if(s.win&&s.win!==e)throw new Error("Different window already linked for window: "+(t||"undefined"));if(t){if(s.name&&s.name!==t)throw new Error("Different window already linked for name "+t+": "+s.name);s.name=t,D.set(t,s)}return r&&(s.domain=r,g(e)),T.set(e,s),s}function A(n,e){R({win:n,domain:Object(o.getDomainFromUrl)(e)})}var M=window.open;function N(){for(var n=0,e=W.keys(),t=null==e?0:e.length;n<t;n++){var r=e[n],o=W.get(r);o&&o.parentNode&&o.parentNode.removeChild(o)}W.reset(),S.reset()}window.open=function(n,e,t,r){var i=M.call(this,Object(o.normalizeMockUrl)(n),e,t,r);return i?(R({win:i,name:e,domain:n?Object(o.getDomainFromUrl)(n):null}),i):i},t.d(e,"openTunnelToOpener",function(){return j}),t.d(e,"needsBridgeForBrowser",function(){return s}),t.d(e,"needsBridgeForWin",function(){return f}),t.d(e,"needsBridgeForDomain",function(){return d}),t.d(e,"needsBridge",function(){return l}),t.d(e,"getBridgeName",function(){return w}),t.d(e,"isBridge",function(){return h}),t.d(e,"documentBodyReady",function(){return m}),t.d(e,"registerRemoteWindow",function(){return g}),t.d(e,"findRemoteWindow",function(){return v}),t.d(e,"registerRemoteSendMessage",function(){return y}),t.d(e,"rejectRemoteSendMessage",function(){return O}),t.d(e,"sendBridgeMessage",function(){return b}),t.d(e,"hasBridge",function(){return P}),t.d(e,"openBridge",function(){return I}),t.d(e,"linkWindow",function(){return R}),t.d(e,"linkUrl",function(){return A}),t.d(e,"destroyBridges",function(){return N})},function(n,e,t){"use strict";t.d({},"WeakMap",function(){return u});var r=t(0);function o(n,e){for(var t=0;t<n.length;t++)try{if(n[t]===e)return t}catch(n){}return-1}var i=Object.defineProperty,a=Date.now()%1e9,u=function(){function n(){if(function(e,t){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this),a+=1,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__"+a,function(){if("undefined"==typeof WeakMap)return!1;if(void 0===Object.freeze)return!1;try{var n=new WeakMap,e={};return Object.freeze(e),n.set(e,"__testvalue__"),"__testvalue__"===n.get(e)}catch(n){return!1}}())try{this.weakmap=new WeakMap}catch(n){}this.keys=[],this.values=[]}return n.prototype._cleanupClosedWindows=function(){for(var n=this.weakmap,e=this.keys,t=0;t<e.length;t++){var o=e[t];if(Object(r.isWindow)(o)&&Object(r.isWindowClosed)(o)){if(n)try{n.delete(o)}catch(n){}e.splice(t,1),this.values.splice(t,1),t-=1}}},n.prototype.isSafeToReadWrite=function(n){if(Object(r.isWindow)(n))return!1;try{n&&n.self,n&&n[this.name]}catch(n){return!1}return!0},n.prototype.set=function(n,e){if(!n)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{t.set(n,e)}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n)){var r=this.name,a=n[r];a&&a[0]===n?a[1]=e:i(n,r,{value:[n,e],writable:!0})}else{this._cleanupClosedWindows();var u=this.keys,c=this.values,s=o(u,n);-1===s?(u.push(n),c.push(e)):c[s]=e}},n.prototype.get=function(n){if(!n)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{if(e.has(n))return e.get(n)}catch(n){delete this.weakmap}if(!this.isSafeToReadWrite(n)){this._cleanupClosedWindows();var t=o(this.keys,n);if(-1===t)return;return this.values[t]}var r=n[this.name];if(r&&r[0]===n)return r[1]},n.prototype.delete=function(n){if(!n)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{e.delete(n)}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n)){var t=n[this.name];t&&t[0]===n&&(t[0]=t[1]=void 0)}else{this._cleanupClosedWindows();var r=this.keys,i=o(r,n);-1!==i&&(r.splice(i,1),this.values.splice(i,1))}},n.prototype.has=function(n){if(!n)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{if(e.has(n))return!0}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n)){var t=n[this.name];return!(!t||t[0]!==n)}return this._cleanupClosedWindows(),-1!==o(this.keys,n)},n.prototype.getOrSet=function(n,e){if(this.has(n))return this.get(n);var t=e();return this.set(n,t),t},n}();t.d(e,"a",function(){return u})},function(n,e,t){"use strict";t.d(e,"a",function(){return r}),t.d(e,"b",function(){return o}),t.d(e,"c",function(){return i});var r={MOCK:"mock:",FILE:"file:",ABOUT:"about:"},o="*",i={IFRAME:"iframe",POPUP:"popup"}},function(n,e,t){"use strict";e.a=function(){return!!(window.navigator.mockUserAgent||window.navigator.userAgent).match(/Android|webOS|iPhone|iPad|iPod|bada|Symbian|Palm|CriOS|BlackBerry|IEMobile|WindowsMobile|Opera Mini/i)}},function(n,e,t){"use strict";t(2),t(0),t(8);var r=t(6);t(10),e.b=function n(){return Object(r.e)(n,function(){try{if("undefined"==typeof window)return!1;if(window.localStorage){var n=Math.random().toString();window.localStorage.setItem("__test__localStorage__",n);var e=window.localStorage.getItem("__test__localStorage__");if(window.localStorage.removeItem("__test__localStorage__"),n===e)return!0}}catch(n){}return!1})},e.a=function(n,e,t){return n.addEventListener(e,t),{cancel:function(){n.removeEventListener(e,t)}}},"function"==typeof Symbol&&Symbol.iterator,Object.assign,Object.create(Error.prototype)},function(n,e,t){"use strict";e.a=function n(e){var t=e.name,i=e.version,a=void 0===i?"latest":i,u=e.lifetime,c=void 0===u?3e5:u;return Object(r.e)(n,function(){var n="__"+t+"_"+a+"_storage__",e=void 0;function i(t){var i=Object(o.b)(),a=void 0;if(e&&(a=e),!a&&i){var u=window.localStorage.getItem(n);u&&(a=JSON.parse(u))}a||(a=Object(r.c)()[n]),a||(a={id:Object(r.q)()}),a.id||(a.id=Object(r.q)()),e=a;var c=t(a);return i?window.localStorage.setItem(n,JSON.stringify(a)):Object(r.c)()[n]=a,e=null,c}function u(n){return i(function(e){var t=e.__session__,o=Date.now();return t&&o-t.created>c&&(t=null),t||(t={guid:Object(r.q)(),created:o}),e.__session__=t,n(t)})}return{getState:i,getID:function(){return i(function(n){return n.id})},getSessionState:function(n){return u(function(e){return e.state=e.state||{},n(e.state)})},getSessionID:function(){return u(function(n){return n.guid})}}},[{name:t,version:a,lifetime:c}])};var r=t(6),o=t(11)},function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={};t.d(r,"markWindowKnown",function(){return i.e}),t.d(r,"serializeMessage",function(){return A}),t.d(r,"deserializeMessage",function(){return M}),t.d(r,"ProxyWindow",function(){return _}),t.d(r,"cleanUpWindow",function(){return mn}),t.d(r,"Promise",function(){return y.a}),t.d(r,"bridge",function(){return pn}),t.d(r,"parent",function(){return hn}),t.d(r,"send",function(){return on}),t.d(r,"requestPromises",function(){return tn}),t.d(r,"request",function(){return rn}),t.d(r,"sendToParent",function(){return an}),t.d(r,"client",function(){return un}),t.d(r,"on",function(){return fn}),t.d(r,"listen",function(){return sn}),t.d(r,"once",function(){return dn}),t.d(r,"listener",function(){return ln}),t.d(r,"CONFIG",function(){return c.b}),t.d(r,"disable",function(){return wn});var o,i=t(5),a=t(0),u=t(3),c=t(1),s={FUNCTION:"function",ERROR:"error",PROMISE:"promise",REGEX:"regex",DATE:"date",ARRAY:"array",OBJECT:"object",STRING:"string",NUMBER:"number",BOOLEAN:"boolean",NULL:"null",UNDEFINED:"undefined"},f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function d(n){return"object"===(void 0===n?"undefined":f(n))&&null!==n&&"string"==typeof n.__type__}function l(n){return void 0===n?s.UNDEFINED:null===n?s.NULL:Array.isArray(n)?s.ARRAY:"function"==typeof n?s.FUNCTION:"object"===(void 0===n?"undefined":f(n))?n instanceof Error?s.ERROR:"function"==typeof n.then?s.PROMISE:"[object RegExp]"===Object.prototype.toString.call(n)?s.REGEX:"[object Date]"===Object.prototype.toString.call(n)?s.DATE:s.OBJECT:"string"==typeof n?s.STRING:"number"==typeof n?s.NUMBER:"boolean"==typeof n?s.BOOLEAN:void 0}function w(n,e){return{__type__:n,__val__:e}}var h,m=((o={})[s.FUNCTION]=function(){},o[s.ERROR]=function(n){var e=n.message,t=n.stack,r=n.code;return w(s.ERROR,{message:e,stack:t,code:r})},o[s.PROMISE]=function(){},o[s.REGEX]=function(n){return w(s.REGEX,n.source)},o[s.DATE]=function(n){return w(s.DATE,n.toJSON())},o[s.ARRAY]=function(n){return n},o[s.OBJECT]=function(n){return n},o[s.STRING]=function(n){return n},o[s.NUMBER]=function(n){return n},o[s.BOOLEAN]=function(n){return n},o[s.NULL]=function(n){return n},o),p={},g=((h={})[s.FUNCTION]=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},h[s.ERROR]=function(n){var e=n.message,t=n.stack,r=n.code,o=new Error(e);return o.code=r,o.stack=t+"\n\n"+o.stack,o},h[s.PROMISE]=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},h[s.REGEX]=function(n){return new RegExp(n)},h[s.DATE]=function(n){return new Date(n)},h[s.ARRAY]=function(n){return n},h[s.OBJECT]=function(n){return n},h[s.STRING]=function(n){return n},h[s.NUMBER]=function(n){return n},h[s.BOOLEAN]=function(n){return n},h[s.NULL]=function(n){return n},h),v={},y=t(2),O=t(4),b=Object(O.c)("winToProxyWindow"),E=Object(O.b)("idToProxyWindow");function j(){for(var n=0,e=E.keys(),t=null==e?0:e.length;n<t;n++){var r=e[n];E.get(r).shouldClean()&&E.del(r)}}var _=function(){function n(e,t){!function(e,t){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.isProxyWindow=!0,this.serializedWindow=e,this.actualWindowPromise=new y.a,t&&this.setWindow(t),this.serializedWindow.getInstanceID=Object(u.memoizePromise)(this.serializedWindow.getInstanceID)}return n.prototype.getType=function(){return this.serializedWindow.type},n.prototype.isPopup=function(){return this.getType()===a.WINDOW_TYPE.POPUP},n.prototype.isIframe=function(){return this.getType()===a.WINDOW_TYPE.IFRAME},n.prototype.setLocation=function(n){var e=this;return y.a.try(function(){if(!e.actualWindow)return e.serializedWindow.setLocation(n);e.actualWindow.location=n}).then(function(){return e})},n.prototype.setName=function(n){var e=this;return y.a.try(function(){if(!e.actualWindow)return e.serializedWindow.setName(n);if(!Object(a.isSameDomain)(e.actualWindow))throw new Error("Can not set name for window on different domain");e.actualWindow.name=n,e.actualWindow.frameElement&&e.actualWindow.frameElement.setAttribute("name",n),(0,t(7).linkWindow)({win:e.actualWindow,name:n})}).then(function(){return e})},n.prototype.close=function(){var n=this;return y.a.try(function(){if(!n.actualWindow)return n.serializedWindow.close();n.actualWindow.close()}).then(function(){return n})},n.prototype.focus=function(){var n=this;return y.a.try(function(){return n.actualWindow&&n.actualWindow.focus(),n.serializedWindow.focus()}).then(function(){return n})},n.prototype.isClosed=function(){var n=this;return y.a.try(function(){return n.actualWindow?Object(a.isWindowClosed)(n.actualWindow):n.serializedWindow.isClosed()})},n.prototype.setWindow=function(n){this.actualWindow=n,this.actualWindowPromise.resolve(n)},n.prototype.matchWindow=function(n){var e=this;return y.a.try(function(){return e.actualWindow?n===e.actualWindow:y.a.all([e.getInstanceID(),Object(i.b)(n)]).then(function(t){var r=t[0]===t[1];return r&&e.setWindow(n),r})})},n.prototype.unwrap=function(){return this.actualWindow||this},n.prototype.awaitWindow=function(){return this.actualWindowPromise},n.prototype.getInstanceID=function(){return this.actualWindow?Object(i.b)(this.actualWindow):this.serializedWindow.getInstanceID()},n.prototype.serialize=function(){return this.serializedWindow},n.prototype.shouldClean=function(){return this.actualWindow&&Object(a.isWindowClosed)(this.actualWindow)},n.unwrap=function(e){return n.isProxyWindow(e)?e.unwrap():e},n.serialize=function(e){return j(),n.toProxyWindow(e).serialize()},n.deserialize=function(e){return j(),E.getOrSet(e.id,function(){return new n(e)})},n.isProxyWindow=function(n){return Boolean(n&&!Object(a.isWindow)(n)&&n.isProxyWindow)},n.toProxyWindow=function(e){return j(),n.isProxyWindow(e)?e:b.getOrSet(e,function(){var r=Object(u.uniqueID)();return E.set(r,new n({id:r,type:Object(a.getOpener)(e)?a.WINDOW_TYPE.POPUP:a.WINDOW_TYPE.IFRAME,getInstanceID:function(){return Object(i.b)(e)},close:function(){return y.a.try(function(){e.close()})},focus:function(){return y.a.try(function(){e.focus()})},isClosed:function(){return y.a.try(function(){return Object(a.isWindowClosed)(e)})},setLocation:function(n){return y.a.try(function(){if(Object(a.isSameDomain)(e))try{if(e.location&&"function"==typeof e.location.replace)return void e.location.replace(n)}catch(n){}e.location=n})},setName:function(n){return y.a.try(function(){(0,t(7).linkWindow)({win:e,name:n}),e.name=n})}},e))})},n}(),S=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},W=Object(O.c)("methodStore"),D=Object(O.b)("proxyWindowMethods");function T(n,e,t,r,o){_.isProxyWindow(r)?D.set(n,{val:e,name:t,domain:o,source:r}):(D.del(n),W.getOrSet(r,function(){return{}})[n]={domain:o,name:t,val:e,source:r})}function P(n,e){return W.getOrSet(n,function(){return{}})[e]||D.get(e)}O.a.listeningForFunctions=O.a.listeningForFunctions||!1;var I=Object(u.once)(function(){O.a.listeningForFunctions||(O.a.listeningForFunctions=!0,O.a.on(c.d.METHOD,{origin:c.i},function(n){var e=n.source,t=n.origin,r=n.data,o=r.id,i=r.name;return y.a.try(function(){var n=P(e,o);if(!n)throw new Error("Could not find method '"+r.name+"' with id: "+r.id+" in "+Object(a.getDomain)(window));var c=n.source,s=n.domain,f=n.val;return y.a.try(function(){if(!Object(a.matchDomain)(s,t))throw new Error("Method '"+r.name+"' domain "+JSON.stringify(Object(u.isRegex)(n.domain)?n.domain.source:n.domain)+" does not match origin "+t+" in "+Object(a.getDomain)(window));if(_.isProxyWindow(c))return c.matchWindow(e).then(function(n){if(!n)throw new Error("Method call '"+r.name+"' failed - proxy window does not match source in "+Object(a.getDomain)(window))})}).then(function(){return f.apply({source:e,origin:t},r.args)},function(n){return y.a.try(function(){if(f.onError)return f.onError(n)}).then(function(){throw n})}).then(function(n){return{result:n,id:o,name:i}})})}))});function R(n,e,t,r){I();var o=t.__id__||Object(u.uniqueID)();n=_.unwrap(n);var i=t.__name__||t.name||r;return _.isProxyWindow(n)?(T(o,t,i,n,e),n.awaitWindow().then(function(n){T(o,t,i,n,e)})):T(o,t,i,n,e),w(c.h.CROSS_DOMAIN_FUNCTION,{id:o,name:i})}function A(n,e,t){var r;return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p,t=JSON.stringify(n,function(n){var t=this[n];if(d(this))return t;var r=l(t);if(!r)return t;var o=e[r]||m[r];return o?o(t,n):t});return void 0===t?s.UNDEFINED:t}(t,((r={})[s.PROMISE]=function(t,r){return function(n,e,t,r){return w(c.h.CROSS_DOMAIN_ZALGO_PROMISE,{then:R(n,e,function(n,e){return t.then(n,e)},r)})}(n,e,t,r)},r[s.FUNCTION]=function(t,r){return R(n,e,t,r)},r[s.OBJECT]=function(n){return Object(a.isWindow)(n)||_.isProxyWindow(n)?(e=n,w(c.h.CROSS_DOMAIN_WINDOW,_.serialize(e))):n;var e},r))}function M(n,e,t){var r;return function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;if(n!==s.UNDEFINED)return JSON.parse(n,function(n,t){if(d(this))return t;var r=void 0,o=void 0;if(d(t)?(r=t.__type__,o=t.__val__):(r=l(t),o=t),!r)return o;var i=e[r]||g[r];return i?i(o,n):o})}(t,((r={})[c.h.CROSS_DOMAIN_ZALGO_PROMISE]=function(n){return e=n.then,new y.a(e);var e},r[c.h.CROSS_DOMAIN_FUNCTION]=function(t){return function(n,e,t){var r=t.id,o=t.name,i=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};function i(){var u=arguments;return _.toProxyWindow(n).awaitWindow().then(function(n){var s=P(n,r);return s&&s.val!==i?s.val.apply({source:window,origin:Object(a.getDomain)()},u):O.a.send(n,c.d.METHOD,{id:r,name:o,args:Array.prototype.slice.call(u)},S({domain:e},t)).then(function(n){return n.data.result})}).catch(function(n){throw n})}return i.__name__=o,i.__origin__=e,i.__source__=n,i.__id__=r,i.origin=e,i},u=i();return u.fireAndForget=i({fireAndForget:!0}),u}(n,e,t)},r[c.h.CROSS_DOMAIN_WINDOW]=function(n){return e=n,_.deserialize(e);var e},r))}var N={};N[c.g.POST_MESSAGE]=function(n,e,t){(Array.isArray(t)?t:"string"==typeof t?[t]:[c.i]).map(function(e){if(0===e.indexOf(c.f.MOCK)){if(window.location.protocol===c.f.FILE)return c.i;if(!Object(a.isActuallySameDomain)(n))throw new Error("Attempting to send messsage to mock domain "+e+", but window is actually cross-domain");return Object(a.getActualDomain)(n)}return 0===e.indexOf(c.f.FILE)?c.i:e}).forEach(function(t){return n.postMessage(e,t)})};var C=t(7),x=C.sendBridgeMessage,k=C.needsBridgeForBrowser,B=C.isBridge;N[c.g.BRIDGE]=function(n,e,t){if(k()||B()){if(Object(a.isSameDomain)(n))throw new Error("Post message through bridge disabled between same domain windows");if(!1!==Object(a.isSameTopWindow)(window,n))throw new Error("Can only use bridge to communicate between two different windows, not between frames");return x(n,t,e)}},N[c.g.GLOBAL]=function(n,e){if(Object(i.f)()){if(!Object(a.isSameDomain)(n))throw new Error("Post message through global disabled between different domain windows");if(!1!==Object(a.isSameTopWindow)(window,n))throw new Error("Can only use global to communicate between two different windows, not between frames");var t=n[c.j.POSTROBOT];if(!t)throw new Error("Can not find postRobot global on foreign window");return t.receiveMessage({source:window,origin:Object(a.getDomain)(),data:e})}};var U=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n};function F(n,e,t){return y.a.try(function(){var r;if(Object(a.isWindowClosed)(n))throw new Error("Window is closed");var o=A(n,e,((r={})[c.j.POSTROBOT]=U({id:Object(u.uniqueID)()},t),r)),i=[];return y.a.map(Object.keys(N),function(t){return y.a.try(function(){if(!c.b.ALLOWED_POST_MESSAGE_METHODS[t])throw new Error("Strategy disallowed: "+t);return N[t](n,o,e)}).then(function(){return i.push(t+": success"),!0},function(n){return i.push(t+": "+Object(u.stringifyError)(n)+"\n"),!1})}).then(function(n){var e=n.some(Boolean),r=t.type+" "+t.name+" "+(e?"success":"error")+":\n - "+i.join("\n - ")+"\n";if(!e)throw new Error(r)})})}var L=Object(O.b)("responseListeners"),z=Object(O.c)("requestListeners"),q=Object(O.b)("erroredResponseListeners");O.a.WINDOW_WILDCARD=O.a.WINDOW_WILDCARD||new function(){};var H,G="__domain_regex__";function K(n){return L.get(n)}function J(n){L.del(n)}function Y(n){return q.has(n)}function Q(n){var e=n.name,t=n.win,r=n.domain;if(t===c.i&&(t=null),r===c.i&&(r=null),!e)throw new Error("Name required to get request listener");for(var o=0,i=[t,O.a.WINDOW_WILDCARD],u=null==i?0:i.length;o<u;o++){var s=i[o];if(s){var f=z.get(s);if(f){var d=f[e];if(d){if(r&&"string"==typeof r){if(d[r])return d[r];if(d[G])for(var l=0,w=d[G],h=null==w?0:w.length;l<h;l++){var m=w[l],p=m.regex,g=m.listener;if(Object(a.matchDomain)(p,r))return g}}if(d[c.i])return d[c.i]}}}}}var X=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Z=((H={})[c.e.REQUEST]=function(n,e,t){var r=Q({name:t.name,win:n,domain:e});function o(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.fireAndForget||Object(a.isWindowClosed)(n)?y.a.resolve():F(n,e,X({type:r,ack:o,hash:t.hash,name:t.name},i))}return t.name===c.d.METHOD&&t.data&&"string"==typeof t.data.name?t.data.name:t.name,y.a.all([o(c.e.ACK),y.a.try(function(){if(!r)throw new Error("No handler found for post message: "+t.name+" from "+e+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(a.matchDomain)(r.domain,e))throw new Error("Request origin "+e+" does not match domain "+r.domain.toString());var o=t.data;return r.handler({source:n,origin:e,data:o})}).then(function(n){return o(c.e.RESPONSE,c.c.SUCCESS,{data:n})},function(n){return o(c.e.RESPONSE,c.c.ERROR,{error:n})})]).then(u.noop).catch(function(n){if(r&&r.handleError)return r.handleError(n);throw n})},H[c.e.ACK]=function(n,e,t){if(!Y(t.hash)){var r=K(t.hash);if(!r)throw new Error("No handler found for post message ack for message: "+t.name+" from "+e+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(a.matchDomain)(r.domain,e))throw new Error("Ack origin "+e+" does not match domain "+r.domain.toString());r.ack=!0}},H[c.e.RESPONSE]=function(n,e,t){if(!Y(t.hash)){var r=K(t.hash);if(!r)throw new Error("No handler found for post message response for message: "+t.name+" from "+e+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(a.matchDomain)(r.domain,e))throw new Error("Response origin "+e+" does not match domain "+Object(a.stringifyDomainPattern)(r.domain));if(J(t.hash),t.ack===c.c.ERROR)return r.respond(t.error,null);if(t.ack===c.c.SUCCESS){var o=t.data;return r.respond(null,{source:n,origin:e,data:o})}}},H),V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},$=Object(O.b)("receivedMessages");function nn(n){if(!window||window.closed)throw new Error("Message recieved in closed window");try{if(!n.source)return}catch(n){return}var e=n.source,t=n.origin,r=function(n,e,t){var r=void 0;try{r=M(e,t,n)}catch(n){return}if(r&&"object"===(void 0===r?"undefined":V(r))&&null!==r&&(r=r[c.j.POSTROBOT])&&"object"===(void 0===r?"undefined":V(r))&&null!==r&&r.type&&"string"==typeof r.type&&Z[r.type])return r}(n.data,e,t);r&&(Object(i.e)(e),$.has(r.id)||($.set(r.id,!0),Object(a.isWindowClosed)(e)&&!r.fireAndForget||Z[r.type](e,t,r)))}function en(n){try{Object(u.noop)(n.source)}catch(n){return}var e={source:n.source||n.sourceElement,origin:n.origin||n.originalEvent&&n.originalEvent.origin,data:n.data};if(e.source){if(!e.origin)throw new Error("Post message did not have origin domain");nn(e)}}O.a.receiveMessage=nn;var tn=Object(O.c)("requestPromises");function rn(n){return y.a.try(function(){if(!n.name)throw new Error("Expected options.name");var e=n.name,t=void 0,r=void 0;if("string"==typeof n.window){var o=document.getElementById(n.window);if(!o)throw new Error("Expected options.window "+Object.prototype.toString.call(n.window)+" to be a valid element id");if("iframe"!==o.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(n.window)+" to be an iframe");if(!o.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");t=o.contentWindow}else if(n.window instanceof HTMLIFrameElement){if("iframe"!==n.window.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(n.window)+" to be an iframe");if(n.window&&!n.window.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");n.window&&n.window.contentWindow&&(t=n.window.contentWindow)}else t=n.window;if(!t)throw new Error("Expected options.window to be a window object, iframe, or iframe element id.");var s=t;r=n.domain||c.i;var f=n.name+"_"+Object(u.uniqueID)();if(Object(a.isWindowClosed)(s))throw new Error("Target window is closed");var d=!1,l=tn.getOrSet(s,function(){return[]}),w=y.a.try(function(){if(Object(a.isAncestor)(window,s))return Object(i.a)(s,n.timeout||c.b.CHILD_WINDOW_TIMEOUT)}).then(function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).domain;if(Object(u.isRegex)(r)&&!n)return Object(i.g)(s)}).then(function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).domain;if(Object(u.isRegex)(r)){if(!Object(a.matchDomain)(r,t))throw new Error("Remote window domain "+t+" does not match regex: "+r.toString());r=t}if("string"!=typeof r&&!Array.isArray(r))throw new TypeError("Expected domain to be a string or array");var o=r;return e===c.d.METHOD&&n.data&&"string"==typeof n.data.name&&n.data.name,new y.a(function(t,r){var u=void 0;if(n.fireAndForget||function(n,e){L.set(n,e)}(f,u={name:e,window:s,domain:o,respond:function(n,e){n||(d=!0,l.splice(l.indexOf(w,1))),n?r(n):t(e)}}),F(s,o,{type:c.e.REQUEST,hash:f,name:e,data:n.data,fireAndForget:Boolean(n.fireAndForget)}).catch(r),n.fireAndForget)return t();var h=Object(i.d)(s)?c.b.ACK_TIMEOUT_KNOWN:c.b.ACK_TIMEOUT,m=n.timeout||c.b.RES_TIMEOUT,p=h,g=m,v=100;setTimeout(function n(){if(!d){if(Object(a.isWindowClosed)(s))return u.ack?r(new Error("Window closed for "+e+" before response")):r(new Error("Window closed for "+e+" before ack"));if(p=Math.max(p-v,0),-1!==g&&(g=Math.max(g-v,0)),u.ack){if(-1===g)return;v=Math.min(g,2e3)}else{if(0===p)return r(new Error("No ack for postMessage "+e+" in "+Object(a.getDomain)()+" in "+h+"ms"));if(0===g)return r(new Error("No response for postMessage "+e+" in "+Object(a.getDomain)()+" in "+m+"ms"))}setTimeout(n,v)}},v)})});return w.catch(function(){!function(n){q.set(n,!0)}(f),J(f)}),l.push(w),w})}function on(n,e,t,r){return(r=r||{}).window=n,r.name=e,r.data=t,rn(r)}function an(n,e,t){var r=Object(a.getAncestor)();return r?on(r,n,e,t):new y.a(function(n,e){return e(new Error("Window does not have a parent"))})}function un(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!n.window)throw new Error("Expected options.window");var e=n.window;return{send:function(t,r){return on(e,t,r,n)}}}O.a.send=on;var cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function sn(n){if(!n.name)throw new Error("Expected options.name");if(!n.handler)throw new Error("Expected options.handler");var e=n.name,t=n.window,r=n.domain,o={handler:n.handler,handleError:n.errorHandler||function(n){throw n},window:t,domain:r||c.i,name:e},i=function n(e,t){var r=e.name,o=e.win,i=e.domain;if(!r||"string"!=typeof r)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var a=[],s=0,f=o,d=null==f?0:f.length;s<d;s++){var l=f[s];a.push(n({name:r,domain:i,win:l},t))}return{cancel:function(){for(var n=0,e=null==a?0:a.length;n<e;n++)a[n].cancel()}}}if(Array.isArray(i)){for(var w=[],h=0,m=i,p=null==m?0:m.length;h<p;h++){var g=m[h];w.push(n({name:r,win:o,domain:g},t))}return{cancel:function(){for(var n=0,e=null==w?0:w.length;n<e;n++)w[n].cancel()}}}var v=Q({name:r,win:o,domain:i});if(o&&o!==c.i||(o=O.a.WINDOW_WILDCARD),i=i||c.i,v)throw o&&i?new Error("Request listener already exists for "+r+" on domain "+i.toString()+" for "+(o===O.a.WINDOW_WILDCARD?"wildcard":"specified")+" window"):o?new Error("Request listener already exists for "+r+" for "+(o===O.a.WINDOW_WILDCARD?"wildcard":"specified")+" window"):i?new Error("Request listener already exists for "+r+" on domain "+i.toString()):new Error("Request listener already exists for "+r);var y=z.getOrSet(o,function(){return{}}),b=Object(u.getOrSet)(y,r,function(){return{}}),E=i.toString(),j=void 0,_=void 0;return Object(u.isRegex)(i)?(j=Object(u.getOrSet)(b,G,function(){return[]}),_={regex:i,listener:t},j.push(_)):b[E]=t,{cancel:function(){delete b[E],_&&(j.splice(j.indexOf(_,1)),j.length||delete b[G]),Object.keys(b).length||delete y[r],o&&!Object.keys(y).length&&z.del(o)}}}({name:e,win:t,domain:r},o);if(n.once){var s=o.handler;o.handler=Object(u.once)(function(){return i.cancel(),s.apply(this,arguments)})}if(o.window&&n.errorOnClose)var f=Object(u.safeInterval)(function(){t&&"object"===(void 0===t?"undefined":cn(t))&&Object(a.isWindowClosed)(t)&&(f.cancel(),o.handleError(new Error("Post message target window is closed")))},50);return{cancel:function(){i.cancel()}}}function fn(n,e,t){return"function"==typeof e&&(t=e,e={}),(e=e||{}).name=n,e.handler=t||e.handler,sn(e)}function dn(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments[2];"function"==typeof e&&(t=e,e={}),e=e||{},t=t||e.handler;var r=e.errorHandler,o=new y.a(function(o,i){(e=e||{}).name=n,e.once=!0,e.handler=function(n){if(o(n),t)return t(n)},e.errorHandler=function(n){if(i(n),r)return r(n)}}),i=sn(e);return o.cancel=i.cancel,o}function ln(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{on:function(e,t){return fn(e,n,t)}}}function wn(){delete window[c.j.POSTROBOT],window.removeEventListener("message",en)}O.a.on=fn;var hn=Object(a.getAncestor)();function mn(n){for(var e=0,t=tn.get(n,[]),r=null==t?0:t.length;e<r;e++)t[e].reject(new Error("Window cleaned up before response")).catch(u.noop)}var pn=t(23);O.a.initialized||(O.a.initialized=!0,Object(u.addEventListener)(window,"message",en),pn&&pn.openTunnelToOpener(),Object(i.c)()),t.d(e,"markWindowKnown",function(){return i.e}),t.d(e,"serializeMessage",function(){return A}),t.d(e,"deserializeMessage",function(){return M}),t.d(e,"ProxyWindow",function(){return _}),t.d(e,"cleanUpWindow",function(){return mn}),t.d(e,"Promise",function(){return y.a}),t.d(e,"bridge",function(){return pn}),t.d(e,"parent",function(){return hn}),t.d(e,"send",function(){return on}),t.d(e,"requestPromises",function(){return tn}),t.d(e,"request",function(){return rn}),t.d(e,"sendToParent",function(){return an}),t.d(e,"client",function(){return un}),t.d(e,"on",function(){return fn}),t.d(e,"listen",function(){return sn}),t.d(e,"once",function(){return dn}),t.d(e,"listener",function(){return ln}),t.d(e,"CONFIG",function(){return c.b}),t.d(e,"disable",function(){return wn}),e.default=r},function(n,e,t){"use strict";function r(n){return"[object RegExp]"===Object.prototype.toString.call(n)}var o=t(9);e.g=u,e.f=c,e.a=f,e.c=d,e.i=l,e.l=w,e.o=function(n){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(n===window)return!1}catch(n){return!0}try{if(!n)return!0}catch(n){return!0}try{if(n.closed)return!0}catch(n){return!n||n.message!==i}if(e&&w(n))try{if(n.mockclosed)return!0}catch(n){}try{if(!n.parent||!n.top)return!0}catch(n){}var t=function(n,e){for(var t=0;t<n.length;t++)try{if(n[t]===e)return t}catch(n){}return-1}(y,n);if(-1!==t){var r=O[t];if(r&&function(n){if(!n.contentWindow)return!0;if(!n.parentNode)return!0;var e=n.ownerDocument;return!(!e||!e.documentElement||e.documentElement.contains(n))}(r))return!0}return!1},e.p=function(n){if(function(){for(var n=0;n<y.length;n++){var e=!1;try{e=y[n].closed}catch(n){}e&&(O.splice(n,1),y.splice(n,1))}}(),n&&n.contentWindow)try{y.push(n.contentWindow),O.push(n)}catch(n){}},e.h=function(n){return(n=n||window).navigator.mockUserAgent||n.navigator.userAgent},e.e=function(n,e){for(var t=m(n),r=0,o=null==t?0:t.length;r<o;r++){var i=t[r];try{if(w(i)&&i.name===e&&-1!==t.indexOf(i))return i}catch(n){}}try{if(-1!==t.indexOf(n.frames[e]))return n.frames[e]}catch(n){}try{if(-1!==t.indexOf(n[e]))return n[e]}catch(n){}},e.k=function(n,e){return n===c(e)},e.b=b,e.j=function(n,e){var t=b(e);if(t)return t===n;if(e===n)return!1;if(g(e)===e)return!1;for(var r=0,o=m(n),i=null==o?0:o.length;r<i;r++)if(o[r]===e)return!0;return!1},e.m=function(n,e){var t=g(n)||n,r=g(e)||e;try{if(t&&r)return t===r}catch(n){}var o=v(n),i=v(e);if(E(o,i))return!0;var a=c(t),u=c(r);return!(a&&E(v(a),i)||(u&&E(v(u),o),1))},e.q=function n(e,t){if("string"==typeof e){if("string"==typeof t)return e===o.b||t===e;if(r(t))return!1;if(Array.isArray(t))return!1}return r(e)?r(t)?e.toString()===t.toString():!Array.isArray(t)&&Boolean(t.match(e)):!!Array.isArray(e)&&(Array.isArray(t)?JSON.stringify(e)===JSON.stringify(t):!r(t)&&e.some(function(e){return n(e,t)}))},e.s=function(n){return Array.isArray(n)?"("+n.join(" | ")+")":r(n)?"RegExp("+n.toString():n.toString()},e.d=j,e.n=function(n){try{if(n===window)return!0}catch(n){if(n&&n.message===i)return!0}try{if("[object Window]"===Object.prototype.toString.call(n))return!0}catch(n){if(n&&n.message===i)return!0}try{if(window.Window&&n instanceof window.Window)return!0}catch(n){if(n&&n.message===i)return!0}try{if(n&&n.self===n)return!0}catch(n){if(n&&n.message===i)return!0}try{if(n&&n.parent===n)return!0}catch(n){if(n&&n.message===i)return!0}try{if(n&&n.top===n)return!0}catch(n){if(n&&n.message===i)return!0}try{n&&n.__cross_domain_utils_window_check__}catch(n){return!0}return!1},e.r=function(n){if(0!==j(n).indexOf(o.a.MOCK))return n;throw new Error("Mock urls not supported out of test mode")};var i="Call was rejected by callee.\r\n";function a(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===o.a.ABOUT}function u(n){if(n)try{if(n.parent&&n.parent!==n)return n.parent}catch(n){}}function c(n){if(n&&!u(n))try{return n.opener}catch(n){}}function s(n){try{return n&&n.location&&n.location.href,!0}catch(n){}return!1}function f(n){var e=(n=n||window).location;if(!e)throw new Error("Can not read window location");var t=e.protocol;if(!t)throw new Error("Can not read window protocol");if(t===o.a.FILE)return o.a.FILE+"//";if(t===o.a.ABOUT){var r=u(n);return r&&s(r)?f(r):o.a.ABOUT+"//"}var i=e.host;if(!i)throw new Error("Can not read window host");return t+"//"+i}function d(n){var e=f(n=n||window);return e&&n.mockDomain&&0===n.mockDomain.indexOf(o.a.MOCK)?n.mockDomain:e}function l(n){try{if(n===window)return!0}catch(n){}try{var e=Object.getOwnPropertyDescriptor(n,"location");if(e&&!1===e.enumerable)return!1}catch(n){}try{if(a(n)&&s(n))return!0}catch(n){}try{if(f(n)===f(window))return!0}catch(n){}return!1}function w(n){if(!l(n))return!1;try{if(n===window)return!0;if(a(n)&&s(n))return!0;if(d(window)===d(n))return!0}catch(n){}return!1}function h(n,e){if(!n||!e)return!1;var t=u(e);return t?t===n:-1!==function(n){var e=[];try{for(;n.parent!==n;)e.push(n.parent),n=n.parent}catch(n){}return e}(e).indexOf(n)}function m(n){var e=[],t=void 0;try{t=n.frames}catch(e){t=n}var r=void 0;try{r=t.length}catch(n){}if(0===r)return e;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=t[o]}catch(n){continue}e.push(i)}return e}for(var a=0;a<100;a++){var u=void 0;try{u=t[a]}catch(n){return e}if(!u)return e;e.push(u)}return e}function p(n){for(var e=[],t=0,r=m(n),o=null==r?0:r.length;t<o;t++){var i=r[t];e.push(i);for(var a=0,u=p(i),c=null==u?0:u.length;a<c;a++){var s=u[a];e.push(s)}}return e}function g(n){if(n){try{if(n.top)return n.top}catch(n){}if(u(n)===n)return n;try{if(h(window,n)&&window.top)return window.top}catch(n){}try{if(h(n,window)&&window.top)return window.top}catch(n){}for(var e=0,t=p(n),r=null==t?0:t.length;e<r;e++){var o=t[e];try{if(o.top)return o.top}catch(n){}if(u(o)===o)return o}}}function v(n){var e=g(n);if(!e)throw new Error("Can not determine top window");return[].concat(p(e),[e])}var y=[],O=[];function b(n){return c(n=n||window)||u(n)||void 0}function E(n,e){for(var t=0,r=null==n?0:n.length;t<r;t++)for(var o=n[t],i=0,a=null==e?0:e.length;i<a;i++)if(o===e[i])return!0;return!1}function j(n){return n.match(/^(https?|mock|file):\/\//)?n.split("/").slice(0,3).join("/"):d()}},function(n,e){},function(n,e,t){"use strict";t(6),t(12)},function(n,e,t){"use strict";t(6)},function(n,e,t){"use strict";t(2),t(0)},function(n,e){},function(n,e,t){"use strict";t(6)},function(n,e,t){"use strict"},function(n,e,t){"use strict";t(2),t(6)},function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(7);t.d(e,"openBridge",function(){return r.openBridge}),t.d(e,"linkWindow",function(){return r.linkWindow}),t.d(e,"linkUrl",function(){return r.linkUrl}),t.d(e,"isBridge",function(){return r.isBridge}),t.d(e,"needsBridge",function(){return r.needsBridge}),t.d(e,"needsBridgeForBrowser",function(){return r.needsBridgeForBrowser}),t.d(e,"hasBridge",function(){return r.hasBridge}),t.d(e,"needsBridgeForWin",function(){return r.needsBridgeForWin}),t.d(e,"needsBridgeForDomain",function(){return r.needsBridgeForDomain}),t.d(e,"openTunnelToOpener",function(){return r.openTunnelToOpener}),t.d(e,"destroyBridges",function(){return r.destroyBridges})}])});
//# sourceMappingURL=post-robot.ie.min.js.map

@@ -1,2 +0,2 @@

!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("postRobot",[],t):"object"==typeof exports?exports.postRobot=t():n.postRobot=t()}("undefined"!=typeof self?self:this,function(){return function(n){var t={};function e(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=n,e.c=t,e.d=function(n,t,r){e.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:r})},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},e.p="",e(e.s=9)}([function(n,t,e){"use strict";var r=e(10);e.d(t,"getActualDomain",function(){return r.a}),e.d(t,"getAncestor",function(){return r.b}),e.d(t,"getDomain",function(){return r.c}),e.d(t,"getOpener",function(){return r.d}),e.d(t,"getUserAgent",function(){return r.e}),e.d(t,"isActuallySameDomain",function(){return r.f}),e.d(t,"isAncestor",function(){return r.g}),e.d(t,"isSameDomain",function(){return r.h}),e.d(t,"isWindow",function(){return r.i}),e.d(t,"isWindowClosed",function(){return r.j}),e.d(t,"linkFrameWindow",function(){return r.k}),e.d(t,"matchDomain",function(){return r.l}),e.d(t,"stringifyDomainPattern",function(){return r.m});var o=e(11);e.n(o),e.o(o,"WINDOW_TYPE")&&e.d(t,"WINDOW_TYPE",function(){return o.WINDOW_TYPE});var i=e(5);e.d(t,"WINDOW_TYPE",function(){return i.c})},function(n,t,e){"use strict";function r(n){try{if(!n)return!1;if("undefined"!=typeof Promise&&n instanceof Promise)return!0;if("undefined"!=typeof window&&window.Window&&n instanceof window.Window)return!1;if("undefined"!=typeof window&&window.constructor&&n instanceof window.constructor)return!1;var t={}.toString;if(t){var e=t.call(n);if("[object Window]"===e||"[object global]"===e||"[object DOMWindow]"===e)return!1}if("function"==typeof n.then)return!0}catch(n){return!1}return!1}function o(){var n=void 0;if("undefined"!=typeof window)n=window;else{if("undefined"==typeof window)throw new TypeError("Can not find global");n=window}var t=n.__zalgopromise__=n.__zalgopromise__||{};return t.flushPromises=t.flushPromises||[],t.activeCount=t.activeCount||0,t.possiblyUnhandledPromiseHandlers=t.possiblyUnhandledPromiseHandlers||[],t.dispatchedErrors=t.dispatchedErrors||[],t}var i=function(){function n(t){var e=this;if(function(t,e){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],t){var r=void 0,o=void 0,i=!1,a=!1,u=!1;try{t(function(n){u?e.resolve(n):(i=!0,r=n)},function(n){u?e.reject(n):(a=!0,o=n)})}catch(n){return void this.reject(n)}u=!0,i?this.resolve(r):a&&this.reject(o)}}return n.prototype.resolve=function(n){if(this.resolved||this.rejected)return this;if(r(n))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=n,this.dispatch(),this},n.prototype.reject=function(n){var t=this;if(this.resolved||this.rejected)return this;if(r(n))throw new Error("Can not reject promise with another promise");if(!n){var e=n&&"function"==typeof n.toString?n.toString():Object.prototype.toString.call(n);n=new Error("Expected reject to be called with Error, got "+e)}return this.rejected=!0,this.error=n,this.errorHandled||setTimeout(function(){t.errorHandled||function(n,t){if(-1===o().dispatchedErrors.indexOf(n)){o().dispatchedErrors.push(n),setTimeout(function(){throw n},1);for(var e=0;e<o().possiblyUnhandledPromiseHandlers.length;e++)o().possiblyUnhandledPromiseHandlers[e](n,t)}}(n,t)},1),this.dispatch(),this},n.prototype.asyncReject=function(n){return this.errorHandled=!0,this.reject(n),this},n.prototype.dispatch=function(){var t=this,e=this.dispatching,i=this.resolved,a=this.rejected,u=this.handlers;if(!e&&(i||a)){this.dispatching=!0,o().activeCount+=1;for(var c=function(e){var o=u[e],c=o.onSuccess,s=o.onError,f=o.promise,d=void 0;if(i)try{d=c?c(t.value):t.value}catch(n){return f.reject(n),"continue"}else if(a){if(!s)return f.reject(t.error),"continue";try{d=s(t.error)}catch(n){return f.reject(n),"continue"}}d instanceof n&&(d.resolved||d.rejected)?(d.resolved?f.resolve(d.value):f.reject(d.error),d.errorHandled=!0):r(d)?d instanceof n&&(d.resolved||d.rejected)?d.resolved?f.resolve(d.value):f.reject(d.error):d.then(function(n){f.resolve(n)},function(n){f.reject(n)}):f.resolve(d)},s=0;s<u.length;s++)c(s);u.length=0,this.dispatching=!1,o().activeCount-=1,0===o().activeCount&&n.flushQueue()}},n.prototype.then=function(t,e){if(t&&"function"!=typeof t&&!t.call)throw new Error("Promise.then expected a function for success handler");if(e&&"function"!=typeof e&&!e.call)throw new Error("Promise.then expected a function for error handler");var r=new n;return this.handlers.push({promise:r,onSuccess:t,onError:e}),this.errorHandled=!0,this.dispatch(),r},n.prototype.catch=function(n){return this.then(void 0,n)},n.prototype.finally=function(t){if(t&&"function"!=typeof t&&!t.call)throw new Error("Promise.finally expected a function");return this.then(function(e){return n.try(t).then(function(){return e})},function(e){return n.try(t).then(function(){throw e})})},n.prototype.timeout=function(n,t){var e=this;if(this.resolved||this.rejected)return this;var r=setTimeout(function(){e.resolved||e.rejected||e.reject(t||new Error("Promise timed out after "+n+"ms"))},n);return this.then(function(n){return clearTimeout(r),n})},n.prototype.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.resolve=function(t){return t instanceof n?t:r(t)?new n(function(n,e){return t.then(n,e)}):(new n).resolve(t)},n.reject=function(t){return(new n).reject(t)},n.asyncReject=function(t){return(new n).asyncReject(t)},n.all=function(t){var e=new n,o=t.length,i=[];if(!o)return e.resolve(i),e;for(var a=function(a){var u=t[a];if(u instanceof n){if(u.resolved)return i[a]=u.value,o-=1,"continue"}else if(!r(u))return i[a]=u,o-=1,"continue";n.resolve(u).then(function(n){i[a]=n,0==(o-=1)&&e.resolve(i)},function(n){e.reject(n)})},u=0;u<t.length;u++)a(u);return 0===o&&e.resolve(i),e},n.hash=function(t){var e={};return n.all(Object.keys(t).map(function(r){return n.resolve(t[r]).then(function(n){e[r]=n})})).then(function(){return e})},n.map=function(t,e){return n.all(t.map(e))},n.onPossiblyUnhandledException=function(n){return function(n){return o().possiblyUnhandledPromiseHandlers.push(n),{cancel:function(){o().possiblyUnhandledPromiseHandlers.splice(o().possiblyUnhandledPromiseHandlers.indexOf(n),1)}}}(n)},n.try=function(t,e,r){if(t&&"function"!=typeof t&&!t.call)throw new Error("Promise.try expected a function");var o=void 0;try{o=t.apply(e,r||[])}catch(t){return n.reject(t)}return n.resolve(o)},n.delay=function(t){return new n(function(n){setTimeout(n,t)})},n.isPromise=function(t){return!!(t&&t instanceof n)||r(t)},n.flush=function(){var t=new n;return o().flushPromises.push(t),0===o().activeCount&&n.flushQueue(),t},n.flushQueue=function(){var n=o().flushPromises;o().flushPromises=[];for(var t=0,e=null==n?0:n.length;t<e;t++)n[t].resolve()},n}();e.d(t,"a",function(){return i})},function(n,t,e){"use strict";e(6);var r=e(7);e.d(t,"addEventListener",function(){return r.a}),e(12),e(13),e(8);var o=e(3);e.d(t,"getOrSet",function(){return o.d}),e.d(t,"isRegex",function(){return o.f}),e.d(t,"memoizePromise",function(){return o.h}),e.d(t,"noop",function(){return o.i}),e.d(t,"once",function(){return o.j}),e.d(t,"safeInterval",function(){return o.m}),e.d(t,"stringifyError",function(){return o.o}),e.d(t,"uniqueID",function(){return o.q}),e.d(t,"weakMapMemoizePromise",function(){return o.r}),e(14);var i=e(15);e.n(i),e(16),e(17),e(18)},function(n,t,e){"use strict";t.q=a,t.c=function(){if("undefined"!=typeof window)return window;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("No global found")},t.g=function(n){var t=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new o.a;function i(){for(var t=arguments.length,o=Array(t),i=0;i<t;i++)o[i]=arguments[i];var a=r.getOrSet(e.thisNamespace?this:n,function(){return{}}),u=c(o),s=e.time;if(a[u]&&s&&Date.now()-a[u].time<s&&delete a[u],a[u])return a[u].value;var f=Date.now(),d=n.apply(this,arguments);return a[u]={time:f,value:d},a[u].value}return i.reset=function(){r.delete(e.thisNamespace?t:n)},e.name&&(i.displayName=e.name+":memoized"),i},t.h=function(n){var t={};function e(){for(var e=arguments.length,r=Array(e),o=0;o<e;o++)r[o]=arguments[o];var i=c(r);return t.hasOwnProperty(i)?t[i]:(t[i]=n.apply(this,arguments).finally(function(){delete t[i]}),t[i])}return e.reset=function(){t={}},e},t.k=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};function e(){return r.a.try(n,this,arguments)}return t.name&&(e.displayName=t.name+":promisified"),e},t.e=function(n,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=n.__inline_memoize_cache__=n.__inline_memoize_cache__||{},o=c(e);return r.hasOwnProperty(o)?r[o]:r[o]=t.apply(void 0,e)},t.i=function(){},t.j=function(n){var t=!1;return function(){if(!t)return t=!0,n.apply(this,arguments)}},t.o=function n(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e>=3)return"stringifyError stack overflow";try{if(!t)return"<unknown error: "+Object.prototype.toString.call(t)+">";if("string"==typeof t)return t;if(t instanceof Error){var r=t&&t.stack,o=t&&t.message;if(r&&o)return-1!==r.indexOf(o)?r:o+"\n"+r;if(r)return r;if(o)return o}return"function"==typeof t.toString?t.toString():Object.prototype.toString.call(t)}catch(t){return"Error while stringifying error: "+n(t,e+1)}},t.n=function(n){return"string"==typeof n?n:n&&"function"==typeof n.toString?n.toString():Object.prototype.toString.call(n)},t.b=function(n,t){if(!t)return n;if(Object.assign)return Object.assign(n,t);for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n},t.m=function(n,t){var e=void 0;return function r(){e=setTimeout(function(){n(),r()},t)}(),{cancel:function(){clearTimeout(e)}}},t.a=function(n){return n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()},t.f=function(n){return"[object RegExp]"===Object.prototype.toString.call(n)},e.d(t,"r",function(){return s}),t.d=function(n,t,e){if(n.hasOwnProperty(t))return n[t];var r=e();return n[t]=r,r},t.p=function(n){var t=void 0,e=void 0;try{t=n()}catch(n){e=n}return{result:t,error:e}},t.l=function(n,t){var e=n.indexOf(t);-1!==e&&n.splice(e,1)};var r=e(1),o=e(4),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function a(){var n="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,function(){return n.charAt(Math.floor(Math.random()*n.length))})+"_"+function(n){if("function"==typeof btoa)return btoa(n);if("undefined"!=typeof Buffer)return Buffer.from(n,"utf8").toString("base64");throw new Error("Can not find window.btoa or Buffer")}((new Date).toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var u=void 0;function c(n){try{return JSON.stringify(Array.prototype.slice.call(n),function(n,t){return"function"==typeof t?"memoize["+function(n){if(u=u||new o.a,null===n||void 0===n||"object"!==(void 0===n?"undefined":i(n))&&"function"!=typeof n)throw new Error("Invalid object");var t=u.get(n);return t||(t=(void 0===n?"undefined":i(n))+":"+a(),u.set(n,t)),t}(t)+"]":t})}catch(n){throw new Error("Arguments not serializable -- can not be used to memoize")}}var s=function(n){var t=new o.a;return function(e){var r=this;return t.getOrSet(e,function(){return n.call(r,e).finally(function(){t.delete(e)})})}}},function(n,t,e){"use strict";e.d({},"WeakMap",function(){return u});var r=e(0);function o(n,t){for(var e=0;e<n.length;e++)try{if(n[e]===t)return e}catch(n){}return-1}var i=Object.defineProperty,a=Date.now()%1e9,u=function(){function n(){if(function(t,e){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this),a+=1,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__"+a,function(){if("undefined"==typeof WeakMap)return!1;if(void 0===Object.freeze)return!1;try{var n=new WeakMap,t={};return Object.freeze(t),n.set(t,"__testvalue__"),"__testvalue__"===n.get(t)}catch(n){return!1}}())try{this.weakmap=new WeakMap}catch(n){}this.keys=[],this.values=[]}return n.prototype._cleanupClosedWindows=function(){for(var n=this.weakmap,t=this.keys,e=0;e<t.length;e++){var o=t[e];if(Object(r.isWindow)(o)&&Object(r.isWindowClosed)(o)){if(n)try{n.delete(o)}catch(n){}t.splice(e,1),this.values.splice(e,1),e-=1}}},n.prototype.isSafeToReadWrite=function(n){if(Object(r.isWindow)(n))return!1;try{n&&n.self,n&&n[this.name]}catch(n){return!1}return!0},n.prototype.set=function(n,t){if(!n)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{e.set(n,t)}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n)){var r=this.name,a=n[r];a&&a[0]===n?a[1]=t:i(n,r,{value:[n,t],writable:!0})}else{this._cleanupClosedWindows();var u=this.keys,c=this.values,s=o(u,n);-1===s?(u.push(n),c.push(t)):c[s]=t}},n.prototype.get=function(n){if(!n)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{if(t.has(n))return t.get(n)}catch(n){delete this.weakmap}if(!this.isSafeToReadWrite(n)){this._cleanupClosedWindows();var e=o(this.keys,n);if(-1===e)return;return this.values[e]}var r=n[this.name];if(r&&r[0]===n)return r[1]},n.prototype.delete=function(n){if(!n)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{t.delete(n)}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n)){var e=n[this.name];e&&e[0]===n&&(e[0]=e[1]=void 0)}else{this._cleanupClosedWindows();var r=this.keys,i=o(r,n);-1!==i&&(r.splice(i,1),this.values.splice(i,1))}},n.prototype.has=function(n){if(!n)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{if(t.has(n))return!0}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n)){var e=n[this.name];return!(!e||e[0]!==n)}return this._cleanupClosedWindows(),-1!==o(this.keys,n)},n.prototype.getOrSet=function(n,t){if(this.has(n))return this.get(n);var e=t();return this.set(n,e),e},n}();e.d(t,"a",function(){return u})},function(n,t,e){"use strict";e.d(t,"a",function(){return r}),e.d(t,"b",function(){return o}),e.d(t,"c",function(){return i});var r={MOCK:"mock:",FILE:"file:",ABOUT:"about:"},o="*",i={IFRAME:"iframe",POPUP:"popup"}},function(n,t,e){"use strict";t.a=function(){return!!(window.navigator.mockUserAgent||window.navigator.userAgent).match(/Android|webOS|iPhone|iPad|iPod|bada|Symbian|Palm|CriOS|BlackBerry|IEMobile|WindowsMobile|Opera Mini/i)}},function(n,t,e){"use strict";e(1),e(0),e(4);var r=e(3);e(6),t.b=function n(){return Object(r.e)(n,function(){try{if("undefined"==typeof window)return!1;if(window.localStorage){var n=Math.random().toString();window.localStorage.setItem("__test__localStorage__",n);var t=window.localStorage.getItem("__test__localStorage__");if(window.localStorage.removeItem("__test__localStorage__"),n===t)return!0}}catch(n){}return!1})},t.a=function(n,t,e){return n.addEventListener(t,e),{cancel:function(){n.removeEventListener(t,e)}}},"function"==typeof Symbol&&Symbol.iterator,Object.assign,Object.create(Error.prototype)},function(n,t,e){"use strict";t.a=function n(t){var e=t.name,i=t.version,a=void 0===i?"latest":i,u=t.lifetime,c=void 0===u?3e5:u;return Object(r.e)(n,function(){var n="__"+e+"_"+a+"_storage__",t=void 0;function i(e){var i=Object(o.b)(),a=void 0;if(t&&(a=t),!a&&i){var u=window.localStorage.getItem(n);u&&(a=JSON.parse(u))}a||(a=Object(r.c)()[n]),a||(a={id:Object(r.q)()}),a.id||(a.id=Object(r.q)()),t=a;var c=e(a);return i?window.localStorage.setItem(n,JSON.stringify(a)):Object(r.c)()[n]=a,t=null,c}function u(n){return i(function(t){var e=t.__session__,o=Date.now();return e&&o-e.created>c&&(e=null),e||(e={guid:Object(r.q)(),created:o}),t.__session__=e,n(e)})}return{getState:i,getID:function(){return i(function(n){return n.id})},getSessionState:function(n){return u(function(t){return t.state=t.state||{},n(t.state)})},getSessionID:function(){return u(function(n){return n.guid})}}},[{name:e,version:a,lifetime:c}])};var r=e(3),o=e(7)},function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={};e.d(r,"markWindowKnown",function(){return j}),e.d(r,"serializeMessage",function(){return Q}),e.d(r,"deserializeMessage",function(){return X}),e.d(r,"ProxyWindow",function(){return F}),e.d(r,"cleanUpWindow",function(){return In}),e.d(r,"Promise",function(){return a.a}),e.d(r,"bridge",function(){return Pn}),e.d(r,"parent",function(){return Dn}),e.d(r,"send",function(){return yn}),e.d(r,"requestPromises",function(){return mn}),e.d(r,"request",function(){return vn}),e.d(r,"sendToParent",function(){return gn}),e.d(r,"client",function(){return On}),e.d(r,"on",function(){return _n}),e.d(r,"listen",function(){return bn}),e.d(r,"once",function(){return Wn}),e.d(r,"listener",function(){return Sn}),e.d(r,"CONFIG",function(){return w}),e.d(r,"disable",function(){return jn});var o,i=e(0),a=e(1),u=e(2),c={REQUEST:"postrobot_message_request",RESPONSE:"postrobot_message_response",ACK:"postrobot_message_ack"},s={METHOD:"postrobot_method",HELLO:"postrobot_hello",OPEN_TUNNEL:"postrobot_open_tunnel"},f={POSTROBOT:"__postRobot__"},d="*",l={CROSS_DOMAIN_ZALGO_PROMISE:"cross_domain_zalgo_promise",CROSS_DOMAIN_FUNCTION:"cross_domain_function",CROSS_DOMAIN_WINDOW:"cross_domain_window"},w={BRIDGE_TIMEOUT:5e3,CHILD_WINDOW_TIMEOUT:5e3,ACK_TIMEOUT:2e3,ACK_TIMEOUT_KNOWN:1e4,RES_TIMEOUT:-1,ALLOWED_POST_MESSAGE_METHODS:(o={},o.postrobot_post_message=!0,o.postrobot_bridge=!0,o.postrobot_global=!0,o)},h=e(4),p=window[f.POSTROBOT]=window[f.POSTROBOT]||{},m=p.windowStore=p.windowStore||new h.a,v=function(){return{}};function y(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;function e(n){return m.getOrSet(n,t)}return{has:function(t){return e(t).hasOwnProperty(n)},get:function(t,r){var o=e(t);return o.hasOwnProperty(n)?o[n]:r},set:function(t,r){return e(t)[n]=r,r},del:function(t){delete e(t)[n]},getOrSet:function(t,r){var o=e(t);if(o.hasOwnProperty(n))return o[n];var i=r();return o[n]=i,i}}}function g(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v,e=Object(u.getOrSet)(p,n,t);return{has:function(n){return e.hasOwnProperty(n)},get:function(n,t){return e.hasOwnProperty(n)?e[n]:t},set:function(n,t){return e[n]=t,t},del:function(n){delete e[n]},getOrSet:function(n,t){if(e.hasOwnProperty(n))return e[n];var r=t();return e[n]=r,r},reset:function(){e=t()},keys:function(){return Object.keys(e)}}}p.instanceID=p.instanceID||Object(u.uniqueID)();var O=y("helloPromises");function E(n){return O.getOrSet(n,function(){return new a.a})}var b=Object(u.once)(function(){p.on(s.HELLO,{domain:d},function(n){var t=n.source,e=n.origin;return E(t).resolve({win:t,domain:e}),{instanceID:p.instanceID}})});function _(n){return p.send(n,s.HELLO,{instanceID:p.instanceID},{domain:d,timeout:-1}).then(function(t){var e=t.origin,r=t.data.instanceID;return E(n).resolve({win:n,domain:e}),{win:n,domain:e,instanceID:r}})}var W=Object(u.weakMapMemoizePromise)(function(n){return _(n).then(function(n){return n.instanceID})}),S=y("knownWindows");function j(n){S.set(n,!0)}var D,I={FUNCTION:"function",ERROR:"error",PROMISE:"promise",REGEX:"regex",DATE:"date",ARRAY:"array",OBJECT:"object",STRING:"string",NUMBER:"number",BOOLEAN:"boolean",NULL:"null",UNDEFINED:"undefined"},P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function A(n){return"object"===(void 0===n?"undefined":P(n))&&null!==n&&"string"==typeof n.__type__}function T(n){return void 0===n?I.UNDEFINED:null===n?I.NULL:Array.isArray(n)?I.ARRAY:"function"==typeof n?I.FUNCTION:"object"===(void 0===n?"undefined":P(n))?n instanceof Error?I.ERROR:"function"==typeof n.then?I.PROMISE:"[object RegExp]"===Object.prototype.toString.call(n)?I.REGEX:"[object Date]"===Object.prototype.toString.call(n)?I.DATE:I.OBJECT:"string"==typeof n?I.STRING:"number"==typeof n?I.NUMBER:"boolean"==typeof n?I.BOOLEAN:void 0}function N(n,t){return{__type__:n,__val__:t}}var R,C=((D={})[I.FUNCTION]=function(){},D[I.ERROR]=function(n){var t=n.message,e=n.stack,r=n.code;return N(I.ERROR,{message:t,stack:e,code:r})},D[I.PROMISE]=function(){},D[I.REGEX]=function(n){return N(I.REGEX,n.source)},D[I.DATE]=function(n){return N(I.DATE,n.toJSON())},D[I.ARRAY]=function(n){return n},D[I.OBJECT]=function(n){return n},D[I.STRING]=function(n){return n},D[I.NUMBER]=function(n){return n},D[I.BOOLEAN]=function(n){return n},D[I.NULL]=function(n){return n},D),x={},M=((R={})[I.FUNCTION]=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},R[I.ERROR]=function(n){var t=n.message,e=n.stack,r=n.code,o=new Error(t);return o.code=r,o.stack=e+"\n\n"+o.stack,o},R[I.PROMISE]=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},R[I.REGEX]=function(n){return new RegExp(n)},R[I.DATE]=function(n){return new Date(n)},R[I.ARRAY]=function(n){return n},R[I.OBJECT]=function(n){return n},R[I.STRING]=function(n){return n},R[I.NUMBER]=function(n){return n},R[I.BOOLEAN]=function(n){return n},R[I.NULL]=function(n){return n},R),k={},U=y("winToProxyWindow"),L=g("idToProxyWindow");function z(){for(var n=0,t=L.keys(),e=null==t?0:t.length;n<e;n++){var r=t[n];L.get(r).shouldClean()&&L.del(r)}}var F=function(){function n(t,e){!function(t,e){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.isProxyWindow=!0,this.serializedWindow=t,this.actualWindowPromise=new a.a,e&&this.setWindow(e),this.serializedWindow.getInstanceID=Object(u.memoizePromise)(this.serializedWindow.getInstanceID)}return n.prototype.getType=function(){return this.serializedWindow.type},n.prototype.isPopup=function(){return this.getType()===i.WINDOW_TYPE.POPUP},n.prototype.isIframe=function(){return this.getType()===i.WINDOW_TYPE.IFRAME},n.prototype.setLocation=function(n){var t=this;return a.a.try(function(){if(!t.actualWindow)return t.serializedWindow.setLocation(n);t.actualWindow.location=n}).then(function(){return t})},n.prototype.setName=function(n){var t=this;return a.a.try(function(){if(!t.actualWindow)return t.serializedWindow.setName(n);if(!Object(i.isSameDomain)(t.actualWindow))throw new Error("Can not set name for window on different domain");t.actualWindow.name=n,t.actualWindow.frameElement&&t.actualWindow.frameElement.setAttribute("name",n)}).then(function(){return t})},n.prototype.close=function(){var n=this;return a.a.try(function(){if(!n.actualWindow)return n.serializedWindow.close();n.actualWindow.close()}).then(function(){return n})},n.prototype.focus=function(){var n=this;return a.a.try(function(){return n.actualWindow&&n.actualWindow.focus(),n.serializedWindow.focus()}).then(function(){return n})},n.prototype.isClosed=function(){var n=this;return a.a.try(function(){return n.actualWindow?Object(i.isWindowClosed)(n.actualWindow):n.serializedWindow.isClosed()})},n.prototype.setWindow=function(n){this.actualWindow=n,this.actualWindowPromise.resolve(n)},n.prototype.matchWindow=function(n){var t=this;return a.a.try(function(){return t.actualWindow?n===t.actualWindow:a.a.all([t.getInstanceID(),W(n)]).then(function(e){var r=e[0]===e[1];return r&&t.setWindow(n),r})})},n.prototype.unwrap=function(){return this.actualWindow||this},n.prototype.awaitWindow=function(){return this.actualWindowPromise},n.prototype.getInstanceID=function(){return this.actualWindow?W(this.actualWindow):this.serializedWindow.getInstanceID()},n.prototype.serialize=function(){return this.serializedWindow},n.prototype.shouldClean=function(){return this.actualWindow&&Object(i.isWindowClosed)(this.actualWindow)},n.unwrap=function(t){return n.isProxyWindow(t)?t.unwrap():t},n.serialize=function(t){return z(),n.toProxyWindow(t).serialize()},n.deserialize=function(t){return z(),L.getOrSet(t.id,function(){return new n(t)})},n.isProxyWindow=function(n){return Boolean(n&&!Object(i.isWindow)(n)&&n.isProxyWindow)},n.toProxyWindow=function(t){return z(),n.isProxyWindow(t)?t:U.getOrSet(t,function(){var e=Object(u.uniqueID)();return L.set(e,new n({id:e,type:Object(i.getOpener)(t)?i.WINDOW_TYPE.POPUP:i.WINDOW_TYPE.IFRAME,getInstanceID:function(){return W(t)},close:function(){return a.a.try(function(){t.close()})},focus:function(){return a.a.try(function(){t.focus()})},isClosed:function(){return a.a.try(function(){return Object(i.isWindowClosed)(t)})},setLocation:function(n){return a.a.try(function(){if(Object(i.isSameDomain)(t))try{if(t.location&&"function"==typeof t.location.replace)return void t.location.replace(n)}catch(n){}t.location=n})},setName:function(n){return a.a.try(function(){t.name=n})}},t))})},n}(),B=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},H=y("methodStore"),q=g("proxyWindowMethods");function G(n,t,e,r){F.isProxyWindow(e)?q.set(n,{val:t,domain:r,source:e}):(q.del(n),H.getOrSet(e,function(){return{}})[n]={domain:r,val:t,source:e})}function J(n,t){return H.getOrSet(n,function(){return{}})[t]||q.get(t)}p.listeningForFunctions=p.listeningForFunctions||!1;var K=Object(u.once)(function(){p.listeningForFunctions||(p.listeningForFunctions=!0,p.on(s.METHOD,{origin:d},function(n){var t=n.source,e=n.origin,r=n.data,o=r.id,c=r.name;return a.a.try(function(){var n=J(t,o);if(!n)throw new Error("Could not find method '"+r.name+"' with id: "+r.id+" in "+Object(i.getDomain)(window));var s=n.source,f=n.domain,d=n.val;return a.a.try(function(){if(!Object(i.matchDomain)(f,e))throw new Error("Method '"+r.name+"' domain "+JSON.stringify(Object(u.isRegex)(n.domain)?n.domain.source:n.domain)+" does not match origin "+e+" in "+Object(i.getDomain)(window));if(F.isProxyWindow(s))return s.matchWindow(t).then(function(n){if(!n)throw new Error("Method call '"+r.name+"' failed - proxy window does not match source in "+Object(i.getDomain)(window))})}).then(function(){return d.apply({source:t,origin:e},r.args)},function(n){return a.a.try(function(){if(d.onError)return d.onError(n)}).then(function(){throw n})}).then(function(n){return{result:n,id:o,name:c}})})}))});function Y(n,t,e,r){K();var o=e.__id__||Object(u.uniqueID)();return n=F.unwrap(n),F.isProxyWindow(n)?(G(o,e,n,t),n.awaitWindow().then(function(n){G(o,e,n,t)})):H.getOrSet(n,function(){return{}})[o]={domain:t,val:e},N(l.CROSS_DOMAIN_FUNCTION,{id:o,name:e.name||r})}function Q(n,t,e){var r;return function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:x,e=JSON.stringify(n,function(n){var e=this[n];if(A(this))return e;var r=T(e);if(!r)return e;var o=t[r]||C[r];return o?o(e,n):e});return void 0===e?I.UNDEFINED:e}(e,((r={})[I.PROMISE]=function(e,r){return function(n,t,e,r){return N(l.CROSS_DOMAIN_ZALGO_PROMISE,{then:Y(n,t,function(n,t){return e.then(n,t)},r)})}(n,t,e,r)},r[I.FUNCTION]=function(e,r){return Y(n,t,e,r)},r[I.OBJECT]=function(n){return Object(i.isWindow)(n)||F.isProxyWindow(n)?(t=n,N(l.CROSS_DOMAIN_WINDOW,F.serialize(t))):n;var t},r))}function X(n,t,e){var r;return function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k;if(n!==I.UNDEFINED)return JSON.parse(n,function(n,e){if(A(this))return e;var r=void 0,o=void 0;if(A(e)?(r=e.__type__,o=e.__val__):(r=T(e),o=e),!r)return o;var i=t[r]||M[r];return i?i(o,n):o})}(e,((r={})[l.CROSS_DOMAIN_ZALGO_PROMISE]=function(n){return t=n.then,new a.a(t);var t},r[l.CROSS_DOMAIN_FUNCTION]=function(e){return function(n,t,e){var r=e.id,o=e.name;function a(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return F.toProxyWindow(n).awaitWindow().then(function(n){var u,c=J(n,r);return c?(u=c.val).call.apply(u,[{source:window,origin:Object(i.getDomain)()}].concat(e)):p.send(n,s.METHOD,{id:r,name:o,args:e},B({domain:t},a)).then(function(n){return n.data.result})}).catch(function(n){throw n})}function u(){return a(Array.prototype.slice.call(arguments))}return u.fireAndForget=function(){return a(Array.prototype.slice.call(arguments),{fireAndForget:!0})},u.__name__=o,u.__origin__=t,u.__source__=n,u.__id__=r,u.origin=t,u}(n,t,e)},r[l.CROSS_DOMAIN_WINDOW]=function(n){return t=n,F.deserialize(t);var t},r))}var Z={postrobot_post_message:function(n,t,e){(Array.isArray(e)?e:"string"==typeof e?[e]:[d]).map(function(t){if(0===t.indexOf("mock:")){if("file:"===window.location.protocol)return d;if(!Object(i.isActuallySameDomain)(n))throw new Error("Attempting to send messsage to mock domain "+t+", but window is actually cross-domain");return Object(i.getActualDomain)(n)}return 0===t.indexOf("file:")?d:t}).forEach(function(e){return n.postMessage(t,e)})}},V=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n};function $(n,t,e){return a.a.try(function(){var r;if(Object(i.isWindowClosed)(n))throw new Error("Window is closed");var o=Q(n,t,((r={})[f.POSTROBOT]=V({id:Object(u.uniqueID)()},e),r)),c=[];return a.a.map(Object.keys(Z),function(e){return a.a.try(function(){if(!w.ALLOWED_POST_MESSAGE_METHODS[e])throw new Error("Strategy disallowed: "+e);return Z[e](n,o,t)}).then(function(){return c.push(e+": success"),!0},function(n){return c.push(e+": "+Object(u.stringifyError)(n)+"\n"),!1})}).then(function(n){var t=n.some(Boolean),r=e.type+" "+e.name+" "+(t?"success":"error")+":\n - "+c.join("\n - ")+"\n";if(!t)throw new Error(r)})})}var nn=g("responseListeners"),tn=y("requestListeners"),en=g("erroredResponseListeners");p.WINDOW_WILDCARD=p.WINDOW_WILDCARD||new function(){};var rn,on="__domain_regex__";function an(n){return nn.get(n)}function un(n){nn.del(n)}function cn(n){return en.has(n)}function sn(n){var t=n.name,e=n.win,r=n.domain;if(e===d&&(e=null),r===d&&(r=null),!t)throw new Error("Name required to get request listener");for(var o=0,a=[e,p.WINDOW_WILDCARD],u=null==a?0:a.length;o<u;o++){var c=a[o];if(c){var s=tn.get(c);if(s){var f=s[t];if(f){if(r&&"string"==typeof r){if(f[r])return f[r];if(f[on])for(var l=0,w=f[on],h=null==w?0:w.length;l<h;l++){var m=w[l],v=m.regex,y=m.listener;if(Object(i.matchDomain)(v,r))return y}}if(f[d])return f[d]}}}}}var fn=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},dn=((rn={})[c.REQUEST]=function(n,t,e){var r=sn({name:e.name,win:n,domain:t});function o(r,o){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.fireAndForget||Object(i.isWindowClosed)(n)?a.a.resolve():$(n,t,fn({type:r,ack:o,hash:e.hash,name:e.name},u))}return e.name===s.METHOD&&e.data&&"string"==typeof e.data.name?e.data.name:e.name,a.a.all([o(c.ACK),a.a.try(function(){if(!r)throw new Error("No handler found for post message: "+e.name+" from "+t+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(r.domain,t))throw new Error("Request origin "+t+" does not match domain "+r.domain.toString());var o=e.data;return r.handler({source:n,origin:t,data:o})}).then(function(n){return o(c.RESPONSE,"success",{data:n})},function(n){return o(c.RESPONSE,"error",{error:n})})]).then(u.noop).catch(function(n){if(r&&r.handleError)return r.handleError(n);throw n})},rn[c.ACK]=function(n,t,e){if(!cn(e.hash)){var r=an(e.hash);if(!r)throw new Error("No handler found for post message ack for message: "+e.name+" from "+t+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(r.domain,t))throw new Error("Ack origin "+t+" does not match domain "+r.domain.toString());r.ack=!0}},rn[c.RESPONSE]=function(n,t,e){if(!cn(e.hash)){var r=an(e.hash);if(!r)throw new Error("No handler found for post message response for message: "+e.name+" from "+t+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(r.domain,t))throw new Error("Response origin "+t+" does not match domain "+Object(i.stringifyDomainPattern)(r.domain));if(un(e.hash),"error"===e.ack)return r.respond(e.error,null);if("success"===e.ack){var o=e.data;return r.respond(null,{source:n,origin:t,data:o})}}},rn),ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},wn=g("receivedMessages");function hn(n){if(!window||window.closed)throw new Error("Message recieved in closed window");try{if(!n.source)return}catch(n){return}var t=n.source,e=n.origin,r=function(n,t,e){var r=void 0;try{r=X(t,e,n)}catch(n){return}if(r&&"object"===(void 0===r?"undefined":ln(r))&&null!==r&&(r=r[f.POSTROBOT])&&"object"===(void 0===r?"undefined":ln(r))&&null!==r&&r.type&&"string"==typeof r.type&&dn[r.type])return r}(n.data,t,e);r&&(j(t),wn.has(r.id)||(wn.set(r.id,!0),Object(i.isWindowClosed)(t)&&!r.fireAndForget||dn[r.type](t,e,r)))}function pn(n){try{Object(u.noop)(n.source)}catch(n){return}var t={source:n.source||n.sourceElement,origin:n.origin||n.originalEvent&&n.originalEvent.origin,data:n.data};if(t.source){if(!t.origin)throw new Error("Post message did not have origin domain");hn(t)}}p.receiveMessage=hn;var mn=y("requestPromises");function vn(n){return a.a.try(function(){if(!n.name)throw new Error("Expected options.name");var t=n.name,e=void 0,r=void 0;if("string"==typeof n.window){var o=document.getElementById(n.window);if(!o)throw new Error("Expected options.window "+Object.prototype.toString.call(n.window)+" to be a valid element id");if("iframe"!==o.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(n.window)+" to be an iframe");if(!o.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");e=o.contentWindow}else if(n.window instanceof HTMLIFrameElement){if("iframe"!==n.window.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(n.window)+" to be an iframe");if(n.window&&!n.window.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");n.window&&n.window.contentWindow&&(e=n.window.contentWindow)}else e=n.window;if(!e)throw new Error("Expected options.window to be a window object, iframe, or iframe element id.");var f=e;r=n.domain||d;var l=n.name+"_"+Object(u.uniqueID)();if(Object(i.isWindowClosed)(f))throw new Error("Target window is closed");var h=!1,p=mn.getOrSet(f,function(){return[]}),m=a.a.try(function(){if(Object(i.isAncestor)(window,f))return function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Window",r=E(n);return-1!==t&&(r=r.timeout(t,new Error(e+" did not load after "+t+"ms"))),r}(f,n.timeout||w.CHILD_WINDOW_TIMEOUT)}).then(function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).domain;if(Object(u.isRegex)(r)&&!n)return _(f)}).then(function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).domain;if(Object(u.isRegex)(r)){if(!Object(i.matchDomain)(r,e))throw new Error("Remote window domain "+e+" does not match regex: "+r.toString());r=e}if("string"!=typeof r&&!Array.isArray(r))throw new TypeError("Expected domain to be a string or array");var o=r;return t===s.METHOD&&n.data&&"string"==typeof n.data.name&&n.data.name,new a.a(function(e,r){var a=void 0;if(n.fireAndForget||function(n,t){nn.set(n,t)}(l,a={name:t,window:f,domain:o,respond:function(n,t){n||(h=!0,p.splice(p.indexOf(m,1))),n?r(n):e(t)}}),$(f,o,{type:c.REQUEST,hash:l,name:t,data:n.data,fireAndForget:Boolean(n.fireAndForget)}).catch(r),n.fireAndForget)return e();var u=function(n){return S.get(n,!1)}(f)?w.ACK_TIMEOUT_KNOWN:w.ACK_TIMEOUT,s=n.timeout||w.RES_TIMEOUT,d=u,v=s,y=100;setTimeout(function n(){if(!h){if(Object(i.isWindowClosed)(f))return a.ack?r(new Error("Window closed for "+t+" before response")):r(new Error("Window closed for "+t+" before ack"));if(d=Math.max(d-y,0),-1!==v&&(v=Math.max(v-y,0)),a.ack){if(-1===v)return;y=Math.min(v,2e3)}else{if(0===d)return r(new Error("No ack for postMessage "+t+" in "+Object(i.getDomain)()+" in "+u+"ms"));if(0===v)return r(new Error("No response for postMessage "+t+" in "+Object(i.getDomain)()+" in "+s+"ms"))}setTimeout(n,y)}},y)})});return m.catch(function(){!function(n){en.set(n,!0)}(l),un(l)}),p.push(m),m})}function yn(n,t,e,r){return(r=r||{}).window=n,r.name=t,r.data=e,vn(r)}function gn(n,t,e){var r=Object(i.getAncestor)();return r?yn(r,n,t,e):new a.a(function(n,t){return t(new Error("Window does not have a parent"))})}function On(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!n.window)throw new Error("Expected options.window");var t=n.window;return{send:function(e,r){return yn(t,e,r,n)}}}p.send=yn;var En="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function bn(n){if(!n.name)throw new Error("Expected options.name");if(!n.handler)throw new Error("Expected options.handler");var t=n.name,e=n.window,r=n.domain,o={handler:n.handler,handleError:n.errorHandler||function(n){throw n},window:e,domain:r||d,name:t},a=function n(t,e){var r=t.name,o=t.win,i=t.domain;if(!r||"string"!=typeof r)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var a=[],c=0,s=o,f=null==s?0:s.length;c<f;c++){var l=s[c];a.push(n({name:r,domain:i,win:l},e))}return{cancel:function(){for(var n=0,t=null==a?0:a.length;n<t;n++)a[n].cancel()}}}if(Array.isArray(i)){for(var w=[],h=0,m=i,v=null==m?0:m.length;h<v;h++){var y=m[h];w.push(n({name:r,win:o,domain:y},e))}return{cancel:function(){for(var n=0,t=null==w?0:w.length;n<t;n++)w[n].cancel()}}}var g=sn({name:r,win:o,domain:i});if(o&&o!==d||(o=p.WINDOW_WILDCARD),i=i||d,g)throw o&&i?new Error("Request listener already exists for "+r+" on domain "+i.toString()+" for "+(o===p.WINDOW_WILDCARD?"wildcard":"specified")+" window"):o?new Error("Request listener already exists for "+r+" for "+(o===p.WINDOW_WILDCARD?"wildcard":"specified")+" window"):i?new Error("Request listener already exists for "+r+" on domain "+i.toString()):new Error("Request listener already exists for "+r);var O=tn.getOrSet(o,function(){return{}}),E=Object(u.getOrSet)(O,r,function(){return{}}),b=i.toString(),_=void 0,W=void 0;return Object(u.isRegex)(i)?(_=Object(u.getOrSet)(E,on,function(){return[]}),W={regex:i,listener:e},_.push(W)):E[b]=e,{cancel:function(){delete E[b],W&&(_.splice(_.indexOf(W,1)),_.length||delete E[on]),Object.keys(E).length||delete O[r],o&&!Object.keys(O).length&&tn.del(o)}}}({name:t,win:e,domain:r},o);if(n.once){var c=o.handler;o.handler=Object(u.once)(function(){return a.cancel(),c.apply(this,arguments)})}if(o.window&&n.errorOnClose)var s=Object(u.safeInterval)(function(){e&&"object"===(void 0===e?"undefined":En(e))&&Object(i.isWindowClosed)(e)&&(s.cancel(),o.handleError(new Error("Post message target window is closed")))},50);return{cancel:function(){a.cancel()}}}function _n(n,t,e){return"function"==typeof t&&(e=t,t={}),(t=t||{}).name=n,t.handler=e||t.handler,bn(t)}function Wn(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments[2];"function"==typeof t&&(e=t,t={}),t=t||{},e=e||t.handler;var r=t.errorHandler,o=new a.a(function(o,i){(t=t||{}).name=n,t.once=!0,t.handler=function(n){if(o(n),e)return e(n)},t.errorHandler=function(n){if(i(n),r)return r(n)}}),i=bn(t);return o.cancel=i.cancel,o}function Sn(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{on:function(t,e){return _n(t,n,e)}}}function jn(){delete window[f.POSTROBOT],window.removeEventListener("message",pn)}p.on=_n;var Dn=Object(i.getAncestor)();function In(n){for(var t=0,e=mn.get(n,[]),r=null==e?0:e.length;t<r;t++)e[t].reject(new Error("Window cleaned up before response")).catch(u.noop)}var Pn=null;p.initialized||(p.initialized=!0,Object(u.addEventListener)(window,"message",pn),Pn&&Pn.openTunnelToOpener(),function(){b();var n=Object(i.getAncestor)();n&&_(n).catch(u.noop)}()),e.d(t,"markWindowKnown",function(){return j}),e.d(t,"serializeMessage",function(){return Q}),e.d(t,"deserializeMessage",function(){return X}),e.d(t,"ProxyWindow",function(){return F}),e.d(t,"cleanUpWindow",function(){return In}),e.d(t,"Promise",function(){return a.a}),e.d(t,"bridge",function(){return Pn}),e.d(t,"parent",function(){return Dn}),e.d(t,"send",function(){return yn}),e.d(t,"requestPromises",function(){return mn}),e.d(t,"request",function(){return vn}),e.d(t,"sendToParent",function(){return gn}),e.d(t,"client",function(){return On}),e.d(t,"on",function(){return _n}),e.d(t,"listen",function(){return bn}),e.d(t,"once",function(){return Wn}),e.d(t,"listener",function(){return Sn}),e.d(t,"CONFIG",function(){return w}),e.d(t,"disable",function(){return jn}),t.default=r},function(n,t,e){"use strict";function r(n){return"[object RegExp]"===Object.prototype.toString.call(n)}var o=e(5);t.d=c,t.a=f,t.c=d,t.f=l,t.h=w,t.j=function(n){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(n===window)return!1}catch(n){return!0}try{if(!n)return!0}catch(n){return!0}try{if(n.closed)return!0}catch(n){return!n||n.message!==i}if(t&&w(n))try{if(n.mockclosed)return!0}catch(n){}try{if(!n.parent||!n.top)return!0}catch(n){}var e=function(n,t){for(var e=0;e<n.length;e++)try{if(n[e]===t)return e}catch(n){}return-1}(m,n);if(-1!==e){var r=v[e];if(r&&function(n){if(!n.contentWindow)return!0;if(!n.parentNode)return!0;var t=n.ownerDocument;return!(!t||!t.documentElement||t.documentElement.contains(n))}(r))return!0}return!1},t.k=function(n){if(function(){for(var n=0;n<m.length;n++){var t=!1;try{t=m[n].closed}catch(n){}t&&(v.splice(n,1),m.splice(n,1))}}(),n&&n.contentWindow)try{m.push(n.contentWindow),v.push(n)}catch(n){}},t.e=function(n){return(n=n||window).navigator.mockUserAgent||n.navigator.userAgent},t.b=y,t.g=function(n,t){var e=y(t);if(e)return e===n;if(t===n)return!1;if(function(n){if(n){try{if(n.top)return n.top}catch(n){}if(u(n)===n)return n;try{if(h(window,n)&&window.top)return window.top}catch(n){}try{if(h(n,window)&&window.top)return window.top}catch(n){}for(var t=0,e=function n(t){for(var e=[],r=0,o=p(t),i=null==o?0:o.length;r<i;r++){var a=o[r];e.push(a);for(var u=0,c=n(a),s=null==c?0:c.length;u<s;u++){var f=c[u];e.push(f)}}return e}(n),r=null==e?0:e.length;t<r;t++){var o=e[t];try{if(o.top)return o.top}catch(n){}if(u(o)===o)return o}}}(t)===t)return!1;for(var r=0,o=p(n),i=null==o?0:o.length;r<i;r++)if(o[r]===t)return!0;return!1},t.l=function n(t,e){if("string"==typeof t){if("string"==typeof e)return t===o.b||e===t;if(r(e))return!1;if(Array.isArray(e))return!1}return r(t)?r(e)?t.toString()===e.toString():!Array.isArray(e)&&Boolean(e.match(t)):!!Array.isArray(t)&&(Array.isArray(e)?JSON.stringify(t)===JSON.stringify(e):!r(e)&&t.some(function(t){return n(t,e)}))},t.m=function(n){return Array.isArray(n)?"("+n.join(" | ")+")":r(n)?"RegExp("+n.toString():n.toString()},t.i=function(n){try{if(n===window)return!0}catch(n){if(n&&n.message===i)return!0}try{if("[object Window]"===Object.prototype.toString.call(n))return!0}catch(n){if(n&&n.message===i)return!0}try{if(window.Window&&n instanceof window.Window)return!0}catch(n){if(n&&n.message===i)return!0}try{if(n&&n.self===n)return!0}catch(n){if(n&&n.message===i)return!0}try{if(n&&n.parent===n)return!0}catch(n){if(n&&n.message===i)return!0}try{if(n&&n.top===n)return!0}catch(n){if(n&&n.message===i)return!0}try{n&&n.__cross_domain_utils_window_check__}catch(n){return!0}return!1};var i="Call was rejected by callee.\r\n";function a(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===o.a.ABOUT}function u(n){if(n)try{if(n.parent&&n.parent!==n)return n.parent}catch(n){}}function c(n){if(n&&!u(n))try{return n.opener}catch(n){}}function s(n){try{return n&&n.location&&n.location.href,!0}catch(n){}return!1}function f(n){var t=(n=n||window).location;if(!t)throw new Error("Can not read window location");var e=t.protocol;if(!e)throw new Error("Can not read window protocol");if(e===o.a.FILE)return o.a.FILE+"//";if(e===o.a.ABOUT){var r=u(n);return r&&s(r)?f(r):o.a.ABOUT+"//"}var i=t.host;if(!i)throw new Error("Can not read window host");return e+"//"+i}function d(n){var t=f(n=n||window);return t&&n.mockDomain&&0===n.mockDomain.indexOf(o.a.MOCK)?n.mockDomain:t}function l(n){try{if(n===window)return!0}catch(n){}try{var t=Object.getOwnPropertyDescriptor(n,"location");if(t&&!1===t.enumerable)return!1}catch(n){}try{if(a(n)&&s(n))return!0}catch(n){}try{if(f(n)===f(window))return!0}catch(n){}return!1}function w(n){if(!l(n))return!1;try{if(n===window)return!0;if(a(n)&&s(n))return!0;if(d(window)===d(n))return!0}catch(n){}return!1}function h(n,t){if(!n||!t)return!1;var e=u(t);return e?e===n:-1!==function(n){var t=[];try{for(;n.parent!==n;)t.push(n.parent),n=n.parent}catch(n){}return t}(t).indexOf(n)}function p(n){var t=[],e=void 0;try{e=n.frames}catch(t){e=n}var r=void 0;try{r=e.length}catch(n){}if(0===r)return t;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=e[o]}catch(n){continue}t.push(i)}return t}for(var a=0;a<100;a++){var u=void 0;try{u=e[a]}catch(n){return t}if(!u)return t;t.push(u)}return t}var m=[],v=[];function y(n){return c(n=n||window)||u(n)||void 0}},function(n,t){},function(n,t,e){"use strict";e(3),e(8)},function(n,t,e){"use strict";e(3)},function(n,t,e){"use strict";e(1),e(0)},function(n,t){},function(n,t,e){"use strict";e(3)},function(n,t,e){"use strict"},function(n,t,e){"use strict";e(1),e(3)}])});
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("postRobot",[],t):"object"==typeof exports?exports.postRobot=t():n.postRobot=t()}("undefined"!=typeof self?self:this,function(){return function(n){var t={};function e(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=n,e.c=t,e.d=function(n,t,r){e.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:r})},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},e.p="",e(e.s=9)}([function(n,t,e){"use strict";var r=e(10);e.d(t,"getActualDomain",function(){return r.a}),e.d(t,"getAncestor",function(){return r.b}),e.d(t,"getDomain",function(){return r.c}),e.d(t,"getOpener",function(){return r.d}),e.d(t,"getUserAgent",function(){return r.e}),e.d(t,"isActuallySameDomain",function(){return r.f}),e.d(t,"isAncestor",function(){return r.g}),e.d(t,"isSameDomain",function(){return r.h}),e.d(t,"isWindow",function(){return r.i}),e.d(t,"isWindowClosed",function(){return r.j}),e.d(t,"linkFrameWindow",function(){return r.k}),e.d(t,"matchDomain",function(){return r.l}),e.d(t,"stringifyDomainPattern",function(){return r.m});var o=e(11);e.n(o),e.o(o,"WINDOW_TYPE")&&e.d(t,"WINDOW_TYPE",function(){return o.WINDOW_TYPE});var i=e(5);e.d(t,"WINDOW_TYPE",function(){return i.c})},function(n,t,e){"use strict";function r(n){try{if(!n)return!1;if("undefined"!=typeof Promise&&n instanceof Promise)return!0;if("undefined"!=typeof window&&window.Window&&n instanceof window.Window)return!1;if("undefined"!=typeof window&&window.constructor&&n instanceof window.constructor)return!1;var t={}.toString;if(t){var e=t.call(n);if("[object Window]"===e||"[object global]"===e||"[object DOMWindow]"===e)return!1}if("function"==typeof n.then)return!0}catch(n){return!1}return!1}function o(){var n=void 0;if("undefined"!=typeof window)n=window;else{if("undefined"==typeof window)throw new TypeError("Can not find global");n=window}var t=n.__zalgopromise__=n.__zalgopromise__||{};return t.flushPromises=t.flushPromises||[],t.activeCount=t.activeCount||0,t.possiblyUnhandledPromiseHandlers=t.possiblyUnhandledPromiseHandlers||[],t.dispatchedErrors=t.dispatchedErrors||[],t}var i=function(){function n(t){var e=this;if(function(t,e){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],t){var r=void 0,o=void 0,i=!1,a=!1,u=!1;try{t(function(n){u?e.resolve(n):(i=!0,r=n)},function(n){u?e.reject(n):(a=!0,o=n)})}catch(n){return void this.reject(n)}u=!0,i?this.resolve(r):a&&this.reject(o)}}return n.prototype.resolve=function(n){if(this.resolved||this.rejected)return this;if(r(n))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=n,this.dispatch(),this},n.prototype.reject=function(n){var t=this;if(this.resolved||this.rejected)return this;if(r(n))throw new Error("Can not reject promise with another promise");if(!n){var e=n&&"function"==typeof n.toString?n.toString():Object.prototype.toString.call(n);n=new Error("Expected reject to be called with Error, got "+e)}return this.rejected=!0,this.error=n,this.errorHandled||setTimeout(function(){t.errorHandled||function(n,t){if(-1===o().dispatchedErrors.indexOf(n)){o().dispatchedErrors.push(n),setTimeout(function(){throw n},1);for(var e=0;e<o().possiblyUnhandledPromiseHandlers.length;e++)o().possiblyUnhandledPromiseHandlers[e](n,t)}}(n,t)},1),this.dispatch(),this},n.prototype.asyncReject=function(n){return this.errorHandled=!0,this.reject(n),this},n.prototype.dispatch=function(){var t=this,e=this.dispatching,i=this.resolved,a=this.rejected,u=this.handlers;if(!e&&(i||a)){this.dispatching=!0,o().activeCount+=1;for(var c=function(e){var o=u[e],c=o.onSuccess,s=o.onError,f=o.promise,d=void 0;if(i)try{d=c?c(t.value):t.value}catch(n){return f.reject(n),"continue"}else if(a){if(!s)return f.reject(t.error),"continue";try{d=s(t.error)}catch(n){return f.reject(n),"continue"}}d instanceof n&&(d.resolved||d.rejected)?(d.resolved?f.resolve(d.value):f.reject(d.error),d.errorHandled=!0):r(d)?d instanceof n&&(d.resolved||d.rejected)?d.resolved?f.resolve(d.value):f.reject(d.error):d.then(function(n){f.resolve(n)},function(n){f.reject(n)}):f.resolve(d)},s=0;s<u.length;s++)c(s);u.length=0,this.dispatching=!1,o().activeCount-=1,0===o().activeCount&&n.flushQueue()}},n.prototype.then=function(t,e){if(t&&"function"!=typeof t&&!t.call)throw new Error("Promise.then expected a function for success handler");if(e&&"function"!=typeof e&&!e.call)throw new Error("Promise.then expected a function for error handler");var r=new n;return this.handlers.push({promise:r,onSuccess:t,onError:e}),this.errorHandled=!0,this.dispatch(),r},n.prototype.catch=function(n){return this.then(void 0,n)},n.prototype.finally=function(t){if(t&&"function"!=typeof t&&!t.call)throw new Error("Promise.finally expected a function");return this.then(function(e){return n.try(t).then(function(){return e})},function(e){return n.try(t).then(function(){throw e})})},n.prototype.timeout=function(n,t){var e=this;if(this.resolved||this.rejected)return this;var r=setTimeout(function(){e.resolved||e.rejected||e.reject(t||new Error("Promise timed out after "+n+"ms"))},n);return this.then(function(n){return clearTimeout(r),n})},n.prototype.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.resolve=function(t){return t instanceof n?t:r(t)?new n(function(n,e){return t.then(n,e)}):(new n).resolve(t)},n.reject=function(t){return(new n).reject(t)},n.asyncReject=function(t){return(new n).asyncReject(t)},n.all=function(t){var e=new n,o=t.length,i=[];if(!o)return e.resolve(i),e;for(var a=function(a){var u=t[a];if(u instanceof n){if(u.resolved)return i[a]=u.value,o-=1,"continue"}else if(!r(u))return i[a]=u,o-=1,"continue";n.resolve(u).then(function(n){i[a]=n,0==(o-=1)&&e.resolve(i)},function(n){e.reject(n)})},u=0;u<t.length;u++)a(u);return 0===o&&e.resolve(i),e},n.hash=function(t){var e={};return n.all(Object.keys(t).map(function(r){return n.resolve(t[r]).then(function(n){e[r]=n})})).then(function(){return e})},n.map=function(t,e){return n.all(t.map(e))},n.onPossiblyUnhandledException=function(n){return function(n){return o().possiblyUnhandledPromiseHandlers.push(n),{cancel:function(){o().possiblyUnhandledPromiseHandlers.splice(o().possiblyUnhandledPromiseHandlers.indexOf(n),1)}}}(n)},n.try=function(t,e,r){if(t&&"function"!=typeof t&&!t.call)throw new Error("Promise.try expected a function");var o=void 0;try{o=t.apply(e,r||[])}catch(t){return n.reject(t)}return n.resolve(o)},n.delay=function(t){return new n(function(n){setTimeout(n,t)})},n.isPromise=function(t){return!!(t&&t instanceof n)||r(t)},n.flush=function(){var t=new n;return o().flushPromises.push(t),0===o().activeCount&&n.flushQueue(),t},n.flushQueue=function(){var n=o().flushPromises;o().flushPromises=[];for(var t=0,e=null==n?0:n.length;t<e;t++)n[t].resolve()},n}();e.d(t,"a",function(){return i})},function(n,t,e){"use strict";e(6);var r=e(7);e.d(t,"addEventListener",function(){return r.a}),e(12),e(13),e(8);var o=e(3);e.d(t,"getOrSet",function(){return o.d}),e.d(t,"isRegex",function(){return o.f}),e.d(t,"memoizePromise",function(){return o.h}),e.d(t,"noop",function(){return o.i}),e.d(t,"once",function(){return o.j}),e.d(t,"safeInterval",function(){return o.m}),e.d(t,"stringifyError",function(){return o.o}),e.d(t,"uniqueID",function(){return o.q}),e.d(t,"weakMapMemoizePromise",function(){return o.r}),e(14);var i=e(15);e.n(i),e(16),e(17),e(18)},function(n,t,e){"use strict";t.q=a,t.c=function(){if("undefined"!=typeof window)return window;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("No global found")},t.g=function(n){var t=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new o.a;function i(){for(var t=arguments.length,o=Array(t),i=0;i<t;i++)o[i]=arguments[i];var a=r.getOrSet(e.thisNamespace?this:n,function(){return{}}),u=c(o),s=e.time;if(a[u]&&s&&Date.now()-a[u].time<s&&delete a[u],a[u])return a[u].value;var f=Date.now(),d=n.apply(this,arguments);return a[u]={time:f,value:d},a[u].value}return i.reset=function(){r.delete(e.thisNamespace?t:n)},e.name&&(i.displayName=e.name+":memoized"),i},t.h=function(n){var t={};function e(){for(var e=arguments.length,r=Array(e),o=0;o<e;o++)r[o]=arguments[o];var i=c(r);return t.hasOwnProperty(i)?t[i]:(t[i]=n.apply(this,arguments).finally(function(){delete t[i]}),t[i])}return e.reset=function(){t={}},e},t.k=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};function e(){return r.a.try(n,this,arguments)}return t.name&&(e.displayName=t.name+":promisified"),e},t.e=function(n,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=n.__inline_memoize_cache__=n.__inline_memoize_cache__||{},o=c(e);return r.hasOwnProperty(o)?r[o]:r[o]=t.apply(void 0,e)},t.i=function(){},t.j=function(n){var t=!1;return function(){if(!t)return t=!0,n.apply(this,arguments)}},t.o=function n(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e>=3)return"stringifyError stack overflow";try{if(!t)return"<unknown error: "+Object.prototype.toString.call(t)+">";if("string"==typeof t)return t;if(t instanceof Error){var r=t&&t.stack,o=t&&t.message;if(r&&o)return-1!==r.indexOf(o)?r:o+"\n"+r;if(r)return r;if(o)return o}return"function"==typeof t.toString?t.toString():Object.prototype.toString.call(t)}catch(t){return"Error while stringifying error: "+n(t,e+1)}},t.n=function(n){return"string"==typeof n?n:n&&"function"==typeof n.toString?n.toString():Object.prototype.toString.call(n)},t.b=function(n,t){if(!t)return n;if(Object.assign)return Object.assign(n,t);for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n},t.m=function(n,t){var e=void 0;return function r(){e=setTimeout(function(){n(),r()},t)}(),{cancel:function(){clearTimeout(e)}}},t.a=function(n){return n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()},t.f=function(n){return"[object RegExp]"===Object.prototype.toString.call(n)},e.d(t,"r",function(){return s}),t.d=function(n,t,e){if(n.hasOwnProperty(t))return n[t];var r=e();return n[t]=r,r},t.p=function(n){var t=void 0,e=void 0;try{t=n()}catch(n){e=n}return{result:t,error:e}},t.l=function(n,t){var e=n.indexOf(t);-1!==e&&n.splice(e,1)};var r=e(1),o=e(4),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function a(){var n="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,function(){return n.charAt(Math.floor(Math.random()*n.length))})+"_"+function(n){if("function"==typeof btoa)return btoa(n);if("undefined"!=typeof Buffer)return Buffer.from(n,"utf8").toString("base64");throw new Error("Can not find window.btoa or Buffer")}((new Date).toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var u=void 0;function c(n){try{return JSON.stringify(Array.prototype.slice.call(n),function(n,t){return"function"==typeof t?"memoize["+function(n){if(u=u||new o.a,null===n||void 0===n||"object"!==(void 0===n?"undefined":i(n))&&"function"!=typeof n)throw new Error("Invalid object");var t=u.get(n);return t||(t=(void 0===n?"undefined":i(n))+":"+a(),u.set(n,t)),t}(t)+"]":t})}catch(n){throw new Error("Arguments not serializable -- can not be used to memoize")}}var s=function(n){var t=new o.a;return function(e){var r=this;return t.getOrSet(e,function(){return n.call(r,e).finally(function(){t.delete(e)})})}}},function(n,t,e){"use strict";e.d({},"WeakMap",function(){return u});var r=e(0);function o(n,t){for(var e=0;e<n.length;e++)try{if(n[e]===t)return e}catch(n){}return-1}var i=Object.defineProperty,a=Date.now()%1e9,u=function(){function n(){if(function(t,e){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this),a+=1,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__"+a,function(){if("undefined"==typeof WeakMap)return!1;if(void 0===Object.freeze)return!1;try{var n=new WeakMap,t={};return Object.freeze(t),n.set(t,"__testvalue__"),"__testvalue__"===n.get(t)}catch(n){return!1}}())try{this.weakmap=new WeakMap}catch(n){}this.keys=[],this.values=[]}return n.prototype._cleanupClosedWindows=function(){for(var n=this.weakmap,t=this.keys,e=0;e<t.length;e++){var o=t[e];if(Object(r.isWindow)(o)&&Object(r.isWindowClosed)(o)){if(n)try{n.delete(o)}catch(n){}t.splice(e,1),this.values.splice(e,1),e-=1}}},n.prototype.isSafeToReadWrite=function(n){if(Object(r.isWindow)(n))return!1;try{n&&n.self,n&&n[this.name]}catch(n){return!1}return!0},n.prototype.set=function(n,t){if(!n)throw new Error("WeakMap expected key");var e=this.weakmap;if(e)try{e.set(n,t)}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n)){var r=this.name,a=n[r];a&&a[0]===n?a[1]=t:i(n,r,{value:[n,t],writable:!0})}else{this._cleanupClosedWindows();var u=this.keys,c=this.values,s=o(u,n);-1===s?(u.push(n),c.push(t)):c[s]=t}},n.prototype.get=function(n){if(!n)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{if(t.has(n))return t.get(n)}catch(n){delete this.weakmap}if(!this.isSafeToReadWrite(n)){this._cleanupClosedWindows();var e=o(this.keys,n);if(-1===e)return;return this.values[e]}var r=n[this.name];if(r&&r[0]===n)return r[1]},n.prototype.delete=function(n){if(!n)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{t.delete(n)}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n)){var e=n[this.name];e&&e[0]===n&&(e[0]=e[1]=void 0)}else{this._cleanupClosedWindows();var r=this.keys,i=o(r,n);-1!==i&&(r.splice(i,1),this.values.splice(i,1))}},n.prototype.has=function(n){if(!n)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{if(t.has(n))return!0}catch(n){delete this.weakmap}if(this.isSafeToReadWrite(n)){var e=n[this.name];return!(!e||e[0]!==n)}return this._cleanupClosedWindows(),-1!==o(this.keys,n)},n.prototype.getOrSet=function(n,t){if(this.has(n))return this.get(n);var e=t();return this.set(n,e),e},n}();e.d(t,"a",function(){return u})},function(n,t,e){"use strict";e.d(t,"a",function(){return r}),e.d(t,"b",function(){return o}),e.d(t,"c",function(){return i});var r={MOCK:"mock:",FILE:"file:",ABOUT:"about:"},o="*",i={IFRAME:"iframe",POPUP:"popup"}},function(n,t,e){"use strict";t.a=function(){return!!(window.navigator.mockUserAgent||window.navigator.userAgent).match(/Android|webOS|iPhone|iPad|iPod|bada|Symbian|Palm|CriOS|BlackBerry|IEMobile|WindowsMobile|Opera Mini/i)}},function(n,t,e){"use strict";e(1),e(0),e(4);var r=e(3);e(6),t.b=function n(){return Object(r.e)(n,function(){try{if("undefined"==typeof window)return!1;if(window.localStorage){var n=Math.random().toString();window.localStorage.setItem("__test__localStorage__",n);var t=window.localStorage.getItem("__test__localStorage__");if(window.localStorage.removeItem("__test__localStorage__"),n===t)return!0}}catch(n){}return!1})},t.a=function(n,t,e){return n.addEventListener(t,e),{cancel:function(){n.removeEventListener(t,e)}}},"function"==typeof Symbol&&Symbol.iterator,Object.assign,Object.create(Error.prototype)},function(n,t,e){"use strict";t.a=function n(t){var e=t.name,i=t.version,a=void 0===i?"latest":i,u=t.lifetime,c=void 0===u?3e5:u;return Object(r.e)(n,function(){var n="__"+e+"_"+a+"_storage__",t=void 0;function i(e){var i=Object(o.b)(),a=void 0;if(t&&(a=t),!a&&i){var u=window.localStorage.getItem(n);u&&(a=JSON.parse(u))}a||(a=Object(r.c)()[n]),a||(a={id:Object(r.q)()}),a.id||(a.id=Object(r.q)()),t=a;var c=e(a);return i?window.localStorage.setItem(n,JSON.stringify(a)):Object(r.c)()[n]=a,t=null,c}function u(n){return i(function(t){var e=t.__session__,o=Date.now();return e&&o-e.created>c&&(e=null),e||(e={guid:Object(r.q)(),created:o}),t.__session__=e,n(e)})}return{getState:i,getID:function(){return i(function(n){return n.id})},getSessionState:function(n){return u(function(t){return t.state=t.state||{},n(t.state)})},getSessionID:function(){return u(function(n){return n.guid})}}},[{name:e,version:a,lifetime:c}])};var r=e(3),o=e(7)},function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={};e.d(r,"markWindowKnown",function(){return j}),e.d(r,"serializeMessage",function(){return Q}),e.d(r,"deserializeMessage",function(){return X}),e.d(r,"ProxyWindow",function(){return F}),e.d(r,"cleanUpWindow",function(){return In}),e.d(r,"Promise",function(){return a.a}),e.d(r,"bridge",function(){return Pn}),e.d(r,"parent",function(){return Dn}),e.d(r,"send",function(){return yn}),e.d(r,"requestPromises",function(){return mn}),e.d(r,"request",function(){return vn}),e.d(r,"sendToParent",function(){return gn}),e.d(r,"client",function(){return On}),e.d(r,"on",function(){return _n}),e.d(r,"listen",function(){return bn}),e.d(r,"once",function(){return Wn}),e.d(r,"listener",function(){return Sn}),e.d(r,"CONFIG",function(){return w}),e.d(r,"disable",function(){return jn});var o,i=e(0),a=e(1),u=e(2),c={REQUEST:"postrobot_message_request",RESPONSE:"postrobot_message_response",ACK:"postrobot_message_ack"},s={METHOD:"postrobot_method",HELLO:"postrobot_hello",OPEN_TUNNEL:"postrobot_open_tunnel"},f={POSTROBOT:"__postRobot__"},d="*",l={CROSS_DOMAIN_ZALGO_PROMISE:"cross_domain_zalgo_promise",CROSS_DOMAIN_FUNCTION:"cross_domain_function",CROSS_DOMAIN_WINDOW:"cross_domain_window"},w={BRIDGE_TIMEOUT:5e3,CHILD_WINDOW_TIMEOUT:5e3,ACK_TIMEOUT:2e3,ACK_TIMEOUT_KNOWN:1e4,RES_TIMEOUT:-1,ALLOWED_POST_MESSAGE_METHODS:(o={},o.postrobot_post_message=!0,o.postrobot_bridge=!0,o.postrobot_global=!0,o)},h=e(4),p=window[f.POSTROBOT]=window[f.POSTROBOT]||{},m=p.windowStore=p.windowStore||new h.a,v=function(){return{}};function y(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;function e(n){return m.getOrSet(n,t)}return{has:function(t){return e(t).hasOwnProperty(n)},get:function(t,r){var o=e(t);return o.hasOwnProperty(n)?o[n]:r},set:function(t,r){return e(t)[n]=r,r},del:function(t){delete e(t)[n]},getOrSet:function(t,r){var o=e(t);if(o.hasOwnProperty(n))return o[n];var i=r();return o[n]=i,i}}}function g(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v,e=Object(u.getOrSet)(p,n,t);return{has:function(n){return e.hasOwnProperty(n)},get:function(n,t){return e.hasOwnProperty(n)?e[n]:t},set:function(n,t){return e[n]=t,t},del:function(n){delete e[n]},getOrSet:function(n,t){if(e.hasOwnProperty(n))return e[n];var r=t();return e[n]=r,r},reset:function(){e=t()},keys:function(){return Object.keys(e)}}}p.instanceID=p.instanceID||Object(u.uniqueID)();var O=y("helloPromises");function E(n){return O.getOrSet(n,function(){return new a.a})}var b=Object(u.once)(function(){p.on(s.HELLO,{domain:d},function(n){var t=n.source,e=n.origin;return E(t).resolve({win:t,domain:e}),{instanceID:p.instanceID}})});function _(n){return p.send(n,s.HELLO,{instanceID:p.instanceID},{domain:d,timeout:-1}).then(function(t){var e=t.origin,r=t.data.instanceID;return E(n).resolve({win:n,domain:e}),{win:n,domain:e,instanceID:r}})}var W=Object(u.weakMapMemoizePromise)(function(n){return _(n).then(function(n){return n.instanceID})}),S=y("knownWindows");function j(n){S.set(n,!0)}var D,I={FUNCTION:"function",ERROR:"error",PROMISE:"promise",REGEX:"regex",DATE:"date",ARRAY:"array",OBJECT:"object",STRING:"string",NUMBER:"number",BOOLEAN:"boolean",NULL:"null",UNDEFINED:"undefined"},P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function T(n){return"object"===(void 0===n?"undefined":P(n))&&null!==n&&"string"==typeof n.__type__}function A(n){return void 0===n?I.UNDEFINED:null===n?I.NULL:Array.isArray(n)?I.ARRAY:"function"==typeof n?I.FUNCTION:"object"===(void 0===n?"undefined":P(n))?n instanceof Error?I.ERROR:"function"==typeof n.then?I.PROMISE:"[object RegExp]"===Object.prototype.toString.call(n)?I.REGEX:"[object Date]"===Object.prototype.toString.call(n)?I.DATE:I.OBJECT:"string"==typeof n?I.STRING:"number"==typeof n?I.NUMBER:"boolean"==typeof n?I.BOOLEAN:void 0}function N(n,t){return{__type__:n,__val__:t}}var R,C=((D={})[I.FUNCTION]=function(){},D[I.ERROR]=function(n){var t=n.message,e=n.stack,r=n.code;return N(I.ERROR,{message:t,stack:e,code:r})},D[I.PROMISE]=function(){},D[I.REGEX]=function(n){return N(I.REGEX,n.source)},D[I.DATE]=function(n){return N(I.DATE,n.toJSON())},D[I.ARRAY]=function(n){return n},D[I.OBJECT]=function(n){return n},D[I.STRING]=function(n){return n},D[I.NUMBER]=function(n){return n},D[I.BOOLEAN]=function(n){return n},D[I.NULL]=function(n){return n},D),x={},M=((R={})[I.FUNCTION]=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},R[I.ERROR]=function(n){var t=n.message,e=n.stack,r=n.code,o=new Error(t);return o.code=r,o.stack=e+"\n\n"+o.stack,o},R[I.PROMISE]=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},R[I.REGEX]=function(n){return new RegExp(n)},R[I.DATE]=function(n){return new Date(n)},R[I.ARRAY]=function(n){return n},R[I.OBJECT]=function(n){return n},R[I.STRING]=function(n){return n},R[I.NUMBER]=function(n){return n},R[I.BOOLEAN]=function(n){return n},R[I.NULL]=function(n){return n},R),k={},U=y("winToProxyWindow"),L=g("idToProxyWindow");function z(){for(var n=0,t=L.keys(),e=null==t?0:t.length;n<e;n++){var r=t[n];L.get(r).shouldClean()&&L.del(r)}}var F=function(){function n(t,e){!function(t,e){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.isProxyWindow=!0,this.serializedWindow=t,this.actualWindowPromise=new a.a,e&&this.setWindow(e),this.serializedWindow.getInstanceID=Object(u.memoizePromise)(this.serializedWindow.getInstanceID)}return n.prototype.getType=function(){return this.serializedWindow.type},n.prototype.isPopup=function(){return this.getType()===i.WINDOW_TYPE.POPUP},n.prototype.isIframe=function(){return this.getType()===i.WINDOW_TYPE.IFRAME},n.prototype.setLocation=function(n){var t=this;return a.a.try(function(){if(!t.actualWindow)return t.serializedWindow.setLocation(n);t.actualWindow.location=n}).then(function(){return t})},n.prototype.setName=function(n){var t=this;return a.a.try(function(){if(!t.actualWindow)return t.serializedWindow.setName(n);if(!Object(i.isSameDomain)(t.actualWindow))throw new Error("Can not set name for window on different domain");t.actualWindow.name=n,t.actualWindow.frameElement&&t.actualWindow.frameElement.setAttribute("name",n)}).then(function(){return t})},n.prototype.close=function(){var n=this;return a.a.try(function(){if(!n.actualWindow)return n.serializedWindow.close();n.actualWindow.close()}).then(function(){return n})},n.prototype.focus=function(){var n=this;return a.a.try(function(){return n.actualWindow&&n.actualWindow.focus(),n.serializedWindow.focus()}).then(function(){return n})},n.prototype.isClosed=function(){var n=this;return a.a.try(function(){return n.actualWindow?Object(i.isWindowClosed)(n.actualWindow):n.serializedWindow.isClosed()})},n.prototype.setWindow=function(n){this.actualWindow=n,this.actualWindowPromise.resolve(n)},n.prototype.matchWindow=function(n){var t=this;return a.a.try(function(){return t.actualWindow?n===t.actualWindow:a.a.all([t.getInstanceID(),W(n)]).then(function(e){var r=e[0]===e[1];return r&&t.setWindow(n),r})})},n.prototype.unwrap=function(){return this.actualWindow||this},n.prototype.awaitWindow=function(){return this.actualWindowPromise},n.prototype.getInstanceID=function(){return this.actualWindow?W(this.actualWindow):this.serializedWindow.getInstanceID()},n.prototype.serialize=function(){return this.serializedWindow},n.prototype.shouldClean=function(){return this.actualWindow&&Object(i.isWindowClosed)(this.actualWindow)},n.unwrap=function(t){return n.isProxyWindow(t)?t.unwrap():t},n.serialize=function(t){return z(),n.toProxyWindow(t).serialize()},n.deserialize=function(t){return z(),L.getOrSet(t.id,function(){return new n(t)})},n.isProxyWindow=function(n){return Boolean(n&&!Object(i.isWindow)(n)&&n.isProxyWindow)},n.toProxyWindow=function(t){return z(),n.isProxyWindow(t)?t:U.getOrSet(t,function(){var e=Object(u.uniqueID)();return L.set(e,new n({id:e,type:Object(i.getOpener)(t)?i.WINDOW_TYPE.POPUP:i.WINDOW_TYPE.IFRAME,getInstanceID:function(){return W(t)},close:function(){return a.a.try(function(){t.close()})},focus:function(){return a.a.try(function(){t.focus()})},isClosed:function(){return a.a.try(function(){return Object(i.isWindowClosed)(t)})},setLocation:function(n){return a.a.try(function(){if(Object(i.isSameDomain)(t))try{if(t.location&&"function"==typeof t.location.replace)return void t.location.replace(n)}catch(n){}t.location=n})},setName:function(n){return a.a.try(function(){t.name=n})}},t))})},n}(),B=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},H=y("methodStore"),q=g("proxyWindowMethods");function G(n,t,e,r,o){F.isProxyWindow(r)?q.set(n,{val:t,name:e,domain:o,source:r}):(q.del(n),H.getOrSet(r,function(){return{}})[n]={domain:o,name:e,val:t,source:r})}function J(n,t){return H.getOrSet(n,function(){return{}})[t]||q.get(t)}p.listeningForFunctions=p.listeningForFunctions||!1;var K=Object(u.once)(function(){p.listeningForFunctions||(p.listeningForFunctions=!0,p.on(s.METHOD,{origin:d},function(n){var t=n.source,e=n.origin,r=n.data,o=r.id,c=r.name;return a.a.try(function(){var n=J(t,o);if(!n)throw new Error("Could not find method '"+r.name+"' with id: "+r.id+" in "+Object(i.getDomain)(window));var s=n.source,f=n.domain,d=n.val;return a.a.try(function(){if(!Object(i.matchDomain)(f,e))throw new Error("Method '"+r.name+"' domain "+JSON.stringify(Object(u.isRegex)(n.domain)?n.domain.source:n.domain)+" does not match origin "+e+" in "+Object(i.getDomain)(window));if(F.isProxyWindow(s))return s.matchWindow(t).then(function(n){if(!n)throw new Error("Method call '"+r.name+"' failed - proxy window does not match source in "+Object(i.getDomain)(window))})}).then(function(){return d.apply({source:t,origin:e},r.args)},function(n){return a.a.try(function(){if(d.onError)return d.onError(n)}).then(function(){throw n})}).then(function(n){return{result:n,id:o,name:c}})})}))});function Y(n,t,e,r){K();var o=e.__id__||Object(u.uniqueID)();n=F.unwrap(n);var i=e.__name__||e.name||r;return F.isProxyWindow(n)?(G(o,e,i,n,t),n.awaitWindow().then(function(n){G(o,e,i,n,t)})):G(o,e,i,n,t),N(l.CROSS_DOMAIN_FUNCTION,{id:o,name:i})}function Q(n,t,e){var r;return function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:x,e=JSON.stringify(n,function(n){var e=this[n];if(T(this))return e;var r=A(e);if(!r)return e;var o=t[r]||C[r];return o?o(e,n):e});return void 0===e?I.UNDEFINED:e}(e,((r={})[I.PROMISE]=function(e,r){return function(n,t,e,r){return N(l.CROSS_DOMAIN_ZALGO_PROMISE,{then:Y(n,t,function(n,t){return e.then(n,t)},r)})}(n,t,e,r)},r[I.FUNCTION]=function(e,r){return Y(n,t,e,r)},r[I.OBJECT]=function(n){return Object(i.isWindow)(n)||F.isProxyWindow(n)?(t=n,N(l.CROSS_DOMAIN_WINDOW,F.serialize(t))):n;var t},r))}function X(n,t,e){var r;return function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k;if(n!==I.UNDEFINED)return JSON.parse(n,function(n,e){if(T(this))return e;var r=void 0,o=void 0;if(T(e)?(r=e.__type__,o=e.__val__):(r=A(e),o=e),!r)return o;var i=t[r]||M[r];return i?i(o,n):o})}(e,((r={})[l.CROSS_DOMAIN_ZALGO_PROMISE]=function(n){return t=n.then,new a.a(t);var t},r[l.CROSS_DOMAIN_FUNCTION]=function(e){return function(n,t,e){var r=e.id,o=e.name,a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};function a(){var u=arguments;return F.toProxyWindow(n).awaitWindow().then(function(n){var c=J(n,r);return c&&c.val!==a?c.val.apply({source:window,origin:Object(i.getDomain)()},u):p.send(n,s.METHOD,{id:r,name:o,args:Array.prototype.slice.call(u)},B({domain:t},e)).then(function(n){return n.data.result})}).catch(function(n){throw n})}return a.__name__=o,a.__origin__=t,a.__source__=n,a.__id__=r,a.origin=t,a},u=a();return u.fireAndForget=a({fireAndForget:!0}),u}(n,t,e)},r[l.CROSS_DOMAIN_WINDOW]=function(n){return t=n,F.deserialize(t);var t},r))}var Z={postrobot_post_message:function(n,t,e){(Array.isArray(e)?e:"string"==typeof e?[e]:[d]).map(function(t){if(0===t.indexOf("mock:")){if("file:"===window.location.protocol)return d;if(!Object(i.isActuallySameDomain)(n))throw new Error("Attempting to send messsage to mock domain "+t+", but window is actually cross-domain");return Object(i.getActualDomain)(n)}return 0===t.indexOf("file:")?d:t}).forEach(function(e){return n.postMessage(t,e)})}},V=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n};function $(n,t,e){return a.a.try(function(){var r;if(Object(i.isWindowClosed)(n))throw new Error("Window is closed");var o=Q(n,t,((r={})[f.POSTROBOT]=V({id:Object(u.uniqueID)()},e),r)),c=[];return a.a.map(Object.keys(Z),function(e){return a.a.try(function(){if(!w.ALLOWED_POST_MESSAGE_METHODS[e])throw new Error("Strategy disallowed: "+e);return Z[e](n,o,t)}).then(function(){return c.push(e+": success"),!0},function(n){return c.push(e+": "+Object(u.stringifyError)(n)+"\n"),!1})}).then(function(n){var t=n.some(Boolean),r=e.type+" "+e.name+" "+(t?"success":"error")+":\n - "+c.join("\n - ")+"\n";if(!t)throw new Error(r)})})}var nn=g("responseListeners"),tn=y("requestListeners"),en=g("erroredResponseListeners");p.WINDOW_WILDCARD=p.WINDOW_WILDCARD||new function(){};var rn,on="__domain_regex__";function an(n){return nn.get(n)}function un(n){nn.del(n)}function cn(n){return en.has(n)}function sn(n){var t=n.name,e=n.win,r=n.domain;if(e===d&&(e=null),r===d&&(r=null),!t)throw new Error("Name required to get request listener");for(var o=0,a=[e,p.WINDOW_WILDCARD],u=null==a?0:a.length;o<u;o++){var c=a[o];if(c){var s=tn.get(c);if(s){var f=s[t];if(f){if(r&&"string"==typeof r){if(f[r])return f[r];if(f[on])for(var l=0,w=f[on],h=null==w?0:w.length;l<h;l++){var m=w[l],v=m.regex,y=m.listener;if(Object(i.matchDomain)(v,r))return y}}if(f[d])return f[d]}}}}}var fn=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},dn=((rn={})[c.REQUEST]=function(n,t,e){var r=sn({name:e.name,win:n,domain:t});function o(r,o){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.fireAndForget||Object(i.isWindowClosed)(n)?a.a.resolve():$(n,t,fn({type:r,ack:o,hash:e.hash,name:e.name},u))}return e.name===s.METHOD&&e.data&&"string"==typeof e.data.name?e.data.name:e.name,a.a.all([o(c.ACK),a.a.try(function(){if(!r)throw new Error("No handler found for post message: "+e.name+" from "+t+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(r.domain,t))throw new Error("Request origin "+t+" does not match domain "+r.domain.toString());var o=e.data;return r.handler({source:n,origin:t,data:o})}).then(function(n){return o(c.RESPONSE,"success",{data:n})},function(n){return o(c.RESPONSE,"error",{error:n})})]).then(u.noop).catch(function(n){if(r&&r.handleError)return r.handleError(n);throw n})},rn[c.ACK]=function(n,t,e){if(!cn(e.hash)){var r=an(e.hash);if(!r)throw new Error("No handler found for post message ack for message: "+e.name+" from "+t+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(r.domain,t))throw new Error("Ack origin "+t+" does not match domain "+r.domain.toString());r.ack=!0}},rn[c.RESPONSE]=function(n,t,e){if(!cn(e.hash)){var r=an(e.hash);if(!r)throw new Error("No handler found for post message response for message: "+e.name+" from "+t+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(r.domain,t))throw new Error("Response origin "+t+" does not match domain "+Object(i.stringifyDomainPattern)(r.domain));if(un(e.hash),"error"===e.ack)return r.respond(e.error,null);if("success"===e.ack){var o=e.data;return r.respond(null,{source:n,origin:t,data:o})}}},rn),ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},wn=g("receivedMessages");function hn(n){if(!window||window.closed)throw new Error("Message recieved in closed window");try{if(!n.source)return}catch(n){return}var t=n.source,e=n.origin,r=function(n,t,e){var r=void 0;try{r=X(t,e,n)}catch(n){return}if(r&&"object"===(void 0===r?"undefined":ln(r))&&null!==r&&(r=r[f.POSTROBOT])&&"object"===(void 0===r?"undefined":ln(r))&&null!==r&&r.type&&"string"==typeof r.type&&dn[r.type])return r}(n.data,t,e);r&&(j(t),wn.has(r.id)||(wn.set(r.id,!0),Object(i.isWindowClosed)(t)&&!r.fireAndForget||dn[r.type](t,e,r)))}function pn(n){try{Object(u.noop)(n.source)}catch(n){return}var t={source:n.source||n.sourceElement,origin:n.origin||n.originalEvent&&n.originalEvent.origin,data:n.data};if(t.source){if(!t.origin)throw new Error("Post message did not have origin domain");hn(t)}}p.receiveMessage=hn;var mn=y("requestPromises");function vn(n){return a.a.try(function(){if(!n.name)throw new Error("Expected options.name");var t=n.name,e=void 0,r=void 0;if("string"==typeof n.window){var o=document.getElementById(n.window);if(!o)throw new Error("Expected options.window "+Object.prototype.toString.call(n.window)+" to be a valid element id");if("iframe"!==o.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(n.window)+" to be an iframe");if(!o.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");e=o.contentWindow}else if(n.window instanceof HTMLIFrameElement){if("iframe"!==n.window.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(n.window)+" to be an iframe");if(n.window&&!n.window.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");n.window&&n.window.contentWindow&&(e=n.window.contentWindow)}else e=n.window;if(!e)throw new Error("Expected options.window to be a window object, iframe, or iframe element id.");var f=e;r=n.domain||d;var l=n.name+"_"+Object(u.uniqueID)();if(Object(i.isWindowClosed)(f))throw new Error("Target window is closed");var h=!1,p=mn.getOrSet(f,function(){return[]}),m=a.a.try(function(){if(Object(i.isAncestor)(window,f))return function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Window",r=E(n);return-1!==t&&(r=r.timeout(t,new Error(e+" did not load after "+t+"ms"))),r}(f,n.timeout||w.CHILD_WINDOW_TIMEOUT)}).then(function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).domain;if(Object(u.isRegex)(r)&&!n)return _(f)}).then(function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).domain;if(Object(u.isRegex)(r)){if(!Object(i.matchDomain)(r,e))throw new Error("Remote window domain "+e+" does not match regex: "+r.toString());r=e}if("string"!=typeof r&&!Array.isArray(r))throw new TypeError("Expected domain to be a string or array");var o=r;return t===s.METHOD&&n.data&&"string"==typeof n.data.name&&n.data.name,new a.a(function(e,r){var a=void 0;if(n.fireAndForget||function(n,t){nn.set(n,t)}(l,a={name:t,window:f,domain:o,respond:function(n,t){n||(h=!0,p.splice(p.indexOf(m,1))),n?r(n):e(t)}}),$(f,o,{type:c.REQUEST,hash:l,name:t,data:n.data,fireAndForget:Boolean(n.fireAndForget)}).catch(r),n.fireAndForget)return e();var u=function(n){return S.get(n,!1)}(f)?w.ACK_TIMEOUT_KNOWN:w.ACK_TIMEOUT,s=n.timeout||w.RES_TIMEOUT,d=u,v=s,y=100;setTimeout(function n(){if(!h){if(Object(i.isWindowClosed)(f))return a.ack?r(new Error("Window closed for "+t+" before response")):r(new Error("Window closed for "+t+" before ack"));if(d=Math.max(d-y,0),-1!==v&&(v=Math.max(v-y,0)),a.ack){if(-1===v)return;y=Math.min(v,2e3)}else{if(0===d)return r(new Error("No ack for postMessage "+t+" in "+Object(i.getDomain)()+" in "+u+"ms"));if(0===v)return r(new Error("No response for postMessage "+t+" in "+Object(i.getDomain)()+" in "+s+"ms"))}setTimeout(n,y)}},y)})});return m.catch(function(){!function(n){en.set(n,!0)}(l),un(l)}),p.push(m),m})}function yn(n,t,e,r){return(r=r||{}).window=n,r.name=t,r.data=e,vn(r)}function gn(n,t,e){var r=Object(i.getAncestor)();return r?yn(r,n,t,e):new a.a(function(n,t){return t(new Error("Window does not have a parent"))})}function On(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!n.window)throw new Error("Expected options.window");var t=n.window;return{send:function(e,r){return yn(t,e,r,n)}}}p.send=yn;var En="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function bn(n){if(!n.name)throw new Error("Expected options.name");if(!n.handler)throw new Error("Expected options.handler");var t=n.name,e=n.window,r=n.domain,o={handler:n.handler,handleError:n.errorHandler||function(n){throw n},window:e,domain:r||d,name:t},a=function n(t,e){var r=t.name,o=t.win,i=t.domain;if(!r||"string"!=typeof r)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var a=[],c=0,s=o,f=null==s?0:s.length;c<f;c++){var l=s[c];a.push(n({name:r,domain:i,win:l},e))}return{cancel:function(){for(var n=0,t=null==a?0:a.length;n<t;n++)a[n].cancel()}}}if(Array.isArray(i)){for(var w=[],h=0,m=i,v=null==m?0:m.length;h<v;h++){var y=m[h];w.push(n({name:r,win:o,domain:y},e))}return{cancel:function(){for(var n=0,t=null==w?0:w.length;n<t;n++)w[n].cancel()}}}var g=sn({name:r,win:o,domain:i});if(o&&o!==d||(o=p.WINDOW_WILDCARD),i=i||d,g)throw o&&i?new Error("Request listener already exists for "+r+" on domain "+i.toString()+" for "+(o===p.WINDOW_WILDCARD?"wildcard":"specified")+" window"):o?new Error("Request listener already exists for "+r+" for "+(o===p.WINDOW_WILDCARD?"wildcard":"specified")+" window"):i?new Error("Request listener already exists for "+r+" on domain "+i.toString()):new Error("Request listener already exists for "+r);var O=tn.getOrSet(o,function(){return{}}),E=Object(u.getOrSet)(O,r,function(){return{}}),b=i.toString(),_=void 0,W=void 0;return Object(u.isRegex)(i)?(_=Object(u.getOrSet)(E,on,function(){return[]}),W={regex:i,listener:e},_.push(W)):E[b]=e,{cancel:function(){delete E[b],W&&(_.splice(_.indexOf(W,1)),_.length||delete E[on]),Object.keys(E).length||delete O[r],o&&!Object.keys(O).length&&tn.del(o)}}}({name:t,win:e,domain:r},o);if(n.once){var c=o.handler;o.handler=Object(u.once)(function(){return a.cancel(),c.apply(this,arguments)})}if(o.window&&n.errorOnClose)var s=Object(u.safeInterval)(function(){e&&"object"===(void 0===e?"undefined":En(e))&&Object(i.isWindowClosed)(e)&&(s.cancel(),o.handleError(new Error("Post message target window is closed")))},50);return{cancel:function(){a.cancel()}}}function _n(n,t,e){return"function"==typeof t&&(e=t,t={}),(t=t||{}).name=n,t.handler=e||t.handler,bn(t)}function Wn(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments[2];"function"==typeof t&&(e=t,t={}),t=t||{},e=e||t.handler;var r=t.errorHandler,o=new a.a(function(o,i){(t=t||{}).name=n,t.once=!0,t.handler=function(n){if(o(n),e)return e(n)},t.errorHandler=function(n){if(i(n),r)return r(n)}}),i=bn(t);return o.cancel=i.cancel,o}function Sn(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{on:function(t,e){return _n(t,n,e)}}}function jn(){delete window[f.POSTROBOT],window.removeEventListener("message",pn)}p.on=_n;var Dn=Object(i.getAncestor)();function In(n){for(var t=0,e=mn.get(n,[]),r=null==e?0:e.length;t<r;t++)e[t].reject(new Error("Window cleaned up before response")).catch(u.noop)}var Pn=null;p.initialized||(p.initialized=!0,Object(u.addEventListener)(window,"message",pn),Pn&&Pn.openTunnelToOpener(),function(){b();var n=Object(i.getAncestor)();n&&_(n).catch(u.noop)}()),e.d(t,"markWindowKnown",function(){return j}),e.d(t,"serializeMessage",function(){return Q}),e.d(t,"deserializeMessage",function(){return X}),e.d(t,"ProxyWindow",function(){return F}),e.d(t,"cleanUpWindow",function(){return In}),e.d(t,"Promise",function(){return a.a}),e.d(t,"bridge",function(){return Pn}),e.d(t,"parent",function(){return Dn}),e.d(t,"send",function(){return yn}),e.d(t,"requestPromises",function(){return mn}),e.d(t,"request",function(){return vn}),e.d(t,"sendToParent",function(){return gn}),e.d(t,"client",function(){return On}),e.d(t,"on",function(){return _n}),e.d(t,"listen",function(){return bn}),e.d(t,"once",function(){return Wn}),e.d(t,"listener",function(){return Sn}),e.d(t,"CONFIG",function(){return w}),e.d(t,"disable",function(){return jn}),t.default=r},function(n,t,e){"use strict";function r(n){return"[object RegExp]"===Object.prototype.toString.call(n)}var o=e(5);t.d=c,t.a=f,t.c=d,t.f=l,t.h=w,t.j=function(n){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(n===window)return!1}catch(n){return!0}try{if(!n)return!0}catch(n){return!0}try{if(n.closed)return!0}catch(n){return!n||n.message!==i}if(t&&w(n))try{if(n.mockclosed)return!0}catch(n){}try{if(!n.parent||!n.top)return!0}catch(n){}var e=function(n,t){for(var e=0;e<n.length;e++)try{if(n[e]===t)return e}catch(n){}return-1}(m,n);if(-1!==e){var r=v[e];if(r&&function(n){if(!n.contentWindow)return!0;if(!n.parentNode)return!0;var t=n.ownerDocument;return!(!t||!t.documentElement||t.documentElement.contains(n))}(r))return!0}return!1},t.k=function(n){if(function(){for(var n=0;n<m.length;n++){var t=!1;try{t=m[n].closed}catch(n){}t&&(v.splice(n,1),m.splice(n,1))}}(),n&&n.contentWindow)try{m.push(n.contentWindow),v.push(n)}catch(n){}},t.e=function(n){return(n=n||window).navigator.mockUserAgent||n.navigator.userAgent},t.b=y,t.g=function(n,t){var e=y(t);if(e)return e===n;if(t===n)return!1;if(function(n){if(n){try{if(n.top)return n.top}catch(n){}if(u(n)===n)return n;try{if(h(window,n)&&window.top)return window.top}catch(n){}try{if(h(n,window)&&window.top)return window.top}catch(n){}for(var t=0,e=function n(t){for(var e=[],r=0,o=p(t),i=null==o?0:o.length;r<i;r++){var a=o[r];e.push(a);for(var u=0,c=n(a),s=null==c?0:c.length;u<s;u++){var f=c[u];e.push(f)}}return e}(n),r=null==e?0:e.length;t<r;t++){var o=e[t];try{if(o.top)return o.top}catch(n){}if(u(o)===o)return o}}}(t)===t)return!1;for(var r=0,o=p(n),i=null==o?0:o.length;r<i;r++)if(o[r]===t)return!0;return!1},t.l=function n(t,e){if("string"==typeof t){if("string"==typeof e)return t===o.b||e===t;if(r(e))return!1;if(Array.isArray(e))return!1}return r(t)?r(e)?t.toString()===e.toString():!Array.isArray(e)&&Boolean(e.match(t)):!!Array.isArray(t)&&(Array.isArray(e)?JSON.stringify(t)===JSON.stringify(e):!r(e)&&t.some(function(t){return n(t,e)}))},t.m=function(n){return Array.isArray(n)?"("+n.join(" | ")+")":r(n)?"RegExp("+n.toString():n.toString()},t.i=function(n){try{if(n===window)return!0}catch(n){if(n&&n.message===i)return!0}try{if("[object Window]"===Object.prototype.toString.call(n))return!0}catch(n){if(n&&n.message===i)return!0}try{if(window.Window&&n instanceof window.Window)return!0}catch(n){if(n&&n.message===i)return!0}try{if(n&&n.self===n)return!0}catch(n){if(n&&n.message===i)return!0}try{if(n&&n.parent===n)return!0}catch(n){if(n&&n.message===i)return!0}try{if(n&&n.top===n)return!0}catch(n){if(n&&n.message===i)return!0}try{n&&n.__cross_domain_utils_window_check__}catch(n){return!0}return!1};var i="Call was rejected by callee.\r\n";function a(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===o.a.ABOUT}function u(n){if(n)try{if(n.parent&&n.parent!==n)return n.parent}catch(n){}}function c(n){if(n&&!u(n))try{return n.opener}catch(n){}}function s(n){try{return n&&n.location&&n.location.href,!0}catch(n){}return!1}function f(n){var t=(n=n||window).location;if(!t)throw new Error("Can not read window location");var e=t.protocol;if(!e)throw new Error("Can not read window protocol");if(e===o.a.FILE)return o.a.FILE+"//";if(e===o.a.ABOUT){var r=u(n);return r&&s(r)?f(r):o.a.ABOUT+"//"}var i=t.host;if(!i)throw new Error("Can not read window host");return e+"//"+i}function d(n){var t=f(n=n||window);return t&&n.mockDomain&&0===n.mockDomain.indexOf(o.a.MOCK)?n.mockDomain:t}function l(n){try{if(n===window)return!0}catch(n){}try{var t=Object.getOwnPropertyDescriptor(n,"location");if(t&&!1===t.enumerable)return!1}catch(n){}try{if(a(n)&&s(n))return!0}catch(n){}try{if(f(n)===f(window))return!0}catch(n){}return!1}function w(n){if(!l(n))return!1;try{if(n===window)return!0;if(a(n)&&s(n))return!0;if(d(window)===d(n))return!0}catch(n){}return!1}function h(n,t){if(!n||!t)return!1;var e=u(t);return e?e===n:-1!==function(n){var t=[];try{for(;n.parent!==n;)t.push(n.parent),n=n.parent}catch(n){}return t}(t).indexOf(n)}function p(n){var t=[],e=void 0;try{e=n.frames}catch(t){e=n}var r=void 0;try{r=e.length}catch(n){}if(0===r)return t;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=e[o]}catch(n){continue}t.push(i)}return t}for(var a=0;a<100;a++){var u=void 0;try{u=e[a]}catch(n){return t}if(!u)return t;t.push(u)}return t}var m=[],v=[];function y(n){return c(n=n||window)||u(n)||void 0}},function(n,t){},function(n,t,e){"use strict";e(3),e(8)},function(n,t,e){"use strict";e(3)},function(n,t,e){"use strict";e(1),e(0)},function(n,t){},function(n,t,e){"use strict";e(3)},function(n,t,e){"use strict"},function(n,t,e){"use strict";e(1),e(3)}])});
//# sourceMappingURL=post-robot.min.js.map
{
"name": "post-robot",
"version": "9.0.32",
"version": "9.0.33",
"description": "Simple postMessage based server.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -18,2 +18,3 @@ /* @flow */

type StoredMethod = {|
name : string,
domain : DomainMatcher,

@@ -24,5 +25,5 @@ val : Function,

function addMethod(id : string, val : Function, source : CrossDomainWindowType | ProxyWindow, domain : DomainMatcher) {
function addMethod(id : string, val : Function, name : string, source : CrossDomainWindowType | ProxyWindow, domain : DomainMatcher) {
if (ProxyWindow.isProxyWindow(source)) {
proxyWindowMethods.set(id, { val, domain, source });
proxyWindowMethods.set(id, { val, name, domain, source });
} else {

@@ -32,3 +33,3 @@ proxyWindowMethods.del(id);

let methods = methodStore.getOrSet(source, () => ({}));
methods[id] = { domain, val, source };
methods[id] = { domain, name, val, source };
}

@@ -102,63 +103,61 @@ }

destination = ProxyWindow.unwrap(destination);
let name = val.__name__ || val.name || key;
if (ProxyWindow.isProxyWindow(destination)) {
addMethod(id, val, destination, domain);
addMethod(id, val, name, destination, domain);
// $FlowFixMe
destination.awaitWindow().then(win => {
addMethod(id, val, win, domain);
addMethod(id, val, name, win, domain);
});
} else {
// $FlowFixMe
let methods = methodStore.getOrSet(destination, () => ({}));
methods[id] = { domain, val };
addMethod(id, val, name, destination, domain);
}
return serializeType(SERIALIZATION_TYPE.CROSS_DOMAIN_FUNCTION, { id, name: val.name || key });
return serializeType(SERIALIZATION_TYPE.CROSS_DOMAIN_FUNCTION, { id, name });
}
export function deserializeFunction<T>(source : CrossDomainWindowType | ProxyWindow, origin : string, { id, name } : { id : string, name : string }) : (...args : $ReadOnlyArray<mixed>) => ZalgoPromise<T> {
function deserializedFunction<X : mixed>(args : $ReadOnlyArray<mixed>, opts? : Object = {}) : ZalgoPromise<X> {
let originalStack;
if (__DEBUG__) {
originalStack = (new Error(`Original call to ${ name }():`)).stack;
const getDeserializedFunction = (opts? : Object = {}) => {
function crossDomainFunctionWrapper<X : mixed>() : ZalgoPromise<X> {
let originalStack;
if (__DEBUG__) {
originalStack = (new Error(`Original call to ${ name }():`)).stack;
}
return ProxyWindow.toProxyWindow(source).awaitWindow().then(win => {
let meth = lookupMethod(win, id);
if (meth && meth.val !== crossDomainFunctionWrapper) {
return meth.val.apply({ source: window, origin: getDomain() }, arguments);
} else {
return global.send(win, MESSAGE_NAME.METHOD, { id, name, args: Array.prototype.slice.call(arguments) }, { domain: origin, ...opts })
.then(({ data }) => data.result);
}
}).catch(err => {
// $FlowFixMe
if (__DEBUG__ && originalStack && err.stack) {
// $FlowFixMe
err.stack = `${ err.stack }\n\n${ originalStack }`;
}
throw err;
});
}
return ProxyWindow.toProxyWindow(source).awaitWindow().then(win => {
let meth = lookupMethod(win, id);
crossDomainFunctionWrapper.__name__ = name;
crossDomainFunctionWrapper.__origin__ = origin;
crossDomainFunctionWrapper.__source__ = source;
crossDomainFunctionWrapper.__id__ = id;
if (meth) {
return meth.val.call({ source: window, origin: getDomain() }, ...args);
} else {
return global.send(win, MESSAGE_NAME.METHOD, { id, name, args }, { domain: origin, ...opts })
.then(({ data }) => data.result);
}
crossDomainFunctionWrapper.origin = origin;
}).catch(err => {
// $FlowFixMe
if (__DEBUG__ && originalStack && err.stack) {
// $FlowFixMe
err.stack = `${ err.stack }\n\n${ originalStack }`;
}
throw err;
});
}
function crossDomainFunctionWrapper<X : mixed>() : ZalgoPromise<X> {
return deserializedFunction(Array.prototype.slice.call(arguments));
}
crossDomainFunctionWrapper.fireAndForget = function crossDomainFireAndForgetFunctionWrapper<X : mixed>() : ZalgoPromise<X> {
return deserializedFunction(Array.prototype.slice.call(arguments), { fireAndForget: true });
return crossDomainFunctionWrapper;
};
crossDomainFunctionWrapper.__name__ = name;
crossDomainFunctionWrapper.__origin__ = origin;
crossDomainFunctionWrapper.__source__ = source;
crossDomainFunctionWrapper.__id__ = id;
let crossDomainFunctionWrapper = getDeserializedFunction();
crossDomainFunctionWrapper.fireAndForget = getDeserializedFunction({ fireAndForget: true });
crossDomainFunctionWrapper.origin = origin;
return crossDomainFunctionWrapper;
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc