@pisell/pisellos 2.3.44 → 2.3.45

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 (146) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  2. package/dist/modules/Discount/index.d.ts +0 -1
  3. package/dist/modules/Discount/index.js +11 -40
  4. package/dist/modules/Discount/types.d.ts +0 -1
  5. package/dist/modules/OpenData/index.js +2 -2
  6. package/dist/modules/Order/index.d.ts +2 -4
  7. package/dist/modules/Order/index.js +25 -54
  8. package/dist/modules/Order/types.d.ts +0 -9
  9. package/dist/modules/Order/utils.d.ts +0 -10
  10. package/dist/modules/Order/utils.js +3 -35
  11. package/dist/modules/Product/types.d.ts +0 -1
  12. package/dist/modules/ProductList/index.js +14 -33
  13. package/dist/modules/Quotation/index.d.ts +1 -1
  14. package/dist/modules/Quotation/index.js +2 -2
  15. package/dist/modules/Rules/index.js +13 -47
  16. package/dist/modules/SalesSummary/index.js +13 -12
  17. package/dist/modules/ScanOrderLogger/index.d.ts +0 -2
  18. package/dist/modules/ScanOrderLogger/index.js +2 -15
  19. package/dist/modules/ScanOrderLogger/providers/feishu.js +27 -45
  20. package/dist/modules/ScanOrderLogger/types.d.ts +0 -1
  21. package/dist/modules/Schedule/index.d.ts +1 -3
  22. package/dist/modules/Schedule/index.js +16 -21
  23. package/dist/modules/Summary/utils.js +13 -38
  24. package/dist/modules/index.d.ts +0 -2
  25. package/dist/modules/index.js +1 -3
  26. package/dist/plugins/window.d.ts +0 -1
  27. package/dist/server/index.d.ts +0 -14
  28. package/dist/server/index.js +657 -772
  29. package/dist/solution/BaseSales/index.d.ts +0 -7
  30. package/dist/solution/BaseSales/index.js +42 -64
  31. package/dist/solution/BookingByStep/index.d.ts +1 -16
  32. package/dist/solution/BookingByStep/index.js +215 -294
  33. package/dist/solution/BookingByStep/types.d.ts +1 -2
  34. package/dist/solution/BookingByStep/types.js +1 -3
  35. package/dist/solution/BookingByStep/utils/capacity.js +1 -17
  36. package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  37. package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
  38. package/dist/solution/BookingTicket/index.d.ts +2 -14
  39. package/dist/solution/BookingTicket/index.js +2 -2
  40. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  41. package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -10
  42. package/dist/solution/ScanOrder/index.d.ts +14 -26
  43. package/dist/solution/ScanOrder/index.js +739 -1142
  44. package/dist/solution/ScanOrder/types.d.ts +1 -21
  45. package/dist/solution/ScanOrder/utils.d.ts +0 -8
  46. package/dist/solution/ScanOrder/utils.js +25 -66
  47. package/dist/solution/ShopDiscount/index.d.ts +0 -1
  48. package/dist/solution/ShopDiscount/index.js +87 -125
  49. package/dist/solution/VenueBooking/index.d.ts +11 -39
  50. package/dist/solution/VenueBooking/index.js +841 -1167
  51. package/dist/solution/VenueBooking/types.d.ts +0 -3
  52. package/dist/solution/VenueBooking/utils/resource.js +0 -1
  53. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  54. package/dist/solution/VenueBooking/utils/slotMerge.js +5 -10
  55. package/dist/solution/index.d.ts +0 -1
  56. package/dist/solution/index.js +1 -2
  57. package/dist/types/index.d.ts +0 -1
  58. package/lib/modules/Discount/index.d.ts +0 -1
  59. package/lib/modules/Discount/index.js +0 -9
  60. package/lib/modules/Discount/types.d.ts +0 -1
  61. package/lib/modules/OpenData/index.js +1 -1
  62. package/lib/modules/Order/index.d.ts +2 -4
  63. package/lib/modules/Order/index.js +10 -26
  64. package/lib/modules/Order/types.d.ts +0 -9
  65. package/lib/modules/Order/utils.d.ts +0 -10
  66. package/lib/modules/Order/utils.js +5 -36
  67. package/lib/modules/Product/types.d.ts +0 -1
  68. package/lib/modules/ProductList/index.js +31 -40
  69. package/lib/modules/Quotation/index.d.ts +1 -1
  70. package/lib/modules/Quotation/index.js +2 -2
  71. package/lib/modules/Rules/index.js +16 -33
  72. package/lib/modules/SalesSummary/index.js +7 -6
  73. package/lib/modules/ScanOrderLogger/index.d.ts +0 -2
  74. package/lib/modules/ScanOrderLogger/index.js +1 -13
  75. package/lib/modules/ScanOrderLogger/providers/feishu.js +6 -15
  76. package/lib/modules/ScanOrderLogger/types.d.ts +0 -1
  77. package/lib/modules/Schedule/index.d.ts +1 -3
  78. package/lib/modules/Schedule/index.js +8 -10
  79. package/lib/modules/Summary/utils.js +1 -21
  80. package/lib/modules/index.d.ts +0 -2
  81. package/lib/modules/index.js +1 -5
  82. package/lib/plugins/window.d.ts +0 -1
  83. package/lib/server/index.d.ts +0 -14
  84. package/lib/server/index.js +5 -65
  85. package/lib/solution/BaseSales/index.d.ts +0 -7
  86. package/lib/solution/BaseSales/index.js +8 -24
  87. package/lib/solution/BookingByStep/index.d.ts +1 -16
  88. package/lib/solution/BookingByStep/index.js +18 -60
  89. package/lib/solution/BookingByStep/types.d.ts +1 -2
  90. package/lib/solution/BookingByStep/types.js +0 -5
  91. package/lib/solution/BookingByStep/utils/capacity.js +1 -20
  92. package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  93. package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
  94. package/lib/solution/BookingTicket/index.d.ts +2 -14
  95. package/lib/solution/BookingTicket/index.js +2 -10
  96. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  97. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
  98. package/lib/solution/ScanOrder/index.d.ts +14 -26
  99. package/lib/solution/ScanOrder/index.js +182 -449
  100. package/lib/solution/ScanOrder/types.d.ts +1 -21
  101. package/lib/solution/ScanOrder/utils.d.ts +0 -8
  102. package/lib/solution/ScanOrder/utils.js +0 -31
  103. package/lib/solution/ShopDiscount/index.d.ts +0 -1
  104. package/lib/solution/ShopDiscount/index.js +0 -14
  105. package/lib/solution/VenueBooking/index.d.ts +11 -39
  106. package/lib/solution/VenueBooking/index.js +110 -322
  107. package/lib/solution/VenueBooking/types.d.ts +0 -3
  108. package/lib/solution/VenueBooking/utils/resource.js +0 -1
  109. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  110. package/lib/solution/VenueBooking/utils/slotMerge.js +4 -6
  111. package/lib/solution/index.d.ts +0 -1
  112. package/lib/solution/index.js +1 -3
  113. package/lib/types/index.d.ts +0 -1
  114. package/package.json +1 -1
  115. package/dist/modules/Holder/index.d.ts +0 -48
  116. package/dist/modules/Holder/index.js +0 -640
  117. package/dist/modules/Holder/types.d.ts +0 -123
  118. package/dist/modules/Holder/types.js +0 -1
  119. package/dist/modules/Holder/utils.d.ts +0 -13
  120. package/dist/modules/Holder/utils.js +0 -34
  121. package/dist/modules/ResourcePlanner/index.d.ts +0 -24
  122. package/dist/modules/ResourcePlanner/index.js +0 -181
  123. package/dist/modules/ResourcePlanner/planner.d.ts +0 -14
  124. package/dist/modules/ResourcePlanner/planner.js +0 -1069
  125. package/dist/modules/ResourcePlanner/types.d.ts +0 -227
  126. package/dist/modules/ResourcePlanner/types.js +0 -1
  127. package/dist/solution/UnifiedBookingSales/index.d.ts +0 -183
  128. package/dist/solution/UnifiedBookingSales/index.js +0 -1891
  129. package/dist/solution/UnifiedBookingSales/types.d.ts +0 -143
  130. package/dist/solution/UnifiedBookingSales/types.js +0 -11
  131. package/lib/modules/Holder/index.d.ts +0 -48
  132. package/lib/modules/Holder/index.js +0 -402
  133. package/lib/modules/Holder/types.d.ts +0 -123
  134. package/lib/modules/Holder/types.js +0 -17
  135. package/lib/modules/Holder/utils.d.ts +0 -13
  136. package/lib/modules/Holder/utils.js +0 -71
  137. package/lib/modules/ResourcePlanner/index.d.ts +0 -24
  138. package/lib/modules/ResourcePlanner/index.js +0 -148
  139. package/lib/modules/ResourcePlanner/planner.d.ts +0 -14
  140. package/lib/modules/ResourcePlanner/planner.js +0 -933
  141. package/lib/modules/ResourcePlanner/types.d.ts +0 -227
  142. package/lib/modules/ResourcePlanner/types.js +0 -17
  143. package/lib/solution/UnifiedBookingSales/index.d.ts +0 -183
  144. package/lib/solution/UnifiedBookingSales/index.js +0 -1084
  145. package/lib/solution/UnifiedBookingSales/types.d.ts +0 -143
  146. package/lib/solution/UnifiedBookingSales/types.js +0 -33
@@ -1,16 +1,14 @@
1
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
2
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
3
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
5
4
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
5
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6
6
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
7
7
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
8
8
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
9
9
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
10
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
11
11
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
- function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
13
- function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
14
12
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
15
13
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
16
14
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -30,7 +28,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
30
28
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
31
29
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
32
30
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
33
- import { BaseSalesImpl } from "../BaseSales";
31
+ import { BaseModule } from "../../modules/BaseModule";
34
32
  import { DEFAULT_SLOT_CONFIG, VenueBookingHooks } from "./types";
35
33
  import { attachItemRuleLimitsToTopLevelProducts, buildProductKey, buildItemRuleBusinessData, createEmptySummary, getProductIdentityIndex, getSafeProductNum, normalizeOrderProduct, normalizeItemRuleStrategies, toNonNegativeInt, toPriceString } from "./utils";
36
34
  import { createModule } from "../BookingByStep/types";
@@ -51,8 +49,6 @@ import { composeLinePrice, createUuidV4, getProductSkuOptions, sumOptionUnitPric
51
49
  import { OrderModule } from "../../modules/Order";
52
50
  import { RegisterAndLoginHooks } from "../RegisterAndLogin/types";
53
51
  import Decimal from 'decimal.js';
54
- import { HolderModule } from "../../modules/Holder";
55
- import { getFormIdFromHolderConfig, getProductHolderConfig } from "../../modules/Holder/utils";
56
52
  export * from "./types";
57
53
  var OPEN_DATA_SECTION_CODES = ['basic', 'fulfillment', 'reservation', 'sale', 'menu', 'availability', 'workflow', 'checkout'];
58
54
  function isItemRewardProductDiscount(discount) {
@@ -67,8 +63,8 @@ function cloneCustomDepositData(customDepositData) {
67
63
  deposit_policy_data: Array.isArray(customDepositData.deposit_policy_data) ? _toConsumableArray(customDepositData.deposit_policy_data) : []
68
64
  });
69
65
  }
70
- export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
71
- _inherits(VenueBookingImpl, _BaseSalesImpl);
66
+ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
67
+ _inherits(VenueBookingImpl, _BaseModule);
72
68
  var _super = _createSuper(VenueBookingImpl);
73
69
  function VenueBookingImpl(name, version) {
74
70
  var _this;
@@ -277,76 +273,6 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
277
273
  }
278
274
  return addLog;
279
275
  }()
280
- }, {
281
- key: "getRegisteredModuleNames",
282
- value: function getRegisteredModuleNames() {
283
- return ['scanOrderLogger', 'products', 'order', 'salesSummary', 'venueProducts', 'addonProducts', 'date', 'schedule', 'quotation', 'openData'];
284
- }
285
- }, {
286
- key: "createSubModule",
287
- value: function createSubModule(moduleName) {
288
- switch (moduleName) {
289
- case 'scanOrderLogger':
290
- return createModule('scanOrderLogger', this.name);
291
- case 'venueProducts':
292
- return new ProductList("".concat(this.name, "_venueProducts"));
293
- case 'addonProducts':
294
- return new ProductList("".concat(this.name, "_addonProducts"));
295
- case 'date':
296
- return new DateModule("".concat(this.name, "_date"));
297
- case 'openData':
298
- return new OpenDataModule("".concat(this.name, "_openData"));
299
- default:
300
- return _get(_getPrototypeOf(VenueBookingImpl.prototype), "createSubModule", this).call(this, moduleName);
301
- }
302
- }
303
- }, {
304
- key: "attachProductOriginToTempOrder",
305
- value: function attachProductOriginToTempOrder(tempOrder, productUid, origin) {
306
- var _tempOrder$_extend, _tempOrder$_extend2;
307
- if (!productUid || !origin) return;
308
- tempOrder._extend = _objectSpread(_objectSpread({}, tempOrder._extend || {}), {}, {
309
- productsByUid: _objectSpread(_objectSpread({}, ((_tempOrder$_extend = tempOrder._extend) === null || _tempOrder$_extend === void 0 ? void 0 : _tempOrder$_extend.productsByUid) || {}), {}, _defineProperty({}, productUid, _objectSpread(_objectSpread({}, ((_tempOrder$_extend2 = tempOrder._extend) === null || _tempOrder$_extend2 === void 0 || (_tempOrder$_extend2 = _tempOrder$_extend2.productsByUid) === null || _tempOrder$_extend2 === void 0 ? void 0 : _tempOrder$_extend2[productUid]) || {}), {}, {
310
- origin: origin
311
- })))
312
- });
313
- }
314
- }, {
315
- key: "readProductOriginFromTempOrder",
316
- value: function readProductOriginFromTempOrder(tempOrder, product) {
317
- var _product$metadata, _tempOrder$_extend3;
318
- var uid = ((_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.unique_identification_number) || product.identity_key;
319
- if (uid && (_tempOrder$_extend3 = tempOrder._extend) !== null && _tempOrder$_extend3 !== void 0 && (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) !== null && _tempOrder$_extend3 !== void 0 && (_tempOrder$_extend3 = _tempOrder$_extend3[uid]) !== null && _tempOrder$_extend3 !== void 0 && _tempOrder$_extend3.origin) {
320
- return tempOrder._extend.productsByUid[uid].origin;
321
- }
322
- return product._origin;
323
- }
324
- }, {
325
- key: "normalizeVenueProductTitle",
326
- value: function normalizeVenueProductTitle(value) {
327
- if (typeof value === 'string') {
328
- var text = value.trim();
329
- return text ? {
330
- auto: text
331
- } : undefined;
332
- }
333
- if (!value || _typeof(value) !== 'object' || Array.isArray(value)) return undefined;
334
- var source = value;
335
- var normalized = {};
336
- Object.entries(source).forEach(function (_ref) {
337
- var _ref2 = _slicedToArray(_ref, 2),
338
- key = _ref2[0],
339
- text = _ref2[1];
340
- if (typeof text === 'string') normalized[key] = text;
341
- });
342
- if (!normalized.auto) {
343
- var fallback = normalized.original || normalized.en || normalized['zh-CN'] || normalized['zh-HK'];
344
- if (fallback) normalized.auto = fallback;
345
- }
346
- return Object.values(normalized).some(function (text) {
347
- return String(text || '').trim();
348
- }) ? normalized : undefined;
349
- }
350
276
  }, {
351
277
  key: "normalizeCustomerId",
352
278
  value: function normalizeCustomerId(value) {
@@ -366,115 +292,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
366
292
  }
367
293
  return null;
368
294
  }
369
- }, {
370
- key: "resolveHolderCustomerId",
371
- value: function resolveHolderCustomerId() {
372
- var _this$window, _this$window$getLocal;
373
- var customer = JSON.parse(((_this$window = this.window) === null || _this$window === void 0 || (_this$window$getLocal = _this$window.getLocalStorage) === null || _this$window$getLocal === void 0 ? void 0 : _this$window$getLocal.call(_this$window, 'customer')) || '{}');
374
- if (customer !== null && customer !== void 0 && customer.id) return Number(customer.id);
375
- return undefined;
376
- }
377
-
378
- /**
379
- * 按商品 holder_config 预加载表单数据到 holderMap。
380
- * appointment_booking 在加购时触发;venueBooking 在商品加载后预加载,避免 getHolderFormMap 为空。
381
- */
382
- }, {
383
- key: "preloadHolderForms",
384
- value: (function () {
385
- var _preloadHolderForms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(products) {
386
- var seenFormIds, _iterator, _step, _item$_origin, item, holderConfig, formId, _item$_origin2, _item$_origin3;
387
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
388
- while (1) switch (_context3.prev = _context3.next) {
389
- case 0:
390
- if (!(!this.store.holder || !products.length)) {
391
- _context3.next = 2;
392
- break;
393
- }
394
- return _context3.abrupt("return");
395
- case 2:
396
- seenFormIds = new Set();
397
- _iterator = _createForOfIteratorHelper(products);
398
- _context3.prev = 4;
399
- _iterator.s();
400
- case 6:
401
- if ((_step = _iterator.n()).done) {
402
- _context3.next = 25;
403
- break;
404
- }
405
- item = _step.value;
406
- holderConfig = getProductHolderConfig(item === null || item === void 0 || (_item$_origin = item._origin) === null || _item$_origin === void 0 ? void 0 : _item$_origin.product);
407
- if (holderConfig) {
408
- _context3.next = 11;
409
- break;
410
- }
411
- return _context3.abrupt("continue", 23);
412
- case 11:
413
- formId = getFormIdFromHolderConfig(holderConfig);
414
- if (!seenFormIds.has(formId)) {
415
- _context3.next = 14;
416
- break;
417
- }
418
- return _context3.abrupt("continue", 23);
419
- case 14:
420
- seenFormIds.add(formId);
421
- _context3.prev = 15;
422
- _context3.next = 18;
423
- return this.store.holder.ensureFormByProduct({
424
- product: (item === null || item === void 0 || (_item$_origin2 = item._origin) === null || _item$_origin2 === void 0 ? void 0 : _item$_origin2.product) || {},
425
- customer_id: this.resolveHolderCustomerId(),
426
- shop_id: item === null || item === void 0 || (_item$_origin3 = item._origin) === null || _item$_origin3 === void 0 || (_item$_origin3 = _item$_origin3.product) === null || _item$_origin3 === void 0 ? void 0 : _item$_origin3.shop_id,
427
- useCache: true
428
- });
429
- case 18:
430
- _context3.next = 23;
431
- break;
432
- case 20:
433
- _context3.prev = 20;
434
- _context3.t0 = _context3["catch"](15);
435
- console.error('[VenueBooking] 预加载 holder 表单失败', {
436
- formId: formId,
437
- error: _context3.t0
438
- });
439
- case 23:
440
- _context3.next = 6;
441
- break;
442
- case 25:
443
- _context3.next = 30;
444
- break;
445
- case 27:
446
- _context3.prev = 27;
447
- _context3.t1 = _context3["catch"](4);
448
- _iterator.e(_context3.t1);
449
- case 30:
450
- _context3.prev = 30;
451
- _iterator.f();
452
- return _context3.finish(30);
453
- case 33:
454
- case "end":
455
- return _context3.stop();
456
- }
457
- }, _callee3, this, [[4, 27, 30, 33], [15, 20]]);
458
- }));
459
- function preloadHolderForms(_x3) {
460
- return _preloadHolderForms.apply(this, arguments);
461
- }
462
- return preloadHolderForms;
463
- }())
464
295
  }, {
465
296
  key: "clearLoginEffectListeners",
466
297
  value: function clearLoginEffectListeners() {
467
- var _iterator2 = _createForOfIteratorHelper(this.loginEffectDisposers),
468
- _step2;
298
+ var _iterator = _createForOfIteratorHelper(this.loginEffectDisposers),
299
+ _step;
469
300
  try {
470
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
471
- var dispose = _step2.value;
301
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
302
+ var dispose = _step.value;
472
303
  dispose();
473
304
  }
474
305
  } catch (err) {
475
- _iterator2.e(err);
306
+ _iterator.e(err);
476
307
  } finally {
477
- _iterator2.f();
308
+ _iterator.f();
478
309
  }
479
310
  this.loginEffectDisposers = [];
480
311
  }
@@ -505,30 +336,30 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
505
336
  var currentAccount = (accountModule === null || accountModule === void 0 || (_accountModule$getCur = accountModule.getCurrentAccount) === null || _accountModule$getCur === void 0 ? void 0 : _accountModule$getCur.call(accountModule)) || (accountModule === null || accountModule === void 0 || (_accountModule$getAcc = accountModule.getAccount) === null || _accountModule$getAcc === void 0 ? void 0 : _accountModule$getAcc.call(accountModule)) || null;
506
337
  var createHandleLogin = function createHandleLogin(eventName) {
507
338
  return /*#__PURE__*/function () {
508
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(payload) {
339
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(payload) {
509
340
  var customerId;
510
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
511
- while (1) switch (_context4.prev = _context4.next) {
341
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
342
+ while (1) switch (_context3.prev = _context3.next) {
512
343
  case 0:
513
344
  customerId = _this2.resolveCustomerIdFromLoginPayload(payload);
514
345
  if (customerId) {
515
- _context4.next = 3;
346
+ _context3.next = 3;
516
347
  break;
517
348
  }
518
- return _context4.abrupt("return");
349
+ return _context3.abrupt("return");
519
350
  case 3:
520
- _context4.next = 5;
351
+ _context3.next = 5;
521
352
  return _this2.refreshOrderMarketingAfterLogin({
522
353
  customerId: customerId
523
354
  });
524
355
  case 5:
525
356
  case "end":
526
- return _context4.stop();
357
+ return _context3.stop();
527
358
  }
528
- }, _callee4);
359
+ }, _callee3);
529
360
  }));
530
- return function (_x4) {
531
- return _ref3.apply(this, arguments);
361
+ return function (_x3) {
362
+ return _ref.apply(this, arguments);
532
363
  };
533
364
  }();
534
365
  };
