playlight-sdk 0.2.10 → 0.2.11
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
|
@@ -9,9 +9,9 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
|
-
var _e2, _t2, _n, _ResizeObserverSingleton_instances, r_fn, _a, _PlayLightAPI_instances,
|
|
12
|
+
var _e2, _t2, _n, _ResizeObserverSingleton_instances, r_fn, _a, _PlayLightAPI_instances, i_fn, _b, _PlaylightSDK_instances, s_fn, _c;
|
|
13
13
|
const e = false;
|
|
14
|
-
var t = Array.isArray, n = Array.prototype.indexOf,
|
|
14
|
+
var t = Array.isArray, n = Array.prototype.indexOf, i = Array.from, s = Object.defineProperty, o = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyDescriptors, l = Object.prototype, c = Array.prototype, u = Object.getPrototypeOf, d = Object.isExtensible;
|
|
15
15
|
function is_function(e2) {
|
|
16
16
|
return "function" == typeof e2;
|
|
17
17
|
}
|
|
@@ -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, 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"),
|
|
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"), I = Symbol("");
|
|
27
27
|
function equals(e2) {
|
|
28
28
|
return e2 === this.v;
|
|
29
29
|
}
|
|
@@ -33,8 +33,8 @@ 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 M = false;
|
|
37
|
+
const T = Symbol();
|
|
38
38
|
function lifecycle_outside_component(e2) {
|
|
39
39
|
throw new Error("https://svelte.dev/e/lifecycle_outside_component");
|
|
40
40
|
}
|
|
@@ -43,7 +43,7 @@ function set_component_context(e2) {
|
|
|
43
43
|
O = e2;
|
|
44
44
|
}
|
|
45
45
|
function push(e2, t2 = false, n2) {
|
|
46
|
-
var
|
|
46
|
+
var i2 = O = {
|
|
47
47
|
p: O,
|
|
48
48
|
c: null,
|
|
49
49
|
d: false,
|
|
@@ -53,13 +53,13 @@ function push(e2, t2 = false, n2) {
|
|
|
53
53
|
x: null,
|
|
54
54
|
l: null
|
|
55
55
|
};
|
|
56
|
-
|
|
56
|
+
M && !t2 && (O.l = {
|
|
57
57
|
s: null,
|
|
58
58
|
u: null,
|
|
59
59
|
r1: [],
|
|
60
60
|
r2: source(false)
|
|
61
61
|
}), teardown(() => {
|
|
62
|
-
|
|
62
|
+
i2.d = true;
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
function pop(e2) {
|
|
@@ -67,15 +67,15 @@ function pop(e2) {
|
|
|
67
67
|
if (null !== t2) {
|
|
68
68
|
const e3 = t2.e;
|
|
69
69
|
if (null !== e3) {
|
|
70
|
-
var n2 = V,
|
|
70
|
+
var n2 = V, i2 = R;
|
|
71
71
|
t2.e = null;
|
|
72
72
|
try {
|
|
73
|
-
for (var
|
|
74
|
-
var o2 = e3[
|
|
73
|
+
for (var s2 = 0; s2 < e3.length; s2++) {
|
|
74
|
+
var o2 = e3[s2];
|
|
75
75
|
set_active_effect(o2.effect), set_active_reaction(o2.reaction), effect(o2.fn);
|
|
76
76
|
}
|
|
77
77
|
} finally {
|
|
78
|
-
set_active_effect(n2), set_active_reaction(
|
|
78
|
+
set_active_effect(n2), set_active_reaction(i2);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
O = t2.p, t2.m = true;
|
|
@@ -83,19 +83,19 @@ function pop(e2) {
|
|
|
83
83
|
return {};
|
|
84
84
|
}
|
|
85
85
|
function is_runes() {
|
|
86
|
-
return !
|
|
86
|
+
return !M || 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;
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
92
|
-
var
|
|
90
|
+
const i2 = u(e2);
|
|
91
|
+
if (i2 !== l && i2 !== c) return e2;
|
|
92
|
+
var s2 = /* @__PURE__ */ new Map(), a2 = t(e2), d2 = state(0), f2 = R, with_parent = (e3) => {
|
|
93
93
|
var t2, n3 = R;
|
|
94
94
|
return set_active_reaction(f2), t2 = e3(), set_active_reaction(n3), t2;
|
|
95
95
|
};
|
|
96
96
|
return a2 && // We need to create the length source eagerly to ensure that
|
|
97
97
|
// mutations to the array are properly synced with our proxy
|
|
98
|
-
|
|
98
|
+
s2.set("length", state(
|
|
99
99
|
/** @type {any[]} */
|
|
100
100
|
e2.length
|
|
101
101
|
)), new Proxy(
|
|
@@ -114,45 +114,45 @@ function proxy(e2, n2) {
|
|
|
114
114
|
function state_descriptors_fixed() {
|
|
115
115
|
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
116
116
|
}();
|
|
117
|
-
var
|
|
118
|
-
return void 0 ===
|
|
117
|
+
var i3 = s2.get(t2);
|
|
118
|
+
return void 0 === i3 ? (i3 = with_parent(() => state(n3.value)), s2.set(t2, i3)) : set(i3, with_parent(() => proxy(n3.value))), true;
|
|
119
119
|
},
|
|
120
120
|
deleteProperty(e3, t2) {
|
|
121
|
-
var n3 =
|
|
122
|
-
if (void 0 === n3) t2 in e3 &&
|
|
121
|
+
var n3 = s2.get(t2);
|
|
122
|
+
if (void 0 === n3) t2 in e3 && s2.set(t2, with_parent(() => state(T)));
|
|
123
123
|
else {
|
|
124
124
|
if (a2 && "string" == typeof t2) {
|
|
125
|
-
var
|
|
125
|
+
var i3 = (
|
|
126
126
|
/** @type {Source<number>} */
|
|
127
|
-
|
|
127
|
+
s2.get("length")
|
|
128
128
|
), o2 = Number(t2);
|
|
129
|
-
Number.isInteger(o2) && o2 <
|
|
129
|
+
Number.isInteger(o2) && o2 < i3.v && set(i3, o2);
|
|
130
130
|
}
|
|
131
|
-
set(n3,
|
|
131
|
+
set(n3, T), update_version(d2);
|
|
132
132
|
}
|
|
133
133
|
return true;
|
|
134
134
|
},
|
|
135
|
-
get(t2, n3,
|
|
135
|
+
get(t2, n3, i3) {
|
|
136
136
|
var _a2;
|
|
137
137
|
if (n3 === C) return e2;
|
|
138
|
-
var a3 =
|
|
138
|
+
var a3 = s2.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] : T))), s2.set(n3, a3)), void 0 !== a3
|
|
142
142
|
) {
|
|
143
143
|
var c2 = get$1(a3);
|
|
144
|
-
return c2 ===
|
|
144
|
+
return c2 === T ? void 0 : c2;
|
|
145
145
|
}
|
|
146
|
-
return Reflect.get(t2, n3,
|
|
146
|
+
return Reflect.get(t2, n3, i3);
|
|
147
147
|
},
|
|
148
148
|
getOwnPropertyDescriptor(e3, t2) {
|
|
149
149
|
var n3 = Reflect.getOwnPropertyDescriptor(e3, t2);
|
|
150
150
|
if (n3 && "value" in n3) {
|
|
151
|
-
var
|
|
152
|
-
|
|
151
|
+
var i3 = s2.get(t2);
|
|
152
|
+
i3 && (n3.value = get$1(i3));
|
|
153
153
|
} else if (void 0 === n3) {
|
|
154
|
-
var o2 =
|
|
155
|
-
if (void 0 !== o2 && a3 !==
|
|
154
|
+
var o2 = s2.get(t2), a3 = o2 == null ? void 0 : o2.v;
|
|
155
|
+
if (void 0 !== o2 && a3 !== T) return {
|
|
156
156
|
enumerable: true,
|
|
157
157
|
configurable: true,
|
|
158
158
|
value: a3,
|
|
@@ -164,28 +164,28 @@ function proxy(e2, n2) {
|
|
|
164
164
|
has(e3, t2) {
|
|
165
165
|
var _a2;
|
|
166
166
|
if (t2 === C) return true;
|
|
167
|
-
var n3 =
|
|
168
|
-
if ((void 0 !== n3 || null !== V && (!
|
|
169
|
-
return
|
|
167
|
+
var n3 = s2.get(t2), i3 = void 0 !== n3 && n3.v !== T || Reflect.has(e3, t2);
|
|
168
|
+
if ((void 0 !== n3 || null !== V && (!i3 || ((_a2 = o(e3, t2)) == null ? void 0 : _a2.writable))) && (void 0 === n3 && (n3 = with_parent(() => state(i3 ? proxy(e3[t2]) : T)), s2.set(t2, n3)), get$1(n3) === T)) return false;
|
|
169
|
+
return i3;
|
|
170
170
|
},
|
|
171
|
-
set(e3, t2, n3,
|
|
171
|
+
set(e3, t2, n3, i3) {
|
|
172
172
|
var _a2;
|
|
173
|
-
var l2 =
|
|
173
|
+
var l2 = s2.get(t2), c2 = t2 in e3;
|
|
174
174
|
if (a2 && "length" === t2) for (var u2 = n3; u2 < /** @type {Source<number>} */
|
|
175
175
|
l2.v; u2 += 1) {
|
|
176
|
-
var f3 =
|
|
177
|
-
void 0 !== f3 ? set(f3,
|
|
176
|
+
var f3 = s2.get(u2 + "");
|
|
177
|
+
void 0 !== f3 ? set(f3, T) : 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(T)), s2.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))),
|
|
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))), s2.set(t2, l2)) : (c2 = l2.v !== T, set(l2, with_parent(() => proxy(n3))));
|
|
183
183
|
var p2 = Reflect.getOwnPropertyDescriptor(e3, t2);
|
|
184
|
-
if ((p2 == null ? void 0 : p2.set) && p2.set.call(
|
|
184
|
+
if ((p2 == null ? void 0 : p2.set) && p2.set.call(i3, n3), !c2) {
|
|
185
185
|
if (a2 && "string" == typeof t2) {
|
|
186
186
|
var g2 = (
|
|
187
187
|
/** @type {Source<number>} */
|
|
188
|
-
|
|
188
|
+
s2.get("length")
|
|
189
189
|
), _2 = Number(t2);
|
|
190
190
|
Number.isInteger(_2) && _2 >= g2.v && set(g2, _2 + 1);
|
|
191
191
|
}
|
|
@@ -196,10 +196,10 @@ function proxy(e2, n2) {
|
|
|
196
196
|
ownKeys(e3) {
|
|
197
197
|
get$1(d2);
|
|
198
198
|
var t2 = Reflect.ownKeys(e3).filter((e4) => {
|
|
199
|
-
var t3 =
|
|
200
|
-
return void 0 === t3 || t3.v !==
|
|
199
|
+
var t3 = s2.get(e4);
|
|
200
|
+
return void 0 === t3 || t3.v !== T;
|
|
201
201
|
});
|
|
202
|
-
for (var [n3,
|
|
202
|
+
for (var [n3, i3] of s2) i3.v === T || n3 in e3 || t2.push(n3);
|
|
203
203
|
return t2;
|
|
204
204
|
},
|
|
205
205
|
setPrototypeOf() {
|
|
@@ -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
|
+
M && 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() {
|
|
@@ -259,15 +259,15 @@ function internal_set(e2, t2) {
|
|
|
259
259
|
return t2;
|
|
260
260
|
}
|
|
261
261
|
function update(e2, t2 = 1) {
|
|
262
|
-
var n2 = get$1(e2),
|
|
263
|
-
return set(e2, n2),
|
|
262
|
+
var n2 = get$1(e2), i2 = 1 === t2 ? n2++ : n2--;
|
|
263
|
+
return set(e2, n2), i2;
|
|
264
264
|
}
|
|
265
265
|
function mark_reactions(e2, t2) {
|
|
266
266
|
var n2 = e2.reactions;
|
|
267
|
-
if (null !== n2) for (var
|
|
267
|
+
if (null !== n2) for (var i2 = is_runes(), s2 = n2.length, o2 = 0; o2 < s2; o2++) {
|
|
268
268
|
var a2 = n2[o2], l2 = a2.f;
|
|
269
269
|
l2 & m || // In legacy mode, skip the current effect to prevent infinite loops
|
|
270
|
-
(
|
|
270
|
+
(i2 || a2 !== V) && (set_signal_status(a2, t2), // If the signal a) was previously clean or b) is an unowned derived, then mark it
|
|
271
271
|
1280 & l2 && (2 & l2 ? mark_reactions(
|
|
272
272
|
/** @type {Derived} */
|
|
273
273
|
a2,
|
|
@@ -278,17 +278,17 @@ function mark_reactions(e2, t2) {
|
|
|
278
278
|
)));
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
var P, z, W,
|
|
281
|
+
var P, z, W, E, j;
|
|
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 E.call(e2);
|
|
288
288
|
}
|
|
289
289
|
// @__NO_SIDE_EFFECTS__
|
|
290
290
|
function get_next_sibling(e2) {
|
|
291
|
-
return
|
|
291
|
+
return j.call(e2);
|
|
292
292
|
}
|
|
293
293
|
function child(e2, t2) {
|
|
294
294
|
return /* @__PURE__ */ get_first_child(e2);
|
|
@@ -304,10 +304,10 @@ function first_child(e2, t2) {
|
|
|
304
304
|
return n2 instanceof Comment && "" === n2.data ? /* @__PURE__ */ get_next_sibling(n2) : n2;
|
|
305
305
|
}
|
|
306
306
|
function sibling(e2, t2 = 1, n2 = false) {
|
|
307
|
-
let
|
|
308
|
-
for (; t2--; )
|
|
309
|
-
/* @__PURE__ */ get_next_sibling(
|
|
310
|
-
return
|
|
307
|
+
let i2 = e2;
|
|
308
|
+
for (; t2--; ) i2 = /** @type {TemplateNode} */
|
|
309
|
+
/* @__PURE__ */ get_next_sibling(i2);
|
|
310
|
+
return i2;
|
|
311
311
|
}
|
|
312
312
|
// @__NO_SIDE_EFFECTS__
|
|
313
313
|
function derived(e2) {
|
|
@@ -401,8 +401,8 @@ function validate_effect(e2) {
|
|
|
401
401
|
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
402
402
|
}();
|
|
403
403
|
}
|
|
404
|
-
function create_effect(e2, t2, n2,
|
|
405
|
-
var
|
|
404
|
+
function create_effect(e2, t2, n2, i2 = true) {
|
|
405
|
+
var s2 = V, o2 = {
|
|
406
406
|
ctx: O,
|
|
407
407
|
deps: null,
|
|
408
408
|
nodes_start: null,
|
|
@@ -412,7 +412,7 @@ function create_effect(e2, t2, n2, s2 = true) {
|
|
|
412
412
|
fn: t2,
|
|
413
413
|
last: null,
|
|
414
414
|
next: null,
|
|
415
|
-
parent:
|
|
415
|
+
parent: s2,
|
|
416
416
|
prev: null,
|
|
417
417
|
teardown: null,
|
|
418
418
|
transitions: null,
|
|
@@ -424,10 +424,10 @@ function create_effect(e2, t2, n2, s2 = true) {
|
|
|
424
424
|
throw destroy_effect(o2), e3;
|
|
425
425
|
}
|
|
426
426
|
else null !== t2 && schedule_effect(o2);
|
|
427
|
-
if (!(n2 && null === o2.deps && null === o2.first && null === o2.nodes_start && null === o2.teardown && !(1048704 & o2.f)) &&
|
|
427
|
+
if (!(n2 && null === o2.deps && null === o2.first && null === o2.nodes_start && null === o2.teardown && !(1048704 & o2.f)) && i2 && (null !== s2 && function push_effect(e3, t3) {
|
|
428
428
|
var n3 = t3.last;
|
|
429
429
|
null === n3 ? t3.last = t3.first = e3 : (n3.next = e3, e3.prev = n3, t3.last = e3);
|
|
430
|
-
}(o2,
|
|
430
|
+
}(o2, s2), null !== R && 2 & R.f)) {
|
|
431
431
|
var a2 = (
|
|
432
432
|
/** @type {Derived} */
|
|
433
433
|
R
|
|
@@ -459,14 +459,14 @@ function legacy_pre_effect(e2, t2) {
|
|
|
459
459
|
var n2 = (
|
|
460
460
|
/** @type {ComponentContextLegacy} */
|
|
461
461
|
O
|
|
462
|
-
),
|
|
462
|
+
), i2 = {
|
|
463
463
|
effect: null,
|
|
464
464
|
ran: false
|
|
465
465
|
};
|
|
466
|
-
n2.l.r1.push(
|
|
466
|
+
n2.l.r1.push(i2), i2.effect = render_effect(() => {
|
|
467
467
|
e2(), // If this legacy pre effect has already run before the end of the reset, then
|
|
468
468
|
// bail out to emulate the same behavior.
|
|
469
|
-
|
|
469
|
+
i2.ran || (i2.ran = true, set(n2.l.r2, true), untrack(t2));
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
function legacy_pre_effect_reset() {
|
|
@@ -488,8 +488,8 @@ function render_effect(e2) {
|
|
|
488
488
|
return create_effect(8, e2, true);
|
|
489
489
|
}
|
|
490
490
|
function template_effect(e2, t2 = [], n2 = derived) {
|
|
491
|
-
const
|
|
492
|
-
return block(() => e2(...
|
|
491
|
+
const i2 = t2.map(n2);
|
|
492
|
+
return block(() => e2(...i2.map(get$1)));
|
|
493
493
|
}
|
|
494
494
|
function block(e2, t2 = 0) {
|
|
495
495
|
return create_effect(24 | t2, e2, true);
|
|
@@ -512,22 +512,22 @@ function execute_effect_teardown(e2) {
|
|
|
512
512
|
function destroy_effect_children(e2, t2 = false) {
|
|
513
513
|
var n2 = e2.first;
|
|
514
514
|
for (e2.first = e2.last = null; null !== n2; ) {
|
|
515
|
-
var
|
|
515
|
+
var i2 = n2.next;
|
|
516
516
|
n2.f & p ? (
|
|
517
517
|
// this is now an independent root
|
|
518
518
|
n2.parent = null
|
|
519
|
-
) : destroy_effect(n2, t2), n2 =
|
|
519
|
+
) : destroy_effect(n2, t2), n2 = i2;
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
522
|
function destroy_effect(e2, t2 = true) {
|
|
523
523
|
var n2 = false;
|
|
524
524
|
if ((t2 || 524288 & e2.f) && null !== e2.nodes_start) {
|
|
525
|
-
for (var
|
|
526
|
-
var o2 =
|
|
525
|
+
for (var i2 = e2.nodes_start, s2 = e2.nodes_end; null !== i2; ) {
|
|
526
|
+
var o2 = i2 === s2 ? null : (
|
|
527
527
|
/** @type {TemplateNode} */
|
|
528
|
-
/* @__PURE__ */ get_next_sibling(
|
|
528
|
+
/* @__PURE__ */ get_next_sibling(i2)
|
|
529
529
|
);
|
|
530
|
-
|
|
530
|
+
i2.remove(), i2 = o2;
|
|
531
531
|
}
|
|
532
532
|
n2 = true;
|
|
533
533
|
}
|
|
@@ -541,8 +541,8 @@ function destroy_effect(e2, t2 = true) {
|
|
|
541
541
|
e2.next = e2.prev = e2.teardown = e2.ctx = e2.deps = e2.fn = e2.nodes_start = e2.nodes_end = null;
|
|
542
542
|
}
|
|
543
543
|
function unlink_effect(e2) {
|
|
544
|
-
var t2 = e2.parent, n2 = e2.prev,
|
|
545
|
-
null !== n2 && (n2.next =
|
|
544
|
+
var t2 = e2.parent, n2 = e2.prev, i2 = e2.next;
|
|
545
|
+
null !== n2 && (n2.next = i2), null !== i2 && (i2.prev = n2), null !== t2 && (t2.first === e2 && (t2.first = i2), t2.last === e2 && (t2.last = n2));
|
|
546
546
|
}
|
|
547
547
|
function pause_effect(e2, t2) {
|
|
548
548
|
var n2 = [];
|
|
@@ -554,15 +554,15 @@ function run_out_transitions(e2, t2) {
|
|
|
554
554
|
var n2 = e2.length;
|
|
555
555
|
if (n2 > 0) {
|
|
556
556
|
var check = () => --n2 || t2();
|
|
557
|
-
for (var
|
|
557
|
+
for (var i2 of e2) i2.out(check);
|
|
558
558
|
} else t2();
|
|
559
559
|
}
|
|
560
560
|
function pause_children(e2, t2, n2) {
|
|
561
561
|
if (!(e2.f & y)) {
|
|
562
|
-
if (e2.f ^= y, null !== e2.transitions) for (const
|
|
563
|
-
for (var
|
|
564
|
-
var
|
|
565
|
-
pause_children(
|
|
562
|
+
if (e2.f ^= y, null !== e2.transitions) for (const i3 of e2.transitions) (i3.is_global || n2) && t2.push(i3);
|
|
563
|
+
for (var i2 = e2.first; null !== i2; ) {
|
|
564
|
+
var s2 = i2.next;
|
|
565
|
+
pause_children(i2, t2, !!(!!(i2.f & w) || !!(i2.f & f)) && n2), i2 = s2;
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
}
|
|
@@ -577,27 +577,27 @@ function resume_children(e2, t2) {
|
|
|
577
577
|
// schedule the effect to update
|
|
578
578
|
check_dirtiness(e2) && (set_signal_status(e2, m), schedule_effect(e2));
|
|
579
579
|
for (var n2 = e2.first; null !== n2; ) {
|
|
580
|
-
var
|
|
581
|
-
resume_children(n2, !!(!!(n2.f & w) || !!(n2.f & f)) && t2), n2 =
|
|
580
|
+
var i2 = n2.next;
|
|
581
|
+
resume_children(n2, !!(!!(n2.f & w) || !!(n2.f & f)) && t2), n2 = i2;
|
|
582
582
|
}
|
|
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 D = [], N = [];
|
|
587
587
|
function run_micro_tasks() {
|
|
588
|
-
var e2 =
|
|
589
|
-
|
|
588
|
+
var e2 = D;
|
|
589
|
+
D = [], run_all(e2);
|
|
590
590
|
}
|
|
591
591
|
function queue_micro_task(e2) {
|
|
592
|
-
0 ===
|
|
592
|
+
0 === D.length && queueMicrotask(run_micro_tasks), D.push(e2);
|
|
593
593
|
}
|
|
594
594
|
function flush_tasks() {
|
|
595
|
-
|
|
596
|
-
var e2 =
|
|
597
|
-
|
|
595
|
+
D.length > 0 && run_micro_tasks(), N.length > 0 && function run_idle_tasks() {
|
|
596
|
+
var e2 = N;
|
|
597
|
+
N = [], run_all(e2);
|
|
598
598
|
}();
|
|
599
599
|
}
|
|
600
|
-
let
|
|
600
|
+
let B = false, A = false, L = null, G = false, F = false;
|
|
601
601
|
function set_is_destroying_effect(e2) {
|
|
602
602
|
F = e2;
|
|
603
603
|
}
|
|
@@ -625,15 +625,15 @@ 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,
|
|
628
|
+
var n2 = e2.deps, i2 = !!(t2 & _);
|
|
629
629
|
if (null !== n2) {
|
|
630
|
-
var
|
|
630
|
+
var s2, o2, a2 = !!(t2 & v), l2 = i2 && null !== V && !te, c2 = n2.length;
|
|
631
631
|
if (a2 || l2) {
|
|
632
632
|
var u2 = (
|
|
633
633
|
/** @type {Derived} */
|
|
634
634
|
e2
|
|
635
635
|
), d2 = u2.parent;
|
|
636
|
-
for (
|
|
636
|
+
for (s2 = 0; s2 < c2; s2++) o2 = n2[s2], // We always re-add all reactions (even duplicates) if the derived was
|
|
637
637
|
// previously disconnected, however we don't if it was unowned as we
|
|
638
638
|
// de-duplicate dependencies in that case
|
|
639
639
|
!a2 && ((_a2 = o2 == null ? void 0 : o2.reactions) == null ? void 0 : _a2.includes(u2)) || (o2.reactions ?? (o2.reactions = [])).push(u2);
|
|
@@ -642,24 +642,24 @@ function check_dirtiness(e2) {
|
|
|
642
642
|
// flag
|
|
643
643
|
!l2 || null === d2 || d2.f & _ || (u2.f ^= _);
|
|
644
644
|
}
|
|
645
|
-
for (
|
|
645
|
+
for (s2 = 0; s2 < c2; s2++) if (check_dirtiness(o2 = n2[s2]) && update_derived(
|
|
646
646
|
/** @type {Derived} */
|
|
647
647
|
o2
|
|
648
648
|
), o2.wv > e2.wv) return true;
|
|
649
649
|
}
|
|
650
|
-
|
|
650
|
+
i2 && (null === V || te) || set_signal_status(e2, h);
|
|
651
651
|
}
|
|
652
652
|
return false;
|
|
653
653
|
}
|
|
654
|
-
function handle_error(e2, t2, n2,
|
|
655
|
-
if (
|
|
656
|
-
if (null === n2 && (
|
|
654
|
+
function handle_error(e2, t2, n2, i2) {
|
|
655
|
+
if (B) {
|
|
656
|
+
if (null === n2 && (B = false), /**
|
|
657
657
|
* @param {Effect} effect
|
|
658
658
|
*/
|
|
659
659
|
function should_rethrow_error(e3) {
|
|
660
660
|
return !(e3.f & $ || null !== e3.parent && e3.parent.f & g);
|
|
661
661
|
}(t2)) throw e2;
|
|
662
|
-
} else null !== n2 && (
|
|
662
|
+
} else null !== n2 && (B = true), function propagate_error(e3, t3) {
|
|
663
663
|
for (var n3 = t3; null !== n3; ) {
|
|
664
664
|
if (n3.f & g) try {
|
|
665
665
|
return void n3.fn(e3);
|
|
@@ -668,13 +668,13 @@ function handle_error(e2, t2, n2, s2) {
|
|
|
668
668
|
}
|
|
669
669
|
n3 = n3.parent;
|
|
670
670
|
}
|
|
671
|
-
throw
|
|
671
|
+
throw B = false, e3;
|
|
672
672
|
}(e2, t2);
|
|
673
673
|
}
|
|
674
674
|
function schedule_possible_effect_self_invalidation(e2, t2, n2 = true) {
|
|
675
|
-
var
|
|
676
|
-
if (null !==
|
|
677
|
-
var o2 = s2
|
|
675
|
+
var i2 = e2.reactions;
|
|
676
|
+
if (null !== i2) for (var s2 = 0; s2 < i2.length; s2++) {
|
|
677
|
+
var o2 = i2[s2];
|
|
678
678
|
(K == null ? void 0 : K.includes(e2)) || (2 & o2.f ? schedule_possible_effect_self_invalidation(
|
|
679
679
|
/** @type {Derived} */
|
|
680
680
|
o2,
|
|
@@ -688,7 +688,7 @@ 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,
|
|
691
|
+
var t2 = Y, n2 = Z, i2 = J, s2 = R, o2 = te, a2 = K, l2 = O, c2 = U, u2 = e2.f;
|
|
692
692
|
Y = /** @type {null | Value[]} */
|
|
693
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 {
|
|
@@ -709,25 +709,25 @@ function update_reaction(e2) {
|
|
|
709
709
|
/** @type {Effect} */
|
|
710
710
|
e2
|
|
711
711
|
);
|
|
712
|
-
return null !==
|
|
712
|
+
return null !== s2 && (ee++, null !== J && (null === i2 ? i2 = J : i2.push(.../** @type {Source[]} */
|
|
713
713
|
J))), d2;
|
|
714
714
|
} finally {
|
|
715
|
-
Y = t2, Z = n2, J =
|
|
715
|
+
Y = t2, Z = n2, J = i2, R = s2, te = o2, K = a2, set_component_context(l2), U = c2, e2.f ^= k;
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
718
|
function remove_reaction(e2, t2) {
|
|
719
|
-
let
|
|
720
|
-
if (null !==
|
|
721
|
-
var
|
|
722
|
-
if (-1 !==
|
|
723
|
-
var o2 =
|
|
724
|
-
0 === o2 ?
|
|
719
|
+
let i2 = t2.reactions;
|
|
720
|
+
if (null !== i2) {
|
|
721
|
+
var s2 = n.call(i2, e2);
|
|
722
|
+
if (-1 !== s2) {
|
|
723
|
+
var o2 = i2.length - 1;
|
|
724
|
+
0 === o2 ? i2 = t2.reactions = null : (
|
|
725
725
|
// Swap with last element and then remove.
|
|
726
|
-
(s2
|
|
726
|
+
(i2[s2] = i2[o2], i2.pop())
|
|
727
727
|
);
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
|
-
null ===
|
|
730
|
+
null === i2 && 2 & t2.f && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
731
731
|
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
732
732
|
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
733
733
|
(null === Y || !Y.includes(t2)) && (set_signal_status(t2, b), // If we are working with a derived that is owned by an effect, then mark it as being
|
|
@@ -744,13 +744,13 @@ function remove_reaction(e2, t2) {
|
|
|
744
744
|
}
|
|
745
745
|
function remove_reactions(e2, t2) {
|
|
746
746
|
var n2 = e2.deps;
|
|
747
|
-
if (null !== n2) for (var
|
|
747
|
+
if (null !== n2) for (var i2 = t2; i2 < n2.length; i2++) remove_reaction(e2, n2[i2]);
|
|
748
748
|
}
|
|
749
749
|
function update_effect(t2) {
|
|
750
750
|
var n2 = t2.f;
|
|
751
751
|
if (!(n2 & $)) {
|
|
752
752
|
set_signal_status(t2, h);
|
|
753
|
-
var
|
|
753
|
+
var i2 = V, s2 = O, o2 = G;
|
|
754
754
|
V = t2, G = true;
|
|
755
755
|
try {
|
|
756
756
|
16 & n2 ? function destroy_block_effect_children(e2) {
|
|
@@ -764,9 +764,9 @@ function update_effect(t2) {
|
|
|
764
764
|
t2.deps;
|
|
765
765
|
e;
|
|
766
766
|
} catch (e2) {
|
|
767
|
-
handle_error(e2, t2,
|
|
767
|
+
handle_error(e2, t2, i2, s2 || t2.ctx);
|
|
768
768
|
} finally {
|
|
769
|
-
G = o2, V =
|
|
769
|
+
G = o2, V = i2;
|
|
770
770
|
}
|
|
771
771
|
}
|
|
772
772
|
}
|
|
@@ -786,10 +786,10 @@ function flush_queued_root_effects() {
|
|
|
786
786
|
var t2 = 0;
|
|
787
787
|
for (G = true; H.length > 0; ) {
|
|
788
788
|
t2++ > 1e3 && infinite_loop_guard();
|
|
789
|
-
var n2 = H,
|
|
789
|
+
var n2 = H, i2 = n2.length;
|
|
790
790
|
H = [];
|
|
791
|
-
for (var
|
|
792
|
-
flush_queued_effects(process_effects(n2[
|
|
791
|
+
for (var s2 = 0; s2 < i2; s2++) {
|
|
792
|
+
flush_queued_effects(process_effects(n2[s2]));
|
|
793
793
|
}
|
|
794
794
|
}
|
|
795
795
|
} finally {
|
|
@@ -799,22 +799,22 @@ function flush_queued_root_effects() {
|
|
|
799
799
|
function flush_queued_effects(e2) {
|
|
800
800
|
var t2 = e2.length;
|
|
801
801
|
if (0 !== t2) for (var n2 = 0; n2 < t2; n2++) {
|
|
802
|
-
var
|
|
803
|
-
if (!(24576 &
|
|
804
|
-
check_dirtiness(
|
|
802
|
+
var i2 = e2[n2];
|
|
803
|
+
if (!(24576 & i2.f)) try {
|
|
804
|
+
check_dirtiness(i2) && (update_effect(i2), // Effects with no dependencies or teardown do not get added to the effect tree.
|
|
805
805
|
// Deferred effects (e.g. `$effect(...)`) _are_ added to the tree because we
|
|
806
806
|
// don't know if we need to keep them until they are executed. Doing the check
|
|
807
807
|
// here (rather than in `update_effect`) allows us to skip the work for
|
|
808
808
|
// immediate effects.
|
|
809
|
-
null ===
|
|
809
|
+
null === i2.deps && null === i2.first && null === i2.nodes_start && (null === i2.teardown ? (
|
|
810
810
|
// remove this effect from the graph
|
|
811
|
-
unlink_effect(
|
|
811
|
+
unlink_effect(i2)
|
|
812
812
|
) : (
|
|
813
813
|
// keep the effect in the graph, but free up some memory
|
|
814
|
-
|
|
814
|
+
i2.fn = null
|
|
815
815
|
)));
|
|
816
816
|
} catch (e3) {
|
|
817
|
-
handle_error(e3,
|
|
817
|
+
handle_error(e3, i2, null, i2.ctx);
|
|
818
818
|
}
|
|
819
819
|
}
|
|
820
820
|
}
|
|
@@ -831,10 +831,10 @@ function schedule_effect(e2) {
|
|
|
831
831
|
}
|
|
832
832
|
function process_effects(e2) {
|
|
833
833
|
for (var t2 = [], n2 = e2; null !== n2; ) {
|
|
834
|
-
var
|
|
835
|
-
if (!(
|
|
836
|
-
if (4 &
|
|
837
|
-
else if (
|
|
834
|
+
var i2 = n2.f, s2 = !!(96 & i2);
|
|
835
|
+
if (!(s2 && !!(i2 & h) || i2 & y)) {
|
|
836
|
+
if (4 & i2) t2.push(n2);
|
|
837
|
+
else if (s2) n2.f ^= h;
|
|
838
838
|
else {
|
|
839
839
|
var o2 = R;
|
|
840
840
|
try {
|
|
@@ -872,18 +872,18 @@ function get$1(e2) {
|
|
|
872
872
|
var n2 = (
|
|
873
873
|
/** @type {Derived} */
|
|
874
874
|
e2
|
|
875
|
-
),
|
|
876
|
-
null ===
|
|
875
|
+
), i2 = n2.parent;
|
|
876
|
+
null === i2 || i2.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
879
|
(n2.f ^= _);
|
|
880
880
|
}
|
|
881
881
|
} else if (!(K == null ? void 0 : K.includes(e2))) {
|
|
882
|
-
var
|
|
882
|
+
var s2 = R.deps;
|
|
883
883
|
e2.rv < ee && (e2.rv = ee, // If the signal is accessing the same dependencies in the same
|
|
884
884
|
// order as it did last time, increment `skipped_deps`
|
|
885
885
|
// rather than updating `new_deps`, which creates GC cost
|
|
886
|
-
null === Y && null !==
|
|
886
|
+
null === Y && null !== s2 && s2[Z] === e2 ? Z++ : null === Y ? Y = [e2] : te && Y.includes(e2) || // Normally we can push duplicated dependencies to `new_deps`, but if we're inside
|
|
887
887
|
// an unowned derived because skip_reaction is true, then we need to ensure that
|
|
888
888
|
// we don't have duplicates
|
|
889
889
|
Y.push(e2));
|
|
@@ -925,9 +925,9 @@ function deep_read(e2, t2 = /* @__PURE__ */ new Set()) {
|
|
|
925
925
|
if (n2 !== Object.prototype && n2 !== Array.prototype && n2 !== Map.prototype && n2 !== Set.prototype && n2 !== Date.prototype) {
|
|
926
926
|
const t3 = a(n2);
|
|
927
927
|
for (let n3 in t3) {
|
|
928
|
-
const
|
|
929
|
-
if (
|
|
930
|
-
|
|
928
|
+
const i2 = t3[n3].get;
|
|
929
|
+
if (i2) try {
|
|
930
|
+
i2.call(e2);
|
|
931
931
|
} catch (e3) {
|
|
932
932
|
}
|
|
933
933
|
}
|
|
@@ -941,7 +941,7 @@ const re = ["beforeinput", "click", "change", "dblclick", "contextmenu", "focusi
|
|
|
941
941
|
function is_delegated(e2) {
|
|
942
942
|
return re.includes(e2);
|
|
943
943
|
}
|
|
944
|
-
const
|
|
944
|
+
const ie = {
|
|
945
945
|
// no `class: 'className'` because we handle that separately
|
|
946
946
|
formnovalidate: "formNoValidate",
|
|
947
947
|
ismap: "isMap",
|
|
@@ -957,11 +957,11 @@ const se = {
|
|
|
957
957
|
disableremoteplayback: "disableRemotePlayback"
|
|
958
958
|
};
|
|
959
959
|
function normalize_attribute(e2) {
|
|
960
|
-
return e2 = e2.toLowerCase(),
|
|
960
|
+
return e2 = e2.toLowerCase(), ie[e2] ?? e2;
|
|
961
961
|
}
|
|
962
|
-
const
|
|
962
|
+
const se = ["touchstart", "touchmove"];
|
|
963
963
|
function is_passive_event(e2) {
|
|
964
|
-
return
|
|
964
|
+
return se.includes(e2);
|
|
965
965
|
}
|
|
966
966
|
function autofocus(e2, t2) {
|
|
967
967
|
if (t2) {
|
|
@@ -981,12 +981,12 @@ function without_reactive_context(e2) {
|
|
|
981
981
|
set_active_reaction(t2), set_active_effect(n2);
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
|
-
function listen_to_event_and_reset_event(e2, t2, n2,
|
|
984
|
+
function listen_to_event_and_reset_event(e2, t2, n2, i2 = n2) {
|
|
985
985
|
e2.addEventListener(t2, () => without_reactive_context(n2));
|
|
986
|
-
const
|
|
987
|
-
e2.__on_r =
|
|
988
|
-
|
|
989
|
-
} : () =>
|
|
986
|
+
const s2 = e2.__on_r;
|
|
987
|
+
e2.__on_r = s2 ? () => {
|
|
988
|
+
s2(), i2(true);
|
|
989
|
+
} : () => i2(true), function add_form_reset_listener() {
|
|
990
990
|
oe || (oe = true, document.addEventListener(
|
|
991
991
|
"reset",
|
|
992
992
|
(e3) => {
|
|
@@ -1008,19 +1008,19 @@ function listen_to_event_and_reset_event(e2, t2, n2, s2 = n2) {
|
|
|
1008
1008
|
}();
|
|
1009
1009
|
}
|
|
1010
1010
|
const ae = /* @__PURE__ */ new Set(), le = /* @__PURE__ */ new Set();
|
|
1011
|
-
function create_event(e2, t2, n2,
|
|
1011
|
+
function create_event(e2, t2, n2, i2 = {}) {
|
|
1012
1012
|
function target_handler(e3) {
|
|
1013
|
-
if (
|
|
1013
|
+
if (i2.capture || // Only call in the bubble phase, else delegated events would be called before the capturing events
|
|
1014
1014
|
handle_event_propagation.call(t2, e3), !e3.cancelBubble) return without_reactive_context(() => n2 == null ? void 0 : n2.call(this, e3));
|
|
1015
1015
|
}
|
|
1016
1016
|
return e2.startsWith("pointer") || e2.startsWith("touch") || "wheel" === e2 ? queue_micro_task(() => {
|
|
1017
|
-
t2.addEventListener(e2, target_handler,
|
|
1018
|
-
}) : t2.addEventListener(e2, target_handler,
|
|
1017
|
+
t2.addEventListener(e2, target_handler, i2);
|
|
1018
|
+
}) : t2.addEventListener(e2, target_handler, i2), target_handler;
|
|
1019
1019
|
}
|
|
1020
|
-
function event(e2, t2, n2,
|
|
1020
|
+
function event(e2, t2, n2, i2, s2) {
|
|
1021
1021
|
var o2 = {
|
|
1022
|
-
capture:
|
|
1023
|
-
passive:
|
|
1022
|
+
capture: i2,
|
|
1023
|
+
passive: s2
|
|
1024
1024
|
}, a2 = create_event(e2, t2, n2, o2);
|
|
1025
1025
|
t2 !== document.body && t2 !== window && t2 !== document || teardown(() => {
|
|
1026
1026
|
t2.removeEventListener(e2, a2, o2);
|
|
@@ -1032,7 +1032,7 @@ function delegate(e2) {
|
|
|
1032
1032
|
}
|
|
1033
1033
|
function handle_event_propagation(e2) {
|
|
1034
1034
|
var _a2;
|
|
1035
|
-
var n2 = this,
|
|
1035
|
+
var n2 = this, i2 = (
|
|
1036
1036
|
/** @type {Node} */
|
|
1037
1037
|
n2.ownerDocument
|
|
1038
1038
|
), o2 = e2.type, a2 = ((_a2 = e2.composedPath) == null ? void 0 : _a2.call(e2)) || [], l2 = (
|
|
@@ -1051,9 +1051,9 @@ function handle_event_propagation(e2) {
|
|
|
1051
1051
|
}
|
|
1052
1052
|
if ((l2 = /** @type {Element} */
|
|
1053
1053
|
a2[c2] || e2.target) !== n2) {
|
|
1054
|
-
|
|
1054
|
+
s(e2, "currentTarget", {
|
|
1055
1055
|
configurable: true,
|
|
1056
|
-
get: () => l2 ||
|
|
1056
|
+
get: () => l2 || i2
|
|
1057
1057
|
});
|
|
1058
1058
|
var p2 = R, g2 = V;
|
|
1059
1059
|
set_active_reaction(null), set_active_effect(null);
|
|
@@ -1102,15 +1102,15 @@ function assign_nodes(e2, t2) {
|
|
|
1102
1102
|
}
|
|
1103
1103
|
// @__NO_SIDE_EFFECTS__
|
|
1104
1104
|
function template(e2, t2) {
|
|
1105
|
-
var n2,
|
|
1105
|
+
var n2, i2 = !!(1 & t2), s2 = !!(2 & t2), o2 = !e2.startsWith("<!>");
|
|
1106
1106
|
return () => {
|
|
1107
|
-
void 0 === n2 && (n2 = create_fragment_from_html(o2 ? e2 : "<!>" + e2),
|
|
1107
|
+
void 0 === n2 && (n2 = create_fragment_from_html(o2 ? e2 : "<!>" + e2), i2 || (n2 = /** @type {Node} */
|
|
1108
1108
|
/* @__PURE__ */ get_first_child(n2)));
|
|
1109
1109
|
var t3 = (
|
|
1110
1110
|
/** @type {TemplateNode} */
|
|
1111
|
-
|
|
1111
|
+
s2 || W ? document.importNode(n2, true) : n2.cloneNode(true)
|
|
1112
1112
|
);
|
|
1113
|
-
|
|
1113
|
+
i2 ? assign_nodes(
|
|
1114
1114
|
/** @type {TemplateNode} */
|
|
1115
1115
|
/* @__PURE__ */ get_first_child(t3),
|
|
1116
1116
|
/** @type {TemplateNode} */
|
|
@@ -1121,22 +1121,22 @@ function template(e2, t2) {
|
|
|
1121
1121
|
}
|
|
1122
1122
|
// @__NO_SIDE_EFFECTS__
|
|
1123
1123
|
function ns_template(e2, t2, n2 = "svg") {
|
|
1124
|
-
var
|
|
1124
|
+
var i2, s2 = `<${n2}>${!e2.startsWith("<!>") ? e2 : "<!>" + e2}</${n2}>`;
|
|
1125
1125
|
return () => {
|
|
1126
|
-
if (!
|
|
1126
|
+
if (!i2) {
|
|
1127
1127
|
var e3 = (
|
|
1128
1128
|
/** @type {Element} */
|
|
1129
1129
|
/* @__PURE__ */ get_first_child(
|
|
1130
1130
|
/** @type {DocumentFragment} */
|
|
1131
|
-
create_fragment_from_html(
|
|
1131
|
+
create_fragment_from_html(s2)
|
|
1132
1132
|
)
|
|
1133
1133
|
);
|
|
1134
|
-
|
|
1134
|
+
i2 = /** @type {Element} */
|
|
1135
1135
|
/* @__PURE__ */ get_first_child(e3);
|
|
1136
1136
|
}
|
|
1137
1137
|
var t3 = (
|
|
1138
1138
|
/** @type {TemplateNode} */
|
|
1139
|
-
|
|
1139
|
+
i2.cloneNode(true)
|
|
1140
1140
|
);
|
|
1141
1141
|
return assign_nodes(t3, t3), t3;
|
|
1142
1142
|
};
|
|
@@ -1165,7 +1165,7 @@ function set_text(e2, t2) {
|
|
|
1165
1165
|
(e2.__t = n2, e2.nodeValue = n2 + "");
|
|
1166
1166
|
}
|
|
1167
1167
|
function mount(e2, t2) {
|
|
1168
|
-
return function _mount(e3, { target: t3, anchor: n2, props:
|
|
1168
|
+
return function _mount(e3, { target: t3, anchor: n2, props: s2 = {}, events: a2, context: l2, intro: c2 = true }) {
|
|
1169
1169
|
!/**
|
|
1170
1170
|
* Initialize these lazily to avoid issues when using the runtime in a server context
|
|
1171
1171
|
* where these globals are not available while avoiding a separate server entry point
|
|
@@ -1174,8 +1174,8 @@ function mount(e2, t2) {
|
|
|
1174
1174
|
if (void 0 === P) {
|
|
1175
1175
|
P = window, z = document, W = /Firefox/.test(navigator.userAgent);
|
|
1176
1176
|
var e4 = Element.prototype, t4 = Node.prototype, n3 = Text.prototype;
|
|
1177
|
-
|
|
1178
|
-
|
|
1177
|
+
E = o(t4, "firstChild").get, // @ts-ignore
|
|
1178
|
+
j = 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
|
|
@@ -1187,25 +1187,25 @@ function mount(e2, t2) {
|
|
|
1187
1187
|
}();
|
|
1188
1188
|
var u2 = /* @__PURE__ */ new Set(), event_handle = (e4) => {
|
|
1189
1189
|
for (var n3 = 0; n3 < e4.length; n3++) {
|
|
1190
|
-
var
|
|
1191
|
-
if (!u2.has(
|
|
1192
|
-
u2.add(
|
|
1193
|
-
var
|
|
1194
|
-
t3.addEventListener(
|
|
1195
|
-
passive:
|
|
1190
|
+
var i2 = e4[n3];
|
|
1191
|
+
if (!u2.has(i2)) {
|
|
1192
|
+
u2.add(i2);
|
|
1193
|
+
var s3 = is_passive_event(i2);
|
|
1194
|
+
t3.addEventListener(i2, handle_event_propagation, {
|
|
1195
|
+
passive: s3
|
|
1196
1196
|
});
|
|
1197
|
-
var o2 = ue.get(
|
|
1197
|
+
var o2 = ue.get(i2);
|
|
1198
1198
|
void 0 === o2 ? (
|
|
1199
1199
|
// The document listener ensures we catch events that originate from elements that were
|
|
1200
1200
|
// manually moved outside of the container (e.g. via manual portals).
|
|
1201
|
-
(document.addEventListener(
|
|
1202
|
-
passive:
|
|
1203
|
-
}), ue.set(
|
|
1204
|
-
) : ue.set(
|
|
1201
|
+
(document.addEventListener(i2, handle_event_propagation, {
|
|
1202
|
+
passive: s3
|
|
1203
|
+
}), ue.set(i2, 1))
|
|
1204
|
+
) : ue.set(i2, o2 + 1);
|
|
1205
1205
|
}
|
|
1206
1206
|
}
|
|
1207
1207
|
};
|
|
1208
|
-
event_handle(
|
|
1208
|
+
event_handle(i(ae)), le.add(event_handle);
|
|
1209
1209
|
var f2 = void 0, g2 = (
|
|
1210
1210
|
/**
|
|
1211
1211
|
* An effect root whose children can transition out
|
|
@@ -1220,25 +1220,25 @@ function mount(e2, t2) {
|
|
|
1220
1220
|
}) : (destroy_effect(t4), n3(void 0));
|
|
1221
1221
|
});
|
|
1222
1222
|
}(() => {
|
|
1223
|
-
var
|
|
1223
|
+
var i2 = 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
|
-
(
|
|
1230
|
-
f2 = e3(
|
|
1229
|
+
(s2.$$events = a2), ce = c2, // @ts-expect-error the public typings are not what the actual function looks like
|
|
1230
|
+
f2 = e3(i2, s2) || {}, ce = true, l2 && pop();
|
|
1231
1231
|
}), () => {
|
|
1232
1232
|
var _a2;
|
|
1233
1233
|
for (var e4 of u2) {
|
|
1234
1234
|
t3.removeEventListener(e4, handle_event_propagation);
|
|
1235
|
-
var
|
|
1235
|
+
var s3 = (
|
|
1236
1236
|
/** @type {number} */
|
|
1237
1237
|
ue.get(e4)
|
|
1238
1238
|
);
|
|
1239
|
-
0 == --
|
|
1239
|
+
0 == --s3 ? (document.removeEventListener(e4, handle_event_propagation), ue.delete(e4)) : ue.set(e4, s3);
|
|
1240
1240
|
}
|
|
1241
|
-
le.delete(event_handle),
|
|
1241
|
+
le.delete(event_handle), i2 !== n2 && ((_a2 = i2.parentNode) == null ? void 0 : _a2.removeChild(i2));
|
|
1242
1242
|
};
|
|
1243
1243
|
})
|
|
1244
1244
|
);
|
|
@@ -1247,14 +1247,14 @@ function mount(e2, t2) {
|
|
|
1247
1247
|
}
|
|
1248
1248
|
const ue = /* @__PURE__ */ new Map();
|
|
1249
1249
|
let de = /* @__PURE__ */ new WeakMap();
|
|
1250
|
-
function if_block(e2, t2, [n2,
|
|
1251
|
-
var
|
|
1250
|
+
function if_block(e2, t2, [n2, i2] = [0, 0]) {
|
|
1251
|
+
var s2 = e2, o2 = null, a2 = null, l2 = T, c2 = false;
|
|
1252
1252
|
const set_branch = (e3, t3 = true) => {
|
|
1253
1253
|
c2 = true, update_branch(t3, e3);
|
|
1254
1254
|
}, update_branch = (e3, t3) => {
|
|
1255
|
-
l2 !== (l2 = e3) && (l2 ? (o2 ? resume_effect(o2) : t3 && (o2 = branch(() => t3(
|
|
1255
|
+
l2 !== (l2 = e3) && (l2 ? (o2 ? resume_effect(o2) : t3 && (o2 = branch(() => t3(s2))), a2 && pause_effect(a2, () => {
|
|
1256
1256
|
a2 = null;
|
|
1257
|
-
})) : (a2 ? resume_effect(a2) : t3 && (a2 = branch(() => t3(
|
|
1257
|
+
})) : (a2 ? resume_effect(a2) : t3 && (a2 = branch(() => t3(s2, [n2 + 1, i2]))), o2 && pause_effect(o2, () => {
|
|
1258
1258
|
o2 = null;
|
|
1259
1259
|
})));
|
|
1260
1260
|
};
|
|
@@ -1269,7 +1269,7 @@ function set_current_each_item(e2) {
|
|
|
1269
1269
|
function index(e2, t2) {
|
|
1270
1270
|
return t2;
|
|
1271
1271
|
}
|
|
1272
|
-
function each(e2, n2,
|
|
1272
|
+
function each(e2, n2, s2, o2, a2, l2 = null) {
|
|
1273
1273
|
var c2 = e2, u2 = {
|
|
1274
1274
|
flags: n2,
|
|
1275
1275
|
items: /* @__PURE__ */ new Map(),
|
|
@@ -1278,8 +1278,8 @@ function each(e2, n2, i2, o2, a2, l2 = null) {
|
|
|
1278
1278
|
!(4 & n2) || (c2 = /** @type {Element} */
|
|
1279
1279
|
e2.appendChild(create_text()));
|
|
1280
1280
|
var d2 = null, f2 = false, p2 = /* @__PURE__ */ derived_safe_equal(() => {
|
|
1281
|
-
var e3 =
|
|
1282
|
-
return t(e3) ? e3 : null == e3 ? [] :
|
|
1281
|
+
var e3 = s2();
|
|
1282
|
+
return t(e3) ? e3 : null == e3 ? [] : i(e3);
|
|
1283
1283
|
});
|
|
1284
1284
|
block(() => {
|
|
1285
1285
|
var e3 = get$1(p2), t2 = e3.length;
|
|
@@ -1295,7 +1295,7 @@ function each(e2, n2, i2, o2, a2, l2 = null) {
|
|
|
1295
1295
|
* @param {() => V[]} get_collection
|
|
1296
1296
|
* @returns {void}
|
|
1297
1297
|
*/
|
|
1298
|
-
function reconcile(e4, t3, n3,
|
|
1298
|
+
function reconcile(e4, t3, n3, s3, o3, a3, l3) {
|
|
1299
1299
|
var _a2, _b2, _c2, _d;
|
|
1300
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
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));
|
|
@@ -1305,10 +1305,10 @@ function each(e2, n2, i2, o2, a2, l2 = null) {
|
|
|
1305
1305
|
if (x2.length < k2.length) {
|
|
1306
1306
|
var C2, S2 = k2[0];
|
|
1307
1307
|
w2 = S2.prev;
|
|
1308
|
-
var
|
|
1308
|
+
var I2 = x2[0], M2 = x2[x2.length - 1];
|
|
1309
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, I2.prev, M2.next), link(t3, w2, I2), link(t3, M2, S2), $2 = S2, w2 = M2, 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,21 +1323,21 @@ 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, g2,
|
|
1326
|
+
) : n3, t3, w2, null === w2 ? t3.first : w2.next, d3, f3, g2, s3, 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 O2 =
|
|
1329
|
+
for (var T2 = void 0 === c3 ? [] : i(c3); null !== $2; )
|
|
1330
|
+
$2.e.f & y || T2.push($2), $2 = $2.next;
|
|
1331
|
+
var O2 = T2.length;
|
|
1332
1332
|
if (O2 > 0) {
|
|
1333
1333
|
var q2 = 4 & o3 && 0 === h2 ? n3 : null;
|
|
1334
1334
|
if (_2) {
|
|
1335
|
-
for (g2 = 0; g2 < O2; g2 += 1) (_c2 =
|
|
1336
|
-
for (g2 = 0; g2 < O2; g2 += 1) (_d =
|
|
1335
|
+
for (g2 = 0; g2 < O2; g2 += 1) (_c2 = T2[g2].a) == null ? void 0 : _c2.measure();
|
|
1336
|
+
for (g2 = 0; g2 < O2; g2 += 1) (_d = T2[g2].a) == null ? void 0 : _d.fix();
|
|
1337
1337
|
}
|
|
1338
|
-
!function pause_effects(e5, t4, n4,
|
|
1339
|
-
for (var
|
|
1340
|
-
var l4 = o4 > 0 && 0 ===
|
|
1338
|
+
!function pause_effects(e5, t4, n4, i2) {
|
|
1339
|
+
for (var s4 = [], o4 = t4.length, a4 = 0; a4 < o4; a4++) pause_children(t4[a4].e, s4, true);
|
|
1340
|
+
var l4 = o4 > 0 && 0 === s4.length && null !== n4;
|
|
1341
1341
|
if (l4) {
|
|
1342
1342
|
var c4 = (
|
|
1343
1343
|
/** @type {Element} */
|
|
@@ -1349,15 +1349,15 @@ function each(e2, n2, i2, o2, a2, l2 = null) {
|
|
|
1349
1349
|
}(c4), c4.append(
|
|
1350
1350
|
/** @type {Element} */
|
|
1351
1351
|
n4
|
|
1352
|
-
),
|
|
1352
|
+
), i2.clear(), link(e5, t4[0].prev, t4[o4 - 1].next);
|
|
1353
1353
|
}
|
|
1354
|
-
run_out_transitions(
|
|
1354
|
+
run_out_transitions(s4, () => {
|
|
1355
1355
|
for (var n5 = 0; n5 < o4; n5++) {
|
|
1356
|
-
var
|
|
1357
|
-
l4 || (
|
|
1356
|
+
var s5 = t4[n5];
|
|
1357
|
+
l4 || (i2.delete(s5.k), link(e5, s5.prev, s5.next)), destroy_effect(s5.e, !l4);
|
|
1358
1358
|
}
|
|
1359
1359
|
});
|
|
1360
|
-
}(t3,
|
|
1360
|
+
}(t3, T2, q2, m2);
|
|
1361
1361
|
}
|
|
1362
1362
|
}
|
|
1363
1363
|
_2 && queue_micro_task(() => {
|
|
@@ -1366,7 +1366,7 @@ function each(e2, n2, i2, o2, a2, l2 = null) {
|
|
|
1366
1366
|
});
|
|
1367
1367
|
V.first = t3.first && t3.first.e, /** @type {Effect} */
|
|
1368
1368
|
V.last = w2 && w2.e;
|
|
1369
|
-
}(e3, u2, c2, a2, n2, o2,
|
|
1369
|
+
}(e3, u2, c2, a2, n2, o2, s2), null !== l2 && (0 === t2 ? d2 ? resume_effect(d2) : d2 = branch(() => l2(c2)) : null !== d2 && pause_effect(d2, () => {
|
|
1370
1370
|
d2 = null;
|
|
1371
1371
|
})), // When we mount the each block for the first time, the collection won't be
|
|
1372
1372
|
// connected to this effect as the effect hasn't finished running yet and its deps
|
|
@@ -1377,15 +1377,15 @@ function each(e2, n2, i2, o2, a2, l2 = null) {
|
|
|
1377
1377
|
get$1(p2));
|
|
1378
1378
|
});
|
|
1379
1379
|
}
|
|
1380
|
-
function update_item(e2, t2, n2,
|
|
1381
|
-
1 &
|
|
1380
|
+
function update_item(e2, t2, n2, i2) {
|
|
1381
|
+
1 & i2 && internal_set(e2.v, t2), 2 & i2 ? internal_set(
|
|
1382
1382
|
/** @type {Value<number>} */
|
|
1383
1383
|
e2.i,
|
|
1384
1384
|
n2
|
|
1385
1385
|
) : e2.i = n2;
|
|
1386
1386
|
}
|
|
1387
|
-
function create_item(e2, t2, n2,
|
|
1388
|
-
var d2 = fe, f2 = !!(1 & c2) ? !(16 & c2) ? /* @__PURE__ */ mutable_source(
|
|
1387
|
+
function create_item(e2, t2, n2, i2, s2, o2, a2, l2, c2, u2) {
|
|
1388
|
+
var d2 = fe, f2 = !!(1 & c2) ? !(16 & c2) ? /* @__PURE__ */ mutable_source(s2) : source(s2) : s2, p2 = 2 & c2 ? source(a2) : a2, g2 = {
|
|
1389
1389
|
i: p2,
|
|
1390
1390
|
v: f2,
|
|
1391
1391
|
k: o2,
|
|
@@ -1393,111 +1393,111 @@ function create_item(e2, t2, n2, s2, i2, o2, a2, l2, c2, u2) {
|
|
|
1393
1393
|
// @ts-expect-error
|
|
1394
1394
|
e: null,
|
|
1395
1395
|
prev: n2,
|
|
1396
|
-
next:
|
|
1396
|
+
next: i2
|
|
1397
1397
|
};
|
|
1398
1398
|
fe = g2;
|
|
1399
1399
|
try {
|
|
1400
|
-
return g2.e = branch(() => l2(e2, f2, p2, u2), false), g2.e.prev = n2 && n2.e, g2.e.next =
|
|
1400
|
+
return g2.e = branch(() => l2(e2, f2, p2, u2), false), g2.e.prev = n2 && n2.e, g2.e.next = i2 && i2.e, null === n2 ? t2.first = g2 : (n2.next = g2, n2.e.next = g2.e), null !== i2 && (i2.prev = g2, i2.e.prev = g2.e), g2;
|
|
1401
1401
|
} finally {
|
|
1402
1402
|
fe = d2;
|
|
1403
1403
|
}
|
|
1404
1404
|
}
|
|
1405
1405
|
function move(e2, t2, n2) {
|
|
1406
|
-
for (var
|
|
1406
|
+
for (var i2 = e2.next ? (
|
|
1407
1407
|
/** @type {TemplateNode} */
|
|
1408
1408
|
e2.next.e.nodes_start
|
|
1409
|
-
) : n2,
|
|
1409
|
+
) : n2, s2 = t2 ? (
|
|
1410
1410
|
/** @type {TemplateNode} */
|
|
1411
1411
|
t2.e.nodes_start
|
|
1412
1412
|
) : n2, o2 = (
|
|
1413
1413
|
/** @type {TemplateNode} */
|
|
1414
1414
|
e2.e.nodes_start
|
|
1415
|
-
); o2 !==
|
|
1415
|
+
); o2 !== i2; ) {
|
|
1416
1416
|
var a2 = (
|
|
1417
1417
|
/** @type {TemplateNode} */
|
|
1418
1418
|
/* @__PURE__ */ get_next_sibling(o2)
|
|
1419
1419
|
);
|
|
1420
|
-
|
|
1420
|
+
s2.before(o2), o2 = a2;
|
|
1421
1421
|
}
|
|
1422
1422
|
}
|
|
1423
1423
|
function link(e2, t2, n2) {
|
|
1424
1424
|
null === t2 ? e2.first = n2 : (t2.next = n2, t2.e.next = n2 && n2.e), null !== n2 && (n2.prev = t2, n2.e.prev = t2 && t2.e);
|
|
1425
1425
|
}
|
|
1426
|
-
function slot(e2, t2, n2,
|
|
1426
|
+
function slot(e2, t2, n2, i2, s2) {
|
|
1427
1427
|
var _a2;
|
|
1428
1428
|
var o2 = (_a2 = t2.$$slots) == null ? void 0 : _a2[n2], a2 = false;
|
|
1429
|
-
true === o2 && (o2 = t2["default" === n2 ? "children" : n2], a2 = true), void 0 === o2 ? null !==
|
|
1429
|
+
true === o2 && (o2 = t2["default" === n2 ? "children" : n2], a2 = true), void 0 === o2 ? null !== s2 && s2(e2) : o2(e2, a2 ? () => i2 : i2);
|
|
1430
1430
|
}
|
|
1431
1431
|
function component(e2, t2, n2) {
|
|
1432
|
-
var
|
|
1432
|
+
var i2, s2, o2 = e2;
|
|
1433
1433
|
block(() => {
|
|
1434
|
-
|
|
1434
|
+
i2 !== (i2 = t2()) && (s2 && (pause_effect(s2), s2 = null), i2 && (s2 = branch(() => n2(o2, i2))));
|
|
1435
1435
|
}, w);
|
|
1436
1436
|
}
|
|
1437
1437
|
function r(e2) {
|
|
1438
|
-
var t2, n2,
|
|
1439
|
-
if ("string" == typeof e2 || "number" == typeof e2)
|
|
1438
|
+
var t2, n2, i2 = "";
|
|
1439
|
+
if ("string" == typeof e2 || "number" == typeof e2) i2 += e2;
|
|
1440
1440
|
else if ("object" == typeof e2) if (Array.isArray(e2)) {
|
|
1441
|
-
var
|
|
1442
|
-
for (t2 = 0; t2 <
|
|
1443
|
-
} else for (n2 in e2) e2[n2] && (
|
|
1444
|
-
return
|
|
1441
|
+
var s2 = e2.length;
|
|
1442
|
+
for (t2 = 0; t2 < s2; t2++) e2[t2] && (n2 = r(e2[t2])) && (i2 && (i2 += " "), i2 += n2);
|
|
1443
|
+
} else for (n2 in e2) e2[n2] && (i2 && (i2 += " "), i2 += n2);
|
|
1444
|
+
return i2;
|
|
1445
1445
|
}
|
|
1446
1446
|
function clsx(e2) {
|
|
1447
1447
|
return "object" == typeof e2 ? function clsx$1() {
|
|
1448
|
-
for (var e3, t2, n2 = 0,
|
|
1449
|
-
return
|
|
1448
|
+
for (var e3, t2, n2 = 0, i2 = "", s2 = arguments.length; n2 < s2; n2++) (e3 = arguments[n2]) && (t2 = r(e3)) && (i2 && (i2 += " "), i2 += t2);
|
|
1449
|
+
return i2;
|
|
1450
1450
|
}(e2) : e2 ?? "";
|
|
1451
1451
|
}
|
|
1452
1452
|
const pe = [..." \n\r\f \v\uFEFF"];
|
|
1453
1453
|
function append_styles(e2, t2 = false) {
|
|
1454
|
-
var n2 = t2 ? " !important;" : ";",
|
|
1455
|
-
for (var
|
|
1456
|
-
var o2 = e2[
|
|
1457
|
-
null != o2 && "" !== o2 && (
|
|
1454
|
+
var n2 = t2 ? " !important;" : ";", i2 = "";
|
|
1455
|
+
for (var s2 in e2) {
|
|
1456
|
+
var o2 = e2[s2];
|
|
1457
|
+
null != o2 && "" !== o2 && (i2 += " " + s2 + ": " + o2 + n2);
|
|
1458
1458
|
}
|
|
1459
|
-
return
|
|
1459
|
+
return i2;
|
|
1460
1460
|
}
|
|
1461
1461
|
function to_css_name(e2) {
|
|
1462
1462
|
return "-" !== e2[0] || "-" !== e2[1] ? e2.toLowerCase() : e2;
|
|
1463
1463
|
}
|
|
1464
|
-
function set_class(e2, t2, n2,
|
|
1464
|
+
function set_class(e2, t2, n2, i2, s2, o2) {
|
|
1465
1465
|
var a2 = e2.__className;
|
|
1466
1466
|
if (a2 !== n2 || void 0 === a2) {
|
|
1467
1467
|
var l2 = function to_class(e3, t3, n3) {
|
|
1468
|
-
var
|
|
1469
|
-
if (t3 && (
|
|
1470
|
-
for (var
|
|
1471
|
-
else if (
|
|
1468
|
+
var i3 = null == e3 ? "" : "" + e3;
|
|
1469
|
+
if (t3 && (i3 = i3 ? i3 + " " + t3 : t3), n3) {
|
|
1470
|
+
for (var s3 in n3) if (n3[s3]) i3 = i3 ? i3 + " " + s3 : s3;
|
|
1471
|
+
else if (i3.length) for (var o3 = s3.length, a3 = 0; (a3 = i3.indexOf(s3, a3)) >= 0; ) {
|
|
1472
1472
|
var l3 = a3 + o3;
|
|
1473
|
-
0 !== a3 && !pe.includes(
|
|
1473
|
+
0 !== a3 && !pe.includes(i3[a3 - 1]) || l3 !== i3.length && !pe.includes(i3[l3]) ? a3 = l3 : i3 = (0 === a3 ? "" : i3.substring(0, a3)) + i3.substring(l3 + 1);
|
|
1474
1474
|
}
|
|
1475
1475
|
}
|
|
1476
|
-
return "" ===
|
|
1477
|
-
}(n2,
|
|
1476
|
+
return "" === i3 ? null : i3;
|
|
1477
|
+
}(n2, i2, o2);
|
|
1478
1478
|
null == l2 ? e2.removeAttribute("class") : t2 ? e2.className = l2 : e2.setAttribute("class", l2), // @ts-expect-error need to add __className to patched prototype
|
|
1479
1479
|
e2.__className = n2;
|
|
1480
|
-
} else if (o2 &&
|
|
1480
|
+
} else if (o2 && s2 !== o2) for (var c2 in o2) {
|
|
1481
1481
|
var u2 = !!o2[c2];
|
|
1482
|
-
null !=
|
|
1482
|
+
null != s2 && u2 === !!s2[c2] || e2.classList.toggle(c2, u2);
|
|
1483
1483
|
}
|
|
1484
1484
|
return o2;
|
|
1485
1485
|
}
|
|
1486
|
-
function update_styles(e2, t2 = {}, n2,
|
|
1487
|
-
for (var
|
|
1488
|
-
var o2 = n2[
|
|
1489
|
-
t2[
|
|
1486
|
+
function update_styles(e2, t2 = {}, n2, i2) {
|
|
1487
|
+
for (var s2 in n2) {
|
|
1488
|
+
var o2 = n2[s2];
|
|
1489
|
+
t2[s2] !== o2 && (null == n2[s2] ? e2.style.removeProperty(s2) : e2.style.setProperty(s2, o2, i2));
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
|
-
function set_style(e2, t2, n2,
|
|
1492
|
+
function set_style(e2, t2, n2, i2) {
|
|
1493
1493
|
if (e2.__style !== t2) {
|
|
1494
|
-
var
|
|
1494
|
+
var s2 = function to_style(e3, t3) {
|
|
1495
1495
|
if (t3) {
|
|
1496
|
-
var n3,
|
|
1497
|
-
if (Array.isArray(t3) ? (n3 = t3[0],
|
|
1496
|
+
var n3, i3, s3 = "";
|
|
1497
|
+
if (Array.isArray(t3) ? (n3 = t3[0], i3 = t3[1]) : n3 = t3, e3) {
|
|
1498
1498
|
e3 = String(e3).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
|
|
1499
1499
|
var o2 = false, a2 = 0, l2 = false, c2 = [];
|
|
1500
|
-
n3 && c2.push(...Object.keys(n3).map(to_css_name)),
|
|
1500
|
+
n3 && c2.push(...Object.keys(n3).map(to_css_name)), i3 && c2.push(...Object.keys(i3).map(to_css_name));
|
|
1501
1501
|
var u2 = 0, d2 = -1;
|
|
1502
1502
|
const t4 = e3.length;
|
|
1503
1503
|
for (var f2 = 0; f2 < t4; f2++) {
|
|
@@ -1507,21 +1507,21 @@ function set_style(e2, t2, n2, s2) {
|
|
|
1507
1507
|
else if (";" === p2 || f2 === t4 - 1) {
|
|
1508
1508
|
if (-1 !== d2) {
|
|
1509
1509
|
var g2 = to_css_name(e3.substring(u2, d2).trim());
|
|
1510
|
-
c2.includes(g2) || (";" !== p2 && f2++,
|
|
1510
|
+
c2.includes(g2) || (";" !== p2 && f2++, s3 += " " + e3.substring(u2, f2).trim() + ";");
|
|
1511
1511
|
}
|
|
1512
1512
|
u2 = f2 + 1, d2 = -1;
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
1515
1515
|
}
|
|
1516
1516
|
}
|
|
1517
|
-
return n3 && (
|
|
1517
|
+
return n3 && (s3 += append_styles(n3)), i3 && (s3 += append_styles(i3, true)), "" === (s3 = s3.trim()) ? null : s3;
|
|
1518
1518
|
}
|
|
1519
1519
|
return null == e3 ? null : String(e3);
|
|
1520
|
-
}(t2,
|
|
1521
|
-
null ==
|
|
1520
|
+
}(t2, i2);
|
|
1521
|
+
null == s2 ? e2.removeAttribute("style") : e2.style.cssText = s2, // @ts-expect-error
|
|
1522
1522
|
e2.__style = t2;
|
|
1523
|
-
} else
|
|
1524
|
-
return
|
|
1523
|
+
} else i2 && (Array.isArray(i2) ? (update_styles(e2, n2 == null ? void 0 : n2[0], i2[0]), update_styles(e2, n2 == null ? void 0 : n2[1], i2[1], "important")) : update_styles(e2, n2, i2));
|
|
1524
|
+
return i2;
|
|
1525
1525
|
}
|
|
1526
1526
|
const ge = Symbol("class"), _e = Symbol("style"), ve = Symbol("is custom element"), he = Symbol("is html");
|
|
1527
1527
|
function set_selected(e2, t2) {
|
|
@@ -1531,18 +1531,18 @@ function set_selected(e2, t2) {
|
|
|
1531
1531
|
e2.hasAttribute("selected") || e2.setAttribute("selected", "")
|
|
1532
1532
|
) : e2.removeAttribute("selected");
|
|
1533
1533
|
}
|
|
1534
|
-
function set_attribute(e2, t2, n2,
|
|
1535
|
-
var
|
|
1536
|
-
|
|
1537
|
-
(e2[
|
|
1534
|
+
function set_attribute(e2, t2, n2, i2) {
|
|
1535
|
+
var s2 = get_attributes(e2);
|
|
1536
|
+
s2[t2] !== (s2[t2] = n2) && ("loading" === t2 && // @ts-expect-error
|
|
1537
|
+
(e2[I] = 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));
|
|
1541
1541
|
}
|
|
1542
|
-
function set_attributes(e2, t2, n2,
|
|
1542
|
+
function set_attributes(e2, t2, n2, i2, s2 = 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) : (
|
|
1545
|
+
n2.class ? n2.class = clsx(n2.class) : (i2 || 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];
|
|
@@ -1611,7 +1611,7 @@ function set_attributes(e2, t2, n2, s2, i2 = false) {
|
|
|
1611
1611
|
e2.value = e2.__value = b2;
|
|
1612
1612
|
}
|
|
1613
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,
|
|
1614
|
+
else set_class(e2, "http://www.w3.org/1999/xhtml" === e2.namespaceURI, b2, i2, t2 == null ? void 0 : t2[ge], n2[ge]), c2[m2] = b2, c2[ge] = n2[ge];
|
|
1615
1615
|
}
|
|
1616
1616
|
return c2;
|
|
1617
1617
|
}
|
|
@@ -1626,9 +1626,9 @@ function get_setters(e2) {
|
|
|
1626
1626
|
var t2, n2 = me.get(e2.nodeName);
|
|
1627
1627
|
if (n2) return n2;
|
|
1628
1628
|
me.set(e2.nodeName, n2 = []);
|
|
1629
|
-
for (var
|
|
1630
|
-
for (var o2 in t2 = a(
|
|
1631
|
-
|
|
1629
|
+
for (var i2 = e2, s2 = Element.prototype; s2 !== i2; ) {
|
|
1630
|
+
for (var o2 in t2 = a(i2)) t2[o2].set && n2.push(o2);
|
|
1631
|
+
i2 = u(i2);
|
|
1632
1632
|
}
|
|
1633
1633
|
return n2;
|
|
1634
1634
|
}
|
|
@@ -1667,20 +1667,20 @@ function css_property_to_camelcase(e2) {
|
|
|
1667
1667
|
function css_to_keyframe(e2) {
|
|
1668
1668
|
const t2 = {}, n2 = e2.split(";");
|
|
1669
1669
|
for (const e3 of n2) {
|
|
1670
|
-
const [n3,
|
|
1671
|
-
if (!n3 || void 0 ===
|
|
1672
|
-
t2[css_property_to_camelcase(n3.trim())] =
|
|
1670
|
+
const [n3, i2] = e3.split(":");
|
|
1671
|
+
if (!n3 || void 0 === i2) break;
|
|
1672
|
+
t2[css_property_to_camelcase(n3.trim())] = i2.trim();
|
|
1673
1673
|
}
|
|
1674
1674
|
return t2;
|
|
1675
1675
|
}
|
|
1676
1676
|
const linear$1 = (e2) => e2;
|
|
1677
|
-
function transition(e2, t2, n2,
|
|
1678
|
-
var
|
|
1677
|
+
function transition(e2, t2, n2, i2) {
|
|
1678
|
+
var s2, o2, a2, l2 = !!(1 & e2), c2 = !!(2 & e2), u2 = !!(4 & e2), d2 = l2 && c2 ? "both" : l2 ? "in" : "out", f2 = t2.inert, p2 = t2.style.overflow;
|
|
1679
1679
|
function get_options() {
|
|
1680
1680
|
var e3 = R, o3 = V;
|
|
1681
1681
|
set_active_reaction(null), set_active_effect(null);
|
|
1682
1682
|
try {
|
|
1683
|
-
return
|
|
1683
|
+
return s2 ?? (s2 = n2()(t2, (i2 == null ? void 0 : i2()) ?? /** @type {P} */
|
|
1684
1684
|
{}, {
|
|
1685
1685
|
direction: d2
|
|
1686
1686
|
}));
|
|
@@ -1697,11 +1697,11 @@ function transition(e2, t2, n2, s2) {
|
|
|
1697
1697
|
// if it's not a bidirectional transition
|
|
1698
1698
|
(o2 == null ? void 0 : o2.abort()), dispatch_event(t2, "introstart"), o2 = animate(t2, get_options(), a2, 1, () => {
|
|
1699
1699
|
dispatch_event(t2, "introend"), // Ensure we cancel the animation to prevent leaking
|
|
1700
|
-
o2 == null ? void 0 : o2.abort(), o2 =
|
|
1700
|
+
o2 == null ? void 0 : o2.abort(), o2 = s2 = void 0, t2.style.overflow = p2;
|
|
1701
1701
|
});
|
|
1702
1702
|
},
|
|
1703
1703
|
out(e3) {
|
|
1704
|
-
if (!c2) return e3 == null ? void 0 : e3(), void (
|
|
1704
|
+
if (!c2) return e3 == null ? void 0 : e3(), void (s2 = void 0);
|
|
1705
1705
|
t2.inert = true, dispatch_event(t2, "outrostart"), a2 = animate(t2, get_options(), o2, 0, () => {
|
|
1706
1706
|
dispatch_event(t2, "outroend"), e3 == null ? void 0 : e3();
|
|
1707
1707
|
});
|
|
@@ -1727,8 +1727,8 @@ function transition(e2, t2, n2, s2) {
|
|
|
1727
1727
|
});
|
|
1728
1728
|
}
|
|
1729
1729
|
}
|
|
1730
|
-
function animate(e2, t2, n2,
|
|
1731
|
-
var o2 = 1 ===
|
|
1730
|
+
function animate(e2, t2, n2, i2, s2) {
|
|
1731
|
+
var o2 = 1 === i2;
|
|
1732
1732
|
if (is_function(t2)) {
|
|
1733
1733
|
var a2, l2 = false;
|
|
1734
1734
|
return queue_micro_task(() => {
|
|
@@ -1736,7 +1736,7 @@ function animate(e2, t2, n2, s2, i2) {
|
|
|
1736
1736
|
var c3 = t2({
|
|
1737
1737
|
direction: o2 ? "in" : "out"
|
|
1738
1738
|
});
|
|
1739
|
-
a2 = animate(e2, c3, n2,
|
|
1739
|
+
a2 = animate(e2, c3, n2, i2, s2);
|
|
1740
1740
|
}
|
|
1741
1741
|
}), {
|
|
1742
1742
|
abort: () => {
|
|
@@ -1747,11 +1747,11 @@ function animate(e2, t2, n2, s2, i2) {
|
|
|
1747
1747
|
t: () => a2.t()
|
|
1748
1748
|
};
|
|
1749
1749
|
}
|
|
1750
|
-
if (n2 == null ? void 0 : n2.deactivate(), !(t2 == null ? void 0 : t2.duration)) return
|
|
1750
|
+
if (n2 == null ? void 0 : n2.deactivate(), !(t2 == null ? void 0 : t2.duration)) return s2(), {
|
|
1751
1751
|
abort: noop,
|
|
1752
1752
|
deactivate: noop,
|
|
1753
1753
|
reset: noop,
|
|
1754
|
-
t: () =>
|
|
1754
|
+
t: () => i2
|
|
1755
1755
|
};
|
|
1756
1756
|
const { delay: c2 = 0, css: u2, tick: d2, easing: f2 = linear$1 } = t2;
|
|
1757
1757
|
var p2 = [];
|
|
@@ -1759,13 +1759,13 @@ function animate(e2, t2, n2, s2, i2) {
|
|
|
1759
1759
|
var g2 = css_to_keyframe(u2(0, 1));
|
|
1760
1760
|
p2.push(g2, g2);
|
|
1761
1761
|
}
|
|
1762
|
-
var get_t = () => 1 -
|
|
1762
|
+
var get_t = () => 1 - i2, _2 = e2.animate(p2, {
|
|
1763
1763
|
duration: c2
|
|
1764
1764
|
});
|
|
1765
1765
|
return _2.onfinish = () => {
|
|
1766
|
-
var o3 = (n2 == null ? void 0 : n2.t()) ?? 1 -
|
|
1766
|
+
var o3 = (n2 == null ? void 0 : n2.t()) ?? 1 - i2;
|
|
1767
1767
|
n2 == null ? void 0 : n2.abort();
|
|
1768
|
-
var a3 =
|
|
1768
|
+
var a3 = i2 - o3, l3 = (
|
|
1769
1769
|
/** @type {number} */
|
|
1770
1770
|
t2.duration * Math.abs(a3)
|
|
1771
1771
|
), c3 = [];
|
|
@@ -1807,7 +1807,7 @@ function animate(e2, t2, n2, s2, i2) {
|
|
|
1807
1807
|
duration: l3,
|
|
1808
1808
|
fill: "forwards"
|
|
1809
1809
|
})).onfinish = () => {
|
|
1810
|
-
get_t = () =>
|
|
1810
|
+
get_t = () => i2, d2 == null ? void 0 : d2(i2, 1 - i2), s2();
|
|
1811
1811
|
};
|
|
1812
1812
|
}, {
|
|
1813
1813
|
abort: () => {
|
|
@@ -1818,10 +1818,10 @@ function animate(e2, t2, n2, s2, i2) {
|
|
|
1818
1818
|
_2.onfinish = noop);
|
|
1819
1819
|
},
|
|
1820
1820
|
deactivate: () => {
|
|
1821
|
-
|
|
1821
|
+
s2 = noop;
|
|
1822
1822
|
},
|
|
1823
1823
|
reset: () => {
|
|
1824
|
-
0 ===
|
|
1824
|
+
0 === i2 && (d2 == null ? void 0 : d2(1, 0));
|
|
1825
1825
|
},
|
|
1826
1826
|
t: () => get_t()
|
|
1827
1827
|
};
|
|
@@ -1879,19 +1879,19 @@ var ye = new ResizeObserverSingleton({
|
|
|
1879
1879
|
function is_bound_this(e2, t2) {
|
|
1880
1880
|
return e2 === t2 || (e2 == null ? void 0 : e2[C]) === t2;
|
|
1881
1881
|
}
|
|
1882
|
-
function bind_this(e2 = {}, t2, n2,
|
|
1882
|
+
function bind_this(e2 = {}, t2, n2, i2) {
|
|
1883
1883
|
return effect(() => {
|
|
1884
|
-
var
|
|
1884
|
+
var i3, s2;
|
|
1885
1885
|
return render_effect(() => {
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
e2 !== n2(...
|
|
1886
|
+
i3 = s2, // We only track changes to the parts, not the value itself to avoid unnecessary reruns.
|
|
1887
|
+
s2 = [], untrack(() => {
|
|
1888
|
+
e2 !== n2(...s2) && (t2(e2, ...s2), // If this is an effect rerun (cause: each block context changes), then nullfiy the binding at
|
|
1889
1889
|
// the previous position if it isn't already taken over by a different effect.
|
|
1890
|
-
|
|
1890
|
+
i3 && is_bound_this(n2(...i3), e2) && t2(null, ...i3));
|
|
1891
1891
|
});
|
|
1892
1892
|
}), () => {
|
|
1893
1893
|
queue_micro_task(() => {
|
|
1894
|
-
|
|
1894
|
+
s2 && is_bound_this(n2(...s2), e2) && t2(null, ...s2);
|
|
1895
1895
|
});
|
|
1896
1896
|
};
|
|
1897
1897
|
}), e2;
|
|
@@ -1908,13 +1908,13 @@ function init(e2 = false) {
|
|
|
1908
1908
|
/** @type {Record<string, any>} */
|
|
1909
1909
|
{}
|
|
1910
1910
|
);
|
|
1911
|
-
const
|
|
1912
|
-
let
|
|
1913
|
-
const
|
|
1914
|
-
for (const e4 in
|
|
1915
|
-
return
|
|
1911
|
+
const i2 = /* @__PURE__ */ derived(() => {
|
|
1912
|
+
let i3 = false;
|
|
1913
|
+
const s2 = t2.s;
|
|
1914
|
+
for (const e4 in s2) s2[e4] !== n3[e4] && (n3[e4] = s2[e4], i3 = true);
|
|
1915
|
+
return i3 && e3++, e3;
|
|
1916
1916
|
});
|
|
1917
|
-
props = () => get$1(
|
|
1917
|
+
props = () => get$1(i2);
|
|
1918
1918
|
}
|
|
1919
1919
|
n2.b.length && function user_pre_effect(e3) {
|
|
1920
1920
|
return validate_effect(), render_effect(e3);
|
|
@@ -1938,21 +1938,21 @@ function observe_all(e2, t2) {
|
|
|
1938
1938
|
function subscribe_to_store(e2, t2, n2) {
|
|
1939
1939
|
if (null == e2)
|
|
1940
1940
|
return t2(void 0), noop;
|
|
1941
|
-
const
|
|
1941
|
+
const i2 = untrack(() => e2.subscribe(
|
|
1942
1942
|
t2,
|
|
1943
1943
|
// @ts-expect-error
|
|
1944
1944
|
n2
|
|
1945
1945
|
));
|
|
1946
|
-
return
|
|
1946
|
+
return i2.unsubscribe ? () => i2.unsubscribe() : i2;
|
|
1947
1947
|
}
|
|
1948
1948
|
const $e = [];
|
|
1949
1949
|
function writable(e2, t2 = noop) {
|
|
1950
1950
|
let n2 = null;
|
|
1951
|
-
const
|
|
1951
|
+
const i2 = /* @__PURE__ */ new Set();
|
|
1952
1952
|
function set2(t3) {
|
|
1953
1953
|
if (safe_not_equal(e2, t3) && (e2 = t3, n2)) {
|
|
1954
1954
|
const t4 = !$e.length;
|
|
1955
|
-
for (const t5 of
|
|
1955
|
+
for (const t5 of i2) t5[1](), $e.push(t5, e2);
|
|
1956
1956
|
if (t4) {
|
|
1957
1957
|
for (let e3 = 0; e3 < $e.length; e3 += 2) $e[e3][0]($e[e3 + 1]);
|
|
1958
1958
|
$e.length = 0;
|
|
@@ -1968,13 +1968,13 @@ function writable(e2, t2 = noop) {
|
|
|
1968
1968
|
return {
|
|
1969
1969
|
set: set2,
|
|
1970
1970
|
update: update2,
|
|
1971
|
-
subscribe: function subscribe(
|
|
1972
|
-
const a2 = [
|
|
1973
|
-
return
|
|
1971
|
+
subscribe: function subscribe(s2, o2 = noop) {
|
|
1972
|
+
const a2 = [s2, o2];
|
|
1973
|
+
return i2.add(a2), 1 === i2.size && (n2 = t2(set2, update2) || noop), s2(
|
|
1974
1974
|
/** @type {T} */
|
|
1975
1975
|
e2
|
|
1976
1976
|
), () => {
|
|
1977
|
-
|
|
1977
|
+
i2.delete(a2), 0 === i2.size && n2 && (n2(), n2 = null);
|
|
1978
1978
|
};
|
|
1979
1979
|
}
|
|
1980
1980
|
};
|
|
@@ -1985,24 +1985,24 @@ function get(e2) {
|
|
|
1985
1985
|
}
|
|
1986
1986
|
let we = false, xe = Symbol();
|
|
1987
1987
|
function store_get(e2, t2, n2) {
|
|
1988
|
-
const
|
|
1988
|
+
const i2 = n2[t2] ?? (n2[t2] = {
|
|
1989
1989
|
store: null,
|
|
1990
1990
|
source: /* @__PURE__ */ mutable_source(void 0),
|
|
1991
1991
|
unsubscribe: noop
|
|
1992
1992
|
});
|
|
1993
|
-
if (
|
|
1994
|
-
|
|
1993
|
+
if (i2.store !== e2 && !(xe in n2)) if (i2.unsubscribe(), i2.store = e2 ?? null, null == e2) i2.source.v = void 0, // see synchronous callback comment below
|
|
1994
|
+
i2.unsubscribe = noop;
|
|
1995
1995
|
else {
|
|
1996
|
-
var
|
|
1997
|
-
|
|
1998
|
-
|
|
1996
|
+
var s2 = true;
|
|
1997
|
+
i2.unsubscribe = subscribe_to_store(e2, (e3) => {
|
|
1998
|
+
s2 ? (
|
|
1999
1999
|
// If the first updates to the store value (possibly multiple of them) are synchronously
|
|
2000
2000
|
// inside a derived, we will hit the `state_unsafe_mutation` error if we `set` the value
|
|
2001
|
-
|
|
2002
|
-
) : set(
|
|
2003
|
-
}),
|
|
2001
|
+
i2.source.v = e3
|
|
2002
|
+
) : set(i2.source, e3);
|
|
2003
|
+
}), s2 = false;
|
|
2004
2004
|
}
|
|
2005
|
-
return e2 && xe in n2 ? get(e2) : get$1(
|
|
2005
|
+
return e2 && xe in n2 ? get(e2) : get$1(i2.source);
|
|
2006
2006
|
}
|
|
2007
2007
|
function store_set(e2, t2) {
|
|
2008
2008
|
return e2.set(t2), t2;
|
|
@@ -2014,7 +2014,7 @@ function setup_stores() {
|
|
|
2014
2014
|
for (var t2 in e2) {
|
|
2015
2015
|
e2[t2].unsubscribe();
|
|
2016
2016
|
}
|
|
2017
|
-
|
|
2017
|
+
s(e2, xe, {
|
|
2018
2018
|
enumerable: false,
|
|
2019
2019
|
value: true
|
|
2020
2020
|
});
|
|
@@ -2063,16 +2063,16 @@ const Ce = {
|
|
|
2063
2063
|
get(e2, t2) {
|
|
2064
2064
|
let n2 = e2.props.length;
|
|
2065
2065
|
for (; n2--; ) {
|
|
2066
|
-
let
|
|
2067
|
-
if (is_function(
|
|
2066
|
+
let i2 = e2.props[n2];
|
|
2067
|
+
if (is_function(i2) && (i2 = i2()), "object" == typeof i2 && null !== i2 && t2 in i2) return i2[t2];
|
|
2068
2068
|
}
|
|
2069
2069
|
},
|
|
2070
2070
|
set(e2, t2, n2) {
|
|
2071
|
-
let
|
|
2072
|
-
for (;
|
|
2073
|
-
let
|
|
2074
|
-
is_function(
|
|
2075
|
-
const a2 = o(
|
|
2071
|
+
let i2 = e2.props.length;
|
|
2072
|
+
for (; i2--; ) {
|
|
2073
|
+
let s2 = e2.props[i2];
|
|
2074
|
+
is_function(s2) && (s2 = s2());
|
|
2075
|
+
const a2 = o(s2, t2);
|
|
2076
2076
|
if (a2 && a2.set) return a2.set(n2), true;
|
|
2077
2077
|
}
|
|
2078
2078
|
return false;
|
|
@@ -2080,9 +2080,9 @@ const Ce = {
|
|
|
2080
2080
|
getOwnPropertyDescriptor(e2, t2) {
|
|
2081
2081
|
let n2 = e2.props.length;
|
|
2082
2082
|
for (; n2--; ) {
|
|
2083
|
-
let
|
|
2084
|
-
if (is_function(
|
|
2085
|
-
const e3 = o(
|
|
2083
|
+
let i2 = e2.props[n2];
|
|
2084
|
+
if (is_function(i2) && (i2 = i2()), "object" == typeof i2 && null !== i2 && t2 in i2) {
|
|
2085
|
+
const e3 = o(i2, t2);
|
|
2086
2086
|
return e3 && !e3.configurable && // Prevent a "Non-configurability Report Error": The target is an array, it does
|
|
2087
2087
|
// not actually contain this property. If it is now described as non-configurable,
|
|
2088
2088
|
// the proxy throws a validation error. Setting it to true avoids that.
|
|
@@ -2113,10 +2113,10 @@ function has_destroyed_component_ctx(e2) {
|
|
|
2113
2113
|
var _a2;
|
|
2114
2114
|
return ((_a2 = e2.ctx) == null ? void 0 : _a2.d) ?? false;
|
|
2115
2115
|
}
|
|
2116
|
-
function prop(e2, t2, n2,
|
|
2116
|
+
function prop(e2, t2, n2, i2) {
|
|
2117
2117
|
var _a2;
|
|
2118
|
-
var
|
|
2119
|
-
c2 ? [
|
|
2118
|
+
var s2, a2 = !!(1 & n2), l2 = !M || !!(2 & n2), c2 = !!(8 & n2), u2 = !!(16 & n2), d2 = false;
|
|
2119
|
+
c2 ? [s2, d2] = function capture_store_binding(e3) {
|
|
2120
2120
|
var t3 = we;
|
|
2121
2121
|
try {
|
|
2122
2122
|
return we = false, [e3(), we];
|
|
@@ -2126,21 +2126,21 @@ function prop(e2, t2, n2, s2) {
|
|
|
2126
2126
|
}(() => (
|
|
2127
2127
|
/** @type {V} */
|
|
2128
2128
|
e2[t2]
|
|
2129
|
-
)) :
|
|
2129
|
+
)) : s2 = /** @type {V} */
|
|
2130
2130
|
e2[t2];
|
|
2131
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
|
+
i2
|
|
2134
2134
|
), v2 = true, h2 = false, get_fallback = () => (h2 = true, v2 && (v2 = false, _2 = u2 ? untrack(
|
|
2135
2135
|
/** @type {() => V} */
|
|
2136
|
-
|
|
2136
|
+
i2
|
|
2137
2137
|
) : (
|
|
2138
2138
|
/** @type {V} */
|
|
2139
|
-
|
|
2139
|
+
i2
|
|
2140
2140
|
)), _2);
|
|
2141
|
-
if (void 0 ===
|
|
2141
|
+
if (void 0 === s2 && void 0 !== i2 && (g2 && l2 && function props_invalid_value(e3) {
|
|
2142
2142
|
throw new Error("https://svelte.dev/e/props_invalid_value");
|
|
2143
|
-
}(),
|
|
2143
|
+
}(), s2 = get_fallback(), g2 && g2(s2)), l2) f2 = () => {
|
|
2144
2144
|
var n3 = (
|
|
2145
2145
|
/** @type {V} */
|
|
2146
2146
|
e2[t2]
|
|
@@ -2172,7 +2172,7 @@ function prop(e2, t2, n2, s2) {
|
|
|
2172
2172
|
) : f2();
|
|
2173
2173
|
};
|
|
2174
2174
|
}
|
|
2175
|
-
var y2 = false, $2 = /* @__PURE__ */ mutable_source(
|
|
2175
|
+
var y2 = false, $2 = /* @__PURE__ */ mutable_source(s2), w2 = /* @__PURE__ */ derived(() => {
|
|
2176
2176
|
var e3 = f2(), t3 = get$1($2);
|
|
2177
2177
|
return y2 ? (y2 = false, t3) : $2.v = e3;
|
|
2178
2178
|
});
|
|
@@ -2191,7 +2191,7 @@ function prop(e2, t2, n2, s2) {
|
|
|
2191
2191
|
};
|
|
2192
2192
|
}
|
|
2193
2193
|
function onMount(e2) {
|
|
2194
|
-
null === O && lifecycle_outside_component(),
|
|
2194
|
+
null === O && lifecycle_outside_component(), M && null !== O.l ? (
|
|
2195
2195
|
/**
|
|
2196
2196
|
* Legacy-mode: Init callbacks object for onMount/beforeUpdate/afterUpdate
|
|
2197
2197
|
* @param {ComponentContext} context
|
|
@@ -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
|
+
M = true;
|
|
2218
2218
|
}();
|
|
2219
2219
|
/**
|
|
2220
2220
|
* @license lucide-svelte v0.476.0 - ISC
|
|
@@ -2247,18 +2247,18 @@ const Se = {
|
|
|
2247
2247
|
"stroke-linecap": "round",
|
|
2248
2248
|
"stroke-linejoin": "round"
|
|
2249
2249
|
};
|
|
2250
|
-
var
|
|
2250
|
+
var Ie = /* @__PURE__ */ ns_template("<svg><!><!></svg>");
|
|
2251
2251
|
function Icon$1(e2, t2) {
|
|
2252
|
-
const n2 = legacy_rest_props(t2, ["children", "$$slots", "$$events", "$$legacy"]),
|
|
2252
|
+
const n2 = legacy_rest_props(t2, ["children", "$$slots", "$$events", "$$legacy"]), i2 = legacy_rest_props(n2, ["name", "color", "size", "strokeWidth", "absoluteStrokeWidth", "iconNode"]);
|
|
2253
2253
|
push(t2, false);
|
|
2254
|
-
let
|
|
2254
|
+
let s2 = 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 = Ie();
|
|
2257
2257
|
let f2;
|
|
2258
2258
|
var p2 = child(d2);
|
|
2259
2259
|
each(p2, 1, u2, index, (e3, t3) => {
|
|
2260
2260
|
var n3 = comment();
|
|
2261
|
-
!function element(e4, t4, n4,
|
|
2261
|
+
!function element(e4, t4, n4, i3, s3, o3) {
|
|
2262
2262
|
var a3, l3, c3, u3 = null, d3 = (
|
|
2263
2263
|
/** @type {TemplateNode} */
|
|
2264
2264
|
e4
|
|
@@ -2279,32 +2279,32 @@ function Icon$1(e2, t2) {
|
|
|
2279
2279
|
// tag is changing — destroy immediately, render contents without intro transitions
|
|
2280
2280
|
(destroy_effect(c3), set_should_intro(false))
|
|
2281
2281
|
)), e5 && e5 !== l3 && (c3 = branch(() => {
|
|
2282
|
-
if (assign_nodes(u3 = document.createElementNS("http://www.w3.org/2000/svg", e5), u3),
|
|
2282
|
+
if (assign_nodes(u3 = document.createElementNS("http://www.w3.org/2000/svg", e5), u3), i3) {
|
|
2283
2283
|
var t5 = (
|
|
2284
2284
|
/** @type {TemplateNode} */
|
|
2285
2285
|
u3.appendChild(create_text())
|
|
2286
2286
|
);
|
|
2287
|
-
|
|
2287
|
+
i3(u3, t5);
|
|
2288
2288
|
}
|
|
2289
2289
|
V.nodes_end = u3, d3.before(u3);
|
|
2290
2290
|
})), (a3 = e5) && (l3 = a3), set_should_intro(true), set_current_each_item(n5);
|
|
2291
2291
|
}
|
|
2292
2292
|
}, w);
|
|
2293
2293
|
}(first_child(n3), () => get$1(t3)[0], 0, (e4, n4) => {
|
|
2294
|
-
let
|
|
2295
|
-
template_effect(() =>
|
|
2294
|
+
let i3;
|
|
2295
|
+
template_effect(() => i3 = set_attributes(e4, i3, {
|
|
2296
2296
|
...get$1(t3)[1]
|
|
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
|
+
...i2,
|
|
2302
2302
|
width: a2(),
|
|
2303
2303
|
height: a2(),
|
|
2304
2304
|
stroke: o2(),
|
|
2305
2305
|
"stroke-width": e3,
|
|
2306
2306
|
class: t3
|
|
2307
|
-
}), [() => c2() ? 24 * Number(l2()) / Number(a2()) : l2(), () => ((...e3) => e3.filter((e4, t3, n3) => Boolean(e4) && n3.indexOf(e4) === t3).join(" "))("lucide-icon", "lucide",
|
|
2307
|
+
}), [() => c2() ? 24 * Number(l2()) / Number(a2()) : l2(), () => ((...e3) => e3.filter((e4, t3, n3) => Boolean(e4) && n3.indexOf(e4) === t3).join(" "))("lucide-icon", "lucide", s2() ? `lucide-${s2()}` : "", n2.class)], derived_safe_equal), append(e2, d2), pop();
|
|
2308
2308
|
}
|
|
2309
2309
|
function Loader_circle(e2, t2) {
|
|
2310
2310
|
const n2 = legacy_rest_props(t2, ["children", "$$slots", "$$events", "$$legacy"]);
|
|
@@ -2315,8 +2315,8 @@ function Loader_circle(e2, t2) {
|
|
|
2315
2315
|
d: "M21 12a9 9 0 1 1-6.219-8.56"
|
|
2316
2316
|
}]],
|
|
2317
2317
|
children: (e3, n3) => {
|
|
2318
|
-
var
|
|
2319
|
-
slot(first_child(
|
|
2318
|
+
var i2 = comment();
|
|
2319
|
+
slot(first_child(i2), t2, "default", {}, null), append(e3, i2);
|
|
2320
2320
|
},
|
|
2321
2321
|
$$slots: {
|
|
2322
2322
|
default: true
|
|
@@ -2339,53 +2339,53 @@ function split_css_unit(e2) {
|
|
|
2339
2339
|
"px"
|
|
2340
2340
|
];
|
|
2341
2341
|
}
|
|
2342
|
-
function blur(e2, { delay: t2 = 0, duration: n2 = 400, easing:
|
|
2343
|
-
const a2 = getComputedStyle(e2), l2 = +a2.opacity, c2 = "none" === a2.filter ? "" : a2.filter, u2 = l2 * (1 - o2), [d2, f2] = split_css_unit(
|
|
2342
|
+
function blur(e2, { delay: t2 = 0, duration: n2 = 400, easing: i2 = cubic_in_out, amount: s2 = 5, opacity: o2 = 0 } = {}) {
|
|
2343
|
+
const a2 = getComputedStyle(e2), l2 = +a2.opacity, c2 = "none" === a2.filter ? "" : a2.filter, u2 = l2 * (1 - o2), [d2, f2] = split_css_unit(s2);
|
|
2344
2344
|
return {
|
|
2345
2345
|
delay: t2,
|
|
2346
2346
|
duration: n2,
|
|
2347
|
-
easing:
|
|
2347
|
+
easing: i2,
|
|
2348
2348
|
css: (e3, t3) => `opacity: ${l2 - u2 * t3}; filter: ${c2} blur(${t3 * d2}${f2});`
|
|
2349
2349
|
};
|
|
2350
2350
|
}
|
|
2351
|
-
function fade(e2, { delay: t2 = 0, duration: n2 = 400, easing:
|
|
2352
|
-
const
|
|
2351
|
+
function fade(e2, { delay: t2 = 0, duration: n2 = 400, easing: i2 = linear } = {}) {
|
|
2352
|
+
const s2 = +getComputedStyle(e2).opacity;
|
|
2353
2353
|
return {
|
|
2354
2354
|
delay: t2,
|
|
2355
2355
|
duration: n2,
|
|
2356
|
-
easing:
|
|
2357
|
-
css: (e3) => "opacity: " + e3 *
|
|
2356
|
+
easing: i2,
|
|
2357
|
+
css: (e3) => "opacity: " + e3 * s2
|
|
2358
2358
|
};
|
|
2359
2359
|
}
|
|
2360
|
-
function fly(e2, { delay: t2 = 0, duration: n2 = 400, easing:
|
|
2361
|
-
const l2 = getComputedStyle(e2), c2 = +l2.opacity, u2 = "none" === l2.transform ? "" : l2.transform, d2 = c2 * (1 - a2), [f2, p2] = split_css_unit(
|
|
2360
|
+
function fly(e2, { delay: t2 = 0, duration: n2 = 400, easing: i2 = cubic_out, x: s2 = 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(s2), [g2, _2] = split_css_unit(o2);
|
|
2362
2362
|
return {
|
|
2363
2363
|
delay: t2,
|
|
2364
2364
|
duration: n2,
|
|
2365
|
-
easing:
|
|
2365
|
+
easing: i2,
|
|
2366
2366
|
css: (e3, t3) => `
|
|
2367
2367
|
transform: ${u2} translate(${(1 - e3) * f2}${p2}, ${(1 - e3) * g2}${_2});
|
|
2368
2368
|
opacity: ${c2 - d2 * t3}`
|
|
2369
2369
|
};
|
|
2370
2370
|
}
|
|
2371
|
-
function slide(e2, { delay: t2 = 0, duration: n2 = 400, easing:
|
|
2372
|
-
const o2 = getComputedStyle(e2), a2 = +o2.opacity, l2 = "y" ===
|
|
2371
|
+
function slide(e2, { delay: t2 = 0, duration: n2 = 400, easing: i2 = cubic_out, axis: s2 = "y" } = {}) {
|
|
2372
|
+
const o2 = getComputedStyle(e2), a2 = +o2.opacity, l2 = "y" === s2 ? "height" : "width", c2 = parseFloat(o2[l2]), u2 = "y" === s2 ? ["top", "bottom"] : ["left", "right"], d2 = u2.map((e3) => (
|
|
2373
2373
|
/** @type {'Left' | 'Right' | 'Top' | 'Bottom'} */
|
|
2374
2374
|
`${e3[0].toUpperCase()}${e3.slice(1)}`
|
|
2375
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
|
-
easing:
|
|
2379
|
+
easing: i2,
|
|
2380
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
|
-
function scale(e2, { delay: t2 = 0, duration: n2 = 400, easing:
|
|
2384
|
-
const a2 = getComputedStyle(e2), l2 = +a2.opacity, c2 = "none" === a2.transform ? "" : a2.transform, u2 = 1 -
|
|
2383
|
+
function scale(e2, { delay: t2 = 0, duration: n2 = 400, easing: i2 = cubic_out, start: s2 = 0, opacity: o2 = 0 } = {}) {
|
|
2384
|
+
const a2 = getComputedStyle(e2), l2 = +a2.opacity, c2 = "none" === a2.transform ? "" : a2.transform, u2 = 1 - s2, d2 = l2 * (1 - o2);
|
|
2385
2385
|
return {
|
|
2386
2386
|
delay: t2,
|
|
2387
2387
|
duration: n2,
|
|
2388
|
-
easing:
|
|
2388
|
+
easing: i2,
|
|
2389
2389
|
css: (e3, t3) => `
|
|
2390
2390
|
transform: ${c2} scale(${1 - u2 * t3});
|
|
2391
2391
|
opacity: ${l2 - d2 * t3}
|
|
@@ -2395,14 +2395,14 @@ 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
|
+
}, Me = /* @__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
|
-
let n2 = prop(t2, "position", 3, "bottom-right"),
|
|
2402
|
-
var
|
|
2403
|
-
var
|
|
2404
|
-
|
|
2405
|
-
var
|
|
2401
|
+
let n2 = prop(t2, "position", 3, "bottom-right"), i2 = prop(t2, "visible", 3, true);
|
|
2402
|
+
var s2 = comment(), o2 = first_child(s2), consequent = (e3) => {
|
|
2403
|
+
var i3 = Me();
|
|
2404
|
+
i3.__click = [on_click$4, t2];
|
|
2405
|
+
var s3 = child(i3);
|
|
2406
2406
|
!function Gamepad(e4, t3) {
|
|
2407
2407
|
const n3 = legacy_rest_props(t3, ["children", "$$slots", "$$events", "$$legacy"]);
|
|
2408
2408
|
Icon$1(e4, spread_props({
|
|
@@ -2436,29 +2436,29 @@ function FloatingButton(e2, t2) {
|
|
|
2436
2436
|
rx: "2"
|
|
2437
2437
|
}]],
|
|
2438
2438
|
children: (e5, n4) => {
|
|
2439
|
-
var
|
|
2440
|
-
slot(first_child(
|
|
2439
|
+
var i4 = comment();
|
|
2440
|
+
slot(first_child(i4), t3, "default", {}, null), append(e5, i4);
|
|
2441
2441
|
},
|
|
2442
2442
|
$$slots: {
|
|
2443
2443
|
default: true
|
|
2444
2444
|
}
|
|
2445
2445
|
}));
|
|
2446
|
-
}(child(
|
|
2446
|
+
}(child(s3), {
|
|
2447
2447
|
size: 26,
|
|
2448
2448
|
strokeWidth: 1.75,
|
|
2449
2449
|
class: "z-2 mr-2 transform transition-all duration-300 group-hover:rotate-12"
|
|
2450
|
-
}), template_effect(() => set_class(
|
|
2450
|
+
}), template_effect(() => set_class(i3, 1, `fixed ${("bottom-left" == n2() ? "bottom-4 left-4" : "bottom-right" == n2() ? "right-4 bottom-4" : "") ?? ""} group children-text-white text-black z-99990 flex cursor-pointer gap-2 rounded-md bg-white p-3 font-bold uppercase shadow-lg transition-all hover:scale-105`, "svelte-1j97rta")), transition(3, i3, () => blur), append(e3, i3);
|
|
2451
2451
|
};
|
|
2452
2452
|
if_block(o2, (e3) => {
|
|
2453
|
-
|
|
2454
|
-
}), append(e2,
|
|
2453
|
+
i2() && e3(consequent);
|
|
2454
|
+
}), append(e2, s2), pop();
|
|
2455
2455
|
}
|
|
2456
2456
|
delegate(["click"]);
|
|
2457
|
-
const
|
|
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>'), 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-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>'), 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-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>'),
|
|
2457
|
+
const Te = 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>'), 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-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>'), 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-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>'), Ee = /* @__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
|
-
var
|
|
2461
|
+
var i2 = comment(), s2 = first_child(i2), consequent = (e3) => {
|
|
2462
2462
|
append(e3, Pe());
|
|
2463
2463
|
}, alternate = (e3, t3) => {
|
|
2464
2464
|
var consequent_1 = (e4) => {
|
|
@@ -2468,7 +2468,7 @@ function Icon(e2, t2) {
|
|
|
2468
2468
|
append(e5, We());
|
|
2469
2469
|
}, alternate_2 = (e5, t5) => {
|
|
2470
2470
|
var consequent_3 = (e6) => {
|
|
2471
|
-
append(e6,
|
|
2471
|
+
append(e6, Ee());
|
|
2472
2472
|
}, alternate_3 = (e6) => {
|
|
2473
2473
|
};
|
|
2474
2474
|
if_block(e5, (e6) => {
|
|
@@ -2483,38 +2483,38 @@ function Icon(e2, t2) {
|
|
|
2483
2483
|
"error" === n2() ? e4(consequent_1) : e4(alternate_1, false);
|
|
2484
2484
|
}, t3);
|
|
2485
2485
|
};
|
|
2486
|
-
if_block(
|
|
2486
|
+
if_block(s2, (e3) => {
|
|
2487
2487
|
"success" === n2() ? e3(consequent) : e3(alternate, false);
|
|
2488
|
-
}), append(e2,
|
|
2488
|
+
}), append(e2, i2);
|
|
2489
2489
|
}
|
|
2490
|
-
var
|
|
2490
|
+
var je = /* @__PURE__ */ template('<div class="sonner-loading-bar"></div>'), De = /* @__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
|
-
const
|
|
2494
|
+
const i2 = Array(12).fill(0);
|
|
2495
2495
|
init();
|
|
2496
|
-
var
|
|
2497
|
-
each(child(
|
|
2498
|
-
append(e3,
|
|
2499
|
-
}), template_effect(() => set_attribute(
|
|
2496
|
+
var s2 = De();
|
|
2497
|
+
each(child(s2), 5, () => i2, index, (e3, t3) => {
|
|
2498
|
+
append(e3, je());
|
|
2499
|
+
}), template_effect(() => set_attribute(s2, "data-visible", n2())), append(e2, s2), pop();
|
|
2500
2500
|
}
|
|
2501
2501
|
function cn(...e2) {
|
|
2502
2502
|
return e2.filter(Boolean).join(" ");
|
|
2503
2503
|
}
|
|
2504
|
-
const
|
|
2504
|
+
const Ne = "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
|
+
Ne && t2.set(e3);
|
|
2511
2511
|
},
|
|
2512
2512
|
update: function update2(e3) {
|
|
2513
|
-
|
|
2513
|
+
Ne && t2.update(e3);
|
|
2514
2514
|
}
|
|
2515
2515
|
};
|
|
2516
2516
|
}
|
|
2517
|
-
let
|
|
2517
|
+
let Be = 0;
|
|
2518
2518
|
const Ae = function createToastState() {
|
|
2519
2519
|
const e2 = clientWritable([]), t2 = clientWritable([]);
|
|
2520
2520
|
function addToast(t3) {
|
|
@@ -2522,11 +2522,11 @@ const Ae = function createToastState() {
|
|
|
2522
2522
|
}
|
|
2523
2523
|
function create(t3) {
|
|
2524
2524
|
var _a2;
|
|
2525
|
-
const { message: n2, ...
|
|
2526
|
-
return l2 ? e2.update((e3) => e3.map((e4) => e4.id ===
|
|
2525
|
+
const { message: n2, ...i2 } = t3, s2 = "number" == typeof (t3 == null ? void 0 : t3.id) || t3.id && ((_a2 = t3.id) == null ? void 0 : _a2.length) > 0 ? t3.id : Be++, o2 = void 0 === t3.dismissable || t3.dismissable, a2 = void 0 === t3.type ? "default" : t3.type, l2 = get(e2).find((e3) => e3.id === s2);
|
|
2526
|
+
return l2 ? e2.update((e3) => e3.map((e4) => e4.id === s2 ? {
|
|
2527
2527
|
...e4,
|
|
2528
2528
|
...t3,
|
|
2529
|
-
id:
|
|
2529
|
+
id: s2,
|
|
2530
2530
|
title: n2,
|
|
2531
2531
|
dismissable: o2,
|
|
2532
2532
|
type: a2,
|
|
@@ -2535,12 +2535,12 @@ const Ae = function createToastState() {
|
|
|
2535
2535
|
...e4,
|
|
2536
2536
|
updated: false
|
|
2537
2537
|
})) : addToast({
|
|
2538
|
-
...
|
|
2539
|
-
id:
|
|
2538
|
+
...i2,
|
|
2539
|
+
id: s2,
|
|
2540
2540
|
title: n2,
|
|
2541
2541
|
dismissable: o2,
|
|
2542
2542
|
type: a2
|
|
2543
|
-
}),
|
|
2543
|
+
}), s2;
|
|
2544
2544
|
}
|
|
2545
2545
|
function dismiss(t3) {
|
|
2546
2546
|
if (void 0 !== t3) return e2.update((e3) => e3.map((e4) => e4.id === t3 ? {
|
|
@@ -2613,53 +2613,53 @@ const Ae = function createToastState() {
|
|
|
2613
2613
|
type: "loading",
|
|
2614
2614
|
message: t3.loading
|
|
2615
2615
|
}));
|
|
2616
|
-
const
|
|
2617
|
-
let
|
|
2618
|
-
return
|
|
2616
|
+
const i2 = e3 instanceof Promise ? e3 : e3();
|
|
2617
|
+
let s2 = void 0 !== n2;
|
|
2618
|
+
return i2.then((e4) => {
|
|
2619
2619
|
if (e4 && "boolean" == typeof e4.ok && !e4.ok) {
|
|
2620
|
-
|
|
2621
|
-
const
|
|
2620
|
+
s2 = false;
|
|
2621
|
+
const i3 = "function" == typeof t3.error ? (
|
|
2622
2622
|
// @ts-expect-error: Incorrect response type
|
|
2623
2623
|
t3.error(`HTTP error! status: ${e4.status}`)
|
|
2624
2624
|
) : t3.error;
|
|
2625
2625
|
create({
|
|
2626
2626
|
id: n2,
|
|
2627
2627
|
type: "error",
|
|
2628
|
-
message:
|
|
2628
|
+
message: i3
|
|
2629
2629
|
});
|
|
2630
2630
|
} else if (void 0 !== t3.success) {
|
|
2631
|
-
|
|
2632
|
-
const
|
|
2631
|
+
s2 = false;
|
|
2632
|
+
const i3 = (
|
|
2633
2633
|
// @ts-expect-error: TODO: Better function checking
|
|
2634
2634
|
"function" == typeof t3.success ? t3.success(e4) : t3.success
|
|
2635
2635
|
);
|
|
2636
2636
|
create({
|
|
2637
2637
|
id: n2,
|
|
2638
2638
|
type: "success",
|
|
2639
|
-
message:
|
|
2639
|
+
message: i3
|
|
2640
2640
|
});
|
|
2641
2641
|
}
|
|
2642
2642
|
}).catch((e4) => {
|
|
2643
2643
|
if (void 0 !== t3.error) {
|
|
2644
|
-
|
|
2645
|
-
const
|
|
2644
|
+
s2 = false;
|
|
2645
|
+
const i3 = (
|
|
2646
2646
|
// @ts-expect-error: TODO: Better function checking
|
|
2647
2647
|
"function" == typeof t3.error ? t3.error(e4) : t3.error
|
|
2648
2648
|
);
|
|
2649
2649
|
create({
|
|
2650
2650
|
id: n2,
|
|
2651
2651
|
type: "error",
|
|
2652
|
-
message:
|
|
2652
|
+
message: i3
|
|
2653
2653
|
});
|
|
2654
2654
|
}
|
|
2655
2655
|
}).finally(() => {
|
|
2656
2656
|
var _a2;
|
|
2657
|
-
|
|
2657
|
+
s2 && // Toast is still in load state (and will be indefinitely — dismiss it)
|
|
2658
2658
|
(dismiss(n2), n2 = void 0), (_a2 = t3.finally) == null ? void 0 : _a2.call(t3);
|
|
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) || Be++;
|
|
2663
2663
|
return create({
|
|
2664
2664
|
component: e3,
|
|
2665
2665
|
id: n2,
|
|
@@ -2700,7 +2700,7 @@ var Fe = /* @__PURE__ */ template('<button aria-label="Close toast" data-close-b
|
|
|
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 [
|
|
2703
|
+
const [i2, s2] = setup_stores(), $heights = () => store_get(y2, "$heights", i2), $effect = () => store_get(get$1(Q2), "$effect", i2), 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: "",
|
|
@@ -2716,14 +2716,14 @@ function Toast(e2, t2) {
|
|
|
2716
2716
|
info: "",
|
|
2717
2717
|
loading: ""
|
|
2718
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),
|
|
2719
|
+
let k2 = prop(t2, "toast", 9), C2 = prop(t2, "index", 9), S2 = prop(t2, "expanded", 9), I2 = prop(t2, "invert", 13), M2 = prop(t2, "position", 9), T2 = prop(t2, "visibleToasts", 9), O2 = prop(t2, "expandByDefault", 9), q2 = prop(t2, "closeButton", 9), P2 = prop(t2, "interacting", 9), z2 = prop(t2, "cancelButtonStyle", 9, ""), W2 = prop(t2, "actionButtonStyle", 9, ""), E2 = prop(t2, "duration", 9, 4e3), j2 = prop(t2, "descriptionClass", 9, ""), D2 = prop(t2, "classes", 29, () => ({})), N2 = prop(t2, "unstyled", 9, false), B2 = /* @__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 || E2() || 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(B2, 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(D2()), () => {
|
|
2743
|
+
D2({
|
|
2744
2744
|
...m2,
|
|
2745
|
-
...
|
|
2745
|
+
...D2()
|
|
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(T2())), () => {
|
|
2750
|
+
set(a2, C2() + 1 <= T2());
|
|
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,15 +2760,15 @@ 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(g2,
|
|
2763
|
+
}), legacy_pre_effect(() => deep_read_state(M2()), () => {
|
|
2764
|
+
set(g2, M2().split("-"));
|
|
2765
2765
|
}), legacy_pre_effect(() => ($heights(), get$1(p2)), () => {
|
|
2766
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(I2()), deep_read_state(k2())), () => {
|
|
2771
|
+
I2(k2().invert || I2());
|
|
2772
2772
|
}), legacy_pre_effect(() => get$1(u2), () => {
|
|
2773
2773
|
set(v2, "loading" === get$1(u2));
|
|
2774
2774
|
}), legacy_pre_effect(() => (get$1(p2), get$1(_2)), () => {
|
|
@@ -2776,30 +2776,30 @@ function Toast(e2, t2) {
|
|
|
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(B2)) return;
|
|
2780
2780
|
let e3;
|
|
2781
2781
|
await tick(), e3 = S2() || O2() ? 1 : 1 - 0.05 * C2(), get$1(R2).style.setProperty("height", "auto");
|
|
2782
|
-
const t3 = get$1(R2).offsetHeight, n3 = get$1(R2).getBoundingClientRect().height,
|
|
2783
|
-
let
|
|
2782
|
+
const t3 = get$1(R2).offsetHeight, n3 = get$1(R2).getBoundingClientRect().height, i3 = Math.round(100 * (n3 / e3 + Number.EPSILON)) / 100;
|
|
2783
|
+
let s3;
|
|
2784
2784
|
get$1(R2).style.removeProperty("height"), // Use scaledRectHeight as it's more precise
|
|
2785
|
-
|
|
2785
|
+
s3 = Math.abs(i3 - t3) < 1 ? i3 : t3, set(H2, s3), w2({
|
|
2786
2786
|
toastId: k2().id,
|
|
2787
|
-
height:
|
|
2787
|
+
height: s3
|
|
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(E2())), () => {
|
|
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 || E2() || 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
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
|
-
let
|
|
2801
|
-
return
|
|
2802
|
-
(
|
|
2800
|
+
let i3 = n3[t3];
|
|
2801
|
+
return i3 && i3.store !== e4 && // Don't reset store yet, so that store_get above can resubscribe to new store if necessary
|
|
2802
|
+
(i3.unsubscribe(), i3.unsubscribe = noop), e4;
|
|
2803
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
|
|
@@ -2814,7 +2814,7 @@ function Toast(e2, t2) {
|
|
|
2814
2814
|
}()
|
|
2815
2815
|
) : startTimer()), () => clearTimeout(get$1(Z2))), {
|
|
2816
2816
|
subscribe: e3
|
|
2817
|
-
})), "$effect",
|
|
2817
|
+
})), "$effect", i2);
|
|
2818
2818
|
}), legacy_pre_effect(() => $effect(), () => {
|
|
2819
2819
|
$effect();
|
|
2820
2820
|
}), legacy_pre_effect(() => deep_read_state(k2()), () => {
|
|
@@ -2829,7 +2829,7 @@ function Toast(e2, t2) {
|
|
|
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 = D2()) == 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 : () => {
|
|
@@ -2851,15 +2851,15 @@ function Toast(e2, t2) {
|
|
|
2851
2851
|
}));
|
|
2852
2852
|
}), append(e3, t3);
|
|
2853
2853
|
}, alternate = (e3) => {
|
|
2854
|
-
var n3 = Ye(),
|
|
2855
|
-
var n4 = He(),
|
|
2854
|
+
var n3 = Ye(), i3 = first_child(n3), consequent_8 = (e4) => {
|
|
2855
|
+
var n4 = He(), i4 = 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
|
};
|
|
2859
|
-
if_block(
|
|
2859
|
+
if_block(i4, (e5) => {
|
|
2860
2860
|
!k2().promise && "loading" !== get$1(u2) || k2().icon || e5(consequent_2);
|
|
2861
2861
|
});
|
|
2862
|
-
var
|
|
2862
|
+
var s4 = sibling(i4, 2), consequent_3 = (e5) => {
|
|
2863
2863
|
var t3 = comment();
|
|
2864
2864
|
component(first_child(t3), () => k2().icon, (e6, t4) => {
|
|
2865
2865
|
t4(e6, {});
|
|
@@ -2897,14 +2897,14 @@ function Toast(e2, t2) {
|
|
|
2897
2897
|
"success" === get$1(u2) ? e6(consequent_4) : e6(alternate_2, false);
|
|
2898
2898
|
}, n5);
|
|
2899
2899
|
};
|
|
2900
|
-
if_block(
|
|
2900
|
+
if_block(s4, (e5) => {
|
|
2901
2901
|
k2().icon ? e5(consequent_3) : e5(alternate_1, false);
|
|
2902
2902
|
}), append(e4, n4);
|
|
2903
2903
|
};
|
|
2904
|
-
if_block(
|
|
2904
|
+
if_block(i3, (e4) => {
|
|
2905
2905
|
("default" !== get$1(u2) || k2().icon || k2().promise) && e4(consequent_8);
|
|
2906
2906
|
});
|
|
2907
|
-
var
|
|
2907
|
+
var s3 = sibling(i3, 2), o3 = child(s3), consequent_10 = (e4) => {
|
|
2908
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) => {
|
|
@@ -2918,7 +2918,7 @@ 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 = D2()) == 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) => {
|
|
@@ -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(j2(), get$1(f2), (_a2 = D2()) == 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
|
-
var l3 = sibling(
|
|
2947
|
+
var l3 = sibling(s3, 2), consequent_13 = (e4) => {
|
|
2948
2948
|
var t3 = Ve(), n4 = child(t3);
|
|
2949
2949
|
template_effect((e5) => {
|
|
2950
2950
|
set_style(t3, z2()), 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 = D2()) == 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();
|
|
@@ -2965,7 +2965,7 @@ function Toast(e2, t2) {
|
|
|
2965
2965
|
set_style(t3, W2()), 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 = D2()) == 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();
|
|
@@ -2977,19 +2977,19 @@ function Toast(e2, t2) {
|
|
|
2977
2977
|
};
|
|
2978
2978
|
if_block(re2, (e3) => {
|
|
2979
2979
|
k2().component ? e3(consequent_1) : e3(alternate, false);
|
|
2980
|
-
}), bind_this(ee2, (e3) => set(R2, e3), () => get$1(R2)), template_effect((e3, t3,
|
|
2980
|
+
}), bind_this(ee2, (e3) => set(R2, e3), () => get$1(R2)), template_effect((e3, t3, s3) => {
|
|
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) || N2())), set_attribute(ee2, "data-mounted", get$1(B2)), 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", I2()), set_attribute(ee2, "data-swipe-out", get$1(G2)), set_attribute(ee2, "data-expanded", s3), te2 = set_style(ee2, `${n2.style} ${k2().style}`, te2, {
|
|
2983
2983
|
"--index": C2(),
|
|
2984
2984
|
"--toasts-before": C2(),
|
|
2985
|
-
"--z-index": store_get(b2, "$toasts",
|
|
2985
|
+
"--z-index": store_get(b2, "$toasts", i2).length - C2(),
|
|
2986
2986
|
"--offset": `${get$1(A2) ? get$1(F2) : get$1(U2)}px`,
|
|
2987
2987
|
"--initial-height": `${get$1(H2)}px`
|
|
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(S2() || O2() && get$1(
|
|
2991
|
+
return clsx(cn(n2.class, get$1(d2), (_a2 = D2()) == null ? void 0 : _a2.toast, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.toast, (_d = D2()) == 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(B2))], 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,17 +3006,17 @@ 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,
|
|
3010
|
-
Math.abs(
|
|
3009
|
+
const t3 = e3.clientY - Y2.y, n3 = e3.clientX - Y2.x, i3 = ("top" === get$1(g2)[0] ? Math.min : Math.max)(0, t3), s3 = "touch" === e3.pointerType ? 10 : 2;
|
|
3010
|
+
Math.abs(i3) > s3 ? get$1(R2).style.setProperty("--swipe-amount", `${t3}px`) : Math.abs(n3) > s3 && // User is swiping in wrong direction so we disable swipe gesture
|
|
3011
3011
|
// for the current pointer down interaction
|
|
3012
3012
|
(Y2 = null);
|
|
3013
|
-
}), append(e2, ee2), pop(),
|
|
3013
|
+
}), append(e2, ee2), pop(), s2();
|
|
3014
3014
|
}
|
|
3015
3015
|
var Je = /* @__PURE__ */ template("<ol></ol>"), Xe = /* @__PURE__ */ template('<section class="svelte-1fo5d1m"></section>');
|
|
3016
3016
|
function Toaster(e2, t2) {
|
|
3017
|
-
const n2 = legacy_rest_props(t2, ["children", "$$slots", "$$events", "$$legacy"]),
|
|
3017
|
+
const n2 = legacy_rest_props(t2, ["children", "$$slots", "$$events", "$$legacy"]), i2 = legacy_rest_props(n2, ["invert", "theme", "position", "hotkey", "containerAriaLabel", "richColors", "expand", "duration", "visibleToasts", "closeButton", "toastOptions", "offset", "dir"]);
|
|
3018
3018
|
push(t2, false);
|
|
3019
|
-
const [
|
|
3019
|
+
const [s2, o2] = setup_stores(), $toasts = () => store_get(k2, "$toasts", s2), a2 = /* @__PURE__ */ mutable_source(), l2 = /* @__PURE__ */ mutable_source(), c2 = "dark", u2 = "light";
|
|
3020
3020
|
function getDocumentDirection() {
|
|
3021
3021
|
if ("undefined" == typeof window) return "ltr";
|
|
3022
3022
|
if ("undefined" == typeof document) return "ltr";
|
|
@@ -3025,7 +3025,7 @@ function Toaster(e2, t2) {
|
|
|
3025
3025
|
}
|
|
3026
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
3027
|
const { toasts: k2, heights: C2, reset: S2 } = Ae;
|
|
3028
|
-
let
|
|
3028
|
+
let I2 = /* @__PURE__ */ mutable_source(false), M2 = /* @__PURE__ */ mutable_source(false), T2 = /* @__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
3030
|
}(f2())), q2 = /* @__PURE__ */ mutable_source(), P2 = null, z2 = false;
|
|
3031
3031
|
function handleBlur(e3) {
|
|
@@ -3049,7 +3049,7 @@ function Toaster(e2, t2) {
|
|
|
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(I2, 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(I2, false);
|
|
3053
3053
|
};
|
|
3054
3054
|
return document.addEventListener("keydown", handleKeydown), () => {
|
|
3055
3055
|
document.removeEventListener("keydown", handleKeydown);
|
|
@@ -3059,7 +3059,7 @@ function Toaster(e2, t2) {
|
|
|
3059
3059
|
}), legacy_pre_effect(() => deep_read_state(g2()), () => {
|
|
3060
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(I2, 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(T2, 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(T2, c2)
|
|
3078
3078
|
) : (
|
|
3079
3079
|
// it's not dark
|
|
3080
|
-
set(
|
|
3080
|
+
set(T2, u2)
|
|
3081
3081
|
));
|
|
3082
3082
|
const e3 = window.matchMedia("(prefers-color-scheme: dark)"), changeHandler = ({ matches: e4 }) => {
|
|
3083
|
-
set(
|
|
3083
|
+
set(T2, e4 ? c2 : u2);
|
|
3084
3084
|
};
|
|
3085
3085
|
"addEventListener" in e3 ? e3.addEventListener("change", changeHandler) : (
|
|
3086
3086
|
// @ts-expect-error deprecated API
|
|
@@ -3088,12 +3088,12 @@ function Toaster(e2, t2) {
|
|
|
3088
3088
|
);
|
|
3089
3089
|
}
|
|
3090
3090
|
}), legacy_pre_effect_reset(), init();
|
|
3091
|
-
var W2 = comment(),
|
|
3091
|
+
var W2 = comment(), E2 = first_child(W2), consequent = (e3) => {
|
|
3092
3092
|
var o3 = Xe();
|
|
3093
3093
|
set_attribute(o3, "tabindex", -1), each(o3, 5, () => get$1(a2), index, (e4, o4, a3, l3) => {
|
|
3094
3094
|
var c3 = Je();
|
|
3095
3095
|
let u3;
|
|
3096
|
-
each(c3, 7, () => $toasts().filter((e5) => !e5.position && 0 === a3 || e5.position === get$1(o4)), (e5) => e5.id, (e5, n3,
|
|
3096
|
+
each(c3, 7, () => $toasts().filter((e5) => !e5.position && 0 === a3 || e5.position === get$1(o4)), (e5) => e5.id, (e5, n3, i3, s3) => {
|
|
3097
3097
|
const a4 = /* @__PURE__ */ derived_safe_equal(() => {
|
|
3098
3098
|
var _a2;
|
|
3099
3099
|
return ((_a2 = $2()) == null ? void 0 : _a2.actionButtonStyle) || "";
|
|
@@ -3112,7 +3112,7 @@ function Toaster(e2, t2) {
|
|
|
3112
3112
|
}), g3 = /* @__PURE__ */ derived_safe_equal(() => $2().unstyled || false);
|
|
3113
3113
|
Toast(e5, {
|
|
3114
3114
|
get index() {
|
|
3115
|
-
return get$1(
|
|
3115
|
+
return get$1(i3);
|
|
3116
3116
|
},
|
|
3117
3117
|
get toast() {
|
|
3118
3118
|
return get$1(n3);
|
|
@@ -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(M2);
|
|
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(I2);
|
|
3140
3140
|
},
|
|
3141
3141
|
get actionButtonStyle() {
|
|
3142
3142
|
return get$1(a4);
|
|
@@ -3160,48 +3160,48 @@ function Toaster(e2, t2) {
|
|
|
3160
3160
|
return get$1(g3);
|
|
3161
3161
|
},
|
|
3162
3162
|
$$slots: {
|
|
3163
|
-
"loading-icon": (e6,
|
|
3164
|
-
var
|
|
3165
|
-
slot(first_child(
|
|
3163
|
+
"loading-icon": (e6, i4) => {
|
|
3164
|
+
var s4 = comment();
|
|
3165
|
+
slot(first_child(s4), t2, "loading-icon", {}, (e7) => {
|
|
3166
3166
|
const t3 = /* @__PURE__ */ derived_safe_equal(() => "loading" === get$1(n3).type);
|
|
3167
3167
|
Loader(e7, {
|
|
3168
3168
|
get visible() {
|
|
3169
3169
|
return get$1(t3);
|
|
3170
3170
|
}
|
|
3171
3171
|
});
|
|
3172
|
-
}), append(e6,
|
|
3172
|
+
}), append(e6, s4);
|
|
3173
3173
|
},
|
|
3174
3174
|
"success-icon": (e6, n4) => {
|
|
3175
|
-
var
|
|
3176
|
-
slot(first_child(
|
|
3175
|
+
var i4 = comment();
|
|
3176
|
+
slot(first_child(i4), t2, "success-icon", {}, (e7) => {
|
|
3177
3177
|
Icon(e7, {
|
|
3178
3178
|
type: "success"
|
|
3179
3179
|
});
|
|
3180
|
-
}), append(e6,
|
|
3180
|
+
}), append(e6, i4);
|
|
3181
3181
|
},
|
|
3182
3182
|
"error-icon": (e6, n4) => {
|
|
3183
|
-
var
|
|
3184
|
-
slot(first_child(
|
|
3183
|
+
var i4 = comment();
|
|
3184
|
+
slot(first_child(i4), t2, "error-icon", {}, (e7) => {
|
|
3185
3185
|
Icon(e7, {
|
|
3186
3186
|
type: "error"
|
|
3187
3187
|
});
|
|
3188
|
-
}), append(e6,
|
|
3188
|
+
}), append(e6, i4);
|
|
3189
3189
|
},
|
|
3190
3190
|
"warning-icon": (e6, n4) => {
|
|
3191
|
-
var
|
|
3192
|
-
slot(first_child(
|
|
3191
|
+
var i4 = comment();
|
|
3192
|
+
slot(first_child(i4), t2, "warning-icon", {}, (e7) => {
|
|
3193
3193
|
Icon(e7, {
|
|
3194
3194
|
type: "warning"
|
|
3195
3195
|
});
|
|
3196
|
-
}), append(e6,
|
|
3196
|
+
}), append(e6, i4);
|
|
3197
3197
|
},
|
|
3198
3198
|
"info-icon": (e6, n4) => {
|
|
3199
|
-
var
|
|
3200
|
-
slot(first_child(
|
|
3199
|
+
var i4 = comment();
|
|
3200
|
+
slot(first_child(i4), t2, "info-icon", {}, (e7) => {
|
|
3201
3201
|
Icon(e7, {
|
|
3202
3202
|
type: "info"
|
|
3203
3203
|
});
|
|
3204
|
-
}), append(e6,
|
|
3204
|
+
}), append(e6, i4);
|
|
3205
3205
|
}
|
|
3206
3206
|
}
|
|
3207
3207
|
});
|
|
@@ -3211,26 +3211,26 @@ function Toaster(e2, t2) {
|
|
|
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(T2),
|
|
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
|
+
...i2,
|
|
3221
3221
|
[_e]: {
|
|
3222
|
-
"--front-toast-height": `${(_a2 = store_get(C2, "$heights",
|
|
3222
|
+
"--front-toast-height": `${(_a2 = store_get(C2, "$heights", s2)[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(
|
|
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(I2, true)), event("mousemove", c3, () => set(I2, true)), event("mouseleave", c3, () => {
|
|
3229
|
+
get$1(M2) || set(I2, false);
|
|
3230
|
+
}), event("pointerdown", c3, () => set(M2, true)), event("pointerup", c3, () => set(M2, false)), append(e4, c3);
|
|
3231
3231
|
}), template_effect(() => set_attribute(o3, "aria-label", `${_2()} ${get$1(l2)}`)), append(e3, o3);
|
|
3232
3232
|
};
|
|
3233
|
-
if_block(
|
|
3233
|
+
if_block(E2, (e3) => {
|
|
3234
3234
|
$toasts().length > 0 && e3(consequent);
|
|
3235
3235
|
}), append(e2, W2), pop(), o2();
|
|
3236
3236
|
}
|
|
@@ -3241,24 +3241,24 @@ const Qe = new (_b = class {
|
|
|
3241
3241
|
}
|
|
3242
3242
|
async request(e2, t2 = {}) {
|
|
3243
3243
|
try {
|
|
3244
|
-
const n2 = `${this.baseUrl}${e2}`,
|
|
3244
|
+
const n2 = `${this.baseUrl}${e2}`, i2 = await fetch(n2, {
|
|
3245
3245
|
...t2,
|
|
3246
3246
|
headers: {
|
|
3247
3247
|
"Content-Type": "application/json",
|
|
3248
3248
|
...t2.headers
|
|
3249
3249
|
}
|
|
3250
3250
|
});
|
|
3251
|
-
if (!
|
|
3251
|
+
if (!i2.ok) {
|
|
3252
3252
|
let e3;
|
|
3253
3253
|
try {
|
|
3254
|
-
e3 = await
|
|
3254
|
+
e3 = await i2.json();
|
|
3255
3255
|
} catch {
|
|
3256
3256
|
} finally {
|
|
3257
|
-
if (429 !==
|
|
3258
|
-
return 429 ===
|
|
3257
|
+
if (429 !== i2.status && 404 !== i2.status) throw new Error(`API request failed: ${(e3 == null ? void 0 : e3.error) || (e3 == null ? void 0 : e3.message) || i2.status}`);
|
|
3258
|
+
return 429 === i2.status ? console.warn("Playlight request didn't go through due to rate limiting.") : console.warn("Playlight game not found. This is normal in a test / local environment, but should not appear in production.");
|
|
3259
3259
|
}
|
|
3260
3260
|
}
|
|
3261
|
-
return await
|
|
3261
|
+
return await i2.json();
|
|
3262
3262
|
} catch (e3) {
|
|
3263
3263
|
Ge.error("Error: " + e3), console.error("Playlight API error:", e3);
|
|
3264
3264
|
}
|
|
@@ -3272,19 +3272,19 @@ const Qe = new (_b = class {
|
|
|
3272
3272
|
// Get game suggestions, optionally filtered by category
|
|
3273
3273
|
async getSuggestions(e2 = null, t2 = 1) {
|
|
3274
3274
|
let n2 = "/suggestions";
|
|
3275
|
-
return e2 && (n2 += "/" + e2), t2 && (n2 += "?page=" + t2), n2 += "&without=" + __privateMethod(this, _PlayLightAPI_instances,
|
|
3275
|
+
return e2 && (n2 += "/" + e2), t2 && (n2 += "?page=" + t2), n2 += "&without=" + __privateMethod(this, _PlayLightAPI_instances, i_fn).call(this), await this.request(n2);
|
|
3276
3276
|
}
|
|
3277
3277
|
// Get game suggestions, optionally filtered by category
|
|
3278
3278
|
async getCurrentGameInfo() {
|
|
3279
3279
|
if (this.currentGame) return this.currentGame;
|
|
3280
|
-
let e2 = "/game-by-domain/" + __privateMethod(this, _PlayLightAPI_instances,
|
|
3280
|
+
let e2 = "/game-by-domain/" + __privateMethod(this, _PlayLightAPI_instances, i_fn).call(this);
|
|
3281
3281
|
return this.currentGame = await this.request(e2), this.currentGame ? {
|
|
3282
3282
|
...this.currentGame
|
|
3283
3283
|
} : void 0;
|
|
3284
3284
|
}
|
|
3285
3285
|
// Track discovery overlay open
|
|
3286
3286
|
async trackOpen() {
|
|
3287
|
-
const e2 = __privateMethod(this, _PlayLightAPI_instances,
|
|
3287
|
+
const e2 = __privateMethod(this, _PlayLightAPI_instances, i_fn).call(this);
|
|
3288
3288
|
await this.request("/event/open", {
|
|
3289
3289
|
method: "POST",
|
|
3290
3290
|
body: JSON.stringify({
|
|
@@ -3294,7 +3294,7 @@ const Qe = new (_b = class {
|
|
|
3294
3294
|
}
|
|
3295
3295
|
// Track game click (pass id of the game that was clicked on)
|
|
3296
3296
|
async trackClick(e2) {
|
|
3297
|
-
const t2 = __privateMethod(this, _PlayLightAPI_instances,
|
|
3297
|
+
const t2 = __privateMethod(this, _PlayLightAPI_instances, i_fn).call(this);
|
|
3298
3298
|
await this.request("/event/click", {
|
|
3299
3299
|
method: "POST",
|
|
3300
3300
|
body: JSON.stringify({
|
|
@@ -3305,34 +3305,34 @@ const Qe = new (_b = class {
|
|
|
3305
3305
|
}
|
|
3306
3306
|
// Like or unlike a game (pass gameId and true to like, false to unlike)
|
|
3307
3307
|
async toggleLike(e2, t2 = true) {
|
|
3308
|
-
const n2 = t2 ? "like" : "unlike",
|
|
3308
|
+
const n2 = t2 ? "like" : "unlike", i2 = await this.request(`/rating/${e2}/${n2}`, {
|
|
3309
3309
|
method: "POST"
|
|
3310
3310
|
});
|
|
3311
|
-
return (
|
|
3311
|
+
return (i2 == null ? void 0 : i2.success) || false;
|
|
3312
3312
|
}
|
|
3313
|
-
}, _PlayLightAPI_instances = new WeakSet(),
|
|
3313
|
+
}, _PlayLightAPI_instances = new WeakSet(), i_fn = function() {
|
|
3314
3314
|
const e2 = window.location.hostname;
|
|
3315
3315
|
return e2.startsWith("www.") ? e2.substring(4) : e2;
|
|
3316
3316
|
}, _b)();
|
|
3317
3317
|
var et = /* @__PURE__ */ template('<div><p class="font-bold text-white uppercase"> </p></div>');
|
|
3318
3318
|
function GameBadge(e2, t2) {
|
|
3319
3319
|
let n2 = prop(t2, "isHovered", 3, false);
|
|
3320
|
-
var
|
|
3321
|
-
let
|
|
3322
|
-
var o2 = child(
|
|
3320
|
+
var i2 = et();
|
|
3321
|
+
let s2;
|
|
3322
|
+
var o2 = child(i2), a2 = child(o2);
|
|
3323
3323
|
template_effect((e3) => {
|
|
3324
|
-
|
|
3324
|
+
s2 = set_class(i2, 1, "bg-background absolute top-4 right-4 z-12 px-2 py-0.5 transition-opacity select-none", null, s2, e3), set_text(a2, t2.text);
|
|
3325
3325
|
}, [() => ({
|
|
3326
3326
|
"opacity-0": n2()
|
|
3327
|
-
})]), append(e2,
|
|
3327
|
+
})]), append(e2, i2);
|
|
3328
3328
|
}
|
|
3329
|
-
var on_click$3 = (e2, t2, n2,
|
|
3330
|
-
!get$1(t2) || get$1(n2) ? (Qe.trackClick(
|
|
3331
|
-
}, tt = /* @__PURE__ */ template('<video playsinline="" loop fetchpriority="low"></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>'),
|
|
3329
|
+
var on_click$3 = (e2, t2, n2, i2, s2) => {
|
|
3330
|
+
!get$1(t2) || get$1(n2) ? (Qe.trackClick(s2.game.id), window.open("https://" + s2.game.domain + "?utm_source=playlight", "_blank", "noopener")) : i2();
|
|
3331
|
+
}, tt = /* @__PURE__ */ template('<video playsinline="" loop fetchpriority="low"></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>'), it = /* @__PURE__ */ template('<div role="button" tabindex="0"><!> <!> <img alt="cover" fetchpriority="high"> <!> <div class="prevent-image-select bg-background absolute right-0 -bottom-[18%] left-0 z-9 mx-auto aspect-square w-1/5 animate-pulse rounded-full shadow-xl svelte-o63m4o"></div> <img alt="game logo" fetchpriority="high"></div>');
|
|
3332
3332
|
function GameCard(e2, t2) {
|
|
3333
3333
|
push(t2, true);
|
|
3334
|
-
const [n2,
|
|
3335
|
-
let
|
|
3334
|
+
const [n2, i2] = setup_stores();
|
|
3335
|
+
let s2, 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
3336
|
function handleHover() {
|
|
3337
3337
|
get$1(a2) || get$1(p2) || function playSound(e3, t3 = 1) {
|
|
3338
3338
|
try {
|
|
@@ -3341,12 +3341,12 @@ function GameCard(e2, t2) {
|
|
|
3341
3341
|
} catch (e4) {
|
|
3342
3342
|
console.error("Error playing sound:", e4);
|
|
3343
3343
|
}
|
|
3344
|
-
}(store_get(qe, "$projectUrl", n2) + "/static/sounds/hover-selection.ogg", 0.25), set(a2, true), clearTimeout(
|
|
3344
|
+
}(store_get(qe, "$projectUrl", n2) + "/static/sounds/hover-selection.ogg", 0.25), set(a2, true), clearTimeout(s2), s2 = 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));
|
|
3345
3345
|
}
|
|
3346
3346
|
function handleUnhover() {
|
|
3347
|
-
get$1(c2) && get$1(u2) && get$1(c2).pause(), set(a2, false), clearTimeout(
|
|
3347
|
+
get$1(c2) && get$1(u2) && get$1(c2).pause(), set(a2, false), clearTimeout(s2), set(l2, false);
|
|
3348
3348
|
}
|
|
3349
|
-
var _2 =
|
|
3349
|
+
var _2 = it();
|
|
3350
3350
|
event("touchstart", z, (e3) => {
|
|
3351
3351
|
get$1(g2) && !get$1(g2).contains(e3.target) && handleUnhover();
|
|
3352
3352
|
}, void 0, true), event("pointerdown", z, (e3) => set(p2, "touch" === e3.pointerType)), event("pointermove", z, (e3) => set(p2, "touch" === e3.pointerType)), _2.__click = [on_click$3, p2, l2, handleHover, t2];
|
|
@@ -3380,9 +3380,9 @@ function GameCard(e2, t2) {
|
|
|
3380
3380
|
});
|
|
3381
3381
|
var h2 = sibling(v2, 2), consequent_2 = (e3) => {
|
|
3382
3382
|
var n3 = tt();
|
|
3383
|
-
let
|
|
3383
|
+
let i3;
|
|
3384
3384
|
n3.muted = true, bind_this(n3, (e4) => set(c2, e4), () => get$1(c2)), template_effect((e4) => {
|
|
3385
|
-
set_attribute(n3, "src", t2.game.cover_video_url),
|
|
3385
|
+
set_attribute(n3, "src", t2.game.cover_video_url), i3 = set_class(n3, 1, "absolute top-0 left-0 z-5 h-full w-full object-cover opacity-0", null, i3, e4);
|
|
3386
3386
|
}, [() => ({
|
|
3387
3387
|
"opacity-100": get$1(a2) && get$1(u2) && t2.game.cover_video_url
|
|
3388
3388
|
})]), event("loadeddata", n3, () => {
|
|
@@ -3395,7 +3395,7 @@ function GameCard(e2, t2) {
|
|
|
3395
3395
|
var m2 = sibling(h2, 2);
|
|
3396
3396
|
let b2;
|
|
3397
3397
|
var y2 = sibling(m2, 2), consequent_4 = (e3) => {
|
|
3398
|
-
var n3 = rt(),
|
|
3398
|
+
var n3 = rt(), i3 = child(n3), s3 = child(i3), o3 = child(s3), a3 = child(sibling(s3, 2)), l3 = sibling(i3, 2), consequent_3 = (e4) => {
|
|
3399
3399
|
var t3 = nt();
|
|
3400
3400
|
!function Info(e5, t4) {
|
|
3401
3401
|
const n4 = legacy_rest_props(t4, ["children", "$$slots", "$$events", "$$legacy"]);
|
|
@@ -3412,8 +3412,8 @@ function GameCard(e2, t2) {
|
|
|
3412
3412
|
d: "M12 8h.01"
|
|
3413
3413
|
}]],
|
|
3414
3414
|
children: (e6, n5) => {
|
|
3415
|
-
var
|
|
3416
|
-
slot(first_child(
|
|
3415
|
+
var i4 = comment();
|
|
3416
|
+
slot(first_child(i4), t4, "default", {}, null), append(e6, i4);
|
|
3417
3417
|
},
|
|
3418
3418
|
$$slots: {
|
|
3419
3419
|
default: true
|
|
@@ -3446,7 +3446,7 @@ function GameCard(e2, t2) {
|
|
|
3446
3446
|
set(d2, true);
|
|
3447
3447
|
}), event("load", $2, () => {
|
|
3448
3448
|
set(f2, true);
|
|
3449
|
-
}), append(e2, _2), pop(),
|
|
3449
|
+
}), append(e2, _2), pop(), i2();
|
|
3450
3450
|
}
|
|
3451
3451
|
function backInOut(e2) {
|
|
3452
3452
|
const t2 = 2.5949095;
|
|
@@ -3463,8 +3463,8 @@ function cubicOut(e2) {
|
|
|
3463
3463
|
function sineOut(e2) {
|
|
3464
3464
|
return Math.sin(e2 * Math.PI / 2);
|
|
3465
3465
|
}
|
|
3466
|
-
function flip(e2, { from: t2, to: n2 },
|
|
3467
|
-
var { delay:
|
|
3466
|
+
function flip(e2, { from: t2, to: n2 }, i2 = {}) {
|
|
3467
|
+
var { delay: s2 = 0, duration: o2 = (e3) => 120 * Math.sqrt(e3), easing: a2 = cubicOut } = i2, l2 = getComputedStyle(e2), c2 = "none" === l2.transform ? "" : l2.transform, [u2, d2] = l2.transformOrigin.split(" ").map(parseFloat);
|
|
3468
3468
|
u2 /= e2.clientWidth, d2 /= e2.clientHeight;
|
|
3469
3469
|
var f2 = (
|
|
3470
3470
|
/**
|
|
@@ -3480,7 +3480,7 @@ function flip(e2, { from: t2, to: n2 }, s2 = {}) {
|
|
|
3480
3480
|
}(e2)
|
|
3481
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;
|
|
3482
3482
|
return {
|
|
3483
|
-
delay:
|
|
3483
|
+
delay: s2,
|
|
3484
3484
|
duration: "function" == typeof o2 ? o2(Math.sqrt(b2 * b2 + y2 * y2)) : o2,
|
|
3485
3485
|
easing: a2,
|
|
3486
3486
|
css: (e3, t3) => `transform: ${c2} translate(${t3 * b2}px, ${t3 * y2}px) scale(${e3 + t3 * $2}, ${e3 + t3 * w2});`
|
|
@@ -3489,13 +3489,13 @@ function flip(e2, { from: t2, to: n2 }, s2 = {}) {
|
|
|
3489
3489
|
delegate(["click"]);
|
|
3490
3490
|
var on_click$2 = (e2, t2, n2) => {
|
|
3491
3491
|
set(t2, ""), set(n2, !get$1(n2));
|
|
3492
|
-
},
|
|
3492
|
+
}, st = /* @__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, i2, s2) => {
|
|
3493
3493
|
var _a2;
|
|
3494
|
-
t2(n2), set(
|
|
3494
|
+
t2(n2), set(i2, false), (_a2 = s2.onCategoryChange) == null ? void 0 : _a2.call(s2);
|
|
3495
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>');
|
|
3496
3496
|
function Navigation(e2, t2) {
|
|
3497
3497
|
push(t2, true);
|
|
3498
|
-
let n2,
|
|
3498
|
+
let n2, i2 = prop(t2, "categories", 19, () => []), s2 = prop(t2, "selectedCategory", 15), o2 = state(false), a2 = user_derived(() => s2() || (i2().length > 0 ? i2()[0] : "...")), l2 = state(""), c2 = state(void 0), u2 = user_derived(() => get$1(l2) ? i2().filter((e3) => e3.toLowerCase().includes(get$1(l2).toLowerCase())) : i2());
|
|
3499
3499
|
const d2 = ["Looking for", "Interested in", "Searching for", "Fancy some", "What about these"];
|
|
3500
3500
|
let f2 = state(proxy(d2[0]));
|
|
3501
3501
|
onMount(() => {
|
|
@@ -3519,8 +3519,8 @@ function Navigation(e2, t2) {
|
|
|
3519
3519
|
d: "m6 9 6 6 6-6"
|
|
3520
3520
|
}]],
|
|
3521
3521
|
children: (e4, n4) => {
|
|
3522
|
-
var
|
|
3523
|
-
slot(first_child(
|
|
3522
|
+
var i3 = comment();
|
|
3523
|
+
slot(first_child(i3), t3, "default", {}, null), append(e4, i3);
|
|
3524
3524
|
},
|
|
3525
3525
|
$$slots: {
|
|
3526
3526
|
default: true
|
|
@@ -3548,8 +3548,8 @@ function Navigation(e2, t2) {
|
|
|
3548
3548
|
d: "m21 21-4.3-4.3"
|
|
3549
3549
|
}]],
|
|
3550
3550
|
children: (e5, n5) => {
|
|
3551
|
-
var
|
|
3552
|
-
slot(first_child(
|
|
3551
|
+
var i3 = comment();
|
|
3552
|
+
slot(first_child(i3), t3, "default", {}, null), append(e5, i3);
|
|
3553
3553
|
},
|
|
3554
3554
|
$$slots: {
|
|
3555
3555
|
default: true
|
|
@@ -3561,33 +3561,33 @@ function Navigation(e2, t2) {
|
|
|
3561
3561
|
class: "text-muted-foreground"
|
|
3562
3562
|
});
|
|
3563
3563
|
var p3 = sibling(f3, 2), g3 = child(sibling(a3, 2)), consequent = (e4) => {
|
|
3564
|
-
append(e4,
|
|
3564
|
+
append(e4, st());
|
|
3565
3565
|
}, alternate = (e4, n4) => {
|
|
3566
3566
|
var consequent_1 = (e5) => {
|
|
3567
3567
|
append(e5, ot());
|
|
3568
3568
|
}, alternate_1 = (e5) => {
|
|
3569
3569
|
var n5 = lt();
|
|
3570
3570
|
each(n5, 28, () => get$1(u2), (e6) => e6, (e6, n6) => {
|
|
3571
|
-
var
|
|
3572
|
-
|
|
3573
|
-
var a4 = child(
|
|
3571
|
+
var i3 = at();
|
|
3572
|
+
i3.__click = [on_click_1$1, s2, n6, o2, t2];
|
|
3573
|
+
var a4 = child(i3);
|
|
3574
3574
|
template_effect(() => {
|
|
3575
|
-
set_class(
|
|
3575
|
+
set_class(i3, 1, `w-full cursor-pointer px-4 py-2 text-left transition-colors ${(s2() != n6 ? "hover:bg-muted-foreground/20" : "") ?? ""} ${(s2() == n6 ? "bg-white text-black" : "text-white") ?? ""}`), set_text(a4, n6);
|
|
3576
3576
|
}), function animation(e7, t3, n7) {
|
|
3577
|
-
var
|
|
3577
|
+
var i4, s3, o3, a5 = (
|
|
3578
3578
|
/** @type {EachItem} */
|
|
3579
3579
|
fe
|
|
3580
3580
|
), l3 = null;
|
|
3581
3581
|
a5.a ?? (a5.a = {
|
|
3582
3582
|
element: e7,
|
|
3583
3583
|
measure() {
|
|
3584
|
-
|
|
3584
|
+
i4 = this.element.getBoundingClientRect();
|
|
3585
3585
|
},
|
|
3586
3586
|
apply() {
|
|
3587
|
-
if (o3 == null ? void 0 : o3.abort(),
|
|
3587
|
+
if (o3 == null ? void 0 : o3.abort(), s3 = this.element.getBoundingClientRect(), i4.left !== s3.left || i4.right !== s3.right || i4.top !== s3.top || i4.bottom !== s3.bottom) {
|
|
3588
3588
|
const e8 = t3()(this.element, {
|
|
3589
|
-
from:
|
|
3590
|
-
to:
|
|
3589
|
+
from: i4,
|
|
3590
|
+
to: s3
|
|
3591
3591
|
}, n7 == null ? void 0 : n7());
|
|
3592
3592
|
o3 = animate(this.element, e8, void 0, 1, () => {
|
|
3593
3593
|
o3 == null ? void 0 : o3.abort(), o3 = void 0;
|
|
@@ -3596,7 +3596,7 @@ function Navigation(e2, t2) {
|
|
|
3596
3596
|
},
|
|
3597
3597
|
fix() {
|
|
3598
3598
|
if (!e7.getAnimations().length) {
|
|
3599
|
-
var { position: t4, width: n8, height:
|
|
3599
|
+
var { position: t4, width: n8, height: s4 } = getComputedStyle(e7);
|
|
3600
3600
|
if ("absolute" !== t4 && "fixed" !== t4) {
|
|
3601
3601
|
var o4 = (
|
|
3602
3602
|
/** @type {HTMLElement | SVGElement} */
|
|
@@ -3607,10 +3607,10 @@ function Navigation(e2, t2) {
|
|
|
3607
3607
|
width: o4.width,
|
|
3608
3608
|
height: o4.height,
|
|
3609
3609
|
transform: o4.transform
|
|
3610
|
-
}, o4.position = "absolute", o4.width = n8, o4.height =
|
|
3610
|
+
}, o4.position = "absolute", o4.width = n8, o4.height = s4;
|
|
3611
3611
|
var a6 = e7.getBoundingClientRect();
|
|
3612
|
-
if (
|
|
3613
|
-
var c3 = `translate(${
|
|
3612
|
+
if (i4.left !== a6.left || i4.top !== a6.top) {
|
|
3613
|
+
var c3 = `translate(${i4.left - a6.left}px, ${i4.top - a6.top}px)`;
|
|
3614
3614
|
o4.transform = o4.transform ? `${o4.transform} ${c3}` : c3;
|
|
3615
3615
|
}
|
|
3616
3616
|
}
|
|
@@ -3630,9 +3630,9 @@ function Navigation(e2, t2) {
|
|
|
3630
3630
|
// swap out the element rather than creating a new manager, in case it happened at the same
|
|
3631
3631
|
// moment as a reconciliation
|
|
3632
3632
|
a5.a.element = e7;
|
|
3633
|
-
}(
|
|
3633
|
+
}(i3, () => flip, () => ({
|
|
3634
3634
|
duration: 150
|
|
3635
|
-
})), append(e6,
|
|
3635
|
+
})), append(e6, i3);
|
|
3636
3636
|
}), append(e5, n5);
|
|
3637
3637
|
};
|
|
3638
3638
|
if_block(e4, (e5) => {
|
|
@@ -3640,12 +3640,12 @@ function Navigation(e2, t2) {
|
|
|
3640
3640
|
}, n4);
|
|
3641
3641
|
};
|
|
3642
3642
|
if_block(g3, (e4) => {
|
|
3643
|
-
0 ===
|
|
3643
|
+
0 === i2().length ? e4(consequent) : e4(alternate, false);
|
|
3644
3644
|
}), bind_this(n3, (e4) => set(c2, e4), () => get$1(c2)), function bind_value(e4, t3, n4 = t3) {
|
|
3645
|
-
var
|
|
3646
|
-
listen_to_event_and_reset_event(e4, "input", (
|
|
3647
|
-
var o3 =
|
|
3648
|
-
if (o3 = is_numberlike_input(e4) ? to_number(o3) : o3, n4(o3),
|
|
3645
|
+
var i3 = is_runes();
|
|
3646
|
+
listen_to_event_and_reset_event(e4, "input", (s3) => {
|
|
3647
|
+
var o3 = s3 ? e4.defaultValue : e4.value;
|
|
3648
|
+
if (o3 = is_numberlike_input(e4) ? to_number(o3) : o3, n4(o3), i3 && o3 !== (o3 = t3())) {
|
|
3649
3649
|
var a4 = e4.selectionStart, l3 = e4.selectionEnd;
|
|
3650
3650
|
e4.value = o3 ?? "", // Restore selection
|
|
3651
3651
|
null !== l3 && (e4.selectionStart = a4, e4.selectionEnd = Math.min(l3, e4.value.length));
|
|
@@ -3678,26 +3678,26 @@ function Navigation(e2, t2) {
|
|
|
3678
3678
|
}
|
|
3679
3679
|
delegate(["click"]);
|
|
3680
3680
|
var dt = /* @__PURE__ */ template('<div class="-mx-10 mt-5 flex h-92 w-10 flex-col"><div class="flex h-full items-center justify-center"><div class="flex h-full w-full flex-col items-center justify-between"><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>');
|
|
3681
|
-
function restore(e2, t2, n2,
|
|
3682
|
-
set(t2, false), set(n2, true), set(
|
|
3683
|
-
set(
|
|
3681
|
+
function restore(e2, t2, n2, i2, s2, o2) {
|
|
3682
|
+
set(t2, false), set(n2, true), set(i2, 250), set(s2, 0), o2(250, 0, 250, (e3, t3, n3) => {
|
|
3683
|
+
set(i2, e3 * (1 - n3)), set(s2, n3, true);
|
|
3684
3684
|
});
|
|
3685
3685
|
}
|
|
3686
|
-
async function toggleLike(e2, t2, n2,
|
|
3686
|
+
async function toggleLike(e2, t2, n2, i2) {
|
|
3687
3687
|
var _a2;
|
|
3688
3688
|
if (!((_a2 = t2.currentGame) == null ? void 0 : _a2.id)) return;
|
|
3689
|
-
const
|
|
3690
|
-
store_set(Oe,
|
|
3689
|
+
const s2 = !get$1(n2);
|
|
3690
|
+
store_set(Oe, s2), set(n2, !get$1(n2)), // Toggle liked state
|
|
3691
3691
|
// Save to localStorage
|
|
3692
|
-
|
|
3693
|
-
await Qe.toggleLike(t2.currentGame.id,
|
|
3692
|
+
s2 ? localStorage.setItem(`playlight_${t2.currentGame.id}_liked`, "true") : localStorage.removeItem(`playlight_${t2.currentGame.id}_liked`);
|
|
3693
|
+
await Qe.toggleLike(t2.currentGame.id, s2) || store_set(Oe, !s2);
|
|
3694
3694
|
}
|
|
3695
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);
|
|
3696
3696
|
function CurrentGameDisplay(e2, t2) {
|
|
3697
3697
|
var _a2;
|
|
3698
3698
|
push(t2, true);
|
|
3699
|
-
const [n2,
|
|
3700
|
-
let
|
|
3699
|
+
const [n2, i2] = setup_stores(), $likedInThisSession = () => store_get(Oe, "$likedInThisSession", n2);
|
|
3700
|
+
let s2 = 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;
|
|
3701
3701
|
function startDrag(e3) {
|
|
3702
3702
|
set(u2, true), p2 = e3.type.includes("touch") ? e3.touches[0].clientY : e3.clientY;
|
|
3703
3703
|
}
|
|
@@ -3717,11 +3717,11 @@ function CurrentGameDisplay(e2, t2) {
|
|
|
3717
3717
|
});
|
|
3718
3718
|
}());
|
|
3719
3719
|
}
|
|
3720
|
-
function animate2(e3, t3, n3,
|
|
3721
|
-
const
|
|
3720
|
+
function animate2(e3, t3, n3, i3) {
|
|
3721
|
+
const s3 = Date.now();
|
|
3722
3722
|
!function frame() {
|
|
3723
|
-
const o3 = Math.min((Date.now() -
|
|
3724
|
-
|
|
3723
|
+
const o3 = Math.min((Date.now() - s3) / n3, 1);
|
|
3724
|
+
i3(e3, t3, o3), o3 < 1 && requestAnimationFrame(frame);
|
|
3725
3725
|
}();
|
|
3726
3726
|
}
|
|
3727
3727
|
user_effect(() => {
|
|
@@ -3731,7 +3731,7 @@ function CurrentGameDisplay(e2, t2) {
|
|
|
3731
3731
|
var g2 = gt(), _2 = first_child(g2), consequent = (e3) => {
|
|
3732
3732
|
var n3 = ft();
|
|
3733
3733
|
n3.__mousedown = startDrag, n3.__mousemove = drag, n3.__mouseup = endDrag, n3.__touchstart = startDrag, n3.__touchmove = drag, n3.__touchend = endDrag;
|
|
3734
|
-
var
|
|
3734
|
+
var i3 = sibling(child(n3), 2), o3 = child(i3);
|
|
3735
3735
|
let a3;
|
|
3736
3736
|
var u3 = sibling(o3, 2), p3 = child(u3), g3 = child(sibling(u3, 2)), _3 = child(g3), v3 = sibling(g3, 2);
|
|
3737
3737
|
v3.__click = [toggleLike, t2, d2, $likedInThisSession];
|
|
@@ -3748,8 +3748,8 @@ function CurrentGameDisplay(e2, t2) {
|
|
|
3748
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"
|
|
3749
3749
|
}]],
|
|
3750
3750
|
children: (e5, n5) => {
|
|
3751
|
-
var
|
|
3752
|
-
slot(first_child(
|
|
3751
|
+
var i4 = comment();
|
|
3752
|
+
slot(first_child(i4), t3, "default", {}, null), append(e5, i4);
|
|
3753
3753
|
},
|
|
3754
3754
|
$$slots: {
|
|
3755
3755
|
default: true
|
|
@@ -3766,9 +3766,9 @@ function CurrentGameDisplay(e2, t2) {
|
|
|
3766
3766
|
var _a3, _b2;
|
|
3767
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");
|
|
3768
3768
|
}, [() => ({
|
|
3769
|
-
"animate-pulse": !get$1(
|
|
3769
|
+
"animate-pulse": !get$1(s2)
|
|
3770
3770
|
})]), event("mouseleave", n3, endDrag), event("load", o3, () => {
|
|
3771
|
-
set(
|
|
3771
|
+
set(s2, true);
|
|
3772
3772
|
}), append(e3, n3);
|
|
3773
3773
|
};
|
|
3774
3774
|
if_block(_2, (e3) => {
|
|
@@ -3783,17 +3783,17 @@ function CurrentGameDisplay(e2, t2) {
|
|
|
3783
3783
|
};
|
|
3784
3784
|
if_block(v2, (e3) => {
|
|
3785
3785
|
t2.currentGame && get$1(a2) && e3(consequent_1);
|
|
3786
|
-
}), append(e2, g2), pop(),
|
|
3786
|
+
}), append(e2, g2), pop(), i2();
|
|
3787
3787
|
}
|
|
3788
3788
|
function closeDiscoveryOnEmptyClick(e2, t2) {
|
|
3789
|
-
e2.target === e2.currentTarget && store_set(
|
|
3789
|
+
e2.target === e2.currentTarget && store_set(Te, false);
|
|
3790
3790
|
}
|
|
3791
3791
|
delegate(["mousedown", "mousemove", "mouseup", "touchstart", "touchmove", "touchend", "click"]);
|
|
3792
|
-
var on_click$1 = (e2, t2) => store_set(
|
|
3792
|
+
var on_click$1 = (e2, t2) => store_set(Te, 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="pointer-events-none mx-auto flex h-fit flex-wrap content-start justify-center gap-10 lg:max-w-4/5"><!> <div class="pointer-events-none 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>');
|
|
3793
3793
|
function DiscoveryOverlay(e2, t2) {
|
|
3794
3794
|
push(t2, true);
|
|
3795
|
-
const [n2,
|
|
3796
|
-
let
|
|
3795
|
+
const [n2, i2] = setup_stores(), $discoveryOpen = () => store_get(Te, "$discoveryOpen", n2);
|
|
3796
|
+
let s2, 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);
|
|
3797
3797
|
async function loadNewFeed() {
|
|
3798
3798
|
var _a2, _b2;
|
|
3799
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({
|
|
@@ -3804,19 +3804,19 @@ function DiscoveryOverlay(e2, t2) {
|
|
|
3804
3804
|
async function fetchGames() {
|
|
3805
3805
|
if (get$1(o2) || get$1(a2)) return;
|
|
3806
3806
|
1 === get$1(f2) ? set(o2, true) : set(a2, true);
|
|
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) || [],
|
|
3808
|
-
if (set(d2, [...get$1(d2), ...
|
|
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) || [], i3 = (t3 == null ? void 0 : t3.pageSize) || 15, s3 = n3.filter((e4) => !get$1(d2).some((t4) => t4.id === e4.id));
|
|
3808
|
+
if (set(d2, [...get$1(d2), ...s3], true), n3.length < i3 ? !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
3809
|
set(o2, false), set(a2, false), get$1(p2) && get$1(_2)) {
|
|
3810
3810
|
get$1(_2).getBoundingClientRect().bottom <= window.innerHeight + 300 && fetchGames();
|
|
3811
3811
|
}
|
|
3812
3812
|
}
|
|
3813
|
-
onMount(() => (
|
|
3813
|
+
onMount(() => (s2 = new IntersectionObserver((e3) => {
|
|
3814
3814
|
e3[0].isIntersecting && get$1(p2) && fetchGames();
|
|
3815
3815
|
}, {
|
|
3816
3816
|
rootMargin: "300px",
|
|
3817
3817
|
root: get$1(v2)
|
|
3818
|
-
}), () =>
|
|
3819
|
-
get$1(_2) &&
|
|
3818
|
+
}), () => s2 == null ? void 0 : s2.disconnect())), user_effect(() => {
|
|
3819
|
+
get$1(_2) && s2 && s2.observe(get$1(_2));
|
|
3820
3820
|
}), onMount(async () => {
|
|
3821
3821
|
var _a2, _b2, _c2;
|
|
3822
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
|
|
@@ -3824,7 +3824,7 @@ function DiscoveryOverlay(e2, t2) {
|
|
|
3824
3824
|
});
|
|
3825
3825
|
var h2 = yt();
|
|
3826
3826
|
event("keydown", z, (e3) => {
|
|
3827
|
-
"Escape" == e3.key && store_set(
|
|
3827
|
+
"Escape" == e3.key && store_set(Te, false);
|
|
3828
3828
|
}), h2.__click = [closeDiscoveryOnEmptyClick, $discoveryOpen];
|
|
3829
3829
|
var m2 = child(h2), b2 = child(m2), y2 = child(sibling(b2, 2));
|
|
3830
3830
|
y2.__click = [on_click$1, $discoveryOpen], function X(e3, t3) {
|
|
@@ -3838,8 +3838,8 @@ function DiscoveryOverlay(e2, t2) {
|
|
|
3838
3838
|
d: "m6 6 12 12"
|
|
3839
3839
|
}]],
|
|
3840
3840
|
children: (e4, n4) => {
|
|
3841
|
-
var
|
|
3842
|
-
slot(first_child(
|
|
3841
|
+
var i3 = comment();
|
|
3842
|
+
slot(first_child(i3), t3, "default", {}, null), append(e4, i3);
|
|
3843
3843
|
},
|
|
3844
3844
|
$$slots: {
|
|
3845
3845
|
default: true
|
|
@@ -3883,22 +3883,22 @@ function DiscoveryOverlay(e2, t2) {
|
|
|
3883
3883
|
}, alternate_1 = (e4) => {
|
|
3884
3884
|
var t4 = bt(), n3 = child(t4);
|
|
3885
3885
|
each(n3, 17, () => get$1(d2), index, (e5, t5, n4) => {
|
|
3886
|
-
var
|
|
3887
|
-
const
|
|
3888
|
-
var o3 = first_child(
|
|
3886
|
+
var i4 = ht();
|
|
3887
|
+
const s4 = user_derived(() => get$1(d2).findIndex((e6) => e6.category !== get$1(u2) && !e6.featured));
|
|
3888
|
+
var o3 = first_child(i4), consequent_2 = (e6) => {
|
|
3889
3889
|
!function GameCategorySeperator(e7) {
|
|
3890
3890
|
append(e7, dt());
|
|
3891
3891
|
}(e6);
|
|
3892
3892
|
};
|
|
3893
3893
|
if_block(o3, (e6) => {
|
|
3894
|
-
n4 == get$1(
|
|
3894
|
+
n4 == get$1(s4) && e6(consequent_2);
|
|
3895
3895
|
}), GameCard(sibling(o3, 2), {
|
|
3896
3896
|
get game() {
|
|
3897
3897
|
return get$1(t5);
|
|
3898
3898
|
}
|
|
3899
|
-
}), append(e5,
|
|
3899
|
+
}), append(e5, i4);
|
|
3900
3900
|
});
|
|
3901
|
-
var
|
|
3901
|
+
var i3 = sibling(n3, 2), s3 = child(i3), consequent_3 = (e5) => {
|
|
3902
3902
|
var t5 = mt();
|
|
3903
3903
|
Loader_circle(child(t5), {
|
|
3904
3904
|
class: "animate-spin opacity-75",
|
|
@@ -3906,9 +3906,9 @@ function DiscoveryOverlay(e2, t2) {
|
|
|
3906
3906
|
strokeWidth: 2.5
|
|
3907
3907
|
}), append(e5, t5);
|
|
3908
3908
|
};
|
|
3909
|
-
if_block(
|
|
3909
|
+
if_block(s3, (e5) => {
|
|
3910
3910
|
get$1(a2) && e5(consequent_3);
|
|
3911
|
-
}), bind_this(
|
|
3911
|
+
}), bind_this(i3, (e5) => set(_2, e5), () => get$1(_2)), append(e4, t4);
|
|
3912
3912
|
};
|
|
3913
3913
|
if_block(e3, (e4) => {
|
|
3914
3914
|
0 !== get$1(d2).length || get$1(o2) ? e4(alternate_1, false) : e4(consequent_1);
|
|
@@ -3931,8 +3931,8 @@ function DiscoveryOverlay(e2, t2) {
|
|
|
3931
3931
|
d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"
|
|
3932
3932
|
}]],
|
|
3933
3933
|
children: (e4, n4) => {
|
|
3934
|
-
var
|
|
3935
|
-
slot(first_child(
|
|
3934
|
+
var i3 = comment();
|
|
3935
|
+
slot(first_child(i3), t3, "default", {}, null), append(e4, i3);
|
|
3936
3936
|
},
|
|
3937
3937
|
$$slots: {
|
|
3938
3938
|
default: true
|
|
@@ -3942,7 +3942,7 @@ function DiscoveryOverlay(e2, t2) {
|
|
|
3942
3942
|
size: 14
|
|
3943
3943
|
}), template_effect(() => set_attribute(b2, "src", store_get(qe, "$projectUrl", n2) + "/static/images/logo-white-small.png")), transition(3, h2, () => blur, () => ({
|
|
3944
3944
|
duration: 250
|
|
3945
|
-
})), append(e2, h2), pop(),
|
|
3945
|
+
})), append(e2, h2), pop(), i2();
|
|
3946
3946
|
}
|
|
3947
3947
|
delegate(["click"]);
|
|
3948
3948
|
var $t = /* @__PURE__ */ template("<button><!></button>");
|
|
@@ -3952,77 +3952,86 @@ function Button(e2, t2) {
|
|
|
3952
3952
|
var _a2;
|
|
3953
3953
|
(_a2 = t2.onclick) == null ? void 0 : _a2.apply(this, e3);
|
|
3954
3954
|
}, function snippet(e3, t3, ...n3) {
|
|
3955
|
-
var
|
|
3955
|
+
var i2, s2 = e3, o2 = noop;
|
|
3956
3956
|
block(() => {
|
|
3957
|
-
o2 !== (o2 = t3()) && (
|
|
3957
|
+
o2 !== (o2 = t3()) && (i2 && (destroy_effect(i2), i2 = null), i2 = branch(() => (
|
|
3958
3958
|
/** @type {SnippetFn} */
|
|
3959
|
-
o2(
|
|
3959
|
+
o2(s2, ...n3)
|
|
3960
3960
|
)));
|
|
3961
3961
|
}, w);
|
|
3962
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);
|
|
3963
3963
|
}
|
|
3964
3964
|
delegate(["click"]);
|
|
3965
|
+
const wt = /* @__PURE__ */ new Map();
|
|
3966
|
+
async function triggerEvent(e2, ...t2) {
|
|
3967
|
+
const n2 = wt.get(e2);
|
|
3968
|
+
if (n2) for (const i2 of n2) try {
|
|
3969
|
+
await i2(...t2);
|
|
3970
|
+
} catch (t3) {
|
|
3971
|
+
console.error(`Playlight ${e2} callback error:`, t3);
|
|
3972
|
+
}
|
|
3973
|
+
}
|
|
3965
3974
|
var on_pointerover = (e2, t2) => {
|
|
3966
3975
|
"touch" !== e2.pointerType && t2();
|
|
3967
|
-
},
|
|
3976
|
+
}, xt = /* @__PURE__ */ template('<div class="fixed top-0 right-0 left-0 h-4"></div>'), kt = /* @__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>'), Ct = /* @__PURE__ */ template('<div class="ml-3 flex items-center -space-x-2"></div>'), St = /* @__PURE__ */ template("More games <!>", 1), It = /* @__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);
|
|
3968
3977
|
function ExitIntentDetector(e2, t2) {
|
|
3969
3978
|
push(t2, true);
|
|
3970
|
-
let n2,
|
|
3979
|
+
let n2, i2 = prop(t2, "enabled", 3, true), s2 = prop(t2, "immediate", 3, false), o2 = state(void 0), a2 = state(void 0), l2 = state(false), c2 = state(void 0);
|
|
3971
3980
|
function handleBarTrigger() {
|
|
3972
3981
|
setTimeout(() => {
|
|
3973
3982
|
var _a2;
|
|
3974
|
-
n2 < Date.now() - 50 && (clearTimeout(get$1(c2)), set(c2, null),
|
|
3983
|
+
n2 < Date.now() - 50 && (clearTimeout(get$1(c2)), set(c2, null), s2() ? (triggerEvent("exitIntent"), (_a2 = t2.onIntent) == null ? void 0 : _a2.call(t2)) : (!async function loadInitialSuggestions() {
|
|
3975
3984
|
const e3 = await Qe.getCategories(), t3 = await Qe.getCurrentGameInfo();
|
|
3976
3985
|
get$1(d2) || set(d2, (t3 == null ? void 0 : t3.category) || (e3 == null ? void 0 : e3[(e3 == null ? void 0 : e3.length) - 1]), true);
|
|
3977
3986
|
let n3 = await Qe.getSuggestions(get$1(d2), 1);
|
|
3978
3987
|
set(f2, ((n3 == null ? void 0 : n3.games) || []).slice(0, 3), true);
|
|
3979
|
-
}(), set(l2, true)));
|
|
3988
|
+
}(), triggerEvent("exitIntent"), set(l2, true)));
|
|
3980
3989
|
}, 150);
|
|
3981
3990
|
}
|
|
3982
3991
|
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([]));
|
|
3983
3992
|
var p2 = Mt();
|
|
3984
3993
|
event("mousemove", P, function trackMouse(e3) {
|
|
3985
3994
|
var _a2, _b2;
|
|
3986
|
-
!
|
|
3995
|
+
!i2() || ((_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());
|
|
3987
3996
|
});
|
|
3988
3997
|
var g2 = first_child(p2), consequent = (e3) => {
|
|
3989
|
-
var t3 =
|
|
3998
|
+
var t3 = xt();
|
|
3990
3999
|
t3.__pointerover = [on_pointerover, handleBarTrigger], bind_this(t3, (e4) => set(o2, e4), () => get$1(o2)), append(e3, t3);
|
|
3991
4000
|
};
|
|
3992
4001
|
if_block(g2, (e3) => {
|
|
3993
|
-
|
|
4002
|
+
i2() && e3(consequent);
|
|
3994
4003
|
});
|
|
3995
4004
|
var _2 = sibling(g2, 2), consequent_2 = (e3) => {
|
|
3996
|
-
var n3 =
|
|
3997
|
-
Button(sibling(
|
|
4005
|
+
var n3 = It(), i3 = child(n3), s3 = child(i3);
|
|
4006
|
+
Button(sibling(i3, 2), {
|
|
3998
4007
|
class: "group",
|
|
3999
4008
|
onclick: () => {
|
|
4000
4009
|
var _a2;
|
|
4001
4010
|
(_a2 = t2.onIntent) == null ? void 0 : _a2.call(t2), setTimeout(() => set(l2, false), 150);
|
|
4002
4011
|
},
|
|
4003
4012
|
children: (e4, t3) => {
|
|
4004
|
-
var n4 =
|
|
4005
|
-
var t4 =
|
|
4013
|
+
var n4 = St(), i4 = sibling(first_child(n4)), consequent_1 = (e5) => {
|
|
4014
|
+
var t4 = Ct();
|
|
4006
4015
|
each(t4, 21, () => get$1(f2), index, (e6, t5, n5) => {
|
|
4007
|
-
var
|
|
4008
|
-
let
|
|
4009
|
-
var o3 = child(
|
|
4016
|
+
var i5 = kt();
|
|
4017
|
+
let s4;
|
|
4018
|
+
var o3 = child(i5);
|
|
4010
4019
|
template_effect(() => {
|
|
4011
|
-
|
|
4020
|
+
s4 = set_style(i5, "", s4, {
|
|
4012
4021
|
"z-index": get$1(f2).length - n5
|
|
4013
4022
|
}), set_attribute(o3, "src", get$1(t5).logo_url);
|
|
4014
|
-
}), append(e6,
|
|
4023
|
+
}), append(e6, i5);
|
|
4015
4024
|
}), transition(3, t4, () => slide, () => ({
|
|
4016
4025
|
axis: "x",
|
|
4017
4026
|
duration: 150
|
|
4018
4027
|
})), append(e5, t4);
|
|
4019
4028
|
};
|
|
4020
|
-
if_block(
|
|
4029
|
+
if_block(i4, (e5) => {
|
|
4021
4030
|
var _a2;
|
|
4022
4031
|
((_a2 = get$1(f2)) == null ? void 0 : _a2.length) >= 3 && e5(consequent_1);
|
|
4023
4032
|
}), append(e4, n4);
|
|
4024
4033
|
}
|
|
4025
|
-
}), bind_this(n3, (e4) => set(a2, e4), () => get$1(a2)), template_effect((e4) => set_text(
|
|
4034
|
+
}), bind_this(n3, (e4) => set(a2, e4), () => get$1(a2)), template_effect((e4) => set_text(s3, e4), [() => u2[Math.floor(Math.random() * u2.length)]]), event("mouseenter", n3, () => {
|
|
4026
4035
|
clearTimeout(get$1(c2)), set(c2, null);
|
|
4027
4036
|
}), transition(3, n3, () => fly, () => ({
|
|
4028
4037
|
y: -100,
|
|
@@ -4038,14 +4047,14 @@ delegate(["pointerover"]);
|
|
|
4038
4047
|
var Tt = /* @__PURE__ */ template("<!> <!> <!> <!>", 1);
|
|
4039
4048
|
function App(e2, t2) {
|
|
4040
4049
|
push(t2, true);
|
|
4041
|
-
const [n2,
|
|
4050
|
+
const [n2, i2] = setup_stores(), $discoveryOpen = () => store_get(Te, "$discoveryOpen", n2), $config = () => store_get(t2.config, "$config", n2);
|
|
4042
4051
|
function openDiscovery() {
|
|
4043
|
-
$discoveryOpen() || (store_set(
|
|
4052
|
+
$discoveryOpen() || (store_set(Te, true), Qe.trackOpen());
|
|
4044
4053
|
}
|
|
4045
|
-
let
|
|
4046
|
-
|
|
4054
|
+
let s2;
|
|
4055
|
+
Te.subscribe((e3) => {
|
|
4047
4056
|
try {
|
|
4048
|
-
e3 ? (
|
|
4057
|
+
e3 ? (triggerEvent("discoveryOpen"), s2 = document.body.style.overflow, document.body.style.overflow = "hidden") : (triggerEvent("discoveryClose"), document.body.style.overflow = s2);
|
|
4049
4058
|
} catch (e4) {
|
|
4050
4059
|
console.error("Failed to toggle body overflow style:", e4);
|
|
4051
4060
|
}
|
|
@@ -4095,9 +4104,9 @@ function App(e2, t2) {
|
|
|
4095
4104
|
};
|
|
4096
4105
|
if_block(g2, (e3) => {
|
|
4097
4106
|
$discoveryOpen() && e3(consequent_1);
|
|
4098
|
-
}), append(e2, o2), pop(),
|
|
4107
|
+
}), append(e2, o2), pop(), i2();
|
|
4099
4108
|
}
|
|
4100
|
-
const
|
|
4109
|
+
const Ot = {
|
|
4101
4110
|
button: {
|
|
4102
4111
|
position: "bottom-right",
|
|
4103
4112
|
visible: true
|
|
@@ -4107,40 +4116,40 @@ const It = {
|
|
|
4107
4116
|
immediate: false
|
|
4108
4117
|
}
|
|
4109
4118
|
};
|
|
4110
|
-
let
|
|
4111
|
-
...
|
|
4119
|
+
let qt = {
|
|
4120
|
+
...Ot
|
|
4112
4121
|
};
|
|
4113
4122
|
function initializeConfig(e2 = {}) {
|
|
4114
|
-
return
|
|
4123
|
+
return qt = deepMerge(Ot, e2), qt;
|
|
4115
4124
|
}
|
|
4116
4125
|
function deepMerge(e2, t2) {
|
|
4117
4126
|
const n2 = {
|
|
4118
4127
|
...e2
|
|
4119
4128
|
};
|
|
4120
|
-
return isObject(e2) && isObject(t2) && Object.keys(t2).forEach((
|
|
4121
|
-
isObject(t2[
|
|
4122
|
-
[
|
|
4129
|
+
return isObject(e2) && isObject(t2) && Object.keys(t2).forEach((i2) => {
|
|
4130
|
+
isObject(t2[i2]) ? i2 in e2 ? n2[i2] = deepMerge(e2[i2], t2[i2]) : Object.assign(n2, {
|
|
4131
|
+
[i2]: t2[i2]
|
|
4123
4132
|
}) : Object.assign(n2, {
|
|
4124
|
-
[
|
|
4133
|
+
[i2]: t2[i2]
|
|
4125
4134
|
});
|
|
4126
4135
|
}), n2;
|
|
4127
4136
|
}
|
|
4128
4137
|
function isObject(e2) {
|
|
4129
4138
|
return e2 && "object" == typeof e2 && !Array.isArray(e2);
|
|
4130
4139
|
}
|
|
4131
|
-
var
|
|
4140
|
+
var Pt = /* @__PURE__ */ template('<div class="flex h-62 w-full items-center justify-center"><!></div>'), zt = /* @__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({
|
|
4132
4141
|
left: 2 * -get$1(n2),
|
|
4133
4142
|
behavior: "smooth"
|
|
4134
|
-
}),
|
|
4143
|
+
}), Et = /* @__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({
|
|
4135
4144
|
left: 2 * get$1(n2),
|
|
4136
4145
|
behavior: "smooth"
|
|
4137
4146
|
}), 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>');
|
|
4138
4147
|
function WidgetCarousel(e2, t2) {
|
|
4139
4148
|
push(t2, true);
|
|
4140
|
-
const [n2,
|
|
4141
|
-
let
|
|
4149
|
+
const [n2, i2] = setup_stores();
|
|
4150
|
+
let s2 = state(true), o2 = state(proxy([])), a2 = state(void 0), l2 = state(void 0), c2 = state(0), u2 = state(false), d2 = state(true), f2 = state("");
|
|
4142
4151
|
function updateMask(e3, t3) {
|
|
4143
|
-
const n3 = Math.min(e3 / 50, 1),
|
|
4152
|
+
const n3 = Math.min(e3 / 50, 1), i3 = Math.min(t3 / 50, 1);
|
|
4144
4153
|
set(f2, `mask-image: linear-gradient(
|
|
4145
4154
|
to right,
|
|
4146
4155
|
rgba(0, 0, 0, ${1 - 0.95 * n3}) 0%,
|
|
@@ -4151,57 +4160,57 @@ function WidgetCarousel(e2, t2) {
|
|
|
4151
4160
|
rgba(0, 0, 0, ${1 - 0.046 * n3}) 8%,
|
|
4152
4161
|
black 9%,
|
|
4153
4162
|
black 91%,
|
|
4154
|
-
rgba(0, 0, 0, ${0.954 *
|
|
4155
|
-
rgba(0, 0, 0, ${0.86 *
|
|
4156
|
-
rgba(0, 0, 0, ${0.74 *
|
|
4157
|
-
rgba(0, 0, 0, ${0.554 *
|
|
4158
|
-
rgba(0, 0, 0, ${0.326 *
|
|
4159
|
-
rgba(0, 0, 0, ${0.05 *
|
|
4163
|
+
rgba(0, 0, 0, ${0.954 * i3 + (1 - i3)}) 92%,
|
|
4164
|
+
rgba(0, 0, 0, ${0.86 * i3 + (1 - i3)}) 93.5%,
|
|
4165
|
+
rgba(0, 0, 0, ${0.74 * i3 + (1 - i3)}) 95%,
|
|
4166
|
+
rgba(0, 0, 0, ${0.554 * i3 + (1 - i3)}) 96.5%,
|
|
4167
|
+
rgba(0, 0, 0, ${0.326 * i3 + (1 - i3)}) 98%,
|
|
4168
|
+
rgba(0, 0, 0, ${0.05 * i3 + (1 - i3)})
|
|
4160
4169
|
)`);
|
|
4161
4170
|
}
|
|
4162
4171
|
onMount(async () => {
|
|
4163
4172
|
const e3 = await Qe.getCategories(), t3 = await Qe.getCurrentGameInfo();
|
|
4164
4173
|
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() {
|
|
4165
|
-
set(
|
|
4174
|
+
set(s2, true);
|
|
4166
4175
|
let e4 = await Qe.getSuggestions(get$1(a2), 1), t4 = (e4 == null ? void 0 : e4.games) || [];
|
|
4167
4176
|
if (t4.length < 10 && get$1(a2)) {
|
|
4168
4177
|
const e5 = await Qe.getSuggestions(null, 1), n3 = ((e5 == null ? void 0 : e5.games) || []).filter((e6) => !t4.some((t5) => t5.id === e6.id));
|
|
4169
4178
|
t4 = [...t4, ...n3];
|
|
4170
4179
|
}
|
|
4171
|
-
set(o2, t4.slice(0, 10), true), set(
|
|
4180
|
+
set(o2, t4.slice(0, 10), true), set(s2, false);
|
|
4172
4181
|
}(), get$1(l2)) {
|
|
4173
4182
|
const e4 = get$1(l2).scrollWidth - get$1(l2).clientWidth;
|
|
4174
4183
|
updateMask(get$1(l2).scrollLeft, e4 - get$1(l2).scrollLeft);
|
|
4175
4184
|
}
|
|
4176
4185
|
});
|
|
4177
4186
|
var p2 = Nt(), g2 = child(p2), _2 = child(g2), consequent = (e3) => {
|
|
4178
|
-
var t3 =
|
|
4187
|
+
var t3 = Pt();
|
|
4179
4188
|
Loader_circle(child(t3), {
|
|
4180
4189
|
class: "animate-spin opacity-75",
|
|
4181
4190
|
size: 30,
|
|
4182
4191
|
strokeWidth: 2.5
|
|
4183
4192
|
}), append(e3, t3);
|
|
4184
4193
|
}, alternate = (e3) => {
|
|
4185
|
-
var t3 =
|
|
4194
|
+
var t3 = Wt(), n3 = first_child(t3);
|
|
4186
4195
|
each(n3, 17, () => get$1(o2), index, (e4, t4) => {
|
|
4187
|
-
var n4 =
|
|
4196
|
+
var n4 = zt();
|
|
4188
4197
|
GameCard(child(n4), {
|
|
4189
4198
|
get game() {
|
|
4190
4199
|
return get$1(t4);
|
|
4191
4200
|
},
|
|
4192
4201
|
compact: true
|
|
4193
4202
|
}), function bind_element_size(e5, t5, n5) {
|
|
4194
|
-
var
|
|
4203
|
+
var i4 = ye.observe(e5, () => n5(e5[t5]));
|
|
4195
4204
|
effect(() => (
|
|
4196
4205
|
// The update could contain reads which should be ignored
|
|
4197
|
-
(untrack(() => n5(e5[t5])),
|
|
4206
|
+
(untrack(() => n5(e5[t5])), i4)
|
|
4198
4207
|
));
|
|
4199
4208
|
}(n4, "clientWidth", (e5) => set(c2, e5)), append(e4, n4);
|
|
4200
4209
|
});
|
|
4201
|
-
var
|
|
4202
|
-
Button(sibling(child(
|
|
4210
|
+
var i3 = sibling(n3, 2);
|
|
4211
|
+
Button(sibling(child(i3), 2), {
|
|
4203
4212
|
onclick: () => {
|
|
4204
|
-
store_set(
|
|
4213
|
+
store_set(Te, true), Qe.trackOpen();
|
|
4205
4214
|
},
|
|
4206
4215
|
children: (e4, t4) => {
|
|
4207
4216
|
append(e4, text("See all"));
|
|
@@ -4209,11 +4218,11 @@ function WidgetCarousel(e2, t2) {
|
|
|
4209
4218
|
}), append(e3, t3);
|
|
4210
4219
|
};
|
|
4211
4220
|
if_block(_2, (e3) => {
|
|
4212
|
-
get$1(
|
|
4221
|
+
get$1(s2) ? e3(consequent) : e3(alternate, false);
|
|
4213
4222
|
}), bind_this(g2, (e3) => set(l2, e3), () => get$1(l2));
|
|
4214
4223
|
var v2 = sibling(g2, 2), consequent_3 = (e3) => {
|
|
4215
4224
|
var t3 = Dt(), n3 = first_child(t3), consequent_1 = (e4) => {
|
|
4216
|
-
var t4 =
|
|
4225
|
+
var t4 = Et();
|
|
4217
4226
|
t4.__click = [on_click, l2, c2], function Chevron_left(e5, t5) {
|
|
4218
4227
|
const n4 = legacy_rest_props(t5, ["children", "$$slots", "$$events", "$$legacy"]);
|
|
4219
4228
|
Icon$1(e5, spread_props({
|
|
@@ -4223,8 +4232,8 @@ function WidgetCarousel(e2, t2) {
|
|
|
4223
4232
|
d: "m15 18-6-6 6-6"
|
|
4224
4233
|
}]],
|
|
4225
4234
|
children: (e6, n5) => {
|
|
4226
|
-
var
|
|
4227
|
-
slot(first_child(
|
|
4235
|
+
var i4 = comment();
|
|
4236
|
+
slot(first_child(i4), t5, "default", {}, null), append(e6, i4);
|
|
4228
4237
|
},
|
|
4229
4238
|
$$slots: {
|
|
4230
4239
|
default: true
|
|
@@ -4238,7 +4247,7 @@ function WidgetCarousel(e2, t2) {
|
|
|
4238
4247
|
if_block(n3, (e4) => {
|
|
4239
4248
|
get$1(u2) && e4(consequent_1);
|
|
4240
4249
|
});
|
|
4241
|
-
var
|
|
4250
|
+
var i3 = sibling(n3, 2), consequent_2 = (e4) => {
|
|
4242
4251
|
var t4 = jt();
|
|
4243
4252
|
t4.__click = [on_click_1, l2, c2], function Chevron_right(e5, t5) {
|
|
4244
4253
|
const n4 = legacy_rest_props(t5, ["children", "$$slots", "$$events", "$$legacy"]);
|
|
@@ -4249,8 +4258,8 @@ function WidgetCarousel(e2, t2) {
|
|
|
4249
4258
|
d: "m9 18 6-6-6-6"
|
|
4250
4259
|
}]],
|
|
4251
4260
|
children: (e6, n5) => {
|
|
4252
|
-
var
|
|
4253
|
-
slot(first_child(
|
|
4261
|
+
var i4 = comment();
|
|
4262
|
+
slot(first_child(i4), t5, "default", {}, null), append(e6, i4);
|
|
4254
4263
|
},
|
|
4255
4264
|
$$slots: {
|
|
4256
4265
|
default: true
|
|
@@ -4261,7 +4270,7 @@ function WidgetCarousel(e2, t2) {
|
|
|
4261
4270
|
strokeWidth: 2.75
|
|
4262
4271
|
}), transition(3, t4, () => blur), append(e4, t4);
|
|
4263
4272
|
};
|
|
4264
|
-
if_block(
|
|
4273
|
+
if_block(i3, (e4) => {
|
|
4265
4274
|
get$1(d2) && e4(consequent_2);
|
|
4266
4275
|
}), append(e3, t3);
|
|
4267
4276
|
};
|
|
@@ -4270,7 +4279,7 @@ function WidgetCarousel(e2, t2) {
|
|
|
4270
4279
|
}), template_effect(() => set_style(g2, get$1(f2))), event("scroll", g2, (e3) => {
|
|
4271
4280
|
const t3 = e3.target;
|
|
4272
4281
|
set(u2, t3.scrollLeft > 20), set(d2, t3.scrollLeft < t3.scrollWidth - t3.clientWidth - 20), updateMask(t3.scrollLeft, t3.scrollWidth - t3.clientWidth - t3.scrollLeft);
|
|
4273
|
-
}), append(e2, p2), pop(),
|
|
4282
|
+
}), append(e2, p2), pop(), i2();
|
|
4274
4283
|
}
|
|
4275
4284
|
function initWidgets() {
|
|
4276
4285
|
try {
|
|
@@ -4290,6 +4299,9 @@ const Bt = new /**
|
|
|
4290
4299
|
* The PlaylightSDK class
|
|
4291
4300
|
*/
|
|
4292
4301
|
(_c = class {
|
|
4302
|
+
/**
|
|
4303
|
+
* Create new Playlight instance
|
|
4304
|
+
*/
|
|
4293
4305
|
constructor() {
|
|
4294
4306
|
__privateAdd(this, _PlaylightSDK_instances);
|
|
4295
4307
|
this.container = null, this.isInitialized = false, this.config = writable(null), this.api = Qe;
|
|
@@ -4299,9 +4311,9 @@ const Bt = new /**
|
|
|
4299
4311
|
* @param {Object} [userConfig] - The playlight configuration object
|
|
4300
4312
|
*/
|
|
4301
4313
|
async init(e2 = {}) {
|
|
4302
|
-
return "undefined" == typeof window ? console.error("Playlight cannot run on the server, as it depends on browser APIs.") : this.isInitialized ? (console.warn("Playlight SDK already initialized!"), void (document.getElementById("playlight-sdk-container") || __privateMethod(this, _PlaylightSDK_instances,
|
|
4314
|
+
return "undefined" == typeof window ? console.error("Playlight cannot run on the server, as it depends on browser APIs.") : this.isInitialized ? (console.warn("Playlight SDK already initialized!"), void (document.getElementById("playlight-sdk-container") || __privateMethod(this, _PlaylightSDK_instances, s_fn).call(this))) : (
|
|
4303
4315
|
// Initialize configuration with defaults and user overrides
|
|
4304
|
-
(this.setConfig(e2), __privateMethod(this, _PlaylightSDK_instances,
|
|
4316
|
+
(this.setConfig(e2), __privateMethod(this, _PlaylightSDK_instances, s_fn).call(this), // Create container and mount app
|
|
4305
4317
|
// Widgets
|
|
4306
4318
|
initWidgets(), function setupWidgetObserver() {
|
|
4307
4319
|
try {
|
|
@@ -4323,7 +4335,16 @@ const Bt = new /**
|
|
|
4323
4335
|
* @param {boolean} [value=true] - Whether to show the discovery
|
|
4324
4336
|
*/
|
|
4325
4337
|
setDiscovery(e2 = true) {
|
|
4326
|
-
this.isInitialized && (
|
|
4338
|
+
this.isInitialized && (Te.set(e2), e2 && Qe.trackOpen());
|
|
4339
|
+
}
|
|
4340
|
+
/**
|
|
4341
|
+
* Register an event callback
|
|
4342
|
+
* @param {string} event - Event name
|
|
4343
|
+
* @param {Function} callback - Callback function
|
|
4344
|
+
*/
|
|
4345
|
+
onEvent(e2, t2) {
|
|
4346
|
+
if (!["discoveryOpen", "discoveryClose", "exitIntent"].includes(e2)) return console.warn(`Invalid event type "${e2}!"`);
|
|
4347
|
+
wt.has(e2) || wt.set(e2, []), wt.get(e2).push(t2);
|
|
4327
4348
|
}
|
|
4328
4349
|
/**
|
|
4329
4350
|
* Update the configuration
|
|
@@ -4337,7 +4358,7 @@ const Bt = new /**
|
|
|
4337
4358
|
* Mount the Svelte app to the playlight container
|
|
4338
4359
|
* @private
|
|
4339
4360
|
*/
|
|
4340
|
-
|
|
4361
|
+
s_fn = function() {
|
|
4341
4362
|
try {
|
|
4342
4363
|
this.container = document.createElement("div"), this.container.id = "playlight-sdk-container", this.container.className = "playlight-sdk-container", document.body.appendChild(this.container), // Mount (client-side alternative to render)
|
|
4343
4364
|
mount(App, {
|