@luzmo/analytics-components-kit 1.0.1-alpha.140 → 1.0.1-alpha.141
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/README.md +17 -5
- package/angular/components/ai-interaction-textarea.component.ts +2 -0
- package/angular/components/grid.component.ts +2 -2
- package/angular/esm/components/ai-interaction-textarea.component.d.ts +2 -1
- package/angular/esm/components/ai-interaction-textarea.component.js +7 -2
- package/angular/esm/components/grid.component.d.ts +2 -2
- package/angular/esm/types/ai-chat.types.d.ts +1 -0
- package/angular/types/ai-chat.types.ts +1 -0
- package/components/ai-chat/ai-chat.d.ts +21 -1
- package/components/ai-chat/index.cjs +1 -1
- package/components/ai-chat/index.d.ts +1 -0
- package/components/ai-chat/index.js +3 -3
- package/components/ai-chat/request-contract.d.ts +38 -0
- package/components/ai-chat-BrTAn0m-.cjs +62 -0
- package/components/{ai-chat-Dg2dvhDq.js → ai-chat-D6fPnWEi.js} +211 -151
- package/components/ai-interaction-textarea/ai-interaction-textarea.d.ts +6 -0
- package/components/ai-interaction-textarea/index.cjs +1 -1
- package/components/ai-interaction-textarea/index.js +1 -1
- package/components/{ai-interaction-textarea-DDVKMfTQ.cjs → ai-interaction-textarea-BGnQbDpJ.cjs} +2 -2
- package/components/{ai-interaction-textarea-ZDQPVgXC.js → ai-interaction-textarea-EdWcPK0w.js} +6 -3
- package/components/grid/grid.d.ts +4 -9
- package/components/grid/helpers/grid-effects.d.ts +1 -0
- package/components/grid/helpers/grid-events.d.ts +50 -0
- package/components/grid/helpers/grid-interactions.d.ts +91 -0
- package/components/grid/helpers/grid-item-management.d.ts +45 -0
- package/components/grid/helpers/grid-item-popover.d.ts +15 -0
- package/components/grid/helpers/grid-items.d.ts +9 -0
- package/components/grid/helpers/grid-keyboard-updates.d.ts +18 -0
- package/components/grid/helpers/grid-keydown-event.d.ts +18 -0
- package/components/grid/helpers/grid-popover-cleanup.d.ts +4 -0
- package/components/grid/helpers/grid-rendering.d.ts +63 -0
- package/components/grid/helpers/grid-stack-lifecycle.d.ts +26 -0
- package/components/grid/helpers/grid-theme.d.ts +16 -0
- package/components/grid/helpers/grid-update-cycle.d.ts +24 -0
- package/components/grid/index.cjs +1 -1
- package/components/grid/index.js +1 -1
- package/components/grid-BNbbl-9p.cjs +316 -0
- package/components/{grid-BW6LPvCu.js → grid-Ca-fxUK1.js} +2341 -1965
- package/components/index.cjs +1 -1
- package/components/index.js +5 -5
- package/components/item-data-picker-panel/index.cjs +1 -1
- package/components/item-data-picker-panel/index.js +1 -1
- package/components/slot-contents-picker/index.cjs +1 -1
- package/components/slot-contents-picker/index.js +1 -1
- package/components/slot-contents-picker/slot-contents-picker.d.ts +4 -2
- package/components/{slot-contents-picker-HRJuZQq5.cjs → slot-contents-picker-BO5lSTDz.cjs} +4 -4
- package/components/{slot-contents-picker-CgACNIVS.js → slot-contents-picker-Bw_G1BwZ.js} +112 -92
- package/custom-elements.json +1558 -17
- package/package.json +2 -2
- package/types/ai-chat.types.d.ts +1 -0
- package/components/ai-chat-CbqvVZDp.cjs +0 -60
- package/components/grid-xtLaTdhb.cjs +0 -316
|
@@ -220,20 +220,20 @@ function createDOMPurify() {
|
|
|
220
220
|
let e = n.createElement("template");
|
|
221
221
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
222
222
|
}
|
|
223
|
-
let h, g = "", { implementation:
|
|
224
|
-
t.isSupported = typeof entries == "function" && typeof m == "function" &&
|
|
225
|
-
let { MUSTACHE_EXPR:
|
|
223
|
+
let h, g = "", { implementation: _, createNodeIterator: We, createDocumentFragment: Ge, getElementsByTagName: Ke } = n, { importNode: qe } = r, v = _createHooksMap();
|
|
224
|
+
t.isSupported = typeof entries == "function" && typeof m == "function" && _ && _.createHTMLDocument !== void 0;
|
|
225
|
+
let { MUSTACHE_EXPR: y, ERB_EXPR: b, TMPLIT_EXPR: x, DATA_ATTR: Je, ARIA_ATTR: Ye, IS_SCRIPT_OR_DATA: Xe, ATTR_WHITESPACE: Ze, CUSTOM_ELEMENT: Qe } = EXPRESSIONS, { IS_ALLOWED_URI: $e } = EXPRESSIONS, S = null, et = addToSet({}, [
|
|
226
226
|
...html$1,
|
|
227
227
|
...svg$1,
|
|
228
228
|
...svgFilters,
|
|
229
229
|
...mathMl$1,
|
|
230
230
|
...text
|
|
231
|
-
]),
|
|
231
|
+
]), C = null, tt = addToSet({}, [
|
|
232
232
|
...html$2,
|
|
233
233
|
...svg,
|
|
234
234
|
...mathMl,
|
|
235
235
|
...xml
|
|
236
|
-
]),
|
|
236
|
+
]), w = Object.seal(create(null, {
|
|
237
237
|
tagNameCheck: {
|
|
238
238
|
writable: !0,
|
|
239
239
|
configurable: !1,
|
|
@@ -252,7 +252,7 @@ function createDOMPurify() {
|
|
|
252
252
|
enumerable: !0,
|
|
253
253
|
value: !1
|
|
254
254
|
}
|
|
255
|
-
})),
|
|
255
|
+
})), T = null, E = null, D = Object.seal(create(null, {
|
|
256
256
|
tagCheck: {
|
|
257
257
|
writable: !0,
|
|
258
258
|
configurable: !1,
|
|
@@ -265,7 +265,7 @@ function createDOMPurify() {
|
|
|
265
265
|
enumerable: !0,
|
|
266
266
|
value: null
|
|
267
267
|
}
|
|
268
|
-
})),
|
|
268
|
+
})), nt = !0, O = !0, rt = !1, it = !0, k = !1, A = !0, j = !1, M = !1, N = !1, P = !1, F = !1, I = !1, at = !0, ot = !1, L = !0, R = !1, z = {}, B = null, st = addToSet({}, [
|
|
269
269
|
"annotation-xml",
|
|
270
270
|
"audio",
|
|
271
271
|
"colgroup",
|
|
@@ -291,14 +291,14 @@ function createDOMPurify() {
|
|
|
291
291
|
"title",
|
|
292
292
|
"video",
|
|
293
293
|
"xmp"
|
|
294
|
-
]),
|
|
294
|
+
]), ct = null, lt = addToSet({}, [
|
|
295
295
|
"audio",
|
|
296
296
|
"video",
|
|
297
297
|
"img",
|
|
298
298
|
"source",
|
|
299
299
|
"image",
|
|
300
300
|
"track"
|
|
301
|
-
]),
|
|
301
|
+
]), ut = null, dt = addToSet({}, [
|
|
302
302
|
"alt",
|
|
303
303
|
"class",
|
|
304
304
|
"for",
|
|
@@ -313,58 +313,58 @@ function createDOMPurify() {
|
|
|
313
313
|
"value",
|
|
314
314
|
"style",
|
|
315
315
|
"xmlns"
|
|
316
|
-
]),
|
|
317
|
-
B,
|
|
316
|
+
]), V = "http://www.w3.org/1998/Math/MathML", H = "http://www.w3.org/2000/svg", U = "http://www.w3.org/1999/xhtml", W = U, ft = !1, pt = null, mt = addToSet({}, [
|
|
318
317
|
V,
|
|
319
|
-
H
|
|
320
|
-
|
|
318
|
+
H,
|
|
319
|
+
U
|
|
320
|
+
], stringToString), G = addToSet({}, [
|
|
321
321
|
"mi",
|
|
322
322
|
"mo",
|
|
323
323
|
"mn",
|
|
324
324
|
"ms",
|
|
325
325
|
"mtext"
|
|
326
|
-
]),
|
|
326
|
+
]), K = addToSet({}, ["annotation-xml"]), ht = addToSet({}, [
|
|
327
327
|
"title",
|
|
328
328
|
"style",
|
|
329
329
|
"font",
|
|
330
330
|
"a",
|
|
331
331
|
"script"
|
|
332
|
-
]),
|
|
332
|
+
]), q = null, gt = ["application/xhtml+xml", "text/html"], J = null, Y = null, _t = n.createElement("form"), vt = function(e) {
|
|
333
333
|
return e instanceof RegExp || e instanceof Function;
|
|
334
|
-
},
|
|
334
|
+
}, yt = function() {
|
|
335
335
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
336
|
-
if (!(
|
|
337
|
-
if ((!e || typeof e != "object") && (e = {}), e = clone(e),
|
|
336
|
+
if (!(Y && Y === e)) {
|
|
337
|
+
if ((!e || typeof e != "object") && (e = {}), e = clone(e), q = gt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, J = q === "application/xhtml+xml" ? stringToString : stringToLowerCase, S = objectHasOwnProperty(e, "ALLOWED_TAGS") ? addToSet({}, e.ALLOWED_TAGS, J) : et, C = objectHasOwnProperty(e, "ALLOWED_ATTR") ? addToSet({}, e.ALLOWED_ATTR, J) : tt, pt = objectHasOwnProperty(e, "ALLOWED_NAMESPACES") ? addToSet({}, e.ALLOWED_NAMESPACES, stringToString) : mt, ut = objectHasOwnProperty(e, "ADD_URI_SAFE_ATTR") ? addToSet(clone(dt), e.ADD_URI_SAFE_ATTR, J) : dt, ct = objectHasOwnProperty(e, "ADD_DATA_URI_TAGS") ? addToSet(clone(lt), e.ADD_DATA_URI_TAGS, J) : lt, B = objectHasOwnProperty(e, "FORBID_CONTENTS") ? addToSet({}, e.FORBID_CONTENTS, J) : st, T = objectHasOwnProperty(e, "FORBID_TAGS") ? addToSet({}, e.FORBID_TAGS, J) : clone({}), E = objectHasOwnProperty(e, "FORBID_ATTR") ? addToSet({}, e.FORBID_ATTR, J) : clone({}), z = objectHasOwnProperty(e, "USE_PROFILES") ? e.USE_PROFILES : !1, nt = e.ALLOW_ARIA_ATTR !== !1, O = e.ALLOW_DATA_ATTR !== !1, rt = e.ALLOW_UNKNOWN_PROTOCOLS || !1, it = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, k = e.SAFE_FOR_TEMPLATES || !1, A = e.SAFE_FOR_XML !== !1, j = e.WHOLE_DOCUMENT || !1, P = e.RETURN_DOM || !1, F = e.RETURN_DOM_FRAGMENT || !1, I = e.RETURN_TRUSTED_TYPE || !1, N = e.FORCE_BODY || !1, at = e.SANITIZE_DOM !== !1, ot = e.SANITIZE_NAMED_PROPS || !1, L = e.KEEP_CONTENT !== !1, R = e.IN_PLACE || !1, $e = e.ALLOWED_URI_REGEXP || IS_ALLOWED_URI, W = e.NAMESPACE || U, G = e.MATHML_TEXT_INTEGRATION_POINTS || G, K = e.HTML_INTEGRATION_POINTS || K, w = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && vt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (w.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && vt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (w.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (w.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), k && (O = !1), F && (P = !0), z && (S = addToSet({}, text), C = [], z.html === !0 && (addToSet(S, html$1), addToSet(C, html$2)), z.svg === !0 && (addToSet(S, svg$1), addToSet(C, svg), addToSet(C, xml)), z.svgFilters === !0 && (addToSet(S, svgFilters), addToSet(C, svg), addToSet(C, xml)), z.mathMl === !0 && (addToSet(S, mathMl$1), addToSet(C, mathMl), addToSet(C, xml))), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? D.tagCheck = e.ADD_TAGS : (S === et && (S = clone(S)), addToSet(S, e.ADD_TAGS, J))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? D.attributeCheck = e.ADD_ATTR : (C === tt && (C = clone(C)), addToSet(C, e.ADD_ATTR, J))), e.ADD_URI_SAFE_ATTR && addToSet(ut, e.ADD_URI_SAFE_ATTR, J), e.FORBID_CONTENTS && (B === st && (B = clone(B)), addToSet(B, e.FORBID_CONTENTS, J)), e.ADD_FORBID_CONTENTS && (B === st && (B = clone(B)), addToSet(B, e.ADD_FORBID_CONTENTS, J)), L && (S["#text"] = !0), j && addToSet(S, [
|
|
338
338
|
"html",
|
|
339
339
|
"head",
|
|
340
340
|
"body"
|
|
341
|
-
]),
|
|
341
|
+
]), S.table && (addToSet(S, ["tbody"]), delete T.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
342
342
|
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
343
343
|
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
344
344
|
h = e.TRUSTED_TYPES_POLICY, g = h.createHTML("");
|
|
345
345
|
} else h === void 0 && (h = _createTrustedTypesPolicy(f, i)), h !== null && typeof g == "string" && (g = h.createHTML(""));
|
|
346
|
-
freeze && freeze(e),
|
|
346
|
+
freeze && freeze(e), Y = e;
|
|
347
347
|
}
|
|
348
|
-
},
|
|
348
|
+
}, bt = addToSet({}, [
|
|
349
349
|
...svg$1,
|
|
350
350
|
...svgFilters,
|
|
351
351
|
...svgDisallowed
|
|
352
|
-
]),
|
|
352
|
+
]), xt = addToSet({}, [...mathMl$1, ...mathMlDisallowed]), St = function(e) {
|
|
353
353
|
let t = m(e);
|
|
354
354
|
(!t || !t.tagName) && (t = {
|
|
355
|
-
namespaceURI:
|
|
355
|
+
namespaceURI: W,
|
|
356
356
|
tagName: "template"
|
|
357
357
|
});
|
|
358
358
|
let n = stringToLowerCase(e.tagName), r = stringToLowerCase(t.tagName);
|
|
359
|
-
return
|
|
360
|
-
},
|
|
359
|
+
return pt[e.namespaceURI] ? e.namespaceURI === H ? t.namespaceURI === U ? n === "svg" : t.namespaceURI === V ? n === "svg" && (r === "annotation-xml" || G[r]) : !!bt[n] : e.namespaceURI === V ? t.namespaceURI === U ? n === "math" : t.namespaceURI === H ? n === "math" && K[r] : !!xt[n] : e.namespaceURI === U ? t.namespaceURI === H && !K[r] || t.namespaceURI === V && !G[r] ? !1 : !xt[n] && (ht[n] || !bt[n]) : !!(q === "application/xhtml+xml" && pt[e.namespaceURI]) : !1;
|
|
360
|
+
}, X = function(e) {
|
|
361
361
|
arrayPush(t.removed, { element: e });
|
|
362
362
|
try {
|
|
363
363
|
m(e).removeChild(e);
|
|
364
364
|
} catch {
|
|
365
365
|
Ve(e);
|
|
366
366
|
}
|
|
367
|
-
},
|
|
367
|
+
}, Z = function(e, n) {
|
|
368
368
|
try {
|
|
369
369
|
arrayPush(t.removed, {
|
|
370
370
|
attribute: n.getAttributeNode(e),
|
|
@@ -376,55 +376,55 @@ function createDOMPurify() {
|
|
|
376
376
|
from: n
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
|
-
if (n.removeAttribute(e), e === "is") if (
|
|
380
|
-
|
|
379
|
+
if (n.removeAttribute(e), e === "is") if (P || F) try {
|
|
380
|
+
X(n);
|
|
381
381
|
} catch {}
|
|
382
382
|
else try {
|
|
383
383
|
n.setAttribute(e, "");
|
|
384
384
|
} catch {}
|
|
385
|
-
},
|
|
385
|
+
}, Ct = function(e) {
|
|
386
386
|
let t = null, r = null;
|
|
387
|
-
if (
|
|
387
|
+
if (N) e = "<remove></remove>" + e;
|
|
388
388
|
else {
|
|
389
389
|
let t = stringMatch(e, /^[\r\n\t ]+/);
|
|
390
390
|
r = t && t[0];
|
|
391
391
|
}
|
|
392
|
-
|
|
392
|
+
q === "application/xhtml+xml" && W === U && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
393
393
|
let i = h ? h.createHTML(e) : e;
|
|
394
|
-
if (
|
|
395
|
-
t = new ze().parseFromString(i,
|
|
394
|
+
if (W === U) try {
|
|
395
|
+
t = new ze().parseFromString(i, q);
|
|
396
396
|
} catch {}
|
|
397
397
|
if (!t || !t.documentElement) {
|
|
398
|
-
t =
|
|
398
|
+
t = _.createDocument(W, "template", null);
|
|
399
399
|
try {
|
|
400
|
-
t.documentElement.innerHTML =
|
|
400
|
+
t.documentElement.innerHTML = ft ? g : i;
|
|
401
401
|
} catch {}
|
|
402
402
|
}
|
|
403
403
|
let a = t.body || t.documentElement;
|
|
404
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null),
|
|
405
|
-
}, Ct = function(e) {
|
|
406
|
-
return Ge.call(e.ownerDocument || e, e, u.SHOW_ELEMENT | u.SHOW_COMMENT | u.SHOW_TEXT | u.SHOW_PROCESSING_INSTRUCTION | u.SHOW_CDATA_SECTION, null);
|
|
404
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), W === U ? Ke.call(t, j ? "html" : "body")[0] : j ? t.documentElement : a;
|
|
407
405
|
}, wt = function(e) {
|
|
406
|
+
return We.call(e.ownerDocument || e, e, u.SHOW_ELEMENT | u.SHOW_COMMENT | u.SHOW_TEXT | u.SHOW_PROCESSING_INSTRUCTION | u.SHOW_CDATA_SECTION, null);
|
|
407
|
+
}, Q = function(e) {
|
|
408
408
|
return e instanceof Re && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof d) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
|
409
409
|
}, Tt = function(e) {
|
|
410
410
|
return typeof c == "function" && e instanceof c;
|
|
411
411
|
};
|
|
412
412
|
function $(e, n, r) {
|
|
413
413
|
arrayForEach(e, (e) => {
|
|
414
|
-
e.call(t, n, r,
|
|
414
|
+
e.call(t, n, r, Y);
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
let Et = function(e) {
|
|
418
418
|
let n = null;
|
|
419
|
-
if ($(
|
|
420
|
-
let r =
|
|
421
|
-
if ($(
|
|
419
|
+
if ($(v.beforeSanitizeElements, e, null), Q(e)) return X(e), !0;
|
|
420
|
+
let r = J(e.nodeName);
|
|
421
|
+
if ($(v.uponSanitizeElement, e, {
|
|
422
422
|
tagName: r,
|
|
423
|
-
allowedTags:
|
|
424
|
-
}),
|
|
425
|
-
if (!(
|
|
426
|
-
if (!
|
|
427
|
-
if (
|
|
423
|
+
allowedTags: S
|
|
424
|
+
}), A && e.hasChildNodes() && !Tt(e.firstElementChild) && regExpTest(/<[/\w!]/g, e.innerHTML) && regExpTest(/<[/\w!]/g, e.textContent) || e.nodeType === NODE_TYPE.progressingInstruction || A && e.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, e.data)) return X(e), !0;
|
|
425
|
+
if (!(D.tagCheck instanceof Function && D.tagCheck(r)) && (!S[r] || T[r])) {
|
|
426
|
+
if (!T[r] && Ot(r) && (w.tagNameCheck instanceof RegExp && regExpTest(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r))) return !1;
|
|
427
|
+
if (L && !B[r]) {
|
|
428
428
|
let t = m(e) || e.parentNode, n = Ue(e) || e.childNodes;
|
|
429
429
|
if (n && t) {
|
|
430
430
|
let r = n.length;
|
|
@@ -434,65 +434,65 @@ function createDOMPurify() {
|
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
|
-
return
|
|
437
|
+
return X(e), !0;
|
|
438
438
|
}
|
|
439
|
-
return e instanceof l && !
|
|
440
|
-
v,
|
|
439
|
+
return e instanceof l && !St(e) || (r === "noscript" || r === "noembed" || r === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, e.innerHTML) ? (X(e), !0) : (k && e.nodeType === NODE_TYPE.text && (n = e.textContent, arrayForEach([
|
|
441
440
|
y,
|
|
442
|
-
b
|
|
441
|
+
b,
|
|
442
|
+
x
|
|
443
443
|
], (e) => {
|
|
444
444
|
n = stringReplace(n, e, " ");
|
|
445
|
-
}), e.textContent !== n && (arrayPush(t.removed, { element: e.cloneNode() }), e.textContent = n)), $(
|
|
445
|
+
}), e.textContent !== n && (arrayPush(t.removed, { element: e.cloneNode() }), e.textContent = n)), $(v.afterSanitizeElements, e, null), !1);
|
|
446
446
|
}, Dt = function(e, t, r) {
|
|
447
|
-
if (
|
|
448
|
-
if (!(
|
|
449
|
-
if (!
|
|
450
|
-
if (!(Ot(e) && (
|
|
451
|
-
} else if (!
|
|
447
|
+
if (at && (t === "id" || t === "name") && (r in n || r in _t)) return !1;
|
|
448
|
+
if (!(O && !E[t] && regExpTest(Je, t)) && !(nt && regExpTest(Ye, t)) && !(D.attributeCheck instanceof Function && D.attributeCheck(t, e))) {
|
|
449
|
+
if (!C[t] || E[t]) {
|
|
450
|
+
if (!(Ot(e) && (w.tagNameCheck instanceof RegExp && regExpTest(w.tagNameCheck, e) || w.tagNameCheck instanceof Function && w.tagNameCheck(e)) && (w.attributeNameCheck instanceof RegExp && regExpTest(w.attributeNameCheck, t) || w.attributeNameCheck instanceof Function && w.attributeNameCheck(t, e)) || t === "is" && w.allowCustomizedBuiltInElements && (w.tagNameCheck instanceof RegExp && regExpTest(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r)))) return !1;
|
|
451
|
+
} else if (!ut[t] && !regExpTest($e, stringReplace(r, Ze, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && stringIndexOf(r, "data:") === 0 && ct[e]) && !(rt && !regExpTest(Xe, stringReplace(r, Ze, ""))) && r) return !1;
|
|
452
452
|
}
|
|
453
453
|
return !0;
|
|
454
454
|
}, Ot = function(e) {
|
|
455
|
-
return e !== "annotation-xml" && stringMatch(e,
|
|
455
|
+
return e !== "annotation-xml" && stringMatch(e, Qe);
|
|
456
456
|
}, kt = function(e) {
|
|
457
|
-
$(
|
|
457
|
+
$(v.beforeSanitizeAttributes, e, null);
|
|
458
458
|
let { attributes: n } = e;
|
|
459
|
-
if (!n ||
|
|
459
|
+
if (!n || Q(e)) return;
|
|
460
460
|
let r = {
|
|
461
461
|
attrName: "",
|
|
462
462
|
attrValue: "",
|
|
463
463
|
keepAttr: !0,
|
|
464
|
-
allowedAttributes:
|
|
464
|
+
allowedAttributes: C,
|
|
465
465
|
forceKeepAttr: void 0
|
|
466
466
|
}, i = n.length;
|
|
467
467
|
for (; i--;) {
|
|
468
|
-
let { name: a, namespaceURI: o, value: s } = n[i], c =
|
|
469
|
-
if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, $(
|
|
470
|
-
|
|
468
|
+
let { name: a, namespaceURI: o, value: s } = n[i], c = J(a), l = s, u = a === "value" ? l : stringTrim(l);
|
|
469
|
+
if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, $(v.uponSanitizeAttribute, e, r), u = r.attrValue, ot && (c === "id" || c === "name") && (Z(a, e), u = "user-content-" + u), A && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, u)) {
|
|
470
|
+
Z(a, e);
|
|
471
471
|
continue;
|
|
472
472
|
}
|
|
473
473
|
if (c === "attributename" && stringMatch(u, "href")) {
|
|
474
|
-
|
|
474
|
+
Z(a, e);
|
|
475
475
|
continue;
|
|
476
476
|
}
|
|
477
477
|
if (r.forceKeepAttr) continue;
|
|
478
478
|
if (!r.keepAttr) {
|
|
479
|
-
|
|
479
|
+
Z(a, e);
|
|
480
480
|
continue;
|
|
481
481
|
}
|
|
482
|
-
if (!
|
|
483
|
-
|
|
482
|
+
if (!it && regExpTest(/\/>/i, u)) {
|
|
483
|
+
Z(a, e);
|
|
484
484
|
continue;
|
|
485
485
|
}
|
|
486
|
-
|
|
487
|
-
v,
|
|
486
|
+
k && arrayForEach([
|
|
488
487
|
y,
|
|
489
|
-
b
|
|
488
|
+
b,
|
|
489
|
+
x
|
|
490
490
|
], (e) => {
|
|
491
491
|
u = stringReplace(u, e, " ");
|
|
492
492
|
});
|
|
493
|
-
let d =
|
|
493
|
+
let d = J(e.nodeName);
|
|
494
494
|
if (!Dt(d, c, u)) {
|
|
495
|
-
|
|
495
|
+
Z(a, e);
|
|
496
496
|
continue;
|
|
497
497
|
}
|
|
498
498
|
if (h && typeof f == "object" && typeof f.getAttributeType == "function" && !o) switch (f.getAttributeType(d, c)) {
|
|
@@ -504,73 +504,101 @@ function createDOMPurify() {
|
|
|
504
504
|
break;
|
|
505
505
|
}
|
|
506
506
|
if (u !== l) try {
|
|
507
|
-
o ? e.setAttributeNS(o, a, u) : e.setAttribute(a, u),
|
|
507
|
+
o ? e.setAttributeNS(o, a, u) : e.setAttribute(a, u), Q(e) ? X(e) : arrayPop(t.removed);
|
|
508
508
|
} catch {
|
|
509
|
-
|
|
509
|
+
Z(a, e);
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
$(
|
|
512
|
+
$(v.afterSanitizeAttributes, e, null);
|
|
513
513
|
}, At = function e(t) {
|
|
514
|
-
let n = null, r =
|
|
515
|
-
for ($(
|
|
516
|
-
$(
|
|
514
|
+
let n = null, r = wt(t);
|
|
515
|
+
for ($(v.beforeSanitizeShadowDOM, t, null); n = r.nextNode();) $(v.uponSanitizeShadowNode, n, null), Et(n), kt(n), n.content instanceof a && e(n.content);
|
|
516
|
+
$(v.afterSanitizeShadowDOM, t, null);
|
|
517
517
|
};
|
|
518
518
|
return t.sanitize = function(e) {
|
|
519
519
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, s = null, l = null;
|
|
520
|
-
if (
|
|
520
|
+
if (ft = !e, ft && (e = "<!-->"), typeof e != "string" && !Tt(e)) if (typeof e.toString == "function") {
|
|
521
521
|
if (e = e.toString(), typeof e != "string") throw typeErrorCreate("dirty is not a string, aborting");
|
|
522
522
|
} else throw typeErrorCreate("toString is not a function");
|
|
523
523
|
if (!t.isSupported) return e;
|
|
524
|
-
if (
|
|
524
|
+
if (M || yt(n), t.removed = [], typeof e == "string" && (R = !1), R) {
|
|
525
525
|
if (e.nodeName) {
|
|
526
|
-
let t =
|
|
527
|
-
if (!
|
|
526
|
+
let t = J(e.nodeName);
|
|
527
|
+
if (!S[t] || T[t]) throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
|
|
528
528
|
}
|
|
529
|
-
} else if (e instanceof c) i =
|
|
529
|
+
} else if (e instanceof c) i = Ct("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === NODE_TYPE.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o);
|
|
530
530
|
else {
|
|
531
|
-
if (!
|
|
532
|
-
if (i =
|
|
531
|
+
if (!P && !k && !j && e.indexOf("<") === -1) return h && I ? h.createHTML(e) : e;
|
|
532
|
+
if (i = Ct(e), !i) return P ? null : I ? g : "";
|
|
533
533
|
}
|
|
534
|
-
i &&
|
|
535
|
-
let u =
|
|
534
|
+
i && N && X(i.firstChild);
|
|
535
|
+
let u = wt(R ? e : i);
|
|
536
536
|
for (; s = u.nextNode();) Et(s), kt(s), s.content instanceof a && At(s.content);
|
|
537
|
-
if (
|
|
538
|
-
if (
|
|
539
|
-
if (
|
|
537
|
+
if (R) return e;
|
|
538
|
+
if (P) {
|
|
539
|
+
if (F) for (l = Ge.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
|
|
540
540
|
else l = i;
|
|
541
|
-
return (
|
|
541
|
+
return (C.shadowroot || C.shadowrootmode) && (l = qe.call(r, l, !0)), l;
|
|
542
542
|
}
|
|
543
|
-
let d =
|
|
544
|
-
return
|
|
545
|
-
v,
|
|
543
|
+
let d = j ? i.outerHTML : i.innerHTML;
|
|
544
|
+
return j && S["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), k && arrayForEach([
|
|
546
545
|
y,
|
|
547
|
-
b
|
|
546
|
+
b,
|
|
547
|
+
x
|
|
548
548
|
], (e) => {
|
|
549
549
|
d = stringReplace(d, e, " ");
|
|
550
|
-
}), h &&
|
|
550
|
+
}), h && I ? h.createHTML(d) : d;
|
|
551
551
|
}, t.setConfig = function() {
|
|
552
|
-
|
|
552
|
+
yt(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), M = !0;
|
|
553
553
|
}, t.clearConfig = function() {
|
|
554
|
-
|
|
554
|
+
Y = null, M = !1;
|
|
555
555
|
}, t.isValidAttribute = function(e, t, n) {
|
|
556
|
-
return
|
|
556
|
+
return Y || yt({}), Dt(J(e), J(t), n);
|
|
557
557
|
}, t.addHook = function(e, t) {
|
|
558
|
-
typeof t == "function" && arrayPush(
|
|
558
|
+
typeof t == "function" && arrayPush(v[e], t);
|
|
559
559
|
}, t.removeHook = function(e, t) {
|
|
560
560
|
if (t !== void 0) {
|
|
561
|
-
let n = arrayLastIndexOf(
|
|
562
|
-
return n === -1 ? void 0 : arraySplice(
|
|
561
|
+
let n = arrayLastIndexOf(v[e], t);
|
|
562
|
+
return n === -1 ? void 0 : arraySplice(v[e], n, 1)[0];
|
|
563
563
|
}
|
|
564
|
-
return arrayPop(
|
|
564
|
+
return arrayPop(v[e]);
|
|
565
565
|
}, t.removeHooks = function(e) {
|
|
566
|
-
|
|
566
|
+
v[e] = [];
|
|
567
567
|
}, t.removeAllHooks = function() {
|
|
568
|
-
|
|
568
|
+
v = _createHooksMap();
|
|
569
569
|
}, t;
|
|
570
570
|
}
|
|
571
|
-
var purify = createDOMPurify(), ai_chat_module_default = ":host{box-sizing:border-box;flex-direction:column;width:100%;height:100%;display:flex}:host .chat-container{background:var(--luzmo-ai-chat-background,var(--ai-chat-background));border-radius:var(--luzmo-ai-chat-border-radius,var(--ai-chat-border-radius));width:100%;height:100%;min-height:0;padding:var(--luzmo-ai-chat-padding,var(--ai-chat-padding));gap:var(--luzmo-ai-chat-gap,var(--ai-chat-gap));border:var(--luzmo-ai-chat-border,var(--ai-chat-border));box-shadow:var(--luzmo-ai-chat-box-shadow,var(--ai-chat-box-shadow));flex-direction:column;flex:1;display:flex;overflow:hidden}:host .chat-messages-container{gap:var(--luzmo-ai-chat-gap,var(--ai-chat-gap));flex-direction:column;flex:1;display:flex;overflow:auto}:host luzmo-chat-message{--luzmo-primary:rgba(var(--luzmo-primary-rgb),.08);--chat-message-primary-text-color:var(--luzmo-font-color);--chat-message-primary-border-color:transparent}:host luzmo-ai-interaction-textarea{flex-grow:0;flex-shrink:0}:host{--ai-chat-background:var(--luzmo-background-color);--ai-chat-border-radius:0;--ai-chat-padding:0;--ai-chat-gap:1rem;--ai-chat-max-height:none;--ai-chat-messages-flex:1;--ai-chat-border:none;--ai-chat-box-shadow:none}"
|
|
571
|
+
var purify = createDOMPurify(), ai_chat_module_default = ":host{box-sizing:border-box;flex-direction:column;width:100%;height:100%;display:flex}:host .chat-container{background:var(--luzmo-ai-chat-background,var(--ai-chat-background));border-radius:var(--luzmo-ai-chat-border-radius,var(--ai-chat-border-radius));width:100%;height:100%;min-height:0;padding:var(--luzmo-ai-chat-padding,var(--ai-chat-padding));gap:var(--luzmo-ai-chat-gap,var(--ai-chat-gap));border:var(--luzmo-ai-chat-border,var(--ai-chat-border));box-shadow:var(--luzmo-ai-chat-box-shadow,var(--ai-chat-box-shadow));flex-direction:column;flex:1;display:flex;overflow:hidden}:host .chat-messages-container{gap:var(--luzmo-ai-chat-gap,var(--ai-chat-gap));flex-direction:column;flex:1;display:flex;overflow:auto}:host luzmo-chat-message{--luzmo-primary:rgba(var(--luzmo-primary-rgb),.08);--chat-message-primary-text-color:var(--luzmo-font-color);--chat-message-primary-border-color:transparent}:host luzmo-ai-interaction-textarea{flex-grow:0;flex-shrink:0}:host{--ai-chat-background:var(--luzmo-background-color);--ai-chat-border-radius:0;--ai-chat-padding:0;--ai-chat-gap:1rem;--ai-chat-max-height:none;--ai-chat-messages-flex:1;--ai-chat-border:none;--ai-chat-box-shadow:none}";
|
|
572
|
+
function buildAiMessageRequest(e) {
|
|
573
|
+
let { prompt: t, datasetIds: n, authKey: r, authToken: i, conversationId: a, chart: o, modelPreference: s, apiVersion: c = "0.1.0" } = e;
|
|
574
|
+
return {
|
|
575
|
+
key: r,
|
|
576
|
+
token: i,
|
|
577
|
+
action: "create",
|
|
578
|
+
version: c,
|
|
579
|
+
properties: {
|
|
580
|
+
content: {
|
|
581
|
+
role: "user",
|
|
582
|
+
content: t
|
|
583
|
+
},
|
|
584
|
+
...a ? { conversation_id: a } : {}
|
|
585
|
+
},
|
|
586
|
+
options: {
|
|
587
|
+
available_datasets: n,
|
|
588
|
+
...n.length > 0 ? { dataset_id: n[0] } : {},
|
|
589
|
+
...o ? { chart: {
|
|
590
|
+
...o,
|
|
591
|
+
title: o.title || o.options.title,
|
|
592
|
+
filters: o.filterGroups || [],
|
|
593
|
+
aichartId: o.aichartId || ""
|
|
594
|
+
} } : {},
|
|
595
|
+
model_preference: s
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
var LuzmoAiChat = class extends LuzmoElement {
|
|
572
600
|
constructor(...e) {
|
|
573
|
-
super(...e), this.messages = [], this.selectedDatasets = [], this.placeholder = "Describe your change", this.disabled = !1, this.showAssistantContextMenu = !1, this.authKey = "", this.authToken = "", this.apiUrl = "https://api.luzmo.com", this.appServer = "https://app.luzmo.com", this.flagOpendata = !1, this.hideDatasetButton = !1, this.modelPreference = "performance", this.conversationId = null, this.chart = null, this.
|
|
601
|
+
super(...e), this.messages = [], this.selectedDatasets = [], this.placeholder = "Describe your change", this.disabled = !1, this.showAssistantContextMenu = !1, this.authKey = "", this.authToken = "", this.apiUrl = "https://api.luzmo.com", this.appServer = "https://app.luzmo.com", this.flagOpendata = !1, this.hideDatasetButton = !1, this.modelPreference = "performance", this.requestMode = "internal", this.isGenerating = !1, this.conversationId = null, this.chart = null, this.apiVersion = "0.1.0", this._isGeneratingInternal = !1, this._textareaValue = "";
|
|
574
602
|
}
|
|
575
603
|
static {
|
|
576
604
|
this.styles = unsafeCSS(ai_chat_module_default);
|
|
@@ -581,41 +609,30 @@ var purify = createDOMPurify(), ai_chat_module_default = ":host{box-sizing:borde
|
|
|
581
609
|
_generateMessageId() {
|
|
582
610
|
return `msg-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
583
611
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
available_datasets: t,
|
|
599
|
-
...t.length > 0 && { dataset_id: t[0] },
|
|
600
|
-
...this.chart && { chart: {
|
|
601
|
-
...this.chart,
|
|
602
|
-
title: this.chart.title || this.chart.options.title,
|
|
603
|
-
filters: this.chart.filterGroups || [],
|
|
604
|
-
aichartId: this.chart.aichartId || ""
|
|
605
|
-
} },
|
|
606
|
-
model_preference: this.modelPreference
|
|
607
|
-
}
|
|
608
|
-
}, i = await fetch(n, {
|
|
612
|
+
_buildRequestBody(e, t) {
|
|
613
|
+
return buildAiMessageRequest({
|
|
614
|
+
prompt: e,
|
|
615
|
+
datasetIds: t,
|
|
616
|
+
authKey: this.authKey,
|
|
617
|
+
authToken: this.authToken,
|
|
618
|
+
conversationId: this.conversationId,
|
|
619
|
+
chart: this.chart,
|
|
620
|
+
modelPreference: this.modelPreference,
|
|
621
|
+
apiVersion: this.apiVersion
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
async _sendMessage(e) {
|
|
625
|
+
let t = `${this.apiUrl}/${this.apiVersion}/aimessage`, n = await fetch(t, {
|
|
609
626
|
method: "POST",
|
|
610
627
|
headers: { "Content-Type": "application/json" },
|
|
611
628
|
mode: "cors",
|
|
612
|
-
body: JSON.stringify(
|
|
629
|
+
body: JSON.stringify(e)
|
|
613
630
|
});
|
|
614
|
-
if (!
|
|
615
|
-
let e = await
|
|
616
|
-
throw Error(e?.message || `API request failed with status ${
|
|
631
|
+
if (!n.ok) {
|
|
632
|
+
let e = await n.json().catch(() => null);
|
|
633
|
+
throw Error(e?.message || `API request failed with status ${n.status}`);
|
|
617
634
|
}
|
|
618
|
-
return await
|
|
635
|
+
return await n.json();
|
|
619
636
|
}
|
|
620
637
|
async _addUserMessage(e, t) {
|
|
621
638
|
let n = {
|
|
@@ -633,7 +650,7 @@ var purify = createDOMPurify(), ai_chat_module_default = ":host{box-sizing:borde
|
|
|
633
650
|
})), await this.updateComplete, this._scrollToBottom();
|
|
634
651
|
}
|
|
635
652
|
_prepareForAIResponse() {
|
|
636
|
-
this.
|
|
653
|
+
this._isGeneratingInternal = !0;
|
|
637
654
|
let e = {
|
|
638
655
|
id: this._generateMessageId(),
|
|
639
656
|
type: "ai",
|
|
@@ -646,7 +663,9 @@ var purify = createDOMPurify(), ai_chat_module_default = ":host{box-sizing:borde
|
|
|
646
663
|
detail: { aiSampleChart: e },
|
|
647
664
|
bubbles: !0,
|
|
648
665
|
composed: !0
|
|
649
|
-
}))
|
|
666
|
+
}));
|
|
667
|
+
let n = e.message || e.error || e.clarificationQuestion;
|
|
668
|
+
n && (t.message = n, this.messages = [...this.messages.slice(0, -1), { ...t }], this.dispatchEvent(new CustomEvent("luzmo-response-received", {
|
|
650
669
|
detail: {
|
|
651
670
|
message: t,
|
|
652
671
|
done: !0
|
|
@@ -661,7 +680,7 @@ var purify = createDOMPurify(), ai_chat_module_default = ":host{box-sizing:borde
|
|
|
661
680
|
let t = e.functionResponse.explanation;
|
|
662
681
|
t && typeof t == "string" && (n = e.functionResponse.explanation);
|
|
663
682
|
} else n = e.functionResponse;
|
|
664
|
-
n && (t.message = n, this.messages = [...this.messages.slice(0, -1), { ...t }]), this.dispatchEvent(new CustomEvent("luzmo-response-received", {
|
|
683
|
+
n ||= e.message || e.error || e.clarificationQuestion || null, n && (t.message = n, this.messages = [...this.messages.slice(0, -1), { ...t }]), this.dispatchEvent(new CustomEvent("luzmo-response-received", {
|
|
665
684
|
detail: {
|
|
666
685
|
message: t,
|
|
667
686
|
done: !0
|
|
@@ -671,7 +690,7 @@ var purify = createDOMPurify(), ai_chat_module_default = ":host{box-sizing:borde
|
|
|
671
690
|
}));
|
|
672
691
|
}
|
|
673
692
|
_processAIResponse(e, t) {
|
|
674
|
-
e.generatedChart === void 0 ? (e.functionResponse?.error !== void 0 || typeof e.functionResponse == "string") && this._handleErrorResponse(e, t) : this._handleChartResponse(e, t);
|
|
693
|
+
e.generatedChart === void 0 ? (e.functionResponse?.error !== void 0 || typeof e.functionResponse == "string" || e.clarificationQuestion === "string") && this._handleErrorResponse(e, t) : this._handleChartResponse(e, t);
|
|
675
694
|
}
|
|
676
695
|
_handleAPIError(e) {
|
|
677
696
|
console.error("AI Chart Generation Error:", e);
|
|
@@ -690,15 +709,44 @@ var purify = createDOMPurify(), ai_chat_module_default = ":host{box-sizing:borde
|
|
|
690
709
|
}));
|
|
691
710
|
}
|
|
692
711
|
async _finalizeAIResponse() {
|
|
693
|
-
this.
|
|
712
|
+
this._isGeneratingInternal = !1, await this.updateComplete, this._scrollToBottom();
|
|
713
|
+
}
|
|
714
|
+
_handleDatasetSelected(e) {
|
|
715
|
+
let t = e.detail;
|
|
716
|
+
this.selectedDatasets.some((e) => e.id === t.id) || (this.selectedDatasets = [...this.selectedDatasets, t], this._emitDatasetsChanged());
|
|
717
|
+
}
|
|
718
|
+
_handleDatasetRemoved(e) {
|
|
719
|
+
let t = e.detail;
|
|
720
|
+
this.selectedDatasets = this.selectedDatasets.filter((e) => e.id !== t.id), this._emitDatasetsChanged();
|
|
721
|
+
}
|
|
722
|
+
_emitDatasetsChanged() {
|
|
723
|
+
this.dispatchEvent(new CustomEvent("luzmo-datasets-changed", {
|
|
724
|
+
detail: { selectedDatasets: this.selectedDatasets },
|
|
725
|
+
bubbles: !0,
|
|
726
|
+
composed: !0
|
|
727
|
+
}));
|
|
694
728
|
}
|
|
695
729
|
async _handlePromptSubmitted(e) {
|
|
696
|
-
let { prompt: t, selectedDatasets: n } = e.detail;
|
|
697
|
-
await this._addUserMessage(t, n)
|
|
698
|
-
|
|
730
|
+
let { prompt: t, selectedDatasets: n } = e.detail, r = n.map((e) => e.id), i = this._buildRequestBody(t, r);
|
|
731
|
+
if (await this._addUserMessage(t, n), this.requestMode === "external") {
|
|
732
|
+
let e = {
|
|
733
|
+
prompt: t,
|
|
734
|
+
selectedDatasets: n,
|
|
735
|
+
datasetIds: r,
|
|
736
|
+
request: i,
|
|
737
|
+
url: `${this.apiUrl}/${this.apiVersion}/aimessage`
|
|
738
|
+
};
|
|
739
|
+
this.dispatchEvent(new CustomEvent("luzmo-prompt-submitted", {
|
|
740
|
+
detail: e,
|
|
741
|
+
bubbles: !0,
|
|
742
|
+
composed: !0
|
|
743
|
+
}));
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
let a = await this._prepareForAIResponse();
|
|
699
747
|
try {
|
|
700
|
-
let e =
|
|
701
|
-
this._processAIResponse(
|
|
748
|
+
let e = await this._sendMessage(i);
|
|
749
|
+
this._processAIResponse(e, a);
|
|
702
750
|
} catch (e) {
|
|
703
751
|
this._handleAPIError(e);
|
|
704
752
|
} finally {
|
|
@@ -780,6 +828,7 @@ var purify = createDOMPurify(), ai_chat_module_default = ":host{box-sizing:borde
|
|
|
780
828
|
`);
|
|
781
829
|
}
|
|
782
830
|
render() {
|
|
831
|
+
let e = this.requestMode === "external" ? this.isGenerating : this._isGeneratingInternal;
|
|
783
832
|
return html`
|
|
784
833
|
<div class="chat-container">
|
|
785
834
|
<div class="chat-messages-container">
|
|
@@ -791,7 +840,7 @@ var purify = createDOMPurify(), ai_chat_module_default = ":host{box-sizing:borde
|
|
|
791
840
|
.selectedDatasets=${this.selectedDatasets}
|
|
792
841
|
.placeholder=${this.placeholder}
|
|
793
842
|
?disabled=${this.disabled}
|
|
794
|
-
?is-generating=${
|
|
843
|
+
?is-generating=${e}
|
|
795
844
|
?hide-dataset-button=${this.hideDatasetButton}
|
|
796
845
|
auth-key=${this.authKey}
|
|
797
846
|
auth-token=${this.authToken}
|
|
@@ -799,6 +848,8 @@ var purify = createDOMPurify(), ai_chat_module_default = ":host{box-sizing:borde
|
|
|
799
848
|
app-server=${this.appServer}
|
|
800
849
|
?flag-opendata=${this.flagOpendata}
|
|
801
850
|
@prompt-submitted=${this._handlePromptSubmitted}
|
|
851
|
+
@dataset-selected=${this._handleDatasetSelected}
|
|
852
|
+
@dataset-removed=${this._handleDatasetRemoved}
|
|
802
853
|
></luzmo-ai-interaction-textarea>
|
|
803
854
|
</div>
|
|
804
855
|
`;
|
|
@@ -835,10 +886,19 @@ __decorate([property({ type: Array })], LuzmoAiChat.prototype, "messages", void
|
|
|
835
886
|
type: String,
|
|
836
887
|
attribute: "model-preference"
|
|
837
888
|
})], LuzmoAiChat.prototype, "modelPreference", void 0), __decorate([property({
|
|
889
|
+
type: String,
|
|
890
|
+
attribute: "request-mode"
|
|
891
|
+
})], LuzmoAiChat.prototype, "requestMode", void 0), __decorate([property({
|
|
892
|
+
type: Boolean,
|
|
893
|
+
attribute: "is-generating"
|
|
894
|
+
})], LuzmoAiChat.prototype, "isGenerating", void 0), __decorate([property({
|
|
838
895
|
type: String,
|
|
839
896
|
attribute: "conversation-id"
|
|
840
897
|
})], LuzmoAiChat.prototype, "conversationId", void 0), __decorate([property({
|
|
841
898
|
type: Object,
|
|
842
899
|
attribute: "chart"
|
|
843
|
-
})], LuzmoAiChat.prototype, "chart", void 0), __decorate([
|
|
844
|
-
|
|
900
|
+
})], LuzmoAiChat.prototype, "chart", void 0), __decorate([property({
|
|
901
|
+
type: String,
|
|
902
|
+
attribute: "api-version"
|
|
903
|
+
})], LuzmoAiChat.prototype, "apiVersion", void 0), __decorate([state()], LuzmoAiChat.prototype, "_isGeneratingInternal", void 0), __decorate([state()], LuzmoAiChat.prototype, "_textareaValue", void 0), customElements.get("luzmo-ai-chat") || customElements.define("luzmo-ai-chat", LuzmoAiChat);
|
|
904
|
+
export { buildAiMessageRequest as n, LuzmoAiChat as t };
|