@@ -538,107 +369,97 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
538
369
  }, {
539
370
  key: "refreshOrderMarketingAfterLogin",
540
371
  value: function () {
541
- var _refreshOrderMarketingAfterLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
372
+ var _refreshOrderMarketingAfterLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
542
373
  var _this3 = this;
543
374
  var refreshTask;
544
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
545
- while (1) switch (_context6.prev = _context6.next) {
375
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
376
+ while (1) switch (_context5.prev = _context5.next) {
546
377
  case 0:
547
378
  if (this.store.order) {
548
- _context6.next = 2;
379
+ _context5.next = 2;
549
380
  break;
550
381
  }
551
382
  throw new Error('order 模块未初始化');
552
383
  case 2:
553
384
  if (!this.customerLoginRefreshInFlight) {
554
- _context6.next = 9;
385
+ _context5.next = 9;
555
386
  break;
556
387
  }
557
388
  if (!(this.customerLoginRefreshIdInFlight === params.customerId)) {
558
- _context6.next = 7;
389
+ _context5.next = 7;
559
390
  break;
560
391
  }
561
- _context6.next = 6;
392
+ _context5.next = 6;
562
393
  return this.customerLoginRefreshInFlight;
563
394
  case 6:
564
- return _context6.abrupt("return");
395
+ return _context5.abrupt("return");
565
396
  case 7:
566
- _context6.next = 9;
397
+ _context5.next = 9;
567
398
  return this.customerLoginRefreshInFlight;
568
399
  case 9:
569
400
  this.customerLoginRefreshIdInFlight = params.customerId;
570
- refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
401
+ refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
571
402
  var _this3$otherParams;
572
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
573
- while (1) switch (_context5.prev = _context5.next) {
403
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
404
+ while (1) switch (_context4.prev = _context4.next) {
574
405
  case 0:
575
- if (!_this3.store.holder) {
576
- _context5.next = 3;
577
- break;
578
- }
579
- _context5.next = 3;
580
- return _this3.store.holder.refreshAllFormRecords({
581
- customer_id: params.customerId,
582
- useCache: false
583
- });
584
- case 3:
585
406
  if (!_this3.store.quotation) {
586
- _context5.next = 6;
407
+ _context4.next = 3;
587
408
  break;
588
409
  }
589
- _context5.next = 6;
410
+ _context4.next = 3;
590
411
  return _this3.store.quotation.loadQuotations({
591
412
  channel: (_this3$otherParams = _this3.otherParams) === null || _this3$otherParams === void 0 ? void 0 : _this3$otherParams.channel
592
413
  });
593
- case 6:
414
+ case 3:
594
415
  _this3.recalculateOrderPricesFromQuotation();
595
- _context5.next = 9;
416
+ _context4.next = 6;
596
417
  return _this3.store.order.loadDiscountConfig({
597
418
  customerId: params.customerId
598
419
  });
599
- case 9:
600
- _context5.next = 11;
420
+ case 6:
421
+ _context4.next = 8;
601
422
  return _this3.store.order.recalculateSummary({
602
423
  createIfMissing: true
603
424
  });
604
- case 11:
425
+ case 8:
605
426
  _this3.store.order.persistTempOrder();
606
- _context5.next = 14;
427
+ _context4.next = 11;
607
428
  return _this3.refreshItemRuleQuantityLimits();
608
- case 14:
609
- _context5.next = 16;
429
+ case 11:
430
+ _context4.next = 13;
610
431
  return _this3.refreshCartValidationPassed();
611
- case 16:
432
+ case 13:
612
433
  case "end":
613
- return _context5.stop();
434
+ return _context4.stop();
614
435
  }
615
- }, _callee5);
436
+ }, _callee4);
616
437
  }))();
617
438
  this.customerLoginRefreshInFlight = refreshTask;
618
- _context6.prev = 12;
619
- _context6.next = 15;
439
+ _context5.prev = 12;
440
+ _context5.next = 15;
620
441
  return refreshTask;
621
442
  case 15:
622
- _context6.next = 20;
443
+ _context5.next = 20;
623
444
  break;
624
445
  case 17:
625
- _context6.prev = 17;
626
- _context6.t0 = _context6["catch"](12);
627
- throw _context6.t0;
446
+ _context5.prev = 17;
447
+ _context5.t0 = _context5["catch"](12);
448
+ throw _context5.t0;
628
449
  case 20:
629
- _context6.prev = 20;
450
+ _context5.prev = 20;
630
451
  if (this.customerLoginRefreshInFlight === refreshTask) {
631
452
  this.customerLoginRefreshInFlight = null;
632
453
  this.customerLoginRefreshIdInFlight = null;
633
454
  }
634
- return _context6.finish(20);
455
+ return _context5.finish(20);
635
456
  case 23:
636
457
  case "end":
637
- return _context6.stop();
458
+ return _context5.stop();
638
459
  }
639
- }, _callee6, this, [[12, 17, 20, 23]]);
460
+ }, _callee5, this, [[12, 17, 20, 23]]);
640
461
  }));
641
- function refreshOrderMarketingAfterLogin(_x5) {
462
+ function refreshOrderMarketingAfterLogin(_x4) {
642
463
  return _refreshOrderMarketingAfterLogin.apply(this, arguments);
643
464
  }
644
465
  return refreshOrderMarketingAfterLogin;
@@ -646,21 +467,16 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
646
467
  }, {
647
468
  key: "initialize",
648
469
  value: function () {
649
- var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(core) {
470
+ var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(core) {
650
471
  var _options$otherParams,
651
472
  _options$otherParams2,
652
473
  _this$otherParams,
653
474
  _this$otherParams2,
654
475
  _this$otherParams3,
655
476
  _this4 = this,
656
- _this$otherParams6,
657
- _this$otherParams7,
658
- _this$otherParams8,
659
- _this$otherParams9,
660
- _this$otherParams10;
661
- var options,
662
477
  _this$otherParams4,
663
- _this$otherParams5,
478
+ _this$otherParams5;
479
+ var options,
664
480
  baseModules,
665
481
  venueProductsModule,
666
482
  addonProductsModule,
@@ -668,21 +484,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
668
484
  scheduleModule,
669
485
  quotationModule,
670
486
  openDataModule,
671
- holderCacheState,
672
- sessionData,
673
- _data$this$otherParam,
674
- data,
675
- holderModule,
676
487
  _this$store$order,
677
488
  _this$store$order2,
678
489
  _this$store$quotation,
679
- _this$otherParams11,
680
- _args7 = arguments;
681
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
682
- while (1) switch (_context7.prev = _context7.next) {
490
+ _this$otherParams6,
491
+ _args6 = arguments;
492
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
493
+ while (1) switch (_context6.prev = _context6.next) {
683
494
  case 0:
684
- options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
495
+ options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
685
496
  this.logMethodStart('initialize');
497
+ this.core = core;
498
+ this.initializeOptions = options || {};
686
499
  this.store = _objectSpread(_objectSpread({}, this.store), options.store);
687
500
  this.store.entryContext = ((_options$otherParams = options.otherParams) === null || _options$otherParams === void 0 ? void 0 : _options$otherParams.entryContext) || this.store.entryContext;
688
501
  this.store.status = 'initializing';
@@ -701,19 +514,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
701
514
  passed: null,
702
515
  failures: []
703
516
  };
704
- _context7.next = 19;
705
- return _get(_getPrototypeOf(VenueBookingImpl.prototype), "initialize", this).call(this, core, options);
706
- case 19:
707
- if (this.store.scanOrderLogger) {
708
- this.store.scanOrderLogger.setProvider(((_this$otherParams4 = this.otherParams) === null || _this$otherParams4 === void 0 ? void 0 : _this$otherParams4.loggerProvider) || 'feishu');
709
- this.store.scanOrderLogger.setProviderConfig(((_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.loggerConfig) || {
710
- feishu: {
711
- webhook: 'https://open.feishu.cn/open-apis/bot/v2/hook/8f069b14-9d39-4728-8f78-b56f393bfde8',
712
- errorHook: 'https://open.feishu.cn/open-apis/bot/v2/hook/bdefae5e-f233-4705-8688-946887d9543d'
713
- }
714
- });
715
- this.store.scanOrderLogger.setContext(this.getLoggerContext());
517
+ this.window = core.getPlugin('window');
518
+ this.request = core.getPlugin('request');
519
+ if (this.window) {
520
+ _context6.next = 24;
521
+ break;
716
522
  }
523
+ this.logMethodError('initialize', 'window plugin missing');
524
+ throw new Error('venueBooking解决方案需要 window 插件支持');
525
+ case 24:
526
+ if (this.request) {
527
+ _context6.next = 27;
528
+ break;
529
+ }
530
+ this.logMethodError('initialize', 'request plugin missing');
531
+ throw new Error('venueBooking解决方案需要 request 插件支持');
532
+ case 27:
717
533
  // 注册基础模块(order, salesSummary, products, logger)
718
534
  baseModules = ['scanOrderLogger', 'products', 'order', 'salesSummary'];
719
535
  baseModules.forEach(function (step) {
@@ -726,10 +542,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
726
542
  } : {};
727
543
  var loggerProvider = ((_this4$otherParams = _this4.otherParams) === null || _this4$otherParams === void 0 ? void 0 : _this4$otherParams.loggerProvider) || 'feishu';
728
544
  var loggerConfig = ((_this4$otherParams2 = _this4.otherParams) === null || _this4$otherParams2 === void 0 ? void 0 : _this4$otherParams2.loggerConfig) || {
729
- // feishu: {
730
- // webhook: 'https://open.feishu.cn/open-apis/bot/v2/hook/8f069b14-9d39-4728-8f78-b56f393bfde8',
731
- // errorHook: 'https://open.feishu.cn/open-apis/bot/v2/hook/bdefae5e-f233-4705-8688-946887d9543d',
732
- // },
545
+ feishu: {
546
+ webhook: 'https://open.feishu.cn/open-apis/bot/v2/hook/8f069b14-9d39-4728-8f78-b56f393bfde8',
547
+ errorHook: 'https://open.feishu.cn/open-apis/bot/v2/hook/bdefae5e-f233-4705-8688-946887d9543d'
548
+ }
733
549
  };
734
550
  _this4.core.registerModule(targetModule, {
735
551
  initialState: initialState,
@@ -801,87 +617,69 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
801
617
  this.core.registerModule(openDataModule, {
802
618
  otherParams: _objectSpread(_objectSpread({}, this.otherParams), {}, {
803
619
  fatherModule: this.name,
804
- openCache: !!((_this$otherParams6 = this.otherParams) !== null && _this$otherParams6 !== void 0 && _this$otherParams6.cacheId),
805
- cacheId: (_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7.cacheId
620
+ openCache: !!((_this$otherParams4 = this.otherParams) !== null && _this$otherParams4 !== void 0 && _this$otherParams4.cacheId),
621
+ cacheId: (_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.cacheId
806
622
  })
807
623
  });
808
- if ((_this$otherParams8 = this.otherParams) !== null && _this$otherParams8 !== void 0 && _this$otherParams8.cacheId) {
809
- sessionData = this.window.sessionStorage.getItem(this.name);
810
- if (sessionData) {
811
- try {
812
- data = JSON.parse(sessionData);
813
- holderCacheState = (_data$this$otherParam = data[this.otherParams.cacheId]) === null || _data$this$otherParam === void 0 ? void 0 : _data$this$otherParam["".concat(this.name, "_holder")];
814
- } catch (_unused2) {
815
- // ignore invalid session cache
816
- }
817
- }
624
+ if (this.store.scanOrderLogger) {
625
+ this.store.scanOrderLogger.setContext(this.getLoggerContext());
818
626
  }
819
- holderModule = new HolderModule("".concat(this.name, "_holder"));
820
- this.store.holder = holderModule;
821
- this.core.registerModule(holderModule, {
822
- initialState: holderCacheState,
823
- otherParams: _objectSpread(_objectSpread({}, this.otherParams), {}, {
824
- fatherModule: this.name,
825
- openCache: !!((_this$otherParams9 = this.otherParams) !== null && _this$otherParams9 !== void 0 && _this$otherParams9.cacheId),
826
- cacheId: (_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.cacheId
827
- })
828
- });
829
627
  this.registerCustomerLoginListeners();
830
628
  console.log('[VenueBooking] 初始化开始');
831
- _context7.prev = 46;
832
- _context7.next = 49;
629
+ _context6.prev = 50;
630
+ _context6.next = 53;
833
631
  return (_this$store$order = this.store.order) === null || _this$store$order === void 0 ? void 0 : _this$store$order.recalculateSummary({
834
632
  createIfMissing: false
835
633
  });
836
- case 49:
634
+ case 53:
837
635
  (_this$store$order2 = this.store.order) === null || _this$store$order2 === void 0 || _this$store$order2.persistTempOrder();
838
- _context7.next = 52;
636
+ _context6.next = 56;
839
637
  return this.loadRuntimeConfigs();
840
- case 52:
638
+ case 56:
841
639
  if (!this.store.schedule) {
842
- _context7.next = 57;
640
+ _context6.next = 61;
843
641
  break;
844
642
  }
845
- _context7.next = 55;
643
+ _context6.next = 59;
846
644
  return this.store.schedule.loadAllSchedule();
847
- case 55:
645
+ case 59:
848
646
  this.injectScheduleResolverToQuotation();
849
647
  (_this$store$quotation = this.store.quotation) === null || _this$store$quotation === void 0 || _this$store$quotation.loadQuotations({
850
- channel: (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.channel
648
+ channel: (_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.channel
851
649
  });
852
- case 57:
853
- _context7.next = 59;
650
+ case 61:
651
+ _context6.next = 63;
854
652
  return this.refreshItemRuleQuantityLimits();
855
- case 59:
653
+ case 63:
856
654
  this.store.status = 'ready';
857
655
  console.log('[VenueBooking] 初始化完成');
858
- _context7.next = 63;
656
+ _context6.next = 67;
859
657
  return this.core.effects.emit(VenueBookingHooks.onInited, {
860
658
  status: this.store.status
861
659
  });
862
- case 63:
660
+ case 67:
863
661
  this.logMethodSuccess('initialize', {
864
662
  status: this.store.status
865
663
  });
866
- _context7.next = 73;
664
+ _context6.next = 77;
867
665
  break;
868
- case 66:
869
- _context7.prev = 66;
870
- _context7.t0 = _context7["catch"](46);
666
+ case 70:
667
+ _context6.prev = 70;
668
+ _context6.t0 = _context6["catch"](50);
871
669
  this.store.status = 'error';
872
- this.store.error = _context7.t0 instanceof Error ? _context7.t0.message : '初始化失败';
873
- console.error('[VenueBooking] 初始化失败', _context7.t0);
874
- this.logMethodError('initialize', _context7.t0, {
670
+ this.store.error = _context6.t0 instanceof Error ? _context6.t0.message : '初始化失败';
671
+ console.error('[VenueBooking] 初始化失败', _context6.t0);
672
+ this.logMethodError('initialize', _context6.t0, {
875
673
  status: this.store.status
876
674
  });
877
- throw _context7.t0;
878
- case 73:
675
+ throw _context6.t0;
676
+ case 77:
879
677
  case "end":
880
- return _context7.stop();
678
+ return _context6.stop();
881
679
  }
882
- }, _callee7, this, [[46, 66]]);
680
+ }, _callee6, this, [[50, 70]]);
883
681
  }));
884
- function initialize(_x6) {
682
+ function initialize(_x5) {
885
683
  return _initialize.apply(this, arguments);
886
684
  }
887
685
  return initialize;
@@ -889,22 +687,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
889
687
  }, {
890
688
  key: "destroy",
891
689
  value: function () {
892
- var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
893
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
894
- while (1) switch (_context8.prev = _context8.next) {
690
+ var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
691
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
692
+ while (1) switch (_context7.prev = _context7.next) {
895
693
  case 0:
896
694
  this.logMethodStart('destroy');
897
695
  this.clearLoginEffectListeners();
898
- _context8.next = 4;
696
+ _context7.next = 4;
899
697
  return this.core.effects.emit(VenueBookingHooks.onDestroy, {});
900
698
  case 4:
901
699
  console.log('[VenueBooking] 已销毁');
902
700
  this.logMethodSuccess('destroy');
903
701
  case 6:
904
702
  case "end":
905
- return _context8.stop();
703
+ return _context7.stop();
906
704
  }
907
- }, _callee8, this);
705
+ }, _callee7, this);
908
706
  }));
909
707
  function destroy() {
910
708
  return _destroy.apply(this, arguments);
@@ -914,32 +712,32 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
914
712
  }, {
915
713
  key: "retryInit",
916
714
  value: function () {
917
- var _retryInit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
918
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
919
- while (1) switch (_context9.prev = _context9.next) {
715
+ var _retryInit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
716
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
717
+ while (1) switch (_context8.prev = _context8.next) {
920
718
  case 0:
921
719
  this.logMethodStart('retryInit');
922
720
  console.log('[VenueBooking] retryInit 调用');
923
- _context9.next = 4;
721
+ _context8.next = 4;
924
722
  return this.core.effects.emit(VenueBookingHooks.onRetryInit, {});
925
723
  case 4:
926
- _context9.prev = 4;
927
- _context9.next = 7;
724
+ _context8.prev = 4;
725
+ _context8.next = 7;
928
726
  return this.initialize(this.core, this.initializeOptions);
929
727
  case 7:
930
728
  this.logMethodSuccess('retryInit');
931
- _context9.next = 14;
729
+ _context8.next = 14;
932
730
  break;
933
731
  case 10:
934
- _context9.prev = 10;
935
- _context9.t0 = _context9["catch"](4);
936
- this.logMethodError('retryInit', _context9.t0);
937
- throw _context9.t0;
732
+ _context8.prev = 10;
733
+ _context8.t0 = _context8["catch"](4);
734
+ this.logMethodError('retryInit', _context8.t0);
735
+ throw _context8.t0;
938
736
  case 14:
939
737
  case "end":
940
- return _context9.stop();
738
+ return _context8.stop();
941
739
  }
942
- }, _callee9, this, [[4, 10]]);
740
+ }, _callee8, this, [[4, 10]]);
943
741
  }));
944
742
  function retryInit() {
945
743
  return _retryInit.apply(this, arguments);
@@ -949,22 +747,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
949
747
  }, {
950
748
  key: "refresh",
951
749
  value: function () {
952
- var _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
953
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
954
- while (1) switch (_context10.prev = _context10.next) {
750
+ var _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
751
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
752
+ while (1) switch (_context9.prev = _context9.next) {
955
753
  case 0:
956
754
  this.logMethodStart('refresh');
957
755
  console.log('[VenueBooking] refresh 调用');
958
- _context10.prev = 2;
756
+ _context9.prev = 2;
959
757
  this.store.status = 'initializing';
960
- _context10.next = 6;
758
+ _context9.next = 6;
961
759
  return this.loadRuntimeConfigs();
962
760
  case 6:
963
- _context10.next = 8;
761
+ _context9.next = 8;
964
762
  return this.refreshItemRuleQuantityLimits();
965
763
  case 8:
966
764
  this.store.status = 'ready';
967
- _context10.next = 11;
765
+ _context9.next = 11;
968
766
  return this.core.effects.emit(VenueBookingHooks.onRefresh, {
969
767
  status: this.store.status
970
768
  });
@@ -972,18 +770,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
972
770
  this.logMethodSuccess('refresh', {
973
771
  status: this.store.status
974
772
  });
975
- _context10.next = 18;
773
+ _context9.next = 18;
976
774
  break;
977
775
  case 14:
978
- _context10.prev = 14;
979
- _context10.t0 = _context10["catch"](2);
980
- this.logMethodError('refresh', _context10.t0);
981
- throw _context10.t0;
776
+ _context9.prev = 14;
777
+ _context9.t0 = _context9["catch"](2);
778
+ this.logMethodError('refresh', _context9.t0);
779
+ throw _context9.t0;
982
780
  case 18:
983
781
  case "end":
984
- return _context10.stop();
782
+ return _context9.stop();
985
783
  }
986
- }, _callee10, this, [[2, 14]]);
784
+ }, _callee9, this, [[2, 14]]);
987
785
  }));
988
786
  function refresh() {
989
787
  return _refresh.apply(this, arguments);
@@ -1024,26 +822,26 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1024
822
  }, {
1025
823
  key: "loadAllProducts",
1026
824
  value: function () {
1027
- var _loadAllProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
825
+ var _loadAllProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
1028
826
  var _this5 = this;
1029
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
1030
- while (1) switch (_context11.prev = _context11.next) {
827
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
828
+ while (1) switch (_context10.prev = _context10.next) {
1031
829
  case 0:
1032
830
  if (!this.loadAllProductsInFlight) {
1033
- _context11.next = 2;
831
+ _context10.next = 2;
1034
832
  break;
1035
833
  }
1036
- return _context11.abrupt("return", this.loadAllProductsInFlight);
834
+ return _context10.abrupt("return", this.loadAllProductsInFlight);
1037
835
  case 2:
1038
836
  this.loadAllProductsInFlight = this._doLoadAllProducts().finally(function () {
1039
837
  _this5.loadAllProductsInFlight = null;
1040
838
  });
1041
- return _context11.abrupt("return", this.loadAllProductsInFlight);
839
+ return _context10.abrupt("return", this.loadAllProductsInFlight);
1042
840
  case 4:
1043
841
  case "end":
1044
- return _context11.stop();
842
+ return _context10.stop();
1045
843
  }
1046
- }, _callee11, this);
844
+ }, _callee10, this);
1047
845
  }));
