@but212/atom-effect-jquery 0.13.1 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/dist/atom-effect-jquery.min.js +1 -1
- package/dist/atom-effect-jquery.min.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.mjs +1020 -1124
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,37 +1,34 @@
|
|
|
1
|
-
import
|
|
1
|
+
import h from "jquery";
|
|
2
2
|
import { default as wt } from "jquery";
|
|
3
|
-
const
|
|
3
|
+
const He = {
|
|
4
4
|
/** One second in milliseconds */
|
|
5
5
|
ONE_SECOND_MS: 1e3
|
|
6
|
-
},
|
|
6
|
+
}, ue = {
|
|
7
7
|
IDLE: "idle",
|
|
8
8
|
PENDING: "pending",
|
|
9
9
|
RESOLVED: "resolved",
|
|
10
10
|
REJECTED: "rejected"
|
|
11
|
-
},
|
|
11
|
+
}, v = {
|
|
12
12
|
DISPOSED: 1,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
HAS_FN_SUBS: 2,
|
|
14
|
+
HAS_OBJ_SUBS: 4
|
|
15
|
+
}, N = {
|
|
16
|
+
...v,
|
|
17
|
+
EXECUTING: 8
|
|
16
18
|
}, l = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
IDLE:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// 1000000 - Has error state
|
|
31
|
-
}, G = {
|
|
32
|
-
SYNC: 1,
|
|
33
|
-
NOTIFICATION_SCHEDULED: 2
|
|
34
|
-
}, q = {
|
|
19
|
+
...v,
|
|
20
|
+
DIRTY: 8,
|
|
21
|
+
IDLE: 16,
|
|
22
|
+
PENDING: 32,
|
|
23
|
+
RESOLVED: 64,
|
|
24
|
+
REJECTED: 128,
|
|
25
|
+
RECOMPUTING: 256,
|
|
26
|
+
HAS_ERROR: 512
|
|
27
|
+
}, F = {
|
|
28
|
+
...v,
|
|
29
|
+
SYNC: 8,
|
|
30
|
+
NOTIFICATION_SCHEDULED: 16
|
|
31
|
+
}, V = {
|
|
35
32
|
/** Maximum effect executions per second to detect infinite loops (Legacy/Fallback) */
|
|
36
33
|
MAX_EXECUTIONS_PER_SECOND: 1e3,
|
|
37
34
|
/**
|
|
@@ -47,55 +44,57 @@ const Be = {
|
|
|
47
44
|
/** Maximum iterations for synchronous flush loop to prevent infinite loops */
|
|
48
45
|
MAX_FLUSH_ITERATIONS: 1e3,
|
|
49
46
|
/** Minimum allowed value for max flush iterations */
|
|
50
|
-
MIN_FLUSH_ITERATIONS: 10
|
|
51
|
-
|
|
47
|
+
MIN_FLUSH_ITERATIONS: 10,
|
|
48
|
+
/** Threshold for shrinking the batch queue to assist GC */
|
|
49
|
+
BATCH_QUEUE_SHRINK_THRESHOLD: 1e3
|
|
50
|
+
}, De = {
|
|
52
51
|
/** Maximum dependencies before warning about large dependency graphs */
|
|
53
52
|
MAX_DEPENDENCIES: 1e3,
|
|
54
53
|
/** Enable infinite loop detection warnings */
|
|
55
54
|
WARN_INFINITE_LOOP: !0
|
|
56
|
-
},
|
|
57
|
-
class
|
|
55
|
+
}, A = 1073741823, Xe = 20, de = 1 << Xe - 1, x = typeof process < "u" && process.env && process.env.NODE_ENV !== "production", qe = Object.freeze([]);
|
|
56
|
+
class k extends Error {
|
|
58
57
|
/**
|
|
59
58
|
* Creates a new AtomError
|
|
60
59
|
* @param message - Error message describing what went wrong
|
|
61
60
|
* @param cause - Original error that caused this error
|
|
62
61
|
* @param recoverable - Whether the operation can be retried
|
|
63
62
|
*/
|
|
64
|
-
constructor(e,
|
|
65
|
-
super(e), this.name = "AtomError", this.cause =
|
|
63
|
+
constructor(e, t = null, n = !0) {
|
|
64
|
+
super(e), this.name = "AtomError", this.cause = t, this.recoverable = n, this.timestamp = /* @__PURE__ */ new Date();
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
|
-
class
|
|
67
|
+
class G extends k {
|
|
69
68
|
/**
|
|
70
69
|
* Creates a new ComputedError
|
|
71
70
|
* @param message - Error message
|
|
72
71
|
* @param cause - Original error
|
|
73
72
|
*/
|
|
74
|
-
constructor(e,
|
|
75
|
-
super(e,
|
|
73
|
+
constructor(e, t = null) {
|
|
74
|
+
super(e, t, !0), this.name = "ComputedError";
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
|
-
class
|
|
77
|
+
class Q extends k {
|
|
79
78
|
/**
|
|
80
79
|
* Creates a new EffectError
|
|
81
80
|
* @param message - Error message
|
|
82
81
|
* @param cause - Original error
|
|
83
82
|
*/
|
|
84
|
-
constructor(e,
|
|
85
|
-
super(e,
|
|
83
|
+
constructor(e, t = null) {
|
|
84
|
+
super(e, t, !1), this.name = "EffectError";
|
|
86
85
|
}
|
|
87
86
|
}
|
|
88
|
-
class
|
|
87
|
+
class ne extends k {
|
|
89
88
|
/**
|
|
90
89
|
* Creates a new SchedulerError
|
|
91
90
|
* @param message - Error message
|
|
92
91
|
* @param cause - Original error
|
|
93
92
|
*/
|
|
94
|
-
constructor(e,
|
|
95
|
-
super(e,
|
|
93
|
+
constructor(e, t = null) {
|
|
94
|
+
super(e, t, !1), this.name = "SchedulerError";
|
|
96
95
|
}
|
|
97
96
|
}
|
|
98
|
-
const
|
|
97
|
+
const m = {
|
|
99
98
|
// ─────────────────────────────────────────────────────────────────
|
|
100
99
|
// Computed errors
|
|
101
100
|
// ─────────────────────────────────────────────────────────────────
|
|
@@ -147,454 +146,413 @@ const b = {
|
|
|
147
146
|
* @remarks This prevents cascading failures from masking the original error.
|
|
148
147
|
*/
|
|
149
148
|
CALLBACK_ERROR_IN_ERROR_HANDLER: "Error occurred during onError callback execution"
|
|
150
|
-
},
|
|
151
|
-
function
|
|
152
|
-
return "dependencies" in
|
|
149
|
+
}, fe = /* @__PURE__ */ Symbol("debugName"), Qe = /* @__PURE__ */ Symbol("id"), _e = /* @__PURE__ */ Symbol("type"), Ce = /* @__PURE__ */ Symbol("noDefaultValue");
|
|
150
|
+
function Ge(s) {
|
|
151
|
+
return "dependencies" in s && Array.isArray(s.dependencies);
|
|
153
152
|
}
|
|
154
|
-
let
|
|
155
|
-
function
|
|
156
|
-
if (
|
|
157
|
-
if (
|
|
158
|
-
throw new
|
|
159
|
-
if (
|
|
160
|
-
const n =
|
|
153
|
+
let Ne = 0;
|
|
154
|
+
function Re(s, e, t) {
|
|
155
|
+
if (s._visitedEpoch !== t) {
|
|
156
|
+
if (s._visitedEpoch = t, s === e)
|
|
157
|
+
throw new G("Indirect circular dependency detected");
|
|
158
|
+
if (Ge(s)) {
|
|
159
|
+
const n = s.dependencies;
|
|
161
160
|
for (let i = 0; i < n.length; i++) {
|
|
162
|
-
const
|
|
163
|
-
|
|
161
|
+
const o = n[i];
|
|
162
|
+
o && Re(o, e, t);
|
|
164
163
|
}
|
|
165
164
|
}
|
|
166
165
|
}
|
|
167
166
|
}
|
|
168
|
-
const
|
|
167
|
+
const O = {
|
|
169
168
|
enabled: typeof process < "u" && process.env?.NODE_ENV === "development",
|
|
170
|
-
maxDependencies:
|
|
171
|
-
warnInfiniteLoop:
|
|
172
|
-
warn(
|
|
173
|
-
this.enabled &&
|
|
169
|
+
maxDependencies: De.MAX_DEPENDENCIES,
|
|
170
|
+
warnInfiniteLoop: De.WARN_INFINITE_LOOP,
|
|
171
|
+
warn(s, e) {
|
|
172
|
+
this.enabled && s && console.warn(`[Atom Effect] ${e}`);
|
|
174
173
|
},
|
|
175
174
|
/**
|
|
176
175
|
* Checks for circular dependencies.
|
|
177
176
|
* Direct check runs always; indirect check only in dev mode.
|
|
178
177
|
* @throws {ComputedError} When circular dependency detected
|
|
179
178
|
*/
|
|
180
|
-
checkCircular(
|
|
181
|
-
if (
|
|
182
|
-
throw new
|
|
183
|
-
this.enabled && (
|
|
179
|
+
checkCircular(s, e) {
|
|
180
|
+
if (s === e)
|
|
181
|
+
throw new G("Direct circular dependency detected");
|
|
182
|
+
this.enabled && (Ne++, Re(s, e, Ne));
|
|
184
183
|
},
|
|
185
|
-
attachDebugInfo(
|
|
184
|
+
attachDebugInfo(s, e, t) {
|
|
186
185
|
if (!this.enabled)
|
|
187
186
|
return;
|
|
188
|
-
const n =
|
|
189
|
-
n[
|
|
187
|
+
const n = s;
|
|
188
|
+
n[fe] = `${e}_${t}`, n[Qe] = t, n[_e] = e;
|
|
190
189
|
},
|
|
191
|
-
getDebugName(
|
|
192
|
-
if (
|
|
193
|
-
return
|
|
190
|
+
getDebugName(s) {
|
|
191
|
+
if (s != null && fe in s)
|
|
192
|
+
return s[fe];
|
|
194
193
|
},
|
|
195
|
-
getDebugType(
|
|
196
|
-
if (
|
|
197
|
-
return
|
|
194
|
+
getDebugType(s) {
|
|
195
|
+
if (s != null && _e in s)
|
|
196
|
+
return s[_e];
|
|
198
197
|
}
|
|
199
198
|
};
|
|
200
|
-
let
|
|
201
|
-
const
|
|
202
|
-
class
|
|
199
|
+
let Ye = 1;
|
|
200
|
+
const Je = () => Ye++;
|
|
201
|
+
class Ue {
|
|
203
202
|
constructor() {
|
|
204
|
-
this.flags = 0, this.version = 0, this._lastSeenEpoch = -1, this.id =
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Rotates the phase by 1, automatically incrementing cycle on overflow.
|
|
208
|
-
*
|
|
209
|
-
* Performance Benefits:
|
|
210
|
-
* - Branchless: No conditional statements
|
|
211
|
-
* - O(1): Single bitwise AND operation
|
|
212
|
-
* - Smi-safe: Result always within 30-bit range (0x3fffffff)
|
|
213
|
-
*
|
|
214
|
-
* When Phase reaches 0xfffff (1,048,575), the next increment:
|
|
215
|
-
* - Overflows into Cycle bits
|
|
216
|
-
* - Phase resets to 0
|
|
217
|
-
* - Cycle increments by 1
|
|
218
|
-
*
|
|
219
|
-
* @returns The new version after phase rotation
|
|
220
|
-
*/
|
|
221
|
-
rotatePhase() {
|
|
222
|
-
return this.version = this.version + 1 & F, this.version;
|
|
203
|
+
this.flags = 0, this.version = 0, this._lastSeenEpoch = -1, this._modifiedAtEpoch = -1, this._visitedEpoch = -1, this.id = Je() & A, this._tempUnsub = void 0;
|
|
223
204
|
}
|
|
224
205
|
/**
|
|
225
206
|
* Calculates the logical distance (shift) between current and cached version.
|
|
226
|
-
*
|
|
227
|
-
* Uses modular arithmetic to handle cycle wraparound correctly.
|
|
228
|
-
* The result represents how many phase rotations have occurred since
|
|
229
|
-
* the cached version was recorded.
|
|
230
|
-
*
|
|
231
|
-
* Performance Benefits:
|
|
232
|
-
* - Branchless: Single subtraction with mask
|
|
233
|
-
* - Handles wraparound: Works correctly even when version overflows
|
|
234
|
-
*
|
|
235
|
-
* Use Cases:
|
|
236
|
-
* - Scheduler priority: Large shifts indicate stale updates
|
|
237
|
-
* - Dependency staleness: Detect how outdated a cached value is
|
|
238
|
-
*
|
|
239
|
-
* @param cachedVersion - The previously cached version to compare against
|
|
240
|
-
* @returns Non-negative shift distance (0 to 0x3fffffff)
|
|
241
207
|
*/
|
|
242
208
|
getShift(e) {
|
|
243
|
-
return this.version - e &
|
|
209
|
+
return this.version - e & A;
|
|
244
210
|
}
|
|
245
211
|
}
|
|
246
|
-
class
|
|
212
|
+
class we extends Ue {
|
|
247
213
|
/**
|
|
248
214
|
* Subscribes a listener function or Subscriber object to value changes.
|
|
249
|
-
*
|
|
250
|
-
* @param listener - Function or Subscriber object to call when the value changes
|
|
251
|
-
* @returns An unsubscribe function
|
|
252
|
-
* @throws {AtomError} If listener is not a function or Subscriber
|
|
253
215
|
*/
|
|
254
216
|
subscribe(e) {
|
|
255
|
-
if (typeof e == "
|
|
256
|
-
return this._addSubscriber(
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
217
|
+
if (typeof e == "function")
|
|
218
|
+
return this._addSubscriber(
|
|
219
|
+
this._fnSubs,
|
|
220
|
+
e,
|
|
221
|
+
v.HAS_FN_SUBS
|
|
222
|
+
);
|
|
223
|
+
if (e !== null && typeof e == "object" && "execute" in e)
|
|
224
|
+
return this._addSubscriber(this._objSubs, e, v.HAS_OBJ_SUBS);
|
|
225
|
+
throw new k(m.ATOM_SUBSCRIBER_MUST_BE_FUNCTION);
|
|
260
226
|
}
|
|
261
227
|
/**
|
|
262
228
|
* Gets the total number of active subscribers.
|
|
263
229
|
*/
|
|
264
230
|
subscriberCount() {
|
|
265
|
-
return
|
|
231
|
+
return this._fnSubs.length + this._objSubs.length;
|
|
266
232
|
}
|
|
267
|
-
|
|
268
|
-
|
|
233
|
+
/**
|
|
234
|
+
* Adds a subscriber to the specified subscription list and returns an unsubscribe function.
|
|
235
|
+
* Uses swap-and-pop for efficient removals.
|
|
236
|
+
*/
|
|
237
|
+
_addSubscriber(e, t, n) {
|
|
238
|
+
if (e.indexOf(t) !== -1) return () => {
|
|
269
239
|
};
|
|
270
|
-
e.push(
|
|
271
|
-
let
|
|
240
|
+
e.push(t), this.flags |= n;
|
|
241
|
+
let i = !1;
|
|
272
242
|
return () => {
|
|
273
|
-
if (
|
|
274
|
-
|
|
275
|
-
const
|
|
276
|
-
if (
|
|
277
|
-
const r = e.
|
|
278
|
-
|
|
243
|
+
if (i) return;
|
|
244
|
+
i = !0;
|
|
245
|
+
const o = e.indexOf(t);
|
|
246
|
+
if (o !== -1) {
|
|
247
|
+
const r = e.pop();
|
|
248
|
+
o < e.length && (e[o] = r), this.flags &= ~(e.length === 0 ? n : 0);
|
|
279
249
|
}
|
|
280
250
|
};
|
|
281
251
|
}
|
|
282
252
|
/**
|
|
283
253
|
* Notifies all subscribers of a change.
|
|
284
|
-
*
|
|
285
|
-
* @param newValue - The new value
|
|
286
|
-
* @param oldValue - The old value
|
|
287
254
|
*/
|
|
288
|
-
_notifySubscribers(e,
|
|
289
|
-
const n = this.
|
|
290
|
-
if (n)
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
255
|
+
_notifySubscribers(e, t) {
|
|
256
|
+
const n = this.flags, i = v.HAS_FN_SUBS | v.HAS_OBJ_SUBS;
|
|
257
|
+
if (n & i) {
|
|
258
|
+
if (n & v.HAS_FN_SUBS) {
|
|
259
|
+
const o = this._fnSubs;
|
|
260
|
+
for (let r = 0, c = o.length; r < c; r++) {
|
|
261
|
+
const u = o[r];
|
|
262
|
+
if (u)
|
|
263
|
+
try {
|
|
264
|
+
u(e, t);
|
|
265
|
+
} catch (a) {
|
|
266
|
+
console.error(
|
|
267
|
+
new k(m.ATOM_INDIVIDUAL_SUBSCRIBER_FAILED, a)
|
|
268
|
+
);
|
|
269
|
+
}
|
|
299
270
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
271
|
+
}
|
|
272
|
+
if (n & v.HAS_OBJ_SUBS) {
|
|
273
|
+
const o = this._objSubs;
|
|
274
|
+
for (let r = 0, c = o.length; r < c; r++) {
|
|
275
|
+
const u = o[r];
|
|
276
|
+
if (u)
|
|
277
|
+
try {
|
|
278
|
+
u.execute();
|
|
279
|
+
} catch (a) {
|
|
280
|
+
console.error(
|
|
281
|
+
new k(m.ATOM_INDIVIDUAL_SUBSCRIBER_FAILED, a)
|
|
282
|
+
);
|
|
283
|
+
}
|
|
310
284
|
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
class Ke {
|
|
290
|
+
constructor() {
|
|
291
|
+
this.acquired = 0, this.released = 0, this.rejected = new We();
|
|
311
292
|
}
|
|
312
293
|
}
|
|
313
|
-
class
|
|
294
|
+
class We {
|
|
314
295
|
constructor() {
|
|
315
|
-
this.
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
296
|
+
this.frozen = 0, this.tooLarge = 0, this.poolFull = 0;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
class ge {
|
|
300
|
+
constructor() {
|
|
301
|
+
this.pool = [], this.maxPoolSize = 50, this.maxReusableCapacity = 256, this.stats = x ? new Ke() : null;
|
|
320
302
|
}
|
|
321
303
|
/** Acquires an array from the pool or creates a new one if the pool is empty. */
|
|
322
304
|
acquire() {
|
|
323
|
-
|
|
305
|
+
const e = this.stats;
|
|
306
|
+
return x && e && e.acquired++, this.pool.pop() ?? [];
|
|
324
307
|
}
|
|
325
308
|
/**
|
|
326
309
|
* Releases an array back to the pool.
|
|
327
310
|
* Clears the array before storing it.
|
|
328
|
-
* @param arr - The array to release.
|
|
329
|
-
* @param emptyConst - Optional reference to a constant empty array to skip.
|
|
330
311
|
*/
|
|
331
|
-
release(e,
|
|
332
|
-
if (
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}
|
|
337
|
-
if (e.length > this.maxReusableCapacity) {
|
|
338
|
-
C && this.stats && this.stats.rejected.tooLarge++;
|
|
339
|
-
return;
|
|
340
|
-
}
|
|
341
|
-
if (this.pool.length >= this.maxPoolSize) {
|
|
342
|
-
C && this.stats && this.stats.rejected.poolFull++;
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
e.length = 0, this.pool.push(e), C && this.stats && this.stats.released++;
|
|
312
|
+
release(e, t) {
|
|
313
|
+
if (t && e === t || Object.isFrozen(e)) {
|
|
314
|
+
const c = this.stats;
|
|
315
|
+
x && c && e !== t && c.rejected.frozen++;
|
|
316
|
+
return;
|
|
346
317
|
}
|
|
318
|
+
const n = e.length, i = this.pool, o = i.length;
|
|
319
|
+
if (n > this.maxReusableCapacity || o >= this.maxPoolSize) {
|
|
320
|
+
const c = this.stats;
|
|
321
|
+
x && c && (n > this.maxReusableCapacity ? c.rejected.tooLarge++ : c.rejected.poolFull++);
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
e.length = 0, i.push(e);
|
|
325
|
+
const r = this.stats;
|
|
326
|
+
x && r && r.released++;
|
|
347
327
|
}
|
|
348
328
|
/** Returns current stats for the pool (dev mode only). */
|
|
349
329
|
getStats() {
|
|
350
|
-
|
|
351
|
-
|
|
330
|
+
const e = this.stats;
|
|
331
|
+
if (!x || !e) return null;
|
|
332
|
+
const { acquired: t, released: n, rejected: i } = e, o = i.frozen + i.tooLarge + i.poolFull;
|
|
352
333
|
return {
|
|
353
|
-
acquired:
|
|
354
|
-
released:
|
|
355
|
-
rejected:
|
|
356
|
-
|
|
334
|
+
acquired: t,
|
|
335
|
+
released: n,
|
|
336
|
+
rejected: {
|
|
337
|
+
frozen: i.frozen,
|
|
338
|
+
tooLarge: i.tooLarge,
|
|
339
|
+
poolFull: i.poolFull
|
|
340
|
+
},
|
|
341
|
+
leaked: t - n - o,
|
|
357
342
|
poolSize: this.pool.length
|
|
358
343
|
};
|
|
359
344
|
}
|
|
360
345
|
/** Resets the pool and its stats. */
|
|
361
346
|
reset() {
|
|
362
|
-
this.pool.length = 0
|
|
347
|
+
this.pool.length = 0;
|
|
348
|
+
const e = this.stats;
|
|
349
|
+
x && e && (e.acquired = 0, e.released = 0, e.rejected.frozen = 0, e.rejected.tooLarge = 0, e.rejected.poolFull = 0);
|
|
363
350
|
}
|
|
364
351
|
}
|
|
365
|
-
const
|
|
366
|
-
function
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
if (v.enabled && (t == null || typeof t == "object")) {
|
|
371
|
-
const e = v.getDebugType(t);
|
|
372
|
-
if (e)
|
|
373
|
-
return e === "computed";
|
|
374
|
-
}
|
|
375
|
-
return _e(t) && "invalidate" in t && typeof t.invalidate == "function";
|
|
376
|
-
}
|
|
377
|
-
function Oe(t) {
|
|
378
|
-
return t != null && typeof t.then == "function";
|
|
379
|
-
}
|
|
380
|
-
function Ge(t) {
|
|
381
|
-
return typeof t == "object" && t !== null;
|
|
382
|
-
}
|
|
383
|
-
function Ye(t) {
|
|
384
|
-
return (typeof t == "object" || typeof t == "function") && t !== null && typeof t.addDependency == "function";
|
|
385
|
-
}
|
|
386
|
-
function Je(t) {
|
|
387
|
-
return typeof t == "function" && typeof t.addDependency != "function";
|
|
388
|
-
}
|
|
389
|
-
function Ke(t) {
|
|
390
|
-
return Ge(t) && typeof t.execute == "function";
|
|
391
|
-
}
|
|
392
|
-
function Ue(t, e, s, n) {
|
|
393
|
-
if (e) {
|
|
394
|
-
if (Ye(e)) {
|
|
395
|
-
e.addDependency(t);
|
|
352
|
+
const I = Object.freeze([]), B = Object.freeze([]), T = Object.freeze([]), j = new ge(), Y = new ge(), L = new ge();
|
|
353
|
+
function M(s, e, t, n) {
|
|
354
|
+
if (e != null) {
|
|
355
|
+
if ((typeof e == "object" || typeof e == "function") && typeof e.addDependency == "function") {
|
|
356
|
+
e.addDependency(s);
|
|
396
357
|
return;
|
|
397
358
|
}
|
|
398
|
-
if (
|
|
359
|
+
if (typeof e == "function") {
|
|
399
360
|
const i = e;
|
|
400
|
-
|
|
361
|
+
t.indexOf(i) === -1 && (t.push(i), s.flags |= v.HAS_FN_SUBS);
|
|
401
362
|
return;
|
|
402
363
|
}
|
|
403
|
-
|
|
364
|
+
typeof e == "object" && typeof e.execute == "function" && n.indexOf(e) === -1 && (n.push(e), s.flags |= v.HAS_OBJ_SUBS);
|
|
404
365
|
}
|
|
405
366
|
}
|
|
406
|
-
function
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
367
|
+
function Te(s, e, t, n) {
|
|
368
|
+
const i = s.length, o = e.length, r = e !== I && o > 0;
|
|
369
|
+
if (r)
|
|
370
|
+
for (let u = 0; u < o; u++) {
|
|
371
|
+
const a = e[u];
|
|
372
|
+
a && (a._tempUnsub = t[u]);
|
|
411
373
|
}
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
for (let
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
374
|
+
const c = Y.acquire();
|
|
375
|
+
c.length = i;
|
|
376
|
+
for (let u = 0; u < i; u++) {
|
|
377
|
+
const a = s[u];
|
|
378
|
+
if (!a) continue;
|
|
379
|
+
const _ = a._tempUnsub;
|
|
380
|
+
_ ? (c[u] = _, a._tempUnsub = void 0) : (O.checkCircular(a, n), c[u] = a.subscribe(n));
|
|
381
|
+
}
|
|
382
|
+
if (r)
|
|
383
|
+
for (let u = 0; u < o; u++) {
|
|
384
|
+
const a = e[u];
|
|
385
|
+
if (a) {
|
|
386
|
+
const _ = a._tempUnsub;
|
|
387
|
+
_ && (_(), a._tempUnsub = void 0);
|
|
388
|
+
}
|
|
422
389
|
}
|
|
423
|
-
return
|
|
390
|
+
return t !== B && Y.release(t), c;
|
|
424
391
|
}
|
|
425
|
-
let
|
|
426
|
-
function
|
|
427
|
-
return
|
|
392
|
+
let oe = 0;
|
|
393
|
+
function Fe() {
|
|
394
|
+
return oe = oe + 1 & A || 1, oe;
|
|
428
395
|
}
|
|
429
396
|
function Ze() {
|
|
430
|
-
return
|
|
397
|
+
return oe;
|
|
431
398
|
}
|
|
432
|
-
let
|
|
433
|
-
function
|
|
434
|
-
return
|
|
399
|
+
let pe = 0, be = 0, ce = !1;
|
|
400
|
+
function ve() {
|
|
401
|
+
return ce ? (x && console.warn(
|
|
435
402
|
"Warning: startFlush() called during flush - ignored to prevent infinite loop detection bypass"
|
|
436
|
-
), !1) : (
|
|
403
|
+
), !1) : (ce = !0, pe = pe + 1 & A, be = 0, !0);
|
|
437
404
|
}
|
|
438
|
-
function
|
|
439
|
-
|
|
405
|
+
function xe() {
|
|
406
|
+
ce = !1;
|
|
440
407
|
}
|
|
441
408
|
function et() {
|
|
442
|
-
return
|
|
409
|
+
return ce ? ++be : 0;
|
|
443
410
|
}
|
|
444
411
|
class tt {
|
|
445
412
|
constructor() {
|
|
446
|
-
this.
|
|
413
|
+
this._queueBuffers = [
|
|
414
|
+
[[], []],
|
|
415
|
+
// Normal [0][0], [0][1]
|
|
416
|
+
[[], []]
|
|
417
|
+
// Urgent [1][0], [1][1]
|
|
418
|
+
], this._bufferIndices = new Uint8Array(2), this._sizes = new Uint32Array(2), this._activeQueues = [this._queueBuffers[0][0], this._queueBuffers[1][0]], this._epoch = 0, this.isProcessing = !1, this.isBatching = !1, this.batchDepth = 0, this.batchQueue = [], this.batchQueueSize = 0, this.isFlushingSync = !1, this.maxFlushIterations = V.MAX_FLUSH_ITERATIONS;
|
|
447
419
|
}
|
|
420
|
+
/**
|
|
421
|
+
* Returns the current operational phase of the scheduler.
|
|
422
|
+
*/
|
|
448
423
|
get phase() {
|
|
449
424
|
return this.isProcessing || this.isFlushingSync ? 2 : this.isBatching ? 1 : 0;
|
|
450
425
|
}
|
|
426
|
+
/** Current number of pending normal jobs. */
|
|
427
|
+
get queueSize() {
|
|
428
|
+
return this._sizes[0];
|
|
429
|
+
}
|
|
430
|
+
/** Current number of pending urgent jobs. */
|
|
431
|
+
get urgentQueueSize() {
|
|
432
|
+
return this._sizes[1];
|
|
433
|
+
}
|
|
451
434
|
/**
|
|
452
435
|
* Schedules a task for execution with optional priority based on phase shift.
|
|
453
|
-
*
|
|
454
|
-
* Priority Calculation (Branchless):
|
|
455
|
-
* - If sourceNode and cachedVersion are provided, calculates shift
|
|
456
|
-
* - Jobs with shift >= PHASE_THRESHOLD go to urgentQueue
|
|
457
|
-
* - Uses branchless bit manipulation: ((shift - THRESHOLD) >>> 31) ^ 1
|
|
458
|
-
*
|
|
459
|
-
* @param callback - The function to execute
|
|
460
|
-
* @param sourceNode - Optional reactive node for shift calculation
|
|
461
|
-
* @throws {SchedulerError} If the callback is not a function
|
|
462
436
|
*/
|
|
463
|
-
schedule(e,
|
|
437
|
+
schedule(e, t) {
|
|
464
438
|
if (typeof e != "function")
|
|
465
|
-
throw new
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
439
|
+
throw new ne("Scheduler callback must be a function");
|
|
440
|
+
const n = this._epoch;
|
|
441
|
+
if (e._nextEpoch === n) return;
|
|
442
|
+
if (e._nextEpoch = n, this.isBatching || this.isFlushingSync) {
|
|
443
|
+
this.batchQueue[this.batchQueueSize++] = e;
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
const i = this._calculateUrgency(e, t);
|
|
447
|
+
this._activeQueues[i][this._sizes[i]++] = e, this.isProcessing || this.flush();
|
|
473
448
|
}
|
|
474
449
|
/**
|
|
475
450
|
* Calculates urgency flag using branchless bit manipulation.
|
|
476
451
|
*
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
* Correct formula: (shift >= THRESHOLD) ? 1 : 0
|
|
482
|
-
* Branchless: ((PHASE_THRESHOLD - 1 - shift) >>> 31)
|
|
452
|
+
* Logic:
|
|
453
|
+
* 1. Calculate the 'shift' (rotation distance) from the cached version.
|
|
454
|
+
* 2. Compare against PHASE_THRESHOLD (180° rotation equivalent).
|
|
455
|
+
* 3. Use (N >>> 31) to extract the sign bit in O(1) time.
|
|
483
456
|
*
|
|
484
|
-
* @returns 1 if urgent, 0
|
|
457
|
+
* @returns 1 if urgent (shift >= PHASE_THRESHOLD), 0 otherwise.
|
|
485
458
|
*/
|
|
486
|
-
_calculateUrgency(e,
|
|
487
|
-
if (!
|
|
459
|
+
_calculateUrgency(e, t) {
|
|
460
|
+
if (!t || e._cachedVersion === void 0)
|
|
488
461
|
return 0;
|
|
489
|
-
const n =
|
|
462
|
+
const n = t.getShift(e._cachedVersion);
|
|
490
463
|
return de - 1 - n >>> 31 & 1;
|
|
491
464
|
}
|
|
465
|
+
/**
|
|
466
|
+
* Schedules a microtask-based flush of the queues.
|
|
467
|
+
* Coalesces multiple schedule calls into a single microtask execution.
|
|
468
|
+
*/
|
|
492
469
|
flush() {
|
|
493
|
-
this.isProcessing || this.
|
|
470
|
+
this.isProcessing || this._sizes[0] === 0 && this._sizes[1] === 0 || (this.isProcessing = !0, queueMicrotask(() => {
|
|
494
471
|
try {
|
|
495
|
-
if (this.
|
|
496
|
-
const e =
|
|
497
|
-
this._drainQueue(), e &&
|
|
472
|
+
if (this._sizes[0] === 0 && this._sizes[1] === 0) return;
|
|
473
|
+
const e = ve();
|
|
474
|
+
this._drainQueue(), e && xe();
|
|
498
475
|
} finally {
|
|
499
|
-
this.isProcessing = !1, (this.
|
|
476
|
+
this.isProcessing = !1, (this._sizes[0] > 0 || this._sizes[1] > 0) && !this.isBatching && this.flush();
|
|
500
477
|
}
|
|
501
478
|
}));
|
|
502
479
|
}
|
|
480
|
+
/**
|
|
481
|
+
* Immediately flushes all queues synchronously.
|
|
482
|
+
* Used at the end of a batch block or when immediate reflection is required.
|
|
483
|
+
*/
|
|
503
484
|
flushSync() {
|
|
504
485
|
this.isFlushingSync = !0;
|
|
505
|
-
const e =
|
|
486
|
+
const e = ve();
|
|
506
487
|
try {
|
|
507
488
|
this._mergeBatchQueue(), this._drainQueue();
|
|
508
489
|
} finally {
|
|
509
|
-
this.isFlushingSync = !1, e &&
|
|
490
|
+
this.isFlushingSync = !1, e && xe();
|
|
510
491
|
}
|
|
511
492
|
}
|
|
493
|
+
/**
|
|
494
|
+
* Merges jobs from the batching queue into the primary normal queue.
|
|
495
|
+
* Increments the epoch/uses provided epoch to ensure deduplication.
|
|
496
|
+
*/
|
|
512
497
|
_mergeBatchQueue() {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
498
|
+
const e = this.batchQueueSize;
|
|
499
|
+
if (e === 0) return;
|
|
500
|
+
const t = ++this._epoch, n = this.batchQueue, i = this._activeQueues[0];
|
|
501
|
+
let o = this._sizes[0];
|
|
502
|
+
for (let r = 0; r < e; r++) {
|
|
503
|
+
const c = n[r];
|
|
504
|
+
c._nextEpoch !== t && (c._nextEpoch = t, i[o++] = c);
|
|
519
505
|
}
|
|
506
|
+
this._sizes[0] = o, this.batchQueueSize = 0, n.length > V.BATCH_QUEUE_SHRINK_THRESHOLD && (n.length = 0);
|
|
520
507
|
}
|
|
521
|
-
/**
|
|
522
|
-
* Drains all queues, processing urgent queue completely first.
|
|
523
|
-
*
|
|
524
|
-
* Processing Order:
|
|
525
|
-
* 1. Process all urgent jobs (high phase shift = stale updates)
|
|
526
|
-
* 2. Process normal jobs
|
|
527
|
-
* 3. Repeat until both queues are empty
|
|
528
|
-
*
|
|
529
|
-
* This ordering reduces glitches by ensuring that the most
|
|
530
|
-
* impactful state changes are propagated first.
|
|
531
|
-
*/
|
|
532
508
|
_drainQueue() {
|
|
533
509
|
let e = 0;
|
|
534
|
-
|
|
535
|
-
|
|
510
|
+
const t = this.maxFlushIterations;
|
|
511
|
+
for (; this._sizes[1] > 0 || this._sizes[0] > 0; ) {
|
|
512
|
+
if (++e > t) {
|
|
536
513
|
this._handleFlushOverflow();
|
|
537
514
|
return;
|
|
538
515
|
}
|
|
539
|
-
this.
|
|
516
|
+
this._sizes[1] > 0 && this._processQueue(1), this._sizes[0] > 0 && this._processQueue(0), this._mergeBatchQueue();
|
|
540
517
|
}
|
|
541
518
|
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
_processUrgentQueue() {
|
|
546
|
-
const e = this.urgentQueue, s = this.urgentQueueSize;
|
|
547
|
-
this.urgentQueue = this.urgentQueue === this.urgentQueueA ? this.urgentQueueB : this.urgentQueueA, this.urgentQueueSize = 0, this._epoch++, this._processJobs(e, s);
|
|
548
|
-
}
|
|
549
|
-
_processCurrentQueue() {
|
|
550
|
-
const e = this.queue, s = this.queueSize;
|
|
551
|
-
this.queue = this.queue === this.queueA ? this.queueB : this.queueA, this.queueSize = 0, this._epoch++, this._processJobs(e, s);
|
|
519
|
+
_processQueue(e) {
|
|
520
|
+
const t = this._queueBuffers[e], n = this._bufferIndices[e], i = t[n], o = this._sizes[e], r = n ^ 1;
|
|
521
|
+
this._bufferIndices[e] = r, this._activeQueues[e] = t[r], this._sizes[e] = 0, this._epoch++, this._processJobs(i, o);
|
|
552
522
|
}
|
|
553
523
|
_handleFlushOverflow() {
|
|
554
524
|
console.error(
|
|
555
|
-
new
|
|
525
|
+
new ne(
|
|
556
526
|
`Maximum flush iterations (${this.maxFlushIterations}) exceeded. Possible infinite loop.`
|
|
557
527
|
)
|
|
558
|
-
), this.
|
|
528
|
+
), this._sizes[0] = 0, this._activeQueues[0].length = 0, this._sizes[1] = 0, this._activeQueues[1].length = 0, this.batchQueueSize = 0;
|
|
559
529
|
}
|
|
560
|
-
_processJobs(e,
|
|
561
|
-
for (let n = 0; n <
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
);
|
|
570
|
-
}
|
|
571
|
-
}
|
|
530
|
+
_processJobs(e, t) {
|
|
531
|
+
for (let n = 0; n < t; n++)
|
|
532
|
+
try {
|
|
533
|
+
e[n]();
|
|
534
|
+
} catch (i) {
|
|
535
|
+
console.error(
|
|
536
|
+
new ne("Error occurred during scheduler execution", i)
|
|
537
|
+
);
|
|
538
|
+
}
|
|
572
539
|
e.length = 0;
|
|
573
540
|
}
|
|
574
|
-
/** Starts a new batch of updates. Updates will be deferred until endBatch is called. */
|
|
575
541
|
startBatch() {
|
|
576
542
|
this.batchDepth++, this.isBatching = !0;
|
|
577
543
|
}
|
|
578
|
-
/**
|
|
579
|
-
* Ends the current batch. If the batch depth reaches zero, all pending updates are flushed synchronously.
|
|
580
|
-
*/
|
|
581
544
|
endBatch() {
|
|
582
545
|
this.batchDepth = Math.max(0, this.batchDepth - 1), this.batchDepth === 0 && (this.flushSync(), this.isBatching = !1);
|
|
583
546
|
}
|
|
584
|
-
/**
|
|
585
|
-
* Configures the maximum number of iterations allowed during a synchronous flush.
|
|
586
|
-
* Used to prevent infinite loops.
|
|
587
|
-
* @param max - Maximum iterations count.
|
|
588
|
-
*/
|
|
589
547
|
setMaxFlushIterations(e) {
|
|
590
|
-
if (e <
|
|
591
|
-
throw new
|
|
592
|
-
`Max flush iterations must be at least ${
|
|
548
|
+
if (e < V.MIN_FLUSH_ITERATIONS)
|
|
549
|
+
throw new ne(
|
|
550
|
+
`Max flush iterations must be at least ${V.MIN_FLUSH_ITERATIONS}`
|
|
593
551
|
);
|
|
594
552
|
this.maxFlushIterations = e;
|
|
595
553
|
}
|
|
596
554
|
}
|
|
597
|
-
const
|
|
555
|
+
const te = new tt();
|
|
598
556
|
class st {
|
|
599
557
|
constructor() {
|
|
600
558
|
this.current = null;
|
|
@@ -606,11 +564,11 @@ class st {
|
|
|
606
564
|
* @param listener - The tracking listener to associate with the current execution.
|
|
607
565
|
* @param fn - The function to execute.
|
|
608
566
|
*/
|
|
609
|
-
run(e,
|
|
567
|
+
run(e, t) {
|
|
610
568
|
const n = this.current;
|
|
611
569
|
this.current = e;
|
|
612
570
|
try {
|
|
613
|
-
return
|
|
571
|
+
return t();
|
|
614
572
|
} finally {
|
|
615
573
|
this.current = n;
|
|
616
574
|
}
|
|
@@ -622,140 +580,159 @@ class st {
|
|
|
622
580
|
return this.current;
|
|
623
581
|
}
|
|
624
582
|
}
|
|
625
|
-
const
|
|
626
|
-
function
|
|
627
|
-
if (typeof
|
|
628
|
-
throw new
|
|
629
|
-
const e =
|
|
630
|
-
|
|
583
|
+
const y = new st();
|
|
584
|
+
function Le(s) {
|
|
585
|
+
if (typeof s != "function")
|
|
586
|
+
throw new k("Untracked callback must be a function");
|
|
587
|
+
const e = y.current;
|
|
588
|
+
y.current = null;
|
|
631
589
|
try {
|
|
632
|
-
return
|
|
590
|
+
return s();
|
|
633
591
|
} finally {
|
|
634
|
-
|
|
592
|
+
y.current = e;
|
|
635
593
|
}
|
|
636
594
|
}
|
|
637
|
-
class nt extends
|
|
638
|
-
constructor(e,
|
|
639
|
-
super(), this.
|
|
640
|
-
}
|
|
641
|
-
_getFnSubs() {
|
|
642
|
-
return this._fnSubs ??= [], this._fnSubs;
|
|
643
|
-
}
|
|
644
|
-
_getObjSubs() {
|
|
645
|
-
return this._objSubs ??= [], this._objSubs;
|
|
595
|
+
class nt extends we {
|
|
596
|
+
constructor(e, t) {
|
|
597
|
+
super(), this._value = e, this._pendingOldValue = void 0, this._notifyTask = void 0, this._fnSubs = [], this._objSubs = [], t && (this.flags |= F.SYNC), O.attachDebugInfo(this, "atom", this.id);
|
|
646
598
|
}
|
|
647
599
|
/**
|
|
648
600
|
* Returns the current value and registers the atom as a dependency if in a tracking context.
|
|
649
601
|
*/
|
|
650
602
|
get value() {
|
|
651
|
-
const e =
|
|
652
|
-
return e &&
|
|
603
|
+
const e = y.current;
|
|
604
|
+
return e && M(this, e, this._fnSubs, this._objSubs), this._value;
|
|
653
605
|
}
|
|
654
606
|
/**
|
|
655
607
|
* Sets a new value and schedules notifications if the value has changed.
|
|
656
608
|
*/
|
|
657
609
|
set value(e) {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
this._value = e, this.
|
|
610
|
+
const t = this._value;
|
|
611
|
+
if (Object.is(t, e)) return;
|
|
612
|
+
this._value = e, this.version = this.version + 1 & A;
|
|
613
|
+
const n = this.flags, i = F.HAS_FN_SUBS | F.HAS_OBJ_SUBS;
|
|
614
|
+
n & i && this._scheduleNotification(t);
|
|
661
615
|
}
|
|
662
616
|
/**
|
|
663
617
|
* Schedules or flushes notifications based on sync mode and batching state.
|
|
664
618
|
*/
|
|
665
619
|
_scheduleNotification(e) {
|
|
666
|
-
|
|
620
|
+
let t = this.flags;
|
|
621
|
+
if (t & F.NOTIFICATION_SCHEDULED || (this._pendingOldValue = e, this.flags = t |= F.NOTIFICATION_SCHEDULED), t & F.SYNC && !te.isBatching) {
|
|
667
622
|
this._flushNotifications();
|
|
668
623
|
return;
|
|
669
624
|
}
|
|
670
|
-
|
|
625
|
+
let n = this._notifyTask;
|
|
626
|
+
n || (n = this._notifyTask = () => this._flushNotifications()), te.schedule(n);
|
|
671
627
|
}
|
|
628
|
+
/**
|
|
629
|
+
* Flushes scheduled notifications and resets state for the next cycle.
|
|
630
|
+
*/
|
|
672
631
|
_flushNotifications() {
|
|
673
|
-
if (!(this.flags &
|
|
674
|
-
|
|
675
|
-
|
|
632
|
+
if (!(this.flags & F.NOTIFICATION_SCHEDULED))
|
|
633
|
+
return;
|
|
634
|
+
const e = this._pendingOldValue, t = this._value;
|
|
635
|
+
this._pendingOldValue = void 0, this.flags &= -17, this._notifySubscribers(t, e);
|
|
676
636
|
}
|
|
637
|
+
/**
|
|
638
|
+
* Returns the current value without registering it as a dependency.
|
|
639
|
+
*/
|
|
677
640
|
peek() {
|
|
678
641
|
return this._value;
|
|
679
642
|
}
|
|
643
|
+
/**
|
|
644
|
+
* Disposes of the atom and releases all subscribers and tasks.
|
|
645
|
+
*/
|
|
680
646
|
dispose() {
|
|
681
|
-
this._fnSubs =
|
|
647
|
+
this.flags & F.DISPOSED || (this._fnSubs = [], this._objSubs = [], this.flags |= F.DISPOSED, this._value = void 0, this._pendingOldValue = void 0, this._notifyTask = void 0);
|
|
682
648
|
}
|
|
683
649
|
}
|
|
684
|
-
function it(
|
|
685
|
-
return new nt(
|
|
650
|
+
function it(s, e = {}) {
|
|
651
|
+
return new nt(s, e.sync ?? !1);
|
|
652
|
+
}
|
|
653
|
+
function Z(s, e, t) {
|
|
654
|
+
if (s instanceof TypeError)
|
|
655
|
+
return new e(`Type error (${t}): ${s.message}`, s);
|
|
656
|
+
if (s instanceof ReferenceError)
|
|
657
|
+
return new e(`Reference error (${t}): ${s.message}`, s);
|
|
658
|
+
if (s instanceof k)
|
|
659
|
+
return s;
|
|
660
|
+
const n = s instanceof Error ? s.message : String(s), i = s instanceof Error ? s : null;
|
|
661
|
+
return new e(`Unexpected error (${t}): ${n}`, i);
|
|
662
|
+
}
|
|
663
|
+
function Ee(s) {
|
|
664
|
+
return s !== null && typeof s == "object" && "value" in s && "subscribe" in s && typeof s.subscribe == "function";
|
|
665
|
+
}
|
|
666
|
+
function Ae(s) {
|
|
667
|
+
if (O.enabled && (s == null || typeof s == "object")) {
|
|
668
|
+
const e = O.getDebugType(s);
|
|
669
|
+
if (e)
|
|
670
|
+
return e === "computed";
|
|
671
|
+
}
|
|
672
|
+
return Ee(s) && "invalidate" in s && typeof s.invalidate == "function";
|
|
686
673
|
}
|
|
687
|
-
function
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
674
|
+
function ke(s) {
|
|
675
|
+
return s != null && typeof s.then == "function";
|
|
676
|
+
}
|
|
677
|
+
const Pe = l.RESOLVED | l.PENDING | l.REJECTED, he = Array(Pe + 1).fill(ue.IDLE);
|
|
678
|
+
he[l.RESOLVED] = ue.RESOLVED;
|
|
679
|
+
he[l.PENDING] = ue.PENDING;
|
|
680
|
+
he[l.REJECTED] = ue.REJECTED;
|
|
681
|
+
class ot {
|
|
682
|
+
constructor(e) {
|
|
683
|
+
this._owner = e, this._epoch = -1, this._nextDeps = I, this._nextVersions = T, this._depCount = 0;
|
|
684
|
+
}
|
|
685
|
+
execute() {
|
|
686
|
+
this._owner._markDirty();
|
|
687
|
+
}
|
|
688
|
+
addDependency(e) {
|
|
689
|
+
if (e._lastSeenEpoch === this._epoch)
|
|
690
|
+
return;
|
|
691
|
+
e._lastSeenEpoch = this._epoch;
|
|
692
|
+
const t = this._depCount, n = this._nextDeps, i = this._nextVersions;
|
|
693
|
+
t < n.length ? (n[t] = e, i[t] = e.version) : (n.push(e), i.push(e.version)), this._depCount = t + 1;
|
|
694
|
+
}
|
|
695
|
+
reset() {
|
|
696
|
+
this._epoch = -1, this._nextDeps = I, this._nextVersions = T, this._depCount = 0;
|
|
697
|
+
}
|
|
696
698
|
}
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
ue[l.PENDING] = ce.PENDING;
|
|
700
|
-
ue[l.REJECTED] = ce.REJECTED;
|
|
701
|
-
class Le extends Re {
|
|
702
|
-
constructor(e, s = {}) {
|
|
699
|
+
class Me extends we {
|
|
700
|
+
constructor(e, t = {}) {
|
|
703
701
|
if (typeof e != "function")
|
|
704
|
-
throw new
|
|
705
|
-
if (super(), this.
|
|
706
|
-
const n = this._fnSubs;
|
|
707
|
-
if (n)
|
|
708
|
-
for (let r = n.length - 1; r >= 0; r--)
|
|
709
|
-
try {
|
|
710
|
-
const o = n[r];
|
|
711
|
-
o && o(void 0, void 0);
|
|
712
|
-
} catch (o) {
|
|
713
|
-
console.error(o);
|
|
714
|
-
}
|
|
715
|
-
const i = this._objSubs;
|
|
716
|
-
if (i)
|
|
717
|
-
for (let r = i.length - 1; r >= 0; r--)
|
|
718
|
-
try {
|
|
719
|
-
const o = i[r];
|
|
720
|
-
o && o.execute();
|
|
721
|
-
} catch (o) {
|
|
722
|
-
console.error(o);
|
|
723
|
-
}
|
|
724
|
-
}, this._trackable = Object.assign(() => this._markDirty(), {
|
|
725
|
-
addDependency: (n) => {
|
|
726
|
-
}
|
|
727
|
-
}), v.attachDebugInfo(this, "computed", this.id), v.enabled) {
|
|
702
|
+
throw new G(m.COMPUTED_MUST_BE_FUNCTION);
|
|
703
|
+
if (super(), this.MAX_ASYNC_RETRIES = 3, this._value = void 0, this.flags = l.DIRTY | l.IDLE, this._error = null, this._promiseId = 0, this._equal = t.equal ?? Object.is, this._fn = e, this._defaultValue = "defaultValue" in t ? t.defaultValue : Ce, this._hasDefaultValue = this._defaultValue !== Ce, this._onError = t.onError ?? null, this.MAX_PROMISE_ID = Number.MAX_SAFE_INTEGER - 1, this._fnSubs = [], this._objSubs = [], this._dependencies = I, this._dependencyVersions = T, this._unsubscribes = B, this._cachedErrors = null, this._errorCacheEpoch = -1, this._asyncStartAggregateVersion = 0, this._asyncRetryCount = 0, this._trackable = new ot(this), O.attachDebugInfo(this, "computed", this.id), O.enabled) {
|
|
728
704
|
const n = this;
|
|
729
|
-
n.subscriberCount = this.subscriberCount.bind(this), n.isDirty = () => this.
|
|
705
|
+
n.subscriberCount = this.subscriberCount.bind(this), n.isDirty = () => (this.flags & l.DIRTY) !== 0, n.dependencies = this._dependencies, n.stateFlags = "";
|
|
730
706
|
}
|
|
731
|
-
if (
|
|
707
|
+
if (t.lazy === !1)
|
|
732
708
|
try {
|
|
733
709
|
this._recompute();
|
|
734
710
|
} catch {
|
|
735
711
|
}
|
|
736
712
|
}
|
|
737
|
-
_getFnSubs() {
|
|
738
|
-
return this._fnSubs ??= [], this._fnSubs;
|
|
739
|
-
}
|
|
740
|
-
_getObjSubs() {
|
|
741
|
-
return this._objSubs ??= [], this._objSubs;
|
|
742
|
-
}
|
|
743
713
|
get value() {
|
|
744
|
-
|
|
714
|
+
const e = y.current;
|
|
715
|
+
e && M(this, e, this._fnSubs, this._objSubs);
|
|
716
|
+
const t = this.flags;
|
|
717
|
+
if (t & l.RECOMPUTING) return this._value;
|
|
718
|
+
t & (l.DIRTY | l.IDLE) && this._recompute();
|
|
719
|
+
const n = this.flags;
|
|
720
|
+
return n & l.PENDING ? this._handlePending() : n & l.REJECTED ? this._handleRejected() : this._value;
|
|
745
721
|
}
|
|
746
722
|
peek() {
|
|
747
723
|
return this._value;
|
|
748
724
|
}
|
|
749
725
|
get state() {
|
|
750
|
-
|
|
726
|
+
const e = y.current;
|
|
727
|
+
return e && M(this, e, this._fnSubs, this._objSubs), he[this.flags & Pe];
|
|
751
728
|
}
|
|
752
729
|
get hasError() {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
730
|
+
const e = y.current;
|
|
731
|
+
if (e && M(this, e, this._fnSubs, this._objSubs), this.flags & (l.REJECTED | l.HAS_ERROR)) return !0;
|
|
732
|
+
const t = this._dependencies;
|
|
733
|
+
for (let n = 0, i = t.length; n < i; n++) {
|
|
734
|
+
const o = t[n];
|
|
735
|
+
if (o && o.flags & l.HAS_ERROR) return !0;
|
|
759
736
|
}
|
|
760
737
|
return !1;
|
|
761
738
|
}
|
|
@@ -763,532 +740,451 @@ class Le extends Re {
|
|
|
763
740
|
return !this.hasError;
|
|
764
741
|
}
|
|
765
742
|
get errors() {
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
const
|
|
769
|
-
if (this._errorCacheEpoch ===
|
|
743
|
+
const e = y.current;
|
|
744
|
+
if (e && M(this, e, this._fnSubs, this._objSubs), !this.hasError) return qe;
|
|
745
|
+
const t = Ze();
|
|
746
|
+
if (this._errorCacheEpoch === t && this._cachedErrors !== null)
|
|
770
747
|
return this._cachedErrors;
|
|
771
|
-
const
|
|
772
|
-
this._error &&
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
748
|
+
const n = /* @__PURE__ */ new Set();
|
|
749
|
+
this._error && n.add(this._error);
|
|
750
|
+
const i = this._dependencies;
|
|
751
|
+
for (let r = 0, c = i.length; r < c; r++) {
|
|
752
|
+
const u = i[r];
|
|
753
|
+
if (u && "errors" in u) {
|
|
754
|
+
const a = u.errors;
|
|
755
|
+
for (let _ = 0, P = a.length; _ < P; _++) {
|
|
756
|
+
const S = a[_];
|
|
757
|
+
S && n.add(S);
|
|
780
758
|
}
|
|
781
759
|
}
|
|
782
760
|
}
|
|
783
|
-
|
|
761
|
+
const o = Object.freeze([...n]);
|
|
762
|
+
return this._cachedErrors = o, this._errorCacheEpoch = t, o;
|
|
784
763
|
}
|
|
785
764
|
get lastError() {
|
|
786
|
-
|
|
765
|
+
const e = y.current;
|
|
766
|
+
return e && M(this, e, this._fnSubs, this._objSubs), this._error;
|
|
787
767
|
}
|
|
788
768
|
get isPending() {
|
|
789
|
-
|
|
769
|
+
const e = y.current;
|
|
770
|
+
return e && M(this, e, this._fnSubs, this._objSubs), (this.flags & l.PENDING) !== 0;
|
|
790
771
|
}
|
|
791
772
|
get isResolved() {
|
|
792
|
-
|
|
773
|
+
const e = y.current;
|
|
774
|
+
return e && M(this, e, this._fnSubs, this._objSubs), (this.flags & l.RESOLVED) !== 0;
|
|
793
775
|
}
|
|
794
776
|
invalidate() {
|
|
795
|
-
this._markDirty()
|
|
777
|
+
this._markDirty();
|
|
778
|
+
const e = this._dependencyVersions;
|
|
779
|
+
e !== T && (L.release(e), this._dependencyVersions = T), this._errorCacheEpoch = -1, this._cachedErrors = null;
|
|
796
780
|
}
|
|
797
781
|
dispose() {
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
782
|
+
const e = this._unsubscribes;
|
|
783
|
+
if (e !== B) {
|
|
784
|
+
for (let i = 0, o = e.length; i < o; i++) {
|
|
785
|
+
const r = e[i];
|
|
786
|
+
r && r();
|
|
802
787
|
}
|
|
803
|
-
|
|
788
|
+
Y.release(e), this._unsubscribes = B;
|
|
804
789
|
}
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
return (this.flags & l.DIRTY) !== 0;
|
|
810
|
-
}
|
|
811
|
-
_setDirty() {
|
|
812
|
-
this.flags |= l.DIRTY;
|
|
790
|
+
const t = this._dependencies;
|
|
791
|
+
t !== I && (j.release(t), this._dependencies = I);
|
|
792
|
+
const n = this._dependencyVersions;
|
|
793
|
+
n !== T && (L.release(n), this._dependencyVersions = T), this._fnSubs = [], this._objSubs = [], this.flags = l.DISPOSED | l.DIRTY | l.IDLE, this._error = null, this._value = void 0, this._promiseId = (this._promiseId + 1) % this.MAX_PROMISE_ID, this._cachedErrors = null, this._errorCacheEpoch = -1;
|
|
813
794
|
}
|
|
814
795
|
_clearDirty() {
|
|
815
|
-
this.flags &= -
|
|
816
|
-
}
|
|
817
|
-
_isIdle() {
|
|
818
|
-
return (this.flags & l.IDLE) !== 0;
|
|
819
|
-
}
|
|
820
|
-
_setIdle() {
|
|
821
|
-
this.flags |= l.IDLE, this.flags &= -29;
|
|
822
|
-
}
|
|
823
|
-
_isPending() {
|
|
824
|
-
return (this.flags & l.PENDING) !== 0;
|
|
796
|
+
this.flags &= -9;
|
|
825
797
|
}
|
|
826
798
|
_setPending() {
|
|
827
|
-
this.flags
|
|
799
|
+
this.flags = (this.flags | l.PENDING) & -209;
|
|
828
800
|
}
|
|
829
801
|
_isResolved() {
|
|
830
802
|
return (this.flags & l.RESOLVED) !== 0;
|
|
831
803
|
}
|
|
832
804
|
_setResolved() {
|
|
833
|
-
this.flags
|
|
805
|
+
this.flags = (this.flags | l.RESOLVED) & -689;
|
|
834
806
|
}
|
|
835
807
|
_isRejected() {
|
|
836
808
|
return (this.flags & l.REJECTED) !== 0;
|
|
837
809
|
}
|
|
838
810
|
_setRejected() {
|
|
839
|
-
this.flags
|
|
840
|
-
}
|
|
841
|
-
_isRecomputing() {
|
|
842
|
-
return (this.flags & l.RECOMPUTING) !== 0;
|
|
811
|
+
this.flags = this.flags & -113 | (l.REJECTED | l.HAS_ERROR);
|
|
843
812
|
}
|
|
844
813
|
_setRecomputing(e) {
|
|
845
|
-
const
|
|
846
|
-
this.flags = this.flags & ~
|
|
847
|
-
}
|
|
848
|
-
_getAsyncState() {
|
|
849
|
-
return ue[this.flags & ke];
|
|
850
|
-
}
|
|
851
|
-
_getFlagsAsString() {
|
|
852
|
-
const e = [];
|
|
853
|
-
return this._isDirty() && e.push("DIRTY"), this._isIdle() && e.push("IDLE"), this._isPending() && e.push("PENDING"), this._isResolved() && e.push("RESOLVED"), this._isRejected() && e.push("REJECTED"), this._isRecomputing() && e.push("RECOMPUTING"), e.join(" | ");
|
|
854
|
-
}
|
|
855
|
-
_computeValue() {
|
|
856
|
-
return this._isRecomputing() ? this._value : ((this._isDirty() || this._isIdle()) && this._recompute(), this._isPending() ? this._handlePending() : this._isRejected() ? this._handleRejected() : this._value);
|
|
814
|
+
const t = l.RECOMPUTING;
|
|
815
|
+
this.flags = this.flags & ~t | (e ? -1 : 0) & t;
|
|
857
816
|
}
|
|
858
817
|
_recompute() {
|
|
859
|
-
if (this.
|
|
818
|
+
if (this.flags & l.RECOMPUTING)
|
|
819
|
+
return;
|
|
860
820
|
this._setRecomputing(!0);
|
|
861
|
-
const e = this.
|
|
862
|
-
|
|
821
|
+
const e = this._trackable, t = this._dependencies, n = this._dependencyVersions;
|
|
822
|
+
e._epoch = Fe(), e._nextDeps = j.acquire(), e._nextVersions = L.acquire(), e._depCount = 0;
|
|
823
|
+
let i = !1;
|
|
863
824
|
try {
|
|
864
|
-
const
|
|
865
|
-
this.
|
|
866
|
-
} catch (
|
|
867
|
-
|
|
825
|
+
const o = y.run(e, this._fn), r = e._nextDeps, c = e._nextVersions, u = e._depCount;
|
|
826
|
+
r.length = u, c.length = u, this._unsubscribes = Te(r, t, this._unsubscribes, this), this._dependencies = r, this._dependencyVersions = c, i = !0, ke(o) ? this._handleAsyncComputation(o) : this._finalizeResolution(o);
|
|
827
|
+
} catch (o) {
|
|
828
|
+
let r = o;
|
|
829
|
+
if (!i)
|
|
868
830
|
try {
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
831
|
+
const c = e._nextDeps, u = e._nextVersions, a = e._depCount;
|
|
832
|
+
c.length = a, u.length = a, this._unsubscribes = Te(c, t, this._unsubscribes, this), this._dependencies = c, this._dependencyVersions = u, i = !0;
|
|
833
|
+
} catch (c) {
|
|
834
|
+
r = c;
|
|
872
835
|
}
|
|
873
|
-
this._handleComputationError(
|
|
836
|
+
this._handleComputationError(r);
|
|
874
837
|
} finally {
|
|
875
|
-
|
|
838
|
+
i ? (t !== I && j.release(t), n !== T && L.release(n)) : (j.release(e._nextDeps), L.release(e._nextVersions)), e.reset(), this._setRecomputing(!1);
|
|
876
839
|
}
|
|
877
840
|
}
|
|
878
|
-
_prepareComputationContext() {
|
|
879
|
-
const e = this._dependencies, s = this._dependencyVersions, n = w.acquire(), i = T.acquire(), r = we(), o = { depCount: 0 }, c = (d) => {
|
|
880
|
-
d._lastSeenEpoch !== r && (d._lastSeenEpoch = r, o.depCount < n.length ? (n[o.depCount] = d, i[o.depCount] = d.version) : (n.push(d), i.push(d.version)), o.depCount++);
|
|
881
|
-
}, h = this._trackable.addDependency;
|
|
882
|
-
return this._trackable.addDependency = c, { prevDeps: e, prevVersions: s, nextDeps: n, nextVersions: i, originalAdd: h, state: o };
|
|
883
|
-
}
|
|
884
|
-
_commitDependencies(e) {
|
|
885
|
-
const { nextDeps: s, nextVersions: n, state: i, prevDeps: r } = e;
|
|
886
|
-
s.length = i.depCount, n.length = i.depCount, this._unsubscribes = We(s, r, this._unsubscribes, this), this._dependencies = s, this._dependencyVersions = n;
|
|
887
|
-
}
|
|
888
|
-
_cleanupContext(e, s) {
|
|
889
|
-
this._trackable.addDependency = e.originalAdd, s ? (e.prevDeps !== y && w.release(e.prevDeps), e.prevVersions !== S && T.release(e.prevVersions)) : (w.release(e.nextDeps), T.release(e.nextVersions));
|
|
890
|
-
}
|
|
891
|
-
/**
|
|
892
|
-
* Calculates aggregate shift from all dependencies.
|
|
893
|
-
* Used for scheduling priority in computed chains.
|
|
894
|
-
*
|
|
895
|
-
* Performance: O(N) where N = dependency count
|
|
896
|
-
* Branchless: Each dep.getShift uses modular arithmetic
|
|
897
|
-
*
|
|
898
|
-
* @returns Sum of all dependency shifts (capped at SMI_MAX)
|
|
899
|
-
*/
|
|
900
841
|
_getAggregateShift() {
|
|
901
842
|
let e = 0;
|
|
902
|
-
const
|
|
903
|
-
for (let i = 0; i <
|
|
904
|
-
const r =
|
|
905
|
-
r &&
|
|
843
|
+
const t = this._dependencies, n = this._dependencyVersions;
|
|
844
|
+
for (let i = 0, o = t.length; i < o; i++) {
|
|
845
|
+
const r = t[i], c = n[i];
|
|
846
|
+
r && c !== void 0 && (e = e + r.getShift(c) & A);
|
|
906
847
|
}
|
|
907
848
|
return e;
|
|
908
849
|
}
|
|
909
|
-
/**
|
|
910
|
-
* Checks if this computed should be scheduled with urgent priority.
|
|
911
|
-
* Based on aggregate shift from all dependencies.
|
|
912
|
-
*
|
|
913
|
-
* @returns true if aggregate shift exceeds PHASE_THRESHOLD
|
|
914
|
-
*/
|
|
915
850
|
isUrgent() {
|
|
916
851
|
return this._getAggregateShift() >= de;
|
|
917
852
|
}
|
|
918
|
-
_handleSyncResult(e) {
|
|
919
|
-
this._finalizeResolution(e);
|
|
920
|
-
}
|
|
921
853
|
_handleAsyncComputation(e) {
|
|
922
|
-
this._setPending(), this._clearDirty(), this.
|
|
923
|
-
const
|
|
854
|
+
this._setPending(), this._clearDirty(), this._notifySubscribers(void 0, void 0), this._asyncStartAggregateVersion = this._captureVersionSnapshot(), this._asyncRetryCount = 0, this._promiseId = (this._promiseId + 1) % this.MAX_PROMISE_ID;
|
|
855
|
+
const t = this._promiseId;
|
|
924
856
|
e.then((n) => {
|
|
925
|
-
if (
|
|
926
|
-
const i = this._captureVersionSnapshot() - this._asyncStartAggregateVersion &
|
|
857
|
+
if (t !== this._promiseId) return;
|
|
858
|
+
const i = this._captureVersionSnapshot() - this._asyncStartAggregateVersion & A;
|
|
927
859
|
if (de - 1 - i >>> 31 & 1) {
|
|
928
860
|
if (this._asyncRetryCount < this.MAX_ASYNC_RETRIES) {
|
|
929
861
|
this._asyncRetryCount++, this._markDirty();
|
|
930
862
|
return;
|
|
931
863
|
}
|
|
932
|
-
const
|
|
933
|
-
`Async drift exceeded threshold after ${this.MAX_ASYNC_RETRIES} retries
|
|
864
|
+
const o = new G(
|
|
865
|
+
`Async drift exceeded threshold after ${this.MAX_ASYNC_RETRIES} retries.`
|
|
934
866
|
);
|
|
935
|
-
this._handleAsyncRejection(
|
|
867
|
+
this._handleAsyncRejection(o);
|
|
936
868
|
return;
|
|
937
869
|
}
|
|
938
|
-
this.
|
|
870
|
+
this._finalizeResolution(n), this._notifySubscribers(n, void 0);
|
|
939
871
|
}).catch((n) => {
|
|
940
|
-
|
|
872
|
+
t === this._promiseId && this._handleAsyncRejection(n);
|
|
941
873
|
});
|
|
942
874
|
}
|
|
943
|
-
/**
|
|
944
|
-
* Captures the aggregate version of all dependencies.
|
|
945
|
-
* Used for phase drift validation in async computations.
|
|
946
|
-
*
|
|
947
|
-
* @returns Sum of all dependency versions (capped at SMI_MAX)
|
|
948
|
-
*/
|
|
949
875
|
_captureVersionSnapshot() {
|
|
950
876
|
let e = 0;
|
|
951
|
-
const
|
|
952
|
-
for (let n = 0; n <
|
|
953
|
-
const
|
|
954
|
-
|
|
877
|
+
const t = this._dependencies;
|
|
878
|
+
for (let n = 0, i = t.length; n < i; n++) {
|
|
879
|
+
const o = t[n];
|
|
880
|
+
o && (e = e + o.version & A);
|
|
955
881
|
}
|
|
956
882
|
return e;
|
|
957
883
|
}
|
|
958
|
-
_handleAsyncResolution(e) {
|
|
959
|
-
this._finalizeResolution(e), this._notifyJob();
|
|
960
|
-
}
|
|
961
|
-
/**
|
|
962
|
-
* Unified success finalization for sync and async results.
|
|
963
|
-
* Handles phase rotation, state transition, and error cache clearing.
|
|
964
|
-
*/
|
|
965
|
-
_finalizeResolution(e) {
|
|
966
|
-
(!this._isResolved() || !this._equal(this._value, e)) && this.rotatePhase(), this._value = e, this._clearDirty(), this._setResolved(), this._error = null, this._setRecomputing(!1), this._cachedErrors = null, this._errorCacheEpoch = -1;
|
|
967
|
-
}
|
|
968
884
|
_handleAsyncRejection(e) {
|
|
969
|
-
const
|
|
970
|
-
|
|
885
|
+
const t = Z(e, G, m.COMPUTED_ASYNC_COMPUTATION_FAILED);
|
|
886
|
+
this.flags & l.REJECTED || (this.version = this.version + 1 & A), this._error = t, this._setRejected(), this._clearDirty(), this._setRecomputing(!1);
|
|
887
|
+
const n = this._onError;
|
|
888
|
+
if (n)
|
|
971
889
|
try {
|
|
972
|
-
|
|
973
|
-
} catch (
|
|
974
|
-
console.error(
|
|
890
|
+
n(t);
|
|
891
|
+
} catch (i) {
|
|
892
|
+
console.error(m.CALLBACK_ERROR_IN_ERROR_HANDLER, i);
|
|
975
893
|
}
|
|
976
|
-
this.
|
|
894
|
+
this._notifySubscribers(void 0, void 0);
|
|
895
|
+
}
|
|
896
|
+
_finalizeResolution(e) {
|
|
897
|
+
(!(this.flags & l.RESOLVED) || !this._equal(this._value, e)) && (this.version = this.version + 1 & A), this._value = e, this._clearDirty(), this._setResolved(), this._error = null, this._setRecomputing(!1), this._cachedErrors = null, this._errorCacheEpoch = -1;
|
|
977
898
|
}
|
|
978
899
|
_handleComputationError(e) {
|
|
979
|
-
const
|
|
980
|
-
|
|
900
|
+
const t = Z(e, G, m.COMPUTED_COMPUTATION_FAILED);
|
|
901
|
+
this._error = t, this._setRejected(), this._clearDirty(), this._setRecomputing(!1);
|
|
902
|
+
const n = this._onError;
|
|
903
|
+
if (n)
|
|
981
904
|
try {
|
|
982
|
-
|
|
983
|
-
} catch (
|
|
984
|
-
console.error(
|
|
905
|
+
n(t);
|
|
906
|
+
} catch (i) {
|
|
907
|
+
console.error(m.CALLBACK_ERROR_IN_ERROR_HANDLER, i);
|
|
985
908
|
}
|
|
986
|
-
throw
|
|
909
|
+
throw t;
|
|
987
910
|
}
|
|
988
911
|
_handlePending() {
|
|
989
912
|
if (this._hasDefaultValue)
|
|
990
913
|
return this._defaultValue;
|
|
991
|
-
throw new
|
|
914
|
+
throw new G(m.COMPUTED_ASYNC_PENDING_NO_DEFAULT);
|
|
992
915
|
}
|
|
993
916
|
_handleRejected() {
|
|
994
|
-
|
|
917
|
+
const e = this._error;
|
|
918
|
+
if (e?.recoverable && this._hasDefaultValue)
|
|
995
919
|
return this._defaultValue;
|
|
996
|
-
throw
|
|
920
|
+
throw e;
|
|
997
921
|
}
|
|
998
|
-
/** Subscriber interface - marks dirty on dependency change */
|
|
999
922
|
execute() {
|
|
1000
923
|
this._markDirty();
|
|
1001
924
|
}
|
|
925
|
+
/** @internal */
|
|
1002
926
|
_markDirty() {
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
_registerTracking() {
|
|
1006
|
-
Ue(this, Q.getCurrent(), this._getFnSubs(), this._getObjSubs());
|
|
927
|
+
const e = this.flags;
|
|
928
|
+
e & (l.RECOMPUTING | l.DIRTY) || (this.flags = e | l.DIRTY, this._notifySubscribers(void 0, void 0));
|
|
1007
929
|
}
|
|
1008
930
|
}
|
|
1009
|
-
Object.freeze(
|
|
1010
|
-
function rt(
|
|
1011
|
-
return new
|
|
931
|
+
Object.freeze(Me.prototype);
|
|
932
|
+
function rt(s, e = {}) {
|
|
933
|
+
return new Me(s, e);
|
|
1012
934
|
}
|
|
1013
|
-
class
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
this._dependencies !== y && (w.release(this._dependencies), this._dependencies = y), this._dependencyVersions !== S && (T.release(this._dependencyVersions), this._dependencyVersions = S);
|
|
1034
|
-
}
|
|
1035
|
-
}, this.addDependency = (i) => {
|
|
1036
|
-
if (this.isExecuting && this._nextDeps && this._nextUnsubs && this._nextVersions) {
|
|
1037
|
-
const r = this._currentEpoch;
|
|
1038
|
-
if (i._lastSeenEpoch === r) return;
|
|
1039
|
-
i._lastSeenEpoch = r, this._nextDeps.push(i), this._nextVersions.push(i.version), i._tempUnsub ? (this._nextUnsubs.push(i._tempUnsub), i._tempUnsub = void 0) : this._subscribeTo(i);
|
|
1040
|
-
}
|
|
1041
|
-
}, this.execute = () => {
|
|
1042
|
-
if (this.isDisposed || this.isExecuting || !this._shouldExecute()) return;
|
|
1043
|
-
this._checkInfiniteLoop(), this._setExecuting(!0), this._safeCleanup();
|
|
1044
|
-
const i = this._prepareEffectExecutionContext();
|
|
1045
|
-
let r = !1;
|
|
1046
|
-
try {
|
|
1047
|
-
const o = Q.run(this, this._fn);
|
|
1048
|
-
this._commitEffect(i), r = !0, this._checkLoopWarnings(), Oe(o) ? o.then((c) => {
|
|
1049
|
-
!this.isDisposed && typeof c == "function" && (this._cleanup = c);
|
|
1050
|
-
}).catch((c) => {
|
|
1051
|
-
this._handleExecutionError(c);
|
|
1052
|
-
}) : this._cleanup = typeof o == "function" ? o : null;
|
|
1053
|
-
} catch (o) {
|
|
1054
|
-
r = !0, this._handleExecutionError(o), this._cleanup = null;
|
|
1055
|
-
} finally {
|
|
1056
|
-
this._cleanupEffect(i, r), this._setExecuting(!1);
|
|
935
|
+
class ct extends Ue {
|
|
936
|
+
constructor(e, t = {}) {
|
|
937
|
+
super(), this._cleanup = null, this._dependencies = I, this._dependencyVersions = T, this._unsubscribes = B, this._nextDeps = null, this._nextVersions = null, this._nextUnsubs = null, this._executeTask = void 0, this._onError = t.onError ?? null, this._currentEpoch = -1, this._lastFlushEpoch = -1, this._executionsInEpoch = 0, this._fn = e, this._sync = t.sync ?? !1, this._maxExecutions = t.maxExecutionsPerSecond ?? V.MAX_EXECUTIONS_PER_SECOND, this._maxExecutionsPerFlush = t.maxExecutionsPerFlush ?? V.MAX_EXECUTIONS_PER_EFFECT, this._trackModifications = t.trackModifications ?? !1, this._executionCount = 0, this._historyPtr = 0;
|
|
938
|
+
const n = Number.isFinite(this._maxExecutions), i = n ? Math.min(this._maxExecutions + 1, V.MAX_EXECUTIONS_PER_SECOND + 1) : 0;
|
|
939
|
+
this._historyCapacity = i, this._history = x && n && i > 0 ? new Array(i).fill(0) : null, O.attachDebugInfo(this, "effect", this.id);
|
|
940
|
+
}
|
|
941
|
+
run() {
|
|
942
|
+
if (this.flags & N.DISPOSED)
|
|
943
|
+
throw new Q(m.EFFECT_MUST_BE_FUNCTION);
|
|
944
|
+
this.execute(!0);
|
|
945
|
+
}
|
|
946
|
+
dispose() {
|
|
947
|
+
const e = this.flags;
|
|
948
|
+
if (e & N.DISPOSED) return;
|
|
949
|
+
this.flags = e | N.DISPOSED, this._safeCleanup();
|
|
950
|
+
const t = this._unsubscribes;
|
|
951
|
+
if (t !== B) {
|
|
952
|
+
for (let o = 0, r = t.length; o < r; o++) {
|
|
953
|
+
const c = t[o];
|
|
954
|
+
c && c();
|
|
1057
955
|
}
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
956
|
+
Y.release(t), this._unsubscribes = B;
|
|
957
|
+
}
|
|
958
|
+
const n = this._dependencies;
|
|
959
|
+
n !== I && (j.release(n), this._dependencies = I);
|
|
960
|
+
const i = this._dependencyVersions;
|
|
961
|
+
i !== T && (L.release(i), this._dependencyVersions = T), this._executeTask = void 0;
|
|
962
|
+
}
|
|
963
|
+
addDependency(e) {
|
|
964
|
+
if (!(this.flags & N.EXECUTING)) return;
|
|
965
|
+
const t = this._currentEpoch;
|
|
966
|
+
if (e._lastSeenEpoch === t) return;
|
|
967
|
+
e._lastSeenEpoch = t;
|
|
968
|
+
const n = this._nextDeps, i = this._nextVersions, o = this._nextUnsubs;
|
|
969
|
+
if (!n || !i || !o) return;
|
|
970
|
+
n.push(e), i.push(e.version);
|
|
971
|
+
const r = e._tempUnsub;
|
|
972
|
+
r ? (o.push(r), e._tempUnsub = void 0) : this._subscribeTo(e);
|
|
973
|
+
}
|
|
974
|
+
execute(e = !1) {
|
|
975
|
+
if (this.flags & (N.DISPOSED | N.EXECUTING) || !e && !this._shouldExecute()) return;
|
|
976
|
+
this._checkInfiniteLoop(), this._setExecuting(!0), this._safeCleanup();
|
|
977
|
+
const t = this._prepareEffectExecutionContext();
|
|
978
|
+
let n = !1;
|
|
979
|
+
try {
|
|
980
|
+
const i = y.run(this, this._fn), o = t.nextDeps.length;
|
|
981
|
+
t.nextDeps.length = o, t.nextVersions.length = o, this._dependencies = t.nextDeps, this._dependencyVersions = t.nextVersions, this._unsubscribes = t.nextUnsubs, n = !0, this._checkLoopWarnings(), ke(i) ? i.then((r) => {
|
|
982
|
+
!(this.flags & N.DISPOSED) && typeof r == "function" && (this._cleanup = r);
|
|
983
|
+
}).catch((r) => this._handleExecutionError(r)) : this._cleanup = typeof i == "function" ? i : null;
|
|
984
|
+
} catch (i) {
|
|
985
|
+
n = !0, this._handleExecutionError(i), this._cleanup = null;
|
|
986
|
+
} finally {
|
|
987
|
+
this._cleanupEffect(t, n), this._setExecuting(!1);
|
|
988
|
+
}
|
|
1061
989
|
}
|
|
1062
|
-
/**
|
|
1063
|
-
* Prepares the execution context by acquiring pools and setting up epoch.
|
|
1064
|
-
* @returns The prepared EffectExecutionContext.
|
|
1065
|
-
*/
|
|
1066
990
|
_prepareEffectExecutionContext() {
|
|
1067
|
-
const e = this._dependencies,
|
|
1068
|
-
if (e !==
|
|
1069
|
-
for (let
|
|
1070
|
-
const
|
|
1071
|
-
|
|
991
|
+
const e = this._dependencies, t = this._dependencyVersions, n = this._unsubscribes, i = j.acquire(), o = L.acquire(), r = Y.acquire(), c = Fe();
|
|
992
|
+
if (e !== I)
|
|
993
|
+
for (let u = 0, a = e.length; u < a; u++) {
|
|
994
|
+
const _ = e[u];
|
|
995
|
+
_ && (_._tempUnsub = n[u]);
|
|
1072
996
|
}
|
|
1073
|
-
return this._nextDeps = i, this._nextVersions =
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
/**
|
|
1084
|
-
* Cleans up the effect execution context, releasing resources back to pools.
|
|
1085
|
-
* @param ctx - The effect context to clean up.
|
|
1086
|
-
* @param committed - Whether the changes were committed to the effect.
|
|
1087
|
-
*/
|
|
1088
|
-
_cleanupEffect(e, s) {
|
|
1089
|
-
if (this._nextDeps = null, this._nextVersions = null, this._nextUnsubs = null, s) {
|
|
1090
|
-
if (e.prevDeps !== y) {
|
|
1091
|
-
for (let n = 0; n < e.prevDeps.length; n++) {
|
|
1092
|
-
const i = e.prevDeps[n];
|
|
1093
|
-
i?._tempUnsub && (i._tempUnsub(), i._tempUnsub = void 0);
|
|
997
|
+
return this._nextDeps = i, this._nextVersions = o, this._nextUnsubs = r, this._currentEpoch = c, { prevDeps: e, prevVersions: t, prevUnsubs: n, nextDeps: i, nextVersions: o, nextUnsubs: r };
|
|
998
|
+
}
|
|
999
|
+
_cleanupEffect(e, t) {
|
|
1000
|
+
this._nextDeps = null, this._nextVersions = null, this._nextUnsubs = null;
|
|
1001
|
+
const n = e.prevDeps;
|
|
1002
|
+
if (t) {
|
|
1003
|
+
if (n !== I) {
|
|
1004
|
+
for (let i = 0, o = n.length; i < o; i++) {
|
|
1005
|
+
const r = n[i], c = r ? r._tempUnsub : void 0;
|
|
1006
|
+
c && (c(), r && (r._tempUnsub = void 0));
|
|
1094
1007
|
}
|
|
1095
|
-
|
|
1008
|
+
j.release(n);
|
|
1096
1009
|
}
|
|
1097
|
-
e.prevUnsubs !==
|
|
1010
|
+
e.prevUnsubs !== B && Y.release(e.prevUnsubs), e.prevVersions !== T && L.release(e.prevVersions);
|
|
1098
1011
|
} else {
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1012
|
+
j.release(e.nextDeps), L.release(e.nextVersions);
|
|
1013
|
+
const i = e.nextUnsubs;
|
|
1014
|
+
for (let o = 0, r = i.length; o < r; o++)
|
|
1015
|
+
i[o]?.();
|
|
1016
|
+
if (Y.release(i), n !== I)
|
|
1017
|
+
for (let o = 0, r = n.length; o < r; o++) {
|
|
1018
|
+
const c = n[o];
|
|
1019
|
+
c && (c._tempUnsub = void 0);
|
|
1106
1020
|
}
|
|
1107
1021
|
}
|
|
1108
1022
|
}
|
|
1109
|
-
/**
|
|
1110
|
-
* Subscribes to a dependency's changes.
|
|
1111
|
-
* @param dep - The dependency to subscribe to.
|
|
1112
|
-
*/
|
|
1113
1023
|
_subscribeTo(e) {
|
|
1114
1024
|
try {
|
|
1115
|
-
const
|
|
1116
|
-
this._trackModifications && this.
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1025
|
+
const t = e.subscribe(() => {
|
|
1026
|
+
if (this._trackModifications && this.flags & N.EXECUTING && (e._modifiedAtEpoch = this._currentEpoch), this._sync) {
|
|
1027
|
+
this.execute();
|
|
1028
|
+
return;
|
|
1029
|
+
}
|
|
1030
|
+
let i = this._executeTask;
|
|
1031
|
+
i || (i = this._executeTask = () => this.execute()), te.schedule(i);
|
|
1032
|
+
}), n = this._nextUnsubs;
|
|
1033
|
+
n && n.push(t);
|
|
1034
|
+
} catch (t) {
|
|
1035
|
+
console.error(Z(t, Q, m.EFFECT_EXECUTION_FAILED));
|
|
1036
|
+
const n = this._nextUnsubs;
|
|
1037
|
+
n && n.push(() => {
|
|
1121
1038
|
});
|
|
1122
1039
|
}
|
|
1123
1040
|
}
|
|
1124
|
-
/**
|
|
1125
|
-
* Whether the effect has been disposed.
|
|
1126
|
-
*/
|
|
1127
1041
|
get isDisposed() {
|
|
1128
|
-
return (this.flags &
|
|
1042
|
+
return (this.flags & N.DISPOSED) !== 0;
|
|
1129
1043
|
}
|
|
1130
|
-
/**
|
|
1131
|
-
* Total number of times this effect has executed.
|
|
1132
|
-
*/
|
|
1133
1044
|
get executionCount() {
|
|
1134
1045
|
return this._executionCount;
|
|
1135
1046
|
}
|
|
1136
|
-
/**
|
|
1137
|
-
* Whether the effect is currently executing.
|
|
1138
|
-
*/
|
|
1139
1047
|
get isExecuting() {
|
|
1140
|
-
return (this.flags &
|
|
1048
|
+
return (this.flags & N.EXECUTING) !== 0;
|
|
1141
1049
|
}
|
|
1142
1050
|
_setDisposed() {
|
|
1143
|
-
this.flags |=
|
|
1051
|
+
this.flags |= N.DISPOSED;
|
|
1144
1052
|
}
|
|
1145
1053
|
_setExecuting(e) {
|
|
1146
|
-
const
|
|
1147
|
-
this.flags = this.flags & ~
|
|
1054
|
+
const t = N.EXECUTING;
|
|
1055
|
+
this.flags = this.flags & ~t | (e ? -1 : 0) & t;
|
|
1148
1056
|
}
|
|
1149
|
-
/**
|
|
1150
|
-
* Executes the cleanup function if it exists.
|
|
1151
|
-
*/
|
|
1152
1057
|
_safeCleanup() {
|
|
1153
|
-
|
|
1058
|
+
const e = this._cleanup;
|
|
1059
|
+
if (e) {
|
|
1154
1060
|
try {
|
|
1155
|
-
|
|
1156
|
-
} catch (
|
|
1157
|
-
console.error(
|
|
1061
|
+
e();
|
|
1062
|
+
} catch (t) {
|
|
1063
|
+
console.error(Z(t, Q, m.EFFECT_CLEANUP_FAILED));
|
|
1158
1064
|
}
|
|
1159
1065
|
this._cleanup = null;
|
|
1160
1066
|
}
|
|
1161
1067
|
}
|
|
1162
|
-
/**
|
|
1163
|
-
* Checks for infinite loops by tracking execution counts within a flush and time period.
|
|
1164
|
-
* @throws {EffectError} If an infinite loop is detected.
|
|
1165
|
-
*/
|
|
1166
1068
|
_checkInfiniteLoop() {
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1069
|
+
const e = pe;
|
|
1070
|
+
this._lastFlushEpoch !== e && (this._lastFlushEpoch = e, this._executionsInEpoch = 0), ++this._executionsInEpoch > this._maxExecutionsPerFlush && this._throwInfiniteLoopError("per-effect"), et() > V.MAX_EXECUTIONS_PER_FLUSH && this._throwInfiniteLoopError("global"), this._executionCount++;
|
|
1071
|
+
const t = this._history;
|
|
1072
|
+
if (t) {
|
|
1073
|
+
const n = Date.now(), i = this._historyPtr, o = this._historyCapacity;
|
|
1074
|
+
t[i] = n;
|
|
1075
|
+
const r = (i + 1) % o;
|
|
1076
|
+
this._historyPtr = r;
|
|
1077
|
+
const c = t[r] ?? 0;
|
|
1078
|
+
if (c > 0 && n - c < He.ONE_SECOND_MS) {
|
|
1079
|
+
const u = new Q(
|
|
1080
|
+
`Effect executed ${o} times within 1 second. Infinite loop suspected`
|
|
1174
1081
|
);
|
|
1175
|
-
if (this.dispose(), console.error(
|
|
1176
|
-
throw o;
|
|
1082
|
+
if (this.dispose(), console.error(u), this._onError && this._onError(u), x) throw u;
|
|
1177
1083
|
}
|
|
1178
1084
|
}
|
|
1179
1085
|
}
|
|
1180
1086
|
_throwInfiniteLoopError(e) {
|
|
1181
|
-
const
|
|
1182
|
-
`Infinite loop detected (${e}): effect executed ${this._executionsInEpoch} times in current flush. Total executions in flush: ${
|
|
1087
|
+
const t = new Q(
|
|
1088
|
+
`Infinite loop detected (${e}): effect executed ${this._executionsInEpoch} times in current flush. Total executions in flush: ${be}`
|
|
1183
1089
|
);
|
|
1184
|
-
throw this.dispose(), console.error(
|
|
1090
|
+
throw this.dispose(), console.error(t), t;
|
|
1185
1091
|
}
|
|
1186
|
-
/**
|
|
1187
|
-
* Determines if the effect should execute based on dependency versions.
|
|
1188
|
-
* @returns true if any dependency has changed or if it's the first run.
|
|
1189
|
-
*/
|
|
1190
1092
|
_shouldExecute() {
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1093
|
+
const e = this._dependencies;
|
|
1094
|
+
if (e.length === 0) return !0;
|
|
1095
|
+
const t = this._dependencyVersions;
|
|
1096
|
+
for (let n = 0, i = e.length; n < i; n++) {
|
|
1097
|
+
const o = e[n];
|
|
1098
|
+
if (o) {
|
|
1099
|
+
if (o.version !== t[n]) return !0;
|
|
1100
|
+
if ("value" in o)
|
|
1197
1101
|
try {
|
|
1198
|
-
|
|
1102
|
+
Le(() => o.value);
|
|
1199
1103
|
} catch {
|
|
1200
1104
|
return !0;
|
|
1201
1105
|
}
|
|
1202
|
-
if (s.version !== this._dependencyVersions[e])
|
|
1203
|
-
return !0;
|
|
1204
1106
|
}
|
|
1205
1107
|
}
|
|
1206
1108
|
return !1;
|
|
1207
1109
|
}
|
|
1208
|
-
/**
|
|
1209
|
-
* Handles errors occurring during effect execution.
|
|
1210
|
-
* Wraps the error, logs it to console, and calls onError callback if provided.
|
|
1211
|
-
*/
|
|
1212
1110
|
_handleExecutionError(e) {
|
|
1213
|
-
const
|
|
1214
|
-
console.error(
|
|
1111
|
+
const t = Z(e, Q, m.EFFECT_EXECUTION_FAILED);
|
|
1112
|
+
console.error(t);
|
|
1113
|
+
const n = this._onError;
|
|
1114
|
+
n && n(t);
|
|
1215
1115
|
}
|
|
1216
|
-
/**
|
|
1217
|
-
* Checks for potential infinite loops where an effect modifies its own dependencies.
|
|
1218
|
-
* Only active if trackModifications is enabled and debug is on.
|
|
1219
|
-
*/
|
|
1220
1116
|
_checkLoopWarnings() {
|
|
1221
|
-
if (this._trackModifications &&
|
|
1222
|
-
const e = this._dependencies;
|
|
1223
|
-
for (let
|
|
1224
|
-
const
|
|
1225
|
-
|
|
1117
|
+
if (this._trackModifications && O.enabled) {
|
|
1118
|
+
const e = this._dependencies, t = this._currentEpoch;
|
|
1119
|
+
for (let n = 0, i = e.length; n < i; n++) {
|
|
1120
|
+
const o = e[n];
|
|
1121
|
+
o && o._modifiedAtEpoch === t && O.warn(
|
|
1226
1122
|
!0,
|
|
1227
|
-
`Effect is reading a dependency (${
|
|
1123
|
+
`Effect is reading a dependency (${O.getDebugName(o) || "unknown"}) that it just modified. Infinite loop may occur`
|
|
1228
1124
|
);
|
|
1229
1125
|
}
|
|
1230
1126
|
}
|
|
1231
1127
|
}
|
|
1232
1128
|
}
|
|
1233
|
-
function
|
|
1234
|
-
if (typeof
|
|
1235
|
-
throw new
|
|
1236
|
-
const
|
|
1237
|
-
return
|
|
1129
|
+
function J(s, e = {}) {
|
|
1130
|
+
if (typeof s != "function")
|
|
1131
|
+
throw new Q(m.EFFECT_MUST_BE_FUNCTION);
|
|
1132
|
+
const t = new ct(s, e);
|
|
1133
|
+
return t.execute(), t;
|
|
1238
1134
|
}
|
|
1239
|
-
function
|
|
1240
|
-
if (typeof
|
|
1241
|
-
throw new
|
|
1242
|
-
|
|
1135
|
+
function Ve(s) {
|
|
1136
|
+
if (typeof s != "function")
|
|
1137
|
+
throw new k("Batch callback must be a function");
|
|
1138
|
+
te.startBatch();
|
|
1243
1139
|
try {
|
|
1244
|
-
return
|
|
1140
|
+
return s();
|
|
1245
1141
|
} finally {
|
|
1246
|
-
|
|
1142
|
+
te.endBatch();
|
|
1247
1143
|
}
|
|
1248
1144
|
}
|
|
1249
|
-
function ut(
|
|
1250
|
-
return
|
|
1145
|
+
function ut(s) {
|
|
1146
|
+
return s !== null && typeof s == "object" && "value" in s && "subscribe" in s;
|
|
1251
1147
|
}
|
|
1252
|
-
function
|
|
1253
|
-
if (!
|
|
1254
|
-
const e = "jquery" in
|
|
1148
|
+
function ae(s) {
|
|
1149
|
+
if (!s) return "unknown";
|
|
1150
|
+
const e = "jquery" in s ? s[0] : s;
|
|
1255
1151
|
if (!e) return "unknown";
|
|
1256
1152
|
if (e.id) return `#${e.id}`;
|
|
1257
1153
|
if (e.className) {
|
|
1258
|
-
const
|
|
1259
|
-
return
|
|
1154
|
+
const t = String(e.className).split(/\s+/).filter(Boolean).join(".");
|
|
1155
|
+
return t ? `${e.tagName.toLowerCase()}.${t}` : e.tagName.toLowerCase();
|
|
1260
1156
|
}
|
|
1261
1157
|
return e.tagName.toLowerCase();
|
|
1262
1158
|
}
|
|
1263
|
-
function ht(
|
|
1264
|
-
const e =
|
|
1159
|
+
function ht(s) {
|
|
1160
|
+
const e = s.length;
|
|
1265
1161
|
if (e === 0) return new Int32Array(0);
|
|
1266
|
-
const
|
|
1162
|
+
const t = new Int32Array(e), n = new Int32Array(e);
|
|
1267
1163
|
let i = 0;
|
|
1268
|
-
for (let
|
|
1269
|
-
const c =
|
|
1164
|
+
for (let r = 0; r < e; r++) {
|
|
1165
|
+
const c = s[r];
|
|
1270
1166
|
if (c === -1) continue;
|
|
1271
|
-
if (i === 0 ||
|
|
1272
|
-
|
|
1167
|
+
if (i === 0 || s[n[i - 1]] < c) {
|
|
1168
|
+
t[r] = i > 0 ? n[i - 1] : -1, n[i++] = r;
|
|
1273
1169
|
continue;
|
|
1274
1170
|
}
|
|
1275
|
-
let
|
|
1276
|
-
for (;
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1171
|
+
let u = 0, a = i - 1;
|
|
1172
|
+
for (; u < a; ) {
|
|
1173
|
+
const _ = u + a >>> 1;
|
|
1174
|
+
s[n[_]] < c ? u = _ + 1 : a = _;
|
|
1279
1175
|
}
|
|
1280
|
-
c <
|
|
1176
|
+
c < s[n[u]] && (u > 0 && (t[r] = n[u - 1]), n[u] = r);
|
|
1281
1177
|
}
|
|
1282
|
-
const
|
|
1283
|
-
for (let
|
|
1284
|
-
r
|
|
1285
|
-
return
|
|
1178
|
+
const o = new Int32Array(i);
|
|
1179
|
+
for (let r = i - 1, c = n[i - 1]; r >= 0; r--)
|
|
1180
|
+
o[r] = c, c = t[c];
|
|
1181
|
+
return o;
|
|
1286
1182
|
}
|
|
1287
1183
|
function at() {
|
|
1288
1184
|
if (typeof window < "u") {
|
|
1289
|
-
const
|
|
1290
|
-
if (typeof
|
|
1291
|
-
return
|
|
1185
|
+
const s = window.__ATOM_DEBUG__;
|
|
1186
|
+
if (typeof s == "boolean")
|
|
1187
|
+
return s;
|
|
1292
1188
|
}
|
|
1293
1189
|
try {
|
|
1294
1190
|
if (typeof process < "u" && process.env && process.env.NODE_ENV === "development")
|
|
@@ -1297,93 +1193,93 @@ function at() {
|
|
|
1297
1193
|
}
|
|
1298
1194
|
return !1;
|
|
1299
1195
|
}
|
|
1300
|
-
let
|
|
1196
|
+
let q = at();
|
|
1301
1197
|
const g = {
|
|
1302
1198
|
get enabled() {
|
|
1303
|
-
return
|
|
1199
|
+
return q;
|
|
1304
1200
|
},
|
|
1305
|
-
set enabled(
|
|
1306
|
-
|
|
1201
|
+
set enabled(s) {
|
|
1202
|
+
q = s;
|
|
1307
1203
|
},
|
|
1308
|
-
log(
|
|
1309
|
-
|
|
1204
|
+
log(s, ...e) {
|
|
1205
|
+
q && console.log(`[atom-effect-jquery] ${s}:`, ...e);
|
|
1310
1206
|
},
|
|
1311
|
-
atomChanged(
|
|
1312
|
-
|
|
1207
|
+
atomChanged(s, e, t) {
|
|
1208
|
+
q && console.log(`[atom-effect-jquery] Atom "${s || "anonymous"}" changed:`, e, "→", t);
|
|
1313
1209
|
},
|
|
1314
1210
|
/**
|
|
1315
1211
|
* Logs DOM updates and triggers visual highlight.
|
|
1316
1212
|
*/
|
|
1317
|
-
domUpdated(
|
|
1318
|
-
if (!
|
|
1319
|
-
const n =
|
|
1320
|
-
console.log(`[atom-effect-jquery] DOM updated: ${n}.${e} =`,
|
|
1213
|
+
domUpdated(s, e, t) {
|
|
1214
|
+
if (!q) return;
|
|
1215
|
+
const n = ae(s);
|
|
1216
|
+
console.log(`[atom-effect-jquery] DOM updated: ${n}.${e} =`, t), lt(s);
|
|
1321
1217
|
},
|
|
1322
|
-
cleanup(
|
|
1323
|
-
|
|
1218
|
+
cleanup(s) {
|
|
1219
|
+
q && console.log(`[atom-effect-jquery] Cleanup: ${s}`);
|
|
1324
1220
|
},
|
|
1325
|
-
warn(...
|
|
1326
|
-
|
|
1221
|
+
warn(...s) {
|
|
1222
|
+
q && console.warn("[atom-effect-jquery]", ...s);
|
|
1327
1223
|
}
|
|
1328
1224
|
};
|
|
1329
|
-
function lt(
|
|
1330
|
-
const e =
|
|
1225
|
+
function lt(s) {
|
|
1226
|
+
const e = s[0];
|
|
1331
1227
|
if (!e || !document.contains(e)) return;
|
|
1332
|
-
const
|
|
1333
|
-
clearTimeout(
|
|
1334
|
-
outline:
|
|
1335
|
-
outlineOffset:
|
|
1336
|
-
transition:
|
|
1337
|
-
}),
|
|
1228
|
+
const t = "atom_debug_timer", n = "atom_debug_cleanup_timer", i = "atom_debug_org_style";
|
|
1229
|
+
clearTimeout(s.data(t)), clearTimeout(s.data(n)), s.data(i) || s.data(i, {
|
|
1230
|
+
outline: s.css("outline"),
|
|
1231
|
+
outlineOffset: s.css("outline-offset"),
|
|
1232
|
+
transition: s.css("transition")
|
|
1233
|
+
}), s.css({
|
|
1338
1234
|
outline: "2px solid rgba(255, 68, 68, 0.8)",
|
|
1339
1235
|
"outline-offset": "1px",
|
|
1340
1236
|
transition: "none"
|
|
1341
1237
|
// Remove transition for instant feedback on update
|
|
1342
1238
|
});
|
|
1343
|
-
const
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
outline:
|
|
1348
|
-
"outline-offset":
|
|
1239
|
+
const o = setTimeout(() => {
|
|
1240
|
+
const r = s.data(i);
|
|
1241
|
+
s.css("transition", "outline 0.5s ease-out"), requestAnimationFrame(() => {
|
|
1242
|
+
s.css({
|
|
1243
|
+
outline: r?.outline || "",
|
|
1244
|
+
"outline-offset": r?.outlineOffset || ""
|
|
1349
1245
|
});
|
|
1350
1246
|
const c = setTimeout(() => {
|
|
1351
|
-
|
|
1247
|
+
s.css("transition", r?.transition || ""), s.removeData(t), s.removeData(n), s.removeData(i);
|
|
1352
1248
|
}, 500);
|
|
1353
|
-
|
|
1249
|
+
s.data(n, c);
|
|
1354
1250
|
});
|
|
1355
1251
|
}, 100);
|
|
1356
|
-
|
|
1252
|
+
s.data(t, o);
|
|
1357
1253
|
}
|
|
1358
1254
|
const ft = /* @__PURE__ */ new WeakMap();
|
|
1359
|
-
function
|
|
1360
|
-
const
|
|
1361
|
-
return e.name && ft.set(
|
|
1255
|
+
function Be(s, e = {}) {
|
|
1256
|
+
const t = it(s, e);
|
|
1257
|
+
return e.name && ft.set(t, { name: e.name }), t;
|
|
1362
1258
|
}
|
|
1363
|
-
Object.defineProperty(
|
|
1259
|
+
Object.defineProperty(Be, "debug", {
|
|
1364
1260
|
get() {
|
|
1365
1261
|
return g.enabled;
|
|
1366
1262
|
},
|
|
1367
|
-
set(
|
|
1368
|
-
g.enabled =
|
|
1263
|
+
set(s) {
|
|
1264
|
+
g.enabled = s;
|
|
1369
1265
|
}
|
|
1370
1266
|
});
|
|
1371
|
-
function
|
|
1372
|
-
return new Promise((
|
|
1267
|
+
function _t() {
|
|
1268
|
+
return new Promise((s) => setTimeout(s, 0));
|
|
1373
1269
|
}
|
|
1374
|
-
|
|
1375
|
-
atom:
|
|
1270
|
+
h.extend({
|
|
1271
|
+
atom: Be,
|
|
1376
1272
|
computed: rt,
|
|
1377
|
-
effect:
|
|
1378
|
-
batch:
|
|
1379
|
-
untracked:
|
|
1380
|
-
isAtom:
|
|
1381
|
-
isComputed:
|
|
1382
|
-
isReactive: (
|
|
1383
|
-
nextTick:
|
|
1273
|
+
effect: J,
|
|
1274
|
+
batch: Ve,
|
|
1275
|
+
untracked: Le,
|
|
1276
|
+
isAtom: Ee,
|
|
1277
|
+
isComputed: Ae,
|
|
1278
|
+
isReactive: (s) => Ee(s) || Ae(s),
|
|
1279
|
+
nextTick: _t
|
|
1384
1280
|
});
|
|
1385
|
-
const
|
|
1386
|
-
class
|
|
1281
|
+
const ie = "_aes-bound";
|
|
1282
|
+
class dt {
|
|
1387
1283
|
effects = /* @__PURE__ */ new WeakMap();
|
|
1388
1284
|
cleanups = /* @__PURE__ */ new WeakMap();
|
|
1389
1285
|
boundElements = /* @__PURE__ */ new WeakSet();
|
|
@@ -1402,28 +1298,28 @@ class _t {
|
|
|
1402
1298
|
isIgnored(e) {
|
|
1403
1299
|
return this.ignoredNodes.has(e);
|
|
1404
1300
|
}
|
|
1405
|
-
trackEffect(e,
|
|
1301
|
+
trackEffect(e, t) {
|
|
1406
1302
|
let n = this.effects.get(e);
|
|
1407
|
-
n || (n = [], this.effects.set(e, n), this.boundElements.has(e) || (this.boundElements.add(e), e.classList.add(
|
|
1303
|
+
n || (n = [], this.effects.set(e, n), this.boundElements.has(e) || (this.boundElements.add(e), e.classList.add(ie))), n.push(t);
|
|
1408
1304
|
}
|
|
1409
|
-
trackCleanup(e,
|
|
1305
|
+
trackCleanup(e, t) {
|
|
1410
1306
|
let n = this.cleanups.get(e);
|
|
1411
|
-
n || (n = [], this.cleanups.set(e, n), this.boundElements.has(e) || (this.boundElements.add(e), e.classList.add(
|
|
1307
|
+
n || (n = [], this.cleanups.set(e, n), this.boundElements.has(e) || (this.boundElements.add(e), e.classList.add(ie))), n.push(t);
|
|
1412
1308
|
}
|
|
1413
1309
|
hasBind(e) {
|
|
1414
1310
|
return this.boundElements.has(e);
|
|
1415
1311
|
}
|
|
1416
1312
|
cleanup(e) {
|
|
1417
1313
|
if (!this.boundElements.delete(e)) return;
|
|
1418
|
-
e.classList.remove(
|
|
1419
|
-
const
|
|
1420
|
-
if (
|
|
1314
|
+
e.classList.remove(ie), g.cleanup(ae(e));
|
|
1315
|
+
const t = this.effects.get(e);
|
|
1316
|
+
if (t) {
|
|
1421
1317
|
this.effects.delete(e);
|
|
1422
|
-
for (let i = 0,
|
|
1423
|
-
const
|
|
1424
|
-
if (
|
|
1318
|
+
for (let i = 0, o = t.length; i < o; i++) {
|
|
1319
|
+
const r = t[i];
|
|
1320
|
+
if (r)
|
|
1425
1321
|
try {
|
|
1426
|
-
|
|
1322
|
+
r.dispose();
|
|
1427
1323
|
} catch (c) {
|
|
1428
1324
|
g.warn("Effect dispose error:", c);
|
|
1429
1325
|
}
|
|
@@ -1432,11 +1328,11 @@ class _t {
|
|
|
1432
1328
|
const n = this.cleanups.get(e);
|
|
1433
1329
|
if (n) {
|
|
1434
1330
|
this.cleanups.delete(e);
|
|
1435
|
-
for (let i = 0,
|
|
1436
|
-
const
|
|
1437
|
-
if (
|
|
1331
|
+
for (let i = 0, o = n.length; i < o; i++) {
|
|
1332
|
+
const r = n[i];
|
|
1333
|
+
if (r)
|
|
1438
1334
|
try {
|
|
1439
|
-
|
|
1335
|
+
r();
|
|
1440
1336
|
} catch (c) {
|
|
1441
1337
|
g.warn("Cleanup error:", c);
|
|
1442
1338
|
}
|
|
@@ -1444,489 +1340,489 @@ class _t {
|
|
|
1444
1340
|
}
|
|
1445
1341
|
}
|
|
1446
1342
|
cleanupDescendants(e) {
|
|
1447
|
-
const
|
|
1448
|
-
for (let n = 0, i =
|
|
1449
|
-
const
|
|
1450
|
-
|
|
1343
|
+
const t = e.querySelectorAll(`.${ie}`);
|
|
1344
|
+
for (let n = 0, i = t.length; n < i; n++) {
|
|
1345
|
+
const o = t[n];
|
|
1346
|
+
o && this.boundElements.has(o) && this.cleanup(o);
|
|
1451
1347
|
}
|
|
1452
1348
|
}
|
|
1453
1349
|
cleanupTree(e) {
|
|
1454
1350
|
this.cleanupDescendants(e), this.cleanup(e);
|
|
1455
1351
|
}
|
|
1456
1352
|
}
|
|
1457
|
-
const
|
|
1458
|
-
let
|
|
1459
|
-
function pt(
|
|
1460
|
-
|
|
1461
|
-
for (let
|
|
1462
|
-
const i = e[
|
|
1353
|
+
const d = new dt();
|
|
1354
|
+
let ee = null;
|
|
1355
|
+
function pt(s = document.body) {
|
|
1356
|
+
ee || (ee = new MutationObserver((e) => {
|
|
1357
|
+
for (let t = 0, n = e.length; t < n; t++) {
|
|
1358
|
+
const i = e[t];
|
|
1463
1359
|
if (!i) continue;
|
|
1464
|
-
const
|
|
1465
|
-
for (let
|
|
1466
|
-
const
|
|
1467
|
-
|
|
1360
|
+
const o = i.removedNodes;
|
|
1361
|
+
for (let r = 0, c = o.length; r < c; r++) {
|
|
1362
|
+
const u = o[r];
|
|
1363
|
+
u && (d.isKept(u) || d.isIgnored(u) || u.isConnected || u.nodeType === 1 && d.cleanupTree(u));
|
|
1468
1364
|
}
|
|
1469
1365
|
}
|
|
1470
|
-
}),
|
|
1366
|
+
}), ee.observe(s, { childList: !0, subtree: !0 }));
|
|
1471
1367
|
}
|
|
1472
1368
|
function At() {
|
|
1473
|
-
|
|
1369
|
+
ee?.disconnect(), ee = null;
|
|
1474
1370
|
}
|
|
1475
|
-
function
|
|
1476
|
-
const i =
|
|
1371
|
+
function p(s, e, t, n) {
|
|
1372
|
+
const i = h(s), o = s;
|
|
1477
1373
|
if (ut(e)) {
|
|
1478
|
-
const
|
|
1374
|
+
const r = J(() => {
|
|
1479
1375
|
const c = e.value;
|
|
1480
|
-
|
|
1376
|
+
t(c), g.domUpdated(i, n, c);
|
|
1481
1377
|
});
|
|
1482
|
-
|
|
1378
|
+
d.trackEffect(o, r);
|
|
1483
1379
|
} else
|
|
1484
|
-
|
|
1380
|
+
t(e);
|
|
1485
1381
|
}
|
|
1486
|
-
function
|
|
1382
|
+
function je() {
|
|
1487
1383
|
return { timeoutId: null, phase: "idle", hasFocus: !1 };
|
|
1488
1384
|
}
|
|
1489
|
-
function
|
|
1385
|
+
function ze(s, e, t = {}) {
|
|
1490
1386
|
const {
|
|
1491
1387
|
debounce: n,
|
|
1492
1388
|
event: i = "input",
|
|
1493
|
-
parse:
|
|
1494
|
-
format:
|
|
1495
|
-
} =
|
|
1389
|
+
parse: o = (D) => D,
|
|
1390
|
+
format: r = (D) => String(D ?? "")
|
|
1391
|
+
} = t, c = je(), u = () => {
|
|
1496
1392
|
c.phase = "composing";
|
|
1497
|
-
},
|
|
1498
|
-
c.phase = "idle",
|
|
1393
|
+
}, a = () => {
|
|
1394
|
+
c.phase = "idle", S();
|
|
1499
1395
|
};
|
|
1500
|
-
|
|
1501
|
-
const
|
|
1396
|
+
s.on("compositionstart", u), s.on("compositionend", a);
|
|
1397
|
+
const _ = () => {
|
|
1502
1398
|
c.hasFocus = !0;
|
|
1503
|
-
},
|
|
1399
|
+
}, P = () => {
|
|
1504
1400
|
c.hasFocus = !1;
|
|
1505
|
-
const D =
|
|
1506
|
-
|
|
1401
|
+
const D = r(e.value);
|
|
1402
|
+
s.val() !== D && s.val(D);
|
|
1507
1403
|
};
|
|
1508
|
-
|
|
1509
|
-
const
|
|
1510
|
-
c.phase === "idle" && (c.phase = "syncing-to-atom", e.value =
|
|
1511
|
-
},
|
|
1512
|
-
c.phase === "idle" && (n ? (c.timeoutId && clearTimeout(c.timeoutId), c.timeoutId = window.setTimeout(
|
|
1404
|
+
s.on("focus", _), s.on("blur", P);
|
|
1405
|
+
const S = () => {
|
|
1406
|
+
c.phase === "idle" && (c.phase = "syncing-to-atom", e.value = o(s.val()), c.phase = "idle");
|
|
1407
|
+
}, R = () => {
|
|
1408
|
+
c.phase === "idle" && (n ? (c.timeoutId && clearTimeout(c.timeoutId), c.timeoutId = window.setTimeout(S, n)) : S());
|
|
1513
1409
|
};
|
|
1514
|
-
return
|
|
1515
|
-
const D =
|
|
1516
|
-
if (
|
|
1517
|
-
if (c.hasFocus &&
|
|
1410
|
+
return s.on(i, R), s.on("change", R), { effect: () => {
|
|
1411
|
+
const D = r(e.value), K = s.val();
|
|
1412
|
+
if (K !== D) {
|
|
1413
|
+
if (c.hasFocus && o(K) === e.value)
|
|
1518
1414
|
return;
|
|
1519
|
-
c.phase = "syncing-to-dom",
|
|
1415
|
+
c.phase = "syncing-to-dom", s.val(D), g.domUpdated(s, "val", D), c.phase = "idle";
|
|
1520
1416
|
}
|
|
1521
1417
|
}, cleanup: () => {
|
|
1522
|
-
|
|
1418
|
+
s.off(i, R), s.off("change", R), s.off("compositionstart", u), s.off("compositionend", a), s.off("focus", _), s.off("blur", P), c.timeoutId && clearTimeout(c.timeoutId);
|
|
1523
1419
|
} };
|
|
1524
1420
|
}
|
|
1525
|
-
|
|
1421
|
+
h.fn.atomText = function(s, e) {
|
|
1526
1422
|
return this.each(function() {
|
|
1527
|
-
|
|
1423
|
+
p(
|
|
1528
1424
|
this,
|
|
1529
|
-
|
|
1530
|
-
(
|
|
1531
|
-
const n = e ? e(
|
|
1532
|
-
|
|
1425
|
+
s,
|
|
1426
|
+
(t) => {
|
|
1427
|
+
const n = e ? e(t) : String(t ?? "");
|
|
1428
|
+
h(this).text(n);
|
|
1533
1429
|
},
|
|
1534
1430
|
"text"
|
|
1535
1431
|
);
|
|
1536
1432
|
});
|
|
1537
1433
|
};
|
|
1538
|
-
|
|
1434
|
+
h.fn.atomHtml = function(s) {
|
|
1539
1435
|
return this.each(function() {
|
|
1540
|
-
|
|
1436
|
+
p(this, s, (e) => h(this).html(String(e ?? "")), "html");
|
|
1541
1437
|
});
|
|
1542
1438
|
};
|
|
1543
|
-
|
|
1439
|
+
h.fn.atomClass = function(s, e) {
|
|
1544
1440
|
return this.each(function() {
|
|
1545
|
-
|
|
1441
|
+
p(
|
|
1546
1442
|
this,
|
|
1547
1443
|
e,
|
|
1548
|
-
(
|
|
1549
|
-
`class.${
|
|
1444
|
+
(t) => h(this).toggleClass(s, !!t),
|
|
1445
|
+
`class.${s}`
|
|
1550
1446
|
);
|
|
1551
1447
|
});
|
|
1552
1448
|
};
|
|
1553
|
-
|
|
1449
|
+
h.fn.atomCss = function(s, e, t) {
|
|
1554
1450
|
return this.each(function() {
|
|
1555
|
-
|
|
1451
|
+
p(
|
|
1556
1452
|
this,
|
|
1557
1453
|
e,
|
|
1558
1454
|
(n) => {
|
|
1559
|
-
const i =
|
|
1560
|
-
|
|
1455
|
+
const i = t ? `${n}${t}` : n;
|
|
1456
|
+
h(this).css(s, i);
|
|
1561
1457
|
},
|
|
1562
|
-
`css.${
|
|
1458
|
+
`css.${s}`
|
|
1563
1459
|
);
|
|
1564
1460
|
});
|
|
1565
1461
|
};
|
|
1566
|
-
|
|
1462
|
+
h.fn.atomAttr = function(s, e) {
|
|
1567
1463
|
return this.each(function() {
|
|
1568
|
-
|
|
1464
|
+
p(
|
|
1569
1465
|
this,
|
|
1570
1466
|
e,
|
|
1571
|
-
(
|
|
1572
|
-
const n =
|
|
1573
|
-
|
|
1467
|
+
(t) => {
|
|
1468
|
+
const n = h(this);
|
|
1469
|
+
t == null || t === !1 ? n.removeAttr(s) : t === !0 ? n.attr(s, s) : n.attr(s, String(t));
|
|
1574
1470
|
},
|
|
1575
|
-
`attr.${
|
|
1471
|
+
`attr.${s}`
|
|
1576
1472
|
);
|
|
1577
1473
|
});
|
|
1578
1474
|
};
|
|
1579
|
-
|
|
1475
|
+
h.fn.atomProp = function(s, e) {
|
|
1580
1476
|
return this.each(function() {
|
|
1581
|
-
|
|
1477
|
+
p(this, e, (t) => h(this).prop(s, t), `prop.${s}`);
|
|
1582
1478
|
});
|
|
1583
1479
|
};
|
|
1584
|
-
|
|
1480
|
+
h.fn.atomShow = function(s) {
|
|
1585
1481
|
return this.each(function() {
|
|
1586
|
-
|
|
1482
|
+
p(this, s, (e) => h(this).toggle(!!e), "show");
|
|
1587
1483
|
});
|
|
1588
1484
|
};
|
|
1589
|
-
|
|
1485
|
+
h.fn.atomHide = function(s) {
|
|
1590
1486
|
return this.each(function() {
|
|
1591
|
-
|
|
1487
|
+
p(this, s, (e) => h(this).toggle(!e), "hide");
|
|
1592
1488
|
});
|
|
1593
1489
|
};
|
|
1594
|
-
|
|
1490
|
+
h.fn.atomVal = function(s, e = {}) {
|
|
1595
1491
|
return this.each(function() {
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1492
|
+
const t = h(this), { effect: n, cleanup: i } = ze(t, s, e), o = J(n);
|
|
1493
|
+
d.trackEffect(this, o), d.trackCleanup(this, i);
|
|
1598
1494
|
});
|
|
1599
1495
|
};
|
|
1600
|
-
|
|
1496
|
+
h.fn.atomChecked = function(s) {
|
|
1601
1497
|
return this.each(function() {
|
|
1602
|
-
const e =
|
|
1603
|
-
let
|
|
1498
|
+
const e = h(this);
|
|
1499
|
+
let t = !1;
|
|
1604
1500
|
const n = () => {
|
|
1605
|
-
|
|
1501
|
+
t || (s.value = !!e.prop("checked"));
|
|
1606
1502
|
};
|
|
1607
|
-
e.on("change", n),
|
|
1608
|
-
const i =
|
|
1609
|
-
|
|
1610
|
-
const
|
|
1611
|
-
e.prop("checked",
|
|
1503
|
+
e.on("change", n), d.trackCleanup(this, () => e.off("change", n));
|
|
1504
|
+
const i = J(() => {
|
|
1505
|
+
t = !0;
|
|
1506
|
+
const o = !!s.value;
|
|
1507
|
+
e.prop("checked", o), g.domUpdated(e, "checked", o), t = !1;
|
|
1612
1508
|
});
|
|
1613
|
-
|
|
1509
|
+
d.trackEffect(this, i);
|
|
1614
1510
|
});
|
|
1615
1511
|
};
|
|
1616
|
-
|
|
1512
|
+
h.fn.atomOn = function(s, e) {
|
|
1617
1513
|
return this.each(function() {
|
|
1618
|
-
const
|
|
1619
|
-
|
|
1514
|
+
const t = h(this);
|
|
1515
|
+
t.on(s, e), d.trackCleanup(this, () => t.off(s, e));
|
|
1620
1516
|
});
|
|
1621
1517
|
};
|
|
1622
|
-
|
|
1518
|
+
h.fn.atomUnbind = function() {
|
|
1623
1519
|
return this.each(function() {
|
|
1624
|
-
|
|
1520
|
+
d.cleanupTree(this);
|
|
1625
1521
|
});
|
|
1626
1522
|
};
|
|
1627
|
-
function
|
|
1628
|
-
|
|
1629
|
-
|
|
1523
|
+
function Et(s, e) {
|
|
1524
|
+
p(
|
|
1525
|
+
s.el,
|
|
1630
1526
|
e,
|
|
1631
|
-
(
|
|
1632
|
-
|
|
1527
|
+
(t) => {
|
|
1528
|
+
s.el.textContent = String(t ?? "");
|
|
1633
1529
|
},
|
|
1634
1530
|
"text"
|
|
1635
1531
|
);
|
|
1636
1532
|
}
|
|
1637
|
-
function
|
|
1638
|
-
|
|
1639
|
-
|
|
1533
|
+
function gt(s, e) {
|
|
1534
|
+
p(
|
|
1535
|
+
s.el,
|
|
1640
1536
|
e,
|
|
1641
|
-
(
|
|
1642
|
-
|
|
1537
|
+
(t) => {
|
|
1538
|
+
s.el.innerHTML = String(t ?? "");
|
|
1643
1539
|
},
|
|
1644
1540
|
"html"
|
|
1645
1541
|
);
|
|
1646
1542
|
}
|
|
1647
|
-
function bt(
|
|
1648
|
-
for (const
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
e[
|
|
1543
|
+
function bt(s, e) {
|
|
1544
|
+
for (const t in e)
|
|
1545
|
+
p(
|
|
1546
|
+
s.el,
|
|
1547
|
+
e[t],
|
|
1652
1548
|
(n) => {
|
|
1653
|
-
|
|
1549
|
+
s.el.classList.toggle(t, !!n);
|
|
1654
1550
|
},
|
|
1655
|
-
`class.${
|
|
1551
|
+
`class.${t}`
|
|
1656
1552
|
);
|
|
1657
1553
|
}
|
|
1658
|
-
function mt(
|
|
1659
|
-
const
|
|
1554
|
+
function mt(s, e) {
|
|
1555
|
+
const t = s.el.style;
|
|
1660
1556
|
for (const n in e) {
|
|
1661
1557
|
const i = e[n];
|
|
1662
1558
|
if (i === void 0) continue;
|
|
1663
|
-
const
|
|
1559
|
+
const o = n.includes("-") ? n.replace(/-./g, (r) => r.charAt(1).toUpperCase()) : n;
|
|
1664
1560
|
if (Array.isArray(i)) {
|
|
1665
|
-
const [
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
(
|
|
1670
|
-
|
|
1561
|
+
const [r, c] = i;
|
|
1562
|
+
p(
|
|
1563
|
+
s.el,
|
|
1564
|
+
r,
|
|
1565
|
+
(u) => {
|
|
1566
|
+
t[o] = `${u}${c}`;
|
|
1671
1567
|
},
|
|
1672
1568
|
`css.${n}`
|
|
1673
1569
|
);
|
|
1674
1570
|
} else
|
|
1675
|
-
|
|
1676
|
-
|
|
1571
|
+
p(
|
|
1572
|
+
s.el,
|
|
1677
1573
|
i,
|
|
1678
|
-
(
|
|
1679
|
-
|
|
1574
|
+
(r) => {
|
|
1575
|
+
t[o] = r;
|
|
1680
1576
|
},
|
|
1681
1577
|
`css.${n}`
|
|
1682
1578
|
);
|
|
1683
1579
|
}
|
|
1684
1580
|
}
|
|
1685
|
-
function
|
|
1686
|
-
const
|
|
1581
|
+
function St(s, e) {
|
|
1582
|
+
const t = s.el;
|
|
1687
1583
|
for (const n in e) {
|
|
1688
1584
|
const i = e[n];
|
|
1689
|
-
|
|
1690
|
-
|
|
1585
|
+
p(
|
|
1586
|
+
t,
|
|
1691
1587
|
i,
|
|
1692
|
-
(
|
|
1693
|
-
if (
|
|
1694
|
-
|
|
1588
|
+
(o) => {
|
|
1589
|
+
if (o == null || o === !1) {
|
|
1590
|
+
t.removeAttribute(n);
|
|
1695
1591
|
return;
|
|
1696
1592
|
}
|
|
1697
|
-
|
|
1593
|
+
t.setAttribute(n, o === !0 ? n : String(o));
|
|
1698
1594
|
},
|
|
1699
1595
|
`attr.${n}`
|
|
1700
1596
|
);
|
|
1701
1597
|
}
|
|
1702
1598
|
}
|
|
1703
|
-
function
|
|
1704
|
-
const
|
|
1599
|
+
function yt(s, e) {
|
|
1600
|
+
const t = s.el;
|
|
1705
1601
|
for (const n in e)
|
|
1706
|
-
|
|
1707
|
-
|
|
1602
|
+
p(
|
|
1603
|
+
t,
|
|
1708
1604
|
e[n],
|
|
1709
1605
|
(i) => {
|
|
1710
|
-
|
|
1606
|
+
t[n] = i;
|
|
1711
1607
|
},
|
|
1712
1608
|
`prop.${n}`
|
|
1713
1609
|
);
|
|
1714
1610
|
}
|
|
1715
|
-
function
|
|
1716
|
-
|
|
1717
|
-
|
|
1611
|
+
function It(s, e) {
|
|
1612
|
+
p(
|
|
1613
|
+
s.el,
|
|
1718
1614
|
e,
|
|
1719
|
-
(
|
|
1720
|
-
|
|
1615
|
+
(t) => {
|
|
1616
|
+
s.$el.toggle(!!t);
|
|
1721
1617
|
},
|
|
1722
1618
|
"show"
|
|
1723
1619
|
);
|
|
1724
1620
|
}
|
|
1725
|
-
function
|
|
1726
|
-
|
|
1727
|
-
|
|
1621
|
+
function Dt(s, e) {
|
|
1622
|
+
p(
|
|
1623
|
+
s.el,
|
|
1728
1624
|
e,
|
|
1729
|
-
(
|
|
1730
|
-
|
|
1625
|
+
(t) => {
|
|
1626
|
+
s.$el.toggle(!t);
|
|
1731
1627
|
},
|
|
1732
1628
|
"hide"
|
|
1733
1629
|
);
|
|
1734
1630
|
}
|
|
1735
|
-
function Ct(
|
|
1736
|
-
const
|
|
1737
|
-
|
|
1631
|
+
function Ct(s, e) {
|
|
1632
|
+
const t = Array.isArray(e) ? e[0] : e, n = Array.isArray(e) ? e[1] : {}, { effect: i, cleanup: o } = ze(s.$el, t, n), r = J(i);
|
|
1633
|
+
d.trackEffect(s.el, r), s.trackCleanup(o);
|
|
1738
1634
|
}
|
|
1739
|
-
function
|
|
1740
|
-
const
|
|
1741
|
-
|
|
1635
|
+
function Nt(s, e) {
|
|
1636
|
+
const t = je(), n = () => {
|
|
1637
|
+
t.phase === "idle" && (e.value = s.$el.prop("checked"));
|
|
1742
1638
|
};
|
|
1743
|
-
|
|
1744
|
-
const i =
|
|
1745
|
-
|
|
1746
|
-
const
|
|
1747
|
-
|
|
1639
|
+
s.$el.on("change", n), s.trackCleanup(() => s.$el.off("change", n));
|
|
1640
|
+
const i = J(() => {
|
|
1641
|
+
t.phase = "syncing-to-dom";
|
|
1642
|
+
const o = !!e.value;
|
|
1643
|
+
s.$el.prop("checked", o), g.domUpdated(s.$el, "checked", o), t.phase = "idle";
|
|
1748
1644
|
});
|
|
1749
|
-
|
|
1645
|
+
d.trackEffect(s.el, i);
|
|
1750
1646
|
}
|
|
1751
|
-
function
|
|
1752
|
-
const
|
|
1647
|
+
function Tt(s, e) {
|
|
1648
|
+
const t = s.el;
|
|
1753
1649
|
for (const n in e) {
|
|
1754
1650
|
const i = e[n];
|
|
1755
1651
|
if (typeof i != "function") continue;
|
|
1756
|
-
const
|
|
1757
|
-
|
|
1652
|
+
const o = (r) => i.call(t, h.Event(r));
|
|
1653
|
+
t.addEventListener(n, o), s.trackCleanup(() => t.removeEventListener(n, o));
|
|
1758
1654
|
}
|
|
1759
1655
|
}
|
|
1760
|
-
|
|
1656
|
+
h.fn.atomBind = function(s) {
|
|
1761
1657
|
return this.each(function() {
|
|
1762
|
-
const
|
|
1763
|
-
$el:
|
|
1658
|
+
const t = {
|
|
1659
|
+
$el: h(this),
|
|
1764
1660
|
el: this,
|
|
1765
1661
|
effects: [],
|
|
1766
|
-
trackCleanup: (n) =>
|
|
1662
|
+
trackCleanup: (n) => d.trackCleanup(this, n)
|
|
1767
1663
|
};
|
|
1768
|
-
|
|
1664
|
+
s.text !== void 0 && Et(t, s.text), s.html !== void 0 && gt(t, s.html), s.class && bt(t, s.class), s.css && mt(t, s.css), s.attr && St(t, s.attr), s.prop && yt(t, s.prop), s.show !== void 0 && It(t, s.show), s.hide !== void 0 && Dt(t, s.hide), s.val !== void 0 && Ct(t, s.val), s.checked !== void 0 && Nt(t, s.checked), s.on && Tt(t, s.on);
|
|
1769
1665
|
});
|
|
1770
1666
|
};
|
|
1771
|
-
|
|
1772
|
-
const { key:
|
|
1667
|
+
h.fn.atomList = function(s, e) {
|
|
1668
|
+
const { key: t, render: n, bind: i, update: o, onAdd: r, onRemove: c, empty: u } = e, a = typeof t == "function" ? t : (_) => _[t];
|
|
1773
1669
|
return this.each(function() {
|
|
1774
|
-
const
|
|
1775
|
-
let
|
|
1776
|
-
const D =
|
|
1777
|
-
const
|
|
1778
|
-
if (
|
|
1779
|
-
|
|
1670
|
+
const _ = h(this), P = ae(this), S = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Set();
|
|
1671
|
+
let z = [], $ = null;
|
|
1672
|
+
const D = J(() => {
|
|
1673
|
+
const K = s.value, U = K.length;
|
|
1674
|
+
if (U === 0 ? u && !$ && ($ = h(u).appendTo(_)) : $ && ($.remove(), $ = null), U === 0 && S.size === 0) {
|
|
1675
|
+
z = [];
|
|
1780
1676
|
return;
|
|
1781
1677
|
}
|
|
1782
|
-
g.log("list", `${
|
|
1783
|
-
const
|
|
1784
|
-
for (let
|
|
1785
|
-
const
|
|
1786
|
-
|
|
1678
|
+
g.log("list", `${P} updating with ${U} items`);
|
|
1679
|
+
const se = new Array(U), me = /* @__PURE__ */ new Set();
|
|
1680
|
+
for (let f = 0; f < U; f++) {
|
|
1681
|
+
const E = K[f], C = a(E, f);
|
|
1682
|
+
se[f] = C, me.add(C);
|
|
1787
1683
|
}
|
|
1788
|
-
for (const [
|
|
1789
|
-
if (
|
|
1790
|
-
const
|
|
1791
|
-
|
|
1792
|
-
const
|
|
1793
|
-
|
|
1684
|
+
for (const [f, E] of S) {
|
|
1685
|
+
if (me.has(f) || R.has(f)) continue;
|
|
1686
|
+
const C = () => {
|
|
1687
|
+
E.$el.remove();
|
|
1688
|
+
const b = E.$el[0];
|
|
1689
|
+
b && d.cleanup(b), R.delete(f), g.log("list", `${P} removed item:`, f);
|
|
1794
1690
|
};
|
|
1795
|
-
if (
|
|
1796
|
-
const
|
|
1797
|
-
|
|
1691
|
+
if (S.delete(f), R.add(f), c) {
|
|
1692
|
+
const b = c(E.$el);
|
|
1693
|
+
b instanceof Promise ? b.then(C) : C();
|
|
1798
1694
|
} else
|
|
1799
|
-
|
|
1695
|
+
C();
|
|
1800
1696
|
}
|
|
1801
|
-
if (
|
|
1802
|
-
|
|
1697
|
+
if (U === 0) {
|
|
1698
|
+
z = [];
|
|
1803
1699
|
return;
|
|
1804
1700
|
}
|
|
1805
|
-
const
|
|
1806
|
-
for (let
|
|
1807
|
-
const
|
|
1808
|
-
|
|
1701
|
+
const Se = /* @__PURE__ */ new Map();
|
|
1702
|
+
for (let f = 0; f < z.length; f++) {
|
|
1703
|
+
const E = z[f];
|
|
1704
|
+
E !== void 0 && Se.set(E, f);
|
|
1809
1705
|
}
|
|
1810
|
-
const
|
|
1811
|
-
for (let
|
|
1812
|
-
const
|
|
1813
|
-
|
|
1706
|
+
const ye = new Int32Array(U);
|
|
1707
|
+
for (let f = 0; f < U; f++) {
|
|
1708
|
+
const E = se[f];
|
|
1709
|
+
ye[f] = E !== void 0 ? Se.get(E) ?? -1 : -1;
|
|
1814
1710
|
}
|
|
1815
|
-
const
|
|
1816
|
-
let
|
|
1817
|
-
for (let
|
|
1818
|
-
const
|
|
1819
|
-
if (
|
|
1820
|
-
|
|
1821
|
-
const
|
|
1822
|
-
if (!
|
|
1823
|
-
|
|
1711
|
+
const Ie = ht(ye);
|
|
1712
|
+
let le = Ie.length - 1, w = null;
|
|
1713
|
+
for (let f = U - 1; f >= 0; f--) {
|
|
1714
|
+
const E = se[f], C = K[f], b = S.get(E);
|
|
1715
|
+
if (b) {
|
|
1716
|
+
b.item = C;
|
|
1717
|
+
const H = b.$el[0];
|
|
1718
|
+
if (!H) continue;
|
|
1719
|
+
o && o(b.$el, C, f), le >= 0 && Ie[le] === f ? (le--, H.nextSibling !== w && (w ? b.$el.insertBefore(w) : b.$el.appendTo(_))) : w ? b.$el.insertBefore(w) : b.$el.appendTo(_), w = H;
|
|
1824
1720
|
} else {
|
|
1825
|
-
const
|
|
1826
|
-
|
|
1721
|
+
const H = n(C, f), X = H instanceof Element ? h(H) : h(H);
|
|
1722
|
+
S.set(E, { $el: X, item: C }), w ? X.insertBefore(w) : X.appendTo(_), i && i(X, C, f), r && r(X), g.log("list", `${P} added item:`, E), w = X[0] || null;
|
|
1827
1723
|
}
|
|
1828
1724
|
}
|
|
1829
|
-
|
|
1725
|
+
z = se;
|
|
1830
1726
|
});
|
|
1831
|
-
|
|
1832
|
-
|
|
1727
|
+
d.trackEffect(this, D), d.trackCleanup(this, () => {
|
|
1728
|
+
S.clear(), R.clear(), z = [], $?.remove();
|
|
1833
1729
|
});
|
|
1834
1730
|
});
|
|
1835
1731
|
};
|
|
1836
|
-
const
|
|
1837
|
-
|
|
1732
|
+
const re = /* @__PURE__ */ new WeakMap();
|
|
1733
|
+
h.fn.atomMount = function(s, e = {}) {
|
|
1838
1734
|
return this.each(function() {
|
|
1839
|
-
const
|
|
1735
|
+
const t = h(this), n = ae(this), i = re.get(this);
|
|
1840
1736
|
i && (g.log("mount", `${n} unmounting existing component`), i()), g.log("mount", `${n} mounting component`);
|
|
1841
|
-
let
|
|
1737
|
+
let o;
|
|
1842
1738
|
try {
|
|
1843
|
-
|
|
1844
|
-
} catch (
|
|
1845
|
-
console.error("[atom-effect-jquery] Mount error:",
|
|
1739
|
+
o = s(t, e);
|
|
1740
|
+
} catch (u) {
|
|
1741
|
+
console.error("[atom-effect-jquery] Mount error:", u);
|
|
1846
1742
|
return;
|
|
1847
1743
|
}
|
|
1848
|
-
let
|
|
1744
|
+
let r = !1;
|
|
1849
1745
|
const c = () => {
|
|
1850
|
-
if (!
|
|
1851
|
-
if (
|
|
1746
|
+
if (!r) {
|
|
1747
|
+
if (r = !0, g.log("mount", `${n} full cleanup`), typeof o == "function")
|
|
1852
1748
|
try {
|
|
1853
|
-
|
|
1749
|
+
o();
|
|
1854
1750
|
} catch {
|
|
1855
1751
|
}
|
|
1856
|
-
|
|
1752
|
+
d.cleanupTree(this), re.delete(this);
|
|
1857
1753
|
}
|
|
1858
1754
|
};
|
|
1859
|
-
|
|
1755
|
+
re.set(this, c), d.trackCleanup(this, c);
|
|
1860
1756
|
});
|
|
1861
1757
|
};
|
|
1862
|
-
|
|
1758
|
+
h.fn.atomUnmount = function() {
|
|
1863
1759
|
return this.each(function() {
|
|
1864
|
-
|
|
1760
|
+
re.get(this)?.();
|
|
1865
1761
|
});
|
|
1866
1762
|
};
|
|
1867
|
-
const
|
|
1868
|
-
let
|
|
1869
|
-
function
|
|
1870
|
-
if (
|
|
1871
|
-
|
|
1872
|
-
const
|
|
1873
|
-
|
|
1874
|
-
return (
|
|
1875
|
-
|
|
1876
|
-
}),
|
|
1877
|
-
},
|
|
1763
|
+
const W = /* @__PURE__ */ new WeakMap();
|
|
1764
|
+
let Oe = !1;
|
|
1765
|
+
function $e() {
|
|
1766
|
+
if (Oe) return;
|
|
1767
|
+
Oe = !0;
|
|
1768
|
+
const s = h.fn.on, e = h.fn.off, t = h.fn.remove, n = h.fn.empty, i = h.fn.detach;
|
|
1769
|
+
h.fn.remove = function(o) {
|
|
1770
|
+
return (o ? this.filter(o) : this).each(function() {
|
|
1771
|
+
d.cleanupTree(this), d.markIgnored(this);
|
|
1772
|
+
}), t.call(this, o);
|
|
1773
|
+
}, h.fn.empty = function() {
|
|
1878
1774
|
return this.each(function() {
|
|
1879
|
-
|
|
1775
|
+
d.cleanupDescendants(this);
|
|
1880
1776
|
}), n.call(this);
|
|
1881
|
-
},
|
|
1882
|
-
return (
|
|
1883
|
-
|
|
1884
|
-
}), i.call(this,
|
|
1885
|
-
},
|
|
1886
|
-
let
|
|
1887
|
-
for (let c =
|
|
1888
|
-
if (typeof
|
|
1889
|
-
|
|
1777
|
+
}, h.fn.detach = function(o) {
|
|
1778
|
+
return (o ? this.filter(o) : this).each(function() {
|
|
1779
|
+
d.keep(this);
|
|
1780
|
+
}), i.call(this, o);
|
|
1781
|
+
}, h.fn.on = function(...o) {
|
|
1782
|
+
let r = -1;
|
|
1783
|
+
for (let c = o.length - 1; c >= 0; c--)
|
|
1784
|
+
if (typeof o[c] == "function") {
|
|
1785
|
+
r = c;
|
|
1890
1786
|
break;
|
|
1891
1787
|
}
|
|
1892
|
-
if (
|
|
1893
|
-
const c = r
|
|
1894
|
-
let
|
|
1895
|
-
|
|
1896
|
-
return c.apply(this,
|
|
1897
|
-
},
|
|
1788
|
+
if (r !== -1) {
|
|
1789
|
+
const c = o[r];
|
|
1790
|
+
let u;
|
|
1791
|
+
W.has(c) ? u = W.get(c) : (u = function(...a) {
|
|
1792
|
+
return Ve(() => c.apply(this, a));
|
|
1793
|
+
}, W.set(c, u)), o[r] = u;
|
|
1898
1794
|
}
|
|
1899
|
-
return
|
|
1900
|
-
},
|
|
1901
|
-
let
|
|
1902
|
-
for (let c =
|
|
1903
|
-
if (typeof
|
|
1904
|
-
|
|
1795
|
+
return s.apply(this, o);
|
|
1796
|
+
}, h.fn.off = function(...o) {
|
|
1797
|
+
let r = -1;
|
|
1798
|
+
for (let c = o.length - 1; c >= 0; c--)
|
|
1799
|
+
if (typeof o[c] == "function") {
|
|
1800
|
+
r = c;
|
|
1905
1801
|
break;
|
|
1906
1802
|
}
|
|
1907
|
-
if (
|
|
1908
|
-
const c = r
|
|
1909
|
-
|
|
1803
|
+
if (r !== -1) {
|
|
1804
|
+
const c = o[r];
|
|
1805
|
+
W.has(c) && (o[r] = W.get(c));
|
|
1910
1806
|
}
|
|
1911
|
-
return e.apply(this,
|
|
1807
|
+
return e.apply(this, o);
|
|
1912
1808
|
};
|
|
1913
1809
|
}
|
|
1914
|
-
const
|
|
1915
|
-
|
|
1916
|
-
|
|
1810
|
+
const Ot = $e;
|
|
1811
|
+
$e();
|
|
1812
|
+
h(() => {
|
|
1917
1813
|
pt(document.body);
|
|
1918
1814
|
});
|
|
1919
1815
|
export {
|
|
1920
1816
|
it as atom,
|
|
1921
|
-
|
|
1817
|
+
Ve as batch,
|
|
1922
1818
|
rt as computed,
|
|
1923
1819
|
wt as default,
|
|
1924
1820
|
At as disableAutoCleanup,
|
|
1925
|
-
|
|
1821
|
+
J as effect,
|
|
1926
1822
|
pt as enableAutoCleanup,
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1823
|
+
Ot as enablejQueryBatching,
|
|
1824
|
+
$e as enablejQueryOverrides,
|
|
1825
|
+
d as registry,
|
|
1826
|
+
Le as untracked
|
|
1931
1827
|
};
|
|
1932
1828
|
//# sourceMappingURL=index.mjs.map
|