import{j as n,_ as b}from"./main.2.8.1.js";import{d as m}from"./react-router-dom.9mCuUg3q.js";import{u as v}from"./Note.BeM7sN-p.js";import{F as N}from"./Integrations.D2bgBas2.js";import"./CopyIcn.3gZpHton.js";import"./SnackMsg.S8DrwLlT.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";const V=({customActionConf:e,setCustomActionConf:d,formFields:o,isInfo:u})=>{const a=m.useRef(null);m.useEffect(()=>()=>{a.current=null},[]);const g=l=>{d(t=>v(t,s=>{s.value=l,s.isValid=!1})),a.current&&h(),a.current=""};function c(l){return o.map(t=>({label:t.label,kind:monaco.languages.CompletionItemKind.Function,insertText:`'${t.name}'`,range:l}))}const p=(l,t)=>{a.current=t},h=(l,t)=>{a.current.languages.registerCompletionItemProvider("php",{provideCompletionItems:function(s,r){if(!s.getValueInRange({startLineNumber:r.lineNumber,startColumn:r.column-10,endLineNumber:r.lineNumber,endColumn:r.column}).match(/\$trigger\[?/))return{suggestions:[]};const i=s.getWordUntilPosition(r),x={startLineNumber:r.lineNumber,endLineNumber:r.lineNumber,startColumn:i.startColumn,endColumn:i.endColumn};return{suggestions:c(x)}}})};return n.jsx("div",{className:"flx ",children:u?n.jsxs("div",{children:[n.jsx("div",{className:"mt-3",style:{width:"1500px"},children:n.jsx("b",{children:b("Custom Action:","bit-integrations")})}),n.jsx("textarea",{className:"btcd-paper-inp w-6 mt-1",style:{resize:"none"},rows:"20",value:e.value,type:"text",disabled:u})]}):n.jsx(N,{width:"100%",className:"monaco-editor",height:"50vh",theme:"vs-dark",defaultLanguage:"php",defaultValue:e==null?void 0:e.defaultValue,value:e==null?void 0:e.value,onChange:g,onMount:p})})};export{V as default};
