ai12z 3.7.1-alpha.5 → 3.7.1-alpha.6

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.
Files changed (134) hide show
  1. package/dist/cjs/{ai12z-bot-35b3fdce.js → ai12z-bot-5f633ca7.js} +92 -8
  2. package/dist/cjs/ai12z-bot-5f633ca7.js.map +1 -0
  3. package/dist/cjs/ai12z-bot.cjs.entry.js +2 -1
  4. package/dist/cjs/ai12z-bot.cjs.entry.js.map +1 -1
  5. package/dist/cjs/ai12z-category_2.cjs.entry.js +5 -5
  6. package/dist/cjs/ai12z-category_2.cjs.entry.js.map +1 -1
  7. package/dist/cjs/ai12z-chat_2.cjs.entry.js +35 -12
  8. package/dist/cjs/ai12z-chat_2.cjs.entry.js.map +1 -1
  9. package/dist/cjs/{ai12z-cta-908812f5.js → ai12z-cta-0dddd5e8.js} +22 -3
  10. package/dist/cjs/ai12z-cta-0dddd5e8.js.map +1 -0
  11. package/dist/cjs/ai12z-cta.cjs.entry.js +2 -1
  12. package/dist/cjs/ai12z-cta.cjs.entry.js.map +1 -1
  13. package/dist/cjs/ai12z-mic.cjs.entry.js +5 -5
  14. package/dist/cjs/ai12z-spinner.cjs.entry.js +1 -1
  15. package/dist/cjs/chat-avatar_7.cjs.entry.js +68 -4
  16. package/dist/cjs/chat-avatar_7.cjs.entry.js.map +1 -1
  17. package/dist/cjs/delete-confirmation-modal.cjs.entry.js +36 -0
  18. package/dist/cjs/delete-confirmation-modal.cjs.entry.js.map +1 -0
  19. package/dist/cjs/dynamic-form.cjs.entry.js +1 -1
  20. package/dist/cjs/image-uploader.cjs.entry.js +1 -1
  21. package/dist/cjs/index.cjs.js +3 -2
  22. package/dist/cjs/index.cjs.js.map +1 -1
  23. package/dist/cjs/keyboard-shortcuts-1dd43e6c.js +83 -0
  24. package/dist/cjs/keyboard-shortcuts-1dd43e6c.js.map +1 -0
  25. package/dist/cjs/keyboard-shortcuts-dialog.cjs.entry.js +62 -0
  26. package/dist/cjs/keyboard-shortcuts-dialog.cjs.entry.js.map +1 -0
  27. package/dist/cjs/library.cjs.js +1 -1
  28. package/dist/cjs/loader.cjs.js +1 -1
  29. package/dist/collection/collection-manifest.json +2 -0
  30. package/dist/collection/components/ai12z-bot/ai12z-bot.js +95 -9
  31. package/dist/collection/components/ai12z-bot/ai12z-bot.js.map +1 -1
  32. package/dist/collection/components/ai12z-bot/chat-history.css +34 -3
  33. package/dist/collection/components/ai12z-bot/chat-history.js +75 -3
  34. package/dist/collection/components/ai12z-bot/chat-history.js.map +1 -1
  35. package/dist/collection/components/ai12z-bot/delete-confirmation-modal.css +84 -0
  36. package/dist/collection/components/ai12z-bot/delete-confirmation-modal.js +124 -0
  37. package/dist/collection/components/ai12z-bot/delete-confirmation-modal.js.map +1 -0
  38. package/dist/collection/components/ai12z-bot/keyboard-shortcuts-dialog.css +245 -0
  39. package/dist/collection/components/ai12z-bot/keyboard-shortcuts-dialog.js +122 -0
  40. package/dist/collection/components/ai12z-bot/keyboard-shortcuts-dialog.js.map +1 -0
  41. package/dist/collection/components/ai12z-cta/ai12z-cta.css +35 -0
  42. package/dist/collection/components/ai12z-cta/ai12z-cta.js +24 -3
  43. package/dist/collection/components/ai12z-cta/ai12z-cta.js.map +1 -1
  44. package/dist/collection/components/ai12z-cta/components/Chat.js +28 -4
  45. package/dist/collection/components/ai12z-cta/components/Chat.js.map +1 -1
  46. package/dist/collection/components/ai12z-cta/components/DynamicForm.js +1 -1
  47. package/dist/collection/components/ai12z-cta/components/audiorecorder/audio-recorder.js +4 -4
  48. package/dist/collection/components/ai12z-cta/components/voicetotext/ai12z-mic.js +5 -5
  49. package/dist/collection/components/input/ImageUploader.js +1 -1
  50. package/dist/collection/components/input/Input.js +9 -9
  51. package/dist/collection/components/spinner/Spinner.js +1 -1
  52. package/dist/collection/utils/keyboard-shortcuts.js +152 -0
  53. package/dist/collection/utils/keyboard-shortcuts.js.map +1 -0
  54. package/dist/esm/{ai12z-bot-78c45c7a.js → ai12z-bot-eb674367.js} +92 -8
  55. package/dist/esm/ai12z-bot-eb674367.js.map +1 -0
  56. package/dist/esm/ai12z-bot.entry.js +2 -1
  57. package/dist/esm/ai12z-bot.entry.js.map +1 -1
  58. package/dist/esm/ai12z-category_2.entry.js +5 -5
  59. package/dist/esm/ai12z-category_2.entry.js.map +1 -1
  60. package/dist/esm/ai12z-chat_2.entry.js +35 -12
  61. package/dist/esm/ai12z-chat_2.entry.js.map +1 -1
  62. package/dist/esm/{ai12z-cta-2b78c32a.js → ai12z-cta-6ce2fbc4.js} +22 -3
  63. package/dist/esm/ai12z-cta-6ce2fbc4.js.map +1 -0
  64. package/dist/esm/ai12z-cta.entry.js +2 -1
  65. package/dist/esm/ai12z-cta.entry.js.map +1 -1
  66. package/dist/esm/ai12z-mic.entry.js +5 -5
  67. package/dist/esm/ai12z-spinner.entry.js +1 -1
  68. package/dist/esm/chat-avatar_7.entry.js +68 -4
  69. package/dist/esm/chat-avatar_7.entry.js.map +1 -1
  70. package/dist/esm/delete-confirmation-modal.entry.js +32 -0
  71. package/dist/esm/delete-confirmation-modal.entry.js.map +1 -0
  72. package/dist/esm/dynamic-form.entry.js +1 -1
  73. package/dist/esm/image-uploader.entry.js +1 -1
  74. package/dist/esm/index.js +3 -2
  75. package/dist/esm/index.js.map +1 -1
  76. package/dist/esm/keyboard-shortcuts-c0724cbc.js +81 -0
  77. package/dist/esm/keyboard-shortcuts-c0724cbc.js.map +1 -0
  78. package/dist/esm/keyboard-shortcuts-dialog.entry.js +58 -0
  79. package/dist/esm/keyboard-shortcuts-dialog.entry.js.map +1 -0
  80. package/dist/esm/library.js +1 -1
  81. package/dist/esm/loader.js +1 -1
  82. package/dist/library/index.esm.js +1 -1
  83. package/dist/library/library.esm.js +1 -1
  84. package/dist/library/library.esm.js.map +1 -1
  85. package/dist/library/{p-b1fa1528.entry.js → p-16d2ae9b.entry.js} +2 -2
  86. package/dist/library/p-16d2ae9b.entry.js.map +1 -0
  87. package/dist/library/p-3d6f1b26.js +2 -0
  88. package/dist/library/p-3d6f1b26.js.map +1 -0
  89. package/dist/library/{p-3f4d9a52.entry.js → p-40aff4a4.entry.js} +2 -2
  90. package/dist/library/{p-c33ec76f.entry.js → p-43c6ce34.entry.js} +2 -2
  91. package/dist/library/{p-4a2b1706.entry.js → p-6074dfb6.entry.js} +2 -2
  92. package/dist/library/p-6074dfb6.entry.js.map +1 -0
  93. package/dist/library/p-65408b32.js +2 -0
  94. package/dist/library/p-65408b32.js.map +1 -0
  95. package/dist/library/p-785c1c62.entry.js +2 -0
  96. package/dist/library/p-785c1c62.entry.js.map +1 -0
  97. package/dist/library/p-98e7c633.entry.js +2 -0
  98. package/dist/library/{p-0df2b93c.entry.js → p-a0e19694.entry.js} +2 -2
  99. package/dist/library/{p-a2081c8d.entry.js → p-b2611b39.entry.js} +2 -2
  100. package/dist/library/p-b29c91b2.entry.js +2 -0
  101. package/dist/library/p-b29c91b2.entry.js.map +1 -0
  102. package/dist/library/p-b3b7c89d.entry.js +2 -0
  103. package/dist/library/p-b3b7c89d.entry.js.map +1 -0
  104. package/dist/library/p-c39ca142.js +2 -0
  105. package/dist/library/p-c39ca142.js.map +1 -0
  106. package/dist/library/{p-82c5f3e1.entry.js → p-e9a679d2.entry.js} +2 -2
  107. package/dist/types/components/ai12z-bot/ai12z-bot.d.ts +5 -0
  108. package/dist/types/components/ai12z-bot/chat-history.d.ts +11 -1
  109. package/dist/types/components/ai12z-bot/delete-confirmation-modal.d.ts +11 -0
  110. package/dist/types/components/ai12z-bot/keyboard-shortcuts-dialog.d.ts +17 -0
  111. package/dist/types/components/ai12z-cta/ai12z-cta.d.ts +3 -0
  112. package/dist/types/components/ai12z-cta/components/Chat.d.ts +3 -0
  113. package/dist/types/components.d.ts +72 -0
  114. package/dist/types/utils/keyboard-shortcuts.d.ts +34 -0
  115. package/package.json +2 -2
  116. package/dist/cjs/ai12z-bot-35b3fdce.js.map +0 -1
  117. package/dist/cjs/ai12z-cta-908812f5.js.map +0 -1
  118. package/dist/esm/ai12z-bot-78c45c7a.js.map +0 -1
  119. package/dist/esm/ai12z-cta-2b78c32a.js.map +0 -1
  120. package/dist/library/p-4a2b1706.entry.js.map +0 -1
  121. package/dist/library/p-4fc80f40.js +0 -2
  122. package/dist/library/p-4fc80f40.js.map +0 -1
  123. package/dist/library/p-71f8d014.js +0 -2
  124. package/dist/library/p-71f8d014.js.map +0 -1
  125. package/dist/library/p-9e20a005.entry.js +0 -2
  126. package/dist/library/p-b1fa1528.entry.js.map +0 -1
  127. package/dist/library/p-ea2038f5.entry.js +0 -2
  128. package/dist/library/p-ea2038f5.entry.js.map +0 -1
  129. /package/dist/library/{p-3f4d9a52.entry.js.map → p-40aff4a4.entry.js.map} +0 -0
  130. /package/dist/library/{p-c33ec76f.entry.js.map → p-43c6ce34.entry.js.map} +0 -0
  131. /package/dist/library/{p-9e20a005.entry.js.map → p-98e7c633.entry.js.map} +0 -0
  132. /package/dist/library/{p-0df2b93c.entry.js.map → p-a0e19694.entry.js.map} +0 -0
  133. /package/dist/library/{p-a2081c8d.entry.js.map → p-b2611b39.entry.js.map} +0 -0
  134. /package/dist/library/{p-82c5f3e1.entry.js.map → p-e9a679d2.entry.js.map} +0 -0
