@cuekit-ai/react 1.3.1 → 1.3.3

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/index.js CHANGED
@@ -89,18 +89,14 @@ var init_intent_store = __esm({
89
89
  setElement(elementData) {
90
90
  const index2 = store.allElementsData.findIndex((e3) => e3.elementId === elementData.elementId);
91
91
  if (index2 >= 0) {
92
- console.log("Updating existing element");
93
92
  store.allElementsData[index2] = elementData;
94
93
  } else {
95
- console.log("Adding new element");
96
94
  store.allElementsData.push(elementData);
97
95
  }
98
96
  },
99
97
  getElementById(elementId) {
100
98
  const match = store.allElementsData.find((e3) => e3.elementId === elementId);
101
99
  if (!match) {
102
- console.warn(`[GlobalStore] No element found for ID: ${elementId}`);
103
- console.log("All elements in store:", store.allElementsData);
104
100
  }
105
101
  return match;
106
102
  },
@@ -125,7 +121,6 @@ function navigate(path2, params) {
125
121
  try {
126
122
  navigationHandler(absolutePath, safeParams);
127
123
  } catch (error) {
128
- console.error("[CueKit] navigation handler failed, falling back to default:", error);
129
124
  }
130
125
  return;
131
126
  }
@@ -176,7 +171,6 @@ function onStateChange() {
176
171
  const metadata = JSON.parse(params.metadata);
177
172
  GlobalStore.setMetadata(routeName, metadata);
178
173
  } catch (error) {
179
- console.error("Failed to parse metadata from URL:", error);
180
174
  }
181
175
  }
182
176
  }
