@feedmepos/mf-settings 0.0.38 → 0.0.39-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Business-f7728a38.js → Business-3079ed8d.js} +636 -636
- package/dist/CreateBusiness-878db03c.js +224 -0
- package/dist/{FoodCourt-2c67838f.js → FoodCourt-7cddcacf.js} +2 -2
- package/dist/{ResponsiveFabButton.vue_vue_type_script_setup_true_lang-62e1008f.js → ResponsiveFabButton.vue_vue_type_script_setup_true_lang-8db91a2d.js} +1 -1
- package/dist/{app-9f936b37.js → app-9cfa821a.js} +62 -62
- package/dist/app.js +1 -1
- package/dist/{business-b41c9d64.js → business-2ad18a32.js} +1 -1
- package/dist/{loading-810e6a97.js → loading-8bc1d79a.js} +495 -495
- package/package.json +1 -1
- package/dist/CreateBusiness-c2668ab8.js +0 -223
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { unref as s, defineComponent as A, openBlock as g, createElementBlock as b, ref as f, watch as j, computed as E, resolveComponent as h, createVNode as v, withCtx as G, createElementVNode as t, toDisplayString as y, Fragment as P, renderList as W, normalizeClass as z, createBlock as R, createCommentVNode as Z } from "vue";
|
|
2
|
+
import { useCoreStore as q, useI18n as Q, CountryOptions as Y } from "@feedmepos/mf-common";
|
|
3
|
+
import { _ as J, b as w, r as K } from "./business-2ad18a32.js";
|
|
4
|
+
import { u as X, F as ee } from "./loading-8bc1d79a.js";
|
|
5
|
+
import { useSnackbar as te } from "@feedmepos/ui-library";
|
|
6
|
+
import { useRouter as se } from "vue-router";
|
|
7
|
+
import "pinia";
|
|
8
|
+
function U(r) {
|
|
9
|
+
return typeof r == "function" ? r() : s(r);
|
|
10
|
+
}
|
|
11
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
12
|
+
const S = () => {
|
|
13
|
+
};
|
|
14
|
+
function ne(r, n) {
|
|
15
|
+
function o(...e) {
|
|
16
|
+
return new Promise((c, u) => {
|
|
17
|
+
Promise.resolve(r(() => n.apply(this, e), { fn: n, thisArg: this, args: e })).then(c).catch(u);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return o;
|
|
21
|
+
}
|
|
22
|
+
function oe(r, n = {}) {
|
|
23
|
+
let o, e, c = S;
|
|
24
|
+
const u = (_) => {
|
|
25
|
+
clearTimeout(_), c(), c = S;
|
|
26
|
+
};
|
|
27
|
+
return (_) => {
|
|
28
|
+
const l = U(r), i = U(n.maxWait);
|
|
29
|
+
return o && u(o), l <= 0 || i !== void 0 && i <= 0 ? (e && (u(e), e = null), Promise.resolve(_())) : new Promise((m, C) => {
|
|
30
|
+
c = n.rejectOnCancel ? C : m, i && !e && (e = setTimeout(() => {
|
|
31
|
+
o && u(o), e = null, m(_());
|
|
32
|
+
}, i)), o = setTimeout(() => {
|
|
33
|
+
e && u(e), e = null, m(_());
|
|
34
|
+
}, l);
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function le(r, n = 200, o = {}) {
|
|
39
|
+
return ne(
|
|
40
|
+
oe(n, o),
|
|
41
|
+
r
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
const ie = `<svg width="388" height="388" viewBox="0 0 388 388" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
45
|
+
<path d="M239.449 0H148.553C66.5106 0 0.00195312 66.5086 0.00195312 148.551V239.447C0.00195312 321.489 66.5106 387.998 148.553 387.998H239.449C321.491 387.998 388 321.489 388 239.447V148.551C388 66.5086 321.491 0 239.449 0Z" fill="url(#paint0_linear_8849_557)" style=""/>
|
|
46
|
+
<mask id="mask0_8849_557" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="388" height="388">
|
|
47
|
+
<path d="M239.447 0H148.551C66.5086 0 0 66.5086 0 148.551V239.447C0 321.489 66.5086 387.998 148.551 387.998H239.447C321.49 387.998 387.998 321.489 387.998 239.447V148.551C387.998 66.5086 321.49 0 239.447 0Z" fill="white" style="fill:white;fill:white;fill-opacity:1;"/>
|
|
48
|
+
</mask>
|
|
49
|
+
<g mask="url(#mask0_8849_557)">
|
|
50
|
+
<path d="M82.587 258.589V258.76C83.2747 264.893 84.1917 271.598 85.3953 278.648L101.271 392.296H127.462V253.946C127.462 241.395 137.033 231.194 148.839 231.194H150.329C162.135 231.194 171.706 241.395 171.706 253.946V392.296H216.352V253.946C216.352 241.395 225.923 231.194 237.729 231.194H239.219C251.025 231.194 260.596 241.395 260.596 253.946V392.296H286.959L302.835 277.788C303.981 271.025 304.841 264.549 305.471 258.589V258.187C307.649 238.759 307.649 225.061 307.649 225.061C307.649 182.938 290.054 148.264 252.286 119.78C241.97 112.043 233.029 100.466 232.17 75.7079C232.17 75.7079 229.705 12.9519 253.719 -33.7568H134.339C158.353 12.9519 155.888 75.7079 155.888 75.7079C155.029 100.409 146.088 111.986 135.772 119.78C97.9465 148.321 80.4092 182.938 80.4092 225.061C80.4092 225.061 80.4092 238.873 82.587 258.474V258.589Z" fill="white" style="fill:white;fill:white;fill-opacity:1;"/>
|
|
51
|
+
</g>
|
|
52
|
+
<defs>
|
|
53
|
+
<linearGradient id="paint0_linear_8849_557" x1="43.5013" y1="344.556" x2="344.501" y2="43.5567" gradientUnits="userSpaceOnUse">
|
|
54
|
+
<stop stop-color="#FF5D53" style="stop-color:#FF5D53;stop-color:color(display-p3 1.0000 0.3647 0.3255);stop-opacity:1;"/>
|
|
55
|
+
<stop offset="1" stop-color="#FCA23E" style="stop-color:#FCA23E;stop-color:color(display-p3 0.9882 0.6353 0.2431);stop-opacity:1;"/>
|
|
56
|
+
</linearGradient>
|
|
57
|
+
</defs>
|
|
58
|
+
</svg>
|
|
59
|
+
`, ae = ["innerHTML"], re = /* @__PURE__ */ A({
|
|
60
|
+
__name: "FeedmeLogo",
|
|
61
|
+
setup(r) {
|
|
62
|
+
return (n, o) => (g(), b("div", {
|
|
63
|
+
class: "logo",
|
|
64
|
+
style: { width: "54px", height: "54px" },
|
|
65
|
+
innerHTML: s(ie)
|
|
66
|
+
}, null, 8, ae));
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const ce = /* @__PURE__ */ J(re, [["__scopeId", "data-v-c0191534"]]), ue = { class: "flex flex-col justify-center items-center fixed top-[56px] left-0 w-screen h-[calc(100vh-56px)] bg-fm-color-neutral-white" }, de = { class: "space-y-32" }, me = { class: "space-y-8" }, pe = { class: "fm-typo-en-title-lg-600" }, _e = { class: "space-y-8" }, fe = { class: "fm-typo-en-title-sm-600" }, ve = { class: "flex gap-16" }, ge = ["onClick"], he = { class: "space-y-8" }, ye = { class: "m-8 w-[33px]" }, be = ["innerHTML"], Ce = { class: "fm-typo-en-body-sm-600" }, we = { class: "space-y-16" }, Ue = /* @__PURE__ */ A({
|
|
70
|
+
__name: "CreateBusiness",
|
|
71
|
+
setup(r) {
|
|
72
|
+
var V;
|
|
73
|
+
se();
|
|
74
|
+
const n = q(), o = f(""), e = f(""), c = f(""), u = f(!0), x = te(), _ = X(x), { t: l } = Q(), i = f(((V = n.currentCountry.value) == null ? void 0 : V.toUpperCase()) || "MY"), m = f([]);
|
|
75
|
+
j(
|
|
76
|
+
i,
|
|
77
|
+
(p) => {
|
|
78
|
+
w.readBusinesses(i.value).then((d) => {
|
|
79
|
+
m.value = d;
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
{ immediate: !0 }
|
|
83
|
+
);
|
|
84
|
+
async function C() {
|
|
85
|
+
try {
|
|
86
|
+
const p = await w.readAgentByCode(e.value);
|
|
87
|
+
c.value = p ? p.id : "";
|
|
88
|
+
} catch {
|
|
89
|
+
c.value = "";
|
|
90
|
+
}
|
|
91
|
+
u.value = !!c.value;
|
|
92
|
+
}
|
|
93
|
+
const M = le(C, 500), D = E(() => !!(F.value || m.value.length > 0 || e.value && !c.value)), F = f(!1);
|
|
94
|
+
async function I() {
|
|
95
|
+
_.minor(
|
|
96
|
+
async () => {
|
|
97
|
+
var d;
|
|
98
|
+
const p = await w.createBusiness(
|
|
99
|
+
{
|
|
100
|
+
name: o.value,
|
|
101
|
+
restaurantQuota: 1,
|
|
102
|
+
warehouseQuota: 0,
|
|
103
|
+
internal: !1,
|
|
104
|
+
ownerId: (d = n.sessionUser.value) == null ? void 0 : d.id,
|
|
105
|
+
agentId: c.value || void 0
|
|
106
|
+
},
|
|
107
|
+
i.value
|
|
108
|
+
);
|
|
109
|
+
p._id && (n.setCachedBusiness(p._id), n.setCachedCountry(i.value)), setTimeout(() => {
|
|
110
|
+
window.location.href = "/";
|
|
111
|
+
}, 500);
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
isLoading: F
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
async function N() {
|
|
119
|
+
await n.signOut(), setTimeout(() => {
|
|
120
|
+
window.location.href = `${ee.baseUrl}/login?fm_redirect=${encodeURIComponent(window.location.protocol + "//" + window.location.host)}`;
|
|
121
|
+
}, 500);
|
|
122
|
+
}
|
|
123
|
+
return (p, d) => {
|
|
124
|
+
const k = h("FmTextField"), O = h("FmSnackbar"), B = h("FmButton"), $ = h("FmForm");
|
|
125
|
+
return g(), b("div", ue, [
|
|
126
|
+
v($, {
|
|
127
|
+
class: "w-[540px] xs:w-full xs:px-16 space-y-24",
|
|
128
|
+
"blame-form-child-on-validation-failed": "",
|
|
129
|
+
"on-validation-success": I
|
|
130
|
+
}, {
|
|
131
|
+
default: G(() => {
|
|
132
|
+
var H, T, L;
|
|
133
|
+
return [
|
|
134
|
+
t("div", null, [
|
|
135
|
+
v(ce)
|
|
136
|
+
]),
|
|
137
|
+
t("div", de, [
|
|
138
|
+
t("div", me, [
|
|
139
|
+
t("div", pe, y(s(l)("settings.create_business.welcome", {
|
|
140
|
+
name: (T = (H = s(n).sessionUser) == null ? void 0 : H.value) == null ? void 0 : T.displayName
|
|
141
|
+
})), 1),
|
|
142
|
+
t("div", null, y(s(l)("settings.create_business.subtitle")), 1)
|
|
143
|
+
]),
|
|
144
|
+
t("div", null, [
|
|
145
|
+
v(k, {
|
|
146
|
+
label: s(l)("settings.create_business.business_name.label"),
|
|
147
|
+
"label-mark": "required",
|
|
148
|
+
rules: [s(K)],
|
|
149
|
+
modelValue: o.value,
|
|
150
|
+
"onUpdate:modelValue": d[0] || (d[0] = (a) => o.value = a)
|
|
151
|
+
}, null, 8, ["label", "rules", "modelValue"])
|
|
152
|
+
]),
|
|
153
|
+
t("div", null, [
|
|
154
|
+
v(k, {
|
|
155
|
+
label: s(l)("settings.create_business.agent.label"),
|
|
156
|
+
modelValue: e.value,
|
|
157
|
+
"onUpdate:modelValue": [
|
|
158
|
+
d[1] || (d[1] = (a) => e.value = a),
|
|
159
|
+
s(M)
|
|
160
|
+
],
|
|
161
|
+
rules: [(a) => !a || u.value || s(l)("settings.create_business.agent.invalid")]
|
|
162
|
+
}, null, 8, ["label", "modelValue", "onUpdate:modelValue", "rules"])
|
|
163
|
+
]),
|
|
164
|
+
t("div", _e, [
|
|
165
|
+
t("div", fe, y(s(l)("settings.create_business.country.title")), 1),
|
|
166
|
+
t("div", ve, [
|
|
167
|
+
(g(!0), b(P, null, W(s(Y), (a) => (g(), b("div", {
|
|
168
|
+
key: a.code,
|
|
169
|
+
class: z(["flex-1 h-[124px] flex justify-center items-center border-2 fm-corner-radius-md cursor-pointer", [
|
|
170
|
+
i.value === a.code ? "border-fm-color-primary" : "border-fm-color-neutral-gray-200",
|
|
171
|
+
i.value === a.code ? "bg-fm-color-system-warning-100" : "bg-fm-color-neutral-white"
|
|
172
|
+
]]),
|
|
173
|
+
onClick: (xe) => i.value = a.code.toUpperCase()
|
|
174
|
+
}, [
|
|
175
|
+
t("div", he, [
|
|
176
|
+
t("div", ye, [
|
|
177
|
+
t("span", {
|
|
178
|
+
innerHTML: a.flag
|
|
179
|
+
}, null, 8, be)
|
|
180
|
+
]),
|
|
181
|
+
t("div", Ce, y(a.name), 1)
|
|
182
|
+
])
|
|
183
|
+
], 10, ge))), 128))
|
|
184
|
+
])
|
|
185
|
+
]),
|
|
186
|
+
m.value.length > 0 ? (g(), R(O, {
|
|
187
|
+
key: 0,
|
|
188
|
+
variant: "info",
|
|
189
|
+
title: s(l)("settings.create_business.country.exists.title"),
|
|
190
|
+
description: s(l)("settings.create_business.country.exists.message", { name: (L = m.value[0]) == null ? void 0 : L.name })
|
|
191
|
+
}, null, 8, ["title", "description"])) : Z("", !0),
|
|
192
|
+
t("div", we, [
|
|
193
|
+
t("div", null, [
|
|
194
|
+
v(B, {
|
|
195
|
+
label: s(l)("settings.create_business.submit"),
|
|
196
|
+
variant: "primary",
|
|
197
|
+
size: "lg",
|
|
198
|
+
class: "w-full",
|
|
199
|
+
disabled: D.value,
|
|
200
|
+
type: "submit"
|
|
201
|
+
}, null, 8, ["label", "disabled"])
|
|
202
|
+
]),
|
|
203
|
+
t("div", null, [
|
|
204
|
+
v(B, {
|
|
205
|
+
label: s(l)("settings.create_business.logout"),
|
|
206
|
+
variant: "secondary",
|
|
207
|
+
size: "lg",
|
|
208
|
+
class: "w-full",
|
|
209
|
+
onClick: N
|
|
210
|
+
}, null, 8, ["label"])
|
|
211
|
+
])
|
|
212
|
+
])
|
|
213
|
+
])
|
|
214
|
+
];
|
|
215
|
+
}),
|
|
216
|
+
_: 1
|
|
217
|
+
})
|
|
218
|
+
]);
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
export {
|
|
223
|
+
Ue as default
|
|
224
|
+
};
|
|
@@ -2,8 +2,8 @@ var g1 = Object.defineProperty;
|
|
|
2
2
|
var p1 = (s, c, d) => c in s ? g1(s, c, { enumerable: !0, configurable: !0, writable: !0, value: d }) : s[c] = d;
|
|
3
3
|
var ll = (s, c, d) => (p1(s, typeof c != "symbol" ? c + "" : c, d), d);
|
|
4
4
|
import { defineComponent as zc, ref as en, resolveComponent as Kt, openBlock as xt, createElementBlock as Pr, Fragment as Ji, renderSlot as hb, createVNode as Dt, unref as Yt, withCtx as Tn, createElementVNode as xe, computed as fr, watch as $b, withKeys as b1, toDisplayString as jn, renderList as dc, createBlock as Vi, createCommentVNode as cc, h as Td, getCurrentInstance as y1, withModifiers as _1 } from "vue";
|
|
5
|
-
import { l as D, c as Q, f as ge, h as Bl, i as mb, d as Tr, r as ja, b as t$, u as hm } from "./loading-
|
|
6
|
-
import { e as v1, _ as x$, c as gb, u as z1, a as E1, b as F1, d as Kg } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-
|
|
5
|
+
import { l as D, c as Q, f as ge, h as Bl, i as mb, d as Tr, r as ja, b as t$, u as hm } from "./loading-8bc1d79a.js";
|
|
6
|
+
import { e as v1, _ as x$, c as gb, u as z1, a as E1, b as F1, d as Kg } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-8db91a2d.js";
|
|
7
7
|
import { useSnackbar as Ec, components as Tl, useDialogChild as w1, useDialog as pb, useBreakpoints as S1 } from "@feedmepos/ui-library";
|
|
8
8
|
import { useCoreStore as Fc, useI18n as $m } from "@feedmepos/mf-common";
|
|
9
9
|
import "pinia";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as q, openBlock as H, createElementBlock as G, createElementVNode as U, renderSlot as V, toDisplayString as le, normalizeClass as ae, toRaw as de, mergeModels as fe, useModel as he, computed as A, watchEffect as me, resolveComponent as z, createBlock as Z, withCtx as te, createVNode as Q, Fragment as pe, renderList as $e, markRaw as ve, render as ye, normalizeProps as ge, mergeProps as ne } from "vue";
|
|
2
|
-
import { c as be, g as Me } from "./loading-
|
|
2
|
+
import { c as be, g as Me } from "./loading-8bc1d79a.js";
|
|
3
3
|
import { useCoreStore as _e } from "@feedmepos/mf-common";
|
|
4
4
|
import { useSnackbar as we, useBreakpoints as Se } from "@feedmepos/ui-library";
|
|
5
5
|
const De = {
|