@ozdao/prometheus-framework 0.0.88 → 0.0.89

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-300fcb55.js +1 -0
  2. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-afba007a.mjs +1944 -0
  3. package/dist/ButtonFollow-001c4a65.mjs +130 -0
  4. package/dist/ButtonFollow-48043cc7.js +1 -0
  5. package/dist/CardHeader-0677d446.js +1 -0
  6. package/dist/CardHeader-e361dada.mjs +96 -0
  7. package/dist/CardOrganization-51309400.js +1 -0
  8. package/dist/CardOrganization-bacc2ef6.mjs +202 -0
  9. package/dist/Feed-4b28adc5.mjs +423 -0
  10. package/dist/Feed-5d8d5c21.js +1 -0
  11. package/dist/Feed-76b2997e.mjs +367 -0
  12. package/dist/Feed-eeb63363.js +1 -0
  13. package/dist/IconEdit-3028a3b7.js +1 -0
  14. package/dist/IconEdit-8df23653.mjs +205 -0
  15. package/dist/Image-30f04604.js +9 -0
  16. package/dist/Image-6ec294f3.mjs +477 -0
  17. package/dist/PlaceholderUserpic-10fd9026.js +1 -0
  18. package/dist/PlaceholderUserpic-eb9820ce.mjs +28 -0
  19. package/dist/Popup-7c331e1c.js +1 -0
  20. package/dist/Popup-bdf043ba.mjs +76 -0
  21. package/dist/Product-b233e2a3.js +7 -0
  22. package/dist/Product-eb00f35e.mjs +837 -0
  23. package/dist/ProductEdit-61413d02.mjs +349 -0
  24. package/dist/ProductEdit-fca68ff9.js +1 -0
  25. package/dist/ProfileBlogposts-6704a38c.js +1 -0
  26. package/dist/ProfileBlogposts-775b1cfa.mjs +63 -0
  27. package/dist/ProfileComments-175e42da.js +1 -0
  28. package/dist/ProfileComments-fd7d66bf.mjs +43 -0
  29. package/dist/ProfileEvents-4f2a5f00.js +1 -0
  30. package/dist/ProfileEvents-7a51a9e6.mjs +55 -0
  31. package/dist/ProfileLikes-20a8a3c9.mjs +43 -0
  32. package/dist/ProfileLikes-b3b1350a.js +1 -0
  33. package/dist/ProfileOrganizations-4b866823.mjs +211 -0
  34. package/dist/ProfileOrganizations-6d3a43e4.js +1 -0
  35. package/dist/Publics-0e44c61e.mjs +122 -0
  36. package/dist/Publics-4e1c14fc.js +1 -0
  37. package/dist/Tab-a243605d.mjs +46 -0
  38. package/dist/UploadImage-6e312c46.mjs +83 -0
  39. package/dist/UploadImage-9e7e7468.js +1 -0
  40. package/dist/auth-2bc18d1e.js +8 -0
  41. package/dist/auth-fefd15a3.mjs +1503 -0
  42. package/dist/auth.client.cjs +1 -1
  43. package/dist/auth.client.js +5 -5
  44. package/dist/auth.validation-4a617c0b.mjs +20 -0
  45. package/dist/auth.validation-78a90fed.js +1 -0
  46. package/dist/community.client.cjs +1 -1
  47. package/dist/community.client.js +14 -13
  48. package/dist/components/Field/Field.vue.d.ts.map +1 -1
  49. package/dist/components/FieldPhone/FieldPhone(script-setup).vue.d.ts +3 -3
  50. package/dist/components/FieldPhone/FieldPhone.vue.d.ts +1 -1
  51. package/dist/events.client.cjs +1 -1
  52. package/dist/events.client.js +12 -11
  53. package/dist/inputs.validation-14e8e01f.mjs +93 -0
  54. package/dist/main.css +1 -1
  55. package/dist/organizations-1581c013.mjs +121 -0
  56. package/dist/organizations-c455dad7.js +1 -0
  57. package/dist/organizations.client-040ec107.js +3 -0
  58. package/dist/organizations.client-7937e180.mjs +3037 -0
  59. package/dist/organizations.client.cjs +1 -1
  60. package/dist/organizations.client.js +39 -39
  61. package/dist/organizations.server.js +7 -3
  62. package/dist/organizations.server.mjs +7 -3
  63. package/dist/prometheus-framework.cjs.js +1 -1
  64. package/dist/prometheus-framework.es.js +3 -2
  65. package/dist/style.css +1 -1
  66. package/dist/users.client.cjs +1 -1
  67. package/dist/users.client.js +265 -256
  68. package/dist/users.server.js +2 -2
  69. package/dist/users.server.mjs +2 -2
  70. package/package.json +1 -1
  71. package/src/components/Field/Field.vue +2 -1
  72. package/src/modules/community/components/pages/CreateBlogPost.vue +2 -1
  73. package/src/modules/events/components/pages/EditEvent.vue +2 -1
  74. package/src/modules/organizations/components/blocks/Socials.vue +16 -3
  75. package/src/modules/organizations/components/pages/OrganizationEdit.vue +39 -15
  76. package/src/modules/organizations/components/sections/DetailsTab.vue +13 -9
  77. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  78. package/src/modules/organizations/models/organization.model.js +6 -2
  79. package/src/modules/organizations/store/organizations.js +2 -2
  80. package/src/modules/users/components/pages/Profile.vue +26 -11
  81. package/src/modules/users/components/pages/ProfileEdit.vue +28 -10
  82. package/src/modules/users/models/user.model.js +2 -2
  83. package/src/modules/users/store/users.js +1 -2
@@ -1,13 +1,13 @@
1
1
  import { ref as _, onMounted as Et, openBlock as v, createBlock as ce, unref as c, withCtx as C, createElementBlock as b, Fragment as fe, renderList as $t, createElementVNode as u, normalizeStyle as H, toDisplayString as y, resolveComponent as be, createVNode as g, Transition as F, resolveDynamicComponent as Tt, reactive as ut, withDirectives as S, vModelText as Z, watch as At, withAsyncContext as Ft, defineComponent as Dt, resolveDirective as Rt, normalizeClass as G, withKeys as ie, createCommentVNode as M, vShow as K, vModelDynamic as Mt, renderSlot as xt, createTextVNode as x } from "vue";
