@useinsider/guido 1.0.3-beta.22d624e → 1.0.3-beta.2370dad

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 (123) hide show
  1. package/dist/@types/generic.d.ts +14 -0
  2. package/dist/components/Guido.vue.d.ts +3 -2
  3. package/dist/components/Guido.vue.js +11 -9
  4. package/dist/components/Guido.vue2.js +75 -69
  5. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +19 -0
  6. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +28 -0
  7. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +38 -0
  8. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts +2 -0
  9. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +17 -0
  10. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +37 -0
  11. package/dist/components/organisms/extensions/recommendation/Filters.vue.d.ts +2 -0
  12. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +20 -0
  13. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +44 -0
  14. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +16 -0
  15. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +17 -0
  16. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +27 -0
  17. package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +3 -1
  18. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
  19. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +29 -17
  20. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +3 -1
  21. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -10
  22. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +19 -18
  23. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +2 -0
  24. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +18 -0
  25. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +16 -0
  26. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +2 -0
  27. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +24 -0
  28. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +64 -0
  29. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +2 -0
  30. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +18 -0
  31. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +107 -0
  32. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +2 -0
  33. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +18 -0
  34. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +12 -0
  35. package/dist/components/wrappers/WpDrawer.vue.d.ts +6 -4
  36. package/dist/components/wrappers/WpDrawer.vue.js +6 -4
  37. package/dist/composables/useStripo.js +44 -34
  38. package/dist/config/compiler/unsubscribeCompilerRules.js +42 -29
  39. package/dist/config/migrator/couponBlockMigrator.d.ts +1 -0
  40. package/dist/config/migrator/couponBlockMigrator.js +67 -0
  41. package/dist/config/migrator/index.d.ts +1 -1
  42. package/dist/config/migrator/index.js +7 -5
  43. package/dist/config/migrator/unsubscribeMigrator.d.ts +1 -0
  44. package/dist/config/migrator/unsubscribeMigrator.js +124 -0
  45. package/dist/enums/date.d.ts +13 -0
  46. package/dist/enums/date.js +16 -0
  47. package/dist/enums/defaults.js +4 -0
  48. package/dist/enums/extensions/recommendationBlock.d.ts +16 -0
  49. package/dist/enums/extensions/recommendationBlock.js +80 -0
  50. package/dist/enums/unsubscribe.d.ts +23 -0
  51. package/dist/enums/unsubscribe.js +43 -6
  52. package/dist/extensions/Blocks/Checkbox/control.js +55 -53
  53. package/dist/extensions/Blocks/CouponBlock/block.d.ts +12 -0
  54. package/dist/extensions/Blocks/CouponBlock/block.js +33 -0
  55. package/dist/extensions/Blocks/CouponBlock/extension.d.ts +2 -0
  56. package/dist/extensions/Blocks/CouponBlock/extension.js +8 -0
  57. package/dist/extensions/Blocks/CouponBlock/iconsRegistry.d.ts +4 -0
  58. package/dist/extensions/Blocks/CouponBlock/iconsRegistry.js +33 -0
  59. package/dist/extensions/Blocks/CouponBlock/settingsPanel.d.ts +4 -0
  60. package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +24 -0
  61. package/dist/extensions/Blocks/CouponBlock/template.d.ts +3 -0
  62. package/dist/extensions/Blocks/CouponBlock/template.js +18 -0
  63. package/dist/extensions/Blocks/RadioButton/control.js +44 -42
  64. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  65. package/dist/extensions/Blocks/Recommendation/block.d.ts +10 -0
  66. package/dist/extensions/Blocks/Recommendation/block.js +27 -0
  67. package/dist/extensions/Blocks/Recommendation/control.d.ts +29 -0
  68. package/dist/extensions/Blocks/Recommendation/control.js +277 -0
  69. package/dist/extensions/Blocks/Recommendation/extension.d.ts +2 -0
  70. package/dist/extensions/Blocks/Recommendation/extension.js +10 -0
  71. package/dist/extensions/Blocks/Recommendation/iconsRegistry.d.ts +4 -0
  72. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +51 -0
  73. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +19 -0
  74. package/dist/extensions/Blocks/Recommendation/settingsPanel.d.ts +4 -0
  75. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +32 -0
  76. package/dist/extensions/Blocks/Recommendation/store/recommendation.d.ts +555 -0
  77. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +266 -0
  78. package/dist/extensions/Blocks/Recommendation/template.d.ts +6 -0
  79. package/dist/extensions/Blocks/Recommendation/template.js +200 -0
  80. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +7 -0
  81. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +28 -0
  82. package/dist/extensions/Blocks/Unsubscribe/block.d.ts +32 -0
  83. package/dist/extensions/Blocks/Unsubscribe/block.js +131 -0
  84. package/dist/extensions/Blocks/Unsubscribe/control.d.ts +29 -0
  85. package/dist/extensions/Blocks/Unsubscribe/control.js +167 -0
  86. package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +11 -0
  87. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +42 -0
  88. package/dist/extensions/Blocks/Unsubscribe/extension.d.ts +2 -0
  89. package/dist/extensions/Blocks/Unsubscribe/extension.js +21 -0
  90. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +4 -0
  91. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +21 -0
  92. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +4 -0
  93. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +35 -0
  94. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +42 -0
  95. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +4 -0
  96. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +10 -0
  97. package/dist/extensions/Blocks/Unsubscribe/template.d.ts +12 -0
  98. package/dist/extensions/Blocks/Unsubscribe/template.js +22 -0
  99. package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +9 -0
  100. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +11 -0
  101. package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +7 -0
  102. package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +6 -0
  103. package/dist/extensions/Blocks/common-control.d.ts +66 -0
  104. package/dist/extensions/Blocks/common-control.js +102 -0
  105. package/dist/guido.css +1 -1
  106. package/dist/mock/api/recommendation.d.ts +2 -0
  107. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +83 -71
  108. package/dist/services/recommendationApi.d.ts +6 -0
  109. package/dist/services/recommendationApi.js +43 -0
  110. package/dist/services/unsubscribeApi.d.ts +4 -0
  111. package/dist/services/unsubscribeApi.js +16 -0
  112. package/dist/stores/config.d.ts +97 -0
  113. package/dist/stores/config.js +17 -0
  114. package/dist/stores/editor.d.ts +21 -0
  115. package/dist/stores/editor.js +2 -1
  116. package/dist/stores/unsubscribe.d.ts +253 -5
  117. package/dist/stores/unsubscribe.js +126 -6
  118. package/dist/utils/dateUtil.d.ts +2 -1
  119. package/dist/utils/dateUtil.js +7 -12
  120. package/dist/utils/genericUtil.d.ts +1 -0
  121. package/dist/utils/genericUtil.js +8 -7
  122. package/dist/utils/templatePreparation.js +17 -16
  123. package/package.json +2 -2
