@pie-element/mc-populated-blank 0.3.0-next.4 → 0.3.0-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/author/index.js +2260 -2213
- package/dist/author/index.js.map +1 -1
- package/dist/browser/author/index.js +7 -7
- package/dist/browser/{client-BAfWqkS6.js → client-BmZWrsT3.js} +866 -836
- package/dist/browser/client-BmZWrsT3.js.map +1 -0
- package/dist/browser/controller/index.js +3 -2
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +327 -328
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/{layoutLimits-ATKOwLHb.js → layoutLimits-Bp17YP2V.js} +3 -3
- package/dist/browser/layoutLimits-Bp17YP2V.js.map +1 -0
- package/dist/browser/print/index.js +78 -80
- package/dist/browser/print/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +2 -1
- package/dist/controller/index.d.ts +2 -2
- package/dist/controller/index.js +4 -3
- package/dist/controller/index.js.map +1 -1
- package/dist/delivery/index.js +1768 -1704
- package/dist/delivery/index.js.map +1 -1
- package/dist/index.iife.d.ts +2 -2
- package/dist/index.iife.js +80 -8
- package/dist/index.js +1768 -1704
- package/dist/index.js.map +1 -1
- package/dist/print/index.js +1405 -1342
- package/dist/print/index.js.map +1 -1
- package/dist/shared/layoutLimits.d.ts +1 -1
- package/dist/shared/types.d.ts +1 -0
- package/module/print.js +897 -869
- package/module/print.js.map +1 -1
- package/package.json +2 -2
- package/dist/browser/client-BAfWqkS6.js.map +0 -1
- package/dist/browser/layoutLimits-ATKOwLHb.js.map +0 -1
package/dist/delivery/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
1
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/disclose-version.js
|
|
2
2
|
if (typeof window !== "undefined") {
|
|
3
3
|
var _window$__svelte, _window;
|
|
4
4
|
((_window$__svelte = (_window = window).__svelte ?? (_window.__svelte = {})).v ?? (_window$__svelte.v = /* @__PURE__ */ new Set())).add("5");
|
|
5
5
|
}
|
|
6
6
|
//#endregion
|
|
7
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
7
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/constants.js
|
|
8
8
|
var HYDRATION_ERROR = {};
|
|
9
9
|
var UNINITIALIZED = Symbol("uninitialized");
|
|
10
10
|
var NAMESPACE_SVG = "http://www.w3.org/2000/svg";
|
|
11
11
|
var NAMESPACE_MATHML = "http://www.w3.org/1998/Math/MathML";
|
|
12
12
|
//#endregion
|
|
13
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
13
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/shared/utils.js
|
|
14
14
|
var is_array = Array.isArray;
|
|
15
15
|
var index_of = Array.prototype.indexOf;
|
|
16
16
|
var includes = Array.prototype.includes;
|
|
@@ -112,6 +112,8 @@ var REACTION_IS_UPDATING = 1 << 21;
|
|
|
112
112
|
var ASYNC = 1 << 22;
|
|
113
113
|
var ERROR_VALUE = 1 << 23;
|
|
114
114
|
var STATE_SYMBOL = Symbol("$state");
|
|
115
|
+
/** Marks component export objects, so that `proxy(...)` leaves them untouched */
|
|
116
|
+
var COMPONENT_SYMBOL = Symbol("component");
|
|
115
117
|
var LEGACY_PROPS = Symbol("legacy props");
|
|
116
118
|
var LOADING_ATTR_SYMBOL = Symbol("");
|
|
117
119
|
var ATTRIBUTES_CACHE = Symbol("attributes");
|
|
@@ -128,98 +130,6 @@ var STALE_REACTION = new class StaleReactionError extends Error {
|
|
|
128
130
|
}
|
|
129
131
|
}();
|
|
130
132
|
var IS_XHTML = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
|
|
131
|
-
//#endregion
|
|
132
|
-
//#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/errors.js
|
|
133
|
-
/**
|
|
134
|
-
* Cannot create a `$derived(...)` with an `await` expression outside of an effect tree
|
|
135
|
-
* @returns {never}
|
|
136
|
-
*/
|
|
137
|
-
function async_derived_orphan() {
|
|
138
|
-
throw new Error(`https://svelte.dev/e/async_derived_orphan`);
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Keyed each block has duplicate key `%value%` at indexes %a% and %b%
|
|
142
|
-
* @param {string} a
|
|
143
|
-
* @param {string} b
|
|
144
|
-
* @param {string | undefined | null} [value]
|
|
145
|
-
* @returns {never}
|
|
146
|
-
*/
|
|
147
|
-
function each_key_duplicate(a, b, value) {
|
|
148
|
-
throw new Error(`https://svelte.dev/e/each_key_duplicate`);
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* `%rune%` cannot be used inside an effect cleanup function
|
|
152
|
-
* @param {string} rune
|
|
153
|
-
* @returns {never}
|
|
154
|
-
*/
|
|
155
|
-
function effect_in_teardown(rune) {
|
|
156
|
-
throw new Error(`https://svelte.dev/e/effect_in_teardown`);
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Effect cannot be created inside a `$derived` value that was not itself created inside an effect
|
|
160
|
-
* @returns {never}
|
|
161
|
-
*/
|
|
162
|
-
function effect_in_unowned_derived() {
|
|
163
|
-
throw new Error(`https://svelte.dev/e/effect_in_unowned_derived`);
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* `%rune%` can only be used inside an effect (e.g. during component initialisation)
|
|
167
|
-
* @param {string} rune
|
|
168
|
-
* @returns {never}
|
|
169
|
-
*/
|
|
170
|
-
function effect_orphan(rune) {
|
|
171
|
-
throw new Error(`https://svelte.dev/e/effect_orphan`);
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
|
|
175
|
-
* @returns {never}
|
|
176
|
-
*/
|
|
177
|
-
function effect_update_depth_exceeded() {
|
|
178
|
-
throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Failed to hydrate the application
|
|
182
|
-
* @returns {never}
|
|
183
|
-
*/
|
|
184
|
-
function hydration_failed() {
|
|
185
|
-
throw new Error(`https://svelte.dev/e/hydration_failed`);
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value
|
|
189
|
-
* @param {string} key
|
|
190
|
-
* @returns {never}
|
|
191
|
-
*/
|
|
192
|
-
function props_invalid_value(key) {
|
|
193
|
-
throw new Error(`https://svelte.dev/e/props_invalid_value`);
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.
|
|
197
|
-
* @returns {never}
|
|
198
|
-
*/
|
|
199
|
-
function state_descriptors_fixed() {
|
|
200
|
-
throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Cannot set prototype of `$state` object
|
|
204
|
-
* @returns {never}
|
|
205
|
-
*/
|
|
206
|
-
function state_prototype_fixed() {
|
|
207
|
-
throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`
|
|
211
|
-
* @returns {never}
|
|
212
|
-
*/
|
|
213
|
-
function state_unsafe_mutation() {
|
|
214
|
-
throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* A `<svelte:boundary>` `reset` function cannot be called while an error is still being handled
|
|
218
|
-
* @returns {never}
|
|
219
|
-
*/
|
|
220
|
-
function svelte_boundary_reset_onerror() {
|
|
221
|
-
throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
|
|
222
|
-
}
|
|
223
133
|
/**
|
|
224
134
|
* Reading a derived belonging to a now-destroyed effect may result in stale values
|
|
225
135
|
*/
|
|
@@ -240,7 +150,7 @@ function svelte_boundary_reset_noop() {
|
|
|
240
150
|
console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
|
|
241
151
|
}
|
|
242
152
|
//#endregion
|
|
243
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
153
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/hydration.js
|
|
244
154
|
/** @import { TemplateNode } from '#client' */
|
|
245
155
|
/**
|
|
246
156
|
* Use this variable to guard everything related to hydration code so it can be treeshaken out
|
|
@@ -319,7 +229,7 @@ function read_hydration_instruction(node) {
|
|
|
319
229
|
return node.data;
|
|
320
230
|
}
|
|
321
231
|
//#endregion
|
|
322
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
232
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/equality.js
|
|
323
233
|
/** @import { Equals } from '#client' */
|
|
324
234
|
/** @type {Equals} */
|
|
325
235
|
function equals(value) {
|
|
@@ -338,13 +248,105 @@ function safe_equals(value) {
|
|
|
338
248
|
return !safe_not_equal(value, this.v);
|
|
339
249
|
}
|
|
340
250
|
//#endregion
|
|
341
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
251
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/errors.js
|
|
252
|
+
/**
|
|
253
|
+
* Cannot create a `$derived(...)` with an `await` expression outside of an effect tree
|
|
254
|
+
* @returns {never}
|
|
255
|
+
*/
|
|
256
|
+
function async_derived_orphan() {
|
|
257
|
+
throw new Error(`https://svelte.dev/e/async_derived_orphan`);
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Keyed each block has duplicate key `%value%` at indexes %a% and %b%
|
|
261
|
+
* @param {string} a
|
|
262
|
+
* @param {string} b
|
|
263
|
+
* @param {string | undefined | null} [value]
|
|
264
|
+
* @returns {never}
|
|
265
|
+
*/
|
|
266
|
+
function each_key_duplicate(a, b, value) {
|
|
267
|
+
throw new Error(`https://svelte.dev/e/each_key_duplicate`);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* `%rune%` cannot be used inside an effect cleanup function
|
|
271
|
+
* @param {string} rune
|
|
272
|
+
* @returns {never}
|
|
273
|
+
*/
|
|
274
|
+
function effect_in_teardown(rune) {
|
|
275
|
+
throw new Error(`https://svelte.dev/e/effect_in_teardown`);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Effect cannot be created inside a `$derived` value that was not itself created inside an effect
|
|
279
|
+
* @returns {never}
|
|
280
|
+
*/
|
|
281
|
+
function effect_in_unowned_derived() {
|
|
282
|
+
throw new Error(`https://svelte.dev/e/effect_in_unowned_derived`);
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* `%rune%` can only be used inside an effect (e.g. during component initialisation)
|
|
286
|
+
* @param {string} rune
|
|
287
|
+
* @returns {never}
|
|
288
|
+
*/
|
|
289
|
+
function effect_orphan(rune) {
|
|
290
|
+
throw new Error(`https://svelte.dev/e/effect_orphan`);
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
|
|
294
|
+
* @returns {never}
|
|
295
|
+
*/
|
|
296
|
+
function effect_update_depth_exceeded() {
|
|
297
|
+
throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Failed to hydrate the application
|
|
301
|
+
* @returns {never}
|
|
302
|
+
*/
|
|
303
|
+
function hydration_failed() {
|
|
304
|
+
throw new Error(`https://svelte.dev/e/hydration_failed`);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value
|
|
308
|
+
* @param {string} key
|
|
309
|
+
* @returns {never}
|
|
310
|
+
*/
|
|
311
|
+
function props_invalid_value(key) {
|
|
312
|
+
throw new Error(`https://svelte.dev/e/props_invalid_value`);
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.
|
|
316
|
+
* @returns {never}
|
|
317
|
+
*/
|
|
318
|
+
function state_descriptors_fixed() {
|
|
319
|
+
throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Cannot set prototype of `$state` object
|
|
323
|
+
* @returns {never}
|
|
324
|
+
*/
|
|
325
|
+
function state_prototype_fixed() {
|
|
326
|
+
throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`
|
|
330
|
+
* @returns {never}
|
|
331
|
+
*/
|
|
332
|
+
function state_unsafe_mutation() {
|
|
333
|
+
throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* A `<svelte:boundary>` `reset` function cannot be called while an error is still being handled
|
|
337
|
+
* @returns {never}
|
|
338
|
+
*/
|
|
339
|
+
function svelte_boundary_reset_onerror() {
|
|
340
|
+
throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
|
|
341
|
+
}
|
|
342
|
+
//#endregion
|
|
343
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/flags/index.js
|
|
342
344
|
/** True if experimental.async=true */
|
|
343
345
|
var async_mode_flag = false;
|
|
344
346
|
/** True if we're not certain that we only have Svelte 5 code in the compilation */
|
|
345
347
|
var legacy_mode_flag = false;
|
|
346
348
|
//#endregion
|
|
347
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
349
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/context.js
|
|
348
350
|
/** @import { ComponentContext, DevStackEntry, Effect } from '#client' */
|
|
349
351
|
/** @type {ComponentContext | null} */
|
|
350
352
|
var component_context = null;
|
|
@@ -389,14 +391,22 @@ function pop(component) {
|
|
|
389
391
|
if (component !== void 0) context.x = component;
|
|
390
392
|
context.i = true;
|
|
391
393
|
component_context = context.p;
|
|
392
|
-
return component
|
|
394
|
+
return mark_as_component(component);
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Add a symbol to the object (or create one if undefined) to mark it as a component so it isn't proxified.
|
|
398
|
+
* @param {any} component
|
|
399
|
+
*/
|
|
400
|
+
function mark_as_component(component = {}) {
|
|
401
|
+
define_property(component, COMPONENT_SYMBOL, { value: true });
|
|
402
|
+
return component;
|
|
393
403
|
}
|
|
394
404
|
/** @returns {boolean} */
|
|
395
405
|
function is_runes() {
|
|
396
406
|
return !legacy_mode_flag || component_context !== null && component_context.l === null;
|
|
397
407
|
}
|
|
398
408
|
//#endregion
|
|
399
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
409
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/task.js
|
|
400
410
|
/** @type {Array<() => void>} */
|
|
401
411
|
var micro_tasks = [];
|
|
402
412
|
function run_micro_tasks() {
|
|
@@ -422,40 +432,8 @@ function queue_micro_task(fn) {
|
|
|
422
432
|
function flush_tasks() {
|
|
423
433
|
while (micro_tasks.length > 0) run_micro_tasks();
|
|
424
434
|
}
|
|
425
|
-
/**
|
|
426
|
-
* @param {unknown} error
|
|
427
|
-
*/
|
|
428
|
-
function handle_error(error) {
|
|
429
|
-
var effect = active_effect;
|
|
430
|
-
if (effect === null) {
|
|
431
|
-
/** @type {Derived} */ active_reaction.f |= ERROR_VALUE;
|
|
432
|
-
return error;
|
|
433
|
-
}
|
|
434
|
-
if ((effect.f & 32768) === 0 && (effect.f & 4) === 0) throw error;
|
|
435
|
-
invoke_error_boundary(error, effect);
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* @param {unknown} error
|
|
439
|
-
* @param {Effect | null} effect
|
|
440
|
-
*/
|
|
441
|
-
function invoke_error_boundary(error, effect) {
|
|
442
|
-
if (effect !== null && (effect.f & 16384) !== 0) return;
|
|
443
|
-
while (effect !== null) {
|
|
444
|
-
if ((effect.f & 128) !== 0) {
|
|
445
|
-
if ((effect.f & 32768) === 0) throw error;
|
|
446
|
-
try {
|
|
447
|
-
/** @type {Boundary} */ effect.b.error(error);
|
|
448
|
-
return;
|
|
449
|
-
} catch (e) {
|
|
450
|
-
error = e;
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
effect = effect.parent;
|
|
454
|
-
}
|
|
455
|
-
throw error;
|
|
456
|
-
}
|
|
457
435
|
//#endregion
|
|
458
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
436
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/status.js
|
|
459
437
|
/** @import { Derived, Signal } from '#client' */
|
|
460
438
|
var STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);
|
|
461
439
|
/**
|
|
@@ -474,7 +452,7 @@ function update_derived_status(derived) {
|
|
|
474
452
|
else set_signal_status(derived, MAYBE_DIRTY);
|
|
475
453
|
}
|
|
476
454
|
//#endregion
|
|
477
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
455
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/utils.js
|
|
478
456
|
/** @import { Derived, Effect, Value } from '#client' */
|
|
479
457
|
/**
|
|
480
458
|
* @param {Value[] | null} deps
|
|
@@ -502,7 +480,7 @@ function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
|
|
|
502
480
|
set_signal_status(effect, CLEAN);
|
|
503
481
|
}
|
|
504
482
|
//#endregion
|
|
505
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
483
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/store.js
|
|
506
484
|
/**
|
|
507
485
|
* We set this to `true` when updating a store so that we correctly
|
|
508
486
|
* schedule effects if the update takes place inside a `$:` effect
|
|
@@ -532,7 +510,7 @@ function capture_store_binding(fn) {
|
|
|
532
510
|
}
|
|
533
511
|
}
|
|
534
512
|
//#endregion
|
|
535
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
513
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/misc.js
|
|
536
514
|
var listening_to_form_reset = false;
|
|
537
515
|
function add_form_reset_listener() {
|
|
538
516
|
if (!listening_to_form_reset) {
|
|
@@ -546,7 +524,7 @@ function add_form_reset_listener() {
|
|
|
546
524
|
}
|
|
547
525
|
}
|
|
548
526
|
//#endregion
|
|
549
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
527
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
|
|
550
528
|
/**
|
|
551
529
|
* @template T
|
|
552
530
|
* @param {() => T} fn
|
|
@@ -564,1430 +542,990 @@ function without_reactive_context(fn) {
|
|
|
564
542
|
}
|
|
565
543
|
}
|
|
566
544
|
//#endregion
|
|
567
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
545
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/async.js
|
|
546
|
+
/** @import { Blocker, Effect, Source, Value } from '#client' */
|
|
568
547
|
/**
|
|
569
|
-
*
|
|
570
|
-
*
|
|
571
|
-
*
|
|
572
|
-
*
|
|
573
|
-
* the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.
|
|
574
|
-
*
|
|
575
|
-
* If `start` returns a cleanup function, it will be called when the effect is destroyed.
|
|
576
|
-
*
|
|
577
|
-
* If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects
|
|
578
|
-
* are active, and the returned teardown function will only be called when all effects are destroyed.
|
|
579
|
-
*
|
|
580
|
-
* It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):
|
|
581
|
-
*
|
|
582
|
-
* ```js
|
|
583
|
-
* import { createSubscriber } from 'svelte/reactivity';
|
|
584
|
-
* import { on } from 'svelte/events';
|
|
585
|
-
*
|
|
586
|
-
* export class MediaQuery {
|
|
587
|
-
* #query;
|
|
588
|
-
* #subscribe;
|
|
589
|
-
*
|
|
590
|
-
* constructor(query) {
|
|
591
|
-
* this.#query = window.matchMedia(`(${query})`);
|
|
592
|
-
*
|
|
593
|
-
* this.#subscribe = createSubscriber((update) => {
|
|
594
|
-
* // when the `change` event occurs, re-run any effects that read `this.current`
|
|
595
|
-
* const off = on(this.#query, 'change', update);
|
|
596
|
-
*
|
|
597
|
-
* // stop listening when all the effects are destroyed
|
|
598
|
-
* return () => off();
|
|
599
|
-
* });
|
|
600
|
-
* }
|
|
601
|
-
*
|
|
602
|
-
* get current() {
|
|
603
|
-
* // This makes the getter reactive, if read in an effect
|
|
604
|
-
* this.#subscribe();
|
|
605
|
-
*
|
|
606
|
-
* // Return the current state of the query, whether or not we're in an effect
|
|
607
|
-
* return this.#query.matches;
|
|
608
|
-
* }
|
|
609
|
-
* }
|
|
610
|
-
* ```
|
|
611
|
-
* @param {(update: () => void) => (() => void) | void} start
|
|
612
|
-
* @since 5.7.0
|
|
548
|
+
* @param {Blocker[]} blockers
|
|
549
|
+
* @param {Array<() => any>} sync
|
|
550
|
+
* @param {Array<() => Promise<any>>} async
|
|
551
|
+
* @param {(values: Value[]) => any} fn
|
|
613
552
|
*/
|
|
614
|
-
function
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
});
|
|
553
|
+
function flatten(blockers, sync, async, fn) {
|
|
554
|
+
const d = is_runes() ? derived : derived_safe_equal;
|
|
555
|
+
var pending = blockers.filter((b) => !b.settled);
|
|
556
|
+
var deriveds = sync.map(d);
|
|
557
|
+
if (async.length === 0 && pending.length === 0) {
|
|
558
|
+
fn(deriveds);
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
var parent = active_effect;
|
|
562
|
+
var restore = capture();
|
|
563
|
+
var blocker_promise = pending.length === 1 ? pending[0].promise : pending.length > 1 ? Promise.all(pending.map((b) => b.promise)) : null;
|
|
564
|
+
/**
|
|
565
|
+
* @param {Source[]} async
|
|
566
|
+
*/
|
|
567
|
+
function finish(async) {
|
|
568
|
+
if ((parent.f & 16384) !== 0) return;
|
|
569
|
+
restore();
|
|
570
|
+
try {
|
|
571
|
+
fn([...deriveds, ...async]);
|
|
572
|
+
} catch (error) {
|
|
573
|
+
invoke_error_boundary(error, parent);
|
|
636
574
|
}
|
|
637
|
-
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
575
|
+
unset_context();
|
|
576
|
+
}
|
|
577
|
+
var decrement_pending = increment_pending();
|
|
578
|
+
if (async.length === 0) {
|
|
579
|
+
/** @type {Promise<any>} */ blocker_promise.then(() => finish([])).finally(decrement_pending);
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
function run() {
|
|
583
|
+
Promise.all(async.map((expression) => /* @__PURE__ */ async_derived(expression))).then(finish).catch((error) => invoke_error_boundary(error, parent)).finally(decrement_pending);
|
|
584
|
+
}
|
|
585
|
+
if (blocker_promise) blocker_promise.then(() => {
|
|
586
|
+
restore();
|
|
587
|
+
run();
|
|
588
|
+
unset_context();
|
|
589
|
+
});
|
|
590
|
+
else run();
|
|
648
591
|
}
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
592
|
+
/**
|
|
593
|
+
* Captures the current effect context so that we can restore it after
|
|
594
|
+
* some asynchronous work has happened (so that e.g. `await a + b`
|
|
595
|
+
* causes `b` to be registered as a dependency).
|
|
596
|
+
*/
|
|
597
|
+
function capture() {
|
|
598
|
+
var previous_effect = active_effect;
|
|
599
|
+
var previous_reaction = active_reaction;
|
|
600
|
+
var previous_component_context = component_context;
|
|
601
|
+
var previous_batch = current_batch;
|
|
602
|
+
return function restore(activate_batch = true) {
|
|
603
|
+
set_active_effect(previous_effect);
|
|
604
|
+
set_active_reaction(previous_reaction);
|
|
605
|
+
set_component_context(previous_component_context);
|
|
606
|
+
if (activate_batch && (previous_effect.f & 16384) === 0) {
|
|
607
|
+
previous_batch?.activate();
|
|
608
|
+
previous_batch?.apply();
|
|
609
|
+
}
|
|
610
|
+
};
|
|
653
611
|
}
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
612
|
+
function unset_context(deactivate_batch = true) {
|
|
613
|
+
set_active_effect(null);
|
|
614
|
+
set_active_reaction(null);
|
|
615
|
+
set_component_context(null);
|
|
616
|
+
if (deactivate_batch) current_batch?.deactivate();
|
|
659
617
|
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
618
|
+
/**
|
|
619
|
+
* @returns {(skip?: boolean) => void}
|
|
620
|
+
*/
|
|
621
|
+
function increment_pending() {
|
|
622
|
+
var effect = active_effect;
|
|
623
|
+
var boundary = effect.b;
|
|
624
|
+
var batch = current_batch;
|
|
625
|
+
var blocking = !!boundary?.is_rendered();
|
|
626
|
+
boundary?.update_pending_count(1, batch);
|
|
627
|
+
batch.increment(blocking, effect);
|
|
628
|
+
return () => {
|
|
629
|
+
boundary?.update_pending_count(-1, batch);
|
|
630
|
+
batch.decrement(blocking, effect);
|
|
631
|
+
};
|
|
664
632
|
}
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
633
|
+
/**
|
|
634
|
+
* @template V
|
|
635
|
+
* @param {() => V} fn
|
|
636
|
+
* @returns {Derived<V>}
|
|
637
|
+
*/
|
|
638
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
639
|
+
function derived(fn) {
|
|
640
|
+
var flags = 2 | DIRTY;
|
|
641
|
+
if (active_effect !== null) active_effect.f |= EFFECT_PRESERVED;
|
|
642
|
+
return {
|
|
643
|
+
ctx: component_context,
|
|
644
|
+
deps: null,
|
|
645
|
+
effects: null,
|
|
646
|
+
equals,
|
|
647
|
+
f: flags,
|
|
648
|
+
fn,
|
|
649
|
+
reactions: null,
|
|
650
|
+
rv: 0,
|
|
651
|
+
v: UNINITIALIZED,
|
|
652
|
+
wv: 0,
|
|
653
|
+
parent: active_effect,
|
|
654
|
+
ac: null
|
|
655
|
+
};
|
|
669
656
|
}
|
|
670
|
-
|
|
671
|
-
//#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
|
|
672
|
-
/** @import { Effect, Source, TemplateNode, } from '#client' */
|
|
657
|
+
var OBSOLETE = Symbol("obsolete");
|
|
673
658
|
/**
|
|
674
|
-
* @
|
|
675
|
-
*
|
|
676
|
-
*
|
|
677
|
-
*
|
|
678
|
-
* }
|
|
659
|
+
* @template V
|
|
660
|
+
* @param {() => V | Promise<V>} fn
|
|
661
|
+
* @param {string} [label]
|
|
662
|
+
* @param {string} [location] If provided, print a warning if the value is not read immediately after update
|
|
663
|
+
* @returns {Promise<Source<V>>}
|
|
679
664
|
*/
|
|
680
|
-
|
|
665
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
666
|
+
function async_derived(fn, label, location) {
|
|
667
|
+
let parent = active_effect;
|
|
668
|
+
if (parent === null) async_derived_orphan();
|
|
669
|
+
var promise = void 0;
|
|
670
|
+
var signal = source(UNINITIALIZED);
|
|
671
|
+
var should_suspend = !active_reaction;
|
|
672
|
+
/** @type {Set<ReturnType<typeof deferred<V>>>} */
|
|
673
|
+
var deferreds = /* @__PURE__ */ new Set();
|
|
674
|
+
async_effect(() => {
|
|
675
|
+
var effect = active_effect;
|
|
676
|
+
/** @type {ReturnType<typeof deferred<V>>} */
|
|
677
|
+
var d = deferred();
|
|
678
|
+
promise = d.promise;
|
|
679
|
+
try {
|
|
680
|
+
Promise.resolve(fn()).then(d.resolve, (e) => {
|
|
681
|
+
if (e !== STALE_REACTION) d.reject(e);
|
|
682
|
+
}).finally(unset_context);
|
|
683
|
+
} catch (error) {
|
|
684
|
+
d.reject(error);
|
|
685
|
+
unset_context();
|
|
686
|
+
}
|
|
687
|
+
var batch = current_batch;
|
|
688
|
+
if (should_suspend) {
|
|
689
|
+
if ((effect.f & 32768) !== 0) var decrement_pending = increment_pending();
|
|
690
|
+
if (parent.b?.is_rendered()) batch.async_deriveds.get(effect)?.reject(OBSOLETE);
|
|
691
|
+
else for (const d of deferreds.values()) d.reject(OBSOLETE);
|
|
692
|
+
deferreds.add(d);
|
|
693
|
+
batch.async_deriveds.set(effect, d);
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* @param {any} value
|
|
697
|
+
* @param {unknown} error
|
|
698
|
+
*/
|
|
699
|
+
const handler = (value, error = void 0) => {
|
|
700
|
+
decrement_pending?.();
|
|
701
|
+
deferreds.delete(d);
|
|
702
|
+
if (error === OBSOLETE) return;
|
|
703
|
+
batch.activate();
|
|
704
|
+
if (error) {
|
|
705
|
+
signal.f |= ERROR_VALUE;
|
|
706
|
+
internal_set(signal, error);
|
|
707
|
+
} else {
|
|
708
|
+
if ((signal.f & 8388608) !== 0) signal.f ^= ERROR_VALUE;
|
|
709
|
+
internal_set(signal, value);
|
|
710
|
+
}
|
|
711
|
+
batch.deactivate();
|
|
712
|
+
};
|
|
713
|
+
d.promise.then(handler, (e) => handler(null, e || "unknown"));
|
|
714
|
+
});
|
|
715
|
+
teardown(() => {
|
|
716
|
+
for (const d of deferreds) d.reject(OBSOLETE);
|
|
717
|
+
});
|
|
718
|
+
return new Promise((fulfil) => {
|
|
719
|
+
/** @param {Promise<V>} p */
|
|
720
|
+
function next(p) {
|
|
721
|
+
function go() {
|
|
722
|
+
if (p === promise) fulfil(signal);
|
|
723
|
+
else next(promise);
|
|
724
|
+
}
|
|
725
|
+
p.then(go, go);
|
|
726
|
+
}
|
|
727
|
+
next(promise);
|
|
728
|
+
});
|
|
729
|
+
}
|
|
681
730
|
/**
|
|
682
|
-
* @
|
|
683
|
-
* @param {
|
|
684
|
-
* @
|
|
685
|
-
* @param {((error: unknown) => unknown) | undefined} [transform_error]
|
|
686
|
-
* @returns {void}
|
|
731
|
+
* @template V
|
|
732
|
+
* @param {() => V} fn
|
|
733
|
+
* @returns {Derived<V>}
|
|
687
734
|
*/
|
|
688
|
-
|
|
689
|
-
|
|
735
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
736
|
+
function user_derived(fn) {
|
|
737
|
+
const d = /* @__PURE__ */ derived(fn);
|
|
738
|
+
if (!async_mode_flag) push_reaction_value(d);
|
|
739
|
+
return d;
|
|
690
740
|
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
var
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
* @param {BoundaryProps} props
|
|
712
|
-
* @param {((anchor: Node) => void)} children
|
|
713
|
-
* @param {((error: unknown) => unknown) | undefined} [transform_error]
|
|
714
|
-
*/
|
|
715
|
-
constructor(node, props, children, transform_error) {
|
|
716
|
-
_classPrivateMethodInitSpec(this, _Boundary_brand);
|
|
717
|
-
_defineProperty(
|
|
718
|
-
this,
|
|
719
|
-
/** @type {Boundary | null} */
|
|
720
|
-
"parent",
|
|
721
|
-
void 0
|
|
722
|
-
);
|
|
723
|
-
_defineProperty(this, "is_pending", false);
|
|
724
|
-
_defineProperty(
|
|
725
|
-
this,
|
|
726
|
-
/**
|
|
727
|
-
* API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
|
|
728
|
-
* Inherited from parent boundary, or defaults to identity.
|
|
729
|
-
* @type {(error: unknown) => unknown}
|
|
730
|
-
*/
|
|
731
|
-
"transform_error",
|
|
732
|
-
void 0
|
|
733
|
-
);
|
|
734
|
-
_classPrivateFieldInitSpec(this, _anchor, void 0);
|
|
735
|
-
_classPrivateFieldInitSpec(this, _hydrate_open, hydrating ? hydrate_node : null);
|
|
736
|
-
_classPrivateFieldInitSpec(this, _props, void 0);
|
|
737
|
-
_classPrivateFieldInitSpec(this, _children, void 0);
|
|
738
|
-
_classPrivateFieldInitSpec(this, _effect, void 0);
|
|
739
|
-
_classPrivateFieldInitSpec(this, _main_effect, null);
|
|
740
|
-
_classPrivateFieldInitSpec(this, _pending_effect, null);
|
|
741
|
-
_classPrivateFieldInitSpec(this, _failed_effect, null);
|
|
742
|
-
_classPrivateFieldInitSpec(this, _offscreen_fragment, null);
|
|
743
|
-
_classPrivateFieldInitSpec(this, _local_pending_count, 0);
|
|
744
|
-
_classPrivateFieldInitSpec(this, _pending_count, 0);
|
|
745
|
-
_classPrivateFieldInitSpec(this, _pending_count_update_queued, false);
|
|
746
|
-
_classPrivateFieldInitSpec(this, _dirty_effects$1, /* @__PURE__ */ new Set());
|
|
747
|
-
_classPrivateFieldInitSpec(this, _maybe_dirty_effects$1, /* @__PURE__ */ new Set());
|
|
748
|
-
_classPrivateFieldInitSpec(this, _effect_pending, null);
|
|
749
|
-
_classPrivateFieldInitSpec(this, _effect_pending_subscriber, createSubscriber(() => {
|
|
750
|
-
_classPrivateFieldSet2(_effect_pending, this, source(_classPrivateFieldGet2(_local_pending_count, this)));
|
|
751
|
-
return () => {
|
|
752
|
-
_classPrivateFieldSet2(_effect_pending, this, null);
|
|
753
|
-
};
|
|
754
|
-
}));
|
|
755
|
-
_classPrivateFieldSet2(_anchor, this, node);
|
|
756
|
-
_classPrivateFieldSet2(_props, this, props);
|
|
757
|
-
_classPrivateFieldSet2(_children, this, (anchor) => {
|
|
758
|
-
var effect = active_effect;
|
|
759
|
-
effect.b = this;
|
|
760
|
-
effect.f |= 128;
|
|
761
|
-
children(anchor);
|
|
762
|
-
});
|
|
763
|
-
this.parent = active_effect.b;
|
|
764
|
-
this.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e);
|
|
765
|
-
_classPrivateFieldSet2(_effect, this, block(() => {
|
|
766
|
-
if (hydrating) {
|
|
767
|
-
const comment = _classPrivateFieldGet2(_hydrate_open, this);
|
|
768
|
-
hydrate_next();
|
|
769
|
-
const server_rendered_pending = comment.data === "[!";
|
|
770
|
-
if (comment.data.startsWith("[?")) {
|
|
771
|
-
const serialized_error = JSON.parse(comment.data.slice(2));
|
|
772
|
-
_assertClassBrand(_Boundary_brand, this, _hydrate_failed_content).call(this, serialized_error);
|
|
773
|
-
} else if (server_rendered_pending) _assertClassBrand(_Boundary_brand, this, _hydrate_pending_content).call(this);
|
|
774
|
-
else _assertClassBrand(_Boundary_brand, this, _hydrate_resolved_content).call(this);
|
|
775
|
-
} else _assertClassBrand(_Boundary_brand, this, _render).call(this);
|
|
776
|
-
}, flags));
|
|
777
|
-
if (hydrating) _classPrivateFieldSet2(_anchor, this, hydrate_node);
|
|
778
|
-
}
|
|
779
|
-
/**
|
|
780
|
-
* Defer an effect inside a pending boundary until the boundary resolves
|
|
781
|
-
* @param {Effect} effect
|
|
782
|
-
*/
|
|
783
|
-
defer_effect(effect) {
|
|
784
|
-
defer_effect(effect, _classPrivateFieldGet2(_dirty_effects$1, this), _classPrivateFieldGet2(_maybe_dirty_effects$1, this));
|
|
785
|
-
}
|
|
786
|
-
/**
|
|
787
|
-
* Returns `false` if the effect exists inside a boundary whose pending snippet is shown
|
|
788
|
-
* @returns {boolean}
|
|
789
|
-
*/
|
|
790
|
-
is_rendered() {
|
|
791
|
-
return !this.is_pending && (!this.parent || this.parent.is_rendered());
|
|
792
|
-
}
|
|
793
|
-
has_pending_snippet() {
|
|
794
|
-
return !!_classPrivateFieldGet2(_props, this).pending;
|
|
795
|
-
}
|
|
796
|
-
/**
|
|
797
|
-
* Update the source that powers `$effect.pending()` inside this boundary,
|
|
798
|
-
* and controls when the current `pending` snippet (if any) is removed.
|
|
799
|
-
* Do not call from inside the class
|
|
800
|
-
* @param {1 | -1} d
|
|
801
|
-
* @param {Batch} batch
|
|
802
|
-
*/
|
|
803
|
-
update_pending_count(d, batch) {
|
|
804
|
-
_assertClassBrand(_Boundary_brand, this, _update_pending_count).call(this, d, batch);
|
|
805
|
-
_classPrivateFieldSet2(_local_pending_count, this, _classPrivateFieldGet2(_local_pending_count, this) + d);
|
|
806
|
-
if (!_classPrivateFieldGet2(_effect_pending, this) || _classPrivateFieldGet2(_pending_count_update_queued, this)) return;
|
|
807
|
-
_classPrivateFieldSet2(_pending_count_update_queued, this, true);
|
|
808
|
-
queue_micro_task(() => {
|
|
809
|
-
_classPrivateFieldSet2(_pending_count_update_queued, this, false);
|
|
810
|
-
if (_classPrivateFieldGet2(_effect_pending, this)) internal_set(_classPrivateFieldGet2(_effect_pending, this), _classPrivateFieldGet2(_local_pending_count, this));
|
|
811
|
-
});
|
|
812
|
-
}
|
|
813
|
-
get_effect_pending() {
|
|
814
|
-
_classPrivateFieldGet2(_effect_pending_subscriber, this).call(this);
|
|
815
|
-
return get(_classPrivateFieldGet2(_effect_pending, this));
|
|
741
|
+
/**
|
|
742
|
+
* @template V
|
|
743
|
+
* @param {() => V} fn
|
|
744
|
+
* @returns {Derived<V>}
|
|
745
|
+
*/
|
|
746
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
747
|
+
function derived_safe_equal(fn) {
|
|
748
|
+
const signal = /* @__PURE__ */ derived(fn);
|
|
749
|
+
signal.equals = safe_equals;
|
|
750
|
+
return signal;
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* @param {Derived} derived
|
|
754
|
+
* @returns {void}
|
|
755
|
+
*/
|
|
756
|
+
function destroy_derived_effects(derived) {
|
|
757
|
+
var effects = derived.effects;
|
|
758
|
+
if (effects !== null) {
|
|
759
|
+
derived.effects = null;
|
|
760
|
+
for (var i = 0; i < effects.length; i += 1) destroy_effect(effects[i]);
|
|
816
761
|
}
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* @template T
|
|
765
|
+
* @param {Derived} derived
|
|
766
|
+
* @returns {T}
|
|
767
|
+
*/
|
|
768
|
+
function execute_derived(derived) {
|
|
769
|
+
var value;
|
|
770
|
+
var prev_active_effect = active_effect;
|
|
771
|
+
var parent = derived.parent;
|
|
772
|
+
if (!is_destroying_effect && parent !== null && derived.v !== UNINITIALIZED && (parent.f & 24576) !== 0) {
|
|
773
|
+
derived_inert();
|
|
774
|
+
return derived.v;
|
|
828
775
|
}
|
|
829
|
-
|
|
830
|
-
function _hydrate_resolved_content() {
|
|
776
|
+
set_active_effect(parent);
|
|
831
777
|
try {
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
778
|
+
derived.f &= ~WAS_MARKED;
|
|
779
|
+
destroy_derived_effects(derived);
|
|
780
|
+
value = update_reaction(derived);
|
|
781
|
+
} finally {
|
|
782
|
+
set_active_effect(prev_active_effect);
|
|
835
783
|
}
|
|
784
|
+
return value;
|
|
836
785
|
}
|
|
837
786
|
/**
|
|
838
|
-
* @param {
|
|
787
|
+
* @param {Derived} derived
|
|
788
|
+
* @returns {void}
|
|
839
789
|
*/
|
|
840
|
-
function
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
790
|
+
function update_derived(derived) {
|
|
791
|
+
var value = execute_derived(derived);
|
|
792
|
+
if (!derived.equals(value)) {
|
|
793
|
+
derived.wv = increment_write_version();
|
|
794
|
+
if (!current_batch?.is_fork || derived.deps === null) {
|
|
795
|
+
if (current_batch !== null) {
|
|
796
|
+
current_batch.capture(derived, value, true);
|
|
797
|
+
previous_batch?.capture(derived, value, true);
|
|
798
|
+
} else derived.v = value;
|
|
799
|
+
if (derived.deps === null) {
|
|
800
|
+
set_signal_status(derived, CLEAN);
|
|
801
|
+
return;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
if (is_destroying_effect) return;
|
|
806
|
+
if (batch_values !== null) {
|
|
807
|
+
if (effect_tracking() || current_batch?.is_fork) batch_values.set(derived, value);
|
|
808
|
+
} else update_derived_status(derived);
|
|
848
809
|
}
|
|
849
810
|
/**
|
|
850
|
-
*
|
|
851
|
-
* that invokes `onerror` with it (if provided)
|
|
852
|
-
* @param {unknown} error
|
|
853
|
-
* @returns {{ reset: () => void, invoke_onerror: () => void }}
|
|
811
|
+
* @param {Derived} derived
|
|
854
812
|
*/
|
|
855
|
-
function
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
if (
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
}
|
|
863
|
-
did_reset = true;
|
|
864
|
-
if (calling_on_error) svelte_boundary_reset_onerror();
|
|
865
|
-
if (_classPrivateFieldGet2(_failed_effect, this) !== null) pause_effect(_classPrivateFieldGet2(_failed_effect, this), () => {
|
|
866
|
-
_classPrivateFieldSet2(_failed_effect, this, null);
|
|
867
|
-
});
|
|
868
|
-
_assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
869
|
-
_assertClassBrand(_Boundary_brand, this, _render).call(this);
|
|
813
|
+
function freeze_derived_effects(derived) {
|
|
814
|
+
if (derived.effects === null) return;
|
|
815
|
+
for (const e of derived.effects) if (e.teardown || e.ac) {
|
|
816
|
+
e.teardown?.();
|
|
817
|
+
if (e.ac !== null) without_reactive_context(() => {
|
|
818
|
+
/** @type {AbortController} */ e.ac.abort(STALE_REACTION);
|
|
819
|
+
e.ac = null;
|
|
870
820
|
});
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
_classPrivateFieldGet2(_props, this).onerror?.(error, reset);
|
|
876
|
-
calling_on_error = false;
|
|
877
|
-
} catch (err) {
|
|
878
|
-
invoke_error_boundary(err, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
|
|
879
|
-
}
|
|
880
|
-
};
|
|
881
|
-
return {
|
|
882
|
-
reset,
|
|
883
|
-
invoke_onerror
|
|
884
|
-
};
|
|
821
|
+
if (e.fn !== null) e.teardown = noop;
|
|
822
|
+
remove_reactions(e, 0);
|
|
823
|
+
destroy_effect_children(e);
|
|
824
|
+
}
|
|
885
825
|
}
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
|
|
893
|
-
var anchor = create_text();
|
|
894
|
-
fragment.append(anchor);
|
|
895
|
-
_classPrivateFieldSet2(_main_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
896
|
-
return branch(() => _classPrivateFieldGet2(_children, this).call(this, anchor));
|
|
897
|
-
}));
|
|
898
|
-
if (_classPrivateFieldGet2(_pending_count, this) === 0) {
|
|
899
|
-
_classPrivateFieldGet2(_anchor, this).before(fragment);
|
|
900
|
-
_classPrivateFieldSet2(_offscreen_fragment, this, null);
|
|
901
|
-
pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
|
|
902
|
-
_classPrivateFieldSet2(_pending_effect, this, null);
|
|
903
|
-
});
|
|
904
|
-
_assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
|
|
905
|
-
}
|
|
906
|
-
});
|
|
826
|
+
/**
|
|
827
|
+
* @param {Derived} derived
|
|
828
|
+
*/
|
|
829
|
+
function unfreeze_derived_effects(derived) {
|
|
830
|
+
if (derived.effects === null) return;
|
|
831
|
+
for (const e of derived.effects) if (e.teardown && e.fn !== null) update_effect(e);
|
|
907
832
|
}
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
833
|
+
//#endregion
|
|
834
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/checkPrivateRedeclaration.js
|
|
835
|
+
function _checkPrivateRedeclaration(e, t) {
|
|
836
|
+
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
837
|
+
}
|
|
838
|
+
//#endregion
|
|
839
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateMethodInitSpec.js
|
|
840
|
+
function _classPrivateMethodInitSpec(e, a) {
|
|
841
|
+
_checkPrivateRedeclaration(e, a), a.add(e);
|
|
842
|
+
}
|
|
843
|
+
//#endregion
|
|
844
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldInitSpec.js
|
|
845
|
+
function _classPrivateFieldInitSpec(e, t, a) {
|
|
846
|
+
_checkPrivateRedeclaration(e, t), t.set(e, a);
|
|
847
|
+
}
|
|
848
|
+
//#endregion
|
|
849
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/assertClassBrand.js
|
|
850
|
+
function _assertClassBrand(e, t, n) {
|
|
851
|
+
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
852
|
+
throw new TypeError("Private element is not present on this object");
|
|
853
|
+
}
|
|
854
|
+
//#endregion
|
|
855
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldSet2.js
|
|
856
|
+
function _classPrivateFieldSet2(s, a, r) {
|
|
857
|
+
return s.set(_assertClassBrand(s, a), r), r;
|
|
858
|
+
}
|
|
859
|
+
//#endregion
|
|
860
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldGet2.js
|
|
861
|
+
function _classPrivateFieldGet2(s, a) {
|
|
862
|
+
return s.get(_assertClassBrand(s, a));
|
|
925
863
|
}
|
|
864
|
+
//#endregion
|
|
865
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/batch.js
|
|
866
|
+
/** @import { Fork } from 'svelte' */
|
|
867
|
+
/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
|
|
868
|
+
var _Batch;
|
|
869
|
+
/** @type {Batch | null} */
|
|
870
|
+
var first_batch = null;
|
|
871
|
+
/** @type {Batch | null} */
|
|
872
|
+
var last_batch = null;
|
|
873
|
+
/** @type {Batch | null} */
|
|
874
|
+
var current_batch = null;
|
|
926
875
|
/**
|
|
927
|
-
*
|
|
876
|
+
* This is needed to avoid overwriting inputs
|
|
877
|
+
* @type {Batch | null}
|
|
928
878
|
*/
|
|
929
|
-
|
|
930
|
-
this.is_pending = false;
|
|
931
|
-
batch.transfer_effects(_classPrivateFieldGet2(_dirty_effects$1, this), _classPrivateFieldGet2(_maybe_dirty_effects$1, this));
|
|
932
|
-
}
|
|
879
|
+
var previous_batch = null;
|
|
933
880
|
/**
|
|
934
|
-
*
|
|
935
|
-
*
|
|
881
|
+
* When time travelling (i.e. working in one batch, while other batches
|
|
882
|
+
* still have ongoing work), we ignore the real values of affected
|
|
883
|
+
* signals in favour of their values within the batch
|
|
884
|
+
* @type {Map<Value, any> | null}
|
|
936
885
|
*/
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
set_active_reaction(_classPrivateFieldGet2(_effect, this));
|
|
943
|
-
set_component_context(_classPrivateFieldGet2(_effect, this).ctx);
|
|
944
|
-
try {
|
|
945
|
-
Batch.ensure();
|
|
946
|
-
return fn();
|
|
947
|
-
} catch (e) {
|
|
948
|
-
handle_error(e);
|
|
949
|
-
return null;
|
|
950
|
-
} finally {
|
|
951
|
-
set_active_effect(previous_effect);
|
|
952
|
-
set_active_reaction(previous_reaction);
|
|
953
|
-
set_component_context(previous_ctx);
|
|
954
|
-
}
|
|
955
|
-
}
|
|
886
|
+
var batch_values = null;
|
|
887
|
+
/** @type {Effect | null} */
|
|
888
|
+
var last_scheduled_effect = null;
|
|
889
|
+
var is_flushing_sync = false;
|
|
890
|
+
var is_processing = false;
|
|
956
891
|
/**
|
|
957
|
-
*
|
|
958
|
-
*
|
|
959
|
-
*
|
|
960
|
-
* @
|
|
892
|
+
* During traversal, this is an array. Newly created effects are (if not immediately
|
|
893
|
+
* executed) pushed to this array, rather than going through the scheduling
|
|
894
|
+
* rigamarole that would cause another turn of the flush loop.
|
|
895
|
+
* @type {Effect[] | null}
|
|
961
896
|
*/
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
897
|
+
var collected_effects = null;
|
|
898
|
+
/**
|
|
899
|
+
* An array of effects that are marked during traversal as a result of a `set`
|
|
900
|
+
* (not `internal_set`) call. These will be added to the next batch and
|
|
901
|
+
* trigger another `batch.process()`
|
|
902
|
+
* @type {Effect[] | null}
|
|
903
|
+
* @deprecated when we get rid of legacy mode and stores, we can get rid of this
|
|
904
|
+
*/
|
|
905
|
+
var legacy_updates = null;
|
|
906
|
+
var flush_count = 0;
|
|
907
|
+
var uid = 1;
|
|
908
|
+
var _started = /* @__PURE__ */ new WeakMap();
|
|
909
|
+
var _prev = /* @__PURE__ */ new WeakMap();
|
|
910
|
+
var _next = /* @__PURE__ */ new WeakMap();
|
|
911
|
+
var _commit_callbacks = /* @__PURE__ */ new WeakMap();
|
|
912
|
+
var _discard_callbacks = /* @__PURE__ */ new WeakMap();
|
|
913
|
+
var _pending = /* @__PURE__ */ new WeakMap();
|
|
914
|
+
var _blocking_pending = /* @__PURE__ */ new WeakMap();
|
|
915
|
+
var _deferred = /* @__PURE__ */ new WeakMap();
|
|
916
|
+
var _roots = /* @__PURE__ */ new WeakMap();
|
|
917
|
+
var _new_effects = /* @__PURE__ */ new WeakMap();
|
|
918
|
+
var _dirty_effects$1 = /* @__PURE__ */ new WeakMap();
|
|
919
|
+
var _maybe_dirty_effects$1 = /* @__PURE__ */ new WeakMap();
|
|
920
|
+
var _skipped_branches = /* @__PURE__ */ new WeakMap();
|
|
921
|
+
var _unskipped_branches = /* @__PURE__ */ new WeakMap();
|
|
922
|
+
var _decrement_queued = /* @__PURE__ */ new WeakMap();
|
|
923
|
+
var _Batch_brand = /* @__PURE__ */ new WeakSet();
|
|
924
|
+
var Batch = class Batch {
|
|
925
|
+
constructor() {
|
|
926
|
+
_classPrivateMethodInitSpec(this, _Batch_brand);
|
|
927
|
+
_defineProperty(this, "id", uid++);
|
|
928
|
+
_classPrivateFieldInitSpec(this, _started, false);
|
|
929
|
+
_defineProperty(this, "linked", true);
|
|
930
|
+
_classPrivateFieldInitSpec(this, _prev, null);
|
|
931
|
+
_classPrivateFieldInitSpec(this, _next, null);
|
|
932
|
+
_defineProperty(
|
|
933
|
+
this,
|
|
934
|
+
/** @type {Map<Effect, ReturnType<typeof deferred<any>>>} */
|
|
935
|
+
"async_deriveds",
|
|
936
|
+
/* @__PURE__ */ new Map()
|
|
937
|
+
);
|
|
938
|
+
_defineProperty(
|
|
939
|
+
this,
|
|
940
|
+
/**
|
|
941
|
+
* The current values of any signals that are updated in this batch.
|
|
942
|
+
* Tuple format: [value, is_derived] (note: is_derived is false for deriveds, too, if they were overridden via assignment)
|
|
943
|
+
* They keys of this map are identical to `this.#previous`
|
|
944
|
+
* @type {Map<Value, [any, boolean]>}
|
|
945
|
+
*/
|
|
946
|
+
"current",
|
|
947
|
+
/* @__PURE__ */ new Map()
|
|
948
|
+
);
|
|
949
|
+
_defineProperty(
|
|
950
|
+
this,
|
|
951
|
+
/**
|
|
952
|
+
* The values of any signals (sources and deriveds) that are updated in this batch _before_ those updates took place.
|
|
953
|
+
* They keys of this map are identical to `this.#current`
|
|
954
|
+
* @type {Map<Value, any>}
|
|
955
|
+
*/
|
|
956
|
+
"previous",
|
|
957
|
+
/* @__PURE__ */ new Map()
|
|
958
|
+
);
|
|
959
|
+
_classPrivateFieldInitSpec(this, _commit_callbacks, /* @__PURE__ */ new Set());
|
|
960
|
+
_classPrivateFieldInitSpec(this, _discard_callbacks, /* @__PURE__ */ new Set());
|
|
961
|
+
_classPrivateFieldInitSpec(this, _pending, 0);
|
|
962
|
+
_classPrivateFieldInitSpec(this, _blocking_pending, /* @__PURE__ */ new Map());
|
|
963
|
+
_classPrivateFieldInitSpec(this, _deferred, null);
|
|
964
|
+
_classPrivateFieldInitSpec(this, _roots, []);
|
|
965
|
+
_classPrivateFieldInitSpec(this, _new_effects, []);
|
|
966
|
+
_classPrivateFieldInitSpec(this, _dirty_effects$1, /* @__PURE__ */ new Set());
|
|
967
|
+
_classPrivateFieldInitSpec(this, _maybe_dirty_effects$1, /* @__PURE__ */ new Set());
|
|
968
|
+
_classPrivateFieldInitSpec(this, _skipped_branches, /* @__PURE__ */ new Map());
|
|
969
|
+
_classPrivateFieldInitSpec(this, _unskipped_branches, /* @__PURE__ */ new Set());
|
|
970
|
+
_defineProperty(this, "is_fork", false);
|
|
971
|
+
_classPrivateFieldInitSpec(this, _decrement_queued, false);
|
|
972
|
+
if (last_batch === null) first_batch = last_batch = this;
|
|
973
|
+
else {
|
|
974
|
+
_classPrivateFieldSet2(_next, last_batch, this);
|
|
975
|
+
_classPrivateFieldSet2(_prev, this, last_batch);
|
|
967
976
|
}
|
|
968
|
-
|
|
977
|
+
last_batch = this;
|
|
969
978
|
}
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
979
|
+
/**
|
|
980
|
+
* Add an effect to the #skipped_branches map and reset its children
|
|
981
|
+
* @param {Effect} effect
|
|
982
|
+
*/
|
|
983
|
+
skip_effect(effect) {
|
|
984
|
+
if (!_classPrivateFieldGet2(_skipped_branches, this).has(effect)) _classPrivateFieldGet2(_skipped_branches, this).set(effect, {
|
|
985
|
+
d: [],
|
|
986
|
+
m: []
|
|
975
987
|
});
|
|
976
|
-
|
|
977
|
-
_classPrivateFieldGet2(_anchor, this).before(_classPrivateFieldGet2(_offscreen_fragment, this));
|
|
978
|
-
_classPrivateFieldSet2(_offscreen_fragment, this, null);
|
|
979
|
-
}
|
|
988
|
+
_classPrivateFieldGet2(_unskipped_branches, this).delete(effect);
|
|
980
989
|
}
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
*
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
990
|
+
/**
|
|
991
|
+
* Remove an effect from the #skipped_branches map and reschedule
|
|
992
|
+
* any tracked dirty/maybe_dirty child effects
|
|
993
|
+
* @param {Effect} effect
|
|
994
|
+
* @param {(e: Effect) => void} callback
|
|
995
|
+
*/
|
|
996
|
+
unskip_effect(effect, callback = (e) => this.schedule(e)) {
|
|
997
|
+
var tracked = _classPrivateFieldGet2(_skipped_branches, this).get(effect);
|
|
998
|
+
if (tracked) {
|
|
999
|
+
_classPrivateFieldGet2(_skipped_branches, this).delete(effect);
|
|
1000
|
+
for (var e of tracked.d) {
|
|
1001
|
+
set_signal_status(e, DIRTY);
|
|
1002
|
+
callback(e);
|
|
1003
|
+
}
|
|
1004
|
+
for (e of tracked.m) {
|
|
1005
|
+
set_signal_status(e, MAYBE_DIRTY);
|
|
1006
|
+
callback(e);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
_classPrivateFieldGet2(_unskipped_branches, this).add(effect);
|
|
989
1010
|
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1011
|
+
/**
|
|
1012
|
+
* Associate a change to a given source with the current
|
|
1013
|
+
* batch, noting its previous and current values
|
|
1014
|
+
* @param {Value} source
|
|
1015
|
+
* @param {any} value
|
|
1016
|
+
* @param {boolean} [is_derived]
|
|
1017
|
+
*/
|
|
1018
|
+
capture(source, value, is_derived = false) {
|
|
1019
|
+
if (source.v !== UNINITIALIZED && !this.previous.has(source)) this.previous.set(source, source.v);
|
|
1020
|
+
if ((source.f & 8388608) === 0) {
|
|
1021
|
+
this.current.set(source, [value, is_derived]);
|
|
1022
|
+
batch_values?.set(source, value);
|
|
1023
|
+
}
|
|
1024
|
+
if (!this.is_fork) source.v = value;
|
|
993
1025
|
}
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
_classPrivateFieldSet2(_failed_effect, this, null);
|
|
1026
|
+
activate() {
|
|
1027
|
+
current_batch = this;
|
|
997
1028
|
}
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
set_hydrate_node(skip_nodes());
|
|
1029
|
+
deactivate() {
|
|
1030
|
+
current_batch = null;
|
|
1031
|
+
batch_values = null;
|
|
1002
1032
|
}
|
|
1003
|
-
|
|
1004
|
-
/** @param {unknown} transformed_error */
|
|
1005
|
-
const handle_error_result = (transformed_error) => {
|
|
1006
|
-
const { reset, invoke_onerror } = _assertClassBrand(_Boundary_brand, this, _create_reset).call(this, transformed_error);
|
|
1007
|
-
invoke_onerror();
|
|
1008
|
-
if (failed) _classPrivateFieldSet2(_failed_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
1009
|
-
try {
|
|
1010
|
-
return branch(() => {
|
|
1011
|
-
var effect = active_effect;
|
|
1012
|
-
effect.b = this;
|
|
1013
|
-
effect.f |= 128;
|
|
1014
|
-
failed(_classPrivateFieldGet2(_anchor, this), () => transformed_error, () => reset);
|
|
1015
|
-
});
|
|
1016
|
-
} catch (error) {
|
|
1017
|
-
invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
|
|
1018
|
-
return null;
|
|
1019
|
-
}
|
|
1020
|
-
}));
|
|
1021
|
-
};
|
|
1022
|
-
queue_micro_task(() => {
|
|
1023
|
-
/** @type {unknown} */
|
|
1024
|
-
var result;
|
|
1033
|
+
flush() {
|
|
1025
1034
|
try {
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1035
|
+
is_processing = true;
|
|
1036
|
+
current_batch = this;
|
|
1037
|
+
_assertClassBrand(_Batch_brand, this, _process).call(this);
|
|
1038
|
+
} finally {
|
|
1039
|
+
flush_count = 0;
|
|
1040
|
+
last_scheduled_effect = null;
|
|
1041
|
+
collected_effects = null;
|
|
1042
|
+
legacy_updates = null;
|
|
1043
|
+
is_processing = false;
|
|
1044
|
+
current_batch = null;
|
|
1045
|
+
batch_values = null;
|
|
1046
|
+
old_values.clear();
|
|
1030
1047
|
}
|
|
1031
|
-
if (result !== null && typeof result === "object" && typeof result.then === "function")
|
|
1032
|
-
/** @type {any} */ result.then(
|
|
1033
|
-
handle_error_result,
|
|
1034
|
-
/** @param {unknown} e */
|
|
1035
|
-
(e) => invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent)
|
|
1036
|
-
);
|
|
1037
|
-
else handle_error_result(result);
|
|
1038
|
-
});
|
|
1039
|
-
}
|
|
1040
|
-
//#endregion
|
|
1041
|
-
//#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/async.js
|
|
1042
|
-
/** @import { Blocker, Effect, Source, Value } from '#client' */
|
|
1043
|
-
/**
|
|
1044
|
-
* @param {Blocker[]} blockers
|
|
1045
|
-
* @param {Array<() => any>} sync
|
|
1046
|
-
* @param {Array<() => Promise<any>>} async
|
|
1047
|
-
* @param {(values: Value[]) => any} fn
|
|
1048
|
-
*/
|
|
1049
|
-
function flatten(blockers, sync, async, fn) {
|
|
1050
|
-
const d = is_runes() ? derived : derived_safe_equal;
|
|
1051
|
-
var pending = blockers.filter((b) => !b.settled);
|
|
1052
|
-
var deriveds = sync.map(d);
|
|
1053
|
-
if (async.length === 0 && pending.length === 0) {
|
|
1054
|
-
fn(deriveds);
|
|
1055
|
-
return;
|
|
1056
1048
|
}
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1049
|
+
discard() {
|
|
1050
|
+
for (const fn of _classPrivateFieldGet2(_discard_callbacks, this)) fn(this);
|
|
1051
|
+
_classPrivateFieldGet2(_discard_callbacks, this).clear();
|
|
1052
|
+
for (const deferred of this.async_deriveds.values()) deferred.reject(OBSOLETE);
|
|
1053
|
+
_assertClassBrand(_Batch_brand, this, _unlink).call(this);
|
|
1054
|
+
_classPrivateFieldGet2(_deferred, this)?.resolve();
|
|
1055
|
+
}
|
|
1060
1056
|
/**
|
|
1061
|
-
* @param {
|
|
1057
|
+
* @param {Effect} effect
|
|
1062
1058
|
*/
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1059
|
+
register_created_effect(effect) {
|
|
1060
|
+
_classPrivateFieldGet2(_new_effects, this).push(effect);
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* @param {boolean} blocking
|
|
1064
|
+
* @param {Effect} effect
|
|
1065
|
+
*/
|
|
1066
|
+
increment(blocking, effect) {
|
|
1067
|
+
_classPrivateFieldSet2(_pending, this, _classPrivateFieldGet2(_pending, this) + 1);
|
|
1068
|
+
if (blocking) {
|
|
1069
|
+
let blocking_pending_count = _classPrivateFieldGet2(_blocking_pending, this).get(effect) ?? 0;
|
|
1070
|
+
_classPrivateFieldGet2(_blocking_pending, this).set(effect, blocking_pending_count + 1);
|
|
1070
1071
|
}
|
|
1071
|
-
unset_context();
|
|
1072
1072
|
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1073
|
+
/**
|
|
1074
|
+
* @param {boolean} blocking
|
|
1075
|
+
* @param {Effect} effect
|
|
1076
|
+
*/
|
|
1077
|
+
decrement(blocking, effect) {
|
|
1078
|
+
_classPrivateFieldSet2(_pending, this, _classPrivateFieldGet2(_pending, this) - 1);
|
|
1079
|
+
if (blocking) {
|
|
1080
|
+
let blocking_pending_count = _classPrivateFieldGet2(_blocking_pending, this).get(effect) ?? 0;
|
|
1081
|
+
if (blocking_pending_count === 1) _classPrivateFieldGet2(_blocking_pending, this).delete(effect);
|
|
1082
|
+
else _classPrivateFieldGet2(_blocking_pending, this).set(effect, blocking_pending_count - 1);
|
|
1083
|
+
}
|
|
1084
|
+
if (_classPrivateFieldGet2(_decrement_queued, this)) return;
|
|
1085
|
+
_classPrivateFieldSet2(_decrement_queued, this, true);
|
|
1086
|
+
queue_micro_task(() => {
|
|
1087
|
+
_classPrivateFieldSet2(_decrement_queued, this, false);
|
|
1088
|
+
if (this.linked) this.flush();
|
|
1089
|
+
});
|
|
1077
1090
|
}
|
|
1078
|
-
|
|
1079
|
-
|
|
1091
|
+
/**
|
|
1092
|
+
* @param {Set<Effect>} dirty_effects
|
|
1093
|
+
* @param {Set<Effect>} maybe_dirty_effects
|
|
1094
|
+
*/
|
|
1095
|
+
transfer_effects(dirty_effects, maybe_dirty_effects) {
|
|
1096
|
+
for (const e of dirty_effects) _classPrivateFieldGet2(_dirty_effects$1, this).add(e);
|
|
1097
|
+
for (const e of maybe_dirty_effects) _classPrivateFieldGet2(_maybe_dirty_effects$1, this).add(e);
|
|
1098
|
+
dirty_effects.clear();
|
|
1099
|
+
maybe_dirty_effects.clear();
|
|
1080
1100
|
}
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
return function restore(activate_batch = true) {
|
|
1099
|
-
set_active_effect(previous_effect);
|
|
1100
|
-
set_active_reaction(previous_reaction);
|
|
1101
|
-
set_component_context(previous_component_context);
|
|
1102
|
-
if (activate_batch && (previous_effect.f & 16384) === 0) {
|
|
1103
|
-
previous_batch?.activate();
|
|
1104
|
-
previous_batch?.apply();
|
|
1101
|
+
/** @param {(batch: Batch) => void} fn */
|
|
1102
|
+
oncommit(fn) {
|
|
1103
|
+
_classPrivateFieldGet2(_commit_callbacks, this).add(fn);
|
|
1104
|
+
}
|
|
1105
|
+
/** @param {(batch: Batch) => void} fn */
|
|
1106
|
+
ondiscard(fn) {
|
|
1107
|
+
_classPrivateFieldGet2(_discard_callbacks, this).add(fn);
|
|
1108
|
+
}
|
|
1109
|
+
settled() {
|
|
1110
|
+
return (_classPrivateFieldGet2(_deferred, this) ?? _classPrivateFieldSet2(_deferred, this, deferred())).promise;
|
|
1111
|
+
}
|
|
1112
|
+
static ensure() {
|
|
1113
|
+
if (current_batch === null) {
|
|
1114
|
+
const batch = current_batch = new Batch();
|
|
1115
|
+
if (!is_processing && !is_flushing_sync) queue_micro_task(() => {
|
|
1116
|
+
if (!_classPrivateFieldGet2(_started, batch)) batch.flush();
|
|
1117
|
+
});
|
|
1105
1118
|
}
|
|
1106
|
-
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
if (deactivate_batch) current_batch?.deactivate();
|
|
1113
|
-
}
|
|
1114
|
-
/**
|
|
1115
|
-
* @returns {(skip?: boolean) => void}
|
|
1116
|
-
*/
|
|
1117
|
-
function increment_pending() {
|
|
1118
|
-
var effect = active_effect;
|
|
1119
|
-
var boundary = effect.b;
|
|
1120
|
-
var batch = current_batch;
|
|
1121
|
-
var blocking = !!boundary?.is_rendered();
|
|
1122
|
-
boundary?.update_pending_count(1, batch);
|
|
1123
|
-
batch.increment(blocking, effect);
|
|
1124
|
-
return () => {
|
|
1125
|
-
boundary?.update_pending_count(-1, batch);
|
|
1126
|
-
batch.decrement(blocking, effect);
|
|
1127
|
-
};
|
|
1128
|
-
}
|
|
1129
|
-
/**
|
|
1130
|
-
* @template V
|
|
1131
|
-
* @param {() => V} fn
|
|
1132
|
-
* @returns {Derived<V>}
|
|
1133
|
-
*/
|
|
1134
|
-
/*#__NO_SIDE_EFFECTS__*/
|
|
1135
|
-
function derived(fn) {
|
|
1136
|
-
var flags = 2 | DIRTY;
|
|
1137
|
-
if (active_effect !== null) active_effect.f |= EFFECT_PRESERVED;
|
|
1138
|
-
return {
|
|
1139
|
-
ctx: component_context,
|
|
1140
|
-
deps: null,
|
|
1141
|
-
effects: null,
|
|
1142
|
-
equals,
|
|
1143
|
-
f: flags,
|
|
1144
|
-
fn,
|
|
1145
|
-
reactions: null,
|
|
1146
|
-
rv: 0,
|
|
1147
|
-
v: UNINITIALIZED,
|
|
1148
|
-
wv: 0,
|
|
1149
|
-
parent: active_effect,
|
|
1150
|
-
ac: null
|
|
1151
|
-
};
|
|
1152
|
-
}
|
|
1153
|
-
var OBSOLETE = Symbol("obsolete");
|
|
1154
|
-
/**
|
|
1155
|
-
* @template V
|
|
1156
|
-
* @param {() => V | Promise<V>} fn
|
|
1157
|
-
* @param {string} [label]
|
|
1158
|
-
* @param {string} [location] If provided, print a warning if the value is not read immediately after update
|
|
1159
|
-
* @returns {Promise<Source<V>>}
|
|
1160
|
-
*/
|
|
1161
|
-
/*#__NO_SIDE_EFFECTS__*/
|
|
1162
|
-
function async_derived(fn, label, location) {
|
|
1163
|
-
let parent = active_effect;
|
|
1164
|
-
if (parent === null) async_derived_orphan();
|
|
1165
|
-
var promise = void 0;
|
|
1166
|
-
var signal = source(UNINITIALIZED);
|
|
1167
|
-
var should_suspend = !active_reaction;
|
|
1168
|
-
/** @type {Set<ReturnType<typeof deferred<V>>>} */
|
|
1169
|
-
var deferreds = /* @__PURE__ */ new Set();
|
|
1170
|
-
async_effect(() => {
|
|
1171
|
-
var effect = active_effect;
|
|
1172
|
-
/** @type {ReturnType<typeof deferred<V>>} */
|
|
1173
|
-
var d = deferred();
|
|
1174
|
-
promise = d.promise;
|
|
1175
|
-
try {
|
|
1176
|
-
Promise.resolve(fn()).then(d.resolve, (e) => {
|
|
1177
|
-
if (e !== STALE_REACTION) d.reject(e);
|
|
1178
|
-
}).finally(unset_context);
|
|
1179
|
-
} catch (error) {
|
|
1180
|
-
d.reject(error);
|
|
1181
|
-
unset_context();
|
|
1119
|
+
return current_batch;
|
|
1120
|
+
}
|
|
1121
|
+
apply() {
|
|
1122
|
+
if (!async_mode_flag || !this.is_fork && _classPrivateFieldGet2(_prev, this) === null && _classPrivateFieldGet2(_next, this) === null) {
|
|
1123
|
+
batch_values = null;
|
|
1124
|
+
return;
|
|
1182
1125
|
}
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
if (
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1126
|
+
batch_values = /* @__PURE__ */ new Map();
|
|
1127
|
+
for (const [source, [value]] of this.current) batch_values.set(source, value);
|
|
1128
|
+
for (let batch = first_batch; batch !== null; batch = _classPrivateFieldGet2(_next, batch)) {
|
|
1129
|
+
if (batch === this || batch.is_fork) continue;
|
|
1130
|
+
var intersects = false;
|
|
1131
|
+
if (batch.id < this.id) for (const [source, [, is_derived]] of batch.current) {
|
|
1132
|
+
if (is_derived) continue;
|
|
1133
|
+
if (this.current.has(source)) {
|
|
1134
|
+
intersects = true;
|
|
1135
|
+
break;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
if (!intersects) {
|
|
1139
|
+
for (const [source, previous] of batch.previous) if (!batch_values.has(source)) batch_values.set(source, previous);
|
|
1140
|
+
}
|
|
1190
1141
|
}
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1142
|
+
}
|
|
1143
|
+
/**
|
|
1144
|
+
*
|
|
1145
|
+
* @param {Effect} effect
|
|
1146
|
+
*/
|
|
1147
|
+
schedule(effect) {
|
|
1148
|
+
last_scheduled_effect = effect;
|
|
1149
|
+
if (effect.b?.is_pending && (effect.f & 16777228) !== 0 && (effect.f & 32768) === 0) {
|
|
1150
|
+
effect.b.defer_effect(effect);
|
|
1151
|
+
return;
|
|
1152
|
+
}
|
|
1153
|
+
var e = effect;
|
|
1154
|
+
while (e.parent !== null) {
|
|
1155
|
+
e = e.parent;
|
|
1156
|
+
var flags = e.f;
|
|
1157
|
+
if (collected_effects !== null && e === active_effect) {
|
|
1158
|
+
if (async_mode_flag) return;
|
|
1159
|
+
if ((active_reaction === null || (active_reaction.f & 2) === 0) && !legacy_is_updating_store) return;
|
|
1206
1160
|
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
});
|
|
1211
|
-
teardown(() => {
|
|
1212
|
-
for (const d of deferreds) d.reject(OBSOLETE);
|
|
1213
|
-
});
|
|
1214
|
-
return new Promise((fulfil) => {
|
|
1215
|
-
/** @param {Promise<V>} p */
|
|
1216
|
-
function next(p) {
|
|
1217
|
-
function go() {
|
|
1218
|
-
if (p === promise) fulfil(signal);
|
|
1219
|
-
else next(promise);
|
|
1161
|
+
if ((flags & 96) !== 0) {
|
|
1162
|
+
if ((flags & 1024) === 0) return;
|
|
1163
|
+
e.f ^= CLEAN;
|
|
1220
1164
|
}
|
|
1221
|
-
p.then(go, go);
|
|
1222
1165
|
}
|
|
1223
|
-
|
|
1224
|
-
}
|
|
1166
|
+
_classPrivateFieldGet2(_roots, this).push(e);
|
|
1167
|
+
}
|
|
1168
|
+
};
|
|
1169
|
+
_Batch = Batch;
|
|
1170
|
+
function _is_deferred() {
|
|
1171
|
+
if (this.is_fork) return true;
|
|
1172
|
+
for (const effect of _classPrivateFieldGet2(_blocking_pending, this).keys()) {
|
|
1173
|
+
var e = effect;
|
|
1174
|
+
var skipped = false;
|
|
1175
|
+
while (e.parent !== null) {
|
|
1176
|
+
if (_classPrivateFieldGet2(_skipped_branches, this).has(e)) {
|
|
1177
|
+
skipped = true;
|
|
1178
|
+
break;
|
|
1179
|
+
}
|
|
1180
|
+
e = e.parent;
|
|
1181
|
+
}
|
|
1182
|
+
if (!skipped) return true;
|
|
1183
|
+
}
|
|
1184
|
+
return false;
|
|
1225
1185
|
}
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1186
|
+
function _process() {
|
|
1187
|
+
_classPrivateFieldSet2(_started, this, true);
|
|
1188
|
+
if (flush_count++ > 1e3) {
|
|
1189
|
+
_assertClassBrand(_Batch_brand, this, _unlink).call(this);
|
|
1190
|
+
infinite_loop_guard();
|
|
1191
|
+
}
|
|
1192
|
+
for (const e of _classPrivateFieldGet2(_dirty_effects$1, this)) {
|
|
1193
|
+
_classPrivateFieldGet2(_maybe_dirty_effects$1, this).delete(e);
|
|
1194
|
+
set_signal_status(e, DIRTY);
|
|
1195
|
+
this.schedule(e);
|
|
1196
|
+
}
|
|
1197
|
+
for (const e of _classPrivateFieldGet2(_maybe_dirty_effects$1, this)) {
|
|
1198
|
+
set_signal_status(e, MAYBE_DIRTY);
|
|
1199
|
+
this.schedule(e);
|
|
1200
|
+
}
|
|
1201
|
+
const roots = _classPrivateFieldGet2(_roots, this);
|
|
1202
|
+
_classPrivateFieldSet2(_roots, this, []);
|
|
1203
|
+
this.apply();
|
|
1204
|
+
/** @type {Effect[]} */
|
|
1205
|
+
var effects = collected_effects = [];
|
|
1206
|
+
/** @type {Effect[]} */
|
|
1207
|
+
var render_effects = [];
|
|
1208
|
+
/**
|
|
1209
|
+
* @type {Effect[]}
|
|
1210
|
+
* @deprecated when we get rid of legacy mode and stores, we can get rid of this
|
|
1211
|
+
*/
|
|
1212
|
+
var updates = legacy_updates = [];
|
|
1213
|
+
for (const root of roots) try {
|
|
1214
|
+
_assertClassBrand(_Batch_brand, this, _traverse).call(this, root, effects, render_effects);
|
|
1215
|
+
} catch (e) {
|
|
1216
|
+
reset_all(root);
|
|
1217
|
+
if (!_assertClassBrand(_Batch_brand, this, _is_deferred).call(this)) this.discard();
|
|
1218
|
+
throw e;
|
|
1219
|
+
}
|
|
1220
|
+
current_batch = null;
|
|
1221
|
+
if (updates.length > 0) {
|
|
1222
|
+
var batch = _Batch.ensure();
|
|
1223
|
+
for (const e of updates) batch.schedule(e);
|
|
1224
|
+
}
|
|
1225
|
+
collected_effects = null;
|
|
1226
|
+
legacy_updates = null;
|
|
1227
|
+
if (_assertClassBrand(_Batch_brand, this, _is_deferred).call(this)) {
|
|
1228
|
+
_assertClassBrand(_Batch_brand, this, _defer_effects).call(this, render_effects);
|
|
1229
|
+
_assertClassBrand(_Batch_brand, this, _defer_effects).call(this, effects);
|
|
1230
|
+
for (const [e, t] of _classPrivateFieldGet2(_skipped_branches, this)) reset_branch(e, t);
|
|
1231
|
+
if (updates.length > 0)
|
|
1232
|
+
/** @type {Batch} */ _assertClassBrand(_Batch_brand, current_batch, _process).call(current_batch);
|
|
1233
|
+
return;
|
|
1234
|
+
}
|
|
1235
|
+
const earlier_batch = _assertClassBrand(_Batch_brand, this, _find_earlier_batch).call(this);
|
|
1236
|
+
if (earlier_batch) {
|
|
1237
|
+
_assertClassBrand(_Batch_brand, this, _defer_effects).call(this, render_effects);
|
|
1238
|
+
_assertClassBrand(_Batch_brand, this, _defer_effects).call(this, effects);
|
|
1239
|
+
_assertClassBrand(_Batch_brand, earlier_batch, _merge).call(earlier_batch, this);
|
|
1240
|
+
return;
|
|
1241
|
+
}
|
|
1242
|
+
_classPrivateFieldGet2(_dirty_effects$1, this).clear();
|
|
1243
|
+
_classPrivateFieldGet2(_maybe_dirty_effects$1, this).clear();
|
|
1244
|
+
for (const fn of _classPrivateFieldGet2(_commit_callbacks, this)) fn(this);
|
|
1245
|
+
_classPrivateFieldGet2(_commit_callbacks, this).clear();
|
|
1246
|
+
previous_batch = this;
|
|
1247
|
+
flush_queued_effects(render_effects);
|
|
1248
|
+
flush_queued_effects(effects);
|
|
1249
|
+
previous_batch = null;
|
|
1250
|
+
_classPrivateFieldGet2(_deferred, this)?.resolve();
|
|
1251
|
+
var next_batch = current_batch;
|
|
1252
|
+
if (_classPrivateFieldGet2(_pending, this) === 0 && (_classPrivateFieldGet2(_roots, this).length === 0 || next_batch !== null)) {
|
|
1253
|
+
_assertClassBrand(_Batch_brand, this, _unlink).call(this);
|
|
1254
|
+
if (async_mode_flag) {
|
|
1255
|
+
_assertClassBrand(_Batch_brand, this, _commit$1).call(this);
|
|
1256
|
+
current_batch = next_batch;
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
if (_classPrivateFieldGet2(_roots, this).length > 0) if (next_batch !== null) {
|
|
1260
|
+
const batch = next_batch;
|
|
1261
|
+
_classPrivateFieldGet2(_roots, batch).push(..._classPrivateFieldGet2(_roots, this).filter((r) => !_classPrivateFieldGet2(_roots, batch).includes(r)));
|
|
1262
|
+
} else next_batch = this;
|
|
1263
|
+
if (next_batch !== null) {
|
|
1264
|
+
old_values.clear();
|
|
1265
|
+
_assertClassBrand(_Batch_brand, next_batch, _process).call(next_batch);
|
|
1266
|
+
}
|
|
1236
1267
|
}
|
|
1237
1268
|
/**
|
|
1238
|
-
*
|
|
1239
|
-
*
|
|
1240
|
-
* @
|
|
1269
|
+
* Traverse the effect tree, executing effects or stashing
|
|
1270
|
+
* them for later execution as appropriate
|
|
1271
|
+
* @param {Effect} root
|
|
1272
|
+
* @param {Effect[]} effects
|
|
1273
|
+
* @param {Effect[]} render_effects
|
|
1241
1274
|
*/
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1275
|
+
function _traverse(root, effects, render_effects) {
|
|
1276
|
+
root.f ^= CLEAN;
|
|
1277
|
+
var effect = root.first;
|
|
1278
|
+
while (effect !== null) {
|
|
1279
|
+
var flags = effect.f;
|
|
1280
|
+
var is_branch = (flags & 96) !== 0;
|
|
1281
|
+
if (!(is_branch && (flags & 1024) !== 0 || (flags & 8192) !== 0 || _classPrivateFieldGet2(_skipped_branches, this).has(effect)) && effect.fn !== null) {
|
|
1282
|
+
if (is_branch) effect.f ^= CLEAN;
|
|
1283
|
+
else if ((flags & 4) !== 0) effects.push(effect);
|
|
1284
|
+
else if (async_mode_flag && (flags & 16777224) !== 0) render_effects.push(effect);
|
|
1285
|
+
else if (is_dirty(effect)) {
|
|
1286
|
+
if ((flags & 16) !== 0) _classPrivateFieldGet2(_maybe_dirty_effects$1, this).add(effect);
|
|
1287
|
+
update_effect(effect);
|
|
1288
|
+
}
|
|
1289
|
+
var child = effect.first;
|
|
1290
|
+
if (child !== null) {
|
|
1291
|
+
effect = child;
|
|
1292
|
+
continue;
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
while (effect !== null) {
|
|
1296
|
+
var next = effect.next;
|
|
1297
|
+
if (next !== null) {
|
|
1298
|
+
effect = next;
|
|
1299
|
+
break;
|
|
1300
|
+
}
|
|
1301
|
+
effect = effect.parent;
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1247
1304
|
}
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
derived.effects = null;
|
|
1256
|
-
for (var i = 0; i < effects.length; i += 1) destroy_effect(effects[i]);
|
|
1305
|
+
function _find_earlier_batch() {
|
|
1306
|
+
var batch = _classPrivateFieldGet2(_prev, this);
|
|
1307
|
+
while (batch !== null) {
|
|
1308
|
+
if (!batch.is_fork) {
|
|
1309
|
+
for (const [value, [, is_derived]] of this.current) if (batch.current.has(value) && !is_derived) return batch;
|
|
1310
|
+
}
|
|
1311
|
+
batch = _classPrivateFieldGet2(_prev, batch);
|
|
1257
1312
|
}
|
|
1313
|
+
return null;
|
|
1258
1314
|
}
|
|
1259
1315
|
/**
|
|
1260
|
-
* @
|
|
1261
|
-
* @param {Derived} derived
|
|
1262
|
-
* @returns {T}
|
|
1316
|
+
* @param {Batch} batch
|
|
1263
1317
|
*/
|
|
1264
|
-
function
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
if (!is_destroying_effect && parent !== null && derived.v !== UNINITIALIZED && (parent.f & 24576) !== 0) {
|
|
1269
|
-
derived_inert();
|
|
1270
|
-
return derived.v;
|
|
1318
|
+
function _merge(batch) {
|
|
1319
|
+
for (const [source, value] of batch.current) {
|
|
1320
|
+
if (!this.previous.has(source) && batch.previous.has(source)) this.previous.set(source, batch.previous.get(source));
|
|
1321
|
+
this.current.set(source, value);
|
|
1271
1322
|
}
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
destroy_derived_effects(derived);
|
|
1276
|
-
value = update_reaction(derived);
|
|
1277
|
-
} finally {
|
|
1278
|
-
set_active_effect(prev_active_effect);
|
|
1323
|
+
for (const [effect, deferred] of batch.async_deriveds) {
|
|
1324
|
+
const d = this.async_deriveds.get(effect);
|
|
1325
|
+
if (d) deferred.promise.then(d.resolve).catch(d.reject);
|
|
1279
1326
|
}
|
|
1280
|
-
|
|
1327
|
+
batch.async_deriveds.clear();
|
|
1328
|
+
this.transfer_effects(_classPrivateFieldGet2(_dirty_effects$1, batch), _classPrivateFieldGet2(_maybe_dirty_effects$1, batch));
|
|
1329
|
+
/**
|
|
1330
|
+
* mark all effects that depend on `batch.current`, except the
|
|
1331
|
+
* async effects that we just resolved (TODO unless they depend
|
|
1332
|
+
* on values in this batch that are NOT in the later batch?).
|
|
1333
|
+
* Through this we also will populate the correct #skipped_branches,
|
|
1334
|
+
* oncommit callbacks etc, so we don't need to merge them separately.
|
|
1335
|
+
* @param {Value} value
|
|
1336
|
+
*/
|
|
1337
|
+
const mark = (value) => {
|
|
1338
|
+
var reactions = value.reactions;
|
|
1339
|
+
if (reactions === null) return;
|
|
1340
|
+
if ((value.f & 2) !== 0 && (value.f & 6144) === 0) return;
|
|
1341
|
+
for (const reaction of reactions) {
|
|
1342
|
+
var flags = reaction.f;
|
|
1343
|
+
if ((flags & 2) !== 0) mark(reaction);
|
|
1344
|
+
else {
|
|
1345
|
+
var effect = reaction;
|
|
1346
|
+
if (flags & 4194320 && !this.async_deriveds.has(effect)) {
|
|
1347
|
+
_classPrivateFieldGet2(_maybe_dirty_effects$1, this).delete(effect);
|
|
1348
|
+
set_signal_status(effect, DIRTY);
|
|
1349
|
+
this.schedule(effect);
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
};
|
|
1354
|
+
for (const source of this.current.keys()) mark(source);
|
|
1355
|
+
this.oncommit(() => batch.discard());
|
|
1356
|
+
_assertClassBrand(_Batch_brand, batch, _unlink).call(batch);
|
|
1357
|
+
current_batch = this;
|
|
1358
|
+
_assertClassBrand(_Batch_brand, this, _process).call(this);
|
|
1281
1359
|
}
|
|
1282
1360
|
/**
|
|
1283
|
-
* @param {
|
|
1284
|
-
* @returns {void}
|
|
1361
|
+
* @param {Effect[]} effects
|
|
1285
1362
|
*/
|
|
1286
|
-
function
|
|
1287
|
-
var
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
if (
|
|
1296
|
-
|
|
1297
|
-
|
|
1363
|
+
function _defer_effects(effects) {
|
|
1364
|
+
for (var i = 0; i < effects.length; i += 1) defer_effect(effects[i], _classPrivateFieldGet2(_dirty_effects$1, this), _classPrivateFieldGet2(_maybe_dirty_effects$1, this));
|
|
1365
|
+
}
|
|
1366
|
+
function _commit$1() {
|
|
1367
|
+
for (let batch = first_batch; batch !== null; batch = _classPrivateFieldGet2(_next, batch)) {
|
|
1368
|
+
var is_earlier = batch.id < this.id;
|
|
1369
|
+
/** @type {Source[]} */
|
|
1370
|
+
var sources = [];
|
|
1371
|
+
for (const [source, [value, is_derived]] of this.current) {
|
|
1372
|
+
if (batch.current.has(source)) {
|
|
1373
|
+
var batch_value = batch.current.get(source)[0];
|
|
1374
|
+
if (is_earlier && value !== batch_value) batch.current.set(source, [value, is_derived]);
|
|
1375
|
+
else continue;
|
|
1376
|
+
}
|
|
1377
|
+
sources.push(source);
|
|
1378
|
+
}
|
|
1379
|
+
if (is_earlier) for (const [effect, deferred] of this.async_deriveds) {
|
|
1380
|
+
const d = batch.async_deriveds.get(effect);
|
|
1381
|
+
if (d) deferred.promise.then(d.resolve).catch(d.reject);
|
|
1382
|
+
}
|
|
1383
|
+
var current = [...batch.current.keys()].filter((source) => !batch.current.get(source)[1]);
|
|
1384
|
+
if (!_classPrivateFieldGet2(_started, batch) || current.length === 0) continue;
|
|
1385
|
+
var others = current.filter((source) => !this.current.has(source));
|
|
1386
|
+
if (others.length === 0) {
|
|
1387
|
+
if (is_earlier) batch.discard();
|
|
1388
|
+
} else if (sources.length > 0) {
|
|
1389
|
+
if (is_earlier) for (const unskipped of _classPrivateFieldGet2(_unskipped_branches, this)) batch.unskip_effect(unskipped, (e) => {
|
|
1390
|
+
if ((e.f & 4194320) !== 0) batch.schedule(e);
|
|
1391
|
+
else _assertClassBrand(_Batch_brand, batch, _defer_effects).call(batch, [e]);
|
|
1392
|
+
});
|
|
1393
|
+
batch.activate();
|
|
1394
|
+
/** @type {Set<Value>} */
|
|
1395
|
+
var marked = /* @__PURE__ */ new Set();
|
|
1396
|
+
/** @type {Map<Reaction, boolean>} */
|
|
1397
|
+
var checked = /* @__PURE__ */ new Map();
|
|
1398
|
+
for (var source of sources) mark_effects(source, others, marked, checked);
|
|
1399
|
+
checked = /* @__PURE__ */ new Map();
|
|
1400
|
+
var current_unequal = [...batch.current].filter(([c, v1]) => {
|
|
1401
|
+
const v2 = this.current.get(c);
|
|
1402
|
+
if (!v2) return true;
|
|
1403
|
+
return v2[0] !== v1[0] || v2[1] !== v1[1];
|
|
1404
|
+
}).map(([c]) => c);
|
|
1405
|
+
if (current_unequal.length > 0) {
|
|
1406
|
+
for (const effect of _classPrivateFieldGet2(_new_effects, this)) if ((effect.f & 155648) === 0 && depends_on(effect, current_unequal, checked)) if ((effect.f & 4194320) !== 0) {
|
|
1407
|
+
set_signal_status(effect, DIRTY);
|
|
1408
|
+
batch.schedule(effect);
|
|
1409
|
+
} else _classPrivateFieldGet2(_dirty_effects$1, batch).add(effect);
|
|
1298
1410
|
}
|
|
1411
|
+
if (_classPrivateFieldGet2(_roots, batch).length > 0 && !_classPrivateFieldGet2(_decrement_queued, batch)) {
|
|
1412
|
+
batch.apply();
|
|
1413
|
+
for (var root of _classPrivateFieldGet2(_roots, batch)) _assertClassBrand(_Batch_brand, batch, _traverse).call(batch, root, [], []);
|
|
1414
|
+
_classPrivateFieldSet2(_roots, batch, []);
|
|
1415
|
+
}
|
|
1416
|
+
batch.deactivate();
|
|
1299
1417
|
}
|
|
1300
1418
|
}
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1419
|
+
}
|
|
1420
|
+
function _unlink() {
|
|
1421
|
+
if (!this.linked) return;
|
|
1422
|
+
var prev = _classPrivateFieldGet2(_prev, this);
|
|
1423
|
+
var next = _classPrivateFieldGet2(_next, this);
|
|
1424
|
+
if (prev === null) first_batch = next;
|
|
1425
|
+
else _classPrivateFieldSet2(_next, prev, next);
|
|
1426
|
+
if (next === null) last_batch = prev;
|
|
1427
|
+
else _classPrivateFieldSet2(_prev, next, prev);
|
|
1428
|
+
this.linked = false;
|
|
1305
1429
|
}
|
|
1306
1430
|
/**
|
|
1307
|
-
*
|
|
1431
|
+
* Synchronously flush any pending updates.
|
|
1432
|
+
* Returns void if no callback is provided, otherwise returns the result of calling the callback.
|
|
1433
|
+
* @template [T=void]
|
|
1434
|
+
* @param {(() => T) | undefined} [fn]
|
|
1435
|
+
* @returns {T}
|
|
1308
1436
|
*/
|
|
1309
|
-
function
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1437
|
+
function flushSync(fn) {
|
|
1438
|
+
var was_flushing_sync = is_flushing_sync;
|
|
1439
|
+
is_flushing_sync = true;
|
|
1440
|
+
try {
|
|
1441
|
+
var result;
|
|
1442
|
+
if (fn) {
|
|
1443
|
+
if (current_batch !== null && !current_batch.is_fork) current_batch.flush();
|
|
1444
|
+
result = fn();
|
|
1445
|
+
}
|
|
1446
|
+
while (true) {
|
|
1447
|
+
flush_tasks();
|
|
1448
|
+
if (current_batch === null) return result;
|
|
1449
|
+
current_batch.flush();
|
|
1450
|
+
}
|
|
1451
|
+
} finally {
|
|
1452
|
+
is_flushing_sync = was_flushing_sync;
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
function infinite_loop_guard() {
|
|
1456
|
+
try {
|
|
1457
|
+
effect_update_depth_exceeded();
|
|
1458
|
+
} catch (error) {
|
|
1459
|
+
invoke_error_boundary(error, last_scheduled_effect);
|
|
1320
1460
|
}
|
|
1321
1461
|
}
|
|
1462
|
+
/** @type {Set<Effect> | null} */
|
|
1463
|
+
var eager_block_effects = null;
|
|
1322
1464
|
/**
|
|
1323
|
-
* @param {
|
|
1465
|
+
* @param {Array<Effect>} effects
|
|
1466
|
+
* @returns {void}
|
|
1324
1467
|
*/
|
|
1325
|
-
function
|
|
1326
|
-
|
|
1327
|
-
|
|
1468
|
+
function flush_queued_effects(effects) {
|
|
1469
|
+
var length = effects.length;
|
|
1470
|
+
if (length === 0) return;
|
|
1471
|
+
var i = 0;
|
|
1472
|
+
while (i < length) {
|
|
1473
|
+
var effect = effects[i++];
|
|
1474
|
+
if ((effect.f & 24576) === 0 && is_dirty(effect)) {
|
|
1475
|
+
eager_block_effects = /* @__PURE__ */ new Set();
|
|
1476
|
+
update_effect(effect);
|
|
1477
|
+
if (effect.deps === null && effect.first === null && effect.nodes === null && effect.teardown === null && effect.ac === null) unlink_effect(effect);
|
|
1478
|
+
if (eager_block_effects?.size > 0) {
|
|
1479
|
+
old_values.clear();
|
|
1480
|
+
for (const e of eager_block_effects) {
|
|
1481
|
+
if ((e.f & 24576) !== 0) continue;
|
|
1482
|
+
/** @type {Effect[]} */
|
|
1483
|
+
const ordered_effects = [e];
|
|
1484
|
+
let ancestor = e.parent;
|
|
1485
|
+
while (ancestor !== null) {
|
|
1486
|
+
if (eager_block_effects.has(ancestor)) {
|
|
1487
|
+
eager_block_effects.delete(ancestor);
|
|
1488
|
+
ordered_effects.push(ancestor);
|
|
1489
|
+
}
|
|
1490
|
+
ancestor = ancestor.parent;
|
|
1491
|
+
}
|
|
1492
|
+
for (let j = ordered_effects.length - 1; j >= 0; j--) {
|
|
1493
|
+
const e = ordered_effects[j];
|
|
1494
|
+
if ((e.f & 24576) !== 0) continue;
|
|
1495
|
+
update_effect(e);
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
eager_block_effects.clear();
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
eager_block_effects = null;
|
|
1328
1503
|
}
|
|
1329
|
-
//#endregion
|
|
1330
|
-
//#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/batch.js
|
|
1331
|
-
/** @import { Fork } from 'svelte' */
|
|
1332
|
-
/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
|
|
1333
|
-
var _Batch;
|
|
1334
|
-
/** @type {Batch | null} */
|
|
1335
|
-
var first_batch = null;
|
|
1336
|
-
/** @type {Batch | null} */
|
|
1337
|
-
var last_batch = null;
|
|
1338
|
-
/** @type {Batch | null} */
|
|
1339
|
-
var current_batch = null;
|
|
1340
1504
|
/**
|
|
1341
|
-
* This is
|
|
1342
|
-
*
|
|
1505
|
+
* This is similar to `mark_reactions`, but it only marks async/block effects
|
|
1506
|
+
* depending on `value` and at least one of the other `sources`, so that
|
|
1507
|
+
* these effects can re-run after another batch has been committed
|
|
1508
|
+
* @param {Value} value
|
|
1509
|
+
* @param {Source[]} sources
|
|
1510
|
+
* @param {Set<Value>} marked
|
|
1511
|
+
* @param {Map<Reaction, boolean>} checked
|
|
1343
1512
|
*/
|
|
1344
|
-
|
|
1513
|
+
function mark_effects(value, sources, marked, checked) {
|
|
1514
|
+
if (marked.has(value)) return;
|
|
1515
|
+
marked.add(value);
|
|
1516
|
+
if (value.reactions !== null) for (const reaction of value.reactions) {
|
|
1517
|
+
const flags = reaction.f;
|
|
1518
|
+
if ((flags & 2) !== 0) mark_effects(reaction, sources, marked, checked);
|
|
1519
|
+
else if ((flags & 4194320) !== 0 && (flags & 2048) === 0 && depends_on(reaction, sources, checked)) {
|
|
1520
|
+
set_signal_status(reaction, DIRTY);
|
|
1521
|
+
schedule_effect(reaction);
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1345
1525
|
/**
|
|
1346
|
-
*
|
|
1347
|
-
*
|
|
1348
|
-
*
|
|
1349
|
-
* @type {Map<Value, any> | null}
|
|
1350
|
-
*/
|
|
1351
|
-
var batch_values = null;
|
|
1352
|
-
/** @type {Effect | null} */
|
|
1353
|
-
var last_scheduled_effect = null;
|
|
1354
|
-
var is_flushing_sync = false;
|
|
1355
|
-
var is_processing = false;
|
|
1356
|
-
/**
|
|
1357
|
-
* During traversal, this is an array. Newly created effects are (if not immediately
|
|
1358
|
-
* executed) pushed to this array, rather than going through the scheduling
|
|
1359
|
-
* rigamarole that would cause another turn of the flush loop.
|
|
1360
|
-
* @type {Effect[] | null}
|
|
1361
|
-
*/
|
|
1362
|
-
var collected_effects = null;
|
|
1363
|
-
/**
|
|
1364
|
-
* An array of effects that are marked during traversal as a result of a `set`
|
|
1365
|
-
* (not `internal_set`) call. These will be added to the next batch and
|
|
1366
|
-
* trigger another `batch.process()`
|
|
1367
|
-
* @type {Effect[] | null}
|
|
1368
|
-
* @deprecated when we get rid of legacy mode and stores, we can get rid of this
|
|
1369
|
-
*/
|
|
1370
|
-
var legacy_updates = null;
|
|
1371
|
-
var flush_count = 0;
|
|
1372
|
-
var uid = 1;
|
|
1373
|
-
var _started = /* @__PURE__ */ new WeakMap();
|
|
1374
|
-
var _prev = /* @__PURE__ */ new WeakMap();
|
|
1375
|
-
var _next = /* @__PURE__ */ new WeakMap();
|
|
1376
|
-
var _commit_callbacks = /* @__PURE__ */ new WeakMap();
|
|
1377
|
-
var _discard_callbacks = /* @__PURE__ */ new WeakMap();
|
|
1378
|
-
var _pending = /* @__PURE__ */ new WeakMap();
|
|
1379
|
-
var _blocking_pending = /* @__PURE__ */ new WeakMap();
|
|
1380
|
-
var _deferred = /* @__PURE__ */ new WeakMap();
|
|
1381
|
-
var _roots = /* @__PURE__ */ new WeakMap();
|
|
1382
|
-
var _new_effects = /* @__PURE__ */ new WeakMap();
|
|
1383
|
-
var _dirty_effects = /* @__PURE__ */ new WeakMap();
|
|
1384
|
-
var _maybe_dirty_effects = /* @__PURE__ */ new WeakMap();
|
|
1385
|
-
var _skipped_branches = /* @__PURE__ */ new WeakMap();
|
|
1386
|
-
var _unskipped_branches = /* @__PURE__ */ new WeakMap();
|
|
1387
|
-
var _decrement_queued = /* @__PURE__ */ new WeakMap();
|
|
1388
|
-
var _Batch_brand = /* @__PURE__ */ new WeakSet();
|
|
1389
|
-
var Batch = class Batch {
|
|
1390
|
-
constructor() {
|
|
1391
|
-
_classPrivateMethodInitSpec(this, _Batch_brand);
|
|
1392
|
-
_defineProperty(this, "id", uid++);
|
|
1393
|
-
_classPrivateFieldInitSpec(this, _started, false);
|
|
1394
|
-
_defineProperty(this, "linked", true);
|
|
1395
|
-
_classPrivateFieldInitSpec(this, _prev, null);
|
|
1396
|
-
_classPrivateFieldInitSpec(this, _next, null);
|
|
1397
|
-
_defineProperty(
|
|
1398
|
-
this,
|
|
1399
|
-
/** @type {Map<Effect, ReturnType<typeof deferred<any>>>} */
|
|
1400
|
-
"async_deriveds",
|
|
1401
|
-
/* @__PURE__ */ new Map()
|
|
1402
|
-
);
|
|
1403
|
-
_defineProperty(
|
|
1404
|
-
this,
|
|
1405
|
-
/**
|
|
1406
|
-
* The current values of any signals that are updated in this batch.
|
|
1407
|
-
* Tuple format: [value, is_derived] (note: is_derived is false for deriveds, too, if they were overridden via assignment)
|
|
1408
|
-
* They keys of this map are identical to `this.#previous`
|
|
1409
|
-
* @type {Map<Value, [any, boolean]>}
|
|
1410
|
-
*/
|
|
1411
|
-
"current",
|
|
1412
|
-
/* @__PURE__ */ new Map()
|
|
1413
|
-
);
|
|
1414
|
-
_defineProperty(
|
|
1415
|
-
this,
|
|
1416
|
-
/**
|
|
1417
|
-
* The values of any signals (sources and deriveds) that are updated in this batch _before_ those updates took place.
|
|
1418
|
-
* They keys of this map are identical to `this.#current`
|
|
1419
|
-
* @type {Map<Value, any>}
|
|
1420
|
-
*/
|
|
1421
|
-
"previous",
|
|
1422
|
-
/* @__PURE__ */ new Map()
|
|
1423
|
-
);
|
|
1424
|
-
_classPrivateFieldInitSpec(this, _commit_callbacks, /* @__PURE__ */ new Set());
|
|
1425
|
-
_classPrivateFieldInitSpec(this, _discard_callbacks, /* @__PURE__ */ new Set());
|
|
1426
|
-
_classPrivateFieldInitSpec(this, _pending, 0);
|
|
1427
|
-
_classPrivateFieldInitSpec(this, _blocking_pending, /* @__PURE__ */ new Map());
|
|
1428
|
-
_classPrivateFieldInitSpec(this, _deferred, null);
|
|
1429
|
-
_classPrivateFieldInitSpec(this, _roots, []);
|
|
1430
|
-
_classPrivateFieldInitSpec(this, _new_effects, []);
|
|
1431
|
-
_classPrivateFieldInitSpec(this, _dirty_effects, /* @__PURE__ */ new Set());
|
|
1432
|
-
_classPrivateFieldInitSpec(this, _maybe_dirty_effects, /* @__PURE__ */ new Set());
|
|
1433
|
-
_classPrivateFieldInitSpec(this, _skipped_branches, /* @__PURE__ */ new Map());
|
|
1434
|
-
_classPrivateFieldInitSpec(this, _unskipped_branches, /* @__PURE__ */ new Set());
|
|
1435
|
-
_defineProperty(this, "is_fork", false);
|
|
1436
|
-
_classPrivateFieldInitSpec(this, _decrement_queued, false);
|
|
1437
|
-
if (last_batch === null) first_batch = last_batch = this;
|
|
1438
|
-
else {
|
|
1439
|
-
_classPrivateFieldSet2(_next, last_batch, this);
|
|
1440
|
-
_classPrivateFieldSet2(_prev, this, last_batch);
|
|
1441
|
-
}
|
|
1442
|
-
last_batch = this;
|
|
1443
|
-
}
|
|
1444
|
-
/**
|
|
1445
|
-
* Add an effect to the #skipped_branches map and reset its children
|
|
1446
|
-
* @param {Effect} effect
|
|
1447
|
-
*/
|
|
1448
|
-
skip_effect(effect) {
|
|
1449
|
-
if (!_classPrivateFieldGet2(_skipped_branches, this).has(effect)) _classPrivateFieldGet2(_skipped_branches, this).set(effect, {
|
|
1450
|
-
d: [],
|
|
1451
|
-
m: []
|
|
1452
|
-
});
|
|
1453
|
-
_classPrivateFieldGet2(_unskipped_branches, this).delete(effect);
|
|
1454
|
-
}
|
|
1455
|
-
/**
|
|
1456
|
-
* Remove an effect from the #skipped_branches map and reschedule
|
|
1457
|
-
* any tracked dirty/maybe_dirty child effects
|
|
1458
|
-
* @param {Effect} effect
|
|
1459
|
-
* @param {(e: Effect) => void} callback
|
|
1460
|
-
*/
|
|
1461
|
-
unskip_effect(effect, callback = (e) => this.schedule(e)) {
|
|
1462
|
-
var tracked = _classPrivateFieldGet2(_skipped_branches, this).get(effect);
|
|
1463
|
-
if (tracked) {
|
|
1464
|
-
_classPrivateFieldGet2(_skipped_branches, this).delete(effect);
|
|
1465
|
-
for (var e of tracked.d) {
|
|
1466
|
-
set_signal_status(e, DIRTY);
|
|
1467
|
-
callback(e);
|
|
1468
|
-
}
|
|
1469
|
-
for (e of tracked.m) {
|
|
1470
|
-
set_signal_status(e, MAYBE_DIRTY);
|
|
1471
|
-
callback(e);
|
|
1472
|
-
}
|
|
1473
|
-
}
|
|
1474
|
-
_classPrivateFieldGet2(_unskipped_branches, this).add(effect);
|
|
1475
|
-
}
|
|
1476
|
-
/**
|
|
1477
|
-
* Associate a change to a given source with the current
|
|
1478
|
-
* batch, noting its previous and current values
|
|
1479
|
-
* @param {Value} source
|
|
1480
|
-
* @param {any} value
|
|
1481
|
-
* @param {boolean} [is_derived]
|
|
1482
|
-
*/
|
|
1483
|
-
capture(source, value, is_derived = false) {
|
|
1484
|
-
if (source.v !== UNINITIALIZED && !this.previous.has(source)) this.previous.set(source, source.v);
|
|
1485
|
-
if ((source.f & 8388608) === 0) {
|
|
1486
|
-
this.current.set(source, [value, is_derived]);
|
|
1487
|
-
batch_values?.set(source, value);
|
|
1488
|
-
}
|
|
1489
|
-
if (!this.is_fork) source.v = value;
|
|
1490
|
-
}
|
|
1491
|
-
activate() {
|
|
1492
|
-
current_batch = this;
|
|
1493
|
-
}
|
|
1494
|
-
deactivate() {
|
|
1495
|
-
current_batch = null;
|
|
1496
|
-
batch_values = null;
|
|
1497
|
-
}
|
|
1498
|
-
flush() {
|
|
1499
|
-
try {
|
|
1500
|
-
is_processing = true;
|
|
1501
|
-
current_batch = this;
|
|
1502
|
-
_assertClassBrand(_Batch_brand, this, _process).call(this);
|
|
1503
|
-
} finally {
|
|
1504
|
-
flush_count = 0;
|
|
1505
|
-
last_scheduled_effect = null;
|
|
1506
|
-
collected_effects = null;
|
|
1507
|
-
legacy_updates = null;
|
|
1508
|
-
is_processing = false;
|
|
1509
|
-
current_batch = null;
|
|
1510
|
-
batch_values = null;
|
|
1511
|
-
old_values.clear();
|
|
1512
|
-
}
|
|
1513
|
-
}
|
|
1514
|
-
discard() {
|
|
1515
|
-
for (const fn of _classPrivateFieldGet2(_discard_callbacks, this)) fn(this);
|
|
1516
|
-
_classPrivateFieldGet2(_discard_callbacks, this).clear();
|
|
1517
|
-
for (const deferred of this.async_deriveds.values()) deferred.reject(OBSOLETE);
|
|
1518
|
-
_assertClassBrand(_Batch_brand, this, _unlink).call(this);
|
|
1519
|
-
_classPrivateFieldGet2(_deferred, this)?.resolve();
|
|
1520
|
-
}
|
|
1521
|
-
/**
|
|
1522
|
-
* @param {Effect} effect
|
|
1523
|
-
*/
|
|
1524
|
-
register_created_effect(effect) {
|
|
1525
|
-
_classPrivateFieldGet2(_new_effects, this).push(effect);
|
|
1526
|
-
}
|
|
1527
|
-
/**
|
|
1528
|
-
* @param {boolean} blocking
|
|
1529
|
-
* @param {Effect} effect
|
|
1530
|
-
*/
|
|
1531
|
-
increment(blocking, effect) {
|
|
1532
|
-
_classPrivateFieldSet2(_pending, this, _classPrivateFieldGet2(_pending, this) + 1);
|
|
1533
|
-
if (blocking) {
|
|
1534
|
-
let blocking_pending_count = _classPrivateFieldGet2(_blocking_pending, this).get(effect) ?? 0;
|
|
1535
|
-
_classPrivateFieldGet2(_blocking_pending, this).set(effect, blocking_pending_count + 1);
|
|
1536
|
-
}
|
|
1537
|
-
}
|
|
1538
|
-
/**
|
|
1539
|
-
* @param {boolean} blocking
|
|
1540
|
-
* @param {Effect} effect
|
|
1541
|
-
*/
|
|
1542
|
-
decrement(blocking, effect) {
|
|
1543
|
-
_classPrivateFieldSet2(_pending, this, _classPrivateFieldGet2(_pending, this) - 1);
|
|
1544
|
-
if (blocking) {
|
|
1545
|
-
let blocking_pending_count = _classPrivateFieldGet2(_blocking_pending, this).get(effect) ?? 0;
|
|
1546
|
-
if (blocking_pending_count === 1) _classPrivateFieldGet2(_blocking_pending, this).delete(effect);
|
|
1547
|
-
else _classPrivateFieldGet2(_blocking_pending, this).set(effect, blocking_pending_count - 1);
|
|
1548
|
-
}
|
|
1549
|
-
if (_classPrivateFieldGet2(_decrement_queued, this)) return;
|
|
1550
|
-
_classPrivateFieldSet2(_decrement_queued, this, true);
|
|
1551
|
-
queue_micro_task(() => {
|
|
1552
|
-
_classPrivateFieldSet2(_decrement_queued, this, false);
|
|
1553
|
-
if (this.linked) this.flush();
|
|
1554
|
-
});
|
|
1555
|
-
}
|
|
1556
|
-
/**
|
|
1557
|
-
* @param {Set<Effect>} dirty_effects
|
|
1558
|
-
* @param {Set<Effect>} maybe_dirty_effects
|
|
1559
|
-
*/
|
|
1560
|
-
transfer_effects(dirty_effects, maybe_dirty_effects) {
|
|
1561
|
-
for (const e of dirty_effects) _classPrivateFieldGet2(_dirty_effects, this).add(e);
|
|
1562
|
-
for (const e of maybe_dirty_effects) _classPrivateFieldGet2(_maybe_dirty_effects, this).add(e);
|
|
1563
|
-
dirty_effects.clear();
|
|
1564
|
-
maybe_dirty_effects.clear();
|
|
1565
|
-
}
|
|
1566
|
-
/** @param {(batch: Batch) => void} fn */
|
|
1567
|
-
oncommit(fn) {
|
|
1568
|
-
_classPrivateFieldGet2(_commit_callbacks, this).add(fn);
|
|
1569
|
-
}
|
|
1570
|
-
/** @param {(batch: Batch) => void} fn */
|
|
1571
|
-
ondiscard(fn) {
|
|
1572
|
-
_classPrivateFieldGet2(_discard_callbacks, this).add(fn);
|
|
1573
|
-
}
|
|
1574
|
-
settled() {
|
|
1575
|
-
return (_classPrivateFieldGet2(_deferred, this) ?? _classPrivateFieldSet2(_deferred, this, deferred())).promise;
|
|
1576
|
-
}
|
|
1577
|
-
static ensure() {
|
|
1578
|
-
if (current_batch === null) {
|
|
1579
|
-
const batch = current_batch = new Batch();
|
|
1580
|
-
if (!is_processing && !is_flushing_sync) queue_micro_task(() => {
|
|
1581
|
-
if (!_classPrivateFieldGet2(_started, batch)) batch.flush();
|
|
1582
|
-
});
|
|
1583
|
-
}
|
|
1584
|
-
return current_batch;
|
|
1585
|
-
}
|
|
1586
|
-
apply() {
|
|
1587
|
-
if (!async_mode_flag || !this.is_fork && _classPrivateFieldGet2(_prev, this) === null && _classPrivateFieldGet2(_next, this) === null) {
|
|
1588
|
-
batch_values = null;
|
|
1589
|
-
return;
|
|
1590
|
-
}
|
|
1591
|
-
batch_values = /* @__PURE__ */ new Map();
|
|
1592
|
-
for (const [source, [value]] of this.current) batch_values.set(source, value);
|
|
1593
|
-
for (let batch = first_batch; batch !== null; batch = _classPrivateFieldGet2(_next, batch)) {
|
|
1594
|
-
if (batch === this || batch.is_fork) continue;
|
|
1595
|
-
var intersects = false;
|
|
1596
|
-
if (batch.id < this.id) for (const [source, [, is_derived]] of batch.current) {
|
|
1597
|
-
if (is_derived) continue;
|
|
1598
|
-
if (this.current.has(source)) {
|
|
1599
|
-
intersects = true;
|
|
1600
|
-
break;
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
if (!intersects) {
|
|
1604
|
-
for (const [source, previous] of batch.previous) if (!batch_values.has(source)) batch_values.set(source, previous);
|
|
1605
|
-
}
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
|
-
/**
|
|
1609
|
-
*
|
|
1610
|
-
* @param {Effect} effect
|
|
1611
|
-
*/
|
|
1612
|
-
schedule(effect) {
|
|
1613
|
-
last_scheduled_effect = effect;
|
|
1614
|
-
if (effect.b?.is_pending && (effect.f & 16777228) !== 0 && (effect.f & 32768) === 0) {
|
|
1615
|
-
effect.b.defer_effect(effect);
|
|
1616
|
-
return;
|
|
1617
|
-
}
|
|
1618
|
-
var e = effect;
|
|
1619
|
-
while (e.parent !== null) {
|
|
1620
|
-
e = e.parent;
|
|
1621
|
-
var flags = e.f;
|
|
1622
|
-
if (collected_effects !== null && e === active_effect) {
|
|
1623
|
-
if (async_mode_flag) return;
|
|
1624
|
-
if ((active_reaction === null || (active_reaction.f & 2) === 0) && !legacy_is_updating_store) return;
|
|
1625
|
-
}
|
|
1626
|
-
if ((flags & 96) !== 0) {
|
|
1627
|
-
if ((flags & 1024) === 0) return;
|
|
1628
|
-
e.f ^= CLEAN;
|
|
1629
|
-
}
|
|
1630
|
-
}
|
|
1631
|
-
_classPrivateFieldGet2(_roots, this).push(e);
|
|
1632
|
-
}
|
|
1633
|
-
};
|
|
1634
|
-
_Batch = Batch;
|
|
1635
|
-
function _is_deferred() {
|
|
1636
|
-
if (this.is_fork) return true;
|
|
1637
|
-
for (const effect of _classPrivateFieldGet2(_blocking_pending, this).keys()) {
|
|
1638
|
-
var e = effect;
|
|
1639
|
-
var skipped = false;
|
|
1640
|
-
while (e.parent !== null) {
|
|
1641
|
-
if (_classPrivateFieldGet2(_skipped_branches, this).has(e)) {
|
|
1642
|
-
skipped = true;
|
|
1643
|
-
break;
|
|
1644
|
-
}
|
|
1645
|
-
e = e.parent;
|
|
1646
|
-
}
|
|
1647
|
-
if (!skipped) return true;
|
|
1648
|
-
}
|
|
1649
|
-
return false;
|
|
1650
|
-
}
|
|
1651
|
-
function _process() {
|
|
1652
|
-
_classPrivateFieldSet2(_started, this, true);
|
|
1653
|
-
if (flush_count++ > 1e3) {
|
|
1654
|
-
_assertClassBrand(_Batch_brand, this, _unlink).call(this);
|
|
1655
|
-
infinite_loop_guard();
|
|
1656
|
-
}
|
|
1657
|
-
for (const e of _classPrivateFieldGet2(_dirty_effects, this)) {
|
|
1658
|
-
_classPrivateFieldGet2(_maybe_dirty_effects, this).delete(e);
|
|
1659
|
-
set_signal_status(e, DIRTY);
|
|
1660
|
-
this.schedule(e);
|
|
1661
|
-
}
|
|
1662
|
-
for (const e of _classPrivateFieldGet2(_maybe_dirty_effects, this)) {
|
|
1663
|
-
set_signal_status(e, MAYBE_DIRTY);
|
|
1664
|
-
this.schedule(e);
|
|
1665
|
-
}
|
|
1666
|
-
const roots = _classPrivateFieldGet2(_roots, this);
|
|
1667
|
-
_classPrivateFieldSet2(_roots, this, []);
|
|
1668
|
-
this.apply();
|
|
1669
|
-
/** @type {Effect[]} */
|
|
1670
|
-
var effects = collected_effects = [];
|
|
1671
|
-
/** @type {Effect[]} */
|
|
1672
|
-
var render_effects = [];
|
|
1673
|
-
/**
|
|
1674
|
-
* @type {Effect[]}
|
|
1675
|
-
* @deprecated when we get rid of legacy mode and stores, we can get rid of this
|
|
1676
|
-
*/
|
|
1677
|
-
var updates = legacy_updates = [];
|
|
1678
|
-
for (const root of roots) try {
|
|
1679
|
-
_assertClassBrand(_Batch_brand, this, _traverse).call(this, root, effects, render_effects);
|
|
1680
|
-
} catch (e) {
|
|
1681
|
-
reset_all(root);
|
|
1682
|
-
if (!_assertClassBrand(_Batch_brand, this, _is_deferred).call(this)) this.discard();
|
|
1683
|
-
throw e;
|
|
1684
|
-
}
|
|
1685
|
-
current_batch = null;
|
|
1686
|
-
if (updates.length > 0) {
|
|
1687
|
-
var batch = _Batch.ensure();
|
|
1688
|
-
for (const e of updates) batch.schedule(e);
|
|
1689
|
-
}
|
|
1690
|
-
collected_effects = null;
|
|
1691
|
-
legacy_updates = null;
|
|
1692
|
-
if (_assertClassBrand(_Batch_brand, this, _is_deferred).call(this)) {
|
|
1693
|
-
_assertClassBrand(_Batch_brand, this, _defer_effects).call(this, render_effects);
|
|
1694
|
-
_assertClassBrand(_Batch_brand, this, _defer_effects).call(this, effects);
|
|
1695
|
-
for (const [e, t] of _classPrivateFieldGet2(_skipped_branches, this)) reset_branch(e, t);
|
|
1696
|
-
if (updates.length > 0)
|
|
1697
|
-
/** @type {Batch} */ _assertClassBrand(_Batch_brand, current_batch, _process).call(current_batch);
|
|
1698
|
-
return;
|
|
1699
|
-
}
|
|
1700
|
-
const earlier_batch = _assertClassBrand(_Batch_brand, this, _find_earlier_batch).call(this);
|
|
1701
|
-
if (earlier_batch) {
|
|
1702
|
-
_assertClassBrand(_Batch_brand, this, _defer_effects).call(this, render_effects);
|
|
1703
|
-
_assertClassBrand(_Batch_brand, this, _defer_effects).call(this, effects);
|
|
1704
|
-
_assertClassBrand(_Batch_brand, earlier_batch, _merge).call(earlier_batch, this);
|
|
1705
|
-
return;
|
|
1706
|
-
}
|
|
1707
|
-
_classPrivateFieldGet2(_dirty_effects, this).clear();
|
|
1708
|
-
_classPrivateFieldGet2(_maybe_dirty_effects, this).clear();
|
|
1709
|
-
for (const fn of _classPrivateFieldGet2(_commit_callbacks, this)) fn(this);
|
|
1710
|
-
_classPrivateFieldGet2(_commit_callbacks, this).clear();
|
|
1711
|
-
previous_batch = this;
|
|
1712
|
-
flush_queued_effects(render_effects);
|
|
1713
|
-
flush_queued_effects(effects);
|
|
1714
|
-
previous_batch = null;
|
|
1715
|
-
_classPrivateFieldGet2(_deferred, this)?.resolve();
|
|
1716
|
-
var next_batch = current_batch;
|
|
1717
|
-
if (_classPrivateFieldGet2(_pending, this) === 0 && (_classPrivateFieldGet2(_roots, this).length === 0 || next_batch !== null)) {
|
|
1718
|
-
_assertClassBrand(_Batch_brand, this, _unlink).call(this);
|
|
1719
|
-
if (async_mode_flag) {
|
|
1720
|
-
_assertClassBrand(_Batch_brand, this, _commit$1).call(this);
|
|
1721
|
-
current_batch = next_batch;
|
|
1722
|
-
}
|
|
1723
|
-
}
|
|
1724
|
-
if (_classPrivateFieldGet2(_roots, this).length > 0) if (next_batch !== null) {
|
|
1725
|
-
const batch = next_batch;
|
|
1726
|
-
_classPrivateFieldGet2(_roots, batch).push(..._classPrivateFieldGet2(_roots, this).filter((r) => !_classPrivateFieldGet2(_roots, batch).includes(r)));
|
|
1727
|
-
} else next_batch = this;
|
|
1728
|
-
if (next_batch !== null) _assertClassBrand(_Batch_brand, next_batch, _process).call(next_batch);
|
|
1729
|
-
}
|
|
1730
|
-
/**
|
|
1731
|
-
* Traverse the effect tree, executing effects or stashing
|
|
1732
|
-
* them for later execution as appropriate
|
|
1733
|
-
* @param {Effect} root
|
|
1734
|
-
* @param {Effect[]} effects
|
|
1735
|
-
* @param {Effect[]} render_effects
|
|
1736
|
-
*/
|
|
1737
|
-
function _traverse(root, effects, render_effects) {
|
|
1738
|
-
root.f ^= CLEAN;
|
|
1739
|
-
var effect = root.first;
|
|
1740
|
-
while (effect !== null) {
|
|
1741
|
-
var flags = effect.f;
|
|
1742
|
-
var is_branch = (flags & 96) !== 0;
|
|
1743
|
-
if (!(is_branch && (flags & 1024) !== 0 || (flags & 8192) !== 0 || _classPrivateFieldGet2(_skipped_branches, this).has(effect)) && effect.fn !== null) {
|
|
1744
|
-
if (is_branch) effect.f ^= CLEAN;
|
|
1745
|
-
else if ((flags & 4) !== 0) effects.push(effect);
|
|
1746
|
-
else if (async_mode_flag && (flags & 16777224) !== 0) render_effects.push(effect);
|
|
1747
|
-
else if (is_dirty(effect)) {
|
|
1748
|
-
if ((flags & 16) !== 0) _classPrivateFieldGet2(_maybe_dirty_effects, this).add(effect);
|
|
1749
|
-
update_effect(effect);
|
|
1750
|
-
}
|
|
1751
|
-
var child = effect.first;
|
|
1752
|
-
if (child !== null) {
|
|
1753
|
-
effect = child;
|
|
1754
|
-
continue;
|
|
1755
|
-
}
|
|
1756
|
-
}
|
|
1757
|
-
while (effect !== null) {
|
|
1758
|
-
var next = effect.next;
|
|
1759
|
-
if (next !== null) {
|
|
1760
|
-
effect = next;
|
|
1761
|
-
break;
|
|
1762
|
-
}
|
|
1763
|
-
effect = effect.parent;
|
|
1764
|
-
}
|
|
1765
|
-
}
|
|
1766
|
-
}
|
|
1767
|
-
function _find_earlier_batch() {
|
|
1768
|
-
var batch = _classPrivateFieldGet2(_prev, this);
|
|
1769
|
-
while (batch !== null) {
|
|
1770
|
-
if (!batch.is_fork) {
|
|
1771
|
-
for (const [value, [, is_derived]] of this.current) if (batch.current.has(value) && !is_derived) return batch;
|
|
1772
|
-
}
|
|
1773
|
-
batch = _classPrivateFieldGet2(_prev, batch);
|
|
1774
|
-
}
|
|
1775
|
-
return null;
|
|
1776
|
-
}
|
|
1777
|
-
/**
|
|
1778
|
-
* @param {Batch} batch
|
|
1779
|
-
*/
|
|
1780
|
-
function _merge(batch) {
|
|
1781
|
-
for (const [source, value] of batch.current) {
|
|
1782
|
-
if (!this.previous.has(source) && batch.previous.has(source)) this.previous.set(source, batch.previous.get(source));
|
|
1783
|
-
this.current.set(source, value);
|
|
1784
|
-
}
|
|
1785
|
-
for (const [effect, deferred] of batch.async_deriveds) {
|
|
1786
|
-
const d = this.async_deriveds.get(effect);
|
|
1787
|
-
if (d) deferred.promise.then(d.resolve).catch(d.reject);
|
|
1788
|
-
}
|
|
1789
|
-
batch.async_deriveds.clear();
|
|
1790
|
-
this.transfer_effects(_classPrivateFieldGet2(_dirty_effects, batch), _classPrivateFieldGet2(_maybe_dirty_effects, batch));
|
|
1791
|
-
/**
|
|
1792
|
-
* mark all effects that depend on `batch.current`, except the
|
|
1793
|
-
* async effects that we just resolved (TODO unless they depend
|
|
1794
|
-
* on values in this batch that are NOT in the later batch?).
|
|
1795
|
-
* Through this we also will populate the correct #skipped_branches,
|
|
1796
|
-
* oncommit callbacks etc, so we don't need to merge them separately.
|
|
1797
|
-
* @param {Value} value
|
|
1798
|
-
*/
|
|
1799
|
-
const mark = (value) => {
|
|
1800
|
-
var reactions = value.reactions;
|
|
1801
|
-
if (reactions === null) return;
|
|
1802
|
-
if ((value.f & 2) !== 0 && (value.f & 6144) === 0) return;
|
|
1803
|
-
for (const reaction of reactions) {
|
|
1804
|
-
var flags = reaction.f;
|
|
1805
|
-
if ((flags & 2) !== 0) mark(reaction);
|
|
1806
|
-
else {
|
|
1807
|
-
var effect = reaction;
|
|
1808
|
-
if (flags & 4194320 && !this.async_deriveds.has(effect)) {
|
|
1809
|
-
_classPrivateFieldGet2(_maybe_dirty_effects, this).delete(effect);
|
|
1810
|
-
set_signal_status(effect, DIRTY);
|
|
1811
|
-
this.schedule(effect);
|
|
1812
|
-
}
|
|
1813
|
-
}
|
|
1814
|
-
}
|
|
1815
|
-
};
|
|
1816
|
-
for (const source of this.current.keys()) mark(source);
|
|
1817
|
-
this.oncommit(() => batch.discard());
|
|
1818
|
-
_assertClassBrand(_Batch_brand, batch, _unlink).call(batch);
|
|
1819
|
-
current_batch = this;
|
|
1820
|
-
_assertClassBrand(_Batch_brand, this, _process).call(this);
|
|
1821
|
-
}
|
|
1822
|
-
/**
|
|
1823
|
-
* @param {Effect[]} effects
|
|
1824
|
-
*/
|
|
1825
|
-
function _defer_effects(effects) {
|
|
1826
|
-
for (var i = 0; i < effects.length; i += 1) defer_effect(effects[i], _classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
|
|
1827
|
-
}
|
|
1828
|
-
function _commit$1() {
|
|
1829
|
-
for (let batch = first_batch; batch !== null; batch = _classPrivateFieldGet2(_next, batch)) {
|
|
1830
|
-
var is_earlier = batch.id < this.id;
|
|
1831
|
-
/** @type {Source[]} */
|
|
1832
|
-
var sources = [];
|
|
1833
|
-
for (const [source, [value, is_derived]] of this.current) {
|
|
1834
|
-
if (batch.current.has(source)) {
|
|
1835
|
-
var batch_value = batch.current.get(source)[0];
|
|
1836
|
-
if (is_earlier && value !== batch_value) batch.current.set(source, [value, is_derived]);
|
|
1837
|
-
else continue;
|
|
1838
|
-
}
|
|
1839
|
-
sources.push(source);
|
|
1840
|
-
}
|
|
1841
|
-
if (is_earlier) for (const [effect, deferred] of this.async_deriveds) {
|
|
1842
|
-
const d = batch.async_deriveds.get(effect);
|
|
1843
|
-
if (d) deferred.promise.then(d.resolve).catch(d.reject);
|
|
1844
|
-
}
|
|
1845
|
-
var current = [...batch.current.keys()].filter((source) => !batch.current.get(source)[1]);
|
|
1846
|
-
if (!_classPrivateFieldGet2(_started, batch) || current.length === 0) continue;
|
|
1847
|
-
var others = current.filter((source) => !this.current.has(source));
|
|
1848
|
-
if (others.length === 0) {
|
|
1849
|
-
if (is_earlier) batch.discard();
|
|
1850
|
-
} else if (sources.length > 0) {
|
|
1851
|
-
if (is_earlier) for (const unskipped of _classPrivateFieldGet2(_unskipped_branches, this)) batch.unskip_effect(unskipped, (e) => {
|
|
1852
|
-
if ((e.f & 4194320) !== 0) batch.schedule(e);
|
|
1853
|
-
else _assertClassBrand(_Batch_brand, batch, _defer_effects).call(batch, [e]);
|
|
1854
|
-
});
|
|
1855
|
-
batch.activate();
|
|
1856
|
-
/** @type {Set<Value>} */
|
|
1857
|
-
var marked = /* @__PURE__ */ new Set();
|
|
1858
|
-
/** @type {Map<Reaction, boolean>} */
|
|
1859
|
-
var checked = /* @__PURE__ */ new Map();
|
|
1860
|
-
for (var source of sources) mark_effects(source, others, marked, checked);
|
|
1861
|
-
checked = /* @__PURE__ */ new Map();
|
|
1862
|
-
var current_unequal = [...batch.current].filter(([c, v1]) => {
|
|
1863
|
-
const v2 = this.current.get(c);
|
|
1864
|
-
if (!v2) return true;
|
|
1865
|
-
return v2[0] !== v1[0] || v2[1] !== v1[1];
|
|
1866
|
-
}).map(([c]) => c);
|
|
1867
|
-
if (current_unequal.length > 0) {
|
|
1868
|
-
for (const effect of _classPrivateFieldGet2(_new_effects, this)) if ((effect.f & 155648) === 0 && depends_on(effect, current_unequal, checked)) if ((effect.f & 4194320) !== 0) {
|
|
1869
|
-
set_signal_status(effect, DIRTY);
|
|
1870
|
-
batch.schedule(effect);
|
|
1871
|
-
} else _classPrivateFieldGet2(_dirty_effects, batch).add(effect);
|
|
1872
|
-
}
|
|
1873
|
-
if (_classPrivateFieldGet2(_roots, batch).length > 0 && !_classPrivateFieldGet2(_decrement_queued, batch)) {
|
|
1874
|
-
batch.apply();
|
|
1875
|
-
for (var root of _classPrivateFieldGet2(_roots, batch)) _assertClassBrand(_Batch_brand, batch, _traverse).call(batch, root, [], []);
|
|
1876
|
-
_classPrivateFieldSet2(_roots, batch, []);
|
|
1877
|
-
}
|
|
1878
|
-
batch.deactivate();
|
|
1879
|
-
}
|
|
1880
|
-
}
|
|
1881
|
-
}
|
|
1882
|
-
function _unlink() {
|
|
1883
|
-
if (!this.linked) return;
|
|
1884
|
-
var prev = _classPrivateFieldGet2(_prev, this);
|
|
1885
|
-
var next = _classPrivateFieldGet2(_next, this);
|
|
1886
|
-
if (prev === null) first_batch = next;
|
|
1887
|
-
else _classPrivateFieldSet2(_next, prev, next);
|
|
1888
|
-
if (next === null) last_batch = prev;
|
|
1889
|
-
else _classPrivateFieldSet2(_prev, next, prev);
|
|
1890
|
-
this.linked = false;
|
|
1891
|
-
}
|
|
1892
|
-
/**
|
|
1893
|
-
* Synchronously flush any pending updates.
|
|
1894
|
-
* Returns void if no callback is provided, otherwise returns the result of calling the callback.
|
|
1895
|
-
* @template [T=void]
|
|
1896
|
-
* @param {(() => T) | undefined} [fn]
|
|
1897
|
-
* @returns {T}
|
|
1898
|
-
*/
|
|
1899
|
-
function flushSync(fn) {
|
|
1900
|
-
var was_flushing_sync = is_flushing_sync;
|
|
1901
|
-
is_flushing_sync = true;
|
|
1902
|
-
try {
|
|
1903
|
-
var result;
|
|
1904
|
-
if (fn) {
|
|
1905
|
-
if (current_batch !== null && !current_batch.is_fork) current_batch.flush();
|
|
1906
|
-
result = fn();
|
|
1907
|
-
}
|
|
1908
|
-
while (true) {
|
|
1909
|
-
flush_tasks();
|
|
1910
|
-
if (current_batch === null) return result;
|
|
1911
|
-
current_batch.flush();
|
|
1912
|
-
}
|
|
1913
|
-
} finally {
|
|
1914
|
-
is_flushing_sync = was_flushing_sync;
|
|
1915
|
-
}
|
|
1916
|
-
}
|
|
1917
|
-
function infinite_loop_guard() {
|
|
1918
|
-
try {
|
|
1919
|
-
effect_update_depth_exceeded();
|
|
1920
|
-
} catch (error) {
|
|
1921
|
-
invoke_error_boundary(error, last_scheduled_effect);
|
|
1922
|
-
}
|
|
1923
|
-
}
|
|
1924
|
-
/** @type {Set<Effect> | null} */
|
|
1925
|
-
var eager_block_effects = null;
|
|
1926
|
-
/**
|
|
1927
|
-
* @param {Array<Effect>} effects
|
|
1928
|
-
* @returns {void}
|
|
1929
|
-
*/
|
|
1930
|
-
function flush_queued_effects(effects) {
|
|
1931
|
-
var length = effects.length;
|
|
1932
|
-
if (length === 0) return;
|
|
1933
|
-
var i = 0;
|
|
1934
|
-
while (i < length) {
|
|
1935
|
-
var effect = effects[i++];
|
|
1936
|
-
if ((effect.f & 24576) === 0 && is_dirty(effect)) {
|
|
1937
|
-
eager_block_effects = /* @__PURE__ */ new Set();
|
|
1938
|
-
update_effect(effect);
|
|
1939
|
-
if (effect.deps === null && effect.first === null && effect.nodes === null && effect.teardown === null && effect.ac === null) unlink_effect(effect);
|
|
1940
|
-
if (eager_block_effects?.size > 0) {
|
|
1941
|
-
old_values.clear();
|
|
1942
|
-
for (const e of eager_block_effects) {
|
|
1943
|
-
if ((e.f & 24576) !== 0) continue;
|
|
1944
|
-
/** @type {Effect[]} */
|
|
1945
|
-
const ordered_effects = [e];
|
|
1946
|
-
let ancestor = e.parent;
|
|
1947
|
-
while (ancestor !== null) {
|
|
1948
|
-
if (eager_block_effects.has(ancestor)) {
|
|
1949
|
-
eager_block_effects.delete(ancestor);
|
|
1950
|
-
ordered_effects.push(ancestor);
|
|
1951
|
-
}
|
|
1952
|
-
ancestor = ancestor.parent;
|
|
1953
|
-
}
|
|
1954
|
-
for (let j = ordered_effects.length - 1; j >= 0; j--) {
|
|
1955
|
-
const e = ordered_effects[j];
|
|
1956
|
-
if ((e.f & 24576) !== 0) continue;
|
|
1957
|
-
update_effect(e);
|
|
1958
|
-
}
|
|
1959
|
-
}
|
|
1960
|
-
eager_block_effects.clear();
|
|
1961
|
-
}
|
|
1962
|
-
}
|
|
1963
|
-
}
|
|
1964
|
-
eager_block_effects = null;
|
|
1965
|
-
}
|
|
1966
|
-
/**
|
|
1967
|
-
* This is similar to `mark_reactions`, but it only marks async/block effects
|
|
1968
|
-
* depending on `value` and at least one of the other `sources`, so that
|
|
1969
|
-
* these effects can re-run after another batch has been committed
|
|
1970
|
-
* @param {Value} value
|
|
1971
|
-
* @param {Source[]} sources
|
|
1972
|
-
* @param {Set<Value>} marked
|
|
1973
|
-
* @param {Map<Reaction, boolean>} checked
|
|
1974
|
-
*/
|
|
1975
|
-
function mark_effects(value, sources, marked, checked) {
|
|
1976
|
-
if (marked.has(value)) return;
|
|
1977
|
-
marked.add(value);
|
|
1978
|
-
if (value.reactions !== null) for (const reaction of value.reactions) {
|
|
1979
|
-
const flags = reaction.f;
|
|
1980
|
-
if ((flags & 2) !== 0) mark_effects(reaction, sources, marked, checked);
|
|
1981
|
-
else if ((flags & 4194320) !== 0 && (flags & 2048) === 0 && depends_on(reaction, sources, checked)) {
|
|
1982
|
-
set_signal_status(reaction, DIRTY);
|
|
1983
|
-
schedule_effect(reaction);
|
|
1984
|
-
}
|
|
1985
|
-
}
|
|
1986
|
-
}
|
|
1987
|
-
/**
|
|
1988
|
-
* @param {Reaction} reaction
|
|
1989
|
-
* @param {Source[]} sources
|
|
1990
|
-
* @param {Map<Reaction, boolean>} checked
|
|
1526
|
+
* @param {Reaction} reaction
|
|
1527
|
+
* @param {Source[]} sources
|
|
1528
|
+
* @param {Map<Reaction, boolean>} checked
|
|
1991
1529
|
*/
|
|
1992
1530
|
function depends_on(reaction, sources, checked) {
|
|
1993
1531
|
const depends = checked.get(reaction);
|
|
@@ -2040,7 +1578,7 @@ function reset_all(effect) {
|
|
|
2040
1578
|
}
|
|
2041
1579
|
}
|
|
2042
1580
|
//#endregion
|
|
2043
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
1581
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/sources.js
|
|
2044
1582
|
/** @import { Derived, Effect, Source, Value } from '#client' */
|
|
2045
1583
|
/** @type {Set<Effect>} */
|
|
2046
1584
|
var eager_effects = /* @__PURE__ */ new Set();
|
|
@@ -2110,7 +1648,8 @@ function set(source, value, should_proxy = false) {
|
|
|
2110
1648
|
*/
|
|
2111
1649
|
function internal_set(source, value, updated_during_traversal = null) {
|
|
2112
1650
|
if (!source.equals(value)) {
|
|
2113
|
-
old_values.set(source,
|
|
1651
|
+
if (is_destroying_effect) old_values.set(source, value);
|
|
1652
|
+
else if (!old_values.has(source)) old_values.set(source, source.v);
|
|
2114
1653
|
var batch = Batch.ensure();
|
|
2115
1654
|
batch.capture(source, value);
|
|
2116
1655
|
if ((source.f & 2) !== 0) {
|
|
@@ -2186,7 +1725,7 @@ function mark_reactions(signal, status, updated_during_traversal) {
|
|
|
2186
1725
|
* @returns {T}
|
|
2187
1726
|
*/
|
|
2188
1727
|
function proxy(value) {
|
|
2189
|
-
if (typeof value !== "object" || value === null || STATE_SYMBOL in value) return value;
|
|
1728
|
+
if (typeof value !== "object" || value === null || STATE_SYMBOL in value || COMPONENT_SYMBOL in value) return value;
|
|
2190
1729
|
const prototype = get_prototype_of(value);
|
|
2191
1730
|
if (prototype !== object_prototype && prototype !== array_prototype) return value;
|
|
2192
1731
|
/** @type {Map<any, Source<any>>} */
|
|
@@ -2339,7 +1878,7 @@ function proxy(value) {
|
|
|
2339
1878
|
});
|
|
2340
1879
|
}
|
|
2341
1880
|
//#endregion
|
|
2342
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
1881
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/operations.js
|
|
2343
1882
|
/** @import { Effect, TemplateNode } from '#client' */
|
|
2344
1883
|
/** @type {Window} */
|
|
2345
1884
|
var $window;
|
|
@@ -2439,6 +1978,21 @@ function first_child(node, is_text = false) {
|
|
|
2439
1978
|
return hydrate_node;
|
|
2440
1979
|
}
|
|
2441
1980
|
/**
|
|
1981
|
+
* `child`, for the very common case of an element with exactly one child. Resetting the
|
|
1982
|
+
* hydration cursor is part of the same step, so the compiler doesn't have to emit a
|
|
1983
|
+
* separate `reset` call for every `<p>{text}</p>` in an app.
|
|
1984
|
+
* Don't mark this as side-effect-free, hydration needs to walk all nodes
|
|
1985
|
+
* @param {TemplateNode} node
|
|
1986
|
+
* @param {boolean} [is_text]
|
|
1987
|
+
* @returns {TemplateNode | null}
|
|
1988
|
+
*/
|
|
1989
|
+
function only_child(node, is_text = false) {
|
|
1990
|
+
if (!hydrating) return /* @__PURE__ */ get_first_child(node);
|
|
1991
|
+
var first = child(node, is_text);
|
|
1992
|
+
reset(node);
|
|
1993
|
+
return first;
|
|
1994
|
+
}
|
|
1995
|
+
/**
|
|
2442
1996
|
* Don't mark this as side-effect-free, hydration needs to walk all nodes
|
|
2443
1997
|
* @param {TemplateNode} node
|
|
2444
1998
|
* @param {number} count
|
|
@@ -2516,8 +2070,40 @@ function merge_text_nodes(text) {
|
|
|
2516
2070
|
next = text.nextSibling;
|
|
2517
2071
|
}
|
|
2518
2072
|
}
|
|
2073
|
+
/**
|
|
2074
|
+
* @param {unknown} error
|
|
2075
|
+
*/
|
|
2076
|
+
function handle_error(error) {
|
|
2077
|
+
var effect = active_effect;
|
|
2078
|
+
if (effect === null) {
|
|
2079
|
+
/** @type {Derived} */ active_reaction.f |= ERROR_VALUE;
|
|
2080
|
+
return error;
|
|
2081
|
+
}
|
|
2082
|
+
if ((effect.f & 32768) === 0 && (effect.f & 4) === 0) throw error;
|
|
2083
|
+
invoke_error_boundary(error, effect);
|
|
2084
|
+
}
|
|
2085
|
+
/**
|
|
2086
|
+
* @param {unknown} error
|
|
2087
|
+
* @param {Effect | null} effect
|
|
2088
|
+
*/
|
|
2089
|
+
function invoke_error_boundary(error, effect) {
|
|
2090
|
+
if (effect !== null && (effect.f & 16384) !== 0) return;
|
|
2091
|
+
while (effect !== null) {
|
|
2092
|
+
if ((effect.f & 128) !== 0 && (effect.f & 33570816) === 0) {
|
|
2093
|
+
if ((effect.f & 32768) === 0) throw error;
|
|
2094
|
+
try {
|
|
2095
|
+
/** @type {Boundary} */ effect.b.error(error);
|
|
2096
|
+
return;
|
|
2097
|
+
} catch (e) {
|
|
2098
|
+
error = e;
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
effect = effect.parent;
|
|
2102
|
+
}
|
|
2103
|
+
throw error;
|
|
2104
|
+
}
|
|
2519
2105
|
//#endregion
|
|
2520
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
2106
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/effects.js
|
|
2521
2107
|
/** @import { Blocker, ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */
|
|
2522
2108
|
/**
|
|
2523
2109
|
* @param {'$effect' | '$effect.pre' | '$inspect'} rune
|
|
@@ -2720,6 +2306,8 @@ function execute_effect_teardown(effect) {
|
|
|
2720
2306
|
set_active_reaction(null);
|
|
2721
2307
|
try {
|
|
2722
2308
|
teardown.call(null);
|
|
2309
|
+
} catch (error) {
|
|
2310
|
+
invoke_error_boundary(error, effect.parent);
|
|
2723
2311
|
} finally {
|
|
2724
2312
|
set_is_destroying_effect(previously_destroying_effect);
|
|
2725
2313
|
set_active_reaction(previous_reaction);
|
|
@@ -2822,6 +2410,7 @@ function unlink_effect(effect) {
|
|
|
2822
2410
|
function pause_effect(effect, callback, destroy = true) {
|
|
2823
2411
|
/** @type {TransitionManager[]} */
|
|
2824
2412
|
var transitions = [];
|
|
2413
|
+
effect.f |= 256;
|
|
2825
2414
|
pause_children(effect, transitions, true);
|
|
2826
2415
|
var fn = () => {
|
|
2827
2416
|
if (destroy) destroy_effect(effect);
|
|
@@ -2861,6 +2450,7 @@ function pause_children(effect, transitions, local) {
|
|
|
2861
2450
|
* @param {Effect} effect
|
|
2862
2451
|
*/
|
|
2863
2452
|
function resume_effect(effect) {
|
|
2453
|
+
effect.f &= -257;
|
|
2864
2454
|
resume_children(effect, true);
|
|
2865
2455
|
}
|
|
2866
2456
|
/**
|
|
@@ -2868,6 +2458,7 @@ function resume_effect(effect) {
|
|
|
2868
2458
|
* @param {boolean} local
|
|
2869
2459
|
*/
|
|
2870
2460
|
function resume_children(effect, local) {
|
|
2461
|
+
if ((effect.f & 256) !== 0) return;
|
|
2871
2462
|
if ((effect.f & 8192) === 0) return;
|
|
2872
2463
|
effect.f ^= INERT;
|
|
2873
2464
|
if ((effect.f & 1024) === 0) {
|
|
@@ -2903,14 +2494,14 @@ function move_effect(effect, fragment) {
|
|
|
2903
2494
|
}
|
|
2904
2495
|
}
|
|
2905
2496
|
//#endregion
|
|
2906
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
2497
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/legacy.js
|
|
2907
2498
|
/**
|
|
2908
2499
|
* @type {Set<Value> | null}
|
|
2909
2500
|
* @deprecated
|
|
2910
2501
|
*/
|
|
2911
2502
|
var captured_signals = null;
|
|
2912
2503
|
//#endregion
|
|
2913
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
2504
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/runtime.js
|
|
2914
2505
|
/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
|
|
2915
2506
|
/**
|
|
2916
2507
|
* True if updating in an effect context that is reactive (i.e. not branch/root effects)
|
|
@@ -2967,7 +2558,7 @@ function set_untracked_writes(value) {
|
|
|
2967
2558
|
* Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing
|
|
2968
2559
|
**/
|
|
2969
2560
|
var write_version = 1;
|
|
2970
|
-
/** @type {number} Used to version each read of a source of derived to avoid duplicating
|
|
2561
|
+
/** @type {number} Used to version each read of a source of derived to avoid duplicating dependencies inside a reaction */
|
|
2971
2562
|
var read_version = 0;
|
|
2972
2563
|
var update_version = read_version;
|
|
2973
2564
|
/** @param {number} value */
|
|
@@ -3048,24 +2639,8 @@ function update_reaction(reaction) {
|
|
|
3048
2639
|
var fn = reaction.fn;
|
|
3049
2640
|
var result = fn();
|
|
3050
2641
|
reaction.f |= REACTION_RAN;
|
|
3051
|
-
var deps = reaction
|
|
3052
|
-
var
|
|
3053
|
-
if (new_deps !== null) {
|
|
3054
|
-
var i;
|
|
3055
|
-
if (!is_fork) remove_reactions(reaction, skipped_deps);
|
|
3056
|
-
if (deps !== null && skipped_deps > 0) {
|
|
3057
|
-
deps.length = skipped_deps + new_deps.length;
|
|
3058
|
-
for (i = 0; i < new_deps.length; i++) deps[skipped_deps + i] = new_deps[i];
|
|
3059
|
-
} else reaction.deps = deps = new_deps;
|
|
3060
|
-
if (effect_tracking() && (reaction.f & 512) !== 0) for (i = skipped_deps; i < deps.length; i++) {
|
|
3061
|
-
var _deps$i;
|
|
3062
|
-
((_deps$i = deps[i]).reactions ?? (_deps$i.reactions = [])).push(reaction);
|
|
3063
|
-
}
|
|
3064
|
-
} else if (!is_fork && deps !== null && skipped_deps < deps.length) {
|
|
3065
|
-
remove_reactions(reaction, skipped_deps);
|
|
3066
|
-
deps.length = skipped_deps;
|
|
3067
|
-
}
|
|
3068
|
-
if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & 6146) === 0) for (i = 0; i < untracked_writes.length; i++) schedule_possible_effect_self_invalidation(untracked_writes[i], reaction);
|
|
2642
|
+
var deps = update_dependencies(reaction);
|
|
2643
|
+
if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & 6146) === 0) for (var i = 0; i < untracked_writes.length; i++) schedule_possible_effect_self_invalidation(untracked_writes[i], reaction);
|
|
3069
2644
|
if (previous_reaction !== null && previous_reaction !== reaction) {
|
|
3070
2645
|
read_version++;
|
|
3071
2646
|
if (previous_reaction.deps !== null) for (let i = 0; i < previous_skipped_deps; i += 1) previous_reaction.deps[i].rv = read_version;
|
|
@@ -3076,6 +2651,7 @@ function update_reaction(reaction) {
|
|
|
3076
2651
|
if ((reaction.f & 8388608) !== 0) reaction.f ^= ERROR_VALUE;
|
|
3077
2652
|
return result;
|
|
3078
2653
|
} catch (error) {
|
|
2654
|
+
update_dependencies(reaction);
|
|
3079
2655
|
return handle_error(error);
|
|
3080
2656
|
} finally {
|
|
3081
2657
|
reaction.f ^= REACTION_IS_UPDATING;
|
|
@@ -3090,6 +2666,29 @@ function update_reaction(reaction) {
|
|
|
3090
2666
|
}
|
|
3091
2667
|
}
|
|
3092
2668
|
/**
|
|
2669
|
+
* @param {Reaction} reaction
|
|
2670
|
+
*/
|
|
2671
|
+
function update_dependencies(reaction) {
|
|
2672
|
+
var deps = reaction.deps;
|
|
2673
|
+
var is_fork = current_batch?.is_fork;
|
|
2674
|
+
if (new_deps !== null) {
|
|
2675
|
+
var i;
|
|
2676
|
+
if (!is_fork) remove_reactions(reaction, skipped_deps);
|
|
2677
|
+
if (deps !== null && skipped_deps > 0) {
|
|
2678
|
+
deps.length = skipped_deps + new_deps.length;
|
|
2679
|
+
for (i = 0; i < new_deps.length; i++) deps[skipped_deps + i] = new_deps[i];
|
|
2680
|
+
} else reaction.deps = deps = new_deps;
|
|
2681
|
+
if (effect_tracking() && (reaction.f & 512) !== 0) for (i = skipped_deps; i < deps.length; i++) {
|
|
2682
|
+
var _deps$i;
|
|
2683
|
+
((_deps$i = deps[i]).reactions ?? (_deps$i.reactions = [])).push(reaction);
|
|
2684
|
+
}
|
|
2685
|
+
} else if (!is_fork && deps !== null && skipped_deps < deps.length) {
|
|
2686
|
+
remove_reactions(reaction, skipped_deps);
|
|
2687
|
+
deps.length = skipped_deps;
|
|
2688
|
+
}
|
|
2689
|
+
return deps;
|
|
2690
|
+
}
|
|
2691
|
+
/**
|
|
3093
2692
|
* @template V
|
|
3094
2693
|
* @param {Reaction} signal
|
|
3095
2694
|
* @param {Value<V>} dependency
|
|
@@ -3262,7 +2861,7 @@ function untrack(fn) {
|
|
|
3262
2861
|
}
|
|
3263
2862
|
}
|
|
3264
2863
|
//#endregion
|
|
3265
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
2864
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/events.js
|
|
3266
2865
|
/**
|
|
3267
2866
|
* Used on elements, as a map of event type -> event handler,
|
|
3268
2867
|
* and on events themselves to track which element handled an event
|
|
@@ -3273,6 +2872,7 @@ var all_registered_events = /* @__PURE__ */ new Set();
|
|
|
3273
2872
|
/** @type {Set<(events: Array<string>) => void>} */
|
|
3274
2873
|
var root_event_handles = /* @__PURE__ */ new Set();
|
|
3275
2874
|
var last_propagated_event = null;
|
|
2875
|
+
var last_propagated_event_clear_scheduled = false;
|
|
3276
2876
|
/**
|
|
3277
2877
|
* @this {EventTarget}
|
|
3278
2878
|
* @param {Event} event
|
|
@@ -3285,6 +2885,13 @@ function handle_event_propagation(event) {
|
|
|
3285
2885
|
var path = event.composedPath?.() || [];
|
|
3286
2886
|
var current_target = path[0] || event.target;
|
|
3287
2887
|
last_propagated_event = event;
|
|
2888
|
+
if (!last_propagated_event_clear_scheduled) {
|
|
2889
|
+
last_propagated_event_clear_scheduled = true;
|
|
2890
|
+
setTimeout(() => {
|
|
2891
|
+
last_propagated_event_clear_scheduled = false;
|
|
2892
|
+
last_propagated_event = null;
|
|
2893
|
+
});
|
|
2894
|
+
}
|
|
3288
2895
|
var path_idx = 0;
|
|
3289
2896
|
var handled_at = last_propagated_event === event && event[event_symbol];
|
|
3290
2897
|
if (handled_at) {
|
|
@@ -3335,178 +2942,634 @@ function handle_event_propagation(event) {
|
|
|
3335
2942
|
for (let error of other_errors) queueMicrotask(() => {
|
|
3336
2943
|
throw error;
|
|
3337
2944
|
});
|
|
3338
|
-
throw throw_error;
|
|
2945
|
+
throw throw_error;
|
|
2946
|
+
}
|
|
2947
|
+
} finally {
|
|
2948
|
+
event[event_symbol] = handler_element;
|
|
2949
|
+
delete event.currentTarget;
|
|
2950
|
+
set_active_reaction(previous_reaction);
|
|
2951
|
+
set_active_effect(previous_effect);
|
|
2952
|
+
}
|
|
2953
|
+
}
|
|
2954
|
+
//#endregion
|
|
2955
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/reconciler.js
|
|
2956
|
+
var policy = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
|
|
2957
|
+
/** @param {string} html */
|
|
2958
|
+
createHTML: (html) => {
|
|
2959
|
+
return html;
|
|
2960
|
+
} });
|
|
2961
|
+
/** @param {string} html */
|
|
2962
|
+
function create_trusted_html(html) {
|
|
2963
|
+
return policy?.createHTML(html) ?? html;
|
|
2964
|
+
}
|
|
2965
|
+
/**
|
|
2966
|
+
* @param {string} html
|
|
2967
|
+
*/
|
|
2968
|
+
function create_fragment_from_html(html) {
|
|
2969
|
+
var elem = create_element("template");
|
|
2970
|
+
elem.innerHTML = create_trusted_html(html.replaceAll("<!>", "<!---->"));
|
|
2971
|
+
return elem.content;
|
|
2972
|
+
}
|
|
2973
|
+
//#endregion
|
|
2974
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/template.js
|
|
2975
|
+
/** @import { Effect, EffectNodes, TemplateNode } from '#client' */
|
|
2976
|
+
/** @import { TemplateStructure } from './types' */
|
|
2977
|
+
/**
|
|
2978
|
+
* @param {TemplateNode} start
|
|
2979
|
+
* @param {TemplateNode | null} end
|
|
2980
|
+
*/
|
|
2981
|
+
function assign_nodes(start, end) {
|
|
2982
|
+
var effect = active_effect;
|
|
2983
|
+
if (effect.nodes === null) effect.nodes = {
|
|
2984
|
+
start,
|
|
2985
|
+
end,
|
|
2986
|
+
a: null,
|
|
2987
|
+
t: null
|
|
2988
|
+
};
|
|
2989
|
+
}
|
|
2990
|
+
/**
|
|
2991
|
+
* @param {string} content
|
|
2992
|
+
* @param {number} flags
|
|
2993
|
+
* @returns {() => Node | Node[]}
|
|
2994
|
+
*/
|
|
2995
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2996
|
+
function from_html(content, flags) {
|
|
2997
|
+
var is_fragment = (flags & 1) !== 0;
|
|
2998
|
+
var use_import_node = (flags & 2) !== 0;
|
|
2999
|
+
/** @type {Node} */
|
|
3000
|
+
var node;
|
|
3001
|
+
/**
|
|
3002
|
+
* Whether or not the first item is a text/element node. If not, we need to
|
|
3003
|
+
* create an additional comment node to act as `effect.nodes.start`
|
|
3004
|
+
*/
|
|
3005
|
+
var has_start = !content.startsWith("<!>");
|
|
3006
|
+
return () => {
|
|
3007
|
+
if (hydrating) {
|
|
3008
|
+
assign_nodes(hydrate_node, null);
|
|
3009
|
+
return hydrate_node;
|
|
3010
|
+
}
|
|
3011
|
+
if (node === void 0) {
|
|
3012
|
+
node = create_fragment_from_html(has_start ? content : "<!>" + content);
|
|
3013
|
+
if (!is_fragment) node = /* @__PURE__ */ get_first_child(node);
|
|
3014
|
+
}
|
|
3015
|
+
var clone = use_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true);
|
|
3016
|
+
if (is_fragment) {
|
|
3017
|
+
var start = /* @__PURE__ */ get_first_child(clone);
|
|
3018
|
+
var end = clone.lastChild;
|
|
3019
|
+
assign_nodes(start, end);
|
|
3020
|
+
} else assign_nodes(clone, clone);
|
|
3021
|
+
return clone;
|
|
3022
|
+
};
|
|
3023
|
+
}
|
|
3024
|
+
/**
|
|
3025
|
+
* @param {string} content
|
|
3026
|
+
* @param {number} flags
|
|
3027
|
+
* @param {'svg' | 'math'} ns
|
|
3028
|
+
* @returns {() => Node | Node[]}
|
|
3029
|
+
*/
|
|
3030
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
3031
|
+
function from_namespace(content, flags, ns = "svg") {
|
|
3032
|
+
/**
|
|
3033
|
+
* Whether or not the first item is a text/element node. If not, we need to
|
|
3034
|
+
* create an additional comment node to act as `effect.nodes.start`
|
|
3035
|
+
*/
|
|
3036
|
+
var has_start = !content.startsWith("<!>");
|
|
3037
|
+
var is_fragment = (flags & 1) !== 0;
|
|
3038
|
+
var wrapped = `<${ns}>${has_start ? content : "<!>" + content}</${ns}>`;
|
|
3039
|
+
/** @type {Element | DocumentFragment} */
|
|
3040
|
+
var node;
|
|
3041
|
+
return () => {
|
|
3042
|
+
if (hydrating) {
|
|
3043
|
+
assign_nodes(hydrate_node, null);
|
|
3044
|
+
return hydrate_node;
|
|
3045
|
+
}
|
|
3046
|
+
if (!node) {
|
|
3047
|
+
var root = /* @__PURE__ */ get_first_child(create_fragment_from_html(wrapped));
|
|
3048
|
+
if (is_fragment) {
|
|
3049
|
+
node = document.createDocumentFragment();
|
|
3050
|
+
while (/* @__PURE__ */ get_first_child(root)) node.appendChild(/* @__PURE__ */ get_first_child(root));
|
|
3051
|
+
} else node = /* @__PURE__ */ get_first_child(root);
|
|
3052
|
+
}
|
|
3053
|
+
var clone = node.cloneNode(true);
|
|
3054
|
+
if (is_fragment) {
|
|
3055
|
+
var start = /* @__PURE__ */ get_first_child(clone);
|
|
3056
|
+
var end = clone.lastChild;
|
|
3057
|
+
assign_nodes(start, end);
|
|
3058
|
+
} else assign_nodes(clone, clone);
|
|
3059
|
+
return clone;
|
|
3060
|
+
};
|
|
3061
|
+
}
|
|
3062
|
+
/**
|
|
3063
|
+
* @param {string} content
|
|
3064
|
+
* @param {number} flags
|
|
3065
|
+
*/
|
|
3066
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
3067
|
+
function from_svg(content, flags) {
|
|
3068
|
+
return /* @__PURE__ */ from_namespace(content, flags, "svg");
|
|
3069
|
+
}
|
|
3070
|
+
/**
|
|
3071
|
+
* @returns {TemplateNode | DocumentFragment}
|
|
3072
|
+
*/
|
|
3073
|
+
function comment() {
|
|
3074
|
+
if (hydrating) {
|
|
3075
|
+
assign_nodes(hydrate_node, null);
|
|
3076
|
+
return hydrate_node;
|
|
3077
|
+
}
|
|
3078
|
+
var frag = document.createDocumentFragment();
|
|
3079
|
+
var start = document.createComment("");
|
|
3080
|
+
var anchor = create_text();
|
|
3081
|
+
frag.append(start, anchor);
|
|
3082
|
+
assign_nodes(start, anchor);
|
|
3083
|
+
return frag;
|
|
3084
|
+
}
|
|
3085
|
+
/**
|
|
3086
|
+
* Assign the created (or in hydration mode, traversed) dom elements to the current block
|
|
3087
|
+
* and insert the elements into the dom (in client mode).
|
|
3088
|
+
* @param {Text | Comment | Element} anchor
|
|
3089
|
+
* @param {DocumentFragment | Element} dom
|
|
3090
|
+
*/
|
|
3091
|
+
function append(anchor, dom) {
|
|
3092
|
+
if (hydrating) {
|
|
3093
|
+
var effect = active_effect;
|
|
3094
|
+
if ((effect.f & 32768) === 0 || effect.nodes.end === null) effect.nodes.end = hydrate_node;
|
|
3095
|
+
hydrate_next();
|
|
3096
|
+
return;
|
|
3097
|
+
}
|
|
3098
|
+
if (anchor === null) return;
|
|
3099
|
+
anchor.before(dom);
|
|
3100
|
+
}
|
|
3101
|
+
/**
|
|
3102
|
+
* Subset of delegated events which should be passive by default.
|
|
3103
|
+
* These two are already passive via browser defaults on window, document and body.
|
|
3104
|
+
* But since
|
|
3105
|
+
* - we're delegating them
|
|
3106
|
+
* - they happen often
|
|
3107
|
+
* - they apply to mobile which is generally less performant
|
|
3108
|
+
* we're marking them as passive by default for other elements, too.
|
|
3109
|
+
*/
|
|
3110
|
+
var PASSIVE_EVENTS = ["touchstart", "touchmove"];
|
|
3111
|
+
/**
|
|
3112
|
+
* Returns `true` if `name` is a passive event
|
|
3113
|
+
* @param {string} name
|
|
3114
|
+
*/
|
|
3115
|
+
function is_passive_event(name) {
|
|
3116
|
+
return PASSIVE_EVENTS.includes(name);
|
|
3117
|
+
}
|
|
3118
|
+
//#endregion
|
|
3119
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/reactivity/create-subscriber.js
|
|
3120
|
+
/**
|
|
3121
|
+
* Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.
|
|
3122
|
+
* It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.
|
|
3123
|
+
*
|
|
3124
|
+
* If `subscribe` is called inside an effect (including indirectly, for example inside a getter),
|
|
3125
|
+
* the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.
|
|
3126
|
+
*
|
|
3127
|
+
* If `start` returns a cleanup function, it will be called when the effect is destroyed.
|
|
3128
|
+
*
|
|
3129
|
+
* If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects
|
|
3130
|
+
* are active, and the returned teardown function will only be called when all effects are destroyed.
|
|
3131
|
+
*
|
|
3132
|
+
* It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):
|
|
3133
|
+
*
|
|
3134
|
+
* ```js
|
|
3135
|
+
* import { createSubscriber } from 'svelte/reactivity';
|
|
3136
|
+
* import { on } from 'svelte/events';
|
|
3137
|
+
*
|
|
3138
|
+
* export class MediaQuery {
|
|
3139
|
+
* #query;
|
|
3140
|
+
* #subscribe;
|
|
3141
|
+
*
|
|
3142
|
+
* constructor(query) {
|
|
3143
|
+
* this.#query = window.matchMedia(`(${query})`);
|
|
3144
|
+
*
|
|
3145
|
+
* this.#subscribe = createSubscriber((update) => {
|
|
3146
|
+
* // when the `change` event occurs, re-run any effects that read `this.current`
|
|
3147
|
+
* const off = on(this.#query, 'change', update);
|
|
3148
|
+
*
|
|
3149
|
+
* // stop listening when all the effects are destroyed
|
|
3150
|
+
* return () => off();
|
|
3151
|
+
* });
|
|
3152
|
+
* }
|
|
3153
|
+
*
|
|
3154
|
+
* get current() {
|
|
3155
|
+
* // This makes the getter reactive, if read in an effect
|
|
3156
|
+
* this.#subscribe();
|
|
3157
|
+
*
|
|
3158
|
+
* // Return the current state of the query, whether or not we're in an effect
|
|
3159
|
+
* return this.#query.matches;
|
|
3160
|
+
* }
|
|
3161
|
+
* }
|
|
3162
|
+
* ```
|
|
3163
|
+
* @param {(update: () => void) => (() => void) | void} start
|
|
3164
|
+
* @since 5.7.0
|
|
3165
|
+
*/
|
|
3166
|
+
function createSubscriber(start) {
|
|
3167
|
+
let subscribers = 0;
|
|
3168
|
+
let version = source(0);
|
|
3169
|
+
/** @type {(() => void) | void} */
|
|
3170
|
+
let stop;
|
|
3171
|
+
return () => {
|
|
3172
|
+
if (effect_tracking()) {
|
|
3173
|
+
get(version);
|
|
3174
|
+
render_effect(() => {
|
|
3175
|
+
if (subscribers === 0) stop = untrack(() => start(() => increment(version)));
|
|
3176
|
+
subscribers += 1;
|
|
3177
|
+
return () => {
|
|
3178
|
+
queue_micro_task(() => {
|
|
3179
|
+
subscribers -= 1;
|
|
3180
|
+
if (subscribers === 0) {
|
|
3181
|
+
stop?.();
|
|
3182
|
+
stop = void 0;
|
|
3183
|
+
increment(version);
|
|
3184
|
+
}
|
|
3185
|
+
});
|
|
3186
|
+
};
|
|
3187
|
+
});
|
|
3339
3188
|
}
|
|
3340
|
-
}
|
|
3341
|
-
event[event_symbol] = handler_element;
|
|
3342
|
-
delete event.currentTarget;
|
|
3343
|
-
set_active_reaction(previous_reaction);
|
|
3344
|
-
set_active_effect(previous_effect);
|
|
3345
|
-
}
|
|
3189
|
+
};
|
|
3346
3190
|
}
|
|
3347
3191
|
//#endregion
|
|
3348
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
3349
|
-
|
|
3350
|
-
/** @param {string} html */
|
|
3351
|
-
createHTML: (html) => {
|
|
3352
|
-
return html;
|
|
3353
|
-
} });
|
|
3354
|
-
/** @param {string} html */
|
|
3355
|
-
function create_trusted_html(html) {
|
|
3356
|
-
return policy?.createHTML(html) ?? html;
|
|
3357
|
-
}
|
|
3192
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
|
|
3193
|
+
/** @import { Effect, Source, TemplateNode, } from '#client' */
|
|
3358
3194
|
/**
|
|
3359
|
-
* @
|
|
3195
|
+
* @typedef {{
|
|
3196
|
+
* onerror?: ((error: unknown, reset: () => void) => void) | null;
|
|
3197
|
+
* failed?: ((anchor: Node, error: () => unknown, reset: () => () => void) => void) | null;
|
|
3198
|
+
* pending?: ((anchor: Node) => void) | null;
|
|
3199
|
+
* }} BoundaryProps
|
|
3360
3200
|
*/
|
|
3361
|
-
|
|
3362
|
-
var elem = create_element("template");
|
|
3363
|
-
elem.innerHTML = create_trusted_html(html.replaceAll("<!>", "<!---->"));
|
|
3364
|
-
return elem.content;
|
|
3365
|
-
}
|
|
3366
|
-
//#endregion
|
|
3367
|
-
//#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/template.js
|
|
3368
|
-
/** @import { Effect, EffectNodes, TemplateNode } from '#client' */
|
|
3369
|
-
/** @import { TemplateStructure } from './types' */
|
|
3201
|
+
var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED;
|
|
3370
3202
|
/**
|
|
3371
|
-
* @param {TemplateNode}
|
|
3372
|
-
* @param {
|
|
3203
|
+
* @param {TemplateNode} node
|
|
3204
|
+
* @param {BoundaryProps} props
|
|
3205
|
+
* @param {((anchor: Node) => void)} children
|
|
3206
|
+
* @param {((error: unknown) => unknown) | undefined} [transform_error]
|
|
3207
|
+
* @returns {void}
|
|
3373
3208
|
*/
|
|
3374
|
-
function
|
|
3375
|
-
|
|
3376
|
-
if (effect.nodes === null) effect.nodes = {
|
|
3377
|
-
start,
|
|
3378
|
-
end,
|
|
3379
|
-
a: null,
|
|
3380
|
-
t: null
|
|
3381
|
-
};
|
|
3209
|
+
function boundary(node, props, children, transform_error) {
|
|
3210
|
+
new Boundary(node, props, children, transform_error);
|
|
3382
3211
|
}
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
*/
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3212
|
+
var _anchor = /* @__PURE__ */ new WeakMap();
|
|
3213
|
+
var _hydrate_open = /* @__PURE__ */ new WeakMap();
|
|
3214
|
+
var _props = /* @__PURE__ */ new WeakMap();
|
|
3215
|
+
var _children = /* @__PURE__ */ new WeakMap();
|
|
3216
|
+
var _effect = /* @__PURE__ */ new WeakMap();
|
|
3217
|
+
var _main_effect = /* @__PURE__ */ new WeakMap();
|
|
3218
|
+
var _pending_effect = /* @__PURE__ */ new WeakMap();
|
|
3219
|
+
var _failed_effect = /* @__PURE__ */ new WeakMap();
|
|
3220
|
+
var _offscreen_fragment = /* @__PURE__ */ new WeakMap();
|
|
3221
|
+
var _local_pending_count = /* @__PURE__ */ new WeakMap();
|
|
3222
|
+
var _pending_count = /* @__PURE__ */ new WeakMap();
|
|
3223
|
+
var _pending_count_update_queued = /* @__PURE__ */ new WeakMap();
|
|
3224
|
+
var _dirty_effects = /* @__PURE__ */ new WeakMap();
|
|
3225
|
+
var _maybe_dirty_effects = /* @__PURE__ */ new WeakMap();
|
|
3226
|
+
var _effect_pending = /* @__PURE__ */ new WeakMap();
|
|
3227
|
+
var _effect_pending_subscriber = /* @__PURE__ */ new WeakMap();
|
|
3228
|
+
var _Boundary_brand = /* @__PURE__ */ new WeakSet();
|
|
3229
|
+
var Boundary = class {
|
|
3394
3230
|
/**
|
|
3395
|
-
*
|
|
3396
|
-
*
|
|
3231
|
+
* @param {TemplateNode} node
|
|
3232
|
+
* @param {BoundaryProps} props
|
|
3233
|
+
* @param {((anchor: Node) => void)} children
|
|
3234
|
+
* @param {((error: unknown) => unknown) | undefined} [transform_error]
|
|
3397
3235
|
*/
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3236
|
+
constructor(node, props, children, transform_error) {
|
|
3237
|
+
_classPrivateMethodInitSpec(this, _Boundary_brand);
|
|
3238
|
+
_defineProperty(
|
|
3239
|
+
this,
|
|
3240
|
+
/** @type {Boundary | null} */
|
|
3241
|
+
"parent",
|
|
3242
|
+
void 0
|
|
3243
|
+
);
|
|
3244
|
+
_defineProperty(this, "is_pending", false);
|
|
3245
|
+
_defineProperty(
|
|
3246
|
+
this,
|
|
3247
|
+
/**
|
|
3248
|
+
* API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
|
|
3249
|
+
* Inherited from parent boundary, or defaults to identity.
|
|
3250
|
+
* @type {(error: unknown) => unknown}
|
|
3251
|
+
*/
|
|
3252
|
+
"transform_error",
|
|
3253
|
+
void 0
|
|
3254
|
+
);
|
|
3255
|
+
_classPrivateFieldInitSpec(this, _anchor, void 0);
|
|
3256
|
+
_classPrivateFieldInitSpec(this, _hydrate_open, hydrating ? hydrate_node : null);
|
|
3257
|
+
_classPrivateFieldInitSpec(this, _props, void 0);
|
|
3258
|
+
_classPrivateFieldInitSpec(this, _children, void 0);
|
|
3259
|
+
_classPrivateFieldInitSpec(this, _effect, void 0);
|
|
3260
|
+
_classPrivateFieldInitSpec(this, _main_effect, null);
|
|
3261
|
+
_classPrivateFieldInitSpec(this, _pending_effect, null);
|
|
3262
|
+
_classPrivateFieldInitSpec(this, _failed_effect, null);
|
|
3263
|
+
_classPrivateFieldInitSpec(this, _offscreen_fragment, null);
|
|
3264
|
+
_classPrivateFieldInitSpec(this, _local_pending_count, 0);
|
|
3265
|
+
_classPrivateFieldInitSpec(this, _pending_count, 0);
|
|
3266
|
+
_classPrivateFieldInitSpec(this, _pending_count_update_queued, false);
|
|
3267
|
+
_classPrivateFieldInitSpec(this, _dirty_effects, /* @__PURE__ */ new Set());
|
|
3268
|
+
_classPrivateFieldInitSpec(this, _maybe_dirty_effects, /* @__PURE__ */ new Set());
|
|
3269
|
+
_classPrivateFieldInitSpec(this, _effect_pending, null);
|
|
3270
|
+
_classPrivateFieldInitSpec(this, _effect_pending_subscriber, createSubscriber(() => {
|
|
3271
|
+
_classPrivateFieldSet2(_effect_pending, this, source(_classPrivateFieldGet2(_local_pending_count, this)));
|
|
3272
|
+
return () => {
|
|
3273
|
+
_classPrivateFieldSet2(_effect_pending, this, null);
|
|
3274
|
+
};
|
|
3275
|
+
}));
|
|
3276
|
+
_classPrivateFieldSet2(_anchor, this, node);
|
|
3277
|
+
_classPrivateFieldSet2(_props, this, props);
|
|
3278
|
+
_classPrivateFieldSet2(_children, this, (anchor) => {
|
|
3279
|
+
var effect = active_effect;
|
|
3280
|
+
effect.b = this;
|
|
3281
|
+
effect.f |= 128;
|
|
3282
|
+
children(anchor);
|
|
3283
|
+
});
|
|
3284
|
+
this.parent = active_effect.b;
|
|
3285
|
+
this.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e);
|
|
3286
|
+
_classPrivateFieldSet2(_effect, this, block(() => {
|
|
3287
|
+
if (hydrating) {
|
|
3288
|
+
const comment = _classPrivateFieldGet2(_hydrate_open, this);
|
|
3289
|
+
hydrate_next();
|
|
3290
|
+
const server_rendered_pending = comment.data === "[!";
|
|
3291
|
+
if (comment.data.startsWith("[?")) {
|
|
3292
|
+
const serialized_error = JSON.parse(comment.data.slice(2));
|
|
3293
|
+
_assertClassBrand(_Boundary_brand, this, _hydrate_failed_content).call(this, serialized_error);
|
|
3294
|
+
} else if (server_rendered_pending) _assertClassBrand(_Boundary_brand, this, _hydrate_pending_content).call(this);
|
|
3295
|
+
else _assertClassBrand(_Boundary_brand, this, _hydrate_resolved_content).call(this);
|
|
3296
|
+
} else _assertClassBrand(_Boundary_brand, this, _render).call(this);
|
|
3297
|
+
}, flags));
|
|
3298
|
+
if (hydrating) _classPrivateFieldSet2(_anchor, this, hydrate_node);
|
|
3299
|
+
}
|
|
3300
|
+
/**
|
|
3301
|
+
* Defer an effect inside a pending boundary until the boundary resolves
|
|
3302
|
+
* @param {Effect} effect
|
|
3303
|
+
*/
|
|
3304
|
+
defer_effect(effect) {
|
|
3305
|
+
defer_effect(effect, _classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
|
|
3306
|
+
}
|
|
3307
|
+
/**
|
|
3308
|
+
* Returns `false` if the effect exists inside a boundary whose pending snippet is shown
|
|
3309
|
+
* @returns {boolean}
|
|
3310
|
+
*/
|
|
3311
|
+
is_rendered() {
|
|
3312
|
+
return !this.is_pending && (!this.parent || this.parent.is_rendered());
|
|
3313
|
+
}
|
|
3314
|
+
has_pending_snippet() {
|
|
3315
|
+
return !!_classPrivateFieldGet2(_props, this).pending;
|
|
3316
|
+
}
|
|
3317
|
+
/**
|
|
3318
|
+
* Update the source that powers `$effect.pending()` inside this boundary,
|
|
3319
|
+
* and controls when the current `pending` snippet (if any) is removed.
|
|
3320
|
+
* Do not call from inside the class
|
|
3321
|
+
* @param {1 | -1} d
|
|
3322
|
+
* @param {Batch} batch
|
|
3323
|
+
*/
|
|
3324
|
+
update_pending_count(d, batch) {
|
|
3325
|
+
_assertClassBrand(_Boundary_brand, this, _update_pending_count).call(this, d, batch);
|
|
3326
|
+
_classPrivateFieldSet2(_local_pending_count, this, _classPrivateFieldGet2(_local_pending_count, this) + d);
|
|
3327
|
+
if (!_classPrivateFieldGet2(_effect_pending, this) || _classPrivateFieldGet2(_pending_count_update_queued, this)) return;
|
|
3328
|
+
_classPrivateFieldSet2(_pending_count_update_queued, this, true);
|
|
3329
|
+
queue_micro_task(() => {
|
|
3330
|
+
_classPrivateFieldSet2(_pending_count_update_queued, this, false);
|
|
3331
|
+
if (_classPrivateFieldGet2(_effect_pending, this)) internal_set(_classPrivateFieldGet2(_effect_pending, this), _classPrivateFieldGet2(_local_pending_count, this));
|
|
3332
|
+
});
|
|
3333
|
+
}
|
|
3334
|
+
get_effect_pending() {
|
|
3335
|
+
_classPrivateFieldGet2(_effect_pending_subscriber, this).call(this);
|
|
3336
|
+
return get(_classPrivateFieldGet2(_effect_pending, this));
|
|
3337
|
+
}
|
|
3338
|
+
/** @param {unknown} error */
|
|
3339
|
+
error(error) {
|
|
3340
|
+
if (!_classPrivateFieldGet2(_props, this).onerror && !_classPrivateFieldGet2(_props, this).failed) throw error;
|
|
3341
|
+
if (current_batch?.is_fork) {
|
|
3342
|
+
if (_classPrivateFieldGet2(_main_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_main_effect, this));
|
|
3343
|
+
if (_classPrivateFieldGet2(_pending_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_pending_effect, this));
|
|
3344
|
+
if (_classPrivateFieldGet2(_failed_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_failed_effect, this));
|
|
3345
|
+
current_batch.oncommit(() => {
|
|
3346
|
+
_assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
|
|
3347
|
+
});
|
|
3348
|
+
} else _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
|
|
3349
|
+
}
|
|
3350
|
+
};
|
|
3351
|
+
function _hydrate_resolved_content() {
|
|
3352
|
+
try {
|
|
3353
|
+
_classPrivateFieldSet2(_main_effect, this, branch(() => _classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this))));
|
|
3354
|
+
} catch (error) {
|
|
3355
|
+
this.error(error);
|
|
3356
|
+
}
|
|
3357
|
+
}
|
|
3358
|
+
/**
|
|
3359
|
+
* @param {unknown} error The deserialized error from the server's hydration comment
|
|
3360
|
+
*/
|
|
3361
|
+
function _hydrate_failed_content(error) {
|
|
3362
|
+
const failed = _classPrivateFieldGet2(_props, this).failed;
|
|
3363
|
+
const { reset, invoke_onerror } = _assertClassBrand(_Boundary_brand, this, _create_reset).call(this, error);
|
|
3364
|
+
queue_micro_task(invoke_onerror);
|
|
3365
|
+
if (!failed) return;
|
|
3366
|
+
_classPrivateFieldSet2(_failed_effect, this, branch(() => {
|
|
3367
|
+
failed(_classPrivateFieldGet2(_anchor, this), () => error, () => reset);
|
|
3368
|
+
}));
|
|
3416
3369
|
}
|
|
3417
3370
|
/**
|
|
3418
|
-
*
|
|
3419
|
-
*
|
|
3420
|
-
* @param {
|
|
3421
|
-
* @returns {() =>
|
|
3371
|
+
* Creates the `reset` function for a failed boundary, along with a function
|
|
3372
|
+
* that invokes `onerror` with it (if provided)
|
|
3373
|
+
* @param {unknown} error
|
|
3374
|
+
* @returns {{ reset: () => void, invoke_onerror: () => void }}
|
|
3422
3375
|
*/
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
var is_fragment = (flags & 1) !== 0;
|
|
3431
|
-
var wrapped = `<${ns}>${has_start ? content : "<!>" + content}</${ns}>`;
|
|
3432
|
-
/** @type {Element | DocumentFragment} */
|
|
3433
|
-
var node;
|
|
3434
|
-
return () => {
|
|
3435
|
-
if (hydrating) {
|
|
3436
|
-
assign_nodes(hydrate_node, null);
|
|
3437
|
-
return hydrate_node;
|
|
3376
|
+
function _create_reset(error) {
|
|
3377
|
+
var did_reset = false;
|
|
3378
|
+
var calling_on_error = false;
|
|
3379
|
+
const reset = () => {
|
|
3380
|
+
if (did_reset) {
|
|
3381
|
+
svelte_boundary_reset_noop();
|
|
3382
|
+
return;
|
|
3438
3383
|
}
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3384
|
+
did_reset = true;
|
|
3385
|
+
if (calling_on_error) svelte_boundary_reset_onerror();
|
|
3386
|
+
if (_classPrivateFieldGet2(_failed_effect, this) !== null) pause_effect(_classPrivateFieldGet2(_failed_effect, this), () => {
|
|
3387
|
+
_classPrivateFieldSet2(_failed_effect, this, null);
|
|
3388
|
+
});
|
|
3389
|
+
_assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
3390
|
+
_assertClassBrand(_Boundary_brand, this, _render).call(this);
|
|
3391
|
+
});
|
|
3392
|
+
};
|
|
3393
|
+
const invoke_onerror = () => {
|
|
3394
|
+
try {
|
|
3395
|
+
calling_on_error = true;
|
|
3396
|
+
_classPrivateFieldGet2(_props, this).onerror?.(error, reset);
|
|
3397
|
+
calling_on_error = false;
|
|
3398
|
+
} catch (err) {
|
|
3399
|
+
invoke_error_boundary(err, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
|
|
3445
3400
|
}
|
|
3446
|
-
var clone = node.cloneNode(true);
|
|
3447
|
-
if (is_fragment) {
|
|
3448
|
-
var start = /* @__PURE__ */ get_first_child(clone);
|
|
3449
|
-
var end = clone.lastChild;
|
|
3450
|
-
assign_nodes(start, end);
|
|
3451
|
-
} else assign_nodes(clone, clone);
|
|
3452
|
-
return clone;
|
|
3453
3401
|
};
|
|
3402
|
+
return {
|
|
3403
|
+
reset,
|
|
3404
|
+
invoke_onerror
|
|
3405
|
+
};
|
|
3406
|
+
}
|
|
3407
|
+
function _hydrate_pending_content() {
|
|
3408
|
+
const pending = _classPrivateFieldGet2(_props, this).pending;
|
|
3409
|
+
if (!pending) return;
|
|
3410
|
+
this.is_pending = true;
|
|
3411
|
+
_classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
|
|
3412
|
+
queue_micro_task(() => {
|
|
3413
|
+
var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
|
|
3414
|
+
var anchor = create_text();
|
|
3415
|
+
var handled = false;
|
|
3416
|
+
fragment.append(anchor);
|
|
3417
|
+
_classPrivateFieldSet2(_main_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
3418
|
+
try {
|
|
3419
|
+
return branch(() => _classPrivateFieldGet2(_children, this).call(this, anchor));
|
|
3420
|
+
} catch (error) {
|
|
3421
|
+
try {
|
|
3422
|
+
this.error(error);
|
|
3423
|
+
handled = true;
|
|
3424
|
+
} catch (error) {
|
|
3425
|
+
invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
|
|
3426
|
+
}
|
|
3427
|
+
return null;
|
|
3428
|
+
}
|
|
3429
|
+
}));
|
|
3430
|
+
if (_classPrivateFieldGet2(_main_effect, this) === null) {
|
|
3431
|
+
_classPrivateFieldSet2(_offscreen_fragment, this, null);
|
|
3432
|
+
if (handled) _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
|
|
3433
|
+
return;
|
|
3434
|
+
}
|
|
3435
|
+
if (_classPrivateFieldGet2(_pending_count, this) === 0) {
|
|
3436
|
+
_classPrivateFieldGet2(_anchor, this).before(fragment);
|
|
3437
|
+
_classPrivateFieldSet2(_offscreen_fragment, this, null);
|
|
3438
|
+
pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
|
|
3439
|
+
_classPrivateFieldSet2(_pending_effect, this, null);
|
|
3440
|
+
});
|
|
3441
|
+
_assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
|
|
3442
|
+
}
|
|
3443
|
+
});
|
|
3444
|
+
}
|
|
3445
|
+
function _render() {
|
|
3446
|
+
try {
|
|
3447
|
+
this.is_pending = this.has_pending_snippet();
|
|
3448
|
+
_classPrivateFieldSet2(_pending_count, this, 0);
|
|
3449
|
+
_classPrivateFieldSet2(_local_pending_count, this, 0);
|
|
3450
|
+
_classPrivateFieldSet2(_main_effect, this, branch(() => {
|
|
3451
|
+
_classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this));
|
|
3452
|
+
}));
|
|
3453
|
+
if (_classPrivateFieldGet2(_pending_count, this) > 0) {
|
|
3454
|
+
var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
|
|
3455
|
+
move_effect(_classPrivateFieldGet2(_main_effect, this), fragment);
|
|
3456
|
+
const pending = _classPrivateFieldGet2(_props, this).pending;
|
|
3457
|
+
_classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
|
|
3458
|
+
} else _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
|
|
3459
|
+
} catch (error) {
|
|
3460
|
+
this.error(error);
|
|
3461
|
+
}
|
|
3454
3462
|
}
|
|
3455
3463
|
/**
|
|
3456
|
-
* @param {
|
|
3457
|
-
* @param {number} flags
|
|
3464
|
+
* @param {Batch} batch
|
|
3458
3465
|
*/
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3466
|
+
function _resolve(batch) {
|
|
3467
|
+
this.is_pending = false;
|
|
3468
|
+
batch.transfer_effects(_classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
|
|
3462
3469
|
}
|
|
3463
3470
|
/**
|
|
3464
|
-
* @
|
|
3471
|
+
* @template T
|
|
3472
|
+
* @param {() => T} fn
|
|
3465
3473
|
*/
|
|
3466
|
-
function
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3474
|
+
function _run(fn) {
|
|
3475
|
+
var previous_effect = active_effect;
|
|
3476
|
+
var previous_reaction = active_reaction;
|
|
3477
|
+
var previous_ctx = component_context;
|
|
3478
|
+
set_active_effect(_classPrivateFieldGet2(_effect, this));
|
|
3479
|
+
set_active_reaction(_classPrivateFieldGet2(_effect, this));
|
|
3480
|
+
set_component_context(_classPrivateFieldGet2(_effect, this).ctx);
|
|
3481
|
+
try {
|
|
3482
|
+
Batch.ensure();
|
|
3483
|
+
return fn();
|
|
3484
|
+
} finally {
|
|
3485
|
+
set_active_effect(previous_effect);
|
|
3486
|
+
set_active_reaction(previous_reaction);
|
|
3487
|
+
set_component_context(previous_ctx);
|
|
3470
3488
|
}
|
|
3471
|
-
var frag = document.createDocumentFragment();
|
|
3472
|
-
var start = document.createComment("");
|
|
3473
|
-
var anchor = create_text();
|
|
3474
|
-
frag.append(start, anchor);
|
|
3475
|
-
assign_nodes(start, anchor);
|
|
3476
|
-
return frag;
|
|
3477
3489
|
}
|
|
3478
3490
|
/**
|
|
3479
|
-
*
|
|
3480
|
-
*
|
|
3481
|
-
* @param {
|
|
3482
|
-
* @param {
|
|
3491
|
+
* Updates the pending count associated with the currently visible pending snippet,
|
|
3492
|
+
* if any, such that we can replace the snippet with content once work is done
|
|
3493
|
+
* @param {1 | -1} d
|
|
3494
|
+
* @param {Batch} batch
|
|
3483
3495
|
*/
|
|
3484
|
-
function
|
|
3485
|
-
if (
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3496
|
+
function _update_pending_count(d, batch) {
|
|
3497
|
+
if (!this.has_pending_snippet()) {
|
|
3498
|
+
if (this.parent) {
|
|
3499
|
+
var _this$parent;
|
|
3500
|
+
_assertClassBrand(_Boundary_brand, _this$parent = this.parent, _update_pending_count).call(_this$parent, d, batch);
|
|
3501
|
+
}
|
|
3489
3502
|
return;
|
|
3490
3503
|
}
|
|
3491
|
-
|
|
3492
|
-
|
|
3504
|
+
_classPrivateFieldSet2(_pending_count, this, _classPrivateFieldGet2(_pending_count, this) + d);
|
|
3505
|
+
if (_classPrivateFieldGet2(_pending_count, this) === 0) {
|
|
3506
|
+
_assertClassBrand(_Boundary_brand, this, _resolve).call(this, batch);
|
|
3507
|
+
if (_classPrivateFieldGet2(_pending_effect, this)) pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
|
|
3508
|
+
_classPrivateFieldSet2(_pending_effect, this, null);
|
|
3509
|
+
});
|
|
3510
|
+
if (_classPrivateFieldGet2(_offscreen_fragment, this)) {
|
|
3511
|
+
_classPrivateFieldGet2(_anchor, this).before(_classPrivateFieldGet2(_offscreen_fragment, this));
|
|
3512
|
+
_classPrivateFieldSet2(_offscreen_fragment, this, null);
|
|
3513
|
+
}
|
|
3514
|
+
}
|
|
3493
3515
|
}
|
|
3494
3516
|
/**
|
|
3495
|
-
*
|
|
3496
|
-
* These two are already passive via browser defaults on window, document and body.
|
|
3497
|
-
* But since
|
|
3498
|
-
* - we're delegating them
|
|
3499
|
-
* - they happen often
|
|
3500
|
-
* - they apply to mobile which is generally less performant
|
|
3501
|
-
* we're marking them as passive by default for other elements, too.
|
|
3502
|
-
*/
|
|
3503
|
-
var PASSIVE_EVENTS = ["touchstart", "touchmove"];
|
|
3504
|
-
/**
|
|
3505
|
-
* Returns `true` if `name` is a passive event
|
|
3506
|
-
* @param {string} name
|
|
3517
|
+
* @param {unknown} error
|
|
3507
3518
|
*/
|
|
3508
|
-
function
|
|
3509
|
-
|
|
3519
|
+
function _handle_error(error) {
|
|
3520
|
+
if (_classPrivateFieldGet2(_main_effect, this)) {
|
|
3521
|
+
destroy_effect(_classPrivateFieldGet2(_main_effect, this));
|
|
3522
|
+
_classPrivateFieldSet2(_main_effect, this, null);
|
|
3523
|
+
}
|
|
3524
|
+
if (_classPrivateFieldGet2(_pending_effect, this)) {
|
|
3525
|
+
destroy_effect(_classPrivateFieldGet2(_pending_effect, this));
|
|
3526
|
+
_classPrivateFieldSet2(_pending_effect, this, null);
|
|
3527
|
+
}
|
|
3528
|
+
if (_classPrivateFieldGet2(_failed_effect, this)) {
|
|
3529
|
+
destroy_effect(_classPrivateFieldGet2(_failed_effect, this));
|
|
3530
|
+
_classPrivateFieldSet2(_failed_effect, this, null);
|
|
3531
|
+
}
|
|
3532
|
+
if (hydrating) {
|
|
3533
|
+
set_hydrate_node(_classPrivateFieldGet2(_hydrate_open, this));
|
|
3534
|
+
next();
|
|
3535
|
+
set_hydrate_node(skip_nodes());
|
|
3536
|
+
}
|
|
3537
|
+
let failed = _classPrivateFieldGet2(_props, this).failed;
|
|
3538
|
+
/** @param {unknown} transformed_error */
|
|
3539
|
+
const handle_error_result = (transformed_error) => {
|
|
3540
|
+
const { reset, invoke_onerror } = _assertClassBrand(_Boundary_brand, this, _create_reset).call(this, transformed_error);
|
|
3541
|
+
invoke_onerror();
|
|
3542
|
+
if (failed) _classPrivateFieldSet2(_failed_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
3543
|
+
try {
|
|
3544
|
+
return branch(() => {
|
|
3545
|
+
var effect = active_effect;
|
|
3546
|
+
effect.b = this;
|
|
3547
|
+
effect.f |= 128;
|
|
3548
|
+
failed(_classPrivateFieldGet2(_anchor, this), () => transformed_error, () => reset);
|
|
3549
|
+
});
|
|
3550
|
+
} catch (error) {
|
|
3551
|
+
invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
|
|
3552
|
+
return null;
|
|
3553
|
+
}
|
|
3554
|
+
}));
|
|
3555
|
+
};
|
|
3556
|
+
queue_micro_task(() => {
|
|
3557
|
+
/** @type {unknown} */
|
|
3558
|
+
var result;
|
|
3559
|
+
try {
|
|
3560
|
+
result = this.transform_error(error);
|
|
3561
|
+
} catch (e) {
|
|
3562
|
+
invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
|
|
3563
|
+
return;
|
|
3564
|
+
}
|
|
3565
|
+
if (result !== null && typeof result === "object" && typeof result.then === "function")
|
|
3566
|
+
/** @type {any} */ result.then(
|
|
3567
|
+
handle_error_result,
|
|
3568
|
+
/** @param {unknown} e */
|
|
3569
|
+
(e) => invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent)
|
|
3570
|
+
);
|
|
3571
|
+
else handle_error_result(result);
|
|
3572
|
+
});
|
|
3510
3573
|
}
|
|
3511
3574
|
/**
|
|
3512
3575
|
* @param {Element} text
|
|
@@ -3610,7 +3673,7 @@ function _mount(Component, { target, anchor, props = {}, events, context, intro
|
|
|
3610
3673
|
if (events)
|
|
3611
3674
|
/** @type {any} */ props.$$events = events;
|
|
3612
3675
|
if (hydrating) assign_nodes(anchor_node, null);
|
|
3613
|
-
component = Component(anchor_node, props) ||
|
|
3676
|
+
component = Component(anchor_node, props) || mark_as_component();
|
|
3614
3677
|
if (hydrating) {
|
|
3615
3678
|
/** @type {Effect & { nodes: EffectNodes }} */ active_effect.nodes.end = hydrate_node;
|
|
3616
3679
|
if (hydrate_node === null || hydrate_node.nodeType !== 8 || hydrate_node.data !== "]") {
|
|
@@ -3696,7 +3759,7 @@ function unmount(component, options) {
|
|
|
3696
3759
|
return Promise.resolve();
|
|
3697
3760
|
}
|
|
3698
3761
|
//#endregion
|
|
3699
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
3762
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/blocks/branches.js
|
|
3700
3763
|
/** @import { Effect, TemplateNode } from '#client' */
|
|
3701
3764
|
var _batches = /* @__PURE__ */ new WeakMap();
|
|
3702
3765
|
var _onscreen = /* @__PURE__ */ new WeakMap();
|
|
@@ -3819,7 +3882,7 @@ var BranchManager = class {
|
|
|
3819
3882
|
}
|
|
3820
3883
|
};
|
|
3821
3884
|
//#endregion
|
|
3822
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
3885
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/blocks/if.js
|
|
3823
3886
|
/** @import { TemplateNode } from '#client' */
|
|
3824
3887
|
/**
|
|
3825
3888
|
* @param {TemplateNode} node
|
|
@@ -3865,7 +3928,7 @@ function if_block(node, fn, elseif = false) {
|
|
|
3865
3928
|
}, flags);
|
|
3866
3929
|
}
|
|
3867
3930
|
//#endregion
|
|
3868
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
3931
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/blocks/each.js
|
|
3869
3932
|
/** @import { EachItem, EachOutroGroup, EachState, Effect, EffectNodes, MaybeSource, Source, TemplateNode, TransitionManager, Value } from '#client' */
|
|
3870
3933
|
/** @import { Batch } from '../../reactivity/batch.js'; */
|
|
3871
3934
|
/**
|
|
@@ -3898,7 +3961,7 @@ function pause_effects(state, to_destroy, controlled_anchor) {
|
|
|
3898
3961
|
}, false);
|
|
3899
3962
|
}
|
|
3900
3963
|
if (remaining === 0) {
|
|
3901
|
-
var fast_path = transitions.length === 0 && controlled_anchor !== null;
|
|
3964
|
+
var fast_path = transitions.length === 0 && controlled_anchor !== null && state.pending.size === 0;
|
|
3902
3965
|
if (fast_path) {
|
|
3903
3966
|
var anchor = controlled_anchor;
|
|
3904
3967
|
var parent_node = anchor.parentNode;
|
|
@@ -4330,13 +4393,14 @@ function html(node, get_value, is_controlled = false, svg = false, mathml = fals
|
|
|
4330
4393
|
});
|
|
4331
4394
|
}
|
|
4332
4395
|
//#endregion
|
|
4333
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4396
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/css.js
|
|
4334
4397
|
/**
|
|
4335
4398
|
* @param {Node} anchor
|
|
4336
4399
|
* @param {{ hash: string, code: string }} css
|
|
4337
4400
|
*/
|
|
4338
4401
|
function append_styles$1(anchor, css) {
|
|
4339
4402
|
effect(() => {
|
|
4403
|
+
anchor = active_effect?.parent?.nodes?.start ?? anchor;
|
|
4340
4404
|
var root = anchor.getRootNode();
|
|
4341
4405
|
var target = root.host ? root : /** @type {Document} */ root.head ?? root.ownerDocument.head;
|
|
4342
4406
|
if (!target.querySelector("#" + css.hash)) {
|
|
@@ -4348,7 +4412,7 @@ function append_styles$1(anchor, css) {
|
|
|
4348
4412
|
});
|
|
4349
4413
|
}
|
|
4350
4414
|
//#endregion
|
|
4351
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4415
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/shared/attributes.js
|
|
4352
4416
|
var whitespace = [..." \n\r\f\xA0\v"];
|
|
4353
4417
|
/**
|
|
4354
4418
|
* @param {any} value
|
|
@@ -4412,7 +4476,7 @@ function to_style(value, styles) {
|
|
|
4412
4476
|
important_styles = styles[1];
|
|
4413
4477
|
} else normal_styles = styles;
|
|
4414
4478
|
if (value) {
|
|
4415
|
-
value = String(value).replaceAll(
|
|
4479
|
+
value = String(value).replaceAll(/\/\*.*?\*\//g, "").trim();
|
|
4416
4480
|
/** @type {boolean | '"' | "'"} */
|
|
4417
4481
|
var in_str = false;
|
|
4418
4482
|
var in_apo = 0;
|
|
@@ -4458,7 +4522,7 @@ function to_style(value, styles) {
|
|
|
4458
4522
|
return value == null ? null : String(value);
|
|
4459
4523
|
}
|
|
4460
4524
|
//#endregion
|
|
4461
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4525
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/class.js
|
|
4462
4526
|
/**
|
|
4463
4527
|
* @param {Element} dom
|
|
4464
4528
|
* @param {boolean | number} is_html
|
|
@@ -4483,7 +4547,7 @@ function set_class(dom, is_html, value, hash, prev_classes, next_classes) {
|
|
|
4483
4547
|
return next_classes;
|
|
4484
4548
|
}
|
|
4485
4549
|
//#endregion
|
|
4486
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4550
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/style.js
|
|
4487
4551
|
/**
|
|
4488
4552
|
* @param {Element & ElementCSSInlineStyle} dom
|
|
4489
4553
|
* @param {Record<string, any>} prev
|
|
@@ -4517,7 +4581,7 @@ function set_style(dom, value, prev_styles, next_styles) {
|
|
|
4517
4581
|
return next_styles;
|
|
4518
4582
|
}
|
|
4519
4583
|
//#endregion
|
|
4520
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4584
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/attributes.js
|
|
4521
4585
|
/** @import { Blocker, Effect } from '#client' */
|
|
4522
4586
|
var IS_CUSTOM_ELEMENT = Symbol("is custom element");
|
|
4523
4587
|
var IS_HTML = Symbol("is html");
|
|
@@ -4586,7 +4650,7 @@ function set_attribute(element, attribute, value, skip_warning) {
|
|
|
4586
4650
|
if (attributes[attribute] === (attributes[attribute] = value)) return;
|
|
4587
4651
|
if (attribute === "loading") element[LOADING_ATTR_SYMBOL] = value;
|
|
4588
4652
|
if (value == null) element.removeAttribute(attribute);
|
|
4589
|
-
else if (typeof value !== "string" && get_setters(element).
|
|
4653
|
+
else if (typeof value !== "string" && get_setters(element).has(attribute)) element[attribute] = value;
|
|
4590
4654
|
else element.setAttribute(attribute, value);
|
|
4591
4655
|
}
|
|
4592
4656
|
/**
|
|
@@ -4599,26 +4663,26 @@ function get_attributes(element) {
|
|
|
4599
4663
|
[IS_HTML]: element.namespaceURI === "http://www.w3.org/1999/xhtml"
|
|
4600
4664
|
});
|
|
4601
4665
|
}
|
|
4602
|
-
/** @type {Map<string, string
|
|
4666
|
+
/** @type {Map<string, Set<string>>} */
|
|
4603
4667
|
var setters_cache = /* @__PURE__ */ new Map();
|
|
4604
4668
|
/** @param {Element} element */
|
|
4605
4669
|
function get_setters(element) {
|
|
4606
4670
|
var cache_key = element.getAttribute("is") || element.nodeName;
|
|
4607
4671
|
var setters = setters_cache.get(cache_key);
|
|
4608
4672
|
if (setters) return setters;
|
|
4609
|
-
setters_cache.set(cache_key, setters =
|
|
4673
|
+
setters_cache.set(cache_key, setters = /* @__PURE__ */ new Set());
|
|
4610
4674
|
var descriptors;
|
|
4611
4675
|
var proto = element;
|
|
4612
4676
|
var element_proto = Element.prototype;
|
|
4613
4677
|
while (element_proto !== proto) {
|
|
4614
4678
|
descriptors = get_descriptors(proto);
|
|
4615
|
-
for (var key in descriptors) if (descriptors[key].set && key !== "innerHTML" && key !== "textContent" && key !== "innerText") setters.
|
|
4679
|
+
for (var key in descriptors) if (descriptors[key].set && key !== "innerHTML" && key !== "textContent" && key !== "innerText") setters.add(key);
|
|
4616
4680
|
proto = get_prototype_of(proto);
|
|
4617
4681
|
}
|
|
4618
4682
|
return setters;
|
|
4619
4683
|
}
|
|
4620
4684
|
//#endregion
|
|
4621
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4685
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js
|
|
4622
4686
|
var _ResizeObserverSingleton;
|
|
4623
4687
|
var _listeners = /* @__PURE__ */ new WeakMap();
|
|
4624
4688
|
var _observer = /* @__PURE__ */ new WeakMap();
|
|
@@ -4670,7 +4734,7 @@ function _getObserver() {
|
|
|
4670
4734
|
}
|
|
4671
4735
|
_defineProperty(ResizeObserverSingleton, "entries", /* @__PURE__ */ new WeakMap());
|
|
4672
4736
|
//#endregion
|
|
4673
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4737
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/bindings/this.js
|
|
4674
4738
|
/** @import { ComponentContext, Effect } from '#client' */
|
|
4675
4739
|
/**
|
|
4676
4740
|
* @param {any} bound_value
|
|
@@ -4688,7 +4752,7 @@ function is_bound_this(bound_value, element_or_component) {
|
|
|
4688
4752
|
* returns all the parts of the each block context that are used in the expression
|
|
4689
4753
|
* @returns {void}
|
|
4690
4754
|
*/
|
|
4691
|
-
function bind_this(element_or_component =
|
|
4755
|
+
function bind_this(element_or_component = mark_as_component(), update, get_value, get_parts) {
|
|
4692
4756
|
var component_effect = component_context.r;
|
|
4693
4757
|
var parent = active_effect;
|
|
4694
4758
|
effect(() => {
|
|
@@ -4722,7 +4786,7 @@ function bind_this(element_or_component = {}, update, get_value, get_parts) {
|
|
|
4722
4786
|
return element_or_component;
|
|
4723
4787
|
}
|
|
4724
4788
|
//#endregion
|
|
4725
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4789
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/props.js
|
|
4726
4790
|
/** @import { Derived, Effect, Source } from './types.js' */
|
|
4727
4791
|
/**
|
|
4728
4792
|
* This function is responsible for synchronizing a possibly bound prop with the inner component state.
|
|
@@ -4815,7 +4879,7 @@ function prop(props, key, flags, fallback) {
|
|
|
4815
4879
|
});
|
|
4816
4880
|
}
|
|
4817
4881
|
//#endregion
|
|
4818
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
4882
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/legacy/legacy-client.js
|
|
4819
4883
|
/** @import { ComponentConstructorOptions, ComponentType, SvelteComponent, Component } from 'svelte' */
|
|
4820
4884
|
/**
|
|
4821
4885
|
* Takes the same options as a Svelte 4 component and the component function and returns a Svelte 4 compatible component.
|
|
@@ -4934,7 +4998,7 @@ var Svelte4Component = class {
|
|
|
4934
4998
|
}
|
|
4935
4999
|
};
|
|
4936
5000
|
//#endregion
|
|
4937
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
5001
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/custom-element.js
|
|
4938
5002
|
/**
|
|
4939
5003
|
* @typedef {Object} CustomElementPropDefinition
|
|
4940
5004
|
* @property {string} [attribute]
|
|
@@ -5460,8 +5524,7 @@ function AudioPlayer($$anchor, $$props) {
|
|
|
5460
5524
|
var node_2 = sibling(audio_1, 2);
|
|
5461
5525
|
var consequent_1 = ($$anchor) => {
|
|
5462
5526
|
var button_1 = root_1$3();
|
|
5463
|
-
var text =
|
|
5464
|
-
reset(button_1);
|
|
5527
|
+
var text = only_child(button_1, true);
|
|
5465
5528
|
bind_this(button_1, ($$value) => set(autoplayEnableButtonEl, $$value), () => get(autoplayEnableButtonEl));
|
|
5466
5529
|
template_effect(() => set_text(text, uiText().clickToEnableAutoplay));
|
|
5467
5530
|
append($$anchor, button_1);
|
|
@@ -5474,8 +5537,7 @@ function AudioPlayer($$anchor, $$props) {
|
|
|
5474
5537
|
};
|
|
5475
5538
|
var consequent_3 = ($$anchor) => {
|
|
5476
5539
|
var p = root_3$3();
|
|
5477
|
-
var text_1 =
|
|
5478
|
-
reset(p);
|
|
5540
|
+
var text_1 = only_child(p, true);
|
|
5479
5541
|
template_effect(() => set_text(text_1, get(audioErrorMessage)));
|
|
5480
5542
|
append($$anchor, p);
|
|
5481
5543
|
};
|
|
@@ -5506,13 +5568,13 @@ create_custom_element(AudioPlayer, {
|
|
|
5506
5568
|
}, [], [], { mode: "open" });
|
|
5507
5569
|
//#endregion
|
|
5508
5570
|
//#region src/delivery/ClozeMarker.svelte
|
|
5509
|
-
var root$2 = /* @__PURE__ */ from_html(`<img class="w-auto object-contain pie-blank-image" style="max-height:var(--mpb-
|
|
5571
|
+
var root$2 = /* @__PURE__ */ from_html(`<img class="w-auto object-contain pie-blank-image" style="max-width:var(--mpb-choice-image-max-width, 9.375rem);max-height:var(--mpb-choice-image-max-height, 9.375rem);"/>`);
|
|
5510
5572
|
var root_1$2 = /* @__PURE__ */ from_html(`<span class="cloze-marker-value pie-blank-value svelte-d9l5tb"></span>`);
|
|
5511
|
-
var root_2$2 = /* @__PURE__ */ from_html(`<span class="cloze-marker-empty svelte-d9l5tb" aria-hidden="true"> </span>`);
|
|
5573
|
+
var root_2$2 = /* @__PURE__ */ from_html(`<span class="cloze-marker-empty svelte-d9l5tb"><span aria-hidden="true"> </span> <span class="sr-only svelte-d9l5tb">(blank)</span></span>`);
|
|
5512
5574
|
var root_3$2 = /* @__PURE__ */ from_html(`<span role="status" aria-live="polite" aria-atomic="true"><!></span>`);
|
|
5513
5575
|
var $$css$2 = {
|
|
5514
5576
|
hash: "svelte-d9l5tb",
|
|
5515
|
-
code: ".cloze-marker.svelte-d9l5tb {display:inline-flex;align-items:center;justify-content:center;text-align:center;vertical-align:baseline;}.cloze-marker.svelte-d9l5tb:focus-within {outline:2px solid var(--mpb-focus-ring, #1565c0);outline-offset:2px;}.cloze-marker-standalone.svelte-d9l5tb {width:var(--mpb-blank-standalone-width, 7rem);}.cloze-marker-empty.svelte-d9l5tb {display:inline-block;min-width:4ch;}.cloze-marker-value.svelte-d9l5tb {width:100%;display:inline-flex;align-items:center;justify-content:center;text-align:center;}.cloze-marker-value.svelte-d9l5tb p {margin:0;}"
|
|
5577
|
+
code: ".cloze-marker.svelte-d9l5tb {display:inline-flex;align-items:center;justify-content:center;text-align:center;vertical-align:baseline;}.cloze-marker.svelte-d9l5tb:focus-within {outline:2px solid var(--mpb-focus-ring, #1565c0);outline-offset:2px;}.cloze-marker-standalone.svelte-d9l5tb {width:var(--mpb-blank-standalone-width, 7rem);}.cloze-marker-empty.svelte-d9l5tb {display:inline-block;min-width:4ch;}.cloze-marker-value.svelte-d9l5tb {width:100%;display:inline-flex;align-items:center;justify-content:center;text-align:center;}.cloze-marker-value.svelte-d9l5tb p {margin:0;}\n\n /* Same 150x150 content-element constraint as ChoiceRow.svelte's .choice-html\n img — the selected choice's raw labelHtml can carry an embedded <img> here\n too, regardless of customType. See CONTOOL-3159. */.cloze-marker-value.svelte-d9l5tb img {width:150px;height:150px;}.sr-only.svelte-d9l5tb {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}"
|
|
5516
5578
|
};
|
|
5517
5579
|
function ClozeMarker($$anchor, $$props) {
|
|
5518
5580
|
push($$props, true);
|
|
@@ -5613,15 +5675,16 @@ create_custom_element(ClozeMarker, {
|
|
|
5613
5675
|
}, [], [], { mode: "open" });
|
|
5614
5676
|
//#endregion
|
|
5615
5677
|
//#region src/delivery/ChoiceRow.svelte
|
|
5616
|
-
var root$1 = /* @__PURE__ */ from_html(`<img class="object-contain pie-choice-image" style="max-height:var(--mpb-choice-image-max-height,
|
|
5678
|
+
var root$1 = /* @__PURE__ */ from_html(`<img class="object-contain pie-choice-image" style="max-width:var(--mpb-choice-image-max-width, 9.375rem);max-height:var(--mpb-choice-image-max-height, 9.375rem);"/>`);
|
|
5617
5679
|
var root_1$1 = /* @__PURE__ */ from_html(`<span class="choice-html pie-choice-label svelte-8xu1pt"></span>`);
|
|
5618
5680
|
var root_2$1 = /* @__PURE__ */ from_html(`<label class="cursor-pointer choice-tile text-center pie-choice-tile svelte-8xu1pt"><span class="choice-tile-content pie-choice-tile-content svelte-8xu1pt"><!></span> <input type="radio" class="choice-radio-bottom pie-choice-radio pie-choice-radio-bottom svelte-8xu1pt"/></label>`);
|
|
5619
|
-
var root_3$1 = /* @__PURE__ */ from_html(`<
|
|
5620
|
-
var root_4$1 = /* @__PURE__ */ from_html(`<
|
|
5621
|
-
var root_5$1 = /* @__PURE__ */ from_html(`<
|
|
5681
|
+
var root_3$1 = /* @__PURE__ */ from_html(`<img class="object-contain pie-choice-image" style="max-height:var(--mpb-choice-image-max-height, 5rem);"/>`);
|
|
5682
|
+
var root_4$1 = /* @__PURE__ */ from_html(`<input type="radio" class="choice-radio-inline pie-choice-radio pie-choice-radio-inline svelte-8xu1pt"/> <label class="cursor-pointer flex-1 pie-choice-label-wrap svelte-8xu1pt"><!></label>`, 1);
|
|
5683
|
+
var root_5$1 = /* @__PURE__ */ from_html(`<span aria-hidden="true"> </span>`);
|
|
5684
|
+
var root_6$1 = /* @__PURE__ */ from_html(`<div style="gap:var(--mpb-choice-row-gap, 0.5rem);"><!> <!></div>`);
|
|
5622
5685
|
var $$css$1 = {
|
|
5623
5686
|
hash: "svelte-8xu1pt",
|
|
5624
|
-
code: ".choice-row-horizontal.svelte-8xu1pt {flex-direction:column;align-items:center;width:min(var(--mpb-choice-width-px, 170px), var(--mpb-choice-width-vw, 30vw));min-height:var(--mpb-choice-tile-min-height, 11rem);gap:0;}.choice-tile.svelte-8xu1pt {display:flex;flex-direction:column;justify-content:space-between;align-items:center;width:100%;min-height:var(--mpb-choice-tile-min-height, 11rem);padding:0.8rem 0.65rem 0.5rem;border-radius:8px;background:transparent;transition:background-color 120ms ease-in-out;}.choice-tile-content.svelte-8xu1pt {width:100%;display:flex;align-items:center;justify-content:center;min-height:var(--mpb-choice-content-min-height, 7.5rem);}.choice-row-horizontal.svelte-8xu1pt:hover .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-hover-bg, var(--pie-background-dark, #ecedf1));}.pie-choice-horizontal.svelte-8xu1pt:not(.is-selected):not(:hover) .pie-choice-tile:where(.svelte-8xu1pt) {background:transparent;}.choice-row-horizontal.is-selected.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-selected-bg, var(--pie-secondary-background, rgba(241, 241, 241, 1)));}.choice-row-horizontal.is-selected.svelte-8xu1pt:hover .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-selected-bg, var(--pie-secondary-background, rgba(241, 241, 241, 1)));}.pie-choice.svelte-8xu1pt:not(.pie-choice-horizontal):hover .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-background-dark, #ecedf1);}.pie-choice.svelte-8xu1pt:not(.pie-choice-horizontal):not(.is-selected):not(:hover) .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:transparent;}.pie-choice:not(.pie-choice-horizontal).is-selected.svelte-8xu1pt .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-secondary-background, rgba(241, 241, 241, 1));border-radius:6px;}.pie-choice:not(.pie-choice-horizontal).is-selected.svelte-8xu1pt:hover .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-secondary-background, rgba(241, 241, 241, 1));}.pie-choice.choice-correct.svelte-8xu1pt {border-left:3px solid var(--pie-correct-tertiary, #0ea449);}.pie-choice.choice-incorrect.svelte-8xu1pt {border-left:3px solid var(--pie-incorrect-icon, #bf0d00);}.pie-choice-horizontal.choice-correct.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--pie-correct-secondary, #e8f5e9);}.pie-choice-horizontal.choice-incorrect.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--pie-incorrect-secondary, #ffebee);}.pie-choice-feedback-badge.svelte-8xu1pt {margin-left:auto;display:inline-flex;align-items:center;justify-content:center;width:1.1rem;height:1.1rem;border-radius:9999px;font-size:0.72rem;line-height:1;font-weight:700;color:var(--pie-white, #ffffff);}.pie-choice-feedback-correct.svelte-8xu1pt {background:var(--pie-correct-icon, #087d38);}.pie-choice-feedback-incorrect.svelte-8xu1pt {background:var(--pie-incorrect-icon, #bf0d00);}.choice-row-horizontal.svelte-8xu1pt p {margin:0;text-align:center;}.choice-html.svelte-8xu1pt p {margin:0;}.choice-html.svelte-8xu1pt {width:100%;display:inline-flex;align-items:center;justify-content:center;text-align:center;}.choice-radio-bottom.svelte-8xu1pt {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);padding:var(--mpb-choice-radio-padding, 0px);}.choice-radio-inline.svelte-8xu1pt {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);}"
|
|
5687
|
+
code: ".choice-row-horizontal.svelte-8xu1pt {flex-direction:column;align-items:center;width:min(var(--mpb-choice-width-px, 170px), var(--mpb-choice-width-vw, 30vw));min-height:var(--mpb-choice-tile-min-height, 11rem);gap:0;}.choice-tile.svelte-8xu1pt {display:flex;flex-direction:column;justify-content:space-between;align-items:center;width:100%;min-height:var(--mpb-choice-tile-min-height, 11rem);padding:0.8rem 0.65rem 0.5rem;border-radius:8px;background:transparent;transition:background-color 120ms ease-in-out;}.choice-tile-content.svelte-8xu1pt {width:100%;display:flex;align-items:center;justify-content:center;min-height:var(--mpb-choice-content-min-height, 7.5rem);}.choice-row-horizontal.svelte-8xu1pt:hover .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-hover-bg, var(--pie-background-dark, #ecedf1));}.pie-choice-horizontal.svelte-8xu1pt:not(.is-selected):not(:hover) .pie-choice-tile:where(.svelte-8xu1pt) {background:transparent;}.choice-row-horizontal.is-selected.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-selected-bg, var(--pie-secondary-background, rgba(241, 241, 241, 1)));}.choice-row-horizontal.is-selected.svelte-8xu1pt:hover .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-selected-bg, var(--pie-secondary-background, rgba(241, 241, 241, 1)));}.pie-choice.svelte-8xu1pt:not(.pie-choice-horizontal):hover .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-background-dark, #ecedf1);}.pie-choice.svelte-8xu1pt:not(.pie-choice-horizontal):not(.is-selected):not(:hover) .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:transparent;}.pie-choice:not(.pie-choice-horizontal).is-selected.svelte-8xu1pt .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-secondary-background, rgba(241, 241, 241, 1));border-radius:6px;}.pie-choice:not(.pie-choice-horizontal).is-selected.svelte-8xu1pt:hover .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-secondary-background, rgba(241, 241, 241, 1));}.pie-choice.choice-correct.svelte-8xu1pt {border-left:3px solid var(--pie-correct-tertiary, #0ea449);}.pie-choice.choice-incorrect.svelte-8xu1pt {border-left:3px solid var(--pie-incorrect-icon, #bf0d00);}.pie-choice-horizontal.choice-correct.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--pie-correct-secondary, #e8f5e9);}.pie-choice-horizontal.choice-incorrect.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--pie-incorrect-secondary, #ffebee);}.pie-choice-feedback-badge.svelte-8xu1pt {margin-left:auto;display:inline-flex;align-items:center;justify-content:center;width:1.1rem;height:1.1rem;border-radius:9999px;font-size:0.72rem;line-height:1;font-weight:700;color:var(--pie-white, #ffffff);}.pie-choice-feedback-correct.svelte-8xu1pt {background:var(--pie-correct-icon, #087d38);}.pie-choice-feedback-incorrect.svelte-8xu1pt {background:var(--pie-incorrect-icon, #bf0d00);}.choice-row-horizontal.svelte-8xu1pt p {margin:0;text-align:center;}.choice-html.svelte-8xu1pt p {margin:0;}.choice-html.svelte-8xu1pt {width:100%;display:inline-flex;align-items:center;justify-content:center;text-align:center;}\n\n /* Choices carrying raw <img> markup in labelHtml (rather than the dedicated\n imageUrl/imageAlt fields) render unconstrained at their authored size\n otherwise — 3rd-party/CQT-sourced content is typically authored well above\n the platform's 150x150 content-element spec. Applies regardless of\n customType, unlike the r1-CQT-specific cqt-css overlays. See CONTOOL-3159. */.choice-html.svelte-8xu1pt img {width:150px;height:150px;}.choice-radio-bottom.svelte-8xu1pt {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);padding:var(--mpb-choice-radio-padding, 0px);}.choice-radio-inline.svelte-8xu1pt {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);}"
|
|
5625
5688
|
};
|
|
5626
5689
|
function ChoiceRow($$anchor, $$props) {
|
|
5627
5690
|
push($$props, true);
|
|
@@ -5692,7 +5755,7 @@ function ChoiceRow($$anchor, $$props) {
|
|
|
5692
5755
|
flushSync();
|
|
5693
5756
|
}
|
|
5694
5757
|
};
|
|
5695
|
-
var div =
|
|
5758
|
+
var div = root_6$1();
|
|
5696
5759
|
var node = child(div);
|
|
5697
5760
|
var consequent_1 = ($$anchor) => {
|
|
5698
5761
|
var label = root_2$1();
|
|
@@ -5731,13 +5794,13 @@ function ChoiceRow($$anchor, $$props) {
|
|
|
5731
5794
|
append($$anchor, label);
|
|
5732
5795
|
};
|
|
5733
5796
|
var alternate_2 = ($$anchor) => {
|
|
5734
|
-
var fragment =
|
|
5797
|
+
var fragment = root_4$1();
|
|
5735
5798
|
var input_1 = first_child(fragment);
|
|
5736
5799
|
remove_input_defaults(input_1);
|
|
5737
5800
|
var label_1 = sibling(input_1, 2);
|
|
5738
5801
|
var node_2 = child(label_1);
|
|
5739
5802
|
var consequent_2 = ($$anchor) => {
|
|
5740
|
-
var img_1 =
|
|
5803
|
+
var img_1 = root_3$1();
|
|
5741
5804
|
template_effect(() => {
|
|
5742
5805
|
set_attribute(img_1, "src", choice().imageUrl);
|
|
5743
5806
|
set_attribute(img_1, "alt", choice().imageAlt || `Choice ${choice().id}`);
|
|
@@ -5771,9 +5834,8 @@ function ChoiceRow($$anchor, $$props) {
|
|
|
5771
5834
|
});
|
|
5772
5835
|
var node_3 = sibling(node, 2);
|
|
5773
5836
|
var consequent_3 = ($$anchor) => {
|
|
5774
|
-
var span_3 =
|
|
5775
|
-
var text =
|
|
5776
|
-
reset(span_3);
|
|
5837
|
+
var span_3 = root_5$1();
|
|
5838
|
+
var text = only_child(span_3, true);
|
|
5777
5839
|
template_effect(() => {
|
|
5778
5840
|
set_class(span_3, 1, `pie-choice-feedback-badge ${correctness() === "correct" ? "pie-choice-feedback-correct" : "pie-choice-feedback-incorrect"}`, "svelte-8xu1pt");
|
|
5779
5841
|
set_text(text, correctness() === "correct" ? "✓" : "✕");
|
|
@@ -5868,8 +5930,8 @@ var DEFAULT_LAYOUT_LIMITS = {
|
|
|
5868
5930
|
horizontalChoiceWidthVw: 30,
|
|
5869
5931
|
horizontalChoiceTileMinHeightRem: 11,
|
|
5870
5932
|
horizontalChoiceContentMinHeightRem: 7.5,
|
|
5871
|
-
|
|
5872
|
-
|
|
5933
|
+
choiceImageMaxHeightRem: 9.375,
|
|
5934
|
+
choiceImageMaxWidthRem: 9.375,
|
|
5873
5935
|
listenButtonSizePx: 128,
|
|
5874
5936
|
stimulusMinColumnPx: 210,
|
|
5875
5937
|
textMinColumnPx: 260,
|
|
@@ -5940,8 +6002,8 @@ var CSS_VAR_SPEC = {
|
|
|
5940
6002
|
varName: "--mpb-choice-image-max-height",
|
|
5941
6003
|
unit: "rem"
|
|
5942
6004
|
},
|
|
5943
|
-
|
|
5944
|
-
varName: "--mpb-
|
|
6005
|
+
choiceImageMaxWidthRem: {
|
|
6006
|
+
varName: "--mpb-choice-image-max-width",
|
|
5945
6007
|
unit: "rem"
|
|
5946
6008
|
},
|
|
5947
6009
|
choiceGroupGapRem: {
|
|
@@ -6147,7 +6209,7 @@ function computeLegendText(params) {
|
|
|
6147
6209
|
}
|
|
6148
6210
|
//#endregion
|
|
6149
6211
|
//#region src/delivery/cqt-css/sel-r1-base.css?raw
|
|
6150
|
-
var sel_r1_base_default = "/* Shared base styles for all sel_r1-*_plusggg variants.\n Applied via the data-mpb-variant=\"sel-r1-base\" style element.\n Uses [class*=\"variant-sel-r1-\"] so it covers every r1 variant class.\n Source: web-ItemBankViewer/learnosity/templates/Renaissance/r1.scss */\n\n/* r1.scss: Starial font throughout.\n font-size 14px mirrors the Learnosity host root (.lrn_widget) which sets the\n base for all em-scaled rules in r1.scss (e.g. .rli-r1-content-element { 1.9em })\n and any em-based author content (e.g. <span style=\"font-size:1.8em\">). Without\n this base PIE inherits the 16px browser default and renders ~14% larger than\n the LSY reference. See CONTOOL-2567. */\n[class*=\"variant-sel-r1-\"] {\n font-family: Starial, Arial, sans-serif;\n font-size: 14px;\n}\n\n/* r1.scss: .rli-r1-audio-transcript { font-family:Roboto; font-size:16px } */\n[class*=\"variant-sel-r1-\"] .pie-audio-transcript {\n font-family: Roboto, Arial, sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n}\n\n/* r1.scss: .rli-r1-content-element { font-size: 1.9em } wraps all stem tokens.\n Makes inline font-size spans in the template multiply on top of this base. */\n[class*=\"variant-sel-r1-\"] .pie-template-line {\n font-size: 1.9em;\n}\n\n/* r1.scss: .rli-r1-stem { display:flex; flex-direction:row; justify-content:center }\n r1.scss: .rli-r1-content-element { margin-right:2px; margin-left:2px } — 4px total gap.\n Apply the per-element margin to both classless tokens and the blank slot\n (which is the cloze equivalent) so the gap stacks with whitespace text-nodes\n between flex items the same way LSY does. Earlier this used column-gap:4px,\n but flex column-gap accumulates with the cloze-side mx-1 and the implicit\n whitespace, producing a wider gap than LSY shows. See CONTOOL-2569. */\n[class*=\"variant-sel-r1-\"] .pie-template-line {\n display: flex;\n flex-direction: row;\n align-items: baseline;\n justify-content: center;\n}\n\n[class*=\"variant-sel-r1-\"] .pie-template-line p {\n margin: 0;\n display: flex;\n flex-direction: row;\n align-items: baseline;\n}\n\n/* r1.scss: .rli-r1-content-element { min-width:150px; max-width:150px; min-height:150px;\n line-height:89px; margin-right:2px; margin-left:2px } — wraps every stem token\n (blank slot and adjacent inline spans) in LSY, giving each a 150px box with a\n 2px per-side margin. Apply to inline tokens in all r1 variants so trailing\n tokens in audio_blank_only (gplusggg) match the blank's height the way LSY does. */\n[class*=\"variant-sel-r1-\"] .pie-template-line span:not([class]) {\n min-width: 150px;\n max-width: 150px;\n min-height: 150px;\n line-height: 89px;\n margin-left: 2px;\n margin-right: 2px;\n}\n\n/* In token_sequence layouts the blank itself is also a content-element box (no\n surrounding .rli-r1-cloze container at 160px). audio_blank_only / stimulus_image_blank\n keep their own 160px min-height set on the blank slot in McPopulatedBlank.svelte to\n mirror LSY's .rli-r1-cloze height. The 2px per-side margin matches LSY's\n .rli-r1-content-element pattern (overriding the default Tailwind mx-1). */\n[class*=\"variant-sel-r1-\"].layout-token_sequence .pie-template-line .pie-blank-slot {\n min-width: 150px;\n max-width: 150px;\n min-height:
|
|
6212
|
+
var sel_r1_base_default = "/* Shared base styles for all sel_r1-*_plusggg variants.\n Applied via the data-mpb-variant=\"sel-r1-base\" style element.\n Uses [class*=\"variant-sel-r1-\"] so it covers every r1 variant class.\n Source: web-ItemBankViewer/learnosity/templates/Renaissance/r1.scss */\n\n/* r1.scss: Starial font throughout.\n font-size 14px mirrors the Learnosity host root (.lrn_widget) which sets the\n base for all em-scaled rules in r1.scss (e.g. .rli-r1-content-element { 1.9em })\n and any em-based author content (e.g. <span style=\"font-size:1.8em\">). Without\n this base PIE inherits the 16px browser default and renders ~14% larger than\n the LSY reference. See CONTOOL-2567. */\n[class*=\"variant-sel-r1-\"] {\n font-family: Starial, Arial, sans-serif;\n font-size: 14px;\n}\n\n/* r1.scss: .rli-r1-audio-transcript { font-family:Roboto; font-size:16px } */\n[class*=\"variant-sel-r1-\"] .pie-audio-transcript {\n font-family: Roboto, Arial, sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n}\n\n/* r1.scss: .rli-r1-content-element { font-size: 1.9em } wraps all stem tokens.\n Makes inline font-size spans in the template multiply on top of this base. */\n[class*=\"variant-sel-r1-\"] .pie-template-line {\n font-size: 1.9em;\n}\n\n/* r1.scss: .rli-r1-stem { display:flex; flex-direction:row; justify-content:center }\n r1.scss: .rli-r1-content-element { margin-right:2px; margin-left:2px } — 4px total gap.\n Apply the per-element margin to both classless tokens and the blank slot\n (which is the cloze equivalent) so the gap stacks with whitespace text-nodes\n between flex items the same way LSY does. Earlier this used column-gap:4px,\n but flex column-gap accumulates with the cloze-side mx-1 and the implicit\n whitespace, producing a wider gap than LSY shows. See CONTOOL-2569. */\n[class*=\"variant-sel-r1-\"] .pie-template-line {\n display: flex;\n flex-direction: row;\n align-items: baseline;\n justify-content: center;\n}\n\n[class*=\"variant-sel-r1-\"] .pie-template-line p {\n margin: 0;\n display: flex;\n flex-direction: row;\n align-items: baseline;\n}\n\n/* r1.scss: .rli-r1-content-element { min-width:150px; max-width:150px; min-height:150px;\n line-height:89px; margin-right:2px; margin-left:2px } — wraps every stem token\n (blank slot and adjacent inline spans) in LSY, giving each a 150px box with a\n 2px per-side margin. Apply to inline tokens in all r1 variants so trailing\n tokens in audio_blank_only (gplusggg) match the blank's height the way LSY does. */\n[class*=\"variant-sel-r1-\"] .pie-template-line span:not([class]) {\n min-width: 150px;\n max-width: 150px;\n min-height: 150px;\n line-height: 89px;\n margin-left: 2px;\n margin-right: 2px;\n}\n\n/* .pie-template-line's align-items:baseline (above) computes a shared baseline\n across all its flex items. .pie-blank-slot has no baseline-participating child\n of its own (.cloze-marker centers internally, align-items:center) — so it\n contributes a *synthesized* baseline back to the row, based on its own box\n geometry. That geometry swings wildly depending on the blank's content: an\n empty placeholder vs. a selected choice's image (up to 150x150). Every time a\n choice is selected the row's shared baseline is recomputed from that new\n geometry, visibly shifting sibling tokens like a leading/trailing stem word.\n align-self removes the blank from that shared computation entirely — its\n siblings' position no longer depends on what's currently displayed inside it.\n See CONTOOL-3159. */\n[class*=\"variant-sel-r1-\"] .pie-template-line .pie-blank-slot {\n align-self: flex-end;\n}\n\n/* In token_sequence layouts the blank itself is also a content-element box (no\n surrounding .rli-r1-cloze container at 160px). audio_blank_only / stimulus_image_blank\n keep their own 160px min-height set on the blank slot in McPopulatedBlank.svelte to\n mirror LSY's .rli-r1-cloze height. The 2px per-side margin matches LSY's\n .rli-r1-content-element pattern (overriding the default Tailwind mx-1).\n .pie-blank-slot is box-sizing:border-box with a permanent 6px border-bottom\n (the underline) — min-height:150px therefore only leaves 144px for content,\n so an empty blank (content ~0px, clamped to the 150px floor) and a blank\n showing a 150px choice image (150 + 6 border = 156px, exceeding the floor)\n render at two different total heights. Since .pie-blank-slot is bottom-anchored\n in its row (align-self:flex-end above), that 6px height difference shows up as\n a visible shift of the blank/image every time a choice is selected or cleared.\n min-height:156px keeps the total box height constant regardless of content, so\n the 150px is fully available to the image/text and the border no longer\n competes with it. See CONTOOL-3159. */\n[class*=\"variant-sel-r1-\"].layout-token_sequence .pie-template-line .pie-blank-slot {\n min-width: 150px;\n max-width: 150px;\n min-height: 156px;\n line-height: 89px;\n margin-left: 2px;\n margin-right: 2px;\n}\n\n/* audio_blank_only / stimulus_image_blank keep the 160px wide blank slot, but\n still need the 2px per-side margin so the gap to the trailing token mirrors\n LSY's .rli-r1-content-element rhythm. Without this, Tailwind's mx-1 (4px)\n would dominate and the cloze→token gap diverges from LSY. See CONTOOL-2569. */\n[class*=\"variant-sel-r1-\"].layout-audio_blank_only .pie-template-line .pie-blank-slot,\n[class*=\"variant-sel-r1-\"].layout-stimulus_image_blank .pie-template-line .pie-blank-slot {\n margin-left: 2px;\n margin-right: 2px;\n}\n\n/* The `.pie-template-line span:not([class])` rule above has no depth limit, so it\n also matches the unclassed answer <span> ClozeMarker.svelte renders inside\n .pie-blank-value once a choice is selected (e.g. author font-size overrides like\n <span style=\"font-size:3em\">). For token_sequence that coincides with the blank\n slot's own 150px/89px box above, so outer and inner agree. audio_blank_only /\n stimulus_image_blank instead keep .pie-blank-slot at LSY's separate, taller\n .rli-r1-cloze box (160px) — forcing the answer span into the stem token's\n 150px/89px box there is wrong: a plain (non-flex) span whose min-height exceeds\n its line-height renders that line top-anchored, pinning the answer text to the\n top of the blank with the rest of the box empty beneath it, instead of centered\n on the underline the way LSY renders it. See CONTOOL-3159. */\n[class*=\"variant-sel-r1-\"].layout-audio_blank_only .pie-blank-value span:not([class]),\n[class*=\"variant-sel-r1-\"].layout-stimulus_image_blank .pie-blank-value span:not([class]) {\n min-width: 0;\n max-width: none;\n min-height: 0;\n line-height: normal;\n margin-left: 0;\n margin-right: 0;\n}\n\n/* r1.scss: .rli-r1-content-element { font-size:1.9em; line-height:89px } on distractors */\n[class*=\"variant-sel-r1-\"] .pie-choice-label {\n font-size: 1.9em;\n line-height: 89px;\n}\n\n/* r1.scss: .rli-r1-content-element { min-width:150px; max-width:150px;\n min-height:150px } wraps every image (stem token + distractor) and forces\n the content box to 150×150. LSY's host also rewrites <img width/height>\n to 150 server-side. PIE keeps the authored attributes (typically 108×108),\n so without an explicit override images render ~28% smaller than LSY.\n See CONTOOL-2570. */\n[class*=\"variant-sel-r1-\"] .pie-template-line img,\n[class*=\"variant-sel-r1-\"] .pie-choice-label img {\n width: 150px;\n height: 150px;\n}\n";
|
|
6151
6213
|
//#endregion
|
|
6152
6214
|
//#region src/delivery/variant-css-map.ts
|
|
6153
6215
|
var VARIANT_BY_CUSTOM_TYPE = {
|
|
@@ -6197,7 +6259,7 @@ var VARIANT_BY_CUSTOM_TYPE = {
|
|
|
6197
6259
|
variantId: "sel-r1-s3",
|
|
6198
6260
|
variantClass: "variant-sel-r1-s3",
|
|
6199
6261
|
sourceUrl: "https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-s3_plusggg/0.0.1/question.css",
|
|
6200
|
-
cssText: "/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-s3_plusggg/0.0.1/question.css */\n/* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */\n.mc-populated-blank-root.variant-sel-r1-s3 {\n max-width: 860px;\n margin-inline: auto;\n --mpb-listen-button-size: 128px;\n --mpb-choice-width-px: 155px;\n --mpb-choice-tile-min-height: 11.25rem;\n --mpb-choice-content-min-height: 9.375rem;\n --mpb-choice-group-gap: 0.35rem;\n --mpb-choice-row-gap: 0.35rem;\n --mpb-horizontal-choice-radio-top-margin: 0.25rem;\n --mpb-stimulus-min-column: 240px;\n --mpb-stimulus-grid-column-gap: 1.1rem;\n --mpb-stimulus-choices-margin-top: 0.85rem;\n --mpb-audio-blank-template-margin-bottom: 0.9rem;\n --mpb-blank-wide-width: 6.8rem;\n}\n\n/* sel_r1-s3_plusggg/question.css does not set font-weight on distractors or\n cloze content-element, so they inherit 400 from the host root. The earlier\n font-weight:500 override caused PIE to render visibly heavier than LSY for\n the same author content. See CONTOOL-2571. */\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-label,\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-label :is(span, p, div) {\n font-size: 1.9em;\n line-height: 89px;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-blank-value,\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-blank-value :is(span, p, div) {\n line-height: 1.1;\n white-space: nowrap;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal .pie-choice-tile {\n border-radius: 6px;\n background: #f1f1f1;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank {\n grid-template-columns: minmax(220px, auto) auto auto;\n grid-template-areas:\n \"transcript transcript transcript\"\n \"sentence template audio\"\n \"choices choices choices\";\n justify-content: center;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-template-line {\n grid-area: template;\n justify-self: center;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-sentence-line {\n justify-self: end;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-audio-container {\n justify-self: start;\n align-self: start;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-choices-fieldset {\n justify-self: center;\n width: fit-content;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-sentence-line img {\n max-width: 100%;\n height: auto;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal:hover .pie-choice-tile {\n background: #e2e2e2;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal.is-selected .pie-choice-tile,\n.mc-populated-blank-root.variant-sel-r1-s3\n .pie-choice-horizontal.is-selected:hover\n .pie-choice-tile {\n background: #fcfcd3;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal .pie-choice-radio {\n transform: scale(0.85);\n}\n"
|
|
6262
|
+
cssText: "/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-s3_plusggg/0.0.1/question.css */\n/* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */\n.mc-populated-blank-root.variant-sel-r1-s3 {\n max-width: 860px;\n margin-inline: auto;\n --mpb-listen-button-size: 128px;\n --mpb-choice-width-px: 155px;\n --mpb-choice-tile-min-height: 11.25rem;\n --mpb-choice-content-min-height: 9.375rem;\n --mpb-choice-group-gap: 0.35rem;\n --mpb-choice-row-gap: 0.35rem;\n --mpb-horizontal-choice-radio-top-margin: 0.25rem;\n --mpb-stimulus-min-column: 240px;\n --mpb-stimulus-grid-column-gap: 1.1rem;\n --mpb-stimulus-choices-margin-top: 0.85rem;\n --mpb-audio-blank-template-margin-bottom: 0.9rem;\n --mpb-blank-wide-width: 6.8rem;\n}\n\n/* sel_r1-s3_plusggg/question.css does not set font-weight on distractors or\n cloze content-element, so they inherit 400 from the host root. The earlier\n font-weight:500 override caused PIE to render visibly heavier than LSY for\n the same author content. See CONTOOL-2571. */\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-label,\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-label :is(span, p, div) {\n font-size: 1.9em;\n line-height: 89px;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-blank-value,\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-blank-value :is(span, p, div) {\n line-height: 1.1;\n white-space: nowrap;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal .pie-choice-tile {\n border-radius: 6px;\n background: #f1f1f1;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank {\n grid-template-columns: minmax(220px, auto) auto auto;\n grid-template-areas:\n \"transcript transcript transcript\"\n \"sentence template audio\"\n \"choices choices choices\";\n justify-content: center;\n /* question.css: .rli-s3-cloze-container { justify-content:end } bottom-anchors\n the cloze against the shared sentence/audio row instead of top-aligning it —\n matches every item sitting on the same visual baseline. See CONTOOL-3159. */\n align-items: end;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-template-line {\n grid-area: template;\n justify-self: center;\n}\n\n/* ClozeMarker.svelte's shared .cloze-marker rule vertically *centers* its content\n (align-items:center). question.css's .rli-s3-cloze-container uses\n justify-content:end instead, bottom-anchoring the answer text against the\n underline. Centering leaves it floating well above both the underline and the\n sentence image's own (bottom-anchored) baseline. The blank's own box height\n (160px, from McPopulatedBlank.svelte's shared audio_blank_only/stimulus_image_blank\n rule) is left as-is — it already matches the Learnosity reference (~161px)\n closely; only the internal alignment was wrong. See CONTOOL-3159. */\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-blank-slot {\n align-items: flex-end;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-sentence-line {\n justify-self: end;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-audio-container {\n justify-self: start;\n align-self: start;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-choices-fieldset {\n justify-self: center;\n width: fit-content;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-sentence-line img {\n max-width: 100%;\n height: auto;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal:hover .pie-choice-tile {\n background: #e2e2e2;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal.is-selected .pie-choice-tile,\n.mc-populated-blank-root.variant-sel-r1-s3\n .pie-choice-horizontal.is-selected:hover\n .pie-choice-tile {\n background: #fcfcd3;\n}\n\n.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal .pie-choice-radio {\n transform: scale(0.85);\n}\n"
|
|
6201
6263
|
}
|
|
6202
6264
|
};
|
|
6203
6265
|
var normalizeCustomType = (value) => {
|
|
@@ -6243,7 +6305,7 @@ var root_3 = /* @__PURE__ */ from_html(`<div class="pie-correct-answer-toggle-ro
|
|
|
6243
6305
|
var root_4 = /* @__PURE__ */ from_html(`<div class="mb-3 prose prose-p:my-1 sentence-line pie-sentence-line svelte-6wlbb4"></div>`);
|
|
6244
6306
|
var root_5 = /* @__PURE__ */ from_html(`<div class="mb-4 template-line pie-template-line svelte-6wlbb4"><!><!><!></div>`);
|
|
6245
6307
|
var root_6 = /* @__PURE__ */ from_html(`<p class="sr-only pie-result-feedback svelte-6wlbb4" role="status" aria-live="polite"> </p>`);
|
|
6246
|
-
var root_7 = /* @__PURE__ */ from_html(`<div><!> <!> <!> <!> <!> <!> <fieldset class="border-0 p-0 m-0 pie-choices-fieldset svelte-6wlbb4"><legend class="sr-only pie-choices-legend svelte-6wlbb4"> </legend> <div style="gap:var(--mpb-choice-group-gap, 0.5rem);" role="radiogroup" tabindex="-1"></div></fieldset></div>`);
|
|
6308
|
+
var root_7 = /* @__PURE__ */ from_html(`<div><!> <!> <!> <!> <!> <!> <p class="sr-only pie-blank-hint svelte-6wlbb4"> </p> <fieldset class="border-0 p-0 m-0 pie-choices-fieldset svelte-6wlbb4"><legend class="sr-only pie-choices-legend svelte-6wlbb4"> </legend> <div style="gap:var(--mpb-choice-group-gap, 0.5rem);" role="radiogroup" tabindex="-1"></div></fieldset></div>`);
|
|
6247
6309
|
var $$css = {
|
|
6248
6310
|
hash: "svelte-6wlbb4",
|
|
6249
6311
|
code: ".sr-only.svelte-6wlbb4 {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}.mc-populated-blank-root.svelte-6wlbb4 {--mpb-focus-ring: var(\n --pie-focus-outline,\n var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565c0))\n );}.mc-populated-blank-root.svelte-6wlbb4 .prose {max-width:none;}.pie-toggle-correct-answer.svelte-6wlbb4 {width:100%;cursor:pointer;border:0;background:transparent;padding:0;display:flex;justify-content:center;text-align:center;color:var(--pie-text, black);}.pie-correct-answer-toggle-row.svelte-6wlbb4 {width:100%;display:flex;justify-content:flex-end;}.pie-correct-answer-toggle-content.svelte-6wlbb4 {display:flex;margin:0 auto;align-items:center;}.pie-correct-answer-toggle-icon-holder.svelte-6wlbb4 {width:25px;margin-right:5px;display:inline-flex;align-items:center;justify-content:center;}.pie-correct-answer-toggle-svg.svelte-6wlbb4 {width:25px;height:25px;}.pie-correct-answer-toggle-label.svelte-6wlbb4 {width:fit-content;min-width:140px;align-self:center;vertical-align:middle;font-weight:400;user-select:none;}.pie-toggle-correct-answer.svelte-6wlbb4:hover .pie-correct-answer-toggle-label:where(.svelte-6wlbb4),\n .pie-toggle-correct-answer.svelte-6wlbb4:focus-visible .pie-correct-answer-toggle-label:where(.svelte-6wlbb4) {text-decoration:underline;}.template-line.svelte-6wlbb4 {white-space:pre-wrap;}.template-line.svelte-6wlbb4 p {margin:0;display:inline;}.layout-audio_blank_only.svelte-6wlbb4 .pie-audio-container,\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-audio-container {display:flex;width:min(100%, var(--mpb-audio-instructions-max-width, 875px));margin-left:auto;margin-right:auto;justify-content:flex-end;}.layout-audio_blank_only.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {text-align:center;margin:var(--mpb-audio-blank-template-margin-top, 0.8rem) 0\n var(--mpb-audio-blank-template-margin-bottom, 1.8rem);}.layout-audio_blank_only.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {display:flex;justify-content:center;}.layout-audio_blank_only.svelte-6wlbb4 .pie-blank-slot,\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-blank-slot {width:var(--mpb-blank-wide-width, 10rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 6px);min-height:160px;padding-bottom:4px;}.layout-stimulus_image_blank.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-stimulus-min-column, 210px), 1fr) auto;grid-template-areas:'sentence audio'\n '. template'\n 'choices choices';column-gap:var(--mpb-stimulus-grid-column-gap, 2rem);row-gap:var(--mpb-stimulus-grid-row-gap, 0.7rem);align-items:start;}.layout-stimulus_image_blank.svelte-6wlbb4 .pie-audio-container {grid-area:audio;margin:0;}.layout-stimulus_image_blank.svelte-6wlbb4 .sentence-line:where(.svelte-6wlbb4) {grid-area:sentence;margin:var(--mpb-stimulus-sentence-margin-top, 0.2rem) 0 0;}.layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:0;text-align:center;justify-self:center;}.layout-stimulus_image_blank.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-stimulus-choices-margin-top, 0.9rem);}.layout-token_sequence.svelte-6wlbb4 {display:grid;grid-template-columns:1fr auto;grid-template-areas:'audio audio'\n 'template template'\n 'choices choices';column-gap:var(--mpb-token-grid-column-gap, 1.5rem);row-gap:var(--mpb-token-grid-row-gap, 0.8rem);align-items:start;}.layout-token_sequence.svelte-6wlbb4 .pie-audio-container {grid-area:audio;margin:0;justify-self:end;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-token-template-margin-top, 0.6rem) 0 0;justify-self:center;text-align:center;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) span + span {margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 .pie-blank-slot {width:var(--mpb-blank-standalone-width, 7rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 4px);margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-token-choices-margin-top, 0.2rem);}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-text-min-column, 260px), 1fr) auto;grid-template-areas:'template audio'\n 'choices choices';column-gap:var(--mpb-inline-grid-column-gap, 1.5rem);row-gap:var(--mpb-inline-grid-row-gap, 0.65rem);align-items:start;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-audio-container {grid-area:audio;margin:0;justify-self:end;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-inline-template-margin-top, 0.45rem) 0 0;text-align:center;justify-self:center;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-inline-choices-margin-top, 0.25rem);}\n\n /* Match Learnosity responsive behavior for CQT audio-blank layouts:\n at smaller widths, audio control shifts left and answer tiles stack. */\n @media (max-width: 760px) {.layout-audio_blank_only.svelte-6wlbb4 .pie-audio-container,\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-audio-container,\n .layout-token_sequence.svelte-6wlbb4 .pie-audio-container,\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-audio-container {width:100%;margin-left:0;margin-right:0;justify-content:flex-start;justify-self:start;}.layout-audio_blank_only.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4) {flex-direction:column;align-items:flex-start;justify-content:flex-start;}.layout-audio_blank_only.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4) {width:min(100%, var(--mpb-narrow-choice-max-width, 230px));align-items:flex-start;}\n }"
|
|
@@ -6255,6 +6317,7 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
6255
6317
|
const DEFAULT_UI_TEXT = {
|
|
6256
6318
|
answerChoices: "Answer choices",
|
|
6257
6319
|
selectedAnswerInSentence: "Selected answer in sentence",
|
|
6320
|
+
blankPreSelectionHint: "The answer you choose will appear on the blank line above.",
|
|
6258
6321
|
showCorrectAnswer: "Show correct answer",
|
|
6259
6322
|
hideCorrectAnswer: "Hide correct answer",
|
|
6260
6323
|
clickToEnableAutoplay: "Click to enable audio autoplay",
|
|
@@ -6327,6 +6390,7 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
6327
6390
|
const promptId = /* @__PURE__ */ user_derived(() => `${instanceId}-prompt`);
|
|
6328
6391
|
const legendId = /* @__PURE__ */ user_derived(() => `${instanceId}-choices-legend`);
|
|
6329
6392
|
const resultId = /* @__PURE__ */ user_derived(() => `${instanceId}-result`);
|
|
6393
|
+
const blankHintId = /* @__PURE__ */ user_derived(() => `${instanceId}-blank-hint`);
|
|
6330
6394
|
const legendText = /* @__PURE__ */ user_derived(() => computeLegendText({
|
|
6331
6395
|
prompt: model()?.prompt || "",
|
|
6332
6396
|
legendMaxChars: get(layout).legendMaxChars,
|
|
@@ -6497,9 +6561,7 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
6497
6561
|
else $$render(alternate, -1);
|
|
6498
6562
|
});
|
|
6499
6563
|
reset(span_1);
|
|
6500
|
-
var
|
|
6501
|
-
var text = child(span_2, true);
|
|
6502
|
-
reset(span_2);
|
|
6564
|
+
var text = only_child(sibling(span_1, 2), true);
|
|
6503
6565
|
reset(span);
|
|
6504
6566
|
reset(button);
|
|
6505
6567
|
bind_this(button, ($$value) => set(toggleCorrectAnswerButtonEl, $$value), () => get(toggleCorrectAnswerButtonEl));
|
|
@@ -6596,8 +6658,7 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
6596
6658
|
var node_9 = sibling(node_5, 2);
|
|
6597
6659
|
var consequent_5 = ($$anchor) => {
|
|
6598
6660
|
var p = root_6();
|
|
6599
|
-
var text_1 =
|
|
6600
|
-
reset(p);
|
|
6661
|
+
var text_1 = only_child(p, true);
|
|
6601
6662
|
template_effect(() => {
|
|
6602
6663
|
set_attribute(p, "id", get(resultId));
|
|
6603
6664
|
set_text(text_1, get(resultText));
|
|
@@ -6607,10 +6668,11 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
6607
6668
|
if_block(node_9, ($$render) => {
|
|
6608
6669
|
if (get(resultText)) $$render(consequent_5);
|
|
6609
6670
|
});
|
|
6610
|
-
var
|
|
6671
|
+
var p_1 = sibling(node_9, 2);
|
|
6672
|
+
var text_2 = only_child(p_1, true);
|
|
6673
|
+
var fieldset = sibling(p_1, 2);
|
|
6611
6674
|
var legend = child(fieldset);
|
|
6612
|
-
var
|
|
6613
|
-
reset(legend);
|
|
6675
|
+
var text_3 = only_child(legend, true);
|
|
6614
6676
|
var div_5 = sibling(legend, 2);
|
|
6615
6677
|
each(div_5, 21, () => get(choices), (c) => c.id, ($$anchor, c) => {
|
|
6616
6678
|
{
|
|
@@ -6653,18 +6715,20 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
6653
6715
|
reset(fieldset);
|
|
6654
6716
|
reset(div);
|
|
6655
6717
|
bind_this(div, ($$value) => set(rootEl, $$value), () => get(rootEl));
|
|
6656
|
-
template_effect(() => {
|
|
6718
|
+
template_effect(($0) => {
|
|
6657
6719
|
set_class(div, 1, `p-4 mc-populated-blank-root pie-element pie-element-mc-populated-blank pie-delivery-root layout-${get(layoutProfile)} ${get(variantRootClass)} ${get(hasInlineSentenceAudioLayout) ? "has-inline-audio" : ""}`, "svelte-6wlbb4");
|
|
6658
6720
|
set_attribute(div, "lang", get(lang));
|
|
6659
6721
|
set_style(div, get(layout).rootStyle);
|
|
6722
|
+
set_attribute(p_1, "id", get(blankHintId));
|
|
6723
|
+
set_text(text_2, get(uiText).blankPreSelectionHint);
|
|
6660
6724
|
fieldset.disabled = model()?.disabled;
|
|
6661
6725
|
set_attribute(legend, "id", get(legendId));
|
|
6662
|
-
set_text(
|
|
6726
|
+
set_text(text_3, get(legendText));
|
|
6663
6727
|
set_class(div_5, 1, `pie-choices ${get(isHorizontalChoices) ? "flex flex-row flex-wrap items-start justify-center" : "flex flex-col"}`, "svelte-6wlbb4");
|
|
6664
6728
|
set_attribute(div_5, "aria-labelledby", get(choicesGroupLabelledBy));
|
|
6665
6729
|
set_attribute(div_5, "aria-label", get(choicesGroupAriaLabel));
|
|
6666
|
-
set_attribute(div_5, "aria-describedby",
|
|
6667
|
-
});
|
|
6730
|
+
set_attribute(div_5, "aria-describedby", $0);
|
|
6731
|
+
}, [() => [get(blankHintId), get(resultText) ? get(resultId) : void 0].filter(Boolean).join(" ")]);
|
|
6668
6732
|
append($$anchor, div);
|
|
6669
6733
|
return pop($$exports);
|
|
6670
6734
|
}
|