@rpcbase/client 0.415.0 → 0.417.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/errorReporting-CVoUUKxW.js +18 -0
- package/dist/errorReporting-CVoUUKxW.js.map +1 -0
- package/dist/getServerApiClient-BzqOKL0g.js +178 -0
- package/dist/getServerApiClient-BzqOKL0g.js.map +1 -0
- package/dist/index.js +2585 -2347
- package/dist/index.js.map +1 -1
- package/dist/instrument.js +40 -32
- package/dist/instrument.js.map +1 -1
- package/dist/rts/index.js +256 -2
- package/dist/rts/index.js.map +1 -0
- package/dist/spatial-nav/index.js +4327 -4793
- package/dist/spatial-nav/index.js.map +1 -1
- package/dist/throttle-CXOc9Dto.js +396 -0
- package/dist/throttle-CXOc9Dto.js.map +1 -0
- package/dist/useQuery-NQNva6kg.js +2573 -0
- package/dist/useQuery-NQNva6kg.js.map +1 -0
- package/package.json +2 -2
- package/dist/errorReporting-Dfcrn3W1.js +0 -18
- package/dist/errorReporting-Dfcrn3W1.js.map +0 -1
- package/dist/getServerApiClient-udstTQk3.js +0 -153
- package/dist/getServerApiClient-udstTQk3.js.map +0 -1
- package/dist/rts-rSMRh4Xw.js +0 -2406
- package/dist/rts-rSMRh4Xw.js.map +0 -1
- package/dist/throttle-Clti0UeB.js +0 -606
- package/dist/throttle-Clti0UeB.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,2436 +1,2674 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as setClientExceptionReporter, t as reportClientException } from "./errorReporting-Dfcrn3W1.js";
|
|
3
|
-
import { A as peekHydratedRtsCount, D as clearHydratedRtsQueryData, E as STATIC_RPCBASE_RTS_HYDRATION_DATA_KEY, M as peekHydratedRtsQueryPageInfo, N as peekHydratedRtsQueryTotalCount, O as consumeHydratedRtsCount, T as RtsSsrRuntimeProvider, j as peekHydratedRtsQueryData, k as hydrateRtsFromWindow, t as useQuery } from "./rts-rSMRh4Xw.js";
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
4
2
|
import { c } from "react/compiler-runtime";
|
|
5
|
-
import {
|
|
6
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useSyncExternalStore, lazy, useEffect, Suspense, StrictMode, useState, useRef, useLayoutEffect, createContext, useContext } from "react";
|
|
7
4
|
import env from "@rpcbase/env";
|
|
8
|
-
import {
|
|
5
|
+
import { getNavigationGuards, createRoutesFromElements, createBrowserRouter, RouterProvider, matchRoutes, useLocation, RoutePrefetchProvider, useRouteError, isRouteErrorResponse } from "@rpcbase/router";
|
|
9
6
|
import { hydrateRoot } from "react-dom/client";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
7
|
+
import { r as reportClientException } from "./errorReporting-CVoUUKxW.js";
|
|
8
|
+
import { s } from "./errorReporting-CVoUUKxW.js";
|
|
9
|
+
import { h as hydrateRtsFromWindow, u as useQuery } from "./useQuery-NQNva6kg.js";
|
|
10
|
+
import { R, S, c as c2, a, p, b, d, e } from "./useQuery-NQNva6kg.js";
|
|
11
|
+
import { r as requireToString, g as getDefaultExportFromCjs, t as throttle$1 } from "./throttle-CXOc9Dto.js";
|
|
12
|
+
const emptyUnsubscribe = () => {
|
|
13
|
+
};
|
|
14
|
+
const useMediaQuery = (query) => {
|
|
15
|
+
const $ = c(4);
|
|
16
|
+
const isServer = typeof window === "undefined";
|
|
17
|
+
let t0;
|
|
18
|
+
if ($[0] !== query) {
|
|
19
|
+
t0 = (callback) => {
|
|
20
|
+
if (isServer) {
|
|
21
|
+
return emptyUnsubscribe;
|
|
22
|
+
}
|
|
23
|
+
const mql = window.matchMedia(query);
|
|
24
|
+
if (mql.addEventListener) {
|
|
25
|
+
mql.addEventListener("change", callback);
|
|
26
|
+
return () => mql.removeEventListener("change", callback);
|
|
27
|
+
}
|
|
28
|
+
mql.addListener(callback);
|
|
29
|
+
return () => mql.removeListener(callback);
|
|
30
|
+
};
|
|
31
|
+
$[0] = query;
|
|
32
|
+
$[1] = t0;
|
|
33
|
+
} else {
|
|
34
|
+
t0 = $[1];
|
|
35
|
+
}
|
|
36
|
+
const subscribe = t0;
|
|
37
|
+
let t1;
|
|
38
|
+
if ($[2] !== query) {
|
|
39
|
+
t1 = () => {
|
|
40
|
+
if (isServer) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
return window.matchMedia(query).matches;
|
|
44
|
+
};
|
|
45
|
+
$[2] = query;
|
|
46
|
+
$[3] = t1;
|
|
47
|
+
} else {
|
|
48
|
+
t1 = $[3];
|
|
49
|
+
}
|
|
50
|
+
const getSnapshot = t1;
|
|
51
|
+
return useSyncExternalStore(subscribe, getSnapshot, _temp$3);
|
|
41
52
|
};
|
|
42
53
|
function _temp$3() {
|
|
43
|
-
|
|
54
|
+
return false;
|
|
44
55
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
56
|
+
let sonner = null;
|
|
57
|
+
let sonnerImport = null;
|
|
58
|
+
const queued = [];
|
|
59
|
+
let toasterRequested = false;
|
|
60
|
+
const toasterListeners = /* @__PURE__ */ new Set();
|
|
61
|
+
let toasterMounted = false;
|
|
62
|
+
let toasterPreloadStarted = false;
|
|
63
|
+
let idCounter = 0;
|
|
64
|
+
const createToastId = () => `rb-toast-${++idCounter}`;
|
|
65
|
+
const resolveId = (id) => {
|
|
66
|
+
if (typeof id === "number") return id;
|
|
67
|
+
if (typeof id === "string" && id.length > 0) return id;
|
|
68
|
+
return void 0;
|
|
69
|
+
};
|
|
70
|
+
const requestToasterMount = () => {
|
|
71
|
+
if (toasterRequested) return;
|
|
72
|
+
toasterRequested = true;
|
|
73
|
+
for (const listener of toasterListeners) {
|
|
74
|
+
listener();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const subscribeToasterRequested = (listener) => {
|
|
78
|
+
toasterListeners.add(listener);
|
|
79
|
+
return () => {
|
|
80
|
+
toasterListeners.delete(listener);
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
const getToasterRequested = () => toasterRequested;
|
|
84
|
+
const flushQueue = () => {
|
|
85
|
+
if (!sonner) return;
|
|
86
|
+
if (typeof document !== "undefined" && !toasterMounted) return;
|
|
87
|
+
while (queued.length) {
|
|
88
|
+
const fn = queued.shift();
|
|
89
|
+
if (fn) fn(sonner);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const setToasterMounted = (mounted) => {
|
|
93
|
+
toasterMounted = mounted;
|
|
94
|
+
if (mounted) flushQueue();
|
|
95
|
+
};
|
|
96
|
+
const loadSonner = () => {
|
|
97
|
+
if (sonner) return Promise.resolve(sonner);
|
|
98
|
+
if (sonnerImport) return sonnerImport;
|
|
99
|
+
sonnerImport = import("sonner").then((mod) => {
|
|
100
|
+
sonner = mod;
|
|
101
|
+
flushQueue();
|
|
102
|
+
return mod;
|
|
103
|
+
});
|
|
104
|
+
return sonnerImport;
|
|
105
|
+
};
|
|
106
|
+
const enqueue = (fn) => {
|
|
107
|
+
if (sonner && (toasterMounted || typeof document === "undefined")) {
|
|
108
|
+
fn(sonner);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
queued.push(fn);
|
|
112
|
+
};
|
|
113
|
+
const isPageLoaded = () => {
|
|
114
|
+
if (typeof document === "undefined") return false;
|
|
115
|
+
return document.readyState === "complete";
|
|
116
|
+
};
|
|
117
|
+
const startToaster = () => {
|
|
118
|
+
if (toasterPreloadStarted) return;
|
|
119
|
+
toasterPreloadStarted = true;
|
|
120
|
+
requestToasterMount();
|
|
121
|
+
void loadSonner();
|
|
122
|
+
};
|
|
123
|
+
const ensureReady = () => {
|
|
124
|
+
if (typeof document === "undefined") startToaster();
|
|
125
|
+
};
|
|
126
|
+
const buildToastData = (data, id) => data ? {
|
|
127
|
+
...data,
|
|
128
|
+
id
|
|
129
|
+
} : {
|
|
130
|
+
id
|
|
131
|
+
};
|
|
132
|
+
const toastFn = ((message, data) => {
|
|
133
|
+
ensureReady();
|
|
134
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
135
|
+
const nextData = buildToastData(data, id);
|
|
136
|
+
enqueue((m) => {
|
|
137
|
+
m.toast(message, nextData);
|
|
138
|
+
});
|
|
139
|
+
return id;
|
|
126
140
|
});
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
141
|
+
const toastSuccess = (message, data) => {
|
|
142
|
+
ensureReady();
|
|
143
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
144
|
+
const nextData = buildToastData(data, id);
|
|
145
|
+
enqueue((m) => {
|
|
146
|
+
m.toast.success(message, nextData);
|
|
147
|
+
});
|
|
148
|
+
return id;
|
|
149
|
+
};
|
|
150
|
+
const toastInfo = (message, data) => {
|
|
151
|
+
ensureReady();
|
|
152
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
153
|
+
const nextData = buildToastData(data, id);
|
|
154
|
+
enqueue((m) => {
|
|
155
|
+
m.toast.info(message, nextData);
|
|
156
|
+
});
|
|
157
|
+
return id;
|
|
158
|
+
};
|
|
159
|
+
const toastWarning = (message, data) => {
|
|
160
|
+
ensureReady();
|
|
161
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
162
|
+
const nextData = buildToastData(data, id);
|
|
163
|
+
enqueue((m) => {
|
|
164
|
+
m.toast.warning(message, nextData);
|
|
165
|
+
});
|
|
166
|
+
return id;
|
|
167
|
+
};
|
|
168
|
+
const toastError = (message, data) => {
|
|
169
|
+
ensureReady();
|
|
170
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
171
|
+
const nextData = buildToastData(data, id);
|
|
172
|
+
enqueue((m) => {
|
|
173
|
+
m.toast.error(message, nextData);
|
|
174
|
+
});
|
|
175
|
+
return id;
|
|
176
|
+
};
|
|
177
|
+
const toastMessage = (message, data) => {
|
|
178
|
+
ensureReady();
|
|
179
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
180
|
+
const nextData = buildToastData(data, id);
|
|
181
|
+
enqueue((m) => {
|
|
182
|
+
m.toast.message(message, nextData);
|
|
183
|
+
});
|
|
184
|
+
return id;
|
|
185
|
+
};
|
|
186
|
+
const toastLoading = (message, data) => {
|
|
187
|
+
ensureReady();
|
|
188
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
189
|
+
const nextData = buildToastData(data, id);
|
|
190
|
+
enqueue((m) => {
|
|
191
|
+
m.toast.loading(message, nextData);
|
|
192
|
+
});
|
|
193
|
+
return id;
|
|
194
|
+
};
|
|
195
|
+
const toastCustom = (jsx2, data) => {
|
|
196
|
+
ensureReady();
|
|
197
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
198
|
+
const nextData = buildToastData(data, id);
|
|
199
|
+
enqueue((m) => {
|
|
200
|
+
m.toast.custom(jsx2, nextData);
|
|
201
|
+
});
|
|
202
|
+
return id;
|
|
203
|
+
};
|
|
204
|
+
const toastPromise = (promise, data) => {
|
|
205
|
+
ensureReady();
|
|
206
|
+
if (!data) return void 0;
|
|
207
|
+
const startedPromise = promise instanceof Function ? promise() : promise;
|
|
208
|
+
const unwrap = () => Promise.resolve(startedPromise);
|
|
209
|
+
if (data.loading === void 0) {
|
|
210
|
+
enqueue((m) => {
|
|
211
|
+
m.toast.promise(startedPromise, data);
|
|
212
|
+
});
|
|
213
|
+
return {
|
|
214
|
+
unwrap
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
const id = resolveId(data.id) ?? createToastId();
|
|
218
|
+
const nextData = {
|
|
219
|
+
...data,
|
|
220
|
+
id
|
|
221
|
+
};
|
|
222
|
+
enqueue((m) => {
|
|
223
|
+
m.toast.promise(startedPromise, nextData);
|
|
224
|
+
});
|
|
225
|
+
return Object.assign(id, {
|
|
226
|
+
unwrap
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
const toastDismiss = (id) => {
|
|
230
|
+
ensureReady();
|
|
231
|
+
enqueue((m) => {
|
|
232
|
+
m.toast.dismiss(id);
|
|
233
|
+
});
|
|
234
|
+
return id;
|
|
235
|
+
};
|
|
236
|
+
const toastGetHistory = () => sonner ? sonner.toast.getHistory() : [];
|
|
237
|
+
const toastGetToasts = () => sonner ? sonner.toast.getToasts() : [];
|
|
238
|
+
const toast = Object.assign(toastFn, {
|
|
239
|
+
success: toastSuccess,
|
|
240
|
+
info: toastInfo,
|
|
241
|
+
warning: toastWarning,
|
|
242
|
+
error: toastError,
|
|
243
|
+
message: toastMessage,
|
|
244
|
+
loading: toastLoading,
|
|
245
|
+
custom: toastCustom,
|
|
246
|
+
promise: toastPromise,
|
|
247
|
+
dismiss: toastDismiss,
|
|
248
|
+
getHistory: toastGetHistory,
|
|
249
|
+
getToasts: toastGetToasts
|
|
232
250
|
});
|
|
233
|
-
|
|
234
|
-
|
|
251
|
+
const LazySonnerToaster = lazy(async () => {
|
|
252
|
+
const mod = await import("sonner");
|
|
253
|
+
return {
|
|
254
|
+
default: mod.Toaster
|
|
255
|
+
};
|
|
235
256
|
});
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
257
|
+
const MountedLazyToaster = (props) => {
|
|
258
|
+
const $ = c(3);
|
|
259
|
+
let t0;
|
|
260
|
+
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
261
|
+
t0 = [];
|
|
262
|
+
$[0] = t0;
|
|
263
|
+
} else {
|
|
264
|
+
t0 = $[0];
|
|
265
|
+
}
|
|
266
|
+
useEffect(_temp2$1, t0);
|
|
267
|
+
let t1;
|
|
268
|
+
if ($[1] !== props) {
|
|
269
|
+
t1 = /* @__PURE__ */ jsx(LazySonnerToaster, { ...props });
|
|
270
|
+
$[1] = props;
|
|
271
|
+
$[2] = t1;
|
|
272
|
+
} else {
|
|
273
|
+
t1 = $[2];
|
|
274
|
+
}
|
|
275
|
+
return t1;
|
|
276
|
+
};
|
|
277
|
+
const ActiveToaster = () => {
|
|
278
|
+
const $ = c(9);
|
|
279
|
+
const isMobile = useMediaQuery("(max-width: 767px)");
|
|
280
|
+
const isCoarsePointer = useMediaQuery("(hover: none) and (pointer: coarse)");
|
|
281
|
+
const position = isMobile ? "top-center" : void 0;
|
|
282
|
+
let t0;
|
|
283
|
+
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
284
|
+
t0 = [];
|
|
285
|
+
$[0] = t0;
|
|
286
|
+
} else {
|
|
287
|
+
t0 = $[0];
|
|
288
|
+
}
|
|
289
|
+
useEffect(_temp4$1, t0);
|
|
290
|
+
const t1 = !isCoarsePointer;
|
|
291
|
+
let t2;
|
|
292
|
+
if ($[1] !== isCoarsePointer) {
|
|
293
|
+
t2 = isCoarsePointer ? void 0 : [];
|
|
294
|
+
$[1] = isCoarsePointer;
|
|
295
|
+
$[2] = t2;
|
|
296
|
+
} else {
|
|
297
|
+
t2 = $[2];
|
|
298
|
+
}
|
|
299
|
+
let t3;
|
|
300
|
+
if ($[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
301
|
+
t3 = {
|
|
302
|
+
pointerEvents: "auto",
|
|
303
|
+
"--toast-close-button-start": "unset",
|
|
304
|
+
"--toast-close-button-end": "0",
|
|
305
|
+
"--toast-close-button-transform": "translate(35%, -35%)"
|
|
306
|
+
};
|
|
307
|
+
$[3] = t3;
|
|
308
|
+
} else {
|
|
309
|
+
t3 = $[3];
|
|
310
|
+
}
|
|
311
|
+
let t4;
|
|
312
|
+
if ($[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
313
|
+
t4 = {
|
|
314
|
+
style: {
|
|
315
|
+
pointerEvents: "auto",
|
|
316
|
+
userSelect: "text"
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
$[4] = t4;
|
|
320
|
+
} else {
|
|
321
|
+
t4 = $[4];
|
|
322
|
+
}
|
|
323
|
+
let t5;
|
|
324
|
+
if ($[5] !== position || $[6] !== t1 || $[7] !== t2) {
|
|
325
|
+
t5 = /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(MountedLazyToaster, { closeButton: t1, theme: "dark", position, swipeDirections: t2, style: t3, toastOptions: t4 }) });
|
|
326
|
+
$[5] = position;
|
|
327
|
+
$[6] = t1;
|
|
328
|
+
$[7] = t2;
|
|
329
|
+
$[8] = t5;
|
|
330
|
+
} else {
|
|
331
|
+
t5 = $[8];
|
|
332
|
+
}
|
|
333
|
+
return t5;
|
|
334
|
+
};
|
|
335
|
+
const Toaster = () => {
|
|
336
|
+
const $ = c(2);
|
|
337
|
+
let t0;
|
|
338
|
+
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
339
|
+
t0 = [];
|
|
340
|
+
$[0] = t0;
|
|
341
|
+
} else {
|
|
342
|
+
t0 = $[0];
|
|
343
|
+
}
|
|
344
|
+
useEffect(_temp8, t0);
|
|
345
|
+
const requested = useSyncExternalStore(subscribeToasterRequested, getToasterRequested, getToasterRequested);
|
|
346
|
+
if (!requested) {
|
|
347
|
+
return null;
|
|
348
|
+
}
|
|
349
|
+
let t1;
|
|
350
|
+
if ($[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
351
|
+
t1 = /* @__PURE__ */ jsx(ActiveToaster, {});
|
|
352
|
+
$[1] = t1;
|
|
353
|
+
} else {
|
|
354
|
+
t1 = $[1];
|
|
355
|
+
}
|
|
356
|
+
return t1;
|
|
323
357
|
};
|
|
324
358
|
function _temp$2() {
|
|
325
|
-
|
|
359
|
+
return setToasterMounted(false);
|
|
326
360
|
}
|
|
327
361
|
function _temp2$1() {
|
|
328
|
-
|
|
329
|
-
|
|
362
|
+
setToasterMounted(true);
|
|
363
|
+
return _temp$2;
|
|
330
364
|
}
|
|
331
365
|
function _temp3$1(event) {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
366
|
+
const target = event.target;
|
|
367
|
+
if (!(target instanceof Element)) {
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
if (!target.closest("[data-sonner-toaster]")) {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
event.preventDefault();
|
|
336
374
|
}
|
|
337
375
|
function _temp4$1() {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
376
|
+
const handler = _temp3$1;
|
|
377
|
+
document.addEventListener("dismissableLayer.pointerDownOutside", handler, true);
|
|
378
|
+
document.addEventListener("dismissableLayer.focusOutside", handler, true);
|
|
379
|
+
return () => {
|
|
380
|
+
document.removeEventListener("dismissableLayer.pointerDownOutside", handler, true);
|
|
381
|
+
document.removeEventListener("dismissableLayer.focusOutside", handler, true);
|
|
382
|
+
};
|
|
345
383
|
}
|
|
346
384
|
function _temp5$1() {
|
|
347
|
-
|
|
385
|
+
return startToaster();
|
|
348
386
|
}
|
|
349
387
|
function _temp6() {
|
|
350
|
-
|
|
388
|
+
return startToaster();
|
|
351
389
|
}
|
|
352
390
|
function _temp7() {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
391
|
+
if (typeof window.requestIdleCallback === "function") {
|
|
392
|
+
window.requestIdleCallback(_temp5$1, {
|
|
393
|
+
timeout: 2e3
|
|
394
|
+
});
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
window.setTimeout(_temp6, 150);
|
|
358
398
|
}
|
|
359
399
|
function _temp8() {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
400
|
+
if (typeof window === "undefined") {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
const startDeferred = _temp7;
|
|
404
|
+
if (isPageLoaded()) {
|
|
405
|
+
startDeferred();
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
window.addEventListener("load", startDeferred, {
|
|
409
|
+
once: true
|
|
410
|
+
});
|
|
411
|
+
return () => {
|
|
412
|
+
window.removeEventListener("load", startDeferred);
|
|
413
|
+
};
|
|
370
414
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
};
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
]
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
415
|
+
let apiClient;
|
|
416
|
+
const initApiClient = async (args) => {
|
|
417
|
+
if (env.SSR) {
|
|
418
|
+
if (!args) {
|
|
419
|
+
throw new Error("Server args must be provided in SSR mode");
|
|
420
|
+
}
|
|
421
|
+
const {
|
|
422
|
+
getServerApiClient
|
|
423
|
+
} = await import("./getServerApiClient-BzqOKL0g.js");
|
|
424
|
+
apiClient = await getServerApiClient(args.app);
|
|
425
|
+
} else {
|
|
426
|
+
const axios = (await import("axios/dist/browser/axios.cjs")).default;
|
|
427
|
+
const axiosClient = axios.create({
|
|
428
|
+
baseURL: args && "baseURL" in args ? args?.baseURL ?? "/" : "/",
|
|
429
|
+
withCredentials: true,
|
|
430
|
+
headers: {
|
|
431
|
+
"Content-Type": "application/json"
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
const createMethod = (method) => {
|
|
435
|
+
return async (path, payload, _ctx) => {
|
|
436
|
+
const config = {
|
|
437
|
+
method,
|
|
438
|
+
url: path,
|
|
439
|
+
...method === "get" ? {
|
|
440
|
+
params: payload
|
|
441
|
+
} : {
|
|
442
|
+
data: payload
|
|
443
|
+
},
|
|
444
|
+
headers: {
|
|
445
|
+
// ...(typeof ctxOrPath !== 'string' && {
|
|
446
|
+
// // 'X-Custom-Header': ctxOrPath.someHeaderValue,
|
|
447
|
+
// // ...ctxOrPath.additionalHeaders,
|
|
448
|
+
// }),
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
try {
|
|
452
|
+
const response = await axiosClient(config);
|
|
453
|
+
return response.data;
|
|
454
|
+
} catch (error) {
|
|
455
|
+
console.log("AXIOS API ERROR", error);
|
|
456
|
+
throw error;
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
};
|
|
460
|
+
apiClient = {
|
|
461
|
+
get: createMethod("get"),
|
|
462
|
+
put: createMethod("put"),
|
|
463
|
+
post: createMethod("post"),
|
|
464
|
+
delete: createMethod("delete")
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
const CLEANUP_WAIT_DELAY = 1e3;
|
|
469
|
+
const cleanupURL = () => {
|
|
470
|
+
if (env.SSR) {
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
const runCleanup = () => {
|
|
474
|
+
setTimeout(() => {
|
|
475
|
+
const url = new URL(window.location.href);
|
|
476
|
+
const params = new URLSearchParams(url.search);
|
|
477
|
+
const paramKeys = Array.from(params.keys());
|
|
478
|
+
paramKeys.forEach((key) => {
|
|
479
|
+
if (key.startsWith("utm_")) {
|
|
480
|
+
params.delete(key);
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
const cleanUrl = url.pathname + (params.toString() ? "?" + params.toString() : "") + url.hash;
|
|
484
|
+
window.history.replaceState({}, document.title, cleanUrl);
|
|
485
|
+
}, CLEANUP_WAIT_DELAY);
|
|
486
|
+
};
|
|
487
|
+
if (document.readyState === "complete" || document.readyState === "interactive") {
|
|
488
|
+
runCleanup();
|
|
489
|
+
} else {
|
|
490
|
+
document.addEventListener("DOMContentLoaded", runCleanup, {
|
|
491
|
+
once: true
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
const isDesktopDevice = () => {
|
|
496
|
+
if (typeof window === "undefined") {
|
|
497
|
+
return false;
|
|
498
|
+
}
|
|
499
|
+
if (typeof window.matchMedia !== "function") {
|
|
500
|
+
return false;
|
|
501
|
+
}
|
|
502
|
+
const hasDesktopPointer = window.matchMedia("(hover: hover) and (pointer: fine)").matches;
|
|
503
|
+
const hasTouch = typeof navigator !== "undefined" && navigator.maxTouchPoints > 0;
|
|
504
|
+
return hasDesktopPointer && !hasTouch;
|
|
505
|
+
};
|
|
506
|
+
const isPlaywrightTestEnvironment = () => {
|
|
507
|
+
if (typeof navigator === "undefined") {
|
|
508
|
+
return false;
|
|
509
|
+
}
|
|
510
|
+
return navigator.webdriver === true;
|
|
511
|
+
};
|
|
512
|
+
const DEFAULT_PRIORITY = 0;
|
|
513
|
+
const canBlockNavigation = (guard, {
|
|
514
|
+
isPathnameChange,
|
|
515
|
+
isSearchChange
|
|
516
|
+
}) => {
|
|
517
|
+
if (!guard.enabled) return false;
|
|
518
|
+
if (isPathnameChange) return true;
|
|
519
|
+
if (isSearchChange && guard.blockOnSearch) return true;
|
|
520
|
+
return false;
|
|
521
|
+
};
|
|
522
|
+
const pickNavigationGuard = (args) => {
|
|
523
|
+
const isPathnameChange = args.currentLocation.pathname !== args.nextLocation.pathname;
|
|
524
|
+
const isSearchChange = args.currentLocation.search !== args.nextLocation.search;
|
|
525
|
+
if (!isPathnameChange && !isSearchChange) {
|
|
526
|
+
return null;
|
|
527
|
+
}
|
|
528
|
+
const eligibleGuards = getNavigationGuards().filter((guard) => canBlockNavigation(guard, {
|
|
529
|
+
isPathnameChange,
|
|
530
|
+
isSearchChange
|
|
531
|
+
})).filter((guard) => guard.shouldBlockNavigation(args));
|
|
532
|
+
if (eligibleGuards.length === 0) {
|
|
533
|
+
return null;
|
|
534
|
+
}
|
|
535
|
+
return eligibleGuards.reduce((best, guard) => {
|
|
536
|
+
const bestPriority = best.priority ?? DEFAULT_PRIORITY;
|
|
537
|
+
const guardPriority = guard.priority ?? DEFAULT_PRIORITY;
|
|
538
|
+
return guardPriority > bestPriority ? guard : best;
|
|
539
|
+
}, eligibleGuards[0]);
|
|
540
|
+
};
|
|
541
|
+
const getLocationDedupKey = (location) => location.key ?? `${location.pathname}${location.search}`;
|
|
542
|
+
const hasUnloadBlockers = () => getNavigationGuards().some((guard) => guard.enabled && guard.shouldBlockUnload);
|
|
543
|
+
const WINDOW_STATE_KEY = "__rpcbaseNavigationGuardWindowState";
|
|
544
|
+
const INSTALLED_ROUTERS_KEY = "__rpcbaseNavigationGuardInstalledRouters";
|
|
545
|
+
const BEFORE_UNLOAD_INSTALLED_KEY = "__rpcbaseBeforeUnloadNavigationGuardInstalled";
|
|
546
|
+
const getWindowState = () => {
|
|
547
|
+
if (typeof window === "undefined") return null;
|
|
548
|
+
const globalWindow = window;
|
|
549
|
+
const existing = globalWindow[WINDOW_STATE_KEY];
|
|
550
|
+
if (existing) {
|
|
551
|
+
if (typeof existing.suppressBeforeUnloadFromKey === "undefined") {
|
|
552
|
+
existing.suppressBeforeUnloadFromKey = null;
|
|
553
|
+
}
|
|
554
|
+
return existing;
|
|
555
|
+
}
|
|
556
|
+
const created = {
|
|
557
|
+
suppressBeforeUnloadFromKey: null,
|
|
558
|
+
nativePromptActive: false
|
|
559
|
+
};
|
|
560
|
+
globalWindow[WINDOW_STATE_KEY] = created;
|
|
561
|
+
return created;
|
|
562
|
+
};
|
|
563
|
+
const getGlobalGuardWeakSet = () => {
|
|
564
|
+
const globalScope = globalThis;
|
|
565
|
+
const existing = globalScope[INSTALLED_ROUTERS_KEY];
|
|
566
|
+
if (existing && existing instanceof WeakSet) {
|
|
567
|
+
return existing;
|
|
568
|
+
}
|
|
569
|
+
const created = /* @__PURE__ */ new WeakSet();
|
|
570
|
+
globalScope[INSTALLED_ROUTERS_KEY] = created;
|
|
571
|
+
return created;
|
|
572
|
+
};
|
|
573
|
+
const installGlobalNavigationGuard = (router) => {
|
|
574
|
+
const installedRouters = getGlobalGuardWeakSet();
|
|
575
|
+
if (installedRouters.has(router)) {
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
installedRouters.add(router);
|
|
579
|
+
const blockerKey = "rpcbase:navigation-guards";
|
|
580
|
+
const windowState = getWindowState();
|
|
581
|
+
let lastArgs = null;
|
|
582
|
+
let lastPromptedLocationKey = null;
|
|
583
|
+
router.getBlocker(blockerKey, (args) => {
|
|
584
|
+
lastArgs = args;
|
|
585
|
+
if (windowState?.nativePromptActive && args.historyAction !== "POP") {
|
|
586
|
+
windowState.nativePromptActive = false;
|
|
587
|
+
}
|
|
588
|
+
return pickNavigationGuard(args) !== null;
|
|
589
|
+
});
|
|
590
|
+
router.subscribe((state) => {
|
|
591
|
+
if (windowState?.suppressBeforeUnloadFromKey) {
|
|
592
|
+
const currentKey = getLocationDedupKey(state.location);
|
|
593
|
+
if (currentKey !== windowState.suppressBeforeUnloadFromKey) {
|
|
594
|
+
windowState.suppressBeforeUnloadFromKey = null;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
const blocker = state.blockers.get(blockerKey);
|
|
598
|
+
if (!blocker || blocker.state !== "blocked") {
|
|
599
|
+
lastPromptedLocationKey = null;
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
const blockedLocation = blocker.location;
|
|
603
|
+
const dedupKey = getLocationDedupKey(blockedLocation);
|
|
604
|
+
if (lastPromptedLocationKey === dedupKey) {
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
lastPromptedLocationKey = dedupKey;
|
|
608
|
+
if (windowState?.nativePromptActive && lastArgs?.historyAction === "POP") {
|
|
609
|
+
windowState.nativePromptActive = false;
|
|
610
|
+
blocker.reset();
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
const args = lastArgs;
|
|
614
|
+
if (!args) {
|
|
615
|
+
blocker.proceed();
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
const guard = pickNavigationGuard(args);
|
|
619
|
+
if (!guard) {
|
|
620
|
+
blocker.proceed();
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
const ok = window.confirm(guard.message);
|
|
624
|
+
if (ok) {
|
|
625
|
+
if (windowState) {
|
|
626
|
+
windowState.suppressBeforeUnloadFromKey = getLocationDedupKey(args.currentLocation);
|
|
627
|
+
}
|
|
628
|
+
blocker.proceed();
|
|
629
|
+
} else {
|
|
630
|
+
blocker.reset();
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
if (typeof window !== "undefined") {
|
|
634
|
+
const globalWindow = window;
|
|
635
|
+
if (!globalWindow[BEFORE_UNLOAD_INSTALLED_KEY]) {
|
|
636
|
+
globalWindow[BEFORE_UNLOAD_INSTALLED_KEY] = true;
|
|
637
|
+
window.addEventListener("beforeunload", (event) => {
|
|
638
|
+
const state = getWindowState();
|
|
639
|
+
if (state && state.suppressBeforeUnloadFromKey) {
|
|
640
|
+
state.suppressBeforeUnloadFromKey = null;
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
if (!hasUnloadBlockers()) {
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
if (state) {
|
|
647
|
+
state.nativePromptActive = true;
|
|
648
|
+
}
|
|
649
|
+
event.preventDefault();
|
|
650
|
+
event.returnValue = "";
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
const SSR_ERROR_STATE_GLOBAL_KEY = "__RPCBASE_SSR_ERROR__";
|
|
656
|
+
const ESCAPED_LT = /</g;
|
|
657
|
+
const ESCAPED_U2028 = /\u2028/g;
|
|
658
|
+
const ESCAPED_U2029 = /\u2029/g;
|
|
659
|
+
const serializeSsrErrorState = (state) => JSON.stringify(state).replace(ESCAPED_LT, "\\u003c").replace(ESCAPED_U2028, "\\u2028").replace(ESCAPED_U2029, "\\u2029");
|
|
660
|
+
const peekClientSsrErrorState = () => {
|
|
661
|
+
if (typeof window === "undefined") {
|
|
662
|
+
return null;
|
|
663
|
+
}
|
|
664
|
+
const globalScope = window;
|
|
665
|
+
const state = globalScope[SSR_ERROR_STATE_GLOBAL_KEY];
|
|
666
|
+
if (state && typeof state === "object") {
|
|
667
|
+
return state;
|
|
668
|
+
}
|
|
669
|
+
return null;
|
|
670
|
+
};
|
|
671
|
+
const consumeClientSsrErrorState = () => {
|
|
672
|
+
const state = peekClientSsrErrorState();
|
|
673
|
+
if (!state) {
|
|
674
|
+
return null;
|
|
675
|
+
}
|
|
676
|
+
if (typeof window !== "undefined") {
|
|
677
|
+
delete window[SSR_ERROR_STATE_GLOBAL_KEY];
|
|
678
|
+
}
|
|
679
|
+
return state;
|
|
680
|
+
};
|
|
681
|
+
const DEFAULT_TITLE = "Something went wrong";
|
|
682
|
+
const DEFAULT_MESSAGE = "We couldn't render this page. Please try again in a few seconds.";
|
|
683
|
+
const SsrErrorFallback = (t0) => {
|
|
684
|
+
const $ = c(19);
|
|
685
|
+
const {
|
|
686
|
+
state,
|
|
687
|
+
renderErrorExtra
|
|
688
|
+
} = t0;
|
|
689
|
+
const {
|
|
690
|
+
statusCode: t1,
|
|
691
|
+
title: t2,
|
|
692
|
+
message: t3,
|
|
693
|
+
details
|
|
694
|
+
} = state;
|
|
695
|
+
const statusCode = t1 === void 0 ? 500 : t1;
|
|
696
|
+
const title = t2 === void 0 ? DEFAULT_TITLE : t2;
|
|
697
|
+
const message = t3 === void 0 ? DEFAULT_MESSAGE : t3;
|
|
698
|
+
let t4;
|
|
699
|
+
if ($[0] !== renderErrorExtra || $[1] !== state) {
|
|
700
|
+
t4 = renderErrorExtra?.(state);
|
|
701
|
+
$[0] = renderErrorExtra;
|
|
702
|
+
$[1] = state;
|
|
703
|
+
$[2] = t4;
|
|
704
|
+
} else {
|
|
705
|
+
t4 = $[2];
|
|
706
|
+
}
|
|
707
|
+
const extra = t4;
|
|
708
|
+
let t5;
|
|
709
|
+
if ($[3] !== statusCode) {
|
|
710
|
+
t5 = /* @__PURE__ */ jsx("p", { className: "text-base font-semibold text-rose-600", children: statusCode });
|
|
711
|
+
$[3] = statusCode;
|
|
712
|
+
$[4] = t5;
|
|
713
|
+
} else {
|
|
714
|
+
t5 = $[4];
|
|
715
|
+
}
|
|
716
|
+
let t6;
|
|
717
|
+
if ($[5] !== title) {
|
|
718
|
+
t6 = /* @__PURE__ */ jsx("h1", { className: "mt-4 text-pretty text-4xl font-semibold tracking-tight text-gray-900 sm:text-5xl", children: title });
|
|
719
|
+
$[5] = title;
|
|
720
|
+
$[6] = t6;
|
|
721
|
+
} else {
|
|
722
|
+
t6 = $[6];
|
|
723
|
+
}
|
|
724
|
+
let t7;
|
|
725
|
+
if ($[7] !== message) {
|
|
726
|
+
t7 = /* @__PURE__ */ jsx("p", { className: "mt-6 text-lg text-gray-600 sm:text-xl/relaxed", children: message });
|
|
727
|
+
$[7] = message;
|
|
728
|
+
$[8] = t7;
|
|
729
|
+
} else {
|
|
730
|
+
t7 = $[8];
|
|
731
|
+
}
|
|
732
|
+
let t8;
|
|
733
|
+
if ($[9] !== details) {
|
|
734
|
+
t8 = details ? /* @__PURE__ */ jsxs("div", { className: "mt-10 w-full rounded-2xl bg-gray-900/95 p-5 text-left shadow-2xl", children: [
|
|
735
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold uppercase tracking-wide text-gray-400", children: "Debug details" }),
|
|
736
|
+
/* @__PURE__ */ jsx("pre", { className: "mt-3 max-h-64 overflow-auto whitespace-pre-wrap text-sm text-gray-100", children: details })
|
|
737
|
+
] }) : null;
|
|
738
|
+
$[9] = details;
|
|
739
|
+
$[10] = t8;
|
|
740
|
+
} else {
|
|
741
|
+
t8 = $[10];
|
|
742
|
+
}
|
|
743
|
+
let t9;
|
|
744
|
+
if ($[11] !== extra) {
|
|
745
|
+
t9 = extra ? /* @__PURE__ */ jsx("div", { className: "mt-10 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-center", children: extra }) : null;
|
|
746
|
+
$[11] = extra;
|
|
747
|
+
$[12] = t9;
|
|
748
|
+
} else {
|
|
749
|
+
t9 = $[12];
|
|
750
|
+
}
|
|
751
|
+
let t10;
|
|
752
|
+
if ($[13] !== t5 || $[14] !== t6 || $[15] !== t7 || $[16] !== t8 || $[17] !== t9) {
|
|
753
|
+
t10 = /* @__PURE__ */ jsx("div", { className: "bg-white min-h-screen", children: /* @__PURE__ */ jsxs("main", { className: "mx-auto flex min-h-screen max-w-2xl flex-col items-center justify-center px-6 py-12 text-center sm:py-24", children: [
|
|
754
|
+
t5,
|
|
755
|
+
t6,
|
|
756
|
+
t7,
|
|
757
|
+
t8,
|
|
758
|
+
t9
|
|
759
|
+
] }) });
|
|
760
|
+
$[13] = t5;
|
|
761
|
+
$[14] = t6;
|
|
762
|
+
$[15] = t7;
|
|
763
|
+
$[16] = t8;
|
|
764
|
+
$[17] = t9;
|
|
765
|
+
$[18] = t10;
|
|
766
|
+
} else {
|
|
767
|
+
t10 = $[18];
|
|
768
|
+
}
|
|
769
|
+
return t10;
|
|
770
|
+
};
|
|
771
|
+
const isProduction = env.MODE === "production";
|
|
772
|
+
const LOADER_TIMEOUT_MS = 1e4;
|
|
773
|
+
const HYDRATION_IDENTIFIER_PREFIX = "rb-";
|
|
774
|
+
const IMMUTABLE_LAZY_ROUTE_KEYS = /* @__PURE__ */ new Set(["lazy", "caseSensitive", "path", "id", "index", "children"]);
|
|
775
|
+
const showErrorOverlay = (err) => {
|
|
776
|
+
const ErrorOverlay = customElements.get("vite-error-overlay");
|
|
777
|
+
if (!ErrorOverlay) {
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
console.log(err);
|
|
781
|
+
const overlay = new ErrorOverlay(err);
|
|
782
|
+
document.body.appendChild(overlay);
|
|
783
|
+
};
|
|
784
|
+
const handleServerErrors = () => {
|
|
785
|
+
const hydrationData = window.__staticRouterHydrationData;
|
|
786
|
+
if (hydrationData?.errors) {
|
|
787
|
+
const {
|
|
788
|
+
errors
|
|
789
|
+
} = hydrationData;
|
|
790
|
+
Object.values(errors).forEach((error) => {
|
|
791
|
+
showErrorOverlay({
|
|
792
|
+
plugin: "ssr-router",
|
|
793
|
+
...error.reason
|
|
794
|
+
});
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
const clearStaticRouterHydrationData = () => {
|
|
799
|
+
delete window.__staticRouterHydrationData;
|
|
800
|
+
};
|
|
801
|
+
const wrapLoaderWithTimeout = (loader, routeId) => async (...args) => new Promise((resolve, reject) => {
|
|
802
|
+
const timer = setTimeout(() => {
|
|
803
|
+
console.error("[rpcbase timeout][client loader]", {
|
|
804
|
+
routeId,
|
|
805
|
+
ms: LOADER_TIMEOUT_MS,
|
|
806
|
+
url: window.location.href
|
|
807
|
+
});
|
|
808
|
+
reject(new Response("Loader timeout", {
|
|
809
|
+
status: 504
|
|
810
|
+
}));
|
|
811
|
+
}, LOADER_TIMEOUT_MS);
|
|
812
|
+
Promise.resolve(loader(...args)).then((val) => {
|
|
813
|
+
clearTimeout(timer);
|
|
814
|
+
resolve(val);
|
|
815
|
+
}).catch((err) => {
|
|
816
|
+
clearTimeout(timer);
|
|
817
|
+
reject(err);
|
|
818
|
+
});
|
|
722
819
|
});
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
var
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
var
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
*/
|
|
1255
|
-
function createCompounder(callback) {
|
|
1256
|
-
return function(string) {
|
|
1257
|
-
return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
|
|
1258
|
-
};
|
|
1259
|
-
}
|
|
1260
|
-
module.exports = createCompounder;
|
|
1261
|
-
}));
|
|
1262
|
-
//#endregion
|
|
1263
|
-
//#region src/getFeatureFlag.ts
|
|
1264
|
-
var import_snakeCase = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1265
|
-
module.exports = require__createCompounder()(function(result, word, index) {
|
|
1266
|
-
return result + (index ? "_" : "") + word.toLowerCase();
|
|
1267
|
-
});
|
|
1268
|
-
})))(), 1);
|
|
1269
|
-
var getFeatureFlagNYI = async (_flag) => {};
|
|
1270
|
-
var getFeatureFlag = async (flag) => {
|
|
1271
|
-
const envKey = `RB_PUBLIC_FLAG_${(0, import_snakeCase.default)(flag).toUpperCase()}`;
|
|
1272
|
-
if (env.SSR) {
|
|
1273
|
-
if (process.env[envKey] !== void 0) return process.env[envKey];
|
|
1274
|
-
return await getFeatureFlagNYI(flag);
|
|
1275
|
-
} else {
|
|
1276
|
-
if (globalThis.__rb_env__[envKey] !== void 0) return globalThis.__rb_env__[envKey];
|
|
1277
|
-
return await getFeatureFlagNYI(flag);
|
|
1278
|
-
}
|
|
1279
|
-
};
|
|
1280
|
-
//#endregion
|
|
1281
|
-
//#region src/utils/useApplyScroll.ts
|
|
820
|
+
const applyLoaderTimeouts = (routes) => {
|
|
821
|
+
routes.forEach((route) => {
|
|
822
|
+
if (typeof route.loader === "function") {
|
|
823
|
+
route.loader = wrapLoaderWithTimeout(route.loader, route.id);
|
|
824
|
+
}
|
|
825
|
+
if (typeof route.lazy === "function") {
|
|
826
|
+
const origLazy = route.lazy;
|
|
827
|
+
route.lazy = async (...lazyArgs) => {
|
|
828
|
+
const mod = await origLazy(...lazyArgs);
|
|
829
|
+
if (typeof mod.loader === "function") {
|
|
830
|
+
const origLoader = mod.loader;
|
|
831
|
+
mod.loader = (...loaderArgs) => wrapLoaderWithTimeout(origLoader, route.id)(...loaderArgs);
|
|
832
|
+
}
|
|
833
|
+
return mod;
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
if (route.children) {
|
|
837
|
+
applyLoaderTimeouts(route.children);
|
|
838
|
+
}
|
|
839
|
+
});
|
|
840
|
+
};
|
|
841
|
+
const resolveLazyRoute = async (route) => {
|
|
842
|
+
const lazy2 = route.lazy;
|
|
843
|
+
if (typeof lazy2 !== "function") return;
|
|
844
|
+
const lazyModule = await lazy2();
|
|
845
|
+
if (!lazyModule || typeof lazyModule !== "object") {
|
|
846
|
+
route.lazy = void 0;
|
|
847
|
+
return;
|
|
848
|
+
}
|
|
849
|
+
const mutableRoute = route;
|
|
850
|
+
for (const [key, value] of Object.entries(lazyModule)) {
|
|
851
|
+
if (IMMUTABLE_LAZY_ROUTE_KEYS.has(key)) continue;
|
|
852
|
+
if (mutableRoute[key] !== void 0) continue;
|
|
853
|
+
mutableRoute[key] = value;
|
|
854
|
+
}
|
|
855
|
+
route.lazy = void 0;
|
|
856
|
+
};
|
|
857
|
+
const preloadMatchedLazyRoutes = async (routes) => {
|
|
858
|
+
const matches = matchRoutes(routes, {
|
|
859
|
+
pathname: window.location.pathname,
|
|
860
|
+
search: window.location.search,
|
|
861
|
+
hash: window.location.hash
|
|
862
|
+
});
|
|
863
|
+
if (!matches?.length) return;
|
|
864
|
+
await Promise.all(matches.map((match) => resolveLazyRoute(match.route)));
|
|
865
|
+
};
|
|
866
|
+
const getRootElement = () => {
|
|
867
|
+
const el = document.getElementById("root");
|
|
868
|
+
if (!el) {
|
|
869
|
+
throw new Error("Root element #root not found");
|
|
870
|
+
}
|
|
871
|
+
return el;
|
|
872
|
+
};
|
|
873
|
+
const hydrateSsrFallbackIfPresent = (rootElement, renderErrorExtra) => {
|
|
874
|
+
const ssrErrorState = peekClientSsrErrorState();
|
|
875
|
+
if (!ssrErrorState) {
|
|
876
|
+
return false;
|
|
877
|
+
}
|
|
878
|
+
consumeClientSsrErrorState();
|
|
879
|
+
hydrateRoot(rootElement, /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(SsrErrorFallback, { state: ssrErrorState, renderErrorExtra }) }));
|
|
880
|
+
return true;
|
|
881
|
+
};
|
|
882
|
+
const ClientOnly = (t0) => {
|
|
883
|
+
const $ = c(4);
|
|
884
|
+
const {
|
|
885
|
+
children
|
|
886
|
+
} = t0;
|
|
887
|
+
const [mounted, setMounted] = useState(false);
|
|
888
|
+
let t1;
|
|
889
|
+
let t2;
|
|
890
|
+
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
891
|
+
t1 = () => {
|
|
892
|
+
setMounted(true);
|
|
893
|
+
};
|
|
894
|
+
t2 = [];
|
|
895
|
+
$[0] = t1;
|
|
896
|
+
$[1] = t2;
|
|
897
|
+
} else {
|
|
898
|
+
t1 = $[0];
|
|
899
|
+
t2 = $[1];
|
|
900
|
+
}
|
|
901
|
+
useEffect(t1, t2);
|
|
902
|
+
if (!mounted) {
|
|
903
|
+
return null;
|
|
904
|
+
}
|
|
905
|
+
let t3;
|
|
906
|
+
if ($[2] !== children) {
|
|
907
|
+
t3 = /* @__PURE__ */ jsx(Fragment, { children });
|
|
908
|
+
$[2] = children;
|
|
909
|
+
$[3] = t3;
|
|
910
|
+
} else {
|
|
911
|
+
t3 = $[3];
|
|
912
|
+
}
|
|
913
|
+
return t3;
|
|
914
|
+
};
|
|
915
|
+
const initWithRoutes = async (routesElement, opts) => {
|
|
916
|
+
const rootElement = getRootElement();
|
|
917
|
+
if (hydrateSsrFallbackIfPresent(rootElement, opts?.renderErrorExtra)) {
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
await initApiClient();
|
|
921
|
+
cleanupURL();
|
|
922
|
+
handleServerErrors();
|
|
923
|
+
hydrateRtsFromWindow();
|
|
924
|
+
const routes = createRoutesFromElements(routesElement);
|
|
925
|
+
applyLoaderTimeouts(routes);
|
|
926
|
+
await preloadMatchedLazyRoutes(routes);
|
|
927
|
+
const router = createBrowserRouter(routes, {});
|
|
928
|
+
clearStaticRouterHydrationData();
|
|
929
|
+
installGlobalNavigationGuard(router);
|
|
930
|
+
const toError = (error) => error instanceof Error ? error : new Error(String(error));
|
|
931
|
+
const mentionsHydration = (value, depth = 0) => {
|
|
932
|
+
if (depth > 5) {
|
|
933
|
+
return false;
|
|
934
|
+
}
|
|
935
|
+
if (typeof value === "string") {
|
|
936
|
+
return value.toLowerCase().includes("hydrat");
|
|
937
|
+
}
|
|
938
|
+
if (value instanceof Error) {
|
|
939
|
+
const digest = value.digest;
|
|
940
|
+
const cause = value.cause;
|
|
941
|
+
return mentionsHydration(value.message, depth + 1) || mentionsHydration(digest, depth + 1) || mentionsHydration(cause, depth + 1);
|
|
942
|
+
}
|
|
943
|
+
return false;
|
|
944
|
+
};
|
|
945
|
+
const reactErrorHandler = (reactContext) => (error, errorInfo) => {
|
|
946
|
+
const err = toError(error);
|
|
947
|
+
reportClientException(err, {
|
|
948
|
+
reactContext,
|
|
949
|
+
componentStack: errorInfo?.componentStack
|
|
950
|
+
});
|
|
951
|
+
if (reactContext === "uncaught") {
|
|
952
|
+
console.warn("Uncaught error", err, errorInfo?.componentStack);
|
|
953
|
+
}
|
|
954
|
+
};
|
|
955
|
+
const baseHydrationOptions = {
|
|
956
|
+
identifierPrefix: HYDRATION_IDENTIFIER_PREFIX
|
|
957
|
+
};
|
|
958
|
+
const hydrationOptions = isProduction ? {
|
|
959
|
+
...baseHydrationOptions,
|
|
960
|
+
onUncaughtError: reactErrorHandler("uncaught"),
|
|
961
|
+
onCaughtError: reactErrorHandler("caught"),
|
|
962
|
+
onRecoverableError: reactErrorHandler("recoverable")
|
|
963
|
+
} : opts?.devThrowsOnHydrationErrors ? {
|
|
964
|
+
...baseHydrationOptions,
|
|
965
|
+
onRecoverableError(error, errorInfo) {
|
|
966
|
+
const err = toError(error);
|
|
967
|
+
if (mentionsHydration(err) || mentionsHydration(errorInfo?.componentStack)) {
|
|
968
|
+
throw err;
|
|
969
|
+
}
|
|
970
|
+
console.error(err, errorInfo?.componentStack);
|
|
971
|
+
}
|
|
972
|
+
} : baseHydrationOptions;
|
|
973
|
+
hydrateRoot(rootElement, /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
974
|
+
/* @__PURE__ */ jsx(RouterProvider, { router }),
|
|
975
|
+
/* @__PURE__ */ jsx(ClientOnly, { children: /* @__PURE__ */ jsx(Toaster, {}) })
|
|
976
|
+
] }) }), hydrationOptions);
|
|
977
|
+
};
|
|
978
|
+
if (!isProduction && !env.SSR && isDesktopDevice() && !isPlaywrightTestEnvironment()) {
|
|
979
|
+
import("react-grab/core").then(({
|
|
980
|
+
init
|
|
981
|
+
}) => {
|
|
982
|
+
init({
|
|
983
|
+
// theme: { hue: 350 }
|
|
984
|
+
});
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
var _arrayReduce;
|
|
988
|
+
var hasRequired_arrayReduce;
|
|
989
|
+
function require_arrayReduce() {
|
|
990
|
+
if (hasRequired_arrayReduce) return _arrayReduce;
|
|
991
|
+
hasRequired_arrayReduce = 1;
|
|
992
|
+
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
993
|
+
var index = -1, length = array == null ? 0 : array.length;
|
|
994
|
+
if (initAccum && length) {
|
|
995
|
+
accumulator = array[++index];
|
|
996
|
+
}
|
|
997
|
+
while (++index < length) {
|
|
998
|
+
accumulator = iteratee(accumulator, array[index], index, array);
|
|
999
|
+
}
|
|
1000
|
+
return accumulator;
|
|
1001
|
+
}
|
|
1002
|
+
_arrayReduce = arrayReduce;
|
|
1003
|
+
return _arrayReduce;
|
|
1004
|
+
}
|
|
1005
|
+
var _basePropertyOf;
|
|
1006
|
+
var hasRequired_basePropertyOf;
|
|
1007
|
+
function require_basePropertyOf() {
|
|
1008
|
+
if (hasRequired_basePropertyOf) return _basePropertyOf;
|
|
1009
|
+
hasRequired_basePropertyOf = 1;
|
|
1010
|
+
function basePropertyOf(object) {
|
|
1011
|
+
return function(key) {
|
|
1012
|
+
return object == null ? void 0 : object[key];
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
_basePropertyOf = basePropertyOf;
|
|
1016
|
+
return _basePropertyOf;
|
|
1017
|
+
}
|
|
1018
|
+
var _deburrLetter;
|
|
1019
|
+
var hasRequired_deburrLetter;
|
|
1020
|
+
function require_deburrLetter() {
|
|
1021
|
+
if (hasRequired_deburrLetter) return _deburrLetter;
|
|
1022
|
+
hasRequired_deburrLetter = 1;
|
|
1023
|
+
var basePropertyOf = require_basePropertyOf();
|
|
1024
|
+
var deburredLetters = {
|
|
1025
|
+
// Latin-1 Supplement block.
|
|
1026
|
+
"À": "A",
|
|
1027
|
+
"Á": "A",
|
|
1028
|
+
"Â": "A",
|
|
1029
|
+
"Ã": "A",
|
|
1030
|
+
"Ä": "A",
|
|
1031
|
+
"Å": "A",
|
|
1032
|
+
"à": "a",
|
|
1033
|
+
"á": "a",
|
|
1034
|
+
"â": "a",
|
|
1035
|
+
"ã": "a",
|
|
1036
|
+
"ä": "a",
|
|
1037
|
+
"å": "a",
|
|
1038
|
+
"Ç": "C",
|
|
1039
|
+
"ç": "c",
|
|
1040
|
+
"Ð": "D",
|
|
1041
|
+
"ð": "d",
|
|
1042
|
+
"È": "E",
|
|
1043
|
+
"É": "E",
|
|
1044
|
+
"Ê": "E",
|
|
1045
|
+
"Ë": "E",
|
|
1046
|
+
"è": "e",
|
|
1047
|
+
"é": "e",
|
|
1048
|
+
"ê": "e",
|
|
1049
|
+
"ë": "e",
|
|
1050
|
+
"Ì": "I",
|
|
1051
|
+
"Í": "I",
|
|
1052
|
+
"Î": "I",
|
|
1053
|
+
"Ï": "I",
|
|
1054
|
+
"ì": "i",
|
|
1055
|
+
"í": "i",
|
|
1056
|
+
"î": "i",
|
|
1057
|
+
"ï": "i",
|
|
1058
|
+
"Ñ": "N",
|
|
1059
|
+
"ñ": "n",
|
|
1060
|
+
"Ò": "O",
|
|
1061
|
+
"Ó": "O",
|
|
1062
|
+
"Ô": "O",
|
|
1063
|
+
"Õ": "O",
|
|
1064
|
+
"Ö": "O",
|
|
1065
|
+
"Ø": "O",
|
|
1066
|
+
"ò": "o",
|
|
1067
|
+
"ó": "o",
|
|
1068
|
+
"ô": "o",
|
|
1069
|
+
"õ": "o",
|
|
1070
|
+
"ö": "o",
|
|
1071
|
+
"ø": "o",
|
|
1072
|
+
"Ù": "U",
|
|
1073
|
+
"Ú": "U",
|
|
1074
|
+
"Û": "U",
|
|
1075
|
+
"Ü": "U",
|
|
1076
|
+
"ù": "u",
|
|
1077
|
+
"ú": "u",
|
|
1078
|
+
"û": "u",
|
|
1079
|
+
"ü": "u",
|
|
1080
|
+
"Ý": "Y",
|
|
1081
|
+
"ý": "y",
|
|
1082
|
+
"ÿ": "y",
|
|
1083
|
+
"Æ": "Ae",
|
|
1084
|
+
"æ": "ae",
|
|
1085
|
+
"Þ": "Th",
|
|
1086
|
+
"þ": "th",
|
|
1087
|
+
"ß": "ss",
|
|
1088
|
+
// Latin Extended-A block.
|
|
1089
|
+
"Ā": "A",
|
|
1090
|
+
"Ă": "A",
|
|
1091
|
+
"Ą": "A",
|
|
1092
|
+
"ā": "a",
|
|
1093
|
+
"ă": "a",
|
|
1094
|
+
"ą": "a",
|
|
1095
|
+
"Ć": "C",
|
|
1096
|
+
"Ĉ": "C",
|
|
1097
|
+
"Ċ": "C",
|
|
1098
|
+
"Č": "C",
|
|
1099
|
+
"ć": "c",
|
|
1100
|
+
"ĉ": "c",
|
|
1101
|
+
"ċ": "c",
|
|
1102
|
+
"č": "c",
|
|
1103
|
+
"Ď": "D",
|
|
1104
|
+
"Đ": "D",
|
|
1105
|
+
"ď": "d",
|
|
1106
|
+
"đ": "d",
|
|
1107
|
+
"Ē": "E",
|
|
1108
|
+
"Ĕ": "E",
|
|
1109
|
+
"Ė": "E",
|
|
1110
|
+
"Ę": "E",
|
|
1111
|
+
"Ě": "E",
|
|
1112
|
+
"ē": "e",
|
|
1113
|
+
"ĕ": "e",
|
|
1114
|
+
"ė": "e",
|
|
1115
|
+
"ę": "e",
|
|
1116
|
+
"ě": "e",
|
|
1117
|
+
"Ĝ": "G",
|
|
1118
|
+
"Ğ": "G",
|
|
1119
|
+
"Ġ": "G",
|
|
1120
|
+
"Ģ": "G",
|
|
1121
|
+
"ĝ": "g",
|
|
1122
|
+
"ğ": "g",
|
|
1123
|
+
"ġ": "g",
|
|
1124
|
+
"ģ": "g",
|
|
1125
|
+
"Ĥ": "H",
|
|
1126
|
+
"Ħ": "H",
|
|
1127
|
+
"ĥ": "h",
|
|
1128
|
+
"ħ": "h",
|
|
1129
|
+
"Ĩ": "I",
|
|
1130
|
+
"Ī": "I",
|
|
1131
|
+
"Ĭ": "I",
|
|
1132
|
+
"Į": "I",
|
|
1133
|
+
"İ": "I",
|
|
1134
|
+
"ĩ": "i",
|
|
1135
|
+
"ī": "i",
|
|
1136
|
+
"ĭ": "i",
|
|
1137
|
+
"į": "i",
|
|
1138
|
+
"ı": "i",
|
|
1139
|
+
"Ĵ": "J",
|
|
1140
|
+
"ĵ": "j",
|
|
1141
|
+
"Ķ": "K",
|
|
1142
|
+
"ķ": "k",
|
|
1143
|
+
"ĸ": "k",
|
|
1144
|
+
"Ĺ": "L",
|
|
1145
|
+
"Ļ": "L",
|
|
1146
|
+
"Ľ": "L",
|
|
1147
|
+
"Ŀ": "L",
|
|
1148
|
+
"Ł": "L",
|
|
1149
|
+
"ĺ": "l",
|
|
1150
|
+
"ļ": "l",
|
|
1151
|
+
"ľ": "l",
|
|
1152
|
+
"ŀ": "l",
|
|
1153
|
+
"ł": "l",
|
|
1154
|
+
"Ń": "N",
|
|
1155
|
+
"Ņ": "N",
|
|
1156
|
+
"Ň": "N",
|
|
1157
|
+
"Ŋ": "N",
|
|
1158
|
+
"ń": "n",
|
|
1159
|
+
"ņ": "n",
|
|
1160
|
+
"ň": "n",
|
|
1161
|
+
"ŋ": "n",
|
|
1162
|
+
"Ō": "O",
|
|
1163
|
+
"Ŏ": "O",
|
|
1164
|
+
"Ő": "O",
|
|
1165
|
+
"ō": "o",
|
|
1166
|
+
"ŏ": "o",
|
|
1167
|
+
"ő": "o",
|
|
1168
|
+
"Ŕ": "R",
|
|
1169
|
+
"Ŗ": "R",
|
|
1170
|
+
"Ř": "R",
|
|
1171
|
+
"ŕ": "r",
|
|
1172
|
+
"ŗ": "r",
|
|
1173
|
+
"ř": "r",
|
|
1174
|
+
"Ś": "S",
|
|
1175
|
+
"Ŝ": "S",
|
|
1176
|
+
"Ş": "S",
|
|
1177
|
+
"Š": "S",
|
|
1178
|
+
"ś": "s",
|
|
1179
|
+
"ŝ": "s",
|
|
1180
|
+
"ş": "s",
|
|
1181
|
+
"š": "s",
|
|
1182
|
+
"Ţ": "T",
|
|
1183
|
+
"Ť": "T",
|
|
1184
|
+
"Ŧ": "T",
|
|
1185
|
+
"ţ": "t",
|
|
1186
|
+
"ť": "t",
|
|
1187
|
+
"ŧ": "t",
|
|
1188
|
+
"Ũ": "U",
|
|
1189
|
+
"Ū": "U",
|
|
1190
|
+
"Ŭ": "U",
|
|
1191
|
+
"Ů": "U",
|
|
1192
|
+
"Ű": "U",
|
|
1193
|
+
"Ų": "U",
|
|
1194
|
+
"ũ": "u",
|
|
1195
|
+
"ū": "u",
|
|
1196
|
+
"ŭ": "u",
|
|
1197
|
+
"ů": "u",
|
|
1198
|
+
"ű": "u",
|
|
1199
|
+
"ų": "u",
|
|
1200
|
+
"Ŵ": "W",
|
|
1201
|
+
"ŵ": "w",
|
|
1202
|
+
"Ŷ": "Y",
|
|
1203
|
+
"ŷ": "y",
|
|
1204
|
+
"Ÿ": "Y",
|
|
1205
|
+
"Ź": "Z",
|
|
1206
|
+
"Ż": "Z",
|
|
1207
|
+
"Ž": "Z",
|
|
1208
|
+
"ź": "z",
|
|
1209
|
+
"ż": "z",
|
|
1210
|
+
"ž": "z",
|
|
1211
|
+
"IJ": "IJ",
|
|
1212
|
+
"ij": "ij",
|
|
1213
|
+
"Œ": "Oe",
|
|
1214
|
+
"œ": "oe",
|
|
1215
|
+
"ʼn": "'n",
|
|
1216
|
+
"ſ": "s"
|
|
1217
|
+
};
|
|
1218
|
+
var deburrLetter = basePropertyOf(deburredLetters);
|
|
1219
|
+
_deburrLetter = deburrLetter;
|
|
1220
|
+
return _deburrLetter;
|
|
1221
|
+
}
|
|
1222
|
+
var deburr_1;
|
|
1223
|
+
var hasRequiredDeburr;
|
|
1224
|
+
function requireDeburr() {
|
|
1225
|
+
if (hasRequiredDeburr) return deburr_1;
|
|
1226
|
+
hasRequiredDeburr = 1;
|
|
1227
|
+
var deburrLetter = require_deburrLetter(), toString2 = requireToString();
|
|
1228
|
+
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
1229
|
+
var rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
|
1230
|
+
var rsCombo = "[" + rsComboRange + "]";
|
|
1231
|
+
var reComboMark = RegExp(rsCombo, "g");
|
|
1232
|
+
function deburr(string) {
|
|
1233
|
+
string = toString2(string);
|
|
1234
|
+
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
|
|
1235
|
+
}
|
|
1236
|
+
deburr_1 = deburr;
|
|
1237
|
+
return deburr_1;
|
|
1238
|
+
}
|
|
1239
|
+
var _asciiWords;
|
|
1240
|
+
var hasRequired_asciiWords;
|
|
1241
|
+
function require_asciiWords() {
|
|
1242
|
+
if (hasRequired_asciiWords) return _asciiWords;
|
|
1243
|
+
hasRequired_asciiWords = 1;
|
|
1244
|
+
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
1245
|
+
function asciiWords(string) {
|
|
1246
|
+
return string.match(reAsciiWord) || [];
|
|
1247
|
+
}
|
|
1248
|
+
_asciiWords = asciiWords;
|
|
1249
|
+
return _asciiWords;
|
|
1250
|
+
}
|
|
1251
|
+
var _hasUnicodeWord;
|
|
1252
|
+
var hasRequired_hasUnicodeWord;
|
|
1253
|
+
function require_hasUnicodeWord() {
|
|
1254
|
+
if (hasRequired_hasUnicodeWord) return _hasUnicodeWord;
|
|
1255
|
+
hasRequired_hasUnicodeWord = 1;
|
|
1256
|
+
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
|
1257
|
+
function hasUnicodeWord(string) {
|
|
1258
|
+
return reHasUnicodeWord.test(string);
|
|
1259
|
+
}
|
|
1260
|
+
_hasUnicodeWord = hasUnicodeWord;
|
|
1261
|
+
return _hasUnicodeWord;
|
|
1262
|
+
}
|
|
1263
|
+
var _unicodeWords;
|
|
1264
|
+
var hasRequired_unicodeWords;
|
|
1265
|
+
function require_unicodeWords() {
|
|
1266
|
+
if (hasRequired_unicodeWords) return _unicodeWords;
|
|
1267
|
+
hasRequired_unicodeWords = 1;
|
|
1268
|
+
var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
1269
|
+
var rsApos = "['’]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
|
|
1270
|
+
var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq;
|
|
1271
|
+
var reUnicodeWord = RegExp([
|
|
1272
|
+
rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
|
|
1273
|
+
rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
|
|
1274
|
+
rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
|
|
1275
|
+
rsUpper + "+" + rsOptContrUpper,
|
|
1276
|
+
rsOrdUpper,
|
|
1277
|
+
rsOrdLower,
|
|
1278
|
+
rsDigits,
|
|
1279
|
+
rsEmoji
|
|
1280
|
+
].join("|"), "g");
|
|
1281
|
+
function unicodeWords(string) {
|
|
1282
|
+
return string.match(reUnicodeWord) || [];
|
|
1283
|
+
}
|
|
1284
|
+
_unicodeWords = unicodeWords;
|
|
1285
|
+
return _unicodeWords;
|
|
1286
|
+
}
|
|
1287
|
+
var words_1;
|
|
1288
|
+
var hasRequiredWords;
|
|
1289
|
+
function requireWords() {
|
|
1290
|
+
if (hasRequiredWords) return words_1;
|
|
1291
|
+
hasRequiredWords = 1;
|
|
1292
|
+
var asciiWords = require_asciiWords(), hasUnicodeWord = require_hasUnicodeWord(), toString2 = requireToString(), unicodeWords = require_unicodeWords();
|
|
1293
|
+
function words(string, pattern, guard) {
|
|
1294
|
+
string = toString2(string);
|
|
1295
|
+
pattern = guard ? void 0 : pattern;
|
|
1296
|
+
if (pattern === void 0) {
|
|
1297
|
+
return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
|
|
1298
|
+
}
|
|
1299
|
+
return string.match(pattern) || [];
|
|
1300
|
+
}
|
|
1301
|
+
words_1 = words;
|
|
1302
|
+
return words_1;
|
|
1303
|
+
}
|
|
1304
|
+
var _createCompounder;
|
|
1305
|
+
var hasRequired_createCompounder;
|
|
1306
|
+
function require_createCompounder() {
|
|
1307
|
+
if (hasRequired_createCompounder) return _createCompounder;
|
|
1308
|
+
hasRequired_createCompounder = 1;
|
|
1309
|
+
var arrayReduce = require_arrayReduce(), deburr = requireDeburr(), words = requireWords();
|
|
1310
|
+
var rsApos = "['’]";
|
|
1311
|
+
var reApos = RegExp(rsApos, "g");
|
|
1312
|
+
function createCompounder(callback) {
|
|
1313
|
+
return function(string) {
|
|
1314
|
+
return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1317
|
+
_createCompounder = createCompounder;
|
|
1318
|
+
return _createCompounder;
|
|
1319
|
+
}
|
|
1320
|
+
var snakeCase_1;
|
|
1321
|
+
var hasRequiredSnakeCase;
|
|
1322
|
+
function requireSnakeCase() {
|
|
1323
|
+
if (hasRequiredSnakeCase) return snakeCase_1;
|
|
1324
|
+
hasRequiredSnakeCase = 1;
|
|
1325
|
+
var createCompounder = require_createCompounder();
|
|
1326
|
+
var snakeCase = createCompounder(function(result, word, index) {
|
|
1327
|
+
return result + (index ? "_" : "") + word.toLowerCase();
|
|
1328
|
+
});
|
|
1329
|
+
snakeCase_1 = snakeCase;
|
|
1330
|
+
return snakeCase_1;
|
|
1331
|
+
}
|
|
1332
|
+
var snakeCaseExports = requireSnakeCase();
|
|
1333
|
+
const _snakeCase = /* @__PURE__ */ getDefaultExportFromCjs(snakeCaseExports);
|
|
1334
|
+
const getFeatureFlagNYI = async (_flag) => {
|
|
1335
|
+
return void 0;
|
|
1336
|
+
};
|
|
1337
|
+
const getFeatureFlag = async (flag) => {
|
|
1338
|
+
const envKey = `RB_PUBLIC_FLAG_${_snakeCase(flag).toUpperCase()}`;
|
|
1339
|
+
if (env.SSR) {
|
|
1340
|
+
if (process.env[envKey] !== void 0) {
|
|
1341
|
+
return process.env[envKey];
|
|
1342
|
+
}
|
|
1343
|
+
return await getFeatureFlagNYI();
|
|
1344
|
+
} else {
|
|
1345
|
+
if (globalThis.__rb_env__[envKey] !== void 0) {
|
|
1346
|
+
return globalThis.__rb_env__[envKey];
|
|
1347
|
+
}
|
|
1348
|
+
return await getFeatureFlagNYI();
|
|
1349
|
+
}
|
|
1350
|
+
};
|
|
1282
1351
|
function throttle(callback, limit) {
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1352
|
+
let wait = false;
|
|
1353
|
+
return (...args) => {
|
|
1354
|
+
if (!wait) {
|
|
1355
|
+
callback(...args);
|
|
1356
|
+
wait = true;
|
|
1357
|
+
setTimeout(() => {
|
|
1358
|
+
wait = false;
|
|
1359
|
+
}, limit);
|
|
1360
|
+
}
|
|
1361
|
+
};
|
|
1293
1362
|
}
|
|
1294
1363
|
function useApplyScroll() {
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1364
|
+
const $ = c(17);
|
|
1365
|
+
const location = useLocation();
|
|
1366
|
+
const previousPathRef = useRef(location.pathname);
|
|
1367
|
+
const hasAppliedLocationRef = useRef(false);
|
|
1368
|
+
const isScrollingProgrammatically = useRef(false);
|
|
1369
|
+
const scrollTimeoutRef = useRef(null);
|
|
1370
|
+
const lastAppliedHashRef = useRef("");
|
|
1371
|
+
let t0;
|
|
1372
|
+
let t1;
|
|
1373
|
+
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
1374
|
+
t0 = () => {
|
|
1375
|
+
if (typeof window !== "undefined") {
|
|
1376
|
+
lastAppliedHashRef.current = window.location.hash || "";
|
|
1377
|
+
}
|
|
1378
|
+
};
|
|
1379
|
+
t1 = [];
|
|
1380
|
+
$[0] = t0;
|
|
1381
|
+
$[1] = t1;
|
|
1382
|
+
} else {
|
|
1383
|
+
t0 = $[0];
|
|
1384
|
+
t1 = $[1];
|
|
1385
|
+
}
|
|
1386
|
+
useEffect(t0, t1);
|
|
1387
|
+
let t2;
|
|
1388
|
+
let t3;
|
|
1389
|
+
if ($[2] !== location.hash) {
|
|
1390
|
+
t2 = () => {
|
|
1391
|
+
lastAppliedHashRef.current = location.hash || "";
|
|
1392
|
+
};
|
|
1393
|
+
t3 = [location.hash];
|
|
1394
|
+
$[2] = location.hash;
|
|
1395
|
+
$[3] = t2;
|
|
1396
|
+
$[4] = t3;
|
|
1397
|
+
} else {
|
|
1398
|
+
t2 = $[3];
|
|
1399
|
+
t3 = $[4];
|
|
1400
|
+
}
|
|
1401
|
+
useEffect(t2, t3);
|
|
1402
|
+
let t4;
|
|
1403
|
+
if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
1404
|
+
t4 = (hash) => {
|
|
1405
|
+
if (typeof window === "undefined") {
|
|
1406
|
+
return;
|
|
1407
|
+
}
|
|
1408
|
+
if (lastAppliedHashRef.current === hash) {
|
|
1409
|
+
return;
|
|
1410
|
+
}
|
|
1411
|
+
const base = `${window.location.pathname}${window.location.search}`;
|
|
1412
|
+
window.history.replaceState(window.history.state, "", `${base}${hash}`);
|
|
1413
|
+
lastAppliedHashRef.current = hash;
|
|
1414
|
+
};
|
|
1415
|
+
$[5] = t4;
|
|
1416
|
+
} else {
|
|
1417
|
+
t4 = $[5];
|
|
1418
|
+
}
|
|
1419
|
+
const replaceHashSilently = t4;
|
|
1420
|
+
let t5;
|
|
1421
|
+
if ($[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
1422
|
+
t5 = () => {
|
|
1423
|
+
isScrollingProgrammatically.current = true;
|
|
1424
|
+
if (scrollTimeoutRef.current) {
|
|
1425
|
+
clearTimeout(scrollTimeoutRef.current);
|
|
1426
|
+
}
|
|
1427
|
+
scrollTimeoutRef.current = setTimeout(() => {
|
|
1428
|
+
isScrollingProgrammatically.current = false;
|
|
1429
|
+
}, 1e3);
|
|
1430
|
+
};
|
|
1431
|
+
$[6] = t5;
|
|
1432
|
+
} else {
|
|
1433
|
+
t5 = $[6];
|
|
1434
|
+
}
|
|
1435
|
+
const markProgrammaticScroll = t5;
|
|
1436
|
+
let t6;
|
|
1437
|
+
let t7;
|
|
1438
|
+
if ($[7] !== location.hash || $[8] !== location.pathname) {
|
|
1439
|
+
t6 = () => {
|
|
1440
|
+
const isInitialLocation = !hasAppliedLocationRef.current;
|
|
1441
|
+
hasAppliedLocationRef.current = true;
|
|
1442
|
+
const pathChanged = previousPathRef.current !== location.pathname;
|
|
1443
|
+
const applyHashScroll = (behavior) => {
|
|
1444
|
+
const id = location.hash.substring(1);
|
|
1445
|
+
const element = document.getElementById(id);
|
|
1446
|
+
if (!element) {
|
|
1447
|
+
return;
|
|
1448
|
+
}
|
|
1449
|
+
markProgrammaticScroll();
|
|
1450
|
+
element.scrollIntoView({
|
|
1451
|
+
behavior
|
|
1452
|
+
});
|
|
1453
|
+
};
|
|
1454
|
+
if (pathChanged) {
|
|
1455
|
+
previousPathRef.current = location.pathname;
|
|
1456
|
+
if (!location.hash) {
|
|
1457
|
+
window.scrollTo({
|
|
1458
|
+
top: 0,
|
|
1459
|
+
left: 0,
|
|
1460
|
+
behavior: "auto"
|
|
1461
|
+
});
|
|
1462
|
+
return;
|
|
1463
|
+
}
|
|
1464
|
+
setTimeout(() => {
|
|
1465
|
+
applyHashScroll("auto");
|
|
1466
|
+
}, 100);
|
|
1467
|
+
return;
|
|
1468
|
+
}
|
|
1469
|
+
if (!location.hash) {
|
|
1470
|
+
return;
|
|
1471
|
+
}
|
|
1472
|
+
applyHashScroll(isInitialLocation ? "auto" : "smooth");
|
|
1473
|
+
};
|
|
1474
|
+
t7 = [location.hash, location.pathname, markProgrammaticScroll];
|
|
1475
|
+
$[7] = location.hash;
|
|
1476
|
+
$[8] = location.pathname;
|
|
1477
|
+
$[9] = t6;
|
|
1478
|
+
$[10] = t7;
|
|
1479
|
+
} else {
|
|
1480
|
+
t6 = $[9];
|
|
1481
|
+
t7 = $[10];
|
|
1482
|
+
}
|
|
1483
|
+
useEffect(t6, t7);
|
|
1484
|
+
let t8;
|
|
1485
|
+
let t9;
|
|
1486
|
+
if ($[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
1487
|
+
t8 = () => {
|
|
1488
|
+
if (typeof window === "undefined") {
|
|
1489
|
+
return;
|
|
1490
|
+
}
|
|
1491
|
+
const handleScroll = throttle(() => {
|
|
1492
|
+
if (isScrollingProgrammatically.current) {
|
|
1493
|
+
return;
|
|
1494
|
+
}
|
|
1495
|
+
const sections = Array.from(document.querySelectorAll("section[id]"));
|
|
1496
|
+
if (sections.length === 0) {
|
|
1497
|
+
replaceHashSilently("");
|
|
1498
|
+
return;
|
|
1499
|
+
}
|
|
1500
|
+
const scrollPosition = window.scrollY;
|
|
1501
|
+
const viewportHeight = window.innerHeight;
|
|
1502
|
+
const checkPoint = scrollPosition + viewportHeight / 3;
|
|
1503
|
+
let activeSectionId = null;
|
|
1504
|
+
for (const section of sections) {
|
|
1505
|
+
if (section.offsetTop <= checkPoint && section.offsetTop + section.offsetHeight > checkPoint) {
|
|
1506
|
+
activeSectionId = section.id;
|
|
1507
|
+
break;
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
const newHash = activeSectionId ? `#${activeSectionId}` : "";
|
|
1511
|
+
replaceHashSilently(newHash);
|
|
1512
|
+
}, 150);
|
|
1513
|
+
document.addEventListener("scroll", handleScroll);
|
|
1514
|
+
return () => {
|
|
1515
|
+
document.removeEventListener("scroll", handleScroll);
|
|
1516
|
+
if (scrollTimeoutRef.current) {
|
|
1517
|
+
clearTimeout(scrollTimeoutRef.current);
|
|
1518
|
+
scrollTimeoutRef.current = null;
|
|
1519
|
+
}
|
|
1520
|
+
};
|
|
1521
|
+
};
|
|
1522
|
+
t9 = [replaceHashSilently];
|
|
1523
|
+
$[11] = t8;
|
|
1524
|
+
$[12] = t9;
|
|
1525
|
+
} else {
|
|
1526
|
+
t8 = $[11];
|
|
1527
|
+
t9 = $[12];
|
|
1528
|
+
}
|
|
1529
|
+
useEffect(t8, t9);
|
|
1530
|
+
let t10;
|
|
1531
|
+
let t11;
|
|
1532
|
+
if ($[13] !== location.hash || $[14] !== location.pathname) {
|
|
1533
|
+
t10 = () => {
|
|
1534
|
+
const handleClick = (event) => {
|
|
1535
|
+
const target = event.target;
|
|
1536
|
+
const link = target?.closest("a");
|
|
1537
|
+
const currentHash = typeof window !== "undefined" ? window.location.hash : location.hash || "";
|
|
1538
|
+
if (!link || !link.hash || link.pathname !== location.pathname || link.hash !== currentHash) {
|
|
1539
|
+
return;
|
|
1540
|
+
}
|
|
1541
|
+
const id_0 = link.hash.substring(1);
|
|
1542
|
+
const element_0 = document.getElementById(id_0);
|
|
1543
|
+
if (element_0) {
|
|
1544
|
+
event.preventDefault();
|
|
1545
|
+
event.stopPropagation();
|
|
1546
|
+
markProgrammaticScroll();
|
|
1547
|
+
element_0.scrollIntoView({
|
|
1548
|
+
behavior: "smooth"
|
|
1549
|
+
});
|
|
1550
|
+
}
|
|
1551
|
+
};
|
|
1552
|
+
document.addEventListener("click", handleClick, true);
|
|
1553
|
+
return () => document.removeEventListener("click", handleClick, true);
|
|
1554
|
+
};
|
|
1555
|
+
t11 = [location.hash, location.pathname, markProgrammaticScroll];
|
|
1556
|
+
$[13] = location.hash;
|
|
1557
|
+
$[14] = location.pathname;
|
|
1558
|
+
$[15] = t10;
|
|
1559
|
+
$[16] = t11;
|
|
1560
|
+
} else {
|
|
1561
|
+
t10 = $[15];
|
|
1562
|
+
t11 = $[16];
|
|
1563
|
+
}
|
|
1564
|
+
useEffect(t10, t11);
|
|
1472
1565
|
}
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
};
|
|
1494
|
-
|
|
1495
|
-
//#region ../../node_modules/fast-equals/dist/es/index.mjs
|
|
1496
|
-
var import_throttle = /* @__PURE__ */ __toESM(require_throttle(), 1);
|
|
1497
|
-
var { getOwnPropertyNames, getOwnPropertySymbols } = Object;
|
|
1498
|
-
var { hasOwnProperty } = Object.prototype;
|
|
1499
|
-
/**
|
|
1500
|
-
* Combine two comparators into a single comparators.
|
|
1501
|
-
*/
|
|
1566
|
+
const RootProvider = (t0) => {
|
|
1567
|
+
const $ = c(4);
|
|
1568
|
+
const {
|
|
1569
|
+
children,
|
|
1570
|
+
routePrefetch
|
|
1571
|
+
} = t0;
|
|
1572
|
+
useApplyScroll();
|
|
1573
|
+
const t1 = routePrefetch?.defaultPrefetch ?? "intent";
|
|
1574
|
+
let t2;
|
|
1575
|
+
if ($[0] !== children || $[1] !== routePrefetch || $[2] !== t1) {
|
|
1576
|
+
t2 = /* @__PURE__ */ jsx(RoutePrefetchProvider, { ...routePrefetch, defaultPrefetch: t1, children });
|
|
1577
|
+
$[0] = children;
|
|
1578
|
+
$[1] = routePrefetch;
|
|
1579
|
+
$[2] = t1;
|
|
1580
|
+
$[3] = t2;
|
|
1581
|
+
} else {
|
|
1582
|
+
t2 = $[3];
|
|
1583
|
+
}
|
|
1584
|
+
return t2;
|
|
1585
|
+
};
|
|
1586
|
+
const { getOwnPropertyNames, getOwnPropertySymbols } = Object;
|
|
1587
|
+
const { hasOwnProperty } = Object.prototype;
|
|
1502
1588
|
function combineComparators(comparatorA, comparatorB) {
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1589
|
+
return function isEqual(a2, b2, state) {
|
|
1590
|
+
return comparatorA(a2, b2, state) && comparatorB(a2, b2, state);
|
|
1591
|
+
};
|
|
1506
1592
|
}
|
|
1507
|
-
/**
|
|
1508
|
-
* Wrap the provided `areItemsEqual` method to manage the circular state, allowing
|
|
1509
|
-
* for circular references to be safely included in the comparison without creating
|
|
1510
|
-
* stack overflows.
|
|
1511
|
-
*/
|
|
1512
1593
|
function createIsCircular(areItemsEqual) {
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1594
|
+
return function isCircular(a2, b2, state) {
|
|
1595
|
+
if (!a2 || !b2 || typeof a2 !== "object" || typeof b2 !== "object") {
|
|
1596
|
+
return areItemsEqual(a2, b2, state);
|
|
1597
|
+
}
|
|
1598
|
+
const { cache } = state;
|
|
1599
|
+
const cachedA = cache.get(a2);
|
|
1600
|
+
const cachedB = cache.get(b2);
|
|
1601
|
+
if (cachedA && cachedB) {
|
|
1602
|
+
return cachedA === b2 && cachedB === a2;
|
|
1603
|
+
}
|
|
1604
|
+
cache.set(a2, b2);
|
|
1605
|
+
cache.set(b2, a2);
|
|
1606
|
+
const result = areItemsEqual(a2, b2, state);
|
|
1607
|
+
cache.delete(a2);
|
|
1608
|
+
cache.delete(b2);
|
|
1609
|
+
return result;
|
|
1610
|
+
};
|
|
1526
1611
|
}
|
|
1527
|
-
/**
|
|
1528
|
-
* Get the properties to strictly examine, which include both own properties that are
|
|
1529
|
-
* not enumerable and symbol properties.
|
|
1530
|
-
*/
|
|
1531
1612
|
function getStrictProperties(object) {
|
|
1532
|
-
|
|
1613
|
+
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
|
|
1533
1614
|
}
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
var sameValueEqual = Object.is || function sameValueEqual(a, b) {
|
|
1551
|
-
return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;
|
|
1552
|
-
};
|
|
1553
|
-
/**
|
|
1554
|
-
* Whether the values passed are equal based on a
|
|
1555
|
-
* [Strict Equality Comparison](https://262.ecma-international.org/7.0/#sec-strict-equality-comparison) basis.
|
|
1556
|
-
* Simplified, this maps to if the two values are referentially equal to one another (`a === b`).
|
|
1557
|
-
*
|
|
1558
|
-
* @note
|
|
1559
|
-
* This is mainly available as a convenience function, such as being a default when a function to determine equality between
|
|
1560
|
-
* two objects is used.
|
|
1561
|
-
*/
|
|
1562
|
-
function strictEqual(a, b) {
|
|
1563
|
-
return a === b;
|
|
1615
|
+
const hasOwn = (
|
|
1616
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
1617
|
+
Object.hasOwn || ((object, property) => hasOwnProperty.call(object, property))
|
|
1618
|
+
);
|
|
1619
|
+
const PREACT_VNODE = "__v";
|
|
1620
|
+
const PREACT_OWNER = "__o";
|
|
1621
|
+
const REACT_OWNER = "_owner";
|
|
1622
|
+
const { getOwnPropertyDescriptor, keys } = Object;
|
|
1623
|
+
const sameValueEqual = (
|
|
1624
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
1625
|
+
Object.is || function sameValueEqual2(a2, b2) {
|
|
1626
|
+
return a2 === b2 ? a2 !== 0 || 1 / a2 === 1 / b2 : a2 !== a2 && b2 !== b2;
|
|
1627
|
+
}
|
|
1628
|
+
);
|
|
1629
|
+
function strictEqual(a2, b2) {
|
|
1630
|
+
return a2 === b2;
|
|
1564
1631
|
}
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
*/
|
|
1568
|
-
function areArrayBuffersEqual(a, b) {
|
|
1569
|
-
return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));
|
|
1632
|
+
function areArrayBuffersEqual(a2, b2) {
|
|
1633
|
+
return a2.byteLength === b2.byteLength && areTypedArraysEqual(new Uint8Array(a2), new Uint8Array(b2));
|
|
1570
1634
|
}
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1635
|
+
function areArraysEqual(a2, b2, state) {
|
|
1636
|
+
let index = a2.length;
|
|
1637
|
+
if (b2.length !== index) {
|
|
1638
|
+
return false;
|
|
1639
|
+
}
|
|
1640
|
+
while (index-- > 0) {
|
|
1641
|
+
if (!state.equals(a2[index], b2[index], index, index, a2, b2, state)) {
|
|
1642
|
+
return false;
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
return true;
|
|
1579
1646
|
}
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
*/
|
|
1583
|
-
function areDataViewsEqual(a, b) {
|
|
1584
|
-
return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength));
|
|
1647
|
+
function areDataViewsEqual(a2, b2) {
|
|
1648
|
+
return a2.byteLength === b2.byteLength && areTypedArraysEqual(new Uint8Array(a2.buffer, a2.byteOffset, a2.byteLength), new Uint8Array(b2.buffer, b2.byteOffset, b2.byteLength));
|
|
1585
1649
|
}
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
*/
|
|
1589
|
-
function areDatesEqual(a, b) {
|
|
1590
|
-
return sameValueEqual(a.getTime(), b.getTime());
|
|
1650
|
+
function areDatesEqual(a2, b2) {
|
|
1651
|
+
return sameValueEqual(a2.getTime(), b2.getTime());
|
|
1591
1652
|
}
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
*/
|
|
1595
|
-
function areErrorsEqual(a, b) {
|
|
1596
|
-
return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
|
|
1653
|
+
function areErrorsEqual(a2, b2) {
|
|
1654
|
+
return a2.name === b2.name && a2.message === b2.message && a2.cause === b2.cause && a2.stack === b2.stack;
|
|
1597
1655
|
}
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1656
|
+
function areMapsEqual(a2, b2, state) {
|
|
1657
|
+
const size = a2.size;
|
|
1658
|
+
if (size !== b2.size) {
|
|
1659
|
+
return false;
|
|
1660
|
+
}
|
|
1661
|
+
if (!size) {
|
|
1662
|
+
return true;
|
|
1663
|
+
}
|
|
1664
|
+
const matchedIndices = new Array(size);
|
|
1665
|
+
const aIterable = a2.entries();
|
|
1666
|
+
let aResult;
|
|
1667
|
+
let bResult;
|
|
1668
|
+
let index = 0;
|
|
1669
|
+
while (aResult = aIterable.next()) {
|
|
1670
|
+
if (aResult.done) {
|
|
1671
|
+
break;
|
|
1672
|
+
}
|
|
1673
|
+
const bIterable = b2.entries();
|
|
1674
|
+
let hasMatch = false;
|
|
1675
|
+
let matchIndex = 0;
|
|
1676
|
+
while (bResult = bIterable.next()) {
|
|
1677
|
+
if (bResult.done) {
|
|
1678
|
+
break;
|
|
1679
|
+
}
|
|
1680
|
+
if (matchedIndices[matchIndex]) {
|
|
1681
|
+
matchIndex++;
|
|
1682
|
+
continue;
|
|
1683
|
+
}
|
|
1684
|
+
const aEntry = aResult.value;
|
|
1685
|
+
const bEntry = bResult.value;
|
|
1686
|
+
if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a2, b2, state) && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a2, b2, state)) {
|
|
1687
|
+
hasMatch = matchedIndices[matchIndex] = true;
|
|
1688
|
+
break;
|
|
1689
|
+
}
|
|
1690
|
+
matchIndex++;
|
|
1691
|
+
}
|
|
1692
|
+
if (!hasMatch) {
|
|
1693
|
+
return false;
|
|
1694
|
+
}
|
|
1695
|
+
index++;
|
|
1696
|
+
}
|
|
1697
|
+
return true;
|
|
1633
1698
|
}
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1699
|
+
function areObjectsEqual(a2, b2, state) {
|
|
1700
|
+
const properties = keys(a2);
|
|
1701
|
+
let index = properties.length;
|
|
1702
|
+
if (keys(b2).length !== index) {
|
|
1703
|
+
return false;
|
|
1704
|
+
}
|
|
1705
|
+
while (index-- > 0) {
|
|
1706
|
+
if (!isPropertyEqual(a2, b2, state, properties[index])) {
|
|
1707
|
+
return false;
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
return true;
|
|
1643
1711
|
}
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1712
|
+
function areObjectsEqualStrict(a2, b2, state) {
|
|
1713
|
+
const properties = getStrictProperties(a2);
|
|
1714
|
+
let index = properties.length;
|
|
1715
|
+
if (getStrictProperties(b2).length !== index) {
|
|
1716
|
+
return false;
|
|
1717
|
+
}
|
|
1718
|
+
let property;
|
|
1719
|
+
let descriptorA;
|
|
1720
|
+
let descriptorB;
|
|
1721
|
+
while (index-- > 0) {
|
|
1722
|
+
property = properties[index];
|
|
1723
|
+
if (!isPropertyEqual(a2, b2, state, property)) {
|
|
1724
|
+
return false;
|
|
1725
|
+
}
|
|
1726
|
+
descriptorA = getOwnPropertyDescriptor(a2, property);
|
|
1727
|
+
descriptorB = getOwnPropertyDescriptor(b2, property);
|
|
1728
|
+
if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) {
|
|
1729
|
+
return false;
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
return true;
|
|
1662
1733
|
}
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
*/
|
|
1666
|
-
function arePrimitiveWrappersEqual(a, b) {
|
|
1667
|
-
return sameValueEqual(a.valueOf(), b.valueOf());
|
|
1734
|
+
function arePrimitiveWrappersEqual(a2, b2) {
|
|
1735
|
+
return sameValueEqual(a2.valueOf(), b2.valueOf());
|
|
1668
1736
|
}
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
*/
|
|
1672
|
-
function areRegExpsEqual(a, b) {
|
|
1673
|
-
return a.source === b.source && a.flags === b.flags;
|
|
1737
|
+
function areRegExpsEqual(a2, b2) {
|
|
1738
|
+
return a2.source === b2.source && a2.flags === b2.flags;
|
|
1674
1739
|
}
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1740
|
+
function areSetsEqual(a2, b2, state) {
|
|
1741
|
+
const size = a2.size;
|
|
1742
|
+
if (size !== b2.size) {
|
|
1743
|
+
return false;
|
|
1744
|
+
}
|
|
1745
|
+
if (!size) {
|
|
1746
|
+
return true;
|
|
1747
|
+
}
|
|
1748
|
+
const matchedIndices = new Array(size);
|
|
1749
|
+
const aIterable = a2.values();
|
|
1750
|
+
let aResult;
|
|
1751
|
+
let bResult;
|
|
1752
|
+
while (aResult = aIterable.next()) {
|
|
1753
|
+
if (aResult.done) {
|
|
1754
|
+
break;
|
|
1755
|
+
}
|
|
1756
|
+
const bIterable = b2.values();
|
|
1757
|
+
let hasMatch = false;
|
|
1758
|
+
let matchIndex = 0;
|
|
1759
|
+
while (bResult = bIterable.next()) {
|
|
1760
|
+
if (bResult.done) {
|
|
1761
|
+
break;
|
|
1762
|
+
}
|
|
1763
|
+
if (!matchedIndices[matchIndex] && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a2, b2, state)) {
|
|
1764
|
+
hasMatch = matchedIndices[matchIndex] = true;
|
|
1765
|
+
break;
|
|
1766
|
+
}
|
|
1767
|
+
matchIndex++;
|
|
1768
|
+
}
|
|
1769
|
+
if (!hasMatch) {
|
|
1770
|
+
return false;
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
return true;
|
|
1702
1774
|
}
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1775
|
+
function areTypedArraysEqual(a2, b2) {
|
|
1776
|
+
let index = a2.byteLength;
|
|
1777
|
+
if (b2.byteLength !== index || a2.byteOffset !== b2.byteOffset) {
|
|
1778
|
+
return false;
|
|
1779
|
+
}
|
|
1780
|
+
while (index-- > 0) {
|
|
1781
|
+
if (a2[index] !== b2[index]) {
|
|
1782
|
+
return false;
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
return true;
|
|
1711
1786
|
}
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
*/
|
|
1715
|
-
function areUrlsEqual(a, b) {
|
|
1716
|
-
return a.hostname === b.hostname && a.pathname === b.pathname && a.protocol === b.protocol && a.port === b.port && a.hash === b.hash && a.username === b.username && a.password === b.password;
|
|
1787
|
+
function areUrlsEqual(a2, b2) {
|
|
1788
|
+
return a2.hostname === b2.hostname && a2.pathname === b2.pathname && a2.protocol === b2.protocol && a2.port === b2.port && a2.hash === b2.hash && a2.username === b2.username && a2.password === b2.password;
|
|
1717
1789
|
}
|
|
1718
|
-
function isPropertyEqual(
|
|
1719
|
-
|
|
1720
|
-
|
|
1790
|
+
function isPropertyEqual(a2, b2, state, property) {
|
|
1791
|
+
if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE) && (a2.$$typeof || b2.$$typeof)) {
|
|
1792
|
+
return true;
|
|
1793
|
+
}
|
|
1794
|
+
return hasOwn(b2, property) && state.equals(a2[property], b2[property], property, property, a2, b2, state);
|
|
1721
1795
|
}
|
|
1722
|
-
|
|
1723
|
-
/**
|
|
1724
|
-
* Create a comparator method based on the type-specific equality comparators passed.
|
|
1725
|
-
*/
|
|
1796
|
+
const toString = Object.prototype.toString;
|
|
1726
1797
|
function createEqualityComparator(config) {
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1798
|
+
const supportedComparatorMap = createSupportedComparatorMap(config);
|
|
1799
|
+
const { areArraysEqual: areArraysEqual2, areDatesEqual: areDatesEqual2, areFunctionsEqual, areMapsEqual: areMapsEqual2, areNumbersEqual, areObjectsEqual: areObjectsEqual2, areRegExpsEqual: areRegExpsEqual2, areSetsEqual: areSetsEqual2, getUnsupportedCustomComparator } = config;
|
|
1800
|
+
return function comparator(a2, b2, state) {
|
|
1801
|
+
if (a2 === b2) {
|
|
1802
|
+
return true;
|
|
1803
|
+
}
|
|
1804
|
+
if (a2 == null || b2 == null) {
|
|
1805
|
+
return false;
|
|
1806
|
+
}
|
|
1807
|
+
const type = typeof a2;
|
|
1808
|
+
if (type !== typeof b2) {
|
|
1809
|
+
return false;
|
|
1810
|
+
}
|
|
1811
|
+
if (type !== "object") {
|
|
1812
|
+
if (type === "number" || type === "bigint") {
|
|
1813
|
+
return areNumbersEqual(a2, b2, state);
|
|
1814
|
+
}
|
|
1815
|
+
if (type === "function") {
|
|
1816
|
+
return areFunctionsEqual(a2, b2, state);
|
|
1817
|
+
}
|
|
1818
|
+
return false;
|
|
1819
|
+
}
|
|
1820
|
+
const constructor = a2.constructor;
|
|
1821
|
+
if (constructor !== b2.constructor) {
|
|
1822
|
+
return false;
|
|
1823
|
+
}
|
|
1824
|
+
if (constructor === Object) {
|
|
1825
|
+
return areObjectsEqual2(a2, b2, state);
|
|
1826
|
+
}
|
|
1827
|
+
if (constructor === Array) {
|
|
1828
|
+
return areArraysEqual2(a2, b2, state);
|
|
1829
|
+
}
|
|
1830
|
+
if (constructor === Date) {
|
|
1831
|
+
return areDatesEqual2(a2, b2, state);
|
|
1832
|
+
}
|
|
1833
|
+
if (constructor === RegExp) {
|
|
1834
|
+
return areRegExpsEqual2(a2, b2, state);
|
|
1835
|
+
}
|
|
1836
|
+
if (constructor === Map) {
|
|
1837
|
+
return areMapsEqual2(a2, b2, state);
|
|
1838
|
+
}
|
|
1839
|
+
if (constructor === Set) {
|
|
1840
|
+
return areSetsEqual2(a2, b2, state);
|
|
1841
|
+
}
|
|
1842
|
+
if (constructor === Promise) {
|
|
1843
|
+
return false;
|
|
1844
|
+
}
|
|
1845
|
+
if (Array.isArray(a2)) {
|
|
1846
|
+
return areArraysEqual2(a2, b2, state);
|
|
1847
|
+
}
|
|
1848
|
+
const tag = toString.call(a2);
|
|
1849
|
+
const supportedComparator = supportedComparatorMap[tag];
|
|
1850
|
+
if (supportedComparator) {
|
|
1851
|
+
return supportedComparator(a2, b2, state);
|
|
1852
|
+
}
|
|
1853
|
+
const unsupportedCustomComparator = getUnsupportedCustomComparator && getUnsupportedCustomComparator(a2, b2, state, tag);
|
|
1854
|
+
if (unsupportedCustomComparator) {
|
|
1855
|
+
return unsupportedCustomComparator(a2, b2, state);
|
|
1856
|
+
}
|
|
1857
|
+
return false;
|
|
1858
|
+
};
|
|
1759
1859
|
}
|
|
1760
|
-
/**
|
|
1761
|
-
* Create the configuration object used for building comparators.
|
|
1762
|
-
*/
|
|
1763
1860
|
function createEqualityComparatorConfig({ circular, createCustomConfig, strict }) {
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1861
|
+
let config = {
|
|
1862
|
+
areArrayBuffersEqual,
|
|
1863
|
+
areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
|
|
1864
|
+
areDataViewsEqual,
|
|
1865
|
+
areDatesEqual,
|
|
1866
|
+
areErrorsEqual,
|
|
1867
|
+
areFunctionsEqual: strictEqual,
|
|
1868
|
+
areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
|
|
1869
|
+
areNumbersEqual: sameValueEqual,
|
|
1870
|
+
areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
|
|
1871
|
+
arePrimitiveWrappersEqual,
|
|
1872
|
+
areRegExpsEqual,
|
|
1873
|
+
areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
|
|
1874
|
+
areTypedArraysEqual: strict ? combineComparators(areTypedArraysEqual, areObjectsEqualStrict) : areTypedArraysEqual,
|
|
1875
|
+
areUrlsEqual,
|
|
1876
|
+
getUnsupportedCustomComparator: void 0
|
|
1877
|
+
};
|
|
1878
|
+
if (createCustomConfig) {
|
|
1879
|
+
config = Object.assign({}, config, createCustomConfig(config));
|
|
1880
|
+
}
|
|
1881
|
+
if (circular) {
|
|
1882
|
+
const areArraysEqual2 = createIsCircular(config.areArraysEqual);
|
|
1883
|
+
const areMapsEqual2 = createIsCircular(config.areMapsEqual);
|
|
1884
|
+
const areObjectsEqual2 = createIsCircular(config.areObjectsEqual);
|
|
1885
|
+
const areSetsEqual2 = createIsCircular(config.areSetsEqual);
|
|
1886
|
+
config = Object.assign({}, config, {
|
|
1887
|
+
areArraysEqual: areArraysEqual2,
|
|
1888
|
+
areMapsEqual: areMapsEqual2,
|
|
1889
|
+
areObjectsEqual: areObjectsEqual2,
|
|
1890
|
+
areSetsEqual: areSetsEqual2
|
|
1891
|
+
});
|
|
1892
|
+
}
|
|
1893
|
+
return config;
|
|
1795
1894
|
}
|
|
1796
|
-
/**
|
|
1797
|
-
* Default equality comparator pass-through, used as the standard `isEqual` creator for
|
|
1798
|
-
* use inside the built comparator.
|
|
1799
|
-
*/
|
|
1800
1895
|
function createInternalEqualityComparator(compare) {
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1896
|
+
return function(a2, b2, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
|
|
1897
|
+
return compare(a2, b2, state);
|
|
1898
|
+
};
|
|
1804
1899
|
}
|
|
1805
|
-
/**
|
|
1806
|
-
* Create the `isEqual` function used by the consuming application.
|
|
1807
|
-
*/
|
|
1808
1900
|
function createIsEqual({ circular, comparator, createState, equals, strict }) {
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1901
|
+
if (createState) {
|
|
1902
|
+
return function isEqual(a2, b2) {
|
|
1903
|
+
const { cache = circular ? /* @__PURE__ */ new WeakMap() : void 0, meta } = createState();
|
|
1904
|
+
return comparator(a2, b2, {
|
|
1905
|
+
cache,
|
|
1906
|
+
equals,
|
|
1907
|
+
meta,
|
|
1908
|
+
strict
|
|
1909
|
+
});
|
|
1910
|
+
};
|
|
1911
|
+
}
|
|
1912
|
+
if (circular) {
|
|
1913
|
+
return function isEqual(a2, b2) {
|
|
1914
|
+
return comparator(a2, b2, {
|
|
1915
|
+
cache: /* @__PURE__ */ new WeakMap(),
|
|
1916
|
+
equals,
|
|
1917
|
+
meta: void 0,
|
|
1918
|
+
strict
|
|
1919
|
+
});
|
|
1920
|
+
};
|
|
1921
|
+
}
|
|
1922
|
+
const state = {
|
|
1923
|
+
cache: void 0,
|
|
1924
|
+
equals,
|
|
1925
|
+
meta: void 0,
|
|
1926
|
+
strict
|
|
1927
|
+
};
|
|
1928
|
+
return function isEqual(a2, b2) {
|
|
1929
|
+
return comparator(a2, b2, state);
|
|
1930
|
+
};
|
|
1835
1931
|
}
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1932
|
+
function createSupportedComparatorMap({ areArrayBuffersEqual: areArrayBuffersEqual2, areArraysEqual: areArraysEqual2, areDataViewsEqual: areDataViewsEqual2, areDatesEqual: areDatesEqual2, areErrorsEqual: areErrorsEqual2, areFunctionsEqual, areMapsEqual: areMapsEqual2, areNumbersEqual, areObjectsEqual: areObjectsEqual2, arePrimitiveWrappersEqual: arePrimitiveWrappersEqual2, areRegExpsEqual: areRegExpsEqual2, areSetsEqual: areSetsEqual2, areTypedArraysEqual: areTypedArraysEqual2, areUrlsEqual: areUrlsEqual2 }) {
|
|
1933
|
+
return {
|
|
1934
|
+
"[object Arguments]": areObjectsEqual2,
|
|
1935
|
+
"[object Array]": areArraysEqual2,
|
|
1936
|
+
"[object ArrayBuffer]": areArrayBuffersEqual2,
|
|
1937
|
+
"[object AsyncGeneratorFunction]": areFunctionsEqual,
|
|
1938
|
+
"[object BigInt]": areNumbersEqual,
|
|
1939
|
+
"[object BigInt64Array]": areTypedArraysEqual2,
|
|
1940
|
+
"[object BigUint64Array]": areTypedArraysEqual2,
|
|
1941
|
+
"[object Boolean]": arePrimitiveWrappersEqual2,
|
|
1942
|
+
"[object DataView]": areDataViewsEqual2,
|
|
1943
|
+
"[object Date]": areDatesEqual2,
|
|
1944
|
+
// If an error tag, it should be tested explicitly. Like RegExp, the properties are not
|
|
1945
|
+
// enumerable, and therefore will give false positives if tested like a standard object.
|
|
1946
|
+
"[object Error]": areErrorsEqual2,
|
|
1947
|
+
"[object Float16Array]": areTypedArraysEqual2,
|
|
1948
|
+
"[object Float32Array]": areTypedArraysEqual2,
|
|
1949
|
+
"[object Float64Array]": areTypedArraysEqual2,
|
|
1950
|
+
"[object Function]": areFunctionsEqual,
|
|
1951
|
+
"[object GeneratorFunction]": areFunctionsEqual,
|
|
1952
|
+
"[object Int8Array]": areTypedArraysEqual2,
|
|
1953
|
+
"[object Int16Array]": areTypedArraysEqual2,
|
|
1954
|
+
"[object Int32Array]": areTypedArraysEqual2,
|
|
1955
|
+
"[object Map]": areMapsEqual2,
|
|
1956
|
+
"[object Number]": arePrimitiveWrappersEqual2,
|
|
1957
|
+
"[object Object]": (a2, b2, state) => (
|
|
1958
|
+
// The exception for value comparison is custom `Promise`-like class instances. These should
|
|
1959
|
+
// be treated the same as standard `Promise` objects, which means strict equality, and if
|
|
1960
|
+
// it reaches this point then that strict equality comparison has already failed.
|
|
1961
|
+
typeof a2.then !== "function" && typeof b2.then !== "function" && areObjectsEqual2(a2, b2, state)
|
|
1962
|
+
),
|
|
1963
|
+
// For RegExp, the properties are not enumerable, and therefore will give false positives if
|
|
1964
|
+
// tested like a standard object.
|
|
1965
|
+
"[object RegExp]": areRegExpsEqual2,
|
|
1966
|
+
"[object Set]": areSetsEqual2,
|
|
1967
|
+
"[object String]": arePrimitiveWrappersEqual2,
|
|
1968
|
+
"[object URL]": areUrlsEqual2,
|
|
1969
|
+
"[object Uint8Array]": areTypedArraysEqual2,
|
|
1970
|
+
"[object Uint8ClampedArray]": areTypedArraysEqual2,
|
|
1971
|
+
"[object Uint16Array]": areTypedArraysEqual2,
|
|
1972
|
+
"[object Uint32Array]": areTypedArraysEqual2
|
|
1973
|
+
};
|
|
1872
1974
|
}
|
|
1873
|
-
|
|
1874
|
-
* Whether the items passed are deeply-equal in value.
|
|
1875
|
-
*/
|
|
1876
|
-
var deepEqual = createCustomEqual();
|
|
1975
|
+
const deepEqual = createCustomEqual();
|
|
1877
1976
|
createCustomEqual({ strict: true });
|
|
1878
1977
|
createCustomEqual({ circular: true });
|
|
1879
1978
|
createCustomEqual({
|
|
1880
|
-
|
|
1881
|
-
|
|
1979
|
+
circular: true,
|
|
1980
|
+
strict: true
|
|
1981
|
+
});
|
|
1982
|
+
createCustomEqual({
|
|
1983
|
+
createInternalComparator: () => sameValueEqual
|
|
1882
1984
|
});
|
|
1883
|
-
createCustomEqual({ createInternalComparator: () => sameValueEqual });
|
|
1884
1985
|
createCustomEqual({
|
|
1885
|
-
|
|
1886
|
-
|
|
1986
|
+
strict: true,
|
|
1987
|
+
createInternalComparator: () => sameValueEqual
|
|
1887
1988
|
});
|
|
1888
1989
|
createCustomEqual({
|
|
1889
|
-
|
|
1890
|
-
|
|
1990
|
+
circular: true,
|
|
1991
|
+
createInternalComparator: () => sameValueEqual
|
|
1891
1992
|
});
|
|
1892
1993
|
createCustomEqual({
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1994
|
+
circular: true,
|
|
1995
|
+
createInternalComparator: () => sameValueEqual,
|
|
1996
|
+
strict: true
|
|
1896
1997
|
});
|
|
1897
|
-
/**
|
|
1898
|
-
* Create a custom equality comparison method.
|
|
1899
|
-
*
|
|
1900
|
-
* This can be done to create very targeted comparisons in extreme hot-path scenarios
|
|
1901
|
-
* where the standard methods are not performant enough, but can also be used to provide
|
|
1902
|
-
* support for legacy environments that do not support expected features like
|
|
1903
|
-
* `RegExp.prototype.flags` out of the box.
|
|
1904
|
-
*/
|
|
1905
1998
|
function createCustomEqual(options = {}) {
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
createState,
|
|
1912
|
-
equals: createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator),
|
|
1913
|
-
strict
|
|
1914
|
-
});
|
|
1999
|
+
const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false } = options;
|
|
2000
|
+
const config = createEqualityComparatorConfig(options);
|
|
2001
|
+
const comparator = createEqualityComparator(config);
|
|
2002
|
+
const equals = createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator);
|
|
2003
|
+
return createIsEqual({ circular, comparator, createState, equals, strict });
|
|
1915
2004
|
}
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2005
|
+
const defaultRect = {
|
|
2006
|
+
x: 0,
|
|
2007
|
+
y: 0,
|
|
2008
|
+
width: 0,
|
|
2009
|
+
height: 0,
|
|
2010
|
+
top: 0,
|
|
2011
|
+
left: 0,
|
|
2012
|
+
bottom: 0,
|
|
2013
|
+
right: 0
|
|
2014
|
+
};
|
|
2015
|
+
const useLocalMeasure = () => {
|
|
2016
|
+
const $ = c(6);
|
|
2017
|
+
const [node, setNode] = useState(null);
|
|
2018
|
+
let t0;
|
|
2019
|
+
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2020
|
+
t0 = (el) => setNode(el);
|
|
2021
|
+
$[0] = t0;
|
|
2022
|
+
} else {
|
|
2023
|
+
t0 = $[0];
|
|
2024
|
+
}
|
|
2025
|
+
const ref = t0;
|
|
2026
|
+
const [rect, setRect] = useState(defaultRect);
|
|
2027
|
+
let t1;
|
|
2028
|
+
let t2;
|
|
2029
|
+
if ($[1] !== node) {
|
|
2030
|
+
t1 = () => {
|
|
2031
|
+
if (typeof window === "undefined" || typeof ResizeObserver === "undefined") {
|
|
2032
|
+
return;
|
|
2033
|
+
}
|
|
2034
|
+
if (!node) {
|
|
2035
|
+
return;
|
|
2036
|
+
}
|
|
2037
|
+
const observer = new ResizeObserver((entries) => {
|
|
2038
|
+
const entry = entries[0];
|
|
2039
|
+
if (!entry?.contentRect) {
|
|
2040
|
+
return;
|
|
2041
|
+
}
|
|
2042
|
+
const {
|
|
2043
|
+
x,
|
|
2044
|
+
y,
|
|
2045
|
+
width,
|
|
2046
|
+
height,
|
|
2047
|
+
top,
|
|
2048
|
+
left,
|
|
2049
|
+
bottom,
|
|
2050
|
+
right
|
|
2051
|
+
} = entry.contentRect;
|
|
2052
|
+
setRect({
|
|
2053
|
+
x,
|
|
2054
|
+
y,
|
|
2055
|
+
width,
|
|
2056
|
+
height,
|
|
2057
|
+
top,
|
|
2058
|
+
left,
|
|
2059
|
+
bottom,
|
|
2060
|
+
right
|
|
2061
|
+
});
|
|
2062
|
+
});
|
|
2063
|
+
observer.observe(node);
|
|
2064
|
+
return () => observer.disconnect();
|
|
2065
|
+
};
|
|
2066
|
+
t2 = [node];
|
|
2067
|
+
$[1] = node;
|
|
2068
|
+
$[2] = t1;
|
|
2069
|
+
$[3] = t2;
|
|
2070
|
+
} else {
|
|
2071
|
+
t1 = $[2];
|
|
2072
|
+
t2 = $[3];
|
|
2073
|
+
}
|
|
2074
|
+
useLayoutEffect(t1, t2);
|
|
2075
|
+
let t3;
|
|
2076
|
+
if ($[4] !== rect) {
|
|
2077
|
+
t3 = [ref, rect];
|
|
2078
|
+
$[4] = rect;
|
|
2079
|
+
$[5] = t3;
|
|
2080
|
+
} else {
|
|
2081
|
+
t3 = $[5];
|
|
2082
|
+
}
|
|
2083
|
+
return t3;
|
|
2084
|
+
};
|
|
2085
|
+
const DEFAULT_THROTTLE_TIME = 16;
|
|
2086
|
+
const useThrottledMeasure = (t0) => {
|
|
2087
|
+
const $ = c(10);
|
|
2088
|
+
const throttleDuration = t0 === void 0 ? DEFAULT_THROTTLE_TIME : t0;
|
|
2089
|
+
const hasInitialMeasure = useRef(false);
|
|
2090
|
+
const [ref, measuredRect] = useLocalMeasure();
|
|
2091
|
+
const [rect, setRect] = useState(_temp$1);
|
|
2092
|
+
let t1;
|
|
2093
|
+
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2094
|
+
t1 = (newRect) => {
|
|
2095
|
+
setRect((current) => deepEqual(current, newRect) ? current : newRect);
|
|
2096
|
+
};
|
|
2097
|
+
$[0] = t1;
|
|
2098
|
+
} else {
|
|
2099
|
+
t1 = $[0];
|
|
2100
|
+
}
|
|
2101
|
+
let t2;
|
|
2102
|
+
if ($[1] !== throttleDuration) {
|
|
2103
|
+
t2 = throttle$1(t1, throttleDuration, {
|
|
2104
|
+
leading: true,
|
|
2105
|
+
trailing: true
|
|
2106
|
+
});
|
|
2107
|
+
$[1] = throttleDuration;
|
|
2108
|
+
$[2] = t2;
|
|
2109
|
+
} else {
|
|
2110
|
+
t2 = $[2];
|
|
2111
|
+
}
|
|
2112
|
+
const throttledSetRect = t2;
|
|
2113
|
+
let t3;
|
|
2114
|
+
let t4;
|
|
2115
|
+
if ($[3] !== measuredRect || $[4] !== throttledSetRect) {
|
|
2116
|
+
t3 = () => {
|
|
2117
|
+
if (measuredRect.width > 0 && !hasInitialMeasure.current) {
|
|
2118
|
+
hasInitialMeasure.current = true;
|
|
2119
|
+
setRect((current_0) => deepEqual(current_0, measuredRect) ? current_0 : measuredRect);
|
|
2120
|
+
return;
|
|
2121
|
+
}
|
|
2122
|
+
throttledSetRect(measuredRect);
|
|
2123
|
+
return () => {
|
|
2124
|
+
throttledSetRect.cancel();
|
|
2125
|
+
};
|
|
2126
|
+
};
|
|
2127
|
+
t4 = [measuredRect, throttledSetRect];
|
|
2128
|
+
$[3] = measuredRect;
|
|
2129
|
+
$[4] = throttledSetRect;
|
|
2130
|
+
$[5] = t3;
|
|
2131
|
+
$[6] = t4;
|
|
2132
|
+
} else {
|
|
2133
|
+
t3 = $[5];
|
|
2134
|
+
t4 = $[6];
|
|
2135
|
+
}
|
|
2136
|
+
useEffect(t3, t4);
|
|
2137
|
+
let t5;
|
|
2138
|
+
if ($[7] !== rect || $[8] !== ref) {
|
|
2139
|
+
t5 = [ref, rect];
|
|
2140
|
+
$[7] = rect;
|
|
2141
|
+
$[8] = ref;
|
|
2142
|
+
$[9] = t5;
|
|
2143
|
+
} else {
|
|
2144
|
+
t5 = $[9];
|
|
2145
|
+
}
|
|
2146
|
+
return t5;
|
|
2035
2147
|
};
|
|
2036
2148
|
function _temp$1() {
|
|
2037
|
-
|
|
2149
|
+
return defaultRect;
|
|
2038
2150
|
}
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
};
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
};
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2151
|
+
const defaultState = {
|
|
2152
|
+
statusCode: 500,
|
|
2153
|
+
title: "Something went wrong",
|
|
2154
|
+
message: "We couldn't render this route. Please try again shortly."
|
|
2155
|
+
};
|
|
2156
|
+
const toSsrErrorState = (error) => {
|
|
2157
|
+
if (isRouteErrorResponse(error)) {
|
|
2158
|
+
const data = error.data;
|
|
2159
|
+
const message = typeof data === "string" ? data : data?.message || defaultState.message;
|
|
2160
|
+
let details;
|
|
2161
|
+
if (env.DEV && data && typeof data !== "string") {
|
|
2162
|
+
try {
|
|
2163
|
+
details = JSON.stringify(data, null, 2);
|
|
2164
|
+
} catch {
|
|
2165
|
+
details = void 0;
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
return {
|
|
2169
|
+
statusCode: error.status ?? defaultState.statusCode,
|
|
2170
|
+
title: error.statusText || defaultState.title,
|
|
2171
|
+
message,
|
|
2172
|
+
details
|
|
2173
|
+
};
|
|
2174
|
+
}
|
|
2175
|
+
if (error instanceof Error) {
|
|
2176
|
+
return {
|
|
2177
|
+
statusCode: defaultState.statusCode,
|
|
2178
|
+
title: defaultState.title,
|
|
2179
|
+
message: error.message || defaultState.message,
|
|
2180
|
+
details: globalThis.__rb_env__.DEV ? error.stack ?? error.message : void 0
|
|
2181
|
+
};
|
|
2182
|
+
}
|
|
2183
|
+
if (typeof error === "string") {
|
|
2184
|
+
return {
|
|
2185
|
+
statusCode: defaultState.statusCode,
|
|
2186
|
+
title: defaultState.title,
|
|
2187
|
+
message: error
|
|
2188
|
+
};
|
|
2189
|
+
}
|
|
2190
|
+
return defaultState;
|
|
2191
|
+
};
|
|
2192
|
+
const RouteErrorBoundary = (t0) => {
|
|
2193
|
+
const $ = c(5);
|
|
2194
|
+
const {
|
|
2195
|
+
renderErrorExtra
|
|
2196
|
+
} = t0;
|
|
2197
|
+
const routeError = useRouteError();
|
|
2198
|
+
let t1;
|
|
2199
|
+
if ($[0] !== routeError) {
|
|
2200
|
+
t1 = toSsrErrorState(routeError);
|
|
2201
|
+
$[0] = routeError;
|
|
2202
|
+
$[1] = t1;
|
|
2203
|
+
} else {
|
|
2204
|
+
t1 = $[1];
|
|
2205
|
+
}
|
|
2206
|
+
const state = t1;
|
|
2207
|
+
let t2;
|
|
2208
|
+
if ($[2] !== renderErrorExtra || $[3] !== state) {
|
|
2209
|
+
t2 = /* @__PURE__ */ jsx(SsrErrorFallback, { state, renderErrorExtra });
|
|
2210
|
+
$[2] = renderErrorExtra;
|
|
2211
|
+
$[3] = state;
|
|
2212
|
+
$[4] = t2;
|
|
2213
|
+
} else {
|
|
2214
|
+
t2 = $[4];
|
|
2215
|
+
}
|
|
2216
|
+
return t2;
|
|
2217
|
+
};
|
|
2218
|
+
const listNotifications = async (input = {}) => {
|
|
2219
|
+
const result = await apiClient.post("/api/rb/notifications", input);
|
|
2220
|
+
if (!result?.ok) {
|
|
2221
|
+
throw new Error(result?.error || "Failed to load notifications");
|
|
2222
|
+
}
|
|
2223
|
+
return {
|
|
2224
|
+
notifications: Array.isArray(result.notifications) ? result.notifications : [],
|
|
2225
|
+
unreadCount: Number.isFinite(result.unreadCount) ? Math.max(0, Math.floor(result.unreadCount ?? 0)) : 0,
|
|
2226
|
+
unseenCount: Number.isFinite(result.unseenCount) ? Math.max(0, Math.floor(result.unseenCount ?? 0)) : 0
|
|
2227
|
+
};
|
|
2228
|
+
};
|
|
2229
|
+
const markNotificationRead = async (notificationId) => {
|
|
2230
|
+
const id = notificationId.trim();
|
|
2231
|
+
if (!id) throw new Error("notificationId is required");
|
|
2232
|
+
const result = await apiClient.post(`/api/rb/notifications/${encodeURIComponent(id)}/read`, {});
|
|
2233
|
+
if (!result?.ok) {
|
|
2234
|
+
throw new Error(result?.error || "Failed to mark notification read");
|
|
2235
|
+
}
|
|
2236
|
+
};
|
|
2237
|
+
const archiveNotification = async (notificationId) => {
|
|
2238
|
+
const id = notificationId.trim();
|
|
2239
|
+
if (!id) throw new Error("notificationId is required");
|
|
2240
|
+
const result = await apiClient.post(`/api/rb/notifications/${encodeURIComponent(id)}/archive`, {});
|
|
2241
|
+
if (!result?.ok) {
|
|
2242
|
+
throw new Error(result?.error || "Failed to archive notification");
|
|
2243
|
+
}
|
|
2244
|
+
};
|
|
2245
|
+
const markAllNotificationsRead = async () => {
|
|
2246
|
+
const result = await apiClient.post("/api/rb/notifications/mark-all-read", {});
|
|
2247
|
+
if (!result?.ok) {
|
|
2248
|
+
throw new Error(result?.error || "Failed to mark all notifications read");
|
|
2249
|
+
}
|
|
2250
|
+
};
|
|
2251
|
+
const getNotificationSettings = async () => {
|
|
2252
|
+
const result = await apiClient.get("/api/rb/notifications/settings", {});
|
|
2253
|
+
if (!result?.ok) {
|
|
2254
|
+
throw new Error(result?.error || "Failed to load notification settings");
|
|
2255
|
+
}
|
|
2256
|
+
return result.settings ?? {
|
|
2257
|
+
digestFrequency: "weekly",
|
|
2258
|
+
topicPreferences: []
|
|
2259
|
+
};
|
|
2260
|
+
};
|
|
2261
|
+
const updateNotificationSettings = async (partial) => {
|
|
2262
|
+
const result = await apiClient.put("/api/rb/notifications/settings", partial);
|
|
2263
|
+
if (!result?.ok) {
|
|
2264
|
+
throw new Error(result?.error || "Failed to update notification settings");
|
|
2265
|
+
}
|
|
2266
|
+
return result.settings ?? {
|
|
2267
|
+
digestFrequency: "weekly",
|
|
2268
|
+
topicPreferences: []
|
|
2269
|
+
};
|
|
2270
|
+
};
|
|
2271
|
+
const runNotificationDigest = async ({
|
|
2272
|
+
force = false
|
|
2273
|
+
} = {}) => {
|
|
2274
|
+
const result = await apiClient.post("/api/rb/notifications/digest/run", {
|
|
2275
|
+
force
|
|
2276
|
+
});
|
|
2277
|
+
if (!result?.ok) {
|
|
2278
|
+
throw new Error(result?.error || "Failed to run digest");
|
|
2279
|
+
}
|
|
2280
|
+
return {
|
|
2281
|
+
sent: result.sent === true,
|
|
2282
|
+
skippedReason: result.skippedReason
|
|
2283
|
+
};
|
|
2284
|
+
};
|
|
2285
|
+
const NotificationsRealtimeContext = createContext(null);
|
|
2286
|
+
const toIso = (value) => {
|
|
2287
|
+
if (value instanceof Date) return value.toISOString();
|
|
2288
|
+
if (typeof value === "string") return value;
|
|
2289
|
+
return void 0;
|
|
2290
|
+
};
|
|
2291
|
+
const toNotificationItem = (doc) => {
|
|
2292
|
+
const id = typeof doc._id === "string" ? doc._id : String(doc._id ?? "");
|
|
2293
|
+
if (!id) return null;
|
|
2294
|
+
return {
|
|
2295
|
+
id,
|
|
2296
|
+
topic: typeof doc.topic === "string" ? doc.topic : void 0,
|
|
2297
|
+
title: typeof doc.title === "string" ? doc.title : "",
|
|
2298
|
+
body: typeof doc.body === "string" ? doc.body : void 0,
|
|
2299
|
+
url: typeof doc.url === "string" ? doc.url : void 0,
|
|
2300
|
+
createdAt: toIso(doc.createdAt) ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
2301
|
+
seenAt: toIso(doc.seenAt),
|
|
2302
|
+
readAt: toIso(doc.readAt),
|
|
2303
|
+
archivedAt: toIso(doc.archivedAt),
|
|
2304
|
+
metadata: typeof doc.metadata === "object" && doc.metadata !== null ? doc.metadata : void 0
|
|
2305
|
+
};
|
|
2306
|
+
};
|
|
2307
|
+
const buildDisabledTopics = (settings) => {
|
|
2308
|
+
const raw = settings?.topicPreferences;
|
|
2309
|
+
if (!Array.isArray(raw) || raw.length === 0) return [];
|
|
2310
|
+
return raw.map((pref) => {
|
|
2311
|
+
if (!pref || typeof pref !== "object") return null;
|
|
2312
|
+
const topic = typeof pref.topic === "string" ? pref.topic.trim() : "";
|
|
2313
|
+
if (!topic) return null;
|
|
2314
|
+
return pref.inApp === false ? topic : null;
|
|
2315
|
+
}).filter((topic) => Boolean(topic));
|
|
2182
2316
|
};
|
|
2183
2317
|
function NotificationsRealtimeProvider(t0) {
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2318
|
+
const $ = c(47);
|
|
2319
|
+
const {
|
|
2320
|
+
userId,
|
|
2321
|
+
limit: t1,
|
|
2322
|
+
toastOnNew: t2,
|
|
2323
|
+
children
|
|
2324
|
+
} = t0;
|
|
2325
|
+
const limit = t1 === void 0 ? 200 : t1;
|
|
2326
|
+
const toastOnNew = t2 === void 0 ? true : t2;
|
|
2327
|
+
let t3;
|
|
2328
|
+
if ($[0] !== userId) {
|
|
2329
|
+
t3 = typeof userId === "string" ? userId.trim() : "";
|
|
2330
|
+
$[0] = userId;
|
|
2331
|
+
$[1] = t3;
|
|
2332
|
+
} else {
|
|
2333
|
+
t3 = $[1];
|
|
2334
|
+
}
|
|
2335
|
+
const trimmedUserId = t3;
|
|
2336
|
+
const canUseRts = Boolean(trimmedUserId);
|
|
2337
|
+
let t4;
|
|
2338
|
+
if ($[2] !== canUseRts || $[3] !== trimmedUserId) {
|
|
2339
|
+
t4 = canUseRts ? {
|
|
2340
|
+
userId: trimmedUserId
|
|
2341
|
+
} : {};
|
|
2342
|
+
$[2] = canUseRts;
|
|
2343
|
+
$[3] = trimmedUserId;
|
|
2344
|
+
$[4] = t4;
|
|
2345
|
+
} else {
|
|
2346
|
+
t4 = $[4];
|
|
2347
|
+
}
|
|
2348
|
+
let t5;
|
|
2349
|
+
if ($[5] !== canUseRts) {
|
|
2350
|
+
t5 = {
|
|
2351
|
+
key: "rb.notifications.settings",
|
|
2352
|
+
limit: 1,
|
|
2353
|
+
enabled: canUseRts
|
|
2354
|
+
};
|
|
2355
|
+
$[5] = canUseRts;
|
|
2356
|
+
$[6] = t5;
|
|
2357
|
+
} else {
|
|
2358
|
+
t5 = $[6];
|
|
2359
|
+
}
|
|
2360
|
+
const settingsQuery = useQuery("RBNotificationSettings", t4, t5);
|
|
2361
|
+
const settings = settingsQuery.data?.[0] ?? null;
|
|
2362
|
+
let t6;
|
|
2363
|
+
if ($[7] !== settings) {
|
|
2364
|
+
t6 = buildDisabledTopics(settings);
|
|
2365
|
+
$[7] = settings;
|
|
2366
|
+
$[8] = t6;
|
|
2367
|
+
} else {
|
|
2368
|
+
t6 = $[8];
|
|
2369
|
+
}
|
|
2370
|
+
const disabledTopics = t6;
|
|
2371
|
+
let t7;
|
|
2372
|
+
bb0: {
|
|
2373
|
+
if (!canUseRts) {
|
|
2374
|
+
let t83;
|
|
2375
|
+
if ($[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2376
|
+
t83 = {};
|
|
2377
|
+
$[9] = t83;
|
|
2378
|
+
} else {
|
|
2379
|
+
t83 = $[9];
|
|
2380
|
+
}
|
|
2381
|
+
t7 = t83;
|
|
2382
|
+
break bb0;
|
|
2383
|
+
}
|
|
2384
|
+
let t82;
|
|
2385
|
+
if ($[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2386
|
+
t82 = {
|
|
2387
|
+
$exists: false
|
|
2388
|
+
};
|
|
2389
|
+
$[10] = t82;
|
|
2390
|
+
} else {
|
|
2391
|
+
t82 = $[10];
|
|
2392
|
+
}
|
|
2393
|
+
let base;
|
|
2394
|
+
if ($[11] !== disabledTopics || $[12] !== trimmedUserId) {
|
|
2395
|
+
base = {
|
|
2396
|
+
userId: trimmedUserId,
|
|
2397
|
+
archivedAt: t82
|
|
2398
|
+
};
|
|
2399
|
+
if (disabledTopics.length > 0) {
|
|
2400
|
+
let t92;
|
|
2401
|
+
if ($[14] !== disabledTopics) {
|
|
2402
|
+
t92 = {
|
|
2403
|
+
$nin: disabledTopics
|
|
2404
|
+
};
|
|
2405
|
+
$[14] = disabledTopics;
|
|
2406
|
+
$[15] = t92;
|
|
2407
|
+
} else {
|
|
2408
|
+
t92 = $[15];
|
|
2409
|
+
}
|
|
2410
|
+
base.topic = t92;
|
|
2411
|
+
}
|
|
2412
|
+
$[11] = disabledTopics;
|
|
2413
|
+
$[12] = trimmedUserId;
|
|
2414
|
+
$[13] = base;
|
|
2415
|
+
} else {
|
|
2416
|
+
base = $[13];
|
|
2417
|
+
}
|
|
2418
|
+
t7 = base;
|
|
2419
|
+
}
|
|
2420
|
+
const query = t7;
|
|
2421
|
+
let t8;
|
|
2422
|
+
if ($[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2423
|
+
t8 = {
|
|
2424
|
+
createdAt: -1
|
|
2425
|
+
};
|
|
2426
|
+
$[16] = t8;
|
|
2427
|
+
} else {
|
|
2428
|
+
t8 = $[16];
|
|
2429
|
+
}
|
|
2430
|
+
let t9;
|
|
2431
|
+
if ($[17] !== canUseRts || $[18] !== limit) {
|
|
2432
|
+
t9 = {
|
|
2433
|
+
key: "rb.notifications",
|
|
2434
|
+
sort: t8,
|
|
2435
|
+
limit,
|
|
2436
|
+
enabled: canUseRts
|
|
2437
|
+
};
|
|
2438
|
+
$[17] = canUseRts;
|
|
2439
|
+
$[18] = limit;
|
|
2440
|
+
$[19] = t9;
|
|
2441
|
+
} else {
|
|
2442
|
+
t9 = $[19];
|
|
2443
|
+
}
|
|
2444
|
+
const notificationsQuery = useQuery("RBNotification", query, t9);
|
|
2445
|
+
let t10;
|
|
2446
|
+
bb1: {
|
|
2447
|
+
const raw = notificationsQuery.data;
|
|
2448
|
+
if (!Array.isArray(raw)) {
|
|
2449
|
+
let t113;
|
|
2450
|
+
if ($[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2451
|
+
t113 = [];
|
|
2452
|
+
$[20] = t113;
|
|
2453
|
+
} else {
|
|
2454
|
+
t113 = $[20];
|
|
2455
|
+
}
|
|
2456
|
+
t10 = t113;
|
|
2457
|
+
break bb1;
|
|
2458
|
+
}
|
|
2459
|
+
let t112;
|
|
2460
|
+
if ($[21] !== raw) {
|
|
2461
|
+
t112 = raw.map(_temp).filter(_temp2);
|
|
2462
|
+
$[21] = raw;
|
|
2463
|
+
$[22] = t112;
|
|
2464
|
+
} else {
|
|
2465
|
+
t112 = $[22];
|
|
2466
|
+
}
|
|
2467
|
+
t10 = t112;
|
|
2468
|
+
}
|
|
2469
|
+
const notifications = t10;
|
|
2470
|
+
let t11;
|
|
2471
|
+
if ($[23] !== notifications) {
|
|
2472
|
+
t11 = notifications.reduce(_temp3, 0);
|
|
2473
|
+
$[23] = notifications;
|
|
2474
|
+
$[24] = t11;
|
|
2475
|
+
} else {
|
|
2476
|
+
t11 = $[24];
|
|
2477
|
+
}
|
|
2478
|
+
const unreadCount = t11;
|
|
2479
|
+
let t12;
|
|
2480
|
+
if ($[25] !== notifications) {
|
|
2481
|
+
t12 = notifications.reduce(_temp4, 0);
|
|
2482
|
+
$[25] = notifications;
|
|
2483
|
+
$[26] = t12;
|
|
2484
|
+
} else {
|
|
2485
|
+
t12 = $[26];
|
|
2486
|
+
}
|
|
2487
|
+
const unseenCount = t12;
|
|
2488
|
+
let t13;
|
|
2489
|
+
if ($[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2490
|
+
t13 = /* @__PURE__ */ new Set();
|
|
2491
|
+
$[27] = t13;
|
|
2492
|
+
} else {
|
|
2493
|
+
t13 = $[27];
|
|
2494
|
+
}
|
|
2495
|
+
const lastToastIds = useRef(t13);
|
|
2496
|
+
const hasSeededToastIds = useRef(false);
|
|
2497
|
+
let t14;
|
|
2498
|
+
if ($[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2499
|
+
t14 = Date.now();
|
|
2500
|
+
$[28] = t14;
|
|
2501
|
+
} else {
|
|
2502
|
+
t14 = $[28];
|
|
2503
|
+
}
|
|
2504
|
+
const toastStartMs = useRef(t14);
|
|
2505
|
+
let t15;
|
|
2506
|
+
if ($[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2507
|
+
t15 = () => {
|
|
2508
|
+
hasSeededToastIds.current = false;
|
|
2509
|
+
lastToastIds.current = /* @__PURE__ */ new Set();
|
|
2510
|
+
toastStartMs.current = Date.now();
|
|
2511
|
+
};
|
|
2512
|
+
$[29] = t15;
|
|
2513
|
+
} else {
|
|
2514
|
+
t15 = $[29];
|
|
2515
|
+
}
|
|
2516
|
+
let t16;
|
|
2517
|
+
if ($[30] !== trimmedUserId) {
|
|
2518
|
+
t16 = [trimmedUserId];
|
|
2519
|
+
$[30] = trimmedUserId;
|
|
2520
|
+
$[31] = t16;
|
|
2521
|
+
} else {
|
|
2522
|
+
t16 = $[31];
|
|
2523
|
+
}
|
|
2524
|
+
useEffect(t15, t16);
|
|
2525
|
+
let t17;
|
|
2526
|
+
let t18;
|
|
2527
|
+
if ($[32] !== canUseRts || $[33] !== notifications || $[34] !== notificationsQuery.loading || $[35] !== toastOnNew) {
|
|
2528
|
+
t17 = () => {
|
|
2529
|
+
if (!toastOnNew) {
|
|
2530
|
+
return;
|
|
2531
|
+
}
|
|
2532
|
+
if (!canUseRts) {
|
|
2533
|
+
return;
|
|
2534
|
+
}
|
|
2535
|
+
if (notificationsQuery.loading) {
|
|
2536
|
+
return;
|
|
2537
|
+
}
|
|
2538
|
+
if (!hasSeededToastIds.current) {
|
|
2539
|
+
hasSeededToastIds.current = true;
|
|
2540
|
+
lastToastIds.current = new Set(notifications.map(_temp5));
|
|
2541
|
+
return;
|
|
2542
|
+
}
|
|
2543
|
+
const nextNew = notifications.filter((n_3) => !lastToastIds.current.has(n_3.id));
|
|
2544
|
+
if (!nextNew.length) {
|
|
2545
|
+
return;
|
|
2546
|
+
}
|
|
2547
|
+
for (const n_4 of nextNew) {
|
|
2548
|
+
lastToastIds.current.add(n_4.id);
|
|
2549
|
+
}
|
|
2550
|
+
const isTabActive = typeof document !== "undefined" && document.visibilityState === "visible";
|
|
2551
|
+
if (!isTabActive) {
|
|
2552
|
+
return;
|
|
2553
|
+
}
|
|
2554
|
+
const eligible = nextNew.filter((n_5) => {
|
|
2555
|
+
const createdAtMs = Date.parse(n_5.createdAt);
|
|
2556
|
+
if (!Number.isFinite(createdAtMs)) {
|
|
2557
|
+
return true;
|
|
2558
|
+
}
|
|
2559
|
+
return createdAtMs >= toastStartMs.current;
|
|
2560
|
+
});
|
|
2561
|
+
if (!eligible.length) {
|
|
2562
|
+
return;
|
|
2563
|
+
}
|
|
2564
|
+
if (eligible.length > 3) {
|
|
2565
|
+
toast(`${eligible.length} new notifications`, {
|
|
2566
|
+
description: "Open the notifications drawer to view them."
|
|
2567
|
+
});
|
|
2568
|
+
return;
|
|
2569
|
+
}
|
|
2570
|
+
for (const n_6 of eligible) {
|
|
2571
|
+
toast(n_6.title || "New notification", {
|
|
2572
|
+
description: n_6.body
|
|
2573
|
+
});
|
|
2574
|
+
}
|
|
2575
|
+
};
|
|
2576
|
+
t18 = [canUseRts, notifications, notificationsQuery.loading, toastOnNew];
|
|
2577
|
+
$[32] = canUseRts;
|
|
2578
|
+
$[33] = notifications;
|
|
2579
|
+
$[34] = notificationsQuery.loading;
|
|
2580
|
+
$[35] = toastOnNew;
|
|
2581
|
+
$[36] = t17;
|
|
2582
|
+
$[37] = t18;
|
|
2583
|
+
} else {
|
|
2584
|
+
t17 = $[36];
|
|
2585
|
+
t18 = $[37];
|
|
2586
|
+
}
|
|
2587
|
+
useEffect(t17, t18);
|
|
2588
|
+
let t19;
|
|
2589
|
+
if ($[38] !== notifications || $[39] !== notificationsQuery.error || $[40] !== notificationsQuery.loading || $[41] !== unreadCount || $[42] !== unseenCount) {
|
|
2590
|
+
t19 = {
|
|
2591
|
+
notifications,
|
|
2592
|
+
unreadCount,
|
|
2593
|
+
unseenCount,
|
|
2594
|
+
loading: notificationsQuery.loading,
|
|
2595
|
+
error: notificationsQuery.error
|
|
2596
|
+
};
|
|
2597
|
+
$[38] = notifications;
|
|
2598
|
+
$[39] = notificationsQuery.error;
|
|
2599
|
+
$[40] = notificationsQuery.loading;
|
|
2600
|
+
$[41] = unreadCount;
|
|
2601
|
+
$[42] = unseenCount;
|
|
2602
|
+
$[43] = t19;
|
|
2603
|
+
} else {
|
|
2604
|
+
t19 = $[43];
|
|
2605
|
+
}
|
|
2606
|
+
const value = t19;
|
|
2607
|
+
const t20 = canUseRts ? value : null;
|
|
2608
|
+
let t21;
|
|
2609
|
+
if ($[44] !== children || $[45] !== t20) {
|
|
2610
|
+
t21 = /* @__PURE__ */ jsx(NotificationsRealtimeContext.Provider, { value: t20, children });
|
|
2611
|
+
$[44] = children;
|
|
2612
|
+
$[45] = t20;
|
|
2613
|
+
$[46] = t21;
|
|
2614
|
+
} else {
|
|
2615
|
+
t21 = $[46];
|
|
2616
|
+
}
|
|
2617
|
+
return t21;
|
|
2414
2618
|
}
|
|
2415
2619
|
function _temp5(n_2) {
|
|
2416
|
-
|
|
2620
|
+
return n_2.id;
|
|
2417
2621
|
}
|
|
2418
2622
|
function _temp4(acc_0, n_1) {
|
|
2419
|
-
|
|
2623
|
+
return acc_0 + (n_1.seenAt ? 0 : 1);
|
|
2420
2624
|
}
|
|
2421
2625
|
function _temp3(acc, n_0) {
|
|
2422
|
-
|
|
2626
|
+
return acc + (n_0.readAt ? 0 : 1);
|
|
2423
2627
|
}
|
|
2424
2628
|
function _temp2(n) {
|
|
2425
|
-
|
|
2629
|
+
return Boolean(n);
|
|
2426
2630
|
}
|
|
2427
2631
|
function _temp(doc) {
|
|
2428
|
-
|
|
2632
|
+
return toNotificationItem(doc);
|
|
2429
2633
|
}
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
};
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2634
|
+
const useNotificationsRealtime = () => {
|
|
2635
|
+
return useContext(NotificationsRealtimeContext);
|
|
2636
|
+
};
|
|
2637
|
+
export {
|
|
2638
|
+
NotificationsRealtimeContext,
|
|
2639
|
+
NotificationsRealtimeProvider,
|
|
2640
|
+
RootProvider,
|
|
2641
|
+
RouteErrorBoundary,
|
|
2642
|
+
R as RtsSsrRuntimeProvider,
|
|
2643
|
+
SSR_ERROR_STATE_GLOBAL_KEY,
|
|
2644
|
+
S as STATIC_RPCBASE_RTS_HYDRATION_DATA_KEY,
|
|
2645
|
+
SsrErrorFallback,
|
|
2646
|
+
apiClient,
|
|
2647
|
+
archiveNotification,
|
|
2648
|
+
c2 as clearHydratedRtsQueryData,
|
|
2649
|
+
consumeClientSsrErrorState,
|
|
2650
|
+
a as consumeHydratedRtsCount,
|
|
2651
|
+
getFeatureFlag,
|
|
2652
|
+
getNotificationSettings,
|
|
2653
|
+
hydrateRtsFromWindow,
|
|
2654
|
+
initApiClient,
|
|
2655
|
+
initWithRoutes,
|
|
2656
|
+
listNotifications,
|
|
2657
|
+
markAllNotificationsRead,
|
|
2658
|
+
markNotificationRead,
|
|
2659
|
+
peekClientSsrErrorState,
|
|
2660
|
+
p as peekHydratedRtsCount,
|
|
2661
|
+
b as peekHydratedRtsQueryData,
|
|
2662
|
+
d as peekHydratedRtsQueryPageInfo,
|
|
2663
|
+
e as peekHydratedRtsQueryTotalCount,
|
|
2664
|
+
reportClientException,
|
|
2665
|
+
runNotificationDigest,
|
|
2666
|
+
serializeSsrErrorState,
|
|
2667
|
+
s as setClientExceptionReporter,
|
|
2668
|
+
toast,
|
|
2669
|
+
updateNotificationSettings,
|
|
2670
|
+
useMediaQuery,
|
|
2671
|
+
useNotificationsRealtime,
|
|
2672
|
+
useThrottledMeasure
|
|
2673
|
+
};
|
|
2674
|
+
//# sourceMappingURL=index.js.map
|