@levo-so/react 0.1.36 → 0.1.40
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/{Sonner-t6JVKA0a.js → Sonner-5IAqCkBs.js} +12 -9
- package/dist/Tooltip-DcdGb876.js +383 -0
- package/dist/audience/components/block.d.ts.map +1 -1
- package/dist/audience/components/component.d.ts +2 -2
- package/dist/audience/components/component.d.ts.map +1 -1
- package/dist/audience/components/page.d.ts.map +1 -1
- package/dist/audience/hooks/useBounce.d.ts +4 -0
- package/dist/audience/hooks/useBounce.d.ts.map +1 -0
- package/dist/audience/hooks/useCurrentTab.d.ts.map +1 -1
- package/dist/audience/hooks/useDownloadSpeed.d.ts.map +1 -1
- package/dist/audience/hooks/useIdentifyAudience.d.ts +7 -0
- package/dist/audience/hooks/useIdentifyAudience.d.ts.map +1 -0
- package/dist/audience/hooks/useOpenTabs.d.ts.map +1 -1
- package/dist/audience/hooks/usePerformanceMetrics.d.ts.map +1 -1
- package/dist/audience/index.js +1 -1
- package/dist/audience/utils/autocapture.d.ts.map +1 -1
- package/dist/components/Sonner.d.ts.map +1 -1
- package/dist/components/Spinner.d.ts.map +1 -1
- package/dist/components/button/buttonVariants.d.ts +1 -1
- package/dist/components/button/buttonVariants.d.ts.map +1 -1
- package/dist/components/index.js +20 -21
- package/dist/index.css +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +121 -83
- package/dist/isEmptyObject-B9yh0nbg.js +19 -0
- package/dist/{jsx-runtime-B6kdoens.js → jsx-runtime-D0AQ1Mn7.js} +216 -217
- package/dist/membership/index.d.ts +1 -1
- package/dist/membership/index.d.ts.map +1 -1
- package/dist/membership/index.js +1 -1
- package/dist/page-DweUjn1K.js +627 -0
- package/dist/providers/index.js +1 -1
- package/dist/utils/byteToSize.d.ts.map +1 -1
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/errorHandler.d.ts.map +1 -1
- package/dist/utils/index.js +10 -12
- package/dist/utils/isDateObject.d.ts.map +1 -1
- package/dist/utils/isEmptyObject.d.ts.map +1 -1
- package/dist/utils/isNullOrUndefined.d.ts.map +1 -1
- package/dist/utils/isObject.d.ts.map +1 -1
- package/package.json +7 -12
- package/dist/Checbox-sq-atGlJ.js +0 -28
- package/dist/CheckboxWidget-3qTjxIlp.js +0 -124
- package/dist/CollectionFormBuilder-CUzpwIva.js +0 -1195
- package/dist/CurrencyWidget-DgH4uCpg.js +0 -60
- package/dist/DateTimeWidget-C2hLHKU6.js +0 -80
- package/dist/DefaultFormVariant-Cm9i2BBn.js +0 -81
- package/dist/DropdownWidget-B6mRXcTa.js +0 -115
- package/dist/EmailWidget-CBFnvo9z.js +0 -41
- package/dist/FormCaptcha-btA0HfMx.js +0 -187
- package/dist/GeocoderWidget-DZGXm9Ji.js +0 -68
- package/dist/Input-Vv7mKQFt.js +0 -54
- package/dist/MultiGeocoderWidget-D7ogTcWu.js +0 -49
- package/dist/MultiTextWidget-DYxi8PHm.js +0 -33
- package/dist/PhoneWidget-BxaGCfLs.js +0 -48
- package/dist/RadioWidget-Bkq1Oudi.js +0 -109
- package/dist/RichTextWidget-Caqhw4GK.js +0 -310
- package/dist/Spinner-BcBoT-J5.js +0 -410
- package/dist/StepsFormVariant-D-m93LMv.js +0 -140
- package/dist/SwitchWidget-BpAzgVui.js +0 -53
- package/dist/TextWidget-CHkFlxmT.js +0 -33
- package/dist/TextareaWidget-B0htlijX.js +0 -30
- package/dist/ToggleCheckboxWidget-DLrS6ax4.js +0 -44
- package/dist/Tooltip-DoWyn3Ho.js +0 -37
- package/dist/URLWidget-CnWKNlOF.js +0 -14
- package/dist/UploadWidget-DSvWOBuR.js +0 -656
- package/dist/byteToSize-BFKZSBu1.js +0 -8
- package/dist/cn-C9QoOYNG.js +0 -6
- package/dist/collection/components/Altcha.d.ts +0 -10
- package/dist/collection/components/Altcha.d.ts.map +0 -1
- package/dist/collection/components/CollectionFormBuilder.d.ts +0 -12
- package/dist/collection/components/CollectionFormBuilder.d.ts.map +0 -1
- package/dist/collection/components/FieldRenderer.d.ts +0 -9
- package/dist/collection/components/FieldRenderer.d.ts.map +0 -1
- package/dist/collection/components/FormCaptcha.d.ts +0 -3
- package/dist/collection/components/FormCaptcha.d.ts.map +0 -1
- package/dist/collection/components/core/AsyncSelectPaginate/AsyncSelectPaginate.d.ts +0 -5
- package/dist/collection/components/core/AsyncSelectPaginate/AsyncSelectPaginate.d.ts.map +0 -1
- package/dist/collection/components/core/Checkbox/Checbox.d.ts +0 -5
- package/dist/collection/components/core/Checkbox/Checbox.d.ts.map +0 -1
- package/dist/collection/components/core/Input/Input.d.ts +0 -11
- package/dist/collection/components/core/Input/Input.d.ts.map +0 -1
- package/dist/collection/components/core/Switch/Switch.d.ts +0 -5
- package/dist/collection/components/core/Switch/Switch.d.ts.map +0 -1
- package/dist/collection/components/renderer/RenderArrayWidget.d.ts +0 -5
- package/dist/collection/components/renderer/RenderArrayWidget.d.ts.map +0 -1
- package/dist/collection/components/renderer/RenderCommonField.d.ts +0 -5
- package/dist/collection/components/renderer/RenderCommonField.d.ts.map +0 -1
- package/dist/collection/components/renderer/RenderRecordWidget.d.ts +0 -4
- package/dist/collection/components/renderer/RenderRecordWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/ErrorMessage.d.ts +0 -6
- package/dist/collection/components/widgets/ErrorMessage.d.ts.map +0 -1
- package/dist/collection/components/widgets/FieldWrapper.d.ts +0 -14
- package/dist/collection/components/widgets/FieldWrapper.d.ts.map +0 -1
- package/dist/collection/components/widgets/FormHelperText.d.ts +0 -6
- package/dist/collection/components/widgets/FormHelperText.d.ts.map +0 -1
- package/dist/collection/components/widgets/FormLabel.d.ts +0 -8
- package/dist/collection/components/widgets/FormLabel.d.ts.map +0 -1
- package/dist/collection/components/widgets/checkboxWidget/CheckboxWidget.d.ts +0 -8
- package/dist/collection/components/widgets/checkboxWidget/CheckboxWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2M.d.ts +0 -7
- package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2M.d.ts.map +0 -1
- package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2O.d.ts +0 -7
- package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2O.d.ts.map +0 -1
- package/dist/collection/components/widgets/collectionWidget/SelectedCollectionItems.d.ts +0 -8
- package/dist/collection/components/widgets/collectionWidget/SelectedCollectionItems.d.ts.map +0 -1
- package/dist/collection/components/widgets/currencyWidget/CurrencyWidget.d.ts +0 -9
- package/dist/collection/components/widgets/currencyWidget/CurrencyWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/dateTimeWidget/DateTimeWidget.d.ts +0 -8
- package/dist/collection/components/widgets/dateTimeWidget/DateTimeWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/dropdownWidget/DropdownWidget.d.ts +0 -9
- package/dist/collection/components/widgets/dropdownWidget/DropdownWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/emailWidget/EmailWidget.d.ts +0 -8
- package/dist/collection/components/widgets/emailWidget/EmailWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/geocoderWidget/GeocoderWidget.d.ts +0 -8
- package/dist/collection/components/widgets/geocoderWidget/GeocoderWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/multiGeocoderWidget/MultiGeocoderWidget.d.ts +0 -8
- package/dist/collection/components/widgets/multiGeocoderWidget/MultiGeocoderWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/multiTextWidget/MultiTextWidget.d.ts +0 -7
- package/dist/collection/components/widgets/multiTextWidget/MultiTextWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/phoneWidget/PhoneWidget.d.ts +0 -8
- package/dist/collection/components/widgets/phoneWidget/PhoneWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/radioWidget/RadioWidget.d.ts +0 -11
- package/dist/collection/components/widgets/radioWidget/RadioWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/richTextWidget/RichTextWidget.d.ts +0 -12
- package/dist/collection/components/widgets/richTextWidget/RichTextWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/switchWidget/SwitchWidget.d.ts +0 -8
- package/dist/collection/components/widgets/switchWidget/SwitchWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/textWidget/TextWidget.d.ts +0 -9
- package/dist/collection/components/widgets/textWidget/TextWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/textareaWidget/TextareaWidget.d.ts +0 -8
- package/dist/collection/components/widgets/textareaWidget/TextareaWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/toggleCheckboxWidget/ToggleCheckboxWidget.d.ts +0 -8
- package/dist/collection/components/widgets/toggleCheckboxWidget/ToggleCheckboxWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/uploadWidget/CommonPreview.d.ts +0 -11
- package/dist/collection/components/widgets/uploadWidget/CommonPreview.d.ts.map +0 -1
- package/dist/collection/components/widgets/uploadWidget/ExternalURL.d.ts +0 -11
- package/dist/collection/components/widgets/uploadWidget/ExternalURL.d.ts.map +0 -1
- package/dist/collection/components/widgets/uploadWidget/FileUploadDropBox.d.ts +0 -10
- package/dist/collection/components/widgets/uploadWidget/FileUploadDropBox.d.ts.map +0 -1
- package/dist/collection/components/widgets/uploadWidget/FileUploadModal.d.ts +0 -13
- package/dist/collection/components/widgets/uploadWidget/FileUploadModal.d.ts.map +0 -1
- package/dist/collection/components/widgets/uploadWidget/ImportFromAssets.d.ts +0 -11
- package/dist/collection/components/widgets/uploadWidget/ImportFromAssets.d.ts.map +0 -1
- package/dist/collection/components/widgets/uploadWidget/UploadWidget.d.ts +0 -19
- package/dist/collection/components/widgets/uploadWidget/UploadWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/urlWidget/URLWidget.d.ts +0 -5
- package/dist/collection/components/widgets/urlWidget/URLWidget.d.ts.map +0 -1
- package/dist/collection/index.d.ts +0 -5
- package/dist/collection/index.d.ts.map +0 -1
- package/dist/collection/index.js +0 -20
- package/dist/collection/lib/FormBuilder.d.ts +0 -8
- package/dist/collection/lib/FormBuilder.d.ts.map +0 -1
- package/dist/collection/lib/SaveDraftValues.d.ts +0 -7
- package/dist/collection/lib/SaveDraftValues.d.ts.map +0 -1
- package/dist/collection/lib/hooks/useLevoForm.d.ts +0 -18
- package/dist/collection/lib/hooks/useLevoForm.d.ts.map +0 -1
- package/dist/collection/lib/provider/LevoFormProvider.d.ts +0 -9
- package/dist/collection/lib/provider/LevoFormProvider.d.ts.map +0 -1
- package/dist/collection/lib/variants/DefaultFormVariant.d.ts +0 -3
- package/dist/collection/lib/variants/DefaultFormVariant.d.ts.map +0 -1
- package/dist/collection/lib/variants/StepsFormVariant.d.ts +0 -4
- package/dist/collection/lib/variants/StepsFormVariant.d.ts.map +0 -1
- package/dist/collection/types/context.d.ts +0 -34
- package/dist/collection/types/context.d.ts.map +0 -1
- package/dist/collection/types/errors.d.ts +0 -7
- package/dist/collection/types/errors.d.ts.map +0 -1
- package/dist/collection/types/formVariant.d.ts +0 -18
- package/dist/collection/types/formVariant.d.ts.map +0 -1
- package/dist/collection/types/forms.d.ts +0 -31
- package/dist/collection/types/forms.d.ts.map +0 -1
- package/dist/collection/types/index.d.ts +0 -4
- package/dist/collection/types/index.d.ts.map +0 -1
- package/dist/collection/types/renderer.d.ts +0 -6
- package/dist/collection/types/renderer.d.ts.map +0 -1
- package/dist/collection/utils/formHelpers.d.ts +0 -48
- package/dist/collection/utils/formHelpers.d.ts.map +0 -1
- package/dist/collection/utils/getFieldValidations.d.ts +0 -6
- package/dist/collection/utils/getFieldValidations.d.ts.map +0 -1
- package/dist/collection/utils/index.d.ts +0 -6
- package/dist/collection/utils/index.d.ts.map +0 -1
- package/dist/collection/utils/schema.d.ts +0 -3
- package/dist/collection/utils/schema.d.ts.map +0 -1
- package/dist/collection/utils/setFormErrors.d.ts +0 -4
- package/dist/collection/utils/setFormErrors.d.ts.map +0 -1
- package/dist/collection/utils/storage.d.ts +0 -11
- package/dist/collection/utils/storage.d.ts.map +0 -1
- package/dist/errorHandler-_34Yv8wA.js +0 -9
- package/dist/isEmptyObject-C5s4GzLE.js +0 -8
- package/dist/libs.css +0 -1
- package/dist/libs.d.ts +0 -1
- package/dist/page-C1-z2EsC.js +0 -574
|
@@ -2,7 +2,7 @@ export declare class LevoOAuth {
|
|
|
2
2
|
static Container: import('react').FC<import('./components/Container').LevoOAuthProps>;
|
|
3
3
|
static Button: import('react').FC<{
|
|
4
4
|
provider: import('@levo-so/core').ILevoOAuthProvider;
|
|
5
|
-
children:
|
|
5
|
+
children: React.ReactNode;
|
|
6
6
|
}>;
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/membership/index.ts"],"names":[],"mappings":"AAIA,qBAAa,SAAS;IACpB,MAAM,CAAC,SAAS,sEAAa;IAE7B,MAAM,CAAC,MAAM
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/membership/index.ts"],"names":[],"mappings":"AAIA,qBAAa,SAAS;IACpB,MAAM,CAAC,SAAS,sEAAa;IAE7B,MAAM,CAAC,MAAM;;kBAES,MAAO,SAAS;OAFf;CACxB"}
|
package/dist/membership/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var O = Object.defineProperty;
|
|
3
3
|
var R = (e, t, n) => t in e ? O(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
4
|
var m = (e, t, n) => R(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
|
-
import { j as p } from "../jsx-runtime-
|
|
5
|
+
import { j as p } from "../jsx-runtime-D0AQ1Mn7.js";
|
|
6
6
|
import j, { useState as g, useEffect as x, useMemo as y, useContext as P, useRef as U, useCallback as W } from "react";
|
|
7
7
|
import { useLevo as _ } from "../providers/index.js";
|
|
8
8
|
const L = j.createContext({
|
|
@@ -0,0 +1,627 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var te = Object.defineProperty;
|
|
3
|
+
var ne = (e, t, o) => t in e ? te(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
|
|
4
|
+
var U = (e, t, o) => ne(e, typeof t != "symbol" ? t + "" : t, o);
|
|
5
|
+
import { j as oe } from "./jsx-runtime-D0AQ1Mn7.js";
|
|
6
|
+
import { useEffect as f, useState as h } from "react";
|
|
7
|
+
import { useInView as re } from "react-intersection-observer";
|
|
8
|
+
import { useLevo as b } from "./providers/index.js";
|
|
9
|
+
import { LocalStorageLock as se } from "@levo-so/core";
|
|
10
|
+
import { usePageLifecycle as ie, LifecycleState as j } from "use-page-lifecycle";
|
|
11
|
+
const bt = ({ id: e, properties: t = {} }) => {
|
|
12
|
+
const { audience: o } = b(), { ref: n, inView: r } = re({
|
|
13
|
+
triggerOnce: !0
|
|
14
|
+
});
|
|
15
|
+
return f(() => {
|
|
16
|
+
o != null && o.instance && r && (o == null || o.track("block.view", {
|
|
17
|
+
...t,
|
|
18
|
+
resource: "block",
|
|
19
|
+
identifier: e
|
|
20
|
+
}));
|
|
21
|
+
}, [r]), /* @__PURE__ */ oe.jsx("div", { ref: n, style: { height: "0px" } });
|
|
22
|
+
}, wt = ({ event: e, properties: t }) => {
|
|
23
|
+
const { audience: o } = b();
|
|
24
|
+
return f(() => {
|
|
25
|
+
o != null && o.instance && (o == null || o.track(e, t));
|
|
26
|
+
}, [o == null ? void 0 : o.instance, e, t]), null;
|
|
27
|
+
};
|
|
28
|
+
function A(e) {
|
|
29
|
+
var t = typeof e;
|
|
30
|
+
return e != null && (t == "object" || t == "function");
|
|
31
|
+
}
|
|
32
|
+
var ce = typeof global == "object" && global && global.Object === Object && global, ae = typeof self == "object" && self && self.Object === Object && self, V = ce || ae || Function("return this")(), D = function() {
|
|
33
|
+
return V.Date.now();
|
|
34
|
+
}, ue = /\s/;
|
|
35
|
+
function de(e) {
|
|
36
|
+
for (var t = e.length; t-- && ue.test(e.charAt(t)); )
|
|
37
|
+
;
|
|
38
|
+
return t;
|
|
39
|
+
}
|
|
40
|
+
var le = /^\s+/;
|
|
41
|
+
function fe(e) {
|
|
42
|
+
return e && e.slice(0, de(e) + 1).replace(le, "");
|
|
43
|
+
}
|
|
44
|
+
var _ = V.Symbol, K = Object.prototype, me = K.hasOwnProperty, ge = K.toString, E = _ ? _.toStringTag : void 0;
|
|
45
|
+
function pe(e) {
|
|
46
|
+
var t = me.call(e, E), o = e[E];
|
|
47
|
+
try {
|
|
48
|
+
e[E] = void 0;
|
|
49
|
+
var n = !0;
|
|
50
|
+
} catch {
|
|
51
|
+
}
|
|
52
|
+
var r = ge.call(e);
|
|
53
|
+
return n && (t ? e[E] = o : delete e[E]), r;
|
|
54
|
+
}
|
|
55
|
+
var he = Object.prototype, be = he.toString;
|
|
56
|
+
function we(e) {
|
|
57
|
+
return be.call(e);
|
|
58
|
+
}
|
|
59
|
+
var ye = "[object Null]", ve = "[object Undefined]", B = _ ? _.toStringTag : void 0;
|
|
60
|
+
function Se(e) {
|
|
61
|
+
return e == null ? e === void 0 ? ve : ye : B && B in Object(e) ? pe(e) : we(e);
|
|
62
|
+
}
|
|
63
|
+
function ke(e) {
|
|
64
|
+
return e != null && typeof e == "object";
|
|
65
|
+
}
|
|
66
|
+
var Te = "[object Symbol]";
|
|
67
|
+
function Ee(e) {
|
|
68
|
+
return typeof e == "symbol" || ke(e) && Se(e) == Te;
|
|
69
|
+
}
|
|
70
|
+
var H = NaN, Le = /^[-+]0x[0-9a-f]+$/i, _e = /^0b[01]+$/i, Ce = /^0o[0-7]+$/i, xe = parseInt;
|
|
71
|
+
function W(e) {
|
|
72
|
+
if (typeof e == "number")
|
|
73
|
+
return e;
|
|
74
|
+
if (Ee(e))
|
|
75
|
+
return H;
|
|
76
|
+
if (A(e)) {
|
|
77
|
+
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
78
|
+
e = A(t) ? t + "" : t;
|
|
79
|
+
}
|
|
80
|
+
if (typeof e != "string")
|
|
81
|
+
return e === 0 ? e : +e;
|
|
82
|
+
e = fe(e);
|
|
83
|
+
var o = _e.test(e);
|
|
84
|
+
return o || Ce.test(e) ? xe(e.slice(2), o ? 2 : 8) : Le.test(e) ? H : +e;
|
|
85
|
+
}
|
|
86
|
+
var Ne = "Expected a function", Ie = Math.max, Oe = Math.min;
|
|
87
|
+
function Re(e, t, o) {
|
|
88
|
+
var n, r, s, i, c, a, u = 0, l = !1, d = !1, m = !0;
|
|
89
|
+
if (typeof e != "function")
|
|
90
|
+
throw new TypeError(Ne);
|
|
91
|
+
t = W(t) || 0, A(o) && (l = !!o.leading, d = "maxWait" in o, s = d ? Ie(W(o.maxWait) || 0, t) : s, m = "trailing" in o ? !!o.trailing : m);
|
|
92
|
+
function p(g) {
|
|
93
|
+
var w = n, T = r;
|
|
94
|
+
return n = r = void 0, u = g, i = e.apply(T, w), i;
|
|
95
|
+
}
|
|
96
|
+
function N(g) {
|
|
97
|
+
return u = g, c = setTimeout(v, t), l ? p(g) : i;
|
|
98
|
+
}
|
|
99
|
+
function S(g) {
|
|
100
|
+
var w = g - a, T = g - u, F = t - w;
|
|
101
|
+
return d ? Oe(F, s - T) : F;
|
|
102
|
+
}
|
|
103
|
+
function k(g) {
|
|
104
|
+
var w = g - a, T = g - u;
|
|
105
|
+
return a === void 0 || w >= t || w < 0 || d && T >= s;
|
|
106
|
+
}
|
|
107
|
+
function v() {
|
|
108
|
+
var g = D();
|
|
109
|
+
if (k(g))
|
|
110
|
+
return I(g);
|
|
111
|
+
c = setTimeout(v, S(g));
|
|
112
|
+
}
|
|
113
|
+
function I(g) {
|
|
114
|
+
return c = void 0, m && n ? p(g) : (n = r = void 0, i);
|
|
115
|
+
}
|
|
116
|
+
function O() {
|
|
117
|
+
c !== void 0 && clearTimeout(c), u = 0, n = a = r = c = void 0;
|
|
118
|
+
}
|
|
119
|
+
function ee() {
|
|
120
|
+
return c === void 0 ? i : I(D());
|
|
121
|
+
}
|
|
122
|
+
function R() {
|
|
123
|
+
var g = D(), w = k(g);
|
|
124
|
+
if (n = arguments, r = this, a = g, w) {
|
|
125
|
+
if (c === void 0)
|
|
126
|
+
return N(a);
|
|
127
|
+
if (d)
|
|
128
|
+
return clearTimeout(c), c = setTimeout(v, t), p(a);
|
|
129
|
+
}
|
|
130
|
+
return c === void 0 && (c = setTimeout(v, t)), i;
|
|
131
|
+
}
|
|
132
|
+
return R.cancel = O, R.flush = ee, R;
|
|
133
|
+
}
|
|
134
|
+
const je = () => {
|
|
135
|
+
const [e, t] = h(0), [o, n] = h(0), [r, s] = h(0), [i, c] = h(Date.now()), [a, u] = h("read"), l = Re(() => {
|
|
136
|
+
const d = window.scrollY, m = document.documentElement.scrollHeight, p = window.innerHeight, N = Math.round(
|
|
137
|
+
d / (m - p) * 100
|
|
138
|
+
), S = Math.floor(N / 5) * 5;
|
|
139
|
+
if (S <= o)
|
|
140
|
+
return;
|
|
141
|
+
const k = Date.now(), v = (k - i) / 1e3, O = Math.abs(d - r) / v;
|
|
142
|
+
u(O > 300 ? "scan" : "read"), s(d), c(k), n(S), t(S);
|
|
143
|
+
}, 250);
|
|
144
|
+
return f(() => (window.addEventListener("scroll", l), () => window.removeEventListener("scroll", l)), []), { depth: e, speedCategory: a };
|
|
145
|
+
}, De = () => {
|
|
146
|
+
const e = b(), [t, o] = h(0);
|
|
147
|
+
return f(() => {
|
|
148
|
+
const n = Number(localStorage.getItem(e.audience.storage_keys.open_tabs)) || 0;
|
|
149
|
+
o(n), localStorage.setItem(
|
|
150
|
+
e.audience.storage_keys.open_tabs,
|
|
151
|
+
(n + 1).toString()
|
|
152
|
+
);
|
|
153
|
+
const r = (i) => {
|
|
154
|
+
i.key === e.audience.storage_keys.open_tabs && o(Number(i.newValue) || 0);
|
|
155
|
+
};
|
|
156
|
+
window.addEventListener("storage", r);
|
|
157
|
+
const s = () => {
|
|
158
|
+
const i = Number(localStorage.getItem(e.audience.storage_keys.open_tabs)) || 0;
|
|
159
|
+
i > 0 && localStorage.setItem(
|
|
160
|
+
e.audience.storage_keys.open_tabs,
|
|
161
|
+
(i - 1).toString()
|
|
162
|
+
);
|
|
163
|
+
};
|
|
164
|
+
return window.addEventListener("beforeunload", s), () => {
|
|
165
|
+
window.removeEventListener("storage", r), window.removeEventListener("beforeunload", s);
|
|
166
|
+
};
|
|
167
|
+
}, []), t;
|
|
168
|
+
}, Me = () => {
|
|
169
|
+
const e = b(), [t, o] = h(null);
|
|
170
|
+
return f(() => {
|
|
171
|
+
let n = sessionStorage.getItem(
|
|
172
|
+
e.audience.storage_keys.current_tab
|
|
173
|
+
);
|
|
174
|
+
const r = JSON.parse(
|
|
175
|
+
localStorage.getItem(e.audience.storage_keys.all_tabs) || "[]"
|
|
176
|
+
);
|
|
177
|
+
n && r.includes(n) && (n = null), n || (n = `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, sessionStorage.setItem(
|
|
178
|
+
e.audience.storage_keys.current_tab,
|
|
179
|
+
n
|
|
180
|
+
)), r.includes(n) || (r.push(n), localStorage.setItem(
|
|
181
|
+
e.audience.storage_keys.all_tabs,
|
|
182
|
+
JSON.stringify(r)
|
|
183
|
+
)), o(n);
|
|
184
|
+
const s = () => {
|
|
185
|
+
const i = r.filter(
|
|
186
|
+
(c) => c !== n
|
|
187
|
+
);
|
|
188
|
+
localStorage.setItem(
|
|
189
|
+
e.audience.storage_keys.all_tabs,
|
|
190
|
+
JSON.stringify(i)
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
return window.addEventListener("beforeunload", s), () => {
|
|
194
|
+
window.removeEventListener("beforeunload", s);
|
|
195
|
+
};
|
|
196
|
+
}, []), t;
|
|
197
|
+
}, C = (e) => Object.prototype.toString.call(e) == "[object String]", Ae = (e, t) => e.indexOf(t) !== -1, x = (e) => e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""), G = (e) => e === void 0, $e = (e) => e === null, J = (e) => G(e) || $e(e), z = (e) => !!e && (e == null ? void 0 : e.nodeType) === 3;
|
|
198
|
+
function Pe(e) {
|
|
199
|
+
return !!e && (e == null ? void 0 : e.nodeType) === 1;
|
|
200
|
+
}
|
|
201
|
+
function Fe(e, t) {
|
|
202
|
+
return !!e && !!(e != null && e.tagName) && (e == null ? void 0 : e.tagName.toLowerCase()) === t.toLowerCase();
|
|
203
|
+
}
|
|
204
|
+
function Ue(e) {
|
|
205
|
+
return e ? x(e).split(/\s+/) : [];
|
|
206
|
+
}
|
|
207
|
+
function Be(e) {
|
|
208
|
+
let t = "";
|
|
209
|
+
switch (typeof (e == null ? void 0 : e.className)) {
|
|
210
|
+
case "string":
|
|
211
|
+
t = e == null ? void 0 : e.className;
|
|
212
|
+
break;
|
|
213
|
+
// TODO: when is this ever used?
|
|
214
|
+
case "object":
|
|
215
|
+
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")) || "";
|
|
216
|
+
break;
|
|
217
|
+
default:
|
|
218
|
+
t = "";
|
|
219
|
+
}
|
|
220
|
+
return Ue(t);
|
|
221
|
+
}
|
|
222
|
+
const y = (e, t = 255) => J(e) ? "" : x(e).split(/(\s+)/).filter((o) => P(o)).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, t), $ = (e) => {
|
|
223
|
+
let t = "";
|
|
224
|
+
if (Ye(e) && // !isSensitiveElement(el) &&
|
|
225
|
+
(e != null && e.childNodes) && (e != null && e.childNodes.length))
|
|
226
|
+
for (const o of e == null ? void 0 : e.childNodes)
|
|
227
|
+
z(o) && o.textContent && (t += y(o.textContent) ?? "");
|
|
228
|
+
return x(t);
|
|
229
|
+
}, He = (e) => {
|
|
230
|
+
var t, o;
|
|
231
|
+
return G(e.target) ? (e == null ? void 0 : e.srcElement) || null : (t = e == null ? void 0 : e.target) != null && t.shadowRoot ? ((o = e == null ? void 0 : e.composedPath()) == null ? void 0 : o[0]) || null : (e == null ? void 0 : e.target) || null;
|
|
232
|
+
}, We = (e, t) => {
|
|
233
|
+
if (!window || !e || Fe(e, "html") || !Pe(e))
|
|
234
|
+
return !1;
|
|
235
|
+
const o = window.getComputedStyle(e);
|
|
236
|
+
if (o && o.getPropertyValue("cursor") === "pointer" && t.type === "click")
|
|
237
|
+
return !0;
|
|
238
|
+
switch (e == null ? void 0 : e.tagName.toLowerCase()) {
|
|
239
|
+
case "html":
|
|
240
|
+
return !1;
|
|
241
|
+
case "form":
|
|
242
|
+
return t.type === "submit";
|
|
243
|
+
case "input":
|
|
244
|
+
case "select":
|
|
245
|
+
case "textarea":
|
|
246
|
+
return ["change", "click"].includes(t.type);
|
|
247
|
+
default:
|
|
248
|
+
return t.type === "click";
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
function Ye(e) {
|
|
252
|
+
if (Ae(Be(e), "ph-include"))
|
|
253
|
+
return !0;
|
|
254
|
+
const t = e.type || "";
|
|
255
|
+
if (C(t))
|
|
256
|
+
switch (t.toLowerCase()) {
|
|
257
|
+
case "hidden":
|
|
258
|
+
return !1;
|
|
259
|
+
case "password":
|
|
260
|
+
return !1;
|
|
261
|
+
}
|
|
262
|
+
const o = e.name || (e == null ? void 0 : e.id) || "";
|
|
263
|
+
return !(C(o) && /^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g, "")));
|
|
264
|
+
}
|
|
265
|
+
const X = "(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})", Ve = new RegExp(`^(?:${X})$`), Ke = new RegExp(X), q = "\\d{3}-?\\d{2}-?\\d{4}", Ge = new RegExp(`^(${q})$`), Je = new RegExp(`(${q})`), P = (e, t = !0) => !(J(e) || C(e) && (e = x(e), (t ? Ve : Ke).test((e || "").replace(/[- ]/g, "")) || (t ? Ge : Je).test(e))), ze = (e) => C(e) ? e.substring(0, 10) === "_ngcontent" || e.substring(0, 7) === "_nghost" : !1, Xe = (e) => {
|
|
266
|
+
let t = $(e);
|
|
267
|
+
return t = `${t} ${Z(e)}`.trim(), P(t) ? t : "";
|
|
268
|
+
};
|
|
269
|
+
function Z(e) {
|
|
270
|
+
var o;
|
|
271
|
+
let t = "";
|
|
272
|
+
if (e != null && e.childNodes.length) {
|
|
273
|
+
for (const n of e.childNodes)
|
|
274
|
+
if (n && ((o = n.tagName) == null ? void 0 : o.toLowerCase()) === "span")
|
|
275
|
+
try {
|
|
276
|
+
const r = $(n);
|
|
277
|
+
t = `${t} ${r}`.trim(), n != null && n.childNodes.length && (t = `${t} ${Z(n)}`.trim());
|
|
278
|
+
} catch {
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return t;
|
|
282
|
+
}
|
|
283
|
+
const qe = ["input", "textarea", "select"], Q = (e) => {
|
|
284
|
+
var r, s, i, c;
|
|
285
|
+
const t = (r = e == null ? void 0 : e.tagName) == null ? void 0 : r.toLowerCase(), o = {
|
|
286
|
+
element: t
|
|
287
|
+
};
|
|
288
|
+
(t == null ? void 0 : t.toLowerCase()) === "a" || (t == null ? void 0 : t.toLowerCase()) === "button" ? o.text = Xe(e) : o.text = $(e);
|
|
289
|
+
const n = Array.from(e.attributes).reduce(
|
|
290
|
+
(a, u) => {
|
|
291
|
+
if (P(u.value) && !ze(u.name)) {
|
|
292
|
+
if (u.name === "class")
|
|
293
|
+
return a;
|
|
294
|
+
a[u.name] = typeof (u == null ? void 0 : u.value) == "string" ? y(u.value) : u.value;
|
|
295
|
+
}
|
|
296
|
+
return a;
|
|
297
|
+
},
|
|
298
|
+
{}
|
|
299
|
+
);
|
|
300
|
+
if (o.attributes = n, qe.includes(t) || (e == null ? void 0 : e.getAttribute("contenteditable")) === "true") {
|
|
301
|
+
let a;
|
|
302
|
+
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 && (o.value = typeof a == "string" || a === null ? y(a, 1024) : a);
|
|
303
|
+
let u = "";
|
|
304
|
+
o != null && o.attributes.id && (u = y(
|
|
305
|
+
((i = (s = document.querySelector(`label[for="${o == null ? void 0 : o.attributes.id}"]`)) == null ? void 0 : s.textContent) == null ? void 0 : i.trim()) || ""
|
|
306
|
+
));
|
|
307
|
+
const l = e.closest("label");
|
|
308
|
+
u || (u = y(((c = l == null ? void 0 : l.textContent) == null ? void 0 : c.trim()) || "")), u && (o.label = u);
|
|
309
|
+
}
|
|
310
|
+
return o;
|
|
311
|
+
}, Ze = (e, t) => {
|
|
312
|
+
var r;
|
|
313
|
+
let o = He(e);
|
|
314
|
+
z(o) && (o = o.parentNode || null);
|
|
315
|
+
const n = ["copy", "cut"].includes(t);
|
|
316
|
+
if (o && (n || We(o, e))) {
|
|
317
|
+
const s = Q(o);
|
|
318
|
+
if (n) {
|
|
319
|
+
const i = y((r = window == null ? void 0 : window.getSelection()) == null ? void 0 : r.toString()), c = (e == null ? void 0 : e.type) || "clipboard";
|
|
320
|
+
s.copy_text = i ?? "", s.copy_type = c;
|
|
321
|
+
}
|
|
322
|
+
return s;
|
|
323
|
+
}
|
|
324
|
+
return null;
|
|
325
|
+
}, Qe = 30, et = 1e3, tt = 3;
|
|
326
|
+
class nt {
|
|
327
|
+
constructor() {
|
|
328
|
+
U(this, "clicks");
|
|
329
|
+
this.clicks = [];
|
|
330
|
+
}
|
|
331
|
+
isRageClick(t, o, n) {
|
|
332
|
+
const r = this.clicks[this.clicks.length - 1];
|
|
333
|
+
if (r && Math.abs(t - r.x) + Math.abs(o - r.y) < Qe && n - r.timestamp < et) {
|
|
334
|
+
if (this.clicks.push({ x: t, y: o, timestamp: n }), this.clicks.length === tt)
|
|
335
|
+
return !0;
|
|
336
|
+
} else
|
|
337
|
+
this.clicks = [{ x: t, y: o, timestamp: n }];
|
|
338
|
+
return !1;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
const M = new nt(), ot = () => {
|
|
342
|
+
const { audience: e } = b();
|
|
343
|
+
f(() => {
|
|
344
|
+
let t = null;
|
|
345
|
+
const o = (s) => {
|
|
346
|
+
if (t) {
|
|
347
|
+
clearTimeout(t), t = null;
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
t = setTimeout(() => {
|
|
351
|
+
r(s, !1), t = null;
|
|
352
|
+
}, 250);
|
|
353
|
+
}, n = (s) => {
|
|
354
|
+
t && (clearTimeout(t), t = null), r(s, !0);
|
|
355
|
+
}, r = (s, i = !1) => {
|
|
356
|
+
var c;
|
|
357
|
+
try {
|
|
358
|
+
let a = {
|
|
359
|
+
hostname: window.location.hostname,
|
|
360
|
+
pathname: window.location.pathname,
|
|
361
|
+
page_title: document.title,
|
|
362
|
+
url: window.location.href,
|
|
363
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
364
|
+
event_type: i ? "dblclick" : "click",
|
|
365
|
+
button_type: s.button
|
|
366
|
+
};
|
|
367
|
+
if (s.target instanceof HTMLElement) {
|
|
368
|
+
const u = s.target;
|
|
369
|
+
a.rage_click = M == null ? void 0 : M.isRageClick(
|
|
370
|
+
s.clientX,
|
|
371
|
+
s.clientY,
|
|
372
|
+
(/* @__PURE__ */ new Date()).getTime()
|
|
373
|
+
), a = {
|
|
374
|
+
...a,
|
|
375
|
+
...Q(u)
|
|
376
|
+
};
|
|
377
|
+
let l = u == null ? void 0 : u.getAttribute("href");
|
|
378
|
+
if (!l) {
|
|
379
|
+
let d = u.parentNode, m = 0;
|
|
380
|
+
for (; d && m < 8; ) {
|
|
381
|
+
const p = (c = d == null ? void 0 : d.parentElement) == null ? void 0 : c.getAttribute("href");
|
|
382
|
+
if (p) {
|
|
383
|
+
l = p;
|
|
384
|
+
break;
|
|
385
|
+
}
|
|
386
|
+
d = d.parentNode, m++;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
e == null || e.track("page.click", {
|
|
390
|
+
...a,
|
|
391
|
+
href: l || void 0
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
} catch {
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
return document.addEventListener("click", o), document.addEventListener("dblclick", n), () => {
|
|
398
|
+
document.removeEventListener("click", o), document.removeEventListener("dblclick", n);
|
|
399
|
+
};
|
|
400
|
+
}, [e]);
|
|
401
|
+
}, L = (e) => Number(e.toFixed(0)), rt = (e) => {
|
|
402
|
+
const { audience: t } = b(), [o] = h({
|
|
403
|
+
value: L(performance.now()),
|
|
404
|
+
timestamp: L(Date.now())
|
|
405
|
+
}), [n, r] = h({
|
|
406
|
+
value: null,
|
|
407
|
+
timestamp: null
|
|
408
|
+
}), [s, i] = h({
|
|
409
|
+
value: null,
|
|
410
|
+
timestamp: null
|
|
411
|
+
});
|
|
412
|
+
return f(() => {
|
|
413
|
+
let c = !0;
|
|
414
|
+
const a = (d, m) => {
|
|
415
|
+
c && d({ value: L(m), timestamp: L(Date.now()) });
|
|
416
|
+
}, u = new PerformanceObserver((d) => {
|
|
417
|
+
for (const m of d.getEntries())
|
|
418
|
+
m.name === "first-contentful-paint" && a(r, m.startTime);
|
|
419
|
+
});
|
|
420
|
+
u.observe({ type: "paint", buffered: !0 });
|
|
421
|
+
const l = () => a(i, performance.now());
|
|
422
|
+
return document.readyState === "complete" ? a(i, performance.now()) : window.addEventListener("load", l), () => {
|
|
423
|
+
c = !1, u.disconnect(), window.removeEventListener("load", l);
|
|
424
|
+
};
|
|
425
|
+
}, []), f(() => {
|
|
426
|
+
o && t && (t == null || t.track("page.metrics", {
|
|
427
|
+
script_load: o.value,
|
|
428
|
+
script_load_at: o.timestamp,
|
|
429
|
+
version: 2
|
|
430
|
+
}));
|
|
431
|
+
}, [o, t]), f(() => {
|
|
432
|
+
n.value !== null && t && (t == null || t.track("page.metrics", {
|
|
433
|
+
first_contentful_paint: n.value,
|
|
434
|
+
first_contentful_paint_at: n.timestamp,
|
|
435
|
+
version: 2
|
|
436
|
+
}));
|
|
437
|
+
}, [n, t]), f(() => {
|
|
438
|
+
s.value !== null && t && (t == null || t.track("page.metrics", {
|
|
439
|
+
window_onload: s.value,
|
|
440
|
+
window_onload_at: s.timestamp,
|
|
441
|
+
version: 2
|
|
442
|
+
}));
|
|
443
|
+
}, [s, t]), { script: o, fcp: n, window_onload: s };
|
|
444
|
+
}, st = () => {
|
|
445
|
+
const { audience: e } = b();
|
|
446
|
+
f(() => {
|
|
447
|
+
let t;
|
|
448
|
+
const o = () => {
|
|
449
|
+
clearTimeout(t), t = setTimeout(() => {
|
|
450
|
+
const n = window.getSelection();
|
|
451
|
+
if (n && (n == null ? void 0 : n.rangeCount) > 0) {
|
|
452
|
+
const r = n == null ? void 0 : n.toString();
|
|
453
|
+
r && (e == null || e.track("page.selection", {
|
|
454
|
+
text: y(r)
|
|
455
|
+
}));
|
|
456
|
+
}
|
|
457
|
+
}, 1e3);
|
|
458
|
+
};
|
|
459
|
+
return document.addEventListener("selectionchange", o), () => {
|
|
460
|
+
clearTimeout(t), document.removeEventListener("selectionchange", o);
|
|
461
|
+
};
|
|
462
|
+
}, []);
|
|
463
|
+
}, Y = "lv_insights_st", it = 15 * 60 * 1e3, ct = (e = "https://cachefly.cachefly.net/1mb.test") => {
|
|
464
|
+
const [t, o] = h(null);
|
|
465
|
+
return f(() => {
|
|
466
|
+
const n = localStorage.getItem(Y);
|
|
467
|
+
if (n) {
|
|
468
|
+
const { speed: c, timestamp: a } = JSON.parse(n);
|
|
469
|
+
if (Date.now() - a < it) {
|
|
470
|
+
o(c);
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
let r = null;
|
|
475
|
+
const s = async () => {
|
|
476
|
+
const c = new se("download_speed");
|
|
477
|
+
if (c.acquireLock())
|
|
478
|
+
try {
|
|
479
|
+
const u = performance.now();
|
|
480
|
+
await fetch(e, { cache: "no-store" });
|
|
481
|
+
const d = (performance.now() - u) / 1e3, m = Math.round(8 / d);
|
|
482
|
+
o(m), localStorage.setItem(
|
|
483
|
+
Y,
|
|
484
|
+
JSON.stringify({ speed: m, timestamp: Date.now() })
|
|
485
|
+
);
|
|
486
|
+
} catch {
|
|
487
|
+
} finally {
|
|
488
|
+
c.releaseLock();
|
|
489
|
+
}
|
|
490
|
+
}, i = () => {
|
|
491
|
+
document.removeEventListener("mousemove", i), document.removeEventListener("keydown", i), document.removeEventListener("scroll", i), r = setTimeout(s, 5e3);
|
|
492
|
+
};
|
|
493
|
+
return document.addEventListener("mousemove", i, { once: !0 }), document.addEventListener("keydown", i, { once: !0 }), document.addEventListener("scroll", i, { once: !0 }), () => {
|
|
494
|
+
r && clearTimeout(r), document.removeEventListener("mousemove", i), document.removeEventListener("keydown", i), document.removeEventListener("scroll", i);
|
|
495
|
+
};
|
|
496
|
+
}, [e]), t;
|
|
497
|
+
}, at = ({
|
|
498
|
+
id: e,
|
|
499
|
+
properties: t = {},
|
|
500
|
+
href: o
|
|
501
|
+
}) => {
|
|
502
|
+
const n = b();
|
|
503
|
+
f(() => {
|
|
504
|
+
(() => {
|
|
505
|
+
var s, i;
|
|
506
|
+
n != null && n.insightsUrl && n.workspace && o && ((s = n == null ? void 0 : n.audience) != null && s.instance ? n == null || n.audience.instance.page({
|
|
507
|
+
resource: "page",
|
|
508
|
+
identifier: e
|
|
509
|
+
}) : (i = n == null ? void 0 : n.audience) == null || i.initiate({
|
|
510
|
+
...t,
|
|
511
|
+
id: e,
|
|
512
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
513
|
+
}));
|
|
514
|
+
})();
|
|
515
|
+
}, [n == null ? void 0 : n.insightsUrl, n == null ? void 0 : n.workspace, o]), f(() => {
|
|
516
|
+
const r = (s) => {
|
|
517
|
+
var c;
|
|
518
|
+
const i = localStorage.getItem(
|
|
519
|
+
n.audience.storage_keys.identify
|
|
520
|
+
);
|
|
521
|
+
s.key === n.audience.storage_keys.identify && !(n != null && n.audience.is_identified) && !i && ((c = n == null ? void 0 : n.audience) == null || c.identify({
|
|
522
|
+
withLock: !1
|
|
523
|
+
}));
|
|
524
|
+
};
|
|
525
|
+
return window.addEventListener("storage", r), () => {
|
|
526
|
+
window.removeEventListener("storage", r);
|
|
527
|
+
};
|
|
528
|
+
}, []);
|
|
529
|
+
}, ut = ({ id: e }) => {
|
|
530
|
+
const t = b();
|
|
531
|
+
f(() => {
|
|
532
|
+
const n = () => {
|
|
533
|
+
var i, c;
|
|
534
|
+
const r = (i = performance.getEntriesByType(
|
|
535
|
+
"navigation"
|
|
536
|
+
)) == null ? void 0 : i[0];
|
|
537
|
+
let s = !1;
|
|
538
|
+
if (r)
|
|
539
|
+
r.type === "navigate" && (s = !0);
|
|
540
|
+
else
|
|
541
|
+
try {
|
|
542
|
+
const a = document.activeElement;
|
|
543
|
+
(a == null ? void 0 : a.tagName) === "A" && a.href && (new URL(a.href).origin !== window.location.origin ? s = !0 : s = !1);
|
|
544
|
+
} catch {
|
|
545
|
+
}
|
|
546
|
+
(c = t == null ? void 0 : t.audience) == null || c.bounce({
|
|
547
|
+
resource: "page",
|
|
548
|
+
identifier: e,
|
|
549
|
+
is_navigating_away: s,
|
|
550
|
+
navigation_type: r == null ? void 0 : r.type
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
return window.addEventListener("beforeunload", n), () => {
|
|
554
|
+
window.removeEventListener("beforeunload", n);
|
|
555
|
+
};
|
|
556
|
+
}, [t == null ? void 0 : t.audience, e]);
|
|
557
|
+
const [o] = ie();
|
|
558
|
+
f(() => {
|
|
559
|
+
var n;
|
|
560
|
+
(o === j.HIDDEN || o === j.UNKNOWN || o === j.FROZEN) && ((n = t == null ? void 0 : t.audience) == null || n.bounce({
|
|
561
|
+
resource: "page",
|
|
562
|
+
identifier: e,
|
|
563
|
+
state: o
|
|
564
|
+
}));
|
|
565
|
+
}, [o, t == null ? void 0 : t.audience, e]);
|
|
566
|
+
}, yt = ({ id: e, properties: t = {} }) => {
|
|
567
|
+
var i;
|
|
568
|
+
const o = typeof window < "u" ? window.location.href : "", n = b();
|
|
569
|
+
f(() => {
|
|
570
|
+
n && typeof window < "u" && (window.levo_client = n);
|
|
571
|
+
}, [n]), f(() => {
|
|
572
|
+
n != null && n.audience && typeof window < "u" && (window.levo_audience = n == null ? void 0 : n.audience);
|
|
573
|
+
}, []), De(), Me(), ot();
|
|
574
|
+
const r = ct();
|
|
575
|
+
f(() => {
|
|
576
|
+
var c;
|
|
577
|
+
(c = n == null ? void 0 : n.audience) != null && c.instance && r && (n == null || n.audience.track("user.speedtest", {
|
|
578
|
+
speed: r,
|
|
579
|
+
unit: "Mbps"
|
|
580
|
+
}));
|
|
581
|
+
}, [r]);
|
|
582
|
+
const s = je();
|
|
583
|
+
return f(() => {
|
|
584
|
+
var c;
|
|
585
|
+
(c = n == null ? void 0 : n.audience) != null && c.instance && (n == null || n.audience.track("page.scroll", {
|
|
586
|
+
resource: "page",
|
|
587
|
+
identifier: e,
|
|
588
|
+
percent: s.depth,
|
|
589
|
+
speed_category: s.speedCategory
|
|
590
|
+
}));
|
|
591
|
+
}, [
|
|
592
|
+
(i = n == null ? void 0 : n.audience) == null ? void 0 : i.instance,
|
|
593
|
+
s.depth,
|
|
594
|
+
s.speedCategory,
|
|
595
|
+
e
|
|
596
|
+
]), rt(), st(), at({
|
|
597
|
+
href: o,
|
|
598
|
+
id: e,
|
|
599
|
+
properties: t
|
|
600
|
+
}), ut({ id: e }), f(() => {
|
|
601
|
+
const c = {
|
|
602
|
+
change: "form.change",
|
|
603
|
+
submit: "form.submit",
|
|
604
|
+
copy: "page.copy",
|
|
605
|
+
cut: "page.copy"
|
|
606
|
+
}, a = (l) => (d) => {
|
|
607
|
+
var p;
|
|
608
|
+
const m = Ze(d, l);
|
|
609
|
+
m && c[l] && ((p = n == null ? void 0 : n.audience) == null || p.track(c[l], m));
|
|
610
|
+
}, u = {
|
|
611
|
+
change: a("change"),
|
|
612
|
+
copy: a("copy"),
|
|
613
|
+
cut: a("cut"),
|
|
614
|
+
submit: a("submit")
|
|
615
|
+
};
|
|
616
|
+
return document.addEventListener("change", u.change), document.addEventListener("copy", u.copy), document.addEventListener("cut", u.cut), document.addEventListener("submit", u.submit), () => {
|
|
617
|
+
document.removeEventListener("change", u.change), document.removeEventListener("copy", u.copy), document.removeEventListener("cut", u.cut), document.removeEventListener("submit", u.submit);
|
|
618
|
+
};
|
|
619
|
+
}, []), (!(n != null && n.insightsUrl) || !n.workspace || !n.workspace.startsWith("W")) && console.error(
|
|
620
|
+
"[@levo-so/react] The utility could not be initialized, due to missing workspace, or endpoint for insights."
|
|
621
|
+
), null;
|
|
622
|
+
};
|
|
623
|
+
export {
|
|
624
|
+
bt as L,
|
|
625
|
+
wt as a,
|
|
626
|
+
yt as b
|
|
627
|
+
};
|
package/dist/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { j as r } from "../jsx-runtime-
|
|
2
|
+
import { j as r } from "../jsx-runtime-D0AQ1Mn7.js";
|
|
3
3
|
import { createContext as n, useContext as s } from "react";
|
|
4
4
|
const o = n(null), v = ({ children: e, client: t }) => /* @__PURE__ */ r.jsx(o.Provider, { value: t, children: e }), x = () => {
|
|
5
5
|
const e = s(o);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"byteToSize.d.ts","sourceRoot":"","sources":["../../src/utils/byteToSize.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"byteToSize.d.ts","sourceRoot":"","sources":["../../src/utils/byteToSize.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,EAAE,iBAAY,WAQrD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/dist/utils/cn.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C,eAAO,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C,eAAO,MAAM,EAAE,GAAI,GAAG,QAAQ,UAAU,EAAE,WAEzC,CAAC;AAEF,eAAe,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorHandler.d.ts","sourceRoot":"","sources":["../../src/utils/errorHandler.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"errorHandler.d.ts","sourceRoot":"","sources":["../../src/utils/errorHandler.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,GAAI,OAAO,GAAG,sCAMtC,CAAC"}
|