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

post-robot

Package Overview
Dependencies
Maintainers
2
Versions
246
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

post-robot - npm Package Compare versions

Comparing version 1.0.20 to 1.0.21

demo/child.htm

2

bower.json
{
"name": "post-robot",
"main": "index.js",
"version": "1.0.20",
"version": "1.0.21",
"authors": [

@@ -6,0 +6,0 @@ "Daniel Brain <dbrain@paypal.com>"

@@ -1791,3 +1791,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

} else if (message.ack === _conf.CONSTANTS.POST_MESSAGE_ACK.SUCCESS) {
return options.respond(null, message.response);
return options.respond(null, message.response || message.data);
}

@@ -1794,0 +1794,0 @@ }), _RECEIVE_MESSAGE_TYPE);

@@ -8,2 +8,2 @@ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("postRobot",[],t):"object"==typeof exports?exports.postRobot=t():e.postRobot=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(){(0,a.registerGlobals)(),u.util.debug("ID",(0,i.getWindowID)()),u.util.listen(window,"message",s.messageListener),u.childWindows.register((0,i.getWindowID)(),window,u.util.getType()),(0,u.propagate)((0,i.getWindowID)())}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1);Object.keys(o).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var i=n(3),u=n(13),s=n(11),a=n(15);r(),t["default"]=e.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.util=t.openBridge=t.reset=t.parent=void 0;var r=n(2);Object.keys(r).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var o=n(23);Object.keys(o).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var i=n(24);Object.keys(i).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var u=n(25);Object.keys(u).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}})});var s=n(11);Object.defineProperty(t,"reset",{enumerable:!0,get:function(){return s.resetListeners}});var a=n(16);Object.defineProperty(t,"openBridge",{enumerable:!0,get:function(){return a.openBridge}});var c=n(7);Object.defineProperty(t,"util",{enumerable:!0,get:function(){return c.util}});t.parent=c.util.getParent()},function(e,t,n){"use strict";function r(e){return a.promise.nodeify(new a.promise.Promise(function(t,n){if(!e.name)throw new Error("Expected options.name");if(!e.window)throw new Error("Expected options.window");if(u.CONFIG.MOCK_MODE)e.window=window;else if("string"==typeof e.window){var r=document.getElementById(e.window);if(!r)throw new Error("Expected options.window "+e.window+" to be a valid element id");if("iframe"!==r.tagName.toLowerCase())throw new Error("Expected options.window "+e.window+" to be an iframe");if(e.window=r.contentWindow,!e.window)throw new Error("Expected options.window")}var o=e.name+"_"+a.util.uniqueID();if(s.listeners.response[o]=e,e.window.closed)throw new Error("Target window is closed");e.timeout&&setTimeout(function(){return n(new Error("Post message response timed out after "+e.timeout+" ms"))},e.timeout),e.respond=function(e,r){return e?n(e):t(r)},(0,s.sendMessage)(e.window,{hash:o,type:u.CONSTANTS.POST_MESSAGE_TYPE.REQUEST,name:e.name,data:e.data||{}})["catch"](n),setTimeout(function(){return e.ack?void 0:n(new Error("No ack for postMessage "+e.name))},u.CONFIG.ACK_TIMEOUT)}),e.callback)}function o(e,t,n,o){return!o&&n instanceof Function&&(o=n,n={}),r({window:e,name:t,data:n,callback:o})}function i(e,t,n){if(!a.util.getParent())throw new Error("Window does not have a parent");return o(a.util.getParent(),e,t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.request=r,t.send=o,t.sendToParent=i;var u=n(3),s=n(11),a=n(13)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4);Object.keys(r).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var o=n(5);Object.keys(o).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var i=n(6);Object.keys(i).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CONFIG={ALLOW_POSTMESSAGE_POPUP:!0,DEBUG:!1,ACK_TIMEOUT:3e3,LOG_TO_PAGE:!1,MOCK_MODE:!1}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CONSTANTS={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:{IDENTIFY:"identify"},WINDOW_TYPES:{FULLPAGE:"fullpage",POPUP:"popup",IFRAME:"iframe"},WINDOW_PROPS:{POSTROBOT:"__postRobot__"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWindowID=void 0;var r=n(7);t.getWindowID=r.util.memoize(function(){return window.name||r.util.uniqueID()})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.util=void 0;var r=n(3),o=n(8),i=t.util={isPopup:function(){return Boolean(window.opener)},isIframe:function(){return Boolean(window.parent&&window!==window.parent)},isFullpage:function(){return Boolean(!i.isIframe()&&!i.isPopup())},windowReady:new o.promise.Promise(function(e,t){return"complete"===document.readyState?e():void window.addEventListener("load",e)}),getType:function(){return i.isPopup()?r.CONSTANTS.WINDOW_TYPES.POPUP:i.isIframe()?r.CONSTANTS.WINDOW_TYPES.IFRAME:r.CONSTANTS.WINDOW_TYPES.FULLPAGE},once:function(e){if(!e)return e;var t=!1;return function(){return t?void 0:(t=!0,e.apply(this,arguments))}},getParent:function(){return i.isPopup()?window.opener:i.isIframe()?window.parent:void 0},eachParent:function(e,t){var n=window;for(t&&e(window);;){var r=n.opener||n.parent;if(n===r)return;n=r,e(n)}},eachFrame:function(e,t){for(var n=0;n<e.frames.length;n++){var r=void 0;try{r=e.frames[n]}catch(o){continue}t(r)}},noop:function(){},getDomain:function(){return window.location.host},clearLogs:function(){if(window.console&&window.console.clear&&window.console.clear(),r.CONFIG.LOG_TO_PAGE){var e=document.getElementById("postRobotLogs");e&&e.parentNode.removeChild(e)}},writeToPage:function(e,t){setTimeout(function(){var n=document.getElementById("postRobotLogs");n||(n=document.createElement("div"),n.id="postRobotLogs",n.style.cssText="width: 800px; font-family: monospace; white-space: pre-wrap;",document.body.appendChild(n));var r=document.createElement("div"),o=(new Date).toString().split(" ")[4],u=i.map(t,function(e){if("string"==typeof e)return e;if(!e)return toString.call(e);var t=void 0;try{t=JSON.stringify(e,0,2)}catch(n){t="[object]"}return"\n\n"+t+"\n\n"}).join(" "),s=o+" "+e+" "+u;r.innerHTML=s;var a={log:"#ddd",warn:"orange",error:"red",info:"blue",debug:"#aaa"}[e];r.style.cssText="margin-top: 10px; color: "+a+";",n.childNodes.length?n.insertBefore(r,n.childNodes[0]):n.appendChild(r)})},logLevel:function(e,t){t=Array.prototype.slice.call(t),t.unshift(i.getDomain()),t.unshift(i.getType().toLowerCase()),t.unshift("[post-robot]"),r.CONFIG.LOG_TO_PAGE&&i.writeToPage(e,t),window.console&&(window.console[e]||(e="log"),window.console[e]&&window.console[e].apply(window.console,t))},log:function(){i.logLevel("info",arguments)},debug:function(){r.CONFIG.DEBUG&&i.logLevel("debug",arguments)},debugError:function(){r.CONFIG.DEBUG&&i.logLevel("error",arguments)},safeHasProp:function(e,t){try{return!!e[t]}catch(n){return!1}},warn:function(){i.logLevel("warn",arguments)},error:function(){i.logLevel("error",arguments)},listen:function(e,t,n){return e.addEventListener?e.addEventListener(t,n):e.attachEvent("on"+t,n),{cancel:function(){e.removeEventListener?e.removeEventListener(t,n):e.detachEvent("on"+t,n)}}},apply:function(e,t,n){return e.apply instanceof Function?e.apply(t,n):e(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9])},find:function(e,t,n){if(!e)return n;for(var r=0;r<e.length;r++)if(t(e[r]))return e[r];return n},map:function(e,t){for(var n=[],r=0;r<e.length;r++)n.push(t(e[r]));return n},some:function(e,t){t=t||Boolean;for(var n=0;n<e.length;n++)if(t(e[n]))return!0;return!1},keys:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t},values:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t},getByValue:function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&e[n]===t)return n},uniqueID:function(){var e="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})},isFrameOwnedBy:function(e,t){try{return t.parent===e}catch(n){try{for(var r=0;r<e.frames.length;r++)if(e.frames[r]===t)return!0}catch(o){return!1}}return!1},memoize:function(e){var t={};return function(){var n=JSON.stringify(Array.prototype.slice.call(arguments));return t.hasOwnProperty(n)||(t[n]=e.apply(this,arguments)),t[n]}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promise=void 0;var r=n(9),o=t.promise={get Promise(){return window.Promise?window.Promise:r.Promise},asyncPromise:function(e){return new o.Promise(function(t,n){setTimeout(function(){try{return e(t,n)}catch(r){return n(r)}})})},run:function(e){return o.Promise.resolve().then(e)},method:function(e){return function(){var t=this,n=arguments;return o.Promise.resolve().then(function(){return e.apply(t,n)})}},nodeify:function(e,t){return t?void e.then(function(e){t(null,e)},function(e){t(e)}):e}}},function(e,t,n){var r;(function(o,i){/*!

*/
(function(){function u(e,t){W[C]=e,W[C+1]=t,C+=2,2===C&&A()}function s(e){return"function"==typeof e}function a(){return function(){o.nextTick(l)}}function c(){var e=0,t=new j(l),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function f(){var e=new MessageChannel;return e.port1.onmessage=l,function(){e.port2.postMessage(0)}}function d(){return function(){setTimeout(l,1)}}function l(){for(var e=0;C>e;e+=2)(0,W[e])(W[e+1]),W[e]=void 0,W[e+1]=void 0;C=0}function p(){}function w(e,t,n,r){try{e.call(t,n,r)}catch(o){return o}}function h(e,t,n){u(function(e){var r=!1,o=w(n,t,function(n){r||(r=!0,t!==n?g(e,n):S(e,n))},function(t){r||(r=!0,v(e,t))});!r&&o&&(r=!0,v(e,o))},e)}function O(e,t){1===t.a?S(e,t.b):2===e.a?v(e,t.b):m(t,void 0,function(t){g(e,t)},function(t){v(e,t)})}function g(e,t){if(e===t)v(e,new TypeError("You cannot resolve a promise with itself"));else if("function"==typeof t||"object"==typeof t&&null!==t)if(t.constructor===e.constructor)O(e,t);else{var n;try{n=t.then}catch(r){R.error=r,n=R}n===R?v(e,R.error):void 0===n?S(e,t):s(n)?h(e,t,n):S(e,t)}else S(e,t)}function E(e){e.f&&e.f(e.b),y(e)}function S(e,t){void 0===e.a&&(e.b=t,e.a=1,0!==e.e.length&&u(y,e))}function v(e,t){void 0===e.a&&(e.a=2,e.b=t,u(E,e))}function m(e,t,n,r){var o=e.e,i=o.length;e.f=null,o[i]=t,o[i+1]=n,o[i+2]=r,0===i&&e.a&&u(y,e)}function y(e){var t=e.e,n=e.a;if(0!==t.length){for(var r,o,i=e.b,u=0;u<t.length;u+=3)r=t[u],o=t[u+n],r?P(n,r,o,i):o(i);e.e.length=0}}function T(){this.error=null}function P(e,t,n,r){var o,i,u,a,c=s(n);if(c){try{o=n(r)}catch(f){G.error=f,o=G}if(o===G?(a=!0,i=o.error,o=null):u=!0,t===o)return void v(t,new TypeError("A promises callback cannot return that same promise."))}else o=r,u=!0;void 0===t.a&&(c&&u?g(t,o):a?v(t,i):1===e?S(t,o):2===e&&v(t,o))}function b(e,t){try{t(function(t){g(e,t)},function(t){v(e,t)})}catch(n){v(e,n)}}function _(e,t,n,r){this.n=e,this.c=new e(p,r),this.i=n,this.o(t)?(this.m=t,this.d=this.length=t.length,this.l(),0===this.length?S(this.c,this.b):(this.length=this.length||0,this.k(),0===this.d&&S(this.c,this.b))):v(this.c,this.p())}function N(e){if(D++,this.b=this.a=void 0,this.e=[],p!==e){if(!s(e))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof N))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");b(this,e)}}var A,M=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},C=0,I="undefined"!=typeof window?window:{},j=I.MutationObserver||I.WebKitMutationObserver,I="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,W=Array(1e3);A="undefined"!=typeof o&&"[object process]"==={}.toString.call(o)?a():j?c():I?f():d();var R=new T,G=new T;_.prototype.o=function(e){return M(e)},_.prototype.p=function(){return Error("Array Methods must be provided an Array")},_.prototype.l=function(){this.b=Array(this.length)},_.prototype.k=function(){for(var e=this.length,t=this.c,n=this.m,r=0;void 0===t.a&&e>r;r++)this.j(n[r],r)},_.prototype.j=function(e,t){var n=this.n;"object"==typeof e&&null!==e?e.constructor===n&&void 0!==e.a?(e.f=null,this.g(e.a,t,e.b)):this.q(n.resolve(e),t):(this.d--,this.b[t]=this.h(e))},_.prototype.g=function(e,t,n){var r=this.c;void 0===r.a&&(this.d--,this.i&&2===e?v(r,n):this.b[t]=this.h(n)),0===this.d&&S(r,this.b)},_.prototype.h=function(e){return e},_.prototype.q=function(e,t){var n=this;m(e,void 0,function(e){n.g(1,t,e)},function(e){n.g(2,t,e)})};var D=0;N.all=function(e,t){return new _(this,e,!0,t).c},N.race=function(e,t){function n(e){g(o,e)}function r(e){v(o,e)}var o=new this(p,t);if(!M(e))return v(o,new TypeError("You must pass an array to race.")),o;for(var i=e.length,u=0;void 0===o.a&&i>u;u++)m(this.resolve(e[u]),void 0,n,r);return o},N.resolve=function(e,t){if(e&&"object"==typeof e&&e.constructor===this)return e;var n=new this(p,t);return g(n,e),n},N.reject=function(e,t){var n=new this(p,t);return v(n,e),n},N.prototype={constructor:N,then:function(e,t){var n=this.a;if(1===n&&!e||2===n&&!t)return this;var r=new this.constructor(p),o=this.b;if(n){var i=arguments[n-1];u(function(){P(n,r,i,o)})}else m(this,r,e,t);return r},"catch":function(e){return this.then(null,e)}};var x={Promise:N,polyfill:function(){var e;e="undefined"!=typeof i?i:"undefined"!=typeof window&&window.document?window:self,"Promise"in e&&"resolve"in e.Promise&&"reject"in e.Promise&&"all"in e.Promise&&"race"in e.Promise&&function(){var t;return new e.Promise(function(e){t=e}),s(t)}()||(e.Promise=N)}};r=function(){return x}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))}).call(this)}).call(t,n(10),function(){return this}())},function(e,t){function n(){c&&u&&(c=!1,u.length?a=u.concat(a):f=-1,a.length&&r())}function r(){if(!c){var e=setTimeout(n);c=!0;for(var t=a.length;t;){for(u=a,a=[];++f<t;)u&&u[f].run();f=-1,t=a.length}u=null,c=!1,clearTimeout(e)}}function o(e,t){this.fun=e,this.array=t}function i(){}var u,s=e.exports={},a=[],c=!1,f=-1;s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];a.push(new o(e,t)),1!==a.length||c||setTimeout(r,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=i,s.addListener=i,s.once=i,s.off=i,s.removeListener=i,s.removeAllListeners=i,s.emit=i,s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12);Object.keys(r).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var o=n(19);Object.keys(o).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var i=n(21);Object.keys(i).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})})},function(e,t,n){"use strict";function r(e){try{e=JSON.parse(e)}catch(t){return}if(e.type&&l.RECEIVE_MESSAGE_TYPES[e.type])return e}function o(e,t){if(!s.CONFIG.MOCK_MODE&&t&&(t.type!==s.CONSTANTS.POST_MESSAGE_TYPE.REQUEST||!t.name||!d.listeners.request[t.name]||d.listeners.request[t.name].proxy!==!1)){var n=(t.type===s.CONSTANTS.POST_MESSAGE_TYPE.REQUEST||t.type===s.CONSTANTS.POST_MESSAGE_TYPE.ACK)&&d.listeners.response[t.hash];if(!n)for(var r=0;r<d.listeners.proxies.length;r++){var o=d.listeners.proxies[r];if(e===o.from)return o.to}if("parent.opener"===t.target){var i=void 0;try{i=window.parent.opener}catch(u){throw new Error("Can not get window.parent.opener to proxy to")}if(!i)throw new Error("Can not get window.parent.opener to proxy to");return i}if(t.target&&t.target!==(0,s.getWindowID)()){var c=a.childWindows.getWindowById(t.target);if(!c)throw new Error("Unable to find window to proxy message to: "+t.target);return c}}}function i(e,t){var n=r(t);if(n&&-1===p.indexOf(n.id)){p.push(n.id),a.childWindows.register(n.source,e,n.windowType);var i=o(e,n);return i?(delete n.target,(0,f.sendMessage)(i,n,!0)):(a.util.log("#receive",n.type,n.name,n),s.CONFIG.MOCK_MODE?l.RECEIVE_MESSAGE_TYPES[n.type](e,n):void l.RECEIVE_MESSAGE_TYPES[n.type](e,n))}}function u(e){var t=e.source||e.sourceElement,n=e.data;(0,c.emulateIERestrictions)(t,window),i(t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.receiveMessage=i,t.messageListener=u;var s=n(3),a=n(13),c=n(15),f=n(19),d=n(21),l=n(22),p=[]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8);Object.keys(r).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var o=n(7);Object.keys(o).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var i=n(14);Object.keys(i).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})})},function(e,t,n){"use strict";function r(e,t){return u.util.find(a,function(n){return n[e]===t},{})}function o(e){function t(t,r){t&&t!==window&&-1===n.indexOf(t)&&(u.util.debug("propagating to",r,t),n.push(t),u.util.safeHasProp(t,i.CONSTANTS.WINDOW_PROPS.POSTROBOT)?t[i.CONSTANTS.WINDOW_PROPS.POSTROBOT].registerSelf(e,window,u.util.getType()):(0,s.send)(t,i.CONSTANTS.POST_MESSAGE_NAMES.IDENTIFY,{id:e,type:u.util.getType()}).then(function(e){c.register(e.id,t,e.type)},function(e){u.util.debugError("Error sending identify:",e.stack||e.toString())}))}(0,s.on)(i.CONSTANTS.POST_MESSAGE_NAMES.IDENTIFY,function(t,n,r){return t?void 0:{id:e}});var n=[];u.util.eachParent(function(e){t(e,"parent"),u.util.eachFrame(e,function(e){t(e,"frame")})},!0)}Object.defineProperty(t,"__esModule",{value:!0}),t.childWindows=void 0,t.propagate=o;var i=n(3),u=n(13),s=n(1),a=[],c=t.childWindows={getWindowId:function(e){return r("win",e).id},getWindowById:function(e){return r("id",e).win},getWindowType:function(e){var t=r("win",e);if(t&&t.type)return t.type;if(u.util.safeHasProp(e,"parent")&&e.parent!==e)return i.CONSTANTS.WINDOW_TYPES.IFRAME;if(u.util.safeHasProp(e,"opener"))return i.CONSTANTS.WINDOW_TYPES.POPUP;var n=u.util.some(a,function(t){return u.util.isFrameOwnedBy(t.win,e)});return n?i.CONSTANTS.WINDOW_TYPES.IFRAME:void 0},register:function(e,t,n){var r=u.util.find(a,function(n){return n.id===e&&n.win===t});r||(u.util.debug("Registering window:",n,e,t),a.push({id:e,win:t,type:n}))}},f=window.open;window.open=function(e,t,n,r){t||(t=u.util.uniqueID(),arguments[1]=t);var o=u.util.apply(f,this,arguments);return c.register(t,o,i.CONSTANTS.WINDOW_TYPES.POPUP),o}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16);Object.keys(r).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var o=n(17);Object.keys(o).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var i=n(18);Object.keys(i).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})})},function(e,t,n){"use strict";function r(){return s}function o(e){try{if(!e||!e.frames||!e.frames.length)return;for(var t=0;t<e.frames.length;t++)try{var n=e.frames[t];if(n&&n[i.CONSTANTS.WINDOW_PROPS.POSTROBOT])return n}catch(r){continue}}catch(r){return}}Object.defineProperty(t,"__esModule",{value:!0}),t.openBridge=void 0,t.getBridge=r,t.getBridgeFor=o;var i=n(3),u=n(13),s=void 0;t.openBridge=u.util.memoize(function(e){if(s)throw new Error("Only one bridge supported");return s=new u.promise.Promise(function(t,n){u.util.debug("Opening bridge:",e);var r=document.createElement("iframe");r.setAttribute("id","postRobotBridge"),r.setAttribute("style","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.onload=function(){return t(r)},r.onerror=n,r.src=e,document.body.appendChild(r)})})},function(e,t,n){"use strict";function r(){if(window[o.CONSTANTS.WINDOW_PROPS.POSTROBOT])throw new Error("Attempting to load postRobot twice on the same window");window[o.CONSTANTS.WINDOW_PROPS.POSTROBOT]={registerSelf:function(e,t,n){i.childWindows.register(e,t,n)},postMessage:i.promise.method(function(e,t){(0,u.receiveMessage)(e,t)}),postMessageParent:i.promise.method(function(e,t){window.parent.postMessage(t,"*")})}}Object.defineProperty(t,"__esModule",{value:!0}),t.registerGlobals=r;var o=n(3),i=n(13),u=n(11)},function(e,t,n){"use strict";function r(e,t){if(!o.CONFIG.ALLOW_POSTMESSAGE_POPUP){var n=i.childWindows.getWindowType(e)===o.CONSTANTS.WINDOW_TYPES.IFRAME&&i.util.isFrameOwnedBy(t,e),r=i.childWindows.getWindowType(t)===o.CONSTANTS.WINDOW_TYPES.IFRAME&&i.util.isFrameOwnedBy(e,t);if(!n&&!r)throw e===window?new Error("Can not send post messages to another window (disabled by config to emulate IE)"):new Error("Can not receive post messages sent from another window (disabled by config to emulate IE)")}}Object.defineProperty(t,"__esModule",{value:!0}),t.emulateIERestrictions=r;var o=n(3),i=n(13)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendMessage=void 0;var r=n(3),o=n(13),i=n(20);t.sendMessage=o.promise.method(function(e,t,n){if(t.id=t.id||o.util.uniqueID(),t.source=(0,r.getWindowID)(),t.originalSource=t.originalSource||(0,r.getWindowID)(),t.windowType=o.util.getType(),t.originalWindowType=t.originalWindowType||o.util.getType(),t.target||(t.target=o.childWindows.getWindowId(e)),o.util.log(n?"#proxy":"#send",t.type,t.name,t),r.CONFIG.MOCK_MODE)return delete t.target,window[r.CONSTANTS.WINDOW_PROPS.POSTROBOT].postMessage(window,JSON.stringify(t));if(e===window)throw new Error("Attemping to send message to self");return o.util.debug("Waiting for window to be ready"),o.util.windowReady.then(function(){return o.util.debug("Running send message strategies",t),o.promise.Promise.all(o.util.map(o.util.keys(i.SEND_MESSAGE_STRATEGIES),function(n){return i.SEND_MESSAGE_STRATEGIES[n](e,t).then(function(){return o.util.debug(n,"success"),!0},function(e){return o.util.debugError(n,"error\n\n",e.stack||e.toString()),!1})})).then(function(e){if(!o.util.some(e))throw new Error("No post-message strategy succeeded")})})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SEND_MESSAGE_STRATEGIES=void 0;var r=n(3),o=n(13),i=n(15);t.SEND_MESSAGE_STRATEGIES={POST_MESSAGE:o.promise.method(function(e,t){return(0,i.emulateIERestrictions)(window,e),e.postMessage(JSON.stringify(t,0,2),"*")}),POST_MESSAGE_GLOBAL_METHOD:o.promise.method(function(e,t){if(!o.util.safeHasProp(e,r.CONSTANTS.WINDOW_PROPS.POSTROBOT))throw new Error("postRobot not found on window");return e[r.CONSTANTS.WINDOW_PROPS.POSTROBOT].postMessage(window,JSON.stringify(t,0,2))}),POST_MESSAGE_UP_THROUGH_BRIDGE:o.promise.method(function(e,t){var n=(0,i.getBridgeFor)(e);if(!n)throw new Error("No bridge available in window");if(!o.util.safeHasProp(n,r.CONSTANTS.WINDOW_PROPS.POSTROBOT))throw new Error("postRobot not installed in bridge");return n[r.CONSTANTS.WINDOW_PROPS.POSTROBOT].postMessageParent(window,JSON.stringify(t,0,2))}),POST_MESSAGE_DOWN_THROUGH_BRIDGE:o.promise.method(function(e,t){var n=(0,i.getBridge)();if(!n)throw new Error("Bridge not initialized");if(e===n.contentWindow)throw new Error("Message target is bridge");if(!t.target){if(e!==window.opener)throw new Error("Can not post message down through bridge without target");t.target="parent.opener"}return n.then(function(e){e.contentWindow.postMessage(JSON.stringify(t,0,2),"*")})})}},function(e,t){"use strict";function n(){t.listeners=r={request:{},response:{},proxies:[]}}Object.defineProperty(t,"__esModule",{value:!0}),t.resetListeners=n;var r=t.listeners=void 0;n()},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.RECEIVE_MESSAGE_TYPES=void 0;var o,i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(3),s=n(13),a=n(19),c=n(21);t.RECEIVE_MESSAGE_TYPES=(o={},r(o,u.CONSTANTS.POST_MESSAGE_TYPE.ACK,function(e,t){var n=c.listeners.response[t.hash];if(!n)throw new Error("No handler found for post message ack for message: "+t.name+" in "+window.location.href);n.ack=!0}),r(o,u.CONSTANTS.POST_MESSAGE_TYPE.REQUEST,function(e,t){function n(n){return(0,a.sendMessage)(e,i({target:t.originalSource?t.originalSource:s.childWindows.getWindowId(e),hash:t.hash,name:t.name},n))["catch"](function(e){if(r)return r.handleError(e);throw e})}var r=c.listeners.request[t.name],o=s.util.once(function(e,t){return n(e?{type:u.CONSTANTS.POST_MESSAGE_TYPE.RESPONSE,ack:u.CONSTANTS.POST_MESSAGE_ACK.ERROR,error:e.stack||e.toString()}:{type:u.CONSTANTS.POST_MESSAGE_TYPE.RESPONSE,ack:u.CONSTANTS.POST_MESSAGE_ACK.SUCCESS,response:t||{}})});if(!r)return o(new Error("No postmessage request handler for "+t.name+" in "+window.location.href));if(!r.window||!e||r.window===e){n({type:u.CONSTANTS.POST_MESSAGE_TYPE.ACK});var f=void 0;try{f=r.handler(null,t.data,function(e,t){return e?o(e):o(null,t)})}catch(d){return o(d)}return"undefined"!=typeof f?f.then instanceof Function?f.then(function(e){return o(null,e)},o):o(null,f):void 0}}),r(o,u.CONSTANTS.POST_MESSAGE_TYPE.RESPONSE,function(e,t){var n=c.listeners.response[t.hash];if(!n)throw new Error("No response handler found for post message response "+t.name+" in "+window.location.href);return delete c.listeners.response[t.hash],t.ack===u.CONSTANTS.POST_MESSAGE_ACK.ERROR?n.respond(t.error):t.ack===u.CONSTANTS.POST_MESSAGE_ACK.SUCCESS?n.respond(null,t.response):void 0}),o)},function(e,t,n){"use strict";function r(e){if(!e.name)throw new Error("Expected options.name");if(a.listeners.request[e.name]&&!e.override&&!u.CONFIG.MOCK_MODE)throw new Error("Post message response handler already registered: "+e.name);if(!e.handler)throw new Error("Expected options.handler");return e.errorHandler=e.errorHandler||s.util.noop,e.once&&(e.handler=s.util.once(e.handler)),a.listeners.request[e.name]=e,e.handleError=function(t){delete a.listeners.request[e.name],e.errorHandler(t)},e.window&&e.errorOnClose&&!function(){var t=setInterval(function(){e.window.closed&&(clearInterval(t),e.handleError(new Error("Post message target window is closed")))},50)}(),{cancel:function(){delete a.listeners.request[e.name]}}}function o(e,t,n,o){return t instanceof Function&&(o=n,n=t,t={}),t.name=e,t.handler=n||t.handler,t.errorHandler=o||t.errorHandler,r(t)}function i(e,t,n,o){return t instanceof Function&&(o=n,n=t,t={}),t.name=e,t.handler=n||t.handler,t.errorHandler=o||t.errorHandler,t.once=!0,r(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.listen=r,t.on=o,t.once=i;var u=n(3),s=n(13),a=n(11)},function(e,t,n){"use strict";function r(e,t){i.listeners.proxies.push({from:e,to:t}),i.listeners.proxies.push({from:t,to:e})}function o(e,t){for(var n=[],r=0;r<i.listeners.proxies.length;r++){var o=i.listeners.proxies[r];(o.to===e&&o.from===t||o.to===t&&o.from===e)&&n.push(o)}for(var u=0;u<n.length;u++)i.listeners.proxies.splice(i.listeners.proxies.indexOf(n[u]),1)}Object.defineProperty(t,"__esModule",{value:!0}),t.proxy=r,t.unproxy=o;var i=n(11)},function(e,t,n){"use strict";function r(){i.CONFIG.MOCK_MODE=!0}function o(){i.CONFIG.MOCK_MODE=!1}Object.defineProperty(t,"__esModule",{value:!0}),t.enableMockMode=r,t.disableMockMode=o;var i=n(3)}])});
(function(){function u(e,t){W[C]=e,W[C+1]=t,C+=2,2===C&&A()}function s(e){return"function"==typeof e}function a(){return function(){o.nextTick(l)}}function c(){var e=0,t=new j(l),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function f(){var e=new MessageChannel;return e.port1.onmessage=l,function(){e.port2.postMessage(0)}}function d(){return function(){setTimeout(l,1)}}function l(){for(var e=0;C>e;e+=2)(0,W[e])(W[e+1]),W[e]=void 0,W[e+1]=void 0;C=0}function p(){}function w(e,t,n,r){try{e.call(t,n,r)}catch(o){return o}}function h(e,t,n){u(function(e){var r=!1,o=w(n,t,function(n){r||(r=!0,t!==n?g(e,n):S(e,n))},function(t){r||(r=!0,v(e,t))});!r&&o&&(r=!0,v(e,o))},e)}function O(e,t){1===t.a?S(e,t.b):2===e.a?v(e,t.b):m(t,void 0,function(t){g(e,t)},function(t){v(e,t)})}function g(e,t){if(e===t)v(e,new TypeError("You cannot resolve a promise with itself"));else if("function"==typeof t||"object"==typeof t&&null!==t)if(t.constructor===e.constructor)O(e,t);else{var n;try{n=t.then}catch(r){R.error=r,n=R}n===R?v(e,R.error):void 0===n?S(e,t):s(n)?h(e,t,n):S(e,t)}else S(e,t)}function E(e){e.f&&e.f(e.b),y(e)}function S(e,t){void 0===e.a&&(e.b=t,e.a=1,0!==e.e.length&&u(y,e))}function v(e,t){void 0===e.a&&(e.a=2,e.b=t,u(E,e))}function m(e,t,n,r){var o=e.e,i=o.length;e.f=null,o[i]=t,o[i+1]=n,o[i+2]=r,0===i&&e.a&&u(y,e)}function y(e){var t=e.e,n=e.a;if(0!==t.length){for(var r,o,i=e.b,u=0;u<t.length;u+=3)r=t[u],o=t[u+n],r?P(n,r,o,i):o(i);e.e.length=0}}function T(){this.error=null}function P(e,t,n,r){var o,i,u,a,c=s(n);if(c){try{o=n(r)}catch(f){G.error=f,o=G}if(o===G?(a=!0,i=o.error,o=null):u=!0,t===o)return void v(t,new TypeError("A promises callback cannot return that same promise."))}else o=r,u=!0;void 0===t.a&&(c&&u?g(t,o):a?v(t,i):1===e?S(t,o):2===e&&v(t,o))}function b(e,t){try{t(function(t){g(e,t)},function(t){v(e,t)})}catch(n){v(e,n)}}function _(e,t,n,r){this.n=e,this.c=new e(p,r),this.i=n,this.o(t)?(this.m=t,this.d=this.length=t.length,this.l(),0===this.length?S(this.c,this.b):(this.length=this.length||0,this.k(),0===this.d&&S(this.c,this.b))):v(this.c,this.p())}function N(e){if(D++,this.b=this.a=void 0,this.e=[],p!==e){if(!s(e))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof N))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");b(this,e)}}var A,M=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},C=0,I="undefined"!=typeof window?window:{},j=I.MutationObserver||I.WebKitMutationObserver,I="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,W=Array(1e3);A="undefined"!=typeof o&&"[object process]"==={}.toString.call(o)?a():j?c():I?f():d();var R=new T,G=new T;_.prototype.o=function(e){return M(e)},_.prototype.p=function(){return Error("Array Methods must be provided an Array")},_.prototype.l=function(){this.b=Array(this.length)},_.prototype.k=function(){for(var e=this.length,t=this.c,n=this.m,r=0;void 0===t.a&&e>r;r++)this.j(n[r],r)},_.prototype.j=function(e,t){var n=this.n;"object"==typeof e&&null!==e?e.constructor===n&&void 0!==e.a?(e.f=null,this.g(e.a,t,e.b)):this.q(n.resolve(e),t):(this.d--,this.b[t]=this.h(e))},_.prototype.g=function(e,t,n){var r=this.c;void 0===r.a&&(this.d--,this.i&&2===e?v(r,n):this.b[t]=this.h(n)),0===this.d&&S(r,this.b)},_.prototype.h=function(e){return e},_.prototype.q=function(e,t){var n=this;m(e,void 0,function(e){n.g(1,t,e)},function(e){n.g(2,t,e)})};var D=0;N.all=function(e,t){return new _(this,e,!0,t).c},N.race=function(e,t){function n(e){g(o,e)}function r(e){v(o,e)}var o=new this(p,t);if(!M(e))return v(o,new TypeError("You must pass an array to race.")),o;for(var i=e.length,u=0;void 0===o.a&&i>u;u++)m(this.resolve(e[u]),void 0,n,r);return o},N.resolve=function(e,t){if(e&&"object"==typeof e&&e.constructor===this)return e;var n=new this(p,t);return g(n,e),n},N.reject=function(e,t){var n=new this(p,t);return v(n,e),n},N.prototype={constructor:N,then:function(e,t){var n=this.a;if(1===n&&!e||2===n&&!t)return this;var r=new this.constructor(p),o=this.b;if(n){var i=arguments[n-1];u(function(){P(n,r,i,o)})}else m(this,r,e,t);return r},"catch":function(e){return this.then(null,e)}};var x={Promise:N,polyfill:function(){var e;e="undefined"!=typeof i?i:"undefined"!=typeof window&&window.document?window:self,"Promise"in e&&"resolve"in e.Promise&&"reject"in e.Promise&&"all"in e.Promise&&"race"in e.Promise&&function(){var t;return new e.Promise(function(e){t=e}),s(t)}()||(e.Promise=N)}};r=function(){return x}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))}).call(this)}).call(t,n(10),function(){return this}())},function(e,t){function n(){c&&u&&(c=!1,u.length?a=u.concat(a):f=-1,a.length&&r())}function r(){if(!c){var e=setTimeout(n);c=!0;for(var t=a.length;t;){for(u=a,a=[];++f<t;)u&&u[f].run();f=-1,t=a.length}u=null,c=!1,clearTimeout(e)}}function o(e,t){this.fun=e,this.array=t}function i(){}var u,s=e.exports={},a=[],c=!1,f=-1;s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];a.push(new o(e,t)),1!==a.length||c||setTimeout(r,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=i,s.addListener=i,s.once=i,s.off=i,s.removeListener=i,s.removeAllListeners=i,s.emit=i,s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12);Object.keys(r).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var o=n(19);Object.keys(o).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var i=n(21);Object.keys(i).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})})},function(e,t,n){"use strict";function r(e){try{e=JSON.parse(e)}catch(t){return}if(e.type&&l.RECEIVE_MESSAGE_TYPES[e.type])return e}function o(e,t){if(!s.CONFIG.MOCK_MODE&&t&&(t.type!==s.CONSTANTS.POST_MESSAGE_TYPE.REQUEST||!t.name||!d.listeners.request[t.name]||d.listeners.request[t.name].proxy!==!1)){var n=(t.type===s.CONSTANTS.POST_MESSAGE_TYPE.REQUEST||t.type===s.CONSTANTS.POST_MESSAGE_TYPE.ACK)&&d.listeners.response[t.hash];if(!n)for(var r=0;r<d.listeners.proxies.length;r++){var o=d.listeners.proxies[r];if(e===o.from)return o.to}if("parent.opener"===t.target){var i=void 0;try{i=window.parent.opener}catch(u){throw new Error("Can not get window.parent.opener to proxy to")}if(!i)throw new Error("Can not get window.parent.opener to proxy to");return i}if(t.target&&t.target!==(0,s.getWindowID)()){var c=a.childWindows.getWindowById(t.target);if(!c)throw new Error("Unable to find window to proxy message to: "+t.target);return c}}}function i(e,t){var n=r(t);if(n&&-1===p.indexOf(n.id)){p.push(n.id),a.childWindows.register(n.source,e,n.windowType);var i=o(e,n);return i?(delete n.target,(0,f.sendMessage)(i,n,!0)):(a.util.log("#receive",n.type,n.name,n),s.CONFIG.MOCK_MODE?l.RECEIVE_MESSAGE_TYPES[n.type](e,n):void l.RECEIVE_MESSAGE_TYPES[n.type](e,n))}}function u(e){var t=e.source||e.sourceElement,n=e.data;(0,c.emulateIERestrictions)(t,window),i(t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.receiveMessage=i,t.messageListener=u;var s=n(3),a=n(13),c=n(15),f=n(19),d=n(21),l=n(22),p=[]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8);Object.keys(r).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var o=n(7);Object.keys(o).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var i=n(14);Object.keys(i).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})})},function(e,t,n){"use strict";function r(e,t){return u.util.find(a,function(n){return n[e]===t},{})}function o(e){function t(t,r){t&&t!==window&&-1===n.indexOf(t)&&(u.util.debug("propagating to",r,t),n.push(t),u.util.safeHasProp(t,i.CONSTANTS.WINDOW_PROPS.POSTROBOT)?t[i.CONSTANTS.WINDOW_PROPS.POSTROBOT].registerSelf(e,window,u.util.getType()):(0,s.send)(t,i.CONSTANTS.POST_MESSAGE_NAMES.IDENTIFY,{id:e,type:u.util.getType()}).then(function(e){c.register(e.id,t,e.type)},function(e){u.util.debugError("Error sending identify:",e.stack||e.toString())}))}(0,s.on)(i.CONSTANTS.POST_MESSAGE_NAMES.IDENTIFY,function(t,n,r){return t?void 0:{id:e}});var n=[];u.util.eachParent(function(e){t(e,"parent"),u.util.eachFrame(e,function(e){t(e,"frame")})},!0)}Object.defineProperty(t,"__esModule",{value:!0}),t.childWindows=void 0,t.propagate=o;var i=n(3),u=n(13),s=n(1),a=[],c=t.childWindows={getWindowId:function(e){return r("win",e).id},getWindowById:function(e){return r("id",e).win},getWindowType:function(e){var t=r("win",e);if(t&&t.type)return t.type;if(u.util.safeHasProp(e,"parent")&&e.parent!==e)return i.CONSTANTS.WINDOW_TYPES.IFRAME;if(u.util.safeHasProp(e,"opener"))return i.CONSTANTS.WINDOW_TYPES.POPUP;var n=u.util.some(a,function(t){return u.util.isFrameOwnedBy(t.win,e)});return n?i.CONSTANTS.WINDOW_TYPES.IFRAME:void 0},register:function(e,t,n){var r=u.util.find(a,function(n){return n.id===e&&n.win===t});r||(u.util.debug("Registering window:",n,e,t),a.push({id:e,win:t,type:n}))}},f=window.open;window.open=function(e,t,n,r){t||(t=u.util.uniqueID(),arguments[1]=t);var o=u.util.apply(f,this,arguments);return c.register(t,o,i.CONSTANTS.WINDOW_TYPES.POPUP),o}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16);Object.keys(r).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var o=n(17);Object.keys(o).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var i=n(18);Object.keys(i).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})})},function(e,t,n){"use strict";function r(){return s}function o(e){try{if(!e||!e.frames||!e.frames.length)return;for(var t=0;t<e.frames.length;t++)try{var n=e.frames[t];if(n&&n[i.CONSTANTS.WINDOW_PROPS.POSTROBOT])return n}catch(r){continue}}catch(r){return}}Object.defineProperty(t,"__esModule",{value:!0}),t.openBridge=void 0,t.getBridge=r,t.getBridgeFor=o;var i=n(3),u=n(13),s=void 0;t.openBridge=u.util.memoize(function(e){if(s)throw new Error("Only one bridge supported");return s=new u.promise.Promise(function(t,n){u.util.debug("Opening bridge:",e);var r=document.createElement("iframe");r.setAttribute("id","postRobotBridge"),r.setAttribute("style","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.onload=function(){return t(r)},r.onerror=n,r.src=e,document.body.appendChild(r)})})},function(e,t,n){"use strict";function r(){if(window[o.CONSTANTS.WINDOW_PROPS.POSTROBOT])throw new Error("Attempting to load postRobot twice on the same window");window[o.CONSTANTS.WINDOW_PROPS.POSTROBOT]={registerSelf:function(e,t,n){i.childWindows.register(e,t,n)},postMessage:i.promise.method(function(e,t){(0,u.receiveMessage)(e,t)}),postMessageParent:i.promise.method(function(e,t){window.parent.postMessage(t,"*")})}}Object.defineProperty(t,"__esModule",{value:!0}),t.registerGlobals=r;var o=n(3),i=n(13),u=n(11)},function(e,t,n){"use strict";function r(e,t){if(!o.CONFIG.ALLOW_POSTMESSAGE_POPUP){var n=i.childWindows.getWindowType(e)===o.CONSTANTS.WINDOW_TYPES.IFRAME&&i.util.isFrameOwnedBy(t,e),r=i.childWindows.getWindowType(t)===o.CONSTANTS.WINDOW_TYPES.IFRAME&&i.util.isFrameOwnedBy(e,t);if(!n&&!r)throw e===window?new Error("Can not send post messages to another window (disabled by config to emulate IE)"):new Error("Can not receive post messages sent from another window (disabled by config to emulate IE)")}}Object.defineProperty(t,"__esModule",{value:!0}),t.emulateIERestrictions=r;var o=n(3),i=n(13)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendMessage=void 0;var r=n(3),o=n(13),i=n(20);t.sendMessage=o.promise.method(function(e,t,n){if(t.id=t.id||o.util.uniqueID(),t.source=(0,r.getWindowID)(),t.originalSource=t.originalSource||(0,r.getWindowID)(),t.windowType=o.util.getType(),t.originalWindowType=t.originalWindowType||o.util.getType(),t.target||(t.target=o.childWindows.getWindowId(e)),o.util.log(n?"#proxy":"#send",t.type,t.name,t),r.CONFIG.MOCK_MODE)return delete t.target,window[r.CONSTANTS.WINDOW_PROPS.POSTROBOT].postMessage(window,JSON.stringify(t));if(e===window)throw new Error("Attemping to send message to self");return o.util.debug("Waiting for window to be ready"),o.util.windowReady.then(function(){return o.util.debug("Running send message strategies",t),o.promise.Promise.all(o.util.map(o.util.keys(i.SEND_MESSAGE_STRATEGIES),function(n){return i.SEND_MESSAGE_STRATEGIES[n](e,t).then(function(){return o.util.debug(n,"success"),!0},function(e){return o.util.debugError(n,"error\n\n",e.stack||e.toString()),!1})})).then(function(e){if(!o.util.some(e))throw new Error("No post-message strategy succeeded")})})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SEND_MESSAGE_STRATEGIES=void 0;var r=n(3),o=n(13),i=n(15);t.SEND_MESSAGE_STRATEGIES={POST_MESSAGE:o.promise.method(function(e,t){return(0,i.emulateIERestrictions)(window,e),e.postMessage(JSON.stringify(t,0,2),"*")}),POST_MESSAGE_GLOBAL_METHOD:o.promise.method(function(e,t){if(!o.util.safeHasProp(e,r.CONSTANTS.WINDOW_PROPS.POSTROBOT))throw new Error("postRobot not found on window");return e[r.CONSTANTS.WINDOW_PROPS.POSTROBOT].postMessage(window,JSON.stringify(t,0,2))}),POST_MESSAGE_UP_THROUGH_BRIDGE:o.promise.method(function(e,t){var n=(0,i.getBridgeFor)(e);if(!n)throw new Error("No bridge available in window");if(!o.util.safeHasProp(n,r.CONSTANTS.WINDOW_PROPS.POSTROBOT))throw new Error("postRobot not installed in bridge");return n[r.CONSTANTS.WINDOW_PROPS.POSTROBOT].postMessageParent(window,JSON.stringify(t,0,2))}),POST_MESSAGE_DOWN_THROUGH_BRIDGE:o.promise.method(function(e,t){var n=(0,i.getBridge)();if(!n)throw new Error("Bridge not initialized");if(e===n.contentWindow)throw new Error("Message target is bridge");if(!t.target){if(e!==window.opener)throw new Error("Can not post message down through bridge without target");t.target="parent.opener"}return n.then(function(e){e.contentWindow.postMessage(JSON.stringify(t,0,2),"*")})})}},function(e,t){"use strict";function n(){t.listeners=r={request:{},response:{},proxies:[]}}Object.defineProperty(t,"__esModule",{value:!0}),t.resetListeners=n;var r=t.listeners=void 0;n()},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.RECEIVE_MESSAGE_TYPES=void 0;var o,i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(3),s=n(13),a=n(19),c=n(21);t.RECEIVE_MESSAGE_TYPES=(o={},r(o,u.CONSTANTS.POST_MESSAGE_TYPE.ACK,function(e,t){var n=c.listeners.response[t.hash];if(!n)throw new Error("No handler found for post message ack for message: "+t.name+" in "+window.location.href);n.ack=!0}),r(o,u.CONSTANTS.POST_MESSAGE_TYPE.REQUEST,function(e,t){function n(n){return(0,a.sendMessage)(e,i({target:t.originalSource?t.originalSource:s.childWindows.getWindowId(e),hash:t.hash,name:t.name},n))["catch"](function(e){if(r)return r.handleError(e);throw e})}var r=c.listeners.request[t.name],o=s.util.once(function(e,t){return n(e?{type:u.CONSTANTS.POST_MESSAGE_TYPE.RESPONSE,ack:u.CONSTANTS.POST_MESSAGE_ACK.ERROR,error:e.stack||e.toString()}:{type:u.CONSTANTS.POST_MESSAGE_TYPE.RESPONSE,ack:u.CONSTANTS.POST_MESSAGE_ACK.SUCCESS,response:t||{}})});if(!r)return o(new Error("No postmessage request handler for "+t.name+" in "+window.location.href));if(!r.window||!e||r.window===e){n({type:u.CONSTANTS.POST_MESSAGE_TYPE.ACK});var f=void 0;try{f=r.handler(null,t.data,function(e,t){return e?o(e):o(null,t)})}catch(d){return o(d)}return"undefined"!=typeof f?f.then instanceof Function?f.then(function(e){return o(null,e)},o):o(null,f):void 0}}),r(o,u.CONSTANTS.POST_MESSAGE_TYPE.RESPONSE,function(e,t){var n=c.listeners.response[t.hash];if(!n)throw new Error("No response handler found for post message response "+t.name+" in "+window.location.href);return delete c.listeners.response[t.hash],t.ack===u.CONSTANTS.POST_MESSAGE_ACK.ERROR?n.respond(t.error):t.ack===u.CONSTANTS.POST_MESSAGE_ACK.SUCCESS?n.respond(null,t.response||t.data):void 0}),o)},function(e,t,n){"use strict";function r(e){if(!e.name)throw new Error("Expected options.name");if(a.listeners.request[e.name]&&!e.override&&!u.CONFIG.MOCK_MODE)throw new Error("Post message response handler already registered: "+e.name);if(!e.handler)throw new Error("Expected options.handler");return e.errorHandler=e.errorHandler||s.util.noop,e.once&&(e.handler=s.util.once(e.handler)),a.listeners.request[e.name]=e,e.handleError=function(t){delete a.listeners.request[e.name],e.errorHandler(t)},e.window&&e.errorOnClose&&!function(){var t=setInterval(function(){e.window.closed&&(clearInterval(t),e.handleError(new Error("Post message target window is closed")))},50)}(),{cancel:function(){delete a.listeners.request[e.name]}}}function o(e,t,n,o){return t instanceof Function&&(o=n,n=t,t={}),t.name=e,t.handler=n||t.handler,t.errorHandler=o||t.errorHandler,r(t)}function i(e,t,n,o){return t instanceof Function&&(o=n,n=t,t={}),t.name=e,t.handler=n||t.handler,t.errorHandler=o||t.errorHandler,t.once=!0,r(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.listen=r,t.on=o,t.once=i;var u=n(3),s=n(13),a=n(11)},function(e,t,n){"use strict";function r(e,t){i.listeners.proxies.push({from:e,to:t}),i.listeners.proxies.push({from:t,to:e})}function o(e,t){for(var n=[],r=0;r<i.listeners.proxies.length;r++){var o=i.listeners.proxies[r];(o.to===e&&o.from===t||o.to===t&&o.from===e)&&n.push(o)}for(var u=0;u<n.length;u++)i.listeners.proxies.splice(i.listeners.proxies.indexOf(n[u]),1)}Object.defineProperty(t,"__esModule",{value:!0}),t.proxy=r,t.unproxy=o;var i=n(11)},function(e,t,n){"use strict";function r(){i.CONFIG.MOCK_MODE=!0}function o(){i.CONFIG.MOCK_MODE=!1}Object.defineProperty(t,"__esModule",{value:!0}),t.enableMockMode=r,t.disableMockMode=o;var i=n(3)}])});
{
"name": "post-robot",
"version": "1.0.20",
"version": "1.0.21",
"description": "Simple postMessage based server.",

@@ -5,0 +5,0 @@ "main": "dist/post-robot.min.js",

@@ -106,5 +106,5 @@

} else if (message.ack === CONSTANTS.POST_MESSAGE_ACK.SUCCESS) {
return options.respond(null, message.response);
return options.respond(null, message.response || message.data);
}
}
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc