@calcom/atoms 2.3.7-fixup → 2.3.7-fixup-1

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 (65) hide show
  1. package/dist/{AddressInput-Bh-C8Iqa.js → AddressInput-ChrEOlMO.js} +1 -1
  2. package/dist/{AlbyPriceComponent-BP1N6jYu.js → AlbyPriceComponent-D3ifyxvQ.js} +1 -1
  3. package/dist/{AppCard-CNwqEjUt.js → AppCard-Bnx8PyD-.js} +1 -1
  4. package/dist/{AppListCardPlatformWrapper-DB9SlTnM.js → AppListCardPlatformWrapper-D54gFhln.js} +1 -1
  5. package/dist/{AppListCardWebWrapper-CDf9y1Dc.js → AppListCardWebWrapper-SJ5aYvnw.js} +1 -1
  6. package/dist/{AppSettingsInterface-Cp-dp1jc.js → AppSettingsInterface-7Yodrpy1.js} +1 -1
  7. package/dist/{AppSettingsInterface-pbq0qnPI.js → AppSettingsInterface-BgKHkFIh.js} +1 -1
  8. package/dist/{AppSettingsInterface-E0eqaH0n.js → AppSettingsInterface-C2wk8sg9.js} +1 -1
  9. package/dist/{DateRangePicker-DEYP9zG0.js → DateRangePicker-D6d-fTwN.js} +1 -1
  10. package/dist/{EventTypeAppCardInterface-CPcFpQ3c.js → EventTypeAppCardInterface--q-rDVfk.js} +3 -3
  11. package/dist/{EventTypeAppCardInterface-D332WS0S.js → EventTypeAppCardInterface-5VUq1O85.js} +3 -3
  12. package/dist/{EventTypeAppCardInterface-15RU6zBB.js → EventTypeAppCardInterface-B002JZB5.js} +4 -4
  13. package/dist/{EventTypeAppCardInterface-BJQpJXaS.js → EventTypeAppCardInterface-BJl9Wp7G.js} +4 -4
  14. package/dist/{EventTypeAppCardInterface-BTyc6XQV.js → EventTypeAppCardInterface-BOH6GKDM.js} +4 -4
  15. package/dist/{EventTypeAppCardInterface-QWdHCADl.js → EventTypeAppCardInterface-BczCNooX.js} +2 -2
  16. package/dist/{EventTypeAppCardInterface-MvDGrm97.js → EventTypeAppCardInterface-C1_WqOFN.js} +4 -4
  17. package/dist/{EventTypeAppCardInterface-CH3R5Yza.js → EventTypeAppCardInterface-C6Zb_BOz.js} +3 -3
  18. package/dist/{EventTypeAppCardInterface-DkAhmTh5.js → EventTypeAppCardInterface-C7-53_r-.js} +4 -4
  19. package/dist/{EventTypeAppCardInterface-B7z9bAe3.js → EventTypeAppCardInterface-CEaLeHwI.js} +4 -4
  20. package/dist/{EventTypeAppCardInterface-CS02mgy7.js → EventTypeAppCardInterface-CWsdiu1M.js} +3 -3
  21. package/dist/{EventTypeAppCardInterface-m8wkcC4S.js → EventTypeAppCardInterface-CkbJwtz4.js} +4 -4
  22. package/dist/{EventTypeAppCardInterface-B3qJJcKZ.js → EventTypeAppCardInterface-CypdnpwS.js} +3 -3
  23. package/dist/{EventTypeAppCardInterface-BtTfCLq9.js → EventTypeAppCardInterface-Cyw1HwrX.js} +2 -2
  24. package/dist/{EventTypeAppCardInterface-B6C4HQgj.js → EventTypeAppCardInterface-D1sq2FyS.js} +4 -4
  25. package/dist/{EventTypeAppCardInterface-DVhM61zx.js → EventTypeAppCardInterface-D2ab7G17.js} +4 -4
  26. package/dist/{EventTypeAppCardInterface-ClMGc4IK.js → EventTypeAppCardInterface-DA_6xDwJ.js} +3 -3
  27. package/dist/{EventTypeAppCardInterface-Bgmau-vd.js → EventTypeAppCardInterface-DJNEs3De.js} +4 -4
  28. package/dist/{EventTypeAppCardInterface-CKXTxo_h.js → EventTypeAppCardInterface-DQ0WwBqP.js} +3 -3
  29. package/dist/{EventTypeAppCardInterface-BAKqPVCo.js → EventTypeAppCardInterface-DZSBS-zk.js} +3 -3
  30. package/dist/{EventTypeAppCardInterface-C5qaKJqX.js → EventTypeAppCardInterface-DaLnUNBX.js} +3 -3
  31. package/dist/{EventTypeAppCardInterface-CMX5PU9O.js → EventTypeAppCardInterface-H8rKSMMe.js} +3 -3
  32. package/dist/{EventTypeAppCardInterface-CxysYyHB.js → EventTypeAppCardInterface-hRMntRPM.js} +3 -3
  33. package/dist/{EventTypeAppCardInterface-k8r3gQJS.js → EventTypeAppCardInterface-juXolJiA.js} +3 -3
  34. package/dist/{EventTypeAppCardInterface-DZvT8f3X.js → EventTypeAppCardInterface-rnYNaHvZ.js} +3 -3
  35. package/dist/{EventTypeAppCardInterface-DJ8HpQQx.js → EventTypeAppCardInterface-ryEna_o8.js} +3 -3
  36. package/dist/{EventTypeAppCardInterface-C_JaD9s-.js → EventTypeAppCardInterface-x0m8Gx9B.js} +4 -4
  37. package/dist/{EventTypeAppCardInterface-DloEhSq9.js → EventTypeAppCardInterface-yMfSgCM7.js} +3 -3
  38. package/dist/{EventTypeAppSettingsInterface-Cl-6S1B4.js → EventTypeAppSettingsInterface-B5vdtAWe.js} +1 -1
  39. package/dist/{EventTypeAppSettingsInterface-DKpU4mQI.js → EventTypeAppSettingsInterface-BIWiNPKv.js} +1 -1
  40. package/dist/{EventTypeAppSettingsInterface-03K9jUqd.js → EventTypeAppSettingsInterface-BdgHXAst.js} +1 -1
  41. package/dist/{EventTypeAppSettingsInterface-86cKMClC.js → EventTypeAppSettingsInterface-BiMxrrL4.js} +1 -1
  42. package/dist/{EventTypeAppSettingsInterface-DNG6aGCF.js → EventTypeAppSettingsInterface-BylQ_OGm.js} +1 -1
  43. package/dist/{EventTypeAppSettingsInterface-DtXqiTZs.js → EventTypeAppSettingsInterface-CEMPEVB8.js} +1 -1
  44. package/dist/{EventTypeAppSettingsInterface-A2AtCig3.js → EventTypeAppSettingsInterface-CRhaZp0b.js} +1 -1
  45. package/dist/{EventTypeAppSettingsInterface-C8NpK3Jm.js → EventTypeAppSettingsInterface-CiI6Mf1b.js} +1 -1
  46. package/dist/{EventTypeAppSettingsInterface-DYNKxCtx.js → EventTypeAppSettingsInterface-D-2AGPtv.js} +1 -1
  47. package/dist/{EventTypeAppSettingsInterface-Bljmd_Ei.js → EventTypeAppSettingsInterface-DHg3shLU.js} +1 -1
  48. package/dist/{EventTypeAppSettingsInterface-Bzljb-1g.js → EventTypeAppSettingsInterface-DLASXsiG.js} +1 -1
  49. package/dist/{EventTypeAppSettingsInterface-C3akFXfn.js → EventTypeAppSettingsInterface-DkKJjPl2.js} +1 -1
  50. package/dist/{EventTypeAppSettingsInterface-eOOmRa7o.js → EventTypeAppSettingsInterface-LlAeeT5d.js} +1 -1
  51. package/dist/{EventTypeAppSettingsInterface-BR8AGgBt.js → EventTypeAppSettingsInterface-vv4P2LrX.js} +1 -1
  52. package/dist/{EventTypeDescription-B6BdhcZ2.js → EventTypeDescription-a25sdTgA.js} +1 -1
  53. package/dist/{InstallAppButton-9erqRwiu.js → InstallAppButton-BObuzZKd.js} +1 -1
  54. package/dist/{InstallAppButton-BZodW4_D.js → InstallAppButton-DrF8md8g.js} +1 -1
  55. package/dist/{InstallAppButton-DgCWNEgB.js → InstallAppButton-ZLDX9vLj.js} +1 -1
  56. package/dist/{PhoneInput-nj5zJc5j.js → PhoneInput-BabPRASG.js} +1 -1
  57. package/dist/StripePaymentForm-Bha9OX4J.js +492 -0
  58. package/dist/cal-atoms.js +6 -6
  59. package/dist/{index-BawyuP19.js → index-CwlVE06V.js} +2 -2
  60. package/dist/{index-1hM9I9K9.js → index-eLgG4zd2.js} +110924 -88134
  61. package/dist/packages/platform/atoms/vite.config.d.ts.map +1 -1
  62. package/dist/{server.browser-ya82YPFu.js → server.browser-Dc9HKQ91.js} +1 -1
  63. package/dist/{useIsAppEnabled-BCbnkFD7.js → useIsAppEnabled-B-OOKpqX.js} +1 -1
  64. package/package.json +1 -1
  65. package/dist/StripePaymentForm-CdnHxdij.js +0 -551
