@ozdao/prometheus-framework 0.2.252 → 0.2.254

Sign up to get free protection for your applications and to get access to all the features.
Files changed (310) hide show
  1. package/dist/auth.server.js +298 -14
  2. package/dist/auth.server.mjs +298 -14
  3. package/dist/builder.js +4 -4
  4. package/dist/builder.mjs +4 -4
  5. package/dist/chats.server.js +110 -0
  6. package/dist/chats.server.mjs +111 -0
  7. package/dist/community.server.js +38 -21
  8. package/dist/community.server.mjs +38 -21
  9. package/dist/events.server.js +38 -18
  10. package/dist/events.server.mjs +38 -17
  11. package/dist/files.server.js +12 -3
  12. package/dist/files.server.mjs +12 -3
  13. package/dist/gallery.server.js +17 -4
  14. package/dist/gallery.server.mjs +17 -4
  15. package/dist/organizations.server.js +43 -26
  16. package/dist/organizations.server.mjs +43 -26
  17. package/dist/products.server.js +49 -23
  18. package/dist/products.server.mjs +49 -22
  19. package/dist/prometheus-framework/src/modules/auth/auth.client.cjs +15 -3
  20. package/dist/prometheus-framework/src/modules/auth/auth.client.cjs.map +1 -1
  21. package/dist/prometheus-framework/src/modules/auth/auth.client.js +16 -4
  22. package/dist/prometheus-framework/src/modules/auth/auth.client.js.map +1 -1
  23. package/dist/prometheus-framework/src/modules/auth/views/components/blocks/CardUser.vue.cjs +95 -0
  24. package/dist/prometheus-framework/src/modules/auth/views/components/blocks/CardUser.vue.cjs.map +1 -0
  25. package/dist/prometheus-framework/src/modules/auth/views/components/blocks/CardUser.vue.js +95 -0
  26. package/dist/prometheus-framework/src/modules/auth/views/components/blocks/CardUser.vue.js.map +1 -0
  27. package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue.cjs +284 -0
  28. package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue.cjs.map +1 -0
  29. package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue.js +284 -0
  30. package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue.js.map +1 -0
  31. package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue2.cjs +2 -0
  32. package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue2.cjs.map +1 -0
  33. package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue2.js +2 -0
  34. package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue2.js.map +1 -0
  35. package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileBlogposts.vue.cjs +85 -0
  36. package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileBlogposts.vue.cjs.map +1 -0
  37. package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js +85 -0
  38. package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js.map +1 -0
  39. package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue.cjs +176 -0
  40. package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue.cjs.map +1 -0
  41. package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue.js +176 -0
  42. package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue.js.map +1 -0
  43. package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue2.cjs +2 -0
  44. package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue2.cjs.map +1 -0
  45. package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue2.js +2 -0
  46. package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue2.js.map +1 -0
  47. package/dist/prometheus-framework/src/modules/auth/views/components/sections/FeaturedUsers.vue.cjs +114 -0
  48. package/dist/prometheus-framework/src/modules/auth/views/components/sections/FeaturedUsers.vue.cjs.map +1 -0
  49. package/dist/prometheus-framework/src/modules/auth/views/components/sections/FeaturedUsers.vue.js +114 -0
  50. package/dist/prometheus-framework/src/modules/auth/views/components/sections/FeaturedUsers.vue.js.map +1 -0
  51. package/dist/prometheus-framework/src/modules/auth/views/components/sections/ProfileCompletion.vue.cjs +72 -0
  52. package/dist/prometheus-framework/src/modules/auth/views/components/sections/ProfileCompletion.vue.cjs.map +1 -0
  53. package/dist/prometheus-framework/src/modules/auth/views/components/sections/ProfileCompletion.vue.js +72 -0
  54. package/dist/prometheus-framework/src/modules/auth/views/components/sections/ProfileCompletion.vue.js.map +1 -0
  55. package/dist/prometheus-framework/src/modules/auth/views/router/users.cjs +97 -0
  56. package/dist/prometheus-framework/src/modules/auth/views/router/users.cjs.map +1 -0
  57. package/dist/prometheus-framework/src/modules/auth/views/router/users.js +97 -0
  58. package/dist/prometheus-framework/src/modules/auth/views/router/users.js.map +1 -0
  59. package/dist/prometheus-framework/src/modules/auth/views/store/users.cjs +95 -0
  60. package/dist/prometheus-framework/src/modules/auth/views/store/users.cjs.map +1 -0
  61. package/dist/prometheus-framework/src/modules/auth/views/store/users.js +95 -0
  62. package/dist/prometheus-framework/src/modules/auth/views/store/users.js.map +1 -0
  63. package/dist/prometheus-framework/src/modules/backoffice/backoffice.client.cjs +32 -2
  64. package/dist/prometheus-framework/src/modules/backoffice/backoffice.client.cjs.map +1 -1
  65. package/dist/prometheus-framework/src/modules/backoffice/backoffice.client.js +32 -2
  66. package/dist/prometheus-framework/src/modules/backoffice/backoffice.client.js.map +1 -1
  67. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +2 -2
  68. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs.map +1 -1
  69. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +2 -2
  70. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js.map +1 -1
  71. package/dist/prometheus-framework/src/modules/chats/chats.client.cjs +31 -0
  72. package/dist/prometheus-framework/src/modules/chats/chats.client.cjs.map +1 -0
  73. package/dist/prometheus-framework/src/modules/chats/chats.client.js +31 -0
  74. package/dist/prometheus-framework/src/modules/chats/chats.client.js.map +1 -0
  75. package/dist/prometheus-framework/src/modules/community/community.client.cjs +42 -7
  76. package/dist/prometheus-framework/src/modules/community/community.client.cjs.map +1 -1
  77. package/dist/prometheus-framework/src/modules/community/community.client.js +59 -24
  78. package/dist/prometheus-framework/src/modules/community/community.client.js.map +1 -1
  79. package/dist/prometheus-framework/src/modules/community/router/blogposts.cjs +68 -70
  80. package/dist/prometheus-framework/src/modules/community/router/blogposts.cjs.map +1 -1
  81. package/dist/prometheus-framework/src/modules/community/router/blogposts.js +68 -70
  82. package/dist/prometheus-framework/src/modules/community/router/blogposts.js.map +1 -1
  83. package/dist/prometheus-framework/src/modules/gallery/gallery.client.cjs +26 -3
  84. package/dist/prometheus-framework/src/modules/gallery/gallery.client.cjs.map +1 -1
  85. package/dist/prometheus-framework/src/modules/gallery/gallery.client.js +27 -4
  86. package/dist/prometheus-framework/src/modules/gallery/gallery.client.js.map +1 -1
  87. package/dist/prometheus-framework/src/modules/gallery/router/gallery.router.cjs +2 -2
  88. package/dist/prometheus-framework/src/modules/gallery/router/gallery.router.cjs.map +1 -1
  89. package/dist/prometheus-framework/src/modules/gallery/router/gallery.router.js +2 -2
  90. package/dist/prometheus-framework/src/modules/gallery/router/gallery.router.js.map +1 -1
  91. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs.map +1 -1
  93. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
  94. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js.map +1 -1
  95. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  96. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs.map +1 -1
  97. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
  98. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js.map +1 -1
  99. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +2 -2
  100. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs.map +1 -1
  101. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
  102. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js.map +1 -1
  103. package/dist/prometheus-framework/src/modules/orders/orders.client.cjs +4 -1
  104. package/dist/prometheus-framework/src/modules/orders/orders.client.cjs.map +1 -1
  105. package/dist/prometheus-framework/src/modules/orders/orders.client.js +4 -1
  106. package/dist/prometheus-framework/src/modules/orders/orders.client.js.map +1 -1
  107. package/dist/prometheus-framework/src/modules/orders/store/testimonials.cjs +63 -0
  108. package/dist/prometheus-framework/src/modules/orders/store/testimonials.cjs.map +1 -0
  109. package/dist/prometheus-framework/src/modules/orders/store/testimonials.js +63 -0
  110. package/dist/prometheus-framework/src/modules/orders/store/testimonials.js.map +1 -0
  111. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +2 -2
  112. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs.map +1 -1
  113. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +2 -2
  114. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js.map +1 -1
  115. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
  116. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs.map +1 -1
  117. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
  118. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js.map +1 -1
  119. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  120. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs.map +1 -1
  121. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
  122. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js.map +1 -1
  123. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  124. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs.map +1 -1
  125. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
  126. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js.map +1 -1
  127. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  128. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs.map +1 -1
  129. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +1 -1
  130. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js.map +1 -1
  131. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs.map +1 -1
  132. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js.map +1 -1
  133. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +2 -2
  134. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs.map +1 -1
  135. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
  136. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js.map +1 -1
  137. package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +60 -11
  138. package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs.map +1 -1
  139. package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +95 -46
  140. package/dist/prometheus-framework/src/modules/organizations/organizations.client.js.map +1 -1
  141. package/dist/prometheus-framework/src/modules/organizations/router/organizations.cjs +6 -10
  142. package/dist/prometheus-framework/src/modules/organizations/router/organizations.cjs.map +1 -1
  143. package/dist/prometheus-framework/src/modules/organizations/router/organizations.js +8 -12
  144. package/dist/prometheus-framework/src/modules/organizations/router/organizations.js.map +1 -1
  145. package/dist/prometheus-framework/src/modules/pages/pages.client.cjs +500 -500
  146. package/dist/prometheus-framework/src/modules/pages/pages.client.js +500 -500
  147. package/dist/prometheus-framework/src/modules/products/components/layouts/Marketplace.vue.cjs +179 -0
  148. package/dist/prometheus-framework/src/modules/products/components/layouts/Marketplace.vue.cjs.map +1 -0
  149. package/dist/prometheus-framework/src/modules/products/components/layouts/Marketplace.vue.js +179 -0
  150. package/dist/prometheus-framework/src/modules/products/components/layouts/Marketplace.vue.js.map +1 -0
  151. package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.cjs +64 -0
  152. package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.cjs.map +1 -0
  153. package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.js +64 -0
  154. package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.js.map +1 -0
  155. package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.cjs +2 -2
  156. package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.js +2 -2
  157. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +2 -2
  158. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs.map +1 -1
  159. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +2 -2
  160. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js.map +1 -1
  161. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  162. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs.map +1 -1
  163. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  164. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js.map +1 -1
  165. package/dist/prometheus-framework/src/modules/products/components/sections/Filters.vue.cjs +156 -0
  166. package/dist/prometheus-framework/src/modules/products/components/sections/Filters.vue.cjs.map +1 -0
  167. package/dist/prometheus-framework/src/modules/products/components/sections/Filters.vue.js +157 -0
  168. package/dist/prometheus-framework/src/modules/products/components/sections/Filters.vue.js.map +1 -0
  169. package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue.cjs +1 -1
  170. package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue.cjs.map +1 -1
  171. package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue.js +1 -1
  172. package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue.js.map +1 -1
  173. package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.cjs +1 -1
  174. package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.cjs.map +1 -1
  175. package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.js +1 -1
  176. package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.js.map +1 -1
  177. package/dist/prometheus-framework/src/modules/products/products.client.cjs +72 -7
  178. package/dist/prometheus-framework/src/modules/products/products.client.cjs.map +1 -1
  179. package/dist/prometheus-framework/src/modules/products/products.client.js +114 -49
  180. package/dist/prometheus-framework/src/modules/products/products.client.js.map +1 -1
  181. package/dist/prometheus-framework/src/modules/products/router/marketplace.router.cjs +46 -0
  182. package/dist/prometheus-framework/src/modules/products/router/marketplace.router.cjs.map +1 -0
  183. package/dist/prometheus-framework/src/modules/products/router/marketplace.router.js +46 -0
  184. package/dist/prometheus-framework/src/modules/products/router/marketplace.router.js.map +1 -0
  185. package/dist/prometheus-framework/src/modules/products/router/products.router.cjs +79 -36
  186. package/dist/prometheus-framework/src/modules/products/router/products.router.cjs.map +1 -1
  187. package/dist/prometheus-framework/src/modules/products/router/products.router.js +78 -35
  188. package/dist/prometheus-framework/src/modules/products/router/products.router.js.map +1 -1
  189. package/dist/prometheus-framework/src/modules/products/store/marketplace.cjs +57 -0
  190. package/dist/prometheus-framework/src/modules/products/store/marketplace.cjs.map +1 -0
  191. package/dist/prometheus-framework/src/modules/products/store/marketplace.js +57 -0
  192. package/dist/prometheus-framework/src/modules/products/store/marketplace.js.map +1 -0
  193. package/dist/prometheus-framework/src/modules/reports/reports.client.cjs +21 -2
  194. package/dist/prometheus-framework/src/modules/reports/reports.client.cjs.map +1 -1
  195. package/dist/prometheus-framework/src/modules/reports/reports.client.js +20 -1
  196. package/dist/prometheus-framework/src/modules/reports/reports.client.js.map +1 -1
  197. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
  198. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.cjs.map +1 -1
  199. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js +1 -1
  200. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js.map +1 -1
  201. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.cjs +2 -2
  202. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.cjs.map +1 -1
  203. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.js +2 -2
  204. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.js.map +1 -1
  205. package/dist/prometheus-framework/src/modules/spots/components/pages/Spot.vue.cjs +2 -2
  206. package/dist/prometheus-framework/src/modules/spots/components/pages/Spot.vue.cjs.map +1 -1
  207. package/dist/prometheus-framework/src/modules/spots/components/pages/Spot.vue.js +2 -2
  208. package/dist/prometheus-framework/src/modules/spots/components/pages/Spot.vue.js.map +1 -1
  209. package/dist/reports.server.js +21 -8
  210. package/dist/reports.server.mjs +21 -8
  211. package/package.json +9 -1
  212. package/src/builder/webpack/webpack.config.client.js +2 -2
  213. package/src/builder/webpack/webpack.config.server.js +1 -1
  214. package/src/builder/webpack/webpack.config.spa.js +1 -1
  215. package/src/builder/webpack/webpack.config.ssr.js +1 -1
  216. package/src/modules/auth/auth.client.js +16 -3
  217. package/src/modules/auth/auth.server.js +22 -1
  218. package/src/modules/{users → auth/controllers}/routes/users.routes.js +1 -1
  219. package/src/modules/auth/controllers/services/auth.service.js +0 -1
  220. package/src/modules/{users → auth/views}/components/pages/Profile.vue +1 -1
  221. package/src/modules/{users → auth/views}/components/pages/ProfileEdit.vue +2 -2
  222. package/src/modules/{users → auth/views}/components/sections/FeaturedUsers.vue +2 -2
  223. package/src/modules/auth/views/router/users.js +79 -0
  224. package/src/modules/backoffice/backoffice.client.js +53 -11
  225. package/src/modules/backoffice/router/backoffice.js +29 -2
  226. package/src/modules/chats/chats.client.js +48 -0
  227. package/src/modules/chats/chats.server.js +32 -0
  228. package/src/modules/community/community.client.js +56 -10
  229. package/src/modules/community/community.server.js +35 -14
  230. package/src/modules/community/models/comment.model.js +7 -7
  231. package/src/modules/community/models/reaction.model.js +5 -5
  232. package/src/modules/community/router/blogposts.js +55 -57
  233. package/src/modules/events/events.server.js +37 -16
  234. package/src/modules/events/models/ticket.model.js +6 -6
  235. package/src/modules/files/files.server.js +17 -7
  236. package/src/modules/gallery/gallery.client.js +44 -8
  237. package/src/modules/gallery/gallery.server.js +28 -9
  238. package/src/modules/gallery/router/gallery.router.js +2 -2
  239. package/src/modules/orders/components/pages/OrderCreate.vue +1 -1
  240. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +1 -1
  241. package/src/modules/orders/components/sections/FormAddCustomer.vue +2 -2
  242. package/src/modules/orders/orders.client.js +4 -1
  243. package/src/modules/orders/orders.server.js +1 -0
  244. package/src/modules/organizations/components/blocks/CardDepartment.vue +1 -1
  245. package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -1
  246. package/src/modules/organizations/components/pages/Department.vue +1 -1
  247. package/src/modules/organizations/components/pages/DepartmentEdit.vue +1 -1
  248. package/src/modules/organizations/components/pages/Members.vue +1 -1
  249. package/src/modules/organizations/components/pages/Organization.vue +1 -1
  250. package/src/modules/organizations/components/sections/MembersAdd.vue +2 -2
  251. package/src/modules/organizations/controllers/organizations.controller.js +0 -2
  252. package/src/modules/organizations/models/department.model.js +7 -7
  253. package/src/modules/organizations/models/membership.model.js +5 -5
  254. package/src/modules/organizations/organizations.client.js +71 -16
  255. package/src/modules/organizations/organizations.server.js +43 -18
  256. package/src/modules/organizations/router/organizations.js +6 -13
  257. package/src/modules/{marketplace → products}/components/layouts/Marketplace.vue +20 -19
  258. package/src/modules/{marketplace → products}/components/pages/Catalog.vue +5 -5
  259. package/src/modules/products/components/pages/Products.vue +2 -2
  260. package/src/modules/products/components/sections/FilterProducts.vue +1 -1
  261. package/src/modules/{marketplace → products}/components/sections/Filters.vue +12 -15
  262. package/src/modules/products/components/sections/HeroRecommendation.vue +1 -1
  263. package/src/modules/products/components/sections/PopularProducts.vue +1 -1
  264. package/src/modules/products/models/category.model.js +3 -3
  265. package/src/modules/products/models/product.model.js +7 -7
  266. package/src/modules/products/products.client.js +93 -25
  267. package/src/modules/products/products.server.js +47 -16
  268. package/src/modules/products/router/marketplace.router.js +38 -0
  269. package/src/modules/products/router/products.router.js +72 -32
  270. package/src/modules/reports/models/report.model.js +4 -4
  271. package/src/modules/reports/reports.client.js +35 -14
  272. package/src/modules/reports/reports.server.js +27 -8
  273. package/src/modules/spots/components/layouts/Spots.vue +1 -1
  274. package/src/modules/spots/components/pages/Map.vue +1 -1
  275. package/src/modules/spots/components/pages/Spot.vue +1 -1
  276. package/src/modules/backoffice/router/admin.js +0 -51
  277. package/src/modules/landing/components/pages/404.vue +0 -3
  278. package/src/modules/landing/components/pages/Farming.vue +0 -226
  279. package/src/modules/landing/components/pages/Governance.vue +0 -144
  280. package/src/modules/landing/components/pages/Home.vue +0 -51
  281. package/src/modules/landing/components/pages/Hotel.vue +0 -43
  282. package/src/modules/landing/router/landing.js +0 -39
  283. package/src/modules/legal/components/pages/Legal.vue +0 -62
  284. package/src/modules/legal/components/pages/legal/Cookies.vue +0 -370
  285. package/src/modules/legal/components/pages/legal/EULA.vue +0 -2145
  286. package/src/modules/legal/components/pages/legal/Privacy.vue +0 -4284
  287. package/src/modules/legal/components/pages/legal/Terms.vue +0 -1283
  288. package/src/modules/legal/legal.client.js +0 -18
  289. package/src/modules/legal/router/legal.js +0 -59
  290. package/src/modules/marketplace/router/marketplace.js +0 -54
  291. package/src/modules/users/router/users.js +0 -90
  292. package/src/modules/users/users.client.js +0 -22
  293. package/src/modules/users/users.server.js +0 -13
  294. /package/src/modules/{users → auth/controllers}/middlewares/visitor.logger.js +0 -0
  295. /package/src/modules/{users/controllers/users.controller.js → auth/controllers/services/users.service.js} +0 -0
  296. /package/src/modules/{users → auth}/models/request.model.js +0 -0
  297. /package/src/modules/{users → auth}/models/user.model.js +0 -0
  298. /package/src/modules/{users → auth}/models/visitor.model.js +0 -0
  299. /package/src/modules/{users → auth/views}/components/blocks/CardUser.vue +0 -0
  300. /package/src/modules/{users → auth/views}/components/pages/ProfileBlogposts.vue +0 -0
  301. /package/src/modules/{users → auth/views}/components/pages/ProfileComments.vue +0 -0
  302. /package/src/modules/{users → auth/views}/components/pages/ProfileLikes.vue +0 -0
  303. /package/src/modules/{users → auth/views}/components/sections/ProfileCompletion.vue +0 -0
  304. /package/src/modules/{users → auth/views}/router/account.js +0 -0
  305. /package/src/modules/{users → auth/views}/store/users.js +0 -0
  306. /package/src/modules/{projects/controller → governance/controllers/factories}/projects.controller.js +0 -0
  307. /package/src/modules/{projects → governance/controllers}/routes/projects.routes.js +0 -0
  308. /package/src/modules/{projects → governance}/models/project.model.js +0 -0
  309. /package/src/modules/{projects → governance/views}/store/projects.js +0 -0
  310. /package/src/modules/{marketplace → products}/store/marketplace.js +0 -0
