@useinsider/guido 3.12.0-beta.d2745e7 → 3.12.0-beta.d77b0d2

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 (73) hide show
  1. package/dist/@types/config/schemas.js +9 -4
  2. package/dist/components/Guido.vue.js +6 -6
  3. package/dist/components/Guido.vue2.js +50 -49
  4. package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +38 -0
  5. package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +271 -0
  6. package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.js +18 -0
  7. package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue2.js +42 -0
  8. package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.js +20 -0
  9. package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue2.js +18 -0
  10. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.js +20 -0
  11. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue2.js +60 -0
  12. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.js +19 -0
  13. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue2.js +19 -0
  14. package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.js +22 -0
  15. package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue2.js +29 -0
  16. package/dist/composables/useHtmlValidator.js +68 -60
  17. package/dist/composables/useHttp.js +61 -52
  18. package/dist/composables/useRecommendation.js +56 -40
  19. package/dist/composables/useSave.js +22 -22
  20. package/dist/composables/useStrategyFilters.js +16 -0
  21. package/dist/config/migrator/recommendationMigrator.js +7 -4
  22. package/dist/enums/date.js +4 -3
  23. package/dist/enums/extensions/filteringV2.js +1024 -0
  24. package/dist/enums/extensions/recommendationBlock.js +45 -24
  25. package/dist/enums/extensions/strategyDetail.js +149 -0
  26. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +12 -11
  27. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +141 -123
  28. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +297 -0
  29. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +16 -2
  30. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +137 -0
  31. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +549 -165
  32. package/dist/extensions/Blocks/Recommendation/utils/strategyHumanizer.js +97 -0
  33. package/dist/extensions/Blocks/Recommendation/utils/strategyNavigation.js +8 -0
  34. package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +95 -0
  35. package/dist/extensions/Blocks/Recommendation/utils/strategyUrl.js +43 -0
  36. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +24 -10
  37. package/dist/extensions/Blocks/common-control.js +37 -35
  38. package/dist/guido.css +1 -1
  39. package/dist/services/recommendationApi.js +127 -33
  40. package/dist/services/stripoApi.js +18 -18
  41. package/dist/src/@types/config/schemas.d.ts +10 -0
  42. package/dist/src/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.d.ts +2 -0
  43. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.d.ts +43 -0
  44. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.d.ts +29 -0
  45. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.d.ts +40 -0
  46. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.d.ts +38 -0
  47. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.d.ts +51 -0
  48. package/dist/src/composables/useConfig.d.ts +2 -0
  49. package/dist/src/composables/useHtmlValidator.d.ts +2 -0
  50. package/dist/src/composables/useRecommendation.d.ts +2 -0
  51. package/dist/src/composables/useStrategyFilters.d.ts +24 -0
  52. package/dist/src/enums/extensions/filteringV2.d.ts +72 -0
  53. package/dist/src/enums/extensions/recommendationBlock.d.ts +33 -0
  54. package/dist/src/enums/extensions/strategyDetail.d.ts +90 -0
  55. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +10 -4
  56. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +118 -0
  57. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +958 -1
  58. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
  59. package/dist/src/extensions/Blocks/Recommendation/utils/strategyHumanizer.d.ts +50 -0
  60. package/dist/src/extensions/Blocks/Recommendation/utils/strategyNavigation.d.ts +10 -0
  61. package/dist/src/extensions/Blocks/Recommendation/utils/strategySummary.d.ts +34 -0
  62. package/dist/src/extensions/Blocks/Recommendation/utils/strategyUrl.d.ts +51 -0
  63. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +8 -1
  64. package/dist/src/extensions/Blocks/common-control.d.ts +5 -2
  65. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  66. package/dist/src/services/recommendationApi.d.ts +9 -1
  67. package/dist/src/stores/config.d.ts +18 -0
  68. package/dist/src/utils/genericUtil.d.ts +9 -0
  69. package/dist/static/styles/components/base-input.css.js +6 -7
  70. package/dist/utils/dateUtil.js +23 -10
  71. package/dist/utils/genericUtil.js +10 -1
  72. package/dist/utils/templatePreparation.js +70 -57
  73. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
