@useinsider/guido 3.3.0-beta.d5c796a → 3.3.0-beta.ddabd14

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 (39) hide show
  1. package/dist/components/Guido.vue.js +1 -1
  2. package/dist/components/Guido.vue2.js +103 -91
  3. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +9 -11
  4. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +70 -35
  5. package/dist/components/organisms/header/MiddleSlot.vue.js +1 -1
  6. package/dist/components/organisms/header/MiddleSlot.vue2.js +7 -8
  7. package/dist/composables/useCortexBlueprintBridge.js +36 -61
  8. package/dist/composables/useHtmlValidator.js +41 -36
  9. package/dist/composables/useRecommendation.js +2 -2
  10. package/dist/composables/useStripo.js +66 -62
  11. package/dist/config/migrator/index.js +21 -10
  12. package/dist/config/migrator/radioButtonMigrator.js +73 -48
  13. package/dist/enums/extensions/recommendationBlock.js +101 -46
  14. package/dist/enums/unsubscribe.js +25 -24
  15. package/dist/extensions/Blocks/Checkbox/control.js +23 -23
  16. package/dist/extensions/Blocks/RadioButton/control.js +15 -15
  17. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  18. package/dist/extensions/Blocks/Recommendation/block.js +43 -36
  19. package/dist/extensions/Blocks/Recommendation/services/configService.js +33 -26
  20. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +35 -26
  21. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +25 -12
  22. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
  23. package/dist/guido.css +1 -1
  24. package/dist/services/unsubscribeApi.js +6 -6
  25. package/dist/src/composables/useCortexBlueprintBridge.d.ts +2 -5
  26. package/dist/src/enums/extensions/recommendationBlock.d.ts +6 -1
  27. package/dist/src/enums/unsubscribe.d.ts +8 -3
  28. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  29. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +11 -3
  30. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -1
  31. package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +2 -0
  32. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
  33. package/dist/utils/templatePreparation.js +57 -50
  34. package/package.json +1 -1
  35. package/dist/components/organisms/header/AiStatusPill.vue.js +0 -18
  36. package/dist/components/organisms/header/AiStatusPill.vue2.js +0 -13
  37. package/dist/src/components/organisms/header/AiStatusPill.vue.d.ts +0 -2
  38. package/dist/src/stores/ai-status.d.ts +0 -41
  39. package/dist/stores/ai-status.js +0 -25
@@ -12,7 +12,7 @@ var t = function() {
12
12
  n,
13
13
  !1,
14
14
  null,
15
- "cdee3452"
15
+ "fcccebf6"
16
16
  );
17
17
  const l = s.exports;
