@useinsider/guido 1.0.3-beta.367d151 → 1.0.3-beta.3757462

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 (111) hide show
  1. package/dist/@types/generic.d.ts +0 -14
  2. package/dist/components/Guido.vue.d.ts +2 -3
  3. package/dist/components/Guido.vue.js +9 -11
  4. package/dist/components/Guido.vue2.js +69 -75
  5. package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +1 -3
  6. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
  7. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +17 -30
  8. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +1 -3
  9. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +10 -12
  10. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -19
  11. package/dist/components/wrappers/WpDrawer.vue.d.ts +4 -6
  12. package/dist/components/wrappers/WpDrawer.vue.js +4 -6
  13. package/dist/composables/useStripo.js +18 -26
  14. package/dist/config/compiler/unsubscribeCompilerRules.js +29 -42
  15. package/dist/config/migrator/index.d.ts +1 -1
  16. package/dist/config/migrator/index.js +6 -7
  17. package/dist/enums/defaults.js +0 -4
  18. package/dist/enums/unsubscribe.d.ts +0 -23
  19. package/dist/enums/unsubscribe.js +6 -43
  20. package/dist/extensions/Blocks/Checkbox/control.js +54 -53
  21. package/dist/extensions/Blocks/RadioButton/control.js +45 -44
  22. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  23. package/dist/guido.css +1 -1
  24. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +71 -83
  25. package/dist/stores/editor.d.ts +0 -21
  26. package/dist/stores/editor.js +1 -2
  27. package/dist/stores/unsubscribe.d.ts +5 -253
  28. package/dist/stores/unsubscribe.js +6 -126
  29. package/dist/utils/dateUtil.d.ts +0 -4
  30. package/dist/utils/dateUtil.js +12 -8
  31. package/dist/utils/genericUtil.d.ts +0 -1
  32. package/dist/utils/genericUtil.js +7 -8
  33. package/dist/utils/templatePreparation.js +16 -17
  34. package/package.json +2 -2
  35. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +0 -19
  36. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +0 -28
  37. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +0 -38
  38. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts +0 -2
  39. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +0 -17
  40. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +0 -37
  41. package/dist/components/organisms/extensions/recommendation/Filters.vue.d.ts +0 -2
  42. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +0 -20
  43. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +0 -44
  44. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +0 -16
  45. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +0 -17
  46. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +0 -27
  47. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -2
  48. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +0 -18
  49. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +0 -16
  50. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -2
  51. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +0 -24
  52. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +0 -64
  53. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -2
  54. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +0 -18
  55. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +0 -107
  56. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -2
  57. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +0 -18
  58. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +0 -12
  59. package/dist/config/migrator/unsubscribeMigrator.d.ts +0 -1
  60. package/dist/config/migrator/unsubscribeMigrator.js +0 -124
  61. package/dist/enums/date.d.ts +0 -13
  62. package/dist/enums/date.js +0 -16
  63. package/dist/enums/extensions/recommendationBlock.d.ts +0 -16
  64. package/dist/enums/extensions/recommendationBlock.js +0 -80
  65. package/dist/extensions/Blocks/Recommendation/block.d.ts +0 -10
  66. package/dist/extensions/Blocks/Recommendation/block.js +0 -27
  67. package/dist/extensions/Blocks/Recommendation/control.d.ts +0 -29
  68. package/dist/extensions/Blocks/Recommendation/control.js +0 -277
  69. package/dist/extensions/Blocks/Recommendation/extension.d.ts +0 -2
  70. package/dist/extensions/Blocks/Recommendation/extension.js +0 -10
  71. package/dist/extensions/Blocks/Recommendation/iconsRegistry.d.ts +0 -4
  72. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +0 -51
  73. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +0 -19
  74. package/dist/extensions/Blocks/Recommendation/settingsPanel.d.ts +0 -4
  75. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +0 -32
  76. package/dist/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -555
  77. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +0 -266
  78. package/dist/extensions/Blocks/Recommendation/template.d.ts +0 -6
  79. package/dist/extensions/Blocks/Recommendation/template.js +0 -200
  80. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +0 -7
  81. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +0 -28
  82. package/dist/extensions/Blocks/Unsubscribe/block.d.ts +0 -32
  83. package/dist/extensions/Blocks/Unsubscribe/block.js +0 -131
  84. package/dist/extensions/Blocks/Unsubscribe/control.d.ts +0 -29
  85. package/dist/extensions/Blocks/Unsubscribe/control.js +0 -167
  86. package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +0 -11
  87. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +0 -42
  88. package/dist/extensions/Blocks/Unsubscribe/extension.d.ts +0 -2
  89. package/dist/extensions/Blocks/Unsubscribe/extension.js +0 -21
  90. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +0 -4
  91. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +0 -21
  92. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +0 -4
  93. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +0 -35
  94. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +0 -42
  95. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +0 -4
  96. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +0 -10
  97. package/dist/extensions/Blocks/Unsubscribe/template.d.ts +0 -12
  98. package/dist/extensions/Blocks/Unsubscribe/template.js +0 -22
  99. package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -9
  100. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +0 -11
  101. package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +0 -7
  102. package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +0 -6
  103. package/dist/extensions/Blocks/common-control.d.ts +0 -66
  104. package/dist/extensions/Blocks/common-control.js +0 -102
  105. package/dist/mock/api/recommendation.d.ts +0 -2
  106. package/dist/services/recommendationApi.d.ts +0 -6
  107. package/dist/services/recommendationApi.js +0 -43
  108. package/dist/services/unsubscribeApi.d.ts +0 -4
  109. package/dist/services/unsubscribeApi.js +0 -16
  110. package/dist/stores/config.d.ts +0 -97
  111. package/dist/stores/config.js +0 -17
