@mobilon-dev/chotto 0.3.82 → 0.3.84

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 (30) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/1_atoms/Tooltip/Tooltip.vue.js +1 -1
  3. package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +66 -51
  4. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +366 -283
  5. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanelAttributeIndicator.vue.js +46 -34
  6. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.js +64 -39
  7. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.js +116 -61
  8. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationChannels.js +1 -1
  9. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.js +30 -16
  10. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationRecentSelection.js +47 -0
  11. package/dist/components/2_blocks/CommunicationPanel/icons/{CommunicationPanelConfirmSpinner.vue2.js → CommunicationPanelConfirmSpinner.vue.js} +1 -1
  12. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelUnconfirmedIcon.vue.js +19 -0
  13. package/dist/themes/dark.css +1 -1
  14. package/dist/themes/default.css +1 -1
  15. package/dist/themes/glass.css +1 -1
  16. package/dist/themes/green.css +1 -1
  17. package/dist/themes/mobilon1.css +1 -1
  18. package/dist/types/components/1_atoms/Tooltip/Tooltip.vue.d.ts +10 -0
  19. package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +4 -0
  20. package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanelAttributeIndicator.vue.d.ts +4 -2
  21. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.d.ts +10 -1
  22. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.d.ts +23 -2
  23. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.d.ts +1 -0
  24. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationRecentSelection.d.ts +20 -0
  25. package/dist/types/components/2_blocks/CommunicationPanel/icons/CommunicationPanelUnconfirmedIcon.vue.d.ts +2 -0
  26. package/dist/types/components/2_blocks/CommunicationPanel/icons/index.d.ts +1 -0
  27. package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +4 -0
  28. package/dist/types/components/2_blocks/CommunicationPanel/styles/types.d.ts +42 -10
  29. package/dist/types/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.d.ts +1 -1
  30. package/package.json +1 -1
