"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[20],{50020:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var n=a(51280),l=a(88496),r=a(42992),u=a(43960),o=a.n(u),i=a(93396),s=a(25536);const c=(0,l.memo)((({id:e,value:t,onChange:a})=>{const[u,c]=(0,l.useState)(t),[d,m]=(0,l.useState)("wysiwyg"),[g,b]=(0,l.useState)(t),{getFieldValue:h,updateField:w,setChangedField:f}=(0,s.default)();return(0,l.useEffect)((()=>{if(g===t)return;const e=setTimeout((()=>{c(g)}),500);return()=>{clearTimeout(e)}}),[g]),(0,l.useEffect)((()=>{if(u===t)return;const n=setTimeout((()=>{w(e,u),b(u),f(e,u),a(u)}),500);return()=>{clearTimeout(n)}}),[u]),(0,l.useEffect)((()=>{c(t)}),[h(e)]),(0,n.createElement)(n.Fragment,null,(0,n.createElement)("button",{className:"button button-default",onClick:e=>{m("wysiwyg"===d?"html":"wysiwyg")}},"wysiwyg"===d&&"HTML","html"===d&&(0,i.__)("Editor","complianz-gdpr")),"html"===d&&(0,n.createElement)(n.Fragment,null,(0,n.createElement)("textarea",{rows:"8",onChange:e=>{return t=e.target.value,b(t),void c(t);var t},value:g})),"wysiwyg"===d&&(0,n.createElement)(n.Fragment,null,(0,n.createElement)(r.CKEditor,{editor:o(),config:{toolbar:["undo","redo","heading","|","bold","italic","link","bulletedList","numberedList","blockQuote","insertTable"]},data:u,onChange:(e,t)=>{const a=t.getData();c(a)}})))}))}}]);