import {
    G as M,
    r as v,
    z as Q,
    R as J,
    $ as E,
    aZ as Z,
    C as q,
    E as K,
    aJ as W,
    H as R,
    N as h,
    I as y,
    Q as d,
    O as i,
    aw as I,
    ax as $,
    J as r,
    P as p,
    au as G,
    aA as j,
    a_ as X,
    u as c,
    F as D,
    aB as Y,
    aC as ee,
    ao as P,
    an as F
} from "./common.modules-af1f85b9.js";
import {
    d as ne,
    P as N,
    V as le,
    v as A,
    E as ie,
    b as ue,
    c as H,
    e as de
} from "./page-login-index.vue_vue_type_script_setup_true_lang.ts-fbfa23c0.js";
import {
    a3 as V,
    G as B,
    A as x,
    bh as me,
    bi as se,
    bj as ae,
    ch as te,
    _ as oe,
    bE as ce,
    bn as pe,
    N as ve
} from "./page-activity-ActivityDetail-f7c58355.js";
const we = w => (Y("data-v-e7fb7c52"), w = w(), ee(), w),
    ge = {
        class: "register__container"
    },
    _e = {
        class: "register__container-tip"
    },
    be = we(() => r("div", {
        class: "tipbg"
    }, null, -1)),
    fe = {
        class: "register__container-tips"
    },
    he = {
        class: "register__container-remember"
    },
    ye = {
        class: "register__container-button"
    },
    Se = M({
        __name: "ResetPassword",
        setup(w, {
            expose: T
        }) {
            const C = v("reset"),
                {
                    t: n
                } = Q(),
                s = V(),
                l = J(),
                g = v(!1),
                S = B(),
                b = v(!1),
                m = v(!1),
                e = v({
                    numberType: s.userForm.numberType,
                    number: "",
                    password: "",
                    rePassword: "",
                    smsvcode: ""
                });
            sessionStorage.getItem("rpwd") && (e.value = JSON.parse(sessionStorage.getItem("rpwd") || ""), sessionStorage.setItem("rpwd", "")), E(() => s.rPwdForm.numberType, t => {
                !e.value.numberType && (e.value.numberType = t)
            }, {
                flush: "post"
            });
            const a = async () => {
                const t = (e.value.number.trim() + e.value.numberType).length;
                if (t < 10 || t > 14) return s.setCountDown(0), c({
                    message: n("wrongTel"),
                    wordBreak: "break-word"
                });
                await x(me({
                    phone: e.value.numberType + e.value.number,
                    codeType: se.resetPassword
                })) ? D(n("sendSuccess")) : setTimeout(() => {
                    s.setCountDown(0)
                }, 500)
            };
            async function _() {
                const t = (e.value.number.trim() + e.value.numberType).length;
                if (t < 10 || t > 14) return c({
                    message: n("wrongTel"),
                    wordBreak: "break-word"
                });
                if (!e.value.number.trim() || g.value) {
                    g.value = !0;
                    return
                }
                if (s.isOpenForgetPasswordSMSState)
                    if (e.value.smsvcode.trim()) {
                        if (e.value.smsvcode.trim().length != 6) return c({
                            message: n("verifyCode6Digits"),
                            wordBreak: "break-word"
                        })
                    } else return c({
                        message: n("registerTip1"),
                        wordBreak: "break-word"
                    });
                if (!e.value.password.trim()) return c({
                    message: n("registerTip2"),
                    wordBreak: "break-word"
                });
                if (!A.passReg3.test(e.value.password)) {
                    m.value = !0;
                    return
                }
                if (!e.value.rePassword.trim()) return c({
                    message: n("registerTip3"),
                    wordBreak: "break-word"
                });
                if (e.value.password !== e.value.rePassword) {
                    b.value = !0;
                    return
                } else b.value = !1;
                if (!s.userForm.termAndPolicy) return c({
                    message: n("registerDesc1"),
                    wordBreak: "break-word"
                });
                const {
                    numberType: o,
                    number: f,
                    password: u,
                    smsvcode: z
                } = e.value;
                let re = {
                    username: o + f.trim(),
                    password: u,
                    smsvcode: z,
                    type: "mobile"
                };
                await x(ae(re)) && (localStorage.getItem("token") && (await te({}), S.token = "", s.userForm.vCode = "", s.loginout(), localStorage.setItem("isToLogin", "1"), B().setToken("")), l.push("/login"), D(n("rpdsucceed")))
            }
            Z(window, "keydown", t => {
                t.key == "Enter" && _()
            });
            const k = () => {
                    l.push({
                        name: "About-AboutDetail"
                    })
                },
                O = t => {
                    e.value.numberType = t
                },
                L = t => {
                    e.value.number = t
                };
            q(() => {
                s.setCountDown(0)
            });
            let U = E(() => e.value.number, t => {
                s.setCountDown(0)
            }, {
                flush: "post"
            });
            return K(() => {
                U()
            }), W((t, o) => {
                t.name == "About-AboutDetail" ? sessionStorage.setItem("rpwd", JSON.stringify(e.value)) : sessionStorage.setItem("rpwd", "")
            }), T({
                showPhoneValidate: g
            }), (t, o) => {
                const f = R("van-checkbox");
                return h(), y("div", ge, [d(ne, {
                    "show-validate": g.value,
                    "onUpdate:showValidate": o[0] || (o[0] = u => g.value = u),
                    "number-type": e.value.numberType,
                    number: e.value.number,
                    type: C.value,
                    onChangeT: O,
                    onChangeN: L
                }, null, 8, ["show-validate", "number-type", "number", "type"]), d(N, {
                    value: e.value.password,
                    "onUpdate:value": o[1] || (o[1] = u => e.value.password = u),
                    label: i(n)("newPSWRest")
                }, null, 8, ["value", "label"]), I(r("div", _e, [be, r("span", null, p(i(n)("pswRule")), 1)], 512), [
                    [$, m.value]
                ]), d(N, {
                    value: e.value.rePassword,
                    "onUpdate:value": o[2] || (o[2] = u => e.value.rePassword = u),
                    label: i(n)("newPSWconfirm")
                }, null, 8, ["value", "label"]), I(r("div", fe, [r("span", null, p(i(n)("unmatchedInput")), 1)], 512), [
                    [$, b.value]
                ]), d(le, {
                    value: e.value.smsvcode,
                    "onUpdate:value": o[3] || (o[3] = u => e.value.smsvcode = u),
                    number: e.value.number,
                    sendFunc: a,
                    numberType: e.value.numberType,
                    loginType: "1"
                }, null, 8, ["value", "number", "numberType"]), r("div", he, [d(f, {
                    modelValue: i(s).userForm.termAndPolicy,
                    "onUpdate:modelValue": o[5] || (o[5] = u => i(s).userForm.termAndPolicy = u)
                }, {
                    default: G(() => [j(p(i(n)("readNagree")) + " ", 1), r("span", {
                        onClick: o[4] || (o[4] = X(u => k(), ["stop"]))
                    }, p(i(n)("desPrivacy")), 1)]),
                    _: 1
                }, 8, ["modelValue"])]), r("div", ye, [r("button", {
                    onClick: _
                }, p(i(n)("reset")), 1)])])
            }
        }
    });