@@ -1,17 +1,18 @@
1
- import { computed as o, createElementBlock as i, openBlock as e, createCommentVNode as u, Fragment as y, createBlock as r, withCtx as C, createElementVNode as A, normalizeClass as p, unref as l } from "vue";
2
- import I from "../../1_atoms/Tooltip/Tooltip.vue.js";
3
- import f from "./icons/CommunicationPanelCheckIcon.vue.js";
4
- import b from "./icons/CommunicationPanelConfirmSpinner.vue2.js";
5
- import { isAttributeConfirming as S, shouldShowAttributeCheckmark as _, shouldShowBlockedIndicatorSlot as g, getAttributeCheckIndicatorClass as w, getAttributeIndicatorTooltipText as x } from "./composables/useCommunicationAttributes.js";
6
- const B = { class: "attribute-indicator-slot" }, T = {
7
- key: 2,
1
+ import { computed as o, createElementBlock as a, openBlock as e, createCommentVNode as s, Fragment as I, createBlock as i, withCtx as A, createElementVNode as S, normalizeClass as b, unref as r } from "vue";
2
+ import _ from "../../1_atoms/Tooltip/Tooltip.vue.js";
3
+ import k from "./icons/CommunicationPanelCheckIcon.vue.js";
4
+ import h from "./icons/CommunicationPanelUnconfirmedIcon.vue.js";
5
+ import v from "./icons/CommunicationPanelConfirmSpinner.vue.js";
6
+ import { isAttributeConfirming as g, shouldShowAttributeCheckmark as w, shouldShowAttributeUnconfirmedIndicator as x, shouldShowBlockedIndicatorSlot as q, getAttributeCheckIndicatorClass as B, getAttributeIndicatorTooltipText as T } from "./composables/useCommunicationAttributes.js";
7
+ const P = { class: "attribute-indicator-slot" }, N = {
8
+ key: 3,
8
9
  class: "blocked-indicator-mark",
9
10
  "aria-hidden": "true"
10
- }, q = {
11
- key: 2,
11
+ }, U = {
12
+ key: 3,
12
13
  class: "blocked-indicator-mark",
13
14
  "aria-hidden": "true"
14
- }, F = {
15
+ }, H = {
15
16
  __name: "CommunicationPanelAttributeIndicator",
16
17
  props: {
17
18
  attribute: {
@@ -37,52 +38,63 @@ const B = { class: "attribute-indicator-slot" }, T = {
37
38
  type: Object,
38
39
  required: !1,
39
40
  default: () => ({})
41
+ },
42
+ tooltipDelay: {
43
+ type: Number,
44
+ required: !1,
45
+ default: 600
40
46
  }
41
47
  },
42
- setup(k) {
43
- const t = k, s = o(() => ({
48
+ setup(d) {
49
+ const t = d, m = o(() => ({
44
50
  isSelected: t.isSelected,
45
51
  confirmingAttributeId: t.confirmingAttributeId,
46
52
  blockedAttributeIds: t.blockedAttributeIds ?? []
47
- })), a = o(
48
- () => S(t.attribute, t.confirmingAttributeId)
53
+ })), n = o(
54
+ () => g(t.attribute, t.confirmingAttributeId)
49
55
  ), c = o(
50
- () => _(t.attribute, t.isSelected)
51
- ), n = o(
52
- () => g(t.attribute, s.value)
53
- ), h = o(() => a.value || c.value), v = o(() => h.value || n.value), d = o(() => a.value ? "confirming-indicator" : n.value ? "blocked-indicator" : w(t.attribute, t.isSelected) ?? ""), m = o(
54
- () => x(
56
+ () => w(t.attribute, t.isSelected)
57
+ ), u = o(
58
+ () => x(t.attribute)
59
+ ), l = o(
60
+ () => q(t.attribute, m.value)
61
+ ), y = o(
62
+ () => n.value || c.value || u.value
63
+ ), C = o(() => y.value || l.value), f = o(() => n.value ? "confirming-indicator" : l.value ? "blocked-indicator" : B(t.attribute, t.isSelected) ?? ""), p = o(
64
+ () => T(
55
65
  t.attribute,
56
66
  t.indicatorTooltips,
57
- s.value
67
+ m.value
58
68
  )
59
69
  );
60
- return (P, j) => (e(), i("span", B, [
61
- v.value ? (e(), i(y, { key: 0 }, [
62
- m.value ? (e(), r(I, {
70
+ return (j, D) => (e(), a("span", P, [
71
+ C.value ? (e(), a(I, { key: 0 }, [
72
+ p.value ? (e(), i(_, {
63
73
  key: 0,
64
- text: m.value,
74
+ text: p.value,
65
75
  position: "bottom-left",
66
- offset: 8
76
+ offset: 8,
77
+ delay: d.tooltipDelay,
78
+ "hide-on-click": ""
67
79
  }, {
68
- default: C(() => [
69
- A("span", {
70
- class: p(d.value)
80
+ default: A(() => [
81
+ S("span", {
82
+ class: b(f.value)
71
83
  }, [
72
- a.value ? (e(), r(l(b), { key: 0 })) : c.value ? (e(), r(l(f), { key: 1 })) : n.value ? (e(), i("span", T)) : u("", !0)
84
+ n.value ? (e(), i(r(v), { key: 0 })) : c.value ? (e(), i(r(k), { key: 1 })) : u.value ? (e(), i(r(h), { key: 2 })) : l.value ? (e(), a("span", N)) : s("", !0)
73
85
  ], 2)
74
86
  ]),
75
87
  _: 1
76
- }, 8, ["text"])) : (e(), i("span", {
88
+ }, 8, ["text", "delay"])) : (e(), a("span", {
77
89
  key: 1,
78
- class: p(d.value)
90
+ class: b(f.value)
79
91
  }, [
80
- a.value ? (e(), r(l(b), { key: 0 })) : c.value ? (e(), r(l(f), { key: 1 })) : n.value ? (e(), i("span", q)) : u("", !0)
92
+ n.value ? (e(), i(r(v), { key: 0 })) : c.value ? (e(), i(r(k), { key: 1 })) : u.value ? (e(), i(r(h), { key: 2 })) : l.value ? (e(), a("span", U)) : s("", !0)
81
93
  ], 2))
82
- ], 64)) : u("", !0)
94
+ ], 64)) : s("", !0)
83
95
  ]));
84
96
  }
85
97
  };
86
98
  export {
87
- F as default
99
+ H as default
88
100
  };
@@ -1,91 +1,116 @@
1
- import { needsAttributeConfirmation as o } from "./useCommunicationAttributes.js";
2
- function H({
1
+ import { needsAttributeConfirmation as m } from "./useCommunicationAttributes.js";
2
+ import { resolveRecentChannelSelection as J } from "./useCommunicationRecentSelection.js";
3
+ function Y({
3
4
  activeChannelType: l,
4
- channels: t,
5
- selectedChannel: s,
6
- selectedChannelType: v,
7
- hoveredAttribute: S,
8
- confirmingAttributeId: c,
5
+ channels: v,
6
+ selectedChannel: i,
7
+ selectedChannelType: s,
8
+ hoveredAttribute: z,
9
+ confirmingAttributeId: q,
9
10
  isAttributeBlocked: u,
10
11
  closeMenu: a,
11
- hasMultipleChannels: q,
12
+ hasMultipleChannels: A,
12
13
  getSingleChannelForType: x,
13
- getAvailableChannels: P,
14
+ getAvailableChannels: C,
14
15
  isChannelEmpty: d,
15
- isNewDialog: h,
16
- showDefaultChannelTooltipWithTimer: C,
17
- clearDefaultChannelTooltip: p,
18
- emit: f
16
+ isNewDialog: I,
17
+ showDefaultChannelTooltipWithTimer: R,
18
+ clearDefaultChannelTooltip: S,
19
+ emit: t,
20
+ panelPendingSelection: f
19
21
  }) {
20
- const i = (n, e, r) => {
21
- u(n) || (c.value = n.id, f("confirm-attribute", {
22
+ const b = (n, e, r) => {
23
+ u(n) || (q.value = n.id, t("confirm-attribute", {
22
24
  attributeId: n.id,
23
25
  channelId: e,
24
26
  channelType: r,
25
27
  attribute: n
26
28
  }));
27
- }, b = (n, e, r) => {
28
- if (o(n)) {
29
- i(n, e, r);
29
+ }, G = (n, e, r) => {
30
+ if (m(n)) {
31
+ b(n, e, r);
30
32
  return;
31
33
  }
32
- A(n, e);
33
- }, m = (n) => {
34
+ j(n, e);
35
+ }, h = (n) => {
34
36
  if (!(!n || u(n))) {
35
- if (o(n)) {
36
- i(n, "", "phone");
37
+ if (m(n)) {
38
+ b(n, "", "phone");
37
39
  return;
38
40
  }
39
- f("phone-call", {
41
+ t("phone-call", {
40
42
  attributeId: n.id,
41
43
  phoneNumber: n.data
42
44
  }), a();
43
45
  }
44
- }, A = (n, e) => {
45
- f("select-attribute-channel", {
46
+ }, j = (n, e) => {
47
+ t("select-attribute-channel", {
46
48
  attributeId: n.id,
47
49
  channelId: e
48
- }), v.value = l.value, s.value = t.value.find((r) => r.channelId === e) ?? {}, d(e) && h.value ? C() : p(), a();
50
+ }), s.value = l.value, i.value = v.value.find((r) => r.channelId === e) ?? {}, d(e) && I.value ? R() : S(), a();
49
51
  };
50
52
  return {
51
- handlePhoneCall: m,
53
+ handlePhoneCall: h,
52
54
  handleAttributeClick: (n) => {
53
- if (c.value || u(n))
55
+ if (q.value || u(n))
54
56
  return;
55
57
  const e = l.value;
56
58
  if (e) {
57
59
  if (e === "phone") {
58
- m(n);
60
+ h(n);
59
61
  return;
60
62
  }
61
- if (!q(e)) {
63
+ if (!A(e)) {
62
64
  const r = x(e);
63
- r && b(n, r.channelId, e);
65
+ r && G(n, r.channelId, e);
64
66
  }
65
67
  }
66
68
  },
67
- selectSingleChannel: A,
69
+ selectSingleChannel: j,
68
70
  selectChannel: (n) => {
69
- const e = S.value, r = l.value;
71
+ const e = z.value, r = l.value;
70
72
  if (!e || !r || u(e)) {
71
73
  a();
72
74
  return;
73
75
  }
74
- if (o(e)) {
75
- i(e, n, r);
76
+ if (m(e)) {
77
+ b(e, n, r);
76
78
  return;
77
79
  }
78
- f("select-attribute-channel", {
80
+ t("select-attribute-channel", {
79
81
  attributeId: e.id,
80
82
  channelId: n
81
- }), v.value = r, s.value = t.value.find((g) => g.channelId === n) ?? {}, d(n) && h.value ? C() : p(), a();
83
+ }), s.value = r, i.value = v.value.find((c) => c.channelId === n) ?? {}, d(n) && I.value ? R() : S(), a();
82
84
  },
83
85
  availableChannels: () => {
84
86
  const n = l.value;
85
- return n ? P(n) : [];
87
+ return n ? C(n) : [];
88
+ },
89
+ applyRecentChannelButtonSelection: (n, e, r) => {
90
+ const c = J(
91
+ n,
92
+ e,
93
+ r,
94
+ x,
95
+ C
96
+ );
97
+ if (!c)
98
+ return !1;
99
+ const { attribute: P, channelId: o } = c;
100
+ return u(P) ? !1 : (f && (f.value = {
101
+ channelType: n,
102
+ attributeId: P.id,
103
+ channelId: o
104
+ }), t("select-attribute-channel", {
105
+ attributeId: P.id,
106
+ channelId: o
107
+ }), s.value = n, i.value = v.value.find((H) => H.channelId === o) ?? {}, d(o) && I.value ? R() : S(), !0);
108
+ },
109
+ clearPanelPendingSelection: () => {
110
+ f && (f.value = null);
86
111
  }
87
112
  };
88
113
  }
89
114
  export {
90
- H as useCommunicationActions
115
+ Y as useCommunicationActions
91
116
  };
@@ -1,98 +1,153 @@
1
- import { computed as A, unref as a, ref as y, watch as g } from "vue";
2
- const T = ["confirmed", "unconfirmed"];
3
- function w(n) {
4
- return T.includes(n);
1
+ import { computed as A, unref as C, ref as E, watch as T } from "vue";
2
+ const N = ["confirmed", "unconfirmed"], R = "not_found";
3
+ function k(n) {
4
+ return N.includes(n);
5
5
  }
6
- function B(n) {
6
+ function L(n) {
7
7
  const e = n == null ? void 0 : n.status;
8
- return w(e) ? `status-${e}` : null;
8
+ return k(e) ? `status-${e}` : null;
9
9
  }
10
- function C(n) {
10
+ function S(n) {
11
11
  return (n == null ? void 0 : n.status) === "confirmed";
12
12
  }
13
- function E(n) {
13
+ function a(n) {
14
14
  return (n == null ? void 0 : n.status) === "unconfirmed";
15
15
  }
16
- function O(n) {
17
- return E(n);
16
+ function y(n) {
17
+ return Array.isArray(n == null ? void 0 : n.canonResolveStates) ? n.canonResolveStates : [];
18
18
  }
19
- function d(n, e) {
20
- return e || C(n);
19
+ function I(n) {
20
+ return String(n ?? "").toLowerCase() === R;
21
21
  }
22
- function U(n, e) {
23
- return d(n, e) ? e ? "selected-indicator" : "confirmed-indicator" : null;
22
+ function m(n) {
23
+ return a(n) ? y(n).some(
24
+ (e) => I(e.substatus)
25
+ ) : !1;
24
26
  }
25
- function l(n, e) {
27
+ function O(n, e, c = []) {
28
+ const r = new Set(
29
+ [e, ...c].map((i) => String(i ?? "").trim()).filter(Boolean)
30
+ );
31
+ return !r.size || !a(n) ? !1 : y(n).some((i) => {
32
+ if (!I(i.substatus)) return !1;
33
+ const s = String(i.channelId ?? "").trim(), l = String(i.backendChannelId ?? "").trim();
34
+ if (!s && !l) return !1;
35
+ if (r.has(s) || r.has(l)) return !0;
36
+ for (const f of r) {
37
+ const p = f.includes(".") ? f.split(".").slice(1).join(".") : f, u = s.includes(".") ? s.split(".").slice(1).join(".") : s;
38
+ if (p && u && p === u) return !0;
39
+ }
40
+ return !1;
41
+ });
42
+ }
43
+ function U(n, e, c, r, i = []) {
44
+ return O(n, e, i) ? "unconfirmed" : c ? h(n, r) ? "spinner" : "check" : null;
45
+ }
46
+ function j(n) {
47
+ return a(n);
48
+ }
49
+ function v(n, e) {
50
+ return e || S(n) || m(n);
51
+ }
52
+ function _(n, e) {
53
+ return a(n) ? !1 : e || S(n);
54
+ }
55
+ function M(n) {
56
+ return m(n);
57
+ }
58
+ function x(n, e) {
59
+ return m(n) ? "unconfirmed-indicator" : _(n, e) ? e ? "selected-indicator" : "confirmed-indicator" : null;
60
+ }
61
+ function h(n, e) {
26
62
  return !e || !(n != null && n.id) ? !1 : n.id === e;
27
63
  }
28
- function S(n, e) {
64
+ function w(n, e) {
29
65
  return !(n != null && n.id) || !(e != null && e.length) ? !1 : e.includes(n.id);
30
66
  }
31
- function v(n, e) {
32
- return l(n, e.confirmingAttributeId) || d(n, e.isSelected);
67
+ function z(n, e) {
68
+ return h(n, e.confirmingAttributeId) || v(n, e.isSelected);
69
+ }
70
+ function D(n, e) {
71
+ return w(n, e.blockedAttributeIds) ? !h(n, e.confirmingAttributeId) && !v(n, e.isSelected) : !1;
33
72
  }
34
73
  function F(n, e) {
35
- return S(n, e.blockedAttributeIds) ? !l(n, e.confirmingAttributeId) && !d(n, e.isSelected) : !1;
74
+ return h(n, e.confirmingAttributeId) ? "confirming" : w(n, e.blockedAttributeIds) ? "blocked" : z(n, e) ? e.isSelected ? "selected" : S(n) ? "confirmed" : m(n) ? "unconfirmed" : null : null;
36
75
  }
37
- function z(n, e) {
38
- return l(n, e.confirmingAttributeId) ? "confirming" : S(n, e.blockedAttributeIds) ? "blocked" : v(n, e) ? e.isSelected ? "selected" : C(n) ? "confirmed" : null : null;
76
+ function K(n, e, c) {
77
+ const r = F(n, c);
78
+ return !r || !e ? "" : e[r] ?? "";
39
79
  }
40
- function L(n, e, c) {
41
- const s = z(n, c);
42
- return !s || !e ? "" : e[s] ?? "";
80
+ function V(n, e, c, r, i = []) {
81
+ const s = U(
82
+ n,
83
+ e,
84
+ c,
85
+ r,
86
+ i
87
+ );
88
+ return s ? s === "spinner" ? "confirming-indicator" : s === "unconfirmed" ? "unconfirmed-indicator" : "selected-indicator" : null;
43
89
  }
44
- function _({
90
+ function $({
45
91
  contactAttributes: n,
46
92
  panelChannelTypes: e,
47
93
  frozenAttribute: c
48
94
  }) {
49
- const s = A(() => a(n) ?? []), f = A(() => a(e) ?? []), m = (o) => Object.fromEntries(o.map((i) => [i, []])), p = y(
50
- m(f.value)
51
- ), t = () => {
52
- const o = f.value, i = m(o), u = new Set(o);
53
- s.value.forEach((r) => {
54
- if (!(!r || !r.type)) {
55
- if (r.type === "telegram") {
56
- u.has("telegram") && i.telegram.push(r);
95
+ const r = A(() => C(n) ?? []), i = A(() => C(e) ?? []), s = (u) => Object.fromEntries(u.map((o) => [o, []])), l = E(
96
+ s(i.value)
97
+ ), f = () => {
98
+ const u = i.value, o = s(u), d = new Set(u);
99
+ r.value.forEach((t) => {
100
+ if (!(!t || !t.type)) {
101
+ if (t.type === "telegram") {
102
+ d.has("telegram") && o.telegram.push(t);
57
103
  return;
58
104
  }
59
- if (r.type === "max") {
60
- u.has("max") && i.max.push(r);
105
+ if (t.type === "max") {
106
+ d.has("max") && o.max.push(t);
61
107
  return;
62
108
  }
63
- if (r.type === "phone") {
64
- ["whatsapp", "sms", "phone"].forEach((h) => {
65
- u.has(h) && i[h].push(r);
109
+ if (t.type === "phone") {
110
+ ["whatsapp", "sms", "phone"].forEach((g) => {
111
+ d.has(g) && o[g].push(t);
66
112
  });
67
113
  return;
68
114
  }
69
- u.has(r.type) && i[r.type] && i[r.type].push(r);
115
+ d.has(t.type) && o[t.type] && o[t.type].push(t);
70
116
  }
71
- }), p.value = i;
117
+ }), l.value = o;
72
118
  };
73
- return g(s, t, { deep: !0, immediate: !0 }), g(f, t), {
74
- organizedContactAttributes: p,
75
- organizeContactAttributes: t,
76
- isAttributeFrozen: (o) => {
77
- const i = c.value;
78
- return !o || !(i != null && i.id) ? !1 : o.id === i.id;
119
+ return T(r, f, { deep: !0, immediate: !0 }), T(i, f), {
120
+ organizedContactAttributes: l,
121
+ organizeContactAttributes: f,
122
+ isAttributeFrozen: (u) => {
123
+ const o = c.value;
124
+ return !u || !(o != null && o.id) ? !1 : u.id === o.id;
79
125
  }
80
126
  };
81
127
  }
82
128
  export {
83
- T as CONTACT_ATTRIBUTE_STATUSES,
84
- U as getAttributeCheckIndicatorClass,
85
- z as getAttributeIndicatorTooltipKey,
86
- L as getAttributeIndicatorTooltipText,
87
- B as getAttributeStatusClass,
88
- S as isAttributeBlocked,
89
- C as isAttributeConfirmed,
90
- l as isAttributeConfirming,
91
- E as isAttributeUnconfirmed,
92
- w as isContactAttributeStatus,
93
- O as needsAttributeConfirmation,
94
- d as shouldShowAttributeCheckmark,
95
- v as shouldShowAttributeIndicator,
96
- F as shouldShowBlockedIndicatorSlot,
97
- _ as useCommunicationAttributes
129
+ R as CANON_RESOLVE_SUBSTATUS_NOT_FOUND,
130
+ N as CONTACT_ATTRIBUTE_STATUSES,
131
+ y as getAttributeCanonResolveStates,
132
+ x as getAttributeCheckIndicatorClass,
133
+ F as getAttributeIndicatorTooltipKey,
134
+ K as getAttributeIndicatorTooltipText,
135
+ L as getAttributeStatusClass,
136
+ V as getSubMenuChannelIndicatorClass,
137
+ U as getSubMenuChannelIndicatorType,
138
+ m as hasCanonResolveNotFound,
139
+ w as isAttributeBlocked,
140
+ S as isAttributeConfirmed,
141
+ h as isAttributeConfirming,
142
+ a as isAttributeUnconfirmed,
143
+ I as isCanonResolveSubstatusNotFound,
144
+ O as isChannelCanonResolveNotFound,
145
+ k as isContactAttributeStatus,
146
+ j as needsAttributeConfirmation,
147
+ _ as shouldShowAttributeCheckmark,
148
+ z as shouldShowAttributeIndicator,
149
+ v as shouldShowAttributeStatusIndicator,
150
+ M as shouldShowAttributeUnconfirmedIndicator,
151
+ D as shouldShowBlockedIndicatorSlot,
152
+ $ as useCommunicationAttributes
98
153
  };
@@ -1,5 +1,5 @@
1
1
  import { computed as c, unref as i } from "vue";
2
- /* empty css */
2
+ /* empty css */
3
3
  import M from "../icons/CommunicationPanelPhoneIcon.vue.js";
4
4
  import b from "../icons/CommunicationPanelWhatsAppIcon.vue.js";
5
5
  import w from "../icons/CommunicationPanelTelegramIcon.vue.js";
@@ -1,31 +1,45 @@
1
- import { ref as n } from "vue";
2
- function C({
3
- panelRef: c,
4
- selectedChannelType: i,
5
- frozenAttribute: t
1
+ import { ref as l, nextTick as f } from "vue";
2
+ function M({
3
+ panelRef: v,
4
+ selectedChannelType: d,
5
+ frozenAttribute: c
6
6
  }) {
7
- const l = n(null), v = n(null), u = n(!1), a = n(!1), s = () => {
8
- u.value = !1, l.value = null, t.value = null, a.value = !1;
7
+ const n = l(null), h = l(null), u = l(!1), a = l(!1), s = l(!1), t = () => {
8
+ u.value = !1, n.value = null, c.value = null, a.value = !1;
9
+ }, C = () => {
10
+ s.value = !0, f(() => {
11
+ f(() => {
12
+ s.value = !1;
13
+ });
14
+ });
15
+ }, i = (e) => {
16
+ n.value = e, u.value = !0, a.value = !1, c.value = null, C();
9
17
  };
10
18
  return {
11
- activeChannelType: l,
12
- hoveredChannel: v,
19
+ activeChannelType: n,
20
+ hoveredChannel: h,
13
21
  showMenu: u,
14
22
  showSubMenu: a,
15
23
  handleChannelClick: (e) => {
16
- if (i.value === e && l.value === e) {
17
- s();
24
+ if (d.value === e && n.value === e) {
25
+ t();
18
26
  return;
19
27
  }
20
- l.value = e, u.value = !0, a.value = !1, t.value = null;
28
+ i(e);
21
29
  },
22
- closeMenu: s,
30
+ openMenu: i,
31
+ closeMenu: t,
23
32
  handleClickOutside: (e) => {
24
- const o = c.value;
25
- o && !o.contains(e.target) && s();
33
+ if (s.value)
34
+ return;
35
+ const o = v.value;
36
+ if (!o)
37
+ return;
38
+ const r = typeof e.composedPath == "function" ? e.composedPath() : [];
39
+ Array.isArray(r) && r.includes(o) || o.contains(e.target) || t();
26
40
  }
27
41
  };
28
42
  }
29
43
  export {
30
- C as useCommunicationMenu
44
+ M as useCommunicationMenu
31
45
  };
@@ -0,0 +1,47 @@
1
+ import { isAttributeUnconfirmed as f, needsAttributeConfirmation as d } from "./useCommunicationAttributes.js";
2
+ const c = /* @__PURE__ */ new Set(["whatsapp", "telegram", "max", "sms"]);
3
+ function h(t) {
4
+ return c.has(t);
5
+ }
6
+ function a(t, n) {
7
+ if (!n || !t.length)
8
+ return;
9
+ const l = n.includes(".") ? n.split(".").pop() : n;
10
+ return t.find((r) => {
11
+ const i = r.id ?? r.attributeId;
12
+ return !i || typeof i != "string" ? !1 : i === n || i === l || i.endsWith(`.${l}`);
13
+ });
14
+ }
15
+ function m(t, n, l, r) {
16
+ const i = r(t);
17
+ if (n != null && n.channelId) {
18
+ const s = i.find((e) => e.channelId === n.channelId);
19
+ if (s)
20
+ return s.channelId;
21
+ }
22
+ if (i.length === 1)
23
+ return i[0].channelId;
24
+ const o = l(t);
25
+ return (o == null ? void 0 : o.channelId) ?? null;
26
+ }
27
+ function I(t, n, l, r, i) {
28
+ if (!h(t))
29
+ return null;
30
+ const o = n == null ? void 0 : n[t], s = m(
31
+ t,
32
+ o,
33
+ r,
34
+ i
35
+ );
36
+ if (!s)
37
+ return null;
38
+ const e = l[t] ?? [];
39
+ if (e.some(f))
40
+ return null;
41
+ const u = a(e, o == null ? void 0 : o.attributeId) ?? (e.length === 1 ? e[0] : void 0);
42
+ return !u || d(u) ? null : { attribute: u, channelId: s };
43
+ }
44
+ export {
45
+ h as isOneClickChannelType,
46
+ I as resolveRecentChannelSelection
47
+ };
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as n, openBlock as e } from "vue";
2
- /* empty css */
2
+ /* empty css */
3
3
  import o from "../../../../_virtual/_plugin-vue_export-helper.js";
4
4
  const r = {}, t = {
5
5
  class: "communication-panel-confirm-spinner",
@@ -0,0 +1,19 @@
1
+ import { createElementBlock as t, openBlock as i, createStaticVNode as e } from "vue";
2
+ import n from "../../../../_virtual/_plugin-vue_export-helper.js";
3
+ const o = {}, c = {
4
+ width: "16",
5
+ height: "16",
6
+ viewBox: "0 0 16 16",
7
+ fill: "none",
8
+ xmlns: "http://www.w3.org/2000/svg",
9
+ "aria-hidden": "true"
10
+ };
11
+ function r(l, C) {
12
+ return i(), t("svg", c, [...C[0] || (C[0] = [
13
+ e('<g clip-path="url(#communication-panel-unconfirmed-icon-clip)"><path d="M8 15C6.14348 15 4.36301 14.2625 3.05025 12.9497C1.7375 11.637 1 9.85652 1 8C1 6.14348 1.7375 4.36301 3.05025 3.05025C4.36301 1.7375 6.14348 1 8 1C9.85652 1 11.637 1.7375 12.9497 3.05025C14.2625 4.36301 15 6.14348 15 8C15 9.85652 14.2625 11.637 12.9497 12.9497C11.637 14.2625 9.85652 15 8 15ZM8 16C10.1217 16 12.1566 15.1571 13.6569 13.6569C15.1571 12.1566 16 10.1217 16 8C16 5.87827 15.1571 3.84344 13.6569 2.34315C12.1566 0.842855 10.1217 0 8 0C5.87827 0 3.84344 0.842855 2.34315 2.34315C0.842855 3.84344 0 5.87827 0 8C0 10.1217 0.842855 12.1566 2.34315 13.6569C3.84344 15.1571 5.87827 16 8 16Z" fill="#F84932"></path><path d="M7 10.9991C7 10.8678 7.02587 10.7378 7.07612 10.6165C7.12638 10.4951 7.20003 10.3849 7.29289 10.292C7.38575 10.1992 7.49599 10.1255 7.61732 10.0753C7.73864 10.025 7.86868 9.99914 8 9.99914C8.13132 9.99914 8.26136 10.025 8.38268 10.0753C8.50401 10.1255 8.61425 10.1992 8.70711 10.292C8.79997 10.3849 8.87362 10.4951 8.92388 10.6165C8.97413 10.7378 9 10.8678 9 10.9991C9 11.2644 8.89464 11.5187 8.70711 11.7062C8.51957 11.8938 8.26522 11.9991 8 11.9991C7.73478 11.9991 7.48043 11.8938 7.29289 11.7062C7.10536 11.5187 7 11.2644 7 10.9991ZM7.098 4.99414C7.08468 4.86798 7.09804 4.74043 7.1372 4.61977C7.17636 4.4991 7.24045 4.38802 7.32532 4.29373C7.41018 4.19943 7.51392 4.12403 7.62981 4.07242C7.7457 4.02081 7.87114 3.99414 7.998 3.99414C8.12486 3.99414 8.2503 4.02081 8.36619 4.07242C8.48208 4.12403 8.58582 4.19943 8.67068 4.29373C8.75555 4.38802 8.81964 4.4991 8.8588 4.61977C8.89796 4.74043 8.91132 4.86798 8.898 4.99414L8.548 8.50114C8.53624 8.63891 8.4732 8.76725 8.37136 8.86078C8.26951 8.9543 8.13627 9.00619 7.998 9.00619C7.85973 9.00619 7.72649 8.9543 7.62464 8.86078C7.5228 8.76725 7.45976 8.63891 7.448 8.50114L7.098 4.99414Z" fill="#F84932"></path></g><defs><clipPath id="communication-panel-unconfirmed-icon-clip"><rect width="16" height="16" fill="white"></rect></clipPath></defs>', 2)
14
+ ])]);
15
+ }
16
+ const d = /* @__PURE__ */ n(o, [["render", r]]);
17
+ export {
18
+ d as default
19
+ };