"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[760,6348,2340],{60760:(e,t,c)=>{c.r(t),c.d(t,{default:()=>d});var n=c(51280),a=c(72340),o=c(88496),i=c(93396),l=c(25536),s=c(6348);const d=(0,o.memo)((()=>{const{savedDocument:e,conclusions:t}=(0,a.default)(),{addHelpNotice:c}=(0,l.default)();return(0,o.useEffect)((()=>{e.has_to_be_reported&&c("create-data-breach-reports","warning",(0,i.__)("This wizard is intended to provide a general guide to a possible data breach.","complianz-gdpr")+" "+(0,i.__)("Specialist legal advice should be sought about your specific circumstances.","complianz-gdpr"),(0,i.__)("Specialist legal advice required","complianz-gdpr"),!1)}),[e]),(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{id:"cmplz-conclusion"},(0,n.createElement)("h3",null,(0,i.__)("Your dataleak report:","complianz-gdpr")),(0,n.createElement)("ul",{className:"cmplz-conclusion__list"},t.length>0&&t.map(((e,t)=>(0,n.createElement)(s.default,{conclusion:e,key:t,delay:1e3*t}))))))}))},6348:(e,t,c)=>{c.r(t),c.d(t,{default:()=>s});var n=c(51280),a=c(88496),o=c(15832),i=c(24300),l=c.n(i);const s=(0,a.memo)((({conclusion:e,delay:t})=>{const[c,i]=(0,a.useState)(!0);(0,a.useEffect)((()=>{setTimeout((()=>{s()}),t)}));const s=()=>{i(!1)};let d="green";return"warning"===e.report_status&&(d="orange"),"error"===e.report_status&&(d="red"),(0,n.createElement)(n.Fragment,null,c&&(0,n.createElement)("li",{className:"cmplz-conclusion__check icon-loading"},(0,n.createElement)(o.default,{name:"loading",color:"grey"}),(0,n.createElement)("div",{className:"cmplz-conclusion__check--report-text"}," ",e.check_text," ")),!c&&(0,n.createElement)("li",{className:"cmplz-conclusion__check icon-"+e.report_status},(0,n.createElement)(o.default,{name:e.report_status,color:d}),(0,n.createElement)("div",{className:"cmplz-conclusion__check--report-text",dangerouslySetInnerHTML:{__html:l().sanitize(e.report_text)}}," ")))}))},72340:(e,t,c)=>{c.r(t),c.d(t,{default:()=>l});var n=c(30809),a=c(524),o=c(61744),i=c(12648);const l=(0,n.Su)(((e,t)=>({documentsLoaded:!1,savedDocument:{},conclusions:[],region:"",fileName:"",fetching:!1,updating:!1,loadingFields:!1,documents:[],regions:[],fields:[],editDocumentId:!1,resetEditDocumentId:t=>{e({editDocumentId:!1,region:""})},editDocument:async t=>{e({updating:!0}),await o.doAction("load_databreach_report",{id:t}).then((t=>{e({fields:t.fields,region:t.region,updating:!1,fileName:t.file_name})})).catch((e=>{console.error(e)})),e({editDocumentId:t})},setRegion:t=>{e({region:t})},updateField:(c,n)=>{let o=!1,l=!1;e((0,a.cp)((e=>{e.fields.forEach((function(e,t){e.id===c&&(l=t,o=!0)})),!1!==l&&(e.fields[l].value=n)})));let s=(0,i.updateFieldsListWithConditions)(t().fields);e({fields:s})},save:async c=>{e({updating:!0});let n=t().editDocumentId,a=0;await o.doAction("save_databreach_report",{fields:t().fields,region:c,post_id:n}).then((t=>(a=t.post_id,e({updating:!1,conclusions:t.conclusions}),t))).catch((e=>{console.error(e)})),await t().fetchData();let i=t().documents.filter((e=>e.id===a));i.length>0&&e({savedDocument:i[0]})},deleteDocuments:async c=>{let n=t().documents.filter((e=>c.includes(e.id)));e((e=>({documents:e.documents.filter((e=>!c.includes(e.id)))})));let a={};a.documents=n,await o.doAction("delete_databreach_report",a).then((e=>e)).catch((e=>{console.error(e)}))},fetchData:async()=>{if(t().fetching)return;e({fetching:!0});const{documents:c,regions:n}=await o.doAction("get_databreach_reports",{}).then((e=>e)).catch((e=>{console.error(e)}));e((e=>({documentsLoaded:!0,documents:c,regions:n,fetching:!1})))},fetchFields:async t=>{let c={region:t};e({loadingFields:!0});const{fields:n}=await o.doAction("get_databreach_report_fields",c).then((e=>e)).catch((e=>{console.error(e)}));let a=(0,i.updateFieldsListWithConditions)(n);e((e=>({fields:a,loadingFields:!1})))}})))}}]);