lr-chatbot 0.48.63 → 0.48.64

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 (3) hide show
  1. package/index.js +124 -95
  2. package/index.js.map +1 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -1190,20 +1190,24 @@ var Re = Le, ze = /*#__PURE__*/ function() {
1190
1190
  var r = e[a];
1191
1191
  if (r.bubbleElement.classList.contains(t[0]) && !t.slice(1).find(function(e) {
1192
1192
  return !r.bubbleElement.classList.contains(e);
1193
- })) if (n) {
1194
- if (!n.find(function(e) {
1195
- return r.bubbleElement.classList.contains(e);
1196
- })) return { v: r };
1197
- } else return { v: r };
1193
+ })) {
1194
+ if (n) {
1195
+ if (!n.find(function(e) {
1196
+ return r.bubbleElement.classList.contains(e);
1197
+ })) return { v: r };
1198
+ } else return { v: r };
1199
+ }
1198
1200
  }, i, a = e.length - 1; a >= 0; --a) if (i = r(), i) return i.v;
1199
1201
  }
1200
1202
  },
1201
1203
  {
1202
1204
  key: "getLastMessage",
1203
1205
  value: function(e, t, n) {
1204
- for (var r = e.length - 1; r >= 0; --r) if (e[r].role === t) if (n) {
1205
- if (e[r][n]) return e[r];
1206
- } else return e[r];
1206
+ for (var r = e.length - 1; r >= 0; --r) if (e[r].role === t) {
1207
+ if (n) {
1208
+ if (e[r][n]) return e[r];
1209
+ } else return e[r];
1210
+ }
1207
1211
  }
1208
1212
  },
