var S=Object.defineProperty;var f=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var g=(i,e,t)=>e in i?S(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,b=(i,e)=>{for(var t in e||(e={}))w.call(e,t)&&g(i,t,e[t]);if(f)for(var t of f(e))y.call(e,t)&&g(i,t,e[t]);return i};import{_ as r,j as a}from"./main.2.9.0.js";import{u as N,e as _,b as n}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{S as F}from"./SnackMsg.DYSD96P4.js";import{S as C}from"./Steps.BYe8zHkm.js";import{I as D,s as E}from"./Integrations.DL8wqGct.js";import q from"./TrelloAuthorization.EFQsJDvS.js";import{g as L,s as M,h as P,d as x}from"./TrelloCommonFunc.D9g9N5Od.js";import{T as A}from"./TrelloIntegLayout.cVzjfZmF.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./BackIcn._8Wofmn2.js";import"./TutorialLink.CFG7bS5c.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function se({formFields:i,setFlow:e,flow:t,allIntegURL:h}){const j=N(),{formID:v}=_(),[d,l]=n.useState(!1),[m,p]=n.useState(1),[I,o]=n.useState({show:!1}),u=[{key:"name",label:r("Name","bit-integrations"),required:!0},{key:"desc",label:r("Description","bit-integrations"),required:!1},{key:"due",label:r("Date","bit-integrations"),required:!1}],[s,c]=n.useState({name:"Trello",type:"Trello",clientId:"",listId:"",listName:"",tags:"",pos:"",field_map:L(u),custom_field_map:[{formField:"",trelloFormField:""}],cardFields:u,customFields:[],actions:{}});n.useEffect(()=>{window.opener&&M("trello")},[]);const T=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!x(s)){o({show:!0,msg:r("Please map fields to continue.","bit-integrations")});return}s.listId!==""&&p(3)};return a.jsxs("div",{children:[a.jsx(F,{snack:I,setSnackbar:o}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(C,{step:3,active:m})}),a.jsx(q,{formID:v,trelloConf:s,setTrelloConf:c,step:m,setstep:p,isLoading:d,setIsLoading:l,setSnackbar:o}),a.jsxs("div",{className:"btcd-stp-page",style:b({},m===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(A,{formFields:i,handleInput:k=>P(k,s,c,l,o),trelloConf:s,setTrelloConf:c,isLoading:d,setIsLoading:l,setSnackbar:o}),a.jsxs("button",{onClick:()=>T(),disabled:!(s!=null&&s.listId)||!x(s),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[r("Next","bit-integrations"),"  ",a.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),a.jsx(D,{step:m,saveConfig:()=>E({flow:t,setFlow:e,allIntegURL:h,navigate:j,conf:s,setIsLoading:l,setSnackbar:o}),isLoading:d,dataConf:s,setDataConf:c,formFields:i})]})}export{se as default};
