@ozdao/prometheus-framework 0.1.27 → 0.1.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. package/dist/Chips-493042f7.js +1 -0
  2. package/dist/Chips-9cf6c0da.mjs +286 -0
  3. package/dist/Feed-27f62b1c.mjs +368 -0
  4. package/dist/Feed-7c8c901a.mjs +380 -0
  5. package/dist/Feed-aee74095.js +1 -0
  6. package/dist/Feed-bfd7d1d9.js +1 -0
  7. package/dist/Image-1f7252c0.mjs +477 -0
  8. package/dist/Image-448f9228.js +9 -0
  9. package/dist/Product-3c9c8197.js +7 -0
  10. package/dist/Product-748ec8b7.mjs +842 -0
  11. package/dist/Product-852f952c.js +7 -0
  12. package/dist/Product-bbdc8460.mjs +841 -0
  13. package/dist/ProductEdit-17f4e395.mjs +304 -0
  14. package/dist/ProductEdit-4af06681.js +1 -0
  15. package/dist/ProductEdit-4f9b6d56.js +1 -0
  16. package/dist/ProductEdit-a1050ab6.mjs +303 -0
  17. package/dist/ProfileBlogposts-03d04b92.mjs +66 -0
  18. package/dist/ProfileBlogposts-f9312adf.js +1 -0
  19. package/dist/ProfileComments-6d863cd3.mjs +45 -0
  20. package/dist/ProfileComments-e6970923.js +1 -0
  21. package/dist/ProfileEvents-917169c6.mjs +58 -0
  22. package/dist/ProfileEvents-996bce18.js +1 -0
  23. package/dist/ProfileLikes-0402d1fb.js +1 -0
  24. package/dist/ProfileLikes-92196922.mjs +45 -0
  25. package/dist/auth.client.cjs +8 -8
  26. package/dist/auth.client.js +581 -602
  27. package/dist/auth.validation-2cdd2231.mjs +17 -0
  28. package/dist/auth.validation-30bb0efd.js +1 -0
  29. package/dist/community.client.cjs +1 -1
  30. package/dist/community.client.js +65 -65
  31. package/dist/components/CardFooter/CardFooter.vue.d.ts +1 -1
  32. package/dist/components/CardHeader/CardHeader.vue.d.ts +1 -1
  33. package/dist/events.client.cjs +2 -2
  34. package/dist/events.client.js +6 -6
  35. package/dist/legal.client.cjs +1 -1
  36. package/dist/legal.client.js +2596 -2567
  37. package/dist/modules/community/components/blocks/FooterBlogpost.vue.d.ts +1 -1
  38. package/dist/modules/community/components/sections/Feed.vue.d.ts +1 -1
  39. package/dist/modules/events/components/blocks/CardEvent.vue.d.ts +3 -3
  40. package/dist/modules/events/components/sections/Feed.vue.d.ts +1 -1
  41. package/dist/modules/events/components/sections/List.vue.d.ts +1 -1
  42. package/dist/modules/organizations/components/sections/Feed.vue.d.ts +1 -1
  43. package/dist/modules/organizations/components/sections/Organizations.vue.d.ts +1 -1
  44. package/dist/organizations.client-13fc2cbe.js +3 -0
  45. package/dist/organizations.client-39196bef.mjs +3041 -0
  46. package/dist/organizations.client-85a2ae66.js +3 -0
  47. package/dist/organizations.client-91e84d4f.mjs +3022 -0
  48. package/dist/organizations.client.cjs +1 -1
  49. package/dist/organizations.client.js +43 -42
  50. package/dist/states.validation-766a62a6.mjs +13 -0
  51. package/dist/states.validation-92231934.js +1 -0
  52. package/dist/style.css +1 -1
  53. package/dist/users.client.cjs +1 -1
  54. package/dist/users.client.js +199 -194
  55. package/package.json +1 -1
  56. package/src/components/CardFooter/CardFooter.vue +27 -30
  57. package/src/components/CardHeader/CardHeader.vue +56 -3
  58. package/src/modules/auth/components/pages/SignIn.vue +2 -2
  59. package/src/modules/community/components/layouts/Community.vue +5 -5
  60. package/src/modules/events/components/blocks/CardEvent.vue +3 -2
  61. package/src/modules/events/components/pages/EditEvent.vue +1 -1
  62. package/src/modules/events/router/events.js +1 -0
  63. package/src/modules/legal/components/pages/Legal.vue +33 -17
  64. package/src/modules/legal/router/legal.js +51 -21
  65. package/src/modules/organizations/router/organizations.js +19 -0
  66. package/src/modules/users/components/pages/Profile.vue +2 -2
  67. package/src/modules/users/router/users.js +36 -31
