"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[9713],{89713:(e,i,t)=>{t.r(i),t.d(i,{default:()=>n});var l=t(86087),s=t(70470),r=(t(43158),t(51289),t(20047),t(27723)),a=t(45111),o=t(10790);const n=(0,l.memo)((e=>{let i=e.mode?e.mode:"css",t=e.height?e.height:"200px",n=e.field&&e.field.default?e.field.default:e.placeholder;const[c,d]=(0,l.useState)(e.value),[p,u]=(0,l.useState)(!1);(0,l.useEffect)((()=>{if(c===e.value)return;const i=setTimeout((()=>{e.onChange(c)}),500);return()=>{clearTimeout(i)}}),[c]);let h=e.disabled?"cmplz-editor-disabled":"";return(0,o.jsxs)("div",{className:h,children:[p&&(0,o.jsxs)("div",{className:"cmplz-error-text",children:[(0,o.jsx)(a.default,{name:"error",size:13,color:"red"}),(0,o.jsx)("p",{children:(0,r.__)("Write your JavaScript without wrapping it in script tags.","complianz-gdpr")})]}),(0,o.jsx)(s.Ay,{readOnly:e.disabled,placeholder:"//"+n,mode:i,theme:"monokai",width:"100%",height:t,onChange:e=>(e=>{(e.includes("<script>")||e.includes("<\/script>"))&&u(!0),e=(e=e.replace(/<script>/gi,"")).replace(/<\/script>/gi,""),d(e)})(e),fontSize:12,showPrintMargin:!0,showGutter:!0,highlightActiveLine:!0,value:c,setOptions:{enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,enableSnippets:!1,showLineNumbers:!0,tabSize:2,useWorker:!1}})]})}))}}]);