if (self.CavalryLogger) { CavalryLogger.start_js(["q1Dz8"]); }

__d("XBrowserPushUpsellXOutController",["XController"],(function a(b,c,d,e,f,g){f.exports=c("XController").create("/notifications/client/push/upsellxout/",{})}),null);
__d("NotificationJewelUpsell.react",["cx","fbt","ix","Arbiter","AsyncRequest","BanzaiLogger","BrowserPushStrings","Image.react","ImageBlock.react","NotificationPermissionRequest.react","PushRegistration","React","XBrowserPushDisabledController","XBrowserPushUpsellXOutController","XPushRegisterServiceWorkerController","XUIButton.react","XUICloseButton.react","emptyFunction"],(function a(b,c,d,e,f,g,h,i,j){__p&&__p();var k,l,m="BrowserPushInstall/installed";k=babelHelpers.inherits(n,c("React").Component);l=k&&k.prototype;function n(o){"use strict";__p&&__p();l.constructor.call(this,o);this.state={isInstalling:false,isHidden:true};this.$NotificationJewelUpsell3=function(){this.setState({isHidden:true})}.bind(this);this.$NotificationJewelUpsell4=function(){var p=c("XBrowserPushUpsellXOutController").getURIBuilder().getURI();new(c("AsyncRequest"))().setURI(p).setMethod("POST").send();c("Arbiter").inform(m);this.$NotificationJewelUpsell5("upsell_xout")}.bind(this);this.$NotificationJewelUpsell6=function(){this.$NotificationJewelUpsell5("turn_on");this.setState({isInstalling:true});this.$NotificationJewelUpsell1.registerPush(c("XPushRegisterServiceWorkerController"),c("AsyncRequest")).then(function(){c("Arbiter").inform(m);this.$NotificationJewelUpsell5("install")}.bind(this))["catch"](function(){c("Arbiter").inform(m);if(c("PushRegistration").pushPermissionIsDenied())this.$NotificationJewelUpsell5("deny");else this.$NotificationJewelUpsell5("install_ignore")}.bind(this))}.bind(this);this.$NotificationJewelUpsell1=c("PushRegistration").get(o.path,o.appID)}n.prototype.componentDidMount=function(){"use strict";this.$NotificationJewelUpsell1.isPushRegistered(this.props.isInstalled,c("XPushRegisterServiceWorkerController"),c("XBrowserPushDisabledController"),c("AsyncRequest")).then(function(o){if(!o&&!this.props.wasXOuted)this.$NotificationJewelUpsell2()}.bind(this))["catch"](c("emptyFunction"));c("Arbiter").subscribe(m,this.$NotificationJewelUpsell3)};n.prototype.$NotificationJewelUpsell2=function(){"use strict";this.setState({isHidden:false})};n.prototype.$NotificationJewelUpsell5=function(event){"use strict";c("BanzaiLogger").log("BrowserPushLoggerConfig",{event:event,appid:this.props.appID,surface:"jewel_upsell"})};n.prototype.render=function(){"use strict";if(this.state.isHidden)return null;var o=this.state.isInstalling?c("React").createElement(c("NotificationPermissionRequest.react"),{onHide:function(){return this.setState({isInstalling:false})}.bind(this)}):null;return c("React").createElement("section",{className:"_4by1"},o,c("React").createElement(c("ImageBlock.react"),{spacing:"large"},c("React").createElement(c("Image.react"),{draggable:false,src:j("287648")}),c("React").createElement("div",{className:"_4by2"},c("React").createElement("h4",null,c("BrowserPushStrings").turn_on),c("React").createElement("div",null,c("BrowserPushStrings").explanation),c("React").createElement(c("XUIButton.react"),{className:"_4by3",label:i._("Turn On"),onClick:this.$NotificationJewelUpsell6,use:"special"}))),c("React").createElement(c("XUICloseButton.react"),{className:"_4by4",onClick:this.$NotificationJewelUpsell4}))};f.exports=n}),null);