@ozdao/prometheus-framework 0.2.138 → 0.2.140

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. package/dist/auth.server.js +30 -15
  2. package/dist/auth.server.mjs +30 -15
  3. package/dist/community.server.js +3 -3
  4. package/dist/community.server.mjs +3 -3
  5. package/dist/events.server.js +3 -3
  6. package/dist/events.server.mjs +3 -3
  7. package/dist/files.server.js +3 -3
  8. package/dist/files.server.mjs +3 -3
  9. package/dist/gallery.server.js +4 -4
  10. package/dist/gallery.server.mjs +4 -4
  11. package/dist/index-DNI4aUP2.js +259 -0
  12. package/dist/index-Tcyehi73.mjs +260 -0
  13. package/dist/orders.server.js +9 -8
  14. package/dist/orders.server.mjs +9 -8
  15. package/dist/organizations.server.js +31 -15
  16. package/dist/organizations.server.mjs +31 -15
  17. package/dist/products.server.js +37 -5
  18. package/dist/products.server.mjs +37 -5
  19. package/dist/prometheus-framework/src/components/Completion/Completion.vue.cjs +1 -1
  20. package/dist/prometheus-framework/src/components/Completion/Completion.vue.js +19 -19
  21. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +1 -1
  23. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  25. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
  27. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  29. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
  31. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +32 -31
  33. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +2 -2
  35. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +2 -2
  37. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +2 -2
  39. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/auth/store/auth.js +50 -47
  41. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js +1 -1
  43. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  45. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +3 -3
  47. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  49. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +2 -2
  51. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  53. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +1 -1
  55. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +2 -2
  57. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  59. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  61. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +3 -3
  63. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +2 -2
  65. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +5 -5
  67. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  69. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
  71. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  73. package/dist/prometheus-framework/src/modules/marketplace/store/marketplace.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/marketplace/store/marketplace.js +1 -1
  75. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  77. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +16 -16
  79. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +5 -5
  81. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +2 -2
  83. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  84. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  85. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  86. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  87. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
  88. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +42 -39
  89. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  91. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +4 -4
  93. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  94. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +121 -112
  95. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  96. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +4 -4
  97. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  98. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +17 -16
  99. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  100. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +3 -3
  101. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  102. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +121 -61
  103. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  104. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +6 -6
  105. package/dist/prometheus-framework/src/modules/organizations/store/invites.cjs +1 -1
  106. package/dist/prometheus-framework/src/modules/organizations/store/invites.js +25 -24
  107. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  108. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +2 -2
  109. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  110. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  111. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  112. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  113. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  114. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  115. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  116. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  117. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  118. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +3 -3
  119. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  120. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +3 -3
  121. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  122. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
  123. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  124. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  125. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  126. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +3 -3
  127. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  128. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  129. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  130. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +3 -3
  131. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
  132. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +1 -1
  133. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.cjs +1 -1
  134. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.js +2 -2
  135. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
  136. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js +4 -4
  137. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.cjs +1 -1
  138. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.js +66 -67
  139. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.cjs +1 -1
  140. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.js +4 -4
  141. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  142. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +3 -3
  143. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  144. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +78 -74
  145. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.cjs +1 -1
  146. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +1 -1
  147. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.cjs +1 -1
  148. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +2 -2
  149. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  150. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +5 -5
  151. package/dist/reports.server.js +0 -3
  152. package/dist/reports.server.mjs +0 -3
  153. package/dist/style.css +1 -1
  154. package/dist/wallet.server.js +5 -5
  155. package/dist/wallet.server.mjs +8 -8
  156. package/package.json +1 -1
  157. package/src/components/Completion/Completion.vue +29 -30
  158. package/src/modules/auth/components/pages/Invite.vue +4 -2
  159. package/src/modules/auth/controllers/auth.controller.js +31 -13
  160. package/src/modules/auth/middlewares/authJwt.js +80 -0
  161. package/src/modules/{middlewares/server → auth/middlewares}/index.js +1 -3
  162. package/src/modules/{middlewares/server → auth/middlewares}/verifyAccesses.js +1 -1
  163. package/src/modules/auth/routes/auth.routes.js +2 -2
  164. package/src/modules/auth/routes/twofa.routes.js +1 -1
  165. package/src/modules/auth/store/auth.js +9 -0
  166. package/src/modules/chats/routes/chats.routes.js +1 -1
  167. package/src/modules/community/routes/blog.routes.js +2 -2
  168. package/src/modules/events/routes/events.routes.js +2 -2
  169. package/src/modules/files/routes/files.routes.js +2 -2
  170. package/src/modules/gallery/components/pages/Gallery.vue +1 -1
  171. package/src/modules/gallery/routes/gallery.routes.js +4 -5
  172. package/src/modules/globals/services/globals.crud.js +2 -2
  173. package/src/modules/marketplace/store/marketplace.js +1 -1
  174. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +2 -2
  175. package/src/modules/orders/components/sections/FormAddCustomer.vue +2 -2
  176. package/src/modules/orders/controllers/orders.controller.js +1 -2
  177. package/src/modules/orders/routes/applications.routes.js +2 -2
  178. package/src/modules/orders/routes/orders.routes.js +2 -2
  179. package/src/modules/organizations/components/blocks/CardOrganization.vue +9 -7
  180. package/src/modules/organizations/components/pages/Members.vue +26 -15
  181. package/src/modules/organizations/components/sections/DetailsTab.vue +1 -1
  182. package/src/modules/organizations/components/sections/MembersAdd.vue +101 -43
  183. package/src/modules/organizations/controllers/invites.controller.js +18 -13
  184. package/src/modules/organizations/controllers/memberships.controller.js +16 -9
  185. package/src/modules/organizations/controllers/organizations.controller.js +3 -4
  186. package/src/modules/organizations/models/membership.model.js +2 -0
  187. package/src/modules/organizations/models/organization.model.js +4 -0
  188. package/src/modules/organizations/routes/invites.routes.js +2 -2
  189. package/src/modules/organizations/store/invites.js +2 -1
  190. package/src/modules/products/controllers/leftovers.controller.js +1 -1
  191. package/src/modules/products/middlewares/index.js +11 -0
  192. package/src/modules/products/routes/categories.routes.js +2 -2
  193. package/src/modules/reports/routes/reports.routes.js +2 -2
  194. package/src/modules/spots/components/layouts/Spots.vue +2 -2
  195. package/src/modules/spots/components/pages/Map.vue +79 -78
  196. package/src/modules/users/components/pages/ProfileEdit.vue +37 -22
  197. package/src/modules/wallet/controllers/routes/payments.routes.js +2 -2
  198. package/src/modules/wallet/controllers/routes/rewards.routes.js +2 -2
  199. package/src/modules/middlewares/server/authJwt.js +0 -68
  200. /package/src/modules/{middlewares/server → auth/middlewares}/authSecret.js +0 -0
  201. /package/src/modules/{middlewares/server → auth/middlewares}/verifyInvites.js +0 -0
  202. /package/src/modules/{middlewares/server → auth/middlewares}/verifySignUp.js +0 -0
  203. /package/src/modules/{middlewares/server → auth/middlewares}/verifyUser.js +0 -0
  204. /package/src/modules/globals/services/{globals.cashe.js → globals.cache.js} +0 -0
  205. /package/src/modules/{middlewares/server → products/middlewares}/verifyCategory.js +0 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../components/Tab/Tab.vue2.cjs"),f=require("../../../../components/Field/Field.vue.cjs"),_=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),b=require("../../../../components/Button/Button.vue.cjs"),d=require("vue-router"),g=require("vue-i18n"),w=require("../../localization/SignUp.json.cjs"),l=require("../../store/auth.cjs"),N=require("../../store/twofa.cjs"),i=require("../../../middlewares/client/inputs.validation.cjs");;/* empty css */const V={class:"t-left pd-medium"},S={class:"mn-b-small"},E={class:"mn-b-small p-small uppercase t-semi bg-light radius-big o-hidden"},q={class:"pos-relative"},C={class:"mn-b-semi radius-small"},y={class:"mn-b-small t-transp"},D={class:"mn-b-semi radius-small o-hidden"},x={class:"mn-b-small t-transp"},T={class:"w-100"},k={__name:"SignUp",setup(I){const{t}=g.useI18n({useScope:"global",...w.default}),s=e.ref(null),r=e.ref(null);d.useRoute();const c=d.useRouter(),a=e.ref("phone");async function m(){try{a.value==="phone"&&await i.validateInputs(s,i.validatePhone,l.state.user.phone,"Некорректный телефон"),a.value==="email"&&await i.validateInputs(r,i.validateEmail,l.state.user.email,"Некорректный email")}catch{throw new Error}try{await N.sendCode(l.state.user,"signup",a.value)}catch{throw new Error}}function p(){c.push({name:"Enter Code"})}return(u,n)=>{const h=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",V,[e.createElementVNode("h3",S,e.toDisplayString(e.unref(t)("title")),1),e.createElementVNode("div",E,[e.createVNode(v.default,{selected:a.value,"onUpdate:selected":n[0]||(n[0]=o=>a.value=o),tabs:[{name:e.unref(t)("phone"),value:"phone"},{name:e.unref(t)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",q,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",C,[e.createElementVNode("p",y,e.toDisplayString(e.unref(t)("smsNotice")),1),e.createVNode(_.default,{onChange:n[1]||(n[1]=o=>l.state.user.phone=o),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:s.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-light pd-small radius-small mn-b-thin"},null,8,["validation","inputOptions"])],512),[[e.vShow,a.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",D,[e.createElementVNode("p",x,e.toDisplayString(e.unref(t)("emailNotice")),1),e.createVNode(f.default,{field:l.state.user.email,"onUpdate:field":n[2]||(n[2]=o=>l.state.user.email=o),placeholder:e.unref(t)("emailPlaceholder"),validation:r.value,class:"bg-light pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,a.value==="email"]])]),_:1})]),e.createVNode(b.default,{submit:m,callback:p,class:"w-100 bg-main mn-b-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1}),e.createElementVNode("div",T,[e.createVNode(h,{to:"/auth/signin",class:"underline mn-b-medium d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("haveAccount")),1)]),_:1})])])}}};exports.default=k;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../components/Tab/Tab.vue2.cjs"),f=require("../../../../components/Field/Field.vue2.cjs"),_=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),b=require("../../../../components/Button/Button.vue2.cjs"),d=require("vue-router"),g=require("vue-i18n"),w=require("../../localization/SignUp.json.cjs"),l=require("../../store/auth.cjs"),N=require("../../store/twofa.cjs"),i=require("../../../middlewares/client/inputs.validation.cjs");;/* empty css */const V={class:"t-left pd-medium"},S={class:"mn-b-small"},E={class:"mn-b-small p-small uppercase t-semi bg-light radius-big o-hidden"},q={class:"pos-relative"},C={class:"mn-b-semi radius-small"},y={class:"mn-b-small t-transp"},D={class:"mn-b-semi radius-small o-hidden"},x={class:"mn-b-small t-transp"},T={class:"w-100"},k={__name:"SignUp",setup(I){const{t}=g.useI18n({useScope:"global",...w.default}),s=e.ref(null),r=e.ref(null);d.useRoute();const c=d.useRouter(),a=e.ref("phone");async function m(){try{a.value==="phone"&&await i.validateInputs(s,i.validatePhone,l.state.user.phone,"Некорректный телефон"),a.value==="email"&&await i.validateInputs(r,i.validateEmail,l.state.user.email,"Некорректный email")}catch{throw new Error}try{await N.sendCode(l.state.user,"signup",a.value)}catch{throw new Error}}function p(){c.push({name:"Enter Code"})}return(u,n)=>{const h=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",V,[e.createElementVNode("h3",S,e.toDisplayString(e.unref(t)("title")),1),e.createElementVNode("div",E,[e.createVNode(v.default,{selected:a.value,"onUpdate:selected":n[0]||(n[0]=o=>a.value=o),tabs:[{name:e.unref(t)("phone"),value:"phone"},{name:e.unref(t)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",q,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",C,[e.createElementVNode("p",y,e.toDisplayString(e.unref(t)("smsNotice")),1),e.createVNode(_.default,{onChange:n[1]||(n[1]=o=>l.state.user.phone=o),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:s.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-light pd-small radius-small mn-b-thin"},null,8,["validation","inputOptions"])],512),[[e.vShow,a.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",D,[e.createElementVNode("p",x,e.toDisplayString(e.unref(t)("emailNotice")),1),e.createVNode(f.default,{field:l.state.user.email,"onUpdate:field":n[2]||(n[2]=o=>l.state.user.email=o),placeholder:e.unref(t)("emailPlaceholder"),validation:r.value,class:"bg-light pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,a.value==="email"]])]),_:1})]),e.createVNode(b.default,{submit:m,callback:p,class:"w-100 bg-main mn-b-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1}),e.createElementVNode("div",T,[e.createVNode(h,{to:"/auth/signin",class:"underline mn-b-medium d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("haveAccount")),1)]),_:1})])])}}};exports.default=k;
