@alan-ai/alan-sdk-web 1.8.60 → 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
@@ -84181,15 +84215,14 @@
84181
84215
  `
84182
84216
  },
84183
84217
  send: `
84184
- <svg width="36" height="24" viewBox="0 0 36 24" fill="none" xmlns="http://www.w3.org/2000/svg">
84185
- <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"/>
84186
84220
  </svg>
84187
84221
  `,
84188
84222
  mic: `
84189
- <svg width="44" height="40" viewBox="0 0 44 40" fill="none" xmlns="http://www.w3.org/2000/svg">
84190
- <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"/>
84191
84225
  </svg>
84192
-
84193
84226
  `,
84194
84227
  micPlayingBars: `<div class="alan-text-chat__animated-btn-bars">
84195
84228
  <div class="alan-text-chat__bar alan-text-chat__bar-1"></div>
@@ -84204,9 +84237,10 @@
84204
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"/>
84205
84238
  </svg>
84206
84239
  `,
84207
- 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">
84208
- <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"/>
84209
- </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
+ `,
84210
84244
  noWiFi: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
84211
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"/>
84212
84246
  </svg>
@@ -84261,32 +84295,6 @@
84261
84295
  return textChatOptions?.popup?.icons?.mute?.svgOn || chatIcons.unmute;
84262
84296
  }
84263
84297
 
84264
- // alan_btn/src/state.ts
84265
- var uiState = {
84266
- lib: {
84267
- version: ""
84268
- },
84269
- project: {
84270
- id: null
84271
- },
84272
- btn: {
84273
- isTopAligned: false,
84274
- zIndex: void 0
84275
- },
84276
- textChat: {
84277
- available: false,
84278
- expanded: false,
84279
- inlined: false,
84280
- options: null,
84281
- loaderTimeoutMs: 3e4,
84282
- defaults: {
84283
- minChatWidth: 250,
84284
- appearAnimationMs: 200,
84285
- chatMargin: 25
84286
- }
84287
- }
84288
- };
84289
-
84290
84298
  // alan_btn/src/textChat/fullscreen.ts
84291
84299
  function openChatInFullScreen(chatHolderDiv) {
84292
84300
  chatHolderDiv.classList.add("alan-btn_text-chat-full-screen");
@@ -84314,7 +84322,7 @@
84314
84322
  sideChatHeader.appendChild(chatCollapseSideBarBtn);
84315
84323
  chatCloseSideBarBtn.addEventListener("click", options.closeTextChat);
84316
84324
  chatCollapseSideBarBtn.addEventListener("click", options.expandCollapseChatSidePanel);
84317
- newChatSideBarBtn.addEventListener("click", options.onClearChatClick);
84325
+ newChatSideBarBtn.addEventListener("click", options.clearTextChat);
84318
84326
  }
84319
84327
  }
84320
84328
 
@@ -84696,14 +84704,12 @@
84696
84704
  }
84697
84705
  return null;
84698
84706
  }
