@pisell/private-materials 3.3.42 → 3.3.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +5 -5
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +5 -5
  9. package/es/businessModel/SalesModel/index.d.ts +0 -1
  10. package/es/components/Sales/Summary/utils.d.ts +1 -1
  11. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +4 -25
  12. package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
  13. package/es/components/appointmentBooking/components/Cart/Item/index.js +31 -16
  14. package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  15. package/es/components/appointmentBooking/components/Content/index.js +39 -20
  16. package/es/components/appointmentBooking/components/Date/index.js +2 -13
  17. package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
  18. package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  19. package/es/components/appointmentBooking/components/Form/index.js +76 -167
  20. package/es/components/appointmentBooking/components/Form/utils.d.ts +8 -0
  21. package/es/components/appointmentBooking/components/Form/utils.js +36 -0
  22. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  23. package/es/components/appointmentBooking/components/Header/index.js +78 -46
  24. package/es/components/appointmentBooking/components/Resource/index.js +92 -115
  25. package/es/components/appointmentBooking/components/Services/index.js +19 -4
  26. package/es/components/appointmentBooking/components/TimeSlicing/index.js +20 -27
  27. package/es/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
  28. package/es/components/appointmentBooking/context.js +50 -3
  29. package/es/components/appointmentBooking/deposit/index.d.ts +0 -1
  30. package/es/components/appointmentBooking/hooks.d.ts +1 -2
  31. package/es/components/appointmentBooking/hooks.js +377 -269
  32. package/es/components/appointmentBooking/utils.d.ts +91 -2
  33. package/es/components/appointmentBooking/utils.js +350 -61
  34. package/es/components/booking/components/footer/index.d.ts +0 -1
  35. package/es/components/booking/components/voucher/index.d.ts +0 -1
  36. package/es/components/booking/components/voucher/index.js +2 -1
  37. package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  38. package/es/components/booking/hooks/useClearCart.d.ts +0 -1
  39. package/es/components/booking/info/dateRange/index.d.ts +0 -1
  40. package/es/components/booking/info/index.d.ts +0 -1
  41. package/es/components/booking/info/service/Lists.d.ts +0 -1
  42. package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  43. package/es/components/booking/info/service/serviceItem/index.d.ts +0 -1
  44. package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
  45. package/es/components/booking/info/service2/Lists.d.ts +0 -1
  46. package/es/components/booking/info/service2/utils.d.ts +1 -1
  47. package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  48. package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -1
  49. package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
  50. package/es/components/booking/utils.d.ts +2 -2
  51. package/es/components/eftposPay/amount.d.ts +1 -1
  52. package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  53. package/es/components/eftposPay/component/fail/index.d.ts +1 -0
  54. package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
  55. package/es/components/eftposPay/device.d.ts +1 -1
  56. package/es/components/eftposPay/hooks.d.ts +1 -1
  57. package/es/components/eftposPay/index.d.ts +1 -0
  58. package/es/components/eftposPay/pay.d.ts +1 -0
  59. package/es/components/eftposPay/store/index.d.ts +2 -2
  60. package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
  61. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  62. package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
  63. package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
  64. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
  65. package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  66. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  67. package/es/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
  68. package/es/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
  69. package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  70. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  71. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  72. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
  73. package/es/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
  74. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  75. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  76. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  77. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  78. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
  79. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  80. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
  81. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  82. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
  83. package/es/components/eventBooking/index.d.ts +0 -1
  84. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  85. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  86. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  87. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  88. package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
  89. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  90. package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
  91. package/es/components/pisellSelectCustomerModal/index.d.ts +0 -1
  92. package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
  93. package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  94. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  95. package/es/components/productExtension/index.d.ts +0 -1
  96. package/es/components/productSelect/components/TabProduct/index.d.ts +0 -1
  97. package/es/components/productSelect/components/productGroup/index.d.ts +11 -7
  98. package/es/components/productSelect/components/productGroup/index.js +32 -19
  99. package/es/components/productSelect/components/productGroup/index.less +17 -3
  100. package/es/components/productSelect/index.d.ts +3 -2
  101. package/es/components/productSelect/index.js +20 -6
  102. package/es/components/productSelect/index.less +7 -0
  103. package/es/components/shoppingCart/components/Cart/index.d.ts +0 -1
  104. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  105. package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
  106. package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -1
  107. package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
  108. package/es/components/shoppingCart/index.d.ts +0 -1
  109. package/es/components/ticketBooking/components/addServiceVariant/addService.js +11 -3
  110. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  111. package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  112. package/es/components/ticketBooking/index.d.ts +0 -1
  113. package/es/components/wallet/hooks/useWalletCard.d.ts +0 -1
  114. package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
  115. package/lib/businessModel/SalesModel/index.d.ts +0 -1
  116. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  117. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +0 -5
  118. package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
  119. package/lib/components/appointmentBooking/components/Cart/Item/index.js +35 -16
  120. package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  121. package/lib/components/appointmentBooking/components/Content/index.js +37 -21
  122. package/lib/components/appointmentBooking/components/Date/index.js +0 -6
  123. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
  124. package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  125. package/lib/components/appointmentBooking/components/Form/index.js +56 -108
  126. package/lib/components/appointmentBooking/components/Form/utils.d.ts +8 -0
  127. package/lib/components/appointmentBooking/components/Form/utils.js +49 -0
  128. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  129. package/lib/components/appointmentBooking/components/Header/index.js +49 -19
  130. package/lib/components/appointmentBooking/components/Resource/index.js +51 -69
  131. package/lib/components/appointmentBooking/components/Services/index.js +16 -3
  132. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +1 -7
  133. package/lib/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
  134. package/lib/components/appointmentBooking/context.js +52 -4
  135. package/lib/components/appointmentBooking/deposit/index.d.ts +0 -1
  136. package/lib/components/appointmentBooking/hooks.d.ts +1 -2
  137. package/lib/components/appointmentBooking/hooks.js +153 -57
  138. package/lib/components/appointmentBooking/utils.d.ts +91 -2
  139. package/lib/components/appointmentBooking/utils.js +210 -50
  140. package/lib/components/booking/components/footer/index.d.ts +0 -1
  141. package/lib/components/booking/components/voucher/index.d.ts +0 -1
  142. package/lib/components/booking/components/voucher/index.js +2 -1
  143. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  144. package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
  145. package/lib/components/booking/info/dateRange/index.d.ts +0 -1
  146. package/lib/components/booking/info/index.d.ts +0 -1
  147. package/lib/components/booking/info/service/Lists.d.ts +0 -1
  148. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  149. package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -1
  150. package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
  151. package/lib/components/booking/info/service2/Lists.d.ts +0 -1
  152. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  153. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  154. package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -1
  155. package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
  156. package/lib/components/booking/utils.d.ts +2 -2
  157. package/lib/components/eftposPay/amount.d.ts +1 -1
  158. package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
  159. package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
  160. package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
  161. package/lib/components/eftposPay/device.d.ts +1 -1
  162. package/lib/components/eftposPay/hooks.d.ts +1 -1
  163. package/lib/components/eftposPay/index.d.ts +1 -0
  164. package/lib/components/eftposPay/pay.d.ts +1 -0
  165. package/lib/components/eftposPay/store/index.d.ts +2 -2
  166. package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
  167. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  168. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
  169. package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
  170. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
  171. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  172. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  173. package/lib/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
  174. package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
  175. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  176. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  177. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  178. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
  179. package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
  180. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  181. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  182. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  183. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  184. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
  185. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  186. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
  187. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  188. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
  189. package/lib/components/eventBooking/index.d.ts +0 -1
  190. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  191. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  192. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  193. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  194. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
  195. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  196. package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +0 -1
  197. package/lib/components/pisellSelectCustomerModal/index.d.ts +0 -1
  198. package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
  199. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  200. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  201. package/lib/components/productExtension/index.d.ts +0 -1
  202. package/lib/components/productSelect/components/TabProduct/index.d.ts +0 -1
  203. package/lib/components/productSelect/components/productGroup/index.d.ts +11 -7
  204. package/lib/components/productSelect/components/productGroup/index.js +12 -10
  205. package/lib/components/productSelect/components/productGroup/index.less +17 -3
  206. package/lib/components/productSelect/index.d.ts +3 -2
  207. package/lib/components/productSelect/index.js +17 -3
  208. package/lib/components/productSelect/index.less +7 -0
  209. package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -1
  210. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  211. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
  212. package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -1
  213. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
  214. package/lib/components/shoppingCart/index.d.ts +0 -1
  215. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +9 -1
  216. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  217. package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  218. package/lib/components/ticketBooking/index.d.ts +0 -1
  219. package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -1
  220. package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
  221. package/lowcode/product-select/meta.ts +18 -34
  222. package/package.json +2 -2
