@alan-ai/alan-sdk-web 1.8.69 → 1.8.71

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
@@ -341,7 +341,7 @@
341
341
  this._cleanups.push(f);
342
342
  };
343
343
 
344
- function fillAuth(values, ext) {
344
+ function fillAuth(values, ext, config) {
345
345
  var auth = {};
346
346
  for (var k in ext) {
347
347
  auth[k] = ext[k];
@@ -363,6 +363,10 @@
363
363
  if (ext && ext.appName) {
364
364
  auth.appName = ext.appName;
365
365
  }
366
+
367
+ if (auth && auth.withEdgeUrl) {
368
+ auth.edgeUrl = config ? config.url : undefined;
369
+ }
366
370
  return auth;
367
371
  }
368
372
 
@@ -384,7 +388,7 @@
384
388
  throw new Error("Wrong projectId was provided: ", projectId);
385
389
  }
386
390
 
387
- connect._worker.postMessage(["connectProject", connect._config, fillAuth(auth, ext), mode]);
391
+ connect._worker.postMessage(["connectProject", connect._config, fillAuth(auth, ext, connect._config), mode]);
388
392
  function signupEvent(name, handler) {
389
393
  alanAudio.on(name, handler);
390
394
  connect._addCleanup(function() {
@@ -429,7 +433,7 @@
429
433
  throw new Error("Wrong projectId was provided");
430
434
  }
431
435
 
432
- connect._worker.postMessage(["connectProject", connect._config, fillAuth(auth, ext), mode]);
436
+ connect._worker.postMessage(["connectProject", connect._config, fillAuth(auth, ext, connect._config), mode]);
433
437
  function signupEvent(name, handler) {
434
438
  alanAudio.on(name, handler);
435
439
  connect._addCleanup(function() {
@@ -89462,7 +89466,7 @@
89462
89466
  expanded: false,
89463
89467
  inlined: false,
89464
89468
  options: null,
89465
- loaderTimeoutMs: 18e4,
89469
+ loaderTimeoutMs: 18e5,
89466
89470
  defaults: {
89467
89471
  minChatWidth: 250,
89468
89472
  appearAnimationMs: 200,
@@ -89474,6 +89478,131 @@
89474
89478
  }
89475
89479
  };
89476
89480
 
89481
+ // alan_btn/src/assets/chatIcons.ts
89482
+ var chatIcons = {
89483
+ toogleChatSideBar: '<svg fill="#000000" width="24px" height="24px" viewBox="0 0 32 32" id="icon" xmlns="http://www.w3.org/2000/svg"><defs><style>.cls-1{fill:none;}</style></defs><path d="M28,4H4A2,2,0,0,0,2,6V26a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V6A2,2,0,0,0,28,4ZM4,6h6V26H4ZM28,26H12V6H28Z"/><rect id="_Transparent_Rectangle_" data-name="&lt;Transparent Rectangle&gt;" class="cls-1" width="32" height="32"/></svg>',
89484
+ closeChat: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
89485
+ <path d="M18.7071 6.70711C19.0976 6.31658 19.0976 5.68342 18.7071 5.29289C18.3166 4.90237 17.6834 4.90237 17.2929 5.29289L12 10.5858L6.70711 5.29289C6.31658 4.90237 5.68342 4.90237 5.29289 5.29289C4.90237 5.68342 4.90237 6.31658 5.29289 6.70711L10.5858 12L5.29289 17.2929C4.90237 17.6834 4.90237 18.3166 5.29289 18.7071C5.68342 19.0976 6.31658 19.0976 6.70711 18.7071L12 13.4142L17.2929 18.7071C17.6834 19.0976 18.3166 19.0976 18.7071 18.7071C19.0976 18.3166 19.0976 17.6834 18.7071 17.2929L13.4142 12L18.7071 6.70711Z" fill="#969EB0"/>
89486
+ </svg>
89487
+ `,
89488
+ plus: `<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
89489
+ <path d="M4 12H20M12 4V20" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
89490
+ </svg>`,
89491
+ clear: `
89492
+ <svg width="28" height="26" viewBox="0 0 28 26" fill="none" xmlns="http://www.w3.org/2000/svg">
89493
+ <path class="alan-chat__plus-icon" fill-rule="evenodd" clip-rule="evenodd" d="M20.4167 13C16.8728 13 14 15.8728 14 19.4167C14 22.9605 16.8728 25.8333 20.4167 25.8333C23.9605 25.8333 26.8333 22.9605 26.8333 19.4167C26.8333 15.8728 23.9605 13 20.4167 13ZM20.4167 16.5C20.7388 16.5 21 16.7612 21 17.0833V18.8333H22.75C23.0722 18.8333 23.3333 19.0945 23.3333 19.4167C23.3333 19.7388 23.0722 20 22.75 20H21V21.75C21 22.0722 20.7388 22.3333 20.4167 22.3333C20.0945 22.3333 19.8333 22.0722 19.8333 21.75V20H18.0833C17.7612 20 17.5 19.7388 17.5 19.4167C17.5 19.0945 17.7612 18.8333 18.0833 18.8333H19.8333V17.0833C19.8333 16.7612 20.0945 16.5 20.4167 16.5Z"/>
89494
+ <path class="alan-chat__dialog-icon" fill-rule="evenodd" clip-rule="evenodd" d="M2.75006 13.375C2.75006 6.81661 8.06668 1.5 14.625 1.5C21.1834 1.5 26.5 6.81661 26.5 13.375C26.5 19.9334 21.1835 25.25 14.625 25.25C13.123 25.25 11.6833 24.9705 10.3571 24.4596C10.2434 24.4158 10.1776 24.3905 10.129 24.373C10.1231 24.3709 10.1179 24.3691 10.1136 24.3676L10.1085 24.368C10.0689 24.371 10.015 24.3765 9.91179 24.3871L3.46809 25.0532C3.20038 25.081 2.9211 25.1099 2.6875 25.1126C2.45533 25.1154 2.03684 25.1022 1.63558 24.8574C1.16523 24.5705 0.844876 24.0912 0.759601 23.547C0.686851 23.0826 0.834701 22.6909 0.925976 22.4774C1.01781 22.2626 1.15134 22.0156 1.27931 21.7787L3.34416 17.9569C3.43349 17.7915 3.48124 17.7025 3.51336 17.6363C3.51505 17.6329 3.51661 17.6295 3.51805 17.6265C3.51564 17.6179 3.51273 17.6076 3.5092 17.5958C3.48214 17.5041 3.44049 17.3799 3.36975 17.17C2.96755 15.9768 2.75006 14.7 2.75006 13.375Z" stroke-width="1.25"/>
89495
+ </svg>
89496
+ `,
89497
+ resizer: {
89498
+ left: `<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
89499
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M13.7266 0.273364C14.0911 0.63786 14.0911 1.22881 13.7266 1.59331L1.59331 13.7266C1.22881 14.0911 0.63786 14.0911 0.273364 13.7266C-0.0911215 13.3622 -0.0911215 12.7712 0.273364 12.4067L12.4067 0.273364C12.7712 -0.0911215 13.3622 -0.0911215 13.7266 0.273364ZM13.7266 6.80672C14.0911 7.17119 14.0911 7.76217 13.7266 8.12664L8.12664 13.7266C7.76217 14.0911 7.17119 14.0911 6.80672 13.7266C6.44225 13.3622 6.44225 12.7712 6.80672 12.4067L12.4067 6.80672C12.7712 6.44225 13.3622 6.44225 13.7266 6.80672Z" fill="#CCD4DD"/>
89500
+ </svg>
89501
+ `,
89502
+ right: `<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
89503
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M13.7266 0.273364C14.0911 0.63786 14.0911 1.22881 13.7266 1.59331L1.59331 13.7266C1.22881 14.0911 0.63786 14.0911 0.273364 13.7266C-0.0911215 13.3622 -0.0911215 12.7712 0.273364 12.4067L12.4067 0.273364C12.7712 -0.0911215 13.3622 -0.0911215 13.7266 0.273364ZM13.7266 6.80672C14.0911 7.17119 14.0911 7.76217 13.7266 8.12664L8.12664 13.7266C7.76217 14.0911 7.17119 14.0911 6.80672 13.7266C6.44225 13.3622 6.44225 12.7712 6.80672 12.4067L12.4067 6.80672C12.7712 6.44225 13.3622 6.44225 13.7266 6.80672Z" fill="#CCD4DD"/>
89504
+ </svg>
89505
+ `
89506
+ },
89507
+ send: `
89508
+ <svg width="44" height="28" viewBox="0 0 44 28" fill="none" xmlns="http://www.w3.org/2000/svg">
89509
+ <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"/>
89510
+ </svg>
89511
+ `,
89512
+ stopResponse: `
89513
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
89514
+ <path d="M6.38461 8.38458C6.38461 7.28001 7.28004 6.38458 8.38461 6.38458H13.6154C14.72 6.38458 15.6154 7.28001 15.6154 8.38458V13.6154C15.6154 14.7199 14.72 15.6154 13.6154 15.6154H8.38461C7.28004 15.6154 6.38461 14.7199 6.38461 13.6154V8.38458Z" stroke="black"/>
89515
+ <circle cx="11" cy="11" r="10" stroke="black"/>
89516
+ </svg>
89517
+
89518
+ `,
89519
+ mic: `
89520
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
89521
+ <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"/>
89522
+ </svg>
89523
+ `,
89524
+ micPlayingBars: `<div class="alan-text-chat__animated-btn-bars">
89525
+ <div class="alan-text-chat__bar alan-text-chat__bar-1"></div>
89526
+ <div class="alan-text-chat__bar alan-text-chat__bar-2"></div>
89527
+ <div class="alan-text-chat__bar alan-text-chat__bar-3"></div>
89528
+ <div class="alan-text-chat__bar alan-text-chat__bar-3"></div>
89529
+ <div class="alan-text-chat__bar alan-text-chat__bar-2"></div>
89530
+ <div class="alan-text-chat__bar alan-text-chat__bar-1"></div>
89531
+ </div>
89532
+ `,
89533
+ noMic: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
89534
+ <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"/>
89535
+ </svg>
89536
+ `,
89537
+ 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">
89538
+ <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"/>
89539
+ </svg>
89540
+ `,
89541
+ noWiFi: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
89542
+ <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"/>
89543
+ </svg>
89544
+ `,
89545
+ mute: `
89546
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
89547
+ <path d="M18.3346 7.49998L13.3346 12.5M13.3346 7.49998L18.3346 12.5M8.0299 3.63805L5.39183 6.27612C5.2477 6.42025 5.17564 6.49231 5.09154 6.54385C5.01698 6.58954 4.93569 6.62321 4.85066 6.64362C4.75476 6.66665 4.65284 6.66665 4.44902 6.66665H3.0013C2.53459 6.66665 2.30124 6.66665 2.12298 6.75747C1.96617 6.83737 1.83869 6.96485 1.7588 7.12165C1.66797 7.29991 1.66797 7.53327 1.66797 7.99998V12C1.66797 12.4667 1.66797 12.7 1.7588 12.8783C1.83869 13.0351 1.96617 13.1626 2.12298 13.2425C2.30124 13.3333 2.53459 13.3333 3.0013 13.3333H4.44902C4.65284 13.3333 4.75476 13.3333 4.85066 13.3563C4.93569 13.3768 5.01698 13.4104 5.09154 13.4561C5.17564 13.5076 5.2477 13.5797 5.39183 13.7238L8.0299 16.3619C8.38688 16.7189 8.56537 16.8974 8.71861 16.9094C8.85158 16.9199 8.98152 16.8661 9.06814 16.7647C9.16797 16.6478 9.16797 16.3954 9.16797 15.8905V4.10946C9.16797 3.60461 9.16797 3.35219 9.06814 3.2353C8.98152 3.13388 8.85158 3.08006 8.71861 3.09052C8.56537 3.10258 8.38688 3.28107 8.0299 3.63805Z" stroke="#969EB0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
89548
+ </svg>`,
89549
+ unmute: `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
89550
+ <path d="M16.4559 4.16665C17.637 5.80851 18.3327 7.82301 18.3327 9.99998C18.3327 12.177 17.637 14.1914 16.4559 15.8333M13.1204 6.66665C13.7795 7.61151 14.166 8.76061 14.166 9.99998C14.166 11.2394 13.7795 12.3885 13.1204 13.3333M8.02795 3.63805L5.38987 6.27612C5.24575 6.42025 5.17368 6.49231 5.08959 6.54385C5.01503 6.58954 4.93374 6.62321 4.84871 6.64362C4.7528 6.66665 4.65089 6.66665 4.44706 6.66665H2.99935C2.53264 6.66665 2.29928 6.66665 2.12102 6.75747C1.96422 6.83737 1.83674 6.96485 1.75684 7.12165C1.66602 7.29991 1.66602 7.53327 1.66602 7.99998V12C1.66602 12.4667 1.66602 12.7 1.75684 12.8783C1.83674 13.0351 1.96422 13.1626 2.12102 13.2425C2.29928 13.3333 2.53264 13.3333 2.99935 13.3333H4.44706C4.65089 13.3333 4.7528 13.3333 4.84871 13.3563C4.93374 13.3768 5.01503 13.4104 5.08959 13.4561C5.17368 13.5076 5.24575 13.5797 5.38987 13.7238L8.02794 16.3619C8.38492 16.7189 8.56342 16.8974 8.71666 16.9094C8.84962 16.9199 8.97956 16.8661 9.06618 16.7647C9.16602 16.6478 9.16602 16.3954 9.16602 15.8905V4.10946C9.16602 3.60461 9.16602 3.35219 9.06618 3.2353C8.97956 3.13388 8.84962 3.08006 8.71666 3.09052C8.56342 3.10258 8.38492 3.28107 8.02795 3.63805Z" stroke="#969EB0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
89551
+ </svg>
89552
+ `,
89553
+ like: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16.5 5.202c0-2.442-1.14-4.198-3.007-4.198-1.026 0-1.378.601-1.746 2-.075.288-.112.429-.151.567-.101.36-.277.97-.527 1.831a.25.25 0 0 1-.03.065L8.174 9.953a5.884 5.884 0 0 1-2.855 2.327l-.473.18a2.75 2.75 0 0 0-1.716 3.092l.404 2.087a3.25 3.25 0 0 0 2.417 2.537l7.628 1.87a4.75 4.75 0 0 0 5.733-3.44l1.415-5.549a3.25 3.25 0 0 0-3.15-4.053h-1.822c.496-1.633.746-2.893.746-3.802ZM4.6 15.267a1.25 1.25 0 0 1 .78-1.405l.474-.182a7.385 7.385 0 0 0 3.582-2.92l2.867-4.485c.09-.14.159-.294.205-.455.252-.865.428-1.479.53-1.842.044-.154.085-.31.159-.593.19-.722.283-.881.295-.881.868 0 1.507.984 1.507 2.698 0 .885-.326 2.336-.984 4.315a.75.75 0 0 0 .711.987h2.85a1.751 1.751 0 0 1 1.696 2.182l-1.415 5.55a3.25 3.25 0 0 1-3.923 2.353l-7.628-1.87a1.75 1.75 0 0 1-1.301-1.366L4.6 15.267Z"></path></svg>`,
89554
+ likeSelected: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.056 9.004c.46-1.427.693-2.677.693-3.754 0-2.398-.939-4.247-2.5-4.247-.847 0-1.109.504-1.437 1.747.018-.065-.163.634-.215.821-.101.359-.277.97-.527 1.831a.247.247 0 0 1-.03.065L8.174 9.953a5.885 5.885 0 0 1-2.855 2.326l-1.257.482a1.75 1.75 0 0 0-1.092 1.967l.686 3.539a2.25 2.25 0 0 0 1.673 1.757l8.25 2.022a4.75 4.75 0 0 0 5.733-3.44l1.574-6.173a2.75 2.75 0 0 0-2.665-3.43h-3.165Z"></path></svg>`,
89555
+ dislike: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16.5 17.985c0 2.442-1.14 4.199-3.007 4.199-.975 0-1.341-.543-1.69-1.796l-.207-.772c-.101-.359-.277-.97-.527-1.831a.25.25 0 0 0-.03-.065l-2.866-4.486a5.884 5.884 0 0 0-2.855-2.326l-.473-.181A2.75 2.75 0 0 1 3.13 7.634l.404-2.086A3.25 3.25 0 0 1 5.95 3.01l7.628-1.87a4.75 4.75 0 0 1 5.733 3.44l1.415 5.55a3.25 3.25 0 0 1-3.15 4.052h-1.822c.496 1.633.746 2.893.746 3.802ZM4.6 7.92a1.25 1.25 0 0 0 .78 1.406l.474.18a7.385 7.385 0 0 1 3.582 2.92l2.867 4.486c.09.141.159.294.205.455l.552 1.92.212.791c.14.488.21.606.22.606.868 0 1.507-.985 1.507-2.7 0-.884-.326-2.335-.984-4.314a.75.75 0 0 1 .711-.987h2.85a1.75 1.75 0 0 0 1.696-2.182l-1.415-5.55a3.25 3.25 0 0 0-3.923-2.353l-7.628 1.87a1.75 1.75 0 0 0-1.301 1.366L4.6 7.92Z"></path></svg>`,
89556
+ dislikeSelected: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.056 14.183c.46 1.427.693 2.676.693 3.753 0 2.398-.939 4.247-2.5 4.247-.8 0-1.078-.45-1.383-1.546l-.27-1.022c-.1-.358-.276-.97-.526-1.83a.247.247 0 0 0-.03-.066l-2.866-4.485a5.885 5.885 0 0 0-2.855-2.327l-1.257-.481A1.75 1.75 0 0 1 2.97 8.458l.686-3.538a2.25 2.25 0 0 1 1.673-1.758l8.25-2.021a4.75 4.75 0 0 1 5.733 3.44l1.574 6.172a2.75 2.75 0 0 1-2.665 3.43h-3.165Z"></path></svg>`,
89557
+ copy: `<svg class="alan-btn__copy-icon" width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
89558
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5 16.5L19.5 4.5L18.75 3.75H9L8.25 4.5L8.25 7.5L5.25 7.5L4.5 8.25V20.25L5.25 21H15L15.75 20.25V17.25H18.75L19.5 16.5ZM15.75 15.75L15.75 8.25L15 7.5L9.75 7.5V5.25L18 5.25V15.75H15.75ZM6 9L14.25 9L14.25 19.5L6 19.5L6 9Z" fill="#080341"/>
89559
+ </svg>`,
89560
+ copied: `<svg class="alan-btn__copied-icon" width="24px" height="24px" viewBox="0 0 24 24" role="img" xmlns="http://www.w3.org/2000/svg" aria-labelledby="okIconTitle" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none" color="#000000"> <title id="okIconTitle">Copied!</title> <polyline points="4 13 9 18 20 7"/> </svg>`,
89561
+ expandChat: `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
89562
+ <rect x="1.75" y="2.75" width="16.5" height="14.5" rx="1.25" stroke="#969EB0" stroke-width="1.5"/>
89563
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M4.77344 11.0002C5.18765 11.0002 5.52344 11.336 5.52344 11.7502V13.2898C5.52344 13.4002 5.61298 13.4898 5.72344 13.4898L7.2949 13.4898C7.70911 13.4898 8.0449 13.8256 8.0449 14.2398C8.0449 14.654 7.70912 14.9898 7.29491 14.9898L5.27345 14.9898C4.58309 14.9898 4.02344 14.4302 4.02344 13.7398V11.7502C4.02344 11.336 4.35922 11.0002 4.77344 11.0002Z" fill="#969EB0"/>
89564
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M15.25 9C14.8358 9 14.5 8.66421 14.5 8.25V6.71045C14.5 6.6 14.4105 6.51045 14.3 6.51045L12.7285 6.51046C12.3143 6.51047 11.9785 6.17468 11.9785 5.76047C11.9785 5.34625 12.3143 5.01047 12.7285 5.01046L14.75 5.01045C15.4404 5.01045 16 5.57009 16 6.26045V8.25C16 8.66421 15.6642 9 15.25 9Z" fill="#969EB0"/>
89565
+ </svg>`,
89566
+ collapseChat: `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
89567
+ <rect x="1.75" y="2.75" width="16.5" height="14.5" rx="1.25" stroke="#969EB0" stroke-width="1.5"/>
89568
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7.29492 14.9898C6.88071 14.9898 6.54492 14.654 6.54492 14.2398V12.7003C6.54492 12.5898 6.45538 12.5003 6.34492 12.5003L4.77346 12.5003C4.35925 12.5003 4.02346 12.1645 4.02346 11.7503C4.02346 11.3361 4.35924 11.0003 4.77345 11.0003L6.79491 11.0003C7.48527 11.0003 8.04492 11.5599 8.04492 12.2503V14.2398C8.04492 14.654 7.70914 14.9898 7.29492 14.9898Z" fill="#969EB0"/>
89569
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12.7285 5.01044C13.1427 5.01044 13.4785 5.34622 13.4785 5.76044V7.29998C13.4785 7.41044 13.5681 7.49998 13.6785 7.49998L15.25 7.49997C15.6642 7.49997 16 7.83576 16 8.24997C16 8.66418 15.6642 8.99997 15.25 8.99997L13.2285 8.99999C12.5382 8.99999 11.9785 8.44035 11.9785 7.74999V5.76044C11.9785 5.34622 12.3143 5.01044 12.7285 5.01044Z" fill="#969EB0"/>
89570
+ </svg>
89571
+ `,
89572
+ saveChatState: `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
89573
+ <path d="M2.375 12.875C2.375 15.1141 2.375 16.2337 3.07062 16.9294C3.76624 17.625 4.88583 17.625 7.125 17.625H11.875C14.1142 17.625 15.2337 17.625 15.9294 16.9294C16.625 16.2337 16.625 15.1141 16.625 12.875" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
89574
+ <path d="M9.50001 3.375V13.6667M9.50001 13.6667L12.6667 10.2031M9.50001 13.6667L6.33334 10.2031" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
89575
+ </svg>
89576
+ `
89577
+ };
89578
+ function getCloseChatIcon(textChatOptions) {
89579
+ return textChatOptions?.popup?.icons?.close?.svg || chatIcons.closeChat;
89580
+ }
89581
+ function getExpandChatIcon(textChatOptions) {
89582
+ return textChatOptions?.popup?.icons?.fullScreen?.svgExpand || chatIcons.expandChat;
89583
+ }
89584
+ function getCollapseChatIcon(textChatOptions) {
89585
+ return textChatOptions?.popup?.icons?.fullScreen?.svgCollapse || chatIcons.collapseChat;
89586
+ }
89587
+ function getSaveChatStateIcon(textChatOptions) {
89588
+ return textChatOptions?.popup?.icons?.saveChatState?.svg || chatIcons.saveChatState;
89589
+ }
89590
+ function getSendChatIcon(textChatOptions) {
89591
+ return textChatOptions?.popup?.icons?.send?.svg || chatIcons.send;
89592
+ }
89593
+ function getStopChatIcon(textChatOptions) {
89594
+ return textChatOptions?.popup?.icons?.stopResponse?.svg || chatIcons.stopResponse;
89595
+ }
89596
+ function getMicChatIcon(textChatOptions) {
89597
+ return textChatOptions?.popup?.icons?.mic?.svg || chatIcons.mic;
89598
+ }
89599
+ function getMuteChatIcon(textChatOptions) {
89600
+ return textChatOptions?.popup?.icons?.mute?.svgOff || chatIcons.mute;
89601
+ }
89602
+ function getUnmuteChatIcon(textChatOptions) {
89603
+ return textChatOptions?.popup?.icons?.mute?.svgOn || chatIcons.unmute;
89604
+ }
89605
+
89477
89606
  // alan_btn/src/textChat/helpers/getMsgLoader.ts
89478
89607
  function getMsgLoader(textChatOptions, message, onlyLoader) {
89479
89608
  const isQueryProgressEnabled = textChatOptions?.bubbles?.waitingResponse?.queryProgress?.enabled;
@@ -89488,10 +89617,19 @@
89488
89617
  if (onlyLoader) {
89489
89618
  waitingResponseBubbleLabel = "";
89490
89619
  }
89491
- const content = isDefaultLayout ? `${waitingResponseBubbleLabel || ""} <div class="alan-btn__chat-incomming-msg-inner-wrapper ${waitingResponseBubbleLabel === "" ? "" : "with-text"}"><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>` : `<span class="alan-btn__chat-incomming-msg-loader-icon"></span>
89492
- <span class="alan-btn__chat-incomming-msg-loader-label">${waitingResponseBubbleLabel}</span>`;
89620
+ const content = isDefaultLayout ? `<span class="alan-btn__chat-incomming-msg-loader-label-default ${waitingResponseBubbleLabel?.length > 0 ? "with-text" : ""}">
89621
+ ${getMsgStopBtn(textChatOptions, true)}
89622
+ ${waitingResponseBubbleLabel || ""}</span>
89623
+ <div class="alan-btn__chat-incomming-msg-inner-wrapper ${waitingResponseBubbleLabel === "" ? "" : "with-text"}"><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>` : `<span class="alan-btn__chat-incomming-msg-loader-icon alan-btn__chat-stop-response-holder">
89624
+ ${getMsgStopBtn(textChatOptions, false)}
89625
+ </span>
89626
+ <span class="alan-btn__chat-incomming-msg-loader-label">${waitingResponseBubbleLabel}</span>`;
89493
89627
  return `<div class="alan-btn__chat-incomming-msg-wrapper">${content}</div>`;
89494
89628
  }
89629
+ function getMsgStopBtn(textChatOptions, shouldBeWrapped) {
89630
+ const content = `<div class="alan-btn__stop-response-btn">${getStopChatIcon(textChatOptions)}</div>`;
89631
+ return shouldBeWrapped ? `<div class="alan-btn__chat-stop-response-holder">${content}</div>` : content;
89632
+ }
89495
89633
  function capitalize(str) {
89496
89634
  return str.charAt(0).toUpperCase() + str.substring(1);
89497
89635
  }
@@ -89541,6 +89679,13 @@
89541
89679
  let replaceLoader = false;
89542
89680
  let msgInd = null;
89543
89681
  let updateResponse = false;
89682
+ if (msg.type === "connection-separator") {
89683
+ messages.push({ ...msg });
89684
+ return {
89685
+ isNew: true,
89686
+ msgInd: messages.length - 1
89687
+ };
89688
+ }
89544
89689
  const msgReqId = msg.reqId || msg?.ctx?.reqId;
89545
89690
  const msgResponseId = msg?.ctx?.responseId;
89546
89691
  if (msg.type === "response" && msg.name === "loading") {
@@ -89712,121 +89857,6 @@
89712
89857
  return defaultZIndex;
89713
89858
  }
89714
89859
 
89715
- // alan_btn/src/assets/chatIcons.ts
89716
- var chatIcons = {
89717
- toogleChatSideBar: '<svg fill="#000000" width="24px" height="24px" viewBox="0 0 32 32" id="icon" xmlns="http://www.w3.org/2000/svg"><defs><style>.cls-1{fill:none;}</style></defs><path d="M28,4H4A2,2,0,0,0,2,6V26a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V6A2,2,0,0,0,28,4ZM4,6h6V26H4ZM28,26H12V6H28Z"/><rect id="_Transparent_Rectangle_" data-name="&lt;Transparent Rectangle&gt;" class="cls-1" width="32" height="32"/></svg>',
89718
- closeChat: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
89719
- <path d="M18.7071 6.70711C19.0976 6.31658 19.0976 5.68342 18.7071 5.29289C18.3166 4.90237 17.6834 4.90237 17.2929 5.29289L12 10.5858L6.70711 5.29289C6.31658 4.90237 5.68342 4.90237 5.29289 5.29289C4.90237 5.68342 4.90237 6.31658 5.29289 6.70711L10.5858 12L5.29289 17.2929C4.90237 17.6834 4.90237 18.3166 5.29289 18.7071C5.68342 19.0976 6.31658 19.0976 6.70711 18.7071L12 13.4142L17.2929 18.7071C17.6834 19.0976 18.3166 19.0976 18.7071 18.7071C19.0976 18.3166 19.0976 17.6834 18.7071 17.2929L13.4142 12L18.7071 6.70711Z" fill="#969EB0"/>
89720
- </svg>
89721
- `,
89722
- plus: `<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
89723
- <path d="M4 12H20M12 4V20" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
89724
- </svg>`,
89725
- clear: `
89726
- <svg width="28" height="26" viewBox="0 0 28 26" fill="none" xmlns="http://www.w3.org/2000/svg">
89727
- <path class="alan-chat__plus-icon" fill-rule="evenodd" clip-rule="evenodd" d="M20.4167 13C16.8728 13 14 15.8728 14 19.4167C14 22.9605 16.8728 25.8333 20.4167 25.8333C23.9605 25.8333 26.8333 22.9605 26.8333 19.4167C26.8333 15.8728 23.9605 13 20.4167 13ZM20.4167 16.5C20.7388 16.5 21 16.7612 21 17.0833V18.8333H22.75C23.0722 18.8333 23.3333 19.0945 23.3333 19.4167C23.3333 19.7388 23.0722 20 22.75 20H21V21.75C21 22.0722 20.7388 22.3333 20.4167 22.3333C20.0945 22.3333 19.8333 22.0722 19.8333 21.75V20H18.0833C17.7612 20 17.5 19.7388 17.5 19.4167C17.5 19.0945 17.7612 18.8333 18.0833 18.8333H19.8333V17.0833C19.8333 16.7612 20.0945 16.5 20.4167 16.5Z"/>
89728
- <path class="alan-chat__dialog-icon" fill-rule="evenodd" clip-rule="evenodd" d="M2.75006 13.375C2.75006 6.81661 8.06668 1.5 14.625 1.5C21.1834 1.5 26.5 6.81661 26.5 13.375C26.5 19.9334 21.1835 25.25 14.625 25.25C13.123 25.25 11.6833 24.9705 10.3571 24.4596C10.2434 24.4158 10.1776 24.3905 10.129 24.373C10.1231 24.3709 10.1179 24.3691 10.1136 24.3676L10.1085 24.368C10.0689 24.371 10.015 24.3765 9.91179 24.3871L3.46809 25.0532C3.20038 25.081 2.9211 25.1099 2.6875 25.1126C2.45533 25.1154 2.03684 25.1022 1.63558 24.8574C1.16523 24.5705 0.844876 24.0912 0.759601 23.547C0.686851 23.0826 0.834701 22.6909 0.925976 22.4774C1.01781 22.2626 1.15134 22.0156 1.27931 21.7787L3.34416 17.9569C3.43349 17.7915 3.48124 17.7025 3.51336 17.6363C3.51505 17.6329 3.51661 17.6295 3.51805 17.6265C3.51564 17.6179 3.51273 17.6076 3.5092 17.5958C3.48214 17.5041 3.44049 17.3799 3.36975 17.17C2.96755 15.9768 2.75006 14.7 2.75006 13.375Z" stroke-width="1.25"/>
89729
- </svg>
89730
- `,
89731
- resizer: {
89732
- left: `<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
89733
- <path fill-rule="evenodd" clip-rule="evenodd" d="M13.7266 0.273364C14.0911 0.63786 14.0911 1.22881 13.7266 1.59331L1.59331 13.7266C1.22881 14.0911 0.63786 14.0911 0.273364 13.7266C-0.0911215 13.3622 -0.0911215 12.7712 0.273364 12.4067L12.4067 0.273364C12.7712 -0.0911215 13.3622 -0.0911215 13.7266 0.273364ZM13.7266 6.80672C14.0911 7.17119 14.0911 7.76217 13.7266 8.12664L8.12664 13.7266C7.76217 14.0911 7.17119 14.0911 6.80672 13.7266C6.44225 13.3622 6.44225 12.7712 6.80672 12.4067L12.4067 6.80672C12.7712 6.44225 13.3622 6.44225 13.7266 6.80672Z" fill="#CCD4DD"/>
89734
- </svg>
89735
- `,
89736
- right: `<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
89737
- <path fill-rule="evenodd" clip-rule="evenodd" d="M13.7266 0.273364C14.0911 0.63786 14.0911 1.22881 13.7266 1.59331L1.59331 13.7266C1.22881 14.0911 0.63786 14.0911 0.273364 13.7266C-0.0911215 13.3622 -0.0911215 12.7712 0.273364 12.4067L12.4067 0.273364C12.7712 -0.0911215 13.3622 -0.0911215 13.7266 0.273364ZM13.7266 6.80672C14.0911 7.17119 14.0911 7.76217 13.7266 8.12664L8.12664 13.7266C7.76217 14.0911 7.17119 14.0911 6.80672 13.7266C6.44225 13.3622 6.44225 12.7712 6.80672 12.4067L12.4067 6.80672C12.7712 6.44225 13.3622 6.44225 13.7266 6.80672Z" fill="#CCD4DD"/>
89738
- </svg>
89739
- `
89740
- },
89741
- send: `
89742
- <svg width="44" height="28" viewBox="0 0 44 28" fill="none" xmlns="http://www.w3.org/2000/svg">
89743
- <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"/>
89744
- </svg>
89745
- `,
89746
- mic: `
89747
- <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
89748
- <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"/>
89749
- </svg>
89750
- `,
89751
- micPlayingBars: `<div class="alan-text-chat__animated-btn-bars">
89752
- <div class="alan-text-chat__bar alan-text-chat__bar-1"></div>
89753
- <div class="alan-text-chat__bar alan-text-chat__bar-2"></div>
89754
- <div class="alan-text-chat__bar alan-text-chat__bar-3"></div>
89755
- <div class="alan-text-chat__bar alan-text-chat__bar-3"></div>
89756
- <div class="alan-text-chat__bar alan-text-chat__bar-2"></div>
89757
- <div class="alan-text-chat__bar alan-text-chat__bar-1"></div>
89758
- </div>
89759
- `,
89760
- noMic: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
89761
- <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"/>
89762
- </svg>
89763
- `,
89764
- 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">
89765
- <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"/>
89766
- </svg>
89767
- `,
89768
- noWiFi: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
89769
- <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"/>
89770
- </svg>
89771
- `,
89772
- mute: `
89773
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
89774
- <path d="M18.3346 7.49998L13.3346 12.5M13.3346 7.49998L18.3346 12.5M8.0299 3.63805L5.39183 6.27612C5.2477 6.42025 5.17564 6.49231 5.09154 6.54385C5.01698 6.58954 4.93569 6.62321 4.85066 6.64362C4.75476 6.66665 4.65284 6.66665 4.44902 6.66665H3.0013C2.53459 6.66665 2.30124 6.66665 2.12298 6.75747C1.96617 6.83737 1.83869 6.96485 1.7588 7.12165C1.66797 7.29991 1.66797 7.53327 1.66797 7.99998V12C1.66797 12.4667 1.66797 12.7 1.7588 12.8783C1.83869 13.0351 1.96617 13.1626 2.12298 13.2425C2.30124 13.3333 2.53459 13.3333 3.0013 13.3333H4.44902C4.65284 13.3333 4.75476 13.3333 4.85066 13.3563C4.93569 13.3768 5.01698 13.4104 5.09154 13.4561C5.17564 13.5076 5.2477 13.5797 5.39183 13.7238L8.0299 16.3619C8.38688 16.7189 8.56537 16.8974 8.71861 16.9094C8.85158 16.9199 8.98152 16.8661 9.06814 16.7647C9.16797 16.6478 9.16797 16.3954 9.16797 15.8905V4.10946C9.16797 3.60461 9.16797 3.35219 9.06814 3.2353C8.98152 3.13388 8.85158 3.08006 8.71861 3.09052C8.56537 3.10258 8.38688 3.28107 8.0299 3.63805Z" stroke="#969EB0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
89775
- </svg>`,
89776
- unmute: `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
89777
- <path d="M16.4559 4.16665C17.637 5.80851 18.3327 7.82301 18.3327 9.99998C18.3327 12.177 17.637 14.1914 16.4559 15.8333M13.1204 6.66665C13.7795 7.61151 14.166 8.76061 14.166 9.99998C14.166 11.2394 13.7795 12.3885 13.1204 13.3333M8.02795 3.63805L5.38987 6.27612C5.24575 6.42025 5.17368 6.49231 5.08959 6.54385C5.01503 6.58954 4.93374 6.62321 4.84871 6.64362C4.7528 6.66665 4.65089 6.66665 4.44706 6.66665H2.99935C2.53264 6.66665 2.29928 6.66665 2.12102 6.75747C1.96422 6.83737 1.83674 6.96485 1.75684 7.12165C1.66602 7.29991 1.66602 7.53327 1.66602 7.99998V12C1.66602 12.4667 1.66602 12.7 1.75684 12.8783C1.83674 13.0351 1.96422 13.1626 2.12102 13.2425C2.29928 13.3333 2.53264 13.3333 2.99935 13.3333H4.44706C4.65089 13.3333 4.7528 13.3333 4.84871 13.3563C4.93374 13.3768 5.01503 13.4104 5.08959 13.4561C5.17368 13.5076 5.24575 13.5797 5.38987 13.7238L8.02794 16.3619C8.38492 16.7189 8.56342 16.8974 8.71666 16.9094C8.84962 16.9199 8.97956 16.8661 9.06618 16.7647C9.16602 16.6478 9.16602 16.3954 9.16602 15.8905V4.10946C9.16602 3.60461 9.16602 3.35219 9.06618 3.2353C8.97956 3.13388 8.84962 3.08006 8.71666 3.09052C8.56342 3.10258 8.38492 3.28107 8.02795 3.63805Z" stroke="#969EB0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
89778
- </svg>
89779
- `,
89780
- like: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16.5 5.202c0-2.442-1.14-4.198-3.007-4.198-1.026 0-1.378.601-1.746 2-.075.288-.112.429-.151.567-.101.36-.277.97-.527 1.831a.25.25 0 0 1-.03.065L8.174 9.953a5.884 5.884 0 0 1-2.855 2.327l-.473.18a2.75 2.75 0 0 0-1.716 3.092l.404 2.087a3.25 3.25 0 0 0 2.417 2.537l7.628 1.87a4.75 4.75 0 0 0 5.733-3.44l1.415-5.549a3.25 3.25 0 0 0-3.15-4.053h-1.822c.496-1.633.746-2.893.746-3.802ZM4.6 15.267a1.25 1.25 0 0 1 .78-1.405l.474-.182a7.385 7.385 0 0 0 3.582-2.92l2.867-4.485c.09-.14.159-.294.205-.455.252-.865.428-1.479.53-1.842.044-.154.085-.31.159-.593.19-.722.283-.881.295-.881.868 0 1.507.984 1.507 2.698 0 .885-.326 2.336-.984 4.315a.75.75 0 0 0 .711.987h2.85a1.751 1.751 0 0 1 1.696 2.182l-1.415 5.55a3.25 3.25 0 0 1-3.923 2.353l-7.628-1.87a1.75 1.75 0 0 1-1.301-1.366L4.6 15.267Z"></path></svg>`,
89781
- likeSelected: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.056 9.004c.46-1.427.693-2.677.693-3.754 0-2.398-.939-4.247-2.5-4.247-.847 0-1.109.504-1.437 1.747.018-.065-.163.634-.215.821-.101.359-.277.97-.527 1.831a.247.247 0 0 1-.03.065L8.174 9.953a5.885 5.885 0 0 1-2.855 2.326l-1.257.482a1.75 1.75 0 0 0-1.092 1.967l.686 3.539a2.25 2.25 0 0 0 1.673 1.757l8.25 2.022a4.75 4.75 0 0 0 5.733-3.44l1.574-6.173a2.75 2.75 0 0 0-2.665-3.43h-3.165Z"></path></svg>`,
89782
- dislike: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16.5 17.985c0 2.442-1.14 4.199-3.007 4.199-.975 0-1.341-.543-1.69-1.796l-.207-.772c-.101-.359-.277-.97-.527-1.831a.25.25 0 0 0-.03-.065l-2.866-4.486a5.884 5.884 0 0 0-2.855-2.326l-.473-.181A2.75 2.75 0 0 1 3.13 7.634l.404-2.086A3.25 3.25 0 0 1 5.95 3.01l7.628-1.87a4.75 4.75 0 0 1 5.733 3.44l1.415 5.55a3.25 3.25 0 0 1-3.15 4.052h-1.822c.496 1.633.746 2.893.746 3.802ZM4.6 7.92a1.25 1.25 0 0 0 .78 1.406l.474.18a7.385 7.385 0 0 1 3.582 2.92l2.867 4.486c.09.141.159.294.205.455l.552 1.92.212.791c.14.488.21.606.22.606.868 0 1.507-.985 1.507-2.7 0-.884-.326-2.335-.984-4.314a.75.75 0 0 1 .711-.987h2.85a1.75 1.75 0 0 0 1.696-2.182l-1.415-5.55a3.25 3.25 0 0 0-3.923-2.353l-7.628 1.87a1.75 1.75 0 0 0-1.301 1.366L4.6 7.92Z"></path></svg>`,
89783
- dislikeSelected: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.056 14.183c.46 1.427.693 2.676.693 3.753 0 2.398-.939 4.247-2.5 4.247-.8 0-1.078-.45-1.383-1.546l-.27-1.022c-.1-.358-.276-.97-.526-1.83a.247.247 0 0 0-.03-.066l-2.866-4.485a5.885 5.885 0 0 0-2.855-2.327l-1.257-.481A1.75 1.75 0 0 1 2.97 8.458l.686-3.538a2.25 2.25 0 0 1 1.673-1.758l8.25-2.021a4.75 4.75 0 0 1 5.733 3.44l1.574 6.172a2.75 2.75 0 0 1-2.665 3.43h-3.165Z"></path></svg>`,
89784
- copy: `<svg class="alan-btn__copy-icon" width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
89785
- <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5 16.5L19.5 4.5L18.75 3.75H9L8.25 4.5L8.25 7.5L5.25 7.5L4.5 8.25V20.25L5.25 21H15L15.75 20.25V17.25H18.75L19.5 16.5ZM15.75 15.75L15.75 8.25L15 7.5L9.75 7.5V5.25L18 5.25V15.75H15.75ZM6 9L14.25 9L14.25 19.5L6 19.5L6 9Z" fill="#080341"/>
89786
- </svg>`,
89787
- copied: `<svg class="alan-btn__copied-icon" width="24px" height="24px" viewBox="0 0 24 24" role="img" xmlns="http://www.w3.org/2000/svg" aria-labelledby="okIconTitle" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none" color="#000000"> <title id="okIconTitle">Copied!</title> <polyline points="4 13 9 18 20 7"/> </svg>`,
89788
- expandChat: `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
89789
- <rect x="1.75" y="2.75" width="16.5" height="14.5" rx="1.25" stroke="#969EB0" stroke-width="1.5"/>
89790
- <path fill-rule="evenodd" clip-rule="evenodd" d="M4.77344 11.0002C5.18765 11.0002 5.52344 11.336 5.52344 11.7502V13.2898C5.52344 13.4002 5.61298 13.4898 5.72344 13.4898L7.2949 13.4898C7.70911 13.4898 8.0449 13.8256 8.0449 14.2398C8.0449 14.654 7.70912 14.9898 7.29491 14.9898L5.27345 14.9898C4.58309 14.9898 4.02344 14.4302 4.02344 13.7398V11.7502C4.02344 11.336 4.35922 11.0002 4.77344 11.0002Z" fill="#969EB0"/>
89791
- <path fill-rule="evenodd" clip-rule="evenodd" d="M15.25 9C14.8358 9 14.5 8.66421 14.5 8.25V6.71045C14.5 6.6 14.4105 6.51045 14.3 6.51045L12.7285 6.51046C12.3143 6.51047 11.9785 6.17468 11.9785 5.76047C11.9785 5.34625 12.3143 5.01047 12.7285 5.01046L14.75 5.01045C15.4404 5.01045 16 5.57009 16 6.26045V8.25C16 8.66421 15.6642 9 15.25 9Z" fill="#969EB0"/>
89792
- </svg>`,
89793
- collapseChat: `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
89794
- <rect x="1.75" y="2.75" width="16.5" height="14.5" rx="1.25" stroke="#969EB0" stroke-width="1.5"/>
89795
- <path fill-rule="evenodd" clip-rule="evenodd" d="M7.29492 14.9898C6.88071 14.9898 6.54492 14.654 6.54492 14.2398V12.7003C6.54492 12.5898 6.45538 12.5003 6.34492 12.5003L4.77346 12.5003C4.35925 12.5003 4.02346 12.1645 4.02346 11.7503C4.02346 11.3361 4.35924 11.0003 4.77345 11.0003L6.79491 11.0003C7.48527 11.0003 8.04492 11.5599 8.04492 12.2503V14.2398C8.04492 14.654 7.70914 14.9898 7.29492 14.9898Z" fill="#969EB0"/>
89796
- <path fill-rule="evenodd" clip-rule="evenodd" d="M12.7285 5.01044C13.1427 5.01044 13.4785 5.34622 13.4785 5.76044V7.29998C13.4785 7.41044 13.5681 7.49998 13.6785 7.49998L15.25 7.49997C15.6642 7.49997 16 7.83576 16 8.24997C16 8.66418 15.6642 8.99997 15.25 8.99997L13.2285 8.99999C12.5382 8.99999 11.9785 8.44035 11.9785 7.74999V5.76044C11.9785 5.34622 12.3143 5.01044 12.7285 5.01044Z" fill="#969EB0"/>
89797
- </svg>
89798
- `,
89799
- saveChatState: `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
89800
- <path d="M2.375 12.875C2.375 15.1141 2.375 16.2337 3.07062 16.9294C3.76624 17.625 4.88583 17.625 7.125 17.625H11.875C14.1142 17.625 15.2337 17.625 15.9294 16.9294C16.625 16.2337 16.625 15.1141 16.625 12.875" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
89801
- <path d="M9.50001 3.375V13.6667M9.50001 13.6667L12.6667 10.2031M9.50001 13.6667L6.33334 10.2031" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
89802
- </svg>
89803
- `
89804
- };
89805
- function getCloseChatIcon(textChatOptions) {
89806
- return textChatOptions?.popup?.icons?.close?.svg || chatIcons.closeChat;
89807
- }
89808
- function getExpandChatIcon(textChatOptions) {
89809
- return textChatOptions?.popup?.icons?.fullScreen?.svgExpand || chatIcons.expandChat;
89810
- }
89811
- function getCollapseChatIcon(textChatOptions) {
89812
- return textChatOptions?.popup?.icons?.fullScreen?.svgCollapse || chatIcons.collapseChat;
89813
- }
89814
- function getSaveChatStateIcon(textChatOptions) {
89815
- return textChatOptions?.popup?.icons?.saveChatState?.svg || chatIcons.saveChatState;
89816
- }
89817
- function getSendChatIcon(textChatOptions) {
89818
- return textChatOptions?.popup?.icons?.send?.svg || chatIcons.send;
89819
- }
89820
- function getMicChatIcon(textChatOptions) {
89821
- return textChatOptions?.popup?.icons?.mic?.svg || chatIcons.mic;
89822
- }
89823
- function getMuteChatIcon(textChatOptions) {
89824
- return textChatOptions?.popup?.icons?.mute?.svgOff || chatIcons.mute;
89825
- }
89826
- function getUnmuteChatIcon(textChatOptions) {
89827
- return textChatOptions?.popup?.icons?.mute?.svgOn || chatIcons.unmute;
89828
- }
89829
-
89830
89860
  // alan_btn/src/textChat/fullscreen.ts
89831
89861
  function openChatInFullScreen(chatHolderDiv) {
89832
89862
  chatHolderDiv.classList.add("alan-btn_text-chat-full-screen");
@@ -90459,6 +90489,7 @@
90459
90489
  const responseBubbleRightPadding = getNumPropVal(textChatOptions?.bubbles?.response?.padding?.right, 20);
90460
90490
  const responseBubbleBottomPadding = getNumPropVal(textChatOptions?.bubbles?.response?.padding?.bottom, 9);
90461
90491
  const responseBubbleLeftPadding = getNumPropVal(textChatOptions?.bubbles?.response?.padding?.left, 20);
90492
+ const newDialogSeparatorColor = textChatOptions?.bubbles?.newDialog?.separator?.color || `#d3dae2`;
90462
90493
  const waitingResponseBubbleLayout = textChatOptions?.bubbles?.waitingResponse?.layout || "default";
90463
90494
  const responseBubbleBorderRadiusTopLeft = getNumPropVal(textChatOptions?.bubbles?.response?.borderRadius?.topLeft, defaultBubbleBorderRadius);
90464
90495
  const responseBubbleBorderRadiusTopRight = getNumPropVal(textChatOptions?.bubbles?.response?.borderRadius?.topRight, defaultBubbleBorderRadius);
@@ -90469,6 +90500,8 @@
90469
90500
  const textareaRightPadding = getNumPropVal(textChatOptions?.textarea?.padding?.right, 42);
90470
90501
  const textareaBottomPadding = getNumPropVal(textChatOptions?.textarea?.padding?.bottom, 12);
90471
90502
  const textareaLeftPadding = getNumPropVal(textChatOptions?.textarea?.padding?.left, 12);
90503
+ const stopResponseIconDefaultColor = textChatOptions?.popup?.icons?.stopResponse?.default?.fill || `#171717`;
90504
+ const stopResponseIconHoverColor = textChatOptions?.popup?.icons?.stopResponse?.hover?.fill || `#0078ff`;
90472
90505
  const requestBubbleLabelTopPadding = getNumPropVal(textChatOptions?.bubbles?.request?.label?.padding?.top, 0);
90473
90506
  const requestBubbleLabelRightPadding = getNumPropVal(textChatOptions?.bubbles?.request?.label?.padding?.right, 0);
90474
90507
  const requestBubbleLabelBottomPadding = getNumPropVal(textChatOptions?.bubbles?.request?.label?.padding?.bottom, 4);
@@ -91211,6 +91244,41 @@
91211
91244
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat.alan-btn__disconnected .alan-btn__chat-send-btn svg path {
91212
91245
  opacity: 1;
91213
91246
  }`;
91247
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat .alan-btn__chat-stop-response-holder {
91248
+ cursor: pointer;
91249
+ display: flex;
91250
+ }`;
91251
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat .alan-btn__chat-stop-response-holder .alan-btn__stop-response-btn svg path {
91252
+ stroke: ${stopResponseIconDefaultColor};
91253
+ }`;
91254
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat .alan-btn__chat-stop-response-holder .alan-btn__stop-response-btn svg circle {
91255
+ stroke: ${stopResponseIconDefaultColor};
91256
+ }`;
91257
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat .alan-btn__chat-stop-response-holder .alan-btn__stop-response-btn svg rect {
91258
+ fill: ${stopResponseIconDefaultColor};
91259
+ }`;
91260
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat .alan-btn__chat-stop-response-holder .alan-btn__stop-response-btn:hover svg path {
91261
+ stroke: ${stopResponseIconHoverColor};
91262
+ }`;
91263
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat .alan-btn__chat-stop-response-holder .alan-btn__stop-response-btn:hover svg circle {
91264
+ stroke: ${stopResponseIconHoverColor};
91265
+ }`;
91266
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat .alan-btn__chat-stop-response-holder .alan-btn__stop-response-btn:hover svg rect {
91267
+ fill: ${stopResponseIconHoverColor};
91268
+ }`;
91269
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat .alan-btn__chat-stop-response-holder:hover .alan-btn__stop-response-btn {
91270
+ opacity: 1;
91271
+ transition: opacity 300ms ease-in-out;
91272
+ }`;
91273
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat .alan-btn__stop-response-btn {
91274
+ display: inline-flex;
91275
+ align-items: center;
91276
+ justify-content: center;
91277
+ }`;
91278
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat .alan-btn__stop-response-btn svg {
91279
+ max-width: 22px;
91280
+ max-height: 22px;
91281
+ }`;
91214
91282
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat.alan-btn__disconnected .alan-btn__chat-mic-btn {
91215
91283
  opacity: 0.2;
91216
91284
  pointer-events: none;
@@ -91529,6 +91597,14 @@
91529
91597
  box-shadow: none;
91530
91598
  border-color:transparent;` : ``}
91531
91599
  }`;
91600
+ keyFrames += getStyleSheetMarker() + `.alan-btn__chat-connection-separator {
91601
+ width: 100%;
91602
+ height: 1px;
91603
+ min-height: 1px;
91604
+ max-height: 1px;
91605
+ background-color: ${newDialogSeparatorColor};
91606
+ margin: 50px 0;
91607
+ }`;
91532
91608
  keyFrames += getStyleSheetMarker() + `.alan-btn__chat-buttons {
91533
91609
  margin-bottom: 16px;
91534
91610
  display:flex;
@@ -91787,11 +91863,15 @@
91787
91863
  keyFrames += getCssForTextChatLinks(getStyleSheetMarker(), uiState.textChat.options);
91788
91864
  keyFrames += getCssForCommandsBlock(getStyleSheetMarker(), uiState.textChat.options);
91789
91865
  keyFrames += getStyleSheetMarker() + `.alan-incoming-msg {
91866
+ padding-left: 12px;
91790
91867
  display: flex;
91791
91868
  align-items: center;
91792
91869
  overflow: hidden;
91793
91870
  animation:chat-bubble-appear-w-opacity 300ms ease-in-out forwards 100ms, hide-buble 300ms forwards ease ${uiState.textChat.loaderTimeoutMs}ms !important;
91794
91871
  }`;
91872
+ keyFrames += getStyleSheetMarker() + `.alan-hide-msg-immidiatelly {
91873
+ display: none!important;
91874
+ }`;
91795
91875
  keyFrames += getStyleSheetMarker() + `.alan-hidden-loader {
91796
91876
  display: none!important;
91797
91877
  }`;
@@ -92094,10 +92174,14 @@
92094
92174
  const waitingResponseBubbleLabelIconAlignment = textChatOptions?.bubbles?.waitingResponse?.alignment || "center";
92095
92175
  const waitingResponseBubbleLoaderIcon = textChatOptions?.bubbles?.waitingResponse?.icon?.svg;
92096
92176
  const waitingResponseBubbleLoaderIconGap = getNumPropVal(textChatOptions?.bubbles?.waitingResponse?.icon?.gap, 8);
92177
+ const responseBubbleBg = textChatOptions?.bubbles?.response?.backgroundColor || `#ffffff`;
92178
+ const responseBubbleFontColor = textChatOptions?.bubbles?.response?.color || `#171717`;
92097
92179
  const [responseLabelWidth, responseLabelHeight] = parseSvgSize(waitingResponseBubbleLoaderIcon);
92098
92180
  keyFrames += styleSheetMarker + `.alan-btn__chat-incomming-msg-wrapper {
92099
92181
  display: flex;
92182
+ max-width: 100%;
92100
92183
  align-items: ${waitingResponseBubbleLabelIconAlignment};
92184
+ gap: ${waitingResponseBubbleLoaderIconGap}px;
92101
92185
  ${waitingResponseBubbleLayout !== "default" ? `
92102
92186
  gap: ${waitingResponseBubbleLoaderIconGap}px;
92103
92187
  ` : ``}
@@ -92113,6 +92197,34 @@
92113
92197
  }`;
92114
92198
  keyFrames += styleSheetMarker + `.alan-btn__chat-incomming-msg-loader-label {
92115
92199
  display: inline-block;
92200
+ max-width: 90%;
92201
+ white-space: nowrap;
92202
+ overflow: hidden;
92203
+ text-overflow: ellipsis;
92204
+ }`;
92205
+ keyFrames += styleSheetMarker + `.alan-btn__chat-incomming-msg-loader-label-default {
92206
+ position: relative;
92207
+ overflow: hidden;
92208
+ white-space: nowrap;
92209
+ max-width: calc(100% - 20px);
92210
+ display: inline-block;
92211
+ display: flex;
92212
+ gap: 4px;
92213
+ }`;
92214
+ keyFrames += styleSheetMarker + `.alan-btn__chat-incomming-msg-loader-label-default svg path {
92215
+ stroke: ${responseBubbleFontColor};
92216
+ }`;
92217
+ keyFrames += styleSheetMarker + `.alan-btn__chat-incomming-msg-loader-label-default svg circle {
92218
+ stroke: ${responseBubbleFontColor};
92219
+ }`;
92220
+ keyFrames += styleSheetMarker + `.alan-btn__chat-incomming-msg-loader-label-default.with-text::after {
92221
+ position: absolute;
92222
+ top: 0;
92223
+ right: 0;
92224
+ content: '';
92225
+ height: 100%;
92226
+ width: 20px;
92227
+ background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, ${responseBubbleBg} 100%);
92116
92228
  }`;
92117
92229
  keyFrames += styleSheetMarker + `.alan-btn__chat-incomming-msg-inner-wrapper {
92118
92230
  display: flex;
@@ -93512,23 +93624,32 @@ code.hljs {
93512
93624
  const iframeEls = document.querySelectorAll("#" + iframeId);
93513
93625
  iframeEls.forEach((iframeEl) => {
93514
93626
  const responseWrapper = iframeEl.closest(".alan-btn__chat-response, .chat-bubble_message");
93515
- if (responseWrapper) {
93516
- if (withSvg) {
93517
- responseWrapper.classList.add("with-svg");
93627
+ if (Math.abs(iframeEl.clientHeight - height) !== 20) {
93628
+ iframeEl.style.height = (+height > maxIFrameHeight ? maxIFrameHeight : height) + "px";
93629
+ }
93630
+ if (!responseWrapper) {
93631
+ iframeEl.style.width = "100%";
93632
+ return;
93633
+ }
93634
+ if (withSvg) {
93635
+ responseWrapper.classList.add("with-svg");
93636
+ } else {
93637
+ if (height < 650) {
93638
+ changeWidthIfNeeded(iframeEl, width);
93518
93639
  } else {
93519
- if (height < 650) {
93520
- iframeEl.style.width = width + "px";
93640
+ if (responseWrapper.clientWidth <= width) {
93641
+ changeWidthIfNeeded(iframeEl, width);
93521
93642
  } else {
93522
- if (responseWrapper.clientWidth <= width) {
93523
- iframeEl.style.width = width + "px";
93524
- } else {
93525
- iframeEl.style.width = "100%";
93526
- }
93643
+ iframeEl.style.width = "100%";
93527
93644
  }
93528
93645
  }
93529
93646
  }
93530
- iframeEl.style.height = (+height > maxIFrameHeight ? maxIFrameHeight : height) + "px";
93531
93647
  });
93648
+ function changeWidthIfNeeded(iframeEl, newWidth) {
93649
+ if (Math.abs(iframeEl.clientWidth - newWidth) !== 20) {
93650
+ iframeEl.style.width = newWidth + "px";
93651
+ }
93652
+ }
93532
93653
  }
93533
93654
  function onIFrameSizeListener(event) {
93534
93655
  if (event.data && event.data.source !== "alan-chat-iframe") {
@@ -93565,6 +93686,7 @@ code.hljs {
93565
93686
 
93566
93687
  // alan_btn/src/textChat/saveChatStateToFile.ts
93567
93688
  var adjustIFrameSizeString = adjustIFrameSize.toString();
93689
+ var addImgToThePageString = addImgToThePage.toString();
93568
93690
  var onIFrameSizeListenerString = onIFrameSizeListener.toString();
93569
93691
  async function saveChatState(chatName, chatEl, width, projectId, headContent, codeContent) {
93570
93692
  const chatConteiner = chatEl.cloneNode(true);
@@ -93598,6 +93720,7 @@ code.hljs {
93598
93720
  <!DOCTYPE html>
93599
93721
  <html lang="en">
93600
93722
  <head>
93723
+ <meta charset="UTF-8">
93601
93724
  <title>Alan Text Chat History</title>
93602
93725
  ${headContent ? headContent : ""}
93603
93726
  <style>
@@ -93708,6 +93831,7 @@ code.hljs {
93708
93831
  ${codeContent ? codeContent : ""}
93709
93832
  <script>
93710
93833
  ${adjustIFrameSizeString}
93834
+ ${addImgToThePageString}
93711
93835
  window.addEventListener("message", ${onIFrameSizeListenerString});
93712
93836
  <script>
93713
93837
  </body>
@@ -93793,8 +93917,16 @@ code.hljs {
93793
93917
 
93794
93918
  // alan_btn/alan_btn.ts
93795
93919
  var import_lodash2 = __toESM(require_lodash());
93920
+
93921
+ // alan_btn/src/textChat/helpers/getMsgReqId.ts
93922
+ function getMsgReqId(msg) {
93923
+ return msg.reqId || msg?.ctx?.reqId;
93924
+ ;
93925
+ }
93926
+
93927
+ // alan_btn/alan_btn.ts
93796
93928
  (function(ns) {
93797
- uiState.lib.version = "alan-version.1.8.69".replace("alan-version.", "");
93929
+ uiState.lib.version = "alan-version.1.8.71".replace("alan-version.", "");
93798
93930
  if (window.alanBtn) {
93799
93931
  console.warn("Alan: the Alan Button source code has already added (v." + uiState.lib.version + ")");
93800
93932
  }
@@ -93822,6 +93954,7 @@ code.hljs {
93822
93954
  var textChatIsHidden = true;
93823
93955
  var voiceEnabledInTextChat = true;
93824
93956
  var textChatMessages = [];
93957
+ var canceledRequests = [];
93825
93958
  var textChatScrollPosition = null;
93826
93959
  var sentMessageInd = null;
93827
93960
  var sentMessages = [];
@@ -93921,7 +94054,7 @@ code.hljs {
93921
94054
  closeTextChat();
93922
94055
  },
93923
94056
  clear: () => {
93924
- clearTextChat();
94057
+ onClearTextChatBtnClick();
93925
94058
  }
93926
94059
  },
93927
94060
  //deprecated
@@ -94883,7 +95016,7 @@ code.hljs {
94883
95016
  if (isLocalStorageAvailable) {
94884
95017
  return localStorage.getItem(getDialogIdSessionKey());
94885
95018
  }
94886
- return null;
95019
+ return void 0;
94887
95020
  }
94888
95021
  function saveDialogId(dialogId) {
94889
95022
  if (isLocalStorageAvailable && dialogId) {
@@ -95380,14 +95513,16 @@ code.hljs {
95380
95513
  switchState(getDefaultBtnState());
95381
95514
  }
95382
95515
  const { dialogId } = window.tutorProject.getSettings();
95383
- if (getSavedDialogId() !== dialogId) {
95384
- clearChatAndChatHistory();
95385
- }
95386
95516
  console.info("Alan: connected to dialog - ", dialogId, "prev. dialog: ", getSavedDialogId() || "-");
95387
95517
  curDialogId = dialogId;
95388
- saveDialogId(dialogId);
95389
- restoreMessageList(true);
95390
- sentMessages = restoreSentMessages();
95518
+ if (getSavedDialogId() !== dialogId) {
95519
+ saveDialogId(dialogId);
95520
+ onNewDialogAutoReconnect();
95521
+ } else {
95522
+ saveDialogId(dialogId);
95523
+ restoreMessageList(true);
95524
+ }
95525
+ console.info("Alan: curDialogId", curDialogId);
95391
95526
  if (!isTutorMode()) {
95392
95527
  sendSyncPageState();
95393
95528
  }
@@ -95988,7 +96123,22 @@ code.hljs {
95988
96123
  ${LEARN_MORE_LABEL}
95989
96124
  ` + msg.links?.map((link) => link.href).join("\n") : "")
95990
96125
  );
96126
+ return;
96127
+ }
96128
+ }
96129
+ clickedEl = e.target;
96130
+ clickedEl = clickedEl.closest(".alan-btn__chat-stop-response-holder");
96131
+ if (clickedEl) {
96132
+ const responseBubble = clickedEl.closest("[data-msg-index]");
96133
+ const msgInd = responseBubble.getAttribute("data-msg-index");
96134
+ const msg = textChatMessages[msgInd];
96135
+ if (responseBubble && msg) {
96136
+ const curMsgReqId = getMsgReqId(msg);
96137
+ canceledRequests.push(curMsgReqId);
96138
+ responseBubble.classList.add("alan-hide-msg-immidiatelly");
96139
+ saveMessageHistory();
95991
96140
  }
96141
+ enableTextareaInTheChat();
95992
96142
  }
95993
96143
  }, false);
