@_solaris/messenger-widget 0.5.4 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/messenger.js CHANGED
@@ -1,4 +1,4 @@
1
- import { reactive as Fe, openBlock as c, createElementBlock as u, normalizeStyle as z, normalizeClass as O, toDisplayString as v, resolveComponent as E, createVNode as V, Transition as Ue, withCtx as je, Fragment as L, renderList as U, withKeys as ue, withModifiers as Y, createElementVNode as o, createCommentVNode as w, createBlock as N, withDirectives as K, vModelText as X, createTextVNode as pe, resolveDynamicComponent as De, renderSlot as Pe, vModelCheckbox as qe, vModelSelect as ze, markRaw as ke } from "vue";
1
+ import { reactive as Fe, openBlock as c, createElementBlock as u, normalizeStyle as z, normalizeClass as O, toDisplayString as v, resolveComponent as L, createVNode as V, Transition as Ue, withCtx as je, Fragment as E, renderList as U, withKeys as ue, withModifiers as Y, createElementVNode as o, createCommentVNode as w, createBlock as N, withDirectives as K, vModelText as X, createTextVNode as pe, resolveDynamicComponent as De, renderSlot as Pe, vModelCheckbox as qe, vModelSelect as ze, markRaw as ke } from "vue";
2
2
  const He = [
3
3
  "connected",
4
4
  "message",
@@ -1106,7 +1106,7 @@ function Ae(e, t) {
1106
1106
  const n = e.options.find((i) => (i == null ? void 0 : i.value) === t);
1107
1107
  return (n == null ? void 0 : n.label) || t;
1108
1108
  }
1109
- function Le(e, t, n) {
1109
+ function Ee(e, t, n) {
1110
1110
  return Array.isArray(t) ? t.map((i) => Ae(e, String(i))).join(", ") : typeof t == "boolean" ? n(t ? "common.yes" : "common.no") : Ae(e, String(t));
1111
1111
  }
1112
1112
  function tt(e, t, n = j()) {
@@ -1116,7 +1116,7 @@ function tt(e, t, n = j()) {
1116
1116
  if (!(s != null && s.key) || !(s != null && s.label)) continue;
1117
1117
  const a = t[s.key];
1118
1118
  if (a == null || a === "") continue;
1119
- const l = Le(s, a, n);
1119
+ const l = Ee(s, a, n);
1120
1120
  l && r.push(`${s.label} :
1121
1121
  ${l}`);
1122
1122
  }
@@ -1130,7 +1130,7 @@ function nt(e, t, n = j()) {
1130
1130
  if (!(s != null && s.key) || !(s != null && s.label)) continue;
1131
1131
  const a = t == null ? void 0 : t[s.key];
1132
1132
  if (a == null || a === "") continue;
1133
- const l = Le(s, a, n);
1133
+ const l = Ee(s, a, n);
1134
1134
  if (!l) continue;
1135
1135
  const p = s.type === "textarea" || typeof l == "string" && (l.length > 60 || l.includes(`
1136
1136
  `));
@@ -1665,9 +1665,9 @@ function wt(e, t, n, i, r, s) {
1665
1665
  }, v(s.initials), 5))
1666
1666
  ], 6);
1667
1667
  }
