@loczer/storefront-sdk 0.230.0 → 0.232.0

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 (68) hide show
  1. package/dist/StorefrontContext.d.ts +0 -2
  2. package/dist/StorefrontContext.d.ts.map +1 -1
  3. package/dist/StorefrontProvider.d.ts +0 -1
  4. package/dist/StorefrontProvider.d.ts.map +1 -1
  5. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-C9kJFMIu.js → base-booking-BJXFzDM5.js} +0 -2
  6. package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-epi7FXIk.js → cart-inputs-3lBblkB0.js} +0 -10
  7. package/dist/chunks/pkg/booking-engine/dist/{schemas-DW5gdDYz.js → schemas-JjiUWFIv.js} +2 -2
  8. package/dist/chunks/pkg/ui/dist/LanguagePicker/index-D7_3voTe.js +83 -0
  9. package/dist/components/BookingBikeQuickAddCard/index.d.ts +3 -1
  10. package/dist/components/BookingBikeQuickAddCard/index.d.ts.map +1 -1
  11. package/dist/components/BookingBikeQuickAddCard/index.js +94 -85
  12. package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
  13. package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
  14. package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
  15. package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
  16. package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
  17. package/dist/components/ContractSaleDocument/InvoiceDetails.js +62 -56
  18. package/dist/components/Footer/businessHoursStatus.js +1 -1
  19. package/dist/components/Header/index.d.ts.map +1 -1
  20. package/dist/components/Header/index.js +56 -56
  21. package/dist/components/LanguageSelector/index.d.ts.map +1 -1
  22. package/dist/components/LanguageSelector/index.js +19 -64
  23. package/dist/components/StorefrontCartPanel/index.js +1 -1
  24. package/dist/i18n/en.d.ts +2 -4
  25. package/dist/i18n/en.d.ts.map +1 -1
  26. package/dist/i18n/en.js +3 -5
  27. package/dist/i18n/fr.d.ts +2 -4
  28. package/dist/i18n/fr.d.ts.map +1 -1
  29. package/dist/i18n/fr.js +4 -6
  30. package/dist/index.d.ts +17 -35
  31. package/dist/index.js +3 -3
  32. package/dist/lib/booking-period.js +1 -1
  33. package/dist/lib/booking.d.ts +6 -6
  34. package/dist/lib/booking.d.ts.map +1 -1
  35. package/dist/lib/booking.js +21 -21
  36. package/dist/lib/cart.d.ts +1 -0
  37. package/dist/lib/cart.d.ts.map +1 -1
  38. package/dist/lib/cart.js +2 -0
  39. package/dist/lib/checkoutSubmit.d.ts +2 -6
  40. package/dist/lib/checkoutSubmit.d.ts.map +1 -1
  41. package/dist/lib/checkoutSubmit.js +3 -11
  42. package/dist/lib/pricing.js +1 -1
  43. package/dist/lib/storefrontAvailability.d.ts +12 -8
  44. package/dist/lib/storefrontAvailability.d.ts.map +1 -1
  45. package/dist/lib/storefrontAvailability.js +17 -7
  46. package/dist/pages/BookingPage.d.ts.map +1 -1
  47. package/dist/pages/BookingPage.js +236 -238
  48. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  49. package/dist/pages/CheckoutPage.js +127 -125
  50. package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
  51. package/dist/pages/ContractSaleDocumentPage.js +117 -171
  52. package/dist/pages/HomePage.js +8 -8
  53. package/dist/pages/ProductPage.d.ts.map +1 -1
  54. package/dist/pages/ProductPage.js +187 -181
  55. package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -1
  56. package/dist/pages/checkout/components/CheckoutDetailsCard.js +4 -17
  57. package/dist/pages/checkout/components/CheckoutLoadingSkeleton.d.ts +7 -0
  58. package/dist/pages/checkout/components/CheckoutLoadingSkeleton.d.ts.map +1 -0
  59. package/dist/pages/checkout/components/CheckoutLoadingSkeleton.js +105 -0
  60. package/dist/pages/checkout/types.d.ts +1 -2
  61. package/dist/pages/checkout/types.d.ts.map +1 -1
  62. package/dist/pages/checkout/types.js +1 -2
  63. package/dist/storefront.css +1 -1
  64. package/dist/storefrontSchemas.d.ts +0 -2
  65. package/dist/storefrontSchemas.d.ts.map +1 -1
  66. package/dist/storefrontSchemas.js +1 -2
  67. package/package.json +1 -1
  68. package/dist/chunks/pkg/ui/dist/{MorphingModalWizard-j1CgFGLe.js → MorphingModalWizard-Q8O5Rjfq.js} +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPage.tsx"],"names":[],"mappings":"AAoFA,MAAM,CAAC,OAAO,UAAU,YAAY,4CAsoBnC"}