84699
- function fixTextChatSizeIfNeeded(width, height, doubleMargin) {
84700
- var defaultChatMargin = uiState.textChat.defaults.chatMargin;
84701
- const margin = doubleMargin ? 2 * defaultChatMargin : defaultChatMargin;
84702
- if (height !== null && window.innerHeight - defaultChatMargin < height) {
84703
- setChatHeight(window.innerHeight - margin);
84707
+ function fixTextChatSizeIfNeeded(width, height) {
84708
+ if (height !== null && window.innerHeight < height) {
84709
+ setChatHeight(window.innerHeight);
84704
84710
  }
84705
- if (width !== null && window.innerWidth - defaultChatMargin < width) {
84706
- setChatWidth(window.innerWidth - margin);
84711
+ if (width !== null && window.innerWidth < width) {
84712
+ setChatWidth(window.innerWidth);
84707
84713
  }
84708
84714
  }
84709
84715
 
@@ -84852,14 +84858,34 @@
84852
84858
  function getPaddingProp(top, right, bottom, left) {
84853
84859
  return `${top}px ${right}px ${bottom}px ${left}px;`;
84854
84860
  }
84855
-
84856
- // alan_btn/src/styles/chat.ts
84861
+ function getInnerBorderRadiusProp(br) {
84862
+ if (+br > 0) {
84863
+ return +br - 1;
84864
+ }
84865
+ return 0;
84866
+ }
84857
84867
  function getNumPropVal(val, defaultVal) {
84858
84868
  if (+val >= 0) {
84859
84869
  return val;
84860
84870
  }
84861
84871
  return defaultVal;
84862
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
84863
84889
  var flexMap = {
84864
84890
  left: "flex-start",
84865
84891
  right: "flex-end",
@@ -84871,11 +84897,11 @@
84871
84897
  const defaultMinChatHeight = 400;
84872
84898
  const defaultChatHeight = 700;
84873
84899
  const chatHeaderHeight = +textChatOptions?.header?.height || 40;
84874
- const chatTextareaLineHieght = 1.25;
84900
+ const chatTextareaLineHieght = uiState.textChat.defaults.textareaLineHeight;
84875
84901
  const textareaHolderHeight = +textChatOptions?.footer?.height || 67;
84876
84902
  const chatMicBtnActiveSize = 32;
84877
84903
  const textChatScrollSize = 6;
84878
- const defaultChatTextareaFontSize = 15;
84904
+ const defaultChatTextareaFontSize = uiState.textChat.defaults.textareaFontSize;
84879
84905
  const withSendBtnOutside = textChatOptions?.footer?.layout?.name === "send-btn-outside";
84880
84906
  const footerTopPadding = getNumPropVal(textChatOptions?.footer?.padding?.top, 2);
84881
84907
  const footerRightPadding = getNumPropVal(textChatOptions?.footer?.padding?.right, 18);
@@ -84901,6 +84927,7 @@
84901
84927
  const responseBubbleRightPadding = getNumPropVal(textChatOptions?.bubbles?.response?.padding?.right, 20);
84902
84928
  const responseBubbleBottomPadding = getNumPropVal(textChatOptions?.bubbles?.response?.padding?.bottom, 9);
84903
84929
  const responseBubbleLeftPadding = getNumPropVal(textChatOptions?.bubbles?.response?.padding?.left, 20);
84930
+ const waitingResponseBubbleLayout = textChatOptions?.bubbles?.waitingResponse?.layout || "default";
84904
84931
  const responseBubbleBorderRadiusTopLeft = getNumPropVal(textChatOptions?.bubbles?.response?.borderRadius?.topLeft, defaultBubbleBorderRadius);
84905
84932
  const responseBubbleBorderRadiusTopRight = getNumPropVal(textChatOptions?.bubbles?.response?.borderRadius?.topRight, defaultBubbleBorderRadius);
84906
84933
  const responseBubbleBorderRadiusBottomRight = getNumPropVal(textChatOptions?.bubbles?.response?.borderRadius?.bottomRight, defaultBubbleBorderRadius);
@@ -84930,7 +84957,7 @@
84930
84957
  const headerLayoutName = textChatOptions?.header?.layout?.name || "centered-title";
84931
84958
  let cssChatHeight = getTextChatSizeAfterResize("height");
84932
84959
  let cssChatWidth = getTextChatSizeAfterResize("width");
84933
- fixTextChatSizeIfNeeded(cssChatWidth, cssChatHeight, true);
84960
+ fixTextChatSizeIfNeeded(cssChatWidth, cssChatHeight);
84934
84961
  cssChatHeight = getTextChatSizeAfterResize("height");
84935
84962
  cssChatWidth = getTextChatSizeAfterResize("width");
84936
84963
  if (cssChatHeight) {
@@ -84952,6 +84979,7 @@
84952
84979
  const chatBgColor1 = textChatOptions?.popup?.backgroundColor || `#DAEBFF`;
84953
84980
  const chatBgColor2 = textChatOptions?.popup?.backgroundColor2 || `#ffffff`;
84954
84981
  const chatGradientType = textChatOptions?.popup?.gradientType || `linear`;
84982
+ const chatCustomBg = textChatOptions?.popup?.background?.customCss;
84955
84983
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-holder {
84956
84984
  position: fixed;
84957
84985
  height: ${cssChatHeight};
@@ -85150,6 +85178,9 @@
85150
85178
  if (chatGradientType === "radial") {
85151
85179
  chatBackgroud = `radial-gradient(circle, ${chatBgColor2} 0%, ${chatBgColor1} 100%)`;
85152
85180
  }
85181
+ if (chatGradientType === "custom" && chatCustomBg) {
85182
+ chatBackgroud = chatCustomBg;
85183
+ }
85153
85184
  keyFrames += getStyleSheetMarker() + `.alan-btn__popup-chat {
85154
85185
  height: 100%;
85155
85186
  position: relative;
@@ -85177,11 +85208,11 @@
85177
85208
  }`;
85178
85209
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-textarea-holder {
85179
85210
  width: 100%;
85180
- height: ${textareaHolderHeight}px;
85181
- max-height: ${textareaHolderHeight}px;
85182
85211
  min-height: ${textareaHolderHeight}px;
85183
- background-color: ${textChatOptions?.footer?.backgroundColor || "transparent"};
85212
+ background-color: ${textChatOptions?.footer?.backgroundColor || "#DAEBFF"};
85184
85213
  position: relative;
85214
+ display: flex;
85215
+ flex-shrink: 0;
85185
85216
  padding: ${getPaddingProp(footerTopPadding, footerRightPadding, footerBottomPadding, footerLeftPadding)};
85186
85217
  }`;
85187
85218
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-textarea-holder-outer-content {
@@ -85195,20 +85226,20 @@
85195
85226
  width: 100%;
85196
85227
  height: 100%;
85197
85228
  position: relative;
85229
+ display: flex;
85230
+ align-items: center;
85198
85231
  }`;
85199
85232
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-messages-empty-block {
85200
85233
  flex: 1 1 auto;
85201
85234
  }`;
85202
85235
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-messages-wrapper {
85203
85236
  width: 100%;
85204
- height: calc(100% - ${chatHeaderHeight + textareaHolderHeight}px);
85205
- max-height: calc(100% - ${chatHeaderHeight + textareaHolderHeight}px);
85206
- min-height: calc(100% - ${chatHeaderHeight + textareaHolderHeight}px);
85237
+ height: 100%;
85207
85238
  overflow-y: scroll;
85208
85239
  overflow-x: hidden;
85209
85240
  padding: ${getPaddingProp(msgsTopPadding, msgsRightPadding, msgsBottomPadding, msgsLeftPadding)};
85210
85241
  display: flex;
85211
- flex-shrink: 0;
85242
+ flex-shrink: 1;
85212
85243
  flex-direction: column-reverse;
85213
85244
  }`;
85214
85245
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-messages {
@@ -85242,16 +85273,24 @@
85242
85273
  position:relative;
85243
85274
  }`;
85244
85275
  const headerFontSize = textChatOptions?.header?.fontSize || 16;
85276
+ const headerIconGap = getNumPropVal(textChatOptions?.header?.icon?.gap, 12);
85277
+ const headerAlignment = textChatOptions?.header?.alignment || "center";
85245
85278
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-header-title {
85246
85279
  max-width: calc(100% - 112px);
85247
85280
  overflow: hidden;
85248
85281
  text-overflow: ellipsis;
85249
85282
  white-space: nowrap;
85250
- display: inline-block;
85283
+ display: flex;
85284
+ align-items: ${headerAlignment};
85251
85285
  font-weight: 600;
85252
85286
  font-size: ${headerFontSize}px;
85253
- position: relative;
85254
- 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;
85255
85294
  }`;
85256
85295
  const withGradientForHeader = uiState.textChat.options?.header?.withBottomGradient !== false;
85257
85296
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-header-gradient {
@@ -85304,8 +85343,10 @@
85304
85343
  height: 100%;
85305
85344
  cursor: pointer;
85306
85345
  position: relative;
85307
- top:50%;
85308
- transform: translateY(-50%);
85346
+ }`;
85347
+ keyFrames += getStyleSheetMarker() + `.multi-line .alan-btn__chat-clear-btn {
85348
+ align-items: flex-end;
85349
+ padding-bottom: ${textareaBottomPadding}px;
85309
85350
  }`;
85310
85351
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-clear-btn.disabled {
85311
85352
  pointer-events: none;
@@ -85508,7 +85549,7 @@
85508
85549
  min-height:15px;
85509
85550
  width: 100%;
85510
85551
  position: absolute;
85511
- bottom: ${textareaHolderHeight}px;
85552
+ top: -15px;
85512
85553
  display: ${withGradientForFooter ? "block" : "none"};
85513
85554
  left:0;
85514
85555
  }`;
@@ -85527,8 +85568,6 @@
85527
85568
  font-size: ${getTextAreaFontSize(isMobile(), textChatOptions?.textarea?.fontSize || defaultChatTextareaFontSize)}px;
85528
85569
  line-height: ${chatTextareaLineHieght};
85529
85570
  text-align: left;
85530
- max-height: 100%;
85531
- height: 100%;
85532
85571
  padding: ${getPaddingProp(textareaTopPadding, textareaRightPadding, textareaBottomPadding, textareaLeftPadding)};
85533
85572
  margin: 0px!important;
85534
85573
  -webkit-user-select: text;
@@ -85558,8 +85597,9 @@
85558
85597
  border-radius: 3px;
85559
85598
  background: transparent;
85560
85599
  }`;
85600
+ const micHolderWidth = 44;
85561
85601
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-holder.alan-text-chat__voice-enabled .alan-btn__chat-textarea {
85562
- padding-left: 44px;
85602
+ padding-left: ${micHolderWidth}px;
85563
85603
  }`;
85564
85604
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat.alan-btn__mic-active .alan-btn__chat-textarea {
85565
85605
  opacity: 0.6;
@@ -85633,11 +85673,11 @@
85633
85673
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-send-btn {
85634
85674
  ${!withSendBtnOutside && `
85635
85675
  position: absolute;
85636
- top: 50%;
85676
+ top: 0;
85637
85677
  right: 0px;
85638
- transform: translateY(-50%);
85678
+ width: 44px;
85639
85679
  `}
85640
-
85680
+ height: 100%;
85641
85681
  transition: opacity 300ms ease-in-out;
85642
85682
  display: flex;
85643
85683
  flex-direction: row;
@@ -85651,6 +85691,10 @@
85651
85691
  -ms-user-select: none; /* IE/Edge */
85652
85692
  user-select: none;
85653
85693
  }`;
85694
+ keyFrames += getStyleSheetMarker() + `.multi-line .alan-btn__chat-send-btn {
85695
+ align-items: flex-end;
85696
+ padding-bottom: ${textareaBottomPadding}px;
85697
+ }`;
85654
85698
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-send-btn svg path {
85655
85699
  stroke: ${textChatOptions?.textarea?.placeholderColor || `#747474`};
85656
85700
  opacity: 0.5;
@@ -85670,10 +85714,11 @@
85670
85714
  }
85671
85715
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-mic-btn {
85672
85716
  position: absolute;
85673
- left: 3px;
85674
- top:50%;
85675
- transform: translateY(-50%);
85676
- transform-origin: top;
85717
+ left: 0px;
85718
+ top:0;
85719
+ height: 100%;
85720
+ width: ${micHolderWidth}px;
85721
+ transform-origin: center;
85677
85722
  display: flex;
85678
85723
  flex-direction: row;
85679
85724
  cursor: pointer;
@@ -85681,6 +85726,10 @@
85681
85726
  align-items: center;
85682
85727
  border-radius: 50%;
85683
85728
  }`;
85729
+ keyFrames += getStyleSheetMarker() + `.multi-line .alan-btn__chat-mic-btn {
85730
+ align-items: flex-end;
85731
+ padding-bottom: ${textareaBottomPadding}px;
85732
+ }`;
85684
85733
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-notifications-bubble {
85685
85734
  position: absolute;
85686
85735
  right: 4px;
@@ -85847,8 +85896,13 @@
85847
85896
  }`;
85848
85897
  const responseBubbleFontSize = +(textChatOptions?.bubbles?.response?.fontSize || 15);
85849
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;
85850
85902
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-response-label {
85851
- display: ${responseBubbleLabelEnabled ? "block" : "none"};
85903
+ display: ${responseBubbleLabelEnabled ? "flex" : "none"};
85904
+ align-items:${responseBubbleLabelAlignment};
85905
+ gap: ${responseBubbleLabelIconGap}px;
85852
85906
  position: relative;
85853
85907
  color: ${responseBubbleLabelColor};
85854
85908
  font-size: ${responseBubbleLabelFontSize}px;
@@ -85862,6 +85916,19 @@
85862
85916
  -ms-user-select: text; /* IE/Edge */
85863
85917
  user-select: text;
85864
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
+ }`;
85865
85932
  keyFrames += getStyleSheetMarker() + `.alan-btn_text-chat-full-screen .alan-btn__chat-response-label {
85866
85933
  text-align: left;
85867
85934
  padding-left: ${avatarSize + avatarRightMargin}px;
@@ -85890,6 +85957,11 @@
85890
85957
  -ms-user-select: text; /* IE/Edge */
85891
85958
  user-select: text;
85892
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
+ }`;
85893
85965
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-buttons {
85894
85966
  margin-bottom: 16px;
85895
85967
  display:flex;
@@ -86156,31 +86228,7 @@
86156
86228
  padding: 0px;
86157
86229
  margin-bottom:0;
86158
86230
  }`);
86159
- keyFrames += getStyleSheetMarker() + `.alan-btn__chat-incomming-msg-wrapper {
86160
- display: flex;
86161
- align-items: center;
86162
- }`;
86163
- keyFrames += getStyleSheetMarker() + `.alan-btn__chat-incomming-msg {
86164
- border-radius: 50%;
86165
- background-color: ${textChatOptions?.bubbles?.response?.color || `#080808`};
86166
- margin: 2px;
86167
- height: 6px;
86168
- width: 6px;
86169
- animation: alan-dot-bounce 1.5s infinite ease;
86170
- }`;
86171
- keyFrames += getStyleSheetMarker() + `.msg-2 {
86172
- animation-delay: .2s;
86173
- }`;
86174
- keyFrames += getStyleSheetMarker() + `.msg-3 {
86175
- animation-delay: .3s;
86176
- }`;
86177
- keyFrames += getStyleSheetMarker() + generateKeyFrame("alan-dot-bounce", `
86178
- 0%, 100% { opacity:1;}
86179
-
86180
- 60% {
86181
- transform: translateY(3px);
86182
- opacity:.0;
86183
- }`);
86231
+ keyFrames += getCssForResponseLoader(getStyleSheetMarker(), uiState.textChat.options);
86184
86232
  keyFrames += getStyleSheetMarker() + `.alan-btn_text-chat-full-screen .alan-btn__chat-popup {
86185
86233
  width: 100%;
86186
86234
  margin-left: 51px;
@@ -86432,9 +86480,71 @@
86432
86480
  }`;
86433
86481
  return keyFrames;
86434
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
+ }
86435
86532
  function getCssForTextChatLinks(styleSheetMarker, textChatOptions) {
86436
86533
  let result = "";
86437
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);
86438
86548
  result += styleSheetMarker + `.alan-btn__chat-response-links-wrapper {
86439
86549
  display: flex;
86440
86550
  flex-wrap: wrap;
@@ -86445,32 +86555,46 @@
86445
86555
  margin-top: 10px;
86446
86556
  }`;
86447
86557
  result += styleSheetMarker + `.alan-btn__chat-response-link {
86448
- border: 1px solid #EAF2FC;
86449
- border-radius: 4px;
86558
+ border: 1px solid ${learnMoreLinkBorderColor};
86559
+ border-radius: ${learnMoreTopLeftBorderRadius}px ${learnMoreTopRightBorderRadius}px ${learnMoreBottomRightBorderRadius}px ${learnMoreBottomLeftBorderRadius}px;
86560
+ background-color: ${learnMoreLinkBackgroundColor};
86450
86561
  margin-right: 10px;
86451
86562
  margin-bottom: 4px;
86452
86563
  display: flex;
86453
86564
  align-items: center;
86454
86565
  max-width: 100%;
86455
- font-size: ${responseBubbleFontSize - 2}px;
86456
86566
  }`;
86457
86567
  if (!isMobile()) {
86458
86568
  result += styleSheetMarker + `.alan-btn__chat-response-links-wrapper a.alan-btn__chat-response-link:hover {
86459
86569
  text-decoration: none !important;
86460
- 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};
86461
86577
  }`;
86462
86578
  }
86463
86579
  result += styleSheetMarker + `.alan-btn__chat-response-link-icon-wrapper {
86464
86580
  padding: 9px 4px;
86465
- background-color: #EAF2FC;
86466
- border-radius: 3px;
86581
+ background-color: ${learnMoreLinkNumberBackgroundColor};
86582
+ border-radius: ${getInnerBorderRadiusProp(learnMoreTopLeftBorderRadius)}px ${getInnerBorderRadiusProp(learnMoreTopRightBorderRadius)}px ${getInnerBorderRadiusProp(learnMoreBottomRightBorderRadius)}px ${getInnerBorderRadiusProp(learnMoreBottomLeftBorderRadius)}px;
86467
86583
  display: inline-block;
86468
- min-width: 26px;
86584
+ min-width: 28px;
86469
86585
  height: 100%;
86470
86586
  display: flex;
86471
86587
  justify-content: center;
86472
86588
  align-items: center;
86473
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
+ }
86474
86598
  const linkColor = uiState.textChat.options?.bubbles?.response?.links?.color?.default || `#4183c4`;
86475
86599
  const linkHoverColor = uiState.textChat.options?.bubbles?.response?.links?.color?.hover || `#4183c4`;
86476
86600
  result += styleSheetMarker + `.alan-btn__chat-response-link svg path {
@@ -86608,13 +86732,27 @@
86608
86732
  // alan_btn/src/styles/markdown.ts
86609
86733
  function generateCssForMarkdown(stylesheetMarker, classPrefix) {
86610
86734
  let keyFrames = "";
86735
+ const tableBorderColor = uiState.textChat.options?.bubbles?.response?.table?.borderColor || `#b7b5b5`;
86611
86736
  const responseBubbleFontSize = +(uiState.textChat.options?.bubbles?.response?.fontSize || 15);
86612
86737
  const responseBubbleBg = uiState.textChat.options?.bubbles?.response?.backgroundColor || `#ffffff`;
86613
86738
  const responseBubbleFontColor = uiState.textChat.options?.bubbles?.response?.color || `#171717`;
86614
86739
  const responseBubbleCodeBackgroundColor = uiState.textChat.options?.bubbles?.response?.codeBackgroundColor || `#f8f8f8`;
86740
+ const responseBubbleCodeBorderColor = uiState.textChat.options?.bubbles?.response?.codeBorderColor || `#DDD`;
86615
86741
  const linkColor = uiState.textChat.options?.bubbles?.response?.links?.color?.default || `#4183c4`;
86616
86742
  const linkHoverColor = uiState.textChat.options?.bubbles?.response?.links?.color?.hover || `#4183c4`;
86617
- 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);
86618
86756
  const cssRules = [
86619
86757
  `a {
86620
86758
  color: ${linkColor}!important;
@@ -86753,7 +86891,7 @@
86753
86891
  `code {
86754
86892
  background-color: ${responseBubbleCodeBackgroundColor}!important;
86755
86893
  border-radius: 3px!important;
86756
- border: 1px solid #DDD!important;
86894
+ border: 1px solid ${responseBubbleCodeBorderColor}!important;
86757
86895
  font-family: Consolas, "Liberation Mono", Courier, monospace!important;
86758
86896
  margin: 0 2px!important;
86759
86897
  padding: 0 5px!important;
@@ -86767,7 +86905,7 @@
86767
86905
  `pre {
86768
86906
  background-color: ${responseBubbleCodeBackgroundColor}!important;
86769
86907
  border-radius: 3px!important;
86770
- border: 1px solid #DDD!important;
86908
+ border: 1px solid ${responseBubbleCodeBorderColor}!important;
86771
86909
  font-family: Consolas, "Liberation Mono", Courier, monospace!important;
86772
86910
  padding: 10px!important;
86773
86911
  white-space: pre-line!important;
@@ -86807,19 +86945,19 @@
86807
86945
  }`,
86808
86946
  `table > thead > tr > th {
86809
86947
  padding: 4px!important;
86810
- border-top: 1px solid #b7b5b5!important;
86948
+ border-top: 1px solid ${tableBorderColor}!important;
86811
86949
  }`,
86812
86950
  `table > tbody > tr > th {
86813
86951
  padding: 4px!important;
86814
- border-top: 1px solid #b7b5b5!important;
86952
+ border-top: 1px solid ${tableBorderColor}!important;
86815
86953
  }`,
86816
86954
  `table > thead > tr > td {
86817
86955
  padding: 4px!important;
86818
- border-top: 1px solid #b7b5b5!important;
86956
+ border-top: 1px solid ${tableBorderColor}!important;
86819
86957
  }`,
86820
86958
  `table > tbody > tr > td {
86821
86959
  padding: 4px;
86822
- border-top: 1px solid #b7b5b5!important;
86960
+ border-top: 1px solid ${tableBorderColor}!important;
86823
86961
  }`,
86824
86962
  `strong {
86825
86963
  font-weight: bold!important;
@@ -86828,11 +86966,18 @@
86828
86966
  font-style: italic!important;
86829
86967
  }`,
86830
86968
  `sup.footnote-ref{
86831
- background: ${footerLinkBgColor};
86969
+ background: ${learnMoreLinkNumberBackgroundColor};
86832
86970
  padding: 1px;
86833
86971
  border-radius: 4px;
86834
86972
  position: relative;
86835
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};
86836
86981
  }`,
86837
86982
  `.footnotes{
86838
86983
  padding-top: 10px;
@@ -86849,13 +86994,19 @@
86849
86994
  `.footnote-item {
86850
86995
  position: relative;
86851
86996
  display: inline-block;
86852
- border-radius: 4px;
86997
+ border-radius: ${learnMoreTopLeftBorderRadius}px ${learnMoreTopRightBorderRadius}px ${learnMoreBottomRightBorderRadius}px ${learnMoreBottomLeftBorderRadius}px;
86853
86998
  cursor: pointer;
86854
- border: 1px solid ${footerLinkBgColor};
86999
+ border: 1px solid ${learnMoreLinkBorderColor};
86855
87000
  margin-bottom:4px;
87001
+ background-color: ${learnMoreLinkBackgroundColor};
86856
87002
  }`,
86857
87003
  `.footnote-item:hover {
86858
- 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};
86859
87010
  }`,
86860
87011
  `.footnote-item p {
86861
87012
  margin-top: 0;
@@ -86872,17 +87023,23 @@
86872
87023
  counter-increment: list-counter;
86873
87024
  content: counter(list-counter);
86874
87025
  padding: 4px 4px;
86875
- background-color: ${footerLinkBgColor};
86876
- 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;
86877
87029
  display: inline-block;
86878
- min-width: 18px;
87030
+ min-width: 28px;
86879
87031
  text-align: center;
86880
87032
  color: ${linkColor}!important;
86881
87033
  }`,
86882
87034
  `.footnotes-list>.footnote-item:hover::before {
86883
87035
  color: ${linkHoverColor}!important;
87036
+ background-color: ${learnMoreLinkNumberHoverBackgroundColor};
86884
87037
  }`,
86885
- `.footnotes-sep{
87038
+ `.footnotes-list>.footnote-item:active::before {
87039
+ color: ${linkHoverColor}!important;
87040
+ background-color: ${learnMoreLinkNumberActiveBackgroundColor};
87041
+ }`,
87042
+ `.footnotes-sep {
86886
87043
  display: none!important;
86887
87044
  }`,
86888
87045
  `.scroll-table {
@@ -86964,7 +87121,7 @@
86964
87121
  keyFrames += getStyleSheetMarker() + ".alan-overlay-popup:hover .alan-overlay-popup__ok{opacity:1;transition:opacity 300ms ease-in-out;}";
86965
87122
  keyFrames += getStyleSheetMarker() + generateKeyFrame("alan-gradient", "0%{backgroundPosition: 0 0;}50%{backgroundPosition: -100% 0;}100%{backgroundPosition: 0 0;}");
86966
87123
  keyFrames += getStyleSheetMarker() + generateKeyFrame("alan-pulsating", "0%{transform: scale(1.11111);}50%{transform: scale(1.0);}100%{transform: scale(1.11111);}");
86967
- 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) }");
86968
87125
  keyFrames += getStyleSheetMarker() + generateKeyFrame("alan-mic-pulsating", "0%{transform: scale(0.91);}50%{transform: scale(1.0);}100%{transform: scale(0.91);}");
86969
87126
  keyFrames += getStyleSheetMarker() + generateKeyFrame("alan-triangle-mic-pulsating", "0%{transform: scale(0.94);}50%{transform: scale(1.0);}100%{transform: scale(0.94);}");
86970
87127
  keyFrames += getStyleSheetMarker() + generateKeyFrame("alan-fade-in", "0%{opacity: 0;}100%{opacity:1;}");
@@ -87123,13 +87280,13 @@
87123
87280
 
87124
87281
  // alan_btn/src/textChat/highlightJs.ts
87125
87282
  window.hljs = es_default;
87126
- var hljsWasInit = false;
87127
- function initHighlightJs() {
87128
- if (hljsWasInit)
87283
+ var hljsTheme = false;
87284
+ function initHighlightJs(theme) {
87285
+ if (hljsTheme === theme)
87129
87286
  return;
87130
- hljsWasInit = true;
87287
+ hljsTheme = theme;
87131
87288
  var style = document.createElement("style");
87132
- style.textContent = highlightJsCss();
87289
+ style.textContent = highlightJsCss(theme);
87133
87290
  document.getElementsByTagName("head")[0].appendChild(style);
87134
87291
  }
87135
87292
  function highlightCode(msgsHolder) {
@@ -87144,8 +87301,8 @@
87144
87301
  });
87145
87302
  }
87146
87303
  }
87147
- function highlightJsCss() {
87148
- return `
87304
+ function highlightJsCss(theme) {
87305
+ const lightTheme = `
87149
87306
  pre code.hljs {
87150
87307
  display: block;
87151
87308
  overflow-x: auto;
@@ -87264,6 +87421,130 @@
87264
87421
  /* purposely ignored */
87265
87422
 
87266
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];
87267
87548
  }
87268
87549
 
87269
87550
  // node_modules/dont-crop/dist/mjs/linearRegression.js
@@ -87400,7 +87681,7 @@
87400
87681
  if (button.setVisualState) {
87401
87682
  resultBtn += ` data-alan-button-set-visual-state="${encodeValueForHtmlAttr(button.setVisualState)}" `;
87402
87683
  }
87403
- resultBtn += ` >${button.label}</div>`;
87684
+ resultBtn += ` >${button.html || button.label}</div>`;
87404
87685
  return resultBtn;
87405
87686
  }).join("") || ""}</div>`;
87406
87687
  }
@@ -87540,7 +87821,7 @@
87540
87821
 
87541
87822
  // alan_btn/alan_btn.ts
87542
87823
  (function(ns) {
87543
- uiState.lib.version = "alan-version.1.8.60".replace("alan-version.", "");
87824
+ uiState.lib.version = "alan-version.1.8.61".replace("alan-version.", "");
87544
87825
  if (window.alanBtn) {
87545
87826
  console.warn("Alan: the Alan Button source code has already added (v." + uiState.lib.version + ")");
87546
87827
  }
@@ -87655,6 +87936,19 @@
87655
87936
  },
87656
87937
  isAudioOutputEnabled: () => {
87657
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();
87658
87952
  }
87659
87953
  },
87660
87954
  //deprecated
@@ -88534,7 +88828,7 @@
88534
88828
  onresizeDebounced({});
88535
88829
  if (!(uiState.textChat.expanded || uiState.textChat.inlined)) {
88536
88830
  var chatHolderRect = chatHolderDiv.getBoundingClientRect();
88537
- fixTextChatSizeIfNeeded(chatHolderRect.width, chatHolderRect.height, false);
88831
+ fixTextChatSizeIfNeeded(chatHolderRect.width, chatHolderRect.height);
88538
88832
  }
88539
88833
  };
88540
88834
  var initialPermissionWasAsked = false;
@@ -88656,7 +88950,7 @@
88656
88950
  continueWithAudio = false;
88657
88951
  if (textChatIsHidden) {
88658
88952
  sendClientEvent({ buttonClicked: true });
88659
- fixTextChatSizeIfNeeded(getTextChatSizeAfterResize("width"), getTextChatSizeAfterResize("height"), true);
88953
+ fixTextChatSizeIfNeeded(getTextChatSizeAfterResize("width"), getTextChatSizeAfterResize("height"));
88660
88954
  showTextChat();
88661
88955
  setTextChatPosition(chatHolderDiv);
88662
88956
  }
@@ -89044,6 +89338,11 @@
89044
89338
  if (data && data.web && data.web.chatOptions?.textChat?.enabled === true) {
89045
89339
  uiState.textChat.available = true;
89046
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
+ }
89047
89346
  uiState.textChat.options = data.web.chatOptions?.textChat;
89048
89347
  if (getVoiceEnabledFlag() !== data.web.chatOptions?.textChat?.audio?.enabled) {
89049
89348
  if (data.web.chatOptions?.textChat?.audio?.enabled) {
@@ -89674,7 +89973,6 @@
89674
89973
  function buildMsgContent(msg) {
89675
89974
  return `${buildImagesContent(msg)}${buildMsgTextContent(msg)}${buildLinksContent(msg)}${buildCommandsBlock(msg)}${buildMsgIncommingLoader(msg)}`;
89676
89975
  }
89677
- initHighlightJs();
89678
89976
  initMathJax(textChatMessages.length, (i2) => getMsgElForMathJax(i2));
89679
89977
  document.addEventListener("click", (e) => {
89680
89978
  let clickedEl = e.target;
@@ -89708,9 +90006,12 @@ ${LEARN_MORE_LABEL}
89708
90006
  }
89709
90007
  function getMsgBubbleLabel(msg) {
89710
90008
  if (msg.type === "request" || msg.type === "response") {
90009
+ const isResponse = msg.type === "response";
89711
90010
  const requestLabel = uiState?.textChat?.options?.bubbles?.request?.label?.text || "Me";
89712
90011
  const responseLabel = uiState?.textChat?.options?.bubbles?.response?.label?.text || "Alan";
89713
- 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>`;
89714
90015
  return msgLabel;
89715
90016
  }
89716
90017
  return "";
@@ -89908,7 +90209,7 @@ ${LEARN_MORE_LABEL}
89908
90209
  }
89909
90210
  }
89910
90211
  }
89911
- function onClearChatClick() {
90212
+ function clearTextChat() {
89912
90213
  clearDialogId();
89913
90214
  if (window.tutorProject) {
89914
90215
  window.tutorProject.close();
@@ -90046,6 +90347,70 @@ ${LEARN_MORE_LABEL}
90046
90347
  textareaHolder.classList.remove("ready-to-send");
90047
90348
  }
90048
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
+ }
90049
90414
  }
90050
90415
  function getRestoreMsgsLsKey() {
90051
90416
  const projectId = getProjectId();
@@ -90125,7 +90490,8 @@ ${LEARN_MORE_LABEL}
90125
90490
  }
90126
90491
  const goToPrev = keyCode === 38;
90127
90492
  const goToNext = keyCode === 40;
90128
- if (goToPrev || goToNext) {
90493
+ const isMultiline = uiState.textChat.options?.textarea?.fieldType === "multi-line";
90494
+ if (!isMultiline && (goToPrev || goToNext)) {
90129
90495
  switchMessages(keyCode);
90130
90496
  e.stopPropagation();
90131
90497
  e.preventDefault();
@@ -90200,6 +90566,16 @@ ${LEARN_MORE_LABEL}
90200
90566
  parentEl.children[0].classList.add("alan-btn__chat-enter-full-screen-mode");
90201
90567
  parentEl.children[1].classList.add("alan-btn__chat-exit-full-screen-mode");
90202
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
+ }
90203
90579
  function initTextChat() {
90204
90580
  var textareaDiv = document.getElementById("textarea-holder");
90205
90581
  var textareaInnerDiv = document.getElementById("textarea-inner-holder");
@@ -90215,6 +90591,7 @@ ${LEARN_MORE_LABEL}
90215
90591
  var leftHeaderIconsHolder = document.getElementById("chat-header-left-icons");
90216
90592
  var closeChatBtnImg = document.getElementById("alan-btn-chat-close-btn");
90217
90593
  var expandCollapseChatBtnImg = document.getElementById("alan-btn-expand-collapse-chat-btn");
90594
+ const isMultiline = uiState.textChat.options?.textarea?.fieldType === "multi-line";
90218
90595
  if (!chatDivWrapper.classList.contains("alan-btn__chat")) {
90219
90596
  document.addEventListener("touchstart", keyboardScrollFixListenerForChat, { passive: false });
90220
90597
  if (isInlinedMode()) {
@@ -90242,7 +90619,7 @@ ${LEARN_MORE_LABEL}
90242
90619
  headerInnerDiv = createDiv({ id: "chat-header-inner", class: "alan-btn__chat-header-inner" });
90243
90620
  var headerDivGr = createDiv({ class: "alan-btn__chat-header-gradient" });
90244
90621
  var clearChatBtn = createDivWithSvg(chatIcons.clear, { id: "clear-chat-btn", class: "alan-btn__chat-clear-btn" });
90245
- clearChatBtn.addEventListener("click", onClearChatClick);
90622
+ clearChatBtn.addEventListener("click", clearTextChat);
90246
90623
  headerTille = document.createElement("span");
90247
90624
  headerTille.id = "chat-header-title";
90248
90625
  headerTille.classList.add("alan-btn__chat-header-title");
@@ -90266,18 +90643,13 @@ ${LEARN_MORE_LABEL}
90266
90643
  headerInnerDiv.appendChild(headerTille);
90267
90644
  headerInnerDiv.appendChild(rightHeaderIconsHolder);
90268
90645
  headerDiv.appendChild(headerInnerDiv);
90269
- fillSideBarContent(chatSideBar, { onClearChatClick, expandCollapseChatSidePanel, closeTextChat });
90646
+ fillSideBarContent(chatSideBar, { clearTextChat, expandCollapseChatSidePanel, closeTextChat });
90270
90647
  textareaInnerDiv = createDiv({ id: "textarea-inner-holder", class: "alan-btn__chat-textarea-inner-holder" });
90271
90648
  textareaHolderDiv = createDiv({ id: "textarea-holder-content", class: "alan-btn__chat-textarea-holder-outer-content" });
90272
90649
  textareaDiv = createDiv({ id: "textarea-holder", class: "alan-btn__chat-textarea-holder" });
90273
90650
  var textareaDivGr = document.createElement("div");
90274
90651
  textareaDivGr.classList.add("alan-btn__chat-textarea-holder-gradient");
90275
- chatTextarea = document.createElement("input");
90276
- chatTextarea.id = "chatTextarea";
90277
- chatTextarea.setAttribute("autocomplete", "off");
90278
- chatTextarea.classList.add("alan-btn__chat-textarea");
90279
- chatTextarea.addEventListener("keydown", onChatTextAreaKeyDown);
90280
- chatTextarea.addEventListener("keyup", onChatTextAreaKeyUp);
90652
+ chatTextarea = createTextInputNode(isMultiline ? "textarea" : "input");
90281
90653
  chatSendBtn = document.createElement("div");
90282
90654
  chatSendBtn.id = "chat-send-btn";
90283
90655
  chatSendBtn.classList.add("alan-btn__chat-send-btn");
@@ -90293,10 +90665,23 @@ ${LEARN_MORE_LABEL}
90293
90665
  chatDiv.appendChild(headerDivGr);
90294
90666
  chatHolderDiv.classList.add("alan-btn__chat-holder");
90295
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
+ });
90296
90681
  if (headerTille) {
90682
+ const icon = uiState.textChat.options?.header?.icon?.svg;
90297
90683
  const title = uiState.textChat.options?.header?.label || "Alan AI Assistant";
90298
- headerTille.innerText = title;
90299
- 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>`;
90300
90685
  }
90301
90686
  if (closeChatBtnImg) {
90302
90687
  closeChatBtnImg.innerHTML = getCloseChatIcon(uiState.textChat.options);
@@ -90316,6 +90701,7 @@ ${LEARN_MORE_LABEL}
90316
90701
  chatMicBtn.id = "chat-mic-btn";
90317
90702
  chatMicBtn.addEventListener("click", () => {
90318
90703
  chatTextarea.value = "";
90704
+ resizeTextArea();
90319
90705
  textareaDiv.classList.remove("show-gradient");
90320
90706
  if (!isAlanActive) {
90321
90707
  disableVoiceEnabledBtn();
@@ -90431,13 +90817,21 @@ ${LEARN_MORE_LABEL}
90431
90817
  }
90432
90818
  function expandCollapseTextChat() {
90433
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) {
90434
90827
  uiState.textChat.expanded = true;
90435
90828
  openChatInFullScreen(chatHolderDiv);
90436
- } else {
90437
- uiState.textChat.expanded = false;
90438
- chatHolderDiv.classList.remove("alan-btn_text-chat-full-screen");
90439
90829
  }
90440
90830
  }
90831
+ function exitFullScreenModeForTextChat() {
90832
+ uiState.textChat.expanded = false;
90833
+ chatHolderDiv.classList.remove("alan-btn_text-chat-full-screen");
90834
+ }
90441
90835
  function getVoiceEnabledFlagLocalStorageKey() {
90442
90836
  return `alan-btn-text-chat__text-to-speach-voice-enabled__for-projectId-${getProjectId()}`;
90443
90837
  }
@@ -90925,6 +91319,7 @@ ${LEARN_MORE_LABEL}
90925
91319
  btn.appendChild(chatNotificationsBubble);
90926
91320
  }
90927
91321
  rootEl.appendChild(chatHolderDiv);
91322
+ resizeTextArea();
90928
91323
  btnDisabled = false;
90929
91324
  }
90930
91325
  function hideBtn() {
@@ -91214,7 +91609,10 @@ ${LEARN_MORE_LABEL}
91214
91609
  }
91215
91610
  if (!isMobile()) {
91216
91611
  chatHolderDiv.addEventListener("mousedown", onMouseDownForResizeTextChat);
91217
- chatHolderDiv.addEventListener("mousemove", onMouseHoverForResizeTextChat);
91612
+ chatHolderDiv.addEventListener("mousemove", (e) => {
91613
+ onMouseHoverForResizeTextChat(e);
91614
+ resizeTextAreaDebounced();
91615
+ });
91218
91616
  chatHolderDiv.addEventListener("mouseleave", onMouseHoverForResizeTextChat);
91219
91617
  document.addEventListener("mouseup", onMouseUpForResizeTextChat, true);
91220
91618
  document.addEventListener("mousemove", onMouseMoveForResizeTextChat, true);