1209
1213
  {
@@ -2046,10 +2050,13 @@ Gt.prototype.process = function(e) {
2046
2050
  function Kt(e, t, n, r, i) {
2047
2051
  var a, o, s, c, l, u, d;
2048
2052
  for (this.src = e, this.parser = t, this.options = n, this.env = r, this.tokens = i, this.bMarks = [], this.eMarks = [], this.tShift = [], this.blkIndent = 0, this.line = 0, this.lineMax = 0, this.tight = !1, this.parentType = "root", this.ddIndent = -1, this.level = 0, this.result = "", o = this.src, u = 0, d = !1, s = c = u = 0, l = o.length; c < l; c++) {
2049
- if (a = o.charCodeAt(c), !d) if (a === 32) {
2050
- u++;
2051
- continue;
2052
- } else d = !0;
2053
+ if (a = o.charCodeAt(c), !d) {
2054
+ if (a === 32) {
2055
+ u++;
2056
+ continue;
2057
+ }
2058
+ d = !0;
2059
+ }
2053
2060
  (a === 10 || c === l - 1) && (a !== 10 && c++, this.bMarks.push(s), this.eMarks.push(c), this.tShift.push(u), d = !1, u = 0, s = c + 1);
2054
2061
  }
2055
2062
  this.bMarks.push(o.length), this.eMarks.push(o.length), this.tShift.push(0), this.lineMax = this.bMarks.length - 1;
@@ -2577,23 +2584,26 @@ function Sn(e, t) {
2577
2584
  function Cn(e, t) {
2578
2585
  var n, r, i = e.pos;
2579
2586
  if (e.src.charCodeAt(i) !== 10) return !1;
2580
- if (n = e.pending.length - 1, r = e.posMax, !t) if (n >= 0 && e.pending.charCodeAt(n) === 32) if (n >= 1 && e.pending.charCodeAt(n - 1) === 32) {
2581
- for (var a = n - 2; a >= 0; a--) if (e.pending.charCodeAt(a) !== 32) {
2582
- e.pending = e.pending.substring(0, a + 1);
2583
- break;
2584
- }
2585
- e.push({
2586
- type: "hardbreak",
2587
+ if (n = e.pending.length - 1, r = e.posMax, !t) {
2588
+ if (n >= 0 && e.pending.charCodeAt(n) === 32) {
2589
+ if (n >= 1 && e.pending.charCodeAt(n - 1) === 32) {
2590
+ for (var a = n - 2; a >= 0; a--) if (e.pending.charCodeAt(a) !== 32) {
2591
+ e.pending = e.pending.substring(0, a + 1);
2592
+ break;
2593
+ }
2594
+ e.push({
2595
+ type: "hardbreak",
2596
+ level: e.level
2597
+ });
2598
+ } else e.pending = e.pending.slice(0, -1), e.push({
2599
+ type: "softbreak",
2600
+ level: e.level
2601
+ });
2602
+ } else e.push({
2603
+ type: "softbreak",
2587
2604
  level: e.level
2588
2605
  });
2589
- } else e.pending = e.pending.slice(0, -1), e.push({
2590
- type: "softbreak",
2591
- level: e.level
2592
- });
2593
- else e.push({
2594
- type: "softbreak",
2595
- level: e.level
2596
- });
2606
+ }
2597
2607
  for (i++; i < r && e.src.charCodeAt(i) === 32;) i++;
2598
2608
  return e.pos = i, !0;
2599
2609
  }
@@ -10858,13 +10868,15 @@ Aa.Speech = /* @__PURE__ */ function() {
10858
10868
  key: "prepareBeforeStart",
10859
10869
  value: function(e) {
10860
10870
  var t;
10861
- if (e != null && e.element) if (Xa.EventListeners.add(this, e), Array.isArray(e.element)) {
10862
- var n = e.element.find(function(e) {
10863
- return e === document.activeElement;
10864
- }) || e.element[0];
10865
- if (!n) return;
10866
- this.prepare(n);
10867
- } else this.prepare(e.element);
10871
+ if (e != null && e.element) {
10872
+ if (Xa.EventListeners.add(this, e), Array.isArray(e.element)) {
10873
+ var n = e.element.find(function(e) {
10874
+ return e === document.activeElement;
10875
+ }) || e.element[0];
10876
+ if (!n) return;
10877
+ this.prepare(n);
10878
+ } else this.prepare(e.element);
10879
+ }
10868
10880
  e?.displayInterimResults !== void 0 && (this._displayInterimResults = e.displayInterimResults), e != null && e.textColor && (this._finalTextColor = e?.textColor?.final, to.Elements.applyCustomColors(this, e.textColor)), e?.insertInCursorLocation !== void 0 && (this.insertInCursorLocation = e.insertInCursorLocation), e?.autoScroll !== void 0 && (this.autoScroll = e.autoScroll), this._onResult = e?.onResult, this._onPreResult = e?.onPreResult, this._onStart = e?.onStart, this._onStop = e?.onStop, this._onError = e?.onError, this.onCommandModeTrigger = e?.onCommandModeTrigger, this.onPauseTrigger = e?.onPauseTrigger, this._options = e, (t = this._options) != null && t.commands && (this.commands = Qa.CommandUtils.process(this._options.commands));
10869
10881
  }
10870
10882
  },
@@ -13678,7 +13690,7 @@ var dc = class extends HTMLElement {
13678
13690
  static finalizeStyles(e) {
13679
13691
  let t = [];
13680
13692
  if (Array.isArray(e)) {
13681
- let n = new Set(e.flat(Infinity).reverse());
13693
+ let n = new Set(e.flat(1 / 0).reverse());
13682
13694
  for (let e of n) t.unshift(Xs(e));
13683
13695
  } else e !== void 0 && t.push(Xs(e));
13684
13696
  return t;
@@ -13857,16 +13869,18 @@ var Bc = (e, t) => {
13857
13869
  i.append(e[t], xc());
13858
13870
  }
13859
13871
  }
13860
- } else if (i.nodeType === 8) if (i.data === vc) c.push({
13861
- type: 2,
13862
- index: a
13863
- });
13864
- else {
13865
- let e = -1;
13866
- for (; (e = i.data.indexOf(_c, e + 1)) !== -1;) c.push({
13867
- type: 7,
13872
+ } else if (i.nodeType === 8) {
13873
+ if (i.data === vc) c.push({
13874
+ type: 2,
13868
13875
  index: a
13869
- }), e += _c.length - 1;
13876
+ });
13877
+ else {
13878
+ let e = -1;
13879
+ for (; (e = i.data.indexOf(_c, e + 1)) !== -1;) c.push({
13880
+ type: 7,
13881
+ index: a
13882
+ }), e += _c.length - 1;
13883
+ }
13870
13884
  }
13871
13885
  a++;
13872
13886
  }
@@ -16048,15 +16062,16 @@ var Tu = function() {
16048
16062
  }].forEach(function(t) {
16049
16063
  for (s = 0; a = t.regex.exec(e);) {
16050
16064
  var n = a[1].trim();
16051
- if (o = u(n), o === void 0) if (typeof d == "function") {
16052
- var c = d(e, a, r);
16053
- o = typeof c == "string" ? c : "";
16054
- } else if (r && Object.prototype.hasOwnProperty.call(r, n)) o = "";
16055
- else if (f) {
16056
- o = a[0];
16057
- continue;
16058
- } else i.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), o = "";
16059
- else typeof o != "string" && !i.useRawValueToEscape && (o = Vl(o));
16065
+ if (o = u(n), o === void 0) {
16066
+ if (typeof d == "function") {
16067
+ var c = d(e, a, r);
16068
+ o = typeof c == "string" ? c : "";
16069
+ } else if (r && Object.prototype.hasOwnProperty.call(r, n)) o = "";
16070
+ else if (f) {
16071
+ o = a[0];
16072
+ continue;
16073
+ } else i.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), o = "";
16074
+ } else typeof o != "string" && !i.useRawValueToEscape && (o = Vl(o));
16060
16075
  var l = t.safeValue(o);
16061
16076
  if (e = e.replace(a[0], l), f ? (t.regex.lastIndex += o.length, t.regex.lastIndex -= a[0].length) : t.regex.lastIndex = 0, s++, s >= i.maxReplaces) break;
16062
16077
  }
@@ -17233,12 +17248,12 @@ var Pd = Js`
17233
17248
  }
17234
17249
  `;
17235
17250
  //#endregion
17236
- //#region \0@oxc-project+runtime@0.142.0/helpers/esm/decorateMetadata.js
17251
+ //#region \0@oxc-project+runtime@0.146.0/helpers/esm/decorateMetadata.js
17237
17252
  function q(e, t) {
17238
17253
  if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
17239
17254
  }
17240
17255
  //#endregion
17241
- //#region \0@oxc-project+runtime@0.142.0/helpers/esm/decorate.js
17256
+ //#region \0@oxc-project+runtime@0.146.0/helpers/esm/decorate.js
17242
17257
  function J(e, t, n, r) {
17243
17258
  var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
17244
17259
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
@@ -17521,9 +17536,12 @@ function $d(e) {
17521
17536
  }
17522
17537
  function ef(e, t = !1, n = 0) {
17523
17538
  let r = this._$AH, i = this._$AN;
17524
- if (i !== void 0 && i.size !== 0) if (t) if (Array.isArray(r)) for (let e = n; e < r.length; e++) Xd(r[e], !1), Zd(r[e]);
17525
- else r != null && (Xd(r, !1), Zd(r));
17526
- else Xd(this, e);
17539
+ if (i !== void 0 && i.size !== 0) {
17540
+ if (t) {
17541
+ if (Array.isArray(r)) for (let e = n; e < r.length; e++) Xd(r[e], !1), Zd(r[e]);
17542
+ else r != null && (Xd(r, !1), Zd(r));
17543
+ } else Xd(this, e);
17544
+ }
17527
17545
  }
17528
17546
  var tf = (e) => {
17529
17547
  e.type == fl.CHILD && (e._$AP ??= ef, e._$AQ ??= $d);
@@ -17555,10 +17573,12 @@ var tf = (e) => {
17555
17573
  return n && this.rt(void 0), (n || this.lt !== this.ct) && (this.G = t, this.ht = e.options?.host, this.rt(this.ct = e.element)), G;
17556
17574
  }
17557
17575
  rt(e) {
17558
- if (this.G !== void 0) if (this.isConnected || (e = void 0), typeof this.G == "function") {
17559
- let t = this.ht ?? globalThis, n = rf.get(t);
17560
- n === void 0 && (n = /* @__PURE__ */ new WeakMap(), rf.set(t, n)), n.get(this.G) !== void 0 && this.G.call(this.ht, void 0), n.set(this.G, e), e !== void 0 && this.G.call(this.ht, e);
17561
- } else this.G.value = e;
17576
+ if (this.G !== void 0) {
17577
+ if (this.isConnected || (e = void 0), typeof this.G == "function") {
17578
+ let t = this.ht ?? globalThis, n = rf.get(t);
17579
+ n === void 0 && (n = /* @__PURE__ */ new WeakMap(), rf.set(t, n)), n.get(this.G) !== void 0 && this.G.call(this.ht, void 0), n.set(this.G, e), e !== void 0 && this.G.call(this.ht, e);
17580
+ } else this.G.value = e;
17581
+ }
17562
17582
  }
17563
17583
  get lt() {
17564
17584
  return typeof this.G == "function" ? rf.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
@@ -18925,9 +18945,11 @@ function Gm(e, t) {
18925
18945
  }
18926
18946
  function s(n) {
18927
18947
  let r = Y.hasOwnProp(t, "transitional") ? t.transitional : void 0;
18928
- if (!Y.isUndefined(r)) if (Y.isPlainObject(r)) {
18929
- if (Y.hasOwnProp(r, n)) return r[n];
18930
- } else return;
18948
+ if (!Y.isUndefined(r)) {
18949
+ if (Y.isPlainObject(r)) {
18950
+ if (Y.hasOwnProp(r, n)) return r[n];
18951
+ } else return;
18952
+ }
18931
18953
  let i = Y.hasOwnProp(e, "transitional") ? e.transitional : void 0;
18932
18954
  if (Y.isPlainObject(i) && Y.hasOwnProp(i, n)) return i[n];
18933
18955
  }
@@ -20464,18 +20486,20 @@ function Hg(e, t, n, r) {
20464
20486
  let o = i[a];
20465
20487
  if (ig(o)) continue;
20466
20488
  let s = t[o], c = e[o];
20467
- if (Fg(s) && (s = { ...s }), Fg(c) && (c = { ...c }), rg(s) && (s = Pg(s)), Array.isArray(s)) if (Array.isArray(c)) {
20468
- let e = [], t = Reflect.ownKeys(c);
20469
- for (let n = 0; n < t.length; n++) {
20470
- let r = t[n];
20471
- e[r] = c[r];
20472
- }
20473
- c = e;
20474
- } else if (zg(c)) {
20475
- let e = [];
20476
- for (let t = 0; t < c.length; t++) e[t] = c[t];
20477
- c = e;
20478
- } else c = [];
20489
+ if (Fg(s) && (s = { ...s }), Fg(c) && (c = { ...c }), rg(s) && (s = Pg(s)), Array.isArray(s)) {
20490
+ if (Array.isArray(c)) {
20491
+ let e = [], t = Reflect.ownKeys(c);
20492
+ for (let n = 0; n < t.length; n++) {
20493
+ let r = t[n];
20494
+ e[r] = c[r];
20495
+ }
20496
+ c = e;
20497
+ } else if (zg(c)) {
20498
+ let e = [];
20499
+ for (let t = 0; t < c.length; t++) e[t] = c[t];
20500
+ c = e;
20501
+ } else c = [];
20502
+ }
20479
20503
  let l = n(c, s, o, e, t, r);
20480
20504
  l === void 0 ? Array.isArray(s) || Ig(c) && Ig(s) && (ag(c) || ag(s) || Bg(c) || Bg(s)) ? e[o] = Hg(c, s, n, r) : c == null && ag(s) ? e[o] = Hg({}, s, n, r) : c == null && Bg(s) ? e[o] = Pg(s) : (c === void 0 || s !== void 0) && (e[o] = s) : e[o] = l;
20481
20505
  }
@@ -21530,12 +21554,13 @@ var d_ = /* @__PURE__ */ s(((e, t) => {
21530
21554
  var o = t.length;
21531
21555
  if (r && typeof r.arrayLimit == "number" && o > r.arrayLimit) return s(p(t.concat(n), r), o);
21532
21556
  t[o] = n;
21533
- } else if (t && typeof t == "object") if (c(t)) {
21534
- var d = l(t) + 1;
21535
- t[d] = n, u(t, d);
21536
- } else if (r && r.strictMerge) return [t, n];
21537
- else (r && (r.plainObjects || r.allowPrototypes) || !i.call(Object.prototype, n)) && (t[n] = !0);
21538
- else return [t, n];
21557
+ } else if (t && typeof t == "object") {
21558
+ if (c(t)) {
21559
+ var d = l(t) + 1;
21560
+ t[d] = n, u(t, d);
21561
+ } else if (r && r.strictMerge) return [t, n];
21562
+ else (r && (r.plainObjects || r.allowPrototypes) || !i.call(Object.prototype, n)) && (t[n] = !0);
21563
+ } else return [t, n];
21539
21564
  return t;
21540
21565
  }
21541
21566
  if (!t || typeof t != "object") {
@@ -23478,12 +23503,14 @@ function ex() {
23478
23503
  from: n
23479
23504
  });
23480
23505
  }
23481
- if (n.removeAttribute(e), e === "is") if (Ae || je) try {
23482
- mt(n);
23483
- } catch {}
23484
- else try {
23485
- n.setAttribute(e, "");
23486
- } catch {}
23506
+ if (n.removeAttribute(e), e === "is") {
23507
+ if (Ae || je) try {
23508
+ mt(n);
23509
+ } catch {}
23510
+ else try {
23511
+ n.setAttribute(e, "");
23512
+ } catch {}
23513
+ }
23487
23514
  }, _t = function(e) {
23488
23515
  let t = v(e);
23489
23516
  if (t) for (let n = t.length - 1; n >= 0; --n) {
@@ -24091,7 +24118,7 @@ var kx = "lr.chatbot.broadcast_channel." + document.location.hostname, Ax = "lr.
24091
24118
  }), this.#e = "/bff", this.#t = !1, this.#n = !1, this.#r = !1, this.#i = !1, this._closeClickCount = 0, this._isConversationDone = !1, this._shouldEndConversation = !1, this._broadcastController = new ry(this, kx), this._conversationHistoryTask = this.createConversationHistoryTask(), this.registerBroadcastMessages();
24092
24119
  }
24093
24120
  getVersion() {
24094
- return "LR Chatbot - v.0.48.63";
24121
+ return "LR Chatbot - v.0.48.64";
24095
24122
  }
24096
24123
  async connectedCallback() {
24097
24124
  super.connectedCallback(), this._conversationHistoryTask.run();
@@ -24310,11 +24337,13 @@ var kx = "lr.chatbot.broadcast_channel." + document.location.hostname, Ax = "lr.
24310
24337
  this.minimized || (this.opened = !1, this.minimized = !0, localStorage.setItem(jx, "minimized"));
24311
24338
  }
24312
24339
  open() {
24313
- if (!this.opened) if (this.isWebviewPage()) window.location.href = "laredoute://?chat";
24314
- else {
24315
- this.opened = !0, this.minimized = !1, localStorage.setItem(jx, "opened"), this._broadcastController.send({ action: "open" });
24316
- let e = new CustomEvent("chatBotWindowOpen", { detail: "true" });
24317
- window.dispatchEvent(e);
24340
+ if (!this.opened) {
24341
+ if (this.isWebviewPage()) window.location.href = "laredoute://?chat";
24342
+ else {
24343
+ this.opened = !0, this.minimized = !1, localStorage.setItem(jx, "opened"), this._broadcastController.send({ action: "open" });
24344
+ let e = new CustomEvent("chatBotWindowOpen", { detail: "true" });
24345
+ window.dispatchEvent(e);
24346
+ }
24318
24347
  }
24319
24348
  }
24320
24349
  close() {