@getsoren/shared-module 2.53.0 → 2.55.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/dist/events/catalog/clientEvents.d.ts +245 -0
- package/dist/events/catalog/supplierEvents.d.ts +3 -0
- package/dist/events/constants.d.ts +16 -0
- package/dist/events/hooks/useEventDeclaration/useEventDeclaration.d.ts +40 -0
- package/dist/events/hooks/useEventDeclaration/useEventDeclaration.test.d.ts +1 -0
- package/dist/events/index.d.ts +19 -0
- package/dist/events/locales/ar.d.ts +3 -0
- package/dist/events/locales/de.d.ts +3 -0
- package/dist/events/locales/en.d.ts +3 -0
- package/dist/events/locales/es.d.ts +3 -0
- package/dist/events/locales/fr.d.ts +166 -0
- package/dist/events/locales/it.d.ts +3 -0
- package/dist/events/locales/locales.d.ts +3 -0
- package/dist/events/locales/pt.d.ts +3 -0
- package/dist/events/tenants/bouygues/bouygues.d.ts +3 -0
- package/dist/events/tenants/index.d.ts +11 -0
- package/dist/events/tenants/tenants.test.d.ts +1 -0
- package/dist/events/types.d.ts +164 -0
- package/dist/events/utils/amounts/amounts.d.ts +18 -0
- package/dist/events/utils/payload/payload.d.ts +27 -0
- package/dist/events/utils/payload/payload.test.d.ts +1 -0
- package/dist/events/utils/readEvent/readEvent.d.ts +18 -0
- package/dist/events/utils/readEvent/readEvent.test.d.ts +1 -0
- package/dist/events/utils/steps/steps.d.ts +14 -0
- package/dist/events/utils/steps/steps.test.d.ts +1 -0
- package/dist/events.js +1936 -0
- package/dist/hooks/useCurrentLanguage/useCurrentLanguage.d.ts +1 -1
- package/dist/main.d.ts +4 -0
- package/dist/main.js +190 -146
- package/dist/utils/getCurrentLanguage/getCurrentLanguage.d.ts +10 -0
- package/dist/utils/getCurrentLanguage/getCurrentLanguage.test.d.ts +1 -0
- package/dist/utils/pageDuration/pageDuration.d.ts +30 -0
- package/dist/utils/pageDuration/pageDuration.test.d.ts +1 -0
- package/dist/utils/token/token.d.ts +23 -0
- package/dist/utils/token/token.test.d.ts +1 -0
- package/package.json +6 -1
package/dist/main.js
CHANGED
|
@@ -129,17 +129,17 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
129
129
|
value: i,
|
|
130
130
|
children: e
|
|
131
131
|
});
|
|
132
|
-
}, x = 900 * 1e3, S = 60 * 1e3, C = 600 * 1e3, w = "auto-reload-on-new-version-timestamp",
|
|
132
|
+
}, x = 900 * 1e3, S = 60 * 1e3, C = 600 * 1e3, w = "auto-reload-on-new-version-timestamp", ee = /<meta[^>]*name="version"[^>]*content="([^"]*)"/, T = (e) => {
|
|
133
133
|
try {
|
|
134
134
|
return sessionStorage.getItem(e);
|
|
135
135
|
} catch {
|
|
136
136
|
return null;
|
|
137
137
|
}
|
|
138
|
-
},
|
|
138
|
+
}, E = (e, t) => {
|
|
139
139
|
try {
|
|
140
140
|
sessionStorage.setItem(e, t);
|
|
141
141
|
} catch {}
|
|
142
|
-
},
|
|
142
|
+
}, D = ({ version: e, checkInterval: t = x, children: n, ...r }) => {
|
|
143
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
145
|
let { useLocation: f, Outlet: p } = s, { pathname: m } = f(), h = l(m);
|
|
@@ -151,7 +151,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
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(
|
|
154
|
+
let n = (await t.text()).match(ee)?.[1];
|
|
155
155
|
n && n !== "%VERSION%" && n !== e && (c.current = !0);
|
|
156
156
|
} catch {}
|
|
157
157
|
}
|
|
@@ -164,10 +164,10 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
164
164
|
}, [e, t]), o(() => {
|
|
165
165
|
if (m === h.current || (h.current = m, !c.current)) return;
|
|
166
166
|
c.current = !1;
|
|
167
|
-
let e = Number(
|
|
168
|
-
Date.now() - e < C || (
|
|
167
|
+
let e = Number(T(w) || "0");
|
|
168
|
+
Date.now() - e < C || (E(w, String(Date.now())), window.location.reload());
|
|
169
169
|
}, [m]), n ?? /* @__PURE__ */ d(p, {});
|
|
170
|
-
},
|
|
170
|
+
}, O = ({ data: e, ...t }) => {
|
|
171
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.");
|
|
@@ -183,7 +183,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
183
183
|
u,
|
|
184
184
|
f
|
|
185
185
|
]), /* @__PURE__ */ d(l, {});
|
|
186
|
-
},
|
|
186
|
+
}, k = "[data-amp-track-feature]", A = [
|
|
187
187
|
"a",
|
|
188
188
|
"button",
|
|
189
189
|
"input",
|
|
@@ -195,18 +195,18 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
195
195
|
"[contenteditable=\"true\" i]",
|
|
196
196
|
"[data-amp-default-track]",
|
|
197
197
|
".amp-default-track"
|
|
198
|
-
],
|
|
198
|
+
], te = { defaultMaskLevel: "medium" }, j = (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, k],
|
|
203
203
|
...n
|
|
204
204
|
};
|
|
205
|
-
},
|
|
205
|
+
}, M = (e, t) => !t || e === !1 ? !1 : {
|
|
206
206
|
deadClicks: !0,
|
|
207
207
|
rageClicks: !0,
|
|
208
208
|
...e === !0 ? {} : e
|
|
209
|
-
},
|
|
209
|
+
}, N = ({ apiKey: e, appVersion: t, sessionReplaySampleRate: n, serverZone: r, elementInteractions: i = !0, frustrationInteractions: c = !0, platform: u = "desktop", sessionReplayPrivacy: d = te, ...f }) => {
|
|
210
210
|
let { libraries: p } = a(y), m = f.amplitude || p?.amplitude, h = l({
|
|
211
211
|
elementInteractions: i,
|
|
212
212
|
frustrationInteractions: c,
|
|
@@ -221,12 +221,12 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
221
221
|
}), o(() => {
|
|
222
222
|
let i = m?.analytics, a = m?.sessionReplayPlugin;
|
|
223
223
|
if (!(e && i)) return;
|
|
224
|
-
let { elementInteractions: o, frustrationInteractions: s, sessionReplayPrivacy: c } = h.current, l = "platform-enrichment", d =
|
|
224
|
+
let { elementInteractions: o, frustrationInteractions: s, sessionReplayPrivacy: c } = h.current, l = "platform-enrichment", d = j(o, i.Types?.DEFAULT_CSS_SELECTOR_ALLOWLIST ?? A);
|
|
225
225
|
return i.init(e, {
|
|
226
226
|
appVersion: t,
|
|
227
227
|
autocapture: {
|
|
228
228
|
elementInteractions: d,
|
|
229
|
-
frustrationInteractions:
|
|
229
|
+
frustrationInteractions: M(s, d !== !1),
|
|
230
230
|
pageViews: { trackHistoryChanges: "pathOnly" }
|
|
231
231
|
},
|
|
232
232
|
serverZone: r
|
|
@@ -254,22 +254,22 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
254
254
|
r,
|
|
255
255
|
n
|
|
256
256
|
]), null;
|
|
257
|
-
},
|
|
257
|
+
}, P = (() => {
|
|
258
258
|
try {
|
|
259
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;
|
|
260
260
|
} catch {
|
|
261
261
|
return !1;
|
|
262
262
|
}
|
|
263
|
-
})(),
|
|
264
|
-
let { apiURL: i = r.apiURL, libraries: o, localStorageKeys: s } = a(y), c = r?.userLocalStorageKey || s?.user ||
|
|
263
|
+
})(), ne = "user", re = ({ 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 || ne, l = r?.axios || o?.axios;
|
|
265
265
|
if (!l) throw Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
266
|
-
if (!l?.defaults ||
|
|
266
|
+
if (!l?.defaults || P) return null;
|
|
267
267
|
if (typeof window < "u" && window.localStorage) {
|
|
268
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;
|
|
269
269
|
o && (l.defaults.headers.common.Authorization = o);
|
|
270
270
|
}
|
|
271
271
|
return l.defaults.baseURL = i, l.defaults.headers.post["Content-Type"] = n, null;
|
|
272
|
-
},
|
|
272
|
+
}, ie = [
|
|
273
273
|
"ar",
|
|
274
274
|
"de",
|
|
275
275
|
"en",
|
|
@@ -277,15 +277,15 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
277
277
|
"fr",
|
|
278
278
|
"it",
|
|
279
279
|
"pt"
|
|
280
|
-
],
|
|
280
|
+
], ae = (e) => ie.includes(e), oe = ({ language: e, ...t }) => {
|
|
281
281
|
let { libraries: n } = a(y), r = t?.dayjs || n?.dayjs, i = t?.plugin || n?.dayjsPlugin;
|
|
282
282
|
if (!r) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");
|
|
283
283
|
r.extend(t.localizedFormat), i && i.forEach((e) => {
|
|
284
284
|
e && r.extend(e);
|
|
285
285
|
});
|
|
286
|
-
let o = e || navigator.language?.slice(0, 2) || "en", s =
|
|
286
|
+
let o = e || navigator.language?.slice(0, 2) || "en", s = ae(o) ? o : "en";
|
|
287
287
|
return r.locale() !== s && r.locale(s), null;
|
|
288
|
-
},
|
|
288
|
+
}, F = "hubspot-messages-iframe-container", I = "hs-show", L = "data-hs-hidden", se = ({ hubId: e }) => (o(() => {
|
|
289
289
|
if (!e) return;
|
|
290
290
|
let t = document.createElement("script");
|
|
291
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), () => {
|
|
@@ -294,14 +294,14 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
294
294
|
}, [e]), o(() => {
|
|
295
295
|
let e = document.createElement("style");
|
|
296
296
|
return e.textContent = `
|
|
297
|
-
html[${
|
|
298
|
-
html[${
|
|
299
|
-
`, document.head.appendChild(e), document.documentElement.setAttribute(
|
|
300
|
-
e.remove(), document.documentElement.removeAttribute(
|
|
297
|
+
html[${L}] div#${F} { display: none !important; }
|
|
298
|
+
html[${L}] div#${F}.${I} { display: initial !important; }
|
|
299
|
+
`, document.head.appendChild(e), document.documentElement.setAttribute(L, ""), () => {
|
|
300
|
+
e.remove(), document.documentElement.removeAttribute(L);
|
|
301
301
|
};
|
|
302
|
-
}, []), null),
|
|
302
|
+
}, []), null), ce = ({ debug: e, resources: t, ...n }) => {
|
|
303
303
|
let { libraries: r } = a(y), i = n?.i18 || r?.i18, { i18next: o, initReactI18next: s, languageDetector: c } = i || {};
|
|
304
|
-
if (
|
|
304
|
+
if (P) return null;
|
|
305
305
|
if (!(i && o && c && s)) throw Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
306
306
|
return o.isInitialized ? null : (o.use(c).use(s).init({
|
|
307
307
|
debug: e,
|
|
@@ -319,12 +319,12 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
319
319
|
}), o.on("languageChanged", (e) => {
|
|
320
320
|
document.documentElement.setAttribute("lang", e);
|
|
321
321
|
}), null);
|
|
322
|
-
},
|
|
322
|
+
}, R = { replay: "keep" }, z = (e) => e.tags?.replay === R.replay, B = [/^https:\/\/(api|events)\.mapbox\.com\//], V = (e, t) => t.some((t) => typeof t == "string" ? e.includes(t) : t.test(e)), le = ({ dsn: e, integrations: t, tracesSampleRate: n, tracePropagationTargets: r, ignoreErrors: i, ignoreRequestUrls: s, debug: c, environment: l, release: u, replaysSessionSampleRate: d = 0, replaysOnErrorSampleRate: f = 1, replayBeforeErrorSampling: p = z, ...m }) => {
|
|
323
323
|
let { libraries: h } = a(y), g = m?.sentry || h?.sentry, _ = m?.reactRouter || h?.reactRouter;
|
|
324
324
|
if (!g) throw Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
325
325
|
if (!_) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
326
326
|
if (g.isInitialized()) return null;
|
|
327
|
-
let { createRoutesFromChildren: v, matchRoutes: b, useLocation: x, useNavigationType: S } = _, C = d > 0 || f > 0, w = [...s || [], ...
|
|
327
|
+
let { createRoutesFromChildren: v, matchRoutes: b, useLocation: x, useNavigationType: S } = _, C = d > 0 || f > 0, w = [...s || [], ...B];
|
|
328
328
|
return (c || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && g.init({
|
|
329
329
|
debug: c,
|
|
330
330
|
dsn: e,
|
|
@@ -342,7 +342,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
342
342
|
g.reactRouterV6BrowserTracingIntegration({
|
|
343
343
|
createRoutesFromChildren: v,
|
|
344
344
|
matchRoutes: b,
|
|
345
|
-
shouldCreateSpanForRequest: (e) => !
|
|
345
|
+
shouldCreateSpanForRequest: (e) => !V(e, w),
|
|
346
346
|
useEffect: o,
|
|
347
347
|
useLocation: x,
|
|
348
348
|
useNavigationType: S
|
|
@@ -356,12 +356,12 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
356
356
|
tracePropagationTargets: r,
|
|
357
357
|
tracesSampleRate: n ?? 1
|
|
358
358
|
}), null;
|
|
359
|
-
},
|
|
360
|
-
let { libraries: c, localStorageKeys: l } = a(y), f = s?.reactRouter || c?.reactRouter, p = s?.axios || c?.axios, m = s?.localStorageKey || l?.user ||
|
|
359
|
+
}, H = /* @__PURE__ */ new WeakMap(), ue = "user", de = ({ Fallback: e, isLogged: n, loginPath: r = "/login", redirect401Path: i = "/login", ...s }) => {
|
|
360
|
+
let { libraries: c, localStorageKeys: l } = a(y), f = s?.reactRouter || c?.reactRouter, p = s?.axios || c?.axios, m = s?.localStorageKey || l?.user || ue;
|
|
361
361
|
if (!f) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
362
362
|
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;
|
|
363
363
|
return o(() => {
|
|
364
|
-
p && (
|
|
364
|
+
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)))));
|
|
365
365
|
}, [
|
|
366
366
|
p,
|
|
367
367
|
m,
|
|
@@ -377,34 +377,34 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
377
377
|
state: { from: x },
|
|
378
378
|
replace: !0
|
|
379
379
|
});
|
|
380
|
-
},
|
|
380
|
+
}, U = /* @__PURE__ */ new Set(), fe = () => (o(() => {
|
|
381
381
|
let e = Symbol();
|
|
382
|
-
return
|
|
383
|
-
|
|
382
|
+
return U.add(e), document.documentElement.removeAttribute(L), () => {
|
|
383
|
+
U.delete(e), U.size === 0 && document.documentElement.setAttribute(L, "");
|
|
384
384
|
};
|
|
385
|
-
}, []), null),
|
|
385
|
+
}, []), null), pe = "user", me = {
|
|
386
386
|
client: "/v2/threads/ws",
|
|
387
387
|
supplier: "/v1/threads/ws"
|
|
388
|
-
},
|
|
388
|
+
}, he = (e, t) => `${e.startsWith("https") ? "wss" : "ws"}://${e.replace(/^https?:\/\//, "")}${t}`, ge = (e) => {
|
|
389
389
|
try {
|
|
390
390
|
let t = localStorage.getItem(e);
|
|
391
391
|
return t ? JSON.parse(t)?.accessToken ?? null : null;
|
|
392
392
|
} catch {
|
|
393
393
|
return null;
|
|
394
394
|
}
|
|
395
|
-
},
|
|
396
|
-
let [g, v] = u(!1), [b, x] = u(!1), [S, C] = u(0), [w,
|
|
395
|
+
}, W = n(null), _e = ({ children: e, token: t, url: n, wsPath: r, maxReconnectAttempts: s, reconnectBaseDelay: c, maxMessageBodyLength: f = 1e4, reconnect: p = !0, enabled: m = !0, context: h = "client" }) => {
|
|
396
|
+
let [g, v] = u(!1), [b, x] = u(!1), [S, C] = u(0), [w, ee] = u(m), T = m && w, { apiURL: E, localStorageKeys: D } = a(y), O = D?.user || pe, k = l(null), A = l(/* @__PURE__ */ new Set());
|
|
397
397
|
o(() => {
|
|
398
|
-
if (!
|
|
399
|
-
let e = r ??
|
|
398
|
+
if (!T) return;
|
|
399
|
+
let e = r ?? me[h], i = n || (E ? he(E, e) : null);
|
|
400
400
|
if (!i) return;
|
|
401
|
-
let a = () => t ??
|
|
401
|
+
let a = () => t ?? ge(O), o = (e) => {
|
|
402
402
|
switch (e.type) {
|
|
403
403
|
case "ready":
|
|
404
404
|
x(!0), C(e.unreadCount ?? 0);
|
|
405
405
|
break;
|
|
406
406
|
}
|
|
407
|
-
for (let t of
|
|
407
|
+
for (let t of A.current) t(e);
|
|
408
408
|
}, l = setTimeout(() => {
|
|
409
409
|
let e = new _({
|
|
410
410
|
getToken: a,
|
|
@@ -418,80 +418,80 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
418
418
|
reconnectBaseDelay: c,
|
|
419
419
|
url: i
|
|
420
420
|
});
|
|
421
|
-
|
|
421
|
+
k.current = e, e.connect();
|
|
422
422
|
}, 0);
|
|
423
423
|
return () => {
|
|
424
|
-
clearTimeout(l),
|
|
424
|
+
clearTimeout(l), k.current?.disconnect(), k.current = null;
|
|
425
425
|
};
|
|
426
426
|
}, [
|
|
427
|
-
|
|
427
|
+
T,
|
|
428
428
|
n,
|
|
429
429
|
r,
|
|
430
430
|
h,
|
|
431
431
|
t,
|
|
432
432
|
p,
|
|
433
|
-
|
|
434
|
-
|
|
433
|
+
E,
|
|
434
|
+
O,
|
|
435
435
|
f,
|
|
436
436
|
s,
|
|
437
437
|
c
|
|
438
438
|
]);
|
|
439
|
-
let
|
|
440
|
-
|
|
441
|
-
}, []),
|
|
442
|
-
|
|
443
|
-
}, []),
|
|
444
|
-
|
|
445
|
-
}, []),
|
|
446
|
-
|
|
447
|
-
}, []),
|
|
448
|
-
|
|
449
|
-
}, []),
|
|
439
|
+
let te = i((e) => {
|
|
440
|
+
k.current?.joinThread(e);
|
|
441
|
+
}, []), j = i((e) => {
|
|
442
|
+
k.current?.leaveThread(e);
|
|
443
|
+
}, []), M = i((e, t) => {
|
|
444
|
+
k.current?.sendMessage(e, t);
|
|
445
|
+
}, []), N = i((e) => {
|
|
446
|
+
k.current?.markRead(e);
|
|
447
|
+
}, []), P = i((e, t) => {
|
|
448
|
+
k.current?.listThreads(e, t);
|
|
449
|
+
}, []), ne = i((e = 1) => {
|
|
450
450
|
C((t) => t + e);
|
|
451
|
-
}, []),
|
|
451
|
+
}, []), re = {
|
|
452
452
|
decrementUnreadCount: i((e = 1) => {
|
|
453
453
|
C((t) => Math.max(0, t - e));
|
|
454
454
|
}, []),
|
|
455
455
|
disconnect: i(() => {
|
|
456
|
-
|
|
456
|
+
k.current?.disconnect(), k.current = null;
|
|
457
457
|
}, []),
|
|
458
|
-
incrementUnreadCount:
|
|
458
|
+
incrementUnreadCount: ne,
|
|
459
459
|
isConnected: g,
|
|
460
460
|
isReady: b,
|
|
461
|
-
joinThread:
|
|
462
|
-
leaveThread:
|
|
463
|
-
listThreads:
|
|
464
|
-
markRead:
|
|
465
|
-
sendMessage:
|
|
461
|
+
joinThread: te,
|
|
462
|
+
leaveThread: j,
|
|
463
|
+
listThreads: P,
|
|
464
|
+
markRead: N,
|
|
465
|
+
sendMessage: M,
|
|
466
466
|
setEnabled: i((e) => {
|
|
467
|
-
|
|
467
|
+
ee(e);
|
|
468
468
|
}, []),
|
|
469
|
-
subscribe: i((e) => (
|
|
470
|
-
|
|
469
|
+
subscribe: i((e) => (A.current.add(e), () => {
|
|
470
|
+
A.current.delete(e);
|
|
471
471
|
}), []),
|
|
472
472
|
unreadCount: S
|
|
473
473
|
};
|
|
474
|
-
return /* @__PURE__ */ d(
|
|
475
|
-
value:
|
|
474
|
+
return /* @__PURE__ */ d(W.Provider, {
|
|
475
|
+
value: re,
|
|
476
476
|
children: e
|
|
477
477
|
});
|
|
478
|
-
},
|
|
478
|
+
}, ve = 3, ye = new Set([
|
|
479
479
|
400,
|
|
480
480
|
401,
|
|
481
481
|
403,
|
|
482
482
|
404
|
|
483
|
-
]),
|
|
484
|
-
let n =
|
|
485
|
-
return e <
|
|
486
|
-
},
|
|
483
|
+
]), be = (e) => e?.response?.status, G = (e, t) => {
|
|
484
|
+
let n = be(t);
|
|
485
|
+
return e < ve && !(n !== void 0 && ye.has(n));
|
|
486
|
+
}, xe = (e, t, n) => (Array.isArray(e) ? e.length : 0) + (typeof n == "number" ? n : 0), Se = ({ children: e, defaultQueriesOptions: t, defaultMutationsOptions: n, ...r }) => {
|
|
487
487
|
let { libraries: i } = a(y), o = r.QueryClient || i?.reactQuery?.QueryClient, s = r.QueryClientProvider || i?.reactQuery?.QueryClientProvider;
|
|
488
488
|
if (!o) throw Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
489
489
|
if (!s) throw Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
490
490
|
let [c] = u(() => new o({ defaultOptions: {
|
|
491
491
|
mutations: n,
|
|
492
492
|
queries: {
|
|
493
|
-
getNextPageParam:
|
|
494
|
-
retry:
|
|
493
|
+
getNextPageParam: xe,
|
|
494
|
+
retry: G,
|
|
495
495
|
...t
|
|
496
496
|
}
|
|
497
497
|
} }));
|
|
@@ -499,17 +499,17 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
499
499
|
client: c,
|
|
500
500
|
children: e
|
|
501
501
|
});
|
|
502
|
-
},
|
|
502
|
+
}, K = ({ library: e, date: t, format: n = "ll" }) => e(t).format(n), q = (e, t) => {
|
|
503
503
|
let { fractionDigits: n = 0, metric: r = "km", spacingBetween: i = !0 } = t || {}, a = Number(e), o = i ? " " : "";
|
|
504
504
|
return Number.isNaN(a) ? `0${o}${r}` : `${a.toFixed(n)}${o}${r}`;
|
|
505
|
-
},
|
|
505
|
+
}, J = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((e) => e.length > 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" "), Ce = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, we = ({ path: e, size: t, apiURL: n }) => {
|
|
506
506
|
if (!e) return "";
|
|
507
|
-
let r = `${n}${
|
|
507
|
+
let r = `${n}${Ce(e)}`, i = r.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
|
|
508
508
|
return typeof t == "number" && i ? `${r.replace("/files", `/thumbs/${t}`)}` : r;
|
|
509
|
-
},
|
|
509
|
+
}, Te = (e) => {
|
|
510
510
|
let { apiURL: t, libraries: n } = a(y), r = e?.dayjs || n?.dayjs, o = i((e, n) => {
|
|
511
511
|
if (!t) throw Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");
|
|
512
|
-
return typeof e == "string" && /^https?:\/\//.test(e) ? e :
|
|
512
|
+
return typeof e == "string" && /^https?:\/\//.test(e) ? e : we({
|
|
513
513
|
apiURL: t,
|
|
514
514
|
path: e,
|
|
515
515
|
size: n
|
|
@@ -518,17 +518,17 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
518
518
|
return {
|
|
519
519
|
dateAdapter: i((e, t) => {
|
|
520
520
|
if (!r) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
521
|
-
return
|
|
521
|
+
return K({
|
|
522
522
|
date: e,
|
|
523
523
|
format: t,
|
|
524
524
|
library: r
|
|
525
525
|
});
|
|
526
526
|
}, [r]),
|
|
527
|
-
distanceAdapter:
|
|
527
|
+
distanceAdapter: q,
|
|
528
528
|
filePathAdapter: o,
|
|
529
|
-
worksiteNameAdapter:
|
|
529
|
+
worksiteNameAdapter: J
|
|
530
530
|
};
|
|
531
|
-
},
|
|
531
|
+
}, Ee = () => {
|
|
532
532
|
let { libraries: e } = a(y), t = e?.amplitude?.analytics, n = i((e, n) => {
|
|
533
533
|
if (!t || (t.setUserId(e), !n)) return;
|
|
534
534
|
let r = new t.Identify();
|
|
@@ -552,7 +552,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
552
552
|
setGroup: r,
|
|
553
553
|
track: o
|
|
554
554
|
};
|
|
555
|
-
},
|
|
555
|
+
}, De = (e) => {
|
|
556
556
|
let { libraries: t, localStorageKeys: n } = a(y), r = e?.axios || t?.axios, s = e?.localStorageKey || n?.user || "user";
|
|
557
557
|
if (!r) throw Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
|
|
558
558
|
let c = i(({ tokenType: e, accessToken: t }) => {
|
|
@@ -561,7 +561,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
561
561
|
r.defaults.headers.common.Authorization = null;
|
|
562
562
|
}, [r.defaults.headers.common]);
|
|
563
563
|
return o(() => {
|
|
564
|
-
if (
|
|
564
|
+
if (P) return;
|
|
565
565
|
let e = ({ newValue: e, key: t }) => {
|
|
566
566
|
if (t === s) try {
|
|
567
567
|
let { accessToken: t, tokenType: n } = JSON.parse(e ?? "null") ?? {};
|
|
@@ -588,9 +588,9 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
588
588
|
clearAuthenticationToken: l,
|
|
589
589
|
setAuthenticationToken: c
|
|
590
590
|
};
|
|
591
|
-
},
|
|
591
|
+
}, Oe = "New message", ke = (e, t) => {
|
|
592
592
|
if (!("Notification" in window) || typeof Notification != "function" || Notification.permission !== "granted" || !document.hidden) return;
|
|
593
|
-
let n = new Notification(t.title ??
|
|
593
|
+
let n = new Notification(t.title ?? Oe, {
|
|
594
594
|
badge: t?.badge,
|
|
595
595
|
body: t?.body || e.bodyPreview,
|
|
596
596
|
data: t?.data,
|
|
@@ -605,8 +605,8 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
605
605
|
let { onClick: r } = t;
|
|
606
606
|
n.onclick = () => r(e);
|
|
607
607
|
}
|
|
608
|
-
},
|
|
609
|
-
let t = a(
|
|
608
|
+
}, Ae = (e) => {
|
|
609
|
+
let t = a(W);
|
|
610
610
|
if (!t) throw Error("useChat must be used within ChatProvider");
|
|
611
611
|
let { subscribe: n, setEnabled: r, ...i } = t, s = l(e);
|
|
612
612
|
return s.current = e, o(() => {
|
|
@@ -623,7 +623,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
623
623
|
r?.(e);
|
|
624
624
|
break;
|
|
625
625
|
case "new_message_notification":
|
|
626
|
-
i?.(e), t && t.enabled !== !1 &&
|
|
626
|
+
i?.(e), t && t.enabled !== !1 && ke(e, t);
|
|
627
627
|
break;
|
|
628
628
|
case "presence":
|
|
629
629
|
a?.(e);
|
|
@@ -648,44 +648,44 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
648
648
|
break;
|
|
649
649
|
}
|
|
650
650
|
}), [n]), i;
|
|
651
|
-
},
|
|
652
|
-
let
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
651
|
+
}, Y = (e, t = "full") => {
|
|
652
|
+
let n = e || navigator.language;
|
|
653
|
+
return t === "short" ? n.split("-")[0] : n;
|
|
654
|
+
}, je = (e, t = "full") => {
|
|
655
|
+
let [n, r] = u(() => Y(e?.language, t));
|
|
656
656
|
return o(() => {
|
|
657
|
-
e && "isInitialized" in e && e.isInitialized && e.language && r(
|
|
657
|
+
e && "isInitialized" in e && e.isInitialized && e.language && r(Y(e.language, t));
|
|
658
658
|
let n = (e) => {
|
|
659
|
-
r(
|
|
659
|
+
r(Y(e, t));
|
|
660
660
|
};
|
|
661
661
|
return e?.on?.("languageChanged", n), () => {
|
|
662
662
|
e?.off?.("languageChanged", n);
|
|
663
663
|
};
|
|
664
664
|
}, [e, t]), n;
|
|
665
|
-
},
|
|
665
|
+
}, Me = "tracktor.filter", Ne = {
|
|
666
666
|
getFilter: () => void 0,
|
|
667
667
|
getFilters: () => ({}),
|
|
668
668
|
handleFilter: () => () => {},
|
|
669
669
|
setFilter: () => {}
|
|
670
|
-
},
|
|
670
|
+
}, Pe = (e) => {
|
|
671
671
|
try {
|
|
672
672
|
return JSON.parse(e);
|
|
673
673
|
} catch {
|
|
674
674
|
return e;
|
|
675
675
|
}
|
|
676
|
-
},
|
|
676
|
+
}, Fe = (e, t, n) => `${n}_${e}=>${t}`, Ie = (e) => e.reduce((e, t) => {
|
|
677
677
|
let n = localStorage.getItem(t);
|
|
678
678
|
if (n) try {
|
|
679
679
|
let t = JSON.parse(n), r = Object.keys(t)?.[0];
|
|
680
680
|
r && (e[r] = Object.values(t)?.[0]);
|
|
681
681
|
} catch {}
|
|
682
682
|
return e;
|
|
683
|
-
}, {}),
|
|
684
|
-
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 ||
|
|
685
|
-
if (
|
|
683
|
+
}, {}), Le = (e) => {
|
|
684
|
+
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 || Me, f = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, p = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
|
|
685
|
+
if (P) return Ne;
|
|
686
686
|
if (!r) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of reactRouter.");
|
|
687
687
|
let m = () => Object.keys(localStorage).filter((t) => t.startsWith(d) && t.endsWith(e?.pathname || i)), h = (t, n, r = !0) => {
|
|
688
|
-
let a =
|
|
688
|
+
let a = Fe(t, e?.pathname || i, d);
|
|
689
689
|
if (!n || Array.isArray(n) && !n.length) {
|
|
690
690
|
f ? (o.delete(t), s(o)) : l((e) => {
|
|
691
691
|
let n = { ...e };
|
|
@@ -705,13 +705,13 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
705
705
|
getFilter: (t, n) => {
|
|
706
706
|
if (f) {
|
|
707
707
|
let e = o.get(t);
|
|
708
|
-
if (e) return
|
|
708
|
+
if (e) return Pe(e);
|
|
709
709
|
} else {
|
|
710
710
|
let e = c[t];
|
|
711
711
|
if (e !== void 0) return e;
|
|
712
712
|
}
|
|
713
713
|
if (p) {
|
|
714
|
-
let n =
|
|
714
|
+
let n = Fe(t, e?.pathname || i, d), r = localStorage.getItem(n);
|
|
715
715
|
if (r) try {
|
|
716
716
|
let e = JSON.parse(r)[t];
|
|
717
717
|
return !f && e !== void 0 && l((n) => ({
|
|
@@ -723,9 +723,9 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
723
723
|
return n;
|
|
724
724
|
},
|
|
725
725
|
getFilters: () => {
|
|
726
|
-
let e = p ?
|
|
726
|
+
let e = p ? Ie(m()) : {};
|
|
727
727
|
if (f) {
|
|
728
|
-
let t = Array.from(o.entries()).reduce((e, [t, n]) => (e[t] =
|
|
728
|
+
let t = Array.from(o.entries()).reduce((e, [t, n]) => (e[t] = Pe(n), e), {});
|
|
729
729
|
return {
|
|
730
730
|
...e,
|
|
731
731
|
...t
|
|
@@ -746,7 +746,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
746
746
|
},
|
|
747
747
|
setFilter: h
|
|
748
748
|
};
|
|
749
|
-
},
|
|
749
|
+
}, Re = () => document.getElementById(F), ze = () => {
|
|
750
750
|
let [e, t] = u(() => !!window.HubSpotConversations);
|
|
751
751
|
return o(() => {
|
|
752
752
|
if (window.HubSpotConversations) {
|
|
@@ -756,16 +756,16 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
756
756
|
window.hsConversationsOnReady = [() => t(!0)];
|
|
757
757
|
}, []), o(() => {
|
|
758
758
|
e && window.HubSpotConversations?.on("widgetClosed", () => {
|
|
759
|
-
|
|
759
|
+
Re()?.classList.remove(I);
|
|
760
760
|
});
|
|
761
761
|
}, [e]), {
|
|
762
762
|
isAvailable: e,
|
|
763
763
|
toggle: i(() => {
|
|
764
|
-
let e = window.HubSpotConversations, t =
|
|
765
|
-
e && t && (t.classList.contains("hs-show") ? (e.widget.close(), t.classList.remove(
|
|
764
|
+
let e = window.HubSpotConversations, t = Re();
|
|
765
|
+
e && t && (t.classList.contains("hs-show") ? (e.widget.close(), t.classList.remove(I)) : (t.classList.add(I), e.widget.open()));
|
|
766
766
|
}, [])
|
|
767
767
|
};
|
|
768
|
-
},
|
|
768
|
+
}, Be = ({ data: e, fetchNextPage: t, isFetchingNextPage: n, isInitialLoading: r, isLoading: a, enabled: o = !0 }) => {
|
|
769
769
|
let s = i(async (e) => {
|
|
770
770
|
n || !o || await t({ pageParam: e?.pageParam || e.visibleRowsCount });
|
|
771
771
|
}, [
|
|
@@ -781,7 +781,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
781
781
|
loadingVariant: r ? "skeleton" : "linear-progress",
|
|
782
782
|
rows: l
|
|
783
783
|
};
|
|
784
|
-
},
|
|
784
|
+
}, Ve = (e) => {
|
|
785
785
|
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) => {
|
|
786
786
|
if (e && typeof e == "object" && "response" in e) {
|
|
787
787
|
let { response: t } = e || {};
|
|
@@ -805,38 +805,38 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
805
805
|
}, []),
|
|
806
806
|
printError: l
|
|
807
807
|
};
|
|
808
|
-
},
|
|
809
|
-
if (!
|
|
808
|
+
}, He = "chunk-reload-timestamp", X = "chunk-reload", Ue = 1e4, Z = 2, Q = !1;
|
|
809
|
+
if (!P && typeof window < "u") {
|
|
810
810
|
try {
|
|
811
811
|
let e = new URL(window.location.href);
|
|
812
|
-
e.searchParams.has(
|
|
812
|
+
e.searchParams.has(X) && (Q = !0, e.searchParams.delete(X), window.history.replaceState(null, "", e.toString()));
|
|
813
813
|
} catch {}
|
|
814
814
|
window.addEventListener("vite:preloadError", (e) => {
|
|
815
815
|
e.preventDefault();
|
|
816
816
|
});
|
|
817
817
|
}
|
|
818
|
-
var
|
|
818
|
+
var We = (e) => {
|
|
819
819
|
if (!(e instanceof Error)) return !1;
|
|
820
820
|
let t = e.message.toLowerCase();
|
|
821
821
|
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";
|
|
822
|
-
},
|
|
822
|
+
}, Ge = /import\s*\(\s*(['"])((\w+:(\/?\/?))?[^\s,]+)\1/, Ke = (e) => e.toString().match(Ge)?.[2] ?? null, qe = (e) => {
|
|
823
823
|
try {
|
|
824
824
|
return sessionStorage.getItem(e);
|
|
825
825
|
} catch {
|
|
826
826
|
return null;
|
|
827
827
|
}
|
|
828
|
-
},
|
|
828
|
+
}, Je = (e, t) => {
|
|
829
829
|
try {
|
|
830
830
|
sessionStorage.setItem(e, t);
|
|
831
831
|
} catch {}
|
|
832
|
-
},
|
|
833
|
-
for (let t = 0; t <
|
|
834
|
-
return await
|
|
832
|
+
}, Ye = (e) => Function("url", "return import(url)")(e), Xe = async (e) => {
|
|
833
|
+
for (let t = 0; t < Z; t++) try {
|
|
834
|
+
return await Ye(`${e}?t=${Date.now()}`);
|
|
835
835
|
} catch {
|
|
836
|
-
t <
|
|
836
|
+
t < Z - 1 && await new Promise((e) => setTimeout(e, 500 * 2 ** t));
|
|
837
837
|
}
|
|
838
|
-
throw Error(`Failed to import ${e} after ${
|
|
839
|
-
},
|
|
838
|
+
throw Error(`Failed to import ${e} after ${Z} retries`);
|
|
839
|
+
}, Ze = async () => {
|
|
840
840
|
try {
|
|
841
841
|
if (typeof navigator < "u" && "serviceWorker" in navigator) {
|
|
842
842
|
let e = await navigator.serviceWorker.getRegistrations();
|
|
@@ -847,27 +847,71 @@ var Ue = (e) => {
|
|
|
847
847
|
await Promise.all(e.map((e) => caches.delete(e)));
|
|
848
848
|
}
|
|
849
849
|
} catch {}
|
|
850
|
-
},
|
|
851
|
-
await
|
|
850
|
+
}, Qe = async () => {
|
|
851
|
+
await Ze();
|
|
852
852
|
let e = new URL(window.location.href);
|
|
853
|
-
e.searchParams.set(
|
|
854
|
-
},
|
|
853
|
+
e.searchParams.set(X, String(Date.now())), window.location.replace(e.toString());
|
|
854
|
+
}, $e = (e) => e != null && e.default !== void 0, et = (e) => r(async () => {
|
|
855
855
|
let t;
|
|
856
856
|
try {
|
|
857
857
|
let n = await e();
|
|
858
|
-
if (
|
|
858
|
+
if ($e(n)) return n;
|
|
859
859
|
t = /* @__PURE__ */ Error("Module resolved without a valid default export");
|
|
860
860
|
} catch (e) {
|
|
861
861
|
t = e;
|
|
862
862
|
}
|
|
863
|
-
if (
|
|
864
|
-
let n =
|
|
863
|
+
if (P || !We(t)) throw t;
|
|
864
|
+
let n = Ke(e);
|
|
865
865
|
if (n) try {
|
|
866
|
-
let e = await
|
|
867
|
-
if (
|
|
866
|
+
let e = await Xe(n);
|
|
867
|
+
if ($e(e)) return e;
|
|
868
868
|
} catch {}
|
|
869
|
-
let r = Number(
|
|
870
|
-
return Date.now() - r <
|
|
871
|
-
})
|
|
869
|
+
let r = Number(qe(He) || "0");
|
|
870
|
+
return Date.now() - r < Ue || Q || (Je(He, String(Date.now())), await Qe()), { default: () => null };
|
|
871
|
+
}), tt = "Page Left", nt = 1800 * 1e3, rt = 1e3, it = (e, t = !0) => {
|
|
872
|
+
let n = 0, r = t ? e : null, i = !1, a = (e) => {
|
|
873
|
+
r !== null && (n += Math.max(0, e - r), r = null);
|
|
874
|
+
};
|
|
875
|
+
return {
|
|
876
|
+
pause: (e) => {
|
|
877
|
+
i || a(e);
|
|
878
|
+
},
|
|
879
|
+
resume: (e) => {
|
|
880
|
+
!i && r === null && (r = e);
|
|
881
|
+
},
|
|
882
|
+
stop: (e) => (i ||= (a(e), !0), Math.min(nt, Math.round(n)))
|
|
883
|
+
};
|
|
884
|
+
}, at = (e, t) => t < 1e3 ? null : {
|
|
885
|
+
duration_ms: Math.round(t),
|
|
886
|
+
page_path: e
|
|
887
|
+
}, ot = (e) => {
|
|
888
|
+
if (typeof e != "object" || !e) return !1;
|
|
889
|
+
let { exp: t, sub: n, entity_id: r, scope: i } = e;
|
|
890
|
+
return typeof t == "number" && typeof n == "string" && typeof r == "number" && Array.isArray(i) && i.every((e) => typeof e == "string");
|
|
891
|
+
}, st = (e) => {
|
|
892
|
+
let t = e.replace(/-/g, "+").replace(/_/g, "/"), n = t + "=".repeat((4 - t.length % 4) % 4);
|
|
893
|
+
return decodeURIComponent(Array.from(atob(n), (e) => `%${e.charCodeAt(0).toString(16).padStart(2, "0")}`).join(""));
|
|
894
|
+
}, ct = (e) => {
|
|
895
|
+
let t = e?.split(".")[1];
|
|
896
|
+
if (!t) return null;
|
|
897
|
+
try {
|
|
898
|
+
let e = JSON.parse(st(t));
|
|
899
|
+
return ot(e) ? e : null;
|
|
900
|
+
} catch {
|
|
901
|
+
return null;
|
|
902
|
+
}
|
|
903
|
+
}, $ = (e) => btoa(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""), lt = async (e, t) => {
|
|
904
|
+
let n = new TextEncoder(), r = await crypto.subtle.importKey("raw", n.encode(e), {
|
|
905
|
+
hash: "SHA-256",
|
|
906
|
+
name: "HMAC"
|
|
907
|
+
}, !1, ["sign"]), i = await crypto.subtle.sign("HMAC", r, n.encode(t));
|
|
908
|
+
return $(String.fromCharCode(...new Uint8Array(i)));
|
|
909
|
+
}, ut = async (e, t) => {
|
|
910
|
+
let n = `${$(JSON.stringify({
|
|
911
|
+
alg: "HS256",
|
|
912
|
+
typ: "JWT"
|
|
913
|
+
}))}.${$(JSON.stringify(e))}`;
|
|
914
|
+
return `${n}.${await lt(t, n)}`;
|
|
915
|
+
};
|
|
872
916
|
//#endregion
|
|
873
|
-
export {
|
|
917
|
+
export { k as AMPLITUDE_FEATURE_SELECTOR, D as AutoReloadOnNewVersion, _ as ChatClient, W as ChatContext, _e as ChatProvider, O as GTMSendPageView, N as InitializeAmplitude, re as InitializeAxiosConfig, oe as InitializeDaysJSConfig, se as InitializeHubSpot, ce as InitializeI18nConfig, le as InitializeSentryConfig, y as InjectDependenciesContext, b as InjectDependenciesProvider, v as MaskTextField, nt as PAGE_DURATION_CAP_MS, rt as PAGE_DURATION_MIN_MS, tt as PAGE_LEFT_EVENT, Se as QueryProvider, de as RequireAuth, B as SENTRY_IGNORED_REQUEST_URLS, R as SENTRY_KEEP_REPLAY, ie as SUPPORTED_LANGUAGE, fe as ShowHubSpotBubble, it as createVisibleStopwatch, K as dateAdapter, ct as decodeToken, q as distanceAdapter, ut as encodeToken, Y as getCurrentLanguage, e as getOrvalConfig, z as isReplayKeptForError, et as lazyWithRetry, V as matchesRequestUrl, at as pageLeftProperties, G as shouldRetryQuery, Te as useAdapter, Ee as useAmplitude, De as useAuth, Ae as useChat, je as useCurrentLanguage, Le as useFilters, ze as useHubSpot, Be as useInfiniteDataGrid, Ve as useResponseError, J as worksiteNameAdapter };
|