var S=Object.defineProperty;var m=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var h=(i,s,e)=>s in i?S(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e,u=(i,s)=>{for(var e in s||(s={}))w.call(s,e)&&h(i,e,s[e]);if(m)for(var e of m(s))y.call(s,e)&&h(i,e,s[e]);return i};import{j as t,_ as a,b as z}from"./main.2.8.10.js";import{b as x}from"./react-router.DMwpH23k.js";import{B as F}from"./BackIcn.BFDZx8No.js";import{y as b}from"./Note.DalStCGz.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function H({secureCustomFieldsConf:i,setSecureCustomFieldsConf:s,step:e,nextPage:p,isLoading:c,setIsLoading:l,setSnackbar:j,isInfo:f=!1}){const[r,g]=x.useState(!1),[o,N]=x.useState(!1),v=()=>{l("auth"),z({},"secure_custom_fields_authorize").then(n=>{n!=null&&n.success&&(g(!0),j({show:!0,msg:a("Connected with Secure Custom Fields Successfully","bit-integrations")})),l(!1),N(!0)})},C=n=>{const d=u({},i);d[n.target.name]=n.target.value,s(d)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:e===1&&900,height:e===1&&"auto"},children:[t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:C,name:"name",value:i.name,type:"text",placeholder:a("Integration Name...","bit-integrations")}),c==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(b,{size:25,clr:"#022217",className:"mr-2"}),a("Checking if Secure Custom Fields is authorized!!!","bit-integrations")]}),o&&!r&&!c&&t.jsx("div",{className:"flx mt-5",style:{width:900,justifyContent:"center"},children:t.jsxs("div",{className:"txt-center",children:[t.jsx("div",{className:"btcd-icn btcd-icn-err",children:t.jsx("span",{children:"✕"})}),t.jsx("div",{className:"mt-2",children:a("Secure Custom Fields is not activated or not installed","bit-integrations")})]})}),o&&r&&!c&&t.jsxs("div",{className:"flx mt-5",style:{width:900},children:[t.jsx("div",{className:"btcd-icn btcd-icn-success",children:t.jsx("span",{children:"✓"})}),t.jsx("div",{className:"mt-2",children:a("Secure Custom Fields is activated","bit-integrations")})]}),!f&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:v,className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||c==="auth",children:[r?a("Connected","bit-integrations"):a("Connect to Secure Custom Fields","bit-integrations"),c==="auth"&&t.jsx(b,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>p(2),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!r,children:[a("Next","bit-integrations"),t.jsx(F,{className:"ml-1 rev-icn"})]})]})]})}export{H as default};
