@useinsider/guido 3.12.0-beta.98baf2f → 3.12.0-beta.aa6f9ba

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.
Files changed (82) hide show
  1. package/dist/@types/config/schemas.js +13 -8
  2. package/dist/components/Guido.vue.js +6 -6
  3. package/dist/components/Guido.vue2.js +50 -49
  4. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +1 -1
  5. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +8 -8
  6. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
  7. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +10 -10
  8. package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +36 -0
  9. package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +244 -0
  10. package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.js +18 -0
  11. package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue2.js +42 -0
  12. package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.js +20 -0
  13. package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue2.js +18 -0
  14. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.js +20 -0
  15. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue2.js +60 -0
  16. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.js +19 -0
  17. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue2.js +19 -0
  18. package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.js +22 -0
  19. package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue2.js +29 -0
  20. package/dist/composables/usePreviewInteractionGuard.js +36 -11
  21. package/dist/composables/useRecommendation.js +82 -51
  22. package/dist/composables/useRecommendationPreview.js +61 -60
  23. package/dist/composables/useStrategyFilters.js +16 -0
  24. package/dist/composables/useStripoEventHandler.js +9 -12
  25. package/dist/config/migrator/recommendationMigrator.js +7 -4
  26. package/dist/enums/date.js +4 -3
  27. package/dist/enums/extensions/filteringV2.js +8 -0
  28. package/dist/enums/extensions/recommendationBlock.js +28 -22
  29. package/dist/enums/extensions/strategyDetail.js +148 -0
  30. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  31. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +12 -11
  32. package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
  33. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +123 -109
  34. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +146 -0
  35. package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
  36. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +1 -1
  37. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
  38. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +256 -102
  39. package/dist/extensions/Blocks/Recommendation/utils/strategyHumanizer.js +97 -0
  40. package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +10 -0
  41. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +24 -12
  42. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -2
  43. package/dist/extensions/Blocks/controlFactories.js +125 -75
  44. package/dist/guido.css +1 -1
  45. package/dist/services/recommendationApi.js +72 -29
  46. package/dist/services/stripoApi.js +27 -28
  47. package/dist/src/@types/config/schemas.d.ts +10 -0
  48. package/dist/src/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.d.ts +2 -0
  49. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.d.ts +43 -0
  50. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.d.ts +29 -0
  51. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.d.ts +40 -0
  52. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.d.ts +38 -0
  53. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.d.ts +51 -0
  54. package/dist/src/composables/useConfig.d.ts +2 -0
  55. package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
  56. package/dist/src/composables/useRecommendation.d.ts +2 -0
  57. package/dist/src/composables/useStrategyFilters.d.ts +24 -0
  58. package/dist/src/enums/extensions/filteringV2.d.ts +72 -0
  59. package/dist/src/enums/extensions/recommendationBlock.d.ts +10 -0
  60. package/dist/src/enums/extensions/strategyDetail.d.ts +90 -0
  61. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  62. package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
  63. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  64. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -1
  65. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +61 -0
  66. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +606 -1
  67. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
  68. package/dist/src/extensions/Blocks/Recommendation/utils/strategyHumanizer.d.ts +50 -0
  69. package/dist/src/extensions/Blocks/Recommendation/utils/strategySummary.d.ts +34 -0
  70. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +3 -1
  71. package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
  72. package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
  73. package/dist/src/services/recommendationApi.d.ts +7 -1
  74. package/dist/src/stores/config.d.ts +18 -0
  75. package/dist/src/utils/genericUtil.d.ts +9 -0
  76. package/dist/src/utils/urlSchemes.d.ts +6 -0
  77. package/dist/static/styles/base.css.js +15 -0
  78. package/dist/utils/dateUtil.js +23 -10
  79. package/dist/utils/genericUtil.js +10 -1
  80. package/dist/utils/templatePreparation.js +62 -58
  81. package/dist/utils/urlSchemes.js +4 -0
  82. package/package.json +1 -1
