@nil-/xit 0.4.19 → 0.4.20
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/assets/bundler.js +271 -267
- package/assets/index.js +680 -1012
- package/assets/svelte/events.js +1 -1
- package/assets/svelte/index.js +60 -2266
- package/assets/svelte/internal/client.js +2567 -1639
- package/assets/svelte/internal/disclose-version.js +1 -2
- package/assets/svelte/motion.js +158 -204
- package/assets/svelte/reactivity.js +262 -239
- package/assets/svelte/store.js +3085 -113
- package/components/loaders/Helpers.d.ts +8 -22
- package/components/loaders/Reactive.svelte +1 -13
- package/components/loaders/Reactive.svelte.d.ts +29 -0
- package/components/loaders/ReadOnly.svelte +4 -37
- package/components/loaders/ReadOnly.svelte.d.ts +29 -0
- package/index.d.ts +23 -16
- package/index.js +31 -1
- package/package.json +1 -1
- package/test/Frame.svelte +4 -5
- package/test/Save.svelte +1 -1
package/assets/svelte/motion.js
CHANGED
|
@@ -1,104 +1,75 @@
|
|
|
1
|
-
var
|
|
1
|
+
var x = (e) => {
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var r = (e, t, s) => (
|
|
6
|
-
import "./internal/client.js";
|
|
7
|
-
import { MediaQuery as
|
|
8
|
-
import {
|
|
9
|
-
import { b as z, c as st, a as g, l as ht, n as dt, g as D } from "./index.js";
|
|
4
|
+
var X = (e, t, s) => t.has(e) || x("Cannot " + s);
|
|
5
|
+
var r = (e, t, s) => (X(e, t, "read from private field"), s ? s.call(e) : t.get(e)), c = (e, t, s) => t.has(e) ? x("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), a = (e, t, s, i) => (X(e, t, "write to private field"), i ? i.call(e, s) : t.set(e, s), s), _ = (e, t, s) => (X(e, t, "access private method"), s);
|
|
6
|
+
import { r as H, l as V } from "./internal/client.js";
|
|
7
|
+
import { MediaQuery as ht } from "./reactivity.js";
|
|
8
|
+
import { c9 as D, ah as et, a1 as u, cE as at, a$ as ct, a4 as O, cF as st } from "./store.js";
|
|
10
9
|
import { linear as rt } from "./easing.js";
|
|
11
|
-
|
|
12
|
-
// don't access requestAnimationFrame eagerly outside method
|
|
13
|
-
// this allows basic testing of user code without JSDOM
|
|
14
|
-
// bunder will eval and remove ternary when the user's app is built
|
|
15
|
-
tick: (
|
|
16
|
-
/** @param {any} _ */
|
|
17
|
-
(e) => requestAnimationFrame(e)
|
|
18
|
-
),
|
|
19
|
-
now: () => ut(),
|
|
20
|
-
tasks: /* @__PURE__ */ new Set()
|
|
21
|
-
};
|
|
22
|
-
function it() {
|
|
23
|
-
const e = m.now();
|
|
24
|
-
m.tasks.forEach((t) => {
|
|
25
|
-
t.c(e) || (m.tasks.delete(t), t.f());
|
|
26
|
-
}), m.tasks.size !== 0 && m.tick(it);
|
|
27
|
-
}
|
|
28
|
-
function U(e) {
|
|
29
|
-
let t;
|
|
30
|
-
return m.tasks.size === 0 && m.tick(it), {
|
|
31
|
-
promise: new Promise((s) => {
|
|
32
|
-
m.tasks.add(t = { c: e, f: s });
|
|
33
|
-
}),
|
|
34
|
-
abort() {
|
|
35
|
-
m.tasks.delete(t);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function J(e) {
|
|
10
|
+
function L(e) {
|
|
40
11
|
return Object.prototype.toString.call(e) === "[object Date]";
|
|
41
12
|
}
|
|
42
|
-
function
|
|
43
|
-
if (typeof s == "number" ||
|
|
44
|
-
const o = i - s, n = (s - t) / (e.dt || 1 / 60), f = e.opts.stiffness * o,
|
|
45
|
-
return Math.abs(
|
|
13
|
+
function N(e, t, s, i) {
|
|
14
|
+
if (typeof s == "number" || L(s)) {
|
|
15
|
+
const o = i - s, n = (s - t) / (e.dt || 1 / 60), f = e.opts.stiffness * o, h = e.opts.damping * n, m = (f - h) * e.inv_mass, p = (n + m) * e.dt;
|
|
16
|
+
return Math.abs(p) < e.opts.precision && Math.abs(o) < e.opts.precision ? i : (e.settled = !1, L(s) ? new Date(s.getTime() + p) : s + p);
|
|
46
17
|
} else {
|
|
47
18
|
if (Array.isArray(s))
|
|
48
19
|
return s.map(
|
|
49
20
|
(o, n) => (
|
|
50
21
|
// @ts-ignore
|
|
51
|
-
|
|
22
|
+
N(e, t[n], s[n], i[n])
|
|
52
23
|
)
|
|
53
24
|
);
|
|
54
25
|
if (typeof s == "object") {
|
|
55
26
|
const o = {};
|
|
56
27
|
for (const n in s)
|
|
57
|
-
o[n] =
|
|
28
|
+
o[n] = N(e, t[n], s[n], i[n]);
|
|
58
29
|
return o;
|
|
59
30
|
} else
|
|
60
31
|
throw new Error(`Cannot spring ${typeof s} values`);
|
|
61
32
|
}
|
|
62
33
|
}
|
|
63
|
-
function
|
|
64
|
-
const s =
|
|
65
|
-
let f,
|
|
34
|
+
function gt(e, t = {}) {
|
|
35
|
+
const s = st(e), { stiffness: i = 0.15, damping: o = 0.8, precision: n = 0.01 } = t;
|
|
36
|
+
let f, h, m, p = (
|
|
66
37
|
/** @type {T} */
|
|
67
38
|
e
|
|
68
|
-
),
|
|
39
|
+
), g = (
|
|
69
40
|
/** @type {T | undefined} */
|
|
70
41
|
e
|
|
71
|
-
),
|
|
72
|
-
function A(
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
return e == null ||
|
|
76
|
-
if (
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
inv_mass:
|
|
42
|
+
), d = 1, j = 0, y = !1;
|
|
43
|
+
function A(P, b = {}) {
|
|
44
|
+
g = P;
|
|
45
|
+
const nt = m = {};
|
|
46
|
+
return e == null || b.hard || E.stiffness >= 1 && E.damping >= 1 ? (y = !0, f = H.now(), p = P, s.set(e = g), Promise.resolve()) : (b.soft && (j = 1 / ((b.soft === !0 ? 0.5 : +b.soft) * 60), d = 0), h || (f = H.now(), y = !1, h = V((G) => {
|
|
47
|
+
if (y)
|
|
48
|
+
return y = !1, h = null, !1;
|
|
49
|
+
d = Math.min(d + j, 1);
|
|
50
|
+
const ot = Math.min(G - f, 1e3 / 30), W = {
|
|
51
|
+
inv_mass: d,
|
|
81
52
|
opts: E,
|
|
82
53
|
settled: !0,
|
|
83
|
-
dt:
|
|
84
|
-
},
|
|
85
|
-
return f =
|
|
54
|
+
dt: ot * 60 / 1e3
|
|
55
|
+
}, ft = N(W, p, e, g);
|
|
56
|
+
return f = G, p = /** @type {T} */
|
|
86
57
|
e, s.set(e = /** @type {T} */
|
|
87
|
-
|
|
88
|
-
})), new Promise((
|
|
89
|
-
|
|
90
|
-
|
|
58
|
+
ft), W.settled && (h = null), !W.settled;
|
|
59
|
+
})), new Promise((G) => {
|
|
60
|
+
h.promise.then(() => {
|
|
61
|
+
nt === m && G();
|
|
91
62
|
});
|
|
92
63
|
}));
|
|
93
64
|
}
|
|
94
65
|
const E = {
|
|
95
66
|
set: A,
|
|
96
|
-
update: (
|
|
67
|
+
update: (P, b) => A(P(
|
|
97
68
|
/** @type {T} */
|
|
98
|
-
|
|
69
|
+
g,
|
|
99
70
|
/** @type {T} */
|
|
100
71
|
e
|
|
101
|
-
),
|
|
72
|
+
), b),
|
|
102
73
|
subscribe: s.subscribe,
|
|
103
74
|
stiffness: i,
|
|
104
75
|
damping: o,
|
|
@@ -106,34 +77,28 @@ function mt(e, t = {}) {
|
|
|
106
77
|
};
|
|
107
78
|
return E;
|
|
108
79
|
}
|
|
109
|
-
var
|
|
110
|
-
const
|
|
80
|
+
var C, T, $, l, k, F, q, Q, I, M, z, U, it;
|
|
81
|
+
const Y = class Y {
|
|
111
82
|
/**
|
|
112
83
|
* @param {T} value
|
|
113
|
-
* @param {
|
|
84
|
+
* @param {SpringOptions} [options]
|
|
114
85
|
*/
|
|
115
86
|
constructor(t, s = {}) {
|
|
116
|
-
c(this,
|
|
117
|
-
c(this,
|
|
118
|
-
c(this, T,
|
|
119
|
-
c(this,
|
|
120
|
-
c(this,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
)
|
|
124
|
-
c(this,
|
|
125
|
-
|
|
126
|
-
void 0
|
|
127
|
-
));
|
|
128
|
-
c(this, _);
|
|
129
|
-
c(this, Q, 0);
|
|
130
|
-
c(this, q, 1);
|
|
131
|
-
c(this, G, 0);
|
|
87
|
+
c(this, U);
|
|
88
|
+
c(this, C, D(0.15));
|
|
89
|
+
c(this, T, D(0.8));
|
|
90
|
+
c(this, $, D(0.01));
|
|
91
|
+
c(this, l);
|
|
92
|
+
c(this, k);
|
|
93
|
+
c(this, F);
|
|
94
|
+
c(this, q, 0);
|
|
95
|
+
c(this, Q, 1);
|
|
96
|
+
c(this, I, 0);
|
|
132
97
|
/** @type {import('../internal/client/types').Task | null} */
|
|
133
|
-
c(this,
|
|
98
|
+
c(this, M, null);
|
|
134
99
|
/** @type {ReturnType<typeof deferred> | null} */
|
|
135
|
-
c(this,
|
|
136
|
-
|
|
100
|
+
c(this, z, null);
|
|
101
|
+
a(this, l, D(t)), a(this, k, D(t)), typeof s.stiffness == "number" && (r(this, C).v = K(s.stiffness, 0, 1)), typeof s.damping == "number" && (r(this, T).v = K(s.damping, 0, 1)), typeof s.precision == "number" && (r(this, $).v = s.precision);
|
|
137
102
|
}
|
|
138
103
|
/**
|
|
139
104
|
* Create a spring whose value is bound to the return value of `fn`. This must be called
|
|
@@ -150,11 +115,11 @@ const Z = class Z {
|
|
|
150
115
|
* ```
|
|
151
116
|
* @template U
|
|
152
117
|
* @param {() => U} fn
|
|
153
|
-
* @param {
|
|
118
|
+
* @param {SpringOptions} [options]
|
|
154
119
|
*/
|
|
155
120
|
static of(t, s) {
|
|
156
|
-
const i = new
|
|
157
|
-
return
|
|
121
|
+
const i = new Y(t(), s);
|
|
122
|
+
return et(() => {
|
|
158
123
|
i.set(t());
|
|
159
124
|
}), i;
|
|
160
125
|
}
|
|
@@ -167,75 +132,75 @@ const Z = class Z {
|
|
|
167
132
|
* the specified number of milliseconds. This is useful for things like 'fling' gestures.
|
|
168
133
|
*
|
|
169
134
|
* @param {T} value
|
|
170
|
-
* @param {
|
|
135
|
+
* @param {SpringUpdateOptions} [options]
|
|
171
136
|
*/
|
|
172
137
|
set(t, s) {
|
|
173
138
|
var o, n;
|
|
174
|
-
if ((o = r(this,
|
|
175
|
-
return (n = r(this,
|
|
176
|
-
s != null && s.preserveMomentum && (
|
|
177
|
-
var i =
|
|
178
|
-
return i.promise.catch(
|
|
179
|
-
i === r(this,
|
|
139
|
+
if ((o = r(this, z)) == null || o.reject(new Error("Aborted")), s != null && s.instant || r(this, l).v === void 0)
|
|
140
|
+
return (n = r(this, M)) == null || n.abort(), a(this, M, null), u(r(this, l), u(r(this, k), t)), a(this, F, t), Promise.resolve();
|
|
141
|
+
s != null && s.preserveMomentum && (a(this, Q, 0), a(this, I, s.preserveMomentum));
|
|
142
|
+
var i = a(this, z, at());
|
|
143
|
+
return i.promise.catch(ct), _(this, U, it).call(this, t).then(() => {
|
|
144
|
+
i === r(this, z) && i.resolve(void 0);
|
|
180
145
|
}), i.promise;
|
|
181
146
|
}
|
|
182
147
|
get current() {
|
|
183
|
-
return
|
|
148
|
+
return O(r(this, l));
|
|
184
149
|
}
|
|
185
150
|
get damping() {
|
|
186
|
-
return
|
|
151
|
+
return O(r(this, T));
|
|
187
152
|
}
|
|
188
153
|
set damping(t) {
|
|
189
|
-
|
|
154
|
+
u(r(this, T), K(t, 0, 1));
|
|
190
155
|
}
|
|
191
156
|
get precision() {
|
|
192
|
-
return
|
|
157
|
+
return O(r(this, $));
|
|
193
158
|
}
|
|
194
159
|
set precision(t) {
|
|
195
|
-
|
|
160
|
+
u(r(this, $), t);
|
|
196
161
|
}
|
|
197
162
|
get stiffness() {
|
|
198
|
-
return
|
|
163
|
+
return O(r(this, C));
|
|
199
164
|
}
|
|
200
165
|
set stiffness(t) {
|
|
201
|
-
|
|
166
|
+
u(r(this, C), K(t, 0, 1));
|
|
202
167
|
}
|
|
203
168
|
get target() {
|
|
204
|
-
return
|
|
169
|
+
return O(r(this, k));
|
|
205
170
|
}
|
|
206
171
|
set target(t) {
|
|
207
172
|
this.set(t);
|
|
208
173
|
}
|
|
209
174
|
};
|
|
210
|
-
|
|
211
|
-
|
|
175
|
+
C = new WeakMap(), T = new WeakMap(), $ = new WeakMap(), l = new WeakMap(), k = new WeakMap(), F = new WeakMap(), q = new WeakMap(), Q = new WeakMap(), I = new WeakMap(), M = new WeakMap(), z = new WeakMap(), U = new WeakSet(), /** @param {T} value */
|
|
176
|
+
it = function(t) {
|
|
212
177
|
var i;
|
|
213
|
-
if (
|
|
214
|
-
|
|
215
|
-
var s = 1e3 / (r(this,
|
|
216
|
-
r(this,
|
|
217
|
-
|
|
218
|
-
const n = Math.min(o - r(this,
|
|
219
|
-
inv_mass: r(this,
|
|
178
|
+
if (u(r(this, k), t), (i = r(this, l)).v ?? (i.v = t), r(this, F) ?? a(this, F, r(this, l).v), !r(this, M)) {
|
|
179
|
+
a(this, q, H.now());
|
|
180
|
+
var s = 1e3 / (r(this, I) * 60);
|
|
181
|
+
r(this, M) ?? a(this, M, V((o) => {
|
|
182
|
+
a(this, Q, Math.min(r(this, Q) + s, 1));
|
|
183
|
+
const n = Math.min(o - r(this, q), 1e3 / 30), f = {
|
|
184
|
+
inv_mass: r(this, Q),
|
|
220
185
|
opts: {
|
|
221
|
-
stiffness: r(this,
|
|
186
|
+
stiffness: r(this, C).v,
|
|
222
187
|
damping: r(this, T).v,
|
|
223
|
-
precision: r(this,
|
|
188
|
+
precision: r(this, $).v
|
|
224
189
|
},
|
|
225
190
|
settled: !0,
|
|
226
191
|
dt: n * 60 / 1e3
|
|
227
192
|
};
|
|
228
|
-
var
|
|
229
|
-
return
|
|
193
|
+
var h = N(f, r(this, F), r(this, l).v, r(this, k).v);
|
|
194
|
+
return a(this, F, r(this, l).v), a(this, q, o), u(r(this, l), h), f.settled && a(this, M, null), !f.settled;
|
|
230
195
|
}));
|
|
231
196
|
}
|
|
232
|
-
return r(this,
|
|
197
|
+
return r(this, M).promise;
|
|
233
198
|
};
|
|
234
|
-
let
|
|
235
|
-
function
|
|
199
|
+
let v = Y;
|
|
200
|
+
function K(e, t, s) {
|
|
236
201
|
return Math.max(t, Math.min(s, e));
|
|
237
202
|
}
|
|
238
|
-
function
|
|
203
|
+
function S(e, t) {
|
|
239
204
|
if (e === t || e !== e) return () => e;
|
|
240
205
|
const s = typeof e;
|
|
241
206
|
if (s !== typeof t || Array.isArray(e) !== Array.isArray(t))
|
|
@@ -243,7 +208,7 @@ function L(e, t) {
|
|
|
243
208
|
if (Array.isArray(e)) {
|
|
244
209
|
const i = (
|
|
245
210
|
/** @type {Array<any>} */
|
|
246
|
-
t.map((o, n) =>
|
|
211
|
+
t.map((o, n) => S(
|
|
247
212
|
/** @type {Array<any>} */
|
|
248
213
|
e[n],
|
|
249
214
|
o
|
|
@@ -254,17 +219,17 @@ function L(e, t) {
|
|
|
254
219
|
if (s === "object") {
|
|
255
220
|
if (!e || !t)
|
|
256
221
|
throw new Error("Object cannot be null");
|
|
257
|
-
if (
|
|
258
|
-
const n = e.getTime(),
|
|
259
|
-
return (
|
|
222
|
+
if (L(e) && L(t)) {
|
|
223
|
+
const n = e.getTime(), h = t.getTime() - n;
|
|
224
|
+
return (m) => new Date(n + m * h);
|
|
260
225
|
}
|
|
261
226
|
const i = Object.keys(t), o = {};
|
|
262
227
|
return i.forEach((n) => {
|
|
263
|
-
o[n] =
|
|
228
|
+
o[n] = S(e[n], t[n]);
|
|
264
229
|
}), (n) => {
|
|
265
230
|
const f = {};
|
|
266
|
-
return i.forEach((
|
|
267
|
-
f[
|
|
231
|
+
return i.forEach((h) => {
|
|
232
|
+
f[h] = o[h](n);
|
|
268
233
|
}), f;
|
|
269
234
|
};
|
|
270
235
|
}
|
|
@@ -278,69 +243,63 @@ function L(e, t) {
|
|
|
278
243
|
}
|
|
279
244
|
return () => t;
|
|
280
245
|
}
|
|
281
|
-
function
|
|
282
|
-
const s =
|
|
246
|
+
function yt(e, t = {}) {
|
|
247
|
+
const s = st(e);
|
|
283
248
|
let i, o = e;
|
|
284
|
-
function n(f,
|
|
249
|
+
function n(f, h) {
|
|
285
250
|
if (o = f, e == null)
|
|
286
251
|
return s.set(e = f), Promise.resolve();
|
|
287
|
-
let
|
|
288
|
-
delay:
|
|
289
|
-
duration:
|
|
290
|
-
easing:
|
|
291
|
-
interpolate:
|
|
292
|
-
} = { ...t, ...
|
|
293
|
-
if (
|
|
294
|
-
return
|
|
295
|
-
const A =
|
|
252
|
+
let m = i, p = !1, {
|
|
253
|
+
delay: g = 0,
|
|
254
|
+
duration: d = 400,
|
|
255
|
+
easing: j = rt,
|
|
256
|
+
interpolate: y = S
|
|
257
|
+
} = { ...t, ...h };
|
|
258
|
+
if (d === 0)
|
|
259
|
+
return m && (m.abort(), m = null), s.set(e = o), Promise.resolve();
|
|
260
|
+
const A = H.now() + g;
|
|
296
261
|
let E;
|
|
297
|
-
return i =
|
|
298
|
-
if (
|
|
299
|
-
|
|
262
|
+
return i = V((P) => {
|
|
263
|
+
if (P < A) return !0;
|
|
264
|
+
p || (E = y(
|
|
300
265
|
/** @type {any} */
|
|
301
266
|
e,
|
|
302
267
|
f
|
|
303
|
-
), typeof
|
|
268
|
+
), typeof d == "function" && (d = d(
|
|
304
269
|
/** @type {any} */
|
|
305
270
|
e,
|
|
306
271
|
f
|
|
307
|
-
)),
|
|
308
|
-
const
|
|
309
|
-
return
|
|
310
|
-
|
|
272
|
+
)), p = !0), m && (m.abort(), m = null);
|
|
273
|
+
const b = P - A;
|
|
274
|
+
return b > /** @type {number} */
|
|
275
|
+
d ? (s.set(e = f), !1) : (s.set(e = E(j(b / d))), !0);
|
|
311
276
|
}), i.promise;
|
|
312
277
|
}
|
|
313
278
|
return {
|
|
314
279
|
set: n,
|
|
315
|
-
update: (f,
|
|
280
|
+
update: (f, h) => n(f(
|
|
316
281
|
/** @type {any} */
|
|
317
282
|
o,
|
|
318
283
|
/** @type {any} */
|
|
319
284
|
e
|
|
320
|
-
),
|
|
285
|
+
), h),
|
|
321
286
|
subscribe: s.subscribe
|
|
322
287
|
};
|
|
323
288
|
}
|
|
324
|
-
var
|
|
325
|
-
const
|
|
289
|
+
var w, B, J, R;
|
|
290
|
+
const Z = class Z {
|
|
326
291
|
/**
|
|
327
292
|
* @param {T} value
|
|
328
|
-
* @param {
|
|
293
|
+
* @param {TweenOptions<T>} options
|
|
329
294
|
*/
|
|
330
295
|
constructor(t, s = {}) {
|
|
331
|
-
c(this,
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
)
|
|
335
|
-
c(this, $, z(
|
|
336
|
-
/** @type {T} */
|
|
337
|
-
void 0
|
|
338
|
-
));
|
|
339
|
-
/** @type {TweenedOptions<T>} */
|
|
340
|
-
c(this, H);
|
|
296
|
+
c(this, w);
|
|
297
|
+
c(this, B);
|
|
298
|
+
/** @type {TweenOptions<T>} */
|
|
299
|
+
c(this, J);
|
|
341
300
|
/** @type {import('../internal/client/types').Task | null} */
|
|
342
|
-
c(this,
|
|
343
|
-
|
|
301
|
+
c(this, R, null);
|
|
302
|
+
a(this, w, D(t)), a(this, B, D(t)), a(this, J, s);
|
|
344
303
|
}
|
|
345
304
|
/**
|
|
346
305
|
* Create a tween whose value is bound to the return value of `fn`. This must be called
|
|
@@ -357,11 +316,11 @@ const x = class x {
|
|
|
357
316
|
* ```
|
|
358
317
|
* @template U
|
|
359
318
|
* @param {() => U} fn
|
|
360
|
-
* @param {
|
|
319
|
+
* @param {TweenOptions<U>} [options]
|
|
361
320
|
*/
|
|
362
321
|
static of(t, s) {
|
|
363
|
-
const i = new
|
|
364
|
-
return
|
|
322
|
+
const i = new Z(t(), s);
|
|
323
|
+
return et(() => {
|
|
365
324
|
i.set(t());
|
|
366
325
|
}), i;
|
|
367
326
|
}
|
|
@@ -370,60 +329,55 @@ const x = class x {
|
|
|
370
329
|
*
|
|
371
330
|
* If `options` are provided, they will override the tween's defaults.
|
|
372
331
|
* @param {T} value
|
|
373
|
-
* @param {
|
|
332
|
+
* @param {TweenOptions<T>} [options]
|
|
374
333
|
* @returns
|
|
375
334
|
*/
|
|
376
335
|
set(t, s) {
|
|
377
|
-
var
|
|
378
|
-
|
|
336
|
+
var d;
|
|
337
|
+
u(r(this, B), t);
|
|
379
338
|
let {
|
|
380
339
|
delay: i = 0,
|
|
381
340
|
duration: o = 400,
|
|
382
341
|
easing: n = rt,
|
|
383
|
-
interpolate: f =
|
|
384
|
-
} = { ...r(this,
|
|
342
|
+
interpolate: f = S
|
|
343
|
+
} = { ...r(this, J), ...s };
|
|
385
344
|
if (o === 0)
|
|
386
|
-
return (
|
|
387
|
-
const
|
|
388
|
-
let
|
|
389
|
-
return
|
|
390
|
-
if (
|
|
345
|
+
return (d = r(this, R)) == null || d.abort(), u(r(this, w), t), Promise.resolve();
|
|
346
|
+
const h = H.now() + i;
|
|
347
|
+
let m, p = !1, g = r(this, R);
|
|
348
|
+
return a(this, R, V((j) => {
|
|
349
|
+
if (j < h)
|
|
391
350
|
return !0;
|
|
392
|
-
if (!
|
|
393
|
-
|
|
394
|
-
const A = r(this,
|
|
395
|
-
|
|
351
|
+
if (!p) {
|
|
352
|
+
p = !0;
|
|
353
|
+
const A = r(this, w).v;
|
|
354
|
+
m = f(A, t), typeof o == "function" && (o = o(A, t)), g == null || g.abort();
|
|
396
355
|
}
|
|
397
|
-
const
|
|
398
|
-
return
|
|
399
|
-
o ? (
|
|
356
|
+
const y = j - h;
|
|
357
|
+
return y > /** @type {number} */
|
|
358
|
+
o ? (u(r(this, w), t), !1) : (u(r(this, w), m(n(y / /** @type {number} */
|
|
400
359
|
o))), !0);
|
|
401
|
-
})), r(this,
|
|
360
|
+
})), r(this, R).promise;
|
|
402
361
|
}
|
|
403
362
|
get current() {
|
|
404
|
-
return
|
|
363
|
+
return O(r(this, w));
|
|
405
364
|
}
|
|
406
365
|
get target() {
|
|
407
|
-
return
|
|
366
|
+
return O(r(this, B));
|
|
408
367
|
}
|
|
409
368
|
set target(t) {
|
|
410
369
|
this.set(t);
|
|
411
370
|
}
|
|
412
371
|
};
|
|
413
|
-
|
|
414
|
-
let
|
|
415
|
-
const
|
|
372
|
+
w = new WeakMap(), B = new WeakMap(), J = new WeakMap(), R = new WeakMap();
|
|
373
|
+
let tt = Z;
|
|
374
|
+
const bt = /* @__PURE__ */ new ht(
|
|
416
375
|
"(prefers-reduced-motion: reduce)"
|
|
417
|
-
)
|
|
418
|
-
__proto__: null,
|
|
419
|
-
Spring: X,
|
|
420
|
-
Tween: Y,
|
|
421
|
-
prefersReducedMotion: pt,
|
|
422
|
-
spring: mt,
|
|
423
|
-
tweened: lt
|
|
424
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
376
|
+
);
|
|
425
377
|
export {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
378
|
+
v as Spring,
|
|
379
|
+
tt as Tween,
|
|
380
|
+
bt as prefersReducedMotion,
|
|
381
|
+
gt as spring,
|
|
382
|
+
yt as tweened
|
|
429
383
|
};
|