@telia-ace/knowledge-widget-bot-provider 0.0.18-next.1 → 0.0.18-next.3

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.
@@ -11,23 +11,23 @@ var P = (n, t, e) => t in n ? V(n, t, { enumerable: !0, configurable: !0, writab
11
11
  return n;
12
12
  }, $ = (n, t) => j(n, z(t));
13
13
  var b = (n, t, e) => (P(n, typeof t != "symbol" ? t + "" : t, e), e);
14
- var m = (n, t, e) => new Promise((i, s) => {
14
+ var m = (n, t, e) => new Promise((s, i) => {
15
15
  var a = (S) => {
16
16
  try {
17
17
  d(e.next(S));
18
18
  } catch (o) {
19
- s(o);
19
+ i(o);
20
20
  }
21
21
  }, c = (S) => {
22
22
  try {
23
23
  d(e.throw(S));
24
24
  } catch (o) {
25
- s(o);
25
+ i(o);
26
26
  }
27
- }, d = (S) => S.done ? i(S.value) : Promise.resolve(S.value).then(a, c);
27
+ }, d = (S) => S.done ? s(S.value) : Promise.resolve(S.value).then(a, c);
28
28
  d((e = e.apply(n, t)).next());
29
29
  });
30
- import { ConversationMessageListItemType as I, ConversationPlatform as D, registerCustomMessageComponent as B } from "@telia-ace/widget-conversation";
30
+ import { ConversationMessageListItemType as w, ConversationPlatform as D, registerCustomMessageComponent as B } from "@telia-ace/widget-conversation";
31
31
  import { readStorage as J, createStorageWriter as F, StorageCategory as T } from "@telia-ace/widget-services";
32
32
  import { uuid as N } from "@telia-ace/widget-utilities";
33
33
  import { FormBuilder as A, submitButton as q } from "@telia-ace/widget-forms";
@@ -43,14 +43,14 @@ const Q = (n) => {
43
43
  items: t = [],
44
44
  meta: e = {}
45
45
  }) => {
46
- const i = N();
46
+ const s = N();
47
47
  return {
48
- id: i,
48
+ id: s,
49
49
  isUser: n,
50
50
  items: t.map((a) => ({
51
51
  id: a.id || N(),
52
52
  isUser: n,
53
- groupId: i,
53
+ groupId: s,
54
54
  message: a.message || []
55
55
  })),
56
56
  meta: e
@@ -59,14 +59,14 @@ const Q = (n) => {
59
59
  id: n,
60
60
  title: t,
61
61
  defaultIcon: e,
62
- exits: [i],
63
- exitType: s,
62
+ exits: [s],
63
+ exitType: i,
64
64
  confirmationText: a,
65
65
  expandFormAutomatically: c,
66
66
  form: d,
67
67
  description: S
68
68
  }, o = {}) => {
69
- const { adapter: r } = i || { Adapter: {} }, { clientName: l = "", settings: v = {}, customClientName: L = "" } = r, { validation: w } = o, p = {
69
+ const { adapter: r } = s || { Adapter: {} }, { clientName: l = "", settings: v = {}, customClientName: L = "" } = r, { validation: I } = o, p = {
70
70
  id: n.toString(),
71
71
  title: t,
72
72
  description: S,
@@ -80,24 +80,27 @@ const Q = (n) => {
80
80
  const { displayTextBeforeClick: h, textBeforeClick: g } = v;
81
81
  h === "true" && (p.expanded = !1, p.title = g), l.indexOf("phone.text") > -1 ? p.body.phoneNumber = v.phoneNumber : p.body.freetext = v.freetext;
82
82
  }
83
- return (l.indexOf("chat.popup") > -1 || l.indexOf("link") > -1 || l === "custom.adapter" && s === "custom") && (p.body = v, p.body.confirmationFallback = a), l.indexOf("ace") > -1 && (p.body = v), d && d.hasValueComponents && (w ? p.body.form = A.fromLegacyForm(n.toString(), d, w).get() : p.body.form = A.fromLegacyForm(n.toString(), d).get(), c || (p.expanded = p.inline = !1), p.body = tt(p, { submit: "Submit" })), o.guideId && (p.body.guideId = o.guideId), p;
84
- }, Y = (n) => (n == null ? void 0 : n.$type) === "Humany.Matching.Bots.Conversations.GuideListState, Humany.Matching" ? I.LinkList : (n == null ? void 0 : n.$type) === "Humany.Matching.Bots.Conversations.States.GuideFeedbackState, Humany.Matching" ? f.FeedbackList : (n == null ? void 0 : n.$type) === "Humany.Matching.Bots.Conversations.States.ContactState, Humany.Matching" ? f.ContactList : I.ButtonList, Z = (n, t) => {
83
+ return (l.indexOf("chat.popup") > -1 || l.indexOf("link") > -1 || l === "custom.adapter" && i === "custom") && (p.body = v, p.body.confirmationFallback = a), l.indexOf("ace") > -1 && (p.body = v), d && d.hasValueComponents && (I ? p.body.form = A.fromLegacyForm(n.toString(), d, I).get() : p.body.form = A.fromLegacyForm(n.toString(), d).get(), c || (p.expanded = p.inline = !1), p.body = tt(p, { submit: "Submit" })), o.guideId && (p.body.guideId = o.guideId), p;
84
+ }, Y = (n) => {
85
+ const { localState: t } = n;
86
+ return n.tags.includes("suggestion") ? w.LinkList : (t == null ? void 0 : t.$type) === "Humany.Matching.Bots.Conversations.GuideListState, Humany.Matching" ? w.LinkList : (t == null ? void 0 : t.$type) === "Humany.Matching.Bots.Conversations.States.GuideFeedbackState, Humany.Matching" ? f.FeedbackList : (t == null ? void 0 : t.$type) === "Humany.Matching.Bots.Conversations.States.ContactState, Humany.Matching" ? f.ContactList : w.ButtonList;
87
+ }, Z = (n, t) => {
85
88
  const { knowledgeBotEndpoint: e } = t.properties();
86
89
  if (e)
87
90
  return `${e}/conversations`;
88
- const { data: i } = n.get("$settings");
89
- if (!i || !i.projection)
91
+ const { data: s } = n.get("$settings");
92
+ if (!s || !s.projection)
90
93
  throw new Error("Missing Knowledge Bot endpoint");
91
- return `${i.projection}/conversations`;
94
+ return `${s.projection}/conversations`;
92
95
  }, tt = (n, {
93
96
  submit: t,
94
97
  errors: e,
95
- meta: i
98
+ meta: s
96
99
  }) => {
97
- var s;
98
- if ((s = n == null ? void 0 : n.body) != null && s.form) {
100
+ var i;
101
+ if ((i = n == null ? void 0 : n.body) != null && i.form) {
99
102
  const { body: a } = n, c = new A(a.form);
100
- return a.form.layout.submit || c.createComponent(q(t, "submit")), e && c.setValidationErrors(e), i && c.setMeta(i), $(K({}, a), {
103
+ return a.form.layout.submit || c.createComponent(q(t, "submit")), e && c.setValidationErrors(e), s && c.setMeta(s), $(K({}, a), {
101
104
  form: c.get()
102
105
  });
103
106
  }
@@ -118,22 +121,22 @@ const Q = (n) => {
118
121
  groupId: l
119
122
  }) => {
120
123
  const L = [];
121
- return v.actions = r.content.items.map((w) => {
124
+ return v.actions = r.content.items.map((I) => {
122
125
  var h;
123
126
  const p = {
124
- label: w.title,
125
- actionKey: w.actionKey,
126
- symbol: w.symbol ? w.symbol : void 0
127
+ label: I.title,
128
+ actionKey: I.actionKey,
129
+ symbol: I.symbol ? I.symbol : void 0
127
130
  };
128
- if (w.data) {
129
- const g = r.actions[w.actionKey];
130
- o === f.ContactList ? (L.push(w.data.id), p.data = X(w.data, {
131
+ if (I.data) {
132
+ const g = r.actions[I.actionKey];
133
+ o === f.ContactList ? (L.push(I.data.id), p.data = X(I.data, {
131
134
  guideId: (h = g == null ? void 0 : g.guideId) == null ? void 0 : h.toString()
132
- })) : p.data = w.data;
135
+ })) : p.data = I.data;
133
136
  }
134
137
  return p;
135
138
  }), o === f.ContactList && (v.contactMethodIds = L), v;
136
- }, i = (L, w, ...p) => m(void 0, [L, w, ...p], function* (o, r, l = [], v) {
139
+ }, s = (L, I, ...p) => m(void 0, [L, I, ...p], function* (o, r, l = [], v) {
137
140
  const h = N();
138
141
  switch (o.type) {
139
142
  case "List": {
@@ -144,7 +147,7 @@ const Q = (n) => {
144
147
  groupId: r.id
145
148
  };
146
149
  if (g && (E.header = g), (x == null ? void 0 : x.length) > 0) {
147
- const u = Y(o.localState);
150
+ const u = Y(o);
148
151
  if (E = e(u, o, r.id, E), l.length) {
149
152
  const k = l.find((M) => M.tags.includes("paging")), O = l.find((M) => M.tags.includes("fallback"));
150
153
  if (k != null && k.content && (r.meta.paging = {
@@ -167,7 +170,7 @@ const Q = (n) => {
167
170
  y({
168
171
  messageId: h,
169
172
  message: [
170
- I.Separator,
173
+ w.Separator,
171
174
  void 0
172
175
  ],
173
176
  group: r
@@ -195,7 +198,7 @@ const Q = (n) => {
195
198
  return H && C.unshift(
196
199
  y({
197
200
  messageId: h,
198
- message: [I.HTML, { body: H }],
201
+ message: [w.HTML, { body: H }],
199
202
  group: r
200
203
  })
201
204
  ), C;
@@ -206,7 +209,7 @@ const Q = (n) => {
206
209
  y({
207
210
  messageId: h,
208
211
  message: [
209
- I.HTML,
212
+ w.HTML,
210
213
  { body: o.content.html }
211
214
  ],
212
215
  group: r
@@ -237,7 +240,7 @@ const Q = (n) => {
237
240
  y({
238
241
  messageId: h,
239
242
  message: [
240
- I.ButtonList,
243
+ w.ButtonList,
241
244
  {
242
245
  actions: H.content.items.map((u) => ({
243
246
  label: u.title,
@@ -256,7 +259,7 @@ const Q = (n) => {
256
259
  g.push(
257
260
  y({
258
261
  messageId: h,
259
- message: [I.Separator, void 0],
262
+ message: [w.Separator, void 0],
260
263
  group: r
261
264
  })
262
265
  ), g.push(
@@ -272,7 +275,7 @@ const Q = (n) => {
272
275
  messageId: h,
273
276
  group: r,
274
277
  message: [
275
- I.HTML,
278
+ w.HTML,
276
279
  {
277
280
  body: C.content.html
278
281
  }
@@ -332,7 +335,7 @@ const Q = (n) => {
332
335
  y({
333
336
  messageId: h,
334
337
  message: [
335
- I.HTML,
338
+ w.HTML,
336
339
  {
337
340
  body: x.body
338
341
  }
@@ -347,7 +350,7 @@ const Q = (n) => {
347
350
  y({
348
351
  messageId: h,
349
352
  message: [
350
- I.HTML,
353
+ w.HTML,
351
354
  {
352
355
  body: o.content.item.body
353
356
  }
@@ -360,7 +363,7 @@ const Q = (n) => {
360
363
  y({
361
364
  messageId: h,
362
365
  message: [
363
- I.HTML,
366
+ w.HTML,
364
367
  {
365
368
  body: o.content.message || "Something went wrong."
366
369
  }
@@ -371,7 +374,7 @@ const Q = (n) => {
371
374
  default:
372
375
  return [];
373
376
  }
374
- }), s = (o) => ["CategorizedNoticeList", "NoticeList"].includes(o.type) ? (o.content.items || []).reduce((r, l) => (o.content.isInitialNotices && r.push($(K({}, o), {
377
+ }), i = (o) => ["CategorizedNoticeList", "NoticeList"].includes(o.type) ? (o.content.items || []).reduce((r, l) => (o.content.isInitialNotices && r.push($(K({}, o), {
375
378
  id: N(),
376
379
  type: l.type || o.type,
377
380
  content: {
@@ -388,29 +391,29 @@ const Q = (n) => {
388
391
  ]), c = [], d = n.sort((o, r) => {
389
392
  var v = a.get(o.type) || 20, L = a.get(r.type) || 20;
390
393
  return v - L;
391
- }).filter((o) => !o.relation).reduce((o, r) => o.concat(s(r)), []), S = (o) => typeof o.actions.selector != "undefined";
394
+ }).filter((o) => !o.relation).reduce((o, r) => o.concat(i(r)), []), S = (o) => typeof o.actions.selector != "undefined";
392
395
  for (const o of d) {
393
396
  const r = n.filter(
394
397
  (L) => L.relation === o.id && !S(L)
395
398
  ), l = G({ isUser: !1 });
396
- (yield i(o, l, r, t)).forEach((L) => {
399
+ (yield s(o, l, r, t)).forEach((L) => {
397
400
  l.items.push(L);
398
401
  }), l.items.length && c.push(l);
399
402
  }
400
403
  return c;
401
404
  });
402
- class nt {
403
- constructor(t, e, i, s) {
405
+ class st {
406
+ constructor(t, e, s, i) {
404
407
  b(this, "globalState");
405
408
  b(this, "localState");
406
409
  b(this, "clientId");
407
410
  b(this, "entries");
408
- this.endpoint = t, this.events = e, this.store = i, this.container = s, this.clientId = N(), this.entries = [];
411
+ this.endpoint = t, this.events = e, this.store = s, this.container = i, this.clientId = N(), this.entries = [];
409
412
  }
410
413
  start(e) {
411
414
  return m(this, arguments, function* ({ silent: t }) {
412
- const i = yield this.store.read("globalState"), s = yield this.store.read("localState"), a = yield this.store.read("entries");
413
- if (this.globalState = i || this.globalState, this.localState = s || this.localState, this.entries = a || this.entries, t)
415
+ const s = yield this.store.read("globalState"), i = yield this.store.read("localState"), a = yield this.store.read("entries");
416
+ if (this.globalState = s || this.globalState, this.localState = i || this.localState, this.entries = a || this.entries, t)
414
417
  return;
415
418
  const c = this.createInitialEnvelope();
416
419
  return yield this.postEnvelope(c);
@@ -442,9 +445,9 @@ class nt {
442
445
  }
443
446
  nextAction(t) {
444
447
  return m(this, null, function* () {
445
- var i;
448
+ var s;
446
449
  const { paging: e } = t.meta;
447
- if (!!((i = e.actions) != null && i.next))
450
+ if (!!((s = e.actions) != null && s.next))
448
451
  return this.postEnvelope(
449
452
  {
450
453
  action: {
@@ -456,16 +459,16 @@ class nt {
456
459
  clientId: this.clientId
457
460
  },
458
461
  t
459
- ).then((s) => {
462
+ ).then((i) => {
460
463
  const a = t.items.findIndex((c) => c.message[0] === "link-list");
461
- return a === -1 || !s ? t : $(K({}, t), {
462
- meta: K(K({}, t.meta), s[0].meta),
464
+ return a === -1 || !i ? t : $(K({}, t), {
465
+ meta: K(K({}, t.meta), i[0].meta),
463
466
  items: [
464
467
  ...t.items.slice(0, a),
465
468
  $(K({}, t.items[a]), {
466
469
  message: [
467
- s[0].items[0].message[0],
468
- K(K({}, t.items[a].message[1]), s[0].items[0].message[1])
470
+ i[0].items[0].message[0],
471
+ K(K({}, t.items[a].message[1]), i[0].items[0].message[1])
469
472
  ]
470
473
  }),
471
474
  ...t.items.slice(a + 1)
@@ -476,12 +479,12 @@ class nt {
476
479
  }
477
480
  showContactMethodAction(t) {
478
481
  return m(this, null, function* () {
479
- const e = this.entries.find((s) => s.id === t.entryId), i = e == null ? void 0 : e.actions[t.actionKey];
480
- if (!!i)
482
+ const e = this.entries.find((i) => i.id === t.entryId), s = e == null ? void 0 : e.actions[t.actionKey];
483
+ if (!!s)
481
484
  return this.postEnvelope({
482
485
  action: {
483
486
  key: t.actionKey,
484
- content: i
487
+ content: s
485
488
  },
486
489
  localState: e.localState,
487
490
  globalState: this.globalState,
@@ -515,22 +518,22 @@ class nt {
515
518
  postEnvelope(t, e) {
516
519
  return m(this, null, function* () {
517
520
  try {
518
- const i = yield fetch(this.endpoint, this.getHttpOptions(t));
519
- if (!i.ok)
520
- throw i;
521
- const s = yield i.json();
522
- return this.handleResponse(s, e);
523
- } catch (i) {
521
+ const s = yield fetch(this.endpoint, this.getHttpOptions(t));
522
+ if (!s.ok)
523
+ throw s;
524
+ const i = yield s.json();
525
+ return this.handleResponse(i, e);
526
+ } catch (s) {
524
527
  process.env.NODE_ENV !== "production" && console.warn("Something went wrong when posting the envelope.");
525
- let s = "Something went wrong";
526
- return (i.message === "Failed to fetch" || i.message === "NetworkError when attempting to fetch resource.") && (s = "Lost connection... Please try again."), this.handleResponse({
528
+ let i = "Something went wrong";
529
+ return (s.message === "Failed to fetch" || s.message === "NetworkError when attempting to fetch resource.") && (i = "Lost connection... Please try again."), this.handleResponse({
527
530
  entries: [
528
531
  {
529
532
  id: N(),
530
533
  type: "Error",
531
534
  timestamp: new Date().toISOString(),
532
535
  content: {
533
- message: s
536
+ message: i
534
537
  },
535
538
  actions: {},
536
539
  tags: []
@@ -543,8 +546,8 @@ class nt {
543
546
  handleResponse(t, e) {
544
547
  return m(this, null, function* () {
545
548
  this.entries = this.entries.concat(t.entries), this.store.write(this.entries, "entries");
546
- const i = t.entries.find((a) => a.type === "Widget");
547
- return i && this.events.dispatch("provider:widget-entry", i.content), t.globalState && (this.globalState = t.globalState, this.store.write(t.globalState, "globalState")), this.localState = t.entries.reduce((a, c) => c.localState ? c.localState : a, void 0), this.store.write(this.localState, "localState"), yield et(t.entries, e);
549
+ const s = t.entries.find((a) => a.type === "Widget");
550
+ return s && this.events.dispatch("provider:widget-entry", s.content), t.globalState && (this.globalState = t.globalState, this.store.write(t.globalState, "globalState")), this.localState = t.entries.reduce((a, c) => c.localState ? c.localState : a, void 0), this.store.write(this.localState, "localState"), yield et(t.entries, e);
548
551
  });
549
552
  }
550
553
  getHttpOptions(t) {
@@ -564,8 +567,8 @@ class nt {
564
567
  return this.entries.find((e) => !!e.actions[t]);
565
568
  }
566
569
  }
567
- const it = nt;
568
- class st {
570
+ const nt = st;
571
+ class it {
569
572
  constructor(t) {
570
573
  b(this, "enabled", !0);
571
574
  b(this, "botProviderGlobalStateKey", "bot-provider-global-state");
@@ -601,16 +604,16 @@ class st {
601
604
  }
602
605
  write(t, e) {
603
606
  return m(this, null, function* () {
604
- const i = this.getKey(e);
605
- if (!this.enabled || !i)
607
+ const s = this.getKey(e);
608
+ if (!this.enabled || !s)
606
609
  return;
607
- (yield F(this.container, i, T.Necessary))(t);
610
+ (yield F(this.container, s, T.Necessary))(t);
608
611
  });
609
612
  }
610
613
  }
611
- const ot = st;
614
+ const ot = it;
612
615
  class at {
613
- constructor(t, e, i) {
616
+ constructor(t, e, s) {
614
617
  b(this, "agent");
615
618
  b(this, "user");
616
619
  b(this, "httpClient");
@@ -618,14 +621,14 @@ class at {
618
621
  b(this, "groups", []);
619
622
  b(this, "store");
620
623
  this.container = t, this.conversation = e;
621
- const { events: s } = this.container.get("$widget");
622
- this.events = s, this.store = new ot(t), this.agent = e.createAgent({
624
+ const { events: i } = this.container.get("$widget");
625
+ this.events = i, this.store = new ot(t), this.agent = e.createAgent({
623
626
  id: "knowledge-bot-agent",
624
627
  name: "",
625
628
  avatar: void 0
626
629
  }), this.user = e.user;
627
- const a = Z(t, i);
628
- this.httpClient = new it(a, s, this.store, this.container), this.events.subscribe("provider:widget-entry", (c, d) => {
630
+ const a = Z(t, s);
631
+ this.httpClient = new nt(a, i, this.store, this.container), this.events.subscribe("provider:widget-entry", (c, d) => {
629
632
  this.onWidgetEntryReceived(d);
630
633
  }), this.events.subscribe(
631
634
  "provider:open-contact-method",
@@ -643,17 +646,17 @@ class at {
643
646
  name: e.agent.name,
644
647
  avatar: e.agent.avatar
645
648
  });
646
- const i = yield this.conversation.isRehydrated(), s = yield this.httpClient.start({
647
- silent: ((a = this.conversation.options) == null ? void 0 : a.silent) || i
649
+ const s = yield this.conversation.isRehydrated(), i = yield this.httpClient.start({
650
+ silent: ((a = this.conversation.options) == null ? void 0 : a.silent) || s
648
651
  });
649
- s && this.onMessagesReceived(s), t();
652
+ i && this.onMessagesReceived(i), t();
650
653
  });
651
654
  }
652
655
  onMessagesReceived(t) {
653
656
  return m(this, null, function* () {
654
657
  this.groups = this.groups.concat(t), t.forEach((e) => {
655
- const i = e.items.map((s) => s.message);
656
- e.isUser ? e.writer = this.user.print(i) : e.writer = this.agent.print(i);
658
+ const s = e.items.map((i) => i.message);
659
+ e.isUser ? e.writer = this.user.print(s) : e.writer = this.agent.print(s);
657
660
  });
658
661
  });
659
662
  }
@@ -665,30 +668,30 @@ class at {
665
668
  {
666
669
  if (typeof t == "string")
667
670
  return;
668
- const i = this.groups.find((s) => {
671
+ const s = this.groups.find((i) => {
669
672
  var a;
670
- return s.id === ((a = t.data) == null ? void 0 : a.groupId);
673
+ return i.id === ((a = t.data) == null ? void 0 : a.groupId);
671
674
  });
672
- if (i) {
673
- const s = yield this.httpClient.nextAction(i);
674
- if (s) {
675
- const a = s.items.map((c) => c.message);
676
- i.meta.paging = s == null ? void 0 : s.meta.paging, i.writer.update(a);
675
+ if (s) {
676
+ const i = yield this.httpClient.nextAction(s);
677
+ if (i) {
678
+ const a = i.items.map((c) => c.message);
679
+ s.meta.paging = i == null ? void 0 : i.meta.paging, s.writer.update(a);
677
680
  }
678
681
  }
679
682
  }
680
683
  break;
681
684
  case "help":
682
685
  {
683
- const i = this.conversation.loading(), s = yield this.httpClient.helpAction();
684
- i(), s && this.onMessagesReceived(s);
686
+ const s = this.conversation.loading(), i = yield this.httpClient.helpAction();
687
+ s(), i && this.onMessagesReceived(i);
685
688
  }
686
689
  break;
687
690
  default:
688
691
  {
689
692
  typeof t != "string" && t.label && this.printUserMessage(t.label);
690
- const i = this.conversation.loading(), s = yield this.httpClient.defaultAction(e);
691
- s && this.onMessagesReceived(s), i();
693
+ const s = this.conversation.loading(), i = yield this.httpClient.defaultAction(e);
694
+ i && this.onMessagesReceived(i), s();
692
695
  }
693
696
  break;
694
697
  }
@@ -701,7 +704,7 @@ class at {
701
704
  {
702
705
  id: N(),
703
706
  isUser: !0,
704
- message: [I.HTML, { body: t }]
707
+ message: [w.HTML, { body: t }]
705
708
  }
706
709
  ]
707
710
  });
@@ -709,8 +712,8 @@ class at {
709
712
  }
710
713
  onMessageSend(t) {
711
714
  return m(this, null, function* () {
712
- const e = this.conversation.loading(), i = yield this.httpClient.sendMessage(t);
713
- this.printUserMessage(t), i && this.onMessagesReceived(i), e();
715
+ const e = this.conversation.loading(), s = yield this.httpClient.sendMessage(t);
716
+ this.printUserMessage(t), s && this.onMessagesReceived(s), e();
714
717
  });
715
718
  }
716
719
  onWidgetEntryReceived(t) {
@@ -736,11 +739,11 @@ const rt = at, ct = (n) => m(void 0, null, function* () {
736
739
  B(
737
740
  n,
738
741
  f.ContactList,
739
- import("./contact-method-list.0f9b85c9.js")
742
+ import("./contact-method-list.369194cf.js")
740
743
  ), B(
741
744
  n,
742
745
  f.ContactMethod,
743
- import("./contact-method.6ba724b7.js")
746
+ import("./contact-method.49203d93.js")
744
747
  ), B(
745
748
  n,
746
749
  f.NotificationList,
@@ -753,23 +756,23 @@ const rt = at, ct = (n) => m(void 0, null, function* () {
753
756
  n,
754
757
  f.FeedbackList,
755
758
  import("./feedback-list.73d8aa69.js")
756
- ), t.registerProvider("ace-knowledge-bot", (e, i) => {
757
- const s = new rt(n, e, i);
758
- s.initialize();
759
+ ), t.registerProvider("ace-knowledge-bot", (e, s) => {
760
+ const i = new rt(n, e, s);
761
+ i.initialize();
759
762
  const a = [];
760
763
  return a.push(
761
- i.actions.watch("conversation.user-submit", (c, d) => {
762
- s.onMessageSend(c.text);
764
+ s.actions.watch("conversation.user-submit", (c, d) => {
765
+ i.onMessageSend(c.text);
763
766
  })
764
767
  ), a.push(
765
- i.actions.watch("conversation.action", (c, d) => (s.onInput(c), d(c)))
768
+ s.actions.watch("conversation.action", (c, d) => (i.onInput(c), d(c)))
766
769
  ), a.push(
767
- i.actions.create("evaluate", (c) => {
770
+ s.actions.create("evaluate", (c) => {
768
771
  const { events: d } = n.get("$widget");
769
772
  d.dispatch("bot-provider:evaluate", c);
770
773
  })
771
774
  ), a.push(
772
- i.actions.create("submit", (c) => {
775
+ s.actions.create("submit", (c) => {
773
776
  const { events: d } = n.get("$widget");
774
777
  d.dispatch("bot-provider:form-submitted", c);
775
778
  })
@@ -784,4 +787,4 @@ export {
784
787
  mt as K,
785
788
  tt as u
786
789
  };
787
- //# sourceMappingURL=index.9c7696ef.js.map
790
+ //# sourceMappingURL=index.94fbbd75.js.map