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IkF,QAAQ,CAACC,OAAO,CAACC,MAAM,CACzB,aACD,CAAG,UAA6BrG,MAAA,CAAnBkG,EAAYI,MAAM,EAEhC,OAAOrF,EAAIkF,QAAQ,CAACC,OAAO,CAACC,MAAM,CAAC,aAAgB,EAIvDpF,EAAIsF,YAAY,CAACzD,QAAQ,CAAC0D,GAAG,CAC3B,GAASC,EACT,QACM9D,EAUJ,MAVIA,CAAAA,OAAAA,CAAAA,EAAAA,EAAIG,QAAQ,GAAZH,KAAAA,IAAAA,EAAAA,KAAAA,EAAAA,EAAc+D,MAAM,IAAK,KAErBlE,WAAAA,OAAOC,QAAQ,CAACkE,QAAQ,EAC1BnE,CAAAA,OAAOC,QAAQ,CAACC,IAAI,CAAG,WAOtB5D,QAAQ8H,MAAM,CAACjE,EACxB,qBCnCFkE,EAAAC,OAAA,EAAkB,mNCAlBD,EAAAC,OAAA,EAAkB,6HCAlBD,EAAAC,OAAA,EAAkB,6HCAlBD,EAAAC,OAAA,EAAkB","sources":["webpack://_N_E/?9b11","webpack://_N_E/./src/components/Checkbox/index.tsx","webpack://_N_E/./src/services/api/User.ts","webpack://_N_E/./src/components/Form/Login/index.tsx","webpack://_N_E/./src/components/Input/index.tsx","webpack://_N_E/./src/services/api/index.ts","webpack://_N_E/./src/app/login/styles.module.css","webpack://_N_E/./src/components/Checkbox/styles.module.css","webpack://_N_E/./src/components/Form/Login/styles.module.css","webpack://_N_E/./src/components/Input/styles.module.css","webpack://_N_E/"],"sourcesContent":["import(/* webpackMode: \"eager\" */ \"/codebuild/output/src1667011034/src/verus_broker_frontend/node_modules/next/dist/client/image-component.js\");\nimport(/* webpackMode: \"eager\" */ \"/codebuild/output/src1667011034/src/verus_broker_frontend/node_modules/next/dist/client/link.js\");\nimport(/* webpackMode: \"eager\" */ \"/codebuild/output/src1667011034/src/verus_broker_frontend/src/app/login/styles.module.css\");\nimport(/* webpackMode: \"eager\" */ \"/codebuild/output/src1667011034/src/verus_broker_frontend/src/components/Form/Login/index.tsx\")","import styles from \"./styles.module.css\";\nimport { ICheckboxProps } from \"./types\";\n\nexport default function Checkbox({\n orientation = \"row\",\n error,\n ...rest\n}: Readonly) {\n const hasError = Boolean(error);\n\n return (\n <>\n \n {\n if (rest.onChange) {\n rest.onChange(event);\n }\n }}\n />\n {rest.label && }\n \n {hasError &&

{error}

}\n \n );\n}\n","import { type ICredentials, api } from \".\";\nimport type { IUser } from \"@/models\";\nimport type { ILoginFormValues } from \"@/components/Form/Login/types\";\n\nexport const UserService = {\n Login: (values: ILoginFormValues) => {\n // @ts-ignore local field only\n delete values.remember_me;\n\n return api.post(\"int/token/\", values);\n },\n\n GetCurrent: () => {\n return api.get(\"int/current_user/\");\n },\n};\n","\"use client\";\n\nimport { useRef } from \"react\";\nimport Image from \"next/image\";\nimport Swal from \"sweetalert2\";\nimport { setCookie } from \"nookies\";\nimport { Formik, FormikProps } from \"formik\";\nimport * as Yup from \"yup\";\nimport Input from \"@/components/Input\";\nimport Checkbox from \"@/components/Checkbox\";\nimport { setAuthHeader } from \"@/services/api\";\nimport { UserService } from \"@/services/api/User\";\nimport styles from \"./styles.module.css\";\nimport { ILoginFormValues } from \"./types\";\n\nconst LoginFormSchema = Yup.object().shape({\n username: Yup.string().required(\"Username is required\"),\n password: Yup.string().required(\"Password is required\"),\n remember_me: Yup.boolean(),\n});\n\nexport default function LoginForm() {\n const formRef = useRef>(null);\n\n const handleFormSubmit = async (values: ILoginFormValues) => {\n try {\n const loginRes = (await UserService.Login(values)).data;\n setAuthHeader(loginRes);\n setCookie(null, \"auth\", btoa(JSON.stringify(loginRes)), {\n maxAge: values.remember_me ? 30 * 24 * 60 * 60 : undefined,\n });\n window.location.href = \"/\";\n } catch (err: any) {\n formRef.current?.setErrors(err?.response?.data ?? {});\n Swal.fire({\n title: \"Error\",\n text:\n err?.response?.data?.detail ??\n err?.response?.data?.non_field_errors?.join(\", \") ??\n err?.message ??\n \"An error occurred while logging in. Please, try again later.\",\n icon: \"error\",\n });\n }\n };\n\n return (\n \n {({\n values,\n errors,\n touched,\n setFieldValue,\n handleChange,\n handleSubmit,\n isSubmitting,\n }) => (\n
\n \n\n

