@alan-ai/alan-sdk-web 1.8.59 → 1.8.61

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/alan_lib.js CHANGED
@@ -83965,9 +83965,43 @@
83965
83965
  }
83966
83966
  });
83967
83967
 
83968
+ // alan_btn/src/state.ts
83969
+ var uiState = {
83970
+ lib: {
83971
+ version: ""
83972
+ },
83973
+ project: {
83974
+ id: null
83975
+ },
83976
+ btn: {
83977
+ isTopAligned: false,
83978
+ zIndex: void 0
83979
+ },
83980
+ textChat: {
83981
+ available: false,
83982
+ expanded: false,
83983
+ inlined: false,
83984
+ options: null,
83985
+ loaderTimeoutMs: 3e4,
83986
+ defaults: {
83987
+ minChatWidth: 250,
83988
+ appearAnimationMs: 200,
83989
+ chatMargin: 25,
83990
+ textareaFontSize: 15,
83991
+ textareaLineHeight: 1.6,
83992
+ defaultSvgIconSize: 24
83993
+ }
83994
+ }
83995
+ };
83996
+
83968
83997
  // alan_btn/src/textChat/helpers/getMsgLoader.ts
83969
83998
  function getMsgLoader() {
83970
- return '<div class="alan-btn__chat-incomming-msg-wrapper"> <div class="alan-btn__chat-incomming-msg msg-1">&nbsp;</div> <div class="alan-btn__chat-incomming-msg msg-2">&nbsp;</div> <div class="alan-btn__chat-incomming-msg msg-3">&nbsp;</div> </div>';
83999
+ const textChatOptions = uiState.textChat.options;
84000
+ const waitingResponseBubbleLayout = textChatOptions?.bubbles?.waitingResponse?.layout || "default";
84001
+ const waitingResponseBubbleLabel = textChatOptions?.bubbles?.waitingResponse?.label || "Generating response...";
84002
+ const content = waitingResponseBubbleLayout === "default" ? '<div class="alan-btn__chat-incomming-msg msg-1">&nbsp;</div> <div class="alan-btn__chat-incomming-msg msg-2">&nbsp;</div> <div class="alan-btn__chat-incomming-msg msg-3">&nbsp;</div>' : `<span class="alan-btn__chat-incomming-msg-loader-icon"></span>
84003
+ <span class="alan-btn__chat-incomming-msg-loader-label">${waitingResponseBubbleLabel}</span>`;
84004
+ return `<div class="alan-btn__chat-incomming-msg-wrapper">${content}</div>`;
83971
84005
  }
83972
84006
 
83973
84007
  // alan_btn/src/textChat/helpers/buildMsgIncommingLoader.ts
@@ -83977,7 +84011,7 @@
83977
84011
  function buildMsgIncommingLoader(msg) {
83978
84012
  if (msg.initLoad)
83979
84013
  return "";
83980
- return !isFinalMessage(msg) ? `<div style="margin-top: 12px;margin-bottom: 12px;">${getMsgLoader()}</div>` : "";
84014
+ return !isFinalMessage(msg) ? `<div style="margin-top: 12px;margin-bottom: 4px;">${getMsgLoader()}</div>` : "";
83981
84015
  }
83982
84016
 
83983
84017
  // alan_btn/src/textChat/helpers/getMsgReadProp.ts
@@ -83989,12 +84023,13 @@
83989
84023
 
83990
84024
  // alan_btn/src/textChat/helpers/mergeProgressiveMessages.ts
