"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[24,6420],{50024:(e,t,a)=>{a.r(t),a.d(t,{default:()=>p});var n=a(51280),l=a(88496),i=a(93396),r=a(60312),o=a(96420);const p=()=>{const{dataLoaded:e,pluginData:t,pluginActions:a,fetchOtherPluginsData:p,error:c}=(0,o.default)();return(0,l.useEffect)((()=>{e||p()}),[]),!e||c?(0,n.createElement)(r.default,{lines:"3",error:c}):(0,n.createElement)("div",{className:"cmplz-other-plugins-container"},t.map(((e,t)=>((e,t)=>(0,n.createElement)("div",{key:t,className:"cmplz-other-plugins-element cmplz-"+e.slug},(0,n.createElement)("a",{href:e.wordpress_url,target:"_blank",rel:"noopener noreferrer",title:e.title},(0,n.createElement)("div",{className:"cmplz-bullet"}),(0,n.createElement)("div",{className:"cmplz-other-plugins-content"},e.title)),(0,n.createElement)("div",{className:"cmplz-other-plugin-status"},"upgrade-to-premium"===e.pluginAction&&(0,n.createElement)("a",{target:"_blank",href:e.upgrade_url,rel:"noopener noreferrer"},(0,i.__)("Upgrade","complianz-gdpr")),"upgrade-to-premium"!==e.pluginAction&&"installed"!==e.pluginAction&&(0,n.createElement)("a",{href:"#",onClick:t=>a(e.slug,e.pluginAction,t)},e.pluginActionNice),"installed"===e.pluginAction&&(0,i.__)("Installed","complianz-gdpr"))))(e,t))))}},96420:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(30809),l=a(61744),i=a(93396);const r=(0,n.Su)(((e,t)=>({error:!1,dataLoaded:!1,pluginData:[],updatePluginData:(a,n)=>{let l=t().pluginData;l.forEach((function(e,t){e.slug===a&&(l[t]=n)})),e((e=>({dataLoaded:!0,pluginData:l})))},getPluginData:e=>t().pluginData.filter((t=>t.slug===e))[0],fetchOtherPluginsData:async()=>{const{pluginData:t,error:a}=await l.doAction("otherpluginsdata").then((e=>{let t=[];t=e.plugins;let a=e.error;return a||t.forEach((function(e,a){t[a].pluginActionNice=o(e.pluginAction)})),{pluginData:t,error:a}}));e((e=>({dataLoaded:!0,pluginData:t,error:a})))},pluginActions:(e,a,n)=>{n&&n.preventDefault();let i={};i.slug=e,i.pluginAction=a;let r=t().getPluginData(e);"download"===a?r.pluginAction="downloading":"activate"===a&&(r.pluginAction="activating"),r.pluginActionNice=o(r.pluginAction),t().updatePluginData(e,r),"installed"!==a&&"upgrade-to-premium"!==a&&l.doAction("plugin_actions",i).then((a=>{r=a,t().updatePluginData(e,r),t().pluginActions(e,r.pluginAction)}))}}))),o=e=>({download:(0,i.__)("Install","complianz-gdpr"),activate:(0,i.__)("Activate","complianz-gdpr"),activating:(0,i.__)("Activating...","complianz-gdpr"),downloading:(0,i.__)("Downloading...","complianz-gdpr"),"upgrade-to-premium":(0,i.__)("Downloading...","complianz-gdpr")}[e])}}]);