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