pleasenobugs 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1153 @@
1
+ var On = Object.defineProperty;
2
+ var nn = (e) => {
3
+ throw TypeError(e);
4
+ };
5
+ var Vn = (e, n, t) => n in e ? On(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
6
+ var tn = (e, n, t) => Vn(e, typeof n != "symbol" ? n + "" : n, t), Le = (e, n, t) => n.has(e) || nn("Cannot " + t);
7
+ var k = (e, n, t) => (Le(e, n, "read from private field"), t ? t.call(e) : n.get(e)), H = (e, n, t) => n.has(e) ? nn("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(e) : n.set(e, t), E = (e, n, t, a) => (Le(e, n, "write to private field"), a ? a.call(e, t) : n.set(e, t), t), O = (e, n, t) => (Le(e, n, "access private method"), t);
8
+ import { sortPosts as Rn, createMatcher as Kn, insideNimiqPay as Yn, createClient as Gn } from "./client.js";
9
+ import { SignerError as Wt, nimiqPaySigner as Ut } from "./client.js";
10
+ const Jn = 24;
11
+ var Ne, y, xn, G, an, yn, wn, je, xe, de, kn, Re, Fe, He, Se = {}, Te = [], Zn = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Ae = Array.isArray;
12
+ function V(e, n) {
13
+ for (var t in n) e[t] = n[t];
14
+ return e;
15
+ }
16
+ function Ke(e) {
17
+ e && e.parentNode && e.parentNode.removeChild(e);
18
+ }
19
+ function Qn(e, n, t) {
20
+ var a, l, o, d = {};
21
+ for (o in n) o == "key" ? a = n[o] : o == "ref" ? l = n[o] : d[o] = n[o];
22
+ if (arguments.length > 2 && (d.children = arguments.length > 3 ? Ne.call(arguments, 2) : t), typeof e == "function" && e.defaultProps != null) for (o in e.defaultProps) d[o] === void 0 && (d[o] = e.defaultProps[o]);
23
+ return ye(e, d, a, l, null);
24
+ }
25
+ function ye(e, n, t, a, l) {
26
+ var o = { type: e, props: n, key: t, ref: a, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: l ?? ++xn, __i: -1, __u: 0 };
27
+ return l == null && y.vnode != null && y.vnode(o), o;
28
+ }
29
+ function be(e) {
30
+ return e.children;
31
+ }
32
+ function we(e, n) {
33
+ this.props = e, this.context = n;
34
+ }
35
+ function Z(e, n) {
36
+ if (n == null) return e.__ ? Z(e.__, e.__i + 1) : null;
37
+ for (var t; n < e.__k.length; n++) if ((t = e.__k[n]) != null && t.__e != null) return t.__e;
38
+ return typeof e.type == "function" ? Z(e) : null;
39
+ }
40
+ function Xn(e) {
41
+ if (e.__P && e.__d) {
42
+ var n = e.__v, t = n.__e, a = [], l = [], o = V({}, n);
43
+ o.__v = n.__v + 1, y.vnode && y.vnode(o), Ye(e.__P, o, n, e.__n, e.__P.namespaceURI, 32 & n.__u ? [t] : null, a, t ?? Z(n), !!(32 & n.__u), l), o.__v = n.__v, o.__.__k[o.__i] = o, Nn(a, o, l), n.__e = n.__ = null, o.__e != t && Mn(o);
44
+ }
45
+ }
46
+ function Mn(e) {
47
+ if ((e = e.__) != null && e.__c != null) return e.__e = e.__c.base = null, e.__k.some(function(n) {
48
+ if (n != null && n.__e != null) return e.__e = e.__c.base = n.__e;
49
+ }), Mn(e);
50
+ }
51
+ function rn(e) {
52
+ (!e.__d && (e.__d = !0) && G.push(e) && !ze.__r++ || an != y.debounceRendering) && ((an = y.debounceRendering) || yn)(ze);
53
+ }
54
+ function ze() {
55
+ try {
56
+ for (var e, n = 1; G.length; ) G.length > n && G.sort(wn), e = G.shift(), n = G.length, Xn(e);
57
+ } finally {
58
+ G.length = ze.__r = 0;
59
+ }
60
+ }
61
+ function Sn(e, n, t, a, l, o, d, c, b, s, u) {
62
+ var f, i, _, v, M, S, x = a && a.__k || Te, h = n.length;
63
+ for (b = et(t, n, x, b, h), f = 0; f < h; f++) (_ = t.__k[f]) != null && (i = _.__i != -1 && x[_.__i] || Se, _.__i = f, S = Ye(e, _, i, l, o, d, c, b, s, u), v = _.__e, _.ref && i.ref != _.ref && (i.ref && Ge(i.ref, null, _), u.push(_.ref, _.__c || v, _)), M == null && v != null && (M = v), 4 & _.__u ? (b = Tn(_, b, e), i.__e && (i.__e = null)) : typeof _.type == "function" && S !== void 0 ? b = S : v && (b = v.nextSibling), _.__u &= -7);
64
+ return t.__e = M, b;
65
+ }
66
+ function et(e, n, t, a, l) {
67
+ var o, d, c, b, s, u = t.length, f = u, i = 0;
68
+ for (e.__k = new Array(l), o = 0; o < l; o++) (d = n[o]) != null && typeof d != "boolean" && typeof d != "function" ? (typeof d == "string" || typeof d == "number" || typeof d == "bigint" || d.constructor == String ? d = e.__k[o] = ye(null, d, null, null, null) : Ae(d) ? d = e.__k[o] = ye(be, { children: d }, null, null, null) : d.constructor === void 0 && d.__b > 0 ? d = e.__k[o] = ye(d.type, d.props, d.key, d.ref ? d.ref : null, d.__v) : e.__k[o] = d, b = o + i, d.__ = e, d.__b = e.__b + 1, c = null, (s = d.__i = nt(d, t, b, f)) != -1 && (f--, (c = t[s]) && (c.__u |= 2)), c == null || c.__v == null ? (s == -1 && (l > u ? i-- : l < u && i++), typeof d.type != "function" && (d.__u |= 4)) : s != b && (s == b - 1 ? i-- : s == b + 1 ? i++ : (s > b ? i-- : i++, d.__u |= 4))) : e.__k[o] = null;
69
+ if (f) for (o = 0; o < u; o++) (c = t[o]) != null && !(2 & c.__u) && (c.__e == a && (a = Z(c)), Cn(c, c));
70
+ return a;
71
+ }
72
+ function Tn(e, n, t) {
73
+ var a, l;
74
+ if (typeof e.type == "function") {
75
+ for (a = e.__k, l = 0; a && l < a.length; l++) a[l] && (a[l].__ = e, n = Tn(a[l], n, t));
76
+ return n;
77
+ }
78
+ e.__e != n && (n && e.type && !n.parentNode && (n = Z(e)), n = t.insertBefore(e.__e, n || null));
79
+ do
80
+ n = n && n.nextSibling;
81
+ while (n != null && n.nodeType == 8);
82
+ return n;
83
+ }
84
+ function nt(e, n, t, a) {
85
+ var l, o, d, c = e.key, b = e.type, s = n[t], u = s != null && (2 & s.__u) == 0;
86
+ if (s === null && c == null || u && c == s.key && b == s.type) return t;
87
+ if (a > (u ? 1 : 0)) {
88
+ for (l = t - 1, o = t + 1; l >= 0 || o < n.length; ) if ((s = n[d = l >= 0 ? l-- : o++]) != null && !(2 & s.__u) && c == s.key && b == s.type) return d;
89
+ }
90
+ return -1;
91
+ }
92
+ function on(e, n, t) {
93
+ n[0] == "-" ? e.setProperty(n, t ?? "") : e[n] = t == null ? "" : typeof t != "number" || Zn.test(n) ? t : t + "px";
94
+ }
95
+ function ve(e, n, t, a, l) {
96
+ var o, d;
97
+ e: if (n == "style") if (typeof t == "string") e.style.cssText = t;
98
+ else {
99
+ if (typeof a == "string" && (e.style.cssText = a = ""), a) for (n in a) t && n in t || on(e.style, n, "");
100
+ if (t) for (n in t) a && t[n] == a[n] || on(e.style, n, t[n]);
101
+ }
102
+ else if (n[0] == "o" && n[1] == "n") o = n != (n = n.replace(kn, "$1")), d = n.toLowerCase(), n = d in e || n == "onFocusOut" || n == "onFocusIn" ? d.slice(2) : n.slice(2), e.l || (e.l = {}), e.l[n + o] = t, t ? a ? t[de] = a[de] : (t[de] = Re, e.addEventListener(n, o ? He : Fe, o)) : e.removeEventListener(n, o ? He : Fe, o);
103
+ else {
104
+ if (l == "http://www.w3.org/2000/svg") n = n.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
105
+ else if (n != "width" && n != "height" && n != "href" && n != "list" && n != "form" && n != "tabIndex" && n != "download" && n != "rowSpan" && n != "colSpan" && n != "role" && n != "popover" && n in e) try {
106
+ e[n] = t ?? "";
107
+ break e;
108
+ } catch {
109
+ }
110
+ typeof t == "function" || (t == null || t === !1 && n[4] != "-" ? e.removeAttribute(n) : e.setAttribute(n, n == "popover" && t == 1 ? "" : t));
111
+ }
112
+ }
113
+ function ln(e) {
114
+ return function(n) {
115
+ if (this.l) {
116
+ var t = this.l[n.type + e];
117
+ if (n[xe] == null) n[xe] = Re++;
118
+ else if (n[xe] < t[de]) return;
119
+ return t(y.event ? y.event(n) : n);
120
+ }
121
+ };
122
+ }
123
+ function Ye(e, n, t, a, l, o, d, c, b, s) {
124
+ var u, f, i, _, v, M, S, x, h, P, L, A, D, I, F, R, $ = n.type;
125
+ if (n.constructor !== void 0) return null;
126
+ 128 & t.__u && (b = !!(32 & t.__u), o = [c = n.__e = t.__e]), (u = y.__b) && u(n);
127
+ e: if (typeof $ == "function") {
128
+ f = d.length;
129
+ try {
130
+ if (h = n.props, P = $.prototype && $.prototype.render, L = (u = $.contextType) && a[u.__c], A = u ? L ? L.props.value : u.__ : a, t.__c ? x = (i = n.__c = t.__c).__ = i.__E : (P ? n.__c = i = new $(h, A) : (n.__c = i = new we(h, A), i.constructor = $, i.render = at), L && L.sub(i), i.state || (i.state = {}), i.__n = a, _ = i.__d = !0, i.__h = [], i._sb = []), P && i.__s == null && (i.__s = i.state), P && $.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = V({}, i.__s)), V(i.__s, $.getDerivedStateFromProps(h, i.__s))), v = i.props, M = i.state, i.__v = n, _) P && $.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), P && i.componentDidMount != null && i.__h.push(i.componentDidMount);
131
+ else {
132
+ if (P && $.getDerivedStateFromProps == null && h !== v && i.componentWillReceiveProps != null && i.componentWillReceiveProps(h, A), n.__v == t.__v || !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(h, i.__s, A) === !1) {
133
+ n.__v != t.__v && (i.props = h, i.state = i.__s, i.__d = !1), n.__e = t.__e, n.__k = t.__k, n.__k.some(function(j) {
134
+ j && (j.__ = n);
135
+ }), Te.push.apply(i.__h, i._sb), i._sb = [], i.__h.length && d.push(i), c = Z(t);
136
+ break e;
137
+ }
138
+ i.componentWillUpdate != null && i.componentWillUpdate(h, i.__s, A), P && i.componentDidUpdate != null && i.__h.push(function() {
139
+ i.componentDidUpdate(v, M, S);
140
+ });
141
+ }
142
+ if (i.context = A, i.props = h, i.__P = e, i.__e = !1, D = y.__r, I = 0, P) i.state = i.__s, i.__d = !1, D && D(n), u = i.render(i.props, i.state, i.context), Te.push.apply(i.__h, i._sb), i._sb = [];
143
+ else do
144
+ i.__d = !1, D && D(n), u = i.render(i.props, i.state, i.context), i.state = i.__s;
145
+ while (i.__d && ++I < 25);
146
+ i.state = i.__s, i.getChildContext != null && (a = V(V({}, a), i.getChildContext())), P && !_ && i.getSnapshotBeforeUpdate != null && (S = i.getSnapshotBeforeUpdate(v, M)), F = u != null && u.type === be && u.key == null ? An(u.props.children) : u, c = Sn(e, Ae(F) ? F : [F], n, t, a, l, o, d, c, b, s), i.base = n.__e, n.__u &= -161, i.__h.length && d.push(i), x && (i.__E = i.__ = null);
147
+ } catch (j) {
148
+ if (d.length = f, n.__v = null, b || o != null) {
149
+ if (j.then) {
150
+ for (n.__u |= b ? 160 : 128; c && c.nodeType == 8 && c.nextSibling; ) c = c.nextSibling;
151
+ o != null && (o[o.indexOf(c)] = null), n.__e = c;
152
+ } else if (o != null) for (R = o.length; R--; ) Ke(o[R]);
153
+ } else n.__e = t.__e;
154
+ n.__k == null && (n.__k = t.__k || []), j.then || zn(n), y.__e(j, n, t);
155
+ }
156
+ } else o == null && n.__v == t.__v ? (n.__k = t.__k, n.__e = t.__e) : c = n.__e = tt(t.__e, n, t, a, l, o, d, b, s);
157
+ return (u = y.diffed) && u(n), 128 & n.__u ? void 0 : c;
158
+ }
159
+ function zn(e) {
160
+ e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(zn));
161
+ }
162
+ function Nn(e, n, t) {
163
+ for (var a = 0; a < t.length; a++) Ge(t[a], t[++a], t[++a]);
164
+ y.__c && y.__c(n, e), e.some(function(l) {
165
+ try {
166
+ e = l.__h, l.__h = [], e.some(function(o) {
167
+ o.call(l);
168
+ });
169
+ } catch (o) {
170
+ y.__e(o, l.__v);
171
+ }
172
+ });
173
+ }
174
+ function An(e) {
175
+ return typeof e != "object" || e == null || e.__b > 0 ? e : Ae(e) ? e.map(An) : e.constructor !== void 0 ? null : V({}, e);
176
+ }
177
+ function tt(e, n, t, a, l, o, d, c, b) {
178
+ var s, u, f, i, _, v, M, S = t.props || Se, x = n.props, h = n.type;
179
+ if (h == "svg" ? l = "http://www.w3.org/2000/svg" : h == "math" ? l = "http://www.w3.org/1998/Math/MathML" : l || (l = "http://www.w3.org/1999/xhtml"), o != null) {
180
+ for (s = 0; s < o.length; s++) if ((_ = o[s]) && "setAttribute" in _ == !!h && (h ? _.localName == h : _.nodeType == 3)) {
181
+ e = _, o[s] = null;
182
+ break;
183
+ }
184
+ }
185
+ if (e == null) {
186
+ if (h == null) return document.createTextNode(x);
187
+ e = document.createElementNS(l, h, x.is && x), c && (y.__m && y.__m(n, o), c = !1), o = null;
188
+ }
189
+ if (h == null) S === x || c && e.data == x || (e.data = x);
190
+ else {
191
+ if (o = h == "textarea" && x.defaultValue != null ? null : o && Ne.call(e.childNodes), !c && o != null) for (S = {}, s = 0; s < e.attributes.length; s++) S[(_ = e.attributes[s]).name] = _.value;
192
+ for (s in S) _ = S[s], s == "dangerouslySetInnerHTML" ? f = _ : s == "children" || s in x || s == "value" && "defaultValue" in x || s == "checked" && "defaultChecked" in x || ve(e, s, null, _, l);
193
+ for (s in x) _ = x[s], s == "children" ? i = _ : s == "dangerouslySetInnerHTML" ? u = _ : s == "value" ? v = _ : s == "checked" ? M = _ : c && typeof _ != "function" || S[s] === _ || ve(e, s, _, S[s], l);
194
+ if (u) c || f && (u.__html == f.__html || u.__html == e.innerHTML) || (e.innerHTML = u.__html), n.__k = [];
195
+ else if (f && (e.innerHTML = ""), Sn(n.type == "template" ? e.content : e, Ae(i) ? i : [i], n, t, a, h == "foreignObject" ? "http://www.w3.org/1999/xhtml" : l, o, d, o ? o[0] : t.__k && Z(t, 0), c, b), o != null) for (s = o.length; s--; ) Ke(o[s]);
196
+ c && h != "textarea" || (s = "value", h == "progress" && v == null ? e.removeAttribute("value") : v != null && (v !== e[s] || h == "progress" && !v || h == "option" && v != S[s]) && ve(e, s, v, S[s], l), s = "checked", M != null && M != e[s] && ve(e, s, M, S[s], l));
197
+ }
198
+ return e;
199
+ }
200
+ function Ge(e, n, t) {
201
+ try {
202
+ if (typeof e == "function") {
203
+ var a = typeof e.__u == "function";
204
+ a && e.__u(), a && n == null || (e.__u = e(n));
205
+ } else e.current = n;
206
+ } catch (l) {
207
+ y.__e(l, t);
208
+ }
209
+ }
210
+ function Cn(e, n, t) {
211
+ var a, l;
212
+ if (y.unmount && y.unmount(e), (a = e.ref) && (a.current && a.current != e.__e || Ge(a, null, n)), (a = e.__c) != null) {
213
+ if (a.componentWillUnmount) try {
214
+ a.componentWillUnmount();
215
+ } catch (o) {
216
+ y.__e(o, n);
217
+ }
218
+ a.base = a.__P = a.__n = null;
219
+ }
220
+ if (a = e.__k) for (l = 0; l < a.length; l++) a[l] && Cn(a[l], n, t || typeof e.type != "function");
221
+ t || Ke(e.__e), e.__c = e.__ = e.__e = void 0;
222
+ }
223
+ function at(e, n, t) {
224
+ return this.constructor(e, t);
225
+ }
226
+ function le(e, n, t) {
227
+ var a, l, o, d;
228
+ n == document && (n = document.documentElement), y.__ && y.__(e, n), l = (a = !1) ? null : n.__k, o = [], d = [], Ye(n, e = n.__k = Qn(be, null, [e]), l || Se, Se, n.namespaceURI, l ? null : n.firstChild ? Ne.call(n.childNodes) : null, o, l ? l.__e : n.firstChild, a, d), Nn(o, e, d), e.props.children = null;
229
+ }
230
+ Ne = Te.slice, y = { __e: function(e, n, t, a) {
231
+ for (var l, o, d; n = n.__; ) if ((l = n.__c) && !l.__) try {
232
+ if ((o = l.constructor) && o.getDerivedStateFromError != null && (l.setState(o.getDerivedStateFromError(e)), d = l.__d), l.componentDidCatch != null && (l.componentDidCatch(e, a || {}), d = l.__d), d) return l.__E = l;
233
+ } catch (c) {
234
+ e = c;
235
+ }
236
+ throw e;
237
+ } }, xn = 0, we.prototype.setState = function(e, n) {
238
+ var t;
239
+ t = this.__s != null && this.__s != this.state ? this.__s : this.__s = V({}, this.state), typeof e == "function" && (e = e(V({}, t), this.props)), e && V(t, e), e != null && this.__v && (n && this._sb.push(n), rn(this));
240
+ }, we.prototype.forceUpdate = function(e) {
241
+ this.__v && (this.__e = !0, e && this.__h.push(e), rn(this));
242
+ }, we.prototype.render = be, G = [], yn = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, wn = function(e, n) {
243
+ return e.__v.__b - n.__v.__b;
244
+ }, ze.__r = 0, je = Math.random().toString(8), xe = "__d" + je, de = "__a" + je, kn = /(PointerCapture)$|Capture$/i, Re = 0, Fe = ln(!1), He = ln(!0);
245
+ var rt = 0;
246
+ function r(e, n, t, a, l, o) {
247
+ n || (n = {});
248
+ var d, c, b = n;
249
+ if ("ref" in b) for (c in b = {}, n) c == "ref" ? d = n[c] : b[c] = n[c];
250
+ var s = { type: e, props: b, key: t, ref: d, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --rt, __i: -1, __u: 0, __source: l, __self: o };
251
+ if (typeof e == "function" && (d = e.defaultProps)) for (c in d) b[c] === void 0 && (b[c] = d[c]);
252
+ return y.vnode && y.vnode(s), s;
253
+ }
254
+ var ce, T, qe, sn, pe = 0, Pn = [], z = y, dn = z.__b, cn = z.__r, pn = z.diffed, _n = z.__c, un = z.unmount, bn = z.__;
255
+ function Je(e, n) {
256
+ z.__h && z.__h(T, e, pe || n), pe = 0;
257
+ var t = T.__H || (T.__H = { __: [], __h: [] });
258
+ return e >= t.__.length && t.__.push({}), t.__[e];
259
+ }
260
+ function N(e) {
261
+ return pe = 1, ot($n, e);
262
+ }
263
+ function ot(e, n, t) {
264
+ var a = Je(ce++, 2);
265
+ if (a.t = e, !a.__c && (a.__ = [$n(void 0, n), function(c) {
266
+ var b = a.__N ? a.__N[0] : a.__[0], s = a.t(b, c);
267
+ b !== s && (a.__N = [s, a.__[1]], a.__c.setState({}));
268
+ }], a.__c = T, !T.__f)) {
269
+ var l = function(c, b, s) {
270
+ if (!a.__c.__H) return !0;
271
+ var u = !1, f = a.__c.props !== c;
272
+ if (a.__c.__H.__.some(function(_) {
273
+ if (_.__N) {
274
+ u = !0;
275
+ var v = _.__[0];
276
+ _.__ = _.__N, _.__N = void 0, v !== _.__[0] && (f = !0);
277
+ }
278
+ }), o) {
279
+ var i = o.call(this, c, b, s);
280
+ return u ? i || f : i;
281
+ }
282
+ return !u || f;
283
+ };
284
+ T.__f = !0;
285
+ var o = T.shouldComponentUpdate, d = T.componentWillUpdate;
286
+ T.componentWillUpdate = function(c, b, s) {
287
+ if (this.__e) {
288
+ var u = o;
289
+ o = void 0, l(c, b, s), o = u;
290
+ }
291
+ d && d.call(this, c, b, s);
292
+ }, T.shouldComponentUpdate = l;
293
+ }
294
+ return a.__N || a.__;
295
+ }
296
+ function ke(e, n) {
297
+ var t = Je(ce++, 3);
298
+ !z.__s && Dn(t.__H, n) && (t.__ = e, t.u = n, T.__H.__h.push(t));
299
+ }
300
+ function hn(e) {
301
+ return pe = 5, _e(function() {
302
+ return { current: e };
303
+ }, []);
304
+ }
305
+ function _e(e, n) {
306
+ var t = Je(ce++, 7);
307
+ return Dn(t.__H, n) && (t.__ = e(), t.__H = n, t.__h = e), t.__;
308
+ }
309
+ function it(e, n) {
310
+ return pe = 8, _e(function() {
311
+ return e;
312
+ }, n);
313
+ }
314
+ function lt() {
315
+ for (var e; e = Pn.shift(); ) {
316
+ var n = e.__H;
317
+ if (e.__P && n) try {
318
+ n.__h.some(Me), n.__h.some(Be), n.__h = [];
319
+ } catch (t) {
320
+ n.__h = [], z.__e(t, e.__v);
321
+ }
322
+ }
323
+ }
324
+ z.__b = function(e) {
325
+ T = null, dn && dn(e);
326
+ }, z.__ = function(e, n) {
327
+ e && n.__k && n.__k.__m && (e.__m = n.__k.__m), bn && bn(e, n);
328
+ }, z.__r = function(e) {
329
+ cn && cn(e), ce = 0;
330
+ var n = (T = e.__c).__H;
331
+ n && (qe === T ? (n.__h = [], T.__h = [], n.__.some(function(t) {
332
+ t.__N && (t.__ = t.__N), t.u = t.__N = void 0;
333
+ })) : (n.__h.some(Me), n.__h.some(Be), n.__h = [], ce = 0)), qe = T;
334
+ }, z.diffed = function(e) {
335
+ pn && pn(e);
336
+ var n = e.__c;
337
+ n && n.__H && (n.__H.__h.length && (Pn.push(n) !== 1 && sn === z.requestAnimationFrame || ((sn = z.requestAnimationFrame) || st)(lt)), n.__H.__.some(function(t) {
338
+ t.u && (t.__H = t.u, t.u = void 0);
339
+ })), qe = T = null;
340
+ }, z.__c = function(e, n) {
341
+ n.some(function(t) {
342
+ try {
343
+ t.__h.some(Me), t.__h = t.__h.filter(function(a) {
344
+ return !a.__ || Be(a);
345
+ });
346
+ } catch (a) {
347
+ n.some(function(l) {
348
+ l.__h && (l.__h = []);
349
+ }), n = [], z.__e(a, t.__v);
350
+ }
351
+ }), _n && _n(e, n);
352
+ }, z.unmount = function(e) {
353
+ un && un(e);
354
+ var n, t = e.__c;
355
+ t && t.__H && (t.__H.__.some(function(a) {
356
+ try {
357
+ Me(a);
358
+ } catch (l) {
359
+ n = l;
360
+ }
361
+ }), t.__H = void 0, n && z.__e(n, t.__v));
362
+ };
363
+ var fn = typeof requestAnimationFrame == "function";
364
+ function st(e) {
365
+ var n, t = function() {
366
+ clearTimeout(a), fn && cancelAnimationFrame(n), setTimeout(e);
367
+ }, a = setTimeout(t, 35);
368
+ fn && (n = requestAnimationFrame(t));
369
+ }
370
+ function Me(e) {
371
+ var n = T, t = e.__c;
372
+ typeof t == "function" && (e.__c = void 0, t()), T = n;
373
+ }
374
+ function Be(e) {
375
+ var n = T;
376
+ e.__c = e.__(), T = n;
377
+ }
378
+ function Dn(e, n) {
379
+ return !e || e.length !== n.length || n.some(function(t, a) {
380
+ return t !== e[a];
381
+ });
382
+ }
383
+ function $n(e, n) {
384
+ return typeof n == "function" ? n(e) : n;
385
+ }
386
+ const dt = ["en", "nl", "de"], gn = {
387
+ "board.title": { en: "Feedback", nl: "Feedback", de: "Feedback" },
388
+ "board.open": { en: "Feedback", nl: "Feedback", de: "Feedback" },
389
+ "board.close": { en: "Close", nl: "Sluiten", de: "Schließen" },
390
+ "board.back": { en: "Back", nl: "Terug", de: "Zurück" },
391
+ "board.top": { en: "Top", nl: "Top", de: "Top" },
392
+ "board.new": { en: "New", nl: "Nieuw", de: "Neu" },
393
+ "board.order": { en: "Order", nl: "Volgorde", de: "Reihenfolge" },
394
+ "board.all": { en: "All", nl: "Alles", de: "Alles" },
395
+ "board.bugs": { en: "Bugs", nl: "Bugs", de: "Bugs" },
396
+ "board.ideas": { en: "Ideas", nl: "Ideeën", de: "Ideen" },
397
+ "board.kindBug": { en: "Bug", nl: "Bug", de: "Bug" },
398
+ "board.kindIdea": { en: "Idea", nl: "Idee", de: "Idee" },
399
+ "board.statusOpen": { en: "Open", nl: "Open", de: "Offen" },
400
+ "board.statusPlanned": { en: "Planned", nl: "Gepland", de: "Geplant" },
401
+ "board.statusDone": { en: "Done", nl: "Klaar", de: "Fertig" },
402
+ "board.statusDeclined": { en: "Not doing", nl: "Doen we niet", de: "Machen wir nicht" },
403
+ "board.anon": { en: "Anonymous", nl: "Anoniem", de: "Anonym" },
404
+ "board.byYou": { en: "You", nl: "Jij", de: "Du" },
405
+ // Named rather than "the owner": a board that answers in the third person
406
+ // reads like a support desk.
407
+ "board.reply": { en: "{app} says", nl: "{app} zegt", de: "{app} sagt" },
408
+ "board.upvote": { en: "I want this too", nl: "Dit wil ik ook", de: "Will ich auch" },
409
+ "board.emptyTitle": {
410
+ en: "Nothing here yet. Tell us what is broken or what you miss.",
411
+ nl: "Hier staat nog niets. Vertel wat er stuk is of wat je mist.",
412
+ de: "Hier steht noch nichts. Sag uns, was kaputt ist oder was dir fehlt."
413
+ },
414
+ "board.emptyFiltered": {
415
+ en: "Nothing of that kind yet.",
416
+ nl: "Nog niets van deze soort.",
417
+ de: "Von dieser Sorte noch nichts."
418
+ },
419
+ "board.write": { en: "Write feedback", nl: "Feedback schrijven", de: "Feedback schreiben" },
420
+ "board.loadFailed": {
421
+ en: "Could not reach the board.",
422
+ nl: "Kon het bord niet bereiken.",
423
+ de: "Das Board war nicht erreichbar."
424
+ },
425
+ "board.retry": { en: "Try again", nl: "Opnieuw", de: "Nochmal" },
426
+ "board.page": { en: "Page {n}", nl: "Pagina {n}", de: "Seite {n}" },
427
+ "board.signIn": {
428
+ en: "Sign in with your wallet",
429
+ nl: "Inloggen met je wallet",
430
+ de: "Mit deiner Wallet anmelden"
431
+ },
432
+ // Reading works anywhere; writing needs a wallet. Said when somebody tries,
433
+ // not up front, so a reader is never told off for reading.
434
+ "board.needWallet": {
435
+ en: "Open {app} in Nimiq Pay to post and vote.",
436
+ nl: "Open {app} in Nimiq Pay om te posten en te stemmen.",
437
+ de: "Öffne {app} in Nimiq Pay, um zu posten und abzustimmen."
438
+ },
439
+ // ---- Writing one ----
440
+ "board.composeTitle": { en: "Your feedback", nl: "Jouw feedback", de: "Dein Feedback" },
441
+ "board.whatKind": { en: "What is it?", nl: "Wat is het?", de: "Was ist es?" },
442
+ "board.placeholder": {
443
+ en: "What is broken, or what do you miss?",
444
+ nl: "Wat is er stuk, of wat mis je?",
445
+ de: "Was ist kaputt, oder was fehlt dir?"
446
+ },
447
+ "board.public": {
448
+ en: "Everybody using {app} can read this.",
449
+ nl: "Iedereen die {app} gebruikt kan dit lezen.",
450
+ de: "Jeder, der {app} nutzt, kann das lesen."
451
+ },
452
+ "board.showName": { en: "Show my name", nl: "Mijn naam tonen", de: "Meinen Namen zeigen" },
453
+ "board.namePlaceholder": { en: "Your name", nl: "Je naam", de: "Dein Name" },
454
+ // The honest version. Anonymous means the name is not shown, never that the
455
+ // wallet is not known: the daily limit and one vote per wallet both have to
456
+ // ask who.
457
+ "board.anonNote": {
458
+ en: "Nobody on the board sees who wrote it, and your wallet address is never shown. The server does know your wallet: votes and the daily limit are counted per wallet.",
459
+ nl: "Niemand op het bord ziet wie het schreef, en je wallet-adres wordt nooit getoond. De server kent je wallet wel: stemmen en de daglimiet tellen per wallet.",
460
+ de: "Niemand auf dem Board sieht, wer es geschrieben hat, und deine Wallet-Adresse wird nie gezeigt. Der Server kennt deine Wallet schon: Stimmen und das Tageslimit zählen pro Wallet."
461
+ },
462
+ "board.send": { en: "Put it on the board", nl: "Op het bord zetten", de: "Aufs Board setzen" },
463
+ "board.left": {
464
+ en: "{n} of {max} left today",
465
+ nl: "Nog {n} van {max} vandaag",
466
+ de: "Noch {n} von {max} heute"
467
+ },
468
+ "board.noneLeft": {
469
+ en: "That is today’s {max}. Back tomorrow.",
470
+ nl: "Dat waren de {max} van vandaag. Morgen weer.",
471
+ de: "Das waren die {max} für heute. Morgen wieder."
472
+ },
473
+ "board.likeThis": {
474
+ en: "Said already, maybe?",
475
+ nl: "Misschien al gezegd?",
476
+ de: "Vielleicht schon gesagt?"
477
+ },
478
+ "board.likeThisNote": {
479
+ en: "Back one of these instead and it counts for more.",
480
+ nl: "Steun er liever een van deze, dan telt het zwaarder.",
481
+ de: "Unterstütz lieber eins davon, dann zählt es mehr."
482
+ },
483
+ // Two ways a post can be refused, because the answer to one is "go again"
484
+ // and the answer to the other is "come back tomorrow".
485
+ "board.failed": {
486
+ en: "That did not go through. Try again.",
487
+ nl: "Dat ging niet door. Probeer het opnieuw.",
488
+ de: "Das ist nicht durchgegangen. Versuch es noch mal."
489
+ },
490
+ "board.failedFull": {
491
+ en: "Not posted: that was today’s {max}. Back tomorrow.",
492
+ nl: "Niet geplaatst: dat waren de {max} van vandaag. Morgen weer.",
493
+ de: "Nicht gepostet: das waren die {max} für heute. Morgen wieder."
494
+ },
495
+ "board.sent": { en: "Feedback sent!", nl: "Feedback verstuurd!", de: "Feedback gesendet!" },
496
+ // ---- Throwing your own away ----
497
+ "board.delete": { en: "Throw away", nl: "Weggooien", de: "Wegwerfen" },
498
+ "board.deleteTitle": { en: "Throw this away?", nl: "Deze weggooien?", de: "Das hier wegwerfen?" },
499
+ "board.deleteNote": {
500
+ en: "It leaves the board for everybody, with its votes.",
501
+ nl: "Hij gaat voor iedereen van het bord, met stemmen en al.",
502
+ de: "Es verschwindet für alle vom Board, samt Stimmen."
503
+ },
504
+ "board.cancel": { en: "Cancel", nl: "Annuleren", de: "Abbrechen" },
505
+ // ---- Answering one (owners only) ----
506
+ "board.manage": { en: "Answer this", nl: "Hier antwoord op geven", de: "Darauf antworten" },
507
+ "board.setStatus": { en: "Where it stands", nl: "Waar het staat", de: "Wo es steht" },
508
+ "board.replyLabel": { en: "Your answer", nl: "Jouw antwoord", de: "Deine Antwort" },
509
+ "board.replyPlaceholder": { en: "Say something back", nl: "Zeg er iets over", de: "Sag was dazu" },
510
+ "board.hide": { en: "Take off the board", nl: "Van het bord halen", de: "Vom Board nehmen" },
511
+ "board.unhide": { en: "Put it back", nl: "Terugzetten", de: "Zurückstellen" },
512
+ "board.hidden": { en: "Off the board", nl: "Van het bord", de: "Vom Board" },
513
+ "board.save": { en: "Save", nl: "Opslaan", de: "Speichern" },
514
+ "board.context": { en: "Sent with", nl: "Meegestuurd", de: "Mitgeschickt" },
515
+ // ---- When ----
516
+ "time.now": { en: "just now", nl: "zojuist", de: "gerade eben" },
517
+ "time.min": { en: "{n}m ago", nl: "{n}m geleden", de: "vor {n} Min." },
518
+ "time.hour": { en: "{n}h ago", nl: "{n}u geleden", de: "vor {n} Std." },
519
+ "time.day": { en: "{n}d ago", nl: "{n}d geleden", de: "vor {n} Tg." }
520
+ };
521
+ function ct(e) {
522
+ const n = [
523
+ e,
524
+ typeof window < "u" ? window.nimiqPay?.language : void 0,
525
+ typeof document < "u" ? document.documentElement.lang : void 0,
526
+ typeof navigator < "u" ? navigator.language : void 0
527
+ ];
528
+ for (const t of n)
529
+ if (t) return t.slice(0, 2).toLowerCase();
530
+ return "en";
531
+ }
532
+ function pt(e, n = {}) {
533
+ const t = dt.includes(e) ? e : "en";
534
+ return (a, l) => {
535
+ let o = n[a] ?? gn[a][t] ?? gn[a].en;
536
+ if (l) for (const [d, c] of Object.entries(l)) o = o.split(`{${d}}`).join(String(c));
537
+ return o;
538
+ };
539
+ }
540
+ const We = 6e4, Ue = 60 * We, Oe = 24 * Ue, _t = 7 * Oe, mn = /* @__PURE__ */ new Map();
541
+ function ut(e, n, t = Date.now()) {
542
+ const a = Math.max(0, t - e);
543
+ if (a >= _t) {
544
+ let l = mn.get(n);
545
+ return l || (l = new Intl.DateTimeFormat(n, { day: "numeric", month: "short" }), mn.set(n, l)), { date: l.format(new Date(e)).replace(".", "") };
546
+ }
547
+ return a < We ? { key: "time.now", vars: { n: "0" } } : a < Ue ? { key: "time.min", vars: { n: String(Math.floor(a / We)) } } : a < Oe ? { key: "time.hour", vars: { n: String(Math.floor(a / Ue)) } } : { key: "time.day", vars: { n: String(Math.floor(a / Oe)) } };
548
+ }
549
+ const W = (e, n, t = !1) => /* @__PURE__ */ r(
550
+ "svg",
551
+ {
552
+ width: e,
553
+ height: e,
554
+ viewBox: "0 0 24 24",
555
+ fill: t ? "currentColor" : "none",
556
+ stroke: t ? "none" : "currentColor",
557
+ "stroke-width": "2.25",
558
+ "stroke-linecap": "round",
559
+ "stroke-linejoin": "round",
560
+ "aria-hidden": "true",
561
+ children: n
562
+ }
563
+ ), bt = ({ size: e = 22 }) => W(e, /* @__PURE__ */ r("path", { d: "M15 5l-7 7 7 7" })), ht = ({ size: e = 22 }) => W(e, /* @__PURE__ */ r("path", { d: "M6 6l12 12M18 6L6 18" })), ft = ({ size: e = 20 }) => W(e, /* @__PURE__ */ r("path", { d: "M12 5v14M5 12h14" })), gt = ({ size: e = 18 }) => W(e, /* @__PURE__ */ r("path", { d: "M4 7h16M9 7V4.5h6V7M6.5 7l1 12.5h9l1-12.5M10 11v5M14 11v5" })), mt = ({ size: e = 14 }) => W(e, /* @__PURE__ */ r("path", { d: "M12 6.5l7.2 9a1 1 0 0 1-.78 1.6H5.58a1 1 0 0 1-.78-1.6L12 6.5z" }), !0), vt = ({ size: e = 20 }) => W(e, /* @__PURE__ */ r("path", { d: "M4 5.5h16v10H9l-5 4v-14z" })), xt = ({ size: e = 12 }) => W(e, /* @__PURE__ */ r("path", { d: "M8 9h8v5a4 4 0 0 1-8 0V9zM9.5 9a2.5 2.5 0 0 1 5 0M4 12h4M16 12h4M5 7l3 2M19 7l-3 2M5 18l3-2M19 18l-3-2" })), yt = ({ size: e = 12 }) => W(e, /* @__PURE__ */ r("path", { d: "M9 18h6M10 21h4M12 3a6 6 0 0 0-3.5 10.9V16h7v-2.1A6 6 0 0 0 12 3z" })), wt = ({ size: e = 12 }) => W(e, /* @__PURE__ */ r("path", { d: "M12 7v5l3 2M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18z" })), kt = ({ size: e = 12 }) => W(e, /* @__PURE__ */ r("path", { d: "M5 12.5l4.5 4.5L19 7.5" })), Mt = ({ size: e = 12 }) => W(e, /* @__PURE__ */ r("path", { d: "M7 7l10 10M17 7L7 17" })), se = {
564
+ bug: { icon: () => /* @__PURE__ */ r(xt, {}), label: "board.kindBug" },
565
+ idea: { icon: () => /* @__PURE__ */ r(yt, {}), label: "board.kindIdea" }
566
+ }, St = {
567
+ planned: { icon: () => /* @__PURE__ */ r(wt, {}), label: "board.statusPlanned" },
568
+ done: { icon: () => /* @__PURE__ */ r(kt, {}), label: "board.statusDone" },
569
+ declined: { icon: () => /* @__PURE__ */ r(Mt, {}), label: "board.statusDeclined" }
570
+ };
571
+ function vn({ tone: e, icon: n, label: t }) {
572
+ return /* @__PURE__ */ r("span", { class: "badge", children: [
573
+ /* @__PURE__ */ r("span", { class: `badge__dot badge__dot--${e}`, children: n() }),
574
+ t
575
+ ] });
576
+ }
577
+ function En({
578
+ votes: e,
579
+ voted: n,
580
+ onVote: t,
581
+ t: a
582
+ }) {
583
+ return /* @__PURE__ */ r(
584
+ "button",
585
+ {
586
+ type: "button",
587
+ class: "vote",
588
+ "aria-label": a("board.upvote"),
589
+ "aria-pressed": n,
590
+ onClick: (l) => {
591
+ l.stopPropagation(), t(!n);
592
+ },
593
+ children: [
594
+ /* @__PURE__ */ r(mt, {}),
595
+ /* @__PURE__ */ r("span", { children: e })
596
+ ]
597
+ }
598
+ );
599
+ }
600
+ function Tt({
601
+ post: e,
602
+ appName: n,
603
+ t,
604
+ locale: a,
605
+ onVote: l,
606
+ onDelete: o,
607
+ onManage: d
608
+ }) {
609
+ const c = se[e.kind], b = St[e.status], s = ut(e.at, a);
610
+ return /* @__PURE__ */ r(
611
+ "li",
612
+ {
613
+ class: `card${d ? " card--owner" : ""}${e.hidden ? " card--hidden" : ""}`,
614
+ onClick: d,
615
+ role: d ? "button" : void 0,
616
+ tabIndex: d ? 0 : void 0,
617
+ "aria-label": d ? t("board.manage") : void 0,
618
+ onKeyDown: d ? (u) => {
619
+ u.target === u.currentTarget && (u.key === "Enter" || u.key === " ") && (u.preventDefault(), d());
620
+ } : void 0,
621
+ children: [
622
+ /* @__PURE__ */ r("div", { class: "card__head", children: [
623
+ /* @__PURE__ */ r(vn, { tone: e.kind, icon: c.icon, label: t(c.label) }),
624
+ b && /* @__PURE__ */ r(vn, { tone: e.status, icon: b.icon, label: t(b.label) }),
625
+ e.hidden && /* @__PURE__ */ r("span", { class: "card__off", children: t("board.hidden") }),
626
+ /* @__PURE__ */ r("span", { class: "card__when", children: "date" in s ? s.date : t(s.key, s.vars) })
627
+ ] }),
628
+ /* @__PURE__ */ r("p", { class: "card__text", children: e.text }),
629
+ e.reply && /* @__PURE__ */ r("div", { class: "card__reply", children: [
630
+ /* @__PURE__ */ r("span", { class: "card__reply-who", children: t("board.reply", { app: n }) }),
631
+ /* @__PURE__ */ r("p", { class: "card__reply-text", children: e.reply.text })
632
+ ] }),
633
+ /* @__PURE__ */ r("div", { class: "card__foot", children: [
634
+ /* @__PURE__ */ r("span", { class: "card__who", children: e.mine ? t("board.byYou") : e.who ?? t("board.anon") }),
635
+ o && /* @__PURE__ */ r(
636
+ "button",
637
+ {
638
+ type: "button",
639
+ class: "icon-btn card__bin",
640
+ "aria-label": t("board.delete"),
641
+ onClick: (u) => {
642
+ u.stopPropagation(), o();
643
+ },
644
+ children: /* @__PURE__ */ r(gt, {})
645
+ }
646
+ ),
647
+ /* @__PURE__ */ r(En, { votes: e.votes, voted: e.voted, onVote: l, t })
648
+ ] })
649
+ ]
650
+ }
651
+ );
652
+ }
653
+ function zt({
654
+ t: e,
655
+ kinds: n,
656
+ posts: t,
657
+ likeThis: a,
658
+ left: l,
659
+ perDay: o,
660
+ textMax: d,
661
+ name: c,
662
+ appName: b,
663
+ onVote: s,
664
+ onSend: u
665
+ }) {
666
+ const [f, i] = N(n[0]), [_, v] = N(""), [M, S] = N(!1), [x, h] = N(c), [P, L] = N(!1), [A, D] = N(null), I = _e(() => a(t, _), [t, _, a]), F = _.trim(), R = l !== null && l <= 0, $ = M && !x.trim(), j = async () => {
667
+ L(!0), D(null);
668
+ const g = await u({ kind: f, text: F, anon: !M, name: x.trim() });
669
+ g && (D(g.key ? { key: g.key, vars: g.vars } : null), L(!1));
670
+ };
671
+ return /* @__PURE__ */ r("div", { class: "compose", children: [
672
+ n.length > 1 && /* @__PURE__ */ r(be, { children: [
673
+ /* @__PURE__ */ r("span", { class: "label", children: e("board.whatKind") }),
674
+ /* @__PURE__ */ r("div", { class: "kinds", role: "radiogroup", "aria-label": e("board.whatKind"), children: n.map((g) => /* @__PURE__ */ r(
675
+ "button",
676
+ {
677
+ type: "button",
678
+ role: "radio",
679
+ "aria-checked": f === g,
680
+ class: "chip-pick",
681
+ onClick: () => i(g),
682
+ children: [
683
+ /* @__PURE__ */ r("span", { class: `badge__dot badge__dot--${g}`, children: se[g].icon() }),
684
+ e(se[g].label)
685
+ ]
686
+ },
687
+ g
688
+ )) })
689
+ ] }),
690
+ /* @__PURE__ */ r("p", { class: "public", children: e("board.public", { app: b }) }),
691
+ /* @__PURE__ */ r(
692
+ "textarea",
693
+ {
694
+ class: "field",
695
+ value: _,
696
+ maxLength: d,
697
+ placeholder: e("board.placeholder"),
698
+ "aria-label": e("board.placeholder"),
699
+ onInput: (g) => {
700
+ v(g.target.value), D(null);
701
+ }
702
+ }
703
+ ),
704
+ /* @__PURE__ */ r("span", { class: "count", children: d - _.length }),
705
+ I.length > 0 && /* @__PURE__ */ r("div", { class: "alike", children: [
706
+ /* @__PURE__ */ r("span", { class: "label", children: e("board.likeThis") }),
707
+ /* @__PURE__ */ r("p", { class: "alike__note", children: e("board.likeThisNote") }),
708
+ /* @__PURE__ */ r("ul", { class: "alike__list", children: I.map((g) => /* @__PURE__ */ r("li", { class: "alike__row", children: [
709
+ /* @__PURE__ */ r("span", { class: `badge__dot badge__dot--${g.kind}`, "aria-label": e(se[g.kind].label), children: se[g.kind].icon() }),
710
+ /* @__PURE__ */ r("span", { class: "alike__text", children: g.text }),
711
+ /* @__PURE__ */ r(En, { votes: g.votes, voted: g.voted, onVote: (Ce) => s(g.id, Ce), t: e })
712
+ ] }, g.id)) })
713
+ ] }),
714
+ /* @__PURE__ */ r("div", { class: "switch-row", children: [
715
+ /* @__PURE__ */ r("span", { class: "switch-row__label", id: "pnb-show-name", children: e("board.showName") }),
716
+ /* @__PURE__ */ r(
717
+ "button",
718
+ {
719
+ type: "button",
720
+ role: "switch",
721
+ class: "switch",
722
+ "aria-checked": M,
723
+ "aria-labelledby": "pnb-show-name",
724
+ onClick: () => S(!M)
725
+ }
726
+ )
727
+ ] }),
728
+ M && /* @__PURE__ */ r(
729
+ "input",
730
+ {
731
+ class: "input",
732
+ value: x,
733
+ maxLength: Jn,
734
+ placeholder: e("board.namePlaceholder"),
735
+ "aria-label": e("board.namePlaceholder"),
736
+ onInput: (g) => h(g.target.value)
737
+ }
738
+ ),
739
+ /* @__PURE__ */ r("p", { class: "note", children: e("board.anonNote") }),
740
+ /* @__PURE__ */ r("div", { class: "send", children: [
741
+ /* @__PURE__ */ r(
742
+ "button",
743
+ {
744
+ type: "button",
745
+ class: "btn",
746
+ disabled: !F || R || P || $,
747
+ "aria-busy": P,
748
+ onClick: () => void j(),
749
+ children: P ? /* @__PURE__ */ r("span", { class: "spinner" }) : e("board.send")
750
+ }
751
+ ),
752
+ /* @__PURE__ */ r("span", { class: `left${A ? " left--bad" : ""}`, role: "status", children: A ? e(A.key, A.vars) : l === null ? "" : R ? e("board.noneLeft", { max: o }) : e("board.left", { n: l, max: o }) })
753
+ ] })
754
+ ] });
755
+ }
756
+ function Ln({
757
+ label: e,
758
+ onClose: n,
759
+ children: t
760
+ }) {
761
+ return ke(() => {
762
+ const a = (l) => {
763
+ l.key === "Escape" && n();
764
+ };
765
+ return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
766
+ }, [n]), /* @__PURE__ */ r("div", { class: "scrim", onClick: n, children: /* @__PURE__ */ r("div", { class: "sheet", role: "dialog", "aria-modal": "true", "aria-label": e, onClick: (a) => a.stopPropagation(), children: t }) });
767
+ }
768
+ function Nt({ t: e, onConfirm: n, onClose: t }) {
769
+ return /* @__PURE__ */ r(Ln, { label: e("board.deleteTitle"), onClose: t, children: [
770
+ /* @__PURE__ */ r("h2", { class: "sheet__title", children: e("board.deleteTitle") }),
771
+ /* @__PURE__ */ r("p", { class: "sheet__quote", children: e("board.deleteNote") }),
772
+ /* @__PURE__ */ r("div", { class: "sheet__actions", children: [
773
+ /* @__PURE__ */ r("button", { type: "button", class: "btn btn--danger", onClick: n, children: e("board.delete") }),
774
+ /* @__PURE__ */ r("button", { type: "button", class: "text-btn", onClick: t, children: e("board.cancel") })
775
+ ] })
776
+ ] });
777
+ }
778
+ const At = [
779
+ { status: "open", label: "board.statusOpen" },
780
+ { status: "planned", label: "board.statusPlanned" },
781
+ { status: "done", label: "board.statusDone" },
782
+ { status: "declined", label: "board.statusDeclined" }
783
+ ];
784
+ function Ct({
785
+ t: e,
786
+ post: n,
787
+ replyMax: t,
788
+ onSave: a,
789
+ onClose: l
790
+ }) {
791
+ const [o, d] = N(n.status), [c, b] = N(n.reply?.text ?? ""), [s, u] = N(!!n.hidden), f = n.context ? Object.entries(n.context) : [];
792
+ return /* @__PURE__ */ r(Ln, { label: e("board.manage"), onClose: l, children: [
793
+ /* @__PURE__ */ r("h2", { class: "sheet__title", children: e("board.manage") }),
794
+ /* @__PURE__ */ r("p", { class: "sheet__quote", children: n.text }),
795
+ f.length > 0 && /* @__PURE__ */ r("dl", { class: "context", "aria-label": e("board.context"), children: f.map(([i, _]) => /* @__PURE__ */ r("div", { children: [
796
+ /* @__PURE__ */ r("dt", { children: i }),
797
+ /* @__PURE__ */ r("dd", { children: _ })
798
+ ] }, i)) }),
799
+ /* @__PURE__ */ r("span", { class: "label", style: { display: "block", marginTop: "20px", marginBottom: "8px" }, children: e("board.setStatus") }),
800
+ /* @__PURE__ */ r("div", { class: "states", role: "radiogroup", "aria-label": e("board.setStatus"), children: At.map((i) => /* @__PURE__ */ r(
801
+ "button",
802
+ {
803
+ type: "button",
804
+ role: "radio",
805
+ "aria-checked": o === i.status,
806
+ class: "chip-pick",
807
+ onClick: () => d(i.status),
808
+ children: e(i.label)
809
+ },
810
+ i.status
811
+ )) }),
812
+ /* @__PURE__ */ r("span", { class: "label", style: { display: "block", marginTop: "20px", marginBottom: "8px" }, children: e("board.replyLabel") }),
813
+ /* @__PURE__ */ r(
814
+ "textarea",
815
+ {
816
+ class: "field",
817
+ style: { minHeight: "96px" },
818
+ value: c,
819
+ maxLength: t,
820
+ placeholder: e("board.replyPlaceholder"),
821
+ "aria-label": e("board.replyLabel"),
822
+ onInput: (i) => b(i.target.value)
823
+ }
824
+ ),
825
+ /* @__PURE__ */ r("button", { type: "button", class: "hide-btn", "aria-pressed": s, onClick: () => u(!s), children: e(s ? "board.unhide" : "board.hide") }),
826
+ /* @__PURE__ */ r("div", { class: "sheet__actions", children: /* @__PURE__ */ r("button", { type: "button", class: "btn", onClick: () => a({ status: o, reply: c.trim(), hidden: s }), children: e("board.save") }) })
827
+ ] });
828
+ }
829
+ const Ie = 15, Pt = 2600;
830
+ function jn({ client: e, t: n, locale: t, appName: a, suggestName: l, context: o, noise: d, onClose: c, onPosted: b }) {
831
+ const [s, u] = N(null), [f, i] = N(!1), [_, v] = N("board"), [M, S] = N("top"), [x, h] = N("all"), [P, L] = N(1), [A, D] = N(null), [I, F] = N(null), [R, $] = N(!1), j = hn(null), g = (d ?? []).join("|"), Ce = _e(() => Kn(g ? g.split("|") : []), [g]), Ze = hn(!1), U = it(async () => {
832
+ const p = await e.board();
833
+ p.ok ? (Ze.current = !0, u(p.data), i(!1)) : Ze.current || i(!0);
834
+ }, [e]);
835
+ ke(() => {
836
+ U();
837
+ }, [U]), ke(() => {
838
+ if (!I) return;
839
+ const p = setTimeout(() => F(null), Pt);
840
+ return () => clearTimeout(p);
841
+ }, [I]), ke(() => {
842
+ const p = j.current;
843
+ if (!p) return;
844
+ let m = p.scrollTop, w = 0;
845
+ const C = () => {
846
+ const ie = p.scrollTop, Ee = ie - m;
847
+ if (m = ie, ie < 48) {
848
+ w = 0, $(!1);
849
+ return;
850
+ }
851
+ w = Math.sign(Ee) === Math.sign(w) ? w + Ee : Ee, w > 24 ? $(!0) : w < -8 && $(!1);
852
+ };
853
+ return p.addEventListener("scroll", C, { passive: !0 }), () => p.removeEventListener("scroll", C);
854
+ }, [_, s]);
855
+ const he = a ?? s?.project.name ?? "", K = s?.project.rules, fe = !!s?.me?.owner, oe = s?.posts ?? [], Qe = _e(() => {
856
+ const p = oe.filter((m) => fe || !m.hidden);
857
+ return Rn(x === "all" ? p : p.filter((m) => m.kind === x), M);
858
+ }, [oe, x, M, fe]), Pe = Math.max(1, Math.ceil(Qe.length / Ie)), De = Math.min(P, Pe), Xe = Qe.slice((De - 1) * Ie, De * Ie), ge = (p, m) => u((w) => w && { ...w, posts: w.posts.map((C) => C.id === p ? { ...C, ...m } : C) }), me = (p) => {
859
+ p === "no_signer" ? F(n("board.needWallet", { app: he })) : p !== "declined" && F(n("board.failed"));
860
+ }, en = async (p, m) => {
861
+ const w = oe.find((ie) => ie.id === p);
862
+ if (!w) return;
863
+ ge(p, { votes: Math.max(0, w.votes + (m ? 1 : -1)), voted: m });
864
+ const C = await e.vote(p, m);
865
+ C.ok ? (ge(p, { votes: C.data.votes, voted: C.data.voted }), s?.me || U()) : (ge(p, { votes: w.votes, voted: w.voted }), me(C.error));
866
+ }, Hn = async (p) => {
867
+ const m = Dt(), w = p.kind === "bug" ? { ...o, host: Yn() ? "nimiq-pay" : "browser" } : void 0, C = await e.post({ id: m, kind: p.kind, text: p.text, anon: p.anon, context: w });
868
+ return C.ok ? (!p.anon && p.name && p.name !== s?.me?.name && await e.setName(p.name), v("board"), S("new"), h("all"), L(1), F(n("board.sent")), b?.({ id: m, kind: p.kind }), await U(), null) : C.error === "declined" ? { key: null } : C.error === "no_signer" ? { key: "board.needWallet", vars: { app: he } } : C.error === "too_many" ? (U(), { key: "board.failedFull", vars: { max: K?.perDay ?? 5 } }) : { key: "board.failed" };
869
+ }, Bn = async () => {
870
+ const p = await e.signIn();
871
+ p.ok ? await U() : me(p.error);
872
+ }, Wn = async (p) => {
873
+ D(null), u((w) => w && { ...w, posts: w.posts.filter((C) => C.id !== p.id) });
874
+ const m = await e.remove(p.id);
875
+ m.ok || me(m.error), U();
876
+ }, Un = async (p, m) => {
877
+ D(null), ge(p.id, {
878
+ status: m.status,
879
+ hidden: m.hidden || void 0,
880
+ reply: m.reply ? { text: m.reply, at: Date.now() } : void 0
881
+ });
882
+ const w = await e.manage(p.id, m);
883
+ w.ok || me(w.error), U();
884
+ }, $e = K?.kinds ?? ["bug", "idea"];
885
+ return _ === "compose" && K ? /* @__PURE__ */ r("div", { class: "app", children: [
886
+ /* @__PURE__ */ r("header", { class: "bar", children: [
887
+ /* @__PURE__ */ r("button", { type: "button", class: "icon-btn", "aria-label": n("board.back"), onClick: () => v("board"), children: /* @__PURE__ */ r(bt, {}) }),
888
+ /* @__PURE__ */ r("h2", { class: "bar__title", children: n("board.composeTitle") }),
889
+ /* @__PURE__ */ r("span", {})
890
+ ] }),
891
+ /* @__PURE__ */ r("div", { class: "scroll", ref: j, style: { paddingBottom: "24px" }, children: /* @__PURE__ */ r(
892
+ zt,
893
+ {
894
+ t: n,
895
+ kinds: $e,
896
+ posts: oe,
897
+ likeThis: Ce,
898
+ left: s?.me ? s.me.left : null,
899
+ perDay: K.perDay,
900
+ textMax: K.textMax,
901
+ name: s?.me?.name ?? l ?? "",
902
+ appName: he,
903
+ onVote: en,
904
+ onSend: Hn
905
+ }
906
+ ) }),
907
+ I && /* @__PURE__ */ r("div", { class: "toast", role: "status", children: I })
908
+ ] }) : /* @__PURE__ */ r("div", { class: "app", children: [
909
+ /* @__PURE__ */ r("header", { class: "bar", children: [
910
+ c ? /* @__PURE__ */ r("button", { type: "button", class: "icon-btn", "aria-label": n("board.close"), onClick: c, children: /* @__PURE__ */ r(ht, {}) }) : /* @__PURE__ */ r("span", {}),
911
+ /* @__PURE__ */ r("h2", { class: "bar__title", children: n("board.title") }),
912
+ /* @__PURE__ */ r(
913
+ "button",
914
+ {
915
+ type: "button",
916
+ class: "icon-btn",
917
+ "aria-label": n("board.write"),
918
+ disabled: !K,
919
+ onClick: () => v("compose"),
920
+ children: /* @__PURE__ */ r(ft, {})
921
+ }
922
+ )
923
+ ] }),
924
+ $e.length > 1 && /* @__PURE__ */ r("div", { class: "filters", children: ["all", ...$e].map((p) => /* @__PURE__ */ r(
925
+ "button",
926
+ {
927
+ type: "button",
928
+ class: "chip-pick",
929
+ "aria-pressed": x === p,
930
+ onClick: () => {
931
+ h(p), L(1);
932
+ },
933
+ children: n(p === "all" ? "board.all" : p === "bug" ? "board.bugs" : "board.ideas")
934
+ },
935
+ p
936
+ )) }),
937
+ /* @__PURE__ */ r("div", { class: "scroll", ref: j, children: [
938
+ f ? /* @__PURE__ */ r("div", { class: "empty", children: [
939
+ /* @__PURE__ */ r("p", { children: n("board.loadFailed") }),
940
+ /* @__PURE__ */ r("button", { type: "button", class: "text-btn", onClick: () => void U(), children: n("board.retry") })
941
+ ] }) : s ? Xe.length === 0 ? /* @__PURE__ */ r("p", { class: "empty", children: n(oe.length === 0 ? "board.emptyTitle" : "board.emptyFiltered") }) : /* @__PURE__ */ r("ul", { class: "list", children: Xe.map((p) => /* @__PURE__ */ r(
942
+ Tt,
943
+ {
944
+ post: p,
945
+ appName: he,
946
+ t: n,
947
+ locale: t,
948
+ onVote: (m) => void en(p.id, m),
949
+ onDelete: p.mine || fe ? () => D({ kind: "delete", post: p }) : void 0,
950
+ onManage: fe ? () => D({ kind: "manage", post: p }) : void 0
951
+ },
952
+ p.id
953
+ )) }) : /* @__PURE__ */ r("div", { class: "empty", "aria-busy": "true", children: /* @__PURE__ */ r("span", { class: "spinner", style: { display: "inline-block" } }) }),
954
+ Pe > 1 && /* @__PURE__ */ r("nav", { class: "pager", children: Array.from({ length: Pe }, (p, m) => m + 1).map((p) => /* @__PURE__ */ r(
955
+ "button",
956
+ {
957
+ type: "button",
958
+ "aria-current": p === De ? "page" : void 0,
959
+ "aria-label": n("board.page", { n: p }),
960
+ onClick: () => {
961
+ L(p), j.current?.scrollTo({ top: 0 });
962
+ },
963
+ children: p
964
+ },
965
+ p
966
+ )) }),
967
+ s && !s.me && e.canSign && /* @__PURE__ */ r("div", { class: "sign-in", children: /* @__PURE__ */ r("button", { type: "button", class: "text-btn", onClick: () => void Bn(), children: n("board.signIn") }) })
968
+ ] }),
969
+ /* @__PURE__ */ r("div", { class: `order${R ? " order--away" : ""}`, children: /* @__PURE__ */ r("div", { class: "order__pill", role: "tablist", "aria-label": n("board.order"), children: ["top", "new"].map((p) => /* @__PURE__ */ r(
970
+ "button",
971
+ {
972
+ type: "button",
973
+ role: "tab",
974
+ class: "order__tab",
975
+ "aria-selected": M === p,
976
+ onClick: () => {
977
+ S(p), L(1);
978
+ },
979
+ children: n(p === "top" ? "board.top" : "board.new")
980
+ },
981
+ p
982
+ )) }) }),
983
+ I && /* @__PURE__ */ r("div", { class: "toast", role: "status", children: I }),
984
+ A?.kind === "delete" && /* @__PURE__ */ r(Nt, { t: n, onConfirm: () => void Wn(A.post), onClose: () => D(null) }),
985
+ A?.kind === "manage" && K && /* @__PURE__ */ r(
986
+ Ct,
987
+ {
988
+ t: n,
989
+ post: A.post,
990
+ replyMax: K.replyMax,
991
+ onSave: (p) => void Un(A.post, p),
992
+ onClose: () => D(null)
993
+ }
994
+ )
995
+ ] });
996
+ }
997
+ function Dt() {
998
+ return typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `p-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
999
+ }
1000
+ const $t = ':host{--pnb-bg: #ffffff;--pnb-surface: #f4f4f7;--pnb-surface-2: #e8e8ef;--pnb-sunken: #e8e8ef;--pnb-line: #dcdce5;--pnb-text: #1b1b24;--pnb-text-quiet: #5a5a6b;--pnb-accent: #2563eb;--pnb-on-accent: #ffffff;--pnb-danger: #d23b2f;--pnb-bug: #e5484d;--pnb-idea: #e9a00b;--pnb-planned: #3e7bfa;--pnb-done: #2f9e66;--pnb-declined: #8b8d98;--pnb-radius: 8px;--pnb-radius-sheet: 16px;--pnb-shadow: 0 6px 16px rgba(0, 0, 0, .18);--pnb-scrim: rgba(10, 10, 20, .5);--pnb-font: inherit;--pnb-z: 2147483000;--pnb-inset-top: env(safe-area-inset-top, 0px);--pnb-inset-bottom: env(safe-area-inset-bottom, 0px);display:block;font-family:var(--pnb-font);color:var(--pnb-text);-webkit-tap-highlight-color:transparent}@media (prefers-color-scheme: dark){:host(:not([theme])),:host([theme="auto"]){--pnb-bg: #15151c;--pnb-surface: #22222c;--pnb-surface-2: #2e2e3a;--pnb-sunken: #0d0d12;--pnb-line: #383846;--pnb-text: #f2f2f7;--pnb-text-quiet: #a9a9ba;--pnb-accent: #6b93ff;--pnb-on-accent: #0b0b12;--pnb-danger: #ff6b5e;--pnb-shadow: 0 6px 16px rgba(0, 0, 0, .45);--pnb-scrim: rgba(0, 0, 0, .6)}}:host([theme="dark"]){--pnb-bg: #15151c;--pnb-surface: #22222c;--pnb-surface-2: #2e2e3a;--pnb-sunken: #0d0d12;--pnb-line: #383846;--pnb-text: #f2f2f7;--pnb-text-quiet: #a9a9ba;--pnb-accent: #6b93ff;--pnb-on-accent: #0b0b12;--pnb-danger: #ff6b5e;--pnb-shadow: 0 6px 16px rgba(0, 0, 0, .45);--pnb-scrim: rgba(0, 0, 0, .6)}:host([theme="shitti"]){--pnb-bg: #292a56;--pnb-surface: #5656ac;--pnb-surface-2: #454689;--pnb-sunken: #1a1a32;--pnb-line: #6d6dc5;--pnb-text: #ffffff;--pnb-text-quiet: rgba(255, 255, 255, .78);--pnb-accent: #1fc7d4;--pnb-on-accent: #12132b;--pnb-danger: #ff7a6b;--pnb-shadow: 0 6px 16px rgba(0, 0, 0, .28);--pnb-scrim: rgba(10, 10, 30, .6)}*,*:before,*:after{box-sizing:border-box}button,input,textarea{font:inherit;color:inherit}button{cursor:pointer;border:0;background:none;padding:0}:focus-visible{outline:2px solid var(--pnb-accent);outline-offset:2px}.app{--_top: 0px;--_bottom: 0px;position:relative;display:flex;flex-direction:column;height:100%;min-height:320px;background:var(--pnb-bg);overflow:hidden}.bar{display:grid;grid-template-columns:48px 1fr 48px;align-items:center;min-height:56px;padding:0 4px;padding-top:var(--_top);flex-shrink:0}.bar__title{margin:0;text-align:center;font-size:18px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.icon-btn{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;color:var(--pnb-text)}.icon-btn:active{background:var(--pnb-surface)}.filters{display:flex;gap:8px;padding:4px 16px 12px;flex-shrink:0;flex-wrap:wrap}.chip-pick{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;border-radius:999px;background:var(--pnb-surface);color:var(--pnb-text-quiet);font-size:14px;font-weight:700}.chip-pick[aria-pressed=true],.chip-pick[aria-checked=true]{background:var(--pnb-text);color:var(--pnb-bg)}.scroll{flex:1;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:0 16px calc(96px + var(--_bottom))}.list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}.empty{margin:48px auto 0;max-width:280px;text-align:center;color:var(--pnb-text-quiet);line-height:1.45}.empty .text-btn{margin-top:12px}.card{position:relative;padding:16px;border-radius:var(--pnb-radius);background:var(--pnb-surface);border:1px solid var(--pnb-line)}.card--owner{cursor:pointer}.card--hidden{opacity:.6}.card__head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px 4px 4px;border-radius:999px;background:var(--pnb-surface-2);font-size:12px;font-weight:700}.badge__dot{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;color:#fff}.badge__dot--bug{background:var(--pnb-bug)}.badge__dot--idea{background:var(--pnb-idea)}.badge__dot--planned{background:var(--pnb-planned)}.badge__dot--done{background:var(--pnb-done)}.badge__dot--declined{background:var(--pnb-declined)}.card__off{font-size:12px;font-weight:700;color:var(--pnb-danger)}.card__when{margin-left:auto;font-size:12px;color:var(--pnb-text-quiet)}.card__text{margin:12px 0 0;font-size:16px;line-height:1.4;overflow-wrap:anywhere;white-space:pre-wrap}.card__reply{margin-top:12px;padding:10px 12px;border-radius:var(--pnb-radius);background:var(--pnb-bg);border-left:3px solid var(--pnb-accent)}.card__reply-who{font-size:12px;font-weight:700;color:var(--pnb-text-quiet)}.card__reply-text{margin:4px 0 0;font-size:14px;line-height:1.4;overflow-wrap:anywhere;white-space:pre-wrap}.card__foot{display:flex;align-items:center;gap:8px;margin-top:12px}.card__who{flex:1;min-width:0;font-size:14px;color:var(--pnb-text-quiet);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card__bin{width:36px;height:36px;color:var(--pnb-text-quiet)}.vote{display:inline-flex;align-items:center;gap:6px;min-width:56px;height:36px;padding:0 12px;border-radius:999px;background:var(--pnb-surface-2);font-size:14px;font-weight:700;justify-content:center}.vote[aria-pressed=true]{background:var(--pnb-accent);color:var(--pnb-on-accent)}.order{position:absolute;left:0;right:0;bottom:calc(20px + var(--_bottom));display:flex;justify-content:center;pointer-events:none;transition:transform .22s ease,opacity .16s ease}.order--away{transform:translateY(80px);opacity:0}.order__pill{pointer-events:auto;display:grid;grid-template-columns:1fr 1fr;width:min(240px,calc(100% - 32px));height:48px;padding:4px;border-radius:999px;background:var(--pnb-sunken);box-shadow:var(--pnb-shadow)}.order__tab{border-radius:999px;font-weight:700;font-size:15px;color:var(--pnb-text-quiet)}.order__tab[aria-selected=true]{background:var(--pnb-surface);color:var(--pnb-text)}.pager{display:flex;justify-content:center;gap:6px;margin-top:20px}.pager button{min-width:36px;height:36px;border-radius:999px;color:var(--pnb-text-quiet);font-weight:700}.pager button[aria-current=page]{background:var(--pnb-surface);color:var(--pnb-text)}.sign-in{display:flex;justify-content:center;margin-top:16px}.sign-in .text-btn{font-size:14px;text-decoration:underline;text-underline-offset:3px}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;height:48px;padding:0 24px;border-radius:999px;background:var(--pnb-accent);color:var(--pnb-on-accent);font-size:16px;font-weight:700}.btn:disabled{opacity:.45;cursor:default}.btn--danger{background:var(--pnb-danger);color:#fff}.text-btn{display:inline-block;padding:12px 16px;font-weight:700;color:var(--pnb-text-quiet)}.spinner{width:20px;height:20px;border-radius:50%;border:2.5px solid currentColor;border-right-color:transparent;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.compose{display:flex;flex-direction:column;gap:8px;padding-bottom:24px}.label{margin-top:12px;font-size:14px;font-weight:700}.kinds{display:flex;gap:8px}.chip-pick .badge__dot{width:20px;height:20px}.public{margin:12px 0 0;font-size:14px;color:var(--pnb-text-quiet)}.field{width:100%;min-height:140px;padding:12px 14px;border-radius:var(--pnb-radius);border:1px solid var(--pnb-line);background:var(--pnb-surface);font-size:16px;line-height:1.4;resize:vertical}.field:focus{outline:none;border-color:var(--pnb-accent)}.input{width:100%;height:44px;padding:0 14px;border-radius:var(--pnb-radius);border:1px solid var(--pnb-line);background:var(--pnb-surface);font-size:16px}.input:focus{outline:none;border-color:var(--pnb-accent)}.count{align-self:flex-end;font-size:12px;color:var(--pnb-text-quiet)}.alike{margin-top:8px;padding:12px;border-radius:var(--pnb-radius);background:var(--pnb-surface)}.alike__note{margin:4px 0 8px;font-size:13px;color:var(--pnb-text-quiet)}.alike__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.alike__row{display:flex;align-items:center;gap:12px}.alike__text{flex:1;min-width:0;font-size:14px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.switch-row{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:16px}.switch-row__label{font-weight:700}.switch{position:relative;flex-shrink:0;width:48px;height:28px;border-radius:999px;background:var(--pnb-surface-2);border:1px solid var(--pnb-line);transition:background .16s ease}.switch:after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:var(--pnb-text-quiet);transition:transform .16s ease,background .16s ease}.switch[aria-checked=true]{background:var(--pnb-accent);border-color:var(--pnb-accent)}.switch[aria-checked=true]:after{transform:translate(20px);background:var(--pnb-on-accent)}.note{margin:4px 0 0;font-size:12px;line-height:1.45;color:var(--pnb-text-quiet)}.send{display:flex;flex-direction:column;align-items:center;gap:8px;margin-top:20px}.left{font-size:13px;color:var(--pnb-text-quiet);text-align:center}.left--bad{color:var(--pnb-danger)}.scrim{position:absolute;inset:0;z-index:10;display:flex;align-items:flex-end;background:var(--pnb-scrim);animation:fade-in .18s ease}.sheet{width:100%;max-height:90%;overflow-y:auto;padding:24px 24px calc(24px + var(--_bottom));border-radius:var(--pnb-radius-sheet) var(--pnb-radius-sheet) 0 0;background:var(--pnb-bg);animation:rise .22s cubic-bezier(.2,.8,.2,1)}.sheet__title{margin:0;font-size:20px;font-weight:700}.sheet__quote{margin:8px 0 0;color:var(--pnb-text-quiet);overflow-wrap:anywhere}.sheet__actions{display:flex;flex-direction:column;align-items:center;gap:4px;margin-top:24px}.states{display:flex;flex-wrap:wrap;gap:8px}.context{margin:12px 0 0;padding:10px 12px;border-radius:var(--pnb-radius);background:var(--pnb-surface);font-size:13px;line-height:1.5}.context dt{font-weight:700;display:inline}.context dd{display:inline;margin:0 0 0 4px;color:var(--pnb-text-quiet)}.hide-btn{margin-top:16px;font-weight:700;color:var(--pnb-danger)}.toast{position:absolute;left:16px;right:16px;bottom:calc(84px + var(--_bottom));z-index:20;padding:14px 16px;border-radius:var(--pnb-radius);background:var(--pnb-text);color:var(--pnb-bg);font-weight:700;text-align:center;box-shadow:var(--pnb-shadow);animation:rise .22s cubic-bezier(.2,.8,.2,1)}.overlay{position:fixed;inset:0;z-index:var(--pnb-z);animation:slide-up .28s cubic-bezier(.2,.8,.2,1)}.overlay .app{--_top: var(--pnb-inset-top);--_bottom: var(--pnb-inset-bottom)}.overlay--leaving{animation:slide-down .22s cubic-bezier(.4,0,1,1) forwards}.fab{position:fixed;right:calc(16px + env(safe-area-inset-right,0px));bottom:calc(16px + var(--pnb-inset-bottom));z-index:calc(var(--pnb-z) - 1);display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 16px 0 12px;border-radius:999px;background:var(--pnb-accent);color:var(--pnb-on-accent);font-weight:700;font-size:15px;box-shadow:var(--pnb-shadow)}@keyframes fade-in{0%{opacity:0}}@keyframes rise{0%{transform:translateY(24px);opacity:0}}@keyframes slide-up{0%{transform:translateY(100%)}}@keyframes slide-down{to{transform:translateY(100%)}}@media (prefers-reduced-motion: reduce){.overlay,.overlay--leaving,.scrim,.sheet,.toast{animation:none}.order{transition:opacity .16s ease}.order--away{transform:none}.spinner{animation-duration:1.6s}}', Ve = "please-no-bugs";
1001
+ var Q, q, X, J, ee, ne, te, ae, re, ue, B, In, Y;
1002
+ class qn extends HTMLElement {
1003
+ constructor() {
1004
+ super(...arguments);
1005
+ H(this, B);
1006
+ H(this, Q, null);
1007
+ H(this, q, null);
1008
+ H(this, X, null);
1009
+ H(this, J, "");
1010
+ H(this, ee);
1011
+ H(this, ne);
1012
+ H(this, te);
1013
+ H(this, ae);
1014
+ H(this, re);
1015
+ H(this, ue);
1016
+ }
1017
+ /** How to sign outside Nimiq Pay. Inside it the widget signs by itself. */
1018
+ get signer() {
1019
+ return k(this, ee);
1020
+ }
1021
+ set signer(t) {
1022
+ E(this, ee, t), E(this, J, ""), O(this, B, Y).call(this);
1023
+ }
1024
+ /**
1025
+ * Your app's own wallet login, so nobody signs twice: `{ address, publicKey,
1026
+ * signature, message }`. Needs the project to list that message. Set it to
1027
+ * null on logout.
1028
+ */
1029
+ get appLogin() {
1030
+ return k(this, ne);
1031
+ }
1032
+ set appLogin(t) {
1033
+ E(this, ne, t), E(this, J, ""), O(this, B, Y).call(this);
1034
+ }
1035
+ /** Sent with every bug report, to owners only: `{ version: '1.4.0' }`. */
1036
+ get context() {
1037
+ return k(this, te);
1038
+ }
1039
+ set context(t) {
1040
+ E(this, te, t), O(this, B, Y).call(this);
1041
+ }
1042
+ /** Words common in your app, so "said already?" ignores them: `['nim', 'wallet']`. */
1043
+ get noise() {
1044
+ return k(this, ae);
1045
+ }
1046
+ set noise(t) {
1047
+ E(this, ae, t), O(this, B, Y).call(this);
1048
+ }
1049
+ /** Override any string, or supply a language: `{ 'board.title': 'Ideas box' }`. */
1050
+ get strings() {
1051
+ return k(this, re);
1052
+ }
1053
+ set strings(t) {
1054
+ E(this, re, t), O(this, B, Y).call(this);
1055
+ }
1056
+ connectedCallback() {
1057
+ if (!k(this, Q)) {
1058
+ E(this, Q, this.attachShadow({ mode: "open" }));
1059
+ const t = document.createElement("style");
1060
+ t.textContent = $t, E(this, q, document.createElement("div")), k(this, q).style.height = "100%", k(this, Q).append(t, k(this, q));
1061
+ }
1062
+ O(this, B, Y).call(this);
1063
+ }
1064
+ disconnectedCallback() {
1065
+ k(this, q) && le(null, k(this, q));
1066
+ }
1067
+ attributeChangedCallback(t) {
1068
+ (t === "project" || t === "server") && E(this, J, ""), t === "accent" && O(this, B, In).call(this), O(this, B, Y).call(this);
1069
+ }
1070
+ /** Close an overlay: slide it away, then tell the page. */
1071
+ close() {
1072
+ this.dispatchEvent(new CustomEvent("pleasenobugs:close", { bubbles: !0, composed: !0 }));
1073
+ }
1074
+ }
1075
+ Q = new WeakMap(), q = new WeakMap(), X = new WeakMap(), J = new WeakMap(), ee = new WeakMap(), ne = new WeakMap(), te = new WeakMap(), ae = new WeakMap(), re = new WeakMap(), ue = new WeakMap(), B = new WeakSet(), In = function() {
1076
+ const t = this.getAttribute("accent");
1077
+ t ? (this.style.setProperty("--pnb-accent", t), this.style.setProperty("--pnb-on-accent", Lt(t))) : (this.style.removeProperty("--pnb-accent"), this.style.removeProperty("--pnb-on-accent"));
1078
+ }, Y = function() {
1079
+ if (!k(this, q) || !this.isConnected) return;
1080
+ const t = this.getAttribute("project"), a = this.getAttribute("server");
1081
+ if (!t || !a) {
1082
+ le(null, k(this, q)), clearTimeout(k(this, ue)), E(this, ue, setTimeout(() => {
1083
+ (!this.getAttribute("project") || !this.getAttribute("server")) && console.warn("[pleasenobugs] <please-no-bugs> needs both a `project` and a `server` attribute.");
1084
+ }, 1e3));
1085
+ return;
1086
+ }
1087
+ const l = `${a}|${t}`;
1088
+ (!k(this, X) || k(this, J) !== l) && (E(this, X, Gn({ server: a, project: t, signer: k(this, ee), appLogin: k(this, ne) })), E(this, J, l));
1089
+ const o = ct(this.getAttribute("lang")), d = this.getAttribute("mode") ?? "inline", c = {
1090
+ client: k(this, X),
1091
+ t: pt(o, k(this, re)),
1092
+ locale: o,
1093
+ appName: this.getAttribute("app-name") ?? void 0,
1094
+ suggestName: this.getAttribute("name") ?? void 0,
1095
+ context: k(this, te),
1096
+ noise: k(this, ae),
1097
+ onPosted: (b) => this.dispatchEvent(new CustomEvent("pleasenobugs:posted", { detail: b, bubbles: !0, composed: !0 }))
1098
+ };
1099
+ d === "floating" ? le(/* @__PURE__ */ r(Et, { app: c, label: c.t("board.open") }), k(this, q)) : d === "overlay" ? le(/* @__PURE__ */ r(Fn, { app: c, onGone: () => this.close() }), k(this, q)) : le(/* @__PURE__ */ r(jn, { ...c }), k(this, q));
1100
+ }, tn(qn, "observedAttributes", ["project", "server", "mode", "lang", "theme", "accent", "app-name", "name"]);
1101
+ function Fn({ app: e, onGone: n }) {
1102
+ const [t, a] = N(!1);
1103
+ return /* @__PURE__ */ r(
1104
+ "div",
1105
+ {
1106
+ class: `overlay${t ? " overlay--leaving" : ""}`,
1107
+ onAnimationEnd: (o) => {
1108
+ t && o.target === o.currentTarget && n();
1109
+ },
1110
+ children: /* @__PURE__ */ r(jn, { ...e, onClose: () => {
1111
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return n();
1112
+ a(!0);
1113
+ } })
1114
+ }
1115
+ );
1116
+ }
1117
+ function Et({ app: e, label: n }) {
1118
+ const [t, a] = N(!1);
1119
+ return t ? /* @__PURE__ */ r(Fn, { app: e, onGone: () => a(!1) }) : /* @__PURE__ */ r("button", { type: "button", class: "fab", onClick: () => a(!0), children: [
1120
+ /* @__PURE__ */ r(vt, {}),
1121
+ n
1122
+ ] });
1123
+ }
1124
+ function Lt(e) {
1125
+ const n = e.trim().replace("#", ""), t = n.length === 3 ? [...n].map((o) => o + o).join("") : n.slice(0, 6);
1126
+ if (!/^[0-9a-f]{6}$/i.test(t)) return "#ffffff";
1127
+ const a = (o) => {
1128
+ const d = parseInt(t.slice(o, o + 2), 16) / 255;
1129
+ return d <= 0.03928 ? d / 12.92 : ((d + 0.055) / 1.055) ** 2.4;
1130
+ }, l = 0.2126 * a(0) + 0.7152 * a(2) + 0.0722 * a(4);
1131
+ return 1.05 / (l + 0.05) >= (l + 0.05) / 0.05 ? "#ffffff" : "#111118";
1132
+ }
1133
+ function jt() {
1134
+ typeof customElements < "u" && !customElements.get(Ve) && customElements.define(Ve, qn);
1135
+ }
1136
+ jt();
1137
+ function Ft(e) {
1138
+ const n = document.createElement(Ve);
1139
+ n.setAttribute("mode", "overlay"), n.setAttribute("project", e.project), n.setAttribute("server", e.server), e.lang && n.setAttribute("lang", e.lang), e.theme && n.setAttribute("theme", e.theme), e.accent && n.setAttribute("accent", e.accent), e.appName && n.setAttribute("app-name", e.appName), e.name && n.setAttribute("name", e.name), n.signer = e.signer, n.appLogin = e.appLogin, n.context = e.context, n.noise = e.noise, n.strings = e.strings;
1140
+ const t = () => n.remove();
1141
+ return n.addEventListener("pleasenobugs:close", t, { once: !0 }), document.body.append(n), () => n.close();
1142
+ }
1143
+ export {
1144
+ qn as PleaseNoBugsElement,
1145
+ Wt as SignerError,
1146
+ Gn as createClient,
1147
+ Kn as createMatcher,
1148
+ Yn as insideNimiqPay,
1149
+ Ut as nimiqPaySigner,
1150
+ Ft as open,
1151
+ Lt as readableOn,
1152
+ Rn as sortPosts
1153
+ };