@ozdao/prometheus-framework 0.1.24 → 0.1.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. package/dist/BackofficeGallery-0e0132f5.mjs +306 -0
  2. package/dist/BackofficeGallery-a52a27b6.js +1 -0
  3. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-19e23006.mjs +1945 -0
  4. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-f3d37f29.js +1 -0
  5. package/dist/Button-d8e72ac0.mjs +296 -0
  6. package/dist/Button-ee08e6bf.js +1 -0
  7. package/dist/ButtonFollow-00d85977.mjs +133 -0
  8. package/dist/ButtonFollow-7c0180b3.js +1 -0
  9. package/dist/CardOrganization-3f4a13d3.mjs +230 -0
  10. package/dist/CardOrganization-bf366e4e.js +1 -0
  11. package/dist/Feed-0b1dad65.js +1 -0
  12. package/dist/Feed-8110366a.mjs +439 -0
  13. package/dist/Feed-82ad8e29.mjs +368 -0
  14. package/dist/Feed-c8b1c72d.js +1 -0
  15. package/dist/Image-2269667e.js +9 -0
  16. package/dist/Image-7dcfe90d.mjs +477 -0
  17. package/dist/MenuItem-1216a99f.js +1 -0
  18. package/dist/MenuItem-97c50b97.mjs +93 -0
  19. package/dist/Popup-0420381f.js +1 -0
  20. package/dist/Popup-47b37484.mjs +76 -0
  21. package/dist/Product-977a8a7f.js +7 -0
  22. package/dist/Product-bbe7171a.mjs +842 -0
  23. package/dist/ProductEdit-e4cad9d1.js +1 -0
  24. package/dist/ProductEdit-f7a9af17.mjs +303 -0
  25. package/dist/ProfileBlogposts-5379335e.js +1 -0
  26. package/dist/ProfileBlogposts-5deee0c5.mjs +65 -0
  27. package/dist/ProfileComments-3cf3e265.mjs +44 -0
  28. package/dist/ProfileComments-8c9146ef.js +1 -0
  29. package/dist/ProfileEvents-7502ed90.mjs +57 -0
  30. package/dist/ProfileEvents-ea023c17.js +1 -0
  31. package/dist/ProfileLikes-23b6f2f9.js +1 -0
  32. package/dist/ProfileLikes-5b52e4ae.mjs +44 -0
  33. package/dist/ProfileOrganizations-769325c7.js +1 -0
  34. package/dist/ProfileOrganizations-c5151835.mjs +214 -0
  35. package/dist/Publics-4438ca51.js +1 -0
  36. package/dist/Publics-538180a8.mjs +45 -0
  37. package/dist/UploadImage-33f6a9f4.js +1 -0
  38. package/dist/UploadImage-f7b0335f.mjs +83 -0
  39. package/dist/UploadImageMultiple-297b3897.js +1 -0
  40. package/dist/UploadImageMultiple-7b132ba0.mjs +58 -0
  41. package/dist/auth-2f9b2dfc.js +7 -0
  42. package/dist/auth-b047fdc0.mjs +612 -0
  43. package/dist/auth.client.cjs +8 -8
  44. package/dist/auth.client.js +24 -23
  45. package/dist/auth.validation-02e0629b.mjs +20 -0
  46. package/dist/auth.validation-6a59443b.js +1 -0
  47. package/dist/backoffice.client.cjs +1 -1
  48. package/dist/backoffice.client.js +1 -1
  49. package/dist/community.client.cjs +1 -1
  50. package/dist/community.client.js +69 -68
  51. package/dist/events.client.cjs +2 -2
  52. package/dist/events.client.js +21 -20
  53. package/dist/index-0ab9d59c.mjs +934 -0
  54. package/dist/index-7ecbf72a.js +2 -0
  55. package/dist/legal.client.cjs +1 -0
  56. package/dist/legal.client.js +8426 -0
  57. package/dist/modules/landing/components/pages/Legal.vue.d.ts +2 -0
  58. package/dist/modules/landing/components/pages/legal/Cookies.vue.d.ts +2 -0
  59. package/dist/modules/landing/components/pages/legal/Privacy.vue.d.ts +2 -0
  60. package/dist/modules/landing/components/pages/legal/Terms.vue.d.ts +2 -0
  61. package/dist/modules/legal/components/pages/Legal.vue.d.ts +2 -0
  62. package/dist/modules/legal/components/pages/legal/Cookies.vue.d.ts +2 -0
  63. package/dist/modules/legal/components/pages/legal/Privacy.vue.d.ts +2 -0
  64. package/dist/modules/legal/components/pages/legal/Terms.vue.d.ts +2 -0
  65. package/dist/organizations-aed4245d.mjs +122 -0
  66. package/dist/organizations-bb8f676d.js +1 -0
  67. package/dist/organizations.client-5548024c.js +3 -0
  68. package/dist/organizations.client-976762d2.mjs +3021 -0
  69. package/dist/organizations.client.cjs +1 -1
  70. package/dist/organizations.client.js +45 -44
  71. package/dist/style.css +1 -1
  72. package/dist/users.client.cjs +1 -1
  73. package/dist/users.client.js +254 -324
  74. package/package.json +5 -1
  75. package/src/modules/community/components/pages/CreateBlogPost.vue +1 -1
  76. package/src/modules/constructor/components/sections/Constructor.vue +3 -3
  77. package/src/modules/landing/landing.client.js +1 -2
  78. package/src/modules/legal/components/pages/Legal.vue +43 -0
  79. package/src/modules/legal/components/pages/legal/Cookies.vue +370 -0
  80. package/src/modules/legal/components/pages/legal/Privacy.vue +4284 -0
  81. package/src/modules/legal/components/pages/legal/Terms.vue +1283 -0
  82. package/src/modules/legal/legal.client.js +16 -0
  83. package/src/modules/legal/router/legal.js +22 -0
  84. package/src/modules/users/components/pages/Profile.vue +13 -0
