define(["require","exports","tslib","react","prop-types","modules/clean/web_timing_logger","modules/clean/api_v2/default_user_client","modules/clean/integrations/integration_popover","modules/clean/integrations/data/store","modules/clean/integrations/performance_timer","modules/clean/integrations/log_event","modules/clean/integrations/report_error"],(function(t,e,r,o,n,i,p,u,s,a,l,c){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),o=r.__importDefault(o),n=r.__importStar(n);var g=(function(t){function e(e){var r=t.call(this,e)||this;r.mounted=!1,r.popoverGroup=new u.IntegrationPopoverGroup,r.getApiV2Client=function(){return r.apiV2Client},r.getIntegrationStore=function(){return r.state.integrationStore},r.getPopoverGroup=function(){return r.popoverGroup},r.shouldAutoDisplayTooltip=function(){return r.state.autoDisplayTooltip},r.getPerformanceTimer=function(){return r.performanceTimer},r.getLogEvent=function(){return r.logEvent},r.getReportError=function(){return r.reportError},r.apiV2Client=new p.DefaultUserApiV2Client(r.props.user),r.performanceTimer=a.WebPerformanceTimer;var o=l.createIntegrationsActionsLogger();return r.logEvent=o.logEvent,r.reportError=c.webReportError,r.state={integrationStore:s.initStoreForIntegration(r.props.user.id),autoDisplayTooltip:!1},r}return r.__extends(e,t),e.prototype.getChildContext=function(){return{getApiV2Client:this.getApiV2Client,getIntegrationStore:this.getIntegrationStore,getPopoverGroup:this.getPopoverGroup,shouldAutoDisplayTooltip:this.shouldAutoDisplayTooltip,performanceTimer:this.getPerformanceTimer,logEvent:this.getLogEvent,reportError:this.getReportError}},e.prototype.componentDidMount=function(){var t=this;this.mounted=!0,i.waitForTTI().then((function(){return r.__awaiter(t,void 0,void 0,(function(){var t,e,o;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.apiV2Client.ns("integrations").rpc("get_user_settings",{},{})];case 1:return t=r.sent(),this.mounted&&(e=t.dismissed_prompts.filter((function(t){return"tooltip_click_for_more_auto_display"===t[".tag"]})).length>0,this.setState({autoDisplayTooltip:!e})),[3,3];case 2:return o=r.sent(),this.reportError(o,"non-critical",["ProfileCard"],{endpoint:"integrations/get_user_settings",entry_point:"file preview"}),[3,3];case 3:return[2]}}))}))}))},e.prototype.componentWillUnmount=function(){this.mounted=!1},e.prototype.render=function(){return this.props.children},e.childContextTypes={getApiV2Client:n.func,getIntegrationStore:n.func,getPopoverGroup:n.func,shouldAutoDisplayTooltip:n.func,performanceTimer:n.func,logEvent:n.func,reportError:n.func},e})(o.default.Component);e.IntegrationProvider=g})); //# sourceMappingURL=integration_provider.min.js-vflqkqzPH.map