playlight-sdk 0.2.6 → 0.2.8
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/playlight-sdk.es.js
CHANGED
|
@@ -23,7 +23,7 @@ function run(e2) {
|
|
|
23
23
|
function run_all(e2) {
|
|
24
24
|
for (var t2 = 0; t2 < e2.length; t2++) e2[t2]();
|
|
25
25
|
}
|
|
26
|
-
const f = 32, p = 64,
|
|
26
|
+
const f = 32, p = 64, g = 128, _ = 256, v = 512, h = 1024, m = 2048, b = 4096, y = 8192, $ = 16384, w = 65536, x = 1 << 20, k = 1 << 21, C = Symbol("$state"), S = Symbol("legacy props"), M = Symbol("");
|
|
27
27
|
function equals(e2) {
|
|
28
28
|
return e2 === this.v;
|
|
29
29
|
}
|
|
@@ -33,18 +33,18 @@ function safe_not_equal(e2, t2) {
|
|
|
33
33
|
function safe_equals(e2) {
|
|
34
34
|
return !safe_not_equal(e2, this.v);
|
|
35
35
|
}
|
|
36
|
-
let
|
|
37
|
-
const
|
|
36
|
+
let T = false;
|
|
37
|
+
const I = Symbol();
|
|
38
38
|
function lifecycle_outside_component(e2) {
|
|
39
39
|
throw new Error("https://svelte.dev/e/lifecycle_outside_component");
|
|
40
40
|
}
|
|
41
|
-
let
|
|
41
|
+
let O = null;
|
|
42
42
|
function set_component_context(e2) {
|
|
43
|
-
|
|
43
|
+
O = e2;
|
|
44
44
|
}
|
|
45
45
|
function push(e2, t2 = false, n2) {
|
|
46
|
-
var s2 =
|
|
47
|
-
p:
|
|
46
|
+
var s2 = O = {
|
|
47
|
+
p: O,
|
|
48
48
|
c: null,
|
|
49
49
|
d: false,
|
|
50
50
|
e: null,
|
|
@@ -53,7 +53,7 @@ function push(e2, t2 = false, n2) {
|
|
|
53
53
|
x: null,
|
|
54
54
|
l: null
|
|
55
55
|
};
|
|
56
|
-
|
|
56
|
+
T && !t2 && (O.l = {
|
|
57
57
|
s: null,
|
|
58
58
|
u: null,
|
|
59
59
|
r1: [],
|
|
@@ -63,7 +63,7 @@ function push(e2, t2 = false, n2) {
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
function pop(e2) {
|
|
66
|
-
const t2 =
|
|
66
|
+
const t2 = O;
|
|
67
67
|
if (null !== t2) {
|
|
68
68
|
const e3 = t2.e;
|
|
69
69
|
if (null !== e3) {
|
|
@@ -78,12 +78,12 @@ function pop(e2) {
|
|
|
78
78
|
set_active_effect(n2), set_active_reaction(s2);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
|
|
81
|
+
O = t2.p, t2.m = true;
|
|
82
82
|
}
|
|
83
83
|
return {};
|
|
84
84
|
}
|
|
85
85
|
function is_runes() {
|
|
86
|
-
return !
|
|
86
|
+
return !T || null !== O && null === O.l;
|
|
87
87
|
}
|
|
88
88
|
function proxy(e2, n2) {
|
|
89
89
|
if ("object" != typeof e2 || null === e2 || C in e2) return e2;
|
|
@@ -119,7 +119,7 @@ function proxy(e2, n2) {
|
|
|
119
119
|
},
|
|
120
120
|
deleteProperty(e3, t2) {
|
|
121
121
|
var n3 = i2.get(t2);
|
|
122
|
-
if (void 0 === n3) t2 in e3 && i2.set(t2, with_parent(() => state(
|
|
122
|
+
if (void 0 === n3) t2 in e3 && i2.set(t2, with_parent(() => state(I)));
|
|
123
123
|
else {
|
|
124
124
|
if (a2 && "string" == typeof t2) {
|
|
125
125
|
var s3 = (
|
|
@@ -128,7 +128,7 @@ function proxy(e2, n2) {
|
|
|
128
128
|
), o2 = Number(t2);
|
|
129
129
|
Number.isInteger(o2) && o2 < s3.v && set(s3, o2);
|
|
130
130
|
}
|
|
131
|
-
set(n3,
|
|
131
|
+
set(n3, I), update_version(d2);
|
|
132
132
|
}
|
|
133
133
|
return true;
|
|
134
134
|
},
|
|
@@ -138,10 +138,10 @@ function proxy(e2, n2) {
|
|
|
138
138
|
var a3 = i2.get(n3), l2 = n3 in t2;
|
|
139
139
|
if (
|
|
140
140
|
// create a source, but only if it's an own property and not a prototype property
|
|
141
|
-
void 0 !== a3 || l2 && !((_a2 = o(t2, n3)) == null ? void 0 : _a2.writable) || (a3 = with_parent(() => state(proxy(l2 ? t2[n3] :
|
|
141
|
+
void 0 !== a3 || l2 && !((_a2 = o(t2, n3)) == null ? void 0 : _a2.writable) || (a3 = with_parent(() => state(proxy(l2 ? t2[n3] : I))), i2.set(n3, a3)), void 0 !== a3
|
|
142
142
|
) {
|
|
143
143
|
var c2 = get$1(a3);
|
|
144
|
-
return c2 ===
|
|
144
|
+
return c2 === I ? void 0 : c2;
|
|
145
145
|
}
|
|
146
146
|
return Reflect.get(t2, n3, s3);
|
|
147
147
|
},
|
|
@@ -152,7 +152,7 @@ function proxy(e2, n2) {
|
|
|
152
152
|
s3 && (n3.value = get$1(s3));
|
|
153
153
|
} else if (void 0 === n3) {
|
|
154
154
|
var o2 = i2.get(t2), a3 = o2 == null ? void 0 : o2.v;
|
|
155
|
-
if (void 0 !== o2 && a3 !==
|
|
155
|
+
if (void 0 !== o2 && a3 !== I) return {
|
|
156
156
|
enumerable: true,
|
|
157
157
|
configurable: true,
|
|
158
158
|
value: a3,
|
|
@@ -164,8 +164,8 @@ function proxy(e2, n2) {
|
|
|
164
164
|
has(e3, t2) {
|
|
165
165
|
var _a2;
|
|
166
166
|
if (t2 === C) return true;
|
|
167
|
-
var n3 = i2.get(t2), s3 = void 0 !== n3 && n3.v !==
|
|
168
|
-
if ((void 0 !== n3 || null !== V && (!s3 || ((_a2 = o(e3, t2)) == null ? void 0 : _a2.writable))) && (void 0 === n3 && (n3 = with_parent(() => state(s3 ? proxy(e3[t2]) :
|
|
167
|
+
var n3 = i2.get(t2), s3 = void 0 !== n3 && n3.v !== I || Reflect.has(e3, t2);
|
|
168
|
+
if ((void 0 !== n3 || null !== V && (!s3 || ((_a2 = o(e3, t2)) == null ? void 0 : _a2.writable))) && (void 0 === n3 && (n3 = with_parent(() => state(s3 ? proxy(e3[t2]) : I)), i2.set(t2, n3)), get$1(n3) === I)) return false;
|
|
169
169
|
return s3;
|
|
170
170
|
},
|
|
171
171
|
set(e3, t2, n3, s3) {
|
|
@@ -174,20 +174,20 @@ function proxy(e2, n2) {
|
|
|
174
174
|
if (a2 && "length" === t2) for (var u2 = n3; u2 < /** @type {Source<number>} */
|
|
175
175
|
l2.v; u2 += 1) {
|
|
176
176
|
var f3 = i2.get(u2 + "");
|
|
177
|
-
void 0 !== f3 ? set(f3,
|
|
177
|
+
void 0 !== f3 ? set(f3, I) : u2 in e3 && // If the item exists in the original, we need to create a uninitialized source,
|
|
178
178
|
// else a later read of the property would result in a source being created with
|
|
179
179
|
// the value of the original item at that index.
|
|
180
|
-
(f3 = with_parent(() => state(
|
|
180
|
+
(f3 = with_parent(() => state(I)), i2.set(u2 + "", f3));
|
|
181
181
|
}
|
|
182
|
-
void 0 === l2 ? c2 && !((_a2 = o(e3, t2)) == null ? void 0 : _a2.writable) || (set(l2 = with_parent(() => state(void 0)), with_parent(() => proxy(n3))), i2.set(t2, l2)) : (c2 = l2.v !==
|
|
182
|
+
void 0 === l2 ? c2 && !((_a2 = o(e3, t2)) == null ? void 0 : _a2.writable) || (set(l2 = with_parent(() => state(void 0)), with_parent(() => proxy(n3))), i2.set(t2, l2)) : (c2 = l2.v !== I, set(l2, with_parent(() => proxy(n3))));
|
|
183
183
|
var p2 = Reflect.getOwnPropertyDescriptor(e3, t2);
|
|
184
184
|
if ((p2 == null ? void 0 : p2.set) && p2.set.call(s3, n3), !c2) {
|
|
185
185
|
if (a2 && "string" == typeof t2) {
|
|
186
|
-
var
|
|
186
|
+
var g2 = (
|
|
187
187
|
/** @type {Source<number>} */
|
|
188
188
|
i2.get("length")
|
|
189
|
-
),
|
|
190
|
-
Number.isInteger(
|
|
189
|
+
), _2 = Number(t2);
|
|
190
|
+
Number.isInteger(_2) && _2 >= g2.v && set(g2, _2 + 1);
|
|
191
191
|
}
|
|
192
192
|
update_version(d2);
|
|
193
193
|
}
|
|
@@ -197,9 +197,9 @@ function proxy(e2, n2) {
|
|
|
197
197
|
get$1(d2);
|
|
198
198
|
var t2 = Reflect.ownKeys(e3).filter((e4) => {
|
|
199
199
|
var t3 = i2.get(e4);
|
|
200
|
-
return void 0 === t3 || t3.v !==
|
|
200
|
+
return void 0 === t3 || t3.v !== I;
|
|
201
201
|
});
|
|
202
|
-
for (var [n3, s3] of i2) s3.v ===
|
|
202
|
+
for (var [n3, s3] of i2) s3.v === I || n3 in e3 || t2.push(n3);
|
|
203
203
|
return t2;
|
|
204
204
|
},
|
|
205
205
|
setPrototypeOf() {
|
|
@@ -213,7 +213,7 @@ function proxy(e2, n2) {
|
|
|
213
213
|
function update_version(e2, t2 = 1) {
|
|
214
214
|
set(e2, e2.v + t2);
|
|
215
215
|
}
|
|
216
|
-
const
|
|
216
|
+
const q = /* @__PURE__ */ new Map();
|
|
217
217
|
function source(e2, t2) {
|
|
218
218
|
return {
|
|
219
219
|
f: 0,
|
|
@@ -235,7 +235,7 @@ function mutable_source(e2, t2 = false) {
|
|
|
235
235
|
const n2 = source(e2);
|
|
236
236
|
return t2 || (n2.equals = safe_equals), // bind the signal to the component context, in case we need to
|
|
237
237
|
// track updates to trigger beforeUpdate/afterUpdate callbacks
|
|
238
|
-
|
|
238
|
+
T && null !== O && null !== O.l && ((_a2 = O.l).s ?? (_a2.s = [])).push(n2), n2;
|
|
239
239
|
}
|
|
240
240
|
function set(e2, t2, n2 = false) {
|
|
241
241
|
return null !== R && !U && is_runes() && 18 & R.f && !(K == null ? void 0 : K.includes(e2)) && function state_unsafe_mutation() {
|
|
@@ -245,7 +245,7 @@ function set(e2, t2, n2 = false) {
|
|
|
245
245
|
function internal_set(e2, t2) {
|
|
246
246
|
if (!e2.equals(t2)) {
|
|
247
247
|
var n2 = e2.v;
|
|
248
|
-
F ?
|
|
248
|
+
F ? q.set(e2, t2) : q.set(e2, n2), e2.v = t2, e2.wv = increment_write_version(), mark_reactions(e2, m), // It's possible that the current reaction might not have up-to-date dependencies
|
|
249
249
|
// whilst it's actively running. So in the case of ensuring it registers the reaction
|
|
250
250
|
// properly for itself, we need to ensure the current effect actually gets
|
|
251
251
|
// scheduled. i.e: `$effect(() => x++)`
|
|
@@ -278,17 +278,17 @@ function mark_reactions(e2, t2) {
|
|
|
278
278
|
)));
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
var
|
|
281
|
+
var P, W, z, j, D;
|
|
282
282
|
function create_text(e2 = "") {
|
|
283
283
|
return document.createTextNode(e2);
|
|
284
284
|
}
|
|
285
285
|
// @__NO_SIDE_EFFECTS__
|
|
286
286
|
function get_first_child(e2) {
|
|
287
|
-
return
|
|
287
|
+
return j.call(e2);
|
|
288
288
|
}
|
|
289
289
|
// @__NO_SIDE_EFFECTS__
|
|
290
290
|
function get_next_sibling(e2) {
|
|
291
|
-
return
|
|
291
|
+
return D.call(e2);
|
|
292
292
|
}
|
|
293
293
|
function child(e2, t2) {
|
|
294
294
|
return /* @__PURE__ */ get_first_child(e2);
|
|
@@ -315,13 +315,13 @@ function derived(e2) {
|
|
|
315
315
|
/** @type {Derived} */
|
|
316
316
|
R
|
|
317
317
|
) : null;
|
|
318
|
-
null === V || null !== n2 && n2.f &
|
|
318
|
+
null === V || null !== n2 && n2.f & _ ? t2 |= _ : (
|
|
319
319
|
// Since deriveds are evaluated lazily, any effects created inside them are
|
|
320
320
|
// created too late to ensure that the parent effect is added to the tree
|
|
321
321
|
V.f |= x
|
|
322
322
|
);
|
|
323
323
|
return {
|
|
324
|
-
ctx:
|
|
324
|
+
ctx: O,
|
|
325
325
|
deps: null,
|
|
326
326
|
effects: null,
|
|
327
327
|
equals,
|
|
@@ -381,7 +381,7 @@ function update_derived(e2) {
|
|
|
381
381
|
return t3;
|
|
382
382
|
}(e2)
|
|
383
383
|
);
|
|
384
|
-
set_signal_status(e2, (te || e2.f &
|
|
384
|
+
set_signal_status(e2, (te || e2.f & _) && null !== e2.deps ? b : h), e2.equals(t2) || (e2.v = t2, e2.wv = increment_write_version());
|
|
385
385
|
}
|
|
386
386
|
function validate_effect(e2) {
|
|
387
387
|
null === V && null === R && /**
|
|
@@ -391,7 +391,7 @@ function validate_effect(e2) {
|
|
|
391
391
|
*/
|
|
392
392
|
function effect_orphan(e3) {
|
|
393
393
|
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
394
|
-
}(), null !== R && R.f &
|
|
394
|
+
}(), null !== R && R.f & _ && null === V && /**
|
|
395
395
|
* Effect cannot be created inside a `$derived` value that was not itself created inside an effect
|
|
396
396
|
* @returns {never}
|
|
397
397
|
*/
|
|
@@ -403,7 +403,7 @@ function validate_effect(e2) {
|
|
|
403
403
|
}
|
|
404
404
|
function create_effect(e2, t2, n2, s2 = true) {
|
|
405
405
|
var i2 = V, o2 = {
|
|
406
|
-
ctx:
|
|
406
|
+
ctx: O,
|
|
407
407
|
deps: null,
|
|
408
408
|
nodes_start: null,
|
|
409
409
|
nodes_end: null,
|
|
@@ -441,10 +441,10 @@ function teardown(e2) {
|
|
|
441
441
|
return set_signal_status(t2, h), t2.teardown = e2, t2;
|
|
442
442
|
}
|
|
443
443
|
function user_effect(e2) {
|
|
444
|
-
if (validate_effect(), !(null !== V && !!(V.f & f) && null !==
|
|
444
|
+
if (validate_effect(), !(null !== V && !!(V.f & f) && null !== O && !O.m)) return effect(e2);
|
|
445
445
|
var t2 = (
|
|
446
446
|
/** @type {ComponentContext} */
|
|
447
|
-
|
|
447
|
+
O
|
|
448
448
|
);
|
|
449
449
|
(t2.e ?? (t2.e = [])).push({
|
|
450
450
|
fn: e2,
|
|
@@ -458,7 +458,7 @@ function effect(e2) {
|
|
|
458
458
|
function legacy_pre_effect(e2, t2) {
|
|
459
459
|
var n2 = (
|
|
460
460
|
/** @type {ComponentContextLegacy} */
|
|
461
|
-
|
|
461
|
+
O
|
|
462
462
|
), s2 = {
|
|
463
463
|
effect: null,
|
|
464
464
|
ran: false
|
|
@@ -472,7 +472,7 @@ function legacy_pre_effect(e2, t2) {
|
|
|
472
472
|
function legacy_pre_effect_reset() {
|
|
473
473
|
var e2 = (
|
|
474
474
|
/** @type {ComponentContextLegacy} */
|
|
475
|
-
|
|
475
|
+
O
|
|
476
476
|
);
|
|
477
477
|
render_effect(() => {
|
|
478
478
|
if (get$1(e2.l.r2)) {
|
|
@@ -583,21 +583,21 @@ function resume_children(e2, t2) {
|
|
|
583
583
|
if (null !== e2.transitions) for (const n3 of e2.transitions) (n3.is_global || t2) && n3.in();
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
|
-
let
|
|
586
|
+
let N = [], B = [];
|
|
587
587
|
function run_micro_tasks() {
|
|
588
|
-
var e2 =
|
|
589
|
-
|
|
588
|
+
var e2 = N;
|
|
589
|
+
N = [], run_all(e2);
|
|
590
590
|
}
|
|
591
591
|
function queue_micro_task(e2) {
|
|
592
|
-
0 ===
|
|
592
|
+
0 === N.length && queueMicrotask(run_micro_tasks), N.push(e2);
|
|
593
593
|
}
|
|
594
594
|
function flush_tasks() {
|
|
595
|
-
|
|
596
|
-
var e2 =
|
|
597
|
-
|
|
595
|
+
N.length > 0 && run_micro_tasks(), B.length > 0 && function run_idle_tasks() {
|
|
596
|
+
var e2 = B;
|
|
597
|
+
B = [], run_all(e2);
|
|
598
598
|
}();
|
|
599
599
|
}
|
|
600
|
-
let
|
|
600
|
+
let E = false, A = false, L = null, G = false, F = false;
|
|
601
601
|
function set_is_destroying_effect(e2) {
|
|
602
602
|
F = e2;
|
|
603
603
|
}
|
|
@@ -625,7 +625,7 @@ function check_dirtiness(e2) {
|
|
|
625
625
|
var t2 = e2.f;
|
|
626
626
|
if (t2 & m) return true;
|
|
627
627
|
if (t2 & b) {
|
|
628
|
-
var n2 = e2.deps, s2 = !!(t2 &
|
|
628
|
+
var n2 = e2.deps, s2 = !!(t2 & _);
|
|
629
629
|
if (null !== n2) {
|
|
630
630
|
var i2, o2, a2 = !!(t2 & v), l2 = s2 && null !== V && !te, c2 = n2.length;
|
|
631
631
|
if (a2 || l2) {
|
|
@@ -640,7 +640,7 @@ function check_dirtiness(e2) {
|
|
|
640
640
|
a2 && (u2.f ^= v), // If the unowned derived is now fully connected to the graph again (it's unowned and reconnected, has a parent
|
|
641
641
|
// and the parent is not unowned), then we can mark it as connected again, removing the need for the unowned
|
|
642
642
|
// flag
|
|
643
|
-
!l2 || null === d2 || d2.f &
|
|
643
|
+
!l2 || null === d2 || d2.f & _ || (u2.f ^= _);
|
|
644
644
|
}
|
|
645
645
|
for (i2 = 0; i2 < c2; i2++) if (check_dirtiness(o2 = n2[i2]) && update_derived(
|
|
646
646
|
/** @type {Derived} */
|
|
@@ -652,23 +652,23 @@ function check_dirtiness(e2) {
|
|
|
652
652
|
return false;
|
|
653
653
|
}
|
|
654
654
|
function handle_error(e2, t2, n2, s2) {
|
|
655
|
-
if (
|
|
656
|
-
if (null === n2 && (
|
|
655
|
+
if (E) {
|
|
656
|
+
if (null === n2 && (E = false), /**
|
|
657
657
|
* @param {Effect} effect
|
|
658
658
|
*/
|
|
659
659
|
function should_rethrow_error(e3) {
|
|
660
|
-
return !(e3.f & $ || null !== e3.parent && e3.parent.f &
|
|
660
|
+
return !(e3.f & $ || null !== e3.parent && e3.parent.f & g);
|
|
661
661
|
}(t2)) throw e2;
|
|
662
|
-
} else null !== n2 && (
|
|
662
|
+
} else null !== n2 && (E = true), function propagate_error(e3, t3) {
|
|
663
663
|
for (var n3 = t3; null !== n3; ) {
|
|
664
|
-
if (n3.f &
|
|
664
|
+
if (n3.f & g) try {
|
|
665
665
|
return void n3.fn(e3);
|
|
666
666
|
} catch {
|
|
667
|
-
n3.f ^=
|
|
667
|
+
n3.f ^= g;
|
|
668
668
|
}
|
|
669
669
|
n3 = n3.parent;
|
|
670
670
|
}
|
|
671
|
-
throw
|
|
671
|
+
throw E = false, e3;
|
|
672
672
|
}(e2, t2);
|
|
673
673
|
}
|
|
674
674
|
function schedule_possible_effect_self_invalidation(e2, t2, n2 = true) {
|
|
@@ -688,9 +688,9 @@ function schedule_possible_effect_self_invalidation(e2, t2, n2 = true) {
|
|
|
688
688
|
}
|
|
689
689
|
function update_reaction(e2) {
|
|
690
690
|
var _a2;
|
|
691
|
-
var t2 = Y, n2 = Z, s2 = J, i2 = R, o2 = te, a2 = K, l2 =
|
|
691
|
+
var t2 = Y, n2 = Z, s2 = J, i2 = R, o2 = te, a2 = K, l2 = O, c2 = U, u2 = e2.f;
|
|
692
692
|
Y = /** @type {null | Value[]} */
|
|
693
|
-
null, Z = 0, J = null, te = !!(u2 &
|
|
693
|
+
null, Z = 0, J = null, te = !!(u2 & _) && (U || !G || null === R), R = 96 & u2 ? null : e2, K = null, set_component_context(e2.ctx), U = false, ee++, e2.f |= k;
|
|
694
694
|
try {
|
|
695
695
|
var d2 = (
|
|
696
696
|
/** @type {Function} */
|
|
@@ -750,7 +750,7 @@ function update_effect(t2) {
|
|
|
750
750
|
var n2 = t2.f;
|
|
751
751
|
if (!(n2 & $)) {
|
|
752
752
|
set_signal_status(t2, h);
|
|
753
|
-
var s2 = V, i2 =
|
|
753
|
+
var s2 = V, i2 = O, o2 = G;
|
|
754
754
|
V = t2, G = true;
|
|
755
755
|
try {
|
|
756
756
|
16 & n2 ? function destroy_block_effect_children(e2) {
|
|
@@ -793,7 +793,7 @@ function flush_queued_root_effects() {
|
|
|
793
793
|
}
|
|
794
794
|
}
|
|
795
795
|
} finally {
|
|
796
|
-
A = false, G = e2, L = null,
|
|
796
|
+
A = false, G = e2, L = null, q.clear();
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
799
|
function flush_queued_effects(e2) {
|
|
@@ -873,10 +873,10 @@ function get$1(e2) {
|
|
|
873
873
|
/** @type {Derived} */
|
|
874
874
|
e2
|
|
875
875
|
), s2 = n2.parent;
|
|
876
|
-
null === s2 || s2.f &
|
|
876
|
+
null === s2 || s2.f & _ || // If the derived is owned by another derived then mark it as unowned
|
|
877
877
|
// as the derived value might have been referenced in a different context
|
|
878
878
|
// since and thus its parent might not be its true owner anymore
|
|
879
|
-
(n2.f ^=
|
|
879
|
+
(n2.f ^= _);
|
|
880
880
|
}
|
|
881
881
|
} else if (!(K == null ? void 0 : K.includes(e2))) {
|
|
882
882
|
var i2 = R.deps;
|
|
@@ -889,7 +889,7 @@ function get$1(e2) {
|
|
|
889
889
|
Y.push(e2));
|
|
890
890
|
}
|
|
891
891
|
return t2 && check_dirtiness(n2 = /** @type {Derived} */
|
|
892
|
-
e2) && update_derived(n2), F &&
|
|
892
|
+
e2) && update_derived(n2), F && q.has(e2) ? q.get(e2) : e2.v;
|
|
893
893
|
}
|
|
894
894
|
function untrack(e2) {
|
|
895
895
|
var t2 = U;
|
|
@@ -1055,10 +1055,10 @@ function handle_event_propagation(e2) {
|
|
|
1055
1055
|
configurable: true,
|
|
1056
1056
|
get: () => l2 || s2
|
|
1057
1057
|
});
|
|
1058
|
-
var p2 = R,
|
|
1058
|
+
var p2 = R, g2 = V;
|
|
1059
1059
|
set_active_reaction(null), set_active_effect(null);
|
|
1060
1060
|
try {
|
|
1061
|
-
for (var
|
|
1061
|
+
for (var _2, v2 = []; null !== l2; ) {
|
|
1062
1062
|
var h2 = l2.assignedSlot || l2.parentNode || /** @type {any} */
|
|
1063
1063
|
l2.host || null;
|
|
1064
1064
|
try {
|
|
@@ -1071,21 +1071,21 @@ function handle_event_propagation(e2) {
|
|
|
1071
1071
|
b2.apply(l2, [e2, ...y2]);
|
|
1072
1072
|
} else m2.call(l2, e2);
|
|
1073
1073
|
} catch (e3) {
|
|
1074
|
-
|
|
1074
|
+
_2 ? v2.push(e3) : _2 = e3;
|
|
1075
1075
|
}
|
|
1076
1076
|
if (e2.cancelBubble || h2 === n2 || null === h2) break;
|
|
1077
1077
|
l2 = h2;
|
|
1078
1078
|
}
|
|
1079
|
-
if (
|
|
1079
|
+
if (_2) {
|
|
1080
1080
|
for (let e3 of v2)
|
|
1081
1081
|
queueMicrotask(() => {
|
|
1082
1082
|
throw e3;
|
|
1083
1083
|
});
|
|
1084
|
-
throw
|
|
1084
|
+
throw _2;
|
|
1085
1085
|
}
|
|
1086
1086
|
} finally {
|
|
1087
1087
|
e2.__root = n2, // @ts-ignore remove proxy on currentTarget
|
|
1088
|
-
delete e2.currentTarget, set_active_reaction(p2), set_active_effect(
|
|
1088
|
+
delete e2.currentTarget, set_active_reaction(p2), set_active_effect(g2);
|
|
1089
1089
|
}
|
|
1090
1090
|
}
|
|
1091
1091
|
}
|
|
@@ -1171,11 +1171,11 @@ function mount(e2, t2) {
|
|
|
1171
1171
|
* where these globals are not available while avoiding a separate server entry point
|
|
1172
1172
|
*/
|
|
1173
1173
|
function init_operations() {
|
|
1174
|
-
if (void 0 ===
|
|
1175
|
-
|
|
1174
|
+
if (void 0 === P) {
|
|
1175
|
+
P = window, W = document, z = /Firefox/.test(navigator.userAgent);
|
|
1176
1176
|
var e4 = Element.prototype, t4 = Node.prototype, n3 = Text.prototype;
|
|
1177
|
-
|
|
1178
|
-
|
|
1177
|
+
j = o(t4, "firstChild").get, // @ts-ignore
|
|
1178
|
+
D = o(t4, "nextSibling").get, d(e4) && // the following assignments improve perf of lookups on DOM nodes
|
|
1179
1179
|
// @ts-expect-error
|
|
1180
1180
|
(e4.__click = void 0, // @ts-expect-error
|
|
1181
1181
|
e4.__className = void 0, // @ts-expect-error
|
|
@@ -1206,7 +1206,7 @@ function mount(e2, t2) {
|
|
|
1206
1206
|
}
|
|
1207
1207
|
};
|
|
1208
1208
|
event_handle(s(ae)), le.add(event_handle);
|
|
1209
|
-
var f2 = void 0,
|
|
1209
|
+
var f2 = void 0, g2 = (
|
|
1210
1210
|
/**
|
|
1211
1211
|
* An effect root whose children can transition out
|
|
1212
1212
|
* @param {() => void} fn
|
|
@@ -1223,7 +1223,7 @@ function mount(e2, t2) {
|
|
|
1223
1223
|
var s2 = n2 ?? t3.appendChild(create_text());
|
|
1224
1224
|
return branch(() => {
|
|
1225
1225
|
l2 && (push({}), /** @type {ComponentContext} */
|
|
1226
|
-
|
|
1226
|
+
O.c = l2);
|
|
1227
1227
|
a2 && // We can't spread the object or else we'd lose the state proxy stuff, if it is one
|
|
1228
1228
|
/** @type {any} */
|
|
1229
1229
|
(i2.$$events = a2), ce = c2, // @ts-expect-error the public typings are not what the actual function looks like
|
|
@@ -1242,13 +1242,13 @@ function mount(e2, t2) {
|
|
|
1242
1242
|
};
|
|
1243
1243
|
})
|
|
1244
1244
|
);
|
|
1245
|
-
return de.set(f2,
|
|
1245
|
+
return de.set(f2, g2), f2;
|
|
1246
1246
|
}(e2, t2);
|
|
1247
1247
|
}
|
|
1248
1248
|
const ue = /* @__PURE__ */ new Map();
|
|
1249
1249
|
let de = /* @__PURE__ */ new WeakMap();
|
|
1250
1250
|
function if_block(e2, t2, [n2, s2] = [0, 0]) {
|
|
1251
|
-
var i2 = e2, o2 = null, a2 = null, l2 =
|
|
1251
|
+
var i2 = e2, o2 = null, a2 = null, l2 = I, c2 = false;
|
|
1252
1252
|
const set_branch = (e3, t3 = true) => {
|
|
1253
1253
|
c2 = true, update_branch(t3, e3);
|
|
1254
1254
|
}, update_branch = (e3, t3) => {
|
|
@@ -1297,18 +1297,18 @@ function each(e2, n2, i2, o2, a2, l2 = null) {
|
|
|
1297
1297
|
*/
|
|
1298
1298
|
function reconcile(e4, t3, n3, i3, o3, a3, l3) {
|
|
1299
1299
|
var _a2, _b2, _c2, _d;
|
|
1300
|
-
var c3, u3, d3, f3, p3,
|
|
1301
|
-
if (
|
|
1302
|
-
for (
|
|
1303
|
-
if (v2 && update_item(p3, d3,
|
|
1300
|
+
var c3, u3, d3, f3, p3, g2, _2 = !!(8 & o3), v2 = !!(3 & o3), h2 = e4.length, m2 = t3.items, b2 = t3.first, $2 = b2, w2 = null, x2 = [], k2 = [];
|
|
1301
|
+
if (_2) for (g2 = 0; g2 < h2; g2 += 1) f3 = a3(d3 = e4[g2], g2), void 0 !== (p3 = m2.get(f3)) && ((_a2 = p3.a) == null ? void 0 : _a2.measure(), (u3 ?? (u3 = /* @__PURE__ */ new Set())).add(p3));
|
|
1302
|
+
for (g2 = 0; g2 < h2; g2 += 1) if (f3 = a3(d3 = e4[g2], g2), void 0 !== (p3 = m2.get(f3))) {
|
|
1303
|
+
if (v2 && update_item(p3, d3, g2, o3), p3.e.f & y && (resume_effect(p3.e), _2 && ((_b2 = p3.a) == null ? void 0 : _b2.unfix(), (u3 ?? (u3 = /* @__PURE__ */ new Set())).delete(p3))), p3 !== $2) {
|
|
1304
1304
|
if (void 0 !== c3 && c3.has(p3)) {
|
|
1305
1305
|
if (x2.length < k2.length) {
|
|
1306
|
-
var C2,
|
|
1307
|
-
w2 =
|
|
1308
|
-
var
|
|
1309
|
-
for (C2 = 0; C2 < x2.length; C2 += 1) move(x2[C2],
|
|
1306
|
+
var C2, S2 = k2[0];
|
|
1307
|
+
w2 = S2.prev;
|
|
1308
|
+
var M2 = x2[0], T2 = x2[x2.length - 1];
|
|
1309
|
+
for (C2 = 0; C2 < x2.length; C2 += 1) move(x2[C2], S2, n3);
|
|
1310
1310
|
for (C2 = 0; C2 < k2.length; C2 += 1) c3.delete(k2[C2]);
|
|
1311
|
-
link(t3,
|
|
1311
|
+
link(t3, M2.prev, T2.next), link(t3, w2, M2), link(t3, T2, S2), $2 = S2, w2 = T2, g2 -= 1, x2 = [], k2 = [];
|
|
1312
1312
|
} else
|
|
1313
1313
|
c3.delete(p3), move(p3, $2, n3), link(t3, p3.prev, p3.next), link(t3, p3, null === w2 ? t3.first : w2.next), link(t3, w2, p3), w2 = p3;
|
|
1314
1314
|
continue;
|
|
@@ -1323,17 +1323,17 @@ function each(e2, n2, i2, o2, a2, l2 = null) {
|
|
|
1323
1323
|
w2 = create_item($2 ? (
|
|
1324
1324
|
/** @type {TemplateNode} */
|
|
1325
1325
|
$2.e.nodes_start
|
|
1326
|
-
) : n3, t3, w2, null === w2 ? t3.first : w2.next, d3, f3,
|
|
1326
|
+
) : n3, t3, w2, null === w2 ? t3.first : w2.next, d3, f3, g2, i3, o3, l3), m2.set(f3, w2), x2 = [], k2 = [], $2 = w2.next;
|
|
1327
1327
|
}
|
|
1328
1328
|
if (null !== $2 || void 0 !== c3) {
|
|
1329
|
-
for (var
|
|
1330
|
-
$2.e.f & y ||
|
|
1331
|
-
var
|
|
1332
|
-
if (
|
|
1333
|
-
var
|
|
1334
|
-
if (
|
|
1335
|
-
for (
|
|
1336
|
-
for (
|
|
1329
|
+
for (var I2 = void 0 === c3 ? [] : s(c3); null !== $2; )
|
|
1330
|
+
$2.e.f & y || I2.push($2), $2 = $2.next;
|
|
1331
|
+
var O2 = I2.length;
|
|
1332
|
+
if (O2 > 0) {
|
|
1333
|
+
var q2 = 4 & o3 && 0 === h2 ? n3 : null;
|
|
1334
|
+
if (_2) {
|
|
1335
|
+
for (g2 = 0; g2 < O2; g2 += 1) (_c2 = I2[g2].a) == null ? void 0 : _c2.measure();
|
|
1336
|
+
for (g2 = 0; g2 < O2; g2 += 1) (_d = I2[g2].a) == null ? void 0 : _d.fix();
|
|
1337
1337
|
}
|
|
1338
1338
|
!function pause_effects(e5, t4, n4, s2) {
|
|
1339
1339
|
for (var i4 = [], o4 = t4.length, a4 = 0; a4 < o4; a4++) pause_children(t4[a4].e, i4, true);
|
|
@@ -1357,10 +1357,10 @@ function each(e2, n2, i2, o2, a2, l2 = null) {
|
|
|
1357
1357
|
l4 || (s2.delete(i5.k), link(e5, i5.prev, i5.next)), destroy_effect(i5.e, !l4);
|
|
1358
1358
|
}
|
|
1359
1359
|
});
|
|
1360
|
-
}(t3,
|
|
1360
|
+
}(t3, I2, q2, m2);
|
|
1361
1361
|
}
|
|
1362
1362
|
}
|
|
1363
|
-
|
|
1363
|
+
_2 && queue_micro_task(() => {
|
|
1364
1364
|
var _a3;
|
|
1365
1365
|
if (void 0 !== u3) for (p3 of u3) (_a3 = p3.a) == null ? void 0 : _a3.apply();
|
|
1366
1366
|
});
|
|
@@ -1385,7 +1385,7 @@ function update_item(e2, t2, n2, s2) {
|
|
|
1385
1385
|
) : e2.i = n2;
|
|
1386
1386
|
}
|
|
1387
1387
|
function create_item(e2, t2, n2, s2, i2, o2, a2, l2, c2, u2) {
|
|
1388
|
-
var d2 = fe, f2 = !!(1 & c2) ? !(16 & c2) ? /* @__PURE__ */ mutable_source(i2) : source(i2) : i2, p2 = 2 & c2 ? source(a2) : a2,
|
|
1388
|
+
var d2 = fe, f2 = !!(1 & c2) ? !(16 & c2) ? /* @__PURE__ */ mutable_source(i2) : source(i2) : i2, p2 = 2 & c2 ? source(a2) : a2, g2 = {
|
|
1389
1389
|
i: p2,
|
|
1390
1390
|
v: f2,
|
|
1391
1391
|
k: o2,
|
|
@@ -1395,9 +1395,9 @@ function create_item(e2, t2, n2, s2, i2, o2, a2, l2, c2, u2) {
|
|
|
1395
1395
|
prev: n2,
|
|
1396
1396
|
next: s2
|
|
1397
1397
|
};
|
|
1398
|
-
fe =
|
|
1398
|
+
fe = g2;
|
|
1399
1399
|
try {
|
|
1400
|
-
return
|
|
1400
|
+
return g2.e = branch(() => l2(e2, f2, p2, u2), false), g2.e.prev = n2 && n2.e, g2.e.next = s2 && s2.e, null === n2 ? t2.first = g2 : (n2.next = g2, n2.e.next = g2.e), null !== s2 && (s2.prev = g2, s2.e.prev = g2.e), g2;
|
|
1401
1401
|
} finally {
|
|
1402
1402
|
fe = d2;
|
|
1403
1403
|
}
|
|
@@ -1506,8 +1506,8 @@ function set_style(e2, t2, n2, s2) {
|
|
|
1506
1506
|
if (":" === p2 && -1 === d2) d2 = f2;
|
|
1507
1507
|
else if (";" === p2 || f2 === t4 - 1) {
|
|
1508
1508
|
if (-1 !== d2) {
|
|
1509
|
-
var
|
|
1510
|
-
c2.includes(
|
|
1509
|
+
var g2 = to_css_name(e3.substring(u2, d2).trim());
|
|
1510
|
+
c2.includes(g2) || (";" !== p2 && f2++, i3 += " " + e3.substring(u2, f2).trim() + ";");
|
|
1511
1511
|
}
|
|
1512
1512
|
u2 = f2 + 1, d2 = -1;
|
|
1513
1513
|
}
|
|
@@ -1523,7 +1523,7 @@ function set_style(e2, t2, n2, s2) {
|
|
|
1523
1523
|
} else s2 && (Array.isArray(s2) ? (update_styles(e2, n2 == null ? void 0 : n2[0], s2[0]), update_styles(e2, n2 == null ? void 0 : n2[1], s2[1], "important")) : update_styles(e2, n2, s2));
|
|
1524
1524
|
return s2;
|
|
1525
1525
|
}
|
|
1526
|
-
const
|
|
1526
|
+
const ge = Symbol("class"), _e = Symbol("style"), ve = Symbol("is custom element"), he = Symbol("is html");
|
|
1527
1527
|
function set_selected(e2, t2) {
|
|
1528
1528
|
t2 ? (
|
|
1529
1529
|
// The selected option could've changed via user selection, and
|
|
@@ -1534,7 +1534,7 @@ function set_selected(e2, t2) {
|
|
|
1534
1534
|
function set_attribute(e2, t2, n2, s2) {
|
|
1535
1535
|
var i2 = get_attributes(e2);
|
|
1536
1536
|
i2[t2] !== (i2[t2] = n2) && ("loading" === t2 && // @ts-expect-error
|
|
1537
|
-
(e2[
|
|
1537
|
+
(e2[M] = n2), null == n2 ? e2.removeAttribute(t2) : "string" != typeof n2 && get_setters(e2).includes(t2) ? (
|
|
1538
1538
|
// @ts-ignore
|
|
1539
1539
|
e2[t2] = n2
|
|
1540
1540
|
) : e2.setAttribute(t2, n2));
|
|
@@ -1542,7 +1542,7 @@ function set_attribute(e2, t2, n2, s2) {
|
|
|
1542
1542
|
function set_attributes(e2, t2, n2, s2, i2 = false) {
|
|
1543
1543
|
var o2 = get_attributes(e2), a2 = o2[ve], l2 = !o2[he], c2 = t2 || {}, u2 = "OPTION" === e2.tagName;
|
|
1544
1544
|
for (var d2 in t2) d2 in n2 || (n2[d2] = null);
|
|
1545
|
-
n2.class ? n2.class = clsx(n2.class) : (s2 || n2[
|
|
1545
|
+
n2.class ? n2.class = clsx(n2.class) : (s2 || n2[ge]) && (n2.class = null), n2[_e] && (n2.style ?? (n2.style = null));
|
|
1546
1546
|
var f2 = get_setters(e2);
|
|
1547
1547
|
for (const m2 in n2) {
|
|
1548
1548
|
let b2 = n2[m2];
|
|
@@ -1552,16 +1552,16 @@ function set_attributes(e2, t2, n2, s2, i2 = false) {
|
|
|
1552
1552
|
var p2 = c2[m2];
|
|
1553
1553
|
if (b2 !== p2) {
|
|
1554
1554
|
c2[m2] = b2;
|
|
1555
|
-
var
|
|
1556
|
-
if ("$$" !==
|
|
1555
|
+
var g2 = m2[0] + m2[1];
|
|
1556
|
+
if ("$$" !== g2) if ("on" === g2) {
|
|
1557
1557
|
const y2 = {}, $2 = "$$" + m2;
|
|
1558
1558
|
let w2 = m2.slice(2);
|
|
1559
|
-
var
|
|
1560
|
-
if (is_capture_event(w2) && (w2 = w2.slice(0, -7), y2.capture = true), !
|
|
1559
|
+
var _2 = is_delegated(w2);
|
|
1560
|
+
if (is_capture_event(w2) && (w2 = w2.slice(0, -7), y2.capture = true), !_2 && p2) {
|
|
1561
1561
|
if (null != b2) continue;
|
|
1562
1562
|
e2.removeEventListener(w2, c2[$2], y2), c2[$2] = null;
|
|
1563
1563
|
}
|
|
1564
|
-
if (null != b2) if (
|
|
1564
|
+
if (null != b2) if (_2)
|
|
1565
1565
|
e2[`__${w2}`] = b2, delegate([w2]);
|
|
1566
1566
|
else {
|
|
1567
1567
|
let handle = function(e3) {
|
|
@@ -1569,7 +1569,7 @@ function set_attributes(e2, t2, n2, s2, i2 = false) {
|
|
|
1569
1569
|
};
|
|
1570
1570
|
c2[$2] = create_event(w2, e2, handle, y2);
|
|
1571
1571
|
}
|
|
1572
|
-
else
|
|
1572
|
+
else _2 && // @ts-ignore
|
|
1573
1573
|
(e2[`__${w2}`] = void 0);
|
|
1574
1574
|
} else if ("style" === m2)
|
|
1575
1575
|
set_attribute(e2, m2, b2);
|
|
@@ -1602,16 +1602,16 @@ function set_attributes(e2, t2, n2, s2, i2 = false) {
|
|
|
1602
1602
|
x2.removeAttribute(v2), x2.defaultValue = C2, // @ts-ignore
|
|
1603
1603
|
x2.value = x2.__value = k2 ? C2 : null;
|
|
1604
1604
|
} else {
|
|
1605
|
-
let
|
|
1606
|
-
x2.removeAttribute(v2), x2.defaultChecked =
|
|
1605
|
+
let S2 = x2.defaultChecked;
|
|
1606
|
+
x2.removeAttribute(v2), x2.defaultChecked = S2, x2.checked = !!k2 && S2;
|
|
1607
1607
|
}
|
|
1608
1608
|
} else e2.removeAttribute(m2);
|
|
1609
1609
|
}
|
|
1610
1610
|
else
|
|
1611
1611
|
e2.value = e2.__value = b2;
|
|
1612
1612
|
}
|
|
1613
|
-
} else set_style(e2, b2, t2 == null ? void 0 : t2[
|
|
1614
|
-
else set_class(e2, "http://www.w3.org/1999/xhtml" === e2.namespaceURI, b2, s2, t2 == null ? void 0 : t2[
|
|
1613
|
+
} else set_style(e2, b2, t2 == null ? void 0 : t2[_e], n2[_e]), c2[m2] = b2, c2[_e] = n2[_e];
|
|
1614
|
+
else set_class(e2, "http://www.w3.org/1999/xhtml" === e2.namespaceURI, b2, s2, t2 == null ? void 0 : t2[ge], n2[ge]), c2[m2] = b2, c2[ge] = n2[ge];
|
|
1615
1615
|
}
|
|
1616
1616
|
return c2;
|
|
1617
1617
|
}
|
|
@@ -1688,7 +1688,7 @@ function transition(e2, t2, n2, s2) {
|
|
|
1688
1688
|
set_active_reaction(e3), set_active_effect(o3);
|
|
1689
1689
|
}
|
|
1690
1690
|
}
|
|
1691
|
-
var
|
|
1691
|
+
var g2 = {
|
|
1692
1692
|
is_global: u2,
|
|
1693
1693
|
in() {
|
|
1694
1694
|
var _a2;
|
|
@@ -1709,21 +1709,21 @@ function transition(e2, t2, n2, s2) {
|
|
|
1709
1709
|
stop: () => {
|
|
1710
1710
|
o2 == null ? void 0 : o2.abort(), a2 == null ? void 0 : a2.abort();
|
|
1711
1711
|
}
|
|
1712
|
-
},
|
|
1712
|
+
}, _2 = (
|
|
1713
1713
|
/** @type {Effect} */
|
|
1714
1714
|
V
|
|
1715
1715
|
);
|
|
1716
|
-
if ((
|
|
1716
|
+
if ((_2.transitions ?? (_2.transitions = [])).push(g2), l2 && ce) {
|
|
1717
1717
|
var v2 = u2;
|
|
1718
1718
|
if (!v2) {
|
|
1719
1719
|
for (var h2 = (
|
|
1720
1720
|
/** @type {Effect | null} */
|
|
1721
|
-
|
|
1721
|
+
_2.parent
|
|
1722
1722
|
); h2 && h2.f & w; ) for (; (h2 = h2.parent) && !(16 & h2.f); ) ;
|
|
1723
1723
|
v2 = !h2 || !!(32768 & h2.f);
|
|
1724
1724
|
}
|
|
1725
1725
|
v2 && effect(() => {
|
|
1726
|
-
untrack(() =>
|
|
1726
|
+
untrack(() => g2.in());
|
|
1727
1727
|
});
|
|
1728
1728
|
}
|
|
1729
1729
|
}
|
|
@@ -1756,13 +1756,13 @@ function animate(e2, t2, n2, s2, i2) {
|
|
|
1756
1756
|
const { delay: c2 = 0, css: u2, tick: d2, easing: f2 = linear$1 } = t2;
|
|
1757
1757
|
var p2 = [];
|
|
1758
1758
|
if (o2 && void 0 === n2 && (d2 && d2(0, 1), u2)) {
|
|
1759
|
-
var
|
|
1760
|
-
p2.push(
|
|
1759
|
+
var g2 = css_to_keyframe(u2(0, 1));
|
|
1760
|
+
p2.push(g2, g2);
|
|
1761
1761
|
}
|
|
1762
|
-
var get_t = () => 1 - s2,
|
|
1762
|
+
var get_t = () => 1 - s2, _2 = e2.animate(p2, {
|
|
1763
1763
|
duration: c2
|
|
1764
1764
|
});
|
|
1765
|
-
return
|
|
1765
|
+
return _2.onfinish = () => {
|
|
1766
1766
|
var o3 = (n2 == null ? void 0 : n2.t()) ?? 1 - s2;
|
|
1767
1767
|
n2 == null ? void 0 : n2.abort();
|
|
1768
1768
|
var a3 = s2 - o3, l3 = (
|
|
@@ -1772,8 +1772,8 @@ function animate(e2, t2, n2, s2, i2) {
|
|
|
1772
1772
|
if (l3 > 0) {
|
|
1773
1773
|
var p3 = false;
|
|
1774
1774
|
if (u2)
|
|
1775
|
-
for (var
|
|
1776
|
-
var h2 = o3 + a3 * f2(v2 /
|
|
1775
|
+
for (var g3 = Math.ceil(l3 / (1e3 / 60)), v2 = 0; v2 <= g3; v2 += 1) {
|
|
1776
|
+
var h2 = o3 + a3 * f2(v2 / g3), m2 = css_to_keyframe(u2(h2, 1 - h2));
|
|
1777
1777
|
c3.push(m2), p3 || (p3 = "hidden" === m2.overflow);
|
|
1778
1778
|
}
|
|
1779
1779
|
p3 && /** @type {HTMLElement} */
|
|
@@ -1781,7 +1781,7 @@ function animate(e2, t2, n2, s2, i2) {
|
|
|
1781
1781
|
var e3 = (
|
|
1782
1782
|
/** @type {number} */
|
|
1783
1783
|
/** @type {globalThis.Animation} */
|
|
1784
|
-
|
|
1784
|
+
_2.currentTime
|
|
1785
1785
|
);
|
|
1786
1786
|
return o3 + a3 * f2(e3 / l3);
|
|
1787
1787
|
}, d2 && function loop(e3) {
|
|
@@ -1798,12 +1798,12 @@ function animate(e2, t2, n2, s2, i2) {
|
|
|
1798
1798
|
}
|
|
1799
1799
|
};
|
|
1800
1800
|
}(() => {
|
|
1801
|
-
if ("running" !==
|
|
1801
|
+
if ("running" !== _2.playState) return false;
|
|
1802
1802
|
var e3 = get_t();
|
|
1803
1803
|
return d2(e3, 1 - e3), true;
|
|
1804
1804
|
});
|
|
1805
1805
|
}
|
|
1806
|
-
(
|
|
1806
|
+
(_2 = e2.animate(c3, {
|
|
1807
1807
|
duration: l3,
|
|
1808
1808
|
fill: "forwards"
|
|
1809
1809
|
})).onfinish = () => {
|
|
@@ -1811,11 +1811,11 @@ function animate(e2, t2, n2, s2, i2) {
|
|
|
1811
1811
|
};
|
|
1812
1812
|
}, {
|
|
1813
1813
|
abort: () => {
|
|
1814
|
-
|
|
1815
|
-
|
|
1814
|
+
_2 && (_2.cancel(), // This prevents memory leaks in Chromium
|
|
1815
|
+
_2.effect = null, // This prevents onfinish to be launched after cancel(),
|
|
1816
1816
|
// which can happen in some rare cases
|
|
1817
1817
|
// see https://github.com/sveltejs/svelte/issues/13681
|
|
1818
|
-
|
|
1818
|
+
_2.onfinish = noop);
|
|
1819
1819
|
},
|
|
1820
1820
|
deactivate: () => {
|
|
1821
1821
|
i2 = noop;
|
|
@@ -1899,7 +1899,7 @@ function bind_this(e2 = {}, t2, n2, s2) {
|
|
|
1899
1899
|
function init(e2 = false) {
|
|
1900
1900
|
const t2 = (
|
|
1901
1901
|
/** @type {ComponentContextLegacy} */
|
|
1902
|
-
|
|
1902
|
+
O
|
|
1903
1903
|
), n2 = t2.l.u;
|
|
1904
1904
|
if (!n2) return;
|
|
1905
1905
|
let props = () => deep_read_state(t2.s);
|
|
@@ -2091,7 +2091,7 @@ const Ce = {
|
|
|
2091
2091
|
}
|
|
2092
2092
|
},
|
|
2093
2093
|
has(e2, t2) {
|
|
2094
|
-
if (t2 === C || t2 ===
|
|
2094
|
+
if (t2 === C || t2 === S) return false;
|
|
2095
2095
|
for (let n2 of e2.props) if (is_function(n2) && (n2 = n2()), null != n2 && t2 in n2) return true;
|
|
2096
2096
|
return false;
|
|
2097
2097
|
},
|
|
@@ -2115,7 +2115,7 @@ function has_destroyed_component_ctx(e2) {
|
|
|
2115
2115
|
}
|
|
2116
2116
|
function prop(e2, t2, n2, s2) {
|
|
2117
2117
|
var _a2;
|
|
2118
|
-
var i2, a2 = !!(1 & n2), l2 = !
|
|
2118
|
+
var i2, a2 = !!(1 & n2), l2 = !T || !!(2 & n2), c2 = !!(8 & n2), u2 = !!(16 & n2), d2 = false;
|
|
2119
2119
|
c2 ? [i2, d2] = function capture_store_binding(e3) {
|
|
2120
2120
|
var t3 = we;
|
|
2121
2121
|
try {
|
|
@@ -2128,19 +2128,19 @@ function prop(e2, t2, n2, s2) {
|
|
|
2128
2128
|
e2[t2]
|
|
2129
2129
|
)) : i2 = /** @type {V} */
|
|
2130
2130
|
e2[t2];
|
|
2131
|
-
var f2, p2 = C in e2 ||
|
|
2131
|
+
var f2, p2 = C in e2 || S in e2, g2 = c2 && (((_a2 = o(e2, t2)) == null ? void 0 : _a2.set) ?? (p2 && t2 in e2 && ((n3) => e2[t2] = n3))) || void 0, _2 = (
|
|
2132
2132
|
/** @type {V} */
|
|
2133
2133
|
s2
|
|
2134
|
-
), v2 = true, h2 = false, get_fallback = () => (h2 = true, v2 && (v2 = false,
|
|
2134
|
+
), v2 = true, h2 = false, get_fallback = () => (h2 = true, v2 && (v2 = false, _2 = u2 ? untrack(
|
|
2135
2135
|
/** @type {() => V} */
|
|
2136
2136
|
s2
|
|
2137
2137
|
) : (
|
|
2138
2138
|
/** @type {V} */
|
|
2139
2139
|
s2
|
|
2140
|
-
)),
|
|
2141
|
-
if (void 0 === i2 && void 0 !== s2 && (
|
|
2140
|
+
)), _2);
|
|
2141
|
+
if (void 0 === i2 && void 0 !== s2 && (g2 && l2 && function props_invalid_value(e3) {
|
|
2142
2142
|
throw new Error("https://svelte.dev/e/props_invalid_value");
|
|
2143
|
-
}(), i2 = get_fallback(),
|
|
2143
|
+
}(), i2 = get_fallback(), g2 && g2(i2)), l2) f2 = () => {
|
|
2144
2144
|
var n3 = (
|
|
2145
2145
|
/** @type {V} */
|
|
2146
2146
|
e2[t2]
|
|
@@ -2154,12 +2154,12 @@ function prop(e2, t2, n2, s2) {
|
|
|
2154
2154
|
));
|
|
2155
2155
|
m2.f |= 131072, f2 = () => {
|
|
2156
2156
|
var e3 = get$1(m2);
|
|
2157
|
-
return void 0 !== e3 && (
|
|
2158
|
-
void 0), void 0 === e3 ?
|
|
2157
|
+
return void 0 !== e3 && (_2 = /** @type {V} */
|
|
2158
|
+
void 0), void 0 === e3 ? _2 : e3;
|
|
2159
2159
|
};
|
|
2160
2160
|
}
|
|
2161
2161
|
if (!(4 & n2)) return f2;
|
|
2162
|
-
if (
|
|
2162
|
+
if (g2) {
|
|
2163
2163
|
var b2 = e2.$$legacy;
|
|
2164
2164
|
return function(e3, t3) {
|
|
2165
2165
|
return arguments.length > 0 ? (
|
|
@@ -2168,7 +2168,7 @@ function prop(e2, t2, n2, s2) {
|
|
|
2168
2168
|
// If the parent is not in runes mode, we need to notify on mutation, too, that the prop
|
|
2169
2169
|
// has changed because the parent will not be able to detect the change otherwise.
|
|
2170
2170
|
(l2 && t3 && !b2 && !d2 || /** @type {Function} */
|
|
2171
|
-
|
|
2171
|
+
g2(t3 ? f2() : e3), e3)
|
|
2172
2172
|
) : f2();
|
|
2173
2173
|
};
|
|
2174
2174
|
}
|
|
@@ -2182,7 +2182,7 @@ function prop(e2, t2, n2, s2) {
|
|
|
2182
2182
|
if (!w2.equals(n3)) {
|
|
2183
2183
|
if (y2 = true, set($2, n3), // To ensure the fallback value is consistent when used with proxies, we
|
|
2184
2184
|
// update the local fallback_value, but only if the fallback is actively used
|
|
2185
|
-
h2 && void 0 !==
|
|
2185
|
+
h2 && void 0 !== _2 && (_2 = n3), has_destroyed_component_ctx(w2)) return e3;
|
|
2186
2186
|
untrack(() => get$1(w2));
|
|
2187
2187
|
}
|
|
2188
2188
|
return e3;
|
|
@@ -2191,7 +2191,7 @@ function prop(e2, t2, n2, s2) {
|
|
|
2191
2191
|
};
|
|
2192
2192
|
}
|
|
2193
2193
|
function onMount(e2) {
|
|
2194
|
-
null ===
|
|
2194
|
+
null === O && lifecycle_outside_component(), T && null !== O.l ? (
|
|
2195
2195
|
/**
|
|
2196
2196
|
* Legacy-mode: Init callbacks object for onMount/beforeUpdate/afterUpdate
|
|
2197
2197
|
* @param {ComponentContext} context
|
|
@@ -2206,7 +2206,7 @@ function onMount(e2) {
|
|
|
2206
2206
|
b: [],
|
|
2207
2207
|
m: []
|
|
2208
2208
|
});
|
|
2209
|
-
}(
|
|
2209
|
+
}(O).m.push(e2)
|
|
2210
2210
|
) : user_effect(() => {
|
|
2211
2211
|
const t2 = untrack(e2);
|
|
2212
2212
|
if ("function" == typeof t2) return t2;
|
|
@@ -2214,7 +2214,7 @@ function onMount(e2) {
|
|
|
2214
2214
|
}
|
|
2215
2215
|
"undefined" != typeof window && // @ts-expect-error
|
|
2216
2216
|
((_a = window.__svelte ?? (window.__svelte = {})).v ?? (_a.v = /* @__PURE__ */ new Set())).add("5"), function enable_legacy_mode_flag() {
|
|
2217
|
-
|
|
2217
|
+
T = true;
|
|
2218
2218
|
}();
|
|
2219
2219
|
/**
|
|
2220
2220
|
* @license lucide-svelte v0.476.0 - ISC
|
|
@@ -2236,7 +2236,7 @@ function onMount(e2) {
|
|
|
2236
2236
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
2237
2237
|
*
|
|
2238
2238
|
*/
|
|
2239
|
-
const
|
|
2239
|
+
const Se = {
|
|
2240
2240
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2241
2241
|
width: 24,
|
|
2242
2242
|
height: 24,
|
|
@@ -2247,13 +2247,13 @@ const Me = {
|
|
|
2247
2247
|
"stroke-linecap": "round",
|
|
2248
2248
|
"stroke-linejoin": "round"
|
|
2249
2249
|
};
|
|
2250
|
-
var
|
|
2250
|
+
var Me = /* @__PURE__ */ ns_template("<svg><!><!></svg>");
|
|
2251
2251
|
function Icon$1(e2, t2) {
|
|
2252
2252
|
const n2 = legacy_rest_props(t2, ["children", "$$slots", "$$events", "$$legacy"]), s2 = legacy_rest_props(n2, ["name", "color", "size", "strokeWidth", "absoluteStrokeWidth", "iconNode"]);
|
|
2253
2253
|
push(t2, false);
|
|
2254
2254
|
let i2 = prop(t2, "name", 8, void 0), o2 = prop(t2, "color", 8, "currentColor"), a2 = prop(t2, "size", 8, 24), l2 = prop(t2, "strokeWidth", 8, 2), c2 = prop(t2, "absoluteStrokeWidth", 8, false), u2 = prop(t2, "iconNode", 24, () => []);
|
|
2255
2255
|
init();
|
|
2256
|
-
var d2 =
|
|
2256
|
+
var d2 = Me();
|
|
2257
2257
|
let f2;
|
|
2258
2258
|
var p2 = child(d2);
|
|
2259
2259
|
each(p2, 1, u2, index, (e3, t3) => {
|
|
@@ -2297,7 +2297,7 @@ function Icon$1(e2, t2) {
|
|
|
2297
2297
|
}));
|
|
2298
2298
|
}), append(e3, n3);
|
|
2299
2299
|
}), slot(sibling(p2), t2, "default", {}, null), template_effect((e3, t3) => f2 = set_attributes(d2, f2, {
|
|
2300
|
-
...
|
|
2300
|
+
...Se,
|
|
2301
2301
|
...s2,
|
|
2302
2302
|
width: a2(),
|
|
2303
2303
|
height: a2(),
|
|
@@ -2358,13 +2358,13 @@ function fade(e2, { delay: t2 = 0, duration: n2 = 400, easing: s2 = linear } = {
|
|
|
2358
2358
|
};
|
|
2359
2359
|
}
|
|
2360
2360
|
function fly(e2, { delay: t2 = 0, duration: n2 = 400, easing: s2 = cubic_out, x: i2 = 0, y: o2 = 0, opacity: a2 = 0 } = {}) {
|
|
2361
|
-
const l2 = getComputedStyle(e2), c2 = +l2.opacity, u2 = "none" === l2.transform ? "" : l2.transform, d2 = c2 * (1 - a2), [f2, p2] = split_css_unit(i2), [
|
|
2361
|
+
const l2 = getComputedStyle(e2), c2 = +l2.opacity, u2 = "none" === l2.transform ? "" : l2.transform, d2 = c2 * (1 - a2), [f2, p2] = split_css_unit(i2), [g2, _2] = split_css_unit(o2);
|
|
2362
2362
|
return {
|
|
2363
2363
|
delay: t2,
|
|
2364
2364
|
duration: n2,
|
|
2365
2365
|
easing: s2,
|
|
2366
2366
|
css: (e3, t3) => `
|
|
2367
|
-
transform: ${u2} translate(${(1 - e3) * f2}${p2}, ${(1 - e3) *
|
|
2367
|
+
transform: ${u2} translate(${(1 - e3) * f2}${p2}, ${(1 - e3) * g2}${_2});
|
|
2368
2368
|
opacity: ${c2 - d2 * t3}`
|
|
2369
2369
|
};
|
|
2370
2370
|
}
|
|
@@ -2372,12 +2372,12 @@ function slide(e2, { delay: t2 = 0, duration: n2 = 400, easing: s2 = cubic_out,
|
|
|
2372
2372
|
const o2 = getComputedStyle(e2), a2 = +o2.opacity, l2 = "y" === i2 ? "height" : "width", c2 = parseFloat(o2[l2]), u2 = "y" === i2 ? ["top", "bottom"] : ["left", "right"], d2 = u2.map((e3) => (
|
|
2373
2373
|
/** @type {'Left' | 'Right' | 'Top' | 'Bottom'} */
|
|
2374
2374
|
`${e3[0].toUpperCase()}${e3.slice(1)}`
|
|
2375
|
-
)), f2 = parseFloat(o2[`padding${d2[0]}`]), p2 = parseFloat(o2[`padding${d2[1]}`]),
|
|
2375
|
+
)), f2 = parseFloat(o2[`padding${d2[0]}`]), p2 = parseFloat(o2[`padding${d2[1]}`]), g2 = parseFloat(o2[`margin${d2[0]}`]), _2 = parseFloat(o2[`margin${d2[1]}`]), v2 = parseFloat(o2[`border${d2[0]}Width`]), h2 = parseFloat(o2[`border${d2[1]}Width`]);
|
|
2376
2376
|
return {
|
|
2377
2377
|
delay: t2,
|
|
2378
2378
|
duration: n2,
|
|
2379
2379
|
easing: s2,
|
|
2380
|
-
css: (e3) => `overflow: hidden;opacity: ${Math.min(20 * e3, 1) * a2};${l2}: ${e3 * c2}px;padding-${u2[0]}: ${e3 * f2}px;padding-${u2[1]}: ${e3 * p2}px;margin-${u2[0]}: ${e3 *
|
|
2380
|
+
css: (e3) => `overflow: hidden;opacity: ${Math.min(20 * e3, 1) * a2};${l2}: ${e3 * c2}px;padding-${u2[0]}: ${e3 * f2}px;padding-${u2[1]}: ${e3 * p2}px;margin-${u2[0]}: ${e3 * g2}px;margin-${u2[1]}: ${e3 * _2}px;border-${u2[0]}-width: ${e3 * v2}px;border-${u2[1]}-width: ${e3 * h2}px;min-${l2}: 0`
|
|
2381
2381
|
};
|
|
2382
2382
|
}
|
|
2383
2383
|
function scale(e2, { delay: t2 = 0, duration: n2 = 400, easing: s2 = cubic_out, start: i2 = 0, opacity: o2 = 0 } = {}) {
|
|
@@ -2395,12 +2395,12 @@ function scale(e2, { delay: t2 = 0, duration: n2 = 400, easing: s2 = cubic_out,
|
|
|
2395
2395
|
var on_click$4 = (e2, t2) => {
|
|
2396
2396
|
var _a2;
|
|
2397
2397
|
(_a2 = t2.onClick) == null ? void 0 : _a2.call(t2);
|
|
2398
|
-
},
|
|
2398
|
+
}, Te = /* @__PURE__ */ template('<button aria-label="open the game discovery"><p class="z-2 flex items-center overflow-hidden text-nowrap svelte-1j97rta"><!> <span class="text-md mr-0.25 inline-block font-bold svelte-1j97rta">More Games</span></p> <div class="bg-background absolute bottom-0 left-0 h-full w-0 transition-all duration-300 group-hover:w-full svelte-1j97rta"></div></button>');
|
|
2399
2399
|
function FloatingButton(e2, t2) {
|
|
2400
2400
|
push(t2, true);
|
|
2401
2401
|
let n2 = prop(t2, "position", 3, "bottom-right"), s2 = prop(t2, "visible", 3, true);
|
|
2402
2402
|
var i2 = comment(), o2 = first_child(i2), consequent = (e3) => {
|
|
2403
|
-
var s3 =
|
|
2403
|
+
var s3 = Te();
|
|
2404
2404
|
s3.__click = [on_click$4, t2];
|
|
2405
2405
|
var i3 = child(s3);
|
|
2406
2406
|
!function Gamepad(e4, t3) {
|
|
@@ -2454,21 +2454,21 @@ function FloatingButton(e2, t2) {
|
|
|
2454
2454
|
}), append(e2, i2), pop();
|
|
2455
2455
|
}
|
|
2456
2456
|
delegate(["click"]);
|
|
2457
|
-
const Oe = writable(false),
|
|
2458
|
-
var Pe = /* @__PURE__ */ ns_template('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>'),
|
|
2457
|
+
const Ie = writable(false), Oe = writable(false), qe = writable("https://sdk.playlight.dev");
|
|
2458
|
+
var Pe = /* @__PURE__ */ ns_template('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>'), We = /* @__PURE__ */ ns_template('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>'), ze = /* @__PURE__ */ ns_template('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>'), je = /* @__PURE__ */ ns_template('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');
|
|
2459
2459
|
function Icon(e2, t2) {
|
|
2460
2460
|
let n2 = prop(t2, "type", 8, "success");
|
|
2461
2461
|
var s2 = comment(), i2 = first_child(s2), consequent = (e3) => {
|
|
2462
2462
|
append(e3, Pe());
|
|
2463
2463
|
}, alternate = (e3, t3) => {
|
|
2464
2464
|
var consequent_1 = (e4) => {
|
|
2465
|
-
append(e4,
|
|
2465
|
+
append(e4, We());
|
|
2466
2466
|
}, alternate_1 = (e4, t4) => {
|
|
2467
2467
|
var consequent_2 = (e5) => {
|
|
2468
|
-
append(e5,
|
|
2468
|
+
append(e5, ze());
|
|
2469
2469
|
}, alternate_2 = (e5, t5) => {
|
|
2470
2470
|
var consequent_3 = (e6) => {
|
|
2471
|
-
append(e6,
|
|
2471
|
+
append(e6, je());
|
|
2472
2472
|
}, alternate_3 = (e6) => {
|
|
2473
2473
|
};
|
|
2474
2474
|
if_block(e5, (e6) => {
|
|
@@ -2487,42 +2487,42 @@ function Icon(e2, t2) {
|
|
|
2487
2487
|
"success" === n2() ? e3(consequent) : e3(alternate, false);
|
|
2488
2488
|
}), append(e2, s2);
|
|
2489
2489
|
}
|
|
2490
|
-
var
|
|
2490
|
+
var De = /* @__PURE__ */ template('<div class="sonner-loading-bar"></div>'), Ne = /* @__PURE__ */ template('<div class="sonner-loading-wrapper"><div class="sonner-spinner"></div></div>');
|
|
2491
2491
|
function Loader(e2, t2) {
|
|
2492
2492
|
push(t2, false);
|
|
2493
2493
|
let n2 = prop(t2, "visible", 8);
|
|
2494
2494
|
const s2 = Array(12).fill(0);
|
|
2495
2495
|
init();
|
|
2496
|
-
var i2 =
|
|
2496
|
+
var i2 = Ne();
|
|
2497
2497
|
each(child(i2), 5, () => s2, index, (e3, t3) => {
|
|
2498
|
-
append(e3,
|
|
2498
|
+
append(e3, De());
|
|
2499
2499
|
}), template_effect(() => set_attribute(i2, "data-visible", n2())), append(e2, i2), pop();
|
|
2500
2500
|
}
|
|
2501
2501
|
function cn(...e2) {
|
|
2502
2502
|
return e2.filter(Boolean).join(" ");
|
|
2503
2503
|
}
|
|
2504
|
-
const
|
|
2504
|
+
const Be = "undefined" != typeof document;
|
|
2505
2505
|
function clientWritable(e2) {
|
|
2506
2506
|
const t2 = writable(e2);
|
|
2507
2507
|
return {
|
|
2508
2508
|
subscribe: t2.subscribe,
|
|
2509
2509
|
set: function set2(e3) {
|
|
2510
|
-
|
|
2510
|
+
Be && t2.set(e3);
|
|
2511
2511
|
},
|
|
2512
2512
|
update: function update2(e3) {
|
|
2513
|
-
|
|
2513
|
+
Be && t2.update(e3);
|
|
2514
2514
|
}
|
|
2515
2515
|
};
|
|
2516
2516
|
}
|
|
2517
|
-
let
|
|
2518
|
-
const
|
|
2517
|
+
let Ee = 0;
|
|
2518
|
+
const Ae = function createToastState() {
|
|
2519
2519
|
const e2 = clientWritable([]), t2 = clientWritable([]);
|
|
2520
2520
|
function addToast(t3) {
|
|
2521
2521
|
e2.update((e3) => [t3, ...e3]);
|
|
2522
2522
|
}
|
|
2523
2523
|
function create(t3) {
|
|
2524
2524
|
var _a2;
|
|
2525
|
-
const { message: n2, ...s2 } = t3, i2 = "number" == typeof (t3 == null ? void 0 : t3.id) || t3.id && ((_a2 = t3.id) == null ? void 0 : _a2.length) > 0 ? t3.id :
|
|
2525
|
+
const { message: n2, ...s2 } = t3, i2 = "number" == typeof (t3 == null ? void 0 : t3.id) || t3.id && ((_a2 = t3.id) == null ? void 0 : _a2.length) > 0 ? t3.id : Ee++, o2 = void 0 === t3.dismissable || t3.dismissable, a2 = void 0 === t3.type ? "default" : t3.type, l2 = get(e2).find((e3) => e3.id === i2);
|
|
2526
2526
|
return l2 ? e2.update((e3) => e3.map((e4) => e4.id === i2 ? {
|
|
2527
2527
|
...e4,
|
|
2528
2528
|
...t3,
|
|
@@ -2659,7 +2659,7 @@ const Be = function createToastState() {
|
|
|
2659
2659
|
}), n2;
|
|
2660
2660
|
},
|
|
2661
2661
|
custom: function custom(e3, t3) {
|
|
2662
|
-
const n2 = (t3 == null ? void 0 : t3.id) ||
|
|
2662
|
+
const n2 = (t3 == null ? void 0 : t3.id) || Ee++;
|
|
2663
2663
|
return create({
|
|
2664
2664
|
component: e3,
|
|
2665
2665
|
id: n2,
|
|
@@ -2680,27 +2680,27 @@ const Be = function createToastState() {
|
|
|
2680
2680
|
heights: t2
|
|
2681
2681
|
};
|
|
2682
2682
|
}();
|
|
2683
|
-
const
|
|
2684
|
-
return
|
|
2683
|
+
const Le = function toastFunction(e2, t2) {
|
|
2684
|
+
return Ae.create({
|
|
2685
2685
|
message: e2,
|
|
2686
2686
|
...t2
|
|
2687
2687
|
});
|
|
2688
|
-
},
|
|
2689
|
-
success:
|
|
2690
|
-
info:
|
|
2691
|
-
warning:
|
|
2692
|
-
error:
|
|
2693
|
-
custom:
|
|
2694
|
-
message:
|
|
2695
|
-
promise:
|
|
2696
|
-
dismiss:
|
|
2697
|
-
loading:
|
|
2688
|
+
}, Ge = Object.assign(Le, {
|
|
2689
|
+
success: Ae.success,
|
|
2690
|
+
info: Ae.info,
|
|
2691
|
+
warning: Ae.warning,
|
|
2692
|
+
error: Ae.error,
|
|
2693
|
+
custom: Ae.custom,
|
|
2694
|
+
message: Ae.message,
|
|
2695
|
+
promise: Ae.promise,
|
|
2696
|
+
dismiss: Ae.dismiss,
|
|
2697
|
+
loading: Ae.loading
|
|
2698
2698
|
});
|
|
2699
|
-
var
|
|
2699
|
+
var Fe = /* @__PURE__ */ template('<button aria-label="Close toast" data-close-button=""><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button>'), He = /* @__PURE__ */ template('<div data-icon=""><!> <!></div>'), Re = /* @__PURE__ */ template('<div data-title=""><!></div>'), Ue = /* @__PURE__ */ template('<div data-description=""><!></div>'), Ve = /* @__PURE__ */ template('<button data-button="" data-cancel=""> </button>'), Ke = /* @__PURE__ */ template('<button data-button=""> </button>'), Ye = /* @__PURE__ */ template('<!> <div data-content=""><!> <!></div> <!> <!>', 1), Ze = /* @__PURE__ */ template('<li aria-atomic="true" role="status" data-sonner-toast=""><!> <!></li>');
|
|
2700
2700
|
function Toast(e2, t2) {
|
|
2701
2701
|
const n2 = legacy_rest_props(t2, ["children", "$$slots", "$$events", "$$legacy"]);
|
|
2702
2702
|
push(t2, false);
|
|
2703
|
-
const [s2, i2] = setup_stores(), $heights = () => store_get(y2, "$heights", s2), $effect = () => store_get(get$1(Q2), "$effect", s2), o2 = /* @__PURE__ */ mutable_source(void 0, true), a2 = /* @__PURE__ */ mutable_source(void 0, true), l2 = /* @__PURE__ */ mutable_source(void 0, true), c2 = /* @__PURE__ */ mutable_source(void 0, true), u2 = /* @__PURE__ */ mutable_source(void 0, true), d2 = /* @__PURE__ */ mutable_source(void 0, true), f2 = /* @__PURE__ */ mutable_source(void 0, true), p2 = /* @__PURE__ */ mutable_source(void 0, true),
|
|
2703
|
+
const [s2, i2] = setup_stores(), $heights = () => store_get(y2, "$heights", s2), $effect = () => store_get(get$1(Q2), "$effect", s2), o2 = /* @__PURE__ */ mutable_source(void 0, true), a2 = /* @__PURE__ */ mutable_source(void 0, true), l2 = /* @__PURE__ */ mutable_source(void 0, true), c2 = /* @__PURE__ */ mutable_source(void 0, true), u2 = /* @__PURE__ */ mutable_source(void 0, true), d2 = /* @__PURE__ */ mutable_source(void 0, true), f2 = /* @__PURE__ */ mutable_source(void 0, true), p2 = /* @__PURE__ */ mutable_source(void 0, true), g2 = /* @__PURE__ */ mutable_source(void 0, true), _2 = /* @__PURE__ */ mutable_source(void 0, true), v2 = /* @__PURE__ */ mutable_source(void 0, true), h2 = /* @__PURE__ */ mutable_source(void 0, true), m2 = {
|
|
2704
2704
|
toast: "",
|
|
2705
2705
|
title: "",
|
|
2706
2706
|
description: "",
|
|
@@ -2715,15 +2715,15 @@ function Toast(e2, t2) {
|
|
|
2715
2715
|
default: "",
|
|
2716
2716
|
info: "",
|
|
2717
2717
|
loading: ""
|
|
2718
|
-
}, { toasts: b2, heights: y2, removeHeight: $2, setHeight: w2, remove: x2 } =
|
|
2719
|
-
let k2 = prop(t2, "toast", 9), C2 = prop(t2, "index", 9),
|
|
2718
|
+
}, { toasts: b2, heights: y2, removeHeight: $2, setHeight: w2, remove: x2 } = Ae;
|
|
2719
|
+
let k2 = prop(t2, "toast", 9), C2 = prop(t2, "index", 9), S2 = prop(t2, "expanded", 9), M2 = prop(t2, "invert", 13), T2 = prop(t2, "position", 9), I2 = prop(t2, "visibleToasts", 9), O2 = prop(t2, "expandByDefault", 9), q2 = prop(t2, "closeButton", 9), P2 = prop(t2, "interacting", 9), W2 = prop(t2, "cancelButtonStyle", 9, ""), z2 = prop(t2, "actionButtonStyle", 9, ""), j2 = prop(t2, "duration", 9, 4e3), D2 = prop(t2, "descriptionClass", 9, ""), N2 = prop(t2, "classes", 29, () => ({})), B2 = prop(t2, "unstyled", 9, false), E2 = /* @__PURE__ */ mutable_source(false, true), A2 = /* @__PURE__ */ mutable_source(false, true), L2 = /* @__PURE__ */ mutable_source(false, true), G2 = /* @__PURE__ */ mutable_source(false, true), F2 = /* @__PURE__ */ mutable_source(0, true), H2 = /* @__PURE__ */ mutable_source(0, true), R2 = /* @__PURE__ */ mutable_source(void 0, true), U2 = /* @__PURE__ */ mutable_source(0, true), V2 = 0, K2 = 0, Y2 = null;
|
|
2720
2720
|
function deleteToast() {
|
|
2721
2721
|
set(A2, true), // Save the offset for the exit swipe animation
|
|
2722
2722
|
set(F2, get$1(U2)), $2(k2().id), setTimeout(() => {
|
|
2723
2723
|
x2(k2().id);
|
|
2724
2724
|
}, 200);
|
|
2725
2725
|
}
|
|
2726
|
-
let Z2 = /* @__PURE__ */ mutable_source(void 0, true), J2 = /* @__PURE__ */ mutable_source(k2().duration ||
|
|
2726
|
+
let Z2 = /* @__PURE__ */ mutable_source(void 0, true), J2 = /* @__PURE__ */ mutable_source(k2().duration || j2() || 4e3, true);
|
|
2727
2727
|
function startTimer() {
|
|
2728
2728
|
V2 = (/* @__PURE__ */ new Date()).getTime(), // Let the toast know it has started
|
|
2729
2729
|
set(Z2, setTimeout(() => {
|
|
@@ -2733,21 +2733,21 @@ function Toast(e2, t2) {
|
|
|
2733
2733
|
}
|
|
2734
2734
|
let Q2 = /* @__PURE__ */ mutable_source(void 0, true);
|
|
2735
2735
|
onMount(() => {
|
|
2736
|
-
set(
|
|
2736
|
+
set(E2, true);
|
|
2737
2737
|
const e3 = get$1(R2).getBoundingClientRect().height;
|
|
2738
2738
|
return set(H2, e3), w2({
|
|
2739
2739
|
toastId: k2().id,
|
|
2740
2740
|
height: e3
|
|
2741
2741
|
}), () => $2(k2().id);
|
|
2742
|
-
}), legacy_pre_effect(() => deep_read_state(
|
|
2743
|
-
|
|
2742
|
+
}), legacy_pre_effect(() => deep_read_state(N2()), () => {
|
|
2743
|
+
N2({
|
|
2744
2744
|
...m2,
|
|
2745
|
-
...
|
|
2745
|
+
...N2()
|
|
2746
2746
|
});
|
|
2747
2747
|
}), legacy_pre_effect(() => deep_read_state(C2()), () => {
|
|
2748
2748
|
set(o2, 0 === C2());
|
|
2749
|
-
}), legacy_pre_effect(() => (deep_read_state(C2()), deep_read_state(
|
|
2750
|
-
set(a2, C2() + 1 <=
|
|
2749
|
+
}), legacy_pre_effect(() => (deep_read_state(C2()), deep_read_state(I2())), () => {
|
|
2750
|
+
set(a2, C2() + 1 <= I2());
|
|
2751
2751
|
}), legacy_pre_effect(() => deep_read_state(k2()), () => {
|
|
2752
2752
|
set(l2, k2().title);
|
|
2753
2753
|
}), legacy_pre_effect(() => deep_read_state(k2()), () => {
|
|
@@ -2760,25 +2760,25 @@ function Toast(e2, t2) {
|
|
|
2760
2760
|
set(f2, k2().descriptionClass || "");
|
|
2761
2761
|
}), legacy_pre_effect(() => ($heights(), deep_read_state(k2())), () => {
|
|
2762
2762
|
set(p2, $heights().findIndex((e3) => e3.toastId === k2().id) || 0);
|
|
2763
|
-
}), legacy_pre_effect(() => deep_read_state(
|
|
2764
|
-
set(
|
|
2763
|
+
}), legacy_pre_effect(() => deep_read_state(T2()), () => {
|
|
2764
|
+
set(g2, T2().split("-"));
|
|
2765
2765
|
}), legacy_pre_effect(() => ($heights(), get$1(p2)), () => {
|
|
2766
|
-
set(
|
|
2766
|
+
set(_2, $heights().reduce((e3, t3, n3) => (
|
|
2767
2767
|
// Calculate offset up untill current toast
|
|
2768
2768
|
n3 >= get$1(p2) ? e3 : e3 + t3.height
|
|
2769
2769
|
), 0));
|
|
2770
|
-
}), legacy_pre_effect(() => (deep_read_state(
|
|
2771
|
-
|
|
2770
|
+
}), legacy_pre_effect(() => (deep_read_state(M2()), deep_read_state(k2())), () => {
|
|
2771
|
+
M2(k2().invert || M2());
|
|
2772
2772
|
}), legacy_pre_effect(() => get$1(u2), () => {
|
|
2773
2773
|
set(v2, "loading" === get$1(u2));
|
|
2774
|
-
}), legacy_pre_effect(() => (get$1(p2), get$1(
|
|
2775
|
-
set(U2, Math.round(14 * get$1(p2) + get$1(
|
|
2774
|
+
}), legacy_pre_effect(() => (get$1(p2), get$1(_2)), () => {
|
|
2775
|
+
set(U2, Math.round(14 * get$1(p2) + get$1(_2)));
|
|
2776
2776
|
}), legacy_pre_effect(() => (get$1(l2), get$1(c2)), () => {
|
|
2777
2777
|
get$1(l2), get$1(c2), // Listen to height changes
|
|
2778
2778
|
async function updateHeights() {
|
|
2779
|
-
if (!get$1(
|
|
2779
|
+
if (!get$1(E2)) return;
|
|
2780
2780
|
let e3;
|
|
2781
|
-
await tick(), e3 =
|
|
2781
|
+
await tick(), e3 = S2() || O2() ? 1 : 1 - 0.05 * C2(), get$1(R2).style.setProperty("height", "auto");
|
|
2782
2782
|
const t3 = get$1(R2).offsetHeight, n3 = get$1(R2).getBoundingClientRect().height, s3 = Math.round(100 * (n3 / e3 + Number.EPSILON)) / 100;
|
|
2783
2783
|
let i3;
|
|
2784
2784
|
get$1(R2).style.removeProperty("height"), // Use scaledRectHeight as it's more precise
|
|
@@ -2787,20 +2787,20 @@ function Toast(e2, t2) {
|
|
|
2787
2787
|
height: i3
|
|
2788
2788
|
});
|
|
2789
2789
|
}();
|
|
2790
|
-
}), legacy_pre_effect(() => (deep_read_state(k2()), get$1(Z2), deep_read_state(
|
|
2790
|
+
}), legacy_pre_effect(() => (deep_read_state(k2()), get$1(Z2), deep_read_state(j2())), () => {
|
|
2791
2791
|
k2().updated && // if the toast has been updated after the initial render,
|
|
2792
2792
|
// we want to reset the timer and set the remaining time to the
|
|
2793
2793
|
// new duration
|
|
2794
|
-
(clearTimeout(get$1(Z2)), set(J2, k2().duration ||
|
|
2794
|
+
(clearTimeout(get$1(Z2)), set(J2, k2().duration || j2() || 4e3), startTimer());
|
|
2795
2795
|
}), legacy_pre_effect(() => (deep_read_state(k2()), get$1(u2)), () => {
|
|
2796
2796
|
set(h2, k2().promise && "loading" === get$1(u2) || k2().duration === Number.POSITIVE_INFINITY);
|
|
2797
|
-
}), legacy_pre_effect(() => (get$1(h2), deep_read_state(
|
|
2797
|
+
}), legacy_pre_effect(() => (get$1(h2), deep_read_state(S2()), deep_read_state(P2()), get$1(Z2)), () => {
|
|
2798
2798
|
var e3;
|
|
2799
2799
|
!function store_unsub(e4, t3, n3) {
|
|
2800
2800
|
let s3 = n3[t3];
|
|
2801
2801
|
return s3 && s3.store !== e4 && // Don't reset store yet, so that store_get above can resubscribe to new store if necessary
|
|
2802
2802
|
(s3.unsubscribe(), s3.unsubscribe = noop), e4;
|
|
2803
|
-
}(set(Q2, (e3 = () => (get$1(h2) || (
|
|
2803
|
+
}(set(Q2, (e3 = () => (get$1(h2) || (S2() || P2() ? (
|
|
2804
2804
|
// If toast's duration changes, it will be out of sync with the
|
|
2805
2805
|
// remainingAtTimeout, so we know we need to restart the timer
|
|
2806
2806
|
// with the new duration
|
|
@@ -2820,16 +2820,16 @@ function Toast(e2, t2) {
|
|
|
2820
2820
|
}), legacy_pre_effect(() => deep_read_state(k2()), () => {
|
|
2821
2821
|
k2().delete && deleteToast();
|
|
2822
2822
|
}), legacy_pre_effect_reset(), init(true);
|
|
2823
|
-
var ee2 =
|
|
2823
|
+
var ee2 = Ze();
|
|
2824
2824
|
let te2;
|
|
2825
2825
|
set_attribute(ee2, "tabindex", 0);
|
|
2826
2826
|
var ne2 = child(ee2), consequent = (e3) => {
|
|
2827
|
-
var t3 =
|
|
2827
|
+
var t3 = Fe();
|
|
2828
2828
|
template_effect((e4) => {
|
|
2829
2829
|
set_attribute(t3, "data-disabled", get$1(v2)), set_class(t3, 1, e4);
|
|
2830
2830
|
}, [() => {
|
|
2831
2831
|
var _a2, _b2, _c2;
|
|
2832
|
-
return clsx(cn((_a2 =
|
|
2832
|
+
return clsx(cn((_a2 = N2()) == null ? void 0 : _a2.closeButton, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.closeButton));
|
|
2833
2833
|
}], derived_safe_equal), event("click", t3, function(...e4) {
|
|
2834
2834
|
var _a2;
|
|
2835
2835
|
(_a2 = get$1(v2) ? void 0 : () => {
|
|
@@ -2839,7 +2839,7 @@ function Toast(e2, t2) {
|
|
|
2839
2839
|
}), append(e3, t3);
|
|
2840
2840
|
};
|
|
2841
2841
|
if_block(ne2, (e3) => {
|
|
2842
|
-
|
|
2842
|
+
q2() && !k2().component && e3(consequent);
|
|
2843
2843
|
});
|
|
2844
2844
|
var re2 = sibling(ne2, 2), consequent_1 = (e3) => {
|
|
2845
2845
|
var t3 = comment();
|
|
@@ -2851,8 +2851,8 @@ function Toast(e2, t2) {
|
|
|
2851
2851
|
}));
|
|
2852
2852
|
}), append(e3, t3);
|
|
2853
2853
|
}, alternate = (e3) => {
|
|
2854
|
-
var n3 =
|
|
2855
|
-
var n4 =
|
|
2854
|
+
var n3 = Ye(), s3 = first_child(n3), consequent_8 = (e4) => {
|
|
2855
|
+
var n4 = He(), s4 = child(n4), consequent_2 = (e5) => {
|
|
2856
2856
|
var n5 = comment();
|
|
2857
2857
|
slot(first_child(n5), t2, "loading-icon", {}, null), append(e5, n5);
|
|
2858
2858
|
};
|
|
@@ -2905,7 +2905,7 @@ function Toast(e2, t2) {
|
|
|
2905
2905
|
("default" !== get$1(u2) || k2().icon || k2().promise) && e4(consequent_8);
|
|
2906
2906
|
});
|
|
2907
2907
|
var i3 = sibling(s3, 2), o3 = child(i3), consequent_10 = (e4) => {
|
|
2908
|
-
var t3 =
|
|
2908
|
+
var t3 = Re(), n4 = child(t3), consequent_9 = (e5) => {
|
|
2909
2909
|
var t4 = comment();
|
|
2910
2910
|
component(first_child(t4), () => k2().title, (e6, t5) => {
|
|
2911
2911
|
t5(e6, spread_props(() => k2().componentProps));
|
|
@@ -2918,14 +2918,14 @@ function Toast(e2, t2) {
|
|
|
2918
2918
|
"string" != typeof k2().title ? e5(consequent_9) : e5(alternate_5, false);
|
|
2919
2919
|
}), template_effect((e5) => set_class(t3, 1, e5), [() => {
|
|
2920
2920
|
var _a2, _b2, _c2;
|
|
2921
|
-
return clsx(cn((_a2 =
|
|
2921
|
+
return clsx(cn((_a2 = N2()) == null ? void 0 : _a2.title, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.title));
|
|
2922
2922
|
}], derived_safe_equal), append(e4, t3);
|
|
2923
2923
|
};
|
|
2924
2924
|
if_block(o3, (e4) => {
|
|
2925
2925
|
k2().title && e4(consequent_10);
|
|
2926
2926
|
});
|
|
2927
2927
|
var a3 = sibling(o3, 2), consequent_12 = (e4) => {
|
|
2928
|
-
var t3 =
|
|
2928
|
+
var t3 = Ue(), n4 = child(t3), consequent_11 = (e5) => {
|
|
2929
2929
|
var t4 = comment();
|
|
2930
2930
|
component(first_child(t4), () => k2().description, (e6, t5) => {
|
|
2931
2931
|
t5(e6, spread_props(() => k2().componentProps));
|
|
@@ -2938,19 +2938,19 @@ function Toast(e2, t2) {
|
|
|
2938
2938
|
"string" != typeof k2().description ? e5(consequent_11) : e5(alternate_6, false);
|
|
2939
2939
|
}), template_effect((e5) => set_class(t3, 1, e5), [() => {
|
|
2940
2940
|
var _a2, _b2;
|
|
2941
|
-
return clsx(cn(
|
|
2941
|
+
return clsx(cn(D2(), get$1(f2), (_a2 = N2()) == null ? void 0 : _a2.description, (_b2 = k2().classes) == null ? void 0 : _b2.description));
|
|
2942
2942
|
}], derived_safe_equal), append(e4, t3);
|
|
2943
2943
|
};
|
|
2944
2944
|
if_block(a3, (e4) => {
|
|
2945
2945
|
k2().description && e4(consequent_12);
|
|
2946
2946
|
});
|
|
2947
2947
|
var l3 = sibling(i3, 2), consequent_13 = (e4) => {
|
|
2948
|
-
var t3 =
|
|
2948
|
+
var t3 = Ve(), n4 = child(t3);
|
|
2949
2949
|
template_effect((e5) => {
|
|
2950
2950
|
set_style(t3, W2()), set_class(t3, 1, e5), set_text(n4, k2().cancel.label);
|
|
2951
2951
|
}, [() => {
|
|
2952
2952
|
var _a2, _b2, _c2;
|
|
2953
|
-
return clsx(cn((_a2 =
|
|
2953
|
+
return clsx(cn((_a2 = N2()) == null ? void 0 : _a2.cancelButton, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.cancelButton));
|
|
2954
2954
|
}], derived_safe_equal), event("click", t3, () => {
|
|
2955
2955
|
var _a2;
|
|
2956
2956
|
deleteToast(), ((_a2 = k2().cancel) == null ? void 0 : _a2.onClick) && k2().cancel.onClick();
|
|
@@ -2960,12 +2960,12 @@ function Toast(e2, t2) {
|
|
|
2960
2960
|
k2().cancel && e4(consequent_13);
|
|
2961
2961
|
});
|
|
2962
2962
|
var c3 = sibling(l3, 2), consequent_14 = (e4) => {
|
|
2963
|
-
var t3 =
|
|
2963
|
+
var t3 = Ke(), n4 = child(t3);
|
|
2964
2964
|
template_effect((e5) => {
|
|
2965
2965
|
set_style(t3, z2()), set_class(t3, 1, e5), set_text(n4, k2().action.label);
|
|
2966
2966
|
}, [() => {
|
|
2967
2967
|
var _a2, _b2, _c2;
|
|
2968
|
-
return clsx(cn((_a2 =
|
|
2968
|
+
return clsx(cn((_a2 = N2()) == null ? void 0 : _a2.actionButton, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.actionButton));
|
|
2969
2969
|
}], derived_safe_equal), event("click", t3, (e5) => {
|
|
2970
2970
|
var _a2;
|
|
2971
2971
|
(_a2 = k2().action) == null ? void 0 : _a2.onClick(e5), e5.defaultPrevented || deleteToast();
|
|
@@ -2979,7 +2979,7 @@ function Toast(e2, t2) {
|
|
|
2979
2979
|
k2().component ? e3(consequent_1) : e3(alternate, false);
|
|
2980
2980
|
}), bind_this(ee2, (e3) => set(R2, e3), () => get$1(R2)), template_effect((e3, t3, i3) => {
|
|
2981
2981
|
var _a2;
|
|
2982
|
-
set_attribute(ee2, "aria-live", k2().important ? "assertive" : "polite"), set_class(ee2, 1, e3), set_attribute(ee2, "data-styled", !(k2().component || ((_a2 = k2()) == null ? void 0 : _a2.unstyled) ||
|
|
2982
|
+
set_attribute(ee2, "aria-live", k2().important ? "assertive" : "polite"), set_class(ee2, 1, e3), set_attribute(ee2, "data-styled", !(k2().component || ((_a2 = k2()) == null ? void 0 : _a2.unstyled) || B2())), set_attribute(ee2, "data-mounted", get$1(E2)), set_attribute(ee2, "data-promise", t3), set_attribute(ee2, "data-removed", get$1(A2)), set_attribute(ee2, "data-visible", get$1(a2)), set_attribute(ee2, "data-y-position", get$1(g2)[0]), set_attribute(ee2, "data-x-position", get$1(g2)[1]), set_attribute(ee2, "data-index", C2()), set_attribute(ee2, "data-front", get$1(o2)), set_attribute(ee2, "data-swiping", get$1(L2)), set_attribute(ee2, "data-type", get$1(u2)), set_attribute(ee2, "data-invert", M2()), set_attribute(ee2, "data-swipe-out", get$1(G2)), set_attribute(ee2, "data-expanded", i3), te2 = set_style(ee2, `${n2.style} ${k2().style}`, te2, {
|
|
2983
2983
|
"--index": C2(),
|
|
2984
2984
|
"--toasts-before": C2(),
|
|
2985
2985
|
"--z-index": store_get(b2, "$toasts", s2).length - C2(),
|
|
@@ -2988,8 +2988,8 @@ function Toast(e2, t2) {
|
|
|
2988
2988
|
});
|
|
2989
2989
|
}, [() => {
|
|
2990
2990
|
var _a2, _b2, _c2, _d, _e3, _f;
|
|
2991
|
-
return clsx(cn(n2.class, get$1(d2), (_a2 =
|
|
2992
|
-
}, () => Boolean(k2().promise), () => Boolean(
|
|
2991
|
+
return clsx(cn(n2.class, get$1(d2), (_a2 = N2()) == null ? void 0 : _a2.toast, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.toast, (_d = N2()) == null ? void 0 : _d[get$1(u2)], (_f = (_e3 = k2()) == null ? void 0 : _e3.classes) == null ? void 0 : _f[get$1(u2)]));
|
|
2992
|
+
}, () => Boolean(k2().promise), () => Boolean(S2() || O2() && get$1(E2))], derived_safe_equal), event("pointerdown", ee2, function onPointerDown(e3) {
|
|
2993
2993
|
if (get$1(v2)) return;
|
|
2994
2994
|
set(F2, get$1(U2));
|
|
2995
2995
|
const t3 = e3.target;
|
|
@@ -3006,13 +3006,13 @@ function Toast(e2, t2) {
|
|
|
3006
3006
|
get$1(R2).style.setProperty("--swipe-amount", "0px"), set(L2, false);
|
|
3007
3007
|
}), event("pointermove", ee2, function onPointerMove(e3) {
|
|
3008
3008
|
if (!Y2) return;
|
|
3009
|
-
const t3 = e3.clientY - Y2.y, n3 = e3.clientX - Y2.x, s3 = ("top" === get$1(
|
|
3009
|
+
const t3 = e3.clientY - Y2.y, n3 = e3.clientX - Y2.x, s3 = ("top" === get$1(g2)[0] ? Math.min : Math.max)(0, t3), i3 = "touch" === e3.pointerType ? 10 : 2;
|
|
3010
3010
|
Math.abs(s3) > i3 ? get$1(R2).style.setProperty("--swipe-amount", `${t3}px`) : Math.abs(n3) > i3 && // User is swiping in wrong direction so we disable swipe gesture
|
|
3011
3011
|
// for the current pointer down interaction
|
|
3012
3012
|
(Y2 = null);
|
|
3013
3013
|
}), append(e2, ee2), pop(), i2();
|
|
3014
3014
|
}
|
|
3015
|
-
var
|
|
3015
|
+
var Je = /* @__PURE__ */ template("<ol></ol>"), Xe = /* @__PURE__ */ template('<section class="svelte-1fo5d1m"></section>');
|
|
3016
3016
|
function Toaster(e2, t2) {
|
|
3017
3017
|
const n2 = legacy_rest_props(t2, ["children", "$$slots", "$$events", "$$legacy"]), s2 = legacy_rest_props(n2, ["invert", "theme", "position", "hotkey", "containerAriaLabel", "richColors", "expand", "duration", "visibleToasts", "closeButton", "toastOptions", "offset", "dir"]);
|
|
3018
3018
|
push(t2, false);
|
|
@@ -3023,43 +3023,43 @@ function Toaster(e2, t2) {
|
|
|
3023
3023
|
const e3 = document.documentElement.getAttribute("dir");
|
|
3024
3024
|
return "auto" !== e3 && e3 ? e3 : window.getComputedStyle(document.documentElement).direction;
|
|
3025
3025
|
}
|
|
3026
|
-
let d2 = prop(t2, "invert", 8, false), f2 = prop(t2, "theme", 8, "light"), p2 = prop(t2, "position", 8, "bottom-right"),
|
|
3027
|
-
const { toasts: k2, heights: C2, reset:
|
|
3028
|
-
let
|
|
3026
|
+
let d2 = prop(t2, "invert", 8, false), f2 = prop(t2, "theme", 8, "light"), p2 = prop(t2, "position", 8, "bottom-right"), g2 = prop(t2, "hotkey", 24, () => ["altKey", "KeyT"]), _2 = prop(t2, "containerAriaLabel", 8, "Notifications"), v2 = prop(t2, "richColors", 8, false), h2 = prop(t2, "expand", 8, false), m2 = prop(t2, "duration", 8, 4e3), b2 = prop(t2, "visibleToasts", 8, 3), y2 = prop(t2, "closeButton", 8, false), $2 = prop(t2, "toastOptions", 24, () => ({})), w2 = prop(t2, "offset", 8, null), x2 = prop(t2, "dir", 24, getDocumentDirection);
|
|
3027
|
+
const { toasts: k2, heights: C2, reset: S2 } = Ae;
|
|
3028
|
+
let M2 = /* @__PURE__ */ mutable_source(false), T2 = /* @__PURE__ */ mutable_source(false), I2 = /* @__PURE__ */ mutable_source(function getInitialTheme(e3) {
|
|
3029
3029
|
return "system" !== e3 ? e3 : "undefined" != typeof window && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? c2 : u2;
|
|
3030
|
-
}(f2())),
|
|
3030
|
+
}(f2())), q2 = /* @__PURE__ */ mutable_source(), P2 = null, W2 = false;
|
|
3031
3031
|
function handleBlur(e3) {
|
|
3032
|
-
W2 && !e3.currentTarget.contains(e3.relatedTarget) && (W2 = false,
|
|
3032
|
+
W2 && !e3.currentTarget.contains(e3.relatedTarget) && (W2 = false, P2 && (P2.focus({
|
|
3033
3033
|
preventScroll: true
|
|
3034
|
-
}),
|
|
3034
|
+
}), P2 = null));
|
|
3035
3035
|
}
|
|
3036
3036
|
function handleFocus(e3) {
|
|
3037
|
-
W2 || (W2 = true,
|
|
3037
|
+
W2 || (W2 = true, P2 = e3.relatedTarget);
|
|
3038
3038
|
}
|
|
3039
3039
|
!function onDestroy(e3) {
|
|
3040
|
-
null ===
|
|
3040
|
+
null === O && lifecycle_outside_component(), onMount(() => () => untrack(e3));
|
|
3041
3041
|
}(() => {
|
|
3042
|
-
get$1(
|
|
3042
|
+
get$1(q2) && P2 && (P2.focus({
|
|
3043
3043
|
preventScroll: true
|
|
3044
|
-
}),
|
|
3044
|
+
}), P2 = null, W2 = false);
|
|
3045
3045
|
}), onMount(() => {
|
|
3046
|
-
|
|
3046
|
+
S2();
|
|
3047
3047
|
const handleKeydown = (e3) => {
|
|
3048
3048
|
var _a2, _b2;
|
|
3049
|
-
|
|
3049
|
+
g2().every((t3) => (
|
|
3050
3050
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3051
3051
|
e3[t3] || e3.code === t3
|
|
3052
|
-
)) && (set(
|
|
3052
|
+
)) && (set(M2, true), (_a2 = get$1(q2)) == null ? void 0 : _a2.focus()), "Escape" !== e3.code || document.activeElement !== get$1(q2) && !((_b2 = get$1(q2)) == null ? void 0 : _b2.contains(document.activeElement)) || set(M2, false);
|
|
3053
3053
|
};
|
|
3054
3054
|
return document.addEventListener("keydown", handleKeydown), () => {
|
|
3055
3055
|
document.removeEventListener("keydown", handleKeydown);
|
|
3056
3056
|
};
|
|
3057
3057
|
}), legacy_pre_effect(() => (deep_read_state(p2()), $toasts()), () => {
|
|
3058
3058
|
set(a2, Array.from(new Set([p2(), ...$toasts().filter((e3) => e3.position).map((e3) => e3.position)].filter(Boolean))));
|
|
3059
|
-
}), legacy_pre_effect(() => deep_read_state(
|
|
3060
|
-
set(l2,
|
|
3059
|
+
}), legacy_pre_effect(() => deep_read_state(g2()), () => {
|
|
3060
|
+
set(l2, g2().join("+").replace(/Key/g, "").replace(/Digit/g, ""));
|
|
3061
3061
|
}), legacy_pre_effect(() => $toasts(), () => {
|
|
3062
|
-
$toasts().length <= 1 && set(
|
|
3062
|
+
$toasts().length <= 1 && set(M2, false);
|
|
3063
3063
|
}), legacy_pre_effect(() => $toasts(), () => {
|
|
3064
3064
|
const e3 = $toasts().filter((e4) => e4.dismiss && !e4.delete);
|
|
3065
3065
|
if (e3.length > 0) {
|
|
@@ -3070,17 +3070,17 @@ function Toaster(e2, t2) {
|
|
|
3070
3070
|
k2.set(t3);
|
|
3071
3071
|
}
|
|
3072
3072
|
}), legacy_pre_effect(() => deep_read_state(f2()), () => {
|
|
3073
|
-
if ("system" !== f2() && set(
|
|
3073
|
+
if ("system" !== f2() && set(I2, f2()), "undefined" != typeof window) {
|
|
3074
3074
|
"system" === f2() && // check if current preference is dark
|
|
3075
3075
|
(window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? (
|
|
3076
3076
|
// it's currently dark
|
|
3077
|
-
set(
|
|
3077
|
+
set(I2, c2)
|
|
3078
3078
|
) : (
|
|
3079
3079
|
// it's not dark
|
|
3080
|
-
set(
|
|
3080
|
+
set(I2, u2)
|
|
3081
3081
|
));
|
|
3082
3082
|
const e3 = window.matchMedia("(prefers-color-scheme: dark)"), changeHandler = ({ matches: e4 }) => {
|
|
3083
|
-
set(
|
|
3083
|
+
set(I2, e4 ? c2 : u2);
|
|
3084
3084
|
};
|
|
3085
3085
|
"addEventListener" in e3 ? e3.addEventListener("change", changeHandler) : (
|
|
3086
3086
|
// @ts-expect-error deprecated API
|
|
@@ -3088,10 +3088,10 @@ function Toaster(e2, t2) {
|
|
|
3088
3088
|
);
|
|
3089
3089
|
}
|
|
3090
3090
|
}), legacy_pre_effect_reset(), init();
|
|
3091
|
-
var z2 = comment(),
|
|
3092
|
-
var o3 =
|
|
3091
|
+
var z2 = comment(), j2 = first_child(z2), consequent = (e3) => {
|
|
3092
|
+
var o3 = Xe();
|
|
3093
3093
|
set_attribute(o3, "tabindex", -1), each(o3, 5, () => get$1(a2), index, (e4, o4, a3, l3) => {
|
|
3094
|
-
var c3 =
|
|
3094
|
+
var c3 = Je();
|
|
3095
3095
|
let u3;
|
|
3096
3096
|
each(c3, 7, () => $toasts().filter((e5) => !e5.position && 0 === a3 || e5.position === get$1(o4)), (e5) => e5.id, (e5, n3, s3, i3) => {
|
|
3097
3097
|
const a4 = /* @__PURE__ */ derived_safe_equal(() => {
|
|
@@ -3109,7 +3109,7 @@ function Toaster(e2, t2) {
|
|
|
3109
3109
|
}), f3 = /* @__PURE__ */ derived_safe_equal(() => $2().classes || {}), p3 = /* @__PURE__ */ derived_safe_equal(() => {
|
|
3110
3110
|
var _a2;
|
|
3111
3111
|
return ((_a2 = $2()) == null ? void 0 : _a2.duration) ?? m2();
|
|
3112
|
-
}),
|
|
3112
|
+
}), g3 = /* @__PURE__ */ derived_safe_equal(() => $2().unstyled || false);
|
|
3113
3113
|
Toast(e5, {
|
|
3114
3114
|
get index() {
|
|
3115
3115
|
return get$1(s3);
|
|
@@ -3127,7 +3127,7 @@ function Toaster(e2, t2) {
|
|
|
3127
3127
|
return y2();
|
|
3128
3128
|
},
|
|
3129
3129
|
get interacting() {
|
|
3130
|
-
return get$1(
|
|
3130
|
+
return get$1(T2);
|
|
3131
3131
|
},
|
|
3132
3132
|
get position() {
|
|
3133
3133
|
return get$1(o4);
|
|
@@ -3136,7 +3136,7 @@ function Toaster(e2, t2) {
|
|
|
3136
3136
|
return h2();
|
|
3137
3137
|
},
|
|
3138
3138
|
get expanded() {
|
|
3139
|
-
return get$1(
|
|
3139
|
+
return get$1(M2);
|
|
3140
3140
|
},
|
|
3141
3141
|
get actionButtonStyle() {
|
|
3142
3142
|
return get$1(a4);
|
|
@@ -3157,7 +3157,7 @@ function Toaster(e2, t2) {
|
|
|
3157
3157
|
return get$1(p3);
|
|
3158
3158
|
},
|
|
3159
3159
|
get unstyled() {
|
|
3160
|
-
return get$1(
|
|
3160
|
+
return get$1(g3);
|
|
3161
3161
|
},
|
|
3162
3162
|
$$slots: {
|
|
3163
3163
|
"loading-icon": (e6, s4) => {
|
|
@@ -3205,36 +3205,36 @@ function Toaster(e2, t2) {
|
|
|
3205
3205
|
}
|
|
3206
3206
|
}
|
|
3207
3207
|
});
|
|
3208
|
-
}), bind_this(c3, (e5) => set(
|
|
3208
|
+
}), bind_this(c3, (e5) => set(q2, e5), () => get$1(q2)), template_effect((e5, t3, o5) => {
|
|
3209
3209
|
var _a2;
|
|
3210
3210
|
u3 = set_attributes(c3, u3, {
|
|
3211
3211
|
tabIndex: -1,
|
|
3212
3212
|
class: n2.class,
|
|
3213
3213
|
"data-sonner-toaster": true,
|
|
3214
|
-
"data-theme": get$1(
|
|
3214
|
+
"data-theme": get$1(I2),
|
|
3215
3215
|
"data-rich-colors": v2(),
|
|
3216
3216
|
dir: e5,
|
|
3217
3217
|
"data-y-position": t3,
|
|
3218
3218
|
"data-x-position": o5,
|
|
3219
3219
|
style: n2.style,
|
|
3220
3220
|
...s2,
|
|
3221
|
-
[
|
|
3221
|
+
[_e]: {
|
|
3222
3222
|
"--front-toast-height": `${(_a2 = store_get(C2, "$heights", i2)[0]) == null ? void 0 : _a2.height}px`,
|
|
3223
3223
|
"--offset": "number" == typeof w2() ? `${w2()}px` : w2() || "32px",
|
|
3224
3224
|
"--width": "356px",
|
|
3225
3225
|
"--gap": "14px"
|
|
3226
3226
|
}
|
|
3227
3227
|
}, "svelte-1fo5d1m"), c3.dir = c3.dir;
|
|
3228
|
-
}, [() => "auto" === x2() ? getDocumentDirection() : x2(), () => get$1(o4).split("-")[0], () => get$1(o4).split("-")[1]], derived_safe_equal), event("blur", c3, handleBlur), event("focus", c3, handleFocus), event("mouseenter", c3, () => set(
|
|
3229
|
-
get$1(
|
|
3230
|
-
}), event("pointerdown", c3, () => set(
|
|
3231
|
-
}), template_effect(() => set_attribute(o3, "aria-label", `${
|
|
3228
|
+
}, [() => "auto" === x2() ? getDocumentDirection() : x2(), () => get$1(o4).split("-")[0], () => get$1(o4).split("-")[1]], derived_safe_equal), event("blur", c3, handleBlur), event("focus", c3, handleFocus), event("mouseenter", c3, () => set(M2, true)), event("mousemove", c3, () => set(M2, true)), event("mouseleave", c3, () => {
|
|
3229
|
+
get$1(T2) || set(M2, false);
|
|
3230
|
+
}), event("pointerdown", c3, () => set(T2, true)), event("pointerup", c3, () => set(T2, false)), append(e4, c3);
|
|
3231
|
+
}), template_effect(() => set_attribute(o3, "aria-label", `${_2()} ${get$1(l2)}`)), append(e3, o3);
|
|
3232
3232
|
};
|
|
3233
|
-
if_block(
|
|
3233
|
+
if_block(j2, (e3) => {
|
|
3234
3234
|
$toasts().length > 0 && e3(consequent);
|
|
3235
3235
|
}), append(e2, z2), pop(), o2();
|
|
3236
3236
|
}
|
|
3237
|
-
const
|
|
3237
|
+
const Qe = new (_b = class {
|
|
3238
3238
|
constructor() {
|
|
3239
3239
|
__privateAdd(this, _PlayLightAPI_instances);
|
|
3240
3240
|
this.baseUrl = "https://api.playlight.dev/platform", this.cachedCategories = null, this.currentGame = null;
|
|
@@ -3260,7 +3260,7 @@ const Xe = new (_b = class {
|
|
|
3260
3260
|
}
|
|
3261
3261
|
return await s2.json();
|
|
3262
3262
|
} catch (e3) {
|
|
3263
|
-
|
|
3263
|
+
Ge.error("Error: " + e3), console.error("Playlight API error:", e3);
|
|
3264
3264
|
}
|
|
3265
3265
|
}
|
|
3266
3266
|
// Get all categories
|
|
@@ -3314,14 +3314,26 @@ const Xe = new (_b = class {
|
|
|
3314
3314
|
const e2 = window.location.hostname;
|
|
3315
3315
|
return e2.startsWith("www.") ? e2.substring(4) : e2;
|
|
3316
3316
|
}, _b)();
|
|
3317
|
+
var et = /* @__PURE__ */ template('<div><p class="font-bold text-white uppercase"> </p></div>');
|
|
3318
|
+
function GameBadge(e2, t2) {
|
|
3319
|
+
let n2 = prop(t2, "isHovered", 3, false);
|
|
3320
|
+
var s2 = et();
|
|
3321
|
+
let i2;
|
|
3322
|
+
var o2 = child(s2), a2 = child(o2);
|
|
3323
|
+
template_effect((e3) => {
|
|
3324
|
+
i2 = set_class(s2, 1, "bg-background absolute top-4 right-4 z-12 px-2 py-0.5 transition-opacity select-none", null, i2, e3), set_text(a2, t2.text);
|
|
3325
|
+
}, [() => ({
|
|
3326
|
+
"opacity-0": n2()
|
|
3327
|
+
})]), append(e2, s2);
|
|
3328
|
+
}
|
|
3317
3329
|
var on_click$3 = (e2, t2, n2, s2, i2) => {
|
|
3318
|
-
!get$1(t2) || get$1(n2) ? (
|
|
3319
|
-
},
|
|
3330
|
+
!get$1(t2) || get$1(n2) ? (Qe.trackClick(i2.game.id), window.open("https://" + i2.game.domain + "?utm_source=playlight", "_blank", "noopener")) : s2();
|
|
3331
|
+
}, tt = /* @__PURE__ */ template('<video playsinline="" loop preload="auto"></video>', 2), nt = /* @__PURE__ */ template('<div class="bg-background/25 text-muted-foreground z-12 flex items-center justify-center gap-1 border-t p-1 px-2 text-sm"><!> <p class="text-muted-foreground text-sm">Tap again to open</p></div>'), rt = /* @__PURE__ */ template('<div class="bg-background/75 absolute right-0 bottom-0 left-0 z-11 flex max-h-1/3 flex-col overflow-hidden text-white backdrop-blur-xl"><div class="h-full w-full overflow-y-auto p-3"><h3 class="mb-2 truncate text-center text-lg font-bold"> </h3> <p class="text-muted-foreground mb-4 text-center text-sm text-balance"> </p></div> <!> <div></div></div>'), st = /* @__PURE__ */ template('<div role="button" tabindex="0"><!> <!> <img alt="cover" loading="eager"> <!> <img alt="game logo" loading="eager"></div>');
|
|
3320
3332
|
function GameCard(e2, t2) {
|
|
3321
3333
|
push(t2, true);
|
|
3322
3334
|
const [n2, s2] = setup_stores();
|
|
3323
|
-
let i2, o2 = prop(t2, "compact", 3, false), a2 = state(false), l2 = state(false), c2 = state(void 0), u2 = state(false), d2 = state(false), f2 = state(false), p2 = state(false),
|
|
3324
|
-
function
|
|
3335
|
+
let i2, o2 = prop(t2, "compact", 3, false), a2 = state(false), l2 = state(false), c2 = state(void 0), u2 = state(false), d2 = state(false), f2 = state(false), p2 = state(false), g2 = state(void 0);
|
|
3336
|
+
function handleHover() {
|
|
3325
3337
|
get$1(a2) || get$1(p2) || function playSound(e3, t3 = 1) {
|
|
3326
3338
|
try {
|
|
3327
3339
|
const n3 = new Audio(e3);
|
|
@@ -3329,37 +3341,45 @@ function GameCard(e2, t2) {
|
|
|
3329
3341
|
} catch (e4) {
|
|
3330
3342
|
console.error("Error playing sound:", e4);
|
|
3331
3343
|
}
|
|
3332
|
-
}(store_get(
|
|
3333
|
-
}
|
|
3334
|
-
function handleMouseLeave() {
|
|
3335
|
-
get$1(p2) || (get$1(c2) && get$1(u2) && get$1(c2).pause(), setUnhovered());
|
|
3344
|
+
}(store_get(qe, "$projectUrl", n2) + "/static/sounds/hover-selection.ogg", 0.25), set(a2, true), clearTimeout(i2), i2 = setTimeout(() => set(l2, true), 300), get$1(c2) && t2.game.cover_video_url && get$1(c2).play().catch((e3) => console.error("Video play error:", e3));
|
|
3336
3345
|
}
|
|
3337
|
-
function
|
|
3338
|
-
set(a2, false), clearTimeout(i2), set(l2, false);
|
|
3346
|
+
function handleUnhover() {
|
|
3347
|
+
get$1(c2) && get$1(u2) && get$1(c2).pause(), set(a2, false), clearTimeout(i2), set(l2, false);
|
|
3339
3348
|
}
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3349
|
+
var _2 = st();
|
|
3350
|
+
event("touchstart", W, (e3) => {
|
|
3351
|
+
get$1(g2) && !get$1(g2).contains(e3.target) && handleUnhover();
|
|
3352
|
+
}, void 0, true), event("pointerdown", W, (e3) => set(p2, "touch" === e3.pointerType)), event("pointermove", W, (e3) => set(p2, "touch" === e3.pointerType)), _2.__click = [on_click$3, p2, l2, handleHover, t2];
|
|
3353
|
+
var v2 = child(_2), consequent = (e3) => {
|
|
3354
|
+
GameBadge(e3, {
|
|
3355
|
+
get isHovered() {
|
|
3356
|
+
return get$1(a2);
|
|
3357
|
+
},
|
|
3358
|
+
text: "Featured"
|
|
3359
|
+
});
|
|
3360
|
+
}, alternate = (e3, n3) => {
|
|
3361
|
+
var consequent_1 = (e4) => {
|
|
3362
|
+
GameBadge(e4, {
|
|
3363
|
+
get isHovered() {
|
|
3364
|
+
return get$1(a2);
|
|
3365
|
+
},
|
|
3366
|
+
text: "New"
|
|
3367
|
+
});
|
|
3368
|
+
};
|
|
3369
|
+
if_block(e3, (e4) => {
|
|
3370
|
+
var _a2;
|
|
3371
|
+
(function isNewGame(e5) {
|
|
3372
|
+
const t3 = /* @__PURE__ */ new Date();
|
|
3373
|
+
return t3.setDate(t3.getDate() - 7), new Date(e5) > t3;
|
|
3374
|
+
})((_a2 = t2.game) == null ? void 0 : _a2.created_at) && e4(consequent_1);
|
|
3375
|
+
}, n3);
|
|
3353
3376
|
};
|
|
3354
3377
|
if_block(v2, (e3) => {
|
|
3355
3378
|
var _a2;
|
|
3356
|
-
(
|
|
3357
|
-
const t3 = /* @__PURE__ */ new Date();
|
|
3358
|
-
return t3.setDate(t3.getDate() - 7), new Date(e4) > t3;
|
|
3359
|
-
})((_a2 = t2.game) == null ? void 0 : _a2.created_at) && e3(consequent);
|
|
3379
|
+
((_a2 = t2.game) == null ? void 0 : _a2.featured) ? e3(consequent) : e3(alternate, false);
|
|
3360
3380
|
});
|
|
3361
|
-
var h2 = sibling(v2, 2),
|
|
3362
|
-
var n3 =
|
|
3381
|
+
var h2 = sibling(v2, 2), consequent_2 = (e3) => {
|
|
3382
|
+
var n3 = tt();
|
|
3363
3383
|
let s3;
|
|
3364
3384
|
n3.muted = true, bind_this(n3, (e4) => set(c2, e4), () => get$1(c2)), template_effect((e4) => {
|
|
3365
3385
|
set_attribute(n3, "src", t2.game.cover_video_url), s3 = set_class(n3, 1, "absolute top-0 left-0 z-5 h-full w-full object-cover opacity-0", null, s3, e4);
|
|
@@ -3370,13 +3390,13 @@ function GameCard(e2, t2) {
|
|
|
3370
3390
|
}), append(e3, n3);
|
|
3371
3391
|
};
|
|
3372
3392
|
if_block(h2, (e3) => {
|
|
3373
|
-
t2.game.cover_video_url && e3(
|
|
3393
|
+
t2.game.cover_video_url && e3(consequent_2);
|
|
3374
3394
|
});
|
|
3375
3395
|
var m2 = sibling(h2, 2);
|
|
3376
3396
|
let b2;
|
|
3377
|
-
var y2 = sibling(m2, 2),
|
|
3378
|
-
var n3 =
|
|
3379
|
-
var t3 =
|
|
3397
|
+
var y2 = sibling(m2, 2), consequent_4 = (e3) => {
|
|
3398
|
+
var n3 = rt(), s3 = child(n3), i3 = child(s3), o3 = child(i3), a3 = child(sibling(i3, 2)), l3 = sibling(s3, 2), consequent_3 = (e4) => {
|
|
3399
|
+
var t3 = nt();
|
|
3380
3400
|
!function Info(e5, t4) {
|
|
3381
3401
|
const n4 = legacy_rest_props(t4, ["children", "$$slots", "$$events", "$$legacy"]);
|
|
3382
3402
|
Icon$1(e5, spread_props({
|
|
@@ -3404,7 +3424,7 @@ function GameCard(e2, t2) {
|
|
|
3404
3424
|
}), append(e4, t3);
|
|
3405
3425
|
};
|
|
3406
3426
|
if_block(l3, (e4) => {
|
|
3407
|
-
get$1(p2) && e4(
|
|
3427
|
+
get$1(p2) && e4(consequent_3);
|
|
3408
3428
|
});
|
|
3409
3429
|
var c3 = sibling(l3, 2);
|
|
3410
3430
|
template_effect(() => {
|
|
@@ -3412,21 +3432,21 @@ function GameCard(e2, t2) {
|
|
|
3412
3432
|
}), transition(3, n3, () => slide), append(e3, n3);
|
|
3413
3433
|
};
|
|
3414
3434
|
if_block(y2, (e3) => {
|
|
3415
|
-
get$1(a2) && e3(
|
|
3435
|
+
get$1(a2) && e3(consequent_4);
|
|
3416
3436
|
});
|
|
3417
3437
|
var $2 = sibling(y2, 2);
|
|
3418
3438
|
let w2;
|
|
3419
|
-
bind_this(
|
|
3420
|
-
set_class(
|
|
3439
|
+
bind_this(_2, (e3) => set(g2, e3), () => get$1(g2)), template_effect((e3, n3) => {
|
|
3440
|
+
set_class(_2, 1, `bg-background highlight-border group relative mt-5 mb-[calc(3dvh+1.5vw)] flex aspect-[2/3] h-1/2 max-h-[75vh] cursor-pointer flex-col shadow-xl transition hover:outline-2 lg:h-3/7 ${(get$1(d2) ? "" : "animate-pulse") ?? ""} ${(o2() ? "min-h-62" : "min-h-92") ?? ""}`, "svelte-o63m4o"), set_attribute(m2, "src", t2.game.cover_image_url), b2 = set_class(m2, 1, "prevent-image-select absolute top-0 left-0 z-10 h-full w-full object-cover opacity-0 transition svelte-o63m4o", null, b2, e3), set_attribute($2, "src", t2.game.logo_url), w2 = set_class($2, 1, "prevent-image-select absolute right-0 -bottom-[18%] left-0 z-10 mx-auto aspect-square w-1/5 rounded-full object-center opacity-0 shadow-xl transition group-hover:outline-2 svelte-o63m4o", null, w2, n3);
|
|
3421
3441
|
}, [() => ({
|
|
3422
3442
|
"opacity-100": get$1(d2) && (!get$1(a2) || !get$1(u2) || !t2.game.cover_video_url)
|
|
3423
3443
|
}), () => ({
|
|
3424
3444
|
"opacity-100": get$1(f2)
|
|
3425
|
-
})]), event("mouseenter",
|
|
3445
|
+
})]), event("mouseenter", _2, handleHover), event("mouseleave", _2, handleUnhover), event("load", m2, () => {
|
|
3426
3446
|
set(d2, true);
|
|
3427
3447
|
}), event("load", $2, () => {
|
|
3428
3448
|
set(f2, true);
|
|
3429
|
-
}), append(e2,
|
|
3449
|
+
}), append(e2, _2), pop(), s2();
|
|
3430
3450
|
}
|
|
3431
3451
|
function backInOut(e2) {
|
|
3432
3452
|
const t2 = 2.5949095;
|
|
@@ -3458,7 +3478,7 @@ function flip(e2, { from: t2, to: n2 }, s2 = {}) {
|
|
|
3458
3478
|
t3.parentElement;
|
|
3459
3479
|
return n3;
|
|
3460
3480
|
}(e2)
|
|
3461
|
-
), p2 = e2.clientWidth / n2.width / f2,
|
|
3481
|
+
), p2 = e2.clientWidth / n2.width / f2, g2 = e2.clientHeight / n2.height / f2, _2 = t2.left + t2.width * u2, v2 = t2.top + t2.height * d2, h2 = n2.left + n2.width * u2, m2 = n2.top + n2.height * d2, b2 = (_2 - h2) * p2, y2 = (v2 - m2) * g2, $2 = t2.width / n2.width, w2 = t2.height / n2.height;
|
|
3462
3482
|
return {
|
|
3463
3483
|
delay: i2,
|
|
3464
3484
|
duration: "function" == typeof o2 ? o2(Math.sqrt(b2 * b2 + y2 * y2)) : o2,
|
|
@@ -3469,10 +3489,10 @@ function flip(e2, { from: t2, to: n2 }, s2 = {}) {
|
|
|
3469
3489
|
delegate(["click"]);
|
|
3470
3490
|
var on_click$2 = (e2, t2, n2) => {
|
|
3471
3491
|
set(t2, ""), set(n2, !get$1(n2));
|
|
3472
|
-
},
|
|
3492
|
+
}, it = /* @__PURE__ */ template('<div class="text-muted-foreground animate-pulse p-4 text-center">Loading...</div>'), ot = /* @__PURE__ */ template('<div class="text-muted-foreground p-4 text-center">No categories found.</div>'), on_click_1$1 = (e2, t2, n2, s2, i2) => {
|
|
3473
3493
|
var _a2;
|
|
3474
3494
|
t2(n2), set(s2, false), (_a2 = i2.onCategoryChange) == null ? void 0 : _a2.call(i2);
|
|
3475
|
-
},
|
|
3495
|
+
}, at = /* @__PURE__ */ template("<button> </button>"), lt = /* @__PURE__ */ template('<div class="space-y-1 p-1"></div>'), ct = /* @__PURE__ */ template('<div class="bg-background/85 fixed left-1/2 z-50 mt-22 w-30 w-full max-w-xs -translate-x-1/2 transform border shadow-lg backdrop-blur-xl"><div class="border-b p-3"><div class="relative"><div class="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-1"><!></div> <input type="text" placeholder="Search categories..." class="w-full border-0 p-1 pl-10 text-white focus:ring-0 focus:outline-none"></div></div> <div class="max-h-60 overflow-y-auto"><!></div></div>'), ut = /* @__PURE__ */ template('<div class="flex w-full flex-col"><h1 class="mb-0! text-center text-2xl font-bold text-white drop-shadow-xl sm:text-4xl"><span> </span> <button class="group mx-1 inline-flex cursor-pointer items-center bg-white px-3 py-1 text-black transition hover:rotate-5"><span class="max-w-[40vw] truncate text-2xl font-bold text-black sm:text-4xl"> </span> <!></button> <span>games?</span></h1> <!></div>');
|
|
3476
3496
|
function Navigation(e2, t2) {
|
|
3477
3497
|
push(t2, true);
|
|
3478
3498
|
let n2, s2 = prop(t2, "categories", 19, () => []), i2 = prop(t2, "selectedCategory", 15), o2 = state(false), a2 = user_derived(() => i2() || (s2().length > 0 ? s2()[0] : "...")), l2 = state(""), c2 = state(void 0), u2 = user_derived(() => get$1(l2) ? s2().filter((e3) => e3.toLowerCase().includes(get$1(l2).toLowerCase())) : s2());
|
|
@@ -3481,12 +3501,12 @@ function Navigation(e2, t2) {
|
|
|
3481
3501
|
onMount(() => {
|
|
3482
3502
|
set(f2, d2[Math.floor(Math.random() * (d2 == null ? void 0 : d2.length))], true);
|
|
3483
3503
|
});
|
|
3484
|
-
var p2 =
|
|
3504
|
+
var p2 = ut();
|
|
3485
3505
|
event("click", W, (e3) => {
|
|
3486
3506
|
var _a2;
|
|
3487
3507
|
!get$1(c2) || ((_a2 = get$1(c2)) == null ? void 0 : _a2.contains(e3.target)) || (n2 == null ? void 0 : n2.contains(e3.target)) || set(o2, false);
|
|
3488
3508
|
});
|
|
3489
|
-
var
|
|
3509
|
+
var g2 = child(p2), _2 = child(g2), v2 = child(_2), h2 = sibling(_2, 2);
|
|
3490
3510
|
h2.__click = [on_click$2, l2, o2];
|
|
3491
3511
|
var m2 = child(h2), b2 = child(m2), y2 = sibling(m2, 2);
|
|
3492
3512
|
const $2 = user_derived(() => get$1(o2) ? "rotate-180 transform" : "");
|
|
@@ -3513,8 +3533,8 @@ function Navigation(e2, t2) {
|
|
|
3513
3533
|
return `mt-1 ml-1 text-black ${get$1($2) ?? ""} transition-transform duration-200`;
|
|
3514
3534
|
}
|
|
3515
3535
|
}), bind_this(h2, (e3) => n2 = e3, () => n2);
|
|
3516
|
-
var w2 = sibling(
|
|
3517
|
-
var n3 =
|
|
3536
|
+
var w2 = sibling(g2, 2), consequent_2 = (e3) => {
|
|
3537
|
+
var n3 = ct(), a3 = child(n3), d3 = child(a3), f3 = child(d3);
|
|
3518
3538
|
!function Search(e4, t3) {
|
|
3519
3539
|
const n4 = legacy_rest_props(t3, ["children", "$$slots", "$$events", "$$legacy"]);
|
|
3520
3540
|
Icon$1(e4, spread_props({
|
|
@@ -3540,15 +3560,15 @@ function Navigation(e2, t2) {
|
|
|
3540
3560
|
strokeWidth: 2.5,
|
|
3541
3561
|
class: "text-muted-foreground"
|
|
3542
3562
|
});
|
|
3543
|
-
var p3 = sibling(f3, 2),
|
|
3544
|
-
append(e4,
|
|
3563
|
+
var p3 = sibling(f3, 2), g3 = child(sibling(a3, 2)), consequent = (e4) => {
|
|
3564
|
+
append(e4, it());
|
|
3545
3565
|
}, alternate = (e4, n4) => {
|
|
3546
3566
|
var consequent_1 = (e5) => {
|
|
3547
|
-
append(e5,
|
|
3567
|
+
append(e5, ot());
|
|
3548
3568
|
}, alternate_1 = (e5) => {
|
|
3549
|
-
var n5 =
|
|
3569
|
+
var n5 = lt();
|
|
3550
3570
|
each(n5, 28, () => get$1(u2), (e6) => e6, (e6, n6) => {
|
|
3551
|
-
var s3 =
|
|
3571
|
+
var s3 = at();
|
|
3552
3572
|
s3.__click = [on_click_1$1, i2, n6, o2, t2];
|
|
3553
3573
|
var a4 = child(s3);
|
|
3554
3574
|
template_effect(() => {
|
|
@@ -3619,7 +3639,7 @@ function Navigation(e2, t2) {
|
|
|
3619
3639
|
0 === get$1(u2).length ? e5(consequent_1) : e5(alternate_1, false);
|
|
3620
3640
|
}, n4);
|
|
3621
3641
|
};
|
|
3622
|
-
if_block(
|
|
3642
|
+
if_block(g3, (e4) => {
|
|
3623
3643
|
0 === s2().length ? e4(consequent) : e4(alternate, false);
|
|
3624
3644
|
}), bind_this(n3, (e4) => set(c2, e4), () => get$1(c2)), function bind_value(e4, t3, n4 = t3) {
|
|
3625
3645
|
var s3 = is_runes();
|
|
@@ -3657,7 +3677,7 @@ function Navigation(e2, t2) {
|
|
|
3657
3677
|
})), append(e2, p2), pop();
|
|
3658
3678
|
}
|
|
3659
3679
|
delegate(["click"]);
|
|
3660
|
-
var
|
|
3680
|
+
var dt = /* @__PURE__ */ template('<div class="-mx-10 mt-5 flex h-1/2 max-h-[75vh] min-h-92 w-10 flex-col lg:h-3/7"><div class="flex h-full items-center justify-center"><div class="flex h-full w-full flex-col items-center justify-between py-6"><div class="bg-muted-foreground min-[1920px]:h-1/4 h-1/5 w-px"></div> <div class="text-muted-foreground origin-center -rotate-90 transform text-sm whitespace-nowrap select-none">From other categories</div> <div class="bg-muted-foreground h-1/5 w-px min-[1920px]:h-1/4"></div></div></div></div>');
|
|
3661
3681
|
function restore(e2, t2, n2, s2, i2, o2) {
|
|
3662
3682
|
set(t2, false), set(n2, true), set(s2, 250), set(i2, 0), o2(250, 0, 250, (e3, t3, n3) => {
|
|
3663
3683
|
set(s2, e3 * (1 - n3)), set(i2, n3, true);
|
|
@@ -3667,31 +3687,33 @@ async function toggleLike(e2, t2, n2, s2) {
|
|
|
3667
3687
|
var _a2;
|
|
3668
3688
|
if (!((_a2 = t2.currentGame) == null ? void 0 : _a2.id)) return;
|
|
3669
3689
|
const i2 = !get$1(n2);
|
|
3670
|
-
|
|
3690
|
+
store_set(Oe, i2), set(n2, !get$1(n2)), // Toggle liked state
|
|
3691
|
+
// Save to localStorage
|
|
3671
3692
|
i2 ? localStorage.setItem(`playlight_${t2.currentGame.id}_liked`, "true") : localStorage.removeItem(`playlight_${t2.currentGame.id}_liked`);
|
|
3672
|
-
await
|
|
3693
|
+
await Qe.toggleLike(t2.currentGame.id, i2) || store_set(Oe, !i2);
|
|
3673
3694
|
}
|
|
3674
|
-
var
|
|
3695
|
+
var ft = /* @__PURE__ */ template('<div class="bg-background/85 fixed bottom-4 left-4 z-2 flex touch-none flex-wrap items-center gap-1 border-1 p-4 text-start shadow-lg backdrop-blur-xl max-sm:right-4 sm:w-72" role="button" tabindex="0"><div class="w-full"><p class="text-muted-foreground text-sm select-none">Currently playing</p></div> <div class="flex w-full items-center gap-2"><img alt="logo"> <p class="max-w-2/3 truncate text-lg font-bold text-white"> </p> <div class="mt-0.5 ml-auto flex items-center gap-2"><p class="text-muted-foreground text-sm"> </p> <button class="text-muted-foreground cursor-pointer transition hover:text-white"><!></button></div></div></div>'), pt = /* @__PURE__ */ template('<div class="fixed bottom-0 z-3 shadow-xl max-sm:right-4 max-sm:left-4 sm:left-4 sm:w-72"><button class="bg-background/85 hover:bg-background/95 w-full rounded-t-md border px-4 py-1.5 backdrop-blur-sm transition" aria-label="Show game display"><div class="bg-muted-foreground mx-auto h-px w-16"></div></button></div>'), gt = /* @__PURE__ */ template("<!> <!>", 1);
|
|
3675
3696
|
function CurrentGameDisplay(e2, t2) {
|
|
3676
3697
|
var _a2;
|
|
3677
3698
|
push(t2, true);
|
|
3678
|
-
|
|
3699
|
+
const [n2, s2] = setup_stores(), $likedInThisSession = () => store_get(Oe, "$likedInThisSession", n2);
|
|
3700
|
+
let i2 = state(false), o2 = state(true), a2 = state(false), l2 = state(0), c2 = state(1), u2 = state(false), d2 = state(false), f2 = state(proxy(((_a2 = t2.currentGame) == null ? void 0 : _a2.likes) || 0)), p2 = 0;
|
|
3679
3701
|
function startDrag(e3) {
|
|
3680
|
-
set(
|
|
3702
|
+
set(u2, true), p2 = e3.type.includes("touch") ? e3.touches[0].clientY : e3.clientY;
|
|
3681
3703
|
}
|
|
3682
3704
|
function drag(e3) {
|
|
3683
|
-
if (!get$1(
|
|
3684
|
-
const t3 = e3.type.includes("touch") ? e3.touches[0].clientY : e3.clientY, n3 = Math.max(0, t3 -
|
|
3685
|
-
set(
|
|
3686
|
-
set(
|
|
3687
|
-
set(
|
|
3705
|
+
if (!get$1(u2)) return;
|
|
3706
|
+
const t3 = e3.type.includes("touch") ? e3.touches[0].clientY : e3.clientY, n3 = Math.max(0, t3 - p2);
|
|
3707
|
+
set(l2, n3, true), set(c2, Math.max(0, 1 - n3 / 150), true), n3 > 40 && function hide() {
|
|
3708
|
+
set(u2, false), animate2(get$1(l2), 250, 250, (e4, t4, n4) => {
|
|
3709
|
+
set(l2, e4 + (t4 - e4) * n4), set(c2, Math.max(0, 1 - 1.5 * n4), true), 1 === n4 && (set(o2, false), set(a2, true));
|
|
3688
3710
|
});
|
|
3689
3711
|
}();
|
|
3690
3712
|
}
|
|
3691
3713
|
function endDrag() {
|
|
3692
|
-
get$1(
|
|
3693
|
-
animate2(get$1(
|
|
3694
|
-
set(
|
|
3714
|
+
get$1(u2) && (set(u2, false), get$1(l2) < 40 && function animateBack() {
|
|
3715
|
+
animate2(get$1(l2), 0, 250, (e3, t3, n3) => {
|
|
3716
|
+
set(l2, e3 * (1 - n3)), set(c2, 1);
|
|
3695
3717
|
});
|
|
3696
3718
|
}());
|
|
3697
3719
|
}
|
|
@@ -3704,28 +3726,28 @@ function CurrentGameDisplay(e2, t2) {
|
|
|
3704
3726
|
}
|
|
3705
3727
|
user_effect(() => {
|
|
3706
3728
|
var _a3, _b2;
|
|
3707
|
-
((_a3 = t2.currentGame) == null ? void 0 : _a3.id) && (set(
|
|
3729
|
+
null != ((_a3 = t2.currentGame) == null ? void 0 : _a3.id) && (set(d2, null !== localStorage.getItem(`playlight_${t2.currentGame.id}_liked`)), set(f2, ((_b2 = t2.currentGame) == null ? void 0 : _b2.likes) || 0, true));
|
|
3708
3730
|
});
|
|
3709
|
-
var
|
|
3710
|
-
var
|
|
3711
|
-
|
|
3712
|
-
var
|
|
3713
|
-
let
|
|
3714
|
-
var
|
|
3715
|
-
|
|
3716
|
-
var h2 = child(
|
|
3717
|
-
const m2 = user_derived(() => get$1(
|
|
3731
|
+
var g2 = gt(), _2 = first_child(g2), consequent = (e3) => {
|
|
3732
|
+
var n3 = ft();
|
|
3733
|
+
n3.__mousedown = startDrag, n3.__mousemove = drag, n3.__mouseup = endDrag, n3.__touchstart = startDrag, n3.__touchmove = drag, n3.__touchend = endDrag;
|
|
3734
|
+
var s3 = sibling(child(n3), 2), o3 = child(s3);
|
|
3735
|
+
let a3;
|
|
3736
|
+
var u3 = sibling(o3, 2), p3 = child(u3), g3 = child(sibling(u3, 2)), _3 = child(g3), v3 = sibling(g3, 2);
|
|
3737
|
+
v3.__click = [toggleLike, t2, d2, $likedInThisSession];
|
|
3738
|
+
var h2 = child(v3);
|
|
3739
|
+
const m2 = user_derived(() => get$1(d2) ? "currentColor" : "none");
|
|
3718
3740
|
!function Thumbs_up(e4, t3) {
|
|
3719
|
-
const
|
|
3741
|
+
const n4 = legacy_rest_props(t3, ["children", "$$slots", "$$events", "$$legacy"]);
|
|
3720
3742
|
Icon$1(e4, spread_props({
|
|
3721
3743
|
name: "thumbs-up"
|
|
3722
|
-
}, () =>
|
|
3744
|
+
}, () => n4, {
|
|
3723
3745
|
iconNode: [["path", {
|
|
3724
3746
|
d: "M7 10v12"
|
|
3725
3747
|
}], ["path", {
|
|
3726
3748
|
d: "M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"
|
|
3727
3749
|
}]],
|
|
3728
|
-
children: (e5,
|
|
3750
|
+
children: (e5, n5) => {
|
|
3729
3751
|
var s4 = comment();
|
|
3730
3752
|
slot(first_child(s4), t3, "default", {}, null), append(e5, s4);
|
|
3731
3753
|
},
|
|
@@ -3742,46 +3764,50 @@ function CurrentGameDisplay(e2, t2) {
|
|
|
3742
3764
|
style: "margin-top: -5px;"
|
|
3743
3765
|
}), template_effect((e4) => {
|
|
3744
3766
|
var _a3, _b2;
|
|
3745
|
-
set_style(
|
|
3767
|
+
set_style(n3, `transform: translateY(${get$1(l2) ?? ""}px); opacity: ${get$1(c2) ?? ""}; cursor: grab;`), set_attribute(o3, "src", (_a3 = t2.currentGame) == null ? void 0 : _a3.logo_url), a3 = set_class(o3, 1, "bg-muted h-5 w-5 select-none", null, a3, e4), set_text(p3, ((_b2 = t2.currentGame) == null ? void 0 : _b2.name) || "Default name"), set_text(_3, $likedInThisSession() ? get$1(f2) + 1 : get$1(f2)), set_style(v3, `color: ${(get$1(d2) ? "white !important" : "") ?? ""};`), set_attribute(v3, "aria-label", get$1(d2) ? "Unlike game" : "Like game");
|
|
3746
3768
|
}, [() => ({
|
|
3747
|
-
"animate-pulse": !get$1(
|
|
3748
|
-
})]), event("mouseleave",
|
|
3749
|
-
set(
|
|
3750
|
-
}), append(e3,
|
|
3769
|
+
"animate-pulse": !get$1(i2)
|
|
3770
|
+
})]), event("mouseleave", n3, endDrag), event("load", o3, () => {
|
|
3771
|
+
set(i2, true);
|
|
3772
|
+
}), append(e3, n3);
|
|
3751
3773
|
};
|
|
3752
|
-
if_block(
|
|
3753
|
-
t2.currentGame && get$1(
|
|
3774
|
+
if_block(_2, (e3) => {
|
|
3775
|
+
t2.currentGame && get$1(o2) && e3(consequent);
|
|
3754
3776
|
});
|
|
3755
|
-
var
|
|
3756
|
-
var t3 =
|
|
3757
|
-
n3.__mousedown = [restore,
|
|
3777
|
+
var v2 = sibling(_2, 2), consequent_1 = (e3) => {
|
|
3778
|
+
var t3 = pt(), n3 = child(t3);
|
|
3779
|
+
n3.__mousedown = [restore, a2, o2, l2, c2, animate2], n3.__touchstart = [restore, a2, o2, l2, c2, animate2], transition(3, n3, () => fly, () => ({
|
|
3758
3780
|
delay: 150,
|
|
3759
3781
|
y: 30
|
|
3760
3782
|
})), append(e3, t3);
|
|
3761
3783
|
};
|
|
3762
|
-
if_block(
|
|
3763
|
-
t2.currentGame && get$1(
|
|
3764
|
-
}), append(e2,
|
|
3784
|
+
if_block(v2, (e3) => {
|
|
3785
|
+
t2.currentGame && get$1(a2) && e3(consequent_1);
|
|
3786
|
+
}), append(e2, g2), pop(), s2();
|
|
3765
3787
|
}
|
|
3766
3788
|
function closeDiscoveryOnEmptyClick(e2, t2) {
|
|
3767
|
-
e2.target === e2.currentTarget && store_set(
|
|
3789
|
+
e2.target === e2.currentTarget && store_set(Ie, false);
|
|
3768
3790
|
}
|
|
3769
3791
|
delegate(["mousedown", "mousemove", "mouseup", "touchstart", "touchmove", "touchend", "click"]);
|
|
3770
|
-
var on_click$1 = (e2, t2) => store_set(
|
|
3792
|
+
var on_click$1 = (e2, t2) => store_set(Ie, false), _t = /* @__PURE__ */ template('<div class="flex h-4/5 items-center justify-center gap-4"><!></div>'), vt = /* @__PURE__ */ template('<div class="pointer-events-none flex h-4/5 items-center justify-center gap-4"><p class="text-white">No games found that match the filter.</p></div>'), ht = /* @__PURE__ */ template("<!> <!>", 1), mt = /* @__PURE__ */ template('<div class="flex h-30 items-center"><!></div>'), bt = /* @__PURE__ */ template('<div class="mx-auto flex h-full flex-wrap content-start justify-center gap-10 lg:max-w-4/5"><!> <div class="flex min-h-10 w-full justify-center"><!></div></div>'), yt = /* @__PURE__ */ template('<div class="bg-background/75 fixed inset-0 top-0 right-0 bottom-0 left-0 z-99999 flex flex-col justify-center text-white backdrop-blur-md" id="playlight-discovery"><div class="pointer-events-none flex items-center justify-between p-4"><img alt="logo" class="pointer-events-none ml-3 w-50 max-sm:w-40"> <div class="mt-3.5 mr-4 flex items-center justify-evenly gap-8 overflow-hidden max-sm:mt-3"><button class="cursor-pointer text-white transition hover:opacity-50"><!></button></div></div> <div class="mx-auto px-6 max-sm:py-1 sm:pt-2 sm:pb-6"><!></div> <!> <div class="mask-fade show-scrollbar relative h-full w-full overflow-y-auto p-4 svelte-44gflq"><!></div> <a href="https://playlight.dev" target="_blank" class="text-muted-foreground fixed right-4 bottom-4 flex items-center gap-1 text-sm transition hover:text-white">Game dev? Join Playlight <!></a></div>');
|
|
3771
3793
|
function DiscoveryOverlay(e2, t2) {
|
|
3772
3794
|
push(t2, true);
|
|
3773
|
-
const [n2, s2] = setup_stores(), $discoveryOpen = () => store_get(
|
|
3774
|
-
let i2, o2 = state(true), a2 = state(false), l2 = state(void 0), c2 = state(proxy([])), u2 = state(void 0), d2 = state(proxy([])), f2 = state(1), p2 = state(true),
|
|
3795
|
+
const [n2, s2] = setup_stores(), $discoveryOpen = () => store_get(Ie, "$discoveryOpen", n2);
|
|
3796
|
+
let i2, o2 = state(true), a2 = state(false), l2 = state(void 0), c2 = state(proxy([])), u2 = state(void 0), d2 = state(proxy([])), f2 = state(1), p2 = state(true), g2 = state(false), _2 = state(void 0), v2 = state(void 0);
|
|
3775
3797
|
async function loadNewFeed() {
|
|
3776
|
-
|
|
3798
|
+
var _a2, _b2;
|
|
3799
|
+
set(d2, [], true), set(f2, 1), set(p2, true), set(g2, false), ((_a2 = get$1(l2)) == null ? void 0 : _a2.featured_game) && get$1(u2) == ((_b2 = get$1(l2)) == null ? void 0 : _b2.category) && get$1(d2).push({
|
|
3800
|
+
...get$1(l2).featured_game,
|
|
3801
|
+
featured: true
|
|
3802
|
+
}), await fetchGames();
|
|
3777
3803
|
}
|
|
3778
3804
|
async function fetchGames() {
|
|
3779
3805
|
if (get$1(o2) || get$1(a2)) return;
|
|
3780
3806
|
1 === get$1(f2) ? set(o2, true) : set(a2, true);
|
|
3781
|
-
const e3 = get$1(
|
|
3782
|
-
if (set(d2, [...get$1(d2), ...i3], true), n3.length < s3 ? !get$1(
|
|
3783
|
-
set(o2, false), set(a2, false), get$1(p2) && get$1(
|
|
3784
|
-
get$1(
|
|
3807
|
+
const e3 = get$1(g2) ? null : get$1(u2), t3 = await Qe.getSuggestions(e3, get$1(f2)), n3 = (t3 == null ? void 0 : t3.games) || [], s3 = (t3 == null ? void 0 : t3.pageSize) || 15, i3 = n3.filter((e4) => !get$1(d2).some((t4) => t4.id === e4.id));
|
|
3808
|
+
if (set(d2, [...get$1(d2), ...i3], true), n3.length < s3 ? !get$1(g2) && get$1(u2) ? (set(g2, true), set(f2, 1)) : set(p2, false) : set(f2, get$1(f2) + 1), // Disable loading state
|
|
3809
|
+
set(o2, false), set(a2, false), get$1(p2) && get$1(_2)) {
|
|
3810
|
+
get$1(_2).getBoundingClientRect().bottom <= window.innerHeight + 300 && fetchGames();
|
|
3785
3811
|
}
|
|
3786
3812
|
}
|
|
3787
3813
|
onMount(() => (i2 = new IntersectionObserver((e3) => {
|
|
@@ -3790,15 +3816,15 @@ function DiscoveryOverlay(e2, t2) {
|
|
|
3790
3816
|
rootMargin: "300px",
|
|
3791
3817
|
root: get$1(v2)
|
|
3792
3818
|
}), () => i2 == null ? void 0 : i2.disconnect())), user_effect(() => {
|
|
3793
|
-
get$1(
|
|
3819
|
+
get$1(_2) && i2 && i2.observe(get$1(_2));
|
|
3794
3820
|
}), onMount(async () => {
|
|
3795
3821
|
var _a2, _b2, _c2;
|
|
3796
|
-
set(l2, await
|
|
3822
|
+
set(l2, await Qe.getCurrentGameInfo(), true), set(c2, await Qe.getCategories(), true), set(u2, ((_a2 = get$1(l2)) == null ? void 0 : _a2.category) || ((_c2 = get$1(c2)) == null ? void 0 : _c2[((_b2 = get$1(c2)) == null ? void 0 : _b2.length) - 1]), true), set(o2, false), // Initial loading done, but loading will be set to true again by fetchGames
|
|
3797
3823
|
await loadNewFeed();
|
|
3798
3824
|
});
|
|
3799
|
-
var h2 =
|
|
3825
|
+
var h2 = yt();
|
|
3800
3826
|
event("keydown", W, (e3) => {
|
|
3801
|
-
"Escape" == e3.key && store_set(
|
|
3827
|
+
"Escape" == e3.key && store_set(Ie, false);
|
|
3802
3828
|
}), h2.__click = [closeDiscoveryOnEmptyClick, $discoveryOpen];
|
|
3803
3829
|
var m2 = child(h2), b2 = child(m2), y2 = child(sibling(b2, 2));
|
|
3804
3830
|
y2.__click = [on_click$1, $discoveryOpen], function X(e3, t3) {
|
|
@@ -3853,15 +3879,15 @@ function DiscoveryOverlay(e2, t2) {
|
|
|
3853
3879
|
}), append(e3, t3);
|
|
3854
3880
|
}, alternate = (e3, t3) => {
|
|
3855
3881
|
var consequent_1 = (e4) => {
|
|
3856
|
-
append(e4,
|
|
3882
|
+
append(e4, vt());
|
|
3857
3883
|
}, alternate_1 = (e4) => {
|
|
3858
|
-
var t4 =
|
|
3884
|
+
var t4 = bt(), n3 = child(t4);
|
|
3859
3885
|
each(n3, 17, () => get$1(d2), index, (e5, t5, n4) => {
|
|
3860
|
-
var s4 =
|
|
3861
|
-
const i4 = user_derived(() => get$1(d2).findIndex((e6) => e6.category !== get$1(u2)));
|
|
3886
|
+
var s4 = ht();
|
|
3887
|
+
const i4 = user_derived(() => get$1(d2).findIndex((e6) => e6.category !== get$1(u2) && !e6.featured));
|
|
3862
3888
|
var o3 = first_child(s4), consequent_2 = (e6) => {
|
|
3863
3889
|
!function GameCategorySeperator(e7) {
|
|
3864
|
-
append(e7,
|
|
3890
|
+
append(e7, dt());
|
|
3865
3891
|
}(e6);
|
|
3866
3892
|
};
|
|
3867
3893
|
if_block(o3, (e6) => {
|
|
@@ -3873,7 +3899,7 @@ function DiscoveryOverlay(e2, t2) {
|
|
|
3873
3899
|
}), append(e5, s4);
|
|
3874
3900
|
});
|
|
3875
3901
|
var s3 = sibling(n3, 2), i3 = child(s3), consequent_3 = (e5) => {
|
|
3876
|
-
var t5 =
|
|
3902
|
+
var t5 = mt();
|
|
3877
3903
|
Loader_circle(child(t5), {
|
|
3878
3904
|
class: "animate-spin opacity-75",
|
|
3879
3905
|
size: 40,
|
|
@@ -3882,7 +3908,7 @@ function DiscoveryOverlay(e2, t2) {
|
|
|
3882
3908
|
};
|
|
3883
3909
|
if_block(i3, (e5) => {
|
|
3884
3910
|
get$1(a2) && e5(consequent_3);
|
|
3885
|
-
}), bind_this(s3, (e5) => set(
|
|
3911
|
+
}), bind_this(s3, (e5) => set(_2, e5), () => get$1(_2)), append(e4, t4);
|
|
3886
3912
|
};
|
|
3887
3913
|
if_block(e3, (e4) => {
|
|
3888
3914
|
0 !== get$1(d2).length || get$1(o2) ? e4(alternate_1, false) : e4(consequent_1);
|
|
@@ -3914,14 +3940,14 @@ function DiscoveryOverlay(e2, t2) {
|
|
|
3914
3940
|
}));
|
|
3915
3941
|
}(sibling(child(C2)), {
|
|
3916
3942
|
size: 14
|
|
3917
|
-
}), template_effect(() => set_attribute(b2, "src", store_get(
|
|
3943
|
+
}), template_effect(() => set_attribute(b2, "src", store_get(qe, "$projectUrl", n2) + "/static/images/logo-white-small.png")), transition(3, h2, () => blur, () => ({
|
|
3918
3944
|
duration: 250
|
|
3919
3945
|
})), append(e2, h2), pop(), s2();
|
|
3920
3946
|
}
|
|
3921
3947
|
delegate(["click"]);
|
|
3922
|
-
var
|
|
3948
|
+
var $t = /* @__PURE__ */ template("<button><!></button>");
|
|
3923
3949
|
function Button(e2, t2) {
|
|
3924
|
-
var n2 =
|
|
3950
|
+
var n2 = $t();
|
|
3925
3951
|
n2.__click = function(...e3) {
|
|
3926
3952
|
var _a2;
|
|
3927
3953
|
(_a2 = t2.onclick) == null ? void 0 : _a2.apply(this, e3);
|
|
@@ -3933,10 +3959,12 @@ function Button(e2, t2) {
|
|
|
3933
3959
|
o2(i2, ...n3)
|
|
3934
3960
|
)));
|
|
3935
3961
|
}, w);
|
|
3936
|
-
}(child(n2), () => t2.children ?? noop), template_effect(() => set_class(n2, 1, `
|
|
3962
|
+
}(child(n2), () => t2.children ?? noop), template_effect(() => set_class(n2, 1, `hover:bg-background text-md inline-flex cursor-pointer items-center bg-white px-3 py-2 font-bold text-nowrap text-black uppercase transition hover:text-white ${t2.class ?? ""}`)), append(e2, n2);
|
|
3937
3963
|
}
|
|
3938
3964
|
delegate(["click"]);
|
|
3939
|
-
var
|
|
3965
|
+
var on_pointerover = (e2, t2) => {
|
|
3966
|
+
"touch" !== e2.pointerType && t2();
|
|
3967
|
+
}, wt = /* @__PURE__ */ template('<div class="fixed top-0 right-0 left-0 h-4"></div>'), xt = /* @__PURE__ */ template('<div class="relative"><img alt="" class="group-hover:outline-background relative h-7 w-7 bg-stone-200 outline outline-4 outline-white transition-colors select-none"></div>'), kt = /* @__PURE__ */ template('<div class="ml-3 flex items-center -space-x-2"></div>'), Ct = /* @__PURE__ */ template("More games <!>", 1), St = /* @__PURE__ */ template('<div role="menu" tabindex="0" class="bg-background/85 fixed top-4 right-4 left-4 z-99998 mx-auto flex w-fit max-w-[calc(100%-2rem)] flex-wrap items-center gap-4 overflow-hidden border-1 p-4 shadow-lg backdrop-blur-xl"><p class="truncate text-lg font-semibold text-nowrap text-white"> </p> <!></div>'), Mt = /* @__PURE__ */ template("<!> <!>", 1);
|
|
3940
3968
|
function ExitIntentDetector(e2, t2) {
|
|
3941
3969
|
push(t2, true);
|
|
3942
3970
|
let n2, s2 = prop(t2, "enabled", 3, true), i2 = prop(t2, "immediate", 3, false), o2 = state(void 0), a2 = state(void 0), l2 = state(false), c2 = state(void 0);
|
|
@@ -3944,28 +3972,28 @@ function ExitIntentDetector(e2, t2) {
|
|
|
3944
3972
|
setTimeout(() => {
|
|
3945
3973
|
var _a2;
|
|
3946
3974
|
n2 < Date.now() - 50 && (clearTimeout(get$1(c2)), set(c2, null), i2() ? (_a2 = t2.onIntent) == null ? void 0 : _a2.call(t2) : (!async function loadInitialSuggestions() {
|
|
3947
|
-
const e3 = await
|
|
3975
|
+
const e3 = await Qe.getCategories(), t3 = await Qe.getCurrentGameInfo();
|
|
3948
3976
|
get$1(d2) || set(d2, (t3 == null ? void 0 : t3.category) || (e3 == null ? void 0 : e3[(e3 == null ? void 0 : e3.length) - 1]), true);
|
|
3949
|
-
let n3 = await
|
|
3977
|
+
let n3 = await Qe.getSuggestions(get$1(d2), 1);
|
|
3950
3978
|
set(f2, ((n3 == null ? void 0 : n3.games) || []).slice(0, 3), true);
|
|
3951
3979
|
}(), set(l2, true)));
|
|
3952
3980
|
}, 150);
|
|
3953
3981
|
}
|
|
3954
|
-
let u2 = ["The cure for boredom.", "
|
|
3982
|
+
let u2 = ["The cure for boredom.", "Ready for what’s next?", "Why stop the fun now?", "Games don’t play themselves.", "A new adventure awaits.", "There’s always time for one more."], d2 = state(void 0), f2 = state(proxy([]));
|
|
3955
3983
|
var p2 = Mt();
|
|
3956
|
-
event("mousemove",
|
|
3984
|
+
event("mousemove", P, function trackMouse(e3) {
|
|
3957
3985
|
var _a2, _b2;
|
|
3958
3986
|
!s2() || ((_a2 = get$1(o2)) == null ? void 0 : _a2.contains(e3.target)) || ((_b2 = get$1(a2)) == null ? void 0 : _b2.contains(e3.target)) || (!get$1(c2) && get$1(l2) && set(c2, setTimeout(() => set(l2, false), 1500), true), n2 = Date.now());
|
|
3959
3987
|
});
|
|
3960
|
-
var
|
|
3961
|
-
var t3 =
|
|
3962
|
-
t3.
|
|
3988
|
+
var g2 = first_child(p2), consequent = (e3) => {
|
|
3989
|
+
var t3 = wt();
|
|
3990
|
+
t3.__pointerover = [on_pointerover, handleBarTrigger], bind_this(t3, (e4) => set(o2, e4), () => get$1(o2)), append(e3, t3);
|
|
3963
3991
|
};
|
|
3964
|
-
if_block(
|
|
3992
|
+
if_block(g2, (e3) => {
|
|
3965
3993
|
s2() && e3(consequent);
|
|
3966
3994
|
});
|
|
3967
|
-
var
|
|
3968
|
-
var n3 =
|
|
3995
|
+
var _2 = sibling(g2, 2), consequent_2 = (e3) => {
|
|
3996
|
+
var n3 = St(), s3 = child(n3), i3 = child(s3);
|
|
3969
3997
|
Button(sibling(s3, 2), {
|
|
3970
3998
|
class: "group",
|
|
3971
3999
|
onclick: () => {
|
|
@@ -3973,10 +4001,10 @@ function ExitIntentDetector(e2, t2) {
|
|
|
3973
4001
|
(_a2 = t2.onIntent) == null ? void 0 : _a2.call(t2), setTimeout(() => set(l2, false), 150);
|
|
3974
4002
|
},
|
|
3975
4003
|
children: (e4, t3) => {
|
|
3976
|
-
var n4 =
|
|
3977
|
-
var t4 =
|
|
4004
|
+
var n4 = Ct(), s4 = sibling(first_child(n4)), consequent_1 = (e5) => {
|
|
4005
|
+
var t4 = kt();
|
|
3978
4006
|
each(t4, 21, () => get$1(f2), index, (e6, t5, n5) => {
|
|
3979
|
-
var s5 =
|
|
4007
|
+
var s5 = xt();
|
|
3980
4008
|
let i4;
|
|
3981
4009
|
var o3 = child(s5);
|
|
3982
4010
|
template_effect(() => {
|
|
@@ -4002,27 +4030,27 @@ function ExitIntentDetector(e2, t2) {
|
|
|
4002
4030
|
duration: 500
|
|
4003
4031
|
})), append(e3, n3);
|
|
4004
4032
|
};
|
|
4005
|
-
if_block(
|
|
4033
|
+
if_block(_2, (e3) => {
|
|
4006
4034
|
get$1(l2) && e3(consequent_2);
|
|
4007
4035
|
}), append(e2, p2), pop();
|
|
4008
4036
|
}
|
|
4009
|
-
delegate(["
|
|
4010
|
-
var
|
|
4037
|
+
delegate(["pointerover"]);
|
|
4038
|
+
var Tt = /* @__PURE__ */ template("<!> <!> <!> <!>", 1);
|
|
4011
4039
|
function App(e2, t2) {
|
|
4012
4040
|
push(t2, true);
|
|
4013
|
-
const [n2, s2] = setup_stores(), $discoveryOpen = () => store_get(
|
|
4041
|
+
const [n2, s2] = setup_stores(), $discoveryOpen = () => store_get(Ie, "$discoveryOpen", n2), $config = () => store_get(t2.config, "$config", n2);
|
|
4014
4042
|
function openDiscovery() {
|
|
4015
|
-
$discoveryOpen() || (store_set(
|
|
4043
|
+
$discoveryOpen() || (store_set(Ie, true), Qe.trackOpen());
|
|
4016
4044
|
}
|
|
4017
4045
|
let i2;
|
|
4018
|
-
|
|
4046
|
+
Ie.subscribe((e3) => {
|
|
4019
4047
|
try {
|
|
4020
4048
|
e3 ? (i2 = document.body.style.overflow, document.body.style.overflow = "hidden") : document.body.style.overflow = i2;
|
|
4021
4049
|
} catch (e4) {
|
|
4022
4050
|
console.error("Failed to toggle body overflow style:", e4);
|
|
4023
4051
|
}
|
|
4024
4052
|
});
|
|
4025
|
-
var o2 =
|
|
4053
|
+
var o2 = Tt(), a2 = first_child(o2);
|
|
4026
4054
|
const l2 = user_derived(() => {
|
|
4027
4055
|
var _a2, _b2;
|
|
4028
4056
|
return (_b2 = (_a2 = $config()) == null ? void 0 : _a2.button) == null ? void 0 : _b2.position;
|
|
@@ -4094,13 +4122,13 @@ function deepMerge(e2, t2) {
|
|
|
4094
4122
|
function isObject(e2) {
|
|
4095
4123
|
return e2 && "object" == typeof e2 && !Array.isArray(e2);
|
|
4096
4124
|
}
|
|
4097
|
-
var
|
|
4125
|
+
var qt = /* @__PURE__ */ template('<div class="flex h-62 w-full items-center justify-center"><!></div>'), Pt = /* @__PURE__ */ template('<div class="snap-center px-2"><!></div>'), Wt = /* @__PURE__ */ template('<!> <div class="bg-background/85 my-auto mr-3 mb-30 ml-2 flex min-w-40 snap-center flex-wrap items-center justify-center gap-4 p-4 pb-6 shadow-lg backdrop-blur-xl"><p class="w-full text-center text-lg font-semibold text-white">Fancy more?</p> <!></div>', 1), on_click = (e2, t2, n2) => get$1(t2).scrollBy({
|
|
4098
4126
|
left: 2 * -get$1(n2),
|
|
4099
4127
|
behavior: "smooth"
|
|
4100
|
-
}),
|
|
4128
|
+
}), zt = /* @__PURE__ */ template('<button class="bg-background/85 absolute top-4/9 left-2 z-20 -translate-y-1/2 transform border p-1 py-4 text-white shadow-lg backdrop-blur-xl transition hover:bg-white hover:text-black max-sm:hidden"><!></button>'), on_click_1 = (e2, t2, n2) => get$1(t2).scrollBy({
|
|
4101
4129
|
left: 2 * get$1(n2),
|
|
4102
4130
|
behavior: "smooth"
|
|
4103
|
-
}),
|
|
4131
|
+
}), jt = /* @__PURE__ */ template('<button class="bg-background/85 absolute top-4/9 right-2 z-20 -translate-y-1/2 transform border p-1 py-4 text-white shadow-lg backdrop-blur-xl transition hover:bg-white hover:text-black max-sm:hidden"><!></button>'), Dt = /* @__PURE__ */ template("<!> <!>", 1), Nt = /* @__PURE__ */ template('<div class="playlight-sdk-container"><div class="relative flex h-full w-full snap-x gap-2 overflow-x-auto"><!></div> <!></div>');
|
|
4104
4132
|
function WidgetCarousel(e2, t2) {
|
|
4105
4133
|
push(t2, true);
|
|
4106
4134
|
const [n2, s2] = setup_stores();
|
|
@@ -4126,12 +4154,12 @@ function WidgetCarousel(e2, t2) {
|
|
|
4126
4154
|
)`);
|
|
4127
4155
|
}
|
|
4128
4156
|
onMount(async () => {
|
|
4129
|
-
const e3 = await
|
|
4157
|
+
const e3 = await Qe.getCategories(), t3 = await Qe.getCurrentGameInfo();
|
|
4130
4158
|
if (set(a2, (t3 == null ? void 0 : t3.category) || (e3 == null ? void 0 : e3[(e3 == null ? void 0 : e3.length) - 1]), true), await async function fetchGames() {
|
|
4131
4159
|
set(i2, true);
|
|
4132
|
-
let e4 = await
|
|
4160
|
+
let e4 = await Qe.getSuggestions(get$1(a2), 1), t4 = (e4 == null ? void 0 : e4.games) || [];
|
|
4133
4161
|
if (t4.length < 10 && get$1(a2)) {
|
|
4134
|
-
const e5 = await
|
|
4162
|
+
const e5 = await Qe.getSuggestions(null, 1), n3 = ((e5 == null ? void 0 : e5.games) || []).filter((e6) => !t4.some((t5) => t5.id === e6.id));
|
|
4135
4163
|
t4 = [...t4, ...n3];
|
|
4136
4164
|
}
|
|
4137
4165
|
set(o2, t4.slice(0, 10), true), set(i2, false);
|
|
@@ -4140,15 +4168,15 @@ function WidgetCarousel(e2, t2) {
|
|
|
4140
4168
|
updateMask(get$1(l2).scrollLeft, e4 - get$1(l2).scrollLeft);
|
|
4141
4169
|
}
|
|
4142
4170
|
});
|
|
4143
|
-
var p2 =
|
|
4144
|
-
var t3 =
|
|
4171
|
+
var p2 = Nt(), g2 = child(p2), _2 = child(g2), consequent = (e3) => {
|
|
4172
|
+
var t3 = qt();
|
|
4145
4173
|
Loader_circle(child(t3), {
|
|
4146
4174
|
class: "animate-spin opacity-75",
|
|
4147
4175
|
size: 30,
|
|
4148
4176
|
strokeWidth: 2.5
|
|
4149
4177
|
}), append(e3, t3);
|
|
4150
4178
|
}, alternate = (e3) => {
|
|
4151
|
-
var t3 =
|
|
4179
|
+
var t3 = Wt(), n3 = first_child(t3);
|
|
4152
4180
|
each(n3, 17, () => get$1(o2), index, (e4, t4) => {
|
|
4153
4181
|
var n4 = Pt();
|
|
4154
4182
|
GameCard(child(n4), {
|
|
@@ -4167,19 +4195,19 @@ function WidgetCarousel(e2, t2) {
|
|
|
4167
4195
|
var s3 = sibling(n3, 2);
|
|
4168
4196
|
Button(sibling(child(s3), 2), {
|
|
4169
4197
|
onclick: () => {
|
|
4170
|
-
store_set(
|
|
4198
|
+
store_set(Ie, true), Qe.trackOpen();
|
|
4171
4199
|
},
|
|
4172
4200
|
children: (e4, t4) => {
|
|
4173
4201
|
append(e4, text("See all"));
|
|
4174
4202
|
}
|
|
4175
4203
|
}), append(e3, t3);
|
|
4176
4204
|
};
|
|
4177
|
-
if_block(
|
|
4205
|
+
if_block(_2, (e3) => {
|
|
4178
4206
|
get$1(i2) ? e3(consequent) : e3(alternate, false);
|
|
4179
|
-
}), bind_this(
|
|
4180
|
-
var v2 = sibling(
|
|
4181
|
-
var t3 =
|
|
4182
|
-
var t4 =
|
|
4207
|
+
}), bind_this(g2, (e3) => set(l2, e3), () => get$1(l2));
|
|
4208
|
+
var v2 = sibling(g2, 2), consequent_3 = (e3) => {
|
|
4209
|
+
var t3 = Dt(), n3 = first_child(t3), consequent_1 = (e4) => {
|
|
4210
|
+
var t4 = zt();
|
|
4183
4211
|
t4.__click = [on_click, l2, c2], function Chevron_left(e5, t5) {
|
|
4184
4212
|
const n4 = legacy_rest_props(t5, ["children", "$$slots", "$$events", "$$legacy"]);
|
|
4185
4213
|
Icon$1(e5, spread_props({
|
|
@@ -4205,7 +4233,7 @@ function WidgetCarousel(e2, t2) {
|
|
|
4205
4233
|
get$1(u2) && e4(consequent_1);
|
|
4206
4234
|
});
|
|
4207
4235
|
var s3 = sibling(n3, 2), consequent_2 = (e4) => {
|
|
4208
|
-
var t4 =
|
|
4236
|
+
var t4 = jt();
|
|
4209
4237
|
t4.__click = [on_click_1, l2, c2], function Chevron_right(e5, t5) {
|
|
4210
4238
|
const n4 = legacy_rest_props(t5, ["children", "$$slots", "$$events", "$$legacy"]);
|
|
4211
4239
|
Icon$1(e5, spread_props({
|
|
@@ -4233,7 +4261,7 @@ function WidgetCarousel(e2, t2) {
|
|
|
4233
4261
|
};
|
|
4234
4262
|
if_block(v2, (e3) => {
|
|
4235
4263
|
get$1(o2).length > 0 && e3(consequent_3);
|
|
4236
|
-
}), template_effect(() => set_style(
|
|
4264
|
+
}), template_effect(() => set_style(g2, get$1(f2))), event("scroll", g2, (e3) => {
|
|
4237
4265
|
const t3 = e3.target;
|
|
4238
4266
|
set(u2, t3.scrollLeft > 20), set(d2, t3.scrollLeft < t3.scrollWidth - t3.clientWidth - 20), updateMask(t3.scrollLeft, t3.scrollWidth - t3.clientWidth - t3.scrollLeft);
|
|
4239
4267
|
}), append(e2, p2), pop(), s2();
|
|
@@ -4252,13 +4280,13 @@ function initWidgets() {
|
|
|
4252
4280
|
}
|
|
4253
4281
|
}
|
|
4254
4282
|
delegate(["click"]);
|
|
4255
|
-
const
|
|
4283
|
+
const Bt = new /**
|
|
4256
4284
|
* The PlaylightSDK class
|
|
4257
4285
|
*/
|
|
4258
4286
|
(_c = class {
|
|
4259
4287
|
constructor() {
|
|
4260
4288
|
__privateAdd(this, _PlaylightSDK_instances);
|
|
4261
|
-
this.container = null, this.isInitialized = false, this.config = writable(null), this.api =
|
|
4289
|
+
this.container = null, this.isInitialized = false, this.config = writable(null), this.api = Qe;
|
|
4262
4290
|
}
|
|
4263
4291
|
/**
|
|
4264
4292
|
* Initialize Playlight
|
|
@@ -4289,7 +4317,7 @@ const Dt = new /**
|
|
|
4289
4317
|
* @param {boolean} [value=true] - Whether to show the discovery
|
|
4290
4318
|
*/
|
|
4291
4319
|
setDiscovery(e2 = true) {
|
|
4292
|
-
this.isInitialized && (
|
|
4320
|
+
this.isInitialized && (Ie.set(e2), e2 && Qe.trackOpen());
|
|
4293
4321
|
}
|
|
4294
4322
|
/**
|
|
4295
4323
|
* Update the configuration
|
|
@@ -4316,8 +4344,8 @@ i_fn = function() {
|
|
|
4316
4344
|
console.error("Playlight error occured during mount:", e2);
|
|
4317
4345
|
}
|
|
4318
4346
|
}, _c)();
|
|
4319
|
-
"undefined" != typeof window && (window.playlightSDK =
|
|
4347
|
+
"undefined" != typeof window && (window.playlightSDK = Bt);
|
|
4320
4348
|
export {
|
|
4321
|
-
|
|
4349
|
+
Bt as default
|
|
4322
4350
|
};
|
|
4323
4351
|
//# sourceMappingURL=playlight-sdk.es.js.map
|