var T=Object.defineProperty;var y=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var N=(a,e,i)=>e in a?T(a,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[e]=i,p=(a,e)=>{for(var i in e||(e={}))C.call(e,i)&&N(a,i,e[i]);if(y)for(var i of y(e))E.call(e,i)&&N(a,i,e[i]);return a};import{k as R,g as _,j as t,_ as n}from"./main.2.8.1.js";import{d as v}from"./react-router-dom.9mCuUg3q.js";import{B as f}from"./BackIcn._kGL_vVw.js";import{a2 as w,z as B}from"./Note.BeM7sN-p.js";import{t as $}from"./SalesforceCommonFunc.NwtI-ly9.js";import{t as D}from"./tutorialLinks.kMkIDzcD.js";import{T as k}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function M({formID:a,salesforceConf:e,setSalesforceConf:i,step:b,setStep:z,isLoading:x,setIsLoading:S,setSnackbar:l,redirectLocation:A,isInfo:s}){const u=R(_),[c,I]=v.useState(!1),[d,h]=v.useState({dataCenter:"",clientId:"",clientSecret:""}),{salesforce:r}=D,L=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),z(2)},o=m=>{const g=p({},e),j=p({},d);j[m.target.name]="",g[m.target.name]=m.target.value,h(j),i(g)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:b===1&&900,height:b===1&&"auto"},children:[t.jsx(k,{title:"Salesforce",youTubeLink:r==null?void 0:r.youTubeLink}),t.jsx(k,{title:"Salesforce",docLink:r==null?void 0:r.docLink}),t.jsx("div",{className:"wdt-200 d-in-b mt-3",children:t.jsx("b",{children:n("Integration Name:","bit-integrations")})}),t.jsx("br",{}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"name",value:e.name,type:"text",placeholder:n("Integration Name...","bit-integrations"),disabled:s}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("Homepage URL:","bit-integrations")})}),t.jsx(w,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",setSnackbar:l,readOnly:s}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("Authorized Redirect URIs:","bit-integrations")})}),t.jsx(w,{value:A||`${u.api}/redirect`,className:"field-key-cpy w-6 ml-0",setSnackbar:l,readOnly:s}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("Client id:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"clientId",value:e.clientId,type:"text",placeholder:n("client ID...","bit-integrations"),disabled:s}),t.jsx("div",{style:{color:"red"},children:d.clientId}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("Client secret:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"clientSecret",value:e.clientSecret,type:"text",placeholder:n("client Secret...","bit-integrations"),disabled:s}),t.jsx("div",{style:{color:"red"},children:d.clientSecret}),!s&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>$(e,i,h,I,S,l,u),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:c||x,children:[c?n("Authorized ✔","bit-integrations"):n("Authorize","bit-integrations"),x&&t.jsx(B,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:L,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!c,children:[n("Next","bit-integrations"),t.jsx(f,{className:"ml-1 rev-icn"})]})]})]})}export{M as default};