@@ -0,0 +1,380 @@
1
+ import { reactive as B, watch as E, openBlock as r, createElementBlock as o, toDisplayString as d, createCommentVNode as c, createElementVNode as f, ref as g, createTextVNode as S, computed as R, createBlock as v, withModifiers as z, createVNode as h, normalizeClass as I, unref as m, renderSlot as L, onMounted as N, Transition as _, withCtx as P, Fragment as T, renderList as F } from "vue";
2
+ import { _ as M } from "./EmptyState-34d85f10.mjs";
3
+ import { _ as V } from "./_plugin-vue_export-helper-dad06003.mjs";
4
+ import { b as j, _ as O, a as U } from "./Chips-9cf6c0da.mjs";
5
+ import { useRouter as A } from "vue-router";
6
+ import { I as q } from "./IconEdit-eacf3856.mjs";
7
+ import { a as D } from "./index-0ab9d59c.mjs";
8
+ import { s as x } from "./globals-96ba60e4.mjs";
9
+ const k = D.create({ baseURL: process.env.API_URL, withCredentials: !0 });
10
+ k.defaults.withCredentials = !0;
11
+ const p = B({
12
+ all: [],
13
+ filter: {
14
+ // query
15
+ tags: [],
16
+ period: ""
17
+ // pagination
18
+ },
19
+ pagination: {
20
+ page: 1,
21
+ perPage: 18
22
+ },
23
+ // Sort
24
+ sort: {
25
+ current: "popularity",
26
+ ascending: !1
27
+ },
28
+ current: {
29
+ _id: "",
30
+ url: "",
31
+ status: "",
32
+ name: "",
33
+ tags: [],
34
+ owner: {},
35
+ date: "",
36
+ views: 0,
37
+ content: []
38
+ }
39
+ });
40
+ async function $(e = {}) {
41
+ e.params = e.params || {}, e.params.skip = e.skip || 0, e.params.limit = e.limit || 9, e.params.tags = e.tags || [], e.period && (e.params.period = e.period), e.url && (e.params = { url: e.url }), e.category && (e.params.category = e.category), e.organization && (e.params.organization = e.organization), e.owner && (e.params.owner = e.owner), e.creator && (e.params.creator = e.creator), e.status && (e.params.status = e.status), e.user && (e.params.user = e.user), e.params.skip = e.skip || 0, e.params.limit = e.limit || 10;
42
+ try {
43
+ console.log("Request params:" + e.params);
44
+ const t = await k.get("/api/blog/read", { params: e.params });
45
+ return e.url ? w(t.data, "current") : w(t.data, "all"), Promise.resolve(t.data);
46
+ } catch (t) {
47
+ return x(t), Promise.reject(t);
48
+ }
49
+ }
50
+ async function G(e) {
51
+ return k.post("/api/blog/create", e).then(
52
+ (t) => (w(t.data, "current"), Promise.resolve(t.data)),
53
+ (t) => (x(t), Promise.reject(t))
54
+ );
55
+ }
56
+ async function H(e) {
57
+ return k.post("/api/blog/update", e).then(
58
+ (t) => (w(t.data, "current"), Promise.resolve(t.data)),
59
+ (t) => (x(t), Promise.reject(t))
60
+ );
61
+ }
62
+ async function J(e) {
63
+ return await k.delete(`/api/blog/delete/${e}`).then(
64
+ (t) => {
65
+ const a = p.all.findIndex((l) => l._id === e);
66
+ return a !== -1 && p.all.splice(a, 1), Promise.resolve(t.data);
67
+ },
68
+ (t) => (x(t), Promise.reject(t))
69
+ );
70
+ }
71
+ function w(e, t) {
72
+ p[t] = e;
73
+ }
74
+ function K() {
75
+ p.current = {
76
+ _id: "",
77
+ url: "",
78
+ status: "",
79
+ name: "",
80
+ tags: [],
81
+ author: "",
82
+ owner: "",
83
+ date: "",
84
+ views: 0,
85
+ content: []
86
+ };
87
+ }
88
+ function Q(e) {
89
+ const t = {
90
+ order: p.project.content.length + 1,
91
+ type: e.type,
92
+ data: e.data,
93
+ class: e.class,
94
+ content: e.content
95
+ };
96
+ p.project.content.push(t);
97
+ }
98
+ E(p, (e, t) => {
99
+ });
100
+ const Ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
101
+ __proto__: null,
102
+ blockAdd: Q,
103
+ clean: K,
104
+ create: G,
105
+ read: $,
106
+ remove: J,
107
+ set: w,
108
+ state: p,
109
+ update: H
110
+ }, Symbol.toStringTag, { value: "Module" })), W = {
111
+ props: {
112
+ progress: {
113
+ type: Number,
114
+ default: null
115
+ },
116
+ status: {
117
+ type: String,
118
+ default: null
119
+ }
120
+ }
121
+ }, X = { class: "circular-loader" }, Y = /* @__PURE__ */ f("svg", { viewBox: "25 25 50 50" }, [
122
+ /* @__PURE__ */ f("circle", {
123
+ cx: "50",
124
+ cy: "50",
125
+ r: "20",
126
+ fill: "none",
127
+ "stroke-width": "4",
128
+ "stroke-miterlimit": "10"
129
+ })
130
+ ], -1), Z = {
131
+ key: 0,
132
+ class: "progress-text"
133
+ }, ee = {
134
+ key: 1,
135
+ class: "uppercase t-semi w-m-10r status-text"
136
+ };
137
+ function te(e, t, a, l, i, n) {
138
+ return r(), o("div", X, [
139
+ Y,
140
+ a.progress ? (r(), o("div", Z, d(a.progress), 1)) : c("", !0),
141
+ a.status ? (r(), o("div", ee, d(a.status), 1)) : c("", !0)
142
+ ]);
143
+ }
144
+ const ae = /* @__PURE__ */ V(W, [["render", te]]), re = { class: "t-semi br-top-dark flex-nowrap flex-nojustify flex" }, se = /* @__PURE__ */ f("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), le = { class: "cursor-pointer" }, oe = /* @__PURE__ */ f("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), ne = {
145
+ __name: "FooterBlogpost",
146
+ props: ["blogpost", "owner", "user"],
147
+ setup(e) {
148
+ const t = e, a = g(t.blogpost.numberOfReactions), l = g(t.blogpost.isReacted), i = g(t.blogpost.reactionId);
149
+ async function n(y) {
150
+ if (!t.user) {
151
+ alert("Please login to add a reaction");
152
+ return;
153
+ }
154
+ try {
155
+ const s = {
156
+ target: t.blogpost._id,
157
+ type: "blogpost",
158
+ user: t.user,
159
+ class: "like"
160
+ }, b = await j.create(s);
161
+ b.reaction.class === "like" && (a.value += 1, l.value = !0, i.value = b.reaction._id);
162
+ } catch (s) {
163
+ console.error(s), alert("Error adding reaction. Please try again later.");
164
+ }
165
+ }
166
+ async function u(y) {
167
+ if (!t.user) {
168
+ alert("Please login to add a reaction");
169
+ return;
170
+ }
171
+ try {
172
+ const s = { _id: i.value };
173
+ await j.delete(s), a.value -= 1, l.value = !1, i.value = null;
174
+ } catch {
175
+ alert("Error adding reaction. Please try again later.");
176
+ }
177
+ }
178
+ return (y, s) => (r(), o("footer", re, [
179
+ S(" 👁️ " + d(e.blogpost.views) + " ", 1),
180
+ se,
181
+ f("div", le, [
182
+ l.value ? c("", !0) : (r(), o("div", {
183
+ key: 0,
184
+ class: "cursor-pointer",
185
+ onClick: s[0] || (s[0] = (b) => n())
186
+ }, " 👍 " + d(a.value), 1)),
187
+ l.value ? (r(), o("div", {
188
+ key: 1,
189
+ class: "cursor-pointer",
190
+ onClick: s[1] || (s[1] = (b) => u())
191
+ }, " 👍 " + d(a.value), 1)) : c("", !0)
192
+ ]),
193
+ oe,
194
+ S(" 💬 " + d(e.blogpost.numberOfComments), 1)
195
+ ]));
196
+ }
197
+ }, ce = { class: "pos-relative bg-grey radius-big" }, ie = ["src"], ue = { class: "pd-t-zero pd-medium" }, de = {
198
+ key: 0,
199
+ class: "cursor-pointer mn-thin flex-nowrap flex w-100"
200
+ }, me = {
201
+ key: 0,
202
+ class: "pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"
203
+ }, ge = {
204
+ key: 1,
205
+ class: "mn-small t-transp p-big"
206
+ }, pe = {
207
+ key: 2,
208
+ class: "mn-small h2"
209
+ }, fe = {
210
+ __name: "CardBlogpost",
211
+ props: ["blogpost", "user", "type"],
212
+ setup(e) {
213
+ const t = e, a = A(), l = R(() => t.blogpost.content.find((n) => n.type === "ImageUpload")), i = R(() => t.blogpost.content.find((n) => n.type === "Textarea"));
214
+ return (n, u) => (r(), o("article", ce, [
215
+ e.user === e.blogpost.creator.target._id ? (r(), v(q, {
216
+ key: 0,
217
+ onClick: u[0] || (u[0] = z((y) => n.$router.push({
218
+ name: "Edit BlogPost",
219
+ params: {
220
+ url: e.blogpost.url
221
+ }
222
+ }), ["stop"])),
223
+ class: "z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"
224
+ })) : c("", !0),
225
+ h(O, {
226
+ class: I({
227
+ "mn-small pd-medium": e.type !== "short",
228
+ "flex-child-order-last flex-child mn-l-small": e.type === "short"
229
+ }),
230
+ owner: e.blogpost.owner,
231
+ creator: e.blogpost.creator,
232
+ date: e.blogpost.createdAt
233
+ }, null, 8, ["class", "owner", "creator", "date"]),
234
+ m(l) && m(l).content && e.type !== "blogpostPage" ? (r(), o("img", {
235
+ key: 1,
236
+ src: (n.FILE_SERVER_URL || "") + m(l).content,
237
+ alt: "Blog post image",
238
+ class: "mn-medium object-fit-cover w-100 h-20r"
239
+ }, null, 8, ie)) : c("", !0),
240
+ f("section", ue, [
241
+ e.type !== "blogpostPage" ? (r(), o("div", de, [
242
+ f("h3", {
243
+ onClick: u[1] || (u[1] = (y) => m(a).push({
244
+ name: "BlogPost",
245
+ params: {
246
+ url: e.blogpost.url
247
+ }
248
+ })),
249
+ class: ""
250
+ }, d(e.blogpost.name), 1),
251
+ e.blogpost.status === "draft" ? (r(), o("div", me, d(e.blogpost.status), 1)) : c("", !0)
252
+ ])) : c("", !0),
253
+ m(i) && m(i).content && e.type !== "blogpostPage" ? (r(), o("p", ge, d(m(i).content.slice(0, 120)) + "... ", 1)) : c("", !0),
254
+ e.type === "blogpostPage" ? (r(), o("h3", pe, d(e.blogpost.name), 1)) : c("", !0),
255
+ L(n.$slots, "default"),
256
+ e.type !== "short" && e.blogpost.tags.length > 0 ? (r(), v(U, {
257
+ key: 3,
258
+ chips: e.blogpost.tags
259
+ }, null, 8, ["chips"])) : c("", !0)
260
+ ]),
261
+ h(ne, {
262
+ class: "pd-t-zero pd-medium",
263
+ blogpost: e.blogpost,
264
+ user: e.user
265
+ }, null, 8, ["blogpost", "user"])
266
+ ]));
267
+ }
268
+ }, ye = { class: "feed" }, be = { key: 1 }, Se = {
269
+ __name: "Feed",
270
+ props: {
271
+ category: {
272
+ type: String,
273
+ default: null
274
+ },
275
+ owner: {
276
+ type: String,
277
+ default: null
278
+ },
279
+ creator: {
280
+ type: String,
281
+ default: null
282
+ },
283
+ status: {
284
+ type: String,
285
+ default: "published"
286
+ },
287
+ user: {
288
+ type: [String, Number],
289
+ default: null
290
+ },
291
+ period: {
292
+ type: String,
293
+ default: null
294
+ }
295
+ },
296
+ setup(e) {
297
+ const t = e, a = g([]), l = g(!0);
298
+ let i = g(!0), n = g(0), u = g(7);
299
+ const y = async () => {
300
+ if (l.value) {
301
+ n.value += u.value;
302
+ const s = await $({
303
+ skip: n.value,
304
+ limit: u.value,
305
+ category: t.category,
306
+ user: t.user,
307
+ owner: t.owner,
308
+ status: t.status,
309
+ creator: t.creator,
310
+ period: t.period
311
+ });
312
+ s.length === 0 && (l.value = !1), a.value = [...a.value, ...s];
313
+ }
314
+ };
315
+ return N(async () => {
316
+ const s = await $({
317
+ skip: n.value,
318
+ limit: u.value,
319
+ category: t.category,
320
+ user: t.user,
321
+ owner: t.owner,
322
+ status: t.status,
323
+ creator: t.creator,
324
+ period: t.period
325
+ });
326
+ s.length === 0 ? l.value = !1 : l.value = !0, a.value = s, i.value = !1;
327
+ }), (s, b) => (r(), o("section", ye, [
328
+ h(_, { name: "scaleTransition" }, {
329
+ default: P(() => [
330
+ m(i) ? (r(), v(ae, {
331
+ key: 0,
332
+ class: "z-index-5 pos-t-50 left-t-50 pos-absolute"
333
+ })) : c("", !0)
334
+ ]),
335
+ _: 1
336
+ }),
337
+ h(_, { name: "scaleTransition" }, {
338
+ default: P(() => [
339
+ !m(i) && a.value.length < 1 ? (r(), v(M, {
340
+ key: 0,
341
+ title: "No Blog Posts Found",
342
+ description: "Currently, there are no posts available in this blog. Please check back later.",
343
+ class: "pd-medium mn-thin bg-grey radius-big"
344
+ })) : (r(), o("div", be, [
345
+ (r(!0), o(T, null, F(a.value, (C) => (r(), v(fe, {
346
+ key: C._id,
347
+ blogpost: C,
348
+ user: e.user,
349
+ class: "mn-medium"
350
+ }, null, 8, ["blogpost", "user"]))), 128)),
351
+ h(_, { name: "scaleTransition" }, {
352
+ default: P(() => [
353
+ l.value && a.value.length > 0 ? (r(), o("button", {
354
+ key: 0,
355
+ onClick: y,
356
+ class: "w-100 bg-main button"
357
+ }, " Load more ")) : c("", !0)
358
+ ]),
359
+ _: 1
360
+ })
361
+ ]))
362
+ ]),
363
+ _: 1
364
+ })
365
+ ]));
366
+ }
367
+ };
368
+ export {
369
+ ae as L,
370
+ Se as _,
371
+ G as a,
372
+ J as b,
373
+ K as c,
374
+ fe as d,
375
+ ne as e,
376
+ Ce as f,
377
+ $ as r,
378
+ p as s,
379
+ H as u
380
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),N=require("./EmptyState-7658d7d6.js"),_=require("./_plugin-vue_export-helper-f246444f.js"),p=require("./Chips-493042f7.js"),C=require("vue-router"),V=require("./IconEdit-4cfe2115.js"),P=require("./index-7ecbf72a.js"),y=require("./globals-928eb13c.js"),g=P.axios.create({baseURL:process.env.API_URL,withCredentials:!0});g.defaults.withCredentials=!0;const i=e.reactive({all:[],filter:{tags:[],period:""},pagination:{page:1,perPage:18},sort:{current:"popularity",ascending:!1},current:{_id:"",url:"",status:"",name:"",tags:[],owner:{},date:"",views:0,content:[]}});async function f(t={}){t.params=t.params||{},t.params.skip=t.skip||0,t.params.limit=t.limit||9,t.params.tags=t.tags||[],t.period&&(t.params.period=t.period),t.url&&(t.params={url:t.url}),t.category&&(t.params.category=t.category),t.organization&&(t.params.organization=t.organization),t.owner&&(t.params.owner=t.owner),t.creator&&(t.params.creator=t.creator),t.status&&(t.params.status=t.status),t.user&&(t.params.user=t.user),t.params.skip=t.skip||0,t.params.limit=t.limit||10;try{console.log("Request params:"+t.params);const r=await g.get("/api/blog/read",{params:t.params});return t.url?m(r.data,"current"):m(r.data,"all"),Promise.resolve(r.data)}catch(r){return y.setError(r),Promise.reject(r)}}async function b(t){return g.post("/api/blog/create",t).then(r=>(m(r.data,"current"),Promise.resolve(r.data)),r=>(y.setError(r),Promise.reject(r)))}async function v(t){return g.post("/api/blog/update",t).then(r=>(m(r.data,"current"),Promise.resolve(r.data)),r=>(y.setError(r),Promise.reject(r)))}async function h(t){return await g.delete(`/api/blog/delete/${t}`).then(r=>{const a=i.all.findIndex(s=>s._id===t);return a!==-1&&i.all.splice(a,1),Promise.resolve(r.data)},r=>(y.setError(r),Promise.reject(r)))}function m(t,r){i[r]=t}function B(){i.current={_id:"",url:"",status:"",name:"",tags:[],author:"",owner:"",date:"",views:0,content:[]}}function S(t){const r={order:i.project.content.length+1,type:t.type,data:t.data,class:t.class,content:t.content};i.project.content.push(r)}e.watch(i,(t,r)=>{});const $=Object.freeze(Object.defineProperty({__proto__:null,blockAdd:S,clean:B,create:b,read:f,remove:h,set:m,state:i,update:v},Symbol.toStringTag,{value:"Module"})),R={props:{progress:{type:Number,default:null},status:{type:String,default:null}}},T={class:"circular-loader"},j=e.createElementVNode("svg",{viewBox:"25 25 50 50"},[e.createElementVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"4","stroke-miterlimit":"10"})],-1),D={key:0,class:"progress-text"},q={key:1,class:"uppercase t-semi w-m-10r status-text"};function z(t,r,a,s,n,l){return e.openBlock(),e.createElementBlock("div",T,[j,a.progress?(e.openBlock(),e.createElementBlock("div",D,e.toDisplayString(a.progress),1)):e.createCommentVNode("",!0),a.status?(e.openBlock(),e.createElementBlock("div",q,e.toDisplayString(a.status),1)):e.createCommentVNode("",!0)])}const w=_._export_sfc(R,[["render",z]]),I={class:"t-semi br-top-dark flex-nowrap flex-nojustify flex"},L=e.createElementVNode("span",{class:"mn-r-small mn-l-small d-block"},"·",-1),F={class:"cursor-pointer"},M=e.createElementVNode("span",{class:"mn-r-small mn-l-small d-block"},"·",-1),E={__name:"FooterBlogpost",props:["blogpost","owner","user"],setup(t){const r=t,a=e.ref(r.blogpost.numberOfReactions),s=e.ref(r.blogpost.isReacted),n=e.ref(r.blogpost.reactionId);async function l(u){if(!r.user){alert("Please login to add a reaction");return}try{const o={target:r.blogpost._id,type:"blogpost",user:r.user,class:"like"},d=await p.actions.create(o);d.reaction.class==="like"&&(a.value+=1,s.value=!0,n.value=d.reaction._id)}catch(o){console.error(o),alert("Error adding reaction. Please try again later.")}}async function c(u){if(!r.user){alert("Please login to add a reaction");return}try{const o={_id:n.value};await p.actions.delete(o),a.value-=1,s.value=!1,n.value=null}catch{alert("Error adding reaction. Please try again later.")}}return(u,o)=>(e.openBlock(),e.createElementBlock("footer",I,[e.createTextVNode(" 👁️ "+e.toDisplayString(t.blogpost.views)+" ",1),L,e.createElementVNode("div",F,[s.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"cursor-pointer",onClick:o[0]||(o[0]=d=>l())}," 👍 "+e.toDisplayString(a.value),1)),s.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cursor-pointer",onClick:o[1]||(o[1]=d=>c())}," 👍 "+e.toDisplayString(a.value),1)):e.createCommentVNode("",!0)]),M,e.createTextVNode(" 💬 "+e.toDisplayString(t.blogpost.numberOfComments),1)]))}},O={class:"pos-relative bg-grey radius-big"},U=["src"],A={class:"pd-t-zero pd-medium"},H={key:0,class:"cursor-pointer mn-thin flex-nowrap flex w-100"},G={key:0,class:"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"},J={key:1,class:"mn-small t-transp p-big"},K={key:2,class:"mn-small h2"},x={__name:"CardBlogpost",props:["blogpost","user","type"],setup(t){const r=t,a=C.useRouter(),s=e.computed(()=>r.blogpost.content.find(l=>l.type==="ImageUpload")),n=e.computed(()=>r.blogpost.content.find(l=>l.type==="Textarea"));return(l,c)=>(e.openBlock(),e.createElementBlock("article",O,[t.user===t.blogpost.creator.target._id?(e.openBlock(),e.createBlock(V.IconEdit,{key:0,onClick:c[0]||(c[0]=e.withModifiers(u=>l.$router.push({name:"Edit BlogPost",params:{url:t.blogpost.url}}),["stop"])),class:"z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"})):e.createCommentVNode("",!0),e.createVNode(p._sfc_main,{class:e.normalizeClass({"mn-small pd-medium":t.type!=="short","flex-child-order-last flex-child mn-l-small":t.type==="short"}),owner:t.blogpost.owner,creator:t.blogpost.creator,date:t.blogpost.createdAt},null,8,["class","owner","creator","date"]),e.unref(s)&&e.unref(s).content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("img",{key:1,src:(l.FILE_SERVER_URL||"")+e.unref(s).content,alt:"Blog post image",class:"mn-medium object-fit-cover w-100 h-20r"},null,8,U)):e.createCommentVNode("",!0),e.createElementVNode("section",A,[t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("h3",{onClick:c[1]||(c[1]=u=>e.unref(a).push({name:"BlogPost",params:{url:t.blogpost.url}})),class:""},e.toDisplayString(t.blogpost.name),1),t.blogpost.status==="draft"?(e.openBlock(),e.createElementBlock("div",G,e.toDisplayString(t.blogpost.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(n)&&e.unref(n).content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("p",J,e.toDisplayString(e.unref(n).content.slice(0,120))+"... ",1)):e.createCommentVNode("",!0),t.type==="blogpostPage"?(e.openBlock(),e.createElementBlock("h3",K,e.toDisplayString(t.blogpost.name),1)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default"),t.type!=="short"&&t.blogpost.tags.length>0?(e.openBlock(),e.createBlock(p._sfc_main$1,{key:3,chips:t.blogpost.tags},null,8,["chips"])):e.createCommentVNode("",!0)]),e.createVNode(E,{class:"pd-t-zero pd-medium",blogpost:t.blogpost,user:t.user},null,8,["blogpost","user"])]))}},Q={class:"feed"},W={key:1},X={__name:"Feed",props:{category:{type:String,default:null},owner:{type:String,default:null},creator:{type:String,default:null},status:{type:String,default:"published"},user:{type:[String,Number],default:null},period:{type:String,default:null}},setup(t){const r=t,a=e.ref([]),s=e.ref(!0);let n=e.ref(!0),l=e.ref(0),c=e.ref(7);const u=async()=>{if(s.value){l.value+=c.value;const o=await f({skip:l.value,limit:c.value,category:r.category,user:r.user,owner:r.owner,status:r.status,creator:r.creator,period:r.period});o.length===0&&(s.value=!1),a.value=[...a.value,...o]}};return e.onMounted(async()=>{const o=await f({skip:l.value,limit:c.value,category:r.category,user:r.user,owner:r.owner,status:r.status,creator:r.creator,period:r.period});o.length===0?s.value=!1:s.value=!0,a.value=o,n.value=!1}),(o,d)=>(e.openBlock(),e.createElementBlock("section",Q,[e.createVNode(e.Transition,{name:"scaleTransition"},{default:e.withCtx(()=>[e.unref(n)?(e.openBlock(),e.createBlock(w,{key:0,class:"z-index-5 pos-t-50 left-t-50 pos-absolute"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"scaleTransition"},{default:e.withCtx(()=>[!e.unref(n)&&a.value.length<1?(e.openBlock(),e.createBlock(N._sfc_main,{key:0,title:"No Blog Posts Found",description:"Currently, there are no posts available in this blog. Please check back later.",class:"pd-medium mn-thin bg-grey radius-big"})):(e.openBlock(),e.createElementBlock("div",W,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,k=>(e.openBlock(),e.createBlock(x,{key:k._id,blogpost:k,user:t.user,class:"mn-medium"},null,8,["blogpost","user"]))),128)),e.createVNode(e.Transition,{name:"scaleTransition"},{default:e.withCtx(()=>[s.value&&a.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:u,class:"w-100 bg-main button"}," Load more ")):e.createCommentVNode("",!0)]),_:1})]))]),_:1})]))}};exports.Loader=w;exports._sfc_main=X;exports._sfc_main$1=x;exports._sfc_main$2=E;exports.blogposts=$;exports.clean=B;exports.create=b;exports.read=f;exports.remove=h;exports.state=i;exports.update=v;
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),N=require("./EmptyState-7658d7d6.js"),C=require("./Chips-493042f7.js"),V=require("./IconEdit-4cfe2115.js"),D=require("vue-router"),U=require("./_plugin-vue_export-helper-f246444f.js"),$=require("./index-7ecbf72a.js"),h=require("./globals-928eb13c.js"),z={key:0,class:"o-hidden pos-relative bg-grey mn-small w-100"},P=["src"],M=["src"],I={class:"w-max mn-r-thin pd-thin radius-small t-semi bg-main"},F={key:0,class:"t-semi"},L={class:"t-semi"},R={key:0,class:"t-semi uppercase"},_={key:1,class:"cursor-pointer mn-thin flex-nowrap flex w-100"},O={key:0,class:""},q={key:1,class:"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"},j={key:2,class:"mn-small p-big"},b={__name:"CardEvent",props:["event","user","short","type"],setup(t){const r=t;e.ref(new Date),D.useRouter(),e.computed(()=>r.event.content.find(a=>a.type.name==="ImageUpload")),e.computed(()=>r.event.content.find(a=>a.type.name==="Textarea"));const s=e.computed(()=>{const a=new Date,c=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds()),n=new Date(r.event.date.start),o=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds())-c;if(o<0)return"Finished";if(o===0)return"Starting Now";{const f=Math.floor(o/1e3),g=Math.floor(f/60),k=Math.floor(g/60),w=Math.floor(k/24);return w>0?`${w} days until event`:k>0?`${k} hours until event`:g>0?`${g} minutes until event`:`${f} seconds until event`}}),l=e.computed(()=>{const a=new Date(r.event.date.start),c={day:"2-digit",month:"2-digit"};return a.toLocaleDateString(void 0,c)}),i=e.computed(()=>{console.log(r.event.date.start),console.log(r.event.date.end);const a=new Date(r.event.date.start),c=new Date(r.event.date.end),n=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(a),p=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(c);return`${n}-${p}`}),d=e.computed(()=>{const a=r.event.name;return a.length>26?`${a.substring(0,22)}…`:a});return(a,c)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass([{"flex-nowrap flex-v-center flex":t.type==="short"},"pos-relative"])},[e.createVNode(C._sfc_main,{class:e.normalizeClass({"mn-small pd-medium":t.type!=="short","flex-child-order-last flex-child mn-l-small":t.type==="short"}),owner:t.event.owner,creator:t.event.creator,members:t.event.numberOfTickets,membersPhotos:t.event.participantsPhotos,type:t.type,dateFormatted:e.unref(s)},null,8,["class","owner","creator","members","membersPhotos","type","dateFormatted"]),t.event.cover&&t.type!=="short"?(e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("img",{src:(a.FILE_SERVER_URL||"")+t.event.cover,alt:"Event image",class:"pos-relative z-index-1 d-block mn-auto h-20r"},null,8,P),e.createElementVNode("img",{src:(a.FILE_SERVER_URL||"")+t.event.cover,alt:"Event Background",class:"z-index-0 pos-absolute w-100 h-100 pos-t-0 pos-r-0",style:{transform:"scale(1.5)",filter:"blur(2rem)","-webkit-filter":"blur(2rem)"}},null,8,M)])):e.createCommentVNode("",!0),e.createElementVNode("section",{class:e.normalizeClass(["pos-relative w-100",{"pd-t-zero pd-medium":t.type!=="short"}])},[t.user===t.event.creator.target._id?(e.openBlock(),e.createBlock(V.IconEdit,{key:0,onClick:c[0]||(c[0]=e.withModifiers(n=>a.$router.push({name:"Edit Event",params:{url:t.event.url}}),["stop"])),class:"z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([{"mn-small":t.type!=="short"},"flex-v-center flex-nowrap flex"])},[e.createElementVNode("div",I,[t.type!=="short"?(e.openBlock(),e.createElementBlock("span",F,e.toDisplayString(e.unref(l))+" | ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",L,e.toDisplayString(e.unref(i)),1)]),t.type==="short"?(e.openBlock(),e.createElementBlock("span",R,e.toDisplayString(e.unref(d)),1)):e.createCommentVNode("",!0)],2),t.type!=="short"?(e.openBlock(),e.createElementBlock("div",_,[t.type!=="short"?(e.openBlock(),e.createElementBlock("h3",O,e.toDisplayString(t.event.name),1)):e.createCommentVNode("",!0),t.event.status==="draft"?(e.openBlock(),e.createElementBlock("div",q,e.toDisplayString(t.event.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.type!=="short"?(e.openBlock(),e.createElementBlock("p",j,e.toDisplayString(t.event.description),1)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default"),t.type!=="short"&&t.event.tags.length>0?(e.openBlock(),e.createBlock(C._sfc_main$1,{key:3,chips:t.event.tags},null,8,["chips"])):e.createCommentVNode("",!0)],2)],2))}},H={},G={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},Y=e.createStaticVNode('<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),A=[Y];function J(t,r){return e.openBlock(),e.createElementBlock("svg",G,A)}const E=U._export_sfc(H,[["render",J]]),y=$.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),u=e.reactive({all:[],filter:{tags:[],period:"",date:null},pagination:{page:1,perPage:18},sort:{current:"popularity",ascending:!1},current:{_id:"",cover:"",url:"",status:"",name:"",tags:[],date:{start:null,false:null},views:0,content:[]}});async function v(t={}){t.params=t.params||{},t.params.skip=t.skip||0,t.params.limit=t.limit||9,t.params.tags=t.tags||[],t.status&&(t.params={status:t.status}),t.url&&(t.params={url:t.url}),t.period&&(t.params.period=t.period),t.category&&(t.params.category=t.category),t.organization&&(t.params.organization=t.organization),t.date&&(t.params.date=t.date),t.participant&&(t.params.participant=t.participant),t.owner&&(t.params.owner=t.owner),t.creator&&(t.params.creator=t.creator),t.user&&(t.params.user=t.user),t.sortOrder&&(t.params.sortOrder=t.sortOrder),t.sortParam&&(t.params.sortParam=t.sortParam),t.params.skip=t.skip||0,t.params.limit=t.limit||10;try{console.log("Request params:"+t.params);const r=await y.get("/api/events/read",{params:t.params});return console.log(t.params),t.url?m(r.data,"current"):m(r.data,"all"),Promise.resolve(r.data)}catch(r){return h.setError(r),Promise.reject(r)}}async function x(t){return y.post("/api/events/create",t).then(r=>(m(r.data,"current"),Promise.resolve(r.data)),r=>(h.setError(r),Promise.reject(r)))}async function B(t){return y.post("/api/events/update",t).then(r=>(m(r.data,"current"),Promise.resolve(r.data)),r=>(h.setError(r),Promise.reject(r)))}async function S(t){return await y.post("/api/events/delete",{_id:t}).then(r=>{const s=u.all.findIndex(l=>l._id===t);return s!==-1&&u.all.splice(s,1),Promise.resolve(r.data)},r=>(h.setError(r),Promise.reject(r)))}function m(t,r){u[r]=t}function T(){u.current={_id:"",cover:"",url:"",status:"",name:"",tags:[],date:{start:null,false:null},views:0,content:[]}}e.watch(u,(t,r)=>{});const K=Object.freeze(Object.defineProperty({__proto__:null,clean:T,create:x,read:v,remove:S,set:m,state:u,update:B},Symbol.toStringTag,{value:"Module"})),Q={class:"feed"},W={__name:"Feed",props:{category:{type:String,default:null},selectedDate:{type:String,default:null},organization:{type:String,default:null},owner:{type:String,default:null},creator:{type:String,default:null},user:{type:[String,Number],default:null},sortOrder:{type:String,default:"desc"},participant:{type:String,default:null},period:{type:String,default:null},status:{type:String,default:null}},setup(t){const r=t,s=e.ref([]),l=e.ref(!1),i=e.ref(!0),d=e.ref(0),a=e.ref(20),c=async()=>{if(l.value){d.value+=a.value;const n=await v({skip:d.value,limit:a.value,category:r.category,sortOrder:r.sortOrder,participant:r.participant,creator:r.creator,user:r.user,date:r.selectedDate,owner:r.owner,organization:r.organization,period:r.period,status:r.status});n.length===0?l.value=!1:l.value=!0,s.value=[...s.value,...n]}};return e.onMounted(async()=>{i.value=!0,console.log(r.selectedDate);const n=await v({skip:d.value,limit:a.value,category:r.category,participant:r.participant,sortOrder:r.sortOrder,user:r.user,owner:r.owner,creator:r.creator,date:r.selectedDate,organization:r.organization,period:r.period,status:r.status});n.length===0?l.value=!1:l.value=!0,s.value=n,i.value=!1}),(n,p)=>(e.openBlock(),e.createElementBlock("section",Q,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"scaleTransition",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[i.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.value,o=>(e.openBlock(),e.createBlock(E,{key:o}))),128)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"scaleTransition"},{default:e.withCtx(()=>[!i.value&&s.value.length<1?(e.openBlock(),e.createBlock(N._sfc_main,{key:0,title:"No Events Found",description:"Currently, there are no events available. Please check back later.",class:"pd-medium mn-thin bg-grey radius-big"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.TransitionGroup,{tag:"ul",name:"scaleTransition",class:"container"},{default:e.withCtx(()=>[!i.value&&s.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s.value,(o,f)=>(e.openBlock(),e.createBlock(b,{onClick:g=>n.$router.push({name:"Event",params:{url:o.url}}),key:o._id,event:o,owner:t.user,type:"normal",class:e.normalizeClass(["bg-grey radius-big mn-medium",{"br-b br-solid br-black-transp-10":f!==s.value.length-1}])},null,8,["onClick","event","owner","class"]))),128)):e.createCommentVNode("",!0),l.value&&s.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c,class:"w-100 bg-main button"},"Load more")):e.createCommentVNode("",!0)]),_:1})]))}};exports.SkeletonEvent=E;exports._sfc_main=W;exports._sfc_main$1=b;exports.clean=T;exports.create=x;exports.events=K;exports.read=v;exports.remove=S;exports.state=u;exports.update=B;