"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[4644,5683],{35683:(e,t,l)=>{l.r(t),l.d(t,{default:()=>n});var i=l(81621),s=l(9588);const n=(0,i.vt)(((e,t)=>({licenseStatus:cmplz_settings.licenseStatus,processing:!1,licenseNotices:[],noticesLoaded:!1,getLicenseNotices:async()=>{const{licenseStatus:t,notices:l}=await s.doAction("license_notices",{}).then((e=>e));e((e=>({noticesLoaded:!0,licenseNotices:l,licenseStatus:t})))},activateLicense:async t=>{let l={};l.license=t,e({processing:!0});const{licenseStatus:i,notices:n}=await s.doAction("activate_license",l);e((e=>({processing:!1,licenseNotices:n,licenseStatus:i})))},deactivateLicense:async()=>{e({processing:!0});const{licenseStatus:t,notices:l}=await s.doAction("deactivate_license");e((e=>({processing:!1,licenseNotices:l,licenseStatus:t})))}})))},54644:(e,t,l)=>{l.r(t),l.d(t,{default:()=>g});var i=l(51609),s=l(44124),n=l(27723),c=l(52043),a=l(35683),r=l(86087),m=l(4219),o=l(88499),d=l(65170),p=l(42838),u=l.n(p);const g=e=>{const{highLightField:t,getFieldValue:p}=(0,m.default)(),{licenseStatus:g}=(0,a.default)(),{bannerDataLoaded:_}=(0,o.default)();let z="https://complianz.io/pricing/";const{subMenu:f,getMenuRegions:h,selectedSubMenuItem:v}=(0,c.default)();let k=h(),E=p("regions");Array.isArray(E)||(E=[E]),k=k.filter((e=>E.includes(e)));const[b,N]=(0,r.useState)(null);(0,r.useEffect)((()=>{Promise.resolve().then(l.bind(l,32636)).then((({default:e})=>{N((()=>e))}))}),[]);let y,L=[];for(const t of e.fields)t.group_id===e.group&&L.push(t);for(const e of f.menu_items)if(e.id===v?y=e:e.menu_items&&(y=e.menu_items.filter((e=>e.id===v))[0]),y)break;for(const t of f.menu_items)if(t.id===v&&t.hasOwnProperty("groups")){let l=t.groups.filter((t=>t.id===e.group));l.length>0&&(y=l[0])}if(!y)return null;let S=y.premium_text?y.premium_text:(0,n.__)("Learn more about %sPremium%s","complianz-gdpr");cmplz_settings.is_premium&&(S="empty"===g||"deactivated"===g?cmplz_settings.messageInactive:cmplz_settings.messageInvalid);let w=!1;y.premium&&(w=!cmplz_settings.is_premium),cmplz_settings.is_premium&&(w="valid"!==g&&"license"!==y.id),z=y.upgrade?y.upgrade:z;let x=y.helpLink_text?y.helpLink_text:(0,n.__)("Instructions","complianz-gdpr"),A=w?"cmplz-disabled":"";return L.filter((e=>e.conditionallyDisabled&&!0===e.conditionallyDisabled||e.visible&&!1===e.visible)).length===L.length?null:(0,i.createElement)("div",{className:"cmplz-grid-item cmplz-"+y.id+" "+A,key:y.id},y.title&&(0,i.createElement)("div",{className:"cmplz-grid-item-header"},(0,i.createElement)("h3",{className:"cmplz-h4"},y.title),k.length>0&&(0,i.createElement)("div",{className:"cmplz-grid-item-controls"},k.map(((e,t)=>(0,i.createElement)("div",{key:t},(0,i.createElement)("img",{className:"cmplz-settings-region",src:cmplz_settings.plugin_url+"/assets/images/"+e+".svg",alt:"region"}))))),0===k.length&&y.helpLink&&(0,i.createElement)("div",{className:"cmplz-grid-item-controls"},(0,i.createElement)(s.default,{target:"_blank",rel:"noopener noreferrer",className:"cmplz-helplink",text:x,url:y.helpLink}))),(0,i.createElement)("div",{className:"cmplz-grid-item-content"},y.intro&&(0,i.createElement)("div",{className:"cmplz-settings-block-intro",dangerouslySetInnerHTML:{__html:u().sanitize(y.intro)}})," ",b&&L.map(((e,l)=>(0,i.createElement)(d.default,{key:"field-"+e.id,fallback:"Could not load field "+e.id},(0,i.createElement)(b,{key:e.id,field:e,highLightField:t}))))),w&&(0,i.createElement)("div",{className:"cmplz-locked"},(0,i.createElement)("div",{className:"cmplz-locked-overlay"},(0,i.createElement)("span",{className:"cmplz-task-status cmplz-premium"},(0,n.__)("Upgrade","complianz-gdpr")),(0,i.createElement)("span",null,cmplz_settings.is_premium&&(0,i.createElement)("span",null,S," ",(0,i.createElement)("a",{className:"cmplz-locked-link",href:cmplz_settings.license_url},(0,n.__)("Check license","complianz-gdpr"))),!cmplz_settings.is_premium&&(0,i.createElement)(s.default,{target:"_blank",rel:"noopener noreferrer",text:S,url:z})))),"banner"===f.id&&!_&&(0,i.createElement)("div",{className:"cmplz-locked"},(0,i.createElement)("div",{className:"cmplz-locked-overlay"})))}}}]);