@@ -0,0 +1,179 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const vueRouter = require("vue-router");
5
+ const vueI18n = require("vue-i18n");
6
+ const BlockFilter = require("../../../globals/views/components/blocks/BlockFilter.vue.cjs");
7
+ const marketplace = require("../../store/marketplace.cjs");
8
+ const globals = require("../../../globals/views/store/globals.cjs");
9
+ const categories = require("../../store/categories.cjs");
10
+ const _hoisted_1 = {
11
+ style: { "min-height": "100%" },
12
+ class: "h-min-100 pd-thin"
13
+ };
14
+ const _hoisted_2 = { class: "pd-semi radius-big bg-light mn-b-small" };
15
+ const _hoisted_3 = { class: "" };
16
+ const _hoisted_4 = { class: "gap-thin cols-2-1_3" };
17
+ const _hoisted_5 = { class: "desktop-only radius-big o-hidden" };
18
+ const _hoisted_6 = { class: "rows-1 gap-thin" };
19
+ const _sfc_main = {
20
+ __name: "Marketplace",
21
+ setup(__props) {
22
+ const route = vueRouter.useRoute();
23
+ const router = vueRouter.useRouter();
24
+ const localPosition = vue.ref({
25
+ city: null,
26
+ state: null,
27
+ country: null
28
+ });
29
+ vue.ref(null);
30
+ function denormalizeUrlParam(param) {
31
+ return param.replace(/-/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
32
+ }
33
+ function normalizeUrlParam(param) {
34
+ return param.toLowerCase().replace(/ /g, "-").replace(/[^a-z0-9-]/g, "");
35
+ }
36
+ if (route.params) {
37
+ let newState = {
38
+ country: denormalizeUrlParam(route.params.country),
39
+ state: denormalizeUrlParam(route.params.state),
40
+ city: denormalizeUrlParam(route.params.city)
41
+ };
42
+ localPosition.value = newState;
43
+ }
44
+ if (route.query) {
45
+ const query = route.query;
46
+ marketplace.state.filter.selected.categories = query.categories ? query.categories.split(",") : [];
47
+ marketplace.state.filter.selected.prices = query.prices ? query.prices.split(",") : [];
48
+ marketplace.state.filter.selected.delivery = query.delivery ? query.delivery.split(",") : [];
49
+ }
50
+ if (route.query.sortParam) marketplace.state.sort.param = route.query.sortParam;
51
+ if (route.query.sortOrder) marketplace.state.sort.order = route.query.sortOrder;
52
+ vue.onMounted(async () => {
53
+ let options = {
54
+ status: "published"
55
+ };
56
+ let categoriesFilter = await categories.actions.fetchCategories(options);
57
+ categoriesFilter = categoriesFilter.map((category) => ({
58
+ value: category.url,
59
+ label: category.name
60
+ }));
61
+ const index = marketplace.state.filter.options.findIndex((option) => option.value === "categories");
62
+ const categoryOption = {
63
+ title: "Categories",
64
+ value: "categories",
65
+ options: categoriesFilter
66
+ };
67
+ if (index !== -1) {
68
+ marketplace.state.filter.options[index] = categoryOption;
69
+ } else {
70
+ marketplace.state.filter.options.unshift(categoryOption);
71
+ }
72
+ });
73
+ vue.watch(() => marketplace.state.sort, (newSortValue, oldSortValue) => {
74
+ let query = { ...route.query };
75
+ query.sortParam = newSortValue.param;
76
+ query.sortOrder = newSortValue.order;
77
+ router.replace({ query });
78
+ }, { deep: true });
79
+ vue.watch(() => marketplace.state.filter.selected, (newFilterValue, oldFilterValue) => {
80
+ const query = { ...route.query };
81
+ Object.keys(oldFilterValue).forEach((key) => {
82
+ if (query[key]) {
83
+ delete query[key];
84
+ }
85
+ });
86
+ const newQueryValues = Object.fromEntries(
87
+ Object.entries(newFilterValue).filter(([key, value]) => Array.isArray(value) && value.length > 0).map(([key, value]) => [key, value.join(",")])
88
+ );
89
+ delete query.options;
90
+ Object.assign(query, newQueryValues);
91
+ router.replace({ query });
92
+ }, { deep: true });
93
+ vue.watch(() => globals.state.position, (newPosition) => {
94
+ const currentRoute = { ...router.currentRoute.value };
95
+ let newParams = {
96
+ country: normalizeUrlParam(newPosition.country),
97
+ state: normalizeUrlParam(newPosition.state),
98
+ city: normalizeUrlParam(newPosition.city)
99
+ };
100
+ currentRoute.params = newParams;
101
+ router.replace(currentRoute);
102
+ }, { deep: true });
103
+ const text = {
104
+ locale: "en",
105
+ messages: {
106
+ en: {
107
+ meta: {
108
+ title: "Marketplace – Shop Our Wide Selection of Quality Weed for Delivery",
109
+ description: "Browse our marketplace of top-grade weed strains and choose from a variety of delivery options. Order now and have your favorite strains delivered straight to your door. Safe, fast, and reliable."
110
+ }
111
+ },
112
+ ru: {
113
+ meta: {
114
+ title: "Маркетплейс – Выбирайте из нашего ассортимента качественной травки для доставки",
115
+ description: "Маркетплейс – Изучите наши продукты высокого качества и выбирайте из различных вариантов доставки. Закажите сейчас и получите свои любимые сорта на дом. Безопасно, быстро и надежно."
116
+ }
117
+ }
118
+ }
119
+ };
120
+ vueI18n.useI18n(text);
121
+ return (_ctx, _cache) => {
122
+ const _component_router_view = vue.resolveComponent("router-view");
123
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
124
+ vue.createElementVNode("header", _hoisted_2, [
125
+ vue.createElementVNode("h2", _hoisted_3, [
126
+ _cache[3] || (_cache[3] = vue.createElementVNode("span", { class: "" }, "Weed in ", -1)),
127
+ localPosition.value.city || localPosition.value.state || localPosition.value.country ? (vue.openBlock(), vue.createElementBlock("span", {
128
+ key: 0,
129
+ onClick: _cache[0] || (_cache[0] = (a) => {
130
+ globals.state.isOpenLocationPopup = true;
131
+ }),
132
+ class: "t-main t-semi cursor-pointer"
133
+ }, [
134
+ localPosition.value.city ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
135
+ vue.createTextVNode(vue.toDisplayString(localPosition.value.city) + ", ", 1)
136
+ ], 64)) : vue.createCommentVNode("", true),
137
+ localPosition.value.state ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
138
+ vue.createTextVNode(vue.toDisplayString(localPosition.value.state) + ", ", 1)
139
+ ], 64)) : vue.createCommentVNode("", true),
140
+ localPosition.value.country ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
141
+ vue.createTextVNode(vue.toDisplayString(localPosition.value.country), 1)
142
+ ], 64)) : vue.createCommentVNode("", true)
143
+ ])) : (vue.openBlock(), vue.createElementBlock("span", {
144
+ key: 1,
145
+ onClick: _cache[1] || (_cache[1] = (a) => {
146
+ globals.state.isOpenLocationPopup = true;
147
+ }),
148
+ class: "h2 pd-l-small pd-r-small pd-t-micro pd-b-micro d-inline-block t-semi radius-extra bg-main t-black cursor-pointer"
149
+ }, " The World "))
150
+ ])
151
+ ]),
152
+ vue.createElementVNode("div", _hoisted_4, [
153
+ vue.createElementVNode("div", _hoisted_5, [
154
+ vue.createVNode(BlockFilter.default, {
155
+ filter: marketplace.state.filter,
156
+ "onUpdate:filter": _cache[2] || (_cache[2] = ($event) => marketplace.state.filter = $event),
157
+ options: marketplace.state.filter.options,
158
+ class: "h-100 w-100 pd-small bg-light"
159
+ }, null, 8, ["filter", "options"])
160
+ ]),
161
+ vue.createElementVNode("div", _hoisted_6, [
162
+ vue.createVNode(_component_router_view, null, {
163
+ default: vue.withCtx(({ Component, route: route2 }) => [
164
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(Component), {
165
+ ref: "page",
166
+ key: route2,
167
+ localPosition: localPosition.value
168
+ }, null, 8, ["localPosition"]))
169
+ ]),
170
+ _: 1
171
+ })
172
+ ])
173
+ ])
174
+ ]);
175
+ };
176
+ }
177
+ };
178
+ exports.default = _sfc_main;
179
+ //# sourceMappingURL=Marketplace.vue.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Marketplace.vue.cjs","sources":["../../../../../../../src/modules/products/components/layouts/Marketplace.vue"],"sourcesContent":["<template>\n\t<div style=\"min-height: 100%;\" class=\"h-min-100 pd-thin\">\n\t\t<header class=\"pd-semi radius-big bg-light mn-b-small\">\n \t<h2 class=\"\">\n \t\t<span class=\"\">Weed in </span>\n\n \t\t<span \n \t\t\tv-if=\"localPosition.city || localPosition.state || localPosition.country\"\n \t\t\t@click=\"a => { globals.state.isOpenLocationPopup = true }\" \n \t\t\tclass=\"t-main t-semi cursor-pointer \"\n \t\t>\n \t\t\t\t<template v-if=\"localPosition.city\">{{localPosition.city}}, </template>\n \t\t\t\t<template v-if=\"localPosition.state\">{{localPosition.state}}, </template>\n \t\t\t\t<template v-if=\"localPosition.country\">{{localPosition.country}}</template>\n \t\t</span>\n\n \t\t<span v-else @click=\"a => { globals.state.isOpenLocationPopup = true }\" class=\"h2 pd-l-small pd-r-small pd-t-micro pd-b-micro d-inline-block t-semi radius-extra bg-main t-black cursor-pointer\">\n\t\t\t\t\t\tThe World\n \t\t</span>\n \t</h2>\n\t\t</header>\n\n\t\t<div class=\"gap-thin \tcols-2-1_3\">\n\t\t\t<div class=\"desktop-only radius-big o-hidden\">\n\t <BlockFilter\n v-model:filter=\"marketplace.state.filter\"\n :options=\"marketplace.state.filter.options\"\n class=\"h-100 w-100 pd-small bg-light\"\n />\n </div>\n\t\t\t<!-- Catalog wrapper -->\n\t\t\t<div class=\"rows-1 gap-thin\">\n\t\t\t\t<router-view v-slot=\"{ Component, route }\">\n\t\t\t\t\t<component ref=\"page\" :key=\"route\" :localPosition=\"localPosition\" :is=\"Component\" />\n\t\t\t\t</router-view>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n\n<script setup=\"props\">\n\t// Import libs\n\timport { computed, onMounted, watch, ref } from 'vue'\n\timport { useRoute, useRouter,onBeforeRouteLeave } from 'vue-router'\n\timport { useI18n } from 'vue-i18n'\n\n\timport BlockFilter from '@pf/src/modules/globals/views/components/blocks/BlockFilter.vue'\n\n\timport * as marketplace from '@pf/src/modules/products/store/marketplace';\n\timport * as globals from '@pf/src/modules/globals/views/store/globals'\n import * as categories from '@pf/src/modules/products/store/categories';\n\n\t// Accessing router and store\n\tconst route = useRoute()\n\tconst router = useRouter()\n\n\tconst localPosition = ref({\n\t\tcity: null,\n\t\tstate: null,\n\t\tcountry: null\n\t});\n\n\tconst desktopFilters = ref(null)\n\n\tfunction denormalizeUrlParam(param) {\n\t return param\n\t .replace(/-/g, ' ') // Замена дефисов на пробелы\n\t .replace(/\\b\\w/g, l => l.toUpperCase()); // Преобразование первой буквы каждого слова в заглавную\n\t}\n\n\tfunction normalizeUrlParam(param) {\n\t return param\n\t .toLowerCase()\n\t .replace(/ /g, '-')\n\t .replace(/[^a-z0-9-]/g, '');\n\t}\n\n\tif (route.params) {\n // Загружаем новые значения из параметров маршрута в состояние\n let newState = {\n country: denormalizeUrlParam(route.params.country),\n state: denormalizeUrlParam(route.params.state),\n city: denormalizeUrlParam(route.params.city),\n };\n\n\t // Обновляем глобальное состояние\n\t localPosition.value = newState;\n\t}\n\n\tif (route.query) {\n\t \tconst query = route.query;\n\n\t\tmarketplace.state.filter.selected.categories = query.categories ? query.categories.split(',') : [];\n\t\tmarketplace.state.filter.selected.prices = query.prices ? query.prices.split(',') : [];\n\t\tmarketplace.state.filter.selected.delivery = query.delivery ? query.delivery.split(',') : [];\n\t}\n\n\tif (route.query.sortParam) marketplace.state.sort.param = route.query.sortParam\n\tif (route.query.sortOrder) marketplace.state.sort.order = route.query.sortOrder\n\n\tonMounted(async () => {\n\t let options = {\n status: 'published'\n }\n\n let categoriesFilter = await categories.actions.fetchCategories(options);\n\n categoriesFilter = categoriesFilter.map(category => ({\n value: category.url,\n label: category.name\n }));\n\n const index = marketplace.state.filter.options.findIndex(option => option.value === 'categories');\n\n const categoryOption = {\n title: 'Categories',\n value: 'categories',\n options: categoriesFilter\n };\n\n if (index !== -1) {\n marketplace.state.filter.options[index] = categoryOption;\n } else {\n marketplace.state.filter.options.unshift(categoryOption);\n }\n\t})\n\n\twatch(() => marketplace.state.sort, (newSortValue, oldSortValue) => {\n\t\tlet query = { ...route.query}\n\t\t\n\t\tquery.sortParam = newSortValue.param\n\t\tquery.sortOrder = newSortValue.order\n\t \n\t // replace the current route\n\t router.replace({ query });\n\t}, { deep: true });\n\n\n\twatch(() => marketplace.state.filter.selected, (newFilterValue, oldFilterValue) => {\n\t // Переводим фильтр в формат query\n\t const query = { ...route.query };\n\n\t // Удаляем старые значения фильтра из query\n\t Object.keys(oldFilterValue).forEach(key => {\n\t if (query[key]) {\n\t delete query[key];\n\t }\n\t });\n\n\t // Добавляем новые значения фильтра в query\n\t const newQueryValues = Object.fromEntries(\n\t Object.entries(newFilterValue)\n\t .filter(([key, value]) => Array.isArray(value) && value.length > 0)\n\t .map(([key, value]) => [key, value.join(',')])\n\t );\n\n\t delete query.options;\n\t Object.assign(query, newQueryValues);\n\n\t // Обновляем маршрут с новым query\n\t router.replace({ query });\n\t}, { deep: true })\n\n\twatch(() => globals.state.position, (newPosition) => {\n\t // get the current route\n\t const currentRoute = { ...router.currentRoute.value };\n\t \n\t // create new parameters based on globals state position\n\t let newParams = {\n\t country: normalizeUrlParam(newPosition.country),\n\t state: normalizeUrlParam(newPosition.state),\n\t city: normalizeUrlParam(newPosition.city),\n\t };\n\t \n\t // update route params\n\t currentRoute.params = newParams;\n\t \n\t // replace the current route\n\t router.replace(currentRoute);\n\t}, { deep: true });\n\n const text = {\n locale: 'en',\n messages: {\n en: {\n\t \tmeta: {\n title: \"Marketplace – Shop Our Wide Selection of Quality Weed for Delivery\",\n description: \"Browse our marketplace of top-grade weed strains and choose from a variety of delivery options. Order now and have your favorite strains delivered straight to your door. Safe, fast, and reliable.\",\n }\n },\n ru: {\n\t meta: {\n title: \"Маркетплейс – Выбирайте из нашего ассортимента качественной травки для доставки\",\n description: \"Маркетплейс – Изучите наши продукты высокого качества и выбирайте из различных вариантов доставки. Закажите сейчас и получите свои любимые сорта на дом. Безопасно, быстро и надежно.\",\n }\n }\n }\n }\n\n \tconst { t } = useI18n(text)\n</script>\n\n<style lang=\"scss\">\n\n\n</style>\n"],"names":["useRoute","useRouter","ref","marketplace.state","onMounted","categories.actions","watch","globals.state","useI18n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsDC,UAAM,QAAQA,UAAAA,SAAU;AACxB,UAAM,SAASC,UAAAA,UAAW;AAE1B,UAAM,gBAAgBC,IAAAA,IAAI;AAAA,MACzB,MAAM;AAAA,MACN,OAAO;AAAA,MACP,SAAS;AAAA,IACX,CAAE;AAEsBA,QAAAA,IAAI,IAAI;AAE/B,aAAS,oBAAoB,OAAO;AAClC,aAAO,MACJ,QAAQ,MAAM,GAAG,EACjB,QAAQ,SAAS,OAAK,EAAE,YAAa,CAAA;AAAA,IACzC;AAED,aAAS,kBAAkB,OAAO;AAChC,aAAO,MACJ,YAAa,EACb,QAAQ,MAAM,GAAG,EACjB,QAAQ,eAAe,EAAE;AAAA,IAC7B;AAED,QAAI,MAAM,QAAQ;AAEf,UAAI,WAAW;AAAA,QACb,SAAS,oBAAoB,MAAM,OAAO,OAAO;AAAA,QACjD,OAAO,oBAAoB,MAAM,OAAO,KAAK;AAAA,QAC7C,MAAM,oBAAoB,MAAM,OAAO,IAAI;AAA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AAAA,YACP,aAAa;AAAA,UACd;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAEaC,YAAAA,QAAQ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,179 @@
1
+ import { ref, onMounted, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, Fragment, createTextVNode, toDisplayString, createCommentVNode, createVNode, withCtx, createBlock, resolveDynamicComponent } from "vue";
2
+ import { useRoute, useRouter } from "vue-router";
3
+ import { useI18n } from "vue-i18n";
4
+ import _sfc_main$1 from "../../../globals/views/components/blocks/BlockFilter.vue.js";
5
+ import { state } from "../../store/marketplace.js";
6
+ import { state as state$1 } from "../../../globals/views/store/globals.js";
7
+ import { actions } from "../../store/categories.js";
8
+ const _hoisted_1 = {
9
+ style: { "min-height": "100%" },
10
+ class: "h-min-100 pd-thin"
11
+ };
12
+ const _hoisted_2 = { class: "pd-semi radius-big bg-light mn-b-small" };
13
+ const _hoisted_3 = { class: "" };
14
+ const _hoisted_4 = { class: "gap-thin cols-2-1_3" };
15
+ const _hoisted_5 = { class: "desktop-only radius-big o-hidden" };
16
+ const _hoisted_6 = { class: "rows-1 gap-thin" };
17
+ const _sfc_main = {
18
+ __name: "Marketplace",
19
+ setup(__props) {
20
+ const route = useRoute();
21
+ const router = useRouter();
22
+ const localPosition = ref({
23
+ city: null,
24
+ state: null,
25
+ country: null
26
+ });
27
+ ref(null);
28
+ function denormalizeUrlParam(param) {
29
+ return param.replace(/-/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
30
+ }
31
+ function normalizeUrlParam(param) {
32
+ return param.toLowerCase().replace(/ /g, "-").replace(/[^a-z0-9-]/g, "");
33
+ }
34
+ if (route.params) {
35
+ let newState = {
36
+ country: denormalizeUrlParam(route.params.country),
37
+ state: denormalizeUrlParam(route.params.state),
38
+ city: denormalizeUrlParam(route.params.city)
39
+ };
40
+ localPosition.value = newState;
41
+ }
42
+ if (route.query) {
43
+ const query = route.query;
44
+ state.filter.selected.categories = query.categories ? query.categories.split(",") : [];
45
+ state.filter.selected.prices = query.prices ? query.prices.split(",") : [];
46
+ state.filter.selected.delivery = query.delivery ? query.delivery.split(",") : [];
47
+ }
48
+ if (route.query.sortParam) state.sort.param = route.query.sortParam;
49
+ if (route.query.sortOrder) state.sort.order = route.query.sortOrder;
50
+ onMounted(async () => {
51
+ let options = {
52
+ status: "published"
53
+ };
54
+ let categoriesFilter = await actions.fetchCategories(options);
55
+ categoriesFilter = categoriesFilter.map((category) => ({
56
+ value: category.url,
57
+ label: category.name
58
+ }));
59
+ const index = state.filter.options.findIndex((option) => option.value === "categories");
60
+ const categoryOption = {
61
+ title: "Categories",
62
+ value: "categories",
63
+ options: categoriesFilter
64
+ };
65
+ if (index !== -1) {
66
+ state.filter.options[index] = categoryOption;
67
+ } else {
68
+ state.filter.options.unshift(categoryOption);
69
+ }
70
+ });
71
+ watch(() => state.sort, (newSortValue, oldSortValue) => {
72
+ let query = { ...route.query };
73
+ query.sortParam = newSortValue.param;
74
+ query.sortOrder = newSortValue.order;
75
+ router.replace({ query });
76
+ }, { deep: true });
77
+ watch(() => state.filter.selected, (newFilterValue, oldFilterValue) => {
78
+ const query = { ...route.query };
79
+ Object.keys(oldFilterValue).forEach((key) => {
80
+ if (query[key]) {
81
+ delete query[key];
82
+ }
83
+ });
84
+ const newQueryValues = Object.fromEntries(
85
+ Object.entries(newFilterValue).filter(([key, value]) => Array.isArray(value) && value.length > 0).map(([key, value]) => [key, value.join(",")])
86
+ );
87
+ delete query.options;
88
+ Object.assign(query, newQueryValues);
89
+ router.replace({ query });
90
+ }, { deep: true });
91
+ watch(() => state$1.position, (newPosition) => {
92
+ const currentRoute = { ...router.currentRoute.value };
93
+ let newParams = {
94
+ country: normalizeUrlParam(newPosition.country),
95
+ state: normalizeUrlParam(newPosition.state),
96
+ city: normalizeUrlParam(newPosition.city)
97
+ };
98
+ currentRoute.params = newParams;
99
+ router.replace(currentRoute);
100
+ }, { deep: true });
101
+ const text = {
102
+ locale: "en",
103
+ messages: {
104
+ en: {
105
+ meta: {
106
+ title: "Marketplace – Shop Our Wide Selection of Quality Weed for Delivery",
107
+ description: "Browse our marketplace of top-grade weed strains and choose from a variety of delivery options. Order now and have your favorite strains delivered straight to your door. Safe, fast, and reliable."
108
+ }
109
+ },
110
+ ru: {
111
+ meta: {
112
+ title: "Маркетплейс – Выбирайте из нашего ассортимента качественной травки для доставки",
113
+ description: "Маркетплейс – Изучите наши продукты высокого качества и выбирайте из различных вариантов доставки. Закажите сейчас и получите свои любимые сорта на дом. Безопасно, быстро и надежно."
114
+ }
115
+ }
116
+ }
117
+ };
118
+ useI18n(text);
119
+ return (_ctx, _cache) => {
120
+ const _component_router_view = resolveComponent("router-view");
121
+ return openBlock(), createElementBlock("div", _hoisted_1, [
122
+ createElementVNode("header", _hoisted_2, [
123
+ createElementVNode("h2", _hoisted_3, [
124
+ _cache[3] || (_cache[3] = createElementVNode("span", { class: "" }, "Weed in ", -1)),
125
+ localPosition.value.city || localPosition.value.state || localPosition.value.country ? (openBlock(), createElementBlock("span", {
126
+ key: 0,
127
+ onClick: _cache[0] || (_cache[0] = (a) => {
128
+ state$1.isOpenLocationPopup = true;
129
+ }),
130
+ class: "t-main t-semi cursor-pointer"
131
+ }, [
132
+ localPosition.value.city ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
133
+ createTextVNode(toDisplayString(localPosition.value.city) + ", ", 1)
134
+ ], 64)) : createCommentVNode("", true),
135
+ localPosition.value.state ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
136
+ createTextVNode(toDisplayString(localPosition.value.state) + ", ", 1)
137
+ ], 64)) : createCommentVNode("", true),
138
+ localPosition.value.country ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
139
+ createTextVNode(toDisplayString(localPosition.value.country), 1)
140
+ ], 64)) : createCommentVNode("", true)
141
+ ])) : (openBlock(), createElementBlock("span", {
142
+ key: 1,
143
+ onClick: _cache[1] || (_cache[1] = (a) => {
144
+ state$1.isOpenLocationPopup = true;
145
+ }),
146
+ class: "h2 pd-l-small pd-r-small pd-t-micro pd-b-micro d-inline-block t-semi radius-extra bg-main t-black cursor-pointer"
147
+ }, " The World "))
148
+ ])
149
+ ]),
150
+ createElementVNode("div", _hoisted_4, [
151
+ createElementVNode("div", _hoisted_5, [
152
+ createVNode(_sfc_main$1, {
153
+ filter: state.filter,
154
+ "onUpdate:filter": _cache[2] || (_cache[2] = ($event) => state.filter = $event),
155
+ options: state.filter.options,
156
+ class: "h-100 w-100 pd-small bg-light"
157
+ }, null, 8, ["filter", "options"])
158
+ ]),
159
+ createElementVNode("div", _hoisted_6, [
160
+ createVNode(_component_router_view, null, {
161
+ default: withCtx(({ Component, route: route2 }) => [
162
+ (openBlock(), createBlock(resolveDynamicComponent(Component), {
163
+ ref: "page",
164
+ key: route2,
165
+ localPosition: localPosition.value
166
+ }, null, 8, ["localPosition"]))
167
+ ]),
168
+ _: 1
169
+ })
170
+ ])
171
+ ])
172
+ ]);
173
+ };
174
+ }
175
+ };
176
+ export {
177
+ _sfc_main as default
178
+ };
179
+ //# sourceMappingURL=Marketplace.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Marketplace.vue.js","sources":["../../../../../../../src/modules/products/components/layouts/Marketplace.vue"],"sourcesContent":["<template>\n\t<div style=\"min-height: 100%;\" class=\"h-min-100 pd-thin\">\n\t\t<header class=\"pd-semi radius-big bg-light mn-b-small\">\n \t<h2 class=\"\">\n \t\t<span class=\"\">Weed in </span>\n\n \t\t<span \n \t\t\tv-if=\"localPosition.city || localPosition.state || localPosition.country\"\n \t\t\t@click=\"a => { globals.state.isOpenLocationPopup = true }\" \n \t\t\tclass=\"t-main t-semi cursor-pointer \"\n \t\t>\n \t\t\t\t<template v-if=\"localPosition.city\">{{localPosition.city}}, </template>\n \t\t\t\t<template v-if=\"localPosition.state\">{{localPosition.state}}, </template>\n \t\t\t\t<template v-if=\"localPosition.country\">{{localPosition.country}}</template>\n \t\t</span>\n\n \t\t<span v-else @click=\"a => { globals.state.isOpenLocationPopup = true }\" class=\"h2 pd-l-small pd-r-small pd-t-micro pd-b-micro d-inline-block t-semi radius-extra bg-main t-black cursor-pointer\">\n\t\t\t\t\t\tThe World\n \t\t</span>\n \t</h2>\n\t\t</header>\n\n\t\t<div class=\"gap-thin \tcols-2-1_3\">\n\t\t\t<div class=\"desktop-only radius-big o-hidden\">\n\t <BlockFilter\n v-model:filter=\"marketplace.state.filter\"\n :options=\"marketplace.state.filter.options\"\n class=\"h-100 w-100 pd-small bg-light\"\n />\n </div>\n\t\t\t<!-- Catalog wrapper -->\n\t\t\t<div class=\"rows-1 gap-thin\">\n\t\t\t\t<router-view v-slot=\"{ Component, route }\">\n\t\t\t\t\t<component ref=\"page\" :key=\"route\" :localPosition=\"localPosition\" :is=\"Component\" />\n\t\t\t\t</router-view>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n\n<script setup=\"props\">\n\t// Import libs\n\timport { computed, onMounted, watch, ref } from 'vue'\n\timport { useRoute, useRouter,onBeforeRouteLeave } from 'vue-router'\n\timport { useI18n } from 'vue-i18n'\n\n\timport BlockFilter from '@pf/src/modules/globals/views/components/blocks/BlockFilter.vue'\n\n\timport * as marketplace from '@pf/src/modules/products/store/marketplace';\n\timport * as globals from '@pf/src/modules/globals/views/store/globals'\n import * as categories from '@pf/src/modules/products/store/categories';\n\n\t// Accessing router and store\n\tconst route = useRoute()\n\tconst router = useRouter()\n\n\tconst localPosition = ref({\n\t\tcity: null,\n\t\tstate: null,\n\t\tcountry: null\n\t});\n\n\tconst desktopFilters = ref(null)\n\n\tfunction denormalizeUrlParam(param) {\n\t return param\n\t .replace(/-/g, ' ') // Замена дефисов на пробелы\n\t .replace(/\\b\\w/g, l => l.toUpperCase()); // Преобразование первой буквы каждого слова в заглавную\n\t}\n\n\tfunction normalizeUrlParam(param) {\n\t return param\n\t .toLowerCase()\n\t .replace(/ /g, '-')\n\t .replace(/[^a-z0-9-]/g, '');\n\t}\n\n\tif (route.params) {\n // Загружаем новые значения из параметров маршрута в состояние\n let newState = {\n country: denormalizeUrlParam(route.params.country),\n state: denormalizeUrlParam(route.params.state),\n city: denormalizeUrlParam(route.params.city),\n };\n\n\t // Обновляем глобальное состояние\n\t localPosition.value = newState;\n\t}\n\n\tif (route.query) {\n\t \tconst query = route.query;\n\n\t\tmarketplace.state.filter.selected.categories = query.categories ? query.categories.split(',') : [];\n\t\tmarketplace.state.filter.selected.prices = query.prices ? query.prices.split(',') : [];\n\t\tmarketplace.state.filter.selected.delivery = query.delivery ? query.delivery.split(',') : [];\n\t}\n\n\tif (route.query.sortParam) marketplace.state.sort.param = route.query.sortParam\n\tif (route.query.sortOrder) marketplace.state.sort.order = route.query.sortOrder\n\n\tonMounted(async () => {\n\t let options = {\n status: 'published'\n }\n\n let categoriesFilter = await categories.actions.fetchCategories(options);\n\n categoriesFilter = categoriesFilter.map(category => ({\n value: category.url,\n label: category.name\n }));\n\n const index = marketplace.state.filter.options.findIndex(option => option.value === 'categories');\n\n const categoryOption = {\n title: 'Categories',\n value: 'categories',\n options: categoriesFilter\n };\n\n if (index !== -1) {\n marketplace.state.filter.options[index] = categoryOption;\n } else {\n marketplace.state.filter.options.unshift(categoryOption);\n }\n\t})\n\n\twatch(() => marketplace.state.sort, (newSortValue, oldSortValue) => {\n\t\tlet query = { ...route.query}\n\t\t\n\t\tquery.sortParam = newSortValue.param\n\t\tquery.sortOrder = newSortValue.order\n\t \n\t // replace the current route\n\t router.replace({ query });\n\t}, { deep: true });\n\n\n\twatch(() => marketplace.state.filter.selected, (newFilterValue, oldFilterValue) => {\n\t // Переводим фильтр в формат query\n\t const query = { ...route.query };\n\n\t // Удаляем старые значения фильтра из query\n\t Object.keys(oldFilterValue).forEach(key => {\n\t if (query[key]) {\n\t delete query[key];\n\t }\n\t });\n\n\t // Добавляем новые значения фильтра в query\n\t const newQueryValues = Object.fromEntries(\n\t Object.entries(newFilterValue)\n\t .filter(([key, value]) => Array.isArray(value) && value.length > 0)\n\t .map(([key, value]) => [key, value.join(',')])\n\t );\n\n\t delete query.options;\n\t Object.assign(query, newQueryValues);\n\n\t // Обновляем маршрут с новым query\n\t router.replace({ query });\n\t}, { deep: true })\n\n\twatch(() => globals.state.position, (newPosition) => {\n\t // get the current route\n\t const currentRoute = { ...router.currentRoute.value };\n\t \n\t // create new parameters based on globals state position\n\t let newParams = {\n\t country: normalizeUrlParam(newPosition.country),\n\t state: normalizeUrlParam(newPosition.state),\n\t city: normalizeUrlParam(newPosition.city),\n\t };\n\t \n\t // update route params\n\t currentRoute.params = newParams;\n\t \n\t // replace the current route\n\t router.replace(currentRoute);\n\t}, { deep: true });\n\n const text = {\n locale: 'en',\n messages: {\n en: {\n\t \tmeta: {\n title: \"Marketplace – Shop Our Wide Selection of Quality Weed for Delivery\",\n description: \"Browse our marketplace of top-grade weed strains and choose from a variety of delivery options. Order now and have your favorite strains delivered straight to your door. Safe, fast, and reliable.\",\n }\n },\n ru: {\n\t meta: {\n title: \"Маркетплейс – Выбирайте из нашего ассортимента качественной травки для доставки\",\n description: \"Маркетплейс – Изучите наши продукты высокого качества и выбирайте из различных вариантов доставки. Закажите сейчас и получите свои любимые сорта на дом. Безопасно, быстро и надежно.\",\n }\n }\n }\n }\n\n \tconst { t } = useI18n(text)\n</script>\n\n<style lang=\"scss\">\n\n\n</style>\n"],"names":["marketplace.state","categories.actions","globals.state"],"mappings":";;;;;;;;;;;;;;;;;;;AAsDC,UAAM,QAAQ,SAAU;AACxB,UAAM,SAAS,UAAW;AAE1B,UAAM,gBAAgB,IAAI;AAAA,MACzB,MAAM;AAAA,MACN,OAAO;AAAA,MACP,SAAS;AAAA,IACX,CAAE;AAEsB,QAAI,IAAI;AAE/B,aAAS,oBAAoB,OAAO;AAClC,aAAO,MACJ,QAAQ,MAAM,GAAG,EACjB,QAAQ,SAAS,OAAK,EAAE,YAAa,CAAA;AAAA,IACzC;AAED,aAAS,kBAAkB,OAA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R,UAAU;AAAA,QACR,IAAI;AAAA,UACH,MAAM;AAAA,YACH,OAAO;AAAA,YACP,aAAa;AAAA,UACd;AAAA,QACF;AAAA,QACD,IAAI;AAAA,UACH,MAAM;AAAA,YACH,OAAO;AAAA,YACP,aAAa;AAAA,UACd;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAEa,YAAQ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const vueRouter = require("vue-router");
5
+ const organizations = require("../../../organizations/store/organizations.cjs");
6
+ const marketplace = require("../../store/marketplace.cjs");
7
+ const globals = require("../../../globals/views/store/globals.cjs");
8
+ const Feed = require("../../../../components/Feed/Feed.vue.cjs");
9
+ const CardOrganization = require("../../../organizations/components/blocks/CardOrganization.vue.cjs");
10
+ const _sfc_main = {
11
+ __name: "Catalog",
12
+ setup(__props) {
13
+ const route = vueRouter.useRoute();
14
+ return (_ctx, _cache) => {
15
+ var _a;
16
+ return vue.openBlock(), vue.createBlock(Feed.default, {
17
+ sort: marketplace.state.sort,
18
+ "onUpdate:sort": _cache[0] || (_cache[0] = ($event) => marketplace.state.sort = $event),
19
+ filter: marketplace.state.filter,
20
+ "onUpdate:filter": _cache[1] || (_cache[1] = ($event) => marketplace.state.filter = $event),
21
+ search: true,
22
+ showLoadMore: false,
23
+ states: {
24
+ empty: {
25
+ title: "No Shops Found",
26
+ description: "Currently, there are no shops."
27
+ }
28
+ },
29
+ store: {
30
+ read: (options) => organizations.actions.read(options)
31
+ },
32
+ options: {
33
+ country: vue.unref(route).params.country,
34
+ state: vue.unref(route).params.state,
35
+ city: vue.unref(route).params.city,
36
+ categories: vue.unref(route).query.categories,
37
+ prices: vue.unref(route).query.prices,
38
+ delivery: vue.unref(route).query.delivery,
39
+ location: (_a = globals.state.position) == null ? void 0 : _a.location,
40
+ contain: ["products"]
41
+ },
42
+ class: "rows-1 gap-thin"
43
+ }, {
44
+ default: vue.withCtx(({
45
+ items
46
+ }) => [
47
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(items, (organization) => {
48
+ return vue.openBlock(), vue.createBlock(CardOrganization.default, {
49
+ key: organization._id,
50
+ organization,
51
+ showRating: true,
52
+ showFollowers: false,
53
+ showProducts: true,
54
+ class: "bg-light w-100 o-hidden radius-big pd-small"
55
+ }, null, 8, ["organization"]);
56
+ }), 128))
57
+ ]),
58
+ _: 1
59
+ }, 8, ["sort", "filter", "store", "options"]);
60
+ };
61
+ }
62
+ };
63
+ exports.default = _sfc_main;
64
+ //# sourceMappingURL=Catalog.vue.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Catalog.vue.cjs","sources":["../../../../../../../src/modules/products/components/pages/Catalog.vue"],"sourcesContent":["<template>\n\t<Feed\n\t\tv-model:sort=\"marketplace.state.sort\"\n\t\tv-model:filter=\"marketplace.state.filter\"\n :search=\"true\"\n :showLoadMore=\"false\"\n :states=\"{\n empty: {\n title: 'No Shops Found',\n description: 'Currently, there are no shops.'\n },\n }\"\n :store=\"{\n read: (options) => organization.actions.read(options)\n }\"\n :options=\"{\n country: route.params.country,\n\t state: route.params.state,\n\t city: route.params.city,\n\t categories: route.query.categories,\n\t prices: route.query.prices,\n\t delivery: route.query.delivery,\n\t location: globals.state.position?.location,\n\t contain: ['products'],\n }\"\n v-slot=\"{ \n items \n }\"\n class=\"rows-1 gap-thin\"\n >\n <CardOrganization \n\t v-for=\"organization in items\" \n\t :key=\"organization._id\"\n\t :organization=\"organization\"\n\t :showRating=\"true\"\n\t :showFollowers=\"false\"\n\t :showProducts=\"true\"\n\t class=\"bg-light w-100 o-hidden radius-big pd-small \"\n\t />\n </Feed>\n</template>\n\n<script setup>\n\timport { computed,reactive,ref, onMounted,watch } from 'vue'\n\timport { useRoute } from 'vue-router'\n\t\n\timport * as organization from '@pf/src/modules/organizations/store/organizations'\n\timport * as marketplace from '@pf/src/modules/products/store/marketplace';\n\timport * as globals from '@pf/src/modules/globals/views/store/globals'\n\n\timport Feed from '@pf/src/components/Feed/Feed.vue'\n\n\timport CardOrganization from '@pf/src/modules/organizations/components/blocks/CardOrganization.vue'\n\t\n\tconst route = useRoute()\n</script>\n\n<style lang=\"scss\">\n</style>\n"],"names":["useRoute"],"mappings":";;;;;;;;;;;;AAsDC,UAAM,QAAQA,UAAAA,SAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,64 @@
1
+ import { openBlock, createBlock, unref, withCtx, createElementBlock, Fragment, renderList } from "vue";
2
+ import { useRoute } from "vue-router";
3
+ import { actions } from "../../../organizations/store/organizations.js";
4
+ import { state } from "../../store/marketplace.js";
5
+ import { state as state$1 } from "../../../globals/views/store/globals.js";
6
+ import _sfc_main$1 from "../../../../components/Feed/Feed.vue.js";
7
+ import _sfc_main$2 from "../../../organizations/components/blocks/CardOrganization.vue.js";
8
+ const _sfc_main = {
9
+ __name: "Catalog",
10
+ setup(__props) {
11
+ const route = useRoute();
12
+ return (_ctx, _cache) => {
13
+ var _a;
14
+ return openBlock(), createBlock(_sfc_main$1, {
15
+ sort: state.sort,
16
+ "onUpdate:sort": _cache[0] || (_cache[0] = ($event) => state.sort = $event),
17
+ filter: state.filter,
18
+ "onUpdate:filter": _cache[1] || (_cache[1] = ($event) => state.filter = $event),
19
+ search: true,
20
+ showLoadMore: false,
21
+ states: {
22
+ empty: {
23
+ title: "No Shops Found",
24
+ description: "Currently, there are no shops."
25
+ }
26
+ },
27
+ store: {
28
+ read: (options) => actions.read(options)
29
+ },
30
+ options: {
31
+ country: unref(route).params.country,
32
+ state: unref(route).params.state,
33
+ city: unref(route).params.city,
34
+ categories: unref(route).query.categories,
35
+ prices: unref(route).query.prices,
36
+ delivery: unref(route).query.delivery,
37
+ location: (_a = state$1.position) == null ? void 0 : _a.location,
38
+ contain: ["products"]
39
+ },
40
+ class: "rows-1 gap-thin"
41
+ }, {
42
+ default: withCtx(({
43
+ items
44
+ }) => [
45
+ (openBlock(true), createElementBlock(Fragment, null, renderList(items, (organization) => {
46
+ return openBlock(), createBlock(_sfc_main$2, {
47
+ key: organization._id,
48
+ organization,
49
+ showRating: true,
50
+ showFollowers: false,
51
+ showProducts: true,
52
+ class: "bg-light w-100 o-hidden radius-big pd-small"
53
+ }, null, 8, ["organization"]);
54
+ }), 128))
55
+ ]),
56
+ _: 1
57
+ }, 8, ["sort", "filter", "store", "options"]);
58
+ };
59
+ }
60
+ };
61
+ export {
62
+ _sfc_main as default
63
+ };
64
+ //# sourceMappingURL=Catalog.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Catalog.vue.js","sources":["../../../../../../../src/modules/products/components/pages/Catalog.vue"],"sourcesContent":["<template>\n\t<Feed\n\t\tv-model:sort=\"marketplace.state.sort\"\n\t\tv-model:filter=\"marketplace.state.filter\"\n :search=\"true\"\n :showLoadMore=\"false\"\n :states=\"{\n empty: {\n title: 'No Shops Found',\n description: 'Currently, there are no shops.'\n },\n }\"\n :store=\"{\n read: (options) => organization.actions.read(options)\n }\"\n :options=\"{\n country: route.params.country,\n\t state: route.params.state,\n\t city: route.params.city,\n\t categories: route.query.categories,\n\t prices: route.query.prices,\n\t delivery: route.query.delivery,\n\t location: globals.state.position?.location,\n\t contain: ['products'],\n }\"\n v-slot=\"{ \n items \n }\"\n class=\"rows-1 gap-thin\"\n >\n <CardOrganization \n\t v-for=\"organization in items\" \n\t :key=\"organization._id\"\n\t :organization=\"organization\"\n\t :showRating=\"true\"\n\t :showFollowers=\"false\"\n\t :showProducts=\"true\"\n\t class=\"bg-light w-100 o-hidden radius-big pd-small \"\n\t />\n </Feed>\n</template>\n\n<script setup>\n\timport { computed,reactive,ref, onMounted,watch } from 'vue'\n\timport { useRoute } from 'vue-router'\n\t\n\timport * as organization from '@pf/src/modules/organizations/store/organizations'\n\timport * as marketplace from '@pf/src/modules/products/store/marketplace';\n\timport * as globals from '@pf/src/modules/globals/views/store/globals'\n\n\timport Feed from '@pf/src/components/Feed/Feed.vue'\n\n\timport CardOrganization from '@pf/src/modules/organizations/components/blocks/CardOrganization.vue'\n\t\n\tconst route = useRoute()\n</script>\n\n<style lang=\"scss\">\n</style>\n"],"names":[],"mappings":";;;;;;;;;;AAsDC,UAAM,QAAQ,SAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -101,6 +101,6 @@ const _sfc_main = {
101
101
  };