95994
96144
  window.addEventListener("click", (e) => {
@@ -96011,6 +96161,10 @@ ${LEARN_MORE_LABEL}
96011
96161
  function renderMessageInTextChat(msg, noAnimation, immidiateScroll) {
96012
96162
  if (!uiState.textChat.available)
96013
96163
  return;
96164
+ if (isMsgShouldBeSkipped(msg)) {
96165
+ console.info("isMsgShouldBeSkipped true");
96166
+ return;
96167
+ }
96014
96168
  let innerMsgPart = "";
96015
96169
  let msgHtml = "";
96016
96170
  const msgHolder = document.getElementById("chatMessages");
@@ -96040,6 +96194,8 @@ ${LEARN_MORE_LABEL}
96040
96194
  if (msg?.buttons) {
96041
96195
  msgHtml = renderButtons(msg?.buttons);
96042
96196
  }
96197
+ } else if (msg.type === "connection-separator") {
96198
+ msgHtml = `<div class="alan-btn__chat-connection-separator"></div>`;
96043
96199
  } else if (msg.type === "chat") {
96044
96200
  msgHtml = `<div class="alan-btn__chat-popup">${msg.html}</div>`;
96045
96201
  } else {
@@ -96073,7 +96229,11 @@ ${LEARN_MORE_LABEL}
96073
96229
  addPopupStyle(msg, div);
96074
96230
  }
96075
96231
  var avatarHtml = `<div class="alan-btn__chat-avatar ${msg.type}">` + (msg.type === "request" ? `<div class="alan-btn__chat-request-avatar"></div>` : `<div class="alan-btn__chat-response-avatar"></div>`) + "</div>";
96076
- div.innerHTML = `${msg.name !== "loading" ? getMsgBubbleLabel(msg) : ""}<div class="alan-btn__chat-bubble-holder">${(msg.type === "chat" || msg.type === "buttons" ? "" : avatarHtml) + msgHtml}</div>`;
96232
+ if (msg.type === "connection-separator") {
96233
+ div.innerHTML = msgHtml;
96234
+ } else {
96235
+ div.innerHTML = `${msg.name !== "loading" ? getMsgBubbleLabel(msg) : ""}<div class="alan-btn__chat-bubble-holder">${(msg.type === "chat" || msg.type === "buttons" ? "" : avatarHtml) + msgHtml}</div>`;
96236
+ }
96077
96237
  msgHolder.appendChild(div);
96078
96238
  if (uiState.textChat.available && textChatIsHidden && msg.type === "response" && msg.read !== true) {
96079
96239
  unreadChatMsgCount++;
@@ -96226,7 +96386,7 @@ ${LEARN_MORE_LABEL}
96226
96386
  function getKeyForSavingTextChatMessages() {
96227
96387
  return `alan-btn-text-chat-msgs-for-dialogId-${curDialogId}`;
96228
96388
  }
96229
- function clearChat() {
96389
+ function clearDOMChat() {
96230
96390
  unreadChatMsgCount = 0;
96231
96391
  textChatMessages = [];
96232
96392
  if (uiState.textChat.available) {
@@ -96236,7 +96396,7 @@ ${LEARN_MORE_LABEL}
96236
96396
  }
96237
96397
  }
96238
96398
  }
96239
- function clearTextChat() {
96399
+ function onClearTextChatBtnClick() {
96240
96400
  clearDialogId();
96241
96401
  if (window.tutorProject) {
96242
96402
  window.tutorProject.close();
@@ -96251,16 +96411,29 @@ ${LEARN_MORE_LABEL}
96251
96411
  btnIsReady = false;
96252
96412
  connectProject();
96253
96413
  }
96254
- clearChatAndChatHistory();
96255
- }
96256
- function clearChatAndChatHistory() {
96257
- clearChat();
96414
+ clearDOMChat();
96258
96415
  clearChatHistoryStorage();
96259
96416
  manageSaveChatHistoryBtn();
96260
96417
  }
96418
+ function onNewDialogAutoReconnect() {
96419
+ console.info("onNewDialogAutoReconnect");
96420
+ if (textChatMessages?.length === 0)
96421
+ return;
96422
+ if (textChatMessages?.at(-1)?.type === "connection-separator")
96423
+ return;
96424
+ const event = {
96425
+ type: "connection-separator"
96426
+ };
96427
+ renderMessageInTextChat(event);
96428
+ }
96429
+ window.onNewDialogAutoReconnect = onNewDialogAutoReconnect;
96261
96430
  function syncChatHistoryBetweenTabs() {
96431
+ if (isTutorMode()) {
96432
+ return;
96433
+ }
96262
96434
  tabActive = true;
96263
96435
  saveTabId();
96436
+ console.info("syncChatHistoryBetweenTabs");
96264
96437
  restoreMessageList(false);
96265
96438
  }
96266
96439
  function saveTabId() {
@@ -96276,13 +96449,16 @@ ${LEARN_MORE_LABEL}
96276
96449
  if (isLocalStorageAvailable) {
96277
96450
  if (curDialogId) {
96278
96451
  savedMsgs = localStorage.getItem(getKeyForSavingTextChatMessages());
96452
+ console.info("restoreMessageList", savedMsgs, curDialogId, getKeyForSavingTextChatMessages());
96279
96453
  try {
96280
96454
  if (savedMsgs === JSON.stringify(textChatMessages)) {
96281
96455
  return;
96282
96456
  }
96283
96457
  savedMsgs = JSON.parse(savedMsgs);
96284
- clearChat();
96285
96458
  if (Array.isArray(savedMsgs)) {
96459
+ if (savedMsgs?.length > 0) {
96460
+ clearDOMChat();
96461
+ }
96286
96462
  for (let i2 = 0; i2 < savedMsgs.length; i2++) {
96287
96463
  if (initLoad === true) {
96288
96464
  if (savedMsgs[i2].name !== "loading") {
@@ -96314,6 +96490,7 @@ ${LEARN_MORE_LABEL}
96314
96490
  }
96315
96491
  async function _sendText(text) {
96316
96492
  var msg = { text, type: "request", name: "text" };
96493
+ sentMessageInd = null;
96317
96494
  clearMessageProgressStatusInterval();
96318
96495
  renderMessageInTextChat(msg);
96319
96496
  var res = await sendText(text);
@@ -96328,6 +96505,10 @@ ${LEARN_MORE_LABEL}
96328
96505
  saveSentMessages(text);
96329
96506
  }
96330
96507
  var lastSendMsgTs = null;
96508
+ function isMsgShouldBeSkipped(msg) {
96509
+ const regId = getMsgReqId(msg);
96510
+ return canceledRequests.indexOf(regId) > -1;
96511
+ }
96331
96512
  function enableTextareaInTheChat() {
96332
96513
  var textareaHolderEl = document.getElementById("textarea-holder");
96333
96514
  textareaHolderEl.classList.remove("alan-btn__inactive");
@@ -96345,6 +96526,7 @@ ${LEARN_MORE_LABEL}
96345
96526
  lastSendMsgTs = setTimeout(() => {
96346
96527
  enableTextareaInTheChat();
96347
96528
  }, 5e3);
96529
+ lastSendMsgTs = Date.now();
96348
96530
  if (text.trim() === "")
96349
96531
  return;
96350
96532
  textareaEl.value = "";
@@ -96479,6 +96661,8 @@ ${LEARN_MORE_LABEL}
96479
96661
  if (isLocalStorageAvailable) {
96480
96662
  const maxSavedForHistoryMsgCount = 25;
96481
96663
  const key = getRestoreMsgsLsKey();
96664
+ if (sentMessages?.indexOf(text) > -1)
96665
+ return;
96482
96666
  sentMessages.push(text);
96483
96667
  if (sentMessages.length > 50) {
96484
96668
  sentMessages = sentMessages.slice(Math.max(sentMessages.length - maxSavedForHistoryMsgCount, 0));
@@ -96696,7 +96880,7 @@ ${LEARN_MORE_LABEL}
96696
96880
  headerInnerDiv = createDiv({ id: "chat-header-inner", class: "alan-btn__chat-header-inner" });
96697
96881
  var headerDivGr = createDiv({ class: "alan-btn__chat-header-gradient" });
96698
96882
  var clearChatBtn = createDivWithSvg(chatIcons.clear, { id: "clear-chat-btn", class: "alan-btn__chat-clear-btn" });
96699
- clearChatBtn.addEventListener("click", clearTextChat);
96883
+ clearChatBtn.addEventListener("click", onClearTextChatBtnClick);
96700
96884
  headerTille = document.createElement("span");
96701
96885
  headerTille.id = "chat-header-title";
96702
96886
  headerTille.classList.add("alan-btn__chat-header-title");
@@ -96744,7 +96928,7 @@ ${LEARN_MORE_LABEL}
96744
96928
  headerInnerDiv.appendChild(headerTille);
96745
96929
  headerInnerDiv.appendChild(rightHeaderIconsHolder);
96746
96930
  headerDiv.appendChild(headerInnerDiv);
96747
- fillSideBarContent(chatSideBar, { clearTextChat, expandCollapseChatSidePanel, closeTextChat });
96931
+ fillSideBarContent(chatSideBar, { clearTextChat: onClearTextChatBtnClick, expandCollapseChatSidePanel, closeTextChat });
96748
96932
  textareaInnerDiv = createDiv({ id: "textarea-inner-holder", class: "alan-btn__chat-textarea-inner-holder" });
96749
96933
  textareaHolderDiv = createDiv({ id: "textarea-holder-content", class: "alan-btn__chat-textarea-holder-outer-content" });
96750
96934
  textareaDiv = createDiv({ id: "textarea-holder", class: "alan-btn__chat-textarea-holder" });
@@ -96793,7 +96977,7 @@ ${LEARN_MORE_LABEL}
96793
96977
  expandCollapseChatBtnImg.innerHTML = `${getExpandChatIcon(uiState?.textChat?.options)}${getCollapseChatIcon(uiState?.textChat?.options)}`;
96794
96978
  addNeedClassesToExpandCollapseBtn(expandCollapseChatBtnImg);
96795
96979
  }
96796
- manageSendBtnIconPosition(chatSendBtn, textareaInnerDiv, textareaHolderDiv);
96980
+ manageSendStopBtnIconPosition(chatSendBtn, textareaInnerDiv, textareaHolderDiv);
96797
96981
  manageUnmuteAlanIconPosition(unmuteAlanBtn, rightHeaderIconsHolder, leftHeaderIconsHolder);
96798
96982
  if (voiceEnabledInTextChat) {
96799
96983
  chatTextarea.setAttribute("placeholder", "Ask me anything...");
@@ -96973,7 +97157,7 @@ ${LEARN_MORE_LABEL}
96973
97157
  }
96974
97158
  }
96975
97159
  }
96976
- function manageSendBtnIconPosition(chatSendBtn, footerInnerDiv, footerHolderDiv) {
97160
+ function manageSendStopBtnIconPosition(chatSendBtn, footerInnerDiv, footerHolderDiv) {
96977
97161
  var textareaInnerDiv = footerInnerDiv || document.getElementById("textarea-inner-holder");
96978
97162
  var textareaHolderDiv = footerHolderDiv || document.getElementById("textarea-holder-content");
96979
97163
  if (chatSendBtn) {
@@ -97322,6 +97506,7 @@ ${LEARN_MORE_LABEL}
97322
97506
  if (uiState.textChat.available) {
97323
97507
  var simpleAlanBtn = document.getElementById("chat-mic-btn");
97324
97508
  var sendBtn = document.getElementById("chat-send-btn");
97509
+ var stopBtn = document.getElementById("chat-stop-btn");
97325
97510
  var textChatEl = document.getElementById("alan-text-chat");
97326
97511
  if (textChatEl) {
97327
97512
  switch (newState) {
@@ -97339,7 +97524,7 @@ ${LEARN_MORE_LABEL}
97339
97524
  default:
97340
97525
  textChatEl.classList.remove("alan-btn__mic-active");
97341
97526
  textChatEl.classList.remove("alan-btn__disconnected");
97342
- manageSendBtnIconPosition(sendBtn);
97527
+ manageSendStopBtnIconPosition(sendBtn, stopBtn);
97343
97528
  break;
97344
97529
  }
97345
97530
  if (simpleAlanBtn) {