PageSourceSearch

https://www.talentick.ai/assets/Register-72d6f005.js

js talentick.ai collected 2026-10-05 14:17:25 UTC 9,902 bytes, 215 lines download raw bytes

1import { b as useLoader, a as useToast, u as useNavigate, r as reactExports, j as jsxRuntimeExports, L as Link, i as instance } from './index-7eddb355.js';
2import { G as GoogleAuth } from './GoogleAuth-4f758340.js';
3import { A as AiOutlineEyeInvisible, a as AiOutlineEye } from './index-e135e8bb.js';
4import { T as Tooltip } from './Tooltip-5e03ff85.js';
5import { A as AuthPageLayout } from './AuthPageLayout-1b2de483.js';
6import { M as MetaData } from './MetaData-057c13f3.js';
7import './ort-bc46c4ad.js';
8import './mediapipe-a71dfc7c.js';
9import './iconBase-1222c717.js';
10import './talentickaiwhite-b41d859a.js';
11import './talentick.ai-58f78b88.js';
12import './auth-2417bf4e.js';
13import './Helmet-959560d8.js';
14import './index-54472d17.js';
15
16const Register = () => {
17  const { setLoading } = useLoader();
18  const toast = useToast();
19  const navigate = useNavigate();
20  const [email, setEmail] = reactExports.useState("");
21  const [password, setPassword] = reactExports.useState("");
22  const [firstName, setFirstName] = reactExports.useState("");
23  const [lastName, setLastName] = reactExports.useState("");
24  const [confirmPassword, setConfirmPassword] = reactExports.useState("");
25  const [showPassword, setShowPassword] = reactExports.useState(false);
26  const handleSubmit = async (event) => {
27    event.preventDefault();
28    if (password !== confirmPassword) {
29      toast.error({
30        title: "Error",
31        description: "Password and Confrim Password do not match. Please Try Again.",
32        duration: 5e3,
33        open: true,
34        status: "error"
35      });
36      return;
37    }
38    try {
39      setLoading(true);
40      const res = await instance.post("register_freetrail_guest", {
41        first_name: firstName,
42        last_name: lastName,
43        email,
44        password
45      });
46      if (res.status === 200) {
47        setLoading(false);
48        navigate("/login");
49        toast.success({
50          title: "Verify Email",
51          description: "An email has been sent for verification.",
52          duration: 5e3,
53          open: true,
54          status: "success"
55        });
56      }
57    } catch (err) {
58      setLoading(false);
59      console.log(err);
60      toast.error({
61        type: "background",
62        duration: 5e3,
63        status: "error",
64        title: "Registration Error",
65        description: err.response?.data?.error || err.response?.data?.message || "Failed to register. Please try again.",
66        open: true
67      });
68    }
69  };
70  return /* @__PURE__ */ jsxRuntimeExports.jsxs(AuthPageLayout, { children: [
71    /* @__PURE__ */ jsxRuntimeExports.jsx(MetaData, { title: "Register", canonicalUrl: "https://www.talentick.ai/#/register" }),
72    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full", children: [
73      /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-2xl md:text-3xl font-bold text-center text-zinc-800 mb-6", children: "Create an Account" }),
74      /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { className: "space-y-5", method: "POST", onSubmit: handleSubmit, children: [
75        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid md:grid-cols-2 gap-4", children: [
76          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
77            /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "mb-1 block text-sm font-medium text-zinc-700 dark:text-zinc-300", children: [
78              "First Name ",
79              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500", children: "*" })
80            ] }),
81            /* @__PURE__ */ jsxRuntimeExports.jsx(
82              "input",
83              {
84                onChange: (e) => setFirstName(e.target.value),
85                name: "first_name",
86                type: "text",
87                required: true,
88                placeholder: "First Name",
89                className: "w-full border border-gray-300 rounded-lg py-3 px-4 text-zinc-700 bg-transparent  "
90              }
91            )
92          ] }),
93          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
94            /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "mb-1 block text-sm font-medium text-zinc-700 dark:text-zinc-300", children: [
95              "Last Name ",
96              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500", children: "*" })
97            ] }),
98            /* @__PURE__ */ jsxRuntimeExports.jsx(
99              "input",
100              {
101                onChange: (e) => setLastName(e.target.value),
102                name: "last_name",
103                type: "text",
104                required: true,
105                placeholder: "Last Name",
106                className: "w-full border border-gray-300 rounded-lg py-3 px-4 text-zinc-700 bg-transparent  "
107              }
108            )
109          ] })
110        ] }),
111        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
112          /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "mb-1 block text-sm font-medium text-zinc-700 dark:text-zinc-300", children: [
113            "Email ",
114            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500", children: "*" })
115          ] }),
116          /* @__PURE__ */ jsxRuntimeExports.jsx(
117            "input",
118            {
119              onChange: (e) => setEmail(e.target.value),
120              name: "email",
121              type: "email",
122              autoComplete: "email",
123              required: true,
124              placeholder: "Email",
125              className: "w-full border border-gray-300 rounded-lg py-3 px-4 text-zinc-700 bg-transparent  "
126            }
127          )
128        ] }),
129        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
130          /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "mb-1 block text-sm font-medium text-zinc-700 dark:text-zinc-300", children: [
131            "Password",
132            " ",
133            /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "list-disc pl-4", children: [
134              /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "At least 6 characters long" }),
135              /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "At least one uppercase letter" }),
136              /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "At least one number" }),
137              /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "At least one special character (@$!%*?&)" })
138            ] }) })
139          ] }),
140          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
141            /* @__PURE__ */ jsxRuntimeExports.jsx(
142              "input",
143              {
144                type: showPassword ? "text" : "password",
145                id: "password",
146                autoComplete: "password",
147                value: password,
148                pattern: "(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{6,}",
149                onChange: (e) => setPassword(e.target.value),
150                onInvalid: (e) => e.target.setCustomValidity(
151                  "Password does not meet the required criteria. Please ensure it meets all the specified requirements."
152                ),
153                onInput: (e) => e.target.setCustomValidity(""),
154                className: "w-full border border-gray-300 rounded-lg py-3 px-4 text-zinc-700 bg-transparent  ",
155                placeholder: "Password",
156                required: true
157              }
158            ),
159            /* @__PURE__ */ jsxRuntimeExports.jsx(
160              "button",
161              {
162                type: "button",
163                onClick: () => setShowPassword(!showPassword),
164                className: "absolute inset-y-0 right-3 flex items-center text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-400",
165                children: showPassword ? /* @__PURE__ */ jsxRuntimeExports.jsx(AiOutlineEyeInvisible, { size: 20 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(AiOutlineEye, { size: 20 })
166              }
167            )
168          ] })
169        ] }),
170        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
171          /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "mb-1 block text-sm font-medium text-zinc-700 dark:text-zinc-300", children: [
172            "Confirm Password ",
173            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500", children: "*" })
174          ] }),
175          /* @__PURE__ */ jsxRuntimeExports.jsx(
176            "input",
177            {
178              onChange: (e) => setConfirmPassword(e.target.value),
179              name: "confirm_password",
180              type: "password",
181              autoComplete: "new-password",
182              required: true,
183              placeholder: "Confirm Password",
184              className: "w-full border border-gray-300 rounded-lg py-3 px-4 text-zinc-700 bg-transparent  "
185            }
186          )
187        ] }),
188        /* @__PURE__ */ jsxRuntimeExports.jsx(
189          "button",
190          {
191            type: "submit",
192            className: "w-full bg-[#162D3A] text-white font-semibold py-3 px-4 rounded-lg hover:bg-[#0e1c24] transition-colors duration-200 flex items-center justify-center",
193            children: "Register"
194          }
195        ),
196        /* @__PURE__ */ jsxRuntimeExports.jsx(GoogleAuth, {}),
197        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-center text-sm text-zinc-600 dark:text-zinc-300 mt-4", children: [
198          "Already have an account?",
199          " ",
200          /* @__PURE__ */ jsxRuntimeExports.jsx(
201            Link,
202            {
203              to: "/login",
204              className: "text-blue-500 hover:text-blue-800 dark:hover:text-blue-300",
205              children: "Login"
206            }
207          )
208        ] })
209      ] })
210    ] })
211  ] });
212};
213
214export { Register as default };
215//# sourceMappingURL=Register-72d6f005.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.