@@ -1,30 +1,42 @@
1
- import { defineComponent as s, ref as r } from "vue";
2
- import a from "../../wrappers/WpModal.vue.js";
3
- import { useTranslations as i } from "../../../composables/useTranslations.js";
4
- import l from "../../../static/assets/onboarding-img.svg.js";
5
- import { useOnboardingStore as m } from "../../../stores/onboarding.js";
6
- const w = /* @__PURE__ */ s({
1
+ import { defineComponent as f, ref as g, computed as o } from "vue";
2
+ import b from "../../wrappers/WpModal.vue.js";
3
+ import { useConfig as D } from "../../../composables/useConfig.js";
4
+ import { useTranslations as v } from "../../../composables/useTranslations.js";
5
+ import { DATE_FORMAT_DD_MM_YYYY as _ } from "../../../enums/date.js";
6
+ import h from "../../../static/assets/onboarding-img.svg.js";
7
+ import { useOnboardingStore as y } from "../../../stores/onboarding.js";
8
+ import { isAfterDate as w, formatPatchDate as C } from "../../../utils/dateUtil.js";
9
+ const V = /* @__PURE__ */ f({
7
10
  __name: "NewVersionPopup",
8
- setup(p) {
9
- const n = i(), e = m(), o = r(!0), t = r({
11
+ emits: ["onboarding-finished"],
12
+ setup(M, { emit: a }) {
13
+ const e = v(), t = y(), s = g(!0), { config: p } = D(), i = o(() => p.migrationDate), n = o(() => w(i.value || 0)), u = o(() => C(
14
+ i.value * 1e3,
15
+ _,
16
+ "en-GB"
17
+ )), l = o(() => n.value ? e("email-editor.onboarding-popup-sunsetted-title") : e("email-editor.onboarding-title")), m = o(() => n.value ? e("email-editor.onboarding-popup-sunsetted-description", {
18
+ sunsetDate: u.value
19
+ }) : e("email-editor.onboarding-description")), d = o(() => n.value ? e("products.cancel") : e("products.remind-me-later")), c = o(() => ({
10
20
  primaryButton: {
11
21
  type: "primary",
12
- labelText: n("left-menu.discover-now")
22
+ labelText: e("left-menu.discover-now")
13
23
  },
14
24
  secondaryButton: {
15
25
  type: "subtle-primary",
16
- labelText: n("products.remind-me-later")
26
+ labelText: d.value
17
27
  }
18
- });
19
- return { __sfc: !0, trans: n, onboardingStore: e, isVisible: o, footerButtonOptions: t, handleDiscoverNow: () => {
20
- e.onDiscoverNowClicked(), o.value = !1;
28
+ })), r = () => {
29
+ s.value = !1, a("onboarding-finished");
30
+ };
31
+ return { __sfc: !0, emit: a, trans: e, onboardingStore: t, isVisible: s, config: p, migrationDate: i, isAfterMigrationDate: n, formattedSunsetDate: u, popupTitle: l, popupDescription: m, secondaryButtonLabel: d, footerButtonOptions: c, closePopup: r, handleDiscoverNow: () => {
32
+ t.onDiscoverNowClicked(), r();
21
33
  }, handleRemindLater: () => {
22
- e.onRemindMeLater(), o.value = !1;
34
+ t.onRemindMeLater(), r();
23
35
  }, handleClose: () => {
24
- e.onNewVersionPopupClose(), o.value = !1;
25
- }, WpModal: a, onboardingImageSvg: l };
36
+ t.onNewVersionPopupClose(), r();
37
+ }, WpModal: b, onboardingImageSvg: h };
26
38
  }
27
39
  });
28
40
  export {
29
- w as default
41
+ V as default
30
42
  };
@@ -1,2 +1,4 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
2
+ "onboarding-finished": () => void;
3
+ }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
4
  export default _default;
@@ -1,19 +1,21 @@
1
- import o from "./OnboardingWrapper.vue2.js";
2
- import _ from "../../../_virtual/_plugin-vue2_normalizer.js";
1
+ import t from "./OnboardingWrapper.vue2.js";
2
+ import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var s = function() {
4
- var n = this, e = n._self._c, t = n._self._setupProxy;
5
- return e("div", n._l(t.visibleOnboardings, function(r) {
6
- return e(r.component, { key: r.type, tag: "component" });
4
+ var n = this, e = n._self._c, r = n._self._setupProxy;
5
+ return e("div", n._l(r.visibleOnboardings, function(o) {
6
+ return e(o.component, { key: o.type, tag: "component", on: { "onboarding-finished": function(p) {
7
+ return r.emit("onboarding-finished");
8
+ } } });
7
9
  }), 1);
8
- }, a = [], p = /* @__PURE__ */ _(
9
- o,
10
+ }, _ = [], a = /* @__PURE__ */ i(
11
+ t,
10
12
  s,
11
- a,
13
+ _,
12
14
  !1,
13
15
  null,
14
16
  null
15
17
  );
16
- const m = p.exports;
18
+ const d = a.exports;
17
19
  export {
18
- m as default
20
+ d as default
19
21
  };
@@ -1,24 +1,25 @@
1
- import { defineComponent as g, computed as e, onMounted as b, watch as t } from "vue";
2
- import { usePartner as O } from "../../../composables/usePartner.js";
3
- import { useEditorStore as u } from "../../../stores/editor.js";
4
- import { useOnboardingStore as v } from "../../../stores/onboarding.js";
5
- import { usePreviewStore as l } from "../../../stores/preview.js";
6
- import y from "./AMPOnboarding.vue.js";
7
- import S from "./GenericOnboarding.vue.js";
1
+ import { defineComponent as b, computed as e, onMounted as O, watch as t } from "vue";
2
+ import { usePartner as u } from "../../../composables/usePartner.js";
3
+ import { useEditorStore as v } from "../../../stores/editor.js";
4
+ import { useOnboardingStore as l } from "../../../stores/onboarding.js";
5
+ import { usePreviewStore as y } from "../../../stores/preview.js";
6
+ import S from "./AMPOnboarding.vue.js";
7
+ import h from "./GenericOnboarding.vue.js";
8
8
  import w from "./NewVersionPopup.vue.js";
9
9
  import P from "./TextBlockOnboarding.vue.js";
10
- import h from "./VersionHistoryOnboarding.vue.js";
11
- const E = /* @__PURE__ */ g({
10
+ import _ from "./VersionHistoryOnboarding.vue.js";
11
+ const F = /* @__PURE__ */ b({
12
12
  __name: "OnboardingWrapper",
13
- setup(_) {
14
- const o = v(), r = u(), s = l(), { isTestPartner: a } = O(), p = e(() => r.isStripoInitialized), d = e(() => a()), m = [
13
+ emits: ["onboarding-finished"],
14
+ setup(A, { emit: f }) {
15
+ const o = l(), r = v(), s = y(), { isTestPartner: a } = u(), p = e(() => r.isStripoInitialized), d = e(() => a()), m = [
15
16
  { type: "newVersionPopup", component: w },
16
- { type: "genericOnboarding", component: S },
17
+ { type: "genericOnboarding", component: h },
17
18
  { type: "textBlockOnboarding", component: P },
18
- { type: "versionHistoryOnboarding", component: h },
19
- { type: "ampOnboarding", component: y }
20
- ], c = (n) => d.value || !p.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), f = e(() => m.filter((n) => c(n.type)));
21
- return b(async () => {
19
+ { type: "versionHistoryOnboarding", component: _ },
20
+ { type: "ampOnboarding", component: S }
21
+ ], c = (n) => d.value || !p.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), g = e(() => m.filter((n) => c(n.type)));
22
+ return O(async () => {
22
23
  await o.fetchUserModalState();
23
24
  }), t(
24
25
  () => r.isVersionHistoryOpen,
@@ -35,9 +36,9 @@ const E = /* @__PURE__ */ g({
35
36
  (n) => {
36
37
  !n && o.isActive("ampOnboarding") && o.close("ampOnboarding");
37
38
  }
38
- ), { __sfc: !0, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: p, isTestPartnerActive: d, onboardingConfigs: m, shouldShow: c, visibleOnboardings: f };
39
+ ), { __sfc: !0, emit: f, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: p, isTestPartnerActive: d, onboardingConfigs: m, shouldShow: c, visibleOnboardings: g };
39
40
  }
40
41
  });
41
42
  export {
42
- E as default
43
+ F as default
43
44
  };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import s from "./UnsubscribeBreadcrumb.vue2.js";
2
+ /* empty css */
3
+ import a from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var o = function() {
5
+ var e = this, t = e._self._c, r = e._self._setupProxy;
6
+ return t(r.InBreadcrumb, { staticClass: "c-p", attrs: { "without-router": "", "active-tab": r.unsubscribeStore.activeType, "home-icon": !1, list: r.breadcrumbs, routes: [] }, on: { click: r.navigate } });
7
+ }, c = [], n = /* @__PURE__ */ a(
8
+ s,
9
+ o,
10
+ c,
11
+ !1,
12
+ null,
13
+ "70835920"
14
+ );
15
+ const f = n.exports;
16
+ export {
17
+ f as default
18
+ };
@@ -0,0 +1,16 @@
1
+ import { defineComponent as o, computed as n } from "vue";
2
+ import { TYPE_TRANSLATIONS as s } from "../../../enums/unsubscribe.js";
3
+ import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
4
+ import { InBreadcrumb as m } from "@useinsider/design-system-vue";
5
+ const f = /* @__PURE__ */ o({
6
+ __name: "UnsubscribeBreadcrumb",
7
+ setup(a) {
8
+ const r = c(), t = n(() => r.getSelectedCollection.map((e) => ({ value: e, text: s[e] })));
9
+ return { __sfc: !0, unsubscribeStore: r, breadcrumbs: t, navigate: (e) => {
10
+ r.activeType = e.value;
11
+ }, InBreadcrumb: m };
12
+ }
13
+ });
14
+ export {
15
+ f as default
16
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,24 @@
1
+ import a from "./UnsubscribePageSelection.vue2.js";
2
+ /* empty css */
3
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var o = function() {
5
+ var r = this, e = r._self._c, t = r._self._setupProxy;
6
+ return e(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", size: "large", "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.pageSelectionDrawerStatus, "title-text": t.trans("newsletter.select-a-template") }, on: { cancelOrBackButtonEvent: t.handleBack, onCloseEvent: t.closeModal, primaryButtonEvent: t.handleSave }, scopedSlots: r._u([{ key: "headerBottomSlot", fn: function() {
7
+ return [e(t.UnsubscribeBreadcrumb, { staticClass: "px-5 py-3" })];
8
+ }, proxy: !0 }]) }, [e("div", { staticClass: "d-g templates-wrapper" }, r._l(t.unsubscribeStore.getTemplatesByActiveType, function(s) {
9
+ return e("div", { key: s.id, staticClass: "template-wrapper", on: { click: function(u) {
10
+ return t.selectTemplate(s.id);
11
+ } } }, [e(t.InContainer, { staticClass: "template-container o-h", class: { selected: t.unsubscribeStore.getSelectedTemplateByActiveType === s.id }, attrs: { border: t.getBorderClass(s.id) } }, [e("div", { staticClass: "w-1 h-1 d-f j-c-c a-i-c" }, [e("img", { staticClass: "w-1 h-1 thumbnail o-h", attrs: { alt: s.name, src: s.thumbnail } })])]), e("div", { staticClass: "mt-1 f-s-1" }, [r._v(" " + r._s(s.name) + " ")])], 1);
12
+ }), 0)]);
13
+ }, i = [], c = /* @__PURE__ */ n(
14
+ a,
15
+ o,
16
+ i,
17
+ !1,
18
+ null,
19
+ "a86fc486"
20
+ );
21
+ const _ = c.exports;
22
+ export {
23
+ _ as default
24
+ };
@@ -0,0 +1,64 @@
1
+ import { defineComponent as f, ref as y, computed as n, watch as T } from "vue";
2
+ import g from "../../wrappers/WpDrawer.vue.js";
3
+ import { useToaster as S } from "../../../composables/useToaster.js";
4
+ import { useTranslations as v } from "../../../composables/useTranslations.js";
5
+ import { ToasterTypeOptions as B } from "../../../enums/toaster.js";
6
+ import { useUnsubscribeStore as w } from "../../../stores/unsubscribe.js";
7
+ import { InContainer as C } from "@useinsider/design-system-vue";
8
+ import h from "./UnsubscribeBreadcrumb.vue.js";
9
+ const E = /* @__PURE__ */ f({
10
+ __name: "UnsubscribePageSelection",
11
+ setup(_) {
12
+ const s = v(), e = w(), { showToaster: a } = S(), o = y(!1), c = n(() => e.isActiveTypeLastInCollection ? o.value ? s("unsubscription-preference.applying-changes") : s("statistics.apply") : s("products.select-and-continue")), i = n(() => e.pageSelectionUpdateStatus && e.isActiveTypeFirstInCollection ? s("products.cancel") : s("newsletter.back")), p = n(() => ({
13
+ primaryButton: {
14
+ styling: "solid",
15
+ type: "primary",
16
+ labelText: c.value,
17
+ loadingStatus: o.value,
18
+ disabledStatus: !1
19
+ },
20
+ cancelOrBackButton: {
21
+ styling: "ghost",
22
+ type: "secondary",
23
+ labelText: i.value,
24
+ disabledStatus: o.value
25
+ }
26
+ })), u = (t) => e.getSelectedTemplateByActiveType === t ? "bor-w-3 bor-s-s bor-c-7" : "bor-w-1 bor-s-s bor-c-6", r = (t) => {
27
+ e.pageSelectionDrawerStatus = !1, t && setTimeout(() => {
28
+ t();
29
+ }, 500);
30
+ }, m = () => {
31
+ if (e.isActiveTypeFirstInCollection) {
32
+ r(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
33
+ return;
34
+ }
35
+ e.setPreviousType();
36
+ }, d = () => {
37
+ if (e.isActiveTypeLastInCollection) {
38
+ o.value = !0;
39
+ const t = e.selectedCollectionType, l = e.getSelectedTemplatesByCollection(t);
40
+ e.addUnsubscribePages(l), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
41
+ detail: {
42
+ collectionType: t,
43
+ selectedPages: l
44
+ }
45
+ })), r(() => {
46
+ o.value = !1, a({
47
+ type: B.Success,
48
+ message: s("global-unsubscribe.pages-were-attached")
49
+ });
50
+ });
51
+ return;
52
+ }
53
+ e.setNextType();
54
+ }, b = (t) => {
55
+ e.setSelectedTemplate(t);
56
+ };
57
+ return T(() => e.pageSelectionDrawerStatus, (t) => {
58
+ t && e.pageSelectionUpdateStatus && e.fetchTemplates();
59
+ }), { __sfc: !0, trans: s, unsubscribeStore: e, showToaster: a, isApplying: o, getPrimaryButtonText: c, getCancelOrBackButtonText: i, footerButtonGroupOptions: p, getBorderClass: u, closeModal: r, handleBack: m, handleSave: d, selectTemplate: b, WpDrawer: g, InContainer: C, UnsubscribeBreadcrumb: h };
60
+ }
61
+ });
62
+ export {
63
+ E as default
64
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import n from "./UnsubscribeTypeSelection.vue2.js";
2
+ /* empty css */
3
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var i = function() {
5
+ var e = this, s = e._self._c, t = e._self._setupProxy;
6
+ return s(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.typeSelectionDrawerStatus, "title-text": t.trans("unsubscription-preference.select-unsubscribe-page-title") }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.selectCollection } }, [s(t.InSegments, { staticClass: "w-1", attrs: { "with-icon": "", align: "vertical", disable: t.isSelecting, "segment-list": t.segmentList, selected: t.selectedCollection, "skeleton-sizing": { width: 495, height: 180 }, "skeleton-status": t.skeletonStatus }, on: { click: t.changeCollection } })], 1);
7
+ }, r = [], c = /* @__PURE__ */ o(
8
+ n,
9
+ i,
10
+ r,
11
+ !1,
12
+ null,
13
+ "dd57102d"
14
+ );
15
+ const d = c.exports;
16
+ export {
17
+ d as default
18
+ };
@@ -0,0 +1,107 @@
1
+ import { defineComponent as h, ref as b, computed as m, watch as _ } from "vue";
2
+ import v from "../../wrappers/WpDrawer.vue.js";
3
+ import { useToaster as B } from "../../../composables/useToaster.js";
4
+ import { useTranslations as N } from "../../../composables/useTranslations.js";
5
+ import { ToasterTypeOptions as U } from "../../../enums/toaster.js";
6
+ import { PAGE_TYPES as l, ACADEMY_LINK as w, UNSUBSCRIBE_PAGES_LINK as P, TYPE_TRANSLATIONS as R } from "../../../enums/unsubscribe.js";
7
+ import { useUnsubscribeStore as D } from "../../../stores/unsubscribe.js";
8
+ import { InSegments as I } from "@useinsider/design-system-vue";
9
+ const z = /* @__PURE__ */ h({
10
+ __name: "UnsubscribeTypeSelection",
11
+ setup(G) {
12
+ const e = N(), { showToaster: f } = B(), t = D(), n = b(!1), i = b(!0), o = b(l.GLOBAL_UNSUBSCRIBE), S = e(
13
+ "unsubscription-preference.select-unsubscribe-page-description",
14
+ { action: `<a href="${w}" target="_blank">${e("ds-rules.visit-academy")}</a>` }
15
+ ), T = m(() => [
16
+ {
17
+ description: e("unsubscription-preference.type-global-unsubscribe-description"),
18
+ icon: "line-contact-global-unsub-page",
19
+ text: e("unsubscription-preference.type-global-unsubscribe"),
20
+ value: l.GLOBAL_UNSUBSCRIBE,
21
+ disable: t.isGlobalUnsubscribeDisabled,
22
+ position: "bottom",
23
+ tooltipText: t.isGlobalUnsubscribeDisabled ? e("unsubscription-preference.global-unsub-added") : ""
24
+ },
25
+ {
26
+ description: e("unsubscription-preference.type-subscription-preferences-center-description"),
27
+ icon: "line-contact-sub-pref-center-page",
28
+ text: e("unsubscription-preference.type-subscription-preferences-center"),
29
+ value: l.SUBSCRIPTION_PREFERENCE_CENTER,
30
+ disable: t.isSubscriptionPreferencesCenterDisabled,
31
+ tooltipText: t.isSubscriptionPreferencesCenterDisabled ? e("unsubscription-preference.pref-center-added") : ""
32
+ }
33
+ ]), y = m(() => ({
34
+ primaryButton: {
35
+ styling: "solid",
36
+ type: "primary",
37
+ labelText: e(
38
+ n.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
39
+ ),
40
+ loadingStatus: n.value,
41
+ disabledStatus: !1,
42
+ skeletonStatus: i.value,
43
+ skeletonSizing: { width: 168, height: 40 }
44
+ },
45
+ cancelOrBackButton: {
46
+ styling: "ghost",
47
+ type: "secondary",
48
+ labelText: e("products.cancel"),
49
+ disabledStatus: n.value,
50
+ skeletonStatus: i.value,
51
+ skeletonSizing: { width: 78, height: 40 }
52
+ }
53
+ })), d = (s) => {
54
+ t.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel")), s && setTimeout(() => {
55
+ s();
56
+ }, 500);
57
+ }, E = (s) => {
58
+ o.value = s;
59
+ }, g = () => {
60
+ const s = t.hasTemplatesByCollectionType, r = [];
61
+ if (Object.entries(s).forEach(([c, p]) => {
62
+ p || r.push(Number(c));
63
+ }), r.length === 0)
64
+ return !0;
65
+ const a = r.map((c) => R[c]);
66
+ let u = "";
67
+ if (r.length === 1)
68
+ u = e("unsubscription-preference.create-page-to-continue", {
69
+ page: a[0]
70
+ });
71
+ else if (r.length === 2)
72
+ u = e("unsubscription-preference.create-pages-to-continue", {
73
+ page1: a[0],
74
+ page2: a[1]
75
+ });
76
+ else {
77
+ const c = a.pop() ?? "", p = a.join(", ");
78
+ u = e("unsubscription-preference.create-multiple-pages-to-continue", {
79
+ pages: p,
80
+ lastPage: c
81
+ });
82
+ }
83
+ return f({
84
+ type: U.Warning,
85
+ message: u,
86
+ actionButton: {
87
+ text: "Go to Unsubscribe Pages",
88
+ onClick: () => {
89
+ window.location.href = P;
90
+ }
91
+ }
92
+ }), !1;
93
+ }, C = async () => {
94
+ if (n.value = !0, await t.fetchTemplates(), t.setCollection(o.value), !g()) {
95
+ n.value = !1, d();
96
+ return;
97
+ }
98
+ n.value = !1, t.typeSelectionDrawerStatus = !1, t.pageSelectionDrawerStatus = !0;
99
+ };
100
+ return _(() => t.typeSelectionDrawerStatus, (s) => {
101
+ s && (i.value = !0, o.value = l.GLOBAL_UNSUBSCRIBE, t.isGlobalUnsubscribeDisabled && (o.value = t.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), i.value = !1);
102
+ }), { __sfc: !0, trans: e, showToaster: f, unsubscribeStore: t, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: S, segmentList: T, footerButtonGroupOptions: y, closeModal: d, changeCollection: E, validateTemplates: g, selectCollection: C, WpDrawer: v, InSegments: I };
103
+ }
104
+ });
105
+ export {
106
+ z as default
107
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import o from "./UnsubscribeWrapper.vue2.js";
2
+ import t from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var _ = function() {
4
+ var s;
5
+ var e = this, n = e._self._c, r = e._self._setupProxy;
6
+ return (s = r.config.extensions) != null && s.unsubscribe ? n("div", [n(r.UnsubscribeTypeSelection), n(r.UnsubscribePageSelection)], 1) : e._e();
7
+ }, c = [], i = /* @__PURE__ */ t(
8
+ o,
9
+ _,
10
+ c,
11
+ !1,
12
+ null,
13
+ null
14
+ );
15
+ const l = i.exports;
16
+ export {
17
+ l as default
18
+ };
@@ -0,0 +1,12 @@
1
+ import { defineComponent as t, defineAsyncComponent as e } from "vue";
2
+ import { useConfig as r } from "../../../composables/useConfig.js";
3
+ const m = /* @__PURE__ */ t({
4
+ __name: "UnsubscribeWrapper",
5
+ setup(i) {
6
+ const n = e(() => import("./UnsubscribePageSelection.vue.js")), o = e(() => import("./UnsubscribeTypeSelection.vue.js")), { config: s } = r();
7
+ return { __sfc: !0, UnsubscribePageSelection: n, UnsubscribeTypeSelection: o, config: s };
8
+ }
9
+ });
10
+ export {
11
+ m as default
12
+ };
@@ -2,7 +2,7 @@ import type { FooterButtonGroupOptions } from '@@/Types/wrappers/wp-drawer';
2
2
  interface Props {
3
3
  id: string;
4
4
  className?: string;
5
- size?: string;
5
+ size?: 'small' | 'medium' | 'large';
6
6
  closeOnOutsideClick?: boolean;
7
7
  descriptionStatus?: boolean;
8
8
  descriptionText?: string;
@@ -10,9 +10,11 @@ interface Props {
10
10
  status: boolean;
11
11
  titleText: string;
12
12
  }
13
- declare var __VLS_12: {};
13
+ declare var __VLS_12: {}, __VLS_14: {};
14
14
  type __VLS_Slots = {} & {
15
- default?: (props: typeof __VLS_12) => any;
15
+ headerBottomSlot?: (props: typeof __VLS_12) => any;
16
+ } & {
17
+ default?: (props: typeof __VLS_14) => any;
16
18
  };
17
19
  declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
18
20
  className: string;
@@ -32,7 +34,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
32
34
  descriptionText: string;
33
35
  }>>>, {
34
36
  className: string;
35
- size: string;
37
+ size: "small" | "medium" | "large";
36
38
  closeOnOutsideClick: boolean;
37
39
  descriptionStatus: boolean;
38
40
  descriptionText: string;
@@ -1,6 +1,6 @@
1
1
  import r from "./WpDrawer.vue2.js";
2
2
  import s from "../../_virtual/_plugin-vue2_normalizer.js";
3
- var i = function() {
3
+ var u = function() {
4
4
  var t = this, n = t._self._c, e = t._self._setupProxy;
5
5
  return n(e.InDrawer, { class: t.className, attrs: { id: t.id, "footer-status": "", "close-on-outside-click": t.closeOnOutsideClick, "description-status": t.descriptionStatus, "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, size: t.size, status: t.status, "title-text": t.titleText }, on: { cancelOrBackButtonEvent: function(o) {
6
6
  return e.emit("cancelOrBackButtonEvent");
@@ -8,13 +8,15 @@ var i = function() {
8
8
  return e.emit("onCloseEvent");
9
9
  }, primaryButtonEvent: function(o) {
10
10
  return e.emit("primaryButtonEvent");
11
- } }, scopedSlots: t._u([{ key: "contentSlot", fn: function() {
11
+ } }, scopedSlots: t._u([t.$slots.headerBottomSlot ? { key: "headerBottomSlot", fn: function() {
12
+ return [t._t("headerBottomSlot")];
13
+ }, proxy: !0 } : null, { key: "contentSlot", fn: function() {
12
14
  return [n("div", [t._t("default")], 2)];
13
15
  }, proxy: !0 }], null, !0) });
14
- }, u = [], c = /* @__PURE__ */ s(
16
+ }, i = [], c = /* @__PURE__ */ s(
15
17
  r,
16
- i,
17
18
  u,
19
+ i,
18
20
  !1,
19
21
  null,
20
22
  null