1668
- const Ee = /* @__PURE__ */ R(vt, [["render", wt], ["__scopeId", "data-v-14e10c0d"]]), bt = 3, kt = {
1668
+ const Le = /* @__PURE__ */ R(vt, [["render", wt], ["__scopeId", "data-v-14e10c0d"]]), bt = 3, kt = {
1669
1669
  name: "WmLauncher",
1670
- components: { HumanAvatar: Ee },
1670
+ components: { HumanAvatar: Le },
1671
1671
  inject: {
1672
1672
  // Translator shared by the Messenger shell; French fallback when
1673
1673
  // the component is used standalone.
@@ -1691,9 +1691,9 @@ const Ee = /* @__PURE__ */ R(vt, [["render", wt], ["__scopeId", "data-v-14e10c0d
1691
1691
  return this.peeks.slice(0, bt).reverse();
1692
1692
  }
1693
1693
  }
1694
- }, Ct = { class: "wm-launcherWrap" }, At = ["aria-label", "onClick", "onKeydown"], St = ["aria-label", "onClick"], Mt = { class: "wm-peek__avatar" }, Tt = ["aria-label"], xt = { class: "wm-peek__body" }, Ot = { class: "wm-peek__head" }, It = { class: "wm-peek__name" }, Lt = { class: "wm-peek__action" }, Et = { class: "wm-peek__text" }, Bt = ["onClick"], Rt = ["aria-label"], Nt = ["aria-label"];
1694
+ }, Ct = { class: "wm-launcherWrap" }, At = ["aria-label", "onClick", "onKeydown"], St = ["aria-label", "onClick"], Mt = { class: "wm-peek__avatar" }, Tt = ["aria-label"], xt = { class: "wm-peek__body" }, Ot = { class: "wm-peek__head" }, It = { class: "wm-peek__name" }, Et = { class: "wm-peek__action" }, Lt = { class: "wm-peek__text" }, Bt = ["onClick"], Rt = ["aria-label"], Nt = ["aria-label"];
1695
1695
  function Ft(e, t, n, i, r, s) {
1696
- const a = E("HumanAvatar");
1696
+ const a = L("HumanAvatar");
1697
1697
  return c(), u("div", Ct, [
1698
1698
  V(Ue, { name: "wm-peek" }, {
1699
1699
  default: je(() => [
@@ -1701,7 +1701,7 @@ function Ft(e, t, n, i, r, s) {
1701
1701
  key: 0,
1702
1702
  class: O(["wm-peekStack", { "wm-peekStack--multi": s.visiblePeeks.length > 1 }])
1703
1703
  }, [
1704
- (c(!0), u(L, null, U(s.visiblePeeks, (l, p) => (c(), u("div", {
1704
+ (c(!0), u(E, null, U(s.visiblePeeks, (l, p) => (c(), u("div", {
1705
1705
  key: l.convId,
1706
1706
  class: "wm-peek",
1707
1707
  style: z({
@@ -1754,9 +1754,9 @@ function Ft(e, t, n, i, r, s) {
1754
1754
  o("div", xt, [
1755
1755
  o("div", Ot, [
1756
1756
  o("span", It, v(l.senderName || s.t("common.agent")), 1),
1757
- o("span", Lt, v(s.t("launcher.repliedToYou")), 1)
1757
+ o("span", Et, v(s.t("launcher.repliedToYou")), 1)
1758
1758
  ]),
1759
- o("p", Et, v(l.preview), 1)
1759
+ o("p", Lt, v(l.preview), 1)
1760
1760
  ]),
1761
1761
  o("button", {
1762
1762
  type: "button",
@@ -1925,7 +1925,7 @@ function Gt(e, t, n, i, r, s) {
1925
1925
  class: "wm-team__stack",
1926
1926
  style: z({ width: s.stackWidth + "px" })
1927
1927
  }, [
1928
- (c(!0), u(L, null, U(n.members.slice(0, 3), (a, l) => (c(), u("div", {
1928
+ (c(!0), u(E, null, U(n.members.slice(0, 3), (a, l) => (c(), u("div", {
1929
1929
  key: l,
1930
1930
  class: "wm-team__pill",
1931
1931
  style: z({
@@ -1991,7 +1991,7 @@ const Yt = /* @__PURE__ */ R(Ht, [["render", Gt], ["__scopeId", "data-v-e49a9063
1991
1991
  class: "wm-header__fill"
1992
1992
  }, rn = { class: "wm-header__actions" }, an = ["aria-label", "title"], on = ["aria-label", "title"];
1993
1993
  function ln(e, t, n, i, r, s) {
1994
- const a = E("AIAvatar"), l = E("TeamAvatars");
1994
+ const a = L("AIAvatar"), l = L("TeamAvatars");
1995
1995
  return c(), u("div", Qt, [
1996
1996
  n.showBack ? (c(), u("button", {
1997
1997
  key: 0,
@@ -2014,7 +2014,7 @@ function ln(e, t, n, i, r, s) {
2014
2014
  o("path", { d: "M19 12H5M12 5l-7 7 7 7" })
2015
2015
  ], -1)
2016
2016
  ])], 8, Xt)) : (c(), u("div", Zt)),
2017
- n.showIdentity ? (c(), u(L, { key: 2 }, [
2017
+ n.showIdentity ? (c(), u(E, { key: 2 }, [
2018
2018
  o("div", en, [
2019
2019
  V(a, {
2020
2020
  size: 30,
@@ -2273,7 +2273,7 @@ const Te = {
2273
2273
  }, In = {
2274
2274
  key: 1,
2275
2275
  class: "wm-onb__section"
2276
- }, Ln = { class: "wm-onb__section-title" }, En = { class: "wm-onb__search" }, Bn = ["placeholder", "aria-label"], Rn = { class: "wm-onb__list" }, Nn = ["onClick"], Fn = ["aria-label"], Un = { class: "wm-onb__thread-body" }, jn = { class: "wm-onb__thread-title" }, Dn = ["innerHTML"], Pn = { class: "wm-onb__thread-meta" }, qn = {
2276
+ }, En = { class: "wm-onb__section-title" }, Ln = { class: "wm-onb__search" }, Bn = ["placeholder", "aria-label"], Rn = { class: "wm-onb__list" }, Nn = ["onClick"], Fn = ["aria-label"], Un = { class: "wm-onb__thread-body" }, jn = { class: "wm-onb__thread-title" }, Dn = ["innerHTML"], Pn = { class: "wm-onb__thread-meta" }, qn = {
2277
2277
  key: 0,
2278
2278
  class: "wm-onb__thread-time"
2279
2279
  }, zn = {
@@ -2281,7 +2281,7 @@ const Te = {
2281
2281
  class: "wm-onb__empty"
2282
2282
  };
2283
2283
  function Hn(e, t, n, i, r, s) {
2284
- const a = E("AIAvatar");
2284
+ const a = L("AIAvatar");
2285
2285
  return c(), u("div", fn, [
2286
2286
  o("div", _n, [
2287
2287
  t[2] || (t[2] = o("svg", {
@@ -2357,7 +2357,7 @@ function Hn(e, t, n, i, r, s) {
2357
2357
  o("div", {
2358
2358
  class: O(s.quickLinksLayout)
2359
2359
  }, [
2360
- (c(!0), u(L, null, U(n.quickLinks, (l, p) => (c(), u("button", {
2360
+ (c(!0), u(E, null, U(n.quickLinks, (l, p) => (c(), u("button", {
2361
2361
  key: p,
2362
2362
  type: "button",
2363
2363
  class: O(["wm-onb__card", { "wm-onb__card--row": s.isOddQuickLinks }]),
@@ -2378,8 +2378,8 @@ function Hn(e, t, n, i, r, s) {
2378
2378
  ], 2)
2379
2379
  ])) : w("", !0),
2380
2380
  n.openThreads.length ? (c(), u("div", In, [
2381
- o("div", Ln, v(s.t("onboarding.recentConversations")), 1),
2382
- o("div", En, [
2381
+ o("div", En, v(s.t("onboarding.recentConversations")), 1),
2382
+ o("div", Ln, [
2383
2383
  t[4] || (t[4] = o("span", { class: "wm-onb__searchIcon" }, [
2384
2384
  o("svg", {
2385
2385
  width: "12",
@@ -2405,7 +2405,7 @@ function Hn(e, t, n, i, r, s) {
2405
2405
  ])
2406
2406
  ]),
2407
2407
  o("div", Rn, [
2408
- (c(!0), u(L, null, U(s.filteredThreads, (l) => (c(), u("button", {
2408
+ (c(!0), u(E, null, U(s.filteredThreads, (l) => (c(), u("button", {
2409
2409
  key: l.id,
2410
2410
  type: "button",
2411
2411
  class: "wm-onb__thread",
@@ -2558,7 +2558,7 @@ function ts(e, t, n, i, r, s) {
2558
2558
  ]),
2559
2559
  o("span", Xn, [
2560
2560
  o("span", Zn, v(n.label), 1),
2561
- s.detailText ? (c(), u(L, { key: 0 }, [
2561
+ s.detailText ? (c(), u(E, { key: 0 }, [
2562
2562
  t[4] || (t[4] = o("span", {
2563
2563
  class: "wm-result__sep",
2564
2564
  "aria-hidden": "true"
@@ -2607,7 +2607,7 @@ function ds(e, t, n, i, r, s) {
2607
2607
  ])
2608
2608
  ]),
2609
2609
  o("div", ls, [
2610
- (c(!0), u(L, null, U(s.fields, (a, l) => (c(), u("div", {
2610
+ (c(!0), u(E, null, U(s.fields, (a, l) => (c(), u("div", {
2611
2611
  key: l,
2612
2612
  class: "wm-art__field"
2613
2613
  }, [
@@ -2674,7 +2674,7 @@ function Cs(e, t, n, i, r, s) {
2674
2674
  ]),
2675
2675
  s.hasBody ? (c(), u("div", ws, [
2676
2676
  n.data.body ? (c(), u("div", bs, v(n.data.body), 1)) : w("", !0),
2677
- s.fields.length ? (c(!0), u(L, { key: 1 }, U(s.fields, (a, l) => (c(), u("div", {
2677
+ s.fields.length ? (c(!0), u(E, { key: 1 }, U(s.fields, (a, l) => (c(), u("div", {
2678
2678
  key: l,
2679
2679
  class: "wm-art__field"
2680
2680
  }, [
@@ -2750,7 +2750,7 @@ const Ms = {
2750
2750
  return /high|haute|élev|elev|critic|critiq|urgent/.test(t) ? 3 : /low|basse|faible|minor/.test(t) ? 1 : 2;
2751
2751
  }
2752
2752
  }
2753
- }, Ts = { class: "wm-art wm-art--ticket" }, xs = { class: "wm-art__head wm-tk__head" }, Os = { class: "wm-art__title wm-tk__title" }, Is = { class: "wm-tk__sub" }, Ls = { class: "wm-tk__ref" }, Es = {
2753
+ }, Ts = { class: "wm-art wm-art--ticket" }, xs = { class: "wm-art__head wm-tk__head" }, Os = { class: "wm-art__title wm-tk__title" }, Is = { class: "wm-tk__sub" }, Es = { class: "wm-tk__ref" }, Ls = {
2754
2754
  key: 0,
2755
2755
  class: "wm-tk__text"
2756
2756
  }, Bs = {
@@ -2777,7 +2777,7 @@ function js(e, t, n, i, r, s) {
2777
2777
  o("div", xs, [
2778
2778
  o("div", Os, v(n.data.title), 1),
2779
2779
  o("div", Is, [
2780
- o("div", Ls, [
2780
+ o("div", Es, [
2781
2781
  t[0] || (t[0] = o("svg", {
2782
2782
  width: "11",
2783
2783
  height: "11",
@@ -2808,10 +2808,10 @@ function js(e, t, n, i, r, s) {
2808
2808
  pe(" " + v(n.data.status.label), 1)
2809
2809
  ], 2)
2810
2810
  ]),
2811
- n.data.body ? (c(), u("div", Es, v(n.data.body), 1)) : w("", !0)
2811
+ n.data.body ? (c(), u("div", Ls, v(n.data.body), 1)) : w("", !0)
2812
2812
  ]),
2813
2813
  s.fields.length ? (c(), u("div", Bs, [
2814
- (c(!0), u(L, null, U(s.fields, (a, l) => (c(), u("div", {
2814
+ (c(!0), u(E, null, U(s.fields, (a, l) => (c(), u("div", {
2815
2815
  key: l,
2816
2816
  class: "wm-art__field"
2817
2817
  }, [
@@ -3096,7 +3096,7 @@ const dr = {
3096
3096
  name: "WmMessageList",
3097
3097
  components: {
3098
3098
  AIAvatar: le,
3099
- HumanAvatar: Ee,
3099
+ HumanAvatar: Le,
3100
3100
  Bubble: ir,
3101
3101
  Typing: cr,
3102
3102
  ActionResult: ns,
@@ -3639,8 +3639,8 @@ const dr = {
3639
3639
  key: 3,
3640
3640
  class: "wm-list__row wm-list__row--ai fade-up"
3641
3641
  }, Ir = { class: "wm-list__avatarSlot" };
3642
- function Lr(e, t, n, i, r, s) {
3643
- const a = E("AIAvatar"), l = E("HumanAvatar"), p = E("ActionResult"), C = E("ArtifactRenderer"), k = E("Bubble"), x = E("AttachmentPreview"), B = E("Typing");
3642
+ function Er(e, t, n, i, r, s) {
3643
+ const a = L("AIAvatar"), l = L("HumanAvatar"), p = L("ActionResult"), C = L("ArtifactRenderer"), k = L("Bubble"), x = L("AttachmentPreview"), B = L("Typing");
3644
3644
  return c(), u("div", {
3645
3645
  ref: "scrollEl",
3646
3646
  class: O(["wm-list", { "wm-list--silent": r.silentFades }]),
@@ -3658,7 +3658,7 @@ function Lr(e, t, n, i, r, s) {
3658
3658
  o("span", vr, v(n.dateLabel), 1),
3659
3659
  t[3] || (t[3] = o("div", { class: "wm-list__line" }, null, -1))
3660
3660
  ])) : w("", !0),
3661
- (c(!0), u(L, null, U(s.groups, (A, H) => (c(), u(L, {
3661
+ (c(!0), u(E, null, U(s.groups, (A, H) => (c(), u(E, {
3662
3662
  key: A.key
3663
3663
  }, [
3664
3664
  A.key === s.unreadGroupKey ? (c(), u("div", yr, [
@@ -3674,8 +3674,8 @@ function Lr(e, t, n, i, r, s) {
3674
3674
  t[6] || (t[6] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
3675
3675
  o("span", kr, v(A.systemLabel), 1),
3676
3676
  t[7] || (t[7] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
3677
- ])) : (c(), u(L, { key: 1 }, [
3678
- (c(!0), u(L, null, U(A.items, (M, D) => (c(), u("div", {
3677
+ ])) : (c(), u(E, { key: 1 }, [
3678
+ (c(!0), u(E, null, U(A.items, (M, D) => (c(), u("div", {
3679
3679
  key: `${s.messageKey(M.message)}-${M.partKey}`,
3680
3680
  "data-row-key": `${s.messageKey(M.message)}-${M.partKey}`,
3681
3681
  class: O(["wm-list__row fade-up", [
@@ -3688,7 +3688,7 @@ function Lr(e, t, n, i, r, s) {
3688
3688
  style: z(s.cornersStyle(A, D))
3689
3689
  }, [
3690
3690
  A.role !== "user" ? (c(), u("div", Ar, [
3691
- D === A.items.length - 1 ? (c(), u(L, { key: 0 }, [
3691
+ D === A.items.length - 1 ? (c(), u(E, { key: 0 }, [
3692
3692
  A.role === "ai" ? (c(), N(a, {
3693
3693
  key: 0,
3694
3694
  size: 26,
@@ -3732,7 +3732,7 @@ function Lr(e, t, n, i, r, s) {
3732
3732
  "wm-list__atts--align-end": A.role === "user"
3733
3733
  }])
3734
3734
  }, [
3735
- (c(!0), u(L, null, U(s.attachmentsOf(
3735
+ (c(!0), u(E, null, U(s.attachmentsOf(
3736
3736
  M.message
3737
3737
  ), (F, q) => (c(), N(x, {
3738
3738
  key: `${s.messageKey(M.message)}-att-${q}`,
@@ -3765,7 +3765,7 @@ function Lr(e, t, n, i, r, s) {
3765
3765
  ])) : w("", !0)
3766
3766
  ], 34);
3767
3767
  }
3768
- const Er = /* @__PURE__ */ R(hr, [["render", Lr], ["__scopeId", "data-v-d769b193"]]), me = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", be = typeof window < "u" && typeof window.MediaRecorder < "u";
3768
+ const Lr = /* @__PURE__ */ R(hr, [["render", Er], ["__scopeId", "data-v-d769b193"]]), me = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", be = typeof window < "u" && typeof window.MediaRecorder < "u";
3769
3769
  function Br() {
3770
3770
  return be && [
3771
3771
  "video/webm;codecs=vp9,opus",
@@ -4079,7 +4079,7 @@ function Qr(e, t, n, i, r, s) {
4079
4079
  onClick: t[2] || (t[2] = (a) => r.attachOpen = !1)
4080
4080
  })) : w("", !0),
4081
4081
  r.attachOpen ? (c(), u("div", zr, [
4082
- (c(!0), u(L, null, U(s.attachItems, (a) => (c(), u("button", {
4082
+ (c(!0), u(E, null, U(s.attachItems, (a) => (c(), u("button", {
4083
4083
  key: a.action,
4084
4084
  type: "button",
4085
4085
  class: "wm-compose__menuItem",
@@ -4183,7 +4183,7 @@ function ti(e, t, n, i, r, s) {
4183
4183
  key: s.batchKey,
4184
4184
  class: "wm-chips"
4185
4185
  }, [
4186
- (c(!0), u(L, null, U(n.items, (a, l) => (c(), u("button", {
4186
+ (c(!0), u(E, null, U(n.items, (a, l) => (c(), u("button", {
4187
4187
  key: l,
4188
4188
  type: "button",
4189
4189
  class: "wm-chip",
@@ -4241,7 +4241,7 @@ const ni = /* @__PURE__ */ R(Zr, [["render", ti], ["__scopeId", "data-v-47ad8085
4241
4241
  class: "wm-approval__detail"
4242
4242
  }, di = { class: "wm-approval__actions" };
4243
4243
  function ui(e, t, n, i, r, s) {
4244
- const a = E("AIAvatar");
4244
+ const a = L("AIAvatar");
4245
4245
  return c(), u("div", ri, [
4246
4246
  o("div", ii, [
4247
4247
  o("div", ai, [
@@ -4378,7 +4378,7 @@ const hi = /* @__PURE__ */ new Set([
4378
4378
  }, xi = ["id", "onUpdate:modelValue", "disabled"], Oi = ["id", "onUpdate:modelValue", "required", "disabled"], Ii = {
4379
4379
  value: "",
4380
4380
  disabled: ""
4381
- }, Li = ["value"], Ei = {
4381
+ }, Ei = ["value"], Li = {
4382
4382
  key: 6,
4383
4383
  class: "wm-form__multi"
4384
4384
  }, Bi = ["value", "checked", "disabled", "onChange"], Ri = {
@@ -4393,7 +4393,7 @@ const hi = /* @__PURE__ */ new Set([
4393
4393
  class: "wm-form__doneLbl"
4394
4394
  };
4395
4395
  function ji(e, t, n, i, r, s) {
4396
- const a = E("AIAvatar");
4396
+ const a = L("AIAvatar");
4397
4397
  return c(), u("div", _i, [
4398
4398
  o("div", gi, [
4399
4399
  o("div", pi, [
@@ -4412,7 +4412,7 @@ function ji(e, t, n, i, r, s) {
4412
4412
  class: "wm-form__body",
4413
4413
  onSubmit: t[0] || (t[0] = Y((...l) => s.onSubmit && s.onSubmit(...l), ["prevent"]))
4414
4414
  }, [
4415
- (c(!0), u(L, null, U(s.normalizedFields, (l) => (c(), u("div", {
4415
+ (c(!0), u(E, null, U(s.normalizedFields, (l) => (c(), u("div", {
4416
4416
  key: l.key,
4417
4417
  class: "wm-form__field"
4418
4418
  }, [
@@ -4490,14 +4490,14 @@ function ji(e, t, n, i, r, s) {
4490
4490
  disabled: n.readOnly || r.busy
4491
4491
  }, [
4492
4492
  o("option", Ii, v(l.placeholder || s.t("form.choose")), 1),
4493
- (c(!0), u(L, null, U(l.options, (p) => (c(), u("option", {
4493
+ (c(!0), u(E, null, U(l.options, (p) => (c(), u("option", {
4494
4494
  key: p.value,
4495
4495
  value: p.value
4496
- }, v(p.label), 9, Li))), 128))
4496
+ }, v(p.label), 9, Ei))), 128))
4497
4497
  ], 8, Oi)), [
4498
4498
  [ze, r.values[l.key]]
4499
- ]) : l.type === "multiselect" ? (c(), u("div", Ei, [
4500
- (c(!0), u(L, null, U(l.options, (p) => (c(), u("label", {
4499
+ ]) : l.type === "multiselect" ? (c(), u("div", Li, [
4500
+ (c(!0), u(E, null, U(l.options, (p) => (c(), u("label", {
4501
4501
  key: p.value,
4502
4502
  class: "wm-form__multiItem"
4503
4503
  }, [
@@ -4587,11 +4587,11 @@ function Xi(e, t, n, i, r, s) {
4587
4587
  ], -1)),
4588
4588
  o("div", Ji, v(s.t("feedback.doneTitle")), 1),
4589
4589
  o("div", Qi, v(s.t("feedback.doneSubtitle")), 1)
4590
- ])) : (c(), u(L, { key: 0 }, [
4590
+ ])) : (c(), u(E, { key: 0 }, [
4591
4591
  o("div", zi, v(s.t("feedback.question")), 1),
4592
4592
  o("div", Hi, v(s.t("feedback.subtitle")), 1),
4593
4593
  o("div", $i, [
4594
- (c(!0), u(L, null, U(s.options, (a) => (c(), u("button", {
4594
+ (c(!0), u(E, null, U(s.options, (a) => (c(), u("button", {
4595
4595
  key: a.v,
4596
4596
  type: "button",
4597
4597
  class: O(["wm-fb__opt", { "is-selected": r.sel === a.v }]),
@@ -4945,7 +4945,7 @@ const Ma = /* @__PURE__ */ R(_a, [["render", Sa], ["__scopeId", "data-v-6d5f94a8
4945
4945
  Launcher: Ut,
4946
4946
  Header: cn,
4947
4947
  Onboarding: $n,
4948
- MessageList: Er,
4948
+ MessageList: Lr,
4949
4949
  Composer: Xr,
4950
4950
  SuggestionChips: ni,
4951
4951
  ApprovalCard: mi,
@@ -5430,6 +5430,18 @@ const Ma = /* @__PURE__ */ R(_a, [["render", Sa], ["__scopeId", "data-v-6d5f94a8
5430
5430
  }
5431
5431
  },
5432
5432
  watch: {
5433
+ // Notifie le snippet parent du changement open/close pour qu'il
5434
+ // resize l'iframe (sinon en sheet la hauteur est plafonnée).
5435
+ isOpen(e) {
5436
+ window.parent && window.parent !== window && window.parent.postMessage(
5437
+ {
5438
+ type: "RESIZE",
5439
+ state: e ? "open" : "closed",
5440
+ displayMode: this.displayMode
5441
+ },
5442
+ "*"
5443
+ );
5444
+ },
5433
5445
  // Prune `dismissedPeeks` entries for threads that are no longer
5434
5446
  // unread (user opened them, or a user reply cleared the unread
5435
5447
  // flag). Without this, the map would grow unbounded across a
@@ -5839,7 +5851,7 @@ const Ma = /* @__PURE__ */ R(_a, [["render", Sa], ["__scopeId", "data-v-6d5f94a8
5839
5851
  }, Oa = ["aria-label"], Ia = {
5840
5852
  key: 0,
5841
5853
  class: "wm-state"
5842
- }, La = { class: "wm-state__err" }, Ea = { class: "wm-state__errTitle" }, Ba = { class: "wm-state__errSub" }, Ra = { class: "wm-bottom" }, Na = {
5854
+ }, Ea = { class: "wm-state__err" }, La = { class: "wm-state__errTitle" }, Ba = { class: "wm-state__errSub" }, Ra = { class: "wm-bottom" }, Na = {
5843
5855
  key: 0,
5844
5856
  ref: "floatEl",
5845
5857
  class: "wm-float"
@@ -5853,7 +5865,7 @@ const Ma = /* @__PURE__ */ R(_a, [["render", Sa], ["__scopeId", "data-v-6d5f94a8
5853
5865
  class: "wm-attached"
5854
5866
  }, Da = ["aria-label", "onClick"];
5855
5867
  function Pa(e, t, n, i, r, s) {
5856
- const a = E("Launcher"), l = E("Header"), p = E("Onboarding"), C = E("MessageList"), k = E("ApprovalCard"), x = E("FormCard"), B = E("Feedback"), A = E("SuggestionChips"), H = E("Composer"), M = E("MoreMenu"), D = E("RenameDialog");
5868
+ const a = L("Launcher"), l = L("Header"), p = L("Onboarding"), C = L("MessageList"), k = L("ApprovalCard"), x = L("FormCard"), B = L("Feedback"), A = L("SuggestionChips"), H = L("Composer"), M = L("MoreMenu"), D = L("RenameDialog");
5857
5869
  return c(), u("div", {
5858
5870
  class: O(["wm-root", `wm-root--${n.displayMode}`])
5859
5871
  }, [
@@ -5901,7 +5913,7 @@ function Pa(e, t, n, i, r, s) {
5901
5913
  class: "wm-loading__spinner",
5902
5914
  "aria-hidden": "true"
5903
5915
  }, null, -1))
5904
- ])) : (c(), u(L, { key: 1 }, [
5916
+ ])) : (c(), u(E, { key: 1 }, [
5905
5917
  V(l, {
5906
5918
  title: s.headerTitle,
5907
5919
  "team-members": s.teamMembers,
@@ -5917,7 +5929,7 @@ function Pa(e, t, n, i, r, s) {
5917
5929
  onClose: s.close
5918
5930
  }, null, 8, ["title", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "agent-name", "agent-avatar-url", "onBack", "onMore", "onClose"]),
5919
5931
  s.error ? (c(), u("div", Ia, [
5920
- o("div", La, [
5932
+ o("div", Ea, [
5921
5933
  t[7] || (t[7] = o("div", { class: "wm-state__errIcon" }, [
5922
5934
  o("svg", {
5923
5935
  width: "14",
@@ -5934,11 +5946,11 @@ function Pa(e, t, n, i, r, s) {
5934
5946
  ])
5935
5947
  ], -1)),
5936
5948
  o("div", null, [
5937
- o("div", Ea, v(s.t("error.connectionFailed")), 1),
5949
+ o("div", La, v(s.t("error.connectionFailed")), 1),
5938
5950
  o("div", Ba, v(s.error), 1)
5939
5951
  ])
5940
5952
  ])
5941
- ])) : s.currentConv ? (c(), u(L, { key: 2 }, [
5953
+ ])) : s.currentConv ? (c(), u(E, { key: 2 }, [
5942
5954
  V(C, {
5943
5955
  ref: "messageList",
5944
5956
  messages: s.displayedMessages,
@@ -6021,7 +6033,7 @@ function Pa(e, t, n, i, r, s) {
6021
6033
  onSubmit: s.onRenameSubmit
6022
6034
  }, null, 8, ["initial-value", "title", "onSubmit"])) : w("", !0),
6023
6035
  r.pendingAttachments.length ? (c(), u("div", ja, [
6024
- (c(!0), u(L, null, U(r.pendingAttachments, (F, q) => (c(), u("div", {
6036
+ (c(!0), u(E, null, U(r.pendingAttachments, (F, q) => (c(), u("div", {
6025
6037
  key: q,
6026
6038
  class: "wm-attached__chip"
6027
6039
  }, [
@@ -6090,7 +6102,7 @@ function Pa(e, t, n, i, r, s) {
6090
6102
  ], 6)) : w("", !0)
6091
6103
  ], 2);
6092
6104
  }
6093
- const Ha = /* @__PURE__ */ R(Ta, [["render", Pa], ["__scopeId", "data-v-8b99fa9d"]]), $a = "0.5.4";
6105
+ const Ha = /* @__PURE__ */ R(Ta, [["render", Pa], ["__scopeId", "data-v-1c840488"]]), $a = "0.5.6";
6094
6106
  export {
6095
6107
  le as AIAvatar,
6096
6108
  _e as AVATAR_COLORS,
@@ -6108,10 +6120,10 @@ export {
6108
6120
  Zi as Feedback,
6109
6121
  Di as FormCard,
6110
6122
  cn as Header,
6111
- Ee as HumanAvatar,
6123
+ Le as HumanAvatar,
6112
6124
  Ut as Launcher,
6113
6125
  be as MEDIA_RECORDER_SUPPORTED,
6114
- Er as MessageList,
6126
+ Lr as MessageList,
6115
6127
  Ha as Messenger,
6116
6128
  fa as MoreMenu,
6117
6129
  $n as Onboarding,
package/dist/snippet.js CHANGED
@@ -1 +1 @@
1
- var Messenger=function(t){"use strict";let e=null,i="",o=null;function d(n){e&&r();const c=n.widgetId||"",S=n.baseUrl||"";i=n.widgetOrigin||S;const b=n.token||"",h=n.context&&typeof n.context=="object"?n.context:null,g=n.displayMode||"floating",u=n.language||"";if(!c||!i){console.warn("[messenger] init skipped — missing widgetId or widgetOrigin");return}const s=new URL(`${M(i)}/widget/${encodeURIComponent(c)}`);g!=="floating"&&s.searchParams.set("display_mode",g),u&&s.searchParams.set("language",u),e=document.createElement("iframe"),e.src=s.toString(),e.title="Messenger",e.setAttribute("aria-label","Messenger"),e.setAttribute("allow","clipboard-write; microphone"),e.setAttribute("data-messenger-widget",""),e.style.cssText=["position:fixed","bottom:20px","right:20px","width:380px","height:600px","max-height:calc(100vh - 40px)","border:0","z-index:2147483647","color-scheme:normal","background:transparent"].join(";"),document.body.appendChild(e);let a=!1;const f=()=>{a||!e||(a=!0,e.contentWindow.postMessage({type:"INIT",origin:window.location.origin,token:b||null,context:h||null},i))};o=m=>{var w;m.source===(e==null?void 0:e.contentWindow)&&((w=m.data)==null?void 0:w.type)==="READY"&&f()},window.addEventListener("message",o),e.addEventListener("load",f),setTimeout(()=>{a||console.warn("[messenger] iframe did not boot after",1e4,"ms — check CSP frame-ancestors and network")},1e4)}function r(){o&&(window.removeEventListener("message",o),o=null),e&&(e.remove(),e=null),i=""}function M(n){return n.endsWith("/")?n.slice(0,-1):n}const l={init:d,destroy:r};return typeof window<"u"&&(window.Messenger=l),t.default=l,t.destroy=r,t.init=d,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),t}({});
1
+ var Messenger=function(o){"use strict";let e=null,s="",r=null;function m(t){e&&l();const d=t.widgetId||"",c=t.baseUrl||"";s=t.widgetOrigin||c;const g=t.token||"",n=t.context&&typeof t.context=="object"?t.context:null,a=t.displayMode||"floating",p=t.language||"";if(!d||!s){console.warn("[messenger] init skipped — missing widgetId or widgetOrigin");return}const u=new URL(`${b(s)}/widget/${encodeURIComponent(d)}`);a!=="floating"&&u.searchParams.set("display_mode",a),p&&u.searchParams.set("language",p),e=document.createElement("iframe"),e.src=u.toString(),e.title="Messenger",e.setAttribute("aria-label","Messenger"),e.setAttribute("allow","clipboard-write; microphone"),e.setAttribute("data-messenger-widget",""),w(e,a,"closed"),document.body.appendChild(e);let f=!1;const M=()=>{f||!e||(f=!0,e.contentWindow.postMessage({type:"INIT",origin:window.location.origin,token:g||null,context:n||null},s))};r=S=>{if(S.source!==(e==null?void 0:e.contentWindow))return;const i=S.data;!i||typeof i!="object"||(i.type==="READY"?M():i.type==="RESIZE"&&e&&w(e,i.displayMode||a,i.state))},window.addEventListener("message",r),e.addEventListener("load",M),setTimeout(()=>{f||console.warn("[messenger] iframe did not boot after",1e4,"ms — check CSP frame-ancestors and network")},1e4)}function l(){r&&(window.removeEventListener("message",r),r=null),e&&(e.remove(),e=null),s=""}function b(t){return t.endsWith("/")?t.slice(0,-1):t}function w(t,d,c){const g=["position:fixed","border:0","z-index:2147483647","color-scheme:normal","background:transparent"];let n;c==="closed"?n=["bottom:0","right:0","width:100px","height:100px"]:d==="sheet"?n=["top:0","bottom:0","right:0","width:min(480px, 100vw)","height:100vh"]:d==="embedded"?n=["inset:0","width:100%","height:100%"]:n=["bottom:20px","right:20px","width:380px","height:600px","max-height:calc(100vh - 40px)"],t.style.cssText=g.concat(n).join(";")}const h={init:m,destroy:l,version:"0.5.6"};return typeof window<"u"&&(window.Messenger=h),o.default=h,o.destroy=l,o.init=m,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),o}({});