@calcom/atoms 2.1.0 → 2.2.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 (180) hide show
  1. package/dist/{AddressInput-YwzlZFoi.js → AddressInput-6bVKck2M.js} +1 -1
  2. package/dist/{AlbyPriceComponent-v2fPuAY6.js → AlbyPriceComponent-GfOmDB_O.js} +1 -1
  3. package/dist/{AppCard-DPKKflIA.js → AppCard-XVjVUT2T.js} +1 -1
  4. package/dist/{AppListCardPlatformWrapper-EXme9z8o.js → AppListCardPlatformWrapper-i7akxulv.js} +1 -1
  5. package/dist/{AppListCardWebWrapper-X8kbSc1m.js → AppListCardWebWrapper-dPeS1ok1.js} +1 -1
  6. package/dist/{AppSettingsInterface-NSwmUaIP.js → AppSettingsInterface-ETQ3qMkX.js} +1 -1
  7. package/dist/{AppSettingsInterface-BvLWVj0g.js → AppSettingsInterface-TrLEI6ni.js} +1 -1
  8. package/dist/{AppSettingsInterface-xgEJBfcc.js → AppSettingsInterface-ZA_4mY8_.js} +1 -1
  9. package/dist/{DateRangePicker-vJzutOv9.js → DateRangePicker-DQqNk0Jz.js} +1 -1
  10. package/dist/{EventTypeAppCardInterface-09hX4tar.js → EventTypeAppCardInterface-1Wyihj4E.js} +3 -3
  11. package/dist/{EventTypeAppCardInterface-WUYJXI9e.js → EventTypeAppCardInterface-6sq_fBN1.js} +4 -4
  12. package/dist/{EventTypeAppCardInterface-m8EiZT8Y.js → EventTypeAppCardInterface-CP8Elysz.js} +4 -4
  13. package/dist/{EventTypeAppCardInterface-ma8MREKX.js → EventTypeAppCardInterface-FLCpeKqZ.js} +4 -4
  14. package/dist/{EventTypeAppCardInterface-HshVnF7K.js → EventTypeAppCardInterface-M1n4NXFA.js} +3 -3
  15. package/dist/{EventTypeAppCardInterface-ICVMZGQi.js → EventTypeAppCardInterface-MdK8qkg-.js} +4 -4
  16. package/dist/EventTypeAppCardInterface-N8wGa45M.js +69 -0
  17. package/dist/{EventTypeAppCardInterface-Ufuez4NS.js → EventTypeAppCardInterface-Qplt4YLq.js} +2 -2
  18. package/dist/{EventTypeAppCardInterface-TJoJRcZf.js → EventTypeAppCardInterface-RHtdwd9a.js} +3 -3
  19. package/dist/{EventTypeAppCardInterface-LZESQcfF.js → EventTypeAppCardInterface-Uga0cNx6.js} +4 -4
  20. package/dist/{EventTypeAppCardInterface-GBBzPZX_.js → EventTypeAppCardInterface-XSG4xPHW.js} +3 -3
  21. package/dist/{EventTypeAppCardInterface-Wn6q_TLQ.js → EventTypeAppCardInterface-ZHgUOsc7.js} +3 -3
  22. package/dist/{EventTypeAppCardInterface-Orzxewv8.js → EventTypeAppCardInterface-b1u3_3R0.js} +4 -4
  23. package/dist/{EventTypeAppCardInterface-mg7bvmY6.js → EventTypeAppCardInterface-cc81lVyN.js} +4 -4
  24. package/dist/{EventTypeAppCardInterface-ZUCIbJ3F.js → EventTypeAppCardInterface-eycetC2V.js} +3 -3
  25. package/dist/{EventTypeAppCardInterface-JhpQqnNX.js → EventTypeAppCardInterface-nL-zlXJQ.js} +4 -4
  26. package/dist/{EventTypeAppCardInterface-_oQfYbc4.js → EventTypeAppCardInterface-oLxuW8Vd.js} +4 -4
  27. package/dist/{EventTypeAppCardInterface-Bd1BtNDj.js → EventTypeAppCardInterface-oZda5T7g.js} +3 -3
  28. package/dist/{EventTypeAppCardInterface-3jiOpP2y.js → EventTypeAppCardInterface-pIt_xj9c.js} +3 -3
  29. package/dist/{EventTypeAppCardInterface-GlbZ4hu8.js → EventTypeAppCardInterface-qcozX-yQ.js} +4 -4
  30. package/dist/{EventTypeAppCardInterface-i0ARNB0w.js → EventTypeAppCardInterface-tgHZw_9s.js} +3 -3
  31. package/dist/{EventTypeAppCardInterface-whbg5vSK.js → EventTypeAppCardInterface-toMtOVtA.js} +3 -3
  32. package/dist/{EventTypeAppCardInterface-mwRrVwW6.js → EventTypeAppCardInterface-ty37Eet2.js} +3 -3
  33. package/dist/{EventTypeAppCardInterface-ZNO40AJ9.js → EventTypeAppCardInterface-wOZWukpM.js} +2 -2
  34. package/dist/{EventTypeAppCardInterface-_QV0cMrn.js → EventTypeAppCardInterface-xdESsRSy.js} +3 -3
  35. package/dist/{EventTypeAppCardInterface-koqzBHWv.js → EventTypeAppCardInterface-xhl5HR0c.js} +4 -4
  36. package/dist/{EventTypeAppCardInterface-MxLOh6jA.js → EventTypeAppCardInterface-y79vOxtJ.js} +3 -3
  37. package/dist/{EventTypeAppCardInterface-0PfdVU5Y.js → EventTypeAppCardInterface-ygx1fj1H.js} +3 -3
  38. package/dist/{EventTypeAppSettingsInterface-LpytQF5N.js → EventTypeAppSettingsInterface-4A-o9k6K.js} +1 -1
  39. package/dist/{EventTypeAppSettingsInterface-c22O6YzI.js → EventTypeAppSettingsInterface-8Ydf4Kkr.js} +1 -1
  40. package/dist/{EventTypeAppSettingsInterface-zAFiQfxX.js → EventTypeAppSettingsInterface-99ISmKkW.js} +1 -1
  41. package/dist/{EventTypeAppSettingsInterface-PmsPQGH3.js → EventTypeAppSettingsInterface-EtvOWW0T.js} +1 -1
  42. package/dist/{EventTypeAppSettingsInterface-dLrUYMim.js → EventTypeAppSettingsInterface-LzkaglR0.js} +1 -1
  43. package/dist/{EventTypeAppSettingsInterface-wkUCA9Qv.js → EventTypeAppSettingsInterface-Ocx3MqcJ.js} +1 -1
  44. package/dist/{EventTypeAppSettingsInterface-fVBD2v9G.js → EventTypeAppSettingsInterface-VXarBLQW.js} +1 -1
  45. package/dist/{EventTypeAppSettingsInterface-9Y1irpa0.js → EventTypeAppSettingsInterface-_L8Wkfpq.js} +1 -1
  46. package/dist/{EventTypeAppSettingsInterface-MGTlOLPQ.js → EventTypeAppSettingsInterface-iF25p2gL.js} +1 -1
  47. package/dist/{EventTypeAppSettingsInterface-tsBm_RHA.js → EventTypeAppSettingsInterface-k25b3S_w.js} +1 -1
  48. package/dist/{EventTypeAppSettingsInterface-8AGnAK4X.js → EventTypeAppSettingsInterface-mxDLmxhf.js} +1 -1
  49. package/dist/{EventTypeAppSettingsInterface-MxDUN49P.js → EventTypeAppSettingsInterface-oyqECCFB.js} +1 -1
  50. package/dist/{EventTypeAppSettingsInterface-juDOdLlP.js → EventTypeAppSettingsInterface-qExeDjlG.js} +1 -1
  51. package/dist/{EventTypeAppSettingsInterface-tM-NXTvl.js → EventTypeAppSettingsInterface-xRSZJnRg.js} +1 -1
  52. package/dist/{InstallAppButton-EOhBKL7m.js → InstallAppButton-RTdjVmy9.js} +1 -1
  53. package/dist/{InstallAppButton-m9kNZ05d.js → InstallAppButton-ZoK0cieH.js} +1 -1
  54. package/dist/{InstallAppButton-XveriT6e.js → InstallAppButton-jnDe70lC.js} +1 -1
  55. package/dist/{PhoneInput-rVvdIejB.js → PhoneInput-KPIrpgU-.js} +1 -1
  56. package/dist/StripePaymentForm-R4ocdPBz.js +493 -0
  57. package/dist/cal-atoms.js +12 -12
  58. package/dist/{index-goVlMJuK.js → index-A4odhI08.js} +1 -1
  59. package/dist/{index-MEbSBQ6m.js → index-dVustuDq.js} +99137 -75869
  60. package/dist/{index-Hj2ocxM1.js → index-jM5C1qEC.js} +141 -243
  61. package/dist/{index-KPjOEROu.js → index-lr8mon7V.js} +1 -1
  62. package/dist/packages/features/bookings/Booker/components/EventMeta.d.ts.map +1 -1
  63. package/dist/packages/features/bookings/Booker/components/ScrollableWithGradients.d.ts +9 -0
  64. package/dist/packages/features/bookings/Booker/components/ScrollableWithGradients.d.ts.map +1 -0
  65. package/dist/packages/features/bookings/Booker/utils/event.d.ts +6 -0
  66. package/dist/packages/features/bookings/Booker/utils/event.d.ts.map +1 -1
  67. package/dist/packages/features/bookings/lib/get-booking.d.ts +6 -0
  68. package/dist/packages/features/bookings/lib/get-booking.d.ts.map +1 -1
  69. package/dist/packages/features/bookings/lib/getAllUserBookings.d.ts +2 -0
  70. package/dist/packages/features/bookings/lib/getAllUserBookings.d.ts.map +1 -1
  71. package/dist/packages/features/bookings/lib/getLuckyUser.d.ts +2 -2
  72. package/dist/packages/features/bookings/lib/getLuckyUser.d.ts.map +1 -1
  73. package/dist/packages/features/bookings/lib/handleConfirmation.d.ts +2 -0
  74. package/dist/packages/features/bookings/lib/handleConfirmation.d.ts.map +1 -1
  75. package/dist/packages/features/bookings/lib/handleNewBooking/ensureAvailableUsers.d.ts +2 -0
  76. package/dist/packages/features/bookings/lib/handleNewBooking/ensureAvailableUsers.d.ts.map +1 -1
  77. package/dist/packages/features/bookings/lib/handleNewBooking/getEventType.d.ts +5 -0
  78. package/dist/packages/features/bookings/lib/handleNewBooking/getEventType.d.ts.map +1 -1
  79. package/dist/packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.d.ts +2 -0
  80. package/dist/packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.d.ts.map +1 -1
  81. package/dist/packages/features/bookings/lib/handleNewBooking/loadUsers.d.ts.map +1 -1
  82. package/dist/packages/features/bookings/lib/handleNewBooking/originalRescheduledBookingUtils.d.ts +6 -0
  83. package/dist/packages/features/bookings/lib/handleNewBooking/originalRescheduledBookingUtils.d.ts.map +1 -1
  84. package/dist/packages/features/bookings/lib/handleSeats/handleSeats.d.ts.map +1 -1
  85. package/dist/packages/features/bookings/lib/handleWebhookTrigger.d.ts +2 -0
  86. package/dist/packages/features/bookings/lib/handleWebhookTrigger.d.ts.map +1 -1
  87. package/dist/packages/features/bookings/lib/payment/getBooking.d.ts +1 -0
  88. package/dist/packages/features/bookings/lib/payment/getBooking.d.ts.map +1 -1
  89. package/dist/packages/features/bookings/lib/reschedule/determineReschedulePreventionRedirect.d.ts +4 -0
  90. package/dist/packages/features/bookings/lib/reschedule/determineReschedulePreventionRedirect.d.ts.map +1 -1
  91. package/dist/packages/features/bookings/lib/reschedule/isWithinMinimumRescheduleNotice.d.ts +2 -0
  92. package/dist/packages/features/bookings/lib/reschedule/isWithinMinimumRescheduleNotice.d.ts.map +1 -0
  93. package/dist/packages/features/bookings/lib/service/RegularBookingService.d.ts.map +1 -1
  94. package/dist/packages/features/bookings/lib/types/actor.d.ts +15 -0
  95. package/dist/packages/features/bookings/lib/types/actor.d.ts.map +1 -1
  96. package/dist/packages/features/data-table/lib/parsers.d.ts +18 -18
  97. package/dist/packages/features/data-table/lib/serializers.d.ts +12 -12
  98. package/dist/packages/features/data-table/lib/types.d.ts +36 -36
  99. package/dist/packages/features/data-table/repositories/filterSegment.type.d.ts +96 -96
  100. package/dist/packages/features/ee/billing/api/webhook/_checkout.session.completed.d.ts +3 -0
  101. package/dist/packages/features/ee/billing/api/webhook/_checkout.session.completed.d.ts.map +1 -1
  102. package/dist/packages/features/ee/billing/constants.d.ts +1 -0
  103. package/dist/packages/features/ee/billing/constants.d.ts.map +1 -1
  104. package/dist/packages/features/ee/billing/di/modules/StripeClient.d.ts.map +1 -1
  105. package/dist/packages/features/ee/payments/api/webhook.d.ts +2 -1
  106. package/dist/packages/features/ee/payments/api/webhook.d.ts.map +1 -1
  107. package/dist/packages/features/ee/payments/pages/payment.d.ts +1 -0
  108. package/dist/packages/features/ee/payments/pages/payment.d.ts.map +1 -1
  109. package/dist/packages/features/ee/workflows/api/scheduleEmailReminders.d.ts.map +1 -1
  110. package/dist/packages/features/ee/workflows/lib/reminders/scheduleMandatoryReminder.d.ts +2 -0
  111. package/dist/packages/features/ee/workflows/lib/reminders/scheduleMandatoryReminder.d.ts.map +1 -1
  112. package/dist/packages/features/ee/workflows/lib/repository/workflowReminder.d.ts +9 -0
  113. package/dist/packages/features/ee/workflows/lib/repository/workflowReminder.d.ts.map +1 -1
  114. package/dist/packages/features/ee/workflows/repositories/WorkflowRepository.d.ts +2 -0
  115. package/dist/packages/features/ee/workflows/repositories/WorkflowRepository.d.ts.map +1 -1
  116. package/dist/packages/features/eventtypes/components/locations/CalVideoSettings.d.ts.map +1 -1
  117. package/dist/packages/features/eventtypes/components/tabs/advanced/DisableReschedulingController.d.ts +18 -0
  118. package/dist/packages/features/eventtypes/components/tabs/advanced/DisableReschedulingController.d.ts.map +1 -0
  119. package/dist/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.d.ts +2 -0
  120. package/dist/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.d.ts.map +1 -1
  121. package/dist/packages/features/eventtypes/hooks/useCreateEventType.d.ts +4 -0
  122. package/dist/packages/features/eventtypes/hooks/useCreateEventType.d.ts.map +1 -1
  123. package/dist/packages/features/eventtypes/lib/defaultEvents.d.ts +9 -0
  124. package/dist/packages/features/eventtypes/lib/defaultEvents.d.ts.map +1 -1
  125. package/dist/packages/features/eventtypes/lib/getEventTypeById.d.ts +4 -0
  126. package/dist/packages/features/eventtypes/lib/getEventTypeById.d.ts.map +1 -1
  127. package/dist/packages/features/eventtypes/lib/getEventTypesByViewer.d.ts +3 -0
  128. package/dist/packages/features/eventtypes/lib/getEventTypesByViewer.d.ts.map +1 -1
  129. package/dist/packages/features/eventtypes/lib/getEventTypesPublic.d.ts +1 -0
  130. package/dist/packages/features/eventtypes/lib/getEventTypesPublic.d.ts.map +1 -1
  131. package/dist/packages/features/eventtypes/lib/getPublicEvent.d.ts +11 -0
  132. package/dist/packages/features/eventtypes/lib/getPublicEvent.d.ts.map +1 -1
  133. package/dist/packages/features/eventtypes/lib/getTeamEventType.d.ts +1 -0
  134. package/dist/packages/features/eventtypes/lib/getTeamEventType.d.ts.map +1 -1
  135. package/dist/packages/features/eventtypes/lib/types.d.ts +11 -0
  136. package/dist/packages/features/eventtypes/lib/types.d.ts.map +1 -1
  137. package/dist/packages/features/eventtypes/repositories/EventRepository.d.ts +6 -0
  138. package/dist/packages/features/eventtypes/repositories/EventRepository.d.ts.map +1 -1
  139. package/dist/packages/features/eventtypes/repositories/__tests__/EventTypeRepository.test.d.ts +2 -0
  140. package/dist/packages/features/eventtypes/repositories/__tests__/EventTypeRepository.test.d.ts.map +1 -0
  141. package/dist/packages/features/eventtypes/repositories/eventTypeRepository.d.ts +35 -0
  142. package/dist/packages/features/eventtypes/repositories/eventTypeRepository.d.ts.map +1 -1
  143. package/dist/packages/kysely/types.d.ts +4 -0
  144. package/dist/packages/kysely/types.d.ts.map +1 -1
  145. package/dist/packages/platform/atoms/connect/conferencing-apps/hooks/useAtomBulkUpdateEventTypesToDefaultLocation.d.ts +1 -0
  146. package/dist/packages/platform/atoms/connect/conferencing-apps/hooks/useAtomBulkUpdateEventTypesToDefaultLocation.d.ts.map +1 -1
  147. package/dist/packages/platform/atoms/event-types/hooks/useAtomEventTypeById.d.ts +3 -0
  148. package/dist/packages/platform/atoms/event-types/hooks/useAtomEventTypeById.d.ts.map +1 -1
  149. package/dist/packages/platform/atoms/event-types/hooks/useAtomEventTypePaymentInfo.d.ts +1 -0
  150. package/dist/packages/platform/atoms/event-types/hooks/useAtomEventTypePaymentInfo.d.ts.map +1 -1
  151. package/dist/packages/platform/atoms/event-types/hooks/useAtomUpdateEventType.d.ts +3 -0
  152. package/dist/packages/platform/atoms/event-types/hooks/useAtomUpdateEventType.d.ts.map +1 -1
  153. package/dist/packages/platform/atoms/event-types/hooks/useEventTypeForm.d.ts.map +1 -1
  154. package/dist/packages/platform/atoms/hooks/bookings/useGetBookingForReschedule.d.ts +2 -0
  155. package/dist/packages/platform/atoms/hooks/bookings/useGetBookingForReschedule.d.ts.map +1 -1
  156. package/dist/packages/platform/atoms/hooks/event-types/private/useCreateEventType.d.ts +1 -0
  157. package/dist/packages/platform/atoms/hooks/event-types/private/useCreateEventType.d.ts.map +1 -1
  158. package/dist/packages/platform/atoms/hooks/event-types/private/useCreateTeamEventType.d.ts +1 -0
  159. package/dist/packages/platform/atoms/hooks/event-types/private/useCreateTeamEventType.d.ts.map +1 -1
  160. package/dist/packages/platform/atoms/hooks/event-types/private/useDeleteEventTypeById.d.ts +1 -0
  161. package/dist/packages/platform/atoms/hooks/event-types/private/useDeleteEventTypeById.d.ts.map +1 -1
  162. package/dist/packages/platform/atoms/hooks/event-types/public/useAtomGetPublicEvent.d.ts +6 -0
  163. package/dist/packages/platform/atoms/hooks/event-types/public/useAtomGetPublicEvent.d.ts.map +1 -1
  164. package/dist/packages/platform/atoms/vite.config.d.ts +1 -1
  165. package/dist/packages/platform/atoms/vite.config.d.ts.map +1 -1
  166. package/dist/packages/platform/libraries/repositories.d.ts +2 -2
  167. package/dist/packages/platform/libraries/repositories.d.ts.map +1 -1
  168. package/dist/packages/prisma/zod/inputTypeSchemas/EventTypeScalarFieldEnumSchema.d.ts +1 -1
  169. package/dist/packages/prisma/zod/inputTypeSchemas/EventTypeScalarFieldEnumSchema.d.ts.map +1 -1
  170. package/dist/packages/prisma/zod/modelSchema/EventTypeSchema.d.ts +11 -0
  171. package/dist/packages/prisma/zod/modelSchema/EventTypeSchema.d.ts.map +1 -1
  172. package/dist/packages/prisma/zod-utils.d.ts +18 -0
  173. package/dist/packages/prisma/zod-utils.d.ts.map +1 -1
  174. package/dist/packages/trpc/server/routers/viewer/slots/util.d.ts +9 -1
  175. package/dist/packages/trpc/server/routers/viewer/slots/util.d.ts.map +1 -1
  176. package/dist/{useIsAppEnabled-taEWsoZr.js → useIsAppEnabled-OQG85VSh.js} +1 -1
  177. package/package.json +1 -1
  178. package/dist/EventTypeAppCardInterface-LK7x4o4J.js +0 -48
  179. package/dist/StripePaymentForm-kEzDv9K9.js +0 -540
  180. package/dist/cal-atoms.umd.cjs +0 -656
