@levo-so/react 0.1.49 → 0.1.52

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/components/Dialog.d.ts +2 -3
  2. package/dist/components/Tabs.d.ts +1 -1
  3. package/dist/components/Tooltip.d.ts +2 -1
  4. package/dist/components/button/buttonVariants.d.ts +2 -2
  5. package/dist/constants/fileUploadPresets.d.ts +6 -0
  6. package/dist/index.css +1 -1
  7. package/dist/index.d.ts +3 -3
  8. package/dist/index.js +1624 -94
  9. package/package.json +23 -45
  10. package/dist/Sonner-BzW9wsXf.js +0 -39
  11. package/dist/Spinner-DBvVyDMF.js +0 -119
  12. package/dist/Tooltip-BeY_STLA.js +0 -281
  13. package/dist/audience/components/block.d.ts.map +0 -1
  14. package/dist/audience/components/component.d.ts.map +0 -1
  15. package/dist/audience/components/page.d.ts.map +0 -1
  16. package/dist/audience/hooks/useBounce.d.ts.map +0 -1
  17. package/dist/audience/hooks/useCurrentTab.d.ts.map +0 -1
  18. package/dist/audience/hooks/useDownloadSpeed.d.ts.map +0 -1
  19. package/dist/audience/hooks/useIdentifyAudience.d.ts.map +0 -1
  20. package/dist/audience/hooks/useOpenTabs.d.ts.map +0 -1
  21. package/dist/audience/hooks/usePerformanceMetrics.d.ts.map +0 -1
  22. package/dist/audience/hooks/useScrollBehavior.d.ts.map +0 -1
  23. package/dist/audience/hooks/useTextSelection.d.ts.map +0 -1
  24. package/dist/audience/hooks/useTrackClicks.d.ts.map +0 -1
  25. package/dist/audience/index.d.ts.map +0 -1
  26. package/dist/audience/index.js +0 -6
  27. package/dist/audience/utils/autocapture.d.ts.map +0 -1
  28. package/dist/audience/utils/rageclick.d.ts.map +0 -1
  29. package/dist/cn-C9QoOYNG.js +0 -6
  30. package/dist/components/Dialog.d.ts.map +0 -1
  31. package/dist/components/DialogWrapper.d.ts.map +0 -1
  32. package/dist/components/Sonner.d.ts.map +0 -1
  33. package/dist/components/Spinner.d.ts.map +0 -1
  34. package/dist/components/Table.d.ts.map +0 -1
  35. package/dist/components/Tabs.d.ts.map +0 -1
  36. package/dist/components/Tooltip.d.ts.map +0 -1
  37. package/dist/components/button/Button.d.ts.map +0 -1
  38. package/dist/components/button/buttonVariants.d.ts.map +0 -1
  39. package/dist/components/button/index.d.ts.map +0 -1
  40. package/dist/components/index.d.ts.map +0 -1
  41. package/dist/components/index.js +0 -34
  42. package/dist/constants/fileUploadPresets.d.ts.map +0 -1
  43. package/dist/constants/index.d.ts.map +0 -1
  44. package/dist/isEmptyObject-BoIi0jMB.js +0 -21
  45. package/dist/jsx-runtime-D0AQ1Mn7.js +0 -633
  46. package/dist/membership/components/Button.d.ts.map +0 -1
  47. package/dist/membership/components/Container.d.ts.map +0 -1
  48. package/dist/membership/components/Core.d.ts.map +0 -1
  49. package/dist/membership/components/Popup.d.ts.map +0 -1
  50. package/dist/membership/index.d.ts.map +0 -1
  51. package/dist/membership/index.js +0 -221
  52. package/dist/membership/useLevoOAuth.d.ts.map +0 -1
  53. package/dist/page-DweUjn1K.js +0 -627
  54. package/dist/providers/LevoProvider.d.ts.map +0 -1
  55. package/dist/providers/index.d.ts +0 -2
  56. package/dist/providers/index.js +0 -13
  57. package/dist/utils/byteToSize.d.ts.map +0 -1
  58. package/dist/utils/cn.d.ts.map +0 -1
  59. package/dist/utils/errorHandler.d.ts.map +0 -1
  60. package/dist/utils/index.d.ts.map +0 -1
  61. package/dist/utils/index.js +0 -12
  62. package/dist/utils/isDateObject.d.ts.map +0 -1
  63. package/dist/utils/isEmptyObject.d.ts.map +0 -1
  64. package/dist/utils/isNullOrUndefined.d.ts.map +0 -1
  65. package/dist/utils/isObject.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -1,28 +1,44 @@
