@ozdao/prometheus-framework 0.0.96 → 0.0.97

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/dist/Chips-32092a52.js +1 -0
  2. package/dist/Chips-cc08d85a.mjs +108 -0
  3. package/dist/Feed-44f715a7.mjs +439 -0
  4. package/dist/Feed-67f403fb.mjs +366 -0
  5. package/dist/Feed-8a867bfc.js +1 -0
  6. package/dist/Feed-c88eb3aa.js +1 -0
  7. package/dist/Image-d74c19ee.mjs +477 -0
  8. package/dist/Image-fd501859.js +9 -0
  9. package/dist/Product-09a39f0b.js +7 -0
  10. package/dist/Product-b7c53f33.mjs +838 -0
  11. package/dist/ProductEdit-3d7f2823.js +1 -0
  12. package/dist/ProductEdit-e827ea38.mjs +350 -0
  13. package/dist/ProfileBlogposts-6f80b734.mjs +64 -0
  14. package/dist/ProfileBlogposts-e3ea2c82.js +1 -0
  15. package/dist/ProfileComments-0d22a8ec.js +1 -0
  16. package/dist/ProfileComments-c7230f42.mjs +44 -0
  17. package/dist/ProfileEvents-2f22e7cf.mjs +56 -0
  18. package/dist/ProfileEvents-cc65404c.js +1 -0
  19. package/dist/ProfileLikes-e4fa0792.mjs +44 -0
  20. package/dist/ProfileLikes-fa41bad0.js +1 -0
  21. package/dist/ProfileOrganizations-cef668b5.mjs +212 -0
  22. package/dist/ProfileOrganizations-d4ec181b.js +1 -0
  23. package/dist/community.client.cjs +1 -1
  24. package/dist/community.client.js +15 -7
  25. package/dist/events.client.cjs +1 -1
  26. package/dist/events.client.js +37 -29
  27. package/dist/organizations.client-723ebb3b.js +3 -0
  28. package/dist/organizations.client-f4dff584.mjs +3017 -0
  29. package/dist/organizations.client.cjs +1 -1
  30. package/dist/organizations.client.js +4 -4
  31. package/dist/users.client.cjs +1 -1
  32. package/dist/users.client.js +9 -6
  33. package/package.json +1 -1
  34. package/src/components/Chips/Chips.vue +1 -2
  35. package/src/modules/backoffice/components/pages/Organizations.vue +1 -1
  36. package/src/modules/community/components/layouts/Community.vue +2 -2
  37. package/src/modules/community/components/pages/Blog.vue +1 -1
  38. package/src/modules/community/router/blogposts.js +9 -1
  39. package/src/modules/events/router/events.js +9 -1
  40. package/src/modules/organizations/components/pages/Organization.vue +1 -1
  41. package/src/modules/organizations/components/pages/Organizations.vue +1 -1
  42. package/src/modules/organizations/components/pages/OrganizationsAccount.vue +1 -1
  43. package/src/modules/organizations/components/sections/Organizations.vue +1 -1
  44. package/src/modules/users/components/pages/ProfileBlogposts.vue +1 -1
  45. package/src/modules/users/components/pages/ProfileComments.vue +1 -1
  46. package/src/modules/users/components/pages/ProfileEvents.vue +1 -1
  47. package/src/modules/users/components/pages/ProfileLikes.vue +1 -1
  48. package/src/modules/users/components/pages/ProfileOrganizations.vue +1 -1
  49. package/src/modules/users/router/users.js +10 -7
