var M=Object.defineProperty;var g=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var j=(o,t,e)=>t in o?M(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,S=(o,t)=>{for(var e in t||(t={}))y.call(t,e)&&j(o,e,t[e]);if(g)for(var e of g(t))C.call(t,e)&&j(o,e,t[e]);return o};import{D as k,g as A,r,j as s,M as _,_ as c,S as z}from"./main-634.js";import{s as E}from"./bf-60-199.js";import{I as D}from"./bf-942-184.js";import{G as T,h as w}from"./bf-403-116.js";import{G as $}from"./bf-328-200.js";import"./bf-275-83.js";import"./bf-746-82.js";import"./bf-822-108.js";import"./bf-25-81.js";import"./bf-438-114.js";import"./bf-913-201.js";function W({formFields:o,setIntegration:t,integrations:e,allIntegURL:m}){const u=k(),{id:f,formID:p}=A(),[b,d]=r.useState(!1),[I,N]=r.useState(1),[a,i]=r.useState(S({},e[f])),[x,l]=r.useState(!1),[v,n]=r.useState({show:!1}),G=()=>{setTimeout(()=>{u(`${m}/new/${a.type}`)},1e3),d(!1)};return s.jsxs("div",{style:{width:900},children:[s.jsx(_,{title:c("Authorize New Google App"),show:b,setModal:()=>d(!1),children:s.jsx(T,{formID:p,sheetConf:a,setSheetConf:i,step:I,setstep:N,setSnackbar:n,isLoading:x,setisLoading:l,allIntegURL:m,authorizedAction:G})}),s.jsx(z,{snack:v,setSnackbar:n}),s.jsxs("div",{className:"flx mt-3",children:[s.jsx("b",{className:"wdt-150 d-in-b",children:c("Integration Name:")}),s.jsx("input",{className:"btcd-paper-inp w-6",onChange:h=>w(h,a,i),name:"name",value:a.name,type:"text",placeholder:c("Integration Name...")})]}),s.jsx("br",{}),s.jsx("br",{}),s.jsx($,{formID:p,formFields:o,handleInput:h=>w(h,a,i,p,l,n),sheetConf:a,setSheetConf:i,isLoading:x,setisLoading:l,setSnackbar:n,setShowMdl:d}),s.jsx(D,{edit:!0,saveConfig:()=>E(e,t,m,a,u,f,1),disabled:a.spreadsheetId===""||a.worksheetName===""||a.field_map.length<1}),s.jsx("br",{})]})}export{W as default};
