@ozdao/prometheus-framework 0.1.16 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-2426cb6f.mjs +1945 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-579e2c7a.mjs +1945 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-c6aba800.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-cab2bcd2.js +1 -0
- package/dist/ButtonFollow-23c4d9fc.mjs +132 -0
- package/dist/ButtonFollow-351486b0.js +1 -0
- package/dist/ButtonFollow-3a05d29f.mjs +132 -0
- package/dist/ButtonFollow-bf5e6d42.js +1 -0
- package/dist/CardOrganization-4d22037e.js +1 -0
- package/dist/CardOrganization-63dcc83b.js +1 -0
- package/dist/CardOrganization-8c5b582b.mjs +230 -0
- package/dist/CardOrganization-e530c9d5.mjs +230 -0
- package/dist/Chips-3dac276c.js +1 -0
- package/dist/Feed-416d84b0.mjs +439 -0
- package/dist/Feed-44beaa4c.mjs +368 -0
- package/dist/Feed-4d9001aa.mjs +368 -0
- package/dist/Feed-51eef23f.js +1 -0
- package/dist/Feed-8a151970.js +1 -0
- package/dist/Feed-c9e6190e.js +1 -0
- package/dist/Feed-d78d4b91.mjs +439 -0
- package/dist/Feed-f4e9769e.js +1 -0
- package/dist/Gallery-1f82841a.mjs +357 -0
- package/dist/Gallery-9305f294.mjs +357 -0
- package/dist/Gallery-dd29c7f6.js +1 -0
- package/dist/Gallery-dea27e94.js +1 -0
- package/dist/Image-22e17cef.js +9 -0
- package/dist/Image-a2c2ab9c.js +9 -0
- package/dist/Image-ad6d4f0f.mjs +477 -0
- package/dist/Image-c0ae2c5f.mjs +477 -0
- package/dist/Popup-383abb2e.js +1 -0
- package/dist/Popup-ad5f59d0.js +1 -0
- package/dist/Popup-e7c9a43e.mjs +76 -0
- package/dist/Popup-f7a5e86b.mjs +76 -0
- package/dist/Product-2d05acc8.mjs +839 -0
- package/dist/Product-b32fb0e1.js +7 -0
- package/dist/Product-d01e3a0d.mjs +839 -0
- package/dist/Product-d9c3b9b9.js +7 -0
- package/dist/ProductEdit-2b4d1d88.js +1 -0
- package/dist/ProductEdit-5e479343.mjs +300 -0
- package/dist/ProductEdit-ab0530e8.js +1 -0
- package/dist/ProductEdit-aca44ef7.mjs +300 -0
- package/dist/ProfileBlogposts-070cb7e9.mjs +65 -0
- package/dist/ProfileBlogposts-2063c511.mjs +65 -0
- package/dist/ProfileBlogposts-b6bf0c42.js +1 -0
- package/dist/ProfileBlogposts-eaecd267.js +1 -0
- package/dist/ProfileComments-1ae70859.js +1 -0
- package/dist/ProfileComments-78231e6a.mjs +44 -0
- package/dist/ProfileComments-8a0c489c.mjs +44 -0
- package/dist/ProfileComments-f0000ea6.js +1 -0
- package/dist/ProfileEvents-4a2fa422.mjs +57 -0
- package/dist/ProfileEvents-8b88287a.js +1 -0
- package/dist/ProfileEvents-90448f97.js +1 -0
- package/dist/ProfileEvents-d978617d.mjs +57 -0
- package/dist/ProfileLikes-74c78a16.mjs +44 -0
- package/dist/ProfileLikes-b48ce0ef.js +1 -0
- package/dist/ProfileLikes-d5f9f058.js +1 -0
- package/dist/ProfileLikes-f5ad4497.mjs +44 -0
- package/dist/ProfileOrganizations-422d1fa5.js +1 -0
- package/dist/ProfileOrganizations-43710687.js +1 -0
- package/dist/ProfileOrganizations-6b1bc5b2.mjs +213 -0
- package/dist/ProfileOrganizations-cf8a12f5.mjs +213 -0
- package/dist/Publics-5472f70c.mjs +123 -0
- package/dist/Publics-640d32fc.mjs +123 -0
- package/dist/Publics-71b9efbe.js +1 -0
- package/dist/Publics-8595ab7e.js +1 -0
- package/dist/Socials-43293869.js +1 -0
- package/dist/Tab-dcd62005.js +1 -0
- package/dist/UploadImage-0f488170.js +1 -0
- package/dist/UploadImage-3c627d89.mjs +83 -0
- package/dist/UploadImage-dfb36cdb.js +1 -0
- package/dist/UploadImage-e4418b43.mjs +83 -0
- package/dist/UploadImageMultiple-c9a7b54f.js +1 -0
- package/dist/UploadImageMultiple-cb6c7188.mjs +58 -0
- package/dist/UploadImageMultiple-d2d48f39.mjs +58 -0
- package/dist/UploadImageMultiple-eddaac87.js +1 -0
- package/dist/auth-4415a97a.js +7 -0
- package/dist/auth-45a454f2.js +7 -0
- package/dist/auth-5cd34aae.mjs +905 -0
- package/dist/auth-afa25b86.mjs +905 -0
- package/dist/auth.client.cjs +8 -8
- package/dist/auth.client.js +16 -15
- package/dist/auth.validation-3e93dc23.mjs +20 -0
- package/dist/auth.validation-4b016fa5.js +1 -0
- package/dist/auth.validation-a17cd085.js +1 -0
- package/dist/auth.validation-a52304cf.mjs +20 -0
- package/dist/backoffice.client.cjs +1 -0
- package/dist/backoffice.client.js +69 -0
- package/dist/carousel.es-cdfb392c.js +5 -0
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +23 -22
- package/dist/components/EditImages/EditImages.vue.d.ts +7 -0
- package/dist/components/FieldPhone/FieldPhone(script-setup).vue.d.ts +3 -3
- package/dist/components/FieldPhone/FieldPhone.vue.d.ts +1 -1
- package/dist/events.client.cjs +2 -2
- package/dist/events.client.js +17 -16
- package/dist/files.server.js +149 -112
- package/dist/files.server.mjs +149 -112
- package/dist/gallery.server.js +148 -0
- package/dist/gallery.server.mjs +149 -0
- package/dist/index-2059e444.js +2 -0
- package/dist/index-4e469a71.mjs +941 -0
- package/dist/index-a661083c.mjs +934 -0
- package/dist/index-b41aac19.js +2 -0
- package/dist/landing.client.cjs +1 -1
- package/dist/modules/gallery/components/sections/Gallery.vue.d.ts +2 -0
- package/dist/modules/icons/navigation/IconChevronRight.vue.d.ts +13 -1
- package/dist/modules/mobile/components/Menu/MenuItem.vue.d.ts +14 -2
- package/dist/organizations-65937ba4.js +1 -0
- package/dist/organizations-81e762e7.mjs +122 -0
- package/dist/organizations-af965fcf.mjs +122 -0
- package/dist/organizations-cf1ab766.js +1 -0
- package/dist/organizations.client-1e9361ec.js +3 -0
- package/dist/organizations.client-43816e25.mjs +3018 -0
- package/dist/organizations.client-b692a78a.mjs +3018 -0
- package/dist/organizations.client-bdc9b044.js +3 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +44 -43
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +224 -184
- package/dist/vue-draggable-next.esm-bundler-21a209c6.js +10 -0
- package/dist/vuex.esm-bundler-685cf29f.js +5 -0
- package/package.json +10 -1
- package/src/components/EditImages/EditImages.vue +55 -0
- package/src/configurator/components/layouts/layoutConfigurator.vue +0 -40
- package/src/modules/backoffice/backoffice.client.js +15 -0
- package/src/modules/backoffice/components/layouts/Account.vue +48 -58
- package/src/modules/backoffice/router/backoffice.js +20 -0
- package/src/modules/files/controllers/files.controller.js +27 -131
- package/src/modules/files/middlewares/server/index.js +10 -0
- package/src/modules/files/middlewares/server/md.js +151 -0
- package/src/modules/files/middlewares/server/middlewareMulter.js +121 -0
- package/src/modules/files/routes/files.routes.js +20 -6
- package/src/modules/gallery/components/sections/Gallery.vue +414 -0
- package/src/modules/gallery/controllers/gallery.controller.js +87 -73
- package/src/modules/gallery/gallery.client.js +17 -0
- package/src/modules/gallery/gallery.server.js +13 -0
- package/src/modules/gallery/models/photo.model.js +20 -14
- package/src/modules/gallery/routes/gallery.routes.js +18 -9
- package/src/modules/gallery/store/gallery.js +25 -19
- package/src/modules/icons/navigation/IconChevronRight.vue +14 -2
- package/src/modules/mobile/components/Menu/Menu.vue +1 -1
- package/src/modules/mobile/components/Menu/MenuItem.vue +8 -2
- package/src/modules/users/components/pages/Profile.vue +22 -1
- package/src/modules/backoffice/components/pages/Profile.vue +0 -109
- package/src/modules/backoffice/components/pages/profile/ProfileEdit.vue +0 -132
@@ -0,0 +1,905 @@
|
|
1
|
+
import { ref as M, openBlock as P, createElementBlock as C, Fragment as we, createElementVNode as d, normalizeClass as ye, toDisplayString as Y, createCommentVNode as A, createVNode as D, Transition as B, withCtx as N, withModifiers as Pe, renderSlot as Ce, createTextVNode as I, reactive as ae, watch as re } from "vue";
|
2
|
+
import { _ as _e } from "./_plugin-vue_export-helper-dad06003.mjs";
|
3
|
+
import { g as ke, a as oe } from "./index-a661083c.mjs";
|
4
|
+
import { s as S } from "./globals-96ba60e4.mjs";
|
5
|
+
const xe = {
|
6
|
+
key: 0,
|
7
|
+
class: "t-transp mn-r-small"
|
8
|
+
}, Oe = { class: "w-100" }, Le = ["type", "value", "placeholder"], Ee = ["value", "placeholder"], je = {
|
9
|
+
key: 0,
|
10
|
+
class: "mn-t-thin mn-thin mn-b-thin invalid-feedback"
|
11
|
+
}, Se = {
|
12
|
+
__name: "Field",
|
13
|
+
props: {
|
14
|
+
label: null,
|
15
|
+
type: "text",
|
16
|
+
placeholder: "Enter something here",
|
17
|
+
field: null,
|
18
|
+
validation: !1,
|
19
|
+
disabled: !1
|
20
|
+
},
|
21
|
+
emits: ["update:field", "focus", "blur"],
|
22
|
+
setup(t, { emit: e }) {
|
23
|
+
const r = M(t.field);
|
24
|
+
return (a, s) => (P(), C(we, null, [
|
25
|
+
d("div", {
|
26
|
+
class: ye([[a.$attrs.class, { "bg-fourth-nano": t.validation }], "flex-center flex-nowrap flex"])
|
27
|
+
}, [
|
28
|
+
t.label ? (P(), C("div", xe, [
|
29
|
+
d("span", null, Y(t.label), 1)
|
30
|
+
])) : A("", !0),
|
31
|
+
d("div", Oe, [
|
32
|
+
t.type !== "textarea" ? (P(), C("input", {
|
33
|
+
key: 0,
|
34
|
+
onInput: s[0] || (s[0] = (o) => r.value = e("update:field", o.target.value)),
|
35
|
+
onFocus: s[1] || (s[1] = (o) => e("focus", o)),
|
36
|
+
onBlur: s[2] || (s[2] = (o) => e("blur", o)),
|
37
|
+
type: t.type,
|
38
|
+
class: "w-100",
|
39
|
+
value: t.field,
|
40
|
+
placeholder: t.placeholder
|
41
|
+
}, null, 40, Le)) : (P(), C("textarea", {
|
42
|
+
key: 1,
|
43
|
+
onInput: s[3] || (s[3] = (o) => r.value = e("update:field", o.target.value)),
|
44
|
+
onFocus: s[4] || (s[4] = (o) => e("focus", o)),
|
45
|
+
onBlur: s[5] || (s[5] = (o) => e("blur", o)),
|
46
|
+
class: "w-100",
|
47
|
+
value: t.field,
|
48
|
+
placeholder: t.placeholder
|
49
|
+
}, null, 40, Ee))
|
50
|
+
])
|
51
|
+
], 2),
|
52
|
+
D(B, { name: "fade" }, {
|
53
|
+
default: N(() => [
|
54
|
+
t.validation ? (P(), C("div", je, " * " + Y(t.validation.message), 1)) : A("", !0)
|
55
|
+
]),
|
56
|
+
_: 1
|
57
|
+
})
|
58
|
+
], 64));
|
59
|
+
}
|
60
|
+
}, it = /* @__PURE__ */ _e(Se, [["__scopeId", "data-v-e4056b41"]]);
|
61
|
+
const $e = ["onClick", "disabled"], Ue = { key: 0 }, Ae = {
|
62
|
+
key: 0,
|
63
|
+
class: "loading"
|
64
|
+
}, Te = /* @__PURE__ */ d("span", null, [
|
65
|
+
/* @__PURE__ */ d("svg", {
|
66
|
+
class: "i-small",
|
67
|
+
width: "135",
|
68
|
+
height: "140",
|
69
|
+
viewBox: "0 0 135 140",
|
70
|
+
xmlns: "http://www.w3.org/2000/svg",
|
71
|
+
fill: "#fff"
|
72
|
+
}, [
|
73
|
+
/* @__PURE__ */ d("rect", {
|
74
|
+
y: "10",
|
75
|
+
width: "15",
|
76
|
+
height: "120",
|
77
|
+
rx: "6"
|
78
|
+
}, [
|
79
|
+
/* @__PURE__ */ d("animate", {
|
80
|
+
attributeName: "height",
|
81
|
+
begin: "0.5s",
|
82
|
+
dur: "1s",
|
83
|
+
values: "120;110;100;90;80;70;60;50;40;140;120",
|
84
|
+
calcMode: "linear",
|
85
|
+
repeatCount: "indefinite"
|
86
|
+
}),
|
87
|
+
/* @__PURE__ */ I(),
|
88
|
+
/* @__PURE__ */ d("animate", {
|
89
|
+
attributeName: "y",
|
90
|
+
begin: "0.5s",
|
91
|
+
dur: "1s",
|
92
|
+
values: "10;15;20;25;30;35;40;45;50;0;10",
|
93
|
+
calcMode: "linear",
|
94
|
+
repeatCount: "indefinite"
|
95
|
+
})
|
96
|
+
]),
|
97
|
+
/* @__PURE__ */ d("rect", {
|
98
|
+
x: "30",
|
99
|
+
y: "10",
|
100
|
+
width: "15",
|
101
|
+
height: "120",
|
102
|
+
rx: "6"
|
103
|
+
}, [
|
104
|
+
/* @__PURE__ */ d("animate", {
|
105
|
+
attributeName: "height",
|
106
|
+
begin: "0.25s",
|
107
|
+
dur: "1s",
|
108
|
+
values: "120;110;100;90;80;70;60;50;40;140;120",
|
109
|
+
calcMode: "linear",
|
110
|
+
repeatCount: "indefinite"
|
111
|
+
}),
|
112
|
+
/* @__PURE__ */ I(),
|
113
|
+
/* @__PURE__ */ d("animate", {
|
114
|
+
attributeName: "y",
|
115
|
+
begin: "0.25s",
|
116
|
+
dur: "1s",
|
117
|
+
values: "10;15;20;25;30;35;40;45;50;0;10",
|
118
|
+
calcMode: "linear",
|
119
|
+
repeatCount: "indefinite"
|
120
|
+
})
|
121
|
+
]),
|
122
|
+
/* @__PURE__ */ d("rect", {
|
123
|
+
x: "60",
|
124
|
+
width: "15",
|
125
|
+
height: "140",
|
126
|
+
rx: "6"
|
127
|
+
}, [
|
128
|
+
/* @__PURE__ */ d("animate", {
|
129
|
+
attributeName: "height",
|
130
|
+
begin: "0s",
|
131
|
+
dur: "1s",
|
132
|
+
values: "120;110;100;90;80;70;60;50;40;140;120",
|
133
|
+
calcMode: "linear",
|
134
|
+
repeatCount: "indefinite"
|
135
|
+
}),
|
136
|
+
/* @__PURE__ */ I(),
|
137
|
+
/* @__PURE__ */ d("animate", {
|
138
|
+
attributeName: "y",
|
139
|
+
begin: "0s",
|
140
|
+
dur: "1s",
|
141
|
+
values: "10;15;20;25;30;35;40;45;50;0;10",
|
142
|
+
calcMode: "linear",
|
143
|
+
repeatCount: "indefinite"
|
144
|
+
})
|
145
|
+
]),
|
146
|
+
/* @__PURE__ */ d("rect", {
|
147
|
+
x: "90",
|
148
|
+
y: "10",
|
149
|
+
width: "15",
|
150
|
+
height: "120",
|
151
|
+
rx: "6"
|
152
|
+
}, [
|
153
|
+
/* @__PURE__ */ d("animate", {
|
154
|
+
attributeName: "height",
|
155
|
+
begin: "0.25s",
|
156
|
+
dur: "1s",
|
157
|
+
values: "120;110;100;90;80;70;60;50;40;140;120",
|
158
|
+
calcMode: "linear",
|
159
|
+
repeatCount: "indefinite"
|
160
|
+
}),
|
161
|
+
/* @__PURE__ */ I(),
|
162
|
+
/* @__PURE__ */ d("animate", {
|
163
|
+
attributeName: "y",
|
164
|
+
begin: "0.25s",
|
165
|
+
dur: "1s",
|
166
|
+
values: "10;15;20;25;30;35;40;45;50;0;10",
|
167
|
+
calcMode: "linear",
|
168
|
+
repeatCount: "indefinite"
|
169
|
+
})
|
170
|
+
]),
|
171
|
+
/* @__PURE__ */ d("rect", {
|
172
|
+
x: "120",
|
173
|
+
y: "10",
|
174
|
+
width: "15",
|
175
|
+
height: "120",
|
176
|
+
rx: "6"
|
177
|
+
}, [
|
178
|
+
/* @__PURE__ */ d("animate", {
|
179
|
+
attributeName: "height",
|
180
|
+
begin: "0.5s",
|
181
|
+
dur: "1s",
|
182
|
+
values: "120;110;100;90;80;70;60;50;40;140;120",
|
183
|
+
calcMode: "linear",
|
184
|
+
repeatCount: "indefinite"
|
185
|
+
}),
|
186
|
+
/* @__PURE__ */ I(),
|
187
|
+
/* @__PURE__ */ d("animate", {
|
188
|
+
attributeName: "y",
|
189
|
+
begin: "0.5s",
|
190
|
+
dur: "1s",
|
191
|
+
values: "10;15;20;25;30;35;40;45;50;0;10",
|
192
|
+
calcMode: "linear",
|
193
|
+
repeatCount: "indefinite"
|
194
|
+
})
|
195
|
+
])
|
196
|
+
])
|
197
|
+
], -1), Re = [
|
198
|
+
Te
|
199
|
+
], Ie = {
|
200
|
+
key: 0,
|
201
|
+
class: "h4 loading"
|
202
|
+
}, Me = /* @__PURE__ */ d("span", { class: "p-small t-white" }, "✔", -1), De = [
|
203
|
+
Me
|
204
|
+
], Be = {
|
205
|
+
key: 0,
|
206
|
+
class: "error"
|
207
|
+
}, lt = {
|
208
|
+
__name: "Button",
|
209
|
+
props: {
|
210
|
+
submit: {
|
211
|
+
type: Function,
|
212
|
+
default: async () => {
|
213
|
+
console.log("Button click.");
|
214
|
+
}
|
215
|
+
},
|
216
|
+
callback: {
|
217
|
+
type: Function,
|
218
|
+
default: async () => {
|
219
|
+
console.log("Button callback.");
|
220
|
+
}
|
221
|
+
},
|
222
|
+
callbackDelay: {
|
223
|
+
type: Number,
|
224
|
+
default: 750
|
225
|
+
},
|
226
|
+
validation: {
|
227
|
+
type: Boolean,
|
228
|
+
default: !1
|
229
|
+
}
|
230
|
+
},
|
231
|
+
setup(t) {
|
232
|
+
const e = t, n = M(null), r = M(null), a = M(!1), s = M(!1);
|
233
|
+
async function o() {
|
234
|
+
n.value.style["pointer-events"] = "none", r.value = null, a.value = !0;
|
235
|
+
try {
|
236
|
+
await e.submit(), n.value.classList.replace("bg-main", "bg-light-main"), a.value = !1, s.value = !0, setTimeout(() => {
|
237
|
+
n.value && (n.value.classList.replace("bg-light-main", "bg-main"), n.value.style.pointerEvents = "auto", a.value = !1, s.value = !1, r.value = null);
|
238
|
+
}, 500), e.callback && setTimeout(() => e.callback(), e.callbackDelay);
|
239
|
+
} catch {
|
240
|
+
n.value.classList.replace("bg-main", "bg-fourth-nano"), r.value = "❌", setTimeout(() => {
|
241
|
+
n.value.classList.replace("bg-fourth-nano", "bg-main"), n.value.style.pointerEvents = "auto", a.value = !1, s.value = !1, r.value = null;
|
242
|
+
}, 1330);
|
243
|
+
}
|
244
|
+
}
|
245
|
+
return (i, u) => (P(), C("button", {
|
246
|
+
onClick: Pe(o, ["stop"]),
|
247
|
+
disabled: t.validation,
|
248
|
+
ref_key: "button",
|
249
|
+
ref: n,
|
250
|
+
class: "w-100 bg-main button"
|
251
|
+
}, [
|
252
|
+
D(B, {
|
253
|
+
mode: "out-in",
|
254
|
+
name: "fadeIn"
|
255
|
+
}, {
|
256
|
+
default: N(() => [
|
257
|
+
!a.value && !r.value && !s.value ? (P(), C("span", Ue, [
|
258
|
+
Ce(i.$slots, "default")
|
259
|
+
])) : A("", !0)
|
260
|
+
]),
|
261
|
+
_: 3
|
262
|
+
}),
|
263
|
+
D(B, {
|
264
|
+
mode: "out-in",
|
265
|
+
name: "fadeIn"
|
266
|
+
}, {
|
267
|
+
default: N(() => [
|
268
|
+
a.value && !r.value ? (P(), C("div", Ae, Re)) : A("", !0)
|
269
|
+
]),
|
270
|
+
_: 1
|
271
|
+
}),
|
272
|
+
D(B, {
|
273
|
+
mode: "out-in",
|
274
|
+
name: "fadeIn"
|
275
|
+
}, {
|
276
|
+
default: N(() => [
|
277
|
+
s.value ? (P(), C("div", Ie, De)) : A("", !0)
|
278
|
+
]),
|
279
|
+
_: 1
|
280
|
+
}),
|
281
|
+
D(B, {
|
282
|
+
mode: "out-in",
|
283
|
+
name: "fadeIn"
|
284
|
+
}, {
|
285
|
+
default: N(() => [
|
286
|
+
r.value ? (P(), C("div", Be, [
|
287
|
+
d("span", null, Y(r.value), 1)
|
288
|
+
])) : A("", !0)
|
289
|
+
]),
|
290
|
+
_: 1
|
291
|
+
})
|
292
|
+
], 8, $e));
|
293
|
+
}
|
294
|
+
};
|
295
|
+
var ie = { exports: {} };
|
296
|
+
/*!
|
297
|
+
* JavaScript Cookie v2.2.1
|
298
|
+
* https://github.com/js-cookie/js-cookie
|
299
|
+
*
|
300
|
+
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
301
|
+
* Released under the MIT license
|
302
|
+
*/
|
303
|
+
(function(t, e) {
|
304
|
+
(function(n) {
|
305
|
+
var r;
|
306
|
+
if (t.exports = n(), r = !0, !r) {
|
307
|
+
var a = window.Cookies, s = window.Cookies = n();
|
308
|
+
s.noConflict = function() {
|
309
|
+
return window.Cookies = a, s;
|
310
|
+
};
|
311
|
+
}
|
312
|
+
})(function() {
|
313
|
+
function n() {
|
314
|
+
for (var s = 0, o = {}; s < arguments.length; s++) {
|
315
|
+
var i = arguments[s];
|
316
|
+
for (var u in i)
|
317
|
+
o[u] = i[u];
|
318
|
+
}
|
319
|
+
return o;
|
320
|
+
}
|
321
|
+
function r(s) {
|
322
|
+
return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
|
323
|
+
}
|
324
|
+
function a(s) {
|
325
|
+
function o() {
|
326
|
+
}
|
327
|
+
function i(l, m, c) {
|
328
|
+
if (!(typeof document > "u")) {
|
329
|
+
c = n({
|
330
|
+
path: "/"
|
331
|
+
}, o.defaults, c), typeof c.expires == "number" && (c.expires = new Date(/* @__PURE__ */ new Date() * 1 + c.expires * 864e5)), c.expires = c.expires ? c.expires.toUTCString() : "";
|
332
|
+
try {
|
333
|
+
var _ = JSON.stringify(m);
|
334
|
+
/^[\{\[]/.test(_) && (m = _);
|
335
|
+
} catch {
|
336
|
+
}
|
337
|
+
m = s.write ? s.write(m, l) : encodeURIComponent(String(m)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), l = encodeURIComponent(String(l)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape);
|
338
|
+
var k = "";
|
339
|
+
for (var x in c)
|
340
|
+
c[x] && (k += "; " + x, c[x] !== !0 && (k += "=" + c[x].split(";")[0]));
|
341
|
+
return document.cookie = l + "=" + m + k;
|
342
|
+
}
|
343
|
+
}
|
344
|
+
function u(l, m) {
|
345
|
+
if (!(typeof document > "u")) {
|
346
|
+
for (var c = {}, _ = document.cookie ? document.cookie.split("; ") : [], k = 0; k < _.length; k++) {
|
347
|
+
var x = _[k].split("="), b = x.slice(1).join("=");
|
348
|
+
!m && b.charAt(0) === '"' && (b = b.slice(1, -1));
|
349
|
+
try {
|
350
|
+
var R = r(x[0]);
|
351
|
+
if (b = (s.read || s)(b, R) || r(b), m)
|
352
|
+
try {
|
353
|
+
b = JSON.parse(b);
|
354
|
+
} catch {
|
355
|
+
}
|
356
|
+
if (c[R] = b, l === R)
|
357
|
+
break;
|
358
|
+
} catch {
|
359
|
+
}
|
360
|
+
}
|
361
|
+
return l ? c[l] : c;
|
362
|
+
}
|
363
|
+
}
|
364
|
+
return o.set = i, o.get = function(l) {
|
365
|
+
return u(
|
366
|
+
l,
|
367
|
+
!1
|
368
|
+
/* read as raw */
|
369
|
+
);
|
370
|
+
}, o.getJSON = function(l) {
|
371
|
+
return u(
|
372
|
+
l,
|
373
|
+
!0
|
374
|
+
/* read as json */
|
375
|
+
);
|
376
|
+
}, o.remove = function(l, m) {
|
377
|
+
i(l, "", n(m, {
|
378
|
+
expires: -1
|
379
|
+
}));
|
380
|
+
}, o.defaults = {}, o.withConverter = a, o;
|
381
|
+
}
|
382
|
+
return a(function() {
|
383
|
+
});
|
384
|
+
});
|
385
|
+
})(ie);
|
386
|
+
var Ne = ie.exports;
|
387
|
+
const J = /* @__PURE__ */ ke(Ne);
|
388
|
+
/*! Capacitor: https://capacitorjs.com/ - MIT License */
|
389
|
+
const Fe = (t) => {
|
390
|
+
const e = /* @__PURE__ */ new Map();
|
391
|
+
e.set("web", { name: "web" });
|
392
|
+
const n = t.CapacitorPlatforms || {
|
393
|
+
currentPlatform: { name: "web" },
|
394
|
+
platforms: e
|
395
|
+
}, r = (s, o) => {
|
396
|
+
n.platforms.set(s, o);
|
397
|
+
}, a = (s) => {
|
398
|
+
n.platforms.has(s) && (n.currentPlatform = n.platforms.get(s));
|
399
|
+
};
|
400
|
+
return n.addPlatform = r, n.setPlatform = a, n;
|
401
|
+
}, He = (t) => t.CapacitorPlatforms = Fe(t), le = /* @__PURE__ */ He(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
|
402
|
+
le.addPlatform;
|
403
|
+
le.setPlatform;
|
404
|
+
var T;
|
405
|
+
(function(t) {
|
406
|
+
t.Unimplemented = "UNIMPLEMENTED", t.Unavailable = "UNAVAILABLE";
|
407
|
+
})(T || (T = {}));
|
408
|
+
class Q extends Error {
|
409
|
+
constructor(e, n, r) {
|
410
|
+
super(e), this.message = e, this.code = n, this.data = r;
|
411
|
+
}
|
412
|
+
}
|
413
|
+
const We = (t) => {
|
414
|
+
var e, n;
|
415
|
+
return t != null && t.androidBridge ? "android" : !((n = (e = t == null ? void 0 : t.webkit) === null || e === void 0 ? void 0 : e.messageHandlers) === null || n === void 0) && n.bridge ? "ios" : "web";
|
416
|
+
}, Ve = (t) => {
|
417
|
+
var e, n, r, a, s;
|
418
|
+
const o = t.CapacitorCustomPlatform || null, i = t.Capacitor || {}, u = i.Plugins = i.Plugins || {}, l = t.CapacitorPlatforms, m = () => o !== null ? o.name : We(t), c = ((e = l == null ? void 0 : l.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || m, _ = () => c() !== "web", k = ((n = l == null ? void 0 : l.currentPlatform) === null || n === void 0 ? void 0 : n.isNativePlatform) || _, x = (f) => {
|
419
|
+
const p = z.get(f);
|
420
|
+
return !!(p != null && p.platforms.has(c()) || W(f));
|
421
|
+
}, b = ((r = l == null ? void 0 : l.currentPlatform) === null || r === void 0 ? void 0 : r.isPluginAvailable) || x, R = (f) => {
|
422
|
+
var p;
|
423
|
+
return (p = i.PluginHeaders) === null || p === void 0 ? void 0 : p.find(($) => $.name === f);
|
424
|
+
}, W = ((a = l == null ? void 0 : l.currentPlatform) === null || a === void 0 ? void 0 : a.getPluginHeader) || R, fe = (f) => t.console.error(f), pe = (f, p, $) => Promise.reject(`${$} does not have an implementation of "${p}".`), z = /* @__PURE__ */ new Map(), me = (f, p = {}) => {
|
425
|
+
const $ = z.get(f);
|
426
|
+
if ($)
|
427
|
+
return console.warn(`Capacitor plugin "${f}" already registered. Cannot register plugins twice.`), $.proxy;
|
428
|
+
const j = c(), U = W(f);
|
429
|
+
let O;
|
430
|
+
const ve = async () => (!O && j in p ? O = typeof p[j] == "function" ? O = await p[j]() : O = p[j] : o !== null && !O && "web" in p && (O = typeof p.web == "function" ? O = await p.web() : O = p.web), O), he = (g, h) => {
|
431
|
+
var y, L;
|
432
|
+
if (U) {
|
433
|
+
const E = U == null ? void 0 : U.methods.find((w) => h === w.name);
|
434
|
+
if (E)
|
435
|
+
return E.rtype === "promise" ? (w) => i.nativePromise(f, h.toString(), w) : (w, V) => i.nativeCallback(f, h.toString(), w, V);
|
436
|
+
if (g)
|
437
|
+
return (y = g[h]) === null || y === void 0 ? void 0 : y.bind(g);
|
438
|
+
} else {
|
439
|
+
if (g)
|
440
|
+
return (L = g[h]) === null || L === void 0 ? void 0 : L.bind(g);
|
441
|
+
throw new Q(`"${f}" plugin is not implemented on ${j}`, T.Unimplemented);
|
442
|
+
}
|
443
|
+
}, K = (g) => {
|
444
|
+
let h;
|
445
|
+
const y = (...L) => {
|
446
|
+
const E = ve().then((w) => {
|
447
|
+
const V = he(w, g);
|
448
|
+
if (V) {
|
449
|
+
const q = V(...L);
|
450
|
+
return h = q == null ? void 0 : q.remove, q;
|
451
|
+
} else
|
452
|
+
throw new Q(`"${f}.${g}()" is not implemented on ${j}`, T.Unimplemented);
|
453
|
+
});
|
454
|
+
return g === "addListener" && (E.remove = async () => h()), E;
|
455
|
+
};
|
456
|
+
return y.toString = () => `${g.toString()}() { [capacitor code] }`, Object.defineProperty(y, "name", {
|
457
|
+
value: g,
|
458
|
+
writable: !1,
|
459
|
+
configurable: !1
|
460
|
+
}), y;
|
461
|
+
}, ee = K("addListener"), te = K("removeListener"), be = (g, h) => {
|
462
|
+
const y = ee({ eventName: g }, h), L = async () => {
|
463
|
+
const w = await y;
|
464
|
+
te({
|
465
|
+
eventName: g,
|
466
|
+
callbackId: w
|
467
|
+
}, h);
|
468
|
+
}, E = new Promise((w) => y.then(() => w({ remove: L })));
|
469
|
+
return E.remove = async () => {
|
470
|
+
console.warn("Using addListener() without 'await' is deprecated."), await L();
|
471
|
+
}, E;
|
472
|
+
}, Z = new Proxy({}, {
|
473
|
+
get(g, h) {
|
474
|
+
switch (h) {
|
475
|
+
case "$$typeof":
|
476
|
+
return;
|
477
|
+
case "toJSON":
|
478
|
+
return () => ({});
|
479
|
+
case "addListener":
|
480
|
+
return U ? be : ee;
|
481
|
+
case "removeListener":
|
482
|
+
return te;
|
483
|
+
default:
|
484
|
+
return K(h);
|
485
|
+
}
|
486
|
+
}
|
487
|
+
});
|
488
|
+
return u[f] = Z, z.set(f, {
|
489
|
+
name: f,
|
490
|
+
proxy: Z,
|
491
|
+
platforms: /* @__PURE__ */ new Set([
|
492
|
+
...Object.keys(p),
|
493
|
+
...U ? [j] : []
|
494
|
+
])
|
495
|
+
}), Z;
|
496
|
+
}, ge = ((s = l == null ? void 0 : l.currentPlatform) === null || s === void 0 ? void 0 : s.registerPlugin) || me;
|
497
|
+
return i.convertFileSrc || (i.convertFileSrc = (f) => f), i.getPlatform = c, i.handleError = fe, i.isNativePlatform = k, i.isPluginAvailable = b, i.pluginMethodNoop = pe, i.registerPlugin = ge, i.Exception = Q, i.DEBUG = !!i.DEBUG, i.isLoggingEnabled = !!i.isLoggingEnabled, i.platform = i.getPlatform(), i.isNative = i.isNativePlatform(), i;
|
498
|
+
}, qe = (t) => t.Capacitor = Ve(t), G = /* @__PURE__ */ qe(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {}), ce = G.registerPlugin;
|
499
|
+
G.Plugins;
|
500
|
+
class de {
|
501
|
+
constructor(e) {
|
502
|
+
this.listeners = {}, this.windowListeners = {}, e && (console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`), this.config = e);
|
503
|
+
}
|
504
|
+
addListener(e, n) {
|
505
|
+
this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(n);
|
506
|
+
const a = this.windowListeners[e];
|
507
|
+
a && !a.registered && this.addWindowListener(a);
|
508
|
+
const s = async () => this.removeListener(e, n), o = Promise.resolve({ remove: s });
|
509
|
+
return Object.defineProperty(o, "remove", {
|
510
|
+
value: async () => {
|
511
|
+
console.warn("Using addListener() without 'await' is deprecated."), await s();
|
512
|
+
}
|
513
|
+
}), o;
|
514
|
+
}
|
515
|
+
async removeAllListeners() {
|
516
|
+
this.listeners = {};
|
517
|
+
for (const e in this.windowListeners)
|
518
|
+
this.removeWindowListener(this.windowListeners[e]);
|
519
|
+
this.windowListeners = {};
|
520
|
+
}
|
521
|
+
notifyListeners(e, n) {
|
522
|
+
const r = this.listeners[e];
|
523
|
+
r && r.forEach((a) => a(n));
|
524
|
+
}
|
525
|
+
hasListeners(e) {
|
526
|
+
return !!this.listeners[e].length;
|
527
|
+
}
|
528
|
+
registerWindowListener(e, n) {
|
529
|
+
this.windowListeners[n] = {
|
530
|
+
registered: !1,
|
531
|
+
windowEventName: e,
|
532
|
+
pluginEventName: n,
|
533
|
+
handler: (r) => {
|
534
|
+
this.notifyListeners(n, r);
|
535
|
+
}
|
536
|
+
};
|
537
|
+
}
|
538
|
+
unimplemented(e = "not implemented") {
|
539
|
+
return new G.Exception(e, T.Unimplemented);
|
540
|
+
}
|
541
|
+
unavailable(e = "not available") {
|
542
|
+
return new G.Exception(e, T.Unavailable);
|
543
|
+
}
|
544
|
+
async removeListener(e, n) {
|
545
|
+
const r = this.listeners[e];
|
546
|
+
if (!r)
|
547
|
+
return;
|
548
|
+
const a = r.indexOf(n);
|
549
|
+
this.listeners[e].splice(a, 1), this.listeners[e].length || this.removeWindowListener(this.windowListeners[e]);
|
550
|
+
}
|
551
|
+
addWindowListener(e) {
|
552
|
+
window.addEventListener(e.windowEventName, e.handler), e.registered = !0;
|
553
|
+
}
|
554
|
+
removeWindowListener(e) {
|
555
|
+
e && (window.removeEventListener(e.windowEventName, e.handler), e.registered = !1);
|
556
|
+
}
|
557
|
+
}
|
558
|
+
const ne = (t) => encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape), se = (t) => t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
559
|
+
class Je extends de {
|
560
|
+
async getCookies() {
|
561
|
+
const e = document.cookie, n = {};
|
562
|
+
return e.split(";").forEach((r) => {
|
563
|
+
if (r.length <= 0)
|
564
|
+
return;
|
565
|
+
let [a, s] = r.replace(/=/, "CAP_COOKIE").split("CAP_COOKIE");
|
566
|
+
a = se(a).trim(), s = se(s).trim(), n[a] = s;
|
567
|
+
}), n;
|
568
|
+
}
|
569
|
+
async setCookie(e) {
|
570
|
+
try {
|
571
|
+
const n = ne(e.key), r = ne(e.value), a = `; expires=${(e.expires || "").replace("expires=", "")}`, s = (e.path || "/").replace("path=", ""), o = e.url != null && e.url.length > 0 ? `domain=${e.url}` : "";
|
572
|
+
document.cookie = `${n}=${r || ""}${a}; path=${s}; ${o};`;
|
573
|
+
} catch (n) {
|
574
|
+
return Promise.reject(n);
|
575
|
+
}
|
576
|
+
}
|
577
|
+
async deleteCookie(e) {
|
578
|
+
try {
|
579
|
+
document.cookie = `${e.key}=; Max-Age=0`;
|
580
|
+
} catch (n) {
|
581
|
+
return Promise.reject(n);
|
582
|
+
}
|
583
|
+
}
|
584
|
+
async clearCookies() {
|
585
|
+
try {
|
586
|
+
const e = document.cookie.split(";") || [];
|
587
|
+
for (const n of e)
|
588
|
+
document.cookie = n.replace(/^ +/, "").replace(/=.*/, `=;expires=${(/* @__PURE__ */ new Date()).toUTCString()};path=/`);
|
589
|
+
} catch (e) {
|
590
|
+
return Promise.reject(e);
|
591
|
+
}
|
592
|
+
}
|
593
|
+
async clearAllCookies() {
|
594
|
+
try {
|
595
|
+
await this.clearCookies();
|
596
|
+
} catch (e) {
|
597
|
+
return Promise.reject(e);
|
598
|
+
}
|
599
|
+
}
|
600
|
+
}
|
601
|
+
const ue = ce("CapacitorCookies", {
|
602
|
+
web: () => new Je()
|
603
|
+
}), Ge = async (t) => new Promise((e, n) => {
|
604
|
+
const r = new FileReader();
|
605
|
+
r.onload = () => {
|
606
|
+
const a = r.result;
|
607
|
+
e(a.indexOf(",") >= 0 ? a.split(",")[1] : a);
|
608
|
+
}, r.onerror = (a) => n(a), r.readAsDataURL(t);
|
609
|
+
}), ze = (t = {}) => {
|
610
|
+
const e = Object.keys(t);
|
611
|
+
return Object.keys(t).map((a) => a.toLocaleLowerCase()).reduce((a, s, o) => (a[s] = t[e[o]], a), {});
|
612
|
+
}, Ke = (t, e = !0) => t ? Object.entries(t).reduce((r, a) => {
|
613
|
+
const [s, o] = a;
|
614
|
+
let i, u;
|
615
|
+
return Array.isArray(o) ? (u = "", o.forEach((l) => {
|
616
|
+
i = e ? encodeURIComponent(l) : l, u += `${s}=${i}&`;
|
617
|
+
}), u.slice(0, -1)) : (i = e ? encodeURIComponent(o) : o, u = `${s}=${i}`), `${r}&${u}`;
|
618
|
+
}, "").substr(1) : null, Ze = (t, e = {}) => {
|
619
|
+
const n = Object.assign({ method: t.method || "GET", headers: t.headers }, e), a = ze(t.headers)["content-type"] || "";
|
620
|
+
if (typeof t.data == "string")
|
621
|
+
n.body = t.data;
|
622
|
+
else if (a.includes("application/x-www-form-urlencoded")) {
|
623
|
+
const s = new URLSearchParams();
|
624
|
+
for (const [o, i] of Object.entries(t.data || {}))
|
625
|
+
s.set(o, i);
|
626
|
+
n.body = s.toString();
|
627
|
+
} else if (a.includes("multipart/form-data")) {
|
628
|
+
const s = new FormData();
|
629
|
+
if (t.data instanceof FormData)
|
630
|
+
t.data.forEach((i, u) => {
|
631
|
+
s.append(u, i);
|
632
|
+
});
|
633
|
+
else
|
634
|
+
for (const i of Object.keys(t.data))
|
635
|
+
s.append(i, t.data[i]);
|
636
|
+
n.body = s;
|
637
|
+
const o = new Headers(n.headers);
|
638
|
+
o.delete("content-type"), n.headers = o;
|
639
|
+
} else
|
640
|
+
(a.includes("application/json") || typeof t.data == "object") && (n.body = JSON.stringify(t.data));
|
641
|
+
return n;
|
642
|
+
};
|
643
|
+
class Qe extends de {
|
644
|
+
/**
|
645
|
+
* Perform an Http request given a set of options
|
646
|
+
* @param options Options to build the HTTP request
|
647
|
+
*/
|
648
|
+
async request(e) {
|
649
|
+
const n = Ze(e, e.webFetchExtra), r = Ke(e.params, e.shouldEncodeUrlParams), a = r ? `${e.url}?${r}` : e.url, s = await fetch(a, n), o = s.headers.get("content-type") || "";
|
650
|
+
let { responseType: i = "text" } = s.ok ? e : {};
|
651
|
+
o.includes("application/json") && (i = "json");
|
652
|
+
let u, l;
|
653
|
+
switch (i) {
|
654
|
+
case "arraybuffer":
|
655
|
+
case "blob":
|
656
|
+
l = await s.blob(), u = await Ge(l);
|
657
|
+
break;
|
658
|
+
case "json":
|
659
|
+
u = await s.json();
|
660
|
+
break;
|
661
|
+
case "document":
|
662
|
+
case "text":
|
663
|
+
default:
|
664
|
+
u = await s.text();
|
665
|
+
}
|
666
|
+
const m = {};
|
667
|
+
return s.headers.forEach((c, _) => {
|
668
|
+
m[_] = c;
|
669
|
+
}), {
|
670
|
+
data: u,
|
671
|
+
headers: m,
|
672
|
+
status: s.status,
|
673
|
+
url: s.url
|
674
|
+
};
|
675
|
+
}
|
676
|
+
/**
|
677
|
+
* Perform an Http GET request given a set of options
|
678
|
+
* @param options Options to build the HTTP request
|
679
|
+
*/
|
680
|
+
async get(e) {
|
681
|
+
return this.request(Object.assign(Object.assign({}, e), { method: "GET" }));
|
682
|
+
}
|
683
|
+
/**
|
684
|
+
* Perform an Http POST request given a set of options
|
685
|
+
* @param options Options to build the HTTP request
|
686
|
+
*/
|
687
|
+
async post(e) {
|
688
|
+
return this.request(Object.assign(Object.assign({}, e), { method: "POST" }));
|
689
|
+
}
|
690
|
+
/**
|
691
|
+
* Perform an Http PUT request given a set of options
|
692
|
+
* @param options Options to build the HTTP request
|
693
|
+
*/
|
694
|
+
async put(e) {
|
695
|
+
return this.request(Object.assign(Object.assign({}, e), { method: "PUT" }));
|
696
|
+
}
|
697
|
+
/**
|
698
|
+
* Perform an Http PATCH request given a set of options
|
699
|
+
* @param options Options to build the HTTP request
|
700
|
+
*/
|
701
|
+
async patch(e) {
|
702
|
+
return this.request(Object.assign(Object.assign({}, e), { method: "PATCH" }));
|
703
|
+
}
|
704
|
+
/**
|
705
|
+
* Perform an Http DELETE request given a set of options
|
706
|
+
* @param options Options to build the HTTP request
|
707
|
+
*/
|
708
|
+
async delete(e) {
|
709
|
+
return this.request(Object.assign(Object.assign({}, e), { method: "DELETE" }));
|
710
|
+
}
|
711
|
+
}
|
712
|
+
ce("CapacitorHttp", {
|
713
|
+
web: () => new Qe()
|
714
|
+
});
|
715
|
+
const Xe = oe.create({ baseURL: process.env.API_URL, withCredentials: !0 }), H = ae({
|
716
|
+
code: {
|
717
|
+
value: "",
|
718
|
+
type: "",
|
719
|
+
method: "",
|
720
|
+
isSended: !1,
|
721
|
+
isValid: !1
|
722
|
+
}
|
723
|
+
});
|
724
|
+
async function Ye(t, e, n) {
|
725
|
+
return await Xe.post("/api/twofa/sendcode", {
|
726
|
+
phone: t.phone.number,
|
727
|
+
email: t.email,
|
728
|
+
method: e,
|
729
|
+
type: n
|
730
|
+
}).then(
|
731
|
+
(r) => (H.code = r.data, H.code.isSended = !0, Promise.resolve(r.data)),
|
732
|
+
(r) => (console.log(r), S(r), Promise.reject(r))
|
733
|
+
);
|
734
|
+
}
|
735
|
+
re(H, (t, e) => {
|
736
|
+
});
|
737
|
+
const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
738
|
+
__proto__: null,
|
739
|
+
sendCode: Ye,
|
740
|
+
state: H
|
741
|
+
}, Symbol.toStringTag, { value: "Module" })), F = oe.create({ baseURL: process.env.API_URL, withCredentials: !0 }), v = ae({
|
742
|
+
user: {
|
743
|
+
_id: "",
|
744
|
+
username: "",
|
745
|
+
email: "",
|
746
|
+
phone: "",
|
747
|
+
password: "",
|
748
|
+
passwordRepeat: ""
|
749
|
+
},
|
750
|
+
access: {
|
751
|
+
roles: null,
|
752
|
+
token: null,
|
753
|
+
status: !1
|
754
|
+
}
|
755
|
+
});
|
756
|
+
if (J.get("user")) {
|
757
|
+
const { _id: t, email: e, phone: n, roles: r, accessToken: a } = JSON.parse(J.get("user"));
|
758
|
+
Object.assign(v.user, { _id: t, email: e, phone: n }), Object.assign(v.access, { token: a, roles: r, status: !!a }), F.interceptors.request.use((s) => (a && (s.headers["x-access-token"] = a), s), (s) => Promise.reject(s));
|
759
|
+
}
|
760
|
+
const et = {
|
761
|
+
async login(t, e) {
|
762
|
+
try {
|
763
|
+
const n = await F.post("/api/auth/signin", {
|
764
|
+
...t,
|
765
|
+
type: e
|
766
|
+
});
|
767
|
+
return X("user", n.data), Object.assign(v.user, {
|
768
|
+
...n.data
|
769
|
+
}), Object.assign(v.access, {
|
770
|
+
token: n.data.accessToken,
|
771
|
+
status: !0,
|
772
|
+
roles: n.data.roles
|
773
|
+
}), n.data;
|
774
|
+
} catch (n) {
|
775
|
+
return Object.assign(v.access, {
|
776
|
+
token: null,
|
777
|
+
status: !1,
|
778
|
+
roles: null
|
779
|
+
}), S(n), Promise.reject(n);
|
780
|
+
}
|
781
|
+
},
|
782
|
+
async signup(t, e, n) {
|
783
|
+
const { password: r, passwordRepeat: a } = v.user;
|
784
|
+
if (r !== a) {
|
785
|
+
const s = {
|
786
|
+
response: {
|
787
|
+
data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
|
788
|
+
}
|
789
|
+
};
|
790
|
+
throw S(s), new Error(s.response.status);
|
791
|
+
}
|
792
|
+
try {
|
793
|
+
t.phone = t.phone.number;
|
794
|
+
const s = await F.post("/api/auth/signup", {
|
795
|
+
...t,
|
796
|
+
type: e,
|
797
|
+
inviteCode: n
|
798
|
+
});
|
799
|
+
return s.data.accessToken && X("user", s.data), Object.assign(v.user, {
|
800
|
+
...s.data
|
801
|
+
}), Object.assign(v.access, {
|
802
|
+
token: s.data.accessToken,
|
803
|
+
status: !0,
|
804
|
+
roles: s.data.roles
|
805
|
+
}), s.data;
|
806
|
+
} catch (s) {
|
807
|
+
throw S(s), console.log("Sign up falied"), s;
|
808
|
+
}
|
809
|
+
},
|
810
|
+
logout() {
|
811
|
+
nt("user"), Object.assign(v.user, {
|
812
|
+
email: "",
|
813
|
+
phone: "",
|
814
|
+
password: "",
|
815
|
+
passwordRepeat: ""
|
816
|
+
}), Object.assign(v.access, {
|
817
|
+
token: null,
|
818
|
+
status: !1
|
819
|
+
});
|
820
|
+
},
|
821
|
+
async resetPassword(t, e) {
|
822
|
+
try {
|
823
|
+
const n = await F.post("/api/auth/reset-password", {
|
824
|
+
email: t.email,
|
825
|
+
phone: t.phone.number,
|
826
|
+
type: e
|
827
|
+
});
|
828
|
+
return Object.assign(H.code, {
|
829
|
+
...n.data,
|
830
|
+
isSended: !0
|
831
|
+
}), n.data;
|
832
|
+
} catch (n) {
|
833
|
+
return S(n), Promise.reject(n);
|
834
|
+
}
|
835
|
+
},
|
836
|
+
async updatePassword(t, e) {
|
837
|
+
const { password: n, passwordRepeat: r } = v.user;
|
838
|
+
if (n !== r) {
|
839
|
+
const a = {
|
840
|
+
response: {
|
841
|
+
data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
|
842
|
+
}
|
843
|
+
};
|
844
|
+
throw S(a), new Error(a.response.status);
|
845
|
+
}
|
846
|
+
try {
|
847
|
+
const a = await F.post("/api/auth/update-password", {
|
848
|
+
email: t.email,
|
849
|
+
phone: t.phone.number,
|
850
|
+
password: t.password,
|
851
|
+
passwordRepeat: t.passwordRepeat,
|
852
|
+
type: e
|
853
|
+
});
|
854
|
+
return a.data.accessToken && X("user", a.data), Object.assign(v.user, {
|
855
|
+
...a.data
|
856
|
+
}), Object.assign(v.access, {
|
857
|
+
token: a.data.accessToken,
|
858
|
+
status: !0
|
859
|
+
}), a.data;
|
860
|
+
} catch (a) {
|
861
|
+
return S(a), Promise.reject(a);
|
862
|
+
}
|
863
|
+
}
|
864
|
+
}, tt = {
|
865
|
+
development: { secure: !1, expires: 1 },
|
866
|
+
production: { expires: 1, domain: process.env.API_URL, sameSite: "none", secure: !0 }
|
867
|
+
};
|
868
|
+
function X(t, e, n = process.env.NODE_ENV) {
|
869
|
+
process.env.MOBILE_APP ? ue.setCookie({
|
870
|
+
url: process.env.API_URL,
|
871
|
+
// используйте ваш API_URL
|
872
|
+
key: t,
|
873
|
+
value: JSON.stringify(e)
|
874
|
+
}) : J.set(t, JSON.stringify(e), tt[n]);
|
875
|
+
}
|
876
|
+
function nt(t, e = process.env.NODE_ENV) {
|
877
|
+
if (process.env.MOBILE_APP)
|
878
|
+
ue.deleteCookie({
|
879
|
+
url: process.env.API_URL,
|
880
|
+
// используйте ваш API_URL
|
881
|
+
key: t
|
882
|
+
});
|
883
|
+
else {
|
884
|
+
const n = e === "production" ? { domain: process.env.API_URL } : {};
|
885
|
+
J.remove(t, n);
|
886
|
+
}
|
887
|
+
}
|
888
|
+
re(v, (t, e) => {
|
889
|
+
});
|
890
|
+
const dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
891
|
+
__proto__: null,
|
892
|
+
actions: et,
|
893
|
+
state: v
|
894
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
895
|
+
export {
|
896
|
+
J as C,
|
897
|
+
it as F,
|
898
|
+
lt as _,
|
899
|
+
et as a,
|
900
|
+
H as b,
|
901
|
+
Ye as c,
|
902
|
+
dt as d,
|
903
|
+
v as s,
|
904
|
+
ct as t
|
905
|
+
};
|