@ozdao/prometheus-framework 0.2.94 → 0.2.95

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. package/dist/auth.server.js +15 -14
  2. package/dist/auth.server.mjs +15 -14
  3. package/dist/main-BJvlNekm.mjs +13631 -0
  4. package/dist/main-pGo7JpSP.js +92 -0
  5. package/dist/orders.server.js +26 -22
  6. package/dist/orders.server.mjs +26 -22
  7. package/dist/organizations.server.js +31 -10
  8. package/dist/organizations.server.mjs +31 -10
  9. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/components/Block/Block.vue.js +2 -2
  11. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  12. package/dist/prometheus-framework/src/components/Button/Button.vue.js +94 -1
  13. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  14. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +1 -94
  15. package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.js +19 -19
  16. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -1
  18. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +1 -84
  20. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  22. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +12 -12
  23. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
  25. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
  26. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
  27. package/dist/prometheus-framework/src/components/Upload/Upload.vue.js +21 -21
  28. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
  30. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  32. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
  34. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
  36. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +2 -2
  38. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +2 -2
  40. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +2 -2
  42. package/dist/prometheus-framework/src/modules/auth/router/auth.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/auth/router/auth.js +4 -0
  44. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +8 -8
  46. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
  48. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  50. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
  52. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  54. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
  55. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
  56. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
  57. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
  58. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  60. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  62. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  64. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  66. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  68. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +60 -60
  70. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
  72. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  74. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
  76. package/dist/prometheus-framework/src/modules/icons/navigation/IconCross.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/icons/navigation/IconCross.vue.js +22 -21
  78. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  80. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +2 -2
  81. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +48 -37
  82. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +160 -167
  84. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +50 -49
  86. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +113 -110
  88. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue.js +14 -14
  89. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
  91. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  93. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  94. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  95. package/dist/prometheus-framework/src/modules/orders/store/models/order.cjs +1 -0
  96. package/dist/prometheus-framework/src/modules/orders/store/models/order.js +28 -0
  97. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  98. package/dist/prometheus-framework/src/modules/orders/store/orders.js +25 -43
  99. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  100. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +19 -19
  101. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  102. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  103. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  104. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +47 -47
  105. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  106. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +143 -131
  107. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  108. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  109. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  110. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  111. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  112. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +3 -3
  113. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  114. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
  115. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  116. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  117. package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
  118. package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +32 -34
  119. package/dist/prometheus-framework/src/modules/organizations/router/members.router.cjs +1 -1
  120. package/dist/prometheus-framework/src/modules/organizations/router/members.router.js +1 -1
  121. package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
  122. package/dist/prometheus-framework/src/modules/organizations/store/departments.js +1 -1
  123. package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
  124. package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +30 -32
  125. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  126. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  127. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  128. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  129. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  130. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  131. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  132. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  133. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  134. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  135. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  136. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  137. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  138. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +155 -187
  139. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  140. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  141. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  142. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +19 -19
  143. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  144. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  145. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  146. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  147. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -1
  148. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +26 -22
  149. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  150. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +68 -65
  151. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  152. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
  153. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  154. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
  155. package/dist/prometheus-framework.cjs.js +1 -1
  156. package/dist/prometheus-framework.es.js +1 -1
  157. package/dist/style.css +1 -1
  158. package/dist/web-B2xhKZNK.js +1 -0
  159. package/dist/web-DTzbVshr.mjs +54 -0
  160. package/package.json +1 -1
  161. package/src/components/Block/Block.vue +1 -1
  162. package/src/modules/auth/controllers/auth.controller.js +19 -16
  163. package/src/modules/auth/router/auth.js +4 -0
  164. package/src/modules/backoffice/router/backoffice.js +3 -3
  165. package/src/modules/chats/routes/chats.routes.js +1 -2
  166. package/src/modules/gallery/components/sections/BackofficeGallery.vue +2 -1
  167. package/src/modules/icons/navigation/IconCross.vue +11 -7
  168. package/src/modules/orders/components/blocks/StatusHistory.vue +8 -11
  169. package/src/modules/orders/components/pages/OrderBackoffice.vue +37 -50
  170. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +7 -3
  171. package/src/modules/orders/components/pages/Orders.vue +1 -1
  172. package/src/modules/orders/controllers/orders.controller.js +24 -24
  173. package/src/modules/orders/models/order.model.js +1 -1
  174. package/src/modules/orders/routes/orders.routes.js +6 -0
  175. package/src/modules/orders/store/models/order.js +33 -0
  176. package/src/modules/orders/store/orders.js +7 -28
  177. package/src/modules/organizations/components/blocks/CardDepartment.vue +2 -2
  178. package/src/modules/organizations/components/pages/DepartmentEdit.vue +7 -5
  179. package/src/modules/organizations/components/pages/Members.vue +50 -38
  180. package/src/modules/organizations/components/pages/Organization.vue +1 -1
  181. package/src/modules/organizations/controllers/invites.controller.js +2 -0
  182. package/src/modules/organizations/controllers/memberships.controller.js +35 -11
  183. package/src/modules/organizations/models/invite.model.js +4 -0
  184. package/src/modules/organizations/organizations.client.js +0 -2
  185. package/src/modules/organizations/router/members.router.js +1 -1
  186. package/src/modules/organizations/store/departments.js +0 -1
  187. package/src/modules/organizations/store/memberships.js +1 -8
  188. package/src/modules/products/components/pages/ProductEdit.vue +39 -33
  189. package/src/modules/products/components/sections/EditProductInfo.vue +3 -3
  190. package/src/modules/users/components/blocks/CardUser.vue +9 -5
  191. package/src/modules/users/components/pages/Profile.vue +5 -3
  192. package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +0 -126
