/* empty css              */ /* empty css              */ /* empty css              */ import "./index-325f2a5d.js";
import { F as e } from "./index-8da36b2b.js";
import {
  a as s,
  b as a,
  j as o,
  u as l,
  aC as r,
  m as t,
  p as d,
  o as p,
  f as i,
  v as m,
  h as n,
  t as u,
  az as c,
  aW as f,
  G as b,
} from "./index-476be0bb.js";
import { b as x } from "./api.mine-40f950d7.js";
import { B as w } from "./index-97676c1f.js";
import { F as j } from "./index-34aa487b.js";
import "./use-route-126c4f06.js";
import "./use-id-50eda0ee.js";
const _ = { class: "pt-14 px-14 pb-20" },
  y = { class: "text-16" },
  g = {
    __name: "index",
    setup(g) {
      const { t: $ } = s(),
        h = a(),
        v = o({ old_password: "", new_password: "" }),
        V = l(),
        C = () => {
          c({ forbidClick: !0, duration: 0 }),
            x(v.value).then((e) => {
              f(),
                b({
                  message: $("修改成功"),
                  onClose() {
                    localStorage.setItem("password", ""),
                      V.clearUserInfo(),
                      h.replace("/login");
                  },
                });
            });
        };
      return (s, a) => {
        const o = e,
          l = w,
          c = j,
          f = r("normal-layout");
        return (
          p(),
          t(
            f,
            {
              flex: "",
              title: s.$t("修改密码"),
              "bg-color": "#f2f2f2",
              "nav-bg-color": "#fff",
              "text-color": "#000",
              backType: 0,
            },
            {
              default: d(() => [
                i("div", _, [
                  m(
                    c,
                    { onSubmit: C, class: "mb-20 rounded-8 overflow-hidden" },
                    {
                      default: d(() => [
                        m(
                          o,
                          {
                            class: "!py-14",
                            modelValue: n(v).old_password,
                            "onUpdate:modelValue":
                              a[0] || (a[0] = (e) => (n(v).old_password = e)),
                            type: "password",
                            label: s.$t("原密码"),
                            placeholder: s.$t("请输入原密码"),
                            rules: [
                              { required: !0, message: s.$t("请输入原密码") },
                            ],
                          },
                          null,
                          8,
                          ["modelValue", "label", "placeholder", "rules"]
                        ),
                        m(
                          o,
                          {
                            class: "!py-14",
                            modelValue: n(v).new_password,
                            "onUpdate:modelValue":
                              a[1] || (a[1] = (e) => (n(v).new_password = e)),
                            type: "password",
                            label: s.$t("新密码"),
                            placeholder: s.$t("请输入新密码"),
                            rules: [
                              { required: !0, message: s.$t("请输入新密码") },
                            ],
                          },
                          null,
                          8,
                          ["modelValue", "label", "placeholder", "rules"]
                        ),
                        m(
                          l,
                          {
                            color: "#5A55E6",
                            block: "",
                            type: "primary",
                            "native-type": "submit",
                            style: {
                              "margin-top": "8rem",
                              "border-radius": "2rem",
                            },
                          },
                          {
                            default: d(() => [i("div", y, u(s.$t("确定")), 1)]),
                            _: 1,
                          }
                        ),
                      ]),
                      _: 1,
                    }
                  ),
                ]),
              ]),
              _: 1,
            },
            8,
            ["title"]
          )
        );
      };
    },
  };
export { g as default };
