import{r as n,j as s}from"./main-406.js";import{B as N}from"./bi.46.744.js";import{_ as i,L as k,b as L,A as y}from"./bi.394.85.js";import{T as d,t as v}from"./bi.150.760.js";function W({formID:z,wcConf:l,setWcConf:h,step:c,setStep:m,setSnackbar:b}){const[a,p]=n.useState(!1),[r,o]=n.useState(!1),[g,x]=n.useState(!1),{wooCommerce:t}=v,f=()=>{o("auth"),L({},"wc_authorize").then(e=>{e!=null&&e.success&&(p(!0),b({show:!0,msg:i("Connected with WooCommerce Successfully","bit-integrations")})),o(!1),x(!0)})},j=e=>{const u=y(l);u[e.target.name]=e.target.value,h(u)};return s.jsxs("div",{className:"btcd-stp-page",style:{width:c===1&&900,height:c===1&&"auto"},children:[(t==null?void 0:t.youTubeLink)&&s.jsx(d,{title:t==null?void 0:t.title,youTubeLink:t==null?void 0:t.youTubeLink}),(t==null?void 0:t.docLink)&&s.jsx(d,{title:t==null?void 0:t.title,docLink:t==null?void 0:t.docLink}),s.jsx("div",{className:"mt-3",children:s.jsx("b",{children:i("Integration Name:","bit-integrations")})}),s.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:j,name:"name",value:l.name,type:"text",placeholder:i("Integration Name...","bit-integrations")}),r==="auth"&&s.jsxs("div",{className:"flx mt-5",children:[s.jsx(k,{size:25,clr:"#022217",className:"mr-2"}),"Checking if WooCommerce is active!!!"]}),g&&!a&&!r&&s.jsxs("div",{className:"flx mt-5",style:{color:"red"},children:[s.jsx("span",{className:"btcd-icn mr-2",style:{fontSize:30,marginTop:-5},children:"×"}),"WooCommerce plugin must be activated to integrate with Bit Integrations."]}),!a&&s.jsx("button",{onClick:f,className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",children:i("Connect","bit-integrations")}),a&&s.jsxs("button",{onClick:()=>m(2),className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",disabled:!a,children:[i("Next","bit-integrations"),s.jsx(N,{className:"ml-1 rev-icn"})]})]})}export{W as default};
