"use strict";(self.webpackChunkcomplianz_gdpr=self.webpackChunkcomplianz_gdpr||[]).push([[1439],{41439:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var s=a(51609),l=a(86087),i=a(27723),n=a(9588),o=a(45111);class d extends l.Component{constructor(){super(...arguments),this.state={data:[],buttonsDisabled:!1}}dismissModal(e){this.props.handleModal(!1,null,e)}componentDidMount(){this.setState({data:this.props.data,buttonsDisabled:!1})}handleFix(e){let t=this.props.data.action;this.setState({buttonsDisabled:!0}),n.doAction(t,"refresh",this.props.data).then((e=>{this.props.data;let{data:t}=this.state;t.description=e.msg,t.subtitle="",this.setState({data:t}),this.props.data,e.success&&this.dismissModal(this.props.data)}))}render(){const{data:e,buttonsDisabled:t}=this.state;let a=t?"disabled":"",l=e.description;return(0,s.createElement)("div",null,(0,s.createElement)("div",{className:"cmplz-modal-backdrop",onClick:e=>this.dismissModal(e)}," "),(0,s.createElement)("div",{className:"cmplz-modal",id:"{id}"},(0,s.createElement)("div",{className:"cmplz-modal-header"},(0,s.createElement)("h2",{className:"modal-title"},e.title),(0,s.createElement)("button",{type:"button",className:"cmplz-modal-close","data-dismiss":"modal","aria-label":"Close",onClick:e=>this.dismissModal(e)},(0,s.createElement)(o.default,{name:"times"}))),(0,s.createElement)("div",{className:"cmplz-modal-content"},e.subtitle&&(0,s.createElement)("div",{className:"cmplz-modal-subtitle"},e.subtitle),Array.isArray(l)&&l.map(((e,t)=>(0,s.createElement)("div",{key:t,className:"cmplz-modal-description"},e)))),(0,s.createElement)("div",{className:"cmplz-modal-footer"},e.edit&&(0,s.createElement)("a",{href:e.edit,target:"_blank",rel:"noopener noreferrer",className:"button button-secondary"},(0,i.__)("Edit","complianz-gdpr")),e.help&&(0,s.createElement)("a",{href:e.help,target:"_blank",rel:"noopener noreferrer",className:"button cmplz-button-help"},(0,i.__)("Help","complianz-gdpr")),!e.ignored&&"ignore_url"===e.action&&(0,s.createElement)("button",{disabled:a,className:"button button-primary",onClick:e=>this.handleFix(e)},(0,i.__)("Ignore","complianz-gdpr")),"ignore_url"!==e.action&&(0,s.createElement)("button",{disabled:a,className:"button button-primary",onClick:e=>this.handleFix(e)},(0,i.__)("Fix","complianz-gdpr")))))}}const r=d}}]);