@calcom/atoms 1.7.0 → 1.8.0-booker

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 (205) hide show
  1. package/dist/{AddressInput-xFwoBxsZ.js → AddressInput-E1ARKDg7.js} +5 -5
  2. package/dist/{AlbyPriceComponent-NnD6qUfW.js → AlbyPriceComponent-jBcuDvZa.js} +24 -24
  3. package/dist/{PhoneInput-uymiSRfv.js → PhoneInput-qXboae9k.js} +62 -62
  4. package/dist/cal-atoms.js +5 -36
  5. package/dist/index-GQl0OyJB.js +88695 -0
  6. package/dist/index-QBpbC_ZD.js +1957 -0
  7. package/dist/{index-WXyiFeKd.js → index-bGbS5CRI.js} +1 -1
  8. package/dist/packages/features/bookings/Booker/components/BookEventForm/BookEventForm.d.ts.map +1 -1
  9. package/dist/packages/features/bookings/Booker/components/EventMeta.d.ts.map +1 -1
  10. package/dist/packages/features/bookings/Booker/components/Header.d.ts.map +1 -1
  11. package/dist/packages/features/bookings/Booker/components/OverlayCalendar/OverlayCalendar.d.ts.map +1 -1
  12. package/dist/packages/features/bookings/Booker/components/hooks/useBookings.d.ts +1 -1
  13. package/dist/packages/features/bookings/Booker/store.d.ts.map +1 -1
  14. package/dist/packages/features/bookings/Booker/utils/event.d.ts +39 -33
  15. package/dist/packages/features/bookings/Booker/utils/event.d.ts.map +1 -1
  16. package/dist/packages/features/bookings/lib/BookingEmailSmsHandler.d.ts +83 -0
  17. package/dist/packages/features/bookings/lib/BookingEmailSmsHandler.d.ts.map +1 -0
  18. package/dist/packages/features/bookings/lib/create-booking.d.ts +91 -91
  19. package/dist/packages/features/bookings/lib/create-recurring-booking.d.ts +91 -91
  20. package/dist/packages/features/bookings/lib/get-booking.d.ts +9 -9
  21. package/dist/packages/features/bookings/lib/getBookingToDelete.d.ts +40 -38
  22. package/dist/packages/features/bookings/lib/getBookingToDelete.d.ts.map +1 -1
  23. package/dist/packages/features/bookings/lib/getCalendarLinks.d.ts +41 -0
  24. package/dist/packages/features/bookings/lib/getCalendarLinks.d.ts.map +1 -0
  25. package/dist/packages/features/bookings/lib/getCalendarLinks.test.d.ts +2 -0
  26. package/dist/packages/features/bookings/lib/getCalendarLinks.test.d.ts.map +1 -0
  27. package/dist/packages/features/bookings/lib/handleBookingRequested.d.ts +16 -0
  28. package/dist/packages/features/bookings/lib/handleBookingRequested.d.ts.map +1 -1
  29. package/dist/packages/features/bookings/lib/handleCancelBooking.d.ts.map +1 -1
  30. package/dist/packages/features/bookings/lib/handleConfirmation.d.ts +1 -0
  31. package/dist/packages/features/bookings/lib/handleConfirmation.d.ts.map +1 -1
  32. package/dist/packages/features/bookings/lib/handleInternalNote.d.ts +2 -2
  33. package/dist/packages/features/bookings/lib/handleNewBooking/createBooking.d.ts +33 -33
  34. package/dist/packages/features/bookings/lib/handleNewBooking/ensureAvailableUsers.d.ts +57 -57
  35. package/dist/packages/features/bookings/lib/handleNewBooking/getEventType.d.ts +60 -57
  36. package/dist/packages/features/bookings/lib/handleNewBooking/getEventType.d.ts.map +1 -1
  37. package/dist/packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.d.ts +57 -57
  38. package/dist/packages/features/bookings/lib/handleNewBooking/loadUsers.d.ts +46 -46
  39. package/dist/packages/features/bookings/lib/handleNewBooking/originalRescheduledBookingUtils.d.ts +45 -45
  40. package/dist/packages/features/bookings/lib/handleNewBooking/scheduleNoShowTriggers.d.ts +1 -0
  41. package/dist/packages/features/bookings/lib/handleNewBooking/scheduleNoShowTriggers.d.ts.map +1 -1
  42. package/dist/packages/features/bookings/lib/handleNewBooking.d.ts +364 -364
  43. package/dist/packages/features/bookings/lib/handleNewBooking.d.ts.map +1 -1
  44. package/dist/packages/features/bookings/lib/handlePayment.d.ts +49 -0
  45. package/dist/packages/features/bookings/lib/handlePayment.d.ts.map +1 -0
  46. package/dist/packages/features/bookings/lib/handleSeats/create/createNewSeat.d.ts +33 -33
  47. package/dist/packages/features/bookings/lib/handleSeats/create/createNewSeat.d.ts.map +1 -1
  48. package/dist/packages/features/bookings/lib/handleSeats/handleSeats.d.ts.map +1 -1
  49. package/dist/packages/features/bookings/lib/handleSeats/reschedule/owner/ownerRescheduleSeatedBooking.d.ts +33 -33
  50. package/dist/packages/features/bookings/lib/requiresConfirmation/getBookingRequest.d.ts +39 -39
  51. package/dist/packages/features/components/controlled-dialog/index.d.ts.map +1 -1
  52. package/dist/packages/features/components/phone-input/PhoneInput.d.ts.map +1 -1
  53. package/dist/packages/features/ee/billing/api/webhook/_customer.subscription.updated.d.ts +2 -1
  54. package/dist/packages/features/ee/billing/api/webhook/_customer.subscription.updated.d.ts.map +1 -1
  55. package/dist/packages/features/ee/billing/credit-service.d.ts +5 -1
  56. package/dist/packages/features/ee/billing/credit-service.d.ts.map +1 -1
  57. package/dist/packages/features/ee/billing/organizations/index.d.ts +1 -2
  58. package/dist/packages/features/ee/billing/organizations/index.d.ts.map +1 -1
  59. package/dist/packages/features/ee/billing/organizations/internal-organization-billing.d.ts +2 -2
  60. package/dist/packages/features/ee/billing/organizations/organization-billing.repository.d.ts +32 -4
  61. package/dist/packages/features/ee/billing/organizations/organization-billing.repository.d.ts.map +1 -1
  62. package/dist/packages/features/ee/payments/server/stripe-service.d.ts +23 -0
  63. package/dist/packages/features/ee/payments/server/stripe-service.d.ts.map +1 -0
  64. package/dist/packages/features/ee/round-robin/lib/bookingLocationService.d.ts +125 -0
  65. package/dist/packages/features/ee/round-robin/lib/bookingLocationService.d.ts.map +1 -0
  66. package/dist/packages/features/ee/round-robin/lib/bookingLocationService.test.d.ts +2 -0
  67. package/dist/packages/features/ee/round-robin/lib/bookingLocationService.test.d.ts.map +1 -0
  68. package/dist/packages/features/ee/round-robin/roundRobinManualReassignment.d.ts +30 -30
  69. package/dist/packages/features/ee/round-robin/roundRobinManualReassignment.d.ts.map +1 -1
  70. package/dist/packages/features/ee/round-robin/roundRobinReassignment.d.ts.map +1 -1
  71. package/dist/packages/features/ee/workflows/api/scheduleEmailReminders.d.ts.map +1 -1
  72. package/dist/packages/features/ee/workflows/lib/constants.d.ts +3 -1
  73. package/dist/packages/features/ee/workflows/lib/constants.d.ts.map +1 -1
  74. package/dist/packages/features/ee/workflows/lib/getOptions.d.ts +1 -1
  75. package/dist/packages/features/ee/workflows/lib/reminders/emailReminderManager.d.ts +0 -3
  76. package/dist/packages/features/ee/workflows/lib/reminders/emailReminderManager.d.ts.map +1 -1
  77. package/dist/packages/features/ee/workflows/lib/reminders/reminderScheduler.d.ts +0 -3
  78. package/dist/packages/features/ee/workflows/lib/reminders/reminderScheduler.d.ts.map +1 -1
  79. package/dist/packages/features/ee/workflows/lib/reminders/scheduleMandatoryReminder.d.ts.map +1 -1
  80. package/dist/packages/features/ee/workflows/lib/reminders/smsReminderManager.d.ts.map +1 -1
  81. package/dist/packages/features/ee/workflows/lib/reminders/utils.d.ts.map +1 -1
  82. package/dist/packages/features/ee/workflows/lib/reminders/whatsappReminderManager.d.ts.map +1 -1
  83. package/dist/packages/features/ee/workflows/lib/repository/workflowReminder.d.ts +6 -6
  84. package/dist/packages/features/ee/workflows/lib/schema.d.ts +7 -2
  85. package/dist/packages/features/ee/workflows/lib/schema.d.ts.map +1 -1
  86. package/dist/packages/features/eventtypes/components/AddVerifiedEmail.d.ts +7 -0
  87. package/dist/packages/features/eventtypes/components/AddVerifiedEmail.d.ts.map +1 -0
  88. package/dist/packages/features/eventtypes/components/tabs/advanced/CustomEventTypeModal.d.ts +1 -1
  89. package/dist/packages/features/eventtypes/components/tabs/advanced/CustomEventTypeModal.d.ts.map +1 -1
  90. package/dist/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.d.ts.map +1 -1
  91. package/dist/packages/features/eventtypes/lib/eventNaming.d.ts +28 -0
  92. package/dist/packages/features/eventtypes/lib/eventNaming.d.ts.map +1 -0
  93. package/dist/packages/features/eventtypes/lib/eventNaming.test.d.ts +2 -0
  94. package/dist/packages/features/eventtypes/lib/eventNaming.test.d.ts.map +1 -0
  95. package/dist/packages/features/eventtypes/lib/getPublicEvent.d.ts +42 -33
  96. package/dist/packages/features/eventtypes/lib/getPublicEvent.d.ts.map +1 -1
  97. package/dist/packages/features/eventtypes/lib/getTeamEventType.d.ts +12 -12
  98. package/dist/packages/features/eventtypes/lib/types.d.ts +1 -1
  99. package/dist/packages/features/eventtypes/lib/types.d.ts.map +1 -1
  100. package/dist/packages/features/shell/user-dropdown/UserDropdown.d.ts +2 -2
  101. package/dist/packages/features/shell/user-dropdown/UserDropdown.d.ts.map +1 -1
  102. package/dist/packages/platform/atoms/event-types/hooks/useAddVerifiedEmail.d.ts +15 -0
  103. package/dist/packages/platform/atoms/event-types/hooks/useAddVerifiedEmail.d.ts.map +1 -0
  104. package/dist/packages/platform/atoms/event-types/hooks/useAtomEventTypeById.d.ts +20 -17
  105. package/dist/packages/platform/atoms/event-types/hooks/useAtomEventTypeById.d.ts.map +1 -1
  106. package/dist/packages/platform/atoms/event-types/hooks/useEventTypeForm.d.ts.map +1 -1
  107. package/dist/packages/platform/atoms/event-types/hooks/useGetVerifiedEmails.d.ts +3 -0
  108. package/dist/packages/platform/atoms/event-types/hooks/useGetVerifiedEmails.d.ts.map +1 -0
  109. package/dist/packages/platform/atoms/event-types/wrappers/EventAdvancedPlatformWrapper.d.ts.map +1 -1
  110. package/dist/packages/platform/atoms/event-types/wrappers/EventTypePlatformWrapper.d.ts.map +1 -1
  111. package/dist/packages/platform/atoms/hooks/bookings/useCreateBooking.d.ts +91 -91
  112. package/dist/packages/platform/atoms/hooks/bookings/useCreateInstantBooking.d.ts +91 -91
  113. package/dist/packages/platform/atoms/hooks/bookings/useCreateRecurringBooking.d.ts +91 -91
  114. package/dist/packages/platform/atoms/hooks/bookings/useGetBookingForReschedule.d.ts +3 -3
  115. package/dist/packages/platform/atoms/hooks/bookings/useHandleBookEvent.d.ts.map +1 -1
  116. package/dist/packages/platform/atoms/hooks/event-types/public/useAtomGetPublicEvent.d.ts +39 -33
  117. package/dist/packages/platform/atoms/hooks/event-types/public/useAtomGetPublicEvent.d.ts.map +1 -1
  118. package/dist/packages/platform/atoms/hooks/schedules/useAtomSchedule.d.ts +3 -3
  119. package/dist/packages/platform/atoms/hooks/schedules/useAtomUpdateSchedule.d.ts +3 -3
  120. package/dist/packages/platform/atoms/hooks/useConnectedCalendars.d.ts.map +1 -1
  121. package/dist/packages/platform/atoms/index.d.ts +0 -36
  122. package/dist/packages/platform/atoms/index.d.ts.map +1 -1
  123. package/dist/packages/platform/atoms/lib/appendClientIdToEmail.d.ts +2 -0
  124. package/dist/packages/platform/atoms/lib/appendClientIdToEmail.d.ts.map +1 -0
  125. package/dist/packages/platform/libraries/event-types.d.ts +5 -5
  126. package/dist/packages/platform/libraries/event-types.d.ts.map +1 -1
  127. package/dist/packages/platform/libraries/index.d.ts +4 -6
  128. package/dist/packages/platform/libraries/index.d.ts.map +1 -1
  129. package/dist/packages/prisma/zod/creditexpenselog.d.ts +6 -0
  130. package/dist/packages/prisma/zod/creditexpenselog.d.ts.map +1 -1
  131. package/dist/packages/prisma/zod/impersonations.d.ts +2 -2
  132. package/dist/packages/prisma/zod/ratelimit.d.ts +2 -2
  133. package/dist/packages/prisma/zod/task.d.ts +2 -2
  134. package/dist/packages/prisma/zod/teamfeatures.d.ts +2 -2
  135. package/dist/packages/prisma/zod/userfeatures.d.ts +2 -2
  136. package/dist/packages/prisma/zod/webhookscheduledtriggers.d.ts +2 -2
  137. package/dist/packages/prisma/zod/workflow.d.ts +7 -2
  138. package/dist/packages/prisma/zod/workflow.d.ts.map +1 -1
  139. package/dist/packages/prisma/zod-utils.d.ts +52 -0
  140. package/dist/packages/prisma/zod-utils.d.ts.map +1 -1
  141. package/dist/packages/prisma-client/index.d.ts +86 -1
  142. package/dist/packages/trpc/react/hooks/useMeQuery.d.ts +2 -2
  143. package/dist/packages/trpc/react/shared.d.ts +1 -1
  144. package/dist/packages/trpc/react/shared.d.ts.map +1 -1
  145. package/dist/packages/trpc/react/trpc.d.ts.map +1 -1
  146. package/dist/packages/trpc/server/routers/viewer/slots/util.d.ts.map +1 -1
  147. package/dist/style.css +1 -1
  148. package/package.json +1 -1
  149. package/dist/AppCard--JDiTUMU.js +0 -281
  150. package/dist/AppListCardPlatformWrapper-ncgLQL4r.js +0 -9
  151. package/dist/AppListCardWebWrapper-YnM7-ccd.js +0 -74
  152. package/dist/AppSettingsInterface-EvAriEj2.js +0 -23
  153. package/dist/AppSettingsInterface-OGwTTVN7.js +0 -29
  154. package/dist/AppSettingsInterface-_WywrNHs.js +0 -75
  155. package/dist/DateRangePicker-m_y_P8tk.js +0 -74
  156. package/dist/EventTypeAppCardInterface--74geeRF.js +0 -39
  157. package/dist/EventTypeAppCardInterface--UDAdk0r.js +0 -24
  158. package/dist/EventTypeAppCardInterface-2Q1qvV5K.js +0 -32
  159. package/dist/EventTypeAppCardInterface-2r4pxyRt.js +0 -34
  160. package/dist/EventTypeAppCardInterface-3T7Bcarm.js +0 -31
  161. package/dist/EventTypeAppCardInterface-EPHC3SF7.js +0 -24
  162. package/dist/EventTypeAppCardInterface-G3OAa6sU.js +0 -41
  163. package/dist/EventTypeAppCardInterface-JQgzokgl.js +0 -32
  164. package/dist/EventTypeAppCardInterface-KDalRazj.js +0 -34
  165. package/dist/EventTypeAppCardInterface-LvigpfyE.js +0 -49
  166. package/dist/EventTypeAppCardInterface-MIro_wur.js +0 -33
  167. package/dist/EventTypeAppCardInterface-Na5tUt6e.js +0 -34
  168. package/dist/EventTypeAppCardInterface-O0yLol5y.js +0 -34
  169. package/dist/EventTypeAppCardInterface-R8-Y-hSu.js +0 -39
  170. package/dist/EventTypeAppCardInterface-YlTC8St1.js +0 -51
  171. package/dist/EventTypeAppCardInterface-_x7wFmBk.js +0 -24
  172. package/dist/EventTypeAppCardInterface-bNGYsiB0.js +0 -86
  173. package/dist/EventTypeAppCardInterface-d-rOMdsH.js +0 -34
  174. package/dist/EventTypeAppCardInterface-iHpJPDlc.js +0 -34
  175. package/dist/EventTypeAppCardInterface-jBTRuVkO.js +0 -51
  176. package/dist/EventTypeAppCardInterface-lXddHFhd.js +0 -41
  177. package/dist/EventTypeAppCardInterface-li1GK953.js +0 -858
  178. package/dist/EventTypeAppCardInterface-qO1PKt6x.js +0 -42
  179. package/dist/EventTypeAppCardInterface-rKAjvg4x.js +0 -24
  180. package/dist/EventTypeAppCardInterface-rV1vgpRv.js +0 -42
  181. package/dist/EventTypeAppCardInterface-sIqZFcBV.js +0 -34
  182. package/dist/EventTypeAppCardInterface-safQ0enm.js +0 -24
  183. package/dist/EventTypeAppSettingsInterface-7e1qbHi8.js +0 -24
  184. package/dist/EventTypeAppSettingsInterface-CLwwrZv6.js +0 -48
  185. package/dist/EventTypeAppSettingsInterface-CPvfqJkx.js +0 -221
  186. package/dist/EventTypeAppSettingsInterface-EZZkJrLi.js +0 -106
  187. package/dist/EventTypeAppSettingsInterface-JBpWa3pz.js +0 -298
  188. package/dist/EventTypeAppSettingsInterface-J_c1VzIk.js +0 -23
  189. package/dist/EventTypeAppSettingsInterface-K4kVWoog.js +0 -23
  190. package/dist/EventTypeAppSettingsInterface-LIn3bMv4.js +0 -25
  191. package/dist/EventTypeAppSettingsInterface-cbkdr04f.js +0 -42
  192. package/dist/EventTypeAppSettingsInterface-eejB8RJX.js +0 -43
  193. package/dist/EventTypeAppSettingsInterface-mOdk6pDR.js +0 -78
  194. package/dist/EventTypeAppSettingsInterface-vNhCP6vQ.js +0 -72
  195. package/dist/EventTypeAppSettingsInterface-xYWyd_Dz.js +0 -120
  196. package/dist/InstallAppButton-6HzB5_Be.js +0 -14
  197. package/dist/InstallAppButton-9sn2Jtoz.js +0 -14
  198. package/dist/InstallAppButton-J51NRgMF.js +0 -58
  199. package/dist/InstallAppButton-JXhBVaYJ.js +0 -29
  200. package/dist/StripePaymentForm-cXAJjJV3.js +0 -493
  201. package/dist/currencyOptions-kannG2hu.js +0 -61
  202. package/dist/index--iR_feQQ.js +0 -165254
  203. package/dist/index-XoFQv1cd.js +0 -518
  204. package/dist/index-tEqQSBcP.js +0 -28
  205. package/dist/useIsAppEnabled-C_9eRB94.js +0 -18