@@ -1,62 +1,52 @@
1
- import { ref as v, onMounted as G, computed as q, openBlock as l, createElementBlock as o, createVNode as x, createElementVNode as s, createTextVNode as O, toDisplayString as a, Fragment as N, renderList as $, normalizeClass as H, unref as g, createCommentVNode as m, withCtx as J, createBlock as C, pushScopeId as K, popScopeId as X } from "vue";
2
- import { useRouter as Z, useRoute as ss } from "vue-router";
3
- import ts from "../../../globals/components/sections/SectionPageTitle.vue.js";
4
- import es from "../../../../components/Popup/Popup.vue.js";
5
- import as from "../../../icons/entities/IconTime.vue.js";
6
- import W from "../blocks/CardOrderItem.vue.js";
7
- import rs from "../../../organizations/components/blocks/CardOrganization.vue.js";
8
- import ls from "../../../chats/components/pages/ChatPage.vue.js";
9
- import ns from "../blocks/StatusHistory.vue.js";
10
- import { state as is } from "../../../globals/store/globals.js";
11
- import { actions as Q, state as f } from "../../store/orders.js";
12
- import { actions as os } from "../../../products/store/products.js";
13
- import { actions as us } from "../../../organizations/store/organizations.js";
1
+ import { ref as f, onMounted as W, computed as R, openBlock as i, createElementBlock as m, createElementVNode as t, createTextVNode as F, toDisplayString as l, Fragment as I, renderList as D, normalizeClass as L, createCommentVNode as b, createVNode as x, unref as v, withCtx as j, createBlock as C, pushScopeId as G, popScopeId as J } from "vue";
2
+ import { useRouter as K, useRoute as Q } from "vue-router";
3
+ import X from "../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js";
4
+ import "../../../../../node_modules/@vuepic/vue-datepicker/dist/main.css.js";
5
+ import "../../../../components/Tab/Tab.vue.js";
6
+ import Y from "../../../../components/Popup/Popup.vue.js";
7
+ import Z from "../../../icons/entities/IconTime.vue.js";
8
+ import T from "../blocks/CardOrderItem.vue.js";
9
+ import tt from "../../../organizations/components/blocks/CardOrganization.vue.js";
10
+ import st from "../../../chats/components/pages/ChatPage.vue.js";
11
+ import et from "../blocks/StatusHistory.vue.js";
12
+ import { state as at } from "../../../globals/store/globals.js";
13
+ import { actions as U, state as g } from "../../store/orders.js";
14
+ import { actions as lt } from "../../../products/store/products.js";
15
+ import { actions as rt } from "../../../organizations/store/organizations.js";
14
16
  import "./OrderBackoffice.vue2.js";