1048
846
  function loadAllProducts() {
1049
847
  return _loadAllProducts.apply(this, arguments);
@@ -1053,31 +851,31 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1053
851
  }, {
1054
852
  key: "_doLoadAllProducts",
1055
853
  value: function () {
1056
- var _doLoadAllProducts2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
1057
- var _this$otherParams12, _this$store$venueProd, associatedMenus, menuListIds, allProducts, list, venueList, addonList, venueStore, _this$store$order3, _this$store$order3$ge, products;
1058
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1059
- while (1) switch (_context12.prev = _context12.next) {
854
+ var _doLoadAllProducts2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
855
+ var _this$otherParams7, _this$store$venueProd, associatedMenus, menuListIds, allProducts, list, venueList, addonList, venueStore;
856
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
857
+ while (1) switch (_context11.prev = _context11.next) {
1060
858
  case 0:
1061
859
  this.logMethodStart('loadAllProducts');
1062
- _context12.prev = 1;
860
+ _context11.prev = 1;
1063
861
  if (this.store.venueProducts) {
1064
- _context12.next = 4;
862
+ _context11.next = 4;
1065
863
  break;
1066
864
  }
1067
865
  throw new Error('venueProducts 模块未初始化');
1068
866
  case 4:
1069
867
  if (this.store.addonProducts) {
1070
- _context12.next = 6;
868
+ _context11.next = 6;
1071
869
  break;
1072
870
  }
1073
871
  throw new Error('addonProducts 模块未初始化');
1074
872
  case 6:
1075
- _context12.next = 8;
873
+ _context11.next = 8;
1076
874
  return this.loadOpenDataConfig();
1077
875
  case 8:
1078
- associatedMenus = ((_this$otherParams12 = this.otherParams) === null || _this$otherParams12 === void 0 || (_this$otherParams12 = _this$otherParams12.openData) === null || _this$otherParams12 === void 0 ? void 0 : _this$otherParams12['menu.associated_menus']) || [];
876
+ associatedMenus = ((_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 || (_this$otherParams7 = _this$otherParams7.openData) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7['menu.associated_menus']) || [];
1079
877
  if (associatedMenus.length) {
1080
- _context12.next = 12;
878
+ _context11.next = 12;
1081
879
  break;
1082
880
  }
1083
881
  this.logMethodError('loadAllProducts', new Error('未获取到餐牌配置(menu.associated_menus),请检查 OpenData 配置'));
@@ -1086,7 +884,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1086
884
  menuListIds = associatedMenus.map(function (n) {
1087
885
  return Number(n.value);
1088
886
  });
1089
- _context12.next = 15;
887
+ _context11.next = 15;
1090
888
  return this.store.venueProducts.loadProducts({
1091
889
  menu_list_ids: menuListIds,
1092
890
  cacheId: this.cacheId,
@@ -1094,7 +892,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1094
892
  schedule_datetime: dayjs().format('YYYY-MM-DD HH:mm:ss')
1095
893
  });
1096
894
  case 15:
1097
- allProducts = _context12.sent;
895
+ allProducts = _context11.sent;
1098
896
  list = Array.isArray(allProducts) ? allProducts : [];
1099
897
  venueList = list.filter(function (p) {
1100
898
  return p.duration != null;
@@ -1110,16 +908,6 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1110
908
  }
1111
909
  this.store.addonProducts.addProduct(addonList);
1112
910
  this.resourceProductMap = buildResourceProductMap(venueList);
1113
-
1114
- // 加载 holder 表单
1115
- if (!this.store.order) {
1116
- _context12.next = 27;
1117
- break;
1118
- }
1119
- products = ((_this$store$order3 = this.store.order) === null || _this$store$order3 === void 0 || (_this$store$order3$ge = _this$store$order3.getOrderProducts) === null || _this$store$order3$ge === void 0 ? void 0 : _this$store$order3$ge.call(_this$store$order3)) || [];
1120
- _context12.next = 27;
1121
- return this.preloadHolderForms(products);
1122
- case 27:
1123
911
  this.productsLoaded = true;
1124
912
  this.logMethodSuccess('loadAllProducts', {
1125
913
  total: list.length,
@@ -1127,20 +915,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1127
915
  addonCount: addonList.length,
1128
916
  resourceCount: this.resourceProductMap.size
1129
917
  });
1130
- return _context12.abrupt("return", {
918
+ return _context11.abrupt("return", {
1131
919
  venueProducts: venueList,
1132
920
  addonProducts: addonList
1133
921
  });
922
+ case 28:
923
+ _context11.prev = 28;
924
+ _context11.t0 = _context11["catch"](1);
925
+ this.logMethodError('loadAllProducts', _context11.t0);
926
+ throw _context11.t0;
1134
927
  case 32:
1135
- _context12.prev = 32;
1136
- _context12.t0 = _context12["catch"](1);
1137
- this.logMethodError('loadAllProducts', _context12.t0);
1138
- throw _context12.t0;
1139
- case 36:
1140
928
  case "end":
1141
- return _context12.stop();
929
+ return _context11.stop();
1142
930
  }
1143
- }, _callee12, this, [[1, 32]]);
931
+ }, _callee11, this, [[1, 28]]);
1144
932
  }));
1145
933
  function _doLoadAllProducts() {
1146
934
  return _doLoadAllProducts2.apply(this, arguments);
@@ -1150,21 +938,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1150
938
  }, {
1151
939
  key: "loadVenueProducts",
1152
940
  value: function () {
1153
- var _loadVenueProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
941
+ var _loadVenueProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
1154
942
  var result;
1155
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1156
- while (1) switch (_context13.prev = _context13.next) {
943
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
944
+ while (1) switch (_context12.prev = _context12.next) {
1157
945
  case 0:
1158
- _context13.next = 2;
946
+ _context12.next = 2;
1159
947
  return this.loadAllProducts();
1160
948
  case 2:
1161
- result = _context13.sent;
1162
- return _context13.abrupt("return", result.venueProducts);
949
+ result = _context12.sent;
950
+ return _context12.abrupt("return", result.venueProducts);
1163
951
  case 4:
1164
952
  case "end":
1165
- return _context13.stop();
953
+ return _context12.stop();
1166
954
  }
1167
- }, _callee13, this);
955
+ }, _callee12, this);
1168
956
  }));
1169
957
  function loadVenueProducts() {
1170
958
  return _loadVenueProducts.apply(this, arguments);
@@ -1174,21 +962,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1174
962
  }, {
1175
963
  key: "loadAddonProducts",
1176
964
  value: function () {
1177
- var _loadAddonProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
965
+ var _loadAddonProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
1178
966
  var result;
1179
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1180
- while (1) switch (_context14.prev = _context14.next) {
967
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
968
+ while (1) switch (_context13.prev = _context13.next) {
1181
969
  case 0:
1182
- _context14.next = 2;
970
+ _context13.next = 2;
1183
971
  return this.loadAllProducts();
1184
972
  case 2:
1185
- result = _context14.sent;
1186
- return _context14.abrupt("return", result.addonProducts);
973
+ result = _context13.sent;
974
+ return _context13.abrupt("return", result.addonProducts);
1187
975
  case 4:
1188
976
  case "end":
1189
- return _context14.stop();
977
+ return _context13.stop();
1190
978
  }
1191
- }, _callee14, this);
979
+ }, _callee13, this);
1192
980
  }));
1193
981
  function loadAddonProducts() {
1194
982
  return _loadAddonProducts.apply(this, arguments);
@@ -1212,38 +1000,38 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1212
1000
  }, {
1213
1001
  key: "loadQuotations",
1214
1002
  value: function () {
1215
- var _loadQuotations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(params) {
1216
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1217
- while (1) switch (_context15.prev = _context15.next) {
1003
+ var _loadQuotations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(params) {
1004
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1005
+ while (1) switch (_context14.prev = _context14.next) {
1218
1006
  case 0:
1219
1007
  this.logMethodStart('loadQuotations');
1220
- _context15.prev = 1;
1008
+ _context14.prev = 1;
1221
1009
  if (this.store.quotation) {
1222
- _context15.next = 4;
1010
+ _context14.next = 4;
1223
1011
  break;
1224
1012
  }
1225
1013
  throw new Error('quotation 模块未初始化');
1226
1014
  case 4:
1227
- _context15.next = 6;
1015
+ _context14.next = 6;
1228
1016
  return this.store.quotation.loadQuotations(params);
1229
1017
  case 6:
1230
1018
  this.logMethodSuccess('loadQuotations', {
1231
1019
  count: this.store.quotation.getQuotationList().length
1232
1020
  });
1233
- _context15.next = 13;
1021
+ _context14.next = 13;
1234
1022
  break;
1235
1023
  case 9:
1236
- _context15.prev = 9;
1237
- _context15.t0 = _context15["catch"](1);
1238
- this.logMethodError('loadQuotations', _context15.t0);
1239
- throw _context15.t0;
1024
+ _context14.prev = 9;
1025
+ _context14.t0 = _context14["catch"](1);
1026
+ this.logMethodError('loadQuotations', _context14.t0);
1027
+ throw _context14.t0;
1240
1028
  case 13:
1241
1029
  case "end":
1242
- return _context15.stop();
1030
+ return _context14.stop();
1243
1031
  }
1244
- }, _callee15, this, [[1, 9]]);
1032
+ }, _callee14, this, [[1, 9]]);
1245
1033
  }));
1246
- function loadQuotations(_x7) {
1034
+ function loadQuotations(_x6) {
1247
1035
  return _loadQuotations.apply(this, arguments);
1248
1036
  }
1249
1037
  return loadQuotations;
@@ -1251,46 +1039,46 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1251
1039
  }, {
1252
1040
  key: "fetchResourceAvailability",
1253
1041
  value: function () {
1254
- var _fetchResourceAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(params) {
1255
- var venueProducts, resourceIds, config, crossDay, effectiveEndDate, res, rawData, _iterator3, _step3, item, _i3, _rawData, _item, mappings, _iterator4, _step4, mapping;
1256
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1257
- while (1) switch (_context16.prev = _context16.next) {
1042
+ var _fetchResourceAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(params) {
1043
+ var venueProducts, resourceIds, config, crossDay, effectiveEndDate, res, rawData, _iterator2, _step2, item, _i3, _rawData, _item, mappings, _iterator3, _step3, mapping;
1044
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1045
+ while (1) switch (_context15.prev = _context15.next) {
1258
1046
  case 0:
1259
1047
  this.logMethodStart('fetchResourceAvailability', params);
1260
- _context16.prev = 1;
1048
+ _context15.prev = 1;
1261
1049
  venueProducts = this.getVenueProducts();
1262
1050
  if (venueProducts.length) {
1263
- _context16.next = 7;
1051
+ _context15.next = 7;
1264
1052
  break;
1265
1053
  }
1266
1054
  this.store.rawResourceData = [];
1267
1055
  this.logMethodSuccess('fetchResourceAvailability', {
1268
1056
  resourceCount: 0
1269
1057
  });
1270
- return _context16.abrupt("return");
1058
+ return _context15.abrupt("return");
1271
1059
  case 7:
1272
1060
  resourceIds = extractResourceIds(venueProducts);
1273
1061
  if (resourceIds.length) {
1274
- _context16.next = 12;
1062
+ _context15.next = 12;
1275
1063
  break;
1276
1064
  }
1277
1065
  this.store.rawResourceData = [];
1278
1066
  this.logMethodSuccess('fetchResourceAvailability', {
1279
1067
  resourceIds: []
1280
1068
  });
1281
- return _context16.abrupt("return");
1069
+ return _context15.abrupt("return");
1282
1070
  case 12:
1283
1071
  // 跨天营业时,endDate 扩展一天以覆盖次日凌晨时段
1284
1072
  config = this.store.slotConfig;
1285
1073
  crossDay = isBusinessHoursCrossDay(config);
1286
1074
  effectiveEndDate = crossDay ? dayjs(params.endDate).add(1, 'day').format('YYYY-MM-DD') : params.endDate;
1287
1075
  if (this.store.date) {
1288
- _context16.next = 17;
1076
+ _context15.next = 17;
1289
1077
  break;
1290
1078
  }
1291
1079
  throw new Error('date 模块未初始化');
1292
1080
  case 17:
1293
- _context16.next = 19;
1081
+ _context15.next = 19;
1294
1082
  return this.store.date.fetchResourceDates({
1295
1083
  query: {
1296
1084
  start_date: params.startDate,
@@ -1300,13 +1088,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1300
1088
  useCache: false
1301
1089
  });
1302
1090
  case 19:
1303
- res = _context16.sent;
1091
+ res = _context15.sent;
1304
1092
  rawData = [];
1305
1093
  if (res !== null && res !== void 0 && res.data && Array.isArray(res.data)) {
1306
- _iterator3 = _createForOfIteratorHelper(res.data);
1094
+ _iterator2 = _createForOfIteratorHelper(res.data);
1307
1095
  try {
1308
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1309
- item = _step3.value;
1096
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1097
+ item = _step2.value;
1310
1098
  rawData.push(_objectSpread({
1311
1099
  resourceId: item.id,
1312
1100
  formId: item.form_id,
@@ -1314,41 +1102,41 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1314
1102
  }, item));
1315
1103
  }
1316
1104
  } catch (err) {
1317
- _iterator3.e(err);
1105
+ _iterator2.e(err);
1318
1106
  } finally {
1319
- _iterator3.f();
1107
+ _iterator2.f();
1320
1108
  }
1321
1109
  }
1322
1110
  this.store.rawResourceData = rawData;
1323
1111
  _i3 = 0, _rawData = rawData;
1324
1112
  case 24:
1325
1113
  if (!(_i3 < _rawData.length)) {
1326
- _context16.next = 34;
1114
+ _context15.next = 34;
1327
1115
  break;
1328
1116
  }
1329
1117
  _item = _rawData[_i3];
1330
1118
  mappings = this.resourceProductMap.get(_item.resourceId);
1331
1119
  if (mappings) {
1332
- _context16.next = 29;
1120
+ _context15.next = 29;
1333
1121
  break;
1334
1122
  }
1335
- return _context16.abrupt("continue", 31);
1123
+ return _context15.abrupt("continue", 31);
1336
1124
  case 29:
1337
- _iterator4 = _createForOfIteratorHelper(mappings);
1125
+ _iterator3 = _createForOfIteratorHelper(mappings);
1338
1126
  try {
1339
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
1340
- mapping = _step4.value;
1127
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1128
+ mapping = _step3.value;
1341
1129
  if (_item.main_field) mapping.resourceName = _item.main_field;
1342
1130
  if (_item.resource_form_id) mapping.formId = _item.resource_form_id;
1343
1131
  }
1344
1132
  } catch (err) {
1345
- _iterator4.e(err);
1133
+ _iterator3.e(err);
1346
1134
  } finally {
1347
- _iterator4.f();
1135
+ _iterator3.f();
1348
1136
  }
1349
1137
  case 31:
1350
1138
  _i3++;
1351
- _context16.next = 24;
1139
+ _context15.next = 24;
1352
1140
  break;
1353
1141
  case 34:
1354
1142
  this.logMethodSuccess('fetchResourceAvailability', {
@@ -1357,21 +1145,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1357
1145
  return sum + r.times.length;
1358
1146
  }, 0)
1359
1147
  });
1360
- _context16.next = 42;
1148
+ _context15.next = 42;
1361
1149
  break;
1362
1150
  case 37:
1363
- _context16.prev = 37;
1364
- _context16.t0 = _context16["catch"](1);
1151
+ _context15.prev = 37;
1152
+ _context15.t0 = _context15["catch"](1);
1365
1153
  this.store.rawResourceData = [];
1366
- this.logMethodError('fetchResourceAvailability', _context16.t0);
1367
- throw _context16.t0;
1154
+ this.logMethodError('fetchResourceAvailability', _context15.t0);
1155
+ throw _context15.t0;
1368
1156
  case 42:
1369
1157
  case "end":
1370
- return _context16.stop();
1158
+ return _context15.stop();
1371
1159
  }
1372
- }, _callee16, this, [[1, 37]]);
1160
+ }, _callee15, this, [[1, 37]]);
1373
1161
  }));
1374
- function fetchResourceAvailability(_x8) {
1162
+ function fetchResourceAvailability(_x7) {
1375
1163
  return _fetchResourceAvailability.apply(this, arguments);
1376
1164
  }
1377
1165
  return fetchResourceAvailability;
@@ -1403,18 +1191,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1403
1191
  var timeRangeMap = calcMinTimeMaxTimeBySchedules(scheduleList, undefined, date);
1404
1192
  var earliestStart = null;
1405
1193
  var latestEnd = null;
1406
- var _iterator5 = _createForOfIteratorHelper(scheduleList),
1407
- _step5;
1194
+ var _iterator4 = _createForOfIteratorHelper(scheduleList),
1195
+ _step4;
1408
1196
  try {
1409
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
1197
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
1410
1198
  var _timeRangeMap$schedul;
1411
- var schedule = _step5.value;
1199
+ var schedule = _step4.value;
1412
1200
  var dateRangeList = (timeRangeMap === null || timeRangeMap === void 0 || (_timeRangeMap$schedul = timeRangeMap[schedule.id]) === null || _timeRangeMap$schedul === void 0 ? void 0 : _timeRangeMap$schedul.dateRangeFormat) || [];
1413
- var _iterator6 = _createForOfIteratorHelper(dateRangeList),
1414
- _step6;
1201
+ var _iterator5 = _createForOfIteratorHelper(dateRangeList),
1202
+ _step5;
1415
1203
  try {
1416
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
1417
- var range = _step6.value;
1204
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
1205
+ var range = _step5.value;
1418
1206
  var start = dayjs(range === null || range === void 0 ? void 0 : range.start);
1419
1207
  var end = dayjs(range === null || range === void 0 ? void 0 : range.end);
1420
1208
  if (!start.isValid() || !end.isValid()) continue;
@@ -1426,15 +1214,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1426
1214
  }
1427
1215
  }
1428
1216
  } catch (err) {
1429
- _iterator6.e(err);
1217
+ _iterator5.e(err);
1430
1218
  } finally {
1431
- _iterator6.f();
1219
+ _iterator5.f();
1432
1220
  }
1433
1221
  }
1434
1222
  } catch (err) {
1435
- _iterator5.e(err);
1223
+ _iterator4.e(err);
1436
1224
  } finally {
1437
- _iterator5.f();
1225
+ _iterator4.f();
1438
1226
  }
1439
1227
  if (!earliestStart || !latestEnd) return nextSlotConfig;
1440
1228
  return _objectSpread(_objectSpread({}, nextSlotConfig), {}, {
@@ -1504,20 +1292,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1504
1292
  }, {
1505
1293
  key: "toggleSlot",
1506
1294
  value: function () {
1507
- var _toggleSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(slot) {
1295
+ var _toggleSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(slot) {
1508
1296
  var mappings, mapping, currentSlots, existIndex, nextSlots, products;
1509
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1510
- while (1) switch (_context17.prev = _context17.next) {
1297
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1298
+ while (1) switch (_context16.prev = _context16.next) {
1511
1299
  case 0:
1512
1300
  this.logMethodStart('toggleSlot', {
1513
1301
  resourceId: slot.resourceId,
1514
1302
  productId: slot.productId,
1515
1303
  startTime: slot.startTime
1516
1304
  });
1517
- _context17.prev = 1;
1305
+ _context16.prev = 1;
1518
1306
  mappings = this.resourceProductMap.get(slot.resourceId);
1519
1307
  if (!(!mappings || !mappings.length)) {
1520
- _context17.next = 5;
1308
+ _context16.next = 5;
1521
1309
  break;
1522
1310
  }
1523
1311
  throw new Error("\u672A\u627E\u5230\u8D44\u6E90 ".concat(slot.resourceId, " \u7684\u5546\u54C1\u6620\u5C04"));
@@ -1526,13 +1314,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1526
1314
  return m.productId === slot.productId;
1527
1315
  });
1528
1316
  if (mapping) {
1529
- _context17.next = 8;
1317
+ _context16.next = 8;
1530
1318
  break;
1531
1319
  }
1532
1320
  throw new Error("\u8D44\u6E90 ".concat(slot.resourceId, " \u672A\u5173\u8054\u5546\u54C1 ").concat(slot.productId));
1533
1321
  case 8:
1534
1322
  if (this.store.order) {
1535
- _context17.next = 10;
1323
+ _context16.next = 10;
1536
1324
  break;
1537
1325
  }
1538
1326
  throw new Error('order 模块未初始化');
@@ -1548,14 +1336,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1548
1336
  } else {
1549
1337
  nextSlots = [].concat(_toConsumableArray(currentSlots), [slot]);
1550
1338
  }
1551
- _context17.next = 15;
1339
+ _context16.next = 15;
1552
1340
  return this.reconcileOrderForResourceProduct(slot.resourceId, slot.productId, nextSlots);
1553
1341
  case 15:
1554
1342
  products = this.store.order.getOrderProducts();
1555
- _context17.next = 18;
1343
+ _context16.next = 18;
1556
1344
  return this.refreshItemRuleQuantityLimits();
1557
1345
  case 18:
1558
- _context17.next = 20;
1346
+ _context16.next = 20;
1559
1347
  return this.refreshCartValidationPassed();
1560
1348
  case 20:
1561
1349
  this.logMethodSuccess('toggleSlot', {
@@ -1564,19 +1352,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1564
1352
  productId: slot.productId,
1565
1353
  slotCount: nextSlots.length
1566
1354
  });
1567
- return _context17.abrupt("return", products);
1355
+ return _context16.abrupt("return", products);
1568
1356
  case 24:
1569
- _context17.prev = 24;
1570
- _context17.t0 = _context17["catch"](1);
1571
- this.logMethodError('toggleSlot', _context17.t0);
1572
- throw _context17.t0;
1357
+ _context16.prev = 24;
1358
+ _context16.t0 = _context16["catch"](1);
1359
+ this.logMethodError('toggleSlot', _context16.t0);
1360
+ throw _context16.t0;
1573
1361
  case 28:
1574
1362
  case "end":
1575
- return _context17.stop();
1363
+ return _context16.stop();
1576
1364
  }
1577
- }, _callee17, this, [[1, 24]]);
1365
+ }, _callee16, this, [[1, 24]]);
1578
1366
  }));
