import{r as d,j as n}from"./main-406.js";import{V as b,_ as v,B as N}from"./bi.394.85.js";const P=({customActionConf:e,setCustomActionConf:m,formFields:g,isInfo:u})=>{const a=d.useRef(null);d.useEffect(()=>()=>{a.current=null},[]);const o=l=>{m(t=>N(t,s=>{s.value=l,s.isValid=!1})),a.current&&x(),a.current=""};function c(l){return g.map(t=>({label:t.label,kind:monaco.languages.CompletionItemKind.Function,insertText:`'${t.name}'`,range:l}))}const h=(l,t)=>{a.current=t},x=(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),p={startLineNumber:r.lineNumber,endLineNumber:r.lineNumber,startColumn:i.startColumn,endColumn:i.endColumn};return{suggestions:c(p)}}})};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:v("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(b,{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:o,onMount:h})})};export{P as default};
