@feedmepos/mf-connect 0.0.16-beta.1 → 0.0.16-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Analytic-C-zZmF5N.js → Analytic-Gq7PoNer.js} +368 -365
- package/dist/App-Cikl5jnp.js +177 -0
- package/dist/Broadcast-DU3JnBwZ.js +223 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-VWLBlxy1.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D0I8IZIR.js} +20 -20
- package/dist/Card-hIeQ5XUH.js +825 -0
- package/dist/Collections-B1SC1rr7.js +453 -0
- package/dist/Credit-BgwI8DR3.js +216 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bz6TSmbW.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D9VR3P2d.js} +1026 -1022
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-AhWnHG02.js → EffectSheet.vue_vue_type_style_index_0_lang-DPgu45MD.js} +29 -29
- package/dist/Experience-C2Q-zqV6.js +221 -0
- package/dist/Game-DU2pZDGk.js +255 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
- package/dist/JsonViewer-v8_C7l5N.js +87 -0
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DykNOOFD.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js} +1 -1
- package/dist/{MainLayout-D0AoA1tk.js → MainLayout-B1aJoR95.js} +2 -2
- package/dist/Marketing-DWiTQp9I.js +316 -0
- package/dist/Member-BEXKBFry.js +69 -0
- package/dist/MemberList-DzMdajIf.js +1733 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/{MemberTransactions-CTAx5jIV.js → MemberTransactions-Bciankuu.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-C-BtHxSc.js → MessageInput.vue_vue_type_script_setup_true_lang-DH25Hfk3.js} +46 -46
- package/dist/Mission-KzwRlaA5.js +259 -0
- package/dist/Point-CSKvZXHc.js +222 -0
- package/dist/Promotion-IiwPhx8p.js +221 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CrpJySSp.js → RuleGroup.vue_vue_type_script_setup_true_lang-4zIO3oCr.js} +545 -544
- package/dist/Segment-2Q0PonBb.js +447 -0
- package/dist/{Setting-Zrj5P_4m.js → Setting-Df5vVRt4.js} +600 -598
- package/dist/Store-C0WXCKs6.js +1503 -0
- package/dist/StoreRewards-eSSIO0nk.js +401 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DS4APaHw.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BjnCRKGX.js} +106 -108
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-ZYjWlDJ1.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-b0xTcoEp.js} +1 -1
- package/dist/{Tier-DVWJyQ9S.js → Tier-v-1FkRU-.js} +464 -449
- package/dist/{Title-B5kX64vs.js → Title-CQ2JWqBW.js} +315 -299
- package/dist/Transaction-0OouN_6s.js +39 -0
- package/dist/Voucher-CL0cgogx.js +488 -0
- package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-Bd19eW7X.js +5381 -0
- package/dist/app-CfS25Z66.js +34797 -0
- package/dist/app-wDQR6dpb.js +39 -0
- package/dist/app.js +5 -3
- package/dist/business-dQh3AEot.js +78 -0
- package/dist/{campaign-BZJuknWK.js → campaign-BOl8AgKA.js} +12 -12
- package/dist/{collection.fn-DoCkZ6z4.js → collection.fn-B_YsXmrP.js} +2 -2
- package/dist/dto-B8NfyVPG.js +1169 -0
- package/dist/{effect-B8kmnKvY.js → effect-C2jCStXO.js} +1 -1
- package/dist/{export-Dm6LYnWo.js → export-BtZc3Yzh.js} +3 -3
- package/dist/{helper-DR4XK3nv.js → helper-8oGsrM56.js} +1 -1
- package/dist/{index-DcUrk07Q.js → index-6FkKY3q0.js} +3 -3
- package/dist/{index-Bu4_26qI.js → index-C7oeXRUl.js} +1 -1
- package/dist/{index-CuL5-ORK.js → index-CZKYIefW.js} +6 -7
- package/dist/{index-yxJMhfxj.js → index-C_0IFnwi.js} +5 -5
- package/dist/{index-BryrRq8O.js → index-DCixRRvz.js} +36 -30
- package/dist/{index-CkiYkbXb.js → index-DFgt4-VW.js} +1 -1
- package/dist/{index-CWf0mh3a.js → index-DYDhH9bi.js} +177 -168
- package/dist/{index-boor8e80.js → index-Di-kWSmf.js} +3 -3
- package/dist/{app-DkI7dYRN.js → index-Dn0jdj0o.js} +9665 -13024
- package/dist/index-DwKqFNF6.js +3 -0
- package/dist/{index-BobRgQrE.js → index-HoacsZDk.js} +2 -2
- package/dist/{index-BxkxVtgm.js → index-UTQHDUdW.js} +1 -1
- package/dist/{loading-BzV5acUX.js → loading-D_AN6p24.js} +6807 -6805
- package/dist/{lodash-mg4435Qq.js → lodash-B5I3zXaY.js} +1 -1
- package/dist/{membership-CqbsLHqx.js → membership-Ccrx9R6r.js} +3 -3
- package/dist/{money-DA_gtp3q.js → money-waD-f-Zz.js} +1 -1
- package/dist/{number-C388eyOu.js → number-CwTGGsh9.js} +1 -1
- package/dist/{rule-Clmr5y4j.js → rule-DJ07h3Gh.js} +2 -2
- package/dist/{rule-builder-BgqNbM-P.js → rule-builder-DJ-acvVD.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/template-clxvNnbF.js +190 -0
- package/dist/{usePagination-o5fgsZwU.js → usePagination-BeF5K3M7.js} +86 -86
- package/dist/vue-i18n-BxwiXSkp.js +2365 -0
- package/dist/{xlsx-BRdh9e2p.js → xlsx-BB366cdN.js} +1945 -1945
- package/package.json +9 -5
- package/dist/Broadcast-X69Mtv3b.js +0 -216
- package/dist/Card-D0X3v1UF.js +0 -822
- package/dist/Collections-umR6Ehqf.js +0 -452
- package/dist/Credit-C1EWF7R0.js +0 -214
- package/dist/Experience-CqL8wyPm.js +0 -211
- package/dist/Game--kYe64EV.js +0 -250
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BjOJ3XSL.js +0 -144
- package/dist/Marketing-CTCQ5ZmZ.js +0 -308
- package/dist/Member-DCduX7zP.js +0 -91
- package/dist/MemberList-B0EkXZJu.js +0 -1729
- package/dist/MemberOverview-C2n9oJZh.js +0 -58
- package/dist/Mission-CVr9rS_D.js +0 -248
- package/dist/Point-BnZ6M74y.js +0 -220
- package/dist/Promotion-B0PUve5S.js +0 -218
- package/dist/Segment-B-XpkyM5.js +0 -445
- package/dist/Store-B2gywCt2.js +0 -1503
- package/dist/StoreRewards-D8410Q_-.js +0 -434
- package/dist/Transaction-CZBO4v4d.js +0 -36
- package/dist/Voucher-se-4JF9B.js +0 -481
- package/dist/app-B2ImSO3V.js +0 -53382
- package/dist/dto-BWpvRpK2.js +0 -1151
- package/dist/template-Dwp7heBA.js +0 -190
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { c as pe, C as
|
|
3
|
-
import { R as
|
|
4
|
-
import { a as ge, R, S as ke, C as H, W as Ve, T as ne, O as Ee } from "./rule-
|
|
5
|
-
import { p as Fe } from "./loading-
|
|
1
|
+
import { defineComponent as N, computed as M, resolveComponent as g, openBlock as n, createElementBlock as F, createElementVNode as U, createVNode as v, unref as e, createTextVNode as ee, toDisplayString as j, withCtx as B, onMounted as K, createBlock as T, createCommentVNode as _, ref as P, Fragment as Y, renderList as A, normalizeClass as L, watch as ie, resolveDynamicComponent as ae, onBeforeMount as ue, isRef as me, createSlots as de } from "vue";
|
|
2
|
+
import { c as pe, C as ye, d as ce, e as ve, f as fe } from "./index-DYDhH9bi.js";
|
|
3
|
+
import { R as D, a as be } from "./rule-builder-DJ-acvVD.js";
|
|
4
|
+
import { a as ge, R as O, S as ke, C as H, W as Ve, T as ne, O as Ee } from "./rule-DJ07h3Gh.js";
|
|
5
|
+
import { p as Fe } from "./loading-D_AN6p24.js";
|
|
6
6
|
import { useDialog as te, useDialogChild as se } from "@feedmepos/ui-library";
|
|
7
7
|
import { h as J } from "./moment-BWErdI6_.js";
|
|
8
|
-
import { z as Se
|
|
9
|
-
import { u as z } from "./membership-
|
|
10
|
-
import {
|
|
8
|
+
import { z as Se } from "./app-Bd19eW7X.js";
|
|
9
|
+
import { u as z } from "./membership-Ccrx9R6r.js";
|
|
10
|
+
import { u as re } from "./business-dQh3AEot.js";
|
|
11
|
+
import { _ as I } from "./index-C_0IFnwi.js";
|
|
11
12
|
import { c as le } from "./object-qECH92oz.js";
|
|
12
13
|
import { Z } from "./zod-W_PvIofQ.js";
|
|
13
|
-
import {
|
|
14
|
-
import "./index-
|
|
15
|
-
import "./index-
|
|
16
|
-
import "./index-
|
|
17
|
-
import "./index-
|
|
18
|
-
import "./index-
|
|
19
|
-
const
|
|
14
|
+
import { N as Te } from "./app-CfS25Z66.js";
|
|
15
|
+
import "./index-CZKYIefW.js";
|
|
16
|
+
import "./index-DCixRRvz.js";
|
|
17
|
+
import "./index-Di-kWSmf.js";
|
|
18
|
+
import "./index-HoacsZDk.js";
|
|
19
|
+
import "./index-DFgt4-VW.js";
|
|
20
|
+
const xe = { class: "flex items-center justify-between" }, Ce = { class: "flex items-center gap-8 xs:flex-wrap" }, Ue = { class: "text-fm-color-primary line-clamp-1 text-ellipsis" }, Re = /* @__PURE__ */ N({
|
|
20
21
|
__name: "RuleEntry",
|
|
21
22
|
props: {
|
|
22
23
|
modelValue: {
|
|
@@ -25,53 +26,53 @@ const he = { class: "flex items-center justify-between" }, Te = { class: "flex i
|
|
|
25
26
|
}
|
|
26
27
|
},
|
|
27
28
|
emits: ["edit", "remove"],
|
|
28
|
-
setup(a, { emit:
|
|
29
|
-
const
|
|
30
|
-
const [
|
|
29
|
+
setup(a, { emit: R }) {
|
|
30
|
+
const f = a, i = M(() => {
|
|
31
|
+
const [s, u] = Object.entries(f.modelValue.conditions)[0];
|
|
31
32
|
return {
|
|
32
|
-
negated:
|
|
33
|
-
property:
|
|
34
|
-
operator:
|
|
33
|
+
negated: f.modelValue.negated == !0,
|
|
34
|
+
property: f.modelValue.property,
|
|
35
|
+
operator: s,
|
|
35
36
|
equator: u
|
|
36
37
|
};
|
|
37
|
-
}), l =
|
|
38
|
+
}), l = R, b = M(
|
|
38
39
|
() => ge(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
i.value.property,
|
|
41
|
+
i.value.operator,
|
|
42
|
+
i.value.equator,
|
|
43
|
+
i.value.negated
|
|
43
44
|
)
|
|
44
45
|
);
|
|
45
|
-
async function t(
|
|
46
|
-
|
|
46
|
+
async function t(s) {
|
|
47
|
+
s.stopPropagation(), await Fe.remove("Are you sure you want to remove this rule?") && l("remove", f.modelValue);
|
|
47
48
|
}
|
|
48
|
-
return (
|
|
49
|
+
return (s, u) => {
|
|
49
50
|
var V;
|
|
50
|
-
const
|
|
51
|
-
return n(), F("div",
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
label: (V = e(pe).find((S) => S.property ===
|
|
51
|
+
const p = g("FmChip"), y = g("FmTooltip"), k = g("FmIcon");
|
|
52
|
+
return n(), F("div", xe, [
|
|
53
|
+
U("div", Ce, [
|
|
54
|
+
v(p, {
|
|
55
|
+
label: (V = e(pe).find((S) => S.property === f.modelValue.property)) == null ? void 0 : V.name,
|
|
55
56
|
class: "!text-fm-color-typo-info !bg-fm-color-system-info-100"
|
|
56
57
|
}, null, 8, ["label"]),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
onClick: u[0] || (u[0] = (S) => l("edit",
|
|
58
|
+
u[1] || (u[1] = U("div", { class: "h-[26px] border-l-2 rounded-md border-fm-color-neutral-gray-100" }, null, -1)),
|
|
59
|
+
U("div", {
|
|
60
|
+
onClick: u[0] || (u[0] = (S) => l("edit", f.modelValue)),
|
|
60
61
|
class: "inline-flex rounded-md items-center gap-4 justify-center h-[30px] px-8 py-4 text-fm-color-typo-primary !bg-transparent border-dashed border-2 fm-typo-en-body-md-600 cursor-pointer"
|
|
61
62
|
}, [
|
|
62
|
-
ee(j(e(
|
|
63
|
-
y
|
|
63
|
+
ee(j(e(b)[0]) + " ", 1),
|
|
64
|
+
v(y, {
|
|
64
65
|
"z-index": 1e3,
|
|
65
|
-
content: e(
|
|
66
|
+
content: e(b)[1]
|
|
66
67
|
}, {
|
|
67
|
-
default:
|
|
68
|
-
|
|
68
|
+
default: B(() => [
|
|
69
|
+
U("div", Ue, j(e(b)[1]), 1)
|
|
69
70
|
]),
|
|
70
71
|
_: 1
|
|
71
72
|
}, 8, ["content"])
|
|
72
73
|
])
|
|
73
74
|
]),
|
|
74
|
-
|
|
75
|
+
v(k, {
|
|
75
76
|
name: "close",
|
|
76
77
|
size: "md",
|
|
77
78
|
class: "cursor-pointer hover:bg-neutral-300 rounded-lg",
|
|
@@ -276,7 +277,7 @@ const Oe = [
|
|
|
276
277
|
}
|
|
277
278
|
]
|
|
278
279
|
}
|
|
279
|
-
], we = { class: "flex flex-nowrap gap-x-4 items-center" },
|
|
280
|
+
], we = { class: "flex flex-nowrap gap-x-4 items-center" }, he = /* @__PURE__ */ N({
|
|
280
281
|
__name: "IsDayInput",
|
|
281
282
|
props: {
|
|
282
283
|
modelValue: {
|
|
@@ -284,31 +285,31 @@ const Oe = [
|
|
|
284
285
|
}
|
|
285
286
|
},
|
|
286
287
|
emits: ["update:model-value"],
|
|
287
|
-
setup(a, { emit:
|
|
288
|
-
const
|
|
288
|
+
setup(a, { emit: R }) {
|
|
289
|
+
const f = a, i = R;
|
|
289
290
|
K(() => {
|
|
290
|
-
|
|
291
|
+
f.modelValue || i("update:model-value", {
|
|
291
292
|
op: "before",
|
|
292
293
|
x: 1
|
|
293
294
|
});
|
|
294
295
|
});
|
|
295
|
-
function l(
|
|
296
|
+
function l(b) {
|
|
296
297
|
const t = le(
|
|
297
|
-
|
|
298
|
+
f.modelValue ?? {
|
|
298
299
|
op: "before",
|
|
299
300
|
x: 1
|
|
300
301
|
}
|
|
301
302
|
);
|
|
302
|
-
|
|
303
|
+
i("update:model-value", {
|
|
303
304
|
...t,
|
|
304
|
-
...
|
|
305
|
+
...b
|
|
305
306
|
});
|
|
306
307
|
}
|
|
307
|
-
return (
|
|
308
|
-
var u,
|
|
309
|
-
const
|
|
308
|
+
return (b, t) => {
|
|
309
|
+
var u, p, y;
|
|
310
|
+
const s = g("FmStepperField");
|
|
310
311
|
return n(), F("div", we, [
|
|
311
|
-
|
|
312
|
+
v(s, {
|
|
312
313
|
class: "w-1/3",
|
|
313
314
|
"model-value": ((u = a.modelValue) == null ? void 0 : u.x) ?? null,
|
|
314
315
|
max: 365,
|
|
@@ -316,16 +317,16 @@ const Oe = [
|
|
|
316
317
|
"append-text": "days",
|
|
317
318
|
"onUpdate:modelValue": t[0] || (t[0] = (k) => l({ x: k }))
|
|
318
319
|
}, null, 8, ["model-value"]),
|
|
319
|
-
|
|
320
|
-
"model-value": ((
|
|
320
|
+
v(I, {
|
|
321
|
+
"model-value": ((p = a.modelValue) == null ? void 0 : p.op) ?? void 0,
|
|
321
322
|
items: [
|
|
322
323
|
{ label: "before", value: "before" },
|
|
323
324
|
{ label: "after", value: "after" }
|
|
324
325
|
],
|
|
325
326
|
"onUpdate:modelValue": t[1] || (t[1] = (k) => l({ op: k }))
|
|
326
327
|
}, null, 8, ["model-value"]),
|
|
327
|
-
|
|
328
|
-
"model-value": ((
|
|
328
|
+
v(I, {
|
|
329
|
+
"model-value": ((y = a.modelValue) == null ? void 0 : y.ignoreYear) ?? !1,
|
|
329
330
|
items: [
|
|
330
331
|
{ label: "same year", value: !1 },
|
|
331
332
|
{ label: "ignore year", value: !0 }
|
|
@@ -336,7 +337,7 @@ const Oe = [
|
|
|
336
337
|
]);
|
|
337
338
|
};
|
|
338
339
|
}
|
|
339
|
-
}),
|
|
340
|
+
}), Ye = { class: "grid grid-cols-4 gap-x-4 items-center" }, De = /* @__PURE__ */ N({
|
|
340
341
|
__name: "IsRangeInput",
|
|
341
342
|
props: {
|
|
342
343
|
modelValue: {
|
|
@@ -349,10 +350,10 @@ const Oe = [
|
|
|
349
350
|
}
|
|
350
351
|
},
|
|
351
352
|
emits: ["update:model-value"],
|
|
352
|
-
setup(a, { emit:
|
|
353
|
-
const
|
|
353
|
+
setup(a, { emit: R }) {
|
|
354
|
+
const f = a, i = R;
|
|
354
355
|
K(() => {
|
|
355
|
-
|
|
356
|
+
f.modelValue || i("update:model-value", {
|
|
356
357
|
op: "this",
|
|
357
358
|
unit: "day",
|
|
358
359
|
ignoreYear: !0
|
|
@@ -364,7 +365,7 @@ const Oe = [
|
|
|
364
365
|
{ label: "month", value: "month" },
|
|
365
366
|
{ label: "quarter", value: "quarter" },
|
|
366
367
|
{ label: "year", value: "year" }
|
|
367
|
-
],
|
|
368
|
+
], b = [
|
|
368
369
|
{
|
|
369
370
|
label: "this",
|
|
370
371
|
value: "this"
|
|
@@ -378,37 +379,37 @@ const Oe = [
|
|
|
378
379
|
value: "next"
|
|
379
380
|
}
|
|
380
381
|
];
|
|
381
|
-
return (t,
|
|
382
|
-
var
|
|
382
|
+
return (t, s) => {
|
|
383
|
+
var p, y, k, V, S;
|
|
383
384
|
const u = g("FmStepperField");
|
|
384
|
-
return n(), F("div",
|
|
385
|
-
|
|
386
|
-
"model-value": (
|
|
385
|
+
return n(), F("div", Ye, [
|
|
386
|
+
v(I, {
|
|
387
|
+
"model-value": (p = a.modelValue) == null ? void 0 : p.op,
|
|
387
388
|
label: "",
|
|
388
|
-
items:
|
|
389
|
+
items: b,
|
|
389
390
|
required: !0,
|
|
390
|
-
"onUpdate:modelValue":
|
|
391
|
+
"onUpdate:modelValue": s[0] || (s[0] = (m) => i("update:model-value", { op: m, unit: "day", ignoreYear: !1 }))
|
|
391
392
|
}, null, 8, ["model-value"]),
|
|
392
|
-
((
|
|
393
|
+
((y = a.modelValue) == null ? void 0 : y.op) != "this" ? (n(), T(u, {
|
|
393
394
|
key: 0,
|
|
394
395
|
"model-value": ((k = a.modelValue) == null ? void 0 : k.x) || 0,
|
|
395
396
|
max: 365,
|
|
396
397
|
"show-steppers": !1,
|
|
397
|
-
"onUpdate:modelValue":
|
|
398
|
+
"onUpdate:modelValue": s[1] || (s[1] = (m) => i("update:model-value", {
|
|
398
399
|
op: a.modelValue.op,
|
|
399
400
|
unit: a.modelValue.unit,
|
|
400
401
|
ignoreYear: a.modelValue.ignoreYear == !0,
|
|
401
402
|
x: m
|
|
402
403
|
}))
|
|
403
|
-
}, null, 8, ["model-value"])) :
|
|
404
|
-
|
|
404
|
+
}, null, 8, ["model-value"])) : _("", !0),
|
|
405
|
+
v(I, {
|
|
405
406
|
"model-value": (V = a.modelValue) == null ? void 0 : V.unit,
|
|
406
407
|
label: "",
|
|
407
408
|
items: l,
|
|
408
409
|
required: !0,
|
|
409
|
-
"onUpdate:modelValue":
|
|
410
|
+
"onUpdate:modelValue": s[2] || (s[2] = (m) => i("update:model-value", { ...f.modelValue, unit: m }))
|
|
410
411
|
}, null, 8, ["model-value"]),
|
|
411
|
-
|
|
412
|
+
v(I, {
|
|
412
413
|
label: "",
|
|
413
414
|
"model-value": (S = a.modelValue) == null ? void 0 : S.ignoreYear,
|
|
414
415
|
items: [
|
|
@@ -416,8 +417,8 @@ const Oe = [
|
|
|
416
417
|
{ label: "ignore", value: !0 }
|
|
417
418
|
],
|
|
418
419
|
required: !0,
|
|
419
|
-
"onUpdate:modelValue":
|
|
420
|
-
...
|
|
420
|
+
"onUpdate:modelValue": s[3] || (s[3] = (m) => i("update:model-value", {
|
|
421
|
+
...f.modelValue,
|
|
421
422
|
ignoreYear: m == !0
|
|
422
423
|
}))
|
|
423
424
|
}, null, 8, ["model-value"])
|
|
@@ -427,22 +428,22 @@ const Oe = [
|
|
|
427
428
|
}), Ie = { class: "space-y-8" }, Me = { class: "text-fm-color-primary rounded-md border-dashed border-2 p-8" }, Be = {
|
|
428
429
|
key: 0,
|
|
429
430
|
class: "flex items-center gap-8"
|
|
430
|
-
}, qe =
|
|
431
|
+
}, qe = { class: "flex gap-4" }, $e = {
|
|
431
432
|
key: 0,
|
|
432
433
|
class: "grid grid-cols-7 overflow-hidden rounded-md border-1"
|
|
433
|
-
},
|
|
434
|
+
}, Ne = ["onClick"], Ae = {
|
|
434
435
|
key: 1,
|
|
435
436
|
class: "flex items-center gap-8"
|
|
436
|
-
},
|
|
437
|
+
}, _e = { class: "flex gap-4 xs:gap-[2px]" }, Pe = { class: "grid grid-cols-6 gap-8" }, Le = {
|
|
437
438
|
key: 0,
|
|
438
439
|
class: "grid grid-cols-7 overflow-hidden rounded-md border-1"
|
|
439
|
-
},
|
|
440
|
+
}, He = ["onClick"], je = {
|
|
440
441
|
key: 1,
|
|
441
442
|
class: "grid grid-cols-2 items-center gap-8"
|
|
442
|
-
},
|
|
443
|
+
}, We = { class: "flex gap-4" }, Ge = {
|
|
443
444
|
key: 4,
|
|
444
445
|
class: "flex items-center justify-end gap-8"
|
|
445
|
-
}, X = /* @__PURE__ */
|
|
446
|
+
}, X = /* @__PURE__ */ N({
|
|
446
447
|
__name: "RruleInput",
|
|
447
448
|
props: {
|
|
448
449
|
modelValue: {
|
|
@@ -459,119 +460,119 @@ const Oe = [
|
|
|
459
460
|
}
|
|
460
461
|
},
|
|
461
462
|
emits: ["update:model-value", "cancel"],
|
|
462
|
-
setup(a, { emit:
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
dtstart:
|
|
466
|
-
freq:
|
|
467
|
-
wkst:
|
|
463
|
+
setup(a, { emit: R }) {
|
|
464
|
+
const f = a, i = R, l = P(
|
|
465
|
+
f.modelValue ? O.fromString(f.modelValue) : new O({
|
|
466
|
+
dtstart: f.startDate,
|
|
467
|
+
freq: O.DAILY,
|
|
468
|
+
wkst: O.SU,
|
|
468
469
|
interval: 1,
|
|
469
470
|
byhour: 0,
|
|
470
471
|
byminute: 0,
|
|
471
472
|
bysecond: 0
|
|
472
473
|
})
|
|
473
474
|
);
|
|
474
|
-
function
|
|
475
|
-
var
|
|
476
|
-
"freq" in t && (l.value = new
|
|
477
|
-
dtstart:
|
|
475
|
+
function b(t) {
|
|
476
|
+
var s;
|
|
477
|
+
"freq" in t && (l.value = new O({
|
|
478
|
+
dtstart: f.startDate,
|
|
478
479
|
freq: t.freq,
|
|
479
480
|
interval: 1,
|
|
480
481
|
byhour: 0,
|
|
481
482
|
byminute: 0,
|
|
482
483
|
bysecond: 0,
|
|
483
|
-
wkst:
|
|
484
|
-
})), t.interval && t.interval > 0 && (l.value = new
|
|
484
|
+
wkst: O.SU
|
|
485
|
+
})), t.interval && t.interval > 0 && (l.value = new O({
|
|
485
486
|
...l.value.origOptions,
|
|
486
|
-
dtstart:
|
|
487
|
+
dtstart: f.startDate,
|
|
487
488
|
interval: t.interval
|
|
488
|
-
})), "byweekday" in t && t.byweekday && Array.isArray(t.byweekday) && t.byweekday.length > 0 && (l.value.options.bymonthday.length > 0 && l.value.options.freq ==
|
|
489
|
+
})), "byweekday" in t && t.byweekday && Array.isArray(t.byweekday) && t.byweekday.length > 0 && (l.value.options.bymonthday.length > 0 && l.value.options.freq == O.MONTHLY && (l.value.options.bymonthday = []), l.value = new O({
|
|
489
490
|
...l.value.origOptions,
|
|
490
|
-
dtstart:
|
|
491
|
+
dtstart: f.startDate,
|
|
491
492
|
bymonthday: [],
|
|
492
493
|
byweekday: t.byweekday
|
|
493
|
-
})), "bysetpos" in t && t.bysetpos != null && (l.value = new
|
|
494
|
+
})), "bysetpos" in t && t.bysetpos != null && (l.value = new O({
|
|
494
495
|
...l.value.origOptions,
|
|
495
|
-
dtstart:
|
|
496
|
+
dtstart: f.startDate,
|
|
496
497
|
bymonthday: [],
|
|
497
498
|
bysetpos: t.bysetpos,
|
|
498
|
-
byweekday: ((
|
|
499
|
-
})), "bymonthday" in t && t.bymonthday && Array.isArray(t.bymonthday) && t.bymonthday.length > 0 && (l.value = new
|
|
499
|
+
byweekday: ((s = l.value.options.byweekday) == null ? void 0 : s.length) > 0 ? l.value.options.byweekday : [6]
|
|
500
|
+
})), "bymonthday" in t && t.bymonthday && Array.isArray(t.bymonthday) && t.bymonthday.length > 0 && (l.value = new O({
|
|
500
501
|
...l.value.origOptions,
|
|
501
|
-
dtstart:
|
|
502
|
+
dtstart: f.startDate,
|
|
502
503
|
bysetpos: [],
|
|
503
504
|
byweekday: [],
|
|
504
505
|
bymonthday: t.bymonthday
|
|
505
|
-
})), "bymonth" in t && t.bymonth && Array.isArray(t.bymonth) && t.bymonth.length > 0 && (l.value = new
|
|
506
|
+
})), "bymonth" in t && t.bymonth && Array.isArray(t.bymonth) && t.bymonth.length > 0 && (l.value = new O({
|
|
506
507
|
...l.value.origOptions,
|
|
507
|
-
dtstart:
|
|
508
|
+
dtstart: f.startDate,
|
|
508
509
|
bysetpos: [],
|
|
509
510
|
bymonth: t.bymonth
|
|
510
|
-
})), "bynweekday" in t && t.bynweekday && (l.value = new
|
|
511
|
+
})), "bynweekday" in t && t.bynweekday && (l.value = new O({
|
|
511
512
|
...l.value.origOptions,
|
|
512
|
-
dtstart:
|
|
513
|
+
dtstart: f.startDate,
|
|
513
514
|
bysetpos: [],
|
|
514
515
|
byweekday: new Ve(
|
|
515
516
|
t.bynweekday[0][0],
|
|
516
517
|
t.bynweekday[0][1]
|
|
517
518
|
)
|
|
518
|
-
})),
|
|
519
|
+
})), f.applyButton || i("update:model-value", l.value.toString());
|
|
519
520
|
}
|
|
520
521
|
return K(() => {
|
|
521
|
-
|
|
522
|
+
f.modelValue || i(
|
|
522
523
|
"update:model-value",
|
|
523
|
-
new
|
|
524
|
-
dtstart:
|
|
525
|
-
freq:
|
|
526
|
-
wkst:
|
|
524
|
+
new O({
|
|
525
|
+
dtstart: f.startDate,
|
|
526
|
+
freq: O.DAILY,
|
|
527
|
+
wkst: O.SU,
|
|
527
528
|
interval: 1,
|
|
528
529
|
byhour: 0,
|
|
529
530
|
byminute: 0,
|
|
530
531
|
bysecond: 0
|
|
531
532
|
}).toString()
|
|
532
533
|
);
|
|
533
|
-
}), (t,
|
|
534
|
+
}), (t, s) => {
|
|
534
535
|
var V, S, m;
|
|
535
|
-
const u = g("FmStepperField"),
|
|
536
|
+
const u = g("FmStepperField"), p = g("FmChip"), y = g("FmButtonGroup"), k = g("FmButton");
|
|
536
537
|
return n(), F("div", Ie, [
|
|
537
|
-
|
|
538
|
-
a.fixedFrequency ?
|
|
539
|
-
|
|
540
|
-
|
|
538
|
+
U("div", Me, j(e(ke)(e(l).options)), 1),
|
|
539
|
+
a.fixedFrequency ? _("", !0) : (n(), F("div", Be, [
|
|
540
|
+
s[8] || (s[8] = U("div", null, "Repeat every", -1)),
|
|
541
|
+
v(u, {
|
|
541
542
|
class: "w-[100px]",
|
|
542
543
|
"model-value": e(l).options.interval,
|
|
543
|
-
"onUpdate:modelValue":
|
|
544
|
+
"onUpdate:modelValue": s[0] || (s[0] = (o) => b({ interval: o > 0 ? o : e(l).options.interval })),
|
|
544
545
|
min: 1
|
|
545
546
|
}, null, 8, ["model-value"]),
|
|
546
|
-
|
|
547
|
+
v(I, {
|
|
547
548
|
class: "w-min",
|
|
548
549
|
items: e(H).frequencies,
|
|
549
550
|
"model-value": e(l).origOptions.freq,
|
|
550
|
-
"onUpdate:modelValue":
|
|
551
|
+
"onUpdate:modelValue": s[1] || (s[1] = (o) => b({ freq: o }))
|
|
551
552
|
}, null, 8, ["items", "model-value"])
|
|
552
553
|
])),
|
|
553
|
-
e(l).options.freq === e(
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
(n(!0), F(Y, null,
|
|
554
|
+
e(l).options.freq === e(O).WEEKLY ? (n(), F(Y, { key: 1 }, [
|
|
555
|
+
s[9] || (s[9] = U("div", null, "Repeat on", -1)),
|
|
556
|
+
U("div", qe, [
|
|
557
|
+
(n(!0), F(Y, null, A(e(H).weekdays, (o) => {
|
|
557
558
|
var d;
|
|
558
|
-
return n(),
|
|
559
|
+
return n(), T(p, {
|
|
559
560
|
class: L(["cursor-pointer", `${(d = e(l).options.byweekday) != null && d.includes(o.value) ? "bg-fm-color-primary text-white" : "bg-fm-color-neutral-gray-200 text-black"}`]),
|
|
560
561
|
label: o.label[0],
|
|
561
562
|
key: o.value,
|
|
562
563
|
compact: !0,
|
|
563
564
|
onClick: () => {
|
|
564
|
-
var c,
|
|
565
|
-
|
|
566
|
-
byweekday: (c = e(l).options.byweekday) != null && c.includes(o.value) ? ((
|
|
565
|
+
var c, x;
|
|
566
|
+
b({
|
|
567
|
+
byweekday: (c = e(l).options.byweekday) != null && c.includes(o.value) ? ((x = e(l).options.byweekday) == null ? void 0 : x.filter((E) => E !== o.value)) || [] : [...e(l).options.byweekday || [], o.value]
|
|
567
568
|
});
|
|
568
569
|
}
|
|
569
570
|
}, null, 8, ["class", "label", "onClick"]);
|
|
570
571
|
}), 128))
|
|
571
572
|
])
|
|
572
|
-
], 64)) :
|
|
573
|
-
e(l).options.freq == e(
|
|
574
|
-
y
|
|
573
|
+
], 64)) : _("", !0),
|
|
574
|
+
e(l).options.freq == e(O).MONTHLY ? (n(), F(Y, { key: 2 }, [
|
|
575
|
+
v(y, {
|
|
575
576
|
"model-value": e(l).options.bymonthday.length ? { label: "Each" } : { label: "On the" },
|
|
576
577
|
items: [
|
|
577
578
|
{
|
|
@@ -581,34 +582,34 @@ const Oe = [
|
|
|
581
582
|
label: "On the"
|
|
582
583
|
}
|
|
583
584
|
],
|
|
584
|
-
"onUpdate:modelValue":
|
|
585
|
-
o.label == "Each" ?
|
|
585
|
+
"onUpdate:modelValue": s[2] || (s[2] = (o) => {
|
|
586
|
+
o.label == "Each" ? b({ bymonthday: [1] }) : b({ bysetpos: 1 });
|
|
586
587
|
})
|
|
587
588
|
}, null, 8, ["model-value"]),
|
|
588
|
-
e(l).options.bymonthday.length > 0 ? (n(), F("div",
|
|
589
|
-
(n(!0), F(Y, null,
|
|
589
|
+
e(l).options.bymonthday.length > 0 ? (n(), F("div", $e, [
|
|
590
|
+
(n(!0), F(Y, null, A(e(H).dates, (o) => (n(), F("div", {
|
|
590
591
|
key: o.value,
|
|
591
592
|
class: L(["cursor-pointer text-center outline-1 outline-fm-color-neutral-gray-100 outline", `${e(l).options.bymonthday.includes(o.value) ? "bg-fm-color-primary text-fm-color-typo-white outline-transparent" : "bg-transparent text-fm-color-typo-primary"} ${o.value == 31 ? "border-r" : ""}`]),
|
|
592
|
-
onClick: (d) =>
|
|
593
|
+
onClick: (d) => b({
|
|
593
594
|
bymonthday: e(l).options.bymonthday.includes(o.value) ? e(l).options.bymonthday.filter((c) => c !== o.value) : [...e(l).options.bymonthday, o.value]
|
|
594
595
|
})
|
|
595
|
-
}, j(o.value), 11,
|
|
596
|
-
])) : (n(), F("div",
|
|
597
|
-
|
|
596
|
+
}, j(o.value), 11, Ne))), 128))
|
|
597
|
+
])) : (n(), F("div", Ae, [
|
|
598
|
+
v(I, {
|
|
598
599
|
items: e(H).ordinals,
|
|
599
600
|
"model-value": (V = e(l).options.bysetpos) == null ? void 0 : V[0],
|
|
600
|
-
"onUpdate:modelValue":
|
|
601
|
+
"onUpdate:modelValue": s[3] || (s[3] = (o) => b({ bysetpos: o }))
|
|
601
602
|
}, null, 8, ["items", "model-value"]),
|
|
602
|
-
|
|
603
|
-
(n(!0), F(Y, null,
|
|
603
|
+
U("div", _e, [
|
|
604
|
+
(n(!0), F(Y, null, A(e(H).weekdays, (o) => {
|
|
604
605
|
var d;
|
|
605
|
-
return n(),
|
|
606
|
+
return n(), T(p, {
|
|
606
607
|
class: L(["cursor-pointer", `${(d = e(l).options.byweekday) != null && d.includes(o.value) ? "bg-fm-color-primary text-white" : "bg-fm-color-neutral-gray-200 text-black"}`]),
|
|
607
608
|
label: o.label[0],
|
|
608
609
|
key: o.value,
|
|
609
610
|
compact: !0,
|
|
610
611
|
onClick: () => {
|
|
611
|
-
|
|
612
|
+
b({
|
|
612
613
|
byweekday: [o.value]
|
|
613
614
|
});
|
|
614
615
|
}
|
|
@@ -616,13 +617,13 @@ const Oe = [
|
|
|
616
617
|
}), 128))
|
|
617
618
|
])
|
|
618
619
|
]))
|
|
619
|
-
], 64)) :
|
|
620
|
-
e(l).options.freq == e(
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
(n(!0), F(Y, null,
|
|
620
|
+
], 64)) : _("", !0),
|
|
621
|
+
e(l).options.freq == e(O).YEARLY ? (n(), F(Y, { key: 3 }, [
|
|
622
|
+
s[10] || (s[10] = U("div", null, "Month", -1)),
|
|
623
|
+
U("div", Pe, [
|
|
624
|
+
(n(!0), F(Y, null, A(e(H).months, (o) => {
|
|
624
625
|
var d, c;
|
|
625
|
-
return n(),
|
|
626
|
+
return n(), T(p, {
|
|
626
627
|
key: o.value,
|
|
627
628
|
class: L(["cursor-pointer", {
|
|
628
629
|
"bg-fm-color-primary text-white": (d = e(l).options.bymonth) == null ? void 0 : d.includes(
|
|
@@ -632,13 +633,13 @@ const Oe = [
|
|
|
632
633
|
}]),
|
|
633
634
|
label: o.shortName,
|
|
634
635
|
compact: !0,
|
|
635
|
-
onClick: (
|
|
636
|
+
onClick: (x) => b({
|
|
636
637
|
bymonth: (e(l).options.bymonth ?? []).includes(o.value) ? (e(l).options.bymonth ?? []).filter((E) => E !== o.value) : [...e(l).options.bymonth ?? [], o.value]
|
|
637
638
|
})
|
|
638
639
|
}, null, 8, ["class", "label", "onClick"]);
|
|
639
640
|
}), 128))
|
|
640
641
|
]),
|
|
641
|
-
y
|
|
642
|
+
v(y, {
|
|
642
643
|
"model-value": e(l).options.bymonthday.length ? { label: "Each" } : { label: "On the" },
|
|
643
644
|
items: [
|
|
644
645
|
{
|
|
@@ -648,48 +649,48 @@ const Oe = [
|
|
|
648
649
|
label: "On the"
|
|
649
650
|
}
|
|
650
651
|
],
|
|
651
|
-
"onUpdate:modelValue":
|
|
652
|
-
o.label == "Each" ?
|
|
652
|
+
"onUpdate:modelValue": s[4] || (s[4] = (o) => {
|
|
653
|
+
o.label == "Each" ? b({
|
|
653
654
|
bymonthday: [1],
|
|
654
655
|
bymonth: e(l).options.bymonth ?? [1]
|
|
655
|
-
}) :
|
|
656
|
-
byweekday: [e(
|
|
656
|
+
}) : b({
|
|
657
|
+
byweekday: [e(O).SU.nth(1)],
|
|
657
658
|
bymonth: e(l).options.bymonth ?? [1]
|
|
658
659
|
});
|
|
659
660
|
})
|
|
660
661
|
}, null, 8, ["model-value"]),
|
|
661
|
-
e(l).options.bymonthday.length > 0 ? (n(), F("div",
|
|
662
|
-
(n(!0), F(Y, null,
|
|
662
|
+
e(l).options.bymonthday.length > 0 ? (n(), F("div", Le, [
|
|
663
|
+
(n(!0), F(Y, null, A(Array(31).fill(null).map((o, d) => d + 1), (o) => (n(), F("div", {
|
|
663
664
|
key: o,
|
|
664
665
|
class: L(["cursor-pointer text-center outline-1 outline-fm-color-neutral-gray-100 outline", `${e(l).options.bymonthday.includes(o) ? "bg-fm-color-primary text-fm-color-typo-white outline-transparent" : "bg-transparent text-fm-color-typo-primary"} ${o == 31 ? "border-r" : ""}`]),
|
|
665
|
-
onClick: (d) =>
|
|
666
|
+
onClick: (d) => b({
|
|
666
667
|
bymonthday: e(l).options.bymonthday.includes(o) ? e(l).options.bymonthday.filter((c) => c !== o) : [...e(l).options.bymonthday, o]
|
|
667
668
|
})
|
|
668
|
-
}, j(o), 11,
|
|
669
|
-
])) : (n(), F("div",
|
|
670
|
-
|
|
669
|
+
}, j(o), 11, He))), 128))
|
|
670
|
+
])) : (n(), F("div", je, [
|
|
671
|
+
v(I, {
|
|
671
672
|
items: e(H).ordinals,
|
|
672
673
|
"model-value": (m = (S = e(l).options.bynweekday) == null ? void 0 : S[0]) == null ? void 0 : m[1],
|
|
673
|
-
"onUpdate:modelValue":
|
|
674
|
+
"onUpdate:modelValue": s[5] || (s[5] = (o) => {
|
|
674
675
|
var d, c;
|
|
675
|
-
return
|
|
676
|
+
return b({
|
|
676
677
|
bynweekday: [[((c = (d = e(l).options.bynweekday) == null ? void 0 : d[0]) == null ? void 0 : c[0]) ?? 1, o]]
|
|
677
678
|
});
|
|
678
679
|
})
|
|
679
680
|
}, null, 8, ["items", "model-value"]),
|
|
680
|
-
|
|
681
|
-
(n(!0), F(Y, null,
|
|
681
|
+
U("div", We, [
|
|
682
|
+
(n(!0), F(Y, null, A(e(H).weekdays, (o) => {
|
|
682
683
|
var d, c;
|
|
683
|
-
return n(),
|
|
684
|
+
return n(), T(p, {
|
|
684
685
|
class: L(["cursor-pointer", `${((c = (d = e(l).options.bynweekday) == null ? void 0 : d[0]) == null ? void 0 : c[0]) === o.value ? "bg-fm-color-primary text-white" : "bg-fm-color-neutral-gray-200 text-black"}`]),
|
|
685
686
|
label: o.label[0],
|
|
686
687
|
key: o.value,
|
|
687
688
|
compact: !0,
|
|
688
689
|
onClick: () => {
|
|
689
|
-
var
|
|
690
|
-
|
|
690
|
+
var x, E;
|
|
691
|
+
b({
|
|
691
692
|
bynweekday: [
|
|
692
|
-
[o.value, ((E = (
|
|
693
|
+
[o.value, ((E = (x = e(l).options.bynweekday) == null ? void 0 : x[0]) == null ? void 0 : E[1]) ?? 1]
|
|
693
694
|
]
|
|
694
695
|
});
|
|
695
696
|
}
|
|
@@ -697,22 +698,22 @@ const Oe = [
|
|
|
697
698
|
}), 128))
|
|
698
699
|
])
|
|
699
700
|
]))
|
|
700
|
-
], 64)) :
|
|
701
|
-
a.applyButton ? (n(), F("div",
|
|
702
|
-
|
|
701
|
+
], 64)) : _("", !0),
|
|
702
|
+
a.applyButton ? (n(), F("div", Ge, [
|
|
703
|
+
v(k, {
|
|
703
704
|
label: "Cancel",
|
|
704
705
|
variant: "tertiary",
|
|
705
|
-
onClick:
|
|
706
|
+
onClick: s[6] || (s[6] = (o) => i("cancel"))
|
|
706
707
|
}),
|
|
707
|
-
|
|
708
|
+
v(k, {
|
|
708
709
|
label: "Apply",
|
|
709
|
-
onClick:
|
|
710
|
+
onClick: s[7] || (s[7] = (o) => i("update:model-value", e(l).toString()))
|
|
710
711
|
})
|
|
711
|
-
])) :
|
|
712
|
+
])) : _("", !0)
|
|
712
713
|
]);
|
|
713
714
|
};
|
|
714
715
|
}
|
|
715
|
-
}),
|
|
716
|
+
}), Ke = { class: "grid grid-cols-4 gap-8 w-full flex-wrap py-16" }, Qe = /* @__PURE__ */ N({
|
|
716
717
|
__name: "IsInMonthInput",
|
|
717
718
|
props: {
|
|
718
719
|
modelValue: {
|
|
@@ -721,30 +722,30 @@ const Oe = [
|
|
|
721
722
|
}
|
|
722
723
|
},
|
|
723
724
|
emits: ["update:model-value"],
|
|
724
|
-
setup(a, { emit:
|
|
725
|
-
const
|
|
726
|
-
name:
|
|
725
|
+
setup(a, { emit: R }) {
|
|
726
|
+
const f = a, i = R, l = J.months().map((b, t) => ({
|
|
727
|
+
name: b,
|
|
727
728
|
shortName: J().month(t).format("MMM"),
|
|
728
729
|
value: t
|
|
729
730
|
}));
|
|
730
731
|
return K(() => {
|
|
731
|
-
|
|
732
|
-
}), (
|
|
733
|
-
const
|
|
734
|
-
return n(), F("div",
|
|
735
|
-
(n(!0), F(Y, null,
|
|
736
|
-
var
|
|
737
|
-
return n(),
|
|
732
|
+
f.modelValue || i("update:model-value", []);
|
|
733
|
+
}), (b, t) => {
|
|
734
|
+
const s = g("FmChip");
|
|
735
|
+
return n(), F("div", Ke, [
|
|
736
|
+
(n(!0), F(Y, null, A(e(l), (u) => {
|
|
737
|
+
var p, y;
|
|
738
|
+
return n(), T(s, {
|
|
738
739
|
class: L(["cursor-pointer", {
|
|
739
|
-
"bg-fm-color-primary text-white": (
|
|
740
|
-
"bg-fm-color-gray-200 text-fm-color-gray-800": !((
|
|
740
|
+
"bg-fm-color-primary text-white": (p = a.modelValue) == null ? void 0 : p.includes(u.value),
|
|
741
|
+
"bg-fm-color-gray-200 text-fm-color-gray-800": !((y = a.modelValue) != null && y.includes(
|
|
741
742
|
u.value
|
|
742
743
|
))
|
|
743
744
|
}]),
|
|
744
745
|
label: u.name,
|
|
745
746
|
key: u.value,
|
|
746
747
|
compact: !0,
|
|
747
|
-
onClick: (k) =>
|
|
748
|
+
onClick: (k) => i(
|
|
748
749
|
"update:model-value",
|
|
749
750
|
a.modelValue.includes(u.value) ? a.modelValue.filter((V) => V !== u.value) : [...a.modelValue, u.value]
|
|
750
751
|
)
|
|
@@ -753,7 +754,7 @@ const Oe = [
|
|
|
753
754
|
]);
|
|
754
755
|
};
|
|
755
756
|
}
|
|
756
|
-
}),
|
|
757
|
+
}), ze = { class: "flex flex-col flex-nowrap" }, Ze = { class: "flex gap-16 items-center w-full" }, Je = { class: "flex grow items-center" }, Xe = { class: "grow text-fm-color-typo-secondary" }, et = { key: 0 }, tt = { class: "px-16" }, lt = /* @__PURE__ */ N({
|
|
757
758
|
__name: "SelectItems",
|
|
758
759
|
props: {
|
|
759
760
|
initialValue: {
|
|
@@ -773,8 +774,8 @@ const Oe = [
|
|
|
773
774
|
default: 380
|
|
774
775
|
}
|
|
775
776
|
},
|
|
776
|
-
setup(a, { expose:
|
|
777
|
-
const
|
|
777
|
+
setup(a, { expose: R }) {
|
|
778
|
+
const f = a, i = Te(), l = M(() => i.menu.value || {
|
|
778
779
|
_id: "",
|
|
779
780
|
modules: {
|
|
780
781
|
catalog: [],
|
|
@@ -791,27 +792,27 @@ const Oe = [
|
|
|
791
792
|
cookingGuide: [],
|
|
792
793
|
serveSequence: []
|
|
793
794
|
}
|
|
794
|
-
}),
|
|
795
|
-
const o =
|
|
796
|
-
return l.value.modules.item.filter(o).reduce((c,
|
|
795
|
+
}), b = M(() => {
|
|
796
|
+
const o = f.filterItems ?? ((c) => !!c.category);
|
|
797
|
+
return l.value.modules.item.filter(o).reduce((c, x) => {
|
|
797
798
|
const E = {
|
|
798
|
-
id:
|
|
799
|
-
category:
|
|
800
|
-
name: (
|
|
799
|
+
id: x._id,
|
|
800
|
+
category: x.category,
|
|
801
|
+
name: (x.name2 || x.name).trim()
|
|
801
802
|
};
|
|
802
803
|
return c = [...c, E], c;
|
|
803
804
|
}, []);
|
|
804
|
-
}), t =
|
|
805
|
+
}), t = M(() => {
|
|
805
806
|
const o = l.value.modules.category.reduce((d, c) => (d[c._id] = {
|
|
806
807
|
id: c._id,
|
|
807
808
|
name: c.name,
|
|
808
809
|
items: {}
|
|
809
810
|
}, d), {});
|
|
810
|
-
return
|
|
811
|
+
return b.value.reduce(
|
|
811
812
|
(d, c) => {
|
|
812
|
-
const
|
|
813
|
-
return d[
|
|
814
|
-
...d[
|
|
813
|
+
const x = c.category ?? "";
|
|
814
|
+
return d[x].items = {
|
|
815
|
+
...d[x].items,
|
|
815
816
|
[c.id]: c
|
|
816
817
|
}, d;
|
|
817
818
|
},
|
|
@@ -824,59 +825,59 @@ const Oe = [
|
|
|
824
825
|
}
|
|
825
826
|
}
|
|
826
827
|
);
|
|
827
|
-
}),
|
|
828
|
-
const o =
|
|
829
|
-
return o ? Object.entries(t.value).reduce((d, [c,
|
|
830
|
-
if (
|
|
831
|
-
return d[c] =
|
|
832
|
-
const E = Object.entries(
|
|
833
|
-
return Object.keys(E).length > 0 && (d[c] = { ...
|
|
828
|
+
}), s = M(() => {
|
|
829
|
+
const o = p.value.toLowerCase();
|
|
830
|
+
return o ? Object.entries(t.value).reduce((d, [c, x]) => {
|
|
831
|
+
if (x.name.toLowerCase().includes(o))
|
|
832
|
+
return d[c] = x, d;
|
|
833
|
+
const E = Object.entries(x.items).reduce((r, [q, w]) => (w.name.toLowerCase().includes(o) && (r[q] = w), r), {});
|
|
834
|
+
return Object.keys(E).length > 0 && (d[c] = { ...x, items: E }), d;
|
|
834
835
|
}, {}) : t.value;
|
|
835
|
-
}), u = P({}),
|
|
836
|
+
}), u = P({}), p = P(""), y = M(() => Object.values(u.value).filter((o) => !!o).length);
|
|
836
837
|
function k(o) {
|
|
837
|
-
u.value =
|
|
838
|
+
u.value = b.value.reduce((d, c) => (d[c.id] = o.includes(c.id), d), {});
|
|
838
839
|
}
|
|
839
840
|
K(async () => {
|
|
840
|
-
await
|
|
841
|
+
await i.getMenu(), k(f.initialValue);
|
|
841
842
|
});
|
|
842
843
|
function V(o) {
|
|
843
|
-
const d = Object.keys(
|
|
844
|
+
const d = Object.keys(s.value[o].items), c = d.filter((x) => u.value[x]);
|
|
844
845
|
return c.length ? c.length === d.length ? !0 : null : !1;
|
|
845
846
|
}
|
|
846
847
|
function S(o) {
|
|
847
|
-
const d = Object.keys(
|
|
848
|
+
const d = Object.keys(s.value[o].items), c = V(o), x = le(u.value);
|
|
848
849
|
for (const E of d)
|
|
849
|
-
|
|
850
|
-
u.value =
|
|
850
|
+
x[E] = c !== !0;
|
|
851
|
+
u.value = x;
|
|
851
852
|
}
|
|
852
853
|
function m(o) {
|
|
853
854
|
u.value[o] = !u.value[o];
|
|
854
855
|
}
|
|
855
|
-
return
|
|
856
|
+
return R({
|
|
856
857
|
onConfirm: () => {
|
|
857
858
|
const o = Object.entries(u.value).filter(([, d]) => !!d).map(([d]) => d);
|
|
858
|
-
|
|
859
|
+
f.onComplete(o);
|
|
859
860
|
}
|
|
860
861
|
}), (o, d) => {
|
|
861
|
-
const c = g("fm-button"),
|
|
862
|
-
return n(), F("div",
|
|
863
|
-
|
|
862
|
+
const c = g("fm-button"), x = g("FmTextField"), E = g("fm-list-item"), r = g("fm-checkbox"), q = g("fm-list");
|
|
863
|
+
return n(), F("div", ze, [
|
|
864
|
+
v(E, {
|
|
864
865
|
tag: "div",
|
|
865
866
|
clickable: !1
|
|
866
867
|
}, {
|
|
867
|
-
default:
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
868
|
+
default: B(() => [
|
|
869
|
+
U("div", Ze, [
|
|
870
|
+
U("div", Je, [
|
|
871
|
+
v(c, {
|
|
871
872
|
icon: "sync",
|
|
872
873
|
variant: "tertiary",
|
|
873
874
|
onClick: d[0] || (d[0] = () => k([]))
|
|
874
875
|
}),
|
|
875
|
-
|
|
876
|
+
U("span", Xe, j(y.value) + " product(s) selected ", 1)
|
|
876
877
|
]),
|
|
877
|
-
|
|
878
|
-
modelValue:
|
|
879
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
878
|
+
v(x, {
|
|
879
|
+
modelValue: p.value,
|
|
880
|
+
"onUpdate:modelValue": d[1] || (d[1] = (w) => p.value = w),
|
|
880
881
|
placeholder: "Search",
|
|
881
882
|
"leading-icon": { name: "search", color: "" },
|
|
882
883
|
style: { width: "200px", "min-width": "200px" }
|
|
@@ -885,40 +886,40 @@ const Oe = [
|
|
|
885
886
|
]),
|
|
886
887
|
_: 1
|
|
887
888
|
}),
|
|
888
|
-
|
|
889
|
-
class: L(["grow overflow-y-auto", `max-h-${
|
|
889
|
+
v(q, {
|
|
890
|
+
class: L(["grow overflow-y-auto", `max-h-${f.maxHeight ? `[${f.maxHeight}px]` : "full"}`])
|
|
890
891
|
}, {
|
|
891
|
-
default:
|
|
892
|
-
(n(!0), F(Y, null,
|
|
893
|
-
key:
|
|
892
|
+
default: B(() => [
|
|
893
|
+
(n(!0), F(Y, null, A(s.value, (w) => (n(), F(Y, {
|
|
894
|
+
key: w.id
|
|
894
895
|
}, [
|
|
895
|
-
Object.keys(
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
"model-value": V(
|
|
899
|
-
indeterminate: V(
|
|
900
|
-
label:
|
|
896
|
+
Object.keys(w.items).length > 0 ? (n(), F("div", et, [
|
|
897
|
+
U("div", tt, [
|
|
898
|
+
v(r, {
|
|
899
|
+
"model-value": V(w.id) ?? !1,
|
|
900
|
+
indeterminate: V(w.id) === null,
|
|
901
|
+
label: w.name,
|
|
901
902
|
value: "",
|
|
902
903
|
name: "",
|
|
903
904
|
sublabel: "",
|
|
904
905
|
class: "w-full",
|
|
905
|
-
"onUpdate:modelValue": () => S(
|
|
906
|
+
"onUpdate:modelValue": () => S(w.id)
|
|
906
907
|
}, null, 8, ["model-value", "indeterminate", "label", "onUpdate:modelValue"])
|
|
907
908
|
]),
|
|
908
|
-
(n(!0), F(Y, null,
|
|
909
|
-
key:
|
|
909
|
+
(n(!0), F(Y, null, A(w.items, ($) => (n(), F("div", {
|
|
910
|
+
key: $.id,
|
|
910
911
|
class: "pl-48"
|
|
911
912
|
}, [
|
|
912
|
-
|
|
913
|
-
"model-value": u.value[
|
|
914
|
-
label:
|
|
915
|
-
value:
|
|
916
|
-
name:
|
|
913
|
+
v(r, {
|
|
914
|
+
"model-value": u.value[$.id],
|
|
915
|
+
label: $.name,
|
|
916
|
+
value: $.id,
|
|
917
|
+
name: $.name,
|
|
917
918
|
class: "w-full",
|
|
918
|
-
"onUpdate:modelValue": () => m(
|
|
919
|
+
"onUpdate:modelValue": () => m($.id)
|
|
919
920
|
}, null, 8, ["model-value", "label", "value", "name", "onUpdate:modelValue"])
|
|
920
921
|
]))), 128))
|
|
921
|
-
])) :
|
|
922
|
+
])) : _("", !0)
|
|
922
923
|
], 64))), 128))
|
|
923
924
|
]),
|
|
924
925
|
_: 1
|
|
@@ -926,7 +927,7 @@ const Oe = [
|
|
|
926
927
|
]);
|
|
927
928
|
};
|
|
928
929
|
}
|
|
929
|
-
}),
|
|
930
|
+
}), ot = { class: "" }, at = { class: "flex justify-end gap-8 w-full" }, nt = /* @__PURE__ */ N({
|
|
930
931
|
__name: "MenuDialog",
|
|
931
932
|
props: {
|
|
932
933
|
modelValue: { type: Boolean },
|
|
@@ -934,58 +935,58 @@ const Oe = [
|
|
|
934
935
|
filterItems: { type: Function }
|
|
935
936
|
},
|
|
936
937
|
emits: ["update:model-value", "confirm"],
|
|
937
|
-
setup(a, { emit:
|
|
938
|
-
const
|
|
938
|
+
setup(a, { emit: R }) {
|
|
939
|
+
const f = a, i = P(), l = P(!1), b = R;
|
|
939
940
|
function t() {
|
|
940
941
|
var u;
|
|
941
|
-
(u =
|
|
942
|
+
(u = i.value) == null || u.onConfirm(), b("update:model-value", !1);
|
|
942
943
|
}
|
|
943
|
-
function
|
|
944
|
-
|
|
944
|
+
function s() {
|
|
945
|
+
b("update:model-value", !1);
|
|
945
946
|
}
|
|
946
947
|
return ie(
|
|
947
|
-
() =>
|
|
948
|
+
() => f.modelValue,
|
|
948
949
|
(u) => {
|
|
949
950
|
l.value = u;
|
|
950
951
|
}
|
|
951
952
|
), K(() => {
|
|
952
|
-
l.value =
|
|
953
|
-
}), (u,
|
|
954
|
-
const
|
|
955
|
-
return n(),
|
|
953
|
+
l.value = f.modelValue;
|
|
954
|
+
}), (u, p) => {
|
|
955
|
+
const y = g("FmButton"), k = g("FmDialog");
|
|
956
|
+
return n(), T(k, {
|
|
956
957
|
"content-scrollable": !1,
|
|
957
958
|
contentClass: "pt-0",
|
|
958
959
|
modelValue: l.value,
|
|
959
|
-
"onUpdate:modelValue":
|
|
960
|
+
"onUpdate:modelValue": p[0] || (p[0] = (V) => l.value = V),
|
|
960
961
|
title: "Select Items",
|
|
961
962
|
"close-button": !1
|
|
962
963
|
}, {
|
|
963
|
-
"dialog-header":
|
|
964
|
-
|
|
965
|
-
]),
|
|
966
|
-
"dialog-footer":
|
|
967
|
-
|
|
968
|
-
y
|
|
964
|
+
"dialog-header": B(() => p[1] || (p[1] = [
|
|
965
|
+
U("div", null, "Select Item", -1)
|
|
966
|
+
])),
|
|
967
|
+
"dialog-footer": B(() => [
|
|
968
|
+
U("div", at, [
|
|
969
|
+
v(y, {
|
|
969
970
|
variant: "tertiary",
|
|
970
|
-
onClick:
|
|
971
|
+
onClick: s,
|
|
971
972
|
label: "Cancel"
|
|
972
973
|
}),
|
|
973
|
-
y
|
|
974
|
+
v(y, {
|
|
974
975
|
variant: "primary",
|
|
975
976
|
onClick: t,
|
|
976
977
|
label: "Confirm"
|
|
977
978
|
})
|
|
978
979
|
])
|
|
979
980
|
]),
|
|
980
|
-
default:
|
|
981
|
-
|
|
982
|
-
|
|
981
|
+
default: B(() => [
|
|
982
|
+
U("div", ot, [
|
|
983
|
+
v(lt, {
|
|
983
984
|
ref_key: "selectItemRef",
|
|
984
|
-
ref:
|
|
985
|
+
ref: i,
|
|
985
986
|
"initial-value": u.initialValue,
|
|
986
987
|
"filter-items": u.filterItems,
|
|
987
988
|
"on-complete": (V) => {
|
|
988
|
-
|
|
989
|
+
b("confirm", V), s();
|
|
989
990
|
}
|
|
990
991
|
}, null, 8, ["initial-value", "filter-items", "on-complete"])
|
|
991
992
|
])
|
|
@@ -994,48 +995,48 @@ const Oe = [
|
|
|
994
995
|
}, 8, ["modelValue"]);
|
|
995
996
|
};
|
|
996
997
|
}
|
|
997
|
-
}),
|
|
998
|
+
}), rt = { id: "select-menu" }, ut = /* @__PURE__ */ N({
|
|
998
999
|
__name: "SelectMenu",
|
|
999
1000
|
props: {
|
|
1000
1001
|
modelValue: {}
|
|
1001
1002
|
},
|
|
1002
1003
|
emits: ["update:model-value"],
|
|
1003
|
-
setup(a, { emit:
|
|
1004
|
-
const
|
|
1005
|
-
var
|
|
1006
|
-
return ((
|
|
1007
|
-
}),
|
|
1008
|
-
function t(
|
|
1009
|
-
|
|
1004
|
+
setup(a, { emit: R }) {
|
|
1005
|
+
const f = a, i = P(!1), l = M(() => {
|
|
1006
|
+
var s;
|
|
1007
|
+
return ((s = f.modelValue) == null ? void 0 : s.length) || 0;
|
|
1008
|
+
}), b = R;
|
|
1009
|
+
function t(s) {
|
|
1010
|
+
b("update:model-value", s);
|
|
1010
1011
|
}
|
|
1011
|
-
return (
|
|
1012
|
-
const
|
|
1013
|
-
return n(), F("div",
|
|
1014
|
-
|
|
1012
|
+
return (s, u) => {
|
|
1013
|
+
const p = g("FmField");
|
|
1014
|
+
return n(), F("div", rt, [
|
|
1015
|
+
v(p, {
|
|
1015
1016
|
class: "text-fm-color-typo-tertiary",
|
|
1016
|
-
onClick: u[0] || (u[0] = (
|
|
1017
|
+
onClick: u[0] || (u[0] = (y) => i.value = !0)
|
|
1017
1018
|
}, {
|
|
1018
|
-
default:
|
|
1019
|
+
default: B(() => [
|
|
1019
1020
|
ee(j(l.value) + " item(s) selected ", 1)
|
|
1020
1021
|
]),
|
|
1021
1022
|
_: 1
|
|
1022
1023
|
}),
|
|
1023
|
-
|
|
1024
|
-
modelValue:
|
|
1024
|
+
v(nt, {
|
|
1025
|
+
modelValue: i.value,
|
|
1025
1026
|
"onUpdate:modelValue": [
|
|
1026
|
-
u[1] || (u[1] = (
|
|
1027
|
-
u[2] || (u[2] = (
|
|
1027
|
+
u[1] || (u[1] = (y) => i.value = y),
|
|
1028
|
+
u[2] || (u[2] = (y) => i.value = y)
|
|
1028
1029
|
],
|
|
1029
|
-
"initial-value":
|
|
1030
|
+
"initial-value": s.modelValue,
|
|
1030
1031
|
onConfirm: t
|
|
1031
1032
|
}, null, 8, ["modelValue", "initial-value"])
|
|
1032
1033
|
]);
|
|
1033
1034
|
};
|
|
1034
1035
|
}
|
|
1035
|
-
}),
|
|
1036
|
+
}), st = {
|
|
1036
1037
|
key: 17,
|
|
1037
1038
|
class: "fm-typo-en-body-lg-600"
|
|
1038
|
-
},
|
|
1039
|
+
}, it = /* @__PURE__ */ N({
|
|
1039
1040
|
__name: "RuleEquator",
|
|
1040
1041
|
props: {
|
|
1041
1042
|
type: {
|
|
@@ -1051,79 +1052,79 @@ const Oe = [
|
|
|
1051
1052
|
}
|
|
1052
1053
|
},
|
|
1053
1054
|
emits: ["update:model-value"],
|
|
1054
|
-
setup(a, { emit:
|
|
1055
|
-
const
|
|
1056
|
-
const
|
|
1057
|
-
return
|
|
1055
|
+
setup(a, { emit: R }) {
|
|
1056
|
+
const f = a, i = R, l = M(() => {
|
|
1057
|
+
const b = ye[f.operator].safeParse(f.modelValue);
|
|
1058
|
+
return b.success ? [] : b.error.errors;
|
|
1058
1059
|
});
|
|
1059
|
-
return (
|
|
1060
|
-
var m, o, d, c,
|
|
1061
|
-
const
|
|
1060
|
+
return (b, t) => {
|
|
1061
|
+
var m, o, d, c, x, E;
|
|
1062
|
+
const s = g("FmTextField"), u = g("FmStepperField"), p = g("FmSimpleDatePicker"), y = g("FmSimpleDateRangePicker"), k = g("FmTimeRangePicker"), V = g("FmTimePicker"), S = g("FmHelperText");
|
|
1062
1063
|
return n(), F("div", {
|
|
1063
1064
|
class: L({ "pb-4": e(l).length })
|
|
1064
1065
|
}, [
|
|
1065
|
-
a.type === "text" ? (n(),
|
|
1066
|
+
a.type === "text" ? (n(), T(s, {
|
|
1066
1067
|
key: 0,
|
|
1067
1068
|
"model-value": a.modelValue,
|
|
1068
|
-
"onUpdate:modelValue": t[0] || (t[0] = (r) =>
|
|
1069
|
-
}, null, 8, ["model-value"])) : a.type === "number" ? (n(),
|
|
1069
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => i("update:model-value", r))
|
|
1070
|
+
}, null, 8, ["model-value"])) : a.type === "number" ? (n(), T(u, {
|
|
1070
1071
|
key: 1,
|
|
1071
1072
|
"model-value": a.modelValue,
|
|
1072
|
-
"onUpdate:modelValue": t[1] || (t[1] = (r) =>
|
|
1073
|
-
}, null, 8, ["model-value"])) : a.operator == "_isDay" ? (n(),
|
|
1073
|
+
"onUpdate:modelValue": t[1] || (t[1] = (r) => i("update:model-value", r))
|
|
1074
|
+
}, null, 8, ["model-value"])) : a.operator == "_isDay" ? (n(), T(ae(he), {
|
|
1074
1075
|
key: 2,
|
|
1075
1076
|
"model-value": a.modelValue,
|
|
1076
|
-
"onUpdate:modelValue": t[2] || (t[2] = (r) =>
|
|
1077
|
-
}, null, 8, ["model-value"])) : a.operator == "_isRange" ? (n(),
|
|
1077
|
+
"onUpdate:modelValue": t[2] || (t[2] = (r) => i("update:model-value", r))
|
|
1078
|
+
}, null, 8, ["model-value"])) : a.operator == "_isRange" ? (n(), T(ae(De), {
|
|
1078
1079
|
key: 3,
|
|
1079
1080
|
"model-value": a.modelValue,
|
|
1080
|
-
"onUpdate:modelValue": t[3] || (t[3] = (r) =>
|
|
1081
|
-
}, null, 8, ["model-value"])) : a.operator == "_isOnDate" ? (n(),
|
|
1081
|
+
"onUpdate:modelValue": t[3] || (t[3] = (r) => i("update:model-value", r))
|
|
1082
|
+
}, null, 8, ["model-value"])) : a.operator == "_isOnDate" ? (n(), T(p, {
|
|
1082
1083
|
key: 4,
|
|
1083
1084
|
"model-value": a.modelValue,
|
|
1084
|
-
"onUpdate:modelValue": t[4] || (t[4] = (r) =>
|
|
1085
|
-
}, null, 8, ["model-value"])) : a.operator == "_isBetween" ? (n(),
|
|
1085
|
+
"onUpdate:modelValue": t[4] || (t[4] = (r) => i("update:model-value", r))
|
|
1086
|
+
}, null, 8, ["model-value"])) : a.operator == "_isBetween" ? (n(), T(y, {
|
|
1086
1087
|
key: 5,
|
|
1087
1088
|
"model-value": {
|
|
1088
1089
|
startDate: (m = a.modelValue) == null ? void 0 : m.start,
|
|
1089
1090
|
endDate: (o = a.modelValue) == null ? void 0 : o.end
|
|
1090
1091
|
},
|
|
1091
1092
|
"onUpdate:modelValue": t[5] || (t[5] = (r) => {
|
|
1092
|
-
|
|
1093
|
+
i("update:model-value", {
|
|
1093
1094
|
start: r.startDate,
|
|
1094
1095
|
end: r.endDate
|
|
1095
1096
|
});
|
|
1096
1097
|
})
|
|
1097
|
-
}, null, 8, ["model-value"])) : a.operator == "_isInMonth" ? (n(),
|
|
1098
|
+
}, null, 8, ["model-value"])) : a.operator == "_isInMonth" ? (n(), T(Qe, {
|
|
1098
1099
|
key: 6,
|
|
1099
1100
|
"model-value": a.modelValue,
|
|
1100
|
-
"onUpdate:modelValue": t[6] || (t[6] = (r) =>
|
|
1101
|
-
}, null, 8, ["model-value"])) : a.operator == "_rrule" ? (n(),
|
|
1101
|
+
"onUpdate:modelValue": t[6] || (t[6] = (r) => i("update:model-value", r))
|
|
1102
|
+
}, null, 8, ["model-value"])) : a.operator == "_rrule" ? (n(), T(X, {
|
|
1102
1103
|
key: 7,
|
|
1103
1104
|
"model-value": a.modelValue,
|
|
1104
|
-
"onUpdate:modelValue": t[7] || (t[7] = (r) =>
|
|
1105
|
-
}, null, 8, ["model-value"])) : a.operator == "_isBetweenTime" ? (n(),
|
|
1105
|
+
"onUpdate:modelValue": t[7] || (t[7] = (r) => i("update:model-value", r))
|
|
1106
|
+
}, null, 8, ["model-value"])) : a.operator == "_isBetweenTime" ? (n(), T(k, {
|
|
1106
1107
|
key: 8,
|
|
1107
|
-
"model-value": [(c = (d = a.modelValue) == null ? void 0 : d[0]) == null ? void 0 : c.start, (E = (
|
|
1108
|
-
"onUpdate:modelValue": t[8] || (t[8] = (r) =>
|
|
1108
|
+
"model-value": [(c = (d = a.modelValue) == null ? void 0 : d[0]) == null ? void 0 : c.start, (E = (x = a.modelValue) == null ? void 0 : x[0]) == null ? void 0 : E.end],
|
|
1109
|
+
"onUpdate:modelValue": t[8] || (t[8] = (r) => i("update:model-value", [
|
|
1109
1110
|
{
|
|
1110
1111
|
start: r[0],
|
|
1111
1112
|
end: r[1]
|
|
1112
1113
|
}
|
|
1113
1114
|
]))
|
|
1114
|
-
}, null, 8, ["model-value"])) : a.operator == "_isOnTime" ? (n(),
|
|
1115
|
+
}, null, 8, ["model-value"])) : a.operator == "_isOnTime" ? (n(), T(V, {
|
|
1115
1116
|
key: 9,
|
|
1116
1117
|
"model-value": a.modelValue,
|
|
1117
|
-
"onUpdate:modelValue": t[9] || (t[9] = (r) =>
|
|
1118
|
-
}, null, 8, ["model-value"])) : a.type == "tier" ? (n(),
|
|
1118
|
+
"onUpdate:modelValue": t[9] || (t[9] = (r) => i("update:model-value", r))
|
|
1119
|
+
}, null, 8, ["model-value"])) : a.type == "tier" ? (n(), T(I, {
|
|
1119
1120
|
key: 10,
|
|
1120
|
-
items: (e(z)().sortedTiers ?? []).map((r,
|
|
1121
|
-
label: `Tier ${
|
|
1122
|
-
value:
|
|
1121
|
+
items: (e(z)().sortedTiers ?? []).map((r, q) => ({
|
|
1122
|
+
label: `Tier ${q + 1} - ${r.name}`,
|
|
1123
|
+
value: q + 1
|
|
1123
1124
|
})),
|
|
1124
1125
|
"model-value": a.modelValue,
|
|
1125
|
-
"onUpdate:modelValue": t[10] || (t[10] = (r) =>
|
|
1126
|
-
}, null, 8, ["items", "model-value"])) : a.type == "boolean" ? (n(),
|
|
1126
|
+
"onUpdate:modelValue": t[10] || (t[10] = (r) => i("update:model-value", r))
|
|
1127
|
+
}, null, 8, ["items", "model-value"])) : a.type == "boolean" ? (n(), T(I, {
|
|
1127
1128
|
key: 11,
|
|
1128
1129
|
multiselect: !0,
|
|
1129
1130
|
items: [
|
|
@@ -1131,8 +1132,8 @@ const Oe = [
|
|
|
1131
1132
|
{ label: "false", value: !1 }
|
|
1132
1133
|
],
|
|
1133
1134
|
"model-value": a.modelValue ?? [],
|
|
1134
|
-
"onUpdate:modelValue": t[11] || (t[11] = (r) =>
|
|
1135
|
-
}, null, 8, ["model-value"])) : a.type == "gender" ? (n(),
|
|
1135
|
+
"onUpdate:modelValue": t[11] || (t[11] = (r) => i("update:model-value", r))
|
|
1136
|
+
}, null, 8, ["model-value"])) : a.type == "gender" ? (n(), T(I, {
|
|
1136
1137
|
key: 12,
|
|
1137
1138
|
multiselect: !0,
|
|
1138
1139
|
items: [
|
|
@@ -1140,21 +1141,21 @@ const Oe = [
|
|
|
1140
1141
|
{ label: "Female", value: "FEMALE" }
|
|
1141
1142
|
],
|
|
1142
1143
|
"model-value": a.modelValue ?? [],
|
|
1143
|
-
"onUpdate:modelValue": t[12] || (t[12] = (r) =>
|
|
1144
|
-
}, null, 8, ["model-value"])) : a.type == "collectible" ? (n(),
|
|
1144
|
+
"onUpdate:modelValue": t[12] || (t[12] = (r) => i("update:model-value", r))
|
|
1145
|
+
}, null, 8, ["model-value"])) : a.type == "collectible" ? (n(), T(I, {
|
|
1145
1146
|
key: 13,
|
|
1146
1147
|
multiselect: !0,
|
|
1147
1148
|
items: [],
|
|
1148
1149
|
"model-value": a.modelValue ?? [],
|
|
1149
|
-
"onUpdate:modelValue": t[13] || (t[13] = (r) =>
|
|
1150
|
-
}, null, 8, ["model-value"])) : a.type == "segment" ? (n(),
|
|
1150
|
+
"onUpdate:modelValue": t[13] || (t[13] = (r) => i("update:model-value", r))
|
|
1151
|
+
}, null, 8, ["model-value"])) : a.type == "segment" ? (n(), T(I, {
|
|
1151
1152
|
key: 14,
|
|
1152
1153
|
multiselect: !0,
|
|
1153
1154
|
items: e(z)().segmentOptions,
|
|
1154
1155
|
"model-value": a.modelValue ?? [],
|
|
1155
|
-
"onUpdate:modelValue": t[14] || (t[14] = (r) =>
|
|
1156
|
+
"onUpdate:modelValue": t[14] || (t[14] = (r) => i("update:model-value", r)),
|
|
1156
1157
|
label: "Select segment(s) to match"
|
|
1157
|
-
}, null, 8, ["items", "model-value"])) : a.type == "title" ? (n(),
|
|
1158
|
+
}, null, 8, ["items", "model-value"])) : a.type == "title" ? (n(), T(I, {
|
|
1158
1159
|
key: 15,
|
|
1159
1160
|
multiselect: !0,
|
|
1160
1161
|
items: (e(z)().sortedTitles ?? []).map((r) => ({
|
|
@@ -1162,13 +1163,13 @@ const Oe = [
|
|
|
1162
1163
|
value: r._id
|
|
1163
1164
|
})),
|
|
1164
1165
|
"model-value": a.modelValue ?? [],
|
|
1165
|
-
"onUpdate:modelValue": t[15] || (t[15] = (r) =>
|
|
1166
|
-
}, null, 8, ["items", "model-value"])) : a.type == "product" ? (n(),
|
|
1166
|
+
"onUpdate:modelValue": t[15] || (t[15] = (r) => i("update:model-value", r))
|
|
1167
|
+
}, null, 8, ["items", "model-value"])) : a.type == "product" ? (n(), T(ut, {
|
|
1167
1168
|
key: 16,
|
|
1168
1169
|
"model-value": a.modelValue,
|
|
1169
|
-
"onUpdate:modelValue": t[16] || (t[16] = (r) =>
|
|
1170
|
-
}, null, 8, ["model-value"])) : (n(), F("div",
|
|
1171
|
-
|
|
1170
|
+
"onUpdate:modelValue": t[16] || (t[16] = (r) => i("update:model-value", r))
|
|
1171
|
+
}, null, 8, ["model-value"])) : (n(), F("div", st, "Rule Not implemented")),
|
|
1172
|
+
v(S, {
|
|
1172
1173
|
class: "items-end",
|
|
1173
1174
|
state: e(Z).helperState(e(l), ""),
|
|
1174
1175
|
text: e(Z).helperText(e(l), "")
|
|
@@ -1176,7 +1177,7 @@ const Oe = [
|
|
|
1176
1177
|
], 2);
|
|
1177
1178
|
};
|
|
1178
1179
|
}
|
|
1179
|
-
}),
|
|
1180
|
+
}), mt = { class: "space-y-4" }, dt = { class: "flex items-center gap-8" }, pt = { class: "flex items-center justify-end gap-8 pt-16 w-full" }, yt = /* @__PURE__ */ N({
|
|
1180
1181
|
__name: "CustomRuleDialog",
|
|
1181
1182
|
props: {
|
|
1182
1183
|
triggerType: {
|
|
@@ -1193,9 +1194,9 @@ const Oe = [
|
|
|
1193
1194
|
}
|
|
1194
1195
|
},
|
|
1195
1196
|
setup(a) {
|
|
1196
|
-
const
|
|
1197
|
-
() =>
|
|
1198
|
-
),
|
|
1197
|
+
const R = te(), f = z(), { emitData: i, emitAction: l } = se(), b = a, t = M(
|
|
1198
|
+
() => ce(b.triggerType, b.includeOnly)
|
|
1199
|
+
), s = (E) => ne[t.value.find((r) => r.property === E).type], u = M(() => {
|
|
1199
1200
|
if (!V.value) return [];
|
|
1200
1201
|
const E = t.value.find(
|
|
1201
1202
|
(r) => r.property === V.value.property
|
|
@@ -1204,30 +1205,30 @@ const Oe = [
|
|
|
1204
1205
|
label: Ee[r].name,
|
|
1205
1206
|
value: r
|
|
1206
1207
|
})) : [];
|
|
1207
|
-
}),
|
|
1208
|
-
const E =
|
|
1208
|
+
}), p = ve, y = M(() => {
|
|
1209
|
+
const E = p.safeParse(V.value);
|
|
1209
1210
|
return E.success ? [] : E.error.errors;
|
|
1210
1211
|
}), k = P(!1), V = P(
|
|
1211
|
-
le(
|
|
1212
|
+
le(b.modelValue) ?? D.constructEntry(
|
|
1212
1213
|
t.value[0].property,
|
|
1213
|
-
|
|
1214
|
+
s(t.value[0].property)[0],
|
|
1214
1215
|
null
|
|
1215
1216
|
)
|
|
1216
|
-
), S =
|
|
1217
|
+
), S = M(() => {
|
|
1217
1218
|
var W;
|
|
1218
|
-
const { property: E, negated: r, conditions:
|
|
1219
|
+
const { property: E, negated: r, conditions: q } = V.value, w = Object.keys(q || {})[0], $ = Object.values(q || {})[0];
|
|
1219
1220
|
return {
|
|
1220
1221
|
property: E,
|
|
1221
1222
|
negated: r == !0,
|
|
1222
1223
|
type: (W = t.value.find((G) => G.property === E)) == null ? void 0 : W.type,
|
|
1223
|
-
operator:
|
|
1224
|
-
equator:
|
|
1224
|
+
operator: w,
|
|
1225
|
+
equator: $
|
|
1225
1226
|
};
|
|
1226
1227
|
});
|
|
1227
1228
|
function m(E) {
|
|
1228
|
-
V.value =
|
|
1229
|
+
V.value = D.constructEntry(
|
|
1229
1230
|
E,
|
|
1230
|
-
|
|
1231
|
+
s(E)[0],
|
|
1231
1232
|
null
|
|
1232
1233
|
);
|
|
1233
1234
|
}
|
|
@@ -1245,50 +1246,50 @@ const Oe = [
|
|
|
1245
1246
|
[S.value.operator]: E
|
|
1246
1247
|
};
|
|
1247
1248
|
}
|
|
1248
|
-
function
|
|
1249
|
-
|
|
1249
|
+
function x() {
|
|
1250
|
+
i(V.value), l("primary"), R.close();
|
|
1250
1251
|
}
|
|
1251
1252
|
return ue(async () => {
|
|
1252
|
-
await
|
|
1253
|
+
await f.readMembership();
|
|
1253
1254
|
}), (E, r) => {
|
|
1254
|
-
const
|
|
1255
|
-
return n(), F("div",
|
|
1256
|
-
|
|
1257
|
-
|
|
1255
|
+
const q = g("FmIcon"), w = g("FmField"), $ = g("FmPill"), W = g("FmMenuItem"), G = g("FmMenu"), Q = g("FmButton");
|
|
1256
|
+
return n(), F("div", mt, [
|
|
1257
|
+
r[5] || (r[5] = U("div", { class: "fm-typo-en-body-lg-400" }, "Property", -1)),
|
|
1258
|
+
v(G, {
|
|
1258
1259
|
shift: !0,
|
|
1259
1260
|
placement: "top-start",
|
|
1260
1261
|
modelValue: e(k),
|
|
1261
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
1262
|
-
onMenuChanged: r[1] || (r[1] = (
|
|
1262
|
+
"onUpdate:modelValue": r[0] || (r[0] = (h) => me(k) ? k.value = h : null),
|
|
1263
|
+
onMenuChanged: r[1] || (r[1] = (h) => k.value = h)
|
|
1263
1264
|
}, {
|
|
1264
|
-
"menu-button":
|
|
1265
|
-
|
|
1266
|
-
append:
|
|
1267
|
-
|
|
1265
|
+
"menu-button": B(() => [
|
|
1266
|
+
v(w, null, {
|
|
1267
|
+
append: B(() => [
|
|
1268
|
+
v(q, {
|
|
1268
1269
|
name: e(k) ? "expand_less" : "expand_more"
|
|
1269
1270
|
}, null, 8, ["name"])
|
|
1270
1271
|
]),
|
|
1271
|
-
default:
|
|
1272
|
-
var
|
|
1272
|
+
default: B(() => {
|
|
1273
|
+
var h;
|
|
1273
1274
|
return [
|
|
1274
|
-
ee(j((
|
|
1275
|
+
ee(j((h = e(t).find((C) => C.property == e(V).property)) == null ? void 0 : h.name) + " ", 1)
|
|
1275
1276
|
];
|
|
1276
1277
|
}),
|
|
1277
1278
|
_: 1
|
|
1278
1279
|
})
|
|
1279
1280
|
]),
|
|
1280
|
-
default:
|
|
1281
|
-
(n(!0), F(Y, null,
|
|
1282
|
-
key:
|
|
1283
|
-
"model-value": e(V).property ==
|
|
1284
|
-
label:
|
|
1285
|
-
disabled:
|
|
1286
|
-
onClick: (
|
|
1281
|
+
default: B(() => [
|
|
1282
|
+
(n(!0), F(Y, null, A(e(t), (h) => (n(), T(W, {
|
|
1283
|
+
key: h.property,
|
|
1284
|
+
"model-value": e(V).property == h.property,
|
|
1285
|
+
label: h.name,
|
|
1286
|
+
disabled: h.premium && !e(re)().isPremium,
|
|
1287
|
+
onClick: (C) => h.premium && !e(re)().isPremium ? null : m(h.property)
|
|
1287
1288
|
}, de({ _: 2 }, [
|
|
1288
|
-
|
|
1289
|
+
h.premium ? {
|
|
1289
1290
|
name: "append",
|
|
1290
|
-
fn:
|
|
1291
|
-
|
|
1291
|
+
fn: B(() => [
|
|
1292
|
+
v($, { variant: "premium" })
|
|
1292
1293
|
]),
|
|
1293
1294
|
key: "0"
|
|
1294
1295
|
} : void 0
|
|
@@ -1296,9 +1297,9 @@ const Oe = [
|
|
|
1296
1297
|
]),
|
|
1297
1298
|
_: 1
|
|
1298
1299
|
}, 8, ["modelValue"]),
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1300
|
+
r[6] || (r[6] = U("div", { class: "fm-typo-en-body-lg-400" }, "Check to perform", -1)),
|
|
1301
|
+
U("div", dt, [
|
|
1302
|
+
v(I, {
|
|
1302
1303
|
class: "w-1/4",
|
|
1303
1304
|
items: [
|
|
1304
1305
|
{ label: "is", value: !1 },
|
|
@@ -1307,39 +1308,39 @@ const Oe = [
|
|
|
1307
1308
|
"model-value": e(V).negated ?? !1,
|
|
1308
1309
|
"onUpdate:modelValue": o
|
|
1309
1310
|
}, null, 8, ["model-value"]),
|
|
1310
|
-
|
|
1311
|
+
v(I, {
|
|
1311
1312
|
class: "flex-1",
|
|
1312
1313
|
items: e(u),
|
|
1313
1314
|
"model-value": e(S).operator,
|
|
1314
1315
|
"onUpdate:modelValue": d
|
|
1315
1316
|
}, null, 8, ["items", "model-value"])
|
|
1316
1317
|
]),
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
e(S).type ? (n(),
|
|
1318
|
+
U("div", null, [
|
|
1319
|
+
r[4] || (r[4] = U("div", { class: "fm-typo-en-body-lg-400" }, "Criteria", -1)),
|
|
1320
|
+
e(S).type ? (n(), T(it, {
|
|
1320
1321
|
key: 0,
|
|
1321
1322
|
type: e(S).type,
|
|
1322
1323
|
operator: e(S).operator,
|
|
1323
1324
|
"model-value": e(S).equator,
|
|
1324
1325
|
"onUpdate:modelValue": c
|
|
1325
|
-
}, null, 8, ["type", "operator", "model-value"])) :
|
|
1326
|
+
}, null, 8, ["type", "operator", "model-value"])) : _("", !0)
|
|
1326
1327
|
]),
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
onClick: r[2] || (r[2] = (
|
|
1328
|
+
U("div", pt, [
|
|
1329
|
+
v(Q, {
|
|
1330
|
+
onClick: r[2] || (r[2] = (h) => e(R).close()),
|
|
1330
1331
|
label: "Cancel",
|
|
1331
1332
|
variant: "tertiary"
|
|
1332
1333
|
}),
|
|
1333
|
-
|
|
1334
|
-
onClick: r[3] || (r[3] = (
|
|
1335
|
-
disabled: e(
|
|
1334
|
+
v(Q, {
|
|
1335
|
+
onClick: r[3] || (r[3] = (h) => x()),
|
|
1336
|
+
disabled: e(y).length > 0,
|
|
1336
1337
|
label: "Save"
|
|
1337
1338
|
}, null, 8, ["disabled"])
|
|
1338
1339
|
])
|
|
1339
1340
|
]);
|
|
1340
1341
|
};
|
|
1341
1342
|
}
|
|
1342
|
-
}),
|
|
1343
|
+
}), ct = { class: "flex flex-col gap-8" }, vt = { class: "grid grid-cols-2 items-center" }, ft = { class: "flex items-center gap-8" }, bt = { class: "pt-16 flex items-center self-end gap-8" }, gt = /* @__PURE__ */ N({
|
|
1343
1344
|
__name: "PresetRuleDialog",
|
|
1344
1345
|
props: {
|
|
1345
1346
|
preset: {
|
|
@@ -1351,10 +1352,10 @@ const Oe = [
|
|
|
1351
1352
|
}
|
|
1352
1353
|
},
|
|
1353
1354
|
setup(a) {
|
|
1354
|
-
const
|
|
1355
|
+
const R = te(), { emitData: f, emitAction: i } = se(), l = z(), b = a;
|
|
1355
1356
|
function t() {
|
|
1356
|
-
const { operator: S, equator: m } =
|
|
1357
|
-
switch (
|
|
1357
|
+
const { operator: S, equator: m } = p.value;
|
|
1358
|
+
switch (b.preset) {
|
|
1358
1359
|
case "MIN_SPEND":
|
|
1359
1360
|
case "SPECIFIC_DATE":
|
|
1360
1361
|
case "SPECIFIC_TIMERANGE":
|
|
@@ -1365,55 +1366,55 @@ const Oe = [
|
|
|
1365
1366
|
return `Applies to ${l.sortedTiers.filter((d, c) => S == "_equal" ? c + 1 == m : S == "_moreThanOrEqual" ? c + 1 >= m : c + 1 <= m).map((d) => d.name).join(", ")}`;
|
|
1366
1367
|
}
|
|
1367
1368
|
}
|
|
1368
|
-
function
|
|
1369
|
+
function s() {
|
|
1369
1370
|
var S, m;
|
|
1370
|
-
switch (
|
|
1371
|
+
switch (b.preset) {
|
|
1371
1372
|
case "MIN_SPEND":
|
|
1372
|
-
return
|
|
1373
|
+
return D.constructEntry("bill.amount", "_moreThanOrEqual", 0);
|
|
1373
1374
|
case "SPECIFIC_DATE":
|
|
1374
|
-
return
|
|
1375
|
+
return D.constructEntry("trigger.date", "_isOnDate", "");
|
|
1375
1376
|
case "SPECIFIC_TIMERANGE":
|
|
1376
|
-
return
|
|
1377
|
+
return D.constructEntry("trigger.time", "_isBetweenTime", [
|
|
1377
1378
|
{ start: "00:00", end: "23:59" }
|
|
1378
1379
|
]);
|
|
1379
1380
|
case "WEEKLY":
|
|
1380
|
-
return
|
|
1381
|
+
return D.constructEntry(
|
|
1381
1382
|
"trigger.date",
|
|
1382
1383
|
"_rrule",
|
|
1383
1384
|
"RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=SU;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
1384
1385
|
);
|
|
1385
1386
|
case "MONTHLY":
|
|
1386
|
-
return
|
|
1387
|
+
return D.constructEntry(
|
|
1387
1388
|
"trigger.date",
|
|
1388
1389
|
"_rrule",
|
|
1389
1390
|
"RRULE:FREQ=MONTHLY;WKST=SU;BYMONTHDAY=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
1390
1391
|
);
|
|
1391
1392
|
case "BIRTHDAY":
|
|
1392
|
-
return
|
|
1393
|
+
return D.constructEntry("user.birthday", "_isDay", {
|
|
1393
1394
|
op: "after",
|
|
1394
1395
|
x: 1,
|
|
1395
1396
|
ignoreYear: !0
|
|
1396
1397
|
});
|
|
1397
1398
|
case "TIER":
|
|
1398
|
-
return
|
|
1399
|
+
return D.constructEntry("user.tier", "_equal", 1);
|
|
1399
1400
|
case "TITLE":
|
|
1400
|
-
return
|
|
1401
|
+
return D.constructEntry("user.titles", "_hasAny", [
|
|
1401
1402
|
(m = (S = l.sortedTitles) == null ? void 0 : S[0]) == null ? void 0 : m._id
|
|
1402
1403
|
]);
|
|
1403
1404
|
case "CUSTOM":
|
|
1404
1405
|
throw new Error("Not implemented");
|
|
1405
1406
|
}
|
|
1406
1407
|
}
|
|
1407
|
-
const u = P(
|
|
1408
|
-
const S =
|
|
1408
|
+
const u = P(s()), p = M(() => {
|
|
1409
|
+
const S = D.simplify(u.value);
|
|
1409
1410
|
return {
|
|
1410
1411
|
...S,
|
|
1411
1412
|
equator: S.equator
|
|
1412
1413
|
};
|
|
1413
1414
|
});
|
|
1414
|
-
function
|
|
1415
|
-
const o =
|
|
1416
|
-
u.value =
|
|
1415
|
+
function y(S, m) {
|
|
1416
|
+
const o = p.value;
|
|
1417
|
+
u.value = D.constructEntry(
|
|
1417
1418
|
o.property,
|
|
1418
1419
|
m ?? o.operator,
|
|
1419
1420
|
S,
|
|
@@ -1421,58 +1422,58 @@ const Oe = [
|
|
|
1421
1422
|
);
|
|
1422
1423
|
}
|
|
1423
1424
|
function k() {
|
|
1424
|
-
|
|
1425
|
+
f(u.value), i("primary"), R.close();
|
|
1425
1426
|
}
|
|
1426
|
-
const V =
|
|
1427
|
+
const V = M(() => {
|
|
1427
1428
|
const S = fe.safeParse(u.value);
|
|
1428
1429
|
return S.success ? [] : S.error.errors;
|
|
1429
1430
|
});
|
|
1430
1431
|
return ue(async () => {
|
|
1431
1432
|
await l.readMembership();
|
|
1432
1433
|
}), (S, m) => {
|
|
1433
|
-
var
|
|
1434
|
-
const o = g("FmStepperField"), d = g("FmDatePicker"), c = g("FmTimeRangePicker"),
|
|
1435
|
-
return n(), F("div",
|
|
1436
|
-
a.preset == "MIN_SPEND" ? (n(),
|
|
1434
|
+
var $, W, G, Q, h;
|
|
1435
|
+
const o = g("FmStepperField"), d = g("FmDatePicker"), c = g("FmTimeRangePicker"), x = g("FmRadio"), E = g("FmSelect"), r = g("FmRadioGroup"), q = g("FmHelperText"), w = g("FmButton");
|
|
1436
|
+
return n(), F("div", ct, [
|
|
1437
|
+
a.preset == "MIN_SPEND" ? (n(), T(o, {
|
|
1437
1438
|
key: 0,
|
|
1438
1439
|
label: "Minimum spend",
|
|
1439
|
-
"model-value": e(
|
|
1440
|
-
"onUpdate:modelValue": m[0] || (m[0] = (
|
|
1441
|
-
}, null, 8, ["model-value"])) : a.preset == "SPECIFIC_DATE" ? (n(),
|
|
1440
|
+
"model-value": e(p).equator,
|
|
1441
|
+
"onUpdate:modelValue": m[0] || (m[0] = (C) => y(C))
|
|
1442
|
+
}, null, 8, ["model-value"])) : a.preset == "SPECIFIC_DATE" ? (n(), T(d, {
|
|
1442
1443
|
key: 1,
|
|
1443
1444
|
label: "Specific Date",
|
|
1444
|
-
"model-value": e(
|
|
1445
|
-
"onUpdate:modelValue": m[1] || (m[1] = (
|
|
1446
|
-
}, null, 8, ["model-value"])) : a.preset == "SPECIFIC_TIMERANGE" ? (n(),
|
|
1445
|
+
"model-value": e(p).equator,
|
|
1446
|
+
"onUpdate:modelValue": m[1] || (m[1] = (C) => y(C))
|
|
1447
|
+
}, null, 8, ["model-value"])) : a.preset == "SPECIFIC_TIMERANGE" ? (n(), T(c, {
|
|
1447
1448
|
key: 2,
|
|
1448
1449
|
label: "Time is between",
|
|
1449
|
-
"model-value": [(W = (
|
|
1450
|
-
"onUpdate:modelValue": m[2] || (m[2] = (
|
|
1450
|
+
"model-value": [(W = ($ = e(p).equator) == null ? void 0 : $[0]) == null ? void 0 : W.start, (Q = (G = e(p).equator) == null ? void 0 : G[0]) == null ? void 0 : Q.end],
|
|
1451
|
+
"onUpdate:modelValue": m[2] || (m[2] = (C) => y([
|
|
1451
1452
|
{
|
|
1452
|
-
start:
|
|
1453
|
-
end:
|
|
1453
|
+
start: C[0],
|
|
1454
|
+
end: C[1]
|
|
1454
1455
|
}
|
|
1455
1456
|
]))
|
|
1456
|
-
}, null, 8, ["model-value"])) : a.preset == "WEEKLY" ? (n(),
|
|
1457
|
+
}, null, 8, ["model-value"])) : a.preset == "WEEKLY" ? (n(), T(X, {
|
|
1457
1458
|
key: 3,
|
|
1458
1459
|
label: "Weekly",
|
|
1459
1460
|
"fixed-frequency": !0,
|
|
1460
|
-
"model-value": e(
|
|
1461
|
-
"onUpdate:modelValue": m[3] || (m[3] = (
|
|
1462
|
-
}, null, 8, ["model-value"])) : a.preset == "MONTHLY" ? (n(),
|
|
1461
|
+
"model-value": e(p).equator,
|
|
1462
|
+
"onUpdate:modelValue": m[3] || (m[3] = (C) => y(C))
|
|
1463
|
+
}, null, 8, ["model-value"])) : a.preset == "MONTHLY" ? (n(), T(X, {
|
|
1463
1464
|
key: 4,
|
|
1464
1465
|
label: "Weekly",
|
|
1465
1466
|
"fixed-frequency": !0,
|
|
1466
|
-
"model-value": e(
|
|
1467
|
-
"onUpdate:modelValue": m[4] || (m[4] = (
|
|
1467
|
+
"model-value": e(p).equator,
|
|
1468
|
+
"onUpdate:modelValue": m[4] || (m[4] = (C) => y(C))
|
|
1468
1469
|
}, null, 8, ["model-value"])) : a.preset == "BIRTHDAY" ? (n(), F(Y, { key: 5 }, [
|
|
1469
|
-
|
|
1470
|
-
|
|
1470
|
+
U("div", vt, [
|
|
1471
|
+
v(x, {
|
|
1471
1472
|
label: "N days before birthday",
|
|
1472
1473
|
value: "_isDay",
|
|
1473
|
-
"model-value": e(
|
|
1474
|
+
"model-value": e(p).operator,
|
|
1474
1475
|
"onUpdate:modelValue": m[5] || (m[5] = () => {
|
|
1475
|
-
|
|
1476
|
+
y(
|
|
1476
1477
|
{
|
|
1477
1478
|
op: "after",
|
|
1478
1479
|
x: 1,
|
|
@@ -1482,13 +1483,13 @@ const Oe = [
|
|
|
1482
1483
|
);
|
|
1483
1484
|
})
|
|
1484
1485
|
}, null, 8, ["model-value"]),
|
|
1485
|
-
|
|
1486
|
-
|
|
1486
|
+
U("div", ft, [
|
|
1487
|
+
v(x, {
|
|
1487
1488
|
label: "Is in this",
|
|
1488
1489
|
value: "_isRange",
|
|
1489
|
-
"model-value": e(
|
|
1490
|
+
"model-value": e(p).operator,
|
|
1490
1491
|
"onUpdate:modelValue": m[6] || (m[6] = () => {
|
|
1491
|
-
|
|
1492
|
+
y(
|
|
1492
1493
|
{
|
|
1493
1494
|
op: "this",
|
|
1494
1495
|
unit: "day",
|
|
@@ -1498,88 +1499,88 @@ const Oe = [
|
|
|
1498
1499
|
);
|
|
1499
1500
|
})
|
|
1500
1501
|
}, null, 8, ["model-value"]),
|
|
1501
|
-
e(
|
|
1502
|
+
e(p).operator == "_isRange" ? (n(), T(E, {
|
|
1502
1503
|
key: 0,
|
|
1503
|
-
items: ["day", "week", "month"].map((
|
|
1504
|
-
"model-value": e(
|
|
1505
|
-
"onUpdate:modelValue": m[7] || (m[7] = (
|
|
1504
|
+
items: ["day", "week", "month"].map((C) => ({ label: C, value: C })),
|
|
1505
|
+
"model-value": e(p).equator.unit,
|
|
1506
|
+
"onUpdate:modelValue": m[7] || (m[7] = (C) => y(
|
|
1506
1507
|
{
|
|
1507
1508
|
op: "this",
|
|
1508
|
-
unit:
|
|
1509
|
+
unit: C,
|
|
1509
1510
|
ignoreYear: !0
|
|
1510
1511
|
},
|
|
1511
1512
|
"_isRange"
|
|
1512
1513
|
))
|
|
1513
|
-
}, null, 8, ["items", "model-value"])) :
|
|
1514
|
+
}, null, 8, ["items", "model-value"])) : _("", !0)
|
|
1514
1515
|
])
|
|
1515
1516
|
]),
|
|
1516
|
-
e(
|
|
1517
|
+
e(p).operator == "_isDay" ? (n(), T(o, {
|
|
1517
1518
|
key: 0,
|
|
1518
1519
|
label: "Days before birthday",
|
|
1519
1520
|
"show-steppers": !1,
|
|
1520
|
-
"model-value": e(
|
|
1521
|
-
"onUpdate:modelValue": m[8] || (m[8] = (
|
|
1521
|
+
"model-value": e(p).equator.x,
|
|
1522
|
+
"onUpdate:modelValue": m[8] || (m[8] = (C) => y({
|
|
1522
1523
|
op: "after",
|
|
1523
|
-
x:
|
|
1524
|
+
x: C,
|
|
1524
1525
|
ignoreYear: !0
|
|
1525
1526
|
}))
|
|
1526
|
-
}, null, 8, ["model-value"])) :
|
|
1527
|
+
}, null, 8, ["model-value"])) : _("", !0)
|
|
1527
1528
|
], 64)) : a.preset == "TIER" ? (n(), F(Y, { key: 6 }, [
|
|
1528
|
-
|
|
1529
|
+
v(r, {
|
|
1529
1530
|
inline: !0,
|
|
1530
|
-
"model-value": e(
|
|
1531
|
-
"onUpdate:modelValue": m[9] || (m[9] = (
|
|
1531
|
+
"model-value": e(p).operator,
|
|
1532
|
+
"onUpdate:modelValue": m[9] || (m[9] = (C) => y(e(p).equator, C))
|
|
1532
1533
|
}, {
|
|
1533
|
-
default:
|
|
1534
|
-
|
|
1534
|
+
default: B(() => [
|
|
1535
|
+
v(x, {
|
|
1535
1536
|
value: "_moreThanOrEqual",
|
|
1536
1537
|
label: "At least"
|
|
1537
1538
|
}),
|
|
1538
|
-
|
|
1539
|
+
v(x, {
|
|
1539
1540
|
value: "_equal",
|
|
1540
1541
|
label: "Equal"
|
|
1541
1542
|
}),
|
|
1542
|
-
|
|
1543
|
+
v(x, {
|
|
1543
1544
|
value: "_lessThanOrEqual",
|
|
1544
1545
|
label: "At most"
|
|
1545
1546
|
})
|
|
1546
1547
|
]),
|
|
1547
1548
|
_: 1
|
|
1548
1549
|
}, 8, ["model-value"]),
|
|
1549
|
-
|
|
1550
|
-
items: (e(l).sortedTiers ?? []).map((
|
|
1551
|
-
label: `Tier ${oe + 1} - ${
|
|
1550
|
+
v(I, {
|
|
1551
|
+
items: (e(l).sortedTiers ?? []).map((C, oe) => ({
|
|
1552
|
+
label: `Tier ${oe + 1} - ${C.name}`,
|
|
1552
1553
|
value: oe + 1
|
|
1553
1554
|
})),
|
|
1554
|
-
"model-value": e(
|
|
1555
|
-
"onUpdate:modelValue": m[10] || (m[10] = (
|
|
1555
|
+
"model-value": e(p).equator,
|
|
1556
|
+
"onUpdate:modelValue": m[10] || (m[10] = (C) => y(C))
|
|
1556
1557
|
}, null, 8, ["items", "model-value"]),
|
|
1557
|
-
|
|
1558
|
+
v(q, {
|
|
1558
1559
|
text: t()
|
|
1559
1560
|
}, null, 8, ["text"])
|
|
1560
|
-
], 64)) : a.preset == "TITLE" ? (n(),
|
|
1561
|
+
], 64)) : a.preset == "TITLE" ? (n(), T(I, {
|
|
1561
1562
|
key: 7,
|
|
1562
1563
|
label: "User has title",
|
|
1563
|
-
items: (e(l).sortedTitles ?? []).map((
|
|
1564
|
-
label:
|
|
1565
|
-
value:
|
|
1564
|
+
items: (e(l).sortedTitles ?? []).map((C) => ({
|
|
1565
|
+
label: C.name,
|
|
1566
|
+
value: C._id
|
|
1566
1567
|
})),
|
|
1567
|
-
"model-value": (
|
|
1568
|
-
"onUpdate:modelValue": m[11] || (m[11] = (
|
|
1569
|
-
}, null, 8, ["items", "model-value"])) :
|
|
1570
|
-
|
|
1568
|
+
"model-value": (h = e(p).equator) == null ? void 0 : h[0],
|
|
1569
|
+
"onUpdate:modelValue": m[11] || (m[11] = (C) => y([C]))
|
|
1570
|
+
}, null, 8, ["items", "model-value"])) : _("", !0),
|
|
1571
|
+
v(q, {
|
|
1571
1572
|
class: "mt-[-8px]",
|
|
1572
1573
|
text: e(Z).helperText(e(V), ""),
|
|
1573
1574
|
state: e(Z).helperState(e(V), "")
|
|
1574
1575
|
}, null, 8, ["text", "state"]),
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
onClick: m[12] || (m[12] = (
|
|
1576
|
+
U("div", bt, [
|
|
1577
|
+
v(w, {
|
|
1578
|
+
onClick: m[12] || (m[12] = (C) => e(R).close()),
|
|
1578
1579
|
label: "Cancel",
|
|
1579
1580
|
variant: "tertiary"
|
|
1580
1581
|
}),
|
|
1581
|
-
|
|
1582
|
-
onClick: m[13] || (m[13] = (
|
|
1582
|
+
v(w, {
|
|
1583
|
+
onClick: m[13] || (m[13] = (C) => k()),
|
|
1583
1584
|
disabled: e(V).length > 0,
|
|
1584
1585
|
label: "Save"
|
|
1585
1586
|
}, null, 8, ["disabled"])
|
|
@@ -1587,7 +1588,7 @@ const Oe = [
|
|
|
1587
1588
|
]);
|
|
1588
1589
|
};
|
|
1589
1590
|
}
|
|
1590
|
-
}),
|
|
1591
|
+
}), kt = /* @__PURE__ */ N({
|
|
1591
1592
|
__name: "RuleConfigurator",
|
|
1592
1593
|
props: {
|
|
1593
1594
|
triggerType: {
|
|
@@ -1604,52 +1605,52 @@ const Oe = [
|
|
|
1604
1605
|
}
|
|
1605
1606
|
},
|
|
1606
1607
|
emits: ["update:model-value"],
|
|
1607
|
-
setup(a, { expose:
|
|
1608
|
-
const
|
|
1609
|
-
function
|
|
1610
|
-
|
|
1611
|
-
title:
|
|
1608
|
+
setup(a, { expose: R, emit: f }) {
|
|
1609
|
+
const i = a, l = f, b = te(), t = P();
|
|
1610
|
+
function s(y) {
|
|
1611
|
+
b.open({
|
|
1612
|
+
title: y.name,
|
|
1612
1613
|
closeButton: !1,
|
|
1613
1614
|
dismissAway: !1,
|
|
1614
|
-
contentComponent:
|
|
1615
|
+
contentComponent: gt,
|
|
1615
1616
|
contentComponentProps: {
|
|
1616
|
-
preset:
|
|
1617
|
-
modelValue:
|
|
1617
|
+
preset: y.type,
|
|
1618
|
+
modelValue: i.modelValue
|
|
1618
1619
|
}
|
|
1619
1620
|
}).onPrimary((k) => l("update:model-value", k));
|
|
1620
1621
|
}
|
|
1621
|
-
function u(
|
|
1622
|
-
|
|
1622
|
+
function u(y) {
|
|
1623
|
+
b.open({
|
|
1623
1624
|
title: "Edit rule",
|
|
1624
1625
|
closeButton: !1,
|
|
1625
1626
|
dismissAway: !1,
|
|
1626
|
-
contentComponent:
|
|
1627
|
+
contentComponent: yt,
|
|
1627
1628
|
contentComponentProps: {
|
|
1628
|
-
triggerType:
|
|
1629
|
-
includeOnly:
|
|
1630
|
-
modelValue:
|
|
1629
|
+
triggerType: i.triggerType,
|
|
1630
|
+
includeOnly: i.includeOnly,
|
|
1631
|
+
modelValue: y
|
|
1631
1632
|
}
|
|
1632
1633
|
}).onPrimary((k) => l("update:model-value", k));
|
|
1633
1634
|
}
|
|
1634
|
-
function
|
|
1635
|
-
if (
|
|
1636
|
-
const [k] =
|
|
1635
|
+
function p(y) {
|
|
1636
|
+
if (y.type == "CUSTOM") {
|
|
1637
|
+
const [k] = y.rules;
|
|
1637
1638
|
return u(
|
|
1638
|
-
|
|
1639
|
+
D.constructEntry(k.property, k.operator, k.equator)
|
|
1639
1640
|
);
|
|
1640
1641
|
}
|
|
1641
|
-
return
|
|
1642
|
+
return s(y);
|
|
1642
1643
|
}
|
|
1643
|
-
return
|
|
1644
|
+
return R({
|
|
1644
1645
|
showCustomDialog: u
|
|
1645
|
-
}), (
|
|
1646
|
+
}), (y, k) => {
|
|
1646
1647
|
const V = g("FmButton"), S = g("FmMenuItem"), m = g("FmMenu");
|
|
1647
|
-
return n(),
|
|
1648
|
+
return n(), T(m, {
|
|
1648
1649
|
shift: !0,
|
|
1649
1650
|
placement: "top-start"
|
|
1650
1651
|
}, {
|
|
1651
|
-
"menu-button":
|
|
1652
|
-
|
|
1652
|
+
"menu-button": B(() => [
|
|
1653
|
+
v(V, {
|
|
1653
1654
|
label: "Add condition",
|
|
1654
1655
|
icon: "add",
|
|
1655
1656
|
class: "text-fm-color-primary border-fm-color-primary",
|
|
@@ -1657,21 +1658,21 @@ const Oe = [
|
|
|
1657
1658
|
variant: "secondary"
|
|
1658
1659
|
})
|
|
1659
1660
|
]),
|
|
1660
|
-
default:
|
|
1661
|
-
(n(!0), F(Y, null,
|
|
1661
|
+
default: B(() => [
|
|
1662
|
+
(n(!0), F(Y, null, A(e(Oe).filter(
|
|
1662
1663
|
(o) => !a.includeOnly || o.for.includes(a.includeOnly)
|
|
1663
|
-
), (o) => (n(),
|
|
1664
|
+
), (o) => (n(), T(S, {
|
|
1664
1665
|
key: o.name,
|
|
1665
1666
|
"model-value": o.name == e(t),
|
|
1666
1667
|
label: o.name,
|
|
1667
|
-
onClick: (d) =>
|
|
1668
|
+
onClick: (d) => p(o)
|
|
1668
1669
|
}, null, 8, ["model-value", "label", "onClick"]))), 128))
|
|
1669
1670
|
]),
|
|
1670
1671
|
_: 1
|
|
1671
1672
|
});
|
|
1672
1673
|
};
|
|
1673
1674
|
}
|
|
1674
|
-
}),
|
|
1675
|
+
}), Nt = /* @__PURE__ */ N({
|
|
1675
1676
|
__name: "RuleGroup",
|
|
1676
1677
|
props: {
|
|
1677
1678
|
triggerType: {
|
|
@@ -1686,46 +1687,46 @@ const Oe = [
|
|
|
1686
1687
|
}
|
|
1687
1688
|
},
|
|
1688
1689
|
emits: ["update:model-value"],
|
|
1689
|
-
setup(a, { emit:
|
|
1690
|
-
const
|
|
1691
|
-
() =>
|
|
1692
|
-
),
|
|
1693
|
-
return (
|
|
1694
|
-
const
|
|
1695
|
-
return n(),
|
|
1696
|
-
default:
|
|
1697
|
-
y
|
|
1698
|
-
default:
|
|
1699
|
-
|
|
1700
|
-
|
|
1690
|
+
setup(a, { emit: R }) {
|
|
1691
|
+
const f = a, i = R, l = M(
|
|
1692
|
+
() => f.modelValue ?? D.scaffoldGroup()
|
|
1693
|
+
), b = M(() => D.getLogic(l.value)), t = P();
|
|
1694
|
+
return (s, u) => {
|
|
1695
|
+
const p = g("FmButtonGroup"), y = g("FmCard");
|
|
1696
|
+
return n(), T(y, { variant: "outlined" }, {
|
|
1697
|
+
default: B(() => [
|
|
1698
|
+
v(y, { class: "border-l-4 border-fm-color-primary p-16 space-y-16" }, {
|
|
1699
|
+
default: B(() => [
|
|
1700
|
+
u[3] || (u[3] = U("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " When ", -1)),
|
|
1701
|
+
v(kt, {
|
|
1701
1702
|
ref_key: "configuratorRef",
|
|
1702
1703
|
ref: t,
|
|
1703
1704
|
"include-only": a.includeOnly,
|
|
1704
1705
|
"trigger-type": a.triggerType,
|
|
1705
|
-
"onUpdate:modelValue": u[0] || (u[0] = (k) =>
|
|
1706
|
+
"onUpdate:modelValue": u[0] || (u[0] = (k) => i("update:model-value", e(D).setRuleToGroup(e(l), k)))
|
|
1706
1707
|
}, null, 8, ["include-only", "trigger-type"]),
|
|
1707
|
-
(n(!0), F(Y, null,
|
|
1708
|
+
(n(!0), F(Y, null, A(e(l).rules, (k, V) => {
|
|
1708
1709
|
var S;
|
|
1709
1710
|
return n(), F(Y, null, [
|
|
1710
|
-
e(be)(k) ? (n(),
|
|
1711
|
+
e(be)(k) ? (n(), T(Re, {
|
|
1711
1712
|
"model-value": k,
|
|
1712
1713
|
key: V,
|
|
1713
1714
|
onEdit: (S = e(t)) == null ? void 0 : S.showCustomDialog,
|
|
1714
1715
|
onRemove: u[1] || (u[1] = (m) => {
|
|
1715
|
-
|
|
1716
|
+
i(
|
|
1716
1717
|
"update:model-value",
|
|
1717
|
-
e(
|
|
1718
|
+
e(D).removeEntry(e(l), m.name)
|
|
1718
1719
|
);
|
|
1719
1720
|
})
|
|
1720
|
-
}, null, 8, ["model-value", "onEdit"])) :
|
|
1721
|
-
|
|
1721
|
+
}, null, 8, ["model-value", "onEdit"])) : _("", !0),
|
|
1722
|
+
v(p, {
|
|
1722
1723
|
class: "w-[200px]",
|
|
1723
1724
|
disabled: Object.keys(e(l).rules).length < 2,
|
|
1724
1725
|
items: [{ label: "And" }, { label: "Or" }],
|
|
1725
|
-
"model-value": e(
|
|
1726
|
-
"onUpdate:modelValue": u[2] || (u[2] = (m) =>
|
|
1726
|
+
"model-value": e(b) === "&&" ? { label: "And" } : { label: "Or" },
|
|
1727
|
+
"onUpdate:modelValue": u[2] || (u[2] = (m) => i(
|
|
1727
1728
|
"update:model-value",
|
|
1728
|
-
e(
|
|
1729
|
+
e(D).setRuleToGroup(
|
|
1729
1730
|
e(l),
|
|
1730
1731
|
[],
|
|
1731
1732
|
m.label === "And" ? "&&" : "||"
|
|
@@ -1744,7 +1745,7 @@ const Oe = [
|
|
|
1744
1745
|
}
|
|
1745
1746
|
});
|
|
1746
1747
|
export {
|
|
1747
|
-
|
|
1748
|
+
Nt as _,
|
|
1748
1749
|
X as a,
|
|
1749
|
-
|
|
1750
|
+
lt as b
|
|
1750
1751
|
};
|