@ozdao/prometheus-framework 0.0.78 → 0.0.80

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-451d2614.mjs +80 -0
  2. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-5ea8b4fa.js +1 -0
  3. package/dist/ButtonFollow-0d83a04a.mjs +130 -0
  4. package/dist/ButtonFollow-f9c5dc7a.js +1 -0
  5. package/dist/CardHeader-2d7e5d49.mjs +76 -0
  6. package/dist/CardHeader-dff9c71a.js +1 -0
  7. package/dist/Comments-b6e32958.js +1 -0
  8. package/dist/Comments-d2a8fd0f.mjs +76 -0
  9. package/dist/EditProductImages-1d4b44a9.mjs +236 -0
  10. package/dist/EditProductImages-d9228ad0.js +1 -0
  11. package/dist/EmptyState-34d85f10.mjs +36 -0
  12. package/dist/EmptyState-7658d7d6.js +1 -0
  13. package/dist/Feed-932d976d.js +1 -0
  14. package/dist/Feed-962e009b.js +1 -0
  15. package/dist/Feed-c93012c7.mjs +346 -0
  16. package/dist/Feed-d8e33aed.mjs +397 -0
  17. package/dist/PlaceholderUserpic-1a6cf257.mjs +28 -0
  18. package/dist/PlaceholderUserpic-3bf126ee.js +1 -0
  19. package/dist/Popup.vue_vue_type_style_index_0_lang-8981c189.mjs +280 -0
  20. package/dist/Popup.vue_vue_type_style_index_0_lang-931f265a.js +1 -0
  21. package/dist/Product-3c64a352.mjs +904 -0
  22. package/dist/Product-67efba5c.js +7 -0
  23. package/dist/ProductEdit-04760699.js +1 -0
  24. package/dist/ProductEdit-39adf62f.mjs +113 -0
  25. package/dist/ProfileBlogposts-00424109.js +1 -0
  26. package/dist/ProfileBlogposts-65a7a5e0.mjs +56 -0
  27. package/dist/ProfileComments-5884d09f.mjs +43 -0
  28. package/dist/ProfileComments-677731b3.js +1 -0
  29. package/dist/ProfileEvents-85a88674.mjs +55 -0
  30. package/dist/ProfileEvents-b5431cd6.js +1 -0
  31. package/dist/ProfileLikes-4a57f637.mjs +43 -0
  32. package/dist/ProfileLikes-8ccf6815.js +1 -0
  33. package/dist/ProfileOrganizations-5d681498.mjs +202 -0
  34. package/dist/ProfileOrganizations-c7688210.js +1 -0
  35. package/dist/Publics-889c25fc.js +1 -0
  36. package/dist/Publics-8bea4201.mjs +44 -0
  37. package/dist/UploadImage-34bc4a3f.mjs +99 -0
  38. package/dist/UploadImage-75b1a18a.js +1 -0
  39. package/dist/auth-18f80fef.mjs +1501 -0
  40. package/dist/auth-78fd9408.js +8 -0
  41. package/dist/auth.client.cjs +5 -5
  42. package/dist/auth.client.js +5 -5
  43. package/dist/auth.validation-6bccabd6.mjs +20 -0
  44. package/dist/auth.validation-a18510e8.js +1 -0
  45. package/dist/community.client.cjs +8 -9
  46. package/dist/community.client.js +568 -552
  47. package/dist/community.server.js +3 -2
  48. package/dist/community.server.mjs +3 -2
  49. package/dist/events.client.cjs +1 -1
  50. package/dist/events.client.js +10 -10
  51. package/dist/files.client.cjs +1 -0
  52. package/dist/files.client.js +1 -0
  53. package/dist/files.server.js +5 -2
  54. package/dist/files.server.mjs +5 -2
  55. package/dist/main.css +1 -1
  56. package/dist/organizations-0e9ff7ca.mjs +319 -0
  57. package/dist/organizations-c77ea9d0.js +1 -0
  58. package/dist/organizations.client.cjs +2 -2
  59. package/dist/organizations.client.js +26 -26
  60. package/dist/prometheus-framework.cjs.js +3 -3
  61. package/dist/prometheus-framework.es.js +8 -8
  62. package/dist/style.css +1 -1
  63. package/dist/users.client.cjs +1 -1
  64. package/dist/users.client.js +10 -10
  65. package/package.json +3 -3
  66. package/src/modules/community/components/elements/ImageUpload.vue +7 -5
  67. package/src/modules/community/components/pages/BlogPost.vue +12 -15
  68. package/src/modules/community/components/pages/CreateBlogPost.vue +14 -1
  69. package/src/modules/community/controllers/blog.controller.js +2 -1
  70. package/src/modules/files/controllers/files.controller.js +5 -1
  71. package/src/modules/files/routes/files.routes.js +3 -1
@@ -1,14 +1,14 @@
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
2
  import "./Tab.vue_vue_type_style_index_0_lang-4ed993c7.mjs";
3
- import { c as ct, s as p, d as oe, a as zt, F as D, b as Y, e as W, _ as kt } from "./auth-84680727.mjs";
4
- import { f as R1, t as M1 } from "./auth-84680727.mjs";
3
+ import { c as ct, s as p, d as oe, a as zt, F as D, b as Y, e as W, _ as kt } from "./auth-18f80fef.mjs";
4
+ import { f as R1, t as M1 } from "./auth-18f80fef.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 { v as R, a as ft, b as _e, c as Ce } from "./inputs.validation-5732152a.mjs";
9
9
  import { s as A } from "./globals-f538c0ef.mjs";
10
10
  import { _ as we } from "./Tab-054b61f7.mjs";