2
- import { v as D, a as ct, b as _e, c as Ce } from "./inputs.validation-6960f71b.mjs";
3
- import { d as ft, s as p, e as oe, a as zt, F as R, b as Y, c as W, _ as kt } from "./auth-35ef1791.mjs";
4
- import { f as D1, t as R1 } from "./auth-35ef1791.mjs";
2
+ import { v as D, b as ct, c as _e, d as Ce } from "./inputs.validation-14e8e01f.mjs";
3
+ import { d as ft, s as p, e as oe, a as zt, F as R, b as Y, c as W, _ as kt } from "./auth-fefd15a3.mjs";
4
+ import { f as D1, t as R1 } from "./auth-fefd15a3.mjs";
5
5
  import { C as Lt, S as jt } from "./carousel.es-44c501bc.mjs";
6
6
  import { useI18n as B } from "vue-i18n";
7
7
  import { useRoute as z, useRouter as k } from "vue-router";
8
8
  import { s as A } from "./globals-96ba60e4.mjs";
9
- import { _ as we } from "./Tab-58cd105f.mjs";
10
- import { r as V, a as ae, c as Te } from "./auth.validation-29113f37.mjs";
9
+ import { _ as we } from "./Tab-a243605d.mjs";
10
+ import { r as V, a as ae, c as Te } from "./auth.validation-4a617c0b.mjs";
11
11
  const Bt = { class: "parent-div" }, Ut = { class: "mn-small" }, Gt = { class: "mn-big mn-r-small mn-l-small" }, N1 = {
12
12
  __name: "SliderFeatures",
13
13
  setup(e) {
@@ -0,0 +1,20 @@
1
+ import { useRouter as i } from "vue-router";
2
+ import { s } from "./auth-fefd15a3.mjs";
3
+ i();
4
+ function n(r, o, e) {
5
+ e(), s.user.phone = "", s.user.email = "", s.user.password = "", s.user.passwordRepeat = "";
6
+ }
7
+ function f(r, o, e) {
8
+ console.log(s.user), s.user.phone === "" && s.user.email === "" ? e("/auth/signin") : e();
9
+ }
10
+ i();
11
+ function c(r, o, e) {
12
+ if (s.access.status)
13
+ return e("/profile/" + s.user._id);
14
+ e();
15
+ }
16
+ export {
17
+ n as a,
18
+ f as c,
19
+ c as r
20
+ };
@@ -0,0 +1 @@
1
+ "use strict";const u=require("vue-router"),e=require("./auth-2bc18d1e.js");u.useRouter();function o(t,r,s){s(),e.state.user.phone="",e.state.user.email="",e.state.user.password="",e.state.user.passwordRepeat=""}function i(t,r,s){console.log(e.state.user),e.state.user.phone===""&&e.state.user.email===""?s("/auth/signin"):s()}u.useRouter();function a(t,r,s){if(e.state.access.status)return s("/profile/"+e.state.user._id);s()}exports.checkUser=i;exports.requiresNoAuth=a;exports.resetUser=o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),w=require("vue-router"),$=require("./Publics-3f277c17.js"),u=require("./Feed-55c5907a.js"),g=require("./auth-5aa8e90c.js"),x=require("./Image-9a870c88.js"),M=require("./Popup-105ef2c3.js"),V=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-15e71ec4.js"),I=require("./organizations-af43bda4.js"),z=require("./EmptyState-7658d7d6.js"),D=require("vue-i18n");require("./globals-928eb13c.js");require("./CardOrganization-ee5c34ab.js");require("./ButtonFollow-2ce169ca.js");require("./CardHeader-925a972b.js");require("./PlaceholderUserpic-d64d6dd5.js");require("./vue-draggable-next.esm-bundler-80731ae0.js");const F={class:"min-h-100vh pd-thin"},O={class:"mn-thin flex-v-center t-left flex-nowrap flex"},L={class:"flex-v-center flex-nowrap flex t-left"},j=e.createElementVNode("span",{class:""},"Topics for ",-1),U={class:"bg-grey pd-medium radius-big mn-semi flex-nowrap flex"},A={class:""},P={__name:"Community",setup(c){const s=w.useRoute(),n=w.useRouter();return(t,a)=>{const d=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("header",O,[e.createElementVNode("h2",L,[j,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",U,[e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(s).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(s).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(s).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(s).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",A,[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})])])}}},H={class:"pd-thin"},R={key:0,class:"h-100 w-100 bg-grey pd-big radius-big"},J={class:"w-full h-full"},G={key:1,class:"pd-thin pos-fixed pos-l-0 pos-b-0 w-100"},Q={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},W={class:"w-m-66r t-left pd-big bg-white radius-big"},K=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),X=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),Y={key:0,class:"mn-thin"},Z={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},T={__name:"CreateBlogPost",setup(c){const s=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(s.params.url){const i=await u.read({user:g.state.user._id,url:s.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 I.actions.read({user:g.state.user._id,postable:g.state.user._id});console.log(l),a.value=l.map(i=>({name:i.profile.name,_id:i._id,photo:i.profile.photo}))});const m=e.ref(""),r=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>r.value.filter(l=>l.text.toLowerCase().includes(m.value.toLowerCase()))),e.computed(()=>r.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",s.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),s.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",H,[e.unref(t)?(e.openBlock(),e.createElementBlock("section",R,[e.createElementVNode("div",J,[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",G,[e.createElementVNode("div",Q,[e.unref(s).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(M._sfc_main,{title:"Добавить участника",onClosePopup:v,isPopupOpen:p.value},{default:e.withCtx(()=>[e.createElementVNode("div",W,[K,e.createVNode(V._sfc_main,{onTagsChanged:i[4]||(i[4]=f=>e.unref(t).tags=f),tags:e.unref(t).tags},null,8,["tags"]),X,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",Y,"Options:")):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",Z,[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:T},Symbol.toStringTag,{value:"Module"})),ee={},te={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},oe=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),ne=[oe];function ae(c,s){return e.openBlock(),e.createElementBlock("svg",te,ne)}const se=g._export_sfc(ee,[["render",ae]]),re={class:"pd-thin"},S={__name:"BlogPost",setup(c){const s=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:s.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",re,[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,r=>e.createVNode(se,{key:r})),64)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!t.value&&!n.value?(e.openBlock(),e.createBlock(z._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]=r=>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,(r,p)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a[r.type]),e.mergeProps({key:p,index:p,component:r,prop:r,class:r.class,content:"content"},d(r),{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})]))}},le=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"})),q={__name:"Blog",setup(c){const s=w.useRoute(),n=w.useRouter();return s.params.category||(s.params.category="featured"),e.onMounted(()=>{if(s.query){const t=s.query,a={tags:t.tags?t.tags.split(","):[],period:t.period?t.period:"year"};u.state.filter=a}}),e.watch(()=>u.state.filter,(t,a)=>{const d={...s.query};Object.keys(a).forEach(m=>{d[m]&&delete d[m]});const o=Object.fromEntries(Object.entries(t).filter(([m,r])=>Array.isArray(r)&&r.length>0||typeof r=="string"&&r).map(([m,r])=>[m,Array.isArray(r)?r.join(","):r]));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(s).params.category,user:g.state.user._id,period:e.unref(s).query.period},null,8,["category","user","period"])]))}},ie=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"})),ce={class:"w-100 cols-4 t-left flex-nowrap flex"},ue={key:0,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},de=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),me={class:"t-semi uppercase"},pe=e.createElementVNode("br",null,null,-1),ge={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),_e={class:"t-semi uppercase"},he=e.createElementVNode("br",null,null,-1),ve={key:2,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},be=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),ye={class:"t-semi uppercase"},we=e.createElementVNode("br",null,null,-1),ke={__name:"Activity",props:{likes:Number,comments:Number,subscriptions:Number},setup(c){return(s,n)=>(e.openBlock(),e.createElementBlock("section",ce,[c.likes?(e.openBlock(),e.createElementBlock("div",ue,[de,e.createElementVNode("span",me,[e.createTextVNode(e.toDisplayString(c.likes),1),pe,e.createTextVNode("likes")])])):e.createCommentVNode("",!0),c.comments?(e.openBlock(),e.createElementBlock("div",ge,[fe,e.createElementVNode("span",_e,[e.createTextVNode(e.toDisplayString(c.comments),1),he,e.createTextVNode("comments")])])):e.createCommentVNode("",!0),c.subscriptions?(e.openBlock(),e.createElementBlock("div",ve,[be,e.createElementVNode("span",ye,[e.createTextVNode(e.toDisplayString(c.subscriptions),1),we,e.createTextVNode("subscriptions")])])):e.createCommentVNode("",!0)]))}},xe={class:"pd-thin radius-extra flex-nowrap flex"},Be=["innerHTML"],Ne={__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:s}){const n=c,{t,locale:a}=D.useI18n();let d=e.ref(0),o=e.ref(n.input),m=e.ref(n.placeholder),r=e.ref(n.enableTyping),p=e.ref(null),b=e.ref(""),v=e.ref(!0),k=null;function B(){s("action")}function N(h){s("update:input",h),b.value=h}function l(){d.value=(d.value+1)%n.placeholderTexts[a.value].length}function i(){r.value=!1,clearInterval(p.value),m.value=n.placeholder,b.value||(o.value="")}function f(){!b.value&&n.enableTyping&&(r.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(()=>{r.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(()=>{r.value||(clearInterval(p.value),clearInterval(k))}),(h,_)=>(e.openBlock(),e.createElementBlock("div",xe,[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,Be)):e.createCommentVNode("",!0)]))}};const Ve={class:"pd-thin"},Ee={class:"o-hidden t-black bg-main pd-big radius-big"},Ce=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),$e={class:"z-index-1 mn-big w-100 flex-nowrap flex"},Pe=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),Te={__name:"SubscribeNewsletter",setup(c){let s=e.ref("");return(n,t)=>(e.openBlock(),e.createElementBlock("section",Ve,[e.createElementVNode("div",Ee,[Ce,e.createElementVNode("div",$e,[e.createVNode(Ne,{input:e.unref(s),typingSpeed:75,loopTyping:!1,enableTyping:!1,placeholder:"Please enter your email",action:"Subscribe","onUpdate:input":t[0]||(t[0]=a=>e.isRef(s)?s.value=a:s=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"])]),Pe])]))}};const Se={class:"container container-joinus"},qe={class:"content"},Me={class:"h0 mn-big"},Ie=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),ze=e.createElementVNode("button",{class:"bg-black t-white button"},"Join Now",-1),De={__name:"JoinUs",setup(c){const s=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(()=>{s.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 r=document.createElement("img");r.src=o,r.classList.add("floating-image");let p=a.spawnPoints[Math.floor(Math.random()*a.spawnPoints.length)],b=(Math.random()-.5)*2*10;r.style.left=`${p+b}%`,r.style.animationDuration=`${Math.random()*(a.maxDuration-a.minDuration)+a.minDuration}s`,document.querySelector(".container").appendChild(r),r.addEventListener("animationiteration",()=>{const v=a.spawnPoints[Math.floor(Math.random()*a.spawnPoints.length)],k=(Math.random()-.5)*2*10;r.style.left=`${v+k}%`})})};return(o,m)=>(e.openBlock(),e.createElementBlock("div",Se,[e.createElementVNode("div",qe,[e.createElementVNode("span",Me,e.toDisplayString(s.value.toLocaleString()),1),Ie,ze])]))}};const Fe=c=>(e.pushScopeId("data-v-18db0d1b"),c=c(),e.popScopeId(),c),Oe={class:"community-feed"},Le=Fe(()=>e.createElementVNode("h2",{class:"w-m-75r mn-auto pd-t-big pd-b-big t-center"},"Discover the Vibrant Community",-1)),je={class:"grid-container"},Ue={__name:"HotPosts",async setup(c){let s,n;const t=e.ref([]),a=async()=>{const o=await u.read({skip:0,limit:7,period:"year"});console.log(o),t.value=o};[s,n]=e.withAsyncContext(()=>a()),await s,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",Oe,[Le,e.createElementVNode("div",je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(r,p)=>(e.openBlock(),e.createBlock(u._sfc_main$1,{blogpost:r,owner:g.state.user._id,key:p,class:e.normalizeClass(d(p))},null,8,["blogpost","owner","class"]))),128))])]))}},Ae=g._export_sfc(Ue,[["__scopeId","data-v-18db0d1b"]]),He=[{path:"community",component:P,meta:{title:{en:"Community",ru:"Коммьюнити"}},children:[{path:":category?",name:"Blog",component:()=>Promise.resolve().then(()=>ie)}]},{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(()=>le)},{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=ke;exports.Blog=q;exports.BlogPost=S;exports.Community=P;exports.CreateBlogPost=T;exports.HotPosts=Ae;exports.JoinUs=De;exports.SubscribeNewsletter=Te;exports.blogpostsRoutes=He;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),w=require("vue-router"),$=require("./Publics-4e1c14fc.js"),u=require("./Feed-5d8d5c21.js"),g=require("./auth-2bc18d1e.js"),x=require("./Image-30f04604.js"),M=require("./Popup-7c331e1c.js"),V=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-300fcb55.js"),I=require("./organizations-c455dad7.js"),z=require("./EmptyState-7658d7d6.js"),D=require("vue-i18n");require("./globals-928eb13c.js");require("./CardOrganization-51309400.js");require("./ButtonFollow-48043cc7.js");require("./CardHeader-0677d446.js");require("./PlaceholderUserpic-10fd9026.js");require("./vue-draggable-next.esm-bundler-80731ae0.js");const F={class:"min-h-100vh pd-thin"},O={class:"mn-thin flex-v-center t-left flex-nowrap flex"},L={class:"flex-v-center flex-nowrap flex t-left"},j=e.createElementVNode("span",{class:""},"Topics for ",-1),U={class:"bg-grey pd-medium radius-big mn-semi flex-nowrap flex"},A={class:""},P={__name:"Community",setup(c){const s=w.useRoute(),n=w.useRouter();return(t,a)=>{const d=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("header",O,[e.createElementVNode("h2",L,[j,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",U,[e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(s).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(s).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(s).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(s).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",A,[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})])])}}},H={class:"pd-thin"},R={key:0,class:"h-100 w-100 bg-grey pd-big radius-big"},J={class:"w-full h-full"},G={key:1,class:"pd-thin pos-fixed pos-l-0 pos-b-0 w-100"},Q={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},W={class:"w-m-66r t-left pd-big bg-white radius-big"},K=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),X=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),Y={key:0,class:"mn-thin"},Z={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},T={__name:"CreateBlogPost",setup(c){const s=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(s.params.url){const i=await u.read({user:g.state.user._id,url:s.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 I.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(""),r=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>r.value.filter(l=>l.text.toLowerCase().includes(m.value.toLowerCase()))),e.computed(()=>r.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",s.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),s.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",H,[e.unref(t)?(e.openBlock(),e.createElementBlock("section",R,[e.createElementVNode("div",J,[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",G,[e.createElementVNode("div",Q,[e.unref(s).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(M._sfc_main,{title:"Добавить участника",onClosePopup:v,isPopupOpen:p.value},{default:e.withCtx(()=>[e.createElementVNode("div",W,[K,e.createVNode(V._sfc_main,{onTagsChanged:i[4]||(i[4]=f=>e.unref(t).tags=f),tags:e.unref(t).tags},null,8,["tags"]),X,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",Y,"Options:")):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",Z,[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:T},Symbol.toStringTag,{value:"Module"})),ee={},te={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},oe=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),ne=[oe];function ae(c,s){return e.openBlock(),e.createElementBlock("svg",te,ne)}const se=g._export_sfc(ee,[["render",ae]]),re={class:"pd-thin"},S={__name:"BlogPost",setup(c){const s=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:s.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",re,[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,r=>e.createVNode(se,{key:r})),64)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!t.value&&!n.value?(e.openBlock(),e.createBlock(z._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]=r=>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,(r,p)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a[r.type]),e.mergeProps({key:p,index:p,component:r,prop:r,class:r.class,content:"content"},d(r),{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})]))}},le=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"})),q={__name:"Blog",setup(c){const s=w.useRoute(),n=w.useRouter();return s.params.category||(s.params.category="featured"),e.onMounted(()=>{if(s.query){const t=s.query,a={tags:t.tags?t.tags.split(","):[],period:t.period?t.period:"year"};u.state.filter=a}}),e.watch(()=>u.state.filter,(t,a)=>{const d={...s.query};Object.keys(a).forEach(m=>{d[m]&&delete d[m]});const o=Object.fromEntries(Object.entries(t).filter(([m,r])=>Array.isArray(r)&&r.length>0||typeof r=="string"&&r).map(([m,r])=>[m,Array.isArray(r)?r.join(","):r]));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(s).params.category,user:g.state.user._id,period:e.unref(s).query.period},null,8,["category","user","period"])]))}},ie=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"})),ce={class:"w-100 cols-4 t-left flex-nowrap flex"},ue={key:0,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},de=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),me={class:"t-semi uppercase"},pe=e.createElementVNode("br",null,null,-1),ge={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),_e={class:"t-semi uppercase"},he=e.createElementVNode("br",null,null,-1),ve={key:2,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},be=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),ye={class:"t-semi uppercase"},we=e.createElementVNode("br",null,null,-1),ke={__name:"Activity",props:{likes:Number,comments:Number,subscriptions:Number},setup(c){return(s,n)=>(e.openBlock(),e.createElementBlock("section",ce,[c.likes?(e.openBlock(),e.createElementBlock("div",ue,[de,e.createElementVNode("span",me,[e.createTextVNode(e.toDisplayString(c.likes),1),pe,e.createTextVNode("likes")])])):e.createCommentVNode("",!0),c.comments?(e.openBlock(),e.createElementBlock("div",ge,[fe,e.createElementVNode("span",_e,[e.createTextVNode(e.toDisplayString(c.comments),1),he,e.createTextVNode("comments")])])):e.createCommentVNode("",!0),c.subscriptions?(e.openBlock(),e.createElementBlock("div",ve,[be,e.createElementVNode("span",ye,[e.createTextVNode(e.toDisplayString(c.subscriptions),1),we,e.createTextVNode("subscriptions")])])):e.createCommentVNode("",!0)]))}},xe={class:"pd-thin radius-extra flex-nowrap flex"},Be=["innerHTML"],Ne={__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:s}){const n=c,{t,locale:a}=D.useI18n();let d=e.ref(0),o=e.ref(n.input),m=e.ref(n.placeholder),r=e.ref(n.enableTyping),p=e.ref(null),b=e.ref(""),v=e.ref(!0),k=null;function B(){s("action")}function N(h){s("update:input",h),b.value=h}function l(){d.value=(d.value+1)%n.placeholderTexts[a.value].length}function i(){r.value=!1,clearInterval(p.value),m.value=n.placeholder,b.value||(o.value="")}function f(){!b.value&&n.enableTyping&&(r.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(()=>{r.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(()=>{r.value||(clearInterval(p.value),clearInterval(k))}),(h,_)=>(e.openBlock(),e.createElementBlock("div",xe,[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,Be)):e.createCommentVNode("",!0)]))}};const Ve={class:"pd-thin"},Ee={class:"o-hidden t-black bg-main pd-big radius-big"},Ce=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),$e={class:"z-index-1 mn-big w-100 flex-nowrap flex"},Pe=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),Te={__name:"SubscribeNewsletter",setup(c){let s=e.ref("");return(n,t)=>(e.openBlock(),e.createElementBlock("section",Ve,[e.createElementVNode("div",Ee,[Ce,e.createElementVNode("div",$e,[e.createVNode(Ne,{input:e.unref(s),typingSpeed:75,loopTyping:!1,enableTyping:!1,placeholder:"Please enter your email",action:"Subscribe","onUpdate:input":t[0]||(t[0]=a=>e.isRef(s)?s.value=a:s=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"])]),Pe])]))}};const Se={class:"container container-joinus"},qe={class:"content"},Me={class:"h0 mn-big"},Ie=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),ze=e.createElementVNode("button",{class:"bg-black t-white button"},"Join Now",-1),De={__name:"JoinUs",setup(c){const s=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(()=>{s.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 r=document.createElement("img");r.src=o,r.classList.add("floating-image");let p=a.spawnPoints[Math.floor(Math.random()*a.spawnPoints.length)],b=(Math.random()-.5)*2*10;r.style.left=`${p+b}%`,r.style.animationDuration=`${Math.random()*(a.maxDuration-a.minDuration)+a.minDuration}s`,document.querySelector(".container").appendChild(r),r.addEventListener("animationiteration",()=>{const v=a.spawnPoints[Math.floor(Math.random()*a.spawnPoints.length)],k=(Math.random()-.5)*2*10;r.style.left=`${v+k}%`})})};return(o,m)=>(e.openBlock(),e.createElementBlock("div",Se,[e.createElementVNode("div",qe,[e.createElementVNode("span",Me,e.toDisplayString(s.value.toLocaleString()),1),Ie,ze])]))}};const Fe=c=>(e.pushScopeId("data-v-18db0d1b"),c=c(),e.popScopeId(),c),Oe={class:"community-feed"},Le=Fe(()=>e.createElementVNode("h2",{class:"w-m-75r mn-auto pd-t-big pd-b-big t-center"},"Discover the Vibrant Community",-1)),je={class:"grid-container"},Ue={__name:"HotPosts",async setup(c){let s,n;const t=e.ref([]),a=async()=>{const o=await u.read({skip:0,limit:7,period:"year"});console.log(o),t.value=o};[s,n]=e.withAsyncContext(()=>a()),await s,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",Oe,[Le,e.createElementVNode("div",je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(r,p)=>(e.openBlock(),e.createBlock(u._sfc_main$1,{blogpost:r,owner:g.state.user._id,key:p,class:e.normalizeClass(d(p))},null,8,["blogpost","owner","class"]))),128))])]))}},Ae=g._export_sfc(Ue,[["__scopeId","data-v-18db0d1b"]]),He=[{path:"community",component:P,meta:{title:{en:"Community",ru:"Коммьюнити"}},children:[{path:":category?",name:"Blog",component:()=>Promise.resolve().then(()=>ie)}]},{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(()=>le)},{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=ke;exports.Blog=q;exports.BlogPost=S;exports.Community=P;exports.CreateBlogPost=T;exports.HotPosts=Ae;exports.JoinUs=De;exports.SubscribeNewsletter=Te;exports.blogpostsRoutes=He;
@@ -1,20 +1,20 @@
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
- import { S as le, _ as re } from "./Publics-9ebffff1.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-a31c43c2.mjs";
5
- import { e as es, f as ts, g as ss } from "./Feed-a31c43c2.mjs";
6
- import { s as w, b as pe, _ as X, F as de } from "./auth-35ef1791.mjs";
7
- import { c as me, _ as ge, a as _e, b as he } from "./Image-6c7584f5.mjs";
8
- import { _ as fe } from "./Popup-82fb2c8a.mjs";
9
- import { _ as ve, S as be, C as ye } from "./Breadcrumbs.vue_vue_type_style_index_0_lang-cdbafd07.mjs";
10
- import { a as we } from "./organizations-1b4c84ee.mjs";
3
+ import { S as le, _ as re } from "./Publics-0e44c61e.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-4b28adc5.mjs";
5
+ import { e as es, f as ts, g as ss } from "./Feed-4b28adc5.mjs";
6
+ import { s as w, b as pe, _ as X, F as de } from "./auth-fefd15a3.mjs";
7
+ import { c as me, _ as ge, a as _e, b as he } from "./Image-6ec294f3.mjs";
8
+ import { _ as fe } from "./Popup-bdf043ba.mjs";
9
+ import { _ as ve, S as be, C as ye } from "./Breadcrumbs.vue_vue_type_style_index_0_lang-afba007a.mjs";
10
+ import { a as we } from "./organizations-1581c013.mjs";
11
11
  import { _ as xe } from "./EmptyState-34d85f10.mjs";
12
12
  import { useI18n as $e } from "vue-i18n";
13
13
  import "./globals-96ba60e4.mjs";
14
- import "./CardOrganization-f70bd169.mjs";
15
- import "./ButtonFollow-728aab73.mjs";
16
- import "./CardHeader-ce5a1a75.mjs";
17
- import "./PlaceholderUserpic-995da0fc.mjs";
14
+ import "./CardOrganization-bacc2ef6.mjs";
15
+ import "./ButtonFollow-001c4a65.mjs";
16
+ import "./CardHeader-e361dada.mjs";
17
+ import "./PlaceholderUserpic-eb9820ce.mjs";
18
18
  import "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
19
19
  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
20
  __name: "Community",
@@ -114,7 +114,8 @@ const ke = { class: "min-h-100vh pd-thin" }, Pe = { class: "mn-thin flex-v-cente
114
114
  });
115
115
  const r = await we.read({
116
116
  user: w.user._id,
117
- postable: w.user._id
117
+ postable: w.user._id,
118
+ limit: 100
118
119
  });
119
120
  console.log(r), a.value = r.map((u) => ({
120
121
  name: u.profile.name,
@@ -1 +1 @@
1
- {"version":3,"file":"Field.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Field/Field.vue"],"names":[],"mappings":"AAuFA,OAAO,wKAAwK,CAAA;;AAG/K,wBAAqF"}
1
+ {"version":3,"file":"Field.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Field/Field.vue"],"names":[],"mappings":"AAwFA,OAAO,wKAAwK,CAAA;;AAG/K,wBAAqF"}
@@ -19,11 +19,11 @@ declare const _default: {
19
19
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {
20
20
  $props: {
21
21
  readonly mode?: string | undefined;
22
+ readonly disabled?: boolean | undefined;
22
23
  readonly allCountries?: unknown[] | undefined;
23
24
  readonly autoFormat?: boolean | undefined;
24
25
  readonly customValidate?: boolean | RegExp | undefined;
25
26
  readonly defaultCountry?: string | undefined;
26
- readonly disabled?: boolean | undefined;
27
27
  readonly autoDefaultCountry?: boolean | undefined;
28
28
  readonly dropdownOptions?: Record<string, any> | undefined;
29
29
  readonly ignoredCountries?: unknown[] | undefined;
@@ -75,11 +75,11 @@ declare const _default: {
75
75
  } & Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").ShallowUnwrapRef<{
76
76
  $props: {
77
77
  readonly mode?: string | undefined;
78
+ readonly disabled?: boolean | undefined;
78
79
  readonly allCountries?: unknown[] | undefined;
79
80
  readonly autoFormat?: boolean | undefined;
80
81
  readonly customValidate?: boolean | RegExp | undefined;
81
82
  readonly defaultCountry?: string | undefined;
82
- readonly disabled?: boolean | undefined;
83
83
  readonly autoDefaultCountry?: boolean | undefined;
84
84
  readonly dropdownOptions?: Record<string, any> | undefined;
85
85
  readonly ignoredCountries?: unknown[] | undefined;
@@ -115,11 +115,11 @@ declare const _default: {
115
115
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {
116
116
  $props: {
117
117
  readonly mode?: string | undefined;
118
+ readonly disabled?: boolean | undefined;
118
119
  readonly allCountries?: unknown[] | undefined;
119
120
  readonly autoFormat?: boolean | undefined;
120
121
  readonly customValidate?: boolean | RegExp | undefined;
121
122
  readonly defaultCountry?: string | undefined;
122
- readonly disabled?: boolean | undefined;
123
123
  readonly autoDefaultCountry?: boolean | undefined;
124
124
  readonly dropdownOptions?: Record<string, any> | undefined;
125
125
  readonly ignoredCountries?: unknown[] | undefined;
@@ -522,11 +522,11 @@ declare const _default: import("vue").DefineComponent<{
522
522
  }>>, {
523
523
  validation: boolean | Record<string, any>;
524
524
  mode: string;
525
+ disabled: boolean;
525
526
  allCountries: unknown[];
526
527
  autoFormat: boolean;
527
528
  customValidate: boolean | RegExp;
528
529
  defaultCountry: string;
529
- disabled: boolean;
530
530
  autoDefaultCountry: boolean;
531
531
  dropdownOptions: Record<string, any>;
532
532
  ignoredCountries: unknown[];
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./Feed-51e4e232.js"),e=require("vue"),V=require("./EmptyState-7658d7d6.js"),v=require("./auth-5aa8e90c.js"),y=require("vue-router"),E=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-15e71ec4.js"),B=require("./Image-9a870c88.js"),P=require("./Popup-105ef2c3.js"),$=require("./UploadImage-441e8526.js"),q=require("./organizations-af43bda4.js"),b=require("./globals-928eb13c.js");require("vue-i18n");require("./CardHeader-925a972b.js");require("./PlaceholderUserpic-d64d6dd5.js");require("./vue-draggable-next.esm-bundler-80731ae0.js");const I={},L={width:"100%",height:"50",xmlns:"http://www.w3.org/2000/svg"},O=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),U=[O];function F(p,r){return e.openBlock(),e.createElementBlock("svg",L,U)}const j=v._export_sfc(I,[["render",F]]);const z={class:"today-events"},M={__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",z,[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(j,{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})]))}},R=["onClick"],A={class:"t-transp"},H={__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",A,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,R))),128))],512)]))}},J={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),W={class:""},C={__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",J,[e.createVNode(H,{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"]),G,e.createElementVNode("section",W,[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})])])}}},Y={key:0,class:"pd-thin"},Q={class:"mn-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex"},K=e.createElementVNode("h4",null,"Upload Event Cover",-1),X=e.createElementVNode("h3",{class:"mn-small"},"Date",-1),Z=e.createElementVNode("h3",{class:"mn-small"},"Description",-1),ee={key:0,class:"pd-b-extra w-100 bg-grey pd-big radius-big"},te={key:1,class:"pd-thin pos-fixed pos-l-0 pos-b-0 w-100"},re={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},ae={class:"w-m-66r t-left pd-big bg-white radius-big"},ne=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),oe=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),se={key:0,class:"mn-thin"},le={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},D={__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 q.actions.read({user:v.state.user._id,postable:v.state.user._id});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",Y,[e.createElementVNode("div",Q,[e.createVNode($._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"]),K]),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"]),X,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"]),Z,e.unref(t)?(e.openBlock(),e.createElementBlock("section",ee,[e.createVNode(B._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",te,[e.createElementVNode("div",re,[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(P._sfc_main,{title:"Добавить участника",onClosePopup:f,isPopupOpen:o.value},{default:e.withCtx(()=>[e.createElementVNode("div",ae,[ne,e.createVNode(E._sfc_main,{onTagsChanged:l[9]||(l[9]=m=>e.unref(t).tags=m),tags:e.unref(t).tags},null,8,["tags"]),oe,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",se,"Options:")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("div",le,[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)}},N=Object.freeze(Object.defineProperty({__proto__:null,default:D},Symbol.toStringTag,{value:"Module"})),w=v.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),k=e.reactive({tickets:[],error:null}),x={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)}}},ie={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 ce={__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 x.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 x.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 button"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.hasTicket?"Leave":"Join"),1)]),_:1}))}},ue=v._export_sfc(ce,[["__scopeId","data-v-d5c351bb"]]),de={class:"pd-thin"},S={__name:"Event",setup(p){const r=y.useRoute(),n=({ticket:o,hasTicket:d,targetId:f})=>{ie.handleTicketUpdate(c.value,o,d,f)},t={Textarea:"p",H2:"h2",Bullets:"p",Caption:"p",ImageUpload:B._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",de,[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(ue,{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(B._sfc_main$1,{key:1,type:"event",target:c.value._id,owner:v.state.user._id},null,8,["target","owner"])):e.createCommentVNode("",!0)]),_:1})]))}},pe=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"})),T={__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"])]))}},me=Object.freeze(Object.defineProperty({__proto__:null,default:T},Symbol.toStringTag,{value:"Module"})),fe=[{path:"events",component:C,meta:{title:{en:"Events",ru:"События"}},children:[{path:":category?",name:"Events",component:()=>Promise.resolve().then(()=>me)}]},{path:"events/create",name:"Create Event",meta:{title:{en:"Create Event",ru:"Создать Событие"},authorize:[]},component:()=>Promise.resolve().then(()=>N)},{path:"events/:url",name:"Event",meta:{title:{en:"Event",ru:"Событие"}},component:()=>Promise.resolve().then(()=>pe)},{path:"events/:url/edit",name:"Edit Event",meta:{authorize:[]},component:()=>Promise.resolve().then(()=>N)}];exports.CardEvent=g._sfc_main$1;exports.Feed=g._sfc_main;exports.eventsStore=g.events;exports.EditEvent=D;exports.EventPage=S;exports.EventsLayout=C;exports.EventsPage=T;exports.List=M;exports.eventsRoutes=fe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./Feed-eeb63363.js"),e=require("vue"),V=require("./EmptyState-7658d7d6.js"),v=require("./auth-2bc18d1e.js"),y=require("vue-router"),E=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-300fcb55.js"),B=require("./Image-30f04604.js"),P=require("./Popup-7c331e1c.js"),$=require("./UploadImage-9e7e7468.js"),q=require("./organizations-c455dad7.js"),b=require("./globals-928eb13c.js");require("vue-i18n");require("./CardHeader-0677d446.js");require("./PlaceholderUserpic-10fd9026.js");require("./vue-draggable-next.esm-bundler-80731ae0.js");const I={},L={width:"100%",height:"50",xmlns:"http://www.w3.org/2000/svg"},O=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),U=[O];function F(p,r){return e.openBlock(),e.createElementBlock("svg",L,U)}const j=v._export_sfc(I,[["render",F]]);const z={class:"today-events"},M={__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",z,[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(j,{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})]))}},R=["onClick"],A={class:"t-transp"},H={__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",A,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,R))),128))],512)]))}},J={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),W={class:""},C={__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",J,[e.createVNode(H,{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"]),G,e.createElementVNode("section",W,[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})])])}}},Y={key:0,class:"pd-thin"},Q={class:"mn-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex"},K=e.createElementVNode("h4",null,"Upload Event Cover",-1),X=e.createElementVNode("h3",{class:"mn-small"},"Date",-1),Z=e.createElementVNode("h3",{class:"mn-small"},"Description",-1),ee={key:0,class:"pd-b-extra w-100 bg-grey pd-big radius-big"},te={key:1,class:"pd-thin pos-fixed pos-l-0 pos-b-0 w-100"},re={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},ae={class:"w-m-66r t-left pd-big bg-white radius-big"},ne=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),oe=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),se={key:0,class:"mn-thin"},le={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},D={__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 q.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",Y,[e.createElementVNode("div",Q,[e.createVNode($._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"]),K]),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"]),X,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"]),Z,e.unref(t)?(e.openBlock(),e.createElementBlock("section",ee,[e.createVNode(B._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",te,[e.createElementVNode("div",re,[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(P._sfc_main,{title:"Добавить участника",onClosePopup:f,isPopupOpen:o.value},{default:e.withCtx(()=>[e.createElementVNode("div",ae,[ne,e.createVNode(E._sfc_main,{onTagsChanged:l[9]||(l[9]=m=>e.unref(t).tags=m),tags:e.unref(t).tags},null,8,["tags"]),oe,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",se,"Options:")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("div",le,[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)}},N=Object.freeze(Object.defineProperty({__proto__:null,default:D},Symbol.toStringTag,{value:"Module"})),w=v.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),k=e.reactive({tickets:[],error:null}),x={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)}}},ie={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 ce={__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 x.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 x.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 button"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.hasTicket?"Leave":"Join"),1)]),_:1}))}},ue=v._export_sfc(ce,[["__scopeId","data-v-d5c351bb"]]),de={class:"pd-thin"},S={__name:"Event",setup(p){const r=y.useRoute(),n=({ticket:o,hasTicket:d,targetId:f})=>{ie.handleTicketUpdate(c.value,o,d,f)},t={Textarea:"p",H2:"h2",Bullets:"p",Caption:"p",ImageUpload:B._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",de,[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(ue,{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(B._sfc_main$1,{key:1,type:"event",target:c.value._id,owner:v.state.user._id},null,8,["target","owner"])):e.createCommentVNode("",!0)]),_:1})]))}},pe=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"})),T={__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"])]))}},me=Object.freeze(Object.defineProperty({__proto__:null,default:T},Symbol.toStringTag,{value:"Module"})),fe=[{path:"events",component:C,meta:{title:{en:"Events",ru:"События"}},children:[{path:":category?",name:"Events",component:()=>Promise.resolve().then(()=>me)}]},{path:"events/create",name:"Create Event",meta:{title:{en:"Create Event",ru:"Создать Событие"},authorize:[]},component:()=>Promise.resolve().then(()=>N)},{path:"events/:url",name:"Event",meta:{title:{en:"Event",ru:"Событие"}},component:()=>Promise.resolve().then(()=>pe)},{path:"events/:url/edit",name:"Edit Event",meta:{authorize:[]},component:()=>Promise.resolve().then(()=>N)}];exports.CardEvent=g._sfc_main$1;exports.Feed=g._sfc_main;exports.eventsStore=g.events;exports.EditEvent=D;exports.EventPage=S;exports.EventsLayout=C;exports.EventsPage=T;exports.List=M;exports.eventsRoutes=fe;
@@ -1,18 +1,18 @@
1
- import { r as F, a as J, s as D, c as X, u as V, b as A, S as Z, _ as ee } from "./Feed-dc8b66bf.mjs";
2
- import { e as vt } from "./Feed-dc8b66bf.mjs";
1
+ import { r as F, a as J, s as D, c as X, u as V, b as A, S as Z, _ as ee } from "./Feed-76b2997e.mjs";
2
+ import { e as vt } from "./Feed-76b2997e.mjs";
3
3
  import { openBlock as d, createElementBlock as _, createStaticVNode as te, ref as w, onMounted as j, createVNode as v, TransitionGroup as U, withCtx as x, Fragment as P, renderList as T, createBlock as $, createCommentVNode as b, Transition as q, normalizeClass as N, createElementVNode as h, unref as m, toDisplayString as L, watch as W, resolveComponent as ae, resolveDynamicComponent as Y, createTextVNode as B, reactive as re, mergeProps as ne } from "vue";
