@getsoren/shared-module 2.47.2 → 2.49.0
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/README.md +1 -1
- package/dist/components/Utils/InitializeAmplitude.d.ts +4 -2
- package/dist/components/Utils/InitializeSentryConfig.d.ts +14 -9
- package/dist/components/Utils/tests/InitializeSentryConfig.test.d.ts +1 -0
- package/dist/constants/sentry.d.ts +13 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +239 -228
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ export default App;
|
|
|
53
53
|
| GTMSendPageView | React Component | Send page view event to Google Tag Manager | @getsoren/react-google-tag-manager & react-router-dom |
|
|
54
54
|
| InitializeAxiosConfig | React Component | Initialize Axios with custom default config options | Axios |
|
|
55
55
|
| InitializeI18nConfig | React Component | Initialize i18n with custom config options | i18next & react-i18next & i18next-browser-languagedetector |
|
|
56
|
-
| InitializeSentryConfig | React Component | Initialize Sentry
|
|
56
|
+
| InitializeSentryConfig | React Component | Initialize Sentry (tracing + buffered replay) | @sentry/react & react-router-dom |
|
|
57
57
|
| InitializeMapBoxConfig | React Component | Initialize MapBox | mapbox-gl |
|
|
58
58
|
| InitializeDaysJSConfig | React Component | Initialize DayJS | dayjs |
|
|
59
59
|
| InitializeHubSpot | React Component | Initialize HubSpot chat widget | - |
|
|
@@ -28,12 +28,13 @@ export interface InitializeAmplitudeProps {
|
|
|
28
28
|
* "feature usage" charts. Defaults to `true`. Pass `false` to opt out, or an options object to refine
|
|
29
29
|
* (`pageUrlExcludelist`, `cssSelectorAllowlist`, `shouldTrackEventResolver`...). Our `[data-amp-track-feature]`
|
|
30
30
|
* selector is always appended to the allowlist unless you provide your own `cssSelectorAllowlist`.
|
|
31
|
-
*
|
|
31
|
+
* Read once at init: an inline object is fine, and changing it afterwards does not re-init the SDK.
|
|
32
32
|
*/
|
|
33
33
|
elementInteractions?: boolean | ElementInteractionsOptions;
|
|
34
34
|
/**
|
|
35
35
|
* Rage / dead click detection (`[Amplitude] Rage Click` / `Dead Click`). Low volume, high UX signal.
|
|
36
36
|
* Defaults to `true` (both enabled) whenever `elementInteractions` is enabled. Pass `false` to opt out.
|
|
37
|
+
* Read once at init, like `elementInteractions`.
|
|
37
38
|
*/
|
|
38
39
|
frustrationInteractions?: boolean | FrustrationInteractionsOptions;
|
|
39
40
|
/**
|
|
@@ -48,6 +49,7 @@ export interface InitializeAmplitudeProps {
|
|
|
48
49
|
/**
|
|
49
50
|
* Session replay privacy settings. Defaults to `{ defaultMaskLevel: "medium" }`: every input is masked, page text is
|
|
50
51
|
* captured. Tag elements with the SDK classes `amp-mask` / `amp-unmask` / `amp-block` for per-element control.
|
|
52
|
+
* Read once at init, like `elementInteractions`.
|
|
51
53
|
*/
|
|
52
54
|
sessionReplayPrivacy?: SessionReplayOptions["privacyConfig"];
|
|
53
55
|
/**
|
|
@@ -64,5 +66,5 @@ export interface InitializeAmplitudeProps {
|
|
|
64
66
|
* - registers the session replay plugin, remote-controlled sample rate by default (Dynamic Sampling ready),
|
|
65
67
|
* - registers an enrichment plugin that adds `platform` to every event's properties.
|
|
66
68
|
*/
|
|
67
|
-
declare const InitializeAmplitude: ({ apiKey, appVersion, elementInteractions, frustrationInteractions, platform,
|
|
69
|
+
declare const InitializeAmplitude: ({ apiKey, appVersion, sessionReplaySampleRate, serverZone, elementInteractions, frustrationInteractions, platform, sessionReplayPrivacy, ...props }: InitializeAmplitudeProps) => null;
|
|
68
70
|
export default InitializeAmplitude;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ErrorEvent } from '@sentry/react';
|
|
1
2
|
import { InjectDependenciesContextProps } from '../../context/InjectDependenciesProvider';
|
|
2
3
|
interface InitializeSentryConfigProps {
|
|
3
4
|
/**
|
|
@@ -13,10 +14,7 @@ interface InitializeSentryConfigProps {
|
|
|
13
14
|
*/
|
|
14
15
|
dsn: string;
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* List of integrations that should be installed after SDK was initialized.
|
|
17
|
+
* Extra integrations installed after the SDK is initialized, on top of the built-in browser tracing and replay ones.
|
|
20
18
|
*/
|
|
21
19
|
integrations?: any[];
|
|
22
20
|
/**
|
|
@@ -25,15 +23,21 @@ interface InitializeSentryConfigProps {
|
|
|
25
23
|
*/
|
|
26
24
|
tracesSampleRate?: number;
|
|
27
25
|
/**
|
|
28
|
-
* The sample rate for session-long replays.
|
|
29
|
-
*
|
|
26
|
+
* The sample rate for session-long replays. 1.0 records every session, 0 records none.
|
|
27
|
+
* Defaults to `0`: replays stay in memory (buffer mode) and are only uploaded for errors, see `replaysOnErrorSampleRate`.
|
|
30
28
|
*/
|
|
31
29
|
replaysSessionSampleRate?: number;
|
|
32
30
|
/**
|
|
33
|
-
* The sample rate for sessions that
|
|
34
|
-
*
|
|
31
|
+
* The sample rate for sessions that had an error occur, independent of `replaysSessionSampleRate`.
|
|
32
|
+
* Defaults to `1.0`. Which errors flush the buffered replay is decided by `replayBeforeErrorSampling`.
|
|
35
33
|
*/
|
|
36
34
|
replaysOnErrorSampleRate?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Decides, per error, whether the buffered replay is uploaded. Defaults to keeping only errors tagged with
|
|
37
|
+
* `SENTRY_KEEP_REPLAY` (`sentry.captureException(error, { tags: SENTRY_KEEP_REPLAY })`). Pass `() => true` to
|
|
38
|
+
* upload a replay for every error. Only applies in buffer mode; session-long replays are always sent.
|
|
39
|
+
*/
|
|
40
|
+
replayBeforeErrorSampling?: (event: ErrorEvent) => boolean;
|
|
37
41
|
/**
|
|
38
42
|
* List of strings/regex controlling to which outgoing requests the SDK will attach tracing headers.
|
|
39
43
|
* By default, the SDK will attach those headers to all requests to localhost and same origin. If this option is provided, the SDK will match the request URL of outgoing requests against the items in this array, and only attach tracing headers if a match was found.
|
|
@@ -71,11 +75,12 @@ interface InitializeSentryConfigProps {
|
|
|
71
75
|
* @param tracesSampleRate
|
|
72
76
|
* @param replaysSessionSampleRate
|
|
73
77
|
* @param replaysOnErrorSampleRate
|
|
78
|
+
* @param replayBeforeErrorSampling
|
|
74
79
|
* @param tracePropagationTargets
|
|
75
80
|
* @param ignoreErrors
|
|
76
81
|
* @param debug
|
|
77
82
|
* @param environment
|
|
78
83
|
* @constructor
|
|
79
84
|
*/
|
|
80
|
-
declare const InitializeSentryConfig: ({ dsn, integrations, tracesSampleRate,
|
|
85
|
+
declare const InitializeSentryConfig: ({ dsn, integrations, tracesSampleRate, tracePropagationTargets, ignoreErrors, debug, environment, release, replaysSessionSampleRate, replaysOnErrorSampleRate, replayBeforeErrorSampling, ...props }: InitializeSentryConfigProps) => null;
|
|
81
86
|
export default InitializeSentryConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ErrorEvent } from '@sentry/react';
|
|
2
|
+
/**
|
|
3
|
+
* Tag opting an error into a replay upload when replays run in buffer mode (session sample rate at 0).
|
|
4
|
+
* Spread it into the capture context: `sentry.captureException(error, { tags: SENTRY_KEEP_REPLAY })`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SENTRY_KEEP_REPLAY: {
|
|
7
|
+
readonly replay: "keep";
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Default `beforeErrorSampling` of the replay integration: only errors tagged with `SENTRY_KEEP_REPLAY` flush the
|
|
11
|
+
* buffered replay, so a noisy error never burns the replay quota by itself.
|
|
12
|
+
*/
|
|
13
|
+
export declare const isReplayKeptForError: (event: ErrorEvent) => boolean;
|
package/dist/main.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from './components/Utils/RequireAuth';
|
|
|
22
22
|
export { default as RequireAuth } from './components/Utils/RequireAuth';
|
|
23
23
|
export * from './components/Utils/ShowHubSpotBubble';
|
|
24
24
|
export { default as ShowHubSpotBubble } from './components/Utils/ShowHubSpotBubble';
|
|
25
|
+
export * from './constants/sentry';
|
|
25
26
|
export * from './context/ChatProvider';
|
|
26
27
|
export { default as ChatProvider } from './context/ChatProvider';
|
|
27
28
|
export * from './context/InjectDependenciesProvider';
|
package/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./orval-Bf_zcxLE.js";
|
|
2
|
-
import { Suspense as t, createContext as n, lazy as r, useCallback as i, useContext as a, useEffect as o,
|
|
3
|
-
import { jsx as
|
|
2
|
+
import { Suspense as t, createContext as n, lazy as r, useCallback as i, useContext as a, useEffect as o, useLayoutEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
3
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
4
4
|
import "dayjs/locale/ar";
|
|
5
5
|
import "dayjs/locale/de";
|
|
6
6
|
import "dayjs/locale/en";
|
|
@@ -9,7 +9,7 @@ import "dayjs/locale/fr";
|
|
|
9
9
|
import "dayjs/locale/it";
|
|
10
10
|
import "dayjs/locale/pt";
|
|
11
11
|
//#region src/chat/ChatClient.ts
|
|
12
|
-
var
|
|
12
|
+
var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e.replace(/_([a-z])/g, (e, t) => t.toUpperCase()), h(t)])) : e, g = (e) => Array.isArray(e) ? e.map(g) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e.replace(/[A-Z]/g, (e) => `_${e.toLowerCase()}`), g(t)])) : e, _ = class {
|
|
13
13
|
url;
|
|
14
14
|
getToken;
|
|
15
15
|
onEvent;
|
|
@@ -27,7 +27,7 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
27
27
|
_connected = !1;
|
|
28
28
|
_ready = !1;
|
|
29
29
|
constructor(e) {
|
|
30
|
-
this.url = e.url, this.getToken = e.getToken, this.onEvent = e.onEvent, this.onConnectionChange = e.onConnectionChange, this.shouldReconnect = e.reconnect ?? !0, this.maxReconnectAttempts = e.maxReconnectAttempts ?? Infinity, this.reconnectBaseDelay = e.reconnectBaseDelay ??
|
|
30
|
+
this.url = e.url, this.getToken = e.getToken, this.onEvent = e.onEvent, this.onConnectionChange = e.onConnectionChange, this.shouldReconnect = e.reconnect ?? !0, this.maxReconnectAttempts = e.maxReconnectAttempts ?? Infinity, this.reconnectBaseDelay = e.reconnectBaseDelay ?? p, this.maxMessageBodyLength = e.maxMessageBodyLength ?? m;
|
|
31
31
|
}
|
|
32
32
|
get connected() {
|
|
33
33
|
return this._connected;
|
|
@@ -44,7 +44,7 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
44
44
|
this._connected = !0, this.reconnectAttempt = 0, this.onConnectionChange?.(!0), this.rejoinThreads(), this.flushPendingMessages();
|
|
45
45
|
}, this.ws.onmessage = (e) => {
|
|
46
46
|
try {
|
|
47
|
-
let t =
|
|
47
|
+
let t = h(JSON.parse(e.data));
|
|
48
48
|
t.type === "ready" && (this._ready = !0), this.onEvent?.(t);
|
|
49
49
|
} catch {}
|
|
50
50
|
}, this.ws.onclose = () => {
|
|
@@ -92,7 +92,7 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
92
92
|
this.pendingMessages.push(e);
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
|
-
this.ws.send(JSON.stringify(
|
|
95
|
+
this.ws.send(JSON.stringify(g(e)));
|
|
96
96
|
}
|
|
97
97
|
flushPendingMessages() {
|
|
98
98
|
let e = [...this.pendingMessages];
|
|
@@ -107,7 +107,7 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
107
107
|
}
|
|
108
108
|
scheduleReconnect() {
|
|
109
109
|
this.clearReconnectTimer();
|
|
110
|
-
let e = Math.min(this.reconnectBaseDelay * 2 ** this.reconnectAttempt,
|
|
110
|
+
let e = Math.min(this.reconnectBaseDelay * 2 ** this.reconnectAttempt, f);
|
|
111
111
|
this.reconnectAttempt++, this.reconnectTimer = setTimeout(() => {
|
|
112
112
|
this.connect();
|
|
113
113
|
}, e);
|
|
@@ -115,8 +115,8 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
115
115
|
clearReconnectTimer() {
|
|
116
116
|
this.reconnectTimer !== null && (clearTimeout(this.reconnectTimer), this.reconnectTimer = null);
|
|
117
117
|
}
|
|
118
|
-
},
|
|
119
|
-
let i =
|
|
118
|
+
}, v = ({ IMaskMixin: e, ...t }) => /* @__PURE__ */ d(c(() => e(({ TextField: e, ...t }) => /* @__PURE__ */ d(e, { ...t })), [e]), { ...t }), y = n({}), b = ({ children: e, apiURL: t, libraries: n, localStorageKeys: r }) => {
|
|
119
|
+
let i = c(() => ({
|
|
120
120
|
apiURL: t,
|
|
121
121
|
libraries: n,
|
|
122
122
|
localStorageKeys: r
|
|
@@ -125,34 +125,34 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
125
125
|
n,
|
|
126
126
|
r
|
|
127
127
|
]);
|
|
128
|
-
return /* @__PURE__ */
|
|
128
|
+
return /* @__PURE__ */ d(y.Provider, {
|
|
129
129
|
value: i,
|
|
130
130
|
children: e
|
|
131
131
|
});
|
|
132
|
-
},
|
|
132
|
+
}, x = 900 * 1e3, S = 60 * 1e3, C = 600 * 1e3, w = "auto-reload-on-new-version-timestamp", T = /<meta[^>]*name="version"[^>]*content="([^"]*)"/, E = (e) => {
|
|
133
133
|
try {
|
|
134
134
|
return sessionStorage.getItem(e);
|
|
135
135
|
} catch {
|
|
136
136
|
return null;
|
|
137
137
|
}
|
|
138
|
-
},
|
|
138
|
+
}, D = (e, t) => {
|
|
139
139
|
try {
|
|
140
140
|
sessionStorage.setItem(e, t);
|
|
141
141
|
} catch {}
|
|
142
|
-
},
|
|
143
|
-
let { libraries: i } = a(
|
|
142
|
+
}, O = ({ version: e, checkInterval: t = x, children: n, ...r }) => {
|
|
143
|
+
let { libraries: i } = a(y), s = r?.reactRouter || i?.reactRouter, c = l(!1), u = l(0);
|
|
144
144
|
if (!s) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of AutoReloadOnNewVersion.");
|
|
145
|
-
let { useLocation: f, Outlet: p } = s, { pathname: m } = f(), h =
|
|
145
|
+
let { useLocation: f, Outlet: p } = s, { pathname: m } = f(), h = l(m);
|
|
146
146
|
return o(() => {
|
|
147
147
|
if (!e || typeof window > "u") return;
|
|
148
148
|
let n = async () => {
|
|
149
|
-
if (!(
|
|
150
|
-
|
|
149
|
+
if (!(c.current || Date.now() - u.current < S)) {
|
|
150
|
+
u.current = Date.now();
|
|
151
151
|
try {
|
|
152
152
|
let t = await fetch("/index.html", { cache: "no-store" });
|
|
153
153
|
if (!t.ok) return;
|
|
154
|
-
let n = (await t.text()).match(
|
|
155
|
-
n && n !== "%VERSION%" && n !== e && (
|
|
154
|
+
let n = (await t.text()).match(T)?.[1];
|
|
155
|
+
n && n !== "%VERSION%" && n !== e && (c.current = !0);
|
|
156
156
|
} catch {}
|
|
157
157
|
}
|
|
158
158
|
}, r = () => {
|
|
@@ -162,28 +162,28 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
162
162
|
clearInterval(i), document.removeEventListener("visibilitychange", r);
|
|
163
163
|
};
|
|
164
164
|
}, [e, t]), o(() => {
|
|
165
|
-
if (m === h.current || (h.current = m, !
|
|
166
|
-
|
|
167
|
-
let e = Number(
|
|
168
|
-
Date.now() - e <
|
|
169
|
-
}, [m]), n ?? /* @__PURE__ */
|
|
170
|
-
},
|
|
171
|
-
let { libraries: n } = a(
|
|
165
|
+
if (m === h.current || (h.current = m, !c.current)) return;
|
|
166
|
+
c.current = !1;
|
|
167
|
+
let e = Number(E(w) || "0");
|
|
168
|
+
Date.now() - e < C || (D(w, String(Date.now())), window.location.reload());
|
|
169
|
+
}, [m]), n ?? /* @__PURE__ */ d(p, {});
|
|
170
|
+
}, k = ({ data: e, ...t }) => {
|
|
171
|
+
let { libraries: n } = a(y), r = t?.reactRouter || n?.reactRouter, i = t?.gtm || n?.gtm;
|
|
172
172
|
if (!r) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
|
|
173
173
|
if (!i) throw Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
|
|
174
|
-
let { useGoogleTagManager: s } = i, { useLocation: c, Outlet: l } = r, { pathname:
|
|
174
|
+
let { useGoogleTagManager: s } = i, { useLocation: c, Outlet: l } = r, { pathname: u } = c(), { sendEvent: f } = s();
|
|
175
175
|
return o(() => {
|
|
176
176
|
f({
|
|
177
177
|
event: "pageView",
|
|
178
|
-
pathname:
|
|
178
|
+
pathname: u,
|
|
179
179
|
...e
|
|
180
180
|
});
|
|
181
181
|
}, [
|
|
182
182
|
e,
|
|
183
|
-
|
|
183
|
+
u,
|
|
184
184
|
f
|
|
185
|
-
]), /* @__PURE__ */
|
|
186
|
-
},
|
|
185
|
+
]), /* @__PURE__ */ d(l, {});
|
|
186
|
+
}, A = "[data-amp-track-feature]", j = [
|
|
187
187
|
"a",
|
|
188
188
|
"button",
|
|
189
189
|
"input",
|
|
@@ -195,74 +195,81 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
195
195
|
"[contenteditable=\"true\" i]",
|
|
196
196
|
"[data-amp-default-track]",
|
|
197
197
|
".amp-default-track"
|
|
198
|
-
],
|
|
198
|
+
], M = { defaultMaskLevel: "medium" }, N = (e, t) => {
|
|
199
199
|
if (e === !1) return !1;
|
|
200
200
|
let n = e === !0 ? {} : e;
|
|
201
201
|
return {
|
|
202
|
-
cssSelectorAllowlist: [...t,
|
|
202
|
+
cssSelectorAllowlist: [...t, A],
|
|
203
203
|
...n
|
|
204
204
|
};
|
|
205
|
-
},
|
|
205
|
+
}, P = (e, t) => !t || e === !1 ? !1 : {
|
|
206
206
|
deadClicks: !0,
|
|
207
207
|
rageClicks: !0,
|
|
208
208
|
...e === !0 ? {} : e
|
|
209
|
-
},
|
|
210
|
-
let { libraries:
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
209
|
+
}, F = ({ apiKey: e, appVersion: t, sessionReplaySampleRate: n, serverZone: r, elementInteractions: i = !0, frustrationInteractions: c = !0, platform: u = "desktop", sessionReplayPrivacy: d = M, ...f }) => {
|
|
210
|
+
let { libraries: p } = a(y), m = f.amplitude || p?.amplitude, h = l({
|
|
211
|
+
elementInteractions: i,
|
|
212
|
+
frustrationInteractions: c,
|
|
213
|
+
sessionReplayPrivacy: d
|
|
214
|
+
});
|
|
215
|
+
return s(() => {
|
|
216
|
+
h.current = {
|
|
217
|
+
elementInteractions: i,
|
|
218
|
+
frustrationInteractions: c,
|
|
219
|
+
sessionReplayPrivacy: d
|
|
220
|
+
};
|
|
221
|
+
}), o(() => {
|
|
222
|
+
let i = m?.analytics, a = m?.sessionReplayPlugin;
|
|
223
|
+
if (!(e && i)) return;
|
|
224
|
+
let { elementInteractions: o, frustrationInteractions: s, sessionReplayPrivacy: c } = h.current, l = "platform-enrichment", d = N(o, i.Types?.DEFAULT_CSS_SELECTOR_ALLOWLIST ?? j);
|
|
225
|
+
return i.init(e, {
|
|
216
226
|
appVersion: t,
|
|
217
227
|
autocapture: {
|
|
218
228
|
elementInteractions: d,
|
|
219
|
-
frustrationInteractions:
|
|
229
|
+
frustrationInteractions: P(s, d !== !1),
|
|
220
230
|
pageViews: { trackHistoryChanges: "pathOnly" }
|
|
221
231
|
},
|
|
222
|
-
serverZone:
|
|
223
|
-
}),
|
|
232
|
+
serverZone: r
|
|
233
|
+
}), a && i.add(a({
|
|
224
234
|
privacyConfig: c,
|
|
225
|
-
...
|
|
226
|
-
})),
|
|
235
|
+
...n === void 0 ? {} : { sampleRate: n }
|
|
236
|
+
})), i.add({
|
|
227
237
|
execute: async (e) => ({
|
|
228
238
|
...e,
|
|
229
239
|
event_properties: {
|
|
230
240
|
...e.event_properties,
|
|
231
|
-
platform:
|
|
241
|
+
platform: u
|
|
232
242
|
}
|
|
233
243
|
}),
|
|
234
|
-
name:
|
|
244
|
+
name: l,
|
|
235
245
|
type: "enrichment"
|
|
236
246
|
}), () => {
|
|
237
|
-
|
|
247
|
+
a && i.remove("@amplitude/plugin-session-replay-browser"), i.remove(l);
|
|
238
248
|
};
|
|
239
249
|
}, [
|
|
240
250
|
e,
|
|
241
|
-
|
|
251
|
+
m,
|
|
242
252
|
t,
|
|
243
|
-
|
|
253
|
+
u,
|
|
244
254
|
r,
|
|
245
|
-
|
|
246
|
-
s,
|
|
247
|
-
c,
|
|
248
|
-
l
|
|
255
|
+
n
|
|
249
256
|
]), null;
|
|
250
|
-
},
|
|
257
|
+
}, I = (() => {
|
|
251
258
|
try {
|
|
252
259
|
return typeof global == "object" && global !== null && ("HermesInternal" in global || "__fbBatchedBridge" in global || "__metro" in global) || typeof window > "u" && typeof global < "u" ? !0 : typeof navigator < "u" && navigator.userAgent ? /react.native|ReactNative/i.test(navigator.userAgent) : !1;
|
|
253
260
|
} catch {
|
|
254
261
|
return !1;
|
|
255
262
|
}
|
|
256
|
-
})(),
|
|
257
|
-
let { apiURL: i = r.apiURL, libraries: o, localStorageKeys: s } = a(
|
|
263
|
+
})(), ee = "user", te = ({ tokenTypeKey: e = "tokenType", tokenKey: t = "accessToken", postContentType: n = "application/json", ...r }) => {
|
|
264
|
+
let { apiURL: i = r.apiURL, libraries: o, localStorageKeys: s } = a(y), c = r?.userLocalStorageKey || s?.user || ee, l = r?.axios || o?.axios;
|
|
258
265
|
if (!l) throw Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
259
|
-
if (!l?.defaults ||
|
|
266
|
+
if (!l?.defaults || I) return null;
|
|
260
267
|
if (typeof window < "u" && window.localStorage) {
|
|
261
268
|
let n = localStorage.getItem(c), r = n ? JSON.parse(n) : null, i = r?.[e] ? r[e] : null, a = r?.[t] ? r[t] : null, o = n ? `${i} ${a}` : null;
|
|
262
269
|
o && (l.defaults.headers.common.Authorization = o);
|
|
263
270
|
}
|
|
264
271
|
return l.defaults.baseURL = i, l.defaults.headers.post["Content-Type"] = n, null;
|
|
265
|
-
},
|
|
272
|
+
}, ne = [
|
|
266
273
|
"ar",
|
|
267
274
|
"de",
|
|
268
275
|
"en",
|
|
@@ -270,15 +277,15 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
270
277
|
"fr",
|
|
271
278
|
"it",
|
|
272
279
|
"pt"
|
|
273
|
-
],
|
|
274
|
-
let { libraries: n } = a(
|
|
280
|
+
], re = (e) => ne.includes(e), ie = ({ language: e, ...t }) => {
|
|
281
|
+
let { libraries: n } = a(y), r = t?.dayjs || n?.dayjs, i = t?.plugin || n?.dayjsPlugin;
|
|
275
282
|
if (!r) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");
|
|
276
283
|
r.extend(t.localizedFormat), i && i.forEach((e) => {
|
|
277
284
|
e && r.extend(e);
|
|
278
285
|
});
|
|
279
|
-
let o = e || navigator.language?.slice(0, 2) || "en", s =
|
|
286
|
+
let o = e || navigator.language?.slice(0, 2) || "en", s = re(o) ? o : "en";
|
|
280
287
|
return r.locale() !== s && r.locale(s), null;
|
|
281
|
-
},
|
|
288
|
+
}, L = "hubspot-messages-iframe-container", R = "hs-show", z = "data-hs-hidden", ae = ({ hubId: e }) => (o(() => {
|
|
282
289
|
if (!e) return;
|
|
283
290
|
let t = document.createElement("script");
|
|
284
291
|
return t.id = "hs-script-loader", t.src = `//js-eu1.hs-scripts.com/${e}.js`, t.async = !0, t.defer = !0, document.body.appendChild(t), () => {
|
|
@@ -287,14 +294,14 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
287
294
|
}, [e]), o(() => {
|
|
288
295
|
let e = document.createElement("style");
|
|
289
296
|
return e.textContent = `
|
|
290
|
-
html[${
|
|
291
|
-
html[${
|
|
292
|
-
`, document.head.appendChild(e), document.documentElement.setAttribute(
|
|
293
|
-
e.remove(), document.documentElement.removeAttribute(
|
|
297
|
+
html[${z}] div#${L} { display: none !important; }
|
|
298
|
+
html[${z}] div#${L}.${R} { display: initial !important; }
|
|
299
|
+
`, document.head.appendChild(e), document.documentElement.setAttribute(z, ""), () => {
|
|
300
|
+
e.remove(), document.documentElement.removeAttribute(z);
|
|
294
301
|
};
|
|
295
|
-
}, []), null),
|
|
296
|
-
let { libraries: r } = a(
|
|
297
|
-
if (
|
|
302
|
+
}, []), null), oe = ({ debug: e, resources: t, ...n }) => {
|
|
303
|
+
let { libraries: r } = a(y), i = n?.i18 || r?.i18, { i18next: o, initReactI18next: s, languageDetector: c } = i || {};
|
|
304
|
+
if (I) return null;
|
|
298
305
|
if (!(i && o && c && s)) throw Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
299
306
|
return o.isInitialized ? null : (o.use(c).use(s).init({
|
|
300
307
|
debug: e,
|
|
@@ -312,18 +319,18 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
312
319
|
}), o.on("languageChanged", (e) => {
|
|
313
320
|
document.documentElement.setAttribute("lang", e);
|
|
314
321
|
}), null);
|
|
315
|
-
},
|
|
316
|
-
let { libraries:
|
|
317
|
-
if (!
|
|
318
|
-
if (!
|
|
319
|
-
if (
|
|
320
|
-
let { createRoutesFromChildren:
|
|
321
|
-
return (
|
|
322
|
-
debug:
|
|
322
|
+
}, B = { replay: "keep" }, V = (e) => e.tags?.replay === B.replay, se = ({ dsn: e, integrations: t, tracesSampleRate: n, tracePropagationTargets: r, ignoreErrors: i, debug: s, environment: c, release: l, replaysSessionSampleRate: u = 0, replaysOnErrorSampleRate: d = 1, replayBeforeErrorSampling: f = V, ...p }) => {
|
|
323
|
+
let { libraries: m } = a(y), h = p?.sentry || m?.sentry, g = p?.reactRouter || m?.reactRouter;
|
|
324
|
+
if (!h) throw Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
325
|
+
if (!g) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
326
|
+
if (h.isInitialized()) return null;
|
|
327
|
+
let { createRoutesFromChildren: _, matchRoutes: v, useLocation: b, useNavigationType: x } = g, S = u > 0 || d > 0;
|
|
328
|
+
return (s || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && h.init({
|
|
329
|
+
debug: s,
|
|
323
330
|
dsn: e,
|
|
324
|
-
environment:
|
|
331
|
+
environment: c || "production",
|
|
325
332
|
ignoreErrors: [
|
|
326
|
-
...
|
|
333
|
+
...i || [],
|
|
327
334
|
/dynamically imported module/,
|
|
328
335
|
/Cannot read properties of undefined \(reading 'default'\)/,
|
|
329
336
|
/Loading chunk \d+ failed/,
|
|
@@ -331,146 +338,150 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
331
338
|
/Failed to fetch dynamically imported module/,
|
|
332
339
|
/vite:preloadError/
|
|
333
340
|
],
|
|
334
|
-
integrations: [
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
341
|
+
integrations: [
|
|
342
|
+
h.reactRouterV6BrowserTracingIntegration({
|
|
343
|
+
createRoutesFromChildren: _,
|
|
344
|
+
matchRoutes: v,
|
|
345
|
+
useEffect: o,
|
|
346
|
+
useLocation: b,
|
|
347
|
+
useNavigationType: x
|
|
348
|
+
}),
|
|
349
|
+
...S ? [h.replayIntegration({ beforeErrorSampling: f })] : [],
|
|
350
|
+
...t || []
|
|
351
|
+
],
|
|
352
|
+
release: l,
|
|
353
|
+
replaysOnErrorSampleRate: d,
|
|
354
|
+
replaysSessionSampleRate: u,
|
|
355
|
+
tracePropagationTargets: r,
|
|
345
356
|
tracesSampleRate: n ?? 1
|
|
346
357
|
}), null;
|
|
347
|
-
},
|
|
348
|
-
let { libraries: c, localStorageKeys:
|
|
358
|
+
}, H = /* @__PURE__ */ new WeakMap(), ce = "user", le = ({ Fallback: e, isLogged: n, loginPath: r = "/login", redirect401Path: i = "/login", ...s }) => {
|
|
359
|
+
let { libraries: c, localStorageKeys: l } = a(y), f = s?.reactRouter || c?.reactRouter, p = s?.axios || c?.axios, m = s?.localStorageKey || l?.user || ce;
|
|
349
360
|
if (!f) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
350
|
-
let [h, g] =
|
|
361
|
+
let [h, g] = u(null), { useLocation: _, Navigate: v, Outlet: b } = f, x = _(), S = typeof n == "function" ? n() : !!n, C = typeof S == "boolean" ? S : S?.isLogged;
|
|
351
362
|
return o(() => {
|
|
352
|
-
p && (
|
|
363
|
+
p && (H.has(p) || (H.set(p, !0), p.interceptors.response.use((e) => e, (e) => (typeof e == "object" && e && "response" in e && e.response && typeof e.response == "object" && "status" in e.response && e.response && typeof e.response == "object" && "status" in e.response && e?.response?.status === 401 && (typeof e == "object" && e && "config" in e && e.config && typeof e.config == "object" && "headers" in e.config && e.config.headers && typeof e.config.headers == "object" && "Authorization" in e.config.headers && e.config.headers.Authorization && (p.defaults.headers.common.Authorization = null, typeof window < "u" && window.localStorage && localStorage.removeItem(m)), g(i)), Promise.reject(e)))));
|
|
353
364
|
}, [
|
|
354
365
|
p,
|
|
355
366
|
m,
|
|
356
367
|
i
|
|
357
|
-
]), C && !h ? /* @__PURE__ */
|
|
368
|
+
]), C && !h ? /* @__PURE__ */ d(t, {
|
|
358
369
|
fallback: e,
|
|
359
|
-
children: x.state?.from?.state && x.state?.from?.pathname === r ? /* @__PURE__ */
|
|
370
|
+
children: x.state?.from?.state && x.state?.from?.pathname === r ? /* @__PURE__ */ d(v, {
|
|
360
371
|
to: x.state.from.state.from.pathname + x.state.from.state.from.search,
|
|
361
372
|
replace: !0
|
|
362
|
-
}) : /* @__PURE__ */
|
|
363
|
-
}) : /* @__PURE__ */
|
|
373
|
+
}) : /* @__PURE__ */ d(b, {})
|
|
374
|
+
}) : /* @__PURE__ */ d(v, {
|
|
364
375
|
to: r + x.search,
|
|
365
376
|
state: { from: x },
|
|
366
377
|
replace: !0
|
|
367
378
|
});
|
|
368
|
-
},
|
|
379
|
+
}, U = /* @__PURE__ */ new Set(), ue = () => (o(() => {
|
|
369
380
|
let e = Symbol();
|
|
370
|
-
return
|
|
371
|
-
|
|
381
|
+
return U.add(e), document.documentElement.removeAttribute(z), () => {
|
|
382
|
+
U.delete(e), U.size === 0 && document.documentElement.setAttribute(z, "");
|
|
372
383
|
};
|
|
373
|
-
}, []), null),
|
|
384
|
+
}, []), null), de = "user", fe = {
|
|
374
385
|
client: "/v2/threads/ws",
|
|
375
386
|
supplier: "/v1/threads/ws"
|
|
376
|
-
},
|
|
387
|
+
}, pe = (e, t) => `${e.startsWith("https") ? "wss" : "ws"}://${e.replace(/^https?:\/\//, "")}${t}`, me = (e) => {
|
|
377
388
|
try {
|
|
378
389
|
let t = localStorage.getItem(e);
|
|
379
390
|
return t ? JSON.parse(t)?.accessToken ?? null : null;
|
|
380
391
|
} catch {
|
|
381
392
|
return null;
|
|
382
393
|
}
|
|
383
|
-
},
|
|
384
|
-
let [
|
|
394
|
+
}, W = n(null), he = ({ children: e, token: t, url: n, wsPath: r, maxReconnectAttempts: s, reconnectBaseDelay: c, maxMessageBodyLength: f = 1e4, reconnect: p = !0, enabled: m = !0, context: h = "client" }) => {
|
|
395
|
+
let [g, v] = u(!1), [b, x] = u(!1), [S, C] = u(0), [w, T] = u(m), E = m && w, { apiURL: D, localStorageKeys: O } = a(y), k = O?.user || de, A = l(null), j = l(/* @__PURE__ */ new Set());
|
|
385
396
|
o(() => {
|
|
386
|
-
if (!
|
|
387
|
-
let e = r ??
|
|
397
|
+
if (!E) return;
|
|
398
|
+
let e = r ?? fe[h], i = n || (D ? pe(D, e) : null);
|
|
388
399
|
if (!i) return;
|
|
389
|
-
let a = () => t ??
|
|
400
|
+
let a = () => t ?? me(k), o = (e) => {
|
|
390
401
|
switch (e.type) {
|
|
391
402
|
case "ready":
|
|
392
403
|
x(!0), C(e.unreadCount ?? 0);
|
|
393
404
|
break;
|
|
394
405
|
}
|
|
395
|
-
for (let t of
|
|
396
|
-
},
|
|
397
|
-
let e = new
|
|
406
|
+
for (let t of j.current) t(e);
|
|
407
|
+
}, l = setTimeout(() => {
|
|
408
|
+
let e = new _({
|
|
398
409
|
getToken: a,
|
|
399
410
|
maxMessageBodyLength: f,
|
|
400
411
|
maxReconnectAttempts: s,
|
|
401
412
|
onConnectionChange: (e) => {
|
|
402
|
-
|
|
413
|
+
v(e), e || x(!1);
|
|
403
414
|
},
|
|
404
415
|
onEvent: o,
|
|
405
416
|
reconnect: p,
|
|
406
|
-
reconnectBaseDelay:
|
|
417
|
+
reconnectBaseDelay: c,
|
|
407
418
|
url: i
|
|
408
419
|
});
|
|
409
|
-
|
|
420
|
+
A.current = e, e.connect();
|
|
410
421
|
}, 0);
|
|
411
422
|
return () => {
|
|
412
|
-
clearTimeout(
|
|
423
|
+
clearTimeout(l), A.current?.disconnect(), A.current = null;
|
|
413
424
|
};
|
|
414
425
|
}, [
|
|
415
|
-
|
|
426
|
+
E,
|
|
416
427
|
n,
|
|
417
428
|
r,
|
|
418
429
|
h,
|
|
419
430
|
t,
|
|
420
431
|
p,
|
|
421
|
-
|
|
422
|
-
|
|
432
|
+
D,
|
|
433
|
+
k,
|
|
423
434
|
f,
|
|
424
435
|
s,
|
|
425
|
-
|
|
436
|
+
c
|
|
426
437
|
]);
|
|
427
|
-
let
|
|
428
|
-
|
|
429
|
-
}, []),
|
|
430
|
-
|
|
431
|
-
}, []),
|
|
432
|
-
|
|
433
|
-
}, []),
|
|
434
|
-
|
|
435
|
-
}, []),
|
|
436
|
-
|
|
437
|
-
}, []),
|
|
438
|
+
let M = i((e) => {
|
|
439
|
+
A.current?.joinThread(e);
|
|
440
|
+
}, []), N = i((e) => {
|
|
441
|
+
A.current?.leaveThread(e);
|
|
442
|
+
}, []), P = i((e, t) => {
|
|
443
|
+
A.current?.sendMessage(e, t);
|
|
444
|
+
}, []), F = i((e) => {
|
|
445
|
+
A.current?.markRead(e);
|
|
446
|
+
}, []), I = i((e, t) => {
|
|
447
|
+
A.current?.listThreads(e, t);
|
|
448
|
+
}, []), ee = i((e = 1) => {
|
|
438
449
|
C((t) => t + e);
|
|
439
|
-
}, []),
|
|
450
|
+
}, []), te = {
|
|
440
451
|
decrementUnreadCount: i((e = 1) => {
|
|
441
452
|
C((t) => Math.max(0, t - e));
|
|
442
453
|
}, []),
|
|
443
454
|
disconnect: i(() => {
|
|
444
|
-
|
|
455
|
+
A.current?.disconnect(), A.current = null;
|
|
445
456
|
}, []),
|
|
446
|
-
incrementUnreadCount:
|
|
447
|
-
isConnected:
|
|
457
|
+
incrementUnreadCount: ee,
|
|
458
|
+
isConnected: g,
|
|
448
459
|
isReady: b,
|
|
449
|
-
joinThread:
|
|
450
|
-
leaveThread:
|
|
451
|
-
listThreads:
|
|
452
|
-
markRead:
|
|
453
|
-
sendMessage:
|
|
460
|
+
joinThread: M,
|
|
461
|
+
leaveThread: N,
|
|
462
|
+
listThreads: I,
|
|
463
|
+
markRead: F,
|
|
464
|
+
sendMessage: P,
|
|
454
465
|
setEnabled: i((e) => {
|
|
455
|
-
|
|
466
|
+
T(e);
|
|
456
467
|
}, []),
|
|
457
|
-
subscribe: i((e) => (
|
|
458
|
-
|
|
468
|
+
subscribe: i((e) => (j.current.add(e), () => {
|
|
469
|
+
j.current.delete(e);
|
|
459
470
|
}), []),
|
|
460
471
|
unreadCount: S
|
|
461
472
|
};
|
|
462
|
-
return /* @__PURE__ */
|
|
463
|
-
value:
|
|
473
|
+
return /* @__PURE__ */ d(W.Provider, {
|
|
474
|
+
value: te,
|
|
464
475
|
children: e
|
|
465
476
|
});
|
|
466
|
-
},
|
|
467
|
-
let { libraries: i } = a(
|
|
477
|
+
}, ge = (e) => e && typeof e == "function", _e = (e) => e && typeof e == "function", ve = ({ children: e, defaultQueriesOptions: t, defaultMutationsOptions: n, ...r }) => {
|
|
478
|
+
let { libraries: i } = a(y), o = r?.QueryClient || i?.reactQuery?.QueryClient, s = r?.QueryClientProvider || i?.reactQuery?.QueryClientProvider;
|
|
468
479
|
if (!o) throw Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
469
480
|
if (!s) throw Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
470
|
-
if (!
|
|
471
|
-
if (!
|
|
472
|
-
let
|
|
473
|
-
return
|
|
481
|
+
if (!ge(s)) throw Error("Provided QueryClientProvider dependencies are not valid.");
|
|
482
|
+
if (!_e(o)) throw Error("Provided QueryClient dependencies are not valid.");
|
|
483
|
+
let c = l(null);
|
|
484
|
+
return c.current ||= new o({ defaultOptions: {
|
|
474
485
|
mutations: { ...n },
|
|
475
486
|
queries: {
|
|
476
487
|
getNextPageParam: (e, t, n) => e.length + (n || 0),
|
|
@@ -478,41 +489,41 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
478
489
|
retry: 3,
|
|
479
490
|
...t
|
|
480
491
|
}
|
|
481
|
-
} }), /* @__PURE__ */
|
|
482
|
-
client:
|
|
492
|
+
} }), /* @__PURE__ */ d(s, {
|
|
493
|
+
client: c.current,
|
|
483
494
|
children: e
|
|
484
495
|
});
|
|
485
|
-
},
|
|
496
|
+
}, G = ({ library: e, date: t, format: n = "ll" }) => e(t).format(n), K = (e, t) => {
|
|
486
497
|
let { fractionDigits: n = 0, metric: r = "km", spacingBetween: i = !0 } = t || {}, a = Number(e), o = i ? " " : "";
|
|
487
498
|
return Number.isNaN(a) ? `0${o}${r}` : `${a.toFixed(n)}${o}${r}`;
|
|
488
|
-
},
|
|
499
|
+
}, q = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((e) => e.length > 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" "), ye = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, be = ({ path: e, size: t, apiURL: n }) => {
|
|
489
500
|
if (!e) return "";
|
|
490
|
-
let r = `${n}${
|
|
501
|
+
let r = `${n}${ye(e)}`, i = r.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
|
|
491
502
|
return typeof t == "number" && i ? `${r.replace("/files", `/thumbs/${t}`)}` : r;
|
|
492
|
-
},
|
|
493
|
-
let { apiURL: t, libraries: n } = a(
|
|
503
|
+
}, xe = (e) => {
|
|
504
|
+
let { apiURL: t, libraries: n } = a(y), r = e?.dayjs || n?.dayjs;
|
|
494
505
|
return {
|
|
495
506
|
dateAdapter: (e, t) => {
|
|
496
507
|
if (!r) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
497
|
-
return
|
|
508
|
+
return G({
|
|
498
509
|
date: e,
|
|
499
510
|
format: t,
|
|
500
511
|
library: r
|
|
501
512
|
});
|
|
502
513
|
},
|
|
503
|
-
distanceAdapter:
|
|
514
|
+
distanceAdapter: K,
|
|
504
515
|
filePathAdapter: (e, n) => {
|
|
505
516
|
if (!t) throw Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");
|
|
506
|
-
return typeof e == "string" && /^https?:\/\//.test(e) ? e :
|
|
517
|
+
return typeof e == "string" && /^https?:\/\//.test(e) ? e : be({
|
|
507
518
|
apiURL: t,
|
|
508
519
|
path: e,
|
|
509
520
|
size: n
|
|
510
521
|
});
|
|
511
522
|
},
|
|
512
|
-
worksiteNameAdapter:
|
|
523
|
+
worksiteNameAdapter: q
|
|
513
524
|
};
|
|
514
|
-
},
|
|
515
|
-
let { libraries: e } = a(
|
|
525
|
+
}, Se = () => {
|
|
526
|
+
let { libraries: e } = a(y), t = e?.amplitude?.analytics, n = i((e, n) => {
|
|
516
527
|
if (!t || (t.setUserId(e), !n)) return;
|
|
517
528
|
let r = new t.Identify();
|
|
518
529
|
Object.entries(n).forEach(([e, t]) => {
|
|
@@ -535,14 +546,14 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
535
546
|
setGroup: r,
|
|
536
547
|
track: o
|
|
537
548
|
};
|
|
538
|
-
},
|
|
539
|
-
let { libraries: t, localStorageKeys: n } = a(
|
|
549
|
+
}, Ce = (e) => {
|
|
550
|
+
let { libraries: t, localStorageKeys: n } = a(y), r = e?.axios || t?.axios, s = e?.localStorageKey || n?.user || "user";
|
|
540
551
|
if (!r) throw Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
|
|
541
552
|
let c = i(({ tokenType: e, accessToken: t }) => {
|
|
542
553
|
r.defaults.headers.common.Authorization = `${e} ${t}`;
|
|
543
554
|
}, [r.defaults.headers.common]);
|
|
544
555
|
return o(() => {
|
|
545
|
-
if (
|
|
556
|
+
if (I) return;
|
|
546
557
|
let e = ({ newValue: e, key: t }) => {
|
|
547
558
|
if (t === s && e) try {
|
|
548
559
|
let { accessToken: t, tokenType: n } = JSON.parse(e);
|
|
@@ -563,9 +574,9 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
563
574
|
},
|
|
564
575
|
setAuthenticationToken: c
|
|
565
576
|
};
|
|
566
|
-
},
|
|
577
|
+
}, we = "New message", Te = (e, t) => {
|
|
567
578
|
if (!("Notification" in window) || typeof Notification != "function" || Notification.permission !== "granted" || !document.hidden) return;
|
|
568
|
-
let n = new Notification(t.title ??
|
|
579
|
+
let n = new Notification(t.title ?? we, {
|
|
569
580
|
badge: t?.badge,
|
|
570
581
|
body: t?.body || e.bodyPreview,
|
|
571
582
|
data: t?.data,
|
|
@@ -580,10 +591,10 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
580
591
|
let { onClick: r } = t;
|
|
581
592
|
n.onclick = () => r(e);
|
|
582
593
|
}
|
|
583
|
-
},
|
|
584
|
-
let t = a(
|
|
594
|
+
}, Ee = (e) => {
|
|
595
|
+
let t = a(W);
|
|
585
596
|
if (!t) throw Error("useChat must be used within ChatProvider");
|
|
586
|
-
let { subscribe: n, setEnabled: r, ...i } = t, s =
|
|
597
|
+
let { subscribe: n, setEnabled: r, ...i } = t, s = l(e);
|
|
587
598
|
return s.current = e, o(() => {
|
|
588
599
|
e?.enabled !== void 0 && r(e.enabled);
|
|
589
600
|
}, [e?.enabled, r]), o(() => {
|
|
@@ -598,7 +609,7 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
598
609
|
r?.(e);
|
|
599
610
|
break;
|
|
600
611
|
case "new_message_notification":
|
|
601
|
-
i?.(e), t && t.enabled !== !1 &&
|
|
612
|
+
i?.(e), t && t.enabled !== !1 && Te(e, t);
|
|
602
613
|
break;
|
|
603
614
|
case "presence":
|
|
604
615
|
a?.(e);
|
|
@@ -623,46 +634,46 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
623
634
|
break;
|
|
624
635
|
}
|
|
625
636
|
}), [n]), i;
|
|
626
|
-
},
|
|
627
|
-
let [n, r] =
|
|
637
|
+
}, J = (e, t) => t === "short" ? e.split("-")[0] : e, De = (e, t = "full") => {
|
|
638
|
+
let [n, r] = u(() => {
|
|
628
639
|
let n = e?.language || navigator.language;
|
|
629
|
-
return e && "isInitialized" in e && e.isInitialized,
|
|
640
|
+
return e && "isInitialized" in e && e.isInitialized, J(n, t);
|
|
630
641
|
});
|
|
631
642
|
return o(() => {
|
|
632
|
-
e && "isInitialized" in e && e.isInitialized && e.language && r(
|
|
643
|
+
e && "isInitialized" in e && e.isInitialized && e.language && r(J(e.language, t));
|
|
633
644
|
let n = (e) => {
|
|
634
|
-
r(
|
|
645
|
+
r(J(e, t));
|
|
635
646
|
};
|
|
636
647
|
return e?.on?.("languageChanged", n), () => {
|
|
637
648
|
e?.off?.("languageChanged", n);
|
|
638
649
|
};
|
|
639
650
|
}, [e, t]), n;
|
|
640
|
-
},
|
|
651
|
+
}, Oe = "tracktor.filter", ke = {
|
|
641
652
|
getFilter: () => void 0,
|
|
642
653
|
getFilters: () => ({}),
|
|
643
654
|
handleFilter: () => () => {},
|
|
644
655
|
setFilter: () => {}
|
|
645
|
-
},
|
|
656
|
+
}, Y = (e) => {
|
|
646
657
|
try {
|
|
647
658
|
return JSON.parse(e);
|
|
648
659
|
} catch {
|
|
649
660
|
return e;
|
|
650
661
|
}
|
|
651
|
-
},
|
|
662
|
+
}, Ae = (e, t, n) => `${n}_${e}=>${t}`, je = (e) => e.reduce((e, t) => {
|
|
652
663
|
let n = localStorage.getItem(t);
|
|
653
664
|
if (n) try {
|
|
654
665
|
let t = JSON.parse(n), r = Object.keys(t)?.[0];
|
|
655
666
|
r && (e[r] = Object.values(t)?.[0]);
|
|
656
667
|
} catch {}
|
|
657
668
|
return e;
|
|
658
|
-
}, {}),
|
|
659
|
-
let { libraries: t, localStorageKeys: n } = a(
|
|
660
|
-
if (
|
|
669
|
+
}, {}), Me = (e) => {
|
|
670
|
+
let { libraries: t, localStorageKeys: n } = a(y), r = e?.reactRouter || t?.reactRouter, { pathname: i } = r?.useLocation?.() ?? { pathname: "/" }, [o, s] = r?.useSearchParams?.() ?? [new URLSearchParams(), () => {}], [c, l] = u({}), d = n?.filter || Oe, f = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, p = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
|
|
671
|
+
if (I) return ke;
|
|
661
672
|
if (!r) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of reactRouter.");
|
|
662
673
|
let m = () => Object.keys(localStorage).filter((t) => t.startsWith(d) && t.endsWith(e?.pathname || i)), h = (t, n, r = !0) => {
|
|
663
|
-
let a =
|
|
674
|
+
let a = Ae(t, e?.pathname || i, d);
|
|
664
675
|
if (!n || Array.isArray(n) && !n.length) {
|
|
665
|
-
f ? (o.delete(t), s(o)) :
|
|
676
|
+
f ? (o.delete(t), s(o)) : l((e) => {
|
|
666
677
|
let n = { ...e };
|
|
667
678
|
return delete n[t], n;
|
|
668
679
|
}), p && localStorage.removeItem(a);
|
|
@@ -671,7 +682,7 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
671
682
|
p && r && n && localStorage.setItem(a, JSON.stringify({
|
|
672
683
|
...o,
|
|
673
684
|
[t]: n
|
|
674
|
-
})), f && n ? (o.set(t, JSON.stringify(n)), s(o)) : !f && n &&
|
|
685
|
+
})), f && n ? (o.set(t, JSON.stringify(n)), s(o)) : !f && n && l((e) => ({
|
|
675
686
|
...e,
|
|
676
687
|
[t]: n
|
|
677
688
|
}));
|
|
@@ -680,16 +691,16 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
680
691
|
getFilter: (t, n) => {
|
|
681
692
|
if (f) {
|
|
682
693
|
let e = o.get(t);
|
|
683
|
-
if (e) return
|
|
694
|
+
if (e) return Y(e);
|
|
684
695
|
} else {
|
|
685
696
|
let e = c[t];
|
|
686
697
|
if (e !== void 0) return e;
|
|
687
698
|
}
|
|
688
699
|
if (p) {
|
|
689
|
-
let n =
|
|
700
|
+
let n = Ae(t, e?.pathname || i, d), r = localStorage.getItem(n);
|
|
690
701
|
if (r) try {
|
|
691
702
|
let e = JSON.parse(r)[t];
|
|
692
|
-
return !f && e !== void 0 &&
|
|
703
|
+
return !f && e !== void 0 && l((n) => ({
|
|
693
704
|
...n,
|
|
694
705
|
[t]: e
|
|
695
706
|
})), e;
|
|
@@ -698,9 +709,9 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
698
709
|
return n;
|
|
699
710
|
},
|
|
700
711
|
getFilters: () => {
|
|
701
|
-
let e = p ?
|
|
712
|
+
let e = p ? je(m()) : {};
|
|
702
713
|
if (f) {
|
|
703
|
-
let t = Array.from(o.entries()).reduce((e, [t, n]) => (e[t] =
|
|
714
|
+
let t = Array.from(o.entries()).reduce((e, [t, n]) => (e[t] = Y(n), e), {});
|
|
704
715
|
return {
|
|
705
716
|
...e,
|
|
706
717
|
...t
|
|
@@ -721,8 +732,8 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
721
732
|
},
|
|
722
733
|
setFilter: h
|
|
723
734
|
};
|
|
724
|
-
},
|
|
725
|
-
let [e, t] =
|
|
735
|
+
}, Ne = () => document.getElementById(L), Pe = () => {
|
|
736
|
+
let [e, t] = u(() => !!window.HubSpotConversations);
|
|
726
737
|
return o(() => {
|
|
727
738
|
if (window.HubSpotConversations) {
|
|
728
739
|
t(!0);
|
|
@@ -731,33 +742,33 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
731
742
|
window.hsConversationsOnReady = [() => t(!0)];
|
|
732
743
|
}, []), o(() => {
|
|
733
744
|
e && window.HubSpotConversations?.on("widgetClosed", () => {
|
|
734
|
-
|
|
745
|
+
Ne()?.classList.remove(R);
|
|
735
746
|
});
|
|
736
747
|
}, [e]), {
|
|
737
748
|
isAvailable: e,
|
|
738
749
|
toggle: i(() => {
|
|
739
|
-
let e = window.HubSpotConversations, t =
|
|
740
|
-
e && t && (t.classList.contains("hs-show") ? (e.widget.close(), t.classList.remove(
|
|
750
|
+
let e = window.HubSpotConversations, t = Ne();
|
|
751
|
+
e && t && (t.classList.contains("hs-show") ? (e.widget.close(), t.classList.remove(R)) : (t.classList.add(R), e.widget.open()));
|
|
741
752
|
}, [])
|
|
742
753
|
};
|
|
743
|
-
},
|
|
744
|
-
let
|
|
754
|
+
}, Fe = ({ data: e, fetchNextPage: t, isFetchingNextPage: n, isInitialLoading: r, isLoading: a, enabled: o = !0 }) => {
|
|
755
|
+
let s = i(async (e) => {
|
|
745
756
|
n || !o || await t({ pageParam: e?.pageParam || e.visibleRowsCount });
|
|
746
757
|
}, [
|
|
747
758
|
o,
|
|
748
759
|
t,
|
|
749
760
|
n
|
|
750
|
-
]), l =
|
|
761
|
+
]), l = c(() => {
|
|
751
762
|
if (e) return e.pages.reduce((e, t) => [...e, ...t], []);
|
|
752
763
|
}, [e]);
|
|
753
764
|
return {
|
|
754
|
-
fetchNextPageOnRowsScrollEnd:
|
|
765
|
+
fetchNextPageOnRowsScrollEnd: s,
|
|
755
766
|
isLoading: n || a,
|
|
756
767
|
loadingVariant: r ? "skeleton" : "linear-progress",
|
|
757
768
|
rows: l
|
|
758
769
|
};
|
|
759
|
-
},
|
|
760
|
-
let { libraries: t } = a(
|
|
770
|
+
}, Ie = (e) => {
|
|
771
|
+
let { libraries: t } = a(y), n = e?.i18 || t?.i18, r = e?.i18?.translateFunction || t?.i18?.translateFunction, o = n?.i18next?.t || r || ((e) => e), { unknownErrorTranslationKey: s = "error.unknownError" } = e || {}, c = o(s), l = i((e) => {
|
|
761
772
|
if (e && typeof e == "object" && "response" in e) {
|
|
762
773
|
let { response: t } = e || {};
|
|
763
774
|
if (t && typeof t == "object" && "reason" in t && t.reason) return String(t.reason);
|
|
@@ -780,38 +791,38 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
780
791
|
}, []),
|
|
781
792
|
printError: l
|
|
782
793
|
};
|
|
783
|
-
},
|
|
784
|
-
if (!
|
|
794
|
+
}, Le = "chunk-reload-timestamp", X = "chunk-reload", Re = 1e4, Z = 2, Q = !1;
|
|
795
|
+
if (!I && typeof window < "u") {
|
|
785
796
|
try {
|
|
786
797
|
let e = new URL(window.location.href);
|
|
787
|
-
e.searchParams.has(
|
|
798
|
+
e.searchParams.has(X) && (Q = !0, e.searchParams.delete(X), window.history.replaceState(null, "", e.toString()));
|
|
788
799
|
} catch {}
|
|
789
800
|
window.addEventListener("vite:preloadError", (e) => {
|
|
790
801
|
e.preventDefault();
|
|
791
802
|
});
|
|
792
803
|
}
|
|
793
|
-
var
|
|
804
|
+
var ze = (e) => {
|
|
794
805
|
if (!(e instanceof Error)) return !1;
|
|
795
806
|
let t = e.message.toLowerCase();
|
|
796
807
|
return t.includes("dynamically imported module") || t.includes("importing a module script failed") || t.includes("loading chunk") || t.includes("loading css chunk") || t.includes("unable to preload css") || t.includes("failed to fetch") || t.includes("error loading dynamically imported module") || t.includes("load failed") || t.includes("without a valid default export") || e.name === "ChunkLoadError";
|
|
797
|
-
},
|
|
808
|
+
}, Be = /import\s*\(\s*(['"])((\w+:(\/?\/?))?[^\s,]+)\1/, Ve = (e) => e.toString().match(Be)?.[2] ?? null, He = (e) => {
|
|
798
809
|
try {
|
|
799
810
|
return sessionStorage.getItem(e);
|
|
800
811
|
} catch {
|
|
801
812
|
return null;
|
|
802
813
|
}
|
|
803
|
-
},
|
|
814
|
+
}, Ue = (e, t) => {
|
|
804
815
|
try {
|
|
805
816
|
sessionStorage.setItem(e, t);
|
|
806
817
|
} catch {}
|
|
807
|
-
},
|
|
808
|
-
for (let t = 0; t <
|
|
809
|
-
return await
|
|
818
|
+
}, We = (e) => Function("url", "return import(url)")(e), Ge = async (e) => {
|
|
819
|
+
for (let t = 0; t < Z; t++) try {
|
|
820
|
+
return await We(`${e}?t=${Date.now()}`);
|
|
810
821
|
} catch {
|
|
811
|
-
t <
|
|
822
|
+
t < Z - 1 && await new Promise((e) => setTimeout(e, 500 * 2 ** t));
|
|
812
823
|
}
|
|
813
|
-
throw Error(`Failed to import ${e} after ${
|
|
814
|
-
},
|
|
824
|
+
throw Error(`Failed to import ${e} after ${Z} retries`);
|
|
825
|
+
}, Ke = async () => {
|
|
815
826
|
try {
|
|
816
827
|
if (typeof navigator < "u" && "serviceWorker" in navigator) {
|
|
817
828
|
let e = await navigator.serviceWorker.getRegistrations();
|
|
@@ -822,27 +833,27 @@ var Fe = (e) => {
|
|
|
822
833
|
await Promise.all(e.map((e) => caches.delete(e)));
|
|
823
834
|
}
|
|
824
835
|
} catch {}
|
|
825
|
-
},
|
|
826
|
-
await
|
|
836
|
+
}, qe = async () => {
|
|
837
|
+
await Ke();
|
|
827
838
|
let e = new URL(window.location.href);
|
|
828
|
-
e.searchParams.set(
|
|
829
|
-
},
|
|
839
|
+
e.searchParams.set(X, String(Date.now())), window.location.replace(e.toString());
|
|
840
|
+
}, $ = (e) => e != null && e.default !== void 0, Je = (e) => r(async () => {
|
|
830
841
|
let t;
|
|
831
842
|
try {
|
|
832
843
|
let n = await e();
|
|
833
|
-
if (
|
|
844
|
+
if ($(n)) return n;
|
|
834
845
|
t = /* @__PURE__ */ Error("Module resolved without a valid default export");
|
|
835
846
|
} catch (e) {
|
|
836
847
|
t = e;
|
|
837
848
|
}
|
|
838
|
-
if (
|
|
839
|
-
let n =
|
|
849
|
+
if (I || !ze(t)) throw t;
|
|
850
|
+
let n = Ve(e);
|
|
840
851
|
if (n) try {
|
|
841
|
-
let e = await
|
|
842
|
-
if (
|
|
852
|
+
let e = await Ge(n);
|
|
853
|
+
if ($(e)) return e;
|
|
843
854
|
} catch {}
|
|
844
|
-
let r = Number(
|
|
845
|
-
return Date.now() - r <
|
|
855
|
+
let r = Number(He(Le) || "0");
|
|
856
|
+
return Date.now() - r < Re || Q || (Ue(Le, String(Date.now())), await qe()), { default: () => null };
|
|
846
857
|
});
|
|
847
858
|
//#endregion
|
|
848
|
-
export {
|
|
859
|
+
export { A as AMPLITUDE_FEATURE_SELECTOR, O as AutoReloadOnNewVersion, _ as ChatClient, W as ChatContext, he as ChatProvider, k as GTMSendPageView, F as InitializeAmplitude, te as InitializeAxiosConfig, ie as InitializeDaysJSConfig, ae as InitializeHubSpot, oe as InitializeI18nConfig, se as InitializeSentryConfig, y as InjectDependenciesContext, b as InjectDependenciesProvider, v as MaskTextField, ve as QueryProvider, le as RequireAuth, B as SENTRY_KEEP_REPLAY, ne as SUPPORTED_LANGUAGE, ue as ShowHubSpotBubble, G as dateAdapter, K as distanceAdapter, e as getOrvalConfig, V as isReplayKeptForError, Je as lazyWithRetry, xe as useAdapter, Se as useAmplitude, Ce as useAuth, Ee as useChat, De as useCurrentLanguage, Me as useFilters, Pe as useHubSpot, Fe as useInfiniteDataGrid, Ie as useResponseError, q as worksiteNameAdapter };
|