@@ -1,8 +1,8 @@
1
1
  import { ref as d, resolveComponent as E, openBlock as S, createElementBlock as x, createElementVNode as o, toDisplayString as r, unref as t, createVNode as l, Transition as h, withCtx as m, withDirectives as _, vShow as f, createTextVNode as v } from "vue";
2
2
  import N from "../../../../components/Tab/Tab.vue2.js";
3
- import V from "../../../../components/Field/Field.vue.js";
3
+ import V from "../../../../components/Field/Field.vue2.js";
4
4
  import y from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import D from "../../../../components/Button/Button.vue.js";
5
+ import D from "../../../../components/Button/Button.vue2.js";
6
6
  import { useRoute as I, useRouter as $ } from "vue-router";
7
7
  import { useI18n as O } from "vue-i18n";
8
8
  import P from "../../localization/SignUp.json.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("axios"),d=require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs"),g=require("../../../../node_modules/@capacitor/preferences/dist/esm/index.cjs"),w=require("vue"),c=require("../../globals/store/globals.cjs"),k=require("./twofa.cjs"),u=l.create({baseURL:process.env.API_URL,withCredentials:!0}),a=w.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1},accesses:[]});async function O(){try{const e=await m("user");if(e){const{_id:t,email:s,phone:n,roles:o,accessToken:r}=e;l.interceptors.request.use(i=>(i.headers["x-access-token"]=r,i),i=>Promise.reject(i));const h=(await l.get("/api/auth/check-accesses")).data;Object.assign(a.user,{_id:t,email:s,phone:n}),Object.assign(a.access,{token:r,roles:o,status:!!r}),a.accesses=h}}catch(e){console.error("Error initializing app:",e),f("user"),a.accesses=[]}}O();const P={async login(e,t){try{const s=await u.post("/api/auth/signin",{...e,type:t});return p("user",s.data),Object.assign(a.user,{...s.data}),Object.assign(a.access,{token:s.data.accessToken,status:!0,roles:s.data.roles}),s.data}catch(s){return Object.assign(a.access,{token:null,status:!1,roles:null}),console.log(s),c.setError(s),Promise.reject(s)}},async signup(e,t,s){const{password:n,passwordRepeat:o}=a.user;if(console.log(n),console.log(o),n!==o){const r={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(r),new Error(r.response.status)}try{const r=await u.post("/api/auth/signup",{...e,type:t,inviteCode:s});return console.log(r),r.data.accessToken&&p("user",r.data),Object.assign(a.user,{...r.data}),Object.assign(a.access,{token:r.data.accessToken,status:!0,roles:r.data.roles}),r.data}catch(r){throw c.setError(r),console.log("Sign up falied"),r}},logout(){f("user"),Object.assign(a.user,{email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(a.access,{token:null,status:!1})},async resetPassword(e,t){try{const s=await u.post("/api/auth/reset-password",{email:e.email,phone:e.phone,type:t});return Object.assign(k.state.code,{...s.data,isSended:!0}),s.data}catch(s){return c.setError(s),Promise.reject(s)}},async updatePassword(e,t){const{password:s,passwordRepeat:n}=a.user;if(s!==n){const o={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(o),new Error(o.response.status)}try{const o=await u.post("/api/auth/update-password",{email:e.email,phone:e.phone,password:e.password,passwordRepeat:e.passwordRepeat,type:t});return o.data.accessToken&&p("user",o.data),Object.assign(a.user,{...o.data}),Object.assign(a.access,{token:o.data.accessToken,status:!0}),o.data}catch(o){return c.setError(o),Promise.reject(o)}}},j={development:{secure:!1,expires:7,sameSite:"Lax"},production:{expires:7,path:"/",domain:process.env.DOMAIN_URL,sameSite:"none",secure:!0}};async function m(e){if(process.env.MOBILE_APP){const{value:t}=await g.Preferences.get({key:e});return t?JSON.parse(t):null}else{const t=d.default.get(e);return t?JSON.parse(t):null}}function p(e,t,s=process.env.DOMAIN_URL){process.env.MOBILE_APP?g.Preferences.set({key:e,value:JSON.stringify(t)}):d.default.set(e,JSON.stringify(t),j[s])}function f(e,t=process.env.NODE_ENV){if(process.env.MOBILE_APP)g.Preferences.remove({key:e});else{const s=t==="production"?{domain:process.env.DOMAIN_URL}:{};d.default.remove(e,s)}}w.watch(a,(e,t)=>{});exports.actions=P;exports.initialize=O;exports.state=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("axios"),w=require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs"),g=require("../../../../node_modules/@capacitor/preferences/dist/esm/index.cjs"),O=require("vue"),c=require("../../globals/store/globals.cjs"),k=require("./twofa.cjs"),u=d.create({baseURL:process.env.API_URL,withCredentials:!0}),r=O.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1},accesses:[]});async function p(){try{const e=await j("user");if(e){const{_id:t,email:s,phone:n,roles:o,accessToken:a}=e;d.interceptors.request.use(i=>(i.headers["x-access-token"]=a,i),i=>Promise.reject(i));const h=(await d.get("/api/auth/check-accesses")).data;Object.assign(r.user,{_id:t,email:s,phone:n}),Object.assign(r.access,{token:a,roles:o,status:!!a}),r.accesses=h}}catch(e){console.error("Error initializing app:",e),f("user"),r.accesses=[]}}p();const m={async login(e,t){try{const s=await u.post("/api/auth/signin",{...e,type:t});return l("user",s.data),Object.assign(r.user,{...s.data}),Object.assign(r.access,{token:s.data.accessToken,status:!0,roles:s.data.roles}),await p(),s.data}catch(s){return Object.assign(r.access,{token:null,status:!1,roles:null}),console.log(s),c.setError(s),Promise.reject(s)}},async signup(e,t,s){const{password:n,passwordRepeat:o}=r.user;if(console.log(n),console.log(o),n!==o){const a={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(a),new Error(a.response.status)}try{const a=await u.post("/api/auth/signup",{...e,type:t,inviteCode:s});return console.log(a),a.data.accessToken&&l("user",a.data),Object.assign(r.user,{...a.data}),Object.assign(r.access,{token:a.data.accessToken,status:!0,roles:a.data.roles}),await p(),a.data}catch(a){throw c.setError(a),console.log("Sign up falied"),a}},logout(){f("user"),Object.assign(r.user,{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(r.access,{roles:null,token:null,status:!1}),r.accesses=[]},async resetPassword(e,t){try{const s=await u.post("/api/auth/reset-password",{email:e.email,phone:e.phone,type:t});return Object.assign(k.state.code,{...s.data,isSended:!0}),s.data}catch(s){return c.setError(s),Promise.reject(s)}},async updatePassword(e,t){const{password:s,passwordRepeat:n}=r.user;if(s!==n){const o={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(o),new Error(o.response.status)}try{const o=await u.post("/api/auth/update-password",{email:e.email,phone:e.phone,password:e.password,passwordRepeat:e.passwordRepeat,type:t});return o.data.accessToken&&l("user",o.data),Object.assign(r.user,{...o.data}),Object.assign(r.access,{token:o.data.accessToken,status:!0}),o.data}catch(o){return c.setError(o),Promise.reject(o)}}},P={development:{secure:!1,expires:7,sameSite:"Lax"},production:{expires:7,path:"/",domain:process.env.DOMAIN_URL,sameSite:"none",secure:!0}};async function j(e){if(process.env.MOBILE_APP){const{value:t}=await g.Preferences.get({key:e});return t?JSON.parse(t):null}else{const t=w.default.get(e);return t?JSON.parse(t):null}}function l(e,t,s=process.env.DOMAIN_URL){process.env.MOBILE_APP?g.Preferences.set({key:e,value:JSON.stringify(t)}):w.default.set(e,JSON.stringify(t),P[s])}function f(e,t=process.env.NODE_ENV){if(process.env.MOBILE_APP)g.Preferences.remove({key:e});else{const s=t==="production"?{domain:process.env.DOMAIN_URL}:{};w.default.remove(e,s)}}O.watch(r,(e,t)=>{});exports.actions=m;exports.initialize=p;exports.state=r;
@@ -1,10 +1,10 @@
1
1
  import d from "axios";
2
- import l from "../../../../../node_modules/js-cookie/dist/js.cookie.js";
3
- import { Preferences as w } from "../../../../node_modules/@capacitor/preferences/dist/esm/index.js";
4
- import { reactive as O, watch as f } from "vue";
2
+ import w from "../../../../../node_modules/js-cookie/dist/js.cookie.js";
3
+ import { Preferences as m } from "../../../../node_modules/@capacitor/preferences/dist/esm/index.js";
4
+ import { reactive as f, watch as h } from "vue";
5
5
  import { setError as c } from "../../globals/store/globals.js";
6
- import { state as h } from "./twofa.js";
7
- const p = d.create({ baseURL: process.env.API_URL, withCredentials: !0 }), o = O({
6
+ import { state as k } from "./twofa.js";
7
+ const p = d.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = f({
8
8
  user: {
9
9
  _id: void 0,
10
10
  username: "",
@@ -20,20 +20,20 @@ const p = d.create({ baseURL: process.env.API_URL, withCredentials: !0 }), o = O
20
20
  },
21
21
  accesses: []
22
22
  });
23
- async function k() {
23
+ async function l() {
24
24
  try {
25
- const e = await v("user");
25
+ const e = await j("user");
26
26
  if (e) {
27
- const { _id: t, email: s, phone: n, roles: r, accessToken: a } = e;
27
+ const { _id: t, email: s, phone: n, roles: o, accessToken: a } = e;
28
28
  d.interceptors.request.use((i) => (i.headers["x-access-token"] = a, i), (i) => Promise.reject(i));
29
- const m = (await d.get("/api/auth/check-accesses")).data;
30
- Object.assign(o.user, { _id: t, email: s, phone: n }), Object.assign(o.access, { token: a, roles: r, status: !!a }), o.accesses = m;
29
+ const O = (await d.get("/api/auth/check-accesses")).data;
30
+ Object.assign(r.user, { _id: t, email: s, phone: n }), Object.assign(r.access, { token: a, roles: o, status: !!a }), r.accesses = O;
31
31
  }
32
32
  } catch (e) {
33
- console.error("Error initializing app:", e), g("user"), o.accesses = [];
33
+ console.error("Error initializing app:", e), g("user"), r.accesses = [];
34
34
  }
35
35
  }
36
- k();
36
+ l();
37
37
  const N = {
38
38
  async login(e, t) {
39
39
  try {
@@ -41,15 +41,15 @@ const N = {
41
41
  ...e,
42
42
  type: t
43
43
  });
44
- return u("user", s.data), Object.assign(o.user, {
44
+ return u("user", s.data), Object.assign(r.user, {
45
45
  ...s.data
46
- }), Object.assign(o.access, {
46
+ }), Object.assign(r.access, {
47
47
  token: s.data.accessToken,
48
48
  status: !0,
49
49
  roles: s.data.roles
50
- }), s.data;
50
+ }), await l(), s.data;
51
51
  } catch (s) {
52
- return Object.assign(o.access, {
52
+ return Object.assign(r.access, {
53
53
  token: null,
54
54
  status: !1,
55
55
  roles: null
@@ -57,8 +57,8 @@ const N = {
57
57
  }
58
58
  },
59
59
  async signup(e, t, s) {
60
- const { password: n, passwordRepeat: r } = o.user;
61
- if (console.log(n), console.log(r), n !== r) {
60
+ const { password: n, passwordRepeat: o } = r.user;
61
+ if (console.log(n), console.log(o), n !== o) {
62
62
  const a = {
63
63
  response: {
64
64
  data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
@@ -72,27 +72,30 @@ const N = {
72
72
  type: t,
73
73
  inviteCode: s
74
74
  });
75
- return console.log(a), a.data.accessToken && u("user", a.data), Object.assign(o.user, {
75
+ return console.log(a), a.data.accessToken && u("user", a.data), Object.assign(r.user, {
76
76
  ...a.data
77
- }), Object.assign(o.access, {
77
+ }), Object.assign(r.access, {
78
78
  token: a.data.accessToken,
79
79
  status: !0,
80
80
  roles: a.data.roles
81
- }), a.data;
81
+ }), await l(), a.data;
82
82
  } catch (a) {
83
83
  throw c(a), console.log("Sign up falied"), a;
84
84
  }
85
85
  },
86
86
  logout() {
87
- g("user"), Object.assign(o.user, {
87
+ g("user"), Object.assign(r.user, {
88
+ _id: void 0,
89
+ username: "",
88
90
  email: "",
89
91
  phone: "",
90
92
  password: "",
91
93
  passwordRepeat: ""
92
- }), Object.assign(o.access, {
94
+ }), Object.assign(r.access, {
95
+ roles: null,
93
96
  token: null,
94
97
  status: !1
95
- });
98
+ }), r.accesses = [];
96
99
  },
97
100
  async resetPassword(e, t) {
98
101
  try {
@@ -101,7 +104,7 @@ const N = {
101
104
  phone: e.phone,
102
105
  type: t
103
106
  });
104
- return Object.assign(h.code, {
107
+ return Object.assign(k.code, {
105
108
  ...s.data,
106
109
  isSended: !0
107
110
  }), s.data;
@@ -110,64 +113,64 @@ const N = {
110
113
  }
111
114
  },
112
115
  async updatePassword(e, t) {
113
- const { password: s, passwordRepeat: n } = o.user;
116
+ const { password: s, passwordRepeat: n } = r.user;
114
117
  if (s !== n) {
115
- const r = {
118
+ const o = {
116
119
  response: {
117
120
  data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
118
121
  }
119
122
  };
120
- throw c(r), new Error(r.response.status);
123
+ throw c(o), new Error(o.response.status);
121
124
  }
122
125
  try {
123
- const r = await p.post("/api/auth/update-password", {
126
+ const o = await p.post("/api/auth/update-password", {
124
127
  email: e.email,
125
128
  phone: e.phone,
126
129
  password: e.password,
127
130
  passwordRepeat: e.passwordRepeat,
128
131
  type: t
129
132
  });
130
- return r.data.accessToken && u("user", r.data), Object.assign(o.user, {
131
- ...r.data
132
- }), Object.assign(o.access, {
133
- token: r.data.accessToken,
133
+ return o.data.accessToken && u("user", o.data), Object.assign(r.user, {
134
+ ...o.data
135
+ }), Object.assign(r.access, {
136
+ token: o.data.accessToken,
134
137
  status: !0
135
- }), r.data;
136
- } catch (r) {
137
- return c(r), Promise.reject(r);
138
+ }), o.data;
139
+ } catch (o) {
140
+ return c(o), Promise.reject(o);
138
141
  }
139
142
  }
140
- }, j = {
143
+ }, _ = {
141
144
  development: { secure: !1, expires: 7, sameSite: "Lax" },
142
145
  production: { expires: 7, path: "/", domain: process.env.DOMAIN_URL, sameSite: "none", secure: !0 }
143
146
  };
144
- async function v(e) {
147
+ async function j(e) {
145
148
  if (process.env.MOBILE_APP) {
146
- const { value: t } = await w.get({ key: e });
149
+ const { value: t } = await m.get({ key: e });
147
150
  return t ? JSON.parse(t) : null;
148
151
  } else {
149
- const t = l.get(e);
152
+ const t = w.get(e);
150
153
  return t ? JSON.parse(t) : null;
151
154
  }
152
155
  }
153
156
  function u(e, t, s = process.env.DOMAIN_URL) {
154
- process.env.MOBILE_APP ? w.set({
157
+ process.env.MOBILE_APP ? m.set({
155
158
  key: e,
156
159
  value: JSON.stringify(t)
157
- }) : l.set(e, JSON.stringify(t), j[s]);
160
+ }) : w.set(e, JSON.stringify(t), _[s]);
158
161
  }
159
162
  function g(e, t = process.env.NODE_ENV) {
160
163
  if (process.env.MOBILE_APP)
161
- w.remove({ key: e });
164
+ m.remove({ key: e });
162
165
  else {
163
166
  const s = t === "production" ? { domain: process.env.DOMAIN_URL } : {};
164
- l.remove(e, s);
167
+ w.remove(e, s);
165
168
  }
166
169
  }
167
- f(o, (e, t) => {
170
+ h(r, (e, t) => {
168
171
  });
169
172
  export {
170
173
  N as actions,
171
- k as initialize,
172
- o as state
174
+ l as initialize,
175
+ r as state
173
176
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../globals/components/blocks/CardHeader.vue.cjs"),d=require("./FooterBlogpost.vue.cjs"),m=require("../../../../components/Text/Text.vue.cjs");;/* empty css */const g=require("vue-router"),b={class:"pos-relative bg-light radius-big flex-column flex"},p={class:"pd-t-zero pd-b-zero pd-medium"},y={key:0,class:"cursor-pointer mn-b-thin flex-nowrap flex w-100"},f={key:0,class:"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"},h={key:1,class:"mn-b-small t-transp p-big"},v={key:2,class:"mn-b-small h2"},k=["src"],B={key:1,controls:"",class:"mn-b-medium object-fit-cover w-100 h-max-20r"},x=["src"],V={__name:"CardBlogpost",props:{blogpost:{type:Object},user:{type:String},type:{type:String},hideDescription:{type:Boolean,default:!1}},setup(t){const i=g.useRouter(),n=t,l=e.computed(()=>n.blogpost.content.find(o=>o.type==="ImageUpload")),s=e.computed(()=>n.blogpost.content.find(o=>o.type==="Video")),r=e.computed(()=>n.blogpost.content.find(o=>o.type==="Textarea"));return(o,a)=>{var c;return e.openBlock(),e.createElementBlock("article",b,[e.createVNode(u.default,{class:e.normalizeClass({"mn-b-small pd-medium":t.type!=="short","flex-child-order-last flex-child mn-l-small":t.type==="short"}),entity:t.blogpost,entityType:"blogpost",user:t.user,owner:t.blogpost.owner,creator:t.blogpost.creator,date:t.blogpost.createdAt,actions:t.user&&t.user===t.blogpost.creator.target._id?[{to:{name:"Edit BlogPost",params:{url:t.blogpost.url}},label:"Edit"}]:null},null,8,["class","entity","user","owner","creator","date","actions"]),e.createElementVNode("section",p,[t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("div",y,[e.createVNode(m.default,{text:t.blogpost.name||"",maxLen:80,class:"h3 d-block",onClick:a[0]||(a[0]=E=>e.unref(i).push({name:"BlogPost",params:{url:t.blogpost.url}}))},null,8,["text"]),t.blogpost.status==="draft"?(e.openBlock(),e.createElementBlock("div",f,e.toDisplayString(t.blogpost.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),r.value&&r.value.content&&t.type!=="blogpostPage"&&!t.hideDescription?(e.openBlock(),e.createElementBlock("p",h,e.toDisplayString(r.value.content.slice(0,120))+"... ",1)):e.createCommentVNode("",!0),t.type==="blogpostPage"?(e.openBlock(),e.createElementBlock("h3",v,e.toDisplayString(t.blogpost.name),1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default")]),l.value&&l.value.content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("img",{key:0,src:(o.FILE_SERVER_URL||"")+l.value.content,alt:"Blog post image",class:"mn-b-medium object-fit-cover w-100 h-min-10r h-100"},null,8,k)):e.createCommentVNode("",!0),!((c=l.value)!=null&&c.content)&&s.value&&s.value.content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("video",B,[e.createElementVNode("source",{src:s.value.content,type:"video/mp4"},null,8,x),e.createTextVNode(" Your browser does not support the video tag. ")])):e.createCommentVNode("",!0),e.createVNode(d.default,{class:"pd-t-zero pd-medium",blogpost:t.blogpost,user:t.user},null,8,["blogpost","user"])])}}};exports.default=V;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../globals/components/blocks/CardHeader.vue.cjs"),d=require("./FooterBlogpost.vue.cjs"),m=require("../../../../components/Text/Text.vue.cjs");;/* empty css */const g=require("vue-router"),b={class:"pos-relative bg-light radius-big flex-column flex"},p={class:"pd-t-zero pd-b-zero pd-medium"},y={key:0,class:"cursor-pointer mn-b-thin flex-nowrap flex w-100"},f={key:0,class:"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"},h={key:1,class:"mn-b-small t-transp p-big"},v={key:2,class:"mn-b-small h2"},k=["src"],B={key:1,controls:"",class:"mn-b-medium object-fit-cover w-100 h-max-20r"},x=["src"],V={__name:"CardBlogpost",props:{blogpost:{type:Object},user:{type:String},type:{type:String},hideDescription:{type:Boolean,default:!1}},setup(t){const i=g.useRouter(),n=t,l=e.computed(()=>n.blogpost.content.find(o=>o.type==="ImageUpload")),s=e.computed(()=>n.blogpost.content.find(o=>o.type==="Video")),r=e.computed(()=>n.blogpost.content.find(o=>o.type==="Textarea"));return(o,a)=>{var c;return e.openBlock(),e.createElementBlock("article",b,[e.createVNode(u.default,{class:e.normalizeClass({"mn-b-small pd-medium":t.type!=="short","flex-child-order-last flex-child mn-l-small":t.type==="short"}),entity:t.blogpost,entityType:"blogpost",user:t.user,owner:t.blogpost.owner,creator:t.blogpost.creator,date:t.blogpost.createdAt,actions:t.user&&t.user===t.blogpost.creator.target._id?[{to:{name:"Edit BlogPost",params:{url:t.blogpost.url}},label:"Edit"}]:null},null,8,["class","entity","user","owner","creator","date","actions"]),e.createElementVNode("section",p,[t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("div",y,[e.createVNode(m.default,{text:t.blogpost.name||"",maxLen:80,class:"h3 d-block",onClick:a[0]||(a[0]=E=>e.unref(i).push({name:"BlogPost",params:{url:t.blogpost.url}}))},null,8,["text"]),t.blogpost.status==="draft"?(e.openBlock(),e.createElementBlock("div",f,e.toDisplayString(t.blogpost.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),r.value&&r.value.content&&t.type!=="blogpostPage"&&!t.hideDescription?(e.openBlock(),e.createElementBlock("p",h,e.toDisplayString(r.value.content.slice(0,120))+"... ",1)):e.createCommentVNode("",!0),t.type==="blogpostPage"?(e.openBlock(),e.createElementBlock("h3",v,e.toDisplayString(t.blogpost.name),1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default")]),l.value&&l.value.content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("img",{key:0,src:(o.FILE_SERVER_URL||"")+l.value.content,alt:"Blog post image",class:"mn-b-medium object-fit-cover w-100 h-min-10r h-100"},null,8,k)):e.createCommentVNode("",!0),!((c=l.value)!=null&&c.content)&&s.value&&s.value.content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("video",B,[e.createElementVNode("source",{src:s.value.content,type:"video/mp4"},null,8,x),e.createTextVNode(" Your browser does not support the video tag. ")])):e.createCommentVNode("",!0),e.createVNode(d.default,{class:"pd-t-zero pd-medium",blogpost:t.blogpost,user:t.user},null,8,["blogpost","user"])])}}};exports.default=V;
@@ -2,7 +2,7 @@ import { computed as c, openBlock as o, createElementBlock as l, createVNode as
2
2
  import x from "../../../globals/components/blocks/CardHeader.vue.js";
3
3
  import k from "./FooterBlogpost.vue.js";
4
4
  import w from "../../../../components/Text/Text.vue.js";
5
- /* empty css */
5
+ /* empty css */
6
6
  import { useRouter as B } from "vue-router";
7
7
  const E = { class: "pos-relative bg-light radius-big flex-column flex" }, P = { class: "pd-t-zero pd-b-zero pd-medium" }, V = {
8
8
  key: 0,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("vue-router"),f=require("../../../../components/Select/Select.vue.cjs"),g=require("../../../../components/Feed/Feed.vue.cjs"),h=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),x=require("../../../icons/entities/IconFeatured.vue.cjs"),b=require("../../../icons/entities/IconPopular.vue.cjs"),w=require("../../../icons/entities/IconRecent.vue.cjs"),_=require("../../../icons/entities/IconFollowing.vue.cjs"),a=require("../../store/blogposts.cjs"),i=require("../../../auth/store/auth.cjs"),d=require("../../../organizations/store/organizations.cjs"),k=require("../../../organizations/store/memberships.cjs"),N={style:{"grid-template-columns":"2fr 4fr 2fr"},class:"cols-3 gap-thin pd-thin"},V={class:"align-self-start pos-sticky pos-t-0 w-100 bg-light radius-big pd-medium p-medium gap-thin flex-column flex-nowrap flex"},v={class:"pos-relative"},C={class:"bg-main t-black radius-big pd-medium pos-relative mn-b-thin flex-v-center t-left flex-nowrap flex"},y={class:"pos-relative flex-v-center flex-nowrap flex"},B=e.createElementVNode("span",{class:"mn-r-thin"},"Topics for ",-1),q={class:"align-self-start bg-light radius-big pd-medium"},E={class:"gap-thin flex-nowrap flex"},z=e.createElementVNode("p",{class:"t-medium mn-b-small"},"Popular Communities",-1),T={__name:"Community",setup(F){const o=m.useRoute(),s=m.useRouter();o.params.category==="popular"&&(a.state.sort.param="views"),o.params.category==="new"&&(a.state.sort.param="createdAt");const p=({membership:u,status:t,target:n},c,r)=>{k.mutations.handleMembershipUpdate(d.state.current,u,t,n,c,r)};return(u,t)=>{const n=e.resolveComponent("router-link"),c=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("ul",V,[e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="featured"},"cursor-pointer flex-v-center flex t-medium pd-thin radius-extra"]),onClick:t[0]||(t[0]=()=>{a.state.sort.param="createdAt",e.unref(s).push({name:"Blog",params:{category:"featured"}})})},[e.createVNode(x.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Featured ")],2),e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="popular"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:t[1]||(t[1]=()=>{a.state.sort.param="views",e.unref(s).push({name:"Blog",params:{category:"popular"}})})},[e.createVNode(b.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Popular ")],2),e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="new"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:t[2]||(t[2]=()=>{a.state.sort.param="createdAt",e.unref(s).push({name:"Blog",params:{category:"new"}})})},[e.createVNode(w.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Recent ")],2),i.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="following"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:t[3]||(t[3]=()=>{a.state.sort.param="createdAt",e.unref(s).push({name:"Blog",params:{category:"following"}})})},[e.createVNode(_.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Following ")],2)):e.createCommentVNode("",!0),e.createVNode(n,{to:{name:"Create BlogPost"},class:"button t-medium mn-t-small bg-main w-100"},{default:e.withCtx(()=>[e.createTextVNode(" Create Post ")]),_:1})]),e.createElementVNode("section",v,[e.createElementVNode("header",C,[e.createElementVNode("h3",y,[B,e.createVNode(f.default,{options:["today","week","month","year","all time"],select:a.state.filter.period,"onUpdate:select":t[4]||(t[4]=r=>a.state.filter.period=r),placeholder:"all time",class:"t-semi pos-relative w-max bg-main t-black pd-thin radius-medium h3 t-center br-solid br-2px br-black-transp-10"},null,8,["select"])])]),e.createVNode(c,null,{default:e.withCtx(({Component:r,route:l})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r),{ref:"page",key:l.query}))]),_:2},1024)]),_:1})]),e.createElementVNode("div",q,[e.createElementVNode("div",E,[z,i.state.user._id?(e.openBlock(),e.createBlock(n,{key:0,to:{name:"Create Organization"},class:"t-medium cursor-pointer hover-scale-1 radius-extra flex-center flex i-medium bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" + ")]),_:1})):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.createVNode(g.default,{states:{empty:{title:"No Organization Found",description:"Currently, there are no organization available."}},store:{read:r=>d.actions.read(r),state:d.state},options:{user:i.state.user._id,sort:"numberOfMemberships",contain:["blogposts"],limit:10}},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,l=>(e.openBlock(),e.createBlock(h.default,{key:l._id,organization:l,user:i.state.user,showProducts:!1,showRating:!1,showFeatured:!1,showFollowers:!1,onUpdateMembership:p,class:"mn-b-thin w-100 pd-0 bg-white radius-big o-hidden"},null,8,["organization","user"]))),128))]),_:1},8,["store","options"])]),_:1})])])}}};exports.default=T;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("vue-router"),f=require("../../../../components/Select/Select.vue2.cjs"),g=require("../../../../components/Feed/Feed.vue.cjs"),h=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),x=require("../../../icons/entities/IconFeatured.vue.cjs"),b=require("../../../icons/entities/IconPopular.vue.cjs"),w=require("../../../icons/entities/IconRecent.vue.cjs"),_=require("../../../icons/entities/IconFollowing.vue.cjs"),a=require("../../store/blogposts.cjs"),i=require("../../../auth/store/auth.cjs"),d=require("../../../organizations/store/organizations.cjs"),k=require("../../../organizations/store/memberships.cjs"),N={style:{"grid-template-columns":"2fr 4fr 2fr"},class:"cols-3 gap-thin pd-thin"},V={class:"align-self-start pos-sticky pos-t-0 w-100 bg-light radius-big pd-medium p-medium gap-thin flex-column flex-nowrap flex"},v={class:"pos-relative"},C={class:"bg-main t-black radius-big pd-medium pos-relative mn-b-thin flex-v-center t-left flex-nowrap flex"},y={class:"pos-relative flex-v-center flex-nowrap flex"},B=e.createElementVNode("span",{class:"mn-r-thin"},"Topics for ",-1),q={class:"align-self-start bg-light radius-big pd-medium"},E={class:"gap-thin flex-nowrap flex"},z=e.createElementVNode("p",{class:"t-medium mn-b-small"},"Popular Communities",-1),T={__name:"Community",setup(F){const o=m.useRoute(),s=m.useRouter();o.params.category==="popular"&&(a.state.sort.param="views"),o.params.category==="new"&&(a.state.sort.param="createdAt");const p=({membership:u,status:t,target:n},c,r)=>{k.mutations.handleMembershipUpdate(d.state.current,u,t,n,c,r)};return(u,t)=>{const n=e.resolveComponent("router-link"),c=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("ul",V,[e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="featured"},"cursor-pointer flex-v-center flex t-medium pd-thin radius-extra"]),onClick:t[0]||(t[0]=()=>{a.state.sort.param="createdAt",e.unref(s).push({name:"Blog",params:{category:"featured"}})})},[e.createVNode(x.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Featured ")],2),e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="popular"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:t[1]||(t[1]=()=>{a.state.sort.param="views",e.unref(s).push({name:"Blog",params:{category:"popular"}})})},[e.createVNode(b.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Popular ")],2),e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="new"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:t[2]||(t[2]=()=>{a.state.sort.param="createdAt",e.unref(s).push({name:"Blog",params:{category:"new"}})})},[e.createVNode(w.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Recent ")],2),i.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="following"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:t[3]||(t[3]=()=>{a.state.sort.param="createdAt",e.unref(s).push({name:"Blog",params:{category:"following"}})})},[e.createVNode(_.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Following ")],2)):e.createCommentVNode("",!0),e.createVNode(n,{to:{name:"Create BlogPost"},class:"button t-medium mn-t-small bg-main w-100"},{default:e.withCtx(()=>[e.createTextVNode(" Create Post ")]),_:1})]),e.createElementVNode("section",v,[e.createElementVNode("header",C,[e.createElementVNode("h3",y,[B,e.createVNode(f.default,{options:["today","week","month","year","all time"],select:a.state.filter.period,"onUpdate:select":t[4]||(t[4]=r=>a.state.filter.period=r),placeholder:"all time",class:"t-semi pos-relative w-max bg-main t-black pd-thin radius-medium h3 t-center br-solid br-2px br-black-transp-10"},null,8,["select"])])]),e.createVNode(c,null,{default:e.withCtx(({Component:r,route:l})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r),{ref:"page",key:l.query}))]),_:2},1024)]),_:1})]),e.createElementVNode("div",q,[e.createElementVNode("div",E,[z,i.state.user._id?(e.openBlock(),e.createBlock(n,{key:0,to:{name:"Create Organization"},class:"t-medium cursor-pointer hover-scale-1 radius-extra flex-center flex i-medium bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" + ")]),_:1})):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.createVNode(g.default,{states:{empty:{title:"No Organization Found",description:"Currently, there are no organization available."}},store:{read:r=>d.actions.read(r),state:d.state},options:{user:i.state.user._id,sort:"numberOfMemberships",contain:["blogposts"],limit:10}},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,l=>(e.openBlock(),e.createBlock(h.default,{key:l._id,organization:l,user:i.state.user,showProducts:!1,showRating:!1,showFeatured:!1,showFollowers:!1,onUpdateMembership:p,class:"mn-b-thin w-100 pd-0 bg-white radius-big o-hidden"},null,8,["organization","user"]))),128))]),_:1},8,["store","options"])]),_:1})])])}}};exports.default=T;