2
- import { object as a, number as n, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as f, boolean as o, array as c, record as k, fallback as C, literal as i, looseObject as g, variant as R, union as h, unknown as s, lazy as T } from "../../node_modules/valibot/dist/index.js";
2
+ import { object as a, number as n, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as f, boolean as o, array as c, record as k, fallback as R, literal as i, looseObject as g, variant as C, union as h, unknown as s, lazy as T } from "../../node_modules/valibot/dist/index.js";
3
3
  const d = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -78,7 +78,7 @@ const d = {
78
78
  select_items: e(c(S))
79
79
  })), P = k(
80
80
  t(),
81
- C(c(S), [])
81
+ R(c(S), [])
82
82
  ), D = g({
83
83
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
84
84
  id: e(n()),
@@ -201,7 +201,12 @@ const d = {
201
201
  /** Enable Liquid template syntax */
202
202
  liquidSyntax: e(o(), !1),
203
203
  /** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
204
- autosave: e(o(), !1)
204
+ autosave: e(o(), !1),
205
+ /**
206
+ * Select a Reusable Recommendation Strategy (RRS) instead of a per-block algorithm.
207
+ * Replaces the algorithm dropdown with a strategy dropdown fed from Smart Recommender.
208
+ */
209
+ reusableRecommendationStrategy: e(o(), !0)
205
210
  }), U = l([
206
211
  "amp-accordion",
207
212
  "amp-carousel",
@@ -273,7 +278,7 @@ const d = {
273
278
  (u) => typeof u == "function",
274
279
  "processor must be a function"
275
280
  )
276
- }), G = R("type", [
281
+ }), G = C("type", [
277
282
  H,
278
283
  _,
279
284
  j,
@@ -1,18 +1,18 @@
1
- import i from "./Guido.vue2.js";
1
+ import a from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import a from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var t = function() {
5
5
  var o = this, r = o._self._c, e = o._self._setupProxy;
6
- return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
6
+ return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.StrategyDetailDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
7
7
  return e.emit("onboarding:finished");
8
8
  } } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
9
- }, n = [], s = /* @__PURE__ */ a(
10
- i,
9
+ }, n = [], s = /* @__PURE__ */ i(
10
+ a,
11
11
  t,
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "50dac6de"
15
+ "f96d1003"
16
16
  );
17
17
  const l = s.exports;
18
18
  export {
@@ -1,29 +1,30 @@
1
1
  import { defineComponent as X, defineAsyncComponent as I, ref as W, computed as x, watch as Y, onMounted as Z, onUnmounted as ee } from "vue";
2
- import { useCortexBlueprintBridge as oe } from "../composables/useCortexBlueprintBridge.js";
3
- import { provideGuidoActions as te } from "../composables/useGuidoActions.js";
2
+ import { useCortexBlueprintBridge as te } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as oe } from "../composables/useGuidoActions.js";
4
4
  import { useGuidoStateBridge as ne } from "../composables/useGuidoStateBridge.js";
5
5
  import { usePartner as re } from "../composables/usePartner.js";
6
6
  import { useStripo as se } from "../composables/useStripo.js";
7
7
  import { useTimerClone as ae } from "../composables/useTimerClone.js";
8
8
  import { migrate as G } from "../config/migrator/index.js";
9
9
  import { ModuleFolderDefaults as H } from "../enums/defaults.js";
10
- import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
11
- import { useRecommendationExtensionStore as ie } from "../extensions/Blocks/Recommendation/store/recommendation.js";
10
+ import { RIBBON_SELECTOR as ie } from "../enums/onboarding.js";
11
+ import { useRecommendationExtensionStore as ce } from "../extensions/Blocks/Recommendation/store/recommendation.js";
12
12
  import me from "./organisms/AutoSaveController.vue.js";
13
13
  import de from "./organisms/base/Toaster.vue.js";
14
14
  import le from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
15
- import ue from "./organisms/header/HeaderWrapper.vue.js";
16
- import pe from "./organisms/LoadingWrapper.vue.js";
17
- import fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
18
- import ve from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
19
- import { useStripoApi as Se } from "../services/stripoApi.js";
20
- import { useConfigStore as ye } from "../stores/config.js";
15
+ import ue from "./organisms/extensions/recommendation/StrategyDetailDrawer.vue.js";
16
+ import pe from "./organisms/header/HeaderWrapper.vue.js";
17
+ import fe from "./organisms/LoadingWrapper.vue.js";
18
+ import ve from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
19
+ import Se from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
20
+ import { useStripoApi as ye } from "../services/stripoApi.js";
21
+ import { useConfigStore as ge } from "../stores/config.js";
21
22
  import { useDynamicContentStore as he } from "../stores/dynamic-content.js";
22
23
  import { useEditorStore as $ } from "../stores/editor.js";
23
- import { usePreviewStore as ge } from "../stores/preview.js";
24
- import { useTemplateStore as be } from "../stores/template.js";
25
- import { useUnsubscribeStore as Ee } from "../stores/unsubscribe.js";
26
- const Ve = /* @__PURE__ */ X({
24
+ import { usePreviewStore as be } from "../stores/preview.js";
25
+ import { useTemplateStore as we } from "../stores/template.js";
26
+ import { useUnsubscribeStore as De } from "../stores/unsubscribe.js";
27
+ const Je = /* @__PURE__ */ X({
27
28
  __name: "Guido",
28
29
  props: {
29
30
  config: null
@@ -34,11 +35,11 @@ const Ve = /* @__PURE__ */ X({
34
35
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
35
36
  ), V = I(
36
37
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
37
- ), E = W(), p = W(), f = he(), w = Ee(), i = ye();
38
- i.init(b.config);
39
- const m = $(), j = ge(), d = x(() => m.hasChanges), { isTestPartner: J } = re(), D = () => {
38
+ ), w = W(), p = W(), f = he(), D = De(), c = ge();
39
+ c.init(b.config);
40
+ const m = $(), j = be(), d = x(() => m.hasChanges), { isTestPartner: J } = re(), E = () => {
40
41
  var e;
41
- return (e = E.value) == null ? void 0 : e.handleSave(!0);
42
+ return (e = w.value) == null ? void 0 : e.handleSave(!0);
42
43
  }, C = (e) => {
43
44
  m.loadingStatus = e;
44
45
  }, {
@@ -46,10 +47,10 @@ const Ve = /* @__PURE__ */ X({
46
47
  userId: T,
47
48
  partnerName: L,
48
49
  username: k,
49
- template: o,
50
+ template: t,
50
51
  editor: s
51
- } = i, l = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", S = (o == null ? void 0 : o.preselectedDynamicContent) || [], U = (s == null ? void 0 : s.savedModulesFolderName) || H.SAVED_MODULES, _ = (s == null ? void 0 : s.defaultModulesFolderName) || H.DEFAULT_MODULES;
52
- oe(), ne();
52
+ } = c, l = (t == null ? void 0 : t.html) || "", F = (t == null ? void 0 : t.css) || "", S = (t == null ? void 0 : t.preselectedDynamicContent) || [], U = (s == null ? void 0 : s.savedModulesFolderName) || H.SAVED_MODULES, _ = (s == null ? void 0 : s.defaultModulesFolderName) || H.DEFAULT_MODULES;
53
+ te(), ne();
53
54
  const y = {
54
55
  emailId: v,
55
56
  userId: T,
@@ -62,11 +63,11 @@ const Ve = /* @__PURE__ */ X({
62
63
  onReady: () => {
63
64
  console.debug("guido:ready"), n("ready");
64
65
  }
65
- }, { initPlugin: O } = se(y, M), { getDefaultTemplate: P } = Se(), { cloneTimersOnSave: R, hasTimerBlocks: A } = ae(), Q = x(() => {
66
+ }, { initPlugin: O } = se(y, M), { getDefaultTemplate: P } = ye(), { cloneTimersOnSave: R, hasTimerBlocks: A } = ae(), Q = x(() => {
66
67
  var e;
67
- return !((e = i.ui) != null && e.showHeader);
68
+ return !((e = c.ui) != null && e.showHeader);
68
69
  });
69
- te({
70
+ oe({
70
71
  onBack: () => {
71
72
  console.debug("guido:back"), n("back");
72
73
  },
@@ -74,8 +75,8 @@ const Ve = /* @__PURE__ */ X({
74
75
  console.debug("guido:save:start"), n("save:start");
75
76
  },
76
77
  onSaveComplete: (e) => {
77
- const t = { ...e, metadata: y };
78
- console.debug("guido:save:complete", t), n("save:complete", t);
78
+ const o = { ...e, metadata: y };
79
+ console.debug("guido:save:complete", o), n("save:complete", o);
79
80
  },
80
81
  onTestEmailClick: () => {
81
82
  console.debug("guido:test-email:click"), n("test-email:click");
@@ -89,52 +90,52 @@ const Ve = /* @__PURE__ */ X({
89
90
  Y(() => d.value, () => {
90
91
  n("on-change", d.value);
91
92
  });
92
- const h = (e) => {
93
- const t = e, { attribute: u, position: c } = t.detail;
94
- console.debug("dynamic-content:open", t.detail), n("dynamic-content:open", u, c);
93
+ const g = (e) => {
94
+ const o = e, { attribute: u, position: i } = o.detail;
95
+ console.debug("dynamic-content:open", o.detail), n("dynamic-content:open", u, i);
95
96
  };
96
97
  let a = null;
97
- const g = () => {
98
- var t;
99
- const e = document.querySelector(ce);
100
- (t = p.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
98
+ const h = () => {
99
+ var o;
100
+ const e = document.querySelector(ie);
101
+ (o = p.value) == null || o.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
101
102
  };
102
103
  return Z(async () => {
103
- var t, u;
104
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ie().$reset(), $().$reset(), m.templateId = v, be().$reset(), g();
105
- const e = (t = p.value) == null ? void 0 : t.parentElement;
106
- e && (a = new ResizeObserver(g), a.observe(e));
104
+ var o, u;
105
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ce().$reset(), $().$reset(), m.templateId = v, we().$reset(), h();
106
+ const e = (o = p.value) == null ? void 0 : o.parentElement;
107
+ e && (a = new ResizeObserver(h), a.observe(e));
107
108
  try {
108
- w.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
109
- const c = ((u = o == null ? void 0 : o.migration) == null ? void 0 : u.recommendationConfigs) ?? {};
109
+ D.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
110
+ const i = ((u = t == null ? void 0 : t.migration) == null ? void 0 : u.recommendationConfigs) ?? {};
110
111
  let r = {
111
- html: l && await G(l, c),
112
+ html: l && await G(l, i),
112
113
  css: F
113
114
  };
114
- r.html || (r = await P(), r.html = await G(r.html, c)), A(r.html) && (r.html = await R(r.html)), await O(r), f.selectedDynamicContentList = S;
115
- } catch (c) {
116
- console.error("Failed to initialize Stripo editor:", c);
115
+ r.html || (r = await P(), r.html = await G(r.html, i)), A(r.html) && (r.html = await R(r.html)), await O(r), f.selectedDynamicContentList = S;
116
+ } catch (i) {
117
+ console.error("Failed to initialize Stripo editor:", i);
117
118
  }
118
- document.addEventListener("dynamic-content:open", h);
119
+ document.addEventListener("dynamic-content:open", g);
119
120
  }), ee(() => {
120
- a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", h);
121
+ a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", g);
121
122
  try {
122
123
  window.UIEditor.removeEditor();
123
124
  } catch {
124
125
  console.debug("Failed to remove Stripo editor: No editor found");
125
126
  }
126
- i.reset();
127
+ c.reset();
127
128
  }), q({
128
129
  dynamicContent: {
129
130
  insert: B,
130
131
  close: N
131
132
  },
132
133
  hasChanges: d,
133
- saveSilent: D,
134
+ saveSilent: E,
134
135
  setLoading: C
135
- }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: b, configStore: i, editorStore: m, previewStore: j, hasChanges: d, isTestPartner: J, saveSilent: D, setLoading: C, templateId: v, userId: T, partnerName: L, username: k, templateConfig: o, editorConfig: s, html: l, css: F, preselectedDynamicContentList: S, savedModulesFolderName: U, defaultModulesFolderName: _, emit: n, metadata: y, options: M, initPlugin: O, getDefaultTemplate: P, cloneTimersOnSave: R, hasTimerBlocks: A, noHeader: Q, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: h, ribbonObserver: a, updateRibbonOffset: g, AutoSaveController: me, Toaster: de, FilterSelectionDrawer: le, HeaderWrapper: ue, LoadingWrapper: pe, SaveAsTemplateDrawer: fe, UnsubscribeWrapper: ve };
136
+ }), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, headerWrapperRef: w, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: D, props: b, configStore: c, editorStore: m, previewStore: j, hasChanges: d, isTestPartner: J, saveSilent: E, setLoading: C, templateId: v, userId: T, partnerName: L, username: k, templateConfig: t, editorConfig: s, html: l, css: F, preselectedDynamicContentList: S, savedModulesFolderName: U, defaultModulesFolderName: _, emit: n, metadata: y, options: M, initPlugin: O, getDefaultTemplate: P, cloneTimersOnSave: R, hasTimerBlocks: A, noHeader: Q, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: g, ribbonObserver: a, updateRibbonOffset: h, AutoSaveController: me, Toaster: de, FilterSelectionDrawer: le, StrategyDetailDrawer: ue, HeaderWrapper: pe, LoadingWrapper: fe, SaveAsTemplateDrawer: ve, UnsubscribeWrapper: Se };
136
137
  }
137
138
  });
138
139
  export {
139
- Ve as default
140
+ Je as default
140
141
  };
@@ -0,0 +1,38 @@
1
+ import o from "./StrategyDetailDrawer.vue2.js";
2
+ /* empty css */
3
+ import l from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var c = function() {
5
+ var i;
6
+ var a = this, s = a._self._c, t = a._self._setupProxy;
7
+ return s(t.InDrawer, { attrs: { id: "recommendation-strategy-detail-drawer", "close-button-status": "", "footer-status": "", "full-width-content-status": "", "overlay-status": "", size: "medium", state: "default", "description-status": !1, "footer-button-group-options": t.footerButtonGroupOptions, status: t.isOpen, "title-text": ((i = t.strategy) == null ? void 0 : i.name) || "" }, on: { cancelOrBackButtonEvent: t.close, onCloseEvent: t.close, primaryButtonEvent: t.onPrimaryAction }, scopedSlots: a._u([{ key: "headerBottomSlot", fn: function() {
8
+ return [t.strategy ? s(t.InTabs, { staticClass: "p-r z-4 px-5", attrs: { "active-tab": t.activeTab, "add-new-tab-active": !1, draggable: !1, "dropdown-tabs": !1, "tabs-list": t.tabs, "use-router": !1 }, on: { click: function(e) {
9
+ t.activeTab = e;
10
+ } } }) : a._e()];
11
+ }, proxy: !0 }, { key: "contentSlot", fn: function() {
12
+ return [t.strategy ? s("div", [t.isSharedAcrossCampaigns ? s("div", { staticClass: "px-5 pt-5" }, [s(t.InInfoBox, { attrs: { id: "strategy-shared-notice", theme: "light", variant: "information", "description-status": !1, "title-status": !1 } }, [s("ul", { staticClass: "strategy-shared-notice" }, a._l(t.sharedNotice, function(e, r) {
13
+ return s("li", { key: r, domProps: { innerHTML: a._s(e) } });
14
+ }), 0)])], 1) : a._e(), t.activeTab === t.DetailTabs.GENERAL ? s("div", [s("div", { staticClass: "px-5 py-5 bor-b-s-s bor-b-c-6 bor-b-w-1" }, [s("div", { staticClass: "f-s-13 f-w-600 mb-3" }, [a._v(" " + a._s(t.trans("discovery-strategy.suitable-page-and-channel-types")) + " ")]), a._l(t.visibleRows(t.pageAndChannelDetails), function(e, r) {
15
+ return s(t.InfoDisplayValue, { key: e.title, attrs: { index: r, title: e.title, "translate-value": e.translateValue, value: e.value } });
16
+ })], 2), s("div", { staticClass: "px-5 py-5 bor-b-s-s bor-b-c-6 bor-b-w-1" }, [s("div", { staticClass: "f-s-13 f-w-600 mb-3" }, [a._v(" " + a._s(t.trans("discovery-strategy.recommendation-widget-preferences")) + " ")]), a._l(t.visibleRows(t.widgetPreferences), function(e, r) {
17
+ return s(t.InfoDisplayValue, { key: e.title, attrs: { index: r, title: e.title, "translate-value": e.translateValue, value: e.value } });
18
+ })], 2), s("div", { staticClass: "px-5 py-5 bor-b-s-s bor-b-c-6 bor-b-w-1" }, [s("div", { staticClass: "f-s-13 f-w-600 mb-3" }, [a._v(" " + a._s(t.trans("discovery-strategy.advanced-personalization-criteria")) + " ")]), a._l(t.visibleRows(t.advancedPersonalization), function(e, r) {
19
+ return s(t.InfoDisplayValue, { key: e.title, attrs: { index: r, title: e.title, "translate-value": e.translateValue, value: e.value } });
20
+ })], 2), s("div", { staticClass: "px-5 py-5" }, [s("div", { staticClass: "f-s-13 f-w-600 mb-3" }, [a._v(" " + a._s(t.trans("discovery-strategy.filters")) + " ")]), s(t.FilterHumanizer, { attrs: { filters: t.strategy.filters } })], 1)]) : a._e(), t.activeTab === t.DetailTabs.OTHER ? s("div", [s("div", { staticClass: "px-5 py-5 bor-b-s-s bor-b-c-6 bor-b-w-1 other-details" }, a._l(t.visibleRows(t.otherDetails), function(e, r) {
21
+ return s(t.InfoDisplayValue, { key: e.title, attrs: { icon: e.icon, "icon-tooltip": e.iconTooltip, "icon-tooltip-after-clicked": e.iconTooltipAfterClicked, index: r, title: e.title, "translate-value": e.translateValue, value: e.value }, on: { iconClick: function(f) {
22
+ var n;
23
+ (n = e.iconClick) == null || n.call(e, e.value);
24
+ } } });
25
+ }), 1), s("div", { staticClass: "px-5 py-5" }, [s(t.CampaignTable, { attrs: { campaigns: t.store.strategyCampaigns, loading: t.store.strategyCampaignsLoading } })], 1)]) : a._e()]) : a._e()];
26
+ }, proxy: !0 }]) });
27
+ }, u = [], v = /* @__PURE__ */ l(
28
+ o,
29
+ c,
30
+ u,
31
+ !1,
32
+ null,
33
+ "8e655adb"
34
+ );
35
+ const _ = v.exports;
36
+ export {
37
+ _ as default
38
+ };
@@ -0,0 +1,271 @@
1
+ import { defineComponent as le, ref as ie, computed as l, watch as U } from "vue";
2
+ import { useTranslations as re } from "../../../../composables/useTranslations.js";
3
+ import { STRATEGY_PAGES as oe } from "../../../../enums/extensions/recommendationBlock.js";
4
+ import { DetailTabs as c, EMAIL_CHANNEL as ue, PageTypeTranslationKeys as ne, TIME as F, COUNT as X } from "../../../../enums/extensions/strategyDetail.js";
5
+ import { useRecommendationExtensionStore as ce } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
6
+ import { navigateToStrategyPage as de, buildStrategyEditPath as ve } from "../../../../extensions/Blocks/Recommendation/utils/strategyNavigation.js";
7
+ import { getMethodTranslationKey as ye, getAlgorithmTranslationKey as pe } from "../../../../extensions/Blocks/Recommendation/utils/strategySummary.js";
8
+ import { formatShortDate as J } from "../../../../utils/dateUtil.js";
9
+ import { parseJsonField as T } from "../../../../utils/genericUtil.js";
10
+ import { InTabs as me, InInfoBox as ge, InDrawer as fe } from "@useinsider/design-system-vue";
11
+ import _e from "./strategy-detail/CampaignTable.vue.js";
12
+ import be from "./strategy-detail/FilterHumanizer.vue.js";
13
+ import he from "./strategy-detail/InfoDisplayValue.vue.js";
14
+ const Re = /* @__PURE__ */ le({
15
+ __name: "StrategyDetailDrawer",
16
+ setup(Ve) {
17
+ const _ = "MIXED", C = "CHECKOUT_RECOMMENDATION", i = re(), o = ce(), p = ie(c.GENERAL), t = l(() => o.getDrawerStrategy), b = l(() => o.strategyDetailDrawerStatus), m = l(() => t.value ? String(t.value.strategy_id) : ""), u = l(() => i("campaign-details-modal.none")), Y = l(() => [
18
+ {
19
+ value: c.GENERAL,
20
+ path: "",
21
+ text: i("discovery-strategy.recommendation-strategy-details")
22
+ },
23
+ {
24
+ value: c.OTHER,
25
+ path: "",
26
+ text: i("discovery-strategy.campaign-and-other-details")
27
+ }
28
+ ]);
29
+ U(
30
+ () => [b.value, p.value, m.value],
31
+ ([e, a, s]) => {
32
+ e && a === c.OTHER && s && o.fetchStrategyCampaigns(s);
33
+ },
34
+ { immediate: !0 }
35
+ ), U(b, (e) => {
36
+ e || (p.value = c.GENERAL);
37
+ });
38
+ const q = () => {
39
+ p.value = c.GENERAL, o.closeStrategyDrawer();
40
+ }, h = l(() => {
41
+ var e, a;
42
+ return (((a = (e = t.value) == null ? void 0 : e.campaignCount) == null ? void 0 : a.active) ?? 0) > 1;
43
+ }), Q = l(() => [
44
+ i("strategy-details-modal.first-line"),
45
+ i("strategy-details-modal.second-line").replace("{url}", oe.LISTING)
46
+ ]), W = l(() => ({
47
+ primaryButton: {
48
+ styling: "solid",
49
+ type: "primary",
50
+ labelText: h.value ? i("strategy-details-modal.duplicate-and-assign") : i("strategy-details-modal.edit"),
51
+ loadingStatus: o.strategyDuplicating
52
+ },
53
+ cancelOrBackButton: {
54
+ styling: "ghost",
55
+ type: "secondary",
56
+ labelText: i("products.cancel"),
57
+ disabledStatus: o.strategyDuplicating
58
+ }
59
+ })), Z = () => {
60
+ if (h.value) {
61
+ o.duplicateAndAssignStrategy();
62
+ return;
63
+ }
64
+ de(ve(m.value));
65
+ }, E = l(() => o.strategyCampaigns.filter((e) => e.status === "Active").reduce((e, a) => {
66
+ var s;
67
+ return e + (((s = a.variants) == null ? void 0 : s.length) ?? 0);
68
+ }, 0)), S = l(() => o.strategyCampaigns.filter((e) => e.status !== "Active").reduce((e, a) => {
69
+ var s;
70
+ return e + (((s = a.variants) == null ? void 0 : s.length) ?? 0);
71
+ }, 0)), D = l(() => {
72
+ var a;
73
+ return (((a = t.value) == null ? void 0 : a.suitable_channels) || "").split(",").map((s) => s.trim()).filter(Boolean).map((s) => i(
74
+ s.toLowerCase() === ue ? "products.newsletter" : `products.${s.toLowerCase()}`
75
+ )).join(", ");
76
+ }), A = l(() => {
77
+ var s;
78
+ const e = (s = t.value) == null ? void 0 : s.suitable_page_types;
79
+ return e ? (typeof e == "string" ? e.split(",").map((r) => r.trim()) : e).filter(Boolean).map((r) => i(ne[r] || r)).join(", ") : "";
80
+ }), ee = l(() => [
81
+ {
82
+ title: "discovery-strategy.channel-types",
83
+ value: D.value || u.value,
84
+ isVisible: !0,
85
+ translateValue: !1
86
+ },
87
+ {
88
+ title: "discovery-strategy.page-types",
89
+ value: A.value || u.value,
90
+ isVisible: !0,
91
+ translateValue: !1
92
+ }
93
+ ]), g = l(
94
+ () => {
95
+ var e;
96
+ return T((e = t.value) == null ? void 0 : e.base_product, null);
97
+ }
98
+ ), V = l(
99
+ () => {
100
+ var e;
101
+ return ((e = t.value) == null ? void 0 : e.algorithm) !== _ && g.value !== null;
102
+ }
103
+ ), I = l(() => {
104
+ const e = g.value;
105
+ if (!e)
106
+ return "";
107
+ const a = i(`discovery-strategy.base-product-source-${e.source}`);
108
+ return e.source === "page" ? a : `${a} ${i(`discovery-strategy.base-product-count-${e.count}`)}`;
109
+ }), B = l(() => t.value ? t.value.algorithm !== _ ? T(t.value.manual_merchandising_products, []).filter(Boolean).join(", ") : T(t.value.mixed_strategies, []).map((e) => e == null ? void 0 : e.productId).filter(Boolean).join(", ") : ""), n = (e) => e ? "common.yes" : "common.no", te = l(() => {
110
+ var e, a, s, r, d, v, y;
111
+ return [
112
+ {
113
+ title: "discovery-strategy.method",
114
+ value: ye(((e = t.value) == null ? void 0 : e.algorithm) || ""),
115
+ isVisible: !0,
116
+ translateValue: !0
117
+ },
118
+ {
119
+ title: "algorithm-panel.algorithm-header",
120
+ value: (((a = t.value) == null ? void 0 : a.algorithm_used) || "").split(",").map((f) => pe(f.trim())).join(", "),
121
+ isVisible: !0,
122
+ translateValue: !0
123
+ },
124
+ {
125
+ title: "discovery-strategy.base-product-label",
126
+ value: I.value,
127
+ isVisible: V.value,
128
+ translateValue: !1
129
+ },
130
+ {
131
+ title: "discovery-strategy.base-product-pin-label",
132
+ value: n((s = g.value) == null ? void 0 : s.pin),
133
+ isVisible: V.value,
134
+ translateValue: !0
135
+ },
136
+ {
137
+ title: "discovery-strategy.checkout-recommendation-cart-value",
138
+ value: String(((r = t.value) == null ? void 0 : r.checkout_recommendation_cart_value) ?? ""),
139
+ isVisible: ((d = t.value) == null ? void 0 : d.algorithm_used) === C,
140
+ translateValue: !1
141
+ },
142
+ {
143
+ title: "discovery-strategy.number-of-products",
144
+ value: String(((v = t.value) == null ? void 0 : v.size) ?? ""),
145
+ isVisible: !0,
146
+ translateValue: !1
147
+ },
148
+ {
149
+ title: "discovery-strategy.manual-merchandising-products",
150
+ value: B.value || u.value,
151
+ isVisible: !0,
152
+ translateValue: !1
153
+ },
154
+ {
155
+ title: "discovery-strategy.shuffle-recommended-products",
156
+ value: n((y = t.value) == null ? void 0 : y.shuffle),
157
+ isVisible: !0,
158
+ translateValue: !0
159
+ }
160
+ ];
161
+ }), x = (e, a) => {
162
+ const s = (a || "").toLowerCase(), r = e === 1 ? `date-time.${s}` : `date-time.${s}s`;
163
+ return `${e ?? ""} ${i(r)}`;
164
+ }, w = (e) => `${e ?? ""} ${i(e === 1 ? "discovery-strategy.item" : "discovery-strategy.items")}`, ae = l(() => {
165
+ var e, a, s, r, d, v, y, f, L, O, P, R, $, M, k, G, H, j, K, z;
166
+ return [
167
+ {
168
+ title: "discovery-strategy.personalize-recommendations-based-on-attribute-affinity",
169
+ value: n((e = t.value) == null ? void 0 : e.attribute_affinity),
170
+ isVisible: !0,
171
+ translateValue: !0
172
+ },
173
+ {
174
+ title: "discovery-strategy.exclude-recently-view-items",
175
+ value: n((a = t.value) == null ? void 0 : a.exclude_view),
176
+ isVisible: !((s = t.value) != null && s.exclude_view),
177
+ translateValue: !0
178
+ },
179
+ {
180
+ title: "discovery-strategy.exclude-items-viewed-in-the-last",
181
+ value: x((r = t.value) == null ? void 0 : r.exclude_view_duration, (d = t.value) == null ? void 0 : d.exclude_view_duration_type),
182
+ isVisible: !!((v = t.value) != null && v.exclude_view) && ((y = t.value) == null ? void 0 : y.exclude_view_option) === F,
183
+ translateValue: !1
184
+ },
185
+ {
186
+ title: "discovery-strategy.number-of-items-to-exclude-from-recently-viewed",
187
+ value: w((f = t.value) == null ? void 0 : f.exclude_view_item_count),
188
+ isVisible: !!((L = t.value) != null && L.exclude_view) && ((O = t.value) == null ? void 0 : O.exclude_view_option) === X,
189
+ translateValue: !1
190
+ },
191
+ {
192
+ title: "discovery-strategy.exclude-recently-purchased-items",
193
+ value: n((P = t.value) == null ? void 0 : P.exclude_purchase),
194
+ isVisible: !((R = t.value) != null && R.exclude_purchase),
195
+ translateValue: !0
196
+ },
197
+ {
198
+ title: "discovery-strategy.exclude-items-purchase-in-the-last",
199
+ value: x(($ = t.value) == null ? void 0 : $.exclude_purchase_duration, (M = t.value) == null ? void 0 : M.exclude_purchase_duration_type),
200
+ isVisible: !!((k = t.value) != null && k.exclude_purchase) && ((G = t.value) == null ? void 0 : G.exclude_purchase_option) === F,
201
+ translateValue: !1
202
+ },
203
+ {
204
+ title: "discovery-strategy.number-of-items-to-exclude-from-recently-purchased",
205
+ value: w((H = t.value) == null ? void 0 : H.exclude_purchase_item_count),
206
+ isVisible: !!((j = t.value) != null && j.exclude_purchase) && ((K = t.value) == null ? void 0 : K.exclude_purchase_option) === X,
207
+ translateValue: !1
208
+ },
209
+ {
210
+ title: "discovery-strategy.exclude-recently-added-cart-items",
211
+ value: n((z = t.value) == null ? void 0 : z.exclude_cart),
212
+ isVisible: !0,
213
+ translateValue: !0
214
+ }
215
+ ];
216
+ }), N = (e) => {
217
+ var a;
218
+ (a = navigator.clipboard) == null || a.writeText(e).catch(() => {
219
+ console.warn("[StrategyDetailDrawer] Copying the strategy id to the clipboard failed.");
220
+ });
221
+ }, se = l(() => {
222
+ var e, a, s;
223
+ return [
224
+ {
225
+ title: "discovery-strategy.strategy-id",
226
+ value: m.value,
227
+ isVisible: !0,
228
+ translateValue: !1,
229
+ icon: "line-copy",
230
+ iconTooltip: "discovery-strategy.copy",
231
+ iconTooltipAfterClicked: "discovery-strategy.copied",
232
+ iconClick: N
233
+ },
234
+ {
235
+ title: "discovery-strategy.last-updated-by",
236
+ value: ((e = t.value) == null ? void 0 : e.last_updated_by) || u.value,
237
+ isVisible: !0,
238
+ translateValue: !1
239
+ },
240
+ {
241
+ title: "discovery-strategy.last-updated-on",
242
+ value: (a = t.value) != null && a.updated_at ? J(t.value.updated_at) : u.value,
243
+ isVisible: !0,
244
+ translateValue: !1
245
+ },
246
+ {
247
+ title: "discovery-strategy.created-date",
248
+ value: (s = t.value) != null && s.created_at ? J(t.value.created_at) : u.value,
249
+ isVisible: !0,
250
+ translateValue: !1
251
+ },
252
+ {
253
+ title: "discovery-strategy.variants-with-live-recommendation-strategies",
254
+ value: String(E.value),
255
+ isVisible: !0,
256
+ translateValue: !1
257
+ },
258
+ {
259
+ title: "discovery-strategy.variants-with-idle-recommendation-strategies",
260
+ value: String(S.value),
261
+ isVisible: !0,
262
+ translateValue: !1
263
+ }
264
+ ];
265
+ });
266
+ return { __sfc: !0, MIXED: _, CHECKOUT_RECOMMENDATION: C, trans: i, store: o, activeTab: p, strategy: t, isOpen: b, strategyId: m, none: u, tabs: Y, close: q, isSharedAcrossCampaigns: h, sharedNotice: Q, footerButtonGroupOptions: W, onPrimaryAction: Z, liveVariantsCount: E, idleVariantsCount: S, suitableChannelTypes: D, suitablePageTypes: A, pageAndChannelDetails: ee, baseProduct: g, isBaseProductVisible: V, baseProductSourceLabel: I, manualMerchandisingProducts: B, yesNo: n, widgetPreferences: te, durationText: x, itemCountText: w, advancedPersonalization: ae, copyStrategyId: N, otherDetails: se, visibleRows: (e) => e.filter((a) => a.isVisible), DetailTabs: c, InDrawer: fe, InInfoBox: ge, InTabs: me, CampaignTable: _e, FilterHumanizer: be, InfoDisplayValue: he };
267
+ }
268
+ });
269
+ export {
270
+ Re as default
271
+ };
@@ -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
+ };