@getsoren/shared-module 2.44.0 → 2.46.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/main.js CHANGED
@@ -1,8 +1,9 @@
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, useMemo as s, useRef as c, useState as l } from "react";
3
- import { jsx as u } from "react/jsx-runtime";
1
+ import { r as e } from "./chunk-D8eiyYIV.js";
2
+ import { t } from "./orval-D6vce7Ml.js";
3
+ import { Suspense as n, createContext as r, lazy as i, useCallback as a, useContext as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
4
+ import { jsx as d } from "react/jsx-runtime";
4
5
  //#region src/chat/ChatClient.ts
5
- var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e.replace(/_([a-z])/g, (e, t) => t.toUpperCase()), m(t)])) : e, 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) => `_${e.toLowerCase()}`), h(t)])) : e, g = class {
6
+ 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 {
6
7
  url;
7
8
  getToken;
8
9
  onEvent;
@@ -20,7 +21,7 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
20
21
  _connected = !1;
21
22
  _ready = !1;
22
23
  constructor(e) {
23
- 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 ?? f, this.maxMessageBodyLength = e.maxMessageBodyLength ?? p;
24
+ 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;
24
25
  }
25
26
  get connected() {
26
27
  return this._connected;
@@ -37,7 +38,7 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
37
38
  this._connected = !0, this.reconnectAttempt = 0, this.onConnectionChange?.(!0), this.rejoinThreads(), this.flushPendingMessages();
38
39
  }, this.ws.onmessage = (e) => {
39
40
  try {
40
- let t = m(JSON.parse(e.data));
41
+ let t = h(JSON.parse(e.data));
41
42
  t.type === "ready" && (this._ready = !0), this.onEvent?.(t);
42
43
  } catch {}
43
44
  }, this.ws.onclose = () => {
@@ -85,7 +86,7 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
85
86
  this.pendingMessages.push(e);
86
87
  return;
87
88
  }
88
- this.ws.send(JSON.stringify(h(e)));
89
+ this.ws.send(JSON.stringify(g(e)));
89
90
  }
90
91
  flushPendingMessages() {
91
92
  let e = [...this.pendingMessages];
@@ -100,7 +101,7 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
100
101
  }
101
102
  scheduleReconnect() {
102
103
  this.clearReconnectTimer();
103
- let e = Math.min(this.reconnectBaseDelay * 2 ** this.reconnectAttempt, d);
104
+ let e = Math.min(this.reconnectBaseDelay * 2 ** this.reconnectAttempt, f);
104
105
  this.reconnectAttempt++, this.reconnectTimer = setTimeout(() => {
105
106
  this.connect();
106
107
  }, e);
@@ -108,8 +109,8 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
108
109
  clearReconnectTimer() {
109
110
  this.reconnectTimer !== null && (clearTimeout(this.reconnectTimer), this.reconnectTimer = null);
110
111
  }
111
- }, _ = ({ IMaskMixin: e, ...t }) => /* @__PURE__ */ u(s(() => e(({ TextField: e, ...t }) => /* @__PURE__ */ u(e, { ...t })), [e]), { ...t }), v = n({}), y = ({ children: e, apiURL: t, libraries: n, localStorageKeys: r }) => {
112
- let i = s(() => ({
112
+ }, v = ({ IMaskMixin: e, ...t }) => /* @__PURE__ */ d(c(() => e(({ TextField: e, ...t }) => /* @__PURE__ */ d(e, { ...t })), [e]), { ...t }), y = r({}), b = ({ children: e, apiURL: t, libraries: n, localStorageKeys: r }) => {
113
+ let i = c(() => ({
113
114
  apiURL: t,
114
115
  libraries: n,
115
116
  localStorageKeys: r
@@ -118,32 +119,70 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
118
119
  n,
119
120
  r
120
121
  ]);
121
- return /* @__PURE__ */ u(v.Provider, {
122
+ return /* @__PURE__ */ d(y.Provider, {
122
123
  value: i,
123
124
  children: e
124
125
  });
125
- }, b = ({ data: e, ...t }) => {
126
- let { libraries: n } = a(v), r = t?.reactRouter || n?.reactRouter, i = t?.gtm || n?.gtm;
126
+ }, x = 900 * 1e3, S = 60 * 1e3, C = 600 * 1e3, w = "auto-reload-on-new-version-timestamp", T = /<meta[^>]*name="version"[^>]*content="([^"]*)"/, E = (e) => {
127
+ try {
128
+ return sessionStorage.getItem(e);
129
+ } catch {
130
+ return null;
131
+ }
132
+ }, D = (e, t) => {
133
+ try {
134
+ sessionStorage.setItem(e, t);
135
+ } catch {}
136
+ }, O = ({ version: e, checkInterval: t = x, children: n, ...r }) => {
137
+ let { libraries: i } = o(y), a = r?.reactRouter || i?.reactRouter, c = l(!1), u = l(0);
138
+ if (!a) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of AutoReloadOnNewVersion.");
139
+ let { useLocation: f, Outlet: p } = a, { pathname: m } = f(), h = l(m);
140
+ return s(() => {
141
+ if (!e || typeof window > "u") return;
142
+ let n = async () => {
143
+ if (!(c.current || Date.now() - u.current < S)) {
144
+ u.current = Date.now();
145
+ try {
146
+ let t = await fetch("/index.html", { cache: "no-store" });
147
+ if (!t.ok) return;
148
+ let n = (await t.text()).match(T)?.[1];
149
+ n && n !== "%VERSION%" && n !== e && (c.current = !0);
150
+ } catch {}
151
+ }
152
+ }, r = () => {
153
+ document.visibilityState === "visible" && n();
154
+ }, i = setInterval(n, t);
155
+ return document.addEventListener("visibilitychange", r), () => {
156
+ clearInterval(i), document.removeEventListener("visibilitychange", r);
157
+ };
158
+ }, [e, t]), s(() => {
159
+ if (m === h.current || (h.current = m, !c.current)) return;
160
+ c.current = !1;
161
+ let e = Number(E(w) || "0");
162
+ Date.now() - e < C || (D(w, String(Date.now())), window.location.reload());
163
+ }, [m]), n ?? /* @__PURE__ */ d(p, {});
164
+ }, k = ({ data: e, ...t }) => {
165
+ let { libraries: n } = o(y), r = t?.reactRouter || n?.reactRouter, i = t?.gtm || n?.gtm;
127
166
  if (!r) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
128
167
  if (!i) throw Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
129
- let { useGoogleTagManager: s } = i, { useLocation: c, Outlet: l } = r, { pathname: d } = c(), { sendEvent: f } = s();
130
- return o(() => {
168
+ let { useGoogleTagManager: a } = i, { useLocation: c, Outlet: l } = r, { pathname: u } = c(), { sendEvent: f } = a();
169
+ return s(() => {
131
170
  f({
132
171
  event: "pageView",
133
- pathname: d,
172
+ pathname: u,
134
173
  ...e
135
174
  });
136
175
  }, [
137
176
  e,
138
- d,
177
+ u,
139
178
  f
140
- ]), /* @__PURE__ */ u(l, {});
141
- }, x = ({ apiKey: e, platform: t = "desktop", sessionReplaySampleRate: n = .25, ...r }) => {
142
- let { libraries: i } = a(v), s = r.amplitude || i?.amplitude;
143
- return o(() => {
144
- let r = s?.analytics, i = s?.sessionReplayPlugin;
179
+ ]), /* @__PURE__ */ d(l, {});
180
+ }, A = ({ apiKey: e, platform: t = "desktop", sessionReplaySampleRate: n = .25, ...r }) => {
181
+ let { libraries: i } = o(y), a = r.amplitude || i?.amplitude;
182
+ return s(() => {
183
+ let r = a?.analytics, i = a?.sessionReplayPlugin;
145
184
  if (!(e && r)) return;
146
- let a = "platform-enrichment";
185
+ let o = "platform-enrichment";
147
186
  return r.init(e, { autocapture: { elementInteractions: !1 } }), i && r.add(i({ sampleRate: n })), r.add({
148
187
  execute: async (e) => ({
149
188
  ...e,
@@ -152,67 +191,75 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
152
191
  platform: t
153
192
  }
154
193
  }),
155
- name: a,
194
+ name: o,
156
195
  type: "enrichment"
157
196
  }), () => {
158
- i && r.remove("@amplitude/plugin-session-replay-browser"), r.remove(a);
197
+ i && r.remove("@amplitude/plugin-session-replay-browser"), r.remove(o);
159
198
  };
160
199
  }, [
161
200
  e,
162
- s,
201
+ a,
163
202
  t,
164
203
  n
165
204
  ]), null;
166
- }, S = (() => {
205
+ }, j = (() => {
167
206
  try {
168
207
  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;
169
208
  } catch {
170
209
  return !1;
171
210
  }
172
- })(), C = "user", w = ({ tokenTypeKey: e = "tokenType", tokenKey: t = "accessToken", postContentType: n = "application/json", ...r }) => {
173
- let { apiURL: i = r.apiURL, libraries: o, localStorageKeys: s } = a(v), c = r?.userLocalStorageKey || s?.user || C, l = r?.axios || o?.axios;
211
+ })(), M = "user", N = ({ tokenTypeKey: e = "tokenType", tokenKey: t = "accessToken", postContentType: n = "application/json", ...r }) => {
212
+ let { apiURL: i = r.apiURL, libraries: a, localStorageKeys: s } = o(y), c = r?.userLocalStorageKey || s?.user || M, l = r?.axios || a?.axios;
174
213
  if (!l) throw Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
175
- if (!l?.defaults || S) return null;
214
+ if (!l?.defaults || j) return null;
176
215
  if (typeof window < "u" && window.localStorage) {
177
216
  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;
178
217
  o && (l.defaults.headers.common.Authorization = o);
179
218
  }
180
219
  return l.defaults.baseURL = i, l.defaults.headers.post["Content-Type"] = n, null;
181
- }, T = ({ language: e, ...t }) => {
182
- let { libraries: n } = a(v), r = t?.dayjs || n?.dayjs, i = t?.plugin || n?.dayjsPlugin;
183
- if (!r) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");
184
- return o(() => {
220
+ }, P = [
221
+ "ar",
222
+ "de",
223
+ "en",
224
+ "es",
225
+ "fr",
226
+ "it",
227
+ "pt"
228
+ ], F = (e) => P.includes(e), I = ({ language: t, ...n }) => {
229
+ let { libraries: r } = o(y), i = n?.dayjs || r?.dayjs, a = n?.plugin || r?.dayjsPlugin;
230
+ if (!i) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");
231
+ return s(() => {
185
232
  (async () => {
186
- let n = e || navigator.language?.slice(0, 2) || "en";
187
- r.extend(t.localizedFormat), i && i.forEach((e) => {
188
- e && r.extend(e);
189
- }), await import("dayjs/locale/en"), await import("dayjs/locale/fr"), r.locale(n);
233
+ let r = t || navigator.language?.slice(0, 2) || "en";
234
+ i.extend(n.localizedFormat), a && a.forEach((e) => {
235
+ e && i.extend(e);
236
+ }), await import("./ar-DxWKHrrW.js").then((t) => /* @__PURE__ */ e(t.default, 1)), await import("./de-B9uAlw43.js").then((t) => /* @__PURE__ */ e(t.default, 1)), await import("dayjs/locale/en"), await import("./es-Czh059B4.js").then((t) => /* @__PURE__ */ e(t.default, 1)), await import("dayjs/locale/fr"), await import("./it-BMMOnRzo.js").then((t) => /* @__PURE__ */ e(t.default, 1)), await import("./pt-cqbtpCpu.js").then((t) => /* @__PURE__ */ e(t.default, 1)), i.locale(F(r) ? r : "en");
190
237
  })().then();
191
238
  }, [
192
- r,
193
239
  i,
194
- e,
195
- t.localizedFormat
240
+ a,
241
+ t,
242
+ n.localizedFormat
196
243
  ]), null;
197
- }, E = "hubspot-messages-iframe-container", D = "hs-show", O = "data-hs-hidden", k = ({ hubId: e }) => (o(() => {
244
+ }, L = "hubspot-messages-iframe-container", R = "hs-show", z = "data-hs-hidden", ee = ({ hubId: e }) => (s(() => {
198
245
  if (!e) return;
199
246
  let t = document.createElement("script");
200
247
  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), () => {
201
248
  t.remove();
202
249
  };
203
- }, [e]), o(() => {
250
+ }, [e]), s(() => {
204
251
  let e = document.createElement("style");
205
252
  return e.textContent = `
206
- html[${O}] div#${E} { display: none !important; }
207
- html[${O}] div#${E}.${D} { display: initial !important; }
208
- `, document.head.appendChild(e), document.documentElement.setAttribute(O, ""), () => {
209
- e.remove(), document.documentElement.removeAttribute(O);
253
+ html[${z}] div#${L} { display: none !important; }
254
+ html[${z}] div#${L}.${R} { display: initial !important; }
255
+ `, document.head.appendChild(e), document.documentElement.setAttribute(z, ""), () => {
256
+ e.remove(), document.documentElement.removeAttribute(z);
210
257
  };
211
- }, []), null), A = ({ debug: e, resources: t, ...n }) => {
212
- let { libraries: r } = a(v), i = n?.i18 || r?.i18, { i18next: o, initReactI18next: s, languageDetector: c } = i || {};
213
- if (S) return null;
214
- if (!(i && o && c && s)) throw Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
215
- return o.isInitialized ? null : (o.use(c).use(s).init({
258
+ }, []), null), te = ({ debug: e, resources: t, ...n }) => {
259
+ let { libraries: r } = o(y), i = n?.i18 || r?.i18, { i18next: a, initReactI18next: s, languageDetector: c } = i || {};
260
+ if (j) return null;
261
+ if (!(i && a && c && s)) throw Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
262
+ return a.isInitialized ? null : (a.use(c).use(s).init({
216
263
  debug: e,
217
264
  fallbackLng: "en",
218
265
  interpolation: { escapeValue: !1 },
@@ -224,16 +271,16 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
224
271
  resources: t,
225
272
  returnNull: !1
226
273
  }).then(() => {
227
- document.documentElement.lang !== o.resolvedLanguage && o.resolvedLanguage && document.documentElement.setAttribute("lang", o.resolvedLanguage);
228
- }), o.on("languageChanged", (e) => {
274
+ document.documentElement.lang !== a.resolvedLanguage && a.resolvedLanguage && document.documentElement.setAttribute("lang", a.resolvedLanguage);
275
+ }), a.on("languageChanged", (e) => {
229
276
  document.documentElement.setAttribute("lang", e);
230
277
  }), null);
231
- }, j = ({ dsn: e, integrations: t, tracesSampleRate: n, replaysSessionSampleRate: r, replaysOnErrorSampleRate: i, tracePropagationTargets: s, ignoreErrors: c, debug: l, environment: u, release: d, ...f }) => {
232
- let { libraries: p } = a(v), m = f?.sentry || p?.sentry, h = f?.reactRouter || p?.reactRouter;
278
+ }, ne = ({ dsn: e, integrations: t, tracesSampleRate: n, replaysSessionSampleRate: r, replaysOnErrorSampleRate: i, tracePropagationTargets: a, ignoreErrors: c, debug: l, environment: u, release: d, ...f }) => {
279
+ let { libraries: p } = o(y), m = f?.sentry || p?.sentry, h = f?.reactRouter || p?.reactRouter;
233
280
  if (!m) throw Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
234
281
  if (!h) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
235
282
  if (m.isInitialized()) return null;
236
- let { createRoutesFromChildren: g, matchRoutes: _, useLocation: y, useNavigationType: b } = h;
283
+ let { createRoutesFromChildren: g, matchRoutes: _, useLocation: v, useNavigationType: b } = h;
237
284
  return (l || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && m.init({
238
285
  debug: l,
239
286
  dsn: e,
@@ -250,82 +297,82 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
250
297
  integrations: [m.reactRouterV6BrowserTracingIntegration({
251
298
  createRoutesFromChildren: g,
252
299
  matchRoutes: _,
253
- useEffect: o,
254
- useLocation: y,
300
+ useEffect: s,
301
+ useLocation: v,
255
302
  useNavigationType: b
256
303
  }), ...t || []],
257
304
  release: d,
258
305
  replaysOnErrorSampleRate: i || 1,
259
306
  replaysSessionSampleRate: r || .1,
260
- tracePropagationTargets: s,
307
+ tracePropagationTargets: a,
261
308
  tracesSampleRate: n || 1
262
309
  }), null;
263
- }, M = /* @__PURE__ */ new WeakMap(), N = "user", P = ({ Fallback: e, isLogged: n, loginPath: r = "/login", redirect401Path: i = "/login", ...s }) => {
264
- let { libraries: c, localStorageKeys: d } = a(v), f = s?.reactRouter || c?.reactRouter, p = s?.axios || c?.axios, m = s?.localStorageKey || d?.user || N;
310
+ }, B = /* @__PURE__ */ new WeakMap(), re = "user", ie = ({ Fallback: e, isLogged: t, loginPath: r = "/login", redirect401Path: i = "/login", ...a }) => {
311
+ let { libraries: c, localStorageKeys: l } = o(y), f = a?.reactRouter || c?.reactRouter, p = a?.axios || c?.axios, m = a?.localStorageKey || l?.user || re;
265
312
  if (!f) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
266
- let [h, g] = l(null), { useLocation: _, Navigate: y, Outlet: b } = f, x = _(), S = typeof n == "function" ? n() : !!n, C = typeof S == "boolean" ? S : S?.isLogged;
267
- return o(() => {
268
- p && (M.has(p) || (M.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)))));
313
+ let [h, g] = u(null), { useLocation: _, Navigate: v, Outlet: b } = f, x = _(), S = typeof t == "function" ? t() : !!t, C = typeof S == "boolean" ? S : S?.isLogged;
314
+ return s(() => {
315
+ p && (B.has(p) || (B.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)))));
269
316
  }, [
270
317
  p,
271
318
  m,
272
319
  i
273
- ]), C && !h ? /* @__PURE__ */ u(t, {
320
+ ]), C && !h ? /* @__PURE__ */ d(n, {
274
321
  fallback: e,
275
- children: x.state?.from?.state && x.state?.from?.pathname === r ? /* @__PURE__ */ u(y, {
322
+ children: x.state?.from?.state && x.state?.from?.pathname === r ? /* @__PURE__ */ d(v, {
276
323
  to: x.state.from.state.from.pathname + x.state.from.state.from.search,
277
324
  replace: !0
278
- }) : /* @__PURE__ */ u(b, {})
279
- }) : /* @__PURE__ */ u(y, {
325
+ }) : /* @__PURE__ */ d(b, {})
326
+ }) : /* @__PURE__ */ d(v, {
280
327
  to: r + x.search,
281
328
  state: { from: x },
282
329
  replace: !0
283
330
  });
284
- }, F = /* @__PURE__ */ new Set(), I = () => (o(() => {
331
+ }, V = /* @__PURE__ */ new Set(), ae = () => (s(() => {
285
332
  let e = Symbol();
286
- return F.add(e), document.documentElement.removeAttribute(O), () => {
287
- F.delete(e), F.size === 0 && document.documentElement.setAttribute(O, "");
333
+ return V.add(e), document.documentElement.removeAttribute(z), () => {
334
+ V.delete(e), V.size === 0 && document.documentElement.setAttribute(z, "");
288
335
  };
289
- }, []), null), ee = "user", te = {
336
+ }, []), null), oe = "user", se = {
290
337
  client: "/v2/threads/ws",
291
338
  supplier: "/v1/threads/ws"
292
- }, ne = (e, t) => `${e.startsWith("https") ? "wss" : "ws"}://${e.replace(/^https?:\/\//, "")}${t}`, re = (e) => {
339
+ }, ce = (e, t) => `${e.startsWith("https") ? "wss" : "ws"}://${e.replace(/^https?:\/\//, "")}${t}`, le = (e) => {
293
340
  try {
294
341
  let t = localStorage.getItem(e);
295
342
  return t ? JSON.parse(t)?.accessToken ?? null : null;
296
343
  } catch {
297
344
  return null;
298
345
  }
299
- }, L = n(null), R = ({ children: e, token: t, url: n, wsPath: r, maxReconnectAttempts: s, reconnectBaseDelay: d, maxMessageBodyLength: f = 1e4, reconnect: p = !0, enabled: m = !0, context: h = "client" }) => {
300
- let [_, y] = l(!1), [b, x] = l(!1), [S, C] = l(0), [w, T] = l(m), E = m && w, { apiURL: D, localStorageKeys: O } = a(v), k = O?.user || ee, A = c(null), j = c(/* @__PURE__ */ new Set());
301
- o(() => {
346
+ }, H = r(null), ue = ({ children: e, token: t, url: n, wsPath: r, maxReconnectAttempts: i, reconnectBaseDelay: c, maxMessageBodyLength: f = 1e4, reconnect: p = !0, enabled: m = !0, context: h = "client" }) => {
347
+ let [g, v] = u(!1), [b, x] = u(!1), [S, C] = u(0), [w, T] = u(m), E = m && w, { apiURL: D, localStorageKeys: O } = o(y), k = O?.user || oe, A = l(null), j = l(/* @__PURE__ */ new Set());
348
+ s(() => {
302
349
  if (!E) return;
303
- let e = r ?? te[h], i = n || (D ? ne(D, e) : null);
304
- if (!i) return;
305
- let a = () => t ?? re(k), o = (e) => {
350
+ let e = r ?? se[h], a = n || (D ? ce(D, e) : null);
351
+ if (!a) return;
352
+ let o = () => t ?? le(k), s = (e) => {
306
353
  switch (e.type) {
307
354
  case "ready":
308
355
  x(!0), C(e.unreadCount ?? 0);
309
356
  break;
310
357
  }
311
358
  for (let t of j.current) t(e);
312
- }, c = setTimeout(() => {
313
- let e = new g({
314
- getToken: a,
359
+ }, l = setTimeout(() => {
360
+ let e = new _({
361
+ getToken: o,
315
362
  maxMessageBodyLength: f,
316
- maxReconnectAttempts: s,
363
+ maxReconnectAttempts: i,
317
364
  onConnectionChange: (e) => {
318
- y(e), e || x(!1);
365
+ v(e), e || x(!1);
319
366
  },
320
- onEvent: o,
367
+ onEvent: s,
321
368
  reconnect: p,
322
- reconnectBaseDelay: d,
323
- url: i
369
+ reconnectBaseDelay: c,
370
+ url: a
324
371
  });
325
372
  A.current = e, e.connect();
326
373
  }, 0);
327
374
  return () => {
328
- clearTimeout(c), A.current?.disconnect(), A.current = null;
375
+ clearTimeout(l), A.current?.disconnect(), A.current = null;
329
376
  };
330
377
  }, [
331
378
  E,
@@ -337,56 +384,56 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
337
384
  D,
338
385
  k,
339
386
  f,
340
- s,
341
- d
387
+ i,
388
+ c
342
389
  ]);
343
- let M = i((e) => {
390
+ let M = a((e) => {
344
391
  A.current?.joinThread(e);
345
- }, []), N = i((e) => {
392
+ }, []), N = a((e) => {
346
393
  A.current?.leaveThread(e);
347
- }, []), P = i((e, t) => {
394
+ }, []), P = a((e, t) => {
348
395
  A.current?.sendMessage(e, t);
349
- }, []), F = i((e) => {
396
+ }, []), F = a((e) => {
350
397
  A.current?.markRead(e);
351
- }, []), I = i((e, t) => {
398
+ }, []), I = a((e, t) => {
352
399
  A.current?.listThreads(e, t);
353
- }, []), R = i((e = 1) => {
400
+ }, []), L = a((e = 1) => {
354
401
  C((t) => t + e);
355
- }, []), z = {
356
- decrementUnreadCount: i((e = 1) => {
402
+ }, []), R = {
403
+ decrementUnreadCount: a((e = 1) => {
357
404
  C((t) => Math.max(0, t - e));
358
405
  }, []),
359
- disconnect: i(() => {
406
+ disconnect: a(() => {
360
407
  A.current?.disconnect(), A.current = null;
361
408
  }, []),
362
- incrementUnreadCount: R,
363
- isConnected: _,
409
+ incrementUnreadCount: L,
410
+ isConnected: g,
364
411
  isReady: b,
365
412
  joinThread: M,
366
413
  leaveThread: N,
367
414
  listThreads: I,
368
415
  markRead: F,
369
416
  sendMessage: P,
370
- setEnabled: i((e) => {
417
+ setEnabled: a((e) => {
371
418
  T(e);
372
419
  }, []),
373
- subscribe: i((e) => (j.current.add(e), () => {
420
+ subscribe: a((e) => (j.current.add(e), () => {
374
421
  j.current.delete(e);
375
422
  }), []),
376
423
  unreadCount: S
377
424
  };
378
- return /* @__PURE__ */ u(L.Provider, {
379
- value: z,
425
+ return /* @__PURE__ */ d(H.Provider, {
426
+ value: R,
380
427
  children: e
381
428
  });
382
- }, z = (e) => e && typeof e == "function", ie = (e) => e && typeof e == "function", ae = ({ children: e, defaultQueriesOptions: t, defaultMutationsOptions: n, ...r }) => {
383
- let { libraries: i } = a(v), o = r?.QueryClient || i?.reactQuery?.QueryClient, s = r?.QueryClientProvider || i?.reactQuery?.QueryClientProvider;
384
- if (!o) throw Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
429
+ }, de = (e) => e && typeof e == "function", fe = (e) => e && typeof e == "function", pe = ({ children: e, defaultQueriesOptions: t, defaultMutationsOptions: n, ...r }) => {
430
+ let { libraries: i } = o(y), a = r?.QueryClient || i?.reactQuery?.QueryClient, s = r?.QueryClientProvider || i?.reactQuery?.QueryClientProvider;
431
+ if (!a) throw Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
385
432
  if (!s) throw Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
386
- if (!z(s)) throw Error("Provided QueryClientProvider dependencies are not valid.");
387
- if (!ie(o)) throw Error("Provided QueryClient dependencies are not valid.");
388
- let l = c(null);
389
- return l.current ||= new o({ defaultOptions: {
433
+ if (!de(s)) throw Error("Provided QueryClientProvider dependencies are not valid.");
434
+ if (!fe(a)) throw Error("Provided QueryClient dependencies are not valid.");
435
+ let c = l(null);
436
+ return c.current ||= new a({ defaultOptions: {
390
437
  mutations: { ...n },
391
438
  queries: {
392
439
  getNextPageParam: (e, t, n) => e.length + (n || 0),
@@ -394,73 +441,73 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
394
441
  retry: 3,
395
442
  ...t
396
443
  }
397
- } }), /* @__PURE__ */ u(s, {
398
- client: l.current,
444
+ } }), /* @__PURE__ */ d(s, {
445
+ client: c.current,
399
446
  children: e
400
447
  });
401
- }, B = ({ library: e, date: t, format: n = "ll" }) => e(t).format(n), V = (e, t) => {
448
+ }, U = ({ library: e, date: t, format: n = "ll" }) => e(t).format(n), W = (e, t) => {
402
449
  let { fractionDigits: n = 0, metric: r = "km", spacingBetween: i = !0 } = t || {}, a = Number(e), o = i ? " " : "";
403
450
  return Number.isNaN(a) ? `0${o}${r}` : `${a.toFixed(n)}${o}${r}`;
404
- }, H = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((e) => e.length > 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" "), oe = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, se = ({ path: e, size: t, apiURL: n }) => {
451
+ }, G = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((e) => e.length > 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" "), me = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, he = ({ path: e, size: t, apiURL: n }) => {
405
452
  if (!e) return "";
406
- let r = `${n}${oe(e)}`, i = r.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
453
+ let r = `${n}${me(e)}`, i = r.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
407
454
  return typeof t == "number" && i ? `${r.replace("/files", `/thumbs/${t}`)}` : r;
408
- }, ce = (e) => {
409
- let { apiURL: t, libraries: n } = a(v), r = e?.dayjs || n?.dayjs;
455
+ }, ge = (e) => {
456
+ let { apiURL: t, libraries: n } = o(y), r = e?.dayjs || n?.dayjs;
410
457
  return {
411
458
  dateAdapter: (e, t) => {
412
459
  if (!r) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
413
- return B({
460
+ return U({
414
461
  date: e,
415
462
  format: t,
416
463
  library: r
417
464
  });
418
465
  },
419
- distanceAdapter: V,
466
+ distanceAdapter: W,
420
467
  filePathAdapter: (e, n) => {
421
468
  if (!t) throw Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");
422
- return typeof e == "string" && /^https?:\/\//.test(e) ? e : se({
469
+ return typeof e == "string" && /^https?:\/\//.test(e) ? e : he({
423
470
  apiURL: t,
424
471
  path: e,
425
472
  size: n
426
473
  });
427
474
  },
428
- worksiteNameAdapter: H
475
+ worksiteNameAdapter: G
429
476
  };
430
- }, le = () => {
431
- let { libraries: e } = a(v), t = e?.amplitude?.analytics, n = i((e, n) => {
477
+ }, _e = () => {
478
+ let { libraries: e } = o(y), t = e?.amplitude?.analytics, n = a((e, n) => {
432
479
  if (!t || (t.setUserId(e), !n)) return;
433
480
  let r = new t.Identify();
434
481
  Object.entries(n).forEach(([e, t]) => {
435
482
  r.set(e, t);
436
483
  }), t.identify(r);
437
- }, [t]), r = i((e, n, r) => {
484
+ }, [t]), r = a((e, n, r) => {
438
485
  if (!t || (t.setGroup(e, n), !r)) return;
439
486
  let i = new t.Identify();
440
487
  Object.entries(r).forEach(([e, t]) => {
441
488
  i.set(e, t);
442
489
  }), t.groupIdentify(e, n, i);
443
- }, [t]), o = i((e, n) => {
490
+ }, [t]), i = a((e, n) => {
444
491
  t && t.track(e, n);
445
492
  }, [t]);
446
493
  return {
447
494
  identify: n,
448
- reset: i(() => {
495
+ reset: a(() => {
449
496
  t && t.reset();
450
497
  }, [t]),
451
498
  setGroup: r,
452
- track: o
499
+ track: i
453
500
  };
454
- }, U = (e) => {
455
- let { libraries: t, localStorageKeys: n } = a(v), r = e?.axios || t?.axios, s = e?.localStorageKey || n?.user || "user";
501
+ }, ve = (e) => {
502
+ let { libraries: t, localStorageKeys: n } = o(y), r = e?.axios || t?.axios, i = e?.localStorageKey || n?.user || "user";
456
503
  if (!r) throw Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
457
- let c = i(({ tokenType: e, accessToken: t }) => {
504
+ let c = a(({ tokenType: e, accessToken: t }) => {
458
505
  r.defaults.headers.common.Authorization = `${e} ${t}`;
459
506
  }, [r.defaults.headers.common]);
460
- return o(() => {
461
- if (S) return;
507
+ return s(() => {
508
+ if (j) return;
462
509
  let e = ({ newValue: e, key: t }) => {
463
- if (t === s && e) try {
510
+ if (t === i && e) try {
464
511
  let { accessToken: t, tokenType: n } = JSON.parse(e);
465
512
  c({
466
513
  accessToken: t,
@@ -473,15 +520,15 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
473
520
  return window.addEventListener("storage", e), () => {
474
521
  window.removeEventListener("storage", e);
475
522
  };
476
- }, [s, c]), {
523
+ }, [i, c]), {
477
524
  clearAuthenticationToken: () => {
478
525
  r.defaults.headers.common.Authorization = null;
479
526
  },
480
527
  setAuthenticationToken: c
481
528
  };
482
- }, ue = "New message", de = (e, t) => {
529
+ }, ye = "New message", be = (e, t) => {
483
530
  if (!("Notification" in window) || typeof Notification != "function" || Notification.permission !== "granted" || !document.hidden) return;
484
- let n = new Notification(t.title ?? ue, {
531
+ let n = new Notification(t.title ?? ye, {
485
532
  badge: t?.badge,
486
533
  body: t?.body || e.bodyPreview,
487
534
  data: t?.data,
@@ -496,16 +543,16 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
496
543
  let { onClick: r } = t;
497
544
  n.onclick = () => r(e);
498
545
  }
499
- }, fe = (e) => {
500
- let t = a(L);
546
+ }, xe = (e) => {
547
+ let t = o(H);
501
548
  if (!t) throw Error("useChat must be used within ChatProvider");
502
- let { subscribe: n, setEnabled: r, ...i } = t, s = c(e);
503
- return s.current = e, o(() => {
549
+ let { subscribe: n, setEnabled: r, ...i } = t, a = l(e);
550
+ return a.current = e, s(() => {
504
551
  e?.enabled !== void 0 && r(e.enabled);
505
- }, [e?.enabled, r]), o(() => {
552
+ }, [e?.enabled, r]), s(() => {
506
553
  e?.browserNotification && e.browserNotification.enabled !== !1 && "Notification" in window && Notification.permission === "default" && typeof Notification.requestPermission == "function" && Notification.requestPermission();
507
- }, [e?.browserNotification]), o(() => n((e) => {
508
- let { browserNotification: t, onReady: n, onNewMessage: r, onNewMessageNotification: i, onPresence: a, onError: o, onJoinedThread: c, onLeftThread: l, onMarkedRead: u, onThreadArchived: d, onThreadsList: f } = s.current ?? {};
554
+ }, [e?.browserNotification]), s(() => n((e) => {
555
+ let { browserNotification: t, onReady: n, onNewMessage: r, onNewMessageNotification: i, onPresence: o, onError: s, onJoinedThread: c, onLeftThread: l, onMarkedRead: u, onThreadArchived: d, onThreadsList: f } = a.current ?? {};
509
556
  switch (e.type) {
510
557
  case "ready":
511
558
  n?.(e);
@@ -514,13 +561,13 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
514
561
  r?.(e);
515
562
  break;
516
563
  case "new_message_notification":
517
- i?.(e), t && t.enabled !== !1 && de(e, t);
564
+ i?.(e), t && t.enabled !== !1 && be(e, t);
518
565
  break;
519
566
  case "presence":
520
- a?.(e);
567
+ o?.(e);
521
568
  break;
522
569
  case "error":
523
- o?.(e);
570
+ s?.(e);
524
571
  break;
525
572
  case "joined_thread":
526
573
  c?.(e);
@@ -539,55 +586,55 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
539
586
  break;
540
587
  }
541
588
  }), [n]), i;
542
- }, W = (e, t) => t === "short" ? e.split("-")[0] : e, pe = (e, t = "full") => {
543
- let [n, r] = l(() => {
589
+ }, K = (e, t) => t === "short" ? e.split("-")[0] : e, Se = (e, t = "full") => {
590
+ let [n, r] = u(() => {
544
591
  let n = e?.language || navigator.language;
545
- return e && "isInitialized" in e && e.isInitialized, W(n, t);
592
+ return e && "isInitialized" in e && e.isInitialized, K(n, t);
546
593
  });
547
- return o(() => {
548
- e && "isInitialized" in e && e.isInitialized && e.language && r(W(e.language, t));
594
+ return s(() => {
595
+ e && "isInitialized" in e && e.isInitialized && e.language && r(K(e.language, t));
549
596
  let n = (e) => {
550
- r(W(e, t));
597
+ r(K(e, t));
551
598
  };
552
599
  return e?.on?.("languageChanged", n), () => {
553
600
  e?.off?.("languageChanged", n);
554
601
  };
555
602
  }, [e, t]), n;
556
- }, me = "tracktor.filter", he = {
603
+ }, Ce = "tracktor.filter", we = {
557
604
  getFilter: () => void 0,
558
605
  getFilters: () => ({}),
559
606
  handleFilter: () => () => {},
560
607
  setFilter: () => {}
561
- }, G = (e) => {
608
+ }, q = (e) => {
562
609
  try {
563
610
  return JSON.parse(e);
564
611
  } catch {
565
612
  return e;
566
613
  }
567
- }, K = (e, t, n) => `${n}_${e}=>${t}`, ge = (e) => e.reduce((e, t) => {
614
+ }, J = (e, t, n) => `${n}_${e}=>${t}`, Te = (e) => e.reduce((e, t) => {
568
615
  let n = localStorage.getItem(t);
569
616
  if (n) try {
570
617
  let t = JSON.parse(n), r = Object.keys(t)?.[0];
571
618
  r && (e[r] = Object.values(t)?.[0]);
572
619
  } catch {}
573
620
  return e;
574
- }, {}), _e = (e) => {
575
- let { libraries: t, localStorageKeys: n } = a(v), r = e?.reactRouter || t?.reactRouter, { pathname: i } = r?.useLocation?.() ?? { pathname: "/" }, [o, s] = r?.useSearchParams?.() ?? [new URLSearchParams(), () => {}], [c, u] = l({}), d = n?.filter || me, f = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, p = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
576
- if (S) return he;
621
+ }, {}), Ee = (e) => {
622
+ let { libraries: t, localStorageKeys: n } = o(y), r = e?.reactRouter || t?.reactRouter, { pathname: i } = r?.useLocation?.() ?? { pathname: "/" }, [a, s] = r?.useSearchParams?.() ?? [new URLSearchParams(), () => {}], [c, l] = u({}), d = n?.filter || Ce, f = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, p = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
623
+ if (j) return we;
577
624
  if (!r) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of reactRouter.");
578
625
  let m = () => Object.keys(localStorage).filter((t) => t.startsWith(d) && t.endsWith(e?.pathname || i)), h = (t, n, r = !0) => {
579
- let a = K(t, e?.pathname || i, d);
626
+ let o = J(t, e?.pathname || i, d);
580
627
  if (!n || Array.isArray(n) && !n.length) {
581
- f ? (o.delete(t), s(o)) : u((e) => {
628
+ f ? (a.delete(t), s(a)) : l((e) => {
582
629
  let n = { ...e };
583
630
  return delete n[t], n;
584
- }), p && localStorage.removeItem(a);
631
+ }), p && localStorage.removeItem(o);
585
632
  return;
586
633
  }
587
- p && r && n && localStorage.setItem(a, JSON.stringify({
588
- ...o,
634
+ p && r && n && localStorage.setItem(o, JSON.stringify({
635
+ ...a,
589
636
  [t]: n
590
- })), f && n ? (o.set(t, JSON.stringify(n)), s(o)) : !f && n && u((e) => ({
637
+ })), f && n ? (a.set(t, JSON.stringify(n)), s(a)) : !f && n && l((e) => ({
591
638
  ...e,
592
639
  [t]: n
593
640
  }));
@@ -595,17 +642,17 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
595
642
  return {
596
643
  getFilter: (t, n) => {
597
644
  if (f) {
598
- let e = o.get(t);
599
- if (e) return G(e);
645
+ let e = a.get(t);
646
+ if (e) return q(e);
600
647
  } else {
601
648
  let e = c[t];
602
649
  if (e !== void 0) return e;
603
650
  }
604
651
  if (p) {
605
- let n = K(t, e?.pathname || i, d), r = localStorage.getItem(n);
652
+ let n = J(t, e?.pathname || i, d), r = localStorage.getItem(n);
606
653
  if (r) try {
607
654
  let e = JSON.parse(r)[t];
608
- return !f && e !== void 0 && u((n) => ({
655
+ return !f && e !== void 0 && l((n) => ({
609
656
  ...n,
610
657
  [t]: e
611
658
  })), e;
@@ -614,9 +661,9 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
614
661
  return n;
615
662
  },
616
663
  getFilters: () => {
617
- let e = p ? ge(m()) : {};
664
+ let e = p ? Te(m()) : {};
618
665
  if (f) {
619
- let t = Array.from(o.entries()).reduce((e, [t, n]) => (e[t] = G(n), e), {});
666
+ let t = Array.from(a.entries()).reduce((e, [t, n]) => (e[t] = q(n), e), {});
620
667
  return {
621
668
  ...e,
622
669
  ...t
@@ -637,43 +684,43 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
637
684
  },
638
685
  setFilter: h
639
686
  };
640
- }, q = () => document.getElementById(E), ve = () => {
641
- let [e, t] = l(() => !!window.HubSpotConversations);
642
- return o(() => {
687
+ }, Y = () => document.getElementById(L), De = () => {
688
+ let [e, t] = u(() => !!window.HubSpotConversations);
689
+ return s(() => {
643
690
  if (window.HubSpotConversations) {
644
691
  t(!0);
645
692
  return;
646
693
  }
647
694
  window.hsConversationsOnReady = [() => t(!0)];
648
- }, []), o(() => {
695
+ }, []), s(() => {
649
696
  e && window.HubSpotConversations?.on("widgetClosed", () => {
650
- q()?.classList.remove(D);
697
+ Y()?.classList.remove(R);
651
698
  });
652
699
  }, [e]), {
653
700
  isAvailable: e,
654
- toggle: i(() => {
655
- let e = window.HubSpotConversations, t = q();
656
- e && t && (t.classList.contains("hs-show") ? (e.widget.close(), t.classList.remove(D)) : (t.classList.add(D), e.widget.open()));
701
+ toggle: a(() => {
702
+ let e = window.HubSpotConversations, t = Y();
703
+ e && t && (t.classList.contains("hs-show") ? (e.widget.close(), t.classList.remove(R)) : (t.classList.add(R), e.widget.open()));
657
704
  }, [])
658
705
  };
659
- }, ye = ({ data: e, fetchNextPage: t, isFetchingNextPage: n, isInitialLoading: r, isLoading: a, enabled: o = !0 }) => {
660
- let c = i(async (e) => {
706
+ }, Oe = ({ data: e, fetchNextPage: t, isFetchingNextPage: n, isInitialLoading: r, isLoading: i, enabled: o = !0 }) => {
707
+ let s = a(async (e) => {
661
708
  n || !o || await t({ pageParam: e?.pageParam || e.visibleRowsCount });
662
709
  }, [
663
710
  o,
664
711
  t,
665
712
  n
666
- ]), l = s(() => {
713
+ ]), l = c(() => {
667
714
  if (e) return e.pages.reduce((e, t) => [...e, ...t], []);
668
715
  }, [e]);
669
716
  return {
670
- fetchNextPageOnRowsScrollEnd: c,
671
- isLoading: n || a,
717
+ fetchNextPageOnRowsScrollEnd: s,
718
+ isLoading: n || i,
672
719
  loadingVariant: r ? "skeleton" : "linear-progress",
673
720
  rows: l
674
721
  };
675
- }, be = (e) => {
676
- let { libraries: t } = a(v), 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) => {
722
+ }, ke = (e) => {
723
+ let { libraries: t } = o(y), n = e?.i18 || t?.i18, r = e?.i18?.translateFunction || t?.i18?.translateFunction, i = n?.i18next?.t || r || ((e) => e), { unknownErrorTranslationKey: s = "error.unknownError" } = e || {}, c = i(s), l = a((e) => {
677
724
  if (e && typeof e == "object" && "response" in e) {
678
725
  let { response: t } = e || {};
679
726
  if (t && typeof t == "object" && "reason" in t && t.reason) return String(t.reason);
@@ -690,44 +737,44 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
690
737
  return e instanceof Error ? e.message : c;
691
738
  }, [c]);
692
739
  return {
693
- getErrorCode: i((e) => {
740
+ getErrorCode: a((e) => {
694
741
  let { response: t } = e || {};
695
742
  return t?.error_code ? String(t?.error_code) : t?.data?.error_code ? String(t?.data?.error_code) : t?.error_code ? String(t?.error_code) : t?.data?.error_code ? String(t.data.error_code) : "unknown_error_code";
696
743
  }, []),
697
744
  printError: l
698
745
  };
699
- }, J = "chunk-reload-timestamp", Y = "chunk-reload", xe = 1e4, X = 2, Z = !1;
700
- if (!S && typeof window < "u") {
746
+ }, X = "chunk-reload-timestamp", Z = "chunk-reload", Ae = 1e4, Q = 2, $ = !1;
747
+ if (!j && typeof window < "u") {
701
748
  try {
702
749
  let e = new URL(window.location.href);
703
- e.searchParams.has(Y) && (Z = !0, e.searchParams.delete(Y), window.history.replaceState(null, "", e.toString()));
750
+ e.searchParams.has(Z) && ($ = !0, e.searchParams.delete(Z), window.history.replaceState(null, "", e.toString()));
704
751
  } catch {}
705
752
  window.addEventListener("vite:preloadError", (e) => {
706
753
  e.preventDefault();
707
754
  });
708
755
  }
709
- var Se = (e) => {
756
+ var je = (e) => {
710
757
  if (!(e instanceof Error)) return !1;
711
758
  let t = e.message.toLowerCase();
712
759
  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";
713
- }, Ce = /import\s*\(\s*(['"])((\w+:(\/?\/?))?[^\s,]+)\1/, we = (e) => e.toString().match(Ce)?.[2] ?? null, Q = (e) => {
760
+ }, Me = /import\s*\(\s*(['"])((\w+:(\/?\/?))?[^\s,]+)\1/, Ne = (e) => e.toString().match(Me)?.[2] ?? null, Pe = (e) => {
714
761
  try {
715
762
  return sessionStorage.getItem(e);
716
763
  } catch {
717
764
  return null;
718
765
  }
719
- }, Te = (e, t) => {
766
+ }, Fe = (e, t) => {
720
767
  try {
721
768
  sessionStorage.setItem(e, t);
722
769
  } catch {}
723
- }, Ee = (e) => Function("url", "return import(url)")(e), De = async (e) => {
724
- for (let t = 0; t < X; t++) try {
725
- return await Ee(`${e}?t=${Date.now()}`);
770
+ }, Ie = (e) => Function("url", "return import(url)")(e), Le = async (e) => {
771
+ for (let t = 0; t < Q; t++) try {
772
+ return await Ie(`${e}?t=${Date.now()}`);
726
773
  } catch {
727
- t < X - 1 && await new Promise((e) => setTimeout(e, 500 * 2 ** t));
774
+ t < Q - 1 && await new Promise((e) => setTimeout(e, 500 * 2 ** t));
728
775
  }
729
- throw Error(`Failed to import ${e} after ${X} retries`);
730
- }, Oe = async () => {
776
+ throw Error(`Failed to import ${e} after ${Q} retries`);
777
+ }, Re = async () => {
731
778
  try {
732
779
  if (typeof navigator < "u" && "serviceWorker" in navigator) {
733
780
  let e = await navigator.serviceWorker.getRegistrations();
@@ -738,27 +785,27 @@ var Se = (e) => {
738
785
  await Promise.all(e.map((e) => caches.delete(e)));
739
786
  }
740
787
  } catch {}
741
- }, ke = async () => {
742
- await Oe();
788
+ }, ze = async () => {
789
+ await Re();
743
790
  let e = new URL(window.location.href);
744
- e.searchParams.set(Y, String(Date.now())), window.location.replace(e.toString());
745
- }, $ = (e) => e != null && e.default !== void 0, Ae = (e) => r(async () => {
791
+ e.searchParams.set(Z, String(Date.now())), window.location.replace(e.toString());
792
+ }, Be = (e) => e != null && e.default !== void 0, Ve = (e) => i(async () => {
746
793
  let t;
747
794
  try {
748
795
  let n = await e();
749
- if ($(n)) return n;
796
+ if (Be(n)) return n;
750
797
  t = /* @__PURE__ */ Error("Module resolved without a valid default export");
751
798
  } catch (e) {
752
799
  t = e;
753
800
  }
754
- if (S || !Se(t)) throw t;
755
- let n = we(e);
801
+ if (j || !je(t)) throw t;
802
+ let n = Ne(e);
756
803
  if (n) try {
757
- let e = await De(n);
758
- if ($(e)) return e;
804
+ let e = await Le(n);
805
+ if (Be(e)) return e;
759
806
  } catch {}
760
- let r = Number(Q(J) || "0");
761
- return Date.now() - r < xe || Z || (Te(J, String(Date.now())), await ke()), { default: () => null };
807
+ let r = Number(Pe(X) || "0");
808
+ return Date.now() - r < Ae || $ || (Fe(X, String(Date.now())), await ze()), { default: () => null };
762
809
  });
763
810
  //#endregion
764
- export { g as ChatClient, L as ChatContext, R as ChatProvider, b as GTMSendPageView, x as InitializeAmplitude, w as InitializeAxiosConfig, T as InitializeDaysJSConfig, k as InitializeHubSpot, A as InitializeI18nConfig, j as InitializeSentryConfig, v as InjectDependenciesContext, y as InjectDependenciesProvider, _ as MaskTextField, ae as QueryProvider, P as RequireAuth, I as ShowHubSpotBubble, B as dateAdapter, V as distanceAdapter, e as getOrvalConfig, Ae as lazyWithRetry, ce as useAdapter, le as useAmplitude, U as useAuth, fe as useChat, pe as useCurrentLanguage, _e as useFilters, ve as useHubSpot, ye as useInfiniteDataGrid, be as useResponseError, H as worksiteNameAdapter };
811
+ export { O as AutoReloadOnNewVersion, _ as ChatClient, H as ChatContext, ue as ChatProvider, k as GTMSendPageView, A as InitializeAmplitude, N as InitializeAxiosConfig, I as InitializeDaysJSConfig, ee as InitializeHubSpot, te as InitializeI18nConfig, ne as InitializeSentryConfig, y as InjectDependenciesContext, b as InjectDependenciesProvider, v as MaskTextField, pe as QueryProvider, ie as RequireAuth, P as SUPPORTED_LANGUAGE, ae as ShowHubSpotBubble, U as dateAdapter, W as distanceAdapter, t as getOrvalConfig, Ve as lazyWithRetry, ge as useAdapter, _e as useAmplitude, ve as useAuth, xe as useChat, Se as useCurrentLanguage, Ee as useFilters, De as useHubSpot, Oe as useInfiniteDataGrid, ke as useResponseError, G as worksiteNameAdapter };