102
102
  }
103
103
  };
104
- const ProductRecommmendation = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-bbe59673"]]);
105
- exports.default = ProductRecommmendation;
104
+ const ProductRecommendation = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-bbe59673"]]);
105
+ exports.default = ProductRecommendation;
106
106
  //# sourceMappingURL=ProductRecommmendation.vue.cjs.map
@@ -99,8 +99,8 @@ const _sfc_main = {
99
99
  };
100
100
  }
101
101
  };
102
- const ProductRecommmendation = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bbe59673"]]);
102
+ const ProductRecommendation = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bbe59673"]]);
103
103
  export {
104
- ProductRecommmendation as default
104
+ ProductRecommendation as default
105
105
  };
106
106
  //# sourceMappingURL=ProductRecommmendation.vue.js.map
@@ -7,7 +7,7 @@ const Feed = require("../../../../components/Feed/Feed.vue.cjs");
7
7
  ;/* empty css */
8
8
  require("vue-i18n");
9
9
  const categories = require("../../store/categories.cjs");
10
- const marketplace = require("../../../marketplace/store/marketplace.cjs");
10
+ const marketplace = require("../../store/marketplace.cjs");
11
11
  ;/* empty css */
12
12
  ;/* empty css */
13
13
  const BlockFilter = require("../../../globals/views/components/blocks/BlockFilter.vue.cjs");