@@ -1,6 +1,6 @@
1
1
  import { resolveComponent as x, openBlock as n, createElementBlock as h, createElementVNode as t, normalizeClass as u, unref as s, createVNode as r, createTextVNode as l, createCommentVNode as w, withCtx as m, Transition as y, createBlock as _, resolveDynamicComponent as C, Fragment as B, renderList as $ } from "vue";
2
2
  import { useRoute as F, useRouter as z } from "vue-router";
3
- import N from "../../../../components/Select/Select.vue.js";
3
+ import N from "../../../../components/Select/Select.vue2.js";
4
4
  import P from "../../../../components/Feed/Feed.vue.js";
5
5
  import A from "../../../organizations/components/blocks/CardOrganization.vue.js";
6
6
  import M from "../../../icons/entities/IconFeatured.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */;/* empty css */const p=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs");;/* empty css */;/* empty css */require("axios");;/* empty css */const _=require("../blocks/CardBlogpost.vue.cjs"),n=require("../../store/blogposts.cjs"),f=require("../../../auth/store/auth.cjs"),b=require("vue-router");;/* empty css */const v=l=>(e.pushScopeId("data-v-bdf0e48a"),l=l(),e.popScopeId(),l),g={class:"flex-v-center flex-nowrap flex mn-b-medium"},h=v(()=>e.createElementVNode("h3",{class:"mn-r-medium"},"Blog",-1)),k={class:""},w={class:"flex-nowrap flex pd-t-zero pd-b-zero pd-big"},q=["onClick"],y=["onClick"],C={__name:"Community",async setup(l){let s,u;const i=b.useRouter();[s,u]=e.withAsyncContext(()=>n.read()),await s,u(),console.log(n.state),e.ref({title:"",content:"",categories:[]});const d=async t=>{window.confirm("Are you sure you want to delete this post?")&&(console.log(t),await n.remove(t))};let c=e.ref("all");const a=e.computed(()=>c.value==="all"?n.state.all:n.state.all.filter(t=>t.categories.includes(c.value)));return e.computed(()=>{for(let t of a.value)if(t.blocks&&t.blocks.length>0){const r=t.blocks.find(o=>o.type.name==="ImageUpload");if(r)return r.content}return null}),(t,r)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",g,[h,e.createElementVNode("button",{onClick:r[0]||(r[0]=o=>e.unref(i).push({name:"Create BlogPost"})),class:"t-white bg-second button-small button"},"+")]),e.createElementVNode("div",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,o=>(e.openBlock(),e.createBlock(_.default,{key:o._id,blogpost:o,owner:f.state.user._id,class:"mn-b-medium"},{default:e.withCtx(()=>[e.createElementVNode("div",w,[e.createElementVNode("button",{class:"mn-r-thin button-small w-100 button",onClick:m=>t.$router.push({path:"/community/posts/"+o.url+"/edit"})},"Edit",8,q),e.createElementVNode("button",{class:"button-small w-100 button",onClick:m=>d(o._id)},"Delete",8,y)])]),_:2},1032,["blogpost","owner"]))),128))])]))}},B=p.default(C,[["__scopeId","data-v-bdf0e48a"]]);exports.default=B;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */;/* empty css */const p=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs");;/* empty css */;/* empty css */require("axios");;/* empty css */const _=require("../blocks/CardBlogpost.vue.cjs"),n=require("../../store/blogposts.cjs"),f=require("../../../auth/store/auth.cjs"),b=require("vue-router");;/* empty css */const v=l=>(e.pushScopeId("data-v-bdf0e48a"),l=l(),e.popScopeId(),l),g={class:"flex-v-center flex-nowrap flex mn-b-medium"},h=v(()=>e.createElementVNode("h3",{class:"mn-r-medium"},"Blog",-1)),k={class:""},w={class:"flex-nowrap flex pd-t-zero pd-b-zero pd-big"},q=["onClick"],y=["onClick"],C={__name:"Community",async setup(l){let s,u;const i=b.useRouter();[s,u]=e.withAsyncContext(()=>n.read()),await s,u(),console.log(n.state),e.ref({title:"",content:"",categories:[]});const d=async t=>{window.confirm("Are you sure you want to delete this post?")&&(console.log(t),await n.remove(t))};let c=e.ref("all");const a=e.computed(()=>c.value==="all"?n.state.all:n.state.all.filter(t=>t.categories.includes(c.value)));return e.computed(()=>{for(let t of a.value)if(t.blocks&&t.blocks.length>0){const r=t.blocks.find(o=>o.type.name==="ImageUpload");if(r)return r.content}return null}),(t,r)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",g,[h,e.createElementVNode("button",{onClick:r[0]||(r[0]=o=>e.unref(i).push({name:"Create BlogPost"})),class:"t-white bg-second button-small button"},"+")]),e.createElementVNode("div",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,o=>(e.openBlock(),e.createBlock(_.default,{key:o._id,blogpost:o,owner:f.state.user._id,class:"mn-b-medium"},{default:e.withCtx(()=>[e.createElementVNode("div",w,[e.createElementVNode("button",{class:"mn-r-thin button-small w-100 button",onClick:m=>t.$router.push({path:"/community/posts/"+o.url+"/edit"})},"Edit",8,q),e.createElementVNode("button",{class:"button-small w-100 button",onClick:m=>d(o._id)},"Delete",8,y)])]),_:2},1032,["blogpost","owner"]))),128))])]))}},B=p.default(C,[["__scopeId","data-v-bdf0e48a"]]);exports.default=B;
@@ -1,9 +1,9 @@
1
1
  import { withAsyncContext as h, ref as u, computed as d, openBlock as r, createElementBlock as p, createElementVNode as o, unref as v, Fragment as w, renderList as g, createBlock as k, withCtx as y, pushScopeId as C, popScopeId as x } from "vue";
2
- /* empty css */
3
- /* empty css */
2
+ /* empty css */
3
+ /* empty css */
4
4
  import B from "../../../../../../_virtual/_plugin-vue_export-helper.js";
5
5
  /* empty css */
6
- /* empty css */
6
+ /* empty css */
7
7
  import "axios";
8
8
  /* empty css */
9
9
  import $ from "../blocks/CardBlogpost.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */const w=require("../../../constructor/components/sections/Constructor.vue.cjs"),V=require("../../../../components/Popup/Popup.vue.cjs");;/* empty css */;/* empty css */const N=require("../../../../components/FieldTags/BlockTags.vue.cjs"),B=require("../../../../components/Checkbox/Checkbox.vue.cjs"),y=require("../../../../components/Field/Field.vue.cjs"),P=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),C=require("../../../../components/Button/Button.vue.cjs"),f=require("vue-router"),n=require("../../store/blogposts.cjs"),i=require("../../../auth/store/auth.cjs"),x=require("../../../organizations/store/organizations.cjs"),q={class:"pd-thin"},E={style:{"min-height":"100%"},class:"w-100 bg-light pd-big radius-big"},T=e.createElementVNode("div",{class:"w-full h-full"},null,-1),z={key:0,class:"pd-thin pos-sticky pos-l-0 pos-b-0 w-100"},A={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},O=e.createElementVNode("h3",{class:"mn-b-small"},"Final Touches",-1),U=e.createElementVNode("h5",{class:"mn-b-thin"},"Add source:",-1),D=e.createElementVNode("h5",{class:"mn-b-thin"},"Add to public:",-1),M={key:0,class:"mn-b-thin"},S={key:1,class:"mn-b-medium br-grey-transp-25 br-2px br-solid pd-small radius-big"},R={__name:"CreateBlogPost",setup($){const s=f.useRoute(),u=f.useRouter();let t=e.ref(null),p=e.ref(null);const c=e.ref([]),r=e.ref(null);e.onMounted(async()=>{const o=await x.actions.read({user:i.state.user._id,postable:i.state.user._id,limit:100});if(p.value=o.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo})),s.params.url){const a=await n.read({user:i.state.user._id,url:s.params.url});t.value=a.pop()}else n.clean(),t.value=n.state.current;t.value.owner||(t.value.owner={target:i.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:i.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(r.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo})});const g=e.ref(""),m=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>m.value.filter(o=>o.text.toLowerCase().includes(g.value.toLowerCase()))),e.computed(()=>m.value.filter(o=>!c.value.some(a=>a.text===o.text)));const d=e.ref(!1);function h(){d.value=!0}function v(){d.value=!1}function b(){c.value.length>0&&c.value.map(o=>o.text),t.value.status="draft",t.value.name=t.value.content[0].content,s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function k(){r.value&&(t.value.owner={target:r.value._id,type:"organization"}),r.value||(t.value.creator.hidden=!1),r.value||(t.value.organization=t.value.creator),t.value.status="published",t.value.name=t.value.content[0].content,s.params.url?n.update(t.value).then(o=>{console.log(t.value),u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.error(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.error(o)})}function _(){confirm("Are you sure you want to delete this post?")&&n.remove(t.value._id).then(o=>{u.push({name:"User Blogposts",params:{_id:t.value.creator.target._id}})}).catch(o=>{console.log(o)})}return(o,a)=>(e.openBlock(),e.createElementBlock("article",q,[e.createElementVNode("section",E,[T,e.unref(t)?(e.openBlock(),e.createBlock(w.default,{key:0,content:e.unref(t).content,onUpdate:a[0]||(a[0]=l=>e.unref(t).content=l)},null,8,["content"])):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{name:"scaleIn"},{default:e.withCtx(()=>[e.unref(t)?(e.openBlock(),e.createElementBlock("section",z,[e.createElementVNode("div",A,[e.unref(s).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[1]||(a[1]=l=>_()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:a[2]||(a[2]=l=>b()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:a[3]||(a[3]=l=>h()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(V.default,{onClosePopup:v,isPopupOpen:d.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[O,e.createVNode(N.default,{onTagsChanged:a[4]||(a[4]=l=>e.unref(t).tags=l),tags:e.unref(t).tags,class:"mn-b-small"},null,8,["tags"]),U,e.createVNode(y.default,{field:e.unref(t).source,"onUpdate:field":a[5]||(a[5]=l=>e.unref(t).source=l),placeholder:"Add full link to the source",class:"mn-b-medium bg-light radius-medium pd-small"},null,8,["field"]),D,e.createVNode(P.default,{modelValue:r.value,"onUpdate:modelValue":a[6]||(a[6]=l=>r.value=l),options:e.unref(p),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-b-medium bg-light radius-medium pd-small"},null,8,["modelValue","options"]),r.value?(e.openBlock(),e.createElementBlock("h5",M,"Options:")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",S,[e.createVNode(B.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[7]||(a[7]=l=>e.unref(t).creator.hidden=l),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(C.default,{submit:k,callback:o.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])]),_:1},8,["isPopupOpen"])]))}};exports.default=R;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */const w=require("../../../constructor/components/sections/Constructor.vue.cjs"),V=require("../../../../components/Popup/Popup.vue2.cjs");;/* empty css */;/* empty css */const N=require("../../../../components/FieldTags/BlockTags.vue.cjs"),B=require("../../../../components/Checkbox/Checkbox.vue.cjs"),y=require("../../../../components/Field/Field.vue2.cjs"),P=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),C=require("../../../../components/Button/Button.vue2.cjs"),f=require("vue-router"),n=require("../../store/blogposts.cjs"),i=require("../../../auth/store/auth.cjs"),x=require("../../../organizations/store/organizations.cjs"),q={class:"pd-thin"},E={style:{"min-height":"100%"},class:"w-100 bg-light pd-big radius-big"},T=e.createElementVNode("div",{class:"w-full h-full"},null,-1),z={key:0,class:"pd-thin pos-sticky pos-l-0 pos-b-0 w-100"},A={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},O=e.createElementVNode("h3",{class:"mn-b-small"},"Final Touches",-1),U=e.createElementVNode("h5",{class:"mn-b-thin"},"Add source:",-1),D=e.createElementVNode("h5",{class:"mn-b-thin"},"Add to public:",-1),M={key:0,class:"mn-b-thin"},S={key:1,class:"mn-b-medium br-grey-transp-25 br-2px br-solid pd-small radius-big"},R={__name:"CreateBlogPost",setup($){const s=f.useRoute(),u=f.useRouter();let t=e.ref(null),p=e.ref(null);const c=e.ref([]),r=e.ref(null);e.onMounted(async()=>{const o=await x.actions.read({user:i.state.user._id,postable:i.state.user._id,limit:100});if(p.value=o.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo})),s.params.url){const a=await n.read({user:i.state.user._id,url:s.params.url});t.value=a.pop()}else n.clean(),t.value=n.state.current;t.value.owner||(t.value.owner={target:i.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:i.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(r.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo})});const g=e.ref(""),m=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>m.value.filter(o=>o.text.toLowerCase().includes(g.value.toLowerCase()))),e.computed(()=>m.value.filter(o=>!c.value.some(a=>a.text===o.text)));const d=e.ref(!1);function h(){d.value=!0}function v(){d.value=!1}function b(){c.value.length>0&&c.value.map(o=>o.text),t.value.status="draft",t.value.name=t.value.content[0].content,s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function k(){r.value&&(t.value.owner={target:r.value._id,type:"organization"}),r.value||(t.value.creator.hidden=!1),r.value||(t.value.organization=t.value.creator),t.value.status="published",t.value.name=t.value.content[0].content,s.params.url?n.update(t.value).then(o=>{console.log(t.value),u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.error(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.error(o)})}function _(){confirm("Are you sure you want to delete this post?")&&n.remove(t.value._id).then(o=>{u.push({name:"User Blogposts",params:{_id:t.value.creator.target._id}})}).catch(o=>{console.log(o)})}return(o,a)=>(e.openBlock(),e.createElementBlock("article",q,[e.createElementVNode("section",E,[T,e.unref(t)?(e.openBlock(),e.createBlock(w.default,{key:0,content:e.unref(t).content,onUpdate:a[0]||(a[0]=l=>e.unref(t).content=l)},null,8,["content"])):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{name:"scaleIn"},{default:e.withCtx(()=>[e.unref(t)?(e.openBlock(),e.createElementBlock("section",z,[e.createElementVNode("div",A,[e.unref(s).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[1]||(a[1]=l=>_()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:a[2]||(a[2]=l=>b()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:a[3]||(a[3]=l=>h()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(V.default,{onClosePopup:v,isPopupOpen:d.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[O,e.createVNode(N.default,{onTagsChanged:a[4]||(a[4]=l=>e.unref(t).tags=l),tags:e.unref(t).tags,class:"mn-b-small"},null,8,["tags"]),U,e.createVNode(y.default,{field:e.unref(t).source,"onUpdate:field":a[5]||(a[5]=l=>e.unref(t).source=l),placeholder:"Add full link to the source",class:"mn-b-medium bg-light radius-medium pd-small"},null,8,["field"]),D,e.createVNode(P.default,{modelValue:r.value,"onUpdate:modelValue":a[6]||(a[6]=l=>r.value=l),options:e.unref(p),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-b-medium bg-light radius-medium pd-small"},null,8,["modelValue","options"]),r.value?(e.openBlock(),e.createElementBlock("h5",M,"Options:")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",S,[e.createVNode(B.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[7]||(a[7]=l=>e.unref(t).creator.hidden=l),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(C.default,{submit:k,callback:o.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])]),_:1},8,["isPopupOpen"])]))}};exports.default=R;
@@ -1,14 +1,14 @@
1
1
  import { ref as r, onMounted as V, computed as w, openBlock as u, createElementBlock as m, createElementVNode as n, unref as l, createBlock as A, createCommentVNode as p, createVNode as i, Transition as U, withCtx as v, createTextVNode as z } from "vue";
2
2
  /* empty css */
3
3
  import D from "../../../constructor/components/sections/Constructor.vue.js";
4
- import N from "../../../../components/Popup/Popup.vue.js";
4
+ import N from "../../../../components/Popup/Popup.vue2.js";
5
5
  /* empty css */
6
6
  /* empty css */
7
7
  import O from "../../../../components/FieldTags/BlockTags.vue.js";
8
8
  import E from "../../../../components/Checkbox/Checkbox.vue.js";
9
- import L from "../../../../components/Field/Field.vue.js";
9
+ import L from "../../../../components/Field/Field.vue2.js";
10
10
  import M from "../../../../components/SelectMulti/SelectMulti.vue.js";
11
- import R from "../../../../components/Button/Button.vue.js";
11
+ import R from "../../../../components/Button/Button.vue2.js";
12
12
  import { useRoute as S, useRouter as F } from "vue-router";
13
13
  import { read as H, clean as j, state as q, update as k, create as y, remove as G } from "../../store/blogposts.js";
14
14
  import { state as f } from "../../../auth/store/auth.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const s=require("../../../../components/Slider/Slider.vue.cjs"),i=require("../blocks/CardBlogpost.vue.cjs"),l=require("../../store/blogposts.cjs"),r=require("../../../auth/store/auth.cjs");;/* empty css */const n={class:"pd-thin"},a={class:"bg-light radius-big pd-t-big pd-b-big"},c={class:"w-100 pd-b-small t-center flex-center flex"},u=e.createElementVNode("b",null,"Community",-1),d={__name:"HotPosts",setup(p){return(_,h)=>{const o=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",n,[e.createElementVNode("div",a,[e.createElementVNode("h2",c,[e.createTextVNode(" Discover Our "),e.createVNode(o,{to:{name:"Blog"},class:"transition-ease-in hover-bg-black hover-t-white transition-timing-1 hover-scale-0 bg-main cursor-pointer pd-thin pd-r-small pd-l-small mn-l-thin radius-extra flex flex-v-center"},{default:e.withCtx(()=>[u]),_:1})]),e.createVNode(s.default,{store:{read:t=>l.read(t)},options:{skip:0,limit:8,user:r.state.user._id,period:"year",category:"featured"},text:{messages:{en:{title:"No Blogposts Found",description:"Currently, there are no blogposts available."}}},class:"slider-hotpost"},{default:e.withCtx(({item:t})=>[(e.openBlock(),e.createBlock(i.default,{key:t._id,blogpost:t,user:r.state.user._id,hideDescription:!0,class:"bg-white flex flex-column h-35r"},null,8,["blogpost","user"]))]),_:1},8,["store","options"])])])}}};exports.default=d;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const s=require("../../../../components/Slider/Slider.vue.cjs"),i=require("../blocks/CardBlogpost.vue.cjs"),l=require("../../store/blogposts.cjs"),r=require("../../../auth/store/auth.cjs");;/* empty css */const n={class:"pd-thin"},a={class:"bg-light radius-big pd-t-big pd-b-big"},c={class:"w-100 pd-b-small t-center flex-center flex"},u=e.createElementVNode("b",null,"Community",-1),d={__name:"HotPosts",setup(p){return(_,h)=>{const o=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",n,[e.createElementVNode("div",a,[e.createElementVNode("h2",c,[e.createTextVNode(" Discover Our "),e.createVNode(o,{to:{name:"Blog"},class:"transition-ease-in hover-bg-black hover-t-white transition-timing-1 hover-scale-0 bg-main cursor-pointer pd-thin pd-r-small pd-l-small mn-l-thin radius-extra flex flex-v-center"},{default:e.withCtx(()=>[u]),_:1})]),e.createVNode(s.default,{store:{read:t=>l.read(t)},options:{skip:0,limit:8,user:r.state.user._id,period:"year",category:"featured"},text:{messages:{en:{title:"No Blogposts Found",description:"Currently, there are no blogposts available."}}},class:"slider-hotpost"},{default:e.withCtx(({item:t})=>[(e.openBlock(),e.createBlock(i.default,{key:t._id,blogpost:t,user:r.state.user._id,hideDescription:!0,class:"bg-white flex flex-column h-35r"},null,8,["blogpost","user"]))]),_:1},8,["store","options"])])])}}};exports.default=d;
@@ -1,8 +1,8 @@
1
1
  import { resolveComponent as n, openBlock as o, createElementBlock as a, createElementVNode as t, createTextVNode as c, createVNode as r, withCtx as s, createBlock as p } from "vue";
2
2
  /* empty css */
3
- /* empty css */
3
+ /* empty css */
4
4
  /* empty css */
5
- /* empty css */
5
+ /* empty css */
6
6
  /* empty css */
7
7
  /* empty css */
8
8
  import m from "../../../../components/Slider/Slider.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../../components/Field/Field.vue.cjs"),m={class:"mn-b-thin w-100 pd-medium bg-white radius-medium"},p=["innerHTML"],b={key:1,class:""},f=e.createElementVNode("p",{class:"t-center"},"Embeds from youtube.com, vimeo.com, soundcloud.com are allowed",-1),v={__name:"Embed",props:["label","value","prop"],emits:["input","updateBlock"],setup(t,{emit:a}){const o=e.ref(null),s=t,c=a;function i(d){return[/youtube\.com/,/facebook\.com/,/instagram\.com/,/twitter\.com/,/tiktok\.com/,/soundcloud\.com/,/vimeo\.com/,/reddit\.com/,/linkedin\.com/,/medium\.com/,/spotify\.com/].some(n=>n.test(d))}function r(){o.value&&i(o.value)?(c("input",o.value),c("updateBlock",s.prop,{content:o.value})):alert("Invalid embed code or source not allowed.")}return(d,l)=>(e.openBlock(),e.createElementBlock("div",m,[t.prop.content?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:t.prop.content,class:"flex-center flex"},null,8,p)):(e.openBlock(),e.createElementBlock("div",b,[e.createVNode(u.default,{field:o.value,"onUpdate:field":l[0]||(l[0]=n=>o.value=n),type:"textarea",placeholder:"Paste your embed code here",class:"w-100 br-solid br-1px br-black-transp-10 pd-medium radius-small mn-b-thin"},null,8,["field"]),e.createElementVNode("div",{class:"flex-v-center flex-nowrap flex gap-small"},[f,e.createElementVNode("button",{onClick:r,class:"button-small button"}," Save ")])]))]))}};exports.default=v;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../../components/Field/Field.vue2.cjs"),m={class:"mn-b-thin w-100 pd-medium bg-white radius-medium"},p=["innerHTML"],b={key:1,class:""},f=e.createElementVNode("p",{class:"t-center"},"Embeds from youtube.com, vimeo.com, soundcloud.com are allowed",-1),v={__name:"Embed",props:["label","value","prop"],emits:["input","updateBlock"],setup(t,{emit:a}){const o=e.ref(null),s=t,c=a;function i(d){return[/youtube\.com/,/facebook\.com/,/instagram\.com/,/twitter\.com/,/tiktok\.com/,/soundcloud\.com/,/vimeo\.com/,/reddit\.com/,/linkedin\.com/,/medium\.com/,/spotify\.com/].some(n=>n.test(d))}function r(){o.value&&i(o.value)?(c("input",o.value),c("updateBlock",s.prop,{content:o.value})):alert("Invalid embed code or source not allowed.")}return(d,l)=>(e.openBlock(),e.createElementBlock("div",m,[t.prop.content?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:t.prop.content,class:"flex-center flex"},null,8,p)):(e.openBlock(),e.createElementBlock("div",b,[e.createVNode(u.default,{field:o.value,"onUpdate:field":l[0]||(l[0]=n=>o.value=n),type:"textarea",placeholder:"Paste your embed code here",class:"w-100 br-solid br-1px br-black-transp-10 pd-medium radius-small mn-b-thin"},null,8,["field"]),e.createElementVNode("div",{class:"flex-v-center flex-nowrap flex gap-small"},[f,e.createElementVNode("button",{onClick:r,class:"button-small button"}," Save ")])]))]))}};exports.default=v;
