import{b as l,$ as h,h as b,k as w,i as j,j as e,_ as r}from"./main.2.8.1.js";import{u as I,h as _,d as c}from"./react-router-dom.9mCuUg3q.js";import{S as y}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as C,I as S,s as v}from"./Integrations.D2bgBas2.js";import{h as f}from"./TwilioCommonFunc.CoCgKkwH.js";import{T as F}from"./TwilioIntegLayout.BCTz75Xn.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";function M({allIntegURL:p}){const g=I(),{id:N}=_(),[o,T]=l(h),[t,i]=l(b),[a,d]=c.useState(!1),[u,s]=c.useState({show:!1}),m=w(j),x=()=>{if(t.to===""&&t.body===""){s({show:!0,msg:r("Please select To and Body field , it is required","bit-integrations")});return}v({flow:o,allIntegURL:p,conf:t,navigate:g,edit:1,setIsLoading:d,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(y,{snack:u,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:r("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:n=>f(n,t,i),name:"name",value:t.name,type:"text",placeholder:r("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(C,{entity:o.triggered_entity,setSnackbar:s}),e.jsx(F,{formID:o.triggered_entity_id,formFields:m,handleInput:n=>f(n,t,i),twilioConf:t,setTwilioConf:i,isLoading:a,setIsLoading:d,setSnackbar:s}),e.jsx(S,{edit:!0,saveConfig:x,disabled:a||t.to===""&&t.body==="",isLoading:a,dataConf:t,setDataConf:i,formFields:m}),e.jsx("br",{})]})}export{M as default};
