@hashgraphonline/hashinal-wc 1.0.0 → 1.0.3

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.
@@ -0,0 +1,4092 @@
1
+ import { d as dijkstraExports, n as ne$1, s as se$1, T as T$2, o as oe$1, R as R$1, a as a$2, t as te$1, p as p$1, y as y$1 } from "./index-DVnLv1FW.js";
2
+ /**
3
+ * @license
4
+ * Copyright 2019 Google LLC
5
+ * SPDX-License-Identifier: BSD-3-Clause
6
+ */
7
+ const t$3 = window, e$5 = t$3.ShadowRoot && (void 0 === t$3.ShadyCSS || t$3.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$3 = Symbol(), n$5 = /* @__PURE__ */ new WeakMap();
8
+ let o$4 = class o {
9
+ constructor(t2, e2, n2) {
10
+ if (this._$cssResult$ = true, n2 !== s$3) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
11
+ this.cssText = t2, this.t = e2;
12
+ }
13
+ get styleSheet() {
14
+ let t2 = this.o;
15
+ const s2 = this.t;
16
+ if (e$5 && void 0 === t2) {
17
+ const e2 = void 0 !== s2 && 1 === s2.length;
18
+ e2 && (t2 = n$5.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e2 && n$5.set(s2, t2));
19
+ }
20
+ return t2;
21
+ }
22
+ toString() {
23
+ return this.cssText;
24
+ }
25
+ };
26
+ const r$2 = (t2) => new o$4("string" == typeof t2 ? t2 : t2 + "", void 0, s$3), i$3 = (t2, ...e2) => {
27
+ const n2 = 1 === t2.length ? t2[0] : e2.reduce((e3, s2, n3) => e3 + ((t3) => {
28
+ if (true === t3._$cssResult$) return t3.cssText;
29
+ if ("number" == typeof t3) return t3;
30
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
31
+ })(s2) + t2[n3 + 1], t2[0]);
32
+ return new o$4(n2, t2, s$3);
33
+ }, S$2 = (s2, n2) => {
34
+ e$5 ? s2.adoptedStyleSheets = n2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet) : n2.forEach((e2) => {
35
+ const n3 = document.createElement("style"), o3 = t$3.litNonce;
36
+ void 0 !== o3 && n3.setAttribute("nonce", o3), n3.textContent = e2.cssText, s2.appendChild(n3);
37
+ });
38
+ }, c$2 = e$5 ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => {
39
+ let e2 = "";
40
+ for (const s2 of t3.cssRules) e2 += s2.cssText;
41
+ return r$2(e2);
42
+ })(t2) : t2;
43
+ /**
44
+ * @license
45
+ * Copyright 2017 Google LLC
46
+ * SPDX-License-Identifier: BSD-3-Clause
47
+ */
48
+ var s$2;
49
+ const e$4 = window, r$1 = e$4.trustedTypes, h$2 = r$1 ? r$1.emptyScript : "", o$3 = e$4.reactiveElementPolyfillSupport, n$4 = { toAttribute(t2, i2) {
50
+ switch (i2) {
51
+ case Boolean:
52
+ t2 = t2 ? h$2 : null;
53
+ break;
54
+ case Object:
55
+ case Array:
56
+ t2 = null == t2 ? t2 : JSON.stringify(t2);
57
+ }
58
+ return t2;
59
+ }, fromAttribute(t2, i2) {
60
+ let s2 = t2;
61
+ switch (i2) {
62
+ case Boolean:
63
+ s2 = null !== t2;
64
+ break;
65
+ case Number:
66
+ s2 = null === t2 ? null : Number(t2);
67
+ break;
68
+ case Object:
69
+ case Array:
70
+ try {
71
+ s2 = JSON.parse(t2);
72
+ } catch (t3) {
73
+ s2 = null;
74
+ }
75
+ }
76
+ return s2;
77
+ } }, a$1 = (t2, i2) => i2 !== t2 && (i2 == i2 || t2 == t2), l$3 = { attribute: true, type: String, converter: n$4, reflect: false, hasChanged: a$1 }, d$1 = "finalized";
78
+ let u$1 = class u extends HTMLElement {
79
+ constructor() {
80
+ super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = false, this.hasUpdated = false, this._$El = null, this._$Eu();
81
+ }
82
+ static addInitializer(t2) {
83
+ var i2;
84
+ this.finalize(), (null !== (i2 = this.h) && void 0 !== i2 ? i2 : this.h = []).push(t2);
85
+ }
86
+ static get observedAttributes() {
87
+ this.finalize();
88
+ const t2 = [];
89
+ return this.elementProperties.forEach((i2, s2) => {
90
+ const e2 = this._$Ep(s2, i2);
91
+ void 0 !== e2 && (this._$Ev.set(e2, s2), t2.push(e2));
92
+ }), t2;
93
+ }
94
+ static createProperty(t2, i2 = l$3) {
95
+ if (i2.state && (i2.attribute = false), this.finalize(), this.elementProperties.set(t2, i2), !i2.noAccessor && !this.prototype.hasOwnProperty(t2)) {
96
+ const s2 = "symbol" == typeof t2 ? Symbol() : "__" + t2, e2 = this.getPropertyDescriptor(t2, s2, i2);
97
+ void 0 !== e2 && Object.defineProperty(this.prototype, t2, e2);
98
+ }
99
+ }
100
+ static getPropertyDescriptor(t2, i2, s2) {
101
+ return { get() {
102
+ return this[i2];
103
+ }, set(e2) {
104
+ const r2 = this[t2];
105
+ this[i2] = e2, this.requestUpdate(t2, r2, s2);
106
+ }, configurable: true, enumerable: true };
107
+ }
108
+ static getPropertyOptions(t2) {
109
+ return this.elementProperties.get(t2) || l$3;
110
+ }
111
+ static finalize() {
112
+ if (this.hasOwnProperty(d$1)) return false;
113
+ this[d$1] = true;
114
+ const t2 = Object.getPrototypeOf(this);
115
+ if (t2.finalize(), void 0 !== t2.h && (this.h = [...t2.h]), this.elementProperties = new Map(t2.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) {
116
+ const t3 = this.properties, i2 = [...Object.getOwnPropertyNames(t3), ...Object.getOwnPropertySymbols(t3)];
117
+ for (const s2 of i2) this.createProperty(s2, t3[s2]);
118
+ }
119
+ return this.elementStyles = this.finalizeStyles(this.styles), true;
120
+ }
121
+ static finalizeStyles(i2) {
122
+ const s2 = [];
123
+ if (Array.isArray(i2)) {
124
+ const e2 = new Set(i2.flat(1 / 0).reverse());
125
+ for (const i3 of e2) s2.unshift(c$2(i3));
126
+ } else void 0 !== i2 && s2.push(c$2(i2));
127
+ return s2;
128
+ }
129
+ static _$Ep(t2, i2) {
130
+ const s2 = i2.attribute;
131
+ return false === s2 ? void 0 : "string" == typeof s2 ? s2 : "string" == typeof t2 ? t2.toLowerCase() : void 0;
132
+ }
133
+ _$Eu() {
134
+ var t2;
135
+ this._$E_ = new Promise((t3) => this.enableUpdating = t3), this._$AL = /* @__PURE__ */ new Map(), this._$Eg(), this.requestUpdate(), null === (t2 = this.constructor.h) || void 0 === t2 || t2.forEach((t3) => t3(this));
136
+ }
137
+ addController(t2) {
138
+ var i2, s2;
139
+ (null !== (i2 = this._$ES) && void 0 !== i2 ? i2 : this._$ES = []).push(t2), void 0 !== this.renderRoot && this.isConnected && (null === (s2 = t2.hostConnected) || void 0 === s2 || s2.call(t2));
140
+ }
141
+ removeController(t2) {
142
+ var i2;
143
+ null === (i2 = this._$ES) || void 0 === i2 || i2.splice(this._$ES.indexOf(t2) >>> 0, 1);
144
+ }
145
+ _$Eg() {
146
+ this.constructor.elementProperties.forEach((t2, i2) => {
147
+ this.hasOwnProperty(i2) && (this._$Ei.set(i2, this[i2]), delete this[i2]);
148
+ });
149
+ }
150
+ createRenderRoot() {
151
+ var t2;
152
+ const s2 = null !== (t2 = this.shadowRoot) && void 0 !== t2 ? t2 : this.attachShadow(this.constructor.shadowRootOptions);
153
+ return S$2(s2, this.constructor.elementStyles), s2;
154
+ }
155
+ connectedCallback() {
156
+ var t2;
157
+ void 0 === this.renderRoot && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(true), null === (t2 = this._$ES) || void 0 === t2 || t2.forEach((t3) => {
158
+ var i2;
159
+ return null === (i2 = t3.hostConnected) || void 0 === i2 ? void 0 : i2.call(t3);
160
+ });
161
+ }
162
+ enableUpdating(t2) {
163
+ }
164
+ disconnectedCallback() {
165
+ var t2;
166
+ null === (t2 = this._$ES) || void 0 === t2 || t2.forEach((t3) => {
167
+ var i2;
168
+ return null === (i2 = t3.hostDisconnected) || void 0 === i2 ? void 0 : i2.call(t3);
169
+ });
170
+ }
171
+ attributeChangedCallback(t2, i2, s2) {
172
+ this._$AK(t2, s2);
173
+ }
174
+ _$EO(t2, i2, s2 = l$3) {
175
+ var e2;
176
+ const r2 = this.constructor._$Ep(t2, s2);
177
+ if (void 0 !== r2 && true === s2.reflect) {
178
+ const h2 = (void 0 !== (null === (e2 = s2.converter) || void 0 === e2 ? void 0 : e2.toAttribute) ? s2.converter : n$4).toAttribute(i2, s2.type);
179
+ this._$El = t2, null == h2 ? this.removeAttribute(r2) : this.setAttribute(r2, h2), this._$El = null;
180
+ }
181
+ }
182
+ _$AK(t2, i2) {
183
+ var s2;
184
+ const e2 = this.constructor, r2 = e2._$Ev.get(t2);
185
+ if (void 0 !== r2 && this._$El !== r2) {
186
+ const t3 = e2.getPropertyOptions(r2), h2 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== (null === (s2 = t3.converter) || void 0 === s2 ? void 0 : s2.fromAttribute) ? t3.converter : n$4;
187
+ this._$El = r2, this[r2] = h2.fromAttribute(i2, t3.type), this._$El = null;
188
+ }
189
+ }
190
+ requestUpdate(t2, i2, s2) {
191
+ let e2 = true;
192
+ void 0 !== t2 && (((s2 = s2 || this.constructor.getPropertyOptions(t2)).hasChanged || a$1)(this[t2], i2) ? (this._$AL.has(t2) || this._$AL.set(t2, i2), true === s2.reflect && this._$El !== t2 && (void 0 === this._$EC && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(t2, s2))) : e2 = false), !this.isUpdatePending && e2 && (this._$E_ = this._$Ej());
193
+ }
194
+ async _$Ej() {
195
+ this.isUpdatePending = true;
196
+ try {
197
+ await this._$E_;
198
+ } catch (t3) {
199
+ Promise.reject(t3);
200
+ }
201
+ const t2 = this.scheduleUpdate();
202
+ return null != t2 && await t2, !this.isUpdatePending;
203
+ }
204
+ scheduleUpdate() {
205
+ return this.performUpdate();
206
+ }
207
+ performUpdate() {
208
+ var t2;
209
+ if (!this.isUpdatePending) return;
210
+ this.hasUpdated, this._$Ei && (this._$Ei.forEach((t3, i3) => this[i3] = t3), this._$Ei = void 0);
211
+ let i2 = false;
212
+ const s2 = this._$AL;
213
+ try {
214
+ i2 = this.shouldUpdate(s2), i2 ? (this.willUpdate(s2), null === (t2 = this._$ES) || void 0 === t2 || t2.forEach((t3) => {
215
+ var i3;
216
+ return null === (i3 = t3.hostUpdate) || void 0 === i3 ? void 0 : i3.call(t3);
217
+ }), this.update(s2)) : this._$Ek();
218
+ } catch (t3) {
219
+ throw i2 = false, this._$Ek(), t3;
220
+ }
221
+ i2 && this._$AE(s2);
222
+ }
223
+ willUpdate(t2) {
224
+ }
225
+ _$AE(t2) {
226
+ var i2;
227
+ null === (i2 = this._$ES) || void 0 === i2 || i2.forEach((t3) => {
228
+ var i3;
229
+ return null === (i3 = t3.hostUpdated) || void 0 === i3 ? void 0 : i3.call(t3);
230
+ }), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2);
231
+ }
232
+ _$Ek() {
233
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
234
+ }
235
+ get updateComplete() {
236
+ return this.getUpdateComplete();
237
+ }
238
+ getUpdateComplete() {
239
+ return this._$E_;
240
+ }
241
+ shouldUpdate(t2) {
242
+ return true;
243
+ }
244
+ update(t2) {
245
+ void 0 !== this._$EC && (this._$EC.forEach((t3, i2) => this._$EO(i2, this[i2], t3)), this._$EC = void 0), this._$Ek();
246
+ }
247
+ updated(t2) {
248
+ }
249
+ firstUpdated(t2) {
250
+ }
251
+ };
252
+ u$1[d$1] = true, u$1.elementProperties = /* @__PURE__ */ new Map(), u$1.elementStyles = [], u$1.shadowRootOptions = { mode: "open" }, null == o$3 || o$3({ ReactiveElement: u$1 }), (null !== (s$2 = e$4.reactiveElementVersions) && void 0 !== s$2 ? s$2 : e$4.reactiveElementVersions = []).push("1.6.3");
253
+ /**
254
+ * @license
255
+ * Copyright 2017 Google LLC
256
+ * SPDX-License-Identifier: BSD-3-Clause
257
+ */
258
+ var t$2;
259
+ const i$2 = window, s$1 = i$2.trustedTypes, e$3 = s$1 ? s$1.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, o$2 = "$lit$", n$3 = `lit$${(Math.random() + "").slice(9)}$`, l$2 = "?" + n$3, h$1 = `<${l$2}>`, r = document, u2 = () => r.createComment(""), d = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, c$1 = Array.isArray, v$1 = (t2) => c$1(t2) || "function" == typeof (null == t2 ? void 0 : t2[Symbol.iterator]), a = "[ \n\f\r]", f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, _$1 = /-->/g, m = />/g, p = RegExp(`>|${a}(?:([^\\s"'>=/]+)(${a}*=${a}*(?:[^
260
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), g = /'/g, $ = /"/g, y = /^(?:script|style|textarea|title)$/i, w = (t2) => (i2, ...s2) => ({ _$litType$: t2, strings: i2, values: s2 }), x = w(1), b = w(2), T$1 = Symbol.for("lit-noChange"), A$1 = Symbol.for("lit-nothing"), E = /* @__PURE__ */ new WeakMap(), C = r.createTreeWalker(r, 129, null, false);
261
+ function P(t2, i2) {
262
+ if (!Array.isArray(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array");
263
+ return void 0 !== e$3 ? e$3.createHTML(i2) : i2;
264
+ }
265
+ const V = (t2, i2) => {
266
+ const s2 = t2.length - 1, e2 = [];
267
+ let l2, r2 = 2 === i2 ? "<svg>" : "", u3 = f;
268
+ for (let i3 = 0; i3 < s2; i3++) {
269
+ const s3 = t2[i3];
270
+ let d2, c2, v2 = -1, a2 = 0;
271
+ for (; a2 < s3.length && (u3.lastIndex = a2, c2 = u3.exec(s3), null !== c2); ) a2 = u3.lastIndex, u3 === f ? "!--" === c2[1] ? u3 = _$1 : void 0 !== c2[1] ? u3 = m : void 0 !== c2[2] ? (y.test(c2[2]) && (l2 = RegExp("</" + c2[2], "g")), u3 = p) : void 0 !== c2[3] && (u3 = p) : u3 === p ? ">" === c2[0] ? (u3 = null != l2 ? l2 : f, v2 = -1) : void 0 === c2[1] ? v2 = -2 : (v2 = u3.lastIndex - c2[2].length, d2 = c2[1], u3 = void 0 === c2[3] ? p : '"' === c2[3] ? $ : g) : u3 === $ || u3 === g ? u3 = p : u3 === _$1 || u3 === m ? u3 = f : (u3 = p, l2 = void 0);
272
+ const w2 = u3 === p && t2[i3 + 1].startsWith("/>") ? " " : "";
273
+ r2 += u3 === f ? s3 + h$1 : v2 >= 0 ? (e2.push(d2), s3.slice(0, v2) + o$2 + s3.slice(v2) + n$3 + w2) : s3 + n$3 + (-2 === v2 ? (e2.push(void 0), i3) : w2);
274
+ }
275
+ return [P(t2, r2 + (t2[s2] || "<?>") + (2 === i2 ? "</svg>" : "")), e2];
276
+ };
277
+ class N {
278
+ constructor({ strings: t2, _$litType$: i2 }, e2) {
279
+ let h2;
280
+ this.parts = [];
281
+ let r2 = 0, d2 = 0;
282
+ const c2 = t2.length - 1, v2 = this.parts, [a2, f2] = V(t2, i2);
283
+ if (this.el = N.createElement(a2, e2), C.currentNode = this.el.content, 2 === i2) {
284
+ const t3 = this.el.content, i3 = t3.firstChild;
285
+ i3.remove(), t3.append(...i3.childNodes);
286
+ }
287
+ for (; null !== (h2 = C.nextNode()) && v2.length < c2; ) {
288
+ if (1 === h2.nodeType) {
289
+ if (h2.hasAttributes()) {
290
+ const t3 = [];
291
+ for (const i3 of h2.getAttributeNames()) if (i3.endsWith(o$2) || i3.startsWith(n$3)) {
292
+ const s2 = f2[d2++];
293
+ if (t3.push(i3), void 0 !== s2) {
294
+ const t4 = h2.getAttribute(s2.toLowerCase() + o$2).split(n$3), i4 = /([.?@])?(.*)/.exec(s2);
295
+ v2.push({ type: 1, index: r2, name: i4[2], strings: t4, ctor: "." === i4[1] ? H : "?" === i4[1] ? L$1 : "@" === i4[1] ? z : k });
296
+ } else v2.push({ type: 6, index: r2 });
297
+ }
298
+ for (const i3 of t3) h2.removeAttribute(i3);
299
+ }
300
+ if (y.test(h2.tagName)) {
301
+ const t3 = h2.textContent.split(n$3), i3 = t3.length - 1;
302
+ if (i3 > 0) {
303
+ h2.textContent = s$1 ? s$1.emptyScript : "";
304
+ for (let s2 = 0; s2 < i3; s2++) h2.append(t3[s2], u2()), C.nextNode(), v2.push({ type: 2, index: ++r2 });
305
+ h2.append(t3[i3], u2());
306
+ }
307
+ }
308
+ } else if (8 === h2.nodeType) if (h2.data === l$2) v2.push({ type: 2, index: r2 });
309
+ else {
310
+ let t3 = -1;
311
+ for (; -1 !== (t3 = h2.data.indexOf(n$3, t3 + 1)); ) v2.push({ type: 7, index: r2 }), t3 += n$3.length - 1;
312
+ }
313
+ r2++;
314
+ }
315
+ }
316
+ static createElement(t2, i2) {
317
+ const s2 = r.createElement("template");
318
+ return s2.innerHTML = t2, s2;
319
+ }
320
+ }
321
+ function S$1(t2, i2, s2 = t2, e2) {
322
+ var o3, n2, l2, h2;
323
+ if (i2 === T$1) return i2;
324
+ let r2 = void 0 !== e2 ? null === (o3 = s2._$Co) || void 0 === o3 ? void 0 : o3[e2] : s2._$Cl;
325
+ const u3 = d(i2) ? void 0 : i2._$litDirective$;
326
+ return (null == r2 ? void 0 : r2.constructor) !== u3 && (null === (n2 = null == r2 ? void 0 : r2._$AO) || void 0 === n2 || n2.call(r2, false), void 0 === u3 ? r2 = void 0 : (r2 = new u3(t2), r2._$AT(t2, s2, e2)), void 0 !== e2 ? (null !== (l2 = (h2 = s2)._$Co) && void 0 !== l2 ? l2 : h2._$Co = [])[e2] = r2 : s2._$Cl = r2), void 0 !== r2 && (i2 = S$1(t2, r2._$AS(t2, i2.values), r2, e2)), i2;
327
+ }
328
+ class M {
329
+ constructor(t2, i2) {
330
+ this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i2;
331
+ }
332
+ get parentNode() {
333
+ return this._$AM.parentNode;
334
+ }
335
+ get _$AU() {
336
+ return this._$AM._$AU;
337
+ }
338
+ u(t2) {
339
+ var i2;
340
+ const { el: { content: s2 }, parts: e2 } = this._$AD, o3 = (null !== (i2 = null == t2 ? void 0 : t2.creationScope) && void 0 !== i2 ? i2 : r).importNode(s2, true);
341
+ C.currentNode = o3;
342
+ let n2 = C.nextNode(), l2 = 0, h2 = 0, u3 = e2[0];
343
+ for (; void 0 !== u3; ) {
344
+ if (l2 === u3.index) {
345
+ let i3;
346
+ 2 === u3.type ? i3 = new R(n2, n2.nextSibling, this, t2) : 1 === u3.type ? i3 = new u3.ctor(n2, u3.name, u3.strings, this, t2) : 6 === u3.type && (i3 = new Z$1(n2, this, t2)), this._$AV.push(i3), u3 = e2[++h2];
347
+ }
348
+ l2 !== (null == u3 ? void 0 : u3.index) && (n2 = C.nextNode(), l2++);
349
+ }
350
+ return C.currentNode = r, o3;
351
+ }
352
+ v(t2) {
353
+ let i2 = 0;
354
+ for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i2), i2 += s2.strings.length - 2) : s2._$AI(t2[i2])), i2++;
355
+ }
356
+ }
357
+ class R {
358
+ constructor(t2, i2, s2, e2) {
359
+ var o3;
360
+ this.type = 2, this._$AH = A$1, this._$AN = void 0, this._$AA = t2, this._$AB = i2, this._$AM = s2, this.options = e2, this._$Cp = null === (o3 = null == e2 ? void 0 : e2.isConnected) || void 0 === o3 || o3;
361
+ }
362
+ get _$AU() {
363
+ var t2, i2;
364
+ return null !== (i2 = null === (t2 = this._$AM) || void 0 === t2 ? void 0 : t2._$AU) && void 0 !== i2 ? i2 : this._$Cp;
365
+ }
366
+ get parentNode() {
367
+ let t2 = this._$AA.parentNode;
368
+ const i2 = this._$AM;
369
+ return void 0 !== i2 && 11 === (null == t2 ? void 0 : t2.nodeType) && (t2 = i2.parentNode), t2;
370
+ }
371
+ get startNode() {
372
+ return this._$AA;
373
+ }
374
+ get endNode() {
375
+ return this._$AB;
376
+ }
377
+ _$AI(t2, i2 = this) {
378
+ t2 = S$1(this, t2, i2), d(t2) ? t2 === A$1 || null == t2 || "" === t2 ? (this._$AH !== A$1 && this._$AR(), this._$AH = A$1) : t2 !== this._$AH && t2 !== T$1 && this._(t2) : void 0 !== t2._$litType$ ? this.g(t2) : void 0 !== t2.nodeType ? this.$(t2) : v$1(t2) ? this.T(t2) : this._(t2);
379
+ }
380
+ k(t2) {
381
+ return this._$AA.parentNode.insertBefore(t2, this._$AB);
382
+ }
383
+ $(t2) {
384
+ this._$AH !== t2 && (this._$AR(), this._$AH = this.k(t2));
385
+ }
386
+ _(t2) {
387
+ this._$AH !== A$1 && d(this._$AH) ? this._$AA.nextSibling.data = t2 : this.$(r.createTextNode(t2)), this._$AH = t2;
388
+ }
389
+ g(t2) {
390
+ var i2;
391
+ const { values: s2, _$litType$: e2 } = t2, o3 = "number" == typeof e2 ? this._$AC(t2) : (void 0 === e2.el && (e2.el = N.createElement(P(e2.h, e2.h[0]), this.options)), e2);
392
+ if ((null === (i2 = this._$AH) || void 0 === i2 ? void 0 : i2._$AD) === o3) this._$AH.v(s2);
393
+ else {
394
+ const t3 = new M(o3, this), i3 = t3.u(this.options);
395
+ t3.v(s2), this.$(i3), this._$AH = t3;
396
+ }
397
+ }
398
+ _$AC(t2) {
399
+ let i2 = E.get(t2.strings);
400
+ return void 0 === i2 && E.set(t2.strings, i2 = new N(t2)), i2;
401
+ }
402
+ T(t2) {
403
+ c$1(this._$AH) || (this._$AH = [], this._$AR());
404
+ const i2 = this._$AH;
405
+ let s2, e2 = 0;
406
+ for (const o3 of t2) e2 === i2.length ? i2.push(s2 = new R(this.k(u2()), this.k(u2()), this, this.options)) : s2 = i2[e2], s2._$AI(o3), e2++;
407
+ e2 < i2.length && (this._$AR(s2 && s2._$AB.nextSibling, e2), i2.length = e2);
408
+ }
409
+ _$AR(t2 = this._$AA.nextSibling, i2) {
410
+ var s2;
411
+ for (null === (s2 = this._$AP) || void 0 === s2 || s2.call(this, false, true, i2); t2 && t2 !== this._$AB; ) {
412
+ const i3 = t2.nextSibling;
413
+ t2.remove(), t2 = i3;
414
+ }
415
+ }
416
+ setConnected(t2) {
417
+ var i2;
418
+ void 0 === this._$AM && (this._$Cp = t2, null === (i2 = this._$AP) || void 0 === i2 || i2.call(this, t2));
419
+ }
420
+ }
421
+ class k {
422
+ constructor(t2, i2, s2, e2, o3) {
423
+ this.type = 1, this._$AH = A$1, this._$AN = void 0, this.element = t2, this.name = i2, this._$AM = e2, this.options = o3, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = A$1;
424
+ }
425
+ get tagName() {
426
+ return this.element.tagName;
427
+ }
428
+ get _$AU() {
429
+ return this._$AM._$AU;
430
+ }
431
+ _$AI(t2, i2 = this, s2, e2) {
432
+ const o3 = this.strings;
433
+ let n2 = false;
434
+ if (void 0 === o3) t2 = S$1(this, t2, i2, 0), n2 = !d(t2) || t2 !== this._$AH && t2 !== T$1, n2 && (this._$AH = t2);
435
+ else {
436
+ const e3 = t2;
437
+ let l2, h2;
438
+ for (t2 = o3[0], l2 = 0; l2 < o3.length - 1; l2++) h2 = S$1(this, e3[s2 + l2], i2, l2), h2 === T$1 && (h2 = this._$AH[l2]), n2 || (n2 = !d(h2) || h2 !== this._$AH[l2]), h2 === A$1 ? t2 = A$1 : t2 !== A$1 && (t2 += (null != h2 ? h2 : "") + o3[l2 + 1]), this._$AH[l2] = h2;
439
+ }
440
+ n2 && !e2 && this.j(t2);
441
+ }
442
+ j(t2) {
443
+ t2 === A$1 ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, null != t2 ? t2 : "");
444
+ }
445
+ }
446
+ class H extends k {
447
+ constructor() {
448
+ super(...arguments), this.type = 3;
449
+ }
450
+ j(t2) {
451
+ this.element[this.name] = t2 === A$1 ? void 0 : t2;
452
+ }
453
+ }
454
+ const I = s$1 ? s$1.emptyScript : "";
455
+ let L$1 = class L extends k {
456
+ constructor() {
457
+ super(...arguments), this.type = 4;
458
+ }
459
+ j(t2) {
460
+ t2 && t2 !== A$1 ? this.element.setAttribute(this.name, I) : this.element.removeAttribute(this.name);
461
+ }
462
+ };
463
+ class z extends k {
464
+ constructor(t2, i2, s2, e2, o3) {
465
+ super(t2, i2, s2, e2, o3), this.type = 5;
466
+ }
467
+ _$AI(t2, i2 = this) {
468
+ var s2;
469
+ if ((t2 = null !== (s2 = S$1(this, t2, i2, 0)) && void 0 !== s2 ? s2 : A$1) === T$1) return;
470
+ const e2 = this._$AH, o3 = t2 === A$1 && e2 !== A$1 || t2.capture !== e2.capture || t2.once !== e2.once || t2.passive !== e2.passive, n2 = t2 !== A$1 && (e2 === A$1 || o3);
471
+ o3 && this.element.removeEventListener(this.name, this, e2), n2 && this.element.addEventListener(this.name, this, t2), this._$AH = t2;
472
+ }
473
+ handleEvent(t2) {
474
+ var i2, s2;
475
+ "function" == typeof this._$AH ? this._$AH.call(null !== (s2 = null === (i2 = this.options) || void 0 === i2 ? void 0 : i2.host) && void 0 !== s2 ? s2 : this.element, t2) : this._$AH.handleEvent(t2);
476
+ }
477
+ }
478
+ let Z$1 = class Z {
479
+ constructor(t2, i2, s2) {
480
+ this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i2, this.options = s2;
481
+ }
482
+ get _$AU() {
483
+ return this._$AM._$AU;
484
+ }
485
+ _$AI(t2) {
486
+ S$1(this, t2);
487
+ }
488
+ };
489
+ const B$1 = i$2.litHtmlPolyfillSupport;
490
+ null == B$1 || B$1(N, R), (null !== (t$2 = i$2.litHtmlVersions) && void 0 !== t$2 ? t$2 : i$2.litHtmlVersions = []).push("2.8.0");
491
+ const D$1 = (t2, i2, s2) => {
492
+ var e2, o3;
493
+ const n2 = null !== (e2 = null == s2 ? void 0 : s2.renderBefore) && void 0 !== e2 ? e2 : i2;
494
+ let l2 = n2._$litPart$;
495
+ if (void 0 === l2) {
496
+ const t3 = null !== (o3 = null == s2 ? void 0 : s2.renderBefore) && void 0 !== o3 ? o3 : null;
497
+ n2._$litPart$ = l2 = new R(i2.insertBefore(u2(), t3), t3, void 0, null != s2 ? s2 : {});
498
+ }
499
+ return l2._$AI(t2), l2;
500
+ };
501
+ /**
502
+ * @license
503
+ * Copyright 2017 Google LLC
504
+ * SPDX-License-Identifier: BSD-3-Clause
505
+ */
506
+ var l$1, o$1;
507
+ class s extends u$1 {
508
+ constructor() {
509
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
510
+ }
511
+ createRenderRoot() {
512
+ var t2, e2;
513
+ const i2 = super.createRenderRoot();
514
+ return null !== (t2 = (e2 = this.renderOptions).renderBefore) && void 0 !== t2 || (e2.renderBefore = i2.firstChild), i2;
515
+ }
516
+ update(t2) {
517
+ const i2 = this.render();
518
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this._$Do = D$1(i2, this.renderRoot, this.renderOptions);
519
+ }
520
+ connectedCallback() {
521
+ var t2;
522
+ super.connectedCallback(), null === (t2 = this._$Do) || void 0 === t2 || t2.setConnected(true);
523
+ }
524
+ disconnectedCallback() {
525
+ var t2;
526
+ super.disconnectedCallback(), null === (t2 = this._$Do) || void 0 === t2 || t2.setConnected(false);
527
+ }
528
+ render() {
529
+ return T$1;
530
+ }
531
+ }
532
+ s.finalized = true, s._$litElement$ = true, null === (l$1 = globalThis.litElementHydrateSupport) || void 0 === l$1 || l$1.call(globalThis, { LitElement: s });
533
+ const n$2 = globalThis.litElementPolyfillSupport;
534
+ null == n$2 || n$2({ LitElement: s });
535
+ (null !== (o$1 = globalThis.litElementVersions) && void 0 !== o$1 ? o$1 : globalThis.litElementVersions = []).push("3.3.3");
536
+ /**
537
+ * @license
538
+ * Copyright 2017 Google LLC
539
+ * SPDX-License-Identifier: BSD-3-Clause
540
+ */
541
+ const e$2 = (e2) => (n2) => "function" == typeof n2 ? ((e3, n3) => (customElements.define(e3, n3), n3))(e2, n2) : ((e3, n3) => {
542
+ const { kind: t2, elements: s2 } = n3;
543
+ return { kind: t2, elements: s2, finisher(n4) {
544
+ customElements.define(e3, n4);
545
+ } };
546
+ })(e2, n2);
547
+ /**
548
+ * @license
549
+ * Copyright 2017 Google LLC
550
+ * SPDX-License-Identifier: BSD-3-Clause
551
+ */
552
+ const i$1 = (i2, e2) => "method" === e2.kind && e2.descriptor && !("value" in e2.descriptor) ? { ...e2, finisher(n2) {
553
+ n2.createProperty(e2.key, i2);
554
+ } } : { kind: "field", key: Symbol(), placement: "own", descriptor: {}, originalKey: e2.key, initializer() {
555
+ "function" == typeof e2.initializer && (this[e2.key] = e2.initializer.call(this));
556
+ }, finisher(n2) {
557
+ n2.createProperty(e2.key, i2);
558
+ } }, e$1 = (i2, e2, n2) => {
559
+ e2.constructor.createProperty(n2, i2);
560
+ };
561
+ function n$1(n2) {
562
+ return (t2, o3) => void 0 !== o3 ? e$1(n2, t2, o3) : i$1(n2, t2);
563
+ }
564
+ /**
565
+ * @license
566
+ * Copyright 2017 Google LLC
567
+ * SPDX-License-Identifier: BSD-3-Clause
568
+ */
569
+ function t$1(t2) {
570
+ return n$1({ ...t2, state: true });
571
+ }
572
+ /**
573
+ * @license
574
+ * Copyright 2021 Google LLC
575
+ * SPDX-License-Identifier: BSD-3-Clause
576
+ */
577
+ var n;
578
+ null != (null === (n = window.HTMLSlotElement) || void 0 === n ? void 0 : n.prototype.assignedElements) ? (o3, n2) => o3.assignedElements(n2) : (o3, n2) => o3.assignedNodes(n2).filter((o4) => o4.nodeType === Node.ELEMENT_NODE);
579
+ /**
580
+ * @license
581
+ * Copyright 2017 Google LLC
582
+ * SPDX-License-Identifier: BSD-3-Clause
583
+ */
584
+ const t = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, e = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 });
585
+ class i {
586
+ constructor(t2) {
587
+ }
588
+ get _$AU() {
589
+ return this._$AM._$AU;
590
+ }
591
+ _$AT(t2, e2, i2) {
592
+ this._$Ct = t2, this._$AM = e2, this._$Ci = i2;
593
+ }
594
+ _$AS(t2, e2) {
595
+ return this.update(t2, e2);
596
+ }
597
+ update(t2, e2) {
598
+ return this.render(...e2);
599
+ }
600
+ }
601
+ /**
602
+ * @license
603
+ * Copyright 2018 Google LLC
604
+ * SPDX-License-Identifier: BSD-3-Clause
605
+ */
606
+ const o2 = e(class extends i {
607
+ constructor(t$12) {
608
+ var i2;
609
+ if (super(t$12), t$12.type !== t.ATTRIBUTE || "class" !== t$12.name || (null === (i2 = t$12.strings) || void 0 === i2 ? void 0 : i2.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
610
+ }
611
+ render(t2) {
612
+ return " " + Object.keys(t2).filter((i2) => t2[i2]).join(" ") + " ";
613
+ }
614
+ update(i2, [s2]) {
615
+ var r2, o3;
616
+ if (void 0 === this.it) {
617
+ this.it = /* @__PURE__ */ new Set(), void 0 !== i2.strings && (this.nt = new Set(i2.strings.join(" ").split(/\s/).filter((t2) => "" !== t2)));
618
+ for (const t2 in s2) s2[t2] && !(null === (r2 = this.nt) || void 0 === r2 ? void 0 : r2.has(t2)) && this.it.add(t2);
619
+ return this.render(s2);
620
+ }
621
+ const e2 = i2.element.classList;
622
+ this.it.forEach((t2) => {
623
+ t2 in s2 || (e2.remove(t2), this.it.delete(t2));
624
+ });
625
+ for (const t2 in s2) {
626
+ const i3 = !!s2[t2];
627
+ i3 === this.it.has(t2) || (null === (o3 = this.nt) || void 0 === o3 ? void 0 : o3.has(t2)) || (i3 ? (e2.add(t2), this.it.add(t2)) : (e2.remove(t2), this.it.delete(t2)));
628
+ }
629
+ return T$1;
630
+ }
631
+ });
632
+ function addUniqueItem(array, item) {
633
+ array.indexOf(item) === -1 && array.push(item);
634
+ }
635
+ const clamp = (min, max, v2) => Math.min(Math.max(v2, min), max);
636
+ const defaults = {
637
+ duration: 0.3,
638
+ delay: 0,
639
+ endDelay: 0,
640
+ repeat: 0,
641
+ easing: "ease"
642
+ };
643
+ const isNumber = (value) => typeof value === "number";
644
+ const isEasingList = (easing) => Array.isArray(easing) && !isNumber(easing[0]);
645
+ const wrap = (min, max, v2) => {
646
+ const rangeSize = max - min;
647
+ return ((v2 - min) % rangeSize + rangeSize) % rangeSize + min;
648
+ };
649
+ function getEasingForSegment(easing, i2) {
650
+ return isEasingList(easing) ? easing[wrap(0, easing.length, i2)] : easing;
651
+ }
652
+ const mix = (min, max, progress2) => -progress2 * min + progress2 * max + min;
653
+ const noop = () => {
654
+ };
655
+ const noopReturn = (v2) => v2;
656
+ const progress = (min, max, value) => max - min === 0 ? 1 : (value - min) / (max - min);
657
+ function fillOffset(offset, remaining) {
658
+ const min = offset[offset.length - 1];
659
+ for (let i2 = 1; i2 <= remaining; i2++) {
660
+ const offsetProgress = progress(0, remaining, i2);
661
+ offset.push(mix(min, 1, offsetProgress));
662
+ }
663
+ }
664
+ function defaultOffset(length) {
665
+ const offset = [0];
666
+ fillOffset(offset, length - 1);
667
+ return offset;
668
+ }
669
+ function interpolate(output, input = defaultOffset(output.length), easing = noopReturn) {
670
+ const length = output.length;
671
+ const remainder = length - input.length;
672
+ remainder > 0 && fillOffset(input, remainder);
673
+ return (t2) => {
674
+ let i2 = 0;
675
+ for (; i2 < length - 2; i2++) {
676
+ if (t2 < input[i2 + 1])
677
+ break;
678
+ }
679
+ let progressInRange = clamp(0, 1, progress(input[i2], input[i2 + 1], t2));
680
+ const segmentEasing = getEasingForSegment(easing, i2);
681
+ progressInRange = segmentEasing(progressInRange);
682
+ return mix(output[i2], output[i2 + 1], progressInRange);
683
+ };
684
+ }
685
+ const isCubicBezier = (easing) => Array.isArray(easing) && isNumber(easing[0]);
686
+ const isEasingGenerator = (easing) => typeof easing === "object" && Boolean(easing.createAnimation);
687
+ const isFunction = (value) => typeof value === "function";
688
+ const isString = (value) => typeof value === "string";
689
+ const time = {
690
+ ms: (seconds) => seconds * 1e3,
691
+ s: (milliseconds) => milliseconds / 1e3
692
+ };
693
+ const calcBezier = (t2, a1, a2) => (((1 - 3 * a2 + 3 * a1) * t2 + (3 * a2 - 6 * a1)) * t2 + 3 * a1) * t2;
694
+ const subdivisionPrecision = 1e-7;
695
+ const subdivisionMaxIterations = 12;
696
+ function binarySubdivide(x2, lowerBound, upperBound, mX1, mX2) {
697
+ let currentX;
698
+ let currentT;
699
+ let i2 = 0;
700
+ do {
701
+ currentT = lowerBound + (upperBound - lowerBound) / 2;
702
+ currentX = calcBezier(currentT, mX1, mX2) - x2;
703
+ if (currentX > 0) {
704
+ upperBound = currentT;
705
+ } else {
706
+ lowerBound = currentT;
707
+ }
708
+ } while (Math.abs(currentX) > subdivisionPrecision && ++i2 < subdivisionMaxIterations);
709
+ return currentT;
710
+ }
711
+ function cubicBezier(mX1, mY1, mX2, mY2) {
712
+ if (mX1 === mY1 && mX2 === mY2)
713
+ return noopReturn;
714
+ const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);
715
+ return (t2) => t2 === 0 || t2 === 1 ? t2 : calcBezier(getTForX(t2), mY1, mY2);
716
+ }
717
+ const steps = (steps2, direction = "end") => (progress2) => {
718
+ progress2 = direction === "end" ? Math.min(progress2, 0.999) : Math.max(progress2, 1e-3);
719
+ const expanded = progress2 * steps2;
720
+ const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded);
721
+ return clamp(0, 1, rounded / steps2);
722
+ };
723
+ const namedEasings = {
724
+ ease: cubicBezier(0.25, 0.1, 0.25, 1),
725
+ "ease-in": cubicBezier(0.42, 0, 1, 1),
726
+ "ease-in-out": cubicBezier(0.42, 0, 0.58, 1),
727
+ "ease-out": cubicBezier(0, 0, 0.58, 1)
728
+ };
729
+ const functionArgsRegex = /\((.*?)\)/;
730
+ function getEasingFunction(definition) {
731
+ if (isFunction(definition))
732
+ return definition;
733
+ if (isCubicBezier(definition))
734
+ return cubicBezier(...definition);
735
+ const namedEasing = namedEasings[definition];
736
+ if (namedEasing)
737
+ return namedEasing;
738
+ if (definition.startsWith("steps")) {
739
+ const args = functionArgsRegex.exec(definition);
740
+ if (args) {
741
+ const argsArray = args[1].split(",");
742
+ return steps(parseFloat(argsArray[0]), argsArray[1].trim());
743
+ }
744
+ }
745
+ return noopReturn;
746
+ }
747
+ class Animation {
748
+ constructor(output, keyframes = [0, 1], { easing, duration: initialDuration = defaults.duration, delay = defaults.delay, endDelay = defaults.endDelay, repeat = defaults.repeat, offset, direction = "normal", autoplay = true } = {}) {
749
+ this.startTime = null;
750
+ this.rate = 1;
751
+ this.t = 0;
752
+ this.cancelTimestamp = null;
753
+ this.easing = noopReturn;
754
+ this.duration = 0;
755
+ this.totalDuration = 0;
756
+ this.repeat = 0;
757
+ this.playState = "idle";
758
+ this.finished = new Promise((resolve, reject) => {
759
+ this.resolve = resolve;
760
+ this.reject = reject;
761
+ });
762
+ easing = easing || defaults.easing;
763
+ if (isEasingGenerator(easing)) {
764
+ const custom = easing.createAnimation(keyframes);
765
+ easing = custom.easing;
766
+ keyframes = custom.keyframes || keyframes;
767
+ initialDuration = custom.duration || initialDuration;
768
+ }
769
+ this.repeat = repeat;
770
+ this.easing = isEasingList(easing) ? noopReturn : getEasingFunction(easing);
771
+ this.updateDuration(initialDuration);
772
+ const interpolate$1 = interpolate(keyframes, offset, isEasingList(easing) ? easing.map(getEasingFunction) : noopReturn);
773
+ this.tick = (timestamp) => {
774
+ var _a;
775
+ delay = delay;
776
+ let t2 = 0;
777
+ if (this.pauseTime !== void 0) {
778
+ t2 = this.pauseTime;
779
+ } else {
780
+ t2 = (timestamp - this.startTime) * this.rate;
781
+ }
782
+ this.t = t2;
783
+ t2 /= 1e3;
784
+ t2 = Math.max(t2 - delay, 0);
785
+ if (this.playState === "finished" && this.pauseTime === void 0) {
786
+ t2 = this.totalDuration;
787
+ }
788
+ const progress2 = t2 / this.duration;
789
+ let currentIteration = Math.floor(progress2);
790
+ let iterationProgress = progress2 % 1;
791
+ if (!iterationProgress && progress2 >= 1) {
792
+ iterationProgress = 1;
793
+ }
794
+ iterationProgress === 1 && currentIteration--;
795
+ const iterationIsOdd = currentIteration % 2;
796
+ if (direction === "reverse" || direction === "alternate" && iterationIsOdd || direction === "alternate-reverse" && !iterationIsOdd) {
797
+ iterationProgress = 1 - iterationProgress;
798
+ }
799
+ const p2 = t2 >= this.totalDuration ? 1 : Math.min(iterationProgress, 1);
800
+ const latest = interpolate$1(this.easing(p2));
801
+ output(latest);
802
+ const isAnimationFinished = this.pauseTime === void 0 && (this.playState === "finished" || t2 >= this.totalDuration + endDelay);
803
+ if (isAnimationFinished) {
804
+ this.playState = "finished";
805
+ (_a = this.resolve) === null || _a === void 0 ? void 0 : _a.call(this, latest);
806
+ } else if (this.playState !== "idle") {
807
+ this.frameRequestId = requestAnimationFrame(this.tick);
808
+ }
809
+ };
810
+ if (autoplay)
811
+ this.play();
812
+ }
813
+ play() {
814
+ const now = performance.now();
815
+ this.playState = "running";
816
+ if (this.pauseTime !== void 0) {
817
+ this.startTime = now - this.pauseTime;
818
+ } else if (!this.startTime) {
819
+ this.startTime = now;
820
+ }
821
+ this.cancelTimestamp = this.startTime;
822
+ this.pauseTime = void 0;
823
+ this.frameRequestId = requestAnimationFrame(this.tick);
824
+ }
825
+ pause() {
826
+ this.playState = "paused";
827
+ this.pauseTime = this.t;
828
+ }
829
+ finish() {
830
+ this.playState = "finished";
831
+ this.tick(0);
832
+ }
833
+ stop() {
834
+ var _a;
835
+ this.playState = "idle";
836
+ if (this.frameRequestId !== void 0) {
837
+ cancelAnimationFrame(this.frameRequestId);
838
+ }
839
+ (_a = this.reject) === null || _a === void 0 ? void 0 : _a.call(this, false);
840
+ }
841
+ cancel() {
842
+ this.stop();
843
+ this.tick(this.cancelTimestamp);
844
+ }
845
+ reverse() {
846
+ this.rate *= -1;
847
+ }
848
+ commitStyles() {
849
+ }
850
+ updateDuration(duration) {
851
+ this.duration = duration;
852
+ this.totalDuration = duration * (this.repeat + 1);
853
+ }
854
+ get currentTime() {
855
+ return this.t;
856
+ }
857
+ set currentTime(t2) {
858
+ if (this.pauseTime !== void 0 || this.rate === 0) {
859
+ this.pauseTime = t2;
860
+ } else {
861
+ this.startTime = performance.now() - t2 / this.rate;
862
+ }
863
+ }
864
+ get playbackRate() {
865
+ return this.rate;
866
+ }
867
+ set playbackRate(rate) {
868
+ this.rate = rate;
869
+ }
870
+ }
871
+ var define_process_env_default = {};
872
+ var invariant = function() {
873
+ };
874
+ if (define_process_env_default.NODE_ENV !== "production") {
875
+ invariant = function(check, message) {
876
+ if (!check) {
877
+ throw new Error(message);
878
+ }
879
+ };
880
+ }
881
+ class MotionValue {
882
+ setAnimation(animation) {
883
+ this.animation = animation;
884
+ animation === null || animation === void 0 ? void 0 : animation.finished.then(() => this.clearAnimation()).catch(() => {
885
+ });
886
+ }
887
+ clearAnimation() {
888
+ this.animation = this.generator = void 0;
889
+ }
890
+ }
891
+ const data = /* @__PURE__ */ new WeakMap();
892
+ function getAnimationData(element) {
893
+ if (!data.has(element)) {
894
+ data.set(element, {
895
+ transforms: [],
896
+ values: /* @__PURE__ */ new Map()
897
+ });
898
+ }
899
+ return data.get(element);
900
+ }
901
+ function getMotionValue(motionValues, name) {
902
+ if (!motionValues.has(name)) {
903
+ motionValues.set(name, new MotionValue());
904
+ }
905
+ return motionValues.get(name);
906
+ }
907
+ const axes = ["", "X", "Y", "Z"];
908
+ const order = ["translate", "scale", "rotate", "skew"];
909
+ const transformAlias = {
910
+ x: "translateX",
911
+ y: "translateY",
912
+ z: "translateZ"
913
+ };
914
+ const rotation = {
915
+ syntax: "<angle>",
916
+ initialValue: "0deg",
917
+ toDefaultUnit: (v2) => v2 + "deg"
918
+ };
919
+ const baseTransformProperties = {
920
+ translate: {
921
+ syntax: "<length-percentage>",
922
+ initialValue: "0px",
923
+ toDefaultUnit: (v2) => v2 + "px"
924
+ },
925
+ rotate: rotation,
926
+ scale: {
927
+ syntax: "<number>",
928
+ initialValue: 1,
929
+ toDefaultUnit: noopReturn
930
+ },
931
+ skew: rotation
932
+ };
933
+ const transformDefinitions = /* @__PURE__ */ new Map();
934
+ const asTransformCssVar = (name) => `--motion-${name}`;
935
+ const transforms = ["x", "y", "z"];
936
+ order.forEach((name) => {
937
+ axes.forEach((axis) => {
938
+ transforms.push(name + axis);
939
+ transformDefinitions.set(asTransformCssVar(name + axis), baseTransformProperties[name]);
940
+ });
941
+ });
942
+ const compareTransformOrder = (a2, b2) => transforms.indexOf(a2) - transforms.indexOf(b2);
943
+ const transformLookup = new Set(transforms);
944
+ const isTransform = (name) => transformLookup.has(name);
945
+ const addTransformToElement = (element, name) => {
946
+ if (transformAlias[name])
947
+ name = transformAlias[name];
948
+ const { transforms: transforms2 } = getAnimationData(element);
949
+ addUniqueItem(transforms2, name);
950
+ element.style.transform = buildTransformTemplate(transforms2);
951
+ };
952
+ const buildTransformTemplate = (transforms2) => transforms2.sort(compareTransformOrder).reduce(transformListToString, "").trim();
953
+ const transformListToString = (template, name) => `${template} ${name}(var(${asTransformCssVar(name)}))`;
954
+ const isCssVar = (name) => name.startsWith("--");
955
+ const registeredProperties = /* @__PURE__ */ new Set();
956
+ function registerCssVariable(name) {
957
+ if (registeredProperties.has(name))
958
+ return;
959
+ registeredProperties.add(name);
960
+ try {
961
+ const { syntax, initialValue } = transformDefinitions.has(name) ? transformDefinitions.get(name) : {};
962
+ CSS.registerProperty({
963
+ name,
964
+ inherits: false,
965
+ syntax,
966
+ initialValue
967
+ });
968
+ } catch (e2) {
969
+ }
970
+ }
971
+ const testAnimation = (keyframes, options) => document.createElement("div").animate(keyframes, options);
972
+ const featureTests = {
973
+ cssRegisterProperty: () => typeof CSS !== "undefined" && Object.hasOwnProperty.call(CSS, "registerProperty"),
974
+ waapi: () => Object.hasOwnProperty.call(Element.prototype, "animate"),
975
+ partialKeyframes: () => {
976
+ try {
977
+ testAnimation({ opacity: [1] });
978
+ } catch (e2) {
979
+ return false;
980
+ }
981
+ return true;
982
+ },
983
+ finished: () => Boolean(testAnimation({ opacity: [0, 1] }, { duration: 1e-3 }).finished),
984
+ linearEasing: () => {
985
+ try {
986
+ testAnimation({ opacity: 0 }, { easing: "linear(0, 1)" });
987
+ } catch (e2) {
988
+ return false;
989
+ }
990
+ return true;
991
+ }
992
+ };
993
+ const results = {};
994
+ const supports = {};
995
+ for (const key in featureTests) {
996
+ supports[key] = () => {
997
+ if (results[key] === void 0)
998
+ results[key] = featureTests[key]();
999
+ return results[key];
1000
+ };
1001
+ }
1002
+ const resolution = 0.015;
1003
+ const generateLinearEasingPoints = (easing, duration) => {
1004
+ let points = "";
1005
+ const numPoints = Math.round(duration / resolution);
1006
+ for (let i2 = 0; i2 < numPoints; i2++) {
1007
+ points += easing(progress(0, numPoints - 1, i2)) + ", ";
1008
+ }
1009
+ return points.substring(0, points.length - 2);
1010
+ };
1011
+ const convertEasing = (easing, duration) => {
1012
+ if (isFunction(easing)) {
1013
+ return supports.linearEasing() ? `linear(${generateLinearEasingPoints(easing, duration)})` : defaults.easing;
1014
+ } else {
1015
+ return isCubicBezier(easing) ? cubicBezierAsString(easing) : easing;
1016
+ }
1017
+ };
1018
+ const cubicBezierAsString = ([a2, b2, c2, d2]) => `cubic-bezier(${a2}, ${b2}, ${c2}, ${d2})`;
1019
+ function hydrateKeyframes(keyframes, readInitialValue) {
1020
+ for (let i2 = 0; i2 < keyframes.length; i2++) {
1021
+ if (keyframes[i2] === null) {
1022
+ keyframes[i2] = i2 ? keyframes[i2 - 1] : readInitialValue();
1023
+ }
1024
+ }
1025
+ return keyframes;
1026
+ }
1027
+ const keyframesList = (keyframes) => Array.isArray(keyframes) ? keyframes : [keyframes];
1028
+ function getStyleName(key) {
1029
+ if (transformAlias[key])
1030
+ key = transformAlias[key];
1031
+ return isTransform(key) ? asTransformCssVar(key) : key;
1032
+ }
1033
+ const style = {
1034
+ get: (element, name) => {
1035
+ name = getStyleName(name);
1036
+ let value = isCssVar(name) ? element.style.getPropertyValue(name) : getComputedStyle(element)[name];
1037
+ if (!value && value !== 0) {
1038
+ const definition = transformDefinitions.get(name);
1039
+ if (definition)
1040
+ value = definition.initialValue;
1041
+ }
1042
+ return value;
1043
+ },
1044
+ set: (element, name, value) => {
1045
+ name = getStyleName(name);
1046
+ if (isCssVar(name)) {
1047
+ element.style.setProperty(name, value);
1048
+ } else {
1049
+ element.style[name] = value;
1050
+ }
1051
+ }
1052
+ };
1053
+ function stopAnimation(animation, needsCommit = true) {
1054
+ if (!animation || animation.playState === "finished")
1055
+ return;
1056
+ try {
1057
+ if (animation.stop) {
1058
+ animation.stop();
1059
+ } else {
1060
+ needsCommit && animation.commitStyles();
1061
+ animation.cancel();
1062
+ }
1063
+ } catch (e2) {
1064
+ }
1065
+ }
1066
+ function getUnitConverter(keyframes, definition) {
1067
+ var _a;
1068
+ let toUnit = (definition === null || definition === void 0 ? void 0 : definition.toDefaultUnit) || noopReturn;
1069
+ const finalKeyframe = keyframes[keyframes.length - 1];
1070
+ if (isString(finalKeyframe)) {
1071
+ const unit = ((_a = finalKeyframe.match(/(-?[\d.]+)([a-z%]*)/)) === null || _a === void 0 ? void 0 : _a[2]) || "";
1072
+ if (unit)
1073
+ toUnit = (value) => value + unit;
1074
+ }
1075
+ return toUnit;
1076
+ }
1077
+ function getDevToolsRecord() {
1078
+ return window.__MOTION_DEV_TOOLS_RECORD;
1079
+ }
1080
+ function animateStyle(element, key, keyframesDefinition, options = {}, AnimationPolyfill) {
1081
+ const record = getDevToolsRecord();
1082
+ const isRecording = options.record !== false && record;
1083
+ let animation;
1084
+ let { duration = defaults.duration, delay = defaults.delay, endDelay = defaults.endDelay, repeat = defaults.repeat, easing = defaults.easing, persist = false, direction, offset, allowWebkitAcceleration = false, autoplay = true } = options;
1085
+ const data2 = getAnimationData(element);
1086
+ const valueIsTransform = isTransform(key);
1087
+ let canAnimateNatively = supports.waapi();
1088
+ valueIsTransform && addTransformToElement(element, key);
1089
+ const name = getStyleName(key);
1090
+ const motionValue = getMotionValue(data2.values, name);
1091
+ const definition = transformDefinitions.get(name);
1092
+ stopAnimation(motionValue.animation, !(isEasingGenerator(easing) && motionValue.generator) && options.record !== false);
1093
+ return () => {
1094
+ const readInitialValue = () => {
1095
+ var _a, _b;
1096
+ return (_b = (_a = style.get(element, name)) !== null && _a !== void 0 ? _a : definition === null || definition === void 0 ? void 0 : definition.initialValue) !== null && _b !== void 0 ? _b : 0;
1097
+ };
1098
+ let keyframes = hydrateKeyframes(keyframesList(keyframesDefinition), readInitialValue);
1099
+ const toUnit = getUnitConverter(keyframes, definition);
1100
+ if (isEasingGenerator(easing)) {
1101
+ const custom = easing.createAnimation(keyframes, key !== "opacity", readInitialValue, name, motionValue);
1102
+ easing = custom.easing;
1103
+ keyframes = custom.keyframes || keyframes;
1104
+ duration = custom.duration || duration;
1105
+ }
1106
+ if (isCssVar(name)) {
1107
+ if (supports.cssRegisterProperty()) {
1108
+ registerCssVariable(name);
1109
+ } else {
1110
+ canAnimateNatively = false;
1111
+ }
1112
+ }
1113
+ if (valueIsTransform && !supports.linearEasing() && (isFunction(easing) || isEasingList(easing) && easing.some(isFunction))) {
1114
+ canAnimateNatively = false;
1115
+ }
1116
+ if (canAnimateNatively) {
1117
+ if (definition) {
1118
+ keyframes = keyframes.map((value) => isNumber(value) ? definition.toDefaultUnit(value) : value);
1119
+ }
1120
+ if (keyframes.length === 1 && (!supports.partialKeyframes() || isRecording)) {
1121
+ keyframes.unshift(readInitialValue());
1122
+ }
1123
+ const animationOptions = {
1124
+ delay: time.ms(delay),
1125
+ duration: time.ms(duration),
1126
+ endDelay: time.ms(endDelay),
1127
+ easing: !isEasingList(easing) ? convertEasing(easing, duration) : void 0,
1128
+ direction,
1129
+ iterations: repeat + 1,
1130
+ fill: "both"
1131
+ };
1132
+ animation = element.animate({
1133
+ [name]: keyframes,
1134
+ offset,
1135
+ easing: isEasingList(easing) ? easing.map((thisEasing) => convertEasing(thisEasing, duration)) : void 0
1136
+ }, animationOptions);
1137
+ if (!animation.finished) {
1138
+ animation.finished = new Promise((resolve, reject) => {
1139
+ animation.onfinish = resolve;
1140
+ animation.oncancel = reject;
1141
+ });
1142
+ }
1143
+ const target = keyframes[keyframes.length - 1];
1144
+ animation.finished.then(() => {
1145
+ if (persist)
1146
+ return;
1147
+ style.set(element, name, target);
1148
+ animation.cancel();
1149
+ }).catch(noop);
1150
+ if (!allowWebkitAcceleration)
1151
+ animation.playbackRate = 1.000001;
1152
+ } else if (AnimationPolyfill && valueIsTransform) {
1153
+ keyframes = keyframes.map((value) => typeof value === "string" ? parseFloat(value) : value);
1154
+ if (keyframes.length === 1) {
1155
+ keyframes.unshift(parseFloat(readInitialValue()));
1156
+ }
1157
+ animation = new AnimationPolyfill((latest) => {
1158
+ style.set(element, name, toUnit ? toUnit(latest) : latest);
1159
+ }, keyframes, Object.assign(Object.assign({}, options), {
1160
+ duration,
1161
+ easing
1162
+ }));
1163
+ } else {
1164
+ const target = keyframes[keyframes.length - 1];
1165
+ style.set(element, name, definition && isNumber(target) ? definition.toDefaultUnit(target) : target);
1166
+ }
1167
+ if (isRecording) {
1168
+ record(element, key, keyframes, {
1169
+ duration,
1170
+ delay,
1171
+ easing,
1172
+ repeat,
1173
+ offset
1174
+ }, "motion-one");
1175
+ }
1176
+ motionValue.setAnimation(animation);
1177
+ if (animation && !autoplay)
1178
+ animation.pause();
1179
+ return animation;
1180
+ };
1181
+ }
1182
+ const getOptions = (options, key) => (
1183
+ /**
1184
+ * TODO: Make test for this
1185
+ * Always return a new object otherwise delay is overwritten by results of stagger
1186
+ * and this results in no stagger
1187
+ */
1188
+ options[key] ? Object.assign(Object.assign({}, options), options[key]) : Object.assign({}, options)
1189
+ );
1190
+ function resolveElements(elements, selectorCache) {
1191
+ if (typeof elements === "string") {
1192
+ {
1193
+ elements = document.querySelectorAll(elements);
1194
+ }
1195
+ } else if (elements instanceof Element) {
1196
+ elements = [elements];
1197
+ }
1198
+ return Array.from(elements || []);
1199
+ }
1200
+ const createAnimation = (factory) => factory();
1201
+ const withControls = (animationFactory, options, duration = defaults.duration) => {
1202
+ return new Proxy({
1203
+ animations: animationFactory.map(createAnimation).filter(Boolean),
1204
+ duration,
1205
+ options
1206
+ }, controls);
1207
+ };
1208
+ const getActiveAnimation = (state) => state.animations[0];
1209
+ const controls = {
1210
+ get: (target, key) => {
1211
+ const activeAnimation = getActiveAnimation(target);
1212
+ switch (key) {
1213
+ case "duration":
1214
+ return target.duration;
1215
+ case "currentTime":
1216
+ return time.s((activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]) || 0);
1217
+ case "playbackRate":
1218
+ case "playState":
1219
+ return activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key];
1220
+ case "finished":
1221
+ if (!target.finished) {
1222
+ target.finished = Promise.all(target.animations.map(selectFinished)).catch(noop);
1223
+ }
1224
+ return target.finished;
1225
+ case "stop":
1226
+ return () => {
1227
+ target.animations.forEach((animation) => stopAnimation(animation));
1228
+ };
1229
+ case "forEachNative":
1230
+ return (callback) => {
1231
+ target.animations.forEach((animation) => callback(animation, target));
1232
+ };
1233
+ default:
1234
+ return typeof (activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]) === "undefined" ? void 0 : () => target.animations.forEach((animation) => animation[key]());
1235
+ }
1236
+ },
1237
+ set: (target, key, value) => {
1238
+ switch (key) {
1239
+ case "currentTime":
1240
+ value = time.ms(value);
1241
+ case "playbackRate":
1242
+ for (let i2 = 0; i2 < target.animations.length; i2++) {
1243
+ target.animations[i2][key] = value;
1244
+ }
1245
+ return true;
1246
+ }
1247
+ return false;
1248
+ }
1249
+ };
1250
+ const selectFinished = (animation) => animation.finished;
1251
+ function resolveOption(option, i2, total) {
1252
+ return isFunction(option) ? option(i2, total) : option;
1253
+ }
1254
+ function createAnimate(AnimatePolyfill) {
1255
+ return function animate2(elements, keyframes, options = {}) {
1256
+ elements = resolveElements(elements);
1257
+ const numElements = elements.length;
1258
+ invariant(Boolean(numElements), "No valid element provided.");
1259
+ invariant(Boolean(keyframes), "No keyframes defined.");
1260
+ const animationFactories = [];
1261
+ for (let i2 = 0; i2 < numElements; i2++) {
1262
+ const element = elements[i2];
1263
+ for (const key in keyframes) {
1264
+ const valueOptions = getOptions(options, key);
1265
+ valueOptions.delay = resolveOption(valueOptions.delay, i2, numElements);
1266
+ const animation = animateStyle(element, key, keyframes[key], valueOptions, AnimatePolyfill);
1267
+ animationFactories.push(animation);
1268
+ }
1269
+ }
1270
+ return withControls(
1271
+ animationFactories,
1272
+ options,
1273
+ /**
1274
+ * TODO:
1275
+ * If easing is set to spring or glide, duration will be dynamically
1276
+ * generated. Ideally we would dynamically generate this from
1277
+ * animation.effect.getComputedTiming().duration but this isn't
1278
+ * supported in iOS13 or our number polyfill. Perhaps it's possible
1279
+ * to Proxy animations returned from animateStyle that has duration
1280
+ * as a getter.
1281
+ */
1282
+ options.duration
1283
+ );
1284
+ };
1285
+ }
1286
+ const animate$1 = createAnimate(Animation);
1287
+ function animateProgress(target, options = {}) {
1288
+ return withControls([
1289
+ () => {
1290
+ const animation = new Animation(target, [0, 1], options);
1291
+ animation.finished.catch(() => {
1292
+ });
1293
+ return animation;
1294
+ }
1295
+ ], options, options.duration);
1296
+ }
1297
+ function animate(target, keyframesOrOptions, options) {
1298
+ const factory = isFunction(target) ? animateProgress : animate$1;
1299
+ return factory(target, keyframesOrOptions, options);
1300
+ }
1301
+ /**
1302
+ * @license
1303
+ * Copyright 2018 Google LLC
1304
+ * SPDX-License-Identifier: BSD-3-Clause
1305
+ */
1306
+ const l = (l2) => null != l2 ? l2 : A$1;
1307
+ var browser = {};
1308
+ var canPromise$1 = function() {
1309
+ return typeof Promise === "function" && Promise.prototype && Promise.prototype.then;
1310
+ };
1311
+ var qrcode = {};
1312
+ var utils$1 = {};
1313
+ let toSJISFunction;
1314
+ const CODEWORDS_COUNT = [
1315
+ 0,
1316
+ // Not used
1317
+ 26,
1318
+ 44,
1319
+ 70,
1320
+ 100,
1321
+ 134,
1322
+ 172,
1323
+ 196,
1324
+ 242,
1325
+ 292,
1326
+ 346,
1327
+ 404,
1328
+ 466,
1329
+ 532,
1330
+ 581,
1331
+ 655,
1332
+ 733,
1333
+ 815,
1334
+ 901,
1335
+ 991,
1336
+ 1085,
1337
+ 1156,
1338
+ 1258,
1339
+ 1364,
1340
+ 1474,
1341
+ 1588,
1342
+ 1706,
1343
+ 1828,
1344
+ 1921,
1345
+ 2051,
1346
+ 2185,
1347
+ 2323,
1348
+ 2465,
1349
+ 2611,
1350
+ 2761,
1351
+ 2876,
1352
+ 3034,
1353
+ 3196,
1354
+ 3362,
1355
+ 3532,
1356
+ 3706
1357
+ ];
1358
+ utils$1.getSymbolSize = function getSymbolSize(version2) {
1359
+ if (!version2) throw new Error('"version" cannot be null or undefined');
1360
+ if (version2 < 1 || version2 > 40) throw new Error('"version" should be in range from 1 to 40');
1361
+ return version2 * 4 + 17;
1362
+ };
1363
+ utils$1.getSymbolTotalCodewords = function getSymbolTotalCodewords(version2) {
1364
+ return CODEWORDS_COUNT[version2];
1365
+ };
1366
+ utils$1.getBCHDigit = function(data2) {
1367
+ let digit = 0;
1368
+ while (data2 !== 0) {
1369
+ digit++;
1370
+ data2 >>>= 1;
1371
+ }
1372
+ return digit;
1373
+ };
1374
+ utils$1.setToSJISFunction = function setToSJISFunction(f2) {
1375
+ if (typeof f2 !== "function") {
1376
+ throw new Error('"toSJISFunc" is not a valid function.');
1377
+ }
1378
+ toSJISFunction = f2;
1379
+ };
1380
+ utils$1.isKanjiModeEnabled = function() {
1381
+ return typeof toSJISFunction !== "undefined";
1382
+ };
1383
+ utils$1.toSJIS = function toSJIS(kanji2) {
1384
+ return toSJISFunction(kanji2);
1385
+ };
1386
+ var errorCorrectionLevel = {};
1387
+ (function(exports) {
1388
+ exports.L = { bit: 1 };
1389
+ exports.M = { bit: 0 };
1390
+ exports.Q = { bit: 3 };
1391
+ exports.H = { bit: 2 };
1392
+ function fromString(string) {
1393
+ if (typeof string !== "string") {
1394
+ throw new Error("Param is not a string");
1395
+ }
1396
+ const lcStr = string.toLowerCase();
1397
+ switch (lcStr) {
1398
+ case "l":
1399
+ case "low":
1400
+ return exports.L;
1401
+ case "m":
1402
+ case "medium":
1403
+ return exports.M;
1404
+ case "q":
1405
+ case "quartile":
1406
+ return exports.Q;
1407
+ case "h":
1408
+ case "high":
1409
+ return exports.H;
1410
+ default:
1411
+ throw new Error("Unknown EC Level: " + string);
1412
+ }
1413
+ }
1414
+ exports.isValid = function isValid2(level) {
1415
+ return level && typeof level.bit !== "undefined" && level.bit >= 0 && level.bit < 4;
1416
+ };
1417
+ exports.from = function from(value, defaultValue) {
1418
+ if (exports.isValid(value)) {
1419
+ return value;
1420
+ }
1421
+ try {
1422
+ return fromString(value);
1423
+ } catch (e2) {
1424
+ return defaultValue;
1425
+ }
1426
+ };
1427
+ })(errorCorrectionLevel);
1428
+ function BitBuffer$1() {
1429
+ this.buffer = [];
1430
+ this.length = 0;
1431
+ }
1432
+ BitBuffer$1.prototype = {
1433
+ get: function(index) {
1434
+ const bufIndex = Math.floor(index / 8);
1435
+ return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) === 1;
1436
+ },
1437
+ put: function(num, length) {
1438
+ for (let i2 = 0; i2 < length; i2++) {
1439
+ this.putBit((num >>> length - i2 - 1 & 1) === 1);
1440
+ }
1441
+ },
1442
+ getLengthInBits: function() {
1443
+ return this.length;
1444
+ },
1445
+ putBit: function(bit) {
1446
+ const bufIndex = Math.floor(this.length / 8);
1447
+ if (this.buffer.length <= bufIndex) {
1448
+ this.buffer.push(0);
1449
+ }
1450
+ if (bit) {
1451
+ this.buffer[bufIndex] |= 128 >>> this.length % 8;
1452
+ }
1453
+ this.length++;
1454
+ }
1455
+ };
1456
+ var bitBuffer = BitBuffer$1;
1457
+ function BitMatrix$1(size) {
1458
+ if (!size || size < 1) {
1459
+ throw new Error("BitMatrix size must be defined and greater than 0");
1460
+ }
1461
+ this.size = size;
1462
+ this.data = new Uint8Array(size * size);
1463
+ this.reservedBit = new Uint8Array(size * size);
1464
+ }
1465
+ BitMatrix$1.prototype.set = function(row, col, value, reserved) {
1466
+ const index = row * this.size + col;
1467
+ this.data[index] = value;
1468
+ if (reserved) this.reservedBit[index] = true;
1469
+ };
1470
+ BitMatrix$1.prototype.get = function(row, col) {
1471
+ return this.data[row * this.size + col];
1472
+ };
1473
+ BitMatrix$1.prototype.xor = function(row, col, value) {
1474
+ this.data[row * this.size + col] ^= value;
1475
+ };
1476
+ BitMatrix$1.prototype.isReserved = function(row, col) {
1477
+ return this.reservedBit[row * this.size + col];
1478
+ };
1479
+ var bitMatrix = BitMatrix$1;
1480
+ var alignmentPattern = {};
1481
+ (function(exports) {
1482
+ const getSymbolSize3 = utils$1.getSymbolSize;
1483
+ exports.getRowColCoords = function getRowColCoords(version2) {
1484
+ if (version2 === 1) return [];
1485
+ const posCount = Math.floor(version2 / 7) + 2;
1486
+ const size = getSymbolSize3(version2);
1487
+ const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2;
1488
+ const positions = [size - 7];
1489
+ for (let i2 = 1; i2 < posCount - 1; i2++) {
1490
+ positions[i2] = positions[i2 - 1] - intervals;
1491
+ }
1492
+ positions.push(6);
1493
+ return positions.reverse();
1494
+ };
1495
+ exports.getPositions = function getPositions2(version2) {
1496
+ const coords = [];
1497
+ const pos = exports.getRowColCoords(version2);
1498
+ const posLength = pos.length;
1499
+ for (let i2 = 0; i2 < posLength; i2++) {
1500
+ for (let j2 = 0; j2 < posLength; j2++) {
1501
+ if (i2 === 0 && j2 === 0 || // top-left
1502
+ i2 === 0 && j2 === posLength - 1 || // bottom-left
1503
+ i2 === posLength - 1 && j2 === 0) {
1504
+ continue;
1505
+ }
1506
+ coords.push([pos[i2], pos[j2]]);
1507
+ }
1508
+ }
1509
+ return coords;
1510
+ };
1511
+ })(alignmentPattern);
1512
+ var finderPattern = {};
1513
+ const getSymbolSize2 = utils$1.getSymbolSize;
1514
+ const FINDER_PATTERN_SIZE = 7;
1515
+ finderPattern.getPositions = function getPositions(version2) {
1516
+ const size = getSymbolSize2(version2);
1517
+ return [
1518
+ // top-left
1519
+ [0, 0],
1520
+ // top-right
1521
+ [size - FINDER_PATTERN_SIZE, 0],
1522
+ // bottom-left
1523
+ [0, size - FINDER_PATTERN_SIZE]
1524
+ ];
1525
+ };
1526
+ var maskPattern = {};
1527
+ (function(exports) {
1528
+ exports.Patterns = {
1529
+ PATTERN000: 0,
1530
+ PATTERN001: 1,
1531
+ PATTERN010: 2,
1532
+ PATTERN011: 3,
1533
+ PATTERN100: 4,
1534
+ PATTERN101: 5,
1535
+ PATTERN110: 6,
1536
+ PATTERN111: 7
1537
+ };
1538
+ const PenaltyScores = {
1539
+ N1: 3,
1540
+ N2: 3,
1541
+ N3: 40,
1542
+ N4: 10
1543
+ };
1544
+ exports.isValid = function isValid2(mask) {
1545
+ return mask != null && mask !== "" && !isNaN(mask) && mask >= 0 && mask <= 7;
1546
+ };
1547
+ exports.from = function from(value) {
1548
+ return exports.isValid(value) ? parseInt(value, 10) : void 0;
1549
+ };
1550
+ exports.getPenaltyN1 = function getPenaltyN1(data2) {
1551
+ const size = data2.size;
1552
+ let points = 0;
1553
+ let sameCountCol = 0;
1554
+ let sameCountRow = 0;
1555
+ let lastCol = null;
1556
+ let lastRow = null;
1557
+ for (let row = 0; row < size; row++) {
1558
+ sameCountCol = sameCountRow = 0;
1559
+ lastCol = lastRow = null;
1560
+ for (let col = 0; col < size; col++) {
1561
+ let module = data2.get(row, col);
1562
+ if (module === lastCol) {
1563
+ sameCountCol++;
1564
+ } else {
1565
+ if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5);
1566
+ lastCol = module;
1567
+ sameCountCol = 1;
1568
+ }
1569
+ module = data2.get(col, row);
1570
+ if (module === lastRow) {
1571
+ sameCountRow++;
1572
+ } else {
1573
+ if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5);
1574
+ lastRow = module;
1575
+ sameCountRow = 1;
1576
+ }
1577
+ }
1578
+ if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5);
1579
+ if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5);
1580
+ }
1581
+ return points;
1582
+ };
1583
+ exports.getPenaltyN2 = function getPenaltyN2(data2) {
1584
+ const size = data2.size;
1585
+ let points = 0;
1586
+ for (let row = 0; row < size - 1; row++) {
1587
+ for (let col = 0; col < size - 1; col++) {
1588
+ const last = data2.get(row, col) + data2.get(row, col + 1) + data2.get(row + 1, col) + data2.get(row + 1, col + 1);
1589
+ if (last === 4 || last === 0) points++;
1590
+ }
1591
+ }
1592
+ return points * PenaltyScores.N2;
1593
+ };
1594
+ exports.getPenaltyN3 = function getPenaltyN3(data2) {
1595
+ const size = data2.size;
1596
+ let points = 0;
1597
+ let bitsCol = 0;
1598
+ let bitsRow = 0;
1599
+ for (let row = 0; row < size; row++) {
1600
+ bitsCol = bitsRow = 0;
1601
+ for (let col = 0; col < size; col++) {
1602
+ bitsCol = bitsCol << 1 & 2047 | data2.get(row, col);
1603
+ if (col >= 10 && (bitsCol === 1488 || bitsCol === 93)) points++;
1604
+ bitsRow = bitsRow << 1 & 2047 | data2.get(col, row);
1605
+ if (col >= 10 && (bitsRow === 1488 || bitsRow === 93)) points++;
1606
+ }
1607
+ }
1608
+ return points * PenaltyScores.N3;
1609
+ };
1610
+ exports.getPenaltyN4 = function getPenaltyN4(data2) {
1611
+ let darkCount = 0;
1612
+ const modulesCount = data2.data.length;
1613
+ for (let i2 = 0; i2 < modulesCount; i2++) darkCount += data2.data[i2];
1614
+ const k2 = Math.abs(Math.ceil(darkCount * 100 / modulesCount / 5) - 10);
1615
+ return k2 * PenaltyScores.N4;
1616
+ };
1617
+ function getMaskAt(maskPattern2, i2, j2) {
1618
+ switch (maskPattern2) {
1619
+ case exports.Patterns.PATTERN000:
1620
+ return (i2 + j2) % 2 === 0;
1621
+ case exports.Patterns.PATTERN001:
1622
+ return i2 % 2 === 0;
1623
+ case exports.Patterns.PATTERN010:
1624
+ return j2 % 3 === 0;
1625
+ case exports.Patterns.PATTERN011:
1626
+ return (i2 + j2) % 3 === 0;
1627
+ case exports.Patterns.PATTERN100:
1628
+ return (Math.floor(i2 / 2) + Math.floor(j2 / 3)) % 2 === 0;
1629
+ case exports.Patterns.PATTERN101:
1630
+ return i2 * j2 % 2 + i2 * j2 % 3 === 0;
1631
+ case exports.Patterns.PATTERN110:
1632
+ return (i2 * j2 % 2 + i2 * j2 % 3) % 2 === 0;
1633
+ case exports.Patterns.PATTERN111:
1634
+ return (i2 * j2 % 3 + (i2 + j2) % 2) % 2 === 0;
1635
+ default:
1636
+ throw new Error("bad maskPattern:" + maskPattern2);
1637
+ }
1638
+ }
1639
+ exports.applyMask = function applyMask(pattern, data2) {
1640
+ const size = data2.size;
1641
+ for (let col = 0; col < size; col++) {
1642
+ for (let row = 0; row < size; row++) {
1643
+ if (data2.isReserved(row, col)) continue;
1644
+ data2.xor(row, col, getMaskAt(pattern, row, col));
1645
+ }
1646
+ }
1647
+ };
1648
+ exports.getBestMask = function getBestMask(data2, setupFormatFunc) {
1649
+ const numPatterns = Object.keys(exports.Patterns).length;
1650
+ let bestPattern = 0;
1651
+ let lowerPenalty = Infinity;
1652
+ for (let p2 = 0; p2 < numPatterns; p2++) {
1653
+ setupFormatFunc(p2);
1654
+ exports.applyMask(p2, data2);
1655
+ const penalty = exports.getPenaltyN1(data2) + exports.getPenaltyN2(data2) + exports.getPenaltyN3(data2) + exports.getPenaltyN4(data2);
1656
+ exports.applyMask(p2, data2);
1657
+ if (penalty < lowerPenalty) {
1658
+ lowerPenalty = penalty;
1659
+ bestPattern = p2;
1660
+ }
1661
+ }
1662
+ return bestPattern;
1663
+ };
1664
+ })(maskPattern);
1665
+ var errorCorrectionCode = {};
1666
+ const ECLevel$1 = errorCorrectionLevel;
1667
+ const EC_BLOCKS_TABLE = [
1668
+ // L M Q H
1669
+ 1,
1670
+ 1,
1671
+ 1,
1672
+ 1,
1673
+ 1,
1674
+ 1,
1675
+ 1,
1676
+ 1,
1677
+ 1,
1678
+ 1,
1679
+ 2,
1680
+ 2,
1681
+ 1,
1682
+ 2,
1683
+ 2,
1684
+ 4,
1685
+ 1,
1686
+ 2,
1687
+ 4,
1688
+ 4,
1689
+ 2,
1690
+ 4,
1691
+ 4,
1692
+ 4,
1693
+ 2,
1694
+ 4,
1695
+ 6,
1696
+ 5,
1697
+ 2,
1698
+ 4,
1699
+ 6,
1700
+ 6,
1701
+ 2,
1702
+ 5,
1703
+ 8,
1704
+ 8,
1705
+ 4,
1706
+ 5,
1707
+ 8,
1708
+ 8,
1709
+ 4,
1710
+ 5,
1711
+ 8,
1712
+ 11,
1713
+ 4,
1714
+ 8,
1715
+ 10,
1716
+ 11,
1717
+ 4,
1718
+ 9,
1719
+ 12,
1720
+ 16,
1721
+ 4,
1722
+ 9,
1723
+ 16,
1724
+ 16,
1725
+ 6,
1726
+ 10,
1727
+ 12,
1728
+ 18,
1729
+ 6,
1730
+ 10,
1731
+ 17,
1732
+ 16,
1733
+ 6,
1734
+ 11,
1735
+ 16,
1736
+ 19,
1737
+ 6,
1738
+ 13,
1739
+ 18,
1740
+ 21,
1741
+ 7,
1742
+ 14,
1743
+ 21,
1744
+ 25,
1745
+ 8,
1746
+ 16,
1747
+ 20,
1748
+ 25,
1749
+ 8,
1750
+ 17,
1751
+ 23,
1752
+ 25,
1753
+ 9,
1754
+ 17,
1755
+ 23,
1756
+ 34,
1757
+ 9,
1758
+ 18,
1759
+ 25,
1760
+ 30,
1761
+ 10,
1762
+ 20,
1763
+ 27,
1764
+ 32,
1765
+ 12,
1766
+ 21,
1767
+ 29,
1768
+ 35,
1769
+ 12,
1770
+ 23,
1771
+ 34,
1772
+ 37,
1773
+ 12,
1774
+ 25,
1775
+ 34,
1776
+ 40,
1777
+ 13,
1778
+ 26,
1779
+ 35,
1780
+ 42,
1781
+ 14,
1782
+ 28,
1783
+ 38,
1784
+ 45,
1785
+ 15,
1786
+ 29,
1787
+ 40,
1788
+ 48,
1789
+ 16,
1790
+ 31,
1791
+ 43,
1792
+ 51,
1793
+ 17,
1794
+ 33,
1795
+ 45,
1796
+ 54,
1797
+ 18,
1798
+ 35,
1799
+ 48,
1800
+ 57,
1801
+ 19,
1802
+ 37,
1803
+ 51,
1804
+ 60,
1805
+ 19,
1806
+ 38,
1807
+ 53,
1808
+ 63,
1809
+ 20,
1810
+ 40,
1811
+ 56,
1812
+ 66,
1813
+ 21,
1814
+ 43,
1815
+ 59,
1816
+ 70,
1817
+ 22,
1818
+ 45,
1819
+ 62,
1820
+ 74,
1821
+ 24,
1822
+ 47,
1823
+ 65,
1824
+ 77,
1825
+ 25,
1826
+ 49,
1827
+ 68,
1828
+ 81
1829
+ ];
1830
+ const EC_CODEWORDS_TABLE = [
1831
+ // L M Q H
1832
+ 7,
1833
+ 10,
1834
+ 13,
1835
+ 17,
1836
+ 10,
1837
+ 16,
1838
+ 22,
1839
+ 28,
1840
+ 15,
1841
+ 26,
1842
+ 36,
1843
+ 44,
1844
+ 20,
1845
+ 36,
1846
+ 52,
1847
+ 64,
1848
+ 26,
1849
+ 48,
1850
+ 72,
1851
+ 88,
1852
+ 36,
1853
+ 64,
1854
+ 96,
1855
+ 112,
1856
+ 40,
1857
+ 72,
1858
+ 108,
1859
+ 130,
1860
+ 48,
1861
+ 88,
1862
+ 132,
1863
+ 156,
1864
+ 60,
1865
+ 110,
1866
+ 160,
1867
+ 192,
1868
+ 72,
1869
+ 130,
1870
+ 192,
1871
+ 224,
1872
+ 80,
1873
+ 150,
1874
+ 224,
1875
+ 264,
1876
+ 96,
1877
+ 176,
1878
+ 260,
1879
+ 308,
1880
+ 104,
1881
+ 198,
1882
+ 288,
1883
+ 352,
1884
+ 120,
1885
+ 216,
1886
+ 320,
1887
+ 384,
1888
+ 132,
1889
+ 240,
1890
+ 360,
1891
+ 432,
1892
+ 144,
1893
+ 280,
1894
+ 408,
1895
+ 480,
1896
+ 168,
1897
+ 308,
1898
+ 448,
1899
+ 532,
1900
+ 180,
1901
+ 338,
1902
+ 504,
1903
+ 588,
1904
+ 196,
1905
+ 364,
1906
+ 546,
1907
+ 650,
1908
+ 224,
1909
+ 416,
1910
+ 600,
1911
+ 700,
1912
+ 224,
1913
+ 442,
1914
+ 644,
1915
+ 750,
1916
+ 252,
1917
+ 476,
1918
+ 690,
1919
+ 816,
1920
+ 270,
1921
+ 504,
1922
+ 750,
1923
+ 900,
1924
+ 300,
1925
+ 560,
1926
+ 810,
1927
+ 960,
1928
+ 312,
1929
+ 588,
1930
+ 870,
1931
+ 1050,
1932
+ 336,
1933
+ 644,
1934
+ 952,
1935
+ 1110,
1936
+ 360,
1937
+ 700,
1938
+ 1020,
1939
+ 1200,
1940
+ 390,
1941
+ 728,
1942
+ 1050,
1943
+ 1260,
1944
+ 420,
1945
+ 784,
1946
+ 1140,
1947
+ 1350,
1948
+ 450,
1949
+ 812,
1950
+ 1200,
1951
+ 1440,
1952
+ 480,
1953
+ 868,
1954
+ 1290,
1955
+ 1530,
1956
+ 510,
1957
+ 924,
1958
+ 1350,
1959
+ 1620,
1960
+ 540,
1961
+ 980,
1962
+ 1440,
1963
+ 1710,
1964
+ 570,
1965
+ 1036,
1966
+ 1530,
1967
+ 1800,
1968
+ 570,
1969
+ 1064,
1970
+ 1590,
1971
+ 1890,
1972
+ 600,
1973
+ 1120,
1974
+ 1680,
1975
+ 1980,
1976
+ 630,
1977
+ 1204,
1978
+ 1770,
1979
+ 2100,
1980
+ 660,
1981
+ 1260,
1982
+ 1860,
1983
+ 2220,
1984
+ 720,
1985
+ 1316,
1986
+ 1950,
1987
+ 2310,
1988
+ 750,
1989
+ 1372,
1990
+ 2040,
1991
+ 2430
1992
+ ];
1993
+ errorCorrectionCode.getBlocksCount = function getBlocksCount(version2, errorCorrectionLevel2) {
1994
+ switch (errorCorrectionLevel2) {
1995
+ case ECLevel$1.L:
1996
+ return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 0];
1997
+ case ECLevel$1.M:
1998
+ return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 1];
1999
+ case ECLevel$1.Q:
2000
+ return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 2];
2001
+ case ECLevel$1.H:
2002
+ return EC_BLOCKS_TABLE[(version2 - 1) * 4 + 3];
2003
+ default:
2004
+ return void 0;
2005
+ }
2006
+ };
2007
+ errorCorrectionCode.getTotalCodewordsCount = function getTotalCodewordsCount(version2, errorCorrectionLevel2) {
2008
+ switch (errorCorrectionLevel2) {
2009
+ case ECLevel$1.L:
2010
+ return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 0];
2011
+ case ECLevel$1.M:
2012
+ return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 1];
2013
+ case ECLevel$1.Q:
2014
+ return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 2];
2015
+ case ECLevel$1.H:
2016
+ return EC_CODEWORDS_TABLE[(version2 - 1) * 4 + 3];
2017
+ default:
2018
+ return void 0;
2019
+ }
2020
+ };
2021
+ var polynomial = {};
2022
+ var galoisField = {};
2023
+ const EXP_TABLE = new Uint8Array(512);
2024
+ const LOG_TABLE = new Uint8Array(256);
2025
+ (function initTables() {
2026
+ let x2 = 1;
2027
+ for (let i2 = 0; i2 < 255; i2++) {
2028
+ EXP_TABLE[i2] = x2;
2029
+ LOG_TABLE[x2] = i2;
2030
+ x2 <<= 1;
2031
+ if (x2 & 256) {
2032
+ x2 ^= 285;
2033
+ }
2034
+ }
2035
+ for (let i2 = 255; i2 < 512; i2++) {
2036
+ EXP_TABLE[i2] = EXP_TABLE[i2 - 255];
2037
+ }
2038
+ })();
2039
+ galoisField.log = function log(n2) {
2040
+ if (n2 < 1) throw new Error("log(" + n2 + ")");
2041
+ return LOG_TABLE[n2];
2042
+ };
2043
+ galoisField.exp = function exp(n2) {
2044
+ return EXP_TABLE[n2];
2045
+ };
2046
+ galoisField.mul = function mul(x2, y2) {
2047
+ if (x2 === 0 || y2 === 0) return 0;
2048
+ return EXP_TABLE[LOG_TABLE[x2] + LOG_TABLE[y2]];
2049
+ };
2050
+ (function(exports) {
2051
+ const GF = galoisField;
2052
+ exports.mul = function mul2(p1, p2) {
2053
+ const coeff = new Uint8Array(p1.length + p2.length - 1);
2054
+ for (let i2 = 0; i2 < p1.length; i2++) {
2055
+ for (let j2 = 0; j2 < p2.length; j2++) {
2056
+ coeff[i2 + j2] ^= GF.mul(p1[i2], p2[j2]);
2057
+ }
2058
+ }
2059
+ return coeff;
2060
+ };
2061
+ exports.mod = function mod(divident, divisor) {
2062
+ let result = new Uint8Array(divident);
2063
+ while (result.length - divisor.length >= 0) {
2064
+ const coeff = result[0];
2065
+ for (let i2 = 0; i2 < divisor.length; i2++) {
2066
+ result[i2] ^= GF.mul(divisor[i2], coeff);
2067
+ }
2068
+ let offset = 0;
2069
+ while (offset < result.length && result[offset] === 0) offset++;
2070
+ result = result.slice(offset);
2071
+ }
2072
+ return result;
2073
+ };
2074
+ exports.generateECPolynomial = function generateECPolynomial(degree) {
2075
+ let poly = new Uint8Array([1]);
2076
+ for (let i2 = 0; i2 < degree; i2++) {
2077
+ poly = exports.mul(poly, new Uint8Array([1, GF.exp(i2)]));
2078
+ }
2079
+ return poly;
2080
+ };
2081
+ })(polynomial);
2082
+ const Polynomial = polynomial;
2083
+ function ReedSolomonEncoder$1(degree) {
2084
+ this.genPoly = void 0;
2085
+ this.degree = degree;
2086
+ if (this.degree) this.initialize(this.degree);
2087
+ }
2088
+ ReedSolomonEncoder$1.prototype.initialize = function initialize(degree) {
2089
+ this.degree = degree;
2090
+ this.genPoly = Polynomial.generateECPolynomial(this.degree);
2091
+ };
2092
+ ReedSolomonEncoder$1.prototype.encode = function encode(data2) {
2093
+ if (!this.genPoly) {
2094
+ throw new Error("Encoder not initialized");
2095
+ }
2096
+ const paddedData = new Uint8Array(data2.length + this.degree);
2097
+ paddedData.set(data2);
2098
+ const remainder = Polynomial.mod(paddedData, this.genPoly);
2099
+ const start = this.degree - remainder.length;
2100
+ if (start > 0) {
2101
+ const buff = new Uint8Array(this.degree);
2102
+ buff.set(remainder, start);
2103
+ return buff;
2104
+ }
2105
+ return remainder;
2106
+ };
2107
+ var reedSolomonEncoder = ReedSolomonEncoder$1;
2108
+ var version = {};
2109
+ var mode = {};
2110
+ var versionCheck = {};
2111
+ versionCheck.isValid = function isValid(version2) {
2112
+ return !isNaN(version2) && version2 >= 1 && version2 <= 40;
2113
+ };
2114
+ var regex = {};
2115
+ const numeric = "[0-9]+";
2116
+ const alphanumeric = "[A-Z $%*+\\-./:]+";
2117
+ let kanji = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
2118
+ kanji = kanji.replace(/u/g, "\\u");
2119
+ const byte = "(?:(?![A-Z0-9 $%*+\\-./:]|" + kanji + ")(?:.|[\r\n]))+";
2120
+ regex.KANJI = new RegExp(kanji, "g");
2121
+ regex.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
2122
+ regex.BYTE = new RegExp(byte, "g");
2123
+ regex.NUMERIC = new RegExp(numeric, "g");
2124
+ regex.ALPHANUMERIC = new RegExp(alphanumeric, "g");
2125
+ const TEST_KANJI = new RegExp("^" + kanji + "$");
2126
+ const TEST_NUMERIC = new RegExp("^" + numeric + "$");
2127
+ const TEST_ALPHANUMERIC = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
2128
+ regex.testKanji = function testKanji(str) {
2129
+ return TEST_KANJI.test(str);
2130
+ };
2131
+ regex.testNumeric = function testNumeric(str) {
2132
+ return TEST_NUMERIC.test(str);
2133
+ };
2134
+ regex.testAlphanumeric = function testAlphanumeric(str) {
2135
+ return TEST_ALPHANUMERIC.test(str);
2136
+ };
2137
+ (function(exports) {
2138
+ const VersionCheck = versionCheck;
2139
+ const Regex = regex;
2140
+ exports.NUMERIC = {
2141
+ id: "Numeric",
2142
+ bit: 1 << 0,
2143
+ ccBits: [10, 12, 14]
2144
+ };
2145
+ exports.ALPHANUMERIC = {
2146
+ id: "Alphanumeric",
2147
+ bit: 1 << 1,
2148
+ ccBits: [9, 11, 13]
2149
+ };
2150
+ exports.BYTE = {
2151
+ id: "Byte",
2152
+ bit: 1 << 2,
2153
+ ccBits: [8, 16, 16]
2154
+ };
2155
+ exports.KANJI = {
2156
+ id: "Kanji",
2157
+ bit: 1 << 3,
2158
+ ccBits: [8, 10, 12]
2159
+ };
2160
+ exports.MIXED = {
2161
+ bit: -1
2162
+ };
2163
+ exports.getCharCountIndicator = function getCharCountIndicator(mode2, version2) {
2164
+ if (!mode2.ccBits) throw new Error("Invalid mode: " + mode2);
2165
+ if (!VersionCheck.isValid(version2)) {
2166
+ throw new Error("Invalid version: " + version2);
2167
+ }
2168
+ if (version2 >= 1 && version2 < 10) return mode2.ccBits[0];
2169
+ else if (version2 < 27) return mode2.ccBits[1];
2170
+ return mode2.ccBits[2];
2171
+ };
2172
+ exports.getBestModeForData = function getBestModeForData(dataStr) {
2173
+ if (Regex.testNumeric(dataStr)) return exports.NUMERIC;
2174
+ else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC;
2175
+ else if (Regex.testKanji(dataStr)) return exports.KANJI;
2176
+ else return exports.BYTE;
2177
+ };
2178
+ exports.toString = function toString(mode2) {
2179
+ if (mode2 && mode2.id) return mode2.id;
2180
+ throw new Error("Invalid mode");
2181
+ };
2182
+ exports.isValid = function isValid2(mode2) {
2183
+ return mode2 && mode2.bit && mode2.ccBits;
2184
+ };
2185
+ function fromString(string) {
2186
+ if (typeof string !== "string") {
2187
+ throw new Error("Param is not a string");
2188
+ }
2189
+ const lcStr = string.toLowerCase();
2190
+ switch (lcStr) {
2191
+ case "numeric":
2192
+ return exports.NUMERIC;
2193
+ case "alphanumeric":
2194
+ return exports.ALPHANUMERIC;
2195
+ case "kanji":
2196
+ return exports.KANJI;
2197
+ case "byte":
2198
+ return exports.BYTE;
2199
+ default:
2200
+ throw new Error("Unknown mode: " + string);
2201
+ }
2202
+ }
2203
+ exports.from = function from(value, defaultValue) {
2204
+ if (exports.isValid(value)) {
2205
+ return value;
2206
+ }
2207
+ try {
2208
+ return fromString(value);
2209
+ } catch (e2) {
2210
+ return defaultValue;
2211
+ }
2212
+ };
2213
+ })(mode);
2214
+ (function(exports) {
2215
+ const Utils2 = utils$1;
2216
+ const ECCode2 = errorCorrectionCode;
2217
+ const ECLevel2 = errorCorrectionLevel;
2218
+ const Mode2 = mode;
2219
+ const VersionCheck = versionCheck;
2220
+ const G18 = 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0;
2221
+ const G18_BCH = Utils2.getBCHDigit(G18);
2222
+ function getBestVersionForDataLength(mode2, length, errorCorrectionLevel2) {
2223
+ for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
2224
+ if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel2, mode2)) {
2225
+ return currentVersion;
2226
+ }
2227
+ }
2228
+ return void 0;
2229
+ }
2230
+ function getReservedBitsCount(mode2, version2) {
2231
+ return Mode2.getCharCountIndicator(mode2, version2) + 4;
2232
+ }
2233
+ function getTotalBitsFromDataArray(segments2, version2) {
2234
+ let totalBits = 0;
2235
+ segments2.forEach(function(data2) {
2236
+ const reservedBits = getReservedBitsCount(data2.mode, version2);
2237
+ totalBits += reservedBits + data2.getBitsLength();
2238
+ });
2239
+ return totalBits;
2240
+ }
2241
+ function getBestVersionForMixedData(segments2, errorCorrectionLevel2) {
2242
+ for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
2243
+ const length = getTotalBitsFromDataArray(segments2, currentVersion);
2244
+ if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel2, Mode2.MIXED)) {
2245
+ return currentVersion;
2246
+ }
2247
+ }
2248
+ return void 0;
2249
+ }
2250
+ exports.from = function from(value, defaultValue) {
2251
+ if (VersionCheck.isValid(value)) {
2252
+ return parseInt(value, 10);
2253
+ }
2254
+ return defaultValue;
2255
+ };
2256
+ exports.getCapacity = function getCapacity(version2, errorCorrectionLevel2, mode2) {
2257
+ if (!VersionCheck.isValid(version2)) {
2258
+ throw new Error("Invalid QR Code version");
2259
+ }
2260
+ if (typeof mode2 === "undefined") mode2 = Mode2.BYTE;
2261
+ const totalCodewords = Utils2.getSymbolTotalCodewords(version2);
2262
+ const ecTotalCodewords = ECCode2.getTotalCodewordsCount(version2, errorCorrectionLevel2);
2263
+ const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8;
2264
+ if (mode2 === Mode2.MIXED) return dataTotalCodewordsBits;
2265
+ const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode2, version2);
2266
+ switch (mode2) {
2267
+ case Mode2.NUMERIC:
2268
+ return Math.floor(usableBits / 10 * 3);
2269
+ case Mode2.ALPHANUMERIC:
2270
+ return Math.floor(usableBits / 11 * 2);
2271
+ case Mode2.KANJI:
2272
+ return Math.floor(usableBits / 13);
2273
+ case Mode2.BYTE:
2274
+ default:
2275
+ return Math.floor(usableBits / 8);
2276
+ }
2277
+ };
2278
+ exports.getBestVersionForData = function getBestVersionForData(data2, errorCorrectionLevel2) {
2279
+ let seg;
2280
+ const ecl = ECLevel2.from(errorCorrectionLevel2, ECLevel2.M);
2281
+ if (Array.isArray(data2)) {
2282
+ if (data2.length > 1) {
2283
+ return getBestVersionForMixedData(data2, ecl);
2284
+ }
2285
+ if (data2.length === 0) {
2286
+ return 1;
2287
+ }
2288
+ seg = data2[0];
2289
+ } else {
2290
+ seg = data2;
2291
+ }
2292
+ return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl);
2293
+ };
2294
+ exports.getEncodedBits = function getEncodedBits2(version2) {
2295
+ if (!VersionCheck.isValid(version2) || version2 < 7) {
2296
+ throw new Error("Invalid QR Code version");
2297
+ }
2298
+ let d2 = version2 << 12;
2299
+ while (Utils2.getBCHDigit(d2) - G18_BCH >= 0) {
2300
+ d2 ^= G18 << Utils2.getBCHDigit(d2) - G18_BCH;
2301
+ }
2302
+ return version2 << 12 | d2;
2303
+ };
2304
+ })(version);
2305
+ var formatInfo = {};
2306
+ const Utils$3 = utils$1;
2307
+ const G15 = 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0;
2308
+ const G15_MASK = 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1;
2309
+ const G15_BCH = Utils$3.getBCHDigit(G15);
2310
+ formatInfo.getEncodedBits = function getEncodedBits(errorCorrectionLevel2, mask) {
2311
+ const data2 = errorCorrectionLevel2.bit << 3 | mask;
2312
+ let d2 = data2 << 10;
2313
+ while (Utils$3.getBCHDigit(d2) - G15_BCH >= 0) {
2314
+ d2 ^= G15 << Utils$3.getBCHDigit(d2) - G15_BCH;
2315
+ }
2316
+ return (data2 << 10 | d2) ^ G15_MASK;
2317
+ };
2318
+ var segments = {};
2319
+ const Mode$4 = mode;
2320
+ function NumericData(data2) {
2321
+ this.mode = Mode$4.NUMERIC;
2322
+ this.data = data2.toString();
2323
+ }
2324
+ NumericData.getBitsLength = function getBitsLength(length) {
2325
+ return 10 * Math.floor(length / 3) + (length % 3 ? length % 3 * 3 + 1 : 0);
2326
+ };
2327
+ NumericData.prototype.getLength = function getLength() {
2328
+ return this.data.length;
2329
+ };
2330
+ NumericData.prototype.getBitsLength = function getBitsLength2() {
2331
+ return NumericData.getBitsLength(this.data.length);
2332
+ };
2333
+ NumericData.prototype.write = function write(bitBuffer2) {
2334
+ let i2, group, value;
2335
+ for (i2 = 0; i2 + 3 <= this.data.length; i2 += 3) {
2336
+ group = this.data.substr(i2, 3);
2337
+ value = parseInt(group, 10);
2338
+ bitBuffer2.put(value, 10);
2339
+ }
2340
+ const remainingNum = this.data.length - i2;
2341
+ if (remainingNum > 0) {
2342
+ group = this.data.substr(i2);
2343
+ value = parseInt(group, 10);
2344
+ bitBuffer2.put(value, remainingNum * 3 + 1);
2345
+ }
2346
+ };
2347
+ var numericData = NumericData;
2348
+ const Mode$3 = mode;
2349
+ const ALPHA_NUM_CHARS = [
2350
+ "0",
2351
+ "1",
2352
+ "2",
2353
+ "3",
2354
+ "4",
2355
+ "5",
2356
+ "6",
2357
+ "7",
2358
+ "8",
2359
+ "9",
2360
+ "A",
2361
+ "B",
2362
+ "C",
2363
+ "D",
2364
+ "E",
2365
+ "F",
2366
+ "G",
2367
+ "H",
2368
+ "I",
2369
+ "J",
2370
+ "K",
2371
+ "L",
2372
+ "M",
2373
+ "N",
2374
+ "O",
2375
+ "P",
2376
+ "Q",
2377
+ "R",
2378
+ "S",
2379
+ "T",
2380
+ "U",
2381
+ "V",
2382
+ "W",
2383
+ "X",
2384
+ "Y",
2385
+ "Z",
2386
+ " ",
2387
+ "$",
2388
+ "%",
2389
+ "*",
2390
+ "+",
2391
+ "-",
2392
+ ".",
2393
+ "/",
2394
+ ":"
2395
+ ];
2396
+ function AlphanumericData(data2) {
2397
+ this.mode = Mode$3.ALPHANUMERIC;
2398
+ this.data = data2;
2399
+ }
2400
+ AlphanumericData.getBitsLength = function getBitsLength3(length) {
2401
+ return 11 * Math.floor(length / 2) + 6 * (length % 2);
2402
+ };
2403
+ AlphanumericData.prototype.getLength = function getLength2() {
2404
+ return this.data.length;
2405
+ };
2406
+ AlphanumericData.prototype.getBitsLength = function getBitsLength4() {
2407
+ return AlphanumericData.getBitsLength(this.data.length);
2408
+ };
2409
+ AlphanumericData.prototype.write = function write2(bitBuffer2) {
2410
+ let i2;
2411
+ for (i2 = 0; i2 + 2 <= this.data.length; i2 += 2) {
2412
+ let value = ALPHA_NUM_CHARS.indexOf(this.data[i2]) * 45;
2413
+ value += ALPHA_NUM_CHARS.indexOf(this.data[i2 + 1]);
2414
+ bitBuffer2.put(value, 11);
2415
+ }
2416
+ if (this.data.length % 2) {
2417
+ bitBuffer2.put(ALPHA_NUM_CHARS.indexOf(this.data[i2]), 6);
2418
+ }
2419
+ };
2420
+ var alphanumericData = AlphanumericData;
2421
+ var encodeUtf8$1 = function encodeUtf8(input) {
2422
+ var result = [];
2423
+ var size = input.length;
2424
+ for (var index = 0; index < size; index++) {
2425
+ var point = input.charCodeAt(index);
2426
+ if (point >= 55296 && point <= 56319 && size > index + 1) {
2427
+ var second = input.charCodeAt(index + 1);
2428
+ if (second >= 56320 && second <= 57343) {
2429
+ point = (point - 55296) * 1024 + second - 56320 + 65536;
2430
+ index += 1;
2431
+ }
2432
+ }
2433
+ if (point < 128) {
2434
+ result.push(point);
2435
+ continue;
2436
+ }
2437
+ if (point < 2048) {
2438
+ result.push(point >> 6 | 192);
2439
+ result.push(point & 63 | 128);
2440
+ continue;
2441
+ }
2442
+ if (point < 55296 || point >= 57344 && point < 65536) {
2443
+ result.push(point >> 12 | 224);
2444
+ result.push(point >> 6 & 63 | 128);
2445
+ result.push(point & 63 | 128);
2446
+ continue;
2447
+ }
2448
+ if (point >= 65536 && point <= 1114111) {
2449
+ result.push(point >> 18 | 240);
2450
+ result.push(point >> 12 & 63 | 128);
2451
+ result.push(point >> 6 & 63 | 128);
2452
+ result.push(point & 63 | 128);
2453
+ continue;
2454
+ }
2455
+ result.push(239, 191, 189);
2456
+ }
2457
+ return new Uint8Array(result).buffer;
2458
+ };
2459
+ const encodeUtf82 = encodeUtf8$1;
2460
+ const Mode$2 = mode;
2461
+ function ByteData(data2) {
2462
+ this.mode = Mode$2.BYTE;
2463
+ if (typeof data2 === "string") {
2464
+ data2 = encodeUtf82(data2);
2465
+ }
2466
+ this.data = new Uint8Array(data2);
2467
+ }
2468
+ ByteData.getBitsLength = function getBitsLength5(length) {
2469
+ return length * 8;
2470
+ };
2471
+ ByteData.prototype.getLength = function getLength3() {
2472
+ return this.data.length;
2473
+ };
2474
+ ByteData.prototype.getBitsLength = function getBitsLength6() {
2475
+ return ByteData.getBitsLength(this.data.length);
2476
+ };
2477
+ ByteData.prototype.write = function(bitBuffer2) {
2478
+ for (let i2 = 0, l2 = this.data.length; i2 < l2; i2++) {
2479
+ bitBuffer2.put(this.data[i2], 8);
2480
+ }
2481
+ };
2482
+ var byteData = ByteData;
2483
+ const Mode$1 = mode;
2484
+ const Utils$2 = utils$1;
2485
+ function KanjiData(data2) {
2486
+ this.mode = Mode$1.KANJI;
2487
+ this.data = data2;
2488
+ }
2489
+ KanjiData.getBitsLength = function getBitsLength7(length) {
2490
+ return length * 13;
2491
+ };
2492
+ KanjiData.prototype.getLength = function getLength4() {
2493
+ return this.data.length;
2494
+ };
2495
+ KanjiData.prototype.getBitsLength = function getBitsLength8() {
2496
+ return KanjiData.getBitsLength(this.data.length);
2497
+ };
2498
+ KanjiData.prototype.write = function(bitBuffer2) {
2499
+ let i2;
2500
+ for (i2 = 0; i2 < this.data.length; i2++) {
2501
+ let value = Utils$2.toSJIS(this.data[i2]);
2502
+ if (value >= 33088 && value <= 40956) {
2503
+ value -= 33088;
2504
+ } else if (value >= 57408 && value <= 60351) {
2505
+ value -= 49472;
2506
+ } else {
2507
+ throw new Error(
2508
+ "Invalid SJIS character: " + this.data[i2] + "\nMake sure your charset is UTF-8"
2509
+ );
2510
+ }
2511
+ value = (value >>> 8 & 255) * 192 + (value & 255);
2512
+ bitBuffer2.put(value, 13);
2513
+ }
2514
+ };
2515
+ var kanjiData = KanjiData;
2516
+ (function(exports) {
2517
+ const Mode2 = mode;
2518
+ const NumericData2 = numericData;
2519
+ const AlphanumericData2 = alphanumericData;
2520
+ const ByteData2 = byteData;
2521
+ const KanjiData2 = kanjiData;
2522
+ const Regex = regex;
2523
+ const Utils2 = utils$1;
2524
+ const dijkstra = dijkstraExports;
2525
+ function getStringByteLength(str) {
2526
+ return unescape(encodeURIComponent(str)).length;
2527
+ }
2528
+ function getSegments(regex2, mode2, str) {
2529
+ const segments2 = [];
2530
+ let result;
2531
+ while ((result = regex2.exec(str)) !== null) {
2532
+ segments2.push({
2533
+ data: result[0],
2534
+ index: result.index,
2535
+ mode: mode2,
2536
+ length: result[0].length
2537
+ });
2538
+ }
2539
+ return segments2;
2540
+ }
2541
+ function getSegmentsFromString(dataStr) {
2542
+ const numSegs = getSegments(Regex.NUMERIC, Mode2.NUMERIC, dataStr);
2543
+ const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode2.ALPHANUMERIC, dataStr);
2544
+ let byteSegs;
2545
+ let kanjiSegs;
2546
+ if (Utils2.isKanjiModeEnabled()) {
2547
+ byteSegs = getSegments(Regex.BYTE, Mode2.BYTE, dataStr);
2548
+ kanjiSegs = getSegments(Regex.KANJI, Mode2.KANJI, dataStr);
2549
+ } else {
2550
+ byteSegs = getSegments(Regex.BYTE_KANJI, Mode2.BYTE, dataStr);
2551
+ kanjiSegs = [];
2552
+ }
2553
+ const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs);
2554
+ return segs.sort(function(s1, s2) {
2555
+ return s1.index - s2.index;
2556
+ }).map(function(obj) {
2557
+ return {
2558
+ data: obj.data,
2559
+ mode: obj.mode,
2560
+ length: obj.length
2561
+ };
2562
+ });
2563
+ }
2564
+ function getSegmentBitsLength(length, mode2) {
2565
+ switch (mode2) {
2566
+ case Mode2.NUMERIC:
2567
+ return NumericData2.getBitsLength(length);
2568
+ case Mode2.ALPHANUMERIC:
2569
+ return AlphanumericData2.getBitsLength(length);
2570
+ case Mode2.KANJI:
2571
+ return KanjiData2.getBitsLength(length);
2572
+ case Mode2.BYTE:
2573
+ return ByteData2.getBitsLength(length);
2574
+ }
2575
+ }
2576
+ function mergeSegments(segs) {
2577
+ return segs.reduce(function(acc, curr) {
2578
+ const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null;
2579
+ if (prevSeg && prevSeg.mode === curr.mode) {
2580
+ acc[acc.length - 1].data += curr.data;
2581
+ return acc;
2582
+ }
2583
+ acc.push(curr);
2584
+ return acc;
2585
+ }, []);
2586
+ }
2587
+ function buildNodes(segs) {
2588
+ const nodes = [];
2589
+ for (let i2 = 0; i2 < segs.length; i2++) {
2590
+ const seg = segs[i2];
2591
+ switch (seg.mode) {
2592
+ case Mode2.NUMERIC:
2593
+ nodes.push([
2594
+ seg,
2595
+ { data: seg.data, mode: Mode2.ALPHANUMERIC, length: seg.length },
2596
+ { data: seg.data, mode: Mode2.BYTE, length: seg.length }
2597
+ ]);
2598
+ break;
2599
+ case Mode2.ALPHANUMERIC:
2600
+ nodes.push([
2601
+ seg,
2602
+ { data: seg.data, mode: Mode2.BYTE, length: seg.length }
2603
+ ]);
2604
+ break;
2605
+ case Mode2.KANJI:
2606
+ nodes.push([
2607
+ seg,
2608
+ { data: seg.data, mode: Mode2.BYTE, length: getStringByteLength(seg.data) }
2609
+ ]);
2610
+ break;
2611
+ case Mode2.BYTE:
2612
+ nodes.push([
2613
+ { data: seg.data, mode: Mode2.BYTE, length: getStringByteLength(seg.data) }
2614
+ ]);
2615
+ }
2616
+ }
2617
+ return nodes;
2618
+ }
2619
+ function buildGraph(nodes, version2) {
2620
+ const table = {};
2621
+ const graph = { start: {} };
2622
+ let prevNodeIds = ["start"];
2623
+ for (let i2 = 0; i2 < nodes.length; i2++) {
2624
+ const nodeGroup = nodes[i2];
2625
+ const currentNodeIds = [];
2626
+ for (let j2 = 0; j2 < nodeGroup.length; j2++) {
2627
+ const node = nodeGroup[j2];
2628
+ const key = "" + i2 + j2;
2629
+ currentNodeIds.push(key);
2630
+ table[key] = { node, lastCount: 0 };
2631
+ graph[key] = {};
2632
+ for (let n2 = 0; n2 < prevNodeIds.length; n2++) {
2633
+ const prevNodeId = prevNodeIds[n2];
2634
+ if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {
2635
+ graph[prevNodeId][key] = getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) - getSegmentBitsLength(table[prevNodeId].lastCount, node.mode);
2636
+ table[prevNodeId].lastCount += node.length;
2637
+ } else {
2638
+ if (table[prevNodeId]) table[prevNodeId].lastCount = node.length;
2639
+ graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) + 4 + Mode2.getCharCountIndicator(node.mode, version2);
2640
+ }
2641
+ }
2642
+ }
2643
+ prevNodeIds = currentNodeIds;
2644
+ }
2645
+ for (let n2 = 0; n2 < prevNodeIds.length; n2++) {
2646
+ graph[prevNodeIds[n2]].end = 0;
2647
+ }
2648
+ return { map: graph, table };
2649
+ }
2650
+ function buildSingleSegment(data2, modesHint) {
2651
+ let mode2;
2652
+ const bestMode = Mode2.getBestModeForData(data2);
2653
+ mode2 = Mode2.from(modesHint, bestMode);
2654
+ if (mode2 !== Mode2.BYTE && mode2.bit < bestMode.bit) {
2655
+ throw new Error('"' + data2 + '" cannot be encoded with mode ' + Mode2.toString(mode2) + ".\n Suggested mode is: " + Mode2.toString(bestMode));
2656
+ }
2657
+ if (mode2 === Mode2.KANJI && !Utils2.isKanjiModeEnabled()) {
2658
+ mode2 = Mode2.BYTE;
2659
+ }
2660
+ switch (mode2) {
2661
+ case Mode2.NUMERIC:
2662
+ return new NumericData2(data2);
2663
+ case Mode2.ALPHANUMERIC:
2664
+ return new AlphanumericData2(data2);
2665
+ case Mode2.KANJI:
2666
+ return new KanjiData2(data2);
2667
+ case Mode2.BYTE:
2668
+ return new ByteData2(data2);
2669
+ }
2670
+ }
2671
+ exports.fromArray = function fromArray(array) {
2672
+ return array.reduce(function(acc, seg) {
2673
+ if (typeof seg === "string") {
2674
+ acc.push(buildSingleSegment(seg, null));
2675
+ } else if (seg.data) {
2676
+ acc.push(buildSingleSegment(seg.data, seg.mode));
2677
+ }
2678
+ return acc;
2679
+ }, []);
2680
+ };
2681
+ exports.fromString = function fromString(data2, version2) {
2682
+ const segs = getSegmentsFromString(data2, Utils2.isKanjiModeEnabled());
2683
+ const nodes = buildNodes(segs);
2684
+ const graph = buildGraph(nodes, version2);
2685
+ const path = dijkstra.find_path(graph.map, "start", "end");
2686
+ const optimizedSegs = [];
2687
+ for (let i2 = 1; i2 < path.length - 1; i2++) {
2688
+ optimizedSegs.push(graph.table[path[i2]].node);
2689
+ }
2690
+ return exports.fromArray(mergeSegments(optimizedSegs));
2691
+ };
2692
+ exports.rawSplit = function rawSplit(data2) {
2693
+ return exports.fromArray(
2694
+ getSegmentsFromString(data2, Utils2.isKanjiModeEnabled())
2695
+ );
2696
+ };
2697
+ })(segments);
2698
+ const Utils$1 = utils$1;
2699
+ const ECLevel = errorCorrectionLevel;
2700
+ const BitBuffer = bitBuffer;
2701
+ const BitMatrix = bitMatrix;
2702
+ const AlignmentPattern = alignmentPattern;
2703
+ const FinderPattern = finderPattern;
2704
+ const MaskPattern = maskPattern;
2705
+ const ECCode = errorCorrectionCode;
2706
+ const ReedSolomonEncoder = reedSolomonEncoder;
2707
+ const Version = version;
2708
+ const FormatInfo = formatInfo;
2709
+ const Mode = mode;
2710
+ const Segments = segments;
2711
+ function setupFinderPattern(matrix, version2) {
2712
+ const size = matrix.size;
2713
+ const pos = FinderPattern.getPositions(version2);
2714
+ for (let i2 = 0; i2 < pos.length; i2++) {
2715
+ const row = pos[i2][0];
2716
+ const col = pos[i2][1];
2717
+ for (let r2 = -1; r2 <= 7; r2++) {
2718
+ if (row + r2 <= -1 || size <= row + r2) continue;
2719
+ for (let c2 = -1; c2 <= 7; c2++) {
2720
+ if (col + c2 <= -1 || size <= col + c2) continue;
2721
+ if (r2 >= 0 && r2 <= 6 && (c2 === 0 || c2 === 6) || c2 >= 0 && c2 <= 6 && (r2 === 0 || r2 === 6) || r2 >= 2 && r2 <= 4 && c2 >= 2 && c2 <= 4) {
2722
+ matrix.set(row + r2, col + c2, true, true);
2723
+ } else {
2724
+ matrix.set(row + r2, col + c2, false, true);
2725
+ }
2726
+ }
2727
+ }
2728
+ }
2729
+ }
2730
+ function setupTimingPattern(matrix) {
2731
+ const size = matrix.size;
2732
+ for (let r2 = 8; r2 < size - 8; r2++) {
2733
+ const value = r2 % 2 === 0;
2734
+ matrix.set(r2, 6, value, true);
2735
+ matrix.set(6, r2, value, true);
2736
+ }
2737
+ }
2738
+ function setupAlignmentPattern(matrix, version2) {
2739
+ const pos = AlignmentPattern.getPositions(version2);
2740
+ for (let i2 = 0; i2 < pos.length; i2++) {
2741
+ const row = pos[i2][0];
2742
+ const col = pos[i2][1];
2743
+ for (let r2 = -2; r2 <= 2; r2++) {
2744
+ for (let c2 = -2; c2 <= 2; c2++) {
2745
+ if (r2 === -2 || r2 === 2 || c2 === -2 || c2 === 2 || r2 === 0 && c2 === 0) {
2746
+ matrix.set(row + r2, col + c2, true, true);
2747
+ } else {
2748
+ matrix.set(row + r2, col + c2, false, true);
2749
+ }
2750
+ }
2751
+ }
2752
+ }
2753
+ }
2754
+ function setupVersionInfo(matrix, version2) {
2755
+ const size = matrix.size;
2756
+ const bits = Version.getEncodedBits(version2);
2757
+ let row, col, mod;
2758
+ for (let i2 = 0; i2 < 18; i2++) {
2759
+ row = Math.floor(i2 / 3);
2760
+ col = i2 % 3 + size - 8 - 3;
2761
+ mod = (bits >> i2 & 1) === 1;
2762
+ matrix.set(row, col, mod, true);
2763
+ matrix.set(col, row, mod, true);
2764
+ }
2765
+ }
2766
+ function setupFormatInfo(matrix, errorCorrectionLevel2, maskPattern2) {
2767
+ const size = matrix.size;
2768
+ const bits = FormatInfo.getEncodedBits(errorCorrectionLevel2, maskPattern2);
2769
+ let i2, mod;
2770
+ for (i2 = 0; i2 < 15; i2++) {
2771
+ mod = (bits >> i2 & 1) === 1;
2772
+ if (i2 < 6) {
2773
+ matrix.set(i2, 8, mod, true);
2774
+ } else if (i2 < 8) {
2775
+ matrix.set(i2 + 1, 8, mod, true);
2776
+ } else {
2777
+ matrix.set(size - 15 + i2, 8, mod, true);
2778
+ }
2779
+ if (i2 < 8) {
2780
+ matrix.set(8, size - i2 - 1, mod, true);
2781
+ } else if (i2 < 9) {
2782
+ matrix.set(8, 15 - i2 - 1 + 1, mod, true);
2783
+ } else {
2784
+ matrix.set(8, 15 - i2 - 1, mod, true);
2785
+ }
2786
+ }
2787
+ matrix.set(size - 8, 8, 1, true);
2788
+ }
2789
+ function setupData(matrix, data2) {
2790
+ const size = matrix.size;
2791
+ let inc = -1;
2792
+ let row = size - 1;
2793
+ let bitIndex = 7;
2794
+ let byteIndex = 0;
2795
+ for (let col = size - 1; col > 0; col -= 2) {
2796
+ if (col === 6) col--;
2797
+ while (true) {
2798
+ for (let c2 = 0; c2 < 2; c2++) {
2799
+ if (!matrix.isReserved(row, col - c2)) {
2800
+ let dark = false;
2801
+ if (byteIndex < data2.length) {
2802
+ dark = (data2[byteIndex] >>> bitIndex & 1) === 1;
2803
+ }
2804
+ matrix.set(row, col - c2, dark);
2805
+ bitIndex--;
2806
+ if (bitIndex === -1) {
2807
+ byteIndex++;
2808
+ bitIndex = 7;
2809
+ }
2810
+ }
2811
+ }
2812
+ row += inc;
2813
+ if (row < 0 || size <= row) {
2814
+ row -= inc;
2815
+ inc = -inc;
2816
+ break;
2817
+ }
2818
+ }
2819
+ }
2820
+ }
2821
+ function createData(version2, errorCorrectionLevel2, segments2) {
2822
+ const buffer = new BitBuffer();
2823
+ segments2.forEach(function(data2) {
2824
+ buffer.put(data2.mode.bit, 4);
2825
+ buffer.put(data2.getLength(), Mode.getCharCountIndicator(data2.mode, version2));
2826
+ data2.write(buffer);
2827
+ });
2828
+ const totalCodewords = Utils$1.getSymbolTotalCodewords(version2);
2829
+ const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2);
2830
+ const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8;
2831
+ if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) {
2832
+ buffer.put(0, 4);
2833
+ }
2834
+ while (buffer.getLengthInBits() % 8 !== 0) {
2835
+ buffer.putBit(0);
2836
+ }
2837
+ const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8;
2838
+ for (let i2 = 0; i2 < remainingByte; i2++) {
2839
+ buffer.put(i2 % 2 ? 17 : 236, 8);
2840
+ }
2841
+ return createCodewords(buffer, version2, errorCorrectionLevel2);
2842
+ }
2843
+ function createCodewords(bitBuffer2, version2, errorCorrectionLevel2) {
2844
+ const totalCodewords = Utils$1.getSymbolTotalCodewords(version2);
2845
+ const ecTotalCodewords = ECCode.getTotalCodewordsCount(version2, errorCorrectionLevel2);
2846
+ const dataTotalCodewords = totalCodewords - ecTotalCodewords;
2847
+ const ecTotalBlocks = ECCode.getBlocksCount(version2, errorCorrectionLevel2);
2848
+ const blocksInGroup2 = totalCodewords % ecTotalBlocks;
2849
+ const blocksInGroup1 = ecTotalBlocks - blocksInGroup2;
2850
+ const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks);
2851
+ const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks);
2852
+ const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1;
2853
+ const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1;
2854
+ const rs = new ReedSolomonEncoder(ecCount);
2855
+ let offset = 0;
2856
+ const dcData = new Array(ecTotalBlocks);
2857
+ const ecData = new Array(ecTotalBlocks);
2858
+ let maxDataSize = 0;
2859
+ const buffer = new Uint8Array(bitBuffer2.buffer);
2860
+ for (let b2 = 0; b2 < ecTotalBlocks; b2++) {
2861
+ const dataSize = b2 < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2;
2862
+ dcData[b2] = buffer.slice(offset, offset + dataSize);
2863
+ ecData[b2] = rs.encode(dcData[b2]);
2864
+ offset += dataSize;
2865
+ maxDataSize = Math.max(maxDataSize, dataSize);
2866
+ }
2867
+ const data2 = new Uint8Array(totalCodewords);
2868
+ let index = 0;
2869
+ let i2, r2;
2870
+ for (i2 = 0; i2 < maxDataSize; i2++) {
2871
+ for (r2 = 0; r2 < ecTotalBlocks; r2++) {
2872
+ if (i2 < dcData[r2].length) {
2873
+ data2[index++] = dcData[r2][i2];
2874
+ }
2875
+ }
2876
+ }
2877
+ for (i2 = 0; i2 < ecCount; i2++) {
2878
+ for (r2 = 0; r2 < ecTotalBlocks; r2++) {
2879
+ data2[index++] = ecData[r2][i2];
2880
+ }
2881
+ }
2882
+ return data2;
2883
+ }
2884
+ function createSymbol(data2, version2, errorCorrectionLevel2, maskPattern2) {
2885
+ let segments2;
2886
+ if (Array.isArray(data2)) {
2887
+ segments2 = Segments.fromArray(data2);
2888
+ } else if (typeof data2 === "string") {
2889
+ let estimatedVersion = version2;
2890
+ if (!estimatedVersion) {
2891
+ const rawSegments = Segments.rawSplit(data2);
2892
+ estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel2);
2893
+ }
2894
+ segments2 = Segments.fromString(data2, estimatedVersion || 40);
2895
+ } else {
2896
+ throw new Error("Invalid data");
2897
+ }
2898
+ const bestVersion = Version.getBestVersionForData(segments2, errorCorrectionLevel2);
2899
+ if (!bestVersion) {
2900
+ throw new Error("The amount of data is too big to be stored in a QR Code");
2901
+ }
2902
+ if (!version2) {
2903
+ version2 = bestVersion;
2904
+ } else if (version2 < bestVersion) {
2905
+ throw new Error(
2906
+ "\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + bestVersion + ".\n"
2907
+ );
2908
+ }
2909
+ const dataBits = createData(version2, errorCorrectionLevel2, segments2);
2910
+ const moduleCount = Utils$1.getSymbolSize(version2);
2911
+ const modules = new BitMatrix(moduleCount);
2912
+ setupFinderPattern(modules, version2);
2913
+ setupTimingPattern(modules);
2914
+ setupAlignmentPattern(modules, version2);
2915
+ setupFormatInfo(modules, errorCorrectionLevel2, 0);
2916
+ if (version2 >= 7) {
2917
+ setupVersionInfo(modules, version2);
2918
+ }
2919
+ setupData(modules, dataBits);
2920
+ if (isNaN(maskPattern2)) {
2921
+ maskPattern2 = MaskPattern.getBestMask(
2922
+ modules,
2923
+ setupFormatInfo.bind(null, modules, errorCorrectionLevel2)
2924
+ );
2925
+ }
2926
+ MaskPattern.applyMask(maskPattern2, modules);
2927
+ setupFormatInfo(modules, errorCorrectionLevel2, maskPattern2);
2928
+ return {
2929
+ modules,
2930
+ version: version2,
2931
+ errorCorrectionLevel: errorCorrectionLevel2,
2932
+ maskPattern: maskPattern2,
2933
+ segments: segments2
2934
+ };
2935
+ }
2936
+ qrcode.create = function create(data2, options) {
2937
+ if (typeof data2 === "undefined" || data2 === "") {
2938
+ throw new Error("No input text");
2939
+ }
2940
+ let errorCorrectionLevel2 = ECLevel.M;
2941
+ let version2;
2942
+ let mask;
2943
+ if (typeof options !== "undefined") {
2944
+ errorCorrectionLevel2 = ECLevel.from(options.errorCorrectionLevel, ECLevel.M);
2945
+ version2 = Version.from(options.version);
2946
+ mask = MaskPattern.from(options.maskPattern);
2947
+ if (options.toSJISFunc) {
2948
+ Utils$1.setToSJISFunction(options.toSJISFunc);
2949
+ }
2950
+ }
2951
+ return createSymbol(data2, version2, errorCorrectionLevel2, mask);
2952
+ };
2953
+ var canvas = {};
2954
+ var utils = {};
2955
+ (function(exports) {
2956
+ function hex2rgba(hex) {
2957
+ if (typeof hex === "number") {
2958
+ hex = hex.toString();
2959
+ }
2960
+ if (typeof hex !== "string") {
2961
+ throw new Error("Color should be defined as hex string");
2962
+ }
2963
+ let hexCode = hex.slice().replace("#", "").split("");
2964
+ if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) {
2965
+ throw new Error("Invalid hex color: " + hex);
2966
+ }
2967
+ if (hexCode.length === 3 || hexCode.length === 4) {
2968
+ hexCode = Array.prototype.concat.apply([], hexCode.map(function(c2) {
2969
+ return [c2, c2];
2970
+ }));
2971
+ }
2972
+ if (hexCode.length === 6) hexCode.push("F", "F");
2973
+ const hexValue = parseInt(hexCode.join(""), 16);
2974
+ return {
2975
+ r: hexValue >> 24 & 255,
2976
+ g: hexValue >> 16 & 255,
2977
+ b: hexValue >> 8 & 255,
2978
+ a: hexValue & 255,
2979
+ hex: "#" + hexCode.slice(0, 6).join("")
2980
+ };
2981
+ }
2982
+ exports.getOptions = function getOptions2(options) {
2983
+ if (!options) options = {};
2984
+ if (!options.color) options.color = {};
2985
+ const margin = typeof options.margin === "undefined" || options.margin === null || options.margin < 0 ? 4 : options.margin;
2986
+ const width = options.width && options.width >= 21 ? options.width : void 0;
2987
+ const scale = options.scale || 4;
2988
+ return {
2989
+ width,
2990
+ scale: width ? 4 : scale,
2991
+ margin,
2992
+ color: {
2993
+ dark: hex2rgba(options.color.dark || "#000000ff"),
2994
+ light: hex2rgba(options.color.light || "#ffffffff")
2995
+ },
2996
+ type: options.type,
2997
+ rendererOpts: options.rendererOpts || {}
2998
+ };
2999
+ };
3000
+ exports.getScale = function getScale(qrSize, opts) {
3001
+ return opts.width && opts.width >= qrSize + opts.margin * 2 ? opts.width / (qrSize + opts.margin * 2) : opts.scale;
3002
+ };
3003
+ exports.getImageWidth = function getImageWidth(qrSize, opts) {
3004
+ const scale = exports.getScale(qrSize, opts);
3005
+ return Math.floor((qrSize + opts.margin * 2) * scale);
3006
+ };
3007
+ exports.qrToImageData = function qrToImageData(imgData, qr, opts) {
3008
+ const size = qr.modules.size;
3009
+ const data2 = qr.modules.data;
3010
+ const scale = exports.getScale(size, opts);
3011
+ const symbolSize = Math.floor((size + opts.margin * 2) * scale);
3012
+ const scaledMargin = opts.margin * scale;
3013
+ const palette = [opts.color.light, opts.color.dark];
3014
+ for (let i2 = 0; i2 < symbolSize; i2++) {
3015
+ for (let j2 = 0; j2 < symbolSize; j2++) {
3016
+ let posDst = (i2 * symbolSize + j2) * 4;
3017
+ let pxColor = opts.color.light;
3018
+ if (i2 >= scaledMargin && j2 >= scaledMargin && i2 < symbolSize - scaledMargin && j2 < symbolSize - scaledMargin) {
3019
+ const iSrc = Math.floor((i2 - scaledMargin) / scale);
3020
+ const jSrc = Math.floor((j2 - scaledMargin) / scale);
3021
+ pxColor = palette[data2[iSrc * size + jSrc] ? 1 : 0];
3022
+ }
3023
+ imgData[posDst++] = pxColor.r;
3024
+ imgData[posDst++] = pxColor.g;
3025
+ imgData[posDst++] = pxColor.b;
3026
+ imgData[posDst] = pxColor.a;
3027
+ }
3028
+ }
3029
+ };
3030
+ })(utils);
3031
+ (function(exports) {
3032
+ const Utils2 = utils;
3033
+ function clearCanvas(ctx, canvas2, size) {
3034
+ ctx.clearRect(0, 0, canvas2.width, canvas2.height);
3035
+ if (!canvas2.style) canvas2.style = {};
3036
+ canvas2.height = size;
3037
+ canvas2.width = size;
3038
+ canvas2.style.height = size + "px";
3039
+ canvas2.style.width = size + "px";
3040
+ }
3041
+ function getCanvasElement() {
3042
+ try {
3043
+ return document.createElement("canvas");
3044
+ } catch (e2) {
3045
+ throw new Error("You need to specify a canvas element");
3046
+ }
3047
+ }
3048
+ exports.render = function render2(qrData, canvas2, options) {
3049
+ let opts = options;
3050
+ let canvasEl = canvas2;
3051
+ if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) {
3052
+ opts = canvas2;
3053
+ canvas2 = void 0;
3054
+ }
3055
+ if (!canvas2) {
3056
+ canvasEl = getCanvasElement();
3057
+ }
3058
+ opts = Utils2.getOptions(opts);
3059
+ const size = Utils2.getImageWidth(qrData.modules.size, opts);
3060
+ const ctx = canvasEl.getContext("2d");
3061
+ const image = ctx.createImageData(size, size);
3062
+ Utils2.qrToImageData(image.data, qrData, opts);
3063
+ clearCanvas(ctx, canvasEl, size);
3064
+ ctx.putImageData(image, 0, 0);
3065
+ return canvasEl;
3066
+ };
3067
+ exports.renderToDataURL = function renderToDataURL(qrData, canvas2, options) {
3068
+ let opts = options;
3069
+ if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) {
3070
+ opts = canvas2;
3071
+ canvas2 = void 0;
3072
+ }
3073
+ if (!opts) opts = {};
3074
+ const canvasEl = exports.render(qrData, canvas2, opts);
3075
+ const type = opts.type || "image/png";
3076
+ const rendererOpts = opts.rendererOpts || {};
3077
+ return canvasEl.toDataURL(type, rendererOpts.quality);
3078
+ };
3079
+ })(canvas);
3080
+ var svgTag = {};
3081
+ const Utils = utils;
3082
+ function getColorAttrib(color, attrib) {
3083
+ const alpha = color.a / 255;
3084
+ const str = attrib + '="' + color.hex + '"';
3085
+ return alpha < 1 ? str + " " + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"' : str;
3086
+ }
3087
+ function svgCmd(cmd, x2, y2) {
3088
+ let str = cmd + x2;
3089
+ if (typeof y2 !== "undefined") str += " " + y2;
3090
+ return str;
3091
+ }
3092
+ function qrToPath(data2, size, margin) {
3093
+ let path = "";
3094
+ let moveBy = 0;
3095
+ let newRow = false;
3096
+ let lineLength = 0;
3097
+ for (let i2 = 0; i2 < data2.length; i2++) {
3098
+ const col = Math.floor(i2 % size);
3099
+ const row = Math.floor(i2 / size);
3100
+ if (!col && !newRow) newRow = true;
3101
+ if (data2[i2]) {
3102
+ lineLength++;
3103
+ if (!(i2 > 0 && col > 0 && data2[i2 - 1])) {
3104
+ path += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0);
3105
+ moveBy = 0;
3106
+ newRow = false;
3107
+ }
3108
+ if (!(col + 1 < size && data2[i2 + 1])) {
3109
+ path += svgCmd("h", lineLength);
3110
+ lineLength = 0;
3111
+ }
3112
+ } else {
3113
+ moveBy++;
3114
+ }
3115
+ }
3116
+ return path;
3117
+ }
3118
+ svgTag.render = function render(qrData, options, cb) {
3119
+ const opts = Utils.getOptions(options);
3120
+ const size = qrData.modules.size;
3121
+ const data2 = qrData.modules.data;
3122
+ const qrcodesize = size + opts.margin * 2;
3123
+ const bg = !opts.color.light.a ? "" : "<path " + getColorAttrib(opts.color.light, "fill") + ' d="M0 0h' + qrcodesize + "v" + qrcodesize + 'H0z"/>';
3124
+ const path = "<path " + getColorAttrib(opts.color.dark, "stroke") + ' d="' + qrToPath(data2, size, opts.margin) + '"/>';
3125
+ const viewBox = 'viewBox="0 0 ' + qrcodesize + " " + qrcodesize + '"';
3126
+ const width = !opts.width ? "" : 'width="' + opts.width + '" height="' + opts.width + '" ';
3127
+ const svgTag2 = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path + "</svg>\n";
3128
+ if (typeof cb === "function") {
3129
+ cb(null, svgTag2);
3130
+ }
3131
+ return svgTag2;
3132
+ };
3133
+ const canPromise = canPromise$1;
3134
+ const QRCode = qrcode;
3135
+ const CanvasRenderer = canvas;
3136
+ const SvgRenderer = svgTag;
3137
+ function renderCanvas(renderFunc, canvas2, text, opts, cb) {
3138
+ const args = [].slice.call(arguments, 1);
3139
+ const argsNum = args.length;
3140
+ const isLastArgCb = typeof args[argsNum - 1] === "function";
3141
+ if (!isLastArgCb && !canPromise()) {
3142
+ throw new Error("Callback required as last argument");
3143
+ }
3144
+ if (isLastArgCb) {
3145
+ if (argsNum < 2) {
3146
+ throw new Error("Too few arguments provided");
3147
+ }
3148
+ if (argsNum === 2) {
3149
+ cb = text;
3150
+ text = canvas2;
3151
+ canvas2 = opts = void 0;
3152
+ } else if (argsNum === 3) {
3153
+ if (canvas2.getContext && typeof cb === "undefined") {
3154
+ cb = opts;
3155
+ opts = void 0;
3156
+ } else {
3157
+ cb = opts;
3158
+ opts = text;
3159
+ text = canvas2;
3160
+ canvas2 = void 0;
3161
+ }
3162
+ }
3163
+ } else {
3164
+ if (argsNum < 1) {
3165
+ throw new Error("Too few arguments provided");
3166
+ }
3167
+ if (argsNum === 1) {
3168
+ text = canvas2;
3169
+ canvas2 = opts = void 0;
3170
+ } else if (argsNum === 2 && !canvas2.getContext) {
3171
+ opts = text;
3172
+ text = canvas2;
3173
+ canvas2 = void 0;
3174
+ }
3175
+ return new Promise(function(resolve, reject) {
3176
+ try {
3177
+ const data2 = QRCode.create(text, opts);
3178
+ resolve(renderFunc(data2, canvas2, opts));
3179
+ } catch (e2) {
3180
+ reject(e2);
3181
+ }
3182
+ });
3183
+ }
3184
+ try {
3185
+ const data2 = QRCode.create(text, opts);
3186
+ cb(null, renderFunc(data2, canvas2, opts));
3187
+ } catch (e2) {
3188
+ cb(e2);
3189
+ }
3190
+ }
3191
+ browser.create = QRCode.create;
3192
+ browser.toCanvas = renderCanvas.bind(null, CanvasRenderer.render);
3193
+ browser.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL);
3194
+ browser.toString = renderCanvas.bind(null, function(data2, _2, opts) {
3195
+ return SvgRenderer.render(data2, opts);
3196
+ });
3197
+ var et = Object.defineProperty, Be = Object.getOwnPropertySymbols, tt = Object.prototype.hasOwnProperty, ot = Object.prototype.propertyIsEnumerable, Ue = (e2, o3, r2) => o3 in e2 ? et(e2, o3, { enumerable: true, configurable: true, writable: true, value: r2 }) : e2[o3] = r2, ve = (e2, o3) => {
3198
+ for (var r2 in o3 || (o3 = {})) tt.call(o3, r2) && Ue(e2, r2, o3[r2]);
3199
+ if (Be) for (var r2 of Be(o3)) ot.call(o3, r2) && Ue(e2, r2, o3[r2]);
3200
+ return e2;
3201
+ };
3202
+ function rt() {
3203
+ var e2;
3204
+ const o3 = (e2 = ne$1.state.themeMode) != null ? e2 : "dark", r2 = { light: { foreground: { 1: "rgb(20,20,20)", 2: "rgb(121,134,134)", 3: "rgb(158,169,169)" }, background: { 1: "rgb(255,255,255)", 2: "rgb(241,243,243)", 3: "rgb(228,231,231)" }, overlay: "rgba(0,0,0,0.1)" }, dark: { foreground: { 1: "rgb(228,231,231)", 2: "rgb(148,158,158)", 3: "rgb(110,119,119)" }, background: { 1: "rgb(20,20,20)", 2: "rgb(39,42,42)", 3: "rgb(59,64,64)" }, overlay: "rgba(255,255,255,0.1)" } }[o3];
3205
+ return { "--wcm-color-fg-1": r2.foreground[1], "--wcm-color-fg-2": r2.foreground[2], "--wcm-color-fg-3": r2.foreground[3], "--wcm-color-bg-1": r2.background[1], "--wcm-color-bg-2": r2.background[2], "--wcm-color-bg-3": r2.background[3], "--wcm-color-overlay": r2.overlay };
3206
+ }
3207
+ function He() {
3208
+ return { "--wcm-accent-color": "#3396FF", "--wcm-accent-fill-color": "#FFFFFF", "--wcm-z-index": "89", "--wcm-background-color": "#3396FF", "--wcm-background-border-radius": "8px", "--wcm-container-border-radius": "30px", "--wcm-wallet-icon-border-radius": "15px", "--wcm-wallet-icon-large-border-radius": "30px", "--wcm-wallet-icon-small-border-radius": "7px", "--wcm-input-border-radius": "28px", "--wcm-button-border-radius": "10px", "--wcm-notification-border-radius": "36px", "--wcm-secondary-button-border-radius": "28px", "--wcm-icon-button-border-radius": "50%", "--wcm-button-hover-highlight-border-radius": "10px", "--wcm-text-big-bold-size": "20px", "--wcm-text-big-bold-weight": "600", "--wcm-text-big-bold-line-height": "24px", "--wcm-text-big-bold-letter-spacing": "-0.03em", "--wcm-text-big-bold-text-transform": "none", "--wcm-text-xsmall-bold-size": "10px", "--wcm-text-xsmall-bold-weight": "700", "--wcm-text-xsmall-bold-line-height": "12px", "--wcm-text-xsmall-bold-letter-spacing": "0.02em", "--wcm-text-xsmall-bold-text-transform": "uppercase", "--wcm-text-xsmall-regular-size": "12px", "--wcm-text-xsmall-regular-weight": "600", "--wcm-text-xsmall-regular-line-height": "14px", "--wcm-text-xsmall-regular-letter-spacing": "-0.03em", "--wcm-text-xsmall-regular-text-transform": "none", "--wcm-text-small-thin-size": "14px", "--wcm-text-small-thin-weight": "500", "--wcm-text-small-thin-line-height": "16px", "--wcm-text-small-thin-letter-spacing": "-0.03em", "--wcm-text-small-thin-text-transform": "none", "--wcm-text-small-regular-size": "14px", "--wcm-text-small-regular-weight": "600", "--wcm-text-small-regular-line-height": "16px", "--wcm-text-small-regular-letter-spacing": "-0.03em", "--wcm-text-small-regular-text-transform": "none", "--wcm-text-medium-regular-size": "16px", "--wcm-text-medium-regular-weight": "600", "--wcm-text-medium-regular-line-height": "20px", "--wcm-text-medium-regular-letter-spacing": "-0.03em", "--wcm-text-medium-regular-text-transform": "none", "--wcm-font-family": "-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif", "--wcm-font-feature-settings": "'tnum' on, 'lnum' on, 'case' on", "--wcm-success-color": "rgb(38,181,98)", "--wcm-error-color": "rgb(242, 90, 103)", "--wcm-overlay-background-color": "rgba(0, 0, 0, 0.3)", "--wcm-overlay-backdrop-filter": "none" };
3209
+ }
3210
+ const h = { getPreset(e2) {
3211
+ return He()[e2];
3212
+ }, setTheme() {
3213
+ const e2 = document.querySelector(":root"), { themeVariables: o3 } = ne$1.state;
3214
+ if (e2) {
3215
+ const r2 = ve(ve(ve({}, rt()), He()), o3);
3216
+ Object.entries(r2).forEach(([a2, t2]) => e2.style.setProperty(a2, t2));
3217
+ }
3218
+ }, globalCss: i$3`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}` }, at = i$3`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;
3219
+ var lt = Object.defineProperty, it = Object.getOwnPropertyDescriptor, F = (e2, o3, r2, a2) => {
3220
+ for (var t2 = a2 > 1 ? void 0 : a2 ? it(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3221
+ return a2 && t2 && lt(o3, r2, t2), t2;
3222
+ };
3223
+ let T = class extends s {
3224
+ constructor() {
3225
+ super(...arguments), this.disabled = false, this.iconLeft = void 0, this.iconRight = void 0, this.onClick = () => null, this.variant = "default";
3226
+ }
3227
+ render() {
3228
+ const e2 = { "wcm-icon-left": this.iconLeft !== void 0, "wcm-icon-right": this.iconRight !== void 0, "wcm-ghost": this.variant === "ghost", "wcm-outline": this.variant === "outline" };
3229
+ let o$12 = "inverse";
3230
+ return this.variant === "ghost" && (o$12 = "secondary"), this.variant === "outline" && (o$12 = "accent"), x`<button class="${o2(e2)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<wcm-text variant="small-regular" color="${o$12}"><slot></slot></wcm-text>${this.iconRight}</button>`;
3231
+ }
3232
+ };
3233
+ T.styles = [h.globalCss, at], F([n$1({ type: Boolean })], T.prototype, "disabled", 2), F([n$1()], T.prototype, "iconLeft", 2), F([n$1()], T.prototype, "iconRight", 2), F([n$1()], T.prototype, "onClick", 2), F([n$1()], T.prototype, "variant", 2), T = F([e$2("wcm-button")], T);
3234
+ const nt = i$3`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;
3235
+ var ct = Object.defineProperty, st = Object.getOwnPropertyDescriptor, ue = (e2, o3, r2, a2) => {
3236
+ for (var t2 = a2 > 1 ? void 0 : a2 ? st(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3237
+ return a2 && t2 && ct(o3, r2, t2), t2;
3238
+ };
3239
+ let ee = class extends s {
3240
+ constructor() {
3241
+ super(...arguments), this.disabled = false, this.variant = "primary";
3242
+ }
3243
+ render() {
3244
+ const e2 = { "wcm-secondary": this.variant === "secondary" };
3245
+ return x`<button ?disabled="${this.disabled}" class="${o2(e2)}"><slot></slot></button>`;
3246
+ }
3247
+ };
3248
+ ee.styles = [h.globalCss, nt], ue([n$1({ type: Boolean })], ee.prototype, "disabled", 2), ue([n$1()], ee.prototype, "variant", 2), ee = ue([e$2("wcm-button-big")], ee);
3249
+ const dt = i$3`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;
3250
+ var wt = (e2, o3, r2, a2) => {
3251
+ for (var t2 = o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = i2(t2) || t2);
3252
+ return t2;
3253
+ };
3254
+ let be = class extends s {
3255
+ render() {
3256
+ return x`<div><slot></slot></div>`;
3257
+ }
3258
+ };
3259
+ be.styles = [h.globalCss, dt], be = wt([e$2("wcm-info-footer")], be);
3260
+ const v = { CROSS_ICON: b`<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.94 11A.75.75 0 1 0 11 9.94L7.414 6.353a.5.5 0 0 1 0-.708L11 2.061A.75.75 0 1 0 9.94 1L6.353 4.586a.5.5 0 0 1-.708 0L2.061 1A.75.75 0 0 0 1 2.06l3.586 3.586a.5.5 0 0 1 0 .708L1 9.939A.75.75 0 1 0 2.06 11l3.586-3.586a.5.5 0 0 1 .708 0L9.939 11Z" fill="#fff"/></svg>`, WALLET_CONNECT_LOGO: b`<svg width="178" height="29" viewBox="0 0 178 29" id="wcm-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`, WALLET_CONNECT_ICON: b`<svg width="28" height="20" viewBox="0 0 28 20"><g clip-path="url(#a)"><path d="M7.386 6.482c3.653-3.576 9.575-3.576 13.228 0l.44.43a.451.451 0 0 1 0 .648L19.55 9.033a.237.237 0 0 1-.33 0l-.606-.592c-2.548-2.496-6.68-2.496-9.228 0l-.648.634a.237.237 0 0 1-.33 0L6.902 7.602a.451.451 0 0 1 0-.647l.483-.473Zm16.338 3.046 1.339 1.31a.451.451 0 0 1 0 .648l-6.035 5.909a.475.475 0 0 1-.662 0L14.083 13.2a.119.119 0 0 0-.166 0l-4.283 4.194a.475.475 0 0 1-.662 0l-6.035-5.91a.451.451 0 0 1 0-.647l1.338-1.31a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0Z" fill="#000000"/></g><defs><clipPath id="a"><path fill="#ffffff" d="M0 0h28v20H0z"/></clipPath></defs></svg>`, WALLET_CONNECT_ICON_COLORED: b`<svg width="96" height="96" fill="none"><path fill="#fff" d="M25.322 33.597c12.525-12.263 32.83-12.263 45.355 0l1.507 1.476a1.547 1.547 0 0 1 0 2.22l-5.156 5.048a.814.814 0 0 1-1.134 0l-2.074-2.03c-8.737-8.555-22.903-8.555-31.64 0l-2.222 2.175a.814.814 0 0 1-1.134 0l-5.156-5.049a1.547 1.547 0 0 1 0-2.22l1.654-1.62Zm56.019 10.44 4.589 4.494a1.547 1.547 0 0 1 0 2.22l-20.693 20.26a1.628 1.628 0 0 1-2.267 0L48.283 56.632a.407.407 0 0 0-.567 0L33.03 71.012a1.628 1.628 0 0 1-2.268 0L10.07 50.75a1.547 1.547 0 0 1 0-2.22l4.59-4.494a1.628 1.628 0 0 1 2.267 0l14.687 14.38c.156.153.41.153.567 0l14.685-14.38a1.628 1.628 0 0 1 2.268 0l14.687 14.38c.156.153.41.153.567 0l14.686-14.38a1.628 1.628 0 0 1 2.268 0Z"/><path stroke="#000" d="M25.672 33.954c12.33-12.072 32.325-12.072 44.655 0l1.508 1.476a1.047 1.047 0 0 1 0 1.506l-5.157 5.048a.314.314 0 0 1-.434 0l-2.074-2.03c-8.932-8.746-23.409-8.746-32.34 0l-2.222 2.174a.314.314 0 0 1-.434 0l-5.157-5.048a1.047 1.047 0 0 1 0-1.506l1.655-1.62Zm55.319 10.44 4.59 4.494a1.047 1.047 0 0 1 0 1.506l-20.694 20.26a1.128 1.128 0 0 1-1.568 0l-14.686-14.38a.907.907 0 0 0-1.267 0L32.68 70.655a1.128 1.128 0 0 1-1.568 0L10.42 50.394a1.047 1.047 0 0 1 0-1.506l4.59-4.493a1.128 1.128 0 0 1 1.567 0l14.687 14.379a.907.907 0 0 0 1.266 0l-.35-.357.35.357 14.686-14.38a1.128 1.128 0 0 1 1.568 0l14.687 14.38a.907.907 0 0 0 1.267 0l14.686-14.38a1.128 1.128 0 0 1 1.568 0Z"/></svg>`, BACK_ICON: b`<svg width="10" height="18" viewBox="0 0 10 18"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.735.179a.75.75 0 0 1 .087 1.057L2.92 8.192a1.25 1.25 0 0 0 0 1.617l5.902 6.956a.75.75 0 1 1-1.144.97L1.776 10.78a2.75 2.75 0 0 1 0-3.559L7.678.265A.75.75 0 0 1 8.735.18Z" fill="#fff"/></svg>`, COPY_ICON: b`<svg width="24" height="24" fill="none"><path fill="#fff" fill-rule="evenodd" d="M7.01 7.01c.03-1.545.138-2.5.535-3.28A5 5 0 0 1 9.73 1.545C10.8 1 12.2 1 15 1c2.8 0 4.2 0 5.27.545a5 5 0 0 1 2.185 2.185C23 4.8 23 6.2 23 9c0 2.8 0 4.2-.545 5.27a5 5 0 0 1-2.185 2.185c-.78.397-1.735.505-3.28.534l-.001.01c-.03 1.54-.138 2.493-.534 3.27a5 5 0 0 1-2.185 2.186C13.2 23 11.8 23 9 23c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C1 19.2 1 17.8 1 15c0-2.8 0-4.2.545-5.27A5 5 0 0 1 3.73 7.545C4.508 7.149 5.46 7.04 7 7.01h.01ZM15 15.5c-1.425 0-2.403-.001-3.162-.063-.74-.06-1.139-.172-1.427-.319a3.5 3.5 0 0 1-1.53-1.529c-.146-.288-.257-.686-.318-1.427C8.501 11.403 8.5 10.425 8.5 9c0-1.425.001-2.403.063-3.162.06-.74.172-1.139.318-1.427a3.5 3.5 0 0 1 1.53-1.53c.288-.146.686-.257 1.427-.318.759-.062 1.737-.063 3.162-.063 1.425 0 2.403.001 3.162.063.74.06 1.139.172 1.427.318a3.5 3.5 0 0 1 1.53 1.53c.146.288.257.686.318 1.427.062.759.063 1.737.063 3.162 0 1.425-.001 2.403-.063 3.162-.06.74-.172 1.139-.319 1.427a3.5 3.5 0 0 1-1.529 1.53c-.288.146-.686.257-1.427.318-.759.062-1.737.063-3.162.063ZM7 8.511c-.444.009-.825.025-1.162.052-.74.06-1.139.172-1.427.318a3.5 3.5 0 0 0-1.53 1.53c-.146.288-.257.686-.318 1.427-.062.759-.063 1.737-.063 3.162 0 1.425.001 2.403.063 3.162.06.74.172 1.139.318 1.427a3.5 3.5 0 0 0 1.53 1.53c.288.146.686.257 1.427.318.759.062 1.737.063 3.162.063 1.425 0 2.403-.001 3.162-.063.74-.06 1.139-.172 1.427-.319a3.5 3.5 0 0 0 1.53-1.53c.146-.287.257-.685.318-1.426.027-.337.043-.718.052-1.162H15c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C7 13.2 7 11.8 7 9v-.489Z" clip-rule="evenodd"/></svg>`, RETRY_ICON: b`<svg width="15" height="16" viewBox="0 0 15 16"><path d="M6.464 2.03A.75.75 0 0 0 5.403.97L2.08 4.293a1 1 0 0 0 0 1.414L5.403 9.03a.75.75 0 0 0 1.06-1.06L4.672 6.177a.25.25 0 0 1 .177-.427h2.085a4 4 0 1 1-3.93 4.746c-.077-.407-.405-.746-.82-.746-.414 0-.755.338-.7.748a5.501 5.501 0 1 0 5.45-6.248H4.848a.25.25 0 0 1-.177-.427L6.464 2.03Z" fill="#fff"/></svg>`, DESKTOP_ICON: b`<svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 5.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C2.204 1 3.13 1 4.98 1h6.04c1.85 0 2.775 0 3.466.394a3 3 0 0 1 1.12 1.12C16 3.204 16 4.13 16 5.98v1.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C13.796 12 12.87 12 11.02 12H4.98c-1.85 0-2.775 0-3.466-.394a3 3 0 0 1-1.12-1.12C0 9.796 0 8.87 0 7.02V5.98ZM4.98 2.5h6.04c.953 0 1.568.001 2.034.043.446.04.608.108.69.154a1.5 1.5 0 0 1 .559.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033v1.04c0 .952-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.046-.243.114-.69.154-.466.042-1.08.043-2.033.043H4.98c-.952 0-1.568-.001-2.034-.043-.446-.04-.608-.108-.69-.154a1.5 1.5 0 0 1-.559-.56c-.046-.08-.114-.243-.154-.69-.042-.465-.043-1.08-.043-2.033V5.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.046.243-.114.69-.154.465-.042 1.08-.043 2.033-.043Z" fill="#fff"/><path d="M4 14.25a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`, MOBILE_ICON: b`<svg width="16" height="16" viewBox="0 0 16 16"><path d="M6.75 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 4.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C5.204 0 6.136 0 8 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C13 2.204 13 3.13 13 4.98v6.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C10.796 16 9.864 16 8 16s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C3 13.796 3 12.87 3 11.02V4.98Zm8.5 0v6.04c0 .953-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.046-.08-.114-.243-.154-.69-.042-.466-.043-1.08-.043-2.033V4.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.045.243-.113.693-.154C6.42 1.501 7.041 1.5 8 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033Z" fill="#fff"/></svg>`, ARROW_DOWN_ICON: b`<svg width="14" height="14" viewBox="0 0 14 14"><path d="M2.28 7.47a.75.75 0 0 0-1.06 1.06l5.25 5.25a.75.75 0 0 0 1.06 0l5.25-5.25a.75.75 0 0 0-1.06-1.06l-3.544 3.543a.25.25 0 0 1-.426-.177V.75a.75.75 0 0 0-1.5 0v10.086a.25.25 0 0 1-.427.176L2.28 7.47Z" fill="#fff"/></svg>`, ARROW_UP_RIGHT_ICON: b`<svg width="15" height="14" fill="none"><path d="M4.5 1.75A.75.75 0 0 1 5.25 1H12a1.5 1.5 0 0 1 1.5 1.5v6.75a.75.75 0 0 1-1.5 0V4.164a.25.25 0 0 0-.427-.176L4.061 11.5A.75.75 0 0 1 3 10.44l7.513-7.513a.25.25 0 0 0-.177-.427H5.25a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`, ARROW_RIGHT_ICON: b`<svg width="6" height="14" viewBox="0 0 6 14"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.181 1.099a.75.75 0 0 1 1.024.279l2.433 4.258a2.75 2.75 0 0 1 0 2.729l-2.433 4.257a.75.75 0 1 1-1.303-.744L4.335 7.62a1.25 1.25 0 0 0 0-1.24L1.902 2.122a.75.75 0 0 1 .28-1.023Z" fill="#fff"/></svg>`, QRCODE_ICON: b`<svg width="25" height="24" viewBox="0 0 25 24"><path d="M23.748 9a.748.748 0 0 0 .748-.752c-.018-2.596-.128-4.07-.784-5.22a6 6 0 0 0-2.24-2.24c-1.15-.656-2.624-.766-5.22-.784a.748.748 0 0 0-.752.748c0 .414.335.749.748.752 1.015.007 1.82.028 2.494.088.995.09 1.561.256 1.988.5.7.398 1.28.978 1.679 1.678.243.427.41.993.498 1.988.061.675.082 1.479.09 2.493a.753.753 0 0 0 .75.749ZM3.527.788C4.677.132 6.152.022 8.747.004A.748.748 0 0 1 9.5.752a.753.753 0 0 1-.749.752c-1.014.007-1.818.028-2.493.088-.995.09-1.561.256-1.988.5-.7.398-1.28.978-1.679 1.678-.243.427-.41.993-.499 1.988-.06.675-.081 1.479-.088 2.493A.753.753 0 0 1 1.252 9a.748.748 0 0 1-.748-.752c.018-2.596.128-4.07.784-5.22a6 6 0 0 1 2.24-2.24ZM1.252 15a.748.748 0 0 0-.748.752c.018 2.596.128 4.07.784 5.22a6 6 0 0 0 2.24 2.24c1.15.656 2.624.766 5.22.784a.748.748 0 0 0 .752-.748.753.753 0 0 0-.749-.752c-1.014-.007-1.818-.028-2.493-.089-.995-.089-1.561-.255-1.988-.498a4.5 4.5 0 0 1-1.679-1.68c-.243-.426-.41-.992-.499-1.987-.06-.675-.081-1.479-.088-2.493A.753.753 0 0 0 1.252 15ZM22.996 15.749a.753.753 0 0 1 .752-.749c.415 0 .751.338.748.752-.018 2.596-.128 4.07-.784 5.22a6 6 0 0 1-2.24 2.24c-1.15.656-2.624.766-5.22.784a.748.748 0 0 1-.752-.748c0-.414.335-.749.748-.752 1.015-.007 1.82-.028 2.494-.089.995-.089 1.561-.255 1.988-.498a4.5 4.5 0 0 0 1.679-1.68c.243-.426.41-.992.498-1.987.061-.675.082-1.479.09-2.493Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 4a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 11h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 4H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1ZM13.5 6.5A2.5 2.5 0 0 1 16 4h2a2.5 2.5 0 0 1 2.5 2.5v2A2.5 2.5 0 0 1 18 11h-2a2.5 2.5 0 0 1-2.5-2.5v-2Zm2.5-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1ZM7 13a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 20h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 13H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1Z" fill="#fff"/><path d="M13.5 15.5c0-.465 0-.697.038-.89a2 2 0 0 1 1.572-1.572C15.303 13 15.535 13 16 13v2.5h-2.5ZM18 13c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89H18V13ZM18 17.5h2.5c0 .465 0 .697-.038.89a2 2 0 0 1-1.572 1.572C18.697 20 18.465 20 18 20v-2.5ZM13.5 17.5H16V20c-.465 0-.697 0-.89-.038a2 2 0 0 1-1.572-1.572c-.038-.193-.038-.425-.038-.89Z" fill="#fff"/></svg>`, SCAN_ICON: b`<svg width="16" height="16" fill="none"><path fill="#fff" d="M10 15.216c0 .422.347.763.768.74 1.202-.064 2.025-.222 2.71-.613a5.001 5.001 0 0 0 1.865-1.866c.39-.684.549-1.507.613-2.709a.735.735 0 0 0-.74-.768.768.768 0 0 0-.76.732c-.009.157-.02.306-.032.447-.073.812-.206 1.244-.384 1.555-.31.545-.761.996-1.306 1.306-.311.178-.743.311-1.555.384-.141.013-.29.023-.447.032a.768.768 0 0 0-.732.76ZM10 .784c0 .407.325.737.732.76.157.009.306.02.447.032.812.073 1.244.206 1.555.384a3.5 3.5 0 0 1 1.306 1.306c.178.311.311.743.384 1.555.013.142.023.29.032.447a.768.768 0 0 0 .76.732.734.734 0 0 0 .74-.768c-.064-1.202-.222-2.025-.613-2.71A5 5 0 0 0 13.477.658c-.684-.39-1.507-.549-2.709-.613a.735.735 0 0 0-.768.74ZM5.232.044A.735.735 0 0 1 6 .784a.768.768 0 0 1-.732.76c-.157.009-.305.02-.447.032-.812.073-1.244.206-1.555.384A3.5 3.5 0 0 0 1.96 3.266c-.178.311-.311.743-.384 1.555-.013.142-.023.29-.032.447A.768.768 0 0 1 .784 6a.735.735 0 0 1-.74-.768c.064-1.202.222-2.025.613-2.71A5 5 0 0 1 2.523.658C3.207.267 4.03.108 5.233.044ZM5.268 14.456a.768.768 0 0 1 .732.76.734.734 0 0 1-.768.74c-1.202-.064-2.025-.222-2.71-.613a5 5 0 0 1-1.865-1.866c-.39-.684-.549-1.507-.613-2.709A.735.735 0 0 1 .784 10c.407 0 .737.325.76.732.009.157.02.306.032.447.073.812.206 1.244.384 1.555a3.5 3.5 0 0 0 1.306 1.306c.311.178.743.311 1.555.384.142.013.29.023.447.032Z"/></svg>`, CHECKMARK_ICON: b`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`, SEARCH_ICON: b`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`, WALLET_PLACEHOLDER: b`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`, GLOBE_ICON: b`<svg width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" fill-rule="evenodd" d="M15.5 8a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Zm-2.113.75c.301 0 .535.264.47.558a6.01 6.01 0 0 1-2.867 3.896c-.203.116-.42-.103-.334-.32.409-1.018.691-2.274.797-3.657a.512.512 0 0 1 .507-.477h1.427Zm.47-2.058c.065.294-.169.558-.47.558H11.96a.512.512 0 0 1-.507-.477c-.106-1.383-.389-2.638-.797-3.656-.087-.217.13-.437.333-.32a6.01 6.01 0 0 1 2.868 3.895Zm-4.402.558c.286 0 .515-.24.49-.525-.121-1.361-.429-2.534-.83-3.393-.279-.6-.549-.93-.753-1.112a.535.535 0 0 0-.724 0c-.204.182-.474.513-.754 1.112-.4.859-.708 2.032-.828 3.393a.486.486 0 0 0 .49.525h2.909Zm-5.415 0c.267 0 .486-.21.507-.477.106-1.383.389-2.638.797-3.656.087-.217-.13-.437-.333-.32a6.01 6.01 0 0 0-2.868 3.895c-.065.294.169.558.47.558H4.04ZM2.143 9.308c-.065-.294.169-.558.47-.558H4.04c.267 0 .486.21.507.477.106 1.383.389 2.639.797 3.657.087.217-.13.436-.333.32a6.01 6.01 0 0 1-2.868-3.896Zm3.913-.033a.486.486 0 0 1 .49-.525h2.909c.286 0 .515.24.49.525-.121 1.361-.428 2.535-.83 3.394-.279.6-.549.93-.753 1.112a.535.535 0 0 1-.724 0c-.204-.182-.474-.513-.754-1.112-.4-.859-.708-2.033-.828-3.394Z" clip-rule="evenodd"/></svg>` }, pt = i$3`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;
3261
+ var ut = (e2, o3, r2, a2) => {
3262
+ for (var t2 = o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = i2(t2) || t2);
3263
+ return t2;
3264
+ };
3265
+ let fe = class extends s {
3266
+ render() {
3267
+ return x`<div class="wcm-toolbar-placeholder"></div><div class="wcm-toolbar">${v.WALLET_CONNECT_LOGO} <button @click="${se$1.close}">${v.CROSS_ICON}</button></div>`;
3268
+ }
3269
+ };
3270
+ fe.styles = [h.globalCss, pt], fe = ut([e$2("wcm-modal-backcard")], fe);
3271
+ const bt = i$3`main{padding:20px;padding-top:0;width:100%}`;
3272
+ var yt = (e2, o3, r2, a2) => {
3273
+ for (var t2 = o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = i2(t2) || t2);
3274
+ return t2;
3275
+ };
3276
+ let xe = class extends s {
3277
+ render() {
3278
+ return x`<main><slot></slot></main>`;
3279
+ }
3280
+ };
3281
+ xe.styles = [h.globalCss, bt], xe = yt([e$2("wcm-modal-content")], xe);
3282
+ const $t = i$3`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;
3283
+ var Ot = (e2, o3, r2, a2) => {
3284
+ for (var t2 = o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = i2(t2) || t2);
3285
+ return t2;
3286
+ };
3287
+ let ye = class extends s {
3288
+ render() {
3289
+ return x`<footer><slot></slot></footer>`;
3290
+ }
3291
+ };
3292
+ ye.styles = [h.globalCss, $t], ye = Ot([e$2("wcm-modal-footer")], ye);
3293
+ const Wt = i$3`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;
3294
+ var It = Object.defineProperty, Et = Object.getOwnPropertyDescriptor, te = (e2, o3, r2, a2) => {
3295
+ for (var t2 = a2 > 1 ? void 0 : a2 ? Et(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3296
+ return a2 && t2 && It(o3, r2, t2), t2;
3297
+ };
3298
+ let S = class extends s {
3299
+ constructor() {
3300
+ super(...arguments), this.title = "", this.onAction = void 0, this.actionIcon = void 0, this.border = false;
3301
+ }
3302
+ backBtnTemplate() {
3303
+ return x`<button class="wcm-back-btn" @click="${T$2.goBack}">${v.BACK_ICON}</button>`;
3304
+ }
3305
+ actionBtnTemplate() {
3306
+ return x`<button class="wcm-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`;
3307
+ }
3308
+ render() {
3309
+ const e2 = { "wcm-border": this.border }, o$12 = T$2.state.history.length > 1, r2 = this.title ? x`<wcm-text variant="big-bold">${this.title}</wcm-text>` : x`<slot></slot>`;
3310
+ return x`<header class="${o2(e2)}">${o$12 ? this.backBtnTemplate() : null} ${r2} ${this.onAction ? this.actionBtnTemplate() : null}</header>`;
3311
+ }
3312
+ };
3313
+ S.styles = [h.globalCss, Wt], te([n$1()], S.prototype, "title", 2), te([n$1()], S.prototype, "onAction", 2), te([n$1()], S.prototype, "actionIcon", 2), te([n$1({ type: Boolean })], S.prototype, "border", 2), S = te([e$2("wcm-modal-header")], S);
3314
+ const c = { MOBILE_BREAKPOINT: 600, WCM_RECENT_WALLET_DATA: "WCM_RECENT_WALLET_DATA", EXPLORER_WALLET_URL: "https://explorer.walletconnect.com/?type=wallet", getShadowRootElement(e2, o3) {
3315
+ const r2 = e2.renderRoot.querySelector(o3);
3316
+ if (!r2) throw new Error(`${o3} not found`);
3317
+ return r2;
3318
+ }, getWalletIcon({ id: e2, image_id: o3 }) {
3319
+ const { walletImages: r2 } = y$1.state;
3320
+ return r2 != null && r2[e2] ? r2[e2] : o3 ? te$1.getWalletImageUrl(o3) : "";
3321
+ }, getWalletName(e2, o3 = false) {
3322
+ return o3 && e2.length > 8 ? `${e2.substring(0, 8)}..` : e2;
3323
+ }, isMobileAnimation() {
3324
+ return window.innerWidth <= c.MOBILE_BREAKPOINT;
3325
+ }, async preloadImage(e2) {
3326
+ const o3 = new Promise((r2, a2) => {
3327
+ const t2 = new Image();
3328
+ t2.onload = r2, t2.onerror = a2, t2.crossOrigin = "anonymous", t2.src = e2;
3329
+ });
3330
+ return Promise.race([o3, a$2.wait(3e3)]);
3331
+ }, getErrorMessage(e2) {
3332
+ return e2 instanceof Error ? e2.message : "Unknown Error";
3333
+ }, debounce(e2, o3 = 500) {
3334
+ let r2;
3335
+ return (...a2) => {
3336
+ function t2() {
3337
+ e2(...a2);
3338
+ }
3339
+ r2 && clearTimeout(r2), r2 = setTimeout(t2, o3);
3340
+ };
3341
+ }, handleMobileLinking(e2) {
3342
+ const { walletConnectUri: o3 } = p$1.state, { mobile: r2, name: a2 } = e2, t2 = r2 == null ? void 0 : r2.native, l2 = r2 == null ? void 0 : r2.universal;
3343
+ c.setRecentWallet(e2);
3344
+ function i2(s2) {
3345
+ let $2 = "";
3346
+ t2 ? $2 = a$2.formatUniversalUrl(t2, s2, a2) : l2 && ($2 = a$2.formatNativeUrl(l2, s2, a2)), a$2.openHref($2, "_self");
3347
+ }
3348
+ o3 && i2(o3);
3349
+ }, handleAndroidLinking() {
3350
+ const { walletConnectUri: e2 } = p$1.state;
3351
+ e2 && (a$2.setWalletConnectAndroidDeepLink(e2), a$2.openHref(e2, "_self"));
3352
+ }, async handleUriCopy() {
3353
+ const { walletConnectUri: e2 } = p$1.state;
3354
+ if (e2) try {
3355
+ await navigator.clipboard.writeText(e2), oe$1.openToast("Link copied", "success");
3356
+ } catch {
3357
+ oe$1.openToast("Failed to copy", "error");
3358
+ }
3359
+ }, getCustomImageUrls() {
3360
+ const { walletImages: e2 } = y$1.state, o3 = Object.values(e2 ?? {});
3361
+ return Object.values(o3);
3362
+ }, truncate(e2, o3 = 8) {
3363
+ return e2.length <= o3 ? e2 : `${e2.substring(0, 4)}...${e2.substring(e2.length - 4)}`;
3364
+ }, setRecentWallet(e2) {
3365
+ try {
3366
+ localStorage.setItem(c.WCM_RECENT_WALLET_DATA, JSON.stringify(e2));
3367
+ } catch {
3368
+ console.info("Unable to set recent wallet");
3369
+ }
3370
+ }, getRecentWallet() {
3371
+ try {
3372
+ const e2 = localStorage.getItem(c.WCM_RECENT_WALLET_DATA);
3373
+ return e2 ? JSON.parse(e2) : void 0;
3374
+ } catch {
3375
+ console.info("Unable to get recent wallet");
3376
+ }
3377
+ }, caseSafeIncludes(e2, o3) {
3378
+ return e2.toUpperCase().includes(o3.toUpperCase());
3379
+ }, openWalletExplorerUrl() {
3380
+ a$2.openHref(c.EXPLORER_WALLET_URL, "_blank");
3381
+ }, getCachedRouterWalletPlatforms() {
3382
+ const { desktop: e2, mobile: o3 } = a$2.getWalletRouterData(), r2 = Boolean(e2 == null ? void 0 : e2.native), a2 = Boolean(e2 == null ? void 0 : e2.universal), t2 = Boolean(o3 == null ? void 0 : o3.native) || Boolean(o3 == null ? void 0 : o3.universal);
3383
+ return { isDesktop: r2, isMobile: t2, isWeb: a2 };
3384
+ }, goToConnectingView(e2) {
3385
+ T$2.setData({ Wallet: e2 });
3386
+ const o3 = a$2.isMobile(), { isDesktop: r2, isWeb: a2, isMobile: t2 } = c.getCachedRouterWalletPlatforms();
3387
+ o3 ? t2 ? T$2.push("MobileConnecting") : a2 ? T$2.push("WebConnecting") : T$2.push("InstallWallet") : r2 ? T$2.push("DesktopConnecting") : a2 ? T$2.push("WebConnecting") : t2 ? T$2.push("MobileQrcodeConnecting") : T$2.push("InstallWallet");
3388
+ } }, Mt = i$3`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;
3389
+ var Lt = Object.defineProperty, Rt = Object.getOwnPropertyDescriptor, $e = (e2, o3, r2, a2) => {
3390
+ for (var t2 = a2 > 1 ? void 0 : a2 ? Rt(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3391
+ return a2 && t2 && Lt(o3, r2, t2), t2;
3392
+ };
3393
+ let oe = class extends s {
3394
+ constructor() {
3395
+ super(), this.view = T$2.state.view, this.prevView = T$2.state.view, this.unsubscribe = void 0, this.oldHeight = "0px", this.resizeObserver = void 0, this.unsubscribe = T$2.subscribe((e2) => {
3396
+ this.view !== e2.view && this.onChangeRoute();
3397
+ });
3398
+ }
3399
+ firstUpdated() {
3400
+ this.resizeObserver = new ResizeObserver(([e2]) => {
3401
+ const o3 = `${e2.contentRect.height}px`;
3402
+ this.oldHeight !== "0px" && animate(this.routerEl, { height: [this.oldHeight, o3] }, { duration: 0.2 }), this.oldHeight = o3;
3403
+ }), this.resizeObserver.observe(this.contentEl);
3404
+ }
3405
+ disconnectedCallback() {
3406
+ var e2, o3;
3407
+ (e2 = this.unsubscribe) == null || e2.call(this), (o3 = this.resizeObserver) == null || o3.disconnect();
3408
+ }
3409
+ get routerEl() {
3410
+ return c.getShadowRootElement(this, ".wcm-router");
3411
+ }
3412
+ get contentEl() {
3413
+ return c.getShadowRootElement(this, ".wcm-content");
3414
+ }
3415
+ viewTemplate() {
3416
+ switch (this.view) {
3417
+ case "ConnectWallet":
3418
+ return x`<wcm-connect-wallet-view></wcm-connect-wallet-view>`;
3419
+ case "DesktopConnecting":
3420
+ return x`<wcm-desktop-connecting-view></wcm-desktop-connecting-view>`;
3421
+ case "MobileConnecting":
3422
+ return x`<wcm-mobile-connecting-view></wcm-mobile-connecting-view>`;
3423
+ case "WebConnecting":
3424
+ return x`<wcm-web-connecting-view></wcm-web-connecting-view>`;
3425
+ case "MobileQrcodeConnecting":
3426
+ return x`<wcm-mobile-qr-connecting-view></wcm-mobile-qr-connecting-view>`;
3427
+ case "WalletExplorer":
3428
+ return x`<wcm-wallet-explorer-view></wcm-wallet-explorer-view>`;
3429
+ case "Qrcode":
3430
+ return x`<wcm-qrcode-view></wcm-qrcode-view>`;
3431
+ case "InstallWallet":
3432
+ return x`<wcm-install-wallet-view></wcm-install-wallet-view>`;
3433
+ default:
3434
+ return x`<div>Not Found</div>`;
3435
+ }
3436
+ }
3437
+ async onChangeRoute() {
3438
+ await animate(this.routerEl, { opacity: [1, 0], scale: [1, 1.02] }, { duration: 0.15, delay: 0.1 }).finished, this.view = T$2.state.view, animate(this.routerEl, { opacity: [0, 1], scale: [0.99, 1] }, { duration: 0.37, delay: 0.05 });
3439
+ }
3440
+ render() {
3441
+ return x`<div class="wcm-router"><div class="wcm-content">${this.viewTemplate()}</div></div>`;
3442
+ }
3443
+ };
3444
+ oe.styles = [h.globalCss, Mt], $e([t$1()], oe.prototype, "view", 2), $e([t$1()], oe.prototype, "prevView", 2), oe = $e([e$2("wcm-modal-router")], oe);
3445
+ const At = i$3`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;
3446
+ var Pt = Object.defineProperty, Tt = Object.getOwnPropertyDescriptor, ze = (e2, o3, r2, a2) => {
3447
+ for (var t2 = a2 > 1 ? void 0 : a2 ? Tt(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3448
+ return a2 && t2 && Pt(o3, r2, t2), t2;
3449
+ };
3450
+ let ne = class extends s {
3451
+ constructor() {
3452
+ super(), this.open = false, this.unsubscribe = void 0, this.timeout = void 0, this.unsubscribe = oe$1.subscribe((e2) => {
3453
+ e2.open ? (this.open = true, this.timeout = setTimeout(() => oe$1.closeToast(), 2200)) : (this.open = false, clearTimeout(this.timeout));
3454
+ });
3455
+ }
3456
+ disconnectedCallback() {
3457
+ var e2;
3458
+ (e2 = this.unsubscribe) == null || e2.call(this), clearTimeout(this.timeout), oe$1.closeToast();
3459
+ }
3460
+ render() {
3461
+ const { message: e2, variant: o$12 } = oe$1.state, r2 = { "wcm-success": o$12 === "success", "wcm-error": o$12 === "error" };
3462
+ return this.open ? x`<div class="${o2(r2)}">${o$12 === "success" ? v.CHECKMARK_ICON : null} ${o$12 === "error" ? v.CROSS_ICON : null}<wcm-text variant="small-regular">${e2}</wcm-text></div>` : null;
3463
+ }
3464
+ };
3465
+ ne.styles = [h.globalCss, At], ze([t$1()], ne.prototype, "open", 2), ne = ze([e$2("wcm-modal-toast")], ne);
3466
+ const jt = 0.1, Ve = 2.5, A = 7;
3467
+ function Ce(e2, o3, r2) {
3468
+ return e2 === o3 ? false : (e2 - o3 < 0 ? o3 - e2 : e2 - o3) <= r2 + jt;
3469
+ }
3470
+ function _t(e2, o3) {
3471
+ const r2 = Array.prototype.slice.call(browser.create(e2, { errorCorrectionLevel: o3 }).modules.data, 0), a2 = Math.sqrt(r2.length);
3472
+ return r2.reduce((t2, l2, i2) => (i2 % a2 === 0 ? t2.push([l2]) : t2[t2.length - 1].push(l2)) && t2, []);
3473
+ }
3474
+ const Dt = { generate(e2, o3, r2) {
3475
+ const a2 = "#141414", t2 = "#ffffff", l2 = [], i2 = _t(e2, "Q"), s2 = o3 / i2.length, $2 = [{ x: 0, y: 0 }, { x: 1, y: 0 }, { x: 0, y: 1 }];
3476
+ $2.forEach(({ x: y2, y: u3 }) => {
3477
+ const O = (i2.length - A) * s2 * y2, b$1 = (i2.length - A) * s2 * u3, E2 = 0.45;
3478
+ for (let M2 = 0; M2 < $2.length; M2 += 1) {
3479
+ const V2 = s2 * (A - M2 * 2);
3480
+ l2.push(b`<rect fill="${M2 % 2 === 0 ? a2 : t2}" height="${V2}" rx="${V2 * E2}" ry="${V2 * E2}" width="${V2}" x="${O + s2 * M2}" y="${b$1 + s2 * M2}">`);
3481
+ }
3482
+ });
3483
+ const f2 = Math.floor((r2 + 25) / s2), Ne = i2.length / 2 - f2 / 2, Ze = i2.length / 2 + f2 / 2 - 1, Se = [];
3484
+ i2.forEach((y2, u3) => {
3485
+ y2.forEach((O, b2) => {
3486
+ if (i2[u3][b2] && !(u3 < A && b2 < A || u3 > i2.length - (A + 1) && b2 < A || u3 < A && b2 > i2.length - (A + 1)) && !(u3 > Ne && u3 < Ze && b2 > Ne && b2 < Ze)) {
3487
+ const E2 = u3 * s2 + s2 / 2, M2 = b2 * s2 + s2 / 2;
3488
+ Se.push([E2, M2]);
3489
+ }
3490
+ });
3491
+ });
3492
+ const J = {};
3493
+ return Se.forEach(([y2, u3]) => {
3494
+ J[y2] ? J[y2].push(u3) : J[y2] = [u3];
3495
+ }), Object.entries(J).map(([y2, u3]) => {
3496
+ const O = u3.filter((b2) => u3.every((E2) => !Ce(b2, E2, s2)));
3497
+ return [Number(y2), O];
3498
+ }).forEach(([y2, u3]) => {
3499
+ u3.forEach((O) => {
3500
+ l2.push(b`<circle cx="${y2}" cy="${O}" fill="${a2}" r="${s2 / Ve}">`);
3501
+ });
3502
+ }), Object.entries(J).filter(([y2, u3]) => u3.length > 1).map(([y2, u3]) => {
3503
+ const O = u3.filter((b2) => u3.some((E2) => Ce(b2, E2, s2)));
3504
+ return [Number(y2), O];
3505
+ }).map(([y2, u3]) => {
3506
+ u3.sort((b2, E2) => b2 < E2 ? -1 : 1);
3507
+ const O = [];
3508
+ for (const b2 of u3) {
3509
+ const E2 = O.find((M2) => M2.some((V2) => Ce(b2, V2, s2)));
3510
+ E2 ? E2.push(b2) : O.push([b2]);
3511
+ }
3512
+ return [y2, O.map((b2) => [b2[0], b2[b2.length - 1]])];
3513
+ }).forEach(([y2, u3]) => {
3514
+ u3.forEach(([O, b$1]) => {
3515
+ l2.push(b`<line x1="${y2}" x2="${y2}" y1="${O}" y2="${b$1}" stroke="${a2}" stroke-width="${s2 / (Ve / 2)}" stroke-linecap="round">`);
3516
+ });
3517
+ }), l2;
3518
+ } }, Nt = i$3`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;
3519
+ var Zt = Object.defineProperty, St = Object.getOwnPropertyDescriptor, q = (e2, o3, r2, a2) => {
3520
+ for (var t2 = a2 > 1 ? void 0 : a2 ? St(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3521
+ return a2 && t2 && Zt(o3, r2, t2), t2;
3522
+ };
3523
+ let j = class extends s {
3524
+ constructor() {
3525
+ super(...arguments), this.uri = "", this.size = 0, this.imageId = void 0, this.walletId = void 0, this.imageUrl = void 0;
3526
+ }
3527
+ svgTemplate() {
3528
+ const e2 = ne$1.state.themeMode === "light" ? this.size : this.size - 36;
3529
+ return b`<svg height="${e2}" width="${e2}">${Dt.generate(this.uri, e2, e2 / 4)}</svg>`;
3530
+ }
3531
+ render() {
3532
+ const e2 = { "wcm-dark": ne$1.state.themeMode === "dark" };
3533
+ return x`<div style="${`width: ${this.size}px`}" class="${o2(e2)}">${this.walletId || this.imageUrl ? x`<wcm-wallet-image walletId="${l(this.walletId)}" imageId="${l(this.imageId)}" imageUrl="${l(this.imageUrl)}"></wcm-wallet-image>` : v.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`;
3534
+ }
3535
+ };
3536
+ j.styles = [h.globalCss, Nt], q([n$1()], j.prototype, "uri", 2), q([n$1({ type: Number })], j.prototype, "size", 2), q([n$1()], j.prototype, "imageId", 2), q([n$1()], j.prototype, "walletId", 2), q([n$1()], j.prototype, "imageUrl", 2), j = q([e$2("wcm-qrcode")], j);
3537
+ const Bt = i$3`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;
3538
+ var Ut = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor, Fe = (e2, o3, r2, a2) => {
3539
+ for (var t2 = a2 > 1 ? void 0 : a2 ? Ht(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3540
+ return a2 && t2 && Ut(o3, r2, t2), t2;
3541
+ };
3542
+ let ce = class extends s {
3543
+ constructor() {
3544
+ super(...arguments), this.onChange = () => null;
3545
+ }
3546
+ render() {
3547
+ return x`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${v.SEARCH_ICON}`;
3548
+ }
3549
+ };
3550
+ ce.styles = [h.globalCss, Bt], Fe([n$1()], ce.prototype, "onChange", 2), ce = Fe([e$2("wcm-search-input")], ce);
3551
+ const zt = i$3`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wcm-accent-color)}`;
3552
+ var qt = (e2, o3, r2, a2) => {
3553
+ for (var t2 = o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = i2(t2) || t2);
3554
+ return t2;
3555
+ };
3556
+ let ke = class extends s {
3557
+ render() {
3558
+ return x`<svg viewBox="0 0 50 50" width="24" height="24"><circle cx="25" cy="25" r="20" fill="none" stroke-width="4" stroke="#fff"/></svg>`;
3559
+ }
3560
+ };
3561
+ ke.styles = [h.globalCss, zt], ke = qt([e$2("wcm-spinner")], ke);
3562
+ const Qt = i$3`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;
3563
+ var Kt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, Oe = (e2, o3, r2, a2) => {
3564
+ for (var t2 = a2 > 1 ? void 0 : a2 ? Yt(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3565
+ return a2 && t2 && Kt(o3, r2, t2), t2;
3566
+ };
3567
+ let re = class extends s {
3568
+ constructor() {
3569
+ super(...arguments), this.variant = "medium-regular", this.color = "primary";
3570
+ }
3571
+ render() {
3572
+ const e2 = { "wcm-big-bold": this.variant === "big-bold", "wcm-medium-regular": this.variant === "medium-regular", "wcm-small-regular": this.variant === "small-regular", "wcm-small-thin": this.variant === "small-thin", "wcm-xsmall-regular": this.variant === "xsmall-regular", "wcm-xsmall-bold": this.variant === "xsmall-bold", "wcm-color-primary": this.color === "primary", "wcm-color-secondary": this.color === "secondary", "wcm-color-tertiary": this.color === "tertiary", "wcm-color-inverse": this.color === "inverse", "wcm-color-accnt": this.color === "accent", "wcm-color-error": this.color === "error" };
3573
+ return x`<span><slot class="${o2(e2)}"></slot></span>`;
3574
+ }
3575
+ };
3576
+ re.styles = [h.globalCss, Qt], Oe([n$1()], re.prototype, "variant", 2), Oe([n$1()], re.prototype, "color", 2), re = Oe([e$2("wcm-text")], re);
3577
+ const Gt = i$3`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;
3578
+ var Xt = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, _ = (e2, o3, r2, a2) => {
3579
+ for (var t2 = a2 > 1 ? void 0 : a2 ? Jt(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3580
+ return a2 && t2 && Xt(o3, r2, t2), t2;
3581
+ };
3582
+ let L2 = class extends s {
3583
+ constructor() {
3584
+ super(...arguments), this.onClick = () => null, this.name = "", this.walletId = "", this.label = void 0, this.imageId = void 0, this.installed = false, this.recent = false;
3585
+ }
3586
+ sublabelTemplate() {
3587
+ return this.recent ? x`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">RECENT</wcm-text>` : this.installed ? x`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</wcm-text>` : null;
3588
+ }
3589
+ handleClick() {
3590
+ R$1.click({ name: "WALLET_BUTTON", walletId: this.walletId }), this.onClick();
3591
+ }
3592
+ render() {
3593
+ var e2;
3594
+ return x`<button @click="${this.handleClick.bind(this)}"><div><wcm-wallet-image walletId="${this.walletId}" imageId="${l(this.imageId)}"></wcm-wallet-image><wcm-text variant="xsmall-regular">${(e2 = this.label) != null ? e2 : c.getWalletName(this.name, true)}</wcm-text>${this.sublabelTemplate()}</div></button>`;
3595
+ }
3596
+ };
3597
+ L2.styles = [h.globalCss, Gt], _([n$1()], L2.prototype, "onClick", 2), _([n$1()], L2.prototype, "name", 2), _([n$1()], L2.prototype, "walletId", 2), _([n$1()], L2.prototype, "label", 2), _([n$1()], L2.prototype, "imageId", 2), _([n$1({ type: Boolean })], L2.prototype, "installed", 2), _([n$1({ type: Boolean })], L2.prototype, "recent", 2), L2 = _([e$2("wcm-wallet-button")], L2);
3598
+ const eo = i$3`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;
3599
+ var to = Object.defineProperty, oo = Object.getOwnPropertyDescriptor, se = (e2, o3, r2, a2) => {
3600
+ for (var t2 = a2 > 1 ? void 0 : a2 ? oo(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3601
+ return a2 && t2 && to(o3, r2, t2), t2;
3602
+ };
3603
+ let Q = class extends s {
3604
+ constructor() {
3605
+ super(...arguments), this.walletId = "", this.imageId = void 0, this.imageUrl = void 0;
3606
+ }
3607
+ render() {
3608
+ var e2;
3609
+ const o3 = (e2 = this.imageUrl) != null && e2.length ? this.imageUrl : c.getWalletIcon({ id: this.walletId, image_id: this.imageId });
3610
+ return x`${o3.length ? x`<div><img crossorigin="anonymous" src="${o3}" alt="${this.id}"></div>` : v.WALLET_PLACEHOLDER}`;
3611
+ }
3612
+ };
3613
+ Q.styles = [h.globalCss, eo], se([n$1()], Q.prototype, "walletId", 2), se([n$1()], Q.prototype, "imageId", 2), se([n$1()], Q.prototype, "imageUrl", 2), Q = se([e$2("wcm-wallet-image")], Q);
3614
+ var ro = Object.defineProperty, ao = Object.getOwnPropertyDescriptor, qe = (e2, o3, r2, a2) => {
3615
+ for (var t2 = a2 > 1 ? void 0 : a2 ? ao(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3616
+ return a2 && t2 && ro(o3, r2, t2), t2;
3617
+ };
3618
+ let We = class extends s {
3619
+ constructor() {
3620
+ super(), this.preload = true, this.preloadData();
3621
+ }
3622
+ async loadImages(e2) {
3623
+ try {
3624
+ e2 != null && e2.length && await Promise.all(e2.map(async (o3) => c.preloadImage(o3)));
3625
+ } catch {
3626
+ console.info("Unsuccessful attempt at preloading some images", e2);
3627
+ }
3628
+ }
3629
+ async preloadListings() {
3630
+ if (y$1.state.enableExplorer) {
3631
+ await te$1.getRecomendedWallets(), p$1.setIsDataLoaded(true);
3632
+ const { recomendedWallets: e2 } = te$1.state, o3 = e2.map((r2) => c.getWalletIcon(r2));
3633
+ await this.loadImages(o3);
3634
+ } else p$1.setIsDataLoaded(true);
3635
+ }
3636
+ async preloadCustomImages() {
3637
+ const e2 = c.getCustomImageUrls();
3638
+ await this.loadImages(e2);
3639
+ }
3640
+ async preloadData() {
3641
+ try {
3642
+ this.preload && (this.preload = false, await Promise.all([this.preloadListings(), this.preloadCustomImages()]));
3643
+ } catch (e2) {
3644
+ console.error(e2), oe$1.openToast("Failed preloading", "error");
3645
+ }
3646
+ }
3647
+ };
3648
+ qe([t$1()], We.prototype, "preload", 2), We = qe([e$2("wcm-explorer-context")], We);
3649
+ var no = (e2, o3, r2, a2) => {
3650
+ for (var t2 = o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = i2(t2) || t2);
3651
+ return t2;
3652
+ };
3653
+ let Qe = class extends s {
3654
+ constructor() {
3655
+ super(), this.unsubscribeTheme = void 0, h.setTheme(), this.unsubscribeTheme = ne$1.subscribe(h.setTheme);
3656
+ }
3657
+ disconnectedCallback() {
3658
+ var e2;
3659
+ (e2 = this.unsubscribeTheme) == null || e2.call(this);
3660
+ }
3661
+ };
3662
+ Qe = no([e$2("wcm-theme-context")], Qe);
3663
+ const co = i$3`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;
3664
+ var ho = (e2, o3, r2, a2) => {
3665
+ for (var t2 = o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = i2(t2) || t2);
3666
+ return t2;
3667
+ };
3668
+ let Ie = class extends s {
3669
+ onGoToQrcode() {
3670
+ T$2.push("Qrcode");
3671
+ }
3672
+ render() {
3673
+ const { recomendedWallets: e2 } = te$1.state, o3 = [...e2, ...e2], r2 = a$2.RECOMMENDED_WALLET_AMOUNT * 2;
3674
+ return x`<wcm-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${v.QRCODE_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-title">${v.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">WalletConnect</wcm-text></div><div class="wcm-slider"><div class="wcm-track">${[...Array(r2)].map((a2, t2) => {
3675
+ const l2 = o3[t2 % o3.length];
3676
+ return l2 ? x`<wcm-wallet-image walletId="${l2.id}" imageId="${l2.image_id}"></wcm-wallet-image>` : v.WALLET_PLACEHOLDER;
3677
+ })}</div><wcm-button-big @click="${c.handleAndroidLinking}"><wcm-text variant="medium-regular" color="inverse">Select Wallet</wcm-text></wcm-button-big></div></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">Choose WalletConnect to see supported apps on your device</wcm-text></wcm-info-footer>`;
3678
+ }
3679
+ };
3680
+ Ie.styles = [h.globalCss, co], Ie = ho([e$2("wcm-android-wallet-selection")], Ie);
3681
+ const wo = i$3`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;
3682
+ var po = Object.defineProperty, go = Object.getOwnPropertyDescriptor, K = (e2, o3, r2, a2) => {
3683
+ for (var t2 = a2 > 1 ? void 0 : a2 ? go(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3684
+ return a2 && t2 && po(o3, r2, t2), t2;
3685
+ };
3686
+ let D = class extends s {
3687
+ constructor() {
3688
+ super(...arguments), this.walletId = void 0, this.imageId = void 0, this.isError = false, this.isStale = false, this.label = "";
3689
+ }
3690
+ svgLoaderTemplate() {
3691
+ var e2, o3;
3692
+ const r2 = (o3 = (e2 = ne$1.state.themeVariables) == null ? void 0 : e2["--wcm-wallet-icon-large-border-radius"]) != null ? o3 : h.getPreset("--wcm-wallet-icon-large-border-radius");
3693
+ let a2 = 0;
3694
+ r2.includes("%") ? a2 = 88 / 100 * parseInt(r2, 10) : a2 = parseInt(r2, 10), a2 *= 1.17;
3695
+ const t2 = 317 - a2 * 1.57, l2 = 425 - a2 * 1.8;
3696
+ return x`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="wcm-loader" x="2" y="2" width="106" height="106" rx="${a2}"/><use xlink:href="#wcm-loader" stroke-dasharray="106 ${t2}" stroke-dashoffset="${l2}"></use></svg>`;
3697
+ }
3698
+ render() {
3699
+ const e2 = { "wcm-error": this.isError, "wcm-stale": this.isStale };
3700
+ return x`<div class="${o2(e2)}">${this.svgLoaderTemplate()}<wcm-wallet-image walletId="${l(this.walletId)}" imageId="${l(this.imageId)}"></wcm-wallet-image></div><wcm-text variant="medium-regular" color="${this.isError ? "error" : "primary"}">${this.isError ? "Connection declined" : this.label}</wcm-text>`;
3701
+ }
3702
+ };
3703
+ D.styles = [h.globalCss, wo], K([n$1()], D.prototype, "walletId", 2), K([n$1()], D.prototype, "imageId", 2), K([n$1({ type: Boolean })], D.prototype, "isError", 2), K([n$1({ type: Boolean })], D.prototype, "isStale", 2), K([n$1()], D.prototype, "label", 2), D = K([e$2("wcm-connector-waiting")], D);
3704
+ const G = { manualWallets() {
3705
+ var e2, o3;
3706
+ const { mobileWallets: r2, desktopWallets: a2 } = y$1.state, t2 = (e2 = G.recentWallet()) == null ? void 0 : e2.id, l2 = a$2.isMobile() ? r2 : a2, i2 = l2 == null ? void 0 : l2.filter((s2) => t2 !== s2.id);
3707
+ return (o3 = a$2.isMobile() ? i2 == null ? void 0 : i2.map(({ id: s2, name: $2, links: f2 }) => ({ id: s2, name: $2, mobile: f2, links: f2 })) : i2 == null ? void 0 : i2.map(({ id: s2, name: $2, links: f2 }) => ({ id: s2, name: $2, desktop: f2, links: f2 }))) != null ? o3 : [];
3708
+ }, recentWallet() {
3709
+ return c.getRecentWallet();
3710
+ }, recomendedWallets(e2 = false) {
3711
+ var o3;
3712
+ const r2 = e2 || (o3 = G.recentWallet()) == null ? void 0 : o3.id, { recomendedWallets: a2 } = te$1.state;
3713
+ return a2.filter((t2) => r2 !== t2.id);
3714
+ } }, Z2 = { onConnecting(e2) {
3715
+ c.goToConnectingView(e2);
3716
+ }, manualWalletsTemplate() {
3717
+ return G.manualWallets().map((e2) => x`<wcm-wallet-button walletId="${e2.id}" name="${e2.name}" .onClick="${() => this.onConnecting(e2)}"></wcm-wallet-button>`);
3718
+ }, recomendedWalletsTemplate(e2 = false) {
3719
+ return G.recomendedWallets(e2).map((o3) => x`<wcm-wallet-button name="${o3.name}" walletId="${o3.id}" imageId="${o3.image_id}" .onClick="${() => this.onConnecting(o3)}"></wcm-wallet-button>`);
3720
+ }, recentWalletTemplate() {
3721
+ const e2 = G.recentWallet();
3722
+ if (e2) return x`<wcm-wallet-button name="${e2.name}" walletId="${e2.id}" imageId="${l(e2.image_id)}" .recent="${true}" .onClick="${() => this.onConnecting(e2)}"></wcm-wallet-button>`;
3723
+ } }, vo = i$3`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;
3724
+ var fo = (e2, o3, r2, a2) => {
3725
+ for (var t2 = o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = i2(t2) || t2);
3726
+ return t2;
3727
+ };
3728
+ let Ee = class extends s {
3729
+ render() {
3730
+ const { explorerExcludedWalletIds: e2, enableExplorer: o3 } = y$1.state, r2 = e2 !== "ALL" && o3, a2 = Z2.manualWalletsTemplate(), t2 = Z2.recomendedWalletsTemplate();
3731
+ let l2 = [Z2.recentWalletTemplate(), ...a2, ...t2];
3732
+ l2 = l2.filter(Boolean);
3733
+ const i2 = l2.length > 4 || r2;
3734
+ let s2 = [];
3735
+ i2 ? s2 = l2.slice(0, 3) : s2 = l2;
3736
+ const $2 = Boolean(s2.length);
3737
+ return x`<wcm-modal-header .border="${true}" title="Connect your wallet" .onAction="${c.handleUriCopy}" .actionIcon="${v.COPY_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-mobile-title"><div class="wcm-subtitle">${v.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">Mobile</wcm-text></div><div class="wcm-subtitle">${v.SCAN_ICON}<wcm-text variant="small-regular" color="secondary">Scan with your wallet</wcm-text></div></div><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>${$2 ? x`<wcm-modal-footer><div class="wcm-desktop-title">${v.DESKTOP_ICON}<wcm-text variant="small-regular" color="accent">Desktop</wcm-text></div><div class="wcm-grid">${s2} ${i2 ? x`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>` : null}</div></wcm-modal-footer>` : null}`;
3738
+ }
3739
+ };
3740
+ Ee.styles = [h.globalCss, vo], Ee = fo([e$2("wcm-desktop-wallet-selection")], Ee);
3741
+ const xo = i$3`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;
3742
+ var Co = (e2, o3, r2, a2) => {
3743
+ for (var t2 = o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = i2(t2) || t2);
3744
+ return t2;
3745
+ };
3746
+ let Me = class extends s {
3747
+ render() {
3748
+ const { termsOfServiceUrl: e2, privacyPolicyUrl: o3 } = y$1.state;
3749
+ return e2 ?? o3 ? x`<div><wcm-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${e2 ? x`<a href="${e2}" target="_blank" rel="noopener noreferrer">Terms of Service</a>` : null} ${e2 && o3 ? "and" : null} ${o3 ? x`<a href="${o3}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>` : null}</wcm-text></div>` : null;
3750
+ }
3751
+ };
3752
+ Me.styles = [h.globalCss, xo], Me = Co([e$2("wcm-legal-notice")], Me);
3753
+ const ko = i$3`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;
3754
+ var Io = (e2, o3, r2, a2) => {
3755
+ for (var t2 = o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = i2(t2) || t2);
3756
+ return t2;
3757
+ };
3758
+ let Le = class extends s {
3759
+ onQrcode() {
3760
+ T$2.push("Qrcode");
3761
+ }
3762
+ render() {
3763
+ const { explorerExcludedWalletIds: e2, enableExplorer: o3 } = y$1.state, r2 = e2 !== "ALL" && o3, a2 = Z2.manualWalletsTemplate(), t2 = Z2.recomendedWalletsTemplate();
3764
+ let l2 = [Z2.recentWalletTemplate(), ...a2, ...t2];
3765
+ l2 = l2.filter(Boolean);
3766
+ const i2 = l2.length > 8 || r2;
3767
+ let s2 = [];
3768
+ i2 ? s2 = l2.slice(0, 7) : s2 = l2;
3769
+ const $2 = Boolean(s2.length);
3770
+ return x`<wcm-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${v.QRCODE_ICON}"></wcm-modal-header>${$2 ? x`<wcm-modal-content><div>${s2} ${i2 ? x`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>` : null}</div></wcm-modal-content>` : null}`;
3771
+ }
3772
+ };
3773
+ Le.styles = [h.globalCss, ko], Le = Io([e$2("wcm-mobile-wallet-selection")], Le);
3774
+ const Eo = i$3`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;
3775
+ var Mo = Object.defineProperty, Lo = Object.getOwnPropertyDescriptor, Re = (e2, o3, r2, a2) => {
3776
+ for (var t2 = a2 > 1 ? void 0 : a2 ? Lo(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3777
+ return a2 && t2 && Mo(o3, r2, t2), t2;
3778
+ };
3779
+ let ae = class extends s {
3780
+ constructor() {
3781
+ super(), this.open = false, this.active = false, this.unsubscribeModal = void 0, this.abortController = void 0, this.unsubscribeModal = se$1.subscribe((e2) => {
3782
+ e2.open ? this.onOpenModalEvent() : this.onCloseModalEvent();
3783
+ });
3784
+ }
3785
+ disconnectedCallback() {
3786
+ var e2;
3787
+ (e2 = this.unsubscribeModal) == null || e2.call(this);
3788
+ }
3789
+ get overlayEl() {
3790
+ return c.getShadowRootElement(this, ".wcm-overlay");
3791
+ }
3792
+ get containerEl() {
3793
+ return c.getShadowRootElement(this, ".wcm-container");
3794
+ }
3795
+ toggleBodyScroll(e2) {
3796
+ if (document.querySelector("body")) if (e2) {
3797
+ const o3 = document.getElementById("wcm-styles");
3798
+ o3 == null ? void 0 : o3.remove();
3799
+ } else document.head.insertAdjacentHTML("beforeend", '<style id="wcm-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>');
3800
+ }
3801
+ onCloseModal(e2) {
3802
+ e2.target === e2.currentTarget && se$1.close();
3803
+ }
3804
+ onOpenModalEvent() {
3805
+ this.toggleBodyScroll(false), this.addKeyboardEvents(), this.open = true, setTimeout(async () => {
3806
+ const e2 = c.isMobileAnimation() ? { y: ["50vh", "0vh"] } : { scale: [0.98, 1] }, o3 = 0.1, r2 = 0.2;
3807
+ await Promise.all([animate(this.overlayEl, { opacity: [0, 1] }, { delay: o3, duration: r2 }).finished, animate(this.containerEl, e2, { delay: o3, duration: r2 }).finished]), this.active = true;
3808
+ }, 0);
3809
+ }
3810
+ async onCloseModalEvent() {
3811
+ this.toggleBodyScroll(true), this.removeKeyboardEvents();
3812
+ const e2 = c.isMobileAnimation() ? { y: ["0vh", "50vh"] } : { scale: [1, 0.98] }, o3 = 0.2;
3813
+ await Promise.all([animate(this.overlayEl, { opacity: [1, 0] }, { duration: o3 }).finished, animate(this.containerEl, e2, { duration: o3 }).finished]), this.containerEl.removeAttribute("style"), this.active = false, this.open = false;
3814
+ }
3815
+ addKeyboardEvents() {
3816
+ this.abortController = new AbortController(), window.addEventListener("keydown", (e2) => {
3817
+ var o3;
3818
+ e2.key === "Escape" ? se$1.close() : e2.key === "Tab" && ((o3 = e2.target) != null && o3.tagName.includes("wcm-") || this.containerEl.focus());
3819
+ }, this.abortController), this.containerEl.focus();
3820
+ }
3821
+ removeKeyboardEvents() {
3822
+ var e2;
3823
+ (e2 = this.abortController) == null || e2.abort(), this.abortController = void 0;
3824
+ }
3825
+ render() {
3826
+ const e2 = { "wcm-overlay": true, "wcm-active": this.active };
3827
+ return x`<wcm-explorer-context></wcm-explorer-context><wcm-theme-context></wcm-theme-context><div id="wcm-modal" class="${o2(e2)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="wcm-container" tabindex="0">${this.open ? x`<wcm-modal-backcard></wcm-modal-backcard><div class="wcm-card"><wcm-modal-router></wcm-modal-router><wcm-modal-toast></wcm-modal-toast></div>` : null}</div></div>`;
3828
+ }
3829
+ };
3830
+ ae.styles = [h.globalCss, Eo], Re([t$1()], ae.prototype, "open", 2), Re([t$1()], ae.prototype, "active", 2), ae = Re([e$2("wcm-modal")], ae);
3831
+ const Ro = i$3`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;
3832
+ var Ao = Object.defineProperty, Po = Object.getOwnPropertyDescriptor, le = (e2, o3, r2, a2) => {
3833
+ for (var t2 = a2 > 1 ? void 0 : a2 ? Po(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3834
+ return a2 && t2 && Ao(o3, r2, t2), t2;
3835
+ };
3836
+ let B = class extends s {
3837
+ constructor() {
3838
+ super(...arguments), this.isMobile = false, this.isDesktop = false, this.isWeb = false, this.isRetry = false;
3839
+ }
3840
+ onMobile() {
3841
+ a$2.isMobile() ? T$2.replace("MobileConnecting") : T$2.replace("MobileQrcodeConnecting");
3842
+ }
3843
+ onDesktop() {
3844
+ T$2.replace("DesktopConnecting");
3845
+ }
3846
+ onWeb() {
3847
+ T$2.replace("WebConnecting");
3848
+ }
3849
+ render() {
3850
+ return x`<div>${this.isRetry ? x`<slot></slot>` : null} ${this.isMobile ? x`<wcm-button .onClick="${this.onMobile}" .iconLeft="${v.MOBILE_ICON}" variant="outline">Mobile</wcm-button>` : null} ${this.isDesktop ? x`<wcm-button .onClick="${this.onDesktop}" .iconLeft="${v.DESKTOP_ICON}" variant="outline">Desktop</wcm-button>` : null} ${this.isWeb ? x`<wcm-button .onClick="${this.onWeb}" .iconLeft="${v.GLOBE_ICON}" variant="outline">Web</wcm-button>` : null}</div>`;
3851
+ }
3852
+ };
3853
+ B.styles = [h.globalCss, Ro], le([n$1({ type: Boolean })], B.prototype, "isMobile", 2), le([n$1({ type: Boolean })], B.prototype, "isDesktop", 2), le([n$1({ type: Boolean })], B.prototype, "isWeb", 2), le([n$1({ type: Boolean })], B.prototype, "isRetry", 2), B = le([e$2("wcm-platform-selection")], B);
3854
+ const To = i$3`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;
3855
+ var Do = (e2, o3, r2, a2) => {
3856
+ for (var t2 = o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = i2(t2) || t2);
3857
+ return t2;
3858
+ };
3859
+ let Ae = class extends s {
3860
+ onClick() {
3861
+ T$2.push("WalletExplorer");
3862
+ }
3863
+ render() {
3864
+ const { recomendedWallets: e2 } = te$1.state, o3 = G.manualWallets(), r2 = [...e2, ...o3].reverse().slice(0, 4);
3865
+ return x`<button @click="${this.onClick}"><div class="wcm-icons">${r2.map((a2) => {
3866
+ const t2 = c.getWalletIcon(a2);
3867
+ if (t2) return x`<img crossorigin="anonymous" src="${t2}">`;
3868
+ const l2 = c.getWalletIcon({ id: a2.id });
3869
+ return l2 ? x`<img crossorigin="anonymous" src="${l2}">` : v.WALLET_PLACEHOLDER;
3870
+ })} ${[...Array(4 - r2.length)].map(() => v.WALLET_PLACEHOLDER)}</div><wcm-text variant="xsmall-regular">View All</wcm-text></button>`;
3871
+ }
3872
+ };
3873
+ Ae.styles = [h.globalCss, To], Ae = Do([e$2("wcm-view-all-wallets-button")], Ae);
3874
+ const No = i$3`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;
3875
+ var Zo = Object.defineProperty, So = Object.getOwnPropertyDescriptor, de = (e2, o3, r2, a2) => {
3876
+ for (var t2 = a2 > 1 ? void 0 : a2 ? So(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3877
+ return a2 && t2 && Zo(o3, r2, t2), t2;
3878
+ };
3879
+ let Y = class extends s {
3880
+ constructor() {
3881
+ super(), this.walletId = "", this.imageId = "", this.uri = "", setTimeout(() => {
3882
+ const { walletConnectUri: e2 } = p$1.state;
3883
+ this.uri = e2;
3884
+ }, 0);
3885
+ }
3886
+ get overlayEl() {
3887
+ return c.getShadowRootElement(this, ".wcm-qr-container");
3888
+ }
3889
+ render() {
3890
+ return x`<div class="wcm-qr-container">${this.uri ? x`<wcm-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${l(this.walletId)}" imageId="${l(this.imageId)}"></wcm-qrcode>` : x`<wcm-spinner></wcm-spinner>`}</div>`;
3891
+ }
3892
+ };
3893
+ Y.styles = [h.globalCss, No], de([n$1()], Y.prototype, "walletId", 2), de([n$1()], Y.prototype, "imageId", 2), de([t$1()], Y.prototype, "uri", 2), Y = de([e$2("wcm-walletconnect-qr")], Y);
3894
+ var Ho = (e2, o3, r2, a2) => {
3895
+ for (var t2 = o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = i2(t2) || t2);
3896
+ return t2;
3897
+ };
3898
+ let Pe = class extends s {
3899
+ viewTemplate() {
3900
+ return a$2.isAndroid() ? x`<wcm-android-wallet-selection></wcm-android-wallet-selection>` : a$2.isMobile() ? x`<wcm-mobile-wallet-selection></wcm-mobile-wallet-selection>` : x`<wcm-desktop-wallet-selection></wcm-desktop-wallet-selection>`;
3901
+ }
3902
+ render() {
3903
+ return x`${this.viewTemplate()}<wcm-legal-notice></wcm-legal-notice>`;
3904
+ }
3905
+ };
3906
+ Pe.styles = [h.globalCss], Pe = Ho([e$2("wcm-connect-wallet-view")], Pe);
3907
+ const zo = i$3`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;
3908
+ var Vo = Object.defineProperty, Fo = Object.getOwnPropertyDescriptor, Ke = (e2, o3, r2, a2) => {
3909
+ for (var t2 = a2 > 1 ? void 0 : a2 ? Fo(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3910
+ return a2 && t2 && Vo(o3, r2, t2), t2;
3911
+ };
3912
+ let me = class extends s {
3913
+ constructor() {
3914
+ super(), this.isError = false, this.openDesktopApp();
3915
+ }
3916
+ onFormatAndRedirect(e2) {
3917
+ const { desktop: o3, name: r2 } = a$2.getWalletRouterData(), a2 = o3 == null ? void 0 : o3.native;
3918
+ if (a2) {
3919
+ const t2 = a$2.formatNativeUrl(a2, e2, r2);
3920
+ a$2.openHref(t2, "_self");
3921
+ }
3922
+ }
3923
+ openDesktopApp() {
3924
+ const { walletConnectUri: e2 } = p$1.state, o3 = a$2.getWalletRouterData();
3925
+ c.setRecentWallet(o3), e2 && this.onFormatAndRedirect(e2);
3926
+ }
3927
+ render() {
3928
+ const { name: e2, id: o3, image_id: r2 } = a$2.getWalletRouterData(), { isMobile: a2, isWeb: t2 } = c.getCachedRouterWalletPlatforms();
3929
+ return x`<wcm-modal-header title="${e2}" .onAction="${c.handleUriCopy}" .actionIcon="${v.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${o3}" imageId="${l(r2)}" label="${`Continue in ${e2}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Connection can continue loading if ${e2} is not installed on your device`}</wcm-text><wcm-platform-selection .isMobile="${a2}" .isWeb="${t2}" .isRetry="${true}"><wcm-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${v.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`;
3930
+ }
3931
+ };
3932
+ me.styles = [h.globalCss, zo], Ke([t$1()], me.prototype, "isError", 2), me = Ke([e$2("wcm-desktop-connecting-view")], me);
3933
+ const qo = i$3`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;
3934
+ var Yo = (e2, o3, r2, a2) => {
3935
+ for (var t2 = o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = i2(t2) || t2);
3936
+ return t2;
3937
+ };
3938
+ let Te = class extends s {
3939
+ onInstall(e2) {
3940
+ e2 && a$2.openHref(e2, "_blank");
3941
+ }
3942
+ render() {
3943
+ const { name: e2, id: o3, image_id: r2, homepage: a2 } = a$2.getWalletRouterData();
3944
+ return x`<wcm-modal-header title="${e2}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${o3}" imageId="${l(r2)}" label="Not Detected" .isStale="${true}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Download ${e2} to continue. If multiple browser extensions are installed, disable non ${e2} ones and try again`}</wcm-text><wcm-button .onClick="${() => this.onInstall(a2)}" .iconLeft="${v.ARROW_DOWN_ICON}">Download</wcm-button></wcm-info-footer>`;
3945
+ }
3946
+ };
3947
+ Te.styles = [h.globalCss, qo], Te = Yo([e$2("wcm-install-wallet-view")], Te);
3948
+ const Go = i$3`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;
3949
+ var Xo = Object.defineProperty, Jo = Object.getOwnPropertyDescriptor, Ye = (e2, o3, r2, a2) => {
3950
+ for (var t2 = a2 > 1 ? void 0 : a2 ? Jo(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
3951
+ return a2 && t2 && Xo(o3, r2, t2), t2;
3952
+ };
3953
+ let he = class extends s {
3954
+ constructor() {
3955
+ super(), this.isError = false, this.openMobileApp();
3956
+ }
3957
+ onFormatAndRedirect(e2, o3 = false) {
3958
+ const { mobile: r2, name: a2 } = a$2.getWalletRouterData(), t2 = r2 == null ? void 0 : r2.native, l2 = r2 == null ? void 0 : r2.universal;
3959
+ if (t2 && !o3) {
3960
+ const i2 = a$2.formatNativeUrl(t2, e2, a2);
3961
+ a$2.openHref(i2, "_self");
3962
+ } else if (l2) {
3963
+ const i2 = a$2.formatUniversalUrl(l2, e2, a2);
3964
+ a$2.openHref(i2, "_self");
3965
+ }
3966
+ }
3967
+ openMobileApp(e2 = false) {
3968
+ const { walletConnectUri: o3 } = p$1.state, r2 = a$2.getWalletRouterData();
3969
+ c.setRecentWallet(r2), o3 && this.onFormatAndRedirect(o3, e2);
3970
+ }
3971
+ onGoToAppStore(e2) {
3972
+ e2 && a$2.openHref(e2, "_blank");
3973
+ }
3974
+ render() {
3975
+ const { name: e2, id: o3, image_id: r2, app: a2, mobile: t2 } = a$2.getWalletRouterData(), { isWeb: l$12 } = c.getCachedRouterWalletPlatforms(), i2 = a2 == null ? void 0 : a2.ios, s2 = t2 == null ? void 0 : t2.universal;
3976
+ return x`<wcm-modal-header title="${e2}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${o3}" imageId="${l(r2)}" label="Tap 'Open' to continue…" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer class="wcm-note"><wcm-platform-selection .isWeb="${l$12}" .isRetry="${true}"><wcm-button .onClick="${() => this.openMobileApp(false)}" .iconRight="${v.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection>${s2 ? x`<wcm-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${() => this.openMobileApp(true)}">Try this alternate link</span></wcm-text>` : null}</wcm-info-footer><wcm-info-footer class="wcm-app-store"><div><wcm-wallet-image walletId="${o3}" imageId="${l(r2)}"></wcm-wallet-image><wcm-text>${`Get ${e2}`}</wcm-text></div><wcm-button .iconRight="${v.ARROW_RIGHT_ICON}" .onClick="${() => this.onGoToAppStore(i2)}" variant="ghost">App Store</wcm-button></wcm-info-footer>`;
3977
+ }
3978
+ };
3979
+ he.styles = [h.globalCss, Go], Ye([t$1()], he.prototype, "isError", 2), he = Ye([e$2("wcm-mobile-connecting-view")], he);
3980
+ const er = i$3`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;
3981
+ var rr = (e2, o3, r2, a2) => {
3982
+ for (var t2 = o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = i2(t2) || t2);
3983
+ return t2;
3984
+ };
3985
+ let je = class extends s {
3986
+ render() {
3987
+ const { name: e2, id: o3, image_id: r2 } = a$2.getWalletRouterData(), { isDesktop: a2, isWeb: t2 } = c.getCachedRouterWalletPlatforms();
3988
+ return x`<wcm-modal-header title="${e2}" .onAction="${c.handleUriCopy}" .actionIcon="${v.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr walletId="${o3}" imageId="${l(r2)}"></wcm-walletconnect-qr></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${e2} app`}</wcm-text><wcm-platform-selection .isDesktop="${a2}" .isWeb="${t2}"></wcm-platform-selection></wcm-info-footer>`;
3989
+ }
3990
+ };
3991
+ je.styles = [h.globalCss, er], je = rr([e$2("wcm-mobile-qr-connecting-view")], je);
3992
+ var ir = (e2, o3, r2, a2) => {
3993
+ for (var t2 = o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = i2(t2) || t2);
3994
+ return t2;
3995
+ };
3996
+ let _e = class extends s {
3997
+ render() {
3998
+ return x`<wcm-modal-header title="Scan the code" .onAction="${c.handleUriCopy}" .actionIcon="${v.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>`;
3999
+ }
4000
+ };
4001
+ _e.styles = [h.globalCss], _e = ir([e$2("wcm-qrcode-view")], _e);
4002
+ const nr = i$3`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;
4003
+ var cr = Object.defineProperty, sr = Object.getOwnPropertyDescriptor, ie = (e2, o3, r2, a2) => {
4004
+ for (var t2 = a2 > 1 ? void 0 : a2 ? sr(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
4005
+ return a2 && t2 && cr(o3, r2, t2), t2;
4006
+ };
4007
+ const De = 40;
4008
+ let U = class extends s {
4009
+ constructor() {
4010
+ super(...arguments), this.loading = !te$1.state.wallets.listings.length, this.firstFetch = !te$1.state.wallets.listings.length, this.search = "", this.endReached = false, this.intersectionObserver = void 0, this.searchDebounce = c.debounce((e2) => {
4011
+ e2.length >= 1 ? (this.firstFetch = true, this.endReached = false, this.search = e2, te$1.resetSearch(), this.fetchWallets()) : this.search && (this.search = "", this.endReached = this.isLastPage(), te$1.resetSearch());
4012
+ });
4013
+ }
4014
+ firstUpdated() {
4015
+ this.createPaginationObserver();
4016
+ }
4017
+ disconnectedCallback() {
4018
+ var e2;
4019
+ (e2 = this.intersectionObserver) == null || e2.disconnect();
4020
+ }
4021
+ get placeholderEl() {
4022
+ return c.getShadowRootElement(this, ".wcm-placeholder-block");
4023
+ }
4024
+ createPaginationObserver() {
4025
+ this.intersectionObserver = new IntersectionObserver(([e2]) => {
4026
+ e2.isIntersecting && !(this.search && this.firstFetch) && this.fetchWallets();
4027
+ }), this.intersectionObserver.observe(this.placeholderEl);
4028
+ }
4029
+ isLastPage() {
4030
+ const { wallets: e2, search: o3 } = te$1.state, { listings: r2, total: a2 } = this.search ? o3 : e2;
4031
+ return a2 <= De || r2.length >= a2;
4032
+ }
4033
+ async fetchWallets() {
4034
+ var e2;
4035
+ const { wallets: o3, search: r2 } = te$1.state, { listings: a2, total: t2, page: l2 } = this.search ? r2 : o3;
4036
+ if (!this.endReached && (this.firstFetch || t2 > De && a2.length < t2)) try {
4037
+ this.loading = true;
4038
+ const i2 = (e2 = p$1.state.chains) == null ? void 0 : e2.join(","), { listings: s2 } = await te$1.getWallets({ page: this.firstFetch ? 1 : l2 + 1, entries: De, search: this.search, version: 2, chains: i2 }), $2 = s2.map((f2) => c.getWalletIcon(f2));
4039
+ await Promise.all([...$2.map(async (f2) => c.preloadImage(f2)), a$2.wait(300)]), this.endReached = this.isLastPage();
4040
+ } catch (i2) {
4041
+ console.error(i2), oe$1.openToast(c.getErrorMessage(i2), "error");
4042
+ } finally {
4043
+ this.loading = false, this.firstFetch = false;
4044
+ }
4045
+ }
4046
+ onConnect(e2) {
4047
+ a$2.isAndroid() ? c.handleMobileLinking(e2) : c.goToConnectingView(e2);
4048
+ }
4049
+ onSearchChange(e2) {
4050
+ const { value: o3 } = e2.target;
4051
+ this.searchDebounce(o3);
4052
+ }
4053
+ render() {
4054
+ const { wallets: e2, search: o$12 } = te$1.state, { listings: r2 } = this.search ? o$12 : e2, a2 = this.loading && !r2.length, t2 = this.search.length >= 3;
4055
+ let l2 = Z2.manualWalletsTemplate(), i2 = Z2.recomendedWalletsTemplate(true);
4056
+ t2 && (l2 = l2.filter(({ values: f2 }) => c.caseSafeIncludes(f2[0], this.search)), i2 = i2.filter(({ values: f2 }) => c.caseSafeIncludes(f2[0], this.search)));
4057
+ const s2 = !this.loading && !r2.length && !i2.length, $2 = { "wcm-loading": a2, "wcm-end-reached": this.endReached || !this.loading, "wcm-empty": s2 };
4058
+ return x`<wcm-modal-header><wcm-search-input .onChange="${this.onSearchChange.bind(this)}"></wcm-search-input></wcm-modal-header><wcm-modal-content class="${o2($2)}"><div class="wcm-grid">${a2 ? null : l2} ${a2 ? null : i2} ${a2 ? null : r2.map((f2) => x`${f2 ? x`<wcm-wallet-button imageId="${f2.image_id}" name="${f2.name}" walletId="${f2.id}" .onClick="${() => this.onConnect(f2)}"></wcm-wallet-button>` : null}`)}</div><div class="wcm-placeholder-block">${s2 ? x`<wcm-text variant="big-bold" color="secondary">No results found</wcm-text>` : null} ${!s2 && this.loading ? x`<wcm-spinner></wcm-spinner>` : null}</div></wcm-modal-content>`;
4059
+ }
4060
+ };
4061
+ U.styles = [h.globalCss, nr], ie([t$1()], U.prototype, "loading", 2), ie([t$1()], U.prototype, "firstFetch", 2), ie([t$1()], U.prototype, "search", 2), ie([t$1()], U.prototype, "endReached", 2), U = ie([e$2("wcm-wallet-explorer-view")], U);
4062
+ const dr = i$3`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;
4063
+ var mr = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, Ge = (e2, o3, r2, a2) => {
4064
+ for (var t2 = a2 > 1 ? void 0 : a2 ? hr(o3, r2) : o3, l2 = e2.length - 1, i2; l2 >= 0; l2--) (i2 = e2[l2]) && (t2 = (a2 ? i2(o3, r2, t2) : i2(t2)) || t2);
4065
+ return a2 && t2 && mr(o3, r2, t2), t2;
4066
+ };
4067
+ let we = class extends s {
4068
+ constructor() {
4069
+ super(), this.isError = false, this.openWebWallet();
4070
+ }
4071
+ onFormatAndRedirect(e2) {
4072
+ const { desktop: o3, name: r2 } = a$2.getWalletRouterData(), a2 = o3 == null ? void 0 : o3.universal;
4073
+ if (a2) {
4074
+ const t2 = a$2.formatUniversalUrl(a2, e2, r2);
4075
+ a$2.openHref(t2, "_blank");
4076
+ }
4077
+ }
4078
+ openWebWallet() {
4079
+ const { walletConnectUri: e2 } = p$1.state, o3 = a$2.getWalletRouterData();
4080
+ c.setRecentWallet(o3), e2 && this.onFormatAndRedirect(e2);
4081
+ }
4082
+ render() {
4083
+ const { name: e2, id: o3, image_id: r2 } = a$2.getWalletRouterData(), { isMobile: a2, isDesktop: t2 } = c.getCachedRouterWalletPlatforms(), l$12 = a$2.isMobile();
4084
+ return x`<wcm-modal-header title="${e2}" .onAction="${c.handleUriCopy}" .actionIcon="${v.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${o3}" imageId="${l(r2)}" label="${`Continue in ${e2}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`${e2} web app has opened in a new tab. Go there, accept the connection, and come back`}</wcm-text><wcm-platform-selection .isMobile="${a2}" .isDesktop="${l$12 ? false : t2}" .isRetry="${true}"><wcm-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${v.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`;
4085
+ }
4086
+ };
4087
+ we.styles = [h.globalCss, dr], Ge([t$1()], we.prototype, "isError", 2), we = Ge([e$2("wcm-web-connecting-view")], we);
4088
+ export {
4089
+ ae as WcmModal,
4090
+ j as WcmQrCode
4091
+ };
4092
+ //# sourceMappingURL=index-CisFDAGs.js.map