18
18
  export {
@@ -1,135 +1,147 @@
1
- import { defineComponent as J, defineAsyncComponent as R, ref as I, computed as W, watch as Q, onMounted as X, onUnmounted as Y } from "vue";
2
- import { useCortexBlueprintBridge as Z } from "../composables/useCortexBlueprintBridge.js";
3
- import { provideGuidoActions as ee } from "../composables/useGuidoActions.js";
4
- import { useGuidoStateBridge as oe } from "../composables/useGuidoStateBridge.js";
5
- import { usePartner as te } from "../composables/usePartner.js";
6
- import { useStripo as ne } from "../composables/useStripo.js";
7
- import { useTimerClone as re } from "../composables/useTimerClone.js";
8
- import { migrate as x } from "../config/migrator/index.js";
9
- import { ModuleFolderDefaults as G } from "../enums/defaults.js";
10
- import { RIBBON_SELECTOR as se } from "../enums/onboarding.js";
11
- import ce from "./organisms/AutoSaveController.vue.js";
12
- import ae from "./organisms/base/Toaster.vue.js";
13
- import ie from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
14
- import me from "./organisms/header/HeaderWrapper.vue.js";
15
- import de from "./organisms/LoadingWrapper.vue.js";
16
- import le from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
17
- import ue from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
18
- import { useStripoApi as pe } from "../services/stripoApi.js";
19
- import { useConfigStore as fe } from "../stores/config.js";
20
- import { useDynamicContentStore as ve } from "../stores/dynamic-content.js";
21
- import { useEditorStore as ye } from "../stores/editor.js";
22
- import { usePreviewStore as he } from "../stores/preview.js";
23
- import { useUnsubscribeStore as Se } from "../stores/unsubscribe.js";
24
- const He = /* @__PURE__ */ J({
1
+ import { defineComponent as ee, defineAsyncComponent as G, ref as z, computed as q, watch as oe, onMounted as te, onUnmounted as ne } from "vue";
2
+ import { useCortexBlueprintBridge as se } from "../composables/useCortexBlueprintBridge.js";
3
+ import { provideGuidoActions as re } from "../composables/useGuidoActions.js";
4
+ import { useGuidoStateBridge as ce } from "../composables/useGuidoStateBridge.js";
5
+ import { usePartner as ae } from "../composables/usePartner.js";
6
+ import { useStripo as ie } from "../composables/useStripo.js";
7
+ import { useTimerClone as de } from "../composables/useTimerClone.js";
8
+ import { migrate as K } from "../config/migrator/index.js";
9
+ import { ModuleFolderDefaults as V } from "../enums/defaults.js";
10
+ import { RIBBON_SELECTOR as me } from "../enums/onboarding.js";
11
+ import le from "./organisms/AutoSaveController.vue.js";
12
+ import ue from "./organisms/base/Toaster.vue.js";
13
+ import pe from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
14
+ import fe from "./organisms/header/HeaderWrapper.vue.js";
15
+ import ve from "./organisms/LoadingWrapper.vue.js";
16
+ import be from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
17
+ import ge from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
18
+ import { useStripoApi as ye } from "../services/stripoApi.js";
19
+ import { useConfigStore as Se } from "../stores/config.js";
20
+ import { useDynamicContentStore as he } from "../stores/dynamic-content.js";
21
+ import { useEditorStore as we } from "../stores/editor.js";
22
+ import { usePreviewStore as Ee } from "../stores/preview.js";
23
+ import { useUnsubscribeStore as De } from "../stores/unsubscribe.js";
24
+ const je = /* @__PURE__ */ ee({
25
25
  __name: "Guido",
26
26
  props: {
27
27
  config: null
28
28
  },
29
29
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
30
- setup(H, { expose: z, emit: n }) {
31
- const g = H, q = R(
30
+ setup($, { expose: j, emit: r }) {
31
+ const D = $, J = G(
32
32
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
33
- ), K = R(
33
+ ), Q = G(
34
34
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
35
- ), w = I(), u = I(), p = ve(), E = Se(), i = fe();
36
- i.init(g.config);
37
- const f = ye(), V = he(), m = W(() => f.hasChanges), { isTestPartner: $ } = te(), D = () => {
35
+ ), C = z(), v = z(), b = he(), k = De(), m = Se();
36
+ m.init(D.config);
37
+ const g = we(), X = Ee(), f = q(() => g.hasChanges), { isTestPartner: Y } = ae(), T = () => {
38
38
  var e;
39
- return (e = w.value) == null ? void 0 : e.handleSave(!0);
39
+ return (e = C.value) == null ? void 0 : e.handleSave(!0);
40
40
  }, {
41
- templateId: v,
42
- userId: C,
43
- partnerName: T,
44
- username: k,
41
+ templateId: y,
42
+ userId: A,
43
+ partnerName: B,
44
+ username: F,
45
45
  template: o,
46
- editor: s
47
- } = i, d = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", y = (o == null ? void 0 : o.preselectedDynamicContent) || [], L = (s == null ? void 0 : s.savedModulesFolderName) || G.SAVED_MODULES, U = (s == null ? void 0 : s.defaultModulesFolderName) || G.DEFAULT_MODULES;
48
- f.templateId = v, Z(), oe();
46
+ editor: c
47
+ } = m, l = (o == null ? void 0 : o.html) || "", L = (o == null ? void 0 : o.css) || "", S = (o == null ? void 0 : o.preselectedDynamicContent) || [], U = (c == null ? void 0 : c.savedModulesFolderName) || V.SAVED_MODULES, _ = (c == null ? void 0 : c.defaultModulesFolderName) || V.DEFAULT_MODULES;
48
+ g.templateId = y, se(), ce();
49
49
  const h = {
50
- emailId: v,
51
- userId: C,
52
- username: k,
53
- partnerName: T,
54
- savedModulesFolderName: L,
55
- defaultModulesFolderName: U
56
- }, _ = {
57
- preselectedDynamicContentList: y,
50
+ emailId: y,
51
+ userId: A,
52
+ username: F,
53
+ partnerName: B,
54
+ savedModulesFolderName: U,
55
+ defaultModulesFolderName: _
56
+ }, H = {
57
+ preselectedDynamicContentList: S,
58
58
  onReady: () => {
59
- console.debug("guido:ready"), n("ready");
59
+ console.debug("guido:ready"), r("ready");
60
60
  }
61
- }, { initPlugin: M } = ne(h, _), { getDefaultTemplate: O } = pe(), { cloneTimersOnSave: P, hasTimerBlocks: A } = re(), j = W(() => {
61
+ }, { initPlugin: M } = ie(h, H), { getDefaultTemplate: O } = ye(), { cloneTimersOnSave: P, hasTimerBlocks: N } = de(), Z = q(() => {
62
62
  var e;
63
- return !((e = i.ui) != null && e.showHeader);
63
+ return !((e = m.ui) != null && e.showHeader);
64
64
  });
65
- ee({
65
+ re({
66
66
  onBack: () => {
67
- console.debug("guido:back"), n("back");
67
+ console.debug("guido:back"), r("back");
68
68
  },
69
69
  onSaveStart: () => {
70
- console.debug("guido:save:start"), n("save:start");
70
+ console.debug("guido:save:start"), r("save:start");
71
71
  },
72
72
  onSaveComplete: (e) => {
73
- const t = { ...e, metadata: h };
74
- console.debug("guido:save:complete", t), n("save:complete", t);
73
+ const t = { ...e, metadata: h }, a = (n) => ((n == null ? void 0 : n.match(/<td[^>]*radio-button-v2[^>]*>/gi)) ?? []).map((u) => {
74
+ var p;
75
+ const d = (((p = u.match(/class="([^"]*)"/)) == null ? void 0 : p[1]) ?? "").split(/\s+/).filter(Boolean);
76
+ return { classes: d, hasBlock: d.includes("radio-button-block"), tag: u };
77
+ });
78
+ console.debug("guido:save:complete", t), console.debug("guido:save:radio-tds", {
79
+ rawHtml: a(e.rawHtml),
80
+ compiledHtml: a(e.compiledHtml)
81
+ }), r("save:complete", t);
75
82
  },
76
83
  onTestEmailClick: () => {
77
- console.debug("guido:test-email:click"), n("test-email:click");
84
+ console.debug("guido:test-email:click"), r("test-email:click");
78
85
  }
79
86
  });
80
- const B = (e) => {
81
- console.debug("dynamic-content:close", e), p.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
82
- }, N = () => {
87
+ const R = (e) => {
88
+ console.debug("dynamic-content:close", e), b.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
89
+ }, I = () => {
83
90
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
84
91
  };
85
- Q(() => m.value, () => {
86
- n("on-change", m.value);
92
+ oe(() => f.value, () => {
93
+ r("on-change", f.value);
87
94
  });
88
- const S = (e) => {
89
- const t = e, { attribute: l, position: a } = t.detail;
90
- console.debug("dynamic-content:open", t.detail), n("dynamic-content:open", l, a);
95
+ const w = (e) => {
96
+ const t = e, { attribute: a, position: n } = t.detail;
97
+ console.debug("dynamic-content:open", t.detail), r("dynamic-content:open", a, n);
91
98
  };
92
- let c = null;
93
- const b = () => {
99
+ let i = null;
100
+ const E = () => {
94
101
  var t;
95
- const e = document.querySelector(se);
96
- (t = u.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
102
+ const e = document.querySelector(me);
103
+ (t = v.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
97
104
  };
98
- return X(async () => {
99
- var t, l;
100
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), b();
101
- const e = (t = u.value) == null ? void 0 : t.parentElement;
102
- e && (c = new ResizeObserver(b), c.observe(e));
105
+ return te(async () => {
106
+ var t, a;
107
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), E();
108
+ const e = (t = v.value) == null ? void 0 : t.parentElement;
109
+ e && (i = new ResizeObserver(E), i.observe(e));
103
110
  try {
104
- E.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
105
- const a = ((l = o == null ? void 0 : o.migration) == null ? void 0 : l.recommendationConfigs) ?? {};
106
- let r = {
107
- html: d && await x(d, a),
108
- css: F
111
+ k.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
112
+ const n = ((a = o == null ? void 0 : o.migration) == null ? void 0 : a.recommendationConfigs) ?? {}, u = (d) => ((d == null ? void 0 : d.match(/<td[^>]*radio-button-v2[^>]*>/gi)) ?? []).map((p) => {
113
+ var x;
114
+ const W = (((x = p.match(/class="([^"]*)"/)) == null ? void 0 : x[1]) ?? "").split(/\s+/).filter(Boolean);
115
+ return { classes: W, hasBlock: W.includes("radio-button-block"), tag: p };
116
+ });
117
+ console.debug("guido:pre-migrate radio-tds", u(l));
118
+ let s = {
119
+ html: l && await K(l, n),
120
+ css: L
109
121
  };
110
- r.html || (r = await O(), r.html = await x(r.html, a)), A(r.html) && (r.html = await P(r.html)), await M(r), p.selectedDynamicContentList = y;
111
- } catch (a) {
112
- console.error("Failed to initialize Stripo editor:", a);
122
+ console.debug("guido:post-migrate radio-tds", u(s.html)), s.html || (s = await O(), s.html = await K(s.html, n)), N(s.html) && (s.html = await P(s.html)), await M(s), b.selectedDynamicContentList = S;
123
+ } catch (n) {
124
+ console.error("Failed to initialize Stripo editor:", n);
113
125
  }
114
- document.addEventListener("dynamic-content:open", S);
115
- }), Y(() => {
116
- c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", S);
126
+ document.addEventListener("dynamic-content:open", w);
127
+ }), ne(() => {
128
+ i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", w);
117
129
  try {
118
130
  window.UIEditor.removeEditor();
119
131
  } catch {
120
132
  console.debug("Failed to remove Stripo editor: No editor found");
121
133
  }
122
- i.reset();
123
- }), z({
134
+ m.reset();
135
+ }), j({
124
136
  dynamicContent: {
125
- insert: B,
126
- close: N
137
+ insert: R,
138
+ close: I
127
139
  },
128
- hasChanges: m,
129
- saveSilent: D
130
- }), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: w, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: E, props: g, configStore: i, editorStore: f, previewStore: V, hasChanges: m, isTestPartner: $, saveSilent: D, templateId: v, userId: C, partnerName: T, username: k, templateConfig: o, editorConfig: s, html: d, css: F, preselectedDynamicContentList: y, savedModulesFolderName: L, defaultModulesFolderName: U, emit: n, metadata: h, options: _, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: A, noHeader: j, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: S, ribbonObserver: c, updateRibbonOffset: b, AutoSaveController: ce, Toaster: ae, FilterSelectionDrawer: ie, HeaderWrapper: me, LoadingWrapper: de, SaveAsTemplateDrawer: le, UnsubscribeWrapper: ue };
140
+ hasChanges: f,
141
+ saveSilent: T
142
+ }), { __sfc: !0, PreviewContainer: J, OnboardingWrapper: Q, headerWrapperRef: C, wrapperRef: v, dynamicContentStore: b, unsubscribeStore: k, props: D, configStore: m, editorStore: g, previewStore: X, hasChanges: f, isTestPartner: Y, saveSilent: T, templateId: y, userId: A, partnerName: B, username: F, templateConfig: o, editorConfig: c, html: l, css: L, preselectedDynamicContentList: S, savedModulesFolderName: U, defaultModulesFolderName: _, emit: r, metadata: h, options: H, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: N, noHeader: Z, insertDynamicContent: R, closeDynamicContent: I, handleDynamicContentOpen: w, ribbonObserver: i, updateRibbonOffset: E, AutoSaveController: le, Toaster: ue, FilterSelectionDrawer: pe, HeaderWrapper: fe, LoadingWrapper: ve, SaveAsTemplateDrawer: be, UnsubscribeWrapper: ge };
131
143
  }
132
144
  });
133
145
  export {
134
- He as default
146
+ je as default
135
147
  };
@@ -1,26 +1,24 @@
1
- import r from "./FilterItem.vue2.js";
1
+ import l from "./FilterItem.vue2.js";
2
2
  /* empty css */
3
- import l from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var i = function() {
3
+ import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var r = function() {
5
5
  var a = this, e = a._self._c, t = a._self._setupProxy;
6
6
  return e("div", { staticClass: "d-f f-d-c w-1 gap-16", attrs: { "data-filter-group": a.filter.filterGroup, "data-filter-number": a.filter.filterNumber } }, [e("div", { staticClass: "d-f a-i-c j-c-s-b pt-4", class: { "bor-t-s-s bor-t-w-1 bor-t-c-50": a.index === 0 } }, [e("p", [a._v(" " + a._s(t.trans("newsletter.filter")) + " " + a._s(a.index + 1) + " ")]), e(t.InButtonV2, { attrs: { id: "guido__delete-filter-group-button", "left-icon": "line-delete", styling: "text", type: "danger", "label-text-status": !1 }, on: { click: function(s) {
7
7
  return t.emit("delete-filter", t.props.filter);
8
- } } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, state: t.getFieldState("attribute"), value: [t.selectedAttributeType] }, on: { select: t.handleAttributeChange } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [t.isBooleanAttribute ? e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.booleanValueOptions, state: t.getFieldState("value"), value: [t.selectedBooleanValue] }, on: { select: t.handleBooleanValueChange } }) : [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), state: t.getFieldState("operator"), value: [t.selectedOperatorType] }, on: { select: function(s) {
9
- return t.updateFilter({ text: "operator", value: s.value });
10
- } } }), e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: "filter-item-input--value", name: "imageUrl", "character-counter-status": !1, "label-text": t.trans("condition.value"), "max-character-length": 25, "placeholder-text": t.trans("condition.enter-value-placeholder"), "state-message": t.valueErrorMessage, states: t.getFieldState("value"), "tooltip-status": !1, type: t.valueInputType, value: decodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
8
+ } } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, state: t.getFieldState("attribute"), value: [t.selectedAttributeType] }, on: { select: t.handleAttributeChange } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [t.isBooleanAttribute ? e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.booleanValueOptions, state: t.getFieldState("value"), value: [t.selectedBooleanValue] }, on: { select: t.handleBooleanValueChange } }) : [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), state: t.getFieldState("operator"), value: [t.selectedOperatorType] }, on: { select: t.handleOperatorChange } }), t.isAnyOfOperator ? e(t.InTags, { staticClass: "w-2", attrs: { "allow-bulk-paste": "", validate: "text", "allow-duplicates": !1, invalid: t.invalidFields.has("value"), "invalid-message": t.valueErrorMessage, label: t.trans("condition.value"), placeholder: t.trans("condition.enter-value-placeholder"), value: t.tagValues }, on: { input: t.onTagsInput } }) : t.isDateAttribute ? e(t.InDatePickerV2, { staticClass: "w-2", attrs: { id: `filter-item-input--value-${a.index}`, "single-date-picker-status": "", "label-text": t.trans("condition.value"), locale: t.datePickerLocale, name: `filter-item-input--value-${a.index}`, "placeholder-text": t.trans("condition.enter-value-placeholder"), state: t.getFieldState("value"), "state-message": t.valueErrorMessage, value: t.datePickerValue }, on: { apply: t.onDatePickerApply } }) : e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: `filter-item-input--value-${a.index}`, name: "imageUrl", "character-counter-status": !1, "label-text": t.trans("condition.value"), "max-character-length": 25, "placeholder-text": t.trans("condition.enter-value-placeholder"), "state-message": t.valueErrorMessage, states: t.getFieldState("value"), "tooltip-status": !1, type: t.valueInputType, value: t.safeDecodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
11
9
  t.updateFilter({ text: "value", value: encodeURIComponent(s) });
12
10
  } } })]], 2), t.props.hasLogicAdapter ? e("div", { staticClass: "w-1 d-f a-i-c j-c-c p-r bor-b-s-s bor-b-w-1 bor-b-c-50 mt-4" }, [e(t.LogicAdapter, { staticClass: "p-a", attrs: { logic: t.props.filter.innerGroupOperator }, on: { change: function(s) {
13
11
  return t.updateFilter({ text: "innerGroupOperator", value: s });
14
12
  } } })], 1) : a._e()]);
15
- }, o = [], n = /* @__PURE__ */ l(
13
+ }, n = [], o = /* @__PURE__ */ i(
14
+ l,
16
15
  r,
17
- i,
18
- o,
16
+ n,
19
17
  !1,
20
18
  null,
21
- "3b53a736"
19
+ "8053a037"
22
20
  );
