@feedmepos/mf-settings 0.0.34 → 0.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3934 @@
1
+ var Pr = Object.defineProperty;
2
+ var Sr = (t, e, r) => e in t ? Pr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var Ke = (t, e, r) => (Sr(t, typeof e != "symbol" ? e + "" : e, r), r);
4
+ import { ref as re, computed as H, defineComponent as W, resolveComponent as K, openBlock as k, createBlock as Q, Teleport as Tr, createVNode as T, Transition as Lr, withCtx as G, normalizeClass as Y, normalizeStyle as Ne, withKeys as Nr, createElementVNode as E, toDisplayString as j, renderSlot as ne, createElementBlock as D, Fragment as se, renderList as me, createCommentVNode as le, createTextVNode as Ce, h as ke, unref as R, watch as rt, onMounted as nr, onUnmounted as Cr, toRaw as _t, reactive as lt, nextTick as sr, onBeforeUnmount as kr, normalizeProps as xr, guardReactiveProps as Vr, withModifiers as xe, getCurrentInstance as Fr, isRef as Et } from "vue";
5
+ import { c as jr, g as ar, b as qe, a as ze, d as or, e as ut, u as ir } from "./loading-810e6a97.js";
6
+ import { useCoreStore as fe, useI18n as pe } from "@feedmepos/mf-common";
7
+ import { useDialog as lr, useDialogChild as Mr, useSnackbar as ct, useBreakpoints as ur, components as cr } from "@feedmepos/ui-library";
8
+ import { c as ge, D as dt, u as dr, _ as Ur, a as Dr, b as Gr, d as He } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-62e1008f.js";
9
+ import { _ as fr, r as ce, b as Br } from "./business-b41c9d64.js";
10
+ import { c as Ve, g as ve, a as Kr, b as qr, d as Xe, r as Ye, e as zr, u as Hr, f as Xr, h as Yr } from "./app-99c9cdb0.js";
11
+ import "pinia";
12
+ import "vue-router";
13
+ import "@feedmepos/mf-e-invoice";
14
+ import "@feedmepos/mf-mdm";
15
+ var Wr = {};
16
+ (function(t) {
17
+ Object.defineProperty(t, "__esModule", { value: !0 }), function(e) {
18
+ e.SLOT_SALE = "SLOT_SALE";
19
+ }(t.ReportWidgetType || (t.ReportWidgetType = {})), function(e) {
20
+ e.v2 = "v2", e.v3 = "v3", e.v4 = "v4";
21
+ }(t.MENU_VERSION || (t.MENU_VERSION = {})), function(e) {
22
+ e.Polygon = "Polygon";
23
+ }(t.GeometryType || (t.GeometryType = {})), function(e) {
24
+ e.stock = "stock", e.discovery = "discovery", e.pickup = "pickup", e.delivery = "delivery", e.foodpanda = "foodpanda", e.deliveryIntegration = "deliveryIntegration", e.kds = "kds", e.ods = "ods";
25
+ }(t.RestaurantFeature || (t.RestaurantFeature = {})), function(e) {
26
+ e.alpha = "alpha", e.beta = "beta", e.latest = "latest";
27
+ }(t.RestaurantChannel || (t.RestaurantChannel = {})), function(e) {
28
+ e.pickup = "pickup", e.delivery = "delivery";
29
+ }(t.DiscoveryType || (t.DiscoveryType = {})), function(e) {
30
+ e.new = "NEW", e.pending = "PENDING", e.approved = "APPROVED";
31
+ }(t.PAYOUT_ACCOUNT_STATUS || (t.PAYOUT_ACCOUNT_STATUS = {})), function(e) {
32
+ e.maybank = "MAYBANK", e.cimbBank = "CIMB_BANK", e.rhbBank = "RHB_BANK", e.bankIslam = "BANK_ISLAM", e.bankMuamalat = "BANK_MUAMALAT", e.bankRakyat = "BANK_RAKYAT", e.bankSimpananNasional = "BANK_SIMPANAN_NASIONAL", e.citiBank = "CITIBANK", e.hongLeongBank = "HONG_LEONG_BANK", e.hsbcBank = "HSBC_BANK", e.ocbcBank = "OCBC_BANK", e.publicBank = "PUBLIC_BANK", e.affinBank = "AFFIN_BANK", e.amBank = "AMBANK", e.agroBank = "AGRO_BANK", e.allianceBank = "ALLIANCE_BANK", e.alRajhiBank = "AL_RAJHI_BANK", e.bankOfChina = "BANK_OF_CHINA", e.bankOfAmerica = "BANK_OF_AMERICA", e.bankOfTokyoMitsubishiUFJ = "BANK_OF_TOKYO_MITSUBISHI_UFJ", e.bnpParibas = "BNP_PARIBAS", e.deutscheBank = "DEUTSCHE_BANK", e.industrialCommercialBankOfChina = "INDUSTRIAL_COMMERCIAL_BANK_OF_CHINA", e.jpMorganChaseBank = "JP_MORGAN_CHASE_BANK", e.kuwaitFinanceHouse = "KUWAIT_FINANCE_HOUSE", e.mizuhoBank = "MIZUHO_BANK", e.standardCharteredBank = "STANDARD_CHARTERED_BANK", e.sumitomoMitsuiBankingCorporation = "SUMITOMO_MITSUI_BANKING_CORPORATION", e.theRoyalBankOfScotland = "THE_ROYAL_BANK_OF_SCOTLAND", e.unitedOverseasBank = "UNITED_OVERSEAS_BANK";
33
+ }(t.BankName || (t.BankName = {})), function(e) {
34
+ e.current = "CURRENT_ACCOUNT", e.saving = "SAVING_ACCOUNT";
35
+ }(t.BankType || (t.BankType = {})), function(e) {
36
+ e[e.maybank = 100002270] = "maybank", e[e.cimbBank = 100002050] = "cimbBank", e[e.rhbBank = 100002186] = "rhbBank", e[e.bankIslam = 100002458] = "bankIslam", e[e.bankMuamalat = 100002458] = "bankMuamalat", e[e.bankRakyat = 100016020] = "bankRakyat", e[e.bankSimpananNasional = 100016017] = "bankSimpananNasional", e[e.citiBank = 100002173] = "citiBank", e[e.hongLeongBank = 100002241] = "hongLeongBank", e[e.hsbcBank = 100002225] = "hsbcBank", e[e.ocbcBank = 100002296] = "ocbcBank", e[e.publicBank = 100002335] = "publicBank", e[e.affinBank = 100002322] = "affinBank", e[e.amBank = 100002089] = "amBank", e[e.agroBank = 100033061] = "agroBank", e[e.allianceBank = 100002128] = "allianceBank", e[e.alRajhiBank = 100003509] = "alRajhiBank", e[e.bankOfChina = 100002429] = "bankOfChina", e[e.bankOfAmerica = 100002076] = "bankOfAmerica", e[e.bankOfTokyoMitsubishiUFJ = 100002102] = "bankOfTokyoMitsubishiUFJ", e[e.bnpParibas = 100002636] = "bnpParibas", e[e.deutscheBank = 100002199] = "deutscheBank", e[e.industrialCommercialBankOfChina = 100002597] = "industrialCommercialBankOfChina", e[e.jpMorganChaseBank = 100002157] = "jpMorganChaseBank", e[e.kuwaitFinanceHouse = 100003460] = "kuwaitFinanceHouse", e[e.mizuhoBank = 100002610] = "mizuhoBank", e[e.standardCharteredBank = 100002144] = "standardCharteredBank", e[e.sumitomoMitsuiBankingCorporation = 100002623] = "sumitomoMitsuiBankingCorporation", e[e.unitedOverseasBank = 100002267] = "unitedOverseasBank";
37
+ }(t.BankRouting || (t.BankRouting = {})), function(e) {
38
+ e.maybank = "MBBEMYKL", e.cimbBank = "CIBBMYKL", e.rhbBank = "RHBBMYKL", e.bankIslam = "BIMBMYKL", e.bankMuamalat = "BMMBMYKL", e.bankRakyat = "BKRMMYKL", e.bankSimpananNasional = "BSNAMYK1", e.citiBank = "CITIMYKL", e.hongLeongBank = "HLBBMYKL", e.hsbcBank = "HBMBMYKL", e.ocbcBank = "OCBCMYKL", e.publicBank = "PBBEMYKL", e.affinBank = "PHBMMYKL", e.amBank = "ARBKMYKL", e.agroBank = "AGOBMYKL", e.allianceBank = "MFBBMYKL", e.alRajhiBank = "RJHIMYKL", e.bankOfChina = "BKCHMYKL", e.bankOfAmerica = "BOFAMY2X", e.bankOfTokyoMitsubishiUFJ = "BOTKMYKX", e.bnpParibas = "BNPAMYKL", e.deutscheBank = "DEUTMYKL", e.industrialCommercialBankOfChina = "ICBKMYKL", e.jpMorganChaseBank = "CHASMYKX", e.kuwaitFinanceHouse = "KFHOMYKL", e.mizuhoBank = "MHCBMYKA", e.standardCharteredBank = "SCBLMYKX", e.sumitomoMitsuiBankingCorporation = "SMBCMYKL", e.unitedOverseasBank = "UOVBMYKL";
39
+ }(t.BankSwiftCode || (t.BankSwiftCode = {})), function(e) {
40
+ e.grab = "Grab", e.merchant = "Merchant", e.partner = "Partner";
41
+ }(t.GF_CAMPAIGN_CREATED_BY || (t.GF_CAMPAIGN_CREATED_BY = {})), function(e) {
42
+ e.all = "all", e.new = "new";
43
+ }(t.GF_CAMPAIGN_EATER_TYPE || (t.GF_CAMPAIGN_EATER_TYPE = {})), function(e) {
44
+ e.net = "net", e.percentage = "percentage", e.delivery = "delivery", e.freeItem = "freeItem";
45
+ }(t.GF_CAMPAIGN_DISCOUNT_TYPE || (t.GF_CAMPAIGN_DISCOUNT_TYPE = {})), function(e) {
46
+ e.order = "order", e.items = "items";
47
+ }(t.GF_CAMPAIGN_SCOPE_TYPE || (t.GF_CAMPAIGN_SCOPE_TYPE = {}));
48
+ })(Wr);
49
+ var mr = { exports: {} };
50
+ (function(t, e) {
51
+ (function(r, n) {
52
+ t.exports = n();
53
+ })(jr, function() {
54
+ return function(r) {
55
+ var n = {};
56
+ function s(o) {
57
+ if (n[o])
58
+ return n[o].exports;
59
+ var i = n[o] = { i: o, l: !1, exports: {} };
60
+ return r[o].call(i.exports, i, i.exports, s), i.l = !0, i.exports;
61
+ }
62
+ return s.m = r, s.c = n, s.d = function(o, i, f) {
63
+ s.o(o, i) || Object.defineProperty(o, i, { enumerable: !0, get: f });
64
+ }, s.r = function(o) {
65
+ typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(o, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(o, "__esModule", { value: !0 });
66
+ }, s.t = function(o, i) {
67
+ if (1 & i && (o = s(o)), 8 & i || 4 & i && typeof o == "object" && o && o.__esModule)
68
+ return o;
69
+ var f = /* @__PURE__ */ Object.create(null);
70
+ if (s.r(f), Object.defineProperty(f, "default", { enumerable: !0, value: o }), 2 & i && typeof o != "string")
71
+ for (var d in o)
72
+ s.d(
73
+ f,
74
+ d,
75
+ (function(u) {
76
+ return o[u];
77
+ }).bind(null, d)
78
+ );
79
+ return f;
80
+ }, s.n = function(o) {
81
+ var i = o && o.__esModule ? function() {
82
+ return o.default;
83
+ } : function() {
84
+ return o;
85
+ };
86
+ return s.d(i, "a", i), i;
87
+ }, s.o = function(o, i) {
88
+ return Object.prototype.hasOwnProperty.call(o, i);
89
+ }, s.p = "", s(s.s = 0);
90
+ }([
91
+ function(r, n, s) {
92
+ r.exports = s(1);
93
+ },
94
+ function(r, n, s) {
95
+ function o(a) {
96
+ return (o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(l) {
97
+ return typeof l;
98
+ } : function(l) {
99
+ return l && typeof Symbol == "function" && l.constructor === Symbol && l !== Symbol.prototype ? "symbol" : typeof l;
100
+ })(a);
101
+ }
102
+ function i(a) {
103
+ var l = "[object " + a + "]";
104
+ return function(b) {
105
+ return Object.prototype.toString.call(b) === l;
106
+ };
107
+ }
108
+ s.r(n), s.d(n, "default", function() {
109
+ return Z;
110
+ }), s.d(n, "compare", function() {
111
+ return M;
112
+ }), s.d(n, "comparable", function() {
113
+ return q;
114
+ });
115
+ var f = i("Array"), d = i("Object"), u = i("Function");
116
+ function g(a, l) {
117
+ return u(a.get) ? a.get(l) : a[l];
118
+ }
119
+ function c(a) {
120
+ return function(l, b) {
121
+ if (!f(b) || !b.length)
122
+ return a(l, b);
123
+ for (var _ = 0, v = b.length; _ < v; _++)
124
+ if (a(l, g(b, _)))
125
+ return !0;
126
+ return !1;
127
+ };
128
+ }
129
+ function L(a) {
130
+ return function(l, b) {
131
+ if (!f(b) || !b.length)
132
+ return a(l, b);
133
+ for (var _ = 0, v = b.length; _ < v; _++)
134
+ if (!a(l, g(b, _)))
135
+ return !1;
136
+ return !0;
137
+ };
138
+ }
139
+ function y(a, l, b, _) {
140
+ return a.validate(a.options, l, b, _);
141
+ }
142
+ var p = {
143
+ $eq: c(function(a, l) {
144
+ return a(l);
145
+ }),
146
+ $ne: L(function(a, l) {
147
+ return a(l);
148
+ }),
149
+ $gt: c(function(a, l) {
150
+ return a(l);
151
+ }),
152
+ $gte: c(function(a, l) {
153
+ return a(l);
154
+ }),
155
+ $lt: c(function(a, l) {
156
+ return a(l);
157
+ }),
158
+ $lte: c(function(a, l) {
159
+ return a(l);
160
+ }),
161
+ $mod: c(function(a, l) {
162
+ return a(l);
163
+ }),
164
+ $in: function(a, l) {
165
+ return a(l);
166
+ },
167
+ $nin: function(a, l) {
168
+ return a(l);
169
+ },
170
+ $not: function(a, l, b, _) {
171
+ return a(l, b, _);
172
+ },
173
+ $type: function(a, l) {
174
+ return a(l);
175
+ },
176
+ $all: function(a, l, b, _) {
177
+ return p.$and(a, l, b, _);
178
+ },
179
+ $size: function(a, l) {
180
+ return !!l && a === l.length;
181
+ },
182
+ $or: function(a, l, b, _) {
183
+ for (var v = 0, m = a.length; v < m; v++)
184
+ if (y(g(a, v), l, b, _))
185
+ return !0;
186
+ return !1;
187
+ },
188
+ $nor: function(a, l, b, _) {
189
+ return !p.$or(a, l, b, _);
190
+ },
191
+ $and: function(a, l, b, _) {
192
+ for (var v = 0, m = a.length; v < m; v++)
193
+ if (!y(g(a, v), l, b, _))
194
+ return !1;
195
+ return !0;
196
+ },
197
+ $regex: c(function(a, l) {
198
+ return typeof l == "string" && a.test(l);
199
+ }),
200
+ $where: function(a, l, b, _) {
201
+ return a.call(l, l, b, _);
202
+ },
203
+ $elemMatch: function(a, l, b, _) {
204
+ return f(l) ? !!~function(v, m) {
205
+ for (var h = 0; h < v.length; h++)
206
+ if (g(v, h), y(m, g(v, h)))
207
+ return h;
208
+ return -1;
209
+ }(l, a) : y(a, l, b, _);
210
+ },
211
+ $exists: function(a, l, b, _) {
212
+ return _.hasOwnProperty(b) === a;
213
+ }
214
+ }, P = {
215
+ $eq: function(a, l, b) {
216
+ var _ = b.comparable, v = b.compare;
217
+ return a instanceof RegExp ? c(function(m) {
218
+ return typeof m == "string" && a.test(m);
219
+ }) : a instanceof Function ? c(a) : f(a) && !a.length ? c(function(m) {
220
+ return f(m) && !m.length;
221
+ }) : c(
222
+ a === null ? function(m) {
223
+ return m == null;
224
+ } : function(m) {
225
+ return v(_(m), _(a)) === 0;
226
+ }
227
+ );
228
+ },
229
+ $gt: function(a, l, b) {
230
+ var _ = b.comparable, v = b.compare;
231
+ return function(m) {
232
+ return v(_(m), _(a)) > 0;
233
+ };
234
+ },
235
+ $gte: function(a, l, b) {
236
+ var _ = b.comparable, v = b.compare;
237
+ return function(m) {
238
+ return v(_(m), _(a)) >= 0;
239
+ };
240
+ },
241
+ $lt: function(a, l, b) {
242
+ var _ = b.comparable, v = b.compare;
243
+ return function(m) {
244
+ return v(_(m), _(a)) < 0;
245
+ };
246
+ },
247
+ $lte: function(a, l, b) {
248
+ var _ = b.comparable, v = b.compare;
249
+ return function(m) {
250
+ return v(_(m), _(a)) <= 0;
251
+ };
252
+ },
253
+ $in: function(a, l, b) {
254
+ var _ = b.comparable;
255
+ return function(v) {
256
+ if (!(v instanceof Array)) {
257
+ var m = _(v);
258
+ if (m === v && o(v) === "object") {
259
+ for (w = a.length; w--; )
260
+ if (String(a[w]) === String(v) && String(v) !== "[object Object]")
261
+ return !0;
262
+ }
263
+ if (m === void 0) {
264
+ for (w = a.length; w--; )
265
+ if (a[w] == null)
266
+ return !0;
267
+ }
268
+ for (w = a.length; w--; ) {
269
+ var h = y(J(g(a, w), b), m, w, a);
270
+ if (h && String(h) !== "[object Object]" && String(m) !== "[object Object]")
271
+ return !0;
272
+ }
273
+ return !!~a.indexOf(m);
274
+ }
275
+ for (var w = v.length; w--; )
276
+ if (~a.indexOf(_(g(v, w))))
277
+ return !0;
278
+ return !1;
279
+ };
280
+ },
281
+ $nin: function(a, l, b) {
282
+ var _ = P.$in(a, l, b);
283
+ return function(v, m, h, w) {
284
+ return !_(v, m, h, w);
285
+ };
286
+ },
287
+ $mod: function(a) {
288
+ return function(l) {
289
+ return l % a[0] == a[1];
290
+ };
291
+ },
292
+ $ne: function(a, l, b) {
293
+ var _ = P.$eq(a, l, b);
294
+ return L(function(v, m, h, w) {
295
+ return !_(v, m, h, w);
296
+ });
297
+ },
298
+ $and: function(a, l, b) {
299
+ return a.map(I(b));
300
+ },
301
+ $all: function(a, l, b) {
302
+ return P.$and(a, l, b);
303
+ },
304
+ $or: function(a, l, b) {
305
+ return a.map(I(b));
306
+ },
307
+ $nor: function(a, l, b) {
308
+ return a.map(I(b));
309
+ },
310
+ $not: function(a, l, b) {
311
+ var _ = I(b)(a);
312
+ return function(v, m, h) {
313
+ return !y(_, v, m, h);
314
+ };
315
+ },
316
+ $type: function(a) {
317
+ return function(l, b, _) {
318
+ return l != null && (l instanceof a || l.constructor == a);
319
+ };
320
+ },
321
+ $regex: function(a, l) {
322
+ return new RegExp(a, l.$options);
323
+ },
324
+ $where: function(a) {
325
+ if (typeof a == "function")
326
+ return a;
327
+ throw new Error(
328
+ 'In CSP mode, sift does not support strings in "$where" condition'
329
+ );
330
+ },
331
+ $elemMatch: function(a, l, b) {
332
+ return I(b)(a);
333
+ },
334
+ $exists: function(a) {
335
+ return !!a;
336
+ }
337
+ };
338
+ function N(a, l) {
339
+ return { options: a, validate: l };
340
+ }
341
+ function C(a, l) {
342
+ var b = a.keyPath, _ = a.child, v = a.query, m = [];
343
+ if (function U(V, B, X, z, ue) {
344
+ if (X === B.length || V == null)
345
+ return void ue.push([V, B[X - 1], z]);
346
+ var $t = g(B, X);
347
+ if (f(V) && isNaN(Number($t)))
348
+ for (var Be = 0, Or = V.length; Be < Or; Be++)
349
+ U(g(V, Be), B, X, V, ue);
350
+ else
351
+ U(g(V, $t), B, X + 1, V, ue);
352
+ }(l, b, 0, l, m), m.length === 1) {
353
+ var h = m[0];
354
+ return y(_, h[0], h[1], h[2]);
355
+ }
356
+ for (var w = v && v.$ne !== void 0, O = w, $ = 0; $ < m.length; $++) {
357
+ var A = m[$], S = y(_, A[0], A[1], A[2]);
358
+ w ? O &= S : O |= S;
359
+ }
360
+ return O;
361
+ }
362
+ function x(a, l, b) {
363
+ return N({ keyPath: a, child: l, query: b }, C);
364
+ }
365
+ function I(a) {
366
+ var l = a.comparable, b = a.expressions, _ = function(h) {
367
+ var w;
368
+ return (!h || !(w = h) || w.constructor !== Object && w.constructor !== Array && w.constructor.toString() !== "function Object() { [native code] }" && w.constructor.toString() !== "function Array() { [native code] }" || w.toJSON) && (h = { $eq: h }), h;
369
+ }, v = function(h) {
370
+ h = l(h);
371
+ var w = [];
372
+ for (var O in h) {
373
+ var $ = h[O];
374
+ if (O !== "$options") {
375
+ var A = p[O] || a && b && b[O];
376
+ if (A)
377
+ P[O] && ($ = P[O]($, h, a)), w.push(N(l($), A));
378
+ else {
379
+ if (O.charCodeAt(0) === 36)
380
+ throw new Error("Unknown operation " + O);
381
+ var S = O.split(".");
382
+ w.push(x(S, m($), $));
383
+ }
384
+ }
385
+ }
386
+ return w.length === 1 ? w[0] : N(w, p.$and);
387
+ }, m = function(h) {
388
+ return h = _(h), function w(O, $) {
389
+ if (!d(O))
390
+ return $;
391
+ for (var A in O)
392
+ $.push(A), w(O[A], $);
393
+ return $;
394
+ }(h, []).join(",").search(/[$.]/) === -1 ? N(h, F) : v(h);
395
+ };
396
+ return function(h) {
397
+ return v(_(h));
398
+ };
399
+ }
400
+ function F(a, l) {
401
+ if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(l))
402
+ return !1;
403
+ if (d(a)) {
404
+ if (Object.keys(a).length !== Object.keys(l).length)
405
+ return !1;
406
+ for (var b in a)
407
+ if (!F(a[b], l[b]))
408
+ return !1;
409
+ return !0;
410
+ }
411
+ if (f(a)) {
412
+ if (a.length !== l.length)
413
+ return !1;
414
+ for (var _ = 0, v = a.length; _ < v; _++)
415
+ if (!F(a[_], l[_]))
416
+ return !1;
417
+ return !0;
418
+ }
419
+ return a === l;
420
+ }
421
+ function J(a, l) {
422
+ var b = I(l)(a);
423
+ return l && l.select && (b = {
424
+ options: b,
425
+ validate: function(_, v, m, h) {
426
+ return y(_, v && l.select(v), m, h);
427
+ }
428
+ }), b;
429
+ }
430
+ function Z(a, l) {
431
+ var b = J(a, l = Object.assign({ compare: M, comparable: q }, l));
432
+ return function(_, v, m) {
433
+ return y(b, _, v, m);
434
+ };
435
+ }
436
+ function M(a, l) {
437
+ if (F(a, l))
438
+ return 0;
439
+ if (o(a) === o(l)) {
440
+ if (a > l)
441
+ return 1;
442
+ if (a < l)
443
+ return -1;
444
+ }
445
+ }
446
+ function q(a) {
447
+ return a instanceof Date ? a.getTime() : f(a) ? a.map(q) : a && typeof a.toJSON == "function" ? a.toJSON() : a;
448
+ }
449
+ }
450
+ ]);
451
+ });
452
+ })(mr);
453
+ var Jr = mr.exports;
454
+ const Zr = /* @__PURE__ */ ar(Jr);
455
+ function wt(t, e) {
456
+ for (var r = 0; r < e.length; r++) {
457
+ var n = e[r];
458
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
459
+ }
460
+ }
461
+ function Qr(t, e, r) {
462
+ return e && wt(t.prototype, e), r && wt(t, r), t;
463
+ }
464
+ function en(t, e) {
465
+ t.prototype = Object.create(e.prototype), t.prototype.constructor = t, t.__proto__ = e;
466
+ }
467
+ function nt(t) {
468
+ return nt = Object.setPrototypeOf ? Object.getPrototypeOf : function(r) {
469
+ return r.__proto__ || Object.getPrototypeOf(r);
470
+ }, nt(t);
471
+ }
472
+ function Fe(t, e) {
473
+ return Fe = Object.setPrototypeOf || function(n, s) {
474
+ return n.__proto__ = s, n;
475
+ }, Fe(t, e);
476
+ }
477
+ function tn() {
478
+ if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
479
+ return !1;
480
+ if (typeof Proxy == "function")
481
+ return !0;
482
+ try {
483
+ return Date.prototype.toString.call(Reflect.construct(Date, [], function() {
484
+ })), !0;
485
+ } catch {
486
+ return !1;
487
+ }
488
+ }
489
+ function Le(t, e, r) {
490
+ return tn() ? Le = Reflect.construct : Le = function(s, o, i) {
491
+ var f = [null];
492
+ f.push.apply(f, o);
493
+ var d = Function.bind.apply(s, f), u = new d();
494
+ return i && Fe(u, i.prototype), u;
495
+ }, Le.apply(null, arguments);
496
+ }
497
+ function rn(t) {
498
+ return Function.toString.call(t).indexOf("[native code]") !== -1;
499
+ }
500
+ function st(t) {
501
+ var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
502
+ return st = function(n) {
503
+ if (n === null || !rn(n))
504
+ return n;
505
+ if (typeof n != "function")
506
+ throw new TypeError("Super expression must either be null or a function");
507
+ if (typeof e < "u") {
508
+ if (e.has(n))
509
+ return e.get(n);
510
+ e.set(n, s);
511
+ }
512
+ function s() {
513
+ return Le(n, arguments, nt(this).constructor);
514
+ }
515
+ return s.prototype = Object.create(n.prototype, {
516
+ constructor: {
517
+ value: s,
518
+ enumerable: !1,
519
+ writable: !0,
520
+ configurable: !0
521
+ }
522
+ }), Fe(s, n);
523
+ }, st(t);
524
+ }
525
+ function Rt(t) {
526
+ if (t === void 0)
527
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
528
+ return t;
529
+ }
530
+ var pr = function(e) {
531
+ return 'Cannot execute "' + e.action + '" on "' + e.subjectName + '"';
532
+ }, Re = pr, nn = /* @__PURE__ */ function(t) {
533
+ en(e, t), e.setDefaultMessage = function(s) {
534
+ s === null ? Re = pr : Re = typeof s == "string" ? function() {
535
+ return s;
536
+ } : s;
537
+ }, e.from = function(s) {
538
+ var o = new this("");
539
+ return Object.defineProperty(o, "ability", {
540
+ value: s
541
+ }), o;
542
+ };
543
+ function e(n, s) {
544
+ var o;
545
+ return s === void 0 && (s = {}), o = t.call(this, n) || this, o._setMetadata(s), o.message = n || Re(Rt(o)), o._customMessage = null, typeof Error.captureStackTrace == "function" && (o.name = o.constructor.name, Error.captureStackTrace(Rt(o), o.constructor)), o;
546
+ }
547
+ var r = e.prototype;
548
+ return r.setMessage = function(s) {
549
+ return this._customMessage = s, this;
550
+ }, r.throwUnlessCan = function(s, o, i) {
551
+ if (!this.ability)
552
+ throw new ReferenceError("Cannot throw FordiddenError without respective ability instance");
553
+ var f = this.ability.relevantRuleFor(s, o, i);
554
+ if (!(f && !f.inverted)) {
555
+ this._setMetadata({
556
+ action: s,
557
+ subject: o,
558
+ field: i,
559
+ subjectName: this.ability.subjectName(o)
560
+ });
561
+ var d = f ? f.reason : "";
562
+ throw this.message = this._customMessage || d || Re(this), this;
563
+ }
564
+ }, r._setMetadata = function(s) {
565
+ this.subject = s.subject, this.subjectName = s.subjectName, this.action = s.action, this.field = s.field;
566
+ }, e;
567
+ }(st(Error));
568
+ function at(t) {
569
+ return Array.isArray(t) ? t : [t];
570
+ }
571
+ function sn(t) {
572
+ if (!t || typeof t == "string")
573
+ return t;
574
+ var e = typeof t == "object" ? t.constructor : t;
575
+ return e.modelName || e.name;
576
+ }
577
+ function an(t) {
578
+ return JSON.parse(JSON.stringify(t));
579
+ }
580
+ var on = /[-/\\^$+?.()|[\]{}]/g, ln = /\.?\*+\.?/g, un = /\*+/, cn = /\./g;
581
+ function dn(t, e, r) {
582
+ var n = r[0] === "*" || t[0] === "." && t[t.length - 1] === "." ? "+" : "*", s = t.indexOf("**") === -1 ? "[^.]" : ".", o = t.replace(cn, "\\$&").replace(un, s + n);
583
+ return e + t.length === r.length ? "(?:" + o + ")?" : o;
584
+ }
585
+ function fn(t, e, r) {
586
+ return t === "." && (r[e - 1] === "*" || r[e + 1] === "*") ? t : "\\" + t;
587
+ }
588
+ function mn(t) {
589
+ var e = t.map(function(n) {
590
+ return n.replace(on, fn).replace(ln, dn);
591
+ }), r = e.length > 1 ? "(?:" + e.join("|") + ")" : e[0];
592
+ return new RegExp("^" + r + "$");
593
+ }
594
+ var pn = /* @__PURE__ */ function() {
595
+ function t(r) {
596
+ this.actions = r.actions || r.action, this.subject = r.subject, this.fields = !r.fields || r.fields.length === 0 ? void 0 : at(r.fields), Object.defineProperty(this, "_fieldsPattern", {
597
+ writable: !0
598
+ }), this.inverted = !!r.inverted, this.conditions = r.conditions, Object.defineProperty(this, "_matches", {
599
+ writable: !0,
600
+ value: this.conditions ? Zr(this.conditions) : void 0
601
+ }), this.reason = r.reason;
602
+ }
603
+ var e = t.prototype;
604
+ return e.matches = function(n) {
605
+ return this._matches ? typeof n == "string" ? !this.inverted : this._matches(n) : !0;
606
+ }, e.isRelevantFor = function(n, s) {
607
+ return this.fields ? s ? this.matchesField(s) : !this.inverted : !0;
608
+ }, e.matchesField = function(n) {
609
+ return typeof this._fieldsPattern > "u" && (this._fieldsPattern = this.fields.join("").indexOf("*") === -1 ? null : mn(this.fields)), this._fieldsPattern === null || n.indexOf("*") !== -1 ? this.fields.indexOf(n) !== -1 : this._fieldsPattern.test(n);
610
+ }, t;
611
+ }(), te = typeof Symbol < "u" ? Symbol("private") : "__" + Date.now(), It = {
612
+ crud: ["create", "read", "update", "delete"]
613
+ };
614
+ function At(t, e) {
615
+ return t === e || Array.isArray(e) && e.indexOf(t) !== -1;
616
+ }
617
+ var hn = /* @__PURE__ */ function() {
618
+ t.addAlias = function(n, s) {
619
+ if (n === "manage" || At("manage", s))
620
+ throw new Error('Cannot add alias for "manage" action because it represents any action');
621
+ if (At(n, s))
622
+ throw new Error("Attempt to alias action to itself: " + n + " -> " + s.toString());
623
+ return It[n] = s, this;
624
+ };
625
+ function t(r, n) {
626
+ n === void 0 && (n = {}), Object.defineProperty(this, "subjectName", {
627
+ value: n.subjectName || sn
628
+ }), this[te] = {
629
+ RuleType: n.RuleType || pn,
630
+ originalRules: r || [],
631
+ hasPerFieldRules: !1,
632
+ indexedRules: /* @__PURE__ */ Object.create(null),
633
+ mergedRules: /* @__PURE__ */ Object.create(null),
634
+ events: {},
635
+ aliases: an(It)
636
+ }, this.update(r);
637
+ }
638
+ var e = t.prototype;
639
+ return e.update = function(n) {
640
+ if (!Array.isArray(n))
641
+ return this;
642
+ var s = {
643
+ rules: n,
644
+ ability: this
645
+ };
646
+ this.emit("update", s), this[te].originalRules = n.slice(0), this[te].mergedRules = /* @__PURE__ */ Object.create(null);
647
+ var o = this.buildIndexFor(n);
648
+ return process.env.NODE_ENV !== "production" && o.isAllInverted && n.length && console.warn("[casl]: Ability contains only inverted rules. That means user will not be able to do any actions. This will be changed to Error throw in the next major version"), this[te].indexedRules = o.rules, this[te].hasPerFieldRules = o.hasPerFieldRules, this.emit("updated", s), this;
649
+ }, e.buildIndexFor = function(n) {
650
+ for (var s = /* @__PURE__ */ Object.create(null), o = this[te].RuleType, i = !0, f = !1, d = 0; d < n.length; d++) {
651
+ var u = new o(n[d]), g = this.expandActions(u.actions), c = at(u.subject), L = n.length - d - 1;
652
+ i = !!(i && u.inverted), !f && u.fields && (f = !0);
653
+ for (var y = 0; y < c.length; y++) {
654
+ var p = c[y];
655
+ s[p] = s[p] || /* @__PURE__ */ Object.create(null);
656
+ for (var P = 0; P < g.length; P++) {
657
+ var N = g[P];
658
+ s[p][N] = s[p][N] || /* @__PURE__ */ Object.create(null), s[p][N][L] = u;
659
+ }
660
+ }
661
+ }
662
+ return {
663
+ isAllInverted: i,
664
+ hasPerFieldRules: f,
665
+ rules: s
666
+ };
667
+ }, e.expandActions = function(n) {
668
+ for (var s = this[te].aliases, o = at(n), i = 0; i < o.length; ) {
669
+ var f = o[i++];
670
+ s.hasOwnProperty(f) && (o = o.concat(s[f]));
671
+ }
672
+ return o;
673
+ }, e.can = function(n, s, o) {
674
+ if (o && typeof o != "string")
675
+ throw new Error("Ability.can expects 3rd parameter to be a string. See https://stalniy.github.io/casl/abilities/2017/07/21/check-abilities.html#checking-fields for details");
676
+ var i = this.relevantRuleFor(n, s, o);
677
+ return !!i && !i.inverted;
678
+ }, e.relevantRuleFor = function(n, s, o) {
679
+ for (var i = this.rulesFor(n, s, o), f = 0; f < i.length; f++)
680
+ if (i[f].matches(s))
681
+ return i[f];
682
+ return null;
683
+ }, e.possibleRulesFor = function(n, s) {
684
+ var o = this.subjectName(s), i = this[te].mergedRules, f = o + "_" + n;
685
+ return i[f] || (i[f] = this.mergeRulesFor(n, o)), i[f];
686
+ }, e.mergeRulesFor = function(n, s) {
687
+ var o = this[te].indexedRules, i = [s, "all"].reduce(function(f, d) {
688
+ var u = o[d];
689
+ return u ? Object.assign(f, u[n], u.manage) : f;
690
+ }, []);
691
+ return i.filter(Boolean);
692
+ }, e.rulesFor = function(n, s, o) {
693
+ var i = this.possibleRulesFor(n, s);
694
+ return this[te].hasPerFieldRules ? i.filter(function(f) {
695
+ return f.isRelevantFor(s, o);
696
+ }) : i;
697
+ }, e.cannot = function() {
698
+ return !this.can.apply(this, arguments);
699
+ }, e.throwUnlessCan = function() {
700
+ var n;
701
+ console.warn(`
702
+ Ability.throwUnlessCan is deprecated and will be removed in 4.x version.
703
+ Please use "ForbiddenError.from(ability).throwUnlessCan(...)" instead.
704
+ `.trim()), (n = nn.from(this)).throwUnlessCan.apply(n, arguments);
705
+ }, e.on = function(n, s) {
706
+ var o = this[te].events, i = !0;
707
+ return o[n] || (o[n] = []), o[n].push(s), function() {
708
+ if (i) {
709
+ var f = o[n].indexOf(s);
710
+ o[n].splice(f, 1), i = !1;
711
+ }
712
+ };
713
+ }, e.emit = function(n, s) {
714
+ var o = this[te].events[n];
715
+ o && o.slice(0).forEach(function(i) {
716
+ return i(s);
717
+ });
718
+ }, Qr(t, [{
719
+ key: "rules",
720
+ get: function() {
721
+ return this[te].originalRules;
722
+ }
723
+ }]), t;
724
+ }(), ye;
725
+ ((t) => {
726
+ ((e) => {
727
+ e[e.feedMe = 0] = "feedMe", e[e.business = 1] = "business", e[e.restaurant = 2] = "restaurant";
728
+ })(t.Level || (t.Level = {})), ((e) => {
729
+ e.manage = "manage", e.create = "create", e.read = "read", e.update = "update", e.delete = "delete";
730
+ })(t.Action || (t.Action = {}));
731
+ })(ye || (ye = {}));
732
+ ((t) => {
733
+ ((e) => {
734
+ ((r) => {
735
+ r.all = "all", r.restaurant = "restaurant", r.business = "business", r.delivery = "delivery", r.agent = "agent";
736
+ })(e.Feedme || (e.Feedme = {})), ((r) => {
737
+ r.quota = "quota", r.owner = "owner";
738
+ })(e.FeedmeBusinessField || (e.FeedmeBusinessField = {})), ((r) => {
739
+ r.profile = "business::profile", r.restaurant = "business::restaurant", r.menu = "business::menu", r.promotion = "business::promotion", r.voucher = "business::voucher", r.membership = "business::membership", r.stock = "business::stock", r.permission = "business::permission", r.role = "business::role";
740
+ })(e.Business || (e.Business = {})), ((r) => {
741
+ r.restaurant = "restaurant";
742
+ })(e.Restaurant || (e.Restaurant = {}));
743
+ })(t.Subject || (t.Subject = {}));
744
+ })(ye || (ye = {}));
745
+ function vn(t, e) {
746
+ const n = fe().sessionUser.value;
747
+ if (!n)
748
+ return;
749
+ const { isAdmin: s } = n.role, o = n.permissions, i = e.filter((f) => f.businessId === t._id).length;
750
+ return t.restaurantQuota > i && ((n == null ? void 0 : n.id) === t.ownerId || s) && new hn(o).can(
751
+ ye.Action.manage,
752
+ ye.Subject.Feedme.all
753
+ );
754
+ }
755
+ const bn = (t) => {
756
+ const e = re(t || "");
757
+ function r(o) {
758
+ return `${o}`.trim().toLowerCase();
759
+ }
760
+ const n = H(() => r(e.value));
761
+ function s(o) {
762
+ return n.value ? o.some((i) => r(i).includes(n.value)) : !0;
763
+ }
764
+ return { searchKey: e, filter: s };
765
+ };
766
+ function Ot(t = "no name") {
767
+ return {
768
+ name: t,
769
+ address: {
770
+ line1: "",
771
+ line2: "",
772
+ state: "",
773
+ city: "",
774
+ postcode: "",
775
+ country: "",
776
+ coordinates: []
777
+ },
778
+ phoneNo: "",
779
+ regNo: "",
780
+ email: ""
781
+ };
782
+ }
783
+ function Pt() {
784
+ return Ee({
785
+ line1: "",
786
+ line2: "",
787
+ city: "",
788
+ postcode: "",
789
+ state: "",
790
+ country: "",
791
+ coordinates: []
792
+ });
793
+ }
794
+ function Ee(t) {
795
+ return {
796
+ ...t,
797
+ get formatted() {
798
+ const { line1: e, line2: r, postcode: n, city: s, state: o, country: i } = t;
799
+ return [e, r || "", n, s, o, i].map((f) => f.replace(/,\s*$/, "")).filter((f) => !!f.trim()).join(", ");
800
+ },
801
+ get isValidPostcode() {
802
+ const e = Number.parseInt(t.postcode);
803
+ return !isNaN(e);
804
+ },
805
+ get isValid() {
806
+ const e = ["line2"];
807
+ return Object.keys(t).filter((r) => !e.includes(r)).every((r) => !!t[r]);
808
+ },
809
+ get isValidCoordinate() {
810
+ return (t.coordinates || []).length === 2;
811
+ }
812
+ };
813
+ }
814
+ const gn = {
815
+ class: /* @__PURE__ */ Y([
816
+ "flex items-center",
817
+ "px-24 pt-16 pb-8",
818
+ "border-b border-fm-color-neutral-gray-100",
819
+ "space-x-4"
820
+ ])
821
+ }, yn = { class: "fm-typo-en-title-sm-600 mr-auto" }, $n = {
822
+ class: /* @__PURE__ */ Y(["flex flex-col", "flex-1 overflow-scroll", "w-full", "px-24"])
823
+ }, _n = /* @__PURE__ */ W({
824
+ __name: "FullScreenForm",
825
+ props: {
826
+ show: { type: Boolean },
827
+ title: {},
828
+ primaryAction: {},
829
+ secondaryActions: {},
830
+ zIndex: { default: 50 }
831
+ },
832
+ emits: ["onPrimary", "onCancel"],
833
+ setup(t, { emit: e }) {
834
+ const r = e, n = () => {
835
+ r("onPrimary");
836
+ }, s = () => {
837
+ r("onCancel");
838
+ };
839
+ return (o, i) => {
840
+ const f = K("fm-button"), d = K("fm-form");
841
+ return k(), Q(Tr, { to: "body" }, [
842
+ T(Lr, { name: "fade" }, {
843
+ default: G(() => [
844
+ o.show ? (k(), Q(d, {
845
+ key: 0,
846
+ "blame-form-child-on-validation-failed": "",
847
+ class: Y(["fixed inset-0", "flex flex-col", "w-screen h-dvh", "bg-fm-color-neutral-white"]),
848
+ style: Ne({ zIndex: o.zIndex }),
849
+ tabindex: "-1",
850
+ onValidationSuccess: n,
851
+ onKeyup: Nr(s, ["esc"])
852
+ }, {
853
+ default: G(() => [
854
+ E("div", gn, [
855
+ E("p", yn, j(o.title), 1),
856
+ ne(o.$slots, "append-title", {}, void 0, !0),
857
+ (k(!0), D(se, null, me(o.secondaryActions, (u) => (k(), Q(f, {
858
+ label: u.label,
859
+ variant: "tertiary",
860
+ onClick: u.click
861
+ }, null, 8, ["label", "onClick"]))), 256)),
862
+ T(f, {
863
+ label: o.primaryAction.label,
864
+ type: "submit",
865
+ variant: "primary"
866
+ }, null, 8, ["label"])
867
+ ]),
868
+ E("div", $n, [
869
+ ne(o.$slots, "default", {}, void 0, !0)
870
+ ])
871
+ ]),
872
+ _: 3
873
+ }, 8, ["style"])) : le("", !0)
874
+ ]),
875
+ _: 3
876
+ })
877
+ ]);
878
+ };
879
+ }
880
+ });
881
+ const En = /* @__PURE__ */ fr(_n, [["__scopeId", "data-v-5b5c7179"]]), wn = { class: "fm-typo-en-body-lg-600" }, Rn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, St = /* @__PURE__ */ W({
882
+ __name: "FormLabel",
883
+ props: {
884
+ label: {},
885
+ optional: { type: Boolean, default: !1 },
886
+ subLabel: {}
887
+ },
888
+ setup(t) {
889
+ const e = t, r = H(() => e.optional && !e.subLabel ? "(optional)" : e.subLabel);
890
+ return (n, s) => (k(), D("p", wn, [
891
+ Ce(j(n.label) + " ", 1),
892
+ E("span", Rn, j(r.value), 1)
893
+ ]));
894
+ }
895
+ }), In = { class: "space-y-4" }, An = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, On = { class: "fm-typo-en-body-lg-600" }, Tt = /* @__PURE__ */ W({
896
+ __name: "InfoBasic",
897
+ props: {
898
+ name: {
899
+ type: String,
900
+ required: !0
901
+ },
902
+ value: {
903
+ type: String,
904
+ required: !0
905
+ }
906
+ },
907
+ setup(t) {
908
+ return (e, r) => (k(), D("div", In, [
909
+ E("div", An, j(t.name), 1),
910
+ E("div", On, j(t.value), 1)
911
+ ]));
912
+ }
913
+ }), Pn = {}, Sn = { class: "py-4" };
914
+ function Tn(t, e) {
915
+ return k(), D("div", Sn, e[0] || (e[0] = [
916
+ E("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)
917
+ ]));
918
+ }
919
+ const Ln = /* @__PURE__ */ fr(Pn, [["render", Tn]]), Nn = {
920
+ key: 0,
921
+ class: "ml-40 w-[320px] fm-corner-radius-lg p-16 border border-fm-color-neutral-gray-200 space-y-4"
922
+ }, Cn = { class: "fm-typo-en-title-sm-600" }, Lt = /* @__PURE__ */ W({
923
+ __name: "Summary",
924
+ props: {
925
+ title: {},
926
+ variant: {},
927
+ items: {}
928
+ },
929
+ setup(t) {
930
+ const e = t, r = lr();
931
+ function n() {
932
+ r.open({
933
+ title: e.title,
934
+ contentComponent: ke("div", { class: "space-y-4" }, [
935
+ ...e.items.map(
936
+ (s) => ke(Tt, {
937
+ name: s.name,
938
+ value: s.value || "--"
939
+ })
940
+ )
941
+ ])
942
+ });
943
+ }
944
+ return (s, o) => {
945
+ const i = K("FmButton");
946
+ return e.variant === "full" ? (k(), D("div", Nn, [
947
+ E("div", Cn, j(s.title), 1),
948
+ T(Ln),
949
+ (k(!0), D(se, null, me(s.items, (f) => (k(), Q(Tt, {
950
+ key: f.name,
951
+ name: f.name,
952
+ value: f.value || "--"
953
+ }, null, 8, ["name", "value"]))), 128))
954
+ ])) : (k(), Q(i, {
955
+ key: 1,
956
+ icon: "info",
957
+ variant: "tertiary",
958
+ onClick: n
959
+ }));
960
+ };
961
+ }
962
+ }), kn = {
963
+ key: 0,
964
+ class: "space-y-4"
965
+ }, xn = { class: "fm-typo-en-body-lg-600" }, Vn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, Fn = {
966
+ class: /* @__PURE__ */ Y(["absolute inset-0", "h-full w-full", "rounded-md overflow-hidden"])
967
+ }, jn = {
968
+ class: /* @__PURE__ */ Y(["relative z-0", "w-full h-full", "overflow-hidden"])
969
+ }, Mn = ["src"], Un = { class: "fm-typo-en-body-lg-600" }, Dn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary" }, be = /* @__PURE__ */ W({
970
+ __name: "ImageDropField",
971
+ props: {
972
+ label: {},
973
+ subLabel: {},
974
+ modelValue: {},
975
+ previousUrl: {},
976
+ width: { default: 323 },
977
+ height: { default: 216 },
978
+ canDelete: { type: Boolean, default: !0 }
979
+ },
980
+ emits: ["update:model-value", "reset:model-value"],
981
+ setup(t, { emit: e }) {
982
+ const r = t, n = e, s = H(() => r.modelValue ? URL.createObjectURL(r.modelValue) : r.previousUrl);
983
+ return (o, i) => {
984
+ const f = K("fm-icon"), d = K("fm-drop-field");
985
+ return s.value ? (k(), D("div", kn, [
986
+ E("p", xn, [
987
+ Ce(j(r.label) + " ", 1),
988
+ E("span", Vn, j(o.subLabel), 1)
989
+ ]),
990
+ E("div", {
991
+ class: Y(["relative", "border-2 border-dashed border-fm-color-neutral-gray-300 rounded-md"]),
992
+ style: Ne({ width: `${r.width}px`, height: `${r.height}px` })
993
+ }, [
994
+ E("div", Fn, [
995
+ E("div", jn, [
996
+ E("img", {
997
+ class: Y(["h-full w-full", "object-cover"]),
998
+ src: s.value,
999
+ alt: "product image"
1000
+ }, null, 8, Mn)
1001
+ ])
1002
+ ]),
1003
+ o.canDelete ? (k(), D("button", {
1004
+ key: 0,
1005
+ class: Y([
1006
+ "absolute top-12 right-12 z-10",
1007
+ "w-24 h-24 rounded-[50%]",
1008
+ "bg-fm-color-neutral-white"
1009
+ ]),
1010
+ type: "button",
1011
+ onClick: i[0] || (i[0] = (u) => n("reset:model-value"))
1012
+ }, [
1013
+ T(f, { name: "close" })
1014
+ ])) : le("", !0)
1015
+ ], 4)
1016
+ ])) : (k(), Q(d, {
1017
+ key: 1,
1018
+ accept: ".jpg, .jpeg, .png, .gif",
1019
+ style: Ne({ width: `${r.width}px`, height: `${r.height}px` }),
1020
+ onFileUpload: i[1] || (i[1] = (u) => n("update:model-value", u))
1021
+ }, {
1022
+ label: G(() => [
1023
+ E("p", Un, [
1024
+ Ce(j(r.label) + " ", 1),
1025
+ E("span", Dn, j(r.subLabel), 1)
1026
+ ])
1027
+ ]),
1028
+ "accept-text": G(() => i[2] || (i[2] = [
1029
+ E("p", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Accepts .jpg, .jpeg, .png, .gif ", -1)
1030
+ ])),
1031
+ _: 1
1032
+ }, 8, ["style"]));
1033
+ };
1034
+ }
1035
+ }), Gn = { class: "space-y-24" }, Bn = { class: "flex gap-16 xs:flex-col xs:gap-24" }, Kn = { class: "flex-1" }, qn = { class: "flex-1" }, zn = { class: "flex gap-16 xs:flex-col xs:gap-24" }, Hn = { class: "flex-1" }, Xn = { class: "flex-1" }, Yn = { class: "flex gap-16 xs:flex-col xs:gap-24" }, Wn = { class: "flex-1" }, Jn = { class: "flex-1" }, Zn = /* @__PURE__ */ W({
1036
+ __name: "RestaurantAddress",
1037
+ props: {
1038
+ modelValue: {
1039
+ type: Object,
1040
+ required: !0
1041
+ }
1042
+ },
1043
+ emits: ["update:model-value"],
1044
+ setup(t, { emit: e }) {
1045
+ const { t: r } = pe();
1046
+ Pt();
1047
+ const n = t, s = e, o = H(() => ge(n.modelValue || Pt()));
1048
+ function i(d) {
1049
+ return (d || "").toString();
1050
+ }
1051
+ function f(d) {
1052
+ s("update:model-value", d(o.value));
1053
+ }
1054
+ return (d, u) => {
1055
+ const g = K("FmTextField");
1056
+ return k(), D("div", Gn, [
1057
+ E("div", Bn, [
1058
+ E("div", Kn, [
1059
+ T(g, {
1060
+ "model-value": o.value.line1,
1061
+ label: R(r)("settings.address.line1"),
1062
+ "label-mark": "required",
1063
+ rules: [R(ce)],
1064
+ "onUpdate:modelValue": u[0] || (u[0] = (c) => f((L) => ({ ...L, line1: i(c) })))
1065
+ }, null, 8, ["model-value", "label", "rules"])
1066
+ ]),
1067
+ E("div", qn, [
1068
+ T(g, {
1069
+ "model-value": o.value.line2,
1070
+ label: R(r)("settings.address.line2"),
1071
+ "onUpdate:modelValue": u[1] || (u[1] = (c) => f((L) => ({ ...L, line2: i(c) })))
1072
+ }, null, 8, ["model-value", "label"])
1073
+ ])
1074
+ ]),
1075
+ E("div", zn, [
1076
+ E("div", Hn, [
1077
+ T(g, {
1078
+ "model-value": o.value.city,
1079
+ rules: [R(ce)],
1080
+ label: R(r)("settings.address.city"),
1081
+ "label-mark": "required",
1082
+ "onUpdate:modelValue": u[2] || (u[2] = (c) => f((L) => ({ ...L, city: i(c) })))
1083
+ }, null, 8, ["model-value", "rules", "label"])
1084
+ ]),
1085
+ E("div", Xn, [
1086
+ T(g, {
1087
+ "model-value": o.value.postcode,
1088
+ label: R(r)("settings.address.postal_code"),
1089
+ "label-mark": "required",
1090
+ rules: [R(ce)],
1091
+ "onUpdate:modelValue": u[3] || (u[3] = (c) => f((L) => ({ ...L, postcode: i(c) })))
1092
+ }, null, 8, ["model-value", "label", "rules"])
1093
+ ])
1094
+ ]),
1095
+ E("div", Yn, [
1096
+ E("div", Wn, [
1097
+ T(g, {
1098
+ "model-value": o.value.state,
1099
+ label: R(r)("settings.address.state"),
1100
+ "label-mark": "required",
1101
+ rules: [R(ce)],
1102
+ "onUpdate:modelValue": u[4] || (u[4] = (c) => f((L) => ({ ...L, state: i(c) })))
1103
+ }, null, 8, ["model-value", "label", "rules"])
1104
+ ]),
1105
+ E("div", Jn, [
1106
+ T(g, {
1107
+ "model-value": o.value.country,
1108
+ label: R(r)("settings.address.country"),
1109
+ "label-mark": "required",
1110
+ rules: [R(ce)],
1111
+ "onUpdate:modelValue": u[5] || (u[5] = (c) => f((L) => ({ ...L, country: i(c) })))
1112
+ }, null, 8, ["model-value", "label", "rules"])
1113
+ ])
1114
+ ])
1115
+ ]);
1116
+ };
1117
+ }
1118
+ }), Qn = /* @__PURE__ */ W({
1119
+ __name: "GoogleMap",
1120
+ props: {
1121
+ markers: {
1122
+ type: Array,
1123
+ default: () => []
1124
+ },
1125
+ polygons: {
1126
+ type: Array,
1127
+ default: () => []
1128
+ },
1129
+ zoom: {
1130
+ type: Number,
1131
+ default: 14
1132
+ },
1133
+ editable: {
1134
+ type: Boolean,
1135
+ default: !1
1136
+ },
1137
+ center: {
1138
+ type: Object,
1139
+ default: Ve.jb
1140
+ }
1141
+ },
1142
+ emits: ["map-click", "marker-change", "polygon-change", "polygon-right-click"],
1143
+ setup(t, { expose: e, emit: r }) {
1144
+ const n = t, s = r;
1145
+ e({
1146
+ setCenter: (a) => {
1147
+ var l;
1148
+ (l = i.value) == null || l.setCenter(a);
1149
+ }
1150
+ });
1151
+ const o = re(), i = re(null), f = [];
1152
+ function d(a) {
1153
+ return {
1154
+ lat: a.latLng.lat(),
1155
+ lng: a.latLng.lng()
1156
+ };
1157
+ }
1158
+ function u(a, l, b) {
1159
+ const _ = ve().maps.event.addListener(a, l, b);
1160
+ f.push(_);
1161
+ }
1162
+ const g = re([]);
1163
+ function c(a, l, b) {
1164
+ u(a, l, b);
1165
+ }
1166
+ function L(a) {
1167
+ y(null), g.value = a.map((l, b) => {
1168
+ const _ = ve(), v = new _.maps.Marker({
1169
+ position: l,
1170
+ draggable: !0
1171
+ });
1172
+ return c(v, "dragend", (m) => {
1173
+ s("marker-change", { index: b, position: d(m) });
1174
+ }), v;
1175
+ }), y(i.value);
1176
+ }
1177
+ function y(a) {
1178
+ g.value.map((l) => _t(l).setMap(a));
1179
+ }
1180
+ const p = re([]);
1181
+ function P(a, l, b) {
1182
+ u(a, l, b);
1183
+ }
1184
+ function N(a, l, b) {
1185
+ u(a, l, b);
1186
+ }
1187
+ function C(a) {
1188
+ return p.value[a].getPath().getArray().map(({ lat: b, lng: _ }) => ({
1189
+ lat: b(),
1190
+ lng: _()
1191
+ }));
1192
+ }
1193
+ function x(a) {
1194
+ const l = C(a);
1195
+ s("polygon-change", { index: a, path: l });
1196
+ }
1197
+ function I(a, l) {
1198
+ const _ = C(a).filter((v, m) => m !== l);
1199
+ s("polygon-change", { index: a, path: _ });
1200
+ }
1201
+ function F(a, l) {
1202
+ l.vertex !== void 0 ? I(a, l.vertex) : s("polygon-right-click", a);
1203
+ }
1204
+ function J(a) {
1205
+ Z(null), p.value = a.map((l, b) => {
1206
+ const _ = ve(), v = new _.maps.Polygon({
1207
+ paths: l.paths,
1208
+ strokeColor: l.strokeColor,
1209
+ fillColor: l.fillColor,
1210
+ fillOpacity: 0.5,
1211
+ editable: n.editable
1212
+ });
1213
+ return P(v, "contextmenu", (m) => F(b, m)), v.getPaths().forEach((m) => {
1214
+ N(m, "insert_at", () => x(b)), N(m, "set_at", () => x(b));
1215
+ }), v;
1216
+ }), Z(i.value);
1217
+ }
1218
+ function Z(a) {
1219
+ p.value.map((l) => _t(l).setMap(a));
1220
+ }
1221
+ function M(a, l, b) {
1222
+ u(a, l, b);
1223
+ }
1224
+ function q() {
1225
+ const a = ve().maps.Map;
1226
+ i.value = new a(o.value, {
1227
+ center: n.center,
1228
+ zoom: n.zoom,
1229
+ mapTypeControl: !1,
1230
+ streetViewControl: !1,
1231
+ draggable: !0,
1232
+ scrollwheel: !0
1233
+ }), M(i.value, "click", (l) => s("map-click", d(l)));
1234
+ }
1235
+ return rt(() => n.markers, L, { deep: !0 }), rt(() => n.polygons, J, { deep: !0 }), nr(() => {
1236
+ !o.value || !ve() || (q(), L(n.markers), J(n.polygons));
1237
+ }), Cr(() => {
1238
+ f.forEach((a) => a.remove());
1239
+ }), (a, l) => (k(), D("div", {
1240
+ ref_key: "mapRef",
1241
+ ref: o,
1242
+ class: "map app-map"
1243
+ }, null, 512));
1244
+ }
1245
+ }), es = { class: "space-y-24" }, ts = { class: "flex flex-row gap-8" }, rs = { class: "flex gap-8" }, ns = { class: "flex gap-8" }, ss = /* @__PURE__ */ W({
1246
+ __name: "CoordinateDialog",
1247
+ props: {
1248
+ address: {
1249
+ type: String,
1250
+ required: !0
1251
+ },
1252
+ coordinate: {
1253
+ type: Object,
1254
+ default: void 0
1255
+ }
1256
+ },
1257
+ setup(t) {
1258
+ const { t: e } = pe(), r = t, { emitData: n } = Mr(), s = lt(
1259
+ ge(r.coordinate ? r.coordinate : Ve.jb)
1260
+ );
1261
+ function o({ position: i }) {
1262
+ s.lat = i.lat, s.lng = i.lng, n(s);
1263
+ }
1264
+ return n(s), (i, f) => (k(), D("div", es, [
1265
+ E("div", null, [
1266
+ E("div", ts, [
1267
+ E("div", null, j(R(e)("settings.coordinate_dialog.address")) + ":", 1),
1268
+ E("div", null, j(t.address || "--"), 1)
1269
+ ]),
1270
+ E("div", rs, [
1271
+ E("div", null, j(R(e)("settings.coordinate_dialog.latitude")) + ":", 1),
1272
+ E("div", null, j(s.lat), 1)
1273
+ ]),
1274
+ E("div", ns, [
1275
+ E("div", null, j(R(e)("settings.coordinate_dialog.longitude")) + ":", 1),
1276
+ E("div", null, j(s.lng), 1)
1277
+ ])
1278
+ ]),
1279
+ T(Qn, {
1280
+ class: "w-full",
1281
+ style: { height: "300px" },
1282
+ editable: "",
1283
+ center: s,
1284
+ markers: [s],
1285
+ onMarkerChange: o,
1286
+ onMapClick: f[0] || (f[0] = (d) => o({ position: d }))
1287
+ }, null, 8, ["center", "markers"])
1288
+ ]));
1289
+ }
1290
+ }), as = /* @__PURE__ */ W({
1291
+ __name: "CoordinateInput",
1292
+ props: {
1293
+ modelValue: {
1294
+ type: Array,
1295
+ default: void 0
1296
+ },
1297
+ address: {
1298
+ type: Object,
1299
+ required: !0
1300
+ },
1301
+ required: {
1302
+ type: Boolean,
1303
+ default: !1
1304
+ }
1305
+ },
1306
+ emits: ["update:model-value"],
1307
+ setup(t, { emit: e }) {
1308
+ const { t: r } = pe(), n = t, s = e, o = lr(), i = H(() => {
1309
+ const c = n.modelValue || [];
1310
+ return c.length < 2 ? null : Kr(c);
1311
+ }), f = H(() => i.value ? `${i.value.lat}, ${i.value.lng}` : "");
1312
+ async function d() {
1313
+ const c = ve().maps.Geocoder, L = new c();
1314
+ let y = i.value;
1315
+ y || await new Promise((p) => {
1316
+ n.address.formatted ? L.geocode({ address: n.address.formatted }, (P) => {
1317
+ var C;
1318
+ const N = (C = P == null ? void 0 : P[0]) == null ? void 0 : C.geometry;
1319
+ y = N ? { lng: N.location.lng(), lat: N.location.lat() } : Ve.jb, p(!0);
1320
+ }) : (y = Ve.jb, p(!0));
1321
+ }), o.open({
1322
+ contentComponent: ss,
1323
+ contentComponentProps: {
1324
+ address: n.address.formatted,
1325
+ coordinate: y
1326
+ },
1327
+ title: r("settings.coordinate_input.dialog.title"),
1328
+ primaryActions: {
1329
+ text: r("settings.coordinate_input.dialog.confirm"),
1330
+ variant: "primary",
1331
+ close: !0
1332
+ },
1333
+ secondaryActions: {
1334
+ text: r("settings.coordinate_input.dialog.delete"),
1335
+ variant: "destructive",
1336
+ close: !0
1337
+ }
1338
+ }).onPrimary(async (p) => {
1339
+ const P = p ? qr(p) : [];
1340
+ g(), s("update:model-value", P);
1341
+ }).onSecondary(() => {
1342
+ g(), s("update:model-value", []);
1343
+ });
1344
+ }
1345
+ const u = re(!1);
1346
+ function g() {
1347
+ u.value = !1;
1348
+ }
1349
+ return (c, L) => {
1350
+ const y = K("FmIcon"), p = K("FmField"), P = K("FmFormGroup");
1351
+ return k(), Q(P, {
1352
+ modelValue: i.value,
1353
+ "onUpdate:modelValue": L[0] || (L[0] = (N) => i.value = N),
1354
+ label: R(r)("settings.coordinate_input.title")
1355
+ }, {
1356
+ default: G(() => [
1357
+ T(p, {
1358
+ class: "cursor-pointer",
1359
+ onClick: d
1360
+ }, {
1361
+ prepend: G(() => [
1362
+ ne(c.$slots, "prepend")
1363
+ ]),
1364
+ append: G(() => [
1365
+ T(y, {
1366
+ class: "text-fm-color-neutral-gray-400",
1367
+ name: "location_on",
1368
+ outline: "",
1369
+ size: "md"
1370
+ })
1371
+ ]),
1372
+ default: G(() => [
1373
+ ne(c.$slots, "default", {}, () => [
1374
+ E("div", {
1375
+ class: Y([[i.value ? "text-fm-color-typo-primary" : "text-fm-color-typo-tertiary"], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
1376
+ }, j(i.value ? f.value : R(r)("settings.coordinate_input.not_set")), 3)
1377
+ ])
1378
+ ]),
1379
+ _: 3
1380
+ })
1381
+ ]),
1382
+ _: 3
1383
+ }, 8, ["modelValue", "label"]);
1384
+ };
1385
+ }
1386
+ }), os = { class: "w-[140px] pt-16" }, is = { class: "pl-32" }, ls = {
1387
+ key: 1,
1388
+ class: "flex gap-8 items-center my-8"
1389
+ }, us = /* @__PURE__ */ W({
1390
+ __name: "OperationHoursInput",
1391
+ props: {
1392
+ modelValue: {
1393
+ type: Object,
1394
+ default: void 0
1395
+ },
1396
+ title: {
1397
+ type: String,
1398
+ required: !1
1399
+ }
1400
+ },
1401
+ emits: ["update:model-value"],
1402
+ setup(t, { emit: e }) {
1403
+ const r = t, n = e, s = ct(), { t: o } = pe();
1404
+ dt().startOf("week");
1405
+ const i = H(
1406
+ () => [
1407
+ o("settings.operation_hours.mon"),
1408
+ o("settings.operation_hours.tue"),
1409
+ o("settings.operation_hours.wed"),
1410
+ o("settings.operation_hours.thu"),
1411
+ o("settings.operation_hours.fri"),
1412
+ o("settings.operation_hours.sat"),
1413
+ o("settings.operation_hours.sun")
1414
+ ].map((C, x) => ({
1415
+ key: x.toString(),
1416
+ label: C,
1417
+ value: x < 6 ? x + 1 : 0,
1418
+ // key of OperatingHours, since data start from sunday, UI start from monday
1419
+ slot: `checkbox-${x}-end`
1420
+ }))
1421
+ ), f = H(
1422
+ () => r.modelValue ? Object.values(r.modelValue) : Array.from(Array(7)).map(() => ({
1423
+ enable: !1,
1424
+ hours: []
1425
+ }))
1426
+ ), d = H(() => Object.values(f.value).map((C) => C.hours)), u = H(() => f.value.reduce((C, x, I) => (x.hours.length > 0 && C.push(I), C), []));
1427
+ function g() {
1428
+ return { start: "00:00", end: "23:59" };
1429
+ }
1430
+ function c(C) {
1431
+ const x = u.value.find((F) => !C.includes(F));
1432
+ if (x !== void 0) {
1433
+ N((F) => (F[x].enable = !1, F[x].hours = [], F));
1434
+ return;
1435
+ }
1436
+ const I = C.find((F) => !u.value.includes(F));
1437
+ I !== void 0 && f.value[I].hours.length === 0 && N((F) => (F[I].enable = !0, F[I].hours = [g()], F));
1438
+ }
1439
+ function L(C) {
1440
+ N((x) => (x[C].hours.push(g()), x));
1441
+ }
1442
+ function y(C, x) {
1443
+ d.value[C].length > 1 ? N((I) => (I[C].hours.splice(x, 1), I)) : s.open({ title: o("settings.operation_hours.cannot_remove_last"), type: "error" });
1444
+ }
1445
+ function p(C, x, I) {
1446
+ I && N((F) => (F[C].hours[x].start = I, F));
1447
+ }
1448
+ function P(C, x, I) {
1449
+ I && N((F) => (F[C].hours[x].end = I, F));
1450
+ }
1451
+ function N(C) {
1452
+ const x = C(ge(f.value)), I = {
1453
+ 0: x[0],
1454
+ 1: x[1],
1455
+ 2: x[2],
1456
+ 3: x[3],
1457
+ 4: x[4],
1458
+ 5: x[5],
1459
+ 6: x[6]
1460
+ };
1461
+ n("update:model-value", I);
1462
+ }
1463
+ return (C, x) => {
1464
+ const I = K("FmCheckbox"), F = K("FmTimePicker"), J = K("FmButton"), Z = K("FmField");
1465
+ return k(), D("div", null, [
1466
+ (k(!0), D(se, null, me(i.value, (M) => (k(), D("div", {
1467
+ key: M.value,
1468
+ class: "flex flex-col items-start"
1469
+ }, [
1470
+ E("div", os, [
1471
+ T(I, {
1472
+ "model-value": u.value,
1473
+ label: M.label,
1474
+ value: M.value,
1475
+ "onUpdate:modelValue": c
1476
+ }, null, 8, ["model-value", "label", "value"])
1477
+ ]),
1478
+ E("div", is, [
1479
+ E("div", null, [
1480
+ u.value.includes(M.value) ? (k(!0), D(se, { key: 0 }, me(d.value[M.value], (q, a) => (k(), D("div", {
1481
+ key: a,
1482
+ class: "flex items-center gap-8"
1483
+ }, [
1484
+ T(F, {
1485
+ "model-value": q.start,
1486
+ "onUpdate:modelValue": (l) => p(M.value, a, l)
1487
+ }, null, 8, ["model-value", "onUpdate:modelValue"]),
1488
+ E("span", {
1489
+ class: Y([["text-fm-color-typo-tertiary"], "fm-typo-en-body-lg-400"])
1490
+ }, j(R(o)("settings.operation_hours.to")), 1),
1491
+ T(F, {
1492
+ "model-value": q.end,
1493
+ "onUpdate:modelValue": (l) => P(M.value, a, l)
1494
+ }, null, 8, ["model-value", "onUpdate:modelValue"]),
1495
+ T(J, {
1496
+ icon: "close",
1497
+ variant: "tertiary",
1498
+ onClick: (l) => y(M.value, a)
1499
+ }, null, 8, ["onClick"]),
1500
+ T(J, {
1501
+ class: Y(a === 0 ? "" : "invisible"),
1502
+ icon: "add",
1503
+ color: "primary",
1504
+ variant: "secondary",
1505
+ onClick: (l) => L(M.value)
1506
+ }, null, 8, ["class", "onClick"])
1507
+ ]))), 128)) : (k(), D("div", ls, [
1508
+ T(Z, null, {
1509
+ default: G(() => [
1510
+ E("div", {
1511
+ class: Y([["text-fm-color-typo-tertiary"], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
1512
+ }, j(R(o)("settings.operation_hours.close")), 1)
1513
+ ]),
1514
+ _: 1
1515
+ }),
1516
+ E("span", {
1517
+ class: Y([["text-fm-color-typo-tertiary"], "fm-typo-en-body-lg-400"])
1518
+ }, j(R(o)("settings.operation_hours.to")), 1),
1519
+ T(Z, null, {
1520
+ default: G(() => [
1521
+ E("div", {
1522
+ class: Y([["text-fm-color-typo-tertiary"], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
1523
+ }, j(R(o)("settings.operation_hours.close")), 1)
1524
+ ]),
1525
+ _: 1
1526
+ })
1527
+ ]))
1528
+ ])
1529
+ ])
1530
+ ]))), 128))
1531
+ ]);
1532
+ };
1533
+ }
1534
+ }), hr = new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/), vr = [
1535
+ "home",
1536
+ "app",
1537
+ "about",
1538
+ "tnc",
1539
+ "terms-and-conditions",
1540
+ "redirection",
1541
+ "redirect",
1542
+ "auth",
1543
+ "login",
1544
+ "logout",
1545
+ "register",
1546
+ "user",
1547
+ "discovery",
1548
+ "discover",
1549
+ "order",
1550
+ "orders",
1551
+ "membership",
1552
+ "memberships",
1553
+ "member",
1554
+ "members",
1555
+ "benefit",
1556
+ "benefits",
1557
+ "reward",
1558
+ "rewards",
1559
+ "voucher",
1560
+ "vouchers",
1561
+ "search",
1562
+ "restaurant",
1563
+ "restaurants",
1564
+ "business",
1565
+ "businesses",
1566
+ "dine",
1567
+ "profile",
1568
+ "scan",
1569
+ "scanner",
1570
+ "menu",
1571
+ "cart",
1572
+ "me",
1573
+ "v",
1574
+ "active-orders",
1575
+ "qr",
1576
+ "setting",
1577
+ "settings",
1578
+ "error",
1579
+ "supportdetails",
1580
+ "support-details",
1581
+ "stacks",
1582
+ "imulus",
1583
+ "github",
1584
+ "twitter",
1585
+ "facebook",
1586
+ "google",
1587
+ "apple",
1588
+ "about",
1589
+ "account",
1590
+ "activate",
1591
+ "add",
1592
+ "admin",
1593
+ "administrator",
1594
+ "api",
1595
+ "app",
1596
+ "apps",
1597
+ "archive",
1598
+ "archives",
1599
+ "auth",
1600
+ "blog",
1601
+ "cache",
1602
+ "cancel",
1603
+ "careers",
1604
+ "cart",
1605
+ "changelog",
1606
+ "checkout",
1607
+ "codereview",
1608
+ "compare",
1609
+ "config",
1610
+ "configuration",
1611
+ "connect",
1612
+ "contact",
1613
+ "create",
1614
+ "delete",
1615
+ "direct_messages",
1616
+ "documentation",
1617
+ "download",
1618
+ "downloads",
1619
+ "edit",
1620
+ "email",
1621
+ "employment",
1622
+ "enterprise",
1623
+ "faq",
1624
+ "favorites",
1625
+ "feed",
1626
+ "feedback",
1627
+ "feeds",
1628
+ "fleet",
1629
+ "fleets",
1630
+ "follow",
1631
+ "followers",
1632
+ "following",
1633
+ "friend",
1634
+ "friends",
1635
+ "gist",
1636
+ "group",
1637
+ "groups",
1638
+ "help",
1639
+ "home",
1640
+ "hosting",
1641
+ "hostmaster",
1642
+ "idea",
1643
+ "ideas",
1644
+ "index",
1645
+ "info",
1646
+ "invitations",
1647
+ "invite",
1648
+ "is",
1649
+ "it",
1650
+ "job",
1651
+ "jobs",
1652
+ "json",
1653
+ "language",
1654
+ "languages",
1655
+ "lists",
1656
+ "login",
1657
+ "logout",
1658
+ "logs",
1659
+ "mail",
1660
+ "map",
1661
+ "maps",
1662
+ "mine",
1663
+ "mis",
1664
+ "news",
1665
+ "oauth",
1666
+ "oauth_clients",
1667
+ "offers",
1668
+ "openid",
1669
+ "order",
1670
+ "orders",
1671
+ "organizations",
1672
+ "plans",
1673
+ "popular",
1674
+ "post",
1675
+ "postmaster",
1676
+ "privacy",
1677
+ "projects",
1678
+ "put",
1679
+ "recruitment",
1680
+ "register",
1681
+ "remove",
1682
+ "replies",
1683
+ "root",
1684
+ "rss",
1685
+ "sales",
1686
+ "save",
1687
+ "search",
1688
+ "security",
1689
+ "sessions",
1690
+ "settings",
1691
+ "shop",
1692
+ "signup",
1693
+ "sitemap",
1694
+ "ssl",
1695
+ "ssladmin",
1696
+ "ssladministrator",
1697
+ "sslwebmaster",
1698
+ "status",
1699
+ "stories",
1700
+ "styleguide",
1701
+ "subscribe",
1702
+ "subscriptions",
1703
+ "support",
1704
+ "sysadmin",
1705
+ "sysadministrator",
1706
+ "terms",
1707
+ "tour",
1708
+ "translations",
1709
+ "trends",
1710
+ "unfollow",
1711
+ "unsubscribe",
1712
+ "update",
1713
+ "url",
1714
+ "user",
1715
+ "weather",
1716
+ "webmaster",
1717
+ "widget",
1718
+ "widgets",
1719
+ "wiki",
1720
+ "ww",
1721
+ "www",
1722
+ "wwww",
1723
+ "xfn",
1724
+ "xml",
1725
+ "xmpp",
1726
+ "yaml",
1727
+ "yml",
1728
+ "chinese",
1729
+ "mandarin",
1730
+ "spanish",
1731
+ "english",
1732
+ "bengali",
1733
+ "hindi",
1734
+ "portuguese",
1735
+ "russian",
1736
+ "japanese",
1737
+ "german",
1738
+ "wu",
1739
+ "javanese",
1740
+ "korean",
1741
+ "french",
1742
+ "vietnamese",
1743
+ "telugu",
1744
+ "chinese",
1745
+ "marathi",
1746
+ "tamil",
1747
+ "turkish",
1748
+ "urdu",
1749
+ "min-nan",
1750
+ "jinyu",
1751
+ "gujarati",
1752
+ "polish",
1753
+ "arabic",
1754
+ "ukrainian",
1755
+ "italian",
1756
+ "xiang",
1757
+ "malayalam",
1758
+ "hakka",
1759
+ "kannada",
1760
+ "oriya",
1761
+ "panjabi",
1762
+ "sunda",
1763
+ "panjabi",
1764
+ "romanian",
1765
+ "bhojpuri",
1766
+ "azerbaijani",
1767
+ "farsi",
1768
+ "maithili",
1769
+ "hausa",
1770
+ "arabic",
1771
+ "burmese",
1772
+ "serbo-croatian",
1773
+ "gan",
1774
+ "awadhi",
1775
+ "thai",
1776
+ "dutch",
1777
+ "yoruba",
1778
+ "sindhi",
1779
+ "ac",
1780
+ "ad",
1781
+ "ae",
1782
+ "af",
1783
+ "ag",
1784
+ "ai",
1785
+ "al",
1786
+ "am",
1787
+ "an",
1788
+ "ao",
1789
+ "aq",
1790
+ "ar",
1791
+ "as",
1792
+ "at",
1793
+ "au",
1794
+ "aw",
1795
+ "ax",
1796
+ "az",
1797
+ "ba",
1798
+ "bb",
1799
+ "bd",
1800
+ "be",
1801
+ "bf",
1802
+ "bg",
1803
+ "bh",
1804
+ "bi",
1805
+ "bj",
1806
+ "bm",
1807
+ "bn",
1808
+ "bo",
1809
+ "br",
1810
+ "bs",
1811
+ "bt",
1812
+ "bv",
1813
+ "bw",
1814
+ "by",
1815
+ "bz",
1816
+ "ca",
1817
+ "cc",
1818
+ "cd",
1819
+ "cf",
1820
+ "cg",
1821
+ "ch",
1822
+ "ci",
1823
+ "ck",
1824
+ "cl",
1825
+ "cm",
1826
+ "cn",
1827
+ "co",
1828
+ "cr",
1829
+ "cs",
1830
+ "cu",
1831
+ "cv",
1832
+ "cx",
1833
+ "cy",
1834
+ "cz",
1835
+ "dd",
1836
+ "de",
1837
+ "dj",
1838
+ "dk",
1839
+ "dm",
1840
+ "do",
1841
+ "dz",
1842
+ "ec",
1843
+ "ee",
1844
+ "eg",
1845
+ "eh",
1846
+ "er",
1847
+ "es",
1848
+ "et",
1849
+ "eu",
1850
+ "fi",
1851
+ "fj",
1852
+ "fk",
1853
+ "fm",
1854
+ "fo",
1855
+ "fr",
1856
+ "ga",
1857
+ "gb",
1858
+ "gd",
1859
+ "ge",
1860
+ "gf",
1861
+ "gg",
1862
+ "gh",
1863
+ "gi",
1864
+ "gl",
1865
+ "gm",
1866
+ "gn",
1867
+ "gp",
1868
+ "gq",
1869
+ "gr",
1870
+ "gs",
1871
+ "gt",
1872
+ "gu",
1873
+ "gw",
1874
+ "gy",
1875
+ "hk",
1876
+ "hm",
1877
+ "hn",
1878
+ "hr",
1879
+ "ht",
1880
+ "hu",
1881
+ "id",
1882
+ "ie",
1883
+ "il",
1884
+ "im",
1885
+ "in",
1886
+ "io",
1887
+ "iq",
1888
+ "ir",
1889
+ "is",
1890
+ "it",
1891
+ "je",
1892
+ "jm",
1893
+ "jo",
1894
+ "jp",
1895
+ "ke",
1896
+ "kg",
1897
+ "kh",
1898
+ "ki",
1899
+ "km",
1900
+ "kn",
1901
+ "kp",
1902
+ "kr",
1903
+ "kw",
1904
+ "ky",
1905
+ "kz",
1906
+ "la",
1907
+ "lb",
1908
+ "lc",
1909
+ "li",
1910
+ "lk",
1911
+ "lr",
1912
+ "ls",
1913
+ "lt",
1914
+ "lu",
1915
+ "lv",
1916
+ "ly",
1917
+ "ma",
1918
+ "mc",
1919
+ "md",
1920
+ "me",
1921
+ "mg",
1922
+ "mh",
1923
+ "mk",
1924
+ "ml",
1925
+ "mm",
1926
+ "mn",
1927
+ "mo",
1928
+ "mp",
1929
+ "mq",
1930
+ "mr",
1931
+ "ms",
1932
+ "mt",
1933
+ "mu",
1934
+ "mv",
1935
+ "mw",
1936
+ "mx",
1937
+ "my",
1938
+ "mz",
1939
+ "na",
1940
+ "nc",
1941
+ "ne",
1942
+ "nf",
1943
+ "ng",
1944
+ "ni",
1945
+ "nl",
1946
+ "no",
1947
+ "np",
1948
+ "nr",
1949
+ "nu",
1950
+ "nz",
1951
+ "om",
1952
+ "pa",
1953
+ "pe",
1954
+ "pf",
1955
+ "pg",
1956
+ "ph",
1957
+ "pk",
1958
+ "pl",
1959
+ "pm",
1960
+ "pn",
1961
+ "pr",
1962
+ "ps",
1963
+ "pt",
1964
+ "pw",
1965
+ "py",
1966
+ "qa",
1967
+ "re",
1968
+ "ro",
1969
+ "rs",
1970
+ "ru",
1971
+ "rw",
1972
+ "sa",
1973
+ "sb",
1974
+ "sc",
1975
+ "sd",
1976
+ "se",
1977
+ "sg",
1978
+ "sh",
1979
+ "si",
1980
+ "sj",
1981
+ "sk",
1982
+ "sl",
1983
+ "sm",
1984
+ "sn",
1985
+ "so",
1986
+ "sr",
1987
+ "ss",
1988
+ "st",
1989
+ "su",
1990
+ "sv",
1991
+ "sy",
1992
+ "sz",
1993
+ "tc",
1994
+ "td",
1995
+ "tf",
1996
+ "tg",
1997
+ "th",
1998
+ "tj",
1999
+ "tk",
2000
+ "tl",
2001
+ "tm",
2002
+ "tn",
2003
+ "to",
2004
+ "tp",
2005
+ "tr",
2006
+ "tt",
2007
+ "tv",
2008
+ "tw",
2009
+ "tz",
2010
+ "ua",
2011
+ "ug",
2012
+ "uk",
2013
+ "us",
2014
+ "uy",
2015
+ "uz",
2016
+ "va",
2017
+ "vc",
2018
+ "ve",
2019
+ "vg",
2020
+ "vi",
2021
+ "vn",
2022
+ "vu",
2023
+ "wf",
2024
+ "ws",
2025
+ "ye",
2026
+ "yt",
2027
+ "yu",
2028
+ "za",
2029
+ "zm",
2030
+ "zw"
2031
+ ];
2032
+ var ot = { exports: {} };
2033
+ const cs = "2.0.0", br = 256, ds = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
2034
+ 9007199254740991, fs = 16, ms = br - 6, ps = [
2035
+ "major",
2036
+ "premajor",
2037
+ "minor",
2038
+ "preminor",
2039
+ "patch",
2040
+ "prepatch",
2041
+ "prerelease"
2042
+ ];
2043
+ var je = {
2044
+ MAX_LENGTH: br,
2045
+ MAX_SAFE_COMPONENT_LENGTH: fs,
2046
+ MAX_SAFE_BUILD_LENGTH: ms,
2047
+ MAX_SAFE_INTEGER: ds,
2048
+ RELEASE_TYPES: ps,
2049
+ SEMVER_SPEC_VERSION: cs,
2050
+ FLAG_INCLUDE_PRERELEASE: 1,
2051
+ FLAG_LOOSE: 2
2052
+ };
2053
+ const hs = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...t) => console.error("SEMVER", ...t) : () => {
2054
+ };
2055
+ var Me = hs;
2056
+ (function(t, e) {
2057
+ const {
2058
+ MAX_SAFE_COMPONENT_LENGTH: r,
2059
+ MAX_SAFE_BUILD_LENGTH: n,
2060
+ MAX_LENGTH: s
2061
+ } = je, o = Me;
2062
+ e = t.exports = {};
2063
+ const i = e.re = [], f = e.safeRe = [], d = e.src = [], u = e.t = {};
2064
+ let g = 0;
2065
+ const c = "[a-zA-Z0-9-]", L = [
2066
+ ["\\s", 1],
2067
+ ["\\d", s],
2068
+ [c, n]
2069
+ ], y = (P) => {
2070
+ for (const [N, C] of L)
2071
+ P = P.split(`${N}*`).join(`${N}{0,${C}}`).split(`${N}+`).join(`${N}{1,${C}}`);
2072
+ return P;
2073
+ }, p = (P, N, C) => {
2074
+ const x = y(N), I = g++;
2075
+ o(P, I, N), u[P] = I, d[I] = N, i[I] = new RegExp(N, C ? "g" : void 0), f[I] = new RegExp(x, C ? "g" : void 0);
2076
+ };
2077
+ p("NUMERICIDENTIFIER", "0|[1-9]\\d*"), p("NUMERICIDENTIFIERLOOSE", "\\d+"), p("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${c}*`), p("MAINVERSION", `(${d[u.NUMERICIDENTIFIER]})\\.(${d[u.NUMERICIDENTIFIER]})\\.(${d[u.NUMERICIDENTIFIER]})`), p("MAINVERSIONLOOSE", `(${d[u.NUMERICIDENTIFIERLOOSE]})\\.(${d[u.NUMERICIDENTIFIERLOOSE]})\\.(${d[u.NUMERICIDENTIFIERLOOSE]})`), p("PRERELEASEIDENTIFIER", `(?:${d[u.NUMERICIDENTIFIER]}|${d[u.NONNUMERICIDENTIFIER]})`), p("PRERELEASEIDENTIFIERLOOSE", `(?:${d[u.NUMERICIDENTIFIERLOOSE]}|${d[u.NONNUMERICIDENTIFIER]})`), p("PRERELEASE", `(?:-(${d[u.PRERELEASEIDENTIFIER]}(?:\\.${d[u.PRERELEASEIDENTIFIER]})*))`), p("PRERELEASELOOSE", `(?:-?(${d[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[u.PRERELEASEIDENTIFIERLOOSE]})*))`), p("BUILDIDENTIFIER", `${c}+`), p("BUILD", `(?:\\+(${d[u.BUILDIDENTIFIER]}(?:\\.${d[u.BUILDIDENTIFIER]})*))`), p("FULLPLAIN", `v?${d[u.MAINVERSION]}${d[u.PRERELEASE]}?${d[u.BUILD]}?`), p("FULL", `^${d[u.FULLPLAIN]}$`), p("LOOSEPLAIN", `[v=\\s]*${d[u.MAINVERSIONLOOSE]}${d[u.PRERELEASELOOSE]}?${d[u.BUILD]}?`), p("LOOSE", `^${d[u.LOOSEPLAIN]}$`), p("GTLT", "((?:<|>)?=?)"), p("XRANGEIDENTIFIERLOOSE", `${d[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), p("XRANGEIDENTIFIER", `${d[u.NUMERICIDENTIFIER]}|x|X|\\*`), p("XRANGEPLAIN", `[v=\\s]*(${d[u.XRANGEIDENTIFIER]})(?:\\.(${d[u.XRANGEIDENTIFIER]})(?:\\.(${d[u.XRANGEIDENTIFIER]})(?:${d[u.PRERELEASE]})?${d[u.BUILD]}?)?)?`), p("XRANGEPLAINLOOSE", `[v=\\s]*(${d[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[u.XRANGEIDENTIFIERLOOSE]})(?:${d[u.PRERELEASELOOSE]})?${d[u.BUILD]}?)?)?`), p("XRANGE", `^${d[u.GTLT]}\\s*${d[u.XRANGEPLAIN]}$`), p("XRANGELOOSE", `^${d[u.GTLT]}\\s*${d[u.XRANGEPLAINLOOSE]}$`), p("COERCEPLAIN", `(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`), p("COERCE", `${d[u.COERCEPLAIN]}(?:$|[^\\d])`), p("COERCEFULL", d[u.COERCEPLAIN] + `(?:${d[u.PRERELEASE]})?(?:${d[u.BUILD]})?(?:$|[^\\d])`), p("COERCERTL", d[u.COERCE], !0), p("COERCERTLFULL", d[u.COERCEFULL], !0), p("LONETILDE", "(?:~>?)"), p("TILDETRIM", `(\\s*)${d[u.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", p("TILDE", `^${d[u.LONETILDE]}${d[u.XRANGEPLAIN]}$`), p("TILDELOOSE", `^${d[u.LONETILDE]}${d[u.XRANGEPLAINLOOSE]}$`), p("LONECARET", "(?:\\^)"), p("CARETTRIM", `(\\s*)${d[u.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", p("CARET", `^${d[u.LONECARET]}${d[u.XRANGEPLAIN]}$`), p("CARETLOOSE", `^${d[u.LONECARET]}${d[u.XRANGEPLAINLOOSE]}$`), p("COMPARATORLOOSE", `^${d[u.GTLT]}\\s*(${d[u.LOOSEPLAIN]})$|^$`), p("COMPARATOR", `^${d[u.GTLT]}\\s*(${d[u.FULLPLAIN]})$|^$`), p("COMPARATORTRIM", `(\\s*)${d[u.GTLT]}\\s*(${d[u.LOOSEPLAIN]}|${d[u.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", p("HYPHENRANGE", `^\\s*(${d[u.XRANGEPLAIN]})\\s+-\\s+(${d[u.XRANGEPLAIN]})\\s*$`), p("HYPHENRANGELOOSE", `^\\s*(${d[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[u.XRANGEPLAINLOOSE]})\\s*$`), p("STAR", "(<|>)?=?\\s*\\*"), p("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), p("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
2078
+ })(ot, ot.exports);
2079
+ var we = ot.exports;
2080
+ const vs = Object.freeze({ loose: !0 }), bs = Object.freeze({}), gs = (t) => t ? typeof t != "object" ? vs : t : bs;
2081
+ var ft = gs;
2082
+ const Nt = /^[0-9]+$/, gr = (t, e) => {
2083
+ const r = Nt.test(t), n = Nt.test(e);
2084
+ return r && n && (t = +t, e = +e), t === e ? 0 : r && !n ? -1 : n && !r ? 1 : t < e ? -1 : 1;
2085
+ }, ys = (t, e) => gr(e, t);
2086
+ var yr = {
2087
+ compareIdentifiers: gr,
2088
+ rcompareIdentifiers: ys
2089
+ };
2090
+ const Ie = Me, { MAX_LENGTH: Ct, MAX_SAFE_INTEGER: Ae } = je, { safeRe: kt, t: xt } = we, $s = ft, { compareIdentifiers: he } = yr;
2091
+ let _s = class ie {
2092
+ constructor(e, r) {
2093
+ if (r = $s(r), e instanceof ie) {
2094
+ if (e.loose === !!r.loose && e.includePrerelease === !!r.includePrerelease)
2095
+ return e;
2096
+ e = e.version;
2097
+ } else if (typeof e != "string")
2098
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
2099
+ if (e.length > Ct)
2100
+ throw new TypeError(
2101
+ `version is longer than ${Ct} characters`
2102
+ );
2103
+ Ie("SemVer", e, r), this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease;
2104
+ const n = e.trim().match(r.loose ? kt[xt.LOOSE] : kt[xt.FULL]);
2105
+ if (!n)
2106
+ throw new TypeError(`Invalid Version: ${e}`);
2107
+ if (this.raw = e, this.major = +n[1], this.minor = +n[2], this.patch = +n[3], this.major > Ae || this.major < 0)
2108
+ throw new TypeError("Invalid major version");
2109
+ if (this.minor > Ae || this.minor < 0)
2110
+ throw new TypeError("Invalid minor version");
2111
+ if (this.patch > Ae || this.patch < 0)
2112
+ throw new TypeError("Invalid patch version");
2113
+ n[4] ? this.prerelease = n[4].split(".").map((s) => {
2114
+ if (/^[0-9]+$/.test(s)) {
2115
+ const o = +s;
2116
+ if (o >= 0 && o < Ae)
2117
+ return o;
2118
+ }
2119
+ return s;
2120
+ }) : this.prerelease = [], this.build = n[5] ? n[5].split(".") : [], this.format();
2121
+ }
2122
+ format() {
2123
+ return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
2124
+ }
2125
+ toString() {
2126
+ return this.version;
2127
+ }
2128
+ compare(e) {
2129
+ if (Ie("SemVer.compare", this.version, this.options, e), !(e instanceof ie)) {
2130
+ if (typeof e == "string" && e === this.version)
2131
+ return 0;
2132
+ e = new ie(e, this.options);
2133
+ }
2134
+ return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
2135
+ }
2136
+ compareMain(e) {
2137
+ return e instanceof ie || (e = new ie(e, this.options)), he(this.major, e.major) || he(this.minor, e.minor) || he(this.patch, e.patch);
2138
+ }
2139
+ comparePre(e) {
2140
+ if (e instanceof ie || (e = new ie(e, this.options)), this.prerelease.length && !e.prerelease.length)
2141
+ return -1;
2142
+ if (!this.prerelease.length && e.prerelease.length)
2143
+ return 1;
2144
+ if (!this.prerelease.length && !e.prerelease.length)
2145
+ return 0;
2146
+ let r = 0;
2147
+ do {
2148
+ const n = this.prerelease[r], s = e.prerelease[r];
2149
+ if (Ie("prerelease compare", r, n, s), n === void 0 && s === void 0)
2150
+ return 0;
2151
+ if (s === void 0)
2152
+ return 1;
2153
+ if (n === void 0)
2154
+ return -1;
2155
+ if (n === s)
2156
+ continue;
2157
+ return he(n, s);
2158
+ } while (++r);
2159
+ }
2160
+ compareBuild(e) {
2161
+ e instanceof ie || (e = new ie(e, this.options));
2162
+ let r = 0;
2163
+ do {
2164
+ const n = this.build[r], s = e.build[r];
2165
+ if (Ie("build compare", r, n, s), n === void 0 && s === void 0)
2166
+ return 0;
2167
+ if (s === void 0)
2168
+ return 1;
2169
+ if (n === void 0)
2170
+ return -1;
2171
+ if (n === s)
2172
+ continue;
2173
+ return he(n, s);
2174
+ } while (++r);
2175
+ }
2176
+ // preminor will bump the version up to the next minor release, and immediately
2177
+ // down to pre-release. premajor and prepatch work the same way.
2178
+ inc(e, r, n) {
2179
+ switch (e) {
2180
+ case "premajor":
2181
+ this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", r, n);
2182
+ break;
2183
+ case "preminor":
2184
+ this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", r, n);
2185
+ break;
2186
+ case "prepatch":
2187
+ this.prerelease.length = 0, this.inc("patch", r, n), this.inc("pre", r, n);
2188
+ break;
2189
+ case "prerelease":
2190
+ this.prerelease.length === 0 && this.inc("patch", r, n), this.inc("pre", r, n);
2191
+ break;
2192
+ case "major":
2193
+ (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
2194
+ break;
2195
+ case "minor":
2196
+ (this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
2197
+ break;
2198
+ case "patch":
2199
+ this.prerelease.length === 0 && this.patch++, this.prerelease = [];
2200
+ break;
2201
+ case "pre": {
2202
+ const s = Number(n) ? 1 : 0;
2203
+ if (!r && n === !1)
2204
+ throw new Error("invalid increment argument: identifier is empty");
2205
+ if (this.prerelease.length === 0)
2206
+ this.prerelease = [s];
2207
+ else {
2208
+ let o = this.prerelease.length;
2209
+ for (; --o >= 0; )
2210
+ typeof this.prerelease[o] == "number" && (this.prerelease[o]++, o = -2);
2211
+ if (o === -1) {
2212
+ if (r === this.prerelease.join(".") && n === !1)
2213
+ throw new Error("invalid increment argument: identifier already exists");
2214
+ this.prerelease.push(s);
2215
+ }
2216
+ }
2217
+ if (r) {
2218
+ let o = [r, s];
2219
+ n === !1 && (o = [r]), he(this.prerelease[0], r) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = o) : this.prerelease = o;
2220
+ }
2221
+ break;
2222
+ }
2223
+ default:
2224
+ throw new Error(`invalid increment argument: ${e}`);
2225
+ }
2226
+ return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
2227
+ }
2228
+ };
2229
+ var ee = _s;
2230
+ const Vt = ee, Es = (t, e, r = !1) => {
2231
+ if (t instanceof Vt)
2232
+ return t;
2233
+ try {
2234
+ return new Vt(t, e);
2235
+ } catch (n) {
2236
+ if (!r)
2237
+ return null;
2238
+ throw n;
2239
+ }
2240
+ };
2241
+ var $e = Es;
2242
+ const ws = $e, Rs = (t, e) => {
2243
+ const r = ws(t, e);
2244
+ return r ? r.version : null;
2245
+ };
2246
+ var Is = Rs;
2247
+ const As = $e, Os = (t, e) => {
2248
+ const r = As(t.trim().replace(/^[=v]+/, ""), e);
2249
+ return r ? r.version : null;
2250
+ };
2251
+ var Ps = Os;
2252
+ const Ft = ee, Ss = (t, e, r, n, s) => {
2253
+ typeof r == "string" && (s = n, n = r, r = void 0);
2254
+ try {
2255
+ return new Ft(
2256
+ t instanceof Ft ? t.version : t,
2257
+ r
2258
+ ).inc(e, n, s).version;
2259
+ } catch {
2260
+ return null;
2261
+ }
2262
+ };
2263
+ var Ts = Ss;
2264
+ const jt = $e, Ls = (t, e) => {
2265
+ const r = jt(t, null, !0), n = jt(e, null, !0), s = r.compare(n);
2266
+ if (s === 0)
2267
+ return null;
2268
+ const o = s > 0, i = o ? r : n, f = o ? n : r, d = !!i.prerelease.length;
2269
+ if (!!f.prerelease.length && !d)
2270
+ return !f.patch && !f.minor ? "major" : i.patch ? "patch" : i.minor ? "minor" : "major";
2271
+ const g = d ? "pre" : "";
2272
+ return r.major !== n.major ? g + "major" : r.minor !== n.minor ? g + "minor" : r.patch !== n.patch ? g + "patch" : "prerelease";
2273
+ };
2274
+ var Ns = Ls;
2275
+ const Cs = ee, ks = (t, e) => new Cs(t, e).major;
2276
+ var xs = ks;
2277
+ const Vs = ee, Fs = (t, e) => new Vs(t, e).minor;
2278
+ var js = Fs;
2279
+ const Ms = ee, Us = (t, e) => new Ms(t, e).patch;
2280
+ var Ds = Us;
2281
+ const Gs = $e, Bs = (t, e) => {
2282
+ const r = Gs(t, e);
2283
+ return r && r.prerelease.length ? r.prerelease : null;
2284
+ };
2285
+ var Ks = Bs;
2286
+ const Mt = ee, qs = (t, e, r) => new Mt(t, r).compare(new Mt(e, r));
2287
+ var ae = qs;
2288
+ const zs = ae, Hs = (t, e, r) => zs(e, t, r);
2289
+ var Xs = Hs;
2290
+ const Ys = ae, Ws = (t, e) => Ys(t, e, !0);
2291
+ var Js = Ws;
2292
+ const Ut = ee, Zs = (t, e, r) => {
2293
+ const n = new Ut(t, r), s = new Ut(e, r);
2294
+ return n.compare(s) || n.compareBuild(s);
2295
+ };
2296
+ var mt = Zs;
2297
+ const Qs = mt, ea = (t, e) => t.sort((r, n) => Qs(r, n, e));
2298
+ var ta = ea;
2299
+ const ra = mt, na = (t, e) => t.sort((r, n) => ra(n, r, e));
2300
+ var sa = na;
2301
+ const aa = ae, oa = (t, e, r) => aa(t, e, r) > 0;
2302
+ var Ue = oa;
2303
+ const ia = ae, la = (t, e, r) => ia(t, e, r) < 0;
2304
+ var pt = la;
2305
+ const ua = ae, ca = (t, e, r) => ua(t, e, r) === 0;
2306
+ var $r = ca;
2307
+ const da = ae, fa = (t, e, r) => da(t, e, r) !== 0;
2308
+ var _r = fa;
2309
+ const ma = ae, pa = (t, e, r) => ma(t, e, r) >= 0;
2310
+ var ht = pa;
2311
+ const ha = ae, va = (t, e, r) => ha(t, e, r) <= 0;
2312
+ var vt = va;
2313
+ const ba = $r, ga = _r, ya = Ue, $a = ht, _a = pt, Ea = vt, wa = (t, e, r, n) => {
2314
+ switch (e) {
2315
+ case "===":
2316
+ return typeof t == "object" && (t = t.version), typeof r == "object" && (r = r.version), t === r;
2317
+ case "!==":
2318
+ return typeof t == "object" && (t = t.version), typeof r == "object" && (r = r.version), t !== r;
2319
+ case "":
2320
+ case "=":
2321
+ case "==":
2322
+ return ba(t, r, n);
2323
+ case "!=":
2324
+ return ga(t, r, n);
2325
+ case ">":
2326
+ return ya(t, r, n);
2327
+ case ">=":
2328
+ return $a(t, r, n);
2329
+ case "<":
2330
+ return _a(t, r, n);
2331
+ case "<=":
2332
+ return Ea(t, r, n);
2333
+ default:
2334
+ throw new TypeError(`Invalid operator: ${e}`);
2335
+ }
2336
+ };
2337
+ var Er = wa;
2338
+ const Ra = ee, Ia = $e, { safeRe: Oe, t: Pe } = we, Aa = (t, e) => {
2339
+ if (t instanceof Ra)
2340
+ return t;
2341
+ if (typeof t == "number" && (t = String(t)), typeof t != "string")
2342
+ return null;
2343
+ e = e || {};
2344
+ let r = null;
2345
+ if (!e.rtl)
2346
+ r = t.match(e.includePrerelease ? Oe[Pe.COERCEFULL] : Oe[Pe.COERCE]);
2347
+ else {
2348
+ const d = e.includePrerelease ? Oe[Pe.COERCERTLFULL] : Oe[Pe.COERCERTL];
2349
+ let u;
2350
+ for (; (u = d.exec(t)) && (!r || r.index + r[0].length !== t.length); )
2351
+ (!r || u.index + u[0].length !== r.index + r[0].length) && (r = u), d.lastIndex = u.index + u[1].length + u[2].length;
2352
+ d.lastIndex = -1;
2353
+ }
2354
+ if (r === null)
2355
+ return null;
2356
+ const n = r[2], s = r[3] || "0", o = r[4] || "0", i = e.includePrerelease && r[5] ? `-${r[5]}` : "", f = e.includePrerelease && r[6] ? `+${r[6]}` : "";
2357
+ return Ia(`${n}.${s}.${o}${i}${f}`, e);
2358
+ };
2359
+ var Oa = Aa;
2360
+ class Pa {
2361
+ constructor() {
2362
+ this.max = 1e3, this.map = /* @__PURE__ */ new Map();
2363
+ }
2364
+ get(e) {
2365
+ const r = this.map.get(e);
2366
+ if (r !== void 0)
2367
+ return this.map.delete(e), this.map.set(e, r), r;
2368
+ }
2369
+ delete(e) {
2370
+ return this.map.delete(e);
2371
+ }
2372
+ set(e, r) {
2373
+ if (!this.delete(e) && r !== void 0) {
2374
+ if (this.map.size >= this.max) {
2375
+ const s = this.map.keys().next().value;
2376
+ this.delete(s);
2377
+ }
2378
+ this.map.set(e, r);
2379
+ }
2380
+ return this;
2381
+ }
2382
+ }
2383
+ var Sa = Pa, We, Dt;
2384
+ function oe() {
2385
+ if (Dt)
2386
+ return We;
2387
+ Dt = 1;
2388
+ const t = /\s+/g;
2389
+ class e {
2390
+ constructor(h, w) {
2391
+ if (w = s(w), h instanceof e)
2392
+ return h.loose === !!w.loose && h.includePrerelease === !!w.includePrerelease ? h : new e(h.raw, w);
2393
+ if (h instanceof o)
2394
+ return this.raw = h.value, this.set = [[h]], this.formatted = void 0, this;
2395
+ if (this.options = w, this.loose = !!w.loose, this.includePrerelease = !!w.includePrerelease, this.raw = h.trim().replace(t, " "), this.set = this.raw.split("||").map((O) => this.parseRange(O.trim())).filter((O) => O.length), !this.set.length)
2396
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
2397
+ if (this.set.length > 1) {
2398
+ const O = this.set[0];
2399
+ if (this.set = this.set.filter(($) => !P($[0])), this.set.length === 0)
2400
+ this.set = [O];
2401
+ else if (this.set.length > 1) {
2402
+ for (const $ of this.set)
2403
+ if ($.length === 1 && N($[0])) {
2404
+ this.set = [$];
2405
+ break;
2406
+ }
2407
+ }
2408
+ }
2409
+ this.formatted = void 0;
2410
+ }
2411
+ get range() {
2412
+ if (this.formatted === void 0) {
2413
+ this.formatted = "";
2414
+ for (let h = 0; h < this.set.length; h++) {
2415
+ h > 0 && (this.formatted += "||");
2416
+ const w = this.set[h];
2417
+ for (let O = 0; O < w.length; O++)
2418
+ O > 0 && (this.formatted += " "), this.formatted += w[O].toString().trim();
2419
+ }
2420
+ }
2421
+ return this.formatted;
2422
+ }
2423
+ format() {
2424
+ return this.range;
2425
+ }
2426
+ toString() {
2427
+ return this.range;
2428
+ }
2429
+ parseRange(h) {
2430
+ const O = ((this.options.includePrerelease && y) | (this.options.loose && p)) + ":" + h, $ = n.get(O);
2431
+ if ($)
2432
+ return $;
2433
+ const A = this.options.loose, S = A ? d[u.HYPHENRANGELOOSE] : d[u.HYPHENRANGE];
2434
+ h = h.replace(S, _(this.options.includePrerelease)), i("hyphen replace", h), h = h.replace(d[u.COMPARATORTRIM], g), i("comparator trim", h), h = h.replace(d[u.TILDETRIM], c), i("tilde trim", h), h = h.replace(d[u.CARETTRIM], L), i("caret trim", h);
2435
+ let U = h.split(" ").map((z) => x(z, this.options)).join(" ").split(/\s+/).map((z) => b(z, this.options));
2436
+ A && (U = U.filter((z) => (i("loose invalid filter", z, this.options), !!z.match(d[u.COMPARATORLOOSE])))), i("range list", U);
2437
+ const V = /* @__PURE__ */ new Map(), B = U.map((z) => new o(z, this.options));
2438
+ for (const z of B) {
2439
+ if (P(z))
2440
+ return [z];
2441
+ V.set(z.value, z);
2442
+ }
2443
+ V.size > 1 && V.has("") && V.delete("");
2444
+ const X = [...V.values()];
2445
+ return n.set(O, X), X;
2446
+ }
2447
+ intersects(h, w) {
2448
+ if (!(h instanceof e))
2449
+ throw new TypeError("a Range is required");
2450
+ return this.set.some((O) => C(O, w) && h.set.some(($) => C($, w) && O.every((A) => $.every((S) => A.intersects(S, w)))));
2451
+ }
2452
+ // if ANY of the sets match ALL of its comparators, then pass
2453
+ test(h) {
2454
+ if (!h)
2455
+ return !1;
2456
+ if (typeof h == "string")
2457
+ try {
2458
+ h = new f(h, this.options);
2459
+ } catch {
2460
+ return !1;
2461
+ }
2462
+ for (let w = 0; w < this.set.length; w++)
2463
+ if (v(this.set[w], h, this.options))
2464
+ return !0;
2465
+ return !1;
2466
+ }
2467
+ }
2468
+ We = e;
2469
+ const r = Sa, n = new r(), s = ft, o = De(), i = Me, f = ee, {
2470
+ safeRe: d,
2471
+ t: u,
2472
+ comparatorTrimReplace: g,
2473
+ tildeTrimReplace: c,
2474
+ caretTrimReplace: L
2475
+ } = we, { FLAG_INCLUDE_PRERELEASE: y, FLAG_LOOSE: p } = je, P = (m) => m.value === "<0.0.0-0", N = (m) => m.value === "", C = (m, h) => {
2476
+ let w = !0;
2477
+ const O = m.slice();
2478
+ let $ = O.pop();
2479
+ for (; w && O.length; )
2480
+ w = O.every((A) => $.intersects(A, h)), $ = O.pop();
2481
+ return w;
2482
+ }, x = (m, h) => (i("comp", m, h), m = Z(m, h), i("caret", m), m = F(m, h), i("tildes", m), m = q(m, h), i("xrange", m), m = l(m, h), i("stars", m), m), I = (m) => !m || m.toLowerCase() === "x" || m === "*", F = (m, h) => m.trim().split(/\s+/).map((w) => J(w, h)).join(" "), J = (m, h) => {
2483
+ const w = h.loose ? d[u.TILDELOOSE] : d[u.TILDE];
2484
+ return m.replace(w, (O, $, A, S, U) => {
2485
+ i("tilde", m, O, $, A, S, U);
2486
+ let V;
2487
+ return I($) ? V = "" : I(A) ? V = `>=${$}.0.0 <${+$ + 1}.0.0-0` : I(S) ? V = `>=${$}.${A}.0 <${$}.${+A + 1}.0-0` : U ? (i("replaceTilde pr", U), V = `>=${$}.${A}.${S}-${U} <${$}.${+A + 1}.0-0`) : V = `>=${$}.${A}.${S} <${$}.${+A + 1}.0-0`, i("tilde return", V), V;
2488
+ });
2489
+ }, Z = (m, h) => m.trim().split(/\s+/).map((w) => M(w, h)).join(" "), M = (m, h) => {
2490
+ i("caret", m, h);
2491
+ const w = h.loose ? d[u.CARETLOOSE] : d[u.CARET], O = h.includePrerelease ? "-0" : "";
2492
+ return m.replace(w, ($, A, S, U, V) => {
2493
+ i("caret", m, $, A, S, U, V);
2494
+ let B;
2495
+ return I(A) ? B = "" : I(S) ? B = `>=${A}.0.0${O} <${+A + 1}.0.0-0` : I(U) ? A === "0" ? B = `>=${A}.${S}.0${O} <${A}.${+S + 1}.0-0` : B = `>=${A}.${S}.0${O} <${+A + 1}.0.0-0` : V ? (i("replaceCaret pr", V), A === "0" ? S === "0" ? B = `>=${A}.${S}.${U}-${V} <${A}.${S}.${+U + 1}-0` : B = `>=${A}.${S}.${U}-${V} <${A}.${+S + 1}.0-0` : B = `>=${A}.${S}.${U}-${V} <${+A + 1}.0.0-0`) : (i("no pr"), A === "0" ? S === "0" ? B = `>=${A}.${S}.${U}${O} <${A}.${S}.${+U + 1}-0` : B = `>=${A}.${S}.${U}${O} <${A}.${+S + 1}.0-0` : B = `>=${A}.${S}.${U} <${+A + 1}.0.0-0`), i("caret return", B), B;
2496
+ });
2497
+ }, q = (m, h) => (i("replaceXRanges", m, h), m.split(/\s+/).map((w) => a(w, h)).join(" ")), a = (m, h) => {
2498
+ m = m.trim();
2499
+ const w = h.loose ? d[u.XRANGELOOSE] : d[u.XRANGE];
2500
+ return m.replace(w, (O, $, A, S, U, V) => {
2501
+ i("xRange", m, O, $, A, S, U, V);
2502
+ const B = I(A), X = B || I(S), z = X || I(U), ue = z;
2503
+ return $ === "=" && ue && ($ = ""), V = h.includePrerelease ? "-0" : "", B ? $ === ">" || $ === "<" ? O = "<0.0.0-0" : O = "*" : $ && ue ? (X && (S = 0), U = 0, $ === ">" ? ($ = ">=", X ? (A = +A + 1, S = 0, U = 0) : (S = +S + 1, U = 0)) : $ === "<=" && ($ = "<", X ? A = +A + 1 : S = +S + 1), $ === "<" && (V = "-0"), O = `${$ + A}.${S}.${U}${V}`) : X ? O = `>=${A}.0.0${V} <${+A + 1}.0.0-0` : z && (O = `>=${A}.${S}.0${V} <${A}.${+S + 1}.0-0`), i("xRange return", O), O;
2504
+ });
2505
+ }, l = (m, h) => (i("replaceStars", m, h), m.trim().replace(d[u.STAR], "")), b = (m, h) => (i("replaceGTE0", m, h), m.trim().replace(d[h.includePrerelease ? u.GTE0PRE : u.GTE0], "")), _ = (m) => (h, w, O, $, A, S, U, V, B, X, z, ue) => (I(O) ? w = "" : I($) ? w = `>=${O}.0.0${m ? "-0" : ""}` : I(A) ? w = `>=${O}.${$}.0${m ? "-0" : ""}` : S ? w = `>=${w}` : w = `>=${w}${m ? "-0" : ""}`, I(B) ? V = "" : I(X) ? V = `<${+B + 1}.0.0-0` : I(z) ? V = `<${B}.${+X + 1}.0-0` : ue ? V = `<=${B}.${X}.${z}-${ue}` : m ? V = `<${B}.${X}.${+z + 1}-0` : V = `<=${V}`, `${w} ${V}`.trim()), v = (m, h, w) => {
2506
+ for (let O = 0; O < m.length; O++)
2507
+ if (!m[O].test(h))
2508
+ return !1;
2509
+ if (h.prerelease.length && !w.includePrerelease) {
2510
+ for (let O = 0; O < m.length; O++)
2511
+ if (i(m[O].semver), m[O].semver !== o.ANY && m[O].semver.prerelease.length > 0) {
2512
+ const $ = m[O].semver;
2513
+ if ($.major === h.major && $.minor === h.minor && $.patch === h.patch)
2514
+ return !0;
2515
+ }
2516
+ return !1;
2517
+ }
2518
+ return !0;
2519
+ };
2520
+ return We;
2521
+ }
2522
+ var Je, Gt;
2523
+ function De() {
2524
+ if (Gt)
2525
+ return Je;
2526
+ Gt = 1;
2527
+ const t = Symbol("SemVer ANY");
2528
+ class e {
2529
+ static get ANY() {
2530
+ return t;
2531
+ }
2532
+ constructor(g, c) {
2533
+ if (c = r(c), g instanceof e) {
2534
+ if (g.loose === !!c.loose)
2535
+ return g;
2536
+ g = g.value;
2537
+ }
2538
+ g = g.trim().split(/\s+/).join(" "), i("comparator", g, c), this.options = c, this.loose = !!c.loose, this.parse(g), this.semver === t ? this.value = "" : this.value = this.operator + this.semver.version, i("comp", this);
2539
+ }
2540
+ parse(g) {
2541
+ const c = this.options.loose ? n[s.COMPARATORLOOSE] : n[s.COMPARATOR], L = g.match(c);
2542
+ if (!L)
2543
+ throw new TypeError(`Invalid comparator: ${g}`);
2544
+ this.operator = L[1] !== void 0 ? L[1] : "", this.operator === "=" && (this.operator = ""), L[2] ? this.semver = new f(L[2], this.options.loose) : this.semver = t;
2545
+ }
2546
+ toString() {
2547
+ return this.value;
2548
+ }
2549
+ test(g) {
2550
+ if (i("Comparator.test", g, this.options.loose), this.semver === t || g === t)
2551
+ return !0;
2552
+ if (typeof g == "string")
2553
+ try {
2554
+ g = new f(g, this.options);
2555
+ } catch {
2556
+ return !1;
2557
+ }
2558
+ return o(g, this.operator, this.semver, this.options);
2559
+ }
2560
+ intersects(g, c) {
2561
+ if (!(g instanceof e))
2562
+ throw new TypeError("a Comparator is required");
2563
+ return this.operator === "" ? this.value === "" ? !0 : new d(g.value, c).test(this.value) : g.operator === "" ? g.value === "" ? !0 : new d(this.value, c).test(g.semver) : (c = r(c), c.includePrerelease && (this.value === "<0.0.0-0" || g.value === "<0.0.0-0") || !c.includePrerelease && (this.value.startsWith("<0.0.0") || g.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && g.operator.startsWith(">") || this.operator.startsWith("<") && g.operator.startsWith("<") || this.semver.version === g.semver.version && this.operator.includes("=") && g.operator.includes("=") || o(this.semver, "<", g.semver, c) && this.operator.startsWith(">") && g.operator.startsWith("<") || o(this.semver, ">", g.semver, c) && this.operator.startsWith("<") && g.operator.startsWith(">")));
2564
+ }
2565
+ }
2566
+ Je = e;
2567
+ const r = ft, { safeRe: n, t: s } = we, o = Er, i = Me, f = ee, d = oe();
2568
+ return Je;
2569
+ }
2570
+ const Ta = oe(), La = (t, e, r) => {
2571
+ try {
2572
+ e = new Ta(e, r);
2573
+ } catch {
2574
+ return !1;
2575
+ }
2576
+ return e.test(t);
2577
+ };
2578
+ var Ge = La;
2579
+ const Na = oe(), Ca = (t, e) => new Na(t, e).set.map((r) => r.map((n) => n.value).join(" ").trim().split(" "));
2580
+ var ka = Ca;
2581
+ const xa = ee, Va = oe(), Fa = (t, e, r) => {
2582
+ let n = null, s = null, o = null;
2583
+ try {
2584
+ o = new Va(e, r);
2585
+ } catch {
2586
+ return null;
2587
+ }
2588
+ return t.forEach((i) => {
2589
+ o.test(i) && (!n || s.compare(i) === -1) && (n = i, s = new xa(n, r));
2590
+ }), n;
2591
+ };
2592
+ var ja = Fa;
2593
+ const Ma = ee, Ua = oe(), Da = (t, e, r) => {
2594
+ let n = null, s = null, o = null;
2595
+ try {
2596
+ o = new Ua(e, r);
2597
+ } catch {
2598
+ return null;
2599
+ }
2600
+ return t.forEach((i) => {
2601
+ o.test(i) && (!n || s.compare(i) === 1) && (n = i, s = new Ma(n, r));
2602
+ }), n;
2603
+ };
2604
+ var Ga = Da;
2605
+ const Ze = ee, Ba = oe(), Bt = Ue, Ka = (t, e) => {
2606
+ t = new Ba(t, e);
2607
+ let r = new Ze("0.0.0");
2608
+ if (t.test(r) || (r = new Ze("0.0.0-0"), t.test(r)))
2609
+ return r;
2610
+ r = null;
2611
+ for (let n = 0; n < t.set.length; ++n) {
2612
+ const s = t.set[n];
2613
+ let o = null;
2614
+ s.forEach((i) => {
2615
+ const f = new Ze(i.semver.version);
2616
+ switch (i.operator) {
2617
+ case ">":
2618
+ f.prerelease.length === 0 ? f.patch++ : f.prerelease.push(0), f.raw = f.format();
2619
+ case "":
2620
+ case ">=":
2621
+ (!o || Bt(f, o)) && (o = f);
2622
+ break;
2623
+ case "<":
2624
+ case "<=":
2625
+ break;
2626
+ default:
2627
+ throw new Error(`Unexpected operation: ${i.operator}`);
2628
+ }
2629
+ }), o && (!r || Bt(r, o)) && (r = o);
2630
+ }
2631
+ return r && t.test(r) ? r : null;
2632
+ };
2633
+ var qa = Ka;
2634
+ const za = oe(), Ha = (t, e) => {
2635
+ try {
2636
+ return new za(t, e).range || "*";
2637
+ } catch {
2638
+ return null;
2639
+ }
2640
+ };
2641
+ var Xa = Ha;
2642
+ const Ya = ee, wr = De(), { ANY: Wa } = wr, Ja = oe(), Za = Ge, Kt = Ue, qt = pt, Qa = vt, eo = ht, to = (t, e, r, n) => {
2643
+ t = new Ya(t, n), e = new Ja(e, n);
2644
+ let s, o, i, f, d;
2645
+ switch (r) {
2646
+ case ">":
2647
+ s = Kt, o = Qa, i = qt, f = ">", d = ">=";
2648
+ break;
2649
+ case "<":
2650
+ s = qt, o = eo, i = Kt, f = "<", d = "<=";
2651
+ break;
2652
+ default:
2653
+ throw new TypeError('Must provide a hilo val of "<" or ">"');
2654
+ }
2655
+ if (Za(t, e, n))
2656
+ return !1;
2657
+ for (let u = 0; u < e.set.length; ++u) {
2658
+ const g = e.set[u];
2659
+ let c = null, L = null;
2660
+ if (g.forEach((y) => {
2661
+ y.semver === Wa && (y = new wr(">=0.0.0")), c = c || y, L = L || y, s(y.semver, c.semver, n) ? c = y : i(y.semver, L.semver, n) && (L = y);
2662
+ }), c.operator === f || c.operator === d || (!L.operator || L.operator === f) && o(t, L.semver))
2663
+ return !1;
2664
+ if (L.operator === d && i(t, L.semver))
2665
+ return !1;
2666
+ }
2667
+ return !0;
2668
+ };
2669
+ var bt = to;
2670
+ const ro = bt, no = (t, e, r) => ro(t, e, ">", r);
2671
+ var so = no;
2672
+ const ao = bt, oo = (t, e, r) => ao(t, e, "<", r);
2673
+ var io = oo;
2674
+ const zt = oe(), lo = (t, e, r) => (t = new zt(t, r), e = new zt(e, r), t.intersects(e, r));
2675
+ var uo = lo;
2676
+ const co = Ge, fo = ae;
2677
+ var mo = (t, e, r) => {
2678
+ const n = [];
2679
+ let s = null, o = null;
2680
+ const i = t.sort((g, c) => fo(g, c, r));
2681
+ for (const g of i)
2682
+ co(g, e, r) ? (o = g, s || (s = g)) : (o && n.push([s, o]), o = null, s = null);
2683
+ s && n.push([s, null]);
2684
+ const f = [];
2685
+ for (const [g, c] of n)
2686
+ g === c ? f.push(g) : !c && g === i[0] ? f.push("*") : c ? g === i[0] ? f.push(`<=${c}`) : f.push(`${g} - ${c}`) : f.push(`>=${g}`);
2687
+ const d = f.join(" || "), u = typeof e.raw == "string" ? e.raw : String(e);
2688
+ return d.length < u.length ? d : e;
2689
+ };
2690
+ const Ht = oe(), gt = De(), { ANY: Qe } = gt, _e = Ge, yt = ae, po = (t, e, r = {}) => {
2691
+ if (t === e)
2692
+ return !0;
2693
+ t = new Ht(t, r), e = new Ht(e, r);
2694
+ let n = !1;
2695
+ e:
2696
+ for (const s of t.set) {
2697
+ for (const o of e.set) {
2698
+ const i = vo(s, o, r);
2699
+ if (n = n || i !== null, i)
2700
+ continue e;
2701
+ }
2702
+ if (n)
2703
+ return !1;
2704
+ }
2705
+ return !0;
2706
+ }, ho = [new gt(">=0.0.0-0")], Xt = [new gt(">=0.0.0")], vo = (t, e, r) => {
2707
+ if (t === e)
2708
+ return !0;
2709
+ if (t.length === 1 && t[0].semver === Qe) {
2710
+ if (e.length === 1 && e[0].semver === Qe)
2711
+ return !0;
2712
+ r.includePrerelease ? t = ho : t = Xt;
2713
+ }
2714
+ if (e.length === 1 && e[0].semver === Qe) {
2715
+ if (r.includePrerelease)
2716
+ return !0;
2717
+ e = Xt;
2718
+ }
2719
+ const n = /* @__PURE__ */ new Set();
2720
+ let s, o;
2721
+ for (const y of t)
2722
+ y.operator === ">" || y.operator === ">=" ? s = Yt(s, y, r) : y.operator === "<" || y.operator === "<=" ? o = Wt(o, y, r) : n.add(y.semver);
2723
+ if (n.size > 1)
2724
+ return null;
2725
+ let i;
2726
+ if (s && o) {
2727
+ if (i = yt(s.semver, o.semver, r), i > 0)
2728
+ return null;
2729
+ if (i === 0 && (s.operator !== ">=" || o.operator !== "<="))
2730
+ return null;
2731
+ }
2732
+ for (const y of n) {
2733
+ if (s && !_e(y, String(s), r) || o && !_e(y, String(o), r))
2734
+ return null;
2735
+ for (const p of e)
2736
+ if (!_e(y, String(p), r))
2737
+ return !1;
2738
+ return !0;
2739
+ }
2740
+ let f, d, u, g, c = o && !r.includePrerelease && o.semver.prerelease.length ? o.semver : !1, L = s && !r.includePrerelease && s.semver.prerelease.length ? s.semver : !1;
2741
+ c && c.prerelease.length === 1 && o.operator === "<" && c.prerelease[0] === 0 && (c = !1);
2742
+ for (const y of e) {
2743
+ if (g = g || y.operator === ">" || y.operator === ">=", u = u || y.operator === "<" || y.operator === "<=", s) {
2744
+ if (L && y.semver.prerelease && y.semver.prerelease.length && y.semver.major === L.major && y.semver.minor === L.minor && y.semver.patch === L.patch && (L = !1), y.operator === ">" || y.operator === ">=") {
2745
+ if (f = Yt(s, y, r), f === y && f !== s)
2746
+ return !1;
2747
+ } else if (s.operator === ">=" && !_e(s.semver, String(y), r))
2748
+ return !1;
2749
+ }
2750
+ if (o) {
2751
+ if (c && y.semver.prerelease && y.semver.prerelease.length && y.semver.major === c.major && y.semver.minor === c.minor && y.semver.patch === c.patch && (c = !1), y.operator === "<" || y.operator === "<=") {
2752
+ if (d = Wt(o, y, r), d === y && d !== o)
2753
+ return !1;
2754
+ } else if (o.operator === "<=" && !_e(o.semver, String(y), r))
2755
+ return !1;
2756
+ }
2757
+ if (!y.operator && (o || s) && i !== 0)
2758
+ return !1;
2759
+ }
2760
+ return !(s && u && !o && i !== 0 || o && g && !s && i !== 0 || L || c);
2761
+ }, Yt = (t, e, r) => {
2762
+ if (!t)
2763
+ return e;
2764
+ const n = yt(t.semver, e.semver, r);
2765
+ return n > 0 ? t : n < 0 || e.operator === ">" && t.operator === ">=" ? e : t;
2766
+ }, Wt = (t, e, r) => {
2767
+ if (!t)
2768
+ return e;
2769
+ const n = yt(t.semver, e.semver, r);
2770
+ return n < 0 ? t : n > 0 || e.operator === "<" && t.operator === "<=" ? e : t;
2771
+ };
2772
+ var bo = po;
2773
+ const et = we, Jt = je, go = ee, Zt = yr, yo = $e, $o = Is, _o = Ps, Eo = Ts, wo = Ns, Ro = xs, Io = js, Ao = Ds, Oo = Ks, Po = ae, So = Xs, To = Js, Lo = mt, No = ta, Co = sa, ko = Ue, xo = pt, Vo = $r, Fo = _r, jo = ht, Mo = vt, Uo = Er, Do = Oa, Go = De(), Bo = oe(), Ko = Ge, qo = ka, zo = ja, Ho = Ga, Xo = qa, Yo = Xa, Wo = bt, Jo = so, Zo = io, Qo = uo, ei = mo, ti = bo;
2774
+ var ri = {
2775
+ parse: yo,
2776
+ valid: $o,
2777
+ clean: _o,
2778
+ inc: Eo,
2779
+ diff: wo,
2780
+ major: Ro,
2781
+ minor: Io,
2782
+ patch: Ao,
2783
+ prerelease: Oo,
2784
+ compare: Po,
2785
+ rcompare: So,
2786
+ compareLoose: To,
2787
+ compareBuild: Lo,
2788
+ sort: No,
2789
+ rsort: Co,
2790
+ gt: ko,
2791
+ lt: xo,
2792
+ eq: Vo,
2793
+ neq: Fo,
2794
+ gte: jo,
2795
+ lte: Mo,
2796
+ cmp: Uo,
2797
+ coerce: Do,
2798
+ Comparator: Go,
2799
+ Range: Bo,
2800
+ satisfies: Ko,
2801
+ toComparators: qo,
2802
+ maxSatisfying: zo,
2803
+ minSatisfying: Ho,
2804
+ minVersion: Xo,
2805
+ validRange: Yo,
2806
+ outside: Wo,
2807
+ gtr: Jo,
2808
+ ltr: Zo,
2809
+ intersects: Qo,
2810
+ simplifyRange: ei,
2811
+ subset: ti,
2812
+ SemVer: go,
2813
+ re: et.re,
2814
+ src: et.src,
2815
+ tokens: et.t,
2816
+ SEMVER_SPEC_VERSION: Jt.SEMVER_SPEC_VERSION,
2817
+ RELEASE_TYPES: Jt.RELEASE_TYPES,
2818
+ compareIdentifiers: Zt.compareIdentifiers,
2819
+ rcompareIdentifiers: Zt.rcompareIdentifiers
2820
+ };
2821
+ const Qt = /* @__PURE__ */ ar(ri);
2822
+ var it = /* @__PURE__ */ ((t) => (t[t.menuV3 = 0] = "menuV3", t[t.applyEffectOnOrder = 1] = "applyEffectOnOrder", t[t.nestedAddon = 2] = "nestedAddon", t[t.feedmeDelivery = 3] = "feedmeDelivery", t[t.taxAndServiceChargeV4 = 4] = "taxAndServiceChargeV4", t[t.itemCombo = 5] = "itemCombo", t[t.itemTakeaway = 6] = "itemTakeaway", t[t.transferInventory = 7] = "transferInventory", t[t.qrEPayment = 8] = "qrEPayment", t[t.deliveryIntegration = 9] = "deliveryIntegration", t[t.rmsPayment = 10] = "rmsPayment", t[t.queue = 11] = "queue", t[t.paymentVoucher = 12] = "paymentVoucher", t))(it || {});
2823
+ const Rr = {
2824
+ 0: "3.0.0-alpha",
2825
+ 1: "3.5.0-alpha",
2826
+ 2: "4.0.0-alpha",
2827
+ 4: "4.0.0-alpha",
2828
+ 5: "4.1.0-alpha",
2829
+ // TODO: #475 make sure current pos version
2830
+ 6: "4.3.10-alpha",
2831
+ 7: "4.5.0-alpha",
2832
+ 8: "6.9.0-alpha",
2833
+ 9: "6.11.0-alpha",
2834
+ 3: "6.12.0-alpha",
2835
+ 10: "6.21.0-alpha",
2836
+ 11: "6.21.0-alpha",
2837
+ 12: "6.31.0-alpha"
2838
+ };
2839
+ function ni(t, e) {
2840
+ return Qt.valid(e) && Qt.gte(e, Rr[t]);
2841
+ }
2842
+ function si(t) {
2843
+ return Rr[t].replace("-alpha", "");
2844
+ }
2845
+ function ai({ posVersion: t, payoutAccount: e }) {
2846
+ return !!t && ni(it.qrEPayment, t) ? !e || !e.enable ? "Payout account is required" : e.status !== ut.F_PAYOUT_ACCOUNT_STATUS.enum.APPROVED ? "Payout account under review" : !0 : `For POS ${si(it.qrEPayment)} or above`;
2847
+ }
2848
+ function Ir(t) {
2849
+ return {
2850
+ id: t._id,
2851
+ ...t,
2852
+ profile: {
2853
+ ...t.profile,
2854
+ address: Ee(t.profile.address)
2855
+ },
2856
+ allowEPayment: ai(t)
2857
+ };
2858
+ }
2859
+ function Se(t) {
2860
+ return Ir(or(t));
2861
+ }
2862
+ async function er(t) {
2863
+ const e = or(t), r = [];
2864
+ for (const n of e)
2865
+ r.push(await Ir(n));
2866
+ return r;
2867
+ }
2868
+ const Ar = {
2869
+ async readRestaurant(t) {
2870
+ return await Se(await qe().get(`/restaurants/${t}`));
2871
+ },
2872
+ async readRestaurants() {
2873
+ return await er(await ze().get("/restaurants"));
2874
+ },
2875
+ async readRestaurantsByBusiness() {
2876
+ return await er(await ze().get("/restaurant-list"));
2877
+ },
2878
+ async createRestaurant(t) {
2879
+ return await Se(await ze().post("/restaurants", t));
2880
+ },
2881
+ async updateRestaurantProfile(t, e) {
2882
+ return await Se(
2883
+ await qe().put(`/restaurants/${t}/profile`, e)
2884
+ );
2885
+ },
2886
+ async updatePayoutAccount(t, e) {
2887
+ return await Se(
2888
+ await qe().put(`/restaurants/${t}/payout-account`, e)
2889
+ );
2890
+ }
2891
+ }, tt = {
2892
+ async get(t, e) {
2893
+ const r = Xe(void 0, e), n = Ye(r, t);
2894
+ return await (await zr(n)).text();
2895
+ },
2896
+ async update(t, e, r) {
2897
+ const n = Xe(void 0, r), s = Ye(n, t);
2898
+ return await Hr(s, e), await Xr(s);
2899
+ },
2900
+ async delete(t, e) {
2901
+ const r = Xe(void 0, e), n = Ye(r, t);
2902
+ await Yr(n);
2903
+ }
2904
+ }, de = {
2905
+ async get(t) {
2906
+ return await tt.get(t);
2907
+ },
2908
+ async update(t, e, r) {
2909
+ return await tt.update(t, e);
2910
+ },
2911
+ async delete(t) {
2912
+ await tt.delete(t);
2913
+ }
2914
+ };
2915
+ class oi {
2916
+ constructor(e, r) {
2917
+ Ke(this, "restaurant");
2918
+ Ke(this, "data");
2919
+ this.restaurant = e, this.data = r;
2920
+ }
2921
+ generateUrl(e) {
2922
+ const r = e === "normal" ? dt().toISOString() : "photo";
2923
+ return `restaurant/${this.restaurant.id}/${e}/${r}`;
2924
+ }
2925
+ async manageThumbnail() {
2926
+ const { newThumbnailPhoto: e, thumbnailPhoto: r } = this.data;
2927
+ if (e) {
2928
+ const s = await de.update(this.generateUrl("thumbnail"), e, {
2929
+ includedTime: !0
2930
+ });
2931
+ this.data.thumbnailPhoto = s;
2932
+ return;
2933
+ }
2934
+ const n = this.restaurant.profile.thumbnailPhoto;
2935
+ n && !r && (await de.delete(n), this.data.thumbnailPhoto = void 0);
2936
+ }
2937
+ async manageCover() {
2938
+ const { newCoverPhoto: e, coverPhoto: r } = this.data;
2939
+ if (e) {
2940
+ const s = await de.update(this.generateUrl("cover"), e, {
2941
+ includedTime: !0
2942
+ });
2943
+ this.data.coverPhoto = s;
2944
+ return;
2945
+ }
2946
+ const n = this.restaurant.profile.coverPhoto;
2947
+ n && !r && (await de.delete(n), this.data.coverPhoto = void 0);
2948
+ }
2949
+ async manageCarousels() {
2950
+ const e = this.data.newPhotos || [];
2951
+ for (const r of e) {
2952
+ const n = await de.update(this.generateUrl("normal"), r);
2953
+ this.data.photos = [...this.data.photos || [], n];
2954
+ }
2955
+ }
2956
+ async run() {
2957
+ return await this.manageThumbnail(), await this.manageCover(), await this.manageCarousels(), this.data;
2958
+ }
2959
+ }
2960
+ async function tr(t, e) {
2961
+ const r = new oi(t, e);
2962
+ await r.run(), await Ar.updateRestaurantProfile(t.id, r.data), await fe().readRestaurants();
2963
+ }
2964
+ const ii = () => {
2965
+ const t = fe();
2966
+ return {
2967
+ async createRestaurant(e, r) {
2968
+ const n = await Ar.createRestaurant({
2969
+ businessId: e,
2970
+ features: [],
2971
+ profile: r
2972
+ });
2973
+ await tr(n, r), await t.readRestaurants();
2974
+ },
2975
+ async updateRestaurantProfile(e, r) {
2976
+ await tr(e, r);
2977
+ }
2978
+ };
2979
+ };
2980
+ function li(t) {
2981
+ const e = re({ top: 0, bottom: 0, left: 0, right: 0 });
2982
+ function r() {
2983
+ if (t.value) {
2984
+ const n = t.value.getBoundingClientRect();
2985
+ e.value = {
2986
+ top: n.top,
2987
+ bottom: n.bottom,
2988
+ left: n.left,
2989
+ right: n.right
2990
+ };
2991
+ }
2992
+ }
2993
+ return rt(t, async (n) => {
2994
+ n && (await sr(), r());
2995
+ }), nr(() => {
2996
+ window.addEventListener("resize", r);
2997
+ }), kr(() => {
2998
+ window.removeEventListener("resize", r);
2999
+ }), e;
3000
+ }
3001
+ const ui = /* @__PURE__ */ W({
3002
+ __name: "FormColumn",
3003
+ props: {
3004
+ shrinkable: { type: Boolean }
3005
+ },
3006
+ setup(t) {
3007
+ return (e, r) => (k(), D("div", {
3008
+ class: Y(["flex-1 flex flex-col space-y-24", { "min-h-0": e.shrinkable }])
3009
+ }, [
3010
+ ne(e.$slots, "default")
3011
+ ], 2));
3012
+ }
3013
+ }), ci = {
3014
+ key: 0,
3015
+ class: "flex flex-row justify-between items-center"
3016
+ }, di = { class: "space-y-4" }, fi = { class: "fm-typo-en-title-sm-600" }, mi = {
3017
+ key: 0,
3018
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
3019
+ }, Te = /* @__PURE__ */ W({
3020
+ __name: "FormSection",
3021
+ props: {
3022
+ title: {},
3023
+ subTitle: {},
3024
+ shrinkable: { type: Boolean }
3025
+ },
3026
+ setup(t) {
3027
+ return (e, r) => (k(), D("div", {
3028
+ class: Y(["flex flex-col space-y-16", { "min-h-0": e.shrinkable }])
3029
+ }, [
3030
+ e.title ? (k(), D("div", ci, [
3031
+ E("div", di, [
3032
+ E("p", fi, j(e.title), 1),
3033
+ e.subTitle ? (k(), D("p", mi, j(e.subTitle), 1)) : le("", !0)
3034
+ ]),
3035
+ ne(e.$slots, "append-title")
3036
+ ])) : le("", !0),
3037
+ T(ui, { shrinkable: e.shrinkable }, {
3038
+ default: G(() => [
3039
+ ne(e.$slots, "default")
3040
+ ]),
3041
+ _: 3
3042
+ }, 8, ["shrinkable"])
3043
+ ], 2));
3044
+ }
3045
+ }), pi = { class: "flex justify-center" }, hi = { class: "space-y-24" }, vi = { class: "space-y-24" }, bi = { class: "flex gap-16 xs:flex-col xs:gap-24" }, gi = { class: "flex-1" }, yi = { class: "flex-1" }, $i = { class: "space-y-24" }, _i = { class: "space-y-24" }, Ei = { class: "space-y-8" }, wi = { class: "space-y-24" }, rr = /* @__PURE__ */ W({
3046
+ __name: "RestaurantForm",
3047
+ props: {
3048
+ restaurantId: {
3049
+ type: String,
3050
+ default: void 0
3051
+ },
3052
+ restaurant: {
3053
+ type: Object
3054
+ },
3055
+ initialValue: {
3056
+ type: Object,
3057
+ default: void 0
3058
+ },
3059
+ enableFeedmeExpress: {
3060
+ type: Boolean,
3061
+ required: !0
3062
+ }
3063
+ },
3064
+ setup(t, { expose: e }) {
3065
+ const r = t, { restaurants: n, currentBusiness: s } = fe(), o = ct(), i = ir(o), { copyTextToClipboard: f } = dr(), d = re(!1), u = (_, v) => {
3066
+ d.value = !d.value;
3067
+ }, g = H(() => {
3068
+ var _;
3069
+ return (_ = r.restaurant) == null ? void 0 : _.profile;
3070
+ }), c = lt(
3071
+ g.value ? ge(g.value) : {
3072
+ ...Ot(),
3073
+ address: Ee(Ot().address),
3074
+ legalName: "",
3075
+ sstRegNo: "",
3076
+ description: "",
3077
+ url: "",
3078
+ thumbnailPhoto: void 0,
3079
+ coverPhoto: void 0,
3080
+ newThumbnailPhoto: void 0,
3081
+ newCoverPhoto: void 0,
3082
+ newPhotos: [],
3083
+ operatingHours: {
3084
+ 0: {
3085
+ enable: !1,
3086
+ hours: []
3087
+ },
3088
+ 1: {
3089
+ enable: !1,
3090
+ hours: []
3091
+ },
3092
+ 2: {
3093
+ enable: !1,
3094
+ hours: []
3095
+ },
3096
+ 3: {
3097
+ enable: !1,
3098
+ hours: []
3099
+ },
3100
+ 4: {
3101
+ enable: !1,
3102
+ hours: []
3103
+ },
3104
+ 5: {
3105
+ enable: !1,
3106
+ hours: []
3107
+ },
3108
+ 6: {
3109
+ enable: !1,
3110
+ hours: []
3111
+ }
3112
+ }
3113
+ }
3114
+ ), L = "https://feedmedev.cc/", y = H(() => fe().currentCountry.value), { t: p } = pe(), P = re(
3115
+ r.restaurantId ? p("settings.business.restaurant.form.title.update") : p("settings.business.restaurant.form.title.add")
3116
+ ), N = H(() => Ee(c.address)), C = H(() => N.value.formatted);
3117
+ function x(_) {
3118
+ var v;
3119
+ if (typeof _ == "string") {
3120
+ const m = (v = n.value.find((h) => h._id === _)) == null ? void 0 : v.profile.operatingHours;
3121
+ m ? c.operatingHours = ge(m) : o.open({
3122
+ title: p("settings.business.restaurant.form.sections.operation_hours.invalid"),
3123
+ type: "error"
3124
+ });
3125
+ }
3126
+ }
3127
+ function I() {
3128
+ c.thumbnailPhoto = void 0, c.newThumbnailPhoto = void 0;
3129
+ }
3130
+ function F() {
3131
+ c.coverPhoto = void 0, c.newCoverPhoto = void 0;
3132
+ }
3133
+ function J(_) {
3134
+ c.newPhotos = c.newPhotos || [], c.newPhotos.push(_);
3135
+ }
3136
+ const Z = ii();
3137
+ function M() {
3138
+ var _, v;
3139
+ if (u(), r.restaurantId) {
3140
+ if (!((_ = s.value) != null && _.id))
3141
+ return;
3142
+ i.minor(async () => {
3143
+ var m, h;
3144
+ r.restaurant && (await Z.updateRestaurantProfile(r.restaurant, {
3145
+ ...c,
3146
+ url: ((m = c.url) == null ? void 0 : m.trim()) || null,
3147
+ code: ((h = c.code) == null ? void 0 : h.trim()) || null
3148
+ }), p("settings.business.restaurant.form.message.updated"));
3149
+ });
3150
+ } else {
3151
+ if (!((v = s.value) != null && v.id))
3152
+ return;
3153
+ i.minor(async () => {
3154
+ var m, h;
3155
+ await Z.createRestaurant(s.value.id, {
3156
+ ...c,
3157
+ url: ((m = c.url) == null ? void 0 : m.trim()) || null,
3158
+ code: ((h = c.code) == null ? void 0 : h.trim()) || null
3159
+ }), p("settings.business.restaurant.form.message.created");
3160
+ });
3161
+ }
3162
+ }
3163
+ const q = H(() => ({
3164
+ title: p("settings.business.restaurant.form.summary.title"),
3165
+ items: [
3166
+ {
3167
+ name: p("settings.business.restaurant.form.summary.name"),
3168
+ value: c.name
3169
+ },
3170
+ {
3171
+ name: p("settings.business.restaurant.form.summary.legal_name"),
3172
+ value: c.legalName
3173
+ },
3174
+ {
3175
+ name: p("settings.business.restaurant.form.summary.contact"),
3176
+ value: c.phoneNo
3177
+ },
3178
+ {
3179
+ name: p("settings.business.restaurant.form.summary.address"),
3180
+ value: C.value
3181
+ }
3182
+ ]
3183
+ })), { isAtMost: a } = ur();
3184
+ H(() => a("sm"));
3185
+ const l = re(null), b = li(l);
3186
+ return e({ trigger: u }), (_, v) => {
3187
+ const m = K("FmTextField"), h = K("FmPhoneNumber"), w = K("FmTextarea"), O = K("FmButton");
3188
+ return k(), D(se, null, [
3189
+ ne(_.$slots, "trigger", xr(Vr({
3190
+ trigger: u
3191
+ }))),
3192
+ T(En, {
3193
+ title: P.value,
3194
+ show: d.value,
3195
+ "primary-action": { label: R(p)("common.save") },
3196
+ "secondary-actions": [
3197
+ { label: R(p)("settings.business.restaurant.actions.discard"), click: () => d.value = !1 }
3198
+ ],
3199
+ onOnPrimary: M,
3200
+ onOnCancel: v[17] || (v[17] = ($) => d.value = !1)
3201
+ }, {
3202
+ "append-title": G(() => [
3203
+ R(a)("sm") ? (k(), Q(Lt, {
3204
+ key: 0,
3205
+ variant: "dialog",
3206
+ title: q.value.title,
3207
+ items: q.value.items
3208
+ }, null, 8, ["title", "items"])) : le("", !0)
3209
+ ]),
3210
+ default: G(() => [
3211
+ E("div", pi, [
3212
+ E("div", {
3213
+ ref_key: "formWrapper",
3214
+ ref: l,
3215
+ class: "py-24 pr-[400px] w-[1150px] xs:pr-0 sm:pr-0 xs:w-full"
3216
+ }, [
3217
+ R(a)("sm") ? le("", !0) : (k(), Q(Lt, {
3218
+ key: 0,
3219
+ class: "fixed",
3220
+ style: Ne({
3221
+ top: "85px",
3222
+ left: R(b).right - 400 + "px"
3223
+ }),
3224
+ variant: "full",
3225
+ title: q.value.title,
3226
+ items: q.value.items
3227
+ }, null, 8, ["style", "title", "items"])),
3228
+ E("div", hi, [
3229
+ T(Te, {
3230
+ title: R(p)("settings.business.restaurant.form.sections.basic_info.title")
3231
+ }, {
3232
+ default: G(() => {
3233
+ var $, A;
3234
+ return [
3235
+ E("div", vi, [
3236
+ E("div", null, [
3237
+ T(m, {
3238
+ label: R(p)("settings.business.restaurant.form.sections.basic_info.code.label"),
3239
+ modelValue: c.code,
3240
+ "onUpdate:modelValue": v[0] || (v[0] = (S) => c.code = S),
3241
+ "label-mark": "optional",
3242
+ "helper-text": R(p)("settings.business.restaurant.form.sections.basic_info.code.helper"),
3243
+ disabled: (($ = g.value) == null ? void 0 : $.code) !== void 0 && ((A = g.value) == null ? void 0 : A.code) !== null
3244
+ }, null, 8, ["label", "modelValue", "helper-text", "disabled"])
3245
+ ]),
3246
+ E("div", null, [
3247
+ T(m, {
3248
+ label: R(p)("settings.business.restaurant.form.sections.basic_info.name.label"),
3249
+ modelValue: c.name,
3250
+ "onUpdate:modelValue": v[1] || (v[1] = (S) => c.name = S),
3251
+ "label-mark": "required",
3252
+ rules: [R(ce)]
3253
+ }, null, 8, ["label", "modelValue", "rules"])
3254
+ ]),
3255
+ E("div", null, [
3256
+ T(m, {
3257
+ label: R(p)("settings.business.restaurant.form.sections.basic_info.legal_name.label"),
3258
+ modelValue: c.legalName,
3259
+ "onUpdate:modelValue": v[2] || (v[2] = (S) => c.legalName = S),
3260
+ "label-mark": "required",
3261
+ rules: [R(ce)]
3262
+ }, null, 8, ["label", "modelValue", "rules"])
3263
+ ]),
3264
+ E("div", null, [
3265
+ T(m, {
3266
+ label: R(p)("settings.business.restaurant.form.sections.basic_info.reg_no.label"),
3267
+ modelValue: c.regNo,
3268
+ "onUpdate:modelValue": v[3] || (v[3] = (S) => c.regNo = S),
3269
+ "label-mark": "required",
3270
+ rules: [R(ce)]
3271
+ }, null, 8, ["label", "modelValue", "rules"])
3272
+ ]),
3273
+ E("div", null, [
3274
+ T(m, {
3275
+ modelValue: c.sstRegNo,
3276
+ "onUpdate:modelValue": v[4] || (v[4] = (S) => c.sstRegNo = S),
3277
+ label: R(p)("settings.business.restaurant.form.sections.basic_info.tax_no.label"),
3278
+ "label-mark": "optional"
3279
+ }, null, 8, ["modelValue", "label"])
3280
+ ]),
3281
+ E("div", bi, [
3282
+ E("div", gi, [
3283
+ T(h, {
3284
+ class: "w-full",
3285
+ label: R(p)("settings.business.restaurant.form.sections.basic_info.contact.label"),
3286
+ modelValue: c.phoneNo,
3287
+ "onUpdate:modelValue": v[5] || (v[5] = (S) => c.phoneNo = S),
3288
+ "label-mark": "optional"
3289
+ }, null, 8, ["label", "modelValue"])
3290
+ ]),
3291
+ E("div", yi, [
3292
+ T(m, {
3293
+ class: "w-full",
3294
+ modelValue: c.email,
3295
+ "onUpdate:modelValue": v[6] || (v[6] = (S) => c.email = S),
3296
+ label: R(p)("settings.business.restaurant.form.sections.basic_info.email.label"),
3297
+ "label-mark": "optional"
3298
+ }, null, 8, ["modelValue", "label"])
3299
+ ])
3300
+ ]),
3301
+ E("div", null, [
3302
+ T(be, {
3303
+ label: R(p)("settings.business.restaurant.form.sections.basic_info.image.label"),
3304
+ "sub-label": R(p)("settings.business.restaurant.form.sections.basic_info.image.optional"),
3305
+ "previous-url": c.thumbnailPhoto,
3306
+ modelValue: c.newThumbnailPhoto,
3307
+ "onUpdate:modelValue": v[7] || (v[7] = (S) => c.newThumbnailPhoto = S),
3308
+ "onReset:modelValue": I
3309
+ }, null, 8, ["label", "sub-label", "previous-url", "modelValue"])
3310
+ ])
3311
+ ])
3312
+ ];
3313
+ }),
3314
+ _: 1
3315
+ }, 8, ["title"]),
3316
+ v[18] || (v[18] = E("div", { class: "w-full h-[2px] bg-fm-color-neutral-gray-100" }, null, -1)),
3317
+ T(Te, {
3318
+ title: R(p)("settings.business.restaurant.form.sections.address.title")
3319
+ }, {
3320
+ default: G(() => [
3321
+ E("div", $i, [
3322
+ T(Zn, {
3323
+ modelValue: c.address,
3324
+ "onUpdate:modelValue": v[8] || (v[8] = ($) => c.address = $)
3325
+ }, null, 8, ["modelValue"]),
3326
+ T(as, {
3327
+ address: N.value,
3328
+ modelValue: c.address.coordinates,
3329
+ "onUpdate:modelValue": v[9] || (v[9] = ($) => c.address.coordinates = $)
3330
+ }, null, 8, ["address", "modelValue"])
3331
+ ])
3332
+ ]),
3333
+ _: 1
3334
+ }, 8, ["title"]),
3335
+ v[19] || (v[19] = E("div", { class: "w-full h-[2px] bg-fm-color-neutral-gray-100" }, null, -1)),
3336
+ T(Te, {
3337
+ title: R(p)("settings.business.restaurant.form.sections.operation_hours.title")
3338
+ }, {
3339
+ default: G(() => [
3340
+ E("div", _i, [
3341
+ E("div", Ei, [
3342
+ T(St, {
3343
+ label: R(p)("settings.business.restaurant.form.sections.operation_hours.copy_with"),
3344
+ optional: !1
3345
+ }, null, 8, ["label"]),
3346
+ T(Ur, {
3347
+ class: "w-[320px]",
3348
+ "exclude-restaurants": [t.restaurantId ?? ""],
3349
+ "model-value": "",
3350
+ "onUpdate:modelValue": v[10] || (v[10] = ($) => x($))
3351
+ }, null, 8, ["exclude-restaurants"]),
3352
+ T(us, {
3353
+ modelValue: c.operatingHours,
3354
+ "onUpdate:modelValue": v[11] || (v[11] = ($) => c.operatingHours = $)
3355
+ }, null, 8, ["modelValue"])
3356
+ ])
3357
+ ])
3358
+ ]),
3359
+ _: 1
3360
+ }, 8, ["title"]),
3361
+ v[20] || (v[20] = E("div", { class: "w-full h-[2px] bg-fm-color-neutral-gray-100" }, null, -1)),
3362
+ T(Te, {
3363
+ title: R(p)("settings.business.restaurant.form.sections.branding.title")
3364
+ }, {
3365
+ default: G(() => [
3366
+ E("div", wi, [
3367
+ T(w, {
3368
+ label: R(p)("settings.business.restaurant.form.sections.branding.description"),
3369
+ "model-value": c.description ?? "",
3370
+ "onUpdate:modelValue": v[12] || (v[12] = ($) => c.description = $)
3371
+ }, null, 8, ["label", "model-value"]),
3372
+ T(m, {
3373
+ label: R(p)("settings.business.restaurant.form.sections.branding.url.label"),
3374
+ placeholder: t.restaurantId,
3375
+ "model-value": c.url,
3376
+ "onUpdate:modelValue": v[14] || (v[14] = ($) => c.url = $),
3377
+ rules: [
3378
+ ($) => {
3379
+ var A;
3380
+ return !$ || ((A = g.value) == null ? void 0 : A.url) == c.url || y.value == R(ut.F_COUNTRY).enum.MY || R(p)("settings.business.restaurant.form.sections.branding.url.errors.disabled");
3381
+ },
3382
+ ($) => !$ || R(hr).test($) || R(p)("settings.business.restaurant.form.sections.branding.url.errors.invalid"),
3383
+ ($) => !$ || !R(vr).includes($) || R(p)("settings.business.restaurant.form.sections.branding.url.errors.reserved")
3384
+ ]
3385
+ }, {
3386
+ prepend: G(() => [
3387
+ E("span", null, j(L))
3388
+ ]),
3389
+ append: G(() => [
3390
+ T(O, {
3391
+ variant: "tertiary",
3392
+ icon: "file_copy",
3393
+ "text-color": "neutral-gray-400",
3394
+ onClick: v[13] || (v[13] = ($) => c.url && R(f)(c.url))
3395
+ })
3396
+ ]),
3397
+ _: 1
3398
+ }, 8, ["label", "placeholder", "model-value", "rules"]),
3399
+ E("div", null, [
3400
+ T(be, {
3401
+ label: R(p)("settings.business.form.cover_photo.label"),
3402
+ "previous-url": c.coverPhoto,
3403
+ modelValue: c.newCoverPhoto,
3404
+ "onUpdate:modelValue": v[15] || (v[15] = ($) => c.newCoverPhoto = $),
3405
+ "onReset:modelValue": F
3406
+ }, null, 8, ["label", "previous-url", "modelValue"])
3407
+ ]),
3408
+ E("div", null, [
3409
+ T(St, {
3410
+ label: R(p)("settings.business.restaurant.form.sections.branding.carousel_photos.label")
3411
+ }, null, 8, ["label"]),
3412
+ (k(!0), D(se, null, me(c.photos || [], ($, A) => (k(), Q(be, {
3413
+ key: A,
3414
+ "previous-url": $,
3415
+ "model-value": void 0,
3416
+ "onReset:modelValue": (S) => {
3417
+ var U;
3418
+ return (U = c.photos) == null ? void 0 : U.splice(A, 1);
3419
+ }
3420
+ }, null, 8, ["previous-url", "onReset:modelValue"]))), 128)),
3421
+ (k(!0), D(se, null, me(c.newPhotos || [], ($, A) => {
3422
+ var S;
3423
+ return k(), Q(be, {
3424
+ key: A,
3425
+ "model-value": ((S = c.newPhotos) == null ? void 0 : S[A]) || void 0,
3426
+ "previous-url": void 0,
3427
+ "onReset:modelValue": (U) => {
3428
+ var V;
3429
+ return (V = c.photos) == null ? void 0 : V.splice(A, 1);
3430
+ }
3431
+ }, null, 8, ["model-value", "onReset:modelValue"]);
3432
+ }), 128)),
3433
+ T(be, {
3434
+ "model-value": void 0,
3435
+ "previous-url": void 0,
3436
+ "onUpdate:modelValue": v[16] || (v[16] = ($) => J($))
3437
+ })
3438
+ ])
3439
+ ])
3440
+ ]),
3441
+ _: 1
3442
+ }, 8, ["title"])
3443
+ ])
3444
+ ], 512)
3445
+ ])
3446
+ ]),
3447
+ _: 1
3448
+ }, 8, ["title", "show", "primary-action", "secondary-actions"])
3449
+ ], 64);
3450
+ };
3451
+ }
3452
+ }), Ri = { class: "fm-typo-en-title-md-600" }, Ii = { class: "pt-8 space-y-24" }, Ai = { class: "flex gap-8 items-center justify-start" }, Oi = /* @__PURE__ */ W({
3453
+ __name: "BusinessForm",
3454
+ props: {
3455
+ businessId: {
3456
+ type: String,
3457
+ required: !0
3458
+ },
3459
+ initialValue: {
3460
+ type: Object,
3461
+ default: void 0
3462
+ }
3463
+ },
3464
+ setup(t, { expose: e }) {
3465
+ const r = t, n = ct(), s = ir(n), o = "https://feedmedev.cc", i = lt(
3466
+ r.initialValue ? ge(r.initialValue) : {
3467
+ thumbnail: void 0,
3468
+ name: "",
3469
+ url: void 0,
3470
+ newThumbnail: void 0
3471
+ }
3472
+ );
3473
+ H(() => i.newThumbnail ? URL.createObjectURL(i.newThumbnail) : i.thumbnail);
3474
+ const f = H(() => fe().currentCountry.value), d = re(!1), u = re(!1), g = (p) => {
3475
+ u.value = !u.value;
3476
+ };
3477
+ function c() {
3478
+ i.thumbnail = void 0, i.newThumbnail = void 0;
3479
+ }
3480
+ const L = async () => {
3481
+ const p = i;
3482
+ await s.minor(async () => {
3483
+ var C, x, I;
3484
+ if (p.newThumbnail) {
3485
+ const F = await de.update(
3486
+ `business/${r.businessId}/thumbnail/${dt().toISOString()}.png`,
3487
+ p.newThumbnail
3488
+ );
3489
+ p.thumbnail = F, (C = r.initialValue) != null && C.thumbnail && await de.delete(r.initialValue.thumbnail);
3490
+ } else
3491
+ (x = r.initialValue) != null && x.thumbnail && !p.thumbnail && await de.delete((I = r.initialValue) == null ? void 0 : I.thumbnail);
3492
+ const P = await Br.updateBusinessProfile(r.businessId, p), N = fe().currentBusiness;
3493
+ N.value = { ...N.value, ...P }, g();
3494
+ });
3495
+ };
3496
+ e({
3497
+ show: u,
3498
+ trigger: g
3499
+ });
3500
+ const { t: y } = pe();
3501
+ return (p, P) => {
3502
+ const N = K("FmTextField"), C = K("fm-button"), x = K("fm-side-sheet");
3503
+ return k(), D(se, null, [
3504
+ ne(p.$slots, "default", { trigger: g }),
3505
+ T(x, {
3506
+ id: "unit-form",
3507
+ modelValue: u.value,
3508
+ "onUpdate:modelValue": P[4] || (P[4] = (I) => u.value = I),
3509
+ "is-container": R(cr).FmForm,
3510
+ "is-container-props": {
3511
+ onValidationSuccess: L,
3512
+ blameFormChildOnValidationFailed: !0
3513
+ },
3514
+ "max-width": 560,
3515
+ "z-index": 100
3516
+ }, {
3517
+ "side-sheet-header": G(() => [
3518
+ E("p", Ri, j(R(y)("settings.business.form.title")), 1)
3519
+ ]),
3520
+ "side-sheet-footer": G(() => [
3521
+ E("div", Ai, [
3522
+ T(C, {
3523
+ label: R(y)("common.update"),
3524
+ loading: d.value,
3525
+ size: "lg",
3526
+ type: "submit",
3527
+ variant: "primary"
3528
+ }, null, 8, ["label", "loading"]),
3529
+ T(C, {
3530
+ label: R(y)("common.cancel"),
3531
+ size: "lg",
3532
+ variant: "tertiary",
3533
+ onClick: P[3] || (P[3] = () => u.value = !1)
3534
+ }, null, 8, ["label"])
3535
+ ])
3536
+ ]),
3537
+ default: G(() => [
3538
+ E("div", Ii, [
3539
+ E("div", null, [
3540
+ T(be, {
3541
+ label: R(y)("settings.business.form.cover_photo.label"),
3542
+ "sub-label": R(y)("settings.business.form.cover_photo.optional"),
3543
+ "previous-url": i.thumbnail,
3544
+ modelValue: i.newThumbnail,
3545
+ "onUpdate:modelValue": P[0] || (P[0] = (I) => i.newThumbnail = I),
3546
+ "onReset:modelValue": c
3547
+ }, null, 8, ["label", "sub-label", "previous-url", "modelValue"])
3548
+ ]),
3549
+ E("div", null, [
3550
+ T(N, {
3551
+ label: R(y)("settings.business.form.name"),
3552
+ modelValue: i.name,
3553
+ "onUpdate:modelValue": P[1] || (P[1] = (I) => i.name = I)
3554
+ }, null, 8, ["label", "modelValue"])
3555
+ ]),
3556
+ E("div", null, [
3557
+ T(N, {
3558
+ label: R(y)("settings.business.form.url.label"),
3559
+ "model-value": i.url || "",
3560
+ "onUpdate:modelValu": P[2] || (P[2] = (I) => i.url = I),
3561
+ placeholder: t.businessId,
3562
+ rules: [
3563
+ (I) => {
3564
+ var F;
3565
+ return !I || ((F = t.initialValue) == null ? void 0 : F.url) == i.url || f.value == R(ut.F_COUNTRY).enum.MY || R(y)("settings.business.form.url.errors.disabled");
3566
+ },
3567
+ (I) => !I || R(hr).test(I) || R(y)("settings.business.form.url.errors.format"),
3568
+ (I) => !I || !R(vr).includes(I) || R(y)("settings.business.form.url.errors.reserved")
3569
+ ]
3570
+ }, {
3571
+ prepend: G(() => [
3572
+ E("span", null, j(R(o) + "/"), 1)
3573
+ ]),
3574
+ _: 1
3575
+ }, 8, ["label", "model-value", "placeholder", "rules"])
3576
+ ])
3577
+ ])
3578
+ ]),
3579
+ _: 1
3580
+ }, 8, ["modelValue", "is-container", "is-container-props"])
3581
+ ], 64);
3582
+ };
3583
+ }
3584
+ });
3585
+ function Pi(t) {
3586
+ return ke(
3587
+ "div",
3588
+ {
3589
+ class: "flex justify-end"
3590
+ },
3591
+ t.map(({ name: e, onClick: r }) => ke(cr.FmButton, {
3592
+ icon: e,
3593
+ outline: !0,
3594
+ variant: "tertiary",
3595
+ iconColor: "neutral-gray-400",
3596
+ onClick: xe(r, ["stop", "prevent"])
3597
+ }))
3598
+ );
3599
+ }
3600
+ const Si = /* @__PURE__ */ W({
3601
+ __name: "BottomSheetMenu",
3602
+ setup(t) {
3603
+ const e = re(!1);
3604
+ async function r() {
3605
+ await sr(), e.value = !e.value;
3606
+ }
3607
+ return (n, s) => {
3608
+ const o = K("FmButton"), i = K("FmBottomSheet");
3609
+ return k(), Q(i, {
3610
+ modelValue: e.value,
3611
+ "onUpdate:modelValue": s[1] || (s[1] = (f) => e.value = f),
3612
+ "dismiss-away": "",
3613
+ "no-header": "",
3614
+ "z-index": 110
3615
+ }, {
3616
+ "bottom-sheet-button": G(() => [
3617
+ n.$slots.button ? le("", !0) : (k(), Q(o, {
3618
+ key: 0,
3619
+ icon: "more_vert",
3620
+ variant: "tertiary",
3621
+ onClick: xe(r, ["stop"])
3622
+ })),
3623
+ ne(n.$slots, "button")
3624
+ ]),
3625
+ default: G(() => [
3626
+ E("div", {
3627
+ onClick: s[0] || (s[0] = (f) => e.value = !1)
3628
+ }, [
3629
+ ne(n.$slots, "default")
3630
+ ])
3631
+ ]),
3632
+ _: 3
3633
+ }, 8, ["modelValue"]);
3634
+ };
3635
+ }
3636
+ }), Ti = { class: "py-8 px-12 hover:bg-fm-color-neutral-gray-100" }, Li = /* @__PURE__ */ W({
3637
+ __name: "BottomSheetMenuItem",
3638
+ props: {
3639
+ label: {},
3640
+ icon: {},
3641
+ disabled: { type: Boolean },
3642
+ itemClass: {}
3643
+ },
3644
+ setup(t) {
3645
+ const e = t;
3646
+ return (r, n) => {
3647
+ const s = K("FmIcon");
3648
+ return k(), D("div", Ti, [
3649
+ r.$slots.content ? le("", !0) : (k(), D("div", {
3650
+ key: 0,
3651
+ class: Y(["flex items-center", {
3652
+ "text-fm-color-typo-disabled": e.disabled,
3653
+ "cursor-pointer": !e.disabled,
3654
+ "cursor-not-allowed": e.disabled,
3655
+ [e.itemClass || ""]: e.itemClass && !e.disabled
3656
+ }])
3657
+ }, [
3658
+ r.icon ? (k(), Q(s, {
3659
+ key: 0,
3660
+ name: r.icon
3661
+ }, null, 8, ["name"])) : le("", !0),
3662
+ Ce(" " + j(r.label), 1)
3663
+ ], 2)),
3664
+ ne(r.$slots, "content")
3665
+ ]);
3666
+ };
3667
+ }
3668
+ }), Ni = { class: "fm-typo-cn-body-md-400 text-fm-color-typo-secondary xs:flex xs:flex-col" }, Ci = { class: "flex flex-1" }, ki = {
3669
+ key: 0,
3670
+ class: "flex gap-8"
3671
+ }, xi = {
3672
+ key: 0,
3673
+ class: "space-y-4"
3674
+ }, Vi = { class: "fm-typo-en-body-md-600" }, Fi = {
3675
+ key: 0,
3676
+ class: "space-y-8"
3677
+ }, ji = { class: "flex justify-end" }, Mi = { class: "flex-1 pb-64 overflow-auto divide-y divide-fm-color-neutral-gray-100" }, Ui = { key: 0 }, Di = ["onClick"], Gi = { class: "flex justify-between items-center" }, Bi = { class: "fm-typo-en-body-lg-600" }, Ki = { class: "flex gap-8" }, qi = { class: "text-fm-color-typo-secondary" }, zi = { class: "text-fm-color-typo-secondary" }, Hi = { class: "text-fm-color-typo-secondary" }, ol = /* @__PURE__ */ W({
3678
+ __name: "Business",
3679
+ setup(t) {
3680
+ const { searchKey: e, filter: r } = bn(), { copyTextToClipboard: n } = dr(), s = ur(), o = H(() => s.breakpoints.value.xs), { t: i } = pe(), f = H(() => {
3681
+ const { currentBusiness: p, restaurants: P } = fe(), N = p.value;
3682
+ if (!N)
3683
+ return null;
3684
+ const { id: C, name: x, thumbnail: I, url: F } = N, J = P.value.filter((M) => M.managable).map((M) => {
3685
+ const { _id: q, profile: a } = M, { name: l, email: b, phoneNo: _, address: v, sstRegNo: m } = {
3686
+ ...a,
3687
+ address: Ee(a.address)
3688
+ };
3689
+ return {
3690
+ id: q,
3691
+ name: l,
3692
+ email: b,
3693
+ phone: _,
3694
+ address: v.formatted,
3695
+ withSST: !!m,
3696
+ doc: M
3697
+ };
3698
+ });
3699
+ return {
3700
+ id: C,
3701
+ name: x,
3702
+ thumbnail: I,
3703
+ url: `https://feedmedev.cc/${F || C}`,
3704
+ doc: N,
3705
+ canCreateRestaurant: vn(N, P.value),
3706
+ restaurants: J.filter(
3707
+ ({ name: M, address: q, phone: a, email: l }) => r([M, q, a, l])
3708
+ )
3709
+ };
3710
+ }), d = H(() => [
3711
+ {
3712
+ header: i("settings.business.restaurant.title"),
3713
+ accessorKey: "name",
3714
+ enableSorting: !1
3715
+ },
3716
+ {
3717
+ header: i("settings.business.restaurant.address"),
3718
+ accessorKey: "address",
3719
+ size: 200,
3720
+ enableSorting: !1
3721
+ },
3722
+ {
3723
+ header: i("settings.business.restaurant.contact"),
3724
+ accessorKey: "phone",
3725
+ enableSorting: !1
3726
+ },
3727
+ {
3728
+ header: i("settings.business.restaurant.email"),
3729
+ accessorKey: "email",
3730
+ enableSorting: !1
3731
+ },
3732
+ {
3733
+ header: i("settings.business.restaurant.tax.title"),
3734
+ enableSorting: !1,
3735
+ cell: (p) => {
3736
+ var N;
3737
+ const P = p.row.original;
3738
+ return (N = P.doc.profile.sstRegNo) != null && N.length ? P.doc.profile.sstRegNo : i("settings.business.restaurant.tax.not_set");
3739
+ }
3740
+ },
3741
+ {
3742
+ id: "action",
3743
+ header: "",
3744
+ size: 80,
3745
+ cell: (p) => {
3746
+ const P = p.row.original;
3747
+ return Pi([
3748
+ {
3749
+ name: "edit",
3750
+ onClick: () => y(P)
3751
+ },
3752
+ {
3753
+ name: "file_copy",
3754
+ onClick: () => {
3755
+ n(P.id);
3756
+ }
3757
+ }
3758
+ ]);
3759
+ }
3760
+ }
3761
+ ]);
3762
+ function u() {
3763
+ var p;
3764
+ n(((p = f.value) == null ? void 0 : p.url) || "");
3765
+ }
3766
+ function g() {
3767
+ if (!f.value)
3768
+ return;
3769
+ const { name: p, url: P, thumbnail: N } = f.value.doc;
3770
+ He(c, Oi, {
3771
+ businessId: f.value.id,
3772
+ initialValue: {
3773
+ name: p,
3774
+ url: P,
3775
+ thumbnail: N
3776
+ }
3777
+ });
3778
+ }
3779
+ const c = Fr();
3780
+ function L() {
3781
+ He(c, rr, {
3782
+ enableFeedmeExpress: !1
3783
+ });
3784
+ }
3785
+ function y(p) {
3786
+ var P;
3787
+ He(c, rr, {
3788
+ restaurantId: p.id,
3789
+ restaurant: p.doc,
3790
+ enableFeedmeExpress: ((P = p.doc.feedmeDelivery) == null ? void 0 : P.enable) || !1
3791
+ });
3792
+ }
3793
+ return (p, P) => {
3794
+ var Z;
3795
+ const N = K("FmSpacer"), C = K("FmButton"), x = K("FmTooltip"), I = K("FmSearch"), F = K("FmTable"), J = K("FmCircularProgress");
3796
+ return k(), Q(Dr, {
3797
+ heading: ((Z = f.value) == null ? void 0 : Z.name) || "--"
3798
+ }, {
3799
+ "sub-heading": G(() => {
3800
+ var M;
3801
+ return [
3802
+ E("div", Ni, [
3803
+ E("span", null, j(R(i)("settings.business.url")) + ": ", 1),
3804
+ E("span", {
3805
+ class: "cursor-pointer xs:w-max-[200px] truncate",
3806
+ onClick: u
3807
+ }, j((M = f.value) == null ? void 0 : M.url), 1)
3808
+ ])
3809
+ ];
3810
+ }),
3811
+ "append-heading": G(() => [
3812
+ E("div", Ci, [
3813
+ T(N),
3814
+ o.value ? (k(), D(se, { key: 1 }, [
3815
+ T(Gr, {
3816
+ onClick: L,
3817
+ label: R(i)("settings.business.add_restaurant"),
3818
+ "prepend-icon": "add"
3819
+ }, null, 8, ["label"]),
3820
+ T(Si, null, {
3821
+ default: G(() => [
3822
+ T(Li, {
3823
+ label: R(i)("common.edit"),
3824
+ onClick: g
3825
+ }, null, 8, ["label"])
3826
+ ]),
3827
+ _: 1
3828
+ })
3829
+ ], 64)) : (k(), D("div", ki, [
3830
+ T(C, {
3831
+ onClick: g,
3832
+ variant: "secondary",
3833
+ label: R(i)("common.edit")
3834
+ }, null, 8, ["label"]),
3835
+ T(x, {
3836
+ variant: "rich",
3837
+ placement: "left",
3838
+ "z-index": 100
3839
+ }, {
3840
+ content: G(() => {
3841
+ var M;
3842
+ return [
3843
+ (M = f.value) != null && M.canCreateRestaurant ? le("", !0) : (k(), D("div", xi, [
3844
+ E("p", Vi, j(R(i)("settings.business.quota.limit_title")), 1),
3845
+ E("p", null, j(R(i)("settings.business.quota.limit_message")), 1)
3846
+ ]))
3847
+ ];
3848
+ }),
3849
+ default: G(() => {
3850
+ var M;
3851
+ return [
3852
+ T(C, {
3853
+ onClick: L,
3854
+ label: R(i)("settings.business.add_restaurant"),
3855
+ disabled: !((M = f.value) != null && M.canCreateRestaurant),
3856
+ "prepend-icon": "add"
3857
+ }, null, 8, ["label", "disabled"])
3858
+ ];
3859
+ }),
3860
+ _: 1
3861
+ })
3862
+ ]))
3863
+ ])
3864
+ ]),
3865
+ default: G(() => {
3866
+ var M, q;
3867
+ return [
3868
+ o.value ? (k(), D(se, { key: 1 }, [
3869
+ T(I, {
3870
+ class: "my-8 mx-16",
3871
+ modelValue: R(e),
3872
+ "onUpdate:modelValue": P[2] || (P[2] = (a) => Et(e) ? e.value = a : null),
3873
+ placeholder: R(i)("settings.business.search_restaurants")
3874
+ }, null, 8, ["modelValue", "placeholder"]),
3875
+ E("div", Mi, [
3876
+ f.value ? (k(!0), D(se, { key: 1 }, me((q = f.value) == null ? void 0 : q.restaurants, (a) => {
3877
+ var l;
3878
+ return k(), D("div", {
3879
+ key: a.id,
3880
+ class: "py-12 px-16 space-y-4",
3881
+ onClick: (b) => y(a)
3882
+ }, [
3883
+ E("div", Gi, [
3884
+ E("div", Bi, j(a.name), 1),
3885
+ E("div", Ki, [
3886
+ T(C, {
3887
+ icon: "edit",
3888
+ "text-color": "neutral-gray-400",
3889
+ variant: "tertiary",
3890
+ onClick: xe((b) => y(a), ["stop"])
3891
+ }, null, 8, ["onClick"]),
3892
+ T(C, {
3893
+ icon: "file_copy",
3894
+ "text-color": "neutral-gray-400",
3895
+ variant: "tertiary",
3896
+ onClick: xe((b) => R(n)(a.id), ["stop"])
3897
+ }, null, 8, ["onClick"])
3898
+ ])
3899
+ ]),
3900
+ E("div", qi, j(R(i)("settings.business.restaurant.contact")) + ": " + j(a.phone), 1),
3901
+ E("div", zi, j(R(i)("settings.business.restaurant.email")) + ": " + j(a.email), 1),
3902
+ E("div", Hi, j(R(i)("settings.business.restaurant.tax.title")) + ": " + j((l = a.doc.profile.sstRegNo) != null && l.length ? a.doc.profile.sstRegNo : R(i)("settings.business.restaurant.tax.not_set")), 1)
3903
+ ], 8, Di);
3904
+ }), 128)) : (k(), D("div", Ui, [
3905
+ T(J, { size: "lg" })
3906
+ ]))
3907
+ ])
3908
+ ], 64)) : (k(), D("div", Fi, [
3909
+ E("div", ji, [
3910
+ T(I, {
3911
+ class: "w-[320px]",
3912
+ modelValue: R(e),
3913
+ "onUpdate:modelValue": P[0] || (P[0] = (a) => Et(e) ? e.value = a : null),
3914
+ placeholder: R(i)("settings.business.search_restaurants")
3915
+ }, null, 8, ["modelValue", "placeholder"])
3916
+ ]),
3917
+ T(F, {
3918
+ "column-defs": d.value,
3919
+ "row-data": ((M = f.value) == null ? void 0 : M.restaurants) || [],
3920
+ "shrink-at": !1,
3921
+ loading: !f.value,
3922
+ onRowClick: P[1] || (P[1] = (a) => y(a.original))
3923
+ }, null, 8, ["column-defs", "row-data", "loading"])
3924
+ ]))
3925
+ ];
3926
+ }),
3927
+ _: 1
3928
+ }, 8, ["heading"]);
3929
+ };
3930
+ }
3931
+ });
3932
+ export {
3933
+ ol as default
3934
+ };