var w=Object.defineProperty;var N=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var y=(s,i,a)=>i in s?w(s,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[i]=a,m=(s,i)=>{for(var a in i||(i={}))z.call(i,a)&&y(s,a,i[a]);if(N)for(var a of N(i))E.call(i,a)&&y(s,a,i[a]);return s};import{r as v,j as t}from"./main-406.js";import{_ as n,L as D,N as F}from"./bi.394.85.js";import{d as I,g as P}from"./bi.342.781.js";import{T as A,t as S}from"./bi.150.760.js";function G({formID:s,freshdeskConf:i,setFreshdeskConf:a,step:d,setstep:_,isLoading:b,setIsLoading:u,setSnackbar:x,redirectLocation:B,isInfo:l}){const[o,T]=v.useState(!1),[r,g]=v.useState({api_key:""}),{freshdesk:e}=S,L=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),P(i,a,u,x),_(2)},c=p=>{const h=m({},i),j=m({},r);j[p.target.name]="",h[p.target.name]=p.target.value,g(j),a(h)},k=`
            <h4>App Domain Exmple</h4>
            <ul>
                <li>https://domain-help.freshdesk.com/</li>
            </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:d===1&&900,height:d===1&&"auto"},children:[(e==null?void 0:e.youTubeLink)&&t.jsx(A,{title:e==null?void 0:e.title,youTubeLink:e==null?void 0:e.youTubeLink}),(e==null?void 0:e.docLink)&&t.jsx(A,{title:e==null?void 0:e.title,docLink:e==null?void 0:e.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("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:n("Integration Name...","bit-integrations"),disabled:l}),t.jsxs("small",{className:"d-blk mt-5",children:[n("To get access Token , Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://bitcode-help.freshdesk.com/a/profiles/72009210017/edit",target:"_blank",rel:"noreferrer",children:n("FreshDesk Console","bit-integrations")})]}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("Your App Domain:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"app_domain",value:i.app_domain,type:"text",placeholder:n("App Domain...","bit-integrations"),disabled:l}),t.jsx("div",{style:{color:"red"},children:r.app_domain}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("App api key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"api_key",value:i.api_key,type:"text",placeholder:n("Access Token...","bit-integrations"),disabled:l}),t.jsx("div",{style:{color:"red"},children:r.api_key}),!l&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>I(i,a,g,T,u,x),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||b,children:[o?n("Authorized ✔","bit-integrations"):n("Authorize","bit-integrations"),b&&t.jsx(D,{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:!o,children:[n("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(F,{note:k})]})}export{G as default};
