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 2.0.10 to 2.0.11

2

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

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

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

!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,s.registerGlobals)(),i.util.debug("ID",(0,u.getWindowID)()),i.util.listen(window,"message",a.messageListener),i.childWindows.register((0,u.getWindowID)(),window,i.util.getType()),(0,i.propagate)((0,u.getWindowID)())}Object.defineProperty(t,"__esModule",{value:!0}),t.Promise=void 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(12);Object.defineProperty(t,"Promise",{enumerable:!0,get:function(){return i.Promise}});var u=n(3),a=n(10),s=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 a=n(10);Object.defineProperty(t,"reset",{enumerable:!0,get:function(){return a.resetListeners}});var s=n(16);Object.defineProperty(t,"openBridge",{enumerable:!0,get:function(){return s.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 s.promise.nodeify(new s.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+"_"+s.util.uniqueID();if(a.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,a.sendMessage)(e.window,{hash:o,type:u.CONSTANTS.POST_MESSAGE_TYPE.REQUEST,name:e.name,data:e.data},e.domain||"*")["catch"](n),setTimeout(function(){return e.ack?void 0:n(new Error("No ack for postMessage "+e.name+" in "+u.CONFIG.ACK_TIMEOUT+"ms"))},u.CONFIG.ACK_TIMEOUT)}),e.callback)}function o(e,t,n,o,i){return i||(!o&&n instanceof Function?(i=n,o={},n={}):o instanceof Function&&(i=o,o={})),o=o||{},o.window=e,o.name=t,o.data=n,o.callback=i,r(o)}function i(e,t,n,r){var i=s.util.getParent();if(!i)throw new Error("Window does not have a parent");return o(s.util.getParent(),e,t,n,r)}Object.defineProperty(t,"__esModule",{value:!0}),t.request=r,t.send=o,t.sendToParent=i;var u=n(3),a=n(10),s=n(12)},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,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.CONFIG=void 0;var o,i=n(5);t.CONFIG={ALLOW_POSTMESSAGE_POPUP:!0,DEBUG:!1,ACK_TIMEOUT:1e3,LOG_TO_PAGE:!1,MOCK_MODE:!1,ALLOWED_POST_MESSAGE_METHODS:(o={},r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE,!0),r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE_GLOBAL_METHOD,!0),r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE_UP_THROUGH_BRIDGE,!0),r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE_DOWN_THROUGH_BRIDGE,!0),o)}},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:"postrobot_identify",METHOD:"postrobot_method"},WINDOW_TYPES:{FULLPAGE:"fullpage",POPUP:"popup",IFRAME:"iframe"},WINDOW_PROPS:{POSTROBOT:"__postRobot__"},SERIALIZATION_TYPES:{METHOD:"postrobot_method"},SEND_STRATEGIES:{POST_MESSAGE:"postrobot_post_message",POST_MESSAGE_GLOBAL_METHOD:"postrobot_post_message_global_method",POST_MESSAGE_UP_THROUGH_BRIDGE:"postrobot_post_message_up_through_bridge",POST_MESSAGE_DOWN_THROUGH_BRIDGE:"postrobot_post_message_down_through_bridge"}}},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="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},o=n(3),i=n(8),u=t.util={isPopup:function(){return Boolean(window.opener)},isIframe:function(){return Boolean(window.parent&&window!==window.parent)},isFullpage:function(){return Boolean(!u.isIframe()&&!u.isPopup())},windowReady:new i.promise.Promise(function(e,t){return"complete"===document.readyState?e():void window.addEventListener("load",e)}),getType:function(){return u.isPopup()?o.CONSTANTS.WINDOW_TYPES.POPUP:u.isIframe()?o.CONSTANTS.WINDOW_TYPES.IFRAME:o.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 u.isPopup()?window.opener:u.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}r!==window&&t(r)}},noop:function(){},getDomain:function(){return window.location.host},clearLogs:function(){if(window.console&&window.console.clear&&window.console.clear(),o.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],i=u.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(" "),a=o+" "+e+" "+i;r.innerHTML=a;var s={log:"#ddd",warn:"orange",error:"red",info:"blue",debug:"#aaa"}[e];r.style.cssText="margin-top: 10px; color: "+s+";",n.childNodes.length?n.insertBefore(r,n.childNodes[0]):n.appendChild(r)})},logLevel:function(e,t){t=Array.prototype.slice.call(t),t.unshift(u.getDomain()),t.unshift(u.getType().toLowerCase()),t.unshift("[post-robot]"),o.CONFIG.LOG_TO_PAGE&&u.writeToPage(e,t),window.console&&(window.console[e]||(e="log"),window.console[e]&&window.console[e].apply(window.console,t))},log:function(){u.logLevel("info",arguments)},debug:function(){o.CONFIG.DEBUG&&u.logLevel("debug",arguments)},debugError:function(){o.CONFIG.DEBUG&&u.logLevel("error",arguments)},safeHasProp:function(e,t){try{return!!e[t]}catch(n){return!1}},warn:function(){u.logLevel("warn",arguments)},error:function(){u.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]}},extend:function(e,t){if(!t)return e;for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},each:function(e,t){if(e instanceof Array)for(var n=0;n<e.length;n++)t(e[n],n);else if(e instanceof Object&&!(e instanceof Function))for(var r in e)e.hasOwnProperty(r)&&t(e[r],r)},replaceObject:function(e,t){var n=e instanceof Array?[]:{};return u.each(e,function(e,o){var i=t(e);void 0!==i?n[o]=i:"object"===("undefined"==typeof e?"undefined":r(e))&&null!==e?n[o]=u.replaceObject(e,t):n[o]=e}),n}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promise=t.Promise=void 0;var r=n(9),o=t.Promise=r.SyncPromise,i=t.promise={Promise:o,run:function(e){return o.resolve().then(e)},method:function(e){return function(){var t=this,n=arguments;return o.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},deNodeify:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return new o(function(t,r){try{return n.length<e.length?e.apply(void 0,n.concat([function(e,n){return e?r(e):t(n)}])):i.run(function(){return e.apply(void 0,n)}).then(t,r)}catch(o){return r(o)}})},map:function(e,t){for(var n=[],r=function(r){n.push(i.run(function(){return t(e[r])}))},u=0;u<e.length;u++)r(u);return o.all(n)}}},function(e,t){"use strict";function n(e,t,n){function r(){if(u){if(s)return n(o);if(a)return t(i)}}var o,i,u=!1,a=!1,s=!1;try{e(function(e){i=e,a=!0,r()},function(e){o=e,s=!0,r()})}catch(c){return n(c)}u=!0,r()}function r(){window.Promise=o}Object.defineProperty(t,"__esModule",{value:!0}),t.patchPromise=r;var o=t.SyncPromise=function(e){if(this.resolved=!1,this.rejected=!1,this.handlers=[],e){var t=this;n(e,function(e){return t.resolve(e)},function(e){return t.reject(e)})}};o.resolve=function(e){return e&&e.then?e:(new o).resolve(e)},o.reject=function(e){return(new o).reject(e)},o.prototype.resolve=function(e){if(this.resolved||this.rejected)return this;if(e&&e.then)throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},o.prototype.reject=function(e){if(this.resolved||this.rejected)return this;if(e&&e.then)throw new Error("Can not reject promise with another promise");return this.rejected=!0,this.value=e,this.dispatch(),this},o.prototype.dispatch=function(){if(this.resolved||this.rejected)for(;this.handlers.length;){var e,t,n=this.handlers.shift();try{this.resolved?e=n.onSuccess?n.onSuccess(this.value):this.value:n.onError?e=n.onError(this.value):t=this.value}catch(r){t=r}if(e===this)throw new Error("Can not return a promise from the the same promise");t?n.promise.reject(t):e&&e.then?e.then(function(e){n.promise.resolve(e)},function(e){n.promise.reject(e)}):n.promise.resolve(e)}},o.prototype.then=function(e,t){var n=new o;return this.handlers.push({promise:n,onSuccess:e,onError:t}),this.dispatch(),n},o.prototype["catch"]=function(e){return this.then(null,e)},o.prototype.done=function(e,t){this.then(e,t||function(e){console.error(e.stack||e.toString())})},o.all=function(e){for(var t=new o,n=e.length,r=[],i=0;i<e.length;i++)e[i].then(function(e){r[i]=e,n-=1,0===n&&t.resolve(r)},function(e){t.reject(e)});return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(11);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(!a.CONFIG.MOCK_MODE&&t){var n=(0,f.getRequestListener)(t.name,e);if(t.type!==a.CONSTANTS.POST_MESSAGE_TYPE.REQUEST||!t.name||!n||n.proxy!==!1){var r=(t.type===a.CONSTANTS.POST_MESSAGE_TYPE.REQUEST||t.type===a.CONSTANTS.POST_MESSAGE_TYPE.ACK)&&f.listeners.response[t.hash];if(!r)for(var o=0;o<f.listeners.proxies.length;o++){var i=f.listeners.proxies[o];if(e===i.from)return i.to}if("parent.opener"===t.target){var u=void 0;try{u=window.parent.opener}catch(c){throw new Error("Can not get window.parent.opener to proxy to")}if(!u)throw new Error("Can not get window.parent.opener to proxy to");return u}if(t.target&&t.target!==(0,a.getWindowID)()){var d=s.childWindows.getWindowById(t.target);if(!d)throw new Error("Unable to find window to proxy message to: "+t.target);return d}}}}function i(e){var t=e.source,n=e.origin,i=e.data,u=r(i);if(u&&-1===p.indexOf(u.id)){p.push(u.id),s.childWindows.register(u.source,t,u.windowType);var c=o(t,u);if(c)return delete u.target,(0,d.sendMessage)(c,u,"*",!0);if(s.util.debug("#receive",u.type,u.name,u),a.CONFIG.MOCK_MODE)return l.RECEIVE_MESSAGE_TYPES[u.type](t,u,n);u.data&&(u.data=(0,s.deserializeMethods)(t,u.data)),l.RECEIVE_MESSAGE_TYPES[u.type](t,u,n)}}function u(e){e={source:e.source||e.sourceElement,origin:e.origin||e.originalEvent.origin,data:e.data};try{(0,c.emulateIERestrictions)(e.source,window)}catch(t){return void console.error(t.stack||t.toString())}i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.receiveMessage=i,t.messageListener=u;var a=n(3),s=n(12),c=n(15),d=n(19),f=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(13);Object.keys(i).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var u=n(14);Object.keys(u).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}})})},function(e,t,n){"use strict";function r(e){for(var t=c,n=Array.isArray(t),r=0,t=n?t:t[Symbol.iterator]();;){var o;if(n){if(r>=t.length)break;o=t[r++]}else{if(r=t.next(),r.done)break;o=r.value}var i=o;if(i.win===e)return i.match}var u=window.location.protocol+"//"+window.location.host,a=!1;try{if(e.location.protocol&&e.location.host){var s=e.location.protocol+"//"+e.location.host;s===u&&(a=!0)}}catch(d){}return c.push({win:e,match:a}),a}function o(e,t){return a.util.find(d,function(n){return n[e]===t},{})}function i(e){function t(t,o){t&&t!==window&&-1===n.indexOf(t)&&(a.util.debug("propagating to",o,t),n.push(t),r(t)&&a.util.safeHasProp(t,u.CONSTANTS.WINDOW_PROPS.POSTROBOT)?t[u.CONSTANTS.WINDOW_PROPS.POSTROBOT].registerSelf(e,window,a.util.getType()):a.util.windowReady.then(function(){(0,s.send)(t,u.CONSTANTS.POST_MESSAGE_NAMES.IDENTIFY,{id:e,type:a.util.getType()}).then(function(e){f.register(e.id,t,e.type)},function(e){a.util.debugError("Error sending identify:",e.stack||e.toString())})}))}(0,s.on)(u.CONSTANTS.POST_MESSAGE_NAMES.IDENTIFY,function(t,n,r){return{id:e}});var n=[];a.util.eachParent(function(e){t(e,"parent"),a.util.eachFrame(e,function(e){t(e,"frame")})},!0)}Object.defineProperty(t,"__esModule",{value:!0}),t.childWindows=void 0,t.isSameDomain=r,t.propagate=i;var u=n(3),a=n(7),s=n(1),c=[],d=[],f=t.childWindows={getWindowId:function(e){return o("win",e).id},getWindowById:function(e){return o("id",e).win},getWindowType:function(e){var t=o("win",e);if(t&&t.type)return t.type;if(a.util.safeHasProp(e,"parent")&&e.parent!==e)return u.CONSTANTS.WINDOW_TYPES.IFRAME;if(a.util.safeHasProp(e,"opener"))return u.CONSTANTS.WINDOW_TYPES.POPUP;var n=a.util.some(d,function(t){return a.util.isFrameOwnedBy(t.win,e)});return n?u.CONSTANTS.WINDOW_TYPES.IFRAME:void 0},register:function(e,t,n){var r=a.util.find(d,function(n){return n.id===e&&n.win===t});r||(a.util.debug("Registering window:",n,e,t),d.push({id:e,win:t,type:n}))},isEqual:function(e,t){if(e===t)return!0;var n=this.getWindowId(e),r=this.getWindowId(t);return!(!n||!r||n!==r)}},l=window.open;window.open=function(e,t,n,r){t||(t=a.util.uniqueID(),arguments[1]=t);var o=a.util.apply(l,this,arguments);return f.register(t,o,u.CONSTANTS.WINDOW_TYPES.POPUP),o}},function(e,t,n){"use strict";function r(e){return e instanceof Object&&e.__type__===s.CONSTANTS.SERIALIZATION_TYPES.METHOD&&e.__id__}function o(e,t){var n=c.util.uniqueID();return f[n]={win:e,method:t},{__type__:s.CONSTANTS.SERIALIZATION_TYPES.METHOD,__id__:n}}function i(e,t){return l(),c.util.replaceObject({obj:t},function(t){if(t instanceof Function)return o(e,t);if(r(t))throw new Error("Attempting to serialize already serialized method")}).obj}function u(e,t){return function(){var n=Array.prototype.slice.call(arguments);return(0,d.send)(e,s.CONSTANTS.POST_MESSAGE_NAMES.METHOD,{id:t.__id__,args:n})}}function a(e,t){return c.util.replaceObject({obj:t},function(t){return r(t)?u(e,t):void 0}).obj}Object.defineProperty(t,"__esModule",{value:!0}),t.listenForMethods=void 0,t.serializeMethod=o,t.serializeMethods=i,t.deserializeMethod=u,t.deserializeMethods=a;var s=n(3),c=n(7),d=n(1),f={},l=t.listenForMethods=c.util.once(function(){(0,d.on)(s.CONSTANTS.POST_MESSAGE_NAMES.METHOD,function(e,t){if(!f[t.id])throw new Error("Could not find method with id: "+t.id);if(f[t.id].win!==e)throw new Error("Method window does not match");return f[t.id].method.apply(null,t.args)})})},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 a}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!==window&&(0,u.isSameDomain)(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(12),a=void 0;t.openBridge=u.util.memoize(function(e){if(a)throw new Error("Only one bridge supported");var t=new u.promise.Promise(function(e){return window.document.body?e(window.document):void window.document.addEventListener("DOMContentLoaded",function(t){return e(window.document)})});return a=t.then(function(t){u.util.debug("Opening bridge:",e);var n=t.createElement("iframe");return n.setAttribute("id","postRobotBridge"),n.setAttribute("style","margin: 0; padding: 0; border: 0px none; overflow: hidden;"),n.setAttribute("frameborder","0"),n.setAttribute("border","0"),n.setAttribute("scrolling","no"),n.setAttribute("allowTransparency","true"),n.setAttribute("tabindex","-1"),n.setAttribute("hidden","true"),n.setAttribute("title",""),n.setAttribute("role","presentation"),n.src=e,t.body.appendChild(n),new u.promise.Promise(function(e,t){n.onload=function(){return e(n)},n.onerror=t})})})},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){(0,u.receiveMessage)(e)}),postMessageParent:i.promise.method(function(e,t,n){if(!window.parent||window.parent===window)throw new Error("Can not find parent to post message to");window.parent.postMessage(t,n)})}}Object.defineProperty(t,"__esModule",{value:!0}),t.registerGlobals=r;var o=n(3),i=n(12),u=n(10)},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(12)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendMessage=void 0;var r=n(3),o=n(12),i=n(20);t.sendMessage=o.promise.method(function(e,t,n,u){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.data=(0,o.serializeMethods)(e,t.data),t.target||(t.target=o.childWindows.getWindowId(e)),o.util.debug(u?"#proxy":"#send",t.type,t.name,t),r.CONFIG.MOCK_MODE)return delete t.target,window[r.CONSTANTS.WINDOW_PROPS.POSTROBOT].postMessage({origin:window.location.protocol+"//"+window.location.host,source:window,data:JSON.stringify(t)});if(e===window)throw new Error("Attemping to send message to self");return o.util.debug("Running send message strategies",t),o.util.windowReady.then(function(){return o.promise.map(o.util.keys(i.SEND_MESSAGE_STRATEGIES),function(u){return o.promise.run(function(){if(!r.CONFIG.ALLOWED_POST_MESSAGE_METHODS[u])throw new Error("Strategy disallowed: "+u);return i.SEND_MESSAGE_STRATEGIES[u](e,t,n)}).then(function(){return o.util.debug(u,"success"),!0},function(e){return o.util.debugError(u,"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";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.SEND_MESSAGE_STRATEGIES=void 0;var o,i=n(3),u=n(12),a=n(15);t.SEND_MESSAGE_STRATEGIES=(o={},r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE,u.promise.method(function(e,t,n){return(0,a.emulateIERestrictions)(window,e),e.postMessage(JSON.stringify(t,0,2),n)})),r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE_GLOBAL_METHOD,u.promise.method(function(e,t,n){if("*"!==n){var r=void 0;try{r=e.location.protocol+"//"+e.location.host}catch(o){}if(!r)throw new Error("Can post post through global method - domain set to "+n+", but we can not verify the domain of the target window");if(r!==n)throw new Error("Can post post through global method - domain "+n+" does not match target window domain "+r)}if(!(0,u.isSameDomain)(e))throw new Error("window is a different domain");if(!u.util.safeHasProp(e,i.CONSTANTS.WINDOW_PROPS.POSTROBOT))throw new Error("postRobot not found on window");return e[i.CONSTANTS.WINDOW_PROPS.POSTROBOT].postMessage({origin:window.location.protocol+"//"+window.location.host,source:window,data:JSON.stringify(t)})})),r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE_UP_THROUGH_BRIDGE,u.promise.method(function(e,t,n){var r=(0,a.getBridgeFor)(e);if(!r)throw new Error("No bridge available in window");if(!(0,u.isSameDomain)(r))throw new Error("Bridge is different domain");if(!u.util.safeHasProp(r,i.CONSTANTS.WINDOW_PROPS.POSTROBOT))throw new Error("postRobot not installed in bridge");return r[i.CONSTANTS.WINDOW_PROPS.POSTROBOT].postMessageParent(window,JSON.stringify(t,0,2),n)})),r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE_DOWN_THROUGH_BRIDGE,u.promise.method(function(e,t,n){var r=(0,a.getBridge)();if(!r)throw new Error("Bridge not initialized");if(e===r.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 r.then(function(e){e.contentWindow.postMessage(JSON.stringify(t,0,2),n)})})),o)},function(e,t,n){"use strict";function r(){t.listeners=s={request:[],response:{},proxies:[]}}function o(e,t){for(var n=s.request,r=Array.isArray(n),o=0,n=r?n:n[Symbol.iterator]();;){var i;if(r){if(o>=n.length)break;i=n[o++]}else{if(o=n.next(),o.done)break;i=o.value}var u=i;if(u.name===e){if(!u.win)return u.options;if(t&&a.childWindows.isEqual(t,u.win))return u.options}}}function i(e){for(var t=void 0,n=s.request,r=Array.isArray(n),o=0,n=r?n:n[Symbol.iterator]();;){var i;if(r){if(o>=n.length)break;i=n[o++]}else{if(o=n.next(),o.done)break;i=o.value}var u=i;if(u.options===e){t=u;break}}t&&s.request.splice(s.request.indexOf(t),1)}function u(e,t,n,r){var u=o(e,t);if(u){if(!r)throw new Error("Request listener already exists for "+e);i(u)}s.request.push({name:e,win:t,options:n})}Object.defineProperty(t,"__esModule",{value:!0}),t.listeners=void 0,t.resetListeners=r,t.getRequestListener=o,t.removeRequestListener=i,t.addRequestListener=u;var a=n(12),s=t.listeners=void 0;r()},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),a=n(12),s=n(19),c=n(21);t.RECEIVE_MESSAGE_TYPES=(o={},r(o,u.CONSTANTS.POST_MESSAGE_TYPE.ACK,function(e,t,n){var r=c.listeners.response[t.hash];if(!r)throw new Error("No handler found for post message ack for message: "+t.name+" in "+window.location.href);r.ack=!0}),r(o,u.CONSTANTS.POST_MESSAGE_TYPE.REQUEST,function(e,t,n){function r(n){return(0,s.sendMessage)(e,i({target:t.originalSource?t.originalSource:a.childWindows.getWindowId(e),hash:t.hash,name:t.name},n),"*")["catch"](function(e){if(o&&o.handleError)return o.handleError(e);throw e})}var o=(0,c.getRequestListener)(t.name,e);return a.promise.run(function(){return r({type:u.CONSTANTS.POST_MESSAGE_TYPE.ACK})}).then(function(){if(!o)throw new Error("No postmessage request handler for "+t.name+" in "+window.location.href);if(!o.window||!e||o.window===e){if(o.domain){var r="string"==typeof o.domain&&n===o.domain||o.domain instanceof RegExp&&n.match(o.domain);if(!r)throw new Error("Message origin "+n+" does not match domain "+o.domain)}return a.promise.deNodeify(o.handler,e,t.data)}}).then(function(e){return r({type:u.CONSTANTS.POST_MESSAGE_TYPE.RESPONSE,ack:u.CONSTANTS.POST_MESSAGE_ACK.SUCCESS,data:e})},function(e){return r({type:u.CONSTANTS.POST_MESSAGE_TYPE.RESPONSE,ack:u.CONSTANTS.POST_MESSAGE_ACK.ERROR,error:e.stack?e.message+"\n"+e.stack:e.toString()})})}),r(o,u.CONSTANTS.POST_MESSAGE_TYPE.RESPONSE,function(e,t,n){var r=c.listeners.response[t.hash];if(!r)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?r.respond(new Error(t.error)):t.ack===u.CONSTANTS.POST_MESSAGE_ACK.SUCCESS?r.respond(null,t.data||t.response):void 0}),o)},function(e,t,n){"use strict";function r(e){if(!e.name)throw new Error("Expected options.name");e.handler=e.handler||a.util.noop,e.errorHandler=e.errorHandler||function(e){throw e},e.once&&!function(){var t=e.handler;e.handler=a.util.once(function(){return(0,s.removeRequestListener)(e),t.apply(this,arguments)})}();var t=e.override||u.CONFIG.MOCK_MODE;return(0,s.addRequestListener)(e.name,e.window,e,t),e.handleError=function(t){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(){(0,s.removeRequestListener)(e)}}}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){t instanceof Function&&(o=n,n=t,t={}),t.name=e,t.handler=n||t.handler,t.errorHandler=o||t.errorHandler,t.once=!0;var i=new a.promise.Promise(function(e,n){t.handler=t.handler||e,t.errorHandler=t.errorHandler||n}),u=r(t);return a.util.extend(i,u),i}Object.defineProperty(t,"__esModule",{value:!0}),t.listen=r,t.on=o,t.once=i;var u=n(3),a=n(12),s=n(10)},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(10)},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.CONSTANTS=t.CONFIG=void 0,t.enableMockMode=r,t.disableMockMode=o;var i=n(3);Object.defineProperty(t,"CONFIG",{enumerable:!0,get:function(){return i.CONFIG}}),Object.defineProperty(t,"CONSTANTS",{enumerable:!0,get:function(){return i.CONSTANTS}})}])});
!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,s.registerGlobals)(),i.util.debug("ID",(0,u.getWindowID)()),i.util.listen(window,"message",a.messageListener),i.childWindows.register((0,u.getWindowID)(),window,i.util.getType()),(0,i.propagate)((0,u.getWindowID)())}Object.defineProperty(t,"__esModule",{value:!0}),t.Promise=void 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(12);Object.defineProperty(t,"Promise",{enumerable:!0,get:function(){return i.Promise}});var u=n(3),a=n(10),s=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 a=n(10);Object.defineProperty(t,"reset",{enumerable:!0,get:function(){return a.resetListeners}});var s=n(16);Object.defineProperty(t,"openBridge",{enumerable:!0,get:function(){return s.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 s.promise.nodeify(new s.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+"_"+s.util.uniqueID();if(a.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,a.sendMessage)(e.window,{hash:o,type:u.CONSTANTS.POST_MESSAGE_TYPE.REQUEST,name:e.name,data:e.data},e.domain||"*")["catch"](n),setTimeout(function(){return e.ack?void 0:n(new Error("No ack for postMessage "+e.name+" in "+u.CONFIG.ACK_TIMEOUT+"ms"))},u.CONFIG.ACK_TIMEOUT)}),e.callback)}function o(e,t,n,o,i){return i||(!o&&n instanceof Function?(i=n,o={},n={}):o instanceof Function&&(i=o,o={})),o=o||{},o.window=e,o.name=t,o.data=n,o.callback=i,r(o)}function i(e,t,n,r){var i=s.util.getParent();if(!i)throw new Error("Window does not have a parent");return o(s.util.getParent(),e,t,n,r)}Object.defineProperty(t,"__esModule",{value:!0}),t.request=r,t.send=o,t.sendToParent=i;var u=n(3),a=n(10),s=n(12)},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,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.CONFIG=void 0;var o,i=n(5);t.CONFIG={ALLOW_POSTMESSAGE_POPUP:!0,DEBUG:!1,ACK_TIMEOUT:1e3,LOG_TO_PAGE:!1,MOCK_MODE:!1,ALLOWED_POST_MESSAGE_METHODS:(o={},r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE,!0),r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE_GLOBAL_METHOD,!0),r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE_UP_THROUGH_BRIDGE,!0),r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE_DOWN_THROUGH_BRIDGE,!0),o)}},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:"postrobot_identify",METHOD:"postrobot_method"},WINDOW_TYPES:{FULLPAGE:"fullpage",POPUP:"popup",IFRAME:"iframe"},WINDOW_PROPS:{POSTROBOT:"__postRobot__"},SERIALIZATION_TYPES:{METHOD:"postrobot_method"},SEND_STRATEGIES:{POST_MESSAGE:"postrobot_post_message",POST_MESSAGE_GLOBAL_METHOD:"postrobot_post_message_global_method",POST_MESSAGE_UP_THROUGH_BRIDGE:"postrobot_post_message_up_through_bridge",POST_MESSAGE_DOWN_THROUGH_BRIDGE:"postrobot_post_message_down_through_bridge"}}},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="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},o=n(3),i=n(8),u=t.util={isPopup:function(){return Boolean(window.opener)},isIframe:function(){return Boolean(window.parent&&window!==window.parent)},isFullpage:function(){return Boolean(!u.isIframe()&&!u.isPopup())},windowReady:new i.promise.Promise(function(e,t){return"complete"===document.readyState?e():void window.addEventListener("load",e)}),getType:function(){return u.isPopup()?o.CONSTANTS.WINDOW_TYPES.POPUP:u.isIframe()?o.CONSTANTS.WINDOW_TYPES.IFRAME:o.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 u.isPopup()?window.opener:u.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}r!==window&&t(r)}},noop:function(){},getDomain:function(){return window.location.host},clearLogs:function(){if(window.console&&window.console.clear&&window.console.clear(),o.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],i=u.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(" "),a=o+" "+e+" "+i;r.innerHTML=a;var s={log:"#ddd",warn:"orange",error:"red",info:"blue",debug:"#aaa"}[e];r.style.cssText="margin-top: 10px; color: "+s+";",n.childNodes.length?n.insertBefore(r,n.childNodes[0]):n.appendChild(r)})},logLevel:function(e,t){t=Array.prototype.slice.call(t),t.unshift(u.getDomain()),t.unshift(u.getType().toLowerCase()),t.unshift("[post-robot]"),o.CONFIG.LOG_TO_PAGE&&u.writeToPage(e,t),window.console&&(window.console[e]||(e="log"),window.console[e]&&window.console[e].apply(window.console,t))},log:function(){u.logLevel("info",arguments)},debug:function(){o.CONFIG.DEBUG&&u.logLevel("debug",arguments)},debugError:function(){o.CONFIG.DEBUG&&u.logLevel("error",arguments)},safeHasProp:function(e,t){try{return!!e[t]}catch(n){return!1}},warn:function(){u.logLevel("warn",arguments)},error:function(){u.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]}},extend:function(e,t){if(!t)return e;for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},each:function(e,t){if(e instanceof Array)for(var n=0;n<e.length;n++)t(e[n],n);else if(e instanceof Object&&!(e instanceof Function))for(var r in e)e.hasOwnProperty(r)&&t(e[r],r)},replaceObject:function(e,t){var n=e instanceof Array?[]:{};return u.each(e,function(e,o){var i=t(e);void 0!==i?n[o]=i:"object"===("undefined"==typeof e?"undefined":r(e))&&null!==e?n[o]=u.replaceObject(e,t):n[o]=e}),n}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promise=t.Promise=void 0;var r=n(9),o=t.Promise=r.SyncPromise,i=t.promise={Promise:o,run:function(e){return o.resolve().then(e)},method:function(e){return function(){var t=this,n=arguments;return o.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},deNodeify:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return new o(function(t,r){try{return n.length<e.length?e.apply(void 0,n.concat([function(e,n){return e?r(e):t(n)}])):i.run(function(){return e.apply(void 0,n)}).then(t,r)}catch(o){return r(o)}})},map:function(e,t){for(var n=[],r=function(r){n.push(i.run(function(){return t(e[r])}))},u=0;u<e.length;u++)r(u);return o.all(n)}}},function(e,t){"use strict";function n(e,t,n){function r(){if(u){if(s)return n(o);if(a)return t(i)}}var o,i,u=!1,a=!1,s=!1;try{e(function(e){i=e,a=!0,r()},function(e){o=e,s=!0,r()})}catch(c){return n(c)}u=!0,r()}function r(){window.Promise=o}Object.defineProperty(t,"__esModule",{value:!0}),t.patchPromise=r;var o=t.SyncPromise=function(e){if(this.resolved=!1,this.rejected=!1,this.handlers=[],e){var t=this;n(e,function(e){return t.resolve(e)},function(e){return t.reject(e)})}};o.resolve=function(e){return e&&e.then?e:(new o).resolve(e)},o.reject=function(e){return(new o).reject(e)},o.prototype.resolve=function(e){if(this.resolved||this.rejected)return this;if(e&&e.then)throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},o.prototype.reject=function(e){if(this.resolved||this.rejected)return this;if(e&&e.then)throw new Error("Can not reject promise with another promise");return this.rejected=!0,this.value=e,this.dispatch(),this},o.prototype.dispatch=function(){if(this.resolved||this.rejected)for(;this.handlers.length;){var e,t,n=this.handlers.shift();try{this.resolved?e=n.onSuccess?n.onSuccess(this.value):this.value:n.onError?e=n.onError(this.value):t=this.value}catch(r){t=r}if(e===this)throw new Error("Can not return a promise from the the same promise");t?n.promise.reject(t):e&&e.then?e.then(function(e){n.promise.resolve(e)},function(e){n.promise.reject(e)}):n.promise.resolve(e)}},o.prototype.then=function(e,t){var n=new o;return this.handlers.push({promise:n,onSuccess:e,onError:t}),this.dispatch(),n},o.prototype["catch"]=function(e){return this.then(null,e)},o.prototype.done=function(e,t){this.then(e,t||function(e){console.error(e.stack||e.toString())})},o.all=function(e){for(var t=new o,n=e.length,r=[],i=0;i<e.length;i++)e[i].then(function(e){r[i]=e,n-=1,0===n&&t.resolve(r)},function(e){t.reject(e)});return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(11);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(!a.CONFIG.MOCK_MODE&&t){var n=(0,f.getRequestListener)(t.name,e);if(t.type!==a.CONSTANTS.POST_MESSAGE_TYPE.REQUEST||!t.name||!n||n.proxy!==!1){var r=(t.type===a.CONSTANTS.POST_MESSAGE_TYPE.REQUEST||t.type===a.CONSTANTS.POST_MESSAGE_TYPE.ACK)&&f.listeners.response[t.hash];if(!r)for(var o=0;o<f.listeners.proxies.length;o++){var i=f.listeners.proxies[o];if(e===i.from)return i.to}if("parent.opener"===t.target){var u=void 0;try{u=window.parent.opener}catch(c){throw new Error("Can not get window.parent.opener to proxy to")}if(!u)throw new Error("Can not get window.parent.opener to proxy to");return u}if(t.target&&t.target!==(0,a.getWindowID)()){var d=s.childWindows.getWindowById(t.target);if(!d)throw new Error("Unable to find window to proxy message to: "+t.target);return d}}}}function i(e){var t=e.source,n=e.origin,i=e.data,u=r(i);if(u&&-1===p.indexOf(u.id)){p.push(u.id),s.childWindows.register(u.source,t,u.windowType);var c=o(t,u);if(c)return delete u.target,(0,d.sendMessage)(c,u,"*",!0);if(s.util.debug("#receive",u.type,u.name,u),a.CONFIG.MOCK_MODE)return l.RECEIVE_MESSAGE_TYPES[u.type](t,u,n);u.data&&(u.data=(0,s.deserializeMethods)(t,u.data)),l.RECEIVE_MESSAGE_TYPES[u.type](t,u,n)}}function u(e){e={source:e.source||e.sourceElement,origin:e.origin||e.originalEvent.origin,data:e.data};try{(0,c.emulateIERestrictions)(e.source,window)}catch(t){return void console.error(t.stack||t.toString())}i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.receiveMessage=i,t.messageListener=u;var a=n(3),s=n(12),c=n(15),d=n(19),f=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(13);Object.keys(i).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var u=n(14);Object.keys(u).forEach(function(e){"default"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}})})},function(e,t,n){"use strict";function r(e){for(var t=c,n=Array.isArray(t),r=0,t=n?t:t[Symbol.iterator]();;){var o;if(n){if(r>=t.length)break;o=t[r++]}else{if(r=t.next(),r.done)break;o=r.value}var i=o;if(i.win===e)return i.match}var u=window.location.protocol+"//"+window.location.host,a=!1;try{if(e.location.protocol&&e.location.host){var s=e.location.protocol+"//"+e.location.host;s===u&&(a=!0)}}catch(d){}return c.push({win:e,match:a}),a}function o(e,t){return a.util.find(d,function(n){return n[e]===t},{})}function i(e){function t(t,o){t&&t!==window&&-1===n.indexOf(t)&&(a.util.debug("propagating to",o,t),n.push(t),r(t)&&a.util.safeHasProp(t,u.CONSTANTS.WINDOW_PROPS.POSTROBOT)?t[u.CONSTANTS.WINDOW_PROPS.POSTROBOT].registerSelf(e,window,a.util.getType()):a.util.windowReady.then(function(){(0,s.send)(t,u.CONSTANTS.POST_MESSAGE_NAMES.IDENTIFY,{id:e,type:a.util.getType()}).then(function(e){f.register(e.id,t,e.type)},function(e){a.util.debugError("Error sending identify:",e.stack||e.toString())})}))}(0,s.on)(u.CONSTANTS.POST_MESSAGE_NAMES.IDENTIFY,function(t,n,r){return{id:e}});var n=[];a.util.eachParent(function(e){t(e,"parent"),a.util.eachFrame(e,function(e){t(e,"frame")})},!0)}Object.defineProperty(t,"__esModule",{value:!0}),t.childWindows=void 0,t.isSameDomain=r,t.propagate=i;var u=n(3),a=n(7),s=n(1),c=[],d=[],f=t.childWindows={getWindowId:function(e){return o("win",e).id},getWindowById:function(e){return o("id",e).win},getWindowType:function(e){var t=o("win",e);if(t&&t.type)return t.type;if(a.util.safeHasProp(e,"parent")&&e.parent!==e)return u.CONSTANTS.WINDOW_TYPES.IFRAME;if(a.util.safeHasProp(e,"opener"))return u.CONSTANTS.WINDOW_TYPES.POPUP;var n=a.util.some(d,function(t){return a.util.isFrameOwnedBy(t.win,e)});return n?u.CONSTANTS.WINDOW_TYPES.IFRAME:void 0},register:function(e,t,n){var r=a.util.find(d,function(n){return n.id===e&&n.win===t});r||(a.util.debug("Registering window:",n,e,t),d.push({id:e,win:t,type:n}))},isEqual:function(e,t){if(e===t)return!0;var n=this.getWindowId(e),r=this.getWindowId(t);return!(!n||!r||n!==r)}},l=window.open;window.open=function(e,t,n,r){t||(t=a.util.uniqueID(),arguments[1]=t);var o=a.util.apply(l,this,arguments);return f.register(t,o,u.CONSTANTS.WINDOW_TYPES.POPUP),o}},function(e,t,n){"use strict";function r(e){return e instanceof Object&&e.__type__===s.CONSTANTS.SERIALIZATION_TYPES.METHOD&&e.__id__}function o(e,t){var n=c.util.uniqueID();return f[n]={win:e,method:t},{__type__:s.CONSTANTS.SERIALIZATION_TYPES.METHOD,__id__:n}}function i(e,t){return l(),c.util.replaceObject({obj:t},function(t){if(t instanceof Function)return o(e,t);if(r(t))throw new Error("Attempting to serialize already serialized method")}).obj}function u(e,t){return function(){var n=Array.prototype.slice.call(arguments);return(0,d.send)(e,s.CONSTANTS.POST_MESSAGE_NAMES.METHOD,{id:t.__id__,args:n})}}function a(e,t){return c.util.replaceObject({obj:t},function(t){return r(t)?u(e,t):void 0}).obj}Object.defineProperty(t,"__esModule",{value:!0}),t.listenForMethods=void 0,t.serializeMethod=o,t.serializeMethods=i,t.deserializeMethod=u,t.deserializeMethods=a;var s=n(3),c=n(7),d=n(1),f={},l=t.listenForMethods=c.util.once(function(){(0,d.on)(s.CONSTANTS.POST_MESSAGE_NAMES.METHOD,function(e,t){if(!f[t.id])throw new Error("Could not find method with id: "+t.id);if(f[t.id].win!==e)throw new Error("Method window does not match");return f[t.id].method.apply(null,t.args)})})},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 a}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!==window&&(0,u.isSameDomain)(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(12),a=void 0;t.openBridge=u.util.memoize(function(e){if(a)throw new Error("Only one bridge supported");var t=new u.promise.Promise(function(e){return window.document.body?e(window.document):void window.document.addEventListener("DOMContentLoaded",function(t){return e(window.document)})});return a=t.then(function(t){u.util.debug("Opening bridge:",e);var n=t.createElement("iframe");return n.setAttribute("id","postRobotBridge"),n.setAttribute("style","margin: 0; padding: 0; border: 0px none; overflow: hidden;"),n.setAttribute("frameborder","0"),n.setAttribute("border","0"),n.setAttribute("scrolling","no"),n.setAttribute("allowTransparency","true"),n.setAttribute("tabindex","-1"),n.setAttribute("hidden","true"),n.setAttribute("title",""),n.setAttribute("role","presentation"),n.src=e,t.body.appendChild(n),new u.promise.Promise(function(e,t){n.onload=function(){return e(n)},n.onerror=t})})})},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){(0,u.receiveMessage)(e)}),postMessageParent:i.promise.method(function(e,t,n){if(!window.parent||window.parent===window)throw new Error("Can not find parent to post message to");window.parent.postMessage(t,n)})}}Object.defineProperty(t,"__esModule",{value:!0}),t.registerGlobals=r;var o=n(3),i=n(12),u=n(10)},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(12)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendMessage=void 0;var r=n(3),o=n(12),i=n(20);t.sendMessage=o.promise.method(function(e,t,n,u){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.data=(0,o.serializeMethods)(e,t.data),t.target||(t.target=o.childWindows.getWindowId(e)),o.util.debug(u?"#proxy":"#send",t.type,t.name,t),r.CONFIG.MOCK_MODE)return delete t.target,window[r.CONSTANTS.WINDOW_PROPS.POSTROBOT].postMessage({origin:window.location.protocol+"//"+window.location.host,source:window,data:JSON.stringify(t)});if(e===window)throw new Error("Attemping to send message to self");if(e.closed)throw new Error("Window is closed");return o.util.debug("Running send message strategies",t),o.util.windowReady.then(function(){return o.promise.map(o.util.keys(i.SEND_MESSAGE_STRATEGIES),function(u){return o.promise.run(function(){if(!r.CONFIG.ALLOWED_POST_MESSAGE_METHODS[u])throw new Error("Strategy disallowed: "+u);return i.SEND_MESSAGE_STRATEGIES[u](e,t,n)}).then(function(){return o.util.debug(u,"success"),!0},function(e){return o.util.debugError(u,"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";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.SEND_MESSAGE_STRATEGIES=void 0;var o,i=n(3),u=n(12),a=n(15);t.SEND_MESSAGE_STRATEGIES=(o={},r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE,u.promise.method(function(e,t,n){return(0,a.emulateIERestrictions)(window,e),e.postMessage(JSON.stringify(t,0,2),n)})),r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE_GLOBAL_METHOD,u.promise.method(function(e,t,n){if("*"!==n){var r=void 0;try{r=e.location.protocol+"//"+e.location.host}catch(o){}if(!r)throw new Error("Can post post through global method - domain set to "+n+", but we can not verify the domain of the target window");if(r!==n)throw new Error("Can post post through global method - domain "+n+" does not match target window domain "+r)}if(!(0,u.isSameDomain)(e))throw new Error("window is a different domain");if(!u.util.safeHasProp(e,i.CONSTANTS.WINDOW_PROPS.POSTROBOT))throw new Error("postRobot not found on window");return e[i.CONSTANTS.WINDOW_PROPS.POSTROBOT].postMessage({origin:window.location.protocol+"//"+window.location.host,source:window,data:JSON.stringify(t)})})),r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE_UP_THROUGH_BRIDGE,u.promise.method(function(e,t,n){var r=(0,a.getBridgeFor)(e);if(!r)throw new Error("No bridge available in window");if(!(0,u.isSameDomain)(r))throw new Error("Bridge is different domain");if(!u.util.safeHasProp(r,i.CONSTANTS.WINDOW_PROPS.POSTROBOT))throw new Error("postRobot not installed in bridge");return r[i.CONSTANTS.WINDOW_PROPS.POSTROBOT].postMessageParent(window,JSON.stringify(t,0,2),n)})),r(o,i.CONSTANTS.SEND_STRATEGIES.POST_MESSAGE_DOWN_THROUGH_BRIDGE,u.promise.method(function(e,t,n){var r=(0,a.getBridge)();if(!r)throw new Error("Bridge not initialized");if(e===r.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 r.then(function(e){e.contentWindow.postMessage(JSON.stringify(t,0,2),n)})})),o)},function(e,t,n){"use strict";function r(){t.listeners=s={request:[],response:{},proxies:[]}}function o(e,t){for(var n=s.request,r=Array.isArray(n),o=0,n=r?n:n[Symbol.iterator]();;){var i;if(r){if(o>=n.length)break;i=n[o++]}else{if(o=n.next(),o.done)break;i=o.value}var u=i;if(u.name===e){if(!u.win)return u.options;if(t&&a.childWindows.isEqual(t,u.win))return u.options}}}function i(e){for(var t=void 0,n=s.request,r=Array.isArray(n),o=0,n=r?n:n[Symbol.iterator]();;){var i;if(r){if(o>=n.length)break;i=n[o++]}else{if(o=n.next(),o.done)break;i=o.value}var u=i;if(u.options===e){t=u;break}}t&&s.request.splice(s.request.indexOf(t),1)}function u(e,t,n,r){var u=o(e,t);if(u){if(!r)throw new Error("Request listener already exists for "+e);i(u)}s.request.push({name:e,win:t,options:n})}Object.defineProperty(t,"__esModule",{value:!0}),t.listeners=void 0,t.resetListeners=r,t.getRequestListener=o,t.removeRequestListener=i,t.addRequestListener=u;var a=n(12),s=t.listeners=void 0;r()},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),a=n(12),s=n(19),c=n(21);t.RECEIVE_MESSAGE_TYPES=(o={},r(o,u.CONSTANTS.POST_MESSAGE_TYPE.ACK,function(e,t,n){var r=c.listeners.response[t.hash];if(!r)throw new Error("No handler found for post message ack for message: "+t.name+" in "+window.location.href);r.ack=!0}),r(o,u.CONSTANTS.POST_MESSAGE_TYPE.REQUEST,function(e,t,n){function r(n){return(0,s.sendMessage)(e,i({target:t.originalSource?t.originalSource:a.childWindows.getWindowId(e),hash:t.hash,name:t.name},n),"*")["catch"](function(e){if(o&&o.handleError)return o.handleError(e);throw e})}var o=(0,c.getRequestListener)(t.name,e);return a.promise.run(function(){return r({type:u.CONSTANTS.POST_MESSAGE_TYPE.ACK})}).then(function(){if(!o)throw new Error("No postmessage request handler for "+t.name+" in "+window.location.href);if(!o.window||!e||o.window===e){if(o.domain){var r="string"==typeof o.domain&&n===o.domain||o.domain instanceof RegExp&&n.match(o.domain);if(!r)throw new Error("Message origin "+n+" does not match domain "+o.domain)}return a.promise.deNodeify(o.handler,e,t.data)}}).then(function(e){return r({type:u.CONSTANTS.POST_MESSAGE_TYPE.RESPONSE,ack:u.CONSTANTS.POST_MESSAGE_ACK.SUCCESS,data:e})},function(e){return r({type:u.CONSTANTS.POST_MESSAGE_TYPE.RESPONSE,ack:u.CONSTANTS.POST_MESSAGE_ACK.ERROR,error:e.stack?e.message+"\n"+e.stack:e.toString()})})}),r(o,u.CONSTANTS.POST_MESSAGE_TYPE.RESPONSE,function(e,t,n){var r=c.listeners.response[t.hash];if(!r)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?r.respond(new Error(t.error)):t.ack===u.CONSTANTS.POST_MESSAGE_ACK.SUCCESS?r.respond(null,t.data||t.response):void 0}),o)},function(e,t,n){"use strict";function r(e){if(!e.name)throw new Error("Expected options.name");e.handler=e.handler||a.util.noop,e.errorHandler=e.errorHandler||function(e){throw e},e.once&&!function(){var t=e.handler;e.handler=a.util.once(function(){return(0,s.removeRequestListener)(e),t.apply(this,arguments)})}();var t=e.override||u.CONFIG.MOCK_MODE;return(0,s.addRequestListener)(e.name,e.window,e,t),e.handleError=function(t){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(){(0,s.removeRequestListener)(e)}}}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){t instanceof Function&&(o=n,n=t,t={}),t.name=e,t.handler=n||t.handler,t.errorHandler=o||t.errorHandler,t.once=!0;var i=new a.promise.Promise(function(e,n){t.handler=t.handler||e,t.errorHandler=t.errorHandler||n}),u=r(t);return a.util.extend(i,u),i}Object.defineProperty(t,"__esModule",{value:!0}),t.listen=r,t.on=o,t.once=i;var u=n(3),a=n(12),s=n(10)},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(10)},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.CONSTANTS=t.CONFIG=void 0,t.enableMockMode=r,t.disableMockMode=o;var i=n(3);Object.defineProperty(t,"CONFIG",{enumerable:!0,get:function(){return i.CONFIG}}),Object.defineProperty(t,"CONSTANTS",{enumerable:!0,get:function(){return i.CONSTANTS}})}])});
{
"name": "post-robot",
"version": "2.0.10",
"version": "2.0.11",
"description": "Simple postMessage based server.",

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

@@ -37,2 +37,6 @@

if (win.closed) {
throw new Error('Window is closed');
}
util.debug('Running send message strategies', message);

@@ -39,0 +43,0 @@

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

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