1579
- function toggleSlot(_x9) {
1367
+ function toggleSlot(_x8) {
1580
1368
  return _toggleSlot.apply(this, arguments);
1581
1369
  }
1582
1370
  return toggleSlot;
@@ -1588,8 +1376,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1588
1376
  }, {
1589
1377
  key: "getSelectedSlotsForResource",
1590
1378
  value: function getSelectedSlotsForResource(resourceId, productId) {
1591
- var _this$store$order4;
1592
- var tempOrder = (_this$store$order4 = this.store.order) === null || _this$store$order4 === void 0 ? void 0 : _this$store$order4.getTempOrder();
1379
+ var _this$store$order3;
1380
+ var tempOrder = (_this$store$order3 = this.store.order) === null || _this$store$order3 === void 0 ? void 0 : _this$store$order3.getTempOrder();
1593
1381
  if (!tempOrder) return [];
1594
1382
  var venueProducts = tempOrder.products.filter(function (p) {
1595
1383
  var _p$metadata, _p$metadata2;
@@ -1600,24 +1388,24 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1600
1388
  });
1601
1389
  var slotDuration = this.store.slotConfig.slotDurationMinutes;
1602
1390
  var slots = [];
1603
- var _iterator7 = _createForOfIteratorHelper(venueProducts),
1604
- _step7;
1391
+ var _iterator6 = _createForOfIteratorHelper(venueProducts),
1392
+ _step6;
1605
1393
  try {
1606
1394
  var _loop = function _loop() {
1607
- var product = _step7.value;
1395
+ var product = _step6.value;
1608
1396
  slots.push.apply(slots, _toConsumableArray(expandMergedSlotToIndividual(product, slotDuration).map(function (s) {
1609
1397
  return _objectSpread(_objectSpread({}, s), {}, {
1610
1398
  productId: Number(product.product_id)
1611
1399
  });
1612
1400
  })));
1613
1401
  };
1614
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
1402
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
1615
1403
  _loop();
1616
1404
  }
1617
1405
  } catch (err) {
1618
- _iterator7.e(err);
1406
+ _iterator6.e(err);
1619
1407
  } finally {
1620
- _iterator7.f();
1408
+ _iterator6.f();
1621
1409
  }
1622
1410
  return slots.sort(function (a, b) {
1623
1411
  return a.startTime.localeCompare(b.startTime);
@@ -1690,28 +1478,28 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1690
1478
 
1691
1479
  // 规则 2:当前是组合资源,任一子资源被选 → 禁用
1692
1480
  if (currentIsCombined) {
1693
- var _iterator8 = _createForOfIteratorHelper(currentChildIds),
1694
- _step8;
1481
+ var _iterator7 = _createForOfIteratorHelper(currentChildIds),
1482
+ _step7;
1695
1483
  try {
1696
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
1697
- var childId = _step8.value;
1484
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
1485
+ var childId = _step7.value;
1698
1486
  if (getSelectedAt(childId).length > 0) return true;
1699
1487
  }
1700
1488
  } catch (err) {
1701
- _iterator8.e(err);
1489
+ _iterator7.e(err);
1702
1490
  } finally {
1703
- _iterator8.f();
1491
+ _iterator7.f();
1704
1492
  }
1705
1493
  }
1706
1494
 
1707
1495
  // 规则 3 & 4:扫描所有已选的 (resId),若是组合资源,检查其 children 是否包含当前 resourceId 或与当前 child 集合有交集
1708
- var _iterator9 = _createForOfIteratorHelper(allSelected),
1709
- _step9;
1496
+ var _iterator8 = _createForOfIteratorHelper(allSelected),
1497
+ _step8;
1710
1498
  try {
1711
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
1712
- var _step9$value = _slicedToArray(_step9.value, 2),
1713
- selectedResId = _step9$value[0],
1714
- slots = _step9$value[1];
1499
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
1500
+ var _step8$value = _slicedToArray(_step8.value, 2),
1501
+ selectedResId = _step8$value[0],
1502
+ slots = _step8$value[1];
1715
1503
  if (!slots.some(function (s) {
1716
1504
  return s.startTime === startTime;
1717
1505
  })) continue;
@@ -1737,9 +1525,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1737
1525
  }
1738
1526
  }
1739
1527
  } catch (err) {
1740
- _iterator9.e(err);
1528
+ _iterator8.e(err);
1741
1529
  } finally {
1742
- _iterator9.f();
1530
+ _iterator8.f();
1743
1531
  }
1744
1532
  return false;
1745
1533
  }
@@ -1750,22 +1538,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1750
1538
  }, {
1751
1539
  key: "getAllSelectedSlots",
1752
1540
  value: function getAllSelectedSlots() {
1753
- var _this$store$order5;
1541
+ var _this$store$order4;
1754
1542
  var result = new Map();
1755
- var tempOrder = (_this$store$order5 = this.store.order) === null || _this$store$order5 === void 0 ? void 0 : _this$store$order5.getTempOrder();
1543
+ var tempOrder = (_this$store$order4 = this.store.order) === null || _this$store$order4 === void 0 ? void 0 : _this$store$order4.getTempOrder();
1756
1544
  if (!tempOrder) return result;
1757
1545
  var venueProducts = tempOrder.products.filter(function (p) {
1758
1546
  var _p$metadata3;
1759
1547
  return (_p$metadata3 = p.metadata) === null || _p$metadata3 === void 0 ? void 0 : _p$metadata3.venue_booking;
1760
1548
  });
1761
1549
  var slotDuration = this.store.slotConfig.slotDurationMinutes;
1762
- var _iterator10 = _createForOfIteratorHelper(venueProducts),
1763
- _step10;
1550
+ var _iterator9 = _createForOfIteratorHelper(venueProducts),
1551
+ _step9;
1764
1552
  try {
1765
1553
  var _loop2 = function _loop2() {
1766
- var _product$metadata2;
1767
- var product = _step10.value;
1768
- var resourceId = (_product$metadata2 = product.metadata) === null || _product$metadata2 === void 0 ? void 0 : _product$metadata2.resource_id;
1554
+ var _product$metadata;
1555
+ var product = _step9.value;
1556
+ var resourceId = (_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.resource_id;
1769
1557
  if (resourceId == null) return 1; // continue
1770
1558
  var productId = Number(product.product_id);
1771
1559
  var existing = result.get(resourceId) || [];
@@ -1776,29 +1564,29 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1776
1564
  })));
1777
1565
  result.set(resourceId, existing);
1778
1566
  };
1779
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
1567
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
1780
1568
  if (_loop2()) continue;
1781
1569
  }
1782
1570
  } catch (err) {
1783
- _iterator10.e(err);
1571
+ _iterator9.e(err);
1784
1572
  } finally {
1785
- _iterator10.f();
1573
+ _iterator9.f();
1786
1574
  }
1787
- var _iterator11 = _createForOfIteratorHelper(result),
1788
- _step11;
1575
+ var _iterator10 = _createForOfIteratorHelper(result),
1576
+ _step10;
1789
1577
  try {
1790
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
1791
- var _step11$value = _slicedToArray(_step11.value, 2),
1792
- key = _step11$value[0],
1793
- slots = _step11$value[1];
1578
+ for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
1579
+ var _step10$value = _slicedToArray(_step10.value, 2),
1580
+ key = _step10$value[0],
1581
+ slots = _step10$value[1];
1794
1582
  result.set(key, slots.sort(function (a, b) {
1795
1583
  return a.startTime.localeCompare(b.startTime);
1796
1584
  }));
1797
1585
  }
1798
1586
  } catch (err) {
1799
- _iterator11.e(err);
1587
+ _iterator10.e(err);
1800
1588
  } finally {
1801
- _iterator11.f();
1589
+ _iterator10.f();
1802
1590
  }
1803
1591
  return result;
1804
1592
  }
@@ -1811,27 +1599,26 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1811
1599
  }, {
1812
1600
  key: "reconcileOrderForResourceProduct",
1813
1601
  value: (function () {
1814
- var _reconcileOrderForResourceProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(resourceId, productId, slots) {
1815
- var _this$store$order6, _this$store$order6$ge;
1816
- var mappings, mapping, tempOrder, matchesCurrent, merged, rawResource, childRawResources, venueProduct, i, _rawResource$form_id, _venueProduct$is_char, group, identityKey, bookingUuid, startMoment, endMoment, duration, customDepositData, productTitle, resourceEntry, venueProductOrigin, normalizedVenueOrderProduct, venueOrderProduct, booking, products;
1817
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1818
- while (1) switch (_context18.prev = _context18.next) {
1602
+ var _reconcileOrderForResourceProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(resourceId, productId, slots) {
1603
+ var mappings, mapping, tempOrder, matchesCurrent, merged, rawResource, childRawResources, venueProduct, i, _rawResource$form_id, _venueProduct$is_char, group, identityKey, bookingUuid, startMoment, endMoment, duration, customDepositData, resourceEntry, booking;
1604
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1605
+ while (1) switch (_context17.prev = _context17.next) {
1819
1606
  case 0:
1820
1607
  mappings = this.resourceProductMap.get(resourceId);
1821
1608
  if (!(!mappings || !mappings.length || !this.store.order)) {
1822
- _context18.next = 3;
1609
+ _context17.next = 3;
1823
1610
  break;
1824
1611
  }
1825
- return _context18.abrupt("return");
1612
+ return _context17.abrupt("return");
1826
1613
  case 3:
1827
1614
  mapping = mappings.find(function (m) {
1828
1615
  return m.productId === productId;
1829
1616
  });
1830
1617
  if (mapping) {
1831
- _context18.next = 6;
1618
+ _context17.next = 6;
1832
1619
  break;
1833
1620
  }
1834
- return _context18.abrupt("return");
1621
+ return _context17.abrupt("return");
1835
1622
  case 6:
1836
1623
  tempOrder = this.store.order.ensureTempOrder();
1837
1624
  matchesCurrent = function matchesCurrent(meta, pid) {
@@ -1849,17 +1636,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1849
1636
  return Number(bookingProductId) !== Number(productId);
1850
1637
  });
1851
1638
  if (slots.length) {
1852
- _context18.next = 16;
1639
+ _context17.next = 16;
1853
1640
  break;
1854
1641
  }
1855
1642
  this.store.order.applyDiscount();
1856
- _context18.next = 14;
1643
+ _context17.next = 14;
1857
1644
  return this.store.order.recalculateSummary({
1858
1645
  createIfMissing: true
1859
1646
  });
1860
1647
  case 14:
1861
1648
  this.store.order.persistTempOrder();
1862
- return _context18.abrupt("return");
1649
+ return _context17.abrupt("return");
1863
1650
  case 16:
1864
1651
  merged = mergeConsecutiveSlots(slots);
1865
1652
  rawResource = this.store.rawResourceData.find(function (r) {
@@ -1878,7 +1665,6 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1878
1665
  endMoment = dayjs(group.endTime, 'YYYY-MM-DD HH:mm');
1879
1666
  duration = endMoment.diff(startMoment, 'minute');
1880
1667
  customDepositData = cloneCustomDepositData(venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.custom_deposit_data);
1881
- productTitle = this.normalizeVenueProductTitle(venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.product_title) || this.normalizeVenueProductTitle(venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.title) || this.normalizeVenueProductTitle(mapping.productTitle);
1882
1668
  resourceEntry = {
1883
1669
  relation_type: 'form',
1884
1670
  like_status: 'common',
@@ -1907,45 +1693,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1907
1693
  };
1908
1694
  });
1909
1695
  }
1910
- venueProductOrigin = {
1911
- name: mapping.productTitle,
1912
- product_title: productTitle,
1913
- cover: (venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.cover) || '',
1914
- custom_deposit_data: customDepositData,
1915
- id: 0,
1916
- number: 1,
1917
- registration_type: 'all',
1918
- relation_products: [],
1919
- is_all: false,
1920
- product: {
1921
- product_id: mapping.productId,
1922
- product_variant_id: 0,
1923
- num: 1,
1924
- product_bundle: [],
1925
- product_sku: {
1926
- option: []
1927
- },
1928
- discount_list: [],
1929
- custom_deposit_data: customDepositData,
1930
- metadata: {}
1931
- },
1932
- sub_type: 'minutes',
1933
- duration: duration,
1934
- like_status: 'common',
1935
- resources: [resourceEntry],
1936
- schedule_id: 0,
1937
- select_date: startMoment.format('YYYY-MM-DD'),
1938
- start_date: startMoment.format('YYYY-MM-DD'),
1939
- start_time: startMoment.format('HH:mm'),
1940
- end_date: endMoment.format('YYYY-MM-DD'),
1941
- end_time: endMoment.format('HH:mm'),
1942
- metadata: {
1943
- venue_booking: true,
1944
- slot_count: group.slotCount
1945
- },
1946
- holder: null
1947
- };
1948
- normalizedVenueOrderProduct = normalizeOrderProduct({
1696
+ tempOrder.products.push(normalizeOrderProduct({
1949
1697
  product_id: mapping.productId,
1950
1698
  product_variant_id: 0,
1951
1699
  identity_key: identityKey,
@@ -1953,11 +1701,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1953
1701
  selling_price: group.totalPrice,
1954
1702
  original_price: group.totalPrice,
1955
1703
  is_charge_tax: (_venueProduct$is_char = venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.is_charge_tax) !== null && _venueProduct$is_char !== void 0 ? _venueProduct$is_char : 0,
1956
- metadata: _objectSpread(_objectSpread({
1957
- venue_booking: true
1958
- }, productTitle ? {
1959
- product_title: productTitle
1960
- } : {}), {}, {
1704
+ metadata: {
1705
+ venue_booking: true,
1961
1706
  resource_id: resourceId,
1962
1707
  resource_form_id: mapping.formId,
1963
1708
  resource_name: mapping.resourceName,
@@ -1970,14 +1715,45 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1970
1715
  productId: mapping.productId,
1971
1716
  quotation: this.store.quotation
1972
1717
  })
1973
- }),
1974
- _origin: venueProductOrigin
1975
- });
1976
- venueOrderProduct = productTitle ? _objectSpread(_objectSpread({}, normalizedVenueOrderProduct), {}, {
1977
- product_title: productTitle
1978
- }) : normalizedVenueOrderProduct;
1979
- this.attachProductOriginToTempOrder(tempOrder, identityKey, venueProductOrigin);
1980
- tempOrder.products.push(venueOrderProduct);
1718
+ },
1719
+ _origin: {
1720
+ name: mapping.productTitle,
1721
+ cover: (venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.cover) || '',
1722
+ custom_deposit_data: customDepositData,
1723
+ id: 0,
1724
+ number: 1,
1725
+ registration_type: 'all',
1726
+ relation_products: [],
1727
+ is_all: false,
1728
+ product: {
1729
+ product_id: mapping.productId,
1730
+ product_variant_id: 0,
1731
+ num: 1,
1732
+ product_bundle: [],
1733
+ product_sku: {
1734
+ option: []
1735
+ },
1736
+ discount_list: [],
1737
+ custom_deposit_data: customDepositData,
1738
+ metadata: {}
1739
+ },
1740
+ sub_type: 'minutes',
1741
+ duration: duration,
1742
+ like_status: 'common',
1743
+ resources: [resourceEntry],
1744
+ schedule_id: 0,
1745
+ select_date: startMoment.format('YYYY-MM-DD'),
1746
+ start_date: startMoment.format('YYYY-MM-DD'),
1747
+ start_time: startMoment.format('HH:mm'),
1748
+ end_date: endMoment.format('YYYY-MM-DD'),
1749
+ end_time: endMoment.format('HH:mm'),
1750
+ metadata: {
1751
+ venue_booking: true,
1752
+ slot_count: group.slotCount
1753
+ },
1754
+ holder: null
1755
+ }
1756
+ }));
1981
1757
  booking = buildVenueBookingEntry({
1982
1758
  group: group,
1983
1759
  resourceId: resourceId,
@@ -1989,26 +1765,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1989
1765
  });
1990
1766
  tempOrder.bookings.push(booking);
1991
1767
  }
1992
-
1993
- // 获取表单信息
1994
- products = ((_this$store$order6 = this.store.order) === null || _this$store$order6 === void 0 || (_this$store$order6$ge = _this$store$order6.getOrderProducts) === null || _this$store$order6$ge === void 0 ? void 0 : _this$store$order6$ge.call(_this$store$order6)) || [];
1995
- _context18.next = 25;
1996
- return this.preloadHolderForms(products);
1997
- case 25:
1998
1768
  this.store.order.applyDiscount();
1999
- _context18.next = 28;
1769
+ _context17.next = 25;
2000
1770
  return this.store.order.recalculateSummary({
2001
1771
  createIfMissing: true
2002
1772
  });
2003
- case 28:
1773
+ case 25:
2004
1774
  this.store.order.persistTempOrder();
2005
- case 29:
1775
+ case 26:
2006
1776
  case "end":
2007
- return _context18.stop();
1777
+ return _context17.stop();
2008
1778
  }
2009
- }, _callee18, this);
1779
+ }, _callee17, this);
2010
1780
  }));
2011
- function reconcileOrderForResourceProduct(_x10, _x11, _x12) {
1781
+ function reconcileOrderForResourceProduct(_x9, _x10, _x11) {
2012
1782
  return _reconcileOrderForResourceProduct.apply(this, arguments);
2013
1783
  }
2014
1784
  return reconcileOrderForResourceProduct;
@@ -2023,23 +1793,23 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2023
1793
  return undefined;
2024
1794
  }
2025
1795
  var children = [];
2026
- var _iterator12 = _createForOfIteratorHelper(combined.resource_ids),
2027
- _step12;
1796
+ var _iterator11 = _createForOfIteratorHelper(combined.resource_ids),
1797
+ _step11;
2028
1798
  try {
2029
1799
  var _loop3 = function _loop3() {
2030
- var id = _step12.value;
1800
+ var id = _step11.value;
2031
1801
  var child = _this8.store.rawResourceData.find(function (r) {
2032
1802
  return String(r.resourceId) === String(id);
2033
1803
  });
2034
1804
  if (child) children.push(child);
2035
1805
  };
2036
- for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
1806
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
2037
1807
  _loop3();
2038
1808
  }
2039
1809
  } catch (err) {
2040
- _iterator12.e(err);
1810
+ _iterator11.e(err);
2041
1811
  } finally {
2042
- _iterator12.f();
1812
+ _iterator11.f();
2043
1813
  }
2044
1814
  return children.length ? children : undefined;
2045
1815
  }
@@ -2061,35 +1831,35 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2061
1831
  }, {
2062
1832
  key: "loadSchedules",
2063
1833
  value: function () {
2064
- var _loadSchedules = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
2065
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
2066
- while (1) switch (_context19.prev = _context19.next) {
1834
+ var _loadSchedules = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
1835
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1836
+ while (1) switch (_context18.prev = _context18.next) {
2067
1837
  case 0:
2068
1838
  this.logMethodStart('loadSchedules');
2069
- _context19.prev = 1;
1839
+ _context18.prev = 1;
2070
1840
  if (this.store.schedule) {
2071
- _context19.next = 4;
1841
+ _context18.next = 4;
2072
1842
  break;
2073
1843
  }
2074
1844
  throw new Error('schedule 模块未初始化');
2075
1845
  case 4:
2076
- _context19.next = 6;
1846
+ _context18.next = 6;
2077
1847
  return this.store.schedule.loadAllSchedule();
2078
1848
  case 6:
2079
1849
  this.injectScheduleResolverToQuotation();
2080
1850
  this.logMethodSuccess('loadSchedules');
2081
- _context19.next = 14;
1851
+ _context18.next = 14;
2082
1852
  break;
2083
1853
  case 10:
2084
- _context19.prev = 10;
2085
- _context19.t0 = _context19["catch"](1);
2086
- this.logMethodError('loadSchedules', _context19.t0);
2087
- throw _context19.t0;
1854
+ _context18.prev = 10;
1855
+ _context18.t0 = _context18["catch"](1);
1856
+ this.logMethodError('loadSchedules', _context18.t0);
1857
+ throw _context18.t0;
2088
1858
  case 14:
2089
1859
  case "end":
2090
- return _context19.stop();
1860
+ return _context18.stop();
2091
1861
  }
2092
- }, _callee19, this, [[1, 10]]);
1862
+ }, _callee18, this, [[1, 10]]);
2093
1863
  }));
2094
1864
  function loadSchedules() {
2095
1865
  return _loadSchedules.apply(this, arguments);
@@ -2117,16 +1887,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2117
1887
  }, {
2118
1888
  key: "getTempOrder",
2119
1889
  value: function getTempOrder() {
2120
- var _this$store$order7;
2121
- var result = ((_this$store$order7 = this.store.order) === null || _this$store$order7 === void 0 ? void 0 : _this$store$order7.getTempOrder()) || null;
1890
+ var _this$store$order5;
1891
+ var result = ((_this$store$order5 = this.store.order) === null || _this$store$order5 === void 0 ? void 0 : _this$store$order5.getTempOrder()) || null;
2122
1892
  return result;
2123
1893
  }
2124
1894
  }, {
2125
1895
  key: "updateTempOrderNote",
2126
1896
  value: function updateTempOrderNote(note) {
2127
- var sync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2128
1897
  if (!this.store.order) throw new Error('order 模块未初始化');
2129
- return this.store.order.updateTempOrderNote(note, sync);
1898
+ return this.store.order.updateTempOrderNote(note);
2130
1899
  }
2131
1900
  }, {
2132
1901
  key: "updateTempOrderContactsInfo",
@@ -2135,23 +1904,23 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2135
1904
  return this.store.order.updateTempOrderContactsInfo(contactsInfo);
2136
1905
  }
2137
1906
  }, {
2138
- key: "ensureVenueTempOrder",
2139
- value: function ensureVenueTempOrder() {
1907
+ key: "ensureTempOrder",
1908
+ value: function ensureTempOrder() {
2140
1909
  if (!this.store.order) throw new Error('order 模块未初始化');
2141
1910
  return this.store.order.ensureTempOrder();
2142
1911
  }
2143
1912
  }, {
2144
1913
  key: "onCustomerLogin",
2145
1914
  value: function () {
2146
- var _onCustomerLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(params) {
2147
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
2148
- while (1) switch (_context20.prev = _context20.next) {
1915
+ var _onCustomerLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(params) {
1916
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1917
+ while (1) switch (_context19.prev = _context19.next) {
2149
1918
  case 0:
2150
1919
  this.logMethodStart('onCustomerLogin', {
2151
1920
  customerId: params.customerId
2152
1921
  });
2153
- _context20.prev = 1;
2154
- _context20.next = 4;
1922
+ _context19.prev = 1;
1923
+ _context19.next = 4;
2155
1924
  return this.refreshOrderMarketingAfterLogin({
2156
1925
  customerId: params.customerId
2157
1926
  });
@@ -2159,20 +1928,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2159
1928
  this.logMethodSuccess('onCustomerLogin', {
2160
1929
  customerId: params.customerId
2161
1930
  });
2162
- _context20.next = 11;
1931
+ _context19.next = 11;
2163
1932
  break;
2164
1933
  case 7:
2165
- _context20.prev = 7;
2166
- _context20.t0 = _context20["catch"](1);
2167
- this.logMethodError('onCustomerLogin', _context20.t0);
2168
- throw _context20.t0;
1934
+ _context19.prev = 7;
1935
+ _context19.t0 = _context19["catch"](1);
1936
+ this.logMethodError('onCustomerLogin', _context19.t0);
1937
+ throw _context19.t0;
2169
1938
  case 11:
2170
1939
  case "end":
2171
- return _context20.stop();
1940
+ return _context19.stop();
2172
1941
  }
2173
- }, _callee20, this, [[1, 7]]);
1942
+ }, _callee19, this, [[1, 7]]);
2174
1943
  }));