@@ -0,0 +1,214 @@
1
+ import { openBlock as r, createElementBlock as o, createStaticVNode as $, ref as c, onMounted as C, createVNode as d, TransitionGroup as v, withCtx as g, Fragment as k, renderList as w, createBlock as f, createCommentVNode as u, Transition as h, normalizeClass as N, watch as q, createElementVNode as O, unref as y } from "vue";
2
+ import { useRoute as M, useRouter as D } from "vue-router";
3
+ import { _ as F } from "./Tab-a243605d.mjs";
4
+ import { _ as L } from "./EmptyState-34d85f10.mjs";
5
+ import { _ as V } from "./CardOrganization-3f4a13d3.mjs";
6
+ import { _ as B } from "./_plugin-vue_export-helper-dad06003.mjs";
7
+ import { a as x } from "./organizations-aed4245d.mjs";
8
+ import { s as _ } from "./auth-b047fdc0.mjs";
9
+ import "./inputs.validation-14e8e01f.mjs";
10
+ import "./globals-96ba60e4.mjs";
11
+ import "vue-i18n";
12
+ import "./ButtonFollow-00d85977.mjs";
13
+ import "./Button-d8e72ac0.mjs";
14
+ import "./index-0ab9d59c.mjs";
15
+ const E = {}, G = {
16
+ width: "100%",
17
+ height: "20rem",
18
+ xmlns: "http://www.w3.org/2000/svg"
19
+ }, P = /* @__PURE__ */ $('<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--grey))"></rect><rect x="15" y="15" rx="4" ry="4" width="40%" height="20" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="45" rx="5" ry="5" width="70%" height="50" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="110" rx="3" ry="3" width="90%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="130" rx="3" ry="3" width="70%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="-25%" y="0" width="25%" height="100%" fill="#fff" mask="url(#myMask)" opacity="0.3"><animate attributeName="x" from="-25%" to="100%" dur="2s" repeatCount="indefinite"></animate></rect>', 6), R = [
20
+ P
21
+ ];
22
+ function T(p, e) {
23
+ return r(), o("svg", G, R);
24
+ }
25
+ const U = /* @__PURE__ */ B(E, [["render", T]]), j = { class: "feed" }, z = {
26
+ __name: "Feed",
27
+ props: {
28
+ category: {
29
+ type: String,
30
+ default: null
31
+ },
32
+ selectedDate: {
33
+ type: String,
34
+ default: null
35
+ },
36
+ organization: {
37
+ type: String,
38
+ default: null
39
+ },
40
+ owner: {
41
+ type: String,
42
+ default: null
43
+ },
44
+ user: {
45
+ type: [String, Number],
46
+ default: null
47
+ },
48
+ member: {
49
+ type: [String, Number],
50
+ default: null
51
+ },
52
+ subscriber: {
53
+ type: [String, Number],
54
+ default: null
55
+ },
56
+ sortOrder: {
57
+ type: String,
58
+ default: "desc"
59
+ },
60
+ participant: {
61
+ type: String,
62
+ default: null
63
+ },
64
+ period: {
65
+ type: String,
66
+ default: null
67
+ },
68
+ status: {
69
+ type: String,
70
+ default: null
71
+ }
72
+ },
73
+ setup(p) {
74
+ const e = p, a = c([]), i = c(!1), t = c(!0), n = c(0), s = c(20), b = async () => {
75
+ if (i.value) {
76
+ n.value += s.value;
77
+ const l = await x.read({
78
+ skip: n.value,
79
+ limit: s.value,
80
+ category: e.category,
81
+ sortOrder: e.sortOrder,
82
+ member: e.member,
83
+ subscriber: e.subscriber,
84
+ onlyuser: e.onlyuser,
85
+ user: e.user,
86
+ date: e.selectedDate,
87
+ owner: e.owner,
88
+ organization: e.organization,
89
+ period: e.period,
90
+ status: e.status
91
+ });
92
+ l.length === 0 ? i.value = !1 : i.value = !0, a.value = [...a.value, ...l];
93
+ }
94
+ };
95
+ return C(async () => {
96
+ t.value = !0, console.log(e.selectedDate);
97
+ const l = await x.read({
98
+ skip: n.value,
99
+ limit: s.value,
100
+ category: e.category,
101
+ member: e.member,
102
+ subscriber: e.subscriber,
103
+ onlyuser: e.onlyuser,
104
+ sortOrder: e.sortOrder,
105
+ user: e.user,
106
+ owner: e.owner,
107
+ date: e.selectedDate,
108
+ organization: e.organization,
109
+ period: e.period,
110
+ status: e.status
111
+ });
112
+ l.length === 0 ? i.value = !1 : i.value = !0, a.value = l, t.value = !1;
113
+ }), (l, J) => (r(), o("section", j, [
114
+ d(v, {
115
+ tag: "ul",
116
+ name: "fade",
117
+ class: "o-hidden bg-grey radius-big"
118
+ }, {
119
+ default: g(() => [
120
+ t.value ? (r(!0), o(k, { key: 0 }, w(s.value, (m) => (r(), f(U, { key: m }))), 128)) : u("", !0)
121
+ ]),
122
+ _: 1
123
+ }),
124
+ d(h, { name: "fade" }, {
125
+ default: g(() => [
126
+ !t.value && a.value.length < 1 ? (r(), f(L, {
127
+ key: 0,
128
+ title: "No Organizations Found",
129
+ description: "Currently, there are no organizations available. Please check back later.",
130
+ class: "pd-medium mn-thin bg-grey radius-big"
131
+ })) : u("", !0)
132
+ ]),
133
+ _: 1
134
+ }),
135
+ d(v, {
136
+ tag: "ul",
137
+ name: "fade",
138
+ class: "container"
139
+ }, {
140
+ default: g(() => [
141
+ !t.value && a.value.length > 0 ? (r(!0), o(k, { key: 0 }, w(a.value, (m, S) => (r(), f(V, {
142
+ onClick: (K) => l.$router.push({ name: "Organization", params: { _id: m._id } }),
143
+ key: m._id,
144
+ organization: m,
145
+ user: p.user,
146
+ type: "normal",
147
+ class: N(["w-100 radius-big mn-medium", {
148
+ "br-b br-solid br-black-transp-10": S !== a.value.length - 1
149
+ }])
150
+ }, null, 8, ["onClick", "organization", "user", "class"]))), 128)) : u("", !0),
151
+ i.value && a.value.length > 0 ? (r(), o("button", {
152
+ key: 1,
153
+ onClick: b,
154
+ class: "w-100 bg-main button"
155
+ }, "Load more")) : u("", !0)
156
+ ]),
157
+ _: 1
158
+ })
159
+ ]));
160
+ }
161
+ }, A = { class: "pd-thin" }, H = { class: "mn-medium flex-v-center flex-nowrap flex" }, I = /* @__PURE__ */ O("h2", { class: "mn-r-medium" }, "Groups", -1), ue = {
162
+ __name: "ProfileOrganizations",
163
+ setup(p) {
164
+ const e = M(), a = D();
165
+ let i = e.query.tab ? e.query.tab : "member";
166
+ const t = c(i);
167
+ return e.query.tab = t.value, q(t, (n) => {
168
+ a.replace({ query: { ...e.query, tab: n } });
169
+ }), (n, s) => (r(), o("div", A, [
170
+ O("header", H, [
171
+ I,
172
+ _.user._id === y(e).params._id ? (r(), o("button", {
173
+ key: 0,
174
+ onClick: s[0] || (s[0] = (b) => n.$router.push({
175
+ name: "Create Organization"
176
+ })),
177
+ class: "radius-100p i-big hover-scale-1 cursor-pointer t-white bg-second"
178
+ }, " + ")) : u("", !0)
179
+ ]),
180
+ d(F, {
181
+ selected: t.value,
182
+ "onUpdate:selected": s[1] || (s[1] = (b) => t.value = b),
183
+ tabs: [
184
+ { name: "Member", value: "member" },
185
+ { name: "Follower", value: "follower" }
186
+ ],
187
+ class: "mn-medium mn-r-medium o-hidden h5 radius-big bg-grey"
188
+ }, null, 8, ["selected"]),
189
+ d(h, { name: "slide-fade" }, {
190
+ default: g(() => [
191
+ t.value === "member" ? (r(), f(z, {
192
+ key: 0,
193
+ user: _.user._id,
194
+ owner: y(e).params._id
195
+ }, null, 8, ["user", "owner"])) : u("", !0)
196
+ ]),
197
+ _: 1
198
+ }),
199
+ d(h, { name: "slide-fade" }, {
200
+ default: g(() => [
201
+ t.value === "follower" ? (r(), f(z, {
202
+ key: 0,
203
+ user: _.user._id,
204
+ subscriber: y(e).params._id
205
+ }, null, 8, ["user", "subscriber"])) : u("", !0)
206
+ ]),
207
+ _: 1
208
+ })
209
+ ]));
210
+ }
211
+ };
212
+ export {
213
+ ue as default
214
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),a=require("./CardOrganization-bf366e4e.js"),c=require("./EmptyState-7658d7d6.js"),s=require("./auth-2f9b2dfc.js"),l=require("./organizations-bb8f676d.js"),u=require("./ButtonFollow-7c0180b3.js");const d={class:"w-100 o-scroll"},_={key:1,class:"w-max gap-thin flex-nowrap flex"},m={__name:"Publics",setup(p){let t=e.ref(null);e.onMounted(async()=>{t.value=await l.actions.read({user:s.state.user._id,sort:"numberOfMemberships",limit:10,types:["public"]})});const i=({membership:r,isMember:o,targetId:n})=>{u.mutations.handleMembershipUpdate(t.value,r,o,n)};return(r,o)=>(e.openBlock(),e.createElementBlock("div",d,[!e.unref(t)||e.unref(t).length<1?(e.openBlock(),e.createBlock(c._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.unref(t)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(t),(n,f)=>(e.openBlock(),e.createBlock(a._sfc_main,{key:n._id,organization:n,user:s.state.user,onUpdateMembership:i,class:"flex-child-1 flex-child w-25r"},null,8,["organization","user"]))),128)):e.createCommentVNode("",!0)]))]))}};exports._sfc_main=m;
@@ -0,0 +1,45 @@
1
+ import { ref as c, onMounted as u, openBlock as t, createElementBlock as n, unref as s, createBlock as a, Fragment as d, renderList as _, createCommentVNode as p } from "vue";
2
+ import { _ as f } from "./CardOrganization-3f4a13d3.mjs";
3
+ import { _ as h } from "./EmptyState-34d85f10.mjs";
4
+ import { s as l } from "./auth-b047fdc0.mjs";
5
+ import { a as y } from "./organizations-aed4245d.mjs";
6
+ import { m as b } from "./ButtonFollow-00d85977.mjs";
7
+ const x = { class: "w-100 o-scroll" }, g = {
8
+ key: 1,
9
+ class: "w-max gap-thin flex-nowrap flex"
10
+ }, P = {
11
+ __name: "Publics",
12
+ setup(k) {
13
+ let e = c(null);
14
+ u(async () => {
15
+ e.value = await y.read({
16
+ user: l.user._id,
17
+ sort: "numberOfMemberships",
18
+ limit: 10,
19
+ types: ["public"]
20
+ });
21
+ });
22
+ const m = ({ membership: o, isMember: i, targetId: r }) => {
23
+ b.handleMembershipUpdate(e.value, o, i, r);
24
+ };
25
+ return (o, i) => (t(), n("div", x, [
26
+ !s(e) || s(e).length < 1 ? (t(), a(h, {
27
+ key: 0,
28
+ title: "Unfortunately, we couldn't find any recommendations for you",
29
+ description: "Explore and find a community or organization that suits your interests.",
30
+ class: "radius-big bg-grey pd-medium"
31
+ })) : (t(), n("div", g, [
32
+ s(e) ? (t(!0), n(d, { key: 0 }, _(s(e), (r, v) => (t(), a(f, {
33
+ key: r._id,
34
+ organization: r,
35
+ user: l.user,
36
+ onUpdateMembership: m,
37
+ class: "flex-child-1 flex-child w-25r"
38
+ }, null, 8, ["organization", "user"]))), 128)) : p("", !0)
39
+ ]))
40
+ ]));
41
+ }
42
+ };
43
+ export {
44
+ P as _
45
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),h=require("./index-7ecbf72a.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(l,{emit:p}){const a=l,o=e.ref(null),r=e.ref(null);e.watch(a,({photo:t})=>{t&&(o.value=t)});function f(){r.value.click()}async function i(t){let n=t.target.files[0],s=new FormData;s.append("file",n);try{let u=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=u.data.filepath,p("update:photo",o.value)}catch(c){console.error(c)}}function d(t){t.preventDefault(),i({target:{files:t.dataTransfer.files}})}return(t,n)=>(e.openBlock(),e.createElementBlock("div",{onClick:f,onDrop:d,onDragover:n[0]||(n[0]=e.withModifiers(()=>{},["prevent"])),class:"image-upload-area flex-v-center flex-h-center flex"},[o.value||l.photo?(e.openBlock(),e.createElementBlock("img",{key:0,src:(t.FILE_SERVER_URL||"")+(o.value||l.photo),alt:"Uploaded image",class:"w-100 h-100 object-fit-cover"},null,8,C)):(e.openBlock(),e.createElementBlock("div",m,g)),e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:r,onChange:i,style:{display:"none"}},null,544)],32))}};exports._sfc_main=w;
@@ -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 "./index-0ab9d59c.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
+ ], D = {
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: (e.FILE_SERVER_URL || "") + (t.value || a.photo),
68
+ alt: "Uploaded image",
69
+ class: "w-100 h-100 object-fit-cover"
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
+ D as _
83
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),m=require("./index-7ecbf72a.js"),h=e.createElementVNode("div",{class:"flex-v-center flex-h-center flex w-100 h-100"}," upload ",-1),v={__name:"UploadImageMultiple",props:["uploadPath"],emits:["update:images"],setup(i,{emit:p}){const c=i,a=e.ref([]),l=e.ref(null);function f(){l.value.click()}async function r(n){let o=n.target.files,s=new FormData;for(let t=0;t<o.length;t++)s.append("file",o[t]);try{(await m.axios.create({baseURL:process.env.API_URL,withCredentials:!0}).post(`/api/upload/multiple?folderName=${encodeURIComponent(c.uploadPath)}`,s,{headers:{"Content-Type":"multipart/form-data"}})).data.forEach(d=>{a.value.push(d.filepath)}),p("update:images",a.value)}catch(t){console.error(t)}}function u(n){n.preventDefault(),r({target:{files:n.dataTransfer.files}})}return(n,o)=>(e.openBlock(),e.createElementBlock("div",{onClick:f,onDrop:u,onDragover:o[0]||(o[0]=e.withModifiers(()=>{},["prevent"])),class:"flex-v-center flex-h-center flex"},[h,e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:l,onChange:r,multiple:"",style:{display:"none"}},null,544)],32))}};exports._sfc_main=v;
@@ -0,0 +1,58 @@
1
+ import { ref as s, openBlock as h, createElementBlock as v, withModifiers as x, createElementVNode as i } from "vue";
2
+ import { a as g } from "./index-0ab9d59c.mjs";
3
+ const _ = /* @__PURE__ */ i("div", { class: "flex-v-center flex-h-center flex w-100 h-100" }, " upload ", -1), D = {
4
+ __name: "UploadImageMultiple",
5
+ props: [
6
+ "uploadPath"
7
+ ],
8
+ emits: ["update:images"],
9
+ setup(p, { emit: f }) {
10
+ const c = p, a = s([]), n = s(null);
11
+ function u() {
12
+ n.value.click();
13
+ }
14
+ async function l(t) {
15
+ let o = t.target.files, r = new FormData();
16
+ for (let e = 0; e < o.length; e++)
17
+ r.append("file", o[e]);
18
+ try {
19
+ (await g.create({ baseURL: process.env.API_URL, withCredentials: !0 }).post(`/api/upload/multiple?folderName=${encodeURIComponent(c.uploadPath)}`, r, {
20
+ headers: {
21
+ "Content-Type": "multipart/form-data"
22
+ }
23
+ })).data.forEach((d) => {
24
+ a.value.push(d.filepath);
25
+ }), f("update:images", a.value);
26
+ } catch (e) {
27
+ console.error(e);
28
+ }
29
+ }
30
+ function m(t) {
31
+ t.preventDefault(), l({
32
+ target: {
33
+ files: t.dataTransfer.files
34
+ }
35
+ });
36
+ }
37
+ return (t, o) => (h(), v("div", {
38
+ onClick: u,
39
+ onDrop: m,
40
+ onDragover: o[0] || (o[0] = x(() => {
41
+ }, ["prevent"])),
42
+ class: "flex-v-center flex-h-center flex"
43
+ }, [
44
+ _,
45
+ i("input", {
46
+ type: "file",
47
+ ref_key: "fileInput",
48
+ ref: n,
49
+ onChange: l,
50
+ multiple: "",
51
+ style: { display: "none" }
52
+ }, null, 544)
53
+ ], 32));
54
+ }
55
+ };
56
+ export {
57
+ D as _
58
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";const G=require("./index-7ecbf72a.js"),H=require("vue"),j=require("./globals-928eb13c.js");var Z={exports:{}};/*!
2
+ * JavaScript Cookie v2.2.1
3
+ * https://github.com/js-cookie/js-cookie
4
+ *
5
+ * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
6
+ * Released under the MIT license
7
+ */(function(r,e){(function(t){var o;if(r.exports=t(),o=!0,!o){var n=window.Cookies,s=window.Cookies=t();s.noConflict=function(){return window.Cookies=n,s}}})(function(){function t(){for(var s=0,i={};s<arguments.length;s++){var a=arguments[s];for(var d in a)i[d]=a[d]}return i}function o(s){return s.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function n(s){function i(){}function a(c,p,l){if(!(typeof document>"u")){l=t({path:"/"},i.defaults,l),typeof l.expires=="number"&&(l.expires=new Date(new Date*1+l.expires*864e5)),l.expires=l.expires?l.expires.toUTCString():"";try{var b=JSON.stringify(p);/^[\{\[]/.test(b)&&(p=b)}catch{}p=s.write?s.write(p,c):encodeURIComponent(String(p)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),c=encodeURIComponent(String(c)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var y="";for(var C in l)l[C]&&(y+="; "+C,l[C]!==!0&&(y+="="+l[C].split(";")[0]));return document.cookie=c+"="+p+y}}function d(c,p){if(!(typeof document>"u")){for(var l={},b=document.cookie?document.cookie.split("; "):[],y=0;y<b.length;y++){var C=b[y].split("="),h=C.slice(1).join("=");!p&&h.charAt(0)==='"'&&(h=h.slice(1,-1));try{var A=o(C[0]);if(h=(s.read||s)(h,A)||o(h),p)try{h=JSON.parse(h)}catch{}if(l[A]=h,c===A)break}catch{}}return c?l[c]:l}}return i.set=a,i.get=function(c){return d(c,!1)},i.getJSON=function(c){return d(c,!0)},i.remove=function(c,p){a(c,"",t(p,{expires:-1}))},i.defaults={},i.withConverter=n,i}return n(function(){})})})(Z);var de=Z.exports;const R=G.getDefaultExportFromCjs(de);/*! Capacitor: https://capacitorjs.com/ - MIT License */const ue=r=>{const e=new Map;e.set("web",{name:"web"});const t=r.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:e},o=(s,i)=>{t.platforms.set(s,i)},n=s=>{t.platforms.has(s)&&(t.currentPlatform=t.platforms.get(s))};return t.addPlatform=o,t.setPlatform=n,t},fe=r=>r.CapacitorPlatforms=ue(r),Q=fe(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});Q.addPlatform;Q.setPlatform;var _;(function(r){r.Unimplemented="UNIMPLEMENTED",r.Unavailable="UNAVAILABLE"})(_||(_={}));class F extends Error{constructor(e,t,o){super(e),this.message=e,this.code=t,this.data=o}}const pe=r=>{var e,t;return r!=null&&r.androidBridge?"android":!((t=(e=r==null?void 0:r.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||t===void 0)&&t.bridge?"ios":"web"},ge=r=>{var e,t,o,n,s;const i=r.CapacitorCustomPlatform||null,a=r.Capacitor||{},d=a.Plugins=a.Plugins||{},c=r.CapacitorPlatforms,p=()=>i!==null?i.name:pe(r),l=((e=c==null?void 0:c.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||p,b=()=>l()!=="web",y=((t=c==null?void 0:c.currentPlatform)===null||t===void 0?void 0:t.isNativePlatform)||b,C=u=>{const f=B.get(u);return!!(f!=null&&f.platforms.has(l())||T(u))},h=((o=c==null?void 0:c.currentPlatform)===null||o===void 0?void 0:o.isPluginAvailable)||C,A=u=>{var f;return(f=a.PluginHeaders)===null||f===void 0?void 0:f.find(x=>x.name===u)},T=((n=c==null?void 0:c.currentPlatform)===null||n===void 0?void 0:n.getPluginHeader)||A,se=u=>r.console.error(u),ne=(u,f,x)=>Promise.reject(`${x} does not have an implementation of "${f}".`),B=new Map,oe=(u,f={})=>{const x=B.get(u);if(x)return console.warn(`Capacitor plugin "${u}" already registered. Cannot register plugins twice.`),x.proxy;const k=l(),S=T(u);let O;const ie=async()=>(!O&&k in f?O=typeof f[k]=="function"?O=await f[k]():O=f[k]:i!==null&&!O&&"web"in f&&(O=typeof f.web=="function"?O=await f.web():O=f.web),O),ce=(g,w)=>{var P,L;if(S){const E=S==null?void 0:S.methods.find(v=>w===v.name);if(E)return E.rtype==="promise"?v=>a.nativePromise(u,w.toString(),v):(v,I)=>a.nativeCallback(u,w.toString(),v,I);if(g)return(P=g[w])===null||P===void 0?void 0:P.bind(g)}else{if(g)return(L=g[w])===null||L===void 0?void 0:L.bind(g);throw new F(`"${u}" plugin is not implemented on ${k}`,_.Unimplemented)}},W=g=>{let w;const P=(...L)=>{const E=ie().then(v=>{const I=ce(v,g);if(I){const D=I(...L);return w=D==null?void 0:D.remove,D}else throw new F(`"${u}.${g}()" is not implemented on ${k}`,_.Unimplemented)});return g==="addListener"&&(E.remove=async()=>w()),E};return P.toString=()=>`${g.toString()}() { [capacitor code] }`,Object.defineProperty(P,"name",{value:g,writable:!1,configurable:!1}),P},K=W("addListener"),V=W("removeListener"),le=(g,w)=>{const P=K({eventName:g},w),L=async()=>{const v=await P;V({eventName:g,callbackId:v},w)},E=new Promise(v=>P.then(()=>v({remove:L})));return E.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await L()},E},q=new Proxy({},{get(g,w){switch(w){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return S?le:K;case"removeListener":return V;default:return W(w)}}});return d[u]=q,B.set(u,{name:u,proxy:q,platforms:new Set([...Object.keys(f),...S?[k]:[]])}),q},ae=((s=c==null?void 0:c.currentPlatform)===null||s===void 0?void 0:s.registerPlugin)||oe;return a.convertFileSrc||(a.convertFileSrc=u=>u),a.getPlatform=l,a.handleError=se,a.isNativePlatform=y,a.isPluginAvailable=h,a.pluginMethodNoop=ne,a.registerPlugin=ae,a.Exception=F,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a.platform=a.getPlatform(),a.isNative=a.isNativePlatform(),a},me=r=>r.Capacitor=ge(r),M=me(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),X=M.registerPlugin;M.Plugins;class Y{constructor(e){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)}addListener(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const s=async()=>this.removeListener(e,t),i=Promise.resolve({remove:s});return Object.defineProperty(i,"remove",{value:async()=>{console.warn("Using addListener() without 'await' is deprecated."),await s()}}),i}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,t){const o=this.listeners[e];o&&o.forEach(n=>n(t))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:o=>{this.notifyListeners(t,o)}}}unimplemented(e="not implemented"){return new M.Exception(e,_.Unimplemented)}unavailable(e="not available"){return new M.Exception(e,_.Unavailable)}async removeListener(e,t){const o=this.listeners[e];if(!o)return;const n=o.indexOf(t);this.listeners[e].splice(n,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}}const z=r=>encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),N=r=>r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class we extends Y{async getCookies(){const e=document.cookie,t={};return e.split(";").forEach(o=>{if(o.length<=0)return;let[n,s]=o.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");n=N(n).trim(),s=N(s).trim(),t[n]=s}),t}async setCookie(e){try{const t=z(e.key),o=z(e.value),n=`; expires=${(e.expires||"").replace("expires=","")}`,s=(e.path||"/").replace("path=",""),i=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${t}=${o||""}${n}; path=${s}; ${i};`}catch(t){return Promise.reject(t)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(t){return Promise.reject(t)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const t of e)document.cookie=t.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}const ee=X("CapacitorCookies",{web:()=>new we}),he=async r=>new Promise((e,t)=>{const o=new FileReader;o.onload=()=>{const n=o.result;e(n.indexOf(",")>=0?n.split(",")[1]:n)},o.onerror=n=>t(n),o.readAsDataURL(r)}),ve=(r={})=>{const e=Object.keys(r);return Object.keys(r).map(n=>n.toLocaleLowerCase()).reduce((n,s,i)=>(n[s]=r[e[i]],n),{})},Pe=(r,e=!0)=>r?Object.entries(r).reduce((o,n)=>{const[s,i]=n;let a,d;return Array.isArray(i)?(d="",i.forEach(c=>{a=e?encodeURIComponent(c):c,d+=`${s}=${a}&`}),d.slice(0,-1)):(a=e?encodeURIComponent(i):i,d=`${s}=${a}`),`${o}&${d}`},"").substr(1):null,be=(r,e={})=>{const t=Object.assign({method:r.method||"GET",headers:r.headers},e),n=ve(r.headers)["content-type"]||"";if(typeof r.data=="string")t.body=r.data;else if(n.includes("application/x-www-form-urlencoded")){const s=new URLSearchParams;for(const[i,a]of Object.entries(r.data||{}))s.set(i,a);t.body=s.toString()}else if(n.includes("multipart/form-data")){const s=new FormData;if(r.data instanceof FormData)r.data.forEach((a,d)=>{s.append(d,a)});else for(const a of Object.keys(r.data))s.append(a,r.data[a]);t.body=s;const i=new Headers(t.headers);i.delete("content-type"),t.headers=i}else(n.includes("application/json")||typeof r.data=="object")&&(t.body=JSON.stringify(r.data));return t};class ye extends Y{async request(e){const t=be(e,e.webFetchExtra),o=Pe(e.params,e.shouldEncodeUrlParams),n=o?`${e.url}?${o}`:e.url,s=await fetch(n,t),i=s.headers.get("content-type")||"";let{responseType:a="text"}=s.ok?e:{};i.includes("application/json")&&(a="json");let d,c;switch(a){case"arraybuffer":case"blob":c=await s.blob(),d=await he(c);break;case"json":d=await s.json();break;case"document":case"text":default:d=await s.text()}const p={};return s.headers.forEach((l,b)=>{p[b]=l}),{data:d,headers:p,status:s.status,url:s.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}X("CapacitorHttp",{web:()=>new ye});const Ce=G.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),U=H.reactive({code:{value:"",type:"",method:"",isSended:!1,isValid:!1}});async function te(r,e,t){return await Ce.post("/api/twofa/sendcode",{phone:r.phone.number,email:r.email,method:e,type:t}).then(o=>(U.code=o.data,U.code.isSended=!0,Promise.resolve(o.data)),o=>(console.log(o),j.setError(o),Promise.reject(o)))}H.watch(U,(r,e)=>{});const Oe=Object.freeze(Object.defineProperty({__proto__:null,sendCode:te,state:U},Symbol.toStringTag,{value:"Module"})),$=G.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),m=H.reactive({user:{_id:"",username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1}});if(R.get("user")){const{_id:r,email:e,phone:t,roles:o,accessToken:n}=JSON.parse(R.get("user"));Object.assign(m.user,{_id:r,email:e,phone:t}),Object.assign(m.access,{token:n,roles:o,status:!!n}),$.interceptors.request.use(s=>(n&&(s.headers["x-access-token"]=n),s),s=>Promise.reject(s))}const re={async login(r,e){try{const t=await $.post("/api/auth/signin",{...r,type:e});return J("user",t.data),Object.assign(m.user,{...t.data}),Object.assign(m.access,{token:t.data.accessToken,status:!0,roles:t.data.roles}),t.data}catch(t){return Object.assign(m.access,{token:null,status:!1,roles:null}),j.setError(t),Promise.reject(t)}},async signup(r,e,t){const{password:o,passwordRepeat:n}=m.user;if(o!==n){const s={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw j.setError(s),new Error(s.response.status)}try{r.phone=r.phone.number;const s=await $.post("/api/auth/signup",{...r,type:e,inviteCode:t});return s.data.accessToken&&J("user",s.data),Object.assign(m.user,{...s.data}),Object.assign(m.access,{token:s.data.accessToken,status:!0,roles:s.data.roles}),s.data}catch(s){throw j.setError(s),console.log("Sign up falied"),s}},logout(){Ee("user"),Object.assign(m.user,{email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(m.access,{token:null,status:!1})},async resetPassword(r,e){try{const t=await $.post("/api/auth/reset-password",{email:r.email,phone:r.phone.number,type:e});return Object.assign(U.code,{...t.data,isSended:!0}),t.data}catch(t){return j.setError(t),Promise.reject(t)}},async updatePassword(r,e){const{password:t,passwordRepeat:o}=m.user;if(t!==o){const n={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw j.setError(n),new Error(n.response.status)}try{const n=await $.post("/api/auth/update-password",{email:r.email,phone:r.phone.number,password:r.password,passwordRepeat:r.passwordRepeat,type:e});return n.data.accessToken&&J("user",n.data),Object.assign(m.user,{...n.data}),Object.assign(m.access,{token:n.data.accessToken,status:!0}),n.data}catch(n){return j.setError(n),Promise.reject(n)}}},Le={development:{secure:!1,expires:1},production:{expires:1,domain:process.env.API_URL,sameSite:"none",secure:!0}};function J(r,e,t=process.env.NODE_ENV){process.env.MOBILE_APP?ee.setCookie({url:process.env.API_URL,key:r,value:JSON.stringify(e)}):R.set(r,JSON.stringify(e),Le[t])}function Ee(r,e=process.env.NODE_ENV){if(process.env.MOBILE_APP)ee.deleteCookie({url:process.env.API_URL,key:r});else{const t=e==="production"?{domain:process.env.API_URL}:{};R.remove(r,t)}}H.watch(m,(r,e)=>{});const ke=Object.freeze(Object.defineProperty({__proto__:null,actions:re,state:m},Symbol.toStringTag,{value:"Module"}));exports.Cookies=R;exports.actions=re;exports.auth=ke;exports.sendCode=te;exports.state=m;exports.state$1=U;exports.twofa=Oe;