appos 0.3.6-0 → 0.3.7-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/bin/main.mjs +3 -3
- package/dist/bin/youch-handler-D7REmh8Z.mjs +2 -0
- package/dist/exports/tests/api.d.mts +1 -1
- package/dist/exports/tests/api.mjs +14 -14
- package/dist/exports/tests/{auth-schema-DUCJw-_2.mjs → auth-schema-B_qHPoa4.mjs} +1 -1
- package/dist/exports/tests/{conditions-B0ffVJ5E.mjs → conditions-BeWxRN_Z.mjs} +1 -1
- package/dist/exports/tests/{extract-blob-metadata-Dv343Vcn.mjs → extract-blob-metadata-6xQrarjB.mjs} +2 -2
- package/dist/exports/tests/{generate-image-variant-cQc8q0kh.mjs → generate-image-variant-KQITLmCx.mjs} +1 -1
- package/dist/exports/tests/{generate-preview-HaTMd2hS.mjs → generate-preview-YnujQo5I.mjs} +1 -1
- package/dist/exports/tests/mock-BvoS23fi.mjs +1 -0
- package/dist/exports/tests/mock.mjs +1 -1
- package/dist/exports/tests/{purge-attachment-D4uOzHRi.mjs → purge-attachment-DTSmCl-z.mjs} +1 -1
- package/dist/exports/tests/{purge-audit-logs-DiPcc09d.mjs → purge-audit-logs-D0_UUhN2.mjs} +1 -1
- package/dist/exports/tests/{purge-unattached-blobs-CqW6tlIC.mjs → purge-unattached-blobs-IENmSB8K.mjs} +1 -1
- package/dist/exports/tests/react.mjs +1 -1
- package/dist/exports/tests/setup.mjs +2 -2
- package/dist/exports/tests/{track-db-changes-Bd4W-P1q.mjs → track-db-changes-Td9Q3DLd.mjs} +1 -1
- package/dist/exports/tests/youch-handler-efUxKCCs.mjs +1 -0
- package/dist/exports/vite/index.mjs +4 -4
- package/dist/exports/vite/{lib-DuBRr9dH.mjs → lib-B0s0q6aX.mjs} +73 -73
- package/dist/exports/vite/lib-BkrbWMaV.mjs +1 -0
- package/dist/exports/vitest/config.mjs +1 -77
- package/dist/exports/vitest/index.mjs +1 -348
- package/package.json +1 -7
- package/dist/bin/youch-handler-DrYdbUhe.mjs +0 -2
- package/dist/exports/devtools/BaseTanStackRouterDevtoolsPanel-BBz1qLry-DUwdvyLv.js +0 -2090
- package/dist/exports/devtools/EIDV623S-B7f6114d.js +0 -2497
- package/dist/exports/devtools/FloatingTanStackRouterDevtools-DymJEvfG-BHuQHiRR.js +0 -237
- package/dist/exports/devtools/MIMHJGAX-Cb3wf11F.js +0 -10903
- package/dist/exports/devtools/Q7LWSL4U-BoEO3rNq.js +0 -37
- package/dist/exports/devtools/VLTTJS3N-CIyRc84e.js +0 -44
- package/dist/exports/devtools/index.d.ts +0 -3
- package/dist/exports/devtools/index.js +0 -1725
- package/dist/exports/devtools/utils-YRTCpRgb.js +0 -1670
- package/dist/exports/tests/magic-string.es-D6VRmdiF.mjs +0 -14
- package/dist/exports/tests/mock-BvkO5nlm.mjs +0 -1
- package/dist/exports/tests/vi.2VT5v0um-Cme1b0Dl.mjs +0 -348
- package/dist/exports/tests/youch-handler-Ch5yf6im.mjs +0 -1
- package/dist/exports/vite/api-DGRU_RdM.mjs +0 -27
- package/dist/exports/vite/build-CxJAu2Bn.mjs +0 -1
- package/dist/exports/vite/build2-BMK0OFVt.mjs +0 -16
- package/dist/exports/vite/chunk-CxnlK1Zi.mjs +0 -1
- package/dist/exports/vite/chunk-PtveFMYu.mjs +0 -1
- package/dist/exports/vite/dist-Bxp8DqWh.mjs +0 -114
- package/dist/exports/vite/dist-CX51FKbX.mjs +0 -1
- package/dist/exports/vite/dist-DcyNr-KR.mjs +0 -1
- package/dist/exports/vite/dist-j3-Khlzt.mjs +0 -1
- package/dist/exports/vite/experimental-index-3KsfmUbz.mjs +0 -1
- package/dist/exports/vite/false-BNJbUKYT.mjs +0 -1
- package/dist/exports/vite/false-BvrPEDU6.mjs +0 -1
- package/dist/exports/vite/internal-C5cVwRiK.mjs +0 -1
- package/dist/exports/vite/jiti-BjSPrFvg.mjs +0 -9
- package/dist/exports/vite/lexer-DQCqS3nf-C6xCDOEQ.mjs +0 -3
- package/dist/exports/vite/lib-CMv7Sfwa.mjs +0 -1
- package/dist/exports/vite/lib-D9TnS-7w.mjs +0 -1
- package/dist/exports/vite/node-DI8AnY_i.mjs +0 -437
- package/dist/exports/vite/postcss-BtmDpj-c.mjs +0 -32
- package/dist/exports/vite/postcss-import-Bk_ZCd6c.mjs +0 -5
- package/dist/exports/vite/rolldown-build-CNW2eye_-CJNfyXdF.mjs +0 -13
- package/dist/exports/vitest/api-CPv6lnxG.mjs +0 -27
- package/dist/exports/vitest/build2-28i3OiJ3.mjs +0 -16
- package/dist/exports/vitest/chunk-_e2jlDPK.mjs +0 -1
- package/dist/exports/vitest/chunk-jwDkFoXW.mjs +0 -1
- package/dist/exports/vitest/dist-L-OpshPJ.mjs +0 -114
- package/dist/exports/vitest/jiti-eNGOyHIo.mjs +0 -9
- package/dist/exports/vitest/lexer-DQCqS3nf-TWLyIqlY.mjs +0 -3
- package/dist/exports/vitest/lib-C3G64csm.mjs +0 -1
- package/dist/exports/vitest/magic-string.es-CxM5Ubyl.mjs +0 -14
- package/dist/exports/vitest/module-runner-DsF4L04D.mjs +0 -1
- package/dist/exports/vitest/postcss-BxLp_Too.mjs +0 -32
- package/dist/exports/vitest/postcss-import-5pKj3f5q.mjs +0 -5
- /package/dist/exports/tests/{constants-DHjjg05J.mjs → constants-D_m07gCJ.mjs} +0 -0
- /package/dist/exports/tests/{dist-EfrRkq5c.mjs → dist-Cx2HEBOB.mjs} +0 -0
- /package/dist/exports/tests/{dist-D6vgKv3t.mjs → dist-DnACOvNW.mjs} +0 -0
- /package/dist/exports/tests/{pdf-BDsS3vjF.mjs → pdf-lZ-as2o7.mjs} +0 -0
- /package/dist/exports/tests/{table-CbU04119.mjs → table-CmPSf_pE.mjs} +0 -0
- /package/dist/exports/tests/{workflow-DwZxTqdH.mjs → workflow-BWRWyC83.mjs} +0 -0
- /package/dist/exports/tests/{zod-DcpxsMPz.mjs → zod-CkJO9qpV.mjs} +0 -0
|
@@ -1,2497 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.bun/@tanstack+query-devtools@5.91.1/node_modules/@tanstack/query-devtools/build/chunk/EIDV623S.js
|
|
2
|
-
var sharedConfig = {
|
|
3
|
-
context: void 0,
|
|
4
|
-
registry: void 0,
|
|
5
|
-
effects: void 0,
|
|
6
|
-
done: false,
|
|
7
|
-
getContextId() {
|
|
8
|
-
return getContextId(this.context.count);
|
|
9
|
-
},
|
|
10
|
-
getNextContextId() {
|
|
11
|
-
return getContextId(this.context.count++);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
function getContextId(count) {
|
|
15
|
-
const num = String(count), len = num.length - 1;
|
|
16
|
-
return sharedConfig.context.id + (len ? String.fromCharCode(96 + len) : "") + num;
|
|
17
|
-
}
|
|
18
|
-
function setHydrateContext(context) {
|
|
19
|
-
sharedConfig.context = context;
|
|
20
|
-
}
|
|
21
|
-
function nextHydrateContext() {
|
|
22
|
-
return {
|
|
23
|
-
...sharedConfig.context,
|
|
24
|
-
id: sharedConfig.getNextContextId(),
|
|
25
|
-
count: 0
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
var IS_DEV = false;
|
|
29
|
-
var equalFn = (a, b) => a === b;
|
|
30
|
-
var $PROXY = Symbol("solid-proxy");
|
|
31
|
-
var SUPPORTS_PROXY = typeof Proxy === "function";
|
|
32
|
-
var $TRACK = Symbol("solid-track");
|
|
33
|
-
var signalOptions = { equals: equalFn };
|
|
34
|
-
var ERROR = null;
|
|
35
|
-
var runEffects = runQueue;
|
|
36
|
-
var STALE = 1;
|
|
37
|
-
var PENDING = 2;
|
|
38
|
-
var UNOWNED = {
|
|
39
|
-
owned: null,
|
|
40
|
-
cleanups: null,
|
|
41
|
-
context: null,
|
|
42
|
-
owner: null
|
|
43
|
-
};
|
|
44
|
-
var NO_INIT = {};
|
|
45
|
-
var Owner = null;
|
|
46
|
-
var Transition = null;
|
|
47
|
-
var Scheduler = null;
|
|
48
|
-
var ExternalSourceConfig = null;
|
|
49
|
-
var Listener = null;
|
|
50
|
-
var Updates = null;
|
|
51
|
-
var Effects = null;
|
|
52
|
-
var ExecCount = 0;
|
|
53
|
-
function createRoot(fn, detachedOwner) {
|
|
54
|
-
const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {
|
|
55
|
-
owned: null,
|
|
56
|
-
cleanups: null,
|
|
57
|
-
context: current ? current.context : null,
|
|
58
|
-
owner: current
|
|
59
|
-
}, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));
|
|
60
|
-
Owner = root;
|
|
61
|
-
Listener = null;
|
|
62
|
-
try {
|
|
63
|
-
return runUpdates(updateFn, true);
|
|
64
|
-
} finally {
|
|
65
|
-
Listener = listener;
|
|
66
|
-
Owner = owner;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
function createSignal(value, options) {
|
|
70
|
-
options = options ? Object.assign({}, signalOptions, options) : signalOptions;
|
|
71
|
-
const s = {
|
|
72
|
-
value,
|
|
73
|
-
observers: null,
|
|
74
|
-
observerSlots: null,
|
|
75
|
-
comparator: options.equals || void 0
|
|
76
|
-
};
|
|
77
|
-
const setter = (value2) => {
|
|
78
|
-
if (typeof value2 === "function") if (Transition && Transition.running && Transition.sources.has(s)) value2 = value2(s.tValue);
|
|
79
|
-
else value2 = value2(s.value);
|
|
80
|
-
return writeSignal(s, value2);
|
|
81
|
-
};
|
|
82
|
-
return [readSignal.bind(s), setter];
|
|
83
|
-
}
|
|
84
|
-
function createComputed(fn, value, options) {
|
|
85
|
-
const c = createComputation(fn, value, true, STALE);
|
|
86
|
-
if (Scheduler && Transition && Transition.running) Updates.push(c);
|
|
87
|
-
else updateComputation(c);
|
|
88
|
-
}
|
|
89
|
-
function createRenderEffect(fn, value, options) {
|
|
90
|
-
const c = createComputation(fn, value, false, STALE);
|
|
91
|
-
if (Scheduler && Transition && Transition.running) Updates.push(c);
|
|
92
|
-
else updateComputation(c);
|
|
93
|
-
}
|
|
94
|
-
function createEffect(fn, value, options) {
|
|
95
|
-
runEffects = runUserEffects;
|
|
96
|
-
const c = createComputation(fn, value, false, STALE), s = SuspenseContext && useContext(SuspenseContext);
|
|
97
|
-
if (s) c.suspense = s;
|
|
98
|
-
if (!options || !options.render) c.user = true;
|
|
99
|
-
Effects ? Effects.push(c) : updateComputation(c);
|
|
100
|
-
}
|
|
101
|
-
function createMemo(fn, value, options) {
|
|
102
|
-
options = options ? Object.assign({}, signalOptions, options) : signalOptions;
|
|
103
|
-
const c = createComputation(fn, value, true, 0);
|
|
104
|
-
c.observers = null;
|
|
105
|
-
c.observerSlots = null;
|
|
106
|
-
c.comparator = options.equals || void 0;
|
|
107
|
-
if (Scheduler && Transition && Transition.running) {
|
|
108
|
-
c.tState = STALE;
|
|
109
|
-
Updates.push(c);
|
|
110
|
-
} else updateComputation(c);
|
|
111
|
-
return readSignal.bind(c);
|
|
112
|
-
}
|
|
113
|
-
function isPromise(v) {
|
|
114
|
-
return v && typeof v === "object" && "then" in v;
|
|
115
|
-
}
|
|
116
|
-
function createResource(pSource, pFetcher, pOptions) {
|
|
117
|
-
let source;
|
|
118
|
-
let fetcher;
|
|
119
|
-
let options;
|
|
120
|
-
source = true;
|
|
121
|
-
fetcher = pSource;
|
|
122
|
-
options = {};
|
|
123
|
-
let pr = null, initP = NO_INIT, id = null, loadedUnderTransition = false, scheduled = false, resolved = "initialValue" in options, dynamic = typeof source === "function" && createMemo(source);
|
|
124
|
-
const contexts = /* @__PURE__ */ new Set(), [value, setValue] = (options.storage || createSignal)(options.initialValue), [error, setError] = createSignal(void 0), [track, trigger] = createSignal(void 0, { equals: false }), [state, setState] = createSignal(resolved ? "ready" : "unresolved");
|
|
125
|
-
if (sharedConfig.context) {
|
|
126
|
-
id = sharedConfig.getNextContextId();
|
|
127
|
-
if (options.ssrLoadFrom === "initial") initP = options.initialValue;
|
|
128
|
-
else if (sharedConfig.load && sharedConfig.has(id)) initP = sharedConfig.load(id);
|
|
129
|
-
}
|
|
130
|
-
function loadEnd(p, v, error2, key) {
|
|
131
|
-
if (pr === p) {
|
|
132
|
-
pr = null;
|
|
133
|
-
key !== void 0 && (resolved = true);
|
|
134
|
-
if ((p === initP || v === initP) && options.onHydrated) queueMicrotask(() => options.onHydrated(key, { value: v }));
|
|
135
|
-
initP = NO_INIT;
|
|
136
|
-
if (Transition && p && loadedUnderTransition) {
|
|
137
|
-
Transition.promises.delete(p);
|
|
138
|
-
loadedUnderTransition = false;
|
|
139
|
-
runUpdates(() => {
|
|
140
|
-
Transition.running = true;
|
|
141
|
-
completeLoad(v, error2);
|
|
142
|
-
}, false);
|
|
143
|
-
} else completeLoad(v, error2);
|
|
144
|
-
}
|
|
145
|
-
return v;
|
|
146
|
-
}
|
|
147
|
-
function completeLoad(v, err) {
|
|
148
|
-
runUpdates(() => {
|
|
149
|
-
if (err === void 0) setValue(() => v);
|
|
150
|
-
setState(err !== void 0 ? "errored" : resolved ? "ready" : "unresolved");
|
|
151
|
-
setError(err);
|
|
152
|
-
for (const c of contexts.keys()) c.decrement();
|
|
153
|
-
contexts.clear();
|
|
154
|
-
}, false);
|
|
155
|
-
}
|
|
156
|
-
function read() {
|
|
157
|
-
const c = SuspenseContext && useContext(SuspenseContext), v = value(), err = error();
|
|
158
|
-
if (err !== void 0 && !pr) throw err;
|
|
159
|
-
if (Listener && !Listener.user && c) createComputed(() => {
|
|
160
|
-
track();
|
|
161
|
-
if (pr) {
|
|
162
|
-
if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);
|
|
163
|
-
else if (!contexts.has(c)) {
|
|
164
|
-
c.increment();
|
|
165
|
-
contexts.add(c);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
return v;
|
|
170
|
-
}
|
|
171
|
-
function load(refetching = true) {
|
|
172
|
-
if (refetching !== false && scheduled) return;
|
|
173
|
-
scheduled = false;
|
|
174
|
-
const lookup = dynamic ? dynamic() : source;
|
|
175
|
-
loadedUnderTransition = Transition && Transition.running;
|
|
176
|
-
if (lookup == null || lookup === false) {
|
|
177
|
-
loadEnd(pr, untrack(value));
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
if (Transition && pr) Transition.promises.delete(pr);
|
|
181
|
-
let error2;
|
|
182
|
-
const p = initP !== NO_INIT ? initP : untrack(() => {
|
|
183
|
-
try {
|
|
184
|
-
return fetcher(lookup, {
|
|
185
|
-
value: value(),
|
|
186
|
-
refetching
|
|
187
|
-
});
|
|
188
|
-
} catch (fetcherError) {
|
|
189
|
-
error2 = fetcherError;
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
if (error2 !== void 0) {
|
|
193
|
-
loadEnd(pr, void 0, castError(error2), lookup);
|
|
194
|
-
return;
|
|
195
|
-
} else if (!isPromise(p)) {
|
|
196
|
-
loadEnd(pr, p, void 0, lookup);
|
|
197
|
-
return p;
|
|
198
|
-
}
|
|
199
|
-
pr = p;
|
|
200
|
-
if ("v" in p) {
|
|
201
|
-
if (p.s === 1) loadEnd(pr, p.v, void 0, lookup);
|
|
202
|
-
else loadEnd(pr, void 0, castError(p.v), lookup);
|
|
203
|
-
return p;
|
|
204
|
-
}
|
|
205
|
-
scheduled = true;
|
|
206
|
-
queueMicrotask(() => scheduled = false);
|
|
207
|
-
runUpdates(() => {
|
|
208
|
-
setState(resolved ? "refreshing" : "pending");
|
|
209
|
-
trigger();
|
|
210
|
-
}, false);
|
|
211
|
-
return p.then((v) => loadEnd(p, v, void 0, lookup), (e) => loadEnd(p, void 0, castError(e), lookup));
|
|
212
|
-
}
|
|
213
|
-
Object.defineProperties(read, {
|
|
214
|
-
state: { get: () => state() },
|
|
215
|
-
error: { get: () => error() },
|
|
216
|
-
loading: { get() {
|
|
217
|
-
const s = state();
|
|
218
|
-
return s === "pending" || s === "refreshing";
|
|
219
|
-
} },
|
|
220
|
-
latest: { get() {
|
|
221
|
-
if (!resolved) return read();
|
|
222
|
-
const err = error();
|
|
223
|
-
if (err && !pr) throw err;
|
|
224
|
-
return value();
|
|
225
|
-
} }
|
|
226
|
-
});
|
|
227
|
-
let owner = Owner;
|
|
228
|
-
if (dynamic) createComputed(() => (owner = Owner, load(false)));
|
|
229
|
-
else load(false);
|
|
230
|
-
return [read, {
|
|
231
|
-
refetch: (info) => runWithOwner(owner, () => load(info)),
|
|
232
|
-
mutate: setValue
|
|
233
|
-
}];
|
|
234
|
-
}
|
|
235
|
-
function batch(fn) {
|
|
236
|
-
return runUpdates(fn, false);
|
|
237
|
-
}
|
|
238
|
-
function untrack(fn) {
|
|
239
|
-
if (!ExternalSourceConfig && Listener === null) return fn();
|
|
240
|
-
const listener = Listener;
|
|
241
|
-
Listener = null;
|
|
242
|
-
try {
|
|
243
|
-
if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);
|
|
244
|
-
return fn();
|
|
245
|
-
} finally {
|
|
246
|
-
Listener = listener;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
function on(deps, fn, options) {
|
|
250
|
-
const isArray3 = Array.isArray(deps);
|
|
251
|
-
let prevInput;
|
|
252
|
-
let defer = options && options.defer;
|
|
253
|
-
return (prevValue) => {
|
|
254
|
-
let input;
|
|
255
|
-
if (isArray3) {
|
|
256
|
-
input = Array(deps.length);
|
|
257
|
-
for (let i = 0; i < deps.length; i++) input[i] = deps[i]();
|
|
258
|
-
} else input = deps();
|
|
259
|
-
if (defer) {
|
|
260
|
-
defer = false;
|
|
261
|
-
return prevValue;
|
|
262
|
-
}
|
|
263
|
-
const result = untrack(() => fn(input, prevInput, prevValue));
|
|
264
|
-
prevInput = input;
|
|
265
|
-
return result;
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
function onMount(fn) {
|
|
269
|
-
createEffect(() => untrack(fn));
|
|
270
|
-
}
|
|
271
|
-
function onCleanup(fn) {
|
|
272
|
-
if (Owner === null);
|
|
273
|
-
else if (Owner.cleanups === null) Owner.cleanups = [fn];
|
|
274
|
-
else Owner.cleanups.push(fn);
|
|
275
|
-
return fn;
|
|
276
|
-
}
|
|
277
|
-
function getOwner() {
|
|
278
|
-
return Owner;
|
|
279
|
-
}
|
|
280
|
-
function runWithOwner(o, fn) {
|
|
281
|
-
const prev = Owner;
|
|
282
|
-
const prevListener = Listener;
|
|
283
|
-
Owner = o;
|
|
284
|
-
Listener = null;
|
|
285
|
-
try {
|
|
286
|
-
return runUpdates(fn, true);
|
|
287
|
-
} catch (err) {
|
|
288
|
-
handleError(err);
|
|
289
|
-
} finally {
|
|
290
|
-
Owner = prev;
|
|
291
|
-
Listener = prevListener;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
function startTransition(fn) {
|
|
295
|
-
if (Transition && Transition.running) {
|
|
296
|
-
fn();
|
|
297
|
-
return Transition.done;
|
|
298
|
-
}
|
|
299
|
-
const l = Listener;
|
|
300
|
-
const o = Owner;
|
|
301
|
-
return Promise.resolve().then(() => {
|
|
302
|
-
Listener = l;
|
|
303
|
-
Owner = o;
|
|
304
|
-
let t;
|
|
305
|
-
if (Scheduler || SuspenseContext) {
|
|
306
|
-
t = Transition || (Transition = {
|
|
307
|
-
sources: /* @__PURE__ */ new Set(),
|
|
308
|
-
effects: [],
|
|
309
|
-
promises: /* @__PURE__ */ new Set(),
|
|
310
|
-
disposed: /* @__PURE__ */ new Set(),
|
|
311
|
-
queue: /* @__PURE__ */ new Set(),
|
|
312
|
-
running: true
|
|
313
|
-
});
|
|
314
|
-
t.done || (t.done = new Promise((res) => t.resolve = res));
|
|
315
|
-
t.running = true;
|
|
316
|
-
}
|
|
317
|
-
runUpdates(fn, false);
|
|
318
|
-
Listener = Owner = null;
|
|
319
|
-
return t ? t.done : void 0;
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
var [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
|
|
323
|
-
function useTransition() {
|
|
324
|
-
return [transPending, startTransition];
|
|
325
|
-
}
|
|
326
|
-
function createContext(defaultValue, options) {
|
|
327
|
-
const id = Symbol("context");
|
|
328
|
-
return {
|
|
329
|
-
id,
|
|
330
|
-
Provider: createProvider(id),
|
|
331
|
-
defaultValue
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
function useContext(context) {
|
|
335
|
-
let value;
|
|
336
|
-
return Owner && Owner.context && (value = Owner.context[context.id]) !== void 0 ? value : context.defaultValue;
|
|
337
|
-
}
|
|
338
|
-
function children(fn) {
|
|
339
|
-
const children2 = createMemo(fn);
|
|
340
|
-
const memo2 = createMemo(() => resolveChildren(children2()));
|
|
341
|
-
memo2.toArray = () => {
|
|
342
|
-
const c = memo2();
|
|
343
|
-
return Array.isArray(c) ? c : c != null ? [c] : [];
|
|
344
|
-
};
|
|
345
|
-
return memo2;
|
|
346
|
-
}
|
|
347
|
-
var SuspenseContext;
|
|
348
|
-
function readSignal() {
|
|
349
|
-
const runningTransition = Transition && Transition.running;
|
|
350
|
-
if (this.sources && (runningTransition ? this.tState : this.state)) if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);
|
|
351
|
-
else {
|
|
352
|
-
const updates = Updates;
|
|
353
|
-
Updates = null;
|
|
354
|
-
runUpdates(() => lookUpstream(this), false);
|
|
355
|
-
Updates = updates;
|
|
356
|
-
}
|
|
357
|
-
if (Listener) {
|
|
358
|
-
const sSlot = this.observers ? this.observers.length : 0;
|
|
359
|
-
if (!Listener.sources) {
|
|
360
|
-
Listener.sources = [this];
|
|
361
|
-
Listener.sourceSlots = [sSlot];
|
|
362
|
-
} else {
|
|
363
|
-
Listener.sources.push(this);
|
|
364
|
-
Listener.sourceSlots.push(sSlot);
|
|
365
|
-
}
|
|
366
|
-
if (!this.observers) {
|
|
367
|
-
this.observers = [Listener];
|
|
368
|
-
this.observerSlots = [Listener.sources.length - 1];
|
|
369
|
-
} else {
|
|
370
|
-
this.observers.push(Listener);
|
|
371
|
-
this.observerSlots.push(Listener.sources.length - 1);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
if (runningTransition && Transition.sources.has(this)) return this.tValue;
|
|
375
|
-
return this.value;
|
|
376
|
-
}
|
|
377
|
-
function writeSignal(node, value, isComp) {
|
|
378
|
-
let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
|
|
379
|
-
if (!node.comparator || !node.comparator(current, value)) {
|
|
380
|
-
if (Transition) {
|
|
381
|
-
const TransitionRunning = Transition.running;
|
|
382
|
-
if (TransitionRunning || !isComp && Transition.sources.has(node)) {
|
|
383
|
-
Transition.sources.add(node);
|
|
384
|
-
node.tValue = value;
|
|
385
|
-
}
|
|
386
|
-
if (!TransitionRunning) node.value = value;
|
|
387
|
-
} else node.value = value;
|
|
388
|
-
if (node.observers && node.observers.length) runUpdates(() => {
|
|
389
|
-
for (let i = 0; i < node.observers.length; i += 1) {
|
|
390
|
-
const o = node.observers[i];
|
|
391
|
-
const TransitionRunning = Transition && Transition.running;
|
|
392
|
-
if (TransitionRunning && Transition.disposed.has(o)) continue;
|
|
393
|
-
if (TransitionRunning ? !o.tState : !o.state) {
|
|
394
|
-
if (o.pure) Updates.push(o);
|
|
395
|
-
else Effects.push(o);
|
|
396
|
-
if (o.observers) markDownstream(o);
|
|
397
|
-
}
|
|
398
|
-
if (!TransitionRunning) o.state = STALE;
|
|
399
|
-
else o.tState = STALE;
|
|
400
|
-
}
|
|
401
|
-
if (Updates.length > 1e6) {
|
|
402
|
-
Updates = [];
|
|
403
|
-
if (IS_DEV);
|
|
404
|
-
throw new Error();
|
|
405
|
-
}
|
|
406
|
-
}, false);
|
|
407
|
-
}
|
|
408
|
-
return value;
|
|
409
|
-
}
|
|
410
|
-
function updateComputation(node) {
|
|
411
|
-
if (!node.fn) return;
|
|
412
|
-
cleanNode(node);
|
|
413
|
-
const time = ExecCount;
|
|
414
|
-
runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
|
|
415
|
-
if (Transition && !Transition.running && Transition.sources.has(node)) queueMicrotask(() => {
|
|
416
|
-
runUpdates(() => {
|
|
417
|
-
Transition && (Transition.running = true);
|
|
418
|
-
Listener = Owner = node;
|
|
419
|
-
runComputation(node, node.tValue, time);
|
|
420
|
-
Listener = Owner = null;
|
|
421
|
-
}, false);
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
function runComputation(node, value, time) {
|
|
425
|
-
let nextValue;
|
|
426
|
-
const owner = Owner, listener = Listener;
|
|
427
|
-
Listener = Owner = node;
|
|
428
|
-
try {
|
|
429
|
-
nextValue = node.fn(value);
|
|
430
|
-
} catch (err) {
|
|
431
|
-
if (node.pure) if (Transition && Transition.running) {
|
|
432
|
-
node.tState = STALE;
|
|
433
|
-
node.tOwned && node.tOwned.forEach(cleanNode);
|
|
434
|
-
node.tOwned = void 0;
|
|
435
|
-
} else {
|
|
436
|
-
node.state = STALE;
|
|
437
|
-
node.owned && node.owned.forEach(cleanNode);
|
|
438
|
-
node.owned = null;
|
|
439
|
-
}
|
|
440
|
-
node.updatedAt = time + 1;
|
|
441
|
-
return handleError(err);
|
|
442
|
-
} finally {
|
|
443
|
-
Listener = listener;
|
|
444
|
-
Owner = owner;
|
|
445
|
-
}
|
|
446
|
-
if (!node.updatedAt || node.updatedAt <= time) {
|
|
447
|
-
if (node.updatedAt != null && "observers" in node) writeSignal(node, nextValue, true);
|
|
448
|
-
else if (Transition && Transition.running && node.pure) {
|
|
449
|
-
Transition.sources.add(node);
|
|
450
|
-
node.tValue = nextValue;
|
|
451
|
-
} else node.value = nextValue;
|
|
452
|
-
node.updatedAt = time;
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
function createComputation(fn, init, pure, state = STALE, options) {
|
|
456
|
-
const c = {
|
|
457
|
-
fn,
|
|
458
|
-
state,
|
|
459
|
-
updatedAt: null,
|
|
460
|
-
owned: null,
|
|
461
|
-
sources: null,
|
|
462
|
-
sourceSlots: null,
|
|
463
|
-
cleanups: null,
|
|
464
|
-
value: init,
|
|
465
|
-
owner: Owner,
|
|
466
|
-
context: Owner ? Owner.context : null,
|
|
467
|
-
pure
|
|
468
|
-
};
|
|
469
|
-
if (Transition && Transition.running) {
|
|
470
|
-
c.state = 0;
|
|
471
|
-
c.tState = state;
|
|
472
|
-
}
|
|
473
|
-
if (Owner === null);
|
|
474
|
-
else if (Owner !== UNOWNED) if (Transition && Transition.running && Owner.pure) if (!Owner.tOwned) Owner.tOwned = [c];
|
|
475
|
-
else Owner.tOwned.push(c);
|
|
476
|
-
else if (!Owner.owned) Owner.owned = [c];
|
|
477
|
-
else Owner.owned.push(c);
|
|
478
|
-
if (ExternalSourceConfig && c.fn) {
|
|
479
|
-
const [track, trigger] = createSignal(void 0, { equals: false });
|
|
480
|
-
const ordinary = ExternalSourceConfig.factory(c.fn, trigger);
|
|
481
|
-
onCleanup(() => ordinary.dispose());
|
|
482
|
-
const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());
|
|
483
|
-
const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);
|
|
484
|
-
c.fn = (x) => {
|
|
485
|
-
track();
|
|
486
|
-
return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);
|
|
487
|
-
};
|
|
488
|
-
}
|
|
489
|
-
return c;
|
|
490
|
-
}
|
|
491
|
-
function runTop(node) {
|
|
492
|
-
const runningTransition = Transition && Transition.running;
|
|
493
|
-
if ((runningTransition ? node.tState : node.state) === 0) return;
|
|
494
|
-
if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);
|
|
495
|
-
if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);
|
|
496
|
-
const ancestors = [node];
|
|
497
|
-
while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
|
|
498
|
-
if (runningTransition && Transition.disposed.has(node)) return;
|
|
499
|
-
if (runningTransition ? node.tState : node.state) ancestors.push(node);
|
|
500
|
-
}
|
|
501
|
-
for (let i = ancestors.length - 1; i >= 0; i--) {
|
|
502
|
-
node = ancestors[i];
|
|
503
|
-
if (runningTransition) {
|
|
504
|
-
let top = node, prev = ancestors[i + 1];
|
|
505
|
-
while ((top = top.owner) && top !== prev) if (Transition.disposed.has(top)) return;
|
|
506
|
-
}
|
|
507
|
-
if ((runningTransition ? node.tState : node.state) === STALE) updateComputation(node);
|
|
508
|
-
else if ((runningTransition ? node.tState : node.state) === PENDING) {
|
|
509
|
-
const updates = Updates;
|
|
510
|
-
Updates = null;
|
|
511
|
-
runUpdates(() => lookUpstream(node, ancestors[0]), false);
|
|
512
|
-
Updates = updates;
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
function runUpdates(fn, init) {
|
|
517
|
-
if (Updates) return fn();
|
|
518
|
-
let wait = false;
|
|
519
|
-
if (!init) Updates = [];
|
|
520
|
-
if (Effects) wait = true;
|
|
521
|
-
else Effects = [];
|
|
522
|
-
ExecCount++;
|
|
523
|
-
try {
|
|
524
|
-
const res = fn();
|
|
525
|
-
completeUpdates(wait);
|
|
526
|
-
return res;
|
|
527
|
-
} catch (err) {
|
|
528
|
-
if (!wait) Effects = null;
|
|
529
|
-
Updates = null;
|
|
530
|
-
handleError(err);
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
function completeUpdates(wait) {
|
|
534
|
-
if (Updates) {
|
|
535
|
-
if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);
|
|
536
|
-
else runQueue(Updates);
|
|
537
|
-
Updates = null;
|
|
538
|
-
}
|
|
539
|
-
if (wait) return;
|
|
540
|
-
let res;
|
|
541
|
-
if (Transition) {
|
|
542
|
-
if (!Transition.promises.size && !Transition.queue.size) {
|
|
543
|
-
const sources = Transition.sources;
|
|
544
|
-
const disposed = Transition.disposed;
|
|
545
|
-
Effects.push.apply(Effects, Transition.effects);
|
|
546
|
-
res = Transition.resolve;
|
|
547
|
-
for (const e2 of Effects) {
|
|
548
|
-
"tState" in e2 && (e2.state = e2.tState);
|
|
549
|
-
delete e2.tState;
|
|
550
|
-
}
|
|
551
|
-
Transition = null;
|
|
552
|
-
runUpdates(() => {
|
|
553
|
-
for (const d of disposed) cleanNode(d);
|
|
554
|
-
for (const v of sources) {
|
|
555
|
-
v.value = v.tValue;
|
|
556
|
-
if (v.owned) for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);
|
|
557
|
-
if (v.tOwned) v.owned = v.tOwned;
|
|
558
|
-
delete v.tValue;
|
|
559
|
-
delete v.tOwned;
|
|
560
|
-
v.tState = 0;
|
|
561
|
-
}
|
|
562
|
-
setTransPending(false);
|
|
563
|
-
}, false);
|
|
564
|
-
} else if (Transition.running) {
|
|
565
|
-
Transition.running = false;
|
|
566
|
-
Transition.effects.push.apply(Transition.effects, Effects);
|
|
567
|
-
Effects = null;
|
|
568
|
-
setTransPending(true);
|
|
569
|
-
return;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
const e = Effects;
|
|
573
|
-
Effects = null;
|
|
574
|
-
if (e.length) runUpdates(() => runEffects(e), false);
|
|
575
|
-
if (res) res();
|
|
576
|
-
}
|
|
577
|
-
function runQueue(queue) {
|
|
578
|
-
for (let i = 0; i < queue.length; i++) runTop(queue[i]);
|
|
579
|
-
}
|
|
580
|
-
function scheduleQueue(queue) {
|
|
581
|
-
for (let i = 0; i < queue.length; i++) {
|
|
582
|
-
const item = queue[i];
|
|
583
|
-
const tasks = Transition.queue;
|
|
584
|
-
if (!tasks.has(item)) {
|
|
585
|
-
tasks.add(item);
|
|
586
|
-
Scheduler(() => {
|
|
587
|
-
tasks.delete(item);
|
|
588
|
-
runUpdates(() => {
|
|
589
|
-
Transition.running = true;
|
|
590
|
-
runTop(item);
|
|
591
|
-
}, false);
|
|
592
|
-
Transition && (Transition.running = false);
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
function runUserEffects(queue) {
|
|
598
|
-
let i, userLength = 0;
|
|
599
|
-
for (i = 0; i < queue.length; i++) {
|
|
600
|
-
const e = queue[i];
|
|
601
|
-
if (!e.user) runTop(e);
|
|
602
|
-
else queue[userLength++] = e;
|
|
603
|
-
}
|
|
604
|
-
if (sharedConfig.context) {
|
|
605
|
-
if (sharedConfig.count) {
|
|
606
|
-
sharedConfig.effects || (sharedConfig.effects = []);
|
|
607
|
-
sharedConfig.effects.push(...queue.slice(0, userLength));
|
|
608
|
-
return;
|
|
609
|
-
}
|
|
610
|
-
setHydrateContext();
|
|
611
|
-
}
|
|
612
|
-
if (sharedConfig.effects && (sharedConfig.done || !sharedConfig.count)) {
|
|
613
|
-
queue = [...sharedConfig.effects, ...queue];
|
|
614
|
-
userLength += sharedConfig.effects.length;
|
|
615
|
-
delete sharedConfig.effects;
|
|
616
|
-
}
|
|
617
|
-
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
618
|
-
}
|
|
619
|
-
function lookUpstream(node, ignore) {
|
|
620
|
-
const runningTransition = Transition && Transition.running;
|
|
621
|
-
if (runningTransition) node.tState = 0;
|
|
622
|
-
else node.state = 0;
|
|
623
|
-
for (let i = 0; i < node.sources.length; i += 1) {
|
|
624
|
-
const source = node.sources[i];
|
|
625
|
-
if (source.sources) {
|
|
626
|
-
const state = runningTransition ? source.tState : source.state;
|
|
627
|
-
if (state === STALE) {
|
|
628
|
-
if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
|
|
629
|
-
} else if (state === PENDING) lookUpstream(source, ignore);
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
function markDownstream(node) {
|
|
634
|
-
const runningTransition = Transition && Transition.running;
|
|
635
|
-
for (let i = 0; i < node.observers.length; i += 1) {
|
|
636
|
-
const o = node.observers[i];
|
|
637
|
-
if (runningTransition ? !o.tState : !o.state) {
|
|
638
|
-
if (runningTransition) o.tState = PENDING;
|
|
639
|
-
else o.state = PENDING;
|
|
640
|
-
if (o.pure) Updates.push(o);
|
|
641
|
-
else Effects.push(o);
|
|
642
|
-
o.observers && markDownstream(o);
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
function cleanNode(node) {
|
|
647
|
-
let i;
|
|
648
|
-
if (node.sources) while (node.sources.length) {
|
|
649
|
-
const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;
|
|
650
|
-
if (obs && obs.length) {
|
|
651
|
-
const n = obs.pop(), s = source.observerSlots.pop();
|
|
652
|
-
if (index < obs.length) {
|
|
653
|
-
n.sourceSlots[s] = index;
|
|
654
|
-
obs[index] = n;
|
|
655
|
-
source.observerSlots[index] = s;
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
if (node.tOwned) {
|
|
660
|
-
for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);
|
|
661
|
-
delete node.tOwned;
|
|
662
|
-
}
|
|
663
|
-
if (Transition && Transition.running && node.pure) reset(node, true);
|
|
664
|
-
else if (node.owned) {
|
|
665
|
-
for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);
|
|
666
|
-
node.owned = null;
|
|
667
|
-
}
|
|
668
|
-
if (node.cleanups) {
|
|
669
|
-
for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
|
|
670
|
-
node.cleanups = null;
|
|
671
|
-
}
|
|
672
|
-
if (Transition && Transition.running) node.tState = 0;
|
|
673
|
-
else node.state = 0;
|
|
674
|
-
}
|
|
675
|
-
function reset(node, top) {
|
|
676
|
-
if (!top) {
|
|
677
|
-
node.tState = 0;
|
|
678
|
-
Transition.disposed.add(node);
|
|
679
|
-
}
|
|
680
|
-
if (node.owned) for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);
|
|
681
|
-
}
|
|
682
|
-
function castError(err) {
|
|
683
|
-
if (err instanceof Error) return err;
|
|
684
|
-
return new Error(typeof err === "string" ? err : "Unknown error", { cause: err });
|
|
685
|
-
}
|
|
686
|
-
function runErrors(err, fns, owner) {
|
|
687
|
-
try {
|
|
688
|
-
for (const f of fns) f(err);
|
|
689
|
-
} catch (e) {
|
|
690
|
-
handleError(e, owner && owner.owner || null);
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
function handleError(err, owner = Owner) {
|
|
694
|
-
const fns = ERROR && owner && owner.context && owner.context[ERROR];
|
|
695
|
-
const error = castError(err);
|
|
696
|
-
if (!fns) throw error;
|
|
697
|
-
if (Effects) Effects.push({
|
|
698
|
-
fn() {
|
|
699
|
-
runErrors(error, fns, owner);
|
|
700
|
-
},
|
|
701
|
-
state: STALE
|
|
702
|
-
});
|
|
703
|
-
else runErrors(error, fns, owner);
|
|
704
|
-
}
|
|
705
|
-
function resolveChildren(children2) {
|
|
706
|
-
if (typeof children2 === "function" && !children2.length) return resolveChildren(children2());
|
|
707
|
-
if (Array.isArray(children2)) {
|
|
708
|
-
const results = [];
|
|
709
|
-
for (let i = 0; i < children2.length; i++) {
|
|
710
|
-
const result = resolveChildren(children2[i]);
|
|
711
|
-
Array.isArray(result) ? results.push.apply(results, result) : results.push(result);
|
|
712
|
-
}
|
|
713
|
-
return results;
|
|
714
|
-
}
|
|
715
|
-
return children2;
|
|
716
|
-
}
|
|
717
|
-
function createProvider(id, options) {
|
|
718
|
-
return function provider(props) {
|
|
719
|
-
let res;
|
|
720
|
-
createRenderEffect(() => res = untrack(() => {
|
|
721
|
-
Owner.context = {
|
|
722
|
-
...Owner.context,
|
|
723
|
-
[id]: props.value
|
|
724
|
-
};
|
|
725
|
-
return children(() => props.children);
|
|
726
|
-
}), void 0);
|
|
727
|
-
return res;
|
|
728
|
-
};
|
|
729
|
-
}
|
|
730
|
-
var FALLBACK = Symbol("fallback");
|
|
731
|
-
function dispose(d) {
|
|
732
|
-
for (let i = 0; i < d.length; i++) d[i]();
|
|
733
|
-
}
|
|
734
|
-
function mapArray(list, mapFn, options = {}) {
|
|
735
|
-
let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;
|
|
736
|
-
onCleanup(() => dispose(disposers));
|
|
737
|
-
return () => {
|
|
738
|
-
let newItems = list() || [], newLen = newItems.length, i, j;
|
|
739
|
-
newItems[$TRACK];
|
|
740
|
-
return untrack(() => {
|
|
741
|
-
let newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;
|
|
742
|
-
if (newLen === 0) {
|
|
743
|
-
if (len !== 0) {
|
|
744
|
-
dispose(disposers);
|
|
745
|
-
disposers = [];
|
|
746
|
-
items = [];
|
|
747
|
-
mapped = [];
|
|
748
|
-
len = 0;
|
|
749
|
-
indexes && (indexes = []);
|
|
750
|
-
}
|
|
751
|
-
if (options.fallback) {
|
|
752
|
-
items = [FALLBACK];
|
|
753
|
-
mapped[0] = createRoot((disposer) => {
|
|
754
|
-
disposers[0] = disposer;
|
|
755
|
-
return options.fallback();
|
|
756
|
-
});
|
|
757
|
-
len = 1;
|
|
758
|
-
}
|
|
759
|
-
} else if (len === 0) {
|
|
760
|
-
mapped = new Array(newLen);
|
|
761
|
-
for (j = 0; j < newLen; j++) {
|
|
762
|
-
items[j] = newItems[j];
|
|
763
|
-
mapped[j] = createRoot(mapper);
|
|
764
|
-
}
|
|
765
|
-
len = newLen;
|
|
766
|
-
} else {
|
|
767
|
-
temp = new Array(newLen);
|
|
768
|
-
tempdisposers = new Array(newLen);
|
|
769
|
-
indexes && (tempIndexes = new Array(newLen));
|
|
770
|
-
for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++);
|
|
771
|
-
for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {
|
|
772
|
-
temp[newEnd] = mapped[end];
|
|
773
|
-
tempdisposers[newEnd] = disposers[end];
|
|
774
|
-
indexes && (tempIndexes[newEnd] = indexes[end]);
|
|
775
|
-
}
|
|
776
|
-
newIndices = /* @__PURE__ */ new Map();
|
|
777
|
-
newIndicesNext = new Array(newEnd + 1);
|
|
778
|
-
for (j = newEnd; j >= start; j--) {
|
|
779
|
-
item = newItems[j];
|
|
780
|
-
i = newIndices.get(item);
|
|
781
|
-
newIndicesNext[j] = i === void 0 ? -1 : i;
|
|
782
|
-
newIndices.set(item, j);
|
|
783
|
-
}
|
|
784
|
-
for (i = start; i <= end; i++) {
|
|
785
|
-
item = items[i];
|
|
786
|
-
j = newIndices.get(item);
|
|
787
|
-
if (j !== void 0 && j !== -1) {
|
|
788
|
-
temp[j] = mapped[i];
|
|
789
|
-
tempdisposers[j] = disposers[i];
|
|
790
|
-
indexes && (tempIndexes[j] = indexes[i]);
|
|
791
|
-
j = newIndicesNext[j];
|
|
792
|
-
newIndices.set(item, j);
|
|
793
|
-
} else disposers[i]();
|
|
794
|
-
}
|
|
795
|
-
for (j = start; j < newLen; j++) if (j in temp) {
|
|
796
|
-
mapped[j] = temp[j];
|
|
797
|
-
disposers[j] = tempdisposers[j];
|
|
798
|
-
if (indexes) {
|
|
799
|
-
indexes[j] = tempIndexes[j];
|
|
800
|
-
indexes[j](j);
|
|
801
|
-
}
|
|
802
|
-
} else mapped[j] = createRoot(mapper);
|
|
803
|
-
mapped = mapped.slice(0, len = newLen);
|
|
804
|
-
items = newItems.slice(0);
|
|
805
|
-
}
|
|
806
|
-
return mapped;
|
|
807
|
-
});
|
|
808
|
-
function mapper(disposer) {
|
|
809
|
-
disposers[j] = disposer;
|
|
810
|
-
if (indexes) {
|
|
811
|
-
const [s, set] = createSignal(j);
|
|
812
|
-
indexes[j] = set;
|
|
813
|
-
return mapFn(newItems[j], s);
|
|
814
|
-
}
|
|
815
|
-
return mapFn(newItems[j]);
|
|
816
|
-
}
|
|
817
|
-
};
|
|
818
|
-
}
|
|
819
|
-
function indexArray(list, mapFn, options = {}) {
|
|
820
|
-
let items = [], mapped = [], disposers = [], signals = [], len = 0, i;
|
|
821
|
-
onCleanup(() => dispose(disposers));
|
|
822
|
-
return () => {
|
|
823
|
-
const newItems = list() || [], newLen = newItems.length;
|
|
824
|
-
newItems[$TRACK];
|
|
825
|
-
return untrack(() => {
|
|
826
|
-
if (newLen === 0) {
|
|
827
|
-
if (len !== 0) {
|
|
828
|
-
dispose(disposers);
|
|
829
|
-
disposers = [];
|
|
830
|
-
items = [];
|
|
831
|
-
mapped = [];
|
|
832
|
-
len = 0;
|
|
833
|
-
signals = [];
|
|
834
|
-
}
|
|
835
|
-
if (options.fallback) {
|
|
836
|
-
items = [FALLBACK];
|
|
837
|
-
mapped[0] = createRoot((disposer) => {
|
|
838
|
-
disposers[0] = disposer;
|
|
839
|
-
return options.fallback();
|
|
840
|
-
});
|
|
841
|
-
len = 1;
|
|
842
|
-
}
|
|
843
|
-
return mapped;
|
|
844
|
-
}
|
|
845
|
-
if (items[0] === FALLBACK) {
|
|
846
|
-
disposers[0]();
|
|
847
|
-
disposers = [];
|
|
848
|
-
items = [];
|
|
849
|
-
mapped = [];
|
|
850
|
-
len = 0;
|
|
851
|
-
}
|
|
852
|
-
for (i = 0; i < newLen; i++) if (i < items.length && items[i] !== newItems[i]) signals[i](() => newItems[i]);
|
|
853
|
-
else if (i >= items.length) mapped[i] = createRoot(mapper);
|
|
854
|
-
for (; i < items.length; i++) disposers[i]();
|
|
855
|
-
len = signals.length = disposers.length = newLen;
|
|
856
|
-
items = newItems.slice(0);
|
|
857
|
-
return mapped = mapped.slice(0, len);
|
|
858
|
-
});
|
|
859
|
-
function mapper(disposer) {
|
|
860
|
-
disposers[i] = disposer;
|
|
861
|
-
const [s, set] = createSignal(newItems[i]);
|
|
862
|
-
signals[i] = set;
|
|
863
|
-
return mapFn(s, i);
|
|
864
|
-
}
|
|
865
|
-
};
|
|
866
|
-
}
|
|
867
|
-
var hydrationEnabled = false;
|
|
868
|
-
function createComponent(Comp, props) {
|
|
869
|
-
if (hydrationEnabled) {
|
|
870
|
-
if (sharedConfig.context) {
|
|
871
|
-
const c = sharedConfig.context;
|
|
872
|
-
setHydrateContext(nextHydrateContext());
|
|
873
|
-
const r = untrack(() => Comp(props || {}));
|
|
874
|
-
setHydrateContext(c);
|
|
875
|
-
return r;
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
return untrack(() => Comp(props || {}));
|
|
879
|
-
}
|
|
880
|
-
function trueFn() {
|
|
881
|
-
return true;
|
|
882
|
-
}
|
|
883
|
-
var propTraps = {
|
|
884
|
-
get(_, property, receiver) {
|
|
885
|
-
if (property === $PROXY) return receiver;
|
|
886
|
-
return _.get(property);
|
|
887
|
-
},
|
|
888
|
-
has(_, property) {
|
|
889
|
-
if (property === $PROXY) return true;
|
|
890
|
-
return _.has(property);
|
|
891
|
-
},
|
|
892
|
-
set: trueFn,
|
|
893
|
-
deleteProperty: trueFn,
|
|
894
|
-
getOwnPropertyDescriptor(_, property) {
|
|
895
|
-
return {
|
|
896
|
-
configurable: true,
|
|
897
|
-
enumerable: true,
|
|
898
|
-
get() {
|
|
899
|
-
return _.get(property);
|
|
900
|
-
},
|
|
901
|
-
set: trueFn,
|
|
902
|
-
deleteProperty: trueFn
|
|
903
|
-
};
|
|
904
|
-
},
|
|
905
|
-
ownKeys(_) {
|
|
906
|
-
return _.keys();
|
|
907
|
-
}
|
|
908
|
-
};
|
|
909
|
-
function resolveSource(s) {
|
|
910
|
-
return !(s = typeof s === "function" ? s() : s) ? {} : s;
|
|
911
|
-
}
|
|
912
|
-
function resolveSources() {
|
|
913
|
-
for (let i = 0, length = this.length; i < length; ++i) {
|
|
914
|
-
const v = this[i]();
|
|
915
|
-
if (v !== void 0) return v;
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
function mergeProps(...sources) {
|
|
919
|
-
let proxy = false;
|
|
920
|
-
for (let i = 0; i < sources.length; i++) {
|
|
921
|
-
const s = sources[i];
|
|
922
|
-
proxy = proxy || !!s && $PROXY in s;
|
|
923
|
-
sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
|
|
924
|
-
}
|
|
925
|
-
if (SUPPORTS_PROXY && proxy) return new Proxy({
|
|
926
|
-
get(property) {
|
|
927
|
-
for (let i = sources.length - 1; i >= 0; i--) {
|
|
928
|
-
const v = resolveSource(sources[i])[property];
|
|
929
|
-
if (v !== void 0) return v;
|
|
930
|
-
}
|
|
931
|
-
},
|
|
932
|
-
has(property) {
|
|
933
|
-
for (let i = sources.length - 1; i >= 0; i--) if (property in resolveSource(sources[i])) return true;
|
|
934
|
-
return false;
|
|
935
|
-
},
|
|
936
|
-
keys() {
|
|
937
|
-
const keys = [];
|
|
938
|
-
for (let i = 0; i < sources.length; i++) keys.push(...Object.keys(resolveSource(sources[i])));
|
|
939
|
-
return [...new Set(keys)];
|
|
940
|
-
}
|
|
941
|
-
}, propTraps);
|
|
942
|
-
const sourcesMap = {};
|
|
943
|
-
const defined = /* @__PURE__ */ Object.create(null);
|
|
944
|
-
for (let i = sources.length - 1; i >= 0; i--) {
|
|
945
|
-
const source = sources[i];
|
|
946
|
-
if (!source) continue;
|
|
947
|
-
const sourceKeys = Object.getOwnPropertyNames(source);
|
|
948
|
-
for (let i2 = sourceKeys.length - 1; i2 >= 0; i2--) {
|
|
949
|
-
const key = sourceKeys[i2];
|
|
950
|
-
if (key === "__proto__" || key === "constructor") continue;
|
|
951
|
-
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
952
|
-
if (!defined[key]) defined[key] = desc.get ? {
|
|
953
|
-
enumerable: true,
|
|
954
|
-
configurable: true,
|
|
955
|
-
get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])
|
|
956
|
-
} : desc.value !== void 0 ? desc : void 0;
|
|
957
|
-
else {
|
|
958
|
-
const sources2 = sourcesMap[key];
|
|
959
|
-
if (sources2) {
|
|
960
|
-
if (desc.get) sources2.push(desc.get.bind(source));
|
|
961
|
-
else if (desc.value !== void 0) sources2.push(() => desc.value);
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
const target = {};
|
|
967
|
-
const definedKeys = Object.keys(defined);
|
|
968
|
-
for (let i = definedKeys.length - 1; i >= 0; i--) {
|
|
969
|
-
const key = definedKeys[i], desc = defined[key];
|
|
970
|
-
if (desc && desc.get) Object.defineProperty(target, key, desc);
|
|
971
|
-
else target[key] = desc ? desc.value : void 0;
|
|
972
|
-
}
|
|
973
|
-
return target;
|
|
974
|
-
}
|
|
975
|
-
function splitProps(props, ...keys) {
|
|
976
|
-
if (SUPPORTS_PROXY && $PROXY in props) {
|
|
977
|
-
const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);
|
|
978
|
-
const res = keys.map((k) => {
|
|
979
|
-
return new Proxy({
|
|
980
|
-
get(property) {
|
|
981
|
-
return k.includes(property) ? props[property] : void 0;
|
|
982
|
-
},
|
|
983
|
-
has(property) {
|
|
984
|
-
return k.includes(property) && property in props;
|
|
985
|
-
},
|
|
986
|
-
keys() {
|
|
987
|
-
return k.filter((property) => property in props);
|
|
988
|
-
}
|
|
989
|
-
}, propTraps);
|
|
990
|
-
});
|
|
991
|
-
res.push(new Proxy({
|
|
992
|
-
get(property) {
|
|
993
|
-
return blocked.has(property) ? void 0 : props[property];
|
|
994
|
-
},
|
|
995
|
-
has(property) {
|
|
996
|
-
return blocked.has(property) ? false : property in props;
|
|
997
|
-
},
|
|
998
|
-
keys() {
|
|
999
|
-
return Object.keys(props).filter((k) => !blocked.has(k));
|
|
1000
|
-
}
|
|
1001
|
-
}, propTraps));
|
|
1002
|
-
return res;
|
|
1003
|
-
}
|
|
1004
|
-
const otherObject = {};
|
|
1005
|
-
const objects = keys.map(() => ({}));
|
|
1006
|
-
for (const propName of Object.getOwnPropertyNames(props)) {
|
|
1007
|
-
const desc = Object.getOwnPropertyDescriptor(props, propName);
|
|
1008
|
-
const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;
|
|
1009
|
-
let blocked = false;
|
|
1010
|
-
let objectIndex = 0;
|
|
1011
|
-
for (const k of keys) {
|
|
1012
|
-
if (k.includes(propName)) {
|
|
1013
|
-
blocked = true;
|
|
1014
|
-
isDefaultDesc ? objects[objectIndex][propName] = desc.value : Object.defineProperty(objects[objectIndex], propName, desc);
|
|
1015
|
-
}
|
|
1016
|
-
++objectIndex;
|
|
1017
|
-
}
|
|
1018
|
-
if (!blocked) isDefaultDesc ? otherObject[propName] = desc.value : Object.defineProperty(otherObject, propName, desc);
|
|
1019
|
-
}
|
|
1020
|
-
return [...objects, otherObject];
|
|
1021
|
-
}
|
|
1022
|
-
function lazy(fn) {
|
|
1023
|
-
let comp;
|
|
1024
|
-
let p;
|
|
1025
|
-
const wrap = (props) => {
|
|
1026
|
-
const ctx = sharedConfig.context;
|
|
1027
|
-
if (ctx) {
|
|
1028
|
-
const [s, set] = createSignal();
|
|
1029
|
-
sharedConfig.count || (sharedConfig.count = 0);
|
|
1030
|
-
sharedConfig.count++;
|
|
1031
|
-
(p || (p = fn())).then((mod) => {
|
|
1032
|
-
!sharedConfig.done && setHydrateContext(ctx);
|
|
1033
|
-
sharedConfig.count--;
|
|
1034
|
-
set(() => mod.default);
|
|
1035
|
-
setHydrateContext();
|
|
1036
|
-
});
|
|
1037
|
-
comp = s;
|
|
1038
|
-
} else if (!comp) {
|
|
1039
|
-
const [s] = createResource(() => (p || (p = fn())).then((mod) => mod.default));
|
|
1040
|
-
comp = s;
|
|
1041
|
-
}
|
|
1042
|
-
let Comp;
|
|
1043
|
-
return createMemo(() => (Comp = comp()) ? untrack(() => {
|
|
1044
|
-
if (IS_DEV);
|
|
1045
|
-
if (!ctx || sharedConfig.done) return Comp(props);
|
|
1046
|
-
const c = sharedConfig.context;
|
|
1047
|
-
setHydrateContext(ctx);
|
|
1048
|
-
const r = Comp(props);
|
|
1049
|
-
setHydrateContext(c);
|
|
1050
|
-
return r;
|
|
1051
|
-
}) : "");
|
|
1052
|
-
};
|
|
1053
|
-
wrap.preload = () => p || ((p = fn()).then((mod) => comp = () => mod.default), p);
|
|
1054
|
-
return wrap;
|
|
1055
|
-
}
|
|
1056
|
-
var counter = 0;
|
|
1057
|
-
function createUniqueId() {
|
|
1058
|
-
return sharedConfig.context ? sharedConfig.getNextContextId() : `cl-${counter++}`;
|
|
1059
|
-
}
|
|
1060
|
-
var narrowedError = (name) => `Stale read from <${name}>.`;
|
|
1061
|
-
function For(props) {
|
|
1062
|
-
const fallback = "fallback" in props && { fallback: () => props.fallback };
|
|
1063
|
-
return createMemo(mapArray(() => props.each, props.children, fallback || void 0));
|
|
1064
|
-
}
|
|
1065
|
-
function Index(props) {
|
|
1066
|
-
const fallback = "fallback" in props && { fallback: () => props.fallback };
|
|
1067
|
-
return createMemo(indexArray(() => props.each, props.children, fallback || void 0));
|
|
1068
|
-
}
|
|
1069
|
-
function Show(props) {
|
|
1070
|
-
const keyed = props.keyed;
|
|
1071
|
-
const conditionValue = createMemo(() => props.when, void 0, void 0);
|
|
1072
|
-
const condition = keyed ? conditionValue : createMemo(conditionValue, void 0, { equals: (a, b) => !a === !b });
|
|
1073
|
-
return createMemo(() => {
|
|
1074
|
-
const c = condition();
|
|
1075
|
-
if (c) {
|
|
1076
|
-
const child = props.children;
|
|
1077
|
-
return typeof child === "function" && child.length > 0 ? untrack(() => child(keyed ? c : () => {
|
|
1078
|
-
if (!untrack(condition)) throw narrowedError("Show");
|
|
1079
|
-
return conditionValue();
|
|
1080
|
-
})) : child;
|
|
1081
|
-
}
|
|
1082
|
-
return props.fallback;
|
|
1083
|
-
}, void 0, void 0);
|
|
1084
|
-
}
|
|
1085
|
-
function Switch(props) {
|
|
1086
|
-
const chs = children(() => props.children);
|
|
1087
|
-
const switchFunc = createMemo(() => {
|
|
1088
|
-
const ch = chs();
|
|
1089
|
-
const mps = Array.isArray(ch) ? ch : [ch];
|
|
1090
|
-
let func = () => void 0;
|
|
1091
|
-
for (let i = 0; i < mps.length; i++) {
|
|
1092
|
-
const index = i;
|
|
1093
|
-
const mp = mps[i];
|
|
1094
|
-
const prevFunc = func;
|
|
1095
|
-
const conditionValue = createMemo(() => prevFunc() ? void 0 : mp.when, void 0, void 0);
|
|
1096
|
-
const condition = mp.keyed ? conditionValue : createMemo(conditionValue, void 0, { equals: (a, b) => !a === !b });
|
|
1097
|
-
func = () => prevFunc() || (condition() ? [
|
|
1098
|
-
index,
|
|
1099
|
-
conditionValue,
|
|
1100
|
-
mp
|
|
1101
|
-
] : void 0);
|
|
1102
|
-
}
|
|
1103
|
-
return func;
|
|
1104
|
-
});
|
|
1105
|
-
return createMemo(() => {
|
|
1106
|
-
const sel = switchFunc()();
|
|
1107
|
-
if (!sel) return props.fallback;
|
|
1108
|
-
const [index, conditionValue, mp] = sel;
|
|
1109
|
-
const child = mp.children;
|
|
1110
|
-
return typeof child === "function" && child.length > 0 ? untrack(() => child(mp.keyed ? conditionValue() : () => {
|
|
1111
|
-
if (untrack(switchFunc)()?.[0] !== index) throw narrowedError("Match");
|
|
1112
|
-
return conditionValue();
|
|
1113
|
-
})) : child;
|
|
1114
|
-
}, void 0, void 0);
|
|
1115
|
-
}
|
|
1116
|
-
function Match(props) {
|
|
1117
|
-
return props;
|
|
1118
|
-
}
|
|
1119
|
-
var DEV = void 0;
|
|
1120
|
-
var Properties = /* @__PURE__ */ new Set([
|
|
1121
|
-
"className",
|
|
1122
|
-
"value",
|
|
1123
|
-
"readOnly",
|
|
1124
|
-
"noValidate",
|
|
1125
|
-
"formNoValidate",
|
|
1126
|
-
"isMap",
|
|
1127
|
-
"noModule",
|
|
1128
|
-
"playsInline",
|
|
1129
|
-
...[
|
|
1130
|
-
"allowfullscreen",
|
|
1131
|
-
"async",
|
|
1132
|
-
"autofocus",
|
|
1133
|
-
"autoplay",
|
|
1134
|
-
"checked",
|
|
1135
|
-
"controls",
|
|
1136
|
-
"default",
|
|
1137
|
-
"disabled",
|
|
1138
|
-
"formnovalidate",
|
|
1139
|
-
"hidden",
|
|
1140
|
-
"indeterminate",
|
|
1141
|
-
"inert",
|
|
1142
|
-
"ismap",
|
|
1143
|
-
"loop",
|
|
1144
|
-
"multiple",
|
|
1145
|
-
"muted",
|
|
1146
|
-
"nomodule",
|
|
1147
|
-
"novalidate",
|
|
1148
|
-
"open",
|
|
1149
|
-
"playsinline",
|
|
1150
|
-
"readonly",
|
|
1151
|
-
"required",
|
|
1152
|
-
"reversed",
|
|
1153
|
-
"seamless",
|
|
1154
|
-
"selected"
|
|
1155
|
-
]
|
|
1156
|
-
]);
|
|
1157
|
-
var ChildProperties = /* @__PURE__ */ new Set([
|
|
1158
|
-
"innerHTML",
|
|
1159
|
-
"textContent",
|
|
1160
|
-
"innerText",
|
|
1161
|
-
"children"
|
|
1162
|
-
]);
|
|
1163
|
-
var Aliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
1164
|
-
className: "class",
|
|
1165
|
-
htmlFor: "for"
|
|
1166
|
-
});
|
|
1167
|
-
var PropAliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
1168
|
-
class: "className",
|
|
1169
|
-
novalidate: {
|
|
1170
|
-
$: "noValidate",
|
|
1171
|
-
FORM: 1
|
|
1172
|
-
},
|
|
1173
|
-
formnovalidate: {
|
|
1174
|
-
$: "formNoValidate",
|
|
1175
|
-
BUTTON: 1,
|
|
1176
|
-
INPUT: 1
|
|
1177
|
-
},
|
|
1178
|
-
ismap: {
|
|
1179
|
-
$: "isMap",
|
|
1180
|
-
IMG: 1
|
|
1181
|
-
},
|
|
1182
|
-
nomodule: {
|
|
1183
|
-
$: "noModule",
|
|
1184
|
-
SCRIPT: 1
|
|
1185
|
-
},
|
|
1186
|
-
playsinline: {
|
|
1187
|
-
$: "playsInline",
|
|
1188
|
-
VIDEO: 1
|
|
1189
|
-
},
|
|
1190
|
-
readonly: {
|
|
1191
|
-
$: "readOnly",
|
|
1192
|
-
INPUT: 1,
|
|
1193
|
-
TEXTAREA: 1
|
|
1194
|
-
}
|
|
1195
|
-
});
|
|
1196
|
-
function getPropAlias(prop, tagName) {
|
|
1197
|
-
const a = PropAliases[prop];
|
|
1198
|
-
return typeof a === "object" ? a[tagName] ? a["$"] : void 0 : a;
|
|
1199
|
-
}
|
|
1200
|
-
var DelegatedEvents = /* @__PURE__ */ new Set([
|
|
1201
|
-
"beforeinput",
|
|
1202
|
-
"click",
|
|
1203
|
-
"dblclick",
|
|
1204
|
-
"contextmenu",
|
|
1205
|
-
"focusin",
|
|
1206
|
-
"focusout",
|
|
1207
|
-
"input",
|
|
1208
|
-
"keydown",
|
|
1209
|
-
"keyup",
|
|
1210
|
-
"mousedown",
|
|
1211
|
-
"mousemove",
|
|
1212
|
-
"mouseout",
|
|
1213
|
-
"mouseover",
|
|
1214
|
-
"mouseup",
|
|
1215
|
-
"pointerdown",
|
|
1216
|
-
"pointermove",
|
|
1217
|
-
"pointerout",
|
|
1218
|
-
"pointerover",
|
|
1219
|
-
"pointerup",
|
|
1220
|
-
"touchend",
|
|
1221
|
-
"touchmove",
|
|
1222
|
-
"touchstart"
|
|
1223
|
-
]);
|
|
1224
|
-
var SVGElements = /* @__PURE__ */ new Set([
|
|
1225
|
-
"altGlyph",
|
|
1226
|
-
"altGlyphDef",
|
|
1227
|
-
"altGlyphItem",
|
|
1228
|
-
"animate",
|
|
1229
|
-
"animateColor",
|
|
1230
|
-
"animateMotion",
|
|
1231
|
-
"animateTransform",
|
|
1232
|
-
"circle",
|
|
1233
|
-
"clipPath",
|
|
1234
|
-
"color-profile",
|
|
1235
|
-
"cursor",
|
|
1236
|
-
"defs",
|
|
1237
|
-
"desc",
|
|
1238
|
-
"ellipse",
|
|
1239
|
-
"feBlend",
|
|
1240
|
-
"feColorMatrix",
|
|
1241
|
-
"feComponentTransfer",
|
|
1242
|
-
"feComposite",
|
|
1243
|
-
"feConvolveMatrix",
|
|
1244
|
-
"feDiffuseLighting",
|
|
1245
|
-
"feDisplacementMap",
|
|
1246
|
-
"feDistantLight",
|
|
1247
|
-
"feDropShadow",
|
|
1248
|
-
"feFlood",
|
|
1249
|
-
"feFuncA",
|
|
1250
|
-
"feFuncB",
|
|
1251
|
-
"feFuncG",
|
|
1252
|
-
"feFuncR",
|
|
1253
|
-
"feGaussianBlur",
|
|
1254
|
-
"feImage",
|
|
1255
|
-
"feMerge",
|
|
1256
|
-
"feMergeNode",
|
|
1257
|
-
"feMorphology",
|
|
1258
|
-
"feOffset",
|
|
1259
|
-
"fePointLight",
|
|
1260
|
-
"feSpecularLighting",
|
|
1261
|
-
"feSpotLight",
|
|
1262
|
-
"feTile",
|
|
1263
|
-
"feTurbulence",
|
|
1264
|
-
"filter",
|
|
1265
|
-
"font",
|
|
1266
|
-
"font-face",
|
|
1267
|
-
"font-face-format",
|
|
1268
|
-
"font-face-name",
|
|
1269
|
-
"font-face-src",
|
|
1270
|
-
"font-face-uri",
|
|
1271
|
-
"foreignObject",
|
|
1272
|
-
"g",
|
|
1273
|
-
"glyph",
|
|
1274
|
-
"glyphRef",
|
|
1275
|
-
"hkern",
|
|
1276
|
-
"image",
|
|
1277
|
-
"line",
|
|
1278
|
-
"linearGradient",
|
|
1279
|
-
"marker",
|
|
1280
|
-
"mask",
|
|
1281
|
-
"metadata",
|
|
1282
|
-
"missing-glyph",
|
|
1283
|
-
"mpath",
|
|
1284
|
-
"path",
|
|
1285
|
-
"pattern",
|
|
1286
|
-
"polygon",
|
|
1287
|
-
"polyline",
|
|
1288
|
-
"radialGradient",
|
|
1289
|
-
"rect",
|
|
1290
|
-
"set",
|
|
1291
|
-
"stop",
|
|
1292
|
-
"svg",
|
|
1293
|
-
"switch",
|
|
1294
|
-
"symbol",
|
|
1295
|
-
"text",
|
|
1296
|
-
"textPath",
|
|
1297
|
-
"tref",
|
|
1298
|
-
"tspan",
|
|
1299
|
-
"use",
|
|
1300
|
-
"view",
|
|
1301
|
-
"vkern"
|
|
1302
|
-
]);
|
|
1303
|
-
var SVGNamespace = {
|
|
1304
|
-
xlink: "http://www.w3.org/1999/xlink",
|
|
1305
|
-
xml: "http://www.w3.org/XML/1998/namespace"
|
|
1306
|
-
};
|
|
1307
|
-
var memo = (fn) => createMemo(() => fn());
|
|
1308
|
-
function reconcileArrays(parentNode, a, b) {
|
|
1309
|
-
let bLength = b.length, aEnd = a.length, bEnd = bLength, aStart = 0, bStart = 0, after = a[aEnd - 1].nextSibling, map = null;
|
|
1310
|
-
while (aStart < aEnd || bStart < bEnd) {
|
|
1311
|
-
if (a[aStart] === b[bStart]) {
|
|
1312
|
-
aStart++;
|
|
1313
|
-
bStart++;
|
|
1314
|
-
continue;
|
|
1315
|
-
}
|
|
1316
|
-
while (a[aEnd - 1] === b[bEnd - 1]) {
|
|
1317
|
-
aEnd--;
|
|
1318
|
-
bEnd--;
|
|
1319
|
-
}
|
|
1320
|
-
if (aEnd === aStart) {
|
|
1321
|
-
const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;
|
|
1322
|
-
while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
|
|
1323
|
-
} else if (bEnd === bStart) while (aStart < aEnd) {
|
|
1324
|
-
if (!map || !map.has(a[aStart])) a[aStart].remove();
|
|
1325
|
-
aStart++;
|
|
1326
|
-
}
|
|
1327
|
-
else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
|
|
1328
|
-
const node = a[--aEnd].nextSibling;
|
|
1329
|
-
parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);
|
|
1330
|
-
parentNode.insertBefore(b[--bEnd], node);
|
|
1331
|
-
a[aEnd] = b[bEnd];
|
|
1332
|
-
} else {
|
|
1333
|
-
if (!map) {
|
|
1334
|
-
map = /* @__PURE__ */ new Map();
|
|
1335
|
-
let i = bStart;
|
|
1336
|
-
while (i < bEnd) map.set(b[i], i++);
|
|
1337
|
-
}
|
|
1338
|
-
const index = map.get(a[aStart]);
|
|
1339
|
-
if (index != null) if (bStart < index && index < bEnd) {
|
|
1340
|
-
let i = aStart, sequence = 1, t;
|
|
1341
|
-
while (++i < aEnd && i < bEnd) {
|
|
1342
|
-
if ((t = map.get(a[i])) == null || t !== index + sequence) break;
|
|
1343
|
-
sequence++;
|
|
1344
|
-
}
|
|
1345
|
-
if (sequence > index - bStart) {
|
|
1346
|
-
const node = a[aStart];
|
|
1347
|
-
while (bStart < index) parentNode.insertBefore(b[bStart++], node);
|
|
1348
|
-
} else parentNode.replaceChild(b[bStart++], a[aStart++]);
|
|
1349
|
-
} else aStart++;
|
|
1350
|
-
else a[aStart++].remove();
|
|
1351
|
-
}
|
|
1352
|
-
}
|
|
1353
|
-
}
|
|
1354
|
-
var $$EVENTS = "_$DX_DELEGATE";
|
|
1355
|
-
function render(code, element, init, options = {}) {
|
|
1356
|
-
let disposer;
|
|
1357
|
-
createRoot((dispose2) => {
|
|
1358
|
-
disposer = dispose2;
|
|
1359
|
-
element === document ? code() : insert(element, code(), element.firstChild ? null : void 0, init);
|
|
1360
|
-
}, options.owner);
|
|
1361
|
-
return () => {
|
|
1362
|
-
disposer();
|
|
1363
|
-
element.textContent = "";
|
|
1364
|
-
};
|
|
1365
|
-
}
|
|
1366
|
-
function template(html, isImportNode, isSVG, isMathML) {
|
|
1367
|
-
let node;
|
|
1368
|
-
const create = () => {
|
|
1369
|
-
const t = isMathML ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
|
|
1370
|
-
t.innerHTML = html;
|
|
1371
|
-
return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;
|
|
1372
|
-
};
|
|
1373
|
-
const fn = isImportNode ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
|
|
1374
|
-
fn.cloneNode = fn;
|
|
1375
|
-
return fn;
|
|
1376
|
-
}
|
|
1377
|
-
function delegateEvents(eventNames, document2 = window.document) {
|
|
1378
|
-
const e = document2[$$EVENTS] || (document2[$$EVENTS] = /* @__PURE__ */ new Set());
|
|
1379
|
-
for (let i = 0, l = eventNames.length; i < l; i++) {
|
|
1380
|
-
const name = eventNames[i];
|
|
1381
|
-
if (!e.has(name)) {
|
|
1382
|
-
e.add(name);
|
|
1383
|
-
document2.addEventListener(name, eventHandler);
|
|
1384
|
-
}
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
function clearDelegatedEvents(document2 = window.document) {
|
|
1388
|
-
if (document2[$$EVENTS]) {
|
|
1389
|
-
for (let name of document2[$$EVENTS].keys()) document2.removeEventListener(name, eventHandler);
|
|
1390
|
-
delete document2[$$EVENTS];
|
|
1391
|
-
}
|
|
1392
|
-
}
|
|
1393
|
-
function setAttribute(node, name, value) {
|
|
1394
|
-
if (isHydrating(node)) return;
|
|
1395
|
-
if (value == null) node.removeAttribute(name);
|
|
1396
|
-
else node.setAttribute(name, value);
|
|
1397
|
-
}
|
|
1398
|
-
function setAttributeNS(node, namespace, name, value) {
|
|
1399
|
-
if (isHydrating(node)) return;
|
|
1400
|
-
if (value == null) node.removeAttributeNS(namespace, name);
|
|
1401
|
-
else node.setAttributeNS(namespace, name, value);
|
|
1402
|
-
}
|
|
1403
|
-
function setBoolAttribute(node, name, value) {
|
|
1404
|
-
if (isHydrating(node)) return;
|
|
1405
|
-
value ? node.setAttribute(name, "") : node.removeAttribute(name);
|
|
1406
|
-
}
|
|
1407
|
-
function className(node, value) {
|
|
1408
|
-
if (isHydrating(node)) return;
|
|
1409
|
-
if (value == null) node.removeAttribute("class");
|
|
1410
|
-
else node.className = value;
|
|
1411
|
-
}
|
|
1412
|
-
function addEventListener(node, name, handler, delegate) {
|
|
1413
|
-
if (delegate) if (Array.isArray(handler)) {
|
|
1414
|
-
node[`$$${name}`] = handler[0];
|
|
1415
|
-
node[`$$${name}Data`] = handler[1];
|
|
1416
|
-
} else node[`$$${name}`] = handler;
|
|
1417
|
-
else if (Array.isArray(handler)) {
|
|
1418
|
-
const handlerFn = handler[0];
|
|
1419
|
-
node.addEventListener(name, handler[0] = (e) => handlerFn.call(node, handler[1], e));
|
|
1420
|
-
} else node.addEventListener(name, handler, typeof handler !== "function" && handler);
|
|
1421
|
-
}
|
|
1422
|
-
function classList(node, value, prev = {}) {
|
|
1423
|
-
const classKeys = Object.keys(value || {}), prevKeys = Object.keys(prev);
|
|
1424
|
-
let i, len;
|
|
1425
|
-
for (i = 0, len = prevKeys.length; i < len; i++) {
|
|
1426
|
-
const key = prevKeys[i];
|
|
1427
|
-
if (!key || key === "undefined" || value[key]) continue;
|
|
1428
|
-
toggleClassKey(node, key, false);
|
|
1429
|
-
delete prev[key];
|
|
1430
|
-
}
|
|
1431
|
-
for (i = 0, len = classKeys.length; i < len; i++) {
|
|
1432
|
-
const key = classKeys[i], classValue = !!value[key];
|
|
1433
|
-
if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue;
|
|
1434
|
-
toggleClassKey(node, key, true);
|
|
1435
|
-
prev[key] = classValue;
|
|
1436
|
-
}
|
|
1437
|
-
return prev;
|
|
1438
|
-
}
|
|
1439
|
-
function style(node, value, prev) {
|
|
1440
|
-
if (!value) return prev ? setAttribute(node, "style") : value;
|
|
1441
|
-
const nodeStyle = node.style;
|
|
1442
|
-
if (typeof value === "string") return nodeStyle.cssText = value;
|
|
1443
|
-
typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
|
|
1444
|
-
prev || (prev = {});
|
|
1445
|
-
value || (value = {});
|
|
1446
|
-
let v, s;
|
|
1447
|
-
for (s in prev) {
|
|
1448
|
-
value[s] ?? nodeStyle.removeProperty(s);
|
|
1449
|
-
delete prev[s];
|
|
1450
|
-
}
|
|
1451
|
-
for (s in value) {
|
|
1452
|
-
v = value[s];
|
|
1453
|
-
if (v !== prev[s]) {
|
|
1454
|
-
nodeStyle.setProperty(s, v);
|
|
1455
|
-
prev[s] = v;
|
|
1456
|
-
}
|
|
1457
|
-
}
|
|
1458
|
-
return prev;
|
|
1459
|
-
}
|
|
1460
|
-
function spread(node, props = {}, isSVG, skipChildren) {
|
|
1461
|
-
const prevProps = {};
|
|
1462
|
-
if (!skipChildren) createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
|
|
1463
|
-
createRenderEffect(() => typeof props.ref === "function" && use(props.ref, node));
|
|
1464
|
-
createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
|
|
1465
|
-
return prevProps;
|
|
1466
|
-
}
|
|
1467
|
-
function use(fn, element, arg) {
|
|
1468
|
-
return untrack(() => fn(element, arg));
|
|
1469
|
-
}
|
|
1470
|
-
function insert(parent, accessor, marker, initial) {
|
|
1471
|
-
if (marker !== void 0 && !initial) initial = [];
|
|
1472
|
-
if (typeof accessor !== "function") return insertExpression(parent, accessor, initial, marker);
|
|
1473
|
-
createRenderEffect((current) => insertExpression(parent, accessor(), current, marker), initial);
|
|
1474
|
-
}
|
|
1475
|
-
function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {
|
|
1476
|
-
props || (props = {});
|
|
1477
|
-
for (const prop in prevProps) if (!(prop in props)) {
|
|
1478
|
-
if (prop === "children") continue;
|
|
1479
|
-
prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef, props);
|
|
1480
|
-
}
|
|
1481
|
-
for (const prop in props) {
|
|
1482
|
-
if (prop === "children") continue;
|
|
1483
|
-
const value = props[prop];
|
|
1484
|
-
prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef, props);
|
|
1485
|
-
}
|
|
1486
|
-
}
|
|
1487
|
-
function getNextElement(template2) {
|
|
1488
|
-
let node, key;
|
|
1489
|
-
if (!isHydrating() || !(node = sharedConfig.registry.get(key = getHydrationKey()))) return template2();
|
|
1490
|
-
if (sharedConfig.completed) sharedConfig.completed.add(node);
|
|
1491
|
-
sharedConfig.registry.delete(key);
|
|
1492
|
-
return node;
|
|
1493
|
-
}
|
|
1494
|
-
function isHydrating(node) {
|
|
1495
|
-
return !!sharedConfig.context && !sharedConfig.done && (!node || node.isConnected);
|
|
1496
|
-
}
|
|
1497
|
-
function toPropertyName(name) {
|
|
1498
|
-
return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());
|
|
1499
|
-
}
|
|
1500
|
-
function toggleClassKey(node, key, value) {
|
|
1501
|
-
const classNames = key.trim().split(/\s+/);
|
|
1502
|
-
for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);
|
|
1503
|
-
}
|
|
1504
|
-
function assignProp(node, prop, value, prev, isSVG, skipRef, props) {
|
|
1505
|
-
let isCE, isProp, isChildProp, propAlias, forceProp;
|
|
1506
|
-
if (prop === "style") return style(node, value, prev);
|
|
1507
|
-
if (prop === "classList") return classList(node, value, prev);
|
|
1508
|
-
if (value === prev) return prev;
|
|
1509
|
-
if (prop === "ref") {
|
|
1510
|
-
if (!skipRef) value(node);
|
|
1511
|
-
} else if (prop.slice(0, 3) === "on:") {
|
|
1512
|
-
const e = prop.slice(3);
|
|
1513
|
-
prev && node.removeEventListener(e, prev, typeof prev !== "function" && prev);
|
|
1514
|
-
value && node.addEventListener(e, value, typeof value !== "function" && value);
|
|
1515
|
-
} else if (prop.slice(0, 10) === "oncapture:") {
|
|
1516
|
-
const e = prop.slice(10);
|
|
1517
|
-
prev && node.removeEventListener(e, prev, true);
|
|
1518
|
-
value && node.addEventListener(e, value, true);
|
|
1519
|
-
} else if (prop.slice(0, 2) === "on") {
|
|
1520
|
-
const name = prop.slice(2).toLowerCase();
|
|
1521
|
-
const delegate = DelegatedEvents.has(name);
|
|
1522
|
-
if (!delegate && prev) {
|
|
1523
|
-
const h = Array.isArray(prev) ? prev[0] : prev;
|
|
1524
|
-
node.removeEventListener(name, h);
|
|
1525
|
-
}
|
|
1526
|
-
if (delegate || value) {
|
|
1527
|
-
addEventListener(node, name, value, delegate);
|
|
1528
|
-
delegate && delegateEvents([name]);
|
|
1529
|
-
}
|
|
1530
|
-
} else if (prop.slice(0, 5) === "attr:") setAttribute(node, prop.slice(5), value);
|
|
1531
|
-
else if (prop.slice(0, 5) === "bool:") setBoolAttribute(node, prop.slice(5), value);
|
|
1532
|
-
else if ((forceProp = prop.slice(0, 5) === "prop:") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-") || "is" in props)) {
|
|
1533
|
-
if (forceProp) {
|
|
1534
|
-
prop = prop.slice(5);
|
|
1535
|
-
isProp = true;
|
|
1536
|
-
} else if (isHydrating(node)) return value;
|
|
1537
|
-
if (prop === "class" || prop === "className") className(node, value);
|
|
1538
|
-
else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;
|
|
1539
|
-
else node[propAlias || prop] = value;
|
|
1540
|
-
} else {
|
|
1541
|
-
const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
|
|
1542
|
-
if (ns) setAttributeNS(node, ns, prop, value);
|
|
1543
|
-
else setAttribute(node, Aliases[prop] || prop, value);
|
|
1544
|
-
}
|
|
1545
|
-
return value;
|
|
1546
|
-
}
|
|
1547
|
-
function eventHandler(e) {
|
|
1548
|
-
if (sharedConfig.registry && sharedConfig.events) {
|
|
1549
|
-
if (sharedConfig.events.find(([el, ev]) => ev === e)) return;
|
|
1550
|
-
}
|
|
1551
|
-
let node = e.target;
|
|
1552
|
-
const key = `$$${e.type}`;
|
|
1553
|
-
const oriTarget = e.target;
|
|
1554
|
-
const oriCurrentTarget = e.currentTarget;
|
|
1555
|
-
const retarget = (value) => Object.defineProperty(e, "target", {
|
|
1556
|
-
configurable: true,
|
|
1557
|
-
value
|
|
1558
|
-
});
|
|
1559
|
-
const handleNode = () => {
|
|
1560
|
-
const handler = node[key];
|
|
1561
|
-
if (handler && !node.disabled) {
|
|
1562
|
-
const data = node[`${key}Data`];
|
|
1563
|
-
data !== void 0 ? handler.call(node, data, e) : handler.call(node, e);
|
|
1564
|
-
if (e.cancelBubble) return;
|
|
1565
|
-
}
|
|
1566
|
-
node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
|
|
1567
|
-
return true;
|
|
1568
|
-
};
|
|
1569
|
-
const walkUpTree = () => {
|
|
1570
|
-
while (handleNode() && (node = node._$host || node.parentNode || node.host));
|
|
1571
|
-
};
|
|
1572
|
-
Object.defineProperty(e, "currentTarget", {
|
|
1573
|
-
configurable: true,
|
|
1574
|
-
get() {
|
|
1575
|
-
return node || document;
|
|
1576
|
-
}
|
|
1577
|
-
});
|
|
1578
|
-
if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;
|
|
1579
|
-
if (e.composedPath) {
|
|
1580
|
-
const path = e.composedPath();
|
|
1581
|
-
retarget(path[0]);
|
|
1582
|
-
for (let i = 0; i < path.length - 2; i++) {
|
|
1583
|
-
node = path[i];
|
|
1584
|
-
if (!handleNode()) break;
|
|
1585
|
-
if (node._$host) {
|
|
1586
|
-
node = node._$host;
|
|
1587
|
-
walkUpTree();
|
|
1588
|
-
break;
|
|
1589
|
-
}
|
|
1590
|
-
if (node.parentNode === oriCurrentTarget) break;
|
|
1591
|
-
}
|
|
1592
|
-
} else walkUpTree();
|
|
1593
|
-
retarget(oriTarget);
|
|
1594
|
-
}
|
|
1595
|
-
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
1596
|
-
const hydrating = isHydrating(parent);
|
|
1597
|
-
if (hydrating) {
|
|
1598
|
-
!current && (current = [...parent.childNodes]);
|
|
1599
|
-
let cleaned = [];
|
|
1600
|
-
for (let i = 0; i < current.length; i++) {
|
|
1601
|
-
const node = current[i];
|
|
1602
|
-
if (node.nodeType === 8 && node.data.slice(0, 2) === "!$") node.remove();
|
|
1603
|
-
else cleaned.push(node);
|
|
1604
|
-
}
|
|
1605
|
-
current = cleaned;
|
|
1606
|
-
}
|
|
1607
|
-
while (typeof current === "function") current = current();
|
|
1608
|
-
if (value === current) return current;
|
|
1609
|
-
const t = typeof value, multi = marker !== void 0;
|
|
1610
|
-
parent = multi && current[0] && current[0].parentNode || parent;
|
|
1611
|
-
if (t === "string" || t === "number") {
|
|
1612
|
-
if (hydrating) return current;
|
|
1613
|
-
if (t === "number") {
|
|
1614
|
-
value = value.toString();
|
|
1615
|
-
if (value === current) return current;
|
|
1616
|
-
}
|
|
1617
|
-
if (multi) {
|
|
1618
|
-
let node = current[0];
|
|
1619
|
-
if (node && node.nodeType === 3) node.data !== value && (node.data = value);
|
|
1620
|
-
else node = document.createTextNode(value);
|
|
1621
|
-
current = cleanChildren(parent, current, marker, node);
|
|
1622
|
-
} else if (current !== "" && typeof current === "string") current = parent.firstChild.data = value;
|
|
1623
|
-
else current = parent.textContent = value;
|
|
1624
|
-
} else if (value == null || t === "boolean") {
|
|
1625
|
-
if (hydrating) return current;
|
|
1626
|
-
current = cleanChildren(parent, current, marker);
|
|
1627
|
-
} else if (t === "function") {
|
|
1628
|
-
createRenderEffect(() => {
|
|
1629
|
-
let v = value();
|
|
1630
|
-
while (typeof v === "function") v = v();
|
|
1631
|
-
current = insertExpression(parent, v, current, marker);
|
|
1632
|
-
});
|
|
1633
|
-
return () => current;
|
|
1634
|
-
} else if (Array.isArray(value)) {
|
|
1635
|
-
const array = [];
|
|
1636
|
-
const currentArray = current && Array.isArray(current);
|
|
1637
|
-
if (normalizeIncomingArray(array, value, current, unwrapArray)) {
|
|
1638
|
-
createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
|
|
1639
|
-
return () => current;
|
|
1640
|
-
}
|
|
1641
|
-
if (hydrating) {
|
|
1642
|
-
if (!array.length) return current;
|
|
1643
|
-
if (marker === void 0) return current = [...parent.childNodes];
|
|
1644
|
-
let node = array[0];
|
|
1645
|
-
if (node.parentNode !== parent) return current;
|
|
1646
|
-
const nodes = [node];
|
|
1647
|
-
while ((node = node.nextSibling) !== marker) nodes.push(node);
|
|
1648
|
-
return current = nodes;
|
|
1649
|
-
}
|
|
1650
|
-
if (array.length === 0) {
|
|
1651
|
-
current = cleanChildren(parent, current, marker);
|
|
1652
|
-
if (multi) return current;
|
|
1653
|
-
} else if (currentArray) if (current.length === 0) appendNodes(parent, array, marker);
|
|
1654
|
-
else reconcileArrays(parent, current, array);
|
|
1655
|
-
else {
|
|
1656
|
-
current && cleanChildren(parent);
|
|
1657
|
-
appendNodes(parent, array);
|
|
1658
|
-
}
|
|
1659
|
-
current = array;
|
|
1660
|
-
} else if (value.nodeType) {
|
|
1661
|
-
if (hydrating && value.parentNode) return current = multi ? [value] : value;
|
|
1662
|
-
if (Array.isArray(current)) {
|
|
1663
|
-
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
1664
|
-
cleanChildren(parent, current, null, value);
|
|
1665
|
-
} else if (current == null || current === "" || !parent.firstChild) parent.appendChild(value);
|
|
1666
|
-
else parent.replaceChild(value, parent.firstChild);
|
|
1667
|
-
current = value;
|
|
1668
|
-
}
|
|
1669
|
-
return current;
|
|
1670
|
-
}
|
|
1671
|
-
function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
1672
|
-
let dynamic = false;
|
|
1673
|
-
for (let i = 0, len = array.length; i < len; i++) {
|
|
1674
|
-
let item = array[i], prev = current && current[normalized.length], t;
|
|
1675
|
-
if (item == null || item === true || item === false);
|
|
1676
|
-
else if ((t = typeof item) === "object" && item.nodeType) normalized.push(item);
|
|
1677
|
-
else if (Array.isArray(item)) dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
|
|
1678
|
-
else if (t === "function") if (unwrap) {
|
|
1679
|
-
while (typeof item === "function") item = item();
|
|
1680
|
-
dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
|
|
1681
|
-
} else {
|
|
1682
|
-
normalized.push(item);
|
|
1683
|
-
dynamic = true;
|
|
1684
|
-
}
|
|
1685
|
-
else {
|
|
1686
|
-
const value = String(item);
|
|
1687
|
-
if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);
|
|
1688
|
-
else normalized.push(document.createTextNode(value));
|
|
1689
|
-
}
|
|
1690
|
-
}
|
|
1691
|
-
return dynamic;
|
|
1692
|
-
}
|
|
1693
|
-
function appendNodes(parent, array, marker = null) {
|
|
1694
|
-
for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
|
|
1695
|
-
}
|
|
1696
|
-
function cleanChildren(parent, current, marker, replacement) {
|
|
1697
|
-
if (marker === void 0) return parent.textContent = "";
|
|
1698
|
-
const node = replacement || document.createTextNode("");
|
|
1699
|
-
if (current.length) {
|
|
1700
|
-
let inserted = false;
|
|
1701
|
-
for (let i = current.length - 1; i >= 0; i--) {
|
|
1702
|
-
const el = current[i];
|
|
1703
|
-
if (node !== el) {
|
|
1704
|
-
const isParent = el.parentNode === parent;
|
|
1705
|
-
if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);
|
|
1706
|
-
else isParent && el.remove();
|
|
1707
|
-
} else inserted = true;
|
|
1708
|
-
}
|
|
1709
|
-
} else parent.insertBefore(node, marker);
|
|
1710
|
-
return [node];
|
|
1711
|
-
}
|
|
1712
|
-
function getHydrationKey() {
|
|
1713
|
-
return sharedConfig.getNextContextId();
|
|
1714
|
-
}
|
|
1715
|
-
var isServer = false;
|
|
1716
|
-
var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
1717
|
-
function createElement(tagName, isSVG = false) {
|
|
1718
|
-
return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);
|
|
1719
|
-
}
|
|
1720
|
-
function Portal(props) {
|
|
1721
|
-
const { useShadow } = props, marker = document.createTextNode(""), mount = () => props.mount || document.body, owner = getOwner();
|
|
1722
|
-
let content;
|
|
1723
|
-
let hydrating = !!sharedConfig.context;
|
|
1724
|
-
createEffect(() => {
|
|
1725
|
-
if (hydrating) getOwner().user = hydrating = false;
|
|
1726
|
-
content || (content = runWithOwner(owner, () => createMemo(() => props.children)));
|
|
1727
|
-
const el = mount();
|
|
1728
|
-
if (el instanceof HTMLHeadElement) {
|
|
1729
|
-
const [clean, setClean] = createSignal(false);
|
|
1730
|
-
const cleanup = () => setClean(true);
|
|
1731
|
-
createRoot((dispose2) => insert(el, () => !clean() ? content() : dispose2(), null));
|
|
1732
|
-
onCleanup(cleanup);
|
|
1733
|
-
} else {
|
|
1734
|
-
const container = createElement(props.isSVG ? "g" : "div", props.isSVG), renderRoot = useShadow && container.attachShadow ? container.attachShadow({ mode: "open" }) : container;
|
|
1735
|
-
Object.defineProperty(container, "_$host", {
|
|
1736
|
-
get() {
|
|
1737
|
-
return marker.parentNode;
|
|
1738
|
-
},
|
|
1739
|
-
configurable: true
|
|
1740
|
-
});
|
|
1741
|
-
insert(renderRoot, content);
|
|
1742
|
-
el.appendChild(container);
|
|
1743
|
-
props.ref && props.ref(container);
|
|
1744
|
-
onCleanup(() => el.removeChild(container));
|
|
1745
|
-
}
|
|
1746
|
-
}, void 0, { render: !hydrating });
|
|
1747
|
-
return marker;
|
|
1748
|
-
}
|
|
1749
|
-
function createDynamic(component, props) {
|
|
1750
|
-
const cached = createMemo(component);
|
|
1751
|
-
return createMemo(() => {
|
|
1752
|
-
const component2 = cached();
|
|
1753
|
-
switch (typeof component2) {
|
|
1754
|
-
case "function": return untrack(() => component2(props));
|
|
1755
|
-
case "string":
|
|
1756
|
-
const isSvg = SVGElements.has(component2);
|
|
1757
|
-
const el = sharedConfig.context ? getNextElement() : createElement(component2, isSvg);
|
|
1758
|
-
spread(el, props, isSvg);
|
|
1759
|
-
return el;
|
|
1760
|
-
}
|
|
1761
|
-
});
|
|
1762
|
-
}
|
|
1763
|
-
function Dynamic(props) {
|
|
1764
|
-
const [, others] = splitProps(props, ["component"]);
|
|
1765
|
-
return createDynamic(() => props.component, others);
|
|
1766
|
-
}
|
|
1767
|
-
var DoubleIndexedKV = class {
|
|
1768
|
-
constructor() {
|
|
1769
|
-
this.keyToValue = /* @__PURE__ */ new Map();
|
|
1770
|
-
this.valueToKey = /* @__PURE__ */ new Map();
|
|
1771
|
-
}
|
|
1772
|
-
set(key, value) {
|
|
1773
|
-
this.keyToValue.set(key, value);
|
|
1774
|
-
this.valueToKey.set(value, key);
|
|
1775
|
-
}
|
|
1776
|
-
getByKey(key) {
|
|
1777
|
-
return this.keyToValue.get(key);
|
|
1778
|
-
}
|
|
1779
|
-
getByValue(value) {
|
|
1780
|
-
return this.valueToKey.get(value);
|
|
1781
|
-
}
|
|
1782
|
-
clear() {
|
|
1783
|
-
this.keyToValue.clear();
|
|
1784
|
-
this.valueToKey.clear();
|
|
1785
|
-
}
|
|
1786
|
-
};
|
|
1787
|
-
var Registry = class {
|
|
1788
|
-
constructor(generateIdentifier) {
|
|
1789
|
-
this.generateIdentifier = generateIdentifier;
|
|
1790
|
-
this.kv = new DoubleIndexedKV();
|
|
1791
|
-
}
|
|
1792
|
-
register(value, identifier) {
|
|
1793
|
-
if (this.kv.getByValue(value)) return;
|
|
1794
|
-
if (!identifier) identifier = this.generateIdentifier(value);
|
|
1795
|
-
this.kv.set(identifier, value);
|
|
1796
|
-
}
|
|
1797
|
-
clear() {
|
|
1798
|
-
this.kv.clear();
|
|
1799
|
-
}
|
|
1800
|
-
getIdentifier(value) {
|
|
1801
|
-
return this.kv.getByValue(value);
|
|
1802
|
-
}
|
|
1803
|
-
getValue(identifier) {
|
|
1804
|
-
return this.kv.getByKey(identifier);
|
|
1805
|
-
}
|
|
1806
|
-
};
|
|
1807
|
-
var ClassRegistry = class extends Registry {
|
|
1808
|
-
constructor() {
|
|
1809
|
-
super((c) => c.name);
|
|
1810
|
-
this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
1811
|
-
}
|
|
1812
|
-
register(value, options) {
|
|
1813
|
-
if (typeof options === "object") {
|
|
1814
|
-
if (options.allowProps) this.classToAllowedProps.set(value, options.allowProps);
|
|
1815
|
-
super.register(value, options.identifier);
|
|
1816
|
-
} else super.register(value, options);
|
|
1817
|
-
}
|
|
1818
|
-
getAllowedProps(value) {
|
|
1819
|
-
return this.classToAllowedProps.get(value);
|
|
1820
|
-
}
|
|
1821
|
-
};
|
|
1822
|
-
function valuesOfObj(record) {
|
|
1823
|
-
if ("values" in Object) return Object.values(record);
|
|
1824
|
-
const values = [];
|
|
1825
|
-
for (const key in record) if (record.hasOwnProperty(key)) values.push(record[key]);
|
|
1826
|
-
return values;
|
|
1827
|
-
}
|
|
1828
|
-
function find(record, predicate) {
|
|
1829
|
-
const values = valuesOfObj(record);
|
|
1830
|
-
if ("find" in values) return values.find(predicate);
|
|
1831
|
-
const valuesNotNever = values;
|
|
1832
|
-
for (let i = 0; i < valuesNotNever.length; i++) {
|
|
1833
|
-
const value = valuesNotNever[i];
|
|
1834
|
-
if (predicate(value)) return value;
|
|
1835
|
-
}
|
|
1836
|
-
}
|
|
1837
|
-
function forEach(record, run) {
|
|
1838
|
-
Object.entries(record).forEach(([key, value]) => run(value, key));
|
|
1839
|
-
}
|
|
1840
|
-
function includes(arr, value) {
|
|
1841
|
-
return arr.indexOf(value) !== -1;
|
|
1842
|
-
}
|
|
1843
|
-
function findArr(record, predicate) {
|
|
1844
|
-
for (let i = 0; i < record.length; i++) {
|
|
1845
|
-
const value = record[i];
|
|
1846
|
-
if (predicate(value)) return value;
|
|
1847
|
-
}
|
|
1848
|
-
}
|
|
1849
|
-
var CustomTransformerRegistry = class {
|
|
1850
|
-
constructor() {
|
|
1851
|
-
this.transfomers = {};
|
|
1852
|
-
}
|
|
1853
|
-
register(transformer) {
|
|
1854
|
-
this.transfomers[transformer.name] = transformer;
|
|
1855
|
-
}
|
|
1856
|
-
findApplicable(v) {
|
|
1857
|
-
return find(this.transfomers, (transformer) => transformer.isApplicable(v));
|
|
1858
|
-
}
|
|
1859
|
-
findByName(name) {
|
|
1860
|
-
return this.transfomers[name];
|
|
1861
|
-
}
|
|
1862
|
-
};
|
|
1863
|
-
var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
|
|
1864
|
-
var isUndefined = (payload) => typeof payload === "undefined";
|
|
1865
|
-
var isNull = (payload) => payload === null;
|
|
1866
|
-
var isPlainObject = (payload) => {
|
|
1867
|
-
if (typeof payload !== "object" || payload === null) return false;
|
|
1868
|
-
if (payload === Object.prototype) return false;
|
|
1869
|
-
if (Object.getPrototypeOf(payload) === null) return true;
|
|
1870
|
-
return Object.getPrototypeOf(payload) === Object.prototype;
|
|
1871
|
-
};
|
|
1872
|
-
var isEmptyObject = (payload) => isPlainObject(payload) && Object.keys(payload).length === 0;
|
|
1873
|
-
var isArray = (payload) => Array.isArray(payload);
|
|
1874
|
-
var isString = (payload) => typeof payload === "string";
|
|
1875
|
-
var isNumber = (payload) => typeof payload === "number" && !isNaN(payload);
|
|
1876
|
-
var isBoolean = (payload) => typeof payload === "boolean";
|
|
1877
|
-
var isRegExp = (payload) => payload instanceof RegExp;
|
|
1878
|
-
var isMap = (payload) => payload instanceof Map;
|
|
1879
|
-
var isSet = (payload) => payload instanceof Set;
|
|
1880
|
-
var isSymbol = (payload) => getType(payload) === "Symbol";
|
|
1881
|
-
var isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf());
|
|
1882
|
-
var isError = (payload) => payload instanceof Error;
|
|
1883
|
-
var isNaNValue = (payload) => typeof payload === "number" && isNaN(payload);
|
|
1884
|
-
var isPrimitive = (payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
|
|
1885
|
-
var isBigint = (payload) => typeof payload === "bigint";
|
|
1886
|
-
var isInfinite = (payload) => payload === Infinity || payload === -Infinity;
|
|
1887
|
-
var isTypedArray = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);
|
|
1888
|
-
var isURL = (payload) => payload instanceof URL;
|
|
1889
|
-
var escapeKey = (key) => key.replace(/\./g, "\\.");
|
|
1890
|
-
var stringifyPath = (path) => path.map(String).map(escapeKey).join(".");
|
|
1891
|
-
var parsePath = (string) => {
|
|
1892
|
-
const result = [];
|
|
1893
|
-
let segment = "";
|
|
1894
|
-
for (let i = 0; i < string.length; i++) {
|
|
1895
|
-
let char = string.charAt(i);
|
|
1896
|
-
if (char === "\\" && string.charAt(i + 1) === ".") {
|
|
1897
|
-
segment += ".";
|
|
1898
|
-
i++;
|
|
1899
|
-
continue;
|
|
1900
|
-
}
|
|
1901
|
-
if (char === ".") {
|
|
1902
|
-
result.push(segment);
|
|
1903
|
-
segment = "";
|
|
1904
|
-
continue;
|
|
1905
|
-
}
|
|
1906
|
-
segment += char;
|
|
1907
|
-
}
|
|
1908
|
-
const lastSegment = segment;
|
|
1909
|
-
result.push(lastSegment);
|
|
1910
|
-
return result;
|
|
1911
|
-
};
|
|
1912
|
-
function simpleTransformation(isApplicable, annotation, transform, untransform) {
|
|
1913
|
-
return {
|
|
1914
|
-
isApplicable,
|
|
1915
|
-
annotation,
|
|
1916
|
-
transform,
|
|
1917
|
-
untransform
|
|
1918
|
-
};
|
|
1919
|
-
}
|
|
1920
|
-
var simpleRules = [
|
|
1921
|
-
simpleTransformation(isUndefined, "undefined", () => null, () => void 0),
|
|
1922
|
-
simpleTransformation(isBigint, "bigint", (v) => v.toString(), (v) => {
|
|
1923
|
-
if (typeof BigInt !== "undefined") return BigInt(v);
|
|
1924
|
-
return v;
|
|
1925
|
-
}),
|
|
1926
|
-
simpleTransformation(isDate, "Date", (v) => v.toISOString(), (v) => new Date(v)),
|
|
1927
|
-
simpleTransformation(isError, "Error", (v, superJson) => {
|
|
1928
|
-
const baseError = {
|
|
1929
|
-
name: v.name,
|
|
1930
|
-
message: v.message
|
|
1931
|
-
};
|
|
1932
|
-
superJson.allowedErrorProps.forEach((prop) => {
|
|
1933
|
-
baseError[prop] = v[prop];
|
|
1934
|
-
});
|
|
1935
|
-
return baseError;
|
|
1936
|
-
}, (v, superJson) => {
|
|
1937
|
-
const e = new Error(v.message);
|
|
1938
|
-
e.name = v.name;
|
|
1939
|
-
e.stack = v.stack;
|
|
1940
|
-
superJson.allowedErrorProps.forEach((prop) => {
|
|
1941
|
-
e[prop] = v[prop];
|
|
1942
|
-
});
|
|
1943
|
-
return e;
|
|
1944
|
-
}),
|
|
1945
|
-
simpleTransformation(isRegExp, "regexp", (v) => "" + v, (regex) => {
|
|
1946
|
-
const body = regex.slice(1, regex.lastIndexOf("/"));
|
|
1947
|
-
const flags = regex.slice(regex.lastIndexOf("/") + 1);
|
|
1948
|
-
return new RegExp(body, flags);
|
|
1949
|
-
}),
|
|
1950
|
-
simpleTransformation(isSet, "set", (v) => [...v.values()], (v) => new Set(v)),
|
|
1951
|
-
simpleTransformation(isMap, "map", (v) => [...v.entries()], (v) => new Map(v)),
|
|
1952
|
-
simpleTransformation((v) => isNaNValue(v) || isInfinite(v), "number", (v) => {
|
|
1953
|
-
if (isNaNValue(v)) return "NaN";
|
|
1954
|
-
if (v > 0) return "Infinity";
|
|
1955
|
-
else return "-Infinity";
|
|
1956
|
-
}, Number),
|
|
1957
|
-
simpleTransformation((v) => v === 0 && 1 / v === -Infinity, "number", () => {
|
|
1958
|
-
return "-0";
|
|
1959
|
-
}, Number),
|
|
1960
|
-
simpleTransformation(isURL, "URL", (v) => v.toString(), (v) => new URL(v))
|
|
1961
|
-
];
|
|
1962
|
-
function compositeTransformation(isApplicable, annotation, transform, untransform) {
|
|
1963
|
-
return {
|
|
1964
|
-
isApplicable,
|
|
1965
|
-
annotation,
|
|
1966
|
-
transform,
|
|
1967
|
-
untransform
|
|
1968
|
-
};
|
|
1969
|
-
}
|
|
1970
|
-
var symbolRule = compositeTransformation((s, superJson) => {
|
|
1971
|
-
if (isSymbol(s)) return !!superJson.symbolRegistry.getIdentifier(s);
|
|
1972
|
-
return false;
|
|
1973
|
-
}, (s, superJson) => {
|
|
1974
|
-
return ["symbol", superJson.symbolRegistry.getIdentifier(s)];
|
|
1975
|
-
}, (v) => v.description, (_, a, superJson) => {
|
|
1976
|
-
const value = superJson.symbolRegistry.getValue(a[1]);
|
|
1977
|
-
if (!value) throw new Error("Trying to deserialize unknown symbol");
|
|
1978
|
-
return value;
|
|
1979
|
-
});
|
|
1980
|
-
var constructorToName = [
|
|
1981
|
-
Int8Array,
|
|
1982
|
-
Uint8Array,
|
|
1983
|
-
Int16Array,
|
|
1984
|
-
Uint16Array,
|
|
1985
|
-
Int32Array,
|
|
1986
|
-
Uint32Array,
|
|
1987
|
-
Float32Array,
|
|
1988
|
-
Float64Array,
|
|
1989
|
-
Uint8ClampedArray
|
|
1990
|
-
].reduce((obj, ctor) => {
|
|
1991
|
-
obj[ctor.name] = ctor;
|
|
1992
|
-
return obj;
|
|
1993
|
-
}, {});
|
|
1994
|
-
var typedArrayRule = compositeTransformation(isTypedArray, (v) => ["typed-array", v.constructor.name], (v) => [...v], (v, a) => {
|
|
1995
|
-
const ctor = constructorToName[a[1]];
|
|
1996
|
-
if (!ctor) throw new Error("Trying to deserialize unknown typed array");
|
|
1997
|
-
return new ctor(v);
|
|
1998
|
-
});
|
|
1999
|
-
function isInstanceOfRegisteredClass(potentialClass, superJson) {
|
|
2000
|
-
if (potentialClass?.constructor) return !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
|
|
2001
|
-
return false;
|
|
2002
|
-
}
|
|
2003
|
-
var classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
|
|
2004
|
-
return ["class", superJson.classRegistry.getIdentifier(clazz.constructor)];
|
|
2005
|
-
}, (clazz, superJson) => {
|
|
2006
|
-
const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
|
|
2007
|
-
if (!allowedProps) return { ...clazz };
|
|
2008
|
-
const result = {};
|
|
2009
|
-
allowedProps.forEach((prop) => {
|
|
2010
|
-
result[prop] = clazz[prop];
|
|
2011
|
-
});
|
|
2012
|
-
return result;
|
|
2013
|
-
}, (v, a, superJson) => {
|
|
2014
|
-
const clazz = superJson.classRegistry.getValue(a[1]);
|
|
2015
|
-
if (!clazz) throw new Error(`Trying to deserialize unknown class '${a[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
|
|
2016
|
-
return Object.assign(Object.create(clazz.prototype), v);
|
|
2017
|
-
});
|
|
2018
|
-
var customRule = compositeTransformation((value, superJson) => {
|
|
2019
|
-
return !!superJson.customTransformerRegistry.findApplicable(value);
|
|
2020
|
-
}, (value, superJson) => {
|
|
2021
|
-
return ["custom", superJson.customTransformerRegistry.findApplicable(value).name];
|
|
2022
|
-
}, (value, superJson) => {
|
|
2023
|
-
return superJson.customTransformerRegistry.findApplicable(value).serialize(value);
|
|
2024
|
-
}, (v, a, superJson) => {
|
|
2025
|
-
const transformer = superJson.customTransformerRegistry.findByName(a[1]);
|
|
2026
|
-
if (!transformer) throw new Error("Trying to deserialize unknown custom value");
|
|
2027
|
-
return transformer.deserialize(v);
|
|
2028
|
-
});
|
|
2029
|
-
var compositeRules = [
|
|
2030
|
-
classRule,
|
|
2031
|
-
symbolRule,
|
|
2032
|
-
customRule,
|
|
2033
|
-
typedArrayRule
|
|
2034
|
-
];
|
|
2035
|
-
var transformValue = (value, superJson) => {
|
|
2036
|
-
const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value, superJson));
|
|
2037
|
-
if (applicableCompositeRule) return {
|
|
2038
|
-
value: applicableCompositeRule.transform(value, superJson),
|
|
2039
|
-
type: applicableCompositeRule.annotation(value, superJson)
|
|
2040
|
-
};
|
|
2041
|
-
const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value, superJson));
|
|
2042
|
-
if (applicableSimpleRule) return {
|
|
2043
|
-
value: applicableSimpleRule.transform(value, superJson),
|
|
2044
|
-
type: applicableSimpleRule.annotation
|
|
2045
|
-
};
|
|
2046
|
-
};
|
|
2047
|
-
var simpleRulesByAnnotation = {};
|
|
2048
|
-
simpleRules.forEach((rule) => {
|
|
2049
|
-
simpleRulesByAnnotation[rule.annotation] = rule;
|
|
2050
|
-
});
|
|
2051
|
-
var untransformValue = (json, type, superJson) => {
|
|
2052
|
-
if (isArray(type)) switch (type[0]) {
|
|
2053
|
-
case "symbol": return symbolRule.untransform(json, type, superJson);
|
|
2054
|
-
case "class": return classRule.untransform(json, type, superJson);
|
|
2055
|
-
case "custom": return customRule.untransform(json, type, superJson);
|
|
2056
|
-
case "typed-array": return typedArrayRule.untransform(json, type, superJson);
|
|
2057
|
-
default: throw new Error("Unknown transformation: " + type);
|
|
2058
|
-
}
|
|
2059
|
-
else {
|
|
2060
|
-
const transformation = simpleRulesByAnnotation[type];
|
|
2061
|
-
if (!transformation) throw new Error("Unknown transformation: " + type);
|
|
2062
|
-
return transformation.untransform(json, superJson);
|
|
2063
|
-
}
|
|
2064
|
-
};
|
|
2065
|
-
var getNthKey = (value, n) => {
|
|
2066
|
-
if (n > value.size) throw new Error("index out of bounds");
|
|
2067
|
-
const keys = value.keys();
|
|
2068
|
-
while (n > 0) {
|
|
2069
|
-
keys.next();
|
|
2070
|
-
n--;
|
|
2071
|
-
}
|
|
2072
|
-
return keys.next().value;
|
|
2073
|
-
};
|
|
2074
|
-
function validatePath(path) {
|
|
2075
|
-
if (includes(path, "__proto__")) throw new Error("__proto__ is not allowed as a property");
|
|
2076
|
-
if (includes(path, "prototype")) throw new Error("prototype is not allowed as a property");
|
|
2077
|
-
if (includes(path, "constructor")) throw new Error("constructor is not allowed as a property");
|
|
2078
|
-
}
|
|
2079
|
-
var getDeep = (object, path) => {
|
|
2080
|
-
validatePath(path);
|
|
2081
|
-
for (let i = 0; i < path.length; i++) {
|
|
2082
|
-
const key = path[i];
|
|
2083
|
-
if (isSet(object)) object = getNthKey(object, +key);
|
|
2084
|
-
else if (isMap(object)) {
|
|
2085
|
-
const row = +key;
|
|
2086
|
-
const type = +path[++i] === 0 ? "key" : "value";
|
|
2087
|
-
const keyOfRow = getNthKey(object, row);
|
|
2088
|
-
switch (type) {
|
|
2089
|
-
case "key":
|
|
2090
|
-
object = keyOfRow;
|
|
2091
|
-
break;
|
|
2092
|
-
case "value":
|
|
2093
|
-
object = object.get(keyOfRow);
|
|
2094
|
-
break;
|
|
2095
|
-
}
|
|
2096
|
-
} else object = object[key];
|
|
2097
|
-
}
|
|
2098
|
-
return object;
|
|
2099
|
-
};
|
|
2100
|
-
var setDeep = (object, path, mapper) => {
|
|
2101
|
-
validatePath(path);
|
|
2102
|
-
if (path.length === 0) return mapper(object);
|
|
2103
|
-
let parent = object;
|
|
2104
|
-
for (let i = 0; i < path.length - 1; i++) {
|
|
2105
|
-
const key = path[i];
|
|
2106
|
-
if (isArray(parent)) {
|
|
2107
|
-
const index = +key;
|
|
2108
|
-
parent = parent[index];
|
|
2109
|
-
} else if (isPlainObject(parent)) parent = parent[key];
|
|
2110
|
-
else if (isSet(parent)) {
|
|
2111
|
-
const row = +key;
|
|
2112
|
-
parent = getNthKey(parent, row);
|
|
2113
|
-
} else if (isMap(parent)) {
|
|
2114
|
-
if (i === path.length - 2) break;
|
|
2115
|
-
const row = +key;
|
|
2116
|
-
const type = +path[++i] === 0 ? "key" : "value";
|
|
2117
|
-
const keyOfRow = getNthKey(parent, row);
|
|
2118
|
-
switch (type) {
|
|
2119
|
-
case "key":
|
|
2120
|
-
parent = keyOfRow;
|
|
2121
|
-
break;
|
|
2122
|
-
case "value":
|
|
2123
|
-
parent = parent.get(keyOfRow);
|
|
2124
|
-
break;
|
|
2125
|
-
}
|
|
2126
|
-
}
|
|
2127
|
-
}
|
|
2128
|
-
const lastKey = path[path.length - 1];
|
|
2129
|
-
if (isArray(parent)) parent[+lastKey] = mapper(parent[+lastKey]);
|
|
2130
|
-
else if (isPlainObject(parent)) parent[lastKey] = mapper(parent[lastKey]);
|
|
2131
|
-
if (isSet(parent)) {
|
|
2132
|
-
const oldValue = getNthKey(parent, +lastKey);
|
|
2133
|
-
const newValue = mapper(oldValue);
|
|
2134
|
-
if (oldValue !== newValue) {
|
|
2135
|
-
parent.delete(oldValue);
|
|
2136
|
-
parent.add(newValue);
|
|
2137
|
-
}
|
|
2138
|
-
}
|
|
2139
|
-
if (isMap(parent)) {
|
|
2140
|
-
const row = +path[path.length - 2];
|
|
2141
|
-
const keyToRow = getNthKey(parent, row);
|
|
2142
|
-
switch (+lastKey === 0 ? "key" : "value") {
|
|
2143
|
-
case "key": {
|
|
2144
|
-
const newKey = mapper(keyToRow);
|
|
2145
|
-
parent.set(newKey, parent.get(keyToRow));
|
|
2146
|
-
if (newKey !== keyToRow) parent.delete(keyToRow);
|
|
2147
|
-
break;
|
|
2148
|
-
}
|
|
2149
|
-
case "value":
|
|
2150
|
-
parent.set(keyToRow, mapper(parent.get(keyToRow)));
|
|
2151
|
-
break;
|
|
2152
|
-
}
|
|
2153
|
-
}
|
|
2154
|
-
return object;
|
|
2155
|
-
};
|
|
2156
|
-
function traverse(tree, walker2, origin = []) {
|
|
2157
|
-
if (!tree) return;
|
|
2158
|
-
if (!isArray(tree)) {
|
|
2159
|
-
forEach(tree, (subtree, key) => traverse(subtree, walker2, [...origin, ...parsePath(key)]));
|
|
2160
|
-
return;
|
|
2161
|
-
}
|
|
2162
|
-
const [nodeValue, children2] = tree;
|
|
2163
|
-
if (children2) forEach(children2, (child, key) => {
|
|
2164
|
-
traverse(child, walker2, [...origin, ...parsePath(key)]);
|
|
2165
|
-
});
|
|
2166
|
-
walker2(nodeValue, origin);
|
|
2167
|
-
}
|
|
2168
|
-
function applyValueAnnotations(plain, annotations, superJson) {
|
|
2169
|
-
traverse(annotations, (type, path) => {
|
|
2170
|
-
plain = setDeep(plain, path, (v) => untransformValue(v, type, superJson));
|
|
2171
|
-
});
|
|
2172
|
-
return plain;
|
|
2173
|
-
}
|
|
2174
|
-
function applyReferentialEqualityAnnotations(plain, annotations) {
|
|
2175
|
-
function apply(identicalPaths, path) {
|
|
2176
|
-
const object = getDeep(plain, parsePath(path));
|
|
2177
|
-
identicalPaths.map(parsePath).forEach((identicalObjectPath) => {
|
|
2178
|
-
plain = setDeep(plain, identicalObjectPath, () => object);
|
|
2179
|
-
});
|
|
2180
|
-
}
|
|
2181
|
-
if (isArray(annotations)) {
|
|
2182
|
-
const [root, other] = annotations;
|
|
2183
|
-
root.forEach((identicalPath) => {
|
|
2184
|
-
plain = setDeep(plain, parsePath(identicalPath), () => plain);
|
|
2185
|
-
});
|
|
2186
|
-
if (other) forEach(other, apply);
|
|
2187
|
-
} else forEach(annotations, apply);
|
|
2188
|
-
return plain;
|
|
2189
|
-
}
|
|
2190
|
-
var isDeep = (object, superJson) => isPlainObject(object) || isArray(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson);
|
|
2191
|
-
function addIdentity(object, path, identities) {
|
|
2192
|
-
const existingSet = identities.get(object);
|
|
2193
|
-
if (existingSet) existingSet.push(path);
|
|
2194
|
-
else identities.set(object, [path]);
|
|
2195
|
-
}
|
|
2196
|
-
function generateReferentialEqualityAnnotations(identitites, dedupe) {
|
|
2197
|
-
const result = {};
|
|
2198
|
-
let rootEqualityPaths = void 0;
|
|
2199
|
-
identitites.forEach((paths) => {
|
|
2200
|
-
if (paths.length <= 1) return;
|
|
2201
|
-
if (!dedupe) paths = paths.map((path) => path.map(String)).sort((a, b) => a.length - b.length);
|
|
2202
|
-
const [representativePath, ...identicalPaths] = paths;
|
|
2203
|
-
if (representativePath.length === 0) rootEqualityPaths = identicalPaths.map(stringifyPath);
|
|
2204
|
-
else result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);
|
|
2205
|
-
});
|
|
2206
|
-
if (rootEqualityPaths) if (isEmptyObject(result)) return [rootEqualityPaths];
|
|
2207
|
-
else return [rootEqualityPaths, result];
|
|
2208
|
-
else return isEmptyObject(result) ? void 0 : result;
|
|
2209
|
-
}
|
|
2210
|
-
var walker = (object, identities, superJson, dedupe, path = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => {
|
|
2211
|
-
const primitive = isPrimitive(object);
|
|
2212
|
-
if (!primitive) {
|
|
2213
|
-
addIdentity(object, path, identities);
|
|
2214
|
-
const seen = seenObjects.get(object);
|
|
2215
|
-
if (seen) return dedupe ? { transformedValue: null } : seen;
|
|
2216
|
-
}
|
|
2217
|
-
if (!isDeep(object, superJson)) {
|
|
2218
|
-
const transformed2 = transformValue(object, superJson);
|
|
2219
|
-
const result2 = transformed2 ? {
|
|
2220
|
-
transformedValue: transformed2.value,
|
|
2221
|
-
annotations: [transformed2.type]
|
|
2222
|
-
} : { transformedValue: object };
|
|
2223
|
-
if (!primitive) seenObjects.set(object, result2);
|
|
2224
|
-
return result2;
|
|
2225
|
-
}
|
|
2226
|
-
if (includes(objectsInThisPath, object)) return { transformedValue: null };
|
|
2227
|
-
const transformationResult = transformValue(object, superJson);
|
|
2228
|
-
const transformed = transformationResult?.value ?? object;
|
|
2229
|
-
const transformedValue = isArray(transformed) ? [] : {};
|
|
2230
|
-
const innerAnnotations = {};
|
|
2231
|
-
forEach(transformed, (value, index) => {
|
|
2232
|
-
if (index === "__proto__" || index === "constructor" || index === "prototype") throw new Error(`Detected property ${index}. This is a prototype pollution risk, please remove it from your object.`);
|
|
2233
|
-
const recursiveResult = walker(value, identities, superJson, dedupe, [...path, index], [...objectsInThisPath, object], seenObjects);
|
|
2234
|
-
transformedValue[index] = recursiveResult.transformedValue;
|
|
2235
|
-
if (isArray(recursiveResult.annotations)) innerAnnotations[index] = recursiveResult.annotations;
|
|
2236
|
-
else if (isPlainObject(recursiveResult.annotations)) forEach(recursiveResult.annotations, (tree, key) => {
|
|
2237
|
-
innerAnnotations[escapeKey(index) + "." + key] = tree;
|
|
2238
|
-
});
|
|
2239
|
-
});
|
|
2240
|
-
const result = isEmptyObject(innerAnnotations) ? {
|
|
2241
|
-
transformedValue,
|
|
2242
|
-
annotations: !!transformationResult ? [transformationResult.type] : void 0
|
|
2243
|
-
} : {
|
|
2244
|
-
transformedValue,
|
|
2245
|
-
annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
|
|
2246
|
-
};
|
|
2247
|
-
if (!primitive) seenObjects.set(object, result);
|
|
2248
|
-
return result;
|
|
2249
|
-
};
|
|
2250
|
-
function getType2(payload) {
|
|
2251
|
-
return Object.prototype.toString.call(payload).slice(8, -1);
|
|
2252
|
-
}
|
|
2253
|
-
function isArray2(payload) {
|
|
2254
|
-
return getType2(payload) === "Array";
|
|
2255
|
-
}
|
|
2256
|
-
function isPlainObject2(payload) {
|
|
2257
|
-
if (getType2(payload) !== "Object") return false;
|
|
2258
|
-
const prototype = Object.getPrototypeOf(payload);
|
|
2259
|
-
return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
|
|
2260
|
-
}
|
|
2261
|
-
function assignProp2(carry, key, newVal, originalObject, includeNonenumerable) {
|
|
2262
|
-
const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
|
|
2263
|
-
if (propType === "enumerable") carry[key] = newVal;
|
|
2264
|
-
if (includeNonenumerable && propType === "nonenumerable") Object.defineProperty(carry, key, {
|
|
2265
|
-
value: newVal,
|
|
2266
|
-
enumerable: false,
|
|
2267
|
-
writable: true,
|
|
2268
|
-
configurable: true
|
|
2269
|
-
});
|
|
2270
|
-
}
|
|
2271
|
-
function copy(target, options = {}) {
|
|
2272
|
-
if (isArray2(target)) return target.map((item) => copy(item, options));
|
|
2273
|
-
if (!isPlainObject2(target)) return target;
|
|
2274
|
-
const props = Object.getOwnPropertyNames(target);
|
|
2275
|
-
const symbols = Object.getOwnPropertySymbols(target);
|
|
2276
|
-
return [...props, ...symbols].reduce((carry, key) => {
|
|
2277
|
-
if (isArray2(options.props) && !options.props.includes(key)) return carry;
|
|
2278
|
-
const val = target[key];
|
|
2279
|
-
assignProp2(carry, key, copy(val, options), target, options.nonenumerable);
|
|
2280
|
-
return carry;
|
|
2281
|
-
}, {});
|
|
2282
|
-
}
|
|
2283
|
-
var SuperJSON = class {
|
|
2284
|
-
/**
|
|
2285
|
-
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
2286
|
-
*/
|
|
2287
|
-
constructor({ dedupe = false } = {}) {
|
|
2288
|
-
this.classRegistry = new ClassRegistry();
|
|
2289
|
-
this.symbolRegistry = new Registry((s) => s.description ?? "");
|
|
2290
|
-
this.customTransformerRegistry = new CustomTransformerRegistry();
|
|
2291
|
-
this.allowedErrorProps = [];
|
|
2292
|
-
this.dedupe = dedupe;
|
|
2293
|
-
}
|
|
2294
|
-
serialize(object) {
|
|
2295
|
-
const identities = /* @__PURE__ */ new Map();
|
|
2296
|
-
const output = walker(object, identities, this, this.dedupe);
|
|
2297
|
-
const res = { json: output.transformedValue };
|
|
2298
|
-
if (output.annotations) res.meta = {
|
|
2299
|
-
...res.meta,
|
|
2300
|
-
values: output.annotations
|
|
2301
|
-
};
|
|
2302
|
-
const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
|
|
2303
|
-
if (equalityAnnotations) res.meta = {
|
|
2304
|
-
...res.meta,
|
|
2305
|
-
referentialEqualities: equalityAnnotations
|
|
2306
|
-
};
|
|
2307
|
-
return res;
|
|
2308
|
-
}
|
|
2309
|
-
deserialize(payload) {
|
|
2310
|
-
const { json, meta } = payload;
|
|
2311
|
-
let result = copy(json);
|
|
2312
|
-
if (meta?.values) result = applyValueAnnotations(result, meta.values, this);
|
|
2313
|
-
if (meta?.referentialEqualities) result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
|
|
2314
|
-
return result;
|
|
2315
|
-
}
|
|
2316
|
-
stringify(object) {
|
|
2317
|
-
return JSON.stringify(this.serialize(object));
|
|
2318
|
-
}
|
|
2319
|
-
parse(string) {
|
|
2320
|
-
return this.deserialize(JSON.parse(string));
|
|
2321
|
-
}
|
|
2322
|
-
registerClass(v, options) {
|
|
2323
|
-
this.classRegistry.register(v, options);
|
|
2324
|
-
}
|
|
2325
|
-
registerSymbol(v, identifier) {
|
|
2326
|
-
this.symbolRegistry.register(v, identifier);
|
|
2327
|
-
}
|
|
2328
|
-
registerCustom(transformer, name) {
|
|
2329
|
-
this.customTransformerRegistry.register({
|
|
2330
|
-
name,
|
|
2331
|
-
...transformer
|
|
2332
|
-
});
|
|
2333
|
-
}
|
|
2334
|
-
allowErrorProps(...props) {
|
|
2335
|
-
this.allowedErrorProps.push(...props);
|
|
2336
|
-
}
|
|
2337
|
-
};
|
|
2338
|
-
SuperJSON.defaultInstance = new SuperJSON();
|
|
2339
|
-
SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
|
|
2340
|
-
SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
|
|
2341
|
-
SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
|
|
2342
|
-
SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
|
|
2343
|
-
SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
|
|
2344
|
-
SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
|
|
2345
|
-
SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
|
|
2346
|
-
SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
|
|
2347
|
-
var serialize = SuperJSON.serialize;
|
|
2348
|
-
SuperJSON.deserialize;
|
|
2349
|
-
var stringify = SuperJSON.stringify;
|
|
2350
|
-
SuperJSON.parse;
|
|
2351
|
-
SuperJSON.registerClass;
|
|
2352
|
-
SuperJSON.registerCustom;
|
|
2353
|
-
SuperJSON.registerSymbol;
|
|
2354
|
-
SuperJSON.allowErrorProps;
|
|
2355
|
-
function getQueryStatusLabel(query) {
|
|
2356
|
-
return query.state.fetchStatus === "fetching" ? "fetching" : !query.getObserversCount() ? "inactive" : query.state.fetchStatus === "paused" ? "paused" : query.isStale() ? "stale" : "fresh";
|
|
2357
|
-
}
|
|
2358
|
-
function getSidedProp(prop, side) {
|
|
2359
|
-
return `${prop}${side.charAt(0).toUpperCase() + side.slice(1)}`;
|
|
2360
|
-
}
|
|
2361
|
-
function getQueryStatusColor({ queryState, observerCount, isStale }) {
|
|
2362
|
-
return queryState.fetchStatus === "fetching" ? "blue" : !observerCount ? "gray" : queryState.fetchStatus === "paused" ? "purple" : isStale ? "yellow" : "green";
|
|
2363
|
-
}
|
|
2364
|
-
function getMutationStatusColor({ status, isPaused }) {
|
|
2365
|
-
return isPaused ? "purple" : status === "error" ? "red" : status === "pending" ? "yellow" : status === "success" ? "green" : "gray";
|
|
2366
|
-
}
|
|
2367
|
-
function getQueryStatusColorByLabel(label) {
|
|
2368
|
-
return label === "fresh" ? "green" : label === "stale" ? "yellow" : label === "paused" ? "purple" : label === "inactive" ? "gray" : "blue";
|
|
2369
|
-
}
|
|
2370
|
-
var displayValue = (value, beautify = false) => {
|
|
2371
|
-
const { json } = serialize(value);
|
|
2372
|
-
return JSON.stringify(json, null, beautify ? 2 : void 0);
|
|
2373
|
-
};
|
|
2374
|
-
var getStatusRank = (q) => q.state.fetchStatus !== "idle" ? 0 : !q.getObserversCount() ? 3 : q.isStale() ? 2 : 1;
|
|
2375
|
-
var queryHashSort = (a, b) => a.queryHash.localeCompare(b.queryHash);
|
|
2376
|
-
var dateSort = (a, b) => a.state.dataUpdatedAt < b.state.dataUpdatedAt ? 1 : -1;
|
|
2377
|
-
var statusAndDateSort = (a, b) => {
|
|
2378
|
-
if (getStatusRank(a) === getStatusRank(b)) return dateSort(a, b);
|
|
2379
|
-
return getStatusRank(a) > getStatusRank(b) ? 1 : -1;
|
|
2380
|
-
};
|
|
2381
|
-
var sortFns = {
|
|
2382
|
-
status: statusAndDateSort,
|
|
2383
|
-
"query hash": queryHashSort,
|
|
2384
|
-
"last updated": dateSort
|
|
2385
|
-
};
|
|
2386
|
-
var getMutationStatusRank = (m) => m.state.isPaused ? 0 : m.state.status === "error" ? 2 : m.state.status === "pending" ? 1 : 3;
|
|
2387
|
-
var mutationDateSort = (a, b) => a.state.submittedAt < b.state.submittedAt ? 1 : -1;
|
|
2388
|
-
var mutationStatusSort = (a, b) => {
|
|
2389
|
-
if (getMutationStatusRank(a) === getMutationStatusRank(b)) return mutationDateSort(a, b);
|
|
2390
|
-
return getMutationStatusRank(a) > getMutationStatusRank(b) ? 1 : -1;
|
|
2391
|
-
};
|
|
2392
|
-
var mutationSortFns = {
|
|
2393
|
-
status: mutationStatusSort,
|
|
2394
|
-
"last updated": mutationDateSort
|
|
2395
|
-
};
|
|
2396
|
-
var convertRemToPixels = (rem) => {
|
|
2397
|
-
return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
2398
|
-
};
|
|
2399
|
-
var getPreferredColorScheme = () => {
|
|
2400
|
-
const [colorScheme, setColorScheme] = createSignal("dark");
|
|
2401
|
-
onMount(() => {
|
|
2402
|
-
const query = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2403
|
-
setColorScheme(query.matches ? "dark" : "light");
|
|
2404
|
-
const listener = (e) => {
|
|
2405
|
-
setColorScheme(e.matches ? "dark" : "light");
|
|
2406
|
-
};
|
|
2407
|
-
query.addEventListener("change", listener);
|
|
2408
|
-
onCleanup(() => query.removeEventListener("change", listener));
|
|
2409
|
-
});
|
|
2410
|
-
return colorScheme;
|
|
2411
|
-
};
|
|
2412
|
-
var updateNestedDataByPath = (oldData, updatePath, value) => {
|
|
2413
|
-
if (updatePath.length === 0) return value;
|
|
2414
|
-
if (oldData instanceof Map) {
|
|
2415
|
-
const newData = new Map(oldData);
|
|
2416
|
-
if (updatePath.length === 1) {
|
|
2417
|
-
newData.set(updatePath[0], value);
|
|
2418
|
-
return newData;
|
|
2419
|
-
}
|
|
2420
|
-
const [head, ...tail] = updatePath;
|
|
2421
|
-
newData.set(head, updateNestedDataByPath(newData.get(head), tail, value));
|
|
2422
|
-
return newData;
|
|
2423
|
-
}
|
|
2424
|
-
if (oldData instanceof Set) {
|
|
2425
|
-
const setAsArray = updateNestedDataByPath(Array.from(oldData), updatePath, value);
|
|
2426
|
-
return new Set(setAsArray);
|
|
2427
|
-
}
|
|
2428
|
-
if (Array.isArray(oldData)) {
|
|
2429
|
-
const newData = [...oldData];
|
|
2430
|
-
if (updatePath.length === 1) {
|
|
2431
|
-
newData[updatePath[0]] = value;
|
|
2432
|
-
return newData;
|
|
2433
|
-
}
|
|
2434
|
-
const [head, ...tail] = updatePath;
|
|
2435
|
-
newData[head] = updateNestedDataByPath(newData[head], tail, value);
|
|
2436
|
-
return newData;
|
|
2437
|
-
}
|
|
2438
|
-
if (oldData instanceof Object) {
|
|
2439
|
-
const newData = { ...oldData };
|
|
2440
|
-
if (updatePath.length === 1) {
|
|
2441
|
-
newData[updatePath[0]] = value;
|
|
2442
|
-
return newData;
|
|
2443
|
-
}
|
|
2444
|
-
const [head, ...tail] = updatePath;
|
|
2445
|
-
newData[head] = updateNestedDataByPath(newData[head], tail, value);
|
|
2446
|
-
return newData;
|
|
2447
|
-
}
|
|
2448
|
-
return oldData;
|
|
2449
|
-
};
|
|
2450
|
-
var deleteNestedDataByPath = (oldData, deletePath) => {
|
|
2451
|
-
if (oldData instanceof Map) {
|
|
2452
|
-
const newData = new Map(oldData);
|
|
2453
|
-
if (deletePath.length === 1) {
|
|
2454
|
-
newData.delete(deletePath[0]);
|
|
2455
|
-
return newData;
|
|
2456
|
-
}
|
|
2457
|
-
const [head, ...tail] = deletePath;
|
|
2458
|
-
newData.set(head, deleteNestedDataByPath(newData.get(head), tail));
|
|
2459
|
-
return newData;
|
|
2460
|
-
}
|
|
2461
|
-
if (oldData instanceof Set) {
|
|
2462
|
-
const setAsArray = deleteNestedDataByPath(Array.from(oldData), deletePath);
|
|
2463
|
-
return new Set(setAsArray);
|
|
2464
|
-
}
|
|
2465
|
-
if (Array.isArray(oldData)) {
|
|
2466
|
-
const newData = [...oldData];
|
|
2467
|
-
if (deletePath.length === 1) return newData.filter((_, idx) => idx.toString() !== deletePath[0]);
|
|
2468
|
-
const [head, ...tail] = deletePath;
|
|
2469
|
-
newData[head] = deleteNestedDataByPath(newData[head], tail);
|
|
2470
|
-
return newData;
|
|
2471
|
-
}
|
|
2472
|
-
if (oldData instanceof Object) {
|
|
2473
|
-
const newData = { ...oldData };
|
|
2474
|
-
if (deletePath.length === 1) {
|
|
2475
|
-
delete newData[deletePath[0]];
|
|
2476
|
-
return newData;
|
|
2477
|
-
}
|
|
2478
|
-
const [head, ...tail] = deletePath;
|
|
2479
|
-
newData[head] = deleteNestedDataByPath(newData[head], tail);
|
|
2480
|
-
return newData;
|
|
2481
|
-
}
|
|
2482
|
-
return oldData;
|
|
2483
|
-
};
|
|
2484
|
-
var setupStyleSheet = (nonce, target) => {
|
|
2485
|
-
if (!nonce) return;
|
|
2486
|
-
if (document.querySelector("#_goober") || target?.querySelector("#_goober")) return;
|
|
2487
|
-
const styleTag = document.createElement("style");
|
|
2488
|
-
const textNode = document.createTextNode("");
|
|
2489
|
-
styleTag.appendChild(textNode);
|
|
2490
|
-
styleTag.id = "_goober";
|
|
2491
|
-
styleTag.setAttribute("nonce", nonce);
|
|
2492
|
-
if (target) target.appendChild(styleTag);
|
|
2493
|
-
else document.head.appendChild(styleTag);
|
|
2494
|
-
};
|
|
2495
|
-
|
|
2496
|
-
//#endregion
|
|
2497
|
-
export { updateNestedDataByPath as $, getQueryStatusColor as A, on as B, createUniqueId as C, getMutationStatusColor as D, displayValue as E, isServer as F, setAttribute as G, onMount as H, lazy as I, splitProps as J, setupStyleSheet as K, memo as L, getQueryStatusLabel as M, getSidedProp as N, getOwner as O, insert as P, untrack as Q, mergeProps as R, createSignal as S, deleteNestedDataByPath as T, render as U, onCleanup as V, serialize as W, stringify as X, spread as Y, template as Z, createContext as _, Index as a, createRenderEffect as b, Show as c, batch as d, use as et, className as f, createComputed as g, createComponent as h, For as i, getQueryStatusColorByLabel as j, getPreferredColorScheme as k, Switch as l, convertRemToPixels as m, DEV as n, useTransition as nt, Match as o, clearDelegatedEvents as p, sortFns as q, Dynamic as r, Portal as s, $TRACK as t, useContext as tt, addEventListener as u, createEffect as v, delegateEvents as w, createRoot as x, createMemo as y, mutationSortFns as z };
|