4
4
  import { _ as G } from "./EmptyState-34d85f10.mjs";
5
- import { _ as Q, s as k, F as C, b as K, a as se } from "./auth-35ef1791.mjs";
5
+ import { _ as Q, s as k, F as C, b as K, a as se } from "./auth-fefd15a3.mjs";
6
6
  import { useRoute as z, useRouter as M } from "vue-router";
7
- import { _ as oe, S as le, C as ie } from "./Breadcrumbs.vue_vue_type_style_index_0_lang-cdbafd07.mjs";
8
- import { _ as ue, a as ce, b as de } from "./Image-6c7584f5.mjs";
9
- import { _ as pe } from "./Popup-82fb2c8a.mjs";
10
- import { _ as me } from "./UploadImage-ff8f9a0c.mjs";
11
- import { a as fe } from "./organizations-1b4c84ee.mjs";
7
+ import { _ as oe, S as le, C as ie } from "./Breadcrumbs.vue_vue_type_style_index_0_lang-afba007a.mjs";
8
+ import { _ as ue, a as ce, b as de } from "./Image-6ec294f3.mjs";
9
+ import { _ as pe } from "./Popup-bdf043ba.mjs";
10
+ import { _ as me } from "./UploadImage-6e312c46.mjs";
11
+ import { a as fe } from "./organizations-1581c013.mjs";
12
12
  import { s as I } from "./globals-96ba60e4.mjs";