@@ -1,493 +0,0 @@
1
- import { jsxs as H, jsx as g } from "react/jsx-runtime";
2
- import f, { useState as R, useEffect as Z } from "react";
3
- import { ar as S, w as ee, b as Ce, B as G, W as Oe } from "./index--iR_feQQ.js";
4
- function Y(n, e) {
5
- var t = Object.keys(n);
6
- if (Object.getOwnPropertySymbols) {
7
- var r = Object.getOwnPropertySymbols(n);
8
- e && (r = r.filter(function(i) {
9
- return Object.getOwnPropertyDescriptor(n, i).enumerable;
10
- })), t.push.apply(t, r);
11
- }
12
- return t;
13
- }
14
- function V(n) {
15
- for (var e = 1; e < arguments.length; e++) {
16
- var t = arguments[e] != null ? arguments[e] : {};
17
- e % 2 ? Y(Object(t), !0).forEach(function(r) {
18
- te(n, r, t[r]);
19
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(t)) : Y(Object(t)).forEach(function(r) {
20
- Object.defineProperty(n, r, Object.getOwnPropertyDescriptor(t, r));
21
- });
22
- }
23
- return n;
24
- }
25
- function A(n) {
26
- "@babel/helpers - typeof";
27
- return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? A = function(e) {
28
- return typeof e;
29
- } : A = function(e) {
30
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
31
- }, A(n);
32
- }
33
- function te(n, e, t) {
34
- return e in n ? Object.defineProperty(n, e, {
35
- value: t,
36
- enumerable: !0,
37
- configurable: !0,
38
- writable: !0
39
- }) : n[e] = t, n;
40
- }
41
- function Pe(n, e) {
42
- return we(n) || je(n, e) || xe(n, e) || Ae();
43
- }
44
- function we(n) {
45
- if (Array.isArray(n))
46
- return n;
47
- }
48
- function je(n, e) {
49
- var t = n && (typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"]);
50
- if (t != null) {
51
- var r = [], i = !0, a = !1, d, l;
52
- try {
53
- for (t = t.call(n); !(i = (d = t.next()).done) && (r.push(d.value), !(e && r.length === e)); i = !0)
54
- ;
55
- } catch (o) {
56
- a = !0, l = o;
57
- } finally {
58
- try {
59
- !i && t.return != null && t.return();
60
- } finally {
61
- if (a)
62
- throw l;
63
- }
64
- }
65
- return r;
66
- }
67
- }
68
- function xe(n, e) {
69
- if (n) {
70
- if (typeof n == "string")
71
- return X(n, e);
72
- var t = Object.prototype.toString.call(n).slice(8, -1);
73
- if (t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set")
74
- return Array.from(n);
75
- if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
76
- return X(n, e);
77
- }
78
- }
79
- function X(n, e) {
80
- (e == null || e > n.length) && (e = n.length);
81
- for (var t = 0, r = new Array(e); t < e; t++)
82
- r[t] = n[t];
83
- return r;
84
- }
85
- function Ae() {
86
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
87
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
88
- }
89
- var B = function(e) {
90
- var t = f.useRef(e);
91
- return f.useEffect(function() {
92
- t.current = e;
93
- }, [e]), t.current;
94
- }, P = function(e) {
95
- return e !== null && A(e) === "object";
96
- }, Le = function(e) {
97
- return P(e) && typeof e.then == "function";
98
- }, Re = function(e) {
99
- return P(e) && typeof e.elements == "function" && typeof e.createToken == "function" && typeof e.createPaymentMethod == "function" && typeof e.confirmCardPayment == "function";
100
- }, z = "[object Object]", Ie = function n(e, t) {
101
- if (!P(e) || !P(t))
102
- return e === t;
103
- var r = Array.isArray(e), i = Array.isArray(t);
104
- if (r !== i)
105
- return !1;
106
- var a = Object.prototype.toString.call(e) === z, d = Object.prototype.toString.call(t) === z;
107
- if (a !== d)
108
- return !1;
109
- if (!a && !r)
110
- return e === t;
111
- var l = Object.keys(e), o = Object.keys(t);
112
- if (l.length !== o.length)
113
- return !1;
114
- for (var s = {}, c = 0; c < l.length; c += 1)
115
- s[l[c]] = !0;
116
- for (var y = 0; y < o.length; y += 1)
117
- s[o[y]] = !0;
118
- var u = Object.keys(s);
119
- if (u.length !== l.length)
120
- return !1;
121
- var b = e, _ = t, C = function(j) {
122
- return n(b[j], _[j]);
123
- };
124
- return u.every(C);
125
- }, ne = function(e, t, r) {
126
- return P(e) ? Object.keys(e).reduce(function(i, a) {
127
- var d = !P(t) || !Ie(e[a], t[a]);
128
- return r.includes(a) ? (d && console.warn("Unsupported prop change: options.".concat(a, " is not a mutable property.")), i) : d ? V(V({}, i || {}), {}, te({}, a, e[a])) : i;
129
- }, null) : null;
130
- }, ke = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", J = function(e) {
131
- if (e === null || Re(e))
132
- return e;
133
- throw new Error(ke);
134
- }, Ne = function(e) {
135
- if (Le(e))
136
- return {
137
- tag: "async",
138
- stripePromise: Promise.resolve(e).then(J)
139
- };
140
- var t = J(e);
141
- return t === null ? {
142
- tag: "empty"
143
- } : {
144
- tag: "sync",
145
- stripe: t
146
- };
147
- }, T = /* @__PURE__ */ f.createContext(null);
148
- T.displayName = "ElementsContext";
149
- var Be = function(e, t) {
150
- if (!e)
151
- throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t, " in an <Elements> provider."));
152
- return e;
153
- }, re = function(e) {
154
- var t = e.stripe, r = e.options, i = e.children, a = f.useMemo(function() {
155
- return Ne(t);
156
- }, [t]), d = f.useState(function() {
157
- return {
158
- stripe: a.tag === "sync" ? a.stripe : null,
159
- elements: a.tag === "sync" ? a.stripe.elements(r) : null
160
- };
161
- }), l = Pe(d, 2), o = l[0], s = l[1];
162
- f.useEffect(function() {
163
- var u = !0, b = function(C) {
164
- s(function(w) {
165
- return w.stripe ? w : {
166
- stripe: C,
167
- elements: C.elements(r)
168
- };
169
- });
170
- };
171
- return a.tag === "async" && !o.stripe ? a.stripePromise.then(function(_) {
172
- _ && u && b(_);
173
- }) : a.tag === "sync" && !o.stripe && b(a.stripe), function() {
174
- u = !1;
175
- };
176
- }, [a, o, r]);
177
- var c = B(t);
178
- f.useEffect(function() {
179
- c !== null && c !== t && console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.");
180
- }, [c, t]);
181
- var y = B(r);
182
- return f.useEffect(function() {
183
- if (o.elements) {
184
- var u = ne(r, y, ["clientSecret", "fonts"]);
185
- u && o.elements.update(u);
186
- }
187
- }, [r, y, o.elements]), f.useEffect(function() {
188
- var u = o.stripe;
189
- !u || !u._registerWrapper || !u.registerAppInfo || (u._registerWrapper({
190
- name: "react-stripe-js",
191
- version: "1.10.0"
192
- }), u.registerAppInfo({
193
- name: "react-stripe-js",
194
- version: "1.10.0",
195
- url: "https://stripe.com/docs/stripe-js/react"
196
- }));
197
- }, [o.stripe]), /* @__PURE__ */ f.createElement(T.Provider, {
198
- value: o
199
- }, i);
200
- };
201
- re.propTypes = {
202
- stripe: S.any,
203
- options: S.object
204
- };
205
- var I = function(e) {
206
- var t = f.useContext(T);
207
- return Be(t, e);
208
- }, Te = function() {
209
- var e = I("calls useElements()"), t = e.elements;
210
- return t;
211
- }, $e = function() {
212
- var e = I("calls useStripe()"), t = e.stripe;
213
- return t;
214
- };
215
- S.func.isRequired;
216
- var h = function(e) {
217
- var t = f.useRef(e);
218
- return f.useEffect(function() {
219
- t.current = e;
220
- }, [e]), function() {
221
- t.current && t.current.apply(t, arguments);
222
- };
223
- }, E = function() {
224
- }, Ue = function(e) {
225
- return e.charAt(0).toUpperCase() + e.slice(1);
226
- }, p = function(e, t) {
227
- var r = "".concat(Ue(e), "Element"), i = function(o) {
228
- var s = o.id, c = o.className, y = o.options, u = y === void 0 ? {} : y, b = o.onBlur, _ = b === void 0 ? E : b, C = o.onFocus, w = C === void 0 ? E : C, j = o.onReady, ce = j === void 0 ? E : j, U = o.onChange, ue = U === void 0 ? E : U, W = o.onEscape, le = W === void 0 ? E : W, F = o.onClick, fe = F === void 0 ? E : F, D = o.onLoadError, de = D === void 0 ? E : D, q = o.onLoaderStart, pe = q === void 0 ? E : q, me = I("mounts <".concat(r, ">")), M = me.elements, O = f.useRef(null), k = f.useRef(null), ye = h(ce), ve = h(_), ge = h(w), Se = h(fe), be = h(ue), he = h(le), Ee = h(de), _e = h(pe);
229
- f.useLayoutEffect(function() {
230
- if (O.current == null && M && k.current != null) {
231
- var v = M.create(e, u);
232
- O.current = v, v.mount(k.current), v.on("ready", function() {
233
- return ye(v);
234
- }), v.on("change", be), v.on("blur", ve), v.on("focus", ge), v.on("escape", he), v.on("loaderror", Ee), v.on("loaderstart", _e), v.on("click", Se);
235
- }
236
- });
237
- var K = B(u);
238
- return f.useEffect(function() {
239
- if (O.current) {
240
- var v = ne(u, K, ["paymentRequest"]);
241
- v && O.current.update(v);
242
- }
243
- }, [u, K]), f.useLayoutEffect(function() {
244
- return function() {
245
- O.current && (O.current.destroy(), O.current = null);
246
- };
247
- }, []), /* @__PURE__ */ f.createElement("div", {
248
- id: s,
249
- className: c,
250
- ref: k
251
- });
252
- }, a = function(o) {
253
- I("mounts <".concat(r, ">"));
254
- var s = o.id, c = o.className;
255
- return /* @__PURE__ */ f.createElement("div", {
256
- id: s,
257
- className: c
258
- });
259
- }, d = t ? a : i;
260
- return d.propTypes = {
261
- id: S.string,
262
- className: S.string,
263
- onChange: S.func,
264
- onBlur: S.func,
265
- onFocus: S.func,
266
- onReady: S.func,
267
- onClick: S.func,
268
- onLoadError: S.func,
269
- onLoaderStart: S.func,
270
- options: S.object
271
- }, d.displayName = r, d.__elementType = e, d;
272
- }, m = typeof window > "u";
273
- p("auBankAccount", m);
274
- p("card", m);
275
- p("cardNumber", m);
276
- p("cardExpiry", m);
277
- p("cardCvc", m);
278
- p("fpxBank", m);
279
- p("iban", m);
280
- p("idealBank", m);
281
- p("p24Bank", m);
282
- p("epsBank", m);
283
- var We = p("payment", m);
284
- p("paymentRequestButton", m);
285
- p("linkAuthentication", m);
286
- p("shippingAddress", m);
287
- p("affirmMessage", m);
288
- p("afterpayClearpayMessage", m);
289
- var $ = {};
290
- Object.defineProperty($, "__esModule", { value: !0 });
291
- function L(n) {
292
- "@babel/helpers - typeof";
293
- return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? L = function(e) {
294
- return typeof e;
295
- } : L = function(e) {
296
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
297
- }, L(n);
298
- }
299
- var ae = "https://js.stripe.com/v3", Fe = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, Q = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", De = function() {
300
- for (var e = document.querySelectorAll('script[src^="'.concat(ae, '"]')), t = 0; t < e.length; t++) {
301
- var r = e[t];
302
- if (Fe.test(r.src))
303
- return r;
304
- }
305
- return null;
306
- }, qe = function(e) {
307
- var t = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", r = document.createElement("script");
308
- r.src = "".concat(ae).concat(t);
309
- var i = document.head || document.body;
310
- if (!i)
311
- throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
312
- return i.appendChild(r), r;
313
- }, Me = function(e, t) {
314
- !e || !e._registerWrapper || e._registerWrapper({
315
- name: "stripe-js",
316
- version: "1.35.0",
317
- startTime: t
318
- });
319
- }, x = null, Ke = function(e) {
320
- return x !== null || (x = new Promise(function(t, r) {
321
- if (typeof window > "u") {
322
- t(null);
323
- return;
324
- }
325
- if (window.Stripe && e && console.warn(Q), window.Stripe) {
326
- t(window.Stripe);
327
- return;
328
- }
329
- try {
330
- var i = De();
331
- i && e ? console.warn(Q) : i || (i = qe(e)), i.addEventListener("load", function() {
332
- window.Stripe ? t(window.Stripe) : r(new Error("Stripe.js not available"));
333
- }), i.addEventListener("error", function() {
334
- r(new Error("Failed to load Stripe.js"));
335
- });
336
- } catch (a) {
337
- r(a);
338
- return;
339
- }
340
- })), x;
341
- }, He = function(e, t, r) {
342
- if (e === null)
343
- return null;
344
- var i = e.apply(void 0, t);
345
- return Me(i, r), i;
346
- }, Ge = function(e) {
347
- var t = `invalid load parameters; expected object of shape
348
-
349
- {advancedFraudSignals: boolean}
350
-
351
- but received
352
-
353
- `.concat(JSON.stringify(e), `
354
- `);
355
- if (e === null || L(e) !== "object")
356
- throw new Error(t);
357
- if (Object.keys(e).length === 1 && typeof e.advancedFraudSignals == "boolean")
358
- return e;
359
- throw new Error(t);
360
- }, oe, ie = !1, se = function() {
361
- for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
362
- t[r] = arguments[r];
363
- ie = !0;
364
- var i = Date.now();
365
- return Ke(oe).then(function(a) {
366
- return He(a, t, i);
367
- });
368
- };
369
- se.setLoadParameters = function(n) {
370
- if (ie)
371
- throw new Error("You cannot change load parameters after calling loadStripe");
372
- oe = Ge(n);
373
- };
374
- $.loadStripe = se;
375
- var Ye = $;
376
- const Ve = process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY || "";
377
- let N;
378
- const Xe = (n) => (N || (N = Ye.loadStripe(
379
- n || Ve
380
- /* , {
381
- locale: "es-419" TODO: Handle multiple locales,
382
- } */
383
- )), N), ze = Xe, Je = (n) => {
384
- const { t: e, i18n: t } = ee(), { paymentOption: r, elements: i, state: a, onPaymentElementChange: d } = n, [l, o] = R(!1), [s, c] = R(r !== "HOLD"), y = l || !s || ["processing", "error"].includes(a.status), u = {
385
- layout: "accordion"
386
- };
387
- return Z(() => {
388
- i == null || i.update({ locale: t.language });
389
- }, [i, t.language]), /* @__PURE__ */ H("form", { id: "payment-form", className: "bg-subtle mt-4 rounded-md p-6", onSubmit: n.onSubmit, children: [
390
- /* @__PURE__ */ g("div", { children: /* @__PURE__ */ g(We, { options: u, onChange: (b) => d() }) }),
391
- r === "HOLD" && /* @__PURE__ */ g("div", { className: "bg-info mb-5 mt-2 rounded-md p-3", children: /* @__PURE__ */ g(
392
- Ce,
393
- {
394
- description: e("acknowledge_booking_no_show_fee", {
395
- amount: n.payment.amount / 100,
396
- formatParams: { amount: { currency: n.payment.currency } }
397
- }),
398
- onChange: (b) => c(b.target.checked),
399
- descriptionClassName: "text-info font-semibold"
400
- }
401
- ) }),
402
- /* @__PURE__ */ H("div", { className: "mt-2 flex justify-end space-x-2", children: [
403
- /* @__PURE__ */ g(
404
- G,
405
- {
406
- color: "minimal",
407
- disabled: y,
408
- id: "cancel",
409
- type: "button",
410
- loading: l,
411
- onClick: () => {
412
- o(!0), n.onCancel();
413
- },
414
- children: /* @__PURE__ */ g("span", { id: "button-text", children: e("cancel") })
415
- }
416
- ),
417
- /* @__PURE__ */ g(
418
- G,
419
- {
420
- type: "submit",
421
- disabled: y,
422
- loading: a.status === "processing",
423
- id: "submit",
424
- color: "secondary",
425
- children: /* @__PURE__ */ g("span", { id: "button-text", children: a.status === "processing" ? /* @__PURE__ */ g("div", { className: "spinner", id: "spinner" }) : e(r === "HOLD" ? "submit_card" : "pay_now") })
426
- }
427
- )
428
- ] }),
429
- a.status === "error" && /* @__PURE__ */ g("div", { className: "mt-4 text-center text-red-900 dark:text-gray-300", role: "alert", children: a.error.message })
430
- ] });
431
- }, Qe = (n) => {
432
- const { t: e } = ee(), t = Te(), r = n.payment.paymentOption, i = n.booking.attendees[0].email, a = $e(), [d, l] = R({ status: "idle" });
433
- return /* @__PURE__ */ g(
434
- Je,
435
- {
436
- ...n,
437
- elements: t,
438
- paymentOption: r,
439
- state: d,
440
- onSubmit: async (o) => {
441
- var y;
442
- if (o.preventDefault(), !a || !t)
443
- return;
444
- l({ status: "processing" });
445
- let s;
446
- const c = {
447
- uid: n.booking.uid,
448
- email: i
449
- };
450
- r === "HOLD" && "setupIntent" in n.payment.data ? (s = await a.confirmSetup({
451
- elements: t,
452
- redirect: "if_required"
453
- }), s.setupIntent && (c.payment_intent = s.setupIntent.id, c.payment_intent_client_secret = s.setupIntent.client_secret || void 0, c.redirect_status = s.setupIntent.status)) : r === "ON_BOOKING" && (s = await a.confirmPayment({
454
- elements: t,
455
- redirect: "if_required",
456
- confirmParams: {
457
- return_url: `${Oe}/booking/${c.uid}`
458
- }
459
- }), s.paymentIntent && (c.payment_intent = s.paymentIntent.id, c.payment_intent_client_secret = s.paymentIntent.client_secret || void 0, c.redirect_status = s.paymentIntent.status)), s != null && s.error ? l({
460
- status: "error",
461
- error: new Error(`Payment failed: ${s.error.message}`)
462
- }) : (l({ status: "idle" }), (y = n.onPaymentSuccess) == null || y.call(n, n), n.location && (n.location.includes("integration") ? c.location = e("web_conferencing_details_to_follow") : c.location = n.location));
463
- },
464
- onCancel: () => {
465
- var o;
466
- (o = n.onPaymentCancellation) == null || o.call(n, n);
467
- },
468
- onPaymentElementChange: () => {
469
- l({ status: "idle" });
470
- }
471
- }
472
- );
473
- }, nt = (n) => {
474
- const e = ze(n.payment.data.stripe_publishable_key), [t, r] = R("stripe");
475
- return Z(() => {
476
- document.documentElement.classList.contains("dark") && r("night");
477
- }, []), /* @__PURE__ */ g(
478
- re,
479
- {
480
- stripe: e,
481
- options: {
482
- clientSecret: n.clientSecret,
483
- appearance: {
484
- theme: t
485
- }
486
- },
487
- children: /* @__PURE__ */ g(Qe, { ...n })
488
- }
489
- );
490
- };
491
- export {
492
- nt as default
493
- };
@@ -1,61 +0,0 @@
1
- const e = [
2
- { label: "United States dollar", value: "USD" },
3
- { label: "Australian dollar", value: "AUD" },
4
- { label: "Brazilian real 2", value: "BRL" },
5
- { label: "Canadian dollar", value: "CAD" },
6
- { label: "Chinese Renmenbi 3", value: "CNY" },
7
- { label: "Czech koruna", value: "CZK" },
8
- { label: "Danish krone", value: "DKK" },
9
- { label: "Euro", value: "EUR" },
10
- { label: "Hong Kong dollar", value: "HKD" },
11
- { label: "Hungarian forint 1", value: "HUF" },
12
- { label: "Israeli new shekel", value: "ILS" },
13
- { label: "Japanese yen 1", value: "JPY" },
14
- { label: "Malaysian ringgit 3", value: "MYR" },
15
- { label: "Mexican peso", value: "MXN" },
16
- { label: "New Taiwan dollar 1", value: "TWD" },
17
- { label: "New Zealand dollar", value: "NZD" },
18
- { label: "Norwegian krone", value: "NOK" },
19
- { label: "Philippine peso", value: "PHP" },
20
- { label: "Polish złoty", value: "PLN" },
21
- { label: "Pound sterling", value: "GBP" },
22
- { label: "Russian ruble", value: "RUB" },
23
- { label: "Singapore dollar", value: "SGD" },
24
- { label: "Swedish krona", value: "SEK" },
25
- { label: "Swiss franc", value: "CHF" },
26
- { label: "Thai baht", value: "THB" }
27
- ], a = {
28
- USD: "$",
29
- AUD: "$",
30
- BRL: "R$",
31
- CAD: "$",
32
- CNY: "¥",
33
- CZK: "Kč",
34
- DKK: "kr",
35
- EUR: "€",
36
- HKD: "$",
37
- HUF: "Ft",
38
- ILS: "₪",
39
- JPY: "¥",
40
- MYR: "RM",
41
- MXN: "$",
42
- TWD: "$",
43
- NZD: "$",
44
- NOK: "kr",
45
- PHP: "₱",
46
- PLN: "zł",
47
- GBP: "£",
48
- RUB: "₽",
49
- SGD: "$",
50
- SEK: "kr",
51
- CHF: "Fr",
52
- THB: "฿"
53
- };
54
- function n(l) {
55
- return Object.keys(a).includes(l);
56
- }
57
- export {
58
- a,
59
- e as c,
60
- n as i
61
- };