@ozdao/prometheus-framework 0.1.85 → 0.1.87

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.cjs +1 -1
  2. package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.js +22 -22
  3. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
  4. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +49 -2
  5. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
  6. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +2 -49
  7. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  8. package/dist/prometheus-framework/src/components/Select/Select.vue.js +78 -2
  9. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  10. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +2 -78
  11. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  12. package/dist/prometheus-framework/src/modules/auth/store/auth.js +106 -84
  13. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  14. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  15. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  16. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  17. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +4 -1
  18. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +62 -2
  19. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -4
  20. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +2 -62
  21. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  23. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  25. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  27. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
  29. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  31. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
  33. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  35. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
  37. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
  39. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  41. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
  43. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +1 -1
  45. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  47. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  49. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  51. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
  53. package/dist/style.css +1 -1
  54. package/package.json +1 -1
  55. package/src/modules/auth/store/auth.js +45 -42
@@ -1,10 +1,10 @@
1
- import l from "../../../../node_modules/axios/lib/axios.js";
2
- import u from "../../../../../node_modules/js-cookie/src/js.cookie.js";
3
- import "../../../../node_modules/@capacitor/core/dist/index.js";
4
- import { reactive as m, watch as w } from "vue";
1
+ import m from "../../../../node_modules/axios/lib/axios.js";
2
+ import d from "../../../../../node_modules/js-cookie/src/js.cookie.js";
3
+ import { CapacitorCookies as l } from "../../../../node_modules/@capacitor/core/dist/index.js";
4
+ import { reactive as w, watch as k } from "vue";
5
5
  import { setError as n } from "../../globals/store/globals.js";