2175
- function onCustomerLogin(_x13) {
1944
+ function onCustomerLogin(_x12) {
2176
1945
  return _onCustomerLogin.apply(this, arguments);
2177
1946
  }
2178
1947
  return onCustomerLogin;
@@ -2186,13 +1955,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2186
1955
  var tempOrder = this.store.order.getTempOrder();
2187
1956
  if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$products = tempOrder.products) !== null && _tempOrder$products !== void 0 && _tempOrder$products.length)) return;
2188
1957
  var now = dayjs().format('YYYY-MM-DD HH:mm:ss');
2189
- var _iterator13 = _createForOfIteratorHelper(tempOrder.products),
2190
- _step13;
1958
+ var _iterator12 = _createForOfIteratorHelper(tempOrder.products),
1959
+ _step12;
2191
1960
  try {
2192
1961
  var _loop4 = function _loop4() {
2193
- var _product$metadata3;
2194
- var product = _step13.value;
2195
- if ((_product$metadata3 = product.metadata) !== null && _product$metadata3 !== void 0 && _product$metadata3.venue_booking) {
1962
+ var _product$metadata2;
1963
+ var product = _step12.value;
1964
+ if ((_product$metadata2 = product.metadata) !== null && _product$metadata2 !== void 0 && _product$metadata2.venue_booking) {
2196
1965
  var mappings = _this10.resourceProductMap.get(product.metadata.resource_id);
2197
1966
  if (!mappings || !mappings.length) return 0; // continue
2198
1967
  var mapping = mappings.find(function (m) {
@@ -2234,43 +2003,43 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2234
2003
  }
2235
2004
  },
2236
2005
  _ret;
2237
- for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
2006
+ for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
2238
2007
  _ret = _loop4();
2239
2008
  if (_ret === 0) continue;
2240
2009
  }
2241
2010
  } catch (err) {
2242
- _iterator13.e(err);
2011
+ _iterator12.e(err);
2243
2012
  } finally {
2244
- _iterator13.f();
2013
+ _iterator12.f();
2245
2014
  }
2246
2015
  }
2247
2016
  }, {
2248
2017
  key: "scanCode",
2249
2018
  value: function () {
2250
- var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(code, customerId) {
2019
+ var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(code, customerId) {
2251
2020
  var result;
2252
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
2253
- while (1) switch (_context21.prev = _context21.next) {
2021
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
2022
+ while (1) switch (_context20.prev = _context20.next) {
2254
2023
  case 0:
2255
2024
  this.logMethodStart('scanCode', {
2256
2025
  code: code
2257
2026
  });
2258
- _context21.prev = 1;
2027
+ _context20.prev = 1;
2259
2028
  if (this.store.order) {
2260
- _context21.next = 4;
2029
+ _context20.next = 4;
2261
2030
  break;
2262
2031
  }
2263
2032
  throw new Error('order 模块未初始化');
2264
2033
  case 4:
2265
- _context21.next = 6;
2034
+ _context20.next = 6;
2266
2035
  return this.store.order.scanCode(code, customerId);
2267
2036
  case 6:
2268
- result = _context21.sent;
2037
+ result = _context20.sent;
2269
2038
  if (!result.isAvailable) {
2270
- _context21.next = 11;
2039
+ _context20.next = 11;
2271
2040
  break;
2272
2041
  }
2273
- _context21.next = 10;
2042
+ _context20.next = 10;
2274
2043
  return this.store.order.recalculateSummary({
2275
2044
  createIfMissing: true
2276
2045
  });
@@ -2280,19 +2049,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2280
2049
  this.logMethodSuccess('scanCode', {
2281
2050
  isAvailable: result.isAvailable
2282
2051
  });
2283
- return _context21.abrupt("return", result);
2052
+ return _context20.abrupt("return", result);
2284
2053
  case 15:
2285
- _context21.prev = 15;
2286
- _context21.t0 = _context21["catch"](1);
2287
- this.logMethodError('scanCode', _context21.t0);
2288
- throw _context21.t0;
2054
+ _context20.prev = 15;
2055
+ _context20.t0 = _context20["catch"](1);
2056
+ this.logMethodError('scanCode', _context20.t0);
2057
+ throw _context20.t0;
2289
2058
  case 19:
2290
2059
  case "end":
2291
- return _context21.stop();
2060
+ return _context20.stop();
2292
2061
  }
2293
- }, _callee21, this, [[1, 15]]);
2062
+ }, _callee20, this, [[1, 15]]);
2294
2063
  }));
2295
- function scanCode(_x14, _x15) {
2064
+ function scanCode(_x13, _x14) {
2296
2065
  return _scanCode.apply(this, arguments);
2297
2066
  }
2298
2067
  return scanCode;
@@ -2308,15 +2077,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2308
2077
  }, {
2309
2078
  key: "setDiscountSelected",
2310
2079
  value: (function () {
2311
- var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(params) {
2312
- var _tempOrder$holder, _this$store$order$get, _this$store$order$get2, list, beforeTarget, updated, updatedTarget, tempOrder, orderStore, discountModule, rulesModule, holders, nextDiscountList, _tempOrder$holder2, result, beforeSelectedIds, _iterator14, _step14, d, selectedResourceIds, _iterator15, _step15, _origin, _product$metadata$sou, _product$metadata4, _product$metadata5, _product$original_pri, product, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice, afterApplyTarget, finalSummary, finalProduct, finalTarget;
2313
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
2314
- while (1) switch (_context22.prev = _context22.next) {
2080
+ var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(params) {
2081
+ var _tempOrder$holder, _this$store$order$get, _this$store$order$get2, list, beforeTarget, updated, updatedTarget, tempOrder, orderStore, discountModule, rulesModule, holders, nextDiscountList, _tempOrder$holder2, result, beforeSelectedIds, _iterator13, _step13, d, selectedResourceIds, _iterator14, _step14, _origin, _product$metadata$sou, _product$metadata3, _product$metadata4, _product$original_pri, product, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice, afterApplyTarget, finalSummary, finalProduct, finalTarget;
2082
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
2083
+ while (1) switch (_context21.prev = _context21.next) {
2315
2084
  case 0:
2316
2085
  this.logMethodStart('setDiscountSelected', params);
2317
- _context22.prev = 1;
2086
+ _context21.prev = 1;
2318
2087
  if (this.store.order) {
2319
- _context22.next = 4;
2088
+ _context21.next = 4;
2320
2089
  break;
2321
2090
  }
2322
2091
  throw new Error('order 模块未初始化');
@@ -2342,7 +2111,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2342
2111
  form_record_id: tempOrder.holder.form_record_id
2343
2112
  }] : [];
2344
2113
  nextDiscountList = updated;
2345
- _context22.next = 16;
2114
+ _context21.next = 16;
2346
2115
  return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(updated);
2347
2116
  case 16:
2348
2117
  if (rulesModule) {
@@ -2369,18 +2138,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2369
2138
  }).map(function (d) {
2370
2139
  return d.id;
2371
2140
  }));
2372
- _iterator14 = _createForOfIteratorHelper(nextDiscountList);
2141
+ _iterator13 = _createForOfIteratorHelper(nextDiscountList);
2373
2142
  try {
2374
- for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
2375
- d = _step14.value;
2143
+ for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
2144
+ d = _step13.value;
2376
2145
  if (d.isSelected && !beforeSelectedIds.has(d.id)) {
2377
2146
  d.isSelected = false;
2378
2147
  }
2379
2148
  }
2380
2149
  } catch (err) {
2381
- _iterator14.e(err);
2150
+ _iterator13.e(err);
2382
2151
  } finally {
2383
- _iterator14.f();
2152
+ _iterator13.f();
2384
2153
  }
2385
2154
  }
2386
2155
  }
@@ -2393,27 +2162,27 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2393
2162
  // 都以 original_price - Σ (当前选中 discount_list.amount) 重算 selling_price。
2394
2163
  // 目的:避免 unselect 后 selling_price 残留、reselect 时把残留价带进下一轮 Rules 造成双折扣。
2395
2164
  // 手动改价商品(_origin.isManualDiscount=true)不参与券流程归一化,保留手工价。
2396
- _iterator15 = _createForOfIteratorHelper(tempOrder.products);
2397
- _context22.prev = 19;
2398
- _iterator15.s();
2165
+ _iterator14 = _createForOfIteratorHelper(tempOrder.products);
2166
+ _context21.prev = 19;
2167
+ _iterator14.s();
2399
2168
  case 21:
2400
- if ((_step15 = _iterator15.n()).done) {
2401
- _context22.next = 38;
2169
+ if ((_step14 = _iterator14.n()).done) {
2170
+ _context21.next = 38;
2402
2171
  break;
2403
2172
  }
2404
- product = _step15.value;
2173
+ product = _step14.value;
2405
2174
  if (!((_origin = product._origin) !== null && _origin !== void 0 && _origin.isManualDiscount)) {
2406
- _context22.next = 25;
2175
+ _context21.next = 25;
2407
2176
  break;
2408
2177
  }
2409
- return _context22.abrupt("continue", 36);
2178
+ return _context21.abrupt("continue", 36);
2410
2179
  case 25:
2411
2180
  if (!(product.discount_list || []).some(isItemRewardProductDiscount)) {
2412
- _context22.next = 28;
2181
+ _context21.next = 28;
2413
2182
  break;
2414
2183
  }
2415
2184
  product.discount_list = (product.discount_list || []).filter(isItemRewardProductDiscount);
2416
- return _context22.abrupt("continue", 36);
2185
+ return _context21.abrupt("continue", 36);
2417
2186
  case 28:
2418
2187
  // 1. 把 product.discount_list 和当前选中的 discount 对齐(剔除已取消的券)
2419
2188
  product.discount_list = (product.discount_list || []).filter(function (pd) {
@@ -2428,7 +2197,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2428
2197
  return sum + (pd.amount || 0);
2429
2198
  }, 0);
2430
2199
  optionSum = sumOptionUnitPrice(getProductSkuOptions(product));
2431
- sourcePrice = (_product$metadata$sou = (_product$metadata4 = product.metadata) === null || _product$metadata4 === void 0 ? void 0 : _product$metadata4.source_product_price) !== null && _product$metadata$sou !== void 0 ? _product$metadata$sou : ((_product$metadata5 = product.metadata) === null || _product$metadata5 === void 0 ? void 0 : _product$metadata5.main_product_original_price) != null ? new Decimal(Number(product.metadata.main_product_original_price) || 0).minus(optionSum).toFixed(2) : (_product$original_pri = product.original_price) !== null && _product$original_pri !== void 0 ? _product$original_pri : '0';
2200
+ sourcePrice = (_product$metadata$sou = (_product$metadata3 = product.metadata) === null || _product$metadata3 === void 0 ? void 0 : _product$metadata3.source_product_price) !== null && _product$metadata$sou !== void 0 ? _product$metadata$sou : ((_product$metadata4 = product.metadata) === null || _product$metadata4 === void 0 ? void 0 : _product$metadata4.main_product_original_price) != null ? new Decimal(Number(product.metadata.main_product_original_price) || 0).minus(optionSum).toFixed(2) : (_product$original_pri = product.original_price) !== null && _product$original_pri !== void 0 ? _product$original_pri : '0';
2432
2201
  newSourceSellingPrice = new Decimal(Number(sourcePrice) || 0).minus(totalPerUnitDiscount).toDecimalPlaces(2).toString();
2433
2202
  newMainSellingPrice = new Decimal(Number(newSourceSellingPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
2434
2203
  if (product.metadata) {
@@ -2440,22 +2209,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2440
2209
  bundle: product.product_bundle
2441
2210
  });
2442
2211
  case 36:
2443
- _context22.next = 21;
2212
+ _context21.next = 21;
2444
2213
  break;
2445
2214
  case 38:
2446
- _context22.next = 43;
2215
+ _context21.next = 43;
2447
2216
  break;
2448
2217
  case 40:
2449
- _context22.prev = 40;
2450
- _context22.t0 = _context22["catch"](19);
2451
- _iterator15.e(_context22.t0);
2218
+ _context21.prev = 40;
2219
+ _context21.t0 = _context21["catch"](19);
2220
+ _iterator14.e(_context21.t0);
2452
2221
  case 43:
2453
- _context22.prev = 43;
2454
- _iterator15.f();
2455
- return _context22.finish(43);
2222
+ _context21.prev = 43;
2223
+ _iterator14.f();
2224
+ return _context21.finish(43);
2456
2225
  case 46:
2457
2226
  OrderModule.populateSavedAmounts(tempOrder.products, nextDiscountList);
2458
- _context22.next = 49;
2227
+ _context21.next = 49;
2459
2228
  return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(nextDiscountList);
2460
2229
  case 49:
2461
2230
  tempOrder.discount_list = (nextDiscountList || []).filter(function (d) {
@@ -2464,7 +2233,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2464
2233
  afterApplyTarget = this.store.order.getDiscountList().find(function (d) {
2465
2234
  return d.id === params.discountId;
2466
2235
  }) || null;
2467
- _context22.next = 53;
2236
+ _context21.next = 53;
2468
2237
  return this.store.order.recalculateSummary({
2469
2238
  createIfMissing: true
2470
2239
  });
@@ -2476,19 +2245,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2476
2245
  finalTarget = this.store.order.getDiscountList().find(function (d) {
2477
2246
  return d.id === params.discountId;
2478
2247
  }) || null;
2479
- return _context22.abrupt("return", this.store.order.getDiscountList());
2248
+ return _context21.abrupt("return", this.store.order.getDiscountList());
2480
2249
  case 61:
2481
- _context22.prev = 61;
2482
- _context22.t1 = _context22["catch"](1);
2483
- this.logMethodError('setDiscountSelected', _context22.t1);
2484
- throw _context22.t1;
2250
+ _context21.prev = 61;
2251
+ _context21.t1 = _context21["catch"](1);
2252
+ this.logMethodError('setDiscountSelected', _context21.t1);
2253
+ throw _context21.t1;
2485
2254
  case 65:
2486
2255
  case "end":
2487
- return _context22.stop();
2256
+ return _context21.stop();
2488
2257
  }
2489
- }, _callee22, this, [[1, 61], [19, 40, 43, 46]]);
2258
+ }, _callee21, this, [[1, 61], [19, 40, 43, 46]]);
2490
2259
  }));
2491
- function setDiscountSelected(_x16) {
2260
+ function setDiscountSelected(_x15) {
2492
2261
  return _setDiscountSelected.apply(this, arguments);
2493
2262
  }
2494
2263
  return setDiscountSelected;
@@ -2496,37 +2265,37 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2496
2265
  }, {
2497
2266
  key: "addNewOrder",
2498
2267
  value: function () {
2499
- var _addNewOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
2268
+ var _addNewOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
2500
2269
  var tempOrder;
2501
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
2502
- while (1) switch (_context23.prev = _context23.next) {
2270
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
2271
+ while (1) switch (_context22.prev = _context22.next) {
2503
2272
  case 0:
2504
2273
  this.logMethodStart('addNewOrder');
2505
- _context23.prev = 1;
2274
+ _context22.prev = 1;
2506
2275
  if (this.store.order) {
2507
- _context23.next = 4;
2276
+ _context22.next = 4;
2508
2277
  break;
2509
2278
  }
2510
2279
  throw new Error('order 模块未初始化');
2511
2280
  case 4:
2512
- _context23.next = 6;
2281
+ _context22.next = 6;
2513
2282
  return this.store.order.addNewOrder();
2514
2283
  case 6:
2515
- tempOrder = _context23.sent;
2284
+ tempOrder = _context22.sent;
2516
2285
  this.logMethodSuccess('addNewOrder', {
2517
2286
  productCount: tempOrder.products.length
2518
2287
  });
2519
- return _context23.abrupt("return", tempOrder);
2288
+ return _context22.abrupt("return", tempOrder);
2520
2289
  case 11:
2521
- _context23.prev = 11;
2522
- _context23.t0 = _context23["catch"](1);
2523
- this.logMethodError('addNewOrder', _context23.t0);
2524
- throw _context23.t0;
2290
+ _context22.prev = 11;
2291
+ _context22.t0 = _context22["catch"](1);
2292
+ this.logMethodError('addNewOrder', _context22.t0);
2293
+ throw _context22.t0;
2525
2294
  case 15:
2526
2295
  case "end":
2527
- return _context23.stop();
2296
+ return _context22.stop();
2528
2297
  }
2529
- }, _callee23, this, [[1, 11]]);
2298
+ }, _callee22, this, [[1, 11]]);
2530
2299
  }));
2531
2300
  function addNewOrder() {
2532
2301
  return _addNewOrder.apply(this, arguments);
@@ -2543,37 +2312,37 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2543
2312
  }, {
2544
2313
  key: "getSummary",
2545
2314
  value: function () {
2546
- var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
2315
+ var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
2547
2316
  var summary;
2548
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
2549
- while (1) switch (_context24.prev = _context24.next) {
2317
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
2318
+ while (1) switch (_context23.prev = _context23.next) {
2550
2319
  case 0:
2551
2320
  this.logMethodStart('getSummary');
2552
- _context24.prev = 1;
2321
+ _context23.prev = 1;
2553
2322
  if (this.store.order) {
2554
- _context24.next = 4;
2323
+ _context23.next = 4;
2555
2324
  break;
2556
2325
  }
2557
2326
  throw new Error('order 模块未初始化');
2558
2327
  case 4:
2559
- _context24.next = 6;
2328
+ _context23.next = 6;
2560
2329
  return this.store.order.getOrderSummary();
2561
2330
  case 6:
2562
- summary = _context24.sent;
2331
+ summary = _context23.sent;
2563
2332
  this.logMethodSuccess('getSummary', {
2564
2333
  totalAmount: summary.total_amount
2565
2334
  });
2566
- return _context24.abrupt("return", summary);
2335
+ return _context23.abrupt("return", summary);
2567
2336
  case 11:
2568
- _context24.prev = 11;
2569
- _context24.t0 = _context24["catch"](1);
2570
- this.logMethodError('getSummary', _context24.t0);
2571
- throw _context24.t0;
2337
+ _context23.prev = 11;
2338
+ _context23.t0 = _context23["catch"](1);
2339
+ this.logMethodError('getSummary', _context23.t0);
2340
+ throw _context23.t0;
2572
2341
  case 15:
2573
2342
  case "end":
2574
- return _context24.stop();
2343
+ return _context23.stop();
2575
2344
  }
2576
- }, _callee24, this, [[1, 11]]);
2345
+ }, _callee23, this, [[1, 11]]);
2577
2346
  }));
