@feedmepos/mf-miniprogram-v2 0.2.10 → 0.2.11-dev.2

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.
Files changed (30) hide show
  1. package/dist/App-B0BXsVum.js +235 -0
  2. package/dist/{BrandFontPicker-BVfiQBLP.js → BrandFontPicker-D_MntcD2.js} +1 -1
  3. package/dist/{BrandKitView-BLH-bglF.js → BrandKitView-DHV0PUus.js} +2 -2
  4. package/dist/{ControlPlaneView-C3wvdkj9.js → ControlPlaneView-CPGMj9dc.js} +8269 -8167
  5. package/dist/{EcosystemView-BY2B_LEL.js → EcosystemView-Blo9u-dq.js} +5 -5
  6. package/dist/{LegacyWorkspaceEntry-DrL-C0xx.js → LegacyWorkspaceEntry-IRMa-8U4.js} +2 -2
  7. package/dist/{MobileProjectDialog-DsXmMUHH.js → MobileProjectDialog-QfVNJfyE.js} +2 -2
  8. package/dist/{MobileProjectsView-CMj0mnZh.js → MobileProjectsView-DVjw5R18.js} +4 -4
  9. package/dist/{ModuleCenterView-DG7ea0p5.js → ModuleCenterView-D_5TWuln.js} +1 -1
  10. package/dist/{ModuleDetailView-DweKadjB.js → ModuleDetailView-U8M_-5qs.js} +1 -1
  11. package/dist/{PagesView-W8d-G5HZ.js → PagesView-Bz5aN_A-.js} +1 -1
  12. package/dist/PortalSettingsView-C-5ahh8D.js +1847 -0
  13. package/dist/{TemplateCenterView-BH3C5h50.js → TemplateCenterView-Bd5haOtu.js} +2 -2
  14. package/dist/{WorkspaceEntryView-Dx8stquZ.js → WorkspaceEntryView-V-Tu9Iiy.js} +1 -1
  15. package/dist/app.js +11 -11
  16. package/dist/controlPlane-Bn-uDXG_.js +145 -0
  17. package/dist/index-DB33ug2V.js +125 -0
  18. package/dist/localPreference-CaizsY6G.js +972 -0
  19. package/dist/package.json +2 -1
  20. package/dist/{portalContext-CCW6O5KF.js → portalContext-FZ8_SePb.js} +2 -2
  21. package/dist/style.css +1 -1
  22. package/dist/useBrandKit-Dl8N-9UZ.js +1110 -0
  23. package/dist/{useModuleCatalog-C7kO_Rjg.js → useModuleCatalog-CNvI4aSK.js} +2 -2
  24. package/package.json +2 -1
  25. package/dist/App-DDgjAONU.js +0 -1129
  26. package/dist/PortalSettingsView-DFsXYy48.js +0 -123
  27. package/dist/controlPlane-CiuLVd7s.js +0 -145
  28. package/dist/index-BnE-gQP_.js +0 -81
  29. package/dist/localPreference-Cdti49bE.js +0 -62
  30. package/dist/useBrandKit-fmzepsFY.js +0 -1096