const ke = oe(Se, [
        ["__scopeId", "data-v-e7fb7c52"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar031-india-in999/src/components/Login/ResetPassword.vue"]
    ]),
    Pe = w => (Y("data-v-470fd154"), w = w(), ee(), w),
    Te = {
        class: "register__container"
    },
    Ce = {
        class: "register__container-tip"
    },
    Ie = Pe(() => r("div", {
        class: "tipbg"
    }, null, -1)),
    $e = {
        class: "register__container-tips"
    },
    Be = {
        class: "register__container-remember"
    },
    Fe = {
        class: "register__container-button"
    },
    Ae = M({
        __name: "ResetEmailPassword",
        setup(w, {
            expose: T
        }) {
            const {
                registerState: C
            } = ce();
            C();
            const n = v("reset"),
                {
                    t: s
                } = Q(),
                l = V(),
                g = B(),
                S = J(),
                b = v(!1),
                m = v(!1),
                e = v(!1),
                a = v({
                    numberType: l.userForm.numberType,
                    number: "",
                    email: "",
                    password: "",
                    rePassword: "",
                    smsvcode: ""
                });
            sessionStorage.getItem("rpwd") && (a.value = JSON.parse(sessionStorage.getItem("rpwd") || ""), sessionStorage.setItem("rpwd", "")), E(() => l.rPwdForm.numberType, t => {
                !a.value.numberType && (a.value.numberType = t)
            }, {
                flush: "post"
            });
            const _ = async () => {
                if (!A.email1.test(a.value.email)) return l.setCountEmailDown(0), c({
                    message: s(H.email),
                    wordBreak: "break-word"
                });
                await x(pe({
                    email: a.value.email,
                    emailType: se.resetPassword
                })) ? D(s("sendSuccess")) : setTimeout(() => {
                    l.setCountEmailDown(0)
                }, 500)
            };
            async function k() {
                if (!A.email1.test(a.value.email)) return c({
                    message: s(H.email),
                    wordBreak: "break-word"
                });
                if (l.isOpenForgetPasswordEmailState)
                    if (a.value.smsvcode.trim()) {
                        if (a.value.smsvcode.trim().length != 6) return c({
                            message: s("verifyCode6Digits"),
                            wordBreak: "break-word"
                        })
                    } else return c({
                        message: s("registerTip6"),
                        wordBreak: "break-word"
                    });
                if (!a.value.password.trim()) return c({
                    message: s("registerTip2"),
                    wordBreak: "break-word"
                });
                if (!A.passReg3.test(a.value.password)) {
                    e.value = !0;
                    return
                }
                if (!a.value.rePassword.trim()) return c({
                    message: s("registerTip3"),
                    wordBreak: "break-word"
                });
                if (a.value.password !== a.value.rePassword) {
                    m.value = !0;
                    return
                } else m.value = !1;
                if (!l.userForm.termAndPolicy) return c({
                    message: s("registerDesc1"),
                    wordBreak: "break-word"
                });
                const {
                    email: t,
                    password: o,
                    smsvcode: f
                } = a.value;
                let u = {
                    username: t.trim(),
                    password: o,
                    type: "email",
                    smsvcode: f
                };
                await x(ae(u)) && (localStorage.getItem("token") && (await te({}), g.token = "", l.userForm.vCode = "", l.loginout(), localStorage.setItem("isToLogin", "1"), B().setToken("")), S.push("/login"), D(s("rpdsucceed")))
            }
            Z(window, "keydown", t => {
                t.key == "Enter" && k()
            });
            const O = () => {
                    S.push({
                        name: "About-AboutDetail"
                    })
                },
                L = t => {
                    a.value.email = t
                };
            q(() => {
                l.setCountEmailDown(0)
            });
            let U = E(() => a.value.email, t => {
                l.setCountEmailDown(0)
            }, {
                flush: "post"
            });
            return K(() => {
                U()
            }), W((t, o) => {
                t.name == "About-AboutDetail" ? sessionStorage.setItem("rpwd", JSON.stringify(a.value)) : sessionStorage.setItem("rpwd", "")
            }), T({
                showPhoneValidate: b
            }), (t, o) => {
                const f = R("van-checkbox");
                return h(), y("div", Te, [d(ie, {
                    ref: "email",
                    type: n.value,
                    email: a.value.email,
                    onChangeN: L
                }, null, 8, ["type", "email"]), d(N, {
                    value: a.value.password,
                    "onUpdate:value": o[0] || (o[0] = u => a.value.password = u),
                    label: i(s)("newPSWRest")
                }, null, 8, ["value", "label"]), I(r("div", Ce, [Ie, r("span", null, p(i(s)("pswRule")), 1)], 512), [
                    [$, e.value]
                ]), d(N, {
                    value: a.value.rePassword,
                    "onUpdate:value": o[1] || (o[1] = u => a.value.rePassword = u),
                    label: i(s)("newPSWconfirm")
                }, null, 8, ["value", "label"]), I(r("div", $e, [r("span", null, p(i(s)("unmatchedInput")), 1)], 512), [
                    [$, m.value]
                ]), d(ue, {
                    value: a.value.smsvcode,
                    "onUpdate:value": o[2] || (o[2] = u => a.value.smsvcode = u),
                    sendFunc: _,
                    email: a.value.email
                }, null, 8, ["value", "email"]), r("div", Be, [d(f, {
                    modelValue: i(l).userForm.termAndPolicy,
                    "onUpdate:modelValue": o[4] || (o[4] = u => i(l).userForm.termAndPolicy = u)
                }, {
                    default: G(() => [j(p(i(s)("readNagree")) + " ", 1), r("span", {
                        onClick: o[3] || (o[3] = X(u => O(), ["stop"]))
                    }, p(i(s)("desPrivacy")), 1)]),
                    _: 1
                }, 8, ["modelValue"])]), r("div", Fe, [r("button", {
                    onClick: k
                }, p(i(s)("reset")), 1)])])
            }
        }
    });
const Ee = oe(Ae, [
        ["__scopeId", "data-v-470fd154"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar031-india-in999/src/components/Login/ResetEmailPassword.vue"]
    ]),
    Re = {
        class: "rpwd__C"
    },
    De = {
        class: "rpwd__C-heading"
    },
    Ne = {
        class: "rpwd__C-heading__title"
    },
    Ve = {
        class: "rpwd__C-heading__subTitle"
    },
    xe = {
        class: "login_container-tab"
    },
    Oe = {
        class: "rpwd__C-form"
    },
    We = M({
        __name: "index",
        setup(w) {
            const {
                t: T
            } = ve.global, C = B(), n = V();
            n.getRegisterState();
            const s = J(),
                l = v("phone");
            n.isOpenForgetPasswordSMSState || (l.value = "email");
            const g = v(!0);

            function S() {
                s.go(-1)
            }
            const b = m => {
                l.value = m
            };
            return C.token && (g.value = !1), W((m, e, a) => {
                m.name !== "About-AboutDetail" && V().clearRpwdData(), a()
            }), (m, e) => {
                const a = R("NavBar"),
                    _ = R("svg-icon");
                return h(), y("div", Re, [d(a, {
                    onClickLeft: S,
                    leftArrow: !0,
                    headLogo: !0,
                    class: "main"
                }, {
                    right: G(() => [d(de)]),
                    _: 1
                }), r("div", De, [r("h1", Ne, p(i(T)("forgetPSW")), 1), r("div", Ve, [r("div", null, p(m.$t("changepasswordphoneoremail")), 1)])]), r("div", xe, [i(n).isOpenForgetPasswordSMSState ? (h(), y("div", {
                    key: 0,
                    class: P(["tab", [l.value == "phone" ? "active" : ""]]),
                    onClick: e[0] || (e[0] = k => b("phone"))
                }, [d(_, {
                    name: "phone"
                }), r("div", {
                    class: P([l.value == "phone" ? "phonefont30active" : ""])
                }, p(m.$t("changepasswordphone")), 3)], 2)) : F("v-if", !0), i(n).isOpenForgetPasswordEmailState ? (h(), y("div", {
                    key: 1,
                    class: P(["tab", [l.value == "email" ? "active" : ""]]),
                    onClick: e[1] || (e[1] = k => b("email"))
                }, [r("div", null, [d(_, {
                    name: "email"
                }), j(), I(d(_, {
                    name: "user"
                }, null, 512), [
                    [$, i(n).isOpenExternalAccount]
                ])]), r("div", {
                    class: P([l.value == "email" ? "emailfont30active" : ""])
                }, p(m.$t("changepasswordemail")), 3)], 2)) : F("v-if", !0)]), r("div", Oe, [i(n).isOpenForgetPasswordSMSState ? (h(), y("div", {
                    key: 0,
                    class: P(["tab-content", [l.value == "phone" ? "activecontent" : ""]])
                }, [d(ke)], 2)) : F("v-if", !0), i(n).isOpenForgetPasswordEmailState ? (h(), y("div", {
                    key: 1,
                    class: P(["tab-content", [l.value == "email" ? "activecontent" : ""]])
                }, [d(Ee)], 2)) : F("v-if", !0)])])
            }
        }
    });
export {
    We as _
};