var S=Object.defineProperty;var f=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var g=(i,t,e)=>t in i?S(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,b=(i,t)=>{for(var e in t||(t={}))w.call(t,e)&&g(i,e,t[e]);if(f)for(var e of f(t))y.call(t,e)&&g(i,e,t[e]);return i};import{_ as r,j as a}from"./main.2.8.1.js";import{u as N,h as _,d as n}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{S as F}from"./SnackMsg.S8DrwLlT.js";import{S as C}from"./Steps.1hz7v9Vj.js";import{I as D,s as E}from"./Integrations.D2bgBas2.js";import q from"./TrelloAuthorization.BFJkS20v.js";import{g as L,s as M,h as P,d as h}from"./TrelloCommonFunc.B7Mpg8Qx.js";import{T as A}from"./TrelloIntegLayout.DxIcAabm.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./BackIcn._kGL_vVw.js";import"./tutorialLinks.kMkIDzcD.js";import"./TutorialLink.BAFX--T3.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function st({formFields:i,setFlow:t,flow:e,allIntegURL:x}){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),!h(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)||!h(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:e,setFlow:t,allIntegURL:x,navigate:j,conf:s,setIsLoading:l,setSnackbar:o}),isLoading:d,dataConf:s,setDataConf:c,formFields:i})]})}export{st as default};