2578
2347
  function getSummary() {
2579
2348
  return _getSummary.apply(this, arguments);
@@ -2583,47 +2352,47 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2583
2352
  }, {
2584
2353
  key: "submitOrder",
2585
2354
  value: function () {
2586
- var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
2587
- var _this$otherParams13, _this$otherParams14, _this$otherParams15, _this$otherParams16, _tempOrder$products2, result, tempOrder;
2588
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
2589
- while (1) switch (_context25.prev = _context25.next) {
2355
+ var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
2356
+ var _this$otherParams8, _this$otherParams9, _this$otherParams10, _this$otherParams11, _tempOrder$products2, result, tempOrder;
2357
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
2358
+ while (1) switch (_context24.prev = _context24.next) {
2590
2359
  case 0:
2591
2360
  this.logMethodStart('submitOrder');
2592
- _context25.prev = 1;
2593
- _context25.next = 4;
2361
+ _context24.prev = 1;
2362
+ _context24.next = 4;
2594
2363
  return this.validateBeforeSubmitByItemRule();
2595
2364
  case 4:
2596
2365
  if (this.store.order) {
2597
- _context25.next = 6;
2366
+ _context24.next = 6;
2598
2367
  break;
2599
2368
  }
2600
2369
  throw new Error('venueBooking解决方案需要 order 模块支持');
2601
2370
  case 6:
2602
- _context25.next = 8;
2371
+ _context24.next = 8;
2603
2372
  return this.store.order.submitTempOrder({
2604
2373
  cacheId: this.cacheId,
2605
- platform: (_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.platform,
2606
- businessCode: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.businessCode,
2607
- channel: (_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.channel,
2608
- type: (_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.type
2374
+ platform: (_this$otherParams8 = this.otherParams) === null || _this$otherParams8 === void 0 ? void 0 : _this$otherParams8.platform,
2375
+ businessCode: (_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.businessCode,
2376
+ channel: (_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.channel,
2377
+ type: (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.type
2609
2378
  });
2610
2379
  case 8:
2611
- result = _context25.sent;
2380
+ result = _context24.sent;
2612
2381
  tempOrder = this.store.order.getTempOrder();
2613
2382
  this.logMethodSuccess('submitOrder', {
2614
2383
  productCount: (tempOrder === null || tempOrder === void 0 || (_tempOrder$products2 = tempOrder.products) === null || _tempOrder$products2 === void 0 ? void 0 : _tempOrder$products2.length) || 0
2615
2384
  });
2616
- return _context25.abrupt("return", result);
2385
+ return _context24.abrupt("return", result);
2617
2386
  case 14:
2618
- _context25.prev = 14;
2619
- _context25.t0 = _context25["catch"](1);
2620
- this.logMethodError('submitOrder', _context25.t0);
2621
- throw _context25.t0;
2387
+ _context24.prev = 14;
2388
+ _context24.t0 = _context24["catch"](1);
2389
+ this.logMethodError('submitOrder', _context24.t0);
2390
+ throw _context24.t0;
2622
2391
  case 18:
2623
2392
  case "end":
2624
- return _context25.stop();
2393
+ return _context24.stop();
2625
2394
  }
2626
- }, _callee25, this, [[1, 14]]);
2395
+ }, _callee24, this, [[1, 14]]);
2627
2396
  }));
2628
2397
  function submitOrder() {
2629
2398
  return _submitOrder.apply(this, arguments);
@@ -2633,23 +2402,23 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2633
2402
  }, {
2634
2403
  key: "addProductToOrder",
2635
2404
  value: function () {
2636
- var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(product) {
2637
- var _product$metadata6, _product$product_vari2, quotationPrice, products;
2638
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2639
- while (1) switch (_context26.prev = _context26.next) {
2405
+ var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(product) {
2406
+ var _product$metadata5, _product$product_vari2, quotationPrice, products;
2407
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
2408
+ while (1) switch (_context25.prev = _context25.next) {
2640
2409
  case 0:
2641
2410
  this.logMethodStart('addProductToOrder', {
2642
2411
  product_id: product.product_id,
2643
2412
  product_variant_id: product.product_variant_id
2644
2413
  });
2645
- _context26.prev = 1;
2414
+ _context25.prev = 1;
2646
2415
  if (this.store.order) {
2647
- _context26.next = 4;
2416
+ _context25.next = 4;
2648
2417
  break;
2649
2418
  }
2650
2419
  throw new Error('order 模块未初始化');
2651
2420
  case 4:
2652
- if (!((_product$metadata6 = product.metadata) !== null && _product$metadata6 !== void 0 && _product$metadata6.venue_booking) && this.store.quotation && product.product_id != null) {
2421
+ if (!((_product$metadata5 = product.metadata) !== null && _product$metadata5 !== void 0 && _product$metadata5.venue_booking) && this.store.quotation && product.product_id != null) {
2653
2422
  quotationPrice = this.store.quotation.getPriceForProduct({
2654
2423
  productId: product.product_id,
2655
2424
  variantId: (_product$product_vari2 = product.product_variant_id) !== null && _product$product_vari2 !== void 0 ? _product$product_vari2 : undefined,
@@ -2662,32 +2431,32 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2662
2431
  product.original_price = product.selling_price;
2663
2432
  }
2664
2433
  }
2665
- _context26.next = 7;
2434
+ _context25.next = 7;
2666
2435
  return this.store.order.addProductToOrder(product);
2667
2436
  case 7:
2668
- products = _context26.sent;
2669
- _context26.next = 10;
2437
+ products = _context25.sent;
2438
+ _context25.next = 10;
2670
2439
  return this.refreshItemRuleQuantityLimits();
2671
2440
  case 10:
2672
- _context26.next = 12;
2441
+ _context25.next = 12;
2673
2442
  return this.refreshCartValidationPassed();
2674
2443
  case 12:
2675
2444
  this.logMethodSuccess('addProductToOrder', {
2676
2445
  productCount: products.length
2677
2446
  });
2678
- return _context26.abrupt("return", products);
2447
+ return _context25.abrupt("return", products);
2679
2448
  case 16:
2680
- _context26.prev = 16;
2681
- _context26.t0 = _context26["catch"](1);
2682
- this.logMethodError('addProductToOrder', _context26.t0);
2683
- throw _context26.t0;
2449
+ _context25.prev = 16;
2450
+ _context25.t0 = _context25["catch"](1);
2451
+ this.logMethodError('addProductToOrder', _context25.t0);
2452
+ throw _context25.t0;
2684
2453
  case 20:
2685
2454
  case "end":
2686
- return _context26.stop();
2455
+ return _context25.stop();
2687
2456
  }
2688
- }, _callee26, this, [[1, 16]]);
2457
+ }, _callee25, this, [[1, 16]]);
2689
2458
  }));
2690
- function addProductToOrder(_x17) {
2459
+ function addProductToOrder(_x16) {
2691
2460
  return _addProductToOrder.apply(this, arguments);
2692
2461
  }
2693
2462
  return addProductToOrder;
@@ -2695,48 +2464,48 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2695
2464
  }, {
2696
2465
  key: "updateOrderProduct",
2697
2466
  value: function () {
2698
- var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(params) {
2467
+ var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(params) {
2699
2468
  var products;
2700
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2701
- while (1) switch (_context27.prev = _context27.next) {
2469
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2470
+ while (1) switch (_context26.prev = _context26.next) {
2702
2471
  case 0:
2703
2472
  this.logMethodStart('updateOrderProduct', {
2704
2473
  product_id: params.product_id,
2705
2474
  product_variant_id: params.product_variant_id
2706
2475
  });
2707
- _context27.prev = 1;
2476
+ _context26.prev = 1;
2708
2477
  if (this.store.order) {
2709
- _context27.next = 4;
2478
+ _context26.next = 4;
2710
2479
  break;
2711
2480
  }
2712
2481
  throw new Error('order 模块未初始化');
2713
2482
  case 4:
2714
- _context27.next = 6;
2483
+ _context26.next = 6;
2715
2484
  return this.store.order.updateOrderProduct(params);
2716
2485
  case 6:
2717
- products = _context27.sent;
2718
- _context27.next = 9;
2486
+ products = _context26.sent;
2487
+ _context26.next = 9;
2719
2488
  return this.refreshItemRuleQuantityLimits();
2720
2489
  case 9:
2721
- _context27.next = 11;
2490
+ _context26.next = 11;
2722
2491
  return this.refreshCartValidationPassed();
2723
2492
  case 11:
2724
2493
  this.logMethodSuccess('updateOrderProduct', {
2725
2494
  productCount: products.length
2726
2495
  });
2727
- return _context27.abrupt("return", products);
2496
+ return _context26.abrupt("return", products);
2728
2497
  case 15:
2729
- _context27.prev = 15;
2730
- _context27.t0 = _context27["catch"](1);
2731
- this.logMethodError('updateOrderProduct', _context27.t0);
2732
- throw _context27.t0;
2498
+ _context26.prev = 15;
2499
+ _context26.t0 = _context26["catch"](1);
2500
+ this.logMethodError('updateOrderProduct', _context26.t0);
2501
+ throw _context26.t0;
2733
2502
  case 19:
2734
2503
  case "end":
2735
- return _context27.stop();
2504
+ return _context26.stop();
2736
2505
  }
2737
- }, _callee27, this, [[1, 15]]);
2506
+ }, _callee26, this, [[1, 15]]);
2738
2507
  }));
2739
- function updateOrderProduct(_x18) {
2508
+ function updateOrderProduct(_x17) {
2740
2509
  return _updateOrderProduct.apply(this, arguments);
2741
2510
  }
2742
2511
  return updateOrderProduct;
@@ -2744,66 +2513,66 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2744
2513
  }, {
2745
2514
  key: "removeProductFromOrder",
2746
2515
  value: function () {
2747
- var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(identity) {
2748
- var _this$store$order$get3, _this$store$order8, _this$store$order$ens, _this$store$order9, _tempOrder$bookings, tempOrder, products, _tempOrder$bookings2, _tempOrder$bookings3, venueProductUids, venueBookingUids, _iterator16, _step16, _product$metadata7, _product$metadata8, product, beforeBookingCount, _this$store$order$per, _this$store$order10;
2749
- return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2750
- while (1) switch (_context28.prev = _context28.next) {
2516
+ var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(identity) {
2517
+ var _this$store$order$get3, _this$store$order6, _this$store$order$ens, _this$store$order7, _tempOrder$bookings, tempOrder, products, _tempOrder$bookings2, _tempOrder$bookings3, venueProductUids, venueBookingUids, _iterator15, _step15, _product$metadata6, _product$metadata7, product, beforeBookingCount, _this$store$order$per, _this$store$order8;
2518
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2519
+ while (1) switch (_context27.prev = _context27.next) {
2751
2520
  case 0:
2752
2521
  this.logMethodStart('removeProductFromOrder', {
2753
2522
  product_id: identity.product_id,
2754
2523
  product_variant_id: identity.product_variant_id
2755
2524
  });
2756
- _context28.prev = 1;
2525
+ _context27.prev = 1;
2757
2526
  if (this.store.order) {
2758
- _context28.next = 4;
2527
+ _context27.next = 4;
2759
2528
  break;
2760
2529
  }
2761
2530
  throw new Error('order 模块未初始化');
2762
2531
  case 4:
2763
- tempOrder = ((_this$store$order$get3 = (_this$store$order8 = this.store.order).getTempOrder) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.call(_this$store$order8)) || ((_this$store$order$ens = (_this$store$order9 = this.store.order).ensureTempOrder) === null || _this$store$order$ens === void 0 ? void 0 : _this$store$order$ens.call(_this$store$order9));
2764
- _context28.next = 7;
2532
+ tempOrder = ((_this$store$order$get3 = (_this$store$order6 = this.store.order).getTempOrder) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.call(_this$store$order6)) || ((_this$store$order$ens = (_this$store$order7 = this.store.order).ensureTempOrder) === null || _this$store$order$ens === void 0 ? void 0 : _this$store$order$ens.call(_this$store$order7));
2533
+ _context27.next = 7;
2765
2534
  return this.store.order.removeProductFromOrder(identity);
2766
2535
  case 7:
2767
- products = _context28.sent;
2536
+ products = _context27.sent;
2768
2537
  if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$bookings = tempOrder.bookings) !== null && _tempOrder$bookings !== void 0 && _tempOrder$bookings.length)) {
2769
- _context28.next = 33;
2538
+ _context27.next = 33;
2770
2539
  break;
2771
2540
  }
2772
2541
  venueProductUids = new Set();
2773
2542
  venueBookingUids = new Set();
2774
- _iterator16 = _createForOfIteratorHelper(tempOrder.products || []);
2775
- _context28.prev = 12;
2776
- _iterator16.s();
2543
+ _iterator15 = _createForOfIteratorHelper(tempOrder.products || []);
2544
+ _context27.prev = 12;
2545
+ _iterator15.s();
2777
2546
  case 14:
2778
- if ((_step16 = _iterator16.n()).done) {
2779
- _context28.next = 22;
2547
+ if ((_step15 = _iterator15.n()).done) {
2548
+ _context27.next = 22;
2780
2549
  break;
2781
2550
  }
2782
- product = _step16.value;
2783
- if (product !== null && product !== void 0 && (_product$metadata7 = product.metadata) !== null && _product$metadata7 !== void 0 && _product$metadata7.venue_booking) {
2784
- _context28.next = 18;
2551
+ product = _step15.value;
2552
+ if (product !== null && product !== void 0 && (_product$metadata6 = product.metadata) !== null && _product$metadata6 !== void 0 && _product$metadata6.venue_booking) {
2553
+ _context27.next = 18;
2785
2554
  break;
2786
2555
  }
2787
- return _context28.abrupt("continue", 20);
2556
+ return _context27.abrupt("continue", 20);
2788
2557
  case 18:
2789
2558
  if (product.identity_key) venueProductUids.add(String(product.identity_key));
2790
- if ((_product$metadata8 = product.metadata) !== null && _product$metadata8 !== void 0 && _product$metadata8.booking_uid) {
2559
+ if ((_product$metadata7 = product.metadata) !== null && _product$metadata7 !== void 0 && _product$metadata7.booking_uid) {
2791
2560
  venueBookingUids.add(String(product.metadata.booking_uid));
2792
2561
  }
2793
2562
  case 20:
2794
- _context28.next = 14;
2563
+ _context27.next = 14;
2795
2564
  break;
2796
2565
  case 22:
2797
- _context28.next = 27;
2566
+ _context27.next = 27;
2798
2567
  break;
2799
2568
  case 24:
2800
- _context28.prev = 24;
2801
- _context28.t0 = _context28["catch"](12);
2802
- _iterator16.e(_context28.t0);
2569
+ _context27.prev = 24;
2570
+ _context27.t0 = _context27["catch"](12);
2571
+ _iterator15.e(_context27.t0);
2803
2572
  case 27:
2804
- _context28.prev = 27;
2805
- _iterator16.f();
2806
- return _context28.finish(27);
2573
+ _context27.prev = 27;
2574
+ _iterator15.f();
2575
+ return _context27.finish(27);
2807
2576
  case 30:
2808
2577
  beforeBookingCount = ((_tempOrder$bookings2 = tempOrder.bookings) === null || _tempOrder$bookings2 === void 0 ? void 0 : _tempOrder$bookings2.length) || 0;
2809
2578
  tempOrder.bookings = (tempOrder.bookings || []).filter(function (booking) {
@@ -2817,31 +2586,31 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2817
2586
  return true;
2818
2587
  });
2819
2588
  if ((((_tempOrder$bookings3 = tempOrder.bookings) === null || _tempOrder$bookings3 === void 0 ? void 0 : _tempOrder$bookings3.length) || 0) !== beforeBookingCount) {
2820
- (_this$store$order$per = (_this$store$order10 = this.store.order).persistTempOrder) === null || _this$store$order$per === void 0 || _this$store$order$per.call(_this$store$order10);
2589
+ (_this$store$order$per = (_this$store$order8 = this.store.order).persistTempOrder) === null || _this$store$order$per === void 0 || _this$store$order$per.call(_this$store$order8);
2821
2590
  }
2822
2591
  case 33:
2823
- _context28.next = 35;
2592
+ _context27.next = 35;
2824
2593
  return this.refreshItemRuleQuantityLimits();
2825
2594
  case 35:
2826
- _context28.next = 37;
2595
+ _context27.next = 37;
2827
2596
  return this.refreshCartValidationPassed();
2828
2597
  case 37:
2829
2598
  this.logMethodSuccess('removeProductFromOrder', {
2830
2599
  productCount: products.length
2831
2600
  });
2832
- return _context28.abrupt("return", products);
2601
+ return _context27.abrupt("return", products);
2833
2602
  case 41:
2834
- _context28.prev = 41;
2835
- _context28.t1 = _context28["catch"](1);
2836
- this.logMethodError('removeProductFromOrder', _context28.t1);
2837
- throw _context28.t1;
2603
+ _context27.prev = 41;
2604
+ _context27.t1 = _context27["catch"](1);
2605
+ this.logMethodError('removeProductFromOrder', _context27.t1);
2606
+ throw _context27.t1;
2838
2607
  case 45:
2839
2608
  case "end":
2840
- return _context28.stop();
2609
+ return _context27.stop();
2841
2610
  }
2842
- }, _callee28, this, [[1, 41], [12, 24, 27, 30]]);
2611
+ }, _callee27, this, [[1, 41], [12, 24, 27, 30]]);
2843
2612
  }));
2844
- function removeProductFromOrder(_x19) {
2613
+ function removeProductFromOrder(_x18) {
2845
2614
  return _removeProductFromOrder.apply(this, arguments);
2846
2615
  }
2847
2616
  return removeProductFromOrder;
@@ -2849,27 +2618,27 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2849
2618
  }, {
2850
2619
  key: "getProductList",
2851
2620
  value: function () {
2852
- var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
2621
+ var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
2853
2622
  var result;
2854
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2855
- while (1) switch (_context29.prev = _context29.next) {
2623
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2624
+ while (1) switch (_context28.prev = _context28.next) {
2856
2625
  case 0:
2857
2626
  if (!this.productsLoaded) {
2858
- _context29.next = 2;
2627
+ _context28.next = 2;
2859
2628
  break;
2860
2629
  }
2861
- return _context29.abrupt("return", attachItemRuleLimitsToTopLevelProducts(this.getAddonProductsList(), this.store.itemRuleQuantityLimits || []));
2630
+ return _context28.abrupt("return", attachItemRuleLimitsToTopLevelProducts(this.getAddonProductsList(), this.store.itemRuleQuantityLimits || []));
2862
2631
  case 2:
2863
- _context29.next = 4;
2632
+ _context28.next = 4;
2864
2633
  return this.loadAllProducts();
2865
2634
  case 4:
2866
- result = _context29.sent;
2867
- return _context29.abrupt("return", attachItemRuleLimitsToTopLevelProducts(result.addonProducts, this.store.itemRuleQuantityLimits || []));
2635
+ result = _context28.sent;
2636
+ return _context28.abrupt("return", attachItemRuleLimitsToTopLevelProducts(result.addonProducts, this.store.itemRuleQuantityLimits || []));
2868
2637
  case 6:
2869
2638
  case "end":
2870
- return _context29.stop();
2639
+ return _context28.stop();
2871
2640
  }
2872
- }, _callee29, this);
2641
+ }, _callee28, this);
2873
2642
  }));
2874
2643
  function getProductList() {
2875
2644
  return _getProductList.apply(this, arguments);
@@ -2879,13 +2648,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2879
2648
  }, {
2880
2649
  key: "loadOpenDataConfig",
2881
2650
  value: function () {
2882
- var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
2651
+ var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
2883
2652
  var lastFetchedAt, cachedData, openDataConfig;
2884
- return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2885
- while (1) switch (_context30.prev = _context30.next) {
2653
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2654
+ while (1) switch (_context29.prev = _context29.next) {
2886
2655
  case 0:
2887
2656
  if (this.store.openData) {
2888
- _context30.next = 2;
2657
+ _context29.next = 2;
2889
2658
  break;
2890
2659
  }
2891
2660
  throw new Error('openData 模块未初始化');
@@ -2893,42 +2662,42 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2893
2662
  lastFetchedAt = this.store.openData.getLastFetchedAt();
2894
2663
  cachedData = this.store.openData.getOpenData();
2895
2664
  if (!(cachedData && lastFetchedAt && Date.now() - lastFetchedAt < VenueBookingImpl.OPEN_DATA_CACHE_TTL)) {
2896
- _context30.next = 7;
2665
+ _context29.next = 7;
2897
2666
  break;
2898
2667
  }
2899
2668
  this.otherParams.openData = cachedData;
2900
- return _context30.abrupt("return", cachedData);
2669
+ return _context29.abrupt("return", cachedData);
2901
2670
  case 7:
2902
2671
  if (!this.loadOpenDataConfigInFlight) {
2903
- _context30.next = 11;
2672
+ _context29.next = 11;
2904
2673
  break;
2905
2674
  }
2906
- _context30.next = 10;
2675
+ _context29.next = 10;
2907
2676
  return this.loadOpenDataConfigInFlight;
2908
2677
  case 10:
2909
- return _context30.abrupt("return", _context30.sent);
2678
+ return _context29.abrupt("return", _context29.sent);
2910
2679
  case 11:
2911
2680
  this.loadOpenDataConfigInFlight = this.store.openData.fetchOpenData({
2912
2681
  scope: 'board',
2913
2682
  target: 'venue_booking+online_store',
2914
2683
  section_code: [].concat(OPEN_DATA_SECTION_CODES)
2915
2684
  });
2916
- _context30.prev = 12;
2917
- _context30.next = 15;
2685
+ _context29.prev = 12;
2686
+ _context29.next = 15;
2918
2687
  return this.loadOpenDataConfigInFlight;
2919
2688
  case 15:
2920
- openDataConfig = _context30.sent;
2689
+ openDataConfig = _context29.sent;
2921
2690
  this.otherParams.openData = openDataConfig;
2922
- return _context30.abrupt("return", openDataConfig);
2691
+ return _context29.abrupt("return", openDataConfig);
2923
2692
  case 18:
2924
- _context30.prev = 18;
2693
+ _context29.prev = 18;
2925
2694
  this.loadOpenDataConfigInFlight = null;
2926
- return _context30.finish(18);
2695
+ return _context29.finish(18);
2927
2696
  case 21:
2928
2697
  case "end":
2929
- return _context30.stop();
2698
+ return _context29.stop();
2930
2699
  }
2931
- }, _callee30, this, [[12,, 18, 21]]);
2700
+ }, _callee29, this, [[12,, 18, 21]]);
2932
2701
  }));
2933
2702
  function loadOpenDataConfig() {
2934
2703
  return _loadOpenDataConfig.apply(this, arguments);
@@ -2938,29 +2707,29 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2938
2707
  }, {
2939
2708
  key: "loadRuntimeConfigs",
2940
2709
  value: function () {
2941
- var _loadRuntimeConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
2710
+ var _loadRuntimeConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
2942
2711
  var itemRuleConfigs;
2943
- return _regeneratorRuntime().wrap(function _callee31$(_context31) {
2944
- while (1) switch (_context31.prev = _context31.next) {
2712
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2713
+ while (1) switch (_context30.prev = _context30.next) {
2945
2714
  case 0:
2946
- _context31.next = 2;
2715
+ _context30.next = 2;
2947
2716
  return this.loadOpenDataConfig();
2948
2717
  case 2:
2949
- _context31.next = 4;
2718
+ _context30.next = 4;
2950
2719
  return this.ensureItemRuleConfigsLoaded();
2951
2720
  case 4:
2952
- itemRuleConfigs = _context31.sent;
2721
+ itemRuleConfigs = _context30.sent;
2953
2722
  this.logMethodSuccess('loadRuntimeConfigs', {
2954
2723
  itemRuleCount: itemRuleConfigs.length
2955
2724
  });
2956
- return _context31.abrupt("return", {
2725
+ return _context30.abrupt("return", {
2957
2726
  itemRuleConfigs: itemRuleConfigs
2958
2727
  });
2959
2728
  case 7:
2960
2729
  case "end":
2961
- return _context31.stop();
2730
+ return _context30.stop();
2962
2731
  }
2963
- }, _callee31, this);
2732
+ }, _callee30, this);
2964
2733
  }));