1
+ {"version":3,"file":"CheckoutPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPage.tsx"],"names":[],"mappings":"AAqFA,MAAM,CAAC,OAAO,UAAU,YAAY,4CA+oBnC"}
@@ -15,16 +15,17 @@ import { ROUTE as _e, responseSchema as ve } from "../lib/checkoutPaymentDecisio
15
15
  import { ROUTE as ye, responseSchema as be } from "../lib/checkoutVerifyCoupon.js";
16
16
  import { CheckoutDetailsCard as xe } from "./checkout/components/CheckoutDetailsCard.js";
17
17
  import { CheckoutInsuranceCard as Se } from "./checkout/components/CheckoutInsuranceCard.js";
18
- import { CheckoutSummaryColumn as Ce } from "./checkout/components/CheckoutSummaryColumn.js";
19
- import { checkoutFormSchema as we } from "./checkout/types.js";
20
- import { useEffect as s, useMemo as c, useRef as Te, useState as l } from "react";
18
+ import { CheckoutLoadingSkeleton as Ce } from "./checkout/components/CheckoutLoadingSkeleton.js";
19
+ import { CheckoutSummaryColumn as we } from "./checkout/components/CheckoutSummaryColumn.js";
20
+ import { checkoutFormSchema as Te } from "./checkout/types.js";
21
+ import { useEffect as s, useMemo as c, useRef as Ee, useState as l } from "react";
21
22
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
22
- import { Link as Ee, useNavigate as De, useParams as Oe, useSearchParams as ke } from "@rpcbase/router";
23
- import { useTranslation as Ae } from "react-i18next";
24
- import { AlertTriangle as je, ArrowLeft as Me } from "lucide-react";
25
- import { useForm as Ne, zodResolver as Pe } from "@rpcbase/form";
23
+ import { Link as De, useNavigate as Oe, useParams as ke, useSearchParams as Ae } from "@rpcbase/router";
24
+ import { useTranslation as je } from "react-i18next";
25
+ import { AlertTriangle as Me, ArrowLeft as Ne } from "lucide-react";
26
+ import { useForm as Pe, zodResolver as Fe } from "@rpcbase/form";
26
27
  //#region src/pages/CheckoutPage.tsx
