import { defineComponent, reactive, ref, mergeProps, withCtx, isRef, unref, createTextVNode, toDisplayString, createVNode, openBlock, createBlock, createCommentVNode, withModifiers, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { b9 as useI18n, bv as useUserSession, br as useState, be as useNuxtApp, b8 as useHead, j as VContainer, V as VBtn, aJ as navigateTo } from './server.mjs';
import { S as Statuses } from '../nitro/nitro.mjs';
import { a as VRow, V as VCol } from './VRow-DwC6p4O-.mjs';
import { V as VForm } from './VForm-BuIr7lQn.mjs';
import { V as VCard, b as VCardTitle, a as VCardSubtitle } from './VCard-D86CughW.mjs';
import { V as VCardText } from './VCardText-KkYigSmQ.mjs';
import { V as VTextField } from './VTextField-DFD0D30-.mjs';
import { V as VCardActions } from './VCardActions-B8o0qNQf.mjs';
import { V as VSpacer } from './VSpacer-D6kTsy1m.mjs';
import 'perfect-debounce';
import 'v-calendar';
import 'linkifyjs';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/utils';
import 'luxon';
import '@sequelize/core';
import 'html-to-text';
import 'zod';
import 'crypto';
import 'node:fs';
import 'sharp';
import 'path';
import 'node:stream';
import 'jsdom';
import 'dompurify';
import 'mime-types';
import 'fs';
import 'fs/promises';
import 'linkify-html';
import '@peertube/http-signature';
import 'jsonld';
import 'lodash.intersection';
import 'email-templates';
import 'node:http';
import 'node:https';
import 'node:crypto';
import 'node:events';
import 'node:buffer';
import 'node:path';
import 'vue-router';
import 'dotenv';
import 'url';
import 'bcryptjs';
import 'slugify';
import 'umzug';
import 'consola';
import '@sequelize/core/decorators-legacy';
import 'util';
import 'mitt';
import 'ical.js';
import 'node:url';
import 'fast-xml-parser';
import './form-Q_oG-_Ip.mjs';
import './forwardRefs-C3iWxc5z.mjs';
import './createSimpleFunctional-D4PbVxKo.mjs';
import './VAvatar-DZc9zgUD.mjs';
import './autofocus-BUnCw2TG.mjs';
import './index-0tjXFI7F.mjs';
import './animation-DMtpo1PO.mjs';

const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "login",
  __ssrInlineRender: true,
  setup(__props) {
    const { t } = useI18n();
    const { fetch: refreshSession } = useUserSession();
    const settings = useState("settings");
    const { $notify } = useNuxtApp();
    useHead({
      title: () => `${settings.value.title} - ${t("common.login")}`
    });
    const credentials = reactive({
      email: "",
      password: ""
    });
    const valid = ref(false);
    const loading = ref(false);
    const emailInput = ref();
    async function login() {
      $fetch("/api/login", {
        method: "POST",
        body: credentials
      }).then(async () => {
        await refreshSession();
        await navigateTo("/");
        $notify("login.ok", Statuses.SUCCESS);
      }).catch(() => $notify("login.error", Statuses.ERROR));
    }
    async function forgot() {
      if (!credentials.email) {
        emailInput.value.focus();
        return;
      }
      loading.value = true;
      try {
        await $fetch("/api/user/recover", { method: "POST", body: { email: credentials.email } });
        $notify("login.check_email");
      } catch (e) {
        console.error(e);
        $notify(String(e), Statuses.ERROR);
      }
      loading.value = false;
    }
    return (_ctx, _push, _parent, _attrs) => {
      _push(ssrRenderComponent(VContainer, mergeProps({ class: "pa-0 pa-md-3" }, _attrs), {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(ssrRenderComponent(VRow, {
              class: "mt-md-5 ma-0",
              justify: "center"
            }, {
              default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(ssrRenderComponent(VCol, {
                    class: "pa-0 pa-md-3",
                    cols: "12",
                    md: "6",
                    lg: "5",
                    xl: "4"
                  }, {
                    default: withCtx((_3, _push4, _parent4, _scopeId3) => {
                      if (_push4) {
                        _push4(ssrRenderComponent(VForm, {
                          ref: "form",
                          modelValue: unref(valid),
                          "onUpdate:modelValue": ($event) => isRef(valid) ? valid.value = $event : null,
                          onSubmit: login
                        }, {
                          default: withCtx((_4, _push5, _parent5, _scopeId4) => {
                            if (_push5) {
                              _push5(ssrRenderComponent(VCard, null, {
                                default: withCtx((_5, _push6, _parent6, _scopeId5) => {
                                  if (_push6) {
                                    _push6(ssrRenderComponent(VCardTitle, null, {
                                      default: withCtx((_6, _push7, _parent7, _scopeId6) => {
                                        if (_push7) {
                                          _push7(`${ssrInterpolate(_ctx.$t("common.login"))}`);
                                        } else {
                                          return [
                                            createTextVNode(toDisplayString(_ctx.$t("common.login")), 1)
                                          ];
                                        }
                                      }),
                                      _: 1
                                    }, _parent6, _scopeId5));
                                    _push6(ssrRenderComponent(VCardSubtitle, null, {
                                      default: withCtx((_6, _push7, _parent7, _scopeId6) => {
                                        if (_push7) {
                                          _push7(`<span${_scopeId6}>${unref(t)("login.description") ?? ""}</span>`);
                                        } else {
                                          return [
                                            createVNode("span", {
                                              innerHTML: unref(t)("login.description")
                                            }, null, 8, ["innerHTML"])
                                          ];
                                        }
                                      }),
                                      _: 1
                                    }, _parent6, _scopeId5));
                                    _push6(ssrRenderComponent(VCardText, null, {
                                      default: withCtx((_6, _push7, _parent7, _scopeId6) => {
                                        if (_push7) {
                                          _push7(ssrRenderComponent(VTextField, {
                                            ref_key: "emailInput",
                                            ref: emailInput,
                                            modelValue: unref(credentials).email,
                                            "onUpdate:modelValue": ($event) => unref(credentials).email = $event,
                                            "validate-on": "blur",
                                            rules: _ctx.$valid.email,
                                            autofocus: "",
                                            label: _ctx.$t("common.email")
                                          }, null, _parent7, _scopeId6));
                                          _push7(ssrRenderComponent(VTextField, {
                                            modelValue: unref(credentials).password,
                                            "onUpdate:modelValue": ($event) => unref(credentials).password = $event,
                                            rules: [_ctx.$valid.password],
                                            type: "password",
                                            label: _ctx.$t("common.password")
                                          }, null, _parent7, _scopeId6));
                                        } else {
                                          return [
                                            createVNode(VTextField, {
                                              ref_key: "emailInput",
                                              ref: emailInput,
                                              modelValue: unref(credentials).email,
                                              "onUpdate:modelValue": ($event) => unref(credentials).email = $event,
                                              "validate-on": "blur",
                                              rules: _ctx.$valid.email,
                                              autofocus: "",
                                              label: _ctx.$t("common.email")
                                            }, null, 8, ["modelValue", "onUpdate:modelValue", "rules", "label"]),
                                            createVNode(VTextField, {
                                              modelValue: unref(credentials).password,
                                              "onUpdate:modelValue": ($event) => unref(credentials).password = $event,
                                              rules: [_ctx.$valid.password],
                                              type: "password",
                                              label: _ctx.$t("common.password")
                                            }, null, 8, ["modelValue", "onUpdate:modelValue", "rules", "label"])
                                          ];
                                        }
                                      }),
                                      _: 1
                                    }, _parent6, _scopeId5));
                                    _push6(ssrRenderComponent(VCardActions, null, {
                                      default: withCtx((_6, _push7, _parent7, _scopeId6) => {
                                        if (_push7) {
                                          _push7(ssrRenderComponent(VBtn, {
                                            variant: "text",
                                            tabindex: "1",
                                            size: "small",
                                            onClick: forgot
                                          }, {
                                            default: withCtx((_7, _push8, _parent8, _scopeId7) => {
                                              if (_push8) {
                                                _push8(`${ssrInterpolate(_ctx.$t("login.forgot_password"))}`);
                                              } else {
                                                return [
                                                  createTextVNode(toDisplayString(_ctx.$t("login.forgot_password")), 1)
                                                ];
                                              }
                                            }),
                                            _: 1
                                          }, _parent7, _scopeId6));
                                        } else {
                                          return [
                                            createVNode(VBtn, {
                                              variant: "text",
                                              tabindex: "1",
                                              size: "small",
                                              onClick: forgot
                                            }, {
                                              default: withCtx(() => [
                                                createTextVNode(toDisplayString(_ctx.$t("login.forgot_password")), 1)
                                              ]),
                                              _: 1
                                            })
                                          ];
                                        }
                                      }),
                                      _: 1
                                    }, _parent6, _scopeId5));
                                    _push6(ssrRenderComponent(VCardActions, null, {
                                      default: withCtx((_6, _push7, _parent7, _scopeId6) => {
                                        if (_push7) {
                                          _push7(ssrRenderComponent(VSpacer, null, null, _parent7, _scopeId6));
                                          if (unref(settings)?.allow_registration) {
                                            _push7(ssrRenderComponent(VBtn, {
                                              to: "/register",
                                              variant: "text",
                                              color: "orange"
                                            }, {
                                              default: withCtx((_7, _push8, _parent8, _scopeId7) => {
                                                if (_push8) {
                                                  _push8(`${ssrInterpolate(_ctx.$t("login.not_registered"))}`);
                                                } else {
                                                  return [
                                                    createTextVNode(toDisplayString(_ctx.$t("login.not_registered")), 1)
                                                  ];
                                                }
                                              }),
                                              _: 1
                                            }, _parent7, _scopeId6));
                                          } else {
                                            _push7(`<!---->`);
                                          }
                                          _push7(ssrRenderComponent(VBtn, {
                                            color: "success",
                                            type: "submit",
                                            variant: "outlined",
                                            disabled: !unref(valid) || unref(loading),
                                            loading: unref(loading)
                                          }, {
                                            default: withCtx((_7, _push8, _parent8, _scopeId7) => {
                                              if (_push8) {
                                                _push8(`${ssrInterpolate(_ctx.$t("common.login"))}`);
                                              } else {
                                                return [
                                                  createTextVNode(toDisplayString(_ctx.$t("common.login")), 1)
                                                ];
                                              }
                                            }),
                                            _: 1
                                          }, _parent7, _scopeId6));
                                        } else {
                                          return [
                                            createVNode(VSpacer),
                                            unref(settings)?.allow_registration ? (openBlock(), createBlock(VBtn, {
                                              key: 0,
                                              to: "/register",
                                              variant: "text",
                                              color: "orange"
                                            }, {
                                              default: withCtx(() => [
                                                createTextVNode(toDisplayString(_ctx.$t("login.not_registered")), 1)
                                              ]),
                                              _: 1
                                            })) : createCommentVNode("", true),
                                            createVNode(VBtn, {
                                              color: "success",
                                              type: "submit",
                                              variant: "outlined",
                                              disabled: !unref(valid) || unref(loading),
                                              loading: unref(loading)
                                            }, {
                                              default: withCtx(() => [
                                                createTextVNode(toDisplayString(_ctx.$t("common.login")), 1)
                                              ]),
                                              _: 1
                                            }, 8, ["disabled", "loading"])
                                          ];
                                        }
                                      }),
                                      _: 1
                                    }, _parent6, _scopeId5));
                                  } else {
                                    return [
                                      createVNode(VCardTitle, null, {
                                        default: withCtx(() => [
                                          createTextVNode(toDisplayString(_ctx.$t("common.login")), 1)
                                        ]),
                                        _: 1
                                      }),
                                      createVNode(VCardSubtitle, null, {
                                        default: withCtx(() => [
                                          createVNode("span", {
                                            innerHTML: unref(t)("login.description")
                                          }, null, 8, ["innerHTML"])
                                        ]),
                                        _: 1
                                      }),
                                      createVNode(VCardText, null, {
                                        default: withCtx(() => [
                                          createVNode(VTextField, {
                                            ref_key: "emailInput",
                                            ref: emailInput,
                                            modelValue: unref(credentials).email,
                                            "onUpdate:modelValue": ($event) => unref(credentials).email = $event,
                                            "validate-on": "blur",
                                            rules: _ctx.$valid.email,
                                            autofocus: "",
                                            label: _ctx.$t("common.email")
                                          }, null, 8, ["modelValue", "onUpdate:modelValue", "rules", "label"]),
                                          createVNode(VTextField, {
                                            modelValue: unref(credentials).password,
                                            "onUpdate:modelValue": ($event) => unref(credentials).password = $event,
                                            rules: [_ctx.$valid.password],
                                            type: "password",
                                            label: _ctx.$t("common.password")
                                          }, null, 8, ["modelValue", "onUpdate:modelValue", "rules", "label"])
                                        ]),
                                        _: 1
                                      }),
                                      createVNode(VCardActions, null, {
                                        default: withCtx(() => [
                                          createVNode(VBtn, {
                                            variant: "text",
                                            tabindex: "1",
                                            size: "small",
                                            onClick: forgot
                                          }, {
                                            default: withCtx(() => [
                                              createTextVNode(toDisplayString(_ctx.$t("login.forgot_password")), 1)
                                            ]),
                                            _: 1
                                          })
                                        ]),
                                        _: 1
                                      }),
                                      createVNode(VCardActions, null, {
                                        default: withCtx(() => [
                                          createVNode(VSpacer),
                                          unref(settings)?.allow_registration ? (openBlock(), createBlock(VBtn, {
                                            key: 0,
                                            to: "/register",
                                            variant: "text",
                                            color: "orange"
                                          }, {
                                            default: withCtx(() => [
                                              createTextVNode(toDisplayString(_ctx.$t("login.not_registered")), 1)
                                            ]),
                                            _: 1
                                          })) : createCommentVNode("", true),
                                          createVNode(VBtn, {
                                            color: "success",
                                            type: "submit",
                                            variant: "outlined",
                                            disabled: !unref(valid) || unref(loading),
                                            loading: unref(loading)
                                          }, {
                                            default: withCtx(() => [
                                              createTextVNode(toDisplayString(_ctx.$t("common.login")), 1)
                                            ]),
                                            _: 1
                                          }, 8, ["disabled", "loading"])
                                        ]),
                                        _: 1
                                      })
                                    ];
                                  }
                                }),
                                _: 1
                              }, _parent5, _scopeId4));
                            } else {
                              return [
                                createVNode(VCard, null, {
                                  default: withCtx(() => [
                                    createVNode(VCardTitle, null, {
                                      default: withCtx(() => [
                                        createTextVNode(toDisplayString(_ctx.$t("common.login")), 1)
                                      ]),
                                      _: 1
                                    }),
                                    createVNode(VCardSubtitle, null, {
                                      default: withCtx(() => [
                                        createVNode("span", {
                                          innerHTML: unref(t)("login.description")
                                        }, null, 8, ["innerHTML"])
                                      ]),
                                      _: 1
                                    }),
                                    createVNode(VCardText, null, {
                                      default: withCtx(() => [
                                        createVNode(VTextField, {
                                          ref_key: "emailInput",
                                          ref: emailInput,
                                          modelValue: unref(credentials).email,
                                          "onUpdate:modelValue": ($event) => unref(credentials).email = $event,
                                          "validate-on": "blur",
                                          rules: _ctx.$valid.email,
                                          autofocus: "",
                                          label: _ctx.$t("common.email")
                                        }, null, 8, ["modelValue", "onUpdate:modelValue", "rules", "label"]),
                                        createVNode(VTextField, {
                                          modelValue: unref(credentials).password,
                                          "onUpdate:modelValue": ($event) => unref(credentials).password = $event,
                                          rules: [_ctx.$valid.password],
                                          type: "password",
                                          label: _ctx.$t("common.password")
                                        }, null, 8, ["modelValue", "onUpdate:modelValue", "rules", "label"])
                                      ]),
                                      _: 1
                                    }),
                                    createVNode(VCardActions, null, {
                                      default: withCtx(() => [
                                        createVNode(VBtn, {
                                          variant: "text",
                                          tabindex: "1",
                                          size: "small",
                                          onClick: forgot
                                        }, {
                                          default: withCtx(() => [
                                            createTextVNode(toDisplayString(_ctx.$t("login.forgot_password")), 1)
                                          ]),
                                          _: 1
                                        })
                                      ]),
                                      _: 1
                                    }),
                                    createVNode(VCardActions, null, {
                                      default: withCtx(() => [
                                        createVNode(VSpacer),
                                        unref(settings)?.allow_registration ? (openBlock(), createBlock(VBtn, {
                                          key: 0,
                                          to: "/register",
                                          variant: "text",
                                          color: "orange"
                                        }, {
                                          default: withCtx(() => [
                                            createTextVNode(toDisplayString(_ctx.$t("login.not_registered")), 1)
                                          ]),
                                          _: 1
                                        })) : createCommentVNode("", true),
                                        createVNode(VBtn, {
                                          color: "success",
                                          type: "submit",
                                          variant: "outlined",
                                          disabled: !unref(valid) || unref(loading),
                                          loading: unref(loading)
                                        }, {
                                          default: withCtx(() => [
                                            createTextVNode(toDisplayString(_ctx.$t("common.login")), 1)
                                          ]),
                                          _: 1
                                        }, 8, ["disabled", "loading"])
                                      ]),
                                      _: 1
                                    })
                                  ]),
                                  _: 1
                                })
                              ];
                            }
                          }),
                          _: 1
                        }, _parent4, _scopeId3));
                      } else {
                        return [
                          createVNode(VForm, {
                            ref: "form",
                            modelValue: unref(valid),
                            "onUpdate:modelValue": ($event) => isRef(valid) ? valid.value = $event : null,
                            onSubmit: withModifiers(login, ["prevent"])
                          }, {
                            default: withCtx(() => [
                              createVNode(VCard, null, {
                                default: withCtx(() => [
                                  createVNode(VCardTitle, null, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(_ctx.$t("common.login")), 1)
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(VCardSubtitle, null, {
                                    default: withCtx(() => [
                                      createVNode("span", {
                                        innerHTML: unref(t)("login.description")
                                      }, null, 8, ["innerHTML"])
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(VCardText, null, {
                                    default: withCtx(() => [
                                      createVNode(VTextField, {
                                        ref_key: "emailInput",
                                        ref: emailInput,
                                        modelValue: unref(credentials).email,
                                        "onUpdate:modelValue": ($event) => unref(credentials).email = $event,
                                        "validate-on": "blur",
                                        rules: _ctx.$valid.email,
                                        autofocus: "",
                                        label: _ctx.$t("common.email")
                                      }, null, 8, ["modelValue", "onUpdate:modelValue", "rules", "label"]),
                                      createVNode(VTextField, {
                                        modelValue: unref(credentials).password,
                                        "onUpdate:modelValue": ($event) => unref(credentials).password = $event,
                                        rules: [_ctx.$valid.password],
                                        type: "password",
                                        label: _ctx.$t("common.password")
                                      }, null, 8, ["modelValue", "onUpdate:modelValue", "rules", "label"])
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(VCardActions, null, {
                                    default: withCtx(() => [
                                      createVNode(VBtn, {
                                        variant: "text",
                                        tabindex: "1",
                                        size: "small",
                                        onClick: forgot
                                      }, {
                                        default: withCtx(() => [
                                          createTextVNode(toDisplayString(_ctx.$t("login.forgot_password")), 1)
                                        ]),
                                        _: 1
                                      })
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(VCardActions, null, {
                                    default: withCtx(() => [
                                      createVNode(VSpacer),
                                      unref(settings)?.allow_registration ? (openBlock(), createBlock(VBtn, {
                                        key: 0,
                                        to: "/register",
                                        variant: "text",
                                        color: "orange"
                                      }, {
                                        default: withCtx(() => [
                                          createTextVNode(toDisplayString(_ctx.$t("login.not_registered")), 1)
                                        ]),
                                        _: 1
                                      })) : createCommentVNode("", true),
                                      createVNode(VBtn, {
                                        color: "success",
                                        type: "submit",
                                        variant: "outlined",
                                        disabled: !unref(valid) || unref(loading),
                                        loading: unref(loading)
                                      }, {
                                        default: withCtx(() => [
                                          createTextVNode(toDisplayString(_ctx.$t("common.login")), 1)
                                        ]),
                                        _: 1
                                      }, 8, ["disabled", "loading"])
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              })
                            ]),
                            _: 1
                          }, 8, ["modelValue", "onUpdate:modelValue"])
                        ];
                      }
                    }),
                    _: 1
                  }, _parent3, _scopeId2));
                } else {
                  return [
                    createVNode(VCol, {
                      class: "pa-0 pa-md-3",
                      cols: "12",
                      md: "6",
                      lg: "5",
                      xl: "4"
                    }, {
                      default: withCtx(() => [
                        createVNode(VForm, {
                          ref: "form",
                          modelValue: unref(valid),
                          "onUpdate:modelValue": ($event) => isRef(valid) ? valid.value = $event : null,
                          onSubmit: withModifiers(login, ["prevent"])
                        }, {
                          default: withCtx(() => [
                            createVNode(VCard, null, {
                              default: withCtx(() => [
                                createVNode(VCardTitle, null, {
                                  default: withCtx(() => [
                                    createTextVNode(toDisplayString(_ctx.$t("common.login")), 1)
                                  ]),
                                  _: 1
                                }),
                                createVNode(VCardSubtitle, null, {
                                  default: withCtx(() => [
                                    createVNode("span", {
                                      innerHTML: unref(t)("login.description")
                                    }, null, 8, ["innerHTML"])
                                  ]),
                                  _: 1
                                }),
                                createVNode(VCardText, null, {
                                  default: withCtx(() => [
                                    createVNode(VTextField, {
                                      ref_key: "emailInput",
                                      ref: emailInput,
                                      modelValue: unref(credentials).email,
                                      "onUpdate:modelValue": ($event) => unref(credentials).email = $event,
                                      "validate-on": "blur",
                                      rules: _ctx.$valid.email,
                                      autofocus: "",
                                      label: _ctx.$t("common.email")
                                    }, null, 8, ["modelValue", "onUpdate:modelValue", "rules", "label"]),
                                    createVNode(VTextField, {
                                      modelValue: unref(credentials).password,
                                      "onUpdate:modelValue": ($event) => unref(credentials).password = $event,
                                      rules: [_ctx.$valid.password],
                                      type: "password",
                                      label: _ctx.$t("common.password")
                                    }, null, 8, ["modelValue", "onUpdate:modelValue", "rules", "label"])
                                  ]),
                                  _: 1
                                }),
                                createVNode(VCardActions, null, {
                                  default: withCtx(() => [
                                    createVNode(VBtn, {
                                      variant: "text",
                                      tabindex: "1",
                                      size: "small",
                                      onClick: forgot
                                    }, {
                                      default: withCtx(() => [
                                        createTextVNode(toDisplayString(_ctx.$t("login.forgot_password")), 1)
                                      ]),
                                      _: 1
                                    })
                                  ]),
                                  _: 1
                                }),
                                createVNode(VCardActions, null, {
                                  default: withCtx(() => [
                                    createVNode(VSpacer),
                                    unref(settings)?.allow_registration ? (openBlock(), createBlock(VBtn, {
                                      key: 0,
                                      to: "/register",
                                      variant: "text",
                                      color: "orange"
                                    }, {
                                      default: withCtx(() => [
                                        createTextVNode(toDisplayString(_ctx.$t("login.not_registered")), 1)
                                      ]),
                                      _: 1
                                    })) : createCommentVNode("", true),
                                    createVNode(VBtn, {
                                      color: "success",
                                      type: "submit",
                                      variant: "outlined",
                                      disabled: !unref(valid) || unref(loading),
                                      loading: unref(loading)
                                    }, {
                                      default: withCtx(() => [
                                        createTextVNode(toDisplayString(_ctx.$t("common.login")), 1)
                                      ]),
                                      _: 1
                                    }, 8, ["disabled", "loading"])
                                  ]),
                                  _: 1
                                })
                              ]),
                              _: 1
                            })
                          ]),
                          _: 1
                        }, 8, ["modelValue", "onUpdate:modelValue"])
                      ]),
                      _: 1
                    })
                  ];
                }
              }),
              _: 1
            }, _parent2, _scopeId));
          } else {
            return [
              createVNode(VRow, {
                class: "mt-md-5 ma-0",
                justify: "center"
              }, {
                default: withCtx(() => [
                  createVNode(VCol, {
                    class: "pa-0 pa-md-3",
                    cols: "12",
                    md: "6",
                    lg: "5",
                    xl: "4"
                  }, {
                    default: withCtx(() => [
                      createVNode(VForm, {
                        ref: "form",
                        modelValue: unref(valid),
                        "onUpdate:modelValue": ($event) => isRef(valid) ? valid.value = $event : null,
                        onSubmit: withModifiers(login, ["prevent"])
                      }, {
                        default: withCtx(() => [
                          createVNode(VCard, null, {
                            default: withCtx(() => [
                              createVNode(VCardTitle, null, {
                                default: withCtx(() => [
                                  createTextVNode(toDisplayString(_ctx.$t("common.login")), 1)
                                ]),
                                _: 1
                              }),
                              createVNode(VCardSubtitle, null, {
                                default: withCtx(() => [
                                  createVNode("span", {
                                    innerHTML: unref(t)("login.description")
                                  }, null, 8, ["innerHTML"])
                                ]),
                                _: 1
                              }),
                              createVNode(VCardText, null, {
                                default: withCtx(() => [
                                  createVNode(VTextField, {
                                    ref_key: "emailInput",
                                    ref: emailInput,
                                    modelValue: unref(credentials).email,
                                    "onUpdate:modelValue": ($event) => unref(credentials).email = $event,
                                    "validate-on": "blur",
                                    rules: _ctx.$valid.email,
                                    autofocus: "",
                                    label: _ctx.$t("common.email")
                                  }, null, 8, ["modelValue", "onUpdate:modelValue", "rules", "label"]),
                                  createVNode(VTextField, {
                                    modelValue: unref(credentials).password,
                                    "onUpdate:modelValue": ($event) => unref(credentials).password = $event,
                                    rules: [_ctx.$valid.password],
                                    type: "password",
                                    label: _ctx.$t("common.password")
                                  }, null, 8, ["modelValue", "onUpdate:modelValue", "rules", "label"])
                                ]),
                                _: 1
                              }),
                              createVNode(VCardActions, null, {
                                default: withCtx(() => [
                                  createVNode(VBtn, {
                                    variant: "text",
                                    tabindex: "1",
                                    size: "small",
                                    onClick: forgot
                                  }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(_ctx.$t("login.forgot_password")), 1)
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              }),
                              createVNode(VCardActions, null, {
                                default: withCtx(() => [
                                  createVNode(VSpacer),
                                  unref(settings)?.allow_registration ? (openBlock(), createBlock(VBtn, {
                                    key: 0,
                                    to: "/register",
                                    variant: "text",
                                    color: "orange"
                                  }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(_ctx.$t("login.not_registered")), 1)
                                    ]),
                                    _: 1
                                  })) : createCommentVNode("", true),
                                  createVNode(VBtn, {
                                    color: "success",
                                    type: "submit",
                                    variant: "outlined",
                                    disabled: !unref(valid) || unref(loading),
                                    loading: unref(loading)
                                  }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(_ctx.$t("common.login")), 1)
                                    ]),
                                    _: 1
                                  }, 8, ["disabled", "loading"])
                                ]),
                                _: 1
                              })
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue", "onUpdate:modelValue"])
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              })
            ];
          }
        }),
        _: 1
      }, _parent));
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/login.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

export { _sfc_main as default };