2965
2734
  function loadRuntimeConfigs() {
2966
2735
  return _loadRuntimeConfigs.apply(this, arguments);
@@ -2970,22 +2739,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2970
2739
  }, {
2971
2740
  key: "fetchItemRuleConfigsByModelIds",
2972
2741
  value: function () {
2973
- var _fetchItemRuleConfigsByModelIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(strategyModelIds) {
2742
+ var _fetchItemRuleConfigsByModelIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(strategyModelIds) {
2974
2743
  var result, configs;
2975
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2976
- while (1) switch (_context32.prev = _context32.next) {
2744
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
2745
+ while (1) switch (_context31.prev = _context31.next) {
2977
2746
  case 0:
2978
2747
  this.logMethodStart('fetchItemRuleConfigsByModelIds', {
2979
2748
  strategyModelIds: strategyModelIds
2980
2749
  });
2981
2750
  if (strategyModelIds.length) {
2982
- _context32.next = 3;
2751
+ _context31.next = 3;
2983
2752
  break;
2984
2753
  }
2985
- return _context32.abrupt("return", []);
2754
+ return _context31.abrupt("return", []);
2986
2755
  case 3:
2987
- _context32.prev = 3;
2988
- _context32.next = 6;
2756
+ _context31.prev = 3;
2757
+ _context31.next = 6;
2989
2758
  return this.request.get('/promotion', {
2990
2759
  skip: 1,
2991
2760
  num: 99,
@@ -2993,7 +2762,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2993
2762
  ids: strategyModelIds
2994
2763
  });
2995
2764
  case 6:
2996
- result = _context32.sent;
2765
+ result = _context31.sent;
2997
2766
  configs = [];
2998
2767
  if (result.code === 200) {
2999
2768
  configs = result.data.list.map(function (item) {
@@ -3004,21 +2773,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3004
2773
  strategyModelIds: strategyModelIds,
3005
2774
  strategyCount: configs.length
3006
2775
  });
3007
- return _context32.abrupt("return", configs);
2776
+ return _context31.abrupt("return", configs);
3008
2777
  case 13:
3009
- _context32.prev = 13;
3010
- _context32.t0 = _context32["catch"](3);
3011
- this.logMethodError('fetchItemRuleConfigsByModelIds', _context32.t0, {
2778
+ _context31.prev = 13;
2779
+ _context31.t0 = _context31["catch"](3);
2780
+ this.logMethodError('fetchItemRuleConfigsByModelIds', _context31.t0, {
3012
2781
  strategyModelIds: strategyModelIds
3013
2782
  });
3014
- return _context32.abrupt("return", []);
2783
+ return _context31.abrupt("return", []);
3015
2784
  case 17:
3016
2785
  case "end":
3017
- return _context32.stop();
2786
+ return _context31.stop();
3018
2787
  }
3019
- }, _callee32, this, [[3, 13]]);
2788
+ }, _callee31, this, [[3, 13]]);
3020
2789
  }));
3021
- function fetchItemRuleConfigsByModelIds(_x20) {
2790
+ function fetchItemRuleConfigsByModelIds(_x19) {
3022
2791
  return _fetchItemRuleConfigsByModelIds.apply(this, arguments);
3023
2792
  }
3024
2793
  return fetchItemRuleConfigsByModelIds;
@@ -3026,22 +2795,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3026
2795
  }, {
3027
2796
  key: "buildPrefillProductSourceMap",
3028
2797
  value: function () {
3029
- var _buildPrefillProductSourceMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33() {
2798
+ var _buildPrefillProductSourceMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
3030
2799
  var sourceMap, productList, visited, collectFromValue;
3031
- return _regeneratorRuntime().wrap(function _callee33$(_context33) {
3032
- while (1) switch (_context33.prev = _context33.next) {
2800
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2801
+ while (1) switch (_context32.prev = _context32.next) {
3033
2802
  case 0:
3034
2803
  sourceMap = new Map();
3035
- _context33.prev = 1;
3036
- _context33.next = 4;
2804
+ _context32.prev = 1;
2805
+ _context32.next = 4;
3037
2806
  return this.getProductList();
3038
2807
  case 4:
3039
- productList = _context33.sent;
2808
+ productList = _context32.sent;
3040
2809
  if (Array.isArray(productList)) {
3041
- _context33.next = 7;
2810
+ _context32.next = 7;
3042
2811
  break;
3043
2812
  }
3044
- return _context33.abrupt("return", sourceMap);
2813
+ return _context32.abrupt("return", sourceMap);
3045
2814
  case 7:
3046
2815
  visited = new Set();
3047
2816
  collectFromValue = function collectFromValue(value) {
@@ -3050,17 +2819,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3050
2819
  if (visited.has(value)) return;
3051
2820
  visited.add(value);
3052
2821
  if (Array.isArray(value)) {
3053
- var _iterator17 = _createForOfIteratorHelper(value),
3054
- _step17;
2822
+ var _iterator16 = _createForOfIteratorHelper(value),
2823
+ _step16;
3055
2824
  try {
3056
- for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
3057
- var item = _step17.value;
2825
+ for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
2826
+ var item = _step16.value;
3058
2827
  collectFromValue(item);
3059
2828
  }
3060
2829
  } catch (err) {
3061
- _iterator17.e(err);
2830
+ _iterator16.e(err);
3062
2831
  } finally {
3063
- _iterator17.f();
2832
+ _iterator16.f();
3064
2833
  }
3065
2834
  return;
3066
2835
  }
@@ -3068,8 +2837,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3068
2837
  var rawProductId = (_node$product_id = node.product_id) !== null && _node$product_id !== void 0 ? _node$product_id : node.id;
3069
2838
  var productId = Number(rawProductId);
3070
2839
  if (Number.isFinite(productId) && productId > 0) {
3071
- var _ref5, _node$product_variant;
3072
- var productVariantId = Number((_ref5 = (_node$product_variant = node.product_variant_id) !== null && _node$product_variant !== void 0 ? _node$product_variant : node.variant_id) !== null && _ref5 !== void 0 ? _ref5 : 0);
2840
+ var _ref3, _node$product_variant;
2841
+ var productVariantId = Number((_ref3 = (_node$product_variant = node.product_variant_id) !== null && _node$product_variant !== void 0 ? _node$product_variant : node.variant_id) !== null && _ref3 !== void 0 ? _ref3 : 0);
3073
2842
  var normalizedVariantId = Number.isNaN(productVariantId) ? 0 : productVariantId;
3074
2843
  var key = buildProductKey(productId, normalizedVariantId);
3075
2844
  if (!sourceMap.has(key)) sourceMap.set(key, node);
@@ -3080,19 +2849,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3080
2849
  }
3081
2850
  };
3082
2851
  collectFromValue(productList);
3083
- _context33.next = 15;
2852
+ _context32.next = 15;
3084
2853
  break;
3085
2854
  case 12:
3086
- _context33.prev = 12;
3087
- _context33.t0 = _context33["catch"](1);
3088
- this.logMethodError('buildPrefillProductSourceMap', _context33.t0);
2855
+ _context32.prev = 12;
2856
+ _context32.t0 = _context32["catch"](1);
2857
+ this.logMethodError('buildPrefillProductSourceMap', _context32.t0);
3089
2858
  case 15:
3090
- return _context33.abrupt("return", sourceMap);
2859
+ return _context32.abrupt("return", sourceMap);
3091
2860
  case 16:
3092
2861
  case "end":
3093
- return _context33.stop();
2862
+ return _context32.stop();
3094
2863
  }
3095
- }, _callee33, this, [[1, 12]]);
2864
+ }, _callee32, this, [[1, 12]]);
3096
2865
  }));
3097
2866
  function buildPrefillProductSourceMap() {
3098
2867
  return _buildPrefillProductSourceMap.apply(this, arguments);
@@ -3107,56 +2876,56 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3107
2876
  }, {
3108
2877
  key: "ensureItemRuleConfigsLoaded",
3109
2878
  value: function () {
3110
- var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
2879
+ var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
3111
2880
  var _this11 = this;
3112
- return _regeneratorRuntime().wrap(function _callee35$(_context35) {
3113
- while (1) switch (_context35.prev = _context35.next) {
2881
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
2882
+ while (1) switch (_context34.prev = _context34.next) {
3114
2883
  case 0:
3115
2884
  if (!(this.itemRuleConfigs.length > 0)) {
3116
- _context35.next = 2;
2885
+ _context34.next = 2;
3117
2886
  break;
3118
2887
  }
3119
- return _context35.abrupt("return", this.itemRuleConfigs);
2888
+ return _context34.abrupt("return", this.itemRuleConfigs);
3120
2889
  case 2:
3121
2890
  if (!this.itemRuleConfigsPromise) {
3122
- _context35.next = 4;
2891
+ _context34.next = 4;
3123
2892
  break;
3124
2893
  }
3125
- return _context35.abrupt("return", this.itemRuleConfigsPromise);
2894
+ return _context34.abrupt("return", this.itemRuleConfigsPromise);
3126
2895
  case 4:
3127
- this.itemRuleConfigsPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
2896
+ this.itemRuleConfigsPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33() {
3128
2897
  var runtimeConfig, staticConfigs;
3129
- return _regeneratorRuntime().wrap(function _callee34$(_context34) {
3130
- while (1) switch (_context34.prev = _context34.next) {
2898
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
2899
+ while (1) switch (_context33.prev = _context33.next) {
3131
2900
  case 0:
3132
2901
  runtimeConfig = _this11.getItemRuleRuntimeConfig();
3133
2902
  staticConfigs = normalizeItemRuleStrategies(runtimeConfig.strategyConfigs);
3134
2903
  if (!(staticConfigs.length > 0)) {
3135
- _context34.next = 6;
2904
+ _context33.next = 6;
3136
2905
  break;
3137
2906
  }
3138
2907
  _this11.itemRuleConfigs = staticConfigs;
3139
2908
  _this11.itemRuleEvaluator.setStrategyConfigs(staticConfigs);
3140
- return _context34.abrupt("return", _this11.itemRuleConfigs);
2909
+ return _context33.abrupt("return", _this11.itemRuleConfigs);
3141
2910
  case 6:
3142
2911
  _this11.itemRuleConfigs = [];
3143
2912
  _this11.itemRuleEvaluator.setStrategyConfigs([]);
3144
- return _context34.abrupt("return", _this11.itemRuleConfigs);
2913
+ return _context33.abrupt("return", _this11.itemRuleConfigs);
3145
2914
  case 9:
3146
2915
  case "end":
3147
- return _context34.stop();
2916
+ return _context33.stop();
3148
2917
  }
3149
- }, _callee34);
2918
+ }, _callee33);
3150
2919
  }))();
3151
- _context35.next = 7;
2920
+ _context34.next = 7;
3152
2921
  return this.itemRuleConfigsPromise;
3153
2922
  case 7:
3154
- return _context35.abrupt("return", _context35.sent);
2923
+ return _context34.abrupt("return", _context34.sent);
3155
2924
  case 8:
3156
2925
  case "end":
3157
- return _context35.stop();
2926
+ return _context34.stop();
3158
2927
  }
3159
- }, _callee35, this);
2928
+ }, _callee34, this);
3160
2929
  }));
3161
2930
  function ensureItemRuleConfigsLoaded() {
3162
2931
  return _ensureItemRuleConfigsLoaded.apply(this, arguments);
@@ -3166,25 +2935,25 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3166
2935
  }, {
3167
2936
  key: "refreshItemRuleQuantityLimits",
3168
2937
  value: function () {
3169
- var _refreshItemRuleQuantityLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
2938
+ var _refreshItemRuleQuantityLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
3170
2939
  var strategyConfigs, businessData, limits;
3171
- return _regeneratorRuntime().wrap(function _callee36$(_context36) {
3172
- while (1) switch (_context36.prev = _context36.next) {
2940
+ return _regeneratorRuntime().wrap(function _callee35$(_context35) {
2941
+ while (1) switch (_context35.prev = _context35.next) {
3173
2942
  case 0:
3174
- _context36.prev = 0;
3175
- _context36.next = 3;
2943
+ _context35.prev = 0;
2944
+ _context35.next = 3;
3176
2945
  return this.ensureItemRuleConfigsLoaded();
3177
2946
  case 3:
3178
- strategyConfigs = _context36.sent;
2947
+ strategyConfigs = _context35.sent;
3179
2948
  if (strategyConfigs.length) {
3180
- _context36.next = 7;
2949
+ _context35.next = 7;
3181
2950
  break;
3182
2951
  }
3183
2952
  this.store.itemRuleQuantityLimits = [];
3184
- return _context36.abrupt("return", []);
2953
+ return _context35.abrupt("return", []);
3185
2954
  case 7:
3186
2955
  businessData = buildItemRuleBusinessData({
3187
- tempOrder: this.ensureVenueTempOrder(),
2956
+ tempOrder: this.ensureTempOrder(),
3188
2957
  runtimeConfig: this.getItemRuleRuntimeConfig(),
3189
2958
  itemRuleConfigs: this.itemRuleConfigs
3190
2959
  });
@@ -3193,18 +2962,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3193
2962
  this.logMethodSuccess('refreshItemRuleQuantityLimits', {
3194
2963
  limitCount: limits.length
3195
2964
  });
3196
- return _context36.abrupt("return", limits);
2965
+ return _context35.abrupt("return", limits);
3197
2966
  case 14:
3198
- _context36.prev = 14;
3199
- _context36.t0 = _context36["catch"](0);
2967
+ _context35.prev = 14;
2968
+ _context35.t0 = _context35["catch"](0);
3200
2969
  this.store.itemRuleQuantityLimits = [];
3201
- this.logMethodError('refreshItemRuleQuantityLimits', _context36.t0);
3202
- return _context36.abrupt("return", []);
2970
+ this.logMethodError('refreshItemRuleQuantityLimits', _context35.t0);
2971
+ return _context35.abrupt("return", []);
3203
2972
  case 19:
3204
2973
  case "end":
3205
- return _context36.stop();
2974
+ return _context35.stop();
3206
2975
  }
3207
- }, _callee36, this, [[0, 14]]);
2976
+ }, _callee35, this, [[0, 14]]);
3208
2977
  }));
