@tixyel/streamelements 7.1.0 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +210 -0
- package/dist/index.es.js +119 -23
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3106,7 +3106,217 @@ type IdentifyYouTubeResult = {
|
|
|
3106
3106
|
top: TopType;
|
|
3107
3107
|
};
|
|
3108
3108
|
|
|
3109
|
+
type Point = {
|
|
3110
|
+
x: number;
|
|
3111
|
+
y: number;
|
|
3112
|
+
};
|
|
3113
|
+
type AnimOptions = {
|
|
3114
|
+
/** Duration in seconds. Default: `1` */
|
|
3115
|
+
duration?: number;
|
|
3116
|
+
fps?: number;
|
|
3117
|
+
easing?: (t: number) => number;
|
|
3118
|
+
};
|
|
3119
|
+
type AnimResult = {
|
|
3120
|
+
x: number[];
|
|
3121
|
+
y: number[];
|
|
3122
|
+
};
|
|
3123
|
+
type QuadraticParams = AnimOptions & {
|
|
3124
|
+
from: Point;
|
|
3125
|
+
to: Point;
|
|
3126
|
+
control: Point;
|
|
3127
|
+
};
|
|
3128
|
+
type CubicParams = AnimOptions & {
|
|
3129
|
+
from: Point & {
|
|
3130
|
+
control: Point;
|
|
3131
|
+
};
|
|
3132
|
+
to: Point & {
|
|
3133
|
+
control: Point;
|
|
3134
|
+
};
|
|
3135
|
+
};
|
|
3136
|
+
type MultiCubicPoint = Point & {
|
|
3137
|
+
control?: Point;
|
|
3138
|
+
controlIn?: Point;
|
|
3139
|
+
controlOut?: Point;
|
|
3140
|
+
};
|
|
3141
|
+
type MultiCubicParams = AnimOptions & {
|
|
3142
|
+
points: [MultiCubicPoint, MultiCubicPoint, MultiCubicPoint, ...MultiCubicPoint[]];
|
|
3143
|
+
};
|
|
3144
|
+
type CircleParams = AnimOptions & {
|
|
3145
|
+
center: Point;
|
|
3146
|
+
radius: number;
|
|
3147
|
+
from?: number;
|
|
3148
|
+
to?: number;
|
|
3149
|
+
};
|
|
3150
|
+
type SpiralParams = AnimOptions & {
|
|
3151
|
+
center: Point;
|
|
3152
|
+
radius: {
|
|
3153
|
+
from: number;
|
|
3154
|
+
to: number;
|
|
3155
|
+
};
|
|
3156
|
+
turns?: number;
|
|
3157
|
+
};
|
|
3158
|
+
declare class AnimateHelper {
|
|
3159
|
+
/**
|
|
3160
|
+
* Interpolate a number from start to end
|
|
3161
|
+
* @example
|
|
3162
|
+
* ```ts
|
|
3163
|
+
* const value = animate.lerp(0, 100, 0.5);
|
|
3164
|
+
* console.log(value); // 50
|
|
3165
|
+
* // Clamped between 0 and 1
|
|
3166
|
+
* const clamped = animate.lerp(0, 100, 1.5);
|
|
3167
|
+
* console.log(clamped); // 100
|
|
3168
|
+
* const clamped2 = animate.lerp(0, 100, -0.5);
|
|
3169
|
+
* console.log(clamped2); // 0
|
|
3170
|
+
* const easeIn = animate.lerp(0, 100, (t) => t * t);
|
|
3171
|
+
* console.log(easeIn); // 25 at t=0.5
|
|
3172
|
+
* const linear = animate.lerp(0, 100, 0.5);
|
|
3173
|
+
* console.log(linear); // 50 at t=0.5
|
|
3174
|
+
* // Ease-in should be less than linear at t=0.5
|
|
3175
|
+
* console.log(easeIn < linear); // true
|
|
3176
|
+
* ```
|
|
3177
|
+
*/
|
|
3178
|
+
lerp(start: number, end: number, t: number): number;
|
|
3179
|
+
/**
|
|
3180
|
+
* Create a quadratic Bezier path between two positions using a control point.
|
|
3181
|
+
* Returns sampled x/y coordinates for the animation timeline.
|
|
3182
|
+
* @example
|
|
3183
|
+
* ```ts
|
|
3184
|
+
* const { x, y } = animate.quadratic({
|
|
3185
|
+
* from: { x: 0, y: 0 },
|
|
3186
|
+
* to: { x: 100, y: 0 },
|
|
3187
|
+
* control: { x: 50, y: 50 },
|
|
3188
|
+
* duration: 1,
|
|
3189
|
+
* fps: 60,
|
|
3190
|
+
* easing: Motion.easeInOut,
|
|
3191
|
+
* });
|
|
3192
|
+
*
|
|
3193
|
+
* // Use with Motion.animate
|
|
3194
|
+
* Motion.animate(element, { x, y }, { duration: 1 });
|
|
3195
|
+
* ```
|
|
3196
|
+
*/
|
|
3197
|
+
quadratic({ from, to, control, duration, fps, easing, }: QuadraticParams): AnimResult;
|
|
3198
|
+
/**
|
|
3199
|
+
* Create a cubic Bezier path between two positions using two control points.
|
|
3200
|
+
* Returns sampled x/y coordinates for the animation timeline.
|
|
3201
|
+
* @example
|
|
3202
|
+
* ```ts
|
|
3203
|
+
* const { x, y } = animate.cubic({
|
|
3204
|
+
* from: { x: 0, y: 0, control: { x: 50, y: 100 } },
|
|
3205
|
+
* to: { x: 200, y: 0, control: { x: 150, y: 100 } },
|
|
3206
|
+
* duration: 2,
|
|
3207
|
+
* fps: 60,
|
|
3208
|
+
* easing: Motion.easeInOut,
|
|
3209
|
+
* });
|
|
3210
|
+
* ```
|
|
3211
|
+
*/
|
|
3212
|
+
cubic({ from, to, duration, fps, easing }: CubicParams): AnimResult;
|
|
3213
|
+
private getMultiCubicOutgoingControl;
|
|
3214
|
+
private getMultiCubicIncomingControl;
|
|
3215
|
+
/**
|
|
3216
|
+
* Create a chained cubic Bezier path using 3 or more points.
|
|
3217
|
+
* First and last points use a single control handle.
|
|
3218
|
+
* Middle points can use separate incoming and outgoing handles.
|
|
3219
|
+
*
|
|
3220
|
+
* Every consecutive pair creates one cubic segment:
|
|
3221
|
+
* `P0 = points[i]`, `P1 = points[i].controlOut`, `P2 = points[i + 1].controlIn`, `P3 = points[i + 1]`.
|
|
3222
|
+
*
|
|
3223
|
+
* For compatibility, `control` is treated as a shared handle when `controlIn` or `controlOut`
|
|
3224
|
+
* are not provided.
|
|
3225
|
+
* @example
|
|
3226
|
+
* ```ts
|
|
3227
|
+
* const { x, y } = animate.multiCubic({
|
|
3228
|
+
* points: [
|
|
3229
|
+
* { x: 0, y: 0, control: { x: 20, y: 40 } },
|
|
3230
|
+
* {
|
|
3231
|
+
* x: 100,
|
|
3232
|
+
* y: 0,
|
|
3233
|
+
* controlIn: { x: 80, y: 60 },
|
|
3234
|
+
* controlOut: { x: 120, y: -20 },
|
|
3235
|
+
* },
|
|
3236
|
+
* { x: 200, y: 50, control: { x: 160, y: 120 } },
|
|
3237
|
+
* ],
|
|
3238
|
+
* duration: 2,
|
|
3239
|
+
* fps: 60,
|
|
3240
|
+
* easing: Motion.easeInOut,
|
|
3241
|
+
* });
|
|
3242
|
+
* ```
|
|
3243
|
+
*/
|
|
3244
|
+
multiCubic({ points, duration, fps, easing }: MultiCubicParams): AnimResult;
|
|
3245
|
+
/**
|
|
3246
|
+
* Create a circular path around a center point.
|
|
3247
|
+
* Angles in degrees. Default: `from: 0`, `to: 360`.
|
|
3248
|
+
* @example
|
|
3249
|
+
* ```ts
|
|
3250
|
+
* const { x, y } = animate.circle({
|
|
3251
|
+
* center: { x: 100, y: 100 },
|
|
3252
|
+
* radius: 50,
|
|
3253
|
+
* from: 0,
|
|
3254
|
+
* to: 360,
|
|
3255
|
+
* duration: 3,
|
|
3256
|
+
* fps: 60,
|
|
3257
|
+
* });
|
|
3258
|
+
* ```
|
|
3259
|
+
*/
|
|
3260
|
+
circle({ center, radius, from, to, duration, fps, easing, }: CircleParams): AnimResult;
|
|
3261
|
+
/**
|
|
3262
|
+
* Create a spiral path around a center point.
|
|
3263
|
+
* @example
|
|
3264
|
+
* ```ts
|
|
3265
|
+
* const { x, y } = animate.spiral({
|
|
3266
|
+
* center: { x: 0, y: 0 },
|
|
3267
|
+
* radius: { from: 10, to: 100 },
|
|
3268
|
+
* turns: 3,
|
|
3269
|
+
* duration: 2,
|
|
3270
|
+
* fps: 60,
|
|
3271
|
+
* easing: (t) => 1 - (1 - t) * (1 - t),
|
|
3272
|
+
* });
|
|
3273
|
+
*
|
|
3274
|
+
* // This will create a spiral that starts at radius 10 and expands to radius 100 over 3 turns.
|
|
3275
|
+
* ```
|
|
3276
|
+
*/
|
|
3277
|
+
spiral({ center, radius, turns, duration, fps, easing, }: SpiralParams): AnimResult;
|
|
3278
|
+
/**
|
|
3279
|
+
* Chain multiple animation paths together sequentially.
|
|
3280
|
+
* @example
|
|
3281
|
+
* ```ts
|
|
3282
|
+
* const path1 = animate.quadratic({
|
|
3283
|
+
* from: { x: 0, y: 0 },
|
|
3284
|
+
* to: { x: 100, y: 0 },
|
|
3285
|
+
* control: { x: 50, y: 50 },
|
|
3286
|
+
* duration: 1,
|
|
3287
|
+
* fps: 60,
|
|
3288
|
+
* });
|
|
3289
|
+
*
|
|
3290
|
+
* const path2 = animate.circle({
|
|
3291
|
+
* center: { x: 100, y: 0 },
|
|
3292
|
+
* radius: 30,
|
|
3293
|
+
* from: 0,
|
|
3294
|
+
* to: 180,
|
|
3295
|
+
* duration: 1,
|
|
3296
|
+
* fps: 60,
|
|
3297
|
+
* });
|
|
3298
|
+
*
|
|
3299
|
+
* const combined = animate.chain(path1, path2);
|
|
3300
|
+
* ```
|
|
3301
|
+
*/
|
|
3302
|
+
chain(...animations: AnimResult[]): AnimResult;
|
|
3303
|
+
/**
|
|
3304
|
+
* Execute multiple animations in sequence with optional delays between them.
|
|
3305
|
+
* Each animation will be sampled and delays will add repeating the last coordinate.
|
|
3306
|
+
* @example
|
|
3307
|
+
* ```ts
|
|
3308
|
+
* const path1 = animate.quadratic({ from: { x: 0, y: 0 }, to: { x: 50, y: 0 }, control: { x: 25, y: 25 }, duration: 0.5, fps: 30 });
|
|
3309
|
+
* const path2 = animate.quadratic({ from: { x: 50, y: 0 }, to: { x: 100, y: 0 }, control: { x: 75, y: 25 }, duration: 0.5, fps: 30 });
|
|
3310
|
+
*
|
|
3311
|
+
* // 30 frames delay between animations
|
|
3312
|
+
* const sequenced = animate.sequence([path1, path2], 30);
|
|
3313
|
+
* ```
|
|
3314
|
+
*/
|
|
3315
|
+
sequence(animations: AnimResult[], delayFrames?: number | number[]): AnimResult;
|
|
3316
|
+
}
|
|
3317
|
+
|
|
3109
3318
|
declare namespace Helper {
|
|
3319
|
+
const animate: AnimateHelper;
|
|
3110
3320
|
const number: NumberHelper;
|
|
3111
3321
|
const element: ElementHelper;
|
|
3112
3322
|
const object: ObjectHelper;
|
package/dist/index.es.js
CHANGED
|
@@ -262,8 +262,8 @@ var e = class {
|
|
|
262
262
|
if (l === 0 || u === 0) throw Error("Element has zero width or height, cannot scale");
|
|
263
263
|
let d = c.width * n / l, f = c.height * n / u, p = o === "width" ? d : o === "height" ? f : Math.min(d, f);
|
|
264
264
|
if (t > 0) {
|
|
265
|
-
let e = c.width * t / l, n = c.height * t / u
|
|
266
|
-
p = Math.max(
|
|
265
|
+
let e = c.width * t / l, n = c.height * t / u;
|
|
266
|
+
p = Math.max(Math.max(e, n), p);
|
|
267
267
|
}
|
|
268
268
|
let m = {
|
|
269
269
|
width: l * p,
|
|
@@ -275,10 +275,10 @@ var e = class {
|
|
|
275
275
|
scalev2(e, t = {}) {
|
|
276
276
|
let { parent: n = e.parentElement, prefer: r = "auto", min: i = 0, max: a = 1, apply: o = () => {} } = t;
|
|
277
277
|
if (!n) throw Error("No parent element found for scaling");
|
|
278
|
-
let s = n.getBoundingClientRect(), c = e.getBoundingClientRect(), l = s.width, u = s.height, d = c.width, f = c.height, p = l * i / d, m = u * i / f, h = l * a / d, g = u * a / f, _ = Math.min(h, g)
|
|
279
|
-
_ = Math.max(_,
|
|
280
|
-
let
|
|
281
|
-
return r === "width" ? _ = Math.max(p, Math.min(h, l / d)) : r === "height" ? _ = Math.max(m, Math.min(g, u / f)) :
|
|
278
|
+
let s = n.getBoundingClientRect(), c = e.getBoundingClientRect(), l = s.width, u = s.height, d = c.width, f = c.height, p = l * i / d, m = u * i / f, h = l * a / d, g = u * a / f, _ = Math.min(h, g);
|
|
279
|
+
_ = Math.max(_, Math.max(p, m));
|
|
280
|
+
let v = d * _, y = f * _;
|
|
281
|
+
return r === "width" ? _ = Math.max(p, Math.min(h, l / d)) : r === "height" ? _ = Math.max(m, Math.min(g, u / f)) : v > l ? _ = Math.max(p, Math.min(h, l / d)) : y > u && (_ = Math.max(m, Math.min(g, u / f))), o.apply(e, [_, e]), _;
|
|
282
282
|
}
|
|
283
283
|
fitText(e, t = 1, n = {}) {
|
|
284
284
|
let r = parseFloat(getComputedStyle(e).getPropertyValue("font-size")), a = {
|
|
@@ -9704,8 +9704,8 @@ var M = class {
|
|
|
9704
9704
|
function m(e, t) {
|
|
9705
9705
|
let n = e?.trim?.() ?? "";
|
|
9706
9706
|
if (!n.length) return null;
|
|
9707
|
-
let r = t[n], i = r === void 0 ? n : r
|
|
9708
|
-
return isNaN(
|
|
9707
|
+
let r = t[n], i = parseFloat(String(r === void 0 ? n : r).replace(/\s/g, ""));
|
|
9708
|
+
return isNaN(i) ? null : i;
|
|
9709
9709
|
}
|
|
9710
9710
|
function h(e, t, n) {
|
|
9711
9711
|
let r = isNaN(Number(t)) ? 0 : Math.max(0, parseInt(String(t))), i = m(e, n);
|
|
@@ -9720,8 +9720,8 @@ var M = class {
|
|
|
9720
9720
|
}
|
|
9721
9721
|
}
|
|
9722
9722
|
function g(e, t = /* @__PURE__ */ new Date()) {
|
|
9723
|
-
let n = t.getTime() - e.getTime(), r = n >= 0, i = Math.abs(n), a = Math.floor(i /
|
|
9724
|
-
return
|
|
9723
|
+
let n = t.getTime() - e.getTime(), r = n >= 0, i = Math.floor(Math.abs(n) / 1e3), a = Math.floor(i / 60), o = Math.floor(a / 60), s = Math.floor(o / 24), c = Math.floor(s / 30), l = Math.floor(s / 365), u = r ? "ago" : "from now";
|
|
9724
|
+
return l > 0 ? `${l}y ${u}` : c > 0 ? `${c}mo ${u}` : s > 0 ? `${s}d ${u}` : o > 0 ? `${o}h ${u}` : a > 0 ? `${a}m ${u}` : `${Math.max(i, 0)}s ${u}`;
|
|
9725
9725
|
}
|
|
9726
9726
|
function _(e, t, n) {
|
|
9727
9727
|
let r = e?.trim?.() ?? "";
|
|
@@ -10311,7 +10311,7 @@ var M = class {
|
|
|
10311
10311
|
message: new T().array(e)[0]
|
|
10312
10312
|
};
|
|
10313
10313
|
}
|
|
10314
|
-
}, z = class {
|
|
10314
|
+
}, z = class e {
|
|
10315
10315
|
delay(e, t) {
|
|
10316
10316
|
return new Promise((n) => setTimeout(() => {
|
|
10317
10317
|
n(t ? t() ?? null : null);
|
|
@@ -10358,9 +10358,9 @@ var M = class {
|
|
|
10358
10358
|
isSameMoment: i === 0
|
|
10359
10359
|
};
|
|
10360
10360
|
}
|
|
10361
|
-
probability(
|
|
10362
|
-
let
|
|
10363
|
-
for (let [e, t] of
|
|
10361
|
+
probability(t) {
|
|
10362
|
+
let n = Object.values(t).reduce((e, t) => e + t, 0), r = new e().typedEntries(t).sort((e, t) => t[1] - e[1]), i = Math.random() * n, a = 0;
|
|
10363
|
+
for (let [e, t] of r) if (a += t, i < a) return e;
|
|
10364
10364
|
}
|
|
10365
10365
|
async findSubscriptionTier({ userId: e, name: t, broadcasterId: n }, r, i = !1) {
|
|
10366
10366
|
let a = (e) => e === "prime" || e === "1000" || e === 1e3 || e === 1 || e === "1" ? 1 : e === "2000" || e === 2e3 || e === 2 || e === "2" ? 2 : e === "3000" || e === 3e3 || e === 3 || e === "3" ? 3 : 1;
|
|
@@ -10474,9 +10474,105 @@ var M = class {
|
|
|
10474
10474
|
}
|
|
10475
10475
|
}
|
|
10476
10476
|
}
|
|
10477
|
+
}, ne = class {
|
|
10478
|
+
lerp(e, t, n) {
|
|
10479
|
+
let r = Math.max(0, Math.min(1, n));
|
|
10480
|
+
return e + (t - e) * r;
|
|
10481
|
+
}
|
|
10482
|
+
quadratic({ from: e, to: t, control: n, duration: r = 1, fps: i = 60, easing: a = (e) => e }) {
|
|
10483
|
+
let o = Math.max(2, Math.round(r * i)), s = [], c = [];
|
|
10484
|
+
for (let r = 0; r <= o; r++) {
|
|
10485
|
+
let i = a(r / o);
|
|
10486
|
+
s.push((1 - i) * (1 - i) * e.x + 2 * (1 - i) * i * n.x + i * i * t.x), c.push((1 - i) * (1 - i) * e.y + 2 * (1 - i) * i * n.y + i * i * t.y);
|
|
10487
|
+
}
|
|
10488
|
+
return {
|
|
10489
|
+
x: s,
|
|
10490
|
+
y: c
|
|
10491
|
+
};
|
|
10492
|
+
}
|
|
10493
|
+
cubic({ from: e, to: t, duration: n = 1, fps: r = 60, easing: i = (e) => e }) {
|
|
10494
|
+
let a = Math.max(2, Math.round(n * r)), o = [], s = [];
|
|
10495
|
+
for (let n = 0; n <= a; n++) {
|
|
10496
|
+
let r = i(n / a), c = 1 - r;
|
|
10497
|
+
o.push(c * c * c * e.x + 3 * c * c * r * e.control.x + 3 * c * r * r * t.control.x + r * r * r * t.x), s.push(c * c * c * e.y + 3 * c * c * r * e.control.y + 3 * c * r * r * t.control.y + r * r * r * t.y);
|
|
10498
|
+
}
|
|
10499
|
+
return {
|
|
10500
|
+
x: o,
|
|
10501
|
+
y: s
|
|
10502
|
+
};
|
|
10503
|
+
}
|
|
10504
|
+
getMultiCubicOutgoingControl(e, t) {
|
|
10505
|
+
let n = e.controlOut ?? e.control;
|
|
10506
|
+
if (n) return n;
|
|
10507
|
+
throw Error(t === 0 ? "The first multiCubic point requires `control` or `controlOut`." : `The multiCubic point at index ${t} requires \`controlOut\` or a shared \`control\`.`);
|
|
10508
|
+
}
|
|
10509
|
+
getMultiCubicIncomingControl(e, t, n) {
|
|
10510
|
+
let r = e.controlIn ?? e.control;
|
|
10511
|
+
if (r) return r;
|
|
10512
|
+
throw Error(t === n ? "The last multiCubic point requires `control` or `controlIn`." : `The multiCubic point at index ${t} requires \`controlIn\` or a shared \`control\`.`);
|
|
10513
|
+
}
|
|
10514
|
+
multiCubic({ points: e, duration: t = 1, fps: n = 60, easing: r = (e) => e }) {
|
|
10515
|
+
if (e.length < 3) throw Error("multiCubic requires at least 3 points.");
|
|
10516
|
+
let i = e.length - 1, a = e.length - 1, o = Math.max(2, Math.round(t * n)), s = Math.max(1, Math.floor(o / i)), c = o % i, l = [], u = [];
|
|
10517
|
+
for (let t = 0; t < i; t++) {
|
|
10518
|
+
let n = e[t], i = e[t + 1], o = this.getMultiCubicOutgoingControl(n, t), d = this.getMultiCubicIncomingControl(i, t + 1, a), f = s + (c > 0 ? 1 : 0);
|
|
10519
|
+
c > 0 && c--;
|
|
10520
|
+
let p = t === 0 ? 0 : 1;
|
|
10521
|
+
for (let e = p; e <= f; e++) {
|
|
10522
|
+
let t = r(e / f), a = 1 - t;
|
|
10523
|
+
l.push(a * a * a * n.x + 3 * a * a * t * o.x + 3 * a * t * t * d.x + t * t * t * i.x), u.push(a * a * a * n.y + 3 * a * a * t * o.y + 3 * a * t * t * d.y + t * t * t * i.y);
|
|
10524
|
+
}
|
|
10525
|
+
}
|
|
10526
|
+
return {
|
|
10527
|
+
x: l,
|
|
10528
|
+
y: u
|
|
10529
|
+
};
|
|
10530
|
+
}
|
|
10531
|
+
circle({ center: e, radius: t, from: n = 0, to: r = 360, duration: i = 1, fps: a = 60, easing: o = (e) => e }) {
|
|
10532
|
+
let s = Math.max(2, Math.round(i * a)), c = [], l = [];
|
|
10533
|
+
for (let i = 0; i <= s; i++) {
|
|
10534
|
+
let a = o(i / s), u = (n + (r - n) * a) * Math.PI / 180;
|
|
10535
|
+
c.push(e.x + t * Math.cos(u)), l.push(e.y + t * Math.sin(u));
|
|
10536
|
+
}
|
|
10537
|
+
return {
|
|
10538
|
+
x: c,
|
|
10539
|
+
y: l
|
|
10540
|
+
};
|
|
10541
|
+
}
|
|
10542
|
+
spiral({ center: e, radius: t, turns: n = 1, duration: r = 1, fps: i = 60, easing: a = (e) => e }) {
|
|
10543
|
+
let o = Math.max(2, Math.round(r * i)), s = [], c = [];
|
|
10544
|
+
for (let r = 0; r <= o; r++) {
|
|
10545
|
+
let i = a(r / o), l = this.lerp(t.from, t.to, i), u = i * n * 360 * Math.PI / 180;
|
|
10546
|
+
s.push(e.x + l * Math.cos(u)), c.push(e.y + l * Math.sin(u));
|
|
10547
|
+
}
|
|
10548
|
+
return {
|
|
10549
|
+
x: s,
|
|
10550
|
+
y: c
|
|
10551
|
+
};
|
|
10552
|
+
}
|
|
10553
|
+
chain(...e) {
|
|
10554
|
+
let t = [], n = [];
|
|
10555
|
+
for (let r of e) t.push(...r.x), n.push(...r.y);
|
|
10556
|
+
return {
|
|
10557
|
+
x: t,
|
|
10558
|
+
y: n
|
|
10559
|
+
};
|
|
10560
|
+
}
|
|
10561
|
+
sequence(e, t = 0) {
|
|
10562
|
+
let n = [], r = [], i = Array.isArray(t) ? t : e.map(() => t);
|
|
10563
|
+
for (let t = 0; t < e.length; t++) {
|
|
10564
|
+
let a = e[t], o = i[t] ?? 0;
|
|
10565
|
+
for (let e = 0; e < o; e++) n.push(a.x[0]), r.push(a.y[0]);
|
|
10566
|
+
n.push(...a.x), r.push(...a.y);
|
|
10567
|
+
}
|
|
10568
|
+
return {
|
|
10569
|
+
x: n,
|
|
10570
|
+
y: r
|
|
10571
|
+
};
|
|
10572
|
+
}
|
|
10477
10573
|
}, B;
|
|
10478
10574
|
(function(e) {
|
|
10479
|
-
e.number = new i(), e.element = new a(), e.object = new o(), e.message = new E(), e.event = new D(), e.string = new N(), e.sound = new P(), e.color = new M(), e.random = new T(), e.fn = new F(), e.utils = new z();
|
|
10575
|
+
e.animate = new ne(), e.number = new i(), e.element = new a(), e.object = new o(), e.message = new E(), e.event = new D(), e.string = new N(), e.sound = new P(), e.color = new M(), e.random = new T(), e.fn = new F(), e.utils = new z();
|
|
10480
10576
|
})(B ||= {});
|
|
10481
10577
|
//#endregion
|
|
10482
10578
|
//#region src/actions/button.ts
|
|
@@ -10597,7 +10693,7 @@ var V = [], H = class e {
|
|
|
10597
10693
|
return !1;
|
|
10598
10694
|
}
|
|
10599
10695
|
}
|
|
10600
|
-
}, G = [],
|
|
10696
|
+
}, G = [], re = class extends e {
|
|
10601
10697
|
constructor(e = {}) {
|
|
10602
10698
|
super(), this.SE_API = null, this.id = "widget communications", this.loaded = !1, this.history = [], this.detected = /* @__PURE__ */ new Set(), this.id = e.id || this.id, G.push(this), Z?.then(async (e) => {
|
|
10603
10699
|
this.loaded = !0, this.SE_API = e, Promise.all([async () => {
|
|
@@ -12666,7 +12762,7 @@ var J = class {
|
|
|
12666
12762
|
timeEnd(e) {
|
|
12667
12763
|
!this.enabled || !console.timeEnd || console.timeEnd(e);
|
|
12668
12764
|
}
|
|
12669
|
-
},
|
|
12765
|
+
}, ie = class extends e {
|
|
12670
12766
|
constructor(e, t) {
|
|
12671
12767
|
super(), this.isDebug = !1, this.init = !1, this.emulate = !1, this.username = e.username, this.password = e.password, this.channels = e.channels, this.isDebug = !!e.isDebug, this.init = !!e.init, this.emulate = t, this.load().then((e) => {
|
|
12672
12768
|
this.instance = e, this.emit("load", e), this.connect();
|
|
@@ -12838,7 +12934,7 @@ var J = class {
|
|
|
12838
12934
|
list: {}
|
|
12839
12935
|
}
|
|
12840
12936
|
};
|
|
12841
|
-
async function
|
|
12937
|
+
async function ae() {
|
|
12842
12938
|
let e = localStorage.getItem("SE_API-STORE") ?? "", t = e ? JSON.parse(e) : {};
|
|
12843
12939
|
return Y.store.list = t, Y;
|
|
12844
12940
|
}
|
|
@@ -12893,7 +12989,7 @@ var X;
|
|
|
12893
12989
|
})(X ||= {});
|
|
12894
12990
|
//#endregion
|
|
12895
12991
|
//#region src/main.ts
|
|
12896
|
-
var Z = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(
|
|
12992
|
+
var Z = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(ae()), Q = new J(), $ = {
|
|
12897
12993
|
SeAPI: Z,
|
|
12898
12994
|
Client: r,
|
|
12899
12995
|
Helper: B,
|
|
@@ -12905,14 +13001,14 @@ var Z = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(ie()), Q
|
|
|
12905
13001
|
useStorage: n,
|
|
12906
13002
|
useQueue: K,
|
|
12907
13003
|
useLogger: J,
|
|
12908
|
-
useComms:
|
|
13004
|
+
useComms: re,
|
|
12909
13005
|
FakeUserPool: te
|
|
12910
13006
|
},
|
|
12911
13007
|
actions: {
|
|
12912
13008
|
Button: H,
|
|
12913
13009
|
Command: W
|
|
12914
13010
|
},
|
|
12915
|
-
multistream: { useComfyJs:
|
|
13011
|
+
multistream: { useComfyJs: ie },
|
|
12916
13012
|
internal: {
|
|
12917
13013
|
usedStorages: t,
|
|
12918
13014
|
usedComms: G,
|
|
@@ -12925,8 +13021,8 @@ var Z = typeof SE_API < "u" ? Promise.resolve(SE_API) : Promise.resolve(ie()), Q
|
|
|
12925
13021
|
typeof window < "u" ? window.Tixyel = $ : globalThis.Tixyel = $;
|
|
12926
13022
|
//#endregion
|
|
12927
13023
|
//#region src/index.ts
|
|
12928
|
-
var
|
|
13024
|
+
var oe = $;
|
|
12929
13025
|
//#endregion
|
|
12930
|
-
export {
|
|
13026
|
+
export { oe as default };
|
|
12931
13027
|
|
|
12932
13028
|
//# sourceMappingURL=index.es.js.map
|