fansunited-management-components 1.55.0-RC1 → 1.55.0-RC3
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/index.es.js +119 -121
- package/index.umd.js +2 -2
- package/package.json +1 -1
- package/src/components/WidgetEmbedCode/WidgetEmbedCode.d.ts +2 -0
- package/src/components/WidgetEmbedCode/WidgetEmbedCode.d.ts.map +1 -1
- package/src/constants/components.d.ts +2 -0
- package/src/constants/components.d.ts.map +1 -1
- package/src/context/ComponentContext.d.ts +2 -0
- package/src/context/ComponentContext.d.ts.map +1 -1
package/index.es.js
CHANGED
|
@@ -37,7 +37,7 @@ var E = (e, t, n) => new Promise((r, i) => {
|
|
|
37
37
|
s((n = n.apply(e, t)).next());
|
|
38
38
|
});
|
|
39
39
|
import * as H from "react";
|
|
40
|
-
import Me, { createContext as Nn, useState as Y, useEffect as
|
|
40
|
+
import Me, { createContext as Nn, useState as Y, useEffect as me, useContext as Ht, useRef as Te, useLayoutEffect as as, useMemo as Se, useCallback as Be, Component as zy, Fragment as ac, forwardRef as bp, memo as Uy, useReducer as Vy, cloneElement as Hy } from "react";
|
|
41
41
|
import { FansUnitedSDK as Wy } from "fansunited-sdk-esm";
|
|
42
42
|
import { unstable_batchedUpdates as Zi, createPortal as yp } from "react-dom";
|
|
43
43
|
import xp from "@emotion/styled";
|
|
@@ -11561,7 +11561,7 @@ const lA = (e, t) => !e && !t ? null : !e && t ? (console.warn(
|
|
|
11561
11561
|
return /* @__PURE__ */ c.jsx(ws.Provider, { value: { sdk: i, https: o }, children: t });
|
|
11562
11562
|
}, sm = Nn(null), uA = ({ children: e, environment: t }) => {
|
|
11563
11563
|
const [n, r] = Y(null), [i, o] = Y(!0);
|
|
11564
|
-
return
|
|
11564
|
+
return me(() => zo(t).onAuthStateChanged((s) => {
|
|
11565
11565
|
Zi(() => {
|
|
11566
11566
|
o(!1), r(s);
|
|
11567
11567
|
});
|
|
@@ -21327,7 +21327,7 @@ const bv = ({ title: e, open: t, imageSrc: n, toggleModal: r }) => /* @__PURE__
|
|
|
21327
21327
|
] });
|
|
21328
21328
|
}, BD = ({ labels: e, showFilters: t, onClick: n }) => /* @__PURE__ */ c.jsx(_e, { title: t ? e.hideFilters : e.showFilters, children: /* @__PURE__ */ c.jsx(qt, { "aria-label": "Filters", onClick: n, children: /* @__PURE__ */ c.jsx(DD, {}) }) }), xv = ({ labels: e, onChangeImages: t }) => {
|
|
21329
21329
|
const [n, r] = Y(!1), [i, o] = Y(!1), [a, s] = Y(!1), [l, u] = Y(!1), [d, f] = Y(1), [h, p] = Y(""), [m, g] = Y(null), [v, x] = Y([]), { https: w } = vt();
|
|
21330
|
-
|
|
21330
|
+
me(() => {
|
|
21331
21331
|
A();
|
|
21332
21332
|
}, [d]);
|
|
21333
21333
|
const y = () => u(!l), C = () => f(($) => $ - 1), b = () => f(($) => $ + 1), I = () => E(void 0, null, function* () {
|
|
@@ -23111,8 +23111,8 @@ function CR(e, t) {
|
|
|
23111
23111
|
k = Math.min(k, fe.getHours()), k === fe.getHours() && (L = Math.min(L, fe.getMinutes())), L === fe.getMinutes() && (G = Math.min(G, fe.getSeconds()));
|
|
23112
23112
|
}
|
|
23113
23113
|
if (q) {
|
|
23114
|
-
var
|
|
23115
|
-
k = Math.max(k,
|
|
23114
|
+
var ve = n.config.minTime !== void 0 ? n.config.minTime : n.config.minDate;
|
|
23115
|
+
k = Math.max(k, ve.getHours()), k === ve.getHours() && L < ve.getMinutes() && (L = ve.getMinutes()), L === ve.getMinutes() && (G = Math.max(G, ve.getSeconds()));
|
|
23116
23116
|
}
|
|
23117
23117
|
}
|
|
23118
23118
|
p(k, L, G);
|
|
@@ -23223,9 +23223,9 @@ function CR(e, t) {
|
|
|
23223
23223
|
function $(k, L) {
|
|
23224
23224
|
for (var G = k.className.indexOf("Month") === -1 ? k.dateObj.getMonth() : n.currentMonth, q = L > 0 ? n.config.showMonths : -1, re = L > 0 ? 1 : -1, ce = G - n.currentMonth; ce != q; ce += re)
|
|
23225
23225
|
for (var Ie = n.daysContainer.children[ce], ue = G - n.currentMonth === ce ? k.$i + L : L < 0 ? Ie.children.length - 1 : 0, Ae = Ie.children.length, fe = ue; fe >= 0 && fe < Ae && fe != (L > 0 ? Ae : -1); fe += re) {
|
|
23226
|
-
var
|
|
23227
|
-
if (
|
|
23228
|
-
return A(
|
|
23226
|
+
var ve = Ie.children[fe];
|
|
23227
|
+
if (ve.className.indexOf("hidden") === -1 && J(ve.dateObj) && Math.abs(k.$i - fe) >= Math.abs(L))
|
|
23228
|
+
return A(ve);
|
|
23229
23229
|
}
|
|
23230
23230
|
n.changeMonth(re), W(T(re), 0);
|
|
23231
23231
|
}
|
|
@@ -23234,12 +23234,12 @@ function CR(e, t) {
|
|
|
23234
23234
|
re === void 0 ? n._input.focus() : q ? $(re, L) : A(re);
|
|
23235
23235
|
}
|
|
23236
23236
|
function P(k, L) {
|
|
23237
|
-
for (var G = (new Date(k, L, 1).getDay() - n.l10n.firstDayOfWeek + 7) % 7, q = n.utils.getDaysInMonth((L - 1 + 12) % 12, k), re = n.utils.getDaysInMonth(L, k), ce = window.document.createDocumentFragment(), Ie = n.config.showMonths > 1, ue = Ie ? "prevMonthDay hidden" : "prevMonthDay", Ae = Ie ? "nextMonthDay hidden" : "nextMonthDay", fe = q + 1 - G,
|
|
23238
|
-
ce.appendChild(I("flatpickr-day " + ue, new Date(k, L - 1, fe), fe,
|
|
23239
|
-
for (fe = 1; fe <= re; fe++,
|
|
23240
|
-
ce.appendChild(I("flatpickr-day", new Date(k, L, fe), fe,
|
|
23241
|
-
for (var $e = re + 1; $e <= 42 - G && (n.config.showMonths === 1 ||
|
|
23242
|
-
ce.appendChild(I("flatpickr-day " + Ae, new Date(k, L + 1, $e % re), $e,
|
|
23237
|
+
for (var G = (new Date(k, L, 1).getDay() - n.l10n.firstDayOfWeek + 7) % 7, q = n.utils.getDaysInMonth((L - 1 + 12) % 12, k), re = n.utils.getDaysInMonth(L, k), ce = window.document.createDocumentFragment(), Ie = n.config.showMonths > 1, ue = Ie ? "prevMonthDay hidden" : "prevMonthDay", Ae = Ie ? "nextMonthDay hidden" : "nextMonthDay", fe = q + 1 - G, ve = 0; fe <= q; fe++, ve++)
|
|
23238
|
+
ce.appendChild(I("flatpickr-day " + ue, new Date(k, L - 1, fe), fe, ve));
|
|
23239
|
+
for (fe = 1; fe <= re; fe++, ve++)
|
|
23240
|
+
ce.appendChild(I("flatpickr-day", new Date(k, L, fe), fe, ve));
|
|
23241
|
+
for (var $e = re + 1; $e <= 42 - G && (n.config.showMonths === 1 || ve % 7 !== 0); $e++, ve++)
|
|
23242
|
+
ce.appendChild(I("flatpickr-day " + Ae, new Date(k, L + 1, $e % re), $e, ve));
|
|
23243
23243
|
var Mt = Ne("div", "dayContainer");
|
|
23244
23244
|
return Mt.appendChild(ce), Mt;
|
|
23245
23245
|
}
|
|
@@ -23507,16 +23507,16 @@ function CR(e, t) {
|
|
|
23507
23507
|
break;
|
|
23508
23508
|
case 9:
|
|
23509
23509
|
if (Ie) {
|
|
23510
|
-
var
|
|
23510
|
+
var ve = [
|
|
23511
23511
|
n.hourElement,
|
|
23512
23512
|
n.minuteElement,
|
|
23513
23513
|
n.secondElement,
|
|
23514
23514
|
n.amPM
|
|
23515
23515
|
].concat(n.pluginElements).filter(function(tt) {
|
|
23516
23516
|
return tt;
|
|
23517
|
-
}), $e =
|
|
23517
|
+
}), $e = ve.indexOf(L);
|
|
23518
23518
|
if ($e !== -1) {
|
|
23519
|
-
var Mt =
|
|
23519
|
+
var Mt = ve[$e + (k.shiftKey ? -1 : 1)];
|
|
23520
23520
|
k.preventDefault(), (Mt || n._input).focus();
|
|
23521
23521
|
}
|
|
23522
23522
|
} else !n.config.noCalendar && n.daysContainer && n.daysContainer.contains(L) && k.shiftKey && (k.preventDefault(), n._input.focus());
|
|
@@ -23540,8 +23540,8 @@ function CR(e, t) {
|
|
|
23540
23540
|
if (L === void 0 && (L = "flatpickr-day"), !(n.selectedDates.length !== 1 || k && (!k.classList.contains(L) || k.classList.contains("flatpickr-disabled")))) {
|
|
23541
23541
|
for (var G = k ? k.dateObj.getTime() : n.days.firstElementChild.dateObj.getTime(), q = n.parseDate(n.selectedDates[0], void 0, !0).getTime(), re = Math.min(G, n.selectedDates[0].getTime()), ce = Math.max(G, n.selectedDates[0].getTime()), Ie = !1, ue = 0, Ae = 0, fe = re; fe < ce; fe += yR.DAY)
|
|
23542
23542
|
J(new Date(fe), !0) || (Ie = Ie || fe > re && fe < ce, fe < q && (!ue || fe > ue) ? ue = fe : fe > q && (!Ae || fe < Ae) && (Ae = fe));
|
|
23543
|
-
var
|
|
23544
|
-
|
|
23543
|
+
var ve = Array.from(n.rContainer.querySelectorAll("*:nth-child(-n+" + n.config.showMonths + ") > ." + L));
|
|
23544
|
+
ve.forEach(function($e) {
|
|
23545
23545
|
var Mt = $e.dateObj, tt = Mt.getTime(), xn = ue > 0 && tt < ue || Ae > 0 && tt > Ae;
|
|
23546
23546
|
if (xn) {
|
|
23547
23547
|
$e.classList.add("notAllowed"), ["inRange", "startRange", "endRange"].forEach(function(En) {
|
|
@@ -23604,15 +23604,15 @@ function CR(e, t) {
|
|
|
23604
23604
|
get: function() {
|
|
23605
23605
|
return n.config._enable;
|
|
23606
23606
|
},
|
|
23607
|
-
set: function(
|
|
23608
|
-
n.config._enable = sr(
|
|
23607
|
+
set: function(ve) {
|
|
23608
|
+
n.config._enable = sr(ve);
|
|
23609
23609
|
}
|
|
23610
23610
|
}), Object.defineProperty(n.config, "disable", {
|
|
23611
23611
|
get: function() {
|
|
23612
23612
|
return n.config._disable;
|
|
23613
23613
|
},
|
|
23614
|
-
set: function(
|
|
23615
|
-
n.config._disable = sr(
|
|
23614
|
+
set: function(ve) {
|
|
23615
|
+
n.config._disable = sr(ve);
|
|
23616
23616
|
}
|
|
23617
23617
|
});
|
|
23618
23618
|
var q = L.mode === "time";
|
|
@@ -23635,9 +23635,9 @@ function CR(e, t) {
|
|
|
23635
23635
|
},
|
|
23636
23636
|
set: ht("max")
|
|
23637
23637
|
});
|
|
23638
|
-
var Ie = function(
|
|
23638
|
+
var Ie = function(ve) {
|
|
23639
23639
|
return function($e) {
|
|
23640
|
-
n.config[
|
|
23640
|
+
n.config[ve === "min" ? "_minTime" : "_maxTime"] = n.parseDate($e, "H:i:S");
|
|
23641
23641
|
};
|
|
23642
23642
|
};
|
|
23643
23643
|
Object.defineProperty(n.config, "minTime", {
|
|
@@ -23653,10 +23653,10 @@ function CR(e, t) {
|
|
|
23653
23653
|
}), L.mode === "time" && (n.config.noCalendar = !0, n.config.enableTime = !0), Object.assign(n.config, G, L);
|
|
23654
23654
|
for (var ue = 0; ue < k.length; ue++)
|
|
23655
23655
|
n.config[k[ue]] = n.config[k[ue]] === !0 || n.config[k[ue]] === "true";
|
|
23656
|
-
Fl.filter(function(
|
|
23657
|
-
return n.config[
|
|
23658
|
-
}).forEach(function(
|
|
23659
|
-
n.config[
|
|
23656
|
+
Fl.filter(function(ve) {
|
|
23657
|
+
return n.config[ve] !== void 0;
|
|
23658
|
+
}).forEach(function(ve) {
|
|
23659
|
+
n.config[ve] = zl(n.config[ve] || []).map(a);
|
|
23660
23660
|
}), n.isMobile = !n.config.disableMobile && !n.config.inline && n.config.mode === "single" && !n.config.disable.length && !n.config.enable && !n.config.weekNumbers && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
23661
23661
|
for (var ue = 0; ue < n.config.plugins.length; ue++) {
|
|
23662
23662
|
var Ae = n.config.plugins[ue](n) || {};
|
|
@@ -23680,13 +23680,13 @@ function CR(e, t) {
|
|
|
23680
23680
|
He("onPreCalendarPosition");
|
|
23681
23681
|
var L = k || n._positionElement, G = Array.prototype.reduce.call(n.calendarContainer.children, function(Ly, My) {
|
|
23682
23682
|
return Ly + My.offsetHeight;
|
|
23683
|
-
}, 0), q = n.calendarContainer.offsetWidth, re = n.config.position.split(" "), ce = re[0], Ie = re.length > 1 ? re[1] : null, ue = L.getBoundingClientRect(), Ae = window.innerHeight - ue.bottom, fe = ce === "above" || ce !== "below" && Ae < G && ue.top > G,
|
|
23683
|
+
}, 0), q = n.calendarContainer.offsetWidth, re = n.config.position.split(" "), ce = re[0], Ie = re.length > 1 ? re[1] : null, ue = L.getBoundingClientRect(), Ae = window.innerHeight - ue.bottom, fe = ce === "above" || ce !== "below" && Ae < G && ue.top > G, ve = window.pageYOffset + ue.top + (fe ? -G - 2 : L.offsetHeight + 2);
|
|
23684
23684
|
if (Ut(n.calendarContainer, "arrowTop", !fe), Ut(n.calendarContainer, "arrowBottom", fe), !n.config.inline) {
|
|
23685
23685
|
var $e = window.pageXOffset + ue.left, Mt = !1, tt = !1;
|
|
23686
23686
|
Ie === "center" ? ($e -= (q - ue.width) / 2, Mt = !0) : Ie === "right" && ($e -= q - ue.width, tt = !0), Ut(n.calendarContainer, "arrowLeft", !Mt && !tt), Ut(n.calendarContainer, "arrowCenter", Mt), Ut(n.calendarContainer, "arrowRight", tt);
|
|
23687
23687
|
var xn = window.document.body.offsetWidth - (window.pageXOffset + ue.right), En = $e + q > window.document.body.offsetWidth, Ey = xn + q > window.document.body.offsetWidth;
|
|
23688
23688
|
if (Ut(n.calendarContainer, "rightMost", En), !n.config.static)
|
|
23689
|
-
if (n.calendarContainer.style.top =
|
|
23689
|
+
if (n.calendarContainer.style.top = ve + "px", !En)
|
|
23690
23690
|
n.calendarContainer.style.left = $e + "px", n.calendarContainer.style.right = "auto";
|
|
23691
23691
|
else if (!Ey)
|
|
23692
23692
|
n.calendarContainer.style.left = "auto", n.calendarContainer.style.right = xn + "px";
|
|
@@ -23727,8 +23727,8 @@ function CR(e, t) {
|
|
|
23727
23727
|
}
|
|
23728
23728
|
function Dt(k) {
|
|
23729
23729
|
k.preventDefault(), k.stopPropagation();
|
|
23730
|
-
var L = function(
|
|
23731
|
-
return
|
|
23730
|
+
var L = function(ve) {
|
|
23731
|
+
return ve.classList && ve.classList.contains("flatpickr-day") && !ve.classList.contains("flatpickr-disabled") && !ve.classList.contains("notAllowed");
|
|
23732
23732
|
}, G = Lv(tn(k), L);
|
|
23733
23733
|
if (G !== void 0) {
|
|
23734
23734
|
var q = G, re = n.latestSelectedDateObj = new Date(q.dateObj.getTime()), ce = (re.getMonth() < n.currentMonth || re.getMonth() > n.currentMonth + n.config.showMonths - 1) && n.config.mode !== "range";
|
|
@@ -23737,8 +23737,8 @@ function CR(e, t) {
|
|
|
23737
23737
|
else if (n.config.mode === "multiple") {
|
|
23738
23738
|
var Ie = Hi(re);
|
|
23739
23739
|
Ie ? n.selectedDates.splice(parseInt(Ie), 1) : n.selectedDates.push(re);
|
|
23740
|
-
} else n.config.mode === "range" && (n.selectedDates.length === 2 && n.clear(!1, !1), n.latestSelectedDateObj = re, n.selectedDates.push(re), nn(re, n.selectedDates[0], !0) !== 0 && n.selectedDates.sort(function(
|
|
23741
|
-
return
|
|
23740
|
+
} else n.config.mode === "range" && (n.selectedDates.length === 2 && n.clear(!1, !1), n.latestSelectedDateObj = re, n.selectedDates.push(re), nn(re, n.selectedDates[0], !0) !== 0 && n.selectedDates.sort(function(ve, $e) {
|
|
23741
|
+
return ve.getTime() - $e.getTime();
|
|
23742
23742
|
}));
|
|
23743
23743
|
if (f(), ce) {
|
|
23744
23744
|
var ue = n.currentYear !== re.getFullYear();
|
|
@@ -23906,8 +23906,8 @@ function CR(e, t) {
|
|
|
23906
23906
|
n.amPM !== void 0 && G === n.amPM && (n.amPM.textContent = n.l10n.amPM[un(n.amPM.textContent === n.l10n.amPM[0])]);
|
|
23907
23907
|
var re = parseFloat(q.getAttribute("min")), ce = parseFloat(q.getAttribute("max")), Ie = parseFloat(q.getAttribute("step")), ue = parseInt(q.value, 10), Ae = k.delta || (L ? k.which === 38 ? 1 : -1 : 0), fe = ue + Ie * Ae;
|
|
23908
23908
|
if (typeof q.value != "undefined" && q.value.length === 2) {
|
|
23909
|
-
var
|
|
23910
|
-
fe < re ? (fe = ce + fe + un(!
|
|
23909
|
+
var ve = q === n.hourElement, $e = q === n.minuteElement;
|
|
23910
|
+
fe < re ? (fe = ce + fe + un(!ve) + (un(ve) && un(!n.amPM)), $e && C(void 0, -1, n.hourElement)) : fe > ce && (fe = q === n.hourElement ? fe - ce - un(!n.amPM) : re, $e && C(void 0, 1, n.hourElement)), n.amPM && ve && (Ie === 1 ? fe + ue === 23 : Math.abs(fe - ue) > Ie) && (n.amPM.textContent = n.l10n.amPM[un(n.amPM.textContent === n.l10n.amPM[0])]), q.value = Qt(fe);
|
|
23911
23911
|
}
|
|
23912
23912
|
}
|
|
23913
23913
|
return i(), n;
|
|
@@ -24826,7 +24826,7 @@ const _R = (e) => {
|
|
|
24826
24826
|
);
|
|
24827
24827
|
}, sh = (e) => e ? Object.entries(e).map(([t, n]) => ({ key: t, value: n })) : [], Wl = (e) => e.reduce((t, n) => (t[n.key] = n.value, t), {}), OR = ({ labels: e, type: t, defaultValue: n, onChange: r }) => {
|
|
24828
24828
|
const [i, o] = Y(sh(n)), [a, s] = Y(null), [l, u] = Y(""), [d, f] = Y(""), [h, p] = Y(""), [m, g] = Y("");
|
|
24829
|
-
|
|
24829
|
+
me(() => o(sh(n)), [n]);
|
|
24830
24830
|
const v = () => {
|
|
24831
24831
|
const C = [...i];
|
|
24832
24832
|
C.push({ key: l, value: h }), o(C), u(""), p(""), r(Wl(C));
|
|
@@ -26391,7 +26391,7 @@ function ML(e) {
|
|
|
26391
26391
|
}, [p, h, f]), g = Be(function(v) {
|
|
26392
26392
|
v && (v.removeEventListener("wheel", f, !1), v.removeEventListener("touchstart", h, !1), v.removeEventListener("touchmove", p, !1));
|
|
26393
26393
|
}, [p, h, f]);
|
|
26394
|
-
return
|
|
26394
|
+
return me(function() {
|
|
26395
26395
|
if (t) {
|
|
26396
26396
|
var v = u.current;
|
|
26397
26397
|
return m(v), function() {
|
|
@@ -26451,7 +26451,7 @@ function jL(e) {
|
|
|
26451
26451
|
}), u && Ch() && (u.removeEventListener("touchmove", bh, ii), l && (l.removeEventListener("touchstart", xh, ii), l.removeEventListener("touchmove", yh, ii)));
|
|
26452
26452
|
}
|
|
26453
26453
|
}, [r]);
|
|
26454
|
-
return
|
|
26454
|
+
return me(function() {
|
|
26455
26455
|
if (t) {
|
|
26456
26456
|
var l = o.current;
|
|
26457
26457
|
return a(l), function() {
|
|
@@ -28979,7 +28979,7 @@ const Ii = dt("MuiCheckbox", ["root", "checkbox", "action", "input", "label", "c
|
|
|
28979
28979
|
const p = h.map((m) => ({ entity_id: m, entity_type: "GAME", entity_relationship: "relatedTo" }));
|
|
28980
28980
|
e.onChange(p);
|
|
28981
28981
|
}, d = () => a(!o);
|
|
28982
|
-
return
|
|
28982
|
+
return me(() => {
|
|
28983
28983
|
l();
|
|
28984
28984
|
}, []), /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
28985
28985
|
r.length > 0 ? /* @__PURE__ */ c.jsxs(
|
|
@@ -29049,7 +29049,7 @@ const Ii = dt("MuiCheckbox", ["root", "checkbox", "action", "input", "label", "c
|
|
|
29049
29049
|
const p = h.map((m) => ({ entity_id: m, entity_type: "TEMPLATE", entity_relationship: "relatedTo" }));
|
|
29050
29050
|
e.onChange(p);
|
|
29051
29051
|
}, d = () => a(!o);
|
|
29052
|
-
return
|
|
29052
|
+
return me(() => {
|
|
29053
29053
|
l();
|
|
29054
29054
|
}, []), /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
29055
29055
|
r.length > 0 ? /* @__PURE__ */ c.jsxs(
|
|
@@ -29139,7 +29139,7 @@ const Ii = dt("MuiCheckbox", ["root", "checkbox", "action", "input", "label", "c
|
|
|
29139
29139
|
}
|
|
29140
29140
|
r([]);
|
|
29141
29141
|
});
|
|
29142
|
-
return
|
|
29142
|
+
return me(() => (o(), () => r(null)), [e, t]), n;
|
|
29143
29143
|
}, tl = ({ my: e }) => /* @__PURE__ */ c.jsx(
|
|
29144
29144
|
ie,
|
|
29145
29145
|
{
|
|
@@ -29724,7 +29724,7 @@ const Er = /* @__PURE__ */ Fn(xj), Bn = ({ option: e }) => /* @__PURE__ */ c.jsx
|
|
|
29724
29724
|
const [o, a] = Y([]), [s, l] = Y([]), [u, d] = Y(!1), [f, h] = Y(""), [p, m] = Y(!1), { sdk: g } = vt(), v = () => m(!p), x = (b, I) => {
|
|
29725
29725
|
a(I), i(I[0] ? [I[0].id] : []);
|
|
29726
29726
|
}, w = 3;
|
|
29727
|
-
|
|
29727
|
+
me(() => {
|
|
29728
29728
|
!f && n && n.length && g.football.getCompetitions({ competitionIds: n }).then((b) => {
|
|
29729
29729
|
a(Bh(b));
|
|
29730
29730
|
}).catch((b) => {
|
|
@@ -29741,7 +29741,7 @@ const Er = /* @__PURE__ */ Fn(xj), Bn = ({ option: e }) => /* @__PURE__ */ c.jsx
|
|
|
29741
29741
|
}, 300),
|
|
29742
29742
|
[]
|
|
29743
29743
|
);
|
|
29744
|
-
|
|
29744
|
+
me(() => {
|
|
29745
29745
|
if (!f || f.length < w) {
|
|
29746
29746
|
l([]);
|
|
29747
29747
|
return;
|
|
@@ -29813,7 +29813,7 @@ const Er = /* @__PURE__ */ Fn(xj), Bn = ({ option: e }) => /* @__PURE__ */ c.jsx
|
|
|
29813
29813
|
const I = b.map((A) => A.id);
|
|
29814
29814
|
r(I && I.length ? I : null);
|
|
29815
29815
|
}, x = 3;
|
|
29816
|
-
|
|
29816
|
+
me(() => {
|
|
29817
29817
|
!d && t && t.length && m.football.getCompetitions({ competitionIds: t }).then((C) => {
|
|
29818
29818
|
o(Nh(C));
|
|
29819
29819
|
}).catch((C) => {
|
|
@@ -29832,7 +29832,7 @@ const Er = /* @__PURE__ */ Fn(xj), Bn = ({ option: e }) => /* @__PURE__ */ c.jsx
|
|
|
29832
29832
|
}, 300),
|
|
29833
29833
|
[]
|
|
29834
29834
|
);
|
|
29835
|
-
|
|
29835
|
+
me(() => {
|
|
29836
29836
|
if (!d || d.length < x) {
|
|
29837
29837
|
s([]);
|
|
29838
29838
|
return;
|
|
@@ -29897,7 +29897,7 @@ const Er = /* @__PURE__ */ Fn(xj), Bn = ({ option: e }) => /* @__PURE__ */ c.jsx
|
|
|
29897
29897
|
const b = C.map((I) => I.id);
|
|
29898
29898
|
n(b && b.length ? b : null);
|
|
29899
29899
|
}, v = 3;
|
|
29900
|
-
|
|
29900
|
+
me(() => {
|
|
29901
29901
|
!u && t && t.length && p.profile.getByIds(t).then((y) => {
|
|
29902
29902
|
i(Fh(y));
|
|
29903
29903
|
}).catch((y) => {
|
|
@@ -29914,7 +29914,7 @@ const Er = /* @__PURE__ */ Fn(xj), Bn = ({ option: e }) => /* @__PURE__ */ c.jsx
|
|
|
29914
29914
|
}, 300),
|
|
29915
29915
|
[]
|
|
29916
29916
|
);
|
|
29917
|
-
|
|
29917
|
+
me(() => {
|
|
29918
29918
|
if (!u || u.length < v) {
|
|
29919
29919
|
a([]);
|
|
29920
29920
|
return;
|
|
@@ -29996,7 +29996,7 @@ const Er = /* @__PURE__ */ Fn(xj), Bn = ({ option: e }) => /* @__PURE__ */ c.jsx
|
|
|
29996
29996
|
const I = b.map((A) => A.id);
|
|
29997
29997
|
r(I && I.length ? I : null);
|
|
29998
29998
|
}, x = 3;
|
|
29999
|
-
|
|
29999
|
+
me(() => {
|
|
30000
30000
|
!d && t && t.length && m.football.getTeams({ teamIds: t, scope: n }).then((C) => {
|
|
30001
30001
|
const b = C.data.filter((I) => !I.name.includes("/"));
|
|
30002
30002
|
o(zh(b));
|
|
@@ -30015,7 +30015,7 @@ const Er = /* @__PURE__ */ Fn(xj), Bn = ({ option: e }) => /* @__PURE__ */ c.jsx
|
|
|
30015
30015
|
}, 300),
|
|
30016
30016
|
[]
|
|
30017
30017
|
);
|
|
30018
|
-
|
|
30018
|
+
me(() => {
|
|
30019
30019
|
if (!d || d.length < x) {
|
|
30020
30020
|
s([]);
|
|
30021
30021
|
return;
|
|
@@ -30250,7 +30250,7 @@ const _j = (e, t, n) => {
|
|
|
30250
30250
|
l.errorHandlingMode === "standard" ? u = s.error : u = s.data.error, u.code !== 404 && u.status !== "code_unknown_contest" && n(), i(new Cb());
|
|
30251
30251
|
}
|
|
30252
30252
|
});
|
|
30253
|
-
return
|
|
30253
|
+
return me(() => {
|
|
30254
30254
|
a();
|
|
30255
30255
|
}, []), r;
|
|
30256
30256
|
};
|
|
@@ -30711,7 +30711,7 @@ const nB = (e, t) => t || e || "-------------", Wc = (e, t) => Array.isArray(e)
|
|
|
30711
30711
|
}
|
|
30712
30712
|
d(!1);
|
|
30713
30713
|
});
|
|
30714
|
-
return
|
|
30714
|
+
return me(() => {
|
|
30715
30715
|
h();
|
|
30716
30716
|
}, [r]), { leaderboard: o, hasMoreParticipants: s, isLeaderboardLoading: u };
|
|
30717
30717
|
};
|
|
@@ -30892,7 +30892,7 @@ const cB = (e) => {
|
|
|
30892
30892
|
}, 300),
|
|
30893
30893
|
[]
|
|
30894
30894
|
);
|
|
30895
|
-
|
|
30895
|
+
me(() => (l(o), () => l.cancel()), [o, l]);
|
|
30896
30896
|
const u = (h, p) => {
|
|
30897
30897
|
const m = p.map((g) => g.id);
|
|
30898
30898
|
e.setOptions(p), e.handleResetData(), e.setFilters((g) => Q(B({}, g), {
|
|
@@ -31214,7 +31214,7 @@ function PB(e) {
|
|
|
31214
31214
|
setCaretTimeout: null,
|
|
31215
31215
|
focusTimeout: null
|
|
31216
31216
|
});
|
|
31217
|
-
|
|
31217
|
+
me(function() {
|
|
31218
31218
|
return M(!0), function() {
|
|
31219
31219
|
clearTimeout(U.current.setCaretTimeout), clearTimeout(U.current.focusTimeout);
|
|
31220
31220
|
};
|
|
@@ -31245,14 +31245,14 @@ function PB(e) {
|
|
|
31245
31245
|
}
|
|
31246
31246
|
ge !== T && j(ee(ge, Le), { event: Xe, source: Pe });
|
|
31247
31247
|
};
|
|
31248
|
-
|
|
31248
|
+
me(function() {
|
|
31249
31249
|
var de = S.current, ge = de.formattedValue, Ce = de.numAsString;
|
|
31250
31250
|
(T !== ge || $ !== Ce) && j(ee(T, $), {
|
|
31251
31251
|
event: void 0,
|
|
31252
31252
|
source: _o.props
|
|
31253
31253
|
});
|
|
31254
31254
|
}, [T, $]);
|
|
31255
|
-
var ne = O.current ? tc(O.current) : void 0, se = typeof window != "undefined" ? as :
|
|
31255
|
+
var ne = O.current ? tc(O.current) : void 0, se = typeof window != "undefined" ? as : me;
|
|
31256
31256
|
se(function() {
|
|
31257
31257
|
var de = O.current;
|
|
31258
31258
|
if (T !== S.current.formattedValue && de) {
|
|
@@ -31581,7 +31581,7 @@ const NB = H.forwardRef(function(t, n) {
|
|
|
31581
31581
|
const [t, n] = Y([]), [r, i] = Y([]), [o, a] = Y(!1), [s, l] = Y(""), [u, d] = Y(!1), { sdk: f } = vt(), h = () => d(!u), p = (v, x) => {
|
|
31582
31582
|
n(x), e.onChangeTags(x);
|
|
31583
31583
|
};
|
|
31584
|
-
|
|
31584
|
+
me(() => {
|
|
31585
31585
|
zB(e.tags, f, n, h);
|
|
31586
31586
|
}, [e.tags]);
|
|
31587
31587
|
const m = Se(
|
|
@@ -31598,7 +31598,7 @@ const NB = H.forwardRef(function(t, n) {
|
|
|
31598
31598
|
}, 300),
|
|
31599
31599
|
[]
|
|
31600
31600
|
);
|
|
31601
|
-
|
|
31601
|
+
me(() => (m(s), () => m.cancel()), [s, m]);
|
|
31602
31602
|
const g = (v, x) => v.map((w, y) => /* @__PURE__ */ c.jsx(
|
|
31603
31603
|
Zt,
|
|
31604
31604
|
{
|
|
@@ -31847,7 +31847,7 @@ function Gb(e) {
|
|
|
31847
31847
|
function zi(e) {
|
|
31848
31848
|
return e ? Fi(e) ? e.document : xd(e) ? Cd(e) ? e : Yo(e) || Gb(e) ? e.ownerDocument : document : document : document;
|
|
31849
31849
|
}
|
|
31850
|
-
const wn = rl ? as :
|
|
31850
|
+
const wn = rl ? as : me;
|
|
31851
31851
|
function il(e) {
|
|
31852
31852
|
const t = Te(e);
|
|
31853
31853
|
return wn(() => {
|
|
@@ -31896,7 +31896,7 @@ function Za(e) {
|
|
|
31896
31896
|
}
|
|
31897
31897
|
function es(e) {
|
|
31898
31898
|
const t = Te();
|
|
31899
|
-
return
|
|
31899
|
+
return me(() => {
|
|
31900
31900
|
t.current = e;
|
|
31901
31901
|
}, [e]), t.current;
|
|
31902
31902
|
}
|
|
@@ -32066,7 +32066,7 @@ function iN() {
|
|
|
32066
32066
|
const Kb = /* @__PURE__ */ Nn(null);
|
|
32067
32067
|
function oN(e) {
|
|
32068
32068
|
const t = Ht(Kb);
|
|
32069
|
-
|
|
32069
|
+
me(() => {
|
|
32070
32070
|
if (!t)
|
|
32071
32071
|
throw new Error("useDndMonitor must be used within a children of <DndContext>");
|
|
32072
32072
|
return t(e);
|
|
@@ -32130,7 +32130,7 @@ function cN(e) {
|
|
|
32130
32130
|
announce: o,
|
|
32131
32131
|
announcement: a
|
|
32132
32132
|
} = iN(), s = Qo("DndLiveRegion"), [l, u] = Y(!1);
|
|
32133
|
-
if (
|
|
32133
|
+
if (me(() => {
|
|
32134
32134
|
u(!0);
|
|
32135
32135
|
}, []), oN(Se(() => ({
|
|
32136
32136
|
onDragStart(f) {
|
|
@@ -33117,7 +33117,7 @@ function BN(e) {
|
|
|
33117
33117
|
const A = v.current.x * x.current.x, T = v.current.y * x.current.y;
|
|
33118
33118
|
I.scrollBy(A, T);
|
|
33119
33119
|
}, []), b = Se(() => s === is.TreeOrder ? [...u].reverse() : u, [s, u]);
|
|
33120
|
-
|
|
33120
|
+
me(
|
|
33121
33121
|
() => {
|
|
33122
33122
|
if (!o || !u.length || !w) {
|
|
33123
33123
|
g();
|
|
@@ -33262,21 +33262,21 @@ function VN(e, t) {
|
|
|
33262
33262
|
}
|
|
33263
33263
|
return x;
|
|
33264
33264
|
}, [e, o, n, f, l]);
|
|
33265
|
-
return
|
|
33265
|
+
return me(() => {
|
|
33266
33266
|
d.current = e;
|
|
33267
|
-
}, [e]),
|
|
33267
|
+
}, [e]), me(
|
|
33268
33268
|
() => {
|
|
33269
33269
|
f || p();
|
|
33270
33270
|
},
|
|
33271
33271
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33272
33272
|
[n, f]
|
|
33273
|
-
),
|
|
33273
|
+
), me(
|
|
33274
33274
|
() => {
|
|
33275
33275
|
o && o.length > 0 && a(null);
|
|
33276
33276
|
},
|
|
33277
33277
|
//eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33278
33278
|
[JSON.stringify(o)]
|
|
33279
|
-
),
|
|
33279
|
+
), me(
|
|
33280
33280
|
() => {
|
|
33281
33281
|
f || typeof s != "number" || m.current !== null || (m.current = setTimeout(() => {
|
|
33282
33282
|
p(), m.current = null;
|
|
@@ -33319,7 +33319,7 @@ function WN(e) {
|
|
|
33319
33319
|
} = window;
|
|
33320
33320
|
return new o(r);
|
|
33321
33321
|
}, [r, n]);
|
|
33322
|
-
return
|
|
33322
|
+
return me(() => () => i == null ? void 0 : i.disconnect(), [i]), i;
|
|
33323
33323
|
}
|
|
33324
33324
|
function cl(e) {
|
|
33325
33325
|
let {
|
|
@@ -33338,7 +33338,7 @@ function cl(e) {
|
|
|
33338
33338
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33339
33339
|
[n]
|
|
33340
33340
|
);
|
|
33341
|
-
return
|
|
33341
|
+
return me(() => () => i == null ? void 0 : i.disconnect(), [i]), i;
|
|
33342
33342
|
}
|
|
33343
33343
|
function GN(e) {
|
|
33344
33344
|
return new wd(Ui(e), e);
|
|
@@ -33389,7 +33389,7 @@ function YN(e) {
|
|
|
33389
33389
|
const sp = [];
|
|
33390
33390
|
function KN(e) {
|
|
33391
33391
|
const t = Te(e), n = Ko((r) => e ? r && r !== sp && e && t.current && e.parentNode === t.current.parentNode ? r : al(e) : sp, [e]);
|
|
33392
|
-
return
|
|
33392
|
+
return me(() => {
|
|
33393
33393
|
t.current = e;
|
|
33394
33394
|
}, [e]), n;
|
|
33395
33395
|
}
|
|
@@ -33398,7 +33398,7 @@ function QN(e) {
|
|
|
33398
33398
|
const a = rc(o.target);
|
|
33399
33399
|
a && n((s) => s ? (s.set(a, Yc(a)), new Map(s)) : null);
|
|
33400
33400
|
}, []);
|
|
33401
|
-
return
|
|
33401
|
+
return me(() => {
|
|
33402
33402
|
const o = r.current;
|
|
33403
33403
|
if (e !== o) {
|
|
33404
33404
|
a(o);
|
|
@@ -33424,19 +33424,19 @@ function QN(e) {
|
|
|
33424
33424
|
function lp(e, t) {
|
|
33425
33425
|
t === void 0 && (t = []);
|
|
33426
33426
|
const n = Te(null);
|
|
33427
|
-
return
|
|
33427
|
+
return me(
|
|
33428
33428
|
() => {
|
|
33429
33429
|
n.current = null;
|
|
33430
33430
|
},
|
|
33431
33431
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33432
33432
|
t
|
|
33433
|
-
),
|
|
33433
|
+
), me(() => {
|
|
33434
33434
|
const r = e !== In;
|
|
33435
33435
|
r && !n.current && (n.current = e), !r && n.current && (n.current = null);
|
|
33436
33436
|
}, [e]), n.current ? Ro(e, n.current) : In;
|
|
33437
33437
|
}
|
|
33438
33438
|
function qN(e) {
|
|
33439
|
-
|
|
33439
|
+
me(
|
|
33440
33440
|
() => {
|
|
33441
33441
|
if (!rl)
|
|
33442
33442
|
return;
|
|
@@ -33714,7 +33714,7 @@ function oF(e) {
|
|
|
33714
33714
|
activatorEvent: r,
|
|
33715
33715
|
draggableNodes: i
|
|
33716
33716
|
} = Ht(qo), o = es(r), a = es(n == null ? void 0 : n.id);
|
|
33717
|
-
return
|
|
33717
|
+
return me(() => {
|
|
33718
33718
|
if (!t && !r && o && a != null) {
|
|
33719
33719
|
if (!ol(o) || document.activeElement === o.target)
|
|
33720
33720
|
return;
|
|
@@ -33923,15 +33923,15 @@ const fy = /* @__PURE__ */ Uy(function(t) {
|
|
|
33923
33923
|
return;
|
|
33924
33924
|
const {
|
|
33925
33925
|
onDragAbort: fe
|
|
33926
|
-
} = K.current,
|
|
33926
|
+
} = K.current, ve = {
|
|
33927
33927
|
id: ue
|
|
33928
33928
|
};
|
|
33929
|
-
fe == null || fe(
|
|
33929
|
+
fe == null || fe(ve), w({
|
|
33930
33930
|
type: "onDragAbort",
|
|
33931
|
-
event:
|
|
33931
|
+
event: ve
|
|
33932
33932
|
});
|
|
33933
33933
|
},
|
|
33934
|
-
onPending(ue, Ae, fe,
|
|
33934
|
+
onPending(ue, Ae, fe, ve) {
|
|
33935
33935
|
if (!T.get(ue))
|
|
33936
33936
|
return;
|
|
33937
33937
|
const {
|
|
@@ -33940,7 +33940,7 @@ const fy = /* @__PURE__ */ Uy(function(t) {
|
|
|
33940
33940
|
id: ue,
|
|
33941
33941
|
constraint: Ae,
|
|
33942
33942
|
initialCoordinates: fe,
|
|
33943
|
-
offset:
|
|
33943
|
+
offset: ve
|
|
33944
33944
|
};
|
|
33945
33945
|
Mt == null || Mt(tt), w({
|
|
33946
33946
|
type: "onDragPending",
|
|
@@ -33955,7 +33955,7 @@ const fy = /* @__PURE__ */ Uy(function(t) {
|
|
|
33955
33955
|
if (!fe)
|
|
33956
33956
|
return;
|
|
33957
33957
|
const {
|
|
33958
|
-
onDragStart:
|
|
33958
|
+
onDragStart: ve
|
|
33959
33959
|
} = K.current, $e = {
|
|
33960
33960
|
activatorEvent: re,
|
|
33961
33961
|
active: {
|
|
@@ -33965,7 +33965,7 @@ const fy = /* @__PURE__ */ Uy(function(t) {
|
|
|
33965
33965
|
}
|
|
33966
33966
|
};
|
|
33967
33967
|
Zi(() => {
|
|
33968
|
-
|
|
33968
|
+
ve == null || ve($e), b(cr.Initializing), x({
|
|
33969
33969
|
type: wt.DragStart,
|
|
33970
33970
|
initialCoordinates: ue,
|
|
33971
33971
|
active: Ae
|
|
@@ -33990,7 +33990,7 @@ const fy = /* @__PURE__ */ Uy(function(t) {
|
|
|
33990
33990
|
return E(this, null, function* () {
|
|
33991
33991
|
const {
|
|
33992
33992
|
active: fe,
|
|
33993
|
-
collisions:
|
|
33993
|
+
collisions: ve,
|
|
33994
33994
|
over: $e,
|
|
33995
33995
|
scrollAdjustedTranslate: Mt
|
|
33996
33996
|
} = ke.current;
|
|
@@ -34002,7 +34002,7 @@ const fy = /* @__PURE__ */ Uy(function(t) {
|
|
|
34002
34002
|
tt = {
|
|
34003
34003
|
activatorEvent: re,
|
|
34004
34004
|
active: fe,
|
|
34005
|
-
collisions:
|
|
34005
|
+
collisions: ve,
|
|
34006
34006
|
delta: Mt,
|
|
34007
34007
|
over: $e
|
|
34008
34008
|
}, ue === wt.DragEnd && typeof xn == "function" && (yield Promise.resolve(xn(tt))) && (ue = wt.DragCancel);
|
|
@@ -34044,7 +34044,7 @@ const fy = /* @__PURE__ */ Uy(function(t) {
|
|
|
34044
34044
|
}, [T, Kr]), Xo = UN(d, Hi);
|
|
34045
34045
|
qN(d), wn(() => {
|
|
34046
34046
|
X && C === cr.Initializing && b(cr.Initialized);
|
|
34047
|
-
}, [X, C]),
|
|
34047
|
+
}, [X, C]), me(
|
|
34048
34048
|
() => {
|
|
34049
34049
|
const {
|
|
34050
34050
|
onDragMove: At
|
|
@@ -34075,7 +34075,7 @@ const fy = /* @__PURE__ */ Uy(function(t) {
|
|
|
34075
34075
|
},
|
|
34076
34076
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34077
34077
|
[zt.x, zt.y]
|
|
34078
|
-
),
|
|
34078
|
+
), me(
|
|
34079
34079
|
() => {
|
|
34080
34080
|
const {
|
|
34081
34081
|
active: At,
|
|
@@ -34289,9 +34289,9 @@ function hF(e) {
|
|
|
34289
34289
|
}), C = Be((T, $) => {
|
|
34290
34290
|
y && ($ && (y.unobserve($), f.current = !1), T && y.observe(T));
|
|
34291
34291
|
}, [y]), [b, I] = Za(C), A = Do(t);
|
|
34292
|
-
return
|
|
34292
|
+
return me(() => {
|
|
34293
34293
|
!y || !b.current || (y.disconnect(), f.current = !1, y.observe(b.current));
|
|
34294
|
-
}, [b, y]),
|
|
34294
|
+
}, [b, y]), me(
|
|
34295
34295
|
() => (s({
|
|
34296
34296
|
type: wt.RegisterDroppable,
|
|
34297
34297
|
element: {
|
|
@@ -34309,7 +34309,7 @@ function hF(e) {
|
|
|
34309
34309
|
})),
|
|
34310
34310
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34311
34311
|
[r]
|
|
34312
|
-
),
|
|
34312
|
+
), me(() => {
|
|
34313
34313
|
n !== d.current.disabled && (s({
|
|
34314
34314
|
type: wt.SetDroppableDisabled,
|
|
34315
34315
|
id: r,
|
|
@@ -34678,7 +34678,7 @@ function by(e) {
|
|
|
34678
34678
|
} = hy(), f = Qo(my, n), h = s.rect !== null, p = Se(() => r.map((I) => typeof I == "object" && "id" in I ? I.id : I), [r]), m = a != null, g = a ? p.indexOf(a.id) : -1, v = u ? p.indexOf(u.id) : -1, x = Te(p), w = !EF(p, x.current), y = v !== -1 && g === -1 || w, C = kF(o);
|
|
34679
34679
|
wn(() => {
|
|
34680
34680
|
w && m && d(p);
|
|
34681
|
-
}, [w, p, m, d]),
|
|
34681
|
+
}, [w, p, m, d]), me(() => {
|
|
34682
34682
|
x.current = p;
|
|
34683
34683
|
}, [p]);
|
|
34684
34684
|
const b = Se(
|
|
@@ -34755,7 +34755,7 @@ function LF(e) {
|
|
|
34755
34755
|
}
|
|
34756
34756
|
}
|
|
34757
34757
|
n !== s.current && (s.current = n);
|
|
34758
|
-
}, [t, n, r, i]),
|
|
34758
|
+
}, [t, n, r, i]), me(() => {
|
|
34759
34759
|
o && a(null);
|
|
34760
34760
|
}, [o]), o;
|
|
34761
34761
|
}
|
|
@@ -34850,9 +34850,9 @@ function xy(e) {
|
|
|
34850
34850
|
node: T,
|
|
34851
34851
|
rect: A
|
|
34852
34852
|
});
|
|
34853
|
-
return
|
|
34853
|
+
return me(() => {
|
|
34854
34854
|
R && X.current.newIndex !== J && (X.current.newIndex = J), f !== X.current.containerId && (X.current.containerId = f), d !== X.current.items && (X.current.items = d);
|
|
34855
|
-
}, [R, J, f, d]),
|
|
34855
|
+
}, [R, J, f, d]), me(() => {
|
|
34856
34856
|
if (le === X.current.activeId)
|
|
34857
34857
|
return;
|
|
34858
34858
|
if (le != null && X.current.activeId == null) {
|
|
@@ -35213,7 +35213,7 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
35213
35213
|
}
|
|
35214
35214
|
r(s);
|
|
35215
35215
|
});
|
|
35216
|
-
return
|
|
35216
|
+
return me(() => (o(), () => r(null)), [e]), n;
|
|
35217
35217
|
}, VF = ({ status: e }) => {
|
|
35218
35218
|
let t = "neutral";
|
|
35219
35219
|
switch (e) {
|
|
@@ -35489,7 +35489,7 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
35489
35489
|
"standing"
|
|
35490
35490
|
], ZF = ["relatedTo", "blocks", "blockedBy", "bonusPointsGame", "nextInSeries", "previousInSeries"], ez = (/* @__PURE__ */ new Map()).set("template", "Leaderboard Templates").set("classic_quiz", "Classic Quiz").set("personality_quiz", "Personality Quiz").set("either_or", "Either/Or").set("match_quiz", "Match Quiz").set("top_x", "Top X").set("bracket", "Custom Bracket Game").set("standing", "Custom Standing Game").set("poll", "Poll"), hp = (/* @__PURE__ */ new Map()).set("relatedTo", "Related to").set("blocks", "Blocks").set("blockedBy", "Blocked by").set("nextInSeries", "Next in series").set("previousInSeries", "Previous in series").set("bonusPointsGame", "Bonus points game"), tz = ({ defaultValue: e = [], onChange: t, labels: n }) => {
|
|
35491
35491
|
const [r, i] = Y([]), [o, a] = Y(""), [s, l] = Y(null), [u, d] = Y("relatedTo"), [f, h] = Y(!1), p = () => h(!f), m = UF(s, p), { sdk: g } = vt();
|
|
35492
|
-
|
|
35492
|
+
me(() => (e.length > 0 && JF(g, e, i, p), () => {
|
|
35493
35493
|
i([]), a(""), l(null), d("relatedTo");
|
|
35494
35494
|
}), []);
|
|
35495
35495
|
const v = () => {
|
|
@@ -35867,7 +35867,11 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
35867
35867
|
}
|
|
35868
35868
|
);
|
|
35869
35869
|
}, oz = ({ entityType: e, entityId: t, authRequirement: n, labels: r }) => {
|
|
35870
|
-
const [i, o] = Y(!1), [a, s] = Y(!1), [l, u] = Y(""), [d, f] = Y(""), [h, p] = Y([]), [m, g] = Y("before"), [v, x] = Y(!1), [w, y] = Y(""), [C, b] = Y(""), [I, A] = Y("STANDARD"), [T, $] = Y("left"), [W, P] = Y(!0)
|
|
35870
|
+
const [i, o] = Y(!1), [a, s] = Y(!1), [l, u] = Y(""), [d, f] = Y(""), [h, p] = Y([]), [m, g] = Y("before"), [v, x] = Y(!1), [w, y] = Y(""), [C, b] = Y(""), [I, A] = Y("STANDARD"), [T, $] = Y("left"), [W, P] = Y(!0);
|
|
35871
|
+
me(() => {
|
|
35872
|
+
n !== "LEAD" && o(!1), n !== "REGISTERED" && s(!1);
|
|
35873
|
+
}, [n]);
|
|
35874
|
+
const S = `
|
|
35871
35875
|
data-content-type="${e}"`, j = `
|
|
35872
35876
|
data-content-id="${t}"`, z = h.length > 0 ? `
|
|
35873
35877
|
data-lead-fields="${h.join(", ")}"` : "", N = i ? `
|
|
@@ -35889,7 +35893,7 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
35889
35893
|
country: "Country",
|
|
35890
35894
|
phoneCountryCode: "Phone country code",
|
|
35891
35895
|
phoneNumber: "Phone number"
|
|
35892
|
-
}, ne = ({ title: X }) => /* @__PURE__ */ c.jsx(_e, { title: X, sx: { maxWidth: 300 }, children: /* @__PURE__ */ c.jsx(dr, { color: "primary" }) }), se = () => /* @__PURE__ */ c.jsxs(ln, { sx: { mb:
|
|
35896
|
+
}, ne = ({ title: X }) => /* @__PURE__ */ c.jsx(_e, { title: X, sx: { maxWidth: 300 }, children: /* @__PURE__ */ c.jsx(dr, { color: "primary" }) }), se = () => /* @__PURE__ */ c.jsxs(ln, { sx: { mb: 2 }, children: [
|
|
35893
35897
|
/* @__PURE__ */ c.jsx(
|
|
35894
35898
|
Dr,
|
|
35895
35899
|
{
|
|
@@ -35916,7 +35920,7 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
35916
35920
|
}
|
|
35917
35921
|
)
|
|
35918
35922
|
] })
|
|
35919
|
-
] }), oe = () => /* @__PURE__ */ c.jsxs(ln, { sx: { mb:
|
|
35923
|
+
] }), oe = () => /* @__PURE__ */ c.jsxs(ln, { sx: { mb: 2 }, children: [
|
|
35920
35924
|
/* @__PURE__ */ c.jsxs(Fe, { children: [
|
|
35921
35925
|
/* @__PURE__ */ c.jsx(ze, { color: "primary", children: r.signInLabel }),
|
|
35922
35926
|
/* @__PURE__ */ c.jsx(Ln, { variant: "outlined", color: "neutral", value: l, defaultValue: "", onChange: (X) => u(X.target.value) }),
|
|
@@ -35927,7 +35931,7 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
35927
35931
|
/* @__PURE__ */ c.jsx(Ln, { variant: "outlined", color: "neutral", value: d, defaultValue: "", onChange: (X) => f(X.target.value) }),
|
|
35928
35932
|
/* @__PURE__ */ c.jsx(On, { children: r.authenticationHandlerDescription })
|
|
35929
35933
|
] })
|
|
35930
|
-
] }), J = () => /* @__PURE__ */ c.jsxs(ln, { sx: {
|
|
35934
|
+
] }), J = () => /* @__PURE__ */ c.jsxs(ln, { sx: { mb: 2 }, children: [
|
|
35931
35935
|
/* @__PURE__ */ c.jsx(
|
|
35932
35936
|
jn,
|
|
35933
35937
|
{
|
|
@@ -35956,8 +35960,8 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
35956
35960
|
A(he), $(he !== "STANDARD" ? null : "left");
|
|
35957
35961
|
};
|
|
35958
35962
|
return /* @__PURE__ */ c.jsxs(ie, { mt: 1, children: [
|
|
35959
|
-
e === "classic-quiz" || e === "poll" ? /* @__PURE__ */ c.jsxs(
|
|
35960
|
-
/* @__PURE__ */ c.jsxs(Fe, { children: [
|
|
35963
|
+
e === "classic-quiz" || e === "poll" ? /* @__PURE__ */ c.jsxs(ie, { mb: 2, children: [
|
|
35964
|
+
/* @__PURE__ */ c.jsxs(Fe, { sx: { mb: 1 }, children: [
|
|
35961
35965
|
/* @__PURE__ */ c.jsx(ze, { color: "primary", children: r.layoutTemplate }),
|
|
35962
35966
|
/* @__PURE__ */ c.jsxs(Ot, { value: I, size: "md", name: "layout_template", onChange: le, children: [
|
|
35963
35967
|
/* @__PURE__ */ c.jsx(et, { value: "STANDARD", children: "Standard" }),
|
|
@@ -35966,7 +35970,7 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
35966
35970
|
] }),
|
|
35967
35971
|
/* @__PURE__ */ c.jsx(On, { children: r.layoutTemplateDescription })
|
|
35968
35972
|
] }),
|
|
35969
|
-
/* @__PURE__ */ c.jsxs(Fe, { children: [
|
|
35973
|
+
/* @__PURE__ */ c.jsxs(Fe, { sx: { mb: e === "classic-quiz" ? 1 : 0 }, children: [
|
|
35970
35974
|
/* @__PURE__ */ c.jsx(ze, { color: "primary", children: r.imagePosition }),
|
|
35971
35975
|
/* @__PURE__ */ c.jsxs(
|
|
35972
35976
|
Ot,
|
|
@@ -36002,7 +36006,7 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
36002
36006
|
/* @__PURE__ */ c.jsx(_e, { title: r.showAnswerExplanationsTooltip, sx: { ml: 2, maxWidth: 300 }, children: /* @__PURE__ */ c.jsx(dr, { color: "primary" }) })
|
|
36003
36007
|
] }) : /* @__PURE__ */ c.jsx(c.Fragment, {})
|
|
36004
36008
|
] }) : /* @__PURE__ */ c.jsx(c.Fragment, {}),
|
|
36005
|
-
/* @__PURE__ */ c.jsxs(ie, { display: "flex", children: [
|
|
36009
|
+
/* @__PURE__ */ c.jsxs(ie, { display: "flex", mb: 1, children: [
|
|
36006
36010
|
/* @__PURE__ */ c.jsx(
|
|
36007
36011
|
ci,
|
|
36008
36012
|
{
|
|
@@ -36020,12 +36024,12 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
36020
36024
|
n !== "LEAD" && /* @__PURE__ */ c.jsx(_e, { title: r.configureLeadsDisabledMessage, sx: { ml: 2, maxWidth: 300 }, children: /* @__PURE__ */ c.jsx(dr, { color: "primary" }) })
|
|
36021
36025
|
] }),
|
|
36022
36026
|
i && se(),
|
|
36023
|
-
/* @__PURE__ */ c.jsxs(ie, { display: "flex", children: [
|
|
36027
|
+
/* @__PURE__ */ c.jsxs(ie, { display: "flex", mb: 1, children: [
|
|
36024
36028
|
/* @__PURE__ */ c.jsx(
|
|
36025
36029
|
ci,
|
|
36026
36030
|
{
|
|
36027
36031
|
defaultValue: a,
|
|
36028
|
-
label:
|
|
36032
|
+
label: r.configureSignIn,
|
|
36029
36033
|
labelPosition: "end",
|
|
36030
36034
|
description: "",
|
|
36031
36035
|
descriptionColor: "neutral",
|
|
@@ -36035,19 +36039,13 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
36035
36039
|
}
|
|
36036
36040
|
}
|
|
36037
36041
|
),
|
|
36038
|
-
n !== "REGISTERED" && /* @__PURE__ */ c.jsx(
|
|
36039
|
-
_e,
|
|
36040
|
-
{
|
|
36041
|
-
title: "Configure sign-in options is enabled only when the authentication requirement is set to “Registered”.",
|
|
36042
|
-
sx: { ml: 2, maxWidth: 300 },
|
|
36043
|
-
children: /* @__PURE__ */ c.jsx(dr, { color: "primary" })
|
|
36044
|
-
}
|
|
36045
|
-
)
|
|
36042
|
+
n !== "REGISTERED" && /* @__PURE__ */ c.jsx(_e, { title: r.configureSignInDisabledMessage, sx: { ml: 2, maxWidth: 300 }, children: /* @__PURE__ */ c.jsx(dr, { color: "primary" }) })
|
|
36046
36043
|
] }),
|
|
36047
36044
|
a && oe(),
|
|
36048
36045
|
/* @__PURE__ */ c.jsx(
|
|
36049
36046
|
ci,
|
|
36050
36047
|
{
|
|
36048
|
+
sx: { label: { mb: 1 } },
|
|
36051
36049
|
defaultValue: v,
|
|
36052
36050
|
label: r.addCampaignInfo,
|
|
36053
36051
|
labelPosition: "end",
|
|
@@ -36060,7 +36058,7 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
36060
36058
|
}
|
|
36061
36059
|
),
|
|
36062
36060
|
v && J(),
|
|
36063
|
-
/* @__PURE__ */ c.jsxs(ie, { position: "relative", mb:
|
|
36061
|
+
/* @__PURE__ */ c.jsxs(ie, { position: "relative", mb: 2, children: [
|
|
36064
36062
|
/* @__PURE__ */ c.jsx(
|
|
36065
36063
|
Jc,
|
|
36066
36064
|
{
|
|
@@ -36089,7 +36087,7 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
36089
36087
|
}
|
|
36090
36088
|
) })
|
|
36091
36089
|
] }),
|
|
36092
|
-
/* @__PURE__ */ c.jsx(Rp, { variant: "outlined", color: "primary", startDecorator: /* @__PURE__ */ c.jsx(dr, {}), sx: { mb:
|
|
36090
|
+
/* @__PURE__ */ c.jsx(Rp, { variant: "outlined", color: "primary", startDecorator: /* @__PURE__ */ c.jsx(dr, {}), sx: { mb: 2, width: "fit-content" }, children: /* @__PURE__ */ c.jsxs(pe, { color: "primary", fontSize: 14, fontWeight: 500, children: [
|
|
36093
36091
|
r.divElementTextInfo,
|
|
36094
36092
|
/* @__PURE__ */ c.jsx(Mi, { href: "https://docs.fansunitedmedia.com/docs/user-centric-widgets#/", underline: "always", target: "_blank", rel: "noopener noreferrer", children: "User-centric widgets" })
|
|
36095
36093
|
] }) })
|
|
@@ -36242,7 +36240,7 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
36242
36240
|
const T = A.map(($) => $.id);
|
|
36243
36241
|
n(T && T.length ? T : null);
|
|
36244
36242
|
}, y = 3;
|
|
36245
|
-
|
|
36243
|
+
me(() => {
|
|
36246
36244
|
!s && t && t.length && g.profile.getByIds(t, void 0, v).then((I) => {
|
|
36247
36245
|
i(gp(I));
|
|
36248
36246
|
}).catch((I) => {
|
|
@@ -36259,7 +36257,7 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
36259
36257
|
}, 300),
|
|
36260
36258
|
[]
|
|
36261
36259
|
);
|
|
36262
|
-
|
|
36260
|
+
me(() => {
|
|
36263
36261
|
if (!s || s.length < y) {
|
|
36264
36262
|
a([]);
|
|
36265
36263
|
return;
|
|
@@ -36504,9 +36502,9 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
36504
36502
|
const $ = l.filter((W) => W.name.toLowerCase().includes(T.toLowerCase()));
|
|
36505
36503
|
s($);
|
|
36506
36504
|
};
|
|
36507
|
-
|
|
36505
|
+
me(() => {
|
|
36508
36506
|
dz(n, v, o, x);
|
|
36509
|
-
}, [n]),
|
|
36507
|
+
}, [n]), me(() => {
|
|
36510
36508
|
w && C();
|
|
36511
36509
|
}, [t]);
|
|
36512
36510
|
const I = Se(
|
|
@@ -36530,7 +36528,7 @@ const Iy = qe(/* @__PURE__ */ c.jsx("path", {
|
|
|
36530
36528
|
}, 300),
|
|
36531
36529
|
[v, w]
|
|
36532
36530
|
);
|
|
36533
|
-
|
|
36531
|
+
me(() => (w ? b(h) : I(h), () => {
|
|
36534
36532
|
w || I.cancel();
|
|
36535
36533
|
}), [h, w]);
|
|
36536
36534
|
const A = (T, $) => T.map((W, P) => /* @__PURE__ */ c.jsx(
|
package/index.umd.js
CHANGED
|
@@ -2472,7 +2472,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2472
2472
|
To pick up a draggable item, press the space bar.
|
|
2473
2473
|
While dragging, use the arrow keys to move the item.
|
|
2474
2474
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
2475
|
-
`},v$={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function b$(e){let{announcements:t=v$,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=m$}=e;const{announce:o,announcement:a}=h$(),s=vo("DndLiveRegion"),[l,u]=x.useState(!1);if(x.useEffect(()=>{u(!0)},[]),p$(x.useMemo(()=>({onDragStart(f){let{active:h}=f;o(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;t.onDragMove&&o(t.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;o(t.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;o(t.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;o(t.onDragCancel({active:h,over:p}))}}),[o,t])),!l)return null;const d=x.createElement(x.Fragment,null,x.createElement(d$,{id:r,value:i.draggable}),x.createElement(f$,{id:s,announcement:a}));return n?Re.createPortal(d,n):d}var mt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(mt||(mt={}));function xs(){}function Cs(e,t){return x.useMemo(()=>({sensor:e,options:t!=null?t:{}}),[e,t])}function xv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const cn=Object.freeze({x:0,y:0});function y$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function x$(e,t){const n=ys(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function C$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function w$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Cv(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function wv(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}const I$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=Cv(t),o=[];for(const a of r){const{id:s}=a,l=n.get(s);if(l){const u=Cv(l),d=i.reduce((h,p,m)=>h+y$(u[m],p),0),f=Number((d/4).toFixed(4));o.push({id:s,data:{droppableContainer:a,value:f}})}}return o.sort(C$)};function S$(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,s=o-n;if(r<i&&n<o){const l=t.width*t.height,u=e.width*e.height,d=a*s,f=d/(l+u-d);return Number(f.toFixed(4))}return 0}const A$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:a}=o,s=n.get(a);if(s){const l=S$(s,t);l>0&&i.push({id:a,data:{droppableContainer:o,value:l}})}}return i.sort(w$)};function T$(e,t,n){return q(z({},e),{scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1})}function Iv(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:cn}function E$(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((a,s)=>q(z({},a),{top:a.top+e*s.y,bottom:a.bottom+e*s.y,left:a.left+e*s.x,right:a.right+e*s.x}),z({},n))}}const k$=E$(1);function Sv(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function _$(e,t,n){const r=Sv(t);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:s}=r,l=e.left-a-(1-i)*parseFloat(n),u=e.top-s-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),d=i?e.width/i:e.width,f=o?e.height/o:e.height;return{width:d,height:f,top:u,right:l+d,bottom:u+f,left:l}}const P$={ignoreTransform:!1};function mi(e,t){t===void 0&&(t=P$);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=Rt(e).getComputedStyle(e);u&&(n=_$(n,u,d))}const{top:r,left:i,width:o,height:a,bottom:s,right:l}=n;return{top:r,left:i,width:o,height:a,bottom:s,right:l}}function Av(e){return mi(e,{ignoreTransform:!0})}function D$(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function O$(e,t){return t===void 0&&(t=Rt(e).getComputedStyle(e)),t.position==="fixed"}function R$(e,t){t===void 0&&(t=Rt(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function ws(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(wu(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!po(i)||mv(i)||n.includes(i))return n;const o=Rt(e).getComputedStyle(i);return i!==e&&R$(i,o)&&n.push(i),O$(i,o)?n:r(i.parentNode)}return e?r(e):n}function Tv(e){const[t]=ws(e,1);return t!=null?t:null}function Su(e){return!ps||!e?null:hi(e)?e:Cu(e)?wu(e)||e===pi(e).scrollingElement?window:po(e)?e:null:null}function Ev(e){return hi(e)?e.scrollX:e.scrollLeft}function kv(e){return hi(e)?e.scrollY:e.scrollTop}function Au(e){return{x:Ev(e),y:kv(e)}}var xt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(xt||(xt={}));function _v(e){return!ps||!e?!1:e===document.scrollingElement}function Pv(e){const t={x:0,y:0},n=_v(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,s=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:a,isRight:s,maxScroll:r,minScroll:t}}const L$={x:.2,y:.2};function M$(e,t,n,r,i){let{top:o,left:a,right:s,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=L$);const{isTop:u,isBottom:d,isLeft:f,isRight:h}=Pv(e),p={x:0,y:0},m={x:0,y:0},g={height:t.height*i.y,width:t.width*i.x};return!u&&o<=t.top+g.height?(p.y=xt.Backward,m.y=r*Math.abs((t.top+g.height-o)/g.height)):!d&&l>=t.bottom-g.height&&(p.y=xt.Forward,m.y=r*Math.abs((t.bottom-g.height-l)/g.height)),!h&&s>=t.right-g.width?(p.x=xt.Forward,m.x=r*Math.abs((t.right-g.width-s)/g.width)):!f&&a<=t.left+g.width&&(p.x=xt.Backward,m.x=r*Math.abs((t.left+g.width-a)/g.width)),{direction:p,speed:m}}function B$(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Dv(e){return e.reduce((t,n)=>gi(t,Au(n)),cn)}function $$(e){return e.reduce((t,n)=>t+Ev(n),0)}function N$(e){return e.reduce((t,n)=>t+kv(n),0)}function Ov(e,t){if(t===void 0&&(t=mi),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);Tv(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const F$=[["x",["left","right"],$$],["y",["top","bottom"],N$]];class Tu{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=ws(n),i=Dv(r);this.rect=z({},t),this.width=t.width,this.height=t.height;for(const[o,a,s]of F$)for(const l of a)Object.defineProperty(this,l,{get:()=>{const u=s(r),d=i[o]-u;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class yo{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function z$(e){const{EventTarget:t}=Rt(e);return e instanceof t?e:pi(e)}function Eu(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(yi(n,2)+yi(r,2))>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var on;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(on||(on={}));function Rv(e){e.preventDefault()}function j$(e){e.stopPropagation()}var ke;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(ke||(ke={}));const Lv={start:[ke.Space,ke.Enter],cancel:[ke.Esc],end:[ke.Space,ke.Enter,ke.Tab]},U$=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ke.Right:return q(z({},n),{x:n.x+25});case ke.Left:return q(z({},n),{x:n.x-25});case ke.Down:return q(z({},n),{y:n.y+25});case ke.Up:return q(z({},n),{y:n.y-25})}};class Is{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new yo(pi(n)),this.windowListeners=new yo(Rt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(on.Resize,this.handleCancel),this.windowListeners.add(on.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(on.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Ov(r),n(cn)}handleKeyDown(t){if(bs(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=Lv,coordinateGetter:a=U$,scrollBehavior:s="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,d=u?{x:u.left,y:u.top}:cn;this.referenceCoordinates||(this.referenceCoordinates=d);const f=a(t,{active:n,context:r.current,currentCoordinates:d});if(f){const h=bo(f,d),p={x:0,y:0},{scrollableAncestors:m}=r.current;for(const g of m){const b=t.code,{isTop:w,isRight:S,isLeft:C,isBottom:I,maxScroll:y,minScroll:A}=Pv(g),E=B$(g),k={x:Math.min(b===ke.Right?E.right-E.width/2:E.right,Math.max(b===ke.Right?E.left:E.left+E.width/2,f.x)),y:Math.min(b===ke.Down?E.bottom-E.height/2:E.bottom,Math.max(b===ke.Down?E.top:E.top+E.height/2,f.y))},F=b===ke.Right&&!S||b===ke.Left&&!C,Y=b===ke.Down&&!I||b===ke.Up&&!w;if(F&&k.x!==f.x){const O=g.scrollLeft+h.x,T=b===ke.Right&&O<=y.x||b===ke.Left&&O>=A.x;if(T&&!h.y){g.scrollTo({left:O,behavior:s});return}T?p.x=g.scrollLeft-O:p.x=b===ke.Right?g.scrollLeft-y.x:g.scrollLeft-A.x,p.x&&g.scrollBy({left:-p.x,behavior:s});break}else if(Y&&k.y!==f.y){const O=g.scrollTop+h.y,T=b===ke.Down&&O<=y.y||b===ke.Up&&O>=A.y;if(T&&!h.x){g.scrollTo({top:O,behavior:s});return}T?p.y=g.scrollTop-O:p.y=b===ke.Down?g.scrollTop-y.y:g.scrollTop-A.y,p.y&&g.scrollBy({top:-p.y,behavior:s});break}}this.handleMove(t,gi(bo(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Is.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Lv,onActivation:i}=t,{active:o}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const s=o.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function Mv(e){return!!(e&&"distance"in e)}function Bv(e){return!!(e&&"delay"in e)}class ku{constructor(t,n,r){var i;r===void 0&&(r=z$(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:a}=o;this.props=t,this.events=n,this.document=pi(a),this.documentListeners=new yo(this.document),this.listeners=new yo(r),this.windowListeners=new yo(Rt(a)),this.initialCoordinates=(i=ys(o))!=null?i:cn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(on.Resize,this.handleCancel),this.windowListeners.add(on.DragStart,Rv),this.windowListeners.add(on.VisibilityChange,this.handleCancel),this.windowListeners.add(on.ContextMenu,Rv),this.documentListeners.add(on.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Bv(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Mv(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(on.Click,j$,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(on.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:a,options:{activationConstraint:s}}=o;if(!i)return;const l=(n=ys(t))!=null?n:cn,u=bo(i,l);if(!r&&s){if(Mv(s)){if(s.tolerance!=null&&Eu(u,s.tolerance))return this.handleCancel();if(Eu(u,s.distance))return this.handleStart()}if(Bv(s)&&Eu(u,s.tolerance))return this.handleCancel();this.handlePending(s,u);return}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===ke.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const V$={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ss extends ku{constructor(t){const{event:n}=t,r=pi(n.target);super(t,V$,r)}}Ss.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const H$={move:{name:"mousemove"},end:{name:"mouseup"}};var _u;(function(e){e[e.RightClick=2]="RightClick"})(_u||(_u={}));class W$ extends ku{constructor(t){super(t,H$,pi(t.event.target))}}W$.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===_u.RightClick?!1:(r==null||r({event:n}),!0)}}];const Pu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class G$ extends ku{constructor(t){super(t,Pu)}static setup(){return window.addEventListener(Pu.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Pu.move.name,t)};function t(){}}}G$.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var xo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(xo||(xo={}));var As;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(As||(As={}));function Y$(e){let{acceleration:t,activator:n=xo.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:a=5,order:s=As.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:h}=e;const p=Q$({delta:f,disabled:!o}),[m,g]=a$(),b=x.useRef({x:0,y:0}),w=x.useRef({x:0,y:0}),S=x.useMemo(()=>{switch(n){case xo.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case xo.DraggableRect:return i}},[n,i,l]),C=x.useRef(null),I=x.useCallback(()=>{const A=C.current;if(!A)return;const E=b.current.x*w.current.x,k=b.current.y*w.current.y;A.scrollBy(E,k)},[]),y=x.useMemo(()=>s===As.TreeOrder?[...u].reverse():u,[s,u]);x.useEffect(()=>{if(!o||!u.length||!S){g();return}for(const A of y){if((r==null?void 0:r(A))===!1)continue;const E=u.indexOf(A),k=d[E];if(!k)continue;const{direction:F,speed:Y}=M$(A,k,S,t,h);for(const O of["x","y"])p[O][F[O]]||(Y[O]=0,F[O]=0);if(Y.x>0||Y.y>0){g(),C.current=A,m(I,a),b.current=Y,w.current=F;return}}b.current={x:0,y:0},w.current={x:0,y:0},g()},[t,I,r,g,o,a,JSON.stringify(S),JSON.stringify(p),m,u,y,d,JSON.stringify(h)])}const K$={x:{[xt.Backward]:!1,[xt.Forward]:!1},y:{[xt.Backward]:!1,[xt.Forward]:!1}};function Q$(e){let{delta:t,disabled:n}=e;const r=vs(t);return mo(i=>{if(n||!r||!i)return K$;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[xt.Backward]:i.x[xt.Backward]||o.x===-1,[xt.Forward]:i.x[xt.Forward]||o.x===1},y:{[xt.Backward]:i.y[xt.Backward]||o.y===-1,[xt.Forward]:i.y[xt.Forward]||o.y===1}}},[n,t,r])}function q$(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return mo(i=>{var o;return t==null?null:(o=r!=null?r:i)!=null?o:null},[r,t])}function J$(e,t){return x.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...o]},[]),[e,t])}var Co;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Co||(Co={}));var Du;(function(e){e.Optimized="optimized"})(Du||(Du={}));const $v=new Map;function X$(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,a]=x.useState(null),{frequency:s,measure:l,strategy:u}=i,d=x.useRef(e),f=b(),h=go(f),p=x.useCallback(function(w){w===void 0&&(w=[]),!h.current&&a(S=>S===null?w:S.concat(w.filter(C=>!S.includes(C))))},[h]),m=x.useRef(null),g=mo(w=>{if(f&&!n)return $v;if(!w||w===$v||d.current!==e||o!=null){const S=new Map;for(let C of e){if(!C)continue;if(o&&o.length>0&&!o.includes(C.id)&&C.rect.current){S.set(C.id,C.rect.current);continue}const I=C.node.current,y=I?new Tu(l(I),I):null;C.rect.current=y,y&&S.set(C.id,y)}return S}return w},[e,o,n,f,l]);return x.useEffect(()=>{d.current=e},[e]),x.useEffect(()=>{f||p()},[n,f]),x.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),x.useEffect(()=>{f||typeof s!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,f,p,...r]),{droppableRects:g,measureDroppableContainers:p,measuringScheduled:o!=null};function b(){switch(u){case Co.Always:return!1;case Co.BeforeDragging:return n;default:return!n}}}function Ou(e,t){return mo(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Z$(e,t){return Ou(e,t)}function eN(e){let{callback:t,disabled:n}=e;const r=gs(t),i=x.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.MutationObserver=="undefined")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return x.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Ts(e){let{callback:t,disabled:n}=e;const r=gs(t),i=x.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.ResizeObserver=="undefined")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return x.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function tN(e){return new Tu(mi(e),e)}function Nv(e,t,n){t===void 0&&(t=tN);const[r,i]=x.useState(null);function o(){i(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l!=null?l:n)!=null?u:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const a=eN({callback(l){if(e)for(const u of l){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),s=Ts({callback:o});return ln(()=>{o(),e?(s==null||s.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),a==null||a.disconnect())},[e]),r}function nN(e){const t=Ou(e);return Iv(e,t)}const Fv=[];function rN(e){const t=x.useRef(e),n=mo(r=>e?r&&r!==Fv&&e&&t.current&&e.parentNode===t.current.parentNode?r:ws(e):Fv,[e]);return x.useEffect(()=>{t.current=e},[e]),n}function iN(e){const[t,n]=x.useState(null),r=x.useRef(e),i=x.useCallback(o=>{const a=Su(o.target);a&&n(s=>s?(s.set(a,Au(a)),new Map(s)):null)},[]);return x.useEffect(()=>{const o=r.current;if(e!==o){a(o);const s=e.map(l=>{const u=Su(l);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,Au(u)]):null}).filter(l=>l!=null);n(s.length?new Map(s):null),r.current=e}return()=>{a(e),a(o)};function a(s){s.forEach(l=>{const u=Su(l);u==null||u.removeEventListener("scroll",i)})}},[i,e]),x.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>gi(o,a),cn):Dv(e):cn,[e,t])}function zv(e,t){t===void 0&&(t=[]);const n=x.useRef(null);return x.useEffect(()=>{n.current=null},t),x.useEffect(()=>{const r=e!==cn;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?bo(e,n.current):cn}function oN(e){x.useEffect(()=>{if(!ps)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function aN(e,t){return x.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=a=>{o(a,t)},n},{}),[e,t])}function jv(e){return x.useMemo(()=>e?D$(e):null,[e])}const Uv=[];function sN(e,t){t===void 0&&(t=mi);const[n]=e,r=jv(n?Rt(n):null),[i,o]=x.useState(Uv);function a(){o(()=>e.length?e.map(l=>_v(l)?r:new Tu(t(l),l)):Uv)}const s=Ts({callback:a});return ln(()=>{s==null||s.disconnect(),a(),e.forEach(l=>s==null?void 0:s.observe(l))},[e]),i}function Vv(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return po(t)?t:e}function lN(e){let{measure:t}=e;const[n,r]=x.useState(null),i=x.useCallback(u=>{for(const{target:d}of u)if(po(d)){r(f=>{const h=t(d);return f?q(z({},f),{width:h.width,height:h.height}):h});break}},[t]),o=Ts({callback:i}),a=x.useCallback(u=>{const d=Vv(u);o==null||o.disconnect(),d&&(o==null||o.observe(d)),r(d?t(d):null)},[t,o]),[s,l]=ms(a);return x.useMemo(()=>({nodeRef:s,rect:n,setRef:l}),[n,s,l])}const cN=[{sensor:Ss,options:{}},{sensor:Is,options:{}}],uN={current:{}},Es={draggable:{measure:Av},droppable:{measure:Av,strategy:Co.WhileDragging,frequency:Du.Optimized},dragOverlay:{measure:mi}};class wo extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const dN={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new wo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:xs},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Es,measureDroppableContainers:xs,windowRect:null,measuringScheduled:!1},Hv={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:xs,draggableNodes:new Map,over:null,measureDroppableContainers:xs},Io=x.createContext(Hv),Wv=x.createContext(dN);function fN(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new wo}}}function hN(e,t){switch(t.type){case mt.DragStart:return q(z({},e),{draggable:q(z({},e.draggable),{initialCoordinates:t.initialCoordinates,active:t.active})});case mt.DragMove:return e.draggable.active==null?e:q(z({},e),{draggable:q(z({},e.draggable),{translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}})});case mt.DragEnd:case mt.DragCancel:return q(z({},e),{draggable:q(z({},e.draggable),{active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}})});case mt.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new wo(e.droppable.containers);return i.set(r,n),q(z({},e),{droppable:q(z({},e.droppable),{containers:i})})}case mt.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new wo(e.droppable.containers);return a.set(n,q(z({},o),{disabled:i})),q(z({},e),{droppable:q(z({},e.droppable),{containers:a})})}case mt.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new wo(e.droppable.containers);return o.delete(n),q(z({},e),{droppable:q(z({},e.droppable),{containers:o})})}default:return e}}function pN(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=x.useContext(Io),o=vs(r),a=vs(n==null?void 0:n.id);return x.useEffect(()=>{if(!t&&!r&&o&&a!=null){if(!bs(o)||document.activeElement===o.target)return;const s=i.get(a);if(!s)return;const{activatorNode:l,node:u}=s;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[l.current,u.current]){if(!d)continue;const f=c$(d);if(f){f.focus();break}}})}},[r,t,i,a,o]),null}function Gv(e,t){let i=t,{transform:n}=i,r=Ge(i,["transform"]);return e!=null&&e.length?e.reduce((o,a)=>a(z({transform:o},r)),n):n}function gN(e){return x.useMemo(()=>({draggable:z(z({},Es.draggable),e==null?void 0:e.draggable),droppable:z(z({},Es.droppable),e==null?void 0:e.droppable),dragOverlay:z(z({},Es.dragOverlay),e==null?void 0:e.dragOverlay)}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function mN(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=x.useRef(!1),{x:a,y:s}=typeof i=="boolean"?{x:i,y:i}:i;ln(()=>{if(!a&&!s||!t){o.current=!1;return}if(o.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=n(u),f=Iv(d,r);if(a||(f.x=0),s||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=Tv(u);h&&h.scrollBy({top:f.y,left:f.x})}},[t,a,s,r,n])}const ks=x.createContext(q(z({},cn),{scaleX:1,scaleY:1}));var sr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(sr||(sr={}));const Yv=x.memo(function(t){var n,r,i,o;let Ms=t,{id:a,accessibility:s,autoScroll:l=!0,children:u,sensors:d=cN,collisionDetection:f=A$,measuring:h,modifiers:p}=Ms,m=Ge(Ms,["id","accessibility","autoScroll","children","sensors","collisionDetection","measuring","modifiers"]);const g=x.useReducer(hN,void 0,fN),[b,w]=g,[S,C]=g$(),[I,y]=x.useState(sr.Uninitialized),A=I===sr.Initialized,{draggable:{active:E,nodes:k,translate:F},droppable:{containers:Y}}=b,O=E!=null?k.get(E):null,T=x.useRef({initial:null,translated:null}),N=x.useMemo(()=>{var Ct;return E!=null?{id:E,data:(Ct=O==null?void 0:O.data)!=null?Ct:uN,rect:T}:null},[E,O]),V=x.useRef(null),[j,$]=x.useState(null),[M,H]=x.useState(null),Q=go(m,Object.values(m)),te=vo("DndDescribedBy",a),R=x.useMemo(()=>Y.getEnabled(),[Y]),L=gN(h),{droppableRects:U,measureDroppableContainers:W,measuringScheduled:re}=X$(R,{dragging:A,dependencies:[F.x,F.y],config:L.droppable}),se=q$(k,E),ae=x.useMemo(()=>M?ys(M):null,[M]),X=un(),le=Z$(se,L.draggable.measure);mN({activeNode:E!=null?k.get(E):null,config:X.layoutShiftCompensation,initialRect:le,measure:L.draggable.measure});const Z=Nv(se,L.draggable.measure,le),he=Nv(se?se.parentElement:null),Se=x.useRef({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:Y,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),He=Y.getNodeFor((n=Se.current.over)==null?void 0:n.id),wt=lN({measure:L.dragOverlay.measure}),ct=(r=wt.nodeRef.current)!=null?r:se,_t=A?(i=wt.rect)!=null?i:Z:null,de=!!(wt.nodeRef.current&&wt.rect),pe=nN(de?null:Z),xe=jv(ct?Rt(ct):null),Te=rN(A?He!=null?He:se:null),We=sN(Te),Pe=Gv(p,{transform:{x:F.x-pe.x,y:F.y-pe.y,scaleX:1,scaleY:1},activatorEvent:M,active:N,activeNodeRect:Z,containerNodeRect:he,draggingNodeRect:_t,over:Se.current.over,overlayNodeRect:wt.rect,scrollableAncestors:Te,scrollableAncestorRects:We,windowRect:xe}),Ee=ae?gi(ae,F):null,It=iN(Te),St=zv(It),jt=zv(It,[Z]),Lt=gi(Pe,St),Qt=_t?k$(_t,Pe):null,lr=N&&Qt?f({active:N,collisionRect:Qt,droppableRects:U,droppableContainers:R,pointerCoordinates:Ee}):null,Rs=wv(lr,"id"),[In,So]=x.useState(null),Ru=de?Pe:gi(Pe,jt),Lu=T$(Ru,(o=In==null?void 0:In.rect)!=null?o:null,Z),je=x.useRef(null),vi=x.useCallback((Ct,P)=>{let{sensor:B,options:K}=P;if(V.current==null)return;const J=k.get(V.current);if(!J)return;const ie=Ct.nativeEvent,ce=new B({active:V.current,activeNode:J,event:ie,options:K,context:Se,onAbort(ue){if(!k.get(ue))return;const{onDragAbort:fe}=Q.current,me={id:ue};fe==null||fe(me),S({type:"onDragAbort",event:me})},onPending(ue,we,fe,me){if(!k.get(ue))return;const{onDragPending:Pt}=Q.current,it={id:ue,constraint:we,initialCoordinates:fe,offset:me};Pt==null||Pt(it),S({type:"onDragPending",event:it})},onStart(ue){const we=V.current;if(we==null)return;const fe=k.get(we);if(!fe)return;const{onDragStart:me}=Q.current,Oe={activatorEvent:ie,active:{id:we,data:fe.data,rect:T}};Re.unstable_batchedUpdates(()=>{me==null||me(Oe),y(sr.Initializing),w({type:mt.DragStart,initialCoordinates:ue,active:we}),S({type:"onDragStart",event:Oe}),$(je.current),H(ie)})},onMove(ue){w({type:mt.DragMove,coordinates:ue})},onEnd:Ce(mt.DragEnd),onCancel:Ce(mt.DragCancel)});je.current=ce;function Ce(ue){return function(){return _(this,null,function*(){const{active:fe,collisions:me,over:Oe,scrollAdjustedTranslate:Pt}=Se.current;let it=null;if(fe&&Pt){const{cancelDrop:dn}=Q.current;it={activatorEvent:ie,active:fe,collisions:me,delta:Pt,over:Oe},ue===mt.DragEnd&&typeof dn=="function"&&(yield Promise.resolve(dn(it)))&&(ue=mt.DragCancel)}V.current=null,Re.unstable_batchedUpdates(()=>{w({type:ue}),y(sr.Uninitialized),So(null),$(null),H(null),je.current=null;const dn=ue===mt.DragEnd?"onDragEnd":"onDragCancel";if(it){const Sn=Q.current[dn];Sn==null||Sn(it),S({type:dn,event:it})}})})}}},[k]),Ao=x.useCallback((Ct,P)=>(B,K)=>{const J=B.nativeEvent,ie=k.get(K);if(V.current!==null||!ie||J.dndKit||J.defaultPrevented)return;const ce={active:ie};Ct(B,P.options,ce)===!0&&(J.dndKit={capturedBy:P.sensor},V.current=K,vi(B,P))},[k,vi]),Ls=J$(d,Ao);oN(d),ln(()=>{Z&&I===sr.Initializing&&y(sr.Initialized)},[Z,I]),x.useEffect(()=>{const{onDragMove:Ct}=Q.current,{active:P,activatorEvent:B,collisions:K,over:J}=Se.current;if(!P||!B)return;const ie={active:P,activatorEvent:B,collisions:K,delta:{x:Lt.x,y:Lt.y},over:J};Re.unstable_batchedUpdates(()=>{Ct==null||Ct(ie),S({type:"onDragMove",event:ie})})},[Lt.x,Lt.y]),x.useEffect(()=>{const{active:Ct,activatorEvent:P,collisions:B,droppableContainers:K,scrollAdjustedTranslate:J}=Se.current;if(!Ct||V.current==null||!P||!J)return;const{onDragOver:ie}=Q.current,ce=K.get(Rs),Ce=ce&&ce.rect.current?{id:ce.id,rect:ce.rect.current,data:ce.data,disabled:ce.disabled}:null,ue={active:Ct,activatorEvent:P,collisions:B,delta:{x:J.x,y:J.y},over:Ce};Re.unstable_batchedUpdates(()=>{So(Ce),ie==null||ie(ue),S({type:"onDragOver",event:ue})})},[Rs]),ln(()=>{Se.current={activatorEvent:M,active:N,activeNode:se,collisionRect:Qt,collisions:lr,droppableRects:U,draggableNodes:k,draggingNode:ct,draggingNodeRect:_t,droppableContainers:Y,over:In,scrollableAncestors:Te,scrollAdjustedTranslate:Lt},T.current={initial:_t,translated:Qt}},[N,se,lr,Qt,k,ct,_t,U,Y,In,Te,Lt]),Y$(q(z({},X),{delta:F,draggingRect:Qt,pointerCoordinates:Ee,scrollableAncestors:Te,scrollableAncestorRects:We}));const bi=x.useMemo(()=>({active:N,activeNode:se,activeNodeRect:Z,activatorEvent:M,collisions:lr,containerNodeRect:he,dragOverlay:wt,draggableNodes:k,droppableContainers:Y,droppableRects:U,over:In,measureDroppableContainers:W,scrollableAncestors:Te,scrollableAncestorRects:We,measuringConfiguration:L,measuringScheduled:re,windowRect:xe}),[N,se,Z,M,lr,he,wt,k,Y,U,In,W,Te,We,L,re,xe]),To=x.useMemo(()=>({activatorEvent:M,activators:Ls,active:N,activeNodeRect:Z,ariaDescribedById:{draggable:te},dispatch:w,draggableNodes:k,over:In,measureDroppableContainers:W}),[M,Ls,N,Z,w,te,k,In,W]);return x.createElement(yv.Provider,{value:C},x.createElement(Io.Provider,{value:To},x.createElement(Wv.Provider,{value:bi},x.createElement(ks.Provider,{value:Lu},u)),x.createElement(pN,{disabled:(s==null?void 0:s.restoreFocus)===!1})),x.createElement(b$,q(z({},s),{hiddenTextDescribedById:te})));function un(){const Ct=(j==null?void 0:j.autoScrollEnabled)===!1,P=typeof l=="object"?l.enabled===!1:l===!1,B=A&&!Ct&&!P;return typeof l=="object"?q(z({},l),{enabled:B}):{enabled:B}}}),vN=x.createContext(null),Kv="button",bN="Draggable";function yN(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=vo(bN),{activators:a,activatorEvent:s,active:l,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:h}=x.useContext(Io),{role:p=Kv,roleDescription:m="draggable",tabIndex:g=0}=i!=null?i:{},b=(l==null?void 0:l.id)===t,w=x.useContext(b?ks:vN),[S,C]=ms(),[I,y]=ms(),A=aN(a,t),E=go(n);ln(()=>(f.set(t,{id:t,key:o,node:S,activatorNode:I,data:E}),()=>{const F=f.get(t);F&&F.key===o&&f.delete(t)}),[f,t]);const k=x.useMemo(()=>({role:p,tabIndex:g,"aria-disabled":r,"aria-pressed":b&&p===Kv?!0:void 0,"aria-roledescription":m,"aria-describedby":d.draggable}),[r,p,g,b,m,d.draggable]);return{active:l,activatorEvent:s,activeNodeRect:u,attributes:k,isDragging:b,listeners:r?void 0:A,node:S,over:h,setNodeRef:C,setActivatorNodeRef:y,transform:w}}function Qv(){return x.useContext(Wv)}const xN="Droppable",CN={timeout:25};function wN(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=vo(xN),{active:a,dispatch:s,over:l,measureDroppableContainers:u}=x.useContext(Io),d=x.useRef({disabled:n}),f=x.useRef(!1),h=x.useRef(null),p=x.useRef(null),{disabled:m,updateMeasurementsFor:g,timeout:b}=z(z({},CN),i),w=go(g!=null?g:r),S=x.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(w.current)?w.current:[w.current]),p.current=null},b)},[b]),C=Ts({callback:S,disabled:m||!a}),I=x.useCallback((k,F)=>{C&&(F&&(C.unobserve(F),f.current=!1),k&&C.observe(k))},[C]),[y,A]=ms(I),E=go(t);return x.useEffect(()=>{!C||!y.current||(C.disconnect(),f.current=!1,C.observe(y.current))},[y,C]),x.useEffect(()=>(s({type:mt.RegisterDroppable,element:{id:r,key:o,disabled:n,node:y,rect:h,data:E}}),()=>s({type:mt.UnregisterDroppable,key:o,id:r})),[r]),x.useEffect(()=>{n!==d.current.disabled&&(s({type:mt.SetDroppableDisabled,id:r,key:o,disabled:n}),d.current.disabled=n)},[r,o,n,s]),{active:a,rect:h,isOver:(l==null?void 0:l.id)===r,node:y,over:l,setNodeRef:A}}function IN(e){let{animation:t,children:n}=e;const[r,i]=x.useState(null),[o,a]=x.useState(null),s=vs(n);return!n&&!r&&s&&i(s),ln(()=>{if(!o)return;const l=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(l==null||u==null){i(null);return}Promise.resolve(t(u,o)).then(()=>{i(null)})},[t,r,o]),x.createElement(x.Fragment,null,n,r?x.cloneElement(r,{ref:a}):null)}const SN={x:0,y:0,scaleX:1,scaleY:1};function AN(e){let{children:t}=e;return x.createElement(Io.Provider,{value:Hv},x.createElement(ks.Provider,{value:SN},t))}const TN={position:"fixed",touchAction:"none"},EN=e=>bs(e)?"transform 250ms ease":void 0,kN=x.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:a,rect:s,style:l,transform:u,transition:d=EN}=e;if(!s)return null;const f=i?u:q(z({},u),{scaleX:1,scaleY:1}),h=z(q(z({},TN),{width:s.width,height:s.height,top:s.top,left:s.left,transform:Hn.Transform.toString(f),transformOrigin:i&&r?x$(r,s):void 0,transition:typeof d=="function"?d(r):d}),l);return x.createElement(n,{className:a,style:h,ref:t},o)}),qv=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:o,className:a}=e;if(o!=null&&o.active)for(const[s,l]of Object.entries(o.active))l!==void 0&&(i[s]=n.node.style.getPropertyValue(s),n.node.style.setProperty(s,l));if(o!=null&&o.dragOverlay)for(const[s,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(s,l);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[l,u]of Object.entries(i))n.node.style.setProperty(l,u);a!=null&&a.active&&n.node.classList.remove(a.active)}},_N={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Hn.Transform.toString(t)},{transform:Hn.Transform.toString(n)}]},sideEffects:qv({styles:{active:{opacity:"0"}}})};function PN(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return gs((o,a)=>{if(t===null)return;const s=n.get(o);if(!s)return;const l=s.node.current;if(!l)return;const u=Vv(a);if(!u)return;const{transform:d}=Rt(a).getComputedStyle(a),f=Sv(d);if(!f)return;const h=typeof t=="function"?t:DN(t);return Ov(l,i.draggable.measure),h({active:{id:o,data:s.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:i,transform:f})})}function DN(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}=z(z({},_N),e);return o=>{let S=o,{active:a,dragOverlay:s,transform:l}=S,u=Ge(S,["active","dragOverlay","transform"]);if(!t)return;const d={x:s.rect.left-a.rect.left,y:s.rect.top-a.rect.top},f={scaleX:l.scaleX!==1?a.rect.width*l.scaleX/s.rect.width:1,scaleY:l.scaleY!==1?a.rect.height*l.scaleY/s.rect.height:1},h=z({x:l.x-d.x,y:l.y-d.y},f),p=i(q(z({},u),{active:a,dragOverlay:s,transform:{initial:l,final:h}})),[m]=p,g=p[p.length-1];if(JSON.stringify(m)===JSON.stringify(g))return;const b=r==null?void 0:r(z({active:a,dragOverlay:s},u)),w=s.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(C=>{w.onfinish=()=>{b==null||b(),C()}})}}let Jv=0;function ON(e){return x.useMemo(()=>{if(e!=null)return Jv++,Jv},[e])}const RN=x.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:o,modifiers:a,wrapperElement:s="div",className:l,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:p,draggableNodes:m,droppableContainers:g,dragOverlay:b,over:w,measuringConfiguration:S,scrollableAncestors:C,scrollableAncestorRects:I,windowRect:y}=Qv(),A=x.useContext(ks),E=ON(f==null?void 0:f.id),k=Gv(a,{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:b.rect,over:w,overlayNodeRect:b.rect,scrollableAncestors:C,scrollableAncestorRects:I,transform:A,windowRect:y}),F=Ou(h),Y=PN({config:r,draggableNodes:m,droppableContainers:g,measuringConfiguration:S}),O=F?b.setRef:void 0;return x.createElement(AN,null,x.createElement(IN,{animation:Y},f&&E?x.createElement(kN,{key:E,id:f.id,ref:O,as:s,activatorEvent:d,adjustScale:t,className:l,transition:o,rect:F,style:z({zIndex:u},i),transform:k},n):null))});function _s(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function LN(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function Ps(e){return e!==null&&e>=0}function MN(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function BN(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Xv=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=_s(t,r,n),a=t[i],s=o[i];return!s||!a?null:{x:s.left-a.left,y:s.top-a.top,scaleX:s.width/a.width,scaleY:s.height/a.height}},Zv="Sortable",eb=x.createContext({activeIndex:-1,containerId:Zv,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Xv,disabled:{draggable:!1,droppable:!1}});function tb(e){let{children:t,id:n,items:r,strategy:i=Xv,disabled:o=!1}=e;const{active:a,dragOverlay:s,droppableRects:l,over:u,measureDroppableContainers:d}=Qv(),f=vo(Zv,n),h=s.rect!==null,p=x.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),m=a!=null,g=a?p.indexOf(a.id):-1,b=u?p.indexOf(u.id):-1,w=x.useRef(p),S=!MN(p,w.current),C=b!==-1&&g===-1||S,I=BN(o);ln(()=>{S&&m&&d(p)},[S,p,m,d]),x.useEffect(()=>{w.current=p},[p]);const y=x.useMemo(()=>({activeIndex:g,containerId:f,disabled:I,disableTransforms:C,items:p,overIndex:b,useDragOverlay:h,sortedRects:LN(p,l),strategy:i}),[g,f,I.draggable,I.droppable,C,p,b,l,h,i]);return x.createElement(eb.Provider,{value:y},t)}const $N=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return _s(n,r,i).indexOf(t)},NN=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:a,previousItems:s,previousContainerId:l,transition:u}=e;return!u||!r||s!==o&&i===a?!1:n?!0:a!==i&&t===l},FN={duration:200,easing:"ease"},nb="transform",zN=Hn.Transition.toString({property:nb,duration:0,easing:"linear"}),jN={roleDescription:"sortable"};function UN(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,a]=x.useState(null),s=x.useRef(n);return ln(()=>{if(!t&&n!==s.current&&r.current){const l=i.current;if(l){const u=mi(r.current,{ignoreTransform:!0}),d={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(d.x||d.y)&&a(d)}}n!==s.current&&(s.current=n)},[t,n,r,i]),x.useEffect(()=>{o&&a(null)},[o]),o}function rb(e){let{animateLayoutChanges:t=NN,attributes:n,disabled:r,data:i,getNewIndex:o=$N,id:a,strategy:s,resizeObserverConfig:l,transition:u=FN}=e;const{items:d,containerId:f,activeIndex:h,disabled:p,disableTransforms:m,sortedRects:g,overIndex:b,useDragOverlay:w,strategy:S}=x.useContext(eb),C=VN(r,p),I=d.indexOf(a),y=x.useMemo(()=>z({sortable:{containerId:f,index:I,items:d}},i),[f,i,I,d]),A=x.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:E,node:k,isOver:F,setNodeRef:Y}=wN({id:a,data:y,disabled:C.droppable,resizeObserverConfig:z({updateMeasurementsFor:A},l)}),{active:O,activatorEvent:T,activeNodeRect:N,attributes:V,setNodeRef:j,listeners:$,isDragging:M,over:H,setActivatorNodeRef:Q,transform:te}=yN({id:a,data:y,attributes:z(z({},jN),n),disabled:C.draggable}),R=o$(Y,j),L=!!O,U=L&&!m&&Ps(h)&&Ps(b),W=!w&&M,re=W&&U?te:null,se=s!=null?s:S,ae=U?re!=null?re:se({rects:g,activeNodeRect:N,activeIndex:h,overIndex:b,index:I}):null,X=Ps(h)&&Ps(b)?o({id:a,items:d,activeIndex:h,overIndex:b}):I,le=O==null?void 0:O.id,Z=x.useRef({activeId:le,items:d,newIndex:X,containerId:f}),he=d!==Z.current.items,Se=t({active:O,containerId:f,isDragging:M,isSorting:L,id:a,index:I,items:d,newIndex:Z.current.newIndex,previousItems:Z.current.items,previousContainerId:Z.current.containerId,transition:u,wasDragging:Z.current.activeId!=null}),He=UN({disabled:!Se,index:I,node:k,rect:E});return x.useEffect(()=>{L&&Z.current.newIndex!==X&&(Z.current.newIndex=X),f!==Z.current.containerId&&(Z.current.containerId=f),d!==Z.current.items&&(Z.current.items=d)},[L,X,f,d]),x.useEffect(()=>{if(le===Z.current.activeId)return;if(le!=null&&Z.current.activeId==null){Z.current.activeId=le;return}const ct=setTimeout(()=>{Z.current.activeId=le},50);return()=>clearTimeout(ct)},[le]),{active:O,activeIndex:h,attributes:V,data:y,rect:E,index:I,newIndex:X,items:d,isOver:F,isSorting:L,isDragging:M,listeners:$,node:k,overIndex:b,over:H,setNodeRef:R,setActivatorNodeRef:Q,setDroppableNodeRef:Y,setDraggableNodeRef:j,transform:He!=null?He:ae,transition:wt()};function wt(){if(He||he&&Z.current.newIndex===I)return zN;if(!(W&&!bs(T)||!u)&&(L||Se))return Hn.Transition.toString(q(z({},u),{property:nb}))}}function VN(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function Ds(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const HN=[ke.Down,ke.Right,ke.Up,ke.Left],ib=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:a,scrollableAncestors:s}}=t;if(HN.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];o.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const h=i.get(f.id);if(h)switch(e.code){case ke.Down:r.top<h.top&&l.push(f);break;case ke.Up:r.top>h.top&&l.push(f);break;case ke.Left:r.left>h.left&&l.push(f);break;case ke.Right:r.left<h.left&&l.push(f);break}});const u=I$({active:n,collisionRect:r,droppableRects:i,droppableContainers:l,pointerCoordinates:null});let d=wv(u,"id");if(d===(a==null?void 0:a.id)&&u.length>1&&(d=u[1].id),d!=null){const f=o.get(n.id),h=o.get(d),p=h?i.get(h.id):null,m=h==null?void 0:h.node.current;if(m&&p&&f&&h){const b=ws(m).some((A,E)=>s[E]!==A),w=ob(f,h),S=WN(f,h),C=b||!w?{x:0,y:0}:{x:S?r.width-p.width:0,y:S?r.height-p.height:0},I={x:p.left,y:p.top};return C.x&&C.y?I:bo(I,C)}}}};function ob(e,t){return!Ds(e)||!Ds(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function WN(e,t){return!Ds(e)||!Ds(t)||!ob(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const ab=Ve(c.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator"),Os=x.createContext({attributes:{},listeners:void 0,ref(){}}),GN=()=>{const{attributes:e,listeners:t,ref:n}=x.useContext(Os);return c.jsx(v.Button,q(z(z({sx:{backgroundColor:"transparent",color:"#919eab",width:"10px",":hover":{backgroundColor:"transparent"},":active":{backgroundColor:"transparent"}}},e),t),{ref:n,children:c.jsx(ab,{})}))},sb=({children:e,id:t,tooltipTitle:n,removeItem:r,useDraggable:i=!0,variant:o="plain"})=>{const{attributes:a,isDragging:s,listeners:l,setNodeRef:u,setActivatorNodeRef:d,transform:f,transition:h}=rb({id:t}),p=x.useMemo(()=>({attributes:a,listeners:l,ref:d}),[a,l,d]),m={opacity:s?.6:void 0,transform:Hn.Translate.toString(f),transition:h};return c.jsx(Os.Provider,{value:p,children:c.jsx(v.ListItem,{variant:o,ref:u,style:m,startAction:i?c.jsx(GN,{}):c.jsx(c.Fragment,{}),endAction:i?c.jsx(v.Tooltip,{title:n,children:c.jsx(v.Button,{variant:"outlined",color:"danger",onClick:r,sx:{ml:"auto",p:.5},size:"sm",children:c.jsx(De.Remove,{})})}):c.jsx(c.Fragment,{}),sx:{p:2,borderRadius:"sm"},children:e})})},YN={sideEffects:qv({styles:{active:{opacity:"0.6"}}})},lb=({children:e})=>c.jsx(RN,{dropAnimation:YN,children:e}),KN=({entities:e=[],labels:t,disabled:n,setEntities:r,removeItem:i})=>{const[o,a]=x.useState(null),s=x.useMemo(()=>e.find(u=>u.id===(o==null?void 0:o.id)),[o,e]),l=xv(Cs(Ss),Cs(Is,{coordinateGetter:ib}));return c.jsxs(Yv,{sensors:l,onDragStart:({active:u})=>{a(u)},onDragEnd:({active:u,over:d})=>{if(d&&u.id!==(d==null?void 0:d.id)){const f=e.findIndex(({id:p})=>p===u.id),h=e.findIndex(({id:p})=>p===d.id);r(_s(e,f,h))}a(null)},onDragCancel:()=>{a(null)},children:[c.jsx(tb,{items:e,children:c.jsx(v.List,{sx:{gap:"10px",padding:0},children:e.map(u=>c.jsxs(sb,{id:u.id,variant:"outlined",removeItem:()=>i(u.id),tooltipTitle:t.removeEntity,useDraggable:!n,children:[c.jsx(v.Typography,{ml:n?0:2.5,children:u.title||u.name}),u.type&&c.jsx(v.Chip,{color:fB(u.type),sx:{marginLeft:2,marginRight:4},children:hB(u.type)})]},`sortable-item-${u.id}`))})}),c.jsx(lb,{children:s?c.jsx(c.Fragment,{children:e.map(u=>c.jsx(sb,{id:u.id,useDraggable:!1,removeItem:()=>{},tooltipTitle:t.removeEntity},`sortable-overlay-item-${u.id}`))}):c.jsx(c.Fragment,{})})]})},QN=({labels:e,value:t,options:n,size:r="sm",disabled:i=!1,sx:o={},onChange:a})=>c.jsxs(v.FormControl,{size:r,disabled:i,children:[c.jsx(v.FormLabel,{children:e.itemsPerPage}),c.jsx(v.Select,{value:t,size:r,onChange:a,sx:q(z({},o),{minHeight:"37px"}),children:n.map((s,l)=>c.jsx(v.Option,{value:s,children:s},`items-per-page-${s}-${l}`))})]}),qN=(e,t)=>{const[n,r]=x.useState(null),{sdk:i}=lt(),o=()=>_(this,null,function*(){let s=[];if(!e){r(s);return}try{switch(e){case"top_x":s=(yield i.topX.getGames({limit:50},!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break;case"match_quiz":s=(yield i.matchQuiz.getGames({limit:50},!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break;case"template":s=(yield i.loyalty.getTemplates(void 0,!0)).data.map(w=>({id:w.id,name:w.name,status:w.status,type:e,relationship:"relatedTo"}));break;case"classic_quiz":s=(yield i.miniGames.getClassicQuizzes({limit:50},!1,!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break;case"personality_quiz":s=(yield i.miniGames.getPersonalityQuizzes({limit:50},!1,!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break;case"either_or":s=(yield i.miniGames.getEitherOrs({limit:50},!1,!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break;case"poll":s=(yield i.voting.getPolls({limit:50},!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break;case"bracket":s=(yield i.bracketGame.getGames({limit:50},!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break;case"standing":s=(yield i.standingGame.getGames({limit:50},!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break}}catch(l){console.error(l),r(s),t();return}r(s)});return x.useEffect(()=>(o(),()=>r(null)),[e]),n},JN=({status:e})=>{let t="neutral";switch(e){case"DYNAMIC":t="primary";break;case"CUSTOM":t="success";break;case"OPEN":t="primary";break;case"LIVE":t="primary";break;case"CANCELED":t="warning";break;case"SETTLED":t="success";break;case"INACTIVE":t="danger";break;case"ACTIVE":t="success";break;case"EXPIRED":t="neutral";break}return c.jsx(v.Chip,{color:t,variant:"solid",size:"sm",children:e})},XN=Ve(c.jsx("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond"),ZN=Ve(c.jsx("path",{d:"m21.58 16.09-1.09-7.66C20.21 6.46 18.52 5 16.53 5H7.47C5.48 5 3.79 6.46 3.51 8.43l-1.09 7.66C2.2 17.63 3.39 19 4.94 19c.68 0 1.32-.27 1.8-.75L9 16h6l2.25 2.25c.48.48 1.13.75 1.8.75 1.56 0 2.75-1.37 2.53-2.91M11 11H9v2H8v-2H6v-1h2V8h1v2h2zm4-1c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m2 3c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"}),"SportsEsports"),eF=Ve(c.jsx("path",{d:"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15M14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2"}),"QuestionMark"),tF=Ve(c.jsx("path",{d:"M9.01 14H2v2h7.01v3L13 15l-3.99-4zm5.98-1v-3H22V8h-7.01V5L11 9z"}),"CompareArrows"),nF=Ve(c.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M9 17H7v-7h2zm4 0h-2V7h2zm4 0h-2v-4h2z"}),"Poll"),rF=e=>{switch(e.entityType){case"top_x":return c.jsx(v.Tooltip,{title:"Top X",children:c.jsx(XN,{})});case"match_quiz":return c.jsx(v.Tooltip,{title:"Match Quiz",children:c.jsx(ZN,{})});case"template":return c.jsx(v.Tooltip,{title:"Leaderboard Templates",children:c.jsx(De.EmojiEvents,{})});case"classic_quiz":return c.jsx(v.Tooltip,{title:"Classic Quiz",children:c.jsx(eF,{})});case"either_or":return c.jsx(v.Tooltip,{title:"Either/Or",children:c.jsx(tF,{})});case"poll":return c.jsx(v.Tooltip,{title:"Poll",children:c.jsx(nF,{})});case"bracket":return c.jsx(v.Tooltip,{title:"Custom Bracket Game",children:c.jsx(De.EmojiEvents,{})});case"standing":return c.jsx(v.Tooltip,{title:"Custom Standings Game",children:c.jsx(De.EmojiEvents,{})});default:return null}},iF=({entity:e,deleteLabel:t,onDelete:n})=>c.jsx(c.Fragment,{children:c.jsx(v.Card,{sx:{p:2,mb:2},children:c.jsx(v.CardContent,{children:c.jsxs(v.Box,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",justifyContent:"space-between"},children:[c.jsx(v.Typography,{fontSize:"sm",startDecorator:c.jsx(rF,{entityType:e.type}),children:e.name}),c.jsx(v.Box,{display:{xs:"none",md:"block"},children:c.jsx(JN,{status:e.status})}),c.jsx(v.Box,{children:c.jsx(v.Tooltip,{title:t,children:c.jsx(v.IconButton,{onClick:()=>n(e.id,e.relationship),color:"danger",size:"sm",children:c.jsx(De.Delete,{})})})})]})})})}),oF=(e,t,n,r)=>_(this,null,function*(){let o=[];const a=new Map;t.forEach(s=>{if(a.has(s.entity_type)){const l=a.get(s.entity_type);a.set(s.entity_type,[...l,[s.entity_id,s.entity_relationship]])}else a.set(s.entity_type,[[s.entity_id,s.entity_relationship]])});try{for(const[s,l]of a)switch(s){case"top_x":const u=l.map(([O])=>O),d=yield e.topX.getGames({limit:u.length,gameIds:u},!0);o=[...o,...d.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"match_quiz":const f=l.map(([O])=>O),h=yield e.matchQuiz.getGames({limit:f.length,gameIds:f},!0);o=[...o,...h.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"template":const p=l.map(([O])=>O),m=yield e.loyalty.getTemplates(void 0,!0);o=[...o,...m.data.filter(O=>p.includes(O.id)).map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"classic_quiz":const g=l.map(([O])=>O),b=yield e.miniGames.getClassicQuizzes({limit:g.length,classicQuizIds:g},!1,!0);o=[...o,...b.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"personality_quiz":const w=l.map(([O])=>O),S=yield e.miniGames.getPersonalityQuizzes({limit:w.length,personalityQuizIds:w},!1,!0);o=[...o,...S.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"either_or":const C=l.map(([O])=>O),I=yield e.miniGames.getEitherOrs({limit:C.length,eitherOrIds:C},!1,!0);o=[...o,...I.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"poll":const y=l.map(([O])=>O),A=yield e.voting.getPolls({limit:y.length,pollIds:y},!0);o=[...o,...A.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"bracket":const E=l.map(([O])=>O),k=yield e.bracketGame.getGames({limit:E.length,gameIds:E},!0);o=[...o,...k.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"standing":const F=l.map(([O])=>O),Y=yield e.standingGame.getGames({limit:F.length,gameIds:F},!0);o=[...o,...Y.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;default:}}catch(s){console.error("Error loading related entities",s),n(o),r()}n(o)}),aF=["top_x","match_quiz","template","classic_quiz","personality_quiz","poll","either_or","bracket","standing"],sF=["relatedTo","blocks","blockedBy","bonusPointsGame","nextInSeries","previousInSeries"],lF=new Map().set("template","Leaderboard Templates").set("classic_quiz","Classic Quiz").set("personality_quiz","Personality Quiz").set("either_or","Either/Or").set("match_quiz","Match Quiz").set("top_x","Top X").set("bracket","Custom Bracket Game").set("standing","Custom Standing Game").set("poll","Poll"),cb=new Map().set("relatedTo","Related to").set("blocks","Blocks").set("blockedBy","Blocked by").set("nextInSeries","Next in series").set("previousInSeries","Previous in series").set("bonusPointsGame","Bonus points game"),cF=({defaultValue:e=[],onChange:t,labels:n})=>{const[r,i]=x.useState([]),[o,a]=x.useState(""),[s,l]=x.useState(null),[u,d]=x.useState("relatedTo"),[f,h]=x.useState(!1),p=()=>h(!f),m=qN(s,p),{sdk:g}=lt();x.useEffect(()=>(e.length>0&&oF(g,e,i,p),()=>{i([]),a(""),l(null),d("relatedTo")}),[]);const b=()=>{if(e.some(E=>E.entity_id===o&&E.entity_relationship===u)){a("");return}const y=[...e,{entity_id:o,entity_type:s,entity_relationship:u}],A=(m==null?void 0:m.filter(E=>E.id===o).map(E=>({id:E.id,name:E.name,type:s,status:E.status,relationship:u})))||[];i([...r,...A]),t(y),a("")},w=(I,y)=>{const A=e.filter(k=>!(k.entity_id===I&&k.entity_relationship===y)),E=r.filter(k=>!(k.id===I&&k.relationship===y));i(E),t(A)},S=r.reduce((I,y)=>{const A=y.relationship;return I[A]||(I[A]=[]),I[A].push(y),I},{}),C=Object.keys(S).sort();return c.jsxs(c.Fragment,{children:[C.map(I=>c.jsxs(v.Box,{sx:{mb:2},children:[c.jsx(v.Typography,{level:"title-md",sx:{fontWeight:"bold",mb:1},children:c.jsx(v.Chip,{variant:"outlined",size:"md",sx:{bgcolor:"background.surface"},children:cb.get(I)||"Unknown relationship"})}),S[I].map((y,A)=>c.jsx(iF,{entity:y,deleteLabel:n.delete,onDelete:w},`related-entity-relationship-${y.id}-${A}`))]},`relationship-group-${I}`)),c.jsxs(v.Box,{sx:{display:"flex",flexDirection:"column",width:"100%",gap:1},children:[c.jsxs(v.FormControl,{children:[c.jsx(v.FormLabel,{required:!0,color:"primary",children:n.type}),c.jsx(v.Select,{value:s,size:"sm",name:"entity_type",onChange:(I,y)=>l(y),sx:{minHeight:"37px"},children:aF.map(I=>c.jsx(v.Option,{value:I,children:lF.get(I)},`entity-type-option-${I}`))})]}),c.jsxs(v.FormControl,{children:[c.jsx(v.FormLabel,{required:!0,color:"primary",children:n.relationship}),c.jsx(v.Select,{value:u,size:"sm",name:"entity_relationship",onChange:(I,y)=>d(y),sx:{minHeight:"37px"},children:sF.map(I=>c.jsx(v.Option,{value:I,children:cb.get(I)},`entity-relationship-option-${I}`))})]}),c.jsxs(v.FormControl,{children:[c.jsx(v.FormLabel,{required:!0,color:"primary",children:n.entity}),c.jsx(v.Select,{value:o,size:"sm",name:"entity_id",onChange:(I,y)=>a(y),sx:{width:"100%",mr:{xs:0,md:1},mb:{xs:1,md:0},minHeight:"37px"},endDecorator:!m&&c.jsx(v.CircularProgress,{size:"sm"}),children:m&&m.map(I=>c.jsx(v.Option,{value:I.id,children:I.name},`entity--${I.id}`))})]}),c.jsx(v.Button,{startDecorator:c.jsx(De.Add,{}),disabled:!o||!s,onClick:b,sx:{mb:1},children:n.add})]}),c.jsx(nt,{showToast:f,message:n.relatedEntitiesErrorMessage,color:"danger",hideToast:p})]})},uF=e=>{const[t,n]=x.useState(!1),[r,i]=x.useState(!1),[o,a]=x.useState("success"),[s,l]=x.useState(""),u=x.useContext(ea),d=(h,p)=>{a(h),l(p),i(!0)},f=()=>_(this,null,function*(){n(!0);const h=yield u==null?void 0:u.https.exportLeadsPerEntity(e.entityId);if(h!=null&&h.ok){const p=yield h.blob(),m=URL.createObjectURL(p),g=document.createElement("a");g.href=m,g.download=`${e.entityType}_${e.entityName}_exported_users_leads.csv`,document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(m),n(!1),d("success",e.labels.usersLeadsExportMessage)}else console.error("Failed to export all users leads: ",yield h==null?void 0:h.json()),n(!1),d("danger",e.labels.usersLeadsExportErrorMessage)});return c.jsxs(c.Fragment,{children:[c.jsxs(v.Box,{mb:2,children:[c.jsx(v.Box,{display:"flex",alignItems:"center",mb:1,children:c.jsx(v.Typography,{level:"body-lg",sx:{mx:"auto"},children:e.labels.exportUsersLeads})}),c.jsx(v.Sheet,{sx:{overflowX:"auto",minWidth:"700px"},children:c.jsxs(v.Table,{variant:"outlined",hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{backgroundColor:"#fff","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left",width:"50%"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:e.labels.category}),c.jsx("th",{children:e.labels.action})]})}),c.jsx("tbody",{children:c.jsxs("tr",{children:[c.jsxs("td",{children:[c.jsx(v.Typography,{level:"body-sm",fontWeight:"600",children:e.labels.exportAllUsersLeads}),c.jsx(v.Typography,{level:"body-xs",color:"neutral",children:e.labels.exportAllUsersLeadsDescription})]}),c.jsx("td",{children:c.jsx(v.Button,{loading:t,onClick:f,children:e.labels.exportAllUsersLeads})})]})})]})})]}),c.jsx(nt,{showToast:r,color:o,message:s,hideToast:()=>i(!1)})]})},dF=({tooltipContent:e="Drag to reorder"})=>{const{attributes:t,listeners:n,ref:r}=x.useContext(Os);return c.jsx(v.Tooltip,{title:e,placement:"left",arrow:!0,children:c.jsx(v.IconButton,q(z(z({variant:"plain",color:"neutral",size:"sm",sx:{color:"text.tertiary",my:"auto",mr:1,":hover":{bgcolor:"action.hover"},":active":{bgcolor:"action.selected"},transition:"all 0.2s",cursor:"grab","&:active":{cursor:"grabbing"}}},t),n),{ref:r,children:c.jsx(ab,{})}))})},ub=({id:e,useDraggable:t=!0,variant:n="outlined",item:r,tooltipContent:i})=>{const{attributes:o,isDragging:a,listeners:s,setNodeRef:l,setActivatorNodeRef:u,transform:d,transition:f}=rb({id:e}),h=x.useMemo(()=>({attributes:o,listeners:s,ref:u}),[o,s,u]),p={opacity:a?.6:void 0,transform:Hn.Translate.toString(d),transition:f},m=b=>b.split(" ").map(w=>w[0]).join("").toUpperCase().substring(0,2),g=b=>r!=null&&r.color?r.color:`hsl(${b.split("").reduce((C,I)=>I.charCodeAt(0)+((C<<5)-C),0)%360}, 70%, 80%)`;return c.jsx(Os.Provider,{value:h,children:c.jsx(v.ListItem,{variant:n,ref:l,style:p,endAction:t?c.jsx(dF,{tooltipContent:i}):null,sx:{p:0,borderRadius:"md",overflow:"hidden",transition:"all 0.2s",boxShadow:a?"md":"sm",transform:`scale(${a?1.02:1})`,border:"1px solid",borderColor:"divider"},children:c.jsxs(v.Box,{sx:{display:"flex",width:"100%",alignItems:"center",gap:2,p:0},children:[c.jsx(v.Sheet,{sx:{width:"8px",alignSelf:"stretch",bgcolor:g(r.name)}}),c.jsx(v.Avatar,{src:r.image,alt:r.name,sx:{bgcolor:g(r.name),my:2,ml:1},children:m(r.name)}),c.jsxs(v.Box,{sx:{py:2,pr:2,flexGrow:1,display:"flex",flexDirection:"column",gap:.5},children:[c.jsx(v.Typography,{level:"title-md",children:r.name}),r.description&&c.jsx(v.Typography,{level:"body-sm",sx:{color:"text.secondary",textOverflow:"ellipsis"},children:r.description}),c.jsx(v.Box,{sx:{mt:.5},children:r.type&&c.jsx(v.Chip,{variant:"soft",color:"primary",size:"sm",sx:{px:1,bgcolor:`${g(r.type)}40`},children:r.type})})]})]})})})},fF=({items:e=[],labels:t,setItems:n})=>{const[r,i]=x.useState(null),o=x.useMemo(()=>e.find(s=>s.id===(r==null?void 0:r.id)),[r,e]),a=xv(Cs(Ss,{activationConstraint:{distance:8}}),Cs(Is,{coordinateGetter:ib}));return e.length===0?c.jsx(v.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",border:"1px dashed",borderColor:"divider",borderRadius:"md"},children:c.jsx(v.Typography,{level:"body-lg",color:"neutral",children:(t==null?void 0:t.noItemsToDisplay)||"No items to display"})}):c.jsxs(Yv,{sensors:a,onDragStart:({active:s})=>{i(s)},onDragEnd:({active:s,over:l})=>{if(l&&s.id!==(l==null?void 0:l.id)){const u=e.findIndex(({id:f})=>f===s.id),d=e.findIndex(({id:f})=>f===l.id);n(_s(e,u,d))}i(null)},onDragCancel:()=>{i(null)},children:[c.jsx(tb,{items:e,children:c.jsx(v.List,{sx:{gap:2,maxHeight:"70vh",overflowY:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"action.focus",borderRadius:"4px"}},children:e.map(s=>c.jsx(ub,{id:s.id,variant:"outlined",item:s,tooltipContent:t==null?void 0:t.dragToReorder},`sortable-item-${s.id}`))})}),c.jsx(lb,{children:o?c.jsx(ub,{id:o.id,useDraggable:!1,item:o,tooltipContent:t.dragToReorder},`sortable-overlay-item-${o.id}`):null})]})},hF=({entityType:e,entityId:t,authRequirement:n,labels:r})=>{const[i,o]=x.useState(!1),[a,s]=x.useState(!1),[l,u]=x.useState(""),[d,f]=x.useState(""),[h,p]=x.useState([]),[m,g]=x.useState("before"),[b,w]=x.useState(!1),[S,C]=x.useState(""),[I,y]=x.useState(""),[A,E]=x.useState("STANDARD"),[k,F]=x.useState("left"),[Y,O]=x.useState(!0),T=`
|
|
2475
|
+
`},v$={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function b$(e){let{announcements:t=v$,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=m$}=e;const{announce:o,announcement:a}=h$(),s=vo("DndLiveRegion"),[l,u]=x.useState(!1);if(x.useEffect(()=>{u(!0)},[]),p$(x.useMemo(()=>({onDragStart(f){let{active:h}=f;o(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;t.onDragMove&&o(t.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;o(t.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;o(t.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;o(t.onDragCancel({active:h,over:p}))}}),[o,t])),!l)return null;const d=x.createElement(x.Fragment,null,x.createElement(d$,{id:r,value:i.draggable}),x.createElement(f$,{id:s,announcement:a}));return n?Re.createPortal(d,n):d}var mt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(mt||(mt={}));function xs(){}function Cs(e,t){return x.useMemo(()=>({sensor:e,options:t!=null?t:{}}),[e,t])}function xv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const cn=Object.freeze({x:0,y:0});function y$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function x$(e,t){const n=ys(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function C$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function w$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Cv(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function wv(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}const I$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=Cv(t),o=[];for(const a of r){const{id:s}=a,l=n.get(s);if(l){const u=Cv(l),d=i.reduce((h,p,m)=>h+y$(u[m],p),0),f=Number((d/4).toFixed(4));o.push({id:s,data:{droppableContainer:a,value:f}})}}return o.sort(C$)};function S$(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,s=o-n;if(r<i&&n<o){const l=t.width*t.height,u=e.width*e.height,d=a*s,f=d/(l+u-d);return Number(f.toFixed(4))}return 0}const A$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:a}=o,s=n.get(a);if(s){const l=S$(s,t);l>0&&i.push({id:a,data:{droppableContainer:o,value:l}})}}return i.sort(w$)};function T$(e,t,n){return q(z({},e),{scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1})}function Iv(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:cn}function E$(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((a,s)=>q(z({},a),{top:a.top+e*s.y,bottom:a.bottom+e*s.y,left:a.left+e*s.x,right:a.right+e*s.x}),z({},n))}}const k$=E$(1);function Sv(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function _$(e,t,n){const r=Sv(t);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:s}=r,l=e.left-a-(1-i)*parseFloat(n),u=e.top-s-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),d=i?e.width/i:e.width,f=o?e.height/o:e.height;return{width:d,height:f,top:u,right:l+d,bottom:u+f,left:l}}const P$={ignoreTransform:!1};function mi(e,t){t===void 0&&(t=P$);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=Rt(e).getComputedStyle(e);u&&(n=_$(n,u,d))}const{top:r,left:i,width:o,height:a,bottom:s,right:l}=n;return{top:r,left:i,width:o,height:a,bottom:s,right:l}}function Av(e){return mi(e,{ignoreTransform:!0})}function D$(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function O$(e,t){return t===void 0&&(t=Rt(e).getComputedStyle(e)),t.position==="fixed"}function R$(e,t){t===void 0&&(t=Rt(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function ws(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(wu(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!po(i)||mv(i)||n.includes(i))return n;const o=Rt(e).getComputedStyle(i);return i!==e&&R$(i,o)&&n.push(i),O$(i,o)?n:r(i.parentNode)}return e?r(e):n}function Tv(e){const[t]=ws(e,1);return t!=null?t:null}function Su(e){return!ps||!e?null:hi(e)?e:Cu(e)?wu(e)||e===pi(e).scrollingElement?window:po(e)?e:null:null}function Ev(e){return hi(e)?e.scrollX:e.scrollLeft}function kv(e){return hi(e)?e.scrollY:e.scrollTop}function Au(e){return{x:Ev(e),y:kv(e)}}var xt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(xt||(xt={}));function _v(e){return!ps||!e?!1:e===document.scrollingElement}function Pv(e){const t={x:0,y:0},n=_v(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,s=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:a,isRight:s,maxScroll:r,minScroll:t}}const L$={x:.2,y:.2};function M$(e,t,n,r,i){let{top:o,left:a,right:s,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=L$);const{isTop:u,isBottom:d,isLeft:f,isRight:h}=Pv(e),p={x:0,y:0},m={x:0,y:0},g={height:t.height*i.y,width:t.width*i.x};return!u&&o<=t.top+g.height?(p.y=xt.Backward,m.y=r*Math.abs((t.top+g.height-o)/g.height)):!d&&l>=t.bottom-g.height&&(p.y=xt.Forward,m.y=r*Math.abs((t.bottom-g.height-l)/g.height)),!h&&s>=t.right-g.width?(p.x=xt.Forward,m.x=r*Math.abs((t.right-g.width-s)/g.width)):!f&&a<=t.left+g.width&&(p.x=xt.Backward,m.x=r*Math.abs((t.left+g.width-a)/g.width)),{direction:p,speed:m}}function B$(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Dv(e){return e.reduce((t,n)=>gi(t,Au(n)),cn)}function $$(e){return e.reduce((t,n)=>t+Ev(n),0)}function N$(e){return e.reduce((t,n)=>t+kv(n),0)}function Ov(e,t){if(t===void 0&&(t=mi),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);Tv(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const F$=[["x",["left","right"],$$],["y",["top","bottom"],N$]];class Tu{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=ws(n),i=Dv(r);this.rect=z({},t),this.width=t.width,this.height=t.height;for(const[o,a,s]of F$)for(const l of a)Object.defineProperty(this,l,{get:()=>{const u=s(r),d=i[o]-u;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class yo{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function z$(e){const{EventTarget:t}=Rt(e);return e instanceof t?e:pi(e)}function Eu(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(yi(n,2)+yi(r,2))>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var on;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(on||(on={}));function Rv(e){e.preventDefault()}function j$(e){e.stopPropagation()}var ke;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(ke||(ke={}));const Lv={start:[ke.Space,ke.Enter],cancel:[ke.Esc],end:[ke.Space,ke.Enter,ke.Tab]},U$=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ke.Right:return q(z({},n),{x:n.x+25});case ke.Left:return q(z({},n),{x:n.x-25});case ke.Down:return q(z({},n),{y:n.y+25});case ke.Up:return q(z({},n),{y:n.y-25})}};class Is{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new yo(pi(n)),this.windowListeners=new yo(Rt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(on.Resize,this.handleCancel),this.windowListeners.add(on.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(on.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Ov(r),n(cn)}handleKeyDown(t){if(bs(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=Lv,coordinateGetter:a=U$,scrollBehavior:s="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,d=u?{x:u.left,y:u.top}:cn;this.referenceCoordinates||(this.referenceCoordinates=d);const f=a(t,{active:n,context:r.current,currentCoordinates:d});if(f){const h=bo(f,d),p={x:0,y:0},{scrollableAncestors:m}=r.current;for(const g of m){const b=t.code,{isTop:w,isRight:S,isLeft:C,isBottom:I,maxScroll:y,minScroll:A}=Pv(g),E=B$(g),k={x:Math.min(b===ke.Right?E.right-E.width/2:E.right,Math.max(b===ke.Right?E.left:E.left+E.width/2,f.x)),y:Math.min(b===ke.Down?E.bottom-E.height/2:E.bottom,Math.max(b===ke.Down?E.top:E.top+E.height/2,f.y))},F=b===ke.Right&&!S||b===ke.Left&&!C,Y=b===ke.Down&&!I||b===ke.Up&&!w;if(F&&k.x!==f.x){const O=g.scrollLeft+h.x,T=b===ke.Right&&O<=y.x||b===ke.Left&&O>=A.x;if(T&&!h.y){g.scrollTo({left:O,behavior:s});return}T?p.x=g.scrollLeft-O:p.x=b===ke.Right?g.scrollLeft-y.x:g.scrollLeft-A.x,p.x&&g.scrollBy({left:-p.x,behavior:s});break}else if(Y&&k.y!==f.y){const O=g.scrollTop+h.y,T=b===ke.Down&&O<=y.y||b===ke.Up&&O>=A.y;if(T&&!h.x){g.scrollTo({top:O,behavior:s});return}T?p.y=g.scrollTop-O:p.y=b===ke.Down?g.scrollTop-y.y:g.scrollTop-A.y,p.y&&g.scrollBy({top:-p.y,behavior:s});break}}this.handleMove(t,gi(bo(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Is.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Lv,onActivation:i}=t,{active:o}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const s=o.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function Mv(e){return!!(e&&"distance"in e)}function Bv(e){return!!(e&&"delay"in e)}class ku{constructor(t,n,r){var i;r===void 0&&(r=z$(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:a}=o;this.props=t,this.events=n,this.document=pi(a),this.documentListeners=new yo(this.document),this.listeners=new yo(r),this.windowListeners=new yo(Rt(a)),this.initialCoordinates=(i=ys(o))!=null?i:cn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(on.Resize,this.handleCancel),this.windowListeners.add(on.DragStart,Rv),this.windowListeners.add(on.VisibilityChange,this.handleCancel),this.windowListeners.add(on.ContextMenu,Rv),this.documentListeners.add(on.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Bv(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Mv(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(on.Click,j$,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(on.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:a,options:{activationConstraint:s}}=o;if(!i)return;const l=(n=ys(t))!=null?n:cn,u=bo(i,l);if(!r&&s){if(Mv(s)){if(s.tolerance!=null&&Eu(u,s.tolerance))return this.handleCancel();if(Eu(u,s.distance))return this.handleStart()}if(Bv(s)&&Eu(u,s.tolerance))return this.handleCancel();this.handlePending(s,u);return}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===ke.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const V$={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ss extends ku{constructor(t){const{event:n}=t,r=pi(n.target);super(t,V$,r)}}Ss.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const H$={move:{name:"mousemove"},end:{name:"mouseup"}};var _u;(function(e){e[e.RightClick=2]="RightClick"})(_u||(_u={}));class W$ extends ku{constructor(t){super(t,H$,pi(t.event.target))}}W$.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===_u.RightClick?!1:(r==null||r({event:n}),!0)}}];const Pu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class G$ extends ku{constructor(t){super(t,Pu)}static setup(){return window.addEventListener(Pu.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Pu.move.name,t)};function t(){}}}G$.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var xo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(xo||(xo={}));var As;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(As||(As={}));function Y$(e){let{acceleration:t,activator:n=xo.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:a=5,order:s=As.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:h}=e;const p=Q$({delta:f,disabled:!o}),[m,g]=a$(),b=x.useRef({x:0,y:0}),w=x.useRef({x:0,y:0}),S=x.useMemo(()=>{switch(n){case xo.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case xo.DraggableRect:return i}},[n,i,l]),C=x.useRef(null),I=x.useCallback(()=>{const A=C.current;if(!A)return;const E=b.current.x*w.current.x,k=b.current.y*w.current.y;A.scrollBy(E,k)},[]),y=x.useMemo(()=>s===As.TreeOrder?[...u].reverse():u,[s,u]);x.useEffect(()=>{if(!o||!u.length||!S){g();return}for(const A of y){if((r==null?void 0:r(A))===!1)continue;const E=u.indexOf(A),k=d[E];if(!k)continue;const{direction:F,speed:Y}=M$(A,k,S,t,h);for(const O of["x","y"])p[O][F[O]]||(Y[O]=0,F[O]=0);if(Y.x>0||Y.y>0){g(),C.current=A,m(I,a),b.current=Y,w.current=F;return}}b.current={x:0,y:0},w.current={x:0,y:0},g()},[t,I,r,g,o,a,JSON.stringify(S),JSON.stringify(p),m,u,y,d,JSON.stringify(h)])}const K$={x:{[xt.Backward]:!1,[xt.Forward]:!1},y:{[xt.Backward]:!1,[xt.Forward]:!1}};function Q$(e){let{delta:t,disabled:n}=e;const r=vs(t);return mo(i=>{if(n||!r||!i)return K$;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[xt.Backward]:i.x[xt.Backward]||o.x===-1,[xt.Forward]:i.x[xt.Forward]||o.x===1},y:{[xt.Backward]:i.y[xt.Backward]||o.y===-1,[xt.Forward]:i.y[xt.Forward]||o.y===1}}},[n,t,r])}function q$(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return mo(i=>{var o;return t==null?null:(o=r!=null?r:i)!=null?o:null},[r,t])}function J$(e,t){return x.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...o]},[]),[e,t])}var Co;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Co||(Co={}));var Du;(function(e){e.Optimized="optimized"})(Du||(Du={}));const $v=new Map;function X$(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,a]=x.useState(null),{frequency:s,measure:l,strategy:u}=i,d=x.useRef(e),f=b(),h=go(f),p=x.useCallback(function(w){w===void 0&&(w=[]),!h.current&&a(S=>S===null?w:S.concat(w.filter(C=>!S.includes(C))))},[h]),m=x.useRef(null),g=mo(w=>{if(f&&!n)return $v;if(!w||w===$v||d.current!==e||o!=null){const S=new Map;for(let C of e){if(!C)continue;if(o&&o.length>0&&!o.includes(C.id)&&C.rect.current){S.set(C.id,C.rect.current);continue}const I=C.node.current,y=I?new Tu(l(I),I):null;C.rect.current=y,y&&S.set(C.id,y)}return S}return w},[e,o,n,f,l]);return x.useEffect(()=>{d.current=e},[e]),x.useEffect(()=>{f||p()},[n,f]),x.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),x.useEffect(()=>{f||typeof s!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,f,p,...r]),{droppableRects:g,measureDroppableContainers:p,measuringScheduled:o!=null};function b(){switch(u){case Co.Always:return!1;case Co.BeforeDragging:return n;default:return!n}}}function Ou(e,t){return mo(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Z$(e,t){return Ou(e,t)}function eN(e){let{callback:t,disabled:n}=e;const r=gs(t),i=x.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.MutationObserver=="undefined")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return x.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Ts(e){let{callback:t,disabled:n}=e;const r=gs(t),i=x.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.ResizeObserver=="undefined")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return x.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function tN(e){return new Tu(mi(e),e)}function Nv(e,t,n){t===void 0&&(t=tN);const[r,i]=x.useState(null);function o(){i(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l!=null?l:n)!=null?u:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const a=eN({callback(l){if(e)for(const u of l){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),s=Ts({callback:o});return ln(()=>{o(),e?(s==null||s.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),a==null||a.disconnect())},[e]),r}function nN(e){const t=Ou(e);return Iv(e,t)}const Fv=[];function rN(e){const t=x.useRef(e),n=mo(r=>e?r&&r!==Fv&&e&&t.current&&e.parentNode===t.current.parentNode?r:ws(e):Fv,[e]);return x.useEffect(()=>{t.current=e},[e]),n}function iN(e){const[t,n]=x.useState(null),r=x.useRef(e),i=x.useCallback(o=>{const a=Su(o.target);a&&n(s=>s?(s.set(a,Au(a)),new Map(s)):null)},[]);return x.useEffect(()=>{const o=r.current;if(e!==o){a(o);const s=e.map(l=>{const u=Su(l);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,Au(u)]):null}).filter(l=>l!=null);n(s.length?new Map(s):null),r.current=e}return()=>{a(e),a(o)};function a(s){s.forEach(l=>{const u=Su(l);u==null||u.removeEventListener("scroll",i)})}},[i,e]),x.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>gi(o,a),cn):Dv(e):cn,[e,t])}function zv(e,t){t===void 0&&(t=[]);const n=x.useRef(null);return x.useEffect(()=>{n.current=null},t),x.useEffect(()=>{const r=e!==cn;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?bo(e,n.current):cn}function oN(e){x.useEffect(()=>{if(!ps)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function aN(e,t){return x.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=a=>{o(a,t)},n},{}),[e,t])}function jv(e){return x.useMemo(()=>e?D$(e):null,[e])}const Uv=[];function sN(e,t){t===void 0&&(t=mi);const[n]=e,r=jv(n?Rt(n):null),[i,o]=x.useState(Uv);function a(){o(()=>e.length?e.map(l=>_v(l)?r:new Tu(t(l),l)):Uv)}const s=Ts({callback:a});return ln(()=>{s==null||s.disconnect(),a(),e.forEach(l=>s==null?void 0:s.observe(l))},[e]),i}function Vv(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return po(t)?t:e}function lN(e){let{measure:t}=e;const[n,r]=x.useState(null),i=x.useCallback(u=>{for(const{target:d}of u)if(po(d)){r(f=>{const h=t(d);return f?q(z({},f),{width:h.width,height:h.height}):h});break}},[t]),o=Ts({callback:i}),a=x.useCallback(u=>{const d=Vv(u);o==null||o.disconnect(),d&&(o==null||o.observe(d)),r(d?t(d):null)},[t,o]),[s,l]=ms(a);return x.useMemo(()=>({nodeRef:s,rect:n,setRef:l}),[n,s,l])}const cN=[{sensor:Ss,options:{}},{sensor:Is,options:{}}],uN={current:{}},Es={draggable:{measure:Av},droppable:{measure:Av,strategy:Co.WhileDragging,frequency:Du.Optimized},dragOverlay:{measure:mi}};class wo extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const dN={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new wo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:xs},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Es,measureDroppableContainers:xs,windowRect:null,measuringScheduled:!1},Hv={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:xs,draggableNodes:new Map,over:null,measureDroppableContainers:xs},Io=x.createContext(Hv),Wv=x.createContext(dN);function fN(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new wo}}}function hN(e,t){switch(t.type){case mt.DragStart:return q(z({},e),{draggable:q(z({},e.draggable),{initialCoordinates:t.initialCoordinates,active:t.active})});case mt.DragMove:return e.draggable.active==null?e:q(z({},e),{draggable:q(z({},e.draggable),{translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}})});case mt.DragEnd:case mt.DragCancel:return q(z({},e),{draggable:q(z({},e.draggable),{active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}})});case mt.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new wo(e.droppable.containers);return i.set(r,n),q(z({},e),{droppable:q(z({},e.droppable),{containers:i})})}case mt.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new wo(e.droppable.containers);return a.set(n,q(z({},o),{disabled:i})),q(z({},e),{droppable:q(z({},e.droppable),{containers:a})})}case mt.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new wo(e.droppable.containers);return o.delete(n),q(z({},e),{droppable:q(z({},e.droppable),{containers:o})})}default:return e}}function pN(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=x.useContext(Io),o=vs(r),a=vs(n==null?void 0:n.id);return x.useEffect(()=>{if(!t&&!r&&o&&a!=null){if(!bs(o)||document.activeElement===o.target)return;const s=i.get(a);if(!s)return;const{activatorNode:l,node:u}=s;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[l.current,u.current]){if(!d)continue;const f=c$(d);if(f){f.focus();break}}})}},[r,t,i,a,o]),null}function Gv(e,t){let i=t,{transform:n}=i,r=Ge(i,["transform"]);return e!=null&&e.length?e.reduce((o,a)=>a(z({transform:o},r)),n):n}function gN(e){return x.useMemo(()=>({draggable:z(z({},Es.draggable),e==null?void 0:e.draggable),droppable:z(z({},Es.droppable),e==null?void 0:e.droppable),dragOverlay:z(z({},Es.dragOverlay),e==null?void 0:e.dragOverlay)}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function mN(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=x.useRef(!1),{x:a,y:s}=typeof i=="boolean"?{x:i,y:i}:i;ln(()=>{if(!a&&!s||!t){o.current=!1;return}if(o.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=n(u),f=Iv(d,r);if(a||(f.x=0),s||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=Tv(u);h&&h.scrollBy({top:f.y,left:f.x})}},[t,a,s,r,n])}const ks=x.createContext(q(z({},cn),{scaleX:1,scaleY:1}));var sr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(sr||(sr={}));const Yv=x.memo(function(t){var n,r,i,o;let Ms=t,{id:a,accessibility:s,autoScroll:l=!0,children:u,sensors:d=cN,collisionDetection:f=A$,measuring:h,modifiers:p}=Ms,m=Ge(Ms,["id","accessibility","autoScroll","children","sensors","collisionDetection","measuring","modifiers"]);const g=x.useReducer(hN,void 0,fN),[b,w]=g,[S,C]=g$(),[I,y]=x.useState(sr.Uninitialized),A=I===sr.Initialized,{draggable:{active:E,nodes:k,translate:F},droppable:{containers:Y}}=b,O=E!=null?k.get(E):null,T=x.useRef({initial:null,translated:null}),N=x.useMemo(()=>{var Ct;return E!=null?{id:E,data:(Ct=O==null?void 0:O.data)!=null?Ct:uN,rect:T}:null},[E,O]),V=x.useRef(null),[j,$]=x.useState(null),[M,H]=x.useState(null),Q=go(m,Object.values(m)),te=vo("DndDescribedBy",a),R=x.useMemo(()=>Y.getEnabled(),[Y]),L=gN(h),{droppableRects:U,measureDroppableContainers:W,measuringScheduled:re}=X$(R,{dragging:A,dependencies:[F.x,F.y],config:L.droppable}),se=q$(k,E),ae=x.useMemo(()=>M?ys(M):null,[M]),X=un(),le=Z$(se,L.draggable.measure);mN({activeNode:E!=null?k.get(E):null,config:X.layoutShiftCompensation,initialRect:le,measure:L.draggable.measure});const Z=Nv(se,L.draggable.measure,le),he=Nv(se?se.parentElement:null),Se=x.useRef({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:Y,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),He=Y.getNodeFor((n=Se.current.over)==null?void 0:n.id),wt=lN({measure:L.dragOverlay.measure}),ct=(r=wt.nodeRef.current)!=null?r:se,_t=A?(i=wt.rect)!=null?i:Z:null,de=!!(wt.nodeRef.current&&wt.rect),pe=nN(de?null:Z),xe=jv(ct?Rt(ct):null),Te=rN(A?He!=null?He:se:null),We=sN(Te),Pe=Gv(p,{transform:{x:F.x-pe.x,y:F.y-pe.y,scaleX:1,scaleY:1},activatorEvent:M,active:N,activeNodeRect:Z,containerNodeRect:he,draggingNodeRect:_t,over:Se.current.over,overlayNodeRect:wt.rect,scrollableAncestors:Te,scrollableAncestorRects:We,windowRect:xe}),Ee=ae?gi(ae,F):null,It=iN(Te),St=zv(It),jt=zv(It,[Z]),Lt=gi(Pe,St),Qt=_t?k$(_t,Pe):null,lr=N&&Qt?f({active:N,collisionRect:Qt,droppableRects:U,droppableContainers:R,pointerCoordinates:Ee}):null,Rs=wv(lr,"id"),[In,So]=x.useState(null),Ru=de?Pe:gi(Pe,jt),Lu=T$(Ru,(o=In==null?void 0:In.rect)!=null?o:null,Z),je=x.useRef(null),vi=x.useCallback((Ct,P)=>{let{sensor:B,options:K}=P;if(V.current==null)return;const J=k.get(V.current);if(!J)return;const ie=Ct.nativeEvent,ce=new B({active:V.current,activeNode:J,event:ie,options:K,context:Se,onAbort(ue){if(!k.get(ue))return;const{onDragAbort:fe}=Q.current,me={id:ue};fe==null||fe(me),S({type:"onDragAbort",event:me})},onPending(ue,we,fe,me){if(!k.get(ue))return;const{onDragPending:Pt}=Q.current,it={id:ue,constraint:we,initialCoordinates:fe,offset:me};Pt==null||Pt(it),S({type:"onDragPending",event:it})},onStart(ue){const we=V.current;if(we==null)return;const fe=k.get(we);if(!fe)return;const{onDragStart:me}=Q.current,Oe={activatorEvent:ie,active:{id:we,data:fe.data,rect:T}};Re.unstable_batchedUpdates(()=>{me==null||me(Oe),y(sr.Initializing),w({type:mt.DragStart,initialCoordinates:ue,active:we}),S({type:"onDragStart",event:Oe}),$(je.current),H(ie)})},onMove(ue){w({type:mt.DragMove,coordinates:ue})},onEnd:Ce(mt.DragEnd),onCancel:Ce(mt.DragCancel)});je.current=ce;function Ce(ue){return function(){return _(this,null,function*(){const{active:fe,collisions:me,over:Oe,scrollAdjustedTranslate:Pt}=Se.current;let it=null;if(fe&&Pt){const{cancelDrop:dn}=Q.current;it={activatorEvent:ie,active:fe,collisions:me,delta:Pt,over:Oe},ue===mt.DragEnd&&typeof dn=="function"&&(yield Promise.resolve(dn(it)))&&(ue=mt.DragCancel)}V.current=null,Re.unstable_batchedUpdates(()=>{w({type:ue}),y(sr.Uninitialized),So(null),$(null),H(null),je.current=null;const dn=ue===mt.DragEnd?"onDragEnd":"onDragCancel";if(it){const Sn=Q.current[dn];Sn==null||Sn(it),S({type:dn,event:it})}})})}}},[k]),Ao=x.useCallback((Ct,P)=>(B,K)=>{const J=B.nativeEvent,ie=k.get(K);if(V.current!==null||!ie||J.dndKit||J.defaultPrevented)return;const ce={active:ie};Ct(B,P.options,ce)===!0&&(J.dndKit={capturedBy:P.sensor},V.current=K,vi(B,P))},[k,vi]),Ls=J$(d,Ao);oN(d),ln(()=>{Z&&I===sr.Initializing&&y(sr.Initialized)},[Z,I]),x.useEffect(()=>{const{onDragMove:Ct}=Q.current,{active:P,activatorEvent:B,collisions:K,over:J}=Se.current;if(!P||!B)return;const ie={active:P,activatorEvent:B,collisions:K,delta:{x:Lt.x,y:Lt.y},over:J};Re.unstable_batchedUpdates(()=>{Ct==null||Ct(ie),S({type:"onDragMove",event:ie})})},[Lt.x,Lt.y]),x.useEffect(()=>{const{active:Ct,activatorEvent:P,collisions:B,droppableContainers:K,scrollAdjustedTranslate:J}=Se.current;if(!Ct||V.current==null||!P||!J)return;const{onDragOver:ie}=Q.current,ce=K.get(Rs),Ce=ce&&ce.rect.current?{id:ce.id,rect:ce.rect.current,data:ce.data,disabled:ce.disabled}:null,ue={active:Ct,activatorEvent:P,collisions:B,delta:{x:J.x,y:J.y},over:Ce};Re.unstable_batchedUpdates(()=>{So(Ce),ie==null||ie(ue),S({type:"onDragOver",event:ue})})},[Rs]),ln(()=>{Se.current={activatorEvent:M,active:N,activeNode:se,collisionRect:Qt,collisions:lr,droppableRects:U,draggableNodes:k,draggingNode:ct,draggingNodeRect:_t,droppableContainers:Y,over:In,scrollableAncestors:Te,scrollAdjustedTranslate:Lt},T.current={initial:_t,translated:Qt}},[N,se,lr,Qt,k,ct,_t,U,Y,In,Te,Lt]),Y$(q(z({},X),{delta:F,draggingRect:Qt,pointerCoordinates:Ee,scrollableAncestors:Te,scrollableAncestorRects:We}));const bi=x.useMemo(()=>({active:N,activeNode:se,activeNodeRect:Z,activatorEvent:M,collisions:lr,containerNodeRect:he,dragOverlay:wt,draggableNodes:k,droppableContainers:Y,droppableRects:U,over:In,measureDroppableContainers:W,scrollableAncestors:Te,scrollableAncestorRects:We,measuringConfiguration:L,measuringScheduled:re,windowRect:xe}),[N,se,Z,M,lr,he,wt,k,Y,U,In,W,Te,We,L,re,xe]),To=x.useMemo(()=>({activatorEvent:M,activators:Ls,active:N,activeNodeRect:Z,ariaDescribedById:{draggable:te},dispatch:w,draggableNodes:k,over:In,measureDroppableContainers:W}),[M,Ls,N,Z,w,te,k,In,W]);return x.createElement(yv.Provider,{value:C},x.createElement(Io.Provider,{value:To},x.createElement(Wv.Provider,{value:bi},x.createElement(ks.Provider,{value:Lu},u)),x.createElement(pN,{disabled:(s==null?void 0:s.restoreFocus)===!1})),x.createElement(b$,q(z({},s),{hiddenTextDescribedById:te})));function un(){const Ct=(j==null?void 0:j.autoScrollEnabled)===!1,P=typeof l=="object"?l.enabled===!1:l===!1,B=A&&!Ct&&!P;return typeof l=="object"?q(z({},l),{enabled:B}):{enabled:B}}}),vN=x.createContext(null),Kv="button",bN="Draggable";function yN(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=vo(bN),{activators:a,activatorEvent:s,active:l,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:h}=x.useContext(Io),{role:p=Kv,roleDescription:m="draggable",tabIndex:g=0}=i!=null?i:{},b=(l==null?void 0:l.id)===t,w=x.useContext(b?ks:vN),[S,C]=ms(),[I,y]=ms(),A=aN(a,t),E=go(n);ln(()=>(f.set(t,{id:t,key:o,node:S,activatorNode:I,data:E}),()=>{const F=f.get(t);F&&F.key===o&&f.delete(t)}),[f,t]);const k=x.useMemo(()=>({role:p,tabIndex:g,"aria-disabled":r,"aria-pressed":b&&p===Kv?!0:void 0,"aria-roledescription":m,"aria-describedby":d.draggable}),[r,p,g,b,m,d.draggable]);return{active:l,activatorEvent:s,activeNodeRect:u,attributes:k,isDragging:b,listeners:r?void 0:A,node:S,over:h,setNodeRef:C,setActivatorNodeRef:y,transform:w}}function Qv(){return x.useContext(Wv)}const xN="Droppable",CN={timeout:25};function wN(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=vo(xN),{active:a,dispatch:s,over:l,measureDroppableContainers:u}=x.useContext(Io),d=x.useRef({disabled:n}),f=x.useRef(!1),h=x.useRef(null),p=x.useRef(null),{disabled:m,updateMeasurementsFor:g,timeout:b}=z(z({},CN),i),w=go(g!=null?g:r),S=x.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(w.current)?w.current:[w.current]),p.current=null},b)},[b]),C=Ts({callback:S,disabled:m||!a}),I=x.useCallback((k,F)=>{C&&(F&&(C.unobserve(F),f.current=!1),k&&C.observe(k))},[C]),[y,A]=ms(I),E=go(t);return x.useEffect(()=>{!C||!y.current||(C.disconnect(),f.current=!1,C.observe(y.current))},[y,C]),x.useEffect(()=>(s({type:mt.RegisterDroppable,element:{id:r,key:o,disabled:n,node:y,rect:h,data:E}}),()=>s({type:mt.UnregisterDroppable,key:o,id:r})),[r]),x.useEffect(()=>{n!==d.current.disabled&&(s({type:mt.SetDroppableDisabled,id:r,key:o,disabled:n}),d.current.disabled=n)},[r,o,n,s]),{active:a,rect:h,isOver:(l==null?void 0:l.id)===r,node:y,over:l,setNodeRef:A}}function IN(e){let{animation:t,children:n}=e;const[r,i]=x.useState(null),[o,a]=x.useState(null),s=vs(n);return!n&&!r&&s&&i(s),ln(()=>{if(!o)return;const l=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(l==null||u==null){i(null);return}Promise.resolve(t(u,o)).then(()=>{i(null)})},[t,r,o]),x.createElement(x.Fragment,null,n,r?x.cloneElement(r,{ref:a}):null)}const SN={x:0,y:0,scaleX:1,scaleY:1};function AN(e){let{children:t}=e;return x.createElement(Io.Provider,{value:Hv},x.createElement(ks.Provider,{value:SN},t))}const TN={position:"fixed",touchAction:"none"},EN=e=>bs(e)?"transform 250ms ease":void 0,kN=x.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:a,rect:s,style:l,transform:u,transition:d=EN}=e;if(!s)return null;const f=i?u:q(z({},u),{scaleX:1,scaleY:1}),h=z(q(z({},TN),{width:s.width,height:s.height,top:s.top,left:s.left,transform:Hn.Transform.toString(f),transformOrigin:i&&r?x$(r,s):void 0,transition:typeof d=="function"?d(r):d}),l);return x.createElement(n,{className:a,style:h,ref:t},o)}),qv=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:o,className:a}=e;if(o!=null&&o.active)for(const[s,l]of Object.entries(o.active))l!==void 0&&(i[s]=n.node.style.getPropertyValue(s),n.node.style.setProperty(s,l));if(o!=null&&o.dragOverlay)for(const[s,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(s,l);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[l,u]of Object.entries(i))n.node.style.setProperty(l,u);a!=null&&a.active&&n.node.classList.remove(a.active)}},_N={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Hn.Transform.toString(t)},{transform:Hn.Transform.toString(n)}]},sideEffects:qv({styles:{active:{opacity:"0"}}})};function PN(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return gs((o,a)=>{if(t===null)return;const s=n.get(o);if(!s)return;const l=s.node.current;if(!l)return;const u=Vv(a);if(!u)return;const{transform:d}=Rt(a).getComputedStyle(a),f=Sv(d);if(!f)return;const h=typeof t=="function"?t:DN(t);return Ov(l,i.draggable.measure),h({active:{id:o,data:s.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:i,transform:f})})}function DN(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}=z(z({},_N),e);return o=>{let S=o,{active:a,dragOverlay:s,transform:l}=S,u=Ge(S,["active","dragOverlay","transform"]);if(!t)return;const d={x:s.rect.left-a.rect.left,y:s.rect.top-a.rect.top},f={scaleX:l.scaleX!==1?a.rect.width*l.scaleX/s.rect.width:1,scaleY:l.scaleY!==1?a.rect.height*l.scaleY/s.rect.height:1},h=z({x:l.x-d.x,y:l.y-d.y},f),p=i(q(z({},u),{active:a,dragOverlay:s,transform:{initial:l,final:h}})),[m]=p,g=p[p.length-1];if(JSON.stringify(m)===JSON.stringify(g))return;const b=r==null?void 0:r(z({active:a,dragOverlay:s},u)),w=s.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(C=>{w.onfinish=()=>{b==null||b(),C()}})}}let Jv=0;function ON(e){return x.useMemo(()=>{if(e!=null)return Jv++,Jv},[e])}const RN=x.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:o,modifiers:a,wrapperElement:s="div",className:l,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:p,draggableNodes:m,droppableContainers:g,dragOverlay:b,over:w,measuringConfiguration:S,scrollableAncestors:C,scrollableAncestorRects:I,windowRect:y}=Qv(),A=x.useContext(ks),E=ON(f==null?void 0:f.id),k=Gv(a,{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:b.rect,over:w,overlayNodeRect:b.rect,scrollableAncestors:C,scrollableAncestorRects:I,transform:A,windowRect:y}),F=Ou(h),Y=PN({config:r,draggableNodes:m,droppableContainers:g,measuringConfiguration:S}),O=F?b.setRef:void 0;return x.createElement(AN,null,x.createElement(IN,{animation:Y},f&&E?x.createElement(kN,{key:E,id:f.id,ref:O,as:s,activatorEvent:d,adjustScale:t,className:l,transition:o,rect:F,style:z({zIndex:u},i),transform:k},n):null))});function _s(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function LN(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function Ps(e){return e!==null&&e>=0}function MN(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function BN(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Xv=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=_s(t,r,n),a=t[i],s=o[i];return!s||!a?null:{x:s.left-a.left,y:s.top-a.top,scaleX:s.width/a.width,scaleY:s.height/a.height}},Zv="Sortable",eb=x.createContext({activeIndex:-1,containerId:Zv,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Xv,disabled:{draggable:!1,droppable:!1}});function tb(e){let{children:t,id:n,items:r,strategy:i=Xv,disabled:o=!1}=e;const{active:a,dragOverlay:s,droppableRects:l,over:u,measureDroppableContainers:d}=Qv(),f=vo(Zv,n),h=s.rect!==null,p=x.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),m=a!=null,g=a?p.indexOf(a.id):-1,b=u?p.indexOf(u.id):-1,w=x.useRef(p),S=!MN(p,w.current),C=b!==-1&&g===-1||S,I=BN(o);ln(()=>{S&&m&&d(p)},[S,p,m,d]),x.useEffect(()=>{w.current=p},[p]);const y=x.useMemo(()=>({activeIndex:g,containerId:f,disabled:I,disableTransforms:C,items:p,overIndex:b,useDragOverlay:h,sortedRects:LN(p,l),strategy:i}),[g,f,I.draggable,I.droppable,C,p,b,l,h,i]);return x.createElement(eb.Provider,{value:y},t)}const $N=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return _s(n,r,i).indexOf(t)},NN=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:a,previousItems:s,previousContainerId:l,transition:u}=e;return!u||!r||s!==o&&i===a?!1:n?!0:a!==i&&t===l},FN={duration:200,easing:"ease"},nb="transform",zN=Hn.Transition.toString({property:nb,duration:0,easing:"linear"}),jN={roleDescription:"sortable"};function UN(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,a]=x.useState(null),s=x.useRef(n);return ln(()=>{if(!t&&n!==s.current&&r.current){const l=i.current;if(l){const u=mi(r.current,{ignoreTransform:!0}),d={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(d.x||d.y)&&a(d)}}n!==s.current&&(s.current=n)},[t,n,r,i]),x.useEffect(()=>{o&&a(null)},[o]),o}function rb(e){let{animateLayoutChanges:t=NN,attributes:n,disabled:r,data:i,getNewIndex:o=$N,id:a,strategy:s,resizeObserverConfig:l,transition:u=FN}=e;const{items:d,containerId:f,activeIndex:h,disabled:p,disableTransforms:m,sortedRects:g,overIndex:b,useDragOverlay:w,strategy:S}=x.useContext(eb),C=VN(r,p),I=d.indexOf(a),y=x.useMemo(()=>z({sortable:{containerId:f,index:I,items:d}},i),[f,i,I,d]),A=x.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:E,node:k,isOver:F,setNodeRef:Y}=wN({id:a,data:y,disabled:C.droppable,resizeObserverConfig:z({updateMeasurementsFor:A},l)}),{active:O,activatorEvent:T,activeNodeRect:N,attributes:V,setNodeRef:j,listeners:$,isDragging:M,over:H,setActivatorNodeRef:Q,transform:te}=yN({id:a,data:y,attributes:z(z({},jN),n),disabled:C.draggable}),R=o$(Y,j),L=!!O,U=L&&!m&&Ps(h)&&Ps(b),W=!w&&M,re=W&&U?te:null,se=s!=null?s:S,ae=U?re!=null?re:se({rects:g,activeNodeRect:N,activeIndex:h,overIndex:b,index:I}):null,X=Ps(h)&&Ps(b)?o({id:a,items:d,activeIndex:h,overIndex:b}):I,le=O==null?void 0:O.id,Z=x.useRef({activeId:le,items:d,newIndex:X,containerId:f}),he=d!==Z.current.items,Se=t({active:O,containerId:f,isDragging:M,isSorting:L,id:a,index:I,items:d,newIndex:Z.current.newIndex,previousItems:Z.current.items,previousContainerId:Z.current.containerId,transition:u,wasDragging:Z.current.activeId!=null}),He=UN({disabled:!Se,index:I,node:k,rect:E});return x.useEffect(()=>{L&&Z.current.newIndex!==X&&(Z.current.newIndex=X),f!==Z.current.containerId&&(Z.current.containerId=f),d!==Z.current.items&&(Z.current.items=d)},[L,X,f,d]),x.useEffect(()=>{if(le===Z.current.activeId)return;if(le!=null&&Z.current.activeId==null){Z.current.activeId=le;return}const ct=setTimeout(()=>{Z.current.activeId=le},50);return()=>clearTimeout(ct)},[le]),{active:O,activeIndex:h,attributes:V,data:y,rect:E,index:I,newIndex:X,items:d,isOver:F,isSorting:L,isDragging:M,listeners:$,node:k,overIndex:b,over:H,setNodeRef:R,setActivatorNodeRef:Q,setDroppableNodeRef:Y,setDraggableNodeRef:j,transform:He!=null?He:ae,transition:wt()};function wt(){if(He||he&&Z.current.newIndex===I)return zN;if(!(W&&!bs(T)||!u)&&(L||Se))return Hn.Transition.toString(q(z({},u),{property:nb}))}}function VN(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function Ds(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const HN=[ke.Down,ke.Right,ke.Up,ke.Left],ib=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:a,scrollableAncestors:s}}=t;if(HN.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];o.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const h=i.get(f.id);if(h)switch(e.code){case ke.Down:r.top<h.top&&l.push(f);break;case ke.Up:r.top>h.top&&l.push(f);break;case ke.Left:r.left>h.left&&l.push(f);break;case ke.Right:r.left<h.left&&l.push(f);break}});const u=I$({active:n,collisionRect:r,droppableRects:i,droppableContainers:l,pointerCoordinates:null});let d=wv(u,"id");if(d===(a==null?void 0:a.id)&&u.length>1&&(d=u[1].id),d!=null){const f=o.get(n.id),h=o.get(d),p=h?i.get(h.id):null,m=h==null?void 0:h.node.current;if(m&&p&&f&&h){const b=ws(m).some((A,E)=>s[E]!==A),w=ob(f,h),S=WN(f,h),C=b||!w?{x:0,y:0}:{x:S?r.width-p.width:0,y:S?r.height-p.height:0},I={x:p.left,y:p.top};return C.x&&C.y?I:bo(I,C)}}}};function ob(e,t){return!Ds(e)||!Ds(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function WN(e,t){return!Ds(e)||!Ds(t)||!ob(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const ab=Ve(c.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator"),Os=x.createContext({attributes:{},listeners:void 0,ref(){}}),GN=()=>{const{attributes:e,listeners:t,ref:n}=x.useContext(Os);return c.jsx(v.Button,q(z(z({sx:{backgroundColor:"transparent",color:"#919eab",width:"10px",":hover":{backgroundColor:"transparent"},":active":{backgroundColor:"transparent"}}},e),t),{ref:n,children:c.jsx(ab,{})}))},sb=({children:e,id:t,tooltipTitle:n,removeItem:r,useDraggable:i=!0,variant:o="plain"})=>{const{attributes:a,isDragging:s,listeners:l,setNodeRef:u,setActivatorNodeRef:d,transform:f,transition:h}=rb({id:t}),p=x.useMemo(()=>({attributes:a,listeners:l,ref:d}),[a,l,d]),m={opacity:s?.6:void 0,transform:Hn.Translate.toString(f),transition:h};return c.jsx(Os.Provider,{value:p,children:c.jsx(v.ListItem,{variant:o,ref:u,style:m,startAction:i?c.jsx(GN,{}):c.jsx(c.Fragment,{}),endAction:i?c.jsx(v.Tooltip,{title:n,children:c.jsx(v.Button,{variant:"outlined",color:"danger",onClick:r,sx:{ml:"auto",p:.5},size:"sm",children:c.jsx(De.Remove,{})})}):c.jsx(c.Fragment,{}),sx:{p:2,borderRadius:"sm"},children:e})})},YN={sideEffects:qv({styles:{active:{opacity:"0.6"}}})},lb=({children:e})=>c.jsx(RN,{dropAnimation:YN,children:e}),KN=({entities:e=[],labels:t,disabled:n,setEntities:r,removeItem:i})=>{const[o,a]=x.useState(null),s=x.useMemo(()=>e.find(u=>u.id===(o==null?void 0:o.id)),[o,e]),l=xv(Cs(Ss),Cs(Is,{coordinateGetter:ib}));return c.jsxs(Yv,{sensors:l,onDragStart:({active:u})=>{a(u)},onDragEnd:({active:u,over:d})=>{if(d&&u.id!==(d==null?void 0:d.id)){const f=e.findIndex(({id:p})=>p===u.id),h=e.findIndex(({id:p})=>p===d.id);r(_s(e,f,h))}a(null)},onDragCancel:()=>{a(null)},children:[c.jsx(tb,{items:e,children:c.jsx(v.List,{sx:{gap:"10px",padding:0},children:e.map(u=>c.jsxs(sb,{id:u.id,variant:"outlined",removeItem:()=>i(u.id),tooltipTitle:t.removeEntity,useDraggable:!n,children:[c.jsx(v.Typography,{ml:n?0:2.5,children:u.title||u.name}),u.type&&c.jsx(v.Chip,{color:fB(u.type),sx:{marginLeft:2,marginRight:4},children:hB(u.type)})]},`sortable-item-${u.id}`))})}),c.jsx(lb,{children:s?c.jsx(c.Fragment,{children:e.map(u=>c.jsx(sb,{id:u.id,useDraggable:!1,removeItem:()=>{},tooltipTitle:t.removeEntity},`sortable-overlay-item-${u.id}`))}):c.jsx(c.Fragment,{})})]})},QN=({labels:e,value:t,options:n,size:r="sm",disabled:i=!1,sx:o={},onChange:a})=>c.jsxs(v.FormControl,{size:r,disabled:i,children:[c.jsx(v.FormLabel,{children:e.itemsPerPage}),c.jsx(v.Select,{value:t,size:r,onChange:a,sx:q(z({},o),{minHeight:"37px"}),children:n.map((s,l)=>c.jsx(v.Option,{value:s,children:s},`items-per-page-${s}-${l}`))})]}),qN=(e,t)=>{const[n,r]=x.useState(null),{sdk:i}=lt(),o=()=>_(this,null,function*(){let s=[];if(!e){r(s);return}try{switch(e){case"top_x":s=(yield i.topX.getGames({limit:50},!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break;case"match_quiz":s=(yield i.matchQuiz.getGames({limit:50},!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break;case"template":s=(yield i.loyalty.getTemplates(void 0,!0)).data.map(w=>({id:w.id,name:w.name,status:w.status,type:e,relationship:"relatedTo"}));break;case"classic_quiz":s=(yield i.miniGames.getClassicQuizzes({limit:50},!1,!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break;case"personality_quiz":s=(yield i.miniGames.getPersonalityQuizzes({limit:50},!1,!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break;case"either_or":s=(yield i.miniGames.getEitherOrs({limit:50},!1,!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break;case"poll":s=(yield i.voting.getPolls({limit:50},!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break;case"bracket":s=(yield i.bracketGame.getGames({limit:50},!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break;case"standing":s=(yield i.standingGame.getGames({limit:50},!0)).data.map(w=>({id:w.id,name:w.title,status:w.status,type:e,relationship:"relatedTo"}));break}}catch(l){console.error(l),r(s),t();return}r(s)});return x.useEffect(()=>(o(),()=>r(null)),[e]),n},JN=({status:e})=>{let t="neutral";switch(e){case"DYNAMIC":t="primary";break;case"CUSTOM":t="success";break;case"OPEN":t="primary";break;case"LIVE":t="primary";break;case"CANCELED":t="warning";break;case"SETTLED":t="success";break;case"INACTIVE":t="danger";break;case"ACTIVE":t="success";break;case"EXPIRED":t="neutral";break}return c.jsx(v.Chip,{color:t,variant:"solid",size:"sm",children:e})},XN=Ve(c.jsx("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond"),ZN=Ve(c.jsx("path",{d:"m21.58 16.09-1.09-7.66C20.21 6.46 18.52 5 16.53 5H7.47C5.48 5 3.79 6.46 3.51 8.43l-1.09 7.66C2.2 17.63 3.39 19 4.94 19c.68 0 1.32-.27 1.8-.75L9 16h6l2.25 2.25c.48.48 1.13.75 1.8.75 1.56 0 2.75-1.37 2.53-2.91M11 11H9v2H8v-2H6v-1h2V8h1v2h2zm4-1c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m2 3c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"}),"SportsEsports"),eF=Ve(c.jsx("path",{d:"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15M14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2"}),"QuestionMark"),tF=Ve(c.jsx("path",{d:"M9.01 14H2v2h7.01v3L13 15l-3.99-4zm5.98-1v-3H22V8h-7.01V5L11 9z"}),"CompareArrows"),nF=Ve(c.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M9 17H7v-7h2zm4 0h-2V7h2zm4 0h-2v-4h2z"}),"Poll"),rF=e=>{switch(e.entityType){case"top_x":return c.jsx(v.Tooltip,{title:"Top X",children:c.jsx(XN,{})});case"match_quiz":return c.jsx(v.Tooltip,{title:"Match Quiz",children:c.jsx(ZN,{})});case"template":return c.jsx(v.Tooltip,{title:"Leaderboard Templates",children:c.jsx(De.EmojiEvents,{})});case"classic_quiz":return c.jsx(v.Tooltip,{title:"Classic Quiz",children:c.jsx(eF,{})});case"either_or":return c.jsx(v.Tooltip,{title:"Either/Or",children:c.jsx(tF,{})});case"poll":return c.jsx(v.Tooltip,{title:"Poll",children:c.jsx(nF,{})});case"bracket":return c.jsx(v.Tooltip,{title:"Custom Bracket Game",children:c.jsx(De.EmojiEvents,{})});case"standing":return c.jsx(v.Tooltip,{title:"Custom Standings Game",children:c.jsx(De.EmojiEvents,{})});default:return null}},iF=({entity:e,deleteLabel:t,onDelete:n})=>c.jsx(c.Fragment,{children:c.jsx(v.Card,{sx:{p:2,mb:2},children:c.jsx(v.CardContent,{children:c.jsxs(v.Box,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",justifyContent:"space-between"},children:[c.jsx(v.Typography,{fontSize:"sm",startDecorator:c.jsx(rF,{entityType:e.type}),children:e.name}),c.jsx(v.Box,{display:{xs:"none",md:"block"},children:c.jsx(JN,{status:e.status})}),c.jsx(v.Box,{children:c.jsx(v.Tooltip,{title:t,children:c.jsx(v.IconButton,{onClick:()=>n(e.id,e.relationship),color:"danger",size:"sm",children:c.jsx(De.Delete,{})})})})]})})})}),oF=(e,t,n,r)=>_(this,null,function*(){let o=[];const a=new Map;t.forEach(s=>{if(a.has(s.entity_type)){const l=a.get(s.entity_type);a.set(s.entity_type,[...l,[s.entity_id,s.entity_relationship]])}else a.set(s.entity_type,[[s.entity_id,s.entity_relationship]])});try{for(const[s,l]of a)switch(s){case"top_x":const u=l.map(([O])=>O),d=yield e.topX.getGames({limit:u.length,gameIds:u},!0);o=[...o,...d.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"match_quiz":const f=l.map(([O])=>O),h=yield e.matchQuiz.getGames({limit:f.length,gameIds:f},!0);o=[...o,...h.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"template":const p=l.map(([O])=>O),m=yield e.loyalty.getTemplates(void 0,!0);o=[...o,...m.data.filter(O=>p.includes(O.id)).map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"classic_quiz":const g=l.map(([O])=>O),b=yield e.miniGames.getClassicQuizzes({limit:g.length,classicQuizIds:g},!1,!0);o=[...o,...b.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"personality_quiz":const w=l.map(([O])=>O),S=yield e.miniGames.getPersonalityQuizzes({limit:w.length,personalityQuizIds:w},!1,!0);o=[...o,...S.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"either_or":const C=l.map(([O])=>O),I=yield e.miniGames.getEitherOrs({limit:C.length,eitherOrIds:C},!1,!0);o=[...o,...I.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"poll":const y=l.map(([O])=>O),A=yield e.voting.getPolls({limit:y.length,pollIds:y},!0);o=[...o,...A.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"bracket":const E=l.map(([O])=>O),k=yield e.bracketGame.getGames({limit:E.length,gameIds:E},!0);o=[...o,...k.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;case"standing":const F=l.map(([O])=>O),Y=yield e.standingGame.getGames({limit:F.length,gameIds:F},!0);o=[...o,...Y.data.map(O=>{var N;const T=((N=l.find(([V])=>V===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:s,relationship:T}})];break;default:}}catch(s){console.error("Error loading related entities",s),n(o),r()}n(o)}),aF=["top_x","match_quiz","template","classic_quiz","personality_quiz","poll","either_or","bracket","standing"],sF=["relatedTo","blocks","blockedBy","bonusPointsGame","nextInSeries","previousInSeries"],lF=new Map().set("template","Leaderboard Templates").set("classic_quiz","Classic Quiz").set("personality_quiz","Personality Quiz").set("either_or","Either/Or").set("match_quiz","Match Quiz").set("top_x","Top X").set("bracket","Custom Bracket Game").set("standing","Custom Standing Game").set("poll","Poll"),cb=new Map().set("relatedTo","Related to").set("blocks","Blocks").set("blockedBy","Blocked by").set("nextInSeries","Next in series").set("previousInSeries","Previous in series").set("bonusPointsGame","Bonus points game"),cF=({defaultValue:e=[],onChange:t,labels:n})=>{const[r,i]=x.useState([]),[o,a]=x.useState(""),[s,l]=x.useState(null),[u,d]=x.useState("relatedTo"),[f,h]=x.useState(!1),p=()=>h(!f),m=qN(s,p),{sdk:g}=lt();x.useEffect(()=>(e.length>0&&oF(g,e,i,p),()=>{i([]),a(""),l(null),d("relatedTo")}),[]);const b=()=>{if(e.some(E=>E.entity_id===o&&E.entity_relationship===u)){a("");return}const y=[...e,{entity_id:o,entity_type:s,entity_relationship:u}],A=(m==null?void 0:m.filter(E=>E.id===o).map(E=>({id:E.id,name:E.name,type:s,status:E.status,relationship:u})))||[];i([...r,...A]),t(y),a("")},w=(I,y)=>{const A=e.filter(k=>!(k.entity_id===I&&k.entity_relationship===y)),E=r.filter(k=>!(k.id===I&&k.relationship===y));i(E),t(A)},S=r.reduce((I,y)=>{const A=y.relationship;return I[A]||(I[A]=[]),I[A].push(y),I},{}),C=Object.keys(S).sort();return c.jsxs(c.Fragment,{children:[C.map(I=>c.jsxs(v.Box,{sx:{mb:2},children:[c.jsx(v.Typography,{level:"title-md",sx:{fontWeight:"bold",mb:1},children:c.jsx(v.Chip,{variant:"outlined",size:"md",sx:{bgcolor:"background.surface"},children:cb.get(I)||"Unknown relationship"})}),S[I].map((y,A)=>c.jsx(iF,{entity:y,deleteLabel:n.delete,onDelete:w},`related-entity-relationship-${y.id}-${A}`))]},`relationship-group-${I}`)),c.jsxs(v.Box,{sx:{display:"flex",flexDirection:"column",width:"100%",gap:1},children:[c.jsxs(v.FormControl,{children:[c.jsx(v.FormLabel,{required:!0,color:"primary",children:n.type}),c.jsx(v.Select,{value:s,size:"sm",name:"entity_type",onChange:(I,y)=>l(y),sx:{minHeight:"37px"},children:aF.map(I=>c.jsx(v.Option,{value:I,children:lF.get(I)},`entity-type-option-${I}`))})]}),c.jsxs(v.FormControl,{children:[c.jsx(v.FormLabel,{required:!0,color:"primary",children:n.relationship}),c.jsx(v.Select,{value:u,size:"sm",name:"entity_relationship",onChange:(I,y)=>d(y),sx:{minHeight:"37px"},children:sF.map(I=>c.jsx(v.Option,{value:I,children:cb.get(I)},`entity-relationship-option-${I}`))})]}),c.jsxs(v.FormControl,{children:[c.jsx(v.FormLabel,{required:!0,color:"primary",children:n.entity}),c.jsx(v.Select,{value:o,size:"sm",name:"entity_id",onChange:(I,y)=>a(y),sx:{width:"100%",mr:{xs:0,md:1},mb:{xs:1,md:0},minHeight:"37px"},endDecorator:!m&&c.jsx(v.CircularProgress,{size:"sm"}),children:m&&m.map(I=>c.jsx(v.Option,{value:I.id,children:I.name},`entity--${I.id}`))})]}),c.jsx(v.Button,{startDecorator:c.jsx(De.Add,{}),disabled:!o||!s,onClick:b,sx:{mb:1},children:n.add})]}),c.jsx(nt,{showToast:f,message:n.relatedEntitiesErrorMessage,color:"danger",hideToast:p})]})},uF=e=>{const[t,n]=x.useState(!1),[r,i]=x.useState(!1),[o,a]=x.useState("success"),[s,l]=x.useState(""),u=x.useContext(ea),d=(h,p)=>{a(h),l(p),i(!0)},f=()=>_(this,null,function*(){n(!0);const h=yield u==null?void 0:u.https.exportLeadsPerEntity(e.entityId);if(h!=null&&h.ok){const p=yield h.blob(),m=URL.createObjectURL(p),g=document.createElement("a");g.href=m,g.download=`${e.entityType}_${e.entityName}_exported_users_leads.csv`,document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(m),n(!1),d("success",e.labels.usersLeadsExportMessage)}else console.error("Failed to export all users leads: ",yield h==null?void 0:h.json()),n(!1),d("danger",e.labels.usersLeadsExportErrorMessage)});return c.jsxs(c.Fragment,{children:[c.jsxs(v.Box,{mb:2,children:[c.jsx(v.Box,{display:"flex",alignItems:"center",mb:1,children:c.jsx(v.Typography,{level:"body-lg",sx:{mx:"auto"},children:e.labels.exportUsersLeads})}),c.jsx(v.Sheet,{sx:{overflowX:"auto",minWidth:"700px"},children:c.jsxs(v.Table,{variant:"outlined",hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{backgroundColor:"#fff","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left",width:"50%"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:e.labels.category}),c.jsx("th",{children:e.labels.action})]})}),c.jsx("tbody",{children:c.jsxs("tr",{children:[c.jsxs("td",{children:[c.jsx(v.Typography,{level:"body-sm",fontWeight:"600",children:e.labels.exportAllUsersLeads}),c.jsx(v.Typography,{level:"body-xs",color:"neutral",children:e.labels.exportAllUsersLeadsDescription})]}),c.jsx("td",{children:c.jsx(v.Button,{loading:t,onClick:f,children:e.labels.exportAllUsersLeads})})]})})]})})]}),c.jsx(nt,{showToast:r,color:o,message:s,hideToast:()=>i(!1)})]})},dF=({tooltipContent:e="Drag to reorder"})=>{const{attributes:t,listeners:n,ref:r}=x.useContext(Os);return c.jsx(v.Tooltip,{title:e,placement:"left",arrow:!0,children:c.jsx(v.IconButton,q(z(z({variant:"plain",color:"neutral",size:"sm",sx:{color:"text.tertiary",my:"auto",mr:1,":hover":{bgcolor:"action.hover"},":active":{bgcolor:"action.selected"},transition:"all 0.2s",cursor:"grab","&:active":{cursor:"grabbing"}}},t),n),{ref:r,children:c.jsx(ab,{})}))})},ub=({id:e,useDraggable:t=!0,variant:n="outlined",item:r,tooltipContent:i})=>{const{attributes:o,isDragging:a,listeners:s,setNodeRef:l,setActivatorNodeRef:u,transform:d,transition:f}=rb({id:e}),h=x.useMemo(()=>({attributes:o,listeners:s,ref:u}),[o,s,u]),p={opacity:a?.6:void 0,transform:Hn.Translate.toString(d),transition:f},m=b=>b.split(" ").map(w=>w[0]).join("").toUpperCase().substring(0,2),g=b=>r!=null&&r.color?r.color:`hsl(${b.split("").reduce((C,I)=>I.charCodeAt(0)+((C<<5)-C),0)%360}, 70%, 80%)`;return c.jsx(Os.Provider,{value:h,children:c.jsx(v.ListItem,{variant:n,ref:l,style:p,endAction:t?c.jsx(dF,{tooltipContent:i}):null,sx:{p:0,borderRadius:"md",overflow:"hidden",transition:"all 0.2s",boxShadow:a?"md":"sm",transform:`scale(${a?1.02:1})`,border:"1px solid",borderColor:"divider"},children:c.jsxs(v.Box,{sx:{display:"flex",width:"100%",alignItems:"center",gap:2,p:0},children:[c.jsx(v.Sheet,{sx:{width:"8px",alignSelf:"stretch",bgcolor:g(r.name)}}),c.jsx(v.Avatar,{src:r.image,alt:r.name,sx:{bgcolor:g(r.name),my:2,ml:1},children:m(r.name)}),c.jsxs(v.Box,{sx:{py:2,pr:2,flexGrow:1,display:"flex",flexDirection:"column",gap:.5},children:[c.jsx(v.Typography,{level:"title-md",children:r.name}),r.description&&c.jsx(v.Typography,{level:"body-sm",sx:{color:"text.secondary",textOverflow:"ellipsis"},children:r.description}),c.jsx(v.Box,{sx:{mt:.5},children:r.type&&c.jsx(v.Chip,{variant:"soft",color:"primary",size:"sm",sx:{px:1,bgcolor:`${g(r.type)}40`},children:r.type})})]})]})})})},fF=({items:e=[],labels:t,setItems:n})=>{const[r,i]=x.useState(null),o=x.useMemo(()=>e.find(s=>s.id===(r==null?void 0:r.id)),[r,e]),a=xv(Cs(Ss,{activationConstraint:{distance:8}}),Cs(Is,{coordinateGetter:ib}));return e.length===0?c.jsx(v.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",border:"1px dashed",borderColor:"divider",borderRadius:"md"},children:c.jsx(v.Typography,{level:"body-lg",color:"neutral",children:(t==null?void 0:t.noItemsToDisplay)||"No items to display"})}):c.jsxs(Yv,{sensors:a,onDragStart:({active:s})=>{i(s)},onDragEnd:({active:s,over:l})=>{if(l&&s.id!==(l==null?void 0:l.id)){const u=e.findIndex(({id:f})=>f===s.id),d=e.findIndex(({id:f})=>f===l.id);n(_s(e,u,d))}i(null)},onDragCancel:()=>{i(null)},children:[c.jsx(tb,{items:e,children:c.jsx(v.List,{sx:{gap:2,maxHeight:"70vh",overflowY:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"action.focus",borderRadius:"4px"}},children:e.map(s=>c.jsx(ub,{id:s.id,variant:"outlined",item:s,tooltipContent:t==null?void 0:t.dragToReorder},`sortable-item-${s.id}`))})}),c.jsx(lb,{children:o?c.jsx(ub,{id:o.id,useDraggable:!1,item:o,tooltipContent:t.dragToReorder},`sortable-overlay-item-${o.id}`):null})]})},hF=({entityType:e,entityId:t,authRequirement:n,labels:r})=>{const[i,o]=x.useState(!1),[a,s]=x.useState(!1),[l,u]=x.useState(""),[d,f]=x.useState(""),[h,p]=x.useState([]),[m,g]=x.useState("before"),[b,w]=x.useState(!1),[S,C]=x.useState(""),[I,y]=x.useState(""),[A,E]=x.useState("STANDARD"),[k,F]=x.useState("left"),[Y,O]=x.useState(!0);x.useEffect(()=>{n!=="LEAD"&&o(!1),n!=="REGISTERED"&&s(!1)},[n]);const T=`
|
|
2476
2476
|
data-content-type="${e}"`,N=`
|
|
2477
2477
|
data-content-id="${t}"`,V=h.length>0?`
|
|
2478
2478
|
data-lead-fields="${h.join(", ")}"`:"",j=i?`
|
|
@@ -2485,7 +2485,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2485
2485
|
data-image-position="${k}"`:"",L=`
|
|
2486
2486
|
data-show-answer-explanations="${Y}"`,U=`<div
|
|
2487
2487
|
data-component="fu-widget"${T}${N}${te}${R}${L}${V}${j}${$}${M}${H}${Q}
|
|
2488
|
-
></div>`,W={fullName:"Full name",firstName:"First name",lastName:"Last name",email:"Email",gender:"Gender",country:"Country",phoneCountryCode:"Phone country code",phoneNumber:"Phone number"},re=({title:Z})=>c.jsx(v.Tooltip,{title:Z,sx:{maxWidth:300},children:c.jsx(ir,{color:"primary"})}),se=()=>c.jsxs(v.Card,{sx:{mb:
|
|
2488
|
+
></div>`,W={fullName:"Full name",firstName:"First name",lastName:"Last name",email:"Email",gender:"Gender",country:"Country",phoneCountryCode:"Phone country code",phoneNumber:"Phone number"},re=({title:Z})=>c.jsx(v.Tooltip,{title:Z,sx:{maxWidth:300},children:c.jsx(ir,{color:"primary"})}),se=()=>c.jsxs(v.Card,{sx:{mb:2},children:[c.jsx(Ar,{label:"",values:h,allValues:Object.keys(W),valuesMap:W,onChange:Z=>p(Z)}),c.jsxs(v.FormControl,{sx:{mb:1},children:[c.jsx(v.FormLabel,{color:"primary",children:r.leadPosition}),c.jsxs(v.Select,{value:m,size:"md",name:"lead_position",onChange:(Z,he)=>g(he==="before"?"before":"after"),children:[c.jsx(v.Option,{value:"before",children:"Before"}),c.jsx(v.Option,{value:"after",children:"After"})]})]})]}),ae=()=>c.jsxs(v.Card,{sx:{mb:2},children:[c.jsxs(v.FormControl,{children:[c.jsx(v.FormLabel,{color:"primary",children:r.signInLabel}),c.jsx(v.Input,{variant:"outlined",color:"neutral",value:l,defaultValue:"",onChange:Z=>u(Z.target.value)}),c.jsx(v.FormHelperText,{children:r.signInLabelDescription})]}),c.jsxs(v.FormControl,{children:[c.jsx(v.FormLabel,{color:"primary",children:r.authenticationHandler}),c.jsx(v.Input,{variant:"outlined",color:"neutral",value:d,defaultValue:"",onChange:Z=>f(Z.target.value)}),c.jsx(v.FormHelperText,{children:r.authenticationHandlerDescription})]})]}),X=()=>c.jsxs(v.Card,{sx:{mb:2},children:[c.jsx(xn,{label:r.id,placeholder:"",defaultValue:S,required:!1,size:"md",endDecorator:c.jsx(re,{title:r.campaignIdInfoMessage}),onChange:Z=>C(Z.target.value)}),c.jsx(xn,{label:r.name,placeholder:"",defaultValue:I,required:!1,size:"md",endDecorator:c.jsx(re,{title:r.campaignNameInfoMessage}),onChange:Z=>y(Z.target.value)})]}),le=(Z,he)=>{E(he),F(he!=="STANDARD"?null:"left")};return c.jsxs(v.Box,{mt:1,children:[e==="classic-quiz"||e==="poll"?c.jsxs(v.Box,{mb:2,children:[c.jsxs(v.FormControl,{sx:{mb:1},children:[c.jsx(v.FormLabel,{color:"primary",children:r.layoutTemplate}),c.jsxs(v.Select,{value:A,size:"md",name:"layout_template",onChange:le,children:[c.jsx(v.Option,{value:"STANDARD",children:"Standard"}),c.jsx(v.Option,{value:"SPLIT",children:"Split"}),c.jsx(v.Option,{value:"OVERLAY",children:"Overlay"})]}),c.jsx(v.FormHelperText,{children:r.layoutTemplateDescription})]}),c.jsxs(v.FormControl,{sx:{mb:e==="classic-quiz"?1:0},children:[c.jsx(v.FormLabel,{color:"primary",children:r.imagePosition}),c.jsxs(v.Select,{value:k,size:"md",name:"image_position",disabled:A!=="STANDARD",onChange:(Z,he)=>F(he),children:[c.jsx(v.Option,{value:"left",children:"Left"}),c.jsx(v.Option,{value:"right",children:"Right"})]}),c.jsx(v.FormHelperText,{children:r.imagePositionDescription})]}),e==="classic-quiz"?c.jsxs(v.Box,{display:"flex",alignItems:"center",children:[c.jsx(ui,{defaultValue:Y,label:r.showAnswerExplanations,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:Z=>{O(Z)}}),c.jsx(v.Tooltip,{title:r.showAnswerExplanationsTooltip,sx:{ml:2,maxWidth:300},children:c.jsx(ir,{color:"primary"})})]}):c.jsx(c.Fragment,{})]}):c.jsx(c.Fragment,{}),c.jsxs(v.Box,{display:"flex",mb:1,children:[c.jsx(ui,{defaultValue:i,label:r.configureLeads,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:n!=="LEAD",onChange:Z=>{Z===!1&&(p([]),g("before")),o(Z)}}),n!=="LEAD"&&c.jsx(v.Tooltip,{title:r.configureLeadsDisabledMessage,sx:{ml:2,maxWidth:300},children:c.jsx(ir,{color:"primary"})})]}),i&&se(),c.jsxs(v.Box,{display:"flex",mb:1,children:[c.jsx(ui,{defaultValue:a,label:r.configureSignIn,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:n!=="REGISTERED",onChange:Z=>{Z===!1&&(u(""),f("")),s(Z)}}),n!=="REGISTERED"&&c.jsx(v.Tooltip,{title:r.configureSignInDisabledMessage,sx:{ml:2,maxWidth:300},children:c.jsx(ir,{color:"primary"})})]}),a&&ae(),c.jsx(ui,{sx:{label:{mb:1}},defaultValue:b,label:r.addCampaignInfo,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:Z=>{Z===!1&&(C(""),y("")),w(Z)}}),b&&X(),c.jsxs(v.Box,{position:"relative",mb:2,children:[c.jsx(v.Textarea,{value:U,minRows:"5",maxRows:"20",readOnly:!0,onMouseDown:Z=>Z.preventDefault(),sx:{cursor:"default","&:hover":{cursor:"default"},"& textarea":{cursor:"default"}}}),c.jsx(v.Tooltip,{title:r.copyToClipboard,children:c.jsx(v.Button,{onClick:()=>{navigator.clipboard.writeText(U)},sx:{position:"absolute",top:"10px",right:"10px",zIndex:1},variant:"soft",color:"neutral",children:c.jsx(De.ContentCopy,{})})})]}),c.jsx(v.Alert,{variant:"outlined",color:"primary",startDecorator:c.jsx(ir,{}),sx:{mb:2,width:"fit-content"},children:c.jsxs(v.Typography,{color:"primary",fontSize:14,fontWeight:500,children:[r.divElementTextInfo,c.jsx(v.Link,{href:"https://docs.fansunitedmedia.com/docs/user-centric-widgets#/",underline:"always",target:"_blank",rel:"noopener noreferrer",children:"User-centric widgets"})]})})]})},pF=["load-more","limited"],gF={"load-more":"Load more",limited:"Limited"},mF=({entityId:e,labels:t})=>{const[n,r]=x.useState(!1),[i,o]=x.useState(""),[a,s]=x.useState(""),[l,u]=x.useState(""),[d,f]=x.useState(10),[h,p]=x.useState(2),[m,g]=x.useState("load-more"),b=`
|
|
2489
2489
|
data-content-id="${e}"`,w=i?`
|
|
2490
2490
|
data-classic-quiz-url="${i}"`:"",S=a?`
|
|
2491
2491
|
data-either-or-url="${a}"`:"",C=l?`
|
package/package.json
CHANGED
|
@@ -9,6 +9,8 @@ type WidgetEmbedCodeLabels = {
|
|
|
9
9
|
showAnswerExplanationsTooltip: string;
|
|
10
10
|
configureLeads: string;
|
|
11
11
|
configureLeadsDisabledMessage: string;
|
|
12
|
+
configureSignIn: string;
|
|
13
|
+
configureSignInDisabledMessage: string;
|
|
12
14
|
leadPosition: string;
|
|
13
15
|
signInLabel: string;
|
|
14
16
|
signInLabelDescription: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetEmbedCode.d.ts","sourceRoot":"","sources":["../../../../src/components/WidgetEmbedCode/WidgetEmbedCode.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"WidgetEmbedCode.d.ts","sourceRoot":"","sources":["../../../../src/components/WidgetEmbedCode/WidgetEmbedCode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AA2BnD,KAAK,qBAAqB,GAAG;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,yBAAyB,EAAE,MAAM,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,wBAAwB,EAAE,MAAM,CAAC;IACjC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,6BAA6B,EAAE,MAAM,CAAC;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,6BAA6B,EAAE,MAAM,CAAC;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,8BAA8B,EAAE,MAAM,CAAC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gCAAgC,EAAE,MAAM,CAAC;IACzC,eAAe,EAAE,MAAM,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,MAAM,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC3B,UAAU,EAAE,cAAc,GAAG,kBAAkB,GAAG,WAAW,GAAG,MAAM,CAAC;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,qBAAqB,CAAC;CAC9B,CAAC;AAEF;;;;;;;GAOG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAsRnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -436,6 +436,8 @@ export declare const components: {
|
|
|
436
436
|
showAnswerExplanationsTooltip: string;
|
|
437
437
|
configureLeads: string;
|
|
438
438
|
configureLeadsDisabledMessage: string;
|
|
439
|
+
configureSignIn: string;
|
|
440
|
+
configureSignInDisabledMessage: string;
|
|
439
441
|
leadPosition: string;
|
|
440
442
|
signInLabel: string;
|
|
441
443
|
signInLabelDescription: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/constants/components.ts"],"names":[],"mappings":"AAkDA,eAAO,MAAM,UAAU;IACtB;;OAEG;;;;;IAEH;;OAEG;;;;;;;;;;;;IAEH;;OAEG;;;;;;;;;;IAEH;;OAEG;;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;;;kBA9DwF,CAAC;qBAC/E,CAAC;iBAAiB,CAAA;;;;IA+D/B;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;;;OAIG;;;;;;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;IAEH;;;;;;;;OAQG;;;;;;;;IAEH;;OAEG;;;;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;;;;;;;IAEH;;OAEG;;;;;;;;;;;;;;;IAEH;;OAEG;;;;;IAEH;;;;;OAKG;;;;;;;;;IAEH;;OAEG
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/constants/components.ts"],"names":[],"mappings":"AAkDA,eAAO,MAAM,UAAU;IACtB;;OAEG;;;;;IAEH;;OAEG;;;;;;;;;;;;IAEH;;OAEG;;;;;;;;;;IAEH;;OAEG;;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;;;kBA9DwF,CAAC;qBAC/E,CAAC;iBAAiB,CAAA;;;;IA+D/B;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;;;OAIG;;;;;;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;IAEH;;;;;;;;OAQG;;;;;;;;IAEH;;OAEG;;;;;;;;;;IAEH;;OAEG;;;;;;;;IAEH;;OAEG;;;;;;;;;;;;;IAEH;;OAEG;;;;;;;;;;;;;;;IAEH;;OAEG;;;;;IAEH;;;;;OAKG;;;;;;;;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEH;;OAEG;;;;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;IAEH;;;;;OAKG;;;oCA9O8B,CAAC;;;;;;;;;;;;;;;;;;CAgPzB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,OAAO,UAAU,CAAC"}
|
|
@@ -302,6 +302,8 @@ declare const ComponentContext: React.Context<{
|
|
|
302
302
|
showAnswerExplanationsTooltip: string;
|
|
303
303
|
configureLeads: string;
|
|
304
304
|
configureLeadsDisabledMessage: string;
|
|
305
|
+
configureSignIn: string;
|
|
306
|
+
configureSignInDisabledMessage: string;
|
|
305
307
|
leadPosition: string;
|
|
306
308
|
signInLabel: string;
|
|
307
309
|
signInLabelDescription: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentContext.d.ts","sourceRoot":"","sources":["../../../src/context/ComponentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG3E,KAAK,sBAAsB,GAAG;IAC7B,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAamzB,CAAC;qBAAoB,CAAC;iBAAgB,CAAC
|
|
1
|
+
{"version":3,"file":"ComponentContext.d.ts","sourceRoot":"","sources":["../../../src/context/ComponentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG3E,KAAK,sBAAsB,GAAG;IAC7B,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAamzB,CAAC;qBAAoB,CAAC;iBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAAztB,CAAC;;;;;;;;;;;;;;;;;;SAblF,CAAC;AAEvE;;;;;GAKG;AACH,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,GAAG,iBAAiB,CAE3E,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC"}
|