3209
2978
  function refreshItemRuleQuantityLimits() {
3210
2979
  return _refreshItemRuleQuantityLimits.apply(this, arguments);
@@ -3214,75 +2983,75 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3214
2983
  }, {
3215
2984
  key: "applyPrefillByItemRule",
3216
2985
  value: function () {
3217
- var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37() {
3218
- var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges, _iterator18, _step18, _prefillItem$product_, prefillItem, productId, productVariantId, targetQuantity, sourceItem, productIndex, _sourceItem$price, _product$metadata9, sellingPrice, origin, product, productUid, targetProduct, previousOrigin, nextOrigin, existedQuantity, delta, nextProduct, _nextProduct$metadata, _productUid;
3219
- return _regeneratorRuntime().wrap(function _callee37$(_context37) {
3220
- while (1) switch (_context37.prev = _context37.next) {
2986
+ var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
2987
+ var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges, _iterator17, _step17, _prefillItem$product_, _origin2, prefillItem, productId, productVariantId, targetQuantity, sourceItem, productIndex, _sourceItem$price, sellingPrice, targetProduct, existedQuantity, delta, nextProduct;
2988
+ return _regeneratorRuntime().wrap(function _callee36$(_context36) {
2989
+ while (1) switch (_context36.prev = _context36.next) {
3221
2990
  case 0:
3222
2991
  if (!this.itemRulePrefillApplied) {
3223
- _context37.next = 2;
2992
+ _context36.next = 2;
3224
2993
  break;
3225
2994
  }
3226
- return _context37.abrupt("return");
2995
+ return _context36.abrupt("return");
3227
2996
  case 2:
3228
2997
  if (this.store.order) {
3229
- _context37.next = 4;
2998
+ _context36.next = 4;
3230
2999
  break;
3231
3000
  }
3232
- return _context37.abrupt("return");
3001
+ return _context36.abrupt("return");
3233
3002
  case 4:
3234
- _context37.next = 6;
3003
+ _context36.next = 6;
3235
3004
  return this.ensureItemRuleConfigsLoaded();
3236
3005
  case 6:
3237
- strategyConfigs = _context37.sent;
3006
+ strategyConfigs = _context36.sent;
3238
3007
  if (strategyConfigs.length) {
3239
- _context37.next = 9;
3008
+ _context36.next = 9;
3240
3009
  break;
3241
3010
  }
3242
- return _context37.abrupt("return");
3011
+ return _context36.abrupt("return");
3243
3012
  case 9:
3244
3013
  businessData = buildItemRuleBusinessData({
3245
- tempOrder: this.ensureVenueTempOrder(),
3014
+ tempOrder: this.ensureTempOrder(),
3246
3015
  runtimeConfig: this.getItemRuleRuntimeConfig(),
3247
3016
  itemRuleConfigs: this.itemRuleConfigs
3248
3017
  });
3249
3018
  prefillItems = this.itemRuleEvaluator.getPrefillItems(businessData);
3250
3019
  if (prefillItems.length) {
3251
- _context37.next = 14;
3020
+ _context36.next = 14;
3252
3021
  break;
3253
3022
  }
3254
3023
  this.itemRulePrefillApplied = true;
3255
- return _context37.abrupt("return");
3024
+ return _context36.abrupt("return");
3256
3025
  case 14:
3257
- _context37.next = 16;
3026
+ _context36.next = 16;
3258
3027
  return this.buildPrefillProductSourceMap();
3259
3028
  case 16:
3260
- productSourceMap = _context37.sent;
3261
- tempOrder = this.ensureVenueTempOrder();
3029
+ productSourceMap = _context36.sent;
3030
+ tempOrder = this.ensureTempOrder();
3262
3031
  hasChanges = false;
3263
- _iterator18 = _createForOfIteratorHelper(prefillItems);
3264
- _context37.prev = 20;
3265
- _iterator18.s();
3032
+ _iterator17 = _createForOfIteratorHelper(prefillItems);
3033
+ _context36.prev = 20;
3034
+ _iterator17.s();
3266
3035
  case 22:
3267
- if ((_step18 = _iterator18.n()).done) {
3268
- _context37.next = 51;
3036
+ if ((_step17 = _iterator17.n()).done) {
3037
+ _context36.next = 45;
3269
3038
  break;
3270
3039
  }
3271
- prefillItem = _step18.value;
3040
+ prefillItem = _step17.value;
3272
3041
  productId = Number(prefillItem.product_id);
3273
3042
  productVariantId = Number((_prefillItem$product_ = prefillItem.product_variant_id) !== null && _prefillItem$product_ !== void 0 ? _prefillItem$product_ : 0);
3274
3043
  targetQuantity = toNonNegativeInt(prefillItem.quantity);
3275
3044
  if (!(!Number.isFinite(productId) || targetQuantity <= 0)) {
3276
- _context37.next = 29;
3045
+ _context36.next = 29;
3277
3046
  break;
3278
3047
  }
3279
- return _context37.abrupt("continue", 49);
3048
+ return _context36.abrupt("continue", 43);
3280
3049
  case 29:
3281
3050
  if (!Number.isNaN(productVariantId)) {
3282
- _context37.next = 31;
3051
+ _context36.next = 31;
3283
3052
  break;
3284
3053
  }
3285
- return _context37.abrupt("continue", 49);
3054
+ return _context36.abrupt("continue", 43);
3286
3055
  case 31:
3287
3056
  sourceItem = productSourceMap.get(buildProductKey(productId, productVariantId)) || productSourceMap.get(buildProductKey(productId, 0)) || null;
3288
3057
  productIndex = getProductIdentityIndex(tempOrder.products, {
@@ -3290,15 +3059,11 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3290
3059
  product_variant_id: productVariantId
3291
3060
  });
3292
3061
  if (!(productIndex === -1)) {
3293
- _context37.next = 42;
3062
+ _context36.next = 38;
3294
3063
  break;
3295
3064
  }
3296
3065
  sellingPrice = toPriceString((_sourceItem$price = sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price) !== null && _sourceItem$price !== void 0 ? _sourceItem$price : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.selling_price, '0.00');
3297
- origin = _objectSpread(_objectSpread({}, sourceItem || {}), {}, {
3298
- item_rule_prefill: true,
3299
- item_rule_id: prefillItem.ruleId
3300
- });
3301
- product = normalizeOrderProduct({
3066
+ tempOrder.products.push(normalizeOrderProduct({
3302
3067
  product_id: productId,
3303
3068
  product_variant_id: productVariantId,
3304
3069
  num: targetQuantity,
@@ -3308,17 +3073,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3308
3073
  item_rule_prefill: true,
3309
3074
  item_rule_id: prefillItem.ruleId
3310
3075
  },
3311
- _origin: origin
3312
- });
3313
- productUid = String(((_product$metadata9 = product.metadata) === null || _product$metadata9 === void 0 ? void 0 : _product$metadata9.unique_identification_number) || '');
3314
- this.attachProductOriginToTempOrder(tempOrder, productUid, origin);
3315
- tempOrder.products.push(product);
3076
+ _origin: _objectSpread(_objectSpread({}, sourceItem || {}), {}, {
3077
+ item_rule_prefill: true,
3078
+ item_rule_id: prefillItem.ruleId
3079
+ })
3080
+ }));
3316
3081
  hasChanges = true;
3317
- return _context37.abrupt("continue", 49);
3318
- case 42:
3082
+ return _context36.abrupt("continue", 43);
3083
+ case 38:
3319
3084
  targetProduct = tempOrder.products[productIndex];
3320
- previousOrigin = this.readProductOriginFromTempOrder(tempOrder, targetProduct);
3321
- nextOrigin = sourceItem ? _objectSpread(_objectSpread({}, previousOrigin || {}), sourceItem) : previousOrigin;
3322
3085
  existedQuantity = toNonNegativeInt(targetProduct.num);
3323
3086
  delta = targetQuantity - existedQuantity;
3324
3087
  nextProduct = _objectSpread(_objectSpread(_objectSpread({}, targetProduct), delta > 0 ? {
@@ -3327,55 +3090,54 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3327
3090
  metadata: _objectSpread(_objectSpread({}, targetProduct.metadata || {}), {}, {
3328
3091
  item_rule_prefill: true,
3329
3092
  item_rule_id: prefillItem.ruleId
3330
- })
3093
+ }),
3094
+ _origin: sourceItem ? _objectSpread(_objectSpread({}, targetProduct._origin || {}), sourceItem) : targetProduct._origin
3331
3095
  });
3332
- if (delta > 0 || Boolean(sourceItem && (!previousOrigin || (previousOrigin === null || previousOrigin === void 0 ? void 0 : previousOrigin.price) !== (sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price)))) {
3333
- _productUid = String(((_nextProduct$metadata = nextProduct.metadata) === null || _nextProduct$metadata === void 0 ? void 0 : _nextProduct$metadata.unique_identification_number) || '');
3334
- this.attachProductOriginToTempOrder(tempOrder, _productUid, nextOrigin);
3096
+ if (delta > 0 || Boolean(sourceItem && (!targetProduct._origin || ((_origin2 = targetProduct._origin) === null || _origin2 === void 0 ? void 0 : _origin2.price) !== (sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price)))) {
3335
3097
  tempOrder.products[productIndex] = nextProduct;
3336
3098
  hasChanges = true;
3337
3099
  }
3338
- case 49:
3339
- _context37.next = 22;
3100
+ case 43:
3101
+ _context36.next = 22;
3340
3102
  break;
3341
- case 51:
3342
- _context37.next = 56;
3103
+ case 45:
3104
+ _context36.next = 50;
3343
3105
  break;
3106
+ case 47:
3107
+ _context36.prev = 47;
3108
+ _context36.t0 = _context36["catch"](20);
3109
+ _iterator17.e(_context36.t0);
3110
+ case 50:
3111
+ _context36.prev = 50;
3112
+ _iterator17.f();
3113
+ return _context36.finish(50);
3344
3114
  case 53:
3345
- _context37.prev = 53;
3346
- _context37.t0 = _context37["catch"](20);
3347
- _iterator18.e(_context37.t0);
3348
- case 56:
3349
- _context37.prev = 56;
3350
- _iterator18.f();
3351
- return _context37.finish(56);
3352
- case 59:
3353
3115
  if (!hasChanges) {
3354
- _context37.next = 64;
3116
+ _context36.next = 58;
3355
3117
  break;
3356
3118
  }
3357
3119
  // Prefill 属于 products CRUD 的一种形式:新增后让 Rules 重算,以支持自动应用可用优惠券。
3358
3120
  this.store.order.applyDiscount();
3359
- _context37.next = 63;
3121
+ _context36.next = 57;
3360
3122
  return this.store.order.recalculateSummary({
3361
3123
  createIfMissing: true
3362
3124
  });
3363
- case 63:
3125
+ case 57:
3364
3126
  this.store.order.persistTempOrder();
3365
- case 64:
3366
- _context37.next = 66;
3127
+ case 58:
3128
+ _context36.next = 60;
3367
3129
  return this.refreshItemRuleQuantityLimits();
3368
- case 66:
3130
+ case 60:
3369
3131
  this.itemRulePrefillApplied = true;
3370
3132
  this.logMethodSuccess('applyPrefillByItemRule', {
3371
3133
  prefillCount: prefillItems.length,
3372
3134
  hasChanges: hasChanges
3373
3135
  });
3374
- case 68:
3136
+ case 62:
3375
3137
  case "end":
3376
- return _context37.stop();
3138
+ return _context36.stop();
3377
3139
  }
3378
- }, _callee37, this, [[20, 53, 56, 59]]);
3140
+ }, _callee36, this, [[20, 47, 50, 53]]);
3379
3141
  }));
3380
3142
  function applyPrefillByItemRule() {
3381
3143
  return _applyPrefillByItemRule.apply(this, arguments);
@@ -3385,24 +3147,24 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3385
3147
  }, {
3386
3148
  key: "applyItemRulePrefill",
3387
3149
  value: function () {
3388
- var _applyItemRulePrefill = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38() {
3389
- return _regeneratorRuntime().wrap(function _callee38$(_context38) {
3390
- while (1) switch (_context38.prev = _context38.next) {
3150
+ var _applyItemRulePrefill = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37() {
3151
+ return _regeneratorRuntime().wrap(function _callee37$(_context37) {
3152
+ while (1) switch (_context37.prev = _context37.next) {
3391
3153
  case 0:
3392
3154
  this.logMethodStart('applyItemRulePrefill');
3393
- _context38.next = 3;
3155
+ _context37.next = 3;
3394
3156
  return this.applyPrefillByItemRule();
3395
3157
  case 3:
3396
- _context38.next = 5;
3158
+ _context37.next = 5;
3397
3159
  return this.refreshItemRuleQuantityLimits();
3398
3160
  case 5:
3399
- _context38.next = 7;
3161
+ _context37.next = 7;
3400
3162
  return this.refreshCartValidationPassed();
3401
3163
  case 7:
3402
3164
  case "end":
3403
- return _context38.stop();
3165
+ return _context37.stop();
3404
3166
  }
3405
- }, _callee38, this);
3167
+ }, _callee37, this);
3406
3168
  }));
3407
3169
  function applyItemRulePrefill() {
3408
3170
  return _applyItemRulePrefill.apply(this, arguments);
@@ -3412,35 +3174,35 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3412
3174
  }, {
3413
3175
  key: "evaluateCartValidationByItemRule",
3414
3176
  value: function () {
3415
- var _evaluateCartValidationByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
3177
+ var _evaluateCartValidationByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38() {
3416
3178
  var strategyConfigs, businessData;
3417
- return _regeneratorRuntime().wrap(function _callee39$(_context39) {
3418
- while (1) switch (_context39.prev = _context39.next) {
3179
+ return _regeneratorRuntime().wrap(function _callee38$(_context38) {
3180
+ while (1) switch (_context38.prev = _context38.next) {
3419
3181
  case 0:
3420
- _context39.next = 2;
3182
+ _context38.next = 2;
3421
3183
  return this.ensureItemRuleConfigsLoaded();
3422
3184
  case 2:
3423
- strategyConfigs = _context39.sent;
3185
+ strategyConfigs = _context38.sent;
3424
3186
  if (strategyConfigs.length) {
3425
- _context39.next = 5;
3187
+ _context38.next = 5;
3426
3188
  break;
3427
3189
  }
3428
- return _context39.abrupt("return", {
3190
+ return _context38.abrupt("return", {
3429
3191
  passed: true,
3430
3192
  failures: []
3431
3193
  });
3432
3194
  case 5:
3433
3195
  businessData = buildItemRuleBusinessData({
3434
- tempOrder: this.ensureVenueTempOrder(),
3196
+ tempOrder: this.ensureTempOrder(),
3435
3197
  runtimeConfig: this.getItemRuleRuntimeConfig(),
3436
3198
  itemRuleConfigs: this.itemRuleConfigs
3437
3199
  });
3438
- return _context39.abrupt("return", this.itemRuleEvaluator.validateCart(businessData));
3200
+ return _context38.abrupt("return", this.itemRuleEvaluator.validateCart(businessData));
3439
3201
  case 7:
3440
3202
  case "end":
3441
- return _context39.stop();
3203
+ return _context38.stop();
3442
3204
  }
3443
- }, _callee39, this);
3205
+ }, _callee38, this);
3444
3206
  }));
3445
3207
  function evaluateCartValidationByItemRule() {
3446
3208
  return _evaluateCartValidationByItemRule.apply(this, arguments);
@@ -3450,20 +3212,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3450
3212
  }, {
3451
3213
  key: "validateBeforeSubmitByItemRule",
3452
3214
  value: function () {
3453
- var _validateBeforeSubmitByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
3215
+ var _validateBeforeSubmitByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
3454
3216
  var validationResult, firstFailure, errorMessage, error;
3455
- return _regeneratorRuntime().wrap(function _callee40$(_context40) {
3456
- while (1) switch (_context40.prev = _context40.next) {
3217
+ return _regeneratorRuntime().wrap(function _callee39$(_context39) {
3218
+ while (1) switch (_context39.prev = _context39.next) {
3457
3219
  case 0:
3458
- _context40.next = 2;
3220
+ _context39.next = 2;
3459
3221
  return this.evaluateCartValidationByItemRule();
3460
3222
  case 2:
3461
- validationResult = _context40.sent;
3223
+ validationResult = _context39.sent;
3462
3224
  if (!validationResult.passed) {
3463
- _context40.next = 5;
3225
+ _context39.next = 5;
3464
3226
  break;
3465
3227
  }
3466
- return _context40.abrupt("return");
3228
+ return _context39.abrupt("return");
3467
3229
  case 5:
3468
3230
  firstFailure = validationResult.failures[0];
3469
3231
  errorMessage = (firstFailure === null || firstFailure === void 0 ? void 0 : firstFailure.validationMessage) || '当前购物车未满足商品规则,请调整后再提交';
@@ -3472,9 +3234,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3472
3234
  throw error;
3473
3235
  case 10:
3474
3236
  case "end":
3475
- return _context40.stop();
3237
+ return _context39.stop();
3476
3238
  }
3477
- }, _callee40, this);
3239
+ }, _callee39, this);
3478
3240
  }));
3479
3241
  function validateBeforeSubmitByItemRule() {
3480
3242
  return _validateBeforeSubmitByItemRule.apply(this, arguments);
@@ -3484,10 +3246,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3484
3246
  }, {
3485
3247
  key: "refreshCartValidationPassed",
3486
3248
  value: function () {
3487
- var _refreshCartValidationPassed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41() {
3249
+ var _refreshCartValidationPassed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
3488
3250
  var previous, nextState, validationResult, changed;
3489
- return _regeneratorRuntime().wrap(function _callee41$(_context41) {
3490
- while (1) switch (_context41.prev = _context41.next) {
3251
+ return _regeneratorRuntime().wrap(function _callee40$(_context40) {
3252
+ while (1) switch (_context40.prev = _context40.next) {
3491
3253
  case 0:
3492
3254
  previous = this.store.cartValidation || {
3493
3255
  passed: null,
@@ -3497,20 +3259,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3497
3259
  passed: null,
3498
3260
  failures: []
3499
3261
  };
3500
- _context41.prev = 2;
3501
- _context41.next = 5;
3262
+ _context40.prev = 2;
3263
+ _context40.next = 5;
3502
3264
  return this.evaluateCartValidationByItemRule();
3503
3265
  case 5:
3504
- validationResult = _context41.sent;
3266
+ validationResult = _context40.sent;
3505
3267
  nextState = {
3506
3268
  passed: validationResult.passed,
3507
3269
  failures: validationResult.failures || []
3508
3270
  };
3509
- _context41.next = 12;
3271
+ _context40.next = 12;
3510
3272
  break;
3511
3273
  case 9:
3512
- _context41.prev = 9;
3513
- _context41.t0 = _context41["catch"](2);
3274
+ _context40.prev = 9;
3275
+ _context40.t0 = _context40["catch"](2);
3514
3276
  nextState = {
3515
3277
  passed: false,
3516
3278
  failures: []
@@ -3519,21 +3281,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3519
3281
  this.store.cartValidation = nextState;
3520
3282
  changed = previous.passed !== nextState.passed || previous.failures !== nextState.failures;
3521
3283
  if (!changed) {
3522
- _context41.next = 17;
3284
+ _context40.next = 17;
3523
3285
  break;
3524
3286
  }
3525
- _context41.next = 17;
3287
+ _context40.next = 17;
3526
3288
  return this.core.effects.emit(VenueBookingHooks.onCartValidationChanged, {
3527
3289
  cartValidation: nextState,
3528
3290
  cartValidationPassed: nextState.passed
3529
3291
  });
3530
3292
  case 17:
3531
- return _context41.abrupt("return", nextState.passed);
3293
+ return _context40.abrupt("return", nextState.passed);
3532
3294
  case 18:
3533
3295
  case "end":
3534
- return _context41.stop();
3296
+ return _context40.stop();
3535
3297
  }
3536
- }, _callee41, this, [[2, 9]]);
3298
+ }, _callee40, this, [[2, 9]]);
3537
3299
  }));
3538
3300
  function refreshCartValidationPassed() {
3539
3301
  return _refreshCartValidationPassed.apply(this, arguments);
@@ -3543,14 +3305,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3543
3305
  }, {
3544
3306
  key: "setItemRuleRuntimeConfig",
3545
3307
  value: function () {
3546
- var _setItemRuleRuntimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42() {
3308
+ var _setItemRuleRuntimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41() {
3547
3309
  var _this$itemRuleRuntime, _this$itemRuleRuntime2;
3548
3310
  var config,
3549
- _args42 = arguments;
3550
- return _regeneratorRuntime().wrap(function _callee42$(_context42) {
3551
- while (1) switch (_context42.prev = _context42.next) {
3311
+ _args41 = arguments;
3312
+ return _regeneratorRuntime().wrap(function _callee41$(_context41) {
3313
+ while (1) switch (_context41.prev = _context41.next) {
3552
3314
  case 0:
3553
- config = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
3315
+ config = _args41.length > 0 && _args41[0] !== undefined ? _args41[0] : {};
3554
3316
  this.logMethodStart('setItemRuleRuntimeConfig');
3555
3317
  this.itemRuleRuntimeConfig = _objectSpread(_objectSpread(_objectSpread({}, this.itemRuleRuntimeConfig), config), {}, {
3556
3318
  pax: _objectSpread(_objectSpread({}, ((_this$itemRuleRuntime = this.itemRuleRuntimeConfig) === null || _this$itemRuleRuntime === void 0 ? void 0 : _this$itemRuleRuntime.pax) || {}), (config === null || config === void 0 ? void 0 : config.pax) || {}),
@@ -3562,10 +3324,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3562
3324
  this.itemRuleEvaluator.setStrategyConfigs([]);
3563
3325
  }
3564
3326
  this.itemRulePrefillApplied = false;
3565
- _context42.next = 7;
3327
+ _context41.next = 7;
3566
3328
  return this.refreshItemRuleQuantityLimits();
3567
3329
  case 7:
3568
- _context42.next = 9;
3330
+ _context41.next = 9;
3569
3331
  return this.refreshCartValidationPassed();
3570
3332
  case 9:
3571
3333
  this.logMethodSuccess('setItemRuleRuntimeConfig', {
@@ -3573,9 +3335,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3573
3335
  });
3574
3336
  case 10:
3575
3337
  case "end":
3576
- return _context42.stop();
3338
+ return _context41.stop();
3577
3339
  }
3578
- }, _callee42, this);
3340
+ }, _callee41, this);
3579
3341
  }));
3580
3342
  function setItemRuleRuntimeConfig() {
3581
3343
  return _setItemRuleRuntimeConfig.apply(this, arguments);
@@ -3602,23 +3364,23 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3602
3364
  }, {
3603
3365
  key: "readUIStateBucket",
3604
3366
  value: function readUIStateBucket() {
3605
- var _this$window2;
3367
+ var _this$window;
3606
3368
  var key = this.getUIStateBucketKey();
3607
- if (!key || !((_this$window2 = this.window) !== null && _this$window2 !== void 0 && _this$window2.sessionStorage)) return {};
3369
+ if (!key || !((_this$window = this.window) !== null && _this$window !== void 0 && _this$window.sessionStorage)) return {};
3608
3370
  try {
3609
3371
  var raw = this.window.sessionStorage.getItem(key) || '{}';
3610
3372
  var parsed = JSON.parse(raw);
3611
3373
  return parsed && _typeof(parsed) === 'object' ? parsed : {};
3612
- } catch (_unused4) {
3374
+ } catch (_unused3) {
3613
3375
  return {};
3614
3376
  }
3615
3377
  }
3616
3378
  }, {
3617
3379
  key: "writeUIStateBucket",
3618
3380
  value: function writeUIStateBucket(bucket) {
3619
- var _this$window3;
3381
+ var _this$window2;
3620
3382
  var key = this.getUIStateBucketKey();
3621
- if (!key || !((_this$window3 = this.window) !== null && _this$window3 !== void 0 && _this$window3.sessionStorage)) return;
3383
+ if (!key || !((_this$window2 = this.window) !== null && _this$window2 !== void 0 && _this$window2.sessionStorage)) return;
3622
3384
  this.window.sessionStorage.setItem(key, JSON.stringify(bucket));
3623
3385
  }
3624
3386
  }, {
@@ -3646,118 +3408,30 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3646
3408
  this.writeUIStateBucket(bucket);
3647
3409
  }
3648
3410
  }
3649
- }, {
3650
- key: "setBookingHolder",
3651
- value: function setBookingHolder(bookingUid, holder) {
3652
- var _tempOrder$bookings4;
3653
- if (!this.store.order) return;
3654
- var tempOrder = this.store.order.ensureTempOrder();
3655
- var booking = (_tempOrder$bookings4 = tempOrder.bookings) === null || _tempOrder$bookings4 === void 0 ? void 0 : _tempOrder$bookings4.find(function (b) {
3656
- var _b$metadata4;
3657
- return ((_b$metadata4 = b.metadata) === null || _b$metadata4 === void 0 ? void 0 : _b$metadata4.unique_identification_number) === bookingUid;
3658
- });
3659
- if (booking) {
3660
- booking.holder = holder;
3661
- }
3662
- var _iterator19 = _createForOfIteratorHelper(tempOrder.products),
3663
- _step19;
3664
- try {
3665
- for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
3666
- var _runtimeProduct$metad, _runtimeProduct$metad2, _runtimeProduct$_orig;
3667
- var product = _step19.value;
3668
- var runtimeProduct = product;
3669
- var productBookingUid = (_runtimeProduct$metad = (_runtimeProduct$metad2 = runtimeProduct.metadata) === null || _runtimeProduct$metad2 === void 0 ? void 0 : _runtimeProduct$metad2.booking_uid) !== null && _runtimeProduct$metad !== void 0 ? _runtimeProduct$metad : (_runtimeProduct$_orig = runtimeProduct._origin) === null || _runtimeProduct$_orig === void 0 || (_runtimeProduct$_orig = _runtimeProduct$_orig.product) === null || _runtimeProduct$_orig === void 0 ? void 0 : _runtimeProduct$_orig.bookingUuid;
3670
- if (String(productBookingUid) !== String(bookingUid)) continue;
3671
- var origin = runtimeProduct._origin && _typeof(runtimeProduct._origin) === 'object' ? runtimeProduct._origin : {};
3672
- origin.holder = holder;
3673
- runtimeProduct._origin = origin;
3674
- }
3675
- } catch (err) {
3676
- _iterator19.e(err);
3677
- } finally {
3678
- _iterator19.f();
3679
- }
3680
- this.store.order.notifyTempOrderChanged();
3681
- }
3682
-
3683
- /**
3684
- * 获取 holder 表单 map
3685
- */
3686
- }, {
3687
- key: "getHolderFormMap",
3688
- value: function getHolderFormMap() {
3689
- if (!this.store.holder) throw new Error('[VenueBooking] holder 模块未初始化');
3690
- return this.store.holder.getHolderFormMap();
3691
- }
3692
-
3693
- /**
3694
- * UI 层触发:按当前 holderMap 批量刷新所有表单的 records
3695
- */
3696
- }, {
3697
- key: "refreshAllHolderFormRecords",
3698
- value: (function () {
3699
- var _refreshAllHolderFormRecords = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(params) {
3700
- var _params$customer_id, _params$useCache;
3701
- var customer_id;
3702
- return _regeneratorRuntime().wrap(function _callee43$(_context43) {
3703
- while (1) switch (_context43.prev = _context43.next) {
3704
- case 0:
3705
- if (this.store.holder) {
3706
- _context43.next = 2;
3707
- break;
3708
- }
3709
- throw new Error('[VenueBooking] holder 模块未初始化');
3710
- case 2:
3711
- customer_id = (_params$customer_id = params === null || params === void 0 ? void 0 : params.customer_id) !== null && _params$customer_id !== void 0 ? _params$customer_id : this.resolveHolderCustomerId();
3712
- return _context43.abrupt("return", this.store.holder.refreshAllFormRecords(_objectSpread(_objectSpread({}, params), {}, {
3713
- customer_id: customer_id,
3714
- useCache: (_params$useCache = params === null || params === void 0 ? void 0 : params.useCache) !== null && _params$useCache !== void 0 ? _params$useCache : false
3715
- })));
3716
- case 4:
3717
- case "end":
3718
- return _context43.stop();
3719
- }
3720
- }, _callee43, this);
3721
- }));
3722
- function refreshAllHolderFormRecords(_x21) {
3723
- return _refreshAllHolderFormRecords.apply(this, arguments);
3724
- }
3725
- return refreshAllHolderFormRecords;
3726
- }()
3727
- /**
3728
- * 添加表单记录
3729
- */
3730
- )
3731
- }, {
3732
- key: "appendFormRecord",
3733
- value: function appendFormRecord(params) {
3734
- if (!this.store.holder) throw new Error('[VenueBooking] holder 模块未初始化');
3735
- return this.store.holder.appendFormRecord(params);
3736
- }
3737
3411
 
3738
3412
  // ─── OpenData 可用性 ───
3739
3413
  }, {
3740
3414
  key: "checkOpenDataAvailability",
3741
3415
  value: function () {
3742
- var _checkOpenDataAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44() {
3743
- return _regeneratorRuntime().wrap(function _callee44$(_context44) {
3744
- while (1) switch (_context44.prev = _context44.next) {
3416
+ var _checkOpenDataAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42() {
3417
+ return _regeneratorRuntime().wrap(function _callee42$(_context42) {
3418
+ while (1) switch (_context42.prev = _context42.next) {
3745
3419
  case 0:
3746
3420
  if (this.store.openData) {
3747
- _context44.next = 2;
3421
+ _context42.next = 2;
3748
3422
  break;
3749
3423
  }
3750
3424
  throw new Error('openData 模块未初始化');
3751
3425
  case 2:
3752
- _context44.next = 4;
3426
+ _context42.next = 4;
3753
3427
  return this.loadOpenDataConfig();
3754
3428
  case 4:
3755
- return _context44.abrupt("return", this.store.openData.checkAvailability(this.store.schedule));
3429
+ return _context42.abrupt("return", this.store.openData.checkAvailability(this.store.schedule));
3756
3430
  case 5:
3757
3431
  case "end":
3758
- return _context44.stop();
3432
+ return _context42.stop();
3759
3433
  }
3760
- }, _callee44, this);
3434
+ }, _callee42, this);
3761
3435
  }));
3762
3436
  function checkOpenDataAvailability() {
3763
3437
  return _checkOpenDataAvailability.apply(this, arguments);
@@ -3767,15 +3441,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3767
3441
  }, {
3768
3442
  key: "setOtherParams",
3769
3443
  value: function () {
3770
- var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(params) {
3771
- var _ref7,
3772
- _ref7$cover,
3444
+ var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(params) {
3445
+ var _ref5,
3446
+ _ref5$cover,
3773
3447
  cover,
3774
- _args45 = arguments;
3775
- return _regeneratorRuntime().wrap(function _callee45$(_context45) {
3776
- while (1) switch (_context45.prev = _context45.next) {
3448
+ _args43 = arguments;
3449
+ return _regeneratorRuntime().wrap(function _callee43$(_context43) {
3450
+ while (1) switch (_context43.prev = _context43.next) {
3777
3451
  case 0:
3778
- _ref7 = _args45.length > 1 && _args45[1] !== undefined ? _args45[1] : {}, _ref7$cover = _ref7.cover, cover = _ref7$cover === void 0 ? false : _ref7$cover;
3452
+ _ref5 = _args43.length > 1 && _args43[1] !== undefined ? _args43[1] : {}, _ref5$cover = _ref5.cover, cover = _ref5$cover === void 0 ? false : _ref5$cover;
3779
3453
  if (cover) {
3780
3454
  this.otherParams = params;
3781
3455
  } else {
@@ -3783,17 +3457,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3783
3457
  }
3784
3458
  case 2:
3785
3459
  case "end":
3786
- return _context45.stop();
3460
+ return _context43.stop();
3787
3461
  }
3788
- }, _callee45, this);
3462
+ }, _callee43, this);
3789
3463
  }));
3790
- function setOtherParams(_x22) {
3464
+ function setOtherParams(_x20) {
3791
3465
  return _setOtherParams.apply(this, arguments);
3792
3466
  }
3793
3467
  return setOtherParams;
3794
3468
  }()
3795
3469
  }]);
3796
3470
  return VenueBookingImpl;
3797
- }(BaseSalesImpl);
3471
+ }(BaseModule);
3798
3472
  _defineProperty(VenueBookingImpl, "OPEN_DATA_CACHE_TTL", 5 * 60 * 1000);
3799
3473
  _defineProperty(VenueBookingImpl, "UI_STATE_KEY_PREFIX", 'pisell.venueBooking.uiState:');