PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / V_3.0.0
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder vV_3.0.0
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
bit-form / assets / bf-975-421.js

bf-975-421.js in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder V_3.0.0, at assets/bf-975-421.js

10 lines 5.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var _=Object.defineProperty;var S=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var I=(t,s,a)=>s in t?_(t,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[s]=a,g=(t,s)=>{for(var a in s||(s={}))q.call(s,a)&&I(t,a,s[a]);if(S)for(var a of S(s))w.call(s,a)&&I(t,a,s[a]);return t};import{r as c,j as e,_ as n,L as P,c as z,F,a as H,S as T,U as L,h as B,V as E}from"./main-294.js";import{B as K}from"./bf-176-80.js";import{S as M}from"./bf-619-257.js";import{a6 as V,a7 as C}from"./bf-813-81.js";import{I as D}from"./bf-906-183.js";import{N as R}from"./bf-897-179.js";import{N as G}from"./bf-744-108.js";import{H as J,h as U,c as W}from"./bf-565-204.js";import"./bf-582-82.js";import"./bf-158-107.js";import"./bf-867-113.js";function Z({hubspotConf:t,setHubspotConf:s,step:a,setstep:j,isInfo:p}){const[d,x]=c.useState(!1),[r,u]=c.useState({name:"",api_key:""}),[v,h]=c.useState(!1),[y,k]=c.useState(!1),N=()=>{const l=g({},t);if(!l.name||!l.api_key){u({name:l.name?"":n("Integration name cann't be empty"),api_key:l.api_key?"":n("API Key cann't be empty")});return}k("auth");const m={api_key:l.api_key};z(m,"bitforms_hubspot_authorize").then(o=>{const{data:A}=o;A&&x(!0),h(!0),k(!1)})},f=l=>{const m=g({},t),o=g({},r);o[l.target.name]="",m[l.target.name]=l.target.value,u(o),s(m)},i=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),j(2)},b=`
2 <h4> Step of generating Access Token:</h4>
3 <ul>
4 <li>Login to your HubSpot account, click the <b>Settings</b> icon settings in the main navigation bar..</li>
5 <li>In the left sidebar menu, navigate to <b>Integrations > Private App</b>.</li>
6 <li>Give name and description and select all necessary scope.</li>
7 <li>Then create Access token.</li>
8 </ul>
9 `;return e.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:n("Integration Name:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:f,name:"name",value:t==null?void 0:t.name,type:"text",placeholder:n("Integration Name..."),disabled:p}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:r.name}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:n("API Key:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:f,name:"api_key",value:t==null?void 0:t.api_key,type:"text",placeholder:n("API Key..."),disabled:p}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:r.api_key}),e.jsxs("small",{className:"d-blk mt-5",children:[n("To get API , Please Visit")," ",e.jsx("a",{className:"btcd-link",href:"https://app.hubspot.com/api-key",target:"_blank",rel:"noreferrer",children:n("Hubspot API Console")})]}),y==="auth"&&e.jsxs("div",{className:"flx mt-5",children:[e.jsx(P,{size:25,clr:"#022217",className:"mr-2"}),"Checking API Key!!!"]}),v&&!d&&!y&&e.jsxs("div",{className:"flx mt-5",style:{color:"red"},children:[e.jsx("span",{className:"btcd-icn mr-2",style:{fontSize:30,marginTop:-5},children:"×"}),"Sorry, API key is invalid"]}),!p&&e.jsxs(e.Fragment,{children:[e.jsx(V,{handleAuthorize:N,isAuthorized:d,isLoading:y}),e.jsx("br",{}),e.jsx(G,{nextPageHandler:()=>i(),disabled:!d})]}),e.jsx(R,{note:b})]})}function re({formFields:t,setIntegration:s,integrations:a,allIntegURL:j}){const p=F(),[d,x]=c.useState(!1),[r,u]=c.useState(1),[v,h]=c.useState({show:!1}),{css:y}=H(),k=[{key:"email",label:"Email",required:!0},{key:"firstname",label:"First Name",required:!1},{key:"lastname",label:"Last Name",required:!1},{key:"website",label:"Website",required:!1},{key:"company",label:"Company",required:!1},{key:"phone",label:"Phone",required:!1},{key:"address",label:"Address",required:!1},{key:"city",label:"City",required:!1},{key:"state",label:"State",required:!1},{key:"zip",label:"Zip",required:!1},{key:"jobtitle",label:"Job Title",required:!1}],N=[{key:"dealname",label:"Deal Name",required:!0},{key:"amount",label:"Amount",required:!1},{key:"closedate",label:"Close Date",required:!1}],f=[{key:"subject",label:"Ticket Name",required:!0},{key:"content",label:"Ticket description",required:!1}],[i,b]=c.useState({name:"Hubspot",type:"Hubspot",api_key:"",field_map:[{formField:"",hubspotField:""}],actions:{},contactFields:k,dealFields:N,ticketFields:f}),l=()=>{C(a,s,j,i,p)},m=o=>{if(!W(i)){E.error("Please map mandatory fields");return}i.field_map.length>0&&u(o)};return e.jsxs("div",{children:[e.jsx(T,{snack:v,setSnackbar:h}),e.jsx("div",{className:"txt-center w-9 mt-2 cal-width",children:e.jsx(M,{step:3,active:r})}),e.jsx(Z,{hubspotConf:i,setHubspotConf:b,step:r,setstep:u,isLoading:d,setIsLoading:x,setSnackbar:h}),e.jsxs("div",{className:"btcd-stp-page",style:g({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:[e.jsx(J,{formFields:t,handleInput:o=>U(o,i,b),hubspotConf:i,setHubspotConf:b,isLoading:d,setIsLoading:x,setSnackbar:h}),e.jsxs(L,{variant:"success",onClick:()=>m(3),disabled:!(i!=null&&i.actionName),className:y(B.ftRight),children:[n("Next"),e.jsx(K,{className:"ml-1 rev-icn"})]})]}),e.jsx(D,{step:r,saveConfig:()=>l()})]})}export{re as default};
10