@@ -0,0 +1,212 @@
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-1b0da77c.mjs";
6
+ import { _ as B } from "./_plugin-vue_export-helper-dad06003.mjs";
7
+ import { a as x } from "./organizations-8ffdf84d.mjs";
8
+ import { s as _ } from "./auth-cfeacd61.mjs";
9
+ import "./inputs.validation-14e8e01f.mjs";
10
+ import "./globals-96ba60e4.mjs";
11
+ import "vue-i18n";
12
+ import "./ButtonFollow-6765c266.mjs";
13
+ const E = {}, G = {
14
+ width: "100%",
15
+ height: "20rem",
16
+ xmlns: "http://www.w3.org/2000/svg"
17
+ }, 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 = [
18
+ P
19
+ ];
20
+ function T(b, e) {
21
+ return r(), o("svg", G, R);
22
+ }
23
+ const U = /* @__PURE__ */ B(E, [["render", T]]), j = { class: "feed" }, z = {
24
+ __name: "Feed",
25
+ props: {
26
+ category: {
27
+ type: String,
28
+ default: null
29
+ },
30
+ selectedDate: {
31
+ type: String,
32
+ default: null
33
+ },
34
+ organization: {
35
+ type: String,
36
+ default: null
37
+ },
38
+ owner: {
39
+ type: String,
40
+ default: null
41
+ },
42
+ user: {
43
+ type: [String, Number],
44
+ default: null
45
+ },
46
+ member: {
47
+ type: [String, Number],
48
+ default: null
49
+ },
50
+ subscriber: {
51
+ type: [String, Number],
52
+ default: null
53
+ },
54
+ sortOrder: {
55
+ type: String,
56
+ default: "desc"
57
+ },
58
+ participant: {
59
+ type: String,
60
+ default: null
61
+ },
62
+ period: {
63
+ type: String,
64
+ default: null
65
+ },
66
+ status: {
67
+ type: String,
68
+ default: null
69
+ }
70
+ },
71
+ setup(b) {
72
+ const e = b, a = c([]), n = c(!1), t = c(!0), i = c(0), s = c(20), p = async () => {
73
+ if (n.value) {
74
+ i.value += s.value;
75
+ const l = await x.read({
76
+ skip: i.value,
77
+ limit: s.value,
78
+ category: e.category,
79
+ sortOrder: e.sortOrder,
80
+ member: e.member,
81
+ subscriber: e.subscriber,
82
+ onlyuser: e.onlyuser,
83
+ user: e.user,
84
+ date: e.selectedDate,
85
+ owner: e.owner,
86
+ organization: e.organization,
87
+ period: e.period,
88
+ status: e.status
89
+ });
90
+ l.length === 0 ? n.value = !1 : n.value = !0, a.value = [...a.value, ...l];
91
+ }
92
+ };
93
+ return C(async () => {
94
+ t.value = !0, console.log(e.selectedDate);
95
+ const l = await x.read({
96
+ skip: i.value,
97
+ limit: s.value,
98
+ category: e.category,
99
+ member: e.member,
100
+ subscriber: e.subscriber,
101
+ onlyuser: e.onlyuser,
102
+ sortOrder: e.sortOrder,
103
+ user: e.user,
104
+ owner: e.owner,
105
+ date: e.selectedDate,
106
+ organization: e.organization,
107
+ period: e.period,
108
+ status: e.status
109
+ });
110
+ l.length === 0 ? n.value = !1 : n.value = !0, a.value = l, t.value = !1;
111
+ }), (l, J) => (r(), o("section", j, [
112
+ d(v, {
113
+ tag: "ul",
114
+ name: "fade",
115
+ class: "o-hidden bg-grey radius-big"
116
+ }, {
117
+ default: g(() => [
118
+ t.value ? (r(!0), o(k, { key: 0 }, w(s.value, (m) => (r(), f(U, { key: m }))), 128)) : u("", !0)
119
+ ]),
120
+ _: 1
121
+ }),
122
+ d(h, { name: "fade" }, {
123
+ default: g(() => [
124
+ !t.value && a.value.length < 1 ? (r(), f(L, {
125
+ key: 0,
126
+ title: "No Organizations Found",
127
+ description: "Currently, there are no organizations available. Please check back later.",
128
+ class: "pd-medium mn-thin bg-grey radius-big"
129
+ })) : u("", !0)
130
+ ]),
131
+ _: 1
132
+ }),
133
+ d(v, {
134
+ tag: "ul",
135
+ name: "fade",
136
+ class: "container"
137
+ }, {
138
+ default: g(() => [
139
+ !t.value && a.value.length > 0 ? (r(!0), o(k, { key: 0 }, w(a.value, (m, S) => (r(), f(V, {
140
+ onClick: (K) => l.$router.push({ name: "Organization", params: { _id: m._id } }),
141
+ key: m._id,
142
+ organization: m,
143
+ user: b.user,
144
+ type: "normal",
145
+ class: N(["w-100 radius-big mn-medium", {
146
+ "br-b br-solid br-black-transp-10": S !== a.value.length - 1
147
+ }])
148
+ }, null, 8, ["onClick", "organization", "user", "class"]))), 128)) : u("", !0),
149
+ n.value && a.value.length > 0 ? (r(), o("button", {
150
+ key: 1,
151
+ onClick: p,
152
+ class: "w-100 bg-main button"
153
+ }, "Load more")) : u("", !0)
154
+ ]),
155
+ _: 1
156
+ })
157
+ ]));
158
+ }
159
+ }, A = { class: "pd-thin" }, H = { class: "mn-medium flex-v-center flex-nowrap flex" }, I = /* @__PURE__ */ O("h2", { class: "mn-r-medium" }, "Groups", -1), le = {
160
+ __name: "ProfileOrganizations",
161
+ setup(b) {
162
+ const e = M(), a = D();
163
+ let n = e.query.tab ? e.query.tab : "member";
164
+ const t = c(n);
165
+ return e.query.tab = t.value, q(t, (i) => {
166
+ a.replace({ query: { ...e.query, tab: i } });
167
+ }), (i, s) => (r(), o("div", A, [
168
+ O("header", H, [
169
+ I,
170
+ _.user._id === y(e).params._id ? (r(), o("button", {
171
+ key: 0,
172
+ onClick: s[0] || (s[0] = (p) => i.$router.push({
173
+ name: "Create Organization"
174
+ })),
175
+ class: "radius-100p i-big hover-scale-1 cursor-pointer t-white bg-second"
176
+ }, " + ")) : u("", !0)
177
+ ]),
178
+ d(F, {
179
+ selected: t.value,
180
+ "onUpdate:selected": s[1] || (s[1] = (p) => t.value = p),
181
+ tabs: [
182
+ { name: "Member", value: "member" },
183
+ { name: "Follower", value: "follower" }
184
+ ],
185
+ class: "mn-medium mn-r-medium o-hidden h5 radius-big bg-grey"
186
+ }, null, 8, ["selected"]),
187
+ d(h, { name: "slide-fade" }, {
188
+ default: g(() => [
189
+ t.value === "member" ? (r(), f(z, {
190
+ key: 0,
191
+ user: _.user._id,
192
+ owner: y(e).params._id
193
+ }, null, 8, ["user", "owner"])) : u("", !0)
194
+ ]),
195
+ _: 1
196
+ }),
197
+ d(h, { name: "slide-fade" }, {
198
+ default: g(() => [
199
+ t.value === "follower" ? (r(), f(z, {
200
+ key: 0,
201
+ user: _.user._id,
202
+ subscriber: y(e).params._id
203
+ }, null, 8, ["user", "subscriber"])) : u("", !0)
204
+ ]),
205
+ _: 1
206
+ })
207
+ ]));
208
+ }
209
+ };
210
+ export {
211
+ le as default
212
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),m=require("vue-router"),f=require("./Tab-6f0a4909.js"),y=require("./EmptyState-7658d7d6.js"),h=require("./CardOrganization-43e80590.js"),k=require("./_plugin-vue_export-helper-f246444f.js"),g=require("./organizations-49a10611.js"),d=require("./auth-b61483ce.js");require("./inputs.validation-24ae76b9.js");require("./globals-928eb13c.js");require("vue-i18n");require("./ButtonFollow-4049a57e.js");const _={},v={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},w=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),x=[w];function B(u,t){return e.openBlock(),e.createElementBlock("svg",v,x)}const C=k._export_sfc(_,[["render",B]]),N={class:"feed"},p={__name:"Feed",props:{category:{type:String,default:null},selectedDate:{type:String,default:null},organization:{type:String,default:null},owner:{type:String,default:null},user:{type:[String,Number],default:null},member:{type:[String,Number],default:null},subscriber:{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(u){const t=u,a=e.ref([]),o=e.ref(!1),r=e.ref(!0),l=e.ref(0),n=e.ref(20),c=async()=>{if(o.value){l.value+=n.value;const i=await g.actions.read({skip:l.value,limit:n.value,category:t.category,sortOrder:t.sortOrder,member:t.member,subscriber:t.subscriber,onlyuser:t.onlyuser,user:t.user,date:t.selectedDate,owner:t.owner,organization:t.organization,period:t.period,status:t.status});i.length===0?o.value=!1:o.value=!0,a.value=[...a.value,...i]}};return e.onMounted(async()=>{r.value=!0,console.log(t.selectedDate);const i=await g.actions.read({skip:l.value,limit:n.value,category:t.category,member:t.member,subscriber:t.subscriber,onlyuser:t.onlyuser,sortOrder:t.sortOrder,user:t.user,owner:t.owner,date:t.selectedDate,organization:t.organization,period:t.period,status:t.status});i.length===0?o.value=!1:o.value=!0,a.value=i,r.value=!1}),(i,O)=>(e.openBlock(),e.createElementBlock("section",N,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[r.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.value,s=>(e.openBlock(),e.createBlock(C,{key:s}))),128)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!r.value&&a.value.length<1?(e.openBlock(),e.createBlock(y._sfc_main,{key:0,title:"No Organizations Found",description:"Currently, there are no organizations 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:"fade",class:"container"},{default:e.withCtx(()=>[!r.value&&a.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.value,(s,b)=>(e.openBlock(),e.createBlock(h._sfc_main,{onClick:E=>i.$router.push({name:"Organization",params:{_id:s._id}}),key:s._id,organization:s,user:u.user,type:"normal",class:e.normalizeClass(["w-100 radius-big mn-medium",{"br-b br-solid br-black-transp-10":b!==a.value.length-1}])},null,8,["onClick","organization","user","class"]))),128)):e.createCommentVNode("",!0),o.value&&a.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c,class:"w-100 bg-main button"},"Load more")):e.createCommentVNode("",!0)]),_:1})]))}},z={class:"pd-thin"},q={class:"mn-medium flex-v-center flex-nowrap flex"},V=e.createElementVNode("h2",{class:"mn-r-medium"},"Groups",-1),S={__name:"ProfileOrganizations",setup(u){const t=m.useRoute(),a=m.useRouter();let o=t.query.tab?t.query.tab:"member";const r=e.ref(o);return t.query.tab=r.value,e.watch(r,l=>{a.replace({query:{...t.query,tab:l}})}),(l,n)=>(e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("header",q,[V,d.state.user._id===e.unref(t).params._id?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:n[0]||(n[0]=c=>l.$router.push({name:"Create Organization"})),class:"radius-100p i-big hover-scale-1 cursor-pointer t-white bg-second"}," + ")):e.createCommentVNode("",!0)]),e.createVNode(f._sfc_main,{selected:r.value,"onUpdate:selected":n[1]||(n[1]=c=>r.value=c),tabs:[{name:"Member",value:"member"},{name:"Follower",value:"follower"}],class:"mn-medium mn-r-medium o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="member"?(e.openBlock(),e.createBlock(p,{key:0,user:d.state.user._id,owner:e.unref(t).params._id},null,8,["user","owner"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="follower"?(e.openBlock(),e.createBlock(p,{key:0,user:d.state.user._id,subscriber:e.unref(t).params._id},null,8,["user","subscriber"])):e.createCommentVNode("",!0)]),_:1})]))}};exports.default=S;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),w=require("vue-router"),$=require("./Publics-6b7c97bd.js"),u=require("./Feed-8acc6844.js"),g=require("./auth-b61483ce.js"),x=require("./Image-f66dbbf4.js"),I=require("./Popup-0b38b537.js"),V=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-6f807eb5.js"),z=require("./organizations-49a10611.js"),D=require("./EmptyState-7658d7d6.js"),P=require("./_plugin-vue_export-helper-f246444f.js"),F=require("vue-i18n");require("./globals-928eb13c.js");require("./CardOrganization-43e80590.js");require("./ButtonFollow-4049a57e.js");require("./Chips-92ccc11f.js");require("./IconEdit-4cfe2115.js");require("./vue-draggable-next.esm-bundler-80731ae0.js");const O={class:"min-h-100vh pd-thin"},L={class:"mn-thin flex-v-center t-left flex-nowrap flex"},j={class:"flex-v-center flex-nowrap flex t-left"},U=e.createElementVNode("span",{class:""},"Topics for ",-1),A={class:"bg-grey pd-medium radius-big mn-semi flex-nowrap flex"},H={class:""},T={__name:"Community",setup(c){const r=w.useRoute(),n=w.useRouter();return(t,a)=>{const d=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("header",L,[e.createElementVNode("h2",j,[U,e.createVNode($.Select,{options:["today","week","month","year"],select:u.state.filter.period,"onUpdate:select":a[0]||(a[0]=o=>u.state.filter.period=o),placeholder:"Select type",class:"w-max mn-l-small bg-grey pd-thin radius-medium h2 t-center t-black"},null,8,["select"])])]),e.createElementVNode("ul",A,[e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="featured"},"mn-r-small t-medium pd-small radius-small"]),onClick:a[1]||(a[1]=o=>e.unref(n).push({name:"Blog"}))},"👑 Featured",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="popular"},"mn-r-small t-medium pd-small radius-small"]),onClick:a[2]||(a[2]=o=>e.unref(n).push({name:"Blog",params:{category:"popular"}}))},"🔥 Popular",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="new"},"mn-r-small t-medium pd-small radius-small"]),onClick:a[3]||(a[3]=o=>e.unref(n).push({name:"Blog",params:{category:"new"}}))},"🆕 New",2),g.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="following"},"t-medium pd-small radius-small"]),onClick:a[4]||(a[4]=o=>e.unref(n).push({name:"Blog",params:{category:"following"}}))},"👥 Following",2)):e.createCommentVNode("",!0)]),e.createElementVNode("section",H,[e.createVNode(d,null,{default:e.withCtx(({Component:o,route:m})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o),{ref:"page",key:m.query}))]),_:2},1024)]),_:1})])])}}},R={class:"pd-thin"},J={key:0,class:"h-100 w-100 bg-grey pd-big radius-big"},G={class:"w-full h-full"},Q={key:1,class:"pd-thin pos-fixed pos-l-0 pos-b-0 w-100"},W={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},K={class:"w-m-66r t-left pd-big bg-white radius-big"},X=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),Y=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),Z={key:0,class:"mn-thin"},ee={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},S={__name:"CreateBlogPost",setup(c){const r=w.useRoute(),n=w.useRouter();let t=e.ref(null),a=e.ref(null);const d=e.ref([]),o=e.ref(null);e.onMounted(async()=>{if(r.params.url){const i=await u.read({user:g.state.user._id,url:r.params.url});t.value=i.pop()}else u.clean(),t.value=u.state.current;t.value.owner||(t.value.owner={target:g.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:g.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(o.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const l=await z.actions.read({user:g.state.user._id,postable:g.state.user._id,limit:100});console.log(l),a.value=l.map(i=>({name:i.profile.name,_id:i._id,photo:i.profile.photo}))});const m=e.ref(""),s=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>s.value.filter(l=>l.text.toLowerCase().includes(m.value.toLowerCase()))),e.computed(()=>s.value.filter(l=>!d.value.some(i=>i.text===l.text)));const p=e.ref(!1);function b(){p.value=!0}function v(){p.value=!1}function k(){d.value.length>0&&d.value.map(l=>l.text),t.value.status="draft",r.params.url?u.update(t.value).then(l=>{n.push({name:"BlogPost",params:{url:l.url}})}).catch(l=>{console.log(l)}):u.create(t.value).then(l=>{n.push({name:"BlogPost",params:{url:l.url}})}).catch(l=>{console.log(l)})}function B(){o.value&&(t.value.owner={target:o.value._id,type:"organization"}),o.value||(t.value.creator.hidden=!1),o.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),r.params.url?u.update(t.value).then(l=>{n.push({name:"BlogPost",params:{url:l.url}})}).catch(l=>{console.log(l)}):u.create(t.value).then(l=>{n.push({name:"BlogPost",params:{url:l.url}})}).catch(l=>{console.log(l)})}function N(){confirm("Are you sure you want to delete this post?")&&u.remove(t.value._id).then(l=>{n.push({name:"User Blogposts",params:{_id:t.value.creator.target._id}})}).catch(l=>{console.log(l)})}return(l,i)=>(e.openBlock(),e.createElementBlock("article",R,[e.unref(t)?(e.openBlock(),e.createElementBlock("section",J,[e.createElementVNode("div",G,[e.createVNode(x._sfc_main$3,{prop:e.unref(t),content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])]),e.createVNode(x._sfc_main,{content:e.unref(t).content,onUpdate:i[0]||(i[0]=f=>e.unref(t).content=f)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",Q,[e.createElementVNode("div",W,[e.unref(r).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:i[1]||(i[1]=f=>N()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:i[2]||(i[2]=f=>k()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:i[3]||(i[3]=f=>b()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(I._sfc_main,{title:"Добавить участника",onClosePopup:v,isPopupOpen:p.value},{default:e.withCtx(()=>[e.createElementVNode("div",K,[X,e.createVNode(V._sfc_main,{onTagsChanged:i[4]||(i[4]=f=>e.unref(t).tags=f),tags:e.unref(t).tags},null,8,["tags"]),Y,e.createVNode(V.SelectMulti,{modelValue:o.value,"onUpdate:modelValue":i[5]||(i[5]=f=>o.value=f),options:e.unref(a),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),o.value?(e.openBlock(),e.createElementBlock("h5",Z,"Options:")):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",ee,[e.createVNode(V.Checkbox,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":i[6]||(i[6]=f=>e.unref(t).creator.hidden=f),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(g._sfc_main,{submit:B,callback:l.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])])]),_:1},8,["isPopupOpen"])]))}},C=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"})),te={},oe={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},ne=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),ae=[ne];function re(c,r){return e.openBlock(),e.createElementBlock("svg",oe,ae)}const se=P._export_sfc(te,[["render",re]]),le={class:"pd-thin"},q={__name:"BlogPost",setup(c){const r=w.useRoute(),n=e.ref(null),t=e.ref(!0);e.onMounted(async()=>{t.value=!0;const o=await u.read({user:g.state.user._id,url:r.params.url});n.value=o[0],t.value=!1});const a={Textarea:"p",H2:"h2",Bullets:"p",Caption:"p",ImageUpload:x._sfc_main$2};function d(o){return o.type==="Textarea"?{innerHTML:o.content,class:"p-medium"}:o.type==="H2"?{innerHTML:o.content,class:"h3"}:o.type==="Caption"?{innerHTML:o.content}:o.type==="ImageUpload"?{src:o.content}:{}}return(o,m)=>(e.openBlock(),e.createElementBlock("section",le,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[t.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},e.renderList(3,s=>e.createVNode(se,{key:s})),64)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!t.value&&!n.value?(e.openBlock(),e.createBlock(D._sfc_main,{key:0,title:"No Blogpost Found",description:"Currently, there are no blogposts 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:"fade",class:"container"},{default:e.withCtx(()=>[!t.value&&n.value?(e.openBlock(),e.createBlock(u._sfc_main$1,{key:0,onClick:m[0]||(m[0]=s=>o.$router.push({name:"Blogpost",params:{url:n.value.url}})),blogpost:n.value,user:g.state.user._id,type:"blogpostPage",class:e.normalizeClass(["mn-medium",{"br-b br-solid br-black-transp-10":o.index!==n.value.length-1}])},{default:e.withCtx(()=>[e.createElementVNode("section",null,[n.value&&n.value.content?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.value.content,(s,p)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a[s.type]),e.mergeProps({key:p,index:p,component:s,prop:s,class:s.class,content:"content"},d(s),{class:"mn-regular"}),null,16,["index","component","prop","class"]))),128)):e.createCommentVNode("",!0)])]),_:1},8,["blogpost","user","class"])):e.createCommentVNode("",!0),e.createVNode($._sfc_main,{class:"mn-small"}),!t.value&&n.value?(e.openBlock(),e.createBlock(x._sfc_main$1,{key:1,type:"blogpost",target:n.value._id,owner:g.state.user._id},null,8,["target","owner"])):e.createCommentVNode("",!0)]),_:1})]))}},ie=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"})),M={__name:"Blog",setup(c){const r=w.useRoute(),n=w.useRouter();return r.params.category||(r.params.category="featured"),e.onMounted(()=>{if(r.query){const t=r.query,a={tags:t.tags?t.tags.split(","):[],period:t.period?t.period:"week"};u.state.filter=a}}),e.watch(()=>u.state.filter,(t,a)=>{const d={...r.query};Object.keys(a).forEach(m=>{d[m]&&delete d[m]});const o=Object.fromEntries(Object.entries(t).filter(([m,s])=>Array.isArray(s)&&s.length>0||typeof s=="string"&&s).map(([m,s])=>[m,Array.isArray(s)?s.join(","):s]));Object.assign(d,o),n.push({query:d})},{deep:!0}),(t,a)=>(e.openBlock(),e.createElementBlock("section",null,[e.createVNode(u._sfc_main,{category:e.unref(r).params.category,user:g.state.user._id,period:e.unref(r).query.period},null,8,["category","user","period"])]))}},ce=Object.freeze(Object.defineProperty({__proto__:null,default:M},Symbol.toStringTag,{value:"Module"})),ue={class:"w-100 cols-4 t-left flex-nowrap flex"},de={key:0,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},me=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),pe={class:"t-semi uppercase"},ge=e.createElementVNode("br",null,null,-1),fe={key:1,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},_e=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"💬",-1),he={class:"t-semi uppercase"},ve=e.createElementVNode("br",null,null,-1),be={key:2,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},ye=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),we={class:"t-semi uppercase"},ke=e.createElementVNode("br",null,null,-1),xe={__name:"Activity",props:{likes:Number,comments:Number,subscriptions:Number},setup(c){return(r,n)=>(e.openBlock(),e.createElementBlock("section",ue,[c.likes?(e.openBlock(),e.createElementBlock("div",de,[me,e.createElementVNode("span",pe,[e.createTextVNode(e.toDisplayString(c.likes),1),ge,e.createTextVNode("likes")])])):e.createCommentVNode("",!0),c.comments?(e.openBlock(),e.createElementBlock("div",fe,[_e,e.createElementVNode("span",he,[e.createTextVNode(e.toDisplayString(c.comments),1),ve,e.createTextVNode("comments")])])):e.createCommentVNode("",!0),c.subscriptions?(e.openBlock(),e.createElementBlock("div",be,[ye,e.createElementVNode("span",we,[e.createTextVNode(e.toDisplayString(c.subscriptions),1),ke,e.createTextVNode("subscriptions")])])):e.createCommentVNode("",!0)]))}},Be={class:"pd-thin radius-extra flex-nowrap flex"},Ne=["innerHTML"],Ve={__name:"FieldBig",props:{input:String,placeholder:{type:String},action:{type:String,default:"Action"},placeholderTexts:{type:Object,default:()=>({en:["First placeholder","Second placeholder","Third placeholder"],ru:["Первый плейсхолдер","Второй плейсхолдер","Третий плейсхолдер"]})},typingSpeed:{type:Number,default:200},loopTyping:{type:Boolean,default:!1},enableTyping:{type:Boolean,default:!1}},emits:["update:input","action"],setup(c,{emit:r}){const n=c,{t,locale:a}=F.useI18n();let d=e.ref(0),o=e.ref(n.input),m=e.ref(n.placeholder),s=e.ref(n.enableTyping),p=e.ref(null),b=e.ref(""),v=e.ref(!0),k=null;function B(){r("action")}function N(h){r("update:input",h),b.value=h}function l(){d.value=(d.value+1)%n.placeholderTexts[a.value].length}function i(){s.value=!1,clearInterval(p.value),m.value=n.placeholder,b.value||(o.value="")}function f(){!b.value&&n.enableTyping&&(s.value=!0,m.value="",E())}function E(){let h=n.placeholderTexts[a.value][d.value],_=0,y=!1;k=setInterval(()=>{v.value=!v.value},200),p.value=setInterval(()=>{s.value&&(y?(o.value=o.value.slice(0,-1),o.value=h.substring(0,_)+(v.value&&_%2?"|":""),_--):(o.value=h.substring(0,_)+(v.value&&_%2?"|":""),_++),_>h.length&&n.loopTyping&&setTimeout(()=>{y=!0,o.value=h.substring(0,_)},333),_===0&&y&&(y=!1,l(),h=n.placeholderTexts[a.value][d.value]))},n.typingSpeed)}return e.onMounted(()=>{n.enableTyping&&E()}),e.watchEffect(()=>{s.value||(clearInterval(p.value),clearInterval(k))}),(h,_)=>(e.openBlock(),e.createElementBlock("div",Be,[e.createVNode(g.Field,{field:e.unref(o),"onUpdate:field":[_[0]||(_[0]=y=>e.isRef(o)?o.value=y:o=y),N],placeholder:e.unref(m),onInput:l,onFocus:i,onBlur:f,class:"w-100 pd-small p-big"},null,8,["field","placeholder"]),c.action?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:B,class:"w-min hover_bg-white hover-t-black t-black bg-main button",innerHTML:c.action},null,8,Ne)):e.createCommentVNode("",!0)]))}};const Ee={class:"pd-thin"},Ce={class:"o-hidden t-black bg-main pd-big radius-big"},$e=e.createElementVNode("header",{class:"t-center z-index-1 mn-big"},[e.createElementVNode("h2",{class:"mn-l-auto mn-r-auto w-m-40r mn-medium"},"Stay Updated with The Latest in Cannabis."),e.createElementVNode("p",{class:"t-transp p-big"},"Subscribe to our newsletter for news, insights, and more from the Weeder universe.")],-1),Pe={class:"z-index-1 mn-big w-100 flex-nowrap flex"},Te=e.createElementVNode("div",{class:"w-100 h-100 pos-absolute pos-t-50-negative pos-r-0 z-index-0 grid"},[e.createElementVNode("div",{class:"spiral"})],-1),Se={__name:"SubscribeNewsletter",setup(c){let r=e.ref("");return(n,t)=>(e.openBlock(),e.createElementBlock("section",Ee,[e.createElementVNode("div",Ce,[$e,e.createElementVNode("div",Pe,[e.createVNode(Ve,{input:e.unref(r),typingSpeed:75,loopTyping:!1,enableTyping:!1,placeholder:"Please enter your email",action:"Subscribe","onUpdate:input":t[0]||(t[0]=a=>e.isRef(r)?r.value=a:r=a),onAction:t[1]||(t[1]=a=>n.router.push({name:"Product Recommmendation",query:{mood:n.mood}})),class:"mn-l-auto mn-r-auto bg-white t-black w-50"},null,8,["input"])]),Te])]))}};const qe={class:"container container-joinus"},Me={class:"content"},Ie={class:"h0 mn-big"},ze=e.createElementVNode("p",{class:"w-m-33r t-center mn-small p-big"},"Together, we're shaping the future of the globals cannabis community.",-1),De=e.createElementVNode("button",{class:"bg-black t-white button"},"Join Now",-1),Fe={__name:"JoinUs",setup(c){const r=e.ref(120950),n=e.ref(["/assets/images/reviews/01.png","/assets/images/reviews/02.png","/assets/images/reviews/03.png","/assets/images/reviews/04.png","/assets/images/reviews/05.png","/assets/images/reviews/06.png"]),t=()=>{setInterval(()=>{r.value+=Math.floor(Math.random()*5)+1},330)},a={minSize:"6rem",maxSize:"10rem",minDuration:5,maxDuration:15,spawnPoints:[10,90]};e.onMounted(()=>{d(),t()});const d=()=>{n.value.forEach((o,m)=>{let s=document.createElement("img");s.src=o,s.classList.add("floating-image");let p=a.spawnPoints[Math.floor(Math.random()*a.spawnPoints.length)],b=(Math.random()-.5)*2*10;s.style.left=`${p+b}%`,s.style.animationDuration=`${Math.random()*(a.maxDuration-a.minDuration)+a.minDuration}s`,document.querySelector(".container").appendChild(s),s.addEventListener("animationiteration",()=>{const v=a.spawnPoints[Math.floor(Math.random()*a.spawnPoints.length)],k=(Math.random()-.5)*2*10;s.style.left=`${v+k}%`})})};return(o,m)=>(e.openBlock(),e.createElementBlock("div",qe,[e.createElementVNode("div",Me,[e.createElementVNode("span",Ie,e.toDisplayString(r.value.toLocaleString()),1),ze,De])]))}};const Oe=c=>(e.pushScopeId("data-v-18db0d1b"),c=c(),e.popScopeId(),c),Le={class:"community-feed"},je=Oe(()=>e.createElementVNode("h2",{class:"w-m-75r mn-auto pd-t-big pd-b-big t-center"},"Discover the Vibrant Community",-1)),Ue={class:"grid-container"},Ae={__name:"HotPosts",async setup(c){let r,n;const t=e.ref([]),a=async()=>{const o=await u.read({skip:0,limit:7,period:"year"});console.log(o),t.value=o};[r,n]=e.withAsyncContext(()=>a()),await r,n();const d=o=>{switch(o){case 0:return"grid-item-2x2";case 1:return"grid-item-2x1";case 2:return"grid-item-1x1";case 3:case 4:return"grid-item-1x1";case 6:return"grid-item-2x1";default:return""}};return(o,m)=>(e.openBlock(),e.createElementBlock("section",Le,[je,e.createElementVNode("div",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(s,p)=>(e.openBlock(),e.createBlock(u._sfc_main$1,{blogpost:s,owner:g.state.user._id,key:p,class:e.normalizeClass(d(p))},null,8,["blogpost","owner","class"]))),128))])]))}},He=P._export_sfc(Ae,[["__scopeId","data-v-18db0d1b"]]),Re=[{path:"community",component:T,meta:{title:{en:"Community",ru:"Коммьюнити"}},children:[{path:":category?",name:"Blog",component:()=>Promise.resolve().then(()=>ce)}]},{path:"community/posts/create",name:"Create BlogPost",meta:{title:{en:"Create Post",ru:"Создать Пост"},authorize:[]},component:()=>Promise.resolve().then(()=>C)},{path:"community/posts/:url",name:"BlogPost",meta:{title:{en:"Post",ru:"Пост"}},component:()=>Promise.resolve().then(()=>ie)},{path:"community/posts/:url/edit",name:"Edit BlogPost",meta:{title:{en:"Edit Post",ru:"Редактировать пост"},authorize:[]},component:()=>Promise.resolve().then(()=>C)}];exports.CardBlogpost=u._sfc_main$1;exports.Feed=u._sfc_main;exports.FooterBlogpost=u._sfc_main$2;exports.blogpostsStore=u.blogposts;exports.reactionsStore=u.reactions;exports.Comments=x._sfc_main$1;exports.Activity=xe;exports.Blog=M;exports.BlogPost=q;exports.Community=T;exports.CreateBlogPost=S;exports.HotPosts=He;exports.JoinUs=Fe;exports.SubscribeNewsletter=Se;exports.blogpostsRoutes=Re;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),w=require("vue-router"),$=require("./Publics-6b7c97bd.js"),u=require("./Feed-c88eb3aa.js"),g=require("./auth-b61483ce.js"),x=require("./Image-fd501859.js"),I=require("./Popup-0b38b537.js"),V=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-6f807eb5.js"),z=require("./organizations-49a10611.js"),D=require("./EmptyState-7658d7d6.js"),P=require("./_plugin-vue_export-helper-f246444f.js"),F=require("vue-i18n");require("./globals-928eb13c.js");require("./CardOrganization-43e80590.js");require("./ButtonFollow-4049a57e.js");require("./Chips-32092a52.js");require("./IconEdit-4cfe2115.js");require("./vue-draggable-next.esm-bundler-80731ae0.js");const O={class:"min-h-100vh pd-thin"},L={class:"mn-thin flex-v-center t-left flex-nowrap flex"},j={class:"flex-v-center flex-nowrap flex t-left"},U=e.createElementVNode("span",{class:""},"Topics for ",-1),A={class:"w-max bg-grey pd-medium radius-big mn-semi flex-nowrap flex"},H={class:""},T={__name:"Community",setup(c){const r=w.useRoute(),n=w.useRouter();return(t,a)=>{const d=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("header",L,[e.createElementVNode("h2",j,[U,e.createVNode($.Select,{options:["today","week","month","year"],select:u.state.filter.period,"onUpdate:select":a[0]||(a[0]=o=>u.state.filter.period=o),placeholder:"Select type",class:"w-max mn-l-small bg-grey pd-thin radius-medium h2 t-center t-black"},null,8,["select"])])]),e.createElementVNode("ul",A,[e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="featured"},"mn-r-small t-medium pd-small radius-small"]),onClick:a[1]||(a[1]=o=>e.unref(n).push({name:"Blog"}))},"👑 Featured",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="popular"},"mn-r-small t-medium pd-small radius-small"]),onClick:a[2]||(a[2]=o=>e.unref(n).push({name:"Blog",params:{category:"popular"}}))},"🔥 Popular",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="new"},"mn-r-small t-medium pd-small radius-small"]),onClick:a[3]||(a[3]=o=>e.unref(n).push({name:"Blog",params:{category:"new"}}))},"🆕 New",2),g.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="following"},"t-medium pd-small radius-small"]),onClick:a[4]||(a[4]=o=>e.unref(n).push({name:"Blog",params:{category:"following"}}))},"👥 Following",2)):e.createCommentVNode("",!0)]),e.createElementVNode("section",H,[e.createVNode(d,null,{default:e.withCtx(({Component:o,route:m})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o),{ref:"page",key:m.query}))]),_:2},1024)]),_:1})])])}}},R={class:"pd-thin"},J={key:0,class:"h-100 w-100 bg-grey pd-big radius-big"},G={class:"w-full h-full"},Q={key:1,class:"pd-thin pos-fixed pos-l-0 pos-b-0 w-100"},W={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},K={class:"w-m-66r t-left pd-big bg-white radius-big"},X=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),Y=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),Z={key:0,class:"mn-thin"},ee={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},S={__name:"CreateBlogPost",setup(c){const r=w.useRoute(),n=w.useRouter();let t=e.ref(null),a=e.ref(null);const d=e.ref([]),o=e.ref(null);e.onMounted(async()=>{if(r.params.url){const i=await u.read({user:g.state.user._id,url:r.params.url});t.value=i.pop()}else u.clean(),t.value=u.state.current;t.value.owner||(t.value.owner={target:g.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:g.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(o.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const l=await z.actions.read({user:g.state.user._id,postable:g.state.user._id,limit:100});console.log(l),a.value=l.map(i=>({name:i.profile.name,_id:i._id,photo:i.profile.photo}))});const m=e.ref(""),s=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>s.value.filter(l=>l.text.toLowerCase().includes(m.value.toLowerCase()))),e.computed(()=>s.value.filter(l=>!d.value.some(i=>i.text===l.text)));const p=e.ref(!1);function b(){p.value=!0}function v(){p.value=!1}function k(){d.value.length>0&&d.value.map(l=>l.text),t.value.status="draft",r.params.url?u.update(t.value).then(l=>{n.push({name:"BlogPost",params:{url:l.url}})}).catch(l=>{console.log(l)}):u.create(t.value).then(l=>{n.push({name:"BlogPost",params:{url:l.url}})}).catch(l=>{console.log(l)})}function B(){o.value&&(t.value.owner={target:o.value._id,type:"organization"}),o.value||(t.value.creator.hidden=!1),o.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),r.params.url?u.update(t.value).then(l=>{n.push({name:"BlogPost",params:{url:l.url}})}).catch(l=>{console.log(l)}):u.create(t.value).then(l=>{n.push({name:"BlogPost",params:{url:l.url}})}).catch(l=>{console.log(l)})}function N(){confirm("Are you sure you want to delete this post?")&&u.remove(t.value._id).then(l=>{n.push({name:"User Blogposts",params:{_id:t.value.creator.target._id}})}).catch(l=>{console.log(l)})}return(l,i)=>(e.openBlock(),e.createElementBlock("article",R,[e.unref(t)?(e.openBlock(),e.createElementBlock("section",J,[e.createElementVNode("div",G,[e.createVNode(x._sfc_main$3,{prop:e.unref(t),content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])]),e.createVNode(x._sfc_main,{content:e.unref(t).content,onUpdate:i[0]||(i[0]=_=>e.unref(t).content=_)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",Q,[e.createElementVNode("div",W,[e.unref(r).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:i[1]||(i[1]=_=>N()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:i[2]||(i[2]=_=>k()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:i[3]||(i[3]=_=>b()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(I._sfc_main,{title:"Добавить участника",onClosePopup:v,isPopupOpen:p.value},{default:e.withCtx(()=>[e.createElementVNode("div",K,[X,e.createVNode(V._sfc_main,{onTagsChanged:i[4]||(i[4]=_=>e.unref(t).tags=_),tags:e.unref(t).tags},null,8,["tags"]),Y,e.createVNode(V.SelectMulti,{modelValue:o.value,"onUpdate:modelValue":i[5]||(i[5]=_=>o.value=_),options:e.unref(a),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),o.value?(e.openBlock(),e.createElementBlock("h5",Z,"Options:")):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",ee,[e.createVNode(V.Checkbox,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":i[6]||(i[6]=_=>e.unref(t).creator.hidden=_),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(g._sfc_main,{submit:B,callback:l.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])])]),_:1},8,["isPopupOpen"])]))}},C=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"})),te={},oe={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},ne=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),ae=[ne];function re(c,r){return e.openBlock(),e.createElementBlock("svg",oe,ae)}const se=P._export_sfc(te,[["render",re]]),le={class:"pd-thin"},q={__name:"BlogPost",setup(c){const r=w.useRoute(),n=e.ref(null),t=e.ref(!0);e.onMounted(async()=>{t.value=!0;const o=await u.read({user:g.state.user._id,url:r.params.url});n.value=o[0],t.value=!1});const a={Textarea:"p",H2:"h2",Bullets:"p",Caption:"p",ImageUpload:x._sfc_main$2};function d(o){return o.type==="Textarea"?{innerHTML:o.content,class:"p-medium"}:o.type==="H2"?{innerHTML:o.content,class:"h3"}:o.type==="Caption"?{innerHTML:o.content}:o.type==="ImageUpload"?{src:o.content}:{}}return(o,m)=>(e.openBlock(),e.createElementBlock("section",le,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[t.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},e.renderList(3,s=>e.createVNode(se,{key:s})),64)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!t.value&&!n.value?(e.openBlock(),e.createBlock(D._sfc_main,{key:0,title:"No Blogpost Found",description:"Currently, there are no blogposts 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:"fade",class:"container"},{default:e.withCtx(()=>[!t.value&&n.value?(e.openBlock(),e.createBlock(u._sfc_main$1,{key:0,onClick:m[0]||(m[0]=s=>o.$router.push({name:"Blogpost",params:{url:n.value.url}})),blogpost:n.value,user:g.state.user._id,type:"blogpostPage",class:e.normalizeClass(["mn-medium",{"br-b br-solid br-black-transp-10":o.index!==n.value.length-1}])},{default:e.withCtx(()=>[e.createElementVNode("section",null,[n.value&&n.value.content?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.value.content,(s,p)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a[s.type]),e.mergeProps({key:p,index:p,component:s,prop:s,class:s.class,content:"content"},d(s),{class:"mn-regular"}),null,16,["index","component","prop","class"]))),128)):e.createCommentVNode("",!0)])]),_:1},8,["blogpost","user","class"])):e.createCommentVNode("",!0),e.createVNode($._sfc_main,{class:"mn-small"}),!t.value&&n.value?(e.openBlock(),e.createBlock(x._sfc_main$1,{key:1,type:"blogpost",target:n.value._id,owner:g.state.user._id},null,8,["target","owner"])):e.createCommentVNode("",!0)]),_:1})]))}},ie=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"})),M={__name:"Blog",setup(c){const r=w.useRoute(),n=w.useRouter();return r.params.category||(r.params.category="featured"),e.onMounted(()=>{if(r.query){const t=r.query,a={tags:t.tags?t.tags.split(","):[],period:t.period?t.period:"week"};u.state.filter=a}}),e.watch(()=>u.state.filter,(t,a)=>{const d={...r.query};Object.keys(a).forEach(m=>{d[m]&&delete d[m]});const o=Object.fromEntries(Object.entries(t).filter(([m,s])=>Array.isArray(s)&&s.length>0||typeof s=="string"&&s).map(([m,s])=>[m,Array.isArray(s)?s.join(","):s]));Object.assign(d,o),n.replace({query:d})},{deep:!0}),(t,a)=>(e.openBlock(),e.createElementBlock("section",null,[e.createVNode(u._sfc_main,{category:e.unref(r).params.category,user:g.state.user._id,period:e.unref(r).query.period},null,8,["category","user","period"])]))}},ce=Object.freeze(Object.defineProperty({__proto__:null,default:M},Symbol.toStringTag,{value:"Module"})),ue={class:"w-100 cols-4 t-left flex-nowrap flex"},de={key:0,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},me=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),pe={class:"t-semi uppercase"},ge=e.createElementVNode("br",null,null,-1),_e={key:1,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},fe=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"💬",-1),he={class:"t-semi uppercase"},ve=e.createElementVNode("br",null,null,-1),be={key:2,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},ye=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),we={class:"t-semi uppercase"},ke=e.createElementVNode("br",null,null,-1),xe={__name:"Activity",props:{likes:Number,comments:Number,subscriptions:Number},setup(c){return(r,n)=>(e.openBlock(),e.createElementBlock("section",ue,[c.likes?(e.openBlock(),e.createElementBlock("div",de,[me,e.createElementVNode("span",pe,[e.createTextVNode(e.toDisplayString(c.likes),1),ge,e.createTextVNode("likes")])])):e.createCommentVNode("",!0),c.comments?(e.openBlock(),e.createElementBlock("div",_e,[fe,e.createElementVNode("span",he,[e.createTextVNode(e.toDisplayString(c.comments),1),ve,e.createTextVNode("comments")])])):e.createCommentVNode("",!0),c.subscriptions?(e.openBlock(),e.createElementBlock("div",be,[ye,e.createElementVNode("span",we,[e.createTextVNode(e.toDisplayString(c.subscriptions),1),ke,e.createTextVNode("subscriptions")])])):e.createCommentVNode("",!0)]))}},Be={class:"pd-thin radius-extra flex-nowrap flex"},Ne=["innerHTML"],Ve={__name:"FieldBig",props:{input:String,placeholder:{type:String},action:{type:String,default:"Action"},placeholderTexts:{type:Object,default:()=>({en:["First placeholder","Second placeholder","Third placeholder"],ru:["Первый плейсхолдер","Второй плейсхолдер","Третий плейсхолдер"]})},typingSpeed:{type:Number,default:200},loopTyping:{type:Boolean,default:!1},enableTyping:{type:Boolean,default:!1}},emits:["update:input","action"],setup(c,{emit:r}){const n=c,{t,locale:a}=F.useI18n();let d=e.ref(0),o=e.ref(n.input),m=e.ref(n.placeholder),s=e.ref(n.enableTyping),p=e.ref(null),b=e.ref(""),v=e.ref(!0),k=null;function B(){r("action")}function N(h){r("update:input",h),b.value=h}function l(){d.value=(d.value+1)%n.placeholderTexts[a.value].length}function i(){s.value=!1,clearInterval(p.value),m.value=n.placeholder,b.value||(o.value="")}function _(){!b.value&&n.enableTyping&&(s.value=!0,m.value="",E())}function E(){let h=n.placeholderTexts[a.value][d.value],f=0,y=!1;k=setInterval(()=>{v.value=!v.value},200),p.value=setInterval(()=>{s.value&&(y?(o.value=o.value.slice(0,-1),o.value=h.substring(0,f)+(v.value&&f%2?"|":""),f--):(o.value=h.substring(0,f)+(v.value&&f%2?"|":""),f++),f>h.length&&n.loopTyping&&setTimeout(()=>{y=!0,o.value=h.substring(0,f)},333),f===0&&y&&(y=!1,l(),h=n.placeholderTexts[a.value][d.value]))},n.typingSpeed)}return e.onMounted(()=>{n.enableTyping&&E()}),e.watchEffect(()=>{s.value||(clearInterval(p.value),clearInterval(k))}),(h,f)=>(e.openBlock(),e.createElementBlock("div",Be,[e.createVNode(g.Field,{field:e.unref(o),"onUpdate:field":[f[0]||(f[0]=y=>e.isRef(o)?o.value=y:o=y),N],placeholder:e.unref(m),onInput:l,onFocus:i,onBlur:_,class:"w-100 pd-small p-big"},null,8,["field","placeholder"]),c.action?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:B,class:"w-min hover_bg-white hover-t-black t-black bg-main button",innerHTML:c.action},null,8,Ne)):e.createCommentVNode("",!0)]))}};const Ee={class:"pd-thin"},Ce={class:"o-hidden t-black bg-main pd-big radius-big"},$e=e.createElementVNode("header",{class:"t-center z-index-1 mn-big"},[e.createElementVNode("h2",{class:"mn-l-auto mn-r-auto w-m-40r mn-medium"},"Stay Updated with The Latest in Cannabis."),e.createElementVNode("p",{class:"t-transp p-big"},"Subscribe to our newsletter for news, insights, and more from the Weeder universe.")],-1),Pe={class:"z-index-1 mn-big w-100 flex-nowrap flex"},Te=e.createElementVNode("div",{class:"w-100 h-100 pos-absolute pos-t-50-negative pos-r-0 z-index-0 grid"},[e.createElementVNode("div",{class:"spiral"})],-1),Se={__name:"SubscribeNewsletter",setup(c){let r=e.ref("");return(n,t)=>(e.openBlock(),e.createElementBlock("section",Ee,[e.createElementVNode("div",Ce,[$e,e.createElementVNode("div",Pe,[e.createVNode(Ve,{input:e.unref(r),typingSpeed:75,loopTyping:!1,enableTyping:!1,placeholder:"Please enter your email",action:"Subscribe","onUpdate:input":t[0]||(t[0]=a=>e.isRef(r)?r.value=a:r=a),onAction:t[1]||(t[1]=a=>n.router.push({name:"Product Recommmendation",query:{mood:n.mood}})),class:"mn-l-auto mn-r-auto bg-white t-black w-50"},null,8,["input"])]),Te])]))}};const qe={class:"container container-joinus"},Me={class:"content"},Ie={class:"h0 mn-big"},ze=e.createElementVNode("p",{class:"w-m-33r t-center mn-small p-big"},"Together, we're shaping the future of the globals cannabis community.",-1),De=e.createElementVNode("button",{class:"bg-black t-white button"},"Join Now",-1),Fe={__name:"JoinUs",setup(c){const r=e.ref(120950),n=e.ref(["/assets/images/reviews/01.png","/assets/images/reviews/02.png","/assets/images/reviews/03.png","/assets/images/reviews/04.png","/assets/images/reviews/05.png","/assets/images/reviews/06.png"]),t=()=>{setInterval(()=>{r.value+=Math.floor(Math.random()*5)+1},330)},a={minSize:"6rem",maxSize:"10rem",minDuration:5,maxDuration:15,spawnPoints:[10,90]};e.onMounted(()=>{d(),t()});const d=()=>{n.value.forEach((o,m)=>{let s=document.createElement("img");s.src=o,s.classList.add("floating-image");let p=a.spawnPoints[Math.floor(Math.random()*a.spawnPoints.length)],b=(Math.random()-.5)*2*10;s.style.left=`${p+b}%`,s.style.animationDuration=`${Math.random()*(a.maxDuration-a.minDuration)+a.minDuration}s`,document.querySelector(".container").appendChild(s),s.addEventListener("animationiteration",()=>{const v=a.spawnPoints[Math.floor(Math.random()*a.spawnPoints.length)],k=(Math.random()-.5)*2*10;s.style.left=`${v+k}%`})})};return(o,m)=>(e.openBlock(),e.createElementBlock("div",qe,[e.createElementVNode("div",Me,[e.createElementVNode("span",Ie,e.toDisplayString(r.value.toLocaleString()),1),ze,De])]))}};const Oe=c=>(e.pushScopeId("data-v-18db0d1b"),c=c(),e.popScopeId(),c),Le={class:"community-feed"},je=Oe(()=>e.createElementVNode("h2",{class:"w-m-75r mn-auto pd-t-big pd-b-big t-center"},"Discover the Vibrant Community",-1)),Ue={class:"grid-container"},Ae={__name:"HotPosts",async setup(c){let r,n;const t=e.ref([]),a=async()=>{const o=await u.read({skip:0,limit:7,period:"year"});console.log(o),t.value=o};[r,n]=e.withAsyncContext(()=>a()),await r,n();const d=o=>{switch(o){case 0:return"grid-item-2x2";case 1:return"grid-item-2x1";case 2:return"grid-item-1x1";case 3:case 4:return"grid-item-1x1";case 6:return"grid-item-2x1";default:return""}};return(o,m)=>(e.openBlock(),e.createElementBlock("section",Le,[je,e.createElementVNode("div",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(s,p)=>(e.openBlock(),e.createBlock(u._sfc_main$1,{blogpost:s,owner:g.state.user._id,key:p,class:e.normalizeClass(d(p))},null,8,["blogpost","owner","class"]))),128))])]))}},He=P._export_sfc(Ae,[["__scopeId","data-v-18db0d1b"]]),Re=[{path:"community",component:T,meta:{title:{en:"Community",ru:"Коммьюнити"},title_hide:!0},children:[{path:":category?",name:"Blog",meta:{title:{en:"Community",ru:"Коммьюнити"},title_hide:!0},component:()=>Promise.resolve().then(()=>ce)}]},{path:"community/posts/create",name:"Create BlogPost",meta:{title:{en:"Create Post",ru:"Создать Пост"},authorize:[]},component:()=>Promise.resolve().then(()=>C)},{path:"community/posts/:url",name:"BlogPost",meta:{title:{en:"Post",ru:"Пост"}},component:()=>Promise.resolve().then(()=>ie)},{path:"community/posts/:url/edit",name:"Edit BlogPost",meta:{title:{en:"Edit Post",ru:"Редактировать пост"},authorize:[]},component:()=>Promise.resolve().then(()=>C)}];exports.CardBlogpost=u._sfc_main$1;exports.Feed=u._sfc_main;exports.FooterBlogpost=u._sfc_main$2;exports.blogpostsStore=u.blogposts;exports.reactionsStore=u.reactions;exports.Comments=x._sfc_main$1;exports.Activity=xe;exports.Blog=M;exports.BlogPost=q;exports.Community=T;exports.CreateBlogPost=S;exports.HotPosts=He;exports.JoinUs=Fe;exports.SubscribeNewsletter=Se;exports.blogpostsRoutes=Re;
@@ -1,10 +1,10 @@
1
1
  import { resolveComponent as Y, openBlock as i, createElementBlock as p, createElementVNode as o, createVNode as h, normalizeClass as B, unref as c, createCommentVNode as v, withCtx as k, Transition as G, createBlock as I, resolveDynamicComponent as Q, ref as g, onMounted as F, computed as V, createTextVNode as T, createStaticVNode as Z, TransitionGroup as H, Fragment as D, renderList as U, mergeProps as ee, watch as te, toDisplayString as N, watchEffect as se, isRef as W, withAsyncContext as ae, pushScopeId as oe, popScopeId as ne } from "vue";
