@calcom/atoms 1.1.2 → 1.2.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 (81) hide show
  1. package/dist/{AddressInput-cAznNQd3.js → AddressInput-_Diya_zo.js} +3 -3
  2. package/dist/{AlbyPriceComponent-oZ0IVf6c.js → AlbyPriceComponent-fIgFEUXN.js} +19 -19
  3. package/dist/{PhoneInput-eRYuhuju.js → PhoneInput-MNv3E3Ho.js} +1 -1
  4. package/dist/cal-atoms.js +5 -36
  5. package/dist/index-TYx-qK4G.js +83374 -0
  6. package/dist/{index-D-baW2SF.js → index-ghibukoV.js} +1 -1
  7. package/dist/index-mKRiKaF6.js +1957 -0
  8. package/dist/packages/features/bookings/lib/handleNewBooking/scheduleNoShowTriggers.integration-test.d.ts +2 -0
  9. package/dist/packages/features/bookings/lib/handleNewBooking/scheduleNoShowTriggers.integration-test.d.ts.map +1 -0
  10. package/dist/packages/features/eventtypes/components/CreateEventTypeForm.d.ts.map +1 -1
  11. package/dist/packages/features/eventtypes/components/tabs/setup/EventSetupTab.d.ts.map +1 -1
  12. package/dist/packages/platform/atoms/index.d.ts +0 -36
  13. package/dist/packages/platform/atoms/index.d.ts.map +1 -1
  14. package/dist/style.css +1 -1
  15. package/fonts/26a46d62cd723877-s.woff2 +0 -0
  16. package/fonts/55c55f0601d81cf3-s.woff2 +0 -0
  17. package/fonts/581909926a08bbc8-s.woff2 +0 -0
  18. package/fonts/6d93bde91c0c2823-s.woff2 +0 -0
  19. package/fonts/90475aac776488b6-s.p.woff2 +0 -0
  20. package/fonts/97e0cb1ae144a2a9-s.woff2 +0 -0
  21. package/fonts/a34f9d1faa5f3315-s.p.woff2 +0 -0
  22. package/fonts/df0a9ae256c0569c-s.woff2 +0 -0
  23. package/globals.min.css +2 -2
  24. package/package.json +3 -2
  25. package/dist/AppCard-vSAp__lv.js +0 -281
  26. package/dist/AppListCardPlatformWrapper-gpEo1mhs.js +0 -9
  27. package/dist/AppListCardWebWrapper-2mtvbrZI.js +0 -74
  28. package/dist/AppSettingsInterface-76krfbgC.js +0 -29
  29. package/dist/AppSettingsInterface-U3J8XNfT.js +0 -23
  30. package/dist/AppSettingsInterface-qR8wrA8Z.js +0 -75
  31. package/dist/DateRangePicker-S8PasnBw.js +0 -74
  32. package/dist/EventTypeAppCardInterface--cvud7p5.js +0 -34
  33. package/dist/EventTypeAppCardInterface-3WyRAq4g.js +0 -858
  34. package/dist/EventTypeAppCardInterface-5GqOLlXa.js +0 -24
  35. package/dist/EventTypeAppCardInterface-7BjnHZSW.js +0 -42
  36. package/dist/EventTypeAppCardInterface-9RRfsmxD.js +0 -41
  37. package/dist/EventTypeAppCardInterface-AqVT1BoP.js +0 -34
  38. package/dist/EventTypeAppCardInterface-AzUqjRAw.js +0 -32
  39. package/dist/EventTypeAppCardInterface-CWeqREZU.js +0 -24
  40. package/dist/EventTypeAppCardInterface-FoNtZTXA.js +0 -39
  41. package/dist/EventTypeAppCardInterface-GC7AOQgo.js +0 -34
  42. package/dist/EventTypeAppCardInterface-HQMqzp7c.js +0 -49
  43. package/dist/EventTypeAppCardInterface-N7WcmdT4.js +0 -34
  44. package/dist/EventTypeAppCardInterface-R0X4nckV.js +0 -32
  45. package/dist/EventTypeAppCardInterface-Uu3O27xa.js +0 -34
  46. package/dist/EventTypeAppCardInterface-V8atUcK-.js +0 -34
  47. package/dist/EventTypeAppCardInterface-Y07gIvmX.js +0 -31
  48. package/dist/EventTypeAppCardInterface-Z-LBRQAn.js +0 -51
  49. package/dist/EventTypeAppCardInterface-aYTZV5EF.js +0 -41
  50. package/dist/EventTypeAppCardInterface-bEYxRxeM.js +0 -51
  51. package/dist/EventTypeAppCardInterface-dKaaMNor.js +0 -86
  52. package/dist/EventTypeAppCardInterface-lguZWNvV.js +0 -24
  53. package/dist/EventTypeAppCardInterface-p0blDTaQ.js +0 -24
  54. package/dist/EventTypeAppCardInterface-rppYuGVz.js +0 -33
  55. package/dist/EventTypeAppCardInterface-tkKsbhWo.js +0 -39
  56. package/dist/EventTypeAppCardInterface-utvbMc02.js +0 -42
  57. package/dist/EventTypeAppCardInterface-wXpCgFPS.js +0 -34
  58. package/dist/EventTypeAppCardInterface-zGyldaa9.js +0 -24
  59. package/dist/EventTypeAppSettingsInterface-7hS6GTO2.js +0 -48
  60. package/dist/EventTypeAppSettingsInterface-FQeyEBxu.js +0 -72
  61. package/dist/EventTypeAppSettingsInterface-HK0lsJ28.js +0 -42
  62. package/dist/EventTypeAppSettingsInterface-MG2xFbSG.js +0 -23
  63. package/dist/EventTypeAppSettingsInterface-Ra9cL5JB.js +0 -25
  64. package/dist/EventTypeAppSettingsInterface-XL4D2Dyv.js +0 -24
  65. package/dist/EventTypeAppSettingsInterface-ZIUpW8te.js +0 -78
  66. package/dist/EventTypeAppSettingsInterface-afhCdPkJ.js +0 -79
  67. package/dist/EventTypeAppSettingsInterface-bA-Dmxj2.js +0 -298
  68. package/dist/EventTypeAppSettingsInterface-g5jo9GKH.js +0 -43
  69. package/dist/EventTypeAppSettingsInterface-sazwK3zk.js +0 -120
  70. package/dist/EventTypeAppSettingsInterface-sbAmbLiK.js +0 -221
  71. package/dist/EventTypeAppSettingsInterface-ycOpDd2-.js +0 -23
  72. package/dist/InstallAppButton-0Gg9ocXb.js +0 -14
  73. package/dist/InstallAppButton-JHaJ7T7H.js +0 -58
  74. package/dist/InstallAppButton-JN6i4iBH.js +0 -14
  75. package/dist/InstallAppButton-JXhBVaYJ.js +0 -29
  76. package/dist/StripePaymentForm-B1BkBzO9.js +0 -493
  77. package/dist/currencyOptions-kannG2hu.js +0 -61
  78. package/dist/index-GkJhe-oj.js +0 -160851
  79. package/dist/index-V8Hhry6U.js +0 -518
  80. package/dist/index-l2YMCxIx.js +0 -30
  81. package/dist/useIsAppEnabled-oIf6wORY.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 { au as S, y as ee, b as Ce, u as G, W as Oe } from "./index-GkJhe-oj.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 T = 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
- }, $ = /* @__PURE__ */ f.createContext(null);
148
- $.displayName = "ElementsContext";
149
- var Te = 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 = T(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 = T(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($.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($);
207
- return Te(t, e);
208
- }, $e = function() {
209
- var e = I("calls useElements()"), t = e.elements;
210
- return t;
211
- }, Be = 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 = T(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 B = {};
290
- Object.defineProperty(B, "__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
- B.loadStripe = se;
375
- var Ye = B;
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 = $e(), r = n.payment.paymentOption, i = n.booking.attendees[0].email, a = Be(), [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
- };