6
- import { state as h } from "./twofa.js";
7
- const i = l.create({ baseURL: process.env.API_URL, withCredentials: !0 }), o = m({
6
+ import { state as f } from "./twofa.js";
7
+ const i = m.create({ baseURL: process.env.API_URL, withCredentials: !0 }), a = w({
8
8
  user: {
9
9
  _id: void 0,
10
10
  username: "",
@@ -18,133 +18,155 @@ const i = l.create({ baseURL: process.env.API_URL, withCredentials: !0 }), o = m
18
18
  token: null,
19
19
  status: !1
20
20
  }
21
- }), d = f("user");
22
- if (d) {
23
- const { _id: s, email: a, phone: e, roles: c, accessToken: t } = d;
24
- Object.assign(o.user, { _id: s, email: a, phone: e }), Object.assign(o.access, { token: t, roles: c, status: !!t }), i.interceptors.request.use((r) => (t && (r.headers["x-access-token"] = t), r), (r) => Promise.reject(r));
21
+ });
22
+ async function O() {
23
+ const e = await h("user");
24
+ if (console.log("user cookie is " + e), e) {
25
+ const { _id: o, email: s, phone: c, roles: r, accessToken: t } = e;
26
+ Object.assign(a.user, { _id: o, email: s, phone: c }), Object.assign(a.access, { token: t, roles: r, status: !!t }), i.interceptors.request.use((p) => (t && (p.headers["x-access-token"] = t), p), (p) => Promise.reject(p));
27
+ }
25
28
  }
26
- const C = {
27
- async login(s, a) {
29
+ O();
30
+ const y = {
31
+ async login(e, o) {
28
32
  try {
29
- const e = await i.post("/api/auth/signin", {
30
- ...s,
31
- type: a
33
+ const s = await i.post("/api/auth/signin", {
34
+ ...e,
35
+ type: o
32
36
  });
33
- return p("user", e.data), Object.assign(o.user, {
34
- ...e.data
35
- }), Object.assign(o.access, {
36
- token: e.data.accessToken,
37
+ return u("user", s.data), Object.assign(a.user, {
38
+ ...s.data
39
+ }), Object.assign(a.access, {
40
+ token: s.data.accessToken,
37
41
  status: !0,
38
- roles: e.data.roles
39
- }), e.data;
40
- } catch (e) {
41
- return Object.assign(o.access, {
42
+ roles: s.data.roles
43
+ }), s.data;
44
+ } catch (s) {
45
+ return Object.assign(a.access, {
42
46
  token: null,
43
47
  status: !1,
44
48
  roles: null
45
- }), n(e), Promise.reject(e);
49
+ }), n(s), Promise.reject(s);
46
50
  }
47
51
  },
48
- async signup(s, a, e) {
49
- const { password: c, passwordRepeat: t } = o.user;
50
- if (c !== t) {
51
- const r = {
52
+ async signup(e, o, s) {
53
+ const { password: c, passwordRepeat: r } = a.user;
54
+ if (c !== r) {
55
+ const t = {
52
56
  response: {
53
57
  data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
54
58
  }
55
59
  };
56
- throw n(r), new Error(r.response.status);
60
+ throw n(t), new Error(t.response.status);
57
61
  }
58
62
  try {
59
- s.phone = s.phone.number;
60
- const r = await i.post("/api/auth/signup", {
61
- ...s,
62
- type: a,
63
- inviteCode: e
63
+ e.phone = e.phone.number;
64
+ const t = await i.post("/api/auth/signup", {
65
+ ...e,
66
+ type: o,
67
+ inviteCode: s
64
68
  });
65
- return r.data.accessToken && p("user", r.data), Object.assign(o.user, {
66
- ...r.data
67
- }), Object.assign(o.access, {
68
- token: r.data.accessToken,
69
+ return t.data.accessToken && u("user", t.data), Object.assign(a.user, {
70
+ ...t.data
71
+ }), Object.assign(a.access, {
72
+ token: t.data.accessToken,
69
73
  status: !0,
70
- roles: r.data.roles
71
- }), r.data;
72
- } catch (r) {
73
- throw n(r), console.log("Sign up falied"), r;
74
+ roles: t.data.roles
75
+ }), t.data;
76
+ } catch (t) {
77
+ throw n(t), console.log("Sign up falied"), t;
74
78
  }
75
79
  },
76
80
  logout() {
77
- g("user"), Object.assign(o.user, {
81
+ P("user"), Object.assign(a.user, {
78
82
  email: "",
79
83
  phone: "",
80
84
  password: "",
81
85
  passwordRepeat: ""
82
- }), Object.assign(o.access, {
86
+ }), Object.assign(a.access, {
83
87
  token: null,
84
88
  status: !1
85
89
  });
86
90
  },
87
- async resetPassword(s, a) {
91
+ async resetPassword(e, o) {
88
92
  try {
89
- const e = await i.post("/api/auth/reset-password", {
90
- email: s.email,
91
- phone: s.phone.number,
92
- type: a
93
+ const s = await i.post("/api/auth/reset-password", {
94
+ email: e.email,
95
+ phone: e.phone.number,
96
+ type: o
93
97
  });
94
- return Object.assign(h.code, {
95
- ...e.data,
98
+ return Object.assign(f.code, {
99
+ ...s.data,
96
100
  isSended: !0
97
- }), e.data;
98
- } catch (e) {
99
- return n(e), Promise.reject(e);
101
+ }), s.data;
102
+ } catch (s) {
103
+ return n(s), Promise.reject(s);
100
104
  }
101
105
  },
102
- async updatePassword(s, a) {
103
- const { password: e, passwordRepeat: c } = o.user;
104
- if (e !== c) {
105
- const t = {
106
+ async updatePassword(e, o) {
107
+ const { password: s, passwordRepeat: c } = a.user;
108
+ if (s !== c) {
109
+ const r = {
106
110
  response: {
107
111
  data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
108
112
  }
109
113
  };
110
- throw n(t), new Error(t.response.status);
114
+ throw n(r), new Error(r.response.status);
111
115
  }
112
116
  try {
113
- const t = await i.post("/api/auth/update-password", {
114
- email: s.email,
115
- phone: s.phone.number,
116
- password: s.password,
117
- passwordRepeat: s.passwordRepeat,
118
- type: a
117
+ const r = await i.post("/api/auth/update-password", {
118
+ email: e.email,
119
+ phone: e.phone.number,
120
+ password: e.password,
121
+ passwordRepeat: e.passwordRepeat,
122
+ type: o
119
123
  });
120
- return t.data.accessToken && p("user", t.data), Object.assign(o.user, {
121
- ...t.data
122
- }), Object.assign(o.access, {
123
- token: t.data.accessToken,
124
+ return r.data.accessToken && u("user", r.data), Object.assign(a.user, {
125
+ ...r.data
126
+ }), Object.assign(a.access, {
127
+ token: r.data.accessToken,
124
128
  status: !0
125
- }), t.data;
126
- } catch (t) {
127
- return n(t), Promise.reject(t);
129
+ }), r.data;
130
+ } catch (r) {
131
+ return n(r), Promise.reject(r);
128
132
  }
129
133
  }
130
- }, O = {
134
+ }, g = {
131
135
  development: { secure: !1, expires: 1 },
132
136
  production: { expires: 1, domain: process.env.API_URL, sameSite: "none", secure: !0 }
133
137
  };
134
- function f(s) {
135
- const a = u.get(s);
136
- return a ? JSON.parse(a) : null;
138
+ async function h(e) {
139
+ if (process.env.MOBILE_APP) {
140
+ const o = await l.getCookies();
141
+ return console.log("capacitor cookie is " + o), o ? JSON.parse(o[e]) : null;
142
+ } else {
143
+ const o = d.get(e);
144
+ return o ? JSON.parse(o) : null;
145
+ }
137
146
  }
138
- function p(s, a, e = process.env.NODE_ENV) {
139
- u.set(s, JSON.stringify(a), O[e]);
147
+ function u(e, o, s = process.env.NODE_ENV) {
148
+ process.env.MOBILE_APP ? l.setCookie({
149
+ url: process.env.API_URL,
150
+ // используйте ваш API_URL
151
+ key: e,
152
+ value: JSON.stringify(o)
153
+ }) : d.set(e, JSON.stringify(o), g[s]);
140
154
  }
141
- function g(s, a = process.env.NODE_ENV) {
142
- const e = a === "production" ? { domain: process.env.API_URL } : {};
143
- u.remove(s, e);
155
+ function P(e, o = process.env.NODE_ENV) {
156
+ if (process.env.MOBILE_APP)
157
+ l.deleteCookie({
158
+ url: process.env.API_URL,
159
+ // используйте ваш API_URL
160
+ key: e
161
+ });
162
+ else {
163
+ const s = o === "production" ? { domain: process.env.API_URL } : {};
164
+ d.remove(e, s);
165
+ }
144
166
  }
145
- w(o, (s, a) => {
167
+ k(a, (e, o) => {
146
168
  });
147
169
  export {
148
- C as actions,
149
- o as state
170
+ y as actions,
171
+ a as state
150
172
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("vue-router"),u=require("../../../../components/Select/Select.vue2.cjs"),a=require("../../store/blogposts.cjs"),c=require("../../../auth/store/auth.cjs"),m={class:"min-h-100vh pd-thin"},d={class:"mn-thin flex-v-center t-left flex-nowrap flex"},p={class:"flex-v-center flex-nowrap flex t-left"},f=e.createElementVNode("span",{class:""},"Topics for ",-1),g={class:"w-100 bg-grey pd-small radius-big mn-semi gap-thin flex-nowrap flex"},h={class:""},w={__name:"Community",setup(k){const l=n.useRoute(),r=n.useRouter();return(y,t)=>{const s=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("header",d,[e.createElementVNode("h2",p,[f,e.createVNode(u.default,{options:["today","week","month","year"],select:a.state.filter.period,"onUpdate:select":t[0]||(t[0]=o=>a.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",g,[e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="featured"},"t-medium pd-thin radius-small"]),onClick:t[1]||(t[1]=o=>e.unref(r).push({name:"Blog"}))},"👑 Featured",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="popular"},"t-medium pd-thin radius-small"]),onClick:t[2]||(t[2]=o=>e.unref(r).push({name:"Blog",params:{category:"popular"}}))},"🔥 Popular",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="new"},"t-medium pd-thin radius-small"]),onClick:t[3]||(t[3]=o=>e.unref(r).push({name:"Blog",params:{category:"new"}}))},"🆕 New",2),c.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="following"},"t-medium pd-thin radius-small"]),onClick:t[4]||(t[4]=o=>e.unref(r).push({name:"Blog",params:{category:"following"}}))},"👥 Following",2)):e.createCommentVNode("",!0)]),e.createElementVNode("section",h,[e.createVNode(s,null,{default:e.withCtx(({Component:o,route:i})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o),{ref:"page",key:i.query}))]),_:2},1024)]),_:1})])])}}};exports.default=w;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("vue-router"),u=require("../../../../components/Select/Select.vue.cjs"),a=require("../../store/blogposts.cjs"),c=require("../../../auth/store/auth.cjs"),m={class:"min-h-100vh pd-thin"},d={class:"mn-thin flex-v-center t-left flex-nowrap flex"},p={class:"flex-v-center flex-nowrap flex t-left"},f=e.createElementVNode("span",{class:""},"Topics for ",-1),g={class:"w-100 bg-grey pd-small radius-big mn-semi gap-thin flex-nowrap flex"},h={class:""},w={__name:"Community",setup(k){const l=n.useRoute(),r=n.useRouter();return(y,t)=>{const s=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("header",d,[e.createElementVNode("h2",p,[f,e.createVNode(u.default,{options:["today","week","month","year"],select:a.state.filter.period,"onUpdate:select":t[0]||(t[0]=o=>a.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",g,[e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="featured"},"t-medium pd-thin radius-small"]),onClick:t[1]||(t[1]=o=>e.unref(r).push({name:"Blog"}))},"👑 Featured",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="popular"},"t-medium pd-thin radius-small"]),onClick:t[2]||(t[2]=o=>e.unref(r).push({name:"Blog",params:{category:"popular"}}))},"🔥 Popular",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="new"},"t-medium pd-thin radius-small"]),onClick:t[3]||(t[3]=o=>e.unref(r).push({name:"Blog",params:{category:"new"}}))},"🆕 New",2),c.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="following"},"t-medium pd-thin radius-small"]),onClick:t[4]||(t[4]=o=>e.unref(r).push({name:"Blog",params:{category:"following"}}))},"👥 Following",2)):e.createCommentVNode("",!0)]),e.createElementVNode("section",h,[e.createVNode(s,null,{default:e.withCtx(({Component:o,route:i})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o),{ref:"page",key:i.query}))]),_:2},1024)]),_:1})])])}}};exports.default=w;
@@ -1,6 +1,6 @@
1
1
  import { resolveComponent as f, openBlock as n, createElementBlock as m, createElementVNode as o, createVNode as i, normalizeClass as r, unref as t, createCommentVNode as g, withCtx as p, Transition as h, createBlock as w, resolveDynamicComponent as y } from "vue";
2
2
  import { useRoute as _, useRouter as k } from "vue-router";
3
- import b from "../../../../components/Select/Select.vue2.js";
3
+ import b from "../../../../components/Select/Select.vue.js";
4
4
  import { state as c } from "../../store/blogposts.js";
5
5
  import { state as v } from "../../../auth/store/auth.js";
6
6
  const x = { class: "min-h-100vh pd-thin" }, C = { class: "mn-thin flex-v-center t-left flex-nowrap flex" }, B = { class: "flex-v-center flex-nowrap flex t-left" }, $ = /* @__PURE__ */ o("span", { class: "" }, "Topics for ", -1), N = { class: "w-100 bg-grey pd-small radius-big mn-semi gap-thin flex-nowrap flex" }, V = { class: "" }, D = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../../../constructor/components/elements/Textarea.vue2.cjs"),V=require("../../../constructor/components/sections/Constructor.vue.cjs"),y=require("../../../../components/Popup/Popup.vue.cjs");require("../../../../components/FieldTags/tag-input.vue.cjs");require("../../../../components/FieldTags/vue-tags-input.scss.cjs");const B=require("../../../../components/FieldTags/BlockTags.vue.cjs"),N=require("../../../../components/Checkbox/Checkbox.vue.cjs"),P=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),x=require("../../../../components/Button/Button.vue2.cjs"),f=require("vue-router"),n=require("../../store/blogposts.cjs"),i=require("../../../auth/store/auth.cjs"),C=require("../../../organizations/store/organizations.cjs"),q={class:"pd-thin"},E={key:0,class:"h-100 w-100 bg-grey pd-big radius-big"},T={class:"w-full h-full"},z={key:1,class:"pd-thin pos-sticky pos-l-0 pos-b-0 w-100"},O={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},D=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),M=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),S={key:0,class:"mn-thin"},U={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},A={__name:"CreateBlogPost",setup(R){const s=f.useRoute(),u=f.useRouter();let t=e.ref(null),p=e.ref(null);const c=e.ref([]),r=e.ref(null);e.onMounted(async()=>{if(s.params.url){const a=await n.read({user:i.state.user._id,url:s.params.url});t.value=a.pop()}else n.clean(),t.value=n.state.current;t.value.owner||(t.value.owner={target:i.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:i.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(r.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const o=await C.actions.read({user:i.state.user._id,postable:i.state.user._id,limit:100});console.log(o),p.value=o.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo}))});const g=e.ref(""),m=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>m.value.filter(o=>o.text.toLowerCase().includes(g.value.toLowerCase()))),e.computed(()=>m.value.filter(o=>!c.value.some(a=>a.text===o.text)));const d=e.ref(!1);function v(){d.value=!0}function h(){d.value=!1}function b(){c.value.length>0&&c.value.map(o=>o.text),t.value.status="draft",s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function k(){r.value&&(t.value.owner={target:r.value._id,type:"organization"}),r.value||(t.value.creator.hidden=!1),r.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function _(){confirm("Are you sure you want to delete this post?")&&n.remove(t.value._id).then(o=>{u.push({name:"User Blogposts",params:{_id:t.value.creator.target._id}})}).catch(o=>{console.log(o)})}return(o,a)=>(e.openBlock(),e.createElementBlock("article",q,[e.unref(t)?(e.openBlock(),e.createElementBlock("section",E,[e.createElementVNode("div",T,[e.createVNode(w.default,{prop:e.unref(t),content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])]),e.createVNode(V.default,{content:e.unref(t).content,onUpdate:a[0]||(a[0]=l=>e.unref(t).content=l)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",z,[e.createElementVNode("div",O,[e.unref(s).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[1]||(a[1]=l=>_()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:a[2]||(a[2]=l=>b()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:a[3]||(a[3]=l=>v()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(y.default,{title:"Добавить участника",onClosePopup:h,isPopupOpen:d.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[D,e.createVNode(B.default,{onTagsChanged:a[4]||(a[4]=l=>e.unref(t).tags=l),tags:e.unref(t).tags},null,8,["tags"]),M,e.createVNode(P.default,{modelValue:r.value,"onUpdate:modelValue":a[5]||(a[5]=l=>r.value=l),options:e.unref(p),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"]),r.value?(e.openBlock(),e.createElementBlock("h5",S,"Options:")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(N.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[6]||(a[6]=l=>e.unref(t).creator.hidden=l),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(x.default,{submit:k,callback:o.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])]),_:1},8,["isPopupOpen"])]))}};exports.default=A;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../../../constructor/components/elements/Textarea.vue.cjs"),V=require("../../../constructor/components/sections/Constructor.vue.cjs"),y=require("../../../../components/Popup/Popup.vue.cjs");require("../../../../components/FieldTags/tag-input.vue.cjs");require("../../../../components/FieldTags/vue-tags-input.scss.cjs");const B=require("../../../../components/FieldTags/BlockTags.vue.cjs"),N=require("../../../../components/Checkbox/Checkbox.vue.cjs"),P=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),x=require("../../../../components/Button/Button.vue2.cjs"),f=require("vue-router"),n=require("../../store/blogposts.cjs"),i=require("../../../auth/store/auth.cjs"),C=require("../../../organizations/store/organizations.cjs"),q={class:"pd-thin"},E={key:0,class:"h-100 w-100 bg-grey pd-big radius-big"},T={class:"w-full h-full"},z={key:1,class:"pd-thin pos-sticky pos-l-0 pos-b-0 w-100"},O={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},D=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),M=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),S={key:0,class:"mn-thin"},U={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},A={__name:"CreateBlogPost",setup(R){const s=f.useRoute(),u=f.useRouter();let t=e.ref(null),p=e.ref(null);const c=e.ref([]),r=e.ref(null);e.onMounted(async()=>{if(s.params.url){const a=await n.read({user:i.state.user._id,url:s.params.url});t.value=a.pop()}else n.clean(),t.value=n.state.current;t.value.owner||(t.value.owner={target:i.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:i.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(r.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const o=await C.actions.read({user:i.state.user._id,postable:i.state.user._id,limit:100});console.log(o),p.value=o.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo}))});const g=e.ref(""),m=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>m.value.filter(o=>o.text.toLowerCase().includes(g.value.toLowerCase()))),e.computed(()=>m.value.filter(o=>!c.value.some(a=>a.text===o.text)));const d=e.ref(!1);function v(){d.value=!0}function h(){d.value=!1}function b(){c.value.length>0&&c.value.map(o=>o.text),t.value.status="draft",s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function k(){r.value&&(t.value.owner={target:r.value._id,type:"organization"}),r.value||(t.value.creator.hidden=!1),r.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function _(){confirm("Are you sure you want to delete this post?")&&n.remove(t.value._id).then(o=>{u.push({name:"User Blogposts",params:{_id:t.value.creator.target._id}})}).catch(o=>{console.log(o)})}return(o,a)=>(e.openBlock(),e.createElementBlock("article",q,[e.unref(t)?(e.openBlock(),e.createElementBlock("section",E,[e.createElementVNode("div",T,[e.createVNode(w.default,{prop:e.unref(t),content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])]),e.createVNode(V.default,{content:e.unref(t).content,onUpdate:a[0]||(a[0]=l=>e.unref(t).content=l)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",z,[e.createElementVNode("div",O,[e.unref(s).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[1]||(a[1]=l=>_()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:a[2]||(a[2]=l=>b()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:a[3]||(a[3]=l=>v()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(y.default,{title:"Добавить участника",onClosePopup:h,isPopupOpen:d.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[D,e.createVNode(B.default,{onTagsChanged:a[4]||(a[4]=l=>e.unref(t).tags=l),tags:e.unref(t).tags},null,8,["tags"]),M,e.createVNode(P.default,{modelValue:r.value,"onUpdate:modelValue":a[5]||(a[5]=l=>r.value=l),options:e.unref(p),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"]),r.value?(e.openBlock(),e.createElementBlock("h5",S,"Options:")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(N.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[6]||(a[6]=l=>e.unref(t).creator.hidden=l),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(x.default,{submit:k,callback:o.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])]),_:1},8,["isPopupOpen"])]))}};exports.default=A;
@@ -1,5 +1,5 @@
1
1
  import { ref as r, onMounted as V, computed as _, openBlock as u, createElementBlock as i, unref as a, createElementVNode as p, createVNode as n, createCommentVNode as m, withCtx as w, createTextVNode as z } from "vue";
2
- import D from "../../../constructor/components/elements/Textarea.vue2.js";
2
+ import D from "../../../constructor/components/elements/Textarea.vue.js";
3
3
  import N from "../../../constructor/components/sections/Constructor.vue.js";
4
4
  import O from "../../../../components/Popup/Popup.vue.js";
5
5
  import "../../../../components/FieldTags/tag-input.vue.js";
@@ -1 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Textarea.vue2.cjs");const k=["placeholder"],x={__name:"Textarea",props:["prop","value","content","placeholder","index","setFocus"],emits:["deleteBlock","updateBlock","addBlock","focus"],setup(l,{emit:s}){const t=l,c=s;e.ref(t);const n=e.ref(null);e.ref(0);function d(a){let o=a.target.value.split(/\n+/);if(o.length>1){t.prop[t.content]=o[0],e.nextTick(()=>{r()});let u=o.slice(1).map(f=>({__name:"Textarea",content:f}));c("addBlock","Textarea","",t.index,{blocks:u,ref:n})}else a.target.value.trim()===""&&a.target.value.includes(`
2
+
3
+ `)&&(console.log("We are adding new block:"+t.index+newBlocks+n),c("addBlock","Textarea","",t.index,{blocks:newBlocks,ref:n})),r()}function p(a){(a.keyCode===8||a.keyCode===46)&&t.prop[t.content].trim()===""&&c("deleteBlock",t.prop)}function i(){e.nextTick(()=>{n.value.focus(),c("updateBlock",t.prop,{setFocus:!1})})}function r(){n.value.style.height="1rem",n.value.style.height=n.value.scrollHeight+"px"}return e.onUpdated(()=>{t.setFocus&&e.nextTick(()=>{i()}),r()}),e.onMounted(()=>{t.setFocus&&e.nextTick(()=>{i()}),r()}),(a,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":o[0]||(o[0]=u=>l.prop[l.content]=u),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:d,onFocus:o[1]||(o[1]=u=>c("focus",n.value)),onKeyup:p,ref_key:"textarea",ref:n,tabindex:"-1",class:"text-area mn-thin"},`
4
+ `,40,k),[[e.vModelText,l.prop[l.content]]])]))}};exports.default=x;
@@ -1,4 +1,64 @@
1
- const e = "";
1
+ import { ref as d, onUpdated as x, nextTick as s, onMounted as m, openBlock as h, createElementBlock as B, withDirectives as g, createElementVNode as v, vModelText as y } from "vue";
2
+ import "./Textarea.vue2.js";
3
+ const T = ["placeholder"], b = {
4
+ __name: "Textarea",
5
+ props: ["prop", "value", "content", "placeholder", "index", "setFocus"],
6
+ emits: ["deleteBlock", "updateBlock", "addBlock", "focus"],
7
+ setup(n, { emit: u }) {
8
+ const e = n, a = u;
9
+ d(e);
10
+ const t = d(null);
11
+ d(0);
12
+ function p(l) {
13
+ let o = l.target.value.split(/\n+/);
14
+ if (o.length > 1) {
15
+ e.prop[e.content] = o[0], s(() => {
16
+ c();
17
+ });
18
+ let r = o.slice(1).map((k) => ({ __name: "Textarea", content: k }));
19
+ a("addBlock", "Textarea", "", e.index, { blocks: r, ref: t });
20
+ } else
21
+ l.target.value.trim() === "" && l.target.value.includes(`
22
+
23
+ `) && (console.log("We are adding new block:" + e.index + newBlocks + t), a("addBlock", "Textarea", "", e.index, { blocks: newBlocks, ref: t })), c();
24
+ }
25
+ function f(l) {
26
+ (l.keyCode === 8 || l.keyCode === 46) && e.prop[e.content].trim() === "" && a("deleteBlock", e.prop);
27
+ }
28
+ function i() {
29
+ s(() => {
30
+ t.value.focus(), a("updateBlock", e.prop, { setFocus: !1 });
31
+ });
32
+ }
33
+ function c() {
34
+ t.value.style.height = "1rem", t.value.style.height = t.value.scrollHeight + "px";
35
+ }
36
+ return x(() => {
37
+ e.setFocus && s(() => {
38
+ i();
39
+ }), c();
40
+ }), m(() => {
41
+ e.setFocus && s(() => {
42
+ i();
43
+ }), c();
44
+ }), (l, o) => (h(), B("div", null, [
45
+ g(v("textarea", {
46
+ "onUpdate:modelValue": o[0] || (o[0] = (r) => n.prop[n.content] = r),
47
+ placeholder: n.placeholder ? n.placeholder : "Enter text",
48
+ onInput: p,
49
+ onFocus: o[1] || (o[1] = (r) => a("focus", t.value)),
50
+ onKeyup: f,
51
+ ref_key: "textarea",
52
+ ref: t,
53
+ tabindex: "-1",
54
+ class: "text-area mn-thin"
55
+ }, `
56
+ `, 40, T), [
57
+ [y, n.prop[n.content]]
58
+ ])
59
+ ]));
60
+ }
61
+ };
2
62
  export {
3
- e as default
63
+ b as default
4
64
  };
@@ -1,4 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Textarea.vue.cjs");const k=["placeholder"],x={__name:"Textarea",props:["prop","value","content","placeholder","index","setFocus"],emits:["deleteBlock","updateBlock","addBlock","focus"],setup(l,{emit:s}){const t=l,c=s;e.ref(t);const n=e.ref(null);e.ref(0);function d(a){let o=a.target.value.split(/\n+/);if(o.length>1){t.prop[t.content]=o[0],e.nextTick(()=>{r()});let u=o.slice(1).map(f=>({__name:"Textarea",content:f}));c("addBlock","Textarea","",t.index,{blocks:u,ref:n})}else a.target.value.trim()===""&&a.target.value.includes(`
2
-
3
- `)&&(console.log("We are adding new block:"+t.index+newBlocks+n),c("addBlock","Textarea","",t.index,{blocks:newBlocks,ref:n})),r()}function p(a){(a.keyCode===8||a.keyCode===46)&&t.prop[t.content].trim()===""&&c("deleteBlock",t.prop)}function i(){e.nextTick(()=>{n.value.focus(),c("updateBlock",t.prop,{setFocus:!1})})}function r(){n.value.style.height="1rem",n.value.style.height=n.value.scrollHeight+"px"}return e.onUpdated(()=>{t.setFocus&&e.nextTick(()=>{i()}),r()}),e.onMounted(()=>{t.setFocus&&e.nextTick(()=>{i()}),r()}),(a,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":o[0]||(o[0]=u=>l.prop[l.content]=u),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:d,onFocus:o[1]||(o[1]=u=>c("focus",n.value)),onKeyup:p,ref_key:"textarea",ref:n,tabindex:"-1",class:"text-area mn-thin"},`
4
- `,40,k),[[e.vModelText,l.prop[l.content]]])]))}};exports.default=x;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
@@ -1,64 +1,4 @@
1
- import { ref as d, onUpdated as x, nextTick as s, onMounted as m, openBlock as h, createElementBlock as B, withDirectives as g, createElementVNode as v, vModelText as y } from "vue";
2
- import "./Textarea.vue.js";
3
- const T = ["placeholder"], b = {
4
- __name: "Textarea",
5
- props: ["prop", "value", "content", "placeholder", "index", "setFocus"],
6
- emits: ["deleteBlock", "updateBlock", "addBlock", "focus"],
7
- setup(n, { emit: u }) {
8
- const e = n, a = u;
9
- d(e);
10
- const t = d(null);
11
- d(0);
12
- function p(l) {
13
- let o = l.target.value.split(/\n+/);
14
- if (o.length > 1) {
15
- e.prop[e.content] = o[0], s(() => {
16
- c();
17
- });
18
- let r = o.slice(1).map((k) => ({ __name: "Textarea", content: k }));
19
- a("addBlock", "Textarea", "", e.index, { blocks: r, ref: t });
20
- } else
21
- l.target.value.trim() === "" && l.target.value.includes(`
22
-
23
- `) && (console.log("We are adding new block:" + e.index + newBlocks + t), a("addBlock", "Textarea", "", e.index, { blocks: newBlocks, ref: t })), c();
24
- }
25
- function f(l) {
26
- (l.keyCode === 8 || l.keyCode === 46) && e.prop[e.content].trim() === "" && a("deleteBlock", e.prop);
27
- }
28
- function i() {
29
- s(() => {
30
- t.value.focus(), a("updateBlock", e.prop, { setFocus: !1 });
31
- });
32
- }
33
- function c() {
34
- t.value.style.height = "1rem", t.value.style.height = t.value.scrollHeight + "px";
35
- }
36
- return x(() => {
37
- e.setFocus && s(() => {
38
- i();
39
- }), c();
40
- }), m(() => {
41
- e.setFocus && s(() => {
42
- i();
43
- }), c();
44
- }), (l, o) => (h(), B("div", null, [
45
- g(v("textarea", {
46
- "onUpdate:modelValue": o[0] || (o[0] = (r) => n.prop[n.content] = r),
47
- placeholder: n.placeholder ? n.placeholder : "Enter text",
48
- onInput: p,
49
- onFocus: o[1] || (o[1] = (r) => a("focus", t.value)),
50
- onKeyup: f,
51
- ref_key: "textarea",
52
- ref: t,
53
- tabindex: "-1",
54
- class: "text-area mn-thin"
55
- }, `
56
- `, 40, T), [
57
- [y, n.prop[n.content]]
58
- ])
59
- ]));
60
- }
61
- };
1
+ const e = "";
62
2
  export {
63
- b as default
3
+ e as default
64
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),E=require("../elements/Textarea.vue2.cjs"),x=require("../elements/H2.vue.cjs"),N=require("../elements/Caption.vue.cjs"),y=require("../elements/Bullets.vue.cjs"),A=require("../elements/ImageUpload.vue.cjs"),V=require("../elements/Embed.vue.cjs"),q=require("../elements/Audio.vue.cjs"),D=require("../../../../../../node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.cjs"),M=["onMouseover"],T={key:0,class:"z-index-5 radius-thin pd-thin bg-white w-max mn-small flex-nowrap flex-column flex"},$=["onClick"],F=["onClick"],I=["onClick"],S=["onClick"],U={__name:"Constructor",props:["content"],emits:["update"],setup(v,{emit:f}){const k=v,u=f;let t=e.ref(null);e.ref(null),t.value={content:k.content};const g={Textarea:E.default,H2:x.default,Bullets:y.default,Caption:N.default,ImageUpload:A.default,Embed:V.default,Audio:q.default};function s(c="Textarea",l="",n,o){console.log("We are adding new block (functuin HandleAddBlock):"+c+l+n+o);let a={order:t.value.content.length+1,type:c,style:"",class:"",content:l,blocks:[],setFocus:!0};if(o&&o.blocks&&Array.isArray(o.blocks)){let m=o.blocks.map(_=>({...a,content:_.content})),B=[(o.index||n)+1,0].concat(m);t.value.content.splice.apply(t.value.content,B);const C=m[m.length-1];console.log("New block is"+C)}else n!==void 0?(t.value.content.splice(n+1,0,a),console.log("Latest block is"+a)):(console.log("Another block is"+a),t.value.content.push(a));i.value=null,u("update",t.value.content)}function h(c,l){const n=t.value.content.findIndex(o=>o===c);n!==-1&&(t.value.content[n]={...t.value.content[n],...l}),u("update",t.value.content)}function p(c){let l=t.value.content.findIndex(n=>n===c);l!==-1&&t.value.content.splice(l,1),t.value.content[l-1].setFocus=!0,u("update",t.value.content)}const i=e.ref(null),d=e.ref(!1),r=e.ref(!1);function b(){d.value=!0}function w(){d.value=!1}return e.watchEffect(()=>{t.value&&t.value.content.length===0&&s("Textarea",""),u("update",t.value.content)}),(c,l)=>(e.openBlock(),e.createElementBlock("section",null,[e.unref(t).content?(e.openBlock(),e.createBlock(e.unref(D.VueDraggableNext),{key:0,class:"w-full",list:e.unref(t).content,onStart:b,onEnd:w},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).content,(n,o)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"pos-relative"},[e.createElementVNode("div",{onMouseover:a=>(i.value=o,r.value=!1),class:"pos-relative w-full h-full"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g[n.type]),{index:o,component:n,prop:n,class:e.normalizeClass(n.class),setFocus:n.setFocus,content:"content",onDeleteBlock:p,onAddBlock:s,onUpdateBlock:h},null,40,["index","component","prop","class","setFocus"]))],40,M),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[i.value===o?(e.openBlock(),e.createElementBlock("div",{key:0,class:"pos-absolute z-index-4 i-semi",style:{right:"calc(100% + 0.5rem)",top:"calc(50% - 1.125rem)"},onMousedown:l[1]||(l[1]=e.withModifiers(a=>d.value=!0,["prevent"]))},[e.createElementVNode("button",{onClick:l[0]||(l[0]=a=>r.value=!r.value),class:"mn-small cursor-pointer w-100 i-semi bg-white radius-thin"},e.toDisplayString(n.content?"...":"+"),1),r.value?(e.openBlock(),e.createElementBlock("div",T,[e.createElementVNode("span",{onClick:a=>p(n),class:"mn-thin w-max t-red bg-white button-small button"}," Remove ",8,$),e.createElementVNode("span",{onClick:a=>s("ImageUpload","",o),class:"mn-thin w-max t-black bg-white button-small button"}," Add Image ",8,F),e.createElementVNode("span",{onClick:a=>s("H2","",o),class:"w-max button-small t-black bg-white button"}," Add Title ",8,I),e.createElementVNode("span",{onClick:a=>s("Embed","",o),class:"w-max button-small t-black bg-white button"}," Add Embed ",8,S)])):e.createCommentVNode("",!0)],32)):e.createCommentVNode("",!0)]),_:2},1024)]))),128))]),_:1},8,["list"])):e.createCommentVNode("",!0)]))}};exports.default=U;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),E=require("../elements/Textarea.vue.cjs"),x=require("../elements/H2.vue.cjs"),N=require("../elements/Caption.vue.cjs"),y=require("../elements/Bullets.vue.cjs"),A=require("../elements/ImageUpload.vue.cjs"),V=require("../elements/Embed.vue.cjs"),q=require("../elements/Audio.vue.cjs"),D=require("../../../../../../node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.cjs"),M=["onMouseover"],T={key:0,class:"z-index-5 radius-thin pd-thin bg-white w-max mn-small flex-nowrap flex-column flex"},$=["onClick"],F=["onClick"],I=["onClick"],S=["onClick"],U={__name:"Constructor",props:["content"],emits:["update"],setup(v,{emit:f}){const k=v,u=f;let t=e.ref(null);e.ref(null),t.value={content:k.content};const g={Textarea:E.default,H2:x.default,Bullets:y.default,Caption:N.default,ImageUpload:A.default,Embed:V.default,Audio:q.default};function s(c="Textarea",l="",n,o){console.log("We are adding new block (functuin HandleAddBlock):"+c+l+n+o);let a={order:t.value.content.length+1,type:c,style:"",class:"",content:l,blocks:[],setFocus:!0};if(o&&o.blocks&&Array.isArray(o.blocks)){let m=o.blocks.map(_=>({...a,content:_.content})),B=[(o.index||n)+1,0].concat(m);t.value.content.splice.apply(t.value.content,B);const C=m[m.length-1];console.log("New block is"+C)}else n!==void 0?(t.value.content.splice(n+1,0,a),console.log("Latest block is"+a)):(console.log("Another block is"+a),t.value.content.push(a));i.value=null,u("update",t.value.content)}function h(c,l){const n=t.value.content.findIndex(o=>o===c);n!==-1&&(t.value.content[n]={...t.value.content[n],...l}),u("update",t.value.content)}function p(c){let l=t.value.content.findIndex(n=>n===c);l!==-1&&t.value.content.splice(l,1),t.value.content[l-1].setFocus=!0,u("update",t.value.content)}const i=e.ref(null),d=e.ref(!1),r=e.ref(!1);function b(){d.value=!0}function w(){d.value=!1}return e.watchEffect(()=>{t.value&&t.value.content.length===0&&s("Textarea",""),u("update",t.value.content)}),(c,l)=>(e.openBlock(),e.createElementBlock("section",null,[e.unref(t).content?(e.openBlock(),e.createBlock(e.unref(D.VueDraggableNext),{key:0,class:"w-full",list:e.unref(t).content,onStart:b,onEnd:w},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).content,(n,o)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"pos-relative"},[e.createElementVNode("div",{onMouseover:a=>(i.value=o,r.value=!1),class:"pos-relative w-full h-full"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g[n.type]),{index:o,component:n,prop:n,class:e.normalizeClass(n.class),setFocus:n.setFocus,content:"content",onDeleteBlock:p,onAddBlock:s,onUpdateBlock:h},null,40,["index","component","prop","class","setFocus"]))],40,M),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[i.value===o?(e.openBlock(),e.createElementBlock("div",{key:0,class:"pos-absolute z-index-4 i-semi",style:{right:"calc(100% + 0.5rem)",top:"calc(50% - 1.125rem)"},onMousedown:l[1]||(l[1]=e.withModifiers(a=>d.value=!0,["prevent"]))},[e.createElementVNode("button",{onClick:l[0]||(l[0]=a=>r.value=!r.value),class:"mn-small cursor-pointer w-100 i-semi bg-white radius-thin"},e.toDisplayString(n.content?"...":"+"),1),r.value?(e.openBlock(),e.createElementBlock("div",T,[e.createElementVNode("span",{onClick:a=>p(n),class:"mn-thin w-max t-red bg-white button-small button"}," Remove ",8,$),e.createElementVNode("span",{onClick:a=>s("ImageUpload","",o),class:"mn-thin w-max t-black bg-white button-small button"}," Add Image ",8,F),e.createElementVNode("span",{onClick:a=>s("H2","",o),class:"w-max button-small t-black bg-white button"}," Add Title ",8,I),e.createElementVNode("span",{onClick:a=>s("Embed","",o),class:"w-max button-small t-black bg-white button"}," Add Embed ",8,S)])):e.createCommentVNode("",!0)],32)):e.createCommentVNode("",!0)]),_:2},1024)]))),128))]),_:1},8,["list"])):e.createCommentVNode("",!0)]))}};exports.default=U;
@@ -1,5 +1,5 @@
1
1
  import { ref as u, watchEffect as M, openBlock as a, createElementBlock as r, unref as p, createBlock as g, withCtx as b, Fragment as N, renderList as I, createElementVNode as c, resolveDynamicComponent as T, normalizeClass as U, createVNode as V, Transition as z, withModifiers as H, toDisplayString as S, createCommentVNode as k } from "vue";
2
- import L from "../elements/Textarea.vue2.js";
2
+ import L from "../elements/Textarea.vue.js";
3
3
  import R from "../elements/H2.vue.js";
4
4
  import W from "../elements/Caption.vue.js";
5
5
  import j from "../elements/Bullets.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router");require("../../../../components/Select/Select.vue.cjs");const f=require("../../../../components/DatePicker/DatePicker.vue.cjs"),i=require("../../store/events.cjs"),m={class:"pd-thin min-h-100vh"},g=e.createElementVNode("div",{class:"mn-thin br-solid br-1px br-grey bg-grey radius-big"},null,-1),y={class:""},_={__name:"layoutEvents",setup(b){const l=c.useRoute(),d=c.useRouter(),u=p(new Date);function p(t){return`${t.getDate().toString().padStart(2,"0")}${(t.getMonth()+1).toString().padStart(2,"0")}${t.getFullYear()}`}if(l.query){const t=l.query,s={tags:t.tags?t.tags.split(","):null,date:t.date?t.date:u};i.state.filter=s}else{const t={date:u};i.state.filter=t}return e.watch(()=>i.state.filter,(t,s)=>{const a={...l.query};Object.keys(s).forEach(o=>{a[o]&&delete a[o]});const n=Object.fromEntries(Object.entries(t).filter(([o,r])=>Array.isArray(r)&&r.length>0||typeof r=="string"&&r).map(([o,r])=>[o,Array.isArray(r)?r.join(","):r]));Object.assign(a,n),d.push({query:a})},{deep:!0}),(t,s)=>{const a=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",m,[e.createVNode(f.default,{date:i.state.filter.date,"onUpdate:date":s[0]||(s[0]=n=>i.state.filter.date=n),locale:t.$i18n.locale,class:"radius-small bg-grey pd-l-zero pd-r-zero pd-medium"},null,8,["date","locale"]),g,e.createElementVNode("section",y,[e.createVNode(a,null,{default:e.withCtx(({Component:n,route:o})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n),{ref:"page",key:o.query}))]),_:2},1024)]),_:1})])])}}};exports.default=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router");require("../../../../components/Select/Select.vue2.cjs");const f=require("../../../../components/DatePicker/DatePicker.vue.cjs"),i=require("../../store/events.cjs"),m={class:"pd-thin min-h-100vh"},g=e.createElementVNode("div",{class:"mn-thin br-solid br-1px br-grey bg-grey radius-big"},null,-1),y={class:""},_={__name:"layoutEvents",setup(b){const l=c.useRoute(),d=c.useRouter(),u=p(new Date);function p(t){return`${t.getDate().toString().padStart(2,"0")}${(t.getMonth()+1).toString().padStart(2,"0")}${t.getFullYear()}`}if(l.query){const t=l.query,s={tags:t.tags?t.tags.split(","):null,date:t.date?t.date:u};i.state.filter=s}else{const t={date:u};i.state.filter=t}return e.watch(()=>i.state.filter,(t,s)=>{const a={...l.query};Object.keys(s).forEach(o=>{a[o]&&delete a[o]});const n=Object.fromEntries(Object.entries(t).filter(([o,r])=>Array.isArray(r)&&r.length>0||typeof r=="string"&&r).map(([o,r])=>[o,Array.isArray(r)?r.join(","):r]));Object.assign(a,n),d.push({query:a})},{deep:!0}),(t,s)=>{const a=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",m,[e.createVNode(f.default,{date:i.state.filter.date,"onUpdate:date":s[0]||(s[0]=n=>i.state.filter.date=n),locale:t.$i18n.locale,class:"radius-small bg-grey pd-l-zero pd-r-zero pd-medium"},null,8,["date","locale"]),g,e.createElementVNode("section",y,[e.createVNode(a,null,{default:e.withCtx(({Component:n,route:o})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n),{ref:"page",key:o.query}))]),_:2},1024)]),_:1})])])}}};exports.default=_;
@@ -1,6 +1,6 @@
1
1
  import { watch as y, resolveComponent as g, openBlock as u, createElementBlock as _, createVNode as l, createElementVNode as m, withCtx as d, Transition as b, createBlock as h, resolveDynamicComponent as w } from "vue";
2
2
  import { useRoute as D, useRouter as q } from "vue-router";
3
- import "../../../../components/Select/Select.vue.js";
3
+ import "../../../../components/Select/Select.vue2.js";
4
4
  import j from "../../../../components/DatePicker/DatePicker.vue.js";
5
5
  import { state as s } from "../../store/events.js";
6
6
  const k = { class: "pd-thin min-h-100vh" }, E = /* @__PURE__ */ m("div", { class: "mn-thin br-solid br-1px br-grey bg-grey radius-big" }, null, -1), V = { class: "" }, B = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../constructor/components/elements/Textarea.vue.cjs");const N=require("../../../constructor/components/sections/Constructor.vue.cjs"),E=require("../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs");require("../../../../../node_modules/@vuepic/vue-datepicker/dist/main.css.cjs");const y=require("../../../../components/Popup/Popup.vue.cjs"),f=require("../../../../components/Field/Field.vue2.cjs"),q=require("../../../../components/FieldTags/BlockTags.vue.cjs"),P=require("../../../../components/Checkbox/Checkbox.vue.cjs"),C=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),x=require("../../../../components/UploadImage/UploadImage.vue.cjs"),B=require("../../../../components/Button/Button.vue2.cjs"),v=require("vue-router"),s=require("../../store/events.cjs"),u=require("../../../auth/store/auth.cjs"),D=require("../../../organizations/store/organizations.cjs");require("./EditEvent.vue2.cjs");const U={key:0,class:"h-100 pd-thin"},T={class:"mn-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex"},z=e.createElementVNode("h4",null,"Upload Event Cover",-1),O=e.createElementVNode("h3",{class:"mn-small"},"Date",-1),M=e.createElementVNode("h3",{class:"mn-small"},"Description",-1),S={key:0,class:"pd-b-extra w-100 bg-grey pd-big radius-big"},A={key:1,class:"pd-thin pos-sticky pos-l-0 pos-b-0 w-100"},R={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},$=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),F=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),j={key:0,class:"mn-thin"},H={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},G={__name:"EditEvent",setup(J){const i=v.useRoute(),d=v.useRouter();let t=e.ref(null),p=e.ref(null);const m=e.ref([]),n=e.ref(null),r=e.ref(),h=()=>({top:0,left:0});e.onMounted(async()=>{if(i.params.url){const a=await s.read({user:u.state.user._id,url:i.params.url});t.value=a.pop();const l=t.value.date.start,_=t.value.date.end;r.value=[l,_]}else{s.clean(),t.value=s.state.current;const a=new Date,l=new Date;r.value=[a,l]}t.value.owner||(t.value.owner={target:u.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:u.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(n.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const o=await D.actions.read({user:u.state.user._id,postable:u.state.user._id,limit:100});p.value=o.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo}))});const c=e.ref(!1);function g(){c.value=!0}function b(){c.value=!1}function k(){m.value.length>0&&m.value.map(o=>o.text),t.value.status="draft",t.value.date={start:r.value[0],end:r.value[1]},i.params.url?s.update(t.value).then(o=>{d.push({name:"Event",params:{url:o.url}})}).catch(o=>{console.error(o)}):s.create(t.value).then(o=>{d.push({name:"Event",params:{url:o.url}})}).catch(o=>{console.error(o)})}function V(){n.value&&(t.value.owner={target:n.value._id,type:"organization"}),n.value||(t.value.creator.hidden=!1),n.value||(t.value.organization=t.value.creator),t.value.status="published",t.value.date={start:r.value[0],end:r.value[1]},console.log(r.value),i.params.url?s.update(t.value).then(o=>{d.push({name:"Event",params:{url:o.url}})}).catch(o=>{console.log(o)}):s.create(t.value).then(o=>{d.push({name:"Event",params:{url:o.url}})}).catch(o=>{console.log(o)})}function w(){confirm("Are you sure you want to delete this event?")&&s.remove(t.value._id).then(o=>{d.push({name:"User Events",params:{_id:t.value.creator.target._id}})}).catch(o=>{console.error(o)})}return(o,a)=>e.unref(t)?(e.openBlock(),e.createElementBlock("article",U,[e.createElementVNode("div",T,[e.createVNode(x.default,{photo:e.unref(t).cover,"onUpdate:photo":a[0]||(a[0]=l=>e.unref(t).cover=l),uploadPath:"users/"+u.state.user._id+"/events",class:"h-4r w-4r aspect-1x1 o-hidden mn-thin radius-extra"},null,8,["photo","uploadPath"]),z]),e.createVNode(f.default,{field:e.unref(t).name,"onUpdate:field":a[1]||(a[1]=l=>e.unref(t).name=l),placeholder:"Event name",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(f.default,{field:e.unref(t).description,"onUpdate:field":a[2]||(a[2]=l=>e.unref(t).description=l),type:"textfield",placeholder:"Enter short description",class:"mn-semi w-100 bg-grey pd-medium radius-small"},null,8,["field"]),O,e.createVNode(e.unref(E.default),{modelValue:r.value,"onUpdate:modelValue":a[3]||(a[3]=l=>r.value=l),"alt-position":h,range:"",class:"mn-semi"},null,8,["modelValue"]),M,e.unref(t)?(e.openBlock(),e.createElementBlock("section",S,[e.createVNode(N.default,{content:e.unref(t).content,onUpdate:a[4]||(a[4]=l=>e.unref(t).content=l)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",A,[e.createElementVNode("div",R,[e.unref(i).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[5]||(a[5]=l=>w()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:a[6]||(a[6]=l=>k()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:a[7]||(a[7]=l=>g()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(y.default,{title:"Добавить участника",onClosePopup:b,isPopupOpen:c.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[$,e.createVNode(q.default,{onTagsChanged:a[8]||(a[8]=l=>e.unref(t).tags=l),tags:e.unref(t).tags},null,8,["tags"]),F,e.createVNode(C.default,{modelValue:n.value,"onUpdate:modelValue":a[9]||(a[9]=l=>n.value=l),options:e.unref(p),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"]),n.value?(e.openBlock(),e.createElementBlock("h5",j,"Options:")):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createElementBlock("div",H,[e.createVNode(P.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[10]||(a[10]=l=>e.unref(t).creator.hidden=l),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(B.default,{submit:V,callback:o.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])]),_:1},8,["isPopupOpen"])])):e.createCommentVNode("",!0)}};exports.default=G;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../constructor/components/elements/Textarea.vue2.cjs");const N=require("../../../constructor/components/sections/Constructor.vue.cjs"),E=require("../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs");require("../../../../../node_modules/@vuepic/vue-datepicker/dist/main.css.cjs");const y=require("../../../../components/Popup/Popup.vue.cjs"),f=require("../../../../components/Field/Field.vue2.cjs"),q=require("../../../../components/FieldTags/BlockTags.vue.cjs"),P=require("../../../../components/Checkbox/Checkbox.vue.cjs"),C=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),x=require("../../../../components/UploadImage/UploadImage.vue.cjs"),B=require("../../../../components/Button/Button.vue2.cjs"),v=require("vue-router"),s=require("../../store/events.cjs"),u=require("../../../auth/store/auth.cjs"),D=require("../../../organizations/store/organizations.cjs");require("./EditEvent.vue2.cjs");const U={key:0,class:"h-100 pd-thin"},T={class:"mn-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex"},z=e.createElementVNode("h4",null,"Upload Event Cover",-1),O=e.createElementVNode("h3",{class:"mn-small"},"Date",-1),M=e.createElementVNode("h3",{class:"mn-small"},"Description",-1),S={key:0,class:"pd-b-extra w-100 bg-grey pd-big radius-big"},A={key:1,class:"pd-thin pos-sticky pos-l-0 pos-b-0 w-100"},R={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},$=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),F=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),j={key:0,class:"mn-thin"},H={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},G={__name:"EditEvent",setup(J){const i=v.useRoute(),d=v.useRouter();let t=e.ref(null),p=e.ref(null);const m=e.ref([]),n=e.ref(null),r=e.ref(),h=()=>({top:0,left:0});e.onMounted(async()=>{if(i.params.url){const a=await s.read({user:u.state.user._id,url:i.params.url});t.value=a.pop();const l=t.value.date.start,_=t.value.date.end;r.value=[l,_]}else{s.clean(),t.value=s.state.current;const a=new Date,l=new Date;r.value=[a,l]}t.value.owner||(t.value.owner={target:u.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:u.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(n.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const o=await D.actions.read({user:u.state.user._id,postable:u.state.user._id,limit:100});p.value=o.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo}))});const c=e.ref(!1);function g(){c.value=!0}function b(){c.value=!1}function k(){m.value.length>0&&m.value.map(o=>o.text),t.value.status="draft",t.value.date={start:r.value[0],end:r.value[1]},i.params.url?s.update(t.value).then(o=>{d.push({name:"Event",params:{url:o.url}})}).catch(o=>{console.error(o)}):s.create(t.value).then(o=>{d.push({name:"Event",params:{url:o.url}})}).catch(o=>{console.error(o)})}function V(){n.value&&(t.value.owner={target:n.value._id,type:"organization"}),n.value||(t.value.creator.hidden=!1),n.value||(t.value.organization=t.value.creator),t.value.status="published",t.value.date={start:r.value[0],end:r.value[1]},console.log(r.value),i.params.url?s.update(t.value).then(o=>{d.push({name:"Event",params:{url:o.url}})}).catch(o=>{console.log(o)}):s.create(t.value).then(o=>{d.push({name:"Event",params:{url:o.url}})}).catch(o=>{console.log(o)})}function w(){confirm("Are you sure you want to delete this event?")&&s.remove(t.value._id).then(o=>{d.push({name:"User Events",params:{_id:t.value.creator.target._id}})}).catch(o=>{console.error(o)})}return(o,a)=>e.unref(t)?(e.openBlock(),e.createElementBlock("article",U,[e.createElementVNode("div",T,[e.createVNode(x.default,{photo:e.unref(t).cover,"onUpdate:photo":a[0]||(a[0]=l=>e.unref(t).cover=l),uploadPath:"users/"+u.state.user._id+"/events",class:"h-4r w-4r aspect-1x1 o-hidden mn-thin radius-extra"},null,8,["photo","uploadPath"]),z]),e.createVNode(f.default,{field:e.unref(t).name,"onUpdate:field":a[1]||(a[1]=l=>e.unref(t).name=l),placeholder:"Event name",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(f.default,{field:e.unref(t).description,"onUpdate:field":a[2]||(a[2]=l=>e.unref(t).description=l),type:"textfield",placeholder:"Enter short description",class:"mn-semi w-100 bg-grey pd-medium radius-small"},null,8,["field"]),O,e.createVNode(e.unref(E.default),{modelValue:r.value,"onUpdate:modelValue":a[3]||(a[3]=l=>r.value=l),"alt-position":h,range:"",class:"mn-semi"},null,8,["modelValue"]),M,e.unref(t)?(e.openBlock(),e.createElementBlock("section",S,[e.createVNode(N.default,{content:e.unref(t).content,onUpdate:a[4]||(a[4]=l=>e.unref(t).content=l)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",A,[e.createElementVNode("div",R,[e.unref(i).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[5]||(a[5]=l=>w()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:a[6]||(a[6]=l=>k()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:a[7]||(a[7]=l=>g()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(y.default,{title:"Добавить участника",onClosePopup:b,isPopupOpen:c.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[$,e.createVNode(q.default,{onTagsChanged:a[8]||(a[8]=l=>e.unref(t).tags=l),tags:e.unref(t).tags},null,8,["tags"]),F,e.createVNode(C.default,{modelValue:n.value,"onUpdate:modelValue":a[9]||(a[9]=l=>n.value=l),options:e.unref(p),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"]),n.value?(e.openBlock(),e.createElementBlock("h5",j,"Options:")):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createElementBlock("div",H,[e.createVNode(P.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[10]||(a[10]=l=>e.unref(t).creator.hidden=l),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(B.default,{submit:V,callback:o.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])]),_:1},8,["isPopupOpen"])])):e.createCommentVNode("",!0)}};exports.default=G;
@@ -1,5 +1,5 @@
1
1
  import { ref as u, onMounted as $, unref as l, openBlock as d, createElementBlock as m, createElementVNode as i, createVNode as s, createCommentVNode as p, withCtx as _, createTextVNode as T } from "vue";
2
- import "../../../constructor/components/elements/Textarea.vue.js";
2
+ import "../../../constructor/components/elements/Textarea.vue2.js";
3
3
  import z from "../../../constructor/components/sections/Constructor.vue.js";
4
4
  import N from "../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js";
5
5
  import "../../../../../node_modules/@vuepic/vue-datepicker/dist/main.css.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const t=require("../sections/Feed.vue.cjs");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/Popup/Popup.vue2.cjs");require("../../../../components/Button/Button.vue.cjs");require("../../../../components/Select/Select.vue.cjs");require("../../../reports/store/reports.cjs");require("../../../../components/Dropdown/Dropdown.vue.cjs");const i=require("../../../auth/store/auth.cjs");require("../../../organizations/store/memberships.cjs");require("../../../community/store/reactions.cjs");const o=require("../../store/events.cjs");require("../sections/List.vue2.cjs");const s={__name:"Events",setup(c){const r=u.useRoute();return u.useRouter(),(n,a)=>(e.openBlock(),e.createElementBlock("section",null,[e.createVNode(t.default,{category:e.unref(r).params.category,user:i.state.user._id,period:e.unref(r).query.period,selectedDate:o.state.filter.date},null,8,["category","user","period","selectedDate"])]))}};exports.default=s;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const t=require("../sections/Feed.vue.cjs");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/Popup/Popup.vue2.cjs");require("../../../../components/Button/Button.vue.cjs");require("../../../../components/Select/Select.vue2.cjs");require("../../../reports/store/reports.cjs");require("../../../../components/Dropdown/Dropdown.vue2.cjs");const i=require("../../../auth/store/auth.cjs");require("../../../organizations/store/memberships.cjs");require("../../../community/store/reactions.cjs");const o=require("../../store/events.cjs");require("../sections/List.vue2.cjs");const s={__name:"Events",setup(c){const r=u.useRoute();return u.useRouter(),(n,a)=>(e.openBlock(),e.createElementBlock("section",null,[e.createVNode(t.default,{category:e.unref(r).params.category,user:i.state.user._id,period:e.unref(r).query.period,selectedDate:o.state.filter.date},null,8,["category","user","period","selectedDate"])]))}};exports.default=s;
@@ -7,9 +7,9 @@ import s from "../sections/Feed.vue.js";
7
7
  import "../../../../components/Loader/Loader.vue.js";
8
8
  import "../../../../components/Popup/Popup.vue2.js";
9
9
  import "../../../../components/Button/Button.vue.js";
10
- import "../../../../components/Select/Select.vue.js";
10
+ import "../../../../components/Select/Select.vue2.js";
11
11
  import "../../../reports/store/reports.js";
12
- import "../../../../components/Dropdown/Dropdown.vue.js";
12
+ import "../../../../components/Dropdown/Dropdown.vue2.js";
13
13
  import { state as a } from "../../../auth/store/auth.js";
14
14
  import "../../../organizations/store/memberships.js";
15
15
  import "../../../community/store/reactions.js";