@@ -0,0 +1,492 @@
1
+ import { jsxs as K, jsx as P } from "react/jsx-runtime";
2
+ import m, { useState as I, useEffect as ee } from "react";
3
+ import { aC as be, aH as he, o as te, a as Ee, B as G, W as _e } from "./index-eLgG4zd2.js";
4
+ var Pe = /* @__PURE__ */ he();
5
+ const C = /* @__PURE__ */ be(Pe);
6
+ function Y(t, e) {
7
+ var n = Object.keys(t);
8
+ if (Object.getOwnPropertySymbols) {
9
+ var a = Object.getOwnPropertySymbols(t);
10
+ e && (a = a.filter(function(s) {
11
+ return Object.getOwnPropertyDescriptor(t, s).enumerable;
12
+ })), n.push.apply(n, a);
13
+ }
14
+ return n;
15
+ }
16
+ function V(t) {
17
+ for (var e = 1; e < arguments.length; e++) {
18
+ var n = arguments[e] != null ? arguments[e] : {};
19
+ e % 2 ? Y(Object(n), !0).forEach(function(a) {
20
+ ne(t, a, n[a]);
21
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Y(Object(n)).forEach(function(a) {
22
+ Object.defineProperty(t, a, Object.getOwnPropertyDescriptor(n, a));
23
+ });
24
+ }
25
+ return t;
26
+ }
27
+ function R(t) {
28
+ "@babel/helpers - typeof";
29
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? R = function(e) {
30
+ return typeof e;
31
+ } : R = function(e) {
32
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
33
+ }, R(t);
34
+ }
35
+ function ne(t, e, n) {
36
+ return e in t ? Object.defineProperty(t, e, {
37
+ value: n,
38
+ enumerable: !0,
39
+ configurable: !0,
40
+ writable: !0
41
+ }) : t[e] = n, t;
42
+ }
43
+ function Ce(t, e) {
44
+ return Oe(t) || we(t, e) || je(t, e) || xe();
45
+ }
46
+ function Oe(t) {
47
+ if (Array.isArray(t)) return t;
48
+ }
49
+ function we(t, e) {
50
+ var n = t && (typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"]);
51
+ if (n != null) {
52
+ var a = [], s = !0, i = !1, f, u;
53
+ try {
54
+ for (n = n.call(t); !(s = (f = n.next()).done) && (a.push(f.value), !(e && a.length === e)); s = !0)
55
+ ;
56
+ } catch (r) {
57
+ i = !0, u = r;
58
+ } finally {
59
+ try {
60
+ !s && n.return != null && n.return();
61
+ } finally {
62
+ if (i) throw u;
63
+ }
64
+ }
65
+ return a;
66
+ }
67
+ }
68
+ function je(t, e) {
69
+ if (t) {
70
+ if (typeof t == "string") return X(t, e);
71
+ var n = Object.prototype.toString.call(t).slice(8, -1);
72
+ if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t);
73
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return X(t, e);
74
+ }
75
+ }
76
+ function X(t, e) {
77
+ (e == null || e > t.length) && (e = t.length);
78
+ for (var n = 0, a = new Array(e); n < e; n++) a[n] = t[n];
79
+ return a;
80
+ }
81
+ function xe() {
82
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
83
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
84
+ }
85
+ var $ = function(e) {
86
+ var n = m.useRef(e);
87
+ return m.useEffect(function() {
88
+ n.current = e;
89
+ }, [e]), n.current;
90
+ }, A = function(e) {
91
+ return e !== null && R(e) === "object";
92
+ }, Ae = function(e) {
93
+ return A(e) && typeof e.then == "function";
94
+ }, Le = function(e) {
95
+ return A(e) && typeof e.elements == "function" && typeof e.createToken == "function" && typeof e.createPaymentMethod == "function" && typeof e.confirmCardPayment == "function";
96
+ }, z = "[object Object]", Re = function t(e, n) {
97
+ if (!A(e) || !A(n))
98
+ return e === n;
99
+ var a = Array.isArray(e), s = Array.isArray(n);
100
+ if (a !== s) return !1;
101
+ var i = Object.prototype.toString.call(e) === z, f = Object.prototype.toString.call(n) === z;
102
+ if (i !== f) return !1;
103
+ if (!i && !a) return e === n;
104
+ var u = Object.keys(e), r = Object.keys(n);
105
+ if (u.length !== r.length) return !1;
106
+ for (var d = {}, v = 0; v < u.length; v += 1)
107
+ d[u[v]] = !0;
108
+ for (var b = 0; b < r.length; b += 1)
109
+ d[r[b]] = !0;
110
+ var l = Object.keys(d);
111
+ if (l.length !== u.length)
112
+ return !1;
113
+ var _ = e, y = n, o = function(p) {
114
+ return t(_[p], y[p]);
115
+ };
116
+ return l.every(o);
117
+ }, re = function(e, n, a) {
118
+ return A(e) ? Object.keys(e).reduce(function(s, i) {
119
+ var f = !A(n) || !Re(e[i], n[i]);
120
+ return a.includes(i) ? (f && console.warn("Unsupported prop change: options.".concat(i, " is not a mutable property.")), s) : f ? V(V({}, s || {}), {}, ne({}, i, e[i])) : s;
121
+ }, null) : null;
122
+ }, Ie = "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) {
123
+ if (e === null || Le(e))
124
+ return e;
125
+ throw new Error(Ie);
126
+ }, ke = function(e) {
127
+ if (Ae(e))
128
+ return {
129
+ tag: "async",
130
+ stripePromise: Promise.resolve(e).then(J)
131
+ };
132
+ var n = J(e);
133
+ return n === null ? {
134
+ tag: "empty"
135
+ } : {
136
+ tag: "sync",
137
+ stripe: n
138
+ };
139
+ }, U = /* @__PURE__ */ m.createContext(null);
140
+ U.displayName = "ElementsContext";
141
+ var Ne = function(e, n) {
142
+ if (!e)
143
+ throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(n, " in an <Elements> provider."));
144
+ return e;
145
+ }, ae = function(e) {
146
+ var n = e.stripe, a = e.options, s = e.children, i = m.useMemo(function() {
147
+ return ke(n);
148
+ }, [n]), f = m.useState(function() {
149
+ return {
150
+ stripe: i.tag === "sync" ? i.stripe : null,
151
+ elements: i.tag === "sync" ? i.stripe.elements(a) : null
152
+ };
153
+ }), u = Ce(f, 2), r = u[0], d = u[1];
154
+ m.useEffect(function() {
155
+ var l = !0, _ = function(o) {
156
+ d(function(c) {
157
+ return c.stripe ? c : {
158
+ stripe: o,
159
+ elements: o.elements(a)
160
+ };
161
+ });
162
+ };
163
+ return i.tag === "async" && !r.stripe ? i.stripePromise.then(function(y) {
164
+ y && l && _(y);
165
+ }) : i.tag === "sync" && !r.stripe && _(i.stripe), function() {
166
+ l = !1;
167
+ };
168
+ }, [i, r, a]);
169
+ var v = $(n);
170
+ m.useEffect(function() {
171
+ v !== null && v !== n && console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.");
172
+ }, [v, n]);
173
+ var b = $(a);
174
+ return m.useEffect(function() {
175
+ if (r.elements) {
176
+ var l = re(a, b, ["clientSecret", "fonts"]);
177
+ l && r.elements.update(l);
178
+ }
179
+ }, [a, b, r.elements]), m.useEffect(function() {
180
+ var l = r.stripe;
181
+ !l || !l._registerWrapper || !l.registerAppInfo || (l._registerWrapper({
182
+ name: "react-stripe-js",
183
+ version: "1.10.0"
184
+ }), l.registerAppInfo({
185
+ name: "react-stripe-js",
186
+ version: "1.10.0",
187
+ url: "https://stripe.com/docs/stripe-js/react"
188
+ }));
189
+ }, [r.stripe]), /* @__PURE__ */ m.createElement(U.Provider, {
190
+ value: r
191
+ }, s);
192
+ };
193
+ ae.propTypes = {
194
+ stripe: C.any,
195
+ options: C.object
196
+ };
197
+ var k = function(e) {
198
+ var n = m.useContext(U);
199
+ return Ne(n, e);
200
+ }, Te = function() {
201
+ var e = k("calls useElements()"), n = e.elements;
202
+ return n;
203
+ }, Be = function() {
204
+ var e = k("calls useStripe()"), n = e.stripe;
205
+ return n;
206
+ };
207
+ C.func.isRequired;
208
+ var O = function(e) {
209
+ var n = m.useRef(e);
210
+ return m.useEffect(function() {
211
+ n.current = e;
212
+ }, [e]), function() {
213
+ n.current && n.current.apply(n, arguments);
214
+ };
215
+ }, w = function() {
216
+ }, $e = function(e) {
217
+ return e.charAt(0).toUpperCase() + e.slice(1);
218
+ }, g = function(e, n) {
219
+ var a = "".concat($e(e), "Element"), s = function(r) {
220
+ var d = r.id, v = r.className, b = r.options, l = b === void 0 ? {} : b, _ = r.onBlur, y = _ === void 0 ? w : _, o = r.onFocus, c = o === void 0 ? w : o, p = r.onReady, h = p === void 0 ? w : p, x = r.onChange, oe = x === void 0 ? w : x, q = r.onEscape, ie = q === void 0 ? w : q, W = r.onClick, se = W === void 0 ? w : W, F = r.onLoadError, ue = F === void 0 ? w : F, D = r.onLoaderStart, ce = D === void 0 ? w : D, le = k("mounts <".concat(a, ">")), M = le.elements, j = m.useRef(null), N = m.useRef(null), fe = O(h), de = O(y), pe = O(c), me = O(se), ve = O(oe), ye = O(ie), ge = O(ue), Se = O(ce);
221
+ m.useLayoutEffect(function() {
222
+ if (j.current == null && M && N.current != null) {
223
+ var E = M.create(e, l);
224
+ j.current = E, E.mount(N.current), E.on("ready", function() {
225
+ return fe(E);
226
+ }), E.on("change", ve), E.on("blur", de), E.on("focus", pe), E.on("escape", ye), E.on("loaderror", ge), E.on("loaderstart", Se), E.on("click", me);
227
+ }
228
+ });
229
+ var H = $(l);
230
+ return m.useEffect(function() {
231
+ if (j.current) {
232
+ var E = re(l, H, ["paymentRequest"]);
233
+ E && j.current.update(E);
234
+ }
235
+ }, [l, H]), m.useLayoutEffect(function() {
236
+ return function() {
237
+ j.current && (j.current.destroy(), j.current = null);
238
+ };
239
+ }, []), /* @__PURE__ */ m.createElement("div", {
240
+ id: d,
241
+ className: v,
242
+ ref: N
243
+ });
244
+ }, i = function(r) {
245
+ k("mounts <".concat(a, ">"));
246
+ var d = r.id, v = r.className;
247
+ return /* @__PURE__ */ m.createElement("div", {
248
+ id: d,
249
+ className: v
250
+ });
251
+ }, f = n ? i : s;
252
+ return f.propTypes = {
253
+ id: C.string,
254
+ className: C.string,
255
+ onChange: C.func,
256
+ onBlur: C.func,
257
+ onFocus: C.func,
258
+ onReady: C.func,
259
+ onClick: C.func,
260
+ onLoadError: C.func,
261
+ onLoaderStart: C.func,
262
+ options: C.object
263
+ }, f.displayName = a, f.__elementType = e, f;
264
+ }, S = typeof window > "u";
265
+ g("auBankAccount", S);
266
+ g("card", S);
267
+ g("cardNumber", S);
268
+ g("cardExpiry", S);
269
+ g("cardCvc", S);
270
+ g("fpxBank", S);
271
+ g("iban", S);
272
+ g("idealBank", S);
273
+ g("p24Bank", S);
274
+ g("epsBank", S);
275
+ var Ue = g("payment", S);
276
+ g("paymentRequestButton", S);
277
+ g("linkAuthentication", S);
278
+ g("shippingAddress", S);
279
+ g("affirmMessage", S);
280
+ g("afterpayClearpayMessage", S);
281
+ var L = {}, Q;
282
+ function qe() {
283
+ if (Q) return L;
284
+ Q = 1, Object.defineProperty(L, "__esModule", { value: !0 });
285
+ function t(y) {
286
+ "@babel/helpers - typeof";
287
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? t = function(o) {
288
+ return typeof o;
289
+ } : t = function(o) {
290
+ return o && typeof Symbol == "function" && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
291
+ }, t(y);
292
+ }
293
+ var e = "https://js.stripe.com/v3", n = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, a = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", s = function() {
294
+ for (var o = document.querySelectorAll('script[src^="'.concat(e, '"]')), c = 0; c < o.length; c++) {
295
+ var p = o[c];
296
+ if (n.test(p.src))
297
+ return p;
298
+ }
299
+ return null;
300
+ }, i = function(o) {
301
+ var c = o && !o.advancedFraudSignals ? "?advancedFraudSignals=false" : "", p = document.createElement("script");
302
+ p.src = "".concat(e).concat(c);
303
+ var h = document.head || document.body;
304
+ if (!h)
305
+ throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
306
+ return h.appendChild(p), p;
307
+ }, f = function(o, c) {
308
+ !o || !o._registerWrapper || o._registerWrapper({
309
+ name: "stripe-js",
310
+ version: "1.35.0",
311
+ startTime: c
312
+ });
313
+ }, u = null, r = function(o) {
314
+ return u !== null || (u = new Promise(function(c, p) {
315
+ if (typeof window > "u") {
316
+ c(null);
317
+ return;
318
+ }
319
+ if (window.Stripe && o && console.warn(a), window.Stripe) {
320
+ c(window.Stripe);
321
+ return;
322
+ }
323
+ try {
324
+ var h = s();
325
+ h && o ? console.warn(a) : h || (h = i(o)), h.addEventListener("load", function() {
326
+ window.Stripe ? c(window.Stripe) : p(new Error("Stripe.js not available"));
327
+ }), h.addEventListener("error", function() {
328
+ p(new Error("Failed to load Stripe.js"));
329
+ });
330
+ } catch (x) {
331
+ p(x);
332
+ return;
333
+ }
334
+ })), u;
335
+ }, d = function(o, c, p) {
336
+ if (o === null)
337
+ return null;
338
+ var h = o.apply(void 0, c);
339
+ return f(h, p), h;
340
+ }, v = function(o) {
341
+ var c = `invalid load parameters; expected object of shape
342
+
343
+ {advancedFraudSignals: boolean}
344
+
345
+ but received
346
+
347
+ `.concat(JSON.stringify(o), `
348
+ `);
349
+ if (o === null || t(o) !== "object")
350
+ throw new Error(c);
351
+ if (Object.keys(o).length === 1 && typeof o.advancedFraudSignals == "boolean")
352
+ return o;
353
+ throw new Error(c);
354
+ }, b, l = !1, _ = function() {
355
+ for (var o = arguments.length, c = new Array(o), p = 0; p < o; p++)
356
+ c[p] = arguments[p];
357
+ l = !0;
358
+ var h = Date.now();
359
+ return r(b).then(function(x) {
360
+ return d(x, c, h);
361
+ });
362
+ };
363
+ return _.setLoadParameters = function(y) {
364
+ if (l)
365
+ throw new Error("You cannot change load parameters after calling loadStripe");
366
+ b = v(y);
367
+ }, L.loadStripe = _, L;
368
+ }
369
+ var T, Z;
370
+ function We() {
371
+ return Z || (Z = 1, T = qe()), T;
372
+ }
373
+ var Fe = We(), De = {};
374
+ const Me = De.NEXT_PUBLIC_STRIPE_PUBLIC_KEY || "";
375
+ let B;
376
+ const He = (t) => (B || (B = Fe.loadStripe(
377
+ t || Me
378
+ /* , {
379
+ locale: "es-419" TODO: Handle multiple locales,
380
+ } */
381
+ )), B), Ke = (t) => {
382
+ const { t: e, i18n: n } = te(), { paymentOption: a, elements: s, state: i, onPaymentElementChange: f } = t, [u, r] = I(!1), [d, v] = I(a !== "HOLD"), b = u || !d || ["processing", "error"].includes(i.status), l = {
383
+ layout: "accordion"
384
+ };
385
+ return ee(() => {
386
+ s == null || s.update({ locale: n.language });
387
+ }, [s, n.language]), /* @__PURE__ */ K("form", { id: "payment-form", className: "bg-subtle mt-4 rounded-md p-6", onSubmit: t.onSubmit, children: [
388
+ /* @__PURE__ */ P("div", { children: /* @__PURE__ */ P(Ue, { options: l, onChange: (_) => f() }) }),
389
+ a === "HOLD" && /* @__PURE__ */ P("div", { className: "bg-cal-info mb-5 mt-2 rounded-md p-3", children: /* @__PURE__ */ P(
390
+ Ee,
391
+ {
392
+ description: e("acknowledge_booking_no_show_fee", {
393
+ amount: t.payment.amount / 100,
394
+ formatParams: { amount: { currency: t.payment.currency } }
395
+ }),
396
+ onChange: (_) => v(_.target.checked),
397
+ descriptionClassName: "text-info font-semibold"
398
+ }
399
+ ) }),
400
+ /* @__PURE__ */ K("div", { className: "mt-2 flex justify-end space-x-2", children: [
401
+ /* @__PURE__ */ P(
402
+ G,
403
+ {
404
+ color: "minimal",
405
+ disabled: b,
406
+ id: "cancel",
407
+ type: "button",
408
+ loading: u,
409
+ onClick: () => {
410
+ r(!0), t.onCancel();
411
+ },
412
+ children: /* @__PURE__ */ P("span", { id: "button-text", children: e("cancel") })
413
+ }
414
+ ),
415
+ /* @__PURE__ */ P(
416
+ G,
417
+ {
418
+ type: "submit",
419
+ disabled: b,
420
+ loading: i.status === "processing",
421
+ id: "submit",
422
+ color: "secondary",
423
+ children: /* @__PURE__ */ P("span", { id: "button-text", children: i.status === "processing" ? /* @__PURE__ */ P("div", { className: "spinner", id: "spinner" }) : e(a === "HOLD" ? "submit_card" : "pay_now") })
424
+ }
425
+ )
426
+ ] }),
427
+ i.status === "error" && /* @__PURE__ */ P("div", { className: "mt-4 text-center text-red-900 dark:text-gray-300", role: "alert", children: i.error.message })
428
+ ] });
429
+ }, Ge = (t) => {
430
+ const { t: e } = te(), n = Te(), a = t.payment.paymentOption;
431
+ t.booking.attendees[0].email;
432
+ const s = Be(), [i, f] = I({ status: "idle" });
433
+ return /* @__PURE__ */ P(
434
+ Ke,
435
+ {
436
+ ...t,
437
+ elements: n,
438
+ paymentOption: a,
439
+ state: i,
440
+ onSubmit: async (u) => {
441
+ var v;
442
+ if (u.preventDefault(), !s || !n)
443
+ return;
444
+ f({ status: "processing" });
445
+ let r;
446
+ const d = {
447
+ uid: t.booking.uid
448
+ };
449
+ a === "HOLD" && "setupIntent" in t.payment.data ? (r = await s.confirmSetup({
450
+ elements: n,
451
+ redirect: "if_required"
452
+ }), r.setupIntent && (d.payment_intent = r.setupIntent.id, d.payment_intent_client_secret = r.setupIntent.client_secret || void 0, d.redirect_status = r.setupIntent.status)) : a === "ON_BOOKING" && (r = await s.confirmPayment({
453
+ elements: n,
454
+ redirect: "if_required",
455
+ confirmParams: {
456
+ return_url: `${_e}/booking/${d.uid}`
457
+ }
458
+ }), r.paymentIntent && (d.payment_intent = r.paymentIntent.id, d.payment_intent_client_secret = r.paymentIntent.client_secret || void 0, d.redirect_status = r.paymentIntent.status)), r != null && r.error ? f({
459
+ status: "error",
460
+ error: new Error(`Payment failed: ${r.error.message}`)
461
+ }) : (f({ status: "idle" }), (v = t.onPaymentSuccess) == null || v.call(t, t), t.location && (t.location.includes("integration") ? d.location = e("web_conferencing_details_to_follow") : d.location = t.location));
462
+ },
463
+ onCancel: () => {
464
+ var u;
465
+ (u = t.onPaymentCancellation) == null || u.call(t, t);
466
+ },
467
+ onPaymentElementChange: () => {
468
+ f({ status: "idle" });
469
+ }
470
+ }
471
+ );
472
+ }, ze = (t) => {
473
+ const e = He(t.payment.data.stripe_publishable_key), [n, a] = I("stripe");
474
+ return ee(() => {
475
+ document.documentElement.classList.contains("dark") && a("night");
476
+ }, []), /* @__PURE__ */ P(
477
+ ae,
478
+ {
479
+ stripe: e,
480
+ options: {
481
+ clientSecret: t.clientSecret,
482
+ appearance: {
483
+ theme: n
484
+ }
485
+ },
486
+ children: /* @__PURE__ */ P(Ge, { ...t })
487
+ }
488
+ );
489
+ };
490
+ export {
491
+ ze as default
492
+ };
package/dist/cal-atoms.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aH as s, aI as t, aJ as n, aK as o, aL as r, aM as i, aN as l, aO as u, aP as b, aQ as C, aR as d, aS as S, aT as c, aU as g, aV as v, aW as T, aX as p, aY as m, aZ as y, a_ as E, a$ as k, b0 as B, b1 as h, b2 as A, b3 as O, b4 as P, b5 as f, b6 as I, b7 as L, b8 as R, b9 as x, ba as z, bb as D, bc as F, bd as M, be as U, an as V, bf as j, bg as w, bh as G, bi as H, bj as J, bk as K } from "./index-1hM9I9K9.js";
1
+ import { aI as s, aJ as t, aK as n, aL as o, aM as r, aN as i, aO as l, aP as b, aQ as u, aR as C, aS as d, aT as S, aU as c, aV as g, aW as v, aX as T, aY as p, aZ as m, a_ as y, a$ as E, b0 as k, b1 as B, b2 as h, b3 as A, b4 as O, b5 as P, b6 as f, b7 as I, b8 as L, b9 as R, ba as x, bb as z, bc as D, bd as F, be as M, bf as U, an as V, bg as j, bh as w, bi as G, bj as J, bk as K, bl as N } from "./index-eLgG4zd2.js";
2
2
  export {
3
3
  s as AvailabilitySettings,
4
4
  t as Booker,
@@ -7,8 +7,8 @@ export {
7
7
  r as CalProvider,
8
8
  i as CalendarSettings,
9
9
  l as CalendarView,
10
- u as ConferencingAppsSettings,
11
- b as Connect,
10
+ b as ConferencingAppsSettings,
11
+ u as Connect,
12
12
  C as CreateEventType,
13
13
  d as CreateSchedule,
14
14
  S as CreateScheduleForm,
@@ -40,7 +40,7 @@ export {
40
40
  j as useMe,
41
41
  w as useOrganizationBookings,
42
42
  G as useOrganizationUserBookings,
43
- H as useRemoveSelectedCalendar,
44
- J as useTeamEventTypes,
45
- K as useTeams
43
+ J as useRemoveSelectedCalendar,
44
+ K as useTeamEventTypes,
45
+ N as useTeams
46
46
  };
@@ -1,5 +1,5 @@
1
- import { S as a } from "./index-1hM9I9K9.js";
2
- import { C as i, a as l, b as r, D as o, c, E as d, F as p, I as n, d as F, e as g, L as S, N as m, P as u, f as x, g as k, h as P, i as T, T as b, j as h, k as I, l as C, m as f, n as D } from "./index-1hM9I9K9.js";
1
+ import { S as a } from "./index-eLgG4zd2.js";
2
+ import { C as i, a as l, b as r, D as o, c, E as d, F as p, I as n, d as F, e as g, L as S, N as m, P as u, f as x, g as k, h as P, i as T, T as b, j as h, k as I, l as C, m as f, n as D } from "./index-eLgG4zd2.js";
3
3
  export {
4
4
  i as Checkbox,
5
5
  l as CheckboxField,