- ${this._plates().map((t) => this._renderPlate(t))}
+ ${this._plates().map((e) => this._renderPlate(e))}
- ${St}
+ ${Se}
${i}
- ${r === null ? t : `${t} · ${r}`}
+ ${r === null ? e : `${e} · ${r}`}
${n}
@@ -1362,167 +1362,167 @@ class Et extends C {
`;
}
}
-customElements.define("nestquest-party-board-card", Et);
-oe({
+customElements.define("nestquest-party-board-card", Ee);
+ot({
type: "nestquest-party-board-card",
name: "NestQuest Party Board",
description: "Kids' attract screen for present and away adventurers."
});
-const Nt = { CHILD: 2 }, Tt = (s) => (...e) => ({ _$litDirective$: s, values: e });
-let Mt = class {
- constructor(e) {
+const Ne = { CHILD: 2 }, Te = (s) => (...t) => ({ _$litDirective$: s, values: t });
+let Me = class {
+ constructor(t) {
}
get _$AU() {
return this._$AM._$AU;
}
- _$AT(e, t, n) {
- this._$Ct = e, this._$AM = t, this._$Ci = n;
+ _$AT(t, e, n) {
+ this._$Ct = t, this._$AM = e, this._$Ci = n;
}
- _$AS(e, t) {
- return this.update(e, t);
+ _$AS(t, e) {
+ return this.update(t, e);
}
- update(e, t) {
- return this.render(...t);
+ update(t, e) {
+ return this.render(...e);
}
};
-const { I: Ot } = at, we = (s) => s, ke = () => document.createComment(""), z = (s, e, t) => {
- const n = s._$AA.parentNode, i = e === void 0 ? s._$AB : e._$AA;
- if (t === void 0) {
- const r = n.insertBefore(ke(), i), o = n.insertBefore(ke(), i);
- t = new Ot(r, o, s, s.options);
+const { I: Oe } = ae, qt = (s) => s, kt = () => document.createComment(""), z = (s, t, e) => {
+ const n = s._$AA.parentNode, i = t === void 0 ? s._$AB : t._$AA;
+ if (e === void 0) {
+ const r = n.insertBefore(kt(), i), o = n.insertBefore(kt(), i);
+ e = new Oe(r, o, s, s.options);
} else {
- const r = t._$AB.nextSibling, o = t._$AM, l = o !== s;
+ const r = e._$AB.nextSibling, o = e._$AM, l = o !== s;
if (l) {
let a;
- t._$AQ?.(s), t._$AM = s, t._$AP !== void 0 && (a = s._$AU) !== o._$AU && t._$AP(a);
+ e._$AQ?.(s), e._$AM = s, e._$AP !== void 0 && (a = s._$AU) !== o._$AU && e._$AP(a);
}
if (r !== i || l) {
- let a = t._$AA;
+ let a = e._$AA;
for (; a !== r; ) {
- const c = we(a).nextSibling;
- we(n).insertBefore(a, i), a = c;
+ const p = qt(a).nextSibling;
+ qt(n).insertBefore(a, i), a = p;
}
}
}
- return t;
-}, w = (s, e, t = s) => (s._$AI(e, t), s), zt = {}, Pt = (s, e = zt) => s._$AH = e, It = (s) => s._$AH, J = (s) => {
+ return e;
+}, q = (s, t, e = s) => (s._$AI(t, e), s), ze = {}, Pe = (s, t = ze) => s._$AH = t, Ie = (s) => s._$AH, J = (s) => {
s._$AR(), s._$AA.remove();
};
-const Ae = (s, e, t) => {
+const At = (s, t, e) => {
const n = /* @__PURE__ */ new Map();
- for (let i = e; i <= t; i++) n.set(s[i], i);
+ for (let i = t; i <= e; i++) n.set(s[i], i);
return n;
-}, Ce = Tt(class extends Mt {
+}, Ct = Te(class extends Me {
constructor(s) {
- if (super(s), s.type !== Nt.CHILD) throw Error("repeat() can only be used in text expressions");
+ if (super(s), s.type !== Ne.CHILD) throw Error("repeat() can only be used in text expressions");
}
- dt(s, e, t) {
+ dt(s, t, e) {
let n;
- t === void 0 ? t = e : e !== void 0 && (n = e);
+ e === void 0 ? e = t : t !== void 0 && (n = t);
const i = [], r = [];
let o = 0;
- for (const l of s) i[o] = n ? n(l, o) : o, r[o] = t(l, o), o++;
+ for (const l of s) i[o] = n ? n(l, o) : o, r[o] = e(l, o), o++;
return { values: r, keys: i };
}
- render(s, e, t) {
- return this.dt(s, e, t).values;
+ render(s, t, e) {
+ return this.dt(s, t, e).values;
}
- update(s, [e, t, n]) {
- const i = It(s), { values: r, keys: o } = this.dt(e, t, n);
+ update(s, [t, e, n]) {
+ const i = Ie(s), { values: r, keys: o } = this.dt(t, e, n);
if (!Array.isArray(i)) return this.ut = o, r;
const l = this.ut ??= [], a = [];
- let c, u, d = 0, f = i.length - 1, h = 0, m = r.length - 1;
+ let p, u, d = 0, f = i.length - 1, h = 0, m = r.length - 1;
for (; d <= f && h <= m; ) if (i[d] === null) d++;
else if (i[f] === null) f--;
- else if (l[d] === o[h]) a[h] = w(i[d], r[h]), d++, h++;
- else if (l[f] === o[m]) a[m] = w(i[f], r[m]), f--, m--;
- else if (l[d] === o[m]) a[m] = w(i[d], r[m]), z(s, a[m + 1], i[d]), d++, m--;
- else if (l[f] === o[h]) a[h] = w(i[f], r[h]), z(s, i[d], i[f]), f--, h++;
- else if (c === void 0 && (c = Ae(o, h, m), u = Ae(l, d, f)), c.has(l[d])) if (c.has(l[f])) {
- const y = u.get(o[h]), b = y !== void 0 ? i[y] : null;
+ else if (l[d] === o[h]) a[h] = q(i[d], r[h]), d++, h++;
+ else if (l[f] === o[m]) a[m] = q(i[f], r[m]), f--, m--;
+ else if (l[d] === o[m]) a[m] = q(i[d], r[m]), z(s, a[m + 1], i[d]), d++, m--;
+ else if (l[f] === o[h]) a[h] = q(i[f], r[h]), z(s, i[d], i[f]), f--, h++;
+ else if (p === void 0 && (p = At(o, h, m), u = At(l, d, f)), p.has(l[d])) if (p.has(l[f])) {
+ const _ = u.get(o[h]), b = _ !== void 0 ? i[_] : null;
if (b === null) {
const j = z(s, i[d]);
- w(j, r[h]), a[h] = j;
- } else a[h] = w(b, r[h]), z(s, i[d], b), i[y] = null;
+ q(j, r[h]), a[h] = j;
+ } else a[h] = q(b, r[h]), z(s, i[d], b), i[_] = null;
h++;
} else J(i[f]), f--;
else J(i[d]), d++;
for (; h <= m; ) {
- const y = z(s, a[m + 1]);
- w(y, r[h]), a[h++] = y;
+ const _ = z(s, a[m + 1]);
+ q(_, r[h]), a[h++] = _;
}
for (; d <= f; ) {
- const y = i[d++];
- y !== null && J(y);
+ const _ = i[d++];
+ _ !== null && J(_);
}
- return this.ut = o, Pt(s, a), E;
+ return this.ut = o, Pe(s, a), E;
}
-}), Se = /* @__PURE__ */ new Map();
-function H(s, e) {
- const t = `${s ?? "local"}|${JSON.stringify(e)}`, n = Se.get(t);
+}), St = /* @__PURE__ */ new Map();
+function H(s, t) {
+ const e = `${s ?? "local"}|${JSON.stringify(t)}`, n = St.get(e);
if (n)
return n;
let i;
try {
i = new Intl.DateTimeFormat("en-US", {
- ...e,
+ ...t,
...s ? { timeZone: s } : {}
});
} catch {
- i = new Intl.DateTimeFormat("en-US", e);
+ i = new Intl.DateTimeFormat("en-US", t);
}
- return Se.set(t, i), i;
+ return St.set(e, i), i;
}
-function Ut(s) {
- const e = s?.config;
- if (!e || typeof e != "object")
+function Ue(s) {
+ const t = s?.config;
+ if (!t || typeof t != "object")
return;
- const t = e.time_zone;
- return typeof t == "string" && t.trim() ? t.trim() : void 0;
+ const e = t.time_zone;
+ return typeof e == "string" && e.trim() ? e.trim() : void 0;
}
-function Ee(s, e) {
- return `${H(e, { weekday: "long" }).format(s)}, ${H(e, { month: "short", day: "numeric" }).format(s)}`;
+function Et(s, t) {
+ return `${H(t, { weekday: "long" }).format(s)}, ${H(t, { month: "short", day: "numeric" }).format(s)}`;
}
-function Dt(s, e) {
- return H(e, { weekday: "long" }).format(s);
+function De(s, t) {
+ return H(t, { weekday: "long" }).format(s);
}
-function Ht(s, e) {
- const t = new Date(s);
- return Number.isNaN(t.getTime()) ? "" : H(e, {
+function He(s, t) {
+ const e = new Date(s);
+ return Number.isNaN(e.getTime()) ? "" : H(t, {
hour: "numeric",
minute: "2-digit",
hour12: !0
- }).format(t);
+ }).format(e);
}
-function jt(s) {
+function je(s) {
if (!s)
return null;
- const e = /^(\d{1,2}):(\d{2})$/.exec(s.trim());
- if (!e)
+ const t = /^(\d{1,2}):(\d{2})$/.exec(s.trim());
+ if (!t)
return null;
- const t = Number(e[1]);
- if (t > 23)
+ const e = Number(t[1]);
+ if (e > 23)
return null;
- const n = t >= 12 ? "PM" : "AM";
- return `${t % 12 === 0 ? 12 : t % 12}:${e[2]} ${n}`;
+ const n = e >= 12 ? "PM" : "AM";
+ return `${e % 12 === 0 ? 12 : e % 12}:${t[2]} ${n}`;
}
function k(s) {
return typeof s == "string" ? s.trim() : "";
}
-function _(s, e) {
+function y(s, t) {
if (s == null || s === "")
- return e;
- const t = typeof s == "number" ? s : Number(s);
- return Number.isFinite(t) ? t : e;
+ return t;
+ const e = typeof s == "number" ? s : Number(s);
+ return Number.isFinite(e) ? e : t;
}
-function $(s) {
+function x(s) {
return Math.max(0, Math.round(s));
}
function X(s) {
- return s.split(/[-_]+/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
+ return s.split(/[-_]+/).filter(Boolean).map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join(" ");
}
-function Rt(s, e) {
- const t = H(e, {
+function Re(s, t) {
+ const e = H(t, {
year: "numeric",
month: "2-digit",
day: "2-digit",
@@ -1531,7 +1531,7 @@ function Rt(s, e) {
second: "2-digit",
hourCycle: "h23"
}).formatToParts(new Date(s)), n = (r) => {
- const o = t.find((l) => l.type === r);
+ const o = e.find((l) => l.type === r);
return o ? Number(o.value) : Number.NaN;
}, i = Date.UTC(
n("year"),
@@ -1543,45 +1543,49 @@ function Rt(s, e) {
);
return Number.isFinite(i) ? i - s : 0;
}
-function Ne(s, e) {
+function Nt(s, t) {
if (typeof s != "string")
return null;
- const t = s.split("-");
- if (t.length !== 3)
+ const e = s.split("-");
+ if (e.length !== 3)
return null;
- const [n, i, r] = t.map((a) => Number(a));
+ const [n, i, r] = e.map((a) => Number(a));
if (!n || !i || !r)
return null;
- if (!e) {
+ if (!t) {
const a = new Date(n, i - 1, r);
return Number.isNaN(a.getTime()) ? null : a;
}
- const o = Date.UTC(n, i - 1, r), l = new Date(o - Rt(o, e));
+ const o = Date.UTC(n, i - 1, r), l = new Date(o - Re(o, t));
return Number.isNaN(l.getTime()) ? null : l;
}
-function Lt() {
+function Le() {
const s = window.location.pathname.split("/").filter(Boolean);
return s.length > 0 ? s[s.length - 1].toLowerCase() : "";
}
-function Bt(s) {
+function Be(s) {
if (!s || typeof s != "object")
return null;
- const e = s, t = k(e.state).toLowerCase();
- if (t !== "open" && t !== "completed")
+ const t = s, e = k(t.state).toLowerCase();
+ if (e !== "open" && e !== "completed")
return null;
- const n = _(e.id, 0);
- return n ? {
+ const n = y(t.id, 0);
+ if (!n)
+ return null;
+ const i = y(t.child_id, 0);
+ return {
id: n,
- title: k(e.title) || "Quest",
- icon: k(e.icon) || null,
- window: k(e.window).toLowerCase(),
- due_time: k(e.due_time) || null,
- state: t,
- overdue: e.overdue === !0,
- completed_at: k(e.completed_at) || null
- } : null;
+ child_id: i > 0 ? i : null,
+ title: k(t.title) || "Quest",
+ icon: k(t.icon) || null,
+ window: k(t.window).toLowerCase(),
+ due_time: k(t.due_time) || null,
+ state: e,
+ overdue: t.overdue === !0,
+ completed_at: k(t.completed_at) || null
+ };
}
-const Te = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", Ft = "polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%)", Me = [-9, 6, -4], Qt = Pe`
+const Tt = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", Fe = "polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%)", Mt = [-9, 6, -4], Qe = Pt`
* {
box-sizing: border-box;
}
@@ -1641,7 +1645,7 @@ const Te = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", Ft = "polygon(50%
width: 96px;
height: 110px;
padding: 3px;
- clip-path: ${v(Te)};
+ clip-path: ${v(Tt)};
background: rgba(255, 255, 255, 0.22);
}
@@ -1652,7 +1656,7 @@ const Te = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", Ft = "polygon(50%
align-items: center;
justify-content: center;
padding-bottom: 32px;
- clip-path: ${v(Te)};
+ clip-path: ${v(Tt)};
background: var(--nq-p-crest);
}
@@ -1718,7 +1722,7 @@ const Te = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", Ft = "polygon(50%
justify-content: center;
width: 44px;
height: 44px;
- clip-path: ${v(Ft)};
+ clip-path: ${v(Fe)};
background: var(--nq-brand-gradient);
}
@@ -2229,7 +2233,42 @@ const Te = "polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%)", Ft = "polygon(50%
width: 38px;
height: 38px;
}
-`, R = p`
`, Wt = p`