@glydeunity/voice-sdk 1.6.22 → 1.6.23
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/glyde-chat.umd.js +9 -9
- package/dist/glyde-chat.umd.js.map +1 -1
- package/dist/index.d.ts +23 -2
- package/dist/voice-sdk.es.js +338 -297
- package/dist/voice-sdk.es.js.map +1 -1
- package/package.json +1 -1
package/dist/voice-sdk.es.js
CHANGED
|
@@ -195,15 +195,15 @@ class Ji {
|
|
|
195
195
|
let r = o ? `${T}/${encodeURIComponent(o)}` : T;
|
|
196
196
|
const z = new URLSearchParams();
|
|
197
197
|
this.config.skipContinuityLimit === !0 && z.set("skip_continuity_limit", "true"), this.config.limitToLast != null && this.config.limitToLast > 0 && z.set("limit_to_last", String(this.config.limitToLast)), z.toString() && (r += (r.includes("?") ? "&" : "?") + z.toString());
|
|
198
|
-
const
|
|
198
|
+
const _ = await fetch(r, {
|
|
199
199
|
method: "GET",
|
|
200
200
|
headers: this.getAuthHeaders()
|
|
201
201
|
});
|
|
202
|
-
if (!
|
|
203
|
-
const U = await
|
|
204
|
-
throw new Error(U.error?.message || U.message || `Failed to fetch voice config: ${
|
|
202
|
+
if (!_.ok) {
|
|
203
|
+
const U = await _.json().catch(() => ({}));
|
|
204
|
+
throw new Error(U.error?.message || U.message || `Failed to fetch voice config: ${_.status}`);
|
|
205
205
|
}
|
|
206
|
-
const { data: H } = await
|
|
206
|
+
const { data: H } = await _.json();
|
|
207
207
|
return H;
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
@@ -233,7 +233,7 @@ class Ji {
|
|
|
233
233
|
const R = await o.json();
|
|
234
234
|
throw new Error(R.error?.message || R.message || "Failed to authenticate voice session");
|
|
235
235
|
}
|
|
236
|
-
const { data: T } = await o.json(), { token: r, agent_config: z, deepgram_config:
|
|
236
|
+
const { data: T } = await o.json(), { token: r, agent_config: z, deepgram_config: _ } = T;
|
|
237
237
|
this.setSessionContext({
|
|
238
238
|
clientUuid: z?.client_uuid,
|
|
239
239
|
contextId: this.config.contextId,
|
|
@@ -243,7 +243,7 @@ class Ji {
|
|
|
243
243
|
const H = z?.instructions || this.serverConfig?.system_prompt || "You are not available at the moment. Please try again later. Do not accept any questions.";
|
|
244
244
|
await this.initializeAudio();
|
|
245
245
|
let U = "wss://agent.deepgram.com/v1/agent/converse";
|
|
246
|
-
const x = this.config.deepgramConfig ||
|
|
246
|
+
const x = this.config.deepgramConfig || _ || this.serverConfig?.deepgram_config;
|
|
247
247
|
if (x?.tags && x.tags.length > 0) {
|
|
248
248
|
const R = new URLSearchParams();
|
|
249
249
|
x.tags.forEach((j) => R.append("tag", j)), U += `?${R.toString()}`;
|
|
@@ -338,6 +338,15 @@ class Ji {
|
|
|
338
338
|
* Initialize the audio system with both capture and playback worklets.
|
|
339
339
|
* Uses inline blob URLs to avoid CORS issues when SDK is embedded in external apps.
|
|
340
340
|
*/
|
|
341
|
+
/**
|
|
342
|
+
* Initialize the audio system: AudioContext, worklet modules, playback node,
|
|
343
|
+
* and pre-acquire the microphone stream.
|
|
344
|
+
*
|
|
345
|
+
* Pre-acquiring the mic here (before the WebSocket even connects) ensures
|
|
346
|
+
* the stream is ready the instant startMicrophone() wires it up. Without
|
|
347
|
+
* this, getUserMedia was only called after SettingsApplied/PromptUpdated,
|
|
348
|
+
* creating a timing gap where the user's first spoken response could be lost.
|
|
349
|
+
*/
|
|
341
350
|
async initializeAudio() {
|
|
342
351
|
this.audioContext = new AudioContext({ sampleRate: this.inputSampleRate });
|
|
343
352
|
const f = this.createWorkletBlobUrl(yg), o = this.createWorkletBlobUrl(gg);
|
|
@@ -349,7 +358,14 @@ class Ji {
|
|
|
349
358
|
} finally {
|
|
350
359
|
URL.revokeObjectURL(f), URL.revokeObjectURL(o);
|
|
351
360
|
}
|
|
352
|
-
this.
|
|
361
|
+
this.mediaStream = await navigator.mediaDevices.getUserMedia({
|
|
362
|
+
audio: {
|
|
363
|
+
channelCount: 1,
|
|
364
|
+
sampleRate: this.inputSampleRate,
|
|
365
|
+
echoCancellation: !0,
|
|
366
|
+
noiseSuppression: !0
|
|
367
|
+
}
|
|
368
|
+
}), this.playbackWorkletNode = new AudioWorkletNode(this.audioContext, "audio-playback-processor"), this.playbackWorkletNode.connect(this.audioContext.destination), this.playbackWorkletNode.port.onmessage = (T) => {
|
|
353
369
|
const { type: r } = T.data;
|
|
354
370
|
(r === "cleared" || r === "bufferEmpty") && (this.isAgentSpeaking = !1, this.agentAudioDoneReceived = !1, this.emit({ type: "agent_speaking", payload: !1 }), this.tryFlushPendingContextReinit());
|
|
355
371
|
};
|
|
@@ -415,10 +431,10 @@ class Ji {
|
|
|
415
431
|
if (o === 0) return;
|
|
416
432
|
const T = o - o % 2;
|
|
417
433
|
if (T === 0) return;
|
|
418
|
-
const r = T === o ? f : f.slice(0, T), z = new Int16Array(r),
|
|
434
|
+
const r = T === o ? f : f.slice(0, T), z = new Int16Array(r), _ = new Float32Array(z.length);
|
|
419
435
|
for (let x = 0; x < z.length; x++)
|
|
420
|
-
|
|
421
|
-
const H = this.resample24kTo48k(
|
|
436
|
+
_[x] = z[x] / 32768;
|
|
437
|
+
const H = this.resample24kTo48k(_);
|
|
422
438
|
!this.isAgentSpeaking && !this.agentAudioDoneReceived && (this.isAgentSpeaking = !0, this.emit({ type: "agent_speaking", payload: !0 }));
|
|
423
439
|
const U = new Float32Array(H);
|
|
424
440
|
this.playbackWorkletNode.port.postMessage({
|
|
@@ -432,8 +448,8 @@ class Ji {
|
|
|
432
448
|
resample24kTo48k(f) {
|
|
433
449
|
const o = f.length * 2, T = new Float32Array(o);
|
|
434
450
|
for (let z = 0; z < f.length - 1; z++) {
|
|
435
|
-
const
|
|
436
|
-
T[z * 2] =
|
|
451
|
+
const _ = f[z], H = f[z + 1];
|
|
452
|
+
T[z * 2] = _, T[z * 2 + 1] = (_ + H) / 2;
|
|
437
453
|
}
|
|
438
454
|
const r = f.length - 1;
|
|
439
455
|
return T[r * 2] = f[r], T[r * 2 + 1] = f[r], T;
|
|
@@ -447,18 +463,23 @@ class Ji {
|
|
|
447
463
|
/**
|
|
448
464
|
* Start capturing microphone audio using AudioWorklet
|
|
449
465
|
*/
|
|
466
|
+
/**
|
|
467
|
+
* Wire the pre-acquired microphone stream to the capture worklet so audio
|
|
468
|
+
* data starts flowing to the WebSocket. The stream itself was already
|
|
469
|
+
* obtained in initializeAudio() to avoid getUserMedia latency here.
|
|
470
|
+
*/
|
|
450
471
|
async startMicrophone() {
|
|
451
472
|
if (!this.audioContext)
|
|
452
473
|
throw new Error("Audio context not initialized");
|
|
453
474
|
try {
|
|
454
|
-
this.mediaStream = await navigator.mediaDevices.getUserMedia({
|
|
475
|
+
this.mediaStream || (console.warn("[GlydeVoice] mediaStream not pre-acquired, calling getUserMedia now"), this.mediaStream = await navigator.mediaDevices.getUserMedia({
|
|
455
476
|
audio: {
|
|
456
477
|
channelCount: 1,
|
|
457
478
|
sampleRate: this.inputSampleRate,
|
|
458
479
|
echoCancellation: !0,
|
|
459
480
|
noiseSuppression: !0
|
|
460
481
|
}
|
|
461
|
-
});
|
|
482
|
+
}));
|
|
462
483
|
const f = this.audioContext.createMediaStreamSource(this.mediaStream);
|
|
463
484
|
this.captureWorkletNode = new AudioWorkletNode(this.audioContext, "audio-capture-processor"), this.captureWorkletNode.port.onmessage = (o) => {
|
|
464
485
|
!this.active || !this.ws || this.ws.readyState !== WebSocket.OPEN || this.isMuted || this.ws.send(o.data);
|
|
@@ -559,16 +580,16 @@ class Ji {
|
|
|
559
580
|
let T = {};
|
|
560
581
|
try {
|
|
561
582
|
T = o.arguments ? JSON.parse(o.arguments) : {};
|
|
562
|
-
} catch (
|
|
563
|
-
console.warn("[GlydeVoice] Failed to parse function arguments:",
|
|
583
|
+
} catch (_) {
|
|
584
|
+
console.warn("[GlydeVoice] Failed to parse function arguments:", _);
|
|
564
585
|
}
|
|
565
586
|
let r;
|
|
566
587
|
try {
|
|
567
588
|
o.name === "end_conversation" ? r = await this.handleEndConversation(T) : r = await this.executeVoiceFunction(o.name, o.id, T);
|
|
568
|
-
} catch (
|
|
569
|
-
console.error("[GlydeVoice] Function call error:",
|
|
589
|
+
} catch (_) {
|
|
590
|
+
console.error("[GlydeVoice] Function call error:", _), r = JSON.stringify({
|
|
570
591
|
error: "Function execution failed",
|
|
571
|
-
details:
|
|
592
|
+
details: _ instanceof Error ? _.message : String(_)
|
|
572
593
|
});
|
|
573
594
|
}
|
|
574
595
|
const z = {
|
|
@@ -579,9 +600,9 @@ class Ji {
|
|
|
579
600
|
};
|
|
580
601
|
this.ws && this.ws.readyState === WebSocket.OPEN ? (this.ws.send(JSON.stringify(z)), console.log("[GlydeVoice] Function response sent:", o.name)) : console.error("[GlydeVoice] Cannot send function response - WebSocket not open");
|
|
581
602
|
try {
|
|
582
|
-
const
|
|
583
|
-
if (
|
|
584
|
-
const H =
|
|
603
|
+
const _ = typeof r == "string" ? JSON.parse(r) : r;
|
|
604
|
+
if (_ && typeof _ == "object" && _.context_switch && typeof _.context_switch.contextType == "string" && typeof _.context_switch.contextId == "string") {
|
|
605
|
+
const H = _.context_switch;
|
|
585
606
|
this.emit({ type: "context_switch", payload: H }), this.pendingContextReinit = { contextType: H.contextType, contextId: H.contextId }, this.pendingContextReinitFallbackTimer && clearTimeout(this.pendingContextReinitFallbackTimer), this.pendingContextReinitFallbackTimer = setTimeout(() => {
|
|
586
607
|
this.pendingContextReinitFallbackTimer = null, this.tryFlushPendingContextReinit();
|
|
587
608
|
}, Ji.PENDING_REINIT_FALLBACK_MS), console.log("[GlydeVoice] Context switch requested; will reinitialize when agent stops speaking or after", Ji.PENDING_REINIT_FALLBACK_MS / 1e3, "s:", H);
|
|
@@ -619,17 +640,17 @@ class Ji {
|
|
|
619
640
|
})
|
|
620
641
|
});
|
|
621
642
|
if (!r.ok) {
|
|
622
|
-
const
|
|
643
|
+
const _ = await r.json().catch(() => ({})), H = _.error?.message || _.message || `HTTP ${r.status}`;
|
|
623
644
|
throw console.error("[GlydeVoice] Voice function API call failed:", r.status, H), new Error(H);
|
|
624
645
|
}
|
|
625
646
|
const z = await r.json();
|
|
626
647
|
if (z.success && z.data?.output !== void 0) {
|
|
627
|
-
const
|
|
628
|
-
if (typeof
|
|
629
|
-
const H =
|
|
648
|
+
const _ = z.data.output;
|
|
649
|
+
if (typeof _ == "object" && _ !== null && _.success === !1) {
|
|
650
|
+
const H = _.error ?? _.fallback_message;
|
|
630
651
|
console.warn("[GlydeVoice] Voice function backend reported failure:", f, H);
|
|
631
652
|
}
|
|
632
|
-
return typeof
|
|
653
|
+
return typeof _ == "string" ? _ : JSON.stringify(_);
|
|
633
654
|
}
|
|
634
655
|
throw console.error("[GlydeVoice] Voice function invalid response:", z), new Error("Invalid response from voice function endpoint");
|
|
635
656
|
} catch (r) {
|
|
@@ -710,12 +731,12 @@ class Ji {
|
|
|
710
731
|
promptLength: T?.system_prompt?.length || 0,
|
|
711
732
|
promptPreview: T?.system_prompt?.substring(0, 200) || "(no prompt)"
|
|
712
733
|
});
|
|
713
|
-
const r = T?.system_prompt || "You are a helpful AI assistant.", z = this.getContextDescription(f),
|
|
734
|
+
const r = T?.system_prompt || "You are a helpful AI assistant.", z = this.getContextDescription(f), _ = this.getContextDescription(this.config.contextType || "screening"), H = `
|
|
714
735
|
---
|
|
715
736
|
## CRITICAL CONTEXT SWITCH - IMMEDIATE EFFECT
|
|
716
737
|
---
|
|
717
738
|
|
|
718
|
-
**STOP**: The previous conversation context ("${
|
|
739
|
+
**STOP**: The previous conversation context ("${_}") has ended.
|
|
719
740
|
|
|
720
741
|
**NEW CONTEXT**: You are now in "${z}" mode.
|
|
721
742
|
|
|
@@ -732,7 +753,7 @@ class Ji {
|
|
|
732
753
|
${r}`;
|
|
733
754
|
console.log("[GlydeVoice] Sending UpdatePrompt to Deepgram:", {
|
|
734
755
|
promptLength: H.length,
|
|
735
|
-
previousContext:
|
|
756
|
+
previousContext: _,
|
|
736
757
|
newContext: z,
|
|
737
758
|
headerPreview: H.substring(0, 500)
|
|
738
759
|
}), this.ws.send(JSON.stringify({ type: "UpdatePrompt", prompt: H })), this.config = { ...this.config, contextType: f, contextId: o }, this.setSessionContext({ contextType: f, contextId: o }), this.serverConfig = T, console.log("[GlydeVoice] Context and prompt updated in-place:", f, o);
|
|
@@ -817,7 +838,7 @@ class mg {
|
|
|
817
838
|
headers: r
|
|
818
839
|
});
|
|
819
840
|
if (!z.ok) {
|
|
820
|
-
const
|
|
841
|
+
const _ = await z.json().catch(() => ({})), H = _.error?.message || _.message || `Request failed: ${z.status}`;
|
|
821
842
|
throw new Error(H);
|
|
822
843
|
}
|
|
823
844
|
return z.json();
|
|
@@ -1090,9 +1111,16 @@ class pg extends mg {
|
|
|
1090
1111
|
return this.conversationSummary;
|
|
1091
1112
|
}
|
|
1092
1113
|
/**
|
|
1093
|
-
* Send a message and get the agent's response
|
|
1114
|
+
* Send a message and get the agent's response.
|
|
1115
|
+
*
|
|
1116
|
+
* Uses incremental history: the user message and AI response are appended
|
|
1117
|
+
* to the local history array rather than replacing it with the full server
|
|
1118
|
+
* history. This prevents old messages from prior sessions flooding the UI
|
|
1119
|
+
* and avoids duplicate user messages caused by optimistic-add + full-replace
|
|
1120
|
+
* race conditions.
|
|
1121
|
+
*
|
|
1094
1122
|
* @param message - The message content to send
|
|
1095
|
-
* @returns The agent's response message
|
|
1123
|
+
* @returns The agent's response message (assistant role)
|
|
1096
1124
|
*/
|
|
1097
1125
|
async sendMessage(f) {
|
|
1098
1126
|
if (this.requiresContextId() && !this.config.contextId)
|
|
@@ -1111,15 +1139,28 @@ class pg extends mg {
|
|
|
1111
1139
|
method: "POST",
|
|
1112
1140
|
body: JSON.stringify(T)
|
|
1113
1141
|
});
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1142
|
+
let _ = null;
|
|
1143
|
+
if (z.response)
|
|
1144
|
+
_ = {
|
|
1145
|
+
role: "assistant",
|
|
1146
|
+
content: z.response,
|
|
1147
|
+
created: (/* @__PURE__ */ new Date()).toISOString()
|
|
1148
|
+
};
|
|
1149
|
+
else if (z.history?.messages) {
|
|
1150
|
+
const U = [...z.history.messages.filter(
|
|
1151
|
+
(x) => x.role !== "system"
|
|
1152
|
+
)].reverse().find((x) => x.role === "assistant");
|
|
1153
|
+
U && (_ = {
|
|
1154
|
+
role: "assistant",
|
|
1155
|
+
content: U.content,
|
|
1156
|
+
created: U.created || (/* @__PURE__ */ new Date()).toISOString()
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
return _ || (_ = {
|
|
1119
1160
|
role: "assistant",
|
|
1120
|
-
content:
|
|
1161
|
+
content: "I received your message.",
|
|
1121
1162
|
created: (/* @__PURE__ */ new Date()).toISOString()
|
|
1122
|
-
};
|
|
1163
|
+
}), this.history.push(_), z.context_switch && (this.contextSwitchManager.requestContextSwitch(z.context_switch), await this.contextSwitchManager.flushPendingContextSwitch()), this.config.onMessage && this.config.onMessage(_), this.emitEvent({ type: "message", payload: _ }), _;
|
|
1123
1164
|
} catch (T) {
|
|
1124
1165
|
throw console.error("[GlydeText] Send message error:", T), this.emitEvent({ type: "error", payload: T }), T;
|
|
1125
1166
|
} finally {
|
|
@@ -1262,7 +1303,7 @@ function bg() {
|
|
|
1262
1303
|
if (Md) return J;
|
|
1263
1304
|
Md = 1;
|
|
1264
1305
|
var d = { env: { NODE_ENV: "production" } };
|
|
1265
|
-
var f = /* @__PURE__ */ Symbol.for("react.transitional.element"), o = /* @__PURE__ */ Symbol.for("react.portal"), T = /* @__PURE__ */ Symbol.for("react.fragment"), r = /* @__PURE__ */ Symbol.for("react.strict_mode"), z = /* @__PURE__ */ Symbol.for("react.profiler"),
|
|
1306
|
+
var f = /* @__PURE__ */ Symbol.for("react.transitional.element"), o = /* @__PURE__ */ Symbol.for("react.portal"), T = /* @__PURE__ */ Symbol.for("react.fragment"), r = /* @__PURE__ */ Symbol.for("react.strict_mode"), z = /* @__PURE__ */ Symbol.for("react.profiler"), _ = /* @__PURE__ */ Symbol.for("react.consumer"), H = /* @__PURE__ */ Symbol.for("react.context"), U = /* @__PURE__ */ Symbol.for("react.forward_ref"), x = /* @__PURE__ */ Symbol.for("react.suspense"), Y = /* @__PURE__ */ Symbol.for("react.memo"), R = /* @__PURE__ */ Symbol.for("react.lazy"), j = /* @__PURE__ */ Symbol.for("react.activity"), Q = Symbol.iterator;
|
|
1266
1307
|
function $(y) {
|
|
1267
1308
|
return y === null || typeof y != "object" ? null : (y = Q && y[Q] || y["@@iterator"], typeof y == "function" ? y : null);
|
|
1268
1309
|
}
|
|
@@ -1276,56 +1317,56 @@ function bg() {
|
|
|
1276
1317
|
},
|
|
1277
1318
|
enqueueSetState: function() {
|
|
1278
1319
|
}
|
|
1279
|
-
}, F = Object.assign,
|
|
1280
|
-
function
|
|
1281
|
-
this.props = y, this.context =
|
|
1320
|
+
}, F = Object.assign, dt = {};
|
|
1321
|
+
function ot(y, M, N) {
|
|
1322
|
+
this.props = y, this.context = M, this.refs = dt, this.updater = N || tt;
|
|
1282
1323
|
}
|
|
1283
|
-
|
|
1324
|
+
ot.prototype.isReactComponent = {}, ot.prototype.setState = function(y, M) {
|
|
1284
1325
|
if (typeof y != "object" && typeof y != "function" && y != null)
|
|
1285
1326
|
throw Error(
|
|
1286
1327
|
"takes an object of state variables to update or a function which returns an object of state variables."
|
|
1287
1328
|
);
|
|
1288
|
-
this.updater.enqueueSetState(this, y,
|
|
1289
|
-
},
|
|
1329
|
+
this.updater.enqueueSetState(this, y, M, "setState");
|
|
1330
|
+
}, ot.prototype.forceUpdate = function(y) {
|
|
1290
1331
|
this.updater.enqueueForceUpdate(this, y, "forceUpdate");
|
|
1291
1332
|
};
|
|
1292
1333
|
function Z() {
|
|
1293
1334
|
}
|
|
1294
|
-
Z.prototype =
|
|
1295
|
-
function K(y,
|
|
1296
|
-
this.props = y, this.context =
|
|
1335
|
+
Z.prototype = ot.prototype;
|
|
1336
|
+
function K(y, M, N) {
|
|
1337
|
+
this.props = y, this.context = M, this.refs = dt, this.updater = N || tt;
|
|
1297
1338
|
}
|
|
1298
1339
|
var L = K.prototype = new Z();
|
|
1299
|
-
L.constructor = K, F(L,
|
|
1300
|
-
var
|
|
1340
|
+
L.constructor = K, F(L, ot.prototype), L.isPureReactComponent = !0;
|
|
1341
|
+
var st = Array.isArray;
|
|
1301
1342
|
function Ct() {
|
|
1302
1343
|
}
|
|
1303
1344
|
var et = { H: null, A: null, T: null, S: null }, Gt = Object.prototype.hasOwnProperty;
|
|
1304
|
-
function Pt(y,
|
|
1345
|
+
function Pt(y, M, N) {
|
|
1305
1346
|
var G = N.ref;
|
|
1306
1347
|
return {
|
|
1307
1348
|
$$typeof: f,
|
|
1308
1349
|
type: y,
|
|
1309
|
-
key:
|
|
1350
|
+
key: M,
|
|
1310
1351
|
ref: G !== void 0 ? G : null,
|
|
1311
1352
|
props: N
|
|
1312
1353
|
};
|
|
1313
1354
|
}
|
|
1314
|
-
function Bt(y,
|
|
1315
|
-
return Pt(y.type,
|
|
1355
|
+
function Bt(y, M) {
|
|
1356
|
+
return Pt(y.type, M, y.props);
|
|
1316
1357
|
}
|
|
1317
1358
|
function Xt(y) {
|
|
1318
1359
|
return typeof y == "object" && y !== null && y.$$typeof === f;
|
|
1319
1360
|
}
|
|
1320
1361
|
function ce(y) {
|
|
1321
|
-
var
|
|
1362
|
+
var M = { "=": "=0", ":": "=2" };
|
|
1322
1363
|
return "$" + y.replace(/[=:]/g, function(N) {
|
|
1323
|
-
return
|
|
1364
|
+
return M[N];
|
|
1324
1365
|
});
|
|
1325
1366
|
}
|
|
1326
1367
|
var fe = /\/+/g;
|
|
1327
|
-
function Vt(y,
|
|
1328
|
-
return typeof y == "object" && y !== null && y.key != null ? ce("" + y.key) :
|
|
1368
|
+
function Vt(y, M) {
|
|
1369
|
+
return typeof y == "object" && y !== null && y.key != null ? ce("" + y.key) : M.toString(36);
|
|
1329
1370
|
}
|
|
1330
1371
|
function w(y) {
|
|
1331
1372
|
switch (y.status) {
|
|
@@ -1335,11 +1376,11 @@ function bg() {
|
|
|
1335
1376
|
throw y.reason;
|
|
1336
1377
|
default:
|
|
1337
1378
|
switch (typeof y.status == "string" ? y.then(Ct, Ct) : (y.status = "pending", y.then(
|
|
1338
|
-
function(
|
|
1339
|
-
y.status === "pending" && (y.status = "fulfilled", y.value =
|
|
1379
|
+
function(M) {
|
|
1380
|
+
y.status === "pending" && (y.status = "fulfilled", y.value = M);
|
|
1340
1381
|
},
|
|
1341
|
-
function(
|
|
1342
|
-
y.status === "pending" && (y.status = "rejected", y.reason =
|
|
1382
|
+
function(M) {
|
|
1383
|
+
y.status === "pending" && (y.status = "rejected", y.reason = M);
|
|
1343
1384
|
}
|
|
1344
1385
|
)), y.status) {
|
|
1345
1386
|
case "fulfilled":
|
|
@@ -1350,7 +1391,7 @@ function bg() {
|
|
|
1350
1391
|
}
|
|
1351
1392
|
throw y;
|
|
1352
1393
|
}
|
|
1353
|
-
function O(y,
|
|
1394
|
+
function O(y, M, N, G, lt) {
|
|
1354
1395
|
var at = typeof y;
|
|
1355
1396
|
(at === "undefined" || at === "boolean") && (y = null);
|
|
1356
1397
|
var mt = !1;
|
|
@@ -1371,7 +1412,7 @@ function bg() {
|
|
|
1371
1412
|
case R:
|
|
1372
1413
|
return mt = y._init, O(
|
|
1373
1414
|
mt(y._payload),
|
|
1374
|
-
|
|
1415
|
+
M,
|
|
1375
1416
|
N,
|
|
1376
1417
|
G,
|
|
1377
1418
|
lt
|
|
@@ -1379,7 +1420,7 @@ function bg() {
|
|
|
1379
1420
|
}
|
|
1380
1421
|
}
|
|
1381
1422
|
if (mt)
|
|
1382
|
-
return lt = lt(y), mt = G === "" ? "." + Vt(y, 0) : G,
|
|
1423
|
+
return lt = lt(y), mt = G === "" ? "." + Vt(y, 0) : G, st(lt) ? (N = "", mt != null && (N = mt.replace(fe, "$&/") + "/"), O(lt, M, N, "", function(Da) {
|
|
1383
1424
|
return Da;
|
|
1384
1425
|
})) : lt != null && (Xt(lt) && (lt = Bt(
|
|
1385
1426
|
lt,
|
|
@@ -1387,14 +1428,14 @@ function bg() {
|
|
|
1387
1428
|
fe,
|
|
1388
1429
|
"$&/"
|
|
1389
1430
|
) + "/") + mt
|
|
1390
|
-
)),
|
|
1431
|
+
)), M.push(lt)), 1;
|
|
1391
1432
|
mt = 0;
|
|
1392
1433
|
var Ft = G === "" ? "." : G + ":";
|
|
1393
|
-
if (
|
|
1434
|
+
if (st(y))
|
|
1394
1435
|
for (var Ut = 0; Ut < y.length; Ut++)
|
|
1395
1436
|
G = y[Ut], at = Ft + Vt(G, Ut), mt += O(
|
|
1396
1437
|
G,
|
|
1397
|
-
|
|
1438
|
+
M,
|
|
1398
1439
|
N,
|
|
1399
1440
|
at,
|
|
1400
1441
|
lt
|
|
@@ -1403,7 +1444,7 @@ function bg() {
|
|
|
1403
1444
|
for (y = Ut.call(y), Ut = 0; !(G = y.next()).done; )
|
|
1404
1445
|
G = G.value, at = Ft + Vt(G, Ut++), mt += O(
|
|
1405
1446
|
G,
|
|
1406
|
-
|
|
1447
|
+
M,
|
|
1407
1448
|
N,
|
|
1408
1449
|
at,
|
|
1409
1450
|
lt
|
|
@@ -1412,48 +1453,48 @@ function bg() {
|
|
|
1412
1453
|
if (typeof y.then == "function")
|
|
1413
1454
|
return O(
|
|
1414
1455
|
w(y),
|
|
1415
|
-
|
|
1456
|
+
M,
|
|
1416
1457
|
N,
|
|
1417
1458
|
G,
|
|
1418
1459
|
lt
|
|
1419
1460
|
);
|
|
1420
|
-
throw
|
|
1421
|
-
"Objects are not valid as a React child (found: " + (
|
|
1461
|
+
throw M = String(y), Error(
|
|
1462
|
+
"Objects are not valid as a React child (found: " + (M === "[object Object]" ? "object with keys {" + Object.keys(y).join(", ") + "}" : M) + "). If you meant to render a collection of children, use an array instead."
|
|
1422
1463
|
);
|
|
1423
1464
|
}
|
|
1424
1465
|
return mt;
|
|
1425
1466
|
}
|
|
1426
|
-
function D(y,
|
|
1467
|
+
function D(y, M, N) {
|
|
1427
1468
|
if (y == null) return y;
|
|
1428
1469
|
var G = [], lt = 0;
|
|
1429
1470
|
return O(y, G, "", "", function(at) {
|
|
1430
|
-
return
|
|
1471
|
+
return M.call(N, at, lt++);
|
|
1431
1472
|
}), G;
|
|
1432
1473
|
}
|
|
1433
1474
|
function ut(y) {
|
|
1434
1475
|
if (y._status === -1) {
|
|
1435
|
-
var
|
|
1436
|
-
|
|
1476
|
+
var M = y._result;
|
|
1477
|
+
M = M(), M.then(
|
|
1437
1478
|
function(N) {
|
|
1438
1479
|
(y._status === 0 || y._status === -1) && (y._status = 1, y._result = N);
|
|
1439
1480
|
},
|
|
1440
1481
|
function(N) {
|
|
1441
1482
|
(y._status === 0 || y._status === -1) && (y._status = 2, y._result = N);
|
|
1442
1483
|
}
|
|
1443
|
-
), y._status === -1 && (y._status = 0, y._result =
|
|
1484
|
+
), y._status === -1 && (y._status = 0, y._result = M);
|
|
1444
1485
|
}
|
|
1445
1486
|
if (y._status === 1) return y._result.default;
|
|
1446
1487
|
throw y._result;
|
|
1447
1488
|
}
|
|
1448
1489
|
var P = typeof reportError == "function" ? reportError : function(y) {
|
|
1449
1490
|
if (typeof window == "object" && typeof window.ErrorEvent == "function") {
|
|
1450
|
-
var
|
|
1491
|
+
var M = new window.ErrorEvent("error", {
|
|
1451
1492
|
bubbles: !0,
|
|
1452
1493
|
cancelable: !0,
|
|
1453
1494
|
message: typeof y == "object" && y !== null && typeof y.message == "string" ? String(y.message) : String(y),
|
|
1454
1495
|
error: y
|
|
1455
1496
|
});
|
|
1456
|
-
if (!window.dispatchEvent(
|
|
1497
|
+
if (!window.dispatchEvent(M)) return;
|
|
1457
1498
|
} else if (typeof d == "object" && typeof d.emit == "function") {
|
|
1458
1499
|
d.emit("uncaughtException", y);
|
|
1459
1500
|
return;
|
|
@@ -1461,24 +1502,24 @@ function bg() {
|
|
|
1461
1502
|
console.error(y);
|
|
1462
1503
|
}, $t = {
|
|
1463
1504
|
map: D,
|
|
1464
|
-
forEach: function(y,
|
|
1505
|
+
forEach: function(y, M, N) {
|
|
1465
1506
|
D(
|
|
1466
1507
|
y,
|
|
1467
1508
|
function() {
|
|
1468
|
-
|
|
1509
|
+
M.apply(this, arguments);
|
|
1469
1510
|
},
|
|
1470
1511
|
N
|
|
1471
1512
|
);
|
|
1472
1513
|
},
|
|
1473
1514
|
count: function(y) {
|
|
1474
|
-
var
|
|
1515
|
+
var M = 0;
|
|
1475
1516
|
return D(y, function() {
|
|
1476
|
-
|
|
1477
|
-
}),
|
|
1517
|
+
M++;
|
|
1518
|
+
}), M;
|
|
1478
1519
|
},
|
|
1479
1520
|
toArray: function(y) {
|
|
1480
|
-
return D(y, function(
|
|
1481
|
-
return
|
|
1521
|
+
return D(y, function(M) {
|
|
1522
|
+
return M;
|
|
1482
1523
|
}) || [];
|
|
1483
1524
|
},
|
|
1484
1525
|
only: function(y) {
|
|
@@ -1489,7 +1530,7 @@ function bg() {
|
|
|
1489
1530
|
return y;
|
|
1490
1531
|
}
|
|
1491
1532
|
};
|
|
1492
|
-
return J.Activity = j, J.Children = $t, J.Component =
|
|
1533
|
+
return J.Activity = j, J.Children = $t, J.Component = ot, J.Fragment = T, J.Profiler = z, J.PureComponent = K, J.StrictMode = r, J.Suspense = x, J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = et, J.__COMPILER_RUNTIME = {
|
|
1493
1534
|
__proto__: null,
|
|
1494
1535
|
c: function(y) {
|
|
1495
1536
|
return et.H.useMemoCache(y);
|
|
@@ -1500,15 +1541,15 @@ function bg() {
|
|
|
1500
1541
|
};
|
|
1501
1542
|
}, J.cacheSignal = function() {
|
|
1502
1543
|
return null;
|
|
1503
|
-
}, J.cloneElement = function(y,
|
|
1544
|
+
}, J.cloneElement = function(y, M, N) {
|
|
1504
1545
|
if (y == null)
|
|
1505
1546
|
throw Error(
|
|
1506
1547
|
"The argument must be a React element, but you passed " + y + "."
|
|
1507
1548
|
);
|
|
1508
1549
|
var G = F({}, y.props), lt = y.key;
|
|
1509
|
-
if (
|
|
1510
|
-
for (at in
|
|
1511
|
-
!Gt.call(
|
|
1550
|
+
if (M != null)
|
|
1551
|
+
for (at in M.key !== void 0 && (lt = "" + M.key), M)
|
|
1552
|
+
!Gt.call(M, at) || at === "key" || at === "__self" || at === "__source" || at === "ref" && M.ref === void 0 || (G[at] = M[at]);
|
|
1512
1553
|
var at = arguments.length - 2;
|
|
1513
1554
|
if (at === 1) G.children = N;
|
|
1514
1555
|
else if (1 < at) {
|
|
@@ -1526,14 +1567,14 @@ function bg() {
|
|
|
1526
1567
|
Provider: null,
|
|
1527
1568
|
Consumer: null
|
|
1528
1569
|
}, y.Provider = y, y.Consumer = {
|
|
1529
|
-
$$typeof:
|
|
1570
|
+
$$typeof: _,
|
|
1530
1571
|
_context: y
|
|
1531
1572
|
}, y;
|
|
1532
|
-
}, J.createElement = function(y,
|
|
1573
|
+
}, J.createElement = function(y, M, N) {
|
|
1533
1574
|
var G, lt = {}, at = null;
|
|
1534
|
-
if (
|
|
1535
|
-
for (G in
|
|
1536
|
-
Gt.call(
|
|
1575
|
+
if (M != null)
|
|
1576
|
+
for (G in M.key !== void 0 && (at = "" + M.key), M)
|
|
1577
|
+
Gt.call(M, G) && G !== "key" && G !== "__self" && G !== "__source" && (lt[G] = M[G]);
|
|
1537
1578
|
var mt = arguments.length - 2;
|
|
1538
1579
|
if (mt === 1) lt.children = N;
|
|
1539
1580
|
else if (1 < mt) {
|
|
@@ -1555,14 +1596,14 @@ function bg() {
|
|
|
1555
1596
|
_payload: { _status: -1, _result: y },
|
|
1556
1597
|
_init: ut
|
|
1557
1598
|
};
|
|
1558
|
-
}, J.memo = function(y,
|
|
1599
|
+
}, J.memo = function(y, M) {
|
|
1559
1600
|
return {
|
|
1560
1601
|
$$typeof: Y,
|
|
1561
1602
|
type: y,
|
|
1562
|
-
compare:
|
|
1603
|
+
compare: M === void 0 ? null : M
|
|
1563
1604
|
};
|
|
1564
1605
|
}, J.startTransition = function(y) {
|
|
1565
|
-
var
|
|
1606
|
+
var M = et.T, N = {};
|
|
1566
1607
|
et.T = N;
|
|
1567
1608
|
try {
|
|
1568
1609
|
var G = y(), lt = et.S;
|
|
@@ -1570,47 +1611,47 @@ function bg() {
|
|
|
1570
1611
|
} catch (at) {
|
|
1571
1612
|
P(at);
|
|
1572
1613
|
} finally {
|
|
1573
|
-
|
|
1614
|
+
M !== null && N.types !== null && (M.types = N.types), et.T = M;
|
|
1574
1615
|
}
|
|
1575
1616
|
}, J.unstable_useCacheRefresh = function() {
|
|
1576
1617
|
return et.H.useCacheRefresh();
|
|
1577
1618
|
}, J.use = function(y) {
|
|
1578
1619
|
return et.H.use(y);
|
|
1579
|
-
}, J.useActionState = function(y,
|
|
1580
|
-
return et.H.useActionState(y,
|
|
1581
|
-
}, J.useCallback = function(y,
|
|
1582
|
-
return et.H.useCallback(y,
|
|
1620
|
+
}, J.useActionState = function(y, M, N) {
|
|
1621
|
+
return et.H.useActionState(y, M, N);
|
|
1622
|
+
}, J.useCallback = function(y, M) {
|
|
1623
|
+
return et.H.useCallback(y, M);
|
|
1583
1624
|
}, J.useContext = function(y) {
|
|
1584
1625
|
return et.H.useContext(y);
|
|
1585
1626
|
}, J.useDebugValue = function() {
|
|
1586
|
-
}, J.useDeferredValue = function(y,
|
|
1587
|
-
return et.H.useDeferredValue(y,
|
|
1588
|
-
}, J.useEffect = function(y,
|
|
1589
|
-
return et.H.useEffect(y,
|
|
1627
|
+
}, J.useDeferredValue = function(y, M) {
|
|
1628
|
+
return et.H.useDeferredValue(y, M);
|
|
1629
|
+
}, J.useEffect = function(y, M) {
|
|
1630
|
+
return et.H.useEffect(y, M);
|
|
1590
1631
|
}, J.useEffectEvent = function(y) {
|
|
1591
1632
|
return et.H.useEffectEvent(y);
|
|
1592
1633
|
}, J.useId = function() {
|
|
1593
1634
|
return et.H.useId();
|
|
1594
|
-
}, J.useImperativeHandle = function(y,
|
|
1595
|
-
return et.H.useImperativeHandle(y,
|
|
1596
|
-
}, J.useInsertionEffect = function(y,
|
|
1597
|
-
return et.H.useInsertionEffect(y,
|
|
1598
|
-
}, J.useLayoutEffect = function(y,
|
|
1599
|
-
return et.H.useLayoutEffect(y,
|
|
1600
|
-
}, J.useMemo = function(y,
|
|
1601
|
-
return et.H.useMemo(y,
|
|
1602
|
-
}, J.useOptimistic = function(y,
|
|
1603
|
-
return et.H.useOptimistic(y,
|
|
1604
|
-
}, J.useReducer = function(y,
|
|
1605
|
-
return et.H.useReducer(y,
|
|
1635
|
+
}, J.useImperativeHandle = function(y, M, N) {
|
|
1636
|
+
return et.H.useImperativeHandle(y, M, N);
|
|
1637
|
+
}, J.useInsertionEffect = function(y, M) {
|
|
1638
|
+
return et.H.useInsertionEffect(y, M);
|
|
1639
|
+
}, J.useLayoutEffect = function(y, M) {
|
|
1640
|
+
return et.H.useLayoutEffect(y, M);
|
|
1641
|
+
}, J.useMemo = function(y, M) {
|
|
1642
|
+
return et.H.useMemo(y, M);
|
|
1643
|
+
}, J.useOptimistic = function(y, M) {
|
|
1644
|
+
return et.H.useOptimistic(y, M);
|
|
1645
|
+
}, J.useReducer = function(y, M, N) {
|
|
1646
|
+
return et.H.useReducer(y, M, N);
|
|
1606
1647
|
}, J.useRef = function(y) {
|
|
1607
1648
|
return et.H.useRef(y);
|
|
1608
1649
|
}, J.useState = function(y) {
|
|
1609
1650
|
return et.H.useState(y);
|
|
1610
|
-
}, J.useSyncExternalStore = function(y,
|
|
1651
|
+
}, J.useSyncExternalStore = function(y, M, N) {
|
|
1611
1652
|
return et.H.useSyncExternalStore(
|
|
1612
1653
|
y,
|
|
1613
|
-
|
|
1654
|
+
M,
|
|
1614
1655
|
N
|
|
1615
1656
|
);
|
|
1616
1657
|
}, J.useTransition = function() {
|
|
@@ -1624,13 +1665,13 @@ function zf() {
|
|
|
1624
1665
|
var k = zf();
|
|
1625
1666
|
const ki = /* @__PURE__ */ vg(k);
|
|
1626
1667
|
function xg(d) {
|
|
1627
|
-
const [f, o] = k.useState("idle"), [T, r] = k.useState([]), [z,
|
|
1668
|
+
const [f, o] = k.useState("idle"), [T, r] = k.useState([]), [z, _] = k.useState(!1), [H, U] = k.useState(!1), [x, Y] = k.useState(!1), [R, j] = k.useState(null), Q = k.useRef(null), $ = k.useCallback((L) => {
|
|
1628
1669
|
switch (L.type) {
|
|
1629
1670
|
case "ready":
|
|
1630
1671
|
o("active");
|
|
1631
1672
|
break;
|
|
1632
1673
|
case "close":
|
|
1633
|
-
o("idle"),
|
|
1674
|
+
o("idle"), _(!1), U(!1);
|
|
1634
1675
|
break;
|
|
1635
1676
|
case "error":
|
|
1636
1677
|
o("error"), j(
|
|
@@ -1638,15 +1679,15 @@ function xg(d) {
|
|
|
1638
1679
|
);
|
|
1639
1680
|
break;
|
|
1640
1681
|
case "user_speaking":
|
|
1641
|
-
|
|
1682
|
+
_(!!L.payload);
|
|
1642
1683
|
break;
|
|
1643
1684
|
case "agent_speaking":
|
|
1644
1685
|
U(!!L.payload);
|
|
1645
1686
|
break;
|
|
1646
1687
|
}
|
|
1647
|
-
}, []), tt = k.useCallback((L,
|
|
1688
|
+
}, []), tt = k.useCallback((L, st) => {
|
|
1648
1689
|
r((Ct) => [...Ct, {
|
|
1649
|
-
role:
|
|
1690
|
+
role: st,
|
|
1650
1691
|
content: L,
|
|
1651
1692
|
timestamp: /* @__PURE__ */ new Date()
|
|
1652
1693
|
}]);
|
|
@@ -1662,9 +1703,9 @@ function xg(d) {
|
|
|
1662
1703
|
} catch (L) {
|
|
1663
1704
|
console.error("[useVoiceAgent] Failed to start:", L), o("error"), j(L instanceof Error ? L.message : "Failed to connect");
|
|
1664
1705
|
}
|
|
1665
|
-
}, [d, $, tt]),
|
|
1666
|
-
Q.current?.stop(), Q.current = null, o("idle"),
|
|
1667
|
-
}, []),
|
|
1706
|
+
}, [d, $, tt]), dt = k.useCallback(() => {
|
|
1707
|
+
Q.current?.stop(), Q.current = null, o("idle"), _(!1), U(!1);
|
|
1708
|
+
}, []), ot = k.useCallback(() => {
|
|
1668
1709
|
const L = !x;
|
|
1669
1710
|
Y(L), Q.current?.setMuted(L);
|
|
1670
1711
|
}, [x]), Z = k.useCallback((L) => {
|
|
@@ -1684,23 +1725,23 @@ function xg(d) {
|
|
|
1684
1725
|
isMuted: x,
|
|
1685
1726
|
errorMessage: R,
|
|
1686
1727
|
start: F,
|
|
1687
|
-
stop:
|
|
1688
|
-
toggleMute:
|
|
1728
|
+
stop: dt,
|
|
1729
|
+
toggleMute: ot,
|
|
1689
1730
|
setMuted: Z,
|
|
1690
1731
|
clearTranscripts: K,
|
|
1691
1732
|
voiceAgent: Q.current
|
|
1692
1733
|
};
|
|
1693
1734
|
}
|
|
1694
1735
|
function Sg(d) {
|
|
1695
|
-
const [f, o] = k.useState("idle"), [T, r] = k.useState([]), [z,
|
|
1736
|
+
const [f, o] = k.useState("idle"), [T, r] = k.useState([]), [z, _] = k.useState(!1), [H, U] = k.useState(null), x = k.useRef(null), Y = k.useRef(!1), R = k.useRef(null), j = k.useCallback(() => (x.current || (x.current = new pg({
|
|
1696
1737
|
...d,
|
|
1697
|
-
onTyping:
|
|
1738
|
+
onTyping: _
|
|
1698
1739
|
})), x.current), [d]), Q = k.useCallback(async () => {
|
|
1699
1740
|
if (!Y.current) {
|
|
1700
1741
|
o("loading"), U(null);
|
|
1701
1742
|
try {
|
|
1702
|
-
const
|
|
1703
|
-
r(
|
|
1743
|
+
const dt = await j().initialize();
|
|
1744
|
+
r(dt), o("ready"), Y.current = !0;
|
|
1704
1745
|
} catch (F) {
|
|
1705
1746
|
console.error("[useTextChat] Initialization error:", F), o("error"), U(F instanceof Error ? F.message : "Failed to initialize chat");
|
|
1706
1747
|
}
|
|
@@ -1709,16 +1750,16 @@ function Sg(d) {
|
|
|
1709
1750
|
if (F.trim()) {
|
|
1710
1751
|
U(null);
|
|
1711
1752
|
try {
|
|
1712
|
-
const
|
|
1753
|
+
const dt = j(), ot = {
|
|
1713
1754
|
role: "user",
|
|
1714
1755
|
content: F.trim(),
|
|
1715
1756
|
created: (/* @__PURE__ */ new Date()).toISOString()
|
|
1716
1757
|
};
|
|
1717
|
-
r((K) => [...K,
|
|
1718
|
-
const Z =
|
|
1719
|
-
r(Z), f !== "ready" && (o("ready"), Y.current = !0);
|
|
1720
|
-
} catch (
|
|
1721
|
-
console.error("[useTextChat] Send message error:",
|
|
1758
|
+
r((K) => [...K, ot]);
|
|
1759
|
+
const Z = await dt.sendMessage(F);
|
|
1760
|
+
r((K) => [...K, Z]), f !== "ready" && (o("ready"), Y.current = !0);
|
|
1761
|
+
} catch (dt) {
|
|
1762
|
+
console.error("[useTextChat] Send message error:", dt), U(dt instanceof Error ? dt.message : "Failed to send message");
|
|
1722
1763
|
}
|
|
1723
1764
|
}
|
|
1724
1765
|
}, [j, f]), tt = k.useCallback(() => {
|
|
@@ -1763,8 +1804,8 @@ function Tg() {
|
|
|
1763
1804
|
Ud = 1;
|
|
1764
1805
|
var d = /* @__PURE__ */ Symbol.for("react.transitional.element"), f = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
1765
1806
|
function o(T, r, z) {
|
|
1766
|
-
var
|
|
1767
|
-
if (z !== void 0 && (
|
|
1807
|
+
var _ = null;
|
|
1808
|
+
if (z !== void 0 && (_ = "" + z), r.key !== void 0 && (_ = "" + r.key), "key" in r) {
|
|
1768
1809
|
z = {};
|
|
1769
1810
|
for (var H in r)
|
|
1770
1811
|
H !== "key" && (z[H] = r[H]);
|
|
@@ -1772,7 +1813,7 @@ function Tg() {
|
|
|
1772
1813
|
return r = z.ref, {
|
|
1773
1814
|
$$typeof: d,
|
|
1774
1815
|
type: T,
|
|
1775
|
-
key:
|
|
1816
|
+
key: _,
|
|
1776
1817
|
ref: r !== void 0 ? r : null,
|
|
1777
1818
|
props: z
|
|
1778
1819
|
};
|
|
@@ -2457,7 +2498,7 @@ const Ld = ({
|
|
|
2457
2498
|
authToken: T,
|
|
2458
2499
|
unityApiUrl: r = "https://api.glydeunity.com",
|
|
2459
2500
|
contextType: z = "screening",
|
|
2460
|
-
height:
|
|
2501
|
+
height: _ = "600px",
|
|
2461
2502
|
onTranscript: H,
|
|
2462
2503
|
onCallEnd: U,
|
|
2463
2504
|
onError: x,
|
|
@@ -2469,12 +2510,12 @@ const Ld = ({
|
|
|
2469
2510
|
status: $,
|
|
2470
2511
|
transcripts: tt,
|
|
2471
2512
|
isUserSpeaking: F,
|
|
2472
|
-
isAgentSpeaking:
|
|
2473
|
-
isMuted:
|
|
2513
|
+
isAgentSpeaking: dt,
|
|
2514
|
+
isMuted: ot,
|
|
2474
2515
|
errorMessage: Z,
|
|
2475
2516
|
start: K,
|
|
2476
2517
|
stop: L,
|
|
2477
|
-
toggleMute:
|
|
2518
|
+
toggleMute: st,
|
|
2478
2519
|
clearTranscripts: Ct
|
|
2479
2520
|
} = xg({
|
|
2480
2521
|
publishableKey: f,
|
|
@@ -2518,7 +2559,7 @@ const Ld = ({
|
|
|
2518
2559
|
background: "var(--glyde-background, white)",
|
|
2519
2560
|
borderRadius: "12px",
|
|
2520
2561
|
boxShadow: "0 4px 6px rgba(0,0,0,0.1)",
|
|
2521
|
-
height: typeof
|
|
2562
|
+
height: typeof _ == "number" ? `${_}px` : _,
|
|
2522
2563
|
display: "flex",
|
|
2523
2564
|
flexDirection: "column",
|
|
2524
2565
|
overflow: "hidden"
|
|
@@ -2635,20 +2676,20 @@ const Ld = ({
|
|
|
2635
2676
|
Ng,
|
|
2636
2677
|
{
|
|
2637
2678
|
isUserSpeaking: F,
|
|
2638
|
-
isAgentSpeaking:
|
|
2679
|
+
isAgentSpeaking: dt
|
|
2639
2680
|
}
|
|
2640
2681
|
),
|
|
2641
2682
|
/* @__PURE__ */ v.jsxs("div", { style: { display: "flex", justifyContent: "center", gap: "12px", marginTop: "16px" }, children: [
|
|
2642
2683
|
/* @__PURE__ */ v.jsx(
|
|
2643
2684
|
"button",
|
|
2644
2685
|
{
|
|
2645
|
-
onClick:
|
|
2686
|
+
onClick: st,
|
|
2646
2687
|
style: {
|
|
2647
2688
|
...Ot.iconButton,
|
|
2648
|
-
background:
|
|
2689
|
+
background: ot ? "var(--glyde-error-light, #fecaca)" : "var(--glyde-secondary-light, #e0f2fe)"
|
|
2649
2690
|
},
|
|
2650
|
-
title:
|
|
2651
|
-
children:
|
|
2691
|
+
title: ot ? "Unmute" : "Mute",
|
|
2692
|
+
children: ot ? /* @__PURE__ */ v.jsx(Og, { size: 20, color: "var(--glyde-error, #dc2626)" }) : /* @__PURE__ */ v.jsx($i, { size: 20, color: "var(--glyde-secondary, #0ea5e9)" })
|
|
2652
2693
|
}
|
|
2653
2694
|
),
|
|
2654
2695
|
/* @__PURE__ */ v.jsxs(
|
|
@@ -2737,7 +2778,7 @@ const Ld = ({
|
|
|
2737
2778
|
apiKey: T,
|
|
2738
2779
|
authToken: r,
|
|
2739
2780
|
unityApiUrl: z = "https://api.glydeunity.com",
|
|
2740
|
-
height:
|
|
2781
|
+
height: _ = "600px",
|
|
2741
2782
|
title: H = "AI Chat",
|
|
2742
2783
|
placeholder: U = "Type your message...",
|
|
2743
2784
|
autoInit: x = !0,
|
|
@@ -2747,8 +2788,8 @@ const Ld = ({
|
|
|
2747
2788
|
const [j, Q] = k.useState(""), $ = k.useRef(null), {
|
|
2748
2789
|
status: tt,
|
|
2749
2790
|
messages: F,
|
|
2750
|
-
isLoading:
|
|
2751
|
-
errorMessage:
|
|
2791
|
+
isLoading: dt,
|
|
2792
|
+
errorMessage: ot,
|
|
2752
2793
|
sendMessage: Z
|
|
2753
2794
|
} = Sg({
|
|
2754
2795
|
publishableKey: o,
|
|
@@ -2762,20 +2803,20 @@ const Ld = ({
|
|
|
2762
2803
|
k.useEffect(() => {
|
|
2763
2804
|
$.current?.scrollIntoView({ behavior: "smooth" });
|
|
2764
2805
|
}, [F]), k.useEffect(() => {
|
|
2765
|
-
tt === "error" &&
|
|
2766
|
-
}, [tt,
|
|
2806
|
+
tt === "error" && ot && R && R(new Error(ot));
|
|
2807
|
+
}, [tt, ot, R]);
|
|
2767
2808
|
const K = async () => {
|
|
2768
|
-
if (!j.trim() ||
|
|
2769
|
-
const
|
|
2770
|
-
Q(""), await Z(
|
|
2771
|
-
}, L = (
|
|
2772
|
-
|
|
2809
|
+
if (!j.trim() || dt) return;
|
|
2810
|
+
const st = j.trim();
|
|
2811
|
+
Q(""), await Z(st), Y && Y({ role: "user", content: st });
|
|
2812
|
+
}, L = (st) => {
|
|
2813
|
+
st.key === "Enter" && !st.shiftKey && (st.preventDefault(), K());
|
|
2773
2814
|
};
|
|
2774
2815
|
return /* @__PURE__ */ v.jsxs("div", { style: {
|
|
2775
2816
|
background: "var(--glyde-background, white)",
|
|
2776
2817
|
borderRadius: "12px",
|
|
2777
2818
|
boxShadow: "0 4px 6px rgba(0,0,0,0.1)",
|
|
2778
|
-
height: typeof
|
|
2819
|
+
height: typeof _ == "number" ? `${_}px` : _,
|
|
2779
2820
|
display: "flex",
|
|
2780
2821
|
flexDirection: "column",
|
|
2781
2822
|
overflow: "hidden"
|
|
@@ -2801,44 +2842,44 @@ const Ld = ({
|
|
|
2801
2842
|
/* @__PURE__ */ v.jsx("div", { className: "glyde-spinner", style: { margin: "0 auto 12px" } }),
|
|
2802
2843
|
"Loading conversation..."
|
|
2803
2844
|
] }),
|
|
2804
|
-
F.map((
|
|
2805
|
-
|
|
2845
|
+
F.map((st, Ct) => /* @__PURE__ */ v.jsx(Hg, { message: st }, Ct)),
|
|
2846
|
+
dt && /* @__PURE__ */ v.jsx("div", { style: { color: "var(--glyde-text-muted, #94a3b8)", fontSize: "0.9rem", marginLeft: "42px" }, children: /* @__PURE__ */ v.jsx(Bg, {}) }),
|
|
2806
2847
|
/* @__PURE__ */ v.jsx("div", { ref: $ })
|
|
2807
2848
|
] }),
|
|
2808
2849
|
/* @__PURE__ */ v.jsxs("div", { style: { padding: "16px 20px", borderTop: "1px solid var(--glyde-border, #eee)" }, children: [
|
|
2809
|
-
|
|
2850
|
+
ot && /* @__PURE__ */ v.jsx("p", { style: {
|
|
2810
2851
|
color: "var(--glyde-error, #ef4444)",
|
|
2811
2852
|
fontSize: "0.85rem",
|
|
2812
2853
|
marginBottom: "10px"
|
|
2813
|
-
}, children:
|
|
2854
|
+
}, children: ot }),
|
|
2814
2855
|
/* @__PURE__ */ v.jsxs("div", { style: { display: "flex", gap: "10px" }, children: [
|
|
2815
2856
|
/* @__PURE__ */ v.jsx(
|
|
2816
2857
|
"input",
|
|
2817
2858
|
{
|
|
2818
2859
|
type: "text",
|
|
2819
2860
|
value: j,
|
|
2820
|
-
onChange: (
|
|
2861
|
+
onChange: (st) => Q(st.target.value),
|
|
2821
2862
|
onKeyDown: L,
|
|
2822
2863
|
placeholder: U,
|
|
2823
2864
|
style: {
|
|
2824
2865
|
...Ot.inputField,
|
|
2825
2866
|
flex: 1
|
|
2826
2867
|
},
|
|
2827
|
-
disabled:
|
|
2868
|
+
disabled: dt
|
|
2828
2869
|
}
|
|
2829
2870
|
),
|
|
2830
2871
|
/* @__PURE__ */ v.jsx(
|
|
2831
2872
|
"button",
|
|
2832
2873
|
{
|
|
2833
2874
|
onClick: K,
|
|
2834
|
-
disabled:
|
|
2875
|
+
disabled: dt || !j.trim(),
|
|
2835
2876
|
style: {
|
|
2836
2877
|
...Ot.iconButton,
|
|
2837
2878
|
background: "var(--glyde-secondary, #0284c7)",
|
|
2838
2879
|
width: "48px",
|
|
2839
2880
|
height: "48px",
|
|
2840
|
-
opacity:
|
|
2841
|
-
cursor:
|
|
2881
|
+
opacity: dt || !j.trim() ? 0.5 : 1,
|
|
2882
|
+
cursor: dt || !j.trim() ? "not-allowed" : "pointer"
|
|
2842
2883
|
},
|
|
2843
2884
|
children: /* @__PURE__ */ v.jsx(zg, { size: 20, color: "white" })
|
|
2844
2885
|
}
|
|
@@ -2922,7 +2963,7 @@ const Ld = ({
|
|
|
2922
2963
|
contextId: T,
|
|
2923
2964
|
unityBaseUrl: r = "https://api.glydeunity.com",
|
|
2924
2965
|
contextType: z = "screening",
|
|
2925
|
-
defaultMode:
|
|
2966
|
+
defaultMode: _ = "voice",
|
|
2926
2967
|
position: H = "bottom-right",
|
|
2927
2968
|
theme: U = "light",
|
|
2928
2969
|
allowModeSwitch: x = !0,
|
|
@@ -2933,17 +2974,17 @@ const Ld = ({
|
|
|
2933
2974
|
allowClose: $ = !0,
|
|
2934
2975
|
onReady: tt,
|
|
2935
2976
|
onModeChange: F,
|
|
2936
|
-
onTranscript:
|
|
2937
|
-
onError:
|
|
2977
|
+
onTranscript: dt,
|
|
2978
|
+
onError: ot,
|
|
2938
2979
|
onClose: Z,
|
|
2939
2980
|
initialExpanded: K = !1,
|
|
2940
2981
|
skipContinuityLimit: L,
|
|
2941
|
-
limitToLast:
|
|
2982
|
+
limitToLast: st
|
|
2942
2983
|
}) => {
|
|
2943
2984
|
console.log("[ChatWidget] Received unityBaseUrl:", r);
|
|
2944
2985
|
const [Ct, et] = k.useState(
|
|
2945
2986
|
R === "floating" ? K : !0
|
|
2946
|
-
), [Gt, Pt] = k.useState(!0), [Bt, Xt] = k.useState(
|
|
2987
|
+
), [Gt, Pt] = k.useState(!0), [Bt, Xt] = k.useState(_ || "voice");
|
|
2947
2988
|
k.useEffect(() => {
|
|
2948
2989
|
const P = U === "auto" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : U;
|
|
2949
2990
|
Fi(P);
|
|
@@ -2953,9 +2994,9 @@ const Ld = ({
|
|
|
2953
2994
|
const ce = Rg(H), fe = (P) => {
|
|
2954
2995
|
Xt(P), F?.(P);
|
|
2955
2996
|
}, Vt = (P, $t) => {
|
|
2956
|
-
|
|
2997
|
+
dt?.(P, $t);
|
|
2957
2998
|
}, w = (P) => {
|
|
2958
|
-
|
|
2999
|
+
ot?.(P);
|
|
2959
3000
|
}, O = () => {
|
|
2960
3001
|
R === "floating" ? et(!1) : (Pt(!1), Z?.());
|
|
2961
3002
|
}, D = {
|
|
@@ -2984,7 +3025,7 @@ const Ld = ({
|
|
|
2984
3025
|
onError: w,
|
|
2985
3026
|
onClose: O,
|
|
2986
3027
|
skipContinuityLimit: L,
|
|
2987
|
-
limitToLast:
|
|
3028
|
+
limitToLast: st
|
|
2988
3029
|
}
|
|
2989
3030
|
) : R === "modal" ? /* @__PURE__ */ v.jsx(
|
|
2990
3031
|
Gg,
|
|
@@ -3005,7 +3046,7 @@ const Ld = ({
|
|
|
3005
3046
|
onError: w,
|
|
3006
3047
|
onClose: O,
|
|
3007
3048
|
skipContinuityLimit: L,
|
|
3008
|
-
limitToLast:
|
|
3049
|
+
limitToLast: st
|
|
3009
3050
|
}
|
|
3010
3051
|
) : R === "mobile" ? /* @__PURE__ */ v.jsx(
|
|
3011
3052
|
Yg,
|
|
@@ -3026,7 +3067,7 @@ const Ld = ({
|
|
|
3026
3067
|
onError: w,
|
|
3027
3068
|
onClose: O,
|
|
3028
3069
|
skipContinuityLimit: L,
|
|
3029
|
-
limitToLast:
|
|
3070
|
+
limitToLast: st
|
|
3030
3071
|
}
|
|
3031
3072
|
) : R === "inline" ? /* @__PURE__ */ v.jsx(
|
|
3032
3073
|
"div",
|
|
@@ -3059,7 +3100,7 @@ const Ld = ({
|
|
|
3059
3100
|
onError: w,
|
|
3060
3101
|
onClose: O,
|
|
3061
3102
|
skipContinuityLimit: L,
|
|
3062
|
-
limitToLast:
|
|
3103
|
+
limitToLast: st
|
|
3063
3104
|
}
|
|
3064
3105
|
)
|
|
3065
3106
|
}
|
|
@@ -3115,7 +3156,7 @@ const Ld = ({
|
|
|
3115
3156
|
onError: w,
|
|
3116
3157
|
onSwitchToText: x ? () => fe("text") : void 0,
|
|
3117
3158
|
skipContinuityLimit: L,
|
|
3118
|
-
limitToLast:
|
|
3159
|
+
limitToLast: st
|
|
3119
3160
|
}
|
|
3120
3161
|
) : /* @__PURE__ */ v.jsx(
|
|
3121
3162
|
Xd,
|
|
@@ -3214,7 +3255,7 @@ const Ld = ({
|
|
|
3214
3255
|
contextId: T,
|
|
3215
3256
|
unityBaseUrl: r,
|
|
3216
3257
|
contextType: z,
|
|
3217
|
-
mode:
|
|
3258
|
+
mode: _,
|
|
3218
3259
|
allowModeSwitch: H,
|
|
3219
3260
|
showHeader: U = !0,
|
|
3220
3261
|
allowClose: x = !0,
|
|
@@ -3226,12 +3267,12 @@ const Ld = ({
|
|
|
3226
3267
|
skipContinuityLimit: tt,
|
|
3227
3268
|
limitToLast: F
|
|
3228
3269
|
}) => {
|
|
3229
|
-
const [
|
|
3270
|
+
const [dt, ot] = k.useState(_);
|
|
3230
3271
|
k.useEffect(() => {
|
|
3231
|
-
|
|
3232
|
-
}, [
|
|
3272
|
+
ot(_);
|
|
3273
|
+
}, [_]);
|
|
3233
3274
|
const Z = (L) => {
|
|
3234
|
-
|
|
3275
|
+
ot(L), R(L);
|
|
3235
3276
|
}, K = (L) => {
|
|
3236
3277
|
if (L !== void 0)
|
|
3237
3278
|
return typeof L == "number" ? `${L}px` : L;
|
|
@@ -3269,8 +3310,8 @@ const Ld = ({
|
|
|
3269
3310
|
padding: "12px 16px",
|
|
3270
3311
|
borderBottom: "1px solid var(--glyde-border, #e5e7eb)",
|
|
3271
3312
|
background: "var(--glyde-background, white)"
|
|
3272
|
-
}, children: /* @__PURE__ */ v.jsx(Qd, { mode:
|
|
3273
|
-
/* @__PURE__ */ v.jsx("div", { style: { flex: 1, overflow: "hidden", display: "flex", flexDirection: "column" }, children:
|
|
3313
|
+
}, children: /* @__PURE__ */ v.jsx(Qd, { mode: dt, onModeChange: Z }) }),
|
|
3314
|
+
/* @__PURE__ */ v.jsx("div", { style: { flex: 1, overflow: "hidden", display: "flex", flexDirection: "column" }, children: dt === "voice" ? /* @__PURE__ */ v.jsx(
|
|
3274
3315
|
Ld,
|
|
3275
3316
|
{
|
|
3276
3317
|
publishableKey: d,
|
|
@@ -3311,8 +3352,8 @@ const Ld = ({
|
|
|
3311
3352
|
z.target === z.currentTarget && d.allowClose && o?.();
|
|
3312
3353
|
};
|
|
3313
3354
|
return k.useEffect(() => {
|
|
3314
|
-
const z = (
|
|
3315
|
-
|
|
3355
|
+
const z = (_) => {
|
|
3356
|
+
_.key === "Escape" && d.allowClose && o?.();
|
|
3316
3357
|
};
|
|
3317
3358
|
return window.addEventListener("keydown", z), () => window.removeEventListener("keydown", z);
|
|
3318
3359
|
}, [o, d.allowClose]), /* @__PURE__ */ v.jsx(
|
|
@@ -3386,9 +3427,9 @@ function Lg() {
|
|
|
3386
3427
|
if (D !== O) {
|
|
3387
3428
|
w[0] = D;
|
|
3388
3429
|
t: for (var ut = 0, P = w.length, $t = P >>> 1; ut < $t; ) {
|
|
3389
|
-
var y = 2 * (ut + 1) - 1,
|
|
3390
|
-
if (0 > r(
|
|
3391
|
-
N < P && 0 > r(G,
|
|
3430
|
+
var y = 2 * (ut + 1) - 1, M = w[y], N = y + 1, G = w[N];
|
|
3431
|
+
if (0 > r(M, D))
|
|
3432
|
+
N < P && 0 > r(G, M) ? (w[ut] = G, w[N] = D, ut = N) : (w[ut] = M, w[y] = D, ut = y);
|
|
3392
3433
|
else if (N < P && 0 > r(G, D))
|
|
3393
3434
|
w[ut] = G, w[N] = D, ut = N;
|
|
3394
3435
|
else break t;
|
|
@@ -3406,12 +3447,12 @@ function Lg() {
|
|
|
3406
3447
|
return z.now();
|
|
3407
3448
|
};
|
|
3408
3449
|
} else {
|
|
3409
|
-
var
|
|
3450
|
+
var _ = Date, H = _.now();
|
|
3410
3451
|
d.unstable_now = function() {
|
|
3411
|
-
return
|
|
3452
|
+
return _.now() - H;
|
|
3412
3453
|
};
|
|
3413
3454
|
}
|
|
3414
|
-
var U = [], x = [], Y = 1, R = null, j = 3, Q = !1, $ = !1, tt = !1, F = !1,
|
|
3455
|
+
var U = [], x = [], Y = 1, R = null, j = 3, Q = !1, $ = !1, tt = !1, F = !1, dt = typeof setTimeout == "function" ? setTimeout : null, ot = typeof clearTimeout == "function" ? clearTimeout : null, Z = typeof setImmediate < "u" ? setImmediate : null;
|
|
3415
3456
|
function K(w) {
|
|
3416
3457
|
for (var O = o(x); O !== null; ) {
|
|
3417
3458
|
if (O.callback === null) T(x);
|
|
@@ -3424,24 +3465,24 @@ function Lg() {
|
|
|
3424
3465
|
function L(w) {
|
|
3425
3466
|
if (tt = !1, K(w), !$)
|
|
3426
3467
|
if (o(U) !== null)
|
|
3427
|
-
$ = !0,
|
|
3468
|
+
$ = !0, st || (st = !0, Xt());
|
|
3428
3469
|
else {
|
|
3429
3470
|
var O = o(x);
|
|
3430
3471
|
O !== null && Vt(L, O.startTime - w);
|
|
3431
3472
|
}
|
|
3432
3473
|
}
|
|
3433
|
-
var
|
|
3474
|
+
var st = !1, Ct = -1, et = 5, Gt = -1;
|
|
3434
3475
|
function Pt() {
|
|
3435
3476
|
return F ? !0 : !(d.unstable_now() - Gt < et);
|
|
3436
3477
|
}
|
|
3437
3478
|
function Bt() {
|
|
3438
|
-
if (F = !1,
|
|
3479
|
+
if (F = !1, st) {
|
|
3439
3480
|
var w = d.unstable_now();
|
|
3440
3481
|
Gt = w;
|
|
3441
3482
|
var O = !0;
|
|
3442
3483
|
try {
|
|
3443
3484
|
t: {
|
|
3444
|
-
$ = !1, tt && (tt = !1,
|
|
3485
|
+
$ = !1, tt && (tt = !1, ot(Ct), Ct = -1), Q = !0;
|
|
3445
3486
|
var D = j;
|
|
3446
3487
|
try {
|
|
3447
3488
|
e: {
|
|
@@ -3476,7 +3517,7 @@ function Lg() {
|
|
|
3476
3517
|
O = void 0;
|
|
3477
3518
|
}
|
|
3478
3519
|
} finally {
|
|
3479
|
-
O ? Xt() :
|
|
3520
|
+
O ? Xt() : st = !1;
|
|
3480
3521
|
}
|
|
3481
3522
|
}
|
|
3482
3523
|
}
|
|
@@ -3492,10 +3533,10 @@ function Lg() {
|
|
|
3492
3533
|
};
|
|
3493
3534
|
} else
|
|
3494
3535
|
Xt = function() {
|
|
3495
|
-
|
|
3536
|
+
dt(Bt, 0);
|
|
3496
3537
|
};
|
|
3497
3538
|
function Vt(w, O) {
|
|
3498
|
-
Ct =
|
|
3539
|
+
Ct = dt(function() {
|
|
3499
3540
|
w(d.unstable_now());
|
|
3500
3541
|
}, O);
|
|
3501
3542
|
}
|
|
@@ -3569,7 +3610,7 @@ function Lg() {
|
|
|
3569
3610
|
startTime: D,
|
|
3570
3611
|
expirationTime: P,
|
|
3571
3612
|
sortIndex: -1
|
|
3572
|
-
}, D > ut ? (w.sortIndex = D, f(x, w), o(U) === null && w === o(x) && (tt ? (
|
|
3613
|
+
}, D > ut ? (w.sortIndex = D, f(x, w), o(U) === null && w === o(x) && (tt ? (ot(Ct), Ct = -1) : tt = !0, Vt(L, D - ut))) : (w.sortIndex = P, f(U, w), $ || Q || ($ = !0, st || (st = !0, Xt()))), w;
|
|
3573
3614
|
}, d.unstable_shouldYield = Pt, d.unstable_wrapCallback = function(w) {
|
|
3574
3615
|
var O = j;
|
|
3575
3616
|
return function() {
|
|
@@ -3632,7 +3673,7 @@ function Vg() {
|
|
|
3632
3673
|
implementation: Y
|
|
3633
3674
|
};
|
|
3634
3675
|
}
|
|
3635
|
-
var
|
|
3676
|
+
var _ = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
3636
3677
|
function H(U, x) {
|
|
3637
3678
|
if (U === "font") return "";
|
|
3638
3679
|
if (typeof x == "string")
|
|
@@ -3644,11 +3685,11 @@ function Vg() {
|
|
|
3644
3685
|
throw Error(f(299));
|
|
3645
3686
|
return z(U, x, null, Y);
|
|
3646
3687
|
}, Wt.flushSync = function(U) {
|
|
3647
|
-
var x =
|
|
3688
|
+
var x = _.T, Y = T.p;
|
|
3648
3689
|
try {
|
|
3649
|
-
if (
|
|
3690
|
+
if (_.T = null, T.p = 2, U) return U();
|
|
3650
3691
|
} finally {
|
|
3651
|
-
|
|
3692
|
+
_.T = x, T.p = Y, T.d.f();
|
|
3652
3693
|
}
|
|
3653
3694
|
}, Wt.preconnect = function(U, x) {
|
|
3654
3695
|
typeof U == "string" && (x ? (x = x.crossOrigin, x = typeof x == "string" ? x === "use-credentials" ? x : "" : void 0) : x = null, T.d.C(U, x));
|
|
@@ -3717,9 +3758,9 @@ function Vg() {
|
|
|
3717
3758
|
}, Wt.unstable_batchedUpdates = function(U, x) {
|
|
3718
3759
|
return U(x);
|
|
3719
3760
|
}, Wt.useFormState = function(U, x, Y) {
|
|
3720
|
-
return
|
|
3761
|
+
return _.H.useFormState(U, x, Y);
|
|
3721
3762
|
}, Wt.useFormStatus = function() {
|
|
3722
|
-
return
|
|
3763
|
+
return _.H.useHostTransitionStatus();
|
|
3723
3764
|
}, Wt.version = "19.2.4", Wt;
|
|
3724
3765
|
}
|
|
3725
3766
|
var Nd;
|
|
@@ -3754,7 +3795,7 @@ function Zg() {
|
|
|
3754
3795
|
function z(t) {
|
|
3755
3796
|
return !(!t || t.nodeType !== 1 && t.nodeType !== 9 && t.nodeType !== 11);
|
|
3756
3797
|
}
|
|
3757
|
-
function
|
|
3798
|
+
function _(t) {
|
|
3758
3799
|
var e = t, l = t;
|
|
3759
3800
|
if (t.alternate) for (; e.return; ) e = e.return;
|
|
3760
3801
|
else {
|
|
@@ -3780,13 +3821,13 @@ function Zg() {
|
|
|
3780
3821
|
return null;
|
|
3781
3822
|
}
|
|
3782
3823
|
function x(t) {
|
|
3783
|
-
if (
|
|
3824
|
+
if (_(t) !== t)
|
|
3784
3825
|
throw Error(r(188));
|
|
3785
3826
|
}
|
|
3786
3827
|
function Y(t) {
|
|
3787
3828
|
var e = t.alternate;
|
|
3788
3829
|
if (!e) {
|
|
3789
|
-
if (e =
|
|
3830
|
+
if (e = _(t), e === null) throw Error(r(188));
|
|
3790
3831
|
return e !== t ? null : t;
|
|
3791
3832
|
}
|
|
3792
3833
|
for (var l = t, a = e; ; ) {
|
|
@@ -3850,7 +3891,7 @@ function Zg() {
|
|
|
3850
3891
|
}
|
|
3851
3892
|
return null;
|
|
3852
3893
|
}
|
|
3853
|
-
var j = Object.assign, Q = /* @__PURE__ */ Symbol.for("react.element"), $ = /* @__PURE__ */ Symbol.for("react.transitional.element"), tt = /* @__PURE__ */ Symbol.for("react.portal"), F = /* @__PURE__ */ Symbol.for("react.fragment"),
|
|
3894
|
+
var j = Object.assign, Q = /* @__PURE__ */ Symbol.for("react.element"), $ = /* @__PURE__ */ Symbol.for("react.transitional.element"), tt = /* @__PURE__ */ Symbol.for("react.portal"), F = /* @__PURE__ */ Symbol.for("react.fragment"), dt = /* @__PURE__ */ Symbol.for("react.strict_mode"), ot = /* @__PURE__ */ Symbol.for("react.profiler"), Z = /* @__PURE__ */ Symbol.for("react.consumer"), K = /* @__PURE__ */ Symbol.for("react.context"), L = /* @__PURE__ */ Symbol.for("react.forward_ref"), st = /* @__PURE__ */ Symbol.for("react.suspense"), Ct = /* @__PURE__ */ Symbol.for("react.suspense_list"), et = /* @__PURE__ */ Symbol.for("react.memo"), Gt = /* @__PURE__ */ Symbol.for("react.lazy"), Pt = /* @__PURE__ */ Symbol.for("react.activity"), Bt = /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel"), Xt = Symbol.iterator;
|
|
3854
3895
|
function ce(t) {
|
|
3855
3896
|
return t === null || typeof t != "object" ? null : (t = Xt && t[Xt] || t["@@iterator"], typeof t == "function" ? t : null);
|
|
3856
3897
|
}
|
|
@@ -3863,11 +3904,11 @@ function Zg() {
|
|
|
3863
3904
|
switch (t) {
|
|
3864
3905
|
case F:
|
|
3865
3906
|
return "Fragment";
|
|
3866
|
-
case st:
|
|
3867
|
-
return "Profiler";
|
|
3868
3907
|
case ot:
|
|
3908
|
+
return "Profiler";
|
|
3909
|
+
case dt:
|
|
3869
3910
|
return "StrictMode";
|
|
3870
|
-
case
|
|
3911
|
+
case st:
|
|
3871
3912
|
return "Suspense";
|
|
3872
3913
|
case Ct:
|
|
3873
3914
|
return "SuspenseList";
|
|
@@ -3905,7 +3946,7 @@ function Zg() {
|
|
|
3905
3946
|
function y(t) {
|
|
3906
3947
|
return { current: t };
|
|
3907
3948
|
}
|
|
3908
|
-
function
|
|
3949
|
+
function M(t) {
|
|
3909
3950
|
0 > $t || (t.current = P[$t], P[$t] = null, $t--);
|
|
3910
3951
|
}
|
|
3911
3952
|
function N(t, e) {
|
|
@@ -3933,10 +3974,10 @@ function Zg() {
|
|
|
3933
3974
|
t = 0;
|
|
3934
3975
|
}
|
|
3935
3976
|
}
|
|
3936
|
-
|
|
3977
|
+
M(G), N(G, t);
|
|
3937
3978
|
}
|
|
3938
3979
|
function Ut() {
|
|
3939
|
-
|
|
3980
|
+
M(G), M(lt), M(at);
|
|
3940
3981
|
}
|
|
3941
3982
|
function Da(t) {
|
|
3942
3983
|
t.memoizedState !== null && N(mt, t);
|
|
@@ -3944,7 +3985,7 @@ function Zg() {
|
|
|
3944
3985
|
e !== l && (N(lt, t), N(G, l));
|
|
3945
3986
|
}
|
|
3946
3987
|
function Mn(t) {
|
|
3947
|
-
lt.current === t && (
|
|
3988
|
+
lt.current === t && (M(G), M(lt)), mt.current === t && (M(mt), Sn._currentValue = ut);
|
|
3948
3989
|
}
|
|
3949
3990
|
var Pi, Cf;
|
|
3950
3991
|
function Cl(t) {
|
|
@@ -5333,13 +5374,13 @@ Error generating stack: ` + a.message + `
|
|
|
5333
5374
|
return t = he(31, l, e, n), t.elementType = Pt, t.lanes = i, t;
|
|
5334
5375
|
case F:
|
|
5335
5376
|
return Rl(l.children, n, i, e);
|
|
5336
|
-
case
|
|
5377
|
+
case dt:
|
|
5337
5378
|
u = 8, n |= 24;
|
|
5338
5379
|
break;
|
|
5380
|
+
case ot:
|
|
5381
|
+
return t = he(12, l, e, n | 2), t.elementType = ot, t.lanes = i, t;
|
|
5339
5382
|
case st:
|
|
5340
|
-
return t = he(
|
|
5341
|
-
case rt:
|
|
5342
|
-
return t = he(13, l, e, n), t.elementType = rt, t.lanes = i, t;
|
|
5383
|
+
return t = he(13, l, e, n), t.elementType = st, t.lanes = i, t;
|
|
5343
5384
|
case Ct:
|
|
5344
5385
|
return t = he(19, l, e, n), t.elementType = Ct, t.lanes = i, t;
|
|
5345
5386
|
default:
|
|
@@ -5434,7 +5475,7 @@ Error generating stack: ` + a.message + `
|
|
|
5434
5475
|
function Do(t, e) {
|
|
5435
5476
|
Ae[Ee++] = je, Ae[Ee++] = Re, Ae[Ee++] = nl, je = e.id, Re = e.overflow, nl = t;
|
|
5436
5477
|
}
|
|
5437
|
-
var Zt = null, At = null,
|
|
5478
|
+
var Zt = null, At = null, rt = !1, il = null, ze = !1, qu = Error(r(519));
|
|
5438
5479
|
function ul(t) {
|
|
5439
5480
|
var e = Error(
|
|
5440
5481
|
r(
|
|
@@ -5510,7 +5551,7 @@ Error generating stack: ` + a.message + `
|
|
|
5510
5551
|
}
|
|
5511
5552
|
function oa(t) {
|
|
5512
5553
|
if (t !== Zt) return !1;
|
|
5513
|
-
if (!
|
|
5554
|
+
if (!rt) return Ro(t), rt = !0, !1;
|
|
5514
5555
|
var e = t.tag, l;
|
|
5515
5556
|
if ((l = e !== 3 && e !== 27) && ((l = e === 5) && (l = t.type, l = !(l !== "form" && l !== "button") || lf(t.type, t.memoizedProps)), l = !l), l && At && ul(t), Ro(t), e === 13) {
|
|
5516
5557
|
if (t = t.memoizedState, t = t !== null ? t.dehydrated : null, !t) throw Error(r(317));
|
|
@@ -5523,7 +5564,7 @@ Error generating stack: ` + a.message + `
|
|
|
5523
5564
|
return !0;
|
|
5524
5565
|
}
|
|
5525
5566
|
function wl() {
|
|
5526
|
-
At = Zt = null,
|
|
5567
|
+
At = Zt = null, rt = !1;
|
|
5527
5568
|
}
|
|
5528
5569
|
function Gu() {
|
|
5529
5570
|
var t = il;
|
|
@@ -5540,7 +5581,7 @@ Error generating stack: ` + a.message + `
|
|
|
5540
5581
|
N(Yu, e._currentValue), e._currentValue = l;
|
|
5541
5582
|
}
|
|
5542
5583
|
function Xe(t) {
|
|
5543
|
-
t._currentValue = Yu.current,
|
|
5584
|
+
t._currentValue = Yu.current, M(Yu);
|
|
5544
5585
|
}
|
|
5545
5586
|
function Lu(t, e, l) {
|
|
5546
5587
|
for (; t !== null; ) {
|
|
@@ -6006,7 +6047,7 @@ Error generating stack: ` + a.message + `
|
|
|
6006
6047
|
t && q && yt.alternate === null && e(g, q), h = i(yt, h, I), ht === null ? X = yt : ht.sibling = yt, ht = yt, q = ft;
|
|
6007
6048
|
}
|
|
6008
6049
|
if (I === m.length)
|
|
6009
|
-
return l(g, q),
|
|
6050
|
+
return l(g, q), rt && Ye(g, I), X;
|
|
6010
6051
|
if (q === null) {
|
|
6011
6052
|
for (; I < m.length; I++)
|
|
6012
6053
|
q = C(g, m[I], E), q !== null && (h = i(
|
|
@@ -6014,7 +6055,7 @@ Error generating stack: ` + a.message + `
|
|
|
6014
6055
|
h,
|
|
6015
6056
|
I
|
|
6016
6057
|
), ht === null ? X = q : ht.sibling = q, ht = q);
|
|
6017
|
-
return
|
|
6058
|
+
return rt && Ye(g, I), X;
|
|
6018
6059
|
}
|
|
6019
6060
|
for (q = a(q); I < m.length; I++)
|
|
6020
6061
|
ft = S(
|
|
@@ -6032,7 +6073,7 @@ Error generating stack: ` + a.message + `
|
|
|
6032
6073
|
), ht === null ? X = ft : ht.sibling = ft, ht = ft);
|
|
6033
6074
|
return t && q.forEach(function(zl) {
|
|
6034
6075
|
return e(g, zl);
|
|
6035
|
-
}),
|
|
6076
|
+
}), rt && Ye(g, I), X;
|
|
6036
6077
|
}
|
|
6037
6078
|
function V(g, h, m, E) {
|
|
6038
6079
|
if (m == null) throw Error(r(151));
|
|
@@ -6046,17 +6087,17 @@ Error generating stack: ` + a.message + `
|
|
|
6046
6087
|
t && q && zl.alternate === null && e(g, q), h = i(zl, h, I), ht === null ? X = zl : ht.sibling = zl, ht = zl, q = ft;
|
|
6047
6088
|
}
|
|
6048
6089
|
if (yt.done)
|
|
6049
|
-
return l(g, q),
|
|
6090
|
+
return l(g, q), rt && Ye(g, I), X;
|
|
6050
6091
|
if (q === null) {
|
|
6051
6092
|
for (; !yt.done; I++, yt = m.next())
|
|
6052
6093
|
yt = C(g, yt.value, E), yt !== null && (h = i(yt, h, I), ht === null ? X = yt : ht.sibling = yt, ht = yt);
|
|
6053
|
-
return
|
|
6094
|
+
return rt && Ye(g, I), X;
|
|
6054
6095
|
}
|
|
6055
6096
|
for (q = a(q); !yt.done; I++, yt = m.next())
|
|
6056
6097
|
yt = S(q, g, I, yt.value, E), yt !== null && (t && yt.alternate !== null && q.delete(yt.key === null ? I : yt.key), h = i(yt, h, I), ht === null ? X = yt : ht.sibling = yt, ht = yt);
|
|
6057
6098
|
return t && q.forEach(function(hg) {
|
|
6058
6099
|
return e(g, hg);
|
|
6059
|
-
}),
|
|
6100
|
+
}), rt && Ye(g, I), X;
|
|
6060
6101
|
}
|
|
6061
6102
|
function St(g, h, m, E) {
|
|
6062
6103
|
if (typeof m == "object" && m !== null && m.type === F && m.key === null && (m = m.props.children), typeof m == "object" && m !== null) {
|
|
@@ -6338,7 +6379,7 @@ Error generating stack: ` + a.message + `
|
|
|
6338
6379
|
N(ai, Fe), N(ga, ga.current);
|
|
6339
6380
|
}
|
|
6340
6381
|
function Iu() {
|
|
6341
|
-
Fe = ai.current,
|
|
6382
|
+
Fe = ai.current, M(ga), M(ai);
|
|
6342
6383
|
}
|
|
6343
6384
|
var ye = y(null), Ce = null;
|
|
6344
6385
|
function rl(t) {
|
|
@@ -6355,7 +6396,7 @@ Error generating stack: ` + a.message + `
|
|
|
6355
6396
|
N(Dt, Dt.current), N(ye, ye.current);
|
|
6356
6397
|
}
|
|
6357
6398
|
function ge(t) {
|
|
6358
|
-
|
|
6399
|
+
M(ye), Ce === t && (Ce = null), M(Dt);
|
|
6359
6400
|
}
|
|
6360
6401
|
var Dt = y(0);
|
|
6361
6402
|
function ni(t) {
|
|
@@ -6583,7 +6624,7 @@ Error generating stack: ` + a.message + `
|
|
|
6583
6624
|
return [i, a];
|
|
6584
6625
|
}
|
|
6585
6626
|
function $o(t, e, l) {
|
|
6586
|
-
var a = W, n = jt(), i =
|
|
6627
|
+
var a = W, n = jt(), i = rt;
|
|
6587
6628
|
if (i) {
|
|
6588
6629
|
if (l === void 0) throw Error(r(407));
|
|
6589
6630
|
l = l();
|
|
@@ -6734,12 +6775,12 @@ Error generating stack: ` + a.message + `
|
|
|
6734
6775
|
return e;
|
|
6735
6776
|
}
|
|
6736
6777
|
function fs(t, e) {
|
|
6737
|
-
if (
|
|
6778
|
+
if (rt) {
|
|
6738
6779
|
var l = Tt.formState;
|
|
6739
6780
|
if (l !== null) {
|
|
6740
6781
|
t: {
|
|
6741
6782
|
var a = W;
|
|
6742
|
-
if (
|
|
6783
|
+
if (rt) {
|
|
6743
6784
|
if (At) {
|
|
6744
6785
|
e: {
|
|
6745
6786
|
for (var n = At, i = ze; n.nodeType !== 8; ) {
|
|
@@ -7241,7 +7282,7 @@ Error generating stack: ` + a.message + `
|
|
|
7241
7282
|
},
|
|
7242
7283
|
useSyncExternalStore: function(t, e, l) {
|
|
7243
7284
|
var a = W, n = It();
|
|
7244
|
-
if (
|
|
7285
|
+
if (rt) {
|
|
7245
7286
|
if (l === void 0)
|
|
7246
7287
|
throw Error(r(407));
|
|
7247
7288
|
l = l();
|
|
@@ -7269,7 +7310,7 @@ Error generating stack: ` + a.message + `
|
|
|
7269
7310
|
},
|
|
7270
7311
|
useId: function() {
|
|
7271
7312
|
var t = It(), e = Tt.identifierPrefix;
|
|
7272
|
-
if (
|
|
7313
|
+
if (rt) {
|
|
7273
7314
|
var l = Re, a = je;
|
|
7274
7315
|
l = (a & ~(1 << 32 - re(a) - 1)).toString(32) + l, e = "_" + e + "R_" + l, l = ui++, 0 < l && (e += "H" + l.toString(32)), e += "_";
|
|
7275
7316
|
} else
|
|
@@ -7523,7 +7564,7 @@ Error generating stack: ` + a.message + `
|
|
|
7523
7564
|
}
|
|
7524
7565
|
return Qc(t, a, n), zi(), !1;
|
|
7525
7566
|
}
|
|
7526
|
-
if (
|
|
7567
|
+
if (rt)
|
|
7527
7568
|
return e = ye.current, e !== null ? ((e.flags & 65536) === 0 && (e.flags |= 256), e.flags |= 65536, e.lanes = n, a !== qu && (t = Error(r(422), { cause: a }), Ka(Te(t, l)))) : (a !== qu && (e = Error(r(423), {
|
|
7528
7569
|
cause: a
|
|
7529
7570
|
}), Ka(
|
|
@@ -7577,7 +7618,7 @@ Error generating stack: ` + a.message + `
|
|
|
7577
7618
|
u,
|
|
7578
7619
|
i,
|
|
7579
7620
|
n
|
|
7580
|
-
), c = lc(), t !== null && !Nt ? (ac(t, e, n), Ze(t, e, n)) : (
|
|
7621
|
+
), c = lc(), t !== null && !Nt ? (ac(t, e, n), Ze(t, e, n)) : (rt && c && Hu(e), e.flags |= 1, Kt(t, e, a, n), e.child);
|
|
7581
7622
|
}
|
|
7582
7623
|
function Ls(t, e, l, a, n) {
|
|
7583
7624
|
if (t === null) {
|
|
@@ -7687,7 +7728,7 @@ Error generating stack: ` + a.message + `
|
|
|
7687
7728
|
function dy(t, e, l) {
|
|
7688
7729
|
var a = e.pendingProps, n = (e.flags & 128) !== 0;
|
|
7689
7730
|
if (e.flags &= -129, t === null) {
|
|
7690
|
-
if (
|
|
7731
|
+
if (rt) {
|
|
7691
7732
|
if (a.mode === "hidden")
|
|
7692
7733
|
return t = yi(e, a), e.lanes = 536870912, un(null, t);
|
|
7693
7734
|
if (Pu(e), (t = At) ? (t = ad(
|
|
@@ -7725,7 +7766,7 @@ Error generating stack: ` + a.message + `
|
|
|
7725
7766
|
l
|
|
7726
7767
|
);
|
|
7727
7768
|
} else
|
|
7728
|
-
t = i.treeContext, At = _e(u.nextSibling), Zt = e,
|
|
7769
|
+
t = i.treeContext, At = _e(u.nextSibling), Zt = e, rt = !0, il = null, ze = !1, t !== null && Do(e, t), e = yi(e, a), e.flags |= 4096;
|
|
7729
7770
|
return e;
|
|
7730
7771
|
}
|
|
7731
7772
|
return t = Ge(t.child, {
|
|
@@ -7751,7 +7792,7 @@ Error generating stack: ` + a.message + `
|
|
|
7751
7792
|
a,
|
|
7752
7793
|
void 0,
|
|
7753
7794
|
n
|
|
7754
|
-
), a = lc(), t !== null && !Nt ? (ac(t, e, n), Ze(t, e, n)) : (
|
|
7795
|
+
), a = lc(), t !== null && !Nt ? (ac(t, e, n), Ze(t, e, n)) : (rt && a && Hu(e), e.flags |= 1, Kt(t, e, l, n), e.child);
|
|
7755
7796
|
}
|
|
7756
7797
|
function ks(t, e, l, a, n, i) {
|
|
7757
7798
|
return Hl(e), e.updateQueue = null, l = Wo(
|
|
@@ -7759,7 +7800,7 @@ Error generating stack: ` + a.message + `
|
|
|
7759
7800
|
a,
|
|
7760
7801
|
l,
|
|
7761
7802
|
n
|
|
7762
|
-
), Jo(t), a = lc(), t !== null && !Nt ? (ac(t, e, i), Ze(t, e, i)) : (
|
|
7803
|
+
), Jo(t), a = lc(), t !== null && !Nt ? (ac(t, e, i), Ze(t, e, i)) : (rt && a && Hu(e), e.flags |= 1, Kt(t, e, l, i), e.child);
|
|
7763
7804
|
}
|
|
7764
7805
|
function Ks(t, e, l, a, n) {
|
|
7765
7806
|
if (Hl(e), e.stateNode === null) {
|
|
@@ -7859,7 +7900,7 @@ Error generating stack: ` + a.message + `
|
|
|
7859
7900
|
function Ws(t, e, l) {
|
|
7860
7901
|
var a = e.pendingProps, n = !1, i = (e.flags & 128) !== 0, u;
|
|
7861
7902
|
if ((u = i) || (u = t !== null && t.memoizedState === null ? !1 : (Dt.current & 2) !== 0), u && (n = !0, e.flags &= -129), u = (e.flags & 32) !== 0, e.flags &= -33, t === null) {
|
|
7862
|
-
if (
|
|
7903
|
+
if (rt) {
|
|
7863
7904
|
if (n ? rl(e) : dl(), (t = At) ? (t = ad(
|
|
7864
7905
|
t,
|
|
7865
7906
|
ze
|
|
@@ -7929,7 +7970,7 @@ Error generating stack: ` + a.message + `
|
|
|
7929
7970
|
} else
|
|
7930
7971
|
uf(c) ? (e.flags |= 192, e.child = t.child, e = null) : (t = s.treeContext, At = _e(
|
|
7931
7972
|
c.nextSibling
|
|
7932
|
-
), Zt = e,
|
|
7973
|
+
), Zt = e, rt = !0, il = null, ze = !1, t !== null && Do(e, t), e = zc(
|
|
7933
7974
|
e,
|
|
7934
7975
|
a.children
|
|
7935
7976
|
), e.flags |= 4096);
|
|
@@ -7994,7 +8035,7 @@ Error generating stack: ` + a.message + `
|
|
|
7994
8035
|
var a = e.pendingProps, n = a.revealOrder, i = a.tail;
|
|
7995
8036
|
a = a.children;
|
|
7996
8037
|
var u = Dt.current, c = (u & 2) !== 0;
|
|
7997
|
-
if (c ? (u = u & 1 | 2, e.flags |= 128) : u &= 1, N(Dt, u), Kt(t, e, a, l), a =
|
|
8038
|
+
if (c ? (u = u & 1 | 2, e.flags |= 128) : u &= 1, N(Dt, u), Kt(t, e, a, l), a = rt ? ka : 0, !c && t !== null && (t.flags & 128) !== 0)
|
|
7998
8039
|
t: for (t = e.child; t !== null; ) {
|
|
7999
8040
|
if (t.tag === 13)
|
|
8000
8041
|
t.memoizedState !== null && $s(t, l, e);
|
|
@@ -8158,7 +8199,7 @@ Error generating stack: ` + a.message + `
|
|
|
8158
8199
|
Nt = (t.flags & 131072) !== 0;
|
|
8159
8200
|
}
|
|
8160
8201
|
else
|
|
8161
|
-
Nt = !1,
|
|
8202
|
+
Nt = !1, rt && (e.flags & 1048576) !== 0 && Uo(e, ka, e.index);
|
|
8162
8203
|
switch (e.lanes = 0, e.tag) {
|
|
8163
8204
|
case 16:
|
|
8164
8205
|
t: {
|
|
@@ -8263,7 +8304,7 @@ Error generating stack: ` + a.message + `
|
|
|
8263
8304
|
);
|
|
8264
8305
|
break t;
|
|
8265
8306
|
} else
|
|
8266
|
-
for (t = e.stateNode.containerInfo, t.nodeType === 9 ? t = t.body : t = t.nodeName === "HTML" ? t.ownerDocument.body : t, At = _e(t.firstChild), Zt = e,
|
|
8307
|
+
for (t = e.stateNode.containerInfo, t.nodeType === 9 ? t = t.body : t = t.nodeName === "HTML" ? t.ownerDocument.body : t, At = _e(t.firstChild), Zt = e, rt = !0, il = null, ze = !0, l = Vo(
|
|
8267
8308
|
e,
|
|
8268
8309
|
null,
|
|
8269
8310
|
a,
|
|
@@ -8290,7 +8331,7 @@ Error generating stack: ` + a.message + `
|
|
|
8290
8331
|
null,
|
|
8291
8332
|
e.pendingProps,
|
|
8292
8333
|
null
|
|
8293
|
-
)) ? e.memoizedState = l :
|
|
8334
|
+
)) ? e.memoizedState = l : rt || (l = e.type, t = e.pendingProps, a = ji(
|
|
8294
8335
|
at.current
|
|
8295
8336
|
).createElement(l), a[Qt] = e, a[te] = t, Jt(a, l, t), Yt(a), e.stateNode = a) : e.memoizedState = od(
|
|
8296
8337
|
e.type,
|
|
@@ -8299,7 +8340,7 @@ Error generating stack: ` + a.message + `
|
|
|
8299
8340
|
t.memoizedState
|
|
8300
8341
|
), null;
|
|
8301
8342
|
case 27:
|
|
8302
|
-
return Da(e), t === null &&
|
|
8343
|
+
return Da(e), t === null && rt && (a = e.stateNode = ud(
|
|
8303
8344
|
e.type,
|
|
8304
8345
|
e.pendingProps,
|
|
8305
8346
|
at.current
|
|
@@ -8310,7 +8351,7 @@ Error generating stack: ` + a.message + `
|
|
|
8310
8351
|
l
|
|
8311
8352
|
), gi(t, e), t === null && (e.flags |= 4194304), e.child;
|
|
8312
8353
|
case 5:
|
|
8313
|
-
return t === null &&
|
|
8354
|
+
return t === null && rt && ((n = a = At) && (a = Vy(
|
|
8314
8355
|
a,
|
|
8315
8356
|
e.type,
|
|
8316
8357
|
e.pendingProps,
|
|
@@ -8324,7 +8365,7 @@ Error generating stack: ` + a.message + `
|
|
|
8324
8365
|
l
|
|
8325
8366
|
), Sn._currentValue = n), gi(t, e), Kt(t, e, a, l), e.child;
|
|
8326
8367
|
case 6:
|
|
8327
|
-
return t === null &&
|
|
8368
|
+
return t === null && rt && ((t = l = At) && (l = Qy(
|
|
8328
8369
|
l,
|
|
8329
8370
|
e.pendingProps,
|
|
8330
8371
|
ze
|
|
@@ -8442,7 +8483,7 @@ Error generating stack: ` + a.message + `
|
|
|
8442
8483
|
e !== null && (t.flags |= 4), t.flags & 16384 && (e = t.tag !== 22 ? Df() : 536870912, t.lanes |= e, Ta |= e);
|
|
8443
8484
|
}
|
|
8444
8485
|
function cn(t, e) {
|
|
8445
|
-
if (!
|
|
8486
|
+
if (!rt)
|
|
8446
8487
|
switch (t.tailMode) {
|
|
8447
8488
|
case "hidden":
|
|
8448
8489
|
e = t.tail;
|
|
@@ -8666,7 +8707,7 @@ Error generating stack: ` + a.message + `
|
|
|
8666
8707
|
case 10:
|
|
8667
8708
|
return Xe(e.type), Et(e), null;
|
|
8668
8709
|
case 19:
|
|
8669
|
-
if (
|
|
8710
|
+
if (M(Dt), a = e.memoizedState, a === null) return Et(e), null;
|
|
8670
8711
|
if (n = (e.flags & 128) !== 0, i = a.rendering, i === null)
|
|
8671
8712
|
if (n) cn(a, !1);
|
|
8672
8713
|
else {
|
|
@@ -8678,7 +8719,7 @@ Error generating stack: ` + a.message + `
|
|
|
8678
8719
|
return N(
|
|
8679
8720
|
Dt,
|
|
8680
8721
|
Dt.current & 1 | 2
|
|
8681
|
-
),
|
|
8722
|
+
), rt && Ye(e, a.treeForkCount), e.child;
|
|
8682
8723
|
}
|
|
8683
8724
|
t = t.sibling;
|
|
8684
8725
|
}
|
|
@@ -8687,7 +8728,7 @@ Error generating stack: ` + a.message + `
|
|
|
8687
8728
|
else {
|
|
8688
8729
|
if (!n)
|
|
8689
8730
|
if (t = ni(i), t !== null) {
|
|
8690
|
-
if (e.flags |= 128, n = !0, t = t.updateQueue, e.updateQueue = t, pi(e, t), cn(a, !0), a.tail === null && a.tailMode === "hidden" && !i.alternate && !
|
|
8731
|
+
if (e.flags |= 128, n = !0, t = t.updateQueue, e.updateQueue = t, pi(e, t), cn(a, !0), a.tail === null && a.tailMode === "hidden" && !i.alternate && !rt)
|
|
8691
8732
|
return Et(e), null;
|
|
8692
8733
|
} else
|
|
8693
8734
|
2 * oe() - a.renderingStartTime > Ti && l !== 536870912 && (e.flags |= 128, n = !0, cn(a, !1), e.lanes = 4194304);
|
|
@@ -8696,10 +8737,10 @@ Error generating stack: ` + a.message + `
|
|
|
8696
8737
|
return a.tail !== null ? (t = a.tail, a.rendering = t, a.tail = t.sibling, a.renderingStartTime = oe(), t.sibling = null, l = Dt.current, N(
|
|
8697
8738
|
Dt,
|
|
8698
8739
|
n ? l & 1 | 2 : l & 1
|
|
8699
|
-
),
|
|
8740
|
+
), rt && Ye(e, a.treeForkCount), t) : (Et(e), null);
|
|
8700
8741
|
case 22:
|
|
8701
8742
|
case 23:
|
|
8702
|
-
return ge(e), Iu(), a = e.memoizedState !== null, t !== null ? t.memoizedState !== null !== a && (e.flags |= 8192) : a && (e.flags |= 8192), a ? (l & 536870912) !== 0 && (e.flags & 128) === 0 && (Et(e), e.subtreeFlags & 6 && (e.flags |= 8192)) : Et(e), l = e.updateQueue, l !== null && pi(e, l.retryQueue), l = null, t !== null && t.memoizedState !== null && t.memoizedState.cachePool !== null && (l = t.memoizedState.cachePool.pool), a = null, e.memoizedState !== null && e.memoizedState.cachePool !== null && (a = e.memoizedState.cachePool.pool), a !== l && (e.flags |= 2048), t !== null &&
|
|
8743
|
+
return ge(e), Iu(), a = e.memoizedState !== null, t !== null ? t.memoizedState !== null !== a && (e.flags |= 8192) : a && (e.flags |= 8192), a ? (l & 536870912) !== 0 && (e.flags & 128) === 0 && (Et(e), e.subtreeFlags & 6 && (e.flags |= 8192)) : Et(e), l = e.updateQueue, l !== null && pi(e, l.retryQueue), l = null, t !== null && t.memoizedState !== null && t.memoizedState.cachePool !== null && (l = t.memoizedState.cachePool.pool), a = null, e.memoizedState !== null && e.memoizedState.cachePool !== null && (a = e.memoizedState.cachePool.pool), a !== l && (e.flags |= 2048), t !== null && M(Bl), null;
|
|
8703
8744
|
case 24:
|
|
8704
8745
|
return l = null, t !== null && (l = t.memoizedState.cache), e.memoizedState.cache !== l && (e.flags |= 2048), Xe(Rt), Et(e), null;
|
|
8705
8746
|
case 25:
|
|
@@ -8734,14 +8775,14 @@ Error generating stack: ` + a.message + `
|
|
|
8734
8775
|
}
|
|
8735
8776
|
return t = e.flags, t & 65536 ? (e.flags = t & -65537 | 128, e) : null;
|
|
8736
8777
|
case 19:
|
|
8737
|
-
return
|
|
8778
|
+
return M(Dt), null;
|
|
8738
8779
|
case 4:
|
|
8739
8780
|
return Ut(), null;
|
|
8740
8781
|
case 10:
|
|
8741
8782
|
return Xe(e.type), null;
|
|
8742
8783
|
case 22:
|
|
8743
8784
|
case 23:
|
|
8744
|
-
return ge(e), Iu(), t !== null &&
|
|
8785
|
+
return ge(e), Iu(), t !== null && M(Bl), t = e.flags, t & 65536 ? (e.flags = t & -65537 | 128, e) : null;
|
|
8745
8786
|
case 24:
|
|
8746
8787
|
return Xe(Rt), null;
|
|
8747
8788
|
case 25:
|
|
@@ -8770,14 +8811,14 @@ Error generating stack: ` + a.message + `
|
|
|
8770
8811
|
ge(e);
|
|
8771
8812
|
break;
|
|
8772
8813
|
case 19:
|
|
8773
|
-
|
|
8814
|
+
M(Dt);
|
|
8774
8815
|
break;
|
|
8775
8816
|
case 10:
|
|
8776
8817
|
Xe(e.type);
|
|
8777
8818
|
break;
|
|
8778
8819
|
case 22:
|
|
8779
8820
|
case 23:
|
|
8780
|
-
ge(e), Iu(), t !== null &&
|
|
8821
|
+
ge(e), Iu(), t !== null && M(Bl);
|
|
8781
8822
|
break;
|
|
8782
8823
|
case 24:
|
|
8783
8824
|
Xe(Rt);
|
|
@@ -10129,7 +10170,7 @@ Error generating stack: ` + a.message + `
|
|
|
10129
10170
|
}
|
|
10130
10171
|
function Sr() {
|
|
10131
10172
|
if (pe === 0)
|
|
10132
|
-
if ((ct & 536870912) === 0 ||
|
|
10173
|
+
if ((ct & 536870912) === 0 || rt) {
|
|
10133
10174
|
var t = Dn;
|
|
10134
10175
|
Dn <<= 1, (Dn & 3932160) === 0 && (Dn = 262144), pe = t;
|
|
10135
10176
|
} else pe = 536870912;
|
|
@@ -10588,7 +10629,7 @@ Error generating stack: ` + a.message + `
|
|
|
10588
10629
|
), nt = null;
|
|
10589
10630
|
return;
|
|
10590
10631
|
}
|
|
10591
|
-
e.flags & 32768 ? (
|
|
10632
|
+
e.flags & 32768 ? (rt || a === 1 ? t = !0 : Sa || (ct & 536870912) !== 0 ? t = !1 : (yl = t = !0, (a === 2 || a === 9 || a === 3 || a === 6) && (a = ye.current, a !== null && a.tag === 13 && (a.flags |= 16384))), Ur(e, t)) : Ci(e);
|
|
10592
10633
|
}
|
|
10593
10634
|
function Ci(t) {
|
|
10594
10635
|
var e = t;
|
|
@@ -11295,7 +11336,7 @@ Error generating stack: ` + a.message + `
|
|
|
11295
11336
|
t: {
|
|
11296
11337
|
if (b = t === "mouseover" || t === "pointerover", S = t === "mouseout" || t === "pointerout", b && l !== yu && (B = l.relatedTarget || l.fromElement) && (Jl(B) || B[Kl]))
|
|
11297
11338
|
break t;
|
|
11298
|
-
if ((S || b) && (b = A.window === A ? A : (b = A.ownerDocument) ? b.defaultView || b.parentWindow : window, S ? (B = l.relatedTarget || l.toElement, S = p, B = B ? Jl(B) : null, B !== null && (St =
|
|
11339
|
+
if ((S || b) && (b = A.window === A ? A : (b = A.ownerDocument) ? b.defaultView || b.parentWindow : window, S ? (B = l.relatedTarget || l.toElement, S = p, B = B ? Jl(B) : null, B !== null && (St = _(B), V = B.tag, B !== St || V !== 5 && V !== 27 && V !== 6) && (B = null)) : (S = null, B = p), S !== B)) {
|
|
11299
11340
|
if (V = Pf, E = "onMouseLeave", g = "onMouseEnter", h = "mouse", (t === "pointerout" || t === "pointerover") && (V = eo, E = "onPointerLeave", g = "onPointerEnter", h = "pointer"), St = S == null ? b : Ha(S), m = B == null ? b : Ha(B), b = new V(
|
|
11300
11341
|
E,
|
|
11301
11342
|
h + "leave",
|
|
@@ -13031,7 +13072,7 @@ Error generating stack: ` + a.message + `
|
|
|
13031
13072
|
var Yi = null;
|
|
13032
13073
|
function gf(t) {
|
|
13033
13074
|
if (Yi = null, t = Jl(t), t !== null) {
|
|
13034
|
-
var e =
|
|
13075
|
+
var e = _(t);
|
|
13035
13076
|
if (e === null) t = null;
|
|
13036
13077
|
else {
|
|
13037
13078
|
var l = e.tag;
|
|
@@ -13238,7 +13279,7 @@ Error generating stack: ` + a.message + `
|
|
|
13238
13279
|
function Ad(t) {
|
|
13239
13280
|
var e = Jl(t.target);
|
|
13240
13281
|
if (e !== null) {
|
|
13241
|
-
var l =
|
|
13282
|
+
var l = _(e);
|
|
13242
13283
|
if (l !== null) {
|
|
13243
13284
|
if (e = l.tag, e === 13) {
|
|
13244
13285
|
if (e = H(l), e !== null) {
|
|
@@ -13550,8 +13591,8 @@ const kl = /* @__PURE__ */ new Map(), _n = {
|
|
|
13550
13591
|
return console.error("[GlydeChat] Container not found:", d), null;
|
|
13551
13592
|
const T = typeof d == "string" ? d : o.id || `glyde-render-${Date.now()}`;
|
|
13552
13593
|
if (kl.has(T)) {
|
|
13553
|
-
const
|
|
13554
|
-
|
|
13594
|
+
const _ = kl.get(T);
|
|
13595
|
+
_ && (_.root.unmount(), kl.delete(T));
|
|
13555
13596
|
}
|
|
13556
13597
|
const r = f.theme === "auto" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : f.theme || "light";
|
|
13557
13598
|
Fi(r);
|
|
@@ -13565,11 +13606,11 @@ const kl = /* @__PURE__ */ new Map(), _n = {
|
|
|
13565
13606
|
destroy() {
|
|
13566
13607
|
z.unmount(), kl.delete(T), o.innerHTML = "", console.log("[GlydeChat] Rendered widget destroyed");
|
|
13567
13608
|
},
|
|
13568
|
-
update(
|
|
13609
|
+
update(_) {
|
|
13569
13610
|
z.render(
|
|
13570
13611
|
ki.createElement(Ki, {
|
|
13571
13612
|
...f,
|
|
13572
|
-
...
|
|
13613
|
+
..._,
|
|
13573
13614
|
container: o
|
|
13574
13615
|
})
|
|
13575
13616
|
);
|
|
@@ -13586,7 +13627,7 @@ const kl = /* @__PURE__ */ new Map(), _n = {
|
|
|
13586
13627
|
* Get SDK version (replaced at build time via Vite define).
|
|
13587
13628
|
*/
|
|
13588
13629
|
get version() {
|
|
13589
|
-
return "1.6.
|
|
13630
|
+
return "1.6.23";
|
|
13590
13631
|
}
|
|
13591
13632
|
};
|
|
13592
13633
|
async function Kg(d, f) {
|
|
@@ -13599,14 +13640,14 @@ async function Kg(d, f) {
|
|
|
13599
13640
|
};
|
|
13600
13641
|
f && (z["x-publishable-key"] = f);
|
|
13601
13642
|
try {
|
|
13602
|
-
const
|
|
13643
|
+
const _ = await fetch(r, {
|
|
13603
13644
|
method: "GET",
|
|
13604
13645
|
credentials: "omit",
|
|
13605
13646
|
headers: z
|
|
13606
|
-
}), H = await
|
|
13607
|
-
return
|
|
13608
|
-
} catch (
|
|
13609
|
-
return console.warn("[GlydeChat] Screen token verify request failed:",
|
|
13647
|
+
}), H = await _.json();
|
|
13648
|
+
return _.ok && H?.success && H?.data?.contextType === "screening" && H?.data?.contextId ? { contextType: "screening", contextId: H.data.contextId } : (console.warn("[GlydeChat] Screen token verify failed:", _.status, H), null);
|
|
13649
|
+
} catch (_) {
|
|
13650
|
+
return console.warn("[GlydeChat] Screen token verify request failed:", _), null;
|
|
13610
13651
|
}
|
|
13611
13652
|
}
|
|
13612
13653
|
function Jg(d) {
|
|
@@ -13621,8 +13662,8 @@ function Jg(d) {
|
|
|
13621
13662
|
for (const r of o) {
|
|
13622
13663
|
const z = r.match(/^\s*(width|height|maxWidth|maxHeight|max-width|max-height)\s*:\s*(.+)\s*$/i);
|
|
13623
13664
|
if (z) {
|
|
13624
|
-
const
|
|
13625
|
-
f[
|
|
13665
|
+
const _ = T[z[1].toLowerCase().replace(/-/g, "")] ?? z[1], H = z[2].trim(), U = Number(H);
|
|
13666
|
+
f[_] = isNaN(U) ? H : U;
|
|
13626
13667
|
}
|
|
13627
13668
|
}
|
|
13628
13669
|
return f;
|
|
@@ -13697,14 +13738,14 @@ function Wg() {
|
|
|
13697
13738
|
console.warn("[GlydeChat] data-container-id element not found:", L, "- falling back to init()");
|
|
13698
13739
|
}
|
|
13699
13740
|
_n.init(Z);
|
|
13700
|
-
},
|
|
13741
|
+
}, dt = async () => {
|
|
13701
13742
|
let Z = tt;
|
|
13702
13743
|
const K = await Kg(H, o);
|
|
13703
13744
|
K && (Z = { ...Z, contextType: K.contextType.trim(), contextId: K.contextId.trim() }, console.log("[GlydeChat] Screen token applied: contextType=", K.contextType, "contextId=", K.contextId)), F(Z);
|
|
13704
|
-
},
|
|
13705
|
-
|
|
13745
|
+
}, ot = () => {
|
|
13746
|
+
dt();
|
|
13706
13747
|
};
|
|
13707
|
-
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
13748
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", ot) : setTimeout(ot, 0);
|
|
13708
13749
|
}
|
|
13709
13750
|
typeof window < "u" && (window.GlydeChat = _n, console.log("[GlydeChat] SDK version:", _n.version), Wg());
|
|
13710
13751
|
export {
|