@@ -1,540 +0,0 @@
1
- import { jsxs as K, jsx as g } from "react/jsx-runtime";
2
- import p, { useState as L, useEffect as Z } from "react";
3
- import { au as we, q as ee, b as xe, B as Y, W as je } from "./index-MEbSBQ6m.js";
4
- var te = { exports: {} }, Re = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED", Te = Re, Le = Te;
5
- function ne() {
6
- }
7
- function re() {
8
- }
9
- re.resetWarningCache = ne;
10
- var Ae = function() {
11
- function t(r, i, a, f, u, o) {
12
- if (o !== Le) {
13
- var s = new Error(
14
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
15
- );
16
- throw s.name = "Invariant Violation", s;
17
- }
18
- }
19
- t.isRequired = t;
20
- function e() {
21
- return t;
22
- }
23
- var n = {
24
- array: t,
25
- bigint: t,
26
- bool: t,
27
- func: t,
28
- number: t,
29
- object: t,
30
- string: t,
31
- symbol: t,
32
- any: t,
33
- arrayOf: e,
34
- element: t,
35
- elementType: t,
36
- instanceOf: e,
37
- node: t,
38
- objectOf: e,
39
- oneOf: e,
40
- oneOfType: e,
41
- shape: e,
42
- exact: e,
43
- checkPropTypes: re,
44
- resetWarningCache: ne
45
- };
46
- return n.PropTypes = n, n;
47
- };
48
- te.exports = Ae();
49
- var Ie = te.exports;
50
- const S = /* @__PURE__ */ we(Ie);
51
- function G(t, e) {
52
- var n = Object.keys(t);
53
- if (Object.getOwnPropertySymbols) {
54
- var r = Object.getOwnPropertySymbols(t);
55
- e && (r = r.filter(function(i) {
56
- return Object.getOwnPropertyDescriptor(t, i).enumerable;
57
- })), n.push.apply(n, r);
58
- }
59
- return n;
60
- }
61
- function V(t) {
62
- for (var e = 1; e < arguments.length; e++) {
63
- var n = arguments[e] != null ? arguments[e] : {};
64
- e % 2 ? G(Object(n), !0).forEach(function(r) {
65
- ae(t, r, n[r]);
66
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : G(Object(n)).forEach(function(r) {
67
- Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
68
- });
69
- }
70
- return t;
71
- }
72
- function R(t) {
73
- "@babel/helpers - typeof";
74
- return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? R = function(e) {
75
- return typeof e;
76
- } : R = function(e) {
77
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
78
- }, R(t);
79
- }
80
- function ae(t, e, n) {
81
- return e in t ? Object.defineProperty(t, e, {
82
- value: n,
83
- enumerable: !0,
84
- configurable: !0,
85
- writable: !0
86
- }) : t[e] = n, t;
87
- }
88
- function ke(t, e) {
89
- return Ne(t) || Be(t, e) || $e(t, e) || We();
90
- }
91
- function Ne(t) {
92
- if (Array.isArray(t))
93
- return t;
94
- }
95
- function Be(t, e) {
96
- var n = t && (typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]);
97
- if (n != null) {
98
- var r = [], i = !0, a = !1, f, u;
99
- try {
100
- for (n = n.call(t); !(i = (f = n.next()).done) && (r.push(f.value), !(e && r.length === e)); i = !0)
101
- ;
102
- } catch (o) {
103
- a = !0, u = o;
104
- } finally {
105
- try {
106
- !i && n.return != null && n.return();
107
- } finally {
108
- if (a)
109
- throw u;
110
- }
111
- }
112
- return r;
113
- }
114
- }
115
- function $e(t, e) {
116
- if (t) {
117
- if (typeof t == "string")
118
- return X(t, e);
119
- var n = Object.prototype.toString.call(t).slice(8, -1);
120
- if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set")
121
- return Array.from(t);
122
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
123
- return X(t, e);
124
- }
125
- }
126
- function X(t, e) {
127
- (e == null || e > t.length) && (e = t.length);
128
- for (var n = 0, r = new Array(e); n < e; n++)
129
- r[n] = t[n];
130
- return r;
131
- }
132
- function We() {
133
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
134
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
135
- }
136
- var N = function(e) {
137
- var n = p.useRef(e);
138
- return p.useEffect(function() {
139
- n.current = e;
140
- }, [e]), n.current;
141
- }, C = function(e) {
142
- return e !== null && R(e) === "object";
143
- }, Fe = function(e) {
144
- return C(e) && typeof e.then == "function";
145
- }, Ue = function(e) {
146
- return C(e) && typeof e.elements == "function" && typeof e.createToken == "function" && typeof e.createPaymentMethod == "function" && typeof e.confirmCardPayment == "function";
147
- }, z = "[object Object]", De = function t(e, n) {
148
- if (!C(e) || !C(n))
149
- return e === n;
150
- var r = Array.isArray(e), i = Array.isArray(n);
151
- if (r !== i)
152
- return !1;
153
- var a = Object.prototype.toString.call(e) === z, f = Object.prototype.toString.call(n) === z;
154
- if (a !== f)
155
- return !1;
156
- if (!a && !r)
157
- return e === n;
158
- var u = Object.keys(e), o = Object.keys(n);
159
- if (u.length !== o.length)
160
- return !1;
161
- for (var s = {}, c = 0; c < u.length; c += 1)
162
- s[u[c]] = !0;
163
- for (var y = 0; y < o.length; y += 1)
164
- s[o[y]] = !0;
165
- var l = Object.keys(s);
166
- if (l.length !== u.length)
167
- return !1;
168
- var h = e, _ = n, P = function(x) {
169
- return t(h[x], _[x]);
170
- };
171
- return l.every(P);
172
- }, oe = function(e, n, r) {
173
- return C(e) ? Object.keys(e).reduce(function(i, a) {
174
- var f = !C(n) || !De(e[a], n[a]);
175
- return r.includes(a) ? (f && console.warn("Unsupported prop change: options.".concat(a, " is not a mutable property.")), i) : f ? V(V({}, i || {}), {}, ae({}, a, e[a])) : i;
176
- }, null) : null;
177
- }, qe = "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) {
178
- if (e === null || Ue(e))
179
- return e;
180
- throw new Error(qe);
181
- }, Me = function(e) {
182
- if (Fe(e))
183
- return {
184
- tag: "async",
185
- stripePromise: Promise.resolve(e).then(J)
186
- };
187
- var n = J(e);
188
- return n === null ? {
189
- tag: "empty"
190
- } : {
191
- tag: "sync",
192
- stripe: n
193
- };
194
- }, B = /* @__PURE__ */ p.createContext(null);
195
- B.displayName = "ElementsContext";
196
- var He = function(e, n) {
197
- if (!e)
198
- throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(n, " in an <Elements> provider."));
199
- return e;
200
- }, ie = function(e) {
201
- var n = e.stripe, r = e.options, i = e.children, a = p.useMemo(function() {
202
- return Me(n);
203
- }, [n]), f = p.useState(function() {
204
- return {
205
- stripe: a.tag === "sync" ? a.stripe : null,
206
- elements: a.tag === "sync" ? a.stripe.elements(r) : null
207
- };
208
- }), u = ke(f, 2), o = u[0], s = u[1];
209
- p.useEffect(function() {
210
- var l = !0, h = function(P) {
211
- s(function(w) {
212
- return w.stripe ? w : {
213
- stripe: P,
214
- elements: P.elements(r)
215
- };
216
- });
217
- };
218
- return a.tag === "async" && !o.stripe ? a.stripePromise.then(function(_) {
219
- _ && l && h(_);
220
- }) : a.tag === "sync" && !o.stripe && h(a.stripe), function() {
221
- l = !1;
222
- };
223
- }, [a, o, r]);
224
- var c = N(n);
225
- p.useEffect(function() {
226
- c !== null && c !== n && console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.");
227
- }, [c, n]);
228
- var y = N(r);
229
- return p.useEffect(function() {
230
- if (o.elements) {
231
- var l = oe(r, y, ["clientSecret", "fonts"]);
232
- l && o.elements.update(l);
233
- }
234
- }, [r, y, o.elements]), p.useEffect(function() {
235
- var l = o.stripe;
236
- !l || !l._registerWrapper || !l.registerAppInfo || (l._registerWrapper({
237
- name: "react-stripe-js",
238
- version: "1.10.0"
239
- }), l.registerAppInfo({
240
- name: "react-stripe-js",
241
- version: "1.10.0",
242
- url: "https://stripe.com/docs/stripe-js/react"
243
- }));
244
- }, [o.stripe]), /* @__PURE__ */ p.createElement(B.Provider, {
245
- value: o
246
- }, i);
247
- };
248
- ie.propTypes = {
249
- stripe: S.any,
250
- options: S.object
251
- };
252
- var A = function(e) {
253
- var n = p.useContext(B);
254
- return He(n, e);
255
- }, Ke = function() {
256
- var e = A("calls useElements()"), n = e.elements;
257
- return n;
258
- }, Ye = function() {
259
- var e = A("calls useStripe()"), n = e.stripe;
260
- return n;
261
- };
262
- S.func.isRequired;
263
- var b = function(e) {
264
- var n = p.useRef(e);
265
- return p.useEffect(function() {
266
- n.current = e;
267
- }, [e]), function() {
268
- n.current && n.current.apply(n, arguments);
269
- };
270
- }, E = function() {
271
- }, Ge = function(e) {
272
- return e.charAt(0).toUpperCase() + e.slice(1);
273
- }, d = function(e, n) {
274
- var r = "".concat(Ge(e), "Element"), i = function(o) {
275
- var s = o.id, c = o.className, y = o.options, l = y === void 0 ? {} : y, h = o.onBlur, _ = h === void 0 ? E : h, P = o.onFocus, w = P === void 0 ? E : P, x = o.onReady, pe = x === void 0 ? E : x, W = o.onChange, fe = W === void 0 ? E : W, F = o.onEscape, de = F === void 0 ? E : F, U = o.onClick, me = U === void 0 ? E : U, D = o.onLoadError, ye = D === void 0 ? E : D, q = o.onLoaderStart, ve = q === void 0 ? E : q, ge = A("mounts <".concat(r, ">")), M = ge.elements, O = p.useRef(null), I = p.useRef(null), Se = b(pe), he = b(_), be = b(w), Ee = b(me), _e = b(fe), Pe = b(de), Oe = b(ye), Ce = b(ve);
276
- p.useLayoutEffect(function() {
277
- if (O.current == null && M && I.current != null) {
278
- var v = M.create(e, l);
279
- O.current = v, v.mount(I.current), v.on("ready", function() {
280
- return Se(v);
281
- }), v.on("change", _e), v.on("blur", he), v.on("focus", be), v.on("escape", Pe), v.on("loaderror", Oe), v.on("loaderstart", Ce), v.on("click", Ee);
282
- }
283
- });
284
- var H = N(l);
285
- return p.useEffect(function() {
286
- if (O.current) {
287
- var v = oe(l, H, ["paymentRequest"]);
288
- v && O.current.update(v);
289
- }
290
- }, [l, H]), p.useLayoutEffect(function() {
291
- return function() {
292
- O.current && (O.current.destroy(), O.current = null);
293
- };
294
- }, []), /* @__PURE__ */ p.createElement("div", {
295
- id: s,
296
- className: c,
297
- ref: I
298
- });
299
- }, a = function(o) {
300
- A("mounts <".concat(r, ">"));
301
- var s = o.id, c = o.className;
302
- return /* @__PURE__ */ p.createElement("div", {
303
- id: s,
304
- className: c
305
- });
306
- }, f = n ? a : i;
307
- return f.propTypes = {
308
- id: S.string,
309
- className: S.string,
310
- onChange: S.func,
311
- onBlur: S.func,
312
- onFocus: S.func,
313
- onReady: S.func,
314
- onClick: S.func,
315
- onLoadError: S.func,
316
- onLoaderStart: S.func,
317
- options: S.object
318
- }, f.displayName = r, f.__elementType = e, f;
319
- }, m = typeof window > "u";
320
- d("auBankAccount", m);
321
- d("card", m);
322
- d("cardNumber", m);
323
- d("cardExpiry", m);
324
- d("cardCvc", m);
325
- d("fpxBank", m);
326
- d("iban", m);
327
- d("idealBank", m);
328
- d("p24Bank", m);
329
- d("epsBank", m);
330
- var Ve = d("payment", m);
331
- d("paymentRequestButton", m);
332
- d("linkAuthentication", m);
333
- d("shippingAddress", m);
334
- d("affirmMessage", m);
335
- d("afterpayClearpayMessage", m);
336
- var $ = {};
337
- Object.defineProperty($, "__esModule", { value: !0 });
338
- function T(t) {
339
- "@babel/helpers - typeof";
340
- return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? T = function(e) {
341
- return typeof e;
342
- } : T = function(e) {
343
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
344
- }, T(t);
345
- }
346
- var se = "https://js.stripe.com/v3", Xe = /^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", ze = function() {
347
- for (var e = document.querySelectorAll('script[src^="'.concat(se, '"]')), n = 0; n < e.length; n++) {
348
- var r = e[n];
349
- if (Xe.test(r.src))
350
- return r;
351
- }
352
- return null;
353
- }, Je = function(e) {
354
- var n = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", r = document.createElement("script");
355
- r.src = "".concat(se).concat(n);
356
- var i = document.head || document.body;
357
- if (!i)
358
- throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
359
- return i.appendChild(r), r;
360
- }, Qe = function(e, n) {
361
- !e || !e._registerWrapper || e._registerWrapper({
362
- name: "stripe-js",
363
- version: "1.35.0",
364
- startTime: n
365
- });
366
- }, j = null, Ze = function(e) {
367
- return j !== null || (j = new Promise(function(n, r) {
368
- if (typeof window > "u") {
369
- n(null);
370
- return;
371
- }
372
- if (window.Stripe && e && console.warn(Q), window.Stripe) {
373
- n(window.Stripe);
374
- return;
375
- }
376
- try {
377
- var i = ze();
378
- i && e ? console.warn(Q) : i || (i = Je(e)), i.addEventListener("load", function() {
379
- window.Stripe ? n(window.Stripe) : r(new Error("Stripe.js not available"));
380
- }), i.addEventListener("error", function() {
381
- r(new Error("Failed to load Stripe.js"));
382
- });
383
- } catch (a) {
384
- r(a);
385
- return;
386
- }
387
- })), j;
388
- }, et = function(e, n, r) {
389
- if (e === null)
390
- return null;
391
- var i = e.apply(void 0, n);
392
- return Qe(i, r), i;
393
- }, tt = function(e) {
394
- var n = `invalid load parameters; expected object of shape
395
-
396
- {advancedFraudSignals: boolean}
397
-
398
- but received
399
-
400
- `.concat(JSON.stringify(e), `
401
- `);
402
- if (e === null || T(e) !== "object")
403
- throw new Error(n);
404
- if (Object.keys(e).length === 1 && typeof e.advancedFraudSignals == "boolean")
405
- return e;
406
- throw new Error(n);
407
- }, ce, ue = !1, le = function() {
408
- for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++)
409
- n[r] = arguments[r];
410
- ue = !0;
411
- var i = Date.now();
412
- return Ze(ce).then(function(a) {
413
- return et(a, n, i);
414
- });
415
- };
416
- le.setLoadParameters = function(t) {
417
- if (ue)
418
- throw new Error("You cannot change load parameters after calling loadStripe");
419
- ce = tt(t);
420
- };
421
- $.loadStripe = le;
422
- var nt = $, rt = {};
423
- const at = rt.NEXT_PUBLIC_STRIPE_PUBLIC_KEY || "";
424
- let k;
425
- const ot = (t) => (k || (k = nt.loadStripe(
426
- t || at
427
- /* , {
428
- locale: "es-419" TODO: Handle multiple locales,
429
- } */
430
- )), k), it = ot, st = (t) => {
431
- const { t: e, i18n: n } = ee(), { paymentOption: r, elements: i, state: a, onPaymentElementChange: f } = t, [u, o] = L(!1), [s, c] = L(r !== "HOLD"), y = u || !s || ["processing", "error"].includes(a.status), l = {
432
- layout: "accordion"
433
- };
434
- return Z(() => {
435
- i == null || i.update({ locale: n.language });
436
- }, [i, n.language]), /* @__PURE__ */ K("form", { id: "payment-form", className: "bg-subtle mt-4 rounded-md p-6", onSubmit: t.onSubmit, children: [
437
- /* @__PURE__ */ g("div", { children: /* @__PURE__ */ g(Ve, { options: l, onChange: (h) => f() }) }),
438
- r === "HOLD" && /* @__PURE__ */ g("div", { className: "bg-cal-info mb-5 mt-2 rounded-md p-3", children: /* @__PURE__ */ g(
439
- xe,
440
- {
441
- description: e("acknowledge_booking_no_show_fee", {
442
- amount: t.payment.amount / 100,
443
- formatParams: { amount: { currency: t.payment.currency } }
444
- }),
445
- onChange: (h) => c(h.target.checked),
446
- descriptionClassName: "text-info font-semibold"
447
- }
448
- ) }),
449
- /* @__PURE__ */ K("div", { className: "mt-2 flex justify-end space-x-2", children: [
450
- /* @__PURE__ */ g(
451
- Y,
452
- {
453
- color: "minimal",
454
- disabled: y,
455
- id: "cancel",
456
- type: "button",
457
- loading: u,
458
- onClick: () => {
459
- o(!0), t.onCancel();
460
- },
461
- children: /* @__PURE__ */ g("span", { id: "button-text", children: e("cancel") })
462
- }
463
- ),
464
- /* @__PURE__ */ g(
465
- Y,
466
- {
467
- type: "submit",
468
- disabled: y,
469
- loading: a.status === "processing",
470
- id: "submit",
471
- color: "secondary",
472
- 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") })
473
- }
474
- )
475
- ] }),
476
- a.status === "error" && /* @__PURE__ */ g("div", { className: "mt-4 text-center text-red-900 dark:text-gray-300", role: "alert", children: a.error.message })
477
- ] });
478
- }, ct = (t) => {
479
- const { t: e } = ee(), n = Ke(), r = t.payment.paymentOption, i = t.booking.attendees[0].email, a = Ye(), [f, u] = L({ status: "idle" });
480
- return /* @__PURE__ */ g(
481
- st,
482
- {
483
- ...t,
484
- elements: n,
485
- paymentOption: r,
486
- state: f,
487
- onSubmit: async (o) => {
488
- var y;
489
- if (o.preventDefault(), !a || !n)
490
- return;
491
- u({ status: "processing" });
492
- let s;
493
- const c = {
494
- uid: t.booking.uid,
495
- email: i
496
- };
497
- r === "HOLD" && "setupIntent" in t.payment.data ? (s = await a.confirmSetup({
498
- elements: n,
499
- redirect: "if_required"
500
- }), 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({
501
- elements: n,
502
- redirect: "if_required",
503
- confirmParams: {
504
- return_url: `${je}/booking/${c.uid}`
505
- }
506
- }), 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 ? u({
507
- status: "error",
508
- error: new Error(`Payment failed: ${s.error.message}`)
509
- }) : (u({ status: "idle" }), (y = t.onPaymentSuccess) == null || y.call(t, t), t.location && (t.location.includes("integration") ? c.location = e("web_conferencing_details_to_follow") : c.location = t.location));
510
- },
511
- onCancel: () => {
512
- var o;
513
- (o = t.onPaymentCancellation) == null || o.call(t, t);
514
- },
515
- onPaymentElementChange: () => {
516
- u({ status: "idle" });
517
- }
518
- }
519
- );
520
- }, ft = (t) => {
521
- const e = it(t.payment.data.stripe_publishable_key), [n, r] = L("stripe");
522
- return Z(() => {
523
- document.documentElement.classList.contains("dark") && r("night");
524
- }, []), /* @__PURE__ */ g(
525
- ie,
526
- {
527
- stripe: e,
528
- options: {
529
- clientSecret: t.clientSecret,
530
- appearance: {
531
- theme: n
532
- }
533
- },
534
- children: /* @__PURE__ */ g(ct, { ...t })
535
- }
536
- );
537
- };
538
- export {
539
- ft as default
540
- };