1
- import { LevoProvider as v, useLevo as x } from "./providers/index.js";
2
- import { L as u, a as T, b } from "./page-DweUjn1K.js";
3
- import { LevoOAuth as y, useLevoOAuth as j } from "./membership/index.js";
4
- import { B as h, D as M, j as O, e as E, i as F, g as w, f as B, c as C, a as P, h as S, d as I, k, S as A, T as H, n as K, l as W, m as q, o as z, q as N, s as U, r as V, p as G, b as J } from "./Tooltip-BeY_STLA.js";
5
- import { T as R, e as X, s as Y } from "./Sonner-BzW9wsXf.js";
6
- import { S as _ } from "./Spinner-DBvVyDMF.js";
7
- import { b as oo, e as eo, i as ao, a as so, c as io, f as to, d as no } from "./isEmptyObject-BoIi0jMB.js";
8
- import { c as mo } from "./cn-C9QoOYNG.js";
9
- import { toast as ro } from "sonner";
10
- const a = [
1
+ "use client";
2
+ var it = Object.defineProperty;
3
+ var ct = (e, t, n) => t in e ? it(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
+ var J = (e, t, n) => ct(e, typeof t != "symbol" ? t + "" : t, n);
5
+ import * as D from "react";
6
+ import I, { createContext as ut, useContext as Pe, useEffect as b, useState as x, useMemo as Ae, useRef as Ie, useCallback as me } from "react";
7
+ import { clsx as lt } from "clsx";
8
+ import { twMerge as De } from "tailwind-merge";
9
+ import { useInView as dt } from "react-intersection-observer";
10
+ import { getLevoError as Me, LocalStorageLock as ft } from "@levo-so/core";
11
+ import { usePageLifecycle as mt, LifecycleState as le } from "use-page-lifecycle";
12
+ import { Slot as gt, Dialog as j, Tabs as B, Tooltip as Y } from "radix-ui";
13
+ import { cva as pt } from "class-variance-authority";
14
+ import { X as bt } from "lucide-react";
15
+ import { Toaster as vt, toast as Q } from "sonner";
16
+ import { toast as Ur } from "sonner";
17
+ const ht = [
11
18
  "pdf",
19
+ "txt",
20
+ "xml",
12
21
  "xls",
13
22
  "xlsx",
23
+ "ods",
24
+ "odt",
14
25
  "doc",
15
26
  "docx",
16
- "csv"
17
- ], s = [
27
+ "csv",
28
+ "odp",
29
+ "ppt",
30
+ "pptx"
31
+ ], wt = [
18
32
  "svg",
19
33
  "png",
20
34
  "jpg",
21
35
  "jpeg",
22
- "webp",
23
36
  "gif",
37
+ "webp",
24
38
  "avif"
25
- ], i = ["mpeg", "mp4"], t = ["mp3", "ogg", "oga"], n = {
39
+ ], yt = ["mp4", "ogv", "webm"], xt = ["mp3", "ogg", "opus"], Tt = {
40
+ "application/xml": [".xml"],
41
+ "text/plain": [".txt"],
26
42
  "application/pdf": [".pdf"],
27
43
  "application/msword": [".doc"],
28
44
  "application/vnd.ms-excel": [".xls"],
@@ -33,94 +49,1608 @@ const a = [
33
49
  ".docx"
34
50
  ],
35
51
  "text/csv": [".csv"]
36
- }, p = {
52
+ }, Et = {
37
53
  "image/jpeg": [".jpeg", ".jpg"],
54
+ "image/jpg": [".jpg"],
38
55
  "image/png": [".png"],
39
56
  "image/gif": [".gif"],
57
+ "image/svg": [".svg"],
40
58
  "image/svg+xml": [".svg"],
41
59
  "image/webp": [".webp"],
42
60
  "image/avif": [".avif"]
43
- }, m = {
61
+ }, kt = {
44
62
  "video/mp4": [".mp4"],
45
- "video/mpeg": [".mpeg"]
46
- }, g = {
63
+ "video/mpeg": [".mpeg"],
64
+ "video/webm": [".webm"]
65
+ }, St = {
47
66
  "audio/mpeg": [".mp3"],
48
- "audio/ogg": [".oga"]
49
- }, o = {
50
- audio: g,
51
- document: n,
52
- image: p,
53
- video: m
54
- }, e = {
55
- audio: t,
56
- document: a,
57
- image: s,
58
- video: i
59
- }, r = [
60
- ...e.audio,
61
- ...e.document,
62
- ...e.image,
63
- ...e.video
64
- ], d = {
65
- ...o.audio,
66
- ...o.document,
67
- ...o.image,
68
- ...o.video
67
+ "audio/ogg": [".oga"],
68
+ "audio/opus": [".opus"]
69
+ }, X = {
70
+ audio: St,
71
+ document: Tt,
72
+ image: Et,
73
+ video: kt
74
+ }, q = {
75
+ audio: xt,
76
+ document: ht,
77
+ image: wt,
78
+ video: yt
79
+ }, Tr = [
80
+ ...q.audio,
81
+ ...q.document,
82
+ ...q.image,
83
+ ...q.video
84
+ ], Er = {
85
+ ...X.audio,
86
+ ...X.document,
87
+ ...X.image,
88
+ ...X.video
89
+ };
90
+ var K = { exports: {} }, z = {};
91
+ /**
92
+ * @license React
93
+ * react-jsx-runtime.production.js
94
+ *
95
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
96
+ *
97
+ * This source code is licensed under the MIT license found in the
98
+ * LICENSE file in the root directory of this source tree.
99
+ */
100
+ var Ee;
101
+ function _t() {
102
+ if (Ee) return z;
103
+ Ee = 1;
104
+ var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
105
+ function n(r, o, s) {
106
+ var c = null;
107
+ if (s !== void 0 && (c = "" + s), o.key !== void 0 && (c = "" + o.key), "key" in o) {
108
+ s = {};
109
+ for (var i in o)
110
+ i !== "key" && (s[i] = o[i]);
111
+ } else s = o;
112
+ return o = s.ref, {
113
+ $$typeof: e,
114
+ type: r,
115
+ key: c,
116
+ ref: o !== void 0 ? o : null,
117
+ props: s
118
+ };
119
+ }
120
+ return z.Fragment = t, z.jsx = n, z.jsxs = n, z;
121
+ }
122
+ var H = {};
123
+ /**
124
+ * @license React
125
+ * react-jsx-runtime.development.js
126
+ *
127
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
128
+ *
129
+ * This source code is licensed under the MIT license found in the
130
+ * LICENSE file in the root directory of this source tree.
131
+ */
132
+ var ke;
133
+ function Ot() {
134
+ return ke || (ke = 1, process.env.NODE_ENV !== "production" && function() {
135
+ function e(a) {
136
+ if (a == null) return null;
137
+ if (typeof a == "function")
138
+ return a.$$typeof === ot ? null : a.displayName || a.name || null;
139
+ if (typeof a == "string") return a;
140
+ switch (a) {
141
+ case _:
142
+ return "Fragment";
143
+ case C:
144
+ return "Profiler";
145
+ case N:
146
+ return "StrictMode";
147
+ case M:
148
+ return "Suspense";
149
+ case w:
150
+ return "SuspenseList";
151
+ case V:
152
+ return "Activity";
153
+ }
154
+ if (typeof a == "object")
155
+ switch (typeof a.tag == "number" && console.error(
156
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
157
+ ), a.$$typeof) {
158
+ case S:
159
+ return "Portal";
160
+ case y:
161
+ return (a.displayName || "Context") + ".Provider";
162
+ case T:
163
+ return (a._context.displayName || "Context") + ".Consumer";
164
+ case O:
165
+ var g = a.render;
166
+ return a = a.displayName, a || (a = g.displayName || g.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
167
+ case P:
168
+ return g = a.displayName || null, g !== null ? g : e(a.type) || "Memo";
169
+ case $:
170
+ g = a._payload, a = a._init;
171
+ try {
172
+ return e(a(g));
173
+ } catch {
174
+ }
175
+ }
176
+ return null;
177
+ }
178
+ function t(a) {
179
+ return "" + a;
180
+ }
181
+ function n(a) {
182
+ try {
183
+ t(a);
184
+ var g = !1;
185
+ } catch {
186
+ g = !0;
187
+ }
188
+ if (g) {
189
+ g = console;
190
+ var h = g.error, E = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
191
+ return h.call(
192
+ g,
193
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
194
+ E
195
+ ), t(a);
196
+ }
197
+ }
198
+ function r(a) {
199
+ if (a === _) return "<>";
200
+ if (typeof a == "object" && a !== null && a.$$typeof === $)
201
+ return "<...>";
202
+ try {
203
+ var g = e(a);
204
+ return g ? "<" + g + ">" : "<...>";
205
+ } catch {
206
+ return "<...>";
207
+ }
208
+ }
209
+ function o() {
210
+ var a = se.A;
211
+ return a === null ? null : a.getOwner();
212
+ }
213
+ function s() {
214
+ return Error("react-stack-top-frame");
215
+ }
216
+ function c(a) {
217
+ if (ve.call(a, "key")) {
218
+ var g = Object.getOwnPropertyDescriptor(a, "key").get;
219
+ if (g && g.isReactWarning) return !1;
220
+ }
221
+ return a.key !== void 0;
222
+ }
223
+ function i(a, g) {
224
+ function h() {
225
+ he || (he = !0, console.error(
226
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
227
+ g
228
+ ));
229
+ }
230
+ h.isReactWarning = !0, Object.defineProperty(a, "key", {
231
+ get: h,
232
+ configurable: !0
233
+ });
234
+ }
235
+ function u() {
236
+ var a = e(this.type);
237
+ return we[a] || (we[a] = !0, console.error(
238
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
239
+ )), a = this.props.ref, a !== void 0 ? a : null;
240
+ }
241
+ function l(a, g, h, E, F, A, ie, ce) {
242
+ return h = A.ref, a = {
243
+ $$typeof: v,
244
+ type: a,
245
+ key: g,
246
+ props: A,
247
+ _owner: F
248
+ }, (h !== void 0 ? h : null) !== null ? Object.defineProperty(a, "ref", {
249
+ enumerable: !1,
250
+ get: u
251
+ }) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._store, "validated", {
252
+ configurable: !1,
253
+ enumerable: !1,
254
+ writable: !0,
255
+ value: 0
256
+ }), Object.defineProperty(a, "_debugInfo", {
257
+ configurable: !1,
258
+ enumerable: !1,
259
+ writable: !0,
260
+ value: null
261
+ }), Object.defineProperty(a, "_debugStack", {
262
+ configurable: !1,
263
+ enumerable: !1,
264
+ writable: !0,
265
+ value: ie
266
+ }), Object.defineProperty(a, "_debugTask", {
267
+ configurable: !1,
268
+ enumerable: !1,
269
+ writable: !0,
270
+ value: ce
271
+ }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
272
+ }
273
+ function p(a, g, h, E, F, A, ie, ce) {
274
+ var k = g.children;
275
+ if (k !== void 0)
276
+ if (E)
277
+ if (st(k)) {
278
+ for (E = 0; E < k.length; E++)
279
+ d(k[E]);
280
+ Object.freeze && Object.freeze(k);
281
+ } else
282
+ console.error(
283
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
284
+ );
285
+ else d(k);
286
+ if (ve.call(g, "key")) {
287
+ k = e(a);
288
+ var U = Object.keys(g).filter(function(at) {
289
+ return at !== "key";
290
+ });
291
+ E = 0 < U.length ? "{key: someKey, " + U.join(": ..., ") + ": ...}" : "{key: someKey}", Te[k + E] || (U = 0 < U.length ? "{" + U.join(": ..., ") + ": ...}" : "{}", console.error(
292
+ `A props object containing a "key" prop is being spread into JSX:
293
+ let props = %s;
294
+ <%s {...props} />
295
+ React keys must be passed directly to JSX without using spread:
296
+ let props = %s;
297
+ <%s key={someKey} {...props} />`,
298
+ E,
299
+ k,
300
+ U,
301
+ k
302
+ ), Te[k + E] = !0);
303
+ }
304
+ if (k = null, h !== void 0 && (n(h), k = "" + h), c(g) && (n(g.key), k = "" + g.key), "key" in g) {
305
+ h = {};
306
+ for (var ue in g)
307
+ ue !== "key" && (h[ue] = g[ue]);
308
+ } else h = g;
309
+ return k && i(
310
+ h,
311
+ typeof a == "function" ? a.displayName || a.name || "Unknown" : a
312
+ ), l(
313
+ a,
314
+ k,
315
+ A,
316
+ F,
317
+ o(),
318
+ h,
319
+ ie,
320
+ ce
321
+ );
322
+ }
323
+ function d(a) {
324
+ typeof a == "object" && a !== null && a.$$typeof === v && a._store && (a._store.validated = 1);
325
+ }
326
+ var f = I, v = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), N = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), T = Symbol.for("react.consumer"), y = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), $ = Symbol.for("react.lazy"), V = Symbol.for("react.activity"), ot = Symbol.for("react.client.reference"), se = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ve = Object.prototype.hasOwnProperty, st = Array.isArray, ae = console.createTask ? console.createTask : function() {
327
+ return null;
328
+ };
329
+ f = {
330
+ "react-stack-bottom-frame": function(a) {
331
+ return a();
332
+ }
333
+ };
334
+ var he, we = {}, ye = f["react-stack-bottom-frame"].bind(
335
+ f,
336
+ s
337
+ )(), xe = ae(r(s)), Te = {};
338
+ H.Fragment = _, H.jsx = function(a, g, h, E, F) {
339
+ var A = 1e4 > se.recentlyCreatedOwnerStacks++;
340
+ return p(
341
+ a,
342
+ g,
343
+ h,
344
+ !1,
345
+ E,
346
+ F,
347
+ A ? Error("react-stack-top-frame") : ye,
348
+ A ? ae(r(a)) : xe
349
+ );
350
+ }, H.jsxs = function(a, g, h, E, F) {
351
+ var A = 1e4 > se.recentlyCreatedOwnerStacks++;
352
+ return p(
353
+ a,
354
+ g,
355
+ h,
356
+ !0,
357
+ E,
358
+ F,
359
+ A ? Error("react-stack-top-frame") : ye,
360
+ A ? ae(r(a)) : xe
361
+ );
362
+ };
363
+ }()), H;
364
+ }
365
+ var Se;
366
+ function jt() {
367
+ return Se || (Se = 1, process.env.NODE_ENV === "production" ? K.exports = _t() : K.exports = Ot()), K.exports;
368
+ }
369
+ var m = jt(), $e = {
370
+ color: void 0,
371
+ size: void 0,
372
+ className: void 0,
373
+ style: void 0,
374
+ attr: void 0
375
+ }, _e = I.createContext && /* @__PURE__ */ I.createContext($e), Nt = ["attr", "size", "title"];
376
+ function Ct(e, t) {
377
+ if (e == null) return {};
378
+ var n = Rt(e, t), r, o;
379
+ if (Object.getOwnPropertySymbols) {
380
+ var s = Object.getOwnPropertySymbols(e);
381
+ for (o = 0; o < s.length; o++)
382
+ r = s[o], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
383
+ }
384
+ return n;
385
+ }
386
+ function Rt(e, t) {
387
+ if (e == null) return {};
388
+ var n = {};
389
+ for (var r in e)
390
+ if (Object.prototype.hasOwnProperty.call(e, r)) {
391
+ if (t.indexOf(r) >= 0) continue;
392
+ n[r] = e[r];
393
+ }
394
+ return n;
395
+ }
396
+ function ee() {
397
+ return ee = Object.assign ? Object.assign.bind() : function(e) {
398
+ for (var t = 1; t < arguments.length; t++) {
399
+ var n = arguments[t];
400
+ for (var r in n)
401
+ Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
402
+ }
403
+ return e;
404
+ }, ee.apply(this, arguments);
405
+ }
406
+ function Oe(e, t) {
407
+ var n = Object.keys(e);
408
+ if (Object.getOwnPropertySymbols) {
409
+ var r = Object.getOwnPropertySymbols(e);
410
+ t && (r = r.filter(function(o) {
411
+ return Object.getOwnPropertyDescriptor(e, o).enumerable;
412
+ })), n.push.apply(n, r);
413
+ }
414
+ return n;
415
+ }
416
+ function te(e) {
417
+ for (var t = 1; t < arguments.length; t++) {
418
+ var n = arguments[t] != null ? arguments[t] : {};
419
+ t % 2 ? Oe(Object(n), !0).forEach(function(r) {
420
+ Lt(e, r, n[r]);
421
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Oe(Object(n)).forEach(function(r) {
422
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
423
+ });
424
+ }
425
+ return e;
426
+ }
427
+ function Lt(e, t, n) {
428
+ return t = Pt(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
429
+ }
430
+ function Pt(e) {
431
+ var t = At(e, "string");
432
+ return typeof t == "symbol" ? t : t + "";
433
+ }
434
+ function At(e, t) {
435
+ if (typeof e != "object" || !e) return e;
436
+ var n = e[Symbol.toPrimitive];
437
+ if (n !== void 0) {
438
+ var r = n.call(e, t);
439
+ if (typeof r != "object") return r;
440
+ throw new TypeError("@@toPrimitive must return a primitive value.");
441
+ }
442
+ return (t === "string" ? String : Number)(e);
443
+ }
444
+ function Fe(e) {
445
+ return e && e.map((t, n) => /* @__PURE__ */ I.createElement(t.tag, te({
446
+ key: n
447
+ }, t.attr), Fe(t.child)));
448
+ }
449
+ function It(e) {
450
+ return (t) => /* @__PURE__ */ I.createElement(Dt, ee({
451
+ attr: te({}, e.attr)
452
+ }, t), Fe(e.child));
453
+ }
454
+ function Dt(e) {
455
+ var t = (n) => {
456
+ var {
457
+ attr: r,
458
+ size: o,
459
+ title: s
460
+ } = e, c = Ct(e, Nt), i = o || n.size || "1em", u;
461
+ return n.className && (u = n.className), e.className && (u = (u ? u + " " : "") + e.className), /* @__PURE__ */ I.createElement("svg", ee({
462
+ stroke: "currentColor",
463
+ fill: "currentColor",
464
+ strokeWidth: "0"
465
+ }, n.attr, r, c, {
466
+ className: u,
467
+ style: te(te({
468
+ color: e.color || n.color
469
+ }, n.style), e.style),
470
+ height: i,
471
+ width: i,
472
+ xmlns: "http://www.w3.org/2000/svg"
473
+ }), s && /* @__PURE__ */ I.createElement("title", null, s), e.children);
474
+ };
475
+ return _e !== void 0 ? /* @__PURE__ */ I.createElement(_e.Consumer, null, (n) => t(n)) : t($e);
476
+ }
477
+ function We(e) {
478
+ return It({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 22c5.421 0 10-4.579 10-10h-2c0 4.337-3.663 8-8 8s-8-3.663-8-8c0-4.336 3.663-8 8-8V2C6.579 2 2 6.58 2 12c0 5.421 4.579 10 10 10z" }, child: [] }] })(e);
479
+ }
480
+ const R = (...e) => De(lt(e)), Mt = pt(
481
+ "inline-flex items-center justify-center text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed",
482
+ {
483
+ variants: {
484
+ variant: {
485
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
486
+ destructive: "bg-destructive text-white hover:bg-destructive/90",
487
+ destructiveOutline: "border border-red-500 text-destructive bg-transparent shadow-sm hover:bg-destructive hover:text-destructive-foreground",
488
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
489
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
490
+ secondaryOutline: "bg-transparent border border-solid border-white hover:bg-white hover:border-input",
491
+ ghost: "hover:bg-accent hover:text-accent-foreground",
492
+ link: "text-primary underline-offset-4 hover:underline"
493
+ },
494
+ size: {
495
+ default: "h-10 px-4 py-2",
496
+ xs: "h-8 px-3 text-xs",
497
+ sm: "h-9 px-3",
498
+ lg: "h-11 px-8",
499
+ icon: "h-10 w-10",
500
+ "icon-small": "h-8 w-8"
501
+ },
502
+ rounded: {
503
+ small: "rounded",
504
+ default: "rounded-md",
505
+ large: "rounded-lg",
506
+ full: "rounded-full"
507
+ }
508
+ },
509
+ defaultVariants: {
510
+ variant: "default",
511
+ size: "default",
512
+ rounded: "default"
513
+ }
514
+ }
515
+ ), $t = D.forwardRef(
516
+ ({
517
+ className: e,
518
+ variant: t,
519
+ size: n,
520
+ rounded: r,
521
+ asChild: o = !1,
522
+ isLoading: s = !1,
523
+ loadingText: c,
524
+ disabled: i,
525
+ ...u
526
+ }, l) => {
527
+ const p = o ? gt.Root : "button";
528
+ return /* @__PURE__ */ m.jsx(
529
+ p,
530
+ {
531
+ className: R(Mt({ variant: t, size: n, rounded: r, className: e })),
532
+ ref: l,
533
+ disabled: i || s,
534
+ type: "button",
535
+ ...u,
536
+ children: s ? /* @__PURE__ */ m.jsxs(m.Fragment, { children: [
537
+ /* @__PURE__ */ m.jsx(
538
+ We,
539
+ {
540
+ className: De(
541
+ "h-4 w-4 animate-spin",
542
+ c ? "mr-2" : ""
543
+ )
544
+ }
545
+ ),
546
+ c
547
+ ] }) : u.children
548
+ }
549
+ );
550
+ }
551
+ );
552
+ $t.displayName = "Button";
553
+ const Ft = j.Root, kr = j.Trigger, Wt = j.Portal, Sr = j.Close, Be = D.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
554
+ j.Overlay,
555
+ {
556
+ ref: n,
557
+ className: R(
558
+ "bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 grid max-h-screen place-items-center overflow-y-auto py-10 backdrop-blur-sm",
559
+ e
560
+ ),
561
+ ...t
562
+ }
563
+ ));
564
+ Be.displayName = j.Overlay.displayName;
565
+ const Ue = D.forwardRef(
566
+ ({
567
+ className: e,
568
+ children: t,
569
+ container: n,
570
+ hideCloseButton: r,
571
+ overlayStyles: o,
572
+ ...s
573
+ }, c) => /* @__PURE__ */ m.jsx(Wt, { container: n, children: /* @__PURE__ */ m.jsx(Be, { className: o, children: /* @__PURE__ */ m.jsxs(
574
+ j.Content,
575
+ {
576
+ ref: c,
577
+ className: R(
578
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 relative z-50 grid w-full max-w-lg gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",
579
+ e
580
+ ),
581
+ ...s,
582
+ children: [
583
+ t,
584
+ !r && /* @__PURE__ */ m.jsxs(
585
+ j.Close,
586
+ {
587
+ type: "button",
588
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm p-1 opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",
589
+ children: [
590
+ /* @__PURE__ */ m.jsx(bt, { className: "h-4 w-4" }),
591
+ /* @__PURE__ */ m.jsx("span", { className: "sr-only", children: "Close" })
592
+ ]
593
+ }
594
+ )
595
+ ]
596
+ }
597
+ ) }) })
598
+ );
599
+ Ue.displayName = j.Content.displayName;
600
+ const Ye = ({
601
+ className: e,
602
+ ...t
603
+ }) => /* @__PURE__ */ m.jsx(
604
+ "div",
605
+ {
606
+ className: R(
607
+ "flex flex-col space-y-1.5 text-center sm:text-left",
608
+ e
609
+ ),
610
+ ...t
611
+ }
612
+ );
613
+ Ye.displayName = "DialogHeader";
614
+ const Bt = ({
615
+ className: e,
616
+ ...t
617
+ }) => /* @__PURE__ */ m.jsx(
618
+ "div",
619
+ {
620
+ className: R(
621
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
622
+ e
623
+ ),
624
+ ...t
625
+ }
626
+ );
627
+ Bt.displayName = "DialogFooter";
628
+ const ze = D.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
629
+ j.Title,
630
+ {
631
+ ref: n,
632
+ className: R(
633
+ "text-lg leading-none font-semibold tracking-tight",
634
+ e
635
+ ),
636
+ ...t
637
+ }
638
+ ));
639
+ ze.displayName = j.Title.displayName;
640
+ const He = D.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
641
+ j.Description,
642
+ {
643
+ ref: n,
644
+ className: R("text-muted-foreground text-sm", e),
645
+ ...t
646
+ }
647
+ ));
648
+ He.displayName = j.Description.displayName;
649
+ const _r = ({
650
+ isOpen: e,
651
+ onClose: t,
652
+ children: n,
653
+ title: r,
654
+ description: o = "",
655
+ contentClassName: s,
656
+ modal: c = !0
657
+ }) => /* @__PURE__ */ m.jsx(Ft, { open: e, onOpenChange: t, modal: c, children: /* @__PURE__ */ m.jsxs(Ue, { className: s, children: [
658
+ r && /* @__PURE__ */ m.jsxs(Ye, { className: "flex-1 font-medium", children: [
659
+ /* @__PURE__ */ m.jsx(ze, { children: r }),
660
+ /* @__PURE__ */ m.jsx(He, { children: o })
661
+ ] }),
662
+ /* @__PURE__ */ m.jsx("div", { className: "w-full", children: n })
663
+ ] }) }), Or = ({ ...e }) => /* @__PURE__ */ m.jsx(
664
+ vt,
665
+ {
666
+ closeButton: !0,
667
+ richColors: !0,
668
+ className: "toaster group",
669
+ toastOptions: {
670
+ classNames: {
671
+ toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
672
+ description: "group-[.toast]:text-muted-foreground",
673
+ actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
674
+ cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"
675
+ }
676
+ },
677
+ ...e
678
+ }
679
+ ), Ut = (e, t = "Error", n = {}) => {
680
+ n != null && n.id && Q.dismiss(n == null ? void 0 : n.id), Q.error(t, {
681
+ description: e,
682
+ duration: 4e3,
683
+ position: "bottom-right",
684
+ ...n
685
+ });
686
+ }, jr = (e, t = "Success", n = {}) => {
687
+ n != null && n.id && Q.dismiss(n == null ? void 0 : n.id), Q.success(t, {
688
+ description: e,
689
+ duration: 4e3,
690
+ position: "bottom-right",
691
+ ...n
692
+ });
693
+ }, Yt = ({ className: e }) => /* @__PURE__ */ m.jsx(We, { className: R("h-8 w-8 animate-spin font-light", e) }), Nr = B.Root, zt = D.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
694
+ B.List,
695
+ {
696
+ ref: n,
697
+ className: R(
698
+ "bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",
699
+ e
700
+ ),
701
+ ...t
702
+ }
703
+ ));
704
+ zt.displayName = B.List.displayName;
705
+ const Ht = D.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
706
+ B.Trigger,
707
+ {
708
+ ref: n,
709
+ className: R(
710
+ "ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-sm px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm",
711
+ e
712
+ ),
713
+ "data-levo-studio-interactive": "true",
714
+ ...t
715
+ }
716
+ ));
717
+ Ht.displayName = B.Trigger.displayName;
718
+ const Gt = D.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m.jsx(
719
+ B.Content,
720
+ {
721
+ ref: n,
722
+ className: R(
723
+ "ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
724
+ e
725
+ ),
726
+ ...t
727
+ }
728
+ ));
729
+ Gt.displayName = B.Content.displayName;
730
+ const Cr = Y.Provider, Vt = Y.Root, Jt = Y.Trigger, Xt = Y.Portal, Ge = D.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__PURE__ */ m.jsx(
731
+ Y.Content,
732
+ {
733
+ ref: r,
734
+ sideOffset: t,
735
+ className: R(
736
+ "bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md border px-3 py-1.5 text-xs shadow-md",
737
+ e
738
+ ),
739
+ ...n
740
+ }
741
+ ));
742
+ Ge.displayName = Y.Content.displayName;
743
+ const Rr = ({
744
+ children: e,
745
+ label: t,
746
+ labelClassName: n,
747
+ contentClassName: r,
748
+ asChild: o = !0,
749
+ contentProps: s = {},
750
+ side: c
751
+ }) => /* @__PURE__ */ m.jsxs(Vt, { children: [
752
+ t && /* @__PURE__ */ m.jsx(Xt, { children: /* @__PURE__ */ m.jsx(
753
+ Ge,
754
+ {
755
+ side: c,
756
+ className: n,
757
+ ...s,
758
+ children: /* @__PURE__ */ m.jsx("p", { className: r, children: t })
759
+ }
760
+ ) }),
761
+ /* @__PURE__ */ m.jsx(Jt, { asChild: o, children: e })
762
+ ] }), Lr = (e, t = 2) => {
763
+ if (e === 0) return "0 B";
764
+ const n = 1024, r = t < 0 ? 0 : t, o = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], s = Math.floor(Math.log(e) / Math.log(n));
765
+ return `${Number.parseFloat((e / n ** s).toFixed(r))} ${o[s]}`;
766
+ }, Pr = (e) => {
767
+ const t = Me(e);
768
+ return Ut((t == null ? void 0 : t.message) || "", (t == null ? void 0 : t.title) || "Error", {
769
+ id: `${(t == null ? void 0 : t.title) || ""}-${(t == null ? void 0 : t.message) || ""}`
770
+ }), t;
771
+ }, qt = (e) => e instanceof Date, Kt = (e) => e == null, Zt = (e) => typeof e == "object", Qt = (e) => !Kt(e) && !Array.isArray(e) && Zt(e) && !qt(e), Ar = (e) => Qt(e) && !Object.keys(e).length, Ve = ut(null), Ir = ({ children: e, client: t }) => /* @__PURE__ */ m.jsx(Ve.Provider, { value: t, children: e }), L = () => {
772
+ const e = Pe(Ve);
773
+ if (!e)
774
+ throw new Error(
775
+ "useLevo must be used within a LevoProvider. Please ensure you have wrapped your component tree with LevoProvider."
776
+ );
777
+ return e;
778
+ }, Dr = ({ id: e, properties: t = {} }) => {
779
+ const { audience: n } = L(), { ref: r, inView: o } = dt({
780
+ triggerOnce: !0
781
+ });
782
+ return b(() => {
783
+ n != null && n.instance && o && (n == null || n.track("block.view", {
784
+ ...t,
785
+ resource: "block",
786
+ identifier: e
787
+ }));
788
+ }, [o]), /* @__PURE__ */ m.jsx("div", { ref: r, style: { height: "0px" } });
789
+ }, Mr = ({ event: e, properties: t }) => {
790
+ const { audience: n } = L();
791
+ return b(() => {
792
+ n != null && n.instance && (n == null || n.track(e, t));
793
+ }, [n == null ? void 0 : n.instance, e, t]), null;
794
+ };
795
+ function ge(e) {
796
+ var t = typeof e;
797
+ return e != null && (t == "object" || t == "function");
798
+ }
799
+ var en = typeof global == "object" && global && global.Object === Object && global, tn = typeof self == "object" && self && self.Object === Object && self, Je = en || tn || Function("return this")(), de = function() {
800
+ return Je.Date.now();
801
+ }, nn = /\s/;
802
+ function rn(e) {
803
+ for (var t = e.length; t-- && nn.test(e.charAt(t)); )
804
+ ;
805
+ return t;
806
+ }
807
+ var on = /^\s+/;
808
+ function sn(e) {
809
+ return e && e.slice(0, rn(e) + 1).replace(on, "");
810
+ }
811
+ var ne = Je.Symbol, Xe = Object.prototype, an = Xe.hasOwnProperty, cn = Xe.toString, G = ne ? ne.toStringTag : void 0;
812
+ function un(e) {
813
+ var t = an.call(e, G), n = e[G];
814
+ try {
815
+ e[G] = void 0;
816
+ var r = !0;
817
+ } catch {
818
+ }
819
+ var o = cn.call(e);
820
+ return r && (t ? e[G] = n : delete e[G]), o;
821
+ }
822
+ var ln = Object.prototype, dn = ln.toString;
823
+ function fn(e) {
824
+ return dn.call(e);
825
+ }
826
+ var mn = "[object Null]", gn = "[object Undefined]", je = ne ? ne.toStringTag : void 0;
827
+ function pn(e) {
828
+ return e == null ? e === void 0 ? gn : mn : je && je in Object(e) ? un(e) : fn(e);
829
+ }
830
+ function bn(e) {
831
+ return e != null && typeof e == "object";
832
+ }
833
+ var vn = "[object Symbol]";
834
+ function hn(e) {
835
+ return typeof e == "symbol" || bn(e) && pn(e) == vn;
836
+ }
837
+ var Ne = NaN, wn = /^[-+]0x[0-9a-f]+$/i, yn = /^0b[01]+$/i, xn = /^0o[0-7]+$/i, Tn = parseInt;
838
+ function Ce(e) {
839
+ if (typeof e == "number")
840
+ return e;
841
+ if (hn(e))
842
+ return Ne;
843
+ if (ge(e)) {
844
+ var t = typeof e.valueOf == "function" ? e.valueOf() : e;
845
+ e = ge(t) ? t + "" : t;
846
+ }
847
+ if (typeof e != "string")
848
+ return e === 0 ? e : +e;
849
+ e = sn(e);
850
+ var n = yn.test(e);
851
+ return n || xn.test(e) ? Tn(e.slice(2), n ? 2 : 8) : wn.test(e) ? Ne : +e;
852
+ }
853
+ var En = "Expected a function", kn = Math.max, Sn = Math.min;
854
+ function _n(e, t, n) {
855
+ var r, o, s, c, i, u, l = 0, p = !1, d = !1, f = !0;
856
+ if (typeof e != "function")
857
+ throw new TypeError(En);
858
+ t = Ce(t) || 0, ge(n) && (p = !!n.leading, d = "maxWait" in n, s = d ? kn(Ce(n.maxWait) || 0, t) : s, f = "trailing" in n ? !!n.trailing : f);
859
+ function v(w) {
860
+ var P = r, $ = o;
861
+ return r = o = void 0, l = w, c = e.apply($, P), c;
862
+ }
863
+ function S(w) {
864
+ return l = w, i = setTimeout(C, t), p ? v(w) : c;
865
+ }
866
+ function _(w) {
867
+ var P = w - u, $ = w - l, V = t - P;
868
+ return d ? Sn(V, s - $) : V;
869
+ }
870
+ function N(w) {
871
+ var P = w - u, $ = w - l;
872
+ return u === void 0 || P >= t || P < 0 || d && $ >= s;
873
+ }
874
+ function C() {
875
+ var w = de();
876
+ if (N(w))
877
+ return T(w);
878
+ i = setTimeout(C, _(w));
879
+ }
880
+ function T(w) {
881
+ return i = void 0, f && r ? v(w) : (r = o = void 0, c);
882
+ }
883
+ function y() {
884
+ i !== void 0 && clearTimeout(i), l = 0, r = u = o = i = void 0;
885
+ }
886
+ function O() {
887
+ return i === void 0 ? c : T(de());
888
+ }
889
+ function M() {
890
+ var w = de(), P = N(w);
891
+ if (r = arguments, o = this, u = w, P) {
892
+ if (i === void 0)
893
+ return S(u);
894
+ if (d)
895
+ return clearTimeout(i), i = setTimeout(C, t), v(u);
896
+ }
897
+ return i === void 0 && (i = setTimeout(C, t)), c;
898
+ }
899
+ return M.cancel = y, M.flush = O, M;
900
+ }
901
+ const On = () => {
902
+ const [e, t] = x(0), [n, r] = x(0), [o, s] = x(0), [c, i] = x(Date.now()), [u, l] = x("read"), p = _n(() => {
903
+ const d = window.scrollY, f = document.documentElement.scrollHeight, v = window.innerHeight, S = Math.round(
904
+ d / (f - v) * 100
905
+ ), _ = Math.floor(S / 5) * 5;
906
+ if (_ <= n)
907
+ return;
908
+ const N = Date.now(), C = (N - c) / 1e3, y = Math.abs(d - o) / C;
909
+ l(y > 300 ? "scan" : "read"), s(d), i(N), r(_), t(_);
910
+ }, 250);
911
+ return b(() => (window.addEventListener("scroll", p), () => window.removeEventListener("scroll", p)), []), { depth: e, speedCategory: u };
912
+ }, jn = () => {
913
+ const e = L(), [t, n] = x(0);
914
+ return b(() => {
915
+ const r = Number(localStorage.getItem(e.audience.storage_keys.open_tabs)) || 0;
916
+ n(r), localStorage.setItem(
917
+ e.audience.storage_keys.open_tabs,
918
+ (r + 1).toString()
919
+ );
920
+ const o = (c) => {
921
+ c.key === e.audience.storage_keys.open_tabs && n(Number(c.newValue) || 0);
922
+ };
923
+ window.addEventListener("storage", o);
924
+ const s = () => {
925
+ const c = Number(localStorage.getItem(e.audience.storage_keys.open_tabs)) || 0;
926
+ c > 0 && localStorage.setItem(
927
+ e.audience.storage_keys.open_tabs,
928
+ (c - 1).toString()
929
+ );
930
+ };
931
+ return window.addEventListener("beforeunload", s), () => {
932
+ window.removeEventListener("storage", o), window.removeEventListener("beforeunload", s);
933
+ };
934
+ }, []), t;
935
+ }, Nn = () => {
936
+ const e = L(), [t, n] = x(null);
937
+ return b(() => {
938
+ let r = sessionStorage.getItem(
939
+ e.audience.storage_keys.current_tab
940
+ );
941
+ const o = JSON.parse(
942
+ localStorage.getItem(e.audience.storage_keys.all_tabs) || "[]"
943
+ );
944
+ r && o.includes(r) && (r = null), r || (r = `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, sessionStorage.setItem(
945
+ e.audience.storage_keys.current_tab,
946
+ r
947
+ )), o.includes(r) || (o.push(r), localStorage.setItem(
948
+ e.audience.storage_keys.all_tabs,
949
+ JSON.stringify(o)
950
+ )), n(r);
951
+ const s = () => {
952
+ const c = o.filter(
953
+ (i) => i !== r
954
+ );
955
+ localStorage.setItem(
956
+ e.audience.storage_keys.all_tabs,
957
+ JSON.stringify(c)
958
+ );
959
+ };
960
+ return window.addEventListener("beforeunload", s), () => {
961
+ window.removeEventListener("beforeunload", s);
962
+ };
963
+ }, []), t;
964
+ }, re = (e) => Object.prototype.toString.call(e) == "[object String]", Cn = (e, t) => e.indexOf(t) !== -1, oe = (e) => e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""), qe = (e) => e === void 0, Rn = (e) => e === null, Ke = (e) => qe(e) || Rn(e), Ze = (e) => !!e && (e == null ? void 0 : e.nodeType) === 3;
965
+ function Ln(e) {
966
+ return !!e && (e == null ? void 0 : e.nodeType) === 1;
967
+ }
968
+ function Pn(e, t) {
969
+ return !!e && !!(e != null && e.tagName) && (e == null ? void 0 : e.tagName.toLowerCase()) === t.toLowerCase();
970
+ }
971
+ function An(e) {
972
+ return e ? oe(e).split(/\s+/) : [];
973
+ }
974
+ function In(e) {
975
+ let t = "";
976
+ switch (typeof (e == null ? void 0 : e.className)) {
977
+ case "string":
978
+ t = e == null ? void 0 : e.className;
979
+ break;
980
+ // TODO: when is this ever used?
981
+ case "object":
982
+ t = (e != null && e.className && "baseVal" in (e == null ? void 0 : e.className) ? (e == null ? void 0 : e.className).baseVal : null) || (e == null ? void 0 : e.getAttribute("class")) || "";
983
+ break;
984
+ default:
985
+ t = "";
986
+ }
987
+ return An(t);
988
+ }
989
+ const W = (e, t = 255) => Ke(e) ? "" : oe(e).split(/(\s+)/).filter((n) => be(n)).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, t), pe = (e) => {
990
+ let t = "";
991
+ if ($n(e) && // !isSensitiveElement(el) &&
992
+ (e != null && e.childNodes) && (e != null && e.childNodes.length))
993
+ for (const n of e == null ? void 0 : e.childNodes)
994
+ Ze(n) && n.textContent && (t += W(n.textContent) ?? "");
995
+ return oe(t);
996
+ }, Dn = (e) => {
997
+ var t, n;
998
+ return qe(e.target) ? (e == null ? void 0 : e.srcElement) || null : (t = e == null ? void 0 : e.target) != null && t.shadowRoot ? ((n = e == null ? void 0 : e.composedPath()) == null ? void 0 : n[0]) || null : (e == null ? void 0 : e.target) || null;
999
+ }, Mn = (e, t) => {
1000
+ if (!window || !e || Pn(e, "html") || !Ln(e))
1001
+ return !1;
1002
+ const n = window.getComputedStyle(e);
1003
+ if (n && n.getPropertyValue("cursor") === "pointer" && t.type === "click")
1004
+ return !0;
1005
+ switch (e == null ? void 0 : e.tagName.toLowerCase()) {
1006
+ case "html":
1007
+ return !1;
1008
+ case "form":
1009
+ return t.type === "submit";
1010
+ case "input":
1011
+ case "select":
1012
+ case "textarea":
1013
+ return ["change", "click"].includes(t.type);
1014
+ default:
1015
+ return t.type === "click";
1016
+ }
1017
+ };
1018
+ function $n(e) {
1019
+ if (Cn(In(e), "ph-include"))
1020
+ return !0;
1021
+ const t = e.type || "";
1022
+ if (re(t))
1023
+ switch (t.toLowerCase()) {
1024
+ case "hidden":
1025
+ return !1;
1026
+ case "password":
1027
+ return !1;
1028
+ }
1029
+ const n = e.name || (e == null ? void 0 : e.id) || "";
1030
+ return !(re(n) && /^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g, "")));
1031
+ }
1032
+ const Qe = "(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})", Fn = new RegExp(`^(?:${Qe})$`), Wn = new RegExp(Qe), et = "\\d{3}-?\\d{2}-?\\d{4}", Bn = new RegExp(`^(${et})$`), Un = new RegExp(`(${et})`), be = (e, t = !0) => !(Ke(e) || re(e) && (e = oe(e), (t ? Fn : Wn).test((e || "").replace(/[- ]/g, "")) || (t ? Bn : Un).test(e))), Yn = (e) => re(e) ? e.substring(0, 10) === "_ngcontent" || e.substring(0, 7) === "_nghost" : !1, zn = (e) => {
1033
+ let t = pe(e);
1034
+ return t = `${t} ${tt(e)}`.trim(), be(t) ? t : "";
1035
+ };
1036
+ function tt(e) {
1037
+ var n;
1038
+ let t = "";
1039
+ if (e != null && e.childNodes.length) {
1040
+ for (const r of e.childNodes)
1041
+ if (r && ((n = r.tagName) == null ? void 0 : n.toLowerCase()) === "span")
1042
+ try {
1043
+ const o = pe(r);
1044
+ t = `${t} ${o}`.trim(), r != null && r.childNodes.length && (t = `${t} ${tt(r)}`.trim());
1045
+ } catch {
1046
+ }
1047
+ }
1048
+ return t;
1049
+ }
1050
+ const Hn = ["input", "textarea", "select"], nt = (e) => {
1051
+ var o, s, c, i;
1052
+ const t = (o = e == null ? void 0 : e.tagName) == null ? void 0 : o.toLowerCase(), n = {
1053
+ element: t
1054
+ };
1055
+ (t == null ? void 0 : t.toLowerCase()) === "a" || (t == null ? void 0 : t.toLowerCase()) === "button" ? n.text = zn(e) : n.text = pe(e);
1056
+ const r = Array.from(e.attributes).reduce(
1057
+ (u, l) => {
1058
+ if (be(l.value) && !Yn(l.name)) {
1059
+ if (l.name === "class")
1060
+ return u;
1061
+ u[l.name] = typeof (l == null ? void 0 : l.value) == "string" ? W(l.value) : l.value;
1062
+ }
1063
+ return u;
1064
+ },
1065
+ {}
1066
+ );
1067
+ if (n.attributes = r, Hn.includes(t) || (e == null ? void 0 : e.getAttribute("contenteditable")) === "true") {
1068
+ let u;
1069
+ e.matches('input[type="checkbox"], input[type="radio"]') ? u = e.checked : e.matches("input, select, textarea") && !e.matches('input[type="password"]') && (u = e.value), u !== void 0 && (n.value = typeof u == "string" || u === null ? W(u, 1024) : u);
1070
+ let l = "";
1071
+ n != null && n.attributes.id && (l = W(
1072
+ ((c = (s = document.querySelector(`label[for="${n == null ? void 0 : n.attributes.id}"]`)) == null ? void 0 : s.textContent) == null ? void 0 : c.trim()) || ""
1073
+ ));
1074
+ const p = e.closest("label");
1075
+ l || (l = W(((i = p == null ? void 0 : p.textContent) == null ? void 0 : i.trim()) || "")), l && (n.label = l);
1076
+ }
1077
+ return n;
1078
+ }, Gn = (e, t) => {
1079
+ var o;
1080
+ let n = Dn(e);
1081
+ Ze(n) && (n = n.parentNode || null);
1082
+ const r = ["copy", "cut"].includes(t);
1083
+ if (n && (r || Mn(n, e))) {
1084
+ const s = nt(n);
1085
+ if (r) {
1086
+ const c = W((o = window == null ? void 0 : window.getSelection()) == null ? void 0 : o.toString()), i = (e == null ? void 0 : e.type) || "clipboard";
1087
+ s.copy_text = c ?? "", s.copy_type = i;
1088
+ }
1089
+ return s;
1090
+ }
1091
+ return null;
1092
+ }, Vn = 30, Jn = 1e3, Xn = 3;
1093
+ class qn {
1094
+ constructor() {
1095
+ J(this, "clicks");
1096
+ this.clicks = [];
1097
+ }
1098
+ isRageClick(t, n, r) {
1099
+ const o = this.clicks[this.clicks.length - 1];
1100
+ if (o && Math.abs(t - o.x) + Math.abs(n - o.y) < Vn && r - o.timestamp < Jn) {
1101
+ if (this.clicks.push({ x: t, y: n, timestamp: r }), this.clicks.length === Xn)
1102
+ return !0;
1103
+ } else
1104
+ this.clicks = [{ x: t, y: n, timestamp: r }];
1105
+ return !1;
1106
+ }
1107
+ }
1108
+ const fe = new qn(), Kn = () => {
1109
+ const { audience: e } = L();
1110
+ b(() => {
1111
+ let t = null;
1112
+ const n = (s) => {
1113
+ if (t) {
1114
+ clearTimeout(t), t = null;
1115
+ return;
1116
+ }
1117
+ t = setTimeout(() => {
1118
+ o(s, !1), t = null;
1119
+ }, 250);
1120
+ }, r = (s) => {
1121
+ t && (clearTimeout(t), t = null), o(s, !0);
1122
+ }, o = (s, c = !1) => {
1123
+ var i;
1124
+ try {
1125
+ let u = {
1126
+ hostname: window.location.hostname,
1127
+ pathname: window.location.pathname,
1128
+ page_title: document.title,
1129
+ url: window.location.href,
1130
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1131
+ event_type: c ? "dblclick" : "click",
1132
+ button_type: s.button
1133
+ };
1134
+ if (s.target instanceof HTMLElement) {
1135
+ const l = s.target;
1136
+ u.rage_click = fe == null ? void 0 : fe.isRageClick(
1137
+ s.clientX,
1138
+ s.clientY,
1139
+ (/* @__PURE__ */ new Date()).getTime()
1140
+ ), u = {
1141
+ ...u,
1142
+ ...nt(l)
1143
+ };
1144
+ let p = l == null ? void 0 : l.getAttribute("href");
1145
+ if (!p) {
1146
+ let d = l.parentNode, f = 0;
1147
+ for (; d && f < 8; ) {
1148
+ const v = (i = d == null ? void 0 : d.parentElement) == null ? void 0 : i.getAttribute("href");
1149
+ if (v) {
1150
+ p = v;
1151
+ break;
1152
+ }
1153
+ d = d.parentNode, f++;
1154
+ }
1155
+ }
1156
+ e == null || e.track("page.click", {
1157
+ ...u,
1158
+ href: p || void 0
1159
+ });
1160
+ }
1161
+ } catch {
1162
+ }
1163
+ };
1164
+ return document.addEventListener("click", n), document.addEventListener("dblclick", r), () => {
1165
+ document.removeEventListener("click", n), document.removeEventListener("dblclick", r);
1166
+ };
1167
+ }, [e]);
1168
+ }, Z = (e) => Number(e.toFixed(0)), Zn = (e) => {
1169
+ const { audience: t } = L(), [n] = x({
1170
+ value: Z(performance.now()),
1171
+ timestamp: Z(Date.now())
1172
+ }), [r, o] = x({
1173
+ value: null,
1174
+ timestamp: null
1175
+ }), [s, c] = x({
1176
+ value: null,
1177
+ timestamp: null
1178
+ });
1179
+ return b(() => {
1180
+ let i = !0;
1181
+ const u = (d, f) => {
1182
+ i && d({ value: Z(f), timestamp: Z(Date.now()) });
1183
+ }, l = new PerformanceObserver((d) => {
1184
+ for (const f of d.getEntries())
1185
+ f.name === "first-contentful-paint" && u(o, f.startTime);
1186
+ });
1187
+ l.observe({ type: "paint", buffered: !0 });
1188
+ const p = () => u(c, performance.now());
1189
+ return document.readyState === "complete" ? u(c, performance.now()) : window.addEventListener("load", p), () => {
1190
+ i = !1, l.disconnect(), window.removeEventListener("load", p);
1191
+ };
1192
+ }, []), b(() => {
1193
+ n && t && (t == null || t.track("page.metrics", {
1194
+ script_load: n.value,
1195
+ script_load_at: n.timestamp,
1196
+ version: 2
1197
+ }));
1198
+ }, [n, t]), b(() => {
1199
+ r.value !== null && t && (t == null || t.track("page.metrics", {
1200
+ first_contentful_paint: r.value,
1201
+ first_contentful_paint_at: r.timestamp,
1202
+ version: 2
1203
+ }));
1204
+ }, [r, t]), b(() => {
1205
+ s.value !== null && t && (t == null || t.track("page.metrics", {
1206
+ window_onload: s.value,
1207
+ window_onload_at: s.timestamp,
1208
+ version: 2
1209
+ }));
1210
+ }, [s, t]), { script: n, fcp: r, window_onload: s };
1211
+ }, Qn = () => {
1212
+ const { audience: e } = L();
1213
+ b(() => {
1214
+ let t;
1215
+ const n = () => {
1216
+ clearTimeout(t), t = setTimeout(() => {
1217
+ const r = window.getSelection();
1218
+ if (r && (r == null ? void 0 : r.rangeCount) > 0) {
1219
+ const o = r == null ? void 0 : r.toString();
1220
+ o && (e == null || e.track("page.selection", {
1221
+ text: W(o)
1222
+ }));
1223
+ }
1224
+ }, 1e3);
1225
+ };
1226
+ return document.addEventListener("selectionchange", n), () => {
1227
+ clearTimeout(t), document.removeEventListener("selectionchange", n);
1228
+ };
1229
+ }, []);
1230
+ }, Re = "lv_insights_st", er = 15 * 60 * 1e3, tr = (e = "https://cachefly.cachefly.net/1mb.test") => {
1231
+ const [t, n] = x(null);
1232
+ return b(() => {
1233
+ const r = localStorage.getItem(Re);
1234
+ if (r) {
1235
+ const { speed: i, timestamp: u } = JSON.parse(r);
1236
+ if (Date.now() - u < er) {
1237
+ n(i);
1238
+ return;
1239
+ }
1240
+ }
1241
+ let o = null;
1242
+ const s = async () => {
1243
+ const i = new ft("download_speed");
1244
+ if (i.acquireLock())
1245
+ try {
1246
+ const l = performance.now();
1247
+ await fetch(e, { cache: "no-store" });
1248
+ const d = (performance.now() - l) / 1e3, f = Math.round(8 / d);
1249
+ n(f), localStorage.setItem(
1250
+ Re,
1251
+ JSON.stringify({ speed: f, timestamp: Date.now() })
1252
+ );
1253
+ } catch {
1254
+ } finally {
1255
+ i.releaseLock();
1256
+ }
1257
+ }, c = () => {
1258
+ document.removeEventListener("mousemove", c), document.removeEventListener("keydown", c), document.removeEventListener("scroll", c), o = setTimeout(s, 5e3);
1259
+ };
1260
+ return document.addEventListener("mousemove", c, { once: !0 }), document.addEventListener("keydown", c, { once: !0 }), document.addEventListener("scroll", c, { once: !0 }), () => {
1261
+ o && clearTimeout(o), document.removeEventListener("mousemove", c), document.removeEventListener("keydown", c), document.removeEventListener("scroll", c);
1262
+ };
1263
+ }, [e]), t;
1264
+ }, nr = ({
1265
+ id: e,
1266
+ properties: t = {},
1267
+ href: n
1268
+ }) => {
1269
+ const r = L();
1270
+ b(() => {
1271
+ (() => {
1272
+ var s, c;
1273
+ r != null && r.insightsUrl && r.workspace && n && ((s = r == null ? void 0 : r.audience) != null && s.instance ? r == null || r.audience.instance.page({
1274
+ resource: "page",
1275
+ identifier: e
1276
+ }) : (c = r == null ? void 0 : r.audience) == null || c.initiate({
1277
+ ...t,
1278
+ id: e,
1279
+ created_at: (/* @__PURE__ */ new Date()).toISOString()
1280
+ }));
1281
+ })();
1282
+ }, [r == null ? void 0 : r.insightsUrl, r == null ? void 0 : r.workspace, n]), b(() => {
1283
+ const o = (s) => {
1284
+ var i;
1285
+ const c = localStorage.getItem(
1286
+ r.audience.storage_keys.identify
1287
+ );
1288
+ s.key === r.audience.storage_keys.identify && !(r != null && r.audience.is_identified) && !c && ((i = r == null ? void 0 : r.audience) == null || i.identify({
1289
+ withLock: !1
1290
+ }));
1291
+ };
1292
+ return window.addEventListener("storage", o), () => {
1293
+ window.removeEventListener("storage", o);
1294
+ };
1295
+ }, []);
1296
+ }, rr = ({ id: e }) => {
1297
+ const t = L();
1298
+ b(() => {
1299
+ const r = () => {
1300
+ var c, i;
1301
+ const o = (c = performance.getEntriesByType(
1302
+ "navigation"
1303
+ )) == null ? void 0 : c[0];
1304
+ let s = !1;
1305
+ if (o)
1306
+ o.type === "navigate" && (s = !0);
1307
+ else
1308
+ try {
1309
+ const u = document.activeElement;
1310
+ (u == null ? void 0 : u.tagName) === "A" && u.href && (new URL(u.href).origin !== window.location.origin ? s = !0 : s = !1);
1311
+ } catch {
1312
+ }
1313
+ (i = t == null ? void 0 : t.audience) == null || i.bounce({
1314
+ resource: "page",
1315
+ identifier: e,
1316
+ is_navigating_away: s,
1317
+ navigation_type: o == null ? void 0 : o.type
1318
+ });
1319
+ };
1320
+ return window.addEventListener("beforeunload", r), () => {
1321
+ window.removeEventListener("beforeunload", r);
1322
+ };
1323
+ }, [t == null ? void 0 : t.audience, e]);
1324
+ const [n] = mt();
1325
+ b(() => {
1326
+ var r;
1327
+ (n === le.HIDDEN || n === le.UNKNOWN || n === le.FROZEN) && ((r = t == null ? void 0 : t.audience) == null || r.bounce({
1328
+ resource: "page",
1329
+ identifier: e,
1330
+ state: n
1331
+ }));
1332
+ }, [n, t == null ? void 0 : t.audience, e]);
1333
+ }, $r = ({ id: e, properties: t = {} }) => {
1334
+ var c;
1335
+ const n = typeof window < "u" ? window.location.href : "", r = L();
1336
+ b(() => {
1337
+ r && typeof window < "u" && (window.levo_client = r);
1338
+ }, [r]), b(() => {
1339
+ r != null && r.audience && typeof window < "u" && (window.levo_audience = r == null ? void 0 : r.audience);
1340
+ }, []), jn(), Nn(), Kn();
1341
+ const o = tr();
1342
+ b(() => {
1343
+ var i;
1344
+ (i = r == null ? void 0 : r.audience) != null && i.instance && o && (r == null || r.audience.track("user.speedtest", {
1345
+ speed: o,
1346
+ unit: "Mbps"
1347
+ }));
1348
+ }, [o]);
1349
+ const s = On();
1350
+ return b(() => {
1351
+ var i;
1352
+ (i = r == null ? void 0 : r.audience) != null && i.instance && (r == null || r.audience.track("page.scroll", {
1353
+ resource: "page",
1354
+ identifier: e,
1355
+ percent: s.depth,
1356
+ speed_category: s.speedCategory
1357
+ }));
1358
+ }, [
1359
+ (c = r == null ? void 0 : r.audience) == null ? void 0 : c.instance,
1360
+ s.depth,
1361
+ s.speedCategory,
1362
+ e
1363
+ ]), Zn(), Qn(), nr({
1364
+ href: n,
1365
+ id: e,
1366
+ properties: t
1367
+ }), rr({ id: e }), b(() => {
1368
+ const i = {
1369
+ change: "form.change",
1370
+ submit: "form.submit",
1371
+ copy: "page.copy",
1372
+ cut: "page.copy"
1373
+ }, u = (p) => (d) => {
1374
+ var v;
1375
+ const f = Gn(d, p);
1376
+ f && i[p] && ((v = r == null ? void 0 : r.audience) == null || v.track(i[p], f));
1377
+ }, l = {
1378
+ change: u("change"),
1379
+ copy: u("copy"),
1380
+ cut: u("cut"),
1381
+ submit: u("submit")
1382
+ };
1383
+ return document.addEventListener("change", l.change), document.addEventListener("copy", l.copy), document.addEventListener("cut", l.cut), document.addEventListener("submit", l.submit), () => {
1384
+ document.removeEventListener("change", l.change), document.removeEventListener("copy", l.copy), document.removeEventListener("cut", l.cut), document.removeEventListener("submit", l.submit);
1385
+ };
1386
+ }, []), (!(r != null && r.insightsUrl) || !r.workspace || !r.workspace.startsWith("W")) && console.error(
1387
+ "[@levo-so/react] The utility could not be initialized, due to missing workspace, or endpoint for insights."
1388
+ ), null;
1389
+ }, rt = I.createContext({
1390
+ urls: null,
1391
+ title: "",
1392
+ isLoading: !1,
1393
+ onSuccess: () => {
1394
+ },
1395
+ onError: () => {
1396
+ }
1397
+ }), or = ({
1398
+ title: e,
1399
+ onSuccess: t,
1400
+ onError: n,
1401
+ children: r
1402
+ }) => {
1403
+ const o = L(), s = typeof window < "u" ? window.location.href : "", [c, i] = x(null), [u, l] = x(!1);
1404
+ b(() => {
1405
+ var d;
1406
+ o.membership && (l(!0), (d = o.membership) == null || d.getOAuthURL().then((f) => {
1407
+ i(f);
1408
+ }).catch((f) => {
1409
+ n({
1410
+ code: (f == null ? void 0 : f.code) || "SOMETHING_WENT_WRONG",
1411
+ message: (f == null ? void 0 : f.message) || "We could not connect with our service for your sign-in."
1412
+ });
1413
+ }).finally(() => {
1414
+ l(!1);
1415
+ }));
1416
+ }, []);
1417
+ const p = Ae(
1418
+ () => ({ title: e, urls: c, isLoading: u, onSuccess: t, onError: n }),
1419
+ [e, c, t, n, u]
1420
+ );
1421
+ return b(() => {
1422
+ if (c && s) {
1423
+ const d = {}, f = Object.keys(c);
1424
+ for (const v of f)
1425
+ try {
1426
+ const S = c[v];
1427
+ if (S) {
1428
+ const _ = new URL(S), N = _.searchParams;
1429
+ N.set("redirect_uri", s);
1430
+ const C = o.pageContext;
1431
+ C && N.set("page_context", JSON.stringify(C)), d[v] = _.toString();
1432
+ }
1433
+ } catch {
1434
+ }
1435
+ i(d);
1436
+ }
1437
+ }, [s]), /* @__PURE__ */ m.jsx(rt.Provider, { value: p, children: r });
1438
+ }, sr = () => Pe(rt), ar = ({ url: e, title: t, height: n, width: r }) => {
1439
+ const o = window.screenX + (window.outerWidth - r) / 2, s = window.screenY + (window.outerHeight - n) / 2.5;
1440
+ return window.open(
1441
+ e,
1442
+ t,
1443
+ `width=${r},height=${n},left=${o},top=${s}`
1444
+ );
1445
+ }, ir = ({
1446
+ title: e = "",
1447
+ width: t = 500,
1448
+ height: n = 500,
1449
+ url: r,
1450
+ children: o,
1451
+ onCode: s,
1452
+ onClose: c
1453
+ }) => {
1454
+ const [i, u] = x(), l = Ie(void 0), p = () => {
1455
+ window.clearInterval(l.current);
1456
+ }, d = () => {
1457
+ u(
1458
+ ar({
1459
+ url: r,
1460
+ title: e,
1461
+ width: t,
1462
+ height: n
1463
+ })
1464
+ );
1465
+ };
1466
+ return b(() => (i && (l.current = window.setInterval(() => {
1467
+ try {
1468
+ const f = i.location.href, v = new URL(f).searchParams, S = v.get("code");
1469
+ if (!S)
1470
+ return;
1471
+ s(S, v), p(), i.close();
1472
+ } catch {
1473
+ } finally {
1474
+ (!i || i.closed) && (c(), p());
1475
+ }
1476
+ }, 700)), () => {
1477
+ i && i.close(), c && c();
1478
+ }), [i]), /* @__PURE__ */ m.jsx(
1479
+ "div",
1480
+ {
1481
+ onClick: () => {
1482
+ d();
1483
+ },
1484
+ children: o
1485
+ }
1486
+ );
1487
+ }, cr = ({
1488
+ title: e = "Levo",
1489
+ url: t,
1490
+ children: n,
1491
+ onSuccess: r,
1492
+ onError: o,
1493
+ width: s = 500,
1494
+ height: c = 700
1495
+ }) => {
1496
+ const i = me((u, l) => {
1497
+ u.toLowerCase() === "success" ? r(l) : o(l);
1498
+ }, []);
1499
+ return /* @__PURE__ */ m.jsx(
1500
+ ir,
1501
+ {
1502
+ title: e,
1503
+ width: s,
1504
+ height: c,
1505
+ onClose: () => {
1506
+ },
1507
+ url: t,
1508
+ onCode: i,
1509
+ children: n
1510
+ }
1511
+ );
1512
+ }, ur = ({ children: e, provider: t }) => {
1513
+ const { title: n, urls: r, isLoading: o, onSuccess: s, onError: c } = sr(), i = r == null ? void 0 : r[t];
1514
+ return i ? /* @__PURE__ */ m.jsx(
1515
+ cr,
1516
+ {
1517
+ title: n,
1518
+ provider: t,
1519
+ url: i,
1520
+ onSuccess: s,
1521
+ onError: c,
1522
+ children: o ? /* @__PURE__ */ m.jsx("div", { className: "w-full items-center justify-center", children: /* @__PURE__ */ m.jsx(Yt, { className: "bg-brand h-5 w-5" }) }) : e
1523
+ }
1524
+ ) : null;
1525
+ }, lr = ({ url: e, title: t, height: n, width: r }) => {
1526
+ const o = window.screenX + (window.outerWidth - r) / 2, s = window.screenY + (window.outerHeight - n) / 2.5;
1527
+ return window.open(
1528
+ e,
1529
+ t,
1530
+ `width=${r},height=${n},left=${o},top=${s}`
1531
+ );
1532
+ }, Fr = ({
1533
+ title: e = "Levo",
1534
+ width: t = 500,
1535
+ height: n = 700,
1536
+ onSuccess: r
1537
+ }) => {
1538
+ const o = L(), [s, c] = x(!1), [i, u] = x(null), [l, p] = x(null), [d, f] = x(), v = Ie(void 0), S = () => {
1539
+ window.clearInterval(v.current);
1540
+ }, _ = me((T, y) => {
1541
+ T.toLowerCase() === "success" ? (p(null), r(y)) : p(y);
1542
+ }, []);
1543
+ b(() => {
1544
+ var T;
1545
+ o.membership && (c(!0), (T = o.membership) == null || T.getOAuthURL().then((y) => {
1546
+ if (y)
1547
+ return u(y), y;
1548
+ throw new Error();
1549
+ }).catch((y) => {
1550
+ var M;
1551
+ const O = Me(y);
1552
+ (M = o.logger) == null || M.error("Failed to get OAuth URL", O.message), p({
1553
+ code: (O == null ? void 0 : O.code) || "SOMETHING_WENT_WRONG",
1554
+ message: (O == null ? void 0 : O.message) || "We could not connect with our service for your sign-in."
1555
+ });
1556
+ }).finally(() => {
1557
+ c(!1);
1558
+ }));
1559
+ }, []), b(() => (d && (v.current = window.setInterval(() => {
1560
+ try {
1561
+ const T = d.location.href, y = new URL(T).searchParams, O = y.get("code");
1562
+ if (!O)
1563
+ return;
1564
+ _(O, y), S(), d.close();
1565
+ } catch {
1566
+ } finally {
1567
+ (!d || d.closed) && (S(), p(null));
1568
+ }
1569
+ }, 700)), () => {
1570
+ d && d.close();
1571
+ }), [d]);
1572
+ const N = me(
1573
+ (T) => {
1574
+ if (T && i !== null) {
1575
+ const y = i == null ? void 0 : i[T];
1576
+ y && (d && d.close(), f(
1577
+ lr({
1578
+ url: y,
1579
+ title: e,
1580
+ width: t,
1581
+ height: n
1582
+ })
1583
+ ));
1584
+ }
1585
+ },
1586
+ [i, d]
1587
+ );
1588
+ return {
1589
+ providers: Ae(() => i !== null ? Object.keys(i).filter(
1590
+ (T) => !!i[T]
1591
+ ) : [], [i]),
1592
+ isLoading: s,
1593
+ error: l,
1594
+ launchPopup: N
1595
+ };
69
1596
  };
1597
+ class Le {
1598
+ }
1599
+ J(Le, "Container", or), J(Le, "Button", ur);
70
1600
  export {
71
- h as Button,
72
- M as Dialog,
73
- O as DialogClose,
74
- E as DialogContent,
75
- F as DialogDescription,
76
- w as DialogFooter,
77
- B as DialogHeader,
78
- C as DialogOverlay,
79
- P as DialogPortal,
80
- S as DialogTitle,
81
- I as DialogTrigger,
82
- k as DialogWrapper,
83
- u as LevoInsightsBlock,
84
- T as LevoInsightsComponent,
85
- b as LevoInsightsPage,
86
- y as LevoOAuth,
87
- v as LevoProvider,
88
- A as SimpleTooltipWrapper,
89
- _ as Spinner,
90
- H as Tabs,
91
- K as TabsContent,
92
- W as TabsList,
93
- q as TabsTrigger,
94
- R as Toaster,
95
- z as Tooltip,
96
- N as TooltipContent,
97
- U as TooltipPortal,
98
- V as TooltipProvider,
99
- G as TooltipTrigger,
100
- r as allMediaFileExtensions,
101
- d as allMediaMimetypes,
102
- t as audioFileExtensions,
103
- g as audioMimetype,
104
- J as buttonVariants,
105
- oo as byteToSize,
106
- mo as cn,
107
- a as documentFileExtensions,
108
- n as documentMimetype,
109
- eo as errorHandler,
110
- X as errorToast,
111
- s as imageFileExtensions,
112
- p as imageMimetype,
113
- ao as isDateObject,
114
- so as isEmptyObject,
115
- io as isNullOrUndefined,
116
- to as isObject,
117
- no as isObjectType,
118
- e as mediaExtensionsByKind,
119
- o as mediaMimetypeByKind,
120
- Y as successToast,
121
- ro as toast,
122
- x as useLevo,
123
- j as useLevoOAuth,
124
- i as videoFileExtensions,
125
- m as videoMimetype
1601
+ $t as Button,
1602
+ Ft as Dialog,
1603
+ Sr as DialogClose,
1604
+ Ue as DialogContent,
1605
+ He as DialogDescription,
1606
+ Bt as DialogFooter,
1607
+ Ye as DialogHeader,
1608
+ Be as DialogOverlay,
1609
+ Wt as DialogPortal,
1610
+ ze as DialogTitle,
1611
+ kr as DialogTrigger,
1612
+ _r as DialogWrapper,
1613
+ Dr as LevoInsightsBlock,
1614
+ Mr as LevoInsightsComponent,
1615
+ $r as LevoInsightsPage,
1616
+ Le as LevoOAuth,
1617
+ Ir as LevoProvider,
1618
+ Rr as SimpleTooltipWrapper,
1619
+ Yt as Spinner,
1620
+ Nr as Tabs,
1621
+ Gt as TabsContent,
1622
+ zt as TabsList,
1623
+ Ht as TabsTrigger,
1624
+ Or as Toaster,
1625
+ Vt as Tooltip,
1626
+ Ge as TooltipContent,
1627
+ Xt as TooltipPortal,
1628
+ Cr as TooltipProvider,
1629
+ Jt as TooltipTrigger,
1630
+ Tr as allMediaFileExtensions,
1631
+ Er as allMediaMimetypes,
1632
+ xt as audioFileExtensions,
1633
+ St as audioMimetype,
1634
+ Mt as buttonVariants,
1635
+ Lr as byteToSize,
1636
+ R as cn,
1637
+ ht as documentFileExtensions,
1638
+ Tt as documentMimetype,
1639
+ Pr as errorHandler,
1640
+ Ut as errorToast,
1641
+ wt as imageFileExtensions,
1642
+ Et as imageMimetype,
1643
+ qt as isDateObject,
1644
+ Ar as isEmptyObject,
1645
+ Kt as isNullOrUndefined,
1646
+ Qt as isObject,
1647
+ Zt as isObjectType,
1648
+ q as mediaExtensionsByKind,
1649
+ X as mediaMimetypeByKind,
1650
+ jr as successToast,
1651
+ Ur as toast,
1652
+ L as useLevo,
1653
+ Fr as useLevoOAuth,
1654
+ yt as videoFileExtensions,
1655
+ kt as videoMimetype
126
1656
  };