@@ -0,0 +1,244 @@
1
+ import { defineComponent as ee, ref as te, computed as l, watch as G } from "vue";
2
+ import { useTranslations as ae } from "../../../../composables/useTranslations.js";
3
+ import { DetailTabs as c, EMAIL_CHANNEL as se, PageTypeTranslationKeys as le, TIME as U, COUNT as F } from "../../../../enums/extensions/strategyDetail.js";
4
+ import { useRecommendationExtensionStore as ie } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ import { getMethodTranslationKey as re, getAlgorithmTranslationKey as ue } from "../../../../extensions/Blocks/Recommendation/utils/strategySummary.js";
6
+ import { formatShortDate as X } from "../../../../utils/dateUtil.js";
7
+ import { parseJsonField as w } from "../../../../utils/genericUtil.js";
8
+ import { InTabs as oe, InDrawer as ne } from "@useinsider/design-system-vue";
9
+ import ce from "./strategy-detail/CampaignTable.vue.js";
10
+ import de from "./strategy-detail/FilterHumanizer.vue.js";
11
+ import ve from "./strategy-detail/InfoDisplayValue.vue.js";
12
+ const Ee = /* @__PURE__ */ ee({
13
+ __name: "StrategyDetailDrawer",
14
+ setup(ye) {
15
+ const f = "MIXED", T = "CHECKOUT_RECOMMENDATION", r = ae(), u = ie(), p = te(c.GENERAL), t = l(() => u.getSelectedStrategy), _ = l(() => u.strategyDetailDrawerStatus), b = l(() => t.value ? String(t.value.strategy_id) : ""), o = l(() => r("campaign-details-modal.none")), J = l(() => [
16
+ {
17
+ value: c.GENERAL,
18
+ path: "",
19
+ text: r("discovery-strategy.recommendation-strategy-details")
20
+ },
21
+ {
22
+ value: c.OTHER,
23
+ path: "",
24
+ text: r("discovery-strategy.campaign-and-other-details")
25
+ }
26
+ ]);
27
+ G(
28
+ () => [_.value, p.value, b.value],
29
+ ([e, a, s]) => {
30
+ e && a === c.OTHER && s && u.fetchStrategyCampaigns(s);
31
+ },
32
+ { immediate: !0 }
33
+ ), G(_, (e) => {
34
+ e || (p.value = c.GENERAL);
35
+ });
36
+ const q = () => {
37
+ p.value = c.GENERAL, u.closeStrategyDrawer();
38
+ }, C = l(() => u.strategyCampaigns.filter((e) => e.status === "Active").reduce((e, a) => {
39
+ var s;
40
+ return e + (((s = a.variants) == null ? void 0 : s.length) ?? 0);
41
+ }, 0)), E = l(() => u.strategyCampaigns.filter((e) => e.status !== "Active").reduce((e, a) => {
42
+ var s;
43
+ return e + (((s = a.variants) == null ? void 0 : s.length) ?? 0);
44
+ }, 0)), D = l(() => {
45
+ var a;
46
+ return (((a = t.value) == null ? void 0 : a.suitable_channels) || "").split(",").map((s) => s.trim()).filter(Boolean).map((s) => r(
47
+ s.toLowerCase() === se ? "products.newsletter" : `products.${s.toLowerCase()}`
48
+ )).join(", ");
49
+ }), S = l(() => {
50
+ var s;
51
+ const e = (s = t.value) == null ? void 0 : s.suitable_page_types;
52
+ return e ? (typeof e == "string" ? e.split(",").map((i) => i.trim()) : e).filter(Boolean).map((i) => r(le[i] || i)).join(", ") : "";
53
+ }), Q = l(() => [
54
+ {
55
+ title: "discovery-strategy.channel-types",
56
+ value: D.value || o.value,
57
+ isVisible: !0,
58
+ translateValue: !1
59
+ },
60
+ {
61
+ title: "discovery-strategy.page-types",
62
+ value: S.value || o.value,
63
+ isVisible: !0,
64
+ translateValue: !1
65
+ }
66
+ ]), m = l(
67
+ () => {
68
+ var e;
69
+ return w((e = t.value) == null ? void 0 : e.base_product, null);
70
+ }
71
+ ), V = l(
72
+ () => {
73
+ var e;
74
+ return ((e = t.value) == null ? void 0 : e.algorithm) !== f && m.value !== null;
75
+ }
76
+ ), A = l(() => {
77
+ const e = m.value;
78
+ if (!e)
79
+ return "";
80
+ const a = r(`discovery-strategy.base-product-source-${e.source}`);
81
+ return e.source === "page" ? a : `${a} ${r(`discovery-strategy.base-product-count-${e.count}`)}`;
82
+ }), I = l(() => t.value ? t.value.algorithm !== f ? w(t.value.manual_merchandising_products, []).filter(Boolean).join(", ") : w(t.value.mixed_strategies, []).map((e) => e == null ? void 0 : e.productId).filter(Boolean).join(", ") : ""), n = (e) => e ? "common.yes" : "common.no", W = l(() => {
83
+ var e, a, s, i, d, v, y;
84
+ return [
85
+ {
86
+ title: "discovery-strategy.method",
87
+ value: re(((e = t.value) == null ? void 0 : e.algorithm) || ""),
88
+ isVisible: !0,
89
+ translateValue: !0
90
+ },
91
+ {
92
+ title: "algorithm-panel.algorithm-header",
93
+ value: (((a = t.value) == null ? void 0 : a.algorithm_used) || "").split(",").map((g) => ue(g.trim())).join(", "),
94
+ isVisible: !0,
95
+ translateValue: !0
96
+ },
97
+ {
98
+ title: "discovery-strategy.base-product-label",
99
+ value: A.value,
100
+ isVisible: V.value,
101
+ translateValue: !1
102
+ },
103
+ {
104
+ title: "discovery-strategy.base-product-pin-label",
105
+ value: n((s = m.value) == null ? void 0 : s.pin),
106
+ isVisible: V.value,
107
+ translateValue: !0
108
+ },
109
+ {
110
+ title: "discovery-strategy.checkout-recommendation-cart-value",
111
+ value: String(((i = t.value) == null ? void 0 : i.checkout_recommendation_cart_value) ?? ""),
112
+ isVisible: ((d = t.value) == null ? void 0 : d.algorithm_used) === T,
113
+ translateValue: !1
114
+ },
115
+ {
116
+ title: "discovery-strategy.number-of-products",
117
+ value: String(((v = t.value) == null ? void 0 : v.size) ?? ""),
118
+ isVisible: !0,
119
+ translateValue: !1
120
+ },
121
+ {
122
+ title: "discovery-strategy.manual-merchandising-products",
123
+ value: I.value || o.value,
124
+ isVisible: !0,
125
+ translateValue: !1
126
+ },
127
+ {
128
+ title: "discovery-strategy.shuffle-recommended-products",
129
+ value: n((y = t.value) == null ? void 0 : y.shuffle),
130
+ isVisible: !0,
131
+ translateValue: !0
132
+ }
133
+ ];
134
+ }), h = (e, a) => {
135
+ const s = (a || "").toLowerCase(), i = e === 1 ? `date-time.${s}` : `date-time.${s}s`;
136
+ return `${e ?? ""} ${r(i)}`;
137
+ }, x = (e) => `${e ?? ""} ${r(e === 1 ? "discovery-strategy.item" : "discovery-strategy.items")}`, Y = l(() => {
138
+ var e, a, s, i, d, v, y, g, L, R, $, M, O, B, P, k, H, j, K, z;
139
+ return [
140
+ {
141
+ title: "discovery-strategy.personalize-recommendations-based-on-attribute-affinity",
142
+ value: n((e = t.value) == null ? void 0 : e.attribute_affinity),
143
+ isVisible: !0,
144
+ translateValue: !0
145
+ },
146
+ {
147
+ title: "discovery-strategy.exclude-recently-view-items",
148
+ value: n((a = t.value) == null ? void 0 : a.exclude_view),
149
+ isVisible: !((s = t.value) != null && s.exclude_view),
150
+ translateValue: !0
151
+ },
152
+ {
153
+ title: "discovery-strategy.exclude-items-viewed-in-the-last",
154
+ value: h((i = t.value) == null ? void 0 : i.exclude_view_duration, (d = t.value) == null ? void 0 : d.exclude_view_duration_type),
155
+ isVisible: !!((v = t.value) != null && v.exclude_view) && ((y = t.value) == null ? void 0 : y.exclude_view_option) === U,
156
+ translateValue: !1
157
+ },
158
+ {
159
+ title: "discovery-strategy.number-of-items-to-exclude-from-recently-viewed",
160
+ value: x((g = t.value) == null ? void 0 : g.exclude_view_item_count),
161
+ isVisible: !!((L = t.value) != null && L.exclude_view) && ((R = t.value) == null ? void 0 : R.exclude_view_option) === F,
162
+ translateValue: !1
163
+ },
164
+ {
165
+ title: "discovery-strategy.exclude-recently-purchased-items",
166
+ value: n(($ = t.value) == null ? void 0 : $.exclude_purchase),
167
+ isVisible: !((M = t.value) != null && M.exclude_purchase),
168
+ translateValue: !0
169
+ },
170
+ {
171
+ title: "discovery-strategy.exclude-items-purchase-in-the-last",
172
+ value: h((O = t.value) == null ? void 0 : O.exclude_purchase_duration, (B = t.value) == null ? void 0 : B.exclude_purchase_duration_type),
173
+ isVisible: !!((P = t.value) != null && P.exclude_purchase) && ((k = t.value) == null ? void 0 : k.exclude_purchase_option) === U,
174
+ translateValue: !1
175
+ },
176
+ {
177
+ title: "discovery-strategy.number-of-items-to-exclude-from-recently-purchased",
178
+ value: x((H = t.value) == null ? void 0 : H.exclude_purchase_item_count),
179
+ isVisible: !!((j = t.value) != null && j.exclude_purchase) && ((K = t.value) == null ? void 0 : K.exclude_purchase_option) === F,
180
+ translateValue: !1
181
+ },
182
+ {
183
+ title: "discovery-strategy.exclude-recently-added-cart-items",
184
+ value: n((z = t.value) == null ? void 0 : z.exclude_cart),
185
+ isVisible: !0,
186
+ translateValue: !0
187
+ }
188
+ ];
189
+ }), N = (e) => {
190
+ var a;
191
+ (a = navigator.clipboard) == null || a.writeText(e).catch(() => {
192
+ console.warn("[StrategyDetailDrawer] Copying the strategy id to the clipboard failed.");
193
+ });
194
+ }, Z = l(() => {
195
+ var e, a, s;
196
+ return [
197
+ {
198
+ title: "discovery-strategy.strategy-id",
199
+ value: b.value,
200
+ isVisible: !0,
201
+ translateValue: !1,
202
+ icon: "line-copy",
203
+ iconTooltip: "discovery-strategy.copy",
204
+ iconTooltipAfterClicked: "discovery-strategy.copied",
205
+ iconClick: N
206
+ },
207
+ {
208
+ title: "discovery-strategy.last-updated-by",
209
+ value: ((e = t.value) == null ? void 0 : e.last_updated_by) || o.value,
210
+ isVisible: !0,
211
+ translateValue: !1
212
+ },
213
+ {
214
+ title: "discovery-strategy.last-updated-on",
215
+ value: (a = t.value) != null && a.updated_at ? X(t.value.updated_at) : o.value,
216
+ isVisible: !0,
217
+ translateValue: !1
218
+ },
219
+ {
220
+ title: "discovery-strategy.created-date",
221
+ value: (s = t.value) != null && s.created_at ? X(t.value.created_at) : o.value,
222
+ isVisible: !0,
223
+ translateValue: !1
224
+ },
225
+ {
226
+ title: "discovery-strategy.variants-with-live-recommendation-strategies",
227
+ value: String(C.value),
228
+ isVisible: !0,
229
+ translateValue: !1
230
+ },
231
+ {
232
+ title: "discovery-strategy.variants-with-idle-recommendation-strategies",
233
+ value: String(E.value),
234
+ isVisible: !0,
235
+ translateValue: !1
236
+ }
237
+ ];
238
+ });
239
+ return { __sfc: !0, MIXED: f, CHECKOUT_RECOMMENDATION: T, trans: r, store: u, activeTab: p, strategy: t, isOpen: _, strategyId: b, none: o, tabs: J, close: q, liveVariantsCount: C, idleVariantsCount: E, suitableChannelTypes: D, suitablePageTypes: S, pageAndChannelDetails: Q, baseProduct: m, isBaseProductVisible: V, baseProductSourceLabel: A, manualMerchandisingProducts: I, yesNo: n, widgetPreferences: W, durationText: h, itemCountText: x, advancedPersonalization: Y, copyStrategyId: N, otherDetails: Z, visibleRows: (e) => e.filter((a) => a.isVisible), DetailTabs: c, InDrawer: ne, InTabs: oe, CampaignTable: ce, FilterHumanizer: de, InfoDisplayValue: ve };
240
+ }
241
+ });
242
+ export {
243
+ Ee as default
244
+ };
@@ -0,0 +1,18 @@
1
+ import n from "./CampaignTable.vue2.js";
2
+ /* empty css */
3
+ import i from "../../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var e = function() {
5
+ var a = this, s = a._self._c, t = a._self._setupProxy;
6
+ return s("div", { staticClass: "campaign-table" }, [s("div", { staticClass: "f-w-600 f-s-2 mb-3" }, [a._v(" " + a._s(t.trans("discovery-strategy.used-in-campaigns", { count: a.campaigns.length })) + " ")]), t.hasCampaigns || a.loading ? s(t.InDataTableV2, { attrs: { id: "strategy-campaign-listing-table", "pagination-status": "", "column-options": t.columnOptions, data: a.campaigns, "horizontal-scroll": !1, "in-container-layout": !1, "items-per-page-status": !1, "loading-status": a.loading } }) : s(t.InNoData, { attrs: { "button-status": !1, description: t.trans("discovery-strategy.no-campaigns-description"), title: t.trans("discovery-strategy.no-campaigns"), "visible-icon": !1 } })], 1);
7
+ }, o = [], r = /* @__PURE__ */ i(
8
+ n,
9
+ e,
10
+ o,
11
+ !1,
12
+ null,
13
+ "3ff1b2a9"
14
+ );
15
+ const g = r.exports;
16
+ export {
17
+ g as default
18
+ };
@@ -0,0 +1,42 @@
1
+ import { defineComponent as d, computed as o } from "vue";
2
+ import { useTranslations as p } from "../../../../../composables/useTranslations.js";
3
+ import { InNoData as c, InDataTableV2 as l } from "@useinsider/design-system-vue";
4
+ const g = /* @__PURE__ */ d({
5
+ __name: "CampaignTable",
6
+ props: {
7
+ campaigns: { default: () => [] },
8
+ loading: { type: Boolean, default: !1 }
9
+ },
10
+ setup(i) {
11
+ const s = i, a = p(), m = o(() => s.campaigns.length > 0), n = (t) => (t.variants ?? []).map((e) => typeof e == "string" ? e : e == null ? void 0 : e.name).filter(Boolean).join(", "), r = o(() => [
12
+ {
13
+ headerName: a("discovery-strategy.status"),
14
+ field: "status",
15
+ type: "status",
16
+ status: (t) => t.status.toLowerCase(),
17
+ text: (t) => t.status,
18
+ width: 130,
19
+ minWidth: 130
20
+ },
21
+ {
22
+ headerName: a("discovery-strategy.campaign-and-variant"),
23
+ field: "name",
24
+ text: (t) => t.name,
25
+ description: (t) => n(t),
26
+ width: 280,
27
+ minWidth: 200
28
+ },
29
+ {
30
+ headerName: a("discovery-strategy.channel"),
31
+ field: "channel",
32
+ text: (t) => t.channel,
33
+ width: 220,
34
+ minWidth: 150
35
+ }
36
+ ]);
37
+ return { __sfc: !0, trans: a, props: s, hasCampaigns: m, getVariantsText: n, columnOptions: r, InDataTableV2: l, InNoData: c };
38
+ }
39
+ });
40
+ export {
41
+ g as default
42
+ };
@@ -0,0 +1,20 @@
1
+ import o from "./FilterHumanizer.vue2.js";
2
+ /* empty css */
3
+ import n from "../../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var l = function() {
5
+ var e = this, r = e._self._c, t = e._self._setupProxy;
6
+ return r("div", { staticClass: "filter-humanizer" }, [t.hasAnyFilter ? e._l(t.filterQuery, function(s, i) {
7
+ return r(t.HumanizerGroup, { key: i, staticClass: "group", attrs: { "condition-list": s.conditionList || [], filters: t.filterQuery, "group-index": String(i), "group-logic": s.groupLogic || "" } });
8
+ }) : [r("p", { staticClass: "px-5 t-c-3" }, [e._v(" " + e._s(t.trans("discovery-strategy.no-filters")) + " ")])], t.canToggle ? r("div", { staticClass: "mt-4 px-5" }, [r(t.InButtonV2, { attrs: { id: "strategy-filters-toggle", styling: "text", type: "primary", "label-text": t.isCollapsed ? t.trans("product-catalog.show-more") : t.trans("product-catalog.show-less"), "left-icon": t.isCollapsed ? "line-chevron-down" : "line-chevron-up" }, on: { click: t.toggleMore } })], 1) : e._e()], 2);
9
+ }, a = [], c = /* @__PURE__ */ n(
10
+ o,
11
+ l,
12
+ a,
13
+ !1,
14
+ null,
15
+ "3ecb7de4"
16
+ );
17
+ const d = c.exports;
18
+ export {
19
+ d as default
20
+ };
@@ -0,0 +1,18 @@
1
+ import { defineComponent as a } from "vue";
2
+ import { useStrategyFilters as p } from "../../../../../composables/useStrategyFilters.js";
3
+ import { useTranslations as f } from "../../../../../composables/useTranslations.js";
4
+ import { InButtonV2 as l } from "@useinsider/design-system-vue";
5
+ import u from "./HumanizerGroup.vue.js";
6
+ const F = /* @__PURE__ */ a({
7
+ __name: "FilterHumanizer",
8
+ props: {
9
+ filters: { default: "{}" }
10
+ },
11
+ setup(t) {
12
+ const r = t, e = f(), { filterQuery: o, hasAnyFilter: s, canToggle: n, isCollapsed: i, toggleMore: m } = p(() => r.filters);
13
+ return { __sfc: !0, trans: e, props: r, filterQuery: o, hasAnyFilter: s, canToggle: n, isCollapsed: i, toggleMore: m, InButtonV2: l, HumanizerGroup: u };
14
+ }
15
+ });
16
+ export {
17
+ F as default
18
+ };
@@ -0,0 +1,20 @@
1
+ import a from "./HumanizerCondition.vue2.js";
2
+ /* empty css */
3
+ import e from "../../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var o = function() {
5
+ var t = this, s = t._self._c, i = t._self._setupProxy;
6
+ return s("div", { class: { "pb-0 pt-1": t.isLast, "py-1": !t.isLast } }, [s("div", { staticClass: "d-f a-i-b j-c-s-b" }, [s("div", { staticClass: "attribute-type" }, [t._v(" " + t._s(i.headingText) + " ")]), s("div", { staticClass: "spaced-dot-sep f-g-1 h-1-s mx-2 w-7-s" }), s(i.InTooltipV2, { attrs: { id: `strategy-condition-${i.conditionId}-${t.index}`, "static-position": "top right", "dynamic-position": !1, text: i.tooltipText }, scopedSlots: t._u([{ key: "triggerElement", fn: function() {
7
+ return [s("div", { staticClass: "d-f condition-data" }, [s("div", { staticClass: "attribute" }, [t._v(" " + t._s(i.capitalizeFirstLetter(i.attributeText)) + " ")]), s("div", { staticClass: "operator f-w-600" }, [t._v(" " + t._s(i.displayOperator) + " ")]), i.totalValueLength < i.MAX_CHARACTER_SIZE ? s("div", { staticClass: "value f-w-600" }, [t._v(" " + t._s(i.suitableValue) + " ")]) : t._e()])];
8
+ }, proxy: !0 }]) })], 1), t.isLast ? t._e() : s("div", { staticClass: "pt-2" }, [s(i.InStatusText, { attrs: { id: `strategy-condition-logic-${i.conditionId}-${t.index}`, size: "small", status: "draft", text: t.condition.conditionLogic || "" } })], 1)]);
9
+ }, n = [], r = /* @__PURE__ */ e(
10
+ a,
11
+ o,
12
+ n,
13
+ !1,
14
+ null,
15
+ "ef803818"
16
+ );
17
+ const p = r.exports;
18
+ export {
19
+ p as default
20
+ };
@@ -0,0 +1,60 @@
1
+ import { defineComponent as V, computed as e } from "vue";
2
+ import { useTranslations as R } from "../../../../../composables/useTranslations.js";
3
+ import { TimeAbbreviations as T } from "../../../../../enums/extensions/filteringV2.js";
4
+ import { Operators as L, DataTypes as _, MultiSelectDataTypes as $, OperatorNames as u, OperatorAbbreviations as b } from "../../../../../enums/extensions/strategyDetail.js";
5
+ import { capitalizeFirstLetter as s, getSuitableValue as D } from "../../../../../extensions/Blocks/Recommendation/utils/strategyHumanizer.js";
6
+ import { InTooltipV2 as U, InStatusText as F } from "@useinsider/design-system-vue";
7
+ const B = /* @__PURE__ */ V({
8
+ __name: "HumanizerCondition",
9
+ props: {
10
+ condition: null,
11
+ index: null,
12
+ isLast: { type: Boolean, default: !1 }
13
+ },
14
+ setup(g) {
15
+ const n = g, c = 40, d = "_dynamic", i = R(), l = e(() => n.condition.type || ""), p = e(() => {
16
+ var t;
17
+ return ((t = n.condition.attribute) == null ? void 0 : t.text) || "";
18
+ }), r = e(() => {
19
+ var t;
20
+ return ((t = n.condition.attribute) == null ? void 0 : t.attributeType) || "";
21
+ }), o = e(() => n.condition.selectedOperator || ""), x = e(() => n.condition.id ?? n.index), f = e(() => {
22
+ const { value: t } = n.condition;
23
+ return Array.isArray(t) ? t.join(",") : t || "";
24
+ }), O = e(() => [
25
+ { text: s(i("journey-builder.weeks")), value: T.WEEK },
26
+ { text: s(i("settings.day-s")), value: T.DAY },
27
+ { text: s(i("settings.hour-s")), value: T.HOUR }
28
+ ]), a = e(() => {
29
+ let t = o.value;
30
+ l.value === "dynamicFilter" && !t.includes(d) && (t = `${t}${d}`);
31
+ const m = (L[r.value] || []).find((h) => h.value === t);
32
+ return m ? i(m.text) : "";
33
+ }), y = () => r.value === _.DATE, A = () => {
34
+ if (!$.includes(r.value) || [u.CONTAINS, u.NOT_CONTAINS].includes(o.value))
35
+ return !1;
36
+ const t = [u.IS_EXACTLY, u.IS_NOT_EXACTLY].includes(o.value);
37
+ return !((n.condition.isHierarchyCategory || r.value === _.STRING) && t);
38
+ }, I = () => [
39
+ b.OPERATOR.IN,
40
+ b.OPERATOR.NOT_IN
41
+ ].includes(o.value), v = e(() => D({
42
+ condition: n.condition,
43
+ selectedOperator: o.value,
44
+ filterValue: f.value,
45
+ timeUnit: n.condition.timeUnit ?? "",
46
+ inBetweenValues: n.condition.inBetweenValues ?? [],
47
+ timeUnitOptions: O.value,
48
+ isDateAttribute: y,
49
+ isMultiSelect: A,
50
+ isInOrNotInOperator: I,
51
+ trans: i
52
+ })), N = e(() => v.value.length + a.value.length), S = e(() => a.value.length > c ? `${a.value.substring(0, c)}...` : a.value), C = e(
53
+ () => `${s(p.value)} ${a.value} ${v.value}`
54
+ ), E = e(() => l.value ? i(`discovery-strategy.${l.value.toLowerCase()}-humanized`) : s(p.value));
55
+ return { __sfc: !0, MAX_CHARACTER_SIZE: c, DYNAMIC_FILTER_SUFFIX: d, trans: i, props: n, filterType: l, attributeText: p, attributeType: r, selectedOperator: o, conditionId: x, filterValue: f, timeUnitOptions: O, operatorTranslated: a, isDateAttribute: y, isMultiSelect: A, isInOrNotInOperator: I, suitableValue: v, totalValueLength: N, displayOperator: S, tooltipText: C, headingText: E, capitalizeFirstLetter: s, InStatusText: F, InTooltipV2: U };
56
+ }
57
+ });
58
+ export {
59
+ B as default
60
+ };
@@ -0,0 +1,19 @@
1
+ import e from "./HumanizerGroup.vue2.js";
2
+ import o from "../../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var a = function() {
4
+ var t = this, s = t._self._c, r = t._self._setupProxy;
5
+ return s("div", [s("div", { staticClass: "py-3 b-c-5 px-5" }, t._l(t.conditionList, function(n, i) {
6
+ return s(r.HumanizerCondition, { key: `${n.id}-${t.groupIndex}-${i}`, staticClass: "condition", attrs: { condition: n, index: i, "is-last": t.conditionList.length - 1 === i } });
7
+ }), 1), r.isLastGroup ? t._e() : s("div", { staticClass: "my-3 d-f j-c-c" }, [s(r.InStatusText, { attrs: { id: `strategy-filter-group-${t.groupIndex}`, size: "small", status: "draft", text: t.groupLogic } })], 1)]);
8
+ }, c = [], u = /* @__PURE__ */ o(
9
+ e,
10
+ a,
11
+ c,
12
+ !1,
13
+ null,
14
+ null
15
+ );
16
+ const p = u.exports;
17
+ export {
18
+ p as default
19
+ };
@@ -0,0 +1,19 @@
1
+ import { defineComponent as n, computed as r } from "vue";
2
+ import { InStatusText as u } from "@useinsider/design-system-vue";
3
+ import i from "./HumanizerCondition.vue.js";
4
+ const l = /* @__PURE__ */ n({
5
+ __name: "HumanizerGroup",
6
+ props: {
7
+ filters: null,
8
+ conditionList: null,
9
+ groupIndex: null,
10
+ groupLogic: { default: "" }
11
+ },
12
+ setup(t) {
13
+ const o = t, e = r(() => Object.keys(o.filters).length === Number(o.groupIndex));
14
+ return { __sfc: !0, props: o, isLastGroup: e, InStatusText: u, HumanizerCondition: i };
15
+ }
16
+ });
17
+ export {
18
+ l as default
19
+ };
@@ -0,0 +1,22 @@
1
+ import a from "./InfoDisplayValue.vue2.js";
2
+ /* empty css */
3
+ import e from "../../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
+ var s = this, t = s._self._c, i = s._self._setupProxy;
6
+ return t("div", { staticClass: "d-f a-i-b l-h-2 mt-2" }, [t("div", { staticClass: "t-c-3 w-s-n-w" }, [s._v(" " + s._s(i.trans(s.title)) + " ")]), t("div", { staticClass: "spaced-dot-sep f-g-1 h-1-s mx-2 w-7-s" }), t("div", { staticClass: "d-f a-i-c" }, [t("div", [s._v(s._s(i.displayValues))]), i.showMore ? t("div", { staticClass: "d-f a-i-c" }, [t("div", { staticClass: "mx-1" }, [s._v(" ... ")]), t(i.InTooltipV2, { attrs: { id: `strategy-detail-show-more-${s.index}`, "static-position": "top right", "dynamic-position": !1, text: i.hiddenDisplayValues, "with-icon": !1 }, scopedSlots: s._u([{ key: "triggerElement", fn: function() {
7
+ return [t("span", { staticClass: "f-w-600" }, [s._v("+" + s._s(i.hiddenValues.length))])];
8
+ }, proxy: !0 }], null, !1, 3725664940) })], 1) : s._e(), s.icon ? t("div", { staticClass: "ml-2" }, [t(i.InTooltipV2, { staticClass: "d-f a-i-c", attrs: { id: `strategy-detail-icon-action-${s.index}`, "static-position": "top right", "dynamic-position": !1, "icon-status": !1, status: !s.disabled, text: i.trans(i.iconTooltipText) }, scopedSlots: s._u([{ key: "triggerElement", fn: function() {
9
+ return [t(i.InIcons, { staticClass: "d-f a-i-c", class: { "i-c-7": !s.disabled, "i-c-2": s.disabled }, attrs: { size: "24", name: s.icon }, on: { click: i.clickOnIcon } })];
10
+ }, proxy: !0 }], null, !1, 4084358903) })], 1) : s._e()])]);
11
+ }, o = [], l = /* @__PURE__ */ e(
12
+ a,
13
+ n,
14
+ o,
15
+ !1,
16
+ null,
17
+ "6e572ff5"
18
+ );
19
+ const p = l.exports;
20
+ export {
21
+ p as default
22
+ };
@@ -0,0 +1,29 @@
1
+ import { defineComponent as _, computed as o, ref as v } from "vue";
2
+ import { useTranslations as I } from "../../../../../composables/useTranslations.js";
3
+ import { InTooltipV2 as V, InIcons as k } from "@useinsider/design-system-vue";
4
+ const h = /* @__PURE__ */ _({
5
+ __name: "InfoDisplayValue",
6
+ props: {
7
+ index: null,
8
+ title: null,
9
+ value: null,
10
+ translateValue: { type: Boolean, default: !1 },
11
+ icon: { default: "" },
12
+ iconTooltip: { default: "" },
13
+ iconTooltipAfterClicked: { default: "" },
14
+ disabled: { type: Boolean, default: !1 }
15
+ },
16
+ emits: ["iconClick"],
17
+ setup(d, { emit: c }) {
18
+ const e = d, l = 3, u = 2e3, r = I(), t = o(() => String(e.value ?? "").split(",").map((n) => n.trim())), i = (n) => e.translateValue ? r(n) : n, f = o(() => t.value.length > l), m = o(() => t.value.slice(0, l).map(i).join(", ")), p = o(() => t.value.slice(l).map(i)), T = o(() => p.value.join(", ")), a = v(e.iconTooltip);
19
+ let s;
20
+ return { __sfc: !0, MAX_INLINE_VALUES: l, TOOLTIP_REVERT_DELAY_MS: u, trans: r, props: e, emit: c, values: t, render: i, showMore: f, displayValues: m, hiddenValues: p, hiddenDisplayValues: T, iconTooltipText: a, revertTimer: s, clickOnIcon: () => {
21
+ e.iconTooltipAfterClicked && (a.value = e.iconTooltipAfterClicked, clearTimeout(s), s = setTimeout(() => {
22
+ a.value = e.iconTooltip;
23
+ }, u)), c("iconClick");
24
+ }, InIcons: k, InTooltipV2: V };
25
+ }
26
+ });
27
+ export {
28
+ h as default
29
+ };
@@ -1,17 +1,42 @@
1
- const o = ["click", "auxclick", "submit"], c = (t) => {
2
- t.preventDefault(), t.stopPropagation();
3
- }, a = () => ({ blockPreviewInteractions: (r) => {
1
+ import { URLS as o, MERGE_TAGS as a } from "../enums/unsubscribe.js";
2
+ import { UNSUBSCRIBE_LINK_SELECTOR as i } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
3
+ import { BASE_SAFE_URL_SCHEMES as u } from "../utils/urlSchemes.js";
4
+ const E = ["click", "auxclick"], d = [
5
+ ...Object.values(a),
6
+ o.UNSUBSCRIBE_URL,
7
+ o.PREFERENCES_URL
8
+ ], l = (e) => {
9
+ if (e.matches(i))
10
+ return !0;
11
+ const r = e.getAttribute("href") ?? "";
12
+ return d.some((t) => r.includes(t));
13
+ }, S = [...u, "tel:", "sms:"], f = (e) => {
14
+ const r = (e.getAttribute("href") ?? "").trim();
15
+ return r === "" || r.startsWith("#") || r.startsWith("{{") ? !1 : S.includes(e.protocol);
16
+ }, m = (e) => {
17
+ var t, n;
18
+ const r = (n = (t = e.target) == null ? void 0 : t.closest) == null ? void 0 : n.call(t, "a");
19
+ if (r) {
20
+ if (l(r) || !f(r)) {
21
+ e.preventDefault(), e.stopPropagation();
22
+ return;
23
+ }
24
+ r.setAttribute("target", "_blank"), r.setAttribute("rel", "noopener noreferrer");
25
+ }
26
+ }, R = (e) => {
27
+ e.preventDefault(), e.stopPropagation();
28
+ }, s = /* @__PURE__ */ new WeakSet(), c = "guidoPreviewGuarded", g = () => ({ guardPreviewInteractions: (r) => {
4
29
  try {
5
- const e = r.contentDocument;
6
- if (!e)
30
+ const t = r.contentDocument;
31
+ if (!t || s.has(t))
7
32
  return;
8
- o.forEach((n) => {
9
- e.addEventListener(n, c, !0);
10
- });
11
- } catch (e) {
12
- console.warn("[usePreviewInteractionGuard] Could not guard preview iframe:", e);
33
+ delete t.documentElement.dataset[c], E.forEach((n) => {
34
+ t.addEventListener(n, m, !0);
35
+ }), t.addEventListener("submit", R, !0), s.add(t), t.documentElement.dataset[c] = "true";
36
+ } catch (t) {
37
+ console.warn("[usePreviewInteractionGuard] Could not guard preview iframe:", t);
13
38
  }
14
39
  } });
15
40
  export {
16
- a as usePreviewInteractionGuard
41
+ g as usePreviewInteractionGuard
17
42
  };