@aintela/chat 0.14.8 → 0.14.9
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/components.js +2 -2
- package/dist/components.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{predictionRows-Damfwthh.js → predictionRows-BkBwfvt4.js} +169 -168
- package/dist/{predictionRows-Damfwthh.js.map → predictionRows-BkBwfvt4.js.map} +1 -1
- package/dist/src/utils/promptHighlight.d.ts +2 -1
- package/dist/src/utils/promptHighlight.test.d.ts +1 -0
- package/dist/utils.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { APPBAR_HEIGHT as fe, APPBAR_HEIGHT as Fe, ASK_USER_CANCELLED as Me, Act
|
|
|
10
10
|
import { s as nn, u as rn, a as on, b as cn, c as ln } from "./useContainerWidth-C7u70yDY.js";
|
|
11
11
|
import { A as pn, D as gn, g as Sn, b as Cn, c as dn, d as hn, e as un, f as En, i as Tn, r as Rn } from "./environmentUtils-VZNTCzEE.js";
|
|
12
12
|
import { ALLOWED_DOMAINS as Pn, ALLOWED_EMAILS as Ln, AUTH_CONFIG as Dn, GOOGLE_CLIENT_ID as vn, getAgentBaseUrl as mn, getArtifactsBaseUrl as _n, getDotNetBaseUrl as xn, getIconByName as yn, iconCategories as fn, materialIcons as Fn, searchIcons as Mn, setEbiContextData as Bn, setEbiContextSessionId as On } from "./utils.js";
|
|
13
|
-
import { P as kn, S as Hn, c as Vn, a as Nn, e as bn, b as wn, f as Gn, i as Wn, d as zn, p as Kn, s as Jn, h as Xn, j as Yn, t as jn, k as qn } from "./predictionRows-
|
|
13
|
+
import { P as kn, S as Hn, c as Vn, a as Nn, e as bn, b as wn, f as Gn, i as Wn, d as zn, p as Kn, s as Jn, h as Xn, j as Yn, t as jn, k as qn } from "./predictionRows-BkBwfvt4.js";
|
|
14
14
|
import { a as Qn, b as $n, c as er, d as ar, f as tr, p as sr } from "./promptTriggers-xwMJ5gRj.js";
|
|
15
15
|
import { u as rr } from "./useChatSessions-BgfeYkcc.js";
|
|
16
16
|
import { Score as ir } from "./interfaces.js";
|
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
var R = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var d = (
|
|
4
|
-
var q = (
|
|
5
|
-
const
|
|
6
|
-
let o = "URL",
|
|
7
|
-
if (
|
|
8
|
-
const a =
|
|
9
|
-
switch (s =
|
|
2
|
+
var I = (r, t, e) => t in r ? R(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var d = (r, t) => R(r, "name", { value: t, configurable: !0 });
|
|
4
|
+
var q = (r, t, e) => I(r, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
+
const z = /^[a-z][a-z0-9+.-]*:\/\//i, Z = /* @__PURE__ */ d((r, t, e) => {
|
|
6
|
+
let o = "URL", n = null, i = null, s = null;
|
|
7
|
+
if (r[0] == "#") {
|
|
8
|
+
const a = r.indexOf("-"), l = r.slice(1, a);
|
|
9
|
+
switch (s = r.slice(a + 1), l.toLowerCase()) {
|
|
10
10
|
case "opendashboard":
|
|
11
11
|
o = "OpenDashboard";
|
|
12
12
|
break;
|
|
13
13
|
case "ask":
|
|
14
|
-
o = "Question",
|
|
14
|
+
o = "Question", n = e;
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
17
|
-
} else
|
|
18
|
-
return { action: o, url: i, question:
|
|
19
|
-
}, "extractLinkAction"),
|
|
20
|
-
{ length: Math.ceil(
|
|
21
|
-
(e, o) =>
|
|
22
|
-
), "chunkArray"),
|
|
23
|
-
|
|
17
|
+
} else z.test(r) ? (o = "URL", i = r) : r[0] === "/" ? (o = "Navigate", i = r) : (r = r.replaceAll("exported/", `exported/${t}/`), o = "Export");
|
|
18
|
+
return { action: o, url: i, question: n, parameter: s };
|
|
19
|
+
}, "extractLinkAction"), F = /* @__PURE__ */ d((r, t) => Array.from(
|
|
20
|
+
{ length: Math.ceil(r.length / t) },
|
|
21
|
+
(e, o) => r.slice(o * t, o * t + t)
|
|
22
|
+
), "chunkArray"), J = /* @__PURE__ */ d((r) => {
|
|
23
|
+
r = r.replaceAll("\\n", `
|
|
24
24
|
`);
|
|
25
|
-
const t = 90, e =
|
|
26
|
-
let
|
|
25
|
+
const t = 90, e = r.split(" "), o = [];
|
|
26
|
+
let n = !1;
|
|
27
27
|
for (const i of e)
|
|
28
28
|
if (i.length > t) {
|
|
29
|
-
|
|
30
|
-
const s = [...i], l =
|
|
29
|
+
n = !0;
|
|
30
|
+
const s = [...i], l = F(s, t).map((c) => c.join("")).join(`
|
|
31
31
|
`);
|
|
32
32
|
o.push(l);
|
|
33
33
|
} else
|
|
34
34
|
o.push(i);
|
|
35
|
-
return
|
|
35
|
+
return n ? o.join(" ") : r;
|
|
36
36
|
}, "splitBigLinesWithSpaces");
|
|
37
|
-
function B(
|
|
38
|
-
let t = parseFloat(
|
|
37
|
+
function B(r) {
|
|
38
|
+
let t = parseFloat(r);
|
|
39
39
|
if (!isNaN(t))
|
|
40
|
-
return
|
|
40
|
+
return r = r.replaceAll(/[,\.]/g, ""), parseInt(r);
|
|
41
41
|
var e = "";
|
|
42
|
-
for (const
|
|
43
|
-
|
|
44
|
-
const o = e.length /
|
|
42
|
+
for (const n of r)
|
|
43
|
+
n.match(/[0-9]/) && (e += n);
|
|
44
|
+
const o = e.length / r.length;
|
|
45
45
|
return t = parseInt(e), !isNaN(t) && o > 0.5 ? t : NaN;
|
|
46
46
|
}
|
|
47
47
|
d(B, "parseRawNumber");
|
|
48
48
|
const V = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i, P = /^[0-9a-f]{32}/i;
|
|
49
|
-
function
|
|
50
|
-
if (!
|
|
49
|
+
function Y(r) {
|
|
50
|
+
if (!r || typeof r != "string")
|
|
51
51
|
return !1;
|
|
52
|
-
const t = U(
|
|
53
|
-
return t === null ? !1 :
|
|
52
|
+
const t = U(r);
|
|
53
|
+
return t === null ? !1 : r.startsWith(t);
|
|
54
54
|
}
|
|
55
|
-
d(
|
|
56
|
-
function U(
|
|
57
|
-
if (!
|
|
55
|
+
d(Y, "startsWithInteractionId");
|
|
56
|
+
function U(r) {
|
|
57
|
+
if (!r || typeof r != "string")
|
|
58
58
|
return null;
|
|
59
|
-
const t =
|
|
59
|
+
const t = r.match(V);
|
|
60
60
|
if (t)
|
|
61
61
|
return t[0];
|
|
62
|
-
const e =
|
|
62
|
+
const e = r.match(P);
|
|
63
63
|
return e ? e[0] : null;
|
|
64
64
|
}
|
|
65
65
|
d(U, "extractInteractionId");
|
|
66
|
-
function
|
|
67
|
-
if (
|
|
68
|
-
return
|
|
69
|
-
const t =
|
|
66
|
+
function Q(r) {
|
|
67
|
+
if (r.length == 0)
|
|
68
|
+
return r;
|
|
69
|
+
const t = r.replaceAll("_", " ").replaceAll("-", " ");
|
|
70
70
|
return t[0].toUpperCase() + t.slice(1);
|
|
71
71
|
}
|
|
72
|
-
d(
|
|
73
|
-
function
|
|
74
|
-
return !
|
|
72
|
+
d(Q, "prettiffyPythonFunctionName");
|
|
73
|
+
function tt(r) {
|
|
74
|
+
return !r || typeof r != "string" ? !1 : !!(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(r) || /^[0-9a-f]{32}$/i.test(r));
|
|
75
75
|
}
|
|
76
|
-
d(
|
|
76
|
+
d(tt, "isValidInteractionId");
|
|
77
77
|
const M = /* @__PURE__ */ new Set(), E = class E {
|
|
78
78
|
constructor(t = {}) {
|
|
79
79
|
this.options = {
|
|
@@ -172,8 +172,8 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
172
172
|
* Make a specific table sortable
|
|
173
173
|
*/
|
|
174
174
|
makeTableSortable(t, e) {
|
|
175
|
-
let o = t.querySelector("thead"),
|
|
176
|
-
if (o && (
|
|
175
|
+
let o = t.querySelector("thead"), n = null, i = [];
|
|
176
|
+
if (o && (n = o.querySelector("tr"), n && (i = n.querySelectorAll("th"))), i.length === 0) {
|
|
177
177
|
console.warn("Table has no sortable columns, skipping");
|
|
178
178
|
return;
|
|
179
179
|
}
|
|
@@ -194,8 +194,8 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
194
194
|
replaceExponentialValues(t) {
|
|
195
195
|
const e = t.querySelector("tbody");
|
|
196
196
|
if (!e) return;
|
|
197
|
-
e.querySelectorAll("tr").forEach((
|
|
198
|
-
|
|
197
|
+
e.querySelectorAll("tr").forEach((n) => {
|
|
198
|
+
n.querySelectorAll("td, th").forEach((s) => {
|
|
199
199
|
const l = s.textContent.trim().match(/^([\d,]+\.?\d*)[eE][+-]?(\d+)$/);
|
|
200
200
|
if (l) {
|
|
201
201
|
const c = parseFloat(l[1].replace(/,/g, "")), u = parseInt(l[2]), f = c * Math.pow(10, u), h = this.formatNumber(f);
|
|
@@ -221,24 +221,24 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
221
221
|
*/
|
|
222
222
|
convertRowToHeader(t, e, o) {
|
|
223
223
|
try {
|
|
224
|
-
const
|
|
225
|
-
return
|
|
224
|
+
const n = t.cloneNode(!0);
|
|
225
|
+
return n.querySelectorAll("td").forEach((s) => {
|
|
226
226
|
const a = document.createElement("th");
|
|
227
227
|
Array.from(s.attributes).forEach((l) => {
|
|
228
228
|
a.setAttribute(l.name, l.value);
|
|
229
229
|
}), a.innerHTML = s.innerHTML, a.style.cssText = s.style.cssText, s.parentNode.replaceChild(a, s);
|
|
230
|
-
}), o && o.contains(t) ? o.removeChild(t) : t.parentNode && t.parentNode.removeChild(t), e.appendChild(
|
|
231
|
-
} catch (
|
|
232
|
-
return console.error("Error converting row to header:",
|
|
230
|
+
}), o && o.contains(t) ? o.removeChild(t) : t.parentNode && t.parentNode.removeChild(t), e.appendChild(n), n;
|
|
231
|
+
} catch (n) {
|
|
232
|
+
return console.error("Error converting row to header:", n), null;
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
/**
|
|
236
236
|
* Make a specific header sortable
|
|
237
237
|
*/
|
|
238
|
-
makeHeaderSortable(t, e, o,
|
|
239
|
-
t.classList.add(this.options.sortableClass), t.style.cursor = "pointer", (!this.options.preserveExistingIcons || !t.querySelector(".material-icons")) && this.addSortIcon(t), this.options.enableResizing && this.addResizing(t, e, o,
|
|
238
|
+
makeHeaderSortable(t, e, o, n) {
|
|
239
|
+
t.classList.add(this.options.sortableClass), t.style.cursor = "pointer", (!this.options.preserveExistingIcons || !t.querySelector(".material-icons")) && this.addSortIcon(t), this.options.enableResizing && this.addResizing(t, e, o, n), this.options.enableReordering && this.addDragAndDrop(t, e, o, n);
|
|
240
240
|
const i = /* @__PURE__ */ d((l) => {
|
|
241
|
-
l.preventDefault(), this.sortTable(e, o,
|
|
241
|
+
l.preventDefault(), this.sortTable(e, o, n);
|
|
242
242
|
}, "clickListener"), s = /* @__PURE__ */ d((l) => {
|
|
243
243
|
t.classList.contains(this.options.activeSortClass) || (t.style.background = this.options.theme.palette.surface.hover);
|
|
244
244
|
}, "mouseEnterListener"), a = /* @__PURE__ */ d((l) => {
|
|
@@ -263,12 +263,12 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
263
263
|
* Sort table by column
|
|
264
264
|
*/
|
|
265
265
|
sortTable(t, e, o) {
|
|
266
|
-
const
|
|
267
|
-
if (!
|
|
266
|
+
const n = t.querySelector("tbody");
|
|
267
|
+
if (!n) {
|
|
268
268
|
console.warn("Table has no tbody element");
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
|
-
const i = Array.from(
|
|
271
|
+
const i = Array.from(n.querySelectorAll("tr"));
|
|
272
272
|
if (i.length === 0) {
|
|
273
273
|
console.warn("Table has no data rows");
|
|
274
274
|
return;
|
|
@@ -280,14 +280,14 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
280
280
|
this.restoreOriginalOrder(t, i);
|
|
281
281
|
return;
|
|
282
282
|
}
|
|
283
|
-
this.sortRows(i, o, a).forEach((c) =>
|
|
283
|
+
this.sortRows(i, o, a).forEach((c) => n.appendChild(c));
|
|
284
284
|
}
|
|
285
285
|
/**
|
|
286
286
|
* Sort rows based on column data
|
|
287
287
|
*/
|
|
288
288
|
sortRows(t, e, o) {
|
|
289
|
-
return t.sort((
|
|
290
|
-
const s =
|
|
289
|
+
return t.sort((n, i) => {
|
|
290
|
+
const s = n.cells[e], a = i.cells[e];
|
|
291
291
|
if (!s || !a) return 0;
|
|
292
292
|
const l = this.extractValue(s), c = this.extractValue(a);
|
|
293
293
|
if (this.options.customSorters[e])
|
|
@@ -330,17 +330,17 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
330
330
|
/**
|
|
331
331
|
* Update visual indicators for sort state
|
|
332
332
|
*/
|
|
333
|
-
updateSortIndicators(t, e, o,
|
|
333
|
+
updateSortIndicators(t, e, o, n) {
|
|
334
334
|
const i = t.querySelectorAll("thead tr th");
|
|
335
335
|
if (i.forEach((s, a) => {
|
|
336
336
|
s.classList.remove(this.options.activeSortClass, this.options.ascendingClass, this.options.descendingClass);
|
|
337
337
|
const l = s.querySelector(".material-icons");
|
|
338
338
|
l && (l.textContent = this.options.unsortedIcon, l.style.opacity = "0.6");
|
|
339
|
-
}),
|
|
339
|
+
}), n !== "none") {
|
|
340
340
|
const s = i[o];
|
|
341
341
|
s.classList.add(this.options.activeSortClass);
|
|
342
342
|
const a = s.querySelector(".material-icons");
|
|
343
|
-
a && (
|
|
343
|
+
a && (n === "asc" ? (s.classList.add(this.options.ascendingClass), a.textContent = this.options.ascendingIcon) : (s.classList.add(this.options.descendingClass), a.textContent = this.options.descendingIcon), a.style.opacity = "1");
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
/**
|
|
@@ -348,12 +348,12 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
348
348
|
*/
|
|
349
349
|
restoreOriginalOrder(t, e) {
|
|
350
350
|
const o = t.querySelector("tbody");
|
|
351
|
-
e.forEach((
|
|
351
|
+
e.forEach((n) => o.appendChild(n));
|
|
352
352
|
}
|
|
353
353
|
/**
|
|
354
354
|
* Add resizing functionality to a header
|
|
355
355
|
*/
|
|
356
|
-
addResizing(t, e, o,
|
|
356
|
+
addResizing(t, e, o, n) {
|
|
357
357
|
if (t.classList.add(this.options.resizableClass), t.style.position = "relative", t.querySelector(".resize-handle"))
|
|
358
358
|
return;
|
|
359
359
|
const i = document.createElement("div");
|
|
@@ -389,7 +389,7 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
389
389
|
/**
|
|
390
390
|
* Add drag and drop functionality to a header
|
|
391
391
|
*/
|
|
392
|
-
addDragAndDrop(t, e, o,
|
|
392
|
+
addDragAndDrop(t, e, o, n) {
|
|
393
393
|
if (t.querySelector(".drag-handle"))
|
|
394
394
|
return;
|
|
395
395
|
t.classList.add(this.options.draggableClass), t.draggable = !0;
|
|
@@ -426,8 +426,8 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
426
426
|
* Create a custom drag image for better UX
|
|
427
427
|
*/
|
|
428
428
|
createCustomDragImage(t, e, o) {
|
|
429
|
-
const
|
|
430
|
-
|
|
429
|
+
const n = document.createElement("div");
|
|
430
|
+
n.style.cssText = `
|
|
431
431
|
position: absolute;
|
|
432
432
|
top: -1000px;
|
|
433
433
|
left: -1000px;
|
|
@@ -451,22 +451,22 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
451
451
|
align-items: center;
|
|
452
452
|
`;
|
|
453
453
|
const i = o;
|
|
454
|
-
|
|
454
|
+
n.innerHTML = `
|
|
455
455
|
<div style="display: flex; align-items: center; gap: 5px; align-content: center;color:white;">
|
|
456
456
|
<span style="overflow: hidden; text-overflow: ellipsis">${i}</span>
|
|
457
457
|
<svg style="fill: grey; font-size: 10px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20" ><defs><path id="a" d="M0 0h24v24H0V0z"/></defs><clipPath id="b"><use xlink:href="#a" overflow="visible"/></clipPath><path clip-path="url(#b)" d="M9.01 14H2v2h7.01v3L13 15l-3.99-4v3zm5.98-1v-3H22V8h-7.01V5L11 9l3.99 4z"/></svg>
|
|
458
458
|
</div>
|
|
459
|
-
`, document.body.appendChild(
|
|
460
|
-
document.body.contains(
|
|
459
|
+
`, document.body.appendChild(n), t.dataTransfer.setDragImage(n, 50, 12), setTimeout(() => {
|
|
460
|
+
document.body.contains(n) && document.body.removeChild(n);
|
|
461
461
|
}, 100);
|
|
462
462
|
}
|
|
463
463
|
/**
|
|
464
464
|
* Highlight an entire column during drag operations
|
|
465
465
|
*/
|
|
466
466
|
highlightColumn(t, e, o) {
|
|
467
|
-
const
|
|
468
|
-
if (!
|
|
469
|
-
const s =
|
|
467
|
+
const n = t.querySelector("thead tr"), i = t.querySelector("tbody");
|
|
468
|
+
if (!n || !i) return;
|
|
469
|
+
const s = n.children[e];
|
|
470
470
|
if (s)
|
|
471
471
|
if (o) {
|
|
472
472
|
s.classList.add(this.options.dragOverClass);
|
|
@@ -490,9 +490,9 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
490
490
|
clearAllColumnHighlights(t) {
|
|
491
491
|
const e = t.querySelector("thead tr"), o = t.querySelector("tbody");
|
|
492
492
|
if (!e || !o) return;
|
|
493
|
-
const
|
|
494
|
-
for (let s = 0; s <
|
|
495
|
-
|
|
493
|
+
const n = e.children;
|
|
494
|
+
for (let s = 0; s < n.length; s++)
|
|
495
|
+
n[s].classList.remove(this.options.dragOverClass);
|
|
496
496
|
const i = o.children;
|
|
497
497
|
for (let s = 0; s < i.length; s++) {
|
|
498
498
|
const a = i[s].children;
|
|
@@ -503,25 +503,25 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
503
503
|
/**
|
|
504
504
|
* Reorder columns in a table
|
|
505
505
|
*/
|
|
506
|
-
reorderColumns(t, e, o,
|
|
506
|
+
reorderColumns(t, e, o, n) {
|
|
507
507
|
const i = t.querySelector("thead tr"), s = t.querySelector("tbody");
|
|
508
508
|
if (!i || !s) return;
|
|
509
509
|
const a = Array.from(i.children), l = Array.from(s.children);
|
|
510
|
-
if (o < 0 || o >= a.length ||
|
|
510
|
+
if (o < 0 || o >= a.length || n < 0 || n >= a.length) {
|
|
511
511
|
console.warn("Invalid column indices for reordering");
|
|
512
512
|
return;
|
|
513
513
|
}
|
|
514
|
-
if (o ===
|
|
514
|
+
if (o === n)
|
|
515
515
|
return;
|
|
516
|
-
const c = a[o], u = a[
|
|
517
|
-
o <
|
|
518
|
-
const p = Array.from(h.children), y = p[o], v = p[
|
|
519
|
-
o <
|
|
516
|
+
const c = a[o], u = a[n];
|
|
517
|
+
o < n ? i.insertBefore(c, u.nextSibling) : i.insertBefore(c, u), l.forEach((h, m) => {
|
|
518
|
+
const p = Array.from(h.children), y = p[o], v = p[n];
|
|
519
|
+
o < n ? h.insertBefore(y, v.nextSibling) : h.insertBefore(y, v);
|
|
520
520
|
});
|
|
521
521
|
const f = this.originalColumnOrder.get(e);
|
|
522
522
|
if (f) {
|
|
523
523
|
const h = [...f], m = h[o];
|
|
524
|
-
h.splice(o, 1), h.splice(
|
|
524
|
+
h.splice(o, 1), h.splice(n, 0, m), this.originalColumnOrder.set(e, h);
|
|
525
525
|
}
|
|
526
526
|
this.applyTableStyles(t), this.refreshDragAndDropListeners(t, e);
|
|
527
527
|
}
|
|
@@ -545,13 +545,13 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
545
545
|
updateTableWidth(t) {
|
|
546
546
|
const e = t.querySelectorAll("th");
|
|
547
547
|
let o = 0;
|
|
548
|
-
e.forEach((
|
|
549
|
-
const i =
|
|
548
|
+
e.forEach((n) => {
|
|
549
|
+
const i = n.style.width;
|
|
550
550
|
if (i) {
|
|
551
551
|
const s = parseInt(i.replace("px", ""));
|
|
552
552
|
o += s;
|
|
553
553
|
} else {
|
|
554
|
-
const s =
|
|
554
|
+
const s = n.textContent.replace(/[📊🔍]/g, "").trim();
|
|
555
555
|
o += s.length;
|
|
556
556
|
}
|
|
557
557
|
}), t.style.width = `${o}px`;
|
|
@@ -561,11 +561,11 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
561
561
|
*/
|
|
562
562
|
calculateTableWidth(t) {
|
|
563
563
|
var f;
|
|
564
|
-
const e = t.getAttribute("data-original-width"), o = e ? parseFloat(e) : 0,
|
|
564
|
+
const e = t.getAttribute("data-original-width"), o = e ? parseFloat(e) : 0, n = t.querySelectorAll("th");
|
|
565
565
|
let i = 0;
|
|
566
566
|
t.parentElement.clientWidth;
|
|
567
567
|
const s = [];
|
|
568
|
-
|
|
568
|
+
n.forEach((h) => {
|
|
569
569
|
let p = h.textContent.replace(/[📊🔍]/g, "").trim().length * this.charWidth + 15;
|
|
570
570
|
s.push(p), i += p;
|
|
571
571
|
});
|
|
@@ -576,7 +576,7 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
576
576
|
const b = p.textContent.length * this.charWidth + 15;
|
|
577
577
|
b > s[y] && y < s.length && (s[y] = b);
|
|
578
578
|
});
|
|
579
|
-
c = s.reduce((h, m) => h += m, 0),
|
|
579
|
+
c = s.reduce((h, m) => h += m, 0), n.forEach((h, m) => {
|
|
580
580
|
if (c > l) {
|
|
581
581
|
const p = s[m] / c;
|
|
582
582
|
h.style.width = `${l * p}px`;
|
|
@@ -739,15 +739,15 @@ const M = /* @__PURE__ */ new Set(), E = class E {
|
|
|
739
739
|
*/
|
|
740
740
|
destroy() {
|
|
741
741
|
this.tables.forEach((e) => {
|
|
742
|
-
e.querySelectorAll(`.${this.options.sortableClass}`).forEach((
|
|
743
|
-
|
|
742
|
+
e.querySelectorAll(`.${this.options.sortableClass}`).forEach((n) => {
|
|
743
|
+
n.classList.remove(
|
|
744
744
|
this.options.sortableClass,
|
|
745
745
|
this.options.activeSortClass,
|
|
746
746
|
this.options.ascendingClass,
|
|
747
747
|
this.options.descendingClass
|
|
748
|
-
),
|
|
749
|
-
const i =
|
|
750
|
-
|
|
748
|
+
), n.style.cursor = "", n.style.background = "";
|
|
749
|
+
const i = n.cloneNode(!0);
|
|
750
|
+
n.parentNode.replaceChild(i, n);
|
|
751
751
|
});
|
|
752
752
|
});
|
|
753
753
|
const t = document.getElementById("sortable-table-styles");
|
|
@@ -764,45 +764,46 @@ d(E, "SortableTable"), /** Fallback advance width, in px, for one character of t
|
|
|
764
764
|
q(E, "DEFAULT_CHAR_WIDTH", 8);
|
|
765
765
|
let A = E;
|
|
766
766
|
typeof window < "u" && (window.SortableTable = A);
|
|
767
|
-
const
|
|
767
|
+
const _ = /* @__PURE__ */ new Set(["/", "@", "#"]), G = /* @__PURE__ */ d((r) => r === "/" ? "slash" : r === "@" ? "at" : "hash", "triggerTypeFor"), k = /[ \t\r\n\f\v]/, X = /[,;:.!?]/, j = /\[[^\]\n]+\]/g, H = /* @__PURE__ */ d((r, t, e) => {
|
|
768
768
|
let o = 0;
|
|
769
|
-
const
|
|
770
|
-
const s = i === 0 ? t :
|
|
771
|
-
return s === void 0 ||
|
|
769
|
+
const n = /* @__PURE__ */ d((i) => {
|
|
770
|
+
const s = i === 0 ? t : r[i - 1];
|
|
771
|
+
return s === void 0 || k.test(s);
|
|
772
772
|
}, "boundaryBefore");
|
|
773
|
-
for (; o <
|
|
774
|
-
const i =
|
|
775
|
-
if (
|
|
773
|
+
for (; o < r.length; ) {
|
|
774
|
+
const i = r[o];
|
|
775
|
+
if (n(o) && _.has(i)) {
|
|
776
776
|
let s = o + 1;
|
|
777
|
-
for (; s <
|
|
778
|
-
|
|
777
|
+
for (; s < r.length && !k.test(r[s]); ) s += 1;
|
|
778
|
+
for (; s > o + 1 && X.test(r[s - 1]); ) s -= 1;
|
|
779
|
+
e.push({ type: G(i), text: r.slice(o, s) }), o = s;
|
|
779
780
|
} else {
|
|
780
781
|
let s = o + 1;
|
|
781
|
-
for (; s <
|
|
782
|
-
const a =
|
|
783
|
-
if (
|
|
782
|
+
for (; s < r.length; ) {
|
|
783
|
+
const a = r[s];
|
|
784
|
+
if (_.has(a) && k.test(r[s - 1])) break;
|
|
784
785
|
s += 1;
|
|
785
786
|
}
|
|
786
|
-
e.push({ type: "plain", text:
|
|
787
|
+
e.push({ type: "plain", text: r.slice(o, s) }), o = s;
|
|
787
788
|
}
|
|
788
789
|
}
|
|
789
|
-
}, "tokenizeSegment"),
|
|
790
|
-
if (!
|
|
791
|
-
const t = [], e = new RegExp(
|
|
790
|
+
}, "tokenizeSegment"), et = /* @__PURE__ */ d((r) => {
|
|
791
|
+
if (!r) return [];
|
|
792
|
+
const t = [], e = new RegExp(j.source, "g");
|
|
792
793
|
let o = 0;
|
|
793
|
-
for (let
|
|
794
|
-
|
|
795
|
-
return o <
|
|
796
|
-
}, "tokenizeForHighlight"),
|
|
797
|
-
const e = t.filter((
|
|
798
|
-
if (e.length === 0) return
|
|
794
|
+
for (let n = e.exec(r); n; n = e.exec(r))
|
|
795
|
+
n.index > o && H(r.slice(o, n.index), o === 0 ? void 0 : r[o - 1], t), t.push({ type: "placeholder", text: n[0] }), o = n.index + n[0].length;
|
|
796
|
+
return o < r.length && H(r.slice(o), o === 0 ? void 0 : r[o - 1], t), t;
|
|
797
|
+
}, "tokenizeForHighlight"), st = /* @__PURE__ */ d((r, t) => {
|
|
798
|
+
const e = t.filter((n) => n.trim().length > 0).sort((n, i) => i.length - n.length);
|
|
799
|
+
if (e.length === 0) return r;
|
|
799
800
|
const o = [];
|
|
800
|
-
for (const
|
|
801
|
-
if (
|
|
802
|
-
o.push(
|
|
801
|
+
for (const n of r) {
|
|
802
|
+
if (n.type !== "plain") {
|
|
803
|
+
o.push(n);
|
|
803
804
|
continue;
|
|
804
805
|
}
|
|
805
|
-
let i =
|
|
806
|
+
let i = n.text;
|
|
806
807
|
for (; i.length > 0; ) {
|
|
807
808
|
let s = -1, a = 0;
|
|
808
809
|
for (const l of e) {
|
|
@@ -818,41 +819,41 @@ const H = /* @__PURE__ */ new Set(["/", "@", "#"]), X = /* @__PURE__ */ d((n) =>
|
|
|
818
819
|
}
|
|
819
820
|
return o;
|
|
820
821
|
}, "chipLocations");
|
|
821
|
-
function
|
|
822
|
-
const
|
|
822
|
+
function ot(r, t, e = t, o = 600) {
|
|
823
|
+
const n = r.value;
|
|
823
824
|
let i = !1;
|
|
824
825
|
const s = /* @__PURE__ */ d(() => {
|
|
825
|
-
i || (i = !0, document.removeEventListener("selectionchange", l),
|
|
826
|
+
i || (i = !0, document.removeEventListener("selectionchange", l), r.removeEventListener("keydown", s), r.removeEventListener("input", s), r.removeEventListener("pointerdown", s), window.clearTimeout(c), window.clearInterval(u));
|
|
826
827
|
}, "stop"), a = /* @__PURE__ */ d(() => {
|
|
827
|
-
if (
|
|
828
|
+
if (r.value !== n) {
|
|
828
829
|
s();
|
|
829
830
|
return;
|
|
830
831
|
}
|
|
831
|
-
|
|
832
|
+
r.selectionStart === t && r.selectionEnd === e || r.setSelectionRange(t, e);
|
|
832
833
|
}, "apply"), l = /* @__PURE__ */ d(() => {
|
|
833
|
-
document.activeElement ===
|
|
834
|
+
document.activeElement === r && a();
|
|
834
835
|
}, "onSelectionChange");
|
|
835
836
|
a();
|
|
836
837
|
const c = window.setTimeout(s, o), u = window.setInterval(a, 50);
|
|
837
|
-
return document.addEventListener("selectionchange", l),
|
|
838
|
+
return document.addEventListener("selectionchange", l), r.addEventListener("keydown", s), r.addEventListener("input", s), r.addEventListener("pointerdown", s), s;
|
|
838
839
|
}
|
|
839
|
-
d(
|
|
840
|
-
function
|
|
840
|
+
d(ot, "placeCaret");
|
|
841
|
+
function rt(r = {}) {
|
|
841
842
|
if (typeof document > "u") return;
|
|
842
843
|
const t = /* @__PURE__ */ d((i) => {
|
|
843
844
|
i.stopPropagation(), i.preventDefault(), o();
|
|
844
845
|
}, "onClick"), e = /* @__PURE__ */ d((i) => {
|
|
845
846
|
i.stopPropagation(), i.preventDefault(), document.removeEventListener("mousedown", e, !0);
|
|
846
847
|
}, "onMouseDown"), o = /* @__PURE__ */ d(() => {
|
|
847
|
-
document.removeEventListener("click", t, !0), document.removeEventListener("mousedown", e, !0), document.removeEventListener("pointerdown", o, !0), window.clearTimeout(
|
|
848
|
-
}, "cleanup"),
|
|
849
|
-
document.addEventListener("click", t, !0),
|
|
848
|
+
document.removeEventListener("click", t, !0), document.removeEventListener("mousedown", e, !0), document.removeEventListener("pointerdown", o, !0), window.clearTimeout(n);
|
|
849
|
+
}, "cleanup"), n = window.setTimeout(o, 500);
|
|
850
|
+
document.addEventListener("click", t, !0), r.mousedown && (document.addEventListener("mousedown", e, !0), document.addEventListener("pointerdown", o, !0));
|
|
850
851
|
}
|
|
851
|
-
d(
|
|
852
|
-
const
|
|
853
|
-
async function
|
|
852
|
+
d(rt, "swallowNextClick");
|
|
853
|
+
const nt = 3;
|
|
854
|
+
async function it(r, { onAtQuery: t, onAtPersonQuery: e }, {
|
|
854
855
|
personConfidence: o = 0,
|
|
855
|
-
locationConfidence:
|
|
856
|
+
locationConfidence: n = 0,
|
|
856
857
|
personFirstThreshold: i = 0.5,
|
|
857
858
|
vertical: s = "air",
|
|
858
859
|
hotelConfidence: a = 0,
|
|
@@ -862,12 +863,12 @@ async function nt(n, { onAtQuery: t, onAtPersonQuery: e }, {
|
|
|
862
863
|
byPriority: f = !1,
|
|
863
864
|
capLeading: h
|
|
864
865
|
} = {}) {
|
|
865
|
-
const m = o >= i && o >=
|
|
866
|
+
const m = o >= i && o >= n;
|
|
866
867
|
let p = [], y = [], v = !t, b = !e, D = null;
|
|
867
868
|
const N = /* @__PURE__ */ d((g, w, C, W) => w && h !== void 0 && t && e && !(W && C.length === 0) ? g.slice(0, h) : g, "cap"), L = /* @__PURE__ */ d((g, w) => {
|
|
868
869
|
const C = N(g, !m, w, b), $ = N(w, m, g, v).map((S) => S.kind ? S : { ...S, kind: "person" });
|
|
869
870
|
if (t && e) {
|
|
870
|
-
const S = $.map((
|
|
871
|
+
const S = $.map((T) => ({ ...T, group: "person" })), O = C.map((T) => ({ ...T, group: "location" }));
|
|
871
872
|
return m ? [...S, ...O] : [...O, ...S];
|
|
872
873
|
}
|
|
873
874
|
return [...$, ...C];
|
|
@@ -884,7 +885,7 @@ async function nt(n, { onAtQuery: t, onAtPersonQuery: e }, {
|
|
|
884
885
|
w !== D && (D = w, u(g));
|
|
885
886
|
}, "publish");
|
|
886
887
|
return await Promise.all([
|
|
887
|
-
t ? t(
|
|
888
|
+
t ? t(r, {
|
|
888
889
|
vertical: s,
|
|
889
890
|
hotelConfidence: a,
|
|
890
891
|
hotelNameConfidence: l,
|
|
@@ -896,20 +897,20 @@ async function nt(n, { onAtQuery: t, onAtPersonQuery: e }, {
|
|
|
896
897
|
}).catch(() => p).then((g) => {
|
|
897
898
|
p = g, v = !0, x();
|
|
898
899
|
}) : void 0,
|
|
899
|
-
e ? e(
|
|
900
|
+
e ? e(r, { leading: m, signal: c }).catch(() => []).then((g) => {
|
|
900
901
|
y = g, b = !0, x();
|
|
901
902
|
}) : void 0
|
|
902
903
|
]), L(p, y);
|
|
903
904
|
}
|
|
904
|
-
d(
|
|
905
|
-
function
|
|
906
|
-
var o,
|
|
907
|
-
const e = (o =
|
|
908
|
-
return e !== void 0 && (t === 0 || ((
|
|
905
|
+
d(it, "fetchAtMentions");
|
|
906
|
+
function at(r, t) {
|
|
907
|
+
var o, n;
|
|
908
|
+
const e = (o = r[t]) == null ? void 0 : o.group;
|
|
909
|
+
return e !== void 0 && (t === 0 || ((n = r[t - 1]) == null ? void 0 : n.group) !== e);
|
|
909
910
|
}
|
|
910
|
-
d(
|
|
911
|
-
function
|
|
912
|
-
return (
|
|
911
|
+
d(at, "isSectionStart");
|
|
912
|
+
function lt(r) {
|
|
913
|
+
return (r ?? []).map((t) => ({
|
|
913
914
|
id: t.key,
|
|
914
915
|
label: t.label,
|
|
915
916
|
value: t.insert ?? t.label,
|
|
@@ -921,23 +922,23 @@ function at(n) {
|
|
|
921
922
|
pred: t
|
|
922
923
|
}));
|
|
923
924
|
}
|
|
924
|
-
d(
|
|
925
|
+
d(lt, "toPredictionRows");
|
|
925
926
|
export {
|
|
926
|
-
|
|
927
|
+
nt as P,
|
|
927
928
|
A as S,
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
929
|
+
F as a,
|
|
930
|
+
Z as b,
|
|
931
|
+
st as c,
|
|
932
|
+
tt as d,
|
|
932
933
|
U as e,
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
934
|
+
it as f,
|
|
935
|
+
Q as g,
|
|
936
|
+
Y as h,
|
|
937
|
+
at as i,
|
|
938
|
+
rt as j,
|
|
939
|
+
et as k,
|
|
940
|
+
ot as p,
|
|
941
|
+
J as s,
|
|
942
|
+
lt as t
|
|
942
943
|
};
|
|
943
|
-
//# sourceMappingURL=predictionRows-
|
|
944
|
+
//# sourceMappingURL=predictionRows-BkBwfvt4.js.map
|