post-robot
Advanced tools
Comparing version 9.0.1 to 9.0.2
@@ -12,8 +12,7 @@ var _ALLOWED_POST_MESSAGE; | ||
ACK_TIMEOUT: window.navigator.userAgent.match(/MSIE/i) !== -1 && !__TEST__ ? 2000 : 1000, | ||
ACK_TIMEOUT: 2000, | ||
ACK_TIMEOUT_KNOWN: 10000, | ||
RES_TIMEOUT: __TEST__ ? 2000 : -1, | ||
ALLOWED_POST_MESSAGE_METHODS: (_ALLOWED_POST_MESSAGE = {}, _ALLOWED_POST_MESSAGE[CONSTANTS.SEND_STRATEGIES.POST_MESSAGE] = true, _ALLOWED_POST_MESSAGE[CONSTANTS.SEND_STRATEGIES.BRIDGE] = true, _ALLOWED_POST_MESSAGE[CONSTANTS.SEND_STRATEGIES.GLOBAL] = true, _ALLOWED_POST_MESSAGE), | ||
ALLOW_SAME_ORIGIN: false | ||
ALLOWED_POST_MESSAGE_METHODS: (_ALLOWED_POST_MESSAGE = {}, _ALLOWED_POST_MESSAGE[CONSTANTS.SEND_STRATEGIES.POST_MESSAGE] = true, _ALLOWED_POST_MESSAGE[CONSTANTS.SEND_STRATEGIES.BRIDGE] = true, _ALLOWED_POST_MESSAGE[CONSTANTS.SEND_STRATEGIES.GLOBAL] = true, _ALLOWED_POST_MESSAGE) | ||
}; | ||
@@ -20,0 +19,0 @@ |
@@ -7,3 +7,3 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
import { CONSTANTS, POST_MESSAGE_NAMES_LIST } from '../../conf'; | ||
import { deserializeMethods } from '../../lib'; | ||
import { deserializeMethods, markWindowKnown } from '../../lib'; | ||
import { global } from '../../global'; | ||
@@ -75,2 +75,4 @@ | ||
markWindowKnown(source); | ||
if (!message.sourceDomain || typeof message.sourceDomain !== 'string') { | ||
@@ -77,0 +79,0 @@ throw new Error('Expected message to have sourceDomain'); |
@@ -54,6 +54,2 @@ 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; }; | ||
if (win === window && !CONFIG.ALLOW_SAME_ORIGIN) { | ||
throw new Error('Attemping to send message to self'); | ||
} | ||
if (isWindowClosed(win)) { | ||
@@ -60,0 +56,0 @@ throw new Error('Window is closed'); |
@@ -7,2 +7,3 @@ import { initOnReady, listenForMethods } from './lib'; | ||
export * from './public'; | ||
export { markWindowKnown } from './lib'; | ||
export { cleanUpWindow } from './clean'; | ||
@@ -9,0 +10,0 @@ export { ZalgoPromise as Promise } from 'zalgo-promise/src'; |
@@ -10,2 +10,3 @@ import { WeakMap } from 'cross-domain-safe-weakmap/src'; | ||
global.readyPromises = global.readyPromises || new WeakMap(); | ||
global.knownWindows = global.knownWindows || new WeakMap(); | ||
@@ -29,2 +30,10 @@ export function onHello(handler) { | ||
export function markWindowKnown(win) { | ||
global.knownWindows.set(win, true); | ||
} | ||
export function isWindowKnown(win) { | ||
return global.knownWindows.get(win); | ||
} | ||
export function initOnReady() { | ||
@@ -31,0 +40,0 @@ |
@@ -9,3 +9,3 @@ export { _send as send }; | ||
import { sendMessage, addResponseListener, deleteResponseListener, markResponseListenerErrored } from '../drivers'; | ||
import { onChildWindowReady, sayHello } from '../lib'; | ||
import { onChildWindowReady, sayHello, isWindowKnown } from '../lib'; | ||
import { global } from '../global'; | ||
@@ -154,5 +154,8 @@ | ||
var ackTimeout = CONFIG.ACK_TIMEOUT; | ||
var resTimeout = options.timeout || CONFIG.RES_TIMEOUT; | ||
var totalAckTimeout = isWindowKnown(win) ? CONFIG.ACK_TIMEOUT_KNOWN : CONFIG.ACK_TIMEOUT; | ||
var totalResTimeout = options.timeout || CONFIG.RES_TIMEOUT; | ||
var ackTimeout = totalAckTimeout; | ||
var resTimeout = totalResTimeout; | ||
var cycleTime = 100; | ||
@@ -190,5 +193,5 @@ | ||
} else if (ackTimeout === 0) { | ||
return reject(new Error('No ack for postMessage ' + name + ' in ' + getDomain() + ' in ' + CONFIG.ACK_TIMEOUT + 'ms')); | ||
return reject(new Error('No ack for postMessage ' + name + ' in ' + getDomain() + ' in ' + totalAckTimeout + 'ms')); | ||
} else if (resTimeout === 0) { | ||
return reject(new Error('No response for postMessage ' + name + ' in ' + getDomain() + ' in ' + (options.timeout || CONFIG.RES_TIMEOUT) + 'ms')); | ||
return reject(new Error('No response for postMessage ' + name + ' in ' + getDomain() + ' in ' + totalResTimeout + 'ms')); | ||
} | ||
@@ -195,0 +198,0 @@ |
@@ -1,3 +0,3 @@ | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("postRobot",[],n):"object"==typeof exports?exports.postRobot=n():e.postRobot=n()}("undefined"!=typeof self?self:this,function(){return function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.p="",r(r.s=13)}([function(e,n,r){"use strict";var t=r(14);r.d(n,"getActualDomain",function(){return t.a}),r.d(n,"getAncestor",function(){return t.b}),r.d(n,"getDomain",function(){return t.c}),r.d(n,"getDomainFromUrl",function(){return t.d}),r.d(n,"getFrameByName",function(){return t.e}),r.d(n,"getFrames",function(){return t.f}),r.d(n,"getOpener",function(){return t.g}),r.d(n,"getParent",function(){return t.h}),r.d(n,"getUserAgent",function(){return t.i}),r.d(n,"isActuallySameDomain",function(){return t.j}),r.d(n,"isAncestor",function(){return t.k}),r.d(n,"isIframe",function(){return t.l}),r.d(n,"isOpener",function(){return t.m}),r.d(n,"isPopup",function(){return t.n}),r.d(n,"isSameDomain",function(){return t.o}),r.d(n,"isSameTopWindow",function(){return t.p}),r.d(n,"isWindow",function(){return t.q}),r.d(n,"isWindowClosed",function(){return t.r}),r.d(n,"linkFrameWindow",function(){return t.s}),r.d(n,"matchDomain",function(){return t.t}),r.d(n,"stringifyDomainPattern",function(){return t.u});var o=r(15);r.n(o)},function(e,n,r){"use strict";var t,o={POST_MESSAGE_TYPE:{REQUEST:"postrobot_message_request",RESPONSE:"postrobot_message_response",ACK:"postrobot_message_ack"},POST_MESSAGE_ACK:{SUCCESS:"success",ERROR:"error"},POST_MESSAGE_NAMES:{METHOD:"postrobot_method",HELLO:"postrobot_ready",OPEN_TUNNEL:"postrobot_open_tunnel"},WINDOW_TYPES:{FULLPAGE:"fullpage",POPUP:"popup",IFRAME:"iframe"},WINDOW_PROPS:{POSTROBOT:"__postRobot__"},SERIALIZATION_TYPES:{METHOD:"postrobot_method",ERROR:"postrobot_error",PROMISE:"postrobot_promise",ZALGO_PROMISE:"postrobot_zalgo_promise",REGEX:"regex"},SEND_STRATEGIES:{POST_MESSAGE:"postrobot_post_message",BRIDGE:"postrobot_bridge",GLOBAL:"postrobot_global"},MOCK_PROTOCOL:"mock:",FILE_PROTOCOL:"file:",BRIDGE_NAME_PREFIX:"__postrobot_bridge__",POSTROBOT_PROXY:"__postrobot_proxy__",WILDCARD:"*"},i={METHOD:"postrobot_method",HELLO:"postrobot_hello",OPEN_TUNNEL:"postrobot_open_tunnel"},a=Object.keys(i).map(function(e){return i[e]}),u={ALLOW_POSTMESSAGE_POPUP:!("__ALLOW_POSTMESSAGE_POPUP__"in window)||window.__ALLOW_POSTMESSAGE_POPUP__,BRIDGE_TIMEOUT:5e3,CHILD_WINDOW_TIMEOUT:5e3,ACK_TIMEOUT:-1!==window.navigator.userAgent.match(/MSIE/i)?2e3:1e3,RES_TIMEOUT:-1,ALLOWED_POST_MESSAGE_METHODS:(t={},t[o.SEND_STRATEGIES.POST_MESSAGE]=!0,t[o.SEND_STRATEGIES.BRIDGE]=!0,t[o.SEND_STRATEGIES.GLOBAL]=!0,t),ALLOW_SAME_ORIGIN:!1};0===window.location.href.indexOf(o.FILE_PROTOCOL)&&(u.ALLOW_POSTMESSAGE_POPUP=!0),r.d(n,"a",function(){return u}),r.d(n,"b",function(){return o}),r.d(n,!1,function(){return i}),r.d(n,!1,function(){return a})},function(e,n,r){"use strict";function t(e){try{if(!e)return!1;if("undefined"!=typeof Promise&&e instanceof Promise)return!0;if("undefined"!=typeof window&&window.Window&&e instanceof window.Window)return!1;if("undefined"!=typeof window&&window.constructor&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var r=n.call(e);if("[object Window]"===r||"[object global]"===r||"[object DOMWindow]"===r)return!1}if("function"==typeof e.then)return!0}catch(e){return!1}return!1}function o(){var e=void 0;if("undefined"!=typeof window)e=window;else{if("undefined"==typeof window)throw new TypeError("Can not find global");e=window}var n=e.__zalgopromise__=e.__zalgopromise__||{};return n.flushPromises=n.flushPromises||[],n.activeCount=n.activeCount||0,n.possiblyUnhandledPromiseHandlers=n.possiblyUnhandledPromiseHandlers||[],n.dispatchedErrors=n.dispatchedErrors||[],n}var i=function(){function e(n){var r=this;if(function(n,r){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],n){var t=void 0,o=void 0,i=!1,a=!1,u=!1;try{n(function(e){u?r.resolve(e):(i=!0,t=e)},function(e){u?r.reject(e):(a=!0,o=e)})}catch(e){return void this.reject(e)}u=!0,i?this.resolve(t):a&&this.reject(o)}}return e.prototype.resolve=function(e){if(this.resolved||this.rejected)return this;if(t(e))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},e.prototype.reject=function(e){var n=this;if(this.resolved||this.rejected)return this;if(t(e))throw new Error("Can not reject promise with another promise");if(!e){var r=e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e);e=new Error("Expected reject to be called with Error, got "+r)}return this.rejected=!0,this.error=e,this.errorHandled||setTimeout(function(){n.errorHandled||function(e,n){if(-1===o().dispatchedErrors.indexOf(e)){o().dispatchedErrors.push(e),setTimeout(function(){throw e},1);for(var r=0;r<o().possiblyUnhandledPromiseHandlers.length;r++)o().possiblyUnhandledPromiseHandlers[r](e,n)}}(e,n)},1),this.dispatch(),this},e.prototype.asyncReject=function(e){this.errorHandled=!0,this.reject(e)},e.prototype.dispatch=function(){var n=this,r=this.dispatching,i=this.resolved,a=this.rejected,u=this.handlers;if(!r&&(i||a)){this.dispatching=!0,o().activeCount+=1;for(var c=function(r){var o=u[r],c=o.onSuccess,s=o.onError,d=o.promise,f=void 0;if(i)try{f=c?c(n.value):n.value}catch(e){return d.reject(e),"continue"}else if(a){if(!s)return d.reject(n.error),"continue";try{f=s(n.error)}catch(e){return d.reject(e),"continue"}}f instanceof e&&(f.resolved||f.rejected)?(f.resolved?d.resolve(f.value):d.reject(f.error),f.errorHandled=!0):t(f)?f instanceof e&&(f.resolved||f.rejected)?f.resolved?d.resolve(f.value):d.reject(f.error):f.then(function(e){d.resolve(e)},function(e){d.reject(e)}):d.resolve(f)},s=0;s<u.length;s++)c(s);u.length=0,this.dispatching=!1,o().activeCount-=1,0===o().activeCount&&e.flushQueue()}},e.prototype.then=function(n,r){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.then expected a function for success handler");if(r&&"function"!=typeof r&&!r.call)throw new Error("Promise.then expected a function for error handler");var t=new e;return this.handlers.push({promise:t,onSuccess:n,onError:r}),this.errorHandled=!0,this.dispatch(),t},e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.finally=function(n){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return e.try(n).then(function(){return r})},function(r){return e.try(n).then(function(){throw r})})},e.prototype.timeout=function(e,n){var r=this;if(this.resolved||this.rejected)return this;var t=setTimeout(function(){r.resolved||r.rejected||r.reject(n||new Error("Promise timed out after "+e+"ms"))},e);return this.then(function(e){return clearTimeout(t),e})},e.prototype.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},e.resolve=function(n){return n instanceof e?n:t(n)?new e(function(e,r){return n.then(e,r)}):(new e).resolve(n)},e.reject=function(n){return(new e).reject(n)},e.all=function(n){var r=new e,o=n.length,i=[];if(!o)return r.resolve(i),r;for(var a=function(a){var u=n[a];if(u instanceof e){if(u.resolved)return i[a]=u.value,o-=1,"continue"}else if(!t(u))return i[a]=u,o-=1,"continue";e.resolve(u).then(function(e){i[a]=e,0==(o-=1)&&r.resolve(i)},function(e){r.reject(e)})},u=0;u<n.length;u++)a(u);return 0===o&&r.resolve(i),r},e.hash=function(n){var r={};return e.all(Object.keys(n).map(function(t){return e.resolve(n[t]).then(function(e){r[t]=e})})).then(function(){return r})},e.map=function(n,r){return e.all(n.map(r))},e.onPossiblyUnhandledException=function(e){return function(e){return o().possiblyUnhandledPromiseHandlers.push(e),{cancel:function(){o().possiblyUnhandledPromiseHandlers.splice(o().possiblyUnhandledPromiseHandlers.indexOf(e),1)}}}(e)},e.try=function(n,r,t){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.try expected a function");var o=void 0;try{o=n.apply(r,t||[])}catch(n){return e.reject(n)}return e.resolve(o)},e.delay=function(n){return new e(function(e){setTimeout(e,n)})},e.isPromise=function(n){return!!(n&&n instanceof e)||t(n)},e.flush=function(){var n=new e;return o().flushPromises.push(n),0===o().activeCount&&e.flushQueue(),n},e.flushQueue=function(){var e=o().flushPromises;o().flushPromises=[];for(var n=0,r=null==e?0:e.length;n<r;n++)e[n].resolve()},e}();r.d(n,"a",function(){return i})},function(e,n,r){"use strict";r.d(n,"a",function(){return o});var t=r(1),o=window[t.b.WINDOW_PROPS.POSTROBOT]=window[t.b.WINDOW_PROPS.POSTROBOT]||{};o.registerSelf=function(){}},function(e,n,r){"use strict";r(10);var t=r(8);r.d(n,"addEventListener",function(){return t.a}),r(16),r(17),r(18),r(11);var o=r(6);r.d(n,"isRegex",function(){return o.f}),r.d(n,"noop",function(){return o.h}),r.d(n,"once",function(){return o.i}),r.d(n,"replaceObject",function(){return o.m}),r.d(n,"safeInterval",function(){return o.n}),r.d(n,"stringifyError",function(){return o.p}),r.d(n,"uniqueID",function(){return o.r}),r.d(n,"weakMapMemoize",function(){return o.s}),r(19);var i=r(20);r.n(i),r(21),r(22)},function(e,n,r){"use strict";r.d({},"WeakMap",function(){return u});var t=r(0);function o(e,n){for(var r=0;r<e.length;r++)try{if(e[r]===n)return r}catch(e){}return-1}var i=Object.defineProperty,a=Date.now()%1e9,u=function(){function e(){if(function(n,r){if(!(n instanceof e))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 e=new WeakMap,n={};return Object.freeze(n),e.set(n,"__testvalue__"),"__testvalue__"===e.get(n)}catch(e){return!1}}())try{this.weakmap=new WeakMap}catch(e){}this.keys=[],this.values=[]}return e.prototype._cleanupClosedWindows=function(){for(var e=this.weakmap,n=this.keys,r=0;r<n.length;r++){var o=n[r];if(Object(t.isWindow)(o)&&Object(t.isWindowClosed)(o)){if(e)try{e.delete(o)}catch(e){}n.splice(r,1),this.values.splice(r,1),r-=1}}},e.prototype.isSafeToReadWrite=function(e){if(Object(t.isWindow)(e))return!1;try{e&&e.self,e&&e[this.name]}catch(e){return!1}return!0},e.prototype.set=function(e,n){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.set(e,n)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var t=this.name,a=e[t];a&&a[0]===e?a[1]=n:i(e,t,{value:[e,n],writable:!0})}else{this._cleanupClosedWindows();var u=this.keys,c=this.values,s=o(u,e);-1===s?(u.push(e),c.push(n)):c[s]=n}},e.prototype.get=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{if(n.has(e))return n.get(e)}catch(e){delete this.weakmap}if(!this.isSafeToReadWrite(e)){this._cleanupClosedWindows();var r=o(this.keys,e);if(-1===r)return;return this.values[r]}var t=e[this.name];if(t&&t[0]===e)return t[1]},e.prototype.delete=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{n.delete(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var r=e[this.name];r&&r[0]===e&&(r[0]=r[1]=void 0)}else{this._cleanupClosedWindows();var t=this.keys,i=o(t,e);-1!==i&&(t.splice(i,1),this.values.splice(i,1))}},e.prototype.has=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{return n.has(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var r=e[this.name];return!(!r||r[0]!==e)}return this._cleanupClosedWindows(),-1!==o(this.keys,e)},e.prototype.getOrSet=function(e,n){if(this.has(e))return this.get(e);var r=n();return this.set(e,r),r},e}();r.d(n,"a",function(){return u})},function(e,n,r){"use strict";n.r=u,n.d=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")},n.g=function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=new o.a;function i(){for(var n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];var u=t.getOrSet(r.thisNamespace?this:e,function(){return{}}),c=s(o),d=r.time;if(u[c]&&d&&Date.now()-u[c].time<d&&delete u[c],u[c])return u[c].value;i.__calling__=!0;var f=Date.now(),l=e.apply(this,arguments);return i.__calling__=!1,u[c]={time:f,value:l},u[c].value}return i.reset=function(){t.delete(r.thisNamespace?n:e)},r.name&&(i.displayName=r.name+":memoized"),i},n.j=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};function r(){return t.a.try(e,this,arguments)}return n.name&&(r.displayName=n.name+":promisified"),r},n.e=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],t=e.__inline_memoize_cache__=e.__inline_memoize_cache__||{},o=s(r);return t.hasOwnProperty(o)?t[o]:t[o]=n.apply(void 0,r)},n.h=function(){},n.i=function(e){var n=!1;return function(){if(!n)return n=!0,e.apply(this,arguments)}},n.p=function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(r>=3)return"stringifyError stack overflow";try{if(!n)return"<unknown error: "+Object.prototype.toString.call(n)+">";if("string"==typeof n)return n;if(n instanceof Error){var t=n&&n.stack,o=n&&n.message;if(t&&o)return-1!==t.indexOf(o)?t:o+"\n"+t;if(t)return t;if(o)return o}return"function"==typeof n.toString?n.toString():Object.prototype.toString.call(n)}catch(n){return"Error while stringifying error: "+e(n,r+1)}},n.o=function(e){return"string"==typeof e?e:e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)},n.c=function(e,n){if(!n)return e;if(Object.assign)return Object.assign(e,n);for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r]);return e},n.k=function(e,n,r){var t=[];return e.replace(n,function(e){t.push(r?r.apply(null,arguments):e)}),t},n.q=function(e){return"data:image/svg+xml;base64,"+a(e)},n.l=function(e,n){var r=[];return e.replace(n,function(e){return r.push(e),""}),r},n.n=function(e,n){var r=void 0;return function t(){r=setTimeout(function(){e(),t()},n)}(),{cancel:function(){clearTimeout(r)}}},n.a=function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},n.m=function e(n,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(Array.isArray(n)){for(var o=n.length,i=[],a=function(o){d(i,o,function(){var i=t?t+"."+o:""+o,a=n[o],u=r(a,o,i);return(l(u)||Array.isArray(u))&&(u=e(u,r,i)),u})},u=0;u<o;u++)a(u);return i}if(l(n)){var c={},s=function(o){if(!n.hasOwnProperty(o))return"continue";d(c,o,function(){var i=t?t+"."+o:""+o,a=n[o],u=r(a,o,i);return(l(u)||Array.isArray(u))&&(u=e(u,r,i)),u})};for(var f in n)s(f);return c}throw new Error("Pass an object or array")},n.b=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,r=void 0;return function(){var t=this,o=arguments;clearTimeout(r),r=setTimeout(function(){return e.apply(t,o)},n)}},n.f=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},r.d(n,"s",function(){return w});var t=r(2),o=r(5),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function a(e){return window.btoa(e)}function u(){var e="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})+"_"+a((new Date).toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var c=void 0;function s(e){try{return JSON.stringify(Array.prototype.slice.call(e),function(e,n){return"function"==typeof n?"memoize["+function(e){if(c=c||new o.a,null===e||void 0===e||"object"!==(void 0===e?"undefined":i(e))&&"function"!=typeof e)throw new Error("Invalid object");var n=c.get(e);return n||(n=(void 0===e?"undefined":i(e))+":"+u(),c.set(e,n)),n}(n)+"]":n})}catch(e){throw new Error("Arguments not serializable -- can not be used to memoize")}}function d(e,n,r){if(Array.isArray(e)){if("number"!=typeof n)throw new TypeError("Array key must be number")}else if("object"===(void 0===e?"undefined":i(e))&&null!==e&&"string"!=typeof n)throw new TypeError("Object key must be string");Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:function(){delete e[n];var t=r();return e[n]=t,t},set:function(r){delete e[n],e[n]=r}})}function f(e){return"object"===(void 0===(n=e)?"undefined":i(n))&&null!==n&&"[object Object]"===Object.prototype.toString.call(e);var n}function l(e){if(!f(e))return!1;var n=e.constructor;if("function"!=typeof n)return!1;var r=n.prototype;return!!f(r)&&!!r.hasOwnProperty("isPrototypeOf")}var w=function(e){var n=new o.a;return function(r){var t=n.get(r);return void 0!==t?t:(void 0!==(t=e.call(this,r))&&n.set(r,t),t)}}},function(e,n,r){"use strict";var t=r(0),o=r(1);function i(){return Object(t.isPopup)()?o.b.WINDOW_TYPES.POPUP:Object(t.isIframe)()?o.b.WINDOW_TYPES.IFRAME:o.b.WINDOW_TYPES.FULLPAGE}function a(){return!!Object(t.getUserAgent)(window).match(/MSIE|trident|edge\/12|edge\/13/i)||!o.a.ALLOW_POSTMESSAGE_POPUP}var u=r(5),c=r(2),s=r(4),d=r(3),f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};d.a.methods=d.a.methods||new u.a;var l=Object(s.once)(function(){d.a.on(o.b.POST_MESSAGE_NAMES.METHOD,{origin:o.b.WILDCARD},function(e){var n=e.source,r=e.origin,o=e.data,i=d.a.methods.get(n);if(!i)throw new Error("Could not find any methods this window has privileges to call");var a=i[o.id];if(!a)throw new Error("Could not find method with id: "+o.id);if(!Object(t.matchDomain)(a.domain,r))throw new Error("Method domain "+a.domain+" does not match origin "+r);return c.a.try(function(){return a.method.apply({source:n,origin:r,data:o},o.args)}).then(function(e){return{result:e,id:o.id,name:o.name}})})});function w(e,n){return"object"===(void 0===e?"undefined":f(e))&&null!==e&&e.__type__===n}function p(e,n,r,t){var i=Object(s.uniqueID)(),a=d.a.methods.get(e);return a||(a={},d.a.methods.set(e,a)),a[i]={domain:n,method:r},{__type__:o.b.SERIALIZATION_TYPES.METHOD,__id__:i,__name__:t}}function h(e,n,r){return Object(s.replaceObject)({obj:r},function(r,t){return"function"==typeof r?p(e,n,r,t.toString()):r instanceof Error?(i=r,{__type__:o.b.SERIALIZATION_TYPES.ERROR,__message__:Object(s.stringifyError)(i),__code__:i.code}):window.Promise&&r instanceof window.Promise?function(e,n,r,t){return{__type__:o.b.SERIALIZATION_TYPES.PROMISE,__then__:p(e,n,function(e,n){return r.then(e,n)},t+".then")}}(e,n,r,t.toString()):c.a.isPromise(r)?function(e,n,r,t){return{__type__:o.b.SERIALIZATION_TYPES.ZALGO_PROMISE,__then__:p(e,n,function(e,n){return r.then(e,n)},t+".then")}}(e,n,r,t.toString()):Object(s.isRegex)(r)?(a=r,{__type__:o.b.SERIALIZATION_TYPES.REGEX,__source__:a.source}):r;var i,a}).obj}function m(e,n,r){function t(){var t=Array.prototype.slice.call(arguments);return d.a.send(e,o.b.POST_MESSAGE_NAMES.METHOD,{id:r.__id__,name:r.__name__,args:t},{domain:n,timeout:-1}).then(function(e){return e.data.result},function(e){throw e})}return t.__name__=r.__name__,t.__xdomain__=!0,t.source=e,t.origin=n,t}function g(e,n,r){var t=new Error(r.__message__);return r.__code__&&(t.code=r.__code__),t}function O(e,n,r){return new c.a(function(t,o){return m(e,n,r.__then__)(t,o)})}function v(e,n,r){return window.Promise?new window.Promise(function(t,o){return m(e,n,r.__then__)(t,o)}):O(e,n,r)}function y(e,n,r){return new RegExp(r.__source__)}function b(e,n,r){return Object(s.replaceObject)({obj:r},function(r){return"object"!==(void 0===r?"undefined":f(r))||null===r?r:w(r,o.b.SERIALIZATION_TYPES.METHOD)?m(e,n,r):w(r,o.b.SERIALIZATION_TYPES.ERROR)?g(0,0,r):w(r,o.b.SERIALIZATION_TYPES.PROMISE)?v(e,n,r):w(r,o.b.SERIALIZATION_TYPES.ZALGO_PROMISE)?O(e,n,r):w(r,o.b.SERIALIZATION_TYPES.REGEX)?y(0,0,r):r}).obj}function _(e){d.a.on(o.b.POST_MESSAGE_NAMES.HELLO,{domain:o.b.WILDCARD},function(n){var r=n.source,t=n.origin;return e({source:r,origin:t})})}function E(e){return d.a.send(e,o.b.POST_MESSAGE_NAMES.HELLO,{},{domain:o.b.WILDCARD,timeout:-1}).then(function(e){return{origin:e.origin}})}function S(){_(function(e){var n=e.source,r=e.origin,t=d.a.readyPromises.get(n)||new c.a;t.resolve({origin:r}),d.a.readyPromises.set(n,t)});var e=Object(t.getAncestor)();e&&E(e).catch(s.noop)}function P(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Window",t=d.a.readyPromises.get(e);return t||(t=new c.a,d.a.readyPromises.set(e,t),-1!==n&&setTimeout(function(){return t.reject(new Error(r+" did not load after "+n+"ms"))},n),t)}d.a.readyPromises=d.a.readyPromises||new u.a,r.d(n,"b",function(){return i}),r.d(n,"e",function(){return a}),r.d(n,"d",function(){return l}),r.d(n,!1,function(){return p}),r.d(n,"h",function(){return h}),r.d(n,!1,function(){return m}),r.d(n,!1,function(){return g}),r.d(n,!1,function(){return O}),r.d(n,!1,function(){return v}),r.d(n,!1,function(){return y}),r.d(n,"a",function(){return b}),r.d(n,!1,function(){return _}),r.d(n,"g",function(){return E}),r.d(n,"c",function(){return S}),r.d(n,"f",function(){return P})},function(e,n,r){"use strict";r(2),r(0),r(5);var t=r(6);r(10),n.d=function e(){return Object(t.e)(e,function(){try{if("undefined"==typeof window)return!1;if(window.localStorage){var e=Math.random().toString();window.localStorage.setItem("__test__localStorage__",e);var n=window.localStorage.getItem("__test__localStorage__");if(window.localStorage.removeItem("__test__localStorage__"),e===n)return!0}}catch(e){}return!1})},n.b=function(e,n){e.appendChild(n)},n.g=function(e,n){try{e.document.open(),e.document.write(n),e.document.close()}catch(r){try{e.location="javascript: document.open(); document.write("+JSON.stringify(n)+"); document.close();"}catch(e){}}},n.f=function(e,n){var r=n.tagName.toLowerCase();if("html"!==r)throw new Error("Expected element to be html, got "+r);for(var t=e.document.documentElement;t.children&&t.children.length;)t.removeChild(t.children[0]);for(;n.children.length;)t.appendChild(n.children[0])},n.e=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.document;e.styleSheet?e.styleSheet.cssText=n:e.appendChild(r.createTextNode(n))},n.a=function(e,n,r){return e.addEventListener(n,r),{cancel:function(){e.removeEventListener(n,r)}}},n.c=function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.document,r=0,t=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.document;return Array.prototype.slice.call(n.querySelectorAll(e))}("script",e),o=null==t?0:t.length;r<o;r++){var i=t[r],a=i.parentNode;if(a){var u=n.createElement("script");u.text=i.textContent,a.replaceChild(u,i)}}},"function"==typeof Symbol&&Symbol.iterator,Object.assign,Object.create(Error.prototype)},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r(2),o=r(0),i=r(4),a=r(1),u=r(3);function c(e){try{u.a.tunnelWindows[e]&&delete u.a.tunnelWindows[e].source}catch(e){}delete u.a.tunnelWindows[e]}u.a.tunnelWindows=u.a.tunnelWindows||{},u.a.tunnelWindowId=0,u.a.openTunnelToParent=function(e){var n=e.name,r=e.source,t=e.canary,s=e.sendMessage,d=Object(o.getParent)(window);if(!d)throw new Error("No parent window found to open tunnel to");var f=function(e){var n=e.name,r=e.source,t=e.canary,a=e.sendMessage;return function(){for(var e=u.a.tunnelWindows,n=0,r=Object.keys(e),t=null==r?0:r.length;n<t;n++){var a=r[n],s=e[a];try{Object(i.noop)(s.source)}catch(e){c(a);continue}Object(o.isWindowClosed)(s.source)&&c(a)}}(),u.a.tunnelWindowId+=1,u.a.tunnelWindows[u.a.tunnelWindowId]={name:n,source:r,canary:t,sendMessage:a},u.a.tunnelWindowId}({name:n,source:r,canary:t,sendMessage:s});return u.a.send(d,a.b.POST_MESSAGE_NAMES.OPEN_TUNNEL,{name:n,sendMessage:function(){var e=function(e){return u.a.tunnelWindows[e]}(f);try{Object(i.noop)(e&&e.source)}catch(e){return void c(f)}if(e&&e.source&&!Object(o.isWindowClosed)(e.source)){try{e.canary()}catch(e){return}e.sendMessage.apply(this,arguments)}}},{domain:a.b.WILDCARD})};var s=r(5);function d(){return!!Object(o.getUserAgent)(window).match(/MSIE|trident|edge\/12|edge\/13/i)||!a.a.ALLOW_POSTMESSAGE_POPUP}function f(e){return!Object(o.isSameTopWindow)(window,e)}function l(e,n){if(e){if(Object(o.getDomain)()!==Object(o.getDomainFromUrl)(e))return!0}else if(n&&!Object(o.isSameDomain)(n))return!0;return!1}function w(e){var n=e.win,r=e.domain;return!(!d()||r&&!l(r,n)||n&&!f(n))}function p(e){var n=(e=e||Object(o.getDomainFromUrl)(e)).replace(/[^a-zA-Z0-9]+/g,"_");return a.b.BRIDGE_NAME_PREFIX+"_"+n}function h(){return Boolean(window.name&&window.name===p(Object(o.getDomain)()))}var m=new t.a(function(e){if(window.document&&window.document.body)return e(window.document.body);var n=setInterval(function(){if(window.document&&window.document.body)return clearInterval(n),e(window.document.body)},10)});function g(e){u.a.remoteWindows.set(e,{sendMessagePromise:new t.a})}function O(e){return u.a.remoteWindows.get(e)}function v(e,n,r){var i=O(e);if(!i)throw new Error("Window not found to register sendMessage to");var a=function(t,i,a){if(t!==e)throw new Error("Remote window does not match window");if(!Object(o.matchDomain)(a,n))throw new Error("Remote domain "+a+" does not match domain "+n);r(i)};i.sendMessagePromise.resolve(a),i.sendMessagePromise=t.a.resolve(a)}function y(e,n){var r=O(e);if(!r)throw new Error("Window not found on which to reject sendMessage");r.sendMessagePromise.asyncReject(n)}function b(e,n,r){var t=Object(o.isOpener)(window,e),i=Object(o.isOpener)(e,window);if(!t&&!i)throw new Error("Can only send messages to and from parent and popup windows");var a=O(e);if(!a)throw new Error("Window not found to send message to");return a.sendMessagePromise.then(function(t){return t(e,n,r)})}u.a.remoteWindows=u.a.remoteWindows||new s.a;var _=Object(i.weakMapMemoize)(function(e){return t.a.try(function(){for(var n=0,r=Object(o.getFrames)(e),i=null==r?0:r.length;n<i;n++){var u=r[n];try{if(u&&u!==window&&Object(o.isSameDomain)(u)&&u[a.b.WINDOW_PROPS.POSTROBOT])return u}catch(e){continue}}try{var c=Object(o.getFrameByName)(e,p(Object(o.getDomain)()));if(!c)return;return Object(o.isSameDomain)(c)&&c[a.b.WINDOW_PROPS.POSTROBOT]?c:new t.a(function(e){var n=void 0,r=void 0;n=setInterval(function(){if(c&&Object(o.isSameDomain)(c)&&c[a.b.WINDOW_PROPS.POSTROBOT])return clearInterval(n),clearTimeout(r),e(c)},100),r=setTimeout(function(){return clearInterval(n),e()},2e3)})}catch(e){}})});function E(){return t.a.try(function(){var e=Object(o.getOpener)(window);if(e&&w({win:e}))return g(e),_(e).then(function(n){return n?window.name?n[a.b.WINDOW_PROPS.POSTROBOT].openTunnelToParent({name:window.name,source:window,canary:function(){},sendMessage:function(e){try{Object(i.noop)(window)}catch(e){return}if(window&&!window.closed)try{u.a.receiveMessage({data:e,origin:this.origin,source:this.source})}catch(e){t.a.reject(e)}}}).then(function(n){var r=n.source,t=n.origin,o=n.data;if(r!==e)throw new Error("Source does not match opener");v(r,t,o.sendMessage)}).catch(function(n){throw y(e,n),n}):y(e,new Error("Can not register with opener: window does not have a name")):y(e,new Error("Can not register with opener: no bridge found in opener"))})})}var S=r(7);function P(e,n){return n=n||Object(o.getDomainFromUrl)(e),Boolean(u.a.bridges[n])}function T(e,n){return n=n||Object(o.getDomainFromUrl)(e),u.a.bridges[n]?u.a.bridges[n]:(u.a.bridges[n]=t.a.try(function(){if(Object(o.getDomain)()===n)throw new Error("Can not open bridge on the same domain as current domain: "+n);var r=p(n);if(Object(o.getFrameByName)(window,r))throw new Error("Frame with name "+r+" already exists on page");var i=function(e,n){var r=document.createElement("iframe");return r.setAttribute("name",e),r.setAttribute("id",e),r.setAttribute("style","display: none; margin: 0; padding: 0; border: 0px none; overflow: hidden;"),r.setAttribute("frameborder","0"),r.setAttribute("border","0"),r.setAttribute("scrolling","no"),r.setAttribute("allowTransparency","true"),r.setAttribute("tabindex","-1"),r.setAttribute("hidden","true"),r.setAttribute("title",""),r.setAttribute("role","presentation"),r.src=n,r}(r,e);return u.a.bridgeFrames[n]=i,m.then(function(r){r.appendChild(i);var o=i.contentWindow;return function(e,n){u.a.on(a.b.POST_MESSAGE_NAMES.OPEN_TUNNEL,{window:e,domain:n},function(e){var r=e.origin,o=e.data;if(r!==n)throw new Error("Domain "+n+" does not match origin "+r);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(!u.a.popupWindowsByName[o.name])throw new Error("Window with name "+o.name+" does not exist, or was not opened by this window");if(!u.a.popupWindowsByName[o.name].domain)throw new Error("We do not have a registered domain for window "+o.name);if(u.a.popupWindowsByName[o.name].domain!==r)throw new Error("Message origin "+r+" does not matched registered window origin "+u.a.popupWindowsByName[o.name].domain);return v(u.a.popupWindowsByName[o.name].win,n,o.sendMessage),{sendMessage:function(e){if(window&&!window.closed){var n=u.a.popupWindowsByName[o.name];if(n)try{u.a.receiveMessage({data:e,origin:n.domain,source:n.win})}catch(e){t.a.reject(e)}}}}})}(o,n),new t.a(function(e,n){i.onload=e,i.onerror=n}).then(function(){return Object(S.f)(o,a.a.BRIDGE_TIMEOUT,"Bridge "+e)}).then(function(){return o})})}),u.a.bridges[n])}u.a.bridges=u.a.bridges||{},u.a.bridgeFrames=u.a.bridgeFrames||{},u.a.popupWindowsByWin=u.a.popupWindowsByWin||new s.a,u.a.popupWindowsByName=u.a.popupWindowsByName||{};var j=window.open;function A(e,n){var r=u.a.popupWindowsByWin.get(e);r&&(r.domain=Object(o.getDomainFromUrl)(n),g(e))}function W(){for(var e=0,n=Object.keys(u.a.bridgeFrames),r=null==n?0:n.length;e<r;e++){var t=n[e],o=u.a.bridgeFrames[t];o.parentNode&&o.parentNode.removeChild(o)}u.a.bridgeFrames={},u.a.bridges={}}window.open=function(e,n,r,t){var i=e;if(e&&0===e.indexOf(a.b.MOCK_PROTOCOL)){var c=e.split("|");i=c[0],e=c[1]}i&&(i=Object(o.getDomainFromUrl)(i));var s=j.call(this,e,n,r,t);if(!s)return s;e&&g(s);for(var d=0,f=Object.keys(u.a.popupWindowsByName),l=null==f?0:f.length;d<l;d++){var w=f[d];Object(o.isWindowClosed)(u.a.popupWindowsByName[w].win)&&delete u.a.popupWindowsByName[w]}if(n&&s){var p=u.a.popupWindowsByWin.get(s)||u.a.popupWindowsByName[n]||{};p.name=p.name||n,p.win=p.win||s,p.domain=p.domain||i,u.a.popupWindowsByWin.set(s,p),u.a.popupWindowsByName[n]=p}return s},r.d(n,"openTunnelToOpener",function(){return E}),r.d(n,"needsBridgeForBrowser",function(){return d}),r.d(n,"needsBridgeForWin",function(){return f}),r.d(n,"needsBridgeForDomain",function(){return l}),r.d(n,"needsBridge",function(){return w}),r.d(n,"getBridgeName",function(){return p}),r.d(n,"isBridge",function(){return h}),r.d(n,"documentBodyReady",function(){return m}),r.d(n,"registerRemoteWindow",function(){return g}),r.d(n,"findRemoteWindow",function(){return O}),r.d(n,"registerRemoteSendMessage",function(){return v}),r.d(n,"rejectRemoteSendMessage",function(){return y}),r.d(n,"sendBridgeMessage",function(){return b}),r.d(n,"hasBridge",function(){return P}),r.d(n,"openBridge",function(){return T}),r.d(n,"linkUrl",function(){return A}),r.d(n,"destroyBridges",function(){return W})},function(e,n,r){"use strict";n.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(e,n,r){"use strict";n.a=function e(n){var r=n.name,i=n.version,a=void 0===i?"latest":i,u=n.lifetime,c=void 0===u?3e5:u;return Object(t.e)(e,function(){var e="__"+r+"_"+a+"_storage__",n=void 0;function i(r){var i=Object(o.d)(),a=void 0;if(n&&(a=n),!a&&i){var u=window.localStorage.getItem(e);u&&(a=JSON.parse(u))}a||(a=Object(t.d)()[e]),a||(a={id:Object(t.r)()}),a.id||(a.id=Object(t.r)()),n=a;var c=r(a);return i?window.localStorage.setItem(e,JSON.stringify(a)):Object(t.d)()[e]=a,n=null,c}function u(e){return i(function(n){var r=n.__session__,o=Date.now();return r&&o-r.created>c&&(r=null),r||(r={guid:Object(t.r)(),created:o}),n.__session__=r,e(r)})}return{getState:i,getID:function(){return i(function(e){return e.id})},getSessionState:function(e){return u(function(n){return n.state=n.state||{},e(n.state)})},getSessionID:function(){return u(function(e){return e.guid})}}},[{name:r,version:a,lifetime:c}])};var t=r(6),o=r(8)},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r(0),o=r(1);function i(e,n){if(!o.a.ALLOW_POSTMESSAGE_POPUP&&!1===Object(t.isSameTopWindow)(e,n))throw new Error("Can not send and receive post messages between two different windows (disabled to emulate IE)")}r.d(n,"emulateIERestrictions",function(){return i})},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t={};r.d(t,"cleanUpWindow",function(){return G}),r.d(t,"Promise",function(){return s.a}),r.d(t,"bridge",function(){return U}),r.d(t,"init",function(){return F}),r.d(t,"parent",function(){return k}),r.d(t,"send",function(){return R}),r.d(t,"request",function(){return W}),r.d(t,"sendToParent",function(){return I}),r.d(t,"client",function(){return D}),r.d(t,"on",function(){return C}),r.d(t,"listen",function(){return L}),r.d(t,"once",function(){return N}),r.d(t,"listener",function(){return B}),r.d(t,"CONFIG",function(){return u.a}),r.d(t,"CONSTANTS",function(){return u.b}),r.d(t,"disable",function(){return x});var o=r(7),i=r(0),a=r(4),u=r(1),c=r(3),s=r(2),d={};d[u.b.SEND_STRATEGIES.POST_MESSAGE]=function(e,n,t){try{r(12).emulateIERestrictions(window,e)}catch(e){return}(Array.isArray(t)?t:"string"==typeof t?[t]:[u.b.WILDCARD]).map(function(n){if(0===n.indexOf(u.b.MOCK_PROTOCOL)){if(window.location.protocol===u.b.FILE_PROTOCOL)return u.b.WILDCARD;if(!Object(i.isActuallySameDomain)(e))throw new Error("Attempting to send messsage to mock domain "+n+", but window is actually cross-domain");return Object(i.getActualDomain)(e)}return 0===n.indexOf(u.b.FILE_PROTOCOL)?u.b.WILDCARD:n}).forEach(function(r){return e.postMessage(n,r)})};var f=r(9),l=f.sendBridgeMessage,w=f.needsBridgeForBrowser,p=f.isBridge;d[u.b.SEND_STRATEGIES.BRIDGE]=function(e,n,r){if(w()||p()){if(Object(i.isSameDomain)(e))throw new Error("Post message through bridge disabled between same domain windows");if(!1!==Object(i.isSameTopWindow)(window,e))throw new Error("Can only use bridge to communicate between two different windows, not between frames");return l(e,n,r)}},d[u.b.SEND_STRATEGIES.GLOBAL]=function(e,n){if(Object(o.e)()){if(!Object(i.isSameDomain)(e))throw new Error("Post message through global disabled between different domain windows");if(!1!==Object(i.isSameTopWindow)(window,e))throw new Error("Can only use global to communicate between two different windows, not between frames");var r=e[u.b.WINDOW_PROPS.POSTROBOT];if(!r)throw new Error("Can not find postRobot global on foreign window");return r.receiveMessage({source:window,origin:Object(i.getDomain)(),data:n})}};var h=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e};function m(e,n,r){return s.a.try(function(){var t;if(n=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=Object(a.uniqueID)(),u=Object(o.b)(),c=Object(i.getDomain)(window);return h({},n,r,{sourceDomain:c,id:n.id||t,windowType:u})}(e,n,{data:Object(o.h)(e,r,n.data),domain:r}),e===window&&!u.a.ALLOW_SAME_ORIGIN)throw new Error("Attemping to send message to self");if(Object(i.isWindowClosed)(e))throw new Error("Window is closed");var c=[],f=JSON.stringify(((t={})[u.b.WINDOW_PROPS.POSTROBOT]=n,t),null,2);return s.a.map(Object.keys(d),function(n){return s.a.try(function(){if(!u.a.ALLOWED_POST_MESSAGE_METHODS[n])throw new Error("Strategy disallowed: "+n);return d[n](e,f,r)}).then(function(){return c.push(n+": success"),!0},function(e){return c.push(n+": "+Object(a.stringifyError)(e)+"\n"),!1})}).then(function(e){var r=e.some(Boolean),t=n.type+" "+n.name+" "+(r?"success":"error")+":\n - "+c.join("\n - ")+"\n";if(!r)throw new Error(t)})})}var g=r(5);c.a.responseListeners=c.a.responseListeners||{},c.a.requestListeners=c.a.requestListeners||{},c.a.WINDOW_WILDCARD=c.a.WINDOW_WILDCARD||new function(){},c.a.erroredResponseListeners=c.a.erroredResponseListeners||{};var O,v="__domain_regex__";function y(e){return c.a.responseListeners[e]}function b(e){delete c.a.responseListeners[e]}function _(e){return Boolean(c.a.erroredResponseListeners[e])}function E(e){var n=e.name,r=e.win,t=e.domain;if(r===u.b.WILDCARD&&(r=null),t===u.b.WILDCARD&&(t=null),!n)throw new Error("Name required to get request listener");var o=c.a.requestListeners[n];if(o)for(var a=0,s=[r,c.a.WINDOW_WILDCARD],d=null==s?0:s.length;a<d;a++){var f=s[a],l=f&&o.get(f);if(l){if(t&&"string"==typeof t){if(l[t])return l[t];if(l[v])for(var w=0,p=l[v],h=null==p?0:p.length;w<h;w++){var m=p[w],g=m.regex,O=m.listener;if(Object(i.matchDomain)(g,t))return O}}if(l[u.b.WILDCARD])return l[u.b.WILDCARD]}}}var S=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},P=((O={})[u.b.POST_MESSAGE_TYPE.ACK]=function(e,n,r){if(!_(r.hash)){var t=y(r.hash);if(!t)throw new Error("No handler found for post message ack for message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(t.domain,n))throw new Error("Ack origin "+n+" does not match domain "+t.domain.toString());t.ack=!0}},O[u.b.POST_MESSAGE_TYPE.REQUEST]=function(e,n,r){var t=E({name:r.name,win:e,domain:n});function o(t){return r.fireAndForget||Object(i.isWindowClosed)(e)?s.a.resolve():m(e,S({target:r.originalSource,hash:r.hash,name:r.name},t),n)}return s.a.all([o({type:u.b.POST_MESSAGE_TYPE.ACK}),s.a.try(function(){if(!t)throw new Error("No handler found for post message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(t.domain,n))throw new Error("Request origin "+n+" does not match domain "+t.domain.toString());var o=r.data;return t.handler({source:e,origin:n,data:o})}).then(function(e){return o({type:u.b.POST_MESSAGE_TYPE.RESPONSE,ack:u.b.POST_MESSAGE_ACK.SUCCESS,data:e})},function(e){var n=Object(a.stringifyError)(e).replace(/^Error: /,""),r=e.code;return o({type:u.b.POST_MESSAGE_TYPE.RESPONSE,ack:u.b.POST_MESSAGE_ACK.ERROR,error:n,code:r})})]).then(a.noop).catch(function(e){if(t&&t.handleError)return t.handleError(e);throw e})},O[u.b.POST_MESSAGE_TYPE.RESPONSE]=function(e,n,r){if(!_(r.hash)){var t=y(r.hash);if(!t)throw new Error("No handler found for post message response for message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(t.domain,n))throw new Error("Response origin "+n+" does not match domain "+Object(i.stringifyDomainPattern)(t.domain));if(b(r.hash),r.ack===u.b.POST_MESSAGE_ACK.ERROR){var o=new Error(r.error);return r.code&&(o.code=r.code),t.respond(o,null)}if(r.ack===u.b.POST_MESSAGE_ACK.SUCCESS){var a=r.data||r.response;return t.respond(null,{source:e,origin:n,data:a})}}},O),T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function j(e){if(!window||window.closed)throw new Error("Message recieved in closed window");try{if(!e.source)return}catch(e){return}var n=e.source,r=e.origin,t=function(e){var n=void 0;try{n=JSON.parse(e)}catch(e){return}if(n&&"object"===(void 0===n?"undefined":T(n))&&null!==n&&(n=n[u.b.WINDOW_PROPS.POSTROBOT])&&"object"===(void 0===n?"undefined":T(n))&&null!==n&&n.type&&"string"==typeof n.type&&P[n.type])return n}(e.data);if(t){if(!t.sourceDomain||"string"!=typeof t.sourceDomain)throw new Error("Expected message to have sourceDomain");0!==t.sourceDomain.indexOf(u.b.MOCK_PROTOCOL)&&0!==t.sourceDomain.indexOf(u.b.FILE_PROTOCOL)||(r=t.sourceDomain),-1===c.a.receivedMessages.indexOf(t.id)&&(c.a.receivedMessages.push(t.id),Object(i.isWindowClosed)(n)&&!t.fireAndForget||(t.data&&(t.data=Object(o.a)(n,r,t.data)),P[t.type](n,r,t)))}}function A(e){try{Object(a.noop)(e.source)}catch(e){return}var n={source:e.source||e.sourceElement,origin:e.origin||e.originalEvent&&e.originalEvent.origin,data:e.data};try{r(12).emulateIERestrictions(n.source,window)}catch(e){return}j(n)}function W(e){return s.a.try(function(){if(!e.name)throw new Error("Expected options.name");var n=e.name,r=void 0,t=void 0;if("string"==typeof e.window){var d=document.getElementById(e.window);if(!d)throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be a valid element id");if("iframe"!==d.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be an iframe");if(!d.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");r=d.contentWindow}else if(e.window instanceof HTMLIFrameElement){if("iframe"!==e.window.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be an iframe");if(e.window&&!e.window.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");e.window&&e.window.contentWindow&&(r=e.window.contentWindow)}else r=e.window;if(!r)throw new Error("Expected options.window to be a window object, iframe, or iframe element id.");var f=r;t=e.domain||u.b.WILDCARD;var l=e.name+"_"+Object(a.uniqueID)();if(Object(i.isWindowClosed)(f))throw new Error("Target window is closed");var w=!1,p=c.a.requestPromises.get(f);p||(p=[],c.a.requestPromises.set(f,p));var h=s.a.try(function(){if(Object(i.isAncestor)(window,f))return Object(o.f)(f,e.timeout||u.a.CHILD_WINDOW_TIMEOUT)}).then(function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(Object(a.isRegex)(t)&&!e)return Object(o.g)(f)}).then(function(){var r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(Object(a.isRegex)(t)){if(!Object(i.matchDomain)(t,r))throw new Error("Remote window domain "+r+" does not match regex: "+t.toString());t=r}if("string"!=typeof t&&!Array.isArray(t))throw new TypeError("Expected domain to be a string or array");var o=t;return new s.a(function(r,t){var a=void 0;if(e.fireAndForget||function(e,n){c.a.responseListeners[e]=n}(l,a={name:n,window:f,domain:o,respond:function(e,n){e||(w=!0,p.splice(p.indexOf(h,1))),e?t(e):r(n)}}),m(f,{type:u.b.POST_MESSAGE_TYPE.REQUEST,hash:l,name:n,data:e.data,fireAndForget:e.fireAndForget},o).catch(t),e.fireAndForget)return r();var s=u.a.ACK_TIMEOUT,d=e.timeout||u.a.RES_TIMEOUT,g=100;setTimeout(function r(){if(!w){if(Object(i.isWindowClosed)(f))return a.ack?t(new Error("Window closed for "+n+" before response")):t(new Error("Window closed for "+n+" before ack"));if(s=Math.max(s-g,0),-1!==d&&(d=Math.max(d-g,0)),a.ack){if(-1===d)return;g=Math.min(d,2e3)}else{if(0===s)return t(new Error("No ack for postMessage "+n+" in "+Object(i.getDomain)()+" in "+u.a.ACK_TIMEOUT+"ms"));if(0===d)return t(new Error("No response for postMessage "+n+" in "+Object(i.getDomain)()+" in "+(e.timeout||u.a.RES_TIMEOUT)+"ms"))}setTimeout(r,g)}},g)})});return h.catch(function(){!function(e){c.a.erroredResponseListeners[e]=!0}(l),b(l)}),p.push(h),h})}function R(e,n,r,t){return(t=t||{}).window=e,t.name=n,t.data=r,W(t)}function I(e,n,r){var t=Object(i.getAncestor)();return t?R(t,e,n,r):new s.a(function(e,n){return n(new Error("Window does not have a parent"))})}function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.window)throw new Error("Expected options.window");var n=e.window;return{send:function(r,t){return R(n,r,t,e)}}}c.a.receivedMessages=c.a.receivedMessages||[],c.a.receiveMessage=j,c.a.requestPromises=c.a.requestPromises||new g.a,c.a.send=R;var M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function L(e){if(!e.name)throw new Error("Expected options.name");if(!e.handler)throw new Error("Expected options.handler");var n=e.name,r=e.window,t=e.domain,o={handler:e.handler,handleError:e.errorHandler||function(e){throw e},window:r,domain:t||u.b.WILDCARD,name:n},s=function e(n,r){var t=n.name,o=n.win,i=n.domain;if(!t||"string"!=typeof t)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var s=[],d=0,f=o,l=null==f?0:f.length;d<l;d++){var w=f[d];s.push(e({name:t,domain:i,win:w},r))}return{cancel:function(){for(var e=0,n=null==s?0:s.length;e<n;e++)s[e].cancel()}}}if(Array.isArray(i)){for(var p=[],h=0,m=i,O=null==m?0:m.length;h<O;h++){var y=m[h];p.push(e({name:t,win:o,domain:y},r))}return{cancel:function(){for(var e=0,n=null==p?0:p.length;e<n;e++)p[e].cancel()}}}var b=E({name:t,win:o,domain:i});if(o&&o!==u.b.WILDCARD||(o=c.a.WINDOW_WILDCARD),i=i||u.b.WILDCARD,b)throw o&&i?new Error("Request listener already exists for "+t+" on domain "+i.toString()+" for "+(o===c.a.WINDOW_WILDCARD?"wildcard":"specified")+" window"):o?new Error("Request listener already exists for "+t+" for "+(o===c.a.WINDOW_WILDCARD?"wildcard":"specified")+" window"):i?new Error("Request listener already exists for "+t+" on domain "+i.toString()):new Error("Request listener already exists for "+t);var _=c.a.requestListeners,S=_[t];S||(S=new g.a,_[t]=S);var P=S.get(o);P||(P={},S.set(o,P));var T=i.toString(),j=P[v],A=void 0;return Object(a.isRegex)(i)?(j||(j=[],P[v]=j),A={regex:i,listener:r},j.push(A)):P[T]=r,{cancel:function(){P&&(delete P[T],o&&0===Object.keys(P).length&&S.delete(o),A&&j.splice(j.indexOf(A,1)))}}}({name:n,win:r,domain:t},o);if(e.once){var d=o.handler;o.handler=Object(a.once)(function(){return s.cancel(),d.apply(this,arguments)})}if(o.window&&e.errorOnClose)var f=Object(a.safeInterval)(function(){r&&"object"===(void 0===r?"undefined":M(r))&&Object(i.isWindowClosed)(r)&&(f.cancel(),o.handleError(new Error("Post message target window is closed")))},50);return{cancel:function(){s.cancel()}}}function C(e,n,r){return"function"==typeof n&&(r=n,n={}),(n=n||{}).name=e,n.handler=r||n.handler,L(n)}function N(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];"function"==typeof n&&(r=n,n={}),n=n||{},r=r||n.handler;var t=n.errorHandler,o=new s.a(function(o,i){(n=n||{}).name=e,n.once=!0,n.handler=function(e){if(o(e),r)return r(e)},n.errorHandler=function(e){if(i(e),t)return t(e)}}),i=L(n);return o.cancel=i.cancel,o}function B(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{on:function(n,r){return C(n,e,r)}}}function x(){delete window[u.b.WINDOW_PROPS.POSTROBOT],window.removeEventListener("message",A)}c.a.on=C;var k=Object(i.getAncestor)();function G(e){var n=c.a.requestPromises.get(e);if(n)for(var r=0,t=null==n?0:n.length;r<t;r++)n[r].reject(new Error("No response from window - cleaned up"));c.a.popupWindowsByWin&&c.a.popupWindowsByWin.delete(e),c.a.remoteWindows&&c.a.remoteWindows.delete(e),c.a.requestPromises.delete(e),c.a.methods.delete(e),c.a.readyPromises.delete(e)}var U=r(23);function F(){c.a.initialized||(Object(a.addEventListener)(window,"message",A),r(9).openTunnelToOpener(),Object(o.c)(),Object(o.d)({on:C,send:R})),c.a.initialized=!0}F(),r.d(n,"cleanUpWindow",function(){return G}),r.d(n,"Promise",function(){return s.a}),r.d(n,"bridge",function(){return U}),r.d(n,"init",function(){return F}),r.d(n,"parent",function(){return k}),r.d(n,"send",function(){return R}),r.d(n,"request",function(){return W}),r.d(n,"sendToParent",function(){return I}),r.d(n,"client",function(){return D}),r.d(n,"on",function(){return C}),r.d(n,"listen",function(){return L}),r.d(n,"once",function(){return N}),r.d(n,"listener",function(){return B}),r.d(n,"CONFIG",function(){return u.a}),r.d(n,"CONSTANTS",function(){return u.b}),r.d(n,"disable",function(){return x}),n.default=t},function(e,n,r){"use strict";function t(e){return"[object RegExp]"===Object.prototype.toString.call(e)}n.h=u,n.g=c,n.a=d,n.c=f,n.j=l,n.o=w,n.f=h,n.r=_,n.s=function(e){if(function(){for(var e=0;e<b.length;e++)v(b[e])&&(b.splice(e,1),y.splice(e,1));for(var n=0;n<y.length;n++)_(y[n])&&(b.splice(n,1),y.splice(n,1))}(),e&&e.contentWindow)try{y.push(e.contentWindow),b.push(e)}catch(e){}},n.i=function(e){return(e=e||window).navigator.mockUserAgent||e.navigator.userAgent},n.e=function(e,n){for(var r=h(e),t=0,o=null==r?0:r.length;t<o;t++){var i=r[t];try{if(w(i)&&i.name===n&&-1!==r.indexOf(i))return i}catch(e){}}try{if(-1!==r.indexOf(e.frames[n]))return e.frames[n]}catch(e){}try{if(-1!==r.indexOf(e[n]))return e[n]}catch(e){}},n.m=function(e,n){return e===c(n)},n.b=E,n.k=function(e,n){var r=E(n);if(r)return r===e;if(n===e)return!1;if(g(n)===n)return!1;for(var t=0,o=h(e),i=null==o?0:o.length;t<i;t++)if(o[t]===n)return!0;return!1},n.n=function(){return Boolean(c(window))},n.l=function(){return Boolean(u(window))},n.p=function(e,n){var r=g(e)||e,t=g(n)||n;try{if(r&&t)return r===t}catch(e){}var o=O(e),i=O(n);if(S(o,i))return!0;var a=c(r),u=c(t);return!(a&&S(O(a),i)||(u&&S(O(u),o),1))},n.t=function e(n,r){if("string"==typeof n){if("string"==typeof r)return n===o.WILDCARD||r===n;if(t(r))return!1;if(Array.isArray(r))return!1}return t(n)?t(r)?n.toString()===r.toString():!Array.isArray(r)&&Boolean(r.match(n)):!!Array.isArray(n)&&(Array.isArray(r)?JSON.stringify(n)===JSON.stringify(r):!t(r)&&n.some(function(n){return e(n,r)}))},n.u=function(e){return Array.isArray(e)?"("+e.join(" | ")+")":t(e)?"RegExp("+e.toString():e.toString()},n.d=function(e){return e.match(/^(https?|mock|file):\/\//)?e.split("/").slice(0,3).join("/"):f()},n.q=function(e){try{if(e===window)return!0}catch(e){if(e&&e.message===i)return!0}try{if("[object Window]"===Object.prototype.toString.call(e))return!0}catch(e){if(e&&e.message===i)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.self===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.parent===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.top===e)return!0}catch(e){if(e&&e.message===i)return!0}try{e&&e.__cross_domain_utils_window_check__}catch(e){return!0}return!1};var o={MOCK_PROTOCOL:"mock:",FILE_PROTOCOL:"file:",ABOUT_PROTOCOL:"about:",WILDCARD:"*"},i="Call was rejected by callee.\r\n";function a(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===o.ABOUT_PROTOCOL}function u(e){if(e)try{if(e.parent&&e.parent!==e)return e.parent}catch(e){}}function c(e){if(e&&!u(e))try{return e.opener}catch(e){}}function s(e){try{return e&&e.location&&e.location.href,!0}catch(e){}return!1}function d(e){var n=(e=e||window).location;if(!n)throw new Error("Can not read window location");var r=n.protocol;if(!r)throw new Error("Can not read window protocol");if(r===o.FILE_PROTOCOL)return o.FILE_PROTOCOL+"//";if(r===o.ABOUT_PROTOCOL){var t=u(e);return t&&s(t)?d(t):o.ABOUT_PROTOCOL+"//"}var i=n.host;if(!i)throw new Error("Can not read window host");return r+"//"+i}function f(e){var n=d(e=e||window);return n&&e.mockDomain&&0===e.mockDomain.indexOf(o.MOCK_PROTOCOL)?e.mockDomain:n}function l(e){try{if(e===window)return!0}catch(e){}try{var n=Object.getOwnPropertyDescriptor(e,"location");if(n&&!1===n.enumerable)return!1}catch(e){}try{if(a(e)&&s(e))return!0}catch(e){}try{if(d(e)===d(window))return!0}catch(e){}return!1}function w(e){if(!l(e))return!1;try{if(e===window)return!0;if(a(e)&&s(e))return!0;if(f(window)===f(e))return!0}catch(e){}return!1}function p(e,n){if(!e||!n)return!1;var r=u(n);return r?r===e:-1!==function(e){var n=[];try{for(;e.parent!==e;)n.push(e.parent),e=e.parent}catch(e){}return n}(n).indexOf(e)}function h(e){var n=[],r=void 0;try{r=e.frames}catch(n){r=e}var t=void 0;try{t=r.length}catch(e){}if(0===t)return n;if(t){for(var o=0;o<t;o++){var i=void 0;try{i=r[o]}catch(e){continue}n.push(i)}return n}for(var a=0;a<100;a++){var u=void 0;try{u=r[a]}catch(e){return n}if(!u)return n;n.push(u)}return n}function m(e){for(var n=[],r=0,t=h(e),o=null==t?0:t.length;r<o;r++){var i=t[r];n.push(i);for(var a=0,u=m(i),c=null==u?0:u.length;a<c;a++){var s=u[a];n.push(s)}}return n}function g(e){if(e){try{if(e.top)return e.top}catch(e){}if(u(e)===e)return e;try{if(p(window,e)&&window.top)return window.top}catch(e){}try{if(p(e,window)&&window.top)return window.top}catch(e){}for(var n=0,r=m(e),t=null==r?0:r.length;n<t;n++){var o=r[n];try{if(o.top)return o.top}catch(e){}if(u(o)===o)return o}}}function O(e){var n=g(e);if(!n)throw new Error("Can not determine top window");return[].concat(m(n),[n])}function v(e){if(!e.contentWindow)return!0;if(!e.parentNode)return!0;var n=e.ownerDocument;return!(!n||!n.body||n.body.contains(e))}var y=[],b=[];function _(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(e===window)return!1}catch(e){return!0}try{if(!e)return!0}catch(e){return!0}try{if(e.closed)return!0}catch(e){return!e||e.message!==i}if(n&&w(e))try{if(e.mockclosed)return!0}catch(e){}try{if(!e.parent||!e.top)return!0}catch(e){}var r=function(e,n){for(var r=0;r<e.length;r++)try{if(e[r]===n)return r}catch(e){}return-1}(y,e);if(-1!==r){var t=b[r];if(t&&v(t))return!0}return!1}function E(e){return c(e=e||window)||u(e)||void 0}function S(e,n){for(var r=0,t=null==e?0:e.length;r<t;r++)for(var o=e[r],i=0,a=null==n?0:n.length;i<a;i++)if(o===n[i])return!0;return!1}},function(e,n){},function(e,n,r){"use strict";r(6),r(11)},function(e,n,r){"use strict";r(6)},function(e,n,r){"use strict";function t(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function o(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}r(6),r(8),"function"==typeof Symbol&&Symbol.iterator,Object.assign,function(e){function n(r){return t(this,n),function(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}(this,e.call(this,"",{},r))}(function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)})(n,e),n.prototype.toString=function(){return this.childrenToString()}}(function(){function e(n,r,o){t(this,e),this.name=n,this.props=r,this.children=o}return e.prototype.toString=function(){var e=this.name,n=this.propsToString(),r=this.childrenToString();return"<"+e+(n?" ":"")+n+">"+r+"</"+e+">"},e.prototype.propsToString=function(){var e=this.props;return e?Object.keys(e).filter(function(n){return"innerHTML"!==n&&e&&!1!==e[n]}).map(function(n){if(e){var r=e[n];if(!0===r)return""+o(n);if("string"==typeof r)return o(n)+'="'+o(r)+'"'}return""}).filter(Boolean).join(" "):""},e.prototype.childrenToString=function(){if(this.props&&this.props.innerHTML)return this.props.innerHTML;if(!this.children)return"";var n="";return function r(t){for(var i=0,a=null==t?0:t.length;i<a;i++){var u=t[i];null!==u&&void 0!==u&&(Array.isArray(u)?r(u):n+=u instanceof e?u.toString():o(u))}}(this.children),n},e}())},function(e,n,r){"use strict";r(2),r(0)},function(e,n){},function(e,n,r){"use strict";r(6)},function(e,n,r){"use strict"},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r(9);r.d(n,"openBridge",function(){return t.openBridge}),r.d(n,"linkUrl",function(){return t.linkUrl}),r.d(n,"isBridge",function(){return t.isBridge}),r.d(n,"needsBridge",function(){return t.needsBridge}),r.d(n,"needsBridgeForBrowser",function(){return t.needsBridgeForBrowser}),r.d(n,"hasBridge",function(){return t.hasBridge}),r.d(n,"needsBridgeForWin",function(){return t.needsBridgeForWin}),r.d(n,"needsBridgeForDomain",function(){return t.needsBridgeForDomain}),r.d(n,"openTunnelToOpener",function(){return t.openTunnelToOpener}),r.d(n,"destroyBridges",function(){return t.destroyBridges})}])}); | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("postRobot",[],n):"object"==typeof exports?exports.postRobot=n():e.postRobot=n()}("undefined"!=typeof self?self:this,function(){return function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.p="",r(r.s=13)}([function(e,n,r){"use strict";var t=r(14);r.d(n,"getActualDomain",function(){return t.a}),r.d(n,"getAncestor",function(){return t.b}),r.d(n,"getDomain",function(){return t.c}),r.d(n,"getDomainFromUrl",function(){return t.d}),r.d(n,"getFrameByName",function(){return t.e}),r.d(n,"getFrames",function(){return t.f}),r.d(n,"getOpener",function(){return t.g}),r.d(n,"getParent",function(){return t.h}),r.d(n,"getUserAgent",function(){return t.i}),r.d(n,"isActuallySameDomain",function(){return t.j}),r.d(n,"isAncestor",function(){return t.k}),r.d(n,"isIframe",function(){return t.l}),r.d(n,"isOpener",function(){return t.m}),r.d(n,"isPopup",function(){return t.n}),r.d(n,"isSameDomain",function(){return t.o}),r.d(n,"isSameTopWindow",function(){return t.p}),r.d(n,"isWindow",function(){return t.q}),r.d(n,"isWindowClosed",function(){return t.r}),r.d(n,"linkFrameWindow",function(){return t.s}),r.d(n,"matchDomain",function(){return t.t}),r.d(n,"stringifyDomainPattern",function(){return t.u});var o=r(15);r.n(o)},function(e,n,r){"use strict";var t,o={POST_MESSAGE_TYPE:{REQUEST:"postrobot_message_request",RESPONSE:"postrobot_message_response",ACK:"postrobot_message_ack"},POST_MESSAGE_ACK:{SUCCESS:"success",ERROR:"error"},POST_MESSAGE_NAMES:{METHOD:"postrobot_method",HELLO:"postrobot_ready",OPEN_TUNNEL:"postrobot_open_tunnel"},WINDOW_TYPES:{FULLPAGE:"fullpage",POPUP:"popup",IFRAME:"iframe"},WINDOW_PROPS:{POSTROBOT:"__postRobot__"},SERIALIZATION_TYPES:{METHOD:"postrobot_method",ERROR:"postrobot_error",PROMISE:"postrobot_promise",ZALGO_PROMISE:"postrobot_zalgo_promise",REGEX:"regex"},SEND_STRATEGIES:{POST_MESSAGE:"postrobot_post_message",BRIDGE:"postrobot_bridge",GLOBAL:"postrobot_global"},MOCK_PROTOCOL:"mock:",FILE_PROTOCOL:"file:",BRIDGE_NAME_PREFIX:"__postrobot_bridge__",POSTROBOT_PROXY:"__postrobot_proxy__",WILDCARD:"*"},i={METHOD:"postrobot_method",HELLO:"postrobot_hello",OPEN_TUNNEL:"postrobot_open_tunnel"},a=Object.keys(i).map(function(e){return i[e]}),u={ALLOW_POSTMESSAGE_POPUP:!("__ALLOW_POSTMESSAGE_POPUP__"in window)||window.__ALLOW_POSTMESSAGE_POPUP__,BRIDGE_TIMEOUT:5e3,CHILD_WINDOW_TIMEOUT:5e3,ACK_TIMEOUT:2e3,ACK_TIMEOUT_KNOWN:1e4,RES_TIMEOUT:-1,ALLOWED_POST_MESSAGE_METHODS:(t={},t[o.SEND_STRATEGIES.POST_MESSAGE]=!0,t[o.SEND_STRATEGIES.BRIDGE]=!0,t[o.SEND_STRATEGIES.GLOBAL]=!0,t)};0===window.location.href.indexOf(o.FILE_PROTOCOL)&&(u.ALLOW_POSTMESSAGE_POPUP=!0),r.d(n,"a",function(){return u}),r.d(n,"b",function(){return o}),r.d(n,!1,function(){return i}),r.d(n,!1,function(){return a})},function(e,n,r){"use strict";function t(e){try{if(!e)return!1;if("undefined"!=typeof Promise&&e instanceof Promise)return!0;if("undefined"!=typeof window&&window.Window&&e instanceof window.Window)return!1;if("undefined"!=typeof window&&window.constructor&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var r=n.call(e);if("[object Window]"===r||"[object global]"===r||"[object DOMWindow]"===r)return!1}if("function"==typeof e.then)return!0}catch(e){return!1}return!1}function o(){var e=void 0;if("undefined"!=typeof window)e=window;else{if("undefined"==typeof window)throw new TypeError("Can not find global");e=window}var n=e.__zalgopromise__=e.__zalgopromise__||{};return n.flushPromises=n.flushPromises||[],n.activeCount=n.activeCount||0,n.possiblyUnhandledPromiseHandlers=n.possiblyUnhandledPromiseHandlers||[],n.dispatchedErrors=n.dispatchedErrors||[],n}var i=function(){function e(n){var r=this;if(function(n,r){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],n){var t=void 0,o=void 0,i=!1,a=!1,u=!1;try{n(function(e){u?r.resolve(e):(i=!0,t=e)},function(e){u?r.reject(e):(a=!0,o=e)})}catch(e){return void this.reject(e)}u=!0,i?this.resolve(t):a&&this.reject(o)}}return e.prototype.resolve=function(e){if(this.resolved||this.rejected)return this;if(t(e))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},e.prototype.reject=function(e){var n=this;if(this.resolved||this.rejected)return this;if(t(e))throw new Error("Can not reject promise with another promise");if(!e){var r=e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e);e=new Error("Expected reject to be called with Error, got "+r)}return this.rejected=!0,this.error=e,this.errorHandled||setTimeout(function(){n.errorHandled||function(e,n){if(-1===o().dispatchedErrors.indexOf(e)){o().dispatchedErrors.push(e),setTimeout(function(){throw e},1);for(var r=0;r<o().possiblyUnhandledPromiseHandlers.length;r++)o().possiblyUnhandledPromiseHandlers[r](e,n)}}(e,n)},1),this.dispatch(),this},e.prototype.asyncReject=function(e){this.errorHandled=!0,this.reject(e)},e.prototype.dispatch=function(){var n=this,r=this.dispatching,i=this.resolved,a=this.rejected,u=this.handlers;if(!r&&(i||a)){this.dispatching=!0,o().activeCount+=1;for(var c=function(r){var o=u[r],c=o.onSuccess,s=o.onError,d=o.promise,f=void 0;if(i)try{f=c?c(n.value):n.value}catch(e){return d.reject(e),"continue"}else if(a){if(!s)return d.reject(n.error),"continue";try{f=s(n.error)}catch(e){return d.reject(e),"continue"}}f instanceof e&&(f.resolved||f.rejected)?(f.resolved?d.resolve(f.value):d.reject(f.error),f.errorHandled=!0):t(f)?f instanceof e&&(f.resolved||f.rejected)?f.resolved?d.resolve(f.value):d.reject(f.error):f.then(function(e){d.resolve(e)},function(e){d.reject(e)}):d.resolve(f)},s=0;s<u.length;s++)c(s);u.length=0,this.dispatching=!1,o().activeCount-=1,0===o().activeCount&&e.flushQueue()}},e.prototype.then=function(n,r){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.then expected a function for success handler");if(r&&"function"!=typeof r&&!r.call)throw new Error("Promise.then expected a function for error handler");var t=new e;return this.handlers.push({promise:t,onSuccess:n,onError:r}),this.errorHandled=!0,this.dispatch(),t},e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.finally=function(n){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return e.try(n).then(function(){return r})},function(r){return e.try(n).then(function(){throw r})})},e.prototype.timeout=function(e,n){var r=this;if(this.resolved||this.rejected)return this;var t=setTimeout(function(){r.resolved||r.rejected||r.reject(n||new Error("Promise timed out after "+e+"ms"))},e);return this.then(function(e){return clearTimeout(t),e})},e.prototype.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},e.resolve=function(n){return n instanceof e?n:t(n)?new e(function(e,r){return n.then(e,r)}):(new e).resolve(n)},e.reject=function(n){return(new e).reject(n)},e.all=function(n){var r=new e,o=n.length,i=[];if(!o)return r.resolve(i),r;for(var a=function(a){var u=n[a];if(u instanceof e){if(u.resolved)return i[a]=u.value,o-=1,"continue"}else if(!t(u))return i[a]=u,o-=1,"continue";e.resolve(u).then(function(e){i[a]=e,0==(o-=1)&&r.resolve(i)},function(e){r.reject(e)})},u=0;u<n.length;u++)a(u);return 0===o&&r.resolve(i),r},e.hash=function(n){var r={};return e.all(Object.keys(n).map(function(t){return e.resolve(n[t]).then(function(e){r[t]=e})})).then(function(){return r})},e.map=function(n,r){return e.all(n.map(r))},e.onPossiblyUnhandledException=function(e){return function(e){return o().possiblyUnhandledPromiseHandlers.push(e),{cancel:function(){o().possiblyUnhandledPromiseHandlers.splice(o().possiblyUnhandledPromiseHandlers.indexOf(e),1)}}}(e)},e.try=function(n,r,t){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.try expected a function");var o=void 0;try{o=n.apply(r,t||[])}catch(n){return e.reject(n)}return e.resolve(o)},e.delay=function(n){return new e(function(e){setTimeout(e,n)})},e.isPromise=function(n){return!!(n&&n instanceof e)||t(n)},e.flush=function(){var n=new e;return o().flushPromises.push(n),0===o().activeCount&&e.flushQueue(),n},e.flushQueue=function(){var e=o().flushPromises;o().flushPromises=[];for(var n=0,r=null==e?0:e.length;n<r;n++)e[n].resolve()},e}();r.d(n,"a",function(){return i})},function(e,n,r){"use strict";r.d(n,"a",function(){return o});var t=r(1),o=window[t.b.WINDOW_PROPS.POSTROBOT]=window[t.b.WINDOW_PROPS.POSTROBOT]||{};o.registerSelf=function(){}},function(e,n,r){"use strict";r(10);var t=r(8);r.d(n,"addEventListener",function(){return t.a}),r(16),r(17),r(18),r(11);var o=r(7);r.d(n,"isRegex",function(){return o.f}),r.d(n,"noop",function(){return o.h}),r.d(n,"once",function(){return o.i}),r.d(n,"replaceObject",function(){return o.m}),r.d(n,"safeInterval",function(){return o.n}),r.d(n,"stringifyError",function(){return o.p}),r.d(n,"uniqueID",function(){return o.r}),r.d(n,"weakMapMemoize",function(){return o.s}),r(19);var i=r(20);r.n(i),r(21),r(22)},function(e,n,r){"use strict";r.d({},"WeakMap",function(){return u});var t=r(0);function o(e,n){for(var r=0;r<e.length;r++)try{if(e[r]===n)return r}catch(e){}return-1}var i=Object.defineProperty,a=Date.now()%1e9,u=function(){function e(){if(function(n,r){if(!(n instanceof e))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 e=new WeakMap,n={};return Object.freeze(n),e.set(n,"__testvalue__"),"__testvalue__"===e.get(n)}catch(e){return!1}}())try{this.weakmap=new WeakMap}catch(e){}this.keys=[],this.values=[]}return e.prototype._cleanupClosedWindows=function(){for(var e=this.weakmap,n=this.keys,r=0;r<n.length;r++){var o=n[r];if(Object(t.isWindow)(o)&&Object(t.isWindowClosed)(o)){if(e)try{e.delete(o)}catch(e){}n.splice(r,1),this.values.splice(r,1),r-=1}}},e.prototype.isSafeToReadWrite=function(e){if(Object(t.isWindow)(e))return!1;try{e&&e.self,e&&e[this.name]}catch(e){return!1}return!0},e.prototype.set=function(e,n){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.set(e,n)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var t=this.name,a=e[t];a&&a[0]===e?a[1]=n:i(e,t,{value:[e,n],writable:!0})}else{this._cleanupClosedWindows();var u=this.keys,c=this.values,s=o(u,e);-1===s?(u.push(e),c.push(n)):c[s]=n}},e.prototype.get=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{if(n.has(e))return n.get(e)}catch(e){delete this.weakmap}if(!this.isSafeToReadWrite(e)){this._cleanupClosedWindows();var r=o(this.keys,e);if(-1===r)return;return this.values[r]}var t=e[this.name];if(t&&t[0]===e)return t[1]},e.prototype.delete=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{n.delete(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var r=e[this.name];r&&r[0]===e&&(r[0]=r[1]=void 0)}else{this._cleanupClosedWindows();var t=this.keys,i=o(t,e);-1!==i&&(t.splice(i,1),this.values.splice(i,1))}},e.prototype.has=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{return n.has(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var r=e[this.name];return!(!r||r[0]!==e)}return this._cleanupClosedWindows(),-1!==o(this.keys,e)},e.prototype.getOrSet=function(e,n){if(this.has(e))return this.get(e);var r=n();return this.set(e,r),r},e}();r.d(n,"a",function(){return u})},function(e,n,r){"use strict";var t=r(0),o=r(1);function i(){return Object(t.isPopup)()?o.b.WINDOW_TYPES.POPUP:Object(t.isIframe)()?o.b.WINDOW_TYPES.IFRAME:o.b.WINDOW_TYPES.FULLPAGE}function a(){return!!Object(t.getUserAgent)(window).match(/MSIE|trident|edge\/12|edge\/13/i)||!o.a.ALLOW_POSTMESSAGE_POPUP}var u=r(5),c=r(2),s=r(4),d=r(3),f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};d.a.methods=d.a.methods||new u.a;var l=Object(s.once)(function(){d.a.on(o.b.POST_MESSAGE_NAMES.METHOD,{origin:o.b.WILDCARD},function(e){var n=e.source,r=e.origin,o=e.data,i=d.a.methods.get(n);if(!i)throw new Error("Could not find any methods this window has privileges to call");var a=i[o.id];if(!a)throw new Error("Could not find method with id: "+o.id);if(!Object(t.matchDomain)(a.domain,r))throw new Error("Method domain "+a.domain+" does not match origin "+r);return c.a.try(function(){return a.method.apply({source:n,origin:r,data:o},o.args)}).then(function(e){return{result:e,id:o.id,name:o.name}})})});function w(e,n){return"object"===(void 0===e?"undefined":f(e))&&null!==e&&e.__type__===n}function p(e,n,r,t){var i=Object(s.uniqueID)(),a=d.a.methods.get(e);return a||(a={},d.a.methods.set(e,a)),a[i]={domain:n,method:r},{__type__:o.b.SERIALIZATION_TYPES.METHOD,__id__:i,__name__:t}}function h(e,n,r){return Object(s.replaceObject)({obj:r},function(r,t){return"function"==typeof r?p(e,n,r,t.toString()):r instanceof Error?(i=r,{__type__:o.b.SERIALIZATION_TYPES.ERROR,__message__:Object(s.stringifyError)(i),__code__:i.code}):window.Promise&&r instanceof window.Promise?function(e,n,r,t){return{__type__:o.b.SERIALIZATION_TYPES.PROMISE,__then__:p(e,n,function(e,n){return r.then(e,n)},t+".then")}}(e,n,r,t.toString()):c.a.isPromise(r)?function(e,n,r,t){return{__type__:o.b.SERIALIZATION_TYPES.ZALGO_PROMISE,__then__:p(e,n,function(e,n){return r.then(e,n)},t+".then")}}(e,n,r,t.toString()):Object(s.isRegex)(r)?(a=r,{__type__:o.b.SERIALIZATION_TYPES.REGEX,__source__:a.source}):r;var i,a}).obj}function m(e,n,r){function t(){var t=Array.prototype.slice.call(arguments);return d.a.send(e,o.b.POST_MESSAGE_NAMES.METHOD,{id:r.__id__,name:r.__name__,args:t},{domain:n,timeout:-1}).then(function(e){return e.data.result},function(e){throw e})}return t.__name__=r.__name__,t.__xdomain__=!0,t.source=e,t.origin=n,t}function g(e,n,r){var t=new Error(r.__message__);return r.__code__&&(t.code=r.__code__),t}function O(e,n,r){return new c.a(function(t,o){return m(e,n,r.__then__)(t,o)})}function v(e,n,r){return window.Promise?new window.Promise(function(t,o){return m(e,n,r.__then__)(t,o)}):O(e,n,r)}function y(e,n,r){return new RegExp(r.__source__)}function b(e,n,r){return Object(s.replaceObject)({obj:r},function(r){return"object"!==(void 0===r?"undefined":f(r))||null===r?r:w(r,o.b.SERIALIZATION_TYPES.METHOD)?m(e,n,r):w(r,o.b.SERIALIZATION_TYPES.ERROR)?g(0,0,r):w(r,o.b.SERIALIZATION_TYPES.PROMISE)?v(e,n,r):w(r,o.b.SERIALIZATION_TYPES.ZALGO_PROMISE)?O(e,n,r):w(r,o.b.SERIALIZATION_TYPES.REGEX)?y(0,0,r):r}).obj}function _(e){d.a.on(o.b.POST_MESSAGE_NAMES.HELLO,{domain:o.b.WILDCARD},function(n){var r=n.source,t=n.origin;return e({source:r,origin:t})})}function E(e){return d.a.send(e,o.b.POST_MESSAGE_NAMES.HELLO,{},{domain:o.b.WILDCARD,timeout:-1}).then(function(e){return{origin:e.origin}})}function S(e){d.a.knownWindows.set(e,!0)}function P(e){return d.a.knownWindows.get(e)}function T(){_(function(e){var n=e.source,r=e.origin,t=d.a.readyPromises.get(n)||new c.a;t.resolve({origin:r}),d.a.readyPromises.set(n,t)});var e=Object(t.getAncestor)();e&&E(e).catch(s.noop)}function j(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Window",t=d.a.readyPromises.get(e);return t||(t=new c.a,d.a.readyPromises.set(e,t),-1!==n&&setTimeout(function(){return t.reject(new Error(r+" did not load after "+n+"ms"))},n),t)}d.a.readyPromises=d.a.readyPromises||new u.a,d.a.knownWindows=d.a.knownWindows||new u.a,r.d(n,"b",function(){return i}),r.d(n,"g",function(){return a}),r.d(n,"e",function(){return l}),r.d(n,!1,function(){return p}),r.d(n,"j",function(){return h}),r.d(n,!1,function(){return m}),r.d(n,!1,function(){return g}),r.d(n,!1,function(){return O}),r.d(n,!1,function(){return v}),r.d(n,!1,function(){return y}),r.d(n,"a",function(){return b}),r.d(n,!1,function(){return _}),r.d(n,"i",function(){return E}),r.d(n,"f",function(){return S}),r.d(n,"d",function(){return P}),r.d(n,"c",function(){return T}),r.d(n,"h",function(){return j})},function(e,n,r){"use strict";n.r=u,n.d=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")},n.g=function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=new o.a;function i(){for(var n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];var u=t.getOrSet(r.thisNamespace?this:e,function(){return{}}),c=s(o),d=r.time;if(u[c]&&d&&Date.now()-u[c].time<d&&delete u[c],u[c])return u[c].value;i.__calling__=!0;var f=Date.now(),l=e.apply(this,arguments);return i.__calling__=!1,u[c]={time:f,value:l},u[c].value}return i.reset=function(){t.delete(r.thisNamespace?n:e)},r.name&&(i.displayName=r.name+":memoized"),i},n.j=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};function r(){return t.a.try(e,this,arguments)}return n.name&&(r.displayName=n.name+":promisified"),r},n.e=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],t=e.__inline_memoize_cache__=e.__inline_memoize_cache__||{},o=s(r);return t.hasOwnProperty(o)?t[o]:t[o]=n.apply(void 0,r)},n.h=function(){},n.i=function(e){var n=!1;return function(){if(!n)return n=!0,e.apply(this,arguments)}},n.p=function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(r>=3)return"stringifyError stack overflow";try{if(!n)return"<unknown error: "+Object.prototype.toString.call(n)+">";if("string"==typeof n)return n;if(n instanceof Error){var t=n&&n.stack,o=n&&n.message;if(t&&o)return-1!==t.indexOf(o)?t:o+"\n"+t;if(t)return t;if(o)return o}return"function"==typeof n.toString?n.toString():Object.prototype.toString.call(n)}catch(n){return"Error while stringifying error: "+e(n,r+1)}},n.o=function(e){return"string"==typeof e?e:e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)},n.c=function(e,n){if(!n)return e;if(Object.assign)return Object.assign(e,n);for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r]);return e},n.k=function(e,n,r){var t=[];return e.replace(n,function(e){t.push(r?r.apply(null,arguments):e)}),t},n.q=function(e){return"data:image/svg+xml;base64,"+a(e)},n.l=function(e,n){var r=[];return e.replace(n,function(e){return r.push(e),""}),r},n.n=function(e,n){var r=void 0;return function t(){r=setTimeout(function(){e(),t()},n)}(),{cancel:function(){clearTimeout(r)}}},n.a=function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},n.m=function e(n,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(Array.isArray(n)){for(var o=n.length,i=[],a=function(o){d(i,o,function(){var i=t?t+"."+o:""+o,a=n[o],u=r(a,o,i);return(l(u)||Array.isArray(u))&&(u=e(u,r,i)),u})},u=0;u<o;u++)a(u);return i}if(l(n)){var c={},s=function(o){if(!n.hasOwnProperty(o))return"continue";d(c,o,function(){var i=t?t+"."+o:""+o,a=n[o],u=r(a,o,i);return(l(u)||Array.isArray(u))&&(u=e(u,r,i)),u})};for(var f in n)s(f);return c}throw new Error("Pass an object or array")},n.b=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,r=void 0;return function(){var t=this,o=arguments;clearTimeout(r),r=setTimeout(function(){return e.apply(t,o)},n)}},n.f=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},r.d(n,"s",function(){return w});var t=r(2),o=r(5),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function a(e){return window.btoa(e)}function u(){var e="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})+"_"+a((new Date).toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var c=void 0;function s(e){try{return JSON.stringify(Array.prototype.slice.call(e),function(e,n){return"function"==typeof n?"memoize["+function(e){if(c=c||new o.a,null===e||void 0===e||"object"!==(void 0===e?"undefined":i(e))&&"function"!=typeof e)throw new Error("Invalid object");var n=c.get(e);return n||(n=(void 0===e?"undefined":i(e))+":"+u(),c.set(e,n)),n}(n)+"]":n})}catch(e){throw new Error("Arguments not serializable -- can not be used to memoize")}}function d(e,n,r){if(Array.isArray(e)){if("number"!=typeof n)throw new TypeError("Array key must be number")}else if("object"===(void 0===e?"undefined":i(e))&&null!==e&&"string"!=typeof n)throw new TypeError("Object key must be string");Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:function(){delete e[n];var t=r();return e[n]=t,t},set:function(r){delete e[n],e[n]=r}})}function f(e){return"object"===(void 0===(n=e)?"undefined":i(n))&&null!==n&&"[object Object]"===Object.prototype.toString.call(e);var n}function l(e){if(!f(e))return!1;var n=e.constructor;if("function"!=typeof n)return!1;var r=n.prototype;return!!f(r)&&!!r.hasOwnProperty("isPrototypeOf")}var w=function(e){var n=new o.a;return function(r){var t=n.get(r);return void 0!==t?t:(void 0!==(t=e.call(this,r))&&n.set(r,t),t)}}},function(e,n,r){"use strict";r(2),r(0),r(5);var t=r(7);r(10),n.d=function e(){return Object(t.e)(e,function(){try{if("undefined"==typeof window)return!1;if(window.localStorage){var e=Math.random().toString();window.localStorage.setItem("__test__localStorage__",e);var n=window.localStorage.getItem("__test__localStorage__");if(window.localStorage.removeItem("__test__localStorage__"),e===n)return!0}}catch(e){}return!1})},n.b=function(e,n){e.appendChild(n)},n.g=function(e,n){try{e.document.open(),e.document.write(n),e.document.close()}catch(r){try{e.location="javascript: document.open(); document.write("+JSON.stringify(n)+"); document.close();"}catch(e){}}},n.f=function(e,n){var r=n.tagName.toLowerCase();if("html"!==r)throw new Error("Expected element to be html, got "+r);for(var t=e.document.documentElement;t.children&&t.children.length;)t.removeChild(t.children[0]);for(;n.children.length;)t.appendChild(n.children[0])},n.e=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.document;e.styleSheet?e.styleSheet.cssText=n:e.appendChild(r.createTextNode(n))},n.a=function(e,n,r){return e.addEventListener(n,r),{cancel:function(){e.removeEventListener(n,r)}}},n.c=function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.document,r=0,t=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.document;return Array.prototype.slice.call(n.querySelectorAll(e))}("script",e),o=null==t?0:t.length;r<o;r++){var i=t[r],a=i.parentNode;if(a){var u=n.createElement("script");u.text=i.textContent,a.replaceChild(u,i)}}},"function"==typeof Symbol&&Symbol.iterator,Object.assign,Object.create(Error.prototype)},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r(2),o=r(0),i=r(4),a=r(1),u=r(3);function c(e){try{u.a.tunnelWindows[e]&&delete u.a.tunnelWindows[e].source}catch(e){}delete u.a.tunnelWindows[e]}u.a.tunnelWindows=u.a.tunnelWindows||{},u.a.tunnelWindowId=0,u.a.openTunnelToParent=function(e){var n=e.name,r=e.source,t=e.canary,s=e.sendMessage,d=Object(o.getParent)(window);if(!d)throw new Error("No parent window found to open tunnel to");var f=function(e){var n=e.name,r=e.source,t=e.canary,a=e.sendMessage;return function(){for(var e=u.a.tunnelWindows,n=0,r=Object.keys(e),t=null==r?0:r.length;n<t;n++){var a=r[n],s=e[a];try{Object(i.noop)(s.source)}catch(e){c(a);continue}Object(o.isWindowClosed)(s.source)&&c(a)}}(),u.a.tunnelWindowId+=1,u.a.tunnelWindows[u.a.tunnelWindowId]={name:n,source:r,canary:t,sendMessage:a},u.a.tunnelWindowId}({name:n,source:r,canary:t,sendMessage:s});return u.a.send(d,a.b.POST_MESSAGE_NAMES.OPEN_TUNNEL,{name:n,sendMessage:function(){var e=function(e){return u.a.tunnelWindows[e]}(f);try{Object(i.noop)(e&&e.source)}catch(e){return void c(f)}if(e&&e.source&&!Object(o.isWindowClosed)(e.source)){try{e.canary()}catch(e){return}e.sendMessage.apply(this,arguments)}}},{domain:a.b.WILDCARD})};var s=r(5);function d(){return!!Object(o.getUserAgent)(window).match(/MSIE|trident|edge\/12|edge\/13/i)||!a.a.ALLOW_POSTMESSAGE_POPUP}function f(e){return!Object(o.isSameTopWindow)(window,e)}function l(e,n){if(e){if(Object(o.getDomain)()!==Object(o.getDomainFromUrl)(e))return!0}else if(n&&!Object(o.isSameDomain)(n))return!0;return!1}function w(e){var n=e.win,r=e.domain;return!(!d()||r&&!l(r,n)||n&&!f(n))}function p(e){var n=(e=e||Object(o.getDomainFromUrl)(e)).replace(/[^a-zA-Z0-9]+/g,"_");return a.b.BRIDGE_NAME_PREFIX+"_"+n}function h(){return Boolean(window.name&&window.name===p(Object(o.getDomain)()))}var m=new t.a(function(e){if(window.document&&window.document.body)return e(window.document.body);var n=setInterval(function(){if(window.document&&window.document.body)return clearInterval(n),e(window.document.body)},10)});function g(e){u.a.remoteWindows.set(e,{sendMessagePromise:new t.a})}function O(e){return u.a.remoteWindows.get(e)}function v(e,n,r){var i=O(e);if(!i)throw new Error("Window not found to register sendMessage to");var a=function(t,i,a){if(t!==e)throw new Error("Remote window does not match window");if(!Object(o.matchDomain)(a,n))throw new Error("Remote domain "+a+" does not match domain "+n);r(i)};i.sendMessagePromise.resolve(a),i.sendMessagePromise=t.a.resolve(a)}function y(e,n){var r=O(e);if(!r)throw new Error("Window not found on which to reject sendMessage");r.sendMessagePromise.asyncReject(n)}function b(e,n,r){var t=Object(o.isOpener)(window,e),i=Object(o.isOpener)(e,window);if(!t&&!i)throw new Error("Can only send messages to and from parent and popup windows");var a=O(e);if(!a)throw new Error("Window not found to send message to");return a.sendMessagePromise.then(function(t){return t(e,n,r)})}u.a.remoteWindows=u.a.remoteWindows||new s.a;var _=Object(i.weakMapMemoize)(function(e){return t.a.try(function(){for(var n=0,r=Object(o.getFrames)(e),i=null==r?0:r.length;n<i;n++){var u=r[n];try{if(u&&u!==window&&Object(o.isSameDomain)(u)&&u[a.b.WINDOW_PROPS.POSTROBOT])return u}catch(e){continue}}try{var c=Object(o.getFrameByName)(e,p(Object(o.getDomain)()));if(!c)return;return Object(o.isSameDomain)(c)&&c[a.b.WINDOW_PROPS.POSTROBOT]?c:new t.a(function(e){var n=void 0,r=void 0;n=setInterval(function(){if(c&&Object(o.isSameDomain)(c)&&c[a.b.WINDOW_PROPS.POSTROBOT])return clearInterval(n),clearTimeout(r),e(c)},100),r=setTimeout(function(){return clearInterval(n),e()},2e3)})}catch(e){}})});function E(){return t.a.try(function(){var e=Object(o.getOpener)(window);if(e&&w({win:e}))return g(e),_(e).then(function(n){return n?window.name?n[a.b.WINDOW_PROPS.POSTROBOT].openTunnelToParent({name:window.name,source:window,canary:function(){},sendMessage:function(e){try{Object(i.noop)(window)}catch(e){return}if(window&&!window.closed)try{u.a.receiveMessage({data:e,origin:this.origin,source:this.source})}catch(e){t.a.reject(e)}}}).then(function(n){var r=n.source,t=n.origin,o=n.data;if(r!==e)throw new Error("Source does not match opener");v(r,t,o.sendMessage)}).catch(function(n){throw y(e,n),n}):y(e,new Error("Can not register with opener: window does not have a name")):y(e,new Error("Can not register with opener: no bridge found in opener"))})})}var S=r(6);function P(e,n){return n=n||Object(o.getDomainFromUrl)(e),Boolean(u.a.bridges[n])}function T(e,n){return n=n||Object(o.getDomainFromUrl)(e),u.a.bridges[n]?u.a.bridges[n]:(u.a.bridges[n]=t.a.try(function(){if(Object(o.getDomain)()===n)throw new Error("Can not open bridge on the same domain as current domain: "+n);var r=p(n);if(Object(o.getFrameByName)(window,r))throw new Error("Frame with name "+r+" already exists on page");var i=function(e,n){var r=document.createElement("iframe");return r.setAttribute("name",e),r.setAttribute("id",e),r.setAttribute("style","display: none; margin: 0; padding: 0; border: 0px none; overflow: hidden;"),r.setAttribute("frameborder","0"),r.setAttribute("border","0"),r.setAttribute("scrolling","no"),r.setAttribute("allowTransparency","true"),r.setAttribute("tabindex","-1"),r.setAttribute("hidden","true"),r.setAttribute("title",""),r.setAttribute("role","presentation"),r.src=n,r}(r,e);return u.a.bridgeFrames[n]=i,m.then(function(r){r.appendChild(i);var o=i.contentWindow;return function(e,n){u.a.on(a.b.POST_MESSAGE_NAMES.OPEN_TUNNEL,{window:e,domain:n},function(e){var r=e.origin,o=e.data;if(r!==n)throw new Error("Domain "+n+" does not match origin "+r);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(!u.a.popupWindowsByName[o.name])throw new Error("Window with name "+o.name+" does not exist, or was not opened by this window");if(!u.a.popupWindowsByName[o.name].domain)throw new Error("We do not have a registered domain for window "+o.name);if(u.a.popupWindowsByName[o.name].domain!==r)throw new Error("Message origin "+r+" does not matched registered window origin "+u.a.popupWindowsByName[o.name].domain);return v(u.a.popupWindowsByName[o.name].win,n,o.sendMessage),{sendMessage:function(e){if(window&&!window.closed){var n=u.a.popupWindowsByName[o.name];if(n)try{u.a.receiveMessage({data:e,origin:n.domain,source:n.win})}catch(e){t.a.reject(e)}}}}})}(o,n),new t.a(function(e,n){i.onload=e,i.onerror=n}).then(function(){return Object(S.h)(o,a.a.BRIDGE_TIMEOUT,"Bridge "+e)}).then(function(){return o})})}),u.a.bridges[n])}u.a.bridges=u.a.bridges||{},u.a.bridgeFrames=u.a.bridgeFrames||{},u.a.popupWindowsByWin=u.a.popupWindowsByWin||new s.a,u.a.popupWindowsByName=u.a.popupWindowsByName||{};var j=window.open;function A(e,n){var r=u.a.popupWindowsByWin.get(e);r&&(r.domain=Object(o.getDomainFromUrl)(n),g(e))}function W(){for(var e=0,n=Object.keys(u.a.bridgeFrames),r=null==n?0:n.length;e<r;e++){var t=n[e],o=u.a.bridgeFrames[t];o.parentNode&&o.parentNode.removeChild(o)}u.a.bridgeFrames={},u.a.bridges={}}window.open=function(e,n,r,t){var i=e;if(e&&0===e.indexOf(a.b.MOCK_PROTOCOL)){var c=e.split("|");i=c[0],e=c[1]}i&&(i=Object(o.getDomainFromUrl)(i));var s=j.call(this,e,n,r,t);if(!s)return s;e&&g(s);for(var d=0,f=Object.keys(u.a.popupWindowsByName),l=null==f?0:f.length;d<l;d++){var w=f[d];Object(o.isWindowClosed)(u.a.popupWindowsByName[w].win)&&delete u.a.popupWindowsByName[w]}if(n&&s){var p=u.a.popupWindowsByWin.get(s)||u.a.popupWindowsByName[n]||{};p.name=p.name||n,p.win=p.win||s,p.domain=p.domain||i,u.a.popupWindowsByWin.set(s,p),u.a.popupWindowsByName[n]=p}return s},r.d(n,"openTunnelToOpener",function(){return E}),r.d(n,"needsBridgeForBrowser",function(){return d}),r.d(n,"needsBridgeForWin",function(){return f}),r.d(n,"needsBridgeForDomain",function(){return l}),r.d(n,"needsBridge",function(){return w}),r.d(n,"getBridgeName",function(){return p}),r.d(n,"isBridge",function(){return h}),r.d(n,"documentBodyReady",function(){return m}),r.d(n,"registerRemoteWindow",function(){return g}),r.d(n,"findRemoteWindow",function(){return O}),r.d(n,"registerRemoteSendMessage",function(){return v}),r.d(n,"rejectRemoteSendMessage",function(){return y}),r.d(n,"sendBridgeMessage",function(){return b}),r.d(n,"hasBridge",function(){return P}),r.d(n,"openBridge",function(){return T}),r.d(n,"linkUrl",function(){return A}),r.d(n,"destroyBridges",function(){return W})},function(e,n,r){"use strict";n.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(e,n,r){"use strict";n.a=function e(n){var r=n.name,i=n.version,a=void 0===i?"latest":i,u=n.lifetime,c=void 0===u?3e5:u;return Object(t.e)(e,function(){var e="__"+r+"_"+a+"_storage__",n=void 0;function i(r){var i=Object(o.d)(),a=void 0;if(n&&(a=n),!a&&i){var u=window.localStorage.getItem(e);u&&(a=JSON.parse(u))}a||(a=Object(t.d)()[e]),a||(a={id:Object(t.r)()}),a.id||(a.id=Object(t.r)()),n=a;var c=r(a);return i?window.localStorage.setItem(e,JSON.stringify(a)):Object(t.d)()[e]=a,n=null,c}function u(e){return i(function(n){var r=n.__session__,o=Date.now();return r&&o-r.created>c&&(r=null),r||(r={guid:Object(t.r)(),created:o}),n.__session__=r,e(r)})}return{getState:i,getID:function(){return i(function(e){return e.id})},getSessionState:function(e){return u(function(n){return n.state=n.state||{},e(n.state)})},getSessionID:function(){return u(function(e){return e.guid})}}},[{name:r,version:a,lifetime:c}])};var t=r(7),o=r(8)},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r(0),o=r(1);function i(e,n){if(!o.a.ALLOW_POSTMESSAGE_POPUP&&!1===Object(t.isSameTopWindow)(e,n))throw new Error("Can not send and receive post messages between two different windows (disabled to emulate IE)")}r.d(n,"emulateIERestrictions",function(){return i})},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t={};r.d(t,"markWindowKnown",function(){return o.f}),r.d(t,"cleanUpWindow",function(){return U}),r.d(t,"Promise",function(){return s.a}),r.d(t,"bridge",function(){return G}),r.d(t,"init",function(){return F}),r.d(t,"parent",function(){return k}),r.d(t,"send",function(){return R}),r.d(t,"request",function(){return W}),r.d(t,"sendToParent",function(){return D}),r.d(t,"client",function(){return I}),r.d(t,"on",function(){return C}),r.d(t,"listen",function(){return L}),r.d(t,"once",function(){return N}),r.d(t,"listener",function(){return B}),r.d(t,"CONFIG",function(){return u.a}),r.d(t,"CONSTANTS",function(){return u.b}),r.d(t,"disable",function(){return x});var o=r(6),i=r(0),a=r(4),u=r(1),c=r(3),s=r(2),d={};d[u.b.SEND_STRATEGIES.POST_MESSAGE]=function(e,n,t){try{r(12).emulateIERestrictions(window,e)}catch(e){return}(Array.isArray(t)?t:"string"==typeof t?[t]:[u.b.WILDCARD]).map(function(n){if(0===n.indexOf(u.b.MOCK_PROTOCOL)){if(window.location.protocol===u.b.FILE_PROTOCOL)return u.b.WILDCARD;if(!Object(i.isActuallySameDomain)(e))throw new Error("Attempting to send messsage to mock domain "+n+", but window is actually cross-domain");return Object(i.getActualDomain)(e)}return 0===n.indexOf(u.b.FILE_PROTOCOL)?u.b.WILDCARD:n}).forEach(function(r){return e.postMessage(n,r)})};var f=r(9),l=f.sendBridgeMessage,w=f.needsBridgeForBrowser,p=f.isBridge;d[u.b.SEND_STRATEGIES.BRIDGE]=function(e,n,r){if(w()||p()){if(Object(i.isSameDomain)(e))throw new Error("Post message through bridge disabled between same domain windows");if(!1!==Object(i.isSameTopWindow)(window,e))throw new Error("Can only use bridge to communicate between two different windows, not between frames");return l(e,n,r)}},d[u.b.SEND_STRATEGIES.GLOBAL]=function(e,n){if(Object(o.g)()){if(!Object(i.isSameDomain)(e))throw new Error("Post message through global disabled between different domain windows");if(!1!==Object(i.isSameTopWindow)(window,e))throw new Error("Can only use global to communicate between two different windows, not between frames");var r=e[u.b.WINDOW_PROPS.POSTROBOT];if(!r)throw new Error("Can not find postRobot global on foreign window");return r.receiveMessage({source:window,origin:Object(i.getDomain)(),data:n})}};var h=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e};function m(e,n,r){return s.a.try(function(){var t;if(n=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=Object(a.uniqueID)(),u=Object(o.b)(),c=Object(i.getDomain)(window);return h({},n,r,{sourceDomain:c,id:n.id||t,windowType:u})}(e,n,{data:Object(o.j)(e,r,n.data),domain:r}),Object(i.isWindowClosed)(e))throw new Error("Window is closed");var c=[],f=JSON.stringify(((t={})[u.b.WINDOW_PROPS.POSTROBOT]=n,t),null,2);return s.a.map(Object.keys(d),function(n){return s.a.try(function(){if(!u.a.ALLOWED_POST_MESSAGE_METHODS[n])throw new Error("Strategy disallowed: "+n);return d[n](e,f,r)}).then(function(){return c.push(n+": success"),!0},function(e){return c.push(n+": "+Object(a.stringifyError)(e)+"\n"),!1})}).then(function(e){var r=e.some(Boolean),t=n.type+" "+n.name+" "+(r?"success":"error")+":\n - "+c.join("\n - ")+"\n";if(!r)throw new Error(t)})})}var g=r(5);c.a.responseListeners=c.a.responseListeners||{},c.a.requestListeners=c.a.requestListeners||{},c.a.WINDOW_WILDCARD=c.a.WINDOW_WILDCARD||new function(){},c.a.erroredResponseListeners=c.a.erroredResponseListeners||{};var O,v="__domain_regex__";function y(e){return c.a.responseListeners[e]}function b(e){delete c.a.responseListeners[e]}function _(e){return Boolean(c.a.erroredResponseListeners[e])}function E(e){var n=e.name,r=e.win,t=e.domain;if(r===u.b.WILDCARD&&(r=null),t===u.b.WILDCARD&&(t=null),!n)throw new Error("Name required to get request listener");var o=c.a.requestListeners[n];if(o)for(var a=0,s=[r,c.a.WINDOW_WILDCARD],d=null==s?0:s.length;a<d;a++){var f=s[a],l=f&&o.get(f);if(l){if(t&&"string"==typeof t){if(l[t])return l[t];if(l[v])for(var w=0,p=l[v],h=null==p?0:p.length;w<h;w++){var m=p[w],g=m.regex,O=m.listener;if(Object(i.matchDomain)(g,t))return O}}if(l[u.b.WILDCARD])return l[u.b.WILDCARD]}}}var S=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},P=((O={})[u.b.POST_MESSAGE_TYPE.ACK]=function(e,n,r){if(!_(r.hash)){var t=y(r.hash);if(!t)throw new Error("No handler found for post message ack for message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(t.domain,n))throw new Error("Ack origin "+n+" does not match domain "+t.domain.toString());t.ack=!0}},O[u.b.POST_MESSAGE_TYPE.REQUEST]=function(e,n,r){var t=E({name:r.name,win:e,domain:n});function o(t){return r.fireAndForget||Object(i.isWindowClosed)(e)?s.a.resolve():m(e,S({target:r.originalSource,hash:r.hash,name:r.name},t),n)}return s.a.all([o({type:u.b.POST_MESSAGE_TYPE.ACK}),s.a.try(function(){if(!t)throw new Error("No handler found for post message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(t.domain,n))throw new Error("Request origin "+n+" does not match domain "+t.domain.toString());var o=r.data;return t.handler({source:e,origin:n,data:o})}).then(function(e){return o({type:u.b.POST_MESSAGE_TYPE.RESPONSE,ack:u.b.POST_MESSAGE_ACK.SUCCESS,data:e})},function(e){var n=Object(a.stringifyError)(e).replace(/^Error: /,""),r=e.code;return o({type:u.b.POST_MESSAGE_TYPE.RESPONSE,ack:u.b.POST_MESSAGE_ACK.ERROR,error:n,code:r})})]).then(a.noop).catch(function(e){if(t&&t.handleError)return t.handleError(e);throw e})},O[u.b.POST_MESSAGE_TYPE.RESPONSE]=function(e,n,r){if(!_(r.hash)){var t=y(r.hash);if(!t)throw new Error("No handler found for post message response for message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(t.domain,n))throw new Error("Response origin "+n+" does not match domain "+Object(i.stringifyDomainPattern)(t.domain));if(b(r.hash),r.ack===u.b.POST_MESSAGE_ACK.ERROR){var o=new Error(r.error);return r.code&&(o.code=r.code),t.respond(o,null)}if(r.ack===u.b.POST_MESSAGE_ACK.SUCCESS){var a=r.data||r.response;return t.respond(null,{source:e,origin:n,data:a})}}},O),T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function j(e){if(!window||window.closed)throw new Error("Message recieved in closed window");try{if(!e.source)return}catch(e){return}var n=e.source,r=e.origin,t=function(e){var n=void 0;try{n=JSON.parse(e)}catch(e){return}if(n&&"object"===(void 0===n?"undefined":T(n))&&null!==n&&(n=n[u.b.WINDOW_PROPS.POSTROBOT])&&"object"===(void 0===n?"undefined":T(n))&&null!==n&&n.type&&"string"==typeof n.type&&P[n.type])return n}(e.data);if(t){if(Object(o.f)(n),!t.sourceDomain||"string"!=typeof t.sourceDomain)throw new Error("Expected message to have sourceDomain");0!==t.sourceDomain.indexOf(u.b.MOCK_PROTOCOL)&&0!==t.sourceDomain.indexOf(u.b.FILE_PROTOCOL)||(r=t.sourceDomain),-1===c.a.receivedMessages.indexOf(t.id)&&(c.a.receivedMessages.push(t.id),Object(i.isWindowClosed)(n)&&!t.fireAndForget||(t.data&&(t.data=Object(o.a)(n,r,t.data)),P[t.type](n,r,t)))}}function A(e){try{Object(a.noop)(e.source)}catch(e){return}var n={source:e.source||e.sourceElement,origin:e.origin||e.originalEvent&&e.originalEvent.origin,data:e.data};try{r(12).emulateIERestrictions(n.source,window)}catch(e){return}j(n)}function W(e){return s.a.try(function(){if(!e.name)throw new Error("Expected options.name");var n=e.name,r=void 0,t=void 0;if("string"==typeof e.window){var d=document.getElementById(e.window);if(!d)throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be a valid element id");if("iframe"!==d.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be an iframe");if(!d.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");r=d.contentWindow}else if(e.window instanceof HTMLIFrameElement){if("iframe"!==e.window.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be an iframe");if(e.window&&!e.window.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");e.window&&e.window.contentWindow&&(r=e.window.contentWindow)}else r=e.window;if(!r)throw new Error("Expected options.window to be a window object, iframe, or iframe element id.");var f=r;t=e.domain||u.b.WILDCARD;var l=e.name+"_"+Object(a.uniqueID)();if(Object(i.isWindowClosed)(f))throw new Error("Target window is closed");var w=!1,p=c.a.requestPromises.get(f);p||(p=[],c.a.requestPromises.set(f,p));var h=s.a.try(function(){if(Object(i.isAncestor)(window,f))return Object(o.h)(f,e.timeout||u.a.CHILD_WINDOW_TIMEOUT)}).then(function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(Object(a.isRegex)(t)&&!e)return Object(o.i)(f)}).then(function(){var r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(Object(a.isRegex)(t)){if(!Object(i.matchDomain)(t,r))throw new Error("Remote window domain "+r+" does not match regex: "+t.toString());t=r}if("string"!=typeof t&&!Array.isArray(t))throw new TypeError("Expected domain to be a string or array");var d=t;return new s.a(function(r,t){var a=void 0;if(e.fireAndForget||function(e,n){c.a.responseListeners[e]=n}(l,a={name:n,window:f,domain:d,respond:function(e,n){e||(w=!0,p.splice(p.indexOf(h,1))),e?t(e):r(n)}}),m(f,{type:u.b.POST_MESSAGE_TYPE.REQUEST,hash:l,name:n,data:e.data,fireAndForget:e.fireAndForget},d).catch(t),e.fireAndForget)return r();var s=Object(o.d)(f)?u.a.ACK_TIMEOUT_KNOWN:u.a.ACK_TIMEOUT,g=e.timeout||u.a.RES_TIMEOUT,O=s,v=g,y=100;setTimeout(function e(){if(!w){if(Object(i.isWindowClosed)(f))return a.ack?t(new Error("Window closed for "+n+" before response")):t(new Error("Window closed for "+n+" before ack"));if(O=Math.max(O-y,0),-1!==v&&(v=Math.max(v-y,0)),a.ack){if(-1===v)return;y=Math.min(v,2e3)}else{if(0===O)return t(new Error("No ack for postMessage "+n+" in "+Object(i.getDomain)()+" in "+s+"ms"));if(0===v)return t(new Error("No response for postMessage "+n+" in "+Object(i.getDomain)()+" in "+g+"ms"))}setTimeout(e,y)}},y)})});return h.catch(function(){!function(e){c.a.erroredResponseListeners[e]=!0}(l),b(l)}),p.push(h),h})}function R(e,n,r,t){return(t=t||{}).window=e,t.name=n,t.data=r,W(t)}function D(e,n,r){var t=Object(i.getAncestor)();return t?R(t,e,n,r):new s.a(function(e,n){return n(new Error("Window does not have a parent"))})}function I(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.window)throw new Error("Expected options.window");var n=e.window;return{send:function(r,t){return R(n,r,t,e)}}}c.a.receivedMessages=c.a.receivedMessages||[],c.a.receiveMessage=j,c.a.requestPromises=c.a.requestPromises||new g.a,c.a.send=R;var M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function L(e){if(!e.name)throw new Error("Expected options.name");if(!e.handler)throw new Error("Expected options.handler");var n=e.name,r=e.window,t=e.domain,o={handler:e.handler,handleError:e.errorHandler||function(e){throw e},window:r,domain:t||u.b.WILDCARD,name:n},s=function e(n,r){var t=n.name,o=n.win,i=n.domain;if(!t||"string"!=typeof t)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var s=[],d=0,f=o,l=null==f?0:f.length;d<l;d++){var w=f[d];s.push(e({name:t,domain:i,win:w},r))}return{cancel:function(){for(var e=0,n=null==s?0:s.length;e<n;e++)s[e].cancel()}}}if(Array.isArray(i)){for(var p=[],h=0,m=i,O=null==m?0:m.length;h<O;h++){var y=m[h];p.push(e({name:t,win:o,domain:y},r))}return{cancel:function(){for(var e=0,n=null==p?0:p.length;e<n;e++)p[e].cancel()}}}var b=E({name:t,win:o,domain:i});if(o&&o!==u.b.WILDCARD||(o=c.a.WINDOW_WILDCARD),i=i||u.b.WILDCARD,b)throw o&&i?new Error("Request listener already exists for "+t+" on domain "+i.toString()+" for "+(o===c.a.WINDOW_WILDCARD?"wildcard":"specified")+" window"):o?new Error("Request listener already exists for "+t+" for "+(o===c.a.WINDOW_WILDCARD?"wildcard":"specified")+" window"):i?new Error("Request listener already exists for "+t+" on domain "+i.toString()):new Error("Request listener already exists for "+t);var _=c.a.requestListeners,S=_[t];S||(S=new g.a,_[t]=S);var P=S.get(o);P||(P={},S.set(o,P));var T=i.toString(),j=P[v],A=void 0;return Object(a.isRegex)(i)?(j||(j=[],P[v]=j),A={regex:i,listener:r},j.push(A)):P[T]=r,{cancel:function(){P&&(delete P[T],o&&0===Object.keys(P).length&&S.delete(o),A&&j.splice(j.indexOf(A,1)))}}}({name:n,win:r,domain:t},o);if(e.once){var d=o.handler;o.handler=Object(a.once)(function(){return s.cancel(),d.apply(this,arguments)})}if(o.window&&e.errorOnClose)var f=Object(a.safeInterval)(function(){r&&"object"===(void 0===r?"undefined":M(r))&&Object(i.isWindowClosed)(r)&&(f.cancel(),o.handleError(new Error("Post message target window is closed")))},50);return{cancel:function(){s.cancel()}}}function C(e,n,r){return"function"==typeof n&&(r=n,n={}),(n=n||{}).name=e,n.handler=r||n.handler,L(n)}function N(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];"function"==typeof n&&(r=n,n={}),n=n||{},r=r||n.handler;var t=n.errorHandler,o=new s.a(function(o,i){(n=n||{}).name=e,n.once=!0,n.handler=function(e){if(o(e),r)return r(e)},n.errorHandler=function(e){if(i(e),t)return t(e)}}),i=L(n);return o.cancel=i.cancel,o}function B(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{on:function(n,r){return C(n,e,r)}}}function x(){delete window[u.b.WINDOW_PROPS.POSTROBOT],window.removeEventListener("message",A)}c.a.on=C;var k=Object(i.getAncestor)();function U(e){var n=c.a.requestPromises.get(e);if(n)for(var r=0,t=null==n?0:n.length;r<t;r++)n[r].reject(new Error("No response from window - cleaned up"));c.a.popupWindowsByWin&&c.a.popupWindowsByWin.delete(e),c.a.remoteWindows&&c.a.remoteWindows.delete(e),c.a.requestPromises.delete(e),c.a.methods.delete(e),c.a.readyPromises.delete(e)}var G=r(23);function F(){c.a.initialized||(Object(a.addEventListener)(window,"message",A),r(9).openTunnelToOpener(),Object(o.c)(),Object(o.e)({on:C,send:R})),c.a.initialized=!0}F(),r.d(n,"markWindowKnown",function(){return o.f}),r.d(n,"cleanUpWindow",function(){return U}),r.d(n,"Promise",function(){return s.a}),r.d(n,"bridge",function(){return G}),r.d(n,"init",function(){return F}),r.d(n,"parent",function(){return k}),r.d(n,"send",function(){return R}),r.d(n,"request",function(){return W}),r.d(n,"sendToParent",function(){return D}),r.d(n,"client",function(){return I}),r.d(n,"on",function(){return C}),r.d(n,"listen",function(){return L}),r.d(n,"once",function(){return N}),r.d(n,"listener",function(){return B}),r.d(n,"CONFIG",function(){return u.a}),r.d(n,"CONSTANTS",function(){return u.b}),r.d(n,"disable",function(){return x}),n.default=t},function(e,n,r){"use strict";function t(e){return"[object RegExp]"===Object.prototype.toString.call(e)}n.h=u,n.g=c,n.a=d,n.c=f,n.j=l,n.o=w,n.f=h,n.r=_,n.s=function(e){if(function(){for(var e=0;e<b.length;e++)v(b[e])&&(b.splice(e,1),y.splice(e,1));for(var n=0;n<y.length;n++)_(y[n])&&(b.splice(n,1),y.splice(n,1))}(),e&&e.contentWindow)try{y.push(e.contentWindow),b.push(e)}catch(e){}},n.i=function(e){return(e=e||window).navigator.mockUserAgent||e.navigator.userAgent},n.e=function(e,n){for(var r=h(e),t=0,o=null==r?0:r.length;t<o;t++){var i=r[t];try{if(w(i)&&i.name===n&&-1!==r.indexOf(i))return i}catch(e){}}try{if(-1!==r.indexOf(e.frames[n]))return e.frames[n]}catch(e){}try{if(-1!==r.indexOf(e[n]))return e[n]}catch(e){}},n.m=function(e,n){return e===c(n)},n.b=E,n.k=function(e,n){var r=E(n);if(r)return r===e;if(n===e)return!1;if(g(n)===n)return!1;for(var t=0,o=h(e),i=null==o?0:o.length;t<i;t++)if(o[t]===n)return!0;return!1},n.n=function(){return Boolean(c(window))},n.l=function(){return Boolean(u(window))},n.p=function(e,n){var r=g(e)||e,t=g(n)||n;try{if(r&&t)return r===t}catch(e){}var o=O(e),i=O(n);if(S(o,i))return!0;var a=c(r),u=c(t);return!(a&&S(O(a),i)||(u&&S(O(u),o),1))},n.t=function e(n,r){if("string"==typeof n){if("string"==typeof r)return n===o.WILDCARD||r===n;if(t(r))return!1;if(Array.isArray(r))return!1}return t(n)?t(r)?n.toString()===r.toString():!Array.isArray(r)&&Boolean(r.match(n)):!!Array.isArray(n)&&(Array.isArray(r)?JSON.stringify(n)===JSON.stringify(r):!t(r)&&n.some(function(n){return e(n,r)}))},n.u=function(e){return Array.isArray(e)?"("+e.join(" | ")+")":t(e)?"RegExp("+e.toString():e.toString()},n.d=function(e){return e.match(/^(https?|mock|file):\/\//)?e.split("/").slice(0,3).join("/"):f()},n.q=function(e){try{if(e===window)return!0}catch(e){if(e&&e.message===i)return!0}try{if("[object Window]"===Object.prototype.toString.call(e))return!0}catch(e){if(e&&e.message===i)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.self===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.parent===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.top===e)return!0}catch(e){if(e&&e.message===i)return!0}try{e&&e.__cross_domain_utils_window_check__}catch(e){return!0}return!1};var o={MOCK_PROTOCOL:"mock:",FILE_PROTOCOL:"file:",ABOUT_PROTOCOL:"about:",WILDCARD:"*"},i="Call was rejected by callee.\r\n";function a(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===o.ABOUT_PROTOCOL}function u(e){if(e)try{if(e.parent&&e.parent!==e)return e.parent}catch(e){}}function c(e){if(e&&!u(e))try{return e.opener}catch(e){}}function s(e){try{return e&&e.location&&e.location.href,!0}catch(e){}return!1}function d(e){var n=(e=e||window).location;if(!n)throw new Error("Can not read window location");var r=n.protocol;if(!r)throw new Error("Can not read window protocol");if(r===o.FILE_PROTOCOL)return o.FILE_PROTOCOL+"//";if(r===o.ABOUT_PROTOCOL){var t=u(e);return t&&s(t)?d(t):o.ABOUT_PROTOCOL+"//"}var i=n.host;if(!i)throw new Error("Can not read window host");return r+"//"+i}function f(e){var n=d(e=e||window);return n&&e.mockDomain&&0===e.mockDomain.indexOf(o.MOCK_PROTOCOL)?e.mockDomain:n}function l(e){try{if(e===window)return!0}catch(e){}try{var n=Object.getOwnPropertyDescriptor(e,"location");if(n&&!1===n.enumerable)return!1}catch(e){}try{if(a(e)&&s(e))return!0}catch(e){}try{if(d(e)===d(window))return!0}catch(e){}return!1}function w(e){if(!l(e))return!1;try{if(e===window)return!0;if(a(e)&&s(e))return!0;if(f(window)===f(e))return!0}catch(e){}return!1}function p(e,n){if(!e||!n)return!1;var r=u(n);return r?r===e:-1!==function(e){var n=[];try{for(;e.parent!==e;)n.push(e.parent),e=e.parent}catch(e){}return n}(n).indexOf(e)}function h(e){var n=[],r=void 0;try{r=e.frames}catch(n){r=e}var t=void 0;try{t=r.length}catch(e){}if(0===t)return n;if(t){for(var o=0;o<t;o++){var i=void 0;try{i=r[o]}catch(e){continue}n.push(i)}return n}for(var a=0;a<100;a++){var u=void 0;try{u=r[a]}catch(e){return n}if(!u)return n;n.push(u)}return n}function m(e){for(var n=[],r=0,t=h(e),o=null==t?0:t.length;r<o;r++){var i=t[r];n.push(i);for(var a=0,u=m(i),c=null==u?0:u.length;a<c;a++){var s=u[a];n.push(s)}}return n}function g(e){if(e){try{if(e.top)return e.top}catch(e){}if(u(e)===e)return e;try{if(p(window,e)&&window.top)return window.top}catch(e){}try{if(p(e,window)&&window.top)return window.top}catch(e){}for(var n=0,r=m(e),t=null==r?0:r.length;n<t;n++){var o=r[n];try{if(o.top)return o.top}catch(e){}if(u(o)===o)return o}}}function O(e){var n=g(e);if(!n)throw new Error("Can not determine top window");return[].concat(m(n),[n])}function v(e){if(!e.contentWindow)return!0;if(!e.parentNode)return!0;var n=e.ownerDocument;return!(!n||!n.documentElement||n.documentElement.contains(e))}var y=[],b=[];function _(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(e===window)return!1}catch(e){return!0}try{if(!e)return!0}catch(e){return!0}try{if(e.closed)return!0}catch(e){return!e||e.message!==i}if(n&&w(e))try{if(e.mockclosed)return!0}catch(e){}try{if(!e.parent||!e.top)return!0}catch(e){}var r=function(e,n){for(var r=0;r<e.length;r++)try{if(e[r]===n)return r}catch(e){}return-1}(y,e);if(-1!==r){var t=b[r];if(t&&v(t))return!0}return!1}function E(e){return c(e=e||window)||u(e)||void 0}function S(e,n){for(var r=0,t=null==e?0:e.length;r<t;r++)for(var o=e[r],i=0,a=null==n?0:n.length;i<a;i++)if(o===n[i])return!0;return!1}},function(e,n){},function(e,n,r){"use strict";r(7),r(11)},function(e,n,r){"use strict";r(7)},function(e,n,r){"use strict";function t(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function o(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}r(7),r(8),"function"==typeof Symbol&&Symbol.iterator,Object.assign,function(e){function n(r){return t(this,n),function(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}(this,e.call(this,"",{},r))}(function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)})(n,e),n.prototype.toString=function(){return this.childrenToString()}}(function(){function e(n,r,o){t(this,e),this.name=n,this.props=r,this.children=o}return e.prototype.toString=function(){var e=this.name,n=this.propsToString(),r=this.childrenToString();return"<"+e+(n?" ":"")+n+">"+r+"</"+e+">"},e.prototype.propsToString=function(){var e=this.props;return e?Object.keys(e).filter(function(n){return"innerHTML"!==n&&e&&!1!==e[n]}).map(function(n){if(e){var r=e[n];if(!0===r)return""+o(n);if("string"==typeof r)return o(n)+'="'+o(r)+'"'}return""}).filter(Boolean).join(" "):""},e.prototype.childrenToString=function(){if(this.props&&this.props.innerHTML)return this.props.innerHTML;if(!this.children)return"";var n="";return function r(t){for(var i=0,a=null==t?0:t.length;i<a;i++){var u=t[i];null!==u&&void 0!==u&&(Array.isArray(u)?r(u):n+=u instanceof e?u.toString():o(u))}}(this.children),n},e}())},function(e,n,r){"use strict";r(2),r(0)},function(e,n){},function(e,n,r){"use strict";r(7)},function(e,n,r){"use strict"},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r(9);r.d(n,"openBridge",function(){return t.openBridge}),r.d(n,"linkUrl",function(){return t.linkUrl}),r.d(n,"isBridge",function(){return t.isBridge}),r.d(n,"needsBridge",function(){return t.needsBridge}),r.d(n,"needsBridgeForBrowser",function(){return t.needsBridgeForBrowser}),r.d(n,"hasBridge",function(){return t.hasBridge}),r.d(n,"needsBridgeForWin",function(){return t.needsBridgeForWin}),r.d(n,"needsBridgeForDomain",function(){return t.needsBridgeForDomain}),r.d(n,"openTunnelToOpener",function(){return t.openTunnelToOpener}),r.d(n,"destroyBridges",function(){return t.destroyBridges})}])}); | ||
//# sourceMappingURL=post-robot.ie.min.js.map | ||
//# sourceMappingURL=post-robot.ie.min.js.map |
@@ -1,3 +0,3 @@ | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("postRobot",[],n):"object"==typeof exports?exports.postRobot=n():e.postRobot=n()}("undefined"!=typeof self?self:this,function(){return function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=8)}([function(e,n,t){"use strict";var r=t(9);t.d(n,"getActualDomain",function(){return r.a}),t.d(n,"getAncestor",function(){return r.b}),t.d(n,"getDomain",function(){return r.c}),t.d(n,"getUserAgent",function(){return r.d}),t.d(n,"isActuallySameDomain",function(){return r.e}),t.d(n,"isAncestor",function(){return r.f}),t.d(n,"isIframe",function(){return r.g}),t.d(n,"isPopup",function(){return r.h}),t.d(n,"isWindow",function(){return r.i}),t.d(n,"isWindowClosed",function(){return r.j}),t.d(n,"linkFrameWindow",function(){return r.k}),t.d(n,"matchDomain",function(){return r.l}),t.d(n,"stringifyDomainPattern",function(){return r.m});var o=t(10);t.n(o)},function(e,n,t){"use strict";function r(e){try{if(!e)return!1;if("undefined"!=typeof Promise&&e instanceof Promise)return!0;if("undefined"!=typeof window&&window.Window&&e instanceof window.Window)return!1;if("undefined"!=typeof window&&window.constructor&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var t=n.call(e);if("[object Window]"===t||"[object global]"===t||"[object DOMWindow]"===t)return!1}if("function"==typeof e.then)return!0}catch(e){return!1}return!1}function o(){var e=void 0;if("undefined"!=typeof window)e=window;else{if("undefined"==typeof window)throw new TypeError("Can not find global");e=window}var n=e.__zalgopromise__=e.__zalgopromise__||{};return n.flushPromises=n.flushPromises||[],n.activeCount=n.activeCount||0,n.possiblyUnhandledPromiseHandlers=n.possiblyUnhandledPromiseHandlers||[],n.dispatchedErrors=n.dispatchedErrors||[],n}var i=function(){function e(n){var t=this;if(function(n,t){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],n){var r=void 0,o=void 0,i=!1,a=!1,c=!1;try{n(function(e){c?t.resolve(e):(i=!0,r=e)},function(e){c?t.reject(e):(a=!0,o=e)})}catch(e){return void this.reject(e)}c=!0,i?this.resolve(r):a&&this.reject(o)}}return e.prototype.resolve=function(e){if(this.resolved||this.rejected)return this;if(r(e))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},e.prototype.reject=function(e){var n=this;if(this.resolved||this.rejected)return this;if(r(e))throw new Error("Can not reject promise with another promise");if(!e){var t=e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e);e=new Error("Expected reject to be called with Error, got "+t)}return this.rejected=!0,this.error=e,this.errorHandled||setTimeout(function(){n.errorHandled||function(e,n){if(-1===o().dispatchedErrors.indexOf(e)){o().dispatchedErrors.push(e),setTimeout(function(){throw e},1);for(var t=0;t<o().possiblyUnhandledPromiseHandlers.length;t++)o().possiblyUnhandledPromiseHandlers[t](e,n)}}(e,n)},1),this.dispatch(),this},e.prototype.asyncReject=function(e){this.errorHandled=!0,this.reject(e)},e.prototype.dispatch=function(){var n=this,t=this.dispatching,i=this.resolved,a=this.rejected,c=this.handlers;if(!t&&(i||a)){this.dispatching=!0,o().activeCount+=1;for(var u=function(t){var o=c[t],u=o.onSuccess,s=o.onError,f=o.promise,d=void 0;if(i)try{d=u?u(n.value):n.value}catch(e){return f.reject(e),"continue"}else if(a){if(!s)return f.reject(n.error),"continue";try{d=s(n.error)}catch(e){return f.reject(e),"continue"}}d instanceof e&&(d.resolved||d.rejected)?(d.resolved?f.resolve(d.value):f.reject(d.error),d.errorHandled=!0):r(d)?d instanceof e&&(d.resolved||d.rejected)?d.resolved?f.resolve(d.value):f.reject(d.error):d.then(function(e){f.resolve(e)},function(e){f.reject(e)}):f.resolve(d)},s=0;s<c.length;s++)u(s);c.length=0,this.dispatching=!1,o().activeCount-=1,0===o().activeCount&&e.flushQueue()}},e.prototype.then=function(n,t){if(n&&"function"!=typeof n&&!n.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 e;return this.handlers.push({promise:r,onSuccess:n,onError:t}),this.errorHandled=!0,this.dispatch(),r},e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.finally=function(n){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.finally expected a function");return this.then(function(t){return e.try(n).then(function(){return t})},function(t){return e.try(n).then(function(){throw t})})},e.prototype.timeout=function(e,n){var t=this;if(this.resolved||this.rejected)return this;var r=setTimeout(function(){t.resolved||t.rejected||t.reject(n||new Error("Promise timed out after "+e+"ms"))},e);return this.then(function(e){return clearTimeout(r),e})},e.prototype.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},e.resolve=function(n){return n instanceof e?n:r(n)?new e(function(e,t){return n.then(e,t)}):(new e).resolve(n)},e.reject=function(n){return(new e).reject(n)},e.all=function(n){var t=new e,o=n.length,i=[];if(!o)return t.resolve(i),t;for(var a=function(a){var c=n[a];if(c instanceof e){if(c.resolved)return i[a]=c.value,o-=1,"continue"}else if(!r(c))return i[a]=c,o-=1,"continue";e.resolve(c).then(function(e){i[a]=e,0==(o-=1)&&t.resolve(i)},function(e){t.reject(e)})},c=0;c<n.length;c++)a(c);return 0===o&&t.resolve(i),t},e.hash=function(n){var t={};return e.all(Object.keys(n).map(function(r){return e.resolve(n[r]).then(function(e){t[r]=e})})).then(function(){return t})},e.map=function(n,t){return e.all(n.map(t))},e.onPossiblyUnhandledException=function(e){return function(e){return o().possiblyUnhandledPromiseHandlers.push(e),{cancel:function(){o().possiblyUnhandledPromiseHandlers.splice(o().possiblyUnhandledPromiseHandlers.indexOf(e),1)}}}(e)},e.try=function(n,t,r){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.try expected a function");var o=void 0;try{o=n.apply(t,r||[])}catch(n){return e.reject(n)}return e.resolve(o)},e.delay=function(n){return new e(function(e){setTimeout(e,n)})},e.isPromise=function(n){return!!(n&&n instanceof e)||r(n)},e.flush=function(){var n=new e;return o().flushPromises.push(n),0===o().activeCount&&e.flushQueue(),n},e.flushQueue=function(){var e=o().flushPromises;o().flushPromises=[];for(var n=0,t=null==e?0:e.length;n<t;n++)e[n].resolve()},e}();t.d(n,"a",function(){return i})},function(e,n,t){"use strict";t(6);var r=t(5);t.d(n,"addEventListener",function(){return r.a}),t(11),t(12),t(13),t(7);var o=t(3);t.d(n,"isRegex",function(){return o.f}),t.d(n,"noop",function(){return o.h}),t.d(n,"once",function(){return o.i}),t.d(n,"replaceObject",function(){return o.m}),t.d(n,"safeInterval",function(){return o.n}),t.d(n,"stringifyError",function(){return o.p}),t.d(n,"uniqueID",function(){return o.r}),t(14);var i=t(15);t.n(i),t(16),t(17)},function(e,n,t){"use strict";n.r=c,n.d=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")},n.g=function(e){var n=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new o.a;function i(){for(var n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];var c=r.getOrSet(t.thisNamespace?this:e,function(){return{}}),u=s(o),f=t.time;if(c[u]&&f&&Date.now()-c[u].time<f&&delete c[u],c[u])return c[u].value;i.__calling__=!0;var d=Date.now(),l=e.apply(this,arguments);return i.__calling__=!1,c[u]={time:d,value:l},c[u].value}return i.reset=function(){r.delete(t.thisNamespace?n:e)},t.name&&(i.displayName=t.name+":memoized"),i},n.j=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};function t(){return r.a.try(e,this,arguments)}return n.name&&(t.displayName=n.name+":promisified"),t},n.e=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=e.__inline_memoize_cache__=e.__inline_memoize_cache__||{},o=s(t);return r.hasOwnProperty(o)?r[o]:r[o]=n.apply(void 0,t)},n.h=function(){},n.i=function(e){var n=!1;return function(){if(!n)return n=!0,e.apply(this,arguments)}},n.p=function e(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(t>=3)return"stringifyError stack overflow";try{if(!n)return"<unknown error: "+Object.prototype.toString.call(n)+">";if("string"==typeof n)return n;if(n instanceof Error){var r=n&&n.stack,o=n&&n.message;if(r&&o)return-1!==r.indexOf(o)?r:o+"\n"+r;if(r)return r;if(o)return o}return"function"==typeof n.toString?n.toString():Object.prototype.toString.call(n)}catch(n){return"Error while stringifying error: "+e(n,t+1)}},n.o=function(e){return"string"==typeof e?e:e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)},n.c=function(e,n){if(!n)return e;if(Object.assign)return Object.assign(e,n);for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e},n.k=function(e,n,t){var r=[];return e.replace(n,function(e){r.push(t?t.apply(null,arguments):e)}),r},n.q=function(e){return"data:image/svg+xml;base64,"+a(e)},n.l=function(e,n){var t=[];return e.replace(n,function(e){return t.push(e),""}),t},n.n=function(e,n){var t=void 0;return function r(){t=setTimeout(function(){e(),r()},n)}(),{cancel:function(){clearTimeout(t)}}},n.a=function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},n.m=function e(n,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(Array.isArray(n)){for(var o=n.length,i=[],a=function(o){f(i,o,function(){var i=r?r+"."+o:""+o,a=n[o],c=t(a,o,i);return(l(c)||Array.isArray(c))&&(c=e(c,t,i)),c})},c=0;c<o;c++)a(c);return i}if(l(n)){var u={},s=function(o){if(!n.hasOwnProperty(o))return"continue";f(u,o,function(){var i=r?r+"."+o:""+o,a=n[o],c=t(a,o,i);return(l(c)||Array.isArray(c))&&(c=e(c,t,i)),c})};for(var d in n)s(d);return u}throw new Error("Pass an object or array")},n.b=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,t=void 0;return function(){var r=this,o=arguments;clearTimeout(t),t=setTimeout(function(){return e.apply(r,o)},n)}},n.f=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)};var r=t(1),o=t(4),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function a(e){return window.btoa(e)}function c(){var e="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})+"_"+a((new Date).toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var u=void 0;function s(e){try{return JSON.stringify(Array.prototype.slice.call(e),function(e,n){return"function"==typeof n?"memoize["+function(e){if(u=u||new o.a,null===e||void 0===e||"object"!==(void 0===e?"undefined":i(e))&&"function"!=typeof e)throw new Error("Invalid object");var n=u.get(e);return n||(n=(void 0===e?"undefined":i(e))+":"+c(),u.set(e,n)),n}(n)+"]":n})}catch(e){throw new Error("Arguments not serializable -- can not be used to memoize")}}function f(e,n,t){if(Array.isArray(e)){if("number"!=typeof n)throw new TypeError("Array key must be number")}else if("object"===(void 0===e?"undefined":i(e))&&null!==e&&"string"!=typeof n)throw new TypeError("Object key must be string");Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:function(){delete e[n];var r=t();return e[n]=r,r},set:function(t){delete e[n],e[n]=t}})}function d(e){return"object"===(void 0===(n=e)?"undefined":i(n))&&null!==n&&"[object Object]"===Object.prototype.toString.call(e);var n}function l(e){if(!d(e))return!1;var n=e.constructor;if("function"!=typeof n)return!1;var t=n.prototype;return!!d(t)&&!!t.hasOwnProperty("isPrototypeOf")}},function(e,n,t){"use strict";t.d({},"WeakMap",function(){return c});var r=t(0);function o(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch(e){}return-1}var i=Object.defineProperty,a=Date.now()%1e9,c=function(){function e(){if(function(n,t){if(!(n instanceof e))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 e=new WeakMap,n={};return Object.freeze(n),e.set(n,"__testvalue__"),"__testvalue__"===e.get(n)}catch(e){return!1}}())try{this.weakmap=new WeakMap}catch(e){}this.keys=[],this.values=[]}return e.prototype._cleanupClosedWindows=function(){for(var e=this.weakmap,n=this.keys,t=0;t<n.length;t++){var o=n[t];if(Object(r.isWindow)(o)&&Object(r.isWindowClosed)(o)){if(e)try{e.delete(o)}catch(e){}n.splice(t,1),this.values.splice(t,1),t-=1}}},e.prototype.isSafeToReadWrite=function(e){if(Object(r.isWindow)(e))return!1;try{e&&e.self,e&&e[this.name]}catch(e){return!1}return!0},e.prototype.set=function(e,n){if(!e)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{t.set(e,n)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var r=this.name,a=e[r];a&&a[0]===e?a[1]=n:i(e,r,{value:[e,n],writable:!0})}else{this._cleanupClosedWindows();var c=this.keys,u=this.values,s=o(c,e);-1===s?(c.push(e),u.push(n)):u[s]=n}},e.prototype.get=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{if(n.has(e))return n.get(e)}catch(e){delete this.weakmap}if(!this.isSafeToReadWrite(e)){this._cleanupClosedWindows();var t=o(this.keys,e);if(-1===t)return;return this.values[t]}var r=e[this.name];if(r&&r[0]===e)return r[1]},e.prototype.delete=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{n.delete(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var t=e[this.name];t&&t[0]===e&&(t[0]=t[1]=void 0)}else{this._cleanupClosedWindows();var r=this.keys,i=o(r,e);-1!==i&&(r.splice(i,1),this.values.splice(i,1))}},e.prototype.has=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{return n.has(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var t=e[this.name];return!(!t||t[0]!==e)}return this._cleanupClosedWindows(),-1!==o(this.keys,e)},e.prototype.getOrSet=function(e,n){if(this.has(e))return this.get(e);var t=n();return this.set(e,t),t},e}();t.d(n,"a",function(){return c})},function(e,n,t){"use strict";t(1),t(0),t(4);var r=t(3);t(6),n.d=function e(){return Object(r.e)(e,function(){try{if("undefined"==typeof window)return!1;if(window.localStorage){var e=Math.random().toString();window.localStorage.setItem("__test__localStorage__",e);var n=window.localStorage.getItem("__test__localStorage__");if(window.localStorage.removeItem("__test__localStorage__"),e===n)return!0}}catch(e){}return!1})},n.b=function(e,n){e.appendChild(n)},n.g=function(e,n){try{e.document.open(),e.document.write(n),e.document.close()}catch(t){try{e.location="javascript: document.open(); document.write("+JSON.stringify(n)+"); document.close();"}catch(e){}}},n.f=function(e,n){var t=n.tagName.toLowerCase();if("html"!==t)throw new Error("Expected element to be html, got "+t);for(var r=e.document.documentElement;r.children&&r.children.length;)r.removeChild(r.children[0]);for(;n.children.length;)r.appendChild(n.children[0])},n.e=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.document;e.styleSheet?e.styleSheet.cssText=n:e.appendChild(t.createTextNode(n))},n.a=function(e,n,t){return e.addEventListener(n,t),{cancel:function(){e.removeEventListener(n,t)}}},n.c=function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.document,t=0,r=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.document;return Array.prototype.slice.call(n.querySelectorAll(e))}("script",e),o=null==r?0:r.length;t<o;t++){var i=r[t],a=i.parentNode;if(a){var c=n.createElement("script");c.text=i.textContent,a.replaceChild(c,i)}}},"function"==typeof Symbol&&Symbol.iterator,Object.assign,Object.create(Error.prototype)},function(e,n,t){"use strict";n.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(e,n,t){"use strict";n.a=function e(n){var t=n.name,i=n.version,a=void 0===i?"latest":i,c=n.lifetime,u=void 0===c?3e5:c;return Object(r.e)(e,function(){var e="__"+t+"_"+a+"_storage__",n=void 0;function i(t){var i=Object(o.d)(),a=void 0;if(n&&(a=n),!a&&i){var c=window.localStorage.getItem(e);c&&(a=JSON.parse(c))}a||(a=Object(r.d)()[e]),a||(a={id:Object(r.r)()}),a.id||(a.id=Object(r.r)()),n=a;var u=t(a);return i?window.localStorage.setItem(e,JSON.stringify(a)):Object(r.d)()[e]=a,n=null,u}function c(e){return i(function(n){var t=n.__session__,o=Date.now();return t&&o-t.created>u&&(t=null),t||(t={guid:Object(r.r)(),created:o}),n.__session__=t,e(t)})}return{getState:i,getID:function(){return i(function(e){return e.id})},getSessionState:function(e){return c(function(n){return n.state=n.state||{},e(n.state)})},getSessionID:function(){return c(function(e){return e.guid})}}},[{name:t,version:a,lifetime:u}])};var r=t(3),o=t(5)},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={};t.d(r,"cleanUpWindow",function(){return Y}),t.d(r,"Promise",function(){return f.a}),t.d(r,"bridge",function(){return K}),t.d(r,"init",function(){return Z}),t.d(r,"parent",function(){return F}),t.d(r,"send",function(){return M}),t.d(r,"request",function(){return C}),t.d(r,"sendToParent",function(){return N}),t.d(r,"client",function(){return x}),t.d(r,"on",function(){return U}),t.d(r,"listen",function(){return G}),t.d(r,"once",function(){return H}),t.d(r,"listener",function(){return q}),t.d(r,"CONFIG",function(){return u}),t.d(r,"CONSTANTS",function(){return a}),t.d(r,"disable",function(){return B});var o,i=t(0),a={POST_MESSAGE_TYPE:{REQUEST:"postrobot_message_request",RESPONSE:"postrobot_message_response",ACK:"postrobot_message_ack"},POST_MESSAGE_ACK:{SUCCESS:"success",ERROR:"error"},POST_MESSAGE_NAMES:{METHOD:"postrobot_method",HELLO:"postrobot_ready",OPEN_TUNNEL:"postrobot_open_tunnel"},WINDOW_TYPES:{FULLPAGE:"fullpage",POPUP:"popup",IFRAME:"iframe"},WINDOW_PROPS:{POSTROBOT:"__postRobot__"},SERIALIZATION_TYPES:{METHOD:"postrobot_method",ERROR:"postrobot_error",PROMISE:"postrobot_promise",ZALGO_PROMISE:"postrobot_zalgo_promise",REGEX:"regex"},SEND_STRATEGIES:{POST_MESSAGE:"postrobot_post_message",BRIDGE:"postrobot_bridge",GLOBAL:"postrobot_global"},MOCK_PROTOCOL:"mock:",FILE_PROTOCOL:"file:",BRIDGE_NAME_PREFIX:"__postrobot_bridge__",POSTROBOT_PROXY:"__postrobot_proxy__",WILDCARD:"*"},c={METHOD:"postrobot_method",HELLO:"postrobot_hello",OPEN_TUNNEL:"postrobot_open_tunnel"},u=(Object.keys(c).map(function(e){return c[e]}),{ALLOW_POSTMESSAGE_POPUP:!("__ALLOW_POSTMESSAGE_POPUP__"in window)||window.__ALLOW_POSTMESSAGE_POPUP__,BRIDGE_TIMEOUT:5e3,CHILD_WINDOW_TIMEOUT:5e3,ACK_TIMEOUT:-1!==window.navigator.userAgent.match(/MSIE/i)?2e3:1e3,RES_TIMEOUT:-1,ALLOWED_POST_MESSAGE_METHODS:(o={},o[a.SEND_STRATEGIES.POST_MESSAGE]=!0,o[a.SEND_STRATEGIES.BRIDGE]=!0,o[a.SEND_STRATEGIES.GLOBAL]=!0,o),ALLOW_SAME_ORIGIN:!1});0===window.location.href.indexOf(a.FILE_PROTOCOL)&&(u.ALLOW_POSTMESSAGE_POPUP=!0);var s=t(4),f=t(1),d=t(2),l=window[a.WINDOW_PROPS.POSTROBOT]=window[a.WINDOW_PROPS.POSTROBOT]||{};l.registerSelf=function(){};var p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};l.methods=l.methods||new s.a;var h=Object(d.once)(function(){l.on(a.POST_MESSAGE_NAMES.METHOD,{origin:a.WILDCARD},function(e){var n=e.source,t=e.origin,r=e.data,o=l.methods.get(n);if(!o)throw new Error("Could not find any methods this window has privileges to call");var a=o[r.id];if(!a)throw new Error("Could not find method with id: "+r.id);if(!Object(i.matchDomain)(a.domain,t))throw new Error("Method domain "+a.domain+" does not match origin "+t);return f.a.try(function(){return a.method.apply({source:n,origin:t,data:r},r.args)}).then(function(e){return{result:e,id:r.id,name:r.name}})})});function w(e,n){return"object"===(void 0===e?"undefined":p(e))&&null!==e&&e.__type__===n}function m(e,n,t,r){var o=Object(d.uniqueID)(),i=l.methods.get(e);return i||(i={},l.methods.set(e,i)),i[o]={domain:n,method:t},{__type__:a.SERIALIZATION_TYPES.METHOD,__id__:o,__name__:r}}function y(e,n,t){function r(){var r=Array.prototype.slice.call(arguments);return l.send(e,a.POST_MESSAGE_NAMES.METHOD,{id:t.__id__,name:t.__name__,args:r},{domain:n,timeout:-1}).then(function(e){return e.data.result},function(e){throw e})}return r.__name__=t.__name__,r.__xdomain__=!0,r.source=e,r.origin=n,r}function _(e,n,t){return new f.a(function(r,o){return y(e,n,t.__then__)(r,o)})}function v(e){return l.send(e,a.POST_MESSAGE_NAMES.HELLO,{},{domain:a.WILDCARD,timeout:-1}).then(function(e){return{origin:e.origin}})}l.readyPromises=l.readyPromises||new s.a;var O={};O[a.SEND_STRATEGIES.POST_MESSAGE]=function(e,n,t){(Array.isArray(t)?t:"string"==typeof t?[t]:[a.WILDCARD]).map(function(n){if(0===n.indexOf(a.MOCK_PROTOCOL)){if(window.location.protocol===a.FILE_PROTOCOL)return a.WILDCARD;if(!Object(i.isActuallySameDomain)(e))throw new Error("Attempting to send messsage to mock domain "+n+", but window is actually cross-domain");return Object(i.getActualDomain)(e)}return 0===n.indexOf(a.FILE_PROTOCOL)?a.WILDCARD:n}).forEach(function(t){return e.postMessage(n,t)})};var g=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e};function E(e,n,t){return f.a.try(function(){var r;if(n=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object(d.uniqueID)(),o=Object(i.isPopup)()?a.WINDOW_TYPES.POPUP:Object(i.isIframe)()?a.WINDOW_TYPES.IFRAME:a.WINDOW_TYPES.FULLPAGE,c=Object(i.getDomain)(window);return g({},n,t,{sourceDomain:c,id:n.id||r,windowType:o})}(e,n,{data:function(e,n,t){return Object(d.replaceObject)({obj:t},function(t,r){return"function"==typeof t?m(e,n,t,r.toString()):t instanceof Error?(o=t,{__type__:a.SERIALIZATION_TYPES.ERROR,__message__:Object(d.stringifyError)(o),__code__:o.code}):window.Promise&&t instanceof window.Promise?function(e,n,t,r){return{__type__:a.SERIALIZATION_TYPES.PROMISE,__then__:m(e,n,function(e,n){return t.then(e,n)},r+".then")}}(e,n,t,r.toString()):f.a.isPromise(t)?function(e,n,t,r){return{__type__:a.SERIALIZATION_TYPES.ZALGO_PROMISE,__then__:m(e,n,function(e,n){return t.then(e,n)},r+".then")}}(e,n,t,r.toString()):Object(d.isRegex)(t)?(i=t,{__type__:a.SERIALIZATION_TYPES.REGEX,__source__:i.source}):t;var o,i}).obj}(e,t,n.data),domain:t}),e===window&&!u.ALLOW_SAME_ORIGIN)throw new Error("Attemping to send message to self");if(Object(i.isWindowClosed)(e))throw new Error("Window is closed");var o=[],c=JSON.stringify(((r={})[a.WINDOW_PROPS.POSTROBOT]=n,r),null,2);return f.a.map(Object.keys(O),function(n){return f.a.try(function(){if(!u.ALLOWED_POST_MESSAGE_METHODS[n])throw new Error("Strategy disallowed: "+n);return O[n](e,c,t)}).then(function(){return o.push(n+": success"),!0},function(e){return o.push(n+": "+Object(d.stringifyError)(e)+"\n"),!1})}).then(function(e){var t=e.some(Boolean),r=n.type+" "+n.name+" "+(t?"success":"error")+":\n - "+o.join("\n - ")+"\n";if(!t)throw new Error(r)})})}l.responseListeners=l.responseListeners||{},l.requestListeners=l.requestListeners||{},l.WINDOW_WILDCARD=l.WINDOW_WILDCARD||new function(){},l.erroredResponseListeners=l.erroredResponseListeners||{};var S,b="__domain_regex__";function P(e){return l.responseListeners[e]}function T(e){delete l.responseListeners[e]}function A(e){return Boolean(l.erroredResponseListeners[e])}function j(e){var n=e.name,t=e.win,r=e.domain;if(t===a.WILDCARD&&(t=null),r===a.WILDCARD&&(r=null),!n)throw new Error("Name required to get request listener");var o=l.requestListeners[n];if(o)for(var c=0,u=[t,l.WINDOW_WILDCARD],s=null==u?0:u.length;c<s;c++){var f=u[c],d=f&&o.get(f);if(d){if(r&&"string"==typeof r){if(d[r])return d[r];if(d[b])for(var p=0,h=d[b],w=null==h?0:h.length;p<w;p++){var m=h[p],y=m.regex,_=m.listener;if(Object(i.matchDomain)(y,r))return _}}if(d[a.WILDCARD])return d[a.WILDCARD]}}}var R=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},I=((S={})[a.POST_MESSAGE_TYPE.ACK]=function(e,n,t){if(!A(t.hash)){var r=P(t.hash);if(!r)throw new Error("No handler found for post message ack for message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(r.domain,n))throw new Error("Ack origin "+n+" does not match domain "+r.domain.toString());r.ack=!0}},S[a.POST_MESSAGE_TYPE.REQUEST]=function(e,n,t){var r=j({name:t.name,win:e,domain:n});function o(r){return t.fireAndForget||Object(i.isWindowClosed)(e)?f.a.resolve():E(e,R({target:t.originalSource,hash:t.hash,name:t.name},r),n)}return f.a.all([o({type:a.POST_MESSAGE_TYPE.ACK}),f.a.try(function(){if(!r)throw new Error("No handler found for post message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(r.domain,n))throw new Error("Request origin "+n+" does not match domain "+r.domain.toString());var o=t.data;return r.handler({source:e,origin:n,data:o})}).then(function(e){return o({type:a.POST_MESSAGE_TYPE.RESPONSE,ack:a.POST_MESSAGE_ACK.SUCCESS,data:e})},function(e){var n=Object(d.stringifyError)(e).replace(/^Error: /,""),t=e.code;return o({type:a.POST_MESSAGE_TYPE.RESPONSE,ack:a.POST_MESSAGE_ACK.ERROR,error:n,code:t})})]).then(d.noop).catch(function(e){if(r&&r.handleError)return r.handleError(e);throw e})},S[a.POST_MESSAGE_TYPE.RESPONSE]=function(e,n,t){if(!A(t.hash)){var r=P(t.hash);if(!r)throw new Error("No handler found for post message response for message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(r.domain,n))throw new Error("Response origin "+n+" does not match domain "+Object(i.stringifyDomainPattern)(r.domain));if(T(t.hash),t.ack===a.POST_MESSAGE_ACK.ERROR){var o=new Error(t.error);return t.code&&(o.code=t.code),r.respond(o,null)}if(t.ack===a.POST_MESSAGE_ACK.SUCCESS){var c=t.data||t.response;return r.respond(null,{source:e,origin:n,data:c})}}},S),D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function W(e){if(!window||window.closed)throw new Error("Message recieved in closed window");try{if(!e.source)return}catch(e){return}var n=e.source,t=e.origin,r=function(e){var n=void 0;try{n=JSON.parse(e)}catch(e){return}if(n&&"object"===(void 0===n?"undefined":D(n))&&null!==n&&(n=n[a.WINDOW_PROPS.POSTROBOT])&&"object"===(void 0===n?"undefined":D(n))&&null!==n&&n.type&&"string"==typeof n.type&&I[n.type])return n}(e.data);if(r){if(!r.sourceDomain||"string"!=typeof r.sourceDomain)throw new Error("Expected message to have sourceDomain");0!==r.sourceDomain.indexOf(a.MOCK_PROTOCOL)&&0!==r.sourceDomain.indexOf(a.FILE_PROTOCOL)||(t=r.sourceDomain),-1===l.receivedMessages.indexOf(r.id)&&(l.receivedMessages.push(r.id),Object(i.isWindowClosed)(n)&&!r.fireAndForget||(r.data&&(r.data=function(e,n,t){return Object(d.replaceObject)({obj:t},function(t){return"object"!==(void 0===t?"undefined":p(t))||null===t?t:w(t,a.SERIALIZATION_TYPES.METHOD)?y(e,n,t):w(t,a.SERIALIZATION_TYPES.ERROR)?(r=t,o=new Error(r.__message__),r.__code__&&(o.code=r.__code__),o):w(t,a.SERIALIZATION_TYPES.PROMISE)?function(e,n,t){return window.Promise?new window.Promise(function(r,o){return y(e,n,t.__then__)(r,o)}):_(e,n,t)}(e,n,t):w(t,a.SERIALIZATION_TYPES.ZALGO_PROMISE)?_(e,n,t):w(t,a.SERIALIZATION_TYPES.REGEX)?function(e,n,t){return new RegExp(t.__source__)}(0,0,t):t;var r,o}).obj}(n,t,r.data)),I[r.type](n,t,r)))}}function L(e){try{Object(d.noop)(e.source)}catch(e){return}W({source:e.source||e.sourceElement,origin:e.origin||e.originalEvent&&e.originalEvent.origin,data:e.data})}function C(e){return f.a.try(function(){if(!e.name)throw new Error("Expected options.name");var n=e.name,t=void 0,r=void 0;if("string"==typeof e.window){var o=document.getElementById(e.window);if(!o)throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be a valid element id");if("iframe"!==o.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.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(e.window instanceof HTMLIFrameElement){if("iframe"!==e.window.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be an iframe");if(e.window&&!e.window.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");e.window&&e.window.contentWindow&&(t=e.window.contentWindow)}else t=e.window;if(!t)throw new Error("Expected options.window to be a window object, iframe, or iframe element id.");var c=t;r=e.domain||a.WILDCARD;var s=e.name+"_"+Object(d.uniqueID)();if(Object(i.isWindowClosed)(c))throw new Error("Target window is closed");var p=!1,h=l.requestPromises.get(c);h||(h=[],l.requestPromises.set(c,h));var w=f.a.try(function(){if(Object(i.isAncestor)(window,c))return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Window",r=l.readyPromises.get(e);return r||(r=new f.a,l.readyPromises.set(e,r),-1!==n&&setTimeout(function(){return r.reject(new Error(t+" did not load after "+n+"ms"))},n),r)}(c,e.timeout||u.CHILD_WINDOW_TIMEOUT)}).then(function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(Object(d.isRegex)(r)&&!e)return v(c)}).then(function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(Object(d.isRegex)(r)){if(!Object(i.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 new f.a(function(t,r){var f=void 0;if(e.fireAndForget||function(e,n){l.responseListeners[e]=n}(s,f={name:n,window:c,domain:o,respond:function(e,n){e||(p=!0,h.splice(h.indexOf(w,1))),e?r(e):t(n)}}),E(c,{type:a.POST_MESSAGE_TYPE.REQUEST,hash:s,name:n,data:e.data,fireAndForget:e.fireAndForget},o).catch(r),e.fireAndForget)return t();var d=u.ACK_TIMEOUT,m=e.timeout||u.RES_TIMEOUT,y=100;setTimeout(function t(){if(!p){if(Object(i.isWindowClosed)(c))return f.ack?r(new Error("Window closed for "+n+" before response")):r(new Error("Window closed for "+n+" before ack"));if(d=Math.max(d-y,0),-1!==m&&(m=Math.max(m-y,0)),f.ack){if(-1===m)return;y=Math.min(m,2e3)}else{if(0===d)return r(new Error("No ack for postMessage "+n+" in "+Object(i.getDomain)()+" in "+u.ACK_TIMEOUT+"ms"));if(0===m)return r(new Error("No response for postMessage "+n+" in "+Object(i.getDomain)()+" in "+(e.timeout||u.RES_TIMEOUT)+"ms"))}setTimeout(t,y)}},y)})});return w.catch(function(){!function(e){l.erroredResponseListeners[e]=!0}(s),T(s)}),h.push(w),w})}function M(e,n,t,r){return(r=r||{}).window=e,r.name=n,r.data=t,C(r)}function N(e,n,t){var r=Object(i.getAncestor)();return r?M(r,e,n,t):new f.a(function(e,n){return n(new Error("Window does not have a parent"))})}function x(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.window)throw new Error("Expected options.window");var n=e.window;return{send:function(t,r){return M(n,t,r,e)}}}l.receivedMessages=l.receivedMessages||[],l.receiveMessage=W,l.requestPromises=l.requestPromises||new s.a,l.send=M;var k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function G(e){if(!e.name)throw new Error("Expected options.name");if(!e.handler)throw new Error("Expected options.handler");var n=e.name,t=e.window,r=e.domain,o={handler:e.handler,handleError:e.errorHandler||function(e){throw e},window:t,domain:r||a.WILDCARD,name:n},c=function e(n,t){var r=n.name,o=n.win,i=n.domain;if(!r||"string"!=typeof r)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var c=[],u=0,f=o,p=null==f?0:f.length;u<p;u++){var h=f[u];c.push(e({name:r,domain:i,win:h},t))}return{cancel:function(){for(var e=0,n=null==c?0:c.length;e<n;e++)c[e].cancel()}}}if(Array.isArray(i)){for(var w=[],m=0,y=i,_=null==y?0:y.length;m<_;m++){var v=y[m];w.push(e({name:r,win:o,domain:v},t))}return{cancel:function(){for(var e=0,n=null==w?0:w.length;e<n;e++)w[e].cancel()}}}var O=j({name:r,win:o,domain:i});if(o&&o!==a.WILDCARD||(o=l.WINDOW_WILDCARD),i=i||a.WILDCARD,O)throw o&&i?new Error("Request listener already exists for "+r+" on domain "+i.toString()+" for "+(o===l.WINDOW_WILDCARD?"wildcard":"specified")+" window"):o?new Error("Request listener already exists for "+r+" for "+(o===l.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 g=l.requestListeners,E=g[r];E||(E=new s.a,g[r]=E);var S=E.get(o);S||(S={},E.set(o,S));var P=i.toString(),T=S[b],A=void 0;return Object(d.isRegex)(i)?(T||(T=[],S[b]=T),A={regex:i,listener:t},T.push(A)):S[P]=t,{cancel:function(){S&&(delete S[P],o&&0===Object.keys(S).length&&E.delete(o),A&&T.splice(T.indexOf(A,1)))}}}({name:n,win:t,domain:r},o);if(e.once){var u=o.handler;o.handler=Object(d.once)(function(){return c.cancel(),u.apply(this,arguments)})}if(o.window&&e.errorOnClose)var f=Object(d.safeInterval)(function(){t&&"object"===(void 0===t?"undefined":k(t))&&Object(i.isWindowClosed)(t)&&(f.cancel(),o.handleError(new Error("Post message target window is closed")))},50);return{cancel:function(){c.cancel()}}}function U(e,n,t){return"function"==typeof n&&(t=n,n={}),(n=n||{}).name=e,n.handler=t||n.handler,G(n)}function H(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments[2];"function"==typeof n&&(t=n,n={}),n=n||{},t=t||n.handler;var r=n.errorHandler,o=new f.a(function(o,i){(n=n||{}).name=e,n.once=!0,n.handler=function(e){if(o(e),t)return t(e)},n.errorHandler=function(e){if(i(e),r)return r(e)}}),i=G(n);return o.cancel=i.cancel,o}function q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{on:function(n,t){return U(n,e,t)}}}function B(){delete window[a.WINDOW_PROPS.POSTROBOT],window.removeEventListener("message",L)}l.on=U;var F=Object(i.getAncestor)();function Y(e){var n=l.requestPromises.get(e);if(n)for(var t=0,r=null==n?0:n.length;t<r;t++)n[t].reject(new Error("No response from window - cleaned up"));l.popupWindowsByWin&&l.popupWindowsByWin.delete(e),l.remoteWindows&&l.remoteWindows.delete(e),l.requestPromises.delete(e),l.methods.delete(e),l.readyPromises.delete(e)}var K=null;function Z(){l.initialized||(Object(d.addEventListener)(window,"message",L),function(){var e;e=function(e){var n=e.source,t=e.origin,r=l.readyPromises.get(n)||new f.a;r.resolve({origin:t}),l.readyPromises.set(n,r)},l.on(a.POST_MESSAGE_NAMES.HELLO,{domain:a.WILDCARD},function(n){var t=n.source,r=n.origin;return e({source:t,origin:r})});var n=Object(i.getAncestor)();n&&v(n).catch(d.noop)}(),h({on:U,send:M})),l.initialized=!0}Z(),t.d(n,"cleanUpWindow",function(){return Y}),t.d(n,"Promise",function(){return f.a}),t.d(n,"bridge",function(){return K}),t.d(n,"init",function(){return Z}),t.d(n,"parent",function(){return F}),t.d(n,"send",function(){return M}),t.d(n,"request",function(){return C}),t.d(n,"sendToParent",function(){return N}),t.d(n,"client",function(){return x}),t.d(n,"on",function(){return U}),t.d(n,"listen",function(){return G}),t.d(n,"once",function(){return H}),t.d(n,"listener",function(){return q}),t.d(n,"CONFIG",function(){return u}),t.d(n,"CONSTANTS",function(){return a}),t.d(n,"disable",function(){return B}),n.default=r},function(e,n,t){"use strict";function r(e){return"[object RegExp]"===Object.prototype.toString.call(e)}n.a=f,n.c=d,n.e=l,n.j=_,n.k=function(e){if(function(){for(var e=0;e<y.length;e++)w(y[e])&&(y.splice(e,1),m.splice(e,1));for(var n=0;n<m.length;n++)_(m[n])&&(y.splice(n,1),m.splice(n,1))}(),e&&e.contentWindow)try{m.push(e.contentWindow),y.push(e)}catch(e){}},n.d=function(e){return(e=e||window).navigator.mockUserAgent||e.navigator.userAgent},n.b=v,n.f=function(e,n){var t=v(n);if(t)return t===e;if(n===e)return!1;if(function(e){if(e){try{if(e.top)return e.top}catch(e){}if(c(e)===e)return e;try{if(p(window,e)&&window.top)return window.top}catch(e){}try{if(p(e,window)&&window.top)return window.top}catch(e){}for(var n=0,t=function e(n){for(var t=[],r=0,o=h(n),i=null==o?0:o.length;r<i;r++){var a=o[r];t.push(a);for(var c=0,u=e(a),s=null==u?0:u.length;c<s;c++){var f=u[c];t.push(f)}}return t}(e),r=null==t?0:t.length;n<r;n++){var o=t[n];try{if(o.top)return o.top}catch(e){}if(c(o)===o)return o}}}(n)===n)return!1;for(var r=0,o=h(e),i=null==o?0:o.length;r<i;r++)if(o[r]===n)return!0;return!1},n.h=function(){return Boolean(u(window))},n.g=function(){return Boolean(c(window))},n.l=function e(n,t){if("string"==typeof n){if("string"==typeof t)return n===o.WILDCARD||t===n;if(r(t))return!1;if(Array.isArray(t))return!1}return r(n)?r(t)?n.toString()===t.toString():!Array.isArray(t)&&Boolean(t.match(n)):!!Array.isArray(n)&&(Array.isArray(t)?JSON.stringify(n)===JSON.stringify(t):!r(t)&&n.some(function(n){return e(n,t)}))},n.m=function(e){return Array.isArray(e)?"("+e.join(" | ")+")":r(e)?"RegExp("+e.toString():e.toString()},n.i=function(e){try{if(e===window)return!0}catch(e){if(e&&e.message===i)return!0}try{if("[object Window]"===Object.prototype.toString.call(e))return!0}catch(e){if(e&&e.message===i)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.self===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.parent===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.top===e)return!0}catch(e){if(e&&e.message===i)return!0}try{e&&e.__cross_domain_utils_window_check__}catch(e){return!0}return!1};var o={MOCK_PROTOCOL:"mock:",FILE_PROTOCOL:"file:",ABOUT_PROTOCOL:"about:",WILDCARD:"*"},i="Call was rejected by callee.\r\n";function a(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===o.ABOUT_PROTOCOL}function c(e){if(e)try{if(e.parent&&e.parent!==e)return e.parent}catch(e){}}function u(e){if(e&&!c(e))try{return e.opener}catch(e){}}function s(e){try{return e&&e.location&&e.location.href,!0}catch(e){}return!1}function f(e){var n=(e=e||window).location;if(!n)throw new Error("Can not read window location");var t=n.protocol;if(!t)throw new Error("Can not read window protocol");if(t===o.FILE_PROTOCOL)return o.FILE_PROTOCOL+"//";if(t===o.ABOUT_PROTOCOL){var r=c(e);return r&&s(r)?f(r):o.ABOUT_PROTOCOL+"//"}var i=n.host;if(!i)throw new Error("Can not read window host");return t+"//"+i}function d(e){var n=f(e=e||window);return n&&e.mockDomain&&0===e.mockDomain.indexOf(o.MOCK_PROTOCOL)?e.mockDomain:n}function l(e){try{if(e===window)return!0}catch(e){}try{var n=Object.getOwnPropertyDescriptor(e,"location");if(n&&!1===n.enumerable)return!1}catch(e){}try{if(a(e)&&s(e))return!0}catch(e){}try{if(f(e)===f(window))return!0}catch(e){}return!1}function p(e,n){if(!e||!n)return!1;var t=c(n);return t?t===e:-1!==function(e){var n=[];try{for(;e.parent!==e;)n.push(e.parent),e=e.parent}catch(e){}return n}(n).indexOf(e)}function h(e){var n=[],t=void 0;try{t=e.frames}catch(n){t=e}var r=void 0;try{r=t.length}catch(e){}if(0===r)return n;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=t[o]}catch(e){continue}n.push(i)}return n}for(var a=0;a<100;a++){var c=void 0;try{c=t[a]}catch(e){return n}if(!c)return n;n.push(c)}return n}function w(e){if(!e.contentWindow)return!0;if(!e.parentNode)return!0;var n=e.ownerDocument;return!(!n||!n.body||n.body.contains(e))}var m=[],y=[];function _(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(e===window)return!1}catch(e){return!0}try{if(!e)return!0}catch(e){return!0}try{if(e.closed)return!0}catch(e){return!e||e.message!==i}if(n&&function(e){if(!l(e))return!1;try{if(e===window)return!0;if(a(e)&&s(e))return!0;if(d(window)===d(e))return!0}catch(e){}return!1}(e))try{if(e.mockclosed)return!0}catch(e){}try{if(!e.parent||!e.top)return!0}catch(e){}var t=function(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch(e){}return-1}(m,e);if(-1!==t){var r=y[t];if(r&&w(r))return!0}return!1}function v(e){return u(e=e||window)||c(e)||void 0}},function(e,n){},function(e,n,t){"use strict";t(3),t(7)},function(e,n,t){"use strict";t(3)},function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function o(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}t(3),t(5),"function"==typeof Symbol&&Symbol.iterator,Object.assign,function(e){function n(t){return r(this,n),function(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}(this,e.call(this,"",{},t))}(function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)})(n,e),n.prototype.toString=function(){return this.childrenToString()}}(function(){function e(n,t,o){r(this,e),this.name=n,this.props=t,this.children=o}return e.prototype.toString=function(){var e=this.name,n=this.propsToString(),t=this.childrenToString();return"<"+e+(n?" ":"")+n+">"+t+"</"+e+">"},e.prototype.propsToString=function(){var e=this.props;return e?Object.keys(e).filter(function(n){return"innerHTML"!==n&&e&&!1!==e[n]}).map(function(n){if(e){var t=e[n];if(!0===t)return""+o(n);if("string"==typeof t)return o(n)+'="'+o(t)+'"'}return""}).filter(Boolean).join(" "):""},e.prototype.childrenToString=function(){if(this.props&&this.props.innerHTML)return this.props.innerHTML;if(!this.children)return"";var n="";return function t(r){for(var i=0,a=null==r?0:r.length;i<a;i++){var c=r[i];null!==c&&void 0!==c&&(Array.isArray(c)?t(c):n+=c instanceof e?c.toString():o(c))}}(this.children),n},e}())},function(e,n,t){"use strict";t(1),t(0)},function(e,n){},function(e,n,t){"use strict";t(3)},function(e,n,t){"use strict"}])}); | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("postRobot",[],n):"object"==typeof exports?exports.postRobot=n():e.postRobot=n()}("undefined"!=typeof self?self:this,function(){return function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=8)}([function(e,n,t){"use strict";var r=t(9);t.d(n,"getActualDomain",function(){return r.a}),t.d(n,"getAncestor",function(){return r.b}),t.d(n,"getDomain",function(){return r.c}),t.d(n,"getUserAgent",function(){return r.d}),t.d(n,"isActuallySameDomain",function(){return r.e}),t.d(n,"isAncestor",function(){return r.f}),t.d(n,"isIframe",function(){return r.g}),t.d(n,"isPopup",function(){return r.h}),t.d(n,"isWindow",function(){return r.i}),t.d(n,"isWindowClosed",function(){return r.j}),t.d(n,"linkFrameWindow",function(){return r.k}),t.d(n,"matchDomain",function(){return r.l}),t.d(n,"stringifyDomainPattern",function(){return r.m});var o=t(10);t.n(o)},function(e,n,t){"use strict";function r(e){try{if(!e)return!1;if("undefined"!=typeof Promise&&e instanceof Promise)return!0;if("undefined"!=typeof window&&window.Window&&e instanceof window.Window)return!1;if("undefined"!=typeof window&&window.constructor&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var t=n.call(e);if("[object Window]"===t||"[object global]"===t||"[object DOMWindow]"===t)return!1}if("function"==typeof e.then)return!0}catch(e){return!1}return!1}function o(){var e=void 0;if("undefined"!=typeof window)e=window;else{if("undefined"==typeof window)throw new TypeError("Can not find global");e=window}var n=e.__zalgopromise__=e.__zalgopromise__||{};return n.flushPromises=n.flushPromises||[],n.activeCount=n.activeCount||0,n.possiblyUnhandledPromiseHandlers=n.possiblyUnhandledPromiseHandlers||[],n.dispatchedErrors=n.dispatchedErrors||[],n}var i=function(){function e(n){var t=this;if(function(n,t){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],n){var r=void 0,o=void 0,i=!1,a=!1,c=!1;try{n(function(e){c?t.resolve(e):(i=!0,r=e)},function(e){c?t.reject(e):(a=!0,o=e)})}catch(e){return void this.reject(e)}c=!0,i?this.resolve(r):a&&this.reject(o)}}return e.prototype.resolve=function(e){if(this.resolved||this.rejected)return this;if(r(e))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},e.prototype.reject=function(e){var n=this;if(this.resolved||this.rejected)return this;if(r(e))throw new Error("Can not reject promise with another promise");if(!e){var t=e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e);e=new Error("Expected reject to be called with Error, got "+t)}return this.rejected=!0,this.error=e,this.errorHandled||setTimeout(function(){n.errorHandled||function(e,n){if(-1===o().dispatchedErrors.indexOf(e)){o().dispatchedErrors.push(e),setTimeout(function(){throw e},1);for(var t=0;t<o().possiblyUnhandledPromiseHandlers.length;t++)o().possiblyUnhandledPromiseHandlers[t](e,n)}}(e,n)},1),this.dispatch(),this},e.prototype.asyncReject=function(e){this.errorHandled=!0,this.reject(e)},e.prototype.dispatch=function(){var n=this,t=this.dispatching,i=this.resolved,a=this.rejected,c=this.handlers;if(!t&&(i||a)){this.dispatching=!0,o().activeCount+=1;for(var u=function(t){var o=c[t],u=o.onSuccess,s=o.onError,f=o.promise,d=void 0;if(i)try{d=u?u(n.value):n.value}catch(e){return f.reject(e),"continue"}else if(a){if(!s)return f.reject(n.error),"continue";try{d=s(n.error)}catch(e){return f.reject(e),"continue"}}d instanceof e&&(d.resolved||d.rejected)?(d.resolved?f.resolve(d.value):f.reject(d.error),d.errorHandled=!0):r(d)?d instanceof e&&(d.resolved||d.rejected)?d.resolved?f.resolve(d.value):f.reject(d.error):d.then(function(e){f.resolve(e)},function(e){f.reject(e)}):f.resolve(d)},s=0;s<c.length;s++)u(s);c.length=0,this.dispatching=!1,o().activeCount-=1,0===o().activeCount&&e.flushQueue()}},e.prototype.then=function(n,t){if(n&&"function"!=typeof n&&!n.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 e;return this.handlers.push({promise:r,onSuccess:n,onError:t}),this.errorHandled=!0,this.dispatch(),r},e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.finally=function(n){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.finally expected a function");return this.then(function(t){return e.try(n).then(function(){return t})},function(t){return e.try(n).then(function(){throw t})})},e.prototype.timeout=function(e,n){var t=this;if(this.resolved||this.rejected)return this;var r=setTimeout(function(){t.resolved||t.rejected||t.reject(n||new Error("Promise timed out after "+e+"ms"))},e);return this.then(function(e){return clearTimeout(r),e})},e.prototype.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},e.resolve=function(n){return n instanceof e?n:r(n)?new e(function(e,t){return n.then(e,t)}):(new e).resolve(n)},e.reject=function(n){return(new e).reject(n)},e.all=function(n){var t=new e,o=n.length,i=[];if(!o)return t.resolve(i),t;for(var a=function(a){var c=n[a];if(c instanceof e){if(c.resolved)return i[a]=c.value,o-=1,"continue"}else if(!r(c))return i[a]=c,o-=1,"continue";e.resolve(c).then(function(e){i[a]=e,0==(o-=1)&&t.resolve(i)},function(e){t.reject(e)})},c=0;c<n.length;c++)a(c);return 0===o&&t.resolve(i),t},e.hash=function(n){var t={};return e.all(Object.keys(n).map(function(r){return e.resolve(n[r]).then(function(e){t[r]=e})})).then(function(){return t})},e.map=function(n,t){return e.all(n.map(t))},e.onPossiblyUnhandledException=function(e){return function(e){return o().possiblyUnhandledPromiseHandlers.push(e),{cancel:function(){o().possiblyUnhandledPromiseHandlers.splice(o().possiblyUnhandledPromiseHandlers.indexOf(e),1)}}}(e)},e.try=function(n,t,r){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.try expected a function");var o=void 0;try{o=n.apply(t,r||[])}catch(n){return e.reject(n)}return e.resolve(o)},e.delay=function(n){return new e(function(e){setTimeout(e,n)})},e.isPromise=function(n){return!!(n&&n instanceof e)||r(n)},e.flush=function(){var n=new e;return o().flushPromises.push(n),0===o().activeCount&&e.flushQueue(),n},e.flushQueue=function(){var e=o().flushPromises;o().flushPromises=[];for(var n=0,t=null==e?0:e.length;n<t;n++)e[n].resolve()},e}();t.d(n,"a",function(){return i})},function(e,n,t){"use strict";t(6);var r=t(5);t.d(n,"addEventListener",function(){return r.a}),t(11),t(12),t(13),t(7);var o=t(3);t.d(n,"isRegex",function(){return o.f}),t.d(n,"noop",function(){return o.h}),t.d(n,"once",function(){return o.i}),t.d(n,"replaceObject",function(){return o.m}),t.d(n,"safeInterval",function(){return o.n}),t.d(n,"stringifyError",function(){return o.p}),t.d(n,"uniqueID",function(){return o.r}),t(14);var i=t(15);t.n(i),t(16),t(17)},function(e,n,t){"use strict";n.r=c,n.d=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")},n.g=function(e){var n=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new o.a;function i(){for(var n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];var c=r.getOrSet(t.thisNamespace?this:e,function(){return{}}),u=s(o),f=t.time;if(c[u]&&f&&Date.now()-c[u].time<f&&delete c[u],c[u])return c[u].value;i.__calling__=!0;var d=Date.now(),l=e.apply(this,arguments);return i.__calling__=!1,c[u]={time:d,value:l},c[u].value}return i.reset=function(){r.delete(t.thisNamespace?n:e)},t.name&&(i.displayName=t.name+":memoized"),i},n.j=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};function t(){return r.a.try(e,this,arguments)}return n.name&&(t.displayName=n.name+":promisified"),t},n.e=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=e.__inline_memoize_cache__=e.__inline_memoize_cache__||{},o=s(t);return r.hasOwnProperty(o)?r[o]:r[o]=n.apply(void 0,t)},n.h=function(){},n.i=function(e){var n=!1;return function(){if(!n)return n=!0,e.apply(this,arguments)}},n.p=function e(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(t>=3)return"stringifyError stack overflow";try{if(!n)return"<unknown error: "+Object.prototype.toString.call(n)+">";if("string"==typeof n)return n;if(n instanceof Error){var r=n&&n.stack,o=n&&n.message;if(r&&o)return-1!==r.indexOf(o)?r:o+"\n"+r;if(r)return r;if(o)return o}return"function"==typeof n.toString?n.toString():Object.prototype.toString.call(n)}catch(n){return"Error while stringifying error: "+e(n,t+1)}},n.o=function(e){return"string"==typeof e?e:e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)},n.c=function(e,n){if(!n)return e;if(Object.assign)return Object.assign(e,n);for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e},n.k=function(e,n,t){var r=[];return e.replace(n,function(e){r.push(t?t.apply(null,arguments):e)}),r},n.q=function(e){return"data:image/svg+xml;base64,"+a(e)},n.l=function(e,n){var t=[];return e.replace(n,function(e){return t.push(e),""}),t},n.n=function(e,n){var t=void 0;return function r(){t=setTimeout(function(){e(),r()},n)}(),{cancel:function(){clearTimeout(t)}}},n.a=function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},n.m=function e(n,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(Array.isArray(n)){for(var o=n.length,i=[],a=function(o){f(i,o,function(){var i=r?r+"."+o:""+o,a=n[o],c=t(a,o,i);return(l(c)||Array.isArray(c))&&(c=e(c,t,i)),c})},c=0;c<o;c++)a(c);return i}if(l(n)){var u={},s=function(o){if(!n.hasOwnProperty(o))return"continue";f(u,o,function(){var i=r?r+"."+o:""+o,a=n[o],c=t(a,o,i);return(l(c)||Array.isArray(c))&&(c=e(c,t,i)),c})};for(var d in n)s(d);return u}throw new Error("Pass an object or array")},n.b=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,t=void 0;return function(){var r=this,o=arguments;clearTimeout(t),t=setTimeout(function(){return e.apply(r,o)},n)}},n.f=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)};var r=t(1),o=t(4),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function a(e){return window.btoa(e)}function c(){var e="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})+"_"+a((new Date).toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var u=void 0;function s(e){try{return JSON.stringify(Array.prototype.slice.call(e),function(e,n){return"function"==typeof n?"memoize["+function(e){if(u=u||new o.a,null===e||void 0===e||"object"!==(void 0===e?"undefined":i(e))&&"function"!=typeof e)throw new Error("Invalid object");var n=u.get(e);return n||(n=(void 0===e?"undefined":i(e))+":"+c(),u.set(e,n)),n}(n)+"]":n})}catch(e){throw new Error("Arguments not serializable -- can not be used to memoize")}}function f(e,n,t){if(Array.isArray(e)){if("number"!=typeof n)throw new TypeError("Array key must be number")}else if("object"===(void 0===e?"undefined":i(e))&&null!==e&&"string"!=typeof n)throw new TypeError("Object key must be string");Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:function(){delete e[n];var r=t();return e[n]=r,r},set:function(t){delete e[n],e[n]=t}})}function d(e){return"object"===(void 0===(n=e)?"undefined":i(n))&&null!==n&&"[object Object]"===Object.prototype.toString.call(e);var n}function l(e){if(!d(e))return!1;var n=e.constructor;if("function"!=typeof n)return!1;var t=n.prototype;return!!d(t)&&!!t.hasOwnProperty("isPrototypeOf")}},function(e,n,t){"use strict";t.d({},"WeakMap",function(){return c});var r=t(0);function o(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch(e){}return-1}var i=Object.defineProperty,a=Date.now()%1e9,c=function(){function e(){if(function(n,t){if(!(n instanceof e))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 e=new WeakMap,n={};return Object.freeze(n),e.set(n,"__testvalue__"),"__testvalue__"===e.get(n)}catch(e){return!1}}())try{this.weakmap=new WeakMap}catch(e){}this.keys=[],this.values=[]}return e.prototype._cleanupClosedWindows=function(){for(var e=this.weakmap,n=this.keys,t=0;t<n.length;t++){var o=n[t];if(Object(r.isWindow)(o)&&Object(r.isWindowClosed)(o)){if(e)try{e.delete(o)}catch(e){}n.splice(t,1),this.values.splice(t,1),t-=1}}},e.prototype.isSafeToReadWrite=function(e){if(Object(r.isWindow)(e))return!1;try{e&&e.self,e&&e[this.name]}catch(e){return!1}return!0},e.prototype.set=function(e,n){if(!e)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{t.set(e,n)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var r=this.name,a=e[r];a&&a[0]===e?a[1]=n:i(e,r,{value:[e,n],writable:!0})}else{this._cleanupClosedWindows();var c=this.keys,u=this.values,s=o(c,e);-1===s?(c.push(e),u.push(n)):u[s]=n}},e.prototype.get=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{if(n.has(e))return n.get(e)}catch(e){delete this.weakmap}if(!this.isSafeToReadWrite(e)){this._cleanupClosedWindows();var t=o(this.keys,e);if(-1===t)return;return this.values[t]}var r=e[this.name];if(r&&r[0]===e)return r[1]},e.prototype.delete=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{n.delete(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var t=e[this.name];t&&t[0]===e&&(t[0]=t[1]=void 0)}else{this._cleanupClosedWindows();var r=this.keys,i=o(r,e);-1!==i&&(r.splice(i,1),this.values.splice(i,1))}},e.prototype.has=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{return n.has(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var t=e[this.name];return!(!t||t[0]!==e)}return this._cleanupClosedWindows(),-1!==o(this.keys,e)},e.prototype.getOrSet=function(e,n){if(this.has(e))return this.get(e);var t=n();return this.set(e,t),t},e}();t.d(n,"a",function(){return c})},function(e,n,t){"use strict";t(1),t(0),t(4);var r=t(3);t(6),n.d=function e(){return Object(r.e)(e,function(){try{if("undefined"==typeof window)return!1;if(window.localStorage){var e=Math.random().toString();window.localStorage.setItem("__test__localStorage__",e);var n=window.localStorage.getItem("__test__localStorage__");if(window.localStorage.removeItem("__test__localStorage__"),e===n)return!0}}catch(e){}return!1})},n.b=function(e,n){e.appendChild(n)},n.g=function(e,n){try{e.document.open(),e.document.write(n),e.document.close()}catch(t){try{e.location="javascript: document.open(); document.write("+JSON.stringify(n)+"); document.close();"}catch(e){}}},n.f=function(e,n){var t=n.tagName.toLowerCase();if("html"!==t)throw new Error("Expected element to be html, got "+t);for(var r=e.document.documentElement;r.children&&r.children.length;)r.removeChild(r.children[0]);for(;n.children.length;)r.appendChild(n.children[0])},n.e=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.document;e.styleSheet?e.styleSheet.cssText=n:e.appendChild(t.createTextNode(n))},n.a=function(e,n,t){return e.addEventListener(n,t),{cancel:function(){e.removeEventListener(n,t)}}},n.c=function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.document,t=0,r=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.document;return Array.prototype.slice.call(n.querySelectorAll(e))}("script",e),o=null==r?0:r.length;t<o;t++){var i=r[t],a=i.parentNode;if(a){var c=n.createElement("script");c.text=i.textContent,a.replaceChild(c,i)}}},"function"==typeof Symbol&&Symbol.iterator,Object.assign,Object.create(Error.prototype)},function(e,n,t){"use strict";n.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(e,n,t){"use strict";n.a=function e(n){var t=n.name,i=n.version,a=void 0===i?"latest":i,c=n.lifetime,u=void 0===c?3e5:c;return Object(r.e)(e,function(){var e="__"+t+"_"+a+"_storage__",n=void 0;function i(t){var i=Object(o.d)(),a=void 0;if(n&&(a=n),!a&&i){var c=window.localStorage.getItem(e);c&&(a=JSON.parse(c))}a||(a=Object(r.d)()[e]),a||(a={id:Object(r.r)()}),a.id||(a.id=Object(r.r)()),n=a;var u=t(a);return i?window.localStorage.setItem(e,JSON.stringify(a)):Object(r.d)()[e]=a,n=null,u}function c(e){return i(function(n){var t=n.__session__,o=Date.now();return t&&o-t.created>u&&(t=null),t||(t={guid:Object(r.r)(),created:o}),n.__session__=t,e(t)})}return{getState:i,getID:function(){return i(function(e){return e.id})},getSessionState:function(e){return c(function(n){return n.state=n.state||{},e(n.state)})},getSessionID:function(){return c(function(e){return e.guid})}}},[{name:t,version:a,lifetime:u}])};var r=t(3),o=t(5)},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={};t.d(r,"markWindowKnown",function(){return O}),t.d(r,"cleanUpWindow",function(){return K}),t.d(r,"Promise",function(){return f.a}),t.d(r,"bridge",function(){return Z}),t.d(r,"init",function(){return z}),t.d(r,"parent",function(){return Y}),t.d(r,"send",function(){return N}),t.d(r,"request",function(){return M}),t.d(r,"sendToParent",function(){return x}),t.d(r,"client",function(){return k}),t.d(r,"on",function(){return H}),t.d(r,"listen",function(){return U}),t.d(r,"once",function(){return q}),t.d(r,"listener",function(){return B}),t.d(r,"CONFIG",function(){return u}),t.d(r,"CONSTANTS",function(){return a}),t.d(r,"disable",function(){return F});var o,i=t(0),a={POST_MESSAGE_TYPE:{REQUEST:"postrobot_message_request",RESPONSE:"postrobot_message_response",ACK:"postrobot_message_ack"},POST_MESSAGE_ACK:{SUCCESS:"success",ERROR:"error"},POST_MESSAGE_NAMES:{METHOD:"postrobot_method",HELLO:"postrobot_ready",OPEN_TUNNEL:"postrobot_open_tunnel"},WINDOW_TYPES:{FULLPAGE:"fullpage",POPUP:"popup",IFRAME:"iframe"},WINDOW_PROPS:{POSTROBOT:"__postRobot__"},SERIALIZATION_TYPES:{METHOD:"postrobot_method",ERROR:"postrobot_error",PROMISE:"postrobot_promise",ZALGO_PROMISE:"postrobot_zalgo_promise",REGEX:"regex"},SEND_STRATEGIES:{POST_MESSAGE:"postrobot_post_message",BRIDGE:"postrobot_bridge",GLOBAL:"postrobot_global"},MOCK_PROTOCOL:"mock:",FILE_PROTOCOL:"file:",BRIDGE_NAME_PREFIX:"__postrobot_bridge__",POSTROBOT_PROXY:"__postrobot_proxy__",WILDCARD:"*"},c={METHOD:"postrobot_method",HELLO:"postrobot_hello",OPEN_TUNNEL:"postrobot_open_tunnel"},u=(Object.keys(c).map(function(e){return c[e]}),{ALLOW_POSTMESSAGE_POPUP:!("__ALLOW_POSTMESSAGE_POPUP__"in window)||window.__ALLOW_POSTMESSAGE_POPUP__,BRIDGE_TIMEOUT:5e3,CHILD_WINDOW_TIMEOUT:5e3,ACK_TIMEOUT:2e3,ACK_TIMEOUT_KNOWN:1e4,RES_TIMEOUT:-1,ALLOWED_POST_MESSAGE_METHODS:(o={},o[a.SEND_STRATEGIES.POST_MESSAGE]=!0,o[a.SEND_STRATEGIES.BRIDGE]=!0,o[a.SEND_STRATEGIES.GLOBAL]=!0,o)});0===window.location.href.indexOf(a.FILE_PROTOCOL)&&(u.ALLOW_POSTMESSAGE_POPUP=!0);var s=t(4),f=t(1),d=t(2),l=window[a.WINDOW_PROPS.POSTROBOT]=window[a.WINDOW_PROPS.POSTROBOT]||{};l.registerSelf=function(){};var p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};l.methods=l.methods||new s.a;var h=Object(d.once)(function(){l.on(a.POST_MESSAGE_NAMES.METHOD,{origin:a.WILDCARD},function(e){var n=e.source,t=e.origin,r=e.data,o=l.methods.get(n);if(!o)throw new Error("Could not find any methods this window has privileges to call");var a=o[r.id];if(!a)throw new Error("Could not find method with id: "+r.id);if(!Object(i.matchDomain)(a.domain,t))throw new Error("Method domain "+a.domain+" does not match origin "+t);return f.a.try(function(){return a.method.apply({source:n,origin:t,data:r},r.args)}).then(function(e){return{result:e,id:r.id,name:r.name}})})});function w(e,n){return"object"===(void 0===e?"undefined":p(e))&&null!==e&&e.__type__===n}function m(e,n,t,r){var o=Object(d.uniqueID)(),i=l.methods.get(e);return i||(i={},l.methods.set(e,i)),i[o]={domain:n,method:t},{__type__:a.SERIALIZATION_TYPES.METHOD,__id__:o,__name__:r}}function y(e,n,t){function r(){var r=Array.prototype.slice.call(arguments);return l.send(e,a.POST_MESSAGE_NAMES.METHOD,{id:t.__id__,name:t.__name__,args:r},{domain:n,timeout:-1}).then(function(e){return e.data.result},function(e){throw e})}return r.__name__=t.__name__,r.__xdomain__=!0,r.source=e,r.origin=n,r}function _(e,n,t){return new f.a(function(r,o){return y(e,n,t.__then__)(r,o)})}function v(e){return l.send(e,a.POST_MESSAGE_NAMES.HELLO,{},{domain:a.WILDCARD,timeout:-1}).then(function(e){return{origin:e.origin}})}function O(e){l.knownWindows.set(e,!0)}l.readyPromises=l.readyPromises||new s.a,l.knownWindows=l.knownWindows||new s.a;var g={};g[a.SEND_STRATEGIES.POST_MESSAGE]=function(e,n,t){(Array.isArray(t)?t:"string"==typeof t?[t]:[a.WILDCARD]).map(function(n){if(0===n.indexOf(a.MOCK_PROTOCOL)){if(window.location.protocol===a.FILE_PROTOCOL)return a.WILDCARD;if(!Object(i.isActuallySameDomain)(e))throw new Error("Attempting to send messsage to mock domain "+n+", but window is actually cross-domain");return Object(i.getActualDomain)(e)}return 0===n.indexOf(a.FILE_PROTOCOL)?a.WILDCARD:n}).forEach(function(t){return e.postMessage(n,t)})};var E=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e};function S(e,n,t){return f.a.try(function(){var r;if(n=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object(d.uniqueID)(),o=Object(i.isPopup)()?a.WINDOW_TYPES.POPUP:Object(i.isIframe)()?a.WINDOW_TYPES.IFRAME:a.WINDOW_TYPES.FULLPAGE,c=Object(i.getDomain)(window);return E({},n,t,{sourceDomain:c,id:n.id||r,windowType:o})}(e,n,{data:function(e,n,t){return Object(d.replaceObject)({obj:t},function(t,r){return"function"==typeof t?m(e,n,t,r.toString()):t instanceof Error?(o=t,{__type__:a.SERIALIZATION_TYPES.ERROR,__message__:Object(d.stringifyError)(o),__code__:o.code}):window.Promise&&t instanceof window.Promise?function(e,n,t,r){return{__type__:a.SERIALIZATION_TYPES.PROMISE,__then__:m(e,n,function(e,n){return t.then(e,n)},r+".then")}}(e,n,t,r.toString()):f.a.isPromise(t)?function(e,n,t,r){return{__type__:a.SERIALIZATION_TYPES.ZALGO_PROMISE,__then__:m(e,n,function(e,n){return t.then(e,n)},r+".then")}}(e,n,t,r.toString()):Object(d.isRegex)(t)?(i=t,{__type__:a.SERIALIZATION_TYPES.REGEX,__source__:i.source}):t;var o,i}).obj}(e,t,n.data),domain:t}),Object(i.isWindowClosed)(e))throw new Error("Window is closed");var o=[],c=JSON.stringify(((r={})[a.WINDOW_PROPS.POSTROBOT]=n,r),null,2);return f.a.map(Object.keys(g),function(n){return f.a.try(function(){if(!u.ALLOWED_POST_MESSAGE_METHODS[n])throw new Error("Strategy disallowed: "+n);return g[n](e,c,t)}).then(function(){return o.push(n+": success"),!0},function(e){return o.push(n+": "+Object(d.stringifyError)(e)+"\n"),!1})}).then(function(e){var t=e.some(Boolean),r=n.type+" "+n.name+" "+(t?"success":"error")+":\n - "+o.join("\n - ")+"\n";if(!t)throw new Error(r)})})}l.responseListeners=l.responseListeners||{},l.requestListeners=l.requestListeners||{},l.WINDOW_WILDCARD=l.WINDOW_WILDCARD||new function(){},l.erroredResponseListeners=l.erroredResponseListeners||{};var b,P="__domain_regex__";function T(e){return l.responseListeners[e]}function A(e){delete l.responseListeners[e]}function j(e){return Boolean(l.erroredResponseListeners[e])}function R(e){var n=e.name,t=e.win,r=e.domain;if(t===a.WILDCARD&&(t=null),r===a.WILDCARD&&(r=null),!n)throw new Error("Name required to get request listener");var o=l.requestListeners[n];if(o)for(var c=0,u=[t,l.WINDOW_WILDCARD],s=null==u?0:u.length;c<s;c++){var f=u[c],d=f&&o.get(f);if(d){if(r&&"string"==typeof r){if(d[r])return d[r];if(d[P])for(var p=0,h=d[P],w=null==h?0:h.length;p<w;p++){var m=h[p],y=m.regex,_=m.listener;if(Object(i.matchDomain)(y,r))return _}}if(d[a.WILDCARD])return d[a.WILDCARD]}}}var I=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},W=((b={})[a.POST_MESSAGE_TYPE.ACK]=function(e,n,t){if(!j(t.hash)){var r=T(t.hash);if(!r)throw new Error("No handler found for post message ack for message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(r.domain,n))throw new Error("Ack origin "+n+" does not match domain "+r.domain.toString());r.ack=!0}},b[a.POST_MESSAGE_TYPE.REQUEST]=function(e,n,t){var r=R({name:t.name,win:e,domain:n});function o(r){return t.fireAndForget||Object(i.isWindowClosed)(e)?f.a.resolve():S(e,I({target:t.originalSource,hash:t.hash,name:t.name},r),n)}return f.a.all([o({type:a.POST_MESSAGE_TYPE.ACK}),f.a.try(function(){if(!r)throw new Error("No handler found for post message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(r.domain,n))throw new Error("Request origin "+n+" does not match domain "+r.domain.toString());var o=t.data;return r.handler({source:e,origin:n,data:o})}).then(function(e){return o({type:a.POST_MESSAGE_TYPE.RESPONSE,ack:a.POST_MESSAGE_ACK.SUCCESS,data:e})},function(e){var n=Object(d.stringifyError)(e).replace(/^Error: /,""),t=e.code;return o({type:a.POST_MESSAGE_TYPE.RESPONSE,ack:a.POST_MESSAGE_ACK.ERROR,error:n,code:t})})]).then(d.noop).catch(function(e){if(r&&r.handleError)return r.handleError(e);throw e})},b[a.POST_MESSAGE_TYPE.RESPONSE]=function(e,n,t){if(!j(t.hash)){var r=T(t.hash);if(!r)throw new Error("No handler found for post message response for message: "+t.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(r.domain,n))throw new Error("Response origin "+n+" does not match domain "+Object(i.stringifyDomainPattern)(r.domain));if(A(t.hash),t.ack===a.POST_MESSAGE_ACK.ERROR){var o=new Error(t.error);return t.code&&(o.code=t.code),r.respond(o,null)}if(t.ack===a.POST_MESSAGE_ACK.SUCCESS){var c=t.data||t.response;return r.respond(null,{source:e,origin:n,data:c})}}},b),D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function L(e){if(!window||window.closed)throw new Error("Message recieved in closed window");try{if(!e.source)return}catch(e){return}var n=e.source,t=e.origin,r=function(e){var n=void 0;try{n=JSON.parse(e)}catch(e){return}if(n&&"object"===(void 0===n?"undefined":D(n))&&null!==n&&(n=n[a.WINDOW_PROPS.POSTROBOT])&&"object"===(void 0===n?"undefined":D(n))&&null!==n&&n.type&&"string"==typeof n.type&&W[n.type])return n}(e.data);if(r){if(O(n),!r.sourceDomain||"string"!=typeof r.sourceDomain)throw new Error("Expected message to have sourceDomain");0!==r.sourceDomain.indexOf(a.MOCK_PROTOCOL)&&0!==r.sourceDomain.indexOf(a.FILE_PROTOCOL)||(t=r.sourceDomain),-1===l.receivedMessages.indexOf(r.id)&&(l.receivedMessages.push(r.id),Object(i.isWindowClosed)(n)&&!r.fireAndForget||(r.data&&(r.data=function(e,n,t){return Object(d.replaceObject)({obj:t},function(t){return"object"!==(void 0===t?"undefined":p(t))||null===t?t:w(t,a.SERIALIZATION_TYPES.METHOD)?y(e,n,t):w(t,a.SERIALIZATION_TYPES.ERROR)?(r=t,o=new Error(r.__message__),r.__code__&&(o.code=r.__code__),o):w(t,a.SERIALIZATION_TYPES.PROMISE)?function(e,n,t){return window.Promise?new window.Promise(function(r,o){return y(e,n,t.__then__)(r,o)}):_(e,n,t)}(e,n,t):w(t,a.SERIALIZATION_TYPES.ZALGO_PROMISE)?_(e,n,t):w(t,a.SERIALIZATION_TYPES.REGEX)?function(e,n,t){return new RegExp(t.__source__)}(0,0,t):t;var r,o}).obj}(n,t,r.data)),W[r.type](n,t,r)))}}function C(e){try{Object(d.noop)(e.source)}catch(e){return}L({source:e.source||e.sourceElement,origin:e.origin||e.originalEvent&&e.originalEvent.origin,data:e.data})}function M(e){return f.a.try(function(){if(!e.name)throw new Error("Expected options.name");var n=e.name,t=void 0,r=void 0;if("string"==typeof e.window){var o=document.getElementById(e.window);if(!o)throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be a valid element id");if("iframe"!==o.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.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(e.window instanceof HTMLIFrameElement){if("iframe"!==e.window.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be an iframe");if(e.window&&!e.window.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");e.window&&e.window.contentWindow&&(t=e.window.contentWindow)}else t=e.window;if(!t)throw new Error("Expected options.window to be a window object, iframe, or iframe element id.");var c=t;r=e.domain||a.WILDCARD;var s=e.name+"_"+Object(d.uniqueID)();if(Object(i.isWindowClosed)(c))throw new Error("Target window is closed");var p=!1,h=l.requestPromises.get(c);h||(h=[],l.requestPromises.set(c,h));var w=f.a.try(function(){if(Object(i.isAncestor)(window,c))return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Window",r=l.readyPromises.get(e);return r||(r=new f.a,l.readyPromises.set(e,r),-1!==n&&setTimeout(function(){return r.reject(new Error(t+" did not load after "+n+"ms"))},n),r)}(c,e.timeout||u.CHILD_WINDOW_TIMEOUT)}).then(function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(Object(d.isRegex)(r)&&!e)return v(c)}).then(function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(Object(d.isRegex)(r)){if(!Object(i.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 new f.a(function(t,r){var f=void 0;if(e.fireAndForget||function(e,n){l.responseListeners[e]=n}(s,f={name:n,window:c,domain:o,respond:function(e,n){e||(p=!0,h.splice(h.indexOf(w,1))),e?r(e):t(n)}}),S(c,{type:a.POST_MESSAGE_TYPE.REQUEST,hash:s,name:n,data:e.data,fireAndForget:e.fireAndForget},o).catch(r),e.fireAndForget)return t();var d=function(e){return l.knownWindows.get(e)}(c)?u.ACK_TIMEOUT_KNOWN:u.ACK_TIMEOUT,m=e.timeout||u.RES_TIMEOUT,y=d,_=m,v=100;setTimeout(function e(){if(!p){if(Object(i.isWindowClosed)(c))return f.ack?r(new Error("Window closed for "+n+" before response")):r(new Error("Window closed for "+n+" before ack"));if(y=Math.max(y-v,0),-1!==_&&(_=Math.max(_-v,0)),f.ack){if(-1===_)return;v=Math.min(_,2e3)}else{if(0===y)return r(new Error("No ack for postMessage "+n+" in "+Object(i.getDomain)()+" in "+d+"ms"));if(0===_)return r(new Error("No response for postMessage "+n+" in "+Object(i.getDomain)()+" in "+m+"ms"))}setTimeout(e,v)}},v)})});return w.catch(function(){!function(e){l.erroredResponseListeners[e]=!0}(s),A(s)}),h.push(w),w})}function N(e,n,t,r){return(r=r||{}).window=e,r.name=n,r.data=t,M(r)}function x(e,n,t){var r=Object(i.getAncestor)();return r?N(r,e,n,t):new f.a(function(e,n){return n(new Error("Window does not have a parent"))})}function k(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.window)throw new Error("Expected options.window");var n=e.window;return{send:function(t,r){return N(n,t,r,e)}}}l.receivedMessages=l.receivedMessages||[],l.receiveMessage=L,l.requestPromises=l.requestPromises||new s.a,l.send=N;var G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function U(e){if(!e.name)throw new Error("Expected options.name");if(!e.handler)throw new Error("Expected options.handler");var n=e.name,t=e.window,r=e.domain,o={handler:e.handler,handleError:e.errorHandler||function(e){throw e},window:t,domain:r||a.WILDCARD,name:n},c=function e(n,t){var r=n.name,o=n.win,i=n.domain;if(!r||"string"!=typeof r)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var c=[],u=0,f=o,p=null==f?0:f.length;u<p;u++){var h=f[u];c.push(e({name:r,domain:i,win:h},t))}return{cancel:function(){for(var e=0,n=null==c?0:c.length;e<n;e++)c[e].cancel()}}}if(Array.isArray(i)){for(var w=[],m=0,y=i,_=null==y?0:y.length;m<_;m++){var v=y[m];w.push(e({name:r,win:o,domain:v},t))}return{cancel:function(){for(var e=0,n=null==w?0:w.length;e<n;e++)w[e].cancel()}}}var O=R({name:r,win:o,domain:i});if(o&&o!==a.WILDCARD||(o=l.WINDOW_WILDCARD),i=i||a.WILDCARD,O)throw o&&i?new Error("Request listener already exists for "+r+" on domain "+i.toString()+" for "+(o===l.WINDOW_WILDCARD?"wildcard":"specified")+" window"):o?new Error("Request listener already exists for "+r+" for "+(o===l.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 g=l.requestListeners,E=g[r];E||(E=new s.a,g[r]=E);var S=E.get(o);S||(S={},E.set(o,S));var b=i.toString(),T=S[P],A=void 0;return Object(d.isRegex)(i)?(T||(T=[],S[P]=T),A={regex:i,listener:t},T.push(A)):S[b]=t,{cancel:function(){S&&(delete S[b],o&&0===Object.keys(S).length&&E.delete(o),A&&T.splice(T.indexOf(A,1)))}}}({name:n,win:t,domain:r},o);if(e.once){var u=o.handler;o.handler=Object(d.once)(function(){return c.cancel(),u.apply(this,arguments)})}if(o.window&&e.errorOnClose)var f=Object(d.safeInterval)(function(){t&&"object"===(void 0===t?"undefined":G(t))&&Object(i.isWindowClosed)(t)&&(f.cancel(),o.handleError(new Error("Post message target window is closed")))},50);return{cancel:function(){c.cancel()}}}function H(e,n,t){return"function"==typeof n&&(t=n,n={}),(n=n||{}).name=e,n.handler=t||n.handler,U(n)}function q(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments[2];"function"==typeof n&&(t=n,n={}),n=n||{},t=t||n.handler;var r=n.errorHandler,o=new f.a(function(o,i){(n=n||{}).name=e,n.once=!0,n.handler=function(e){if(o(e),t)return t(e)},n.errorHandler=function(e){if(i(e),r)return r(e)}}),i=U(n);return o.cancel=i.cancel,o}function B(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{on:function(n,t){return H(n,e,t)}}}function F(){delete window[a.WINDOW_PROPS.POSTROBOT],window.removeEventListener("message",C)}l.on=H;var Y=Object(i.getAncestor)();function K(e){var n=l.requestPromises.get(e);if(n)for(var t=0,r=null==n?0:n.length;t<r;t++)n[t].reject(new Error("No response from window - cleaned up"));l.popupWindowsByWin&&l.popupWindowsByWin.delete(e),l.remoteWindows&&l.remoteWindows.delete(e),l.requestPromises.delete(e),l.methods.delete(e),l.readyPromises.delete(e)}var Z=null;function z(){l.initialized||(Object(d.addEventListener)(window,"message",C),function(){var e;e=function(e){var n=e.source,t=e.origin,r=l.readyPromises.get(n)||new f.a;r.resolve({origin:t}),l.readyPromises.set(n,r)},l.on(a.POST_MESSAGE_NAMES.HELLO,{domain:a.WILDCARD},function(n){var t=n.source,r=n.origin;return e({source:t,origin:r})});var n=Object(i.getAncestor)();n&&v(n).catch(d.noop)}(),h({on:H,send:N})),l.initialized=!0}z(),t.d(n,"markWindowKnown",function(){return O}),t.d(n,"cleanUpWindow",function(){return K}),t.d(n,"Promise",function(){return f.a}),t.d(n,"bridge",function(){return Z}),t.d(n,"init",function(){return z}),t.d(n,"parent",function(){return Y}),t.d(n,"send",function(){return N}),t.d(n,"request",function(){return M}),t.d(n,"sendToParent",function(){return x}),t.d(n,"client",function(){return k}),t.d(n,"on",function(){return H}),t.d(n,"listen",function(){return U}),t.d(n,"once",function(){return q}),t.d(n,"listener",function(){return B}),t.d(n,"CONFIG",function(){return u}),t.d(n,"CONSTANTS",function(){return a}),t.d(n,"disable",function(){return F}),n.default=r},function(e,n,t){"use strict";function r(e){return"[object RegExp]"===Object.prototype.toString.call(e)}n.a=f,n.c=d,n.e=l,n.j=_,n.k=function(e){if(function(){for(var e=0;e<y.length;e++)w(y[e])&&(y.splice(e,1),m.splice(e,1));for(var n=0;n<m.length;n++)_(m[n])&&(y.splice(n,1),m.splice(n,1))}(),e&&e.contentWindow)try{m.push(e.contentWindow),y.push(e)}catch(e){}},n.d=function(e){return(e=e||window).navigator.mockUserAgent||e.navigator.userAgent},n.b=v,n.f=function(e,n){var t=v(n);if(t)return t===e;if(n===e)return!1;if(function(e){if(e){try{if(e.top)return e.top}catch(e){}if(c(e)===e)return e;try{if(p(window,e)&&window.top)return window.top}catch(e){}try{if(p(e,window)&&window.top)return window.top}catch(e){}for(var n=0,t=function e(n){for(var t=[],r=0,o=h(n),i=null==o?0:o.length;r<i;r++){var a=o[r];t.push(a);for(var c=0,u=e(a),s=null==u?0:u.length;c<s;c++){var f=u[c];t.push(f)}}return t}(e),r=null==t?0:t.length;n<r;n++){var o=t[n];try{if(o.top)return o.top}catch(e){}if(c(o)===o)return o}}}(n)===n)return!1;for(var r=0,o=h(e),i=null==o?0:o.length;r<i;r++)if(o[r]===n)return!0;return!1},n.h=function(){return Boolean(u(window))},n.g=function(){return Boolean(c(window))},n.l=function e(n,t){if("string"==typeof n){if("string"==typeof t)return n===o.WILDCARD||t===n;if(r(t))return!1;if(Array.isArray(t))return!1}return r(n)?r(t)?n.toString()===t.toString():!Array.isArray(t)&&Boolean(t.match(n)):!!Array.isArray(n)&&(Array.isArray(t)?JSON.stringify(n)===JSON.stringify(t):!r(t)&&n.some(function(n){return e(n,t)}))},n.m=function(e){return Array.isArray(e)?"("+e.join(" | ")+")":r(e)?"RegExp("+e.toString():e.toString()},n.i=function(e){try{if(e===window)return!0}catch(e){if(e&&e.message===i)return!0}try{if("[object Window]"===Object.prototype.toString.call(e))return!0}catch(e){if(e&&e.message===i)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.self===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.parent===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.top===e)return!0}catch(e){if(e&&e.message===i)return!0}try{e&&e.__cross_domain_utils_window_check__}catch(e){return!0}return!1};var o={MOCK_PROTOCOL:"mock:",FILE_PROTOCOL:"file:",ABOUT_PROTOCOL:"about:",WILDCARD:"*"},i="Call was rejected by callee.\r\n";function a(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===o.ABOUT_PROTOCOL}function c(e){if(e)try{if(e.parent&&e.parent!==e)return e.parent}catch(e){}}function u(e){if(e&&!c(e))try{return e.opener}catch(e){}}function s(e){try{return e&&e.location&&e.location.href,!0}catch(e){}return!1}function f(e){var n=(e=e||window).location;if(!n)throw new Error("Can not read window location");var t=n.protocol;if(!t)throw new Error("Can not read window protocol");if(t===o.FILE_PROTOCOL)return o.FILE_PROTOCOL+"//";if(t===o.ABOUT_PROTOCOL){var r=c(e);return r&&s(r)?f(r):o.ABOUT_PROTOCOL+"//"}var i=n.host;if(!i)throw new Error("Can not read window host");return t+"//"+i}function d(e){var n=f(e=e||window);return n&&e.mockDomain&&0===e.mockDomain.indexOf(o.MOCK_PROTOCOL)?e.mockDomain:n}function l(e){try{if(e===window)return!0}catch(e){}try{var n=Object.getOwnPropertyDescriptor(e,"location");if(n&&!1===n.enumerable)return!1}catch(e){}try{if(a(e)&&s(e))return!0}catch(e){}try{if(f(e)===f(window))return!0}catch(e){}return!1}function p(e,n){if(!e||!n)return!1;var t=c(n);return t?t===e:-1!==function(e){var n=[];try{for(;e.parent!==e;)n.push(e.parent),e=e.parent}catch(e){}return n}(n).indexOf(e)}function h(e){var n=[],t=void 0;try{t=e.frames}catch(n){t=e}var r=void 0;try{r=t.length}catch(e){}if(0===r)return n;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=t[o]}catch(e){continue}n.push(i)}return n}for(var a=0;a<100;a++){var c=void 0;try{c=t[a]}catch(e){return n}if(!c)return n;n.push(c)}return n}function w(e){if(!e.contentWindow)return!0;if(!e.parentNode)return!0;var n=e.ownerDocument;return!(!n||!n.documentElement||n.documentElement.contains(e))}var m=[],y=[];function _(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(e===window)return!1}catch(e){return!0}try{if(!e)return!0}catch(e){return!0}try{if(e.closed)return!0}catch(e){return!e||e.message!==i}if(n&&function(e){if(!l(e))return!1;try{if(e===window)return!0;if(a(e)&&s(e))return!0;if(d(window)===d(e))return!0}catch(e){}return!1}(e))try{if(e.mockclosed)return!0}catch(e){}try{if(!e.parent||!e.top)return!0}catch(e){}var t=function(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch(e){}return-1}(m,e);if(-1!==t){var r=y[t];if(r&&w(r))return!0}return!1}function v(e){return u(e=e||window)||c(e)||void 0}},function(e,n){},function(e,n,t){"use strict";t(3),t(7)},function(e,n,t){"use strict";t(3)},function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function o(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}t(3),t(5),"function"==typeof Symbol&&Symbol.iterator,Object.assign,function(e){function n(t){return r(this,n),function(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}(this,e.call(this,"",{},t))}(function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)})(n,e),n.prototype.toString=function(){return this.childrenToString()}}(function(){function e(n,t,o){r(this,e),this.name=n,this.props=t,this.children=o}return e.prototype.toString=function(){var e=this.name,n=this.propsToString(),t=this.childrenToString();return"<"+e+(n?" ":"")+n+">"+t+"</"+e+">"},e.prototype.propsToString=function(){var e=this.props;return e?Object.keys(e).filter(function(n){return"innerHTML"!==n&&e&&!1!==e[n]}).map(function(n){if(e){var t=e[n];if(!0===t)return""+o(n);if("string"==typeof t)return o(n)+'="'+o(t)+'"'}return""}).filter(Boolean).join(" "):""},e.prototype.childrenToString=function(){if(this.props&&this.props.innerHTML)return this.props.innerHTML;if(!this.children)return"";var n="";return function t(r){for(var i=0,a=null==r?0:r.length;i<a;i++){var c=r[i];null!==c&&void 0!==c&&(Array.isArray(c)?t(c):n+=c instanceof e?c.toString():o(c))}}(this.children),n},e}())},function(e,n,t){"use strict";t(1),t(0)},function(e,n){},function(e,n,t){"use strict";t(3)},function(e,n,t){"use strict"}])}); | ||
//# sourceMappingURL=post-robot.min.js.map | ||
//# sourceMappingURL=post-robot.min.js.map |
{ | ||
"name": "post-robot", | ||
"version": "9.0.1", | ||
"version": "9.0.2", | ||
"description": "Simple postMessage based server.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,4 +14,5 @@ /* @flow */ | ||
ACK_TIMEOUT: (window.navigator.userAgent.match(/MSIE/i) !== -1 && !__TEST__) ? 2000 : 1000, | ||
RES_TIMEOUT: __TEST__ ? 2000 : -1, | ||
ACK_TIMEOUT: 2000, | ||
ACK_TIMEOUT_KNOWN: 10000, | ||
RES_TIMEOUT: __TEST__ ? 2000 : -1, | ||
@@ -18,0 +19,0 @@ ALLOWED_POST_MESSAGE_METHODS: { |
@@ -7,3 +7,3 @@ /* @flow */ | ||
import { CONSTANTS, POST_MESSAGE_NAMES_LIST } from '../../conf'; | ||
import { deserializeMethods } from '../../lib'; | ||
import { deserializeMethods, markWindowKnown } from '../../lib'; | ||
import { global } from '../../global'; | ||
@@ -79,2 +79,4 @@ | ||
markWindowKnown(source); | ||
if (!message.sourceDomain || typeof message.sourceDomain !== 'string') { | ||
@@ -81,0 +83,0 @@ throw new Error(`Expected message to have sourceDomain`); |
@@ -9,2 +9,3 @@ /* @flow */ | ||
export * from './public'; | ||
export { markWindowKnown } from './lib'; | ||
export { cleanUpWindow } from './clean'; | ||
@@ -11,0 +12,0 @@ export { ZalgoPromise as Promise } from 'zalgo-promise/src'; |
@@ -13,2 +13,3 @@ /* @flow */ | ||
global.readyPromises = global.readyPromises || new WeakMap(); | ||
global.knownWindows = global.knownWindows || new WeakMap(); | ||
@@ -28,2 +29,10 @@ export function onHello(handler : ({ source? : CrossDomainWindowType, origin? : string }) => void) { | ||
export function markWindowKnown(win : CrossDomainWindowType) { | ||
global.knownWindows.set(win, true); | ||
} | ||
export function isWindowKnown(win : CrossDomainWindowType) : boolean { | ||
return global.knownWindows.get(win); | ||
} | ||
export function initOnReady() { | ||
@@ -30,0 +39,0 @@ |
@@ -11,3 +11,3 @@ /* @flow */ | ||
import { sendMessage, addResponseListener, deleteResponseListener, markResponseListenerErrored, type ResponseListenerType } from '../drivers'; | ||
import { onChildWindowReady, sayHello } from '../lib'; | ||
import { onChildWindowReady, sayHello, isWindowKnown } from '../lib'; | ||
import { global } from '../global'; | ||
@@ -172,5 +172,8 @@ | ||
let ackTimeout = CONFIG.ACK_TIMEOUT; | ||
let resTimeout = options.timeout || CONFIG.RES_TIMEOUT; | ||
let totalAckTimeout = isWindowKnown(win) ? CONFIG.ACK_TIMEOUT_KNOWN : CONFIG.ACK_TIMEOUT; | ||
let totalResTimeout = options.timeout || CONFIG.RES_TIMEOUT; | ||
let ackTimeout = totalAckTimeout; | ||
let resTimeout = totalResTimeout; | ||
let cycleTime = 100; | ||
@@ -209,6 +212,6 @@ | ||
} else if (ackTimeout === 0) { | ||
return reject(new Error(`No ack for postMessage ${ name } in ${ getDomain() } in ${ CONFIG.ACK_TIMEOUT }ms`)); | ||
return reject(new Error(`No ack for postMessage ${ name } in ${ getDomain() } in ${ totalAckTimeout }ms`)); | ||
} else if (resTimeout === 0) { | ||
return reject(new Error(`No response for postMessage ${ name } in ${ getDomain() } in ${ options.timeout || CONFIG.RES_TIMEOUT }ms`)); | ||
return reject(new Error(`No response for postMessage ${ name } in ${ getDomain() } in ${ totalResTimeout }ms`)); | ||
} | ||
@@ -215,0 +218,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
530440
8789