@useinsider/guido 3.18.0-beta.41e529d → 3.18.0-beta.599df29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/config/schemas.js +1 -3
- package/dist/components/Guido.vue.js +2 -2
- package/dist/components/Guido.vue2.js +87 -85
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +7 -7
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +57 -82
- package/dist/components/organisms/header/EditorActions.vue.js +1 -1
- package/dist/components/organisms/header/EditorActions.vue2.js +54 -41
- package/dist/composables/useActionsApi.js +82 -67
- package/dist/composables/useAutoSave.js +31 -26
- package/dist/composables/useCustomInterfaceAppearance.js +42 -46
- package/dist/composables/useEditorLock.js +20 -0
- package/dist/composables/useGuidoStateBridge.js +37 -31
- package/dist/composables/useSave.js +42 -39
- package/dist/enums/extensions/recommendationBlock.js +1 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +69 -70
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +31 -66
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +49 -90
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +52 -61
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useEditorLock.d.ts +10 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -54
- package/dist/src/services/recommendationApi.d.ts +1 -2
- package/dist/src/stores/config.d.ts +0 -160
- package/dist/static/styles/components/recommendation-strategy.css.js +5 -70
- package/dist/stores/config.js +59 -66
- package/package.json +1 -1
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +0 -18
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +0 -25
- package/dist/composables/useLegacyStrategyConversion.js +0 -52
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +0 -58
- package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +0 -2
- package/dist/src/composables/useLegacyStrategyConversion.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +0 -39
- package/dist/static/assets/icons/filled-arrow-rising.svg.js +0 -5
- package/dist/static/assets/icons/line-info.svg.js +0 -5
|
@@ -24,9 +24,7 @@ const p = {
|
|
|
24
24
|
b(1, "userId is required")
|
|
25
25
|
),
|
|
26
26
|
/** Optional variation ID for A/B testing */
|
|
27
|
-
variationId: e(t())
|
|
28
|
-
/** Optional numeric campaign ID of the host campaign; absent for templates and modules */
|
|
29
|
-
campaignId: e(t())
|
|
27
|
+
variationId: e(t())
|
|
30
28
|
}), L = a({
|
|
31
29
|
/** Fallback font name (e.g., "Georgia") */
|
|
32
30
|
name: t(),
|
|
@@ -3,7 +3,7 @@ import o from "./Guido.vue2.js";
|
|
|
3
3
|
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
5
|
var a = this, r = a._self._c, e = a._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) : a._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), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(),
|
|
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) : a._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), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
9
|
}, s = [], n = /* @__PURE__ */ i(
|
|
@@ -12,7 +12,7 @@ var t = function() {
|
|
|
12
12
|
s,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"050dfa52"
|
|
16
16
|
);
|
|
17
17
|
const f = n.exports;
|
|
18
18
|
export {
|
|
@@ -1,56 +1,55 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
|
|
1
|
+
import { defineComponent as ne, defineAsyncComponent as l, ref as O, computed as u, watch as P, onMounted as re, onUnmounted as se } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as ae } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { useEditorLock as ie } from "../composables/useEditorLock.js";
|
|
4
|
+
import { provideGuidoActions as ce } from "../composables/useGuidoActions.js";
|
|
5
|
+
import { useGuidoStateBridge as de } from "../composables/useGuidoStateBridge.js";
|
|
6
|
+
import { usePartner as me } from "../composables/usePartner.js";
|
|
7
|
+
import { useStripo as le } from "../composables/useStripo.js";
|
|
8
|
+
import { useTimerClone as ue } from "../composables/useTimerClone.js";
|
|
9
|
+
import { migrate as x } from "../config/migrator/index.js";
|
|
10
|
+
import { ModuleFolderDefaults as W } from "../enums/defaults.js";
|
|
11
|
+
import { RIBBON_SELECTOR as pe } from "../enums/onboarding.js";
|
|
12
|
+
import { useRecommendationExtensionStore as G } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
13
|
+
import fe from "./organisms/AutoSaveController.vue.js";
|
|
14
|
+
import ye from "./organisms/base/Toaster.vue.js";
|
|
15
|
+
import ge from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
16
|
+
import ve from "./organisms/header/HeaderWrapper.vue.js";
|
|
17
|
+
import Se from "./organisms/LoadingWrapper.vue.js";
|
|
18
|
+
import be from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
19
|
+
import he from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
20
|
+
import { useStripoApi as Ee } from "../services/stripoApi.js";
|
|
21
|
+
import { useConfigStore as we } from "../stores/config.js";
|
|
22
|
+
import { useDynamicContentStore as Ce } from "../stores/dynamic-content.js";
|
|
23
|
+
import { useEditorStore as H } from "../stores/editor.js";
|
|
24
|
+
import { usePreviewStore as De } from "../stores/preview.js";
|
|
25
|
+
import { useTemplateStore as ke } from "../stores/template.js";
|
|
26
|
+
import { useUnsubscribeStore as Te } from "../stores/unsubscribe.js";
|
|
27
|
+
import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
|
|
28
|
+
const et = /* @__PURE__ */ ne({
|
|
28
29
|
__name: "Guido",
|
|
29
30
|
props: {
|
|
30
31
|
config: null,
|
|
31
32
|
ready: { type: Boolean, default: !0 }
|
|
32
33
|
},
|
|
33
34
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
34
|
-
setup(
|
|
35
|
-
const a =
|
|
35
|
+
setup(z, { expose: q, emit: r }) {
|
|
36
|
+
const a = z, K = l(
|
|
36
37
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
37
|
-
),
|
|
38
|
+
), V = l(
|
|
38
39
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
39
|
-
),
|
|
40
|
+
), j = l(
|
|
40
41
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
41
|
-
),
|
|
42
|
+
), J = l(
|
|
42
43
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
43
|
-
),
|
|
44
|
-
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
45
|
-
), h = U(), p = U(), f = he(), b = we(), o = Se();
|
|
44
|
+
), h = O(), p = O(), f = Ce(), E = Te(), o = we();
|
|
46
45
|
a.ready && o.init(a.config);
|
|
47
|
-
const c =
|
|
46
|
+
const c = H(), Q = De(), m = u(() => c.hasChanges), { isTestPartner: X } = me(), w = () => {
|
|
48
47
|
var t;
|
|
49
48
|
return (t = h.value) == null ? void 0 : t.handleSave(!0);
|
|
50
|
-
},
|
|
49
|
+
}, C = (t) => {
|
|
51
50
|
c.loadingStatus = t;
|
|
52
51
|
};
|
|
53
|
-
|
|
52
|
+
ae(), de();
|
|
54
53
|
const y = () => {
|
|
55
54
|
var t, e;
|
|
56
55
|
return {
|
|
@@ -58,16 +57,18 @@ const Je = /* @__PURE__ */ ee({
|
|
|
58
57
|
userId: o.userId,
|
|
59
58
|
username: o.username,
|
|
60
59
|
partnerName: o.partnerName,
|
|
61
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
62
|
-
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
60
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || W.SAVED_MODULES,
|
|
61
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || W.DEFAULT_MODULES
|
|
63
62
|
};
|
|
64
|
-
}, { initPlugin:
|
|
63
|
+
}, { initPlugin: D, preloadRuntime: k } = le(), { runExclusive: T, beginMount: F, isCurrentMount: I } = ie();
|
|
64
|
+
let g = 0;
|
|
65
|
+
const { getDefaultTemplate: M } = Ee(), { cloneTimersOnSave: R, hasTimerBlocks: L } = ue(), Y = u(() => {
|
|
65
66
|
var t;
|
|
66
67
|
return !((t = o.ui) != null && t.showHeader);
|
|
67
|
-
}),
|
|
68
|
-
() => !!
|
|
68
|
+
}), Z = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ee = u(
|
|
69
|
+
() => !!G().recommendationConfigs.strategyId
|
|
69
70
|
);
|
|
70
|
-
|
|
71
|
+
ce({
|
|
71
72
|
onBack: () => {
|
|
72
73
|
console.debug("guido:back"), r("back");
|
|
73
74
|
},
|
|
@@ -82,79 +83,80 @@ const Je = /* @__PURE__ */ ee({
|
|
|
82
83
|
console.debug("guido:test-email:click"), r("test-email:click");
|
|
83
84
|
}
|
|
84
85
|
});
|
|
85
|
-
const
|
|
86
|
+
const B = (t) => {
|
|
86
87
|
console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
87
|
-
},
|
|
88
|
+
}, A = () => {
|
|
88
89
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
89
90
|
};
|
|
90
|
-
|
|
91
|
-
r("on-change",
|
|
91
|
+
P(() => m.value, () => {
|
|
92
|
+
r("on-change", m.value);
|
|
92
93
|
});
|
|
93
|
-
const
|
|
94
|
+
const v = (t) => {
|
|
94
95
|
const e = t, { attribute: s, position: d } = e.detail;
|
|
95
96
|
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
|
|
96
97
|
};
|
|
97
98
|
let i = null;
|
|
98
|
-
const
|
|
99
|
+
const S = () => {
|
|
99
100
|
var e;
|
|
100
|
-
const t = document.querySelector(
|
|
101
|
+
const t = document.querySelector(pe);
|
|
101
102
|
(e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
102
|
-
},
|
|
103
|
+
}, b = async () => {
|
|
103
104
|
var t;
|
|
104
105
|
try {
|
|
105
106
|
o.initialized || o.init(a.config), c.templateId = o.templateId;
|
|
106
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "",
|
|
107
|
-
|
|
108
|
-
const
|
|
107
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", U = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
108
|
+
E.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
109
|
+
const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, N = o.isFeatureEnabled("linkTrackingIds");
|
|
109
110
|
let n = {
|
|
110
|
-
html: s && await
|
|
111
|
+
html: s && await x(s, _),
|
|
111
112
|
css: d
|
|
112
113
|
};
|
|
113
|
-
n.html || (n = await
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
preselectedDynamicContentList:
|
|
114
|
+
n.html || (n = await M(), n.html = await x(n.html, _));
|
|
115
|
+
const te = N ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
116
|
+
L(n.html) && (n.html = await R(n.html)), N && (c.trackIdSessionFloor = Math.max(te, $(n.html)));
|
|
117
|
+
const oe = {
|
|
118
|
+
preselectedDynamicContentList: U,
|
|
118
119
|
onReady: () => {
|
|
119
120
|
console.debug("guido:ready"), r("ready");
|
|
120
121
|
}
|
|
121
122
|
};
|
|
122
|
-
await
|
|
123
|
+
g = F(), await D(n, y(), oe), f.selectedDynamicContentList = U;
|
|
123
124
|
} catch (e) {
|
|
124
125
|
console.error("Failed to initialize Stripo editor:", e);
|
|
125
126
|
}
|
|
126
127
|
};
|
|
127
|
-
return
|
|
128
|
+
return re(async () => {
|
|
128
129
|
var e;
|
|
129
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
130
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), G().$reset(), H().$reset(), ke().$reset(), S();
|
|
130
131
|
const t = (e = p.value) == null ? void 0 : e.parentElement;
|
|
131
|
-
if (t && (i = new ResizeObserver(
|
|
132
|
-
await
|
|
132
|
+
if (t && (i = new ResizeObserver(S), i.observe(t)), k(), a.ready)
|
|
133
|
+
await b();
|
|
133
134
|
else {
|
|
134
|
-
const s =
|
|
135
|
-
d && (s(),
|
|
135
|
+
const s = P(() => a.ready, (d) => {
|
|
136
|
+
d && (s(), b());
|
|
136
137
|
});
|
|
137
138
|
}
|
|
138
|
-
document.addEventListener("dynamic-content:open",
|
|
139
|
-
}),
|
|
140
|
-
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open",
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
document.addEventListener("dynamic-content:open", v);
|
|
140
|
+
}), se(() => {
|
|
141
|
+
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), T(async () => {
|
|
142
|
+
if (I(g))
|
|
143
|
+
try {
|
|
144
|
+
window.UIEditor.removeEditor();
|
|
145
|
+
} catch {
|
|
146
|
+
console.debug("Failed to remove Stripo editor: No editor found");
|
|
147
|
+
}
|
|
148
|
+
}), o.reset();
|
|
149
|
+
}), q({
|
|
148
150
|
dynamicContent: {
|
|
149
|
-
insert:
|
|
150
|
-
close:
|
|
151
|
+
insert: B,
|
|
152
|
+
close: A
|
|
151
153
|
},
|
|
152
|
-
hasChanges:
|
|
153
|
-
saveSilent:
|
|
154
|
-
setLoading:
|
|
155
|
-
}), { __sfc: !0, PreviewContainer:
|
|
154
|
+
hasChanges: m,
|
|
155
|
+
saveSilent: w,
|
|
156
|
+
setLoading: C
|
|
157
|
+
}), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, headerWrapperRef: h, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: E, props: a, configStore: o, editorStore: c, previewStore: Q, hasChanges: m, isTestPartner: X, saveSilent: w, setLoading: C, emit: r, buildMetadata: y, initPlugin: D, preloadRuntime: k, runExclusive: T, beginMount: F, isCurrentMount: I, mountGeneration: g, getDefaultTemplate: M, cloneTimersOnSave: R, hasTimerBlocks: L, noHeader: Y, isRrsEnabled: Z, hasAssignedStrategy: ee, insertDynamicContent: B, closeDynamicContent: A, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: S, startEditor: b, AutoSaveController: fe, Toaster: ye, FilterSelectionDrawer: ge, HeaderWrapper: ve, LoadingWrapper: Se, SaveAsTemplateDrawer: be, UnsubscribeWrapper: he };
|
|
156
158
|
}
|
|
157
159
|
});
|
|
158
160
|
export {
|
|
159
|
-
|
|
161
|
+
et as default
|
|
160
162
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import r from "./AssignStrategyDrawer.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
var
|
|
4
|
+
import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
5
|
+
var o = function() {
|
|
6
6
|
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
7
7
|
return t.store.assignStrategyDrawerStatus ? s(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", show: "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
|
|
8
|
-
return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "info-box-position": "bottom right", "create-button-visible": !1, loading: t.store.strategiesLoading
|
|
9
|
-
}, proxy: !0 }], null, !1,
|
|
10
|
-
}, n = [], i = /* @__PURE__ */
|
|
8
|
+
return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "info-box-position": "bottom right", "create-button-visible": !1, loading: t.store.strategiesLoading, "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { select: t.onSelect } })], 1)];
|
|
9
|
+
}, proxy: !0 }], null, !1, 2542767044) }) : e._e();
|
|
10
|
+
}, n = [], i = /* @__PURE__ */ a(
|
|
11
11
|
r,
|
|
12
|
-
|
|
12
|
+
o,
|
|
13
13
|
n,
|
|
14
14
|
!1,
|
|
15
15
|
null,
|
|
16
|
-
"
|
|
16
|
+
"2580a7d9"
|
|
17
17
|
);
|
|
18
18
|
const y = i.exports;
|
|
19
19
|
export {
|
|
@@ -1,73 +1,48 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as v, defineAsyncComponent as y, ref as u, computed as l, watch as O } from "vue";
|
|
2
2
|
import "@useinsider/design-system-organisms/style";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
const st = /* @__PURE__ */ h({
|
|
3
|
+
import { useToaster as x } from "../../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as A } from "../../../../composables/useTranslations.js";
|
|
5
|
+
import { DOTTED_DATE_LOCALE as E } from "../../../../enums/date.js";
|
|
6
|
+
import { URLS as h } from "../../../../enums/extensions/recommendationBlock.js";
|
|
7
|
+
import { ToasterTypeOptions as m } from "../../../../enums/toaster.js";
|
|
8
|
+
import { useRecommendationExtensionStore as C } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import B from "./StrategyInfoBoxContent.vue.js";
|
|
10
|
+
import { formatShortDate as I } from "../../../../utils/dateUtil.js";
|
|
11
|
+
import { asText as f } from "../../../../utils/genericUtil.js";
|
|
12
|
+
import { escapeHtml as N } from "../../../../utils/htmlEscape.js";
|
|
13
|
+
import { InSkeleton as b } from "@useinsider/design-system-vue";
|
|
14
|
+
const W = /* @__PURE__ */ v({
|
|
16
15
|
__name: "AssignStrategyDrawer",
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
render: (
|
|
20
|
-
}),
|
|
21
|
-
loader: async () => (await
|
|
16
|
+
setup(k) {
|
|
17
|
+
const c = () => import("@useinsider/design-system-organisms"), g = (t, r) => ({
|
|
18
|
+
render: (a) => a(b, { props: { sizing: { width: t, height: r } } })
|
|
19
|
+
}), S = y({
|
|
20
|
+
loader: async () => (await c()).OrgStrategyDetailModal,
|
|
22
21
|
loadingComponent: g(480, 240),
|
|
23
22
|
delay: 0
|
|
24
|
-
}),
|
|
25
|
-
loader: async () => (await
|
|
23
|
+
}), T = y({
|
|
24
|
+
loader: async () => (await c()).OrgStrategyDropdown,
|
|
26
25
|
loadingComponent: g(240, 42),
|
|
27
26
|
delay: 0
|
|
28
|
-
}),
|
|
29
|
-
|
|
27
|
+
}), o = A(), e = C(), { showToaster: s } = x(), n = u(null), i = u(!1), _ = l(() => e.assignStrategyDrawerStatus ? o("email-editor.assign-strategy-description", { url: h.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
|
|
28
|
+
O(() => e.assignStrategyDrawerStatus, (t) => {
|
|
30
29
|
if (!t)
|
|
31
30
|
return;
|
|
32
|
-
const { strategyId:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
type:
|
|
36
|
-
message:
|
|
31
|
+
const { strategyId: r } = e.recommendationConfigs;
|
|
32
|
+
n.value = r || null, i.value = !1, e.fetchStrategies().catch(() => {
|
|
33
|
+
s({
|
|
34
|
+
type: m.Error,
|
|
35
|
+
message: o("discovery-strategy.error-description")
|
|
37
36
|
});
|
|
38
37
|
});
|
|
39
38
|
});
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
39
|
+
const p = (t) => {
|
|
40
|
+
const r = f(t.updated_at || t.created_at);
|
|
41
|
+
if (!r)
|
|
43
42
|
return "";
|
|
44
|
-
const
|
|
45
|
-
return
|
|
46
|
-
},
|
|
47
|
-
text: r("ds-steps.legacy-strategy"),
|
|
48
|
-
value: y,
|
|
49
|
-
infoBoxProps: {
|
|
50
|
-
id: "strategy-info-legacy",
|
|
51
|
-
theme: "light",
|
|
52
|
-
variant: "information",
|
|
53
|
-
className: "assign-strategy-info-box",
|
|
54
|
-
titleText: x(r("ds-steps.legacy-strategy")),
|
|
55
|
-
descriptionStatus: !0,
|
|
56
|
-
descriptionText: r("statistics.legacy-strategy-description"),
|
|
57
|
-
buttonOptions: [{
|
|
58
|
-
id: d,
|
|
59
|
-
type: "primary",
|
|
60
|
-
text: r("ds-steps.update"),
|
|
61
|
-
loadingStatus: e.legacyConversionLoading,
|
|
62
|
-
disabledStatus: e.legacyConversionLoading
|
|
63
|
-
}]
|
|
64
|
-
}
|
|
65
|
-
})), E = async (t) => {
|
|
66
|
-
if ((t == null ? void 0 : t.id) !== d)
|
|
67
|
-
return;
|
|
68
|
-
const a = await u();
|
|
69
|
-
a && (o.value = a);
|
|
70
|
-
}, m = s(() => e.strategies.map((t) => ({
|
|
43
|
+
const a = I(r, E);
|
|
44
|
+
return o("recommendation-strategy.last-updated-on", { value: a });
|
|
45
|
+
}, D = l(() => e.strategies.map((t) => ({
|
|
71
46
|
text: t.name,
|
|
72
47
|
value: t.strategy_id,
|
|
73
48
|
infoBoxProps: {
|
|
@@ -75,57 +50,57 @@ const st = /* @__PURE__ */ h({
|
|
|
75
50
|
theme: "light",
|
|
76
51
|
variant: "information",
|
|
77
52
|
className: "assign-strategy-info-box",
|
|
78
|
-
titleText:
|
|
53
|
+
titleText: N(f(t.name)),
|
|
79
54
|
descriptionStatus: !0,
|
|
80
|
-
descriptionText:
|
|
81
|
-
slot:
|
|
55
|
+
descriptionText: p(t),
|
|
56
|
+
slot: B,
|
|
82
57
|
slotProps: { strategy: t }
|
|
83
58
|
}
|
|
84
|
-
}))),
|
|
85
|
-
const t = e.strategies.find((
|
|
59
|
+
}))), d = l(() => {
|
|
60
|
+
const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
|
|
86
61
|
return t ? { ...t, fallback_config: null } : null;
|
|
87
|
-
}),
|
|
62
|
+
}), w = l(() => ({
|
|
88
63
|
primaryButton: {
|
|
89
64
|
styling: "solid",
|
|
90
65
|
type: "primary",
|
|
91
|
-
labelText:
|
|
66
|
+
labelText: o("products.assign-btn")
|
|
92
67
|
},
|
|
93
68
|
cancelOrBackButton: {
|
|
94
69
|
styling: "ghost",
|
|
95
70
|
type: "secondary",
|
|
96
|
-
labelText:
|
|
71
|
+
labelText: o("products.cancel")
|
|
97
72
|
}
|
|
98
73
|
}));
|
|
99
|
-
return { __sfc: !0, loadOrganisms:
|
|
74
|
+
return { __sfc: !0, loadOrganisms: c, skeleton: g, OrgStrategyDetailModal: S, OrgStrategyDropdown: T, trans: o, store: e, showToaster: s, selectedStrategyId: n, showSelectionError: i, drawerDescription: _, lastUpdatedText: p, strategyOptions: D, selectedStrategy: d, footerButtonGroupOptions: w, closeDrawer: () => {
|
|
100
75
|
e.closeAssignStrategyDrawer();
|
|
101
76
|
}, assignStrategy: async () => {
|
|
102
|
-
const t =
|
|
77
|
+
const t = d.value;
|
|
103
78
|
if (!t) {
|
|
104
|
-
|
|
79
|
+
i.value = !0;
|
|
105
80
|
return;
|
|
106
81
|
}
|
|
107
|
-
let
|
|
82
|
+
let r = "";
|
|
108
83
|
try {
|
|
109
|
-
|
|
110
|
-
} catch (
|
|
111
|
-
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed",
|
|
84
|
+
r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
|
|
85
|
+
} catch (a) {
|
|
86
|
+
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", a);
|
|
112
87
|
}
|
|
113
|
-
if (!
|
|
114
|
-
|
|
115
|
-
type:
|
|
116
|
-
message:
|
|
88
|
+
if (!r) {
|
|
89
|
+
s({
|
|
90
|
+
type: m.Error,
|
|
91
|
+
message: o("email-editor.strategy-assign-failed", { strategyName: t.name })
|
|
117
92
|
});
|
|
118
93
|
return;
|
|
119
94
|
}
|
|
120
|
-
e.assignStrategy(t),
|
|
121
|
-
type:
|
|
122
|
-
message:
|
|
95
|
+
e.assignStrategy(t), s({
|
|
96
|
+
type: m.Success,
|
|
97
|
+
message: o("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
123
98
|
}), e.closeAssignStrategyDrawer();
|
|
124
99
|
}, onSelect: (t) => {
|
|
125
|
-
|
|
100
|
+
n.value = t.value, i.value = !1;
|
|
126
101
|
} };
|
|
127
102
|
}
|
|
128
103
|
});
|
|
129
104
|
export {
|
|
130
|
-
|
|
105
|
+
W as default
|
|
131
106
|
};
|