@smooai/chat-widget 0.5.1 → 0.5.2
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/chat-widget.global.js +119 -69
- package/dist/chat-widget.global.js.map +1 -1
- package/dist/index.js +67 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48,6 +48,44 @@ function needsUserInfo(resolved) {
|
|
|
48
48
|
return !resolved.allowAnonymous && (resolved.requireName || resolved.requireEmail || resolved.requirePhone);
|
|
49
49
|
}
|
|
50
50
|
//#endregion
|
|
51
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/typeof.js
|
|
52
|
+
function _typeof(o) {
|
|
53
|
+
"@babel/helpers - typeof";
|
|
54
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
55
|
+
return typeof o;
|
|
56
|
+
} : function(o) {
|
|
57
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
58
|
+
}, _typeof(o);
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPrimitive.js
|
|
62
|
+
function toPrimitive(t, r) {
|
|
63
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
64
|
+
var e = t[Symbol.toPrimitive];
|
|
65
|
+
if (void 0 !== e) {
|
|
66
|
+
var i = e.call(t, r || "default");
|
|
67
|
+
if ("object" != _typeof(i)) return i;
|
|
68
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
69
|
+
}
|
|
70
|
+
return ("string" === r ? String : Number)(t);
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPropertyKey.js
|
|
74
|
+
function toPropertyKey(t) {
|
|
75
|
+
var i = toPrimitive(t, "string");
|
|
76
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/defineProperty.js
|
|
80
|
+
function _defineProperty(e, r, t) {
|
|
81
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
82
|
+
value: t,
|
|
83
|
+
enumerable: !0,
|
|
84
|
+
configurable: !0,
|
|
85
|
+
writable: !0
|
|
86
|
+
}) : e[r] = t, e;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
51
89
|
//#region src/conversation.ts
|
|
52
90
|
/**
|
|
53
91
|
* ConversationController — the bridge between the widget UI and the
|
|
@@ -107,19 +145,17 @@ function extractCitations(inner) {
|
|
|
107
145
|
return out;
|
|
108
146
|
}
|
|
109
147
|
var ConversationController = class {
|
|
110
|
-
config;
|
|
111
|
-
events;
|
|
112
|
-
client = null;
|
|
113
|
-
sessionId = null;
|
|
114
|
-
messages = [];
|
|
115
|
-
status = "idle";
|
|
116
|
-
seq = 0;
|
|
117
|
-
/** Visitor identity, seeded from config and updated by the pre-chat form. */
|
|
118
|
-
identity;
|
|
119
|
-
/** requestId of the in-flight turn — used to resume OTP / tool confirmations. */
|
|
120
|
-
activeRequestId = null;
|
|
121
|
-
interrupt = null;
|
|
122
148
|
constructor(config, events) {
|
|
149
|
+
_defineProperty(this, "config", void 0);
|
|
150
|
+
_defineProperty(this, "events", void 0);
|
|
151
|
+
_defineProperty(this, "client", null);
|
|
152
|
+
_defineProperty(this, "sessionId", null);
|
|
153
|
+
_defineProperty(this, "messages", []);
|
|
154
|
+
_defineProperty(this, "status", "idle");
|
|
155
|
+
_defineProperty(this, "seq", 0);
|
|
156
|
+
_defineProperty(this, "identity", void 0);
|
|
157
|
+
_defineProperty(this, "activeRequestId", null);
|
|
158
|
+
_defineProperty(this, "interrupt", null);
|
|
123
159
|
this.config = config;
|
|
124
160
|
this.events = events;
|
|
125
161
|
this.identity = {
|
|
@@ -939,31 +975,27 @@ var SmoothAgentChatElement = class extends HTMLElement {
|
|
|
939
975
|
static get observedAttributes() {
|
|
940
976
|
return OBSERVED;
|
|
941
977
|
}
|
|
942
|
-
root;
|
|
943
|
-
controller = null;
|
|
944
|
-
overrides = {};
|
|
945
|
-
open = false;
|
|
946
|
-
messages = [];
|
|
947
|
-
status = "idle";
|
|
948
|
-
mounted = false;
|
|
949
|
-
/** True once the visitor has cleared the pre-chat identity gate (or it's not needed). */
|
|
950
|
-
userInfoSatisfied = false;
|
|
951
|
-
/** True after the visitor has sent their first message (hides starter chips). */
|
|
952
|
-
hasSent = false;
|
|
953
|
-
/** Starter prompts shown as chips in the empty state. */
|
|
954
|
-
examplePrompts = [];
|
|
955
|
-
/** Current mid-turn interrupt (OTP / tool-confirmation), or null. */
|
|
956
|
-
interrupt = null;
|
|
957
|
-
interruptEl = null;
|
|
958
|
-
panelEl = null;
|
|
959
|
-
launcherEl = null;
|
|
960
|
-
messagesEl = null;
|
|
961
|
-
statusEl = null;
|
|
962
|
-
dotEl = null;
|
|
963
|
-
inputEl = null;
|
|
964
|
-
sendBtn = null;
|
|
965
978
|
constructor() {
|
|
966
979
|
super();
|
|
980
|
+
_defineProperty(this, "root", void 0);
|
|
981
|
+
_defineProperty(this, "controller", null);
|
|
982
|
+
_defineProperty(this, "overrides", {});
|
|
983
|
+
_defineProperty(this, "open", false);
|
|
984
|
+
_defineProperty(this, "messages", []);
|
|
985
|
+
_defineProperty(this, "status", "idle");
|
|
986
|
+
_defineProperty(this, "mounted", false);
|
|
987
|
+
_defineProperty(this, "userInfoSatisfied", false);
|
|
988
|
+
_defineProperty(this, "hasSent", false);
|
|
989
|
+
_defineProperty(this, "examplePrompts", []);
|
|
990
|
+
_defineProperty(this, "interrupt", null);
|
|
991
|
+
_defineProperty(this, "interruptEl", null);
|
|
992
|
+
_defineProperty(this, "panelEl", null);
|
|
993
|
+
_defineProperty(this, "launcherEl", null);
|
|
994
|
+
_defineProperty(this, "messagesEl", null);
|
|
995
|
+
_defineProperty(this, "statusEl", null);
|
|
996
|
+
_defineProperty(this, "dotEl", null);
|
|
997
|
+
_defineProperty(this, "inputEl", null);
|
|
998
|
+
_defineProperty(this, "sendBtn", null);
|
|
967
999
|
this.root = this.attachShadow({ mode: "open" });
|
|
968
1000
|
}
|
|
969
1001
|
connectedCallback() {
|