@@ -141,7 +141,7 @@ const _sfc_main = {
141
141
  user: auth.state.access,
142
142
  class: "h-max",
143
143
  onClickCapture: ($event) => _ctx.$router.push({
144
- name: "Product Organization",
144
+ name: "Organization_Product",
145
145
  params: {
146
146
  _id: vue.unref(route).params._id,
147
147
  product: product._id
@@ -1 +1 @@
1
- {"version":3,"file":"Products.vue.cjs","sources":["../../../../../../../src/modules/products/components/pages/Products.vue"],"sourcesContent":["<template>\n <div>\n <header \n v-if=\"route.name !== 'Organization'\"\n class=\"mn-b-medium flex-v-center flex-nowrap flex\"\n >\n <h2 class=\"mn-r-medium\">Products</h2>\n <button \n @click=\"$router.push({\n name: 'ProductAdd'\n })\" \n class=\"radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second\">\n +\n </button>\n </header>\n\n <Tab \n v-if=\"route.name !== 'Organization'\"\n v-model:selected=\"tabProducts\"\n :tabs=\"[\n { name: 'All', value: 'all' },\n { name: 'Published', value: 'published' },\n { name: 'Unpublished', value: 'unpublished' }, \n { name: 'Archivied', value: 'archivied' } \n ]\"\n class=\"mn-b-small o-hidden h5 radius-big bg-light\"\n />\n\n <div class=\"cols-2-1_3 bg-light pd-thin radius-big gap-thin\">\n\n <BlockFilter\n v-model:filter=\"marketplace.state.filter\"\n :options=\"marketplace.state.filter.options\"\n class=\"h-100 w-100 desktop-only\"\n />\n\n\n <div class=\"rows-1\">\n <!-- <BlockSearch \n @search=\"updateSearch\"\n placeholder=\"Enter product name\"\n class=\"bg-white mn-b-thin\"\n /> -->\n <Feed\n v-model:filter=\"marketplace.state.filter\"\n :search=\"true\"\n :states=\"{\n empty: {\n title: 'No Products Found',\n description: 'Currently, there are no products available.'\n }\n }\"\n :store=\"{\n read: (options) => products.actions.read(options),\n state: products.state\n }\"\n :options=\"{\n limit: 15,\n organization: route.params._id,\n categories: route.query.categories,\n prices: route.query.prices,\n delivery: route.query.delivery,\n // search: route.query.search,\n ...(tabProducts !== 'all' && { status: tabProducts })\n // user: user\n }\"\n v-slot=\"{ \n items \n }\"\n class=\"cols-4 gap-thin\"\n >\n <CardProduct\n v-for=\"product in items\"\n :key=\"product._id\"\n :product=\"product\"\n :user=\"auth.state.access\"\n class=\"h-max\"\n @click.capture=\"$router.push({\n name: 'Product Organization', \n params: { \n _id: route.params._id, \n product: product._id \n } \n })\" \n />\n </Feed>\n </div>\n </div>\n</div>\n</template>\n\n\n<script setup=\"props\">\n // Import libs\n import { computed, watch, onMounted, ref } from 'vue'\n import { useRoute, useRouter } from 'vue-router'\n\n // Import components\n import Tab from '@pf/src/components/Tab/Tab.vue'\n import Feed from '@pf/src/components/Feed/Feed.vue'\n\n import FilterProducts from '@pf/src/modules/products/components/sections/FilterProducts.vue'\n import BlockSearch from '@pf/src/modules/globals/views/components/blocks/BlockSearch.vue'\n import BlockFilter from '@pf/src/modules/globals/views/components/blocks/BlockFilter.vue'\n\n import CardProduct from '@pf/src/modules/products/components/blocks/CardProduct.vue'\n\n // Accessing router and store\n import * as auth from '@pf/src/modules/auth/views/store/auth';\n import * as products from '@pf/src/modules/products/store/products';\n import * as marketplace from '@pf/src/modules/marketplace/store/marketplace';\n import * as categories from '@pf/src/modules/products/store/categories';\n\n const route = useRoute()\n const router = useRouter()\n\n // Tab logic\n const tabProducts = ref(route.query.tabProducts ? route.query.tabProducts : 'all')\n\n if (route.name !== 'Organization') route.query.tabProducts = tabProducts.value\n \n if (route.query) {\n const query = route.query;\n\n marketplace.state.filter.selected.categories = query.categories ? query.categories.split(',') : [];\n marketplace.state.filter.selected.prices = query.prices ? query.prices.split(',') : [];\n marketplace.state.filter.selected.delivery = query.delivery ? query.delivery.split(',') : [];\n }\n\n\n watch(tabProducts, (newValue) => {\n if (route.name !== 'Organization') router.replace({ query: { ...route.query, tabProducts: newValue } });\n });\n\n onMounted(async () => {\n let categoriesFilter = await categories.actions.fetchCategories();\n\n categoriesFilter = categoriesFilter.map(category => ({\n value: category.url,\n label: category.name\n }));\n\n const index = marketplace.state.filter.options.findIndex(option => option.value === 'categories');\n\n const categoryOption = {\n title: 'Categories',\n value: 'categories',\n options: categoriesFilter\n };\n\n if (index !== -1) {\n marketplace.state.filter.options[index] = categoryOption;\n } else {\n marketplace.state.filter.options.unshift(categoryOption);\n }\n })\n\n watch(() => marketplace.state.sort, (newSortValue, oldSortValue) => {\n let query = { ...route.query}\n \n query.sortParam = newSortValue.param\n query.sortOrder = newSortValue.order\n \n // replace the current route\n router.replace({ query });\n }, { deep: true });\n\n\n watch(() => marketplace.state.filter.selected, (newFilterValue, oldFilterValue) => {\n // Переводим фильтр в формат query\n const query = { ...route.query };\n\n // Удаляем старые значения фильтра из query\n Object.keys(oldFilterValue).forEach(key => {\n if (query[key]) {\n delete query[key];\n }\n });\n\n // Добавляем новые значения фильтра в query\n const newQueryValues = Object.fromEntries(\n Object.entries(newFilterValue)\n .filter(([key, value]) => Array.isArray(value) && value.length > 0)\n .map(([key, value]) => [key, value.join(',')])\n );\n\n delete query.options;\n Object.assign(query, newQueryValues);\n\n // Обновляем маршрут с новым query\n router.replace({ query });\n }, { deep: true })\n\n\n\n \n function updateSearch(search) {\n let query = { ...route.query}\n \n query.search = search\n \n router.replace({ query });\n }\n</script>\n\n<style lang=\"scss\">\n\n\n</style>\n"],"names":["useRoute","useRouter","ref","marketplace.state","watch","onMounted","categories.actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiHE,UAAM,QAAQA,UAAAA,SAAU;AACxB,UAAM,SAASC,UAAAA,UAAW;AAG1B,UAAM,cAAcC,QAAI,MAAM,MAAM,cAAc,MAAM,MAAM,cAAc,KAAK;AAEjF,QAAI,MAAM,SAAS,eAAgB,OAAM,MAAM,cAAc,YAAY;AAEzE,QAAI,MAAM,OAAO;AACf,YAAM,QAAQ,MAAM;AAEpBC,kBAAAA,MAAkB,OAAO,SAAS,aAAa,MAAM,aAAa,MAAM,WAAW,MAAM,GAAG,IAAI,CAAA;AAChGA,kBAAAA,MAAkB,OAAO,SAAS,SAAS,MAAM,SAAS,MAAM,OAAO,MAA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AAA,QACjB;AAAA,MACP,CAAK;AAGD,YAAM,iBAAiB,OAAO;AAAA,QAC5B,OAAO,QAAQ,cAAc,EAC1B,OAAO,CAAC,CAAC,KAAK,KAAK,MAAM,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,CAAC,EACjE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,MAAM,KAAK,GAAG,CAAC,CAAC;AAAA,MACrD;AAEI,aAAO,MAAM;AACb,aAAO,OAAO,OAAO,cAAc;AAGnC,aAAO,QAAQ,EAAE,MAAK,CAAE;AAAA,IAC5B,GAAK,EAAE,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Products.vue.cjs","sources":["../../../../../../../src/modules/products/components/pages/Products.vue"],"sourcesContent":["<template>\n <div>\n <header \n v-if=\"route.name !== 'Organization'\"\n class=\"mn-b-medium flex-v-center flex-nowrap flex\"\n >\n <h2 class=\"mn-r-medium\">Products</h2>\n <button \n @click=\"$router.push({\n name: 'ProductAdd'\n })\" \n class=\"radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second\">\n +\n </button>\n </header>\n\n <Tab \n v-if=\"route.name !== 'Organization'\"\n v-model:selected=\"tabProducts\"\n :tabs=\"[\n { name: 'All', value: 'all' },\n { name: 'Published', value: 'published' },\n { name: 'Unpublished', value: 'unpublished' }, \n { name: 'Archivied', value: 'archivied' } \n ]\"\n class=\"mn-b-small o-hidden h5 radius-big bg-light\"\n />\n\n <div class=\"cols-2-1_3 bg-light pd-thin radius-big gap-thin\">\n\n <BlockFilter\n v-model:filter=\"marketplace.state.filter\"\n :options=\"marketplace.state.filter.options\"\n class=\"h-100 w-100 desktop-only\"\n />\n\n\n <div class=\"rows-1\">\n <!-- <BlockSearch \n @search=\"updateSearch\"\n placeholder=\"Enter product name\"\n class=\"bg-white mn-b-thin\"\n /> -->\n <Feed\n v-model:filter=\"marketplace.state.filter\"\n :search=\"true\"\n :states=\"{\n empty: {\n title: 'No Products Found',\n description: 'Currently, there are no products available.'\n }\n }\"\n :store=\"{\n read: (options) => products.actions.read(options),\n state: products.state\n }\"\n :options=\"{\n limit: 15,\n organization: route.params._id,\n categories: route.query.categories,\n prices: route.query.prices,\n delivery: route.query.delivery,\n // search: route.query.search,\n ...(tabProducts !== 'all' && { status: tabProducts })\n // user: user\n }\"\n v-slot=\"{ \n items \n }\"\n class=\"cols-4 gap-thin\"\n >\n <CardProduct\n v-for=\"product in items\"\n :key=\"product._id\"\n :product=\"product\"\n :user=\"auth.state.access\"\n class=\"h-max\"\n @click.capture=\"$router.push({\n name: 'Organization_Product', \n params: { \n _id: route.params._id, \n product: product._id \n } \n })\" \n />\n </Feed>\n </div>\n </div>\n</div>\n</template>\n\n\n<script setup=\"props\">\n // Import libs\n import { computed, watch, onMounted, ref } from 'vue'\n import { useRoute, useRouter } from 'vue-router'\n\n // Import components\n import Tab from '@pf/src/components/Tab/Tab.vue'\n import Feed from '@pf/src/components/Feed/Feed.vue'\n\n import FilterProducts from '@pf/src/modules/products/components/sections/FilterProducts.vue'\n import BlockSearch from '@pf/src/modules/globals/views/components/blocks/BlockSearch.vue'\n import BlockFilter from '@pf/src/modules/globals/views/components/blocks/BlockFilter.vue'\n\n import CardProduct from '@pf/src/modules/products/components/blocks/CardProduct.vue'\n\n // Accessing router and store\n import * as auth from '@pf/src/modules/auth/views/store/auth';\n import * as products from '@pf/src/modules/products/store/products';\n import * as marketplace from '@pf/src/modules/products/store/marketplace';\n import * as categories from '@pf/src/modules/products/store/categories';\n\n const route = useRoute()\n const router = useRouter()\n\n // Tab logic\n const tabProducts = ref(route.query.tabProducts ? route.query.tabProducts : 'all')\n\n if (route.name !== 'Organization') route.query.tabProducts = tabProducts.value\n \n if (route.query) {\n const query = route.query;\n\n marketplace.state.filter.selected.categories = query.categories ? query.categories.split(',') : [];\n marketplace.state.filter.selected.prices = query.prices ? query.prices.split(',') : [];\n marketplace.state.filter.selected.delivery = query.delivery ? query.delivery.split(',') : [];\n }\n\n\n watch(tabProducts, (newValue) => {\n if (route.name !== 'Organization') router.replace({ query: { ...route.query, tabProducts: newValue } });\n });\n\n onMounted(async () => {\n let categoriesFilter = await categories.actions.fetchCategories();\n\n categoriesFilter = categoriesFilter.map(category => ({\n value: category.url,\n label: category.name\n }));\n\n const index = marketplace.state.filter.options.findIndex(option => option.value === 'categories');\n\n const categoryOption = {\n title: 'Categories',\n value: 'categories',\n options: categoriesFilter\n };\n\n if (index !== -1) {\n marketplace.state.filter.options[index] = categoryOption;\n } else {\n marketplace.state.filter.options.unshift(categoryOption);\n }\n })\n\n watch(() => marketplace.state.sort, (newSortValue, oldSortValue) => {\n let query = { ...route.query}\n \n query.sortParam = newSortValue.param\n query.sortOrder = newSortValue.order\n \n // replace the current route\n router.replace({ query });\n }, { deep: true });\n\n\n watch(() => marketplace.state.filter.selected, (newFilterValue, oldFilterValue) => {\n // Переводим фильтр в формат query\n const query = { ...route.query };\n\n // Удаляем старые значения фильтра из query\n Object.keys(oldFilterValue).forEach(key => {\n if (query[key]) {\n delete query[key];\n }\n });\n\n // Добавляем новые значения фильтра в query\n const newQueryValues = Object.fromEntries(\n Object.entries(newFilterValue)\n .filter(([key, value]) => Array.isArray(value) && value.length > 0)\n .map(([key, value]) => [key, value.join(',')])\n );\n\n delete query.options;\n Object.assign(query, newQueryValues);\n\n // Обновляем маршрут с новым query\n router.replace({ query });\n }, { deep: true })\n\n\n\n \n function updateSearch(search) {\n let query = { ...route.query}\n \n query.search = search\n \n router.replace({ query });\n }\n</script>\n\n<style lang=\"scss\">\n\n\n</style>\n"],"names":["useRoute","useRouter","ref","marketplace.state","watch","onMounted","categories.actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiHE,UAAM,QAAQA,UAAAA,SAAU;AACxB,UAAM,SAASC,UAAAA,UAAW;AAG1B,UAAM,cAAcC,QAAI,MAAM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