@@ -0,0 +1,1847 @@
1
+ import { defineComponent as Ut, computed as I, ref as F, watch as dt, onScopeDispose as Dt, resolveComponent as ot, openBlock as _, createElementBlock as k, createElementVNode as v, createVNode as G, withKeys as se, withCtx as ae, toDisplayString as H, unref as vt, normalizeClass as Ft, createCommentVNode as V, onMounted as le, Fragment as ft, renderList as ue, createBlock as ce } from "vue";
2
+ import { useRoute as de, useRouter as fe } from "vue-router";
3
+ import { useCoreStore as $t } from "@feedmepos/mf-common";
4
+ import { useDialog as ge, useSnackbar as he } from "@feedmepos/ui-library";
5
+ import { f as st, e as J, g as me, h as gt, j as pe } from "./index-DB33ug2V.js";
6
+ import { n as we, i as ye, h as ve, g as Ce, c as be, e as zt, j as Ee } from "./controlPlane-Bn-uDXG_.js";
7
+ import { u as Vt } from "./portalContext-FZ8_SePb.js";
8
+ import { a as Be } from "./routes-W8KfuhWL.js";
9
+ import { _ as Ht } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
+ import { l as Se } from "./portalNavigation-DLcC7Koh.js";
11
+ var Z = {}, Ae = function() {
12
+ return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
13
+ }, Ot = {}, M = {};
14
+ let St;
15
+ const Te = [
16
+ 0,
17
+ // Not used
18
+ 26,
19
+ 44,
20
+ 70,
21
+ 100,
22
+ 134,
23
+ 172,
24
+ 196,
25
+ 242,
26
+ 292,
27
+ 346,
28
+ 404,
29
+ 466,
30
+ 532,
31
+ 581,
32
+ 655,
33
+ 733,
34
+ 815,
35
+ 901,
36
+ 991,
37
+ 1085,
38
+ 1156,
39
+ 1258,
40
+ 1364,
41
+ 1474,
42
+ 1588,
43
+ 1706,
44
+ 1828,
45
+ 1921,
46
+ 2051,
47
+ 2185,
48
+ 2323,
49
+ 2465,
50
+ 2611,
51
+ 2761,
52
+ 2876,
53
+ 3034,
54
+ 3196,
55
+ 3362,
56
+ 3532,
57
+ 3706
58
+ ];
59
+ M.getSymbolSize = function(t) {
60
+ if (!t) throw new Error('"version" cannot be null or undefined');
61
+ if (t < 1 || t > 40) throw new Error('"version" should be in range from 1 to 40');
62
+ return t * 4 + 17;
63
+ };
64
+ M.getSymbolTotalCodewords = function(t) {
65
+ return Te[t];
66
+ };
67
+ M.getBCHDigit = function(e) {
68
+ let t = 0;
69
+ for (; e !== 0; )
70
+ t++, e >>>= 1;
71
+ return t;
72
+ };
73
+ M.setToSJISFunction = function(t) {
74
+ if (typeof t != "function")
75
+ throw new Error('"toSJISFunc" is not a valid function.');
76
+ St = t;
77
+ };
78
+ M.isKanjiModeEnabled = function() {
79
+ return typeof St < "u";
80
+ };
81
+ M.toSJIS = function(t) {
82
+ return St(t);
83
+ };
84
+ var at = {};
85
+ (function(e) {
86
+ e.L = { bit: 1 }, e.M = { bit: 0 }, e.Q = { bit: 3 }, e.H = { bit: 2 };
87
+ function t(i) {
88
+ if (typeof i != "string")
89
+ throw new Error("Param is not a string");
90
+ switch (i.toLowerCase()) {
91
+ case "l":
92
+ case "low":
93
+ return e.L;
94
+ case "m":
95
+ case "medium":
96
+ return e.M;
97
+ case "q":
98
+ case "quartile":
99
+ return e.Q;
100
+ case "h":
101
+ case "high":
102
+ return e.H;
103
+ default:
104
+ throw new Error("Unknown EC Level: " + i);
105
+ }
106
+ }
107
+ e.isValid = function(o) {
108
+ return o && typeof o.bit < "u" && o.bit >= 0 && o.bit < 4;
109
+ }, e.from = function(o, n) {
110
+ if (e.isValid(o))
111
+ return o;
112
+ try {
113
+ return t(o);
114
+ } catch {
115
+ return n;
116
+ }
117
+ };
118
+ })(at);
119
+ function Kt() {
120
+ this.buffer = [], this.length = 0;
121
+ }
122
+ Kt.prototype = {
123
+ get: function(e) {
124
+ const t = Math.floor(e / 8);
125
+ return (this.buffer[t] >>> 7 - e % 8 & 1) === 1;
126
+ },
127
+ put: function(e, t) {
128
+ for (let i = 0; i < t; i++)
129
+ this.putBit((e >>> t - i - 1 & 1) === 1);
130
+ },
131
+ getLengthInBits: function() {
132
+ return this.length;
133
+ },
134
+ putBit: function(e) {
135
+ const t = Math.floor(this.length / 8);
136
+ this.buffer.length <= t && this.buffer.push(0), e && (this.buffer[t] |= 128 >>> this.length % 8), this.length++;
137
+ }
138
+ };
139
+ var _e = Kt;
140
+ function X(e) {
141
+ if (!e || e < 1)
142
+ throw new Error("BitMatrix size must be defined and greater than 0");
143
+ this.size = e, this.data = new Uint8Array(e * e), this.reservedBit = new Uint8Array(e * e);
144
+ }
145
+ X.prototype.set = function(e, t, i, o) {
146
+ const n = e * this.size + t;
147
+ this.data[n] = i, o && (this.reservedBit[n] = !0);
148
+ };
149
+ X.prototype.get = function(e, t) {
150
+ return this.data[e * this.size + t];
151
+ };
152
+ X.prototype.xor = function(e, t, i) {
153
+ this.data[e * this.size + t] ^= i;
154
+ };
155
+ X.prototype.isReserved = function(e, t) {
156
+ return this.reservedBit[e * this.size + t];
157
+ };
158
+ var Ie = X, Jt = {};
159
+ (function(e) {
160
+ const t = M.getSymbolSize;
161
+ e.getRowColCoords = function(o) {
162
+ if (o === 1) return [];
163
+ const n = Math.floor(o / 7) + 2, r = t(o), s = r === 145 ? 26 : Math.ceil((r - 13) / (2 * n - 2)) * 2, l = [r - 7];
164
+ for (let a = 1; a < n - 1; a++)
165
+ l[a] = l[a - 1] - s;
166
+ return l.push(6), l.reverse();
167
+ }, e.getPositions = function(o) {
168
+ const n = [], r = e.getRowColCoords(o), s = r.length;
169
+ for (let l = 0; l < s; l++)
170
+ for (let a = 0; a < s; a++)
171
+ l === 0 && a === 0 || // top-left
172
+ l === 0 && a === s - 1 || // bottom-left
173
+ l === s - 1 && a === 0 || n.push([r[l], r[a]]);
174
+ return n;
175
+ };
176
+ })(Jt);
177
+ var jt = {};
178
+ const ke = M.getSymbolSize, Nt = 7;
179
+ jt.getPositions = function(t) {
180
+ const i = ke(t);
181
+ return [
182
+ // top-left
183
+ [0, 0],
184
+ // top-right
185
+ [i - Nt, 0],
186
+ // bottom-left
187
+ [0, i - Nt]
188
+ ];
189
+ };
190
+ var Yt = {};
191
+ (function(e) {
192
+ e.Patterns = {
193
+ PATTERN000: 0,
194
+ PATTERN001: 1,
195
+ PATTERN010: 2,
196
+ PATTERN011: 3,
197
+ PATTERN100: 4,
198
+ PATTERN101: 5,
199
+ PATTERN110: 6,
200
+ PATTERN111: 7
201
+ };
202
+ const t = {
203
+ N1: 3,
204
+ N2: 3,
205
+ N3: 40,
206
+ N4: 10
207
+ };
208
+ e.isValid = function(n) {
209
+ return n != null && n !== "" && !isNaN(n) && n >= 0 && n <= 7;
210
+ }, e.from = function(n) {
211
+ return e.isValid(n) ? parseInt(n, 10) : void 0;
212
+ }, e.getPenaltyN1 = function(n) {
213
+ const r = n.size;
214
+ let s = 0, l = 0, a = 0, c = null, d = null;
215
+ for (let E = 0; E < r; E++) {
216
+ l = a = 0, c = d = null;
217
+ for (let m = 0; m < r; m++) {
218
+ let h = n.get(E, m);
219
+ h === c ? l++ : (l >= 5 && (s += t.N1 + (l - 5)), c = h, l = 1), h = n.get(m, E), h === d ? a++ : (a >= 5 && (s += t.N1 + (a - 5)), d = h, a = 1);
220
+ }
221
+ l >= 5 && (s += t.N1 + (l - 5)), a >= 5 && (s += t.N1 + (a - 5));
222
+ }
223
+ return s;
224
+ }, e.getPenaltyN2 = function(n) {
225
+ const r = n.size;
226
+ let s = 0;
227
+ for (let l = 0; l < r - 1; l++)
228
+ for (let a = 0; a < r - 1; a++) {
229
+ const c = n.get(l, a) + n.get(l, a + 1) + n.get(l + 1, a) + n.get(l + 1, a + 1);
230
+ (c === 4 || c === 0) && s++;
231
+ }
232
+ return s * t.N2;
233
+ }, e.getPenaltyN3 = function(n) {
234
+ const r = n.size;
235
+ let s = 0, l = 0, a = 0;
236
+ for (let c = 0; c < r; c++) {
237
+ l = a = 0;
238
+ for (let d = 0; d < r; d++)
239
+ l = l << 1 & 2047 | n.get(c, d), d >= 10 && (l === 1488 || l === 93) && s++, a = a << 1 & 2047 | n.get(d, c), d >= 10 && (a === 1488 || a === 93) && s++;
240
+ }
241
+ return s * t.N3;
242
+ }, e.getPenaltyN4 = function(n) {
243
+ let r = 0;
244
+ const s = n.data.length;
245
+ for (let a = 0; a < s; a++) r += n.data[a];
246
+ return Math.abs(Math.ceil(r * 100 / s / 5) - 10) * t.N4;
247
+ };
248
+ function i(o, n, r) {
249
+ switch (o) {
250
+ case e.Patterns.PATTERN000:
251
+ return (n + r) % 2 === 0;
252
+ case e.Patterns.PATTERN001:
253
+ return n % 2 === 0;
254
+ case e.Patterns.PATTERN010:
255
+ return r % 3 === 0;
256
+ case e.Patterns.PATTERN011:
257
+ return (n + r) % 3 === 0;
258
+ case e.Patterns.PATTERN100:
259
+ return (Math.floor(n / 2) + Math.floor(r / 3)) % 2 === 0;
260
+ case e.Patterns.PATTERN101:
261
+ return n * r % 2 + n * r % 3 === 0;
262
+ case e.Patterns.PATTERN110:
263
+ return (n * r % 2 + n * r % 3) % 2 === 0;
264
+ case e.Patterns.PATTERN111:
265
+ return (n * r % 3 + (n + r) % 2) % 2 === 0;
266
+ default:
267
+ throw new Error("bad maskPattern:" + o);
268
+ }
269
+ }
270
+ e.applyMask = function(n, r) {
271
+ const s = r.size;
272
+ for (let l = 0; l < s; l++)
273
+ for (let a = 0; a < s; a++)
274
+ r.isReserved(a, l) || r.xor(a, l, i(n, a, l));
275
+ }, e.getBestMask = function(n, r) {
276
+ const s = Object.keys(e.Patterns).length;
277
+ let l = 0, a = 1 / 0;
278
+ for (let c = 0; c < s; c++) {
279
+ r(c), e.applyMask(c, n);
280
+ const d = e.getPenaltyN1(n) + e.getPenaltyN2(n) + e.getPenaltyN3(n) + e.getPenaltyN4(n);
281
+ e.applyMask(c, n), d < a && (a = d, l = c);
282
+ }
283
+ return l;
284
+ };
285
+ })(Yt);
286
+ var lt = {};
287
+ const O = at, et = [
288
+ // L M Q H
289
+ 1,
290
+ 1,
291
+ 1,
292
+ 1,
293
+ 1,
294
+ 1,
295
+ 1,
296
+ 1,
297
+ 1,
298
+ 1,
299
+ 2,
300
+ 2,
301
+ 1,
302
+ 2,
303
+ 2,
304
+ 4,
305
+ 1,
306
+ 2,
307
+ 4,
308
+ 4,
309
+ 2,
310
+ 4,
311
+ 4,
312
+ 4,
313
+ 2,
314
+ 4,
315
+ 6,
316
+ 5,
317
+ 2,
318
+ 4,
319
+ 6,
320
+ 6,
321
+ 2,
322
+ 5,
323
+ 8,
324
+ 8,
325
+ 4,
326
+ 5,
327
+ 8,
328
+ 8,
329
+ 4,
330
+ 5,
331
+ 8,
332
+ 11,
333
+ 4,
334
+ 8,
335
+ 10,
336
+ 11,
337
+ 4,
338
+ 9,
339
+ 12,
340
+ 16,
341
+ 4,
342
+ 9,
343
+ 16,
344
+ 16,
345
+ 6,
346
+ 10,
347
+ 12,
348
+ 18,
349
+ 6,
350
+ 10,
351
+ 17,
352
+ 16,
353
+ 6,
354
+ 11,
355
+ 16,
356
+ 19,
357
+ 6,
358
+ 13,
359
+ 18,
360
+ 21,
361
+ 7,
362
+ 14,
363
+ 21,
364
+ 25,
365
+ 8,
366
+ 16,
367
+ 20,
368
+ 25,
369
+ 8,
370
+ 17,
371
+ 23,
372
+ 25,
373
+ 9,
374
+ 17,
375
+ 23,
376
+ 34,
377
+ 9,
378
+ 18,
379
+ 25,
380
+ 30,
381
+ 10,
382
+ 20,
383
+ 27,
384
+ 32,
385
+ 12,
386
+ 21,
387
+ 29,
388
+ 35,
389
+ 12,
390
+ 23,
391
+ 34,
392
+ 37,
393
+ 12,
394
+ 25,
395
+ 34,
396
+ 40,
397
+ 13,
398
+ 26,
399
+ 35,
400
+ 42,
401
+ 14,
402
+ 28,
403
+ 38,
404
+ 45,
405
+ 15,
406
+ 29,
407
+ 40,
408
+ 48,
409
+ 16,
410
+ 31,
411
+ 43,
412
+ 51,
413
+ 17,
414
+ 33,
415
+ 45,
416
+ 54,
417
+ 18,
418
+ 35,
419
+ 48,
420
+ 57,
421
+ 19,
422
+ 37,
423
+ 51,
424
+ 60,
425
+ 19,
426
+ 38,
427
+ 53,
428
+ 63,
429
+ 20,
430
+ 40,
431
+ 56,
432
+ 66,
433
+ 21,
434
+ 43,
435
+ 59,
436
+ 70,
437
+ 22,
438
+ 45,
439
+ 62,
440
+ 74,
441
+ 24,
442
+ 47,
443
+ 65,
444
+ 77,
445
+ 25,
446
+ 49,
447
+ 68,
448
+ 81
449
+ ], nt = [
450
+ // L M Q H
451
+ 7,
452
+ 10,
453
+ 13,
454
+ 17,
455
+ 10,
456
+ 16,
457
+ 22,
458
+ 28,
459
+ 15,
460
+ 26,
461
+ 36,
462
+ 44,
463
+ 20,
464
+ 36,
465
+ 52,
466
+ 64,
467
+ 26,
468
+ 48,
469
+ 72,
470
+ 88,
471
+ 36,
472
+ 64,
473
+ 96,
474
+ 112,
475
+ 40,
476
+ 72,
477
+ 108,
478
+ 130,
479
+ 48,
480
+ 88,
481
+ 132,
482
+ 156,
483
+ 60,
484
+ 110,
485
+ 160,
486
+ 192,
487
+ 72,
488
+ 130,
489
+ 192,
490
+ 224,
491
+ 80,
492
+ 150,
493
+ 224,
494
+ 264,
495
+ 96,
496
+ 176,
497
+ 260,
498
+ 308,
499
+ 104,
500
+ 198,
501
+ 288,
502
+ 352,
503
+ 120,
504
+ 216,
505
+ 320,
506
+ 384,
507
+ 132,
508
+ 240,
509
+ 360,
510
+ 432,
511
+ 144,
512
+ 280,
513
+ 408,
514
+ 480,
515
+ 168,
516
+ 308,
517
+ 448,
518
+ 532,
519
+ 180,
520
+ 338,
521
+ 504,
522
+ 588,
523
+ 196,
524
+ 364,
525
+ 546,
526
+ 650,
527
+ 224,
528
+ 416,
529
+ 600,
530
+ 700,
531
+ 224,
532
+ 442,
533
+ 644,
534
+ 750,
535
+ 252,
536
+ 476,
537
+ 690,
538
+ 816,
539
+ 270,
540
+ 504,
541
+ 750,
542
+ 900,
543
+ 300,
544
+ 560,
545
+ 810,
546
+ 960,
547
+ 312,
548
+ 588,
549
+ 870,
550
+ 1050,
551
+ 336,
552
+ 644,
553
+ 952,
554
+ 1110,
555
+ 360,
556
+ 700,
557
+ 1020,
558
+ 1200,
559
+ 390,
560
+ 728,
561
+ 1050,
562
+ 1260,
563
+ 420,
564
+ 784,
565
+ 1140,
566
+ 1350,
567
+ 450,
568
+ 812,
569
+ 1200,
570
+ 1440,
571
+ 480,
572
+ 868,
573
+ 1290,
574
+ 1530,
575
+ 510,
576
+ 924,
577
+ 1350,
578
+ 1620,
579
+ 540,
580
+ 980,
581
+ 1440,
582
+ 1710,
583
+ 570,
584
+ 1036,
585
+ 1530,
586
+ 1800,
587
+ 570,
588
+ 1064,
589
+ 1590,
590
+ 1890,
591
+ 600,
592
+ 1120,
593
+ 1680,
594
+ 1980,
595
+ 630,
596
+ 1204,
597
+ 1770,
598
+ 2100,
599
+ 660,
600
+ 1260,
601
+ 1860,
602
+ 2220,
603
+ 720,
604
+ 1316,
605
+ 1950,
606
+ 2310,
607
+ 750,
608
+ 1372,
609
+ 2040,
610
+ 2430
611
+ ];
612
+ lt.getBlocksCount = function(t, i) {
613
+ switch (i) {
614
+ case O.L:
615
+ return et[(t - 1) * 4 + 0];
616
+ case O.M:
617
+ return et[(t - 1) * 4 + 1];
618
+ case O.Q:
619
+ return et[(t - 1) * 4 + 2];
620
+ case O.H:
621
+ return et[(t - 1) * 4 + 3];
622
+ default:
623
+ return;
624
+ }
625
+ };
626
+ lt.getTotalCodewordsCount = function(t, i) {
627
+ switch (i) {
628
+ case O.L:
629
+ return nt[(t - 1) * 4 + 0];
630
+ case O.M:
631
+ return nt[(t - 1) * 4 + 1];
632
+ case O.Q:
633
+ return nt[(t - 1) * 4 + 2];
634
+ case O.H:
635
+ return nt[(t - 1) * 4 + 3];
636
+ default:
637
+ return;
638
+ }
639
+ };
640
+ var qt = {}, ut = {};
641
+ const x = new Uint8Array(512), rt = new Uint8Array(256);
642
+ (function() {
643
+ let t = 1;
644
+ for (let i = 0; i < 255; i++)
645
+ x[i] = t, rt[t] = i, t <<= 1, t & 256 && (t ^= 285);
646
+ for (let i = 255; i < 512; i++)
647
+ x[i] = x[i - 255];
648
+ })();
649
+ ut.log = function(t) {
650
+ if (t < 1) throw new Error("log(" + t + ")");
651
+ return rt[t];
652
+ };
653
+ ut.exp = function(t) {
654
+ return x[t];
655
+ };
656
+ ut.mul = function(t, i) {
657
+ return t === 0 || i === 0 ? 0 : x[rt[t] + rt[i]];
658
+ };
659
+ (function(e) {
660
+ const t = ut;
661
+ e.mul = function(o, n) {
662
+ const r = new Uint8Array(o.length + n.length - 1);
663
+ for (let s = 0; s < o.length; s++)
664
+ for (let l = 0; l < n.length; l++)
665
+ r[s + l] ^= t.mul(o[s], n[l]);
666
+ return r;
667
+ }, e.mod = function(o, n) {
668
+ let r = new Uint8Array(o);
669
+ for (; r.length - n.length >= 0; ) {
670
+ const s = r[0];
671
+ for (let a = 0; a < n.length; a++)
672
+ r[a] ^= t.mul(n[a], s);
673
+ let l = 0;
674
+ for (; l < r.length && r[l] === 0; ) l++;
675
+ r = r.slice(l);
676
+ }
677
+ return r;
678
+ }, e.generateECPolynomial = function(o) {
679
+ let n = new Uint8Array([1]);
680
+ for (let r = 0; r < o; r++)
681
+ n = e.mul(n, new Uint8Array([1, t.exp(r)]));
682
+ return n;
683
+ };
684
+ })(qt);
685
+ const Qt = qt;
686
+ function At(e) {
687
+ this.genPoly = void 0, this.degree = e, this.degree && this.initialize(this.degree);
688
+ }
689
+ At.prototype.initialize = function(t) {
690
+ this.degree = t, this.genPoly = Qt.generateECPolynomial(this.degree);
691
+ };
692
+ At.prototype.encode = function(t) {
693
+ if (!this.genPoly)
694
+ throw new Error("Encoder not initialized");
695
+ const i = new Uint8Array(t.length + this.degree);
696
+ i.set(t);
697
+ const o = Qt.mod(i, this.genPoly), n = this.degree - o.length;
698
+ if (n > 0) {
699
+ const r = new Uint8Array(this.degree);
700
+ return r.set(o, n), r;
701
+ }
702
+ return o;
703
+ };
704
+ var Ne = At, Gt = {}, K = {}, Tt = {};
705
+ Tt.isValid = function(t) {
706
+ return !isNaN(t) && t >= 1 && t <= 40;
707
+ };
708
+ var D = {};
709
+ const xt = "[0-9]+", Pe = "[A-Z $%*+\\-./:]+";
710
+ let W = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
711
+ W = W.replace(/u/g, "\\u");
712
+ const Me = "(?:(?![A-Z0-9 $%*+\\-./:]|" + W + `)(?:.|[\r
713
+ ]))+`;
714
+ D.KANJI = new RegExp(W, "g");
715
+ D.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
716
+ D.BYTE = new RegExp(Me, "g");
717
+ D.NUMERIC = new RegExp(xt, "g");
718
+ D.ALPHANUMERIC = new RegExp(Pe, "g");
719
+ const Re = new RegExp("^" + W + "$"), Le = new RegExp("^" + xt + "$"), Ue = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
720
+ D.testKanji = function(t) {
721
+ return Re.test(t);
722
+ };
723
+ D.testNumeric = function(t) {
724
+ return Le.test(t);
725
+ };
726
+ D.testAlphanumeric = function(t) {
727
+ return Ue.test(t);
728
+ };
729
+ (function(e) {
730
+ const t = Tt, i = D;
731
+ e.NUMERIC = {
732
+ id: "Numeric",
733
+ bit: 1,
734
+ ccBits: [10, 12, 14]
735
+ }, e.ALPHANUMERIC = {
736
+ id: "Alphanumeric",
737
+ bit: 2,
738
+ ccBits: [9, 11, 13]
739
+ }, e.BYTE = {
740
+ id: "Byte",
741
+ bit: 4,
742
+ ccBits: [8, 16, 16]
743
+ }, e.KANJI = {
744
+ id: "Kanji",
745
+ bit: 8,
746
+ ccBits: [8, 10, 12]
747
+ }, e.MIXED = {
748
+ bit: -1
749
+ }, e.getCharCountIndicator = function(r, s) {
750
+ if (!r.ccBits) throw new Error("Invalid mode: " + r);
751
+ if (!t.isValid(s))
752
+ throw new Error("Invalid version: " + s);
753
+ return s >= 1 && s < 10 ? r.ccBits[0] : s < 27 ? r.ccBits[1] : r.ccBits[2];
754
+ }, e.getBestModeForData = function(r) {
755
+ return i.testNumeric(r) ? e.NUMERIC : i.testAlphanumeric(r) ? e.ALPHANUMERIC : i.testKanji(r) ? e.KANJI : e.BYTE;
756
+ }, e.toString = function(r) {
757
+ if (r && r.id) return r.id;
758
+ throw new Error("Invalid mode");
759
+ }, e.isValid = function(r) {
760
+ return r && r.bit && r.ccBits;
761
+ };
762
+ function o(n) {
763
+ if (typeof n != "string")
764
+ throw new Error("Param is not a string");
765
+ switch (n.toLowerCase()) {
766
+ case "numeric":
767
+ return e.NUMERIC;
768
+ case "alphanumeric":
769
+ return e.ALPHANUMERIC;
770
+ case "kanji":
771
+ return e.KANJI;
772
+ case "byte":
773
+ return e.BYTE;
774
+ default:
775
+ throw new Error("Unknown mode: " + n);
776
+ }
777
+ }
778
+ e.from = function(r, s) {
779
+ if (e.isValid(r))
780
+ return r;
781
+ try {
782
+ return o(r);
783
+ } catch {
784
+ return s;
785
+ }
786
+ };
787
+ })(K);
788
+ (function(e) {
789
+ const t = M, i = lt, o = at, n = K, r = Tt, s = 7973, l = t.getBCHDigit(s);
790
+ function a(m, h, C) {
791
+ for (let w = 1; w <= 40; w++)
792
+ if (h <= e.getCapacity(w, C, m))
793
+ return w;
794
+ }
795
+ function c(m, h) {
796
+ return n.getCharCountIndicator(m, h) + 4;
797
+ }
798
+ function d(m, h) {
799
+ let C = 0;
800
+ return m.forEach(function(w) {
801
+ const A = c(w.mode, h);
802
+ C += A + w.getBitsLength();
803
+ }), C;
804
+ }
805
+ function E(m, h) {
806
+ for (let C = 1; C <= 40; C++)
807
+ if (d(m, C) <= e.getCapacity(C, h, n.MIXED))
808
+ return C;
809
+ }
810
+ e.from = function(h, C) {
811
+ return r.isValid(h) ? parseInt(h, 10) : C;
812
+ }, e.getCapacity = function(h, C, w) {
813
+ if (!r.isValid(h))
814
+ throw new Error("Invalid QR Code version");
815
+ typeof w > "u" && (w = n.BYTE);
816
+ const A = t.getSymbolTotalCodewords(h), f = i.getTotalCodewordsCount(h, C), u = (A - f) * 8;
817
+ if (w === n.MIXED) return u;
818
+ const p = u - c(w, h);
819
+ switch (w) {
820
+ case n.NUMERIC:
821
+ return Math.floor(p / 10 * 3);
822
+ case n.ALPHANUMERIC:
823
+ return Math.floor(p / 11 * 2);
824
+ case n.KANJI:
825
+ return Math.floor(p / 13);
826
+ case n.BYTE:
827
+ default:
828
+ return Math.floor(p / 8);
829
+ }
830
+ }, e.getBestVersionForData = function(h, C) {
831
+ let w;
832
+ const A = o.from(C, o.M);
833
+ if (Array.isArray(h)) {
834
+ if (h.length > 1)
835
+ return E(h, A);
836
+ if (h.length === 0)
837
+ return 1;
838
+ w = h[0];
839
+ } else
840
+ w = h;
841
+ return a(w.mode, w.getLength(), A);
842
+ }, e.getEncodedBits = function(h) {
843
+ if (!r.isValid(h) || h < 7)
844
+ throw new Error("Invalid QR Code version");
845
+ let C = h << 12;
846
+ for (; t.getBCHDigit(C) - l >= 0; )
847
+ C ^= s << t.getBCHDigit(C) - l;
848
+ return h << 12 | C;
849
+ };
850
+ })(Gt);
851
+ var Wt = {};
852
+ const Ct = M, Zt = 1335, De = 21522, Pt = Ct.getBCHDigit(Zt);
853
+ Wt.getEncodedBits = function(t, i) {
854
+ const o = t.bit << 3 | i;
855
+ let n = o << 10;
856
+ for (; Ct.getBCHDigit(n) - Pt >= 0; )
857
+ n ^= Zt << Ct.getBCHDigit(n) - Pt;
858
+ return (o << 10 | n) ^ De;
859
+ };
860
+ var Xt = {};
861
+ const Fe = K;
862
+ function j(e) {
863
+ this.mode = Fe.NUMERIC, this.data = e.toString();
864
+ }
865
+ j.getBitsLength = function(t) {
866
+ return 10 * Math.floor(t / 3) + (t % 3 ? t % 3 * 3 + 1 : 0);
867
+ };
868
+ j.prototype.getLength = function() {
869
+ return this.data.length;
870
+ };
871
+ j.prototype.getBitsLength = function() {
872
+ return j.getBitsLength(this.data.length);
873
+ };
874
+ j.prototype.write = function(t) {
875
+ let i, o, n;
876
+ for (i = 0; i + 3 <= this.data.length; i += 3)
877
+ o = this.data.substr(i, 3), n = parseInt(o, 10), t.put(n, 10);
878
+ const r = this.data.length - i;
879
+ r > 0 && (o = this.data.substr(i), n = parseInt(o, 10), t.put(n, r * 3 + 1));
880
+ };
881
+ var $e = j;
882
+ const ze = K, ht = [
883
+ "0",
884
+ "1",
885
+ "2",
886
+ "3",
887
+ "4",
888
+ "5",
889
+ "6",
890
+ "7",
891
+ "8",
892
+ "9",
893
+ "A",
894
+ "B",
895
+ "C",
896
+ "D",
897
+ "E",
898
+ "F",
899
+ "G",
900
+ "H",
901
+ "I",
902
+ "J",
903
+ "K",
904
+ "L",
905
+ "M",
906
+ "N",
907
+ "O",
908
+ "P",
909
+ "Q",
910
+ "R",
911
+ "S",
912
+ "T",
913
+ "U",
914
+ "V",
915
+ "W",
916
+ "X",
917
+ "Y",
918
+ "Z",
919
+ " ",
920
+ "$",
921
+ "%",
922
+ "*",
923
+ "+",
924
+ "-",
925
+ ".",
926
+ "/",
927
+ ":"
928
+ ];
929
+ function Y(e) {
930
+ this.mode = ze.ALPHANUMERIC, this.data = e;
931
+ }
932
+ Y.getBitsLength = function(t) {
933
+ return 11 * Math.floor(t / 2) + 6 * (t % 2);
934
+ };
935
+ Y.prototype.getLength = function() {
936
+ return this.data.length;
937
+ };
938
+ Y.prototype.getBitsLength = function() {
939
+ return Y.getBitsLength(this.data.length);
940
+ };
941
+ Y.prototype.write = function(t) {
942
+ let i;
943
+ for (i = 0; i + 2 <= this.data.length; i += 2) {
944
+ let o = ht.indexOf(this.data[i]) * 45;
945
+ o += ht.indexOf(this.data[i + 1]), t.put(o, 11);
946
+ }
947
+ this.data.length % 2 && t.put(ht.indexOf(this.data[i]), 6);
948
+ };
949
+ var Ve = Y;
950
+ const He = K;
951
+ function q(e) {
952
+ this.mode = He.BYTE, typeof e == "string" ? this.data = new TextEncoder().encode(e) : this.data = new Uint8Array(e);
953
+ }
954
+ q.getBitsLength = function(t) {
955
+ return t * 8;
956
+ };
957
+ q.prototype.getLength = function() {
958
+ return this.data.length;
959
+ };
960
+ q.prototype.getBitsLength = function() {
961
+ return q.getBitsLength(this.data.length);
962
+ };
963
+ q.prototype.write = function(e) {
964
+ for (let t = 0, i = this.data.length; t < i; t++)
965
+ e.put(this.data[t], 8);
966
+ };
967
+ var Oe = q;
968
+ const Ke = K, Je = M;
969
+ function Q(e) {
970
+ this.mode = Ke.KANJI, this.data = e;
971
+ }
972
+ Q.getBitsLength = function(t) {
973
+ return t * 13;
974
+ };
975
+ Q.prototype.getLength = function() {
976
+ return this.data.length;
977
+ };
978
+ Q.prototype.getBitsLength = function() {
979
+ return Q.getBitsLength(this.data.length);
980
+ };
981
+ Q.prototype.write = function(e) {
982
+ let t;
983
+ for (t = 0; t < this.data.length; t++) {
984
+ let i = Je.toSJIS(this.data[t]);
985
+ if (i >= 33088 && i <= 40956)
986
+ i -= 33088;
987
+ else if (i >= 57408 && i <= 60351)
988
+ i -= 49472;
989
+ else
990
+ throw new Error(
991
+ "Invalid SJIS character: " + this.data[t] + `
992
+ Make sure your charset is UTF-8`
993
+ );
994
+ i = (i >>> 8 & 255) * 192 + (i & 255), e.put(i, 13);
995
+ }
996
+ };
997
+ var je = Q, te = { exports: {} };
998
+ (function(e) {
999
+ var t = {
1000
+ single_source_shortest_paths: function(i, o, n) {
1001
+ var r = {}, s = {};
1002
+ s[o] = 0;
1003
+ var l = t.PriorityQueue.make();
1004
+ l.push(o, 0);
1005
+ for (var a, c, d, E, m, h, C, w, A; !l.empty(); ) {
1006
+ a = l.pop(), c = a.value, E = a.cost, m = i[c] || {};
1007
+ for (d in m)
1008
+ m.hasOwnProperty(d) && (h = m[d], C = E + h, w = s[d], A = typeof s[d] > "u", (A || w > C) && (s[d] = C, l.push(d, C), r[d] = c));
1009
+ }
1010
+ if (typeof n < "u" && typeof s[n] > "u") {
1011
+ var f = ["Could not find a path from ", o, " to ", n, "."].join("");
1012
+ throw new Error(f);
1013
+ }
1014
+ return r;
1015
+ },
1016
+ extract_shortest_path_from_predecessor_list: function(i, o) {
1017
+ for (var n = [], r = o; r; )
1018
+ n.push(r), i[r], r = i[r];
1019
+ return n.reverse(), n;
1020
+ },
1021
+ find_path: function(i, o, n) {
1022
+ var r = t.single_source_shortest_paths(i, o, n);
1023
+ return t.extract_shortest_path_from_predecessor_list(
1024
+ r,
1025
+ n
1026
+ );
1027
+ },
1028
+ /**
1029
+ * A very naive priority queue implementation.
1030
+ */
1031
+ PriorityQueue: {
1032
+ make: function(i) {
1033
+ var o = t.PriorityQueue, n = {}, r;
1034
+ i = i || {};
1035
+ for (r in o)
1036
+ o.hasOwnProperty(r) && (n[r] = o[r]);
1037
+ return n.queue = [], n.sorter = i.sorter || o.default_sorter, n;
1038
+ },
1039
+ default_sorter: function(i, o) {
1040
+ return i.cost - o.cost;
1041
+ },
1042
+ /**
1043
+ * Add a new item to the queue and ensure the highest priority element
1044
+ * is at the front of the queue.
1045
+ */
1046
+ push: function(i, o) {
1047
+ var n = { value: i, cost: o };
1048
+ this.queue.push(n), this.queue.sort(this.sorter);
1049
+ },
1050
+ /**
1051
+ * Return the highest priority element in the queue.
1052
+ */
1053
+ pop: function() {
1054
+ return this.queue.shift();
1055
+ },
1056
+ empty: function() {
1057
+ return this.queue.length === 0;
1058
+ }
1059
+ }
1060
+ };
1061
+ e.exports = t;
1062
+ })(te);
1063
+ var Ye = te.exports;
1064
+ (function(e) {
1065
+ const t = K, i = $e, o = Ve, n = Oe, r = je, s = D, l = M, a = Ye;
1066
+ function c(f) {
1067
+ return unescape(encodeURIComponent(f)).length;
1068
+ }
1069
+ function d(f, u, p) {
1070
+ const g = [];
1071
+ let B;
1072
+ for (; (B = f.exec(p)) !== null; )
1073
+ g.push({
1074
+ data: B[0],
1075
+ index: B.index,
1076
+ mode: u,
1077
+ length: B[0].length
1078
+ });
1079
+ return g;
1080
+ }
1081
+ function E(f) {
1082
+ const u = d(s.NUMERIC, t.NUMERIC, f), p = d(s.ALPHANUMERIC, t.ALPHANUMERIC, f);
1083
+ let g, B;
1084
+ return l.isKanjiModeEnabled() ? (g = d(s.BYTE, t.BYTE, f), B = d(s.KANJI, t.KANJI, f)) : (g = d(s.BYTE_KANJI, t.BYTE, f), B = []), u.concat(p, g, B).sort(function(T, N) {
1085
+ return T.index - N.index;
1086
+ }).map(function(T) {
1087
+ return {
1088
+ data: T.data,
1089
+ mode: T.mode,
1090
+ length: T.length
1091
+ };
1092
+ });
1093
+ }
1094
+ function m(f, u) {
1095
+ switch (u) {
1096
+ case t.NUMERIC:
1097
+ return i.getBitsLength(f);
1098
+ case t.ALPHANUMERIC:
1099
+ return o.getBitsLength(f);
1100
+ case t.KANJI:
1101
+ return r.getBitsLength(f);
1102
+ case t.BYTE:
1103
+ return n.getBitsLength(f);
1104
+ }
1105
+ }
1106
+ function h(f) {
1107
+ return f.reduce(function(u, p) {
1108
+ const g = u.length - 1 >= 0 ? u[u.length - 1] : null;
1109
+ return g && g.mode === p.mode ? (u[u.length - 1].data += p.data, u) : (u.push(p), u);
1110
+ }, []);
1111
+ }
1112
+ function C(f) {
1113
+ const u = [];
1114
+ for (let p = 0; p < f.length; p++) {
1115
+ const g = f[p];
1116
+ switch (g.mode) {
1117
+ case t.NUMERIC:
1118
+ u.push([
1119
+ g,
1120
+ { data: g.data, mode: t.ALPHANUMERIC, length: g.length },
1121
+ { data: g.data, mode: t.BYTE, length: g.length }
1122
+ ]);
1123
+ break;
1124
+ case t.ALPHANUMERIC:
1125
+ u.push([
1126
+ g,
1127
+ { data: g.data, mode: t.BYTE, length: g.length }
1128
+ ]);
1129
+ break;
1130
+ case t.KANJI:
1131
+ u.push([
1132
+ g,
1133
+ { data: g.data, mode: t.BYTE, length: c(g.data) }
1134
+ ]);
1135
+ break;
1136
+ case t.BYTE:
1137
+ u.push([
1138
+ { data: g.data, mode: t.BYTE, length: c(g.data) }
1139
+ ]);
1140
+ }
1141
+ }
1142
+ return u;
1143
+ }
1144
+ function w(f, u) {
1145
+ const p = {}, g = { start: {} };
1146
+ let B = ["start"];
1147
+ for (let S = 0; S < f.length; S++) {
1148
+ const T = f[S], N = [];
1149
+ for (let R = 0; R < T.length; R++) {
1150
+ const P = T[R], $ = "" + S + R;
1151
+ N.push($), p[$] = { node: P, lastCount: 0 }, g[$] = {};
1152
+ for (let y = 0; y < B.length; y++) {
1153
+ const b = B[y];
1154
+ p[b] && p[b].node.mode === P.mode ? (g[b][$] = m(p[b].lastCount + P.length, P.mode) - m(p[b].lastCount, P.mode), p[b].lastCount += P.length) : (p[b] && (p[b].lastCount = P.length), g[b][$] = m(P.length, P.mode) + 4 + t.getCharCountIndicator(P.mode, u));
1155
+ }
1156
+ }
1157
+ B = N;
1158
+ }
1159
+ for (let S = 0; S < B.length; S++)
1160
+ g[B[S]].end = 0;
1161
+ return { map: g, table: p };
1162
+ }
1163
+ function A(f, u) {
1164
+ let p;
1165
+ const g = t.getBestModeForData(f);
1166
+ if (p = t.from(u, g), p !== t.BYTE && p.bit < g.bit)
1167
+ throw new Error('"' + f + '" cannot be encoded with mode ' + t.toString(p) + `.
1168
+ Suggested mode is: ` + t.toString(g));
1169
+ switch (p === t.KANJI && !l.isKanjiModeEnabled() && (p = t.BYTE), p) {
1170
+ case t.NUMERIC:
1171
+ return new i(f);
1172
+ case t.ALPHANUMERIC:
1173
+ return new o(f);
1174
+ case t.KANJI:
1175
+ return new r(f);
1176
+ case t.BYTE:
1177
+ return new n(f);
1178
+ }
1179
+ }
1180
+ e.fromArray = function(u) {
1181
+ return u.reduce(function(p, g) {
1182
+ return typeof g == "string" ? p.push(A(g, null)) : g.data && p.push(A(g.data, g.mode)), p;
1183
+ }, []);
1184
+ }, e.fromString = function(u, p) {
1185
+ const g = E(u, l.isKanjiModeEnabled()), B = C(g), S = w(B, p), T = a.find_path(S.map, "start", "end"), N = [];
1186
+ for (let R = 1; R < T.length - 1; R++)
1187
+ N.push(S.table[T[R]].node);
1188
+ return e.fromArray(h(N));
1189
+ }, e.rawSplit = function(u) {
1190
+ return e.fromArray(
1191
+ E(u, l.isKanjiModeEnabled())
1192
+ );
1193
+ };
1194
+ })(Xt);
1195
+ const ct = M, mt = at, qe = _e, Qe = Ie, Ge = Jt, xe = jt, bt = Yt, Et = lt, We = Ne, it = Gt, Ze = Wt, Xe = K, pt = Xt;
1196
+ function tn(e, t) {
1197
+ const i = e.size, o = xe.getPositions(t);
1198
+ for (let n = 0; n < o.length; n++) {
1199
+ const r = o[n][0], s = o[n][1];
1200
+ for (let l = -1; l <= 7; l++)
1201
+ if (!(r + l <= -1 || i <= r + l))
1202
+ for (let a = -1; a <= 7; a++)
1203
+ s + a <= -1 || i <= s + a || (l >= 0 && l <= 6 && (a === 0 || a === 6) || a >= 0 && a <= 6 && (l === 0 || l === 6) || l >= 2 && l <= 4 && a >= 2 && a <= 4 ? e.set(r + l, s + a, !0, !0) : e.set(r + l, s + a, !1, !0));
1204
+ }
1205
+ }
1206
+ function en(e) {
1207
+ const t = e.size;
1208
+ for (let i = 8; i < t - 8; i++) {
1209
+ const o = i % 2 === 0;
1210
+ e.set(i, 6, o, !0), e.set(6, i, o, !0);
1211
+ }
1212
+ }
1213
+ function nn(e, t) {
1214
+ const i = Ge.getPositions(t);
1215
+ for (let o = 0; o < i.length; o++) {
1216
+ const n = i[o][0], r = i[o][1];
1217
+ for (let s = -2; s <= 2; s++)
1218
+ for (let l = -2; l <= 2; l++)
1219
+ s === -2 || s === 2 || l === -2 || l === 2 || s === 0 && l === 0 ? e.set(n + s, r + l, !0, !0) : e.set(n + s, r + l, !1, !0);
1220
+ }
1221
+ }
1222
+ function on(e, t) {
1223
+ const i = e.size, o = it.getEncodedBits(t);
1224
+ let n, r, s;
1225
+ for (let l = 0; l < 18; l++)
1226
+ n = Math.floor(l / 3), r = l % 3 + i - 8 - 3, s = (o >> l & 1) === 1, e.set(n, r, s, !0), e.set(r, n, s, !0);
1227
+ }
1228
+ function wt(e, t, i) {
1229
+ const o = e.size, n = Ze.getEncodedBits(t, i);
1230
+ let r, s;
1231
+ for (r = 0; r < 15; r++)
1232
+ s = (n >> r & 1) === 1, r < 6 ? e.set(r, 8, s, !0) : r < 8 ? e.set(r + 1, 8, s, !0) : e.set(o - 15 + r, 8, s, !0), r < 8 ? e.set(8, o - r - 1, s, !0) : r < 9 ? e.set(8, 15 - r - 1 + 1, s, !0) : e.set(8, 15 - r - 1, s, !0);
1233
+ e.set(o - 8, 8, 1, !0);
1234
+ }
1235
+ function rn(e, t) {
1236
+ const i = e.size;
1237
+ let o = -1, n = i - 1, r = 7, s = 0;
1238
+ for (let l = i - 1; l > 0; l -= 2)
1239
+ for (l === 6 && l--; ; ) {
1240
+ for (let a = 0; a < 2; a++)
1241
+ if (!e.isReserved(n, l - a)) {
1242
+ let c = !1;
1243
+ s < t.length && (c = (t[s] >>> r & 1) === 1), e.set(n, l - a, c), r--, r === -1 && (s++, r = 7);
1244
+ }
1245
+ if (n += o, n < 0 || i <= n) {
1246
+ n -= o, o = -o;
1247
+ break;
1248
+ }
1249
+ }
1250
+ }
1251
+ function sn(e, t, i) {
1252
+ const o = new qe();
1253
+ i.forEach(function(a) {
1254
+ o.put(a.mode.bit, 4), o.put(a.getLength(), Xe.getCharCountIndicator(a.mode, e)), a.write(o);
1255
+ });
1256
+ const n = ct.getSymbolTotalCodewords(e), r = Et.getTotalCodewordsCount(e, t), s = (n - r) * 8;
1257
+ for (o.getLengthInBits() + 4 <= s && o.put(0, 4); o.getLengthInBits() % 8 !== 0; )
1258
+ o.putBit(0);
1259
+ const l = (s - o.getLengthInBits()) / 8;
1260
+ for (let a = 0; a < l; a++)
1261
+ o.put(a % 2 ? 17 : 236, 8);
1262
+ return an(o, e, t);
1263
+ }
1264
+ function an(e, t, i) {
1265
+ const o = ct.getSymbolTotalCodewords(t), n = Et.getTotalCodewordsCount(t, i), r = o - n, s = Et.getBlocksCount(t, i), l = o % s, a = s - l, c = Math.floor(o / s), d = Math.floor(r / s), E = d + 1, m = c - d, h = new We(m);
1266
+ let C = 0;
1267
+ const w = new Array(s), A = new Array(s);
1268
+ let f = 0;
1269
+ const u = new Uint8Array(e.buffer);
1270
+ for (let T = 0; T < s; T++) {
1271
+ const N = T < a ? d : E;
1272
+ w[T] = u.slice(C, C + N), A[T] = h.encode(w[T]), C += N, f = Math.max(f, N);
1273
+ }
1274
+ const p = new Uint8Array(o);
1275
+ let g = 0, B, S;
1276
+ for (B = 0; B < f; B++)
1277
+ for (S = 0; S < s; S++)
1278
+ B < w[S].length && (p[g++] = w[S][B]);
1279
+ for (B = 0; B < m; B++)
1280
+ for (S = 0; S < s; S++)
1281
+ p[g++] = A[S][B];
1282
+ return p;
1283
+ }
1284
+ function ln(e, t, i, o) {
1285
+ let n;
1286
+ if (Array.isArray(e))
1287
+ n = pt.fromArray(e);
1288
+ else if (typeof e == "string") {
1289
+ let c = t;
1290
+ if (!c) {
1291
+ const d = pt.rawSplit(e);
1292
+ c = it.getBestVersionForData(d, i);
1293
+ }
1294
+ n = pt.fromString(e, c || 40);
1295
+ } else
1296
+ throw new Error("Invalid data");
1297
+ const r = it.getBestVersionForData(n, i);
1298
+ if (!r)
1299
+ throw new Error("The amount of data is too big to be stored in a QR Code");
1300
+ if (!t)
1301
+ t = r;
1302
+ else if (t < r)
1303
+ throw new Error(
1304
+ `
1305
+ The chosen QR Code version cannot contain this amount of data.
1306
+ Minimum version required to store current data is: ` + r + `.
1307
+ `
1308
+ );
1309
+ const s = sn(t, i, n), l = ct.getSymbolSize(t), a = new Qe(l);
1310
+ return tn(a, t), en(a), nn(a, t), wt(a, i, 0), t >= 7 && on(a, t), rn(a, s), isNaN(o) && (o = bt.getBestMask(
1311
+ a,
1312
+ wt.bind(null, a, i)
1313
+ )), bt.applyMask(o, a), wt(a, i, o), {
1314
+ modules: a,
1315
+ version: t,
1316
+ errorCorrectionLevel: i,
1317
+ maskPattern: o,
1318
+ segments: n
1319
+ };
1320
+ }
1321
+ Ot.create = function(t, i) {
1322
+ if (typeof t > "u" || t === "")
1323
+ throw new Error("No input text");
1324
+ let o = mt.M, n, r;
1325
+ return typeof i < "u" && (o = mt.from(i.errorCorrectionLevel, mt.M), n = it.from(i.version), r = bt.from(i.maskPattern), i.toSJISFunc && ct.setToSJISFunction(i.toSJISFunc)), ln(t, n, o, r);
1326
+ };
1327
+ var ee = {}, _t = {};
1328
+ (function(e) {
1329
+ function t(i) {
1330
+ if (typeof i == "number" && (i = i.toString()), typeof i != "string")
1331
+ throw new Error("Color should be defined as hex string");
1332
+ let o = i.slice().replace("#", "").split("");
1333
+ if (o.length < 3 || o.length === 5 || o.length > 8)
1334
+ throw new Error("Invalid hex color: " + i);
1335
+ (o.length === 3 || o.length === 4) && (o = Array.prototype.concat.apply([], o.map(function(r) {
1336
+ return [r, r];
1337
+ }))), o.length === 6 && o.push("F", "F");
1338
+ const n = parseInt(o.join(""), 16);
1339
+ return {
1340
+ r: n >> 24 & 255,
1341
+ g: n >> 16 & 255,
1342
+ b: n >> 8 & 255,
1343
+ a: n & 255,
1344
+ hex: "#" + o.slice(0, 6).join("")
1345
+ };
1346
+ }
1347
+ e.getOptions = function(o) {
1348
+ o || (o = {}), o.color || (o.color = {});
1349
+ const n = typeof o.margin > "u" || o.margin === null || o.margin < 0 ? 4 : o.margin, r = o.width && o.width >= 21 ? o.width : void 0, s = o.scale || 4;
1350
+ return {
1351
+ width: r,
1352
+ scale: r ? 4 : s,
1353
+ margin: n,
1354
+ color: {
1355
+ dark: t(o.color.dark || "#000000ff"),
1356
+ light: t(o.color.light || "#ffffffff")
1357
+ },
1358
+ type: o.type,
1359
+ rendererOpts: o.rendererOpts || {}
1360
+ };
1361
+ }, e.getScale = function(o, n) {
1362
+ return n.width && n.width >= o + n.margin * 2 ? n.width / (o + n.margin * 2) : n.scale;
1363
+ }, e.getImageWidth = function(o, n) {
1364
+ const r = e.getScale(o, n);
1365
+ return Math.floor((o + n.margin * 2) * r);
1366
+ }, e.qrToImageData = function(o, n, r) {
1367
+ const s = n.modules.size, l = n.modules.data, a = e.getScale(s, r), c = Math.floor((s + r.margin * 2) * a), d = r.margin * a, E = [r.color.light, r.color.dark];
1368
+ for (let m = 0; m < c; m++)
1369
+ for (let h = 0; h < c; h++) {
1370
+ let C = (m * c + h) * 4, w = r.color.light;
1371
+ if (m >= d && h >= d && m < c - d && h < c - d) {
1372
+ const A = Math.floor((m - d) / a), f = Math.floor((h - d) / a);
1373
+ w = E[l[A * s + f] ? 1 : 0];
1374
+ }
1375
+ o[C++] = w.r, o[C++] = w.g, o[C++] = w.b, o[C] = w.a;
1376
+ }
1377
+ };
1378
+ })(_t);
1379
+ (function(e) {
1380
+ const t = _t;
1381
+ function i(n, r, s) {
1382
+ n.clearRect(0, 0, r.width, r.height), r.style || (r.style = {}), r.height = s, r.width = s, r.style.height = s + "px", r.style.width = s + "px";
1383
+ }
1384
+ function o() {
1385
+ try {
1386
+ return document.createElement("canvas");
1387
+ } catch {
1388
+ throw new Error("You need to specify a canvas element");
1389
+ }
1390
+ }
1391
+ e.render = function(r, s, l) {
1392
+ let a = l, c = s;
1393
+ typeof a > "u" && (!s || !s.getContext) && (a = s, s = void 0), s || (c = o()), a = t.getOptions(a);
1394
+ const d = t.getImageWidth(r.modules.size, a), E = c.getContext("2d"), m = E.createImageData(d, d);
1395
+ return t.qrToImageData(m.data, r, a), i(E, c, d), E.putImageData(m, 0, 0), c;
1396
+ }, e.renderToDataURL = function(r, s, l) {
1397
+ let a = l;
1398
+ typeof a > "u" && (!s || !s.getContext) && (a = s, s = void 0), a || (a = {});
1399
+ const c = e.render(r, s, a), d = a.type || "image/png", E = a.rendererOpts || {};
1400
+ return c.toDataURL(d, E.quality);
1401
+ };
1402
+ })(ee);
1403
+ var ne = {};
1404
+ const un = _t;
1405
+ function Mt(e, t) {
1406
+ const i = e.a / 255, o = t + '="' + e.hex + '"';
1407
+ return i < 1 ? o + " " + t + '-opacity="' + i.toFixed(2).slice(1) + '"' : o;
1408
+ }
1409
+ function yt(e, t, i) {
1410
+ let o = e + t;
1411
+ return typeof i < "u" && (o += " " + i), o;
1412
+ }
1413
+ function cn(e, t, i) {
1414
+ let o = "", n = 0, r = !1, s = 0;
1415
+ for (let l = 0; l < e.length; l++) {
1416
+ const a = Math.floor(l % t), c = Math.floor(l / t);
1417
+ !a && !r && (r = !0), e[l] ? (s++, l > 0 && a > 0 && e[l - 1] || (o += r ? yt("M", a + i, 0.5 + c + i) : yt("m", n, 0), n = 0, r = !1), a + 1 < t && e[l + 1] || (o += yt("h", s), s = 0)) : n++;
1418
+ }
1419
+ return o;
1420
+ }
1421
+ ne.render = function(t, i, o) {
1422
+ const n = un.getOptions(i), r = t.modules.size, s = t.modules.data, l = r + n.margin * 2, a = n.color.light.a ? "<path " + Mt(n.color.light, "fill") + ' d="M0 0h' + l + "v" + l + 'H0z"/>' : "", c = "<path " + Mt(n.color.dark, "stroke") + ' d="' + cn(s, r, n.margin) + '"/>', d = 'viewBox="0 0 ' + l + " " + l + '"', m = '<svg xmlns="http://www.w3.org/2000/svg" ' + (n.width ? 'width="' + n.width + '" height="' + n.width + '" ' : "") + d + ' shape-rendering="crispEdges">' + a + c + `</svg>
1423
+ `;
1424
+ return typeof o == "function" && o(null, m), m;
1425
+ };
1426
+ const dn = Ae, Bt = Ot, oe = ee, fn = ne;
1427
+ function It(e, t, i, o, n) {
1428
+ const r = [].slice.call(arguments, 1), s = r.length, l = typeof r[s - 1] == "function";
1429
+ if (!l && !dn())
1430
+ throw new Error("Callback required as last argument");
1431
+ if (l) {
1432
+ if (s < 2)
1433
+ throw new Error("Too few arguments provided");
1434
+ s === 2 ? (n = i, i = t, t = o = void 0) : s === 3 && (t.getContext && typeof n > "u" ? (n = o, o = void 0) : (n = o, o = i, i = t, t = void 0));
1435
+ } else {
1436
+ if (s < 1)
1437
+ throw new Error("Too few arguments provided");
1438
+ return s === 1 ? (i = t, t = o = void 0) : s === 2 && !t.getContext && (o = i, i = t, t = void 0), new Promise(function(a, c) {
1439
+ try {
1440
+ const d = Bt.create(i, o);
1441
+ a(e(d, t, o));
1442
+ } catch (d) {
1443
+ c(d);
1444
+ }
1445
+ });
1446
+ }
1447
+ try {
1448
+ const a = Bt.create(i, o);
1449
+ n(null, e(a, t, o));
1450
+ } catch (a) {
1451
+ n(a);
1452
+ }
1453
+ }
1454
+ Z.create = Bt.create;
1455
+ Z.toCanvas = It.bind(null, oe.render);
1456
+ Z.toDataURL = It.bind(null, oe.renderToDataURL);
1457
+ Z.toString = It.bind(null, function(e, t, i) {
1458
+ return fn.render(e, i);
1459
+ });
1460
+ const kt = 15e3;
1461
+ function gn() {
1462
+ return Ce(J("fmmf:dev"), re()).portalApiBaseUrl;
1463
+ }
1464
+ async function Rt(e, t) {
1465
+ const i = await e.json().catch(() => null);
1466
+ return new Error(
1467
+ typeof (i == null ? void 0 : i.message) == "string" && i.message ? i.message : `${t} (HTTP ${e.status})`
1468
+ );
1469
+ }
1470
+ async function Lt(e, t = {}) {
1471
+ const i = new Headers(t.headers), o = await ve();
1472
+ return o && i.set("Authorization", o), t.body && i.set("Content-Type", "application/json"), fetch(`${gn()}${e}`, {
1473
+ ...t,
1474
+ headers: i,
1475
+ signal: AbortSignal.timeout(kt)
1476
+ });
1477
+ }
1478
+ async function hn(e, t, i) {
1479
+ const o = encodeURIComponent(e), n = await Lt(`/businesses/${o}`);
1480
+ if (!n.ok) throw await Rt(n, "Could not load the business profile");
1481
+ const r = await n.json(), s = t || e, l = await Lt(`/businesses/${o}/profile`, {
1482
+ method: "PUT",
1483
+ body: JSON.stringify({
1484
+ name: r.name,
1485
+ url: s,
1486
+ thumbnail: r.thumbnail ?? null,
1487
+ coverPhoto: r.coverPhoto ?? null
1488
+ })
1489
+ });
1490
+ if (!l.ok) throw await Rt(l, "Could not save the business link");
1491
+ const a = st(J("fmmf:dev")).apiOrigin;
1492
+ return await fetch(`${a}/short-url`, {
1493
+ method: "POST",
1494
+ headers: { "Content-Type": "application/json" },
1495
+ body: JSON.stringify({ slug: t, oldSlug: i, type: "BUSINESS", businessId: e }),
1496
+ signal: AbortSignal.timeout(kt)
1497
+ }).catch((c) => console.warn("short-url cache warm failed; it will self-heal", c)), s;
1498
+ }
1499
+ async function mn(e, t) {
1500
+ const i = st(J("fmmf:dev")).apiOrigin, o = await fetch(`${i}/short-url/${encodeURIComponent(e)}`, {
1501
+ signal: AbortSignal.any([t, AbortSignal.timeout(kt)])
1502
+ });
1503
+ if (o.status === 404) return null;
1504
+ if (!o.ok) throw new Error(`Could not check the link name (HTTP ${o.status})`);
1505
+ return await o.json();
1506
+ }
1507
+ function re() {
1508
+ return we(ye()) ?? "MY";
1509
+ }
1510
+ const pn = { class: "portal-section" }, wn = { class: "link-row" }, yn = { class: "link-form" }, vn = { class: "link-suffix" }, Cn = {
1511
+ key: 1,
1512
+ class: "portal-error",
1513
+ role: "alert"
1514
+ }, bn = { class: "link-actions" }, En = { class: "link-live" }, Bn = ["href"], Sn = { class: "link-qr" }, An = ["src", "alt"], Tn = {
1515
+ key: 1,
1516
+ class: "link-qr-placeholder"
1517
+ }, _n = ["href", "download"], In = /* @__PURE__ */ Ut({
1518
+ __name: "BusinessLinkSection",
1519
+ setup(e) {
1520
+ const t = Vt(), i = $t(), o = ge(), n = he(), r = st(J("fmmf:dev")).liveDomain, s = I(() => t.businessId.value ?? ""), l = I(() => {
1521
+ var b, L;
1522
+ const y = ((L = (b = i.currentBusiness.value) == null ? void 0 : b.url) == null ? void 0 : L.trim().toLowerCase()) ?? "";
1523
+ return y === s.value ? "" : y;
1524
+ }), a = I(() => me(s.value, l.value, r)), c = F("");
1525
+ dt(l, (y) => c.value = y, { immediate: !0 });
1526
+ const d = I(() => c.value.trim().toLowerCase()), E = I(() => d.value !== l.value), m = F(!1), h = F(null);
1527
+ function C(y) {
1528
+ const b = gt(y.trim().toLowerCase());
1529
+ return b === "format" ? "Use 6+ lowercase letters, numbers or inner hyphens" : b === "reserved" ? "This name is reserved. Choose another." : !0;
1530
+ }
1531
+ const w = F(null);
1532
+ let A, f = null;
1533
+ const u = I(() => {
1534
+ const y = d.value;
1535
+ return y && E.value && !gt(y) ? y : null;
1536
+ });
1537
+ dt(u, (y) => {
1538
+ window.clearTimeout(A), f == null || f.abort(), w.value = y ? { slug: y, state: "checking" } : null, y && (A = window.setTimeout(() => void p(y), 400));
1539
+ });
1540
+ async function p(y) {
1541
+ var L, U;
1542
+ const b = new AbortController();
1543
+ f = b;
1544
+ try {
1545
+ const z = await mn(y, b.signal);
1546
+ if (((L = w.value) == null ? void 0 : L.slug) !== y) return;
1547
+ w.value = {
1548
+ slug: y,
1549
+ state: "done",
1550
+ result: pe(z, s.value, re())
1551
+ };
1552
+ } catch (z) {
1553
+ if (b.signal.aborted || ((U = w.value) == null ? void 0 : U.slug) !== y) return;
1554
+ console.warn("Slug availability check failed", z), w.value = { slug: y, state: "failed" };
1555
+ }
1556
+ }
1557
+ Dt(() => {
1558
+ window.clearTimeout(A), f == null || f.abort();
1559
+ });
1560
+ const g = I(() => {
1561
+ var y;
1562
+ return ((y = w.value) == null ? void 0 : y.slug) === u.value ? w.value : null;
1563
+ }), B = I(() => {
1564
+ const y = g.value;
1565
+ if (!y) return null;
1566
+ if (y.state === "checking") return { tone: "muted", text: "Checking availability…" };
1567
+ if (y.state === "failed")
1568
+ return { tone: "muted", text: "Could not check availability. Saving will still check it." };
1569
+ const { result: b } = y;
1570
+ return b.status === "taken" ? { tone: "error", text: "Already used by another business. Choose another." } : b.status === "shared" ? {
1571
+ tone: "warning",
1572
+ text: `Also used by another business in ${b.countries.join(", ")}. Customers opening this link will be asked to choose a country.`
1573
+ } : { tone: "success", text: "Available" };
1574
+ }), S = I(
1575
+ () => {
1576
+ var y, b;
1577
+ return E.value && !gt(d.value) && // An empty draft resets to the business id and needs no lookup.
1578
+ (!u.value || ((y = g.value) == null ? void 0 : y.state) === "failed" || ((b = g.value) == null ? void 0 : b.state) === "done" && g.value.result.status !== "taken");
1579
+ }
1580
+ ), T = F(null);
1581
+ dt(
1582
+ a,
1583
+ async (y) => {
1584
+ T.value = null;
1585
+ try {
1586
+ const b = await Z.toDataURL(y, { width: 1024, margin: 2, errorCorrectionLevel: "Q" });
1587
+ y === a.value && (T.value = b);
1588
+ } catch (b) {
1589
+ console.error("QR code generation failed", b);
1590
+ }
1591
+ },
1592
+ { immediate: !0 }
1593
+ );
1594
+ const N = I(() => `${l.value || s.value}-qr.png`);
1595
+ async function R() {
1596
+ try {
1597
+ await navigator.clipboard.writeText(a.value), n.open({ message: "Link copied", type: "success" }, 1500);
1598
+ } catch {
1599
+ n.open({ message: "Could not copy the link. Select it and copy it manually.", type: "error" }, 3e3);
1600
+ }
1601
+ }
1602
+ async function P() {
1603
+ var L;
1604
+ const y = d.value;
1605
+ if (!S.value || m.value) return;
1606
+ m.value = !0, h.value = null;
1607
+ const b = l.value;
1608
+ try {
1609
+ const U = await hn(s.value, y, b), z = i.currentBusiness.value;
1610
+ z && (z.url = U), n.open({ message: "Business link saved", type: "success" }, 2e3);
1611
+ const tt = (L = t.context.value) == null ? void 0 : L.projectId;
1612
+ tt && await be(Be.refreshSlug(s.value, tt), {
1613
+ method: "POST",
1614
+ body: JSON.stringify({ businessSlug: U }),
1615
+ signal: AbortSignal.timeout(3e4)
1616
+ }).catch((ie) => console.warn("Live URL refresh failed; the next sync will pick it up", ie));
1617
+ } catch (U) {
1618
+ h.value = zt(U);
1619
+ } finally {
1620
+ m.value = !1;
1621
+ }
1622
+ }
1623
+ function $() {
1624
+ if (S.value) {
1625
+ if (!l.value) return void P();
1626
+ o.open({
1627
+ title: "Change your business link?",
1628
+ message: `${a.value} will stop working, including QR codes already printed or shared with it. Customers will need the new link.`,
1629
+ dismissAway: !0,
1630
+ primaryActions: { close: !0, text: "Change link" },
1631
+ secondaryActions: { close: !0, text: "Cancel" }
1632
+ }).onPrimary(() => void P());
1633
+ }
1634
+ }
1635
+ return (y, b) => {
1636
+ const L = ot("FmTextField"), U = ot("FmButton"), z = ot("FmIcon");
1637
+ return _(), k("section", pn, [
1638
+ b[2] || (b[2] = v("div", { class: "portal-section-head" }, [
1639
+ v("div", null, [
1640
+ v("h2", null, "Business link"),
1641
+ v("p", { class: "portal-description" }, "Where customers open your app. Shared by every country this business runs in.")
1642
+ ])
1643
+ ], -1)),
1644
+ v("div", wn, [
1645
+ v("div", yn, [
1646
+ G(L, {
1647
+ modelValue: c.value,
1648
+ "onUpdate:modelValue": b[0] || (b[0] = (tt) => c.value = tt),
1649
+ label: "Link name",
1650
+ placeholder: s.value,
1651
+ disabled: m.value,
1652
+ rules: [C],
1653
+ onKeydown: se($, ["enter"])
1654
+ }, {
1655
+ append: ae(() => [
1656
+ v("span", vn, "." + H(vt(r)), 1)
1657
+ ]),
1658
+ _: 1
1659
+ }, 8, ["modelValue", "placeholder", "disabled", "rules"]),
1660
+ B.value ? (_(), k("p", {
1661
+ key: 0,
1662
+ class: Ft(["link-check", `link-check--${B.value.tone}`]),
1663
+ "aria-live": "polite"
1664
+ }, H(B.value.text), 3)) : V("", !0),
1665
+ b[1] || (b[1] = v("p", { class: "portal-description" }, "Leave it empty to use your business id.", -1)),
1666
+ h.value ? (_(), k("p", Cn, H(h.value), 1)) : V("", !0),
1667
+ v("div", bn, [
1668
+ G(U, {
1669
+ label: "Save",
1670
+ loading: m.value,
1671
+ disabled: !S.value,
1672
+ onClick: $
1673
+ }, null, 8, ["loading", "disabled"])
1674
+ ]),
1675
+ v("div", En, [
1676
+ v("a", {
1677
+ href: a.value,
1678
+ target: "_blank",
1679
+ rel: "noopener"
1680
+ }, H(a.value), 9, Bn),
1681
+ G(U, {
1682
+ icon: "content_copy",
1683
+ variant: "tertiary",
1684
+ size: "md",
1685
+ "aria-label": "Copy link",
1686
+ onClick: R
1687
+ })
1688
+ ])
1689
+ ]),
1690
+ v("div", Sn, [
1691
+ T.value ? (_(), k("img", {
1692
+ key: 0,
1693
+ src: T.value,
1694
+ alt: `QR code for ${a.value}`
1695
+ }, null, 8, An)) : (_(), k("div", Tn, [
1696
+ G(z, {
1697
+ name: "qr_code_2",
1698
+ size: "xl"
1699
+ })
1700
+ ])),
1701
+ T.value ? (_(), k("a", {
1702
+ key: 2,
1703
+ href: T.value,
1704
+ download: N.value,
1705
+ class: "portal-link-button"
1706
+ }, "Download QR code", 8, _n)) : V("", !0)
1707
+ ])
1708
+ ])
1709
+ ]);
1710
+ };
1711
+ }
1712
+ }), kn = /* @__PURE__ */ Ht(In, [["__scopeId", "data-v-7144b75b"]]), Nn = { class: "portal-page" }, Pn = { class: "portal-page-inner settings-page" }, Mn = { class: "portal-page-heading" }, Rn = ["href"], Ln = {
1713
+ class: "settings-tabs",
1714
+ role: "tablist"
1715
+ }, Un = ["aria-selected", "onClick"], Dn = {
1716
+ key: 0,
1717
+ class: "portal-error",
1718
+ role: "alert"
1719
+ }, Fn = { class: "portal-section" }, $n = { class: "settings-value" }, zn = { class: "portal-section" }, Vn = { class: "settings-icon-row" }, Hn = { class: "settings-icon" }, On = ["src"], Kn = { class: "portal-section" }, Jn = { class: "settings-logo" }, jn = ["src"], Yn = /* @__PURE__ */ Ut({
1720
+ __name: "PortalSettingsView",
1721
+ setup(e) {
1722
+ const t = Vt(), i = de(), o = fe(), n = $t(), r = [
1723
+ { id: "link", label: "Link & QR" },
1724
+ { id: "assets", label: "Assets" }
1725
+ ], s = I(() => i.query.tab === "assets" ? "assets" : "link");
1726
+ function l(f) {
1727
+ o.replace({ query: { ...i.query, tab: f } });
1728
+ }
1729
+ const a = I(
1730
+ () => {
1731
+ var f;
1732
+ return new URL(
1733
+ Se({
1734
+ ...i.query,
1735
+ businessId: t.businessId.value,
1736
+ country: n.currentCountry.value ?? null,
1737
+ restaurantId: ((f = n.currentRestaurant.value) == null ? void 0 : f._id) ?? null
1738
+ }),
1739
+ J("fmmf:dev") === "dev" ? "https://portal.feedmedev.cc" : "https://portal.feedme.cc"
1740
+ ).href;
1741
+ }
1742
+ ), c = F(null), d = F(!0), E = F(null), m = F(!1), h = st(J("fmmf:dev")).apiOrigin, C = I(() => `${h}/metadata/${t.businessId.value}/pwa-512x512.png`), w = I(() => {
1743
+ var f;
1744
+ return (f = Ee()) == null ? void 0 : f.thumbnail;
1745
+ }), A = new AbortController();
1746
+ return le(async () => {
1747
+ var f;
1748
+ try {
1749
+ const u = await fetch(`${h}/metadata/${t.businessId.value}/config`, {
1750
+ signal: AbortSignal.any([A.signal, AbortSignal.timeout(15e3)])
1751
+ });
1752
+ if (u.status === 404) return;
1753
+ if (!u.ok) throw new Error(`Could not load app assets (HTTP ${u.status})`);
1754
+ const p = await u.json();
1755
+ c.value = ((f = p.pwaConfig) == null ? void 0 : f.name) ?? null;
1756
+ } catch (u) {
1757
+ A.signal.aborted || (E.value = zt(u));
1758
+ } finally {
1759
+ d.value = !1;
1760
+ }
1761
+ }), Dt(() => A.abort()), (f, u) => {
1762
+ const p = ot("FmIcon");
1763
+ return _(), k("div", Nn, [
1764
+ v("div", Pn, [
1765
+ v("header", Mn, [
1766
+ u[1] || (u[1] = v("div", null, [
1767
+ v("p", { class: "portal-eyebrow" }, "Your app identity"),
1768
+ v("h1", null, "Settings")
1769
+ ], -1)),
1770
+ s.value === "assets" ? (_(), k("a", {
1771
+ key: 0,
1772
+ href: a.value,
1773
+ class: "portal-link-button",
1774
+ target: "_blank",
1775
+ rel: "noopener"
1776
+ }, "Manage assets in original Portal ↗", 8, Rn)) : V("", !0)
1777
+ ]),
1778
+ v("div", Ln, [
1779
+ (_(), k(ft, null, ue(r, (g) => v("button", {
1780
+ key: g.id,
1781
+ type: "button",
1782
+ role: "tab",
1783
+ "aria-selected": s.value === g.id,
1784
+ class: Ft({ active: s.value === g.id }),
1785
+ onClick: (B) => l(g.id)
1786
+ }, H(g.label), 11, Un)), 64))
1787
+ ]),
1788
+ s.value === "link" && vt(t).businessId.value ? (_(), ce(kn, { key: 0 })) : V("", !0),
1789
+ s.value === "assets" ? (_(), k(ft, { key: 1 }, [
1790
+ u[10] || (u[10] = v("p", { class: "portal-notice" }, " App assets are still managed by the original Mini Program. Edit them there to preserve existing subscription rules and shared business settings. ", -1)),
1791
+ E.value ? (_(), k("p", Dn, H(E.value), 1)) : V("", !0),
1792
+ v("section", Fn, [
1793
+ u[2] || (u[2] = v("h2", null, "App name", -1)),
1794
+ u[3] || (u[3] = v("p", { class: "portal-description" }, "Shown under the icon on your customer’s home screen.", -1)),
1795
+ v("p", $n, H(d.value ? "Loading…" : E.value ? "Unavailable" : c.value || "Not configured"), 1),
1796
+ u[4] || (u[4] = v("p", { class: "portal-description" }, " The original Portal applies the “FeedMe x” naming rule for non-Premium businesses. ", -1))
1797
+ ]),
1798
+ v("section", zn, [
1799
+ u[7] || (u[7] = v("div", { class: "portal-section-head" }, [
1800
+ v("div", null, [
1801
+ v("h2", null, "App icon"),
1802
+ v("p", { class: "portal-description" }, "One square image for the home screen.")
1803
+ ])
1804
+ ], -1)),
1805
+ v("div", Vn, [
1806
+ v("div", Hn, [
1807
+ m.value ? (_(), k(ft, { key: 1 }, [
1808
+ G(p, {
1809
+ name: "image",
1810
+ size: "xl"
1811
+ }),
1812
+ u[5] || (u[5] = v("span", null, "No icon available", -1))
1813
+ ], 64)) : (_(), k("img", {
1814
+ key: 0,
1815
+ src: C.value,
1816
+ alt: "Current app icon",
1817
+ onError: u[0] || (u[0] = (g) => m.value = !0)
1818
+ }, null, 40, On))
1819
+ ]),
1820
+ u[6] || (u[6] = v("div", null, [
1821
+ v("h3", null, "Icon guidelines"),
1822
+ v("p", { class: "portal-description" }, " Use a square image, ideally at least 1024 × 1024 pixels. Keep the important artwork inside the central 4/5 safe area. "),
1823
+ v("p", { class: "portal-description" }, "Changes to this shared icon are not part of a release build.")
1824
+ ], -1))
1825
+ ])
1826
+ ]),
1827
+ v("section", Kn, [
1828
+ u[8] || (u[8] = v("h2", null, "Business branding", -1)),
1829
+ v("div", Jn, [
1830
+ w.value ? (_(), k("img", {
1831
+ key: 0,
1832
+ src: w.value,
1833
+ alt: "Business logo"
1834
+ }, null, 8, jn)) : V("", !0),
1835
+ v("p", null, H(vt(t).businessName.value), 1)
1836
+ ]),
1837
+ u[9] || (u[9] = v("p", { class: "portal-description" }, " Cover images and other shared business assets remain available in the original Portal. ", -1))
1838
+ ])
1839
+ ], 64)) : V("", !0)
1840
+ ])
1841
+ ]);
1842
+ };
1843
+ }
1844
+ }), oo = /* @__PURE__ */ Ht(Yn, [["__scopeId", "data-v-c940a1ba"]]);
1845
+ export {
1846
+ oo as default
1847
+ };