@@ -9,6 +9,7 @@ const utils = require('./utils-266a1a10.js');
9
9
  const index$1 = require('./index-da6bd623.js');
10
10
  const globalStore = require('./global-store-bca518b1.js');
11
11
  const ai12zManager = require('./ai12z-manager-76d339ff.js');
12
+ const keyboardShortcuts = require('./keyboard-shortcuts-1dd43e6c.js');
12
13
 
13
14
  // ILiveAgentProvider.ts
14
15
  const envMode = index.Env.DATA_MODE ;
@@ -1320,6 +1321,10 @@ const Ai12zBot = class {
1320
1321
  bubbleText = bubbleText + data;
1321
1322
  // console.log("bubbleText", bubbleText)
1322
1323
  aiMessageBubble.setAttribute("data-bubbleText", bubbleText);
1324
+ aiMessageBubble.setAttribute("aria-label", bubbleText);
1325
+ aiMessageBubble.setAttribute("role", "log");
1326
+ aiMessageBubble.setAttribute("aria-live", "polite");
1327
+ aiMessageBubble.setAttribute("aria-atomic", "false");
1323
1328
  // Assuming data is a string containing the message content
1324
1329
  let html = converter.makeHtml(bubbleText);
1325
1330
  // Append new content to the existing chat bubble
@@ -1513,6 +1518,9 @@ const Ai12zBot = class {
1513
1518
  ;
1514
1519
  this.isRendered = false // Flag to track if the component has been rendered
1515
1520
  ;
1521
+ this.showShortcutsDialog = false // Keyboard shortcuts help dialog
1522
+ ;
1523
+ this.shortcuts = keyboardShortcuts.DEFAULT_SHORTCUTS;
1516
1524
  }
1517
1525
  get mainObject() {
1518
1526
  if (!window["ai12z"]) {
@@ -1522,6 +1530,45 @@ const Ai12zBot = class {
1522
1530
  }
1523
1531
  handleKeyDown(ev) {
1524
1532
  var _a;
1533
+ // console.log("key:", ev.key, "shift?", ev.shiftKey)
1534
+ // Handle keyboard shortcuts dialog - ? key is actually Shift + /
1535
+ if ((ev.key === "?" || (ev.key === "/" && ev.shiftKey)) && !this.isInputFocused()) {
1536
+ ev.preventDefault();
1537
+ this.showShortcutsDialog = !this.showShortcutsDialog;
1538
+ return;
1539
+ }
1540
+ // Close shortcuts dialog with Escape or ?
1541
+ if (this.showShortcutsDialog && (ev.key === "Escape" || ev.key === "?" || (ev.key === "/" && ev.shiftKey))) {
1542
+ ev.preventDefault();
1543
+ this.showShortcutsDialog = false;
1544
+ return;
1545
+ }
1546
+ // Handle Cmd/Ctrl+K for search
1547
+ if (ev.key === "k" && (ev.metaKey || ev.ctrlKey)) {
1548
+ ev.preventDefault();
1549
+ ev.stopPropagation();
1550
+ // TODO: Implement search functionality
1551
+ this.action("open");
1552
+ console.log("Open search");
1553
+ return;
1554
+ }
1555
+ // Handle Cmd/Ctrl+H for history
1556
+ if (ev.key === "h" && (ev.metaKey || ev.ctrlKey)) {
1557
+ ev.preventDefault();
1558
+ ev.stopPropagation();
1559
+ this.showHistory = !this.showHistory;
1560
+ this.showWelcomeScreen = false;
1561
+ this.loadConversation();
1562
+ return;
1563
+ }
1564
+ // Handle Cmd/Ctrl+N for new conversation
1565
+ if (ev.key === "n" && (ev.metaKey || ev.ctrlKey)) {
1566
+ ev.preventDefault();
1567
+ ev.stopPropagation();
1568
+ this.handleNewConversation();
1569
+ return;
1570
+ }
1571
+ // Handle Enter key for sending messages
1525
1572
  if (ev.key === "Enter" && !ev.shiftKey) {
1526
1573
  // console.log("down arrow pressed")
1527
1574
  ev.preventDefault();
@@ -1529,6 +1576,32 @@ const Ai12zBot = class {
1529
1576
  this.handleSend(this.inputEl.value);
1530
1577
  }
1531
1578
  }
1579
+ // Handle Escape to close modals
1580
+ if (ev.key === "Escape") {
1581
+ this.action("minimize");
1582
+ if (this.showPrivacy) {
1583
+ this.showPrivacy = false;
1584
+ ev.preventDefault();
1585
+ }
1586
+ }
1587
+ }
1588
+ isInputFocused() {
1589
+ var _a;
1590
+ const activeElement = ((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement) || document.activeElement;
1591
+ return (activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === "TEXTAREA" || (activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === "INPUT";
1592
+ }
1593
+ handleNewConversation() {
1594
+ // Clear messages and start a new conversation
1595
+ this.messages = [];
1596
+ this.conversationId = "";
1597
+ this.showWelcomeScreen = true;
1598
+ this.showHistory = false;
1599
+ this.isOpened = true;
1600
+ // Focus input if available
1601
+ setTimeout(() => {
1602
+ var _a;
1603
+ (_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.focus();
1604
+ }, 100);
1532
1605
  }
1533
1606
  buttonClickHandler(event) {
1534
1607
  this.showWelcomeScreen = false;
@@ -2409,6 +2482,10 @@ const Ai12zBot = class {
2409
2482
  behavior: "smooth",
2410
2483
  });
2411
2484
  }
2485
+ if (this.isOpened) {
2486
+ document.title = this.originalTitle;
2487
+ this.unreadCount = 0;
2488
+ }
2412
2489
  }
2413
2490
  toggleTextarea() {
2414
2491
  // console.log("toggleTextarea", this.showTextarea)
@@ -2608,7 +2685,7 @@ const Ai12zBot = class {
2608
2685
  }
2609
2686
  }
2610
2687
  render() {
2611
- var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
2688
+ var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
2612
2689
  if (!this.canRender) {
2613
2690
  return (index.h(index.Host, null, index.h("span", { style: { display: "none" } }, "Failed to load ai12z bot control due to insufficient fund")));
2614
2691
  }
@@ -2646,7 +2723,10 @@ const Ai12zBot = class {
2646
2723
  }
2647
2724
  }, onToggledChange: (event) => {
2648
2725
  this.isToggled = event.detail;
2649
- } })), ((_k = this.botSettings) === null || _k === void 0 ? void 0 : _k.botLogo) && index.h("img", { src: (_l = this.botSettings) === null || _l === void 0 ? void 0 : _l.botLogo, class: "w-8 h-8 rounded-lg", alt: "Bot Logo" }), index.h("h2", { class: "flex-1 pl-2 heading text-body1" }, (_m = this.botSettings) === null || _m === void 0 ? void 0 : _m.botName), index.h("div", { class: "buttons flex gap-2 p-[10px]" }, index.h("button", { class: "rounded-full flex items-center justify-center disabled:cursor-not-allowed bg-transparent hover:bg-blue-95 disabled:bg-transparent disabled:hover:bg-transparent h-6 w-6 hidden md:flex bot-btn-primary", tabindex: "0", onClick: () => {
2726
+ } })), ((_k = this.botSettings) === null || _k === void 0 ? void 0 : _k.botLogo) && index.h("img", { src: (_l = this.botSettings) === null || _l === void 0 ? void 0 : _l.botLogo, class: "w-8 h-8 rounded-lg", alt: "Bot Logo" }), index.h("h2", { class: "flex-1 pl-2 heading text-body1" }, (_m = this.botSettings) === null || _m === void 0 ? void 0 : _m.botName), index.h("div", { class: "buttons flex gap-2 p-[10px]" }, index.h("button", { class: "rounded-full flex items-center justify-center disabled:cursor-not-allowed bg-transparent hover:bg-blue-95 disabled:bg-transparent disabled:hover:bg-transparent h-6 w-6 bot-btn-primary", tabindex: "0", onClick: (e) => {
2727
+ e.preventDefault();
2728
+ this.showShortcutsDialog = true;
2729
+ }, "aria-label": "Keyboard Shortcuts", title: "Keyboard Shortcuts (Press ? for help)" }, index.h("i", { class: "wes-block wes-icon--loading wes-text-body2 modal-toolbar-icon", title: "Keyboard Shortcuts" }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M3 5C3 3.89543 3.89543 3 5 3H19C20.1046 3 21 3.89543 21 5V14C21 15.1046 20.1046 16 19 16H13L9 21V16H5C3.89543 16 3 15.1046 3 14V5Z", stroke: "currentColor", "stroke-width": "2" }), index.h("circle", { cx: "12", cy: "10", r: "1", fill: "currentColor" }), index.h("path", { d: "M9 10C9 8.34315 10.3431 7 12 7", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" })))), index.h("button", { class: "rounded-full flex items-center justify-center disabled:cursor-not-allowed bg-transparent hover:bg-blue-95 disabled:bg-transparent disabled:hover:bg-transparent h-6 w-6 hidden md:flex bot-btn-primary", tabindex: "0", onClick: () => {
2650
2730
  this.isExpanded = !this.isExpanded;
2651
2731
  this.isAnimated = true;
2652
2732
  }, "aria-label": "Collapse Bot to Side Panel" }, index.h("i", { class: "wes-block wes-icon--loading wes-text-body2 modal-toolbar-icon", title: "Collapse Bot to Side Panel" }, this.isExpanded && (index.h("svg", { viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M18.215 14.7076H27.692C28.3074 14.7076 28.492 14.0307 27.9997 13.5383L24.9843 10.4614L30.5228 4.86149C30.8305 4.5538 30.8305 3.99995 30.5228 3.69226L28.2459 1.41536C27.9382 1.16921 27.4459 1.16921 27.0767 1.4769L21.5381 7.01532L18.3997 3.99995C17.9073 3.50765 17.2304 3.69226 17.2304 4.30764V13.7845C17.2304 14.2153 17.7843 14.7076 18.215 14.7076ZM13.7847 17.2308H4.30766C3.69227 17.2308 3.50765 17.9077 3.99996 18.4L7.01537 21.4769L1.47686 27.0769C1.16917 27.3846 1.16917 27.9384 1.47686 28.2461L3.75381 30.523C4.0615 30.8307 4.55381 30.8307 4.92305 30.523L10.5231 24.923L13.6616 27.9384C14.0924 28.4923 14.7693 28.3076 14.7693 27.6923V18.2769C14.7693 17.8462 14.2154 17.2308 13.7847 17.2308Z" }))), !this.isExpanded && (index.h("svg", { viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M30.0308 1.23071H20.4923C19.8769 1.23071 19.6923 1.78455 20.1846 2.27686L23.2 5.29222L17.6615 10.8306C17.3538 11.1383 17.3538 11.6306 17.6615 11.9999L19.9384 14.2768C20.2461 14.5845 20.7384 14.5845 21.1077 14.2768L26.7077 8.67681L29.7231 11.6922C30.2154 12.1845 30.7692 11.9999 30.7692 11.3845V1.90763C30.7692 1.5384 30.4 1.23071 30.0308 1.23071ZM2.15379 30.7692H11.6307C12.2461 30.7692 12.4307 30.0923 11.9384 29.6L8.92303 26.5231L14.4615 20.9231C14.7692 20.6154 14.7692 20.0616 14.4615 19.7539L12.1846 17.477C11.8769 17.1693 11.3846 17.1693 11.0153 17.477L5.47687 23.0154L2.39995 20C1.8461 19.5077 1.23071 19.6923 1.23071 20.3077V29.7846C1.23071 30.2153 1.72302 30.7692 2.15379 30.7692Z" }))))), index.h("button", { class: "rounded-full flex items-center justify-center disabled:cursor-not-allowed bg-transparent hover:bg-blue-95 disabled:bg-transparent disabled:hover:bg-transparent h-6 w-6 bot-btn-primary", "data-testid": "modal-minimize", tabindex: "0", "aria-label": "Minimize", onClick: () => {
@@ -2666,7 +2746,7 @@ const Ai12zBot = class {
2666
2746
  // const email = ""
2667
2747
  return (index.h("div", { class: `flex pb-3 gap-x-2 @md:gap-x-3
2668
2748
  ${message.isUser ? "self-end" : ""}
2669
- ${message.isUser ? "justify-end" : ""} end-user-message message-item`, style: { opacity: "1", transform: "none" }, role: "listitem", tabindex: idx === this.focusedIndex ? 0 : -1, onKeyDown: (e) => this.handleMessageKeyNav(e, idx), ref: el => (this.messageRefs[idx] = el), "aria-label": `Message from ${message.isUser ? "User" : "Bot"}` }, message.isUser && (index.h("div", { class: "flex flex-col items-end" }, index.h("div", { "data-testid": "message", class: "break-words @md:text-body2 box-border @md:pr-4 flex-1 rounded-lg py-2 px-4 user-msg text-body3", innerHTML: message.text, id: message.id }, (_a = message === null || message === void 0 ? void 0 : message.images) === null || _a === void 0 ? void 0 : _a.map(img => {
2749
+ ${message.isUser ? "justify-end" : ""} end-user-message message-item`, style: { opacity: "1", transform: "none" }, role: "listitem", tabindex: idx === this.focusedIndex ? 0 : -1, onKeyDown: (e) => this.handleMessageKeyNav(e, idx), ref: el => (this.messageRefs[idx] = el), "aria-label": `Message from ${message.isUser ? "User" : "Bot"}` }, message.isUser && (index.h("div", { class: "flex flex-col items-end" }, index.h("div", { "data-testid": "message", class: "break-words @md:text-body2 box-border @md:pr-4 flex-1 rounded-lg py-2 px-4 user-msg text-body3", innerHTML: message.text, id: message.id, "aria-live": "polite", "aria-atomic": "false", "aria-label": message.text, role: "log" }, (_a = message === null || message === void 0 ? void 0 : message.images) === null || _a === void 0 ? void 0 : _a.map(img => {
2670
2750
  return index.h("img", { src: img, class: "thumbnail", alt: "thumbnail images" });
2671
2751
  })), index.h("div", { class: "text-gray-30 pt-2 text-right text-body4" }, "Sent ", message.timestamp))), !message.isUser && (index.h("div", { class: "avatar-column" }, index.h("chat-avatar", { id: `la${message.id}`, senderType: (message === null || message === void 0 ? void 0 : message.sender) ? "agent" : "bot", avatarUrl: (_b = this.botSettings) === null || _b === void 0 ? void 0 : _b.botAvatar }))), !message.isUser && (index.h("div", { class: "flex flex-col", style: { width: "100%" } }, index.h("div", { "data-testid": "message", class: {
2672
2752
  "prose": message.controlType === "form" ? false : true,
@@ -2701,9 +2781,11 @@ const Ai12zBot = class {
2701
2781
  }
2702
2782
  // Force a re-render by updating the state
2703
2783
  this.imagesBase64List = [...this.imagesBase64List];
2704
- } }, "\u00D7")))))), index.h("label", { htmlFor: "message-input", class: "sr-only" }, "Your message"), index.h("textarea", { id: "message-input", "aria-describedby": "message-hint", class: `resize-none overflow-hidden text-ellipsis focus:outline-none w-full custom-input ${this.hideAllButtons ? "hidden" : ""}`, "data-testid": "user-input-textarea", rows: this.rowCount, name: "userMessage", placeholder: this.isLiveAgent
2784
+ } }, "\u00D7")))))), index.h("label", { htmlFor: "message-input", class: "sr-only" }, "Your message"), index.h("textarea", { id: "message-input", "aria-describedby": "message-hint", "aria-placeholder": this.isLiveAgent
2785
+ ? "Type a message to the agent..."
2786
+ : (((_r = this.botSettings) === null || _r === void 0 ? void 0 : _r.botPlaceholderText) !== "" ? (_s = this.botSettings) === null || _s === void 0 ? void 0 : _s.botPlaceholderText : "Ask me anything"), "aria-label": "Type your message here", class: `resize-none overflow-hidden text-ellipsis focus:outline-none w-full custom-input ${this.hideAllButtons ? "hidden" : ""}`, "data-testid": "user-input-textarea", rows: this.rowCount, name: "userMessage", placeholder: this.isLiveAgent
2705
2787
  ? "Type a message to the agent..."
2706
- : ((_s = (_r = this.botSettings) === null || _r === void 0 ? void 0 : _r.botPlaceholderText) !== null && _s !== void 0 ? _s : "Ask me anything"),
2788
+ : (((_t = this.botSettings) === null || _t === void 0 ? void 0 : _t.botPlaceholderText) !== "" ? (_u = this.botSettings) === null || _u === void 0 ? void 0 : _u.botPlaceholderText : "Ask me anything"),
2707
2789
  // placeholder={this.botSettings?.botPlaceholderText ?? "Ask me anything"}
2708
2790
  // aria-labelledby="message-submit"
2709
2791
  ref: el => (this.inputEl = el), onKeyUp: _e => {
@@ -2760,8 +2842,10 @@ const Ai12zBot = class {
2760
2842
  }, onClick: () => {
2761
2843
  this.openChat();
2762
2844
  }
2763
- }, this.isBot && index.h("slot", { name: "bot" }), !this.isBot && (index.h("button", { class: "rounded-full flex cursor-pointer items-center pr-[14px] md:gap-x-3 focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-blue-focused bot-btn-primary", tabindex: "0", "aria-label": "open Bot" }, index.h("div", { class: "w-10 h-10 flex items-center justify-center bg-white rounded-full border relative" }, this.botSettings.botLaunchIcon && index.h("img", { src: this.botSettings.botLaunchIcon, alt: "bot icon", class: "w-8 h-8 rounded-lg" }), !this.botSettings.botLaunchIcon && (index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "#2095ae" }, index.h("g", { "stroke-width": "0" }), index.h("g", { "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("g", null, " ", index.h("path", { d: "M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z", stroke: "#2095ae", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), " ")))), index.h("span", { class: "bot-name" }, "Ask ", (_t = this.botSettings) === null || _t === void 0 ? void 0 :
2764
- _t.botName))))))));
2845
+ }, this.isBot && index.h("slot", { name: "bot" }), !this.isBot && (index.h("button", { class: "rounded-full flex cursor-pointer items-center pr-[14px] md:gap-x-3 focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-blue-focused bot-btn-primary", tabindex: "0", "aria-label": "open Bot" }, index.h("div", { class: "w-10 h-10 flex items-center justify-center bg-white rounded-full border relative" }, this.botSettings.botLaunchIcon && index.h("img", { src: this.botSettings.botLaunchIcon, alt: "bot icon", class: "w-8 h-8 rounded-lg" }), !this.botSettings.botLaunchIcon && (index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "#2095ae" }, index.h("g", { "stroke-width": "0" }), index.h("g", { "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("g", null, " ", index.h("path", { d: "M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z", stroke: "#2095ae", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), " ")))), index.h("span", { class: "bot-name" }, "Ask ", (_v = this.botSettings) === null || _v === void 0 ? void 0 :
2846
+ _v.botName)))))), index.h("keyboard-shortcuts-dialog", { show: this.showShortcutsDialog, shortcuts: this.shortcuts, onCloseDialog: () => {
2847
+ this.showShortcutsDialog = false;
2848
+ } })));
2765
2849
  }
2766
2850
  get el() { return index.getElement(this); }
2767
2851
  };
@@ -2769,4 +2853,4 @@ Ai12zBot.style = Ai12zBotStyle0 + (Ai12zBotStyle1 + (Ai12zBotStyle2 + Ai12zBotSt
2769
2853
 
2770
2854
  exports.Ai12zBot = Ai12zBot;
2771
2855
 
2772
- //# sourceMappingURL=ai12z-bot-35b3fdce.js.map
2856
+ //# sourceMappingURL=ai12z-bot-5f633ca7.js.map