"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[5035,9684,5683,9166],{9684:(e,t,a)=>{a.r(t),a.d(t,{default:()=>_});var s=a(86087),c=a(27723),i=a(45111),n=a(47143),l=a(9588),o=a(99166),d=a(4219),r=a(32828),m=a(52043),u=a(42838),p=a.n(u);const _=({notice:e,index:t})=>{const{dismissNotice:a,fetchProgressData:u}=(0,r.default)(),{getField:_,setHighLightField:g,fetchFieldsData:h}=(0,d.default)(),{setSelectedSubMenuItem:f}=(0,m.default)();let v="premium"===e.icon,b=e.url&&-1!==e.url.indexOf("complianz.io"),z=e.status.charAt(0).toUpperCase()+e.status.slice(1);return(0,s.createElement)("div",{key:t,className:"cmplz-task-element"},(0,s.createElement)("span",{className:"cmplz-task-status cmplz-"+e.status},z),(0,s.createElement)("p",{className:"cmplz-task-message",dangerouslySetInnerHTML:{__html:p().sanitize(e.message)}}),b&&e.url&&(0,s.createElement)("a",{target:"_blank",href:e.url,rel:"noopener noreferrer"},(0,c.__)("More info","complianz-gdpr")),e.clear_cache_id&&(0,s.createElement)("span",{className:"cmplz-task-enable button button-secondary",onClick:()=>(async e=>{let t={};t.cache_id=e,l.doAction("clear_cache",t).then((async e=>{(0,n.dispatch)("core/notices").createNotice("success",(0,c.__)("Re-started test","complianz-gdpr"),{__unstableHTML:!0,id:"cmplz_clear_cache",type:"snackbar",isDismissible:!0}).then((0,o.default)(3e3)).then((e=>{(0,n.dispatch)("core/notices").removeNotice("rsssl_clear_cache")})),await h(),await u()}))})(e.clear_cache_id)},(0,c.__)("Re-check","complianz-gdpr")),!v&&!b&&e.url&&(0,s.createElement)("a",{className:"cmplz-task-enable button button-secondary",href:e.url},(0,c.__)("View","complianz-gdpr")),!v&&e.highlight_field_id&&(0,s.createElement)("span",{className:"cmplz-task-enable button button-secondary",onClick:()=>(async()=>{g(e.highlight_field_id);let t=_(e.highlight_field_id);await f(t.menu_id)})()},(0,c.__)("View","complianz-gdpr")),e.plus_one&&(0,s.createElement)("span",{className:"cmplz-plusone"},"1"),e.dismissible&&"completed"!==e.status&&(0,s.createElement)("div",{className:"cmplz-task-dismiss"},(0,s.createElement)("button",{type:"button",onClick:t=>a(e.id)},(0,s.createElement)(i.default,{name:"times"}))))}},35035:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var s=a(86087),c=a(9684),i=a(99695),n=a(27723),l=a(4219),o=a(35683),d=a(32828);const r=(0,s.memo)((e=>{const{fields:t,setChangedField:a,updateField:r}=(0,l.default)(),{setProgressLoaded:m}=(0,d.default)(),{licenseStatus:u,licenseNotices:p,getLicenseNotices:_,noticesLoaded:g,activateLicense:h,deactivateLicense:f,processing:v}=(0,o.default)();(0,s.useEffect)((()=>{g||_()}),[]);let b=e.field,z=v?"cmplz-processing":"";return(0,s.createElement)("div",{className:"components-base-control"},(0,s.createElement)("div",{className:"cmplz-license-field"},(0,s.createElement)("input",{className:"components-text-control__input",type:"password",id:b.id,value:b.value,onChange:e=>{return t=e.target.value,a(b.id,t),void r(b.id,t);var t}}),(0,s.createElement)("button",{className:"button button-default",disabled:v,onClick:()=>(async()=>{"valid"===u?await f():await h(e.field.value),m(!1)})()},"valid"===u&&(0,n.__)("Deactivate","complianz-gdpr"),"valid"!==u&&(0,n.__)("Activate","complianz-gdpr"))),!g&&(0,s.createElement)(i.default,null),g&&(0,s.createElement)("div",{className:z},p.map(((e,t)=>(0,s.createElement)(c.default,{key:t,index:t,notice:e,highLightField:""})))))}))},35683:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var s=a(81621),c=a(9588);const i=(0,s.vt)(((e,t)=>({licenseStatus:cmplz_settings.licenseStatus,processing:!1,licenseNotices:[],noticesLoaded:!1,getLicenseNotices:async()=>{const{licenseStatus:t,notices:a}=await c.doAction("license_notices",{}).then((e=>e));e((e=>({noticesLoaded:!0,licenseNotices:a,licenseStatus:t})))},activateLicense:async t=>{let a={};a.license=t,e({processing:!0});const{licenseStatus:s,notices:i}=await c.doAction("activate_license",a);e((e=>({processing:!1,licenseNotices:i,licenseStatus:s})))},deactivateLicense:async()=>{e({processing:!0});const{licenseStatus:t,notices:a}=await c.doAction("deactivate_license");e((e=>({processing:!1,licenseNotices:a,licenseStatus:t})))}})))},99166:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});const s=e=>function(t){return new Promise((a=>setTimeout((()=>a(t)),e)))}}}]);