@@ -1,37 +0,0 @@
1
- import { defineComponent as n, ref as a, computed as l } from "vue";
2
- import i from "../../../wrappers/WpDrawer.vue.js";
3
- import { useTranslations as p } from "../../../../composables/useTranslations.js";
4
- import { useRecommendationExtensionStore as c } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import u from "./Filters.vue.js";
6
- const b = /* @__PURE__ */ n({
7
- __name: "FilterSelectionDrawer",
8
- setup(m) {
9
- const t = p(), o = c(), e = a(!1), s = l(() => ({
10
- primaryButton: {
11
- styling: "solid",
12
- type: "primary",
13
- labelText: t(
14
- e.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
15
- ),
16
- loadingStatus: e.value,
17
- disabledStatus: !1
18
- },
19
- cancelOrBackButton: {
20
- styling: "ghost",
21
- type: "secondary",
22
- labelText: t("products.cancel"),
23
- disabledStatus: e.value
24
- }
25
- })), r = () => {
26
- o.filterSelectionDrawerStatus = !1;
27
- };
28
- return { __sfc: !0, trans: t, store: o, isApplying: e, footerButtonGroupOptions: s, closeModal: r, applyFilter: () => {
29
- e.value = !0, setTimeout(() => {
30
- console.debug("Filter applied!"), r(), o.generateFilterQuery();
31
- }, 2e3);
32
- }, WpDrawer: i, Filters: u };
33
- }
34
- });
35
- export {
36
- b as default
37
- };
@@ -1,2 +0,0 @@
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;
@@ -1,20 +0,0 @@
1
- import s from "./Filters.vue2.js";
2
- /* empty css */
3
- import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var o = function() {
5
- var i = this, e = i._self._c, t = i._self._setupProxy;
6
- return e("div", { staticClass: "d-f f-d-c gap-16" }, [e("div", { staticClass: "d-f a-i-c j-c-s-b gap-16" }, [e(t.InSegments, { staticClass: "f-g-1 w-1", attrs: { id: "guido__filter-group-segments", "segment-list": t.filterGroupList, selected: t.selectedFilterGroup, "with-icon": !1 }, on: { click: t.changeFilterGroup } }), e(t.InButtonV2, { staticClass: "w-20-s f-g-1", attrs: { id: "guido__add-filter-group-button", "left-icon": "line-plus-netural", type: "secondary", "disabled-status": t.isMaxFilterGroupCount, "label-text": t.trans("smart-recommender.add-filter-group"), "tooltip-text": t.isMaxFilterGroupCount ? t.trans("email-editor.add-filter-tooltip") : "" }, on: { click: t.handleAddFilterGroup } })], 1), e("div", { staticClass: "d-f a-i-c j-c-s-b gap-16" }, [e("div", { staticClass: "d-f a-i-c" }, [t.selectedFilterGroup > 1 ? e(t.LogicAdapter, { staticClass: "mr-2" }) : i._e(), e("p", [i._v(" " + i._s(t.trans("email-editor.filter-group")) + " " + i._s(t.selectedFilterGroup) + " ")])], 1), t.hasRemoveFilterButton ? e(t.InButtonV2, { attrs: { id: "guido__delete-filter-group-button", "left-icon": "line-delete", styling: "text", type: "danger", "label-text-status": !1 }, on: { click: t.handleDeleteFilterGroup } }) : i._e()], 1), e("div", { staticClass: "d-f a-i-c j-c-s-b f-d-c" }, i._l(t.selectedFilterGroupFilters, function(l, r) {
7
- return e(t.FilterItem, { key: r, attrs: { filter: l, "has-logic-adapter": t.hasLogicAdapter && r !== t.selectedFilterGroupFilters.length - 1, index: r }, on: { "delete-filter": t.handleDeleteFilter } });
8
- }), 1), e("div", { staticClass: "d-f a-i-c j-c-c mt-3" }, [e(t.InButtonV2, { staticClass: "w-11-s", attrs: { id: "filter-group--add-filter-button", "left-icon": "line-plus-netural", type: "subtle-primary", "label-text": t.trans("smart-recommender.add-filter-condition") }, on: { click: t.handleAddFilter } })], 1)]);
9
- }, d = [], n = /* @__PURE__ */ a(
10
- s,
11
- o,
12
- d,
13
- !1,
14
- null,
15
- "1ccb6d4a"
16
- );
17
- const _ = n.exports;
18
- export {
19
- _ as default
20
- };
@@ -1,44 +0,0 @@
1
- import { defineComponent as m, computed as o, ref as h } from "vue";
2
- import { useTranslations as G } from "../../../../composables/useTranslations.js";
3
- import { useRecommendationExtensionStore as g } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
4
- import { InButtonV2 as v, InSegments as f } from "@useinsider/design-system-vue";
5
- import _ from "./FilterItem.vue.js";
6
- import A from "./LogicAdapter.vue.js";
7
- const E = /* @__PURE__ */ m({
8
- __name: "Filters",
9
- setup(R) {
10
- const i = G(), l = g(), u = o(() => l.getFilterGroupCount), t = o(() => Array.from({ length: u.value }, (e, a) => ({
11
- text: (a + 1).toString(),
12
- value: a + 1
13
- }))), r = h(1), s = (e) => {
14
- r.value = e;
15
- }, d = () => {
16
- const e = t.value.length + 1;
17
- console.debug("handleAddFilterGroup", e), t.value.push({
18
- text: e.toString(),
19
- value: e
20
- }), l.addFilterGroup(e);
21
- }, p = o(() => t.value.length >= 3), n = o(() => l.getSelectedFilterGroup(r.value)), c = o(() => n.value.length > 1), F = o(() => t.value.length > 1);
22
- return { __sfc: !0, MAX_FILTER_GROUP_COUNT: 3, trans: i, store: l, filterGroupCount: u, filterGroupList: t, selectedFilterGroup: r, changeFilterGroup: s, handleAddFilterGroup: d, isMaxFilterGroupCount: p, selectedFilterGroupFilters: n, hasLogicAdapter: c, hasRemoveFilterButton: F, handleAddFilter: () => {
23
- l.addFilter({
24
- type: "standardFilter",
25
- attribute: "",
26
- operatorReplace: "",
27
- operator: "",
28
- innerGroupOperator: "*",
29
- outerGroupOperator: "*",
30
- filterNumber: n.value.length + 1,
31
- filterGroup: r.value,
32
- isValid: !1,
33
- value: ""
34
- }), console.debug("handleAddFilter");
35
- }, handleDeleteFilter: (e) => {
36
- console.debug("handleDeleteFilter: ", e), l.deleteFilter(e);
37
- }, handleDeleteFilterGroup: () => {
38
- t.value.length !== 1 && (console.debug("handleDeleteFilterGroup"), t.value.splice(r.value - 1, 1), r.value > 1 && r.value--);
39
- }, InSegments: f, InButtonV2: v, FilterItem: _, LogicAdapter: A };
40
- }
41
- });
42
- export {
43
- E as default
44
- };
@@ -1,16 +0,0 @@
1
- type __VLS_Props = {
2
- logic?: string;
3
- };
4
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
5
- change: (value: string) => void;
6
- }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
7
- export default _default;
8
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
- type __VLS_TypePropsToOption<T> = {
10
- [K in keyof T]-?: {} extends Pick<T, K> ? {
11
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
12
- } : {
13
- type: import('vue').PropType<T[K]>;
14
- required: true;
15
- };
16
- };
@@ -1,17 +0,0 @@
1
- import s from "./LogicAdapter.vue2.js";
2
- import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
- var o = function() {
4
- var t = this, r = t._self._c, e = t._self._setupProxy;
5
- return r(e.InSegments, { staticClass: "guido__logic-adapter f-g-1", attrs: { "segment-list": e.logicAdapterList, selected: e.selectedLogicAdapter, "with-icon": !1 }, on: { click: e.changeLogicAdapter } });
6
- }, a = [], c = /* @__PURE__ */ n(
7
- s,
8
- o,
9
- a,
10
- !1,
11
- null,
12
- null
13
- );
14
- const p = c.exports;
15
- export {
16
- p as default
17
- };
@@ -1,27 +0,0 @@
1
- import { defineComponent as s, ref as n } from "vue";
2
- import { InSegments as p } from "@useinsider/design-system-vue";
3
- const l = /* @__PURE__ */ s({
4
- __name: "LogicAdapter",
5
- props: {
6
- logic: null
7
- },
8
- emits: ["change"],
9
- setup(r, { emit: e }) {
10
- const t = r, a = n([
11
- {
12
- text: "and",
13
- value: "*"
14
- },
15
- {
16
- text: "or",
17
- value: "|"
18
- }
19
- ]), o = n(t.logic || "*");
20
- return { __sfc: !0, logicAdapterList: a, emit: e, props: t, selectedLogicAdapter: o, changeLogicAdapter: (c) => {
21
- o.value = c, e("change", c);
22
- }, InSegments: p };
23
- }
24
- });
25
- export {
26
- l as default
27
- };
@@ -1,2 +0,0 @@
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;
@@ -1,18 +0,0 @@
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
- };
@@ -1,16 +0,0 @@
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
- };
@@ -1,2 +0,0 @@
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;
@@ -1,24 +0,0 @@
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
- };
@@ -1,64 +0,0 @@
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
- };
@@ -1,2 +0,0 @@
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;
@@ -1,18 +0,0 @@
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
- };
@@ -1,107 +0,0 @@
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
- };
@@ -1,2 +0,0 @@
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;
@@ -1,18 +0,0 @@
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
- };
@@ -1,12 +0,0 @@
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
- };
@@ -1 +0,0 @@
1
- export declare function migrateUnsubscribe(html: string): Promise<string>;
@@ -1,124 +0,0 @@
1
- var h = Object.defineProperty;
2
- var x = (l, e, t) => e in l ? h(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
3
- var S = (l, e, t) => x(l, typeof e != "symbol" ? e + "" : e, t);
4
- import { MERGE_TAGS as k, PAGE_TYPES as p } from "../../enums/unsubscribe.js";
5
- import { DATA_ATTRIBUTES as A } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
6
- import { useUnsubscribeStore as T } from "../../stores/unsubscribe.js";
7
- class C {
8
- constructor() {
9
- S(this, "parser");
10
- this.parser = new DOMParser();
11
- }
12
- async migrate(e) {
13
- try {
14
- const t = this.parser.parseFromString(e, "text/html"), i = t.querySelectorAll("td.unsubscribe-block");
15
- if (!i.length)
16
- return e;
17
- const o = T();
18
- return await o.fetchTemplates(), i.forEach((r) => {
19
- const c = r.getAttribute("id"), g = this.extractPaddingClass(r), u = r.getAttribute("bgcolor") || "", n = this.extractUnsubscribeContent(r), s = this.getCollectionTypeFromMergeTag(n.linkHref), b = o.getSelectedUnsubscribePagesByCollection(s);
20
- console.debug("[UnsubscribeMigrator]", {
21
- mergeTag: n.linkHref,
22
- collectionType: s,
23
- pageIds: b,
24
- paddingClass: g,
25
- bgColor: u
26
- });
27
- const f = this.buildUnsubscribeBlock(
28
- n,
29
- s,
30
- b,
31
- g,
32
- u
33
- ), a = this.parser.parseFromString(
34
- `<table id="tempDoc"><tbody><tr>${f}</tr></tbody></table>`,
35
- "text/html"
36
- ).querySelector(".unsubscribe-block-v2");
37
- a && r.parentNode && (a.setAttribute("id", c || ""), r.parentNode.replaceChild(a, r));
38
- }), t.documentElement.outerHTML;
39
- } catch (t) {
40
- return console.error("UnsubscribeMigrator failed:", t), e;
41
- }
42
- }
43
- extractPaddingClass(e) {
44
- const i = (e.getAttribute("class") || "").match(/\bes-p\d+\b/);
45
- return i ? i[0] : "";
46
- }
47
- extractUnsubscribeContent(e) {
48
- var m;
49
- const t = e.querySelector("p");
50
- if (!t)
51
- return {
52
- textBefore: "You can ",
53
- linkText: "unsubscribe",
54
- linkHref: "{{ins-unsubscribe-link}}",
55
- linkStyle: "",
56
- textAfter: " from our emails, if you need to.",
57
- isBold: !1,
58
- isItalic: !1,
59
- align: "center",
60
- paragraphStyle: ""
61
- };
62
- const i = e.getAttribute("align") || t.getAttribute("align") || "center", o = t.getAttribute("style") || "", r = t.querySelector("a.unsubscribe-link") || t.querySelector('a[href*="unsubscribe"]');
63
- if (!r)
64
- return {
65
- textBefore: "You can ",
66
- linkText: "unsubscribe",
67
- linkHref: "{{ins-unsubscribe-link}}",
68
- linkStyle: "",
69
- textAfter: " from our emails, if you need to.",
70
- isBold: !1,
71
- isItalic: !1,
72
- align: i,
73
- paragraphStyle: o
74
- };
75
- const c = ((m = r.textContent) == null ? void 0 : m.trim()) || "unsubscribe", g = r.getAttribute("href") || "{{ins-unsubscribe-link}}", u = r.getAttribute("style") || "", n = t.textContent || "", s = n.indexOf(c), b = s >= 0 ? n.substring(0, s).trim() : "You can ", f = s >= 0 ? n.substring(s + c.length).trim() : " from our emails, if you need to.", d = !!t.querySelector("b, strong"), a = !!t.querySelector("i, em");
76
- return {
77
- textBefore: b,
78
- linkText: c,
79
- linkHref: this.normalizeUnsubscribeHref(g),
80
- linkStyle: u,
81
- textAfter: f,
82
- isBold: d,
83
- isItalic: a,
84
- align: i,
85
- paragraphStyle: o
86
- };
87
- }
88
- buildUnsubscribeBlock(e, t, i, o, r) {
89
- const c = e.linkStyle ? ` style="${e.linkStyle}"` : "", u = `<a ${`href="${e.linkHref}" class="unsubscribe-link" target="_blank" data-unsubscribe-link="true"`}${c}>${e.linkText}</a>`, n = [];
90
- e.textBefore && n.push(e.textBefore), n.push(u), e.textAfter && n.push(e.textAfter);
91
- let s = n.join(" ");
92
- e.isBold && e.isItalic ? s = `<strong path="1,0"><em path="1,0,0">${s}</em></strong>` : e.isBold ? s = `<strong path="1,0">${s}</strong>` : e.isItalic && (s = `<em path="1,0">${s}</em>`);
93
- const b = e.align ? ` align="${e.align}"` : "", f = r ? ` bgcolor="${r}"` : "", d = e.paragraphStyle ? ` style="${e.paragraphStyle}"` : "", a = i.length > 0 ? ` ${A.PAGE_LIST}="${i.join(",")}"` : "", m = ` ${A.PAGE_TYPE}="${t}"`, y = "esd-block-text unsubscribe-block-v2 esd-block-unsubscribe esd-unsubscribe-block esd-extension-block";
94
- return `
95
- <td
96
- data-migration="true"
97
- esd-extension-block-id="unsubscribe-block"
98
- class="${o ? `${y} ${o}` : y}"
99
- ${b}${f}${m}${a}
100
- >
101
- <p path="1"${d}>
102
- ${s}
103
- </p>
104
- </td>
105
- `;
106
- }
107
- getCollectionTypeFromMergeTag(e) {
108
- return e === k[p.SUBSCRIPTION_PREFERENCE_CENTER] ? p.SUBSCRIPTION_PREFERENCE_CENTER : e === k[p.GLOBAL_UNSUBSCRIBE] ? p.GLOBAL_UNSUBSCRIBE : p.GLOBAL_UNSUBSCRIBE;
109
- }
110
- normalizeUnsubscribeHref(e) {
111
- if (Object.values(k).includes(e))
112
- return e;
113
- const i = e.match(/{{ins-(?:global-)?(?:preferences-)?unsubscribe-link}}/);
114
- return i ? i[0] : e.includes("unsubscribe") || e.includes("unsub") ? (console.warn(
115
- `[UnsubscribeMigrator] Unrecognized unsubscribe href format: "${e}". Defaulting to {{ins-unsubscribe-link}}`
116
- ), "{{ins-unsubscribe-link}}") : e;
117
- }
118
- }
119
- async function M(l) {
120
- return new C().migrate(l);
121
- }
122
- export {
123
- M as migrateUnsubscribe
124
- };
@@ -1,13 +0,0 @@
1
- export declare const DEFAULT_DATE_FORMAT_OPTIONS: {
2
- readonly month: "short";
3
- readonly day: "numeric";
4
- readonly hour: "2-digit";
5
- readonly minute: "2-digit";
6
- readonly second: "2-digit";
7
- readonly hour12: false;
8
- };
9
- export declare const DATE_FORMAT_DD_MM_YYYY: {
10
- readonly day: "2-digit";
11
- readonly month: "2-digit";
12
- readonly year: "numeric";
13
- };
@@ -1,16 +0,0 @@
1
- const i = {
2
- month: "short",
3
- day: "numeric",
4
- hour: "2-digit",
5
- minute: "2-digit",
6
- second: "2-digit",
7
- hour12: !1
8
- }, t = {
9
- day: "2-digit",
10
- month: "2-digit",
11
- year: "numeric"
12
- };
13
- export {
14
- t as DATE_FORMAT_DD_MM_YYYY,
15
- i as DEFAULT_DATE_FORMAT_OPTIONS
16
- };