11
- import { r as V, a as ae, c as Te } from "./auth.validation-2d33e8c7.mjs";
11
+ import { r as V, a as ae, c as Te } from "./auth.validation-6bccabd6.mjs";
12
12
  const Bt = { class: "parent-div" }, Ut = { class: "mn-small" }, Gt = { class: "mn-big mn-r-small mn-l-small" }, Vt = {
13
13
  __name: "SliderFeatures",
14
14
  setup(e) {
@@ -2993,7 +2993,7 @@ function Lr(e, n, t, d, r, i) {
2993
2993
  const o = Rt("click-outside");
2994
2994
  return v(), b(fe, null, [
2995
2995
  u("div", {
2996
- class: G(["vue3-reactive-tel-input", { "bg-light-red": e.validation }, e.$attrs.class, e.rootClass, { disabled: e.disabled }, e.classes]),
2996
+ class: G(["vue3-reactive-tel-input", { "bg-fourth-nano": e.validation }, e.$attrs.class, e.rootClass, { disabled: e.disabled }, e.classes]),
2997
2997
  style: H([e.rootStyle, e.styles]),
2998
2998
  ref: "rootElement"
2999
2999
  }, [
@@ -3077,7 +3077,7 @@ function Lr(e, n, t, d, r, i) {
3077
3077
  })
3078
3078
  ], 64);
3079
3079
  }
3080
- const Ee = /* @__PURE__ */ kt(Er, [["render", Lr], ["__scopeId", "data-v-97a5e3bb"]]);
3080
+ const Ee = /* @__PURE__ */ kt(Er, [["render", Lr], ["__scopeId", "data-v-50353ca7"]]);
3081
3081
  function at(e) {
3082
3082
  const n = e;
3083
3083
  n.__i18n = n.__i18n || [], n.__i18n.push({
@@ -0,0 +1,20 @@
1
+ import { useRouter as i } from "vue-router";
2
+ import { s } from "./auth-18f80fef.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-78fd9408.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,11 +1,10 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("vue-router"),L=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-dd037bbf.js"),h=require("./Feed-aa3bd30a.js"),y=require("./auth-07c01b19.js"),A=require("./vue-draggable-next.esm-bundler-80731ae0.js"),R=require("./EmptyState-23c13029.js"),O=require("./Publics-07d5bbc4.js"),M=require("./Comments-6ff58c26.js"),J=require("vue-i18n");require("./globals-d7a54bb4.js");require("./CardHeader-377cfc4b.js");require("./PlaceholderUserpic-43e5ab23.js");require("./organizations-5f9c7fbd.js");require("./ButtonFollow-f630623a.js");const G={class:"min-h-100vh pd-thin"},Q={class:"mn-thin flex-v-center t-left flex-nowrap flex"},W={class:"flex-v-center flex-nowrap flex t-left"},K=e.createElementVNode("span",{class:""},"Topics for ",-1),X={class:"bg-grey pd-medium radius-big mn-semi flex-nowrap flex"},Y={class:""},D={__name:"Community",setup(l){const s=b.useRoute(),t=b.useRouter();return(a,i)=>{const r=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("header",Q,[e.createElementVNode("h2",W,[K,e.createVNode(L.Select,{options:["today","week","month","year"],select:h.state.filter.period,"onUpdate:select":i[0]||(i[0]=o=>h.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",X,[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:i[1]||(i[1]=o=>e.unref(t).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:i[2]||(i[2]=o=>e.unref(t).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:i[3]||(i[3]=o=>e.unref(t).push({name:"Blog",params:{category:"new"}}))},"🆕 New",2),y.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:i[4]||(i[4]=o=>e.unref(t).push({name:"Blog",params:{category:"following"}}))},"👥 Following",2)):e.createCommentVNode("",!0)]),e.createElementVNode("section",Y,[e.createVNode(r,null,{default:e.withCtx(({Component:o,route:n})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o),{ref:"page",key:n.query}))]),_:2},1024)]),_:1})])])}}};const Z=["placeholder"],E={__name:"Textarea",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(l,{emit:s}){const t=l;e.ref(t);const a=e.ref(null);function i(o){let n=o.target.value.split(/\n+/);if(n.length>1){t.prop[t.content]=n[0],e.nextTick(()=>{r()});let c=n.slice(1).map(u=>({__name:"Textarea",content:u}));s("addBlock","Textarea","",t.index,{blocks:c,ref:a})}else o.target.value.trim()===""&&o.target.value.includes(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),B=require("vue-router"),z=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-5ea8b4fa.js"),v=require("./Feed-932d976d.js"),y=require("./auth-78fd9408.js"),H=require("./vue-draggable-next.esm-bundler-80731ae0.js"),j=require("./EmptyState-7658d7d6.js"),L=require("./Publics-889c25fc.js"),C=require("./Comments-b6e32958.js"),A=require("vue-i18n");require("./globals-d7a54bb4.js");require("./CardHeader-dff9c71a.js");require("./PlaceholderUserpic-3bf126ee.js");require("./organizations-c77ea9d0.js");require("./ButtonFollow-f9c5dc7a.js");const R={class:"min-h-100vh pd-thin"},O={class:"mn-thin flex-v-center t-left flex-nowrap flex"},J={class:"flex-v-center flex-nowrap flex t-left"},W=e.createElementVNode("span",{class:""},"Topics for ",-1),G={class:"bg-grey pd-medium radius-big mn-semi flex-nowrap flex"},K={class:""},$={__name:"Community",setup(l){const r=B.useRoute(),n=B.useRouter();return(t,c)=>{const i=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",R,[e.createElementVNode("header",O,[e.createElementVNode("h2",J,[W,e.createVNode(z.Select,{options:["today","week","month","year"],select:v.state.filter.period,"onUpdate:select":c[0]||(c[0]=o=>v.state.filter.period=o),placeholder:"Select type",class:"w-max mn-l-small bg-grey pd-thin radius-medium h2 t-center t-black"},null,8,["select"])])]),e.createElementVNode("ul",G,[e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="featured"},"mn-r-small t-medium pd-small radius-small"]),onClick:c[1]||(c[1]=o=>e.unref(n).push({name:"Blog"}))},"👑 Featured",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="popular"},"mn-r-small t-medium pd-small radius-small"]),onClick:c[2]||(c[2]=o=>e.unref(n).push({name:"Blog",params:{category:"popular"}}))},"🔥 Popular",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="new"},"mn-r-small t-medium pd-small radius-small"]),onClick:c[3]||(c[3]=o=>e.unref(n).push({name:"Blog",params:{category:"new"}}))},"🆕 New",2),y.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="following"},"t-medium pd-small radius-small"]),onClick:c[4]||(c[4]=o=>e.unref(n).push({name:"Blog",params:{category:"following"}}))},"👥 Following",2)):e.createCommentVNode("",!0)]),e.createElementVNode("section",K,[e.createVNode(i,null,{default:e.withCtx(({Component:o,route:s})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o),{ref:"page",key:s.query}))]),_:2},1024)]),_:1})])])}}};const Q=["placeholder"],E={__name:"Textarea",props:["obj","label","prop","value","content","textarea","placeholder","index","ref","setFocus"],emits:["deleteBlock","updateBlock","addBlock","focus"],setup(l,{emit:r}){const n=l;e.ref(n);const t=e.ref(null);e.ref(0);function c(a){let u=a.target.value.split(/\n+/);if(u.length>1){n.prop[n.content]=u[0],e.nextTick(()=>{s()});let d=u.slice(1).map(m=>({__name:"Textarea",content:m}));r("addBlock","Textarea","",n.index,{blocks:d,ref:t})}else a.target.value.trim()===""&&a.target.value.includes(`
2
2
 
3
- `)&&s("addBlock","Textarea","",t.index,{blocks:newBlocks,ref:a}),r()}function r(){a.value.style.height="1rem",a.value.style.height=a.value.scrollHeight+"px"}return e.onUpdated(()=>{r()}),e.onMounted(()=>{r()}),e.watch(()=>t.prop[t.content],o=>{o===""&&!o.includes(`
4
- `)&&s("deleteBlock",t.prop)}),(o,n)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{"onUpdate:modelValue":n[0]||(n[0]=c=>l.prop[l.content]=c),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:i,onFocus:n[1]||(n[1]=c=>s("focus",a.value)),ref_key:"textarea",ref:a,class:"text-area mn-small"},`
5
- `,40,Z)),[[e.vModelText,l.prop[l.content]]])}},ee=["placeholder"],V={__name:"H2",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(l,{emit:s}){const t=l;e.ref(t);const a=e.ref(null);function i(o){let n=o.target.value.split(/\n+/);if(n.length>1){t.prop[t.content]=n[0],e.nextTick(()=>{r()});let c=n.slice(1).map(u=>({__name:"H2",content:u}));s("addBlock","H2","",t.index,{blocks:c,ref:a})}else o.target.value.trim()===""&&o.target.value.includes(`
3
+ `)&&(console.log("We are adding new block:"+n.index+newBlocks+t),r("addBlock","Textarea","",n.index,{blocks:newBlocks,ref:t})),s()}function i(a){(a.keyCode===8||a.keyCode===46)&&n.prop[n.content].trim()===""&&r("deleteBlock",n.prop)}function o(){e.nextTick(()=>{t.value.focus(),r("updateBlock",n.prop,{setFocus:!1})})}function s(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{n.setFocus&&e.nextTick(()=>{o()}),s()}),e.onMounted(()=>{n.setFocus&&e.nextTick(()=>{o()}),s()}),e.watch(()=>n.prop[n.content],a=>{}),(a,u)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":u[0]||(u[0]=d=>l.prop[l.content]=d),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:c,onFocus:u[1]||(u[1]=d=>r("focus",t.value)),onKeyup:i,ref_key:"textarea",ref:t,class:"text-area mn-thin"},`
4
+ `,40,Q),[[e.vModelText,l.prop[l.content]]])]))}},X=["placeholder"],T={__name:"H2",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(l,{emit:r}){const n=l;e.ref(n);const t=e.ref(null);function c(o){let s=o.target.value.split(/\n+/);if(s.length>1){n.prop[n.content]=s[0],e.nextTick(()=>{i()});let a=s.slice(1).map(u=>({__name:"H2",content:u}));r("addBlock","H2","",n.index,{blocks:a,ref:t})}else o.target.value.trim()===""&&o.target.value.includes(`
6
5
 
7
- `)&&s("addBlock","H2","",t.index,{blocks:newBlocks,ref:a}),r()}function r(){a.value.style.height="1rem",a.value.style.height=a.value.scrollHeight+"px"}return e.onUpdated(()=>{r()}),e.onMounted(()=>{r()}),e.watch(()=>t.prop[t.content],o=>{o===""&&!o.includes(`
8
- `)&&s("deleteBlock",t.prop)}),(o,n)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{"onUpdate:modelValue":n[0]||(n[0]=c=>l.prop[l.content]=c),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:i,onFocus:n[1]||(n[1]=c=>s("focus",a.value)),ref_key:"textarea",ref:a,class:"h3 w-100 mn-t-semi mn-medium t-semi"},`
9
- `,40,ee)),[[e.vModelText,l.prop[l.content]]])}},te=["placeholder"],T={__name:"Caption",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(l,{emit:s}){const t=l;e.ref(t);const a=e.ref(null);function i(o){const n=/^\s*[-*]\s+(.*)/;let u=o.target.value.split(/\n+/).map(g=>{const v=n.exec(g);return v?v[1]:null}).filter(g=>g!==null);u.length>0?(t.prop[t.content]=u,r()):o.target.value.trim()===""&&(t.prop[t.content]=[],r())}function r(){a.value.style.height="1rem",a.value.style.height=a.value.scrollHeight+"px"}return e.onUpdated(()=>{r()}),e.onMounted(()=>{r()}),e.watch(()=>t.prop[t.content],o=>{(!o||o.length===0)&&s("deleteBlock",t.prop)}),(o,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":n[0]||(n[0]=c=>l.prop[l.content]=c),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:i,onFocus:n[1]||(n[1]=c=>s("focus",a.value)),ref_key:"textarea",ref:a,class:"br-l br-solid br-main pd-l-small text-area mn-small"},`
10
- `,40,te),[[e.vModelText,l.prop[l.content]]])]))}},ne=["placeholder"],P={__name:"Bullets",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(l,{emit:s}){const t=l;e.ref(t);const a=e.ref(null);function i(o){const n=/^\s*[-*]\s+(.*)/;let u=o.target.value.split(/\n+/).map(g=>{const v=n.exec(g);return v?v[1]:null}).filter(g=>g!==null);u.length>0?(t.prop[t.content]=u,r()):o.target.value.trim()===""&&(t.prop[t.content]=[],r())}function r(){a.value.style.height="1rem",a.value.style.height=a.value.scrollHeight+"px"}return e.onUpdated(()=>{r()}),e.onMounted(()=>{r()}),e.watch(()=>t.prop[t.content],o=>{(!o||o.length===0)&&s("deleteBlock",t.prop)}),(o,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.createTextVNode(e.toDisplayString(l.prop[l.content])+" ",1),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":n[0]||(n[0]=c=>l.prop[l.content]=c),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:i,onFocus:n[1]||(n[1]=c=>s("focus",a.value)),ref_key:"textarea",ref:a,class:"text-area mn-small"},`
11
- `,40,ne),[[e.vModelText,l.prop[l.content]]])]))}},oe=["src"],le={key:1,class:"t-transp pd-extra"},S={__name:"ImageUpload",props:["label","value","prop"],emits:["input","updateBlock"],setup(l,{emit:s}){const t=l,a=e.ref(null),i=e.ref(null);function r(){i.value.click()}async function o(c){let u=c.target.files[0],g=new FormData;g.append("file",u);try{const v=y.axios.create({baseURL:process.env.API_URL,withCredentials:!0});console.log(g),console.log(process.env.API_URL);let k=await v.post("/api/upload/image",g,{headers:{"Content-Type":"multipart/form-data"}});a.value=k.data.filepath,s("input",a.value),s("updateBlock",t.prop,a.value)}catch(v){console.error(v)}}function n(c){c.preventDefault(),o({target:{files:c.dataTransfer.files}})}return(c,u)=>(e.openBlock(),e.createElementBlock("div",{onClick:r,onDrop:n,onDragover:u[0]||(u[0]=e.withModifiers(()=>{},["prevent"])),class:"w-100 image-upload-area bg-grey flex-v-center flex-h-center flex t-black mn-small"},[l.prop.content?(e.openBlock(),e.createElementBlock("img",{key:0,src:l.prop.content,alt:"Uploaded image",class:"w-100 h-30r object-fit-contain"},null,8,oe)):(e.openBlock(),e.createElementBlock("span",le,"Click or drag-and-drop your image")),e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:i,onChange:o,style:{display:"none"}},null,544)],32))}};const ae={class:"pd-thin"},re={class:"pd-t-big pd-b-big pd-thin radius-big"},se={class:"mn-l-semi mn-r-semi w-full h-full"},ce=["onMouseover"],ie={class:"mn-l-semi mn-r-semi relative w-full h-full"},ue={key:0,class:"z-index-5 relative left-0 mt-2 w-48 bg-white shadow-lg rounded"},de=["onClick"],pe=e.createElementVNode("button",{class:"block w-full text-left px-4 py-2 hover:bg-gray-200"},"Поменять тип",-1),me=["onClick"],fe=["onClick"],ge=["onClick"],he=["onClick"],ve={class:"pd-thin bg-grey pos-fixed pos-l-0 pos-b-0 w-100"},U={__name:"CreateBlogPost",async setup(l){let s,t;const a=b.useRoute(),i=b.useRouter();let r=e.ref({});if(a.params.url){const d=([s,t]=e.withAsyncContext(()=>h.read({owner:y.state.user._id,url:a.params.url})),s=await s,t(),s);r.value=d.pop()}else h.clean(),r.value=h.state.current;r.value.owner=y.state.user._id;const o={Textarea:E,H2:V,Bullets:P,Caption:T,ImageUpload:S};function n(d="Textarea",f="",p,m){let _={order:r.value.content.length+1,type:{name:d,value:o[d]},style:"",class:"",content:f,blocks:[],ref:m&&m.ref?m.ref:e.ref(null)};if(m&&m.blocks&&Array.isArray(m.blocks)){let $=m.blocks.map(j=>({..._,content:j.content,ref:e.ref(null)})),z=[(m.index||p)+1,0].concat($);r.value.content.splice.apply(r.value.content,z),$[$.length-1]}else p!==void 0?r.value.content.splice(p+1,0,_):r.value.content.push(_);e.nextTick(()=>{_.focus()})}function c(d,f){const p=r.value.content.findIndex(m=>m===d);p!==-1&&(r.value.content[p].content=f)}function u(d){let f=r.value.content.findIndex(p=>p===d);f!==-1&&r.value.content.splice(f,1)}function g(d){d.focus()}function v(){a.params.url?h.update(r.value).then(d=>{i.push({name:"BlogPost",params:{url:d.url}})}).catch(d=>{console.log(d)}):h.create(r.value).then(d=>{i.push({name:"BlogPost",params:{url:d.url}})}).catch(d=>{console.log(d)})}const k=e.ref(null),B=e.ref(!1),x=e.ref(!1);function w(d){if(d.__name){if(d.__name==="Textarea")return E;if(d.__name==="ImageUpload")return S;if(d.__name==="H2")return V;if(d.__name==="Bullets")return P;if(d.__name==="Caption")return T}else return d}function N(){B.value=!0}function C(){B.value=!1}return e.watchEffect(()=>{r.value.content.length===0&&n("Textarea","")}),(d,f)=>(e.openBlock(),e.createElementBlock("article",ae,[e.createElementVNode("section",re,[e.createElementVNode("div",se,[e.createVNode(E,{prop:e.unref(r),content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])]),e.unref(r).content?(e.openBlock(),e.createBlock(e.unref(A.VueDraggableNext),{key:0,class:"w-full",list:e.unref(r).content,onStart:N,onEnd:C},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).content,(p,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"relative",onMouseover:_=>k.value=m,onMouseleave:f[2]||(f[2]=_=>{k.value=null,x.value=!1})},[e.createElementVNode("div",ie,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w(p.type.value)),{index:m,component:p,prop:p,class:e.normalizeClass(p.class),content:"content",onDeleteBlock:u,onAddBlock:n,onUpdateBlock:c,onFocusBlock:g},null,40,["index","component","prop","class"]))]),k.value===m?(e.openBlock(),e.createElementBlock("div",{key:0,class:"pos-absolute pos-l-0 pos-t-0",onMousedown:f[1]||(f[1]=e.withModifiers(_=>B.value=!0,["prevent"]))},[e.createElementVNode("button",{onClick:f[0]||(f[0]=_=>x.value=!x.value),class:"i-regular bg-grey radius-thin"},e.toDisplayString(p.content?"...":"+"),1),x.value?(e.openBlock(),e.createElementBlock("div",ue,[e.createElementVNode("button",{onClick:_=>u(p),class:"block w-full text-left px-4 py-2 hover:bg-gray-200"},"Удалить",8,de),pe,e.createElementVNode("button",{onClick:_=>n("ImageUpload","",m),class:"block w-full text-left px-4 py-2 hover:bg-gray-200"},"Добавить изображение",8,me),e.createElementVNode("button",{onClick:_=>n("H2","",m),class:"block w-full text-left px-4 py-2 hover:bg-gray-200"},"Добавить заголовок",8,fe),e.createElementVNode("button",{onClick:_=>n("Bullets","",m),class:"block w-full text-left px-4 py-2 hover:bg-gray-200"},"Добавить список",8,ge),e.createElementVNode("button",{onClick:_=>n("Caption","",m),class:"block w-full text-left px-4 py-2 hover:bg-gray-200"},"Добавить выделенный текст",8,he)])):e.createCommentVNode("",!0)],32)):e.createCommentVNode("",!0)],40,ce))),128))]),_:1},8,["list"])):e.createCommentVNode("",!0)]),e.createElementVNode("section",ve,[e.createElementVNode("a",{onClick:f[3]||(f[3]=p=>v()),class:"mn-l-auto bg-main button"},"Publish")])]))}},I=Object.freeze(Object.defineProperty({__proto__:null,default:U},Symbol.toStringTag,{value:"Module"})),_e={},ye={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},ke=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),be=[ke];function xe(l,s){return e.openBlock(),e.createElementBlock("svg",ye,be)}const Be=y._export_sfc(_e,[["render",xe]]),we={class:"w-100 bg-darkgrey radius-big image-upload-area flex-v-center flex-h-center flex t-black mn-small"},Ee=["src"],F={__name:"Image",props:["label","value","prop"],setup(l){return e.ref(null),(s,t)=>(e.openBlock(),e.createElementBlock("div",we,[l.prop.content?(e.openBlock(),e.createElementBlock("img",{key:0,src:l.prop.content,alt:"Uploaded image",class:"w-100 h-30r object-fit-contain"},null,8,Ee)):e.createCommentVNode("",!0)]))}},Ne={class:"pd-thin"},q={__name:"BlogPost",setup(l){const s=b.useRoute(),t=e.ref(null),a=e.ref(!0);e.onMounted(async()=>{a.value=!0;const n=await h.read({user:y.state.user._id,url:s.params.url});t.value=n[0],a.value=!1});const i=[{name:"Textarea",value:"p"},{name:"H2",value:"h2"},{name:"Caption",value:"caption"},{name:"ImageUpload",value:F}];function r(n){var c;return(c=i.find(u=>u.name===n))==null?void 0:c.value}function o(n){return n.type.name==="Textarea"?{innerHTML:n.content}:n.type.name==="H2"?{innerHTML:n.content}:n.type.name==="Caption"?{innerHTML:n.content}:n.type.name==="ImageUpload"?{src:n.content}:{}}return(n,c)=>(e.openBlock(),e.createElementBlock("section",Ne,[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,u=>e.createVNode(Be,{key:u})),64)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!a.value&&!t.value?(e.openBlock(),e.createBlock(R._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(()=>[!a.value&&t.value?(e.openBlock(),e.createBlock(h._sfc_main$1,{key:0,onClick:c[0]||(c[0]=u=>n.$router.push({name:"Blogpost",params:{url:t.value.url}})),blogpost:t.value,user:y.state.user._id,type:"blogpostPage",class:e.normalizeClass(["mn-medium",{"br-b br-solid br-black-transp-10":n.index!==t.value.length-1}])},{default:e.withCtx(()=>[e.createElementVNode("section",null,[t.value&&t.value.content?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.value.content,(u,g)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r(u.type.name)),e.mergeProps({key:g,index:g,component:u,prop:u,class:u.class,content:"content"},o(u),{class:"mn-medium"}),null,16,["index","component","prop","class"]))),128)):e.createCommentVNode("",!0)])]),_:1},8,["blogpost","user","class"])):e.createCommentVNode("",!0),e.createVNode(O._sfc_main,{class:"mn-small"}),!a.value&&t.value?(e.openBlock(),e.createBlock(M._sfc_main,{key:1,type:"blogpost",target:t.value._id,owner:y.state.user._id},null,8,["target","owner"])):e.createCommentVNode("",!0)]),_:1})]))}},Ce=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"})),H={__name:"Blog",setup(l){const s=b.useRoute(),t=b.useRouter();return s.params.category||(s.params.category="featured"),e.onMounted(()=>{if(s.query){const a=s.query,i={tags:a.tags?a.tags.split(","):[],period:a.period?a.period:"year"};h.state.filter=i}}),e.watch(()=>h.state.filter,(a,i)=>{const r={...s.query};Object.keys(i).forEach(n=>{r[n]&&delete r[n]});const o=Object.fromEntries(Object.entries(a).filter(([n,c])=>Array.isArray(c)&&c.length>0||typeof c=="string"&&c).map(([n,c])=>[n,Array.isArray(c)?c.join(","):c]));Object.assign(r,o),t.push({query:r})},{deep:!0}),(a,i)=>(e.openBlock(),e.createElementBlock("section",null,[e.createVNode(h._sfc_main,{category:e.unref(s).params.category,user:y.state.user._id,period:e.unref(s).query.period},null,8,["category","user","period"])]))}},$e=Object.freeze(Object.defineProperty({__proto__:null,default:H},Symbol.toStringTag,{value:"Module"})),Ve={class:"w-100 cols-4 t-left flex-nowrap flex"},Te={key:0,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},Pe=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),Se={class:"t-semi uppercase"},Ie=e.createElementVNode("br",null,null,-1),Me={key:1,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),Ue={class:"t-semi uppercase"},Fe=e.createElementVNode("br",null,null,-1),qe={key:2,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},He=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),ze={class:"t-semi uppercase"},je=e.createElementVNode("br",null,null,-1),Le={__name:"Activity",props:{likes:Number,comments:Number,subscriptions:Number},setup(l){return(s,t)=>(e.openBlock(),e.createElementBlock("section",Ve,[l.likes?(e.openBlock(),e.createElementBlock("div",Te,[Pe,e.createElementVNode("span",Se,[e.createTextVNode(e.toDisplayString(l.likes),1),Ie,e.createTextVNode("likes")])])):e.createCommentVNode("",!0),l.comments?(e.openBlock(),e.createElementBlock("div",Me,[De,e.createElementVNode("span",Ue,[e.createTextVNode(e.toDisplayString(l.comments),1),Fe,e.createTextVNode("comments")])])):e.createCommentVNode("",!0),l.subscriptions?(e.openBlock(),e.createElementBlock("div",qe,[He,e.createElementVNode("span",ze,[e.createTextVNode(e.toDisplayString(l.subscriptions),1),je,e.createTextVNode("subscriptions")])])):e.createCommentVNode("",!0)]))}},Ae={class:"pd-thin radius-extra flex-nowrap flex"},Re=["innerHTML"],Oe={__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(l,{emit:s}){const t=l,{t:a,locale:i}=J.useI18n();let r=e.ref(0),o=e.ref(t.input),n=e.ref(t.placeholder),c=e.ref(t.enableTyping),u=e.ref(null),g=e.ref(""),v=e.ref(!0),k=null;function B(){s("action")}function x(f){s("update:input",f),g.value=f}function w(){r.value=(r.value+1)%t.placeholderTexts[i.value].length}function N(){c.value=!1,clearInterval(u.value),n.value=t.placeholder,g.value||(o.value="")}function C(){!g.value&&t.enableTyping&&(c.value=!0,n.value="",d())}function d(){let f=t.placeholderTexts[i.value][r.value],p=0,m=!1;k=setInterval(()=>{v.value=!v.value},200),u.value=setInterval(()=>{c.value&&(m?(o.value=o.value.slice(0,-1),o.value=f.substring(0,p)+(v.value&&p%2?"|":""),p--):(o.value=f.substring(0,p)+(v.value&&p%2?"|":""),p++),p>f.length&&t.loopTyping&&setTimeout(()=>{m=!0,o.value=f.substring(0,p)},333),p===0&&m&&(m=!1,w(),f=t.placeholderTexts[i.value][r.value]))},t.typingSpeed)}return e.onMounted(()=>{t.enableTyping&&d()}),e.watchEffect(()=>{c.value||(clearInterval(u.value),clearInterval(k))}),(f,p)=>(e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(y.Field,{field:e.unref(o),"onUpdate:field":[p[0]||(p[0]=m=>e.isRef(o)?o.value=m:o=m),x],placeholder:e.unref(n),onInput:w,onFocus:N,onBlur:C,class:"w-100 pd-small p-big"},null,8,["field","placeholder"]),l.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:l.action},null,8,Re)):e.createCommentVNode("",!0)]))}};const Je={class:"pd-thin"},Ge={class:"o-hidden t-black bg-main pd-big radius-big"},Qe=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),We={class:"z-index-1 mn-big w-100 flex-nowrap flex"},Ke=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),Xe={__name:"SubscribeNewsletter",setup(l){let s=e.ref("");return(t,a)=>(e.openBlock(),e.createElementBlock("section",Je,[e.createElementVNode("div",Ge,[Qe,e.createElementVNode("div",We,[e.createVNode(Oe,{input:e.unref(s),typingSpeed:75,loopTyping:!1,enableTyping:!1,placeholder:"Please enter your email",action:"Subscribe","onUpdate:input":a[0]||(a[0]=i=>e.isRef(s)?s.value=i:s=i),onAction:a[1]||(a[1]=i=>t.router.push({name:"Product Recommmendation",query:{mood:t.mood}})),class:"mn-l-auto mn-r-auto bg-white t-black w-50"},null,8,["input"])]),Ke])]))}};const Ye={class:"container-joinus"},Ze={class:"content"},et={class:"h0 mn-big"},tt=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),nt=e.createElementVNode("button",{class:"bg-black t-white button"},"Join Now",-1),ot={__name:"JoinUs",setup(l){const s=e.ref(120950),t=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"]),a=()=>{setInterval(()=>{s.value+=Math.floor(Math.random()*5)+1},330)},i={minSize:"6rem",maxSize:"10rem",minDuration:5,maxDuration:15,spawnPoints:[10,90]};e.onMounted(()=>{r(),a()});const r=()=>{t.value.forEach((o,n)=>{let c=document.createElement("img");c.src=o,c.classList.add("floating-image");let u=i.spawnPoints[Math.floor(Math.random()*i.spawnPoints.length)],g=(Math.random()-.5)*2*10;c.style.left=`${u+g}%`,c.style.animationDuration=`${Math.random()*(i.maxDuration-i.minDuration)+i.minDuration}s`,document.querySelector(".container").appendChild(c),c.addEventListener("animationiteration",()=>{const v=i.spawnPoints[Math.floor(Math.random()*i.spawnPoints.length)],k=(Math.random()-.5)*2*10;c.style.left=`${v+k}%`})})};return(o,n)=>(e.openBlock(),e.createElementBlock("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("span",et,e.toDisplayString(s.value.toLocaleString()),1),tt,nt])]))}};const lt=l=>(e.pushScopeId("data-v-18db0d1b"),l=l(),e.popScopeId(),l),at={class:"community-feed"},rt=lt(()=>e.createElementVNode("h2",{class:"w-m-75r mn-auto pd-t-big pd-b-big t-center"},"Discover the Vibrant Community",-1)),st={class:"grid-container"},ct={__name:"HotPosts",async setup(l){let s,t;const a=e.ref([]),i=async()=>{const o=await h.read({skip:0,limit:7,period:"year"});console.log(o),a.value=o};[s,t]=e.withAsyncContext(()=>i()),await s,t();const r=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,n)=>(e.openBlock(),e.createElementBlock("section",at,[rt,e.createElementVNode("div",st,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(c,u)=>(e.openBlock(),e.createBlock(h._sfc_main$1,{blogpost:c,owner:y.state.user._id,key:u,class:e.normalizeClass(r(u))},null,8,["blogpost","owner","class"]))),128))])]))}},it=y._export_sfc(ct,[["__scopeId","data-v-18db0d1b"]]),ut=[{path:"community",component:D,meta:{title:{en:"Community",ru:"Коммьюнити"}},children:[{path:":category?",name:"Blog",component:()=>Promise.resolve().then(()=>$e)}]},{path:"community/posts/create",name:"Create BlogPost",meta:{title:{en:"Create Post",ru:"Создать Пост"},authorize:[]},component:()=>Promise.resolve().then(()=>I)},{path:"community/posts/:url",name:"BlogPost",meta:{title:{en:"Post",ru:"Пост"}},component:()=>Promise.resolve().then(()=>Ce)},{path:"community/posts/:url/edit",name:"Edit BlogPost",meta:{title:{en:"Edit Post",ru:"Редактировать пост"},authorize:[]},component:()=>Promise.resolve().then(()=>I)}];exports.CardBlogpost=h._sfc_main$1;exports.Feed=h._sfc_main;exports.FooterBlogpost=h._sfc_main$2;exports.blogpostsStore=h.blogposts;exports.reactionsStore=h.reactions;exports.Comments=M._sfc_main;exports.Activity=Le;exports.Blog=H;exports.BlogPost=q;exports.Bullets=P;exports.Caption=T;exports.Community=D;exports.CreateBlogPost=U;exports.H2=V;exports.HotPosts=it;exports.Image=F;exports.ImageUpload=S;exports.JoinUs=ot;exports.SubscribeNewsletter=Xe;exports.Textarea=E;exports.blogpostsRoutes=ut;
6
+ `)&&r("addBlock","H2","",n.index,{blocks:newBlocks,ref:t}),i()}function i(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{i()}),e.onMounted(()=>{i()}),e.watch(()=>n.prop[n.content],o=>{o===""&&!o.includes(`
7
+ `)&&r("deleteBlock",n.prop)}),(o,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{"onUpdate:modelValue":s[0]||(s[0]=a=>l.prop[l.content]=a),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:c,onFocus:s[1]||(s[1]=a=>r("focus",t.value)),ref_key:"textarea",ref:t,class:"h3 w-100 mn-t-semi mn-medium t-semi"},`
8
+ `,40,X)),[[e.vModelText,l.prop[l.content]]])}},Y=["placeholder"],S={__name:"Caption",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(l,{emit:r}){const n=l;e.ref(n);const t=e.ref(null);function c(o){const s=/^\s*[-*]\s+(.*)/;let u=o.target.value.split(/\n+/).map(d=>{const m=s.exec(d);return m?m[1]:null}).filter(d=>d!==null);u.length>0?(n.prop[n.content]=u,i()):o.target.value.trim()===""&&(n.prop[n.content]=[],i())}function i(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{i()}),e.onMounted(()=>{i()}),e.watch(()=>n.prop[n.content],o=>{(!o||o.length===0)&&r("deleteBlock",n.prop)}),(o,s)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":s[0]||(s[0]=a=>l.prop[l.content]=a),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:c,onFocus:s[1]||(s[1]=a=>r("focus",t.value)),ref_key:"textarea",ref:t,class:"br-l br-solid br-main pd-l-small text-area mn-small"},`
9
+ `,40,Y),[[e.vModelText,l.prop[l.content]]])]))}},Z=["placeholder"],P={__name:"Bullets",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(l,{emit:r}){const n=l;e.ref(n);const t=e.ref(null);function c(o){const s=/^\s*[-*]\s+(.*)/;let u=o.target.value.split(/\n+/).map(d=>{const m=s.exec(d);return m?m[1]:null}).filter(d=>d!==null);u.length>0?(n.prop[n.content]=u,i()):o.target.value.trim()===""&&(n.prop[n.content]=[],i())}function i(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{i()}),e.onMounted(()=>{i()}),e.watch(()=>n.prop[n.content],o=>{(!o||o.length===0)&&r("deleteBlock",n.prop)}),(o,s)=>(e.openBlock(),e.createElementBlock("div",null,[e.createTextVNode(e.toDisplayString(l.prop[l.content])+" ",1),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":s[0]||(s[0]=a=>l.prop[l.content]=a),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:c,onFocus:s[1]||(s[1]=a=>r("focus",t.value)),ref_key:"textarea",ref:t,class:"text-area mn-small"},`
10
+ `,40,Z),[[e.vModelText,l.prop[l.content]]])]))}},ee=["src"],te={key:1,class:"t-transp pd-extra"},I={__name:"ImageUpload",props:["label","value","prop"],emits:["input","updateBlock"],setup(l,{emit:r}){const n=l,t=e.ref(null),c=e.ref(null);function i(){c.value.click()}async function o(a){let u=a.target.files[0];console.log(u);let d=new FormData,m="unsorted";d.append("file",u),console.log(d.has("file"));try{let N=await y.axios.create({baseURL:process.env.API_URL,withCredentials:!0}).post(`/api/upload/file?folderName=${encodeURIComponent(m)}`,d,{headers:{"Content-Type":"multipart/form-data"}});t.value=N.data.filepath,console.log(t.value),r("input",t.value),r("updateBlock",n.prop,{content:t.value})}catch(x){console.error(x)}}function s(a){a.preventDefault(),o({target:{files:a.dataTransfer.files}})}return(a,u)=>(e.openBlock(),e.createElementBlock("div",{onClick:i,onDrop:s,onDragover:u[0]||(u[0]=e.withModifiers(()=>{},["prevent"])),class:"w-100 radius-big bg-white image-upload-area flex-v-center flex-h-center flex t-black mn-small"},[l.prop.content?(e.openBlock(),e.createElementBlock("img",{key:0,src:l.prop.content,alt:"Uploaded image",class:"w-100 h-30r object-fit-contain"},null,8,ee)):(e.openBlock(),e.createElementBlock("span",te,"Click or drag-and-drop your image")),e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:c,onChange:o,style:{display:"none"}},null,544)],32))}},ne={class:"pd-big"},oe={key:0,class:"cols-2 gap-thin"},le={class:"w-100 bg-grey pd-big radius-big"},ae={class:"w-full h-full"},re=["onMouseover"],se={key:0,class:"z-index-5 radius-thin mn-small relative left-0 mt-2 w-48 bg-white shadow-lg rounded"},ce=["onClick"],ie=e.createElementVNode("button",{class:"block w-full text-left px-4 py-2 hover:bg-gray-200"},"Поменять тип",-1),ue=["onClick"],de=["onClick"],pe=["onClick"],me=["onClick"],fe=e.createStaticVNode('<section class=""><h4 class="mn-small">Select public</h4><div class="mn-semi bg-grey pd-big radius-big gw-100"></div><h4 class="mn-small">Add tags</h4><div class="bg-grey pd-big radius-big gw-100"></div></section>',1),ge={class:"pd-thin pos-fixed pos-l-0 pos-b-0 w-100"},he={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},M={__name:"CreateBlogPost",setup(l){const r=B.useRoute(),n=B.useRouter();let t=e.ref(null);e.onMounted(async()=>{if(r.params.url){const g=await v.read({owner:y.state.user._id,url:r.params.url});t.value=g.pop()}else v.clean(),t.value=v.state.current;t.value.owner={target:y.state.user._id,type:"user"},t.value.creator={target:y.state.user._id,type:"user"}});const c={Textarea:E,H2:T,Bullets:P,Caption:S,ImageUpload:I};function i(g="Textarea",f="",p,h){console.log("We are adding new block (functuin HandleAddBlock):"+g+f+p+h);let _={order:t.value.content.length+1,type:g,style:"",class:"p-medium",content:f,blocks:[],setFocus:!0};if(h&&h.blocks&&Array.isArray(h.blocks)){let k=h.blocks.map(q=>({..._,content:q.content})),b=[(h.index||p)+1,0].concat(k);t.value.content.splice.apply(t.value.content,b);const w=k[k.length-1];console.log("New block is"+w)}else p!==void 0?(t.value.content.splice(p+1,0,_),console.log("Latest block is"+_)):(console.log("Another block is"+_),t.value.content.push(_));u.value=null}function o(g,f){const p=t.value.content.findIndex(h=>h===g);p!==-1&&(t.value.content[p]={...t.value.content[p],...f})}function s(g){let f=t.value.content.findIndex(p=>p===g);f!==-1&&t.value.content.splice(f,1),t.value.content[f-1].setFocus=!0}function a(){r.params.url?v.update(t.value).then(g=>{n.push({name:"BlogPost",params:{url:g.url}})}).catch(g=>{console.log(g)}):v.create(t.value).then(g=>{n.push({name:"BlogPost",params:{url:g.url}})}).catch(g=>{console.log(g)})}const u=e.ref(null),d=e.ref(!1),m=e.ref(!1);function x(){d.value=!0}function N(){d.value=!1}return e.watchEffect(()=>{t.value&&t.value.content.length===0&&i("Textarea","")}),(g,f)=>(e.openBlock(),e.createElementBlock("article",ne,[e.unref(t)?(e.openBlock(),e.createElementBlock("div",oe,[e.createTextVNode(e.toDisplayString(e.unref(t).owner)+" "+e.toDisplayString(e.unref(t).creator)+" ",1),e.createElementVNode("section",le,[e.createElementVNode("div",ae,[e.createVNode(E,{prop:e.unref(t),content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])]),e.unref(t).content?(e.openBlock(),e.createBlock(e.unref(H.VueDraggableNext),{key:0,class:"w-full",list:e.unref(t).content,onStart:x,onEnd:N},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).content,(p,h)=>(e.openBlock(),e.createElementBlock("div",{key:h,class:"relative"},[e.createElementVNode("div",{onMouseover:_=>(u.value=h,m.value=!1),class:"w-full h-full"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c[p.type]),{index:h,component:p,prop:p,class:e.normalizeClass(p.class),setFocus:p.setFocus,content:"content",onDeleteBlock:s,onAddBlock:i,onUpdateBlock:o},null,40,["index","component","prop","class","setFocus"]))],40,re),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[u.value===h?(e.openBlock(),e.createElementBlock("div",{key:0,class:"pos-absolute pos-r-100 pos-t-0 z-index-4 i-semi",onMousedown:f[1]||(f[1]=e.withModifiers(_=>d.value=!0,["prevent"]))},[e.createElementVNode("button",{onClick:f[0]||(f[0]=_=>m.value=!m.value),class:"mn-small w-100 i-big bg-white radius-thin"},e.toDisplayString(p.content?"...":"+"),1),m.value?(e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("button",{onClick:_=>s(p),class:"block w-full text-left px-4 py-2 hover:bg-gray-200"},"Удалить",8,ce),ie,e.createElementVNode("button",{onClick:_=>i("ImageUpload","",h),class:"block w-full text-left px-4 py-2 hover:bg-gray-200"},"Добавить изображение",8,ue),e.createElementVNode("button",{onClick:_=>i("H2","",h),class:"block w-full text-left px-4 py-2 hover:bg-gray-200"},"Добавить заголовок",8,de),e.createElementVNode("button",{onClick:_=>i("Bullets","",h),class:"block w-full text-left px-4 py-2 hover:bg-gray-200"},"Добавить список",8,pe),e.createElementVNode("button",{onClick:_=>i("Caption","",h),class:"block w-full text-left px-4 py-2 hover:bg-gray-200"},"Добавить выделенный текст",8,me)])):e.createCommentVNode("",!0)],32)):e.createCommentVNode("",!0)]),_:2},1024)]))),128))]),_:1},8,["list"])):e.createCommentVNode("",!0)]),fe])):e.createCommentVNode("",!0),e.createElementVNode("section",ge,[e.createElementVNode("div",he,[e.createElementVNode("a",{onClick:f[2]||(f[2]=p=>a()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:f[3]||(f[3]=p=>a()),class:"mn-l-thin bg-black t-white button"},"Publish")])])]))}},V=Object.freeze(Object.defineProperty({__proto__:null,default:M},Symbol.toStringTag,{value:"Module"})),ve={},_e={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},be=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),ke=[be];function ye(l,r){return e.openBlock(),e.createElementBlock("svg",_e,ke)}const xe=y._export_sfc(ve,[["render",ye]]),we={class:"w-100 bg-white radius-big image-upload-area flex-v-center flex-h-center flex t-black mn-small"},Be=["src"],D={__name:"Image",props:["label","value","prop"],setup(l){return e.ref(null),(r,n)=>(e.openBlock(),e.createElementBlock("div",we,[l.prop.content?(e.openBlock(),e.createElementBlock("img",{key:0,src:l.prop.content,alt:"Uploaded image",class:"w-100 h-30r object-fit-contain"},null,8,Be)):e.createCommentVNode("",!0)]))}},Ne={class:"pd-big"},F={__name:"BlogPost",setup(l){const r=B.useRoute(),n=e.ref(null),t=e.ref(!0);e.onMounted(async()=>{t.value=!0;const o=await v.read({user:y.state.user._id,url:r.params.url});n.value=o[0],t.value=!1});const c={Textarea:"p",H2:"h2",Bullets:"p",Caption:"p",ImageUpload:D};function i(o){return o.type==="Textarea"?{innerHTML:o.content}:o.type==="H2"?{innerHTML:o.content}:o.type==="Caption"?{innerHTML:o.content}:o.type==="ImageUpload"?{src:o.content}:{}}return(o,s)=>(e.openBlock(),e.createElementBlock("section",Ne,[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,a=>e.createVNode(xe,{key:a})),64)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!t.value&&!n.value?(e.openBlock(),e.createBlock(j._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(v._sfc_main$1,{key:0,onClick:s[0]||(s[0]=a=>o.$router.push({name:"Blogpost",params:{url:n.value.url}})),blogpost:n.value,user:y.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,(a,u)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c[a.type]),e.mergeProps({key:u,index:u,component:a,prop:a,class:a.class,content:"content"},i(a),{class:"mn-medium"}),null,16,["index","component","prop","class"]))),128)):e.createCommentVNode("",!0)])]),_:1},8,["blogpost","user","class"])):e.createCommentVNode("",!0),e.createVNode(L._sfc_main,{class:"mn-small"}),!t.value&&n.value?(e.openBlock(),e.createBlock(C._sfc_main,{key:1,type:"blogpost",target:n.value._id,owner:y.state.user._id},null,8,["target","owner"])):e.createCommentVNode("",!0)]),_:1})]))}},Ee=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"})),U={__name:"Blog",setup(l){const r=B.useRoute(),n=B.useRouter();return r.params.category||(r.params.category="featured"),e.onMounted(()=>{if(r.query){const t=r.query,c={tags:t.tags?t.tags.split(","):[],period:t.period?t.period:"year"};v.state.filter=c}}),e.watch(()=>v.state.filter,(t,c)=>{const i={...r.query};Object.keys(c).forEach(s=>{i[s]&&delete i[s]});const o=Object.fromEntries(Object.entries(t).filter(([s,a])=>Array.isArray(a)&&a.length>0||typeof a=="string"&&a).map(([s,a])=>[s,Array.isArray(a)?a.join(","):a]));Object.assign(i,o),n.push({query:i})},{deep:!0}),(t,c)=>(e.openBlock(),e.createElementBlock("section",null,[e.createVNode(v._sfc_main,{category:e.unref(r).params.category,user:y.state.user._id,period:e.unref(r).query.period},null,8,["category","user","period"])]))}},Ve=Object.freeze(Object.defineProperty({__proto__:null,default:U},Symbol.toStringTag,{value:"Module"})),Ce={class:"w-100 cols-4 t-left flex-nowrap flex"},$e={key:0,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},Te=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),Se={class:"t-semi uppercase"},Pe=e.createElementVNode("br",null,null,-1),Ie={key:1,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},Me=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"💬",-1),De={class:"t-semi uppercase"},Fe=e.createElementVNode("br",null,null,-1),Ue={key:2,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},qe=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),ze={class:"t-semi uppercase"},He=e.createElementVNode("br",null,null,-1),je={__name:"Activity",props:{likes:Number,comments:Number,subscriptions:Number},setup(l){return(r,n)=>(e.openBlock(),e.createElementBlock("section",Ce,[l.likes?(e.openBlock(),e.createElementBlock("div",$e,[Te,e.createElementVNode("span",Se,[e.createTextVNode(e.toDisplayString(l.likes),1),Pe,e.createTextVNode("likes")])])):e.createCommentVNode("",!0),l.comments?(e.openBlock(),e.createElementBlock("div",Ie,[Me,e.createElementVNode("span",De,[e.createTextVNode(e.toDisplayString(l.comments),1),Fe,e.createTextVNode("comments")])])):e.createCommentVNode("",!0),l.subscriptions?(e.openBlock(),e.createElementBlock("div",Ue,[qe,e.createElementVNode("span",ze,[e.createTextVNode(e.toDisplayString(l.subscriptions),1),He,e.createTextVNode("subscriptions")])])):e.createCommentVNode("",!0)]))}},Le={class:"pd-thin radius-extra flex-nowrap flex"},Ae=["innerHTML"],Re={__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(l,{emit:r}){const n=l,{t,locale:c}=A.useI18n();let i=e.ref(0),o=e.ref(n.input),s=e.ref(n.placeholder),a=e.ref(n.enableTyping),u=e.ref(null),d=e.ref(""),m=e.ref(!0),x=null;function N(){r("action")}function g(k){r("update:input",k),d.value=k}function f(){i.value=(i.value+1)%n.placeholderTexts[c.value].length}function p(){a.value=!1,clearInterval(u.value),s.value=n.placeholder,d.value||(o.value="")}function h(){!d.value&&n.enableTyping&&(a.value=!0,s.value="",_())}function _(){let k=n.placeholderTexts[c.value][i.value],b=0,w=!1;x=setInterval(()=>{m.value=!m.value},200),u.value=setInterval(()=>{a.value&&(w?(o.value=o.value.slice(0,-1),o.value=k.substring(0,b)+(m.value&&b%2?"|":""),b--):(o.value=k.substring(0,b)+(m.value&&b%2?"|":""),b++),b>k.length&&n.loopTyping&&setTimeout(()=>{w=!0,o.value=k.substring(0,b)},333),b===0&&w&&(w=!1,f(),k=n.placeholderTexts[c.value][i.value]))},n.typingSpeed)}return e.onMounted(()=>{n.enableTyping&&_()}),e.watchEffect(()=>{a.value||(clearInterval(u.value),clearInterval(x))}),(k,b)=>(e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(y.Field,{field:e.unref(o),"onUpdate:field":[b[0]||(b[0]=w=>e.isRef(o)?o.value=w:o=w),g],placeholder:e.unref(s),onInput:f,onFocus:p,onBlur:h,class:"w-100 pd-small p-big"},null,8,["field","placeholder"]),l.action?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:N,class:"w-min hover_bg-white hover-t-black t-black bg-main button",innerHTML:l.action},null,8,Ae)):e.createCommentVNode("",!0)]))}};const Oe={class:"pd-thin"},Je={class:"o-hidden t-black bg-main pd-big radius-big"},We=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),Ge={class:"z-index-1 mn-big w-100 flex-nowrap flex"},Ke=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),Qe={__name:"SubscribeNewsletter",setup(l){let r=e.ref("");return(n,t)=>(e.openBlock(),e.createElementBlock("section",Oe,[e.createElementVNode("div",Je,[We,e.createElementVNode("div",Ge,[e.createVNode(Re,{input:e.unref(r),typingSpeed:75,loopTyping:!1,enableTyping:!1,placeholder:"Please enter your email",action:"Subscribe","onUpdate:input":t[0]||(t[0]=c=>e.isRef(r)?r.value=c:r=c),onAction:t[1]||(t[1]=c=>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"])]),Ke])]))}};const Xe={class:"container-joinus"},Ye={class:"content"},Ze={class:"h0 mn-big"},et=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),tt=e.createElementVNode("button",{class:"bg-black t-white button"},"Join Now",-1),nt={__name:"JoinUs",setup(l){const r=e.ref(120950),n=e.ref(["/assets/images/reviews/01.png","/assets/images/reviews/02.png","/assets/images/reviews/03.png","/assets/images/reviews/04.png","/assets/images/reviews/05.png","/assets/images/reviews/06.png"]),t=()=>{setInterval(()=>{r.value+=Math.floor(Math.random()*5)+1},330)},c={minSize:"6rem",maxSize:"10rem",minDuration:5,maxDuration:15,spawnPoints:[10,90]};e.onMounted(()=>{i(),t()});const i=()=>{n.value.forEach((o,s)=>{let a=document.createElement("img");a.src=o,a.classList.add("floating-image");let u=c.spawnPoints[Math.floor(Math.random()*c.spawnPoints.length)],d=(Math.random()-.5)*2*10;a.style.left=`${u+d}%`,a.style.animationDuration=`${Math.random()*(c.maxDuration-c.minDuration)+c.minDuration}s`,document.querySelector(".container").appendChild(a),a.addEventListener("animationiteration",()=>{const m=c.spawnPoints[Math.floor(Math.random()*c.spawnPoints.length)],x=(Math.random()-.5)*2*10;a.style.left=`${m+x}%`})})};return(o,s)=>(e.openBlock(),e.createElementBlock("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("span",Ze,e.toDisplayString(r.value.toLocaleString()),1),et,tt])]))}};const ot=l=>(e.pushScopeId("data-v-18db0d1b"),l=l(),e.popScopeId(),l),lt={class:"community-feed"},at=ot(()=>e.createElementVNode("h2",{class:"w-m-75r mn-auto pd-t-big pd-b-big t-center"},"Discover the Vibrant Community",-1)),rt={class:"grid-container"},st={__name:"HotPosts",async setup(l){let r,n;const t=e.ref([]),c=async()=>{const o=await v.read({skip:0,limit:7,period:"year"});console.log(o),t.value=o};[r,n]=e.withAsyncContext(()=>c()),await r,n();const i=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,s)=>(e.openBlock(),e.createElementBlock("section",lt,[at,e.createElementVNode("div",rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(a,u)=>(e.openBlock(),e.createBlock(v._sfc_main$1,{blogpost:a,owner:y.state.user._id,key:u,class:e.normalizeClass(i(u))},null,8,["blogpost","owner","class"]))),128))])]))}},ct=y._export_sfc(st,[["__scopeId","data-v-18db0d1b"]]),it=[{path:"community",component:$,meta:{title:{en:"Community",ru:"Коммьюнити"}},children:[{path:":category?",name:"Blog",component:()=>Promise.resolve().then(()=>Ve)}]},{path:"community/posts/create",name:"Create BlogPost",meta:{title:{en:"Create Post",ru:"Создать Пост"},authorize:[]},component:()=>Promise.resolve().then(()=>V)},{path:"community/posts/:url",name:"BlogPost",meta:{title:{en:"Post",ru:"Пост"}},component:()=>Promise.resolve().then(()=>Ee)},{path:"community/posts/:url/edit",name:"Edit BlogPost",meta:{title:{en:"Edit Post",ru:"Редактировать пост"},authorize:[]},component:()=>Promise.resolve().then(()=>V)}];exports.CardBlogpost=v._sfc_main$1;exports.Feed=v._sfc_main;exports.FooterBlogpost=v._sfc_main$2;exports.blogpostsStore=v.blogposts;exports.reactionsStore=v.reactions;exports.Comments=C._sfc_main;exports.Activity=je;exports.Blog=U;exports.BlogPost=F;exports.Bullets=P;exports.Caption=S;exports.Community=$;exports.CreateBlogPost=M;exports.H2=T;exports.HotPosts=ct;exports.Image=D;exports.ImageUpload=I;exports.JoinUs=nt;exports.SubscribeNewsletter=Qe;exports.Textarea=E;exports.blogpostsRoutes=it;