23
- const f = n.exports;
21
+ const f = o.exports;
24
22
  export {
25
23
  f as default
26
24
  };
@@ -1,12 +1,14 @@
1
- import { defineComponent as _, computed as l } from "vue";
2
- import { useTranslations as C } from "../../../../composables/useTranslations.js";
3
- import { getOperatorOptions as p } from "../../../../enums/extensions/recommendationBlock.js";
4
- import { useRecommendationExtensionStore as V } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import { getInvalidFilterFields as A } from "../../../../extensions/Blocks/Recommendation/validation/filterSchema.js";
6
- import { InButtonV2 as L, InSelect as O, InBasicTextInput as S } from "@useinsider/design-system-vue";
7
- import E from "./LogicAdapter.vue.js";
8
- import { useDebounceFn as N } from "../../../../node_modules/@vueuse/shared/index.js";
9
- const K = /* @__PURE__ */ _({
1
+ import { defineComponent as N, computed as r } from "vue";
2
+ import { useTranslations as U } from "../../../../composables/useTranslations.js";
3
+ import { getOperatorOptions as f, OP_ANY_OF as d } from "../../../../enums/extensions/recommendationBlock.js";
4
+ import { useRecommendationExtensionStore as E } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ import { parseTagList as j, safeDecodeURIComponent as g } from "../../../../extensions/Blocks/Recommendation/utils/filterUtil.js";
6
+ import { getInvalidFilterFields as w } from "../../../../extensions/Blocks/Recommendation/validation/filterSchema.js";
7
+ import { locale as M } from "../../../../utils/dateUtil.js";
8
+ import { InTags as Y, InButtonV2 as q, InSelect as z, InDatePickerV2 as G, InBasicTextInput as H } from "@useinsider/design-system-vue";
9
+ import J from "./LogicAdapter.vue.js";
10
+ import { useDebounceFn as K } from "../../../../node_modules/@vueuse/shared/index.js";
11
+ const se = /* @__PURE__ */ N({
10
12
  __name: "FilterItem",
11
13
  props: {
12
14
  filter: null,
@@ -15,55 +17,88 @@ const K = /* @__PURE__ */ _({
15
17
  submitted: { type: Boolean }
16
18
  },
17
19
  emits: ["delete-filter"],
18
- setup(f, { emit: v }) {
19
- const t = f, n = C(), a = V(), y = [
20
+ setup(I, { emit: O }) {
21
+ const t = I, s = U(), n = E(), T = [
20
22
  {
21
- text: n("email-editor.standard-filter"),
23
+ text: s("email-editor.standard-filter"),
22
24
  value: "standardFilter"
23
25
  }
24
- ], i = [
26
+ ], u = [
25
27
  { text: "True", value: "true" },
26
28
  { text: "False", value: "false" }
27
- ], d = l(() => t.filter.attribute || ""), r = l(() => a.getFilterList.find((e) => e.value === d.value) || { text: "", value: "", type: "" }), F = l(
29
+ ], m = r(() => t.filter.attribute || ""), i = r(() => n.getFilterList.find((e) => e.value === m.value) || { text: "", value: "", type: "" }), h = r(
28
30
  () => {
29
31
  var e;
30
- return ((e = r.value) == null ? void 0 : e.type) === "Boolean";
32
+ return ((e = i.value) == null ? void 0 : e.type) === "Boolean";
31
33
  }
32
- ), b = l(() => {
34
+ ), b = r(() => {
33
35
  var e;
34
- return p((e = r.value) == null ? void 0 : e.type).find((o) => o.value === t.filter.operator);
35
- }), g = l(
36
- () => i.find((e) => e.value === t.filter.value) || i[0]
37
- ), u = l(() => t.submitted ? A(t.filter) : /* @__PURE__ */ new Set()), h = (e) => u.value.has(e) ? "error" : "default", B = l(
38
- () => u.value.has("value") ? n("action-builder.filter-empty-value-error") : ""
39
- ), c = l(
36
+ return f((e = i.value) == null ? void 0 : e.type).find((o) => o.value === t.filter.operator);
37
+ }), A = r(
38
+ () => u.find((e) => e.value === t.filter.value) || u[0]
39
+ ), p = r(() => t.submitted ? w(t.filter) : /* @__PURE__ */ new Set()), x = (e) => p.value.has(e) ? "error" : "default", B = r(
40
+ () => p.value.has("value") ? s("action-builder.filter-empty-value-error") : ""
41
+ ), v = r(
40
42
  () => {
41
43
  var e;
42
- return ((e = r.value) == null ? void 0 : e.type) === "Number";
44
+ return ((e = i.value) == null ? void 0 : e.type) === "Number";
43
45
  }
44
- ), x = l(() => c.value ? "number" : "text"), T = N((e) => {
45
- a.updateFilter({
46
+ ), D = r(() => v.value ? "number" : "text"), C = r(
47
+ () => {
48
+ var e;
49
+ return ((e = i.value) == null ? void 0 : e.type) === "Date";
50
+ }
51
+ ), _ = r(() => t.filter.operator === d), k = r(() => j(t.filter.value)), P = K((e) => {
52
+ n.updateFilter({
46
53
  ...t.filter,
47
54
  [e.text]: e.value
48
55
  });
49
- }, 500);
50
- return { __sfc: !0, trans: n, store: a, props: t, filterTypeOptions: y, booleanValueOptions: i, attributeType: d, selectedAttributeType: r, isBooleanAttribute: F, selectedOperatorType: b, selectedBooleanValue: g, emit: v, invalidFields: u, getFieldState: h, valueErrorMessage: B, isNumericAttribute: c, valueInputType: x, updateFilter: T, handleAttributeChange: (e) => {
51
- const o = a.getFilterList.find((I) => I.value === e.value), m = (o == null ? void 0 : o.type) === "Boolean", [s] = p(o == null ? void 0 : o.type);
52
- a.updateFilter({
56
+ }, 500), V = (e) => {
57
+ const o = n.getFilterList.find((c) => c.value === e.value), l = (o == null ? void 0 : o.type) === "Boolean", [a] = f(o == null ? void 0 : o.type);
58
+ n.updateFilter({
53
59
  ...t.filter,
54
60
  attribute: e.value,
55
- operator: m ? "=" : (s == null ? void 0 : s.value) ?? "",
56
- value: m ? "true" : ""
61
+ operator: l ? "=" : (a == null ? void 0 : a.value) ?? "",
62
+ value: l ? "true" : ""
57
63
  });
58
- }, handleBooleanValueChange: (e) => {
59
- a.updateFilter({
64
+ }, L = (e) => {
65
+ n.updateFilter({
60
66
  ...t.filter,
61
67
  operator: "=",
62
68
  value: e.value
63
69
  });
64
- }, getOperatorOptions: p, InBasicTextInput: S, InSelect: O, InButtonV2: L, LogicAdapter: E };
70
+ }, S = (e) => {
71
+ const o = e.value;
72
+ if (o === t.filter.operator)
73
+ return;
74
+ const c = t.filter.operator === d !== (o === d);
75
+ n.updateFilter({
76
+ ...t.filter,
77
+ operator: o,
78
+ value: c ? "" : t.filter.value
79
+ });
80
+ }, $ = M(), y = (e) => {
81
+ const [o, l, a] = e.split("-");
82
+ return !o || !l || !a ? "" : `${l}/${a}/${o}`;
83
+ }, F = (e) => {
84
+ const [o, l, a] = e.split("/");
85
+ return !a || !o || !l ? "" : `${a}-${o.padStart(2, "0")}-${l.padStart(2, "0")}`;
86
+ }, R = r(
87
+ () => y(g(t.filter.value))
88
+ );
89
+ return { __sfc: !0, trans: s, store: n, props: t, filterTypeOptions: T, booleanValueOptions: u, attributeType: m, selectedAttributeType: i, isBooleanAttribute: h, selectedOperatorType: b, selectedBooleanValue: A, emit: O, invalidFields: p, getFieldState: x, valueErrorMessage: B, isNumericAttribute: v, valueInputType: D, isDateAttribute: C, isAnyOfOperator: _, tagValues: k, updateFilter: P, handleAttributeChange: V, handleBooleanValueChange: L, handleOperatorChange: S, datePickerLocale: $, isoToPickerDate: y, pickerDateToIso: F, datePickerValue: R, onDatePickerApply: (e) => {
90
+ n.updateFilter({
91
+ ...t.filter,
92
+ value: encodeURIComponent(F(e))
93
+ });
94
+ }, onTagsInput: (e) => {
95
+ n.updateFilter({
96
+ ...t.filter,
97
+ value: e.map(encodeURIComponent).join(",")
98
+ });
99
+ }, getOperatorOptions: f, safeDecodeURIComponent: g, InBasicTextInput: H, InDatePickerV2: G, InSelect: z, InButtonV2: q, InTags: Y, LogicAdapter: J };
65
100
  }
66
101
  });
67
102
  export {
68
- K as default
103
+ se as default
69
104
  };
@@ -2,7 +2,7 @@ import r from "./MiddleSlot.vue2.js";
2
2
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var t = function() {
4
4
  var o = this, e = o._self._c, i = o._self._setupProxy;
5
- return e("div", { staticClass: "d-f a-i-c" }, [i.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(i.VersionHistory), e(i.VersionHistoryViewOptions)], 1) : i.editorStore.isPreviewModeOpen ? e("div", { staticClass: "d-f" }, [e(i.EmailSizeIndicator), e(i.AmpToggle)], 1) : o._e(), e(i.EditorToolbar, { directives: [{ name: "show", rawName: "v-show", value: i.editorStore.isEditorToolbarVisible, expression: "editorStore.isEditorToolbarVisible" }] }), e(i.AiStatusPill)], 1);
5
+ return e("div", { staticClass: "d-f a-i-c" }, [i.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(i.VersionHistory), e(i.VersionHistoryViewOptions)], 1) : i.editorStore.isPreviewModeOpen ? e("div", { staticClass: "d-f" }, [e(i.EmailSizeIndicator), e(i.AmpToggle)], 1) : o._e(), e(i.EditorToolbar, { directives: [{ name: "show", rawName: "v-show", value: i.editorStore.isEditorToolbarVisible, expression: "editorStore.isEditorToolbarVisible" }] })], 1);
6
6
  }, a = [], n = /* @__PURE__ */ s(
7
7
  r,
8
8
  t,
@@ -2,16 +2,15 @@ import { defineComponent as o } from "vue";
2
2
  import r from "../email-preview/amp/AmpToggle.vue.js";
3
3
  import t from "../email-preview/desktop-preview/EmailSizeIndicator.vue.js";
4
4
  import { useEditorStore as i } from "../../../stores/editor.js";
5
- import e from "./AiStatusPill.vue.js";
6
- import m from "./EditorToolbar.vue.js";
7
- import p from "./version-history/VersionHistory.vue.js";
8
- import s from "./version-history/ViewOptions.vue.js";
9
- const V = /* @__PURE__ */ o({
5
+ import e from "./EditorToolbar.vue.js";
6
+ import m from "./version-history/VersionHistory.vue.js";
7
+ import p from "./version-history/ViewOptions.vue.js";
8
+ const S = /* @__PURE__ */ o({
10
9
  __name: "MiddleSlot",
11
- setup(f) {
12
- return { __sfc: !0, editorStore: i(), AmpToggle: r, EmailSizeIndicator: t, AiStatusPill: e, EditorToolbar: m, VersionHistory: p, VersionHistoryViewOptions: s };
10
+ setup(s) {
11
+ return { __sfc: !0, editorStore: i(), AmpToggle: r, EmailSizeIndicator: t, EditorToolbar: e, VersionHistory: m, VersionHistoryViewOptions: p };
13
12
  }
14
13
  });
15
14
  export {
16
- V as default
15
+ S as default
17
16
  };
@@ -1,11 +1,10 @@
1
- import { useEmailTemplateApplier as _, resetEmailTemplateApplier as k } from "./useEmailTemplateApplier.js";
2
- import { useToaster as g } from "./useToaster.js";
1
+ import { useEmailTemplateApplier as m, resetEmailTemplateApplier as w } from "./useEmailTemplateApplier.js";
2
+ import { useToaster as _ } from "./useToaster.js";
3
3
  import { useTranslations as I } from "./useTranslations.js";
4
- import { ToasterTypeOptions as T } from "../enums/toaster.js";
5
- import { useAiStatusStore as P } from "../stores/ai-status.js";
6
- import { getActivePinia as W } from "pinia";
4
+ import { ToasterTypeOptions as S } from "../enums/toaster.js";
5
+ import { getActivePinia as v } from "pinia";
7
6
  import { watch as B, onUnmounted as D } from "vue";
8
- const v = "email_template", x = "chat", L = "guido:debug:ai", M = () => {
7
+ const P = "email_template", x = "chat", L = "guido:debug:ai", M = () => {
9
8
  if (typeof window > "u")
10
9
  return !1;
11
10
  try {
@@ -13,68 +12,44 @@ const v = "email_template", x = "chat", L = "guido:debug:ai", M = () => {
13
12
  } catch {
14
13
  return !1;
15
14
  }
16
- }, F = () => {
17
- const u = W();
18
- if (!u)
15
+ }, O = () => {
16
+ const a = v();
17
+ if (!a)
19
18
  return;
20
- const c = u._s, p = c == null ? void 0 : c.get(x);
19
+ const l = a._s, p = l == null ? void 0 : l.get(x);
21
20
  if (!p)
22
21
  return;
23
- const { applyTemplate: E, applyTemplateDebounced: A } = _(), i = P(), { showToaster: f } = g(), y = I(), d = (t, r) => {
24
- const e = y(t);
25
- return e === t ? r : e;
26
- }, l = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), h = M(), b = (t, r) => {
27
- h && console.debug(`[guido:cortex] msg=${t ?? "?"} type=${(r == null ? void 0 : r.type) ?? "?"}`, r);
28
- }, m = (t) => {
29
- if (t.blueprintType !== v)
22
+ const { applyTemplate: d, applyTemplateDebounced: f } = m(), { showToaster: T } = _(), h = I(), A = (e, t) => {
23
+ const r = h(e);
24
+ return r === e ? t : r;
25
+ }, i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), u = M(), E = (e, t) => {
26
+ u && console.debug(`[guido:cortex] msg=${e ?? "?"} type=${(t == null ? void 0 : t.type) ?? "?"}`, t);
27
+ }, y = (e) => {
28
+ if (e.blueprintType !== P)
30
29
  return;
31
- const r = t.blueprintId, e = t.blueprintData;
32
- if (!r || !(e != null && e.html))
30
+ const t = e.blueprintId, r = e.blueprintData;
31
+ if (!t || !(r != null && r.html))
33
32
  return;
34
- const n = l.get(r);
35
- n === void 0 ? (l.set(r, e.html), E(r, e)) : n !== e.html && (l.set(r, e.html), A(r, e));
36
- }, S = (t) => {
37
- const r = t.toolCallId ?? "?", e = t.isRunning ? "run" : "done", n = t.error ? "err" : "ok", o = `tool:${r}:${e}:${n}`;
38
- if (!s.has(o)) {
39
- if (s.add(o), t.error === !0) {
40
- i.$patch({ isWorking: !1, currentTool: "", lastError: "tool_error" });
41
- return;
42
- }
43
- t.isRunning === !0 ? i.$patch({
44
- isWorking: !0,
45
- currentTool: t.name ?? "",
46
- lastError: ""
47
- }) : i.$patch({ isWorking: !1, currentTool: "" });
48
- }
49
- }, w = (t, r) => {
50
- r && a.has(r) || (r && a.add(r), i.$patch({ isWorking: !1, currentTool: "", lastError: t.content ?? "error" }), f({
51
- type: T.Alert,
52
- message: d("newsletter.ai-template-failed", "AI couldn't generate the template. Please try again.")
53
- }));
54
- }, $ = B(
33
+ const o = i.get(t);
34
+ o === void 0 ? (i.set(t, r.html), d(t, r)) : o !== r.html && (i.set(t, r.html), f(t, r));
35
+ }, s = (e) => e === void 0 || c.has(e) ? !1 : (c.add(e), T({
36
+ type: S.Alert,
37
+ message: A("newsletter.ai-template-failed", "AI couldn't generate the template. Please try again.")
38
+ }), !0), b = B(
55
39
  () => p.messages,
56
- (t) => {
57
- Array.isArray(t) && t.forEach((r) => {
58
- const e = r == null ? void 0 : r.id;
59
- (r == null ? void 0 : r.isError) === !0 && e && !a.has(e) && (a.add(e), i.$patch({ isWorking: !1, currentTool: "", lastError: "message_error" }), f({
60
- type: T.Alert,
61
- message: d(
62
- "newsletter.ai-template-failed",
63
- "AI couldn't generate the template. Please try again."
64
- )
65
- }), h && console.debug(`[guido:cortex] message-level error id=${e}`, r));
66
- const n = r == null ? void 0 : r.segments;
67
- Array.isArray(n) && n.forEach((o) => {
68
- if (o)
69
- switch (b(e, o), o.type) {
40
+ (e) => {
41
+ Array.isArray(e) && e.forEach((t) => {
42
+ const r = t == null ? void 0 : t.id;
43
+ (t == null ? void 0 : t.isError) === !0 && s(r) && u && console.debug(`[guido:cortex] message-level error id=${r}`, t);
44
+ const o = t == null ? void 0 : t.segments;
45
+ Array.isArray(o) && o.forEach((n) => {
46
+ if (n)
47
+ switch (E(r, n), n.type) {
70
48
  case "blueprint":
71
- m(o);
72
- break;
73
- case "tool":
74
- S(o);
49
+ y(n);
75
50
  break;
76
51
  case "error":
77
- w(o, e);
52
+ s(r);
78
53
  break;
79
54
  }
80
55
  });
@@ -83,9 +58,9 @@ const v = "email_template", x = "chat", L = "guido:debug:ai", M = () => {
83
58
  { deep: !0, immediate: !0 }
84
59
  );
85
60
  D(() => {
86
- $(), l.clear(), s.clear(), a.clear(), i.$patch({ isWorking: !1, currentTool: "", lastError: "" }), k();
61
+ b(), i.clear(), c.clear(), w();
87
62
  });
88
63
  };
89
64
  export {
90
- F as useCortexBlueprintBridge
65
+ O as useCortexBlueprintBridge
91
66
  };