83991
84025
  function mergeProgressiveMessages(messages, i, message) {
84026
+ const maxLinksCount = 9;
83992
84027
  const newImages = message.images || [];
83993
84028
  const oldText = messages[i].text || "";
83994
84029
  const newText = message.text || "";
83995
84030
  messages[i].text = oldText + newText;
83996
84031
  messages[i].images = [...messages[i].images || [], ...newImages];
83997
- messages[i].links = [...messages[i].links || [], ...message.links || []];
84032
+ messages[i].links = [...messages[i].links || [], ...message.links || []].splice(0, maxLinksCount);
83998
84033
  if (message.ctx?.format === "markdown") {
83999
84034
  if (messages[i].ctx) {
84000
84035
  messages[i].ctx.format = "markdown";
@@ -84180,15 +84215,14 @@
84180
84215
  `
84181
84216
  },
84182
84217
  send: `
84183
- <svg width="36" height="24" viewBox="0 0 36 24" fill="none" xmlns="http://www.w3.org/2000/svg">
84184
- <path d="M14.1225 13.1096L24.6225 2.60955M14.2501 13.4376L16.8782 20.1956C17.1097 20.791 17.2255 21.0886 17.3923 21.1755C17.5369 21.2509 17.7092 21.251 17.8538 21.1758C18.0207 21.0891 18.1369 20.7916 18.3691 20.1965L24.9594 3.30875C25.1691 2.77157 25.2739 2.50298 25.2165 2.33135C25.1667 2.1823 25.0498 2.06533 24.9007 2.01554C24.7291 1.95821 24.4605 2.06302 23.9233 2.27265L7.03562 8.86299C6.44052 9.09522 6.14303 9.21133 6.05633 9.37823C5.98113 9.52292 5.98122 9.6952 6.05662 9.8398C6.14352 10.0066 6.44123 10.1223 7.03653 10.3539L13.7945 12.982C13.9153 13.029 13.9757 13.0525 14.0266 13.0888C14.0717 13.1209 14.1111 13.1604 14.1433 13.2055C14.1796 13.2563 14.2031 13.3168 14.2501 13.4376Z" stroke="#4A515D" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
84218
+ <svg width="44" height="28" viewBox="0 0 44 28" fill="none" xmlns="http://www.w3.org/2000/svg">
84219
+ <path d="M17.2915 17.7085L29.3026 5.69727M17.4375 18.0837L20.4438 25.8143C20.7086 26.4954 20.8411 26.8358 21.0319 26.9352C21.1973 27.0215 21.3944 27.0216 21.5598 26.9356C21.7507 26.8364 21.8836 26.4961 22.1493 25.8153L29.688 6.4971C29.9279 5.88261 30.0478 5.57536 29.9821 5.37903C29.9252 5.20853 29.7914 5.07473 29.6209 5.01777C29.4246 4.95219 29.1173 5.07209 28.5028 5.31188L9.18467 12.8507C8.50392 13.1164 8.16361 13.2492 8.06444 13.4401C7.97841 13.6056 7.97852 13.8027 8.06477 13.9681C8.16418 14.1589 8.50473 14.2913 9.18571 14.5562L16.9163 17.5625C17.0545 17.6163 17.1236 17.6432 17.1818 17.6847C17.2334 17.7214 17.2784 17.7666 17.3153 17.8182C17.3568 17.8763 17.3837 17.9455 17.4375 18.0837Z" stroke="#4A515D" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
84185
84220
  </svg>
84186
84221
  `,
84187
84222
  mic: `
84188
- <svg width="44" height="40" viewBox="0 0 44 40" fill="none" xmlns="http://www.w3.org/2000/svg">
84189
- <path d="M29 18V20C29 23.866 25.866 27 22 27M22 27C18.134 27 15 23.866 15 20V18M22 27V30M18 30H26M22 23C20.3431 23 19 21.6569 19 20V13C19 11.3432 20.3431 10 22 10C23.6569 10 25 11.3432 25 13V20C25 21.6569 23.6569 23 22 23Z" stroke="#4A515D" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
84223
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
84224
+ <path d="M21.4 12.8V15C21.4 19.2526 17.9526 22.7 13.7 22.7M13.7 22.7C9.4474 22.7 6 19.2526 6 15V12.8M13.7 22.7V26M9.3 26H18.1M13.7 18.3C11.8774 18.3 10.4 16.8226 10.4 15V7.3C10.4 5.47752 11.8774 4 13.7 4C15.5226 4 17 5.47752 17 7.3V15C17 16.8226 15.5226 18.3 13.7 18.3Z" stroke="#4A515D" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
84190
84225
  </svg>
84191
-
84192
84226
  `,
84193
84227
  micPlayingBars: `<div class="alan-text-chat__animated-btn-bars">
84194
84228
  <div class="alan-text-chat__bar alan-text-chat__bar-1"></div>
@@ -84203,9 +84237,10 @@
84203
84237
  <path d="M15 9.4V5C15 3.34315 13.6569 2 12 2C10.8224 2 9.80325 2.67852 9.3122 3.66593M12 19V22M12 19C8.13401 19 5 15.866 5 12V10M12 19C15.866 19 19 15.866 19 12V10M8 22H16M2 2L22 22M12 15C10.3431 15 9 13.6569 9 12V9L14.1226 14.12C13.5796 14.6637 12.8291 15 12 15Z" stroke="#969EB0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
84204
84238
  </svg>
84205
84239
  `,
84206
- disconnected: `<svg class="alan-btn_disconnected-chat-icon-rotate" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
84207
- <path d="M22 10C22 10 19.995 7.26822 18.3662 5.63824C16.7373 4.00827 14.4864 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.1031 21 19.5649 18.2543 20.6482 14.5M22 10V4M22 10H16" stroke="#969EB0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
84208
- </svg>`,
84240
+ disconnected: `<svg class="alan-btn_disconnected-chat-icon-rotate" width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
84241
+ <path d="M26 14C26 14 23.995 11.2682 22.3662 9.63824C20.7373 8.00827 18.4864 7 16 7C11.0294 7 7 11.0294 7 16C7 20.9706 11.0294 25 16 25C20.1031 25 23.5649 22.2543 24.6482 18.5M26 14V8M26 14H20" stroke="#969EB0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
84242
+ </svg>
84243
+ `,
84209
84244
  noWiFi: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
84210
84245
  <path d="M15.3119 10C16.6802 10.4263 17.9624 11.1191 19.08 12.05M22.5799 8.49997C19.6575 5.92394 15.8956 4.50262 11.9999 4.50262C11.3949 4.50262 10.7931 4.5369 10.1972 4.60447M8.52979 15.61C9.54499 14.8888 10.7595 14.5013 12.0048 14.5013C13.2501 14.5013 14.4646 14.8888 15.4798 15.61M12 19.5H12.01M1.19336 8.70076C2.52697 7.47869 4.06839 6.47975 5.75851 5.76306M4.73193 12.243C6.12934 11.012 7.84172 10.1302 9.73265 9.73393M15.6983 15.7751C14.6792 14.9763 13.3952 14.5 11.9999 14.5C10.5835 14.5 9.28172 14.9908 8.25537 15.8116M3 3L21 21" stroke="#969EB0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
84211
84246
  </svg>
@@ -84260,32 +84295,6 @@
84260
84295
  return textChatOptions?.popup?.icons?.mute?.svgOn || chatIcons.unmute;
84261
84296
  }
84262
84297
 
84263
- // alan_btn/src/state.ts
84264
- var uiState = {
84265
- lib: {
84266
- version: ""
84267
- },
84268
- project: {
84269
- id: null
84270
- },
84271
- btn: {
84272
- isTopAligned: false,
84273
- zIndex: void 0
84274
- },
84275
- textChat: {
84276
- available: false,
84277
- expanded: false,
84278
- inlined: false,
84279
- options: null,
84280
- loaderTimeoutMs: 3e4,
84281
- defaults: {
84282
- minChatWidth: 250,
84283
- appearAnimationMs: 200,
84284
- chatMargin: 25
84285
- }
84286
- }
84287
- };
84288
-
84289
84298
  // alan_btn/src/textChat/fullscreen.ts
84290
84299
  function openChatInFullScreen(chatHolderDiv) {
84291
84300
  chatHolderDiv.classList.add("alan-btn_text-chat-full-screen");
@@ -84313,7 +84322,7 @@
84313
84322
  sideChatHeader.appendChild(chatCollapseSideBarBtn);
84314
84323
  chatCloseSideBarBtn.addEventListener("click", options.closeTextChat);
84315
84324
  chatCollapseSideBarBtn.addEventListener("click", options.expandCollapseChatSidePanel);
84316
- newChatSideBarBtn.addEventListener("click", options.onClearChatClick);
84325
+ newChatSideBarBtn.addEventListener("click", options.clearTextChat);
84317
84326
  }
84318
84327
  }
84319
84328
 
@@ -84695,14 +84704,12 @@
84695
84704
  }
84696
84705
  return null;
84697
84706
  }
84698
- function fixTextChatSizeIfNeeded(width, height, doubleMargin) {
84699
- var defaultChatMargin = uiState.textChat.defaults.chatMargin;
84700
- const margin = doubleMargin ? 2 * defaultChatMargin : defaultChatMargin;
84701
- if (height !== null && window.innerHeight - defaultChatMargin < height) {
84702
- setChatHeight(window.innerHeight - margin);
84707
+ function fixTextChatSizeIfNeeded(width, height) {
84708
+ if (height !== null && window.innerHeight < height) {
84709
+ setChatHeight(window.innerHeight);
84703
84710
  }
84704
- if (width !== null && window.innerWidth - defaultChatMargin < width) {
84705
- setChatWidth(window.innerWidth - margin);
84711
+ if (width !== null && window.innerWidth < width) {
84712
+ setChatWidth(window.innerWidth);
84706
84713
  }
84707
84714
  }
84708
84715
 
@@ -84851,14 +84858,34 @@
84851
84858
  function getPaddingProp(top, right, bottom, left) {
84852
84859
  return `${top}px ${right}px ${bottom}px ${left}px;`;
84853
84860
  }
84854
-
84855
- // alan_btn/src/styles/chat.ts
84861
+ function getInnerBorderRadiusProp(br) {
84862
+ if (+br > 0) {
84863
+ return +br - 1;
84864
+ }
84865
+ return 0;
84866
+ }
84856
84867
  function getNumPropVal(val, defaultVal) {
84857
84868
  if (+val >= 0) {
84858
84869
  return val;
84859
84870
  }
84860
84871
  return defaultVal;
84861
84872
  }
84873
+ function svgToBase64(svg) {
84874
+ return btoa(unescape(encodeURIComponent(svg)));
84875
+ }
84876
+ function parseSvgSize(svgString) {
84877
+ if (!svgString)
84878
+ return [];
84879
+ const parser = new DOMParser();
84880
+ const svgDoc = parser.parseFromString(svgString, "image/svg+xml");
84881
+ const svgElement = svgDoc.querySelector("svg");
84882
+ const width = svgElement.getAttribute("width");
84883
+ const height = svgElement.getAttribute("height");
84884
+ const defaultSize = uiState.textChat.defaults.defaultSvgIconSize;
84885
+ return [width || defaultSize, height || defaultSize];
84886
+ }
84887
+
84888
+ // alan_btn/src/styles/chat.ts
84862
84889
  var flexMap = {
84863
84890
  left: "flex-start",
84864
84891
  right: "flex-end",
@@ -84870,11 +84897,11 @@
84870
84897
  const defaultMinChatHeight = 400;
84871
84898
  const defaultChatHeight = 700;
84872
84899
  const chatHeaderHeight = +textChatOptions?.header?.height || 40;
84873
- const chatTextareaLineHieght = 1.25;
84900
+ const chatTextareaLineHieght = uiState.textChat.defaults.textareaLineHeight;
84874
84901
  const textareaHolderHeight = +textChatOptions?.footer?.height || 67;
84875
84902
  const chatMicBtnActiveSize = 32;
84876
84903
  const textChatScrollSize = 6;
84877
- const defaultChatTextareaFontSize = 15;
84904
+ const defaultChatTextareaFontSize = uiState.textChat.defaults.textareaFontSize;
84878
84905
  const withSendBtnOutside = textChatOptions?.footer?.layout?.name === "send-btn-outside";
84879
84906
  const footerTopPadding = getNumPropVal(textChatOptions?.footer?.padding?.top, 2);
84880
84907
  const footerRightPadding = getNumPropVal(textChatOptions?.footer?.padding?.right, 18);
@@ -84900,6 +84927,7 @@
84900
84927
  const responseBubbleRightPadding = getNumPropVal(textChatOptions?.bubbles?.response?.padding?.right, 20);
84901
84928
  const responseBubbleBottomPadding = getNumPropVal(textChatOptions?.bubbles?.response?.padding?.bottom, 9);
84902
84929
  const responseBubbleLeftPadding = getNumPropVal(textChatOptions?.bubbles?.response?.padding?.left, 20);
84930
+ const waitingResponseBubbleLayout = textChatOptions?.bubbles?.waitingResponse?.layout || "default";
84903
84931
  const responseBubbleBorderRadiusTopLeft = getNumPropVal(textChatOptions?.bubbles?.response?.borderRadius?.topLeft, defaultBubbleBorderRadius);
84904
84932
  const responseBubbleBorderRadiusTopRight = getNumPropVal(textChatOptions?.bubbles?.response?.borderRadius?.topRight, defaultBubbleBorderRadius);
84905
84933
  const responseBubbleBorderRadiusBottomRight = getNumPropVal(textChatOptions?.bubbles?.response?.borderRadius?.bottomRight, defaultBubbleBorderRadius);
@@ -84929,7 +84957,7 @@
84929
84957
  const headerLayoutName = textChatOptions?.header?.layout?.name || "centered-title";
84930
84958
  let cssChatHeight = getTextChatSizeAfterResize("height");
84931
84959
  let cssChatWidth = getTextChatSizeAfterResize("width");
84932
- fixTextChatSizeIfNeeded(cssChatWidth, cssChatHeight, true);
84960
+ fixTextChatSizeIfNeeded(cssChatWidth, cssChatHeight);
84933
84961
  cssChatHeight = getTextChatSizeAfterResize("height");
84934
84962
  cssChatWidth = getTextChatSizeAfterResize("width");
84935
84963
  if (cssChatHeight) {
@@ -84951,6 +84979,7 @@
84951
84979
  const chatBgColor1 = textChatOptions?.popup?.backgroundColor || `#DAEBFF`;
84952
84980
  const chatBgColor2 = textChatOptions?.popup?.backgroundColor2 || `#ffffff`;
84953
84981
  const chatGradientType = textChatOptions?.popup?.gradientType || `linear`;
84982
+ const chatCustomBg = textChatOptions?.popup?.background?.customCss;
84954
84983
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-holder {
84955
84984
  position: fixed;
84956
84985
  height: ${cssChatHeight};
@@ -85149,6 +85178,9 @@
85149
85178
  if (chatGradientType === "radial") {
85150
85179
  chatBackgroud = `radial-gradient(circle, ${chatBgColor2} 0%, ${chatBgColor1} 100%)`;
85151
85180
  }
85181
+ if (chatGradientType === "custom" && chatCustomBg) {
85182
+ chatBackgroud = chatCustomBg;
85183
+ }
85152
85184
  keyFrames += getStyleSheetMarker() + `.alan-btn__popup-chat {
85153
85185
  height: 100%;
85154
85186
  position: relative;
@@ -85176,11 +85208,11 @@
85176
85208
  }`;
85177
85209
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-textarea-holder {
85178
85210
  width: 100%;
85179
- height: ${textareaHolderHeight}px;
85180
- max-height: ${textareaHolderHeight}px;
85181
85211
  min-height: ${textareaHolderHeight}px;
85182
- background-color: ${textChatOptions?.footer?.backgroundColor || "transparent"};
85212
+ background-color: ${textChatOptions?.footer?.backgroundColor || "#DAEBFF"};
85183
85213
  position: relative;
85214
+ display: flex;
85215
+ flex-shrink: 0;
85184
85216
  padding: ${getPaddingProp(footerTopPadding, footerRightPadding, footerBottomPadding, footerLeftPadding)};
85185
85217
  }`;
85186
85218
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-textarea-holder-outer-content {
@@ -85194,20 +85226,20 @@
85194
85226
  width: 100%;
85195
85227
  height: 100%;
85196
85228
  position: relative;
85229
+ display: flex;
85230
+ align-items: center;
85197
85231
  }`;
85198
85232
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-messages-empty-block {
85199
85233
  flex: 1 1 auto;
85200
85234
  }`;
85201
85235
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-messages-wrapper {
85202
85236
  width: 100%;
85203
- height: calc(100% - ${chatHeaderHeight + textareaHolderHeight}px);
85204
- max-height: calc(100% - ${chatHeaderHeight + textareaHolderHeight}px);
85205
- min-height: calc(100% - ${chatHeaderHeight + textareaHolderHeight}px);
85237
+ height: 100%;
85206
85238
  overflow-y: scroll;
85207
85239
  overflow-x: hidden;
85208
85240
  padding: ${getPaddingProp(msgsTopPadding, msgsRightPadding, msgsBottomPadding, msgsLeftPadding)};
85209
85241
  display: flex;
85210
- flex-shrink: 0;
85242
+ flex-shrink: 1;
85211
85243
  flex-direction: column-reverse;
85212
85244
  }`;
85213
85245
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-messages {
@@ -85241,16 +85273,24 @@
85241
85273
  position:relative;
85242
85274
  }`;
85243
85275
  const headerFontSize = textChatOptions?.header?.fontSize || 16;
85276
+ const headerIconGap = getNumPropVal(textChatOptions?.header?.icon?.gap, 12);
85277
+ const headerAlignment = textChatOptions?.header?.alignment || "center";
85244
85278
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-header-title {
85245
85279
  max-width: calc(100% - 112px);
85246
85280
  overflow: hidden;
85247
85281
  text-overflow: ellipsis;
85248
85282
  white-space: nowrap;
85249
- display: inline-block;
85283
+ display: flex;
85284
+ align-items: ${headerAlignment};
85250
85285
  font-weight: 600;
85251
85286
  font-size: ${headerFontSize}px;
85252
- position: relative;
85253
- top: ${headerFontSize >= 20 ? "-2" : "0"}px;
85287
+ gap: ${headerIconGap}px;
85288
+ }`;
85289
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat-header-title-icon {
85290
+ display: flex;
85291
+ }`;
85292
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat-header-title-label {
85293
+ display: flex;
85254
85294
  }`;
85255
85295
  const withGradientForHeader = uiState.textChat.options?.header?.withBottomGradient !== false;
85256
85296
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-header-gradient {
@@ -85303,8 +85343,10 @@
85303
85343
  height: 100%;
85304
85344
  cursor: pointer;
85305
85345
  position: relative;
85306
- top:50%;
85307
- transform: translateY(-50%);
85346
+ }`;
85347
+ keyFrames += getStyleSheetMarker() + `.multi-line .alan-btn__chat-clear-btn {
85348
+ align-items: flex-end;
85349
+ padding-bottom: ${textareaBottomPadding}px;
85308
85350
  }`;
85309
85351
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-clear-btn.disabled {
85310
85352
  pointer-events: none;
@@ -85507,7 +85549,7 @@
85507
85549
  min-height:15px;
85508
85550
  width: 100%;
85509
85551
  position: absolute;
85510
- bottom: ${textareaHolderHeight}px;
85552
+ top: -15px;
85511
85553
  display: ${withGradientForFooter ? "block" : "none"};
85512
85554
  left:0;
85513
85555
  }`;
@@ -85526,8 +85568,6 @@
85526
85568
  font-size: ${getTextAreaFontSize(isMobile(), textChatOptions?.textarea?.fontSize || defaultChatTextareaFontSize)}px;
85527
85569
  line-height: ${chatTextareaLineHieght};
85528
85570
  text-align: left;
85529
- max-height: 100%;
85530
- height: 100%;
85531
85571
  padding: ${getPaddingProp(textareaTopPadding, textareaRightPadding, textareaBottomPadding, textareaLeftPadding)};
85532
85572
  margin: 0px!important;
85533
85573
  -webkit-user-select: text;
@@ -85557,8 +85597,9 @@
85557
85597
  border-radius: 3px;
85558
85598
  background: transparent;
85559
85599
  }`;
85600
+ const micHolderWidth = 44;
85560
85601
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-holder.alan-text-chat__voice-enabled .alan-btn__chat-textarea {
85561
- padding-left: 44px;
85602
+ padding-left: ${micHolderWidth}px;
85562
85603
  }`;
85563
85604
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat.alan-btn__mic-active .alan-btn__chat-textarea {
85564
85605
  opacity: 0.6;
@@ -85632,11 +85673,11 @@
85632
85673
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-send-btn {
85633
85674
  ${!withSendBtnOutside && `
85634
85675
  position: absolute;
85635
- top: 50%;
85676
+ top: 0;
85636
85677
  right: 0px;
85637
- transform: translateY(-50%);
85678
+ width: 44px;
85638
85679
  `}
85639
-
85680
+ height: 100%;
85640
85681
  transition: opacity 300ms ease-in-out;
85641
85682
  display: flex;
85642
85683
  flex-direction: row;
@@ -85650,6 +85691,10 @@
85650
85691
  -ms-user-select: none; /* IE/Edge */
85651
85692
  user-select: none;
85652
85693
  }`;
85694
+ keyFrames += getStyleSheetMarker() + `.multi-line .alan-btn__chat-send-btn {
85695
+ align-items: flex-end;
85696
+ padding-bottom: ${textareaBottomPadding}px;
85697
+ }`;
85653
85698
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-send-btn svg path {
85654
85699
  stroke: ${textChatOptions?.textarea?.placeholderColor || `#747474`};
85655
85700
  opacity: 0.5;
@@ -85669,10 +85714,11 @@
85669
85714
  }
85670
85715
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-mic-btn {
85671
85716
  position: absolute;
85672
- left: 3px;
85673
- top:50%;
85674
- transform: translateY(-50%);
85675
- transform-origin: top;
85717
+ left: 0px;
85718
+ top:0;
85719
+ height: 100%;
85720
+ width: ${micHolderWidth}px;
85721
+ transform-origin: center;
85676
85722
  display: flex;
85677
85723
  flex-direction: row;
85678
85724
  cursor: pointer;
@@ -85680,6 +85726,10 @@
85680
85726
  align-items: center;
85681
85727
  border-radius: 50%;
85682
85728
  }`;
85729
+ keyFrames += getStyleSheetMarker() + `.multi-line .alan-btn__chat-mic-btn {
85730
+ align-items: flex-end;
85731
+ padding-bottom: ${textareaBottomPadding}px;
85732
+ }`;
85683
85733
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-notifications-bubble {
85684
85734
  position: absolute;
85685
85735
  right: 4px;
@@ -85846,8 +85896,13 @@
85846
85896
  }`;
85847
85897
  const responseBubbleFontSize = +(textChatOptions?.bubbles?.response?.fontSize || 15);
85848
85898
  const responseBubbleFontColor = textChatOptions?.bubbles?.response?.color || `#171717`;
85899
+ const responseBubbleLabelIconGap = getNumPropVal(textChatOptions?.bubbles?.response?.label?.icon?.gap, 12);
85900
+ const responseBubbleLabelAlignment = textChatOptions?.bubbles?.response?.label?.alignment || "center";
85901
+ const responseLabelIcon = textChatOptions?.bubbles?.response?.label?.icon?.svg;
85849
85902
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-response-label {
85850
- display: ${responseBubbleLabelEnabled ? "block" : "none"};
85903
+ display: ${responseBubbleLabelEnabled ? "flex" : "none"};
85904
+ align-items:${responseBubbleLabelAlignment};
85905
+ gap: ${responseBubbleLabelIconGap}px;
85851
85906
  position: relative;
85852
85907
  color: ${responseBubbleLabelColor};
85853
85908
  font-size: ${responseBubbleLabelFontSize}px;
@@ -85861,6 +85916,19 @@
85861
85916
  -ms-user-select: text; /* IE/Edge */
85862
85917
  user-select: text;
85863
85918
  }`;
85919
+ const [responseLabelWidth, responseLabelHeight] = parseSvgSize(responseLabelIcon);
85920
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat-response-label-icon {
85921
+ display: ${responseLabelIcon ? "flex" : "none"};
85922
+ background-image: url('data:image/svg+xml;base64,${svgToBase64(responseLabelIcon)}');
85923
+ background-size: cover;
85924
+ ${responseLabelIcon ? `
85925
+ width: ${responseLabelWidth}px;
85926
+ height: ${responseLabelHeight}px;
85927
+ ` : ""}
85928
+ }`;
85929
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat-response-label-text {
85930
+ display: flex;
85931
+ }`;
85864
85932
  keyFrames += getStyleSheetMarker() + `.alan-btn_text-chat-full-screen .alan-btn__chat-response-label {
85865
85933
  text-align: left;
85866
85934
  padding-left: ${avatarSize + avatarRightMargin}px;
@@ -85889,6 +85957,11 @@
85889
85957
  -ms-user-select: text; /* IE/Edge */
85890
85958
  user-select: text;
85891
85959
  }`;
85960
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat-response.alan-incoming-msg {
85961
+ ${waitingResponseBubbleLayout === "loader-and-label-wo-bubble" ? `padding: ${getPaddingProp(responseBubbleTopPadding, 0, responseBubbleBottomPadding, 0)};
85962
+ background: none;
85963
+ border-color:transparent;` : ``}
85964
+ }`;
85892
85965
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-buttons {
85893
85966
  margin-bottom: 16px;
85894
85967
  display:flex;
@@ -86155,31 +86228,7 @@
86155
86228
  padding: 0px;
86156
86229
  margin-bottom:0;
86157
86230
  }`);
86158
- keyFrames += getStyleSheetMarker() + `.alan-btn__chat-incomming-msg-wrapper {
86159
- display: flex;
86160
- align-items: center;
86161
- }`;
86162
- keyFrames += getStyleSheetMarker() + `.alan-btn__chat-incomming-msg {
86163
- border-radius: 50%;
86164
- background-color: ${textChatOptions?.bubbles?.response?.color || `#080808`};
86165
- margin: 2px;
86166
- height: 6px;
86167
- width: 6px;
86168
- animation: alan-dot-bounce 1.5s infinite ease;
86169
- }`;
86170
- keyFrames += getStyleSheetMarker() + `.msg-2 {
86171
- animation-delay: .2s;
86172
- }`;
86173
- keyFrames += getStyleSheetMarker() + `.msg-3 {
86174
- animation-delay: .3s;
86175
- }`;
86176
- keyFrames += getStyleSheetMarker() + generateKeyFrame("alan-dot-bounce", `
86177
- 0%, 100% { opacity:1;}
86178
-
86179
- 60% {
86180
- transform: translateY(3px);
86181
- opacity:.0;
86182
- }`);
86231
+ keyFrames += getCssForResponseLoader(getStyleSheetMarker(), uiState.textChat.options);
86183
86232
  keyFrames += getStyleSheetMarker() + `.alan-btn_text-chat-full-screen .alan-btn__chat-popup {
86184
86233
  width: 100%;
86185
86234
  margin-left: 51px;
@@ -86431,9 +86480,71 @@
86431
86480
  }`;
86432
86481
  return keyFrames;
86433
86482
  }
86483
+ function getCssForResponseLoader(styleSheetMarker, textChatOptions) {
86484
+ let keyFrames = "";
86485
+ const waitingResponseBubbleLayout = textChatOptions?.bubbles?.waitingResponse?.layout || "default";
86486
+ const waitingResponseBubbleLabelIconAlignment = textChatOptions?.bubbles?.waitingResponse?.alignment || "center";
86487
+ const waitingResponseBubbleLoaderIcon = textChatOptions?.bubbles?.waitingResponse?.icon?.svg;
86488
+ const waitingResponseBubbleLoaderIconGap = getNumPropVal(textChatOptions?.bubbles?.waitingResponse?.icon?.gap, 8);
86489
+ const [responseLabelWidth, responseLabelHeight] = parseSvgSize(waitingResponseBubbleLoaderIcon);
86490
+ keyFrames += styleSheetMarker + `.alan-btn__chat-incomming-msg-wrapper {
86491
+ display: flex;
86492
+ ${waitingResponseBubbleLayout !== "default" ? `
86493
+ align-items: ${waitingResponseBubbleLabelIconAlignment};
86494
+ gap: ${waitingResponseBubbleLoaderIconGap}px;
86495
+ ` : ``}
86496
+ }`;
86497
+ keyFrames += styleSheetMarker + `.alan-btn__chat-incomming-msg-loader-icon {
86498
+ display: ${waitingResponseBubbleLoaderIcon ? "flex" : "none"};
86499
+ background-image: url('data:image/svg+xml;base64,${svgToBase64(waitingResponseBubbleLoaderIcon)}');
86500
+ background-size: cover;
86501
+ ${waitingResponseBubbleLoaderIcon ? `
86502
+ width: ${responseLabelWidth}px;
86503
+ height: ${responseLabelHeight}px;
86504
+ ` : ""}
86505
+ }`;
86506
+ keyFrames += styleSheetMarker + `.alan-btn__chat-incomming-msg-loader-label {
86507
+ display: inline-block;
86508
+ }`;
86509
+ keyFrames += styleSheetMarker + `.alan-btn__chat-incomming-msg {
86510
+ border-radius: 50%;
86511
+ background-color: ${textChatOptions?.bubbles?.response?.color || `#080808`};
86512
+ margin: 2px;
86513
+ height: 6px;
86514
+ width: 6px;
86515
+ animation: alan-dot-bounce 1.5s infinite ease;
86516
+ }`;
86517
+ keyFrames += styleSheetMarker + `.msg-2 {
86518
+ animation-delay: .2s;
86519
+ }`;
86520
+ keyFrames += styleSheetMarker + `.msg-3 {
86521
+ animation-delay: .3s;
86522
+ }`;
86523
+ keyFrames += styleSheetMarker + generateKeyFrame("alan-dot-bounce", `
86524
+ 0%, 100% { opacity:1;}
86525
+
86526
+ 60% {
86527
+ transform: translateY(3px);
86528
+ opacity:.0;
86529
+ }`);
86530
+ return keyFrames;
86531
+ }
86434
86532
  function getCssForTextChatLinks(styleSheetMarker, textChatOptions) {
86435
86533
  let result = "";
86436
86534
  const responseBubbleFontSize = +(textChatOptions?.bubbles?.response?.fontSize || 15);
86535
+ const learnMoreLinkBorderColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.default?.borderColor || `#EAF2FC`;
86536
+ const learnMoreLinkHoverBorderColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.hover?.borderColor || `#EAF2FC`;
86537
+ const learnMoreLinkActiveBorderColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.active?.borderColor || `#EAF2FC`;
86538
+ const learnMoreLinkBackgroundColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.default?.backgroundColor || `transparent`;
86539
+ const learnMoreLinkHoverBackgroundColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.hover?.backgroundColor || `#EAF2FC`;
86540
+ const learnMoreLinkActiveBackgroundColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.active?.backgroundColor || `#EAF2FC`;
86541
+ const learnMoreLinkNumberBackgroundColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.default?.linkNumberBackgroundColor || `#EAF2FC`;
86542
+ const learnMoreLinkNumberHoverBackgroundColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.hover?.linkNumberBackgroundColor || `#EAF2FC`;
86543
+ const learnMoreLinkNumberActiveBackgroundColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.active?.linkNumberBackgroundColor || `#EAF2FC`;
86544
+ const learnMoreTopLeftBorderRadius = getNumPropVal(uiState.textChat.options?.bubbles?.response?.learnMore?.links?.borderRadius?.topLeft, 4);
86545
+ const learnMoreTopRightBorderRadius = getNumPropVal(uiState.textChat.options?.bubbles?.response?.learnMore?.links?.borderRadius?.topRight, 4);
86546
+ const learnMoreBottomRightBorderRadius = getNumPropVal(uiState.textChat.options?.bubbles?.response?.learnMore?.links?.borderRadius?.bottomRight, 4);
86547
+ const learnMoreBottomLeftBorderRadius = getNumPropVal(uiState.textChat.options?.bubbles?.response?.learnMore?.links?.borderRadius?.bottomLeft, 4);
86437
86548
  result += styleSheetMarker + `.alan-btn__chat-response-links-wrapper {
86438
86549
  display: flex;
86439
86550
  flex-wrap: wrap;
@@ -86444,32 +86555,46 @@
86444
86555
  margin-top: 10px;
86445
86556
  }`;
86446
86557
  result += styleSheetMarker + `.alan-btn__chat-response-link {
86447
- border: 1px solid #EAF2FC;
86448
- border-radius: 4px;
86558
+ border: 1px solid ${learnMoreLinkBorderColor};
86559
+ border-radius: ${learnMoreTopLeftBorderRadius}px ${learnMoreTopRightBorderRadius}px ${learnMoreBottomRightBorderRadius}px ${learnMoreBottomLeftBorderRadius}px;
86560
+ background-color: ${learnMoreLinkBackgroundColor};
86449
86561
  margin-right: 10px;
86450
86562
  margin-bottom: 4px;
86451
86563
  display: flex;
86452
86564
  align-items: center;
86453
86565
  max-width: 100%;
86454
- font-size: ${responseBubbleFontSize - 2}px;
86455
86566
  }`;
86456
86567
  if (!isMobile()) {
86457
86568
  result += styleSheetMarker + `.alan-btn__chat-response-links-wrapper a.alan-btn__chat-response-link:hover {
86458
86569
  text-decoration: none !important;
86459
- background-color: #EAF2FC;
86570
+ background-color: ${learnMoreLinkHoverBackgroundColor};
86571
+ border-color: ${learnMoreLinkHoverBorderColor};
86572
+ }`;
86573
+ result += styleSheetMarker + `.alan-btn__chat-response-links-wrapper a.alan-btn__chat-response-link:active {
86574
+ text-decoration: none !important;
86575
+ background-color: ${learnMoreLinkActiveBackgroundColor};
86576
+ border-color: ${learnMoreLinkActiveBorderColor};
86460
86577
  }`;
86461
86578
  }
86462
86579
  result += styleSheetMarker + `.alan-btn__chat-response-link-icon-wrapper {
86463
86580
  padding: 9px 4px;
86464
- background-color: #EAF2FC;
86465
- border-radius: 3px;
86581
+ background-color: ${learnMoreLinkNumberBackgroundColor};
86582
+ border-radius: ${getInnerBorderRadiusProp(learnMoreTopLeftBorderRadius)}px ${getInnerBorderRadiusProp(learnMoreTopRightBorderRadius)}px ${getInnerBorderRadiusProp(learnMoreBottomRightBorderRadius)}px ${getInnerBorderRadiusProp(learnMoreBottomLeftBorderRadius)}px;
86466
86583
  display: inline-block;
86467
- min-width: 26px;
86584
+ min-width: 28px;
86468
86585
  height: 100%;
86469
86586
  display: flex;
86470
86587
  justify-content: center;
86471
86588
  align-items: center;
86472
86589
  }`;
86590
+ if (!isMobile()) {
86591
+ result += styleSheetMarker + `.alan-btn__chat-response-link:hover .alan-btn__chat-response-link-icon-wrapper {
86592
+ background-color: ${learnMoreLinkNumberHoverBackgroundColor};
86593
+ }`;
86594
+ result += styleSheetMarker + `.alan-btn__chat-response-link:active .alan-btn__chat-response-link-icon-wrapper {
86595
+ background-color: ${learnMoreLinkNumberActiveBackgroundColor};
86596
+ }`;
86597
+ }
86473
86598
  const linkColor = uiState.textChat.options?.bubbles?.response?.links?.color?.default || `#4183c4`;
86474
86599
  const linkHoverColor = uiState.textChat.options?.bubbles?.response?.links?.color?.hover || `#4183c4`;
86475
86600
  result += styleSheetMarker + `.alan-btn__chat-response-link svg path {
@@ -86607,13 +86732,27 @@
86607
86732
  // alan_btn/src/styles/markdown.ts
86608
86733
  function generateCssForMarkdown(stylesheetMarker, classPrefix) {
86609
86734
  let keyFrames = "";
86735
+ const tableBorderColor = uiState.textChat.options?.bubbles?.response?.table?.borderColor || `#b7b5b5`;
86610
86736
  const responseBubbleFontSize = +(uiState.textChat.options?.bubbles?.response?.fontSize || 15);
86611
86737
  const responseBubbleBg = uiState.textChat.options?.bubbles?.response?.backgroundColor || `#ffffff`;
86612
86738
  const responseBubbleFontColor = uiState.textChat.options?.bubbles?.response?.color || `#171717`;
86613
86739
  const responseBubbleCodeBackgroundColor = uiState.textChat.options?.bubbles?.response?.codeBackgroundColor || `#f8f8f8`;
86740
+ const responseBubbleCodeBorderColor = uiState.textChat.options?.bubbles?.response?.codeBorderColor || `#DDD`;
86614
86741
  const linkColor = uiState.textChat.options?.bubbles?.response?.links?.color?.default || `#4183c4`;
86615
86742
  const linkHoverColor = uiState.textChat.options?.bubbles?.response?.links?.color?.hover || `#4183c4`;
86616
- const footerLinkBgColor = "#EAF2FC";
86743
+ const learnMoreLinkBorderColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.default?.borderColor || `#EAF2FC`;
86744
+ const learnMoreLinkHoverBorderColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.hover?.borderColor || `#EAF2FC`;
86745
+ const learnMoreLinkActiveBorderColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.active?.borderColor || `#EAF2FC`;
86746
+ const learnMoreLinkBackgroundColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.default?.backgroundColor || `transparent`;
86747
+ const learnMoreLinkHoverBackgroundColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.hover?.backgroundColor || `#EAF2FC`;
86748
+ const learnMoreLinkActiveBackgroundColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.active?.backgroundColor || `#EAF2FC`;
86749
+ const learnMoreLinkNumberBackgroundColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.default?.linkNumberBackgroundColor || `#EAF2FC`;
86750
+ const learnMoreLinkNumberHoverBackgroundColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.hover?.linkNumberBackgroundColor || `#EAF2FC`;
86751
+ const learnMoreLinkNumberActiveBackgroundColor = uiState.textChat.options?.bubbles?.response?.learnMore?.links?.active?.linkNumberBackgroundColor || `#EAF2FC`;
86752
+ const learnMoreTopLeftBorderRadius = getNumPropVal(uiState.textChat.options?.bubbles?.response?.learnMore?.links?.borderRadius?.topLeft, 4);
86753
+ const learnMoreTopRightBorderRadius = getNumPropVal(uiState.textChat.options?.bubbles?.response?.learnMore?.links?.borderRadius?.topRight, 4);
86754
+ const learnMoreBottomRightBorderRadius = getNumPropVal(uiState.textChat.options?.bubbles?.response?.learnMore?.links?.borderRadius?.bottomRight, 4);
86755
+ const learnMoreBottomLeftBorderRadius = getNumPropVal(uiState.textChat.options?.bubbles?.response?.learnMore?.links?.borderRadius?.bottomLeft, 4);
86617
86756
  const cssRules = [
86618
86757
  `a {
86619
86758
  color: ${linkColor}!important;
@@ -86752,7 +86891,7 @@
86752
86891
  `code {
86753
86892
  background-color: ${responseBubbleCodeBackgroundColor}!important;
86754
86893
  border-radius: 3px!important;
86755
- border: 1px solid #DDD!important;
86894
+ border: 1px solid ${responseBubbleCodeBorderColor}!important;
86756
86895
  font-family: Consolas, "Liberation Mono", Courier, monospace!important;
86757
86896
  margin: 0 2px!important;
86758
86897
  padding: 0 5px!important;
@@ -86766,7 +86905,7 @@
86766
86905
  `pre {
86767
86906
  background-color: ${responseBubbleCodeBackgroundColor}!important;
86768
86907
  border-radius: 3px!important;
86769
- border: 1px solid #DDD!important;
86908
+ border: 1px solid ${responseBubbleCodeBorderColor}!important;
86770
86909
  font-family: Consolas, "Liberation Mono", Courier, monospace!important;
86771
86910
  padding: 10px!important;
86772
86911
  white-space: pre-line!important;
@@ -86806,19 +86945,19 @@
86806
86945
  }`,
86807
86946
  `table > thead > tr > th {
86808
86947
  padding: 4px!important;
86809
- border-top: 1px solid #b7b5b5!important;
86948
+ border-top: 1px solid ${tableBorderColor}!important;
86810
86949
  }`,
86811
86950
  `table > tbody > tr > th {
86812
86951
  padding: 4px!important;
86813
- border-top: 1px solid #b7b5b5!important;
86952
+ border-top: 1px solid ${tableBorderColor}!important;
86814
86953
  }`,
86815
86954
  `table > thead > tr > td {
86816
86955
  padding: 4px!important;
86817
- border-top: 1px solid #b7b5b5!important;
86956
+ border-top: 1px solid ${tableBorderColor}!important;
86818
86957
  }`,
86819
86958
  `table > tbody > tr > td {
86820
86959
  padding: 4px;
86821
- border-top: 1px solid #b7b5b5!important;
86960
+ border-top: 1px solid ${tableBorderColor}!important;
86822
86961
  }`,
86823
86962
  `strong {
86824
86963
  font-weight: bold!important;
@@ -86827,11 +86966,18 @@
86827
86966
  font-style: italic!important;
86828
86967
  }`,
86829
86968
  `sup.footnote-ref{
86830
- background: ${footerLinkBgColor};
86969
+ background: ${learnMoreLinkNumberBackgroundColor};
86831
86970
  padding: 1px;
86832
86971
  border-radius: 4px;
86833
86972
  position: relative;
86834
86973
  top: -5px;
86974
+ font-size: ${responseBubbleFontSize}px!important;
86975
+ }`,
86976
+ `sup.footnote-ref:hover{
86977
+ background: ${learnMoreLinkNumberHoverBackgroundColor};
86978
+ }`,
86979
+ `sup.footnote-ref:active{
86980
+ background: ${learnMoreLinkNumberActiveBackgroundColor};
86835
86981
  }`,
86836
86982
  `.footnotes{
86837
86983
  padding-top: 10px;
@@ -86848,13 +86994,19 @@
86848
86994
  `.footnote-item {
86849
86995
  position: relative;
86850
86996
  display: inline-block;
86851
- border-radius: 4px;
86997
+ border-radius: ${learnMoreTopLeftBorderRadius}px ${learnMoreTopRightBorderRadius}px ${learnMoreBottomRightBorderRadius}px ${learnMoreBottomLeftBorderRadius}px;
86852
86998
  cursor: pointer;
86853
- border: 1px solid ${footerLinkBgColor};
86999
+ border: 1px solid ${learnMoreLinkBorderColor};
86854
87000
  margin-bottom:4px;
87001
+ background-color: ${learnMoreLinkBackgroundColor};
86855
87002
  }`,
86856
87003
  `.footnote-item:hover {
86857
- background-color: ${footerLinkBgColor};
87004
+ border: 1px solid ${learnMoreLinkHoverBorderColor};
87005
+ background-color: ${learnMoreLinkHoverBackgroundColor};
87006
+ }`,
87007
+ `.footnote-item:active {
87008
+ border: 1px solid ${learnMoreLinkActiveBorderColor};
87009
+ background-color: ${learnMoreLinkActiveBackgroundColor};
86858
87010
  }`,
86859
87011
  `.footnote-item p {
86860
87012
  margin-top: 0;
@@ -86871,17 +87023,23 @@
86871
87023
  counter-increment: list-counter;
86872
87024
  content: counter(list-counter);
86873
87025
  padding: 4px 4px;
86874
- background-color: ${footerLinkBgColor};
86875
- border-radius: 3px;
87026
+ background-color: ${learnMoreLinkNumberBackgroundColor};
87027
+ border-radius: ${getInnerBorderRadiusProp(learnMoreTopLeftBorderRadius)}px ${getInnerBorderRadiusProp(learnMoreTopRightBorderRadius)}px ${getInnerBorderRadiusProp(learnMoreBottomRightBorderRadius)}px ${getInnerBorderRadiusProp(learnMoreBottomLeftBorderRadius)}px;
87028
+ box-sizing: border-box;
86876
87029
  display: inline-block;
86877
- min-width: 18px;
87030
+ min-width: 28px;
86878
87031
  text-align: center;
86879
87032
  color: ${linkColor}!important;
86880
87033
  }`,
86881
87034
  `.footnotes-list>.footnote-item:hover::before {
86882
87035
  color: ${linkHoverColor}!important;
87036
+ background-color: ${learnMoreLinkNumberHoverBackgroundColor};
86883
87037
  }`,
86884
- `.footnotes-sep{
87038
+ `.footnotes-list>.footnote-item:active::before {
87039
+ color: ${linkHoverColor}!important;
87040
+ background-color: ${learnMoreLinkNumberActiveBackgroundColor};
87041
+ }`,
87042
+ `.footnotes-sep {
86885
87043
  display: none!important;
86886
87044
  }`,
86887
87045
  `.scroll-table {
@@ -86963,7 +87121,7 @@
86963
87121
  keyFrames += getStyleSheetMarker() + ".alan-overlay-popup:hover .alan-overlay-popup__ok{opacity:1;transition:opacity 300ms ease-in-out;}";
86964
87122
  keyFrames += getStyleSheetMarker() + generateKeyFrame("alan-gradient", "0%{backgroundPosition: 0 0;}50%{backgroundPosition: -100% 0;}100%{backgroundPosition: 0 0;}");
86965
87123
  keyFrames += getStyleSheetMarker() + generateKeyFrame("alan-pulsating", "0%{transform: scale(1.11111);}50%{transform: scale(1.0);}100%{transform: scale(1.11111);}");
86966
- keyFrames += getStyleSheetMarker() + generateKeyFrame("alan-text-chat-pulsating", "0%{transform: scale(1) translateY(-50%);}50%{transform: scale(0.91) translateY(-50%);}100%{transform: scale(1) translateY(-50%);}");
87124
+ keyFrames += getStyleSheetMarker() + generateKeyFrame("alan-text-chat-pulsating", "0%{transform: scale(1)} 50%{transform: scale(0.91);} 100%{transform: scale(1) }");
86967
87125
  keyFrames += getStyleSheetMarker() + generateKeyFrame("alan-mic-pulsating", "0%{transform: scale(0.91);}50%{transform: scale(1.0);}100%{transform: scale(0.91);}");
86968
87126
  keyFrames += getStyleSheetMarker() + generateKeyFrame("alan-triangle-mic-pulsating", "0%{transform: scale(0.94);}50%{transform: scale(1.0);}100%{transform: scale(0.94);}");
86969
87127
  keyFrames += getStyleSheetMarker() + generateKeyFrame("alan-fade-in", "0%{opacity: 0;}100%{opacity:1;}");
@@ -87122,13 +87280,13 @@
87122
87280
 
87123
87281
  // alan_btn/src/textChat/highlightJs.ts
87124
87282
  window.hljs = es_default;
87125
- var hljsWasInit = false;
87126
- function initHighlightJs() {
87127
- if (hljsWasInit)
87283
+ var hljsTheme = false;
87284
+ function initHighlightJs(theme) {
87285
+ if (hljsTheme === theme)
87128
87286
  return;
87129
- hljsWasInit = true;
87287
+ hljsTheme = theme;
87130
87288
  var style = document.createElement("style");
87131
- style.textContent = highlightJsCss();
87289
+ style.textContent = highlightJsCss(theme);
87132
87290
  document.getElementsByTagName("head")[0].appendChild(style);
87133
87291
  }
87134
87292
  function highlightCode(msgsHolder) {
@@ -87143,8 +87301,8 @@
87143
87301
  });
87144
87302
  }
87145
87303
  }
87146
- function highlightJsCss() {
87147
- return `
87304
+ function highlightJsCss(theme) {
87305
+ const lightTheme = `
87148
87306
  pre code.hljs {
87149
87307
  display: block;
87150
87308
  overflow-x: auto;
@@ -87263,6 +87421,130 @@
87263
87421
  /* purposely ignored */
87264
87422
 
87265
87423
  }`;
87424
+ const darkTheme = `
87425
+ pre code.hljs {
87426
+ display: block;
87427
+ overflow-x: auto;
87428
+ padding: 1em
87429
+ }
87430
+ code.hljs {
87431
+ padding: 3px 5px
87432
+ }
87433
+ /*!
87434
+ Theme: GitHub Dark
87435
+ Description: Dark theme as seen on github.com
87436
+ Author: github.com
87437
+ Maintainer: @Hirse
87438
+ Updated: 2021-05-15
87439
+
87440
+ Outdated base version: https://github.com/primer/github-syntax-dark
87441
+ Current colors taken from GitHub's CSS
87442
+ */
87443
+ .hljs {
87444
+ color: #c9d1d9;
87445
+ background: #0d1117
87446
+ }
87447
+ .hljs-doctag,
87448
+ .hljs-keyword,
87449
+ .hljs-meta .hljs-keyword,
87450
+ .hljs-template-tag,
87451
+ .hljs-template-variable,
87452
+ .hljs-type,
87453
+ .hljs-variable.language_ {
87454
+ /* prettylights-syntax-keyword */
87455
+ color: #ff7b72
87456
+ }
87457
+ .hljs-title,
87458
+ .hljs-title.class_,
87459
+ .hljs-title.class_.inherited__,
87460
+ .hljs-title.function_ {
87461
+ /* prettylights-syntax-entity */
87462
+ color: #d2a8ff
87463
+ }
87464
+ .hljs-attr,
87465
+ .hljs-attribute,
87466
+ .hljs-literal,
87467
+ .hljs-meta,
87468
+ .hljs-number,
87469
+ .hljs-operator,
87470
+ .hljs-variable,
87471
+ .hljs-selector-attr,
87472
+ .hljs-selector-class,
87473
+ .hljs-selector-id {
87474
+ /* prettylights-syntax-constant */
87475
+ color: #79c0ff
87476
+ }
87477
+ .hljs-regexp,
87478
+ .hljs-string,
87479
+ .hljs-meta .hljs-string {
87480
+ /* prettylights-syntax-string */
87481
+ color: #a5d6ff
87482
+ }
87483
+ .hljs-built_in,
87484
+ .hljs-symbol {
87485
+ /* prettylights-syntax-variable */
87486
+ color: #ffa657
87487
+ }
87488
+ .hljs-comment,
87489
+ .hljs-code,
87490
+ .hljs-formula {
87491
+ /* prettylights-syntax-comment */
87492
+ color: #8b949e
87493
+ }
87494
+ .hljs-name,
87495
+ .hljs-quote,
87496
+ .hljs-selector-tag,
87497
+ .hljs-selector-pseudo {
87498
+ /* prettylights-syntax-entity-tag */
87499
+ color: #7ee787
87500
+ }
87501
+ .hljs-subst {
87502
+ /* prettylights-syntax-storage-modifier-import */
87503
+ color: #c9d1d9
87504
+ }
87505
+ .hljs-section {
87506
+ /* prettylights-syntax-markup-heading */
87507
+ color: #1f6feb;
87508
+ font-weight: bold
87509
+ }
87510
+ .hljs-bullet {
87511
+ /* prettylights-syntax-markup-list */
87512
+ color: #f2cc60
87513
+ }
87514
+ .hljs-emphasis {
87515
+ /* prettylights-syntax-markup-italic */
87516
+ color: #c9d1d9;
87517
+ font-style: italic
87518
+ }
87519
+ .hljs-strong {
87520
+ /* prettylights-syntax-markup-bold */
87521
+ color: #c9d1d9;
87522
+ font-weight: bold
87523
+ }
87524
+ .hljs-addition {
87525
+ /* prettylights-syntax-markup-inserted */
87526
+ color: #aff5b4;
87527
+ background-color: #033a16
87528
+ }
87529
+ .hljs-deletion {
87530
+ /* prettylights-syntax-markup-deleted */
87531
+ color: #ffdcd7;
87532
+ background-color: #67060c
87533
+ }
87534
+ .hljs-char.escape_,
87535
+ .hljs-link,
87536
+ .hljs-params,
87537
+ .hljs-property,
87538
+ .hljs-punctuation,
87539
+ .hljs-tag {
87540
+ /* purposely ignored */
87541
+
87542
+ }`;
87543
+ const themes = {
87544
+ light: lightTheme,
87545
+ dark: darkTheme
87546
+ };
87547
+ return themes[theme];
87266
87548
  }
87267
87549
 
87268
87550
  // node_modules/dont-crop/dist/mjs/linearRegression.js
@@ -87399,7 +87681,7 @@
87399
87681
  if (button.setVisualState) {
87400
87682
  resultBtn += ` data-alan-button-set-visual-state="${encodeValueForHtmlAttr(button.setVisualState)}" `;
87401
87683
  }
87402
- resultBtn += ` >${button.label}</div>`;
87684
+ resultBtn += ` >${button.html || button.label}</div>`;
87403
87685
  return resultBtn;
87404
87686
  }).join("") || ""}</div>`;
87405
87687
  }
@@ -87539,7 +87821,7 @@
87539
87821
 
87540
87822
  // alan_btn/alan_btn.ts
87541
87823
  (function(ns) {
87542
- uiState.lib.version = "alan-version.1.8.59".replace("alan-version.", "");
87824
+ uiState.lib.version = "alan-version.1.8.61".replace("alan-version.", "");
87543
87825
  if (window.alanBtn) {
87544
87826
  console.warn("Alan: the Alan Button source code has already added (v." + uiState.lib.version + ")");
87545
87827
  }
@@ -87654,6 +87936,19 @@
87654
87936
  },
87655
87937
  isAudioOutputEnabled: () => {
87656
87938
  return textToSpeachVoiceEnabled;
87939
+ },
87940
+ setFullScreenMode: (value) => {
87941
+ if (value) {
87942
+ enterFullScreenModeForTextChat();
87943
+ } else {
87944
+ exitFullScreenModeForTextChat();
87945
+ }
87946
+ },
87947
+ close: () => {
87948
+ closeTextChat();
87949
+ },
87950
+ clear: () => {
87951
+ clearTextChat();
87657
87952
  }
87658
87953
  },
87659
87954
  //deprecated
@@ -88533,7 +88828,7 @@
88533
88828
  onresizeDebounced({});
88534
88829
  if (!(uiState.textChat.expanded || uiState.textChat.inlined)) {
88535
88830
  var chatHolderRect = chatHolderDiv.getBoundingClientRect();
88536
- fixTextChatSizeIfNeeded(chatHolderRect.width, chatHolderRect.height, false);
88831
+ fixTextChatSizeIfNeeded(chatHolderRect.width, chatHolderRect.height);
88537
88832
  }
88538
88833
  };
88539
88834
  var initialPermissionWasAsked = false;
@@ -88655,7 +88950,7 @@
88655
88950
  continueWithAudio = false;
88656
88951
  if (textChatIsHidden) {
88657
88952
  sendClientEvent({ buttonClicked: true });
88658
- fixTextChatSizeIfNeeded(getTextChatSizeAfterResize("width"), getTextChatSizeAfterResize("height"), true);
88953
+ fixTextChatSizeIfNeeded(getTextChatSizeAfterResize("width"), getTextChatSizeAfterResize("height"));
88659
88954
  showTextChat();
88660
88955
  setTextChatPosition(chatHolderDiv);
88661
88956
  }
@@ -89043,6 +89338,11 @@
89043
89338
  if (data && data.web && data.web.chatOptions?.textChat?.enabled === true) {
89044
89339
  uiState.textChat.available = true;
89045
89340
  voiceEnabledInTextChat = data.web.chatOptions?.textChat?.voice?.enabled;
89341
+ const themeFromOptions = data.web.chatOptions?.textChat?.bubbles?.response?.codeTheme || "light";
89342
+ const currentTheme = uiState.textChat.options?.bubbles?.response?.codeTheme;
89343
+ if (currentTheme !== themeFromOptions) {
89344
+ initHighlightJs(themeFromOptions);
89345
+ }
89046
89346
  uiState.textChat.options = data.web.chatOptions?.textChat;
89047
89347
  if (getVoiceEnabledFlag() !== data.web.chatOptions?.textChat?.audio?.enabled) {
89048
89348
  if (data.web.chatOptions?.textChat?.audio?.enabled) {
@@ -89673,7 +89973,6 @@
89673
89973
  function buildMsgContent(msg) {
89674
89974
  return `${buildImagesContent(msg)}${buildMsgTextContent(msg)}${buildLinksContent(msg)}${buildCommandsBlock(msg)}${buildMsgIncommingLoader(msg)}`;
89675
89975
  }
89676
- initHighlightJs();
89677
89976
  initMathJax(textChatMessages.length, (i2) => getMsgElForMathJax(i2));
89678
89977
  document.addEventListener("click", (e) => {
89679
89978
  let clickedEl = e.target;
@@ -89707,9 +90006,12 @@ ${LEARN_MORE_LABEL}
89707
90006
  }
89708
90007
  function getMsgBubbleLabel(msg) {
89709
90008
  if (msg.type === "request" || msg.type === "response") {
90009
+ const isResponse = msg.type === "response";
89710
90010
  const requestLabel = uiState?.textChat?.options?.bubbles?.request?.label?.text || "Me";
89711
90011
  const responseLabel = uiState?.textChat?.options?.bubbles?.response?.label?.text || "Alan";
89712
- const msgLabel = `<div class="alan-btn__chat-${msg.type}-label">${msg.type === "request" ? requestLabel : responseLabel}</div>`;
90012
+ const msgLabel = `<div class="alan-btn__chat-${msg.type}-label">
90013
+ ${isResponse ? `<span class="alan-btn__chat-${msg.type}-label-icon"></span>` : ""}
90014
+ <span class="alan-btn__chat-${msg.type}-label-text">${isResponse ? responseLabel : requestLabel}</span></div>`;
89713
90015
  return msgLabel;
89714
90016
  }
89715
90017
  return "";
@@ -89907,7 +90209,7 @@ ${LEARN_MORE_LABEL}
89907
90209
  }
89908
90210
  }
89909
90211
  }
89910
- function onClearChatClick() {
90212
+ function clearTextChat() {
89911
90213
  clearDialogId();
89912
90214
  if (window.tutorProject) {
89913
90215
  window.tutorProject.close();
@@ -90045,6 +90347,70 @@ ${LEARN_MORE_LABEL}
90045
90347
  textareaHolder.classList.remove("ready-to-send");
90046
90348
  }
90047
90349
  }
90350
+ resizeTextArea();
90351
+ }
90352
+ function onChatTextAreaChange(e) {
90353
+ resizeTextArea();
90354
+ }
90355
+ function getDynamicInputHeight(el, maxHeight) {
90356
+ const style = window.getComputedStyle(el);
90357
+ const text = el.value;
90358
+ const id = "alanBtnHiddenTextDiv";
90359
+ const hasHiddenDiv = document.getElementById(id);
90360
+ const draftDiv = document.getElementById(id) || document.createElement("div");
90361
+ if (style) {
90362
+ draftDiv.id = id;
90363
+ draftDiv.style.position = "absolute";
90364
+ draftDiv.style.visibility = "hidden";
90365
+ draftDiv.style.whiteSpace = "pre-wrap";
90366
+ draftDiv.style.overflow = "visible";
90367
+ draftDiv.style.wordBreak = "break-all";
90368
+ draftDiv.style.width = style.width;
90369
+ draftDiv.style.maxWidth = style.width;
90370
+ draftDiv.style.fontFamily = style.fontFamily;
90371
+ draftDiv.style.fontSize = style.fontSize;
90372
+ draftDiv.style.lineHeight = style.lineHeight;
90373
+ draftDiv.style.padding = style.padding;
90374
+ draftDiv.style.border = style.border;
90375
+ draftDiv.style.maxHeight = `${maxHeight}px`;
90376
+ }
90377
+ draftDiv.textContent = text + "\u200B";
90378
+ if (!hasHiddenDiv) {
90379
+ document.body.appendChild(draftDiv);
90380
+ }
90381
+ const newHeight = draftDiv.offsetHeight;
90382
+ el.style.overflow = maxHeight - newHeight - 2 > 0 ? "hidden" : "auto";
90383
+ return newHeight;
90384
+ }
90385
+ const resizeTextAreaDebounced = throttle(function() {
90386
+ resizeTextArea();
90387
+ }, 300);
90388
+ function resizeTextArea() {
90389
+ var el = getChatTextareaEl();
90390
+ if (!el)
90391
+ return;
90392
+ const isMultiline = uiState.textChat.options?.textarea?.fieldType === "multi-line";
90393
+ const defaultLineHeight = uiState.textChat.defaults.textareaLineHeight;
90394
+ if (isMultiline) {
90395
+ const defaultChatTextareaFontSize = uiState.textChat.defaults.textareaFontSize;
90396
+ const fontSize = +getTextAreaFontSize(isMobile(), uiState.textChat.options?.textarea?.fontSize || defaultChatTextareaFontSize);
90397
+ const textareaTopPadding = +getNumPropVal(uiState.textChat.options?.textarea?.padding?.top, 12);
90398
+ const textareaBottomPadding = +getNumPropVal(uiState.textChat.options?.textarea?.padding?.bottom, 12);
90399
+ const maxLinesCount = +getNumPropVal(uiState.textChat.options?.textarea?.maxLinesCount, 7);
90400
+ const paddingsAndBorder = textareaTopPadding + textareaBottomPadding + 4;
90401
+ const lineHeight = fontSize * defaultLineHeight;
90402
+ const maxHeight = lineHeight * maxLinesCount + paddingsAndBorder;
90403
+ const defaultOneLineHeight = lineHeight + paddingsAndBorder;
90404
+ el.style.height = `${getDynamicInputHeight(el, maxHeight)}px`;
90405
+ if (el.offsetHeight > defaultOneLineHeight) {
90406
+ el.closest("#textarea-holder")?.classList?.add("multi-line");
90407
+ } else {
90408
+ el.closest("#textarea-holder")?.classList?.remove("multi-line");
90409
+ }
90410
+ } else {
90411
+ el.closest("#textarea-holder")?.classList?.remove("multi-line");
90412
+ el.style.height = `100%`;
90413
+ }
90048
90414
  }
90049
90415
  function getRestoreMsgsLsKey() {
90050
90416
  const projectId = getProjectId();
@@ -90124,7 +90490,8 @@ ${LEARN_MORE_LABEL}
90124
90490
  }
90125
90491
  const goToPrev = keyCode === 38;
90126
90492
  const goToNext = keyCode === 40;
90127
- if (goToPrev || goToNext) {
90493
+ const isMultiline = uiState.textChat.options?.textarea?.fieldType === "multi-line";
90494
+ if (!isMultiline && (goToPrev || goToNext)) {
90128
90495
  switchMessages(keyCode);
90129
90496
  e.stopPropagation();
90130
90497
  e.preventDefault();
@@ -90199,6 +90566,16 @@ ${LEARN_MORE_LABEL}
90199
90566
  parentEl.children[0].classList.add("alan-btn__chat-enter-full-screen-mode");
90200
90567
  parentEl.children[1].classList.add("alan-btn__chat-exit-full-screen-mode");
90201
90568
  }
90569
+ function createTextInputNode(fieldType) {
90570
+ const el = document.createElement(fieldType);
90571
+ el.id = "chatTextarea";
90572
+ el.setAttribute("autocomplete", "off");
90573
+ el.classList.add("alan-btn__chat-textarea");
90574
+ el.addEventListener("keydown", onChatTextAreaKeyDown);
90575
+ el.addEventListener("keyup", onChatTextAreaKeyUp);
90576
+ el.addEventListener("input", onChatTextAreaChange);
90577
+ return el;
90578
+ }
90202
90579
  function initTextChat() {
90203
90580
  var textareaDiv = document.getElementById("textarea-holder");
90204
90581
  var textareaInnerDiv = document.getElementById("textarea-inner-holder");
@@ -90214,6 +90591,7 @@ ${LEARN_MORE_LABEL}
90214
90591
  var leftHeaderIconsHolder = document.getElementById("chat-header-left-icons");
90215
90592
  var closeChatBtnImg = document.getElementById("alan-btn-chat-close-btn");
90216
90593
  var expandCollapseChatBtnImg = document.getElementById("alan-btn-expand-collapse-chat-btn");
90594
+ const isMultiline = uiState.textChat.options?.textarea?.fieldType === "multi-line";
90217
90595
  if (!chatDivWrapper.classList.contains("alan-btn__chat")) {
90218
90596
  document.addEventListener("touchstart", keyboardScrollFixListenerForChat, { passive: false });
90219
90597
  if (isInlinedMode()) {
@@ -90241,7 +90619,7 @@ ${LEARN_MORE_LABEL}
90241
90619
  headerInnerDiv = createDiv({ id: "chat-header-inner", class: "alan-btn__chat-header-inner" });
90242
90620
  var headerDivGr = createDiv({ class: "alan-btn__chat-header-gradient" });
90243
90621
  var clearChatBtn = createDivWithSvg(chatIcons.clear, { id: "clear-chat-btn", class: "alan-btn__chat-clear-btn" });
90244
- clearChatBtn.addEventListener("click", onClearChatClick);
90622
+ clearChatBtn.addEventListener("click", clearTextChat);
90245
90623
  headerTille = document.createElement("span");
90246
90624
  headerTille.id = "chat-header-title";
90247
90625
  headerTille.classList.add("alan-btn__chat-header-title");
@@ -90265,18 +90643,13 @@ ${LEARN_MORE_LABEL}
90265
90643
  headerInnerDiv.appendChild(headerTille);
90266
90644
  headerInnerDiv.appendChild(rightHeaderIconsHolder);
90267
90645
  headerDiv.appendChild(headerInnerDiv);
90268
- fillSideBarContent(chatSideBar, { onClearChatClick, expandCollapseChatSidePanel, closeTextChat });
90646
+ fillSideBarContent(chatSideBar, { clearTextChat, expandCollapseChatSidePanel, closeTextChat });
90269
90647
  textareaInnerDiv = createDiv({ id: "textarea-inner-holder", class: "alan-btn__chat-textarea-inner-holder" });
90270
90648
  textareaHolderDiv = createDiv({ id: "textarea-holder-content", class: "alan-btn__chat-textarea-holder-outer-content" });
90271
90649
  textareaDiv = createDiv({ id: "textarea-holder", class: "alan-btn__chat-textarea-holder" });
90272
90650
  var textareaDivGr = document.createElement("div");
90273
90651
  textareaDivGr.classList.add("alan-btn__chat-textarea-holder-gradient");
90274
- chatTextarea = document.createElement("input");
90275
- chatTextarea.id = "chatTextarea";
90276
- chatTextarea.setAttribute("autocomplete", "off");
90277
- chatTextarea.classList.add("alan-btn__chat-textarea");
90278
- chatTextarea.addEventListener("keydown", onChatTextAreaKeyDown);
90279
- chatTextarea.addEventListener("keyup", onChatTextAreaKeyUp);
90652
+ chatTextarea = createTextInputNode(isMultiline ? "textarea" : "input");
90280
90653
  chatSendBtn = document.createElement("div");
90281
90654
  chatSendBtn.id = "chat-send-btn";
90282
90655
  chatSendBtn.classList.add("alan-btn__chat-send-btn");
@@ -90292,10 +90665,23 @@ ${LEARN_MORE_LABEL}
90292
90665
  chatDiv.appendChild(headerDivGr);
90293
90666
  chatHolderDiv.classList.add("alan-btn__chat-holder");
90294
90667
  }
90668
+ const tagName = chatTextarea?.tagName?.toLowerCase();
90669
+ if (tagName === "input" && isMultiline) {
90670
+ const newTextareaEl = createTextInputNode("textarea");
90671
+ newTextareaEl.placeholder = chatTextarea.placeholder;
90672
+ chatTextarea.parentNode.replaceChild(newTextareaEl, chatTextarea);
90673
+ } else if (tagName === "textarea" && !isMultiline) {
90674
+ const newTextareaEl = createTextInputNode("input");
90675
+ newTextareaEl.placeholder = chatTextarea.placeholder;
90676
+ chatTextarea.parentNode.replaceChild(newTextareaEl, chatTextarea);
90677
+ }
90678
+ setTimeout(() => {
90679
+ resizeTextArea();
90680
+ });
90295
90681
  if (headerTille) {
90682
+ const icon = uiState.textChat.options?.header?.icon?.svg;
90296
90683
  const title = uiState.textChat.options?.header?.label || "Alan AI Assistant";
90297
- headerTille.innerText = title;
90298
- headerTille.setAttribute("title", title);
90684
+ headerTille.innerHTML = `${icon ? `<span class="alan-btn__chat-header-title-icon">${icon}</span>` : ""}<span class="alan-btn__chat-header-title-label" title="${title}">${title}</span>`;
90299
90685
  }
90300
90686
  if (closeChatBtnImg) {
90301
90687
  closeChatBtnImg.innerHTML = getCloseChatIcon(uiState.textChat.options);
@@ -90315,6 +90701,7 @@ ${LEARN_MORE_LABEL}
90315
90701
  chatMicBtn.id = "chat-mic-btn";
90316
90702
  chatMicBtn.addEventListener("click", () => {
90317
90703
  chatTextarea.value = "";
90704
+ resizeTextArea();
90318
90705
  textareaDiv.classList.remove("show-gradient");
90319
90706
  if (!isAlanActive) {
90320
90707
  disableVoiceEnabledBtn();
@@ -90430,13 +90817,21 @@ ${LEARN_MORE_LABEL}
90430
90817
  }
90431
90818
  function expandCollapseTextChat() {
90432
90819
  if (!uiState.textChat.expanded) {
90820
+ enterFullScreenModeForTextChat();
90821
+ } else {
90822
+ exitFullScreenModeForTextChat();
90823
+ }
90824
+ }
90825
+ function enterFullScreenModeForTextChat() {
90826
+ if (uiState.textChat?.options?.popup?.fullScreenMode?.enabled === true) {
90433
90827
  uiState.textChat.expanded = true;
90434
90828
  openChatInFullScreen(chatHolderDiv);
90435
- } else {
90436
- uiState.textChat.expanded = false;
90437
- chatHolderDiv.classList.remove("alan-btn_text-chat-full-screen");
90438
90829
  }
90439
90830
  }
90831
+ function exitFullScreenModeForTextChat() {
90832
+ uiState.textChat.expanded = false;
90833
+ chatHolderDiv.classList.remove("alan-btn_text-chat-full-screen");
90834
+ }
90440
90835
  function getVoiceEnabledFlagLocalStorageKey() {
90441
90836
  return `alan-btn-text-chat__text-to-speach-voice-enabled__for-projectId-${getProjectId()}`;
90442
90837
  }
@@ -90924,6 +91319,7 @@ ${LEARN_MORE_LABEL}
90924
91319
  btn.appendChild(chatNotificationsBubble);
90925
91320
  }
90926
91321
  rootEl.appendChild(chatHolderDiv);
91322
+ resizeTextArea();
90927
91323
  btnDisabled = false;
90928
91324
  }
90929
91325
  function hideBtn() {
@@ -91213,7 +91609,10 @@ ${LEARN_MORE_LABEL}
91213
91609
  }
91214
91610
  if (!isMobile()) {
91215
91611
  chatHolderDiv.addEventListener("mousedown", onMouseDownForResizeTextChat);
91216
- chatHolderDiv.addEventListener("mousemove", onMouseHoverForResizeTextChat);
91612
+ chatHolderDiv.addEventListener("mousemove", (e) => {
91613
+ onMouseHoverForResizeTextChat(e);
91614
+ resizeTextAreaDebounced();
91615
+ });
91217
91616
  chatHolderDiv.addEventListener("mouseleave", onMouseHoverForResizeTextChat);
91218
91617
  document.addEventListener("mouseup", onMouseUpForResizeTextChat, true);
91219
91618
  document.addEventListener("mousemove", onMouseMoveForResizeTextChat, true);