@ozdao/prometheus-framework 0.0.87 → 0.0.89
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-300fcb55.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-afba007a.mjs +1944 -0
- package/dist/ButtonFollow-001c4a65.mjs +130 -0
- package/dist/ButtonFollow-48043cc7.js +1 -0
- package/dist/CardHeader-0677d446.js +1 -0
- package/dist/CardHeader-e361dada.mjs +96 -0
- package/dist/CardOrganization-51309400.js +1 -0
- package/dist/CardOrganization-bacc2ef6.mjs +202 -0
- package/dist/Feed-4b28adc5.mjs +423 -0
- package/dist/Feed-51e4e232.js +1 -0
- package/dist/Feed-5d8d5c21.js +1 -0
- package/dist/Feed-76b2997e.mjs +367 -0
- package/dist/Feed-dc8b66bf.mjs +367 -0
- package/dist/Feed-eeb63363.js +1 -0
- package/dist/IconEdit-3028a3b7.js +1 -0
- package/dist/IconEdit-8df23653.mjs +205 -0
- package/dist/Image-30f04604.js +9 -0
- package/dist/Image-6c7584f5.mjs +477 -0
- package/dist/Image-6ec294f3.mjs +477 -0
- package/dist/Image-9a870c88.js +9 -0
- package/dist/PlaceholderUserpic-10fd9026.js +1 -0
- package/dist/PlaceholderUserpic-eb9820ce.mjs +28 -0
- package/dist/Popup-7c331e1c.js +1 -0
- package/dist/Popup-bdf043ba.mjs +76 -0
- package/dist/Product-1724d88d.mjs +837 -0
- package/dist/Product-a94d8b65.js +7 -0
- package/dist/Product-b233e2a3.js +7 -0
- package/dist/Product-eb00f35e.mjs +837 -0
- package/dist/ProductEdit-57484f1e.mjs +349 -0
- package/dist/ProductEdit-61413d02.mjs +349 -0
- package/dist/ProductEdit-ef301baa.js +1 -0
- package/dist/ProductEdit-fca68ff9.js +1 -0
- package/dist/ProfileBlogposts-6704a38c.js +1 -0
- package/dist/ProfileBlogposts-775b1cfa.mjs +63 -0
- package/dist/ProfileComments-175e42da.js +1 -0
- package/dist/ProfileComments-fd7d66bf.mjs +43 -0
- package/dist/ProfileEvents-1cfe6858.mjs +55 -0
- package/dist/ProfileEvents-4f2a5f00.js +1 -0
- package/dist/ProfileEvents-7a51a9e6.mjs +55 -0
- package/dist/ProfileEvents-d8e16509.js +1 -0
- package/dist/ProfileLikes-20a8a3c9.mjs +43 -0
- package/dist/ProfileLikes-b3b1350a.js +1 -0
- package/dist/ProfileOrganizations-4b866823.mjs +211 -0
- package/dist/ProfileOrganizations-6d3a43e4.js +1 -0
- package/dist/Publics-0e44c61e.mjs +122 -0
- package/dist/Publics-4e1c14fc.js +1 -0
- package/dist/Tab-a243605d.mjs +46 -0
- package/dist/UploadImage-6e312c46.mjs +83 -0
- package/dist/UploadImage-9e7e7468.js +1 -0
- package/dist/auth-2bc18d1e.js +8 -0
- package/dist/auth-fefd15a3.mjs +1503 -0
- package/dist/auth.client.cjs +1 -1
- package/dist/auth.client.js +5 -5
- package/dist/auth.validation-4a617c0b.mjs +20 -0
- package/dist/auth.validation-78a90fed.js +1 -0
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +206 -222
- package/dist/components/Field/Field.vue.d.ts.map +1 -1
- 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 +1 -1
- package/dist/events.client.js +332 -312
- package/dist/events.server.js +77 -0
- package/dist/events.server.mjs +77 -0
- package/dist/inputs.validation-14e8e01f.mjs +93 -0
- package/dist/main.css +1 -1
- package/dist/organizations-1581c013.mjs +121 -0
- package/dist/organizations-c455dad7.js +1 -0
- package/dist/organizations.client-040ec107.js +3 -0
- package/dist/organizations.client-686845be.mjs +3179 -0
- package/dist/organizations.client-7937e180.mjs +3037 -0
- package/dist/organizations.client-99bfc474.js +3 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +39 -39
- package/dist/organizations.server.js +7 -3
- package/dist/organizations.server.mjs +7 -3
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +3 -2
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +265 -256
- package/dist/users.server.js +2 -2
- package/dist/users.server.mjs +2 -2
- package/package.json +1 -1
- package/src/components/Field/Field.vue +2 -1
- package/src/modules/community/components/pages/CreateBlogPost.vue +2 -1
- package/src/modules/events/components/blocks/CardEvent.vue +1 -1
- package/src/modules/events/components/pages/EditEvent.vue +9 -3
- package/src/modules/events/components/pages/Event.vue +43 -4
- package/src/modules/events/middlewares/server/index.js +10 -0
- package/src/modules/events/middlewares/server/verifyEvent.js +60 -0
- package/src/modules/events/routes/events.routes.js +14 -1
- package/src/modules/organizations/components/blocks/Socials.vue +16 -3
- package/src/modules/organizations/components/pages/OrganizationEdit.vue +39 -15
- package/src/modules/organizations/components/sections/DetailsTab.vue +13 -9
- package/src/modules/organizations/controllers/organizations.controller.js +1 -1
- package/src/modules/organizations/models/organization.model.js +6 -2
- package/src/modules/organizations/store/organizations.js +2 -2
- package/src/modules/users/components/pages/Profile.vue +26 -11
- package/src/modules/users/components/pages/ProfileEdit.vue +28 -10
- package/src/modules/users/models/user.model.js +2 -2
- package/src/modules/users/store/users.js +1 -2
@@ -0,0 +1,122 @@
|
|
1
|
+
import { ref as f, watch as C, computed as S, openBlock as e, createElementBlock as t, Fragment as h, createElementVNode as m, normalizeClass as b, toDisplayString as p, createCommentVNode as c, withModifiers as z, createVNode as y, Transition as g, withCtx as k, renderList as M, unref as u, onMounted as B, createBlock as w } from "vue";
|
2
|
+
import "./Breadcrumbs.vue_vue_type_style_index_0_lang-afba007a.mjs";
|
3
|
+
import { _ as O, s as x } from "./auth-fefd15a3.mjs";
|
4
|
+
import { _ as U } from "./CardOrganization-bacc2ef6.mjs";
|
5
|
+
import { _ as E } from "./EmptyState-34d85f10.mjs";
|
6
|
+
import { a as N } from "./organizations-1581c013.mjs";
|
7
|
+
import { m as P } from "./ButtonFollow-001c4a65.mjs";
|
8
|
+
const V = {
|
9
|
+
key: 0,
|
10
|
+
class: "t-transp mn-r-small"
|
11
|
+
}, L = ["onClick"], j = ["onClick"], A = {
|
12
|
+
key: 0,
|
13
|
+
class: "mn-t-thin invalid-feedback"
|
14
|
+
}, D = {
|
15
|
+
__name: "Select",
|
16
|
+
props: {
|
17
|
+
label: String,
|
18
|
+
select: [String, Object],
|
19
|
+
placeholder: { type: String, default: "Please select an item" },
|
20
|
+
options: { type: Array, default: () => [] },
|
21
|
+
validation: Boolean
|
22
|
+
},
|
23
|
+
emits: ["update:select", "focus", "blur"],
|
24
|
+
setup(o, { emit: s }) {
|
25
|
+
const a = o, l = f(a.select), i = f(!1);
|
26
|
+
C(() => a.select, (n) => {
|
27
|
+
l.value = n;
|
28
|
+
});
|
29
|
+
const r = S(() => a.select ? a.options.filter((n) => n !== a.select) : a.options), _ = () => {
|
30
|
+
i.value = !i.value, s(i.value ? "focus" : "blur");
|
31
|
+
}, $ = (n) => {
|
32
|
+
l.value = n, _(), s("update:select", l.value);
|
33
|
+
};
|
34
|
+
return (n, T) => {
|
35
|
+
var v;
|
36
|
+
return e(), t(h, null, [
|
37
|
+
m("div", {
|
38
|
+
class: b([n.$attrs.class, "flex-nowrap flex"])
|
39
|
+
}, [
|
40
|
+
o.label ? (e(), t("div", V, [
|
41
|
+
m("span", null, p(o.label), 1)
|
42
|
+
])) : c("", !0),
|
43
|
+
m("li", {
|
44
|
+
onClick: z(_, ["stop"]),
|
45
|
+
class: "w-100"
|
46
|
+
}, [
|
47
|
+
m("span", null, p(((v = l.value) == null ? void 0 : v.name) || l.value || o.placeholder), 1)
|
48
|
+
], 8, L),
|
49
|
+
y(g, {
|
50
|
+
mode: "out-in",
|
51
|
+
name: "fade"
|
52
|
+
}, {
|
53
|
+
default: k(() => [
|
54
|
+
i.value ? (e(), t("ul", {
|
55
|
+
key: 0,
|
56
|
+
class: b([n.$attrs.class, "pos-absolute pos-l-0 z-index-5 w-100 mn-t-big"])
|
57
|
+
}, [
|
58
|
+
(e(!0), t(h, null, M(u(r), (d) => (e(), t("li", null, [
|
59
|
+
d ? (e(), t("span", {
|
60
|
+
key: 0,
|
61
|
+
onClick: (q) => $(d),
|
62
|
+
class: "w-100"
|
63
|
+
}, p(d.name || d), 9, j)) : c("", !0)
|
64
|
+
]))), 256))
|
65
|
+
], 2)) : c("", !0)
|
66
|
+
]),
|
67
|
+
_: 1
|
68
|
+
})
|
69
|
+
], 2),
|
70
|
+
y(g, {
|
71
|
+
mode: "out-in",
|
72
|
+
name: "fade"
|
73
|
+
}, {
|
74
|
+
default: k(() => [
|
75
|
+
o.validation ? (e(), t("div", A, " * " + p(o.validation.message), 1)) : c("", !0)
|
76
|
+
]),
|
77
|
+
_: 1
|
78
|
+
})
|
79
|
+
], 64);
|
80
|
+
};
|
81
|
+
}
|
82
|
+
}, X = /* @__PURE__ */ O(D, [["__scopeId", "data-v-a78dbba1"]]);
|
83
|
+
const F = { class: "w-100 o-scroll" }, I = {
|
84
|
+
key: 1,
|
85
|
+
class: "w-max gap-thin flex-nowrap flex"
|
86
|
+
}, Y = {
|
87
|
+
__name: "Publics",
|
88
|
+
setup(o) {
|
89
|
+
let s = f(null);
|
90
|
+
B(async () => {
|
91
|
+
s.value = await N.read({
|
92
|
+
user: x.user._id,
|
93
|
+
sort: "numberOfMemberships",
|
94
|
+
limit: 10,
|
95
|
+
types: ["public"]
|
96
|
+
});
|
97
|
+
});
|
98
|
+
const a = ({ membership: l, isMember: i, targetId: r }) => {
|
99
|
+
P.handleMembershipUpdate(s.value, l, i, r);
|
100
|
+
};
|
101
|
+
return (l, i) => (e(), t("div", F, [
|
102
|
+
!u(s) || u(s).length < 1 ? (e(), w(E, {
|
103
|
+
key: 0,
|
104
|
+
title: "Unfortunately, we couldn't find any recommendations for you",
|
105
|
+
description: "Explore and find a community or organization that suits your interests.",
|
106
|
+
class: "radius-big bg-grey pd-medium"
|
107
|
+
})) : (e(), t("div", I, [
|
108
|
+
u(s) ? (e(!0), t(h, { key: 0 }, M(u(s), (r, _) => (e(), w(U, {
|
109
|
+
key: r._id,
|
110
|
+
organization: r,
|
111
|
+
user: x.user,
|
112
|
+
onUpdateMembership: a,
|
113
|
+
class: "flex-child-1 flex-child w-100"
|
114
|
+
}, null, 8, ["organization", "user"]))), 128)) : c("", !0)
|
115
|
+
]))
|
116
|
+
]));
|
117
|
+
}
|
118
|
+
};
|
119
|
+
export {
|
120
|
+
X as S,
|
121
|
+
Y as _
|
122
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const e=require("vue");require("./Breadcrumbs.vue_vue_type_style_index_0_lang-300fcb55.js");const u=require("./auth-2bc18d1e.js"),p=require("./CardOrganization-51309400.js"),f=require("./EmptyState-7658d7d6.js"),k=require("./organizations-c455dad7.js"),_=require("./ButtonFollow-48043cc7.js"),h={key:0,class:"t-transp mn-r-small"},y=["onClick"],B=["onClick"],v={key:0,class:"mn-t-thin invalid-feedback"},g={__name:"Select",props:{label:String,select:[String,Object],placeholder:{type:String,default:"Please select an item"},options:{type:Array,default:()=>[]},validation:Boolean},emits:["update:select","focus","blur"],setup(a,{emit:t}){const n=a,l=e.ref(n.select),s=e.ref(!1);e.watch(()=>n.select,o=>{l.value=o});const c=e.computed(()=>n.select?n.options.filter(o=>o!==n.select):n.options),i=()=>{s.value=!s.value,t(s.value?"focus":"blur")},m=o=>{l.value=o,i(),t("update:select",l.value)};return(o,C)=>{var d;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass([o.$attrs.class,"flex-nowrap flex"])},[a.label?(e.openBlock(),e.createElementBlock("div",h,[e.createElementVNode("span",null,e.toDisplayString(a.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("li",{onClick:e.withModifiers(i,["stop"]),class:"w-100"},[e.createElementVNode("span",null,e.toDisplayString(((d=l.value)==null?void 0:d.name)||l.value||a.placeholder),1)],8,y),e.createVNode(e.Transition,{mode:"out-in",name:"fade"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("ul",{key:0,class:e.normalizeClass([o.$attrs.class,"pos-absolute pos-l-0 z-index-5 w-100 mn-t-big"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),r=>(e.openBlock(),e.createElementBlock("li",null,[r?(e.openBlock(),e.createElementBlock("span",{key:0,onClick:N=>m(r),class:"w-100"},e.toDisplayString(r.name||r),9,B)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0)]),_:1})],2),e.createVNode(e.Transition,{mode:"out-in",name:"fade"},{default:e.withCtx(()=>[a.validation?(e.openBlock(),e.createElementBlock("div",v," * "+e.toDisplayString(a.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],64)}}},b=u._export_sfc(g,[["__scopeId","data-v-a78dbba1"]]);const w={class:"w-100 o-scroll"},E={key:1,class:"w-max gap-thin flex-nowrap flex"},x={__name:"Publics",setup(a){let t=e.ref(null);e.onMounted(async()=>{t.value=await k.actions.read({user:u.state.user._id,sort:"numberOfMemberships",limit:10,types:["public"]})});const n=({membership:l,isMember:s,targetId:c})=>{_.mutations.handleMembershipUpdate(t.value,l,s,c)};return(l,s)=>(e.openBlock(),e.createElementBlock("div",w,[!e.unref(t)||e.unref(t).length<1?(e.openBlock(),e.createBlock(f._sfc_main,{key:0,title:"Unfortunately, we couldn't find any recommendations for you",description:"Explore and find a community or organization that suits your interests.",class:"radius-big bg-grey pd-medium"})):(e.openBlock(),e.createElementBlock("div",E,[e.unref(t)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(t),(c,i)=>(e.openBlock(),e.createBlock(p._sfc_main,{key:c._id,organization:c,user:u.state.user,onUpdateMembership:n,class:"flex-child-1 flex-child w-100"},null,8,["organization","user"]))),128)):e.createCommentVNode("",!0)]))]))}};exports.Select=b;exports._sfc_main=x;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { ref as p, computed as v, openBlock as c, createElementBlock as s, createElementVNode as r, Fragment as h, renderList as _, normalizeClass as g, toDisplayString as k, normalizeStyle as x, unref as y } from "vue";
|
2
|
+
import "./inputs.validation-14e8e01f.mjs";
|
3
|
+
const S = { class: "" }, T = { class: "flex-nowrap flex-v-center flex" }, w = ["onClick"], W = {
|
4
|
+
__name: "Tab",
|
5
|
+
props: {
|
6
|
+
tabs: Array,
|
7
|
+
selected: String,
|
8
|
+
callback: Function
|
9
|
+
},
|
10
|
+
emits: ["update:selected"],
|
11
|
+
setup(o, { emit: d }) {
|
12
|
+
const t = o, a = p(0);
|
13
|
+
if (t.selected) {
|
14
|
+
const e = t.tabs.findIndex((l) => l.value === t.selected);
|
15
|
+
e !== -1 && (a.value = e);
|
16
|
+
}
|
17
|
+
function u(e, l) {
|
18
|
+
a.value = e, d("update:selected", l.value), t.callback && t.callback();
|
19
|
+
}
|
20
|
+
function f(e) {
|
21
|
+
return `${100 / t.tabs.length * e}%`;
|
22
|
+
}
|
23
|
+
function b() {
|
24
|
+
return `${100 / t.tabs.length}%`;
|
25
|
+
}
|
26
|
+
const m = v(() => ({ left: f(a.value), width: b() }));
|
27
|
+
return (e, l) => (c(), s("div", S, [
|
28
|
+
r("div", T, [
|
29
|
+
(c(!0), s(h, null, _(o.tabs, (i, n) => (c(), s("div", {
|
30
|
+
key: n,
|
31
|
+
onClick: (z) => u(n, i),
|
32
|
+
class: g([{ "t-transp": n !== a.value }, "z-index-1 t-center pd-small w-100"])
|
33
|
+
}, [
|
34
|
+
r("label", null, k(i.name), 1)
|
35
|
+
], 10, w))), 128)),
|
36
|
+
r("div", {
|
37
|
+
style: x(y(m)),
|
38
|
+
class: "radius-extra bg-main t-white tab-selector"
|
39
|
+
}, null, 4)
|
40
|
+
])
|
41
|
+
]));
|
42
|
+
}
|
43
|
+
};
|
44
|
+
export {
|
45
|
+
W as _
|
46
|
+
};
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import { ref as d, watch as v, openBlock as l, createElementBlock as n, withModifiers as g, createElementVNode as i } from "vue";
|
2
|
+
import { a as w } from "./auth-fefd15a3.mjs";
|
3
|
+
const x = ["src"], _ = {
|
4
|
+
key: 1,
|
5
|
+
class: "flex-v-center flex-h-center flex w-100 h-100 bg-second"
|
6
|
+
}, y = /* @__PURE__ */ i("svg", {
|
7
|
+
class: "i-medium",
|
8
|
+
width: "104",
|
9
|
+
height: "104",
|
10
|
+
viewBox: "0 0 104 104",
|
11
|
+
fill: "none",
|
12
|
+
xmlns: "http://www.w3.org/2000/svg"
|
13
|
+
}, [
|
14
|
+
/* @__PURE__ */ i("path", {
|
15
|
+
fill: "white",
|
16
|
+
d: "M21.2784 37.2973C18.8466 34.6628 18.8466 30.6098 21.2784 27.9753L47.2179 2.03584C48.6364 0.81993 50.2577 0.211974 51.8789 0.211974C53.5001 0.211974 55.1213 0.81993 56.5399 2.03584L82.4793 27.9753C84.9111 30.6098 84.9111 34.6628 82.4793 37.2973C79.8448 39.7291 75.7918 39.7291 73.1573 37.2973L58.3637 22.301V71.5454C58.3637 75.1932 55.5266 78.0303 51.8789 78.0303C48.2311 78.0303 45.394 75.1932 45.394 71.5454V22.301L30.6004 37.2973C27.966 39.7291 23.9129 39.7291 21.2784 37.2973ZM97.2729 71.5454C100.921 71.5454 103.758 74.3825 103.758 78.0303V97.4849C103.758 101.133 100.921 103.97 97.2729 103.97H6.48486C2.83713 103.97 0 101.133 0 97.4849V78.0303C0 74.3825 2.83713 71.5454 6.48486 71.5454H38.9092C38.9092 78.6382 44.7861 84.5151 51.8789 84.5151C58.9717 84.5151 64.8486 78.6382 64.8486 71.5454H97.2729ZM87.5456 92.6212C90.1801 92.6212 92.4092 90.392 92.4092 87.7576C92.4092 85.1231 90.1801 82.8939 87.5456 82.8939C84.9111 82.8939 82.682 85.1231 82.682 87.7576C82.682 90.392 84.9111 92.6212 87.5456 92.6212Z"
|
17
|
+
})
|
18
|
+
], -1), k = [
|
19
|
+
y
|
20
|
+
], U = {
|
21
|
+
__name: "UploadImage",
|
22
|
+
props: [
|
23
|
+
"uploadPath",
|
24
|
+
// only necessary prop
|
25
|
+
"photo"
|
26
|
+
// new prop for holding the image url
|
27
|
+
],
|
28
|
+
emits: ["update:photo"],
|
29
|
+
setup(a, { emit: u }) {
|
30
|
+
const r = a, t = d(null), s = d(null);
|
31
|
+
v(r, ({ photo: e }) => {
|
32
|
+
e && (t.value = e);
|
33
|
+
});
|
34
|
+
function h() {
|
35
|
+
s.value.click();
|
36
|
+
}
|
37
|
+
async function c(e) {
|
38
|
+
let o = e.target.files[0], p = new FormData();
|
39
|
+
p.append("file", o);
|
40
|
+
try {
|
41
|
+
let m = await w.create({ baseURL: process.env.API_URL, withCredentials: !0 }).post(`/api/upload/file?folderName=${encodeURIComponent(r.uploadPath)}`, p, {
|
42
|
+
headers: {
|
43
|
+
"Content-Type": "multipart/form-data"
|
44
|
+
}
|
45
|
+
});
|
46
|
+
t.value = m.data.filepath, u("update:photo", t.value);
|
47
|
+
} catch (f) {
|
48
|
+
console.error(f);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
function C(e) {
|
52
|
+
e.preventDefault(), c({
|
53
|
+
target: {
|
54
|
+
files: e.dataTransfer.files
|
55
|
+
}
|
56
|
+
});
|
57
|
+
}
|
58
|
+
return (e, o) => (l(), n("div", {
|
59
|
+
onClick: h,
|
60
|
+
onDrop: C,
|
61
|
+
onDragover: o[0] || (o[0] = g(() => {
|
62
|
+
}, ["prevent"])),
|
63
|
+
class: "image-upload-area flex-v-center flex-h-center flex"
|
64
|
+
}, [
|
65
|
+
t.value || a.photo ? (l(), n("img", {
|
66
|
+
key: 0,
|
67
|
+
src: t.value || a.photo,
|
68
|
+
alt: "Uploaded image",
|
69
|
+
class: "w-100 h-100 object-fit-fill"
|
70
|
+
}, null, 8, x)) : (l(), n("div", _, k)),
|
71
|
+
i("input", {
|
72
|
+
type: "file",
|
73
|
+
ref_key: "fileInput",
|
74
|
+
ref: s,
|
75
|
+
onChange: c,
|
76
|
+
style: { display: "none" }
|
77
|
+
}, null, 544)
|
78
|
+
], 32));
|
79
|
+
}
|
80
|
+
};
|
81
|
+
export {
|
82
|
+
U as _
|
83
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const e=require("vue"),h=require("./auth-2bc18d1e.js"),C=["src"],m={key:1,class:"flex-v-center flex-h-center flex w-100 h-100 bg-second"},v=e.createElementVNode("svg",{class:"i-medium",width:"104",height:"104",viewBox:"0 0 104 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{fill:"white",d:"M21.2784 37.2973C18.8466 34.6628 18.8466 30.6098 21.2784 27.9753L47.2179 2.03584C48.6364 0.81993 50.2577 0.211974 51.8789 0.211974C53.5001 0.211974 55.1213 0.81993 56.5399 2.03584L82.4793 27.9753C84.9111 30.6098 84.9111 34.6628 82.4793 37.2973C79.8448 39.7291 75.7918 39.7291 73.1573 37.2973L58.3637 22.301V71.5454C58.3637 75.1932 55.5266 78.0303 51.8789 78.0303C48.2311 78.0303 45.394 75.1932 45.394 71.5454V22.301L30.6004 37.2973C27.966 39.7291 23.9129 39.7291 21.2784 37.2973ZM97.2729 71.5454C100.921 71.5454 103.758 74.3825 103.758 78.0303V97.4849C103.758 101.133 100.921 103.97 97.2729 103.97H6.48486C2.83713 103.97 0 101.133 0 97.4849V78.0303C0 74.3825 2.83713 71.5454 6.48486 71.5454H38.9092C38.9092 78.6382 44.7861 84.5151 51.8789 84.5151C58.9717 84.5151 64.8486 78.6382 64.8486 71.5454H97.2729ZM87.5456 92.6212C90.1801 92.6212 92.4092 90.392 92.4092 87.7576C92.4092 85.1231 90.1801 82.8939 87.5456 82.8939C84.9111 82.8939 82.682 85.1231 82.682 87.7576C82.682 90.392 84.9111 92.6212 87.5456 92.6212Z"})],-1),g=[v],w={__name:"UploadImage",props:["uploadPath","photo"],emits:["update:photo"],setup(n,{emit:p}){const a=n,o=e.ref(null),i=e.ref(null);e.watch(a,({photo:t})=>{t&&(o.value=t)});function f(){i.value.click()}async function r(t){let l=t.target.files[0],s=new FormData;s.append("file",l);try{let d=await h.axios.create({baseURL:process.env.API_URL,withCredentials:!0}).post(`/api/upload/file?folderName=${encodeURIComponent(a.uploadPath)}`,s,{headers:{"Content-Type":"multipart/form-data"}});o.value=d.data.filepath,p("update:photo",o.value)}catch(c){console.error(c)}}function u(t){t.preventDefault(),r({target:{files:t.dataTransfer.files}})}return(t,l)=>(e.openBlock(),e.createElementBlock("div",{onClick:f,onDrop:u,onDragover:l[0]||(l[0]=e.withModifiers(()=>{},["prevent"])),class:"image-upload-area flex-v-center flex-h-center flex"},[o.value||n.photo?(e.openBlock(),e.createElementBlock("img",{key:0,src:o.value||n.photo,alt:"Uploaded image",class:"w-100 h-100 object-fit-fill"},null,8,C)):(e.openBlock(),e.createElementBlock("div",m,g)),e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:i,onChange:r,style:{display:"none"}},null,544)],32))}};exports._sfc_main=w;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";const o=require("vue"),A=require("./globals-928eb13c.js");const Ye=(e,t)=>{const r=e.__vccOpts||e;for(const[s,n]of t)r[s]=n;return r},bt={key:0,class:"t-transp mn-r-small"},gt={class:"w-100"},Rt=["type","value","placeholder"],Ct=["value","placeholder"],Ot={key:0,class:"mn-t-thin mn-thin mn-b-thin invalid-feedback"},xt={__name:"Field",props:{label:null,type:"text",placeholder:"Enter something here",field:null,validation:!1,disabled:!1},emits:["update:field","focus","blur"],setup(e,{emit:t}){const r=e,s=o.ref(r.field);return(n,a)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",{class:o.normalizeClass([[n.$attrs.class,{"bg-fourth-nano":e.validation}],"flex-center flex-nowrap flex"])},[e.label?(o.openBlock(),o.createElementBlock("div",bt,[o.createElementVNode("span",null,o.toDisplayString(e.label),1)])):o.createCommentVNode("",!0),o.createElementVNode("div",gt,[e.type!=="textarea"?(o.openBlock(),o.createElementBlock("input",{key:0,onInput:a[0]||(a[0]=i=>s.value=t("update:field",i.target.value)),onFocus:a[1]||(a[1]=i=>t("focus",i)),onBlur:a[2]||(a[2]=i=>t("blur",i)),type:e.type,class:"w-100",value:e.field,placeholder:e.placeholder},null,40,Rt)):(o.openBlock(),o.createElementBlock("textarea",{key:1,onInput:a[3]||(a[3]=i=>s.value=t("update:field",i.target.value)),onFocus:a[4]||(a[4]=i=>t("focus",i)),onBlur:a[5]||(a[5]=i=>t("blur",i)),class:"w-100",value:e.field,placeholder:e.placeholder},null,40,Ct))])],2),o.createVNode(o.Transition,{name:"fade"},{default:o.withCtx(()=>[e.validation?(o.openBlock(),o.createElementBlock("div",Ot," * "+o.toDisplayString(e.validation.message),1)):o.createCommentVNode("",!0)]),_:1})],64))}},_t=Ye(xt,[["__scopeId","data-v-deecbd0c"]]);const Nt=["onClick","disabled"],St={key:0},At={key:0,class:"loading"},Tt=o.createElementVNode("span",null,[o.createElementVNode("svg",{class:"i-small",width:"135",height:"140",viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:"#fff"},[o.createElementVNode("rect",{y:"10",width:"15",height:"120",rx:"6"},[o.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),o.createTextVNode(),o.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),o.createElementVNode("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},[o.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),o.createTextVNode(),o.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),o.createElementVNode("rect",{x:"60",width:"15",height:"140",rx:"6"},[o.createElementVNode("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),o.createTextVNode(),o.createElementVNode("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),o.createElementVNode("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},[o.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),o.createTextVNode(),o.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),o.createElementVNode("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},[o.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),o.createTextVNode(),o.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})])])],-1),Pt=[Tt],Bt={key:0,class:"h4 loading"},kt=o.createElementVNode("span",{class:"p-small t-white"},"✔",-1),Dt=[kt],Ut={key:0,class:"error"},jt={__name:"Button",props:{submit:{type:Function,default:async()=>{console.log("Button click.")}},callback:{type:Function,default:async()=>{console.log("Button callback.")}},callbackDelay:{type:Number,default:750},validation:{type:Boolean,default:!1}},setup(e){const t=e,r=o.ref(null),s=o.ref(null),n=o.ref(!1),a=o.ref(!1);async function i(){r.value.style["pointer-events"]="none",s.value=null,n.value=!0;try{await t.submit(),r.value.classList.replace("bg-main","bg-light-main"),n.value=!1,a.value=!0,setTimeout(()=>{r.value&&(r.value.classList.replace("bg-light-main","bg-main"),r.value.style.pointerEvents="auto",n.value=!1,a.value=!1,s.value=null)},500),t.callback&&setTimeout(()=>t.callback(),t.callbackDelay)}catch{r.value.classList.replace("bg-main","bg-fourth-nano"),s.value="❌",setTimeout(()=>{r.value.classList.replace("bg-fourth-nano","bg-main"),r.value.style.pointerEvents="auto",n.value=!1,a.value=!1,s.value=null},1330)}}return(u,c)=>(o.openBlock(),o.createElementBlock("button",{onClick:o.withModifiers(i,["stop"]),disabled:e.validation,ref_key:"button",ref:r,class:"w-100 bg-main button"},[o.createVNode(o.Transition,{mode:"out-in",name:"fadeIn"},{default:o.withCtx(()=>[!n.value&&!s.value&&!a.value?(o.openBlock(),o.createElementBlock("span",St,[o.renderSlot(u.$slots,"default")])):o.createCommentVNode("",!0)]),_:3}),o.createVNode(o.Transition,{mode:"out-in",name:"fadeIn"},{default:o.withCtx(()=>[n.value&&!s.value?(o.openBlock(),o.createElementBlock("div",At,Pt)):o.createCommentVNode("",!0)]),_:1}),o.createVNode(o.Transition,{mode:"out-in",name:"fadeIn"},{default:o.withCtx(()=>[a.value?(o.openBlock(),o.createElementBlock("div",Bt,Dt)):o.createCommentVNode("",!0)]),_:1}),o.createVNode(o.Transition,{mode:"out-in",name:"fadeIn"},{default:o.withCtx(()=>[s.value?(o.openBlock(),o.createElementBlock("div",Ut,[o.createElementVNode("span",null,o.toDisplayString(s.value),1)])):o.createCommentVNode("",!0)]),_:1})],8,Nt))}};function me(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ve={exports:{}},Ge=function(t,r){return function(){for(var n=new Array(arguments.length),a=0;a<n.length;a++)n[a]=arguments[a];return t.apply(r,n)}},Lt=Ge,Ee=Object.prototype.toString,ye=function(e){return function(t){var r=Ee.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));function T(e){return e=e.toLowerCase(),function(r){return ye(r)===e}}function we(e){return Array.isArray(e)}function H(e){return typeof e>"u"}function qt(e){return e!==null&&!H(e)&&e.constructor!==null&&!H(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}var Ze=T("ArrayBuffer");function Ft(e){var t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ze(e.buffer),t}function Vt(e){return typeof e=="string"}function It(e){return typeof e=="number"}function et(e){return e!==null&&typeof e=="object"}function $(e){if(ye(e)!=="object")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}var $t=T("Date"),Mt=T("File"),Ht=T("Blob"),Jt=T("FileList");function be(e){return Ee.call(e)==="[object Function]"}function Wt(e){return et(e)&&be(e.pipe)}function zt(e){var t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||Ee.call(e)===t||be(e.toString)&&e.toString()===t)}var Xt=T("URLSearchParams");function Kt(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Qt(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function ge(e,t){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),we(e))for(var r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.call(null,e[n],n,e)}function he(){var e={};function t(n,a){$(e[a])&&$(n)?e[a]=he(e[a],n):$(n)?e[a]=he({},n):we(n)?e[a]=n.slice():e[a]=n}for(var r=0,s=arguments.length;r<s;r++)ge(arguments[r],t);return e}function Yt(e,t,r){return ge(t,function(n,a){r&&typeof n=="function"?e[a]=Lt(n,r):e[a]=n}),e}function Gt(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}function Zt(e,t,r,s){e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,r&&Object.assign(e.prototype,r)}function er(e,t,r){var s,n,a,i={};t=t||{};do{for(s=Object.getOwnPropertyNames(e),n=s.length;n-- >0;)a=s[n],i[a]||(t[a]=e[a],i[a]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t}function tr(e,t,r){e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;var s=e.indexOf(t,r);return s!==-1&&s===r}function rr(e){if(!e)return null;var t=e.length;if(H(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r}var nr=function(e){return function(t){return e&&t instanceof e}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array)),y={isArray:we,isArrayBuffer:Ze,isBuffer:qt,isFormData:zt,isArrayBufferView:Ft,isString:Vt,isNumber:It,isObject:et,isPlainObject:$,isUndefined:H,isDate:$t,isFile:Mt,isBlob:Ht,isFunction:be,isStream:Wt,isURLSearchParams:Xt,isStandardBrowserEnv:Qt,forEach:ge,merge:he,extend:Yt,trim:Kt,stripBOM:Gt,inherits:Zt,toFlatObject:er,kindOf:ye,kindOfTest:T,endsWith:tr,toArray:rr,isTypedArray:nr,isFileList:Jt},k=y;function Se(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var tt=function(t,r,s){if(!r)return t;var n;if(s)n=s(r);else if(k.isURLSearchParams(r))n=r.toString();else{var a=[];k.forEach(r,function(c,f){c===null||typeof c>"u"||(k.isArray(c)?f=f+"[]":c=[c],k.forEach(c,function(p){k.isDate(p)?p=p.toISOString():k.isObject(p)&&(p=JSON.stringify(p)),a.push(Se(f)+"="+Se(p))}))}),n=a.join("&")}if(n){var i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+n}return t},ar=y;function J(){this.handlers=[]}J.prototype.use=function(t,r,s){return this.handlers.push({fulfilled:t,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1};J.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};J.prototype.forEach=function(t){ar.forEach(this.handlers,function(s){s!==null&&t(s)})};var sr=J,ir=y,or=function(t,r){ir.forEach(t,function(n,a){a!==r&&a.toUpperCase()===r.toUpperCase()&&(t[r]=n,delete t[a])})},rt=y;function U(e,t,r,s,n){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),s&&(this.request=s),n&&(this.response=n)}rt.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var nt=U.prototype,at={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(e){at[e]={value:e}});Object.defineProperties(U,at);Object.defineProperty(nt,"isAxiosError",{value:!0});U.from=function(e,t,r,s,n,a){var i=Object.create(nt);return rt.toFlatObject(e,i,function(c){return c!==Error.prototype}),U.call(i,e.message,t,r,s,n),i.name=e.name,a&&Object.assign(i,a),i};var q=U,st={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},C=y;function ur(e,t){t=t||new FormData;var r=[];function s(a){return a===null?"":C.isDate(a)?a.toISOString():C.isArrayBuffer(a)||C.isTypedArray(a)?typeof Blob=="function"?new Blob([a]):Buffer.from(a):a}function n(a,i){if(C.isPlainObject(a)||C.isArray(a)){if(r.indexOf(a)!==-1)throw Error("Circular reference detected in "+i);r.push(a),C.forEach(a,function(c,f){if(!C.isUndefined(c)){var d=i?i+"."+f:f,p;if(c&&!i&&typeof c=="object"){if(C.endsWith(f,"{}"))c=JSON.stringify(c);else if(C.endsWith(f,"[]")&&(p=C.toArray(c))){p.forEach(function(l){!C.isUndefined(l)&&t.append(d,s(l))});return}}n(c,d)}}),r.pop()}else t.append(i,s(a))}return n(e),t}var it=ur,G,Ae;function lr(){if(Ae)return G;Ae=1;var e=q;return G=function(r,s,n){var a=n.config.validateStatus;!n.status||!a||a(n.status)?r(n):s(new e("Request failed with status code "+n.status,[e.ERR_BAD_REQUEST,e.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))},G}var Z,Te;function cr(){if(Te)return Z;Te=1;var e=y;return Z=e.isStandardBrowserEnv()?function(){return{write:function(s,n,a,i,u,c){var f=[];f.push(s+"="+encodeURIComponent(n)),e.isNumber(a)&&f.push("expires="+new Date(a).toGMTString()),e.isString(i)&&f.push("path="+i),e.isString(u)&&f.push("domain="+u),c===!0&&f.push("secure"),document.cookie=f.join("; ")},read:function(s){var n=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(s){this.write(s,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Z}var dr=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)},fr=function(t,r){return r?t.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):t},pr=dr,hr=fr,ot=function(t,r){return t&&!pr(r)?hr(t,r):r},ee,Pe;function mr(){if(Pe)return ee;Pe=1;var e=y,t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return ee=function(s){var n={},a,i,u;return s&&e.forEach(s.split(`
|
2
|
+
`),function(f){if(u=f.indexOf(":"),a=e.trim(f.substr(0,u)).toLowerCase(),i=e.trim(f.substr(u+1)),a){if(n[a]&&t.indexOf(a)>=0)return;a==="set-cookie"?n[a]=(n[a]?n[a]:[]).concat([i]):n[a]=n[a]?n[a]+", "+i:i}}),n},ee}var te,Be;function vr(){if(Be)return te;Be=1;var e=y;return te=e.isStandardBrowserEnv()?function(){var r=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a"),n;function a(i){var u=i;return r&&(s.setAttribute("href",u),u=s.href),s.setAttribute("href",u),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return n=a(window.location.href),function(u){var c=e.isString(u)?a(u):u;return c.protocol===n.protocol&&c.host===n.host}}():function(){return function(){return!0}}(),te}var re,ke;function W(){if(ke)return re;ke=1;var e=q,t=y;function r(s){e.call(this,s??"canceled",e.ERR_CANCELED),this.name="CanceledError"}return t.inherits(r,e,{__CANCEL__:!0}),re=r,re}var ne,De;function Er(){return De||(De=1,ne=function(t){var r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return r&&r[1]||""}),ne}var ae,Ue;function je(){if(Ue)return ae;Ue=1;var e=y,t=lr(),r=cr(),s=tt,n=ot,a=mr(),i=vr(),u=st,c=q,f=W(),d=Er();return ae=function(l){return new Promise(function(O,E){var x=l.data,N=l.headers,F=l.responseType,P;function xe(){l.cancelToken&&l.cancelToken.unsubscribe(P),l.signal&&l.signal.removeEventListener("abort",P)}e.isFormData(x)&&e.isStandardBrowserEnv()&&delete N["Content-Type"];var h=new XMLHttpRequest;if(l.auth){var Et=l.auth.username||"",yt=l.auth.password?unescape(encodeURIComponent(l.auth.password)):"";N.Authorization="Basic "+btoa(Et+":"+yt)}var K=n(l.baseURL,l.url);h.open(l.method.toUpperCase(),s(K,l.params,l.paramsSerializer),!0),h.timeout=l.timeout;function _e(){if(h){var R="getAllResponseHeaders"in h?a(h.getAllResponseHeaders()):null,B=!F||F==="text"||F==="json"?h.responseText:h.response,S={data:B,status:h.status,statusText:h.statusText,headers:R,config:l,request:h};t(function(Y){O(Y),xe()},function(Y){E(Y),xe()},S),h=null}}if("onloadend"in h?h.onloadend=_e:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(_e)},h.onabort=function(){h&&(E(new c("Request aborted",c.ECONNABORTED,l,h)),h=null)},h.onerror=function(){E(new c("Network Error",c.ERR_NETWORK,l,h,h)),h=null},h.ontimeout=function(){var B=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded",S=l.transitional||u;l.timeoutErrorMessage&&(B=l.timeoutErrorMessage),E(new c(B,S.clarifyTimeoutError?c.ETIMEDOUT:c.ECONNABORTED,l,h)),h=null},e.isStandardBrowserEnv()){var Ne=(l.withCredentials||i(K))&&l.xsrfCookieName?r.read(l.xsrfCookieName):void 0;Ne&&(N[l.xsrfHeaderName]=Ne)}"setRequestHeader"in h&&e.forEach(N,function(B,S){typeof x>"u"&&S.toLowerCase()==="content-type"?delete N[S]:h.setRequestHeader(S,B)}),e.isUndefined(l.withCredentials)||(h.withCredentials=!!l.withCredentials),F&&F!=="json"&&(h.responseType=l.responseType),typeof l.onDownloadProgress=="function"&&h.addEventListener("progress",l.onDownloadProgress),typeof l.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",l.onUploadProgress),(l.cancelToken||l.signal)&&(P=function(R){h&&(E(!R||R&&R.type?new f:R),h.abort(),h=null)},l.cancelToken&&l.cancelToken.subscribe(P),l.signal&&(l.signal.aborted?P():l.signal.addEventListener("abort",P))),x||(x=null);var Q=d(K);if(Q&&["http","https","file"].indexOf(Q)===-1){E(new c("Unsupported protocol "+Q+":",c.ERR_BAD_REQUEST,l));return}h.send(x)})},ae}var se,Le;function yr(){return Le||(Le=1,se=null),se}var v=y,qe=or,Fe=q,wr=st,br=it,gr={"Content-Type":"application/x-www-form-urlencoded"};function Ve(e,t){!v.isUndefined(e)&&v.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function Rr(){var e;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(e=je()),e}function Cr(e,t,r){if(v.isString(e))try{return(t||JSON.parse)(e),v.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(e)}var z={transitional:wr,adapter:Rr(),transformRequest:[function(t,r){if(qe(r,"Accept"),qe(r,"Content-Type"),v.isFormData(t)||v.isArrayBuffer(t)||v.isBuffer(t)||v.isStream(t)||v.isFile(t)||v.isBlob(t))return t;if(v.isArrayBufferView(t))return t.buffer;if(v.isURLSearchParams(t))return Ve(r,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var s=v.isObject(t),n=r&&r["Content-Type"],a;if((a=v.isFileList(t))||s&&n==="multipart/form-data"){var i=this.env&&this.env.FormData;return br(a?{"files[]":t}:t,i&&new i)}else if(s||n==="application/json")return Ve(r,"application/json"),Cr(t);return t}],transformResponse:[function(t){var r=this.transitional||z.transitional,s=r&&r.silentJSONParsing,n=r&&r.forcedJSONParsing,a=!s&&this.responseType==="json";if(a||n&&v.isString(t)&&t.length)try{return JSON.parse(t)}catch(i){if(a)throw i.name==="SyntaxError"?Fe.from(i,Fe.ERR_BAD_RESPONSE,this,null,this.response):i}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yr()},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};v.forEach(["delete","get","head"],function(t){z.headers[t]={}});v.forEach(["post","put","patch"],function(t){z.headers[t]=v.merge(gr)});var Re=z,Or=y,xr=Re,_r=function(t,r,s){var n=this||xr;return Or.forEach(s,function(i){t=i.call(n,t,r)}),t},ie,Ie;function ut(){return Ie||(Ie=1,ie=function(t){return!!(t&&t.__CANCEL__)}),ie}var $e=y,oe=_r,Nr=ut(),Sr=Re,Ar=W();function ue(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ar}var Tr=function(t){ue(t),t.headers=t.headers||{},t.data=oe.call(t,t.data,t.headers,t.transformRequest),t.headers=$e.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),$e.forEach(["delete","get","head","post","put","patch","common"],function(n){delete t.headers[n]});var r=t.adapter||Sr.adapter;return r(t).then(function(n){return ue(t),n.data=oe.call(t,n.data,n.headers,t.transformResponse),n},function(n){return Nr(n)||(ue(t),n&&n.response&&(n.response.data=oe.call(t,n.response.data,n.response.headers,t.transformResponse))),Promise.reject(n)})},g=y,lt=function(t,r){r=r||{};var s={};function n(d,p){return g.isPlainObject(d)&&g.isPlainObject(p)?g.merge(d,p):g.isPlainObject(p)?g.merge({},p):g.isArray(p)?p.slice():p}function a(d){if(g.isUndefined(r[d])){if(!g.isUndefined(t[d]))return n(void 0,t[d])}else return n(t[d],r[d])}function i(d){if(!g.isUndefined(r[d]))return n(void 0,r[d])}function u(d){if(g.isUndefined(r[d])){if(!g.isUndefined(t[d]))return n(void 0,t[d])}else return n(void 0,r[d])}function c(d){if(d in r)return n(t[d],r[d]);if(d in t)return n(void 0,t[d])}var f={url:i,method:i,data:i,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:c};return g.forEach(Object.keys(t).concat(Object.keys(r)),function(p){var l=f[p]||a,m=l(p);g.isUndefined(m)&&l!==c||(s[p]=m)}),s},le,Me;function ct(){return Me||(Me=1,le={version:"0.27.2"}),le}var Pr=ct().version,_=q,Ce={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){Ce[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});var He={};Ce.transitional=function(t,r,s){function n(a,i){return"[Axios v"+Pr+"] Transitional option '"+a+"'"+i+(s?". "+s:"")}return function(a,i,u){if(t===!1)throw new _(n(i," has been removed"+(r?" in "+r:"")),_.ERR_DEPRECATED);return r&&!He[i]&&(He[i]=!0,console.warn(n(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,i,u):!0}};function Br(e,t,r){if(typeof e!="object")throw new _("options must be an object",_.ERR_BAD_OPTION_VALUE);for(var s=Object.keys(e),n=s.length;n-- >0;){var a=s[n],i=t[a];if(i){var u=e[a],c=u===void 0||i(u,a,e);if(c!==!0)throw new _("option "+a+" must be "+c,_.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new _("Unknown option "+a,_.ERR_BAD_OPTION)}}var kr={assertOptions:Br,validators:Ce},dt=y,Dr=tt,Je=sr,We=Tr,X=lt,Ur=ot,ft=kr,D=ft.validators;function j(e){this.defaults=e,this.interceptors={request:new Je,response:new Je}}j.prototype.request=function(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=X(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var s=r.transitional;s!==void 0&&ft.assertOptions(s,{silentJSONParsing:D.transitional(D.boolean),forcedJSONParsing:D.transitional(D.boolean),clarifyTimeoutError:D.transitional(D.boolean)},!1);var n=[],a=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(a=a&&m.synchronous,n.unshift(m.fulfilled,m.rejected))});var i=[];this.interceptors.response.forEach(function(m){i.push(m.fulfilled,m.rejected)});var u;if(!a){var c=[We,void 0];for(Array.prototype.unshift.apply(c,n),c=c.concat(i),u=Promise.resolve(r);c.length;)u=u.then(c.shift(),c.shift());return u}for(var f=r;n.length;){var d=n.shift(),p=n.shift();try{f=d(f)}catch(l){p(l);break}}try{u=We(f)}catch(l){return Promise.reject(l)}for(;i.length;)u=u.then(i.shift(),i.shift());return u};j.prototype.getUri=function(t){t=X(this.defaults,t);var r=Ur(t.baseURL,t.url);return Dr(r,t.params,t.paramsSerializer)};dt.forEach(["delete","get","head","options"],function(t){j.prototype[t]=function(r,s){return this.request(X(s||{},{method:t,url:r,data:(s||{}).data}))}});dt.forEach(["post","put","patch"],function(t){function r(s){return function(a,i,u){return this.request(X(u||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}j.prototype[t]=r(),j.prototype[t+"Form"]=r(!0)});var jr=j,ce,ze;function Lr(){if(ze)return ce;ze=1;var e=W();function t(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var s;this.promise=new Promise(function(i){s=i});var n=this;this.promise.then(function(a){if(n._listeners){var i,u=n._listeners.length;for(i=0;i<u;i++)n._listeners[i](a);n._listeners=null}}),this.promise.then=function(a){var i,u=new Promise(function(c){n.subscribe(c),i=c}).then(a);return u.cancel=function(){n.unsubscribe(i)},u},r(function(i){n.reason||(n.reason=new e(i),s(n.reason))})}return t.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},t.prototype.subscribe=function(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]},t.prototype.unsubscribe=function(s){if(this._listeners){var n=this._listeners.indexOf(s);n!==-1&&this._listeners.splice(n,1)}},t.source=function(){var s,n=new t(function(i){s=i});return{token:n,cancel:s}},ce=t,ce}var de,Xe;function qr(){return Xe||(Xe=1,de=function(t){return function(s){return t.apply(null,s)}}),de}var fe,Ke;function Fr(){if(Ke)return fe;Ke=1;var e=y;return fe=function(r){return e.isObject(r)&&r.isAxiosError===!0},fe}var Qe=y,Vr=Ge,M=jr,Ir=lt,$r=Re;function pt(e){var t=new M(e),r=Vr(M.prototype.request,t);return Qe.extend(r,M.prototype,t),Qe.extend(r,t),r.create=function(n){return pt(Ir(e,n))},r}var b=pt($r);b.Axios=M;b.CanceledError=W();b.CancelToken=Lr();b.isCancel=ut();b.VERSION=ct().version;b.toFormData=it;b.AxiosError=q;b.Cancel=b.CanceledError;b.all=function(t){return Promise.all(t)};b.spread=qr();b.isAxiosError=Fr();ve.exports=b;ve.exports.default=b;var Mr=ve.exports,Hr=Mr;const Oe=me(Hr);var ht={exports:{}};/*!
|
3
|
+
* JavaScript Cookie v2.2.1
|
4
|
+
* https://github.com/js-cookie/js-cookie
|
5
|
+
*
|
6
|
+
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
7
|
+
* Released under the MIT license
|
8
|
+
*/(function(e,t){(function(r){var s;if(e.exports=r(),s=!0,!s){var n=window.Cookies,a=window.Cookies=r();a.noConflict=function(){return window.Cookies=n,a}}})(function(){function r(){for(var a=0,i={};a<arguments.length;a++){var u=arguments[a];for(var c in u)i[c]=u[c]}return i}function s(a){return a.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function n(a){function i(){}function u(f,d,p){if(!(typeof document>"u")){p=r({path:"/"},i.defaults,p),typeof p.expires=="number"&&(p.expires=new Date(new Date*1+p.expires*864e5)),p.expires=p.expires?p.expires.toUTCString():"";try{var l=JSON.stringify(d);/^[\{\[]/.test(l)&&(d=l)}catch{}d=a.write?a.write(d,f):encodeURIComponent(String(d)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),f=encodeURIComponent(String(f)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var m="";for(var O in p)p[O]&&(m+="; "+O,p[O]!==!0&&(m+="="+p[O].split(";")[0]));return document.cookie=f+"="+d+m}}function c(f,d){if(!(typeof document>"u")){for(var p={},l=document.cookie?document.cookie.split("; "):[],m=0;m<l.length;m++){var O=l[m].split("="),E=O.slice(1).join("=");!d&&E.charAt(0)==='"'&&(E=E.slice(1,-1));try{var x=s(O[0]);if(E=(a.read||a)(E,x)||s(E),d)try{E=JSON.parse(E)}catch{}if(p[x]=E,f===x)break}catch{}}return f?p[f]:p}}return i.set=u,i.get=function(f){return c(f,!1)},i.getJSON=function(f){return c(f,!0)},i.remove=function(f,d){u(f,"",r(d,{expires:-1}))},i.defaults={},i.withConverter=n,i}return n(function(){})})})(ht);var Jr=ht.exports;const I=me(Jr),Wr=Oe.create({baseURL:process.env.API_URL,withCredentials:!0}),L=o.reactive({code:{value:"",type:"",method:"",isSended:!1,isValid:!1}});async function mt(e,t,r){return await Wr.post("/api/twofa/sendcode",{phone:e.phone.number,email:e.email,method:t,type:r}).then(s=>(L.code=s.data,L.code.isSended=!0,Promise.resolve(s.data)),s=>(console.log(s),A.setError(s),Promise.reject(s)))}o.watch(L,(e,t)=>{});const zr=Object.freeze(Object.defineProperty({__proto__:null,sendCode:mt,state:L},Symbol.toStringTag,{value:"Module"})),V=Oe.create({baseURL:process.env.API_URL,withCredentials:!0}),w=o.reactive({user:{_id:"",username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1}});if(I.get("user")){const{_id:e,email:t,phone:r,roles:s,accessToken:n}=JSON.parse(I.get("user"));Object.assign(w.user,{_id:e,email:t,phone:r}),Object.assign(w.access,{token:n,roles:s,status:!!n}),V.interceptors.request.use(a=>(n&&(a.headers["x-access-token"]=n),a),a=>Promise.reject(a))}const vt={async login(e,t){try{console.log(e.phone.number);const r=await V.post("/api/auth/signin",{email:e.email,phone:e.phone.number,password:e.password,passwordRepeat:"",type:t});return pe("user",r.data),console.log(r.data),Object.assign(w.user,{...r.data}),Object.assign(w.access,{token:r.data.accessToken,status:!0,roles:r.data.roles}),r.data}catch(r){return Object.assign(w.access,{token:null,status:!1}),A.setError(r),Promise.reject(r)}},async signup(e,t,r){const{password:s,passwordRepeat:n}=w.user;if(s!==n){const a={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw A.setError(a),new Error(a.response.status)}try{e.phone=e.phone.number;const a=await V.post("/api/auth/signup",{...e,type:t,inviteCode:r});return a.data.accessToken&&pe("user",a.data),Object.assign(w.user,{...a.data}),Object.assign(w.access,{token:a.data.accessToken,status:!0,roles:a.data.roles}),a.data}catch(a){throw A.setError(a),console.log("Sign up falied"),a}},logout(){Kr("user"),Object.assign(w.user,{email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(w.access,{token:null,status:!1})},async resetPassword(e,t){try{const r=await V.post("/api/auth/reset-password",{email:e.email,phone:e.phone.number,type:t});return Object.assign(L.code,{...r.data,isSended:!0}),r.data}catch(r){return A.setError(r),Promise.reject(r)}},async updatePassword(e,t){const{password:r,passwordRepeat:s}=w.user;if(r!==s){const n={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw A.setError(n),new Error(n.response.status)}try{const n=await V.post("/api/auth/update-password",{email:e.email,phone:e.phone.number,password:e.password,passwordRepeat:e.passwordRepeat,type:t});return n.data.accessToken&&pe("user",n.data),Object.assign(w.user,{...n.data}),Object.assign(w.access,{token:n.data.accessToken,status:!0}),n.data}catch(n){return A.setError(n),Promise.reject(n)}}},Xr={development:{secure:!1,expires:1},production:{expires:1,domain:process.env.API_URL,sameSite:"none",secure:!0}};function pe(e,t,r=process.env.NODE_ENV){I.set(e,JSON.stringify(t),Xr[r])}function Kr(e,t=process.env.NODE_ENV){const r=t==="production"?{domain:process.env.API_URL}:{};I.remove(e,r)}o.watch(w,(e,t)=>{});const Qr=Object.freeze(Object.defineProperty({__proto__:null,actions:vt,state:w},Symbol.toStringTag,{value:"Module"}));exports.Cookies=I;exports.Field=_t;exports._export_sfc=Ye;exports._sfc_main=jt;exports.actions=vt;exports.auth=Qr;exports.axios=Oe;exports.getDefaultExportFromCjs=me;exports.sendCode=mt;exports.state=w;exports.state$1=L;exports.twofa=zr;
|