var C=Object.defineProperty;var f=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var u=(o,t,i)=>t in o?C(o,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[t]=i,r=(o,t)=>{for(var i in t||(t={}))k.call(t,i)&&u(o,i,t[i]);if(f)for(var i of f(t))_.call(t,i)&&u(o,i,t[i]);return o};import{h as p,g as y,$ as E,k as F,i as V,j as e,_ as x}from"./main.2.9.0.js";import{u as L,e as N,b as n}from"./react-router.DMwpH23k.js";import{S as $}from"./SnackMsg.DYSD96P4.js";import{y as I}from"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as R,s as T}from"./Integrations.DL8wqGct.js";import{c as A,C as z}from"./CustomFunctionHelper.CtoiCI7A.js";import D from"./CustomFuncEditor.DzEqv_Ss.js";import{T as K}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";function tt({allIntegURL:o}){const t=L(),{formID:i}=N(),[s,c]=p(y),[m,b]=p(E),j=F(V),[a,v]=n.useState({}),[h,S]=n.useState(!1),[g,l]=n.useState({show:!1}),[w,M]=n.useState(1);return n.useEffect(()=>{const d=r({},s);delete d.isValid,c(r({},d))},[s==null?void 0:s.value]),e.jsxs("div",{children:[e.jsx($,{snack:g,setSnackbar:l}),e.jsx(R,{entity:m.triggered_entity,setSnackbar:l}),e.jsx("div",{className:"mt-3",children:e.jsxs("div",{className:"btcd-stp-page",style:r({},w===1&&{width:"91%",height:"auto",overflow:"visible"}),children:[e.jsx(K,{linkKey:"customAction"}),e.jsx("h1",{children:"custom action"}),e.jsx(D,{customActionConf:s,setCustomActionConf:c,formFields:j}),e.jsxs("button",{onClick:()=>A(s,c,a,v),disabled:!s.value||(a==null?void 0:a.validate),className:"btn f-left btcd-btn-lg purple sh-sm flx mt-5",type:"button",children:[s!=null&&s.isValid&&!(a!=null&&a.validate)?x("Validated ✔","bit-integrations"):x("Validated","bit-integrations"),(a==null?void 0:a.validate)&&e.jsx(I,{size:"20",clr:"#022217",className:"ml-2"})]})]})}),e.jsx(z,{edit:!0,saveConfig:()=>T({flow:m,setFlow:b,allIntegURL:o,conf:s,navigate:t,edit:1,setIsLoading:S,setSnackbar:l}),isLoading:h,disabled:!s.isValid}),e.jsx("br",{})]})}export{tt as default};
