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