@@ -20,7 +20,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  var utils_exports = {};
21
21
  __export(utils_exports, {
22
22
  Toast: () => Toast,
23
+ checkAndGoNext: () => checkAndGoNext,
24
+ checkAndMarkCartRenderError: () => checkAndMarkCartRenderError,
23
25
  checkHasFormStep: () => checkHasFormStep,
26
+ currentAppointmentBoard: () => currentAppointmentBoard,
27
+ currentRenderLists: () => currentRenderLists,
24
28
  formatCarts: () => formatCarts,
25
29
  formatCartsResources: () => formatCartsResources,
26
30
  formatCurrentUser: () => formatCurrentUser,
@@ -28,13 +32,19 @@ __export(utils_exports, {
28
32
  formatForms: () => formatForms,
29
33
  formatGuest: () => formatGuest,
30
34
  formatHolder: () => formatHolder,
35
+ getCartCurrentResourceData: () => getCartCurrentResourceData,
36
+ getCurrentBoard: () => getCurrentBoard,
31
37
  getCustomer: () => getCustomer,
38
+ getFormInsertBeforeKey: () => getFormInsertBeforeKey,
32
39
  getMeAccount: () => getMeAccount,
40
+ getMultiResources: () => getMultiResources,
33
41
  getPunctuationMark: () => getPunctuationMark,
42
+ getResourceTitle: () => getResourceTitle,
34
43
  hasResourceFormId: () => hasResourceFormId,
35
44
  openForm: () => openForm,
36
45
  sortResources: () => sortResources,
37
46
  updateBookingFormStorage: () => updateBookingFormStorage,
47
+ updateCartResources: () => updateCartResources,
38
48
  updateLists: () => updateLists
39
49
  });
40
50
  module.exports = __toCommonJS(utils_exports);
@@ -276,69 +286,213 @@ var Toast = (text) => {
276
286
  var checkHasFormStep = ({ setIsErrorHolder, nextStep, isSkip, checkHolder, checkAccount, carts, setCarts, hasResourceFormId: hasResourceFormId2, currentStep, stepList, appointmentBooking, locales: locales2, isLogin, openLoginModal, isFormSubject, utils, accountLists, getHolders }) => {
277
287
  var _a, _b, _c;
278
288
  let isNext = false;
279
- if (hasResourceFormId2) {
280
- const index = (currentStep == null ? void 0 : currentStep.index) + 1;
281
- const description = locales2.getText("pisell2.appointment.fill-form");
282
- const isExist = stepList == null ? void 0 : stepList.some((item) => (item == null ? void 0 : item.key) === "select-time");
283
- appointmentBooking.addStep({ index, key: "fill-form", description }, isExist ? "select-time" : void 0);
284
- } else {
285
- appointmentBooking.removeStep("fill-form");
286
- }
287
289
  const stepLists = (_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList;
288
- if ((currentStep == null ? void 0 : currentStep.index) + 2 === (stepLists == null ? void 0 : stepLists.length)) {
289
- const _checkHolder = () => {
290
- const result = checkHolder({
291
- isFormSubject,
292
- checkAccount,
293
- carts
294
- });
295
- if (result) {
296
- setCarts(result);
297
- }
298
- setIsErrorHolder(!!result);
299
- if (!!result) return true;
290
+ };
291
+ var getCartCurrentResourceData = (cart, currentKey, resources) => {
292
+ var _a, _b, _c, _d, _e, _f, _g;
293
+ try {
294
+ const currentFormId = (_b = (_a = currentKey == null ? void 0 : currentKey.split("_@")) == null ? void 0 : _a[1]) == null ? void 0 : _b.split("-");
295
+ const form_id = Number((currentFormId == null ? void 0 : currentFormId[0]) || ((_e = (_d = (_c = resources == null ? void 0 : resources[0]) == null ? void 0 : _c.resources) == null ? void 0 : _d[0]) == null ? void 0 : _e.id));
296
+ if (!form_id || !resources.length) return;
297
+ const cartId = cart._id;
298
+ const cartOriginResources = ((_f = cart._origin) == null ? void 0 : _f.resources) || [];
299
+ const resourceData = resources.find((r) => String(r._id) === String(cartId));
300
+ if (!resourceData) return;
301
+ let resourceItem = (resourceData.resources || []).find((r) => Number(r.id) === form_id);
302
+ if (!resourceItem) return;
303
+ resourceItem = {
304
+ ...resourceItem,
305
+ renderList: ((_g = resourceItem == null ? void 0 : resourceItem.renderList) == null ? void 0 : _g.map((r) => {
306
+ return {
307
+ ...r,
308
+ label: (r == null ? void 0 : r.main_field) || (r == null ? void 0 : r.id)
309
+ };
310
+ })) || []
300
311
  };
301
- if (!isLogin) {
302
- utils.action({
303
- type: "pisell1.login",
304
- data: {
305
- type: "plugin"
306
- },
307
- callback: (status) => {
308
- var _a2;
309
- if (status === "success") {
310
- if (!isFormSubject) {
311
- const user = JSON.parse(((_a2 = utils == null ? void 0 : utils.storage) == null ? void 0 : _a2.get("customer")) || "{}");
312
- const currentUser = formatCustomer(user);
313
- const meAccount = accountLists == null ? void 0 : accountLists.find((d) => !(d == null ? void 0 : d.isGuest));
314
- appointmentBooking.setLoginAccount(meAccount == null ? void 0 : meAccount.id, currentUser);
315
- } else {
316
- getHolders();
317
- }
318
- if (isSkip) {
319
- isNext = true;
312
+ const cartResource = cartOriginResources.find((r) => Number(r.form_id) === form_id);
313
+ const renderId = (cartResource == null ? void 0 : cartResource.id) || 0;
314
+ const renderItem = ((resourceItem == null ? void 0 : resourceItem.renderList) || []).find((r) => Number(r == null ? void 0 : r.id) === Number(renderId));
315
+ return {
316
+ cartItem: cart,
317
+ resourceItem: {
318
+ ...resourceItem,
319
+ originRenderLists: resourceData.resources
320
+ },
321
+ renderItem
322
+ };
323
+ } catch (error) {
324
+ return cart;
325
+ }
326
+ };
327
+ var getMultiResources = (cart, currentSelectedResource, currentKey) => {
328
+ var _a;
329
+ const resourceItem = currentSelectedResource == null ? void 0 : currentSelectedResource.resourceItem;
330
+ if (!resourceItem || !cart) return [];
331
+ const isCurrentResourceStep = currentKey.startsWith("select-resource");
332
+ let resources = ((_a = cart == null ? void 0 : cart._origin) == null ? void 0 : _a.resources) || [];
333
+ let selectedResources = isCurrentResourceStep ? resources.filter((r) => (r == null ? void 0 : r.form_id) !== (resourceItem == null ? void 0 : resourceItem.form_id)) : resources;
334
+ selectedResources = selectedResources.map((r) => {
335
+ return {
336
+ ...r,
337
+ name: (r == null ? void 0 : r.main_field) || (r == null ? void 0 : r.id),
338
+ isShowChangeResource: false,
339
+ is_hide_like: true
340
+ };
341
+ });
342
+ let currentResources = resources.find((r) => (r == null ? void 0 : r.form_id) === (resourceItem == null ? void 0 : resourceItem.form_id));
343
+ const errorTip = (currentSelectedResource == null ? void 0 : currentSelectedResource.errorTip) || {};
344
+ let currentResource = isCurrentResourceStep ? [{
345
+ allowClearResource: true,
346
+ lists: (resourceItem == null ? void 0 : resourceItem.renderList) || [],
347
+ is_hide_like: true,
348
+ id: currentResources == null ? void 0 : currentResources.id,
349
+ isErrorResource: (errorTip == null ? void 0 : errorTip.isErrorResource) || false,
350
+ resourceErrorText: (errorTip == null ? void 0 : errorTip.resourceErrorText) || ""
351
+ }] : [];
352
+ return [...selectedResources, ...currentResource];
353
+ };
354
+ var getCurrentBoard = (appointmentBooking, code) => {
355
+ var _a;
356
+ const { appointmentBoard } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
357
+ const resourceConfig = (_a = appointmentBoard == null ? void 0 : appointmentBoard.resource_tab) == null ? void 0 : _a[code];
358
+ return resourceConfig;
359
+ };
360
+ var getResourceTitle = (appointmentBooking, code, utils, originResource) => {
361
+ const resourceConfig = getCurrentBoard(appointmentBooking, code);
362
+ let name = "";
363
+ if (resourceConfig == null ? void 0 : resourceConfig.resource_type_title) {
364
+ name = utils.translation(resourceConfig == null ? void 0 : resourceConfig.resource_type_title);
365
+ } else {
366
+ name = (originResource == null ? void 0 : originResource.title) || "";
367
+ }
368
+ return name;
369
+ };
370
+ var checkAndMarkCartRenderError = (carts, appointmentBooking, utils) => {
371
+ try {
372
+ let hasError = false;
373
+ const updatedCartList = carts == null ? void 0 : carts.map((cart) => {
374
+ const currentResource = cart == null ? void 0 : cart.currentSelectedResource;
375
+ if (!(currentResource == null ? void 0 : currentResource.renderItem)) {
376
+ hasError = true;
377
+ const resourceItem = (currentResource == null ? void 0 : currentResource.resourceItem) || {};
378
+ const name = getResourceTitle(appointmentBooking, resourceItem == null ? void 0 : resourceItem.code, utils, resourceItem);
379
+ return {
380
+ ...cart,
381
+ currentSelectedResource: {
382
+ ...currentResource,
383
+ errorTip: {
384
+ isErrorResource: true,
385
+ resourceErrorText: name
320
386
  }
321
387
  }
322
- }
323
- });
324
- } else {
325
- isNext = true;
326
- }
327
- if (isNext && !_checkHolder()) {
328
- nextStep();
388
+ };
389
+ }
390
+ return cart;
391
+ });
392
+ return {
393
+ hasError,
394
+ updatedCartList
395
+ };
396
+ } catch (error) {
397
+ return {};
398
+ }
399
+ };
400
+ var getFormInsertBeforeKey = (currentKey, stepList) => {
401
+ const isFirstResource = currentKey === "select-resource";
402
+ const timeStep = stepList.find((item) => item.key.startsWith("select-time"));
403
+ if (isFirstResource && timeStep) {
404
+ return timeStep.key;
405
+ } else {
406
+ return currentKey;
407
+ }
408
+ };
409
+ var checkAndGoNext = (isFormSubject, checkAccount, carts) => {
410
+ let hasError = false;
411
+ let updatedCartList = [...carts];
412
+ if (isFormSubject && !checkAccount("holder")) {
413
+ updatedCartList = carts == null ? void 0 : carts.map((item) => {
414
+ if (!(item == null ? void 0 : item.holder_id)) {
415
+ hasError = true;
416
+ return {
417
+ ...item,
418
+ isErrorHolder: true
419
+ };
420
+ }
421
+ return item;
422
+ });
423
+ }
424
+ return {
425
+ hasError,
426
+ updatedCartList
427
+ };
428
+ };
429
+ var currentAppointmentBoard = (currentKey, resources, appointmentBooking) => {
430
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
431
+ try {
432
+ const currentStepKey = (_b = (_a = currentKey == null ? void 0 : currentKey.split("_@")) == null ? void 0 : _a[1]) == null ? void 0 : _b.split("-");
433
+ const form_id = Number((currentStepKey == null ? void 0 : currentStepKey[0]) || ((_e = (_d = (_c = resources == null ? void 0 : resources[0]) == null ? void 0 : _c.resources) == null ? void 0 : _d[0]) == null ? void 0 : _e.id));
434
+ const form_code = (currentStepKey == null ? void 0 : currentStepKey[1]) || ((_h = (_g = (_f = resources == null ? void 0 : resources[0]) == null ? void 0 : _f.resources) == null ? void 0 : _g[0]) == null ? void 0 : _h.code);
435
+ const cart_id = currentStepKey == null ? void 0 : currentStepKey[2];
436
+ const resource_form_id = currentStepKey == null ? void 0 : currentStepKey[3];
437
+ const policy_id = currentStepKey == null ? void 0 : currentStepKey[4];
438
+ const resource_tab = (_j = (_i = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _i.appointmentBoard) == null ? void 0 : _j.resource_tab;
439
+ const config = resource_tab == null ? void 0 : resource_tab[form_code];
440
+ const isRequired = (config == null ? void 0 : config.customer_resource) === "customer_resource_required";
441
+ const isSystem = (config == null ? void 0 : config.customer_resource) === "customer_resource_system";
442
+ const isSkip = (config == null ? void 0 : config.hasOwnProperty("resource_skip_select")) ? !!(config == null ? void 0 : config.resource_skip_select) : true;
443
+ return {
444
+ isRequired,
445
+ isSystem,
446
+ isSkip,
447
+ form_id,
448
+ form_code,
449
+ cart_id,
450
+ resource_form_id,
451
+ policy_id
452
+ };
453
+ } catch (error) {
454
+ return {};
455
+ }
456
+ };
457
+ var currentRenderLists = (resources, code) => {
458
+ var _a;
459
+ if (!(resources == null ? void 0 : resources.length) || !code) return [];
460
+ const _resources = ((_a = resources == null ? void 0 : resources[0]) == null ? void 0 : _a.resources) || [];
461
+ const currentResource = _resources == null ? void 0 : _resources.find((item) => item.code === code);
462
+ return (currentResource == null ? void 0 : currentResource.renderList) || [];
463
+ };
464
+ var updateCartResources = (item, value, currentSelectedResources) => {
465
+ var _a, _b, _c;
466
+ let newResource = [];
467
+ let resources = ((_a = item == null ? void 0 : item._origin) == null ? void 0 : _a.resources) || [];
468
+ if (value) {
469
+ const currentResourceIndex = resources.findIndex(
470
+ (item2) => item2.form_id === value.form_id
471
+ );
472
+ if (currentResourceIndex > -1) {
473
+ newResource = resources.map(
474
+ (item2) => item2.form_id === value.form_id ? value : item2
475
+ );
329
476
  } else {
330
- return true;
477
+ newResource = [...resources, value];
331
478
  }
332
479
  } else {
333
- if (isSkip) {
334
- nextStep();
335
- }
480
+ const currentResource = currentSelectedResources == null ? void 0 : currentSelectedResources.find(
481
+ (resource) => (resource == null ? void 0 : resource._id) === (item == null ? void 0 : item._id)
482
+ );
483
+ const form_id = (_c = (_b = currentResource == null ? void 0 : currentResource.currentSelectedResource) == null ? void 0 : _b.renderItem) == null ? void 0 : _c.form_id;
484
+ newResource = resources.filter((item2) => item2.form_id !== form_id);
336
485
  }
486
+ return newResource || [];
337
487
  };
338
488
  // Annotate the CommonJS export names for ESM import in node:
339
489
  0 && (module.exports = {
340
490
  Toast,
491
+ checkAndGoNext,
492
+ checkAndMarkCartRenderError,
341
493
  checkHasFormStep,
494
+ currentAppointmentBoard,
495
+ currentRenderLists,
342
496
  formatCarts,
343
497
  formatCartsResources,
344
498
  formatCurrentUser,
@@ -346,12 +500,18 @@ var checkHasFormStep = ({ setIsErrorHolder, nextStep, isSkip, checkHolder, check
346
500
  formatForms,
347
501
  formatGuest,
348
502
  formatHolder,
503
+ getCartCurrentResourceData,
504
+ getCurrentBoard,
349
505
  getCustomer,
506
+ getFormInsertBeforeKey,
350
507
  getMeAccount,
508
+ getMultiResources,
351
509
  getPunctuationMark,
510
+ getResourceTitle,
352
511
  hasResourceFormId,
353
512
  openForm,
354
513
  sortResources,
355
514
  updateBookingFormStorage,
515
+ updateCartResources,
356
516
  updateLists
357
517
  });
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  /**
4
3
  * @title: 底部
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const VoucherCard: (props: any) => JSX.Element | null;
4
3
  export default VoucherCard;
@@ -102,7 +102,8 @@ var VoucherCard = (props) => {
102
102
  return val;
103
103
  }, [state.service.value]);
104
104
  (0, import_react.useEffect)(() => {
105
- if (productRef.current === state.service.value) {
105
+ var _a2, _b2;
106
+ if (productRef.current === state.service.value || !((_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length)) {
106
107
  return;
107
108
  }
108
109
  if (isBooking4Shop) {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SendModalValues } from './index';
3
2
  declare const useSendModal: (bookingId?: number) => {
4
3
  open: boolean;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const useClearCart: (state: any, dispatch: any) => false | JSX.Element;
3
2
  export default useClearCart;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  export declare const disabledDate: (current: any, position: any, currentDate: any) => any;
4
3
  declare const DateRange: ({ state, dispatch, key }: any) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { InfoProps } from './main';
3
2
  declare const APP: (props: InfoProps) => JSX.Element;
4
3
  export default APP;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Lists: ({ onEdit, onChange, onAction, isParallelResource }: any) => JSX.Element;
3
2
  export default Lists;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const BookingList: ({ items }: {
3
2
  items: any[];
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ServiceItem: ({ d, handleEditService, state, handleLike, resourceItem, errorMessage, handleDeleteService, }: any) => JSX.Element;
4
3
  export default ServiceItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ServiceList: ({ onEdit }: {
4
3
  onEdit: any;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Lists: ({ onEdit, onChange }: any) => JSX.Element;
3
2
  export default Lists;
@@ -241,4 +241,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
241
241
  * @Author: WangHan
242
242
  * @Date: 2024-12-24 11:32
243
243
  */
244
- export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
244
+ export declare const updateServicePrice: (state: any) => Promise<any> | never[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import '../../../info/service/addTimeModal/index.less';
3
2
  declare const AddTimeModal: () => JSX.Element;
4
3
  export default AddTimeModal;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ServiceItem: ({ d, handleEditService, state, handleLike, errorMessage, handleDeleteService, }: any) => JSX.Element;
4
3
  export default ServiceItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ServiceList: ({ onEdit }: {
4
3
  onEdit: any;
@@ -163,10 +163,10 @@ export declare const getProductTotalPrice: (item: any) => number;
163
163
  export declare const getDuration: (duration: number | {
164
164
  type: string;
165
165
  value: number;
166
- }) => number | {
166
+ }) => number | "flexible" | {
167
167
  type: string;
168
168
  value: number;
169
- } | "flexible";
169
+ };
170
170
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
171
171
  export declare const getIsEdit: (state: any) => boolean;
172
172
  export {};
@@ -9,7 +9,7 @@ import { PosProps } from './const';
9
9
  */
10
10
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
11
11
  className?: string | undefined;
12
- onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
12
+ onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
13
13
  [keys: string]: unknown;
14
14
  } | undefined, other?: any) => void) | undefined;
15
15
  onClose: () => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ActionProps } from '../../const';
2
3
  declare const _default: ({ className, isMobile, onChange }: ActionProps) => JSX.Element;
3
4
  export default _default;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ActionProps } from '../../const';
2
3
  declare const _default: ({ onChange, className, isMobile }: ActionProps) => JSX.Element;
3
4
  export default _default;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ActionProps } from '../../const';
2
3
  /**
3
4
  * @title: 支付状态未知页面
@@ -11,7 +11,7 @@ import './device.less';
11
11
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
12
12
  api: PayProps['api'];
13
13
  className?: string | undefined;
14
- onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
14
+ onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
15
15
  [keys: string]: unknown;
16
16
  } | undefined, other?: any) => void) | undefined;
17
17
  onClose: () => void;
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
22
- readonly eftposRef: React.MutableRefObject<"payo" | "tyro" | "windcave" | "stripe">;
22
+ readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PosProps } from './const';
2
3
  import './index.less';
3
4
  declare const _default: (props: PosProps) => JSX.Element | null;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PayProps } from './const';
2
3
  import './index.less';
3
4
  /**
@@ -297,8 +297,8 @@ export declare const backUpFree: (payload: Partial<State>) => {
297
297
  amount?: string | number | undefined;
298
298
  mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
- eftpos?: "payo" | "tyro" | "windcave" | "stripe" | undefined;
301
- action?: "amount" | "pay" | "deviceList" | undefined;
300
+ eftpos?: "stripe" | "payo" | "tyro" | "windcave" | undefined;
301
+ action?: "amount" | "deviceList" | "pay" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
304
304
  title?: string | undefined;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const _default: ({ api, onChange, formatAmount, }: {
2
3
  api: any;
3
4
  onChange: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ErrorTip: ({ text }: any) => JSX.Element;
4
3
  export default ErrorTip;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Total: ({ className, isFooter }: any) => JSX.Element;
4
3
  export default Total;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const CartItem: () => JSX.Element;
4
3
  export default CartItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Cart: ({ open, onCancel }: any) => JSX.Element;
4
3
  export default Cart;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Layout: () => JSX.Element;
4
3
  export default Layout;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const EmptyHolderModal: (props: any) => JSX.Element;
4
3
  export default EmptyHolderModal;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Event: () => JSX.Element;
4
3
  export default Event;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Footer: () => JSX.Element;
4
3
  export default Footer;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Header: () => JSX.Element;
4
3
  export default Header;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const InformationOptionsModal: (props: any) => JSX.Element;
4
3
  export default InformationOptionsModal;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const OrderProductModal: (props: any) => JSX.Element;
4
3
  export default OrderProductModal;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const RemoveOptionConfirmModal: (props: any) => JSX.Element;
3
2
  export default RemoveOptionConfirmModal;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Resource: () => JSX.Element;
4
3
  export default Resource;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const SelectHolderModal: (props: any) => JSX.Element;
3
2
  export default SelectHolderModal;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type CallToBookProps = {
3
2
  show: boolean;
4
3
  type: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const WeekItem: (props: any) => JSX.Element;
4
3
  export default WeekItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare type CalenDateWeekProps = {
4
3
  currentDate: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const BookingOptions: (props: {
3
2
  onChangeBookingOption?: ((bookingOption: any) => void) | undefined;
4
3
  }) => JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Resource: (props: any) => JSX.Element;
3
2
  export default Resource;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Schedule: () => JSX.Element;
3
2
  export default Schedule;