Automating Broker Trade Capture

\n\n \n \n\n \n \n\n {\n setFieldValue(\"remember_me\", !values.remember_me);\n }}\n />\n\n \n \n )}\n \n );\n}\n","import { useState } from \"react\";\nimport Image from \"next/image\";\nimport InputMask from \"react-input-mask\";\nimport { BaiJamjureeFont } from \"@/styles/typography\";\nimport styles from \"./styles.module.css\";\nimport { IInputProps } from \"./types\";\n\nexport default function Input({\n flex,\n mask,\n width,\n icon,\n iconTopOffset = \"1.65rem\",\n error,\n ...rest\n}: Readonly) {\n const [isPasswordVisible, setIsPasswordVisible] = useState(false);\n\n const hasError = Boolean(error);\n\n const togglePasswordVisibility = () => {\n setIsPasswordVisible((prev) => !prev);\n };\n\n return (\n
\n {rest.label && }\n\n {icon && (\n \n )}\n\n {/* @ts-ignore */}\n \n\n {rest.type === \"password\" && (\n \n )}\n\n {hasError &&

{error}

}\n
\n );\n}\n","import { redirect } from \"next/navigation\";\nimport axios from \"axios\";\n\nexport interface ICredentials {\n access: string;\n refresh: string;\n}\n\nexport const api = axios.create({\n baseURL: `${process.env.API_BASE_URL}/api`,\n});\n\nexport const setAuthHeader = (credentials?: ICredentials) => {\n if (credentials) {\n api.defaults.headers.common[\n \"Authorization\"\n ] = `Bearer ${credentials.access}`;\n } else {\n delete api.defaults.headers.common[\"Authorization\"];\n }\n};\n\napi.interceptors.response.use(\n (res) => res,\n (err) => {\n if (err.response?.status === 401) {\n if (typeof window !== \"undefined\") {\n if (window.location.pathname !== \"/login\") {\n window.location.href = \"/logout\";\n }\n } else {\n redirect(\"/logout\");\n }\n }\n\n return Promise.reject(err);\n }\n);\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"styles_container__RuiLu\",\"container-auth-image\":\"styles_container-auth-image__1G7OM\",\"container-form\":\"styles_container-form__ZwXrz\",\"txt-powered-by\":\"styles_txt-powered-by__rZdiK\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"styles_container__qz7_H\",\"border\":\"styles_border__Ipi9w\",\"text-error\":\"styles_text-error__EXBks\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"auth-form\":\"styles_auth-form__1ncLZ\",\"logo\":\"styles_logo__e8Rlu\",\"form-inputs\":\"styles_form-inputs__8Am86\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"styles_container__N96d4\",\"with-icon\":\"styles_with-icon__RiAiS\",\"btn-toggle-password-visibility\":\"styles_btn-toggle-password-visibility__6gFw1\",\"icon\":\"styles_icon__mrOrW\",\"text-error\":\"styles_text-error__Ciwaa\"};"],"names":["Promise","resolve","then","__webpack_require__","t","bind","Checkbox","param","orientation","error","rest","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsxs","Fragment","div","style","flexDirection","className","concat","styles","label","jsx","input","type","onChange","event","htmlFor","name","hasError","Boolean","p","UserService","Login","values","remember_me","api","post","GetCurrent","get","LoginFormSchema","Yup","shape","username","required","password","LoginForm","formRef","useRef","handleFormSubmit","loginRes","data","setAuthHeader","setCookie","btoa","JSON","stringify","maxAge","undefined","window","location","href","err","current","setErrors","response","Swal","title","text","detail","non_field_errors","join","message","icon","jsx_runtime","Formik","innerRef","initialValues","validationSchema","onSubmit","errors","touched","setFieldValue","handleChange","handleSubmit","isSubmitting","form","Image","width","height","alt","src","sizes","h4","span","Input","placeholder","value","disabled","checked","button","flex","mask","iconTopOffset","isPasswordVisible","setIsPasswordVisible","useState","top","InputMask","fontFamily","BaiJamjureeFont","onClick","prev","axios","create","baseURL","process","credentials","defaults","headers","common","access","interceptors","use","res","status","pathname","reject","module","exports"],"sourceRoot":""}