import { defineComponent, ref, reactive, mergeProps, unref, withCtx, createVNode, createBlock, openBlock, createTextVNode, toDisplayString, useSSRContext } from 'vue'; import { ssrRenderComponent, ssrRenderAttrs, ssrInterpolate } from 'vue/server-renderer'; import { u as useRouter$1, a as useConfigStore, b as useUserStore, j as __nuxt_component_1$3, A as APP_Milady_Date, h as generateOtp, d as api$1, v as verifyOtp, c as setToken, s as supabase, k as setPassword, m as setBirthday, n as setNames } from './server.mjs'; import OtpInput from 'vue3-otp-input'; import { B as BasicInput } from './BasicInput-DvVrG0oq.mjs'; import { B as BaseDatePicker, a as BaseDatePickerJalali } from './BaseDatePicker-L5Qgd4FF.mjs'; import { B as BasicButton } from './BasicButton-B9iMRxfW.mjs'; import { B as BasicIconOld } from './BasicIconOld-93vAWohq.mjs'; import '../_/nitro.mjs'; import 'node:http'; import 'node:https'; import 'node:events'; import 'node:buffer'; import 'node:fs'; import 'node:url'; import 'consola'; import 'ipx'; import 'node:path'; import 'node:crypto'; import 'pinia'; import '@supabase/supabase-js'; 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 'lodash-es'; import 'axios'; import '@ant-design/icons-vue'; import 'resize-observer-polyfill'; import 'dom-align'; import 'lodash-es/uniq.js'; import 'lodash-es/pick.js'; import 'lodash-es/isPlainObject.js'; import 'lodash-es/debounce.js'; import 'lodash-es/cloneDeep.js'; import 'async-validator'; import 'lodash-es/find.js'; import 'lodash-es/isEqual.js'; import 'compute-scroll-into-view'; import 'lodash-es/intersection.js'; import 'lodash-es/omit.js'; import 'lodash-es/isNumber.js'; import 'throttle-debounce'; import 'lodash-es/fromPairs.js'; import 'lodash-es/partition.js'; import '../routes/renderer.mjs'; import 'vue-bundle-renderer/runtime'; import 'unhead/server'; import 'devalue'; import 'unhead/utils'; import './usePrice-B-5-jXKQ.mjs'; import 'moment-jalaali'; import 'dayjalali'; import './_plugin-vue_export-helper-1tPrXgE0.mjs'; 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$3; _push(`