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