import { defineComponent, ref, reactive, mergeProps, unref, withCtx, createVNode, openBlock, createBlock, createTextVNode, toDisplayString, useSSRContext } from 'vue'; import { ssrRenderComponent, ssrRenderAttrs, ssrInterpolate } from 'vue/server-renderer'; import { u as useRouter$1, a as useConfigStore, b as useUserStore, f as generateOtp, d as api$1, v as verifyOtp, c as setToken, s as supabase, i as setPassword, j as setBirthday, k as setNames } from './server.mjs'; import OtpInput from 'vue3-otp-input'; import { B as BasicInput } from './BasicInput-CgQV_gT5.mjs'; import { B as BaseDatePicker, a as BaseDatePickerJalali } from './BaseDatePicker-D3_e-ycp.mjs'; import { B as BasicButton } from './BasicButton-7YIRCRg8.mjs'; import { B as BasicIconOld } from './BasicIconOld-Booq7UXp.mjs'; import { _ as __nuxt_component_1 } from './FormItem-Uo-Qw9vC.mjs'; import '../nitro/nitro.mjs'; import 'node:http'; import 'node:https'; import 'node:events'; import 'node:buffer'; import 'node:fs'; import 'node:path'; import 'node:crypto'; import 'node:url'; import 'consola'; import 'fast-xml-parser'; import 'ipx'; import 'pinia'; import '@supabase/supabase-js'; import 'axios'; import 'lodash-es'; import '@babel/runtime/helpers/esm/extends'; import '@babel/runtime/helpers/esm/objectSpread2'; import '@ant-design/colors'; import '@ctrl/tinycolor'; import 'stylis'; import 'vue-types'; import '@ant-design/icons-vue'; import 'unhead/utils'; import './usePrice-CFcNV1RQ.mjs'; import './index-D4HrLPqa.mjs'; import './FormItemContext-DTpHAXaY.mjs'; import './index-BTlbWWOl.mjs'; import 'lodash-es/isPlainObject.js'; import 'resize-observer-polyfill'; import './index-DN2Eqyc3.mjs'; import 'dom-align'; import 'moment-jalaali'; import 'dayjalali'; import './index-CnnQbQCE.mjs'; import './useMergedState-BZEfJ8Fl.mjs'; import './move-DCvQW68K.mjs'; import './shallowequal-CJsWvZb3.mjs'; import './_plugin-vue_export-helper-1tPrXgE0.mjs'; import './index-CO_xVqO1.mjs'; import 'throttle-debounce'; import 'lodash-es/cloneDeep.js'; import 'async-validator'; import 'lodash-es/find.js'; const _sfc_main$1 = /* @__PURE__ */ defineComponent({ __name: "index", __ssrInlineRender: true, setup(__props) { const router = useRouter$1(); const step = ref("mobile"); const config = useConfigStore(); const isBack = ref(false); const loading = ref(false); const user = useUserStore(); const form = reactive({ mobile: void 0, otp: void 0, password: void 0, first_name: void 0, last_name: void 0, birthday: void 0, agree: void 0 }); function handleOnChange(value) { } async function handleOnComplete(value) { form.otp = value; } const goNext = async () => { try { loading.value = true; if (step.value === "mobile") { const res = await generateOtp(form.mobile, "signup"); if (res?.user?.id) { api$1.error(config.useString("userHaveAccount")); router.push({ name: "auth-login" }); return; } isBack.value = false; step.value = "otp"; } else if (step.value === "otp") { const res = await verifyOtp(form.mobile, form.otp); console.log("res ===>", res); setToken(res.session.access_token); await supabase.auth.setSession(res.session); user.getUserInfo(); isBack.value = false; step.value = "password"; } else if (step.value === "password") { if (form.password.length < 6) { api$1.error(config.useString("minPassIs6")); return; } const res = await setPassword(form.password); isBack.value = false; step.value = "birthday"; } else if (step.value === "birthday") { const res = await setBirthday(form.birthday); isBack.value = false; step.value = "name"; } else if (step.value === "name") { const res = await setNames(form.first_name, form.last_name); isBack.value = false; step.value = "agree"; } else if (step.value === "agree") { await router.push({ name: "home" }); } } catch (e) { console.log("e ===>", e); } finally { loading.value = false; } }; return (_ctx, _push, _parent, _attrs) => { const _component_a_form_item = __nuxt_component_1; _push(`