@@ -218,7 +212,6 @@ var init_navigation = __esm({
218
212
  if (name2) {
219
213
  navigate(name2, params);
220
214
  } else {
221
- console.warn("[CueKit] route name not provided");
222
215
  }
223
216
  };
224
217
  handleNavigationAndClick = (routeName, elementHash) => {
@@ -22918,7 +22911,8 @@ var init_jsx_encoder = __esm({
22918
22911
 
22919
22912
  // src/utils/element-service.ts
22920
22913
  function getInteractiveElements() {
22921
- return document.querySelectorAll(INTERACTIVE_ELEMENT_SELECTOR);
22914
+ const elements = document.querySelectorAll(INTERACTIVE_ELEMENT_SELECTOR);
22915
+ return Array.from(new Set(Array.from(elements)));
22922
22916
  }
22923
22917
  function getImmediateText(element3) {
22924
22918
  let text7 = "";
@@ -22932,38 +22926,56 @@ function getImmediateText(element3) {
22932
22926
  return text7.trim();
22933
22927
  }
22934
22928
  function captureFullDOMStructure() {
22935
- console.log("\u{1F333} Capturing full DOM structure...");
22936
- const components = [];
22937
- const interactiveElements = getInteractiveElements();
22938
- interactiveElements.forEach((element3) => {
22939
- if (element3 instanceof HTMLElement && !element3.closest("[data-cuekit-ignore]")) {
22940
- const nodeData = buildFlatDOMNode(element3);
22941
- if (nodeData) {
22942
- components.push(nodeData);
22943
- }
22929
+ console.log("\u{1F333} Capturing full DOM structure for Cuekit...");
22930
+ const interactiveElements = [];
22931
+ const descriptionsMap = /* @__PURE__ */ new Map();
22932
+ document.querySelectorAll("[data-for]").forEach((el) => {
22933
+ const targetId = el.getAttribute("data-for");
22934
+ if (!targetId) return;
22935
+ const tags = [];
22936
+ const description = el.getAttribute("data-ansyr-description");
22937
+ if (description) {
22938
+ tags.push(description);
22939
+ }
22940
+ if (el.textContent) {
22941
+ tags.push(el.textContent.trim());
22942
+ }
22943
+ if (tags.length > 0) {
22944
+ const existingTags = descriptionsMap.get(targetId) || [];
22945
+ descriptionsMap.set(targetId, [...existingTags, ...tags]);
22946
+ }
22947
+ });
22948
+ const allElements = getInteractiveElements();
22949
+ allElements.forEach((element3) => {
22950
+ const style = getComputedStyle(element3);
22951
+ if (element3.closest("[data-cuekit-ignore]") || !isElementClickable(element3) || element3.tagName.toLowerCase() === "script" || style.display === "none" || style.visibility === "hidden") {
22952
+ return;
22944
22953
  }
22954
+ const staticId = element3.getAttribute("data-ansyr-static");
22955
+ const dynamicId = element3.getAttribute("data-ansyr-dynamic");
22956
+ const id = staticId || dynamicId;
22957
+ const tags = [];
22958
+ const directDescription = element3.getAttribute("data-ansyr-description");
22959
+ if (directDescription) {
22960
+ tags.push(directDescription);
22961
+ }
22962
+ if (id && descriptionsMap.has(id)) {
22963
+ tags.push(...descriptionsMap.get(id) || []);
22964
+ }
22965
+ const dto = {
22966
+ testID: id || generateStableDOMId(element3),
22967
+ type: element3.tagName.toLowerCase(),
22968
+ textContent: getImmediateText(element3) || element3.textContent?.trim() || "",
22969
+ tags
22970
+ };
22971
+ interactiveElements.push(dto);
22945
22972
  });
22946
- const result = { components };
22973
+ const result = {
22974
+ components: interactiveElements
22975
+ };
22947
22976
  console.log("\u{1F333} Full DOM structure captured:", result);
22948
22977
  return result;
22949
22978
  }
22950
- function buildFlatDOMNode(element3) {
22951
- if (element3.tagName.toLowerCase() === "script" || element3.hasAttribute("data-cuekit-ignore") || element3.style.display === "none" || element3.style.visibility === "hidden") {
22952
- return null;
22953
- }
22954
- const hash = generateStableDOMId(element3);
22955
- const text7 = getImmediateText(element3).substring(0, 100);
22956
- const isClickable = isElementClickable(element3);
22957
- const componentType = element3.tagName.toLowerCase();
22958
- return {
22959
- hash,
22960
- text: text7,
22961
- isClickable,
22962
- componentType,
22963
- children: []
22964
- // No children in a flat structure
22965
- };
22966
- }
22967
22979
  function isElementClickable(element3) {
22968
22980
  const interactiveSelectors = [
22969
22981
  "button",
@@ -23017,34 +23029,23 @@ function executeAction(action) {
23017
23029
  }
23018
23030
  }
23019
23031
  function getFullDOMStructure() {
23020
- console.log("\u{1F333} ElementService: Getting full DOM structure...");
23021
23032
  return captureFullDOMStructure();
23022
23033
  }
23023
23034
  function clickElement(elementId) {
23024
23035
  if (!elementId) {
23025
- console.warn("\u26A0\uFE0F No element ID provided for click action");
23026
23036
  return false;
23027
23037
  }
23028
- const domStructure = getFullDOMStructure();
23029
- const elementToClick = findElementById(domStructure, elementId);
23030
- if (elementToClick) {
23031
- console.log(`\u{1F3AF} Clicking element: ${elementId}`);
23032
- const domElement = findDOMElementById(elementId);
23033
- if (domElement) {
23034
- domElement.click();
23035
- return true;
23036
- }
23037
- } else {
23038
- console.warn(`\u26A0\uFE0F Element not found: ${elementId}`);
23038
+ const domElement = findDOMElementById(elementId);
23039
+ if (domElement) {
23040
+ domElement.click();
23041
+ return true;
23039
23042
  }
23040
23043
  return false;
23041
23044
  }
23042
23045
  function navigateToElement(target) {
23043
23046
  if (!target) {
23044
- console.warn("\u26A0\uFE0F No target provided for navigation action");
23045
23047
  return false;
23046
23048
  }
23047
- console.log(`\u{1F9ED} Navigating to: ${target}`);
23048
23049
  if (target.includes("/") || target.startsWith("http")) {
23049
23050
  safeNavigate(target, {});
23050
23051
  } else {
@@ -23054,27 +23055,22 @@ function navigateToElement(target) {
23054
23055
  }
23055
23056
  function focusElement(elementId) {
23056
23057
  if (!elementId) {
23057
- console.warn("\u26A0\uFE0F No element ID provided for focus action");
23058
23058
  return false;
23059
23059
  }
23060
23060
  const domElement = findDOMElementById(elementId);
23061
23061
  if (domElement instanceof HTMLInputElement || domElement instanceof HTMLTextAreaElement || domElement instanceof HTMLSelectElement) {
23062
- console.log(`\u{1F4DD} Focusing element: ${elementId}`);
23063
23062
  domElement.focus();
23064
23063
  return true;
23065
23064
  } else {
23066
- console.warn(`\u26A0\uFE0F Focusable element not found: ${elementId}`);
23067
23065
  return false;
23068
23066
  }
23069
23067
  }
23070
23068
  function toggleElement(elementId) {
23071
23069
  if (!elementId) {
23072
- console.warn("\u26A0\uFE0F No element ID provided for toggle action");
23073
23070
  return false;
23074
23071
  }
23075
23072
  const domElement = findDOMElementById(elementId);
23076
23073
  if (domElement instanceof HTMLElement) {
23077
- console.log(`\u{1F504} Toggling element: ${elementId}`);
23078
23074
  if (domElement instanceof HTMLInputElement) {
23079
23075
  if (domElement.type === "checkbox") {
23080
23076
  domElement.checked = !domElement.checked;
@@ -23087,34 +23083,20 @@ function toggleElement(elementId) {
23087
23083
  }
23088
23084
  return true;
23089
23085
  } else {
23090
- console.warn(`\u26A0\uFE0F Toggleable element not found: ${elementId}`);
23091
23086
  return false;
23092
23087
  }
23093
23088
  }
23094
- function findElementById(domStructure, elementId) {
23095
- const searchInComponents = (components) => {
23096
- for (const component of components) {
23097
- if (component.hash === elementId) {
23098
- return component;
23099
- }
23100
- if (component.children.length > 0) {
23101
- const found = searchInComponents(component.children);
23102
- if (found) return found;
23103
- }
23104
- }
23105
- return null;
23106
- };
23107
- return searchInComponents(domStructure.components);
23108
- }
23109
23089
  function findDOMElementById(elementId) {
23090
+ if (!elementId) {
23091
+ return null;
23092
+ }
23110
23093
  const interactiveElements = getInteractiveElements();
23111
23094
  for (const element3 of interactiveElements) {
23112
23095
  if (element3 instanceof HTMLElement) {
23113
- console.log("\u{1F50D} Checking element:", element3);
23114
- const hash = generateStableDOMId(element3);
23115
- console.log("\u{1F50D} Generated hash:", hash);
23116
- if (hash === elementId) {
23117
- console.log("\u{1F50D} Found element:", element3);
23096
+ const staticId = element3.getAttribute("data-ansyr-static");
23097
+ const dynamicId = element3.getAttribute("data-ansyr-dynamic");
23098
+ const currentElementId = staticId || dynamicId || generateStableDOMId(element3);
23099
+ if (currentElementId === elementId) {
23118
23100
  return element3;
23119
23101
  }
23120
23102
  }
@@ -23125,9 +23107,9 @@ var INTERACTIVE_ELEMENT_SELECTOR;
23125
23107
  var init_element_service = __esm({
23126
23108
  "src/utils/element-service.ts"() {
23127
23109
  "use strict";
23128
- init_jsx_encoder();
23129
23110
  init_navigation();
23130
- INTERACTIVE_ELEMENT_SELECTOR = 'a, button, input, textarea, select, [role="button"], [onclick]';
23111
+ init_jsx_encoder();
23112
+ INTERACTIVE_ELEMENT_SELECTOR = 'a, button, input, textarea, select, [role="button"], [onclick], [data-ansyr-static], [data-ansyr-dynamic]';
23131
23113
  }
23132
23114
  });
23133
23115
 
@@ -23161,31 +23143,29 @@ function setWebRTCCallbacks(newCallbacks) {
23161
23143
  }
23162
23144
  async function authenticate(userIdentity, apiKey, appId) {
23163
23145
  try {
23164
- console.log("\u{1F3A4} WebRTCService: Authenticating user...", { userIdentity });
23146
+ const authPayload = {
23147
+ user_identity: userIdentity,
23148
+ app_id: appId || _appId
23149
+ };
23165
23150
  const response = await fetch(`${serverUrl}/auth/login`, {
23166
23151
  method: "POST",
23167
23152
  headers: {
23168
23153
  "Content-Type": "application/json",
23169
23154
  "X-API-Key": apiKey
23170
23155
  },
23171
- body: JSON.stringify({
23172
- user_identity: userIdentity,
23173
- app_id: appId || _appId
23174
- })
23156
+ body: JSON.stringify(authPayload)
23175
23157
  });
23176
23158
  if (!response.ok) {
23177
23159
  const errorData = await response.json();
23178
23160
  throw new Error(errorData.detail || "Authentication failed");
23179
23161
  }
23180
23162
  const authData = await response.json();
23181
- console.log("\u{1F3A4} WebRTCService: Authentication successful:", authData);
23182
23163
  livekitUrl = authData.livekit_url;
23183
23164
  token = authData.livekit_token;
23184
23165
  roomName = authData.room_name;
23185
23166
  userIdentity = authData.user_identity;
23186
23167
  return authData;
23187
23168
  } catch (error) {
23188
- console.error("\u{1F3A4} WebRTCService: Authentication failed:", error);
23189
23169
  throw error;
23190
23170
  }
23191
23171
  }
@@ -23195,7 +23175,6 @@ async function connectToRoom(newLivekitUrl, newToken) {
23195
23175
  if (!url || !authToken) {
23196
23176
  throw new Error("Missing LiveKit URL or token. Please authenticate first.");
23197
23177
  }
23198
- console.log("\u{1F3A4} WebRTCService: Connecting to room...", { url, hasToken: !!authToken });
23199
23178
  try {
23200
23179
  setWebRTCConnectionState({ isConnected: false, isConnecting: true });
23201
23180
  room = new Room({
@@ -23204,17 +23183,13 @@ async function connectToRoom(newLivekitUrl, newToken) {
23204
23183
  });
23205
23184
  setupEventListeners();
23206
23185
  await room.connect(url, authToken);
23207
- console.log("\u{1F3A4} WebRTCService: Successfully connected to room:", room.name);
23208
23186
  setWebRTCConnectionState({ isConnected: true, isConnecting: false });
23209
23187
  try {
23210
23188
  await room.localParticipant.setMicrophoneEnabled(true);
23211
- console.log("\u{1F3A4} WebRTCService: Microphone enabled");
23212
23189
  } catch (micError) {
23213
- console.warn("\u{1F3A4} WebRTCService: Failed to enable microphone:", micError);
23214
23190
  }
23215
23191
  return { success: true };
23216
23192
  } catch (error) {
23217
- console.error("\u{1F3A4} WebRTCService: Failed to connect to room:", error);
23218
23193
  setWebRTCConnectionState({ isConnected: false, isConnecting: false });
23219
23194
  throw error;
23220
23195
  }
@@ -23222,23 +23197,17 @@ async function connectToRoom(newLivekitUrl, newToken) {
23222
23197
  function setupEventListeners() {
23223
23198
  if (!room) return;
23224
23199
  room.on(RoomEvent.ConnectionStateChanged, (state) => {
23225
- console.log("\u{1F3A4} WebRTCService: Connection state changed:", state);
23226
23200
  callbacks.onConnectionStateChange?.(state);
23227
23201
  if (state === ConnectionState.Connected) {
23228
- console.log("\u{1F3A4} WebRTCService: Successfully connected to room");
23229
23202
  setWebRTCConnectionState({ isConnected: true, isConnecting: false });
23230
23203
  } else if (state === ConnectionState.Disconnected) {
23231
- console.log("\u{1F3A4} WebRTCService: Disconnected from room");
23232
23204
  setWebRTCConnectionState({ isConnected: false, isConnecting: false });
23233
23205
  } else if (state === ConnectionState.Connecting) {
23234
- console.log("\u{1F3A4} WebRTCService: Connecting to room...");
23235
23206
  setWebRTCConnectionState({ isConnected: false, isConnecting: true });
23236
23207
  }
23237
23208
  }).on(RoomEvent.ParticipantConnected, (participant) => {
23238
- console.log("\u{1F3A4} WebRTCService: Participant connected:", participant.identity);
23239
23209
  updateParticipantsList();
23240
23210
  }).on(RoomEvent.ParticipantDisconnected, (participant) => {
23241
- console.log("\u{1F3A4} WebRTCService: Participant disconnected:", participant.identity);
23242
23211
  updateParticipantsList();
23243
23212
  }).on(RoomEvent.TrackSubscribed, (track, publication, participant) => {
23244
23213
  if (track.kind === Track.Kind.Audio && !participant.isLocal) {
@@ -23250,9 +23219,8 @@ function setupEventListeners() {
23250
23219
  if (element3 instanceof HTMLAudioElement) {
23251
23220
  const trackId = track.sid || `track_${Date.now()}_${Math.random()}`;
23252
23221
  callbacks.onAISpeechStart?.(trackId);
23253
- element3.play().catch(
23254
- (error) => console.warn("\u{1F3A4} WebRTCService: Failed to auto-play audio:", error)
23255
- );
23222
+ element3.play().catch((error) => {
23223
+ });
23256
23224
  element3.addEventListener("ended", () => callbacks.onAISpeechEnd?.(trackId));
23257
23225
  element3.addEventListener("pause", () => callbacks.onAISpeechEnd?.(trackId));
23258
23226
  }
@@ -23262,13 +23230,12 @@ function setupEventListeners() {
23262
23230
  }).on(RoomEvent.TrackUnsubscribed, (track) => {
23263
23231
  track.detach().forEach((element3) => element3.remove());
23264
23232
  }).on(RoomEvent.DataReceived, (payload, participant) => {
23265
- console.log("\u{1F4E1} LiveKit data received:", new TextDecoder().decode(payload));
23233
+ const decodedPayload = new TextDecoder().decode(payload);
23266
23234
  try {
23267
- const message = JSON.parse(new TextDecoder().decode(payload));
23268
- console.log("\u{1F4E1} LiveKit data received:", message);
23235
+ const message = JSON.parse(decodedPayload);
23269
23236
  callbacks.onNavigationCommand?.(message);
23270
23237
  } catch (error) {
23271
- const message = new TextDecoder().decode(payload);
23238
+ const message = decodedPayload;
23272
23239
  callbacks.onNavigationCommand?.({ type: "raw_text", data: message });
23273
23240
  }
23274
23241
  }).on(RoomEvent.Disconnected, () => {
@@ -23287,26 +23254,25 @@ function updateParticipantsList() {
23287
23254
  async function sendData(data, reliable = true) {
23288
23255
  if (!room) throw new Error("Not connected to room");
23289
23256
  try {
23290
- console.log("\u{1F4E1} LiveKit data sending:", data);
23257
+ console.log("\u2B06\uFE0F Sending data to backend [DataChannel]:", data);
23291
23258
  const encoder = new TextEncoder();
23292
23259
  const encodedData = encoder.encode(data);
23293
23260
  await room.localParticipant.publishData(encodedData, {
23294
23261
  reliable
23295
23262
  });
23296
23263
  } catch (error) {
23297
- console.error("Error sending data:", error);
23298
23264
  throw error;
23299
23265
  }
23300
23266
  }
23301
23267
  async function sendScreenStatus(screenData) {
23302
23268
  try {
23269
+ console.log("\u2B06\uFE0F Sending to backend [/ai/data]:", JSON.stringify(screenData, null, 2));
23303
23270
  await fetch(`${serverUrl}/ai/data`, {
23304
23271
  method: "POST",
23305
23272
  headers: { "Content-Type": "application/json" },
23306
23273
  body: JSON.stringify(screenData)
23307
23274
  });
23308
23275
  } catch (error) {
23309
- console.error("Error sending screen status:", error);
23310
23276
  throw error;
23311
23277
  }
23312
23278
  }
@@ -23321,12 +23287,10 @@ function getParticipants() {
23321
23287
  }
23322
23288
  async function sendUserCommand(command) {
23323
23289
  if (!room) return;
23324
- console.log(`\u{1F4AC} Sending user command: "${command}"`);
23325
23290
  await sendData(command);
23326
23291
  }
23327
23292
  async function sendRuntimeData() {
23328
23293
  if (!room) {
23329
- console.error("\u274C Cannot send runtime data without a room connection");
23330
23294
  return;
23331
23295
  }
23332
23296
  try {
@@ -23339,28 +23303,28 @@ async function sendRuntimeData() {
23339
23303
  current_screen: screenName
23340
23304
  }
23341
23305
  };
23342
- console.log("\u{1F4E6} Sending runtime data response");
23343
23306
  await sendData(JSON.stringify(response));
23344
- console.log("\u{1F4E6} Runtime data sent successfully");
23345
23307
  } catch (error) {
23346
- console.error("\u274C Failed to send runtime data:", error);
23347
23308
  }
23348
23309
  }
23349
23310
  async function sendStaticData(componentData, appId = "default") {
23350
23311
  try {
23312
+ const staticDataPayload = {
23313
+ type: "dashboard_data",
23314
+ app_id: appId,
23315
+ data: componentData
23316
+ };
23317
+ console.log("\u2B06\uFE0F Sending to backend [/ai/data]:", JSON.stringify(staticDataPayload, null, 2));
23351
23318
  const response = await fetch(`${serverUrl}/ai/data`, {
23352
23319
  method: "POST",
23353
23320
  headers: {
23354
23321
  "Content-Type": "application/json"
23355
23322
  },
23356
- body: JSON.stringify({
23357
- type: "dashboard_data",
23358
- app_id: appId,
23359
- data: componentData
23360
- })
23323
+ body: JSON.stringify(staticDataPayload)
23361
23324
  });
23362
23325
  if (response.ok) {
23363
23326
  const result = await response.json();
23327
+ console.log("\u2B07\uFE0F Received from backend [/ai/data]:", JSON.stringify(result, null, 2));
23364
23328
  return { success: true, data: result };
23365
23329
  } else {
23366
23330
  const errorText = await response.text();
@@ -23738,6 +23702,802 @@ var require_extend = __commonJS({
23738
23702
  }
23739
23703
  });
23740
23704
 
23705
+ // (disabled):crypto
23706
+ var require_crypto = __commonJS({
23707
+ "(disabled):crypto"() {
23708
+ "use strict";
23709
+ }
23710
+ });
23711
+
23712
+ // node_modules/crypto-js/core.js
23713
+ var require_core = __commonJS({
23714
+ "node_modules/crypto-js/core.js"(exports, module2) {
23715
+ "use strict";
23716
+ (function(root4, factory) {
23717
+ if (typeof exports === "object") {
23718
+ module2.exports = exports = factory();
23719
+ } else if (typeof define === "function" && define.amd) {
23720
+ define([], factory);
23721
+ } else {
23722
+ root4.CryptoJS = factory();
23723
+ }
23724
+ })(exports, function() {
23725
+ var CryptoJS = CryptoJS || function(Math2, undefined2) {
23726
+ var crypto2;
23727
+ if (typeof window !== "undefined" && window.crypto) {
23728
+ crypto2 = window.crypto;
23729
+ }
23730
+ if (typeof self !== "undefined" && self.crypto) {
23731
+ crypto2 = self.crypto;
23732
+ }
23733
+ if (typeof globalThis !== "undefined" && globalThis.crypto) {
23734
+ crypto2 = globalThis.crypto;
23735
+ }
23736
+ if (!crypto2 && typeof window !== "undefined" && window.msCrypto) {
23737
+ crypto2 = window.msCrypto;
23738
+ }
23739
+ if (!crypto2 && typeof global !== "undefined" && global.crypto) {
23740
+ crypto2 = global.crypto;
23741
+ }
23742
+ if (!crypto2 && typeof require === "function") {
23743
+ try {
23744
+ crypto2 = require_crypto();
23745
+ } catch (err) {
23746
+ }
23747
+ }
23748
+ var cryptoSecureRandomInt = function() {
23749
+ if (crypto2) {
23750
+ if (typeof crypto2.getRandomValues === "function") {
23751
+ try {
23752
+ return crypto2.getRandomValues(new Uint32Array(1))[0];
23753
+ } catch (err) {
23754
+ }
23755
+ }
23756
+ if (typeof crypto2.randomBytes === "function") {
23757
+ try {
23758
+ return crypto2.randomBytes(4).readInt32LE();
23759
+ } catch (err) {
23760
+ }
23761
+ }
23762
+ }
23763
+ throw new Error("Native crypto module could not be used to get secure random number.");
23764
+ };
23765
+ var create2 = Object.create || /* @__PURE__ */ function() {
23766
+ function F2() {
23767
+ }
23768
+ return function(obj) {
23769
+ var subtype;
23770
+ F2.prototype = obj;
23771
+ subtype = new F2();
23772
+ F2.prototype = null;
23773
+ return subtype;
23774
+ };
23775
+ }();
23776
+ var C = {};
23777
+ var C_lib = C.lib = {};
23778
+ var Base = C_lib.Base = /* @__PURE__ */ function() {
23779
+ return {
23780
+ /**
23781
+ * Creates a new object that inherits from this object.
23782
+ *
23783
+ * @param {Object} overrides Properties to copy into the new object.
23784
+ *
23785
+ * @return {Object} The new object.
23786
+ *
23787
+ * @static
23788
+ *
23789
+ * @example
23790
+ *
23791
+ * var MyType = CryptoJS.lib.Base.extend({
23792
+ * field: 'value',
23793
+ *
23794
+ * method: function () {
23795
+ * }
23796
+ * });
23797
+ */
23798
+ extend: function(overrides) {
23799
+ var subtype = create2(this);
23800
+ if (overrides) {
23801
+ subtype.mixIn(overrides);
23802
+ }
23803
+ if (!subtype.hasOwnProperty("init") || this.init === subtype.init) {
23804
+ subtype.init = function() {
23805
+ subtype.$super.init.apply(this, arguments);
23806
+ };
23807
+ }
23808
+ subtype.init.prototype = subtype;
23809
+ subtype.$super = this;
23810
+ return subtype;
23811
+ },
23812
+ /**
23813
+ * Extends this object and runs the init method.
23814
+ * Arguments to create() will be passed to init().
23815
+ *
23816
+ * @return {Object} The new object.
23817
+ *
23818
+ * @static
23819
+ *
23820
+ * @example
23821
+ *
23822
+ * var instance = MyType.create();
23823
+ */
23824
+ create: function() {
23825
+ var instance = this.extend();
23826
+ instance.init.apply(instance, arguments);
23827
+ return instance;
23828
+ },
23829
+ /**
23830
+ * Initializes a newly created object.
23831
+ * Override this method to add some logic when your objects are created.
23832
+ *
23833
+ * @example
23834
+ *
23835
+ * var MyType = CryptoJS.lib.Base.extend({
23836
+ * init: function () {
23837
+ * // ...
23838
+ * }
23839
+ * });
23840
+ */
23841
+ init: function() {
23842
+ },
23843
+ /**
23844
+ * Copies properties into this object.
23845
+ *
23846
+ * @param {Object} properties The properties to mix in.
23847
+ *
23848
+ * @example
23849
+ *
23850
+ * MyType.mixIn({
23851
+ * field: 'value'
23852
+ * });
23853
+ */
23854
+ mixIn: function(properties) {
23855
+ for (var propertyName in properties) {
23856
+ if (properties.hasOwnProperty(propertyName)) {
23857
+ this[propertyName] = properties[propertyName];
23858
+ }
23859
+ }
23860
+ if (properties.hasOwnProperty("toString")) {
23861
+ this.toString = properties.toString;
23862
+ }
23863
+ },
23864
+ /**
23865
+ * Creates a copy of this object.
23866
+ *
23867
+ * @return {Object} The clone.
23868
+ *
23869
+ * @example
23870
+ *
23871
+ * var clone = instance.clone();
23872
+ */
23873
+ clone: function() {
23874
+ return this.init.prototype.extend(this);
23875
+ }
23876
+ };
23877
+ }();
23878
+ var WordArray = C_lib.WordArray = Base.extend({
23879
+ /**
23880
+ * Initializes a newly created word array.
23881
+ *
23882
+ * @param {Array} words (Optional) An array of 32-bit words.
23883
+ * @param {number} sigBytes (Optional) The number of significant bytes in the words.
23884
+ *
23885
+ * @example
23886
+ *
23887
+ * var wordArray = CryptoJS.lib.WordArray.create();
23888
+ * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
23889
+ * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
23890
+ */
23891
+ init: function(words, sigBytes) {
23892
+ words = this.words = words || [];
23893
+ if (sigBytes != undefined2) {
23894
+ this.sigBytes = sigBytes;
23895
+ } else {
23896
+ this.sigBytes = words.length * 4;
23897
+ }
23898
+ },
23899
+ /**
23900
+ * Converts this word array to a string.
23901
+ *
23902
+ * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
23903
+ *
23904
+ * @return {string} The stringified word array.
23905
+ *
23906
+ * @example
23907
+ *
23908
+ * var string = wordArray + '';
23909
+ * var string = wordArray.toString();
23910
+ * var string = wordArray.toString(CryptoJS.enc.Utf8);
23911
+ */
23912
+ toString: function(encoder) {
23913
+ return (encoder || Hex).stringify(this);
23914
+ },
23915
+ /**
23916
+ * Concatenates a word array to this word array.
23917
+ *
23918
+ * @param {WordArray} wordArray The word array to append.
23919
+ *
23920
+ * @return {WordArray} This word array.
23921
+ *
23922
+ * @example
23923
+ *
23924
+ * wordArray1.concat(wordArray2);
23925
+ */
23926
+ concat: function(wordArray) {
23927
+ var thisWords = this.words;
23928
+ var thatWords = wordArray.words;
23929
+ var thisSigBytes = this.sigBytes;
23930
+ var thatSigBytes = wordArray.sigBytes;
23931
+ this.clamp();
23932
+ if (thisSigBytes % 4) {
23933
+ for (var i2 = 0; i2 < thatSigBytes; i2++) {
23934
+ var thatByte = thatWords[i2 >>> 2] >>> 24 - i2 % 4 * 8 & 255;
23935
+ thisWords[thisSigBytes + i2 >>> 2] |= thatByte << 24 - (thisSigBytes + i2) % 4 * 8;
23936
+ }
23937
+ } else {
23938
+ for (var j2 = 0; j2 < thatSigBytes; j2 += 4) {
23939
+ thisWords[thisSigBytes + j2 >>> 2] = thatWords[j2 >>> 2];
23940
+ }
23941
+ }
23942
+ this.sigBytes += thatSigBytes;
23943
+ return this;
23944
+ },
23945
+ /**
23946
+ * Removes insignificant bits.
23947
+ *
23948
+ * @example
23949
+ *
23950
+ * wordArray.clamp();
23951
+ */
23952
+ clamp: function() {
23953
+ var words = this.words;
23954
+ var sigBytes = this.sigBytes;
23955
+ words[sigBytes >>> 2] &= 4294967295 << 32 - sigBytes % 4 * 8;
23956
+ words.length = Math2.ceil(sigBytes / 4);
23957
+ },
23958
+ /**
23959
+ * Creates a copy of this word array.
23960
+ *
23961
+ * @return {WordArray} The clone.
23962
+ *
23963
+ * @example
23964
+ *
23965
+ * var clone = wordArray.clone();
23966
+ */
23967
+ clone: function() {
23968
+ var clone = Base.clone.call(this);
23969
+ clone.words = this.words.slice(0);
23970
+ return clone;
23971
+ },
23972
+ /**
23973
+ * Creates a word array filled with random bytes.
23974
+ *
23975
+ * @param {number} nBytes The number of random bytes to generate.
23976
+ *
23977
+ * @return {WordArray} The random word array.
23978
+ *
23979
+ * @static
23980
+ *
23981
+ * @example
23982
+ *
23983
+ * var wordArray = CryptoJS.lib.WordArray.random(16);
23984
+ */
23985
+ random: function(nBytes) {
23986
+ var words = [];
23987
+ for (var i2 = 0; i2 < nBytes; i2 += 4) {
23988
+ words.push(cryptoSecureRandomInt());
23989
+ }
23990
+ return new WordArray.init(words, nBytes);
23991
+ }
23992
+ });
23993
+ var C_enc = C.enc = {};
23994
+ var Hex = C_enc.Hex = {
23995
+ /**
23996
+ * Converts a word array to a hex string.
23997
+ *
23998
+ * @param {WordArray} wordArray The word array.
23999
+ *
24000
+ * @return {string} The hex string.
24001
+ *
24002
+ * @static
24003
+ *
24004
+ * @example
24005
+ *
24006
+ * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
24007
+ */
24008
+ stringify: function(wordArray) {
24009
+ var words = wordArray.words;
24010
+ var sigBytes = wordArray.sigBytes;
24011
+ var hexChars = [];
24012
+ for (var i2 = 0; i2 < sigBytes; i2++) {
24013
+ var bite = words[i2 >>> 2] >>> 24 - i2 % 4 * 8 & 255;
24014
+ hexChars.push((bite >>> 4).toString(16));
24015
+ hexChars.push((bite & 15).toString(16));
24016
+ }
24017
+ return hexChars.join("");
24018
+ },
24019
+ /**
24020
+ * Converts a hex string to a word array.
24021
+ *
24022
+ * @param {string} hexStr The hex string.
24023
+ *
24024
+ * @return {WordArray} The word array.
24025
+ *
24026
+ * @static
24027
+ *
24028
+ * @example
24029
+ *
24030
+ * var wordArray = CryptoJS.enc.Hex.parse(hexString);
24031
+ */
24032
+ parse: function(hexStr) {
24033
+ var hexStrLength = hexStr.length;
24034
+ var words = [];
24035
+ for (var i2 = 0; i2 < hexStrLength; i2 += 2) {
24036
+ words[i2 >>> 3] |= parseInt(hexStr.substr(i2, 2), 16) << 24 - i2 % 8 * 4;
24037
+ }
24038
+ return new WordArray.init(words, hexStrLength / 2);
24039
+ }
24040
+ };
24041
+ var Latin1 = C_enc.Latin1 = {
24042
+ /**
24043
+ * Converts a word array to a Latin1 string.
24044
+ *
24045
+ * @param {WordArray} wordArray The word array.
24046
+ *
24047
+ * @return {string} The Latin1 string.
24048
+ *
24049
+ * @static
24050
+ *
24051
+ * @example
24052
+ *
24053
+ * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
24054
+ */
24055
+ stringify: function(wordArray) {
24056
+ var words = wordArray.words;
24057
+ var sigBytes = wordArray.sigBytes;
24058
+ var latin1Chars = [];
24059
+ for (var i2 = 0; i2 < sigBytes; i2++) {
24060
+ var bite = words[i2 >>> 2] >>> 24 - i2 % 4 * 8 & 255;
24061
+ latin1Chars.push(String.fromCharCode(bite));
24062
+ }
24063
+ return latin1Chars.join("");
24064
+ },
24065
+ /**
24066
+ * Converts a Latin1 string to a word array.
24067
+ *
24068
+ * @param {string} latin1Str The Latin1 string.
24069
+ *
24070
+ * @return {WordArray} The word array.
24071
+ *
24072
+ * @static
24073
+ *
24074
+ * @example
24075
+ *
24076
+ * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
24077
+ */
24078
+ parse: function(latin1Str) {
24079
+ var latin1StrLength = latin1Str.length;
24080
+ var words = [];
24081
+ for (var i2 = 0; i2 < latin1StrLength; i2++) {
24082
+ words[i2 >>> 2] |= (latin1Str.charCodeAt(i2) & 255) << 24 - i2 % 4 * 8;
24083
+ }
24084
+ return new WordArray.init(words, latin1StrLength);
24085
+ }
24086
+ };
24087
+ var Utf8 = C_enc.Utf8 = {
24088
+ /**
24089
+ * Converts a word array to a UTF-8 string.
24090
+ *
24091
+ * @param {WordArray} wordArray The word array.
24092
+ *
24093
+ * @return {string} The UTF-8 string.
24094
+ *
24095
+ * @static
24096
+ *
24097
+ * @example
24098
+ *
24099
+ * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
24100
+ */
24101
+ stringify: function(wordArray) {
24102
+ try {
24103
+ return decodeURIComponent(escape(Latin1.stringify(wordArray)));
24104
+ } catch (e3) {
24105
+ throw new Error("Malformed UTF-8 data");
24106
+ }
24107
+ },
24108
+ /**
24109
+ * Converts a UTF-8 string to a word array.
24110
+ *
24111
+ * @param {string} utf8Str The UTF-8 string.
24112
+ *
24113
+ * @return {WordArray} The word array.
24114
+ *
24115
+ * @static
24116
+ *
24117
+ * @example
24118
+ *
24119
+ * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
24120
+ */
24121
+ parse: function(utf8Str) {
24122
+ return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
24123
+ }
24124
+ };
24125
+ var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
24126
+ /**
24127
+ * Resets this block algorithm's data buffer to its initial state.
24128
+ *
24129
+ * @example
24130
+ *
24131
+ * bufferedBlockAlgorithm.reset();
24132
+ */
24133
+ reset: function() {
24134
+ this._data = new WordArray.init();
24135
+ this._nDataBytes = 0;
24136
+ },
24137
+ /**
24138
+ * Adds new data to this block algorithm's buffer.
24139
+ *
24140
+ * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
24141
+ *
24142
+ * @example
24143
+ *
24144
+ * bufferedBlockAlgorithm._append('data');
24145
+ * bufferedBlockAlgorithm._append(wordArray);
24146
+ */
24147
+ _append: function(data) {
24148
+ if (typeof data == "string") {
24149
+ data = Utf8.parse(data);
24150
+ }
24151
+ this._data.concat(data);
24152
+ this._nDataBytes += data.sigBytes;
24153
+ },
24154
+ /**
24155
+ * Processes available data blocks.
24156
+ *
24157
+ * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
24158
+ *
24159
+ * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
24160
+ *
24161
+ * @return {WordArray} The processed data.
24162
+ *
24163
+ * @example
24164
+ *
24165
+ * var processedData = bufferedBlockAlgorithm._process();
24166
+ * var processedData = bufferedBlockAlgorithm._process(!!'flush');
24167
+ */
24168
+ _process: function(doFlush) {
24169
+ var processedWords;
24170
+ var data = this._data;
24171
+ var dataWords = data.words;
24172
+ var dataSigBytes = data.sigBytes;
24173
+ var blockSize = this.blockSize;
24174
+ var blockSizeBytes = blockSize * 4;
24175
+ var nBlocksReady = dataSigBytes / blockSizeBytes;
24176
+ if (doFlush) {
24177
+ nBlocksReady = Math2.ceil(nBlocksReady);
24178
+ } else {
24179
+ nBlocksReady = Math2.max((nBlocksReady | 0) - this._minBufferSize, 0);
24180
+ }
24181
+ var nWordsReady = nBlocksReady * blockSize;
24182
+ var nBytesReady = Math2.min(nWordsReady * 4, dataSigBytes);
24183
+ if (nWordsReady) {
24184
+ for (var offset = 0; offset < nWordsReady; offset += blockSize) {
24185
+ this._doProcessBlock(dataWords, offset);
24186
+ }
24187
+ processedWords = dataWords.splice(0, nWordsReady);
24188
+ data.sigBytes -= nBytesReady;
24189
+ }
24190
+ return new WordArray.init(processedWords, nBytesReady);
24191
+ },
24192
+ /**
24193
+ * Creates a copy of this object.
24194
+ *
24195
+ * @return {Object} The clone.
24196
+ *
24197
+ * @example
24198
+ *
24199
+ * var clone = bufferedBlockAlgorithm.clone();
24200
+ */
24201
+ clone: function() {
24202
+ var clone = Base.clone.call(this);
24203
+ clone._data = this._data.clone();
24204
+ return clone;
24205
+ },
24206
+ _minBufferSize: 0
24207
+ });
24208
+ var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
24209
+ /**
24210
+ * Configuration options.
24211
+ */
24212
+ cfg: Base.extend(),
24213
+ /**
24214
+ * Initializes a newly created hasher.
24215
+ *
24216
+ * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
24217
+ *
24218
+ * @example
24219
+ *
24220
+ * var hasher = CryptoJS.algo.SHA256.create();
24221
+ */
24222
+ init: function(cfg) {
24223
+ this.cfg = this.cfg.extend(cfg);
24224
+ this.reset();
24225
+ },
24226
+ /**
24227
+ * Resets this hasher to its initial state.
24228
+ *
24229
+ * @example
24230
+ *
24231
+ * hasher.reset();
24232
+ */
24233
+ reset: function() {
24234
+ BufferedBlockAlgorithm.reset.call(this);
24235
+ this._doReset();
24236
+ },
24237
+ /**
24238
+ * Updates this hasher with a message.
24239
+ *
24240
+ * @param {WordArray|string} messageUpdate The message to append.
24241
+ *
24242
+ * @return {Hasher} This hasher.
24243
+ *
24244
+ * @example
24245
+ *
24246
+ * hasher.update('message');
24247
+ * hasher.update(wordArray);
24248
+ */
24249
+ update: function(messageUpdate) {
24250
+ this._append(messageUpdate);
24251
+ this._process();
24252
+ return this;
24253
+ },
24254
+ /**
24255
+ * Finalizes the hash computation.
24256
+ * Note that the finalize operation is effectively a destructive, read-once operation.
24257
+ *
24258
+ * @param {WordArray|string} messageUpdate (Optional) A final message update.
24259
+ *
24260
+ * @return {WordArray} The hash.
24261
+ *
24262
+ * @example
24263
+ *
24264
+ * var hash = hasher.finalize();
24265
+ * var hash = hasher.finalize('message');
24266
+ * var hash = hasher.finalize(wordArray);
24267
+ */
24268
+ finalize: function(messageUpdate) {
24269
+ if (messageUpdate) {
24270
+ this._append(messageUpdate);
24271
+ }
24272
+ var hash = this._doFinalize();
24273
+ return hash;
24274
+ },
24275
+ blockSize: 512 / 32,
24276
+ /**
24277
+ * Creates a shortcut function to a hasher's object interface.
24278
+ *
24279
+ * @param {Hasher} hasher The hasher to create a helper for.
24280
+ *
24281
+ * @return {Function} The shortcut function.
24282
+ *
24283
+ * @static
24284
+ *
24285
+ * @example
24286
+ *
24287
+ * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
24288
+ */
24289
+ _createHelper: function(hasher) {
24290
+ return function(message, cfg) {
24291
+ return new hasher.init(cfg).finalize(message);
24292
+ };
24293
+ },
24294
+ /**
24295
+ * Creates a shortcut function to the HMAC's object interface.
24296
+ *
24297
+ * @param {Hasher} hasher The hasher to use in this HMAC helper.
24298
+ *
24299
+ * @return {Function} The shortcut function.
24300
+ *
24301
+ * @static
24302
+ *
24303
+ * @example
24304
+ *
24305
+ * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
24306
+ */
24307
+ _createHmacHelper: function(hasher) {
24308
+ return function(message, key) {
24309
+ return new C_algo.HMAC.init(hasher, key).finalize(message);
24310
+ };
24311
+ }
24312
+ });
24313
+ var C_algo = C.algo = {};
24314
+ return C;
24315
+ }(Math);
24316
+ return CryptoJS;
24317
+ });
24318
+ }
24319
+ });
24320
+
24321
+ // node_modules/crypto-js/md5.js
24322
+ var require_md5 = __commonJS({
24323
+ "node_modules/crypto-js/md5.js"(exports, module2) {
24324
+ "use strict";
24325
+ (function(root4, factory) {
24326
+ if (typeof exports === "object") {
24327
+ module2.exports = exports = factory(require_core());
24328
+ } else if (typeof define === "function" && define.amd) {
24329
+ define(["./core"], factory);
24330
+ } else {
24331
+ factory(root4.CryptoJS);
24332
+ }
24333
+ })(exports, function(CryptoJS) {
24334
+ (function(Math2) {
24335
+ var C = CryptoJS;
24336
+ var C_lib = C.lib;
24337
+ var WordArray = C_lib.WordArray;
24338
+ var Hasher = C_lib.Hasher;
24339
+ var C_algo = C.algo;
24340
+ var T = [];
24341
+ (function() {
24342
+ for (var i2 = 0; i2 < 64; i2++) {
24343
+ T[i2] = Math2.abs(Math2.sin(i2 + 1)) * 4294967296 | 0;
24344
+ }
24345
+ })();
24346
+ var MD52 = C_algo.MD5 = Hasher.extend({
24347
+ _doReset: function() {
24348
+ this._hash = new WordArray.init([
24349
+ 1732584193,
24350
+ 4023233417,
24351
+ 2562383102,
24352
+ 271733878
24353
+ ]);
24354
+ },
24355
+ _doProcessBlock: function(M3, offset) {
24356
+ for (var i2 = 0; i2 < 16; i2++) {
24357
+ var offset_i = offset + i2;
24358
+ var M_offset_i = M3[offset_i];
24359
+ M3[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 16711935 | (M_offset_i << 24 | M_offset_i >>> 8) & 4278255360;
24360
+ }
24361
+ var H3 = this._hash.words;
24362
+ var M_offset_0 = M3[offset + 0];
24363
+ var M_offset_1 = M3[offset + 1];
24364
+ var M_offset_2 = M3[offset + 2];
24365
+ var M_offset_3 = M3[offset + 3];
24366
+ var M_offset_4 = M3[offset + 4];
24367
+ var M_offset_5 = M3[offset + 5];
24368
+ var M_offset_6 = M3[offset + 6];
24369
+ var M_offset_7 = M3[offset + 7];
24370
+ var M_offset_8 = M3[offset + 8];
24371
+ var M_offset_9 = M3[offset + 9];
24372
+ var M_offset_10 = M3[offset + 10];
24373
+ var M_offset_11 = M3[offset + 11];
24374
+ var M_offset_12 = M3[offset + 12];
24375
+ var M_offset_13 = M3[offset + 13];
24376
+ var M_offset_14 = M3[offset + 14];
24377
+ var M_offset_15 = M3[offset + 15];
24378
+ var a = H3[0];
24379
+ var b2 = H3[1];
24380
+ var c = H3[2];
24381
+ var d = H3[3];
24382
+ a = FF(a, b2, c, d, M_offset_0, 7, T[0]);
24383
+ d = FF(d, a, b2, c, M_offset_1, 12, T[1]);
24384
+ c = FF(c, d, a, b2, M_offset_2, 17, T[2]);
24385
+ b2 = FF(b2, c, d, a, M_offset_3, 22, T[3]);
24386
+ a = FF(a, b2, c, d, M_offset_4, 7, T[4]);
24387
+ d = FF(d, a, b2, c, M_offset_5, 12, T[5]);
24388
+ c = FF(c, d, a, b2, M_offset_6, 17, T[6]);
24389
+ b2 = FF(b2, c, d, a, M_offset_7, 22, T[7]);
24390
+ a = FF(a, b2, c, d, M_offset_8, 7, T[8]);
24391
+ d = FF(d, a, b2, c, M_offset_9, 12, T[9]);
24392
+ c = FF(c, d, a, b2, M_offset_10, 17, T[10]);
24393
+ b2 = FF(b2, c, d, a, M_offset_11, 22, T[11]);
24394
+ a = FF(a, b2, c, d, M_offset_12, 7, T[12]);
24395
+ d = FF(d, a, b2, c, M_offset_13, 12, T[13]);
24396
+ c = FF(c, d, a, b2, M_offset_14, 17, T[14]);
24397
+ b2 = FF(b2, c, d, a, M_offset_15, 22, T[15]);
24398
+ a = GG(a, b2, c, d, M_offset_1, 5, T[16]);
24399
+ d = GG(d, a, b2, c, M_offset_6, 9, T[17]);
24400
+ c = GG(c, d, a, b2, M_offset_11, 14, T[18]);
24401
+ b2 = GG(b2, c, d, a, M_offset_0, 20, T[19]);
24402
+ a = GG(a, b2, c, d, M_offset_5, 5, T[20]);
24403
+ d = GG(d, a, b2, c, M_offset_10, 9, T[21]);
24404
+ c = GG(c, d, a, b2, M_offset_15, 14, T[22]);
24405
+ b2 = GG(b2, c, d, a, M_offset_4, 20, T[23]);
24406
+ a = GG(a, b2, c, d, M_offset_9, 5, T[24]);
24407
+ d = GG(d, a, b2, c, M_offset_14, 9, T[25]);
24408
+ c = GG(c, d, a, b2, M_offset_3, 14, T[26]);
24409
+ b2 = GG(b2, c, d, a, M_offset_8, 20, T[27]);
24410
+ a = GG(a, b2, c, d, M_offset_13, 5, T[28]);
24411
+ d = GG(d, a, b2, c, M_offset_2, 9, T[29]);
24412
+ c = GG(c, d, a, b2, M_offset_7, 14, T[30]);
24413
+ b2 = GG(b2, c, d, a, M_offset_12, 20, T[31]);
24414
+ a = HH(a, b2, c, d, M_offset_5, 4, T[32]);
24415
+ d = HH(d, a, b2, c, M_offset_8, 11, T[33]);
24416
+ c = HH(c, d, a, b2, M_offset_11, 16, T[34]);
24417
+ b2 = HH(b2, c, d, a, M_offset_14, 23, T[35]);
24418
+ a = HH(a, b2, c, d, M_offset_1, 4, T[36]);
24419
+ d = HH(d, a, b2, c, M_offset_4, 11, T[37]);
24420
+ c = HH(c, d, a, b2, M_offset_7, 16, T[38]);
24421
+ b2 = HH(b2, c, d, a, M_offset_10, 23, T[39]);
24422
+ a = HH(a, b2, c, d, M_offset_13, 4, T[40]);
24423
+ d = HH(d, a, b2, c, M_offset_0, 11, T[41]);
24424
+ c = HH(c, d, a, b2, M_offset_3, 16, T[42]);
24425
+ b2 = HH(b2, c, d, a, M_offset_6, 23, T[43]);
24426
+ a = HH(a, b2, c, d, M_offset_9, 4, T[44]);
24427
+ d = HH(d, a, b2, c, M_offset_12, 11, T[45]);
24428
+ c = HH(c, d, a, b2, M_offset_15, 16, T[46]);
24429
+ b2 = HH(b2, c, d, a, M_offset_2, 23, T[47]);
24430
+ a = II(a, b2, c, d, M_offset_0, 6, T[48]);
24431
+ d = II(d, a, b2, c, M_offset_7, 10, T[49]);
24432
+ c = II(c, d, a, b2, M_offset_14, 15, T[50]);
24433
+ b2 = II(b2, c, d, a, M_offset_5, 21, T[51]);
24434
+ a = II(a, b2, c, d, M_offset_12, 6, T[52]);
24435
+ d = II(d, a, b2, c, M_offset_3, 10, T[53]);
24436
+ c = II(c, d, a, b2, M_offset_10, 15, T[54]);
24437
+ b2 = II(b2, c, d, a, M_offset_1, 21, T[55]);
24438
+ a = II(a, b2, c, d, M_offset_8, 6, T[56]);
24439
+ d = II(d, a, b2, c, M_offset_15, 10, T[57]);
24440
+ c = II(c, d, a, b2, M_offset_6, 15, T[58]);
24441
+ b2 = II(b2, c, d, a, M_offset_13, 21, T[59]);
24442
+ a = II(a, b2, c, d, M_offset_4, 6, T[60]);
24443
+ d = II(d, a, b2, c, M_offset_11, 10, T[61]);
24444
+ c = II(c, d, a, b2, M_offset_2, 15, T[62]);
24445
+ b2 = II(b2, c, d, a, M_offset_9, 21, T[63]);
24446
+ H3[0] = H3[0] + a | 0;
24447
+ H3[1] = H3[1] + b2 | 0;
24448
+ H3[2] = H3[2] + c | 0;
24449
+ H3[3] = H3[3] + d | 0;
24450
+ },
24451
+ _doFinalize: function() {
24452
+ var data = this._data;
24453
+ var dataWords = data.words;
24454
+ var nBitsTotal = this._nDataBytes * 8;
24455
+ var nBitsLeft = data.sigBytes * 8;
24456
+ dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
24457
+ var nBitsTotalH = Math2.floor(nBitsTotal / 4294967296);
24458
+ var nBitsTotalL = nBitsTotal;
24459
+ dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = (nBitsTotalH << 8 | nBitsTotalH >>> 24) & 16711935 | (nBitsTotalH << 24 | nBitsTotalH >>> 8) & 4278255360;
24460
+ dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotalL << 8 | nBitsTotalL >>> 24) & 16711935 | (nBitsTotalL << 24 | nBitsTotalL >>> 8) & 4278255360;
24461
+ data.sigBytes = (dataWords.length + 1) * 4;
24462
+ this._process();
24463
+ var hash = this._hash;
24464
+ var H3 = hash.words;
24465
+ for (var i2 = 0; i2 < 4; i2++) {
24466
+ var H_i = H3[i2];
24467
+ H3[i2] = (H_i << 8 | H_i >>> 24) & 16711935 | (H_i << 24 | H_i >>> 8) & 4278255360;
24468
+ }
24469
+ return hash;
24470
+ },
24471
+ clone: function() {
24472
+ var clone = Hasher.clone.call(this);
24473
+ clone._hash = this._hash.clone();
24474
+ return clone;
24475
+ }
24476
+ });
24477
+ function FF(a, b2, c, d, x, s, t) {
24478
+ var n = a + (b2 & c | ~b2 & d) + x + t;
24479
+ return (n << s | n >>> 32 - s) + b2;
24480
+ }
24481
+ function GG(a, b2, c, d, x, s, t) {
24482
+ var n = a + (b2 & d | c & ~d) + x + t;
24483
+ return (n << s | n >>> 32 - s) + b2;
24484
+ }
24485
+ function HH(a, b2, c, d, x, s, t) {
24486
+ var n = a + (b2 ^ c ^ d) + x + t;
24487
+ return (n << s | n >>> 32 - s) + b2;
24488
+ }
24489
+ function II(a, b2, c, d, x, s, t) {
24490
+ var n = a + (c ^ (b2 | ~d)) + x + t;
24491
+ return (n << s | n >>> 32 - s) + b2;
24492
+ }
24493
+ C.MD5 = Hasher._createHelper(MD52);
24494
+ C.HmacMD5 = Hasher._createHmacHelper(MD52);
24495
+ })(Math);
24496
+ return CryptoJS.MD5;
24497
+ });
24498
+ }
24499
+ });
24500
+
23741
24501
  // src/index.ts
23742
24502
  var index_exports = {};
23743
24503
  __export(index_exports, {
@@ -23750,6 +24510,7 @@ __export(index_exports, {
23750
24510
  captureFullDOMStructure: () => captureFullDOMStructure,
23751
24511
  configureWebRTCServer: () => configureWebRTCServer,
23752
24512
  executeAction: () => executeAction,
24513
+ generateDynamicId: () => generateDynamicId,
23753
24514
  getFullDOMStructure: () => getFullDOMStructure,
23754
24515
  getWebRTCServerConfig: () => getWebRTCServerConfig,
23755
24516
  initWebRTC: () => initWebRTC,
@@ -23874,16 +24635,10 @@ var CuekitProvider = ({
23874
24635
  (0, import_react.useEffect)(() => {
23875
24636
  if (apiKey) {
23876
24637
  try {
23877
- console.log("\u{1F3A4} CuekitProvider: Starting WebRTC initialization...", {
23878
- apiKey: apiKey.substring(0, 10) + "..."
23879
- });
23880
24638
  initWebRTC(apiKey);
23881
- console.log("\u{1F3A4} CuekitProvider: WebRTC initialized successfully");
23882
24639
  } catch (error) {
23883
- console.error("\u{1F3A4} CuekitProvider: Failed to initialize WebRTC:", error);
23884
24640
  }
23885
24641
  } else {
23886
- console.warn("\u{1F3A4} CuekitProvider: No API key provided, skipping WebRTC initialization");
23887
24642
  }
23888
24643
  }, [apiKey]);
23889
24644
  (0, import_react.useEffect)(() => {
@@ -23896,15 +24651,11 @@ var CuekitProvider = ({
23896
24651
  Promise.resolve().then(() => (init_webrtc_service(), webrtc_service_exports)).then(({ setWebRTCCallbacks: setWebRTCCallbacks2 }) => {
23897
24652
  setWebRTCCallbacks2({
23898
24653
  onNavigationCommand: (command) => {
23899
- console.log("\u{1F9ED} Processing navigation command:", command);
23900
24654
  switch (command.type) {
23901
24655
  case "static_data_ready":
23902
- console.log("\u{1F4E6} Static data ready:", command.data);
23903
24656
  break;
23904
24657
  case "ai_intent":
23905
- console.log("\u{1F3AF} AI Intent:", command.text, "->", command.actionType);
23906
24658
  if (command.actionType === "navigate" && command.current_page) {
23907
- console.log(`\u{1F9ED} Navigating to: ${command.current_page}`);
23908
24659
  if (navigationHandler2) {
23909
24660
  navigationHandler2(command.current_page, {
23910
24661
  intent: command.intent,
@@ -23915,13 +24666,10 @@ var CuekitProvider = ({
23915
24666
  }
23916
24667
  break;
23917
24668
  case "user_speech_text":
23918
- console.log("\u{1F464} User said:", command.text);
23919
24669
  break;
23920
24670
  case "ai_speech_text":
23921
- console.log("\u{1F916} AI said:", command.text);
23922
24671
  break;
23923
24672
  default:
23924
- console.log("\u{1F50D} Unknown command type:", command.type);
23925
24673
  }
23926
24674
  },
23927
24675
  onConnectionStateChange: (state) => {
@@ -24061,7 +24809,6 @@ var useWebRTC = (options) => {
24061
24809
  setIsConnected(true);
24062
24810
  return authData;
24063
24811
  } catch (err) {
24064
- console.error("Connection failed:", err);
24065
24812
  setError(err.message || "Failed to connect");
24066
24813
  setIsConnected(false);
24067
24814
  } finally {
@@ -24148,7 +24895,7 @@ var useCuekit = (options) => {
24148
24895
  const [micState, setMicState] = (0, import_react3.useState)("idle");
24149
24896
  const [status, setStatus] = (0, import_react3.useState)("");
24150
24897
  const handleNavigationCommand = (event) => {
24151
- console.log(`\u{1F9E0} Processing event in useCuekit: ${event.type}`, event);
24898
+ console.log(`\u2B07\uFE0F Received event from backend: ${event.type}`, event);
24152
24899
  switch (event.type) {
24153
24900
  case "user_speech_chunk":
24154
24901
  case "ai_speech_chunk": {
@@ -28031,9 +28778,9 @@ function factoryTitle(effects, ok3, nok, type, markerType, stringType) {
28031
28778
  return atBreak(code4);
28032
28779
  }
28033
28780
  effects.consume(code4);
28034
- return code4 === 92 ? escape : inside;
28781
+ return code4 === 92 ? escape2 : inside;
28035
28782
  }
28036
- function escape(code4) {
28783
+ function escape2(code4) {
28037
28784
  if (code4 === marker || code4 === 92) {
28038
28785
  effects.consume(code4);
28039
28786
  return inside;
@@ -36929,9 +37676,9 @@ var SunIcon = ({ width = 24, height = 24, className, ...props }) => {
36929
37676
  viewBox: "0 0 24 24",
36930
37677
  fill: "none",
36931
37678
  stroke: "currentColor",
36932
- "stroke-width": "2",
36933
- "stroke-linecap": "round",
36934
- "stroke-linejoin": "round",
37679
+ strokeWidth: "2",
37680
+ strokeLinecap: "round",
37681
+ strokeLinejoin: "round",
36935
37682
  className,
36936
37683
  ...props
36937
37684
  },
@@ -36960,9 +37707,9 @@ var MoonIcon = ({ width = 24, height = 24, className, ...props }) => {
36960
37707
  viewBox: "0 0 24 24",
36961
37708
  fill: "none",
36962
37709
  stroke: "currentColor",
36963
- "stroke-width": "2",
36964
- "stroke-linecap": "round",
36965
- "stroke-linejoin": "round",
37710
+ strokeWidth: "2",
37711
+ strokeLinecap: "round",
37712
+ strokeLinejoin: "round",
36966
37713
  className,
36967
37714
  ...props
36968
37715
  },
@@ -36983,9 +37730,9 @@ var CloseIcon = ({ width = 24, height = 24, className, ...props }) => {
36983
37730
  viewBox: "0 0 24 24",
36984
37731
  fill: "none",
36985
37732
  stroke: "currentColor",
36986
- "stroke-width": "2",
36987
- "stroke-linecap": "round",
36988
- "stroke-linejoin": "round",
37733
+ strokeWidth: "2",
37734
+ strokeLinecap: "round",
37735
+ strokeLinejoin: "round",
36989
37736
  className,
36990
37737
  ...props
36991
37738
  },
@@ -37007,9 +37754,9 @@ var PhoneOffIcon = ({ width = 24, height = 24, className, ...props }) => {
37007
37754
  viewBox: "0 0 24 24",
37008
37755
  fill: "none",
37009
37756
  stroke: "currentColor",
37010
- "stroke-width": "2",
37011
- "stroke-linecap": "round",
37012
- "stroke-linejoin": "round",
37757
+ strokeWidth: "2",
37758
+ strokeLinecap: "round",
37759
+ strokeLinejoin: "round",
37013
37760
  className,
37014
37761
  ...props
37015
37762
  },
@@ -39636,19 +40383,6 @@ var VoiceIntensityBars = ({
39636
40383
  return null;
39637
40384
  }
39638
40385
  let trackRef = null;
39639
- console.log("VoiceIntensityVisualizer Debug:", {
39640
- participants: participants.length,
39641
- localParticipant: !!localParticipant,
39642
- isActive
39643
- });
39644
- console.log(
39645
- "All participants:",
39646
- participants.map((p) => ({
39647
- identity: p.identity,
39648
- isLocal: p instanceof Participant,
39649
- hasAudio: p.getTrackPublication(Track.Source.Microphone)?.track !== void 0
39650
- }))
39651
- );
39652
40386
  let speakingParticipant = null;
39653
40387
  let highestAudioLevel = 0;
39654
40388
  participants.forEach((participant) => {
@@ -39661,15 +40395,8 @@ var VoiceIntensityBars = ({
39661
40395
  if (!speakingParticipant || highestAudioLevel === 0) {
39662
40396
  speakingParticipant = participants.find((p) => p.isSpeaking) || (participants.length > 0 ? participants[0] : null);
39663
40397
  if (speakingParticipant) {
39664
- console.log("Fallback to speaking status or first participant:", speakingParticipant.identity);
39665
40398
  }
39666
40399
  } else {
39667
- console.log(
39668
- "Using participant with highest audio level:",
39669
- speakingParticipant.identity,
39670
- "level:",
39671
- highestAudioLevel
39672
- );
39673
40400
  }
39674
40401
  if (speakingParticipant) {
39675
40402
  const audioTrack = speakingParticipant.getTrackPublication(Track.Source.Microphone);
@@ -39736,9 +40463,9 @@ var MicIcon = ({ width = 24, height = 24, className, ...props }) => {
39736
40463
  viewBox: "0 0 24 24",
39737
40464
  fill: "none",
39738
40465
  stroke: "currentColor",
39739
- "stroke-width": "2",
39740
- "stroke-linecap": "round",
39741
- "stroke-linejoin": "round",
40466
+ strokeWidth: "2",
40467
+ strokeLinecap: "round",
40468
+ strokeLinejoin: "round",
39742
40469
  className,
39743
40470
  ...props
39744
40471
  },
@@ -39761,9 +40488,9 @@ var LoaderIcon = ({ width = 24, height = 24, className, ...props }) => {
39761
40488
  viewBox: "0 0 24 24",
39762
40489
  fill: "none",
39763
40490
  stroke: "currentColor",
39764
- "stroke-width": "2",
39765
- "stroke-linecap": "round",
39766
- "stroke-linejoin": "round",
40491
+ strokeWidth: "2",
40492
+ strokeLinecap: "round",
40493
+ strokeLinejoin: "round",
39767
40494
  className,
39768
40495
  ...props
39769
40496
  },
@@ -39842,9 +40569,6 @@ var MicButton = ({
39842
40569
  onAISpeechEnd: (trackId) => handleAISpeech(false, trackId),
39843
40570
  appId
39844
40571
  });
39845
- (0, import_react15.useEffect)(() => {
39846
- console.log("\u{1F3A4} MicButton received messages:", JSON.stringify(messageManagerMessages, null, 2));
39847
- }, [messageManagerMessages]);
39848
40572
  (0, import_react15.useEffect)(() => {
39849
40573
  const checkTheme = () => {
39850
40574
  if (typeof document !== "undefined") {
@@ -39894,74 +40618,27 @@ var MicButton = ({
39894
40618
  }, [showBorderGlow]);
39895
40619
  const handleAISpeech = (0, import_react15.useCallback)(
39896
40620
  (isSpeaking, trackId) => {
39897
- console.log("\u{1F3A4} MicButton: ===== AI SPEECH EVENT START =====");
39898
- console.log("\u{1F3A4} MicButton: Event type:", isSpeaking ? "START" : "END");
39899
- console.log("\u{1F3A4} MicButton: Track ID:", trackId);
39900
- console.log("\u{1F3A4} MicButton: Current AI speaking state:", aiSpeakingRef.current);
39901
- console.log("\u{1F3A4} MicButton: Current active AI tracks:", Array.from(activeAITracksRef.current));
39902
- console.log("\u{1F3A4} MicButton: Current status:", status);
39903
- console.log("\u{1F3A4} MicButton: Current mic state:", micState);
39904
- console.log("\u{1F3A4} MicButton: Is listening:", isConnected2);
39905
- console.log("\u{1F3A4} MicButton: Is connected:", isConnected2);
39906
40621
  if (isSpeaking && trackId) {
39907
- console.log("\u{1F3A4} MicButton: ===== AI SPEECH START =====");
39908
- console.log("\u{1F3A4} MicButton: Adding track to active set:", trackId);
39909
40622
  activeAITracksRef.current.add(trackId);
39910
40623
  aiSpeakingRef.current = true;
39911
- console.log("\u{1F3A4} MicButton: After adding track:");
39912
- console.log("\u{1F3A4} MicButton: - Active tracks:", Array.from(activeAITracksRef.current));
39913
- console.log("\u{1F3A4} MicButton: - AI speaking state:", aiSpeakingRef.current);
39914
- console.log("\u{1F3A4} MicButton: - Status set to: AI is speaking...");
39915
40624
  if (aiSpeechTimeoutRef.current) {
39916
- console.log("\u{1F3A4} MicButton: Clearing existing AI speech timeout");
39917
40625
  clearTimeout(aiSpeechTimeoutRef.current);
39918
40626
  }
39919
- console.log(
39920
- "\u{1F3A4} MicButton: AI speech started, active tracks:",
39921
- Array.from(activeAITracksRef.current)
39922
- );
39923
40627
  } else if (!isSpeaking && trackId) {
39924
- console.log("\u{1F3A4} MicButton: ===== AI SPEECH END =====");
39925
- console.log("\u{1F3A4} MicButton: Removing track from active set:", trackId);
39926
40628
  activeAITracksRef.current.delete(trackId);
39927
- console.log("\u{1F3A4} MicButton: After removing track:");
39928
- console.log("\u{1F3A4} MicButton: - Active tracks:", Array.from(activeAITracksRef.current));
39929
- console.log("\u{1F3A4} MicButton: - Active tracks size:", activeAITracksRef.current.size);
39930
40629
  if (activeAITracksRef.current.size === 0) {
39931
- console.log("\u{1F3A4} MicButton: ===== ALL AI TRACKS ENDED =====");
39932
- console.log("\u{1F3A4} MicButton: No more active tracks, resetting AI speaking state");
39933
40630
  aiSpeakingRef.current = false;
39934
- console.log("\u{1F3A4} MicButton: After reset:");
39935
- console.log("\u{1F3A4} MicButton: - AI speaking state:", aiSpeakingRef.current);
39936
- console.log("\u{1F3A4} MicButton: - Status set to: Listening");
39937
- console.log("\u{1F3A4} MicButton: All AI tracks ended, voice recognition re-enabled");
39938
40631
  } else {
39939
- console.log("\u{1F3A4} MicButton: Still have active tracks, keeping AI speaking state");
39940
- console.log("\u{1F3A4} MicButton: Remaining tracks:", Array.from(activeAITracksRef.current));
39941
40632
  }
39942
40633
  } else if (!isSpeaking && !trackId) {
39943
- console.log("\u{1F3A4} MicButton: ===== MANUAL RESET =====");
39944
- console.log("\u{1F3A4} MicButton: Manual reset triggered");
39945
40634
  activeAITracksRef.current.clear();
39946
40635
  aiSpeakingRef.current = false;
39947
- console.log("\u{1F3A4} MicButton: After manual reset:");
39948
- console.log("\u{1F3A4} MicButton: - Active tracks cleared");
39949
- console.log("\u{1F3A4} MicButton: - AI speaking state:", aiSpeakingRef.current);
39950
- console.log("\u{1F3A4} MicButton: - Status set to: Listening");
39951
- console.log("\u{1F3A4} MicButton: AI speech manually reset");
39952
- }
39953
- console.log("\u{1F3A4} MicButton: ===== AI SPEECH EVENT END =====");
39954
- console.log("\u{1F3A4} MicButton: Final state:");
39955
- console.log("\u{1F3A4} MicButton: - AI speaking:", aiSpeakingRef.current);
39956
- console.log("\u{1F3A4} MicButton: - Active tracks:", Array.from(activeAITracksRef.current));
39957
- console.log("\u{1F3A4} MicButton: - Status:", status);
39958
- console.log("\u{1F3A4} MicButton: ================================");
40636
+ }
39959
40637
  },
39960
40638
  [status, micState, isConnected2]
39961
40639
  );
39962
40640
  (0, import_react15.useEffect)(() => {
39963
40641
  if (audioContainerRef2.current) {
39964
- console.log("\u{1F3A4} MicButton: Setting up audio container on mount");
39965
40642
  setAudioContainer(audioContainerRef2);
39966
40643
  }
39967
40644
  return () => {
@@ -39989,49 +40666,33 @@ var MicButton = ({
39989
40666
  };
39990
40667
  (0, import_react15.useEffect)(() => {
39991
40668
  if (isConnected2) {
39992
- console.log("\u{1F3A4} MicButton: WebRTC and SSE connections established - ready for commands");
39993
40669
  } else {
39994
- console.log("\u{1F3A4} MicButton: WebRTC not yet connected - ignoring speech");
39995
40670
  }
39996
40671
  }, [isConnected2]);
39997
40672
  (0, import_react15.useEffect)(() => {
39998
- console.log("\u{1F3A4} MicButton: Auto-open check:", {
39999
- isConnected: isConnected2,
40000
- chatIsOpen: isChatOpen
40001
- });
40002
40673
  if (isConnected2 && !isChatOpen) {
40003
- console.log("\u{1F3A4} MicButton: Auto-opening chat popup");
40004
40674
  openChat();
40005
40675
  }
40006
40676
  }, [isConnected2, isChatOpen, openChat]);
40007
40677
  (0, import_react15.useEffect)(() => {
40008
40678
  if (messageManagerMessages.length > 0 && !isChatOpen) {
40009
- console.log("\u{1F3A4} MicButton: Auto-opening chat popup due to messages");
40010
40679
  openChat();
40011
40680
  }
40012
40681
  }, [messageManagerMessages.length, isChatOpen, openChat]);
40013
40682
  const handleMicClick = (0, import_react15.useCallback)(() => {
40014
40683
  const shouldStop = micState === "listening" && isConnected2;
40015
40684
  if (shouldStop) {
40016
- console.log("\u{1F3A4} MicButton: User wants to stop - closing everything");
40017
40685
  voiceDisconnect().then(() => {
40018
- console.log("\u{1F3A4} MicButton: Stopped and disconnected");
40019
40686
  }).catch((error) => {
40020
- console.error("\u{1F3A4} MicButton: Error during disconnect:", error);
40021
40687
  });
40022
40688
  } else {
40023
- console.log("\u{1F3A4} MicButton: User wants to start - connecting everything");
40024
40689
  voiceConnect(`user_${Date.now()}`, apiKey, appId).then(() => {
40025
- console.log("\u{1F3A4} MicButton: WebRTC and SSE connections started");
40026
40690
  if (showBorderGlow) setShowBodyGlow(true);
40027
40691
  openChat();
40028
- console.log("\u{1F3A4} MicButton: Started listening");
40029
40692
  setTimeout(() => {
40030
- console.log("\u{1F3A4} MicButton: Force opening chat popup after connection");
40031
40693
  openChat();
40032
40694
  }, 500);
40033
40695
  }).catch((error) => {
40034
- console.error("\u{1F3A4} MicButton: Failed to start connections:", error);
40035
40696
  });
40036
40697
  }
40037
40698
  }, [
@@ -40045,14 +40706,12 @@ var MicButton = ({
40045
40706
  showBorderGlow
40046
40707
  ]);
40047
40708
  const handleSendText = async (textToSend) => {
40048
- console.log("\u{1F3A4} MicButton: handleSendText called with:", textToSend);
40049
40709
  setMicState("thinking");
40050
40710
  if (showBorderGlow) setShowBodyGlow(true);
40051
40711
  if (!isChatOpen) {
40052
40712
  openChat();
40053
40713
  }
40054
40714
  if (isConnected2) {
40055
- console.log("\u{1F3A4} MicButton: Sending via WebRTC");
40056
40715
  try {
40057
40716
  await sendUserCommand2(textToSend);
40058
40717
  setMicState("replying");
@@ -40061,27 +40720,21 @@ var MicButton = ({
40061
40720
  if (showBorderGlow) setShowBodyGlow(true);
40062
40721
  }, 1e3);
40063
40722
  } catch (error) {
40064
- console.error("\u{1F3A4} MicButton: Failed to send text:", error);
40065
40723
  } finally {
40066
40724
  setMicState("listening");
40067
40725
  if (showBorderGlow) setShowBodyGlow(true);
40068
40726
  }
40069
40727
  } else {
40070
- console.log("\u{1F3A4} MicButton: WebRTC not connected, cannot send message");
40071
40728
  setMicState("listening");
40072
40729
  if (showBorderGlow) setShowBodyGlow(true);
40073
40730
  }
40074
- console.log("\u{1F3A4} MicButton: Text sent via WebRTC");
40075
40731
  };
40076
40732
  const handleEndCall = async () => {
40077
- console.log("\u{1F3A4} MicButton: Ending call completely...");
40078
40733
  try {
40079
40734
  await voiceDisconnect();
40080
40735
  await voiceDisconnect();
40081
40736
  closeChat();
40082
- console.log("\u{1F3A4} MicButton: Call ended successfully");
40083
40737
  } catch (error) {
40084
- console.error("\u{1F3A4} MicButton: Error ending call:", error);
40085
40738
  }
40086
40739
  };
40087
40740
  const getIcon = () => {
@@ -40284,4 +40937,14 @@ var MicButton = ({
40284
40937
 
40285
40938
  // src/index.ts
40286
40939
  init_element_service();
40940
+
40941
+ // src/utils/instrumentation.ts
40942
+ var import_md5 = __toESM(require_md5());
40943
+ function generateDynamicId(routePath, elementIdentifier) {
40944
+ const combinedString = `${routePath}:${elementIdentifier}`;
40945
+ const hash = (0, import_md5.default)(combinedString).toString();
40946
+ return hash.substring(0, 8);
40947
+ }
40948
+
40949
+ // src/index.ts
40287
40950
  init_element_service();