@feedmepos/mf-connect 0.1.14-prod → 0.1.16-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Analytic-MRp7gtO3.js → Analytic-9_JkMO2c.js} +18 -17
- package/dist/{App-BU3B2A-F.js → App-DfbUtaeM.js} +68 -64
- package/dist/Bin-BoolyqZn.js +165 -0
- package/dist/{Broadcast-DmciJlSU.js → Broadcast-8UwFqqzp.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DJPOgBXj.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CjoVXqOG.js} +6 -7
- package/dist/{Card-Dq2cAgTi.js → Card-BFEc9Zgu.js} +78 -79
- package/dist/{Collections-B4x4VH1a.js → Collections-DqlqGVcv.js} +5 -5
- package/dist/{Credit-CVdT1KBU.js → Credit-BuKQEMU2.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BmjXu-U7.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BjCVR7D4.js} +27 -27
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-A_uosv-g.js → EffectSheet.vue_vue_type_style_index_0_lang-DXBqS4zs.js} +8 -8
- package/dist/{Experience-CEeXWbue.js → Experience-BTf5f-Kb.js} +8 -8
- package/dist/{Game-mx5c5ZhV.js → Game-Ci_39vHg.js} +8 -8
- package/dist/{Index-DQ1qadwz.js → Index-8JLenrzT.js} +9 -9
- package/dist/{Marketing-CciBZijv.js → Marketing-XAmIlYCx.js} +5 -5
- package/dist/{Member-C51SlKxj.js → Member-Bvxgoep1.js} +4 -4
- package/dist/MemberList-BvX98Yt-.js +1596 -0
- package/dist/MemberTransactions-DJt3aJ-h.js +45 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DZu24zwy.js → MessageInput.vue_vue_type_script_setup_true_lang-OFqra1ac.js} +45 -33
- package/dist/{Mission-LpCnpKYD.js → Mission-D_CqN5Es.js} +8 -8
- package/dist/{Overview-DxvOqUao.js → Overview-FRebjePW.js} +62 -63
- package/dist/{Point-BmI7y6h6.js → Point-C_amiOK4.js} +8 -8
- package/dist/{Promotion-MHaOqrwu.js → Promotion-qt_pE8uB.js} +9 -9
- package/dist/{Record-75BxMATe.js → Record-2eAijNwr.js} +6 -6
- package/dist/{Reward-8VfyFuEt.js → Reward-DLNijsC9.js} +35 -35
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-D12_r-9X.js → RewardGroup.vue_vue_type_script_setup_true_lang-dsxs4d5k.js} +12 -13
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BIdBxvN7.js → RuleGroup.vue_vue_type_script_setup_true_lang-BZ4ORSgp.js} +14 -15
- package/dist/{Segment-I9FUibZy.js → Segment-QKuGmThT.js} +13 -13
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BGeR0-AG.js → SelectItems.vue_vue_type_script_setup_true_lang-C02QXf6B.js} +2 -2
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DXpzjbIh.js +147 -0
- package/dist/Setting-GTro0uCw.js +1877 -0
- package/dist/{Store-CQkGNSSm.js → Store-CTxmlEVr.js} +55 -56
- package/dist/{StoreRewards-DOtjveqw.js → StoreRewards-Bm9NXXH2.js} +12 -12
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Cf9IsQXS.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CrxFaBDj.js} +321 -354
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DPmeW62s.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Cf2JpXND.js} +1 -1
- package/dist/{Tier-DAj_5abZ.js → Tier-CB64ZbLz.js} +20 -21
- package/dist/{Title-DryO4wcO.js → Title-62HEE-nU.js} +20 -21
- package/dist/{Transaction-DpibVFU-.js → Transaction-CK9Igmnp.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DoiPRPPo.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DJB9g9bg.js} +6 -6
- package/dist/Voucher-CZLp6Mfd.js +353 -0
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DRnVggfC.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DKunt5iP.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BzBcsSYS.js → ZodTextField.vue_vue_type_script_setup_true_lang-CP0wAVaD.js} +1 -1
- package/dist/{app-BoQTcBOD.js → app-BsOd2LLI.js} +651 -615
- package/dist/{app-BzPle2EI.js → app-D7g1W_8e.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-H9a63ymR.js → business-e0ErhqsW.js} +1 -1
- package/dist/{dto-BBLfD0Lh.js → campaign-CcRs_0FM.js} +610 -819
- package/dist/{campaign-CR-16mwD.js → campaign-CcdO3quq.js} +2 -2
- package/dist/{campaign.enum-DcaetYuk.js → campaign.enum-DSB0ntaX.js} +1 -1
- package/dist/{campaign.fn-BqGZqM77.js → campaign.fn-BSxLDscM.js} +133 -133
- package/dist/{collectible.enum-YKtiwQbt.js → collectible.enum-DR19JADq.js} +3 -3
- package/dist/{collection.fn-CI8lSAsC.js → collection.fn-Bm_oNhCa.js} +2 -2
- package/dist/dto-3LqyQCjQ.js +214 -0
- package/dist/{effect-36H79d0n.js → effect-BuC4ddqL.js} +1 -1
- package/dist/{email-addresses-drrACeqJ.js → email-addresses-FxQM5JQh.js} +1 -1
- package/dist/{export-BgnO3lJs.js → export-DB_vSJ5r.js} +5 -5
- package/dist/{helper-CcV9DZXq.js → helper-Czc_ykUT.js} +1 -1
- package/dist/index-0EgN5Vaf.js +115 -0
- package/dist/{index-Cidu1YZP.js → index-B-gmFyeP.js} +5 -5
- package/dist/{index-CB1CnEOn.js → index-C2Y3Z6cQ.js} +1 -1
- package/dist/{index-mgoYj6L9.js → index-CavK1FD8.js} +1 -1
- package/dist/{index-BEDXujqZ.js → index-DF7DfJ1p.js} +1 -1
- package/dist/{index-DydNNBhY.js → index-DJmQQbIZ.js} +29 -4
- package/dist/{index-CibFRBGu.js → index-DP1XHU5I.js} +6 -6
- package/dist/{index-BRTpdfj3.js → index-DTirkGj1.js} +2057 -1010
- package/dist/{index-ZycLk3NR.js → index-Dc_5fMdM.js} +1 -1
- package/dist/index-Dvp6UpsY.js +44 -0
- package/dist/{index-BPbhXWRp.js → index-KXIH9y_C.js} +12 -13
- package/dist/{index-DLAAi9ur.js → index-o3ez16Wf.js} +3 -3
- package/dist/{index.esm2017-QS_XhcBp.js → index.esm2017-DsCfyosK.js} +1 -1
- package/dist/{loading-LktVwV5k.js → loading-CsMKK-RP.js} +4 -4
- package/dist/{membership-7ETvXph3.js → membership-ChU9QHZQ.js} +6 -6
- package/dist/{money-BYszknw8.js → money-CG2aMqwR.js} +1 -1
- package/dist/{number-Dmd4vT4F.js → number-DOiTymUW.js} +1 -1
- package/dist/{objectid-BQtSeCVi.js → objectid-DEgIJB4V.js} +4 -4
- package/dist/{reward-DJGOX-D1.js → reward-bezIYRz1.js} +1 -1
- package/dist/{rule-D7jM4gdg.js → rule-BXvIZA60.js} +3 -3
- package/dist/{rule-builder-FO9UeYUJ.js → rule-builder-BD_t-4Oq.js} +1 -1
- package/dist/{template-C4Ddrpk1.js → template-CYa8Yqzb.js} +4 -4
- package/dist/{trigger-w7Q4qOMB.js → trigger-B2Ihm351.js} +13 -13
- package/dist/{usePagination-PH1OvyZM.js → usePagination-Dus-uVGw.js} +1 -1
- package/dist/{user-DRPXRVy2.js → user-BkIvuR0M.js} +1 -1
- package/dist/{vue-i18n-B49HKiTU.js → vue-i18n-BOO66JER.js} +112 -112
- package/package.json +1 -1
- package/dist/MemberList-D1x731cU.js +0 -1043
- package/dist/MemberTransactions-BpoTQHFQ.js +0 -38
- package/dist/Setting-B8V2I0EZ.js +0 -1871
- package/dist/Voucher-CSc0_dGX.js +0 -491
- package/dist/index-6RqtavHk.js +0 -1051
- package/dist/index-B5ii6hOh.js +0 -99
|
@@ -0,0 +1,1877 @@
|
|
|
1
|
+
import { defineComponent as Ve, ref as K, computed as se, onMounted as xe, resolveComponent as D, openBlock as $, createBlock as be, withCtx as Q, createElementVNode as C, createVNode as S, unref as d, isRef as $e, createElementBlock as G, Fragment as ge, toDisplayString as R, createTextVNode as X, renderList as Ue, createCommentVNode as Le } from "vue";
|
|
2
|
+
import { h as lt } from "./moment-BWErdI6_.js";
|
|
3
|
+
import { useDialog as ze } from "@feedmepos/ui-library";
|
|
4
|
+
import { a as He, u as ct, p as ut, f as O } from "./loading-CsMKK-RP.js";
|
|
5
|
+
import { u as dt } from "./app-wDQR6dpb.js";
|
|
6
|
+
import { u as ve, l as Ke } from "./business-e0ErhqsW.js";
|
|
7
|
+
import { u as Oe } from "./membership-ChU9QHZQ.js";
|
|
8
|
+
import { h as ft } from "./index-DTirkGj1.js";
|
|
9
|
+
import { _ as Fe } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
10
|
+
import { _ as gt } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-Cf2JpXND.js";
|
|
11
|
+
import { M as mt, _ as ht } from "./MessageInput.vue_vue_type_script_setup_true_lang-OFqra1ac.js";
|
|
12
|
+
import { u as pt } from "./vue-i18n-BOO66JER.js";
|
|
13
|
+
import { useCoreStore as yt } from "@feedmepos/mf-common";
|
|
14
|
+
import { m as wt } from "./index-DJmQQbIZ.js";
|
|
15
|
+
import { o as bt } from "./objectId-dwaoBfJX.js";
|
|
16
|
+
import { a as vt } from "./object-qECH92oz.js";
|
|
17
|
+
var ee = {}, Ct = function() {
|
|
18
|
+
return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
|
|
19
|
+
}, Ye = {}, U = {};
|
|
20
|
+
let Ae;
|
|
21
|
+
const _t = [
|
|
22
|
+
0,
|
|
23
|
+
// Not used
|
|
24
|
+
26,
|
|
25
|
+
44,
|
|
26
|
+
70,
|
|
27
|
+
100,
|
|
28
|
+
134,
|
|
29
|
+
172,
|
|
30
|
+
196,
|
|
31
|
+
242,
|
|
32
|
+
292,
|
|
33
|
+
346,
|
|
34
|
+
404,
|
|
35
|
+
466,
|
|
36
|
+
532,
|
|
37
|
+
581,
|
|
38
|
+
655,
|
|
39
|
+
733,
|
|
40
|
+
815,
|
|
41
|
+
901,
|
|
42
|
+
991,
|
|
43
|
+
1085,
|
|
44
|
+
1156,
|
|
45
|
+
1258,
|
|
46
|
+
1364,
|
|
47
|
+
1474,
|
|
48
|
+
1588,
|
|
49
|
+
1706,
|
|
50
|
+
1828,
|
|
51
|
+
1921,
|
|
52
|
+
2051,
|
|
53
|
+
2185,
|
|
54
|
+
2323,
|
|
55
|
+
2465,
|
|
56
|
+
2611,
|
|
57
|
+
2761,
|
|
58
|
+
2876,
|
|
59
|
+
3034,
|
|
60
|
+
3196,
|
|
61
|
+
3362,
|
|
62
|
+
3532,
|
|
63
|
+
3706
|
|
64
|
+
];
|
|
65
|
+
U.getSymbolSize = function(e) {
|
|
66
|
+
if (!e) throw new Error('"version" cannot be null or undefined');
|
|
67
|
+
if (e < 1 || e > 40) throw new Error('"version" should be in range from 1 to 40');
|
|
68
|
+
return e * 4 + 17;
|
|
69
|
+
};
|
|
70
|
+
U.getSymbolTotalCodewords = function(e) {
|
|
71
|
+
return _t[e];
|
|
72
|
+
};
|
|
73
|
+
U.getBCHDigit = function(t) {
|
|
74
|
+
let e = 0;
|
|
75
|
+
for (; t !== 0; )
|
|
76
|
+
e++, t >>>= 1;
|
|
77
|
+
return e;
|
|
78
|
+
};
|
|
79
|
+
U.setToSJISFunction = function(e) {
|
|
80
|
+
if (typeof e != "function")
|
|
81
|
+
throw new Error('"toSJISFunc" is not a valid function.');
|
|
82
|
+
Ae = e;
|
|
83
|
+
};
|
|
84
|
+
U.isKanjiModeEnabled = function() {
|
|
85
|
+
return typeof Ae < "u";
|
|
86
|
+
};
|
|
87
|
+
U.toSJIS = function(e) {
|
|
88
|
+
return Ae(e);
|
|
89
|
+
};
|
|
90
|
+
var ce = {};
|
|
91
|
+
(function(t) {
|
|
92
|
+
t.L = { bit: 1 }, t.M = { bit: 0 }, t.Q = { bit: 3 }, t.H = { bit: 2 };
|
|
93
|
+
function e(i) {
|
|
94
|
+
if (typeof i != "string")
|
|
95
|
+
throw new Error("Param is not a string");
|
|
96
|
+
switch (i.toLowerCase()) {
|
|
97
|
+
case "l":
|
|
98
|
+
case "low":
|
|
99
|
+
return t.L;
|
|
100
|
+
case "m":
|
|
101
|
+
case "medium":
|
|
102
|
+
return t.M;
|
|
103
|
+
case "q":
|
|
104
|
+
case "quartile":
|
|
105
|
+
return t.Q;
|
|
106
|
+
case "h":
|
|
107
|
+
case "high":
|
|
108
|
+
return t.H;
|
|
109
|
+
default:
|
|
110
|
+
throw new Error("Unknown EC Level: " + i);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
t.isValid = function(r) {
|
|
114
|
+
return r && typeof r.bit < "u" && r.bit >= 0 && r.bit < 4;
|
|
115
|
+
}, t.from = function(r, o) {
|
|
116
|
+
if (t.isValid(r))
|
|
117
|
+
return r;
|
|
118
|
+
try {
|
|
119
|
+
return e(r);
|
|
120
|
+
} catch {
|
|
121
|
+
return o;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
})(ce);
|
|
125
|
+
function je() {
|
|
126
|
+
this.buffer = [], this.length = 0;
|
|
127
|
+
}
|
|
128
|
+
je.prototype = {
|
|
129
|
+
get: function(t) {
|
|
130
|
+
const e = Math.floor(t / 8);
|
|
131
|
+
return (this.buffer[e] >>> 7 - t % 8 & 1) === 1;
|
|
132
|
+
},
|
|
133
|
+
put: function(t, e) {
|
|
134
|
+
for (let i = 0; i < e; i++)
|
|
135
|
+
this.putBit((t >>> e - i - 1 & 1) === 1);
|
|
136
|
+
},
|
|
137
|
+
getLengthInBits: function() {
|
|
138
|
+
return this.length;
|
|
139
|
+
},
|
|
140
|
+
putBit: function(t) {
|
|
141
|
+
const e = Math.floor(this.length / 8);
|
|
142
|
+
this.buffer.length <= e && this.buffer.push(0), t && (this.buffer[e] |= 128 >>> this.length % 8), this.length++;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
var Et = je;
|
|
146
|
+
function te(t) {
|
|
147
|
+
if (!t || t < 1)
|
|
148
|
+
throw new Error("BitMatrix size must be defined and greater than 0");
|
|
149
|
+
this.size = t, this.data = new Uint8Array(t * t), this.reservedBit = new Uint8Array(t * t);
|
|
150
|
+
}
|
|
151
|
+
te.prototype.set = function(t, e, i, r) {
|
|
152
|
+
const o = t * this.size + e;
|
|
153
|
+
this.data[o] = i, r && (this.reservedBit[o] = !0);
|
|
154
|
+
};
|
|
155
|
+
te.prototype.get = function(t, e) {
|
|
156
|
+
return this.data[t * this.size + e];
|
|
157
|
+
};
|
|
158
|
+
te.prototype.xor = function(t, e, i) {
|
|
159
|
+
this.data[t * this.size + e] ^= i;
|
|
160
|
+
};
|
|
161
|
+
te.prototype.isReserved = function(t, e) {
|
|
162
|
+
return this.reservedBit[t * this.size + e];
|
|
163
|
+
};
|
|
164
|
+
var Bt = te, Je = {};
|
|
165
|
+
(function(t) {
|
|
166
|
+
const e = U.getSymbolSize;
|
|
167
|
+
t.getRowColCoords = function(r) {
|
|
168
|
+
if (r === 1) return [];
|
|
169
|
+
const o = Math.floor(r / 7) + 2, n = e(r), a = n === 145 ? 26 : Math.ceil((n - 13) / (2 * o - 2)) * 2, l = [n - 7];
|
|
170
|
+
for (let s = 1; s < o - 1; s++)
|
|
171
|
+
l[s] = l[s - 1] - a;
|
|
172
|
+
return l.push(6), l.reverse();
|
|
173
|
+
}, t.getPositions = function(r) {
|
|
174
|
+
const o = [], n = t.getRowColCoords(r), a = n.length;
|
|
175
|
+
for (let l = 0; l < a; l++)
|
|
176
|
+
for (let s = 0; s < a; s++)
|
|
177
|
+
l === 0 && s === 0 || // top-left
|
|
178
|
+
l === 0 && s === a - 1 || // bottom-left
|
|
179
|
+
l === a - 1 && s === 0 || o.push([n[l], n[s]]);
|
|
180
|
+
return o;
|
|
181
|
+
};
|
|
182
|
+
})(Je);
|
|
183
|
+
var qe = {};
|
|
184
|
+
const At = U.getSymbolSize, Re = 7;
|
|
185
|
+
qe.getPositions = function(e) {
|
|
186
|
+
const i = At(e);
|
|
187
|
+
return [
|
|
188
|
+
// top-left
|
|
189
|
+
[0, 0],
|
|
190
|
+
// top-right
|
|
191
|
+
[i - Re, 0],
|
|
192
|
+
// bottom-left
|
|
193
|
+
[0, i - Re]
|
|
194
|
+
];
|
|
195
|
+
};
|
|
196
|
+
var Ge = {};
|
|
197
|
+
(function(t) {
|
|
198
|
+
t.Patterns = {
|
|
199
|
+
PATTERN000: 0,
|
|
200
|
+
PATTERN001: 1,
|
|
201
|
+
PATTERN010: 2,
|
|
202
|
+
PATTERN011: 3,
|
|
203
|
+
PATTERN100: 4,
|
|
204
|
+
PATTERN101: 5,
|
|
205
|
+
PATTERN110: 6,
|
|
206
|
+
PATTERN111: 7
|
|
207
|
+
};
|
|
208
|
+
const e = {
|
|
209
|
+
N1: 3,
|
|
210
|
+
N2: 3,
|
|
211
|
+
N3: 40,
|
|
212
|
+
N4: 10
|
|
213
|
+
};
|
|
214
|
+
t.isValid = function(o) {
|
|
215
|
+
return o != null && o !== "" && !isNaN(o) && o >= 0 && o <= 7;
|
|
216
|
+
}, t.from = function(o) {
|
|
217
|
+
return t.isValid(o) ? parseInt(o, 10) : void 0;
|
|
218
|
+
}, t.getPenaltyN1 = function(o) {
|
|
219
|
+
const n = o.size;
|
|
220
|
+
let a = 0, l = 0, s = 0, u = null, f = null;
|
|
221
|
+
for (let E = 0; E < n; E++) {
|
|
222
|
+
l = s = 0, u = f = null;
|
|
223
|
+
for (let g = 0; g < n; g++) {
|
|
224
|
+
let c = o.get(E, g);
|
|
225
|
+
c === u ? l++ : (l >= 5 && (a += e.N1 + (l - 5)), u = c, l = 1), c = o.get(g, E), c === f ? s++ : (s >= 5 && (a += e.N1 + (s - 5)), f = c, s = 1);
|
|
226
|
+
}
|
|
227
|
+
l >= 5 && (a += e.N1 + (l - 5)), s >= 5 && (a += e.N1 + (s - 5));
|
|
228
|
+
}
|
|
229
|
+
return a;
|
|
230
|
+
}, t.getPenaltyN2 = function(o) {
|
|
231
|
+
const n = o.size;
|
|
232
|
+
let a = 0;
|
|
233
|
+
for (let l = 0; l < n - 1; l++)
|
|
234
|
+
for (let s = 0; s < n - 1; s++) {
|
|
235
|
+
const u = o.get(l, s) + o.get(l, s + 1) + o.get(l + 1, s) + o.get(l + 1, s + 1);
|
|
236
|
+
(u === 4 || u === 0) && a++;
|
|
237
|
+
}
|
|
238
|
+
return a * e.N2;
|
|
239
|
+
}, t.getPenaltyN3 = function(o) {
|
|
240
|
+
const n = o.size;
|
|
241
|
+
let a = 0, l = 0, s = 0;
|
|
242
|
+
for (let u = 0; u < n; u++) {
|
|
243
|
+
l = s = 0;
|
|
244
|
+
for (let f = 0; f < n; f++)
|
|
245
|
+
l = l << 1 & 2047 | o.get(u, f), f >= 10 && (l === 1488 || l === 93) && a++, s = s << 1 & 2047 | o.get(f, u), f >= 10 && (s === 1488 || s === 93) && a++;
|
|
246
|
+
}
|
|
247
|
+
return a * e.N3;
|
|
248
|
+
}, t.getPenaltyN4 = function(o) {
|
|
249
|
+
let n = 0;
|
|
250
|
+
const a = o.data.length;
|
|
251
|
+
for (let s = 0; s < a; s++) n += o.data[s];
|
|
252
|
+
return Math.abs(Math.ceil(n * 100 / a / 5) - 10) * e.N4;
|
|
253
|
+
};
|
|
254
|
+
function i(r, o, n) {
|
|
255
|
+
switch (r) {
|
|
256
|
+
case t.Patterns.PATTERN000:
|
|
257
|
+
return (o + n) % 2 === 0;
|
|
258
|
+
case t.Patterns.PATTERN001:
|
|
259
|
+
return o % 2 === 0;
|
|
260
|
+
case t.Patterns.PATTERN010:
|
|
261
|
+
return n % 3 === 0;
|
|
262
|
+
case t.Patterns.PATTERN011:
|
|
263
|
+
return (o + n) % 3 === 0;
|
|
264
|
+
case t.Patterns.PATTERN100:
|
|
265
|
+
return (Math.floor(o / 2) + Math.floor(n / 3)) % 2 === 0;
|
|
266
|
+
case t.Patterns.PATTERN101:
|
|
267
|
+
return o * n % 2 + o * n % 3 === 0;
|
|
268
|
+
case t.Patterns.PATTERN110:
|
|
269
|
+
return (o * n % 2 + o * n % 3) % 2 === 0;
|
|
270
|
+
case t.Patterns.PATTERN111:
|
|
271
|
+
return (o * n % 3 + (o + n) % 2) % 2 === 0;
|
|
272
|
+
default:
|
|
273
|
+
throw new Error("bad maskPattern:" + r);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
t.applyMask = function(o, n) {
|
|
277
|
+
const a = n.size;
|
|
278
|
+
for (let l = 0; l < a; l++)
|
|
279
|
+
for (let s = 0; s < a; s++)
|
|
280
|
+
n.isReserved(s, l) || n.xor(s, l, i(o, s, l));
|
|
281
|
+
}, t.getBestMask = function(o, n) {
|
|
282
|
+
const a = Object.keys(t.Patterns).length;
|
|
283
|
+
let l = 0, s = 1 / 0;
|
|
284
|
+
for (let u = 0; u < a; u++) {
|
|
285
|
+
n(u), t.applyMask(u, o);
|
|
286
|
+
const f = t.getPenaltyN1(o) + t.getPenaltyN2(o) + t.getPenaltyN3(o) + t.getPenaltyN4(o);
|
|
287
|
+
t.applyMask(u, o), f < s && (s = f, l = u);
|
|
288
|
+
}
|
|
289
|
+
return l;
|
|
290
|
+
};
|
|
291
|
+
})(Ge);
|
|
292
|
+
var ue = {};
|
|
293
|
+
const z = ce, re = [
|
|
294
|
+
// L M Q H
|
|
295
|
+
1,
|
|
296
|
+
1,
|
|
297
|
+
1,
|
|
298
|
+
1,
|
|
299
|
+
1,
|
|
300
|
+
1,
|
|
301
|
+
1,
|
|
302
|
+
1,
|
|
303
|
+
1,
|
|
304
|
+
1,
|
|
305
|
+
2,
|
|
306
|
+
2,
|
|
307
|
+
1,
|
|
308
|
+
2,
|
|
309
|
+
2,
|
|
310
|
+
4,
|
|
311
|
+
1,
|
|
312
|
+
2,
|
|
313
|
+
4,
|
|
314
|
+
4,
|
|
315
|
+
2,
|
|
316
|
+
4,
|
|
317
|
+
4,
|
|
318
|
+
4,
|
|
319
|
+
2,
|
|
320
|
+
4,
|
|
321
|
+
6,
|
|
322
|
+
5,
|
|
323
|
+
2,
|
|
324
|
+
4,
|
|
325
|
+
6,
|
|
326
|
+
6,
|
|
327
|
+
2,
|
|
328
|
+
5,
|
|
329
|
+
8,
|
|
330
|
+
8,
|
|
331
|
+
4,
|
|
332
|
+
5,
|
|
333
|
+
8,
|
|
334
|
+
8,
|
|
335
|
+
4,
|
|
336
|
+
5,
|
|
337
|
+
8,
|
|
338
|
+
11,
|
|
339
|
+
4,
|
|
340
|
+
8,
|
|
341
|
+
10,
|
|
342
|
+
11,
|
|
343
|
+
4,
|
|
344
|
+
9,
|
|
345
|
+
12,
|
|
346
|
+
16,
|
|
347
|
+
4,
|
|
348
|
+
9,
|
|
349
|
+
16,
|
|
350
|
+
16,
|
|
351
|
+
6,
|
|
352
|
+
10,
|
|
353
|
+
12,
|
|
354
|
+
18,
|
|
355
|
+
6,
|
|
356
|
+
10,
|
|
357
|
+
17,
|
|
358
|
+
16,
|
|
359
|
+
6,
|
|
360
|
+
11,
|
|
361
|
+
16,
|
|
362
|
+
19,
|
|
363
|
+
6,
|
|
364
|
+
13,
|
|
365
|
+
18,
|
|
366
|
+
21,
|
|
367
|
+
7,
|
|
368
|
+
14,
|
|
369
|
+
21,
|
|
370
|
+
25,
|
|
371
|
+
8,
|
|
372
|
+
16,
|
|
373
|
+
20,
|
|
374
|
+
25,
|
|
375
|
+
8,
|
|
376
|
+
17,
|
|
377
|
+
23,
|
|
378
|
+
25,
|
|
379
|
+
9,
|
|
380
|
+
17,
|
|
381
|
+
23,
|
|
382
|
+
34,
|
|
383
|
+
9,
|
|
384
|
+
18,
|
|
385
|
+
25,
|
|
386
|
+
30,
|
|
387
|
+
10,
|
|
388
|
+
20,
|
|
389
|
+
27,
|
|
390
|
+
32,
|
|
391
|
+
12,
|
|
392
|
+
21,
|
|
393
|
+
29,
|
|
394
|
+
35,
|
|
395
|
+
12,
|
|
396
|
+
23,
|
|
397
|
+
34,
|
|
398
|
+
37,
|
|
399
|
+
12,
|
|
400
|
+
25,
|
|
401
|
+
34,
|
|
402
|
+
40,
|
|
403
|
+
13,
|
|
404
|
+
26,
|
|
405
|
+
35,
|
|
406
|
+
42,
|
|
407
|
+
14,
|
|
408
|
+
28,
|
|
409
|
+
38,
|
|
410
|
+
45,
|
|
411
|
+
15,
|
|
412
|
+
29,
|
|
413
|
+
40,
|
|
414
|
+
48,
|
|
415
|
+
16,
|
|
416
|
+
31,
|
|
417
|
+
43,
|
|
418
|
+
51,
|
|
419
|
+
17,
|
|
420
|
+
33,
|
|
421
|
+
45,
|
|
422
|
+
54,
|
|
423
|
+
18,
|
|
424
|
+
35,
|
|
425
|
+
48,
|
|
426
|
+
57,
|
|
427
|
+
19,
|
|
428
|
+
37,
|
|
429
|
+
51,
|
|
430
|
+
60,
|
|
431
|
+
19,
|
|
432
|
+
38,
|
|
433
|
+
53,
|
|
434
|
+
63,
|
|
435
|
+
20,
|
|
436
|
+
40,
|
|
437
|
+
56,
|
|
438
|
+
66,
|
|
439
|
+
21,
|
|
440
|
+
43,
|
|
441
|
+
59,
|
|
442
|
+
70,
|
|
443
|
+
22,
|
|
444
|
+
45,
|
|
445
|
+
62,
|
|
446
|
+
74,
|
|
447
|
+
24,
|
|
448
|
+
47,
|
|
449
|
+
65,
|
|
450
|
+
77,
|
|
451
|
+
25,
|
|
452
|
+
49,
|
|
453
|
+
68,
|
|
454
|
+
81
|
|
455
|
+
], ie = [
|
|
456
|
+
// L M Q H
|
|
457
|
+
7,
|
|
458
|
+
10,
|
|
459
|
+
13,
|
|
460
|
+
17,
|
|
461
|
+
10,
|
|
462
|
+
16,
|
|
463
|
+
22,
|
|
464
|
+
28,
|
|
465
|
+
15,
|
|
466
|
+
26,
|
|
467
|
+
36,
|
|
468
|
+
44,
|
|
469
|
+
20,
|
|
470
|
+
36,
|
|
471
|
+
52,
|
|
472
|
+
64,
|
|
473
|
+
26,
|
|
474
|
+
48,
|
|
475
|
+
72,
|
|
476
|
+
88,
|
|
477
|
+
36,
|
|
478
|
+
64,
|
|
479
|
+
96,
|
|
480
|
+
112,
|
|
481
|
+
40,
|
|
482
|
+
72,
|
|
483
|
+
108,
|
|
484
|
+
130,
|
|
485
|
+
48,
|
|
486
|
+
88,
|
|
487
|
+
132,
|
|
488
|
+
156,
|
|
489
|
+
60,
|
|
490
|
+
110,
|
|
491
|
+
160,
|
|
492
|
+
192,
|
|
493
|
+
72,
|
|
494
|
+
130,
|
|
495
|
+
192,
|
|
496
|
+
224,
|
|
497
|
+
80,
|
|
498
|
+
150,
|
|
499
|
+
224,
|
|
500
|
+
264,
|
|
501
|
+
96,
|
|
502
|
+
176,
|
|
503
|
+
260,
|
|
504
|
+
308,
|
|
505
|
+
104,
|
|
506
|
+
198,
|
|
507
|
+
288,
|
|
508
|
+
352,
|
|
509
|
+
120,
|
|
510
|
+
216,
|
|
511
|
+
320,
|
|
512
|
+
384,
|
|
513
|
+
132,
|
|
514
|
+
240,
|
|
515
|
+
360,
|
|
516
|
+
432,
|
|
517
|
+
144,
|
|
518
|
+
280,
|
|
519
|
+
408,
|
|
520
|
+
480,
|
|
521
|
+
168,
|
|
522
|
+
308,
|
|
523
|
+
448,
|
|
524
|
+
532,
|
|
525
|
+
180,
|
|
526
|
+
338,
|
|
527
|
+
504,
|
|
528
|
+
588,
|
|
529
|
+
196,
|
|
530
|
+
364,
|
|
531
|
+
546,
|
|
532
|
+
650,
|
|
533
|
+
224,
|
|
534
|
+
416,
|
|
535
|
+
600,
|
|
536
|
+
700,
|
|
537
|
+
224,
|
|
538
|
+
442,
|
|
539
|
+
644,
|
|
540
|
+
750,
|
|
541
|
+
252,
|
|
542
|
+
476,
|
|
543
|
+
690,
|
|
544
|
+
816,
|
|
545
|
+
270,
|
|
546
|
+
504,
|
|
547
|
+
750,
|
|
548
|
+
900,
|
|
549
|
+
300,
|
|
550
|
+
560,
|
|
551
|
+
810,
|
|
552
|
+
960,
|
|
553
|
+
312,
|
|
554
|
+
588,
|
|
555
|
+
870,
|
|
556
|
+
1050,
|
|
557
|
+
336,
|
|
558
|
+
644,
|
|
559
|
+
952,
|
|
560
|
+
1110,
|
|
561
|
+
360,
|
|
562
|
+
700,
|
|
563
|
+
1020,
|
|
564
|
+
1200,
|
|
565
|
+
390,
|
|
566
|
+
728,
|
|
567
|
+
1050,
|
|
568
|
+
1260,
|
|
569
|
+
420,
|
|
570
|
+
784,
|
|
571
|
+
1140,
|
|
572
|
+
1350,
|
|
573
|
+
450,
|
|
574
|
+
812,
|
|
575
|
+
1200,
|
|
576
|
+
1440,
|
|
577
|
+
480,
|
|
578
|
+
868,
|
|
579
|
+
1290,
|
|
580
|
+
1530,
|
|
581
|
+
510,
|
|
582
|
+
924,
|
|
583
|
+
1350,
|
|
584
|
+
1620,
|
|
585
|
+
540,
|
|
586
|
+
980,
|
|
587
|
+
1440,
|
|
588
|
+
1710,
|
|
589
|
+
570,
|
|
590
|
+
1036,
|
|
591
|
+
1530,
|
|
592
|
+
1800,
|
|
593
|
+
570,
|
|
594
|
+
1064,
|
|
595
|
+
1590,
|
|
596
|
+
1890,
|
|
597
|
+
600,
|
|
598
|
+
1120,
|
|
599
|
+
1680,
|
|
600
|
+
1980,
|
|
601
|
+
630,
|
|
602
|
+
1204,
|
|
603
|
+
1770,
|
|
604
|
+
2100,
|
|
605
|
+
660,
|
|
606
|
+
1260,
|
|
607
|
+
1860,
|
|
608
|
+
2220,
|
|
609
|
+
720,
|
|
610
|
+
1316,
|
|
611
|
+
1950,
|
|
612
|
+
2310,
|
|
613
|
+
750,
|
|
614
|
+
1372,
|
|
615
|
+
2040,
|
|
616
|
+
2430
|
|
617
|
+
];
|
|
618
|
+
ue.getBlocksCount = function(e, i) {
|
|
619
|
+
switch (i) {
|
|
620
|
+
case z.L:
|
|
621
|
+
return re[(e - 1) * 4 + 0];
|
|
622
|
+
case z.M:
|
|
623
|
+
return re[(e - 1) * 4 + 1];
|
|
624
|
+
case z.Q:
|
|
625
|
+
return re[(e - 1) * 4 + 2];
|
|
626
|
+
case z.H:
|
|
627
|
+
return re[(e - 1) * 4 + 3];
|
|
628
|
+
default:
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
ue.getTotalCodewordsCount = function(e, i) {
|
|
633
|
+
switch (i) {
|
|
634
|
+
case z.L:
|
|
635
|
+
return ie[(e - 1) * 4 + 0];
|
|
636
|
+
case z.M:
|
|
637
|
+
return ie[(e - 1) * 4 + 1];
|
|
638
|
+
case z.Q:
|
|
639
|
+
return ie[(e - 1) * 4 + 2];
|
|
640
|
+
case z.H:
|
|
641
|
+
return ie[(e - 1) * 4 + 3];
|
|
642
|
+
default:
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
var Qe = {}, de = {};
|
|
647
|
+
const W = new Uint8Array(512), ae = new Uint8Array(256);
|
|
648
|
+
(function() {
|
|
649
|
+
let e = 1;
|
|
650
|
+
for (let i = 0; i < 255; i++)
|
|
651
|
+
W[i] = e, ae[e] = i, e <<= 1, e & 256 && (e ^= 285);
|
|
652
|
+
for (let i = 255; i < 512; i++)
|
|
653
|
+
W[i] = W[i - 255];
|
|
654
|
+
})();
|
|
655
|
+
de.log = function(e) {
|
|
656
|
+
if (e < 1) throw new Error("log(" + e + ")");
|
|
657
|
+
return ae[e];
|
|
658
|
+
};
|
|
659
|
+
de.exp = function(e) {
|
|
660
|
+
return W[e];
|
|
661
|
+
};
|
|
662
|
+
de.mul = function(e, i) {
|
|
663
|
+
return e === 0 || i === 0 ? 0 : W[ae[e] + ae[i]];
|
|
664
|
+
};
|
|
665
|
+
(function(t) {
|
|
666
|
+
const e = de;
|
|
667
|
+
t.mul = function(r, o) {
|
|
668
|
+
const n = new Uint8Array(r.length + o.length - 1);
|
|
669
|
+
for (let a = 0; a < r.length; a++)
|
|
670
|
+
for (let l = 0; l < o.length; l++)
|
|
671
|
+
n[a + l] ^= e.mul(r[a], o[l]);
|
|
672
|
+
return n;
|
|
673
|
+
}, t.mod = function(r, o) {
|
|
674
|
+
let n = new Uint8Array(r);
|
|
675
|
+
for (; n.length - o.length >= 0; ) {
|
|
676
|
+
const a = n[0];
|
|
677
|
+
for (let s = 0; s < o.length; s++)
|
|
678
|
+
n[s] ^= e.mul(o[s], a);
|
|
679
|
+
let l = 0;
|
|
680
|
+
for (; l < n.length && n[l] === 0; ) l++;
|
|
681
|
+
n = n.slice(l);
|
|
682
|
+
}
|
|
683
|
+
return n;
|
|
684
|
+
}, t.generateECPolynomial = function(r) {
|
|
685
|
+
let o = new Uint8Array([1]);
|
|
686
|
+
for (let n = 0; n < r; n++)
|
|
687
|
+
o = t.mul(o, new Uint8Array([1, e.exp(n)]));
|
|
688
|
+
return o;
|
|
689
|
+
};
|
|
690
|
+
})(Qe);
|
|
691
|
+
const Xe = Qe;
|
|
692
|
+
function Me(t) {
|
|
693
|
+
this.genPoly = void 0, this.degree = t, this.degree && this.initialize(this.degree);
|
|
694
|
+
}
|
|
695
|
+
Me.prototype.initialize = function(e) {
|
|
696
|
+
this.degree = e, this.genPoly = Xe.generateECPolynomial(this.degree);
|
|
697
|
+
};
|
|
698
|
+
Me.prototype.encode = function(e) {
|
|
699
|
+
if (!this.genPoly)
|
|
700
|
+
throw new Error("Encoder not initialized");
|
|
701
|
+
const i = new Uint8Array(e.length + this.degree);
|
|
702
|
+
i.set(e);
|
|
703
|
+
const r = Xe.mod(i, this.genPoly), o = this.degree - r.length;
|
|
704
|
+
if (o > 0) {
|
|
705
|
+
const n = new Uint8Array(this.degree);
|
|
706
|
+
return n.set(r, o), n;
|
|
707
|
+
}
|
|
708
|
+
return r;
|
|
709
|
+
};
|
|
710
|
+
var Mt = Me, We = {}, H = {}, Se = {};
|
|
711
|
+
Se.isValid = function(e) {
|
|
712
|
+
return !isNaN(e) && e >= 1 && e <= 40;
|
|
713
|
+
};
|
|
714
|
+
var k = {};
|
|
715
|
+
const Ze = "[0-9]+", St = "[A-Z $%*+\\-./:]+";
|
|
716
|
+
let Z = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
717
|
+
Z = Z.replace(/u/g, "\\u");
|
|
718
|
+
const It = "(?:(?![A-Z0-9 $%*+\\-./:]|" + Z + `)(?:.|[\r
|
|
719
|
+
]))+`;
|
|
720
|
+
k.KANJI = new RegExp(Z, "g");
|
|
721
|
+
k.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
|
|
722
|
+
k.BYTE = new RegExp(It, "g");
|
|
723
|
+
k.NUMERIC = new RegExp(Ze, "g");
|
|
724
|
+
k.ALPHANUMERIC = new RegExp(St, "g");
|
|
725
|
+
const Tt = new RegExp("^" + Z + "$"), Pt = new RegExp("^" + Ze + "$"), Nt = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
726
|
+
k.testKanji = function(e) {
|
|
727
|
+
return Tt.test(e);
|
|
728
|
+
};
|
|
729
|
+
k.testNumeric = function(e) {
|
|
730
|
+
return Pt.test(e);
|
|
731
|
+
};
|
|
732
|
+
k.testAlphanumeric = function(e) {
|
|
733
|
+
return Nt.test(e);
|
|
734
|
+
};
|
|
735
|
+
(function(t) {
|
|
736
|
+
const e = Se, i = k;
|
|
737
|
+
t.NUMERIC = {
|
|
738
|
+
id: "Numeric",
|
|
739
|
+
bit: 1,
|
|
740
|
+
ccBits: [10, 12, 14]
|
|
741
|
+
}, t.ALPHANUMERIC = {
|
|
742
|
+
id: "Alphanumeric",
|
|
743
|
+
bit: 2,
|
|
744
|
+
ccBits: [9, 11, 13]
|
|
745
|
+
}, t.BYTE = {
|
|
746
|
+
id: "Byte",
|
|
747
|
+
bit: 4,
|
|
748
|
+
ccBits: [8, 16, 16]
|
|
749
|
+
}, t.KANJI = {
|
|
750
|
+
id: "Kanji",
|
|
751
|
+
bit: 8,
|
|
752
|
+
ccBits: [8, 10, 12]
|
|
753
|
+
}, t.MIXED = {
|
|
754
|
+
bit: -1
|
|
755
|
+
}, t.getCharCountIndicator = function(n, a) {
|
|
756
|
+
if (!n.ccBits) throw new Error("Invalid mode: " + n);
|
|
757
|
+
if (!e.isValid(a))
|
|
758
|
+
throw new Error("Invalid version: " + a);
|
|
759
|
+
return a >= 1 && a < 10 ? n.ccBits[0] : a < 27 ? n.ccBits[1] : n.ccBits[2];
|
|
760
|
+
}, t.getBestModeForData = function(n) {
|
|
761
|
+
return i.testNumeric(n) ? t.NUMERIC : i.testAlphanumeric(n) ? t.ALPHANUMERIC : i.testKanji(n) ? t.KANJI : t.BYTE;
|
|
762
|
+
}, t.toString = function(n) {
|
|
763
|
+
if (n && n.id) return n.id;
|
|
764
|
+
throw new Error("Invalid mode");
|
|
765
|
+
}, t.isValid = function(n) {
|
|
766
|
+
return n && n.bit && n.ccBits;
|
|
767
|
+
};
|
|
768
|
+
function r(o) {
|
|
769
|
+
if (typeof o != "string")
|
|
770
|
+
throw new Error("Param is not a string");
|
|
771
|
+
switch (o.toLowerCase()) {
|
|
772
|
+
case "numeric":
|
|
773
|
+
return t.NUMERIC;
|
|
774
|
+
case "alphanumeric":
|
|
775
|
+
return t.ALPHANUMERIC;
|
|
776
|
+
case "kanji":
|
|
777
|
+
return t.KANJI;
|
|
778
|
+
case "byte":
|
|
779
|
+
return t.BYTE;
|
|
780
|
+
default:
|
|
781
|
+
throw new Error("Unknown mode: " + o);
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
t.from = function(n, a) {
|
|
785
|
+
if (t.isValid(n))
|
|
786
|
+
return n;
|
|
787
|
+
try {
|
|
788
|
+
return r(n);
|
|
789
|
+
} catch {
|
|
790
|
+
return a;
|
|
791
|
+
}
|
|
792
|
+
};
|
|
793
|
+
})(H);
|
|
794
|
+
(function(t) {
|
|
795
|
+
const e = U, i = ue, r = ce, o = H, n = Se, a = 7973, l = e.getBCHDigit(a);
|
|
796
|
+
function s(g, c, b) {
|
|
797
|
+
for (let _ = 1; _ <= 40; _++)
|
|
798
|
+
if (c <= t.getCapacity(_, b, g))
|
|
799
|
+
return _;
|
|
800
|
+
}
|
|
801
|
+
function u(g, c) {
|
|
802
|
+
return o.getCharCountIndicator(g, c) + 4;
|
|
803
|
+
}
|
|
804
|
+
function f(g, c) {
|
|
805
|
+
let b = 0;
|
|
806
|
+
return g.forEach(function(_) {
|
|
807
|
+
const M = u(_.mode, c);
|
|
808
|
+
b += M + _.getBitsLength();
|
|
809
|
+
}), b;
|
|
810
|
+
}
|
|
811
|
+
function E(g, c) {
|
|
812
|
+
for (let b = 1; b <= 40; b++)
|
|
813
|
+
if (f(g, b) <= t.getCapacity(b, c, o.MIXED))
|
|
814
|
+
return b;
|
|
815
|
+
}
|
|
816
|
+
t.from = function(c, b) {
|
|
817
|
+
return n.isValid(c) ? parseInt(c, 10) : b;
|
|
818
|
+
}, t.getCapacity = function(c, b, _) {
|
|
819
|
+
if (!n.isValid(c))
|
|
820
|
+
throw new Error("Invalid QR Code version");
|
|
821
|
+
typeof _ > "u" && (_ = o.BYTE);
|
|
822
|
+
const M = e.getSymbolTotalCodewords(c), y = i.getTotalCodewordsCount(c, b), v = (M - y) * 8;
|
|
823
|
+
if (_ === o.MIXED) return v;
|
|
824
|
+
const w = v - u(_, c);
|
|
825
|
+
switch (_) {
|
|
826
|
+
case o.NUMERIC:
|
|
827
|
+
return Math.floor(w / 10 * 3);
|
|
828
|
+
case o.ALPHANUMERIC:
|
|
829
|
+
return Math.floor(w / 11 * 2);
|
|
830
|
+
case o.KANJI:
|
|
831
|
+
return Math.floor(w / 13);
|
|
832
|
+
case o.BYTE:
|
|
833
|
+
default:
|
|
834
|
+
return Math.floor(w / 8);
|
|
835
|
+
}
|
|
836
|
+
}, t.getBestVersionForData = function(c, b) {
|
|
837
|
+
let _;
|
|
838
|
+
const M = r.from(b, r.M);
|
|
839
|
+
if (Array.isArray(c)) {
|
|
840
|
+
if (c.length > 1)
|
|
841
|
+
return E(c, M);
|
|
842
|
+
if (c.length === 0)
|
|
843
|
+
return 1;
|
|
844
|
+
_ = c[0];
|
|
845
|
+
} else
|
|
846
|
+
_ = c;
|
|
847
|
+
return s(_.mode, _.getLength(), M);
|
|
848
|
+
}, t.getEncodedBits = function(c) {
|
|
849
|
+
if (!n.isValid(c) || c < 7)
|
|
850
|
+
throw new Error("Invalid QR Code version");
|
|
851
|
+
let b = c << 12;
|
|
852
|
+
for (; e.getBCHDigit(b) - l >= 0; )
|
|
853
|
+
b ^= a << e.getBCHDigit(b) - l;
|
|
854
|
+
return c << 12 | b;
|
|
855
|
+
};
|
|
856
|
+
})(We);
|
|
857
|
+
var et = {};
|
|
858
|
+
const Ce = U, tt = 1335, Ut = 21522, De = Ce.getBCHDigit(tt);
|
|
859
|
+
et.getEncodedBits = function(e, i) {
|
|
860
|
+
const r = e.bit << 3 | i;
|
|
861
|
+
let o = r << 10;
|
|
862
|
+
for (; Ce.getBCHDigit(o) - De >= 0; )
|
|
863
|
+
o ^= tt << Ce.getBCHDigit(o) - De;
|
|
864
|
+
return (r << 10 | o) ^ Ut;
|
|
865
|
+
};
|
|
866
|
+
var nt = {};
|
|
867
|
+
const Lt = H;
|
|
868
|
+
function Y(t) {
|
|
869
|
+
this.mode = Lt.NUMERIC, this.data = t.toString();
|
|
870
|
+
}
|
|
871
|
+
Y.getBitsLength = function(e) {
|
|
872
|
+
return 10 * Math.floor(e / 3) + (e % 3 ? e % 3 * 3 + 1 : 0);
|
|
873
|
+
};
|
|
874
|
+
Y.prototype.getLength = function() {
|
|
875
|
+
return this.data.length;
|
|
876
|
+
};
|
|
877
|
+
Y.prototype.getBitsLength = function() {
|
|
878
|
+
return Y.getBitsLength(this.data.length);
|
|
879
|
+
};
|
|
880
|
+
Y.prototype.write = function(e) {
|
|
881
|
+
let i, r, o;
|
|
882
|
+
for (i = 0; i + 3 <= this.data.length; i += 3)
|
|
883
|
+
r = this.data.substr(i, 3), o = parseInt(r, 10), e.put(o, 10);
|
|
884
|
+
const n = this.data.length - i;
|
|
885
|
+
n > 0 && (r = this.data.substr(i), o = parseInt(r, 10), e.put(o, n * 3 + 1));
|
|
886
|
+
};
|
|
887
|
+
var Ft = Y;
|
|
888
|
+
const Rt = H, me = [
|
|
889
|
+
"0",
|
|
890
|
+
"1",
|
|
891
|
+
"2",
|
|
892
|
+
"3",
|
|
893
|
+
"4",
|
|
894
|
+
"5",
|
|
895
|
+
"6",
|
|
896
|
+
"7",
|
|
897
|
+
"8",
|
|
898
|
+
"9",
|
|
899
|
+
"A",
|
|
900
|
+
"B",
|
|
901
|
+
"C",
|
|
902
|
+
"D",
|
|
903
|
+
"E",
|
|
904
|
+
"F",
|
|
905
|
+
"G",
|
|
906
|
+
"H",
|
|
907
|
+
"I",
|
|
908
|
+
"J",
|
|
909
|
+
"K",
|
|
910
|
+
"L",
|
|
911
|
+
"M",
|
|
912
|
+
"N",
|
|
913
|
+
"O",
|
|
914
|
+
"P",
|
|
915
|
+
"Q",
|
|
916
|
+
"R",
|
|
917
|
+
"S",
|
|
918
|
+
"T",
|
|
919
|
+
"U",
|
|
920
|
+
"V",
|
|
921
|
+
"W",
|
|
922
|
+
"X",
|
|
923
|
+
"Y",
|
|
924
|
+
"Z",
|
|
925
|
+
" ",
|
|
926
|
+
"$",
|
|
927
|
+
"%",
|
|
928
|
+
"*",
|
|
929
|
+
"+",
|
|
930
|
+
"-",
|
|
931
|
+
".",
|
|
932
|
+
"/",
|
|
933
|
+
":"
|
|
934
|
+
];
|
|
935
|
+
function j(t) {
|
|
936
|
+
this.mode = Rt.ALPHANUMERIC, this.data = t;
|
|
937
|
+
}
|
|
938
|
+
j.getBitsLength = function(e) {
|
|
939
|
+
return 11 * Math.floor(e / 2) + 6 * (e % 2);
|
|
940
|
+
};
|
|
941
|
+
j.prototype.getLength = function() {
|
|
942
|
+
return this.data.length;
|
|
943
|
+
};
|
|
944
|
+
j.prototype.getBitsLength = function() {
|
|
945
|
+
return j.getBitsLength(this.data.length);
|
|
946
|
+
};
|
|
947
|
+
j.prototype.write = function(e) {
|
|
948
|
+
let i;
|
|
949
|
+
for (i = 0; i + 2 <= this.data.length; i += 2) {
|
|
950
|
+
let r = me.indexOf(this.data[i]) * 45;
|
|
951
|
+
r += me.indexOf(this.data[i + 1]), e.put(r, 11);
|
|
952
|
+
}
|
|
953
|
+
this.data.length % 2 && e.put(me.indexOf(this.data[i]), 6);
|
|
954
|
+
};
|
|
955
|
+
var Dt = j, kt = function(e) {
|
|
956
|
+
for (var i = [], r = e.length, o = 0; o < r; o++) {
|
|
957
|
+
var n = e.charCodeAt(o);
|
|
958
|
+
if (n >= 55296 && n <= 56319 && r > o + 1) {
|
|
959
|
+
var a = e.charCodeAt(o + 1);
|
|
960
|
+
a >= 56320 && a <= 57343 && (n = (n - 55296) * 1024 + a - 56320 + 65536, o += 1);
|
|
961
|
+
}
|
|
962
|
+
if (n < 128) {
|
|
963
|
+
i.push(n);
|
|
964
|
+
continue;
|
|
965
|
+
}
|
|
966
|
+
if (n < 2048) {
|
|
967
|
+
i.push(n >> 6 | 192), i.push(n & 63 | 128);
|
|
968
|
+
continue;
|
|
969
|
+
}
|
|
970
|
+
if (n < 55296 || n >= 57344 && n < 65536) {
|
|
971
|
+
i.push(n >> 12 | 224), i.push(n >> 6 & 63 | 128), i.push(n & 63 | 128);
|
|
972
|
+
continue;
|
|
973
|
+
}
|
|
974
|
+
if (n >= 65536 && n <= 1114111) {
|
|
975
|
+
i.push(n >> 18 | 240), i.push(n >> 12 & 63 | 128), i.push(n >> 6 & 63 | 128), i.push(n & 63 | 128);
|
|
976
|
+
continue;
|
|
977
|
+
}
|
|
978
|
+
i.push(239, 191, 189);
|
|
979
|
+
}
|
|
980
|
+
return new Uint8Array(i).buffer;
|
|
981
|
+
};
|
|
982
|
+
const Vt = kt, xt = H;
|
|
983
|
+
function J(t) {
|
|
984
|
+
this.mode = xt.BYTE, typeof t == "string" && (t = Vt(t)), this.data = new Uint8Array(t);
|
|
985
|
+
}
|
|
986
|
+
J.getBitsLength = function(e) {
|
|
987
|
+
return e * 8;
|
|
988
|
+
};
|
|
989
|
+
J.prototype.getLength = function() {
|
|
990
|
+
return this.data.length;
|
|
991
|
+
};
|
|
992
|
+
J.prototype.getBitsLength = function() {
|
|
993
|
+
return J.getBitsLength(this.data.length);
|
|
994
|
+
};
|
|
995
|
+
J.prototype.write = function(t) {
|
|
996
|
+
for (let e = 0, i = this.data.length; e < i; e++)
|
|
997
|
+
t.put(this.data[e], 8);
|
|
998
|
+
};
|
|
999
|
+
var $t = J;
|
|
1000
|
+
const zt = H, Ht = U;
|
|
1001
|
+
function q(t) {
|
|
1002
|
+
this.mode = zt.KANJI, this.data = t;
|
|
1003
|
+
}
|
|
1004
|
+
q.getBitsLength = function(e) {
|
|
1005
|
+
return e * 13;
|
|
1006
|
+
};
|
|
1007
|
+
q.prototype.getLength = function() {
|
|
1008
|
+
return this.data.length;
|
|
1009
|
+
};
|
|
1010
|
+
q.prototype.getBitsLength = function() {
|
|
1011
|
+
return q.getBitsLength(this.data.length);
|
|
1012
|
+
};
|
|
1013
|
+
q.prototype.write = function(t) {
|
|
1014
|
+
let e;
|
|
1015
|
+
for (e = 0; e < this.data.length; e++) {
|
|
1016
|
+
let i = Ht.toSJIS(this.data[e]);
|
|
1017
|
+
if (i >= 33088 && i <= 40956)
|
|
1018
|
+
i -= 33088;
|
|
1019
|
+
else if (i >= 57408 && i <= 60351)
|
|
1020
|
+
i -= 49472;
|
|
1021
|
+
else
|
|
1022
|
+
throw new Error(
|
|
1023
|
+
"Invalid SJIS character: " + this.data[e] + `
|
|
1024
|
+
Make sure your charset is UTF-8`
|
|
1025
|
+
);
|
|
1026
|
+
i = (i >>> 8 & 255) * 192 + (i & 255), t.put(i, 13);
|
|
1027
|
+
}
|
|
1028
|
+
};
|
|
1029
|
+
var Kt = q, ot = { exports: {} };
|
|
1030
|
+
(function(t) {
|
|
1031
|
+
var e = {
|
|
1032
|
+
single_source_shortest_paths: function(i, r, o) {
|
|
1033
|
+
var n = {}, a = {};
|
|
1034
|
+
a[r] = 0;
|
|
1035
|
+
var l = e.PriorityQueue.make();
|
|
1036
|
+
l.push(r, 0);
|
|
1037
|
+
for (var s, u, f, E, g, c, b, _, M; !l.empty(); ) {
|
|
1038
|
+
s = l.pop(), u = s.value, E = s.cost, g = i[u] || {};
|
|
1039
|
+
for (f in g)
|
|
1040
|
+
g.hasOwnProperty(f) && (c = g[f], b = E + c, _ = a[f], M = typeof a[f] > "u", (M || _ > b) && (a[f] = b, l.push(f, b), n[f] = u));
|
|
1041
|
+
}
|
|
1042
|
+
if (typeof o < "u" && typeof a[o] > "u") {
|
|
1043
|
+
var y = ["Could not find a path from ", r, " to ", o, "."].join("");
|
|
1044
|
+
throw new Error(y);
|
|
1045
|
+
}
|
|
1046
|
+
return n;
|
|
1047
|
+
},
|
|
1048
|
+
extract_shortest_path_from_predecessor_list: function(i, r) {
|
|
1049
|
+
for (var o = [], n = r; n; )
|
|
1050
|
+
o.push(n), i[n], n = i[n];
|
|
1051
|
+
return o.reverse(), o;
|
|
1052
|
+
},
|
|
1053
|
+
find_path: function(i, r, o) {
|
|
1054
|
+
var n = e.single_source_shortest_paths(i, r, o);
|
|
1055
|
+
return e.extract_shortest_path_from_predecessor_list(
|
|
1056
|
+
n,
|
|
1057
|
+
o
|
|
1058
|
+
);
|
|
1059
|
+
},
|
|
1060
|
+
/**
|
|
1061
|
+
* A very naive priority queue implementation.
|
|
1062
|
+
*/
|
|
1063
|
+
PriorityQueue: {
|
|
1064
|
+
make: function(i) {
|
|
1065
|
+
var r = e.PriorityQueue, o = {}, n;
|
|
1066
|
+
i = i || {};
|
|
1067
|
+
for (n in r)
|
|
1068
|
+
r.hasOwnProperty(n) && (o[n] = r[n]);
|
|
1069
|
+
return o.queue = [], o.sorter = i.sorter || r.default_sorter, o;
|
|
1070
|
+
},
|
|
1071
|
+
default_sorter: function(i, r) {
|
|
1072
|
+
return i.cost - r.cost;
|
|
1073
|
+
},
|
|
1074
|
+
/**
|
|
1075
|
+
* Add a new item to the queue and ensure the highest priority element
|
|
1076
|
+
* is at the front of the queue.
|
|
1077
|
+
*/
|
|
1078
|
+
push: function(i, r) {
|
|
1079
|
+
var o = { value: i, cost: r };
|
|
1080
|
+
this.queue.push(o), this.queue.sort(this.sorter);
|
|
1081
|
+
},
|
|
1082
|
+
/**
|
|
1083
|
+
* Return the highest priority element in the queue.
|
|
1084
|
+
*/
|
|
1085
|
+
pop: function() {
|
|
1086
|
+
return this.queue.shift();
|
|
1087
|
+
},
|
|
1088
|
+
empty: function() {
|
|
1089
|
+
return this.queue.length === 0;
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1093
|
+
t.exports = e;
|
|
1094
|
+
})(ot);
|
|
1095
|
+
var Ot = ot.exports;
|
|
1096
|
+
(function(t) {
|
|
1097
|
+
const e = H, i = Ft, r = Dt, o = $t, n = Kt, a = k, l = U, s = Ot;
|
|
1098
|
+
function u(y) {
|
|
1099
|
+
return unescape(encodeURIComponent(y)).length;
|
|
1100
|
+
}
|
|
1101
|
+
function f(y, v, w) {
|
|
1102
|
+
const h = [];
|
|
1103
|
+
let A;
|
|
1104
|
+
for (; (A = y.exec(w)) !== null; )
|
|
1105
|
+
h.push({
|
|
1106
|
+
data: A[0],
|
|
1107
|
+
index: A.index,
|
|
1108
|
+
mode: v,
|
|
1109
|
+
length: A[0].length
|
|
1110
|
+
});
|
|
1111
|
+
return h;
|
|
1112
|
+
}
|
|
1113
|
+
function E(y) {
|
|
1114
|
+
const v = f(a.NUMERIC, e.NUMERIC, y), w = f(a.ALPHANUMERIC, e.ALPHANUMERIC, y);
|
|
1115
|
+
let h, A;
|
|
1116
|
+
return l.isKanjiModeEnabled() ? (h = f(a.BYTE, e.BYTE, y), A = f(a.KANJI, e.KANJI, y)) : (h = f(a.BYTE_KANJI, e.BYTE, y), A = []), v.concat(w, h, A).sort(function(m, P) {
|
|
1117
|
+
return m.index - P.index;
|
|
1118
|
+
}).map(function(m) {
|
|
1119
|
+
return {
|
|
1120
|
+
data: m.data,
|
|
1121
|
+
mode: m.mode,
|
|
1122
|
+
length: m.length
|
|
1123
|
+
};
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
function g(y, v) {
|
|
1127
|
+
switch (v) {
|
|
1128
|
+
case e.NUMERIC:
|
|
1129
|
+
return i.getBitsLength(y);
|
|
1130
|
+
case e.ALPHANUMERIC:
|
|
1131
|
+
return r.getBitsLength(y);
|
|
1132
|
+
case e.KANJI:
|
|
1133
|
+
return n.getBitsLength(y);
|
|
1134
|
+
case e.BYTE:
|
|
1135
|
+
return o.getBitsLength(y);
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
function c(y) {
|
|
1139
|
+
return y.reduce(function(v, w) {
|
|
1140
|
+
const h = v.length - 1 >= 0 ? v[v.length - 1] : null;
|
|
1141
|
+
return h && h.mode === w.mode ? (v[v.length - 1].data += w.data, v) : (v.push(w), v);
|
|
1142
|
+
}, []);
|
|
1143
|
+
}
|
|
1144
|
+
function b(y) {
|
|
1145
|
+
const v = [];
|
|
1146
|
+
for (let w = 0; w < y.length; w++) {
|
|
1147
|
+
const h = y[w];
|
|
1148
|
+
switch (h.mode) {
|
|
1149
|
+
case e.NUMERIC:
|
|
1150
|
+
v.push([
|
|
1151
|
+
h,
|
|
1152
|
+
{ data: h.data, mode: e.ALPHANUMERIC, length: h.length },
|
|
1153
|
+
{ data: h.data, mode: e.BYTE, length: h.length }
|
|
1154
|
+
]);
|
|
1155
|
+
break;
|
|
1156
|
+
case e.ALPHANUMERIC:
|
|
1157
|
+
v.push([
|
|
1158
|
+
h,
|
|
1159
|
+
{ data: h.data, mode: e.BYTE, length: h.length }
|
|
1160
|
+
]);
|
|
1161
|
+
break;
|
|
1162
|
+
case e.KANJI:
|
|
1163
|
+
v.push([
|
|
1164
|
+
h,
|
|
1165
|
+
{ data: h.data, mode: e.BYTE, length: u(h.data) }
|
|
1166
|
+
]);
|
|
1167
|
+
break;
|
|
1168
|
+
case e.BYTE:
|
|
1169
|
+
v.push([
|
|
1170
|
+
{ data: h.data, mode: e.BYTE, length: u(h.data) }
|
|
1171
|
+
]);
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
return v;
|
|
1175
|
+
}
|
|
1176
|
+
function _(y, v) {
|
|
1177
|
+
const w = {}, h = { start: {} };
|
|
1178
|
+
let A = ["start"];
|
|
1179
|
+
for (let p = 0; p < y.length; p++) {
|
|
1180
|
+
const m = y[p], P = [];
|
|
1181
|
+
for (let T = 0; T < m.length; T++) {
|
|
1182
|
+
const I = m[T], L = "" + p + T;
|
|
1183
|
+
P.push(L), w[L] = { node: I, lastCount: 0 }, h[L] = {};
|
|
1184
|
+
for (let V = 0; V < A.length; V++) {
|
|
1185
|
+
const N = A[V];
|
|
1186
|
+
w[N] && w[N].node.mode === I.mode ? (h[N][L] = g(w[N].lastCount + I.length, I.mode) - g(w[N].lastCount, I.mode), w[N].lastCount += I.length) : (w[N] && (w[N].lastCount = I.length), h[N][L] = g(I.length, I.mode) + 4 + e.getCharCountIndicator(I.mode, v));
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
A = P;
|
|
1190
|
+
}
|
|
1191
|
+
for (let p = 0; p < A.length; p++)
|
|
1192
|
+
h[A[p]].end = 0;
|
|
1193
|
+
return { map: h, table: w };
|
|
1194
|
+
}
|
|
1195
|
+
function M(y, v) {
|
|
1196
|
+
let w;
|
|
1197
|
+
const h = e.getBestModeForData(y);
|
|
1198
|
+
if (w = e.from(v, h), w !== e.BYTE && w.bit < h.bit)
|
|
1199
|
+
throw new Error('"' + y + '" cannot be encoded with mode ' + e.toString(w) + `.
|
|
1200
|
+
Suggested mode is: ` + e.toString(h));
|
|
1201
|
+
switch (w === e.KANJI && !l.isKanjiModeEnabled() && (w = e.BYTE), w) {
|
|
1202
|
+
case e.NUMERIC:
|
|
1203
|
+
return new i(y);
|
|
1204
|
+
case e.ALPHANUMERIC:
|
|
1205
|
+
return new r(y);
|
|
1206
|
+
case e.KANJI:
|
|
1207
|
+
return new n(y);
|
|
1208
|
+
case e.BYTE:
|
|
1209
|
+
return new o(y);
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
t.fromArray = function(v) {
|
|
1213
|
+
return v.reduce(function(w, h) {
|
|
1214
|
+
return typeof h == "string" ? w.push(M(h, null)) : h.data && w.push(M(h.data, h.mode)), w;
|
|
1215
|
+
}, []);
|
|
1216
|
+
}, t.fromString = function(v, w) {
|
|
1217
|
+
const h = E(v, l.isKanjiModeEnabled()), A = b(h), p = _(A, w), m = s.find_path(p.map, "start", "end"), P = [];
|
|
1218
|
+
for (let T = 1; T < m.length - 1; T++)
|
|
1219
|
+
P.push(p.table[m[T]].node);
|
|
1220
|
+
return t.fromArray(c(P));
|
|
1221
|
+
}, t.rawSplit = function(v) {
|
|
1222
|
+
return t.fromArray(
|
|
1223
|
+
E(v, l.isKanjiModeEnabled())
|
|
1224
|
+
);
|
|
1225
|
+
};
|
|
1226
|
+
})(nt);
|
|
1227
|
+
const fe = U, he = ce, Yt = Et, jt = Bt, Jt = Je, qt = qe, _e = Ge, Ee = ue, Gt = Mt, le = We, Qt = et, Xt = H, pe = nt;
|
|
1228
|
+
function Wt(t, e) {
|
|
1229
|
+
const i = t.size, r = qt.getPositions(e);
|
|
1230
|
+
for (let o = 0; o < r.length; o++) {
|
|
1231
|
+
const n = r[o][0], a = r[o][1];
|
|
1232
|
+
for (let l = -1; l <= 7; l++)
|
|
1233
|
+
if (!(n + l <= -1 || i <= n + l))
|
|
1234
|
+
for (let s = -1; s <= 7; s++)
|
|
1235
|
+
a + s <= -1 || i <= a + s || (l >= 0 && l <= 6 && (s === 0 || s === 6) || s >= 0 && s <= 6 && (l === 0 || l === 6) || l >= 2 && l <= 4 && s >= 2 && s <= 4 ? t.set(n + l, a + s, !0, !0) : t.set(n + l, a + s, !1, !0));
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
function Zt(t) {
|
|
1239
|
+
const e = t.size;
|
|
1240
|
+
for (let i = 8; i < e - 8; i++) {
|
|
1241
|
+
const r = i % 2 === 0;
|
|
1242
|
+
t.set(i, 6, r, !0), t.set(6, i, r, !0);
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
function en(t, e) {
|
|
1246
|
+
const i = Jt.getPositions(e);
|
|
1247
|
+
for (let r = 0; r < i.length; r++) {
|
|
1248
|
+
const o = i[r][0], n = i[r][1];
|
|
1249
|
+
for (let a = -2; a <= 2; a++)
|
|
1250
|
+
for (let l = -2; l <= 2; l++)
|
|
1251
|
+
a === -2 || a === 2 || l === -2 || l === 2 || a === 0 && l === 0 ? t.set(o + a, n + l, !0, !0) : t.set(o + a, n + l, !1, !0);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
function tn(t, e) {
|
|
1255
|
+
const i = t.size, r = le.getEncodedBits(e);
|
|
1256
|
+
let o, n, a;
|
|
1257
|
+
for (let l = 0; l < 18; l++)
|
|
1258
|
+
o = Math.floor(l / 3), n = l % 3 + i - 8 - 3, a = (r >> l & 1) === 1, t.set(o, n, a, !0), t.set(n, o, a, !0);
|
|
1259
|
+
}
|
|
1260
|
+
function ye(t, e, i) {
|
|
1261
|
+
const r = t.size, o = Qt.getEncodedBits(e, i);
|
|
1262
|
+
let n, a;
|
|
1263
|
+
for (n = 0; n < 15; n++)
|
|
1264
|
+
a = (o >> n & 1) === 1, n < 6 ? t.set(n, 8, a, !0) : n < 8 ? t.set(n + 1, 8, a, !0) : t.set(r - 15 + n, 8, a, !0), n < 8 ? t.set(8, r - n - 1, a, !0) : n < 9 ? t.set(8, 15 - n - 1 + 1, a, !0) : t.set(8, 15 - n - 1, a, !0);
|
|
1265
|
+
t.set(r - 8, 8, 1, !0);
|
|
1266
|
+
}
|
|
1267
|
+
function nn(t, e) {
|
|
1268
|
+
const i = t.size;
|
|
1269
|
+
let r = -1, o = i - 1, n = 7, a = 0;
|
|
1270
|
+
for (let l = i - 1; l > 0; l -= 2)
|
|
1271
|
+
for (l === 6 && l--; ; ) {
|
|
1272
|
+
for (let s = 0; s < 2; s++)
|
|
1273
|
+
if (!t.isReserved(o, l - s)) {
|
|
1274
|
+
let u = !1;
|
|
1275
|
+
a < e.length && (u = (e[a] >>> n & 1) === 1), t.set(o, l - s, u), n--, n === -1 && (a++, n = 7);
|
|
1276
|
+
}
|
|
1277
|
+
if (o += r, o < 0 || i <= o) {
|
|
1278
|
+
o -= r, r = -r;
|
|
1279
|
+
break;
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
function on(t, e, i) {
|
|
1284
|
+
const r = new Yt();
|
|
1285
|
+
i.forEach(function(s) {
|
|
1286
|
+
r.put(s.mode.bit, 4), r.put(s.getLength(), Xt.getCharCountIndicator(s.mode, t)), s.write(r);
|
|
1287
|
+
});
|
|
1288
|
+
const o = fe.getSymbolTotalCodewords(t), n = Ee.getTotalCodewordsCount(t, e), a = (o - n) * 8;
|
|
1289
|
+
for (r.getLengthInBits() + 4 <= a && r.put(0, 4); r.getLengthInBits() % 8 !== 0; )
|
|
1290
|
+
r.putBit(0);
|
|
1291
|
+
const l = (a - r.getLengthInBits()) / 8;
|
|
1292
|
+
for (let s = 0; s < l; s++)
|
|
1293
|
+
r.put(s % 2 ? 17 : 236, 8);
|
|
1294
|
+
return rn(r, t, e);
|
|
1295
|
+
}
|
|
1296
|
+
function rn(t, e, i) {
|
|
1297
|
+
const r = fe.getSymbolTotalCodewords(e), o = Ee.getTotalCodewordsCount(e, i), n = r - o, a = Ee.getBlocksCount(e, i), l = r % a, s = a - l, u = Math.floor(r / a), f = Math.floor(n / a), E = f + 1, g = u - f, c = new Gt(g);
|
|
1298
|
+
let b = 0;
|
|
1299
|
+
const _ = new Array(a), M = new Array(a);
|
|
1300
|
+
let y = 0;
|
|
1301
|
+
const v = new Uint8Array(t.buffer);
|
|
1302
|
+
for (let m = 0; m < a; m++) {
|
|
1303
|
+
const P = m < s ? f : E;
|
|
1304
|
+
_[m] = v.slice(b, b + P), M[m] = c.encode(_[m]), b += P, y = Math.max(y, P);
|
|
1305
|
+
}
|
|
1306
|
+
const w = new Uint8Array(r);
|
|
1307
|
+
let h = 0, A, p;
|
|
1308
|
+
for (A = 0; A < y; A++)
|
|
1309
|
+
for (p = 0; p < a; p++)
|
|
1310
|
+
A < _[p].length && (w[h++] = _[p][A]);
|
|
1311
|
+
for (A = 0; A < g; A++)
|
|
1312
|
+
for (p = 0; p < a; p++)
|
|
1313
|
+
w[h++] = M[p][A];
|
|
1314
|
+
return w;
|
|
1315
|
+
}
|
|
1316
|
+
function sn(t, e, i, r) {
|
|
1317
|
+
let o;
|
|
1318
|
+
if (Array.isArray(t))
|
|
1319
|
+
o = pe.fromArray(t);
|
|
1320
|
+
else if (typeof t == "string") {
|
|
1321
|
+
let u = e;
|
|
1322
|
+
if (!u) {
|
|
1323
|
+
const f = pe.rawSplit(t);
|
|
1324
|
+
u = le.getBestVersionForData(f, i);
|
|
1325
|
+
}
|
|
1326
|
+
o = pe.fromString(t, u || 40);
|
|
1327
|
+
} else
|
|
1328
|
+
throw new Error("Invalid data");
|
|
1329
|
+
const n = le.getBestVersionForData(o, i);
|
|
1330
|
+
if (!n)
|
|
1331
|
+
throw new Error("The amount of data is too big to be stored in a QR Code");
|
|
1332
|
+
if (!e)
|
|
1333
|
+
e = n;
|
|
1334
|
+
else if (e < n)
|
|
1335
|
+
throw new Error(
|
|
1336
|
+
`
|
|
1337
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
1338
|
+
Minimum version required to store current data is: ` + n + `.
|
|
1339
|
+
`
|
|
1340
|
+
);
|
|
1341
|
+
const a = on(e, i, o), l = fe.getSymbolSize(e), s = new jt(l);
|
|
1342
|
+
return Wt(s, e), Zt(s), en(s, e), ye(s, i, 0), e >= 7 && tn(s, e), nn(s, a), isNaN(r) && (r = _e.getBestMask(
|
|
1343
|
+
s,
|
|
1344
|
+
ye.bind(null, s, i)
|
|
1345
|
+
)), _e.applyMask(r, s), ye(s, i, r), {
|
|
1346
|
+
modules: s,
|
|
1347
|
+
version: e,
|
|
1348
|
+
errorCorrectionLevel: i,
|
|
1349
|
+
maskPattern: r,
|
|
1350
|
+
segments: o
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
Ye.create = function(e, i) {
|
|
1354
|
+
if (typeof e > "u" || e === "")
|
|
1355
|
+
throw new Error("No input text");
|
|
1356
|
+
let r = he.M, o, n;
|
|
1357
|
+
return typeof i < "u" && (r = he.from(i.errorCorrectionLevel, he.M), o = le.from(i.version), n = _e.from(i.maskPattern), i.toSJISFunc && fe.setToSJISFunction(i.toSJISFunc)), sn(e, o, r, n);
|
|
1358
|
+
};
|
|
1359
|
+
var rt = {}, Ie = {};
|
|
1360
|
+
(function(t) {
|
|
1361
|
+
function e(i) {
|
|
1362
|
+
if (typeof i == "number" && (i = i.toString()), typeof i != "string")
|
|
1363
|
+
throw new Error("Color should be defined as hex string");
|
|
1364
|
+
let r = i.slice().replace("#", "").split("");
|
|
1365
|
+
if (r.length < 3 || r.length === 5 || r.length > 8)
|
|
1366
|
+
throw new Error("Invalid hex color: " + i);
|
|
1367
|
+
(r.length === 3 || r.length === 4) && (r = Array.prototype.concat.apply([], r.map(function(n) {
|
|
1368
|
+
return [n, n];
|
|
1369
|
+
}))), r.length === 6 && r.push("F", "F");
|
|
1370
|
+
const o = parseInt(r.join(""), 16);
|
|
1371
|
+
return {
|
|
1372
|
+
r: o >> 24 & 255,
|
|
1373
|
+
g: o >> 16 & 255,
|
|
1374
|
+
b: o >> 8 & 255,
|
|
1375
|
+
a: o & 255,
|
|
1376
|
+
hex: "#" + r.slice(0, 6).join("")
|
|
1377
|
+
};
|
|
1378
|
+
}
|
|
1379
|
+
t.getOptions = function(r) {
|
|
1380
|
+
r || (r = {}), r.color || (r.color = {});
|
|
1381
|
+
const o = typeof r.margin > "u" || r.margin === null || r.margin < 0 ? 4 : r.margin, n = r.width && r.width >= 21 ? r.width : void 0, a = r.scale || 4;
|
|
1382
|
+
return {
|
|
1383
|
+
width: n,
|
|
1384
|
+
scale: n ? 4 : a,
|
|
1385
|
+
margin: o,
|
|
1386
|
+
color: {
|
|
1387
|
+
dark: e(r.color.dark || "#000000ff"),
|
|
1388
|
+
light: e(r.color.light || "#ffffffff")
|
|
1389
|
+
},
|
|
1390
|
+
type: r.type,
|
|
1391
|
+
rendererOpts: r.rendererOpts || {}
|
|
1392
|
+
};
|
|
1393
|
+
}, t.getScale = function(r, o) {
|
|
1394
|
+
return o.width && o.width >= r + o.margin * 2 ? o.width / (r + o.margin * 2) : o.scale;
|
|
1395
|
+
}, t.getImageWidth = function(r, o) {
|
|
1396
|
+
const n = t.getScale(r, o);
|
|
1397
|
+
return Math.floor((r + o.margin * 2) * n);
|
|
1398
|
+
}, t.qrToImageData = function(r, o, n) {
|
|
1399
|
+
const a = o.modules.size, l = o.modules.data, s = t.getScale(a, n), u = Math.floor((a + n.margin * 2) * s), f = n.margin * s, E = [n.color.light, n.color.dark];
|
|
1400
|
+
for (let g = 0; g < u; g++)
|
|
1401
|
+
for (let c = 0; c < u; c++) {
|
|
1402
|
+
let b = (g * u + c) * 4, _ = n.color.light;
|
|
1403
|
+
if (g >= f && c >= f && g < u - f && c < u - f) {
|
|
1404
|
+
const M = Math.floor((g - f) / s), y = Math.floor((c - f) / s);
|
|
1405
|
+
_ = E[l[M * a + y] ? 1 : 0];
|
|
1406
|
+
}
|
|
1407
|
+
r[b++] = _.r, r[b++] = _.g, r[b++] = _.b, r[b] = _.a;
|
|
1408
|
+
}
|
|
1409
|
+
};
|
|
1410
|
+
})(Ie);
|
|
1411
|
+
(function(t) {
|
|
1412
|
+
const e = Ie;
|
|
1413
|
+
function i(o, n, a) {
|
|
1414
|
+
o.clearRect(0, 0, n.width, n.height), n.style || (n.style = {}), n.height = a, n.width = a, n.style.height = a + "px", n.style.width = a + "px";
|
|
1415
|
+
}
|
|
1416
|
+
function r() {
|
|
1417
|
+
try {
|
|
1418
|
+
return document.createElement("canvas");
|
|
1419
|
+
} catch {
|
|
1420
|
+
throw new Error("You need to specify a canvas element");
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
t.render = function(n, a, l) {
|
|
1424
|
+
let s = l, u = a;
|
|
1425
|
+
typeof s > "u" && (!a || !a.getContext) && (s = a, a = void 0), a || (u = r()), s = e.getOptions(s);
|
|
1426
|
+
const f = e.getImageWidth(n.modules.size, s), E = u.getContext("2d"), g = E.createImageData(f, f);
|
|
1427
|
+
return e.qrToImageData(g.data, n, s), i(E, u, f), E.putImageData(g, 0, 0), u;
|
|
1428
|
+
}, t.renderToDataURL = function(n, a, l) {
|
|
1429
|
+
let s = l;
|
|
1430
|
+
typeof s > "u" && (!a || !a.getContext) && (s = a, a = void 0), s || (s = {});
|
|
1431
|
+
const u = t.render(n, a, s), f = s.type || "image/png", E = s.rendererOpts || {};
|
|
1432
|
+
return u.toDataURL(f, E.quality);
|
|
1433
|
+
};
|
|
1434
|
+
})(rt);
|
|
1435
|
+
var it = {};
|
|
1436
|
+
const an = Ie;
|
|
1437
|
+
function ke(t, e) {
|
|
1438
|
+
const i = t.a / 255, r = e + '="' + t.hex + '"';
|
|
1439
|
+
return i < 1 ? r + " " + e + '-opacity="' + i.toFixed(2).slice(1) + '"' : r;
|
|
1440
|
+
}
|
|
1441
|
+
function we(t, e, i) {
|
|
1442
|
+
let r = t + e;
|
|
1443
|
+
return typeof i < "u" && (r += " " + i), r;
|
|
1444
|
+
}
|
|
1445
|
+
function ln(t, e, i) {
|
|
1446
|
+
let r = "", o = 0, n = !1, a = 0;
|
|
1447
|
+
for (let l = 0; l < t.length; l++) {
|
|
1448
|
+
const s = Math.floor(l % e), u = Math.floor(l / e);
|
|
1449
|
+
!s && !n && (n = !0), t[l] ? (a++, l > 0 && s > 0 && t[l - 1] || (r += n ? we("M", s + i, 0.5 + u + i) : we("m", o, 0), o = 0, n = !1), s + 1 < e && t[l + 1] || (r += we("h", a), a = 0)) : o++;
|
|
1450
|
+
}
|
|
1451
|
+
return r;
|
|
1452
|
+
}
|
|
1453
|
+
it.render = function(e, i, r) {
|
|
1454
|
+
const o = an.getOptions(i), n = e.modules.size, a = e.modules.data, l = n + o.margin * 2, s = o.color.light.a ? "<path " + ke(o.color.light, "fill") + ' d="M0 0h' + l + "v" + l + 'H0z"/>' : "", u = "<path " + ke(o.color.dark, "stroke") + ' d="' + ln(a, n, o.margin) + '"/>', f = 'viewBox="0 0 ' + l + " " + l + '"', g = '<svg xmlns="http://www.w3.org/2000/svg" ' + (o.width ? 'width="' + o.width + '" height="' + o.width + '" ' : "") + f + ' shape-rendering="crispEdges">' + s + u + `</svg>
|
|
1455
|
+
`;
|
|
1456
|
+
return typeof r == "function" && r(null, g), g;
|
|
1457
|
+
};
|
|
1458
|
+
const cn = Ct, Be = Ye, st = rt, un = it;
|
|
1459
|
+
function Te(t, e, i, r, o) {
|
|
1460
|
+
const n = [].slice.call(arguments, 1), a = n.length, l = typeof n[a - 1] == "function";
|
|
1461
|
+
if (!l && !cn())
|
|
1462
|
+
throw new Error("Callback required as last argument");
|
|
1463
|
+
if (l) {
|
|
1464
|
+
if (a < 2)
|
|
1465
|
+
throw new Error("Too few arguments provided");
|
|
1466
|
+
a === 2 ? (o = i, i = e, e = r = void 0) : a === 3 && (e.getContext && typeof o > "u" ? (o = r, r = void 0) : (o = r, r = i, i = e, e = void 0));
|
|
1467
|
+
} else {
|
|
1468
|
+
if (a < 1)
|
|
1469
|
+
throw new Error("Too few arguments provided");
|
|
1470
|
+
return a === 1 ? (i = e, e = r = void 0) : a === 2 && !e.getContext && (r = i, i = e, e = void 0), new Promise(function(s, u) {
|
|
1471
|
+
try {
|
|
1472
|
+
const f = Be.create(i, r);
|
|
1473
|
+
s(t(f, e, r));
|
|
1474
|
+
} catch (f) {
|
|
1475
|
+
u(f);
|
|
1476
|
+
}
|
|
1477
|
+
});
|
|
1478
|
+
}
|
|
1479
|
+
try {
|
|
1480
|
+
const s = Be.create(i, r);
|
|
1481
|
+
o(null, t(s, e, r));
|
|
1482
|
+
} catch (s) {
|
|
1483
|
+
o(s);
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
ee.create = Be.create;
|
|
1487
|
+
ee.toCanvas = Te.bind(null, st.render);
|
|
1488
|
+
ee.toDataURL = Te.bind(null, st.renderToDataURL);
|
|
1489
|
+
ee.toString = Te.bind(null, function(t, e, i) {
|
|
1490
|
+
return un.render(t, i);
|
|
1491
|
+
});
|
|
1492
|
+
async function dn(t, e = 350) {
|
|
1493
|
+
try {
|
|
1494
|
+
return await ee.toDataURL(t, {
|
|
1495
|
+
width: e,
|
|
1496
|
+
margin: 0
|
|
1497
|
+
});
|
|
1498
|
+
} catch (i) {
|
|
1499
|
+
console.error(i);
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
var fn = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", marketingV1Portal: "https://marketing-v1.feedme.cc" };
|
|
1503
|
+
const gn = { class: "flex items-start" }, mn = /* @__PURE__ */ C("div", null, [
|
|
1504
|
+
/* @__PURE__ */ C("div", { class: "fm-typo-en-title-sm-800" }, "Link device"),
|
|
1505
|
+
/* @__PURE__ */ C("div", { class: "fm-typo-en-body-sm-400" }, " Open your camera on your device to link counter app. ")
|
|
1506
|
+
], -1), hn = { class: "flex flex-col gap-16 mt-16" }, pn = ["src"], yn = /* @__PURE__ */ Ve({
|
|
1507
|
+
__name: "LinkDeviceDialog",
|
|
1508
|
+
setup(t) {
|
|
1509
|
+
const e = ve(), i = Oe(), r = ze(), o = K(), n = K(), a = fn.crmUrl, l = K(), s = se(() => i.membership), u = se(() => {
|
|
1510
|
+
var g, c;
|
|
1511
|
+
return `https://${(g = s.value) != null && g.url ? s.value.url : (c = s.value) == null ? void 0 : c.business}.${a}`;
|
|
1512
|
+
});
|
|
1513
|
+
async function f(g) {
|
|
1514
|
+
const c = await Ke.getOtp(g);
|
|
1515
|
+
return `${u.value}?link-device=${c.otp}`;
|
|
1516
|
+
}
|
|
1517
|
+
async function E(g) {
|
|
1518
|
+
const c = await f(g);
|
|
1519
|
+
l.value = c, o.value = await dn(c);
|
|
1520
|
+
}
|
|
1521
|
+
return xe(async () => {
|
|
1522
|
+
if (await e.readLocations(), !e.locations.length) {
|
|
1523
|
+
r.close();
|
|
1524
|
+
return;
|
|
1525
|
+
}
|
|
1526
|
+
const g = e.locations[0]._id;
|
|
1527
|
+
n.value = g, await E(g);
|
|
1528
|
+
}), (g, c) => {
|
|
1529
|
+
const b = D("FmIcon"), _ = D("FmSelect"), M = D("FmButton"), y = D("FmCard");
|
|
1530
|
+
return $(), be(y, { class: "p-24 max-w-[350px]" }, {
|
|
1531
|
+
default: Q(() => [
|
|
1532
|
+
C("div", gn, [
|
|
1533
|
+
mn,
|
|
1534
|
+
S(b, {
|
|
1535
|
+
name: "close",
|
|
1536
|
+
onClick: c[0] || (c[0] = (v) => d(r).close()),
|
|
1537
|
+
class: "cursor-pointer"
|
|
1538
|
+
})
|
|
1539
|
+
]),
|
|
1540
|
+
C("div", hn, [
|
|
1541
|
+
S(_, {
|
|
1542
|
+
modelValue: d(n),
|
|
1543
|
+
"onUpdate:modelValue": [
|
|
1544
|
+
c[1] || (c[1] = (v) => $e(n) ? n.value = v : null),
|
|
1545
|
+
E
|
|
1546
|
+
],
|
|
1547
|
+
label: "Select Location",
|
|
1548
|
+
items: d(e).locationItems.filter((v) => !!v.value)
|
|
1549
|
+
}, null, 8, ["modelValue", "items"]),
|
|
1550
|
+
C("img", {
|
|
1551
|
+
src: d(o),
|
|
1552
|
+
class: "aspect-square w-full"
|
|
1553
|
+
}, null, 8, pn),
|
|
1554
|
+
S(M, {
|
|
1555
|
+
class: "mx-auto",
|
|
1556
|
+
variant: "plain",
|
|
1557
|
+
icon: "content_copy",
|
|
1558
|
+
onClick: c[2] || (c[2] = (v) => d(He)(d(l)))
|
|
1559
|
+
})
|
|
1560
|
+
])
|
|
1561
|
+
]),
|
|
1562
|
+
_: 1
|
|
1563
|
+
});
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
});
|
|
1567
|
+
var wn = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", marketingV1Portal: "https://marketing-v1.feedme.cc" };
|
|
1568
|
+
const bn = { class: "hidden xs:flex items-center justify-between px-16 py-12 border-b border-fm-color-neutral-gray-100" }, vn = { class: "fm-typo-en-title-md-800" }, Cn = {
|
|
1569
|
+
key: 0,
|
|
1570
|
+
class: "px-24 gap-32 grid grid-cols-3 xs:pt-16"
|
|
1571
|
+
}, _n = { class: "col-span-2 flex flex-col xs:col-span-3" }, En = { class: "fm-typo-en-title-sm-800" }, Bn = { class: "space-y-24" }, An = { class: "space-y-8" }, Mn = { class: "fm-typo-en-title-sm-800" }, Sn = { class: "fm-typo-body-lg-400" }, In = { class: "fm-typo-body-md-400 text-fm-color-typo-secondary" }, Tn = { class: "fm-typo-body-md-400 text-fm-color-typo-secondary" }, Pn = { class: "space-y-8" }, Nn = { class: "fm-typo-en-title-sm-800 flex items-center gap-8" }, Un = { class: "space-y-8" }, Ln = /* @__PURE__ */ C("div", { class: "fm-typo-en-title-sm-800" }, "SMS", -1), Fn = { class: "space-y-8" }, Rn = /* @__PURE__ */ C("div", { class: "fm-typo-en-title-sm-800" }, [
|
|
1572
|
+
/* @__PURE__ */ X(" Free Credit as Discount "),
|
|
1573
|
+
/* @__PURE__ */ C("span", { class: "fm-typo-en-body-md-400 text-fm-color-typo-error" }, "*POS v6.56 or above")
|
|
1574
|
+
], -1), Dn = { class: "space-y-8" }, kn = { class: "fm-typo-en-title-sm-800 flex items-center gap-8" }, Vn = { class: "space-y-8" }, xn = /* @__PURE__ */ C("div", { class: "fm-typo-en-title-sm-800" }, "Activation Location", -1), $n = { class: "flex justify-end pb-24" }, zn = { class: "col-span-1 space-y-8 xs:hidden" }, Hn = /* @__PURE__ */ C("div", { class: "fm-typo-en-body-lg-600" }, "Loyalty setting summary", -1), Kn = /* @__PURE__ */ C("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Name ", -1), On = { class: "fm-typo-en-body-lg-600" }, Yn = /* @__PURE__ */ C("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Advertisement ", -1), jn = { class: "fm-typo-en-body-lg-600" }, Jn = /* @__PURE__ */ C("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Free Credit as Discount ", -1), qn = { class: "fm-typo-en-body-lg-600" }, Gn = /* @__PURE__ */ C("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Activated locations ", -1), Qn = { class: "fm-typo-en-body-lg-600" }, mo = /* @__PURE__ */ Ve({
|
|
1575
|
+
__name: "Setting",
|
|
1576
|
+
setup(t) {
|
|
1577
|
+
const e = dt(), i = yt(), r = ve(), o = Oe(), { global: n, minor: a } = ct, l = ze(), s = K(), u = K(!1), f = [
|
|
1578
|
+
(p) => !p || p.length >= 6 || "Invalid URL format, please enter at least 6 characters",
|
|
1579
|
+
(p) => !p || new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/).test(p) || "Invalid URL format, url should start with a letter or number and can only include lowercase letters, numbers, or hyphens"
|
|
1580
|
+
], E = wn.appUrl, g = se(() => {
|
|
1581
|
+
var p;
|
|
1582
|
+
return `https://${(p = s.value) == null ? void 0 : p.business}.${E}`;
|
|
1583
|
+
}), c = K(), b = K([]), _ = se(() => {
|
|
1584
|
+
var p, m;
|
|
1585
|
+
return Math.min((((m = (p = s.value) == null ? void 0 : p.advertisements) == null ? void 0 : m.length) ?? 0) + 1, 5);
|
|
1586
|
+
}), { t: M } = pt(), y = i.currentCountry.value || "MY", v = [
|
|
1587
|
+
"user.name",
|
|
1588
|
+
"user.gender",
|
|
1589
|
+
"user.birthday",
|
|
1590
|
+
"user.phoneNumber",
|
|
1591
|
+
"membership.url"
|
|
1592
|
+
].filter(
|
|
1593
|
+
(p) => {
|
|
1594
|
+
var m;
|
|
1595
|
+
return !((m = mt[y]) != null && m.includes(p));
|
|
1596
|
+
}
|
|
1597
|
+
);
|
|
1598
|
+
async function w() {
|
|
1599
|
+
l.open({
|
|
1600
|
+
title: "",
|
|
1601
|
+
dialogComponent: yn,
|
|
1602
|
+
closeButton: !1
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1605
|
+
async function h(p) {
|
|
1606
|
+
await ut.remove(
|
|
1607
|
+
"Are you sure you want to unlink this device?",
|
|
1608
|
+
"Unlink device",
|
|
1609
|
+
"Unlink"
|
|
1610
|
+
) && await a(
|
|
1611
|
+
async () => {
|
|
1612
|
+
await Ke.unregisterDevice(p), await r.readLocationDevices();
|
|
1613
|
+
},
|
|
1614
|
+
{
|
|
1615
|
+
message: "Unlinking device",
|
|
1616
|
+
successMessage: "Unlinked device successfully"
|
|
1617
|
+
}
|
|
1618
|
+
);
|
|
1619
|
+
}
|
|
1620
|
+
async function A() {
|
|
1621
|
+
await a(
|
|
1622
|
+
async () => {
|
|
1623
|
+
var P;
|
|
1624
|
+
const p = vt(s.value);
|
|
1625
|
+
p.welcomeMessage && !((P = p.welcomeMessage) != null && P.content) && (p.welcomeMessage.content = "Hi there, you have been invited to join our membership");
|
|
1626
|
+
const m = ft.parse(p);
|
|
1627
|
+
c.value === null && m.image ? await O.delete(O.coverImagePath()) : c.value && (m.image = await O.update(
|
|
1628
|
+
O.coverImagePath(),
|
|
1629
|
+
c.value
|
|
1630
|
+
)), u.value ? m.advertisements = (await Promise.all(
|
|
1631
|
+
new Array(_.value - 1).fill(null).map(async (T, I) => {
|
|
1632
|
+
var V;
|
|
1633
|
+
const L = b.value[I];
|
|
1634
|
+
return L ? await O.update(
|
|
1635
|
+
O.advertisementPath(I, L),
|
|
1636
|
+
L
|
|
1637
|
+
) : (V = m.advertisements) == null ? void 0 : V[I];
|
|
1638
|
+
})
|
|
1639
|
+
)).filter((T) => T) : m.advertisements = [], await wt.update(m), await o.readMembership(), s.value = o.membership;
|
|
1640
|
+
},
|
|
1641
|
+
{
|
|
1642
|
+
message: "Updating membership",
|
|
1643
|
+
successMessage: "Membership updated successfully"
|
|
1644
|
+
}
|
|
1645
|
+
);
|
|
1646
|
+
}
|
|
1647
|
+
return xe(async () => {
|
|
1648
|
+
await n(async () => {
|
|
1649
|
+
var p, m;
|
|
1650
|
+
await r.readPremium(), await r.readLocations(), await r.readLocationDevices(), await o.readMembership(), s.value = o.membership, u.value = (((p = s.value.advertisements) == null ? void 0 : p.length) ?? 0) > 0, b.value = ((m = s.value.advertisements) == null ? void 0 : m.map(() => null)) ?? [];
|
|
1651
|
+
});
|
|
1652
|
+
}), (p, m) => {
|
|
1653
|
+
var Pe, Ne;
|
|
1654
|
+
const P = D("FmPageHead"), T = D("FmButton"), I = D("FmTextField"), L = D("FmCard"), V = D("FmPill"), N = D("FmSwitch"), at = D("FmMenuDivider");
|
|
1655
|
+
return $(), G(ge, null, [
|
|
1656
|
+
S(P, {
|
|
1657
|
+
title: d(M)("connect.setting.title"),
|
|
1658
|
+
class: "xs:hidden"
|
|
1659
|
+
}, null, 8, ["title"]),
|
|
1660
|
+
C("div", bn, [
|
|
1661
|
+
C("div", vn, R(d(M)("connect.setting.basicInfo.title")), 1),
|
|
1662
|
+
S(T, {
|
|
1663
|
+
icon: "info",
|
|
1664
|
+
variant: "tertiary"
|
|
1665
|
+
})
|
|
1666
|
+
]),
|
|
1667
|
+
d(s) ? ($(), G("div", Cn, [
|
|
1668
|
+
C("div", _n, [
|
|
1669
|
+
C("div", En, R(d(M)("connect.setting.basicInfo.title")), 1),
|
|
1670
|
+
C("div", Bn, [
|
|
1671
|
+
S(I, {
|
|
1672
|
+
label: d(M)("connect.setting.basicInfo.membershipTitle"),
|
|
1673
|
+
modelValue: d(s).name,
|
|
1674
|
+
"onUpdate:modelValue": m[0] || (m[0] = (B) => d(s).name = B)
|
|
1675
|
+
}, null, 8, ["label", "modelValue"]),
|
|
1676
|
+
S(I, {
|
|
1677
|
+
disabled: !0,
|
|
1678
|
+
"model-value": d(s).business,
|
|
1679
|
+
rules: f,
|
|
1680
|
+
required: !0,
|
|
1681
|
+
label: d(M)("connect.setting.basicInfo.memberAppUrl"),
|
|
1682
|
+
"helper-text": d(g),
|
|
1683
|
+
placeholder: d(s).business.toString(),
|
|
1684
|
+
"onUpdate:modelValue": m[2] || (m[2] = (B) => d(s).url = B)
|
|
1685
|
+
}, {
|
|
1686
|
+
prepend: Q(() => [
|
|
1687
|
+
X(" https:// ")
|
|
1688
|
+
]),
|
|
1689
|
+
append: Q(() => [
|
|
1690
|
+
X(" ." + R(d(E)) + " ", 1),
|
|
1691
|
+
S(T, {
|
|
1692
|
+
icon: "content_copy",
|
|
1693
|
+
variant: "tertiary",
|
|
1694
|
+
onClick: m[1] || (m[1] = (B) => d(He)(d(g)))
|
|
1695
|
+
})
|
|
1696
|
+
]),
|
|
1697
|
+
_: 1
|
|
1698
|
+
}, 8, ["model-value", "label", "helper-text", "placeholder"]),
|
|
1699
|
+
S(Fe, {
|
|
1700
|
+
label: "Cover image",
|
|
1701
|
+
class: "w-2/3 xs:w-full",
|
|
1702
|
+
"image-fit": "cover",
|
|
1703
|
+
"aspect-ratio": "3/1",
|
|
1704
|
+
thumbnail: d(s).image || void 0,
|
|
1705
|
+
"onUpdate:file": m[3] || (m[3] = async (B) => {
|
|
1706
|
+
c.value = B, B || (d(s).image = null);
|
|
1707
|
+
})
|
|
1708
|
+
}, null, 8, ["thumbnail"]),
|
|
1709
|
+
C("div", An, [
|
|
1710
|
+
C("div", Mn, R(d(M)("connect.setting.counterApp.title")), 1),
|
|
1711
|
+
S(T, {
|
|
1712
|
+
variant: "plain",
|
|
1713
|
+
icon: "link",
|
|
1714
|
+
label: d(M)("connect.setting.counterApp.linkDevice"),
|
|
1715
|
+
onClick: w
|
|
1716
|
+
}, null, 8, ["label"]),
|
|
1717
|
+
($(!0), G(ge, null, Ue(d(r).locationDevices, (B, F) => ($(), be(L, {
|
|
1718
|
+
key: F,
|
|
1719
|
+
variant: "outlined",
|
|
1720
|
+
class: "flex items-center justify-between px-16 py-12"
|
|
1721
|
+
}, {
|
|
1722
|
+
default: Q(() => [
|
|
1723
|
+
C("div", null, [
|
|
1724
|
+
C("p", Sn, R(B.name || `Device ${B._id}`), 1),
|
|
1725
|
+
C("p", In, " Activation date: " + R(d(lt)(d(bt)(B._id.toString())).format(
|
|
1726
|
+
"D MMM YYYY"
|
|
1727
|
+
)), 1),
|
|
1728
|
+
C("p", Tn, " Linked location: " + R(d(r).locations.find((x) => x._id == B.location).name), 1)
|
|
1729
|
+
]),
|
|
1730
|
+
S(T, {
|
|
1731
|
+
icon: "link_off",
|
|
1732
|
+
variant: "tertiary",
|
|
1733
|
+
onClick: (x) => h(B._id)
|
|
1734
|
+
}, null, 8, ["onClick"])
|
|
1735
|
+
]),
|
|
1736
|
+
_: 2
|
|
1737
|
+
}, 1024))), 128))
|
|
1738
|
+
]),
|
|
1739
|
+
C("div", Pn, [
|
|
1740
|
+
C("div", Nn, [
|
|
1741
|
+
X(" Advertisement "),
|
|
1742
|
+
S(V, { variant: "premium" })
|
|
1743
|
+
]),
|
|
1744
|
+
S(N, {
|
|
1745
|
+
modelValue: d(u),
|
|
1746
|
+
"onUpdate:modelValue": m[4] || (m[4] = (B) => $e(u) ? u.value = B : null),
|
|
1747
|
+
label: "Advertisement",
|
|
1748
|
+
sublabel: "This will be show on FeedMe ordering app",
|
|
1749
|
+
"label-placement": "right",
|
|
1750
|
+
disabled: !d(r).isPremium,
|
|
1751
|
+
value: ""
|
|
1752
|
+
}, null, 8, ["modelValue", "disabled"]),
|
|
1753
|
+
d(u) ? ($(), G("div", {
|
|
1754
|
+
class: "flex items-center gap-8 flex-wrap xs:grid xs:grid-cols-2 xs:overflow-x-scroll xs:w-full",
|
|
1755
|
+
key: d(_)
|
|
1756
|
+
}, [
|
|
1757
|
+
($(!0), G(ge, null, Ue(d(_), (B, F) => {
|
|
1758
|
+
var x, ne;
|
|
1759
|
+
return $(), be(Fe, {
|
|
1760
|
+
class: "w-[200px]",
|
|
1761
|
+
"image-fit": "cover",
|
|
1762
|
+
label: "",
|
|
1763
|
+
"aspect-ratio": "2/3",
|
|
1764
|
+
thumbnail: (ne = (x = d(s)) == null ? void 0 : x.advertisements) == null ? void 0 : ne[F],
|
|
1765
|
+
accept: ".png, .jpg, .jpeg, .mp4, .gif",
|
|
1766
|
+
"recommended-size": "Recommended 4:5 ratio / 1080px x 1350px",
|
|
1767
|
+
file: d(b)[F] ?? void 0,
|
|
1768
|
+
"onUpdate:file": (oe) => {
|
|
1769
|
+
d(s).advertisements || (d(s).advertisements = []), oe ? (d(s).advertisements[F] = "", d(b)[F] = oe) : (d(s).advertisements.splice(F, 1), d(b).splice(F, 1));
|
|
1770
|
+
}
|
|
1771
|
+
}, null, 8, ["thumbnail", "file", "onUpdate:file"]);
|
|
1772
|
+
}), 256))
|
|
1773
|
+
])) : Le("", !0)
|
|
1774
|
+
]),
|
|
1775
|
+
C("div", Un, [
|
|
1776
|
+
Ln,
|
|
1777
|
+
S(I, {
|
|
1778
|
+
"model-value": ((Pe = d(s)) == null ? void 0 : Pe.brand) || "",
|
|
1779
|
+
"max-length": 15,
|
|
1780
|
+
label: "Brand Name",
|
|
1781
|
+
"show-word-count": "",
|
|
1782
|
+
"helper-text": `RM 0 ${((Ne = d(s)) == null ? void 0 : Ne.brand) || ""}: YOUR CUSTOMER MESSAGE`,
|
|
1783
|
+
"onUpdate:modelValue": m[5] || (m[5] = (B) => d(s).brand = B)
|
|
1784
|
+
}, null, 8, ["model-value", "helper-text"]),
|
|
1785
|
+
S(ht, {
|
|
1786
|
+
modelValue: d(s).welcomeMessage,
|
|
1787
|
+
"onUpdate:modelValue": m[6] || (m[6] = (B) => d(s).welcomeMessage = B),
|
|
1788
|
+
variables: d(v),
|
|
1789
|
+
placeholder: "Hi there, you have been invited to join membership"
|
|
1790
|
+
}, null, 8, ["modelValue", "variables"])
|
|
1791
|
+
]),
|
|
1792
|
+
C("div", Fn, [
|
|
1793
|
+
Rn,
|
|
1794
|
+
S(N, {
|
|
1795
|
+
"model-value": d(s).freeCreditAsDiscount ?? !1,
|
|
1796
|
+
"onUpdate:modelValue": m[7] || (m[7] = (B) => d(s).freeCreditAsDiscount = B),
|
|
1797
|
+
label: "Free Credit as Discount",
|
|
1798
|
+
sublabel: "When enabled, this will allow free credit to be used as discount in the bill (POS >=v6.56)",
|
|
1799
|
+
"label-placement": "right",
|
|
1800
|
+
value: ""
|
|
1801
|
+
}, null, 8, ["model-value"])
|
|
1802
|
+
]),
|
|
1803
|
+
C("div", Dn, [
|
|
1804
|
+
C("div", kn, [
|
|
1805
|
+
X(" Member Card "),
|
|
1806
|
+
S(V, { variant: "premium" })
|
|
1807
|
+
]),
|
|
1808
|
+
S(N, {
|
|
1809
|
+
"model-value": d(s).cardEnable ?? !1,
|
|
1810
|
+
"onUpdate:modelValue": m[8] || (m[8] = (B) => d(s).cardEnable = B),
|
|
1811
|
+
label: "",
|
|
1812
|
+
sublabel: "Allow member to bind card via member app",
|
|
1813
|
+
"label-placement": "right",
|
|
1814
|
+
value: "",
|
|
1815
|
+
disabled: !d(r).isPremium
|
|
1816
|
+
}, null, 8, ["model-value", "disabled"])
|
|
1817
|
+
]),
|
|
1818
|
+
C("div", Vn, [
|
|
1819
|
+
xn,
|
|
1820
|
+
S(gt, {
|
|
1821
|
+
label: "Select restaurant",
|
|
1822
|
+
"model-value": d(s).targetLocation ?? null,
|
|
1823
|
+
"onUpdate:modelValue": m[9] || (m[9] = (B) => d(s).targetLocation = B)
|
|
1824
|
+
}, null, 8, ["model-value"])
|
|
1825
|
+
]),
|
|
1826
|
+
C("div", $n, [
|
|
1827
|
+
S(T, {
|
|
1828
|
+
label: "Update",
|
|
1829
|
+
type: "button",
|
|
1830
|
+
onClick: A,
|
|
1831
|
+
disabled: !!d(e).loadingQueue.length,
|
|
1832
|
+
loading: !!d(e).loadingQueue.length
|
|
1833
|
+
}, null, 8, ["disabled", "loading"])
|
|
1834
|
+
])
|
|
1835
|
+
])
|
|
1836
|
+
]),
|
|
1837
|
+
C("div", zn, [
|
|
1838
|
+
S(L, {
|
|
1839
|
+
variant: "outlined",
|
|
1840
|
+
class: "flex flex-col p-24 gap-8"
|
|
1841
|
+
}, {
|
|
1842
|
+
default: Q(() => {
|
|
1843
|
+
var B, F, x;
|
|
1844
|
+
return [
|
|
1845
|
+
Hn,
|
|
1846
|
+
S(at, { class: "my-4" }),
|
|
1847
|
+
C("div", null, [
|
|
1848
|
+
Kn,
|
|
1849
|
+
C("div", On, R(d(s).name), 1)
|
|
1850
|
+
]),
|
|
1851
|
+
C("div", null, [
|
|
1852
|
+
Yn,
|
|
1853
|
+
C("div", jn, R((((B = d(s).advertisements) == null ? void 0 : B.length) ?? 0) || "No advertisments"), 1)
|
|
1854
|
+
]),
|
|
1855
|
+
C("div", null, [
|
|
1856
|
+
Jn,
|
|
1857
|
+
C("div", qn, R(d(s).freeCreditAsDiscount ? "Enabled" : "Disabled"), 1)
|
|
1858
|
+
]),
|
|
1859
|
+
C("div", null, [
|
|
1860
|
+
Gn,
|
|
1861
|
+
C("div", Qn, R(!d(s).targetLocation || d(s).targetLocation.length == d(ve)().locations.length ? "All locations" : (x = (F = d(s)) == null ? void 0 : F.targetLocation) == null ? void 0 : x.map(
|
|
1862
|
+
(ne) => d(r).locations.find((oe) => oe._id == ne).name
|
|
1863
|
+
).join(", ")), 1)
|
|
1864
|
+
])
|
|
1865
|
+
];
|
|
1866
|
+
}),
|
|
1867
|
+
_: 1
|
|
1868
|
+
})
|
|
1869
|
+
])
|
|
1870
|
+
])) : Le("", !0)
|
|
1871
|
+
], 64);
|
|
1872
|
+
};
|
|
1873
|
+
}
|
|
1874
|
+
});
|
|
1875
|
+
export {
|
|
1876
|
+
mo as default
|
|
1877
|
+
};
|