module.exports = "(function(e,t,i){var n=i(5894),r=i(4727).Promise,o=i(7358),a=i(4438),s=i(1548),c=i(8737),h=i(5035),d=i(1571),g=i(1725),u=i(4810),p=i(7152);function R(e,t){if(this.change=e,this.config=t,this.reasonShouldNotRedirect=this._checkForReasonNotToRedirect(),!this.reasonShouldNotRedirect){if(!n.isString(this.change.dest)&&!n.isFunction(this.change.dest))throw new Error(\"Redirect destination is not a string or function\");if(n.isFunction(this.change.dest)&&(this.change.dest=this.change.dest(),!n.isString(this.change.dest)))throw new Error(\"Redirect destination function did not evaluate to a string\");if(!this.config.action)throw new Error(\"Redirect changes require an action to be passed in the config.\");d.dispatch(o.ANNOUNCE_PENDING_REDIRECT,{layerId:this.config.action.layerId})}}R.prototype.apply=function(){if(this.reasonShouldNotRedirect)return u.warn(\"Redirect change is not being applied because: \"+this.reasonShouldNotRedirect),r.resolve(h.changeState.IGNORED);if(this.reasonInvalid)return u.error(\"Redirect change cannot be applied because:\",this.reasonInvalid),r.reject(this.reasonInvalid);try{this.__doRedirect(this.__createURL())}catch(e){return r.reject(e)}return r.resolve(h.changeState.APPLIED)},R.prototype.__createURL=function(){var e=g.create(this.change.dest);if(this.change.preserveParameters){var t=p.getLocation().search;t&&(e.search?e.search+=\"&\"+t.substr(1):e.search=t)}return e.toString()},R.prototype.__hidePage=function(){var e=c.createElement(\"style\");e.setAttribute(\"type\",\"text/css\"),e.innerHTML=\"body{display:none;visibility:hidden;}\",c.appendToHead(e)},R.prototype.__doRedirect=function(e){(!this.change.hasOwnProperty(\"hidePage\")||this.change.hidePage)&&this.__hidePage(),p.setLocation(e)},R.prototype._checkForReasonNotToRedirect=function(){var e=s.get(a.COOKIES.REDIRECT);if(!this.change.allowAdditionalRedirect&&!n.isUndefined(e))return\"Page was already redirected.\"},__UNDO_CHANGES_UPON_VIEW_DEACTIVATION__&&(R.prototype.undo=function(){return r.resolve(h.changeState.IGNORED)}),e.exports=function(e){e.registerChangeApplier(h.changeType.REDIRECT,R)}})";