2
2
  import { useRoute as z, useRouter as A } from "vue-router";
3
3
  import { S as le, _ as re } from "./Publics-abbe2e0c.mjs";
4
- import { s as M, r as L, c as ie, u as q, a as R, b as ue, d as K, _ as ce } from "./Feed-8f6eb29d.mjs";
5
- import { e as ts, f as ss, g as as } from "./Feed-8f6eb29d.mjs";
4
+ import { s as M, r as L, c as ie, u as q, a as R, b as ue, d as K, _ as ce } from "./Feed-44f715a7.mjs";
5
+ import { e as ts, f as ss, g as as } from "./Feed-44f715a7.mjs";
6
6
  import { s as w, _ as pe, F as de } from "./auth-cfeacd61.mjs";
7
- import { c as me, _ as ge, a as _e, b as he } from "./Image-661e2fbc.mjs";
7
+ import { c as me, _ as ge, a as _e, b as he } from "./Image-d74c19ee.mjs";
8
8
  import { _ as fe } from "./Popup-e6685f31.mjs";
9
9
  import { _ as ve, S as be, C as ye } from "./Breadcrumbs.vue_vue_type_style_index_0_lang-97217d38.mjs";
10
10
  import { a as we } from "./organizations-8ffdf84d.mjs";
@@ -14,10 +14,10 @@ import { useI18n as $e } from "vue-i18n";
14
14
  import "./globals-96ba60e4.mjs";