27
- var Fe = .2, f = (e, t, n) => {
28
+ var Ie = .2, f = (e, t, n) => {
28
29
  try {
29
30
  return new Intl.NumberFormat(n, {
30
31
  style: "currency",
@@ -33,7 +34,7 @@ var Fe = .2, f = (e, t, n) => {
33
34
  } catch {
34
35
  return `${(e / 100).toFixed(2)} ${t.toUpperCase()}`;
35
36
  }
36
- }, Ie = (e, t) => {
37
+ }, Le = (e, t) => {
37
38
  try {
38
39
  return new Intl.NumberFormat(t, {
39
40
  style: "percent",
@@ -45,49 +46,49 @@ var Fe = .2, f = (e, t, n) => {
45
46
  }
46
47
  };
47
48
  function p() {
48
- let { t: p, i18n: m } = Ae(), { storefrontConfiguration: h } = fe(), Le = h.workspace?.workspaceLanguage, { bikes: g, accessories: Re } = pe(), { storeSlug: _ } = Oe(), [v, ze] = ke(), Be = De(), { items: Ve, itemCount: He, setQuantity: Ue, removeItem: We, beginCheckoutSubmission: Ge, confirmCheckoutPaymentSession: Ke, clearCheckoutSession: qe, clear: Je } = ee(), [y, Ye] = l(!1), b = Te(!1), [x, S] = l(null), [Xe, C] = l(!1), [w, T] = l(null), Ze = v.get("coupon") ?? v.get("code") ?? "", [Qe, E] = l(Ze), [$e, et] = l(Ze.trim()), [D, O] = l(null), [k, A] = l(null), [j, M] = l(!1), [tt, N] = l(null), [nt, P] = l(null), [F, rt] = l(!1), [I, it] = l(!1), at = n(v).toString(), ot = c(() => r(new URLSearchParams(at), _), [at, _]), L = h.settings.fulfillmentModes.includes("delivery"), st = h.settings.deliveryDisabledReason.trim(), ct = L || st.length > 0, lt = h.shop.address?.trim() ?? "", R = c(() => {
49
- let e = t(ot, {
50
- start_time: "",
51
- end_time: ""
49
+ let { t: p, i18n: m } = je(), { storefrontConfiguration: h } = fe(), Re = h.workspace?.workspaceLanguage, { bikes: g, accessories: ze } = pe(), { storeSlug: _ } = ke(), [v, Be] = Ae(), Ve = Oe(), { items: He, itemCount: Ue, isReady: We, setQuantity: Ge, removeItem: Ke, beginCheckoutSubmission: qe, confirmCheckoutPaymentSession: Je, clearCheckoutSession: Ye, clear: Xe } = ee(), [y, Ze] = l(!1), b = Ee(!1), [x, S] = l(null), [Qe, C] = l(!1), [w, T] = l(null), $e = v.get("coupon") ?? v.get("code") ?? "", [et, E] = l($e), [tt, nt] = l($e.trim()), [D, O] = l(null), [k, A] = l(null), [j, M] = l(!1), [rt, N] = l(null), [it, P] = l(null), [F, at] = l(!1), [I, ot] = l(!1), st = n(v).toString(), ct = c(() => r(new URLSearchParams(st), _), [st, _]), L = h.settings.fulfillmentModes.includes("delivery"), lt = h.settings.deliveryDisabledReason.trim(), ut = L || lt.length > 0, dt = h.shop.address?.trim() ?? "", R = c(() => {
50
+ let e = t(ct, {
51
+ startTime: "",
52
+ endTime: ""
52
53
  });
53
54
  return e.fulfillment === "delivery" && !L ? {
54
55
  ...e,
55
56
  fulfillment: "pickup"
56
57
  } : e;
57
- }, [ot, L]), z = c(() => le(R), [R]), B = h.bookingEngine.pricing, ut = te(R, B, h.bookingEngine.shop.timeZone), dt = ne(B.baseUnit, p), ft = ut?.billableUnitCount, V = c(() => re({
58
- items: Ve,
58
+ }, [ct, L]), z = c(() => le(R), [R]), B = h.bookingEngine.pricing, ft = te(R, B, h.bookingEngine.shop.timeZone), pt = ne(B.baseUnit, p), mt = ft?.billableUnitCount, V = c(() => re({
59
+ items: He,
59
60
  language: m.language,
60
- fallbackLanguage: Le,
61
+ fallbackLanguage: Re,
61
62
  products: {
62
63
  bikes: g,
63
- accessories: Re
64
+ accessories: ze
64
65
  },
65
66
  priceUnit: B.baseUnit,
66
- billableUnitCount: ft
67
+ billableUnitCount: mt
67
68
  }), [
68
- Re,
69
+ ze,
69
70
  g,
70
- ft,
71
+ mt,
71
72
  m.language,
72
- Ve,
73
+ He,
73
74
  B.baseUnit,
74
- Le
75
+ Re
75
76
  ]), H = c(() => V.lines.map((e) => ({
76
77
  productId: e.checkoutProductId,
77
78
  productVariantId: e.productVariantId,
78
79
  quantity: e.quantity
79
- })), [V.lines]), [pt, U] = l([]), [W, G] = l(!1);
80
+ })), [V.lines]), [ht, U] = l([]), [gt, W] = l(!1);
80
81
  s(() => {
81
82
  if (!_ || H.length === 0) {
82
- U([]), G(!1);
83
+ U([]), W(!1);
83
84
  return;
84
85
  }
85
86
  if (!z) {
86
- U([]), G(!1);
87
+ U([]), W(!1);
87
88
  return;
88
89
  }
89
90
  let e = !1;
90
- return G(!0), U([]), (async () => {
91
+ return W(!0), U([]), (async () => {
91
92
  try {
92
93
  let t = await o(oe, {
93
94
  storeSlug: _,
@@ -100,51 +101,50 @@ function p() {
100
101
  if (e) return;
101
102
  console.error("Failed to load checkout cart availability", t), U([]);
102
103
  } finally {
103
- e || G(!1);
104
+ e || W(!1);
104
105
  }
105
106
  })(), () => {
106
107
  e = !0;
107
108
  };
108
109
  }, [
109
- R.end_date,
110
- R.end_time,
111
- R.start_date,
112
- R.start_time,
110
+ R.endDate,
111
+ R.endTime,
112
+ R.startDate,
113
+ R.startTime,
113
114
  z,
114
115
  H,
115
116
  _
116
117
  ]);
117
- let mt = c(() => new Map(pt.map((e) => [se(e.productId, e.productVariantId), e])), [pt]), ht = c(() => ({
118
+ let _t = c(() => new Map(ht.map((e) => [se(e.productId, e.productVariantId), e])), [ht]), vt = c(() => ({
118
119
  ...V,
119
120
  lines: V.lines.map((e) => {
120
- let t = mt.get(se(e.checkoutProductId, e.productVariantId)), n = t ? ce(t) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
121
+ let t = _t.get(se(e.checkoutProductId, e.productVariantId)), n = t ? ce(t) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
121
122
  return {
122
123
  ...e,
123
- insufficientCapacity: !W && n !== void 0,
124
- availabilityIssue: W ? void 0 : n
124
+ insufficientCapacity: !gt && n !== void 0,
125
+ availabilityIssue: gt ? void 0 : n
125
126
  };
126
127
  })
127
128
  }), [
128
- mt,
129
- W,
129
+ _t,
130
+ gt,
130
131
  V
131
- ]), K = c(() => V.lines.map((e) => ({
132
+ ]), G = c(() => V.lines.map((e) => ({
132
133
  kind: e.kind,
133
134
  productId: e.checkoutProductId,
134
135
  productVariantId: e.productVariantId,
135
136
  quantity: e.quantity
136
- })), [V.lines]), gt = new Map(g.map((e) => [e.checkoutProductId?.trim() || e.id, e])), q = V.lines.flatMap((e) => {
137
- let t = gt.get(e.checkoutProductId);
137
+ })), [V.lines]), yt = new Map(g.map((e) => [e.checkoutProductId?.trim() || e.id, e])), bt = V.lines.flatMap((e) => {
138
+ let t = yt.get(e.checkoutProductId);
138
139
  return t?.insurance?.enabled ? [{
139
140
  quantity: e.quantity,
140
141
  pricePerDayMinor: t.insurance.pricePerDayMinor,
141
142
  deductibleAmountMinor: t.insurance.deductibleAmountMinor
142
143
  }] : [];
143
- }), J = h.modules?.insurance?.enabled === !0 && q.length > 0, Y = J && I, _t = q.reduce((e, t) => e + t.pricePerDayMinor * t.quantity, 0), vt = q.reduce((e, t) => Math.max(e, t.deductibleAmountMinor), 0), yt = V.totalMinor ?? 0, X = k?.totalMinor ?? yt, Z = k?.insuranceSubtotalMinor ?? 0, bt = D?.discountAmountMinor ?? 0, Q = e(new URLSearchParams(), R).toString(), xt = `/${_ ?? ""}/booking${Q ? `?${Q}` : ""}`, St = `/${_ ?? ""}/checkout${Q ? `?${Q}` : ""}`, Ct = Ne({
144
- resolver: Pe(we),
144
+ }), K = h.modules?.insurance?.enabled === !0 && bt.length > 0, q = K && I, xt = bt.reduce((e, t) => e + t.pricePerDayMinor * t.quantity, 0), St = bt.reduce((e, t) => Math.max(e, t.deductibleAmountMinor), 0), Ct = V.totalMinor ?? 0, J = k?.totalMinor ?? Ct, Y = k?.insuranceSubtotalMinor ?? 0, wt = D?.discountAmountMinor ?? 0, X = e(new URLSearchParams(), R).toString(), Z = `/${_ ?? ""}/booking${X ? `?${X}` : ""}`, Tt = `/${_ ?? ""}/checkout${X ? `?${X}` : ""}`, Et = Pe({
145
+ resolver: Fe(Te),
145
146
  defaultValues: {
146
- first_name: "",
147
- last_name: "",
147
+ fullName: "",
148
148
  email: "",
149
149
  phone: "",
150
150
  notes: ""
@@ -153,30 +153,30 @@ function p() {
153
153
  s(() => {
154
154
  i(_, R);
155
155
  }, [R, _]), s(() => {
156
- !J && I && it(!1);
157
- }, [I, J]);
158
- let wt = (t) => {
156
+ !K && I && ot(!1);
157
+ }, [I, K]);
158
+ let Q = (t) => {
159
159
  let n = {
160
160
  ...R,
161
161
  ...t
162
162
  }, r = e(v, n);
163
- r.toString() !== v.toString() && (ze(r, { replace: !0 }), i(_, r));
163
+ r.toString() !== v.toString() && (Be(r, { replace: !0 }), i(_, r));
164
164
  };
165
165
  s(() => {
166
- if (!_ || K.length === 0 || !z) {
166
+ if (!_ || G.length === 0 || !z) {
167
167
  O(null), A(null), M(!1), N(null), P(null);
168
168
  return;
169
169
  }
170
- let e = $e.trim(), t = e.length === 0 && !F, n = !1;
170
+ let e = tt.trim(), t = e.length === 0 && !F, n = !1;
171
171
  return M(!0), P(null), N(null), (async () => {
172
172
  try {
173
173
  let r = await o(ye, {
174
174
  storeSlug: _,
175
175
  schedule: z,
176
- items: K,
176
+ items: G,
177
177
  couponCode: e || void 0,
178
178
  includeAutoApply: t,
179
- insuranceAccepted: Y
179
+ insuranceAccepted: q
180
180
  }), i = be.parse(r);
181
181
  if (n) return;
182
182
  if (A(typeof i.subtotalMinor == "number" && typeof i.totalMinor == "number" ? {
@@ -201,15 +201,15 @@ function p() {
201
201
  };
202
202
  }, [
203
203
  F,
204
- R.end_date,
205
- R.end_time,
206
- R.start_date,
207
- R.start_time,
204
+ R.endDate,
205
+ R.endTime,
206
+ R.startDate,
207
+ R.startTime,
208
208
  z,
209
- K,
210
- Y,
209
+ G,
210
+ q,
211
211
  _,
212
- $e,
212
+ tt,
213
213
  p
214
214
  ]), s(() => {
215
215
  if (!_ || V.lines.length === 0 || !z) {
@@ -222,8 +222,8 @@ function p() {
222
222
  let t = await o(_e, {
223
223
  storeSlug: _,
224
224
  schedule: z,
225
- estimatedTotalMinor: X,
226
- insuranceAmountMinor: Z
225
+ estimatedTotalMinor: J,
226
+ insuranceAmountMinor: Y
227
227
  }), n = ve.parse(t);
228
228
  if (e) return;
229
229
  if (!n.success || !n.decision) {
@@ -241,21 +241,21 @@ function p() {
241
241
  e = !0;
242
242
  };
243
243
  }, [
244
- R.end_date,
245
- R.end_time,
246
- R.start_date,
247
- R.start_time,
244
+ R.endDate,
245
+ R.endTime,
246
+ R.startDate,
247
+ R.startTime,
248
248
  z,
249
- X,
249
+ J,
250
250
  V.lines.length,
251
- Z,
251
+ Y,
252
252
  _,
253
253
  p
254
254
  ]);
255
- let $ = x?.currency ?? "EUR", Tt = f(X, $, m.language), Et = Math.max(0, X - Z), Dt = Math.round(Et / 1.2), Ot = Dt + Z, kt = Math.max(0, Et - Dt), At = f(Ot, $, m.language), jt = f(kt, $, m.language), Mt = Ie(Fe, m.language), Nt = Z > 0 ? f(Z, $, m.language) : void 0, Pt = x?.amountToCollectMinor ?? 0, Ft = x?.shouldCollectOnlinePayment === !0 && Pt > 0, It = Ct.handleSubmit(async (e) => {
256
- if (!_ || K.length === 0 || !z || b.current) return;
257
- Ye(!0), b.current = !0;
258
- let t = Ge();
255
+ let $ = x?.currency ?? "EUR", Dt = f(J, $, m.language), Ot = Math.max(0, J - Y), kt = Math.round(Ot / 1.2), At = kt + Y, jt = Math.max(0, Ot - kt), Mt = f(At, $, m.language), Nt = f(jt, $, m.language), Pt = Le(Ie, m.language), Ft = Y > 0 ? f(Y, $, m.language) : void 0, It = x?.amountToCollectMinor ?? 0, Lt = x?.shouldCollectOnlinePayment === !0 && It > 0, Rt = Et.handleSubmit(async (e) => {
256
+ if (!_ || G.length === 0 || !z || b.current) return;
257
+ Ze(!0), b.current = !0;
258
+ let t = qe();
259
259
  try {
260
260
  let n = await o(ie, {
261
261
  storeSlug: _,
@@ -263,32 +263,31 @@ function p() {
263
263
  replacesCheckoutSessionId: t.replacesCheckoutSessionId,
264
264
  schedule: z,
265
265
  fulfillment: R.fulfillment,
266
- startAddress: R.fulfillment === "delivery" ? R.start_address : void 0,
267
- endAddress: R.fulfillment === "delivery" ? R.end_address : void 0,
266
+ startAddress: R.fulfillment === "delivery" ? R.startAddress : void 0,
267
+ endAddress: R.fulfillment === "delivery" ? R.endAddress : void 0,
268
268
  couponCode: D?.code,
269
269
  couponAutoApplied: !F && D?.autoApplied,
270
- insuranceAccepted: Y,
270
+ insuranceAccepted: q,
271
271
  customer: {
272
- firstName: e.first_name,
273
- lastName: e.last_name,
272
+ name: e.fullName,
274
273
  email: e.email,
275
274
  phone: e.phone,
276
275
  notes: e.notes
277
276
  },
278
- items: K
277
+ items: G
279
278
  }), r = ae.parse(n);
280
279
  if (!r.success || !r.checkout) {
281
- qe(), a.error(r.message || p("checkout_payment_error"));
280
+ Ye(), a.error(r.message || p("checkout_payment_error"));
282
281
  return;
283
282
  }
284
- r.checkout.requiresPayment ? Ke(r.checkout.checkoutSessionId ?? t.checkoutSessionId) : a.success(p("checkout_success_toast")), await Be(r.checkout.nextPath), r.checkout.requiresPayment || Je();
283
+ r.checkout.requiresPayment ? Je(r.checkout.checkoutSessionId ?? t.checkoutSessionId) : a.success(p("checkout_success_toast")), await Ve(r.checkout.nextPath), r.checkout.requiresPayment || Xe();
285
284
  } catch (e) {
286
285
  console.error("Failed to submit storefront checkout", e), a.error(p("checkout_payment_error"));
287
286
  } finally {
288
- b.current = !1, Ye(!1);
287
+ b.current = !1, Ze(!1);
289
288
  }
290
- }), Lt = p(Ft ? "checkout_continue_to_payment" : "checkout_submit"), Rt = R.fulfillment === "delivery" && R.start_address.trim().length === 0, zt = !y && !Xe && !w && !j && !nt && !!x && !!z && !Rt && K.length > 0;
291
- return V.lines.length === 0 ? /* @__PURE__ */ u("div", {
289
+ }), zt = p(Lt ? "checkout_continue_to_payment" : "checkout_submit"), Bt = R.fulfillment === "delivery" && R.startAddress.trim().length === 0, Vt = !y && !Qe && !w && !j && !it && !!x && !!z && !Bt && G.length > 0;
290
+ return We ? V.lines.length === 0 ? /* @__PURE__ */ u("div", {
292
291
  className: "mx-auto max-w-3xl px-4 py-10 sm:px-6",
293
292
  children: /* @__PURE__ */ d("div", {
294
293
  className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm",
@@ -303,11 +302,11 @@ function p() {
303
302
  }),
304
303
  /* @__PURE__ */ u("div", {
305
304
  className: "mt-6",
306
- children: /* @__PURE__ */ u(Ee, {
307
- to: xt,
305
+ children: /* @__PURE__ */ u(De, {
306
+ to: Z,
308
307
  children: /* @__PURE__ */ d(de, {
309
308
  className: "gap-2",
310
- children: [/* @__PURE__ */ u(Me, {
309
+ children: [/* @__PURE__ */ u(Ne, {
311
310
  className: "h-4 w-4",
312
311
  "aria-hidden": "true"
313
312
  }), /* @__PURE__ */ u("span", { children: p("back_to_booking") })]
@@ -318,9 +317,9 @@ function p() {
318
317
  })
319
318
  }) : /* @__PURE__ */ u(he, {
320
319
  currentStep: "checkout",
321
- bookingPath: xt,
322
- checkoutPath: St,
323
- backPath: xt,
320
+ bookingPath: Z,
321
+ checkoutPath: Tt,
322
+ backPath: Z,
324
323
  backLabel: p("back_to_booking"),
325
324
  children: /* @__PURE__ */ d("div", {
326
325
  className: "grid gap-6 lg:grid-cols-12",
@@ -339,33 +338,33 @@ function p() {
339
338
  /* @__PURE__ */ d("div", {
340
339
  className: "mt-5 grid gap-4",
341
340
  children: [
342
- ct ? /* @__PURE__ */ u("div", {
341
+ ut ? /* @__PURE__ */ u("div", {
343
342
  className: "rounded-xl border border-slate-200 bg-white p-3 shadow-sm",
344
343
  children: /* @__PURE__ */ u(me, {
345
344
  value: R.fulfillment,
346
- onValueChange: (e) => wt({ fulfillment: e }),
347
- pickupAddress: lt,
345
+ onValueChange: (e) => Q({ fulfillment: e }),
346
+ pickupAddress: dt,
348
347
  deliveryEnabled: L,
349
- deliveryDisabledReason: st,
350
- startAddress: R.start_address,
351
- onStartAddressChange: (e) => wt({ start_address: e }),
352
- endAddress: R.end_address,
353
- onEndAddressChange: (e) => wt({ end_address: e }),
348
+ deliveryDisabledReason: lt,
349
+ startAddress: R.startAddress,
350
+ onStartAddressChange: (e) => Q({ startAddress: e }),
351
+ endAddress: R.endAddress,
352
+ onEndAddressChange: (e) => Q({ endAddress: e }),
354
353
  showPickupAddressWhenPickupOnly: !1,
355
354
  testIdPrefix: "storefront-checkout-fulfillment"
356
355
  })
357
356
  }) : null,
358
- /* @__PURE__ */ u(xe, { form: Ct }),
359
- J ? /* @__PURE__ */ u(Se, {
360
- accepted: Y,
357
+ /* @__PURE__ */ u(xe, { form: Et }),
358
+ K ? /* @__PURE__ */ u(Se, {
359
+ accepted: q,
361
360
  disabled: y || j,
362
- dailyAmountLabel: f(_t, $, m.language),
363
- totalAmountLabel: Nt,
361
+ dailyAmountLabel: f(xt, $, m.language),
362
+ totalAmountLabel: Ft,
364
363
  billableDays: k?.insuranceBillableDays,
365
- deductibleLabel: vt > 0 ? f(vt, $, m.language) : void 0,
366
- onAcceptedChange: it
364
+ deductibleLabel: St > 0 ? f(St, $, m.language) : void 0,
365
+ onAcceptedChange: ot
367
366
  }) : null,
368
- Xe ? /* @__PURE__ */ d("div", {
367
+ Qe ? /* @__PURE__ */ d("div", {
369
368
  className: "flex items-center gap-2 text-sm text-slate-600",
370
369
  role: "status",
371
370
  children: [/* @__PURE__ */ u(ge, {
@@ -376,7 +375,7 @@ function p() {
376
375
  w ? /* @__PURE__ */ d("div", {
377
376
  className: "flex items-start gap-2 rounded-md bg-destructive p-3 text-sm text-destructive-foreground shadow-sm",
378
377
  role: "alert",
379
- children: [/* @__PURE__ */ u(je, {
378
+ children: [/* @__PURE__ */ u(Me, {
380
379
  className: "mt-0.5 h-4 w-4",
381
380
  "aria-hidden": "true"
382
381
  }), /* @__PURE__ */ u("span", { children: w })]
@@ -385,49 +384,52 @@ function p() {
385
384
  type: "button",
386
385
  size: "lg",
387
386
  onClick: () => {
388
- It();
387
+ Rt();
389
388
  },
390
- disabled: !zt,
389
+ disabled: !Vt,
391
390
  className: "mt-4 w-fit",
392
- children: /* @__PURE__ */ u("span", { children: Lt })
391
+ children: /* @__PURE__ */ u("span", { children: zt })
393
392
  }),
394
- Rt ? /* @__PURE__ */ u("p", {
393
+ Bt ? /* @__PURE__ */ u("p", {
395
394
  className: "text-sm text-slate-600",
396
395
  children: /* @__PURE__ */ u("span", { children: p("checkout_delivery_address_required") })
397
396
  }) : null
398
397
  ]
399
398
  })
400
399
  ]
401
- }), /* @__PURE__ */ u(Ce, {
402
- lines: ht.lines,
403
- itemCount: He,
404
- baseUnitLabel: dt,
405
- bookingSubtotalLabel: At,
406
- vatAmountLabel: jt,
407
- vatRateLabel: Mt,
408
- bookingTotalLabel: Tt,
409
- onQuantityChange: Ue,
410
- onRemove: We,
400
+ }), /* @__PURE__ */ u(we, {
401
+ lines: vt.lines,
402
+ itemCount: Ue,
403
+ baseUnitLabel: pt,
404
+ bookingSubtotalLabel: Mt,
405
+ vatAmountLabel: Nt,
406
+ vatRateLabel: Pt,
407
+ bookingTotalLabel: Dt,
408
+ onQuantityChange: Ge,
409
+ onRemove: Ke,
411
410
  coupon: {
412
- code: Qe,
411
+ code: et,
413
412
  appliedCode: D?.code,
414
- discountLabel: D && bt > 0 ? f(bt, $, m.language) : null,
415
- message: tt,
416
- error: nt,
413
+ discountLabel: D && wt > 0 ? f(wt, $, m.language) : null,
414
+ message: rt,
415
+ error: it,
417
416
  loading: j,
418
417
  disabled: y,
419
418
  onCodeChange: (e) => {
420
419
  E(e), P(null), N(null);
421
420
  },
422
421
  onApply: () => {
423
- rt(!1), et(Qe.trim());
422
+ at(!1), nt(et.trim());
424
423
  },
425
424
  onRemove: () => {
426
- E(""), et(""), O(null), A(null), P(null), N(null), rt(!0);
425
+ E(""), nt(""), O(null), A(null), P(null), N(null), at(!0);
427
426
  }
428
427
  }
429
428
  })]
430
429
  })
430
+ }) : /* @__PURE__ */ u(Ce, {
431
+ bookingPath: Z,
432
+ checkoutPath: Tt
431
433
  });
432
434
  }
433
435
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ContractSaleDocumentPage.d.ts","sourceRoot":"","sources":["../../src/pages/ContractSaleDocumentPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAmC7C,eAAO,MAAM,mCAAmC,GAAI,QAAQ,MAAM,KAAG,MAAM,GAAG,IAe7E,CAAA;AA0KD,KAAK,8BAA8B,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG;IAC5D,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,MAAM,6BAAqC,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEnE,CAAA;AAYnB,MAAM,CAAC,OAAO,UAAU,wBAAwB,4CA8P/C"}
1
+ {"version":3,"file":"ContractSaleDocumentPage.d.ts","sourceRoot":"","sources":["../../src/pages/ContractSaleDocumentPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAoC7C,eAAO,MAAM,mCAAmC,GAAI,QAAQ,MAAM,KAAG,MAAM,GAAG,IAe7E,CAAA;AAsFD,KAAK,8BAA8B,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG;IAC5D,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,MAAM,6BAAqC,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEnE,CAAA;AAYnB,MAAM,CAAC,OAAO,UAAU,wBAAwB,4CAyQ/C"}