"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[2111,2010],{52010:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var l=a(86087),n=a(45111);const r=e=>{const[t,a]=(0,l.useState)(!1);return(0,l.createElement)("div",{className:"cmplz-panel__list__item",style:e.style?e.style:{}},(0,l.createElement)("details",{open:t},(0,l.createElement)("summary",{onClick:e=>(e=>{e.preventDefault(),a(!t)})(e)},e.icon&&(0,l.createElement)(n.default,{name:e.icon}),(0,l.createElement)("h5",{className:"cmplz-panel__list__item__title"},e.summary),(0,l.createElement)("div",{className:"cmplz-panel__list__item__comment"},e.comment),(0,l.createElement)("div",{className:"cmplz-panel__list__item__icons"},e.icons),(0,l.createElement)(n.default,{name:"chevron-down",size:18})),(0,l.createElement)("div",{className:"cmplz-panel__list__item__details"},t&&e.details)))}},52111:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var l=a(86087),n=a(52010),r=a(4219),m=a(27723),c=a(52043);const i=(0,l.memo)((e=>{const{updateField:t,setChangedField:a}=(0,r.default)(),{selectedMainMenuItem:i}=(0,c.default)(),[s,u]=wp.element.useState(e.thirdParty.name?e.thirdParty.name:""),[d,o]=wp.element.useState(e.thirdParty.purpose?e.thirdParty.purpose:""),[p,_]=wp.element.useState(e.thirdParty.country?e.thirdParty.country:""),[E,y]=wp.element.useState(e.thirdParty.data?e.thirdParty.data:""),h=(l,n)=>{let r=[...e.field.value];Array.isArray(r)||(r=[]);let m={...r[e.index]};m[n]=l,r[e.index]=m,t(e.field.id,r),a(e.field.id,r)};return(0,l.useEffect)((()=>{const e=setTimeout((()=>{h(s,"name")}),500);return()=>{clearTimeout(e)}}),[s]),(0,l.useEffect)((()=>{const e=setTimeout((()=>{h(E,"data")}),500);return()=>{clearTimeout(e)}}),[E]),(0,l.useEffect)((()=>{const e=setTimeout((()=>{h(p,"country")}),500);return()=>{clearTimeout(e)}}),[p]),(0,l.useEffect)((()=>{const e=setTimeout((()=>{h(d,"purpose")}),500);return()=>{clearTimeout(e)}}),[d]),(0,l.createElement)(l.Fragment,null,(0,l.createElement)(n.default,{summary:s,details:(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{className:"cmplz-details-row"},(0,l.createElement)("label",null,(0,m.__)("Name","complianz-gdpr")),(0,l.createElement)("input",{onChange:e=>u(e.target.value),type:"text",placeholder:(0,m.__)("Name","complianz-gdpr"),value:s})),(0,l.createElement)("div",{className:"cmplz-details-row"},(0,l.createElement)("label",null,(0,m.__)("Country","complianz-gdpr")),(0,l.createElement)("input",{onChange:e=>_(e.target.value),type:"text",placeholder:(0,m.__)("Country","complianz-gdpr"),value:p})),(0,l.createElement)("div",{className:"cmplz-details-row"},(0,l.createElement)("label",null,(0,m.__)("Purpose","complianz-gdpr")),(0,l.createElement)("input",{onChange:e=>o(e.target.value),type:"text",placeholder:(0,m.__)("Purpose","complianz-gdpr"),value:d})),(0,l.createElement)("div",{className:"cmplz-details-row"},(0,l.createElement)("label",null,(0,m.__)("Data","complianz-gdpr")),(0,l.createElement)("input",{onChange:e=>y(e.target.value),type:"text",placeholder:(0,m.__)("Data","complianz-gdpr"),value:E})),(0,l.createElement)("div",{className:"cmplz-details-row__buttons"},(0,l.createElement)("button",{className:"button button-default cmplz-reset-button",onClick:l=>(async l=>{let n=e.field.value;Array.isArray(n)||(n=[]);let r=[...n];r.hasOwnProperty(e.index)&&r.splice(e.index,1),t(e.field.id,r),a(e.field.id,r),await saveFields(i,!1,!1)})()},(0,m.__)("Delete","complianz-gdpr"))))}))}))}}]);