@feedmepos/mf-connect 0.1.87-prod → 0.1.89-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Analytic-B9s-dPCT.js → Analytic-Caz3AQQ2.js} +11 -11
- package/dist/{App-Bu9NaLJ4.js → App-D_q4nHiY.js} +7 -7
- package/dist/{Bin-BUUuvk8j.js → Bin-DURa0qe2.js} +8 -8
- package/dist/{Broadcast-VvFRuN2K.js → Broadcast-ByDjXqap.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CgA2btmM.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BD8mWUzO.js} +7 -7
- package/dist/{Card--OD7WD_W.js → Card-BSSzVrbz.js} +19 -19
- package/dist/{Collections-DemrIeUs.js → Collections-CTwUl8W3.js} +8 -8
- package/dist/{Credit-PFNGAhPj.js → Credit-TgZBmYsM.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DyuJDS7x.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DZV3JtDl.js} +33 -33
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BLjGHozS.js → EffectSheet.vue_vue_type_style_index_0_lang-BwOs5NHt.js} +6 -6
- package/dist/{Experience-BCVsnWYw.js → Experience-DUCO6do6.js} +8 -8
- package/dist/{FileSaver.min-BMBGjHQ2.js → FileSaver.min-BaCfYtPG.js} +1 -1
- package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
- package/dist/{Game-B3Gxv2v-.js → Game-DcwQSCjZ.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CyMgFI2D.js → ImageInput.vue_vue_type_script_setup_true_lang-BSMwEFqp.js} +1 -1
- package/dist/{Index-R4XrhBHJ.js → Index-Bp2CKHw3.js} +10 -10
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DjpZnU4y.js → LottieAnimation.vue_vue_type_script_setup_true_lang-WWVHvcOU.js} +1 -1
- package/dist/{MainLayout-Cd8eCkPV.js → MainLayout-Q_0POZ4I.js} +1 -1
- package/dist/{Marketing-BzBEJgtQ.js → Marketing-D52IYXPR.js} +6 -6
- package/dist/{Member-CTFEe38e.js → Member-sxjxhLwQ.js} +12 -12
- package/dist/{MemberList-oL4hRjbk.js → MemberList-vLNFHNRw.js} +27 -27
- package/dist/{MemberTransactions-CUzzrl_F.js → MemberTransactions-BeHeN0Rk.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-D3X7vfMo.js → MessageInput.vue_vue_type_script_setup_true_lang-B6cF0EC3.js} +9 -9
- package/dist/{Mission-C93sLLDp.js → Mission-CnJCjBhe.js} +9 -9
- package/dist/{Overview-CANS2hu-.js → Overview-B3jRs_Cg.js} +19 -19
- package/dist/{Point-D3Qk09Kr.js → Point-BldY5wb0.js} +8 -8
- package/dist/{Promotion-Dtd_dDh4.js → Promotion-CsGhqlY0.js} +9 -9
- package/dist/{Queue-bAOANEOe.js → Queue-CLa2pSXF.js} +11 -11
- package/dist/{Record-7Nsigxg9.js → Record-JbbAM6lI.js} +9 -9
- package/dist/{Reward-BCCSo5Ao.js → Reward-wgiBCIV3.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-sVQ2XtOZ.js → RewardGroup.vue_vue_type_script_setup_true_lang-DiNlpy7_.js} +12 -12
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-B3Ylb1vx.js +1889 -0
- package/dist/{Segment-BTtsXpEm.js → Segment-BQiZ51Wi.js} +25 -25
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Etmkc-3s.js → SelectItems.vue_vue_type_script_setup_true_lang-DbXFTjAN.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dc2_TQiF.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Be_kiAB6.js} +13 -13
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DS1MWUOc.js +226 -0
- package/dist/Setting-De1lCG6N.js +1989 -0
- package/dist/{SettingAdvertisements-D9Lhamel.js → SettingAdvertisements-OdDM05s7.js} +12 -12
- package/dist/{Store-VZ8appMT.js → Store-D1Q0wOXk.js} +289 -285
- package/dist/{StoreRewards-egMoq16P.js → StoreRewards-2Gdv7uu4.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Bh33_foI.js → StoreTransactions.vue_vue_type_script_setup_true_lang-NtxHf8HF.js} +20 -20
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BKzZIJkt.js +140 -0
- package/dist/{Tier-IQfhLdUW.js → Tier-DOnYGgah.js} +22 -22
- package/dist/{Title-DAhwskG_.js → Title-F4XJw6oN.js} +21 -21
- package/dist/{Transaction-DoYHMx8C.js → Transaction-Ws7kBZUE.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-B6SAfZCS.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BZb0EXgi.js} +6 -6
- package/dist/{Voucher-CjUzxTj9.js → Voucher-DX8MKz00.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DjwuuQOy.js → VoucherEditor.vue_vue_type_script_setup_true_lang-tUNn1vRE.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-905euk7D.js → ZodTextField.vue_vue_type_script_setup_true_lang-BvgIZlIh.js} +2 -2
- package/dist/{app-BQKaKSTN.js → app-C-nC9SMv.js} +368 -83
- package/dist/app.js +1 -1
- package/dist/{business-D-Y0xqsG.js → business-CrQ_qouH.js} +1 -1
- package/dist/{campaign-C4FU4mF-.js → campaign-CBRSag11.js} +8 -8
- package/dist/{campaign-BO_GMK22.js → campaign-shm1Nb7g.js} +1 -1
- package/dist/{campaign.enum-ME5t80SA.js → campaign.enum-C-p5_XEd.js} +1 -1
- package/dist/{campaign.fn-CpSdTR_Z.js → campaign.fn-BGzZfg1o.js} +185 -185
- package/dist/{collectible.enum-BJNC4deW.js → collectible.enum-DxOoBouZ.js} +1 -1
- package/dist/{collection.fn-BclOhIak.js → collection.fn-BKmv2KVW.js} +2 -2
- package/dist/{dto-CeKAIN4F.js → dto-BRQj35uX.js} +4 -4
- package/dist/{effect-C5coTG7j.js → effect-Bbc7QO26.js} +1 -1
- package/dist/{email-addresses-DdpDo4U3.js → email-addresses-CdmKczY8.js} +2 -2
- package/dist/{export-Cd7RMmWF.js → export-xWupGZRl.js} +3 -3
- package/dist/{helper-8QHPhfxd.js → helper-C_t7u0sc.js} +1 -1
- package/dist/{index-D8LAuyy5.js → index-BHwWZLKa.js} +2 -2
- package/dist/{index-B2UGAU9v.js → index-BaGjDOR2.js} +1 -1
- package/dist/{index-DlwlvbrO.js → index-BxosLsfW.js} +1 -1
- package/dist/{index-e5r6FpSJ.js → index-C6PeL89d.js} +3 -3
- package/dist/{index-CAP90xO7.js → index-CLvFXL_E.js} +4 -4
- package/dist/{index-CdgAq0Pz.js → index-ClEGMTrv.js} +1 -1
- package/dist/{index-M5KI7NIT.js → index-DAhj82tf.js} +1 -1
- package/dist/{index-D_b2gjAX.js → index-DDQaEXt7.js} +1 -1
- package/dist/{index-BJne3mAB.js → index-DW7nPyed.js} +6 -6
- package/dist/{index-Rb7s8Lqk.js → index-DaCQrz9t.js} +3 -3
- package/dist/{index-Ch_6nXW4.js → index-REoHVOcy.js} +1 -1
- package/dist/{index-BJuTIPNg.js → index-RsNRLaWL.js} +1 -1
- package/dist/{index-Csxi8Zcu.js → index-lZq2A3X2.js} +3 -3
- package/dist/{index.esm2017-D6CILdWW.js → index.esm2017-DIVK9KD2.js} +1 -1
- package/dist/{loading-tl9p27VA.js → loading-xptL2Ny2.js} +1 -1
- package/dist/{lodash-fxLQlj7m.js → lodash-88xjswCi.js} +1 -1
- package/dist/{membership-CBpNdC9y.js → membership-eoLCZt_p.js} +3 -3
- package/dist/{money-CNRljtC1.js → money-DcsDa1nm.js} +1 -1
- package/dist/{number-DmTfN_5Y.js → number-BkGWCSrD.js} +1 -1
- package/dist/{objectid-BuanIDxD.js → objectid-gUqB9tj7.js} +6 -6
- package/dist/{plugins-DvsCeess.js → plugins-DoTCd9nY.js} +3 -3
- package/dist/{reward-CW22wI3L.js → reward-Culc3-Rv.js} +1 -1
- package/dist/{rule-C_3XR2Zd.js → rule-DUDjRs8M.js} +3 -3
- package/dist/{rule-builder-DrwCpDKV.js → rule-builder-CkZtoez-.js} +1 -1
- package/dist/{template-CBaQ8LLp.js → template-CxhdtuLf.js} +7 -7
- package/dist/{timezone-DSEM5B5J.js → timezone-CdsdekR2.js} +2 -2
- package/dist/{trigger-3QCLi7tq.js → trigger-CFXIiuLd.js} +5 -5
- package/dist/usePagination-BSeGmTq6.js +177 -0
- package/dist/{user-CY_UexCt.js → user-C7hrMSvV.js} +1 -1
- package/dist/{vue-i18n-DGcpLn5c.js → vue-i18n-BdGyU2Nr.js} +111 -111
- package/dist/{xlsx-rSwsIehi.js → xlsx-BN2KFkI2.js} +1 -1
- package/dist/{zod-BD5VYWIO.js → zod-DvUTBth7.js} +1 -1
- package/package.json +1 -1
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-C2ZrTL5p.js +0 -1767
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DPDq-Juz.js +0 -147
- package/dist/Setting-D5YbEHxm.js +0 -1982
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-qWbACUbe.js +0 -139
- package/dist/usePagination-CZ7RnfzE.js +0 -223
|
@@ -0,0 +1,1889 @@
|
|
|
1
|
+
import { defineComponent as P, computed as M, resolveComponent as _, openBlock as n, createElementBlock as V, createElementVNode as U, createVNode as c, unref as e, createTextVNode as ne, toDisplayString as A, withCtx as B, onMounted as Z, createBlock as f, createCommentVNode as N, ref as W, Fragment as q, renderList as $, normalizeClass as K, watch as be, resolveDynamicComponent as me, onBeforeMount as pe, isRef as fe, createSlots as ce } from "vue";
|
|
2
|
+
import { a as ge, C as _e, b as ke, c as he, d as Ee } from "./index-lZq2A3X2.js";
|
|
3
|
+
import { R as O, a as Ve } from "./rule-builder-CkZtoez-.js";
|
|
4
|
+
import { useDialog as ue, useDialogChild as ye, useSnackbar as Te } from "@feedmepos/ui-library";
|
|
5
|
+
import { u as G } from "./vue-i18n-BdGyU2Nr.js";
|
|
6
|
+
import { a as Se, R as F, S as Fe, C as j, W as xe, T as ie, O as de } from "./rule-DUDjRs8M.js";
|
|
7
|
+
import { p as Re } from "./plugins-DoTCd9nY.js";
|
|
8
|
+
import { h as ae } from "./moment-D7p2TMB-.js";
|
|
9
|
+
import { z as Ue } from "./app-C-nC9SMv.js";
|
|
10
|
+
import { u as X } from "./membership-eoLCZt_p.js";
|
|
11
|
+
import { u as te } from "./business-CrQ_qouH.js";
|
|
12
|
+
import "./index-DaCQrz9t.js";
|
|
13
|
+
import { _ as w } from "./CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js";
|
|
14
|
+
import { c as ve } from "./object-qECH92oz.js";
|
|
15
|
+
import { Z as le } from "./zod-DvUTBth7.js";
|
|
16
|
+
import { _ as Ce } from "./SelectItems.vue_vue_type_script_setup_true_lang-DbXFTjAN.js";
|
|
17
|
+
import "./index-CLvFXL_E.js";
|
|
18
|
+
import "./index-DW7nPyed.js";
|
|
19
|
+
import "./index-ClEGMTrv.js";
|
|
20
|
+
import "./index-C6PeL89d.js";
|
|
21
|
+
const Ye = { class: "flex items-center justify-between" }, Oe = { class: "flex items-center gap-8 xs:flex-wrap" }, we = { class: "text-fm-color-primary line-clamp-1 text-ellipsis" }, De = /* @__PURE__ */ P({
|
|
22
|
+
__name: "RuleEntry",
|
|
23
|
+
props: {
|
|
24
|
+
modelValue: {
|
|
25
|
+
type: Object,
|
|
26
|
+
required: !0
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
emits: ["edit", "remove"],
|
|
30
|
+
setup(o, { emit: x }) {
|
|
31
|
+
const g = o, u = M(() => {
|
|
32
|
+
const [s, r] = Object.entries(g.modelValue.conditions)[0];
|
|
33
|
+
return {
|
|
34
|
+
negated: g.modelValue.negated == !0,
|
|
35
|
+
property: g.modelValue.property,
|
|
36
|
+
operator: s,
|
|
37
|
+
equator: r
|
|
38
|
+
};
|
|
39
|
+
}), v = x, t = M(
|
|
40
|
+
() => Se(
|
|
41
|
+
u.value.property,
|
|
42
|
+
u.value.operator,
|
|
43
|
+
u.value.equator,
|
|
44
|
+
u.value.negated
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
async function a(s) {
|
|
48
|
+
s.stopPropagation(), await Re.remove("Are you sure you want to remove this rule?") && v("remove", g.modelValue);
|
|
49
|
+
}
|
|
50
|
+
return (s, r) => {
|
|
51
|
+
var k;
|
|
52
|
+
const E = _("FmChip"), i = _("FmTooltip"), b = _("FmIcon");
|
|
53
|
+
return n(), V("div", Ye, [
|
|
54
|
+
U("div", Oe, [
|
|
55
|
+
c(E, {
|
|
56
|
+
label: (k = e(ge).find((R) => R.property === g.modelValue.property)) == null ? void 0 : k.name,
|
|
57
|
+
class: "!text-fm-color-typo-info !bg-fm-color-system-info-100"
|
|
58
|
+
}, null, 8, ["label"]),
|
|
59
|
+
r[1] || (r[1] = U("div", { class: "h-[26px] border-l-2 rounded-md border-fm-color-neutral-gray-100" }, null, -1)),
|
|
60
|
+
U("div", {
|
|
61
|
+
onClick: r[0] || (r[0] = (R) => v("edit", g.modelValue)),
|
|
62
|
+
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"
|
|
63
|
+
}, [
|
|
64
|
+
ne(A(e(t)[0]) + " ", 1),
|
|
65
|
+
c(i, {
|
|
66
|
+
"z-index": 1e3,
|
|
67
|
+
content: e(t)[1]
|
|
68
|
+
}, {
|
|
69
|
+
default: B(() => [
|
|
70
|
+
U("div", we, A(e(t)[1]), 1)
|
|
71
|
+
]),
|
|
72
|
+
_: 1
|
|
73
|
+
}, 8, ["content"])
|
|
74
|
+
])
|
|
75
|
+
]),
|
|
76
|
+
c(b, {
|
|
77
|
+
name: "close",
|
|
78
|
+
size: "md",
|
|
79
|
+
class: "cursor-pointer hover:bg-neutral-300 rounded-lg",
|
|
80
|
+
onClick: a
|
|
81
|
+
})
|
|
82
|
+
]);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
Ue.enum([
|
|
87
|
+
"MIN_SPEND",
|
|
88
|
+
"SPECIFIC_DATE",
|
|
89
|
+
"SPECIFIC_TIMERANGE",
|
|
90
|
+
"WEEKLY",
|
|
91
|
+
"MONTHLY",
|
|
92
|
+
"BIRTHDAY",
|
|
93
|
+
"TIER",
|
|
94
|
+
"TITLE",
|
|
95
|
+
"LAST_X_DAY",
|
|
96
|
+
"CUSTOM"
|
|
97
|
+
]);
|
|
98
|
+
const qe = [
|
|
99
|
+
{
|
|
100
|
+
type: "MIN_SPEND",
|
|
101
|
+
name: "Minimum spend",
|
|
102
|
+
for: ["bill"],
|
|
103
|
+
rules: []
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: "SPECIFIC_DATE",
|
|
107
|
+
name: "Specific date",
|
|
108
|
+
for: ["trigger"],
|
|
109
|
+
rules: []
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
type: "SPECIFIC_TIMERANGE",
|
|
113
|
+
name: "Specific time range",
|
|
114
|
+
for: ["trigger"],
|
|
115
|
+
rules: []
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
type: "WEEKLY",
|
|
119
|
+
name: "Weekly",
|
|
120
|
+
for: ["trigger"],
|
|
121
|
+
rules: [
|
|
122
|
+
{
|
|
123
|
+
property: "trigger.date",
|
|
124
|
+
operator: "_rrule",
|
|
125
|
+
equator: "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=SU;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
type: "MONTHLY",
|
|
131
|
+
name: "Monthly",
|
|
132
|
+
for: ["trigger"],
|
|
133
|
+
rules: [
|
|
134
|
+
{
|
|
135
|
+
property: "trigger.date",
|
|
136
|
+
operator: "_rrule",
|
|
137
|
+
equator: "RRULE:FREQ=MONTHLY;WKST=SU;BYMONTHDAY=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
type: "BIRTHDAY",
|
|
143
|
+
name: "Birthday",
|
|
144
|
+
for: ["user"],
|
|
145
|
+
rules: [
|
|
146
|
+
{
|
|
147
|
+
property: "user.birthday",
|
|
148
|
+
operator: "_isRange",
|
|
149
|
+
equator: {
|
|
150
|
+
op: "this",
|
|
151
|
+
unit: "day",
|
|
152
|
+
ignoreYear: !0
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
type: "BIRTHDAY",
|
|
159
|
+
name: "Birthday Week",
|
|
160
|
+
for: ["user"],
|
|
161
|
+
rules: [
|
|
162
|
+
{
|
|
163
|
+
property: "user.birthday",
|
|
164
|
+
operator: "_isRange",
|
|
165
|
+
equator: {
|
|
166
|
+
op: "this",
|
|
167
|
+
unit: "week",
|
|
168
|
+
ignoreYear: !0
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
type: "BIRTHDAY",
|
|
175
|
+
name: "Birthday Month",
|
|
176
|
+
for: ["user"],
|
|
177
|
+
rules: [
|
|
178
|
+
{
|
|
179
|
+
property: "user.birthday",
|
|
180
|
+
operator: "_isRange",
|
|
181
|
+
equator: {
|
|
182
|
+
op: "this",
|
|
183
|
+
unit: "month",
|
|
184
|
+
ignoreYear: !0
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
type: "BIRTHDAY",
|
|
191
|
+
name: "N day before birthday",
|
|
192
|
+
for: ["user"],
|
|
193
|
+
rules: [
|
|
194
|
+
{
|
|
195
|
+
property: "user.birthday",
|
|
196
|
+
operator: "_isDay",
|
|
197
|
+
equator: {
|
|
198
|
+
op: "before",
|
|
199
|
+
x: 1,
|
|
200
|
+
ignoreYear: !0
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
type: "TIER",
|
|
207
|
+
name: "Specific tier",
|
|
208
|
+
for: ["user"],
|
|
209
|
+
rules: [
|
|
210
|
+
{
|
|
211
|
+
property: "user.tier",
|
|
212
|
+
operator: "_equal",
|
|
213
|
+
equator: 1
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
type: "TITLE",
|
|
219
|
+
name: "Specific title",
|
|
220
|
+
for: ["user"],
|
|
221
|
+
rules: [
|
|
222
|
+
{
|
|
223
|
+
property: "user.titles",
|
|
224
|
+
operator: "_hasAny",
|
|
225
|
+
equator: []
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
type: "LAST_X_DAY",
|
|
231
|
+
name: "Last visit in X days",
|
|
232
|
+
for: ["user"],
|
|
233
|
+
rules: [
|
|
234
|
+
{
|
|
235
|
+
property: "user.stats.lastVisit",
|
|
236
|
+
operator: "_isRange",
|
|
237
|
+
equator: {
|
|
238
|
+
op: "last",
|
|
239
|
+
unit: "day",
|
|
240
|
+
ignoreYear: !0,
|
|
241
|
+
x: 0
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
],
|
|
245
|
+
premium: !0
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
type: "CUSTOM",
|
|
249
|
+
name: "Weekday special",
|
|
250
|
+
for: ["trigger"],
|
|
251
|
+
rules: [
|
|
252
|
+
{
|
|
253
|
+
property: "trigger.date",
|
|
254
|
+
operator: "_rrule",
|
|
255
|
+
equator: "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=MO,TU,WE,TH,FR;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
type: "CUSTOM",
|
|
261
|
+
name: "Weekend special",
|
|
262
|
+
for: ["trigger"],
|
|
263
|
+
rules: [
|
|
264
|
+
{
|
|
265
|
+
property: "trigger.date",
|
|
266
|
+
operator: "_rrule",
|
|
267
|
+
equator: "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=SU,SA;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
268
|
+
}
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
type: "CUSTOM",
|
|
273
|
+
name: "Happy hour",
|
|
274
|
+
for: ["trigger"],
|
|
275
|
+
rules: [
|
|
276
|
+
{
|
|
277
|
+
property: "trigger.time",
|
|
278
|
+
operator: "_isBetweenTime",
|
|
279
|
+
equator: [
|
|
280
|
+
{
|
|
281
|
+
start: "21:00",
|
|
282
|
+
end: "23:59"
|
|
283
|
+
}
|
|
284
|
+
]
|
|
285
|
+
}
|
|
286
|
+
]
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
type: "CUSTOM",
|
|
290
|
+
name: "Mother's day special",
|
|
291
|
+
for: ["trigger"],
|
|
292
|
+
rules: [
|
|
293
|
+
{
|
|
294
|
+
property: "trigger.date",
|
|
295
|
+
operator: "_rrule",
|
|
296
|
+
equator: "RRULE:FREQ=YEARLY;WKST=SU;BYDAY=+2SU;BYMONTH=5;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
type: "CUSTOM",
|
|
302
|
+
name: "Father's day special",
|
|
303
|
+
for: ["trigger"],
|
|
304
|
+
rules: [
|
|
305
|
+
{
|
|
306
|
+
property: "trigger.date",
|
|
307
|
+
operator: "_rrule",
|
|
308
|
+
equator: "RRULE:FREQ=YEARLY;WKST=SU;BYDAY=+3SU;BYMONTH=6;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
309
|
+
}
|
|
310
|
+
]
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
type: "CUSTOM",
|
|
314
|
+
name: "Christmas",
|
|
315
|
+
for: ["trigger"],
|
|
316
|
+
rules: [
|
|
317
|
+
{
|
|
318
|
+
property: "trigger.date",
|
|
319
|
+
operator: "_rrule",
|
|
320
|
+
equator: "RRULE:FREQ=YEARLY;WKST=SU;BYMONTH=12;BYMONTHDAY=25;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
321
|
+
}
|
|
322
|
+
]
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
type: "CUSTOM",
|
|
326
|
+
name: "Feedback rating",
|
|
327
|
+
for: ["feedback"],
|
|
328
|
+
rules: [
|
|
329
|
+
{
|
|
330
|
+
property: "feedback.rating",
|
|
331
|
+
operator: "_lessThanOrEqual",
|
|
332
|
+
equator: 5
|
|
333
|
+
}
|
|
334
|
+
]
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
type: "CUSTOM",
|
|
338
|
+
name: "Custom",
|
|
339
|
+
for: ["trigger", "user", "bill", "feedback"],
|
|
340
|
+
rules: [
|
|
341
|
+
{
|
|
342
|
+
property: "trigger.date",
|
|
343
|
+
operator: "_isOnDate",
|
|
344
|
+
equator: ae().format("YYYY-MM-DD")
|
|
345
|
+
}
|
|
346
|
+
]
|
|
347
|
+
}
|
|
348
|
+
], Be = { class: "flex flex-nowrap gap-x-4 items-center" }, Me = /* @__PURE__ */ P({
|
|
349
|
+
__name: "IsDayInput",
|
|
350
|
+
props: {
|
|
351
|
+
modelValue: {
|
|
352
|
+
type: Object
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
emits: ["update:model-value"],
|
|
356
|
+
setup(o, { emit: x }) {
|
|
357
|
+
const { t: g } = G(), u = o, v = x;
|
|
358
|
+
Z(() => {
|
|
359
|
+
u.modelValue || v("update:model-value", {
|
|
360
|
+
op: "before",
|
|
361
|
+
x: 1
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
function t(a) {
|
|
365
|
+
const s = ve(
|
|
366
|
+
u.modelValue ?? {
|
|
367
|
+
op: "before",
|
|
368
|
+
x: 1
|
|
369
|
+
}
|
|
370
|
+
);
|
|
371
|
+
v("update:model-value", {
|
|
372
|
+
...s,
|
|
373
|
+
...a
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
return (a, s) => {
|
|
377
|
+
var E, i, b;
|
|
378
|
+
const r = _("FmStepperField");
|
|
379
|
+
return n(), V("div", Be, [
|
|
380
|
+
c(r, {
|
|
381
|
+
class: "w-1/3",
|
|
382
|
+
"model-value": ((E = o.modelValue) == null ? void 0 : E.x) ?? null,
|
|
383
|
+
max: 365,
|
|
384
|
+
"show-steppers": !1,
|
|
385
|
+
"append-text": "days",
|
|
386
|
+
"onUpdate:modelValue": s[0] || (s[0] = (k) => t({ x: k }))
|
|
387
|
+
}, null, 8, ["model-value"]),
|
|
388
|
+
c(w, {
|
|
389
|
+
"model-value": ((i = o.modelValue) == null ? void 0 : i.op) ?? void 0,
|
|
390
|
+
items: [
|
|
391
|
+
{
|
|
392
|
+
label: e(g)("connect.template.rule.is_day.before"),
|
|
393
|
+
value: "before"
|
|
394
|
+
},
|
|
395
|
+
{ label: e(g)("connect.template.rule.is_day.after"), value: "after" }
|
|
396
|
+
],
|
|
397
|
+
"onUpdate:modelValue": s[1] || (s[1] = (k) => t({ op: k }))
|
|
398
|
+
}, null, 8, ["model-value", "items"]),
|
|
399
|
+
c(w, {
|
|
400
|
+
"model-value": ((b = o.modelValue) == null ? void 0 : b.ignoreYear) ?? !1,
|
|
401
|
+
items: [
|
|
402
|
+
{
|
|
403
|
+
label: e(g)("connect.template.rule.is_day.same_year"),
|
|
404
|
+
value: !1
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
label: e(g)("connect.template.rule.is_day.ignore_year"),
|
|
408
|
+
value: !0
|
|
409
|
+
}
|
|
410
|
+
],
|
|
411
|
+
required: !0,
|
|
412
|
+
"onUpdate:modelValue": s[2] || (s[2] = (k) => t({ ignoreYear: k == !0 }))
|
|
413
|
+
}, null, 8, ["model-value", "items"])
|
|
414
|
+
]);
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
}), Ie = { class: "grid grid-cols-4 gap-x-4 items-center" }, Ae = /* @__PURE__ */ P({
|
|
418
|
+
__name: "IsRangeInput",
|
|
419
|
+
props: {
|
|
420
|
+
modelValue: {
|
|
421
|
+
type: Object,
|
|
422
|
+
default: () => ({
|
|
423
|
+
op: "this",
|
|
424
|
+
unit: "day",
|
|
425
|
+
ignoreYear: !0
|
|
426
|
+
})
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
emits: ["update:model-value"],
|
|
430
|
+
setup(o, { emit: x }) {
|
|
431
|
+
const { t: g } = G(), u = o, v = x;
|
|
432
|
+
Z(() => {
|
|
433
|
+
u.modelValue || v("update:model-value", {
|
|
434
|
+
op: "this",
|
|
435
|
+
unit: "day",
|
|
436
|
+
ignoreYear: !0
|
|
437
|
+
});
|
|
438
|
+
});
|
|
439
|
+
const t = [
|
|
440
|
+
{ label: g("connect.template.rule.is_range.duration.day"), value: "day" },
|
|
441
|
+
{ label: g("connect.template.rule.is_range.duration.week"), value: "week" },
|
|
442
|
+
{
|
|
443
|
+
label: g("connect.template.rule.is_range.duration.month"),
|
|
444
|
+
value: "month"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
label: g("connect.template.rule.is_range.duration.quarter"),
|
|
448
|
+
value: "quarter"
|
|
449
|
+
},
|
|
450
|
+
{ label: g("connect.template.rule.is_range.duration.year"), value: "year" }
|
|
451
|
+
], a = [
|
|
452
|
+
{
|
|
453
|
+
label: g("connect.template.rule.is_range.op.this"),
|
|
454
|
+
value: "this"
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
label: g("connect.template.rule.is_range.op.last"),
|
|
458
|
+
value: "last"
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
label: g("connect.template.rule.is_range.op.next"),
|
|
462
|
+
value: "next"
|
|
463
|
+
}
|
|
464
|
+
];
|
|
465
|
+
return (s, r) => {
|
|
466
|
+
var i, b, k, R, D;
|
|
467
|
+
const E = _("FmStepperField");
|
|
468
|
+
return n(), V("div", Ie, [
|
|
469
|
+
c(w, {
|
|
470
|
+
"model-value": (i = o.modelValue) == null ? void 0 : i.op,
|
|
471
|
+
label: "",
|
|
472
|
+
items: a,
|
|
473
|
+
required: !0,
|
|
474
|
+
"onUpdate:modelValue": r[0] || (r[0] = (d) => v("update:model-value", { op: d, unit: "day", ignoreYear: !1 }))
|
|
475
|
+
}, null, 8, ["model-value"]),
|
|
476
|
+
((b = o.modelValue) == null ? void 0 : b.op) != "this" ? (n(), f(E, {
|
|
477
|
+
key: 0,
|
|
478
|
+
"model-value": ((k = o.modelValue) == null ? void 0 : k.x) || 0,
|
|
479
|
+
max: 365,
|
|
480
|
+
"show-steppers": !1,
|
|
481
|
+
"onUpdate:modelValue": r[1] || (r[1] = (d) => v("update:model-value", {
|
|
482
|
+
op: o.modelValue.op,
|
|
483
|
+
unit: o.modelValue.unit,
|
|
484
|
+
ignoreYear: o.modelValue.ignoreYear == !0,
|
|
485
|
+
x: d
|
|
486
|
+
}))
|
|
487
|
+
}, null, 8, ["model-value"])) : N("", !0),
|
|
488
|
+
c(w, {
|
|
489
|
+
"model-value": (R = o.modelValue) == null ? void 0 : R.unit,
|
|
490
|
+
label: "",
|
|
491
|
+
items: t,
|
|
492
|
+
required: !0,
|
|
493
|
+
"onUpdate:modelValue": r[2] || (r[2] = (d) => v("update:model-value", { ...u.modelValue, unit: d }))
|
|
494
|
+
}, null, 8, ["model-value"]),
|
|
495
|
+
c(w, {
|
|
496
|
+
label: "",
|
|
497
|
+
"model-value": (D = o.modelValue) == null ? void 0 : D.ignoreYear,
|
|
498
|
+
items: [
|
|
499
|
+
{ label: "same", value: !1 },
|
|
500
|
+
{ label: "ignore", value: !0 }
|
|
501
|
+
],
|
|
502
|
+
required: !0,
|
|
503
|
+
"onUpdate:modelValue": r[3] || (r[3] = (d) => v("update:model-value", {
|
|
504
|
+
...u.modelValue,
|
|
505
|
+
ignoreYear: d == !0
|
|
506
|
+
}))
|
|
507
|
+
}, null, 8, ["model-value"])
|
|
508
|
+
]);
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
}), Ne = { class: "space-y-8" }, Pe = { class: "text-fm-color-primary rounded-md border-dashed border-2 p-8" }, Le = {
|
|
512
|
+
key: 0,
|
|
513
|
+
class: "flex items-center gap-8"
|
|
514
|
+
}, $e = { class: "flex gap-4" }, He = {
|
|
515
|
+
key: 0,
|
|
516
|
+
class: "grid grid-cols-7 overflow-hidden rounded-md border-1"
|
|
517
|
+
}, We = ["onClick"], je = {
|
|
518
|
+
key: 1,
|
|
519
|
+
class: "flex items-center gap-8"
|
|
520
|
+
}, Ke = { class: "flex gap-4 xs:gap-[2px]" }, Ge = { class: "grid grid-cols-6 gap-8" }, Qe = {
|
|
521
|
+
key: 0,
|
|
522
|
+
class: "grid grid-cols-7 overflow-hidden rounded-md border-1"
|
|
523
|
+
}, ze = ["onClick"], Xe = {
|
|
524
|
+
key: 1,
|
|
525
|
+
class: "grid grid-cols-2 items-center gap-8"
|
|
526
|
+
}, Ze = { class: "flex gap-4" }, Je = {
|
|
527
|
+
key: 4,
|
|
528
|
+
class: "flex items-center justify-end gap-8"
|
|
529
|
+
}, re = /* @__PURE__ */ P({
|
|
530
|
+
__name: "RruleInput",
|
|
531
|
+
props: {
|
|
532
|
+
modelValue: {
|
|
533
|
+
type: String
|
|
534
|
+
},
|
|
535
|
+
startDate: {
|
|
536
|
+
type: Object
|
|
537
|
+
},
|
|
538
|
+
applyButton: {
|
|
539
|
+
type: Boolean
|
|
540
|
+
},
|
|
541
|
+
fixedFrequency: {
|
|
542
|
+
type: Boolean
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
emits: ["update:model-value", "cancel"],
|
|
546
|
+
setup(o, { emit: x }) {
|
|
547
|
+
const { t: g } = G(), u = o, v = x, t = W(
|
|
548
|
+
u.modelValue ? F.fromString(u.modelValue) : new F({
|
|
549
|
+
dtstart: u.startDate,
|
|
550
|
+
freq: F.DAILY,
|
|
551
|
+
wkst: F.SU,
|
|
552
|
+
interval: 1,
|
|
553
|
+
byhour: 0,
|
|
554
|
+
byminute: 0,
|
|
555
|
+
bysecond: 0
|
|
556
|
+
})
|
|
557
|
+
);
|
|
558
|
+
function a(s) {
|
|
559
|
+
var r;
|
|
560
|
+
if ("freq" in s)
|
|
561
|
+
switch (s.freq) {
|
|
562
|
+
case F.WEEKLY:
|
|
563
|
+
t.value = new F({
|
|
564
|
+
dtstart: u.startDate,
|
|
565
|
+
freq: s.freq,
|
|
566
|
+
interval: 1,
|
|
567
|
+
byhour: 0,
|
|
568
|
+
byminute: 0,
|
|
569
|
+
bysecond: 0,
|
|
570
|
+
wkst: F.SU,
|
|
571
|
+
byweekday: [F.MO]
|
|
572
|
+
});
|
|
573
|
+
break;
|
|
574
|
+
case F.MONTHLY:
|
|
575
|
+
t.value = new F({
|
|
576
|
+
dtstart: u.startDate,
|
|
577
|
+
freq: s.freq,
|
|
578
|
+
interval: 1,
|
|
579
|
+
byhour: 0,
|
|
580
|
+
byminute: 0,
|
|
581
|
+
bysecond: 0,
|
|
582
|
+
bymonthday: [(/* @__PURE__ */ new Date()).getDate()],
|
|
583
|
+
wkst: F.SU
|
|
584
|
+
});
|
|
585
|
+
break;
|
|
586
|
+
case F.YEARLY:
|
|
587
|
+
t.value = new F({
|
|
588
|
+
dtstart: u.startDate,
|
|
589
|
+
freq: s.freq,
|
|
590
|
+
interval: 1,
|
|
591
|
+
byhour: 0,
|
|
592
|
+
byminute: 0,
|
|
593
|
+
bysecond: 0,
|
|
594
|
+
wkst: F.SU,
|
|
595
|
+
bymonth: [(/* @__PURE__ */ new Date()).getMonth() + 1],
|
|
596
|
+
bymonthday: [(/* @__PURE__ */ new Date()).getDate()]
|
|
597
|
+
});
|
|
598
|
+
break;
|
|
599
|
+
default:
|
|
600
|
+
t.value = new F({
|
|
601
|
+
dtstart: u.startDate,
|
|
602
|
+
freq: s.freq,
|
|
603
|
+
interval: 1,
|
|
604
|
+
byhour: 0,
|
|
605
|
+
byminute: 0,
|
|
606
|
+
bysecond: 0,
|
|
607
|
+
wkst: F.SU
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
s.interval && s.interval > 0 && (t.value = new F({
|
|
611
|
+
...t.value.origOptions,
|
|
612
|
+
dtstart: u.startDate,
|
|
613
|
+
interval: s.interval
|
|
614
|
+
})), "byweekday" in s && s.byweekday && Array.isArray(s.byweekday) && s.byweekday.length > 0 && (t.value.options.bymonthday.length > 0 && t.value.options.freq == F.MONTHLY && (t.value.options.bymonthday = []), t.value = new F({
|
|
615
|
+
...t.value.origOptions,
|
|
616
|
+
dtstart: u.startDate,
|
|
617
|
+
bymonthday: [],
|
|
618
|
+
byweekday: s.byweekday
|
|
619
|
+
})), "bysetpos" in s && s.bysetpos != null && (t.value = new F({
|
|
620
|
+
...t.value.origOptions,
|
|
621
|
+
dtstart: u.startDate,
|
|
622
|
+
bymonthday: [],
|
|
623
|
+
bysetpos: s.bysetpos,
|
|
624
|
+
byweekday: ((r = t.value.options.byweekday) == null ? void 0 : r.length) > 0 ? t.value.options.byweekday : [6]
|
|
625
|
+
})), "bymonthday" in s && s.bymonthday && Array.isArray(s.bymonthday) && s.bymonthday.length > 0 && (t.value = new F({
|
|
626
|
+
...t.value.origOptions,
|
|
627
|
+
dtstart: u.startDate,
|
|
628
|
+
bysetpos: [],
|
|
629
|
+
byweekday: [],
|
|
630
|
+
bymonthday: s.bymonthday
|
|
631
|
+
})), "bymonth" in s && s.bymonth && Array.isArray(s.bymonth) && s.bymonth.length > 0 && (t.value = new F({
|
|
632
|
+
...t.value.origOptions,
|
|
633
|
+
dtstart: u.startDate,
|
|
634
|
+
bysetpos: [],
|
|
635
|
+
bymonth: s.bymonth
|
|
636
|
+
})), "bynweekday" in s && s.bynweekday && (t.value = new F({
|
|
637
|
+
...t.value.origOptions,
|
|
638
|
+
dtstart: u.startDate,
|
|
639
|
+
bysetpos: [],
|
|
640
|
+
byweekday: new xe(
|
|
641
|
+
s.bynweekday[0][0],
|
|
642
|
+
s.bynweekday[0][1]
|
|
643
|
+
)
|
|
644
|
+
})), u.applyButton || v("update:model-value", t.value.toString());
|
|
645
|
+
}
|
|
646
|
+
return Z(() => {
|
|
647
|
+
u.modelValue || v(
|
|
648
|
+
"update:model-value",
|
|
649
|
+
new F({
|
|
650
|
+
dtstart: u.startDate,
|
|
651
|
+
freq: F.DAILY,
|
|
652
|
+
wkst: F.SU,
|
|
653
|
+
interval: 1,
|
|
654
|
+
byhour: 0,
|
|
655
|
+
byminute: 0,
|
|
656
|
+
bysecond: 0
|
|
657
|
+
}).toString()
|
|
658
|
+
);
|
|
659
|
+
}), (s, r) => {
|
|
660
|
+
var R, D, d;
|
|
661
|
+
const E = _("FmStepperField"), i = _("FmChip"), b = _("FmButtonGroup"), k = _("FmButton");
|
|
662
|
+
return n(), V("div", Ne, [
|
|
663
|
+
U("div", Pe, A(e(Fe)(e(t).options)), 1),
|
|
664
|
+
o.fixedFrequency ? N("", !0) : (n(), V("div", Le, [
|
|
665
|
+
U("div", null, A(e(g)("connect.template.rule.rrule.repeat_every")), 1),
|
|
666
|
+
c(E, {
|
|
667
|
+
class: "w-[100px]",
|
|
668
|
+
"model-value": e(t).options.interval,
|
|
669
|
+
"onUpdate:modelValue": r[0] || (r[0] = (l) => a({ interval: l > 0 ? l : e(t).options.interval })),
|
|
670
|
+
min: 1
|
|
671
|
+
}, null, 8, ["model-value"]),
|
|
672
|
+
c(w, {
|
|
673
|
+
class: "w-min",
|
|
674
|
+
items: e(j).frequencies,
|
|
675
|
+
"model-value": e(t).origOptions.freq,
|
|
676
|
+
"onUpdate:modelValue": r[1] || (r[1] = (l) => a({ freq: l }))
|
|
677
|
+
}, null, 8, ["items", "model-value"])
|
|
678
|
+
])),
|
|
679
|
+
e(t).options.freq === e(F).WEEKLY ? (n(), V(q, { key: 1 }, [
|
|
680
|
+
r[8] || (r[8] = U("div", null, "Repeat on", -1)),
|
|
681
|
+
U("div", $e, [
|
|
682
|
+
(n(!0), V(q, null, $(e(j).weekdays, (l) => {
|
|
683
|
+
var y;
|
|
684
|
+
return n(), f(i, {
|
|
685
|
+
class: K(["cursor-pointer", `${(y = e(t).options.byweekday) != null && y.includes(l.value) ? "bg-fm-color-primary text-white" : "bg-fm-color-neutral-gray-200 text-black"}`]),
|
|
686
|
+
label: l.label[0],
|
|
687
|
+
key: l.value,
|
|
688
|
+
compact: !0,
|
|
689
|
+
onClick: () => {
|
|
690
|
+
var p, C;
|
|
691
|
+
a({
|
|
692
|
+
byweekday: (p = e(t).options.byweekday) != null && p.includes(l.value) ? ((C = e(t).options.byweekday) == null ? void 0 : C.filter((m) => m !== l.value)) || [] : [...e(t).options.byweekday || [], l.value]
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
}, null, 8, ["class", "label", "onClick"]);
|
|
696
|
+
}), 128))
|
|
697
|
+
])
|
|
698
|
+
], 64)) : N("", !0),
|
|
699
|
+
e(t).options.freq == e(F).MONTHLY ? (n(), V(q, { key: 2 }, [
|
|
700
|
+
c(b, {
|
|
701
|
+
"model-value": e(t).options.bymonthday.length ? { label: "Each" } : { label: "On the" },
|
|
702
|
+
items: [
|
|
703
|
+
{
|
|
704
|
+
label: "Each"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
label: "On the"
|
|
708
|
+
}
|
|
709
|
+
],
|
|
710
|
+
"onUpdate:modelValue": r[2] || (r[2] = (l) => {
|
|
711
|
+
l.label == "Each" ? a({ bymonthday: [1] }) : a({ bysetpos: 1 });
|
|
712
|
+
})
|
|
713
|
+
}, null, 8, ["model-value"]),
|
|
714
|
+
e(t).options.bymonthday.length > 0 ? (n(), V("div", He, [
|
|
715
|
+
(n(!0), V(q, null, $(e(j).dates, (l) => (n(), V("div", {
|
|
716
|
+
key: l.value,
|
|
717
|
+
class: K(["cursor-pointer text-center outline-1 outline-fm-color-neutral-gray-100 outline", `${e(t).options.bymonthday.includes(l.value) ? "bg-fm-color-primary text-fm-color-typo-white outline-transparent" : "bg-transparent text-fm-color-typo-primary"} ${l.value == 31 ? "border-r" : ""}`]),
|
|
718
|
+
onClick: (y) => a({
|
|
719
|
+
bymonthday: e(t).options.bymonthday.includes(l.value) ? e(t).options.bymonthday.filter((p) => p !== l.value) : [...e(t).options.bymonthday, l.value]
|
|
720
|
+
})
|
|
721
|
+
}, A(l.value), 11, We))), 128))
|
|
722
|
+
])) : (n(), V("div", je, [
|
|
723
|
+
c(w, {
|
|
724
|
+
items: e(j).ordinals,
|
|
725
|
+
"model-value": (R = e(t).options.bysetpos) == null ? void 0 : R[0],
|
|
726
|
+
"onUpdate:modelValue": r[3] || (r[3] = (l) => a({ bysetpos: l }))
|
|
727
|
+
}, null, 8, ["items", "model-value"]),
|
|
728
|
+
U("div", Ke, [
|
|
729
|
+
(n(!0), V(q, null, $(e(j).weekdays, (l) => {
|
|
730
|
+
var y;
|
|
731
|
+
return n(), f(i, {
|
|
732
|
+
class: K(["cursor-pointer", `${(y = e(t).options.byweekday) != null && y.includes(l.value) ? "bg-fm-color-primary text-white" : "bg-fm-color-neutral-gray-200 text-black"}`]),
|
|
733
|
+
label: l.label[0],
|
|
734
|
+
key: l.value,
|
|
735
|
+
compact: !0,
|
|
736
|
+
onClick: () => {
|
|
737
|
+
a({
|
|
738
|
+
byweekday: [l.value]
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
}, null, 8, ["class", "label", "onClick"]);
|
|
742
|
+
}), 128))
|
|
743
|
+
])
|
|
744
|
+
]))
|
|
745
|
+
], 64)) : N("", !0),
|
|
746
|
+
e(t).options.freq == e(F).YEARLY ? (n(), V(q, { key: 3 }, [
|
|
747
|
+
r[9] || (r[9] = U("div", null, "Month", -1)),
|
|
748
|
+
U("div", Ge, [
|
|
749
|
+
(n(!0), V(q, null, $(e(j).months, (l) => {
|
|
750
|
+
var y, p;
|
|
751
|
+
return n(), f(i, {
|
|
752
|
+
key: l.value,
|
|
753
|
+
class: K(["cursor-pointer", {
|
|
754
|
+
"bg-fm-color-primary text-white": (y = e(t).options.bymonth) == null ? void 0 : y.includes(
|
|
755
|
+
l.value
|
|
756
|
+
),
|
|
757
|
+
"bg-fm-color-gray-200 text-fm-color-gray-800": !((p = e(t).options.bymonth) != null && p.includes(l.value))
|
|
758
|
+
}]),
|
|
759
|
+
label: l.shortName,
|
|
760
|
+
compact: !0,
|
|
761
|
+
onClick: (C) => a({
|
|
762
|
+
bymonth: (e(t).options.bymonth ?? []).includes(l.value) ? (e(t).options.bymonth ?? []).filter((m) => m !== l.value) : [...e(t).options.bymonth ?? [], l.value]
|
|
763
|
+
})
|
|
764
|
+
}, null, 8, ["class", "label", "onClick"]);
|
|
765
|
+
}), 128))
|
|
766
|
+
]),
|
|
767
|
+
c(b, {
|
|
768
|
+
"model-value": e(t).options.bymonthday.length ? { label: "Each" } : { label: "On the" },
|
|
769
|
+
items: [
|
|
770
|
+
{
|
|
771
|
+
label: "Each"
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
label: "On the"
|
|
775
|
+
}
|
|
776
|
+
],
|
|
777
|
+
"onUpdate:modelValue": r[4] || (r[4] = (l) => {
|
|
778
|
+
l.label == "Each" ? a({
|
|
779
|
+
bymonthday: [1],
|
|
780
|
+
bymonth: e(t).options.bymonth ?? [1]
|
|
781
|
+
}) : a({
|
|
782
|
+
byweekday: [e(F).SU.nth(1)],
|
|
783
|
+
bymonth: e(t).options.bymonth ?? [1]
|
|
784
|
+
});
|
|
785
|
+
})
|
|
786
|
+
}, null, 8, ["model-value"]),
|
|
787
|
+
e(t).options.bymonthday.length > 0 ? (n(), V("div", Qe, [
|
|
788
|
+
(n(!0), V(q, null, $(Array(31).fill(null).map((l, y) => y + 1), (l) => (n(), V("div", {
|
|
789
|
+
key: l,
|
|
790
|
+
class: K(["cursor-pointer text-center outline-1 outline-fm-color-neutral-gray-100 outline", `${e(t).options.bymonthday.includes(l) ? "bg-fm-color-primary text-fm-color-typo-white outline-transparent" : "bg-transparent text-fm-color-typo-primary"} ${l == 31 ? "border-r" : ""}`]),
|
|
791
|
+
onClick: (y) => a({
|
|
792
|
+
bymonthday: e(t).options.bymonthday.includes(l) ? e(t).options.bymonthday.filter((p) => p !== l) : [...e(t).options.bymonthday, l]
|
|
793
|
+
})
|
|
794
|
+
}, A(l), 11, ze))), 128))
|
|
795
|
+
])) : (n(), V("div", Xe, [
|
|
796
|
+
c(w, {
|
|
797
|
+
items: e(j).ordinals,
|
|
798
|
+
"model-value": (d = (D = e(t).options.bynweekday) == null ? void 0 : D[0]) == null ? void 0 : d[1],
|
|
799
|
+
"onUpdate:modelValue": r[5] || (r[5] = (l) => {
|
|
800
|
+
var y, p;
|
|
801
|
+
return a({
|
|
802
|
+
bynweekday: [[((p = (y = e(t).options.bynweekday) == null ? void 0 : y[0]) == null ? void 0 : p[0]) ?? 1, l]]
|
|
803
|
+
});
|
|
804
|
+
})
|
|
805
|
+
}, null, 8, ["items", "model-value"]),
|
|
806
|
+
U("div", Ze, [
|
|
807
|
+
(n(!0), V(q, null, $(e(j).weekdays, (l) => {
|
|
808
|
+
var y, p;
|
|
809
|
+
return n(), f(i, {
|
|
810
|
+
class: K(["cursor-pointer", `${((p = (y = e(t).options.bynweekday) == null ? void 0 : y[0]) == null ? void 0 : p[0]) === l.value ? "bg-fm-color-primary text-white" : "bg-fm-color-neutral-gray-200 text-black"}`]),
|
|
811
|
+
label: l.label[0],
|
|
812
|
+
key: l.value,
|
|
813
|
+
compact: !0,
|
|
814
|
+
onClick: () => {
|
|
815
|
+
var C, m;
|
|
816
|
+
a({
|
|
817
|
+
bynweekday: [
|
|
818
|
+
[l.value, ((m = (C = e(t).options.bynweekday) == null ? void 0 : C[0]) == null ? void 0 : m[1]) ?? 1]
|
|
819
|
+
]
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
}, null, 8, ["class", "label", "onClick"]);
|
|
823
|
+
}), 128))
|
|
824
|
+
])
|
|
825
|
+
]))
|
|
826
|
+
], 64)) : N("", !0),
|
|
827
|
+
o.applyButton ? (n(), V("div", Je, [
|
|
828
|
+
c(k, {
|
|
829
|
+
label: "Cancel",
|
|
830
|
+
variant: "tertiary",
|
|
831
|
+
onClick: r[6] || (r[6] = (l) => v("cancel"))
|
|
832
|
+
}),
|
|
833
|
+
c(k, {
|
|
834
|
+
label: "Apply",
|
|
835
|
+
onClick: r[7] || (r[7] = (l) => v("update:model-value", e(t).toString()))
|
|
836
|
+
})
|
|
837
|
+
])) : N("", !0)
|
|
838
|
+
]);
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
}), et = { class: "grid grid-cols-4 gap-8 w-full flex-wrap py-16" }, tt = /* @__PURE__ */ P({
|
|
842
|
+
__name: "IsInMonthInput",
|
|
843
|
+
props: {
|
|
844
|
+
modelValue: {
|
|
845
|
+
type: Object,
|
|
846
|
+
required: !0
|
|
847
|
+
}
|
|
848
|
+
},
|
|
849
|
+
emits: ["update:model-value"],
|
|
850
|
+
setup(o, { emit: x }) {
|
|
851
|
+
const g = o, u = x, v = ae.months().map((t, a) => ({
|
|
852
|
+
name: t,
|
|
853
|
+
shortName: ae().month(a).format("MMM"),
|
|
854
|
+
value: a
|
|
855
|
+
}));
|
|
856
|
+
return Z(() => {
|
|
857
|
+
g.modelValue || u("update:model-value", []);
|
|
858
|
+
}), (t, a) => {
|
|
859
|
+
const s = _("FmChip");
|
|
860
|
+
return n(), V("div", et, [
|
|
861
|
+
(n(!0), V(q, null, $(e(v), (r) => {
|
|
862
|
+
var E, i;
|
|
863
|
+
return n(), f(s, {
|
|
864
|
+
class: K(["cursor-pointer", {
|
|
865
|
+
"bg-fm-color-primary text-white": (E = o.modelValue) == null ? void 0 : E.includes(r.value),
|
|
866
|
+
"bg-fm-color-gray-200 text-fm-color-gray-800": !((i = o.modelValue) != null && i.includes(
|
|
867
|
+
r.value
|
|
868
|
+
))
|
|
869
|
+
}]),
|
|
870
|
+
label: r.name,
|
|
871
|
+
key: r.value,
|
|
872
|
+
compact: !0,
|
|
873
|
+
onClick: (b) => u(
|
|
874
|
+
"update:model-value",
|
|
875
|
+
o.modelValue.includes(r.value) ? o.modelValue.filter((k) => k !== r.value) : [...o.modelValue, r.value]
|
|
876
|
+
)
|
|
877
|
+
}, null, 8, ["class", "label", "onClick"]);
|
|
878
|
+
}), 128))
|
|
879
|
+
]);
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
}), lt = { class: "" }, ot = { class: "flex justify-end gap-8 w-full" }, at = /* @__PURE__ */ P({
|
|
883
|
+
__name: "MenuDialog",
|
|
884
|
+
props: {
|
|
885
|
+
modelValue: { type: Boolean },
|
|
886
|
+
initialValue: {},
|
|
887
|
+
filterItems: { type: Function }
|
|
888
|
+
},
|
|
889
|
+
emits: ["update:model-value", "confirm"],
|
|
890
|
+
setup(o, { emit: x }) {
|
|
891
|
+
const g = o, u = W(), v = W(!1), t = x;
|
|
892
|
+
function a() {
|
|
893
|
+
var r;
|
|
894
|
+
(r = u.value) == null || r.onConfirm(), t("update:model-value", !1);
|
|
895
|
+
}
|
|
896
|
+
function s() {
|
|
897
|
+
t("update:model-value", !1);
|
|
898
|
+
}
|
|
899
|
+
return be(
|
|
900
|
+
() => g.modelValue,
|
|
901
|
+
(r) => {
|
|
902
|
+
v.value = r;
|
|
903
|
+
}
|
|
904
|
+
), Z(() => {
|
|
905
|
+
v.value = g.modelValue;
|
|
906
|
+
}), (r, E) => {
|
|
907
|
+
const i = _("FmButton"), b = _("FmDialog");
|
|
908
|
+
return n(), f(b, {
|
|
909
|
+
"content-scrollable": !1,
|
|
910
|
+
contentClass: "pt-0",
|
|
911
|
+
modelValue: v.value,
|
|
912
|
+
"onUpdate:modelValue": E[0] || (E[0] = (k) => v.value = k),
|
|
913
|
+
title: "Select Items",
|
|
914
|
+
"close-button": !1
|
|
915
|
+
}, {
|
|
916
|
+
"dialog-header": B(() => [...E[1] || (E[1] = [
|
|
917
|
+
U("div", null, "Select Item", -1)
|
|
918
|
+
])]),
|
|
919
|
+
"dialog-footer": B(() => [
|
|
920
|
+
U("div", ot, [
|
|
921
|
+
c(i, {
|
|
922
|
+
variant: "tertiary",
|
|
923
|
+
onClick: s,
|
|
924
|
+
label: "Cancel"
|
|
925
|
+
}),
|
|
926
|
+
c(i, {
|
|
927
|
+
variant: "primary",
|
|
928
|
+
onClick: a,
|
|
929
|
+
label: "Confirm"
|
|
930
|
+
})
|
|
931
|
+
])
|
|
932
|
+
]),
|
|
933
|
+
default: B(() => [
|
|
934
|
+
U("div", lt, [
|
|
935
|
+
c(Ce, {
|
|
936
|
+
ref_key: "selectItemRef",
|
|
937
|
+
ref: u,
|
|
938
|
+
"initial-value": o.initialValue,
|
|
939
|
+
"filter-items": o.filterItems,
|
|
940
|
+
"on-complete": (k) => {
|
|
941
|
+
t("confirm", k), s();
|
|
942
|
+
}
|
|
943
|
+
}, null, 8, ["initial-value", "filter-items", "on-complete"])
|
|
944
|
+
])
|
|
945
|
+
]),
|
|
946
|
+
_: 1
|
|
947
|
+
}, 8, ["modelValue"]);
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
}), rt = { id: "select-menu" }, nt = /* @__PURE__ */ P({
|
|
951
|
+
__name: "SelectMenu",
|
|
952
|
+
props: {
|
|
953
|
+
modelValue: {}
|
|
954
|
+
},
|
|
955
|
+
emits: ["update:model-value"],
|
|
956
|
+
setup(o, { emit: x }) {
|
|
957
|
+
const g = o, u = W(!1), v = M(() => {
|
|
958
|
+
var s;
|
|
959
|
+
return ((s = g.modelValue) == null ? void 0 : s.length) || 0;
|
|
960
|
+
}), t = x;
|
|
961
|
+
function a(s) {
|
|
962
|
+
t("update:model-value", s);
|
|
963
|
+
}
|
|
964
|
+
return (s, r) => {
|
|
965
|
+
const E = _("FmField");
|
|
966
|
+
return n(), V("div", rt, [
|
|
967
|
+
c(E, {
|
|
968
|
+
class: "text-fm-color-typo-tertiary",
|
|
969
|
+
onClick: r[0] || (r[0] = (i) => u.value = !0)
|
|
970
|
+
}, {
|
|
971
|
+
default: B(() => [
|
|
972
|
+
ne(A(v.value) + " item(s) selected ", 1)
|
|
973
|
+
]),
|
|
974
|
+
_: 1
|
|
975
|
+
}),
|
|
976
|
+
c(at, {
|
|
977
|
+
modelValue: u.value,
|
|
978
|
+
"onUpdate:modelValue": [
|
|
979
|
+
r[1] || (r[1] = (i) => u.value = i),
|
|
980
|
+
r[2] || (r[2] = (i) => u.value = i)
|
|
981
|
+
],
|
|
982
|
+
"initial-value": o.modelValue,
|
|
983
|
+
onConfirm: a
|
|
984
|
+
}, null, 8, ["modelValue", "initial-value"])
|
|
985
|
+
]);
|
|
986
|
+
};
|
|
987
|
+
}
|
|
988
|
+
}), ut = {
|
|
989
|
+
key: 19,
|
|
990
|
+
class: "fm-typo-en-body-lg-600"
|
|
991
|
+
}, st = /* @__PURE__ */ P({
|
|
992
|
+
__name: "RuleEquator",
|
|
993
|
+
props: {
|
|
994
|
+
type: {
|
|
995
|
+
type: String,
|
|
996
|
+
required: !0
|
|
997
|
+
},
|
|
998
|
+
operator: {
|
|
999
|
+
type: String,
|
|
1000
|
+
required: !0
|
|
1001
|
+
},
|
|
1002
|
+
modelValue: {
|
|
1003
|
+
type: Object
|
|
1004
|
+
}
|
|
1005
|
+
},
|
|
1006
|
+
emits: ["update:model-value"],
|
|
1007
|
+
setup(o, { emit: x }) {
|
|
1008
|
+
const g = o, u = x, v = M(() => {
|
|
1009
|
+
const t = _e[g.operator].safeParse(g.modelValue);
|
|
1010
|
+
return t.success ? [] : t.error.errors;
|
|
1011
|
+
});
|
|
1012
|
+
return (t, a) => {
|
|
1013
|
+
var D, d, l, y, p, C;
|
|
1014
|
+
const s = _("FmTextField"), r = _("FmStepperField"), E = _("FmSimpleDatePicker"), i = _("FmSimpleDateRangePicker"), b = _("FmTimeRangePicker"), k = _("FmTimePicker"), R = _("FmHelperText");
|
|
1015
|
+
return n(), V("div", {
|
|
1016
|
+
class: K({ "pb-4": e(v).length })
|
|
1017
|
+
}, [
|
|
1018
|
+
o.type === "text" ? (n(), f(s, {
|
|
1019
|
+
key: 0,
|
|
1020
|
+
"model-value": o.modelValue,
|
|
1021
|
+
"onUpdate:modelValue": a[0] || (a[0] = (m) => u("update:model-value", m))
|
|
1022
|
+
}, null, 8, ["model-value"])) : o.type === "number" ? (n(), f(r, {
|
|
1023
|
+
key: 1,
|
|
1024
|
+
"model-value": o.modelValue,
|
|
1025
|
+
"onUpdate:modelValue": a[1] || (a[1] = (m) => u("update:model-value", m))
|
|
1026
|
+
}, null, 8, ["model-value"])) : o.operator == "_isDay" ? (n(), f(me(Me), {
|
|
1027
|
+
key: 2,
|
|
1028
|
+
"model-value": o.modelValue,
|
|
1029
|
+
"onUpdate:modelValue": a[2] || (a[2] = (m) => u("update:model-value", m))
|
|
1030
|
+
}, null, 8, ["model-value"])) : o.operator == "_isRange" ? (n(), f(me(Ae), {
|
|
1031
|
+
key: 3,
|
|
1032
|
+
"model-value": o.modelValue,
|
|
1033
|
+
"onUpdate:modelValue": a[3] || (a[3] = (m) => u("update:model-value", m))
|
|
1034
|
+
}, null, 8, ["model-value"])) : o.operator == "_isOnDate" ? (n(), f(E, {
|
|
1035
|
+
key: 4,
|
|
1036
|
+
"model-value": o.modelValue,
|
|
1037
|
+
"onUpdate:modelValue": a[4] || (a[4] = (m) => u("update:model-value", m))
|
|
1038
|
+
}, null, 8, ["model-value"])) : o.operator == "_isBetween" ? (n(), f(i, {
|
|
1039
|
+
key: 5,
|
|
1040
|
+
"model-value": {
|
|
1041
|
+
startDate: (D = o.modelValue) == null ? void 0 : D.start,
|
|
1042
|
+
endDate: (d = o.modelValue) == null ? void 0 : d.end
|
|
1043
|
+
},
|
|
1044
|
+
"onUpdate:modelValue": a[5] || (a[5] = (m) => {
|
|
1045
|
+
u("update:model-value", {
|
|
1046
|
+
start: m.startDate,
|
|
1047
|
+
end: m.endDate
|
|
1048
|
+
});
|
|
1049
|
+
})
|
|
1050
|
+
}, null, 8, ["model-value"])) : o.operator == "_isInMonth" ? (n(), f(tt, {
|
|
1051
|
+
key: 6,
|
|
1052
|
+
"model-value": o.modelValue,
|
|
1053
|
+
"onUpdate:modelValue": a[6] || (a[6] = (m) => u("update:model-value", m))
|
|
1054
|
+
}, null, 8, ["model-value"])) : o.operator == "_rrule" ? (n(), f(re, {
|
|
1055
|
+
key: 7,
|
|
1056
|
+
"model-value": o.modelValue,
|
|
1057
|
+
"onUpdate:modelValue": a[7] || (a[7] = (m) => u("update:model-value", m))
|
|
1058
|
+
}, null, 8, ["model-value"])) : o.operator == "_isBetweenTime" ? (n(), f(b, {
|
|
1059
|
+
key: 8,
|
|
1060
|
+
"disable-time-check": !0,
|
|
1061
|
+
"model-value": [(y = (l = o.modelValue) == null ? void 0 : l[0]) == null ? void 0 : y.start, (C = (p = o.modelValue) == null ? void 0 : p[0]) == null ? void 0 : C.end],
|
|
1062
|
+
"onUpdate:modelValue": a[8] || (a[8] = (m) => u("update:model-value", [
|
|
1063
|
+
{
|
|
1064
|
+
start: m[0],
|
|
1065
|
+
end: m[1]
|
|
1066
|
+
}
|
|
1067
|
+
]))
|
|
1068
|
+
}, null, 8, ["model-value"])) : o.operator == "_isOnTime" ? (n(), f(k, {
|
|
1069
|
+
key: 9,
|
|
1070
|
+
"model-value": o.modelValue,
|
|
1071
|
+
"onUpdate:modelValue": a[9] || (a[9] = (m) => u("update:model-value", m))
|
|
1072
|
+
}, null, 8, ["model-value"])) : o.type == "tier" ? (n(), f(w, {
|
|
1073
|
+
key: 10,
|
|
1074
|
+
items: (e(X)().sortedTiers ?? []).map((m, Y) => ({
|
|
1075
|
+
label: `Tier ${Y + 1} - ${m.name}`,
|
|
1076
|
+
value: Y + 1
|
|
1077
|
+
})),
|
|
1078
|
+
"model-value": o.modelValue,
|
|
1079
|
+
"onUpdate:modelValue": a[10] || (a[10] = (m) => u("update:model-value", m))
|
|
1080
|
+
}, null, 8, ["items", "model-value"])) : o.type == "boolean" ? (n(), f(w, {
|
|
1081
|
+
key: 11,
|
|
1082
|
+
multiselect: !0,
|
|
1083
|
+
items: [
|
|
1084
|
+
{ label: "true", value: !0 },
|
|
1085
|
+
{ label: "false", value: !1 }
|
|
1086
|
+
],
|
|
1087
|
+
"model-value": o.modelValue ?? [],
|
|
1088
|
+
"onUpdate:modelValue": a[11] || (a[11] = (m) => u("update:model-value", m))
|
|
1089
|
+
}, null, 8, ["model-value"])) : o.type == "exist" ? (n(), f(w, {
|
|
1090
|
+
key: 12,
|
|
1091
|
+
items: [
|
|
1092
|
+
{ label: "true", value: "true" },
|
|
1093
|
+
{ label: "false", value: "false" }
|
|
1094
|
+
],
|
|
1095
|
+
"model-value": o.modelValue ?? [],
|
|
1096
|
+
"onUpdate:modelValue": a[12] || (a[12] = (m) => u("update:model-value", m))
|
|
1097
|
+
}, null, 8, ["model-value"])) : o.type == "gender" ? (n(), f(w, {
|
|
1098
|
+
key: 13,
|
|
1099
|
+
multiselect: !0,
|
|
1100
|
+
items: [
|
|
1101
|
+
{ label: "Male", value: "MALE" },
|
|
1102
|
+
{ label: "Female", value: "FEMALE" }
|
|
1103
|
+
],
|
|
1104
|
+
"model-value": o.modelValue ?? [],
|
|
1105
|
+
"onUpdate:modelValue": a[13] || (a[13] = (m) => u("update:model-value", m))
|
|
1106
|
+
}, null, 8, ["model-value"])) : o.type == "collectible" ? (n(), f(w, {
|
|
1107
|
+
key: 14,
|
|
1108
|
+
multiselect: !0,
|
|
1109
|
+
items: [],
|
|
1110
|
+
"model-value": o.modelValue ?? [],
|
|
1111
|
+
"onUpdate:modelValue": a[14] || (a[14] = (m) => u("update:model-value", m))
|
|
1112
|
+
}, null, 8, ["model-value"])) : o.type == "segment" ? (n(), f(w, {
|
|
1113
|
+
key: 15,
|
|
1114
|
+
multiselect: !0,
|
|
1115
|
+
items: e(X)().segmentOptions,
|
|
1116
|
+
"model-value": o.modelValue ?? [],
|
|
1117
|
+
"onUpdate:modelValue": a[15] || (a[15] = (m) => u("update:model-value", m)),
|
|
1118
|
+
label: "Select segment(s) to match"
|
|
1119
|
+
}, null, 8, ["items", "model-value"])) : o.type == "title" ? (n(), f(w, {
|
|
1120
|
+
key: 16,
|
|
1121
|
+
multiselect: !0,
|
|
1122
|
+
items: (e(X)().sortedTitles ?? []).map((m) => ({
|
|
1123
|
+
label: m.name,
|
|
1124
|
+
value: m._id
|
|
1125
|
+
})),
|
|
1126
|
+
"model-value": o.modelValue ?? [],
|
|
1127
|
+
"onUpdate:modelValue": a[16] || (a[16] = (m) => u("update:model-value", m))
|
|
1128
|
+
}, null, 8, ["items", "model-value"])) : o.type == "product" ? (n(), f(nt, {
|
|
1129
|
+
key: 17,
|
|
1130
|
+
"model-value": o.modelValue,
|
|
1131
|
+
"onUpdate:modelValue": a[17] || (a[17] = (m) => u("update:model-value", m))
|
|
1132
|
+
}, null, 8, ["model-value"])) : o.type == "location" ? (n(), f(w, {
|
|
1133
|
+
key: 18,
|
|
1134
|
+
multiselect: !0,
|
|
1135
|
+
items: e(te)().locations.map((m) => ({
|
|
1136
|
+
label: m.name,
|
|
1137
|
+
value: m._id
|
|
1138
|
+
})),
|
|
1139
|
+
"model-value": o.modelValue ?? [],
|
|
1140
|
+
"onUpdate:modelValue": a[18] || (a[18] = (m) => u("update:model-value", m))
|
|
1141
|
+
}, null, 8, ["items", "model-value"])) : (n(), V("div", ut, "Rule: " + A(o.type) + " Not implemented", 1)),
|
|
1142
|
+
c(R, {
|
|
1143
|
+
class: "items-end",
|
|
1144
|
+
state: e(le).helperState(e(v), ""),
|
|
1145
|
+
text: e(le).helperText(e(v), "")
|
|
1146
|
+
}, null, 8, ["state", "text"])
|
|
1147
|
+
], 2);
|
|
1148
|
+
};
|
|
1149
|
+
}
|
|
1150
|
+
}), mt = { class: "space-y-4" }, it = { class: "fm-typo-en-body-lg-400" }, dt = { class: "fm-typo-en-body-lg-400" }, pt = { class: "flex items-center gap-8" }, ct = { class: "fm-typo-en-body-lg-400" }, yt = { class: "flex items-center justify-end gap-8 pt-16 w-full" }, vt = /* @__PURE__ */ P({
|
|
1151
|
+
__name: "CustomRuleDialog",
|
|
1152
|
+
props: {
|
|
1153
|
+
triggerType: {
|
|
1154
|
+
type: String,
|
|
1155
|
+
required: !0
|
|
1156
|
+
},
|
|
1157
|
+
includeOnly: {
|
|
1158
|
+
type: String
|
|
1159
|
+
},
|
|
1160
|
+
modelValue: {
|
|
1161
|
+
type: Object,
|
|
1162
|
+
default: () => {
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
},
|
|
1166
|
+
setup(o) {
|
|
1167
|
+
const x = ue(), g = X(), { emitData: u, emitAction: v } = ye(), { t } = G(), a = {
|
|
1168
|
+
"user.member": "connect.template.rule.custom_modal.properties.user_member",
|
|
1169
|
+
"user.parentReferralCode": "connect.template.rule.custom_modal.properties.user_parent_referral_code",
|
|
1170
|
+
"user.name": "connect.template.rule.custom_modal.properties.user_name",
|
|
1171
|
+
"user.phoneNumber": "connect.template.rule.custom_modal.properties.user_phone_number",
|
|
1172
|
+
"user.email": "connect.template.rule.custom_modal.properties.user_email",
|
|
1173
|
+
"user.birthday": "connect.template.rule.custom_modal.properties.user_birthday",
|
|
1174
|
+
"user.joinAt": "connect.template.rule.custom_modal.properties.user_join_at",
|
|
1175
|
+
"user.location": "connect.template.rule.custom_modal.properties.user_location",
|
|
1176
|
+
"user.gender": "connect.template.rule.custom_modal.properties.user_gender",
|
|
1177
|
+
"user.titles": "connect.template.rule.custom_modal.properties.user_titles",
|
|
1178
|
+
"user.point": "connect.template.rule.custom_modal.properties.user_point",
|
|
1179
|
+
"user.tier": "connect.template.rule.custom_modal.properties.user_tier",
|
|
1180
|
+
"user.segment": "connect.template.rule.custom_modal.properties.user_segment",
|
|
1181
|
+
"user.stats.avgBillSize": "connect.template.rule.custom_modal.properties.user_stats_avg_bill_size",
|
|
1182
|
+
"user.stats.avgVisitFrequency": "connect.template.rule.custom_modal.properties.user_stats_avg_visit_frequency",
|
|
1183
|
+
"user.stats.feedbackCount": "connect.template.rule.custom_modal.properties.user_stats_feedback_count",
|
|
1184
|
+
"user.stats.lastVisit": "connect.template.rule.custom_modal.properties.user_stats_last_visit",
|
|
1185
|
+
"user.stats.topupCount": "connect.template.rule.custom_modal.properties.user_stats_topup_count",
|
|
1186
|
+
"user.stats.visitCount": "connect.template.rule.custom_modal.properties.user_stats_visit_count",
|
|
1187
|
+
"user.stats.lastSeasonPointEarned": "connect.template.rule.custom_modal.properties.user_stats_last_season_point_earned",
|
|
1188
|
+
"user.stats.lastSeasonTierEarned": "connect.template.rule.custom_modal.properties.user_stats_last_season_tier_earned",
|
|
1189
|
+
"user.expiringVouchers.days7": "connect.template.rule.custom_modal.properties.user_expiring_vouchers_days_7",
|
|
1190
|
+
"user.expiringVouchers.days30": "connect.template.rule.custom_modal.properties.user_expiring_vouchers_days_30",
|
|
1191
|
+
"user.expiringVouchers.days90": "connect.template.rule.custom_modal.properties.user_expiring_vouchers_days_90"
|
|
1192
|
+
}, s = {
|
|
1193
|
+
_is: "connect.template.rule.custom_modal.operators.is",
|
|
1194
|
+
_contains: "connect.template.rule.custom_modal.operators.contains",
|
|
1195
|
+
_equal: "connect.template.rule.custom_modal.operators.equal",
|
|
1196
|
+
_lessThan: "connect.template.rule.custom_modal.operators.less_than",
|
|
1197
|
+
_moreThan: "connect.template.rule.custom_modal.operators.more_than",
|
|
1198
|
+
_lessThanOrEqual: "connect.template.rule.custom_modal.operators.less_than_or_equal",
|
|
1199
|
+
_moreThanOrEqual: "connect.template.rule.custom_modal.operators.more_than_or_equal",
|
|
1200
|
+
_isDay: "connect.template.rule.custom_modal.operators.is_day",
|
|
1201
|
+
_isRange: "connect.template.rule.custom_modal.operators.is_in_range",
|
|
1202
|
+
_isOnDate: "connect.template.rule.custom_modal.operators.is_on_date",
|
|
1203
|
+
_isBetween: "connect.template.rule.custom_modal.operators.is_between",
|
|
1204
|
+
_isInMonth: "connect.template.rule.custom_modal.operators.is_in_month",
|
|
1205
|
+
_rrule: "connect.template.rule.custom_modal.operators.matches_occurrence",
|
|
1206
|
+
_isBetweenTime: "connect.template.rule.custom_modal.operators.between_time",
|
|
1207
|
+
_isOnTime: "connect.template.rule.custom_modal.operators.is_on_time",
|
|
1208
|
+
_isIn: "connect.template.rule.custom_modal.operators.is_in",
|
|
1209
|
+
_hasAll: "connect.template.rule.custom_modal.operators.has_all_of",
|
|
1210
|
+
_hasAny: "connect.template.rule.custom_modal.operators.has_any_of"
|
|
1211
|
+
};
|
|
1212
|
+
function r(T) {
|
|
1213
|
+
if (!T) return "";
|
|
1214
|
+
const S = a[T.property];
|
|
1215
|
+
return S ? t(S) : T.name;
|
|
1216
|
+
}
|
|
1217
|
+
function E(T) {
|
|
1218
|
+
const S = s[T];
|
|
1219
|
+
return S ? t(S) : de[T].name;
|
|
1220
|
+
}
|
|
1221
|
+
const i = o, b = M(
|
|
1222
|
+
() => ke(i.triggerType, i.includeOnly)
|
|
1223
|
+
), k = M(
|
|
1224
|
+
() => b.value.find((T) => {
|
|
1225
|
+
var S;
|
|
1226
|
+
return T.property == ((S = p.value) == null ? void 0 : S.property);
|
|
1227
|
+
})
|
|
1228
|
+
), R = (T) => ie[b.value.find((S) => S.property === T).type], D = M(() => {
|
|
1229
|
+
if (!p.value) return [];
|
|
1230
|
+
const T = b.value.find(
|
|
1231
|
+
(S) => S.property === p.value.property
|
|
1232
|
+
);
|
|
1233
|
+
return T ? ie[T.type].filter((S) => {
|
|
1234
|
+
var L, H;
|
|
1235
|
+
return !((H = (L = de[S]) == null ? void 0 : L.exclude) != null && H.includes(p.value.property));
|
|
1236
|
+
}).map((S) => ({
|
|
1237
|
+
label: E(S),
|
|
1238
|
+
value: S
|
|
1239
|
+
})) : [];
|
|
1240
|
+
}), d = he, l = M(() => {
|
|
1241
|
+
const T = d.safeParse(p.value);
|
|
1242
|
+
return T.success ? [] : T.error.errors;
|
|
1243
|
+
}), y = W(!1), p = W(
|
|
1244
|
+
ve(i.modelValue) ?? O.constructEntry(
|
|
1245
|
+
b.value[0].property,
|
|
1246
|
+
R(b.value[0].property)[0],
|
|
1247
|
+
null
|
|
1248
|
+
)
|
|
1249
|
+
), C = M(() => {
|
|
1250
|
+
var h;
|
|
1251
|
+
const { property: T, negated: S, conditions: L } = p.value, H = Object.keys(L || {})[0], Q = Object.values(L || {})[0];
|
|
1252
|
+
return {
|
|
1253
|
+
property: T,
|
|
1254
|
+
negated: S == !0,
|
|
1255
|
+
type: (h = b.value.find((z) => z.property === T)) == null ? void 0 : h.type,
|
|
1256
|
+
operator: H,
|
|
1257
|
+
equator: Q
|
|
1258
|
+
};
|
|
1259
|
+
});
|
|
1260
|
+
function m(T) {
|
|
1261
|
+
p.value = O.constructEntry(
|
|
1262
|
+
T,
|
|
1263
|
+
R(T)[0],
|
|
1264
|
+
null
|
|
1265
|
+
);
|
|
1266
|
+
}
|
|
1267
|
+
function Y(T) {
|
|
1268
|
+
p.value = { ...p.value, negated: T == !0 };
|
|
1269
|
+
}
|
|
1270
|
+
function oe(T) {
|
|
1271
|
+
p.value = {
|
|
1272
|
+
...p.value,
|
|
1273
|
+
conditions: { [T]: null }
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
function J(T) {
|
|
1277
|
+
p.value.conditions = {
|
|
1278
|
+
[C.value.operator]: T
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1281
|
+
function ee() {
|
|
1282
|
+
u(p.value), v("primary"), x.close();
|
|
1283
|
+
}
|
|
1284
|
+
return pe(async () => {
|
|
1285
|
+
await g.readMembership();
|
|
1286
|
+
}), (T, S) => {
|
|
1287
|
+
const L = _("FmIcon"), H = _("FmField"), Q = _("FmPill"), h = _("FmMenuItem"), z = _("FmMenu"), se = _("FmButton");
|
|
1288
|
+
return n(), V("div", mt, [
|
|
1289
|
+
U("div", it, A(e(t)("connect.template.rule.custom_modal.property")), 1),
|
|
1290
|
+
c(z, {
|
|
1291
|
+
shift: !0,
|
|
1292
|
+
placement: "bottom-start",
|
|
1293
|
+
modelValue: e(y),
|
|
1294
|
+
"onUpdate:modelValue": S[0] || (S[0] = (I) => fe(y) ? y.value = I : null),
|
|
1295
|
+
onMenuChanged: S[1] || (S[1] = (I) => y.value = I),
|
|
1296
|
+
"max-height": 300
|
|
1297
|
+
}, {
|
|
1298
|
+
"menu-button": B(() => [
|
|
1299
|
+
c(H, null, {
|
|
1300
|
+
append: B(() => [
|
|
1301
|
+
c(L, {
|
|
1302
|
+
name: e(y) ? "expand_less" : "expand_more"
|
|
1303
|
+
}, null, 8, ["name"])
|
|
1304
|
+
]),
|
|
1305
|
+
default: B(() => [
|
|
1306
|
+
ne(A(r(e(k))) + " ", 1)
|
|
1307
|
+
]),
|
|
1308
|
+
_: 1
|
|
1309
|
+
})
|
|
1310
|
+
]),
|
|
1311
|
+
default: B(() => [
|
|
1312
|
+
(n(!0), V(q, null, $(e(b), (I) => (n(), f(h, {
|
|
1313
|
+
key: I.property,
|
|
1314
|
+
"model-value": e(p).property == I.property,
|
|
1315
|
+
label: r(I),
|
|
1316
|
+
disabled: I.premium && !e(te)().isPremium,
|
|
1317
|
+
onClick: (Vt) => I.premium && !e(te)().isPremium ? null : m(I.property)
|
|
1318
|
+
}, ce({ _: 2 }, [
|
|
1319
|
+
I.premium ? {
|
|
1320
|
+
name: "append",
|
|
1321
|
+
fn: B(() => [
|
|
1322
|
+
c(Q, { variant: "premium" })
|
|
1323
|
+
]),
|
|
1324
|
+
key: "0"
|
|
1325
|
+
} : void 0
|
|
1326
|
+
]), 1032, ["model-value", "label", "disabled", "onClick"]))), 128))
|
|
1327
|
+
]),
|
|
1328
|
+
_: 1
|
|
1329
|
+
}, 8, ["modelValue"]),
|
|
1330
|
+
U("div", dt, A(e(t)("connect.template.rule.custom_modal.check_to_perform")), 1),
|
|
1331
|
+
U("div", pt, [
|
|
1332
|
+
c(w, {
|
|
1333
|
+
class: "w-1/4",
|
|
1334
|
+
items: [
|
|
1335
|
+
{ label: e(t)("connect.template.rule.custom_modal.is"), value: !1 },
|
|
1336
|
+
{
|
|
1337
|
+
label: e(t)("connect.template.rule.custom_modal.is_not"),
|
|
1338
|
+
value: !0
|
|
1339
|
+
}
|
|
1340
|
+
],
|
|
1341
|
+
"model-value": e(p).negated ?? !1,
|
|
1342
|
+
"onUpdate:modelValue": Y
|
|
1343
|
+
}, null, 8, ["items", "model-value"]),
|
|
1344
|
+
c(w, {
|
|
1345
|
+
class: "flex-1",
|
|
1346
|
+
items: e(D),
|
|
1347
|
+
"model-value": e(C).operator,
|
|
1348
|
+
"onUpdate:modelValue": oe
|
|
1349
|
+
}, null, 8, ["items", "model-value"])
|
|
1350
|
+
]),
|
|
1351
|
+
U("div", null, [
|
|
1352
|
+
U("div", ct, A(e(t)("connect.template.rule.custom_modal.criteria")), 1),
|
|
1353
|
+
e(C).type ? (n(), f(st, {
|
|
1354
|
+
key: 0,
|
|
1355
|
+
type: e(C).type,
|
|
1356
|
+
operator: e(C).operator,
|
|
1357
|
+
"model-value": e(C).equator,
|
|
1358
|
+
"onUpdate:modelValue": J
|
|
1359
|
+
}, null, 8, ["type", "operator", "model-value"])) : N("", !0)
|
|
1360
|
+
]),
|
|
1361
|
+
U("div", yt, [
|
|
1362
|
+
c(se, {
|
|
1363
|
+
onClick: S[2] || (S[2] = (I) => e(x).close()),
|
|
1364
|
+
label: e(t)("connect.common.cancel"),
|
|
1365
|
+
variant: "tertiary"
|
|
1366
|
+
}, null, 8, ["label"]),
|
|
1367
|
+
c(se, {
|
|
1368
|
+
onClick: S[3] || (S[3] = (I) => ee()),
|
|
1369
|
+
disabled: e(l).length > 0,
|
|
1370
|
+
label: e(t)("connect.common.save")
|
|
1371
|
+
}, null, 8, ["disabled", "label"])
|
|
1372
|
+
])
|
|
1373
|
+
]);
|
|
1374
|
+
};
|
|
1375
|
+
}
|
|
1376
|
+
}), bt = { class: "flex flex-col gap-8" }, ft = { class: "grid grid-cols-2 items-center" }, gt = { class: "flex items-center gap-8" }, _t = { class: "pt-16 flex items-center self-end gap-8" }, kt = /* @__PURE__ */ P({
|
|
1377
|
+
__name: "PresetRuleDialog",
|
|
1378
|
+
props: {
|
|
1379
|
+
preset: {
|
|
1380
|
+
type: String,
|
|
1381
|
+
required: !0
|
|
1382
|
+
},
|
|
1383
|
+
defaultValue: {
|
|
1384
|
+
type: Object
|
|
1385
|
+
},
|
|
1386
|
+
modelValue: {
|
|
1387
|
+
type: Object
|
|
1388
|
+
}
|
|
1389
|
+
},
|
|
1390
|
+
setup(o) {
|
|
1391
|
+
const x = ue(), { emitData: g, emitAction: u } = ye(), v = X(), { t } = G(), a = o;
|
|
1392
|
+
function s() {
|
|
1393
|
+
const { operator: d, equator: l } = i.value;
|
|
1394
|
+
switch (a.preset) {
|
|
1395
|
+
case "MIN_SPEND":
|
|
1396
|
+
case "SPECIFIC_DATE":
|
|
1397
|
+
case "SPECIFIC_TIMERANGE":
|
|
1398
|
+
case "WEEKLY":
|
|
1399
|
+
case "MONTHLY":
|
|
1400
|
+
case "BIRTHDAY":
|
|
1401
|
+
case "TIER": {
|
|
1402
|
+
const y = v.sortedTiers.filter((p, C) => d == "_equal" ? C + 1 == l : d == "_moreThanOrEqual" ? C + 1 >= l : C + 1 <= l);
|
|
1403
|
+
return t("connect.template.rule.preset_modal.applies_to", {
|
|
1404
|
+
tiers: y.map((p) => p.name).join(", ")
|
|
1405
|
+
});
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
function r() {
|
|
1410
|
+
var d, l;
|
|
1411
|
+
switch (a.preset) {
|
|
1412
|
+
case "MIN_SPEND":
|
|
1413
|
+
return O.constructEntry("bill.amount", "_moreThanOrEqual", 0);
|
|
1414
|
+
case "SPECIFIC_DATE":
|
|
1415
|
+
return O.constructEntry(
|
|
1416
|
+
"trigger.date",
|
|
1417
|
+
"_isOnDate",
|
|
1418
|
+
(/* @__PURE__ */ new Date()).toISOString()
|
|
1419
|
+
);
|
|
1420
|
+
case "SPECIFIC_TIMERANGE":
|
|
1421
|
+
return O.constructEntry("trigger.time", "_isBetweenTime", [
|
|
1422
|
+
{ start: "00:00", end: "23:59" }
|
|
1423
|
+
]);
|
|
1424
|
+
case "WEEKLY":
|
|
1425
|
+
return O.constructEntry(
|
|
1426
|
+
"trigger.date",
|
|
1427
|
+
"_rrule",
|
|
1428
|
+
"RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=SU;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
1429
|
+
);
|
|
1430
|
+
case "MONTHLY":
|
|
1431
|
+
return O.constructEntry(
|
|
1432
|
+
"trigger.date",
|
|
1433
|
+
"_rrule",
|
|
1434
|
+
"RRULE:FREQ=MONTHLY;WKST=SU;BYMONTHDAY=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
1435
|
+
);
|
|
1436
|
+
case "BIRTHDAY":
|
|
1437
|
+
console.log("birthday", a);
|
|
1438
|
+
const y = O.constructEntry(
|
|
1439
|
+
a.defaultValue.property,
|
|
1440
|
+
a.defaultValue.operator,
|
|
1441
|
+
a.defaultValue.equator
|
|
1442
|
+
);
|
|
1443
|
+
return console.log(y), y;
|
|
1444
|
+
case "TIER":
|
|
1445
|
+
return O.constructEntry("user.tier", "_equal", 1);
|
|
1446
|
+
case "TITLE":
|
|
1447
|
+
return O.constructEntry("user.titles", "_hasAny", [
|
|
1448
|
+
(l = (d = v.sortedTitles) == null ? void 0 : d[0]) == null ? void 0 : l._id
|
|
1449
|
+
]);
|
|
1450
|
+
case "LAST_X_DAY":
|
|
1451
|
+
return O.constructEntry("user.stats.lastVisit", "_isRange", {
|
|
1452
|
+
op: "last",
|
|
1453
|
+
unit: "day",
|
|
1454
|
+
ignoreYear: !0,
|
|
1455
|
+
x: 0
|
|
1456
|
+
});
|
|
1457
|
+
case "CUSTOM":
|
|
1458
|
+
throw new Error("Not implemented");
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
const E = W(r()), i = M(() => {
|
|
1462
|
+
const d = O.simplify(E.value);
|
|
1463
|
+
return {
|
|
1464
|
+
...d,
|
|
1465
|
+
equator: d.equator
|
|
1466
|
+
};
|
|
1467
|
+
});
|
|
1468
|
+
function b(d, l) {
|
|
1469
|
+
const y = i.value;
|
|
1470
|
+
E.value = O.constructEntry(
|
|
1471
|
+
y.property,
|
|
1472
|
+
l ?? y.operator,
|
|
1473
|
+
d,
|
|
1474
|
+
E.value.name
|
|
1475
|
+
);
|
|
1476
|
+
}
|
|
1477
|
+
function k() {
|
|
1478
|
+
g(E.value), u("primary"), x.close();
|
|
1479
|
+
}
|
|
1480
|
+
const R = M(() => {
|
|
1481
|
+
const d = Ee.safeParse(E.value);
|
|
1482
|
+
return d.success ? [] : d.error.errors;
|
|
1483
|
+
});
|
|
1484
|
+
pe(async () => {
|
|
1485
|
+
await v.readMembership();
|
|
1486
|
+
});
|
|
1487
|
+
const D = M(() => [
|
|
1488
|
+
{
|
|
1489
|
+
label: t("connect.template.rule.preset_modal.unit.day"),
|
|
1490
|
+
value: "day"
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
label: t("connect.template.rule.preset_modal.unit.week"),
|
|
1494
|
+
value: "week"
|
|
1495
|
+
},
|
|
1496
|
+
{
|
|
1497
|
+
label: t("connect.template.rule.preset_modal.unit.month"),
|
|
1498
|
+
value: "month"
|
|
1499
|
+
}
|
|
1500
|
+
]);
|
|
1501
|
+
return (d, l) => {
|
|
1502
|
+
var T, S, L, H, Q;
|
|
1503
|
+
const y = _("FmStepperField"), p = _("FmDatePicker"), C = _("FmTimeRangePicker"), m = _("FmRadio"), Y = _("FmSelect"), oe = _("FmRadioGroup"), J = _("FmHelperText"), ee = _("FmButton");
|
|
1504
|
+
return n(), V("div", bt, [
|
|
1505
|
+
o.preset == "MIN_SPEND" ? (n(), f(y, {
|
|
1506
|
+
key: 0,
|
|
1507
|
+
label: e(t)("connect.template.rule.preset.minimum_spend"),
|
|
1508
|
+
"model-value": e(i).equator,
|
|
1509
|
+
"onUpdate:modelValue": l[0] || (l[0] = (h) => b(h))
|
|
1510
|
+
}, null, 8, ["label", "model-value"])) : N("", !0),
|
|
1511
|
+
o.preset == "LAST_X_DAY" ? (n(), f(y, {
|
|
1512
|
+
key: 1,
|
|
1513
|
+
label: "",
|
|
1514
|
+
min: 0,
|
|
1515
|
+
prepent: e(t)("connect.template.rule.preset_modal.day"),
|
|
1516
|
+
"model-value": e(i).equator.x,
|
|
1517
|
+
rules: [
|
|
1518
|
+
(h) => h >= 0 || e(t)(
|
|
1519
|
+
"connect.template.rule.preset_modal.value_must_be_greater_than_0"
|
|
1520
|
+
)
|
|
1521
|
+
],
|
|
1522
|
+
"onUpdate:modelValue": l[1] || (l[1] = (h) => b({
|
|
1523
|
+
op: "last",
|
|
1524
|
+
unit: "day",
|
|
1525
|
+
ignoreYear: !0,
|
|
1526
|
+
x: h
|
|
1527
|
+
}))
|
|
1528
|
+
}, null, 8, ["prepent", "model-value", "rules"])) : o.preset == "SPECIFIC_DATE" ? (n(), f(p, {
|
|
1529
|
+
key: 2,
|
|
1530
|
+
label: e(t)("connect.template.rule.preset.specific_date"),
|
|
1531
|
+
"model-value": e(i).equator,
|
|
1532
|
+
"onUpdate:modelValue": l[2] || (l[2] = (h) => b(h))
|
|
1533
|
+
}, null, 8, ["label", "model-value"])) : o.preset == "SPECIFIC_TIMERANGE" ? (n(), f(C, {
|
|
1534
|
+
key: 3,
|
|
1535
|
+
label: e(t)("connect.template.rule.preset_modal.time_is_between"),
|
|
1536
|
+
"disable-time-check": !0,
|
|
1537
|
+
"model-value": [(S = (T = e(i).equator) == null ? void 0 : T[0]) == null ? void 0 : S.start, (H = (L = e(i).equator) == null ? void 0 : L[0]) == null ? void 0 : H.end],
|
|
1538
|
+
"onUpdate:modelValue": l[3] || (l[3] = (h) => b([
|
|
1539
|
+
{
|
|
1540
|
+
start: h[0],
|
|
1541
|
+
end: h[1]
|
|
1542
|
+
}
|
|
1543
|
+
]))
|
|
1544
|
+
}, null, 8, ["label", "model-value"])) : o.preset == "WEEKLY" ? (n(), f(re, {
|
|
1545
|
+
key: 4,
|
|
1546
|
+
label: e(t)("connect.template.rule.preset.weekly"),
|
|
1547
|
+
"fixed-frequency": !0,
|
|
1548
|
+
"model-value": e(i).equator,
|
|
1549
|
+
"onUpdate:modelValue": l[4] || (l[4] = (h) => b(h))
|
|
1550
|
+
}, null, 8, ["label", "model-value"])) : o.preset == "MONTHLY" ? (n(), f(re, {
|
|
1551
|
+
key: 5,
|
|
1552
|
+
label: e(t)("connect.template.rule.preset.monthly"),
|
|
1553
|
+
"fixed-frequency": !0,
|
|
1554
|
+
"model-value": e(i).equator,
|
|
1555
|
+
"onUpdate:modelValue": l[5] || (l[5] = (h) => b(h))
|
|
1556
|
+
}, null, 8, ["label", "model-value"])) : o.preset == "BIRTHDAY" ? (n(), V(q, { key: 6 }, [
|
|
1557
|
+
U("div", ft, [
|
|
1558
|
+
c(m, {
|
|
1559
|
+
label: e(t)("connect.template.rule.birthday.days_before"),
|
|
1560
|
+
value: "_isDay",
|
|
1561
|
+
"model-value": e(i).operator,
|
|
1562
|
+
"onUpdate:modelValue": l[6] || (l[6] = () => {
|
|
1563
|
+
b(
|
|
1564
|
+
{
|
|
1565
|
+
op: "after",
|
|
1566
|
+
x: 1,
|
|
1567
|
+
ignoreYear: !0
|
|
1568
|
+
},
|
|
1569
|
+
"_isDay"
|
|
1570
|
+
);
|
|
1571
|
+
})
|
|
1572
|
+
}, null, 8, ["label", "model-value"]),
|
|
1573
|
+
U("div", gt, [
|
|
1574
|
+
c(m, {
|
|
1575
|
+
label: e(t)("connect.template.rule.preset_modal.is_in_this"),
|
|
1576
|
+
value: "_isRange",
|
|
1577
|
+
"model-value": e(i).operator,
|
|
1578
|
+
"onUpdate:modelValue": l[7] || (l[7] = () => {
|
|
1579
|
+
b(
|
|
1580
|
+
{
|
|
1581
|
+
op: "this",
|
|
1582
|
+
unit: "day",
|
|
1583
|
+
ignoreYear: !0
|
|
1584
|
+
},
|
|
1585
|
+
"_isRange"
|
|
1586
|
+
);
|
|
1587
|
+
})
|
|
1588
|
+
}, null, 8, ["label", "model-value"]),
|
|
1589
|
+
e(i).operator == "_isRange" ? (n(), f(Y, {
|
|
1590
|
+
key: 0,
|
|
1591
|
+
items: e(D),
|
|
1592
|
+
"model-value": e(i).equator.unit,
|
|
1593
|
+
"onUpdate:modelValue": l[8] || (l[8] = (h) => b(
|
|
1594
|
+
{
|
|
1595
|
+
op: "this",
|
|
1596
|
+
unit: h,
|
|
1597
|
+
ignoreYear: !0
|
|
1598
|
+
},
|
|
1599
|
+
"_isRange"
|
|
1600
|
+
))
|
|
1601
|
+
}, null, 8, ["items", "model-value"])) : N("", !0)
|
|
1602
|
+
])
|
|
1603
|
+
]),
|
|
1604
|
+
e(i).operator == "_isDay" ? (n(), f(y, {
|
|
1605
|
+
key: 0,
|
|
1606
|
+
label: e(t)("connect.template.rule.birthday.days_before_label"),
|
|
1607
|
+
"show-steppers": !1,
|
|
1608
|
+
"model-value": e(i).equator.x,
|
|
1609
|
+
"onUpdate:modelValue": l[9] || (l[9] = (h) => b({
|
|
1610
|
+
op: "after",
|
|
1611
|
+
x: h,
|
|
1612
|
+
ignoreYear: !0
|
|
1613
|
+
}))
|
|
1614
|
+
}, null, 8, ["label", "model-value"])) : N("", !0)
|
|
1615
|
+
], 64)) : o.preset == "TIER" ? (n(), V(q, { key: 7 }, [
|
|
1616
|
+
c(oe, {
|
|
1617
|
+
inline: !0,
|
|
1618
|
+
"model-value": e(i).operator,
|
|
1619
|
+
"onUpdate:modelValue": l[10] || (l[10] = (h) => b(e(i).equator, h))
|
|
1620
|
+
}, {
|
|
1621
|
+
default: B(() => [
|
|
1622
|
+
c(m, {
|
|
1623
|
+
value: "_moreThanOrEqual",
|
|
1624
|
+
label: e(t)("connect.template.rule.preset_modal.at_least")
|
|
1625
|
+
}, null, 8, ["label"]),
|
|
1626
|
+
c(m, {
|
|
1627
|
+
value: "_equal",
|
|
1628
|
+
label: e(t)("connect.template.rule.preset_modal.equal")
|
|
1629
|
+
}, null, 8, ["label"]),
|
|
1630
|
+
c(m, {
|
|
1631
|
+
value: "_lessThanOrEqual",
|
|
1632
|
+
label: e(t)("connect.template.rule.preset_modal.at_most")
|
|
1633
|
+
}, null, 8, ["label"])
|
|
1634
|
+
]),
|
|
1635
|
+
_: 1
|
|
1636
|
+
}, 8, ["model-value"]),
|
|
1637
|
+
c(w, {
|
|
1638
|
+
items: (e(v).sortedTiers ?? []).map((h, z) => ({
|
|
1639
|
+
label: `Tier ${z + 1} - ${h.name}`,
|
|
1640
|
+
value: z + 1
|
|
1641
|
+
})),
|
|
1642
|
+
"model-value": e(i).equator,
|
|
1643
|
+
"onUpdate:modelValue": l[11] || (l[11] = (h) => b(h))
|
|
1644
|
+
}, null, 8, ["items", "model-value"]),
|
|
1645
|
+
c(J, {
|
|
1646
|
+
text: s()
|
|
1647
|
+
}, null, 8, ["text"])
|
|
1648
|
+
], 64)) : o.preset == "TITLE" ? (n(), f(w, {
|
|
1649
|
+
key: 8,
|
|
1650
|
+
label: e(t)("connect.template.rule.preset_modal.user_has_title"),
|
|
1651
|
+
items: (e(v).sortedTitles ?? []).map((h) => ({
|
|
1652
|
+
label: h.name,
|
|
1653
|
+
value: h._id
|
|
1654
|
+
})),
|
|
1655
|
+
"model-value": (Q = e(i).equator) == null ? void 0 : Q[0],
|
|
1656
|
+
"onUpdate:modelValue": l[12] || (l[12] = (h) => b([h]))
|
|
1657
|
+
}, null, 8, ["label", "items", "model-value"])) : N("", !0),
|
|
1658
|
+
c(J, {
|
|
1659
|
+
class: "mt-[-8px]",
|
|
1660
|
+
text: e(le).helperText(e(R), ""),
|
|
1661
|
+
state: e(le).helperState(e(R), "")
|
|
1662
|
+
}, null, 8, ["text", "state"]),
|
|
1663
|
+
U("div", _t, [
|
|
1664
|
+
c(ee, {
|
|
1665
|
+
onClick: l[13] || (l[13] = (h) => e(x).close()),
|
|
1666
|
+
label: e(t)("connect.common.cancel"),
|
|
1667
|
+
variant: "tertiary"
|
|
1668
|
+
}, null, 8, ["label"]),
|
|
1669
|
+
c(ee, {
|
|
1670
|
+
onClick: l[14] || (l[14] = (h) => k()),
|
|
1671
|
+
disabled: e(R).length > 0,
|
|
1672
|
+
label: e(t)("connect.common.save")
|
|
1673
|
+
}, null, 8, ["disabled", "label"])
|
|
1674
|
+
])
|
|
1675
|
+
]);
|
|
1676
|
+
};
|
|
1677
|
+
}
|
|
1678
|
+
}), ht = /* @__PURE__ */ P({
|
|
1679
|
+
__name: "RuleConfigurator",
|
|
1680
|
+
props: {
|
|
1681
|
+
triggerType: {
|
|
1682
|
+
type: String,
|
|
1683
|
+
required: !0
|
|
1684
|
+
},
|
|
1685
|
+
includeOnly: {
|
|
1686
|
+
type: String
|
|
1687
|
+
},
|
|
1688
|
+
modelValue: {
|
|
1689
|
+
type: Object,
|
|
1690
|
+
default: () => {
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
},
|
|
1694
|
+
emits: ["update:model-value"],
|
|
1695
|
+
setup(o, { expose: x, emit: g }) {
|
|
1696
|
+
const u = te(), { t: v, te: t } = G(), a = {
|
|
1697
|
+
"Minimum spend": "connect.template.rule.preset.minimum_spend",
|
|
1698
|
+
"Specific date": "connect.template.rule.preset.specific_date",
|
|
1699
|
+
"Specific time range": "connect.template.rule.preset.specific_time_range",
|
|
1700
|
+
Weekly: "connect.template.rule.preset.weekly",
|
|
1701
|
+
Monthly: "connect.template.rule.preset.monthly",
|
|
1702
|
+
Birthday: "connect.template.rule.preset.birthday",
|
|
1703
|
+
"Birthday Week": "connect.template.rule.preset.birthday_week",
|
|
1704
|
+
"Birthday Month": "connect.template.rule.preset.birthday_month",
|
|
1705
|
+
"N day before birthday": "connect.template.rule.preset.n_day_before_birthday",
|
|
1706
|
+
"Specific tier": "connect.template.rule.preset.specific_tier",
|
|
1707
|
+
"Specific title": "connect.template.rule.preset.specific_title",
|
|
1708
|
+
"Last visit in X days": "connect.template.rule.preset.last_visit_in_x_days",
|
|
1709
|
+
"Weekday special": "connect.template.rule.preset.weekday_special",
|
|
1710
|
+
"Weekend special": "connect.template.rule.preset.weekend_special",
|
|
1711
|
+
"Happy hour": "connect.template.rule.preset.happy_hour",
|
|
1712
|
+
"Mother's day special": "connect.template.rule.preset.mothers_day_special",
|
|
1713
|
+
"Father's day special": "connect.template.rule.preset.fathers_day_special",
|
|
1714
|
+
Christmas: "connect.template.rule.preset.christmas",
|
|
1715
|
+
"Feedback rating": "connect.template.rule.preset.feedback_rating",
|
|
1716
|
+
Custom: "connect.template.rule.preset.custom"
|
|
1717
|
+
}, s = o, r = g, E = ue(), i = W();
|
|
1718
|
+
function b(d) {
|
|
1719
|
+
const [l] = d.rules;
|
|
1720
|
+
E.open({
|
|
1721
|
+
title: D(d),
|
|
1722
|
+
closeButton: !1,
|
|
1723
|
+
dismissAway: !1,
|
|
1724
|
+
contentComponent: kt,
|
|
1725
|
+
contentComponentProps: {
|
|
1726
|
+
preset: d.type,
|
|
1727
|
+
defaultValue: l,
|
|
1728
|
+
modelValue: s.modelValue
|
|
1729
|
+
}
|
|
1730
|
+
}).onPrimary((y) => r("update:model-value", y));
|
|
1731
|
+
}
|
|
1732
|
+
function k(d) {
|
|
1733
|
+
E.open({
|
|
1734
|
+
title: v("connect.template.rule.edit_rule"),
|
|
1735
|
+
closeButton: !1,
|
|
1736
|
+
dismissAway: !1,
|
|
1737
|
+
contentComponent: vt,
|
|
1738
|
+
contentComponentProps: {
|
|
1739
|
+
triggerType: s.triggerType,
|
|
1740
|
+
includeOnly: s.includeOnly,
|
|
1741
|
+
modelValue: d
|
|
1742
|
+
}
|
|
1743
|
+
}).onPrimary((l) => r("update:model-value", l));
|
|
1744
|
+
}
|
|
1745
|
+
function R(d) {
|
|
1746
|
+
if (d.type == "CUSTOM") {
|
|
1747
|
+
const [l] = d.rules;
|
|
1748
|
+
return k(
|
|
1749
|
+
O.constructEntry(l.property, l.operator, l.equator)
|
|
1750
|
+
);
|
|
1751
|
+
}
|
|
1752
|
+
return b(d);
|
|
1753
|
+
}
|
|
1754
|
+
function D(d) {
|
|
1755
|
+
const l = a[d.name];
|
|
1756
|
+
return l && t(l) ? v(l) : d.name;
|
|
1757
|
+
}
|
|
1758
|
+
return x({
|
|
1759
|
+
showCustomDialog: k
|
|
1760
|
+
}), (d, l) => {
|
|
1761
|
+
const y = _("FmButton"), p = _("FmPill"), C = _("FmMenuItem"), m = _("FmMenu");
|
|
1762
|
+
return n(), f(m, {
|
|
1763
|
+
shift: !0,
|
|
1764
|
+
placement: "top-start"
|
|
1765
|
+
}, {
|
|
1766
|
+
"menu-button": B(() => [
|
|
1767
|
+
c(y, {
|
|
1768
|
+
label: e(v)("connect.template.rule.add_condition"),
|
|
1769
|
+
icon: "add",
|
|
1770
|
+
class: "text-fm-color-primary border-fm-color-primary",
|
|
1771
|
+
"icon-color": "primary",
|
|
1772
|
+
variant: "secondary"
|
|
1773
|
+
}, null, 8, ["label"])
|
|
1774
|
+
]),
|
|
1775
|
+
default: B(() => [
|
|
1776
|
+
(n(!0), V(q, null, $(e(qe).filter(
|
|
1777
|
+
(Y) => !o.includeOnly || Y.for.includes(o.includeOnly)
|
|
1778
|
+
), (Y) => (n(), f(C, {
|
|
1779
|
+
key: Y.name,
|
|
1780
|
+
"model-value": Y.name == e(i),
|
|
1781
|
+
label: D(Y),
|
|
1782
|
+
onClick: () => {
|
|
1783
|
+
Y != null && Y.premium && !e(u).isPremium || R(Y);
|
|
1784
|
+
},
|
|
1785
|
+
disabled: (Y == null ? void 0 : Y.premium) && !e(u).isPremium
|
|
1786
|
+
}, ce({ _: 2 }, [
|
|
1787
|
+
Y != null && Y.premium ? {
|
|
1788
|
+
name: "append",
|
|
1789
|
+
fn: B(() => [
|
|
1790
|
+
c(p, { variant: "premium" })
|
|
1791
|
+
]),
|
|
1792
|
+
key: "0"
|
|
1793
|
+
} : void 0
|
|
1794
|
+
]), 1032, ["model-value", "label", "onClick", "disabled"]))), 128))
|
|
1795
|
+
]),
|
|
1796
|
+
_: 1
|
|
1797
|
+
});
|
|
1798
|
+
};
|
|
1799
|
+
}
|
|
1800
|
+
}), Et = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ht = /* @__PURE__ */ P({
|
|
1801
|
+
__name: "RuleGroup",
|
|
1802
|
+
props: {
|
|
1803
|
+
triggerType: {
|
|
1804
|
+
type: String,
|
|
1805
|
+
required: !0
|
|
1806
|
+
},
|
|
1807
|
+
includeOnly: {
|
|
1808
|
+
type: String
|
|
1809
|
+
},
|
|
1810
|
+
modelValue: {
|
|
1811
|
+
type: Object
|
|
1812
|
+
}
|
|
1813
|
+
},
|
|
1814
|
+
emits: ["update:model-value"],
|
|
1815
|
+
setup(o, { emit: x }) {
|
|
1816
|
+
const g = o, u = x, v = Te(), { t } = G(), a = M(
|
|
1817
|
+
() => g.modelValue ?? O.scaffoldGroup()
|
|
1818
|
+
), s = M(() => O.getLogic(a.value)), r = M(() => [
|
|
1819
|
+
{ label: t("connect.template.rule.and"), value: "&&" },
|
|
1820
|
+
{ label: t("connect.template.rule.or"), value: "||" }
|
|
1821
|
+
]), E = W();
|
|
1822
|
+
function i(b, k) {
|
|
1823
|
+
try {
|
|
1824
|
+
const R = O.setRuleToGroup(b, k);
|
|
1825
|
+
O.isRuleExceed(b, k), u("update:model-value", R);
|
|
1826
|
+
} catch (R) {
|
|
1827
|
+
v.open({
|
|
1828
|
+
message: R.message,
|
|
1829
|
+
type: "error"
|
|
1830
|
+
});
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
return (b, k) => {
|
|
1834
|
+
const R = _("FmButtonGroup"), D = _("FmCard");
|
|
1835
|
+
return n(), f(D, { variant: "outlined" }, {
|
|
1836
|
+
default: B(() => [
|
|
1837
|
+
c(D, { class: "border-l-4 border-fm-color-primary p-16 space-y-16" }, {
|
|
1838
|
+
default: B(() => [
|
|
1839
|
+
U("div", Et, A(e(t)("connect.template.rule.when")), 1),
|
|
1840
|
+
c(ht, {
|
|
1841
|
+
ref_key: "configuratorRef",
|
|
1842
|
+
ref: E,
|
|
1843
|
+
"include-only": o.includeOnly,
|
|
1844
|
+
"trigger-type": o.triggerType,
|
|
1845
|
+
"onUpdate:modelValue": k[0] || (k[0] = (d) => i(e(a), d))
|
|
1846
|
+
}, null, 8, ["include-only", "trigger-type"]),
|
|
1847
|
+
(n(!0), V(q, null, $(e(a).rules, (d, l) => {
|
|
1848
|
+
var y;
|
|
1849
|
+
return n(), V(q, null, [
|
|
1850
|
+
e(Ve)(d) ? (n(), f(De, {
|
|
1851
|
+
"model-value": d,
|
|
1852
|
+
key: l,
|
|
1853
|
+
onEdit: (y = e(E)) == null ? void 0 : y.showCustomDialog,
|
|
1854
|
+
onRemove: k[1] || (k[1] = (p) => {
|
|
1855
|
+
u(
|
|
1856
|
+
"update:model-value",
|
|
1857
|
+
e(O).removeEntry(e(a), p.name)
|
|
1858
|
+
);
|
|
1859
|
+
})
|
|
1860
|
+
}, null, 8, ["model-value", "onEdit"])) : N("", !0),
|
|
1861
|
+
c(R, {
|
|
1862
|
+
class: "w-[200px]",
|
|
1863
|
+
disabled: Object.keys(e(a).rules).length < 2,
|
|
1864
|
+
items: e(r),
|
|
1865
|
+
"model-value": e(r).find((p) => p.value === e(s)) ?? null,
|
|
1866
|
+
"onUpdate:modelValue": k[2] || (k[2] = (p) => u(
|
|
1867
|
+
"update:model-value",
|
|
1868
|
+
e(O).setRuleToGroup(
|
|
1869
|
+
e(a),
|
|
1870
|
+
[],
|
|
1871
|
+
p.value
|
|
1872
|
+
)
|
|
1873
|
+
))
|
|
1874
|
+
}, null, 8, ["disabled", "items", "model-value"])
|
|
1875
|
+
], 64);
|
|
1876
|
+
}), 256))
|
|
1877
|
+
]),
|
|
1878
|
+
_: 1
|
|
1879
|
+
})
|
|
1880
|
+
]),
|
|
1881
|
+
_: 1
|
|
1882
|
+
});
|
|
1883
|
+
};
|
|
1884
|
+
}
|
|
1885
|
+
});
|
|
1886
|
+
export {
|
|
1887
|
+
Ht as _,
|
|
1888
|
+
re as a
|
|
1889
|
+
};
|