15
15
  import "./CardOrganization-1b0da77c.mjs";
16
16
  import "./ButtonFollow-6765c266.mjs";
17
- import "./Chips-4316f652.mjs";
17
+ import "./Chips-cc08d85a.mjs";
18
18
  import "./IconEdit-eacf3856.mjs";
19
19
  import "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
20
- const ke = { class: "min-h-100vh pd-thin" }, Pe = { class: "mn-thin flex-v-center t-left flex-nowrap flex" }, Ce = { class: "flex-v-center flex-nowrap flex t-left" }, Te = /* @__PURE__ */ o("span", { class: "" }, "Topics for ", -1), Se = { class: "bg-grey pd-medium radius-big mn-semi flex-nowrap flex" }, Be = { class: "" }, Ie = {
20
+ const ke = { class: "min-h-100vh pd-thin" }, Pe = { class: "mn-thin flex-v-center t-left flex-nowrap flex" }, Ce = { class: "flex-v-center flex-nowrap flex t-left" }, Te = /* @__PURE__ */ o("span", { class: "" }, "Topics for ", -1), Se = { class: "w-max bg-grey pd-medium radius-big mn-semi flex-nowrap flex" }, Be = { class: "" }, Ie = {
21
21
  __name: "Community",
22
22
  setup(d) {
23
23
  const n = z(), s = A();
@@ -372,7 +372,7 @@ const Ge = /* @__PURE__ */ X(Ve, [["render", Je]]), Qe = { class: "pd-thin" }, W
372
372
  const t = Object.fromEntries(
373
373
  Object.entries(e).filter(([_, l]) => Array.isArray(l) && l.length > 0 || typeof l == "string" && l).map(([_, l]) => [_, Array.isArray(l) ? l.join(",") : l])
374
374
  );
375
- Object.assign(m, t), s.push({ query: m });
375
+ Object.assign(m, t), s.replace({ query: m });
376
376
  }, { deep: !0 }), (e, a) => (i(), p("section", null, [
377
377
  h(ce, {
378
378
  category: c(n).params.category,
@@ -634,11 +634,19 @@ const Pt = (d) => (oe("data-v-18db0d1b"), d = d(), ne(), d), Ct = { class: "comm
634
634
  title: {
635
635
  en: "Community",
636
636
  ru: "Коммьюнити"
637
- }
637
+ },
638
+ title_hide: !0
638
639
  },
639
640
  children: [{
640
641
  path: ":category?",
641
642
  name: "Blog",
643
+ meta: {
644
+ title: {
645
+ en: "Community",
646
+ ru: "Коммьюнити"
647
+ },
648
+ title_hide: !0
649
+ },
642
650
  component: () => Promise.resolve().then(() => Ye)
643
651
  }]
644
652
  },
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./Feed-c8dc4359.js"),e=require("vue"),V=require("./EmptyState-7658d7d6.js"),C=require("./_plugin-vue_export-helper-f246444f.js"),y=require("vue-router"),E=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-6f807eb5.js"),x=require("./Image-f66dbbf4.js"),$=require("./Popup-0b38b537.js"),v=require("./auth-b61483ce.js"),q=require("./UploadImage-39d42048.js"),I=require("./organizations-49a10611.js"),b=require("./globals-928eb13c.js");require("vue-i18n");require("./Chips-92ccc11f.js");require("./IconEdit-4cfe2115.js");require("./vue-draggable-next.esm-bundler-80731ae0.js");const L={},O={width:"100%",height:"50",xmlns:"http://www.w3.org/2000/svg"},U=e.createStaticVNode('<rect x="0" y="0" width="100%" height="100%" fill="rgb(var(--grey))"></rect><rect x="15" y="15" rx="3" ry="3" width="40" height="20" fill="rgba(var(--black),0.05)"></rect><rect x="65" y="15" rx="3" ry="3" width="150" height="20" fill="rgba(var(--black),0.05)"></rect><circle cx="250" cy="25" r="10" fill="rgba(var(--black),0.1)"></circle><circle cx="265" cy="25" r="10" fill="rgba(var(--black),0.05)"></circle><circle cx="280" cy="25" r="10" fill="rgba(var(--black),0.025)"></circle><rect x="-25%" y="0" width="25%" height="100%" fill="#fff" opacity="0.3"><animate attributeName="x" from="-25%" to="100%" dur="2s" repeatCount="indefinite"></animate></rect>',7),F=[U];function j(p,r){return e.openBlock(),e.createElementBlock("svg",O,F)}const z=C._export_sfc(L,[["render",j]]);const M={class:"today-events"},R={__name:"List",props:{category:{type:String,default:null},organization:{type:String,default:null},owner:{type:String,default:null},user:{type:[String,Number],default:null},period:{type:String,default:null},status:{type:String,default:null}},setup(p){const r=p,n=e.ref([]),t=e.ref(!0),i=e.ref(0),c=e.ref(5);return e.onMounted(async()=>{const a=await g.read({skip:i.value,limit:c.value,sortOrder:"desc",category:r.category,user:r.user,owner:r.owner,organization:r.organization,period:r.period,status:r.status});n.value=a,t.value=!1}),(a,o)=>(e.openBlock(),e.createElementBlock("section",M,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[t.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(c.value,d=>(e.openBlock(),e.createBlock(z,{key:d}))),128)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!t.value&&n.value.length<1?(e.openBlock(),e.createBlock(V._sfc_main,{key:0,title:"No Events Today",description:"Today, 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:"fade",class:"container"},{default:e.withCtx(()=>[!t.value&&n.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.value,(d,f)=>(e.openBlock(),e.createBlock(g._sfc_main$1,{onClick:_=>a.$router.push({name:"Event",params:{url:d.url}}),key:d._id,event:d,owner:p.user,type:"short",class:e.normalizeClass(["pd-medium",{"br-b br-solid br-black-transp-10":f!==n.value.length-1}])},null,8,["onClick","event","owner","class"]))),128)):e.createCommentVNode("",!0)]),_:1})]))}},A=["onClick"],H={class:"t-transp"},J={__name:"DatePicker",props:["date","locale"],setup(p,{emit:r}){const n=p,t=e.ref(null);let i;if(n.date){const u=parseInt(n.date.substring(0,2)),h=parseInt(n.date.substring(2,4))-1,s=parseInt(n.date.substring(4));i=new Date(s,h,u),console.log("Data"+i)}else i=new Date,console.log("No data"+i);i.setHours(0,0,0,0);const c=e.ref(new Date(i)),a=_(i,30);e.onMounted(()=>{if(t.value){const u=t.value.getElementsByClassName("selected")[0]||t.value.getElementsByClassName("bg-main")[0];u&&(t.value.scrollLeft=u.offsetLeft-t.value.offsetWidth/2+u.offsetWidth/2)}});function o(u){c.value=u;const h=d(u);r("update:date",h)}function d(u){return`${u.getDate().toString().padStart(2,"0")}${(u.getMonth()+1).toString().padStart(2,"0")}${u.getFullYear()}`}function f(u){return u.toLocaleDateString(n.locale?n.locale:"en",{weekday:"narrow"}).toUpperCase()}function _(u,h){const s=[];for(let l=-15;l<h-15;l++){const m=new Date(u);m.setDate(u.getDate()+l),m.setHours(0,0,0,0),s.push(m)}return s}return(u,h)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{class:"w-100 o-scroll flex-nowrap flex",ref_key:"scrollContainer",ref:t,style:{"scroll-snap-type":"x mandatory"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),s=>(e.openBlock(),e.createElementBlock("div",{key:s.toString(),onClick:l=>o(s),class:e.normalizeClass([{selected:c.value.toDateString()===s.toDateString()},"cursor-pointer mn-r-small mn-l-small flex-column flex-center flex"])},[e.createElementVNode("span",H,e.toDisplayString(f(s)),1),e.createElementVNode("span",{class:e.normalizeClass([{"bg-main":c.value.toDateString()===s.toDateString()},"transition-ease-in-out t-semi flex-center flex radius-big i-semi day-number"])},e.toDisplayString(s.getDate()),3)],10,A))),128))],512)]))}},G={class:"pd-thin min-h-100vh"},W=e.createElementVNode("div",{class:"mn-thin br-solid br-1px br-grey bg-grey radius-big"},null,-1),Y={class:""},D={__name:"layoutEvents",setup(p){const r=y.useRoute(),n=y.useRouter(),i=c(new Date);function c(a){return`${a.getDate().toString().padStart(2,"0")}${(a.getMonth()+1).toString().padStart(2,"0")}${a.getFullYear()}`}if(r.query){const a=r.query,o={tags:a.tags?a.tags.split(","):null,date:a.date?a.date:i};g.state.filter=o}else{const a={date:i};g.state.filter=a}return e.watch(()=>g.state.filter,(a,o)=>{const d={...r.query};Object.keys(o).forEach(_=>{d[_]&&delete d[_]});const f=Object.fromEntries(Object.entries(a).filter(([_,u])=>Array.isArray(u)&&u.length>0||typeof u=="string"&&u).map(([_,u])=>[_,Array.isArray(u)?u.join(","):u]));Object.assign(d,f),n.push({query:d})},{deep:!0}),(a,o)=>{const d=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",G,[e.createVNode(J,{date:g.state.filter.date,"onUpdate:date":o[0]||(o[0]=f=>g.state.filter.date=f),locale:a.$i18n.locale,class:"radius-small bg-grey pd-l-zero pd-r-zero pd-medium"},null,8,["date","locale"]),W,e.createElementVNode("section",Y,[e.createVNode(d,null,{default:e.withCtx(({Component:f,route:_})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f),{ref:"page",key:_.query}))]),_:2},1024)]),_:1})])])}}},Q={key:0,class:"pd-thin"},K={class:"mn-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex"},X=e.createElementVNode("h4",null,"Upload Event Cover",-1),Z=e.createElementVNode("h3",{class:"mn-small"},"Date",-1),ee=e.createElementVNode("h3",{class:"mn-small"},"Description",-1),te={key:0,class:"pd-b-extra w-100 bg-grey pd-big radius-big"},re={key:1,class:"pd-thin pos-fixed pos-l-0 pos-b-0 w-100"},ae={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},ne={class:"w-m-66r t-left pd-big bg-white radius-big"},oe=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),se=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),le={key:0,class:"mn-thin"},ie={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},S={__name:"EditEvent",setup(p){const r=y.useRoute(),n=y.useRouter();let t=e.ref(null),i=e.ref(null);const c=e.ref([]),a=e.ref(null);e.onMounted(async()=>{if(r.params.url){const l=await g.read({user:v.state.user._id,url:r.params.url});t.value=l.pop(),t.value.date.start=t.value.date.start.slice(0,16),t.value.date.end=t.value.date.end.slice(0,16)}else g.clean(),t.value=g.state.current;t.value.owner||(t.value.owner={target:v.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:v.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(a.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const s=await I.actions.read({user:v.state.user._id,postable:v.state.user._id,limit:100});i.value=s.map(l=>({name:l.profile.name,_id:l._id,photo:l.profile.photo}))});const o=e.ref(!1);function d(){o.value=!0}function f(){o.value=!1}function _(){c.value.length>0&&c.value.map(s=>s.text),t.value.status="draft",r.params.url?g.update(t.value).then(s=>{n.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.error(s)}):g.create(t.value).then(s=>{n.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.error(s)})}function u(){confirm("Are you sure you want to delete this event?")&&(void 0)(t.value._id).then(s=>{n.push({name:"Drafts"})}).catch(s=>{console.error(s)})}function h(){a.value&&(t.value.owner={target:a.value._id,type:"organization"}),a.value||(t.value.creator.hidden=!1),a.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),r.params.url?g.update(t.value).then(s=>{n.push({name:"Blogevent",params:{url:s.url}})}).catch(s=>{console.log(s)}):g.create(t.value).then(s=>{n.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.log(s)})}return(s,l)=>e.unref(t)?(e.openBlock(),e.createElementBlock("article",Q,[e.createElementVNode("div",K,[e.createVNode(q._sfc_main,{photo:e.unref(t).cover,"onUpdate:photo":l[0]||(l[0]=m=>e.unref(t).cover=m),uploadPath:"users/"+v.state.user._id+"/events",class:"h-4r w-4r aspect-1x1 o-hidden mn-thin radius-extra"},null,8,["photo","uploadPath"]),X]),e.createVNode(v.Field,{field:e.unref(t).name,"onUpdate:field":l[1]||(l[1]=m=>e.unref(t).name=m),placeholder:"Event name",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(v.Field,{field:e.unref(t).description,"onUpdate:field":l[2]||(l[2]=m=>e.unref(t).description=m),type:"textfield",placeholder:"Enter short description",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),Z,e.createTextVNode(" "+e.toDisplayString(e.unref(t).date.start)+" ",1),e.createVNode(v.Field,{field:e.unref(t).date.start,"onUpdate:field":l[3]||(l[3]=m=>e.unref(t).date.start=m),label:"Start",type:"datetime-local",placeholder:"Not specified",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(v.Field,{field:e.unref(t).date.end,"onUpdate:field":l[4]||(l[4]=m=>e.unref(t).date.end=m),label:"End",type:"datetime-local",placeholder:"Not specified",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),ee,e.unref(t)?(e.openBlock(),e.createElementBlock("section",te,[e.createVNode(x._sfc_main,{content:e.unref(t).content,onUpdate:l[5]||(l[5]=m=>e.unref(t).content=m)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",re,[e.createElementVNode("div",ae,[e.unref(r).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:l[6]||(l[6]=m=>u()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:l[7]||(l[7]=m=>_()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:l[8]||(l[8]=m=>d()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode($._sfc_main,{title:"Добавить участника",onClosePopup:f,isPopupOpen:o.value},{default:e.withCtx(()=>[e.createElementVNode("div",ne,[oe,e.createVNode(E._sfc_main,{onTagsChanged:l[9]||(l[9]=m=>e.unref(t).tags=m),tags:e.unref(t).tags},null,8,["tags"]),se,e.createVNode(E.SelectMulti,{modelValue:a.value,"onUpdate:modelValue":l[10]||(l[10]=m=>a.value=m),options:e.unref(i),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),a.value?(e.openBlock(),e.createElementBlock("h5",le,"Options:")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(E.Checkbox,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":l[11]||(l[11]=m=>e.unref(t).creator.hidden=m),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(v._sfc_main,{submit:h,callback:s.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])])]),_:1},8,["isPopupOpen"])])):e.createCommentVNode("",!0)}},B=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"})),w=v.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),k=e.reactive({tickets:[],error:null}),N={async read({user:p,type:r,target:n,role:t}){try{const i=await w.get("/api/tickets",{params:{user:p,type:r,target:n,role:t}});return k.error=null,k.tickets=i.data,Promise.resolve(i.data)}catch(i){return b.setError(i),Promise.reject(i)}},async create(p){try{const r=await w.post("/api/tickets/create",p);return k.error=null,Promise.resolve(r.data)}catch(r){return b.setError(r),Promise.reject(r)}},async update(p){try{const r=await w.post("/api/tickets/update",p);return k.error=null,Promise.resolve(r.data)}catch(r){return b.setError(r),Promise.reject(r)}},async delete(p){try{const r=await w.post("/api/tickets/delete",p);return k.error=null,Promise.resolve(r.data)}catch(r){return b.setError(r),Promise.reject(r)}}},ce={handleTicketUpdate(p,r,n){let t;if(Array.isArray(p)?t=p.find(i=>i._id===r.target):typeof p=="object"&&p._id===r.target&&(t=p),t)if(t.hasTicket=n,n)t.tickets.push(r),t.numberOfTickets+=1;else{const i=t.tickets.findIndex(c=>c._id===r._id);i!==-1&&(t.tickets.splice(i,1),t.numberOfTickets-=1)}}};e.watch(k,p=>{});const ue={__name:"ButtonJoin",props:{type:{type:String,required:!0},userId:{type:String,required:!0},hasTicket:{type:Boolean,required:!0},targetId:{type:String,required:!0}},emits:["updateTicket"],setup(p,{emit:r}){const n=p,t=async()=>{n.hasTicket?await c(n.targetId):await i(n.targetId)};async function i(a){try{const o={type:n.type,target:a,user:n.userId},d=await N.create(o);r("updateTicket",{ticket:d,hasTicket:!0,targetId:n.targetId})}catch(o){throw console.log(o),o}}async function c(a){const o={type:n.type,target:a,user:n.userId};try{const d=await N.delete(o);r("updateTicket",{ticket:d,hasTicket:!1,targetId:n.targetId})}catch(d){throw console.log(d),d}}return(a,o)=>(e.openBlock(),e.createBlock(v._sfc_main,{submit:t,class:"bg-main button-small radius-extra button"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.hasTicket?"Leave":"Join"),1)]),_:1}))}},de=C._export_sfc(ue,[["__scopeId","data-v-872ff798"]]),pe={class:"pd-thin"},T={__name:"Event",setup(p){const r=y.useRoute(),n=({ticket:o,hasTicket:d,targetId:f})=>{ce.handleTicketUpdate(c.value,o,d,f)},t={Textarea:"p",H2:"h2",Bullets:"p",Caption:"p",ImageUpload:x._sfc_main$2};function i(o){return o.type==="Textarea"?{innerHTML:o.content,class:"p-medium"}:o.type==="H2"?{innerHTML:o.content,class:"h3"}:o.type==="Caption"?{innerHTML:o.content}:o.type==="ImageUpload"?{src:o.content}:{}}const c=e.ref(null),a=e.ref(!0);return e.onMounted(async()=>{a.value=!0;const o=await g.read({user:v.state.user._id,url:r.params.url});c.value=o[0],a.value=!1}),(o,d)=>(e.openBlock(),e.createElementBlock("section",pe,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},e.renderList(3,f=>e.createVNode(g.SkeletonEvent,{key:f})),64)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!a.value&&!c.value?(e.openBlock(),e.createBlock(V._sfc_main,{key:0,title:"No Event 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:"fade",class:"container"},{default:e.withCtx(()=>[!a.value&&c.value?(e.openBlock(),e.createBlock(g._sfc_main$1,{key:0,onClick:d[0]||(d[0]=f=>o.$router.push({name:"Event",params:{url:c.value.url}})),event:c.value,owner:c.value.owner,user:v.state.user._id,type:"normal",class:"mn-medium bg-grey radius-big"},{default:e.withCtx(()=>[v.state.user._id?(e.openBlock(),e.createBlock(de,{key:0,type:"event",hasTicket:c.value.hasTicket,targetId:c.value._id,userId:v.state.user._id,class:"mn-small w-100 pd-medium mn-auto",onUpdateTicket:n},null,8,["hasTicket","targetId","userId"])):e.createCommentVNode("",!0),e.createElementVNode("section",null,[c.value&&c.value.content?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(c.value.content,(f,_)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t[f.type]),e.mergeProps({key:_,index:_,component:f,prop:f,class:f.class,content:"content"},i(f),{class:"mn-regular"}),null,16,["index","component","prop","class"]))),128)):e.createCommentVNode("",!0)])]),_:1},8,["event","owner","user"])):e.createCommentVNode("",!0),!a.value&&c.value?(e.openBlock(),e.createBlock(x._sfc_main$1,{key:1,type:"event",target:c.value._id,owner:v.state.user._id},null,8,["target","owner"])):e.createCommentVNode("",!0)]),_:1})]))}},me=Object.freeze(Object.defineProperty({__proto__:null,default:T},Symbol.toStringTag,{value:"Module"})),P={__name:"Events",setup(p){const r=y.useRoute();return y.useRouter(),(n,t)=>(e.openBlock(),e.createElementBlock("section",null,[e.createVNode(g._sfc_main,{category:e.unref(r).params.category,user:v.state.user._id,period:e.unref(r).query.period,selectedDate:g.state.filter.date},null,8,["category","user","period","selectedDate"])]))}},fe=Object.freeze(Object.defineProperty({__proto__:null,default:P},Symbol.toStringTag,{value:"Module"})),ge=[{path:"events",component:D,meta:{title:{en:"Events",ru:"События"}},children:[{path:":category?",name:"Events",component:()=>Promise.resolve().then(()=>fe)}]},{path:"events/create",name:"Create Event",meta:{title:{en:"Create Event",ru:"Создать Событие"},authorize:[]},component:()=>Promise.resolve().then(()=>B)},{path:"events/:url",name:"Event",meta:{title:{en:"Event",ru:"Событие"}},component:()=>Promise.resolve().then(()=>me)},{path:"events/:url/edit",name:"Edit Event",meta:{authorize:[]},component:()=>Promise.resolve().then(()=>B)}];exports.CardEvent=g._sfc_main$1;exports.Feed=g._sfc_main;exports.eventsStore=g.events;exports.EditEvent=S;exports.EventPage=T;exports.EventsLayout=D;exports.EventsPage=P;exports.List=R;exports.eventsRoutes=ge;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./Feed-8a867bfc.js"),e=require("vue"),V=require("./EmptyState-7658d7d6.js"),C=require("./_plugin-vue_export-helper-f246444f.js"),y=require("vue-router"),E=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-6f807eb5.js"),x=require("./Image-fd501859.js"),$=require("./Popup-0b38b537.js"),v=require("./auth-b61483ce.js"),q=require("./UploadImage-39d42048.js"),I=require("./organizations-49a10611.js"),b=require("./globals-928eb13c.js");require("vue-i18n");require("./Chips-32092a52.js");require("./IconEdit-4cfe2115.js");require("./vue-draggable-next.esm-bundler-80731ae0.js");const L={},O={width:"100%",height:"50",xmlns:"http://www.w3.org/2000/svg"},U=e.createStaticVNode('<rect x="0" y="0" width="100%" height="100%" fill="rgb(var(--grey))"></rect><rect x="15" y="15" rx="3" ry="3" width="40" height="20" fill="rgba(var(--black),0.05)"></rect><rect x="65" y="15" rx="3" ry="3" width="150" height="20" fill="rgba(var(--black),0.05)"></rect><circle cx="250" cy="25" r="10" fill="rgba(var(--black),0.1)"></circle><circle cx="265" cy="25" r="10" fill="rgba(var(--black),0.05)"></circle><circle cx="280" cy="25" r="10" fill="rgba(var(--black),0.025)"></circle><rect x="-25%" y="0" width="25%" height="100%" fill="#fff" opacity="0.3"><animate attributeName="x" from="-25%" to="100%" dur="2s" repeatCount="indefinite"></animate></rect>',7),F=[U];function j(p,r){return e.openBlock(),e.createElementBlock("svg",O,F)}const z=C._export_sfc(L,[["render",j]]);const M={class:"today-events"},R={__name:"List",props:{category:{type:String,default:null},organization:{type:String,default:null},owner:{type:String,default:null},user:{type:[String,Number],default:null},period:{type:String,default:null},status:{type:String,default:null}},setup(p){const r=p,n=e.ref([]),t=e.ref(!0),i=e.ref(0),c=e.ref(5);return e.onMounted(async()=>{const a=await g.read({skip:i.value,limit:c.value,sortOrder:"desc",category:r.category,user:r.user,owner:r.owner,organization:r.organization,period:r.period,status:r.status});n.value=a,t.value=!1}),(a,o)=>(e.openBlock(),e.createElementBlock("section",M,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[t.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(c.value,d=>(e.openBlock(),e.createBlock(z,{key:d}))),128)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!t.value&&n.value.length<1?(e.openBlock(),e.createBlock(V._sfc_main,{key:0,title:"No Events Today",description:"Today, 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:"fade",class:"container"},{default:e.withCtx(()=>[!t.value&&n.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.value,(d,f)=>(e.openBlock(),e.createBlock(g._sfc_main$1,{onClick:_=>a.$router.push({name:"Event",params:{url:d.url}}),key:d._id,event:d,owner:p.user,type:"short",class:e.normalizeClass(["pd-medium",{"br-b br-solid br-black-transp-10":f!==n.value.length-1}])},null,8,["onClick","event","owner","class"]))),128)):e.createCommentVNode("",!0)]),_:1})]))}},A=["onClick"],H={class:"t-transp"},J={__name:"DatePicker",props:["date","locale"],setup(p,{emit:r}){const n=p,t=e.ref(null);let i;if(n.date){const u=parseInt(n.date.substring(0,2)),h=parseInt(n.date.substring(2,4))-1,s=parseInt(n.date.substring(4));i=new Date(s,h,u),console.log("Data"+i)}else i=new Date,console.log("No data"+i);i.setHours(0,0,0,0);const c=e.ref(new Date(i)),a=_(i,30);e.onMounted(()=>{if(t.value){const u=t.value.getElementsByClassName("selected")[0]||t.value.getElementsByClassName("bg-main")[0];u&&(t.value.scrollLeft=u.offsetLeft-t.value.offsetWidth/2+u.offsetWidth/2)}});function o(u){c.value=u;const h=d(u);r("update:date",h)}function d(u){return`${u.getDate().toString().padStart(2,"0")}${(u.getMonth()+1).toString().padStart(2,"0")}${u.getFullYear()}`}function f(u){return u.toLocaleDateString(n.locale?n.locale:"en",{weekday:"narrow"}).toUpperCase()}function _(u,h){const s=[];for(let l=-15;l<h-15;l++){const m=new Date(u);m.setDate(u.getDate()+l),m.setHours(0,0,0,0),s.push(m)}return s}return(u,h)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{class:"w-100 o-scroll flex-nowrap flex",ref_key:"scrollContainer",ref:t,style:{"scroll-snap-type":"x mandatory"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),s=>(e.openBlock(),e.createElementBlock("div",{key:s.toString(),onClick:l=>o(s),class:e.normalizeClass([{selected:c.value.toDateString()===s.toDateString()},"cursor-pointer mn-r-small mn-l-small flex-column flex-center flex"])},[e.createElementVNode("span",H,e.toDisplayString(f(s)),1),e.createElementVNode("span",{class:e.normalizeClass([{"bg-main":c.value.toDateString()===s.toDateString()},"transition-ease-in-out t-semi flex-center flex radius-big i-semi day-number"])},e.toDisplayString(s.getDate()),3)],10,A))),128))],512)]))}},G={class:"pd-thin min-h-100vh"},W=e.createElementVNode("div",{class:"mn-thin br-solid br-1px br-grey bg-grey radius-big"},null,-1),Y={class:""},D={__name:"layoutEvents",setup(p){const r=y.useRoute(),n=y.useRouter(),i=c(new Date);function c(a){return`${a.getDate().toString().padStart(2,"0")}${(a.getMonth()+1).toString().padStart(2,"0")}${a.getFullYear()}`}if(r.query){const a=r.query,o={tags:a.tags?a.tags.split(","):null,date:a.date?a.date:i};g.state.filter=o}else{const a={date:i};g.state.filter=a}return e.watch(()=>g.state.filter,(a,o)=>{const d={...r.query};Object.keys(o).forEach(_=>{d[_]&&delete d[_]});const f=Object.fromEntries(Object.entries(a).filter(([_,u])=>Array.isArray(u)&&u.length>0||typeof u=="string"&&u).map(([_,u])=>[_,Array.isArray(u)?u.join(","):u]));Object.assign(d,f),n.push({query:d})},{deep:!0}),(a,o)=>{const d=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",G,[e.createVNode(J,{date:g.state.filter.date,"onUpdate:date":o[0]||(o[0]=f=>g.state.filter.date=f),locale:a.$i18n.locale,class:"radius-small bg-grey pd-l-zero pd-r-zero pd-medium"},null,8,["date","locale"]),W,e.createElementVNode("section",Y,[e.createVNode(d,null,{default:e.withCtx(({Component:f,route:_})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f),{ref:"page",key:_.query}))]),_:2},1024)]),_:1})])])}}},Q={key:0,class:"pd-thin"},K={class:"mn-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex"},X=e.createElementVNode("h4",null,"Upload Event Cover",-1),Z=e.createElementVNode("h3",{class:"mn-small"},"Date",-1),ee=e.createElementVNode("h3",{class:"mn-small"},"Description",-1),te={key:0,class:"pd-b-extra w-100 bg-grey pd-big radius-big"},re={key:1,class:"pd-thin pos-fixed pos-l-0 pos-b-0 w-100"},ae={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},ne={class:"w-m-66r t-left pd-big bg-white radius-big"},oe=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),se=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),le={key:0,class:"mn-thin"},ie={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},S={__name:"EditEvent",setup(p){const r=y.useRoute(),n=y.useRouter();let t=e.ref(null),i=e.ref(null);const c=e.ref([]),a=e.ref(null);e.onMounted(async()=>{if(r.params.url){const l=await g.read({user:v.state.user._id,url:r.params.url});t.value=l.pop(),t.value.date.start=t.value.date.start.slice(0,16),t.value.date.end=t.value.date.end.slice(0,16)}else g.clean(),t.value=g.state.current;t.value.owner||(t.value.owner={target:v.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:v.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(a.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const s=await I.actions.read({user:v.state.user._id,postable:v.state.user._id,limit:100});i.value=s.map(l=>({name:l.profile.name,_id:l._id,photo:l.profile.photo}))});const o=e.ref(!1);function d(){o.value=!0}function f(){o.value=!1}function _(){c.value.length>0&&c.value.map(s=>s.text),t.value.status="draft",r.params.url?g.update(t.value).then(s=>{n.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.error(s)}):g.create(t.value).then(s=>{n.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.error(s)})}function u(){confirm("Are you sure you want to delete this event?")&&(void 0)(t.value._id).then(s=>{n.push({name:"Drafts"})}).catch(s=>{console.error(s)})}function h(){a.value&&(t.value.owner={target:a.value._id,type:"organization"}),a.value||(t.value.creator.hidden=!1),a.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),r.params.url?g.update(t.value).then(s=>{n.push({name:"Blogevent",params:{url:s.url}})}).catch(s=>{console.log(s)}):g.create(t.value).then(s=>{n.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.log(s)})}return(s,l)=>e.unref(t)?(e.openBlock(),e.createElementBlock("article",Q,[e.createElementVNode("div",K,[e.createVNode(q._sfc_main,{photo:e.unref(t).cover,"onUpdate:photo":l[0]||(l[0]=m=>e.unref(t).cover=m),uploadPath:"users/"+v.state.user._id+"/events",class:"h-4r w-4r aspect-1x1 o-hidden mn-thin radius-extra"},null,8,["photo","uploadPath"]),X]),e.createVNode(v.Field,{field:e.unref(t).name,"onUpdate:field":l[1]||(l[1]=m=>e.unref(t).name=m),placeholder:"Event name",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(v.Field,{field:e.unref(t).description,"onUpdate:field":l[2]||(l[2]=m=>e.unref(t).description=m),type:"textfield",placeholder:"Enter short description",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),Z,e.createTextVNode(" "+e.toDisplayString(e.unref(t).date.start)+" ",1),e.createVNode(v.Field,{field:e.unref(t).date.start,"onUpdate:field":l[3]||(l[3]=m=>e.unref(t).date.start=m),label:"Start",type:"datetime-local",placeholder:"Not specified",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(v.Field,{field:e.unref(t).date.end,"onUpdate:field":l[4]||(l[4]=m=>e.unref(t).date.end=m),label:"End",type:"datetime-local",placeholder:"Not specified",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),ee,e.unref(t)?(e.openBlock(),e.createElementBlock("section",te,[e.createVNode(x._sfc_main,{content:e.unref(t).content,onUpdate:l[5]||(l[5]=m=>e.unref(t).content=m)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",re,[e.createElementVNode("div",ae,[e.unref(r).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:l[6]||(l[6]=m=>u()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:l[7]||(l[7]=m=>_()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:l[8]||(l[8]=m=>d()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode($._sfc_main,{title:"Добавить участника",onClosePopup:f,isPopupOpen:o.value},{default:e.withCtx(()=>[e.createElementVNode("div",ne,[oe,e.createVNode(E._sfc_main,{onTagsChanged:l[9]||(l[9]=m=>e.unref(t).tags=m),tags:e.unref(t).tags},null,8,["tags"]),se,e.createVNode(E.SelectMulti,{modelValue:a.value,"onUpdate:modelValue":l[10]||(l[10]=m=>a.value=m),options:e.unref(i),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),a.value?(e.openBlock(),e.createElementBlock("h5",le,"Options:")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(E.Checkbox,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":l[11]||(l[11]=m=>e.unref(t).creator.hidden=m),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(v._sfc_main,{submit:h,callback:s.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])])]),_:1},8,["isPopupOpen"])])):e.createCommentVNode("",!0)}},B=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"})),w=v.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),k=e.reactive({tickets:[],error:null}),N={async read({user:p,type:r,target:n,role:t}){try{const i=await w.get("/api/tickets",{params:{user:p,type:r,target:n,role:t}});return k.error=null,k.tickets=i.data,Promise.resolve(i.data)}catch(i){return b.setError(i),Promise.reject(i)}},async create(p){try{const r=await w.post("/api/tickets/create",p);return k.error=null,Promise.resolve(r.data)}catch(r){return b.setError(r),Promise.reject(r)}},async update(p){try{const r=await w.post("/api/tickets/update",p);return k.error=null,Promise.resolve(r.data)}catch(r){return b.setError(r),Promise.reject(r)}},async delete(p){try{const r=await w.post("/api/tickets/delete",p);return k.error=null,Promise.resolve(r.data)}catch(r){return b.setError(r),Promise.reject(r)}}},ce={handleTicketUpdate(p,r,n){let t;if(Array.isArray(p)?t=p.find(i=>i._id===r.target):typeof p=="object"&&p._id===r.target&&(t=p),t)if(t.hasTicket=n,n)t.tickets.push(r),t.numberOfTickets+=1;else{const i=t.tickets.findIndex(c=>c._id===r._id);i!==-1&&(t.tickets.splice(i,1),t.numberOfTickets-=1)}}};e.watch(k,p=>{});const ue={__name:"ButtonJoin",props:{type:{type:String,required:!0},userId:{type:String,required:!0},hasTicket:{type:Boolean,required:!0},targetId:{type:String,required:!0}},emits:["updateTicket"],setup(p,{emit:r}){const n=p,t=async()=>{n.hasTicket?await c(n.targetId):await i(n.targetId)};async function i(a){try{const o={type:n.type,target:a,user:n.userId},d=await N.create(o);r("updateTicket",{ticket:d,hasTicket:!0,targetId:n.targetId})}catch(o){throw console.log(o),o}}async function c(a){const o={type:n.type,target:a,user:n.userId};try{const d=await N.delete(o);r("updateTicket",{ticket:d,hasTicket:!1,targetId:n.targetId})}catch(d){throw console.log(d),d}}return(a,o)=>(e.openBlock(),e.createBlock(v._sfc_main,{submit:t,class:"bg-main button-small radius-extra button"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.hasTicket?"Leave":"Join"),1)]),_:1}))}},de=C._export_sfc(ue,[["__scopeId","data-v-872ff798"]]),pe={class:"pd-thin"},T={__name:"Event",setup(p){const r=y.useRoute(),n=({ticket:o,hasTicket:d,targetId:f})=>{ce.handleTicketUpdate(c.value,o,d,f)},t={Textarea:"p",H2:"h2",Bullets:"p",Caption:"p",ImageUpload:x._sfc_main$2};function i(o){return o.type==="Textarea"?{innerHTML:o.content,class:"p-medium"}:o.type==="H2"?{innerHTML:o.content,class:"h3"}:o.type==="Caption"?{innerHTML:o.content}:o.type==="ImageUpload"?{src:o.content}:{}}const c=e.ref(null),a=e.ref(!0);return e.onMounted(async()=>{a.value=!0;const o=await g.read({user:v.state.user._id,url:r.params.url});c.value=o[0],a.value=!1}),(o,d)=>(e.openBlock(),e.createElementBlock("section",pe,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},e.renderList(3,f=>e.createVNode(g.SkeletonEvent,{key:f})),64)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!a.value&&!c.value?(e.openBlock(),e.createBlock(V._sfc_main,{key:0,title:"No Event 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:"fade",class:"container"},{default:e.withCtx(()=>[!a.value&&c.value?(e.openBlock(),e.createBlock(g._sfc_main$1,{key:0,onClick:d[0]||(d[0]=f=>o.$router.push({name:"Event",params:{url:c.value.url}})),event:c.value,owner:c.value.owner,user:v.state.user._id,type:"normal",class:"mn-medium bg-grey radius-big"},{default:e.withCtx(()=>[v.state.user._id?(e.openBlock(),e.createBlock(de,{key:0,type:"event",hasTicket:c.value.hasTicket,targetId:c.value._id,userId:v.state.user._id,class:"mn-small w-100 pd-medium mn-auto",onUpdateTicket:n},null,8,["hasTicket","targetId","userId"])):e.createCommentVNode("",!0),e.createElementVNode("section",null,[c.value&&c.value.content?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(c.value.content,(f,_)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t[f.type]),e.mergeProps({key:_,index:_,component:f,prop:f,class:f.class,content:"content"},i(f),{class:"mn-regular"}),null,16,["index","component","prop","class"]))),128)):e.createCommentVNode("",!0)])]),_:1},8,["event","owner","user"])):e.createCommentVNode("",!0),!a.value&&c.value?(e.openBlock(),e.createBlock(x._sfc_main$1,{key:1,type:"event",target:c.value._id,owner:v.state.user._id},null,8,["target","owner"])):e.createCommentVNode("",!0)]),_:1})]))}},me=Object.freeze(Object.defineProperty({__proto__:null,default:T},Symbol.toStringTag,{value:"Module"})),P={__name:"Events",setup(p){const r=y.useRoute();return y.useRouter(),(n,t)=>(e.openBlock(),e.createElementBlock("section",null,[e.createVNode(g._sfc_main,{category:e.unref(r).params.category,user:v.state.user._id,period:e.unref(r).query.period,selectedDate:g.state.filter.date},null,8,["category","user","period","selectedDate"])]))}},fe=Object.freeze(Object.defineProperty({__proto__:null,default:P},Symbol.toStringTag,{value:"Module"})),ge=[{path:"events",component:D,meta:{title:{en:"Events",ru:"События"},title_hide:!0},children:[{path:":category?",name:"Events",meta:{title:{en:"Events",ru:"События"},title_hide:!0},component:()=>Promise.resolve().then(()=>fe)}]},{path:"events/create",name:"Create Event",meta:{title:{en:"Create Event",ru:"Создать Событие"},authorize:[]},component:()=>Promise.resolve().then(()=>B)},{path:"events/:url",name:"Event",meta:{title:{en:"Event",ru:"Событие"}},component:()=>Promise.resolve().then(()=>me)},{path:"events/:url/edit",name:"Edit Event",meta:{authorize:[]},component:()=>Promise.resolve().then(()=>B)}];exports.CardEvent=g._sfc_main$1;exports.Feed=g._sfc_main;exports.eventsStore=g.events;exports.EditEvent=S;exports.EventPage=T;exports.EventsLayout=D;exports.EventsPage=P;exports.List=R;exports.eventsRoutes=ge;