@@ -1,5 +1,5 @@
1
1
  import { ref as p, openBlock as n, createElementBlock as c, createVNode as b, createElementVNode as s } from "vue";
2
- import f from "../../../../components/Field/Field.vue.js";
2
+ import f from "../../../../components/Field/Field.vue2.js";
3
3
  const v = { class: "mn-b-thin w-100 pd-medium bg-white radius-medium" }, k = ["innerHTML"], _ = {
4
4
  key: 1,
5
5
  class: ""
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("../../../../components/Chips/Chips.vue2.cjs"),y=require("../../../icons/navigation/IconEdit.vue.cjs"),C=require("../../../globals/components/blocks/CardHeader.vue.cjs");require("../../../community/store/reactions.cjs");const k=require("vue-router"),p={key:0,class:"o-hidden pos-relative bg-light mn-b-small w-100"},E=["src"],T=["src"],w={class:"w-max mn-r-thin pd-thin radius-small t-semi bg-main"},b={class:"t-semi"},B={key:0,class:"t-semi"},D={key:0,class:"t-semi uppercase"},U={key:1,class:"cursor-pointer mn-b-thin flex-nowrap flex w-100"},N={key:0,class:""},V={key:1,class:"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"},S={key:2,class:"mn-b-small p-big"},x={__name:"CardEvent",props:["event","user","short","type"],setup(t){e.ref(new Date),k.useRouter();const o=t;e.computed(()=>o.event.content.find(n=>n.type.name==="ImageUpload")),e.computed(()=>o.event.content.find(n=>n.type.name==="Textarea"));const u=e.computed(()=>{const n=new Date,s=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds()),r=new Date(o.event.date.start),a=Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds())-s;if(a<0)return"Finished";if(a===0)return"Starting Now";{const d=Math.floor(a/1e3),l=Math.floor(d/60),i=Math.floor(l/60),m=Math.floor(i/24);return m>0?`${m} days until event`:i>0?`${i} hours until event`:l>0?`${l} minutes until event`:`${d} seconds until event`}}),v=e.computed(()=>{const n=new Date(o.event.date.start),s={day:"2-digit",month:"2-digit"};return n.toLocaleDateString(void 0,s)}),h=e.computed(()=>{console.log(o.event.date.start),console.log(o.event.date.end);const n=new Date(o.event.date.start),s=new Date(o.event.date.end),r=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(n),c=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(s);return`${r}-${c}`}),f=e.computed(()=>{const n=o.event.name;return n.length>26?`${n.substring(0,22)}…`:n});return(n,s)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass([{"flex-nowrap flex-v-center flex":t.type==="short"},"pos-relative"])},[e.createVNode(C.default,{class:e.normalizeClass({"mn-b-small pd-medium":t.type!=="short","flex-child-order-last flex-child mn-l-small":t.type==="short"}),entity:t.event,entityType:"event",user:t.user,owner:t.event.owner,creator:t.event.creator,members:t.event.numberOfTickets,membersPhotos:t.event.participantsPhotos,type:t.type,dateFormatted:u.value},null,8,["class","entity","user","owner","creator","members","membersPhotos","type","dateFormatted"]),t.event.cover&&t.type!=="short"?(e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("img",{src:(n.FILE_SERVER_URL||"")+t.event.cover,alt:"Event image",class:"pos-relative z-index-1 d-block mn-auto h-20r"},null,8,E),e.createElementVNode("img",{src:(n.FILE_SERVER_URL||"")+t.event.cover,alt:"Event Background",class:"z-index-0 pos-absolute w-100 h-100 pos-t-0 pos-r-0",style:{transform:"scale(1.5)",filter:"blur(2rem)","-webkit-filter":"blur(2rem)"}},null,8,T)])):e.createCommentVNode("",!0),e.createElementVNode("section",{class:e.normalizeClass(["pos-relative w-100",{"pd-t-zero pd-medium":t.type!=="short"}])},[t.user===t.event.creator.target._id?(e.openBlock(),e.createBlock(y.default,{key:0,onClick:s[0]||(s[0]=e.withModifiers(r=>n.$router.push({name:"Edit Event",params:{url:t.event.url}}),["stop"])),class:"z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([{"mn-b-small":t.type!=="short"},"flex-v-center flex-nowrap flex"])},[e.createElementVNode("div",w,[e.createElementVNode("span",b,e.toDisplayString(v.value),1),t.type!=="short"?(e.openBlock(),e.createElementBlock("span",B," | "+e.toDisplayString(h.value),1)):e.createCommentVNode("",!0)]),t.type==="short"?(e.openBlock(),e.createElementBlock("span",D,e.toDisplayString(f.value),1)):e.createCommentVNode("",!0)],2),t.type!=="short"?(e.openBlock(),e.createElementBlock("div",U,[t.type!=="short"?(e.openBlock(),e.createElementBlock("h3",N,e.toDisplayString(t.event.name),1)):e.createCommentVNode("",!0),t.event.status==="draft"?(e.openBlock(),e.createElementBlock("div",V,e.toDisplayString(t.event.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.type!=="short"?(e.openBlock(),e.createElementBlock("p",S,e.toDisplayString(t.event.description),1)):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"default"),t.type!=="short"&&t.event.tags.length>0?(e.openBlock(),e.createBlock(g.default,{key:3,chips:t.event.tags},null,8,["chips"])):e.createCommentVNode("",!0)],2)],2))}};exports.default=x;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("../../../../components/Chips/Chips.vue.cjs"),y=require("../../../icons/navigation/IconEdit.vue.cjs"),C=require("../../../globals/components/blocks/CardHeader.vue.cjs");require("../../../community/store/reactions.cjs");const k=require("vue-router"),p={key:0,class:"o-hidden pos-relative bg-light mn-b-small w-100"},E=["src"],T=["src"],w={class:"w-max mn-r-thin pd-thin radius-small t-semi bg-main"},b={class:"t-semi"},B={key:0,class:"t-semi"},D={key:0,class:"t-semi uppercase"},U={key:1,class:"cursor-pointer mn-b-thin flex-nowrap flex w-100"},N={key:0,class:""},V={key:1,class:"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"},S={key:2,class:"mn-b-small p-big"},x={__name:"CardEvent",props:["event","user","short","type"],setup(t){e.ref(new Date),k.useRouter();const o=t;e.computed(()=>o.event.content.find(n=>n.type.name==="ImageUpload")),e.computed(()=>o.event.content.find(n=>n.type.name==="Textarea"));const u=e.computed(()=>{const n=new Date,s=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds()),r=new Date(o.event.date.start),a=Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds())-s;if(a<0)return"Finished";if(a===0)return"Starting Now";{const d=Math.floor(a/1e3),l=Math.floor(d/60),i=Math.floor(l/60),m=Math.floor(i/24);return m>0?`${m} days until event`:i>0?`${i} hours until event`:l>0?`${l} minutes until event`:`${d} seconds until event`}}),v=e.computed(()=>{const n=new Date(o.event.date.start),s={day:"2-digit",month:"2-digit"};return n.toLocaleDateString(void 0,s)}),h=e.computed(()=>{console.log(o.event.date.start),console.log(o.event.date.end);const n=new Date(o.event.date.start),s=new Date(o.event.date.end),r=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(n),c=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(s);return`${r}-${c}`}),f=e.computed(()=>{const n=o.event.name;return n.length>26?`${n.substring(0,22)}…`:n});return(n,s)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass([{"flex-nowrap flex-v-center flex":t.type==="short"},"pos-relative"])},[e.createVNode(C.default,{class:e.normalizeClass({"mn-b-small pd-medium":t.type!=="short","flex-child-order-last flex-child mn-l-small":t.type==="short"}),entity:t.event,entityType:"event",user:t.user,owner:t.event.owner,creator:t.event.creator,members:t.event.numberOfTickets,membersPhotos:t.event.participantsPhotos,type:t.type,dateFormatted:u.value},null,8,["class","entity","user","owner","creator","members","membersPhotos","type","dateFormatted"]),t.event.cover&&t.type!=="short"?(e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("img",{src:(n.FILE_SERVER_URL||"")+t.event.cover,alt:"Event image",class:"pos-relative z-index-1 d-block mn-auto h-20r"},null,8,E),e.createElementVNode("img",{src:(n.FILE_SERVER_URL||"")+t.event.cover,alt:"Event Background",class:"z-index-0 pos-absolute w-100 h-100 pos-t-0 pos-r-0",style:{transform:"scale(1.5)",filter:"blur(2rem)","-webkit-filter":"blur(2rem)"}},null,8,T)])):e.createCommentVNode("",!0),e.createElementVNode("section",{class:e.normalizeClass(["pos-relative w-100",{"pd-t-zero pd-medium":t.type!=="short"}])},[t.user===t.event.creator.target._id?(e.openBlock(),e.createBlock(y.default,{key:0,onClick:s[0]||(s[0]=e.withModifiers(r=>n.$router.push({name:"Edit Event",params:{url:t.event.url}}),["stop"])),class:"z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([{"mn-b-small":t.type!=="short"},"flex-v-center flex-nowrap flex"])},[e.createElementVNode("div",w,[e.createElementVNode("span",b,e.toDisplayString(v.value),1),t.type!=="short"?(e.openBlock(),e.createElementBlock("span",B," | "+e.toDisplayString(h.value),1)):e.createCommentVNode("",!0)]),t.type==="short"?(e.openBlock(),e.createElementBlock("span",D,e.toDisplayString(f.value),1)):e.createCommentVNode("",!0)],2),t.type!=="short"?(e.openBlock(),e.createElementBlock("div",U,[t.type!=="short"?(e.openBlock(),e.createElementBlock("h3",N,e.toDisplayString(t.event.name),1)):e.createCommentVNode("",!0),t.event.status==="draft"?(e.openBlock(),e.createElementBlock("div",V,e.toDisplayString(t.event.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.type!=="short"?(e.openBlock(),e.createElementBlock("p",S,e.toDisplayString(t.event.description),1)):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"default"),t.type!=="short"&&t.event.tags.length>0?(e.openBlock(),e.createBlock(g.default,{key:3,chips:t.event.tags},null,8,["chips"])):e.createCommentVNode("",!0)],2)],2))}};exports.default=x;
@@ -1,5 +1,5 @@
1
1
  import { ref as k, computed as l, openBlock as n, createElementBlock as i, normalizeClass as m, createVNode as x, createElementVNode as c, createCommentVNode as a, createBlock as w, withModifiers as D, toDisplayString as d, renderSlot as E } from "vue";
2
- import p from "../../../../components/Chips/Chips.vue2.js";
2
+ import p from "../../../../components/Chips/Chips.vue.js";
3
3
  import $ from "../../../icons/navigation/IconEdit.vue.js";
4
4
  import I from "../../../globals/components/blocks/CardHeader.vue.js";
5
5
  import "../../../community/store/reactions.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("../../../../../../node_modules/vue-qrcode-reader/dist/vue-qrcode-reader.cjs"),P=require("../../../../components/Popup/Popup.vue.cjs"),g=require("../../../../components/Button/Button.vue.cjs"),S=require("../../store/tickets.cjs");;/* empty css */const w=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),x=r=>(e.pushScopeId("data-v-20750f79"),r=r(),e.popScopeId(),r),E=x(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Scan QR Code",-1)),q={class:"h-max"},T={__name:"ButtonCheck",emits:"qrcodecheck",setup(r,{emit:i}){const u=i,n=e.ref(!1),a=e.ref("");function l(){n.value=!0}function d(){n.value=!1}const s=e.ref(null);async function p(t){s.value=t.map(o=>o.rawValue);try{const o=s.value[0]||"";if(!o)throw new Error("Troubles with qrcode reading");const c=await S.actions.update({_id:o,status:"used",check:!0});alert("Ticket checked. And it's all right!")}catch{alert("Ticket is not found, already used or deactivated!")}u("qrcodecheck")}function m(t){a.value=`[${t.name}]: `,t.name==="NotAllowedError"?a.value+="you need to grant camera access permission":t.name==="NotFoundError"?a.value+="no camera on this device":t.name==="NotSupportedError"?a.value+="secure context required (HTTPS, localhost)":t.name==="NotReadableError"?a.value+="is the camera already in use?":t.name==="OverconstrainedError"?a.value+="installed cameras are not suitable":t.name==="StreamApiNotSupportedError"?a.value+="Stream API is not supported in this browser":t.name==="InsecureContextError"?a.value+="Camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.":a.value+=t.message}function f(t,o){for(const c of t){const{boundingBox:{x:h,y:v,width:_,height:b}}=c;o.lineWidth=2,o.strokeStyle="#007bff",o.strokeRect(h,v,_,b)}}return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(g.default,{submit:l,class:"bg-main button-small radius-extra button"},{default:e.withCtx(()=>[e.createTextVNode(" Check Tickets ")]),_:1}),e.createVNode(P.default,{title:"Добавить участника",onClosePopup:d,isPopupOpen:n.value,class:"w-max-30r h-max-30r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[E,e.createElementVNode("div",q,[e.createVNode(e.unref(k.QrcodeStream),{track:f,onDetect:p,onError:m})])]),_:1},8,["isPopupOpen"])]))}},N=w.default(T,[["__scopeId","data-v-20750f79"]]);exports.default=N;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("../../../../../../node_modules/vue-qrcode-reader/dist/vue-qrcode-reader.cjs"),P=require("../../../../components/Popup/Popup.vue2.cjs"),g=require("../../../../components/Button/Button.vue2.cjs"),S=require("../../store/tickets.cjs");;/* empty css */const w=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),x=r=>(e.pushScopeId("data-v-20750f79"),r=r(),e.popScopeId(),r),E=x(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Scan QR Code",-1)),q={class:"h-max"},T={__name:"ButtonCheck",emits:"qrcodecheck",setup(r,{emit:i}){const u=i,n=e.ref(!1),a=e.ref("");function l(){n.value=!0}function d(){n.value=!1}const s=e.ref(null);async function p(t){s.value=t.map(o=>o.rawValue);try{const o=s.value[0]||"";if(!o)throw new Error("Troubles with qrcode reading");const c=await S.actions.update({_id:o,status:"used",check:!0});alert("Ticket checked. And it's all right!")}catch{alert("Ticket is not found, already used or deactivated!")}u("qrcodecheck")}function m(t){a.value=`[${t.name}]: `,t.name==="NotAllowedError"?a.value+="you need to grant camera access permission":t.name==="NotFoundError"?a.value+="no camera on this device":t.name==="NotSupportedError"?a.value+="secure context required (HTTPS, localhost)":t.name==="NotReadableError"?a.value+="is the camera already in use?":t.name==="OverconstrainedError"?a.value+="installed cameras are not suitable":t.name==="StreamApiNotSupportedError"?a.value+="Stream API is not supported in this browser":t.name==="InsecureContextError"?a.value+="Camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.":a.value+=t.message}function f(t,o){for(const c of t){const{boundingBox:{x:h,y:v,width:_,height:b}}=c;o.lineWidth=2,o.strokeStyle="#007bff",o.strokeRect(h,v,_,b)}}return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(g.default,{submit:l,class:"bg-main button-small radius-extra button"},{default:e.withCtx(()=>[e.createTextVNode(" Check Tickets ")]),_:1}),e.createVNode(P.default,{title:"Добавить участника",onClosePopup:d,isPopupOpen:n.value,class:"w-max-30r h-max-30r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[E,e.createElementVNode("div",q,[e.createVNode(e.unref(k.QrcodeStream),{track:f,onDetect:p,onError:m})])]),_:1},8,["isPopupOpen"])]))}},N=w.default(T,[["__scopeId","data-v-20750f79"]]);exports.default=N;
@@ -1,7 +1,7 @@
1
1
  import { ref as s, openBlock as w, createElementBlock as E, createVNode as n, withCtx as l, createTextVNode as S, createElementVNode as u, unref as g, pushScopeId as T, popScopeId as C } from "vue";
2
2
  import { QrcodeStream as y } from "../../../../../../node_modules/vue-qrcode-reader/dist/vue-qrcode-reader.js";
3
- import N from "../../../../components/Popup/Popup.vue.js";
4
- import B from "../../../../components/Button/Button.vue.js";
3
+ import N from "../../../../components/Popup/Popup.vue2.js";
4
+ import B from "../../../../components/Button/Button.vue2.js";
5
5
  import { actions as I } from "../../store/tickets.js";
6
6
  /* empty css */
7
7
  import q from "../../../../../../_virtual/_plugin-vue_export-helper.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),p=require("../../../../components/Button/Button.vue.cjs");require("../../../auth/store/auth.cjs");const s=require("../../store/tickets.cjs");;/* empty css */const g=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),k={__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(o,{emit:c}){const n=c,t=o,u=async()=>{t.hasTicket?await l(t.targetId):await d(t.targetId)};async function d(i){try{const e={type:t.type,target:i,user:t.userId},r=await s.actions.create(e);n("updateTicket",{ticket:r,hasTicket:!0,targetId:t.targetId})}catch(e){throw console.log(e),e}}async function l(i){const e={type:t.type,target:i,user:t.userId};try{const r=await s.actions.delete(e);n("updateTicket",{ticket:r,hasTicket:!1,targetId:t.targetId})}catch(r){throw console.log(r),r}}return(i,e)=>(a.openBlock(),a.createBlock(p.default,{submit:u,class:"bg-main button-small radius-extra button"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(o.hasTicket?"Leave":"Join"),1)]),_:1}))}},y=g.default(k,[["__scopeId","data-v-872ff798"]]);exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),p=require("../../../../components/Button/Button.vue2.cjs");require("../../../auth/store/auth.cjs");const s=require("../../store/tickets.cjs");;/* empty css */const g=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),k={__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(o,{emit:c}){const n=c,t=o,u=async()=>{t.hasTicket?await l(t.targetId):await d(t.targetId)};async function d(i){try{const e={type:t.type,target:i,user:t.userId},r=await s.actions.create(e);n("updateTicket",{ticket:r,hasTicket:!0,targetId:t.targetId})}catch(e){throw console.log(e),e}}async function l(i){const e={type:t.type,target:i,user:t.userId};try{const r=await s.actions.delete(e);n("updateTicket",{ticket:r,hasTicket:!1,targetId:t.targetId})}catch(r){throw console.log(r),r}}return(i,e)=>(a.openBlock(),a.createBlock(p.default,{submit:u,class:"bg-main button-small radius-extra button"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(o.hasTicket?"Leave":"Join"),1)]),_:1}))}},y=g.default(k,[["__scopeId","data-v-872ff798"]]);exports.default=y;
@@ -1,5 +1,5 @@
1
1
  import { openBlock as d, createBlock as g, withCtx as m, createTextVNode as l, toDisplayString as k } from "vue";
2
- import f from "../../../../components/Button/Button.vue.js";
2
+ import f from "../../../../components/Button/Button.vue2.js";
3
3
  import "../../../auth/store/auth.js";
4
4
  import { actions as c } from "../../store/tickets.js";
5
5
  /* empty css */