import{b as m,$ as k,h as b,k as D,i as S,j as t,_ as s,z as a}from"./main.2.8.1.js";import{u as I,d as l}from"./react-router-dom.9mCuUg3q.js";import{S as j}from"./SnackMsg.S8DrwLlT.js";import{S as R,I as y,s as C}from"./Integrations.D2bgBas2.js";import{D as N}from"./DokanIntegLayout.BVuFODNV.js";import{h as f,T as n,c as p}from"./dokanCommonFunctions.EK-osF5S.js";import"./Note.BeM7sN-p.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function Q({allIntegURL:g}){const u=I(),[r,v]=m(k),[e,o]=m(b),[E,w]=l.useState(!1),[x,T]=l.useState({auth:!1,euFields:!1,vendors:!1}),[_,i]=l.useState({show:!1}),c=D(S),h=()=>{if(!e.selectedTask){a.error(s("Please select a task!","bit-integrations"));return}if((e.selectedTask===n.UPDATE_VENDOR||e.selectedTask===n.WITHDRAW_REQUEST)&&!e.selectedVendor){a.error(s("Please select a vendor!","bit-integrations"));return}if(e.selectedTask!==n.DELETE_VENDOR&&!p(e)){a.error(s("Please map mandatory fields!","bit-integrations"));return}if(e.selectedTask===n.DELETE_VENDOR&&!e.selectedVendor&&!p(e)){a.error(s("Please select a topic or map fields!","bit-integrations"));return}if(e.selectedTask===n.WITHDRAW_REQUEST&&!e.selectedPaymentMethod){a.error(s("Please select a payment method!","bit-integrations"));return}C({flow:r,allIntegURL:g,conf:e,navigate:u,edit:1,setSnackbar:i})};return t.jsxs("div",{style:{width:900},children:[t.jsx(j,{snack:_,setSnackbar:i}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:s("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:d=>f(d,e,o),name:"name",defaultValue:e.name||"",type:"text",placeholder:s("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(R,{entity:r.triggered_entity,setSnackbar:i}),t.jsx(N,{formID:r.triggered_entity_id,formFields:c,handleInput:d=>f(d,e,o),dokanConf:e,setDokanConf:o,loading:x,setLoading:T,setSnackbar:i}),t.jsx(y,{edit:!0,saveConfig:h,isLoading:E,dataConf:e,setDataConf:o,formFields:c}),t.jsx("br",{})]})}export{Q as default};