15
- import ds from "../../../../../../_virtual/_plugin-vue_export-helper.js";
16
- const n = (k) => (K("data-v-36d45d04"), k = k(), X(), k), cs = {
17
+ import it from "../../../../../../_virtual/_plugin-vue_export-helper.js";
18
+ const r = (k) => (G("data-v-ec5fc79c"), k = k(), J(), k), nt = {
17
19
  key: 0,
18
20
  class: "pd-thin"
19
- }, ms = {
21
+ }, ot = {
20
22
  key: 0,
21
- class: "mn-b-thin pos-relative w-100 bg-main radius-big pd-big"
22
- }, ps = { class: "mn-b-small flex-nowrap flex" }, _s = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "t-medium p-medium mn-r-auto" }, " Progress ", -1)), hs = { class: "t-medium p-medium" }, bs = { class: "p-small t-transp" }, vs = /* @__PURE__ */ n(() => /* @__PURE__ */ s("h2", { class: "mn-b-small" }, null, -1)), gs = { class: "radius-extra mn-b-medium flex-nowrap flex pos-relative" }, fs = { class: "flex-nowrap flex" }, ys = { class: "w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-white-transp-20" }, ws = { class: "t-medium mn-r-auto" }, ks = { class: "bg-grey radius-small pd-small mn-b-thin" }, xs = { class: "bg-grey pd-small radius-small flex gap-thin flex-column mn-b-semi" }, Cs = {
23
+ class: "mn-b-thin pos-relative w-100 bg-main radius-big pd-medium"
24
+ }, dt = { class: "mn-b-small flex-nowrap flex" }, ut = { class: "t-medium p-medium" }, ct = { class: "p-small t-transp" }, mt = { class: "flex-nowrap flex gap-thin pos-relative" }, pt = { class: "bg-grey mn-b-thin pd-thin radius-extra flex-nowrap flex" }, _t = { class: "w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-white-transp-20" }, ht = { class: "t-medium mn-r-auto" }, bt = /* @__PURE__ */ r(() => /* @__PURE__ */ t("span", { class: "p-small t-transp" }, "Estimated Arrival", -1)), vt = /* @__PURE__ */ r(() => /* @__PURE__ */ t("br", null, null, -1)), ft = /* @__PURE__ */ r(() => /* @__PURE__ */ t("p", { class: "t-medium p-medium mn-b-thin" }, " Positions ", -1)), gt = { class: "bg-grey pd-small radius-small flex gap-thin flex-column mn-b-semi" }, wt = {
23
25
  key: 1,
24
26
  class: "gap-thin cols-2"
25
- }, Os = { class: "w-100" }, Ss = { class: "mn-b-thin bg-grey w-100 o-hidden radius-medium" }, Ps = { class: "pd-small flex-nowrap flex" }, Is = { class: "mn-r-auto" }, Ds = /* @__PURE__ */ n(() => /* @__PURE__ */ s("span", { class: "d-block t-medium p-medium" }, "Your order is", -1)), Ns = { class: "t-lh-075 h2 d-block mn-b-small" }, $s = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max" }, "as on 29 aug 2021, Friday", -1)), Es = /* @__PURE__ */ n(() => /* @__PURE__ */ s("div", { class: "t-right" }, [
26
- /* @__PURE__ */ O(" Cancel order"),
27
- /* @__PURE__ */ s("br"),
28
- /* @__PURE__ */ O(" Exchange item "),
29
- /* @__PURE__ */ s("hr", { class: "mn-b-thin mn-t-thin" }),
30
- /* @__PURE__ */ O(" For Delivery Queries Contact Us ")
31
- ], -1)), Ms = { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, zs = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "w-100 t-medium p-medium" }, " Phone ", -1)), Bs = { class: "w-100 t-right" }, Fs = {
32
- key: 0,
33
- class: "pd-small cols-2 br-t br-black-transp-10 br-solid"
34
- }, As = { class: "w-100 t-medium p-medium" }, Rs = { class: "w-100 t-right" }, Vs = /* @__PURE__ */ n(() => /* @__PURE__ */ s("div", { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, [
35
- /* @__PURE__ */ s("p", { class: "t-medium p-medium" }, " Address "),
36
- /* @__PURE__ */ s("p", { class: "w-100 t-right" })
37
- ], -1)), Ls = { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, Ts = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "mn-b-small t-medium p-medium" }, " Delivery ", -1)), Us = { class: "w-100 t-right mn-b-small" }, qs = {
27
+ }, yt = { class: "w-100" }, kt = { class: "mn-b-thin bg-grey w-100 o-hidden radius-medium" }, xt = { class: "pd-small flex-nowrap flex" }, Ct = { class: "mn-r-auto" }, Ot = /* @__PURE__ */ r(() => /* @__PURE__ */ t("span", { class: "d-block t-medium p-medium" }, "Order is", -1)), St = /* @__PURE__ */ r(() => /* @__PURE__ */ t("span", { class: "t-lh-075 h2 d-block mn-b-small" }, "created", -1)), Nt = { class: "pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max" }, Pt = { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, It = /* @__PURE__ */ r(() => /* @__PURE__ */ t("p", { class: "w-100 t-medium p-medium" }, " Phone ", -1)), Dt = { class: "w-100 t-right" }, Mt = { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, $t = /* @__PURE__ */ r(() => /* @__PURE__ */ t("p", { class: "t-medium p-medium" }, " Address ", -1)), zt = { class: "w-100 t-right" }, Et = { class: "pd-small cols-2 br-t br-black-transp-10 br-solid" }, Vt = /* @__PURE__ */ r(() => /* @__PURE__ */ t("p", { class: "mn-b-small t-medium p-medium" }, " Delivery ", -1)), Bt = { class: "w-100 t-right mn-b-small" }, At = {
38
28
  key: 2,
39
29
  class: "t-transp"
40
- }, Hs = { class: "bg-grey radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100" }, Ws = /* @__PURE__ */ n(() => /* @__PURE__ */ s("h3", { class: "mn-b-small" }, "Order Summary", -1)), Qs = { class: "flex gap-thin flex-column mn-b-semi" }, Ys = { class: "mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100" }, js = { class: "pd-small br-solid br-b br-black-transp-10 flex" }, Gs = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "mn-r-auto t-transp" }, "In total", -1)), Js = { class: "pd-small br-solid br-b br-black-transp-10 flex" }, Ks = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "mn-r-auto t-transp" }, "Delivery", -1)), Xs = { class: "pd-small flex-bottom flex" }, Zs = /* @__PURE__ */ n(() => /* @__PURE__ */ s("p", { class: "mn-r-auto t-transp" }, "In total to pay", -1)), st = { class: "p-big t-semi" }, tt = /* @__PURE__ */ n(() => /* @__PURE__ */ s("h3", { class: "mn-b-small" }, "Chat With Us", -1)), et = {
30
+ }, Rt = { class: "bg-grey radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100" }, Ft = /* @__PURE__ */ r(() => /* @__PURE__ */ t("h3", { class: "mn-b-small" }, "Order Summary", -1)), Lt = { class: "flex gap-thin flex-column mn-b-semi" }, Tt = { class: "mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100" }, Ut = { class: "pd-small br-solid br-b br-black-transp-10 flex" }, qt = /* @__PURE__ */ r(() => /* @__PURE__ */ t("p", { class: "mn-r-auto t-transp" }, "In total", -1)), Ht = { class: "pd-small br-solid br-b br-black-transp-10 flex" }, Wt = /* @__PURE__ */ r(() => /* @__PURE__ */ t("p", { class: "mn-r-auto t-transp" }, "Delivery", -1)), jt = { class: "pd-small flex-bottom flex" }, Gt = /* @__PURE__ */ r(() => /* @__PURE__ */ t("p", { class: "mn-r-auto t-transp" }, "In total to pay", -1)), Jt = { class: "p-big t-semi" }, Kt = /* @__PURE__ */ r(() => /* @__PURE__ */ t("h3", { class: "mn-b-small" }, "Chat With Us", -1)), Qt = {
41
31
  __name: "OrderBackoffice",
42
32
  setup(k) {
43
- Z();
44
- const y = ss(), e = v(null), S = v(null), u = v(null), d = ["created", "confirmed", "packing", "in delivery", "delivered"], E = ["Order Confirming", "Order Confirmed", "Packing", "In Delivery", "Delivered"], P = (t) => d.slice(t).includes(e.value.status), I = v(!1), M = v(null), D = v([]);
45
- function Y(t) {
46
- I.value = !0, typeof t == "number" && (M.value = t);
33
+ K();
34
+ const w = Q(), e = f(null), O = f(null), o = f(null), d = ["created", "confirmed", "packing", "in delivery", "delivered"], M = ["Created", "Confirmed", "Packing", "In Delivery", "Delivered"], S = (s) => d.slice(s).includes(e.value.status), N = f(!1), $ = f(null), P = f([]);
35
+ function q(s) {
36
+ N.value = !0, typeof s == "number" && ($.value = s);
47
37
  }
48
38
  function z() {
49
- I.value = !1, M.value = null;
39
+ N.value = !1, $.value = null;
50
40
  }
51
- G(async () => {
52
- var r, i;
53
- e.value = await Q.read({ _id: y.params.order }), e.value = e.value[0], S.value = await os.read({
41
+ W(async () => {
42
+ var a, n;
43
+ e.value = await U.read({ _id: w.params.order }), e.value = e.value[0], O.value = await lt.read({
54
44
  organization: e.value.owner.target._id,
55
45
  limit: 1e3
56
- }), console.log(S.value);
57
- const t = S.value.reduce((p, _) => (p[_._id] = _, p), {});
58
- console.log(t), D.value = e.value.positions.map(({ _id: p, quantity: _ }) => {
59
- const h = t[p];
46
+ }), console.log(O.value);
47
+ const s = O.value.reduce((p, _) => (p[_._id] = _, p), {});
48
+ console.log(s), P.value = e.value.positions.map(({ _id: p, quantity: _ }) => {
49
+ const h = s[p];
60
50
  return {
61
51
  name: h.name,
62
52
  images: h.images,
@@ -64,179 +54,182 @@ const n = (k) => (K("data-v-36d45d04"), k = k(), X(), k), cs = {
64
54
  _id: h._id,
65
55
  quantity: _
66
56
  };
67
- }), u.value = await us.read({
68
- _id: (r = e.value) == null ? void 0 : r.owner.target._id,
69
- location: (i = is.position) == null ? void 0 : i.location
57
+ }), o.value = await rt.read({
58
+ _id: (a = e.value) == null ? void 0 : a.owner.target._id,
59
+ location: (n = at.position) == null ? void 0 : n.location
70
60
  });
71
61
  });
72
- let B = q(() => {
73
- var t;
74
- return Number((t = e.value) == null ? void 0 : t.positions.reduce((r, i) => r + i.price * i.quantity, 0));
62
+ let E = R(() => {
63
+ var s;
64
+ return Number((s = e.value) == null ? void 0 : s.positions.reduce((a, n) => a + n.price * n.quantity, 0));
75
65
  });
76
- q(() => {
77
- var t;
78
- return Number((t = e.value) == null ? void 0 : t.positions.reduce((r, i) => r + i.quantity, 0));
66
+ R(() => {
67
+ var s;
68
+ return Number((s = e.value) == null ? void 0 : s.positions.reduce((a, n) => a + n.quantity, 0));
79
69
  });
80
- function w(t) {
81
- const r = d.indexOf(t);
82
- return r !== -1 && r + 1 < d.length ? d[r + 1] : null;
70
+ function y(s) {
71
+ const a = d.indexOf(s);
72
+ return a !== -1 && a + 1 < d.length ? d[a + 1] : null;
83
73
  }
84
- function F(t) {
85
- const r = d.indexOf(t);
86
- return t ? E[r] : "";
74
+ function V(s) {
75
+ const a = d.indexOf(s);
76
+ return s ? M[a] : "";
87
77
  }
88
- async function j() {
89
- const t = w(f.current.status);
90
- t ? (f.current.status = t, await Q.update(f.current)) : console.error("Next status is void. Must handle somehow."), z();
78
+ async function H() {
79
+ const s = y(g.current.status);
80
+ s ? (g.current.status = s, await U.update(g.current)) : console.error("Next status is void. Must handle somehow."), z();
91
81
  }
92
- return (t, r) => {
93
- var i, p, _, h, A, R, V, L, T, U;
94
- return e.value && u.value ? (l(), o("div", cs, [
95
- x(ts, {
96
- title: `Order is ${e.value.status}`,
97
- class: "mn-b-small bg-grey bg-grey radius-big"
98
- }, null, 8, ["title"]),
99
- e.value ? (l(), o("div", ms, [
100
- s("div", ps, [
101
- _s,
102
- s("p", hs, [
103
- O(" Order No: "),
104
- s("span", bs, "#" + a(e.value._id), 1)
82
+ return (s, a) => {
83
+ var n, p, _, h, B, A;
84
+ return e.value && o.value ? (i(), m("div", nt, [
85
+ e.value ? (i(), m("div", ot, [
86
+ t("div", dt, [
87
+ t("p", ut, [
88
+ F(" Order No: "),
89
+ t("span", ct, "#" + l(e.value._id), 1)
105
90
  ])
106
91
  ]),
107
- vs,
108
- s("div", gs, [
109
- (l(), o(N, null, $(d, (b, c) => s("div", {
92
+ t("div", mt, [
93
+ (i(), m(I, null, D(d, (u, c) => t("div", {
110
94
  key: c,
111
- class: "mn-r-thin w-20"
95
+ class: "w-20"
112
96
  }, [
113
- s("div", {
114
- class: H([
97
+ t("div", {
98
+ class: L([
115
99
  "bg-grey br-anim br-glow radius-extra h-1r w-100",
116
- { "br-glow-anim": P(c) },
117
- { "t-transp": !P(c) },
118
- { blink: e.value.status === d[c] && w(e.value.status) }
100
+ { "br-glow-anim": S(c) },
101
+ { "t-transp": !S(c) },
102
+ { blink: e.value.status === d[c] && y(e.value.status) }
119
103
  ])
120
104
  }, null, 2),
121
- s("div", {
122
- class: H([{ "t-transp": !P(c) }, "mn-t-thin t-medium uppercase"])
123
- }, a(E[c]), 3)
105
+ t("div", {
106
+ class: L([{ "t-transp": !S(c) }, "mn-t-thin p-small t-medium uppercase"])
107
+ }, l(M[c]), 3)
124
108
  ])), 64))
125
- ]),
126
- s("div", fs, [
127
- s("div", ys, [
128
- x(as, {
129
- class: "i-semi t-transp",
130
- fill: "rgb(var(--black)"
131
- }),
132
- s("p", ws, "Estimated Arrival " + a(t.formatDate(e.value.deadline)), 1)
133
- ]),
134
- w(e.value.status) && g(y).name === "Order Edit" ? (l(), o("button", {
135
- key: 0,
136
- onClick: Y,
137
- class: "mn-l-auto bg-black t-white button"
138
- }, " Mark as " + a(F(w(e.value.status))), 1)) : m("", !0)
139
109
  ])
140
- ])) : m("", !0),
141
- x(es, {
110
+ ])) : b("", !0),
111
+ t("div", pt, [
112
+ t("div", _t, [
113
+ x(Z, {
114
+ class: "i-semi t-transp",
115
+ fill: "rgb(var(--black)"
116
+ }),
117
+ t("p", ht, [
118
+ bt,
119
+ vt,
120
+ F(l(s.formatDate(e.value.deadline)), 1)
121
+ ])
122
+ ]),
123
+ y(e.value.status) && v(w).name === "Order Edit" ? (i(), m("button", {
124
+ key: 0,
125
+ onClick: q,
126
+ class: "mn-l-auto bg-black t-white button"
127
+ }, " Mark as " + l(V(y(e.value.status))), 1)) : b("", !0)
128
+ ]),
129
+ x(Y, {
142
130
  title: "Change status",
143
131
  onClosePopup: z,
144
- isPopupOpen: I.value,
132
+ isPopupOpen: N.value,
145
133
  class: "bg-white w-min-30r w-max-30r radius-big pd-big"
146
134
  }, {
147
- default: J(() => [
148
- s("p", ks, "Estimated Arrival " + a(t.formatDate(e.value.deadline)), 1),
149
- s("ul", xs, [
150
- (l(!0), o(N, null, $(D.value, (b, c) => (l(), C(W, {
151
- key: b._id,
135
+ default: j(() => [
136
+ x(v(X), {
137
+ modelValue: e.value.deadline,
138
+ "onUpdate:modelValue": a[0] || (a[0] = (u) => e.value.deadline = u),
139
+ "hide-navigation": ["calendar"],
140
+ flow: ["time"],
141
+ class: "z-index-3 bg-grey radius-small pd-small mn-b-thin mn-b-semi"
142
+ }, null, 8, ["modelValue"]),
143
+ ft,
144
+ t("ul", gt, [
145
+ (i(!0), m(I, null, D(P.value, (u, c) => (i(), C(T, {
146
+ key: u._id,
152
147
  editable: !1,
153
- product: b
148
+ product: u
154
149
  }, null, 8, ["product"]))), 128))
155
150
  ]),
156
- s("button", {
157
- onClick: j,
151
+ t("button", {
152
+ onClick: H,
158
153
  class: "w-100 bg-black-small t-white button"
159
- }, a("Confirm Changing to " + F(w(e.value.status))), 1)
154
+ }, l("Confirm Changing to " + V(y(e.value.status))), 1)
160
155
  ]),
161
156
  _: 1
162
157
  }, 8, ["isPopupOpen"]),
163
- e.value ? (l(), o("div", Cs, [
164
- s("div", Os, [
165
- u.value[0] ? (l(), C(rs, {
158
+ e.value ? (i(), m("div", wt, [
159
+ t("div", yt, [
160
+ o.value[0] ? (i(), C(tt, {
166
161
  key: 0,
167
- organization: u.value[0],
162
+ organization: o.value[0],
168
163
  showRating: !0,
169
164
  showFollowers: !1,
170
165
  showProducts: !1,
171
166
  class: "bg-grey mn-b-thin w-100 o-hidden radius-big pd-small"
172
- }, null, 8, ["organization"])) : m("", !0),
173
- s("div", Ss, [
174
- s("div", Ps, [
175
- s("div", Is, [
176
- Ds,
177
- s("span", Ns, a(e.value.status), 1),
178
- $s
179
- ]),
180
- Es
167
+ }, null, 8, ["organization"])) : b("", !0),
168
+ t("div", kt, [
169
+ t("div", xt, [
170
+ t("div", Ct, [
171
+ Ot,
172
+ St,
173
+ t("p", Nt, l(s.formatDate(e.value.createdAt)), 1)
174
+ ])
175
+ ]),
176
+ t("div", Pt, [
177
+ It,
178
+ t("p", Dt, l(((n = e.value.customer.target) == null ? void 0 : n.number) || "Not specified"), 1)
181
179
  ]),
182
- s("div", Ms, [
183
- zs,
184
- s("p", Bs, a((i = e.value.user) == null ? void 0 : i.number), 1)
180
+ t("div", Mt, [
181
+ $t,
182
+ t("p", zt, l(e.value.delivery.address ? e.value.delivery.address.slice(0, 64) : "Not specified"), 1)
185
183
  ]),
186
- (p = e.value.user) != null && p.messenger.type ? (l(), o("div", Fs, [
187
- s("p", As, a((_ = e.value.user) == null ? void 0 : _.messenger.type), 1),
188
- s("p", Rs, a((h = e.value.user) == null ? void 0 : h.messenger.value), 1)
189
- ])) : m("", !0),
190
- Vs,
191
- s("div", Ls, [
192
- Ts,
193
- s("p", Us, a((A = e.value.delivery) == null ? void 0 : A.type), 1)
184
+ t("div", Et, [
185
+ Vt,
186
+ t("p", Bt, l(e.value.delivery.type ? e.value.delivery.type : "Not specified"), 1)
194
187
  ])
195
188
  ]),
196
- f.current.status_history ? (l(), C(ns, {
189
+ g.current.status_history ? (i(), C(et, {
197
190
  key: 1,
198
191
  statuses: d,
199
- statusHistory: f.current.status_history,
200
- statusCurrent: f.current.status,
201
- edit: g(y).name === "Order Edit"
202
- }, null, 8, ["statusHistory", "statusCurrent", "edit"])) : m("", !0),
203
- t.payment && t.payment.Status === "CONFIRMED" ? (l(), o("span", qs, "Paid")) : m("", !0)
192
+ statusHistory: g.current.status_history,
193
+ statusCurrent: g.current.status,
194
+ edit: v(w).name === "Order Edit"
195
+ }, null, 8, ["statusHistory", "statusCurrent", "edit"])) : b("", !0),
196
+ s.payment && s.payment.Status === "CONFIRMED" ? (i(), m("span", At, "Paid")) : b("", !0)
204
197
  ]),
205
- s("div", Hs, [
206
- Ws,
207
- s("ul", Qs, [
208
- (l(!0), o(N, null, $(D.value, (b, c) => (l(), C(W, {
209
- key: b._id,
198
+ t("div", Rt, [
199
+ Ft,
200
+ t("ul", Lt, [
201
+ (i(!0), m(I, null, D(P.value, (u, c) => (i(), C(T, {
202
+ key: u._id,
210
203
  editable: !1,
211
- product: b
204
+ product: u
212
205
  }, null, 8, ["product"]))), 128))
213
206
  ]),
214
- s("div", Ys, [
215
- s("div", js, [
216
- Gs,
217
- s("p", null, a(g(B)) + " " + a(t.returnCurrency()), 1)
207
+ t("div", Tt, [
208
+ t("div", Ut, [
209
+ qt,
210
+ t("p", null, l(v(E)) + " " + l(s.returnCurrency()), 1)
218
211
  ]),
219
- s("div", Js, [
220
- Ks,
221
- s("p", null, a(t.returnCurrency()) + " " + a(Math.trunc(100 + 20 * ((R = u.value[0]) == null ? void 0 : R.distance) - 7, 5 * (((V = u.value[0]) == null ? void 0 : V.distance) / 10))), 1)
212
+ t("div", Ht, [
213
+ Wt,
214
+ t("p", null, l(s.returnCurrency()) + " " + l(Math.trunc(100 + 20 * ((p = o.value[0]) == null ? void 0 : p.distance) - 7, 5 * (((_ = o.value[0]) == null ? void 0 : _.distance) / 10))), 1)
222
215
  ]),
223
- s("div", Xs, [
224
- Zs,
225
- s("p", st, a(t.returnCurrency()) + " " + a(Math.trunc(100 + 20 * ((L = u.value[0]) == null ? void 0 : L.distance) - 7, 5 * (((T = u.value[0]) == null ? void 0 : T.distance) / 10)) + g(B)), 1)
216
+ t("div", jt, [
217
+ Gt,
218
+ t("p", Jt, l(s.returnCurrency()) + " " + l(Math.trunc(100 + 20 * ((h = o.value[0]) == null ? void 0 : h.distance) - 7, 5 * (((B = o.value[0]) == null ? void 0 : B.distance) / 10)) + v(E)), 1)
226
219
  ])
227
220
  ]),
228
- tt,
229
- x(ls, {
230
- username: g(y).name === "Order Status" ? ((U = e.value.user) == null ? void 0 : U.name) || "User" : "Weeder Support",
231
- chatID: g(y).params.order,
221
+ Kt,
222
+ x(st, {
223
+ username: v(w).name === "Order Status" ? ((A = e.value.user) == null ? void 0 : A.name) || "User" : "Weeder Support",
224
+ chatID: v(w).params.order,
232
225
  class: "radius-semi bg-white o-hidden"
233
226
  }, null, 8, ["username", "chatID"])
234
227
  ])
235
- ])) : m("", !0)
236
- ])) : m("", !0);
228
+ ])) : b("", !0)
229
+ ])) : b("", !0);
237
230
  };
238
231
  }
239
- }, gt = /* @__PURE__ */ ds(et, [["__scopeId", "data-v-36d45d04"]]);
232
+ }, _s = /* @__PURE__ */ it(Qt, [["__scopeId", "data-v-ec5fc79c"]]);
240
233
  export {
241
- gt as default
234
+ _s as default
242
235
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("vue-router");require("../../../../components/Field/Field.vue.cjs");const P=require("../../../../components/Button/Button.vue2.cjs"),q=require("../../../../components/Tab/Tab.vue2.cjs"),k=require("../../../../components/Popup/Popup.vue.cjs"),u=require("../../../../components/Block/Block.vue.cjs"),b=require("../../../../components/Feed/Feed.vue.cjs"),_=require("../blocks/CardOrderItem.vue.cjs");require("../../../../components/Select/Select.vue2.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const C=require("../../../users/components/blocks/CardUser.vue.cjs"),V=require("../sections/FormAddCustomer.vue.cjs"),O=require("../sections/FormDelivery.vue.cjs"),E=require("../sections/FormPayment.vue.cjs"),l=require("../../../globals/store/globals.cjs"),F=require("../../../auth/store/auth.cjs"),t=require("../../store/orders.cjs"),S=require("../../../products/store/products.cjs"),D=require("../../store/customers.store.cjs");require("./OrderCreateBackoffice.vue2.cjs");const R={class:"h-100 flex flex-column pd-thin"},T={class:"flex-v-center flex-nowrap flex"},A=e.createElementVNode("h2",{class:"mn-r-auto"},"Create Order",-1),I=e.createElementVNode("h3",{class:"mn-b-small"},"Add to order",-1),z={class:"bg-grey h-max-100 mn-b-thin o-scroll pd-medium radius-big"},L={key:0,class:"w-100"},M={class:"h3 flex"},U=e.createElementVNode("span",{class:"mn-r-auto t-transp"},"In total",-1),j={__name:"OrderCreateBackoffice",setup(G){const a=h.useRoute(),y=h.useRouter();let g=e.computed(()=>Number(t.state.current.positions.reduce((d,n)=>d+n.price*n.quantity,0)));const s=e.ref("positions"),c=e.ref(!1);function v(){c.value=!0}function m(){c.value=!1}const i=e.ref(!1);function B(){i.value=!0}function p(){i.value=!1}e.ref(null);function w(){t.state.current.creator={type:"user",target:F.state.user._id},t.state.current.owner={type:"organization",target:a.params._id},t.state.current.customer={type:"Customer",target:t.state.current.customer._id||null},t.actions.create(t.state.current)}function x(){y.push({name:"Backoffice Orders",params:{_id:a.params._id}})}return e.onMounted(async()=>{}),(d,n)=>(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(u.default,{class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("header",T,[A,e.createVNode(P.default,{submit:w,callback:x,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Add Order ")]),_:1})])]),_:1}),e.createVNode(q.default,{selected:s.value,"onUpdate:selected":n[0]||(n[0]=r=>s.value=r),tabs:[{name:"Positions",value:"positions"},{name:"Customer",value:"customer"},{name:"Delivery",value:"delivery"},{name:"Payment",value:"payment"}],class:"t-medium radius-medium bg-grey mn-b-small"},null,8,["selected"]),e.createVNode(k.default,{onClosePopup:m,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r h-max-100 flex flex-column radius-big pd-medium pos-relative"},{default:e.withCtx(()=>[I,e.createElementVNode("div",z,[e.createVNode(b.default,{search:{placeholder:"Search products...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>S.actions.read(r),state:null},options:{organization:e.unref(a).params._id},class:""},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(_.default,{key:o._id,editable:!1,product:o,onClick:()=>{let f={...o};f.quantity=1,l.actions.add(t.state.current.positions,f),m()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["store","options"])])]),_:1},8,["isPopupOpen"]),s.value==="positions"?(e.openBlock(),e.createBlock(u.default,{key:0,title:"Positions",actions:[{label:"+",function:()=>v()}],class:"mn-b-small"},{default:e.withCtx(()=>[t.state.current.positions.length===0?(e.openBlock(),e.createElementBlock("span",L," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(r,o)=>(e.openBlock(),e.createBlock(_.default,{key:r._id,editable:!0,product:r,onIncrease:()=>{l.actions.increment(t.state.current.positions,r)},onDecrease:()=>{l.actions.decrement(t.state.current.positions,r)},onRemove:()=>{l.actions.delete(t.state.current.positions,r)},class:"mn-b-thin pd-thin radius-medium bg-white"},null,8,["product","onIncrease","onDecrease","onRemove"]))),128))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="customer"?(e.openBlock(),e.createBlock(u.default,{key:1,title:"Customer",class:"mn-b-semi",actions:[{label:"+",function:()=>B()}]},{default:e.withCtx(()=>[t.state.current.customer._id?(e.openBlock(),e.createBlock(C.default,{key:0,user:t.state.current.customer,photo:t.state.current.customer.profile.photo,name:t.state.current.customer.profile.name||t.state.current.customer.phone||t.state.current.customer.email,onClick:n[1]||(n[1]=()=>{t.mutations.resetCustomer(t.state.current.customer)}),class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name"])):(e.openBlock(),e.createBlock(b.default,{key:1,search:{placeholder:"Search customer...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>e.unref(D.default).read(r),state:null},options:{owner:e.unref(a).params._id},class:"bg-grey h-max-20r o-scroll"},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(C.default,{key:o._id,user:o,photo:o.profile.photo,name:o.profile.name||o.phone||o.email,onClick:()=>{t.state.current.customer=o},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"]))),128))]),_:1},8,["store","options"]))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="delivery"?(e.openBlock(),e.createBlock(O.default,{key:2,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),s.value==="payment"?(e.openBlock(),e.createBlock(E.default,{key:3,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),e.createVNode(k.default,{title:"Add customer",onClosePopup:p,isPopupOpen:i.value,class:e.normalizeClass("bg-white w-min-30r w-max-30r radius-big pd-medium")},{default:e.withCtx(()=>[e.createVNode(V.default,{onCallbackCustomer:p})]),_:1},8,["isPopupOpen"]),e.createVNode(u.default,{class:"mn-b-semi"},{default:e.withCtx(()=>[e.createElementVNode("div",M,[U,e.createElementVNode("span",null,e.toDisplayString(e.unref(g))+" "+e.toDisplayString(d.returnCurrency()),1)])]),_:1})]))}};exports.default=j;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("vue-router");require("../../../../components/Field/Field.vue2.cjs");const P=require("../../../../components/Button/Button.vue.cjs"),q=require("../../../../components/Tab/Tab.vue2.cjs"),k=require("../../../../components/Popup/Popup.vue.cjs"),u=require("../../../../components/Block/Block.vue.cjs"),b=require("../../../../components/Feed/Feed.vue.cjs"),_=require("../blocks/CardOrderItem.vue.cjs");require("../../../../components/Select/Select.vue2.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const C=require("../../../users/components/blocks/CardUser.vue.cjs"),V=require("../sections/FormAddCustomer.vue.cjs"),O=require("../sections/FormDelivery.vue.cjs"),E=require("../sections/FormPayment.vue.cjs"),l=require("../../../globals/store/globals.cjs"),F=require("../../../auth/store/auth.cjs"),t=require("../../store/orders.cjs"),S=require("../../../products/store/products.cjs"),D=require("../../store/customers.store.cjs");require("./OrderCreateBackoffice.vue2.cjs");const R={class:"h-100 flex flex-column pd-thin"},T={class:"flex-v-center flex-nowrap flex"},A=e.createElementVNode("h2",{class:"mn-r-auto"},"Create Order",-1),I=e.createElementVNode("h3",{class:"mn-b-small"},"Add to order",-1),z={class:"bg-grey h-max-100 mn-b-thin o-scroll pd-medium radius-big"},L={key:0,class:"w-100"},M={class:"h3 flex"},U=e.createElementVNode("span",{class:"mn-r-auto t-transp"},"In total",-1),j={__name:"OrderCreateBackoffice",setup(G){const a=h.useRoute(),y=h.useRouter();t.mutations.resetOrder(t.state.current);let g=e.computed(()=>Number(t.state.current.positions.reduce((d,n)=>d+n.price*n.quantity,0)));const s=e.ref("positions"),c=e.ref(!1);function v(){c.value=!0}function m(){c.value=!1}const i=e.ref(!1);function B(){i.value=!0}function p(){i.value=!1}e.ref(null);function w(){t.state.current.creator={type:"User",target:F.state.user._id},t.state.current.owner={type:"Organization",target:a.params._id},t.state.current.customer={type:"Customer",target:t.state.current.customer._id||null},t.actions.create(t.state.current)}function x(){y.push({name:"Backoffice Orders",params:{_id:a.params._id}})}return e.onMounted(()=>{}),(d,n)=>(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(u.default,{class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("header",T,[A,e.createVNode(P.default,{submit:w,callback:x,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Add Order ")]),_:1})])]),_:1}),e.createVNode(q.default,{selected:s.value,"onUpdate:selected":n[0]||(n[0]=r=>s.value=r),tabs:[{name:"Positions",value:"positions"},{name:"Customer",value:"customer"},{name:"Delivery",value:"delivery"},{name:"Payment",value:"payment"}],class:"t-medium radius-medium bg-grey mn-b-small"},null,8,["selected"]),e.createVNode(k.default,{onClosePopup:m,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r h-max-100 flex flex-column radius-big pd-medium pos-relative"},{default:e.withCtx(()=>[I,e.createElementVNode("div",z,[e.createVNode(b.default,{search:{placeholder:"Search products...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>S.actions.read(r),state:null},options:{organization:e.unref(a).params._id},class:""},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(_.default,{key:o._id,editable:!1,product:o,onClick:()=>{let f={...o};f.quantity=1,l.actions.add(t.state.current.positions,f),m()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["store","options"])])]),_:1},8,["isPopupOpen"]),s.value==="positions"?(e.openBlock(),e.createBlock(u.default,{key:0,title:"Positions",actions:[{label:"+",function:()=>v()}],class:"mn-b-small"},{default:e.withCtx(()=>[t.state.current.positions.length===0?(e.openBlock(),e.createElementBlock("span",L," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(r,o)=>(e.openBlock(),e.createBlock(_.default,{key:r._id,editable:!0,product:r,onIncrease:()=>{l.actions.increment(t.state.current.positions,r)},onDecrease:()=>{l.actions.decrement(t.state.current.positions,r)},onRemove:()=>{l.actions.delete(t.state.current.positions,r)},class:"mn-b-thin pd-thin radius-medium bg-white"},null,8,["product","onIncrease","onDecrease","onRemove"]))),128))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="customer"?(e.openBlock(),e.createBlock(u.default,{key:1,title:"Customer",class:"mn-b-semi",actions:[{label:"+",function:()=>B()}]},{default:e.withCtx(()=>[t.state.current.customer._id?(e.openBlock(),e.createBlock(C.default,{key:0,user:t.state.current.customer,photo:t.state.current.customer.profile.photo,name:t.state.current.customer.profile.name||t.state.current.customer.phone||t.state.current.customer.email,onClick:n[1]||(n[1]=()=>{t.mutations.resetCustomer(t.state.current.customer)}),class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name"])):(e.openBlock(),e.createBlock(b.default,{key:1,search:{placeholder:"Search customer...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>e.unref(D.default).read(r),state:null},options:{owner:e.unref(a).params._id},class:"bg-grey h-max-20r o-scroll"},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(C.default,{key:o._id,user:o,photo:o.profile.photo,name:o.profile.name||o.phone||o.email,onClick:()=>{t.state.current.customer=o},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"]))),128))]),_:1},8,["store","options"]))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="delivery"?(e.openBlock(),e.createBlock(O.default,{key:2,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),s.value==="payment"?(e.openBlock(),e.createBlock(E.default,{key:3,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),e.createVNode(k.default,{title:"Add customer",onClosePopup:p,isPopupOpen:i.value,class:e.normalizeClass("bg-white w-min-30r w-max-30r radius-big pd-medium")},{default:e.withCtx(()=>[e.createVNode(V.default,{onCallbackCustomer:p})]),_:1},8,["isPopupOpen"]),e.createVNode(u.default,{class:"mn-b-semi"},{default:e.withCtx(()=>[e.createElementVNode("div",M,[U,e.createElementVNode("span",null,e.toDisplayString(e.unref(g))+" "+e.toDisplayString(d.returnCurrency()),1)])]),_:1})]))}};exports.default=j;