13
13
  import "vue-i18n";
14
- import "./CardHeader-ce5a1a75.mjs";
15
- import "./PlaceholderUserpic-995da0fc.mjs";
14
+ import "./CardHeader-e361dada.mjs";
15
+ import "./PlaceholderUserpic-eb9820ce.mjs";
16
16
  import "./vue-draggable-next.esm-bundler-ff6e3f52.mjs";
17
17
  const ge = {}, ve = {
18
18
  width: "100%",
@@ -274,7 +274,8 @@ const we = { class: "today-events" }, pt = {
274
274
  });
275
275
  const s = await fe.read({
276
276
  user: k.user._id,
277
- postable: k.user._id
277
+ postable: k.user._id,
278
+ limit: 100
278
279
  });
279
280
  l.value = s.map((o) => ({
280
281
  name: o.profile.name,
@@ -0,0 +1,93 @@
1
+ import { i as a } from "./globals-96ba60e4.mjs";
2
+ const n = {
3
+ ru: {
4
+ validation: {
5
+ length: "Содержимое должно быть не менее 1 символа.",
6
+ maxLength: "Содержимое не должно превышать {maxLength} символов.",
7
+ phone: "Неверный формат номера",
8
+ email: "Неверный формат email",
9
+ password: {
10
+ minLength: "Пароль должен быть больше 8 символов",
11
+ lowercase: "Должен быть символ в нижнем регистре",
12
+ uppercase: "Должен быть символ в верхнем регистре",
13
+ number: "Должна быть 1 цифра",
14
+ specialChar: "Должен быть 1 специальный символ"
15
+ }
16
+ }
17
+ },
18
+ en: {
19
+ validation: {
20
+ length: "Content must be at least 1 character long.",
21
+ maxLength: "Content should not exceed {maxLength} characters.",
22
+ phone: "Invalid number format",
23
+ email: "Invalid email format",
24
+ password: {
25
+ minLength: "Password must be longer than 8 characters",
26
+ lowercase: "Must contain a lowercase character",
27
+ uppercase: "Must contain an uppercase character",
28
+ number: "Must contain at least 1 digit",
29
+ specialChar: "Must contain at least 1 special character"
30
+ }
31
+ }
32
+ }
33
+ };
34
+ a.global.mergeLocaleMessage("ru", n.ru);
35
+ a.global.mergeLocaleMessage("en", n.en);
36
+ function i(e) {
37
+ return e.length < 1 ? {
38
+ status: !1,
39
+ message: a.global.t("validation.length")
40
+ } : {
41
+ status: !0,
42
+ message: null
43
+ };
44
+ }
45
+ function u(e) {
46
+ return console.log(e), console.log(e.valid), e.valid ? {
47
+ status: !0,
48
+ message: null
49
+ } : {
50
+ status: !1,
51
+ message: a.global.t("validation.phone")
52
+ };
53
+ }
54
+ function g(e) {
55
+ return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,12}$/.test(e) ? {
56
+ status: !0,
57
+ message: null
58
+ } : {
59
+ status: !1,
60
+ message: a.global.t("validation.email")
61
+ };
62
+ }
63
+ function c(e) {
64
+ return e.length < 8 ? {
65
+ status: !1,
66
+ message: a.global.t("validation.password.minLength")
67
+ } : {
68
+ status: !0,
69
+ message: null
70
+ };
71
+ }
72
+ async function m(e, t, s, o) {
73
+ if (s) {
74
+ const l = t(s);
75
+ if (!l.status)
76
+ throw e.value = l, setTimeout(() => {
77
+ e.value = null;
78
+ }, 3e3), new Error(o);
79
+ } else
80
+ throw e.value = {
81
+ status: !1,
82
+ message: a.global.t("validation.length")
83
+ }, setTimeout(() => {
84
+ e.value = null;
85
+ }, 3e3), new Error(a.global.t("validation.length"));
86
+ }
87
+ export {
88
+ i as a,
89
+ c as b,
90
+ u as c,
91
+ g as d,
92
+ m as v
93
+ };