playlight-sdk 0.0.8 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/playlight-sdk.es.js
CHANGED
|
@@ -4,7 +4,7 @@ var __typeError = (msg) => {
|
|
|
4
4
|
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
5
5
|
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);
|
|
6
6
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
7
|
-
var _a, _PlayLightAPI_instances, e_fn, _b;
|
|
7
|
+
var _a, _PlayLightAPI_instances, e_fn, _b, _PlaylightSDK_instances, t_fn, _c;
|
|
8
8
|
const e = false;
|
|
9
9
|
var t = Array.isArray, n = Array.prototype.indexOf, o = Array.from, i = Object.defineProperty, s = Object.getOwnPropertyDescriptor, a = Object.getOwnPropertyDescriptors, l = Object.prototype, c = Array.prototype, u = Object.getPrototypeOf;
|
|
10
10
|
function is_function(e2) {
|
|
@@ -280,7 +280,7 @@ function proxy(e2, n2 = null, o2) {
|
|
|
280
280
|
function update_version(e2, t2 = 1) {
|
|
281
281
|
set(e2, e2.v + t2);
|
|
282
282
|
}
|
|
283
|
-
var I,
|
|
283
|
+
var I, P, T, O, E;
|
|
284
284
|
function create_text(e2 = "") {
|
|
285
285
|
return document.createTextNode(e2);
|
|
286
286
|
}
|
|
@@ -290,7 +290,7 @@ function get_first_child(e2) {
|
|
|
290
290
|
}
|
|
291
291
|
// @__NO_SIDE_EFFECTS__
|
|
292
292
|
function get_next_sibling(e2) {
|
|
293
|
-
return
|
|
293
|
+
return E.call(e2);
|
|
294
294
|
}
|
|
295
295
|
function child(e2, t2) {
|
|
296
296
|
return /* @__PURE__ */ get_first_child(e2);
|
|
@@ -395,7 +395,7 @@ function validate_effect(e2) {
|
|
|
395
395
|
*/
|
|
396
396
|
function effect_in_unowned_derived() {
|
|
397
397
|
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
398
|
-
}(),
|
|
398
|
+
}(), W && function effect_in_teardown(e3) {
|
|
399
399
|
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
400
400
|
}();
|
|
401
401
|
}
|
|
@@ -498,7 +498,7 @@ function branch(e2, t2 = true) {
|
|
|
498
498
|
function execute_effect_teardown(e2) {
|
|
499
499
|
var t2 = e2.teardown;
|
|
500
500
|
if (null !== t2) {
|
|
501
|
-
const e3 =
|
|
501
|
+
const e3 = W, n2 = F;
|
|
502
502
|
set_is_destroying_effect(true), set_active_reaction(null);
|
|
503
503
|
try {
|
|
504
504
|
t2.call(null);
|
|
@@ -581,23 +581,23 @@ function resume_children(e2, t2) {
|
|
|
581
581
|
if (null !== e2.transitions) for (const n3 of e2.transitions) (n3.is_global || t2) && n3.in();
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
let
|
|
584
|
+
let j = [], N = [];
|
|
585
585
|
function run_micro_tasks() {
|
|
586
|
-
var e2 =
|
|
587
|
-
|
|
586
|
+
var e2 = j;
|
|
587
|
+
j = [], run_all(e2);
|
|
588
588
|
}
|
|
589
589
|
function queue_micro_task(e2) {
|
|
590
|
-
0 ===
|
|
590
|
+
0 === j.length && queueMicrotask(run_micro_tasks), j.push(e2);
|
|
591
591
|
}
|
|
592
592
|
function flush_tasks() {
|
|
593
|
-
|
|
593
|
+
j.length > 0 && run_micro_tasks(), N.length > 0 && function run_idle_tasks() {
|
|
594
594
|
var e2 = N;
|
|
595
595
|
N = [], run_all(e2);
|
|
596
596
|
}();
|
|
597
597
|
}
|
|
598
|
-
let
|
|
598
|
+
let D = false, B = false, A = null, z = false, W = false;
|
|
599
599
|
function set_is_destroying_effect(e2) {
|
|
600
|
-
|
|
600
|
+
W = e2;
|
|
601
601
|
}
|
|
602
602
|
let L = [], F = null, G = false;
|
|
603
603
|
function set_active_reaction(e2) {
|
|
@@ -645,14 +645,14 @@ function check_dirtiness(e2) {
|
|
|
645
645
|
return false;
|
|
646
646
|
}
|
|
647
647
|
function handle_error(e2, t2, n2, o2) {
|
|
648
|
-
if (
|
|
649
|
-
if (null === n2 && (
|
|
648
|
+
if (D) {
|
|
649
|
+
if (null === n2 && (D = false), /**
|
|
650
650
|
* @param {Effect} effect
|
|
651
651
|
*/
|
|
652
652
|
function should_rethrow_error(e3) {
|
|
653
653
|
return !(e3.f & y || null !== e3.parent && e3.parent.f & p);
|
|
654
654
|
}(t2)) throw e2;
|
|
655
|
-
} else null !== n2 && (
|
|
655
|
+
} else null !== n2 && (D = true), function propagate_error(e3, t3) {
|
|
656
656
|
for (var n3 = t3; null !== n3; ) {
|
|
657
657
|
if (n3.f & p) try {
|
|
658
658
|
return void n3.fn(e3);
|
|
@@ -661,7 +661,7 @@ function handle_error(e2, t2, n2, o2) {
|
|
|
661
661
|
}
|
|
662
662
|
n3 = n3.parent;
|
|
663
663
|
}
|
|
664
|
-
throw
|
|
664
|
+
throw D = false, e3;
|
|
665
665
|
}(e2, t2);
|
|
666
666
|
}
|
|
667
667
|
function schedule_possible_effect_self_invalidation(e2, t2, n2 = true) {
|
|
@@ -683,7 +683,7 @@ function update_reaction(e2) {
|
|
|
683
683
|
var _a2;
|
|
684
684
|
var t2 = V, n2 = K, o2 = U, i2 = F, s2 = J, a2 = R, l2 = q, c2 = G, u2 = e2.f;
|
|
685
685
|
V = /** @type {null | Value[]} */
|
|
686
|
-
null, K = 0, U = null, J = !!(u2 & _) && (G || !
|
|
686
|
+
null, K = 0, U = null, J = !!(u2 & _) && (G || !z || null === F), F = 96 & u2 ? null : e2, R = null, set_component_context(e2.ctx), G = false, Y++;
|
|
687
687
|
try {
|
|
688
688
|
var f2 = (
|
|
689
689
|
/** @type {Function} */
|
|
@@ -742,8 +742,8 @@ function update_effect(t2) {
|
|
|
742
742
|
var n2 = t2.f;
|
|
743
743
|
if (!(n2 & y)) {
|
|
744
744
|
set_signal_status(t2, g);
|
|
745
|
-
var o2 = H, i2 = q, s2 =
|
|
746
|
-
H = t2,
|
|
745
|
+
var o2 = H, i2 = q, s2 = z;
|
|
746
|
+
H = t2, z = true;
|
|
747
747
|
try {
|
|
748
748
|
16 & n2 ? function destroy_block_effect_children(e2) {
|
|
749
749
|
for (var t3 = e2.first; null !== t3; ) {
|
|
@@ -758,7 +758,7 @@ function update_effect(t2) {
|
|
|
758
758
|
} catch (e2) {
|
|
759
759
|
handle_error(e2, t2, o2, i2 || t2.ctx);
|
|
760
760
|
} finally {
|
|
761
|
-
|
|
761
|
+
z = s2, H = o2;
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
764
|
}
|
|
@@ -768,15 +768,15 @@ function infinite_loop_guard() {
|
|
|
768
768
|
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
769
769
|
}();
|
|
770
770
|
} catch (e2) {
|
|
771
|
-
if (null ===
|
|
772
|
-
handle_error(e2,
|
|
771
|
+
if (null === A) throw e2;
|
|
772
|
+
handle_error(e2, A, null);
|
|
773
773
|
}
|
|
774
774
|
}
|
|
775
775
|
function flush_queued_root_effects() {
|
|
776
|
-
var e2 =
|
|
776
|
+
var e2 = z;
|
|
777
777
|
try {
|
|
778
778
|
var t2 = 0;
|
|
779
|
-
for (
|
|
779
|
+
for (z = true; L.length > 0; ) {
|
|
780
780
|
t2++ > 1e3 && infinite_loop_guard();
|
|
781
781
|
var n2 = L, o2 = n2.length;
|
|
782
782
|
L = [];
|
|
@@ -785,7 +785,7 @@ function flush_queued_root_effects() {
|
|
|
785
785
|
}
|
|
786
786
|
}
|
|
787
787
|
} finally {
|
|
788
|
-
B = false,
|
|
788
|
+
B = false, z = e2, A = null;
|
|
789
789
|
}
|
|
790
790
|
}
|
|
791
791
|
function flush_queued_effects(e2) {
|
|
@@ -812,7 +812,7 @@ function flush_queued_effects(e2) {
|
|
|
812
812
|
}
|
|
813
813
|
function schedule_effect(e2) {
|
|
814
814
|
B || (B = true, queueMicrotask(flush_queued_root_effects));
|
|
815
|
-
for (var t2 =
|
|
815
|
+
for (var t2 = A = e2; null !== t2.parent; ) {
|
|
816
816
|
var n2 = (t2 = t2.parent).f;
|
|
817
817
|
if (96 & n2) {
|
|
818
818
|
if (!(n2 & g)) return;
|
|
@@ -1103,7 +1103,7 @@ function template(e2, t2) {
|
|
|
1103
1103
|
/* @__PURE__ */ get_first_child(n2)));
|
|
1104
1104
|
var t3 = (
|
|
1105
1105
|
/** @type {TemplateNode} */
|
|
1106
|
-
i2 ||
|
|
1106
|
+
i2 || T ? document.importNode(n2, true) : n2.cloneNode(true)
|
|
1107
1107
|
);
|
|
1108
1108
|
o2 ? assign_nodes(
|
|
1109
1109
|
/** @type {TemplateNode} */
|
|
@@ -1167,10 +1167,10 @@ function mount(e2, t2) {
|
|
|
1167
1167
|
*/
|
|
1168
1168
|
function init_operations() {
|
|
1169
1169
|
if (void 0 === I) {
|
|
1170
|
-
I = window,
|
|
1170
|
+
I = window, P = document, T = /Firefox/.test(navigator.userAgent);
|
|
1171
1171
|
var e4 = Element.prototype, t4 = Node.prototype;
|
|
1172
1172
|
O = s(t4, "firstChild").get, // @ts-ignore
|
|
1173
|
-
|
|
1173
|
+
E = s(t4, "nextSibling").get, // the following assignments improve perf of lookups on DOM nodes
|
|
1174
1174
|
// @ts-expect-error
|
|
1175
1175
|
e4.__click = void 0, // @ts-expect-error
|
|
1176
1176
|
e4.__className = void 0, // @ts-expect-error
|
|
@@ -1291,7 +1291,7 @@ function each(e2, n2, i2, s2, a2, l2 = null) {
|
|
|
1291
1291
|
* @returns {void}
|
|
1292
1292
|
*/
|
|
1293
1293
|
function reconcile(e4, t3, n3, i3, s3, a3, l3) {
|
|
1294
|
-
var _a2, _b2,
|
|
1294
|
+
var _a2, _b2, _c2, _d;
|
|
1295
1295
|
var c3, u3, f3, d3, p3, _2, v2 = !!(8 & s3), g2 = !!(3 & s3), h2 = e4.length, m2 = t3.items, y2 = t3.first, $2 = y2, w2 = null, x2 = [], k2 = [];
|
|
1296
1296
|
if (v2) for (_2 = 0; _2 < h2; _2 += 1) d3 = a3(f3 = e4[_2], _2), void 0 !== (p3 = m2.get(d3)) && ((_a2 = p3.a) == null ? void 0 : _a2.measure(), (u3 ?? (u3 = /* @__PURE__ */ new Set())).add(p3));
|
|
1297
1297
|
for (_2 = 0; _2 < h2; _2 += 1) if (d3 = a3(f3 = e4[_2], _2), void 0 !== (p3 = m2.get(d3))) {
|
|
@@ -1323,12 +1323,12 @@ function each(e2, n2, i2, s2, a2, l2 = null) {
|
|
|
1323
1323
|
if (null !== $2 || void 0 !== c3) {
|
|
1324
1324
|
for (var I2 = void 0 === c3 ? [] : o(c3); null !== $2; )
|
|
1325
1325
|
$2.e.f & b || I2.push($2), $2 = $2.next;
|
|
1326
|
-
var
|
|
1327
|
-
if (
|
|
1328
|
-
var
|
|
1326
|
+
var P2 = I2.length;
|
|
1327
|
+
if (P2 > 0) {
|
|
1328
|
+
var T2 = 4 & s3 && 0 === h2 ? n3 : null;
|
|
1329
1329
|
if (v2) {
|
|
1330
|
-
for (_2 = 0; _2 <
|
|
1331
|
-
for (_2 = 0; _2 <
|
|
1330
|
+
for (_2 = 0; _2 < P2; _2 += 1) (_c2 = I2[_2].a) == null ? void 0 : _c2.measure();
|
|
1331
|
+
for (_2 = 0; _2 < P2; _2 += 1) (_d = I2[_2].a) == null ? void 0 : _d.fix();
|
|
1332
1332
|
}
|
|
1333
1333
|
!function pause_effects(e5, t4, n4, o2) {
|
|
1334
1334
|
for (var i4 = [], s4 = t4.length, a4 = 0; a4 < s4; a4++) pause_children(t4[a4].e, i4, true);
|
|
@@ -1352,7 +1352,7 @@ function each(e2, n2, i2, s2, a2, l2 = null) {
|
|
|
1352
1352
|
l4 || (o2.delete(i5.k), link(e5, i5.prev, i5.next)), destroy_effect(i5.e, !l4);
|
|
1353
1353
|
}
|
|
1354
1354
|
});
|
|
1355
|
-
}(t3, I2,
|
|
1355
|
+
}(t3, I2, T2, m2);
|
|
1356
1356
|
}
|
|
1357
1357
|
}
|
|
1358
1358
|
v2 && queue_micro_task(() => {
|
|
@@ -2414,13 +2414,13 @@ function Icon(e2, t2) {
|
|
|
2414
2414
|
"success" === n2() ? e3(consequent) : e3(alternate, false);
|
|
2415
2415
|
}), append(e2, o2);
|
|
2416
2416
|
}
|
|
2417
|
-
var Ie = /* @__PURE__ */ template('<div class="sonner-loading-bar"></div>'),
|
|
2417
|
+
var Ie = /* @__PURE__ */ template('<div class="sonner-loading-bar"></div>'), Pe = /* @__PURE__ */ template('<div class="sonner-loading-wrapper"><div class="sonner-spinner"></div></div>');
|
|
2418
2418
|
function Loader(e2, t2) {
|
|
2419
2419
|
push(t2, false);
|
|
2420
2420
|
let n2 = prop(t2, "visible", 8);
|
|
2421
2421
|
const o2 = Array(12).fill(0);
|
|
2422
2422
|
init();
|
|
2423
|
-
var i2 =
|
|
2423
|
+
var i2 = Pe();
|
|
2424
2424
|
each(child(i2), 5, () => o2, index, (e3, t3) => {
|
|
2425
2425
|
append(e3, Ie());
|
|
2426
2426
|
}), template_effect(() => set_attribute(i2, "data-visible", n2())), append(e2, i2), pop();
|
|
@@ -2428,21 +2428,21 @@ function Loader(e2, t2) {
|
|
|
2428
2428
|
function cn(...e2) {
|
|
2429
2429
|
return e2.filter(Boolean).join(" ");
|
|
2430
2430
|
}
|
|
2431
|
-
const
|
|
2431
|
+
const Te = "undefined" != typeof document;
|
|
2432
2432
|
function clientWritable(e2) {
|
|
2433
2433
|
const t2 = writable(e2);
|
|
2434
2434
|
return {
|
|
2435
2435
|
subscribe: t2.subscribe,
|
|
2436
2436
|
set: function set2(e3) {
|
|
2437
|
-
|
|
2437
|
+
Te && t2.set(e3);
|
|
2438
2438
|
},
|
|
2439
2439
|
update: function update2(e3) {
|
|
2440
|
-
|
|
2440
|
+
Te && t2.update(e3);
|
|
2441
2441
|
}
|
|
2442
2442
|
};
|
|
2443
2443
|
}
|
|
2444
2444
|
let Oe = 0;
|
|
2445
|
-
const
|
|
2445
|
+
const Ee = function createToastState() {
|
|
2446
2446
|
const e2 = clientWritable([]), t2 = clientWritable([]);
|
|
2447
2447
|
function addToast(t3) {
|
|
2448
2448
|
e2.update((e3) => [t3, ...e3]);
|
|
@@ -2607,23 +2607,23 @@ const je = function createToastState() {
|
|
|
2607
2607
|
heights: t2
|
|
2608
2608
|
};
|
|
2609
2609
|
}();
|
|
2610
|
-
const
|
|
2611
|
-
return
|
|
2610
|
+
const je = function toastFunction(e2, t2) {
|
|
2611
|
+
return Ee.create({
|
|
2612
2612
|
message: e2,
|
|
2613
2613
|
...t2
|
|
2614
2614
|
});
|
|
2615
|
-
}, Ne = Object.assign(
|
|
2616
|
-
success:
|
|
2617
|
-
info:
|
|
2618
|
-
warning:
|
|
2619
|
-
error:
|
|
2620
|
-
custom:
|
|
2621
|
-
message:
|
|
2622
|
-
promise:
|
|
2623
|
-
dismiss:
|
|
2624
|
-
loading:
|
|
2615
|
+
}, Ne = Object.assign(je, {
|
|
2616
|
+
success: Ee.success,
|
|
2617
|
+
info: Ee.info,
|
|
2618
|
+
warning: Ee.warning,
|
|
2619
|
+
error: Ee.error,
|
|
2620
|
+
custom: Ee.custom,
|
|
2621
|
+
message: Ee.message,
|
|
2622
|
+
promise: Ee.promise,
|
|
2623
|
+
dismiss: Ee.dismiss,
|
|
2624
|
+
loading: Ee.loading
|
|
2625
2625
|
});
|
|
2626
|
-
var
|
|
2626
|
+
var De = /* @__PURE__ */ template('<button aria-label="Close toast" data-close-button=""><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button>'), Be = /* @__PURE__ */ template('<div data-icon=""><!> <!></div>'), Ae = /* @__PURE__ */ template('<div data-title=""><!></div>'), ze = /* @__PURE__ */ template('<div data-description=""><!></div>'), We = /* @__PURE__ */ template('<button data-button="" data-cancel=""> </button>'), Le = /* @__PURE__ */ template('<button data-button=""> </button>'), Fe = /* @__PURE__ */ template('<!> <div data-content=""><!> <!></div> <!> <!>', 1), Ge = /* @__PURE__ */ template('<li aria-atomic="true" role="status" data-sonner-toast=""><!> <!></li>');
|
|
2627
2627
|
function Toast(e2, t2) {
|
|
2628
2628
|
const n2 = legacy_rest_props(t2, ["children", "$$slots", "$$events", "$$legacy"]);
|
|
2629
2629
|
push(t2, false);
|
|
@@ -2642,10 +2642,10 @@ function Toast(e2, t2) {
|
|
|
2642
2642
|
default: "",
|
|
2643
2643
|
info: "",
|
|
2644
2644
|
loading: ""
|
|
2645
|
-
}, { toasts: b2, heights: y2, removeHeight: $2, setHeight: w2, remove: x2 } =
|
|
2646
|
-
let k2 = prop(t2, "toast", 9), C2 = prop(t2, "index", 9), S2 = prop(t2, "expanded", 9), M2 = prop(t2, "invert", 13), q2 = prop(t2, "position", 9), I2 = prop(t2, "visibleToasts", 9),
|
|
2645
|
+
}, { toasts: b2, heights: y2, removeHeight: $2, setHeight: w2, remove: x2 } = Ee;
|
|
2646
|
+
let k2 = prop(t2, "toast", 9), C2 = prop(t2, "index", 9), S2 = prop(t2, "expanded", 9), M2 = prop(t2, "invert", 13), q2 = prop(t2, "position", 9), I2 = prop(t2, "visibleToasts", 9), P2 = prop(t2, "expandByDefault", 9), T2 = prop(t2, "closeButton", 9), O2 = prop(t2, "interacting", 9), E2 = prop(t2, "cancelButtonStyle", 9, ""), j2 = prop(t2, "actionButtonStyle", 9, ""), N2 = prop(t2, "duration", 9, 4e3), D2 = prop(t2, "descriptionClass", 9, ""), B2 = prop(t2, "classes", 29, () => ({})), A2 = prop(t2, "unstyled", 9, false), z2 = mutable_state(false, true), W2 = mutable_state(false, true), L2 = mutable_state(false, true), F2 = mutable_state(false, true), G2 = mutable_state(0, true), H2 = mutable_state(0, true), R2 = mutable_state(void 0, true), V2 = mutable_state(0, true), K2 = 0, U2 = 0, Z2 = null;
|
|
2647
2647
|
function deleteToast() {
|
|
2648
|
-
set(
|
|
2648
|
+
set(W2, true), // Save the offset for the exit swipe animation
|
|
2649
2649
|
set(G2, get$1(V2)), $2(k2().id), setTimeout(() => {
|
|
2650
2650
|
x2(k2().id);
|
|
2651
2651
|
}, 200);
|
|
@@ -2660,7 +2660,7 @@ function Toast(e2, t2) {
|
|
|
2660
2660
|
}
|
|
2661
2661
|
let Q2 = mutable_state(void 0, true);
|
|
2662
2662
|
onMount(() => {
|
|
2663
|
-
set(
|
|
2663
|
+
set(z2, true);
|
|
2664
2664
|
const e3 = get$1(R2).getBoundingClientRect().height;
|
|
2665
2665
|
return set(H2, e3), w2({
|
|
2666
2666
|
toastId: k2().id,
|
|
@@ -2703,9 +2703,9 @@ function Toast(e2, t2) {
|
|
|
2703
2703
|
}), legacy_pre_effect(() => (get$1(l2), get$1(c2)), () => {
|
|
2704
2704
|
get$1(l2), get$1(c2), // Listen to height changes
|
|
2705
2705
|
async function updateHeights() {
|
|
2706
|
-
if (!get$1(
|
|
2706
|
+
if (!get$1(z2)) return;
|
|
2707
2707
|
let e3;
|
|
2708
|
-
await tick(), e3 = S2() ||
|
|
2708
|
+
await tick(), e3 = S2() || P2() ? 1 : 1 - 0.05 * C2(), get$1(R2).style.setProperty("height", "auto");
|
|
2709
2709
|
const t3 = get$1(R2).offsetHeight, n3 = get$1(R2).getBoundingClientRect().height, o3 = Math.round(100 * (n3 / e3 + Number.EPSILON)) / 100;
|
|
2710
2710
|
let i3;
|
|
2711
2711
|
get$1(R2).style.removeProperty("height"), // Use scaledRectHeight as it's more precise
|
|
@@ -2751,12 +2751,12 @@ function Toast(e2, t2) {
|
|
|
2751
2751
|
let te2;
|
|
2752
2752
|
set_attribute(ee2, "tabindex", 0);
|
|
2753
2753
|
var ne2 = child(ee2), consequent = (e3) => {
|
|
2754
|
-
var t3 =
|
|
2754
|
+
var t3 = De();
|
|
2755
2755
|
template_effect((e4) => {
|
|
2756
2756
|
set_attribute(t3, "data-disabled", get$1(g2)), set_class(t3, 1, e4);
|
|
2757
2757
|
}, [() => {
|
|
2758
|
-
var _a2, _b2,
|
|
2759
|
-
return clsx(cn((_a2 = B2()) == null ? void 0 : _a2.closeButton, (
|
|
2758
|
+
var _a2, _b2, _c2;
|
|
2759
|
+
return clsx(cn((_a2 = B2()) == null ? void 0 : _a2.closeButton, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.closeButton));
|
|
2760
2760
|
}], derived_safe_equal), event("click", t3, function(...e4) {
|
|
2761
2761
|
var _a2;
|
|
2762
2762
|
(_a2 = get$1(g2) ? void 0 : () => {
|
|
@@ -2766,7 +2766,7 @@ function Toast(e2, t2) {
|
|
|
2766
2766
|
}), append(e3, t3);
|
|
2767
2767
|
};
|
|
2768
2768
|
if_block(ne2, (e3) => {
|
|
2769
|
-
|
|
2769
|
+
T2() && !k2().component && e3(consequent);
|
|
2770
2770
|
});
|
|
2771
2771
|
var re2 = sibling(ne2, 2), consequent_1 = (e3) => {
|
|
2772
2772
|
var t3 = comment();
|
|
@@ -2832,7 +2832,7 @@ function Toast(e2, t2) {
|
|
|
2832
2832
|
("default" !== get$1(u2) || k2().icon || k2().promise) && e4(consequent_8);
|
|
2833
2833
|
});
|
|
2834
2834
|
var i3 = sibling(o3, 2), s3 = child(i3), consequent_10 = (e4) => {
|
|
2835
|
-
var t3 =
|
|
2835
|
+
var t3 = Ae(), n4 = child(t3), consequent_9 = (e5) => {
|
|
2836
2836
|
var t4 = comment();
|
|
2837
2837
|
component(first_child(t4), () => k2().title, (e6, t5) => {
|
|
2838
2838
|
t5(e6, spread_props(() => k2().componentProps));
|
|
@@ -2844,15 +2844,15 @@ function Toast(e2, t2) {
|
|
|
2844
2844
|
if_block(n4, (e5) => {
|
|
2845
2845
|
"string" != typeof k2().title ? e5(consequent_9) : e5(alternate_5, false);
|
|
2846
2846
|
}), template_effect((e5) => set_class(t3, 1, e5), [() => {
|
|
2847
|
-
var _a2, _b2,
|
|
2848
|
-
return clsx(cn((_a2 = B2()) == null ? void 0 : _a2.title, (
|
|
2847
|
+
var _a2, _b2, _c2;
|
|
2848
|
+
return clsx(cn((_a2 = B2()) == null ? void 0 : _a2.title, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.title));
|
|
2849
2849
|
}], derived_safe_equal), append(e4, t3);
|
|
2850
2850
|
};
|
|
2851
2851
|
if_block(s3, (e4) => {
|
|
2852
2852
|
k2().title && e4(consequent_10);
|
|
2853
2853
|
});
|
|
2854
2854
|
var a3 = sibling(s3, 2), consequent_12 = (e4) => {
|
|
2855
|
-
var t3 =
|
|
2855
|
+
var t3 = ze(), n4 = child(t3), consequent_11 = (e5) => {
|
|
2856
2856
|
var t4 = comment();
|
|
2857
2857
|
component(first_child(t4), () => k2().description, (e6, t5) => {
|
|
2858
2858
|
t5(e6, spread_props(() => k2().componentProps));
|
|
@@ -2865,19 +2865,19 @@ function Toast(e2, t2) {
|
|
|
2865
2865
|
"string" != typeof k2().description ? e5(consequent_11) : e5(alternate_6, false);
|
|
2866
2866
|
}), template_effect((e5) => set_class(t3, 1, e5), [() => {
|
|
2867
2867
|
var _a2, _b2;
|
|
2868
|
-
return clsx(cn(
|
|
2868
|
+
return clsx(cn(D2(), get$1(d2), (_a2 = B2()) == null ? void 0 : _a2.description, (_b2 = k2().classes) == null ? void 0 : _b2.description));
|
|
2869
2869
|
}], derived_safe_equal), append(e4, t3);
|
|
2870
2870
|
};
|
|
2871
2871
|
if_block(a3, (e4) => {
|
|
2872
2872
|
k2().description && e4(consequent_12);
|
|
2873
2873
|
});
|
|
2874
2874
|
var l3 = sibling(i3, 2), consequent_13 = (e4) => {
|
|
2875
|
-
var t3 =
|
|
2875
|
+
var t3 = We(), n4 = child(t3);
|
|
2876
2876
|
template_effect((e5) => {
|
|
2877
|
-
set_style(t3,
|
|
2877
|
+
set_style(t3, E2()), set_class(t3, 1, e5), set_text(n4, k2().cancel.label);
|
|
2878
2878
|
}, [() => {
|
|
2879
|
-
var _a2, _b2,
|
|
2880
|
-
return clsx(cn((_a2 = B2()) == null ? void 0 : _a2.cancelButton, (
|
|
2879
|
+
var _a2, _b2, _c2;
|
|
2880
|
+
return clsx(cn((_a2 = B2()) == null ? void 0 : _a2.cancelButton, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.cancelButton));
|
|
2881
2881
|
}], derived_safe_equal), event("click", t3, () => {
|
|
2882
2882
|
var _a2;
|
|
2883
2883
|
deleteToast(), ((_a2 = k2().cancel) == null ? void 0 : _a2.onClick) && k2().cancel.onClick();
|
|
@@ -2889,10 +2889,10 @@ function Toast(e2, t2) {
|
|
|
2889
2889
|
var c3 = sibling(l3, 2), consequent_14 = (e4) => {
|
|
2890
2890
|
var t3 = Le(), n4 = child(t3);
|
|
2891
2891
|
template_effect((e5) => {
|
|
2892
|
-
set_style(t3,
|
|
2892
|
+
set_style(t3, j2()), set_class(t3, 1, e5), set_text(n4, k2().action.label);
|
|
2893
2893
|
}, [() => {
|
|
2894
|
-
var _a2, _b2,
|
|
2895
|
-
return clsx(cn((_a2 = B2()) == null ? void 0 : _a2.actionButton, (
|
|
2894
|
+
var _a2, _b2, _c2;
|
|
2895
|
+
return clsx(cn((_a2 = B2()) == null ? void 0 : _a2.actionButton, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.actionButton));
|
|
2896
2896
|
}], derived_safe_equal), event("click", t3, (e5) => {
|
|
2897
2897
|
var _a2;
|
|
2898
2898
|
(_a2 = k2().action) == null ? void 0 : _a2.onClick(e5), e5.defaultPrevented || deleteToast();
|
|
@@ -2906,17 +2906,17 @@ function Toast(e2, t2) {
|
|
|
2906
2906
|
k2().component ? e3(consequent_1) : e3(alternate, false);
|
|
2907
2907
|
}), bind_this(ee2, (e3) => set(R2, e3), () => get$1(R2)), template_effect((e3, t3, i3) => {
|
|
2908
2908
|
var _a2;
|
|
2909
|
-
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) ||
|
|
2909
|
+
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) || A2())), set_attribute(ee2, "data-mounted", get$1(z2)), set_attribute(ee2, "data-promise", t3), set_attribute(ee2, "data-removed", get$1(W2)), set_attribute(ee2, "data-visible", get$1(a2)), set_attribute(ee2, "data-y-position", get$1(_2)[0]), set_attribute(ee2, "data-x-position", get$1(_2)[1]), set_attribute(ee2, "data-index", C2()), set_attribute(ee2, "data-front", get$1(s2)), set_attribute(ee2, "data-swiping", get$1(L2)), set_attribute(ee2, "data-type", get$1(u2)), set_attribute(ee2, "data-invert", M2()), set_attribute(ee2, "data-swipe-out", get$1(F2)), set_attribute(ee2, "data-expanded", i3), te2 = set_style(ee2, `${n2.style} ${k2().style}`, te2, {
|
|
2910
2910
|
"--index": C2(),
|
|
2911
2911
|
"--toasts-before": C2(),
|
|
2912
2912
|
"--z-index": store_get(b2, "$toasts", o2).length - C2(),
|
|
2913
|
-
"--offset": `${get$1(
|
|
2913
|
+
"--offset": `${get$1(W2) ? get$1(G2) : get$1(V2)}px`,
|
|
2914
2914
|
"--initial-height": `${get$1(H2)}px`
|
|
2915
2915
|
});
|
|
2916
2916
|
}, [() => {
|
|
2917
|
-
var _a2, _b2,
|
|
2918
|
-
return clsx(cn(n2.class, get$1(f2), (_a2 = B2()) == null ? void 0 : _a2.toast, (
|
|
2919
|
-
}, () => Boolean(k2().promise), () => Boolean(S2() ||
|
|
2917
|
+
var _a2, _b2, _c2, _d, _e2, _f;
|
|
2918
|
+
return clsx(cn(n2.class, get$1(f2), (_a2 = B2()) == null ? void 0 : _a2.toast, (_c2 = (_b2 = k2()) == null ? void 0 : _b2.classes) == null ? void 0 : _c2.toast, (_d = B2()) == null ? void 0 : _d[get$1(u2)], (_f = (_e2 = k2()) == null ? void 0 : _e2.classes) == null ? void 0 : _f[get$1(u2)]));
|
|
2919
|
+
}, () => Boolean(k2().promise), () => Boolean(S2() || P2() && get$1(z2))], derived_safe_equal), event("pointerdown", ee2, function onPointerDown(e3) {
|
|
2920
2920
|
if (get$1(g2)) return;
|
|
2921
2921
|
set(G2, get$1(V2));
|
|
2922
2922
|
const t3 = e3.target;
|
|
@@ -2925,11 +2925,11 @@ function Toast(e2, t2) {
|
|
|
2925
2925
|
y: e3.clientY
|
|
2926
2926
|
});
|
|
2927
2927
|
}), event("pointerup", ee2, function onPointerUp() {
|
|
2928
|
-
var _a2, _b2,
|
|
2928
|
+
var _a2, _b2, _c2;
|
|
2929
2929
|
if (get$1(F2)) return;
|
|
2930
2930
|
Z2 = null;
|
|
2931
2931
|
const e3 = Number(((_a2 = get$1(R2)) == null ? void 0 : _a2.style.getPropertyValue("--swipe-amount").replace("px", "")) || 0);
|
|
2932
|
-
if (Math.abs(e3) >= 20) return set(G2, get$1(V2)), (
|
|
2932
|
+
if (Math.abs(e3) >= 20) return set(G2, get$1(V2)), (_c2 = (_b2 = k2()).onDismiss) == null ? void 0 : _c2.call(_b2, k2()), deleteToast(), void set(F2, true);
|
|
2933
2933
|
get$1(R2).style.setProperty("--swipe-amount", "0px"), set(L2, false);
|
|
2934
2934
|
}), event("pointermove", ee2, function onPointerMove(e3) {
|
|
2935
2935
|
if (!Z2) return;
|
|
@@ -2951,24 +2951,24 @@ function Toaster(e2, t2) {
|
|
|
2951
2951
|
return "auto" !== e3 && e3 ? e3 : window.getComputedStyle(document.documentElement).direction;
|
|
2952
2952
|
}
|
|
2953
2953
|
let f2 = prop(t2, "invert", 8, false), d2 = prop(t2, "theme", 8, "light"), p2 = prop(t2, "position", 8, "bottom-right"), _2 = prop(t2, "hotkey", 24, () => ["altKey", "KeyT"]), v2 = prop(t2, "containerAriaLabel", 8, "Notifications"), g2 = 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);
|
|
2954
|
-
const { toasts: k2, heights: C2, reset: S2 } =
|
|
2955
|
-
let M2 = mutable_state(false), I2 = mutable_state(false),
|
|
2954
|
+
const { toasts: k2, heights: C2, reset: S2 } = Ee;
|
|
2955
|
+
let M2 = mutable_state(false), I2 = mutable_state(false), P2 = mutable_state(function getInitialTheme(e3) {
|
|
2956
2956
|
return "system" !== e3 ? e3 : "undefined" != typeof window && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? c2 : u2;
|
|
2957
|
-
}(d2())),
|
|
2957
|
+
}(d2())), T2 = mutable_state(), O2 = null, E2 = false;
|
|
2958
2958
|
function handleBlur(e3) {
|
|
2959
|
-
|
|
2959
|
+
E2 && !e3.currentTarget.contains(e3.relatedTarget) && (E2 = false, O2 && (O2.focus({
|
|
2960
2960
|
preventScroll: true
|
|
2961
2961
|
}), O2 = null));
|
|
2962
2962
|
}
|
|
2963
2963
|
function handleFocus(e3) {
|
|
2964
|
-
|
|
2964
|
+
E2 || (E2 = true, O2 = e3.relatedTarget);
|
|
2965
2965
|
}
|
|
2966
2966
|
!function onDestroy(e3) {
|
|
2967
2967
|
null === q && lifecycle_outside_component(), onMount(() => () => untrack(e3));
|
|
2968
2968
|
}(() => {
|
|
2969
|
-
get$1(
|
|
2969
|
+
get$1(T2) && O2 && (O2.focus({
|
|
2970
2970
|
preventScroll: true
|
|
2971
|
-
}), O2 = null,
|
|
2971
|
+
}), O2 = null, E2 = false);
|
|
2972
2972
|
}), onMount(() => {
|
|
2973
2973
|
S2();
|
|
2974
2974
|
const handleKeydown = (e3) => {
|
|
@@ -2976,7 +2976,7 @@ function Toaster(e2, t2) {
|
|
|
2976
2976
|
_2().every((t3) => (
|
|
2977
2977
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2978
2978
|
e3[t3] || e3.code === t3
|
|
2979
|
-
)) && (set(M2, true), (_a2 = get$1(
|
|
2979
|
+
)) && (set(M2, true), (_a2 = get$1(T2)) == null ? void 0 : _a2.focus()), "Escape" !== e3.code || document.activeElement !== get$1(T2) && !((_b2 = get$1(T2)) == null ? void 0 : _b2.contains(document.activeElement)) || set(M2, false);
|
|
2980
2980
|
};
|
|
2981
2981
|
return document.addEventListener("keydown", handleKeydown), () => {
|
|
2982
2982
|
document.removeEventListener("keydown", handleKeydown);
|
|
@@ -2997,17 +2997,17 @@ function Toaster(e2, t2) {
|
|
|
2997
2997
|
k2.set(t3);
|
|
2998
2998
|
}
|
|
2999
2999
|
}), legacy_pre_effect(() => deep_read_state(d2()), () => {
|
|
3000
|
-
if ("system" !== d2() && set(
|
|
3000
|
+
if ("system" !== d2() && set(P2, d2()), "undefined" != typeof window) {
|
|
3001
3001
|
"system" === d2() && // check if current preference is dark
|
|
3002
3002
|
(window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? (
|
|
3003
3003
|
// it's currently dark
|
|
3004
|
-
set(
|
|
3004
|
+
set(P2, c2)
|
|
3005
3005
|
) : (
|
|
3006
3006
|
// it's not dark
|
|
3007
|
-
set(
|
|
3007
|
+
set(P2, u2)
|
|
3008
3008
|
));
|
|
3009
3009
|
const e3 = window.matchMedia("(prefers-color-scheme: dark)"), changeHandler = ({ matches: e4 }) => {
|
|
3010
|
-
set(
|
|
3010
|
+
set(P2, e4 ? c2 : u2);
|
|
3011
3011
|
};
|
|
3012
3012
|
"addEventListener" in e3 ? e3.addEventListener("change", changeHandler) : (
|
|
3013
3013
|
// @ts-expect-error deprecated API
|
|
@@ -3015,7 +3015,7 @@ function Toaster(e2, t2) {
|
|
|
3015
3015
|
);
|
|
3016
3016
|
}
|
|
3017
3017
|
}), legacy_pre_effect_reset(), init();
|
|
3018
|
-
var
|
|
3018
|
+
var j2 = comment(), N2 = first_child(j2), consequent = (e3) => {
|
|
3019
3019
|
var s3 = Re();
|
|
3020
3020
|
set_attribute(s3, "tabindex", -1), each(s3, 5, () => get$1(a2), index, (e4, s4, a3, l3) => {
|
|
3021
3021
|
var c3 = He();
|
|
@@ -3132,13 +3132,13 @@ function Toaster(e2, t2) {
|
|
|
3132
3132
|
}
|
|
3133
3133
|
}
|
|
3134
3134
|
});
|
|
3135
|
-
}), bind_this(c3, (e5) => set(
|
|
3135
|
+
}), bind_this(c3, (e5) => set(T2, e5), () => get$1(T2)), template_effect((e5, t3, s5) => {
|
|
3136
3136
|
var _a2;
|
|
3137
3137
|
u3 = set_attributes(c3, u3, {
|
|
3138
3138
|
tabIndex: -1,
|
|
3139
3139
|
class: n2.class,
|
|
3140
3140
|
"data-sonner-toaster": true,
|
|
3141
|
-
"data-theme": get$1(
|
|
3141
|
+
"data-theme": get$1(P2),
|
|
3142
3142
|
"data-rich-colors": g2(),
|
|
3143
3143
|
dir: e5,
|
|
3144
3144
|
"data-y-position": t3,
|
|
@@ -3159,7 +3159,7 @@ function Toaster(e2, t2) {
|
|
|
3159
3159
|
};
|
|
3160
3160
|
if_block(N2, (e3) => {
|
|
3161
3161
|
$toasts().length > 0 && e3(consequent);
|
|
3162
|
-
}), append(e2,
|
|
3162
|
+
}), append(e2, j2), pop(), s2();
|
|
3163
3163
|
}
|
|
3164
3164
|
const Ve = writable(false), Ke = writable("https://sdk.playlight.dev");
|
|
3165
3165
|
function handleClick(e2, t2, n2) {
|
|
@@ -3192,7 +3192,7 @@ function GameCard(e2, t2) {
|
|
|
3192
3192
|
set(u2, "ontouchstart" in window);
|
|
3193
3193
|
});
|
|
3194
3194
|
var d2 = Xe();
|
|
3195
|
-
event("touchstart", I, () => set(u2, true), void 0, true), event("touchstart",
|
|
3195
|
+
event("touchstart", I, () => set(u2, true), void 0, true), event("touchstart", P, function handleDocumentTouch(e3) {
|
|
3196
3196
|
get$1(f2) && !get$1(f2).contains(e3.target) && set(i2, false);
|
|
3197
3197
|
}, void 0, true), d2.__touchstart = handleMouseEnter, d2.__click = [handleClick, u2, t2];
|
|
3198
3198
|
var p2 = child(d2), consequent = (e3) => {
|
|
@@ -3378,7 +3378,7 @@ function Navigation(e2, t2) {
|
|
|
3378
3378
|
set(p2, proxy(f2[e3])), d2 = e3;
|
|
3379
3379
|
});
|
|
3380
3380
|
var _2 = it();
|
|
3381
|
-
event("click",
|
|
3381
|
+
event("click", P, function handleClickOutside(e3) {
|
|
3382
3382
|
get$1(c2) && !get$1(c2).contains(e3.target) && n2 && !n2.contains(e3.target) && set(s2, false);
|
|
3383
3383
|
});
|
|
3384
3384
|
var v2 = child(_2), g2 = child(v2), h2 = child(g2), m2 = sibling(g2, 2);
|
|
@@ -3585,8 +3585,8 @@ function DiscoveryOverlay(e2, t2) {
|
|
|
3585
3585
|
}), () => i2 == null ? void 0 : i2.disconnect())), onMount(async () => {
|
|
3586
3586
|
const e3 = await Qe.getCurrentGameInfo();
|
|
3587
3587
|
set(u2, proxy(e3 == null ? void 0 : e3.category)), await async function fetchCategories() {
|
|
3588
|
-
var _a2, _b2,
|
|
3589
|
-
set(d2, proxy(await Qe.getCategories())), !get$1(a2) && ((_a2 = get$1(d2)) == null ? void 0 : _a2.length) > 0 && set(a2, proxy(get$1(u2) && ((_b2 = get$1(d2)) == null ? void 0 : _b2.includes(get$1(u2))) ? get$1(u2) : (_d = get$1(d2)) == null ? void 0 : _d[((
|
|
3588
|
+
var _a2, _b2, _c2, _d;
|
|
3589
|
+
set(d2, proxy(await Qe.getCategories())), !get$1(a2) && ((_a2 = get$1(d2)) == null ? void 0 : _a2.length) > 0 && set(a2, proxy(get$1(u2) && ((_b2 = get$1(d2)) == null ? void 0 : _b2.includes(get$1(u2))) ? get$1(u2) : (_d = get$1(d2)) == null ? void 0 : _d[((_c2 = get$1(d2)) == null ? void 0 : _c2.length) - 1]));
|
|
3590
3590
|
}();
|
|
3591
3591
|
}), user_effect(() => {
|
|
3592
3592
|
get$1(a2) && (set(f2, proxy([])), set(_2, 1), set(v2, true), set(h2, false), set(l2, true), // Delay fetch to prevent rapid requests
|
|
@@ -3597,7 +3597,7 @@ function DiscoveryOverlay(e2, t2) {
|
|
|
3597
3597
|
get$1(g2) && i2 && i2.observe(get$1(g2));
|
|
3598
3598
|
});
|
|
3599
3599
|
var m2 = ut();
|
|
3600
|
-
event("keydown",
|
|
3600
|
+
event("keydown", P, (e3) => {
|
|
3601
3601
|
"Escape" == e3.key && store_set(Ve, false);
|
|
3602
3602
|
});
|
|
3603
3603
|
var b2 = child(m2), y2 = child(b2), $2 = child(y2), w2 = child(sibling(y2, 2)), consequent = (e3) => {
|
|
@@ -3710,14 +3710,14 @@ function DiscoveryOverlay(e2, t2) {
|
|
|
3710
3710
|
})), append(e2, m2), pop(), o2();
|
|
3711
3711
|
}
|
|
3712
3712
|
delegate(["click"]);
|
|
3713
|
-
var ft = /* @__PURE__ */ template('<div class="fixed top-0
|
|
3713
|
+
var ft = /* @__PURE__ */ template('<div class="fixed top-0 right-0 left-0 z-99990 h-2"></div>');
|
|
3714
3714
|
delegate(["mouseover"]);
|
|
3715
3715
|
var dt = /* @__PURE__ */ template("<!> <!> <!> <!>", 1);
|
|
3716
3716
|
function App(e2, t2) {
|
|
3717
|
-
var _a2, _b2,
|
|
3717
|
+
var _a2, _b2, _c2, _d;
|
|
3718
3718
|
push(t2, true);
|
|
3719
3719
|
const [n2, o2] = setup_stores(), $discoveryOpen = () => store_get(Ve, "$discoveryOpen", n2);
|
|
3720
|
-
let i2 = proxy((_b2 = (_a2 = t2.config) == null ? void 0 : _a2.button) == null ? void 0 : _b2.position), s2 = proxy((_d = (
|
|
3720
|
+
let i2 = proxy((_b2 = (_a2 = t2.config) == null ? void 0 : _a2.button) == null ? void 0 : _b2.position), s2 = proxy((_d = (_c2 = t2.config) == null ? void 0 : _c2.button) == null ? void 0 : _d.visible);
|
|
3721
3721
|
function openDiscovery() {
|
|
3722
3722
|
store_set(Ve, true), Qe.trackOpen();
|
|
3723
3723
|
}
|
|
@@ -3752,22 +3752,17 @@ function App(e2, t2) {
|
|
|
3752
3752
|
});
|
|
3753
3753
|
!function ExitIntentDetector(e3, t3) {
|
|
3754
3754
|
push(t3, true);
|
|
3755
|
-
let n3, o3 = prop(t3, "enabled", 3, true), i3 =
|
|
3755
|
+
let n3, o3 = prop(t3, "enabled", 3, true), i3 = 0;
|
|
3756
3756
|
onMount(() => {
|
|
3757
3757
|
"undefined" != typeof window && (n3 = window.innerHeight);
|
|
3758
3758
|
});
|
|
3759
3759
|
var s3 = ft();
|
|
3760
|
-
event("
|
|
3761
|
-
i3 =
|
|
3762
|
-
}), event("mousemove", T, (e4) => {
|
|
3763
|
-
const t4 = e4.clientY;
|
|
3764
|
-
if (!i3) return i3 = true, void (n3 = t4);
|
|
3765
|
-
n3 = t4;
|
|
3760
|
+
event("mousemove", P, (e4) => {
|
|
3761
|
+
n3 = e4.clientY, i3 = Date.now();
|
|
3766
3762
|
}), s3.__mouseover = (e4) => {
|
|
3767
3763
|
var _a3;
|
|
3768
|
-
const s4 = e4.clientY;
|
|
3769
|
-
s4 < n3 && i3 && o3() && !localStorage.getItem("playlight_exit_intent_disabled_by_user") && ((_a3 = t3.onIntent) == null ? void 0 : _a3.call(t3))
|
|
3770
|
-
n3 = s4;
|
|
3764
|
+
const s4 = e4.clientY, a3 = Date.now();
|
|
3765
|
+
s4 < n3 && a3 - i3 < 100 && o3() && !localStorage.getItem("playlight_exit_intent_disabled_by_user") && ((_a3 = t3.onIntent) == null ? void 0 : _a3.call(t3));
|
|
3771
3766
|
}, append(e3, s3), pop();
|
|
3772
3767
|
}(u2, {
|
|
3773
3768
|
get enabled() {
|
|
@@ -3808,29 +3803,43 @@ function deepMerge(e2, t2) {
|
|
|
3808
3803
|
function isObject(e2) {
|
|
3809
3804
|
return e2 && "object" == typeof e2 && !Array.isArray(e2);
|
|
3810
3805
|
}
|
|
3811
|
-
const vt = new class
|
|
3806
|
+
const vt = new (_c = class {
|
|
3812
3807
|
constructor() {
|
|
3808
|
+
__privateAdd(this, _PlaylightSDK_instances);
|
|
3813
3809
|
this.container = null, this.app = null, this.isInitialized = false, this.config = null, this.api = Qe;
|
|
3814
3810
|
}
|
|
3811
|
+
/**
|
|
3812
|
+
* Initialize Playlight
|
|
3813
|
+
* @param {Object} [userConfig] - The playlight configuration object
|
|
3814
|
+
*/
|
|
3815
3815
|
async init(e2 = {}) {
|
|
3816
|
-
|
|
3816
|
+
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, t_fn).call(this))) : (
|
|
3817
3817
|
// Initialize configuration with defaults and user overrides
|
|
3818
|
-
(this.config = initializeConfig(e2), // Create container
|
|
3819
|
-
|
|
3820
|
-
this.
|
|
3821
|
-
target: this.container,
|
|
3822
|
-
props: {
|
|
3823
|
-
config: this.config
|
|
3824
|
-
}
|
|
3825
|
-
}), // Fetch current game info to cache it
|
|
3826
|
-
await this.api.getCurrentGameInfo(), this.isInitialized = true, this)
|
|
3818
|
+
(this.config = initializeConfig(e2), __privateMethod(this, _PlaylightSDK_instances, t_fn).call(this), // Create container and mount
|
|
3819
|
+
// Fetch current game info to cache it
|
|
3820
|
+
await this.api.getCurrentGameInfo(), void (this.isInitialized = true))
|
|
3827
3821
|
);
|
|
3828
3822
|
}
|
|
3829
|
-
|
|
3823
|
+
/**
|
|
3824
|
+
* Show or hide the discovery
|
|
3825
|
+
* @param {boolean} value - Whether to show the discovery
|
|
3826
|
+
*/
|
|
3830
3827
|
setDiscovery(e2) {
|
|
3831
3828
|
this.isInitialized && (Ve.set(e2), get(Ve) && Qe.trackOpen());
|
|
3832
3829
|
}
|
|
3833
|
-
}()
|
|
3830
|
+
}, _PlaylightSDK_instances = new WeakSet(), /**
|
|
3831
|
+
* Mount the Svelte app to the playlight container
|
|
3832
|
+
* @private
|
|
3833
|
+
*/
|
|
3834
|
+
t_fn = function() {
|
|
3835
|
+
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)
|
|
3836
|
+
this.app = mount(App, {
|
|
3837
|
+
target: this.container,
|
|
3838
|
+
props: {
|
|
3839
|
+
config: this.config
|
|
3840
|
+
}
|
|
3841
|
+
});
|
|
3842
|
+
}, _c)();
|
|
3834
3843
|
"undefined" != typeof window && (window.playlightSDK = vt);
|
|
3835
3844
|
export {
|
|
3836
3845
|
vt as default
|