sceyt-chat-react-uikit 1.6.9-beta.15 → 1.6.9-beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +389 -367
  2. package/index.modern.js +389 -367
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -2854,181 +2854,205 @@ function _catch(body, recover) {
2854
2854
  return result;
2855
2855
  }
2856
2856
 
2857
- var currentVersion = 1;
2858
- var _setDataToDB = function setDataToDB(dbName, storeName, data, keyPath) {
2859
- if (!('indexedDB' in window)) {
2860
- log.info("This browser doesn't support IndexedDB");
2861
- } else {
2862
- var openRequest = indexedDB.open(dbName, currentVersion);
2863
- openRequest.onupgradeneeded = function (event) {
2864
- var db = openRequest.result;
2865
- var transaction = event.target.transaction;
2866
- addData(db, storeName, keyPath, data, transaction);
2857
+ // Asynchronously await a promise and pass the result to a finally continuation
2858
+ function _finallyRethrows(body, finalizer) {
2859
+ try {
2860
+ var result = body();
2861
+ } catch (e) {
2862
+ return finalizer(true, e);
2863
+ }
2864
+ if (result && result.then) {
2865
+ return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
2866
+ }
2867
+ return finalizer(false, result);
2868
+ }
2869
+
2870
+ var openDatabase = function openDatabase(dbName) {
2871
+ return new Promise(function (resolve, reject) {
2872
+ var request = indexedDB.open(dbName);
2873
+ request.onsuccess = function () {
2874
+ return resolve(request.result);
2867
2875
  };
2868
- openRequest.onerror = function () {
2869
- log.error('Indexeddb Error ', openRequest.error);
2876
+ request.onerror = function () {
2877
+ return reject(request.error);
2870
2878
  };
2871
- openRequest.onsuccess = function (event) {
2872
- var db = event.target.result;
2879
+ });
2880
+ };
2881
+ var runUpgrade = function runUpgrade(dbName, onUpgrade) {
2882
+ try {
2883
+ return Promise.resolve(openDatabase(dbName)).then(function (db) {
2884
+ var nextVersion = db.version + 1;
2885
+ db.close();
2886
+ return new Promise(function (resolve, reject) {
2887
+ var request = indexedDB.open(dbName, nextVersion);
2888
+ request.onupgradeneeded = function () {
2889
+ var upgradeDb = request.result;
2890
+ onUpgrade(upgradeDb);
2891
+ };
2892
+ request.onsuccess = function () {
2893
+ return resolve(request.result);
2894
+ };
2895
+ request.onerror = function () {
2896
+ return reject(request.error);
2897
+ };
2898
+ request.onblocked = function () {
2899
+ log.warn('IndexedDB upgrade blocked; close other tabs to proceed');
2900
+ };
2901
+ });
2902
+ });
2903
+ } catch (e) {
2904
+ return Promise.reject(e);
2905
+ }
2906
+ };
2907
+ var ensureStore = function ensureStore(dbName, storeName, keyPath) {
2908
+ try {
2909
+ return Promise.resolve(openDatabase(dbName)).then(function (db) {
2873
2910
  if (db.objectStoreNames.contains(storeName)) {
2874
- addData(db, storeName, keyPath, data);
2875
- } else {
2876
- db.close();
2877
- currentVersion++;
2878
- _setDataToDB(dbName, storeName, data, keyPath);
2911
+ return db;
2879
2912
  }
2880
- db.onversionchange = function () {
2881
- db.close();
2882
- };
2883
- };
2884
- openRequest.onblocked = function () {};
2913
+ db.close();
2914
+ return Promise.resolve(runUpgrade(dbName, function (upgradeDb) {
2915
+ if (!upgradeDb.objectStoreNames.contains(storeName)) {
2916
+ upgradeDb.createObjectStore(storeName, {
2917
+ keyPath: keyPath
2918
+ });
2919
+ }
2920
+ }));
2921
+ });
2922
+ } catch (e) {
2923
+ return Promise.reject(e);
2885
2924
  }
2886
2925
  };
2887
- var _getDataFromDB = function getDataFromDB(dbName, storeName, keyPath, keyPatName) {
2926
+ var awaitTransaction = function awaitTransaction(tx) {
2888
2927
  return new Promise(function (resolve, reject) {
2889
- var openRequest = indexedDB.open(dbName, currentVersion);
2890
- openRequest.onupgradeneeded = function (event) {
2891
- var db = event.target.result;
2892
- var transaction = event.target.transaction;
2893
- if (db.objectStoreNames.contains(storeName)) {
2894
- var objectStore = transaction.objectStore(storeName);
2895
- var request = objectStore.get(keyPath);
2896
- request.onsuccess = function (event) {
2897
- var result = event.target.result;
2898
- resolve(result || '');
2899
- };
2900
- request.onerror = function (event) {
2901
- log.error('Error retrieving data during upgrade: ', event.target.error);
2902
- resolve('');
2903
- };
2904
- } else {
2905
- db.createObjectStore(storeName, {
2906
- keyPath: keyPatName
2907
- });
2908
- resolve('');
2909
- }
2928
+ tx.oncomplete = function () {
2929
+ return resolve();
2910
2930
  };
2911
- openRequest.onerror = function (event) {
2912
- if (event.target.error.name === 'VersionError') {
2913
- currentVersion++;
2914
- resolve(_getDataFromDB(dbName, storeName, keyPath));
2915
- } else {
2916
- reject(event);
2917
- }
2931
+ tx.onerror = function () {
2932
+ return reject(tx.error);
2918
2933
  };
2919
- openRequest.onsuccess = function (event) {
2920
- var db = event.target.result;
2921
- if (db.objectStoreNames.contains(storeName)) {
2922
- var transaction = db.transaction(storeName, 'readonly');
2923
- var objectStore = transaction.objectStore(storeName);
2924
- var request = objectStore.get(keyPath);
2925
- request.onsuccess = function (event) {
2926
- var result = event.target.result;
2927
- if (result) {
2928
- db.close();
2929
- resolve(result);
2930
- } else {
2931
- log.info('No data found for the specified keyPathValue.');
2932
- db.close();
2933
- resolve('');
2934
- }
2935
- };
2936
- request.onerror = function (event) {
2937
- db.close();
2938
- log.error('Error retrieving data: ', event.target.error);
2939
- };
2940
- } else {
2941
- db.close();
2942
- resolve('');
2943
- }
2934
+ tx.onabort = function () {
2935
+ return reject(tx.error);
2944
2936
  };
2945
2937
  });
2946
2938
  };
2947
- var addData = function addData(db, storeName, keyPath, data, transaction) {
2948
- if (!db.objectStoreNames.contains(storeName)) {
2949
- var objectStore = db.createObjectStore(storeName, {
2950
- keyPath: keyPath
2951
- });
2952
- data.forEach(function (value) {
2953
- var request = objectStore.put(value);
2954
- request.onsuccess = function () {
2955
- log.info('data added to db during upgrade.. ', request.result);
2956
- };
2957
- request.onerror = function () {
2958
- log.info('Error on put data to db during upgrade.. ', request.error);
2959
- };
2960
- });
2961
- } else {
2962
- if (transaction) {
2963
- var store = transaction.objectStore(storeName);
2964
- data.forEach(function (value) {
2965
- var request = store.put(value);
2966
- request.onsuccess = function () {
2967
- log.info('data added to db using existing transaction.. ', request.result);
2968
- };
2969
- request.onerror = function () {
2970
- log.info('Error on put data to db using existing transaction.. ', request.error);
2971
- };
2939
+ var putWithPossibleOutOfLineKey = function putWithPossibleOutOfLineKey(store, value, keyField) {
2940
+ try {
2941
+ if (store.keyPath !== null) {
2942
+ store.put(value);
2943
+ return;
2944
+ }
2945
+ } catch (e) {}
2946
+ var explicitKey = value === null || value === void 0 ? void 0 : value[keyField];
2947
+ if (explicitKey === undefined || explicitKey === null) {
2948
+ throw new Error("IndexedDB put requires explicit key but value has no '" + keyField + "' field");
2949
+ }
2950
+ store.put(value, explicitKey);
2951
+ };
2952
+ var setDataToDB = function setDataToDB(dbName, storeName, data, keyPath) {
2953
+ try {
2954
+ if (!('indexedDB' in window)) {
2955
+ log.info("This browser doesn't support IndexedDB");
2956
+ return Promise.resolve();
2957
+ }
2958
+ return Promise.resolve(ensureStore(dbName, storeName, keyPath)).then(function (db) {
2959
+ var _temp = _finallyRethrows(function () {
2960
+ var tx = db.transaction(storeName, 'readwrite');
2961
+ var store = tx.objectStore(storeName);
2962
+ data.forEach(function (value) {
2963
+ putWithPossibleOutOfLineKey(store, value, keyPath);
2964
+ });
2965
+ return Promise.resolve(awaitTransaction(tx)).then(function () {});
2966
+ }, function (_wasThrown, _result) {
2967
+ db.close();
2968
+ if (_wasThrown) throw _result;
2969
+ return _result;
2972
2970
  });
2973
- } else {
2974
- var newTransaction = db.transaction(storeName, 'readwrite');
2975
- var _store = newTransaction.objectStore(storeName);
2976
- data.forEach(function (value) {
2977
- var request = _store.put(value);
2978
- request.onsuccess = function () {
2979
- log.info('data added to db.. ', request.result);
2980
- };
2981
- request.onerror = function () {
2982
- log.info('Error on put channel to db .. ', request.error);
2983
- };
2971
+ if (_temp && _temp.then) return _temp.then(function () {});
2972
+ });
2973
+ } catch (e) {
2974
+ return Promise.reject(e);
2975
+ }
2976
+ };
2977
+ var getDataFromDB = function getDataFromDB(dbName, storeName, keyPathValue, keyPathName) {
2978
+ try {
2979
+ return Promise.resolve(_catch(function () {
2980
+ return Promise.resolve(openDatabase(dbName)).then(function (db) {
2981
+ var _exit = false;
2982
+ function _temp5(_result2) {
2983
+ if (_exit) return _result2;
2984
+ var tx = db.transaction(storeName, 'readonly');
2985
+ var objectStore = tx.objectStore(storeName);
2986
+ return Promise.resolve(new Promise(function (resolve, reject) {
2987
+ var request = objectStore.get(keyPathValue);
2988
+ request.onsuccess = function () {
2989
+ return resolve(request.result);
2990
+ };
2991
+ request.onerror = function () {
2992
+ return reject(request.error);
2993
+ };
2994
+ })).then(function (result) {
2995
+ db.close();
2996
+ return result || '';
2997
+ });
2998
+ }
2999
+ var _temp4 = function () {
3000
+ if (!db.objectStoreNames.contains(storeName)) {
3001
+ var _temp3 = function _temp3() {
3002
+ _exit = true;
3003
+ return '';
3004
+ };
3005
+ db.close();
3006
+ var _temp2 = function () {
3007
+ if (keyPathName) {
3008
+ return Promise.resolve(ensureStore(dbName, storeName, keyPathName)).then(function (upgraded) {
3009
+ upgraded.close();
3010
+ });
3011
+ }
3012
+ }();
3013
+ return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
3014
+ }
3015
+ }();
3016
+ return _temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4);
2984
3017
  });
2985
- }
3018
+ }, function (error) {
3019
+ log.error('Error retrieving data: ', error);
3020
+ return '';
3021
+ }));
3022
+ } catch (e) {
3023
+ return Promise.reject(e);
2986
3024
  }
2987
3025
  };
2988
3026
  var getAllStoreNames = function getAllStoreNames(dbName) {
2989
- return new Promise(function (resolve, reject) {
2990
- var openRequest = indexedDB.open(dbName, currentVersion);
2991
- openRequest.onupgradeneeded = function (event) {
2992
- var db = event.target.result;
2993
- resolve(Array.from(db.objectStoreNames));
2994
- };
2995
- openRequest.onerror = function () {
2996
- log.error('Indexeddb Error ', openRequest.error);
2997
- reject(openRequest.error);
2998
- };
2999
- openRequest.onsuccess = function (event) {
3000
- var db = event.target.result;
3027
+ try {
3028
+ return Promise.resolve(openDatabase(dbName)).then(function (db) {
3001
3029
  try {
3002
- var storeNames = Array.from(db.objectStoreNames);
3003
- db.close();
3004
- resolve(storeNames);
3005
- } catch (error) {
3030
+ return Array.from(db.objectStoreNames);
3031
+ } finally {
3006
3032
  db.close();
3007
- reject(error);
3008
3033
  }
3009
- };
3010
- });
3034
+ });
3035
+ } catch (e) {
3036
+ return Promise.reject(e);
3037
+ }
3011
3038
  };
3012
3039
  var deleteStore = function deleteStore(dbName, storeName) {
3013
- return new Promise(function (resolve, reject) {
3014
- var openRequest = indexedDB.open(dbName, currentVersion + 1);
3015
- openRequest.onupgradeneeded = function (event) {
3016
- var db = event.target.result;
3017
- if (db.objectStoreNames.contains(storeName)) {
3018
- db.deleteObjectStore(storeName);
3019
- currentVersion++;
3020
- }
3021
- };
3022
- openRequest.onerror = function () {
3023
- log.error('Indexeddb Error ', openRequest.error);
3024
- reject(openRequest.error);
3025
- };
3026
- openRequest.onsuccess = function (event) {
3027
- var db = event.target.result;
3040
+ try {
3041
+ return Promise.resolve(openDatabase(dbName)).then(function (db) {
3042
+ var shouldDelete = db.objectStoreNames.contains(storeName);
3028
3043
  db.close();
3029
- resolve();
3030
- };
3031
- });
3044
+ if (!shouldDelete) return;
3045
+ return Promise.resolve(runUpgrade(dbName, function (upgradeDb) {
3046
+ if (upgradeDb.objectStoreNames.contains(storeName)) {
3047
+ upgradeDb.deleteObjectStore(storeName);
3048
+ }
3049
+ })).then(function (upgraded) {
3050
+ upgraded.close();
3051
+ });
3052
+ });
3053
+ } catch (e) {
3054
+ return Promise.reject(e);
3055
+ }
3032
3056
  };
3033
3057
 
3034
3058
  var METADATA_DB_NAME = 'sceyt-metadata-db';
@@ -3051,7 +3075,7 @@ var storeMetadata = function storeMetadata(url, metadata) {
3051
3075
  expiresAt: Date.now() + CACHE_DURATION
3052
3076
  });
3053
3077
  var _temp = _catch(function () {
3054
- return Promise.resolve(_setDataToDB(METADATA_DB_NAME, currentMonth, [metadataRecord], 'url')).then(function () {});
3078
+ return Promise.resolve(setDataToDB(METADATA_DB_NAME, currentMonth, [metadataRecord], 'url')).then(function () {});
3055
3079
  }, function (error) {
3056
3080
  console.error('Failed to store metadata in IndexedDB:', error);
3057
3081
  });
@@ -3099,7 +3123,7 @@ var cleanupOldMonthsMetadata = function cleanupOldMonthsMetadata() {
3099
3123
  var getMetadata = function getMetadata(url) {
3100
3124
  return Promise.resolve(_catch(function () {
3101
3125
  var currentMonth = getCurrentMonthKey();
3102
- return Promise.resolve(_getDataFromDB(METADATA_DB_NAME, currentMonth, url, 'url')).then(function (result) {
3126
+ return Promise.resolve(getDataFromDB(METADATA_DB_NAME, currentMonth, url, 'url')).then(function (result) {
3103
3127
  if (!result || typeof result === 'string') {
3104
3128
  return null;
3105
3129
  }
@@ -10937,11 +10961,11 @@ var defaultTheme = {
10937
10961
  light: '#D9D9DF',
10938
10962
  dark: '#303032'
10939
10963
  }, _colors[THEME_COLORS.OVERLAY_BACKGROUND] = {
10940
- light: 'rgba(0, 0, 0, 0.5)',
10941
- dark: 'rgba(0, 0, 0, 0.5)'
10964
+ light: '#111539',
10965
+ dark: '#111539'
10942
10966
  }, _colors[THEME_COLORS.OVERLAY_BACKGROUND_2] = {
10943
- light: 'rgba(17, 21, 57, 0.4)',
10944
- dark: 'rgba(17, 21, 57, 0.4)'
10967
+ light: '#111539',
10968
+ dark: '#111539'
10945
10969
  }, _colors[THEME_COLORS.WARNING] = {
10946
10970
  light: '#FA4C56',
10947
10971
  dark: '#FA4C56'
@@ -11267,11 +11291,12 @@ var sendTypingAC = function sendTypingAC(state) {
11267
11291
  }
11268
11292
  };
11269
11293
  };
11270
- var sendRecordingAC = function sendRecordingAC(state) {
11294
+ var sendRecordingAC = function sendRecordingAC(state, channelId) {
11271
11295
  return {
11272
11296
  type: SEND_RECORDING,
11273
11297
  payload: {
11274
- state: state
11298
+ state: state,
11299
+ channelId: channelId
11275
11300
  }
11276
11301
  };
11277
11302
  };
@@ -12897,7 +12922,7 @@ var UploadPercent = styled__default.span(_templateObject38 || (_templateObject38
12897
12922
  }, function (props) {
12898
12923
  return props.fileAttachment || props.isRepliedMessage || props.isDetailsView ? '40px' : '56px';
12899
12924
  }, function (props) {
12900
- return props.backgroundColor + "40";
12925
+ return props.backgroundColor + "66";
12901
12926
  }, function (props) {
12902
12927
  return props.borderRadius ? props.borderRadius : props.fileAttachment ? '8px' : props.isRepliedMessage ? '4px' : ' 50%';
12903
12928
  }, function (props) {
@@ -16218,47 +16243,43 @@ function sendTyping(action) {
16218
16243
  }, _marked22, null, [[3, 7]]);
16219
16244
  }
16220
16245
  function sendRecording(action) {
16221
- var state, activeChannelId, channel, _t24;
16246
+ var _action$payload, state, channelId, channel, _t24;
16222
16247
  return _regenerator().w(function (_context23) {
16223
16248
  while (1) switch (_context23.p = _context23.n) {
16224
16249
  case 0:
16225
- state = action.payload.state;
16250
+ _action$payload = action.payload, state = _action$payload.state, channelId = _action$payload.channelId;
16226
16251
  _context23.n = 1;
16227
- return effects.call(getActiveChannelId);
16252
+ return effects.call(getChannelFromMap, channelId);
16228
16253
  case 1:
16229
- activeChannelId = _context23.v;
16230
- _context23.n = 2;
16231
- return effects.call(getChannelFromMap, activeChannelId);
16232
- case 2:
16233
16254
  channel = _context23.v;
16234
- _context23.p = 3;
16255
+ _context23.p = 2;
16235
16256
  if (!channel) {
16236
- _context23.n = 6;
16257
+ _context23.n = 5;
16237
16258
  break;
16238
16259
  }
16239
16260
  if (!state) {
16240
- _context23.n = 5;
16261
+ _context23.n = 4;
16241
16262
  break;
16242
16263
  }
16243
- _context23.n = 4;
16264
+ _context23.n = 3;
16244
16265
  return effects.call(channel.startRecording);
16245
- case 4:
16246
- _context23.n = 6;
16266
+ case 3:
16267
+ _context23.n = 5;
16247
16268
  break;
16248
- case 5:
16249
- _context23.n = 6;
16269
+ case 4:
16270
+ _context23.n = 5;
16250
16271
  return effects.call(channel.stopRecording);
16251
- case 6:
16252
- _context23.n = 8;
16272
+ case 5:
16273
+ _context23.n = 7;
16253
16274
  break;
16254
- case 7:
16255
- _context23.p = 7;
16275
+ case 6:
16276
+ _context23.p = 6;
16256
16277
  _t24 = _context23.v;
16257
16278
  log.error('ERROR in send recording', _t24);
16258
- case 8:
16279
+ case 7:
16259
16280
  return _context23.a(2);
16260
16281
  }
16261
- }, _marked23, null, [[3, 7]]);
16282
+ }, _marked23, null, [[2, 6]]);
16262
16283
  }
16263
16284
  function clearHistory(action) {
16264
16285
  var payload, channelId, channel, activeChannelId, groupName, _t25;
@@ -17239,7 +17260,7 @@ function sendMessage(action) {
17239
17260
  } else {
17240
17261
  var pendingAttachment = getPendingAttachment(attachment.tid);
17241
17262
  if (!attachment.cachedUrl) {
17242
- _setDataToDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, [_extends({}, updatedAttachment, {
17263
+ setDataToDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, [_extends({}, updatedAttachment, {
17243
17264
  checksum: pendingAttachment.checksum
17244
17265
  })], 'checksum');
17245
17266
  }
@@ -17397,7 +17418,7 @@ function sendMessage(action) {
17397
17418
  });
17398
17419
  pendingAttachment = getPendingAttachment(messageAttachment[k].tid);
17399
17420
  if (!messageAttachment[k].cachedUrl) {
17400
- _setDataToDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, [_extends({}, messageResponse.attachments[k], {
17421
+ setDataToDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, [_extends({}, messageResponse.attachments[k], {
17401
17422
  checksum: pendingAttachment.checksum || (pendingAttachment === null || pendingAttachment === void 0 ? void 0 : pendingAttachment.file)
17402
17423
  })], 'checksum');
17403
17424
  }
@@ -18315,23 +18336,22 @@ function getMessagesQuery(action) {
18315
18336
  return _regenerator().w(function (_context9) {
18316
18337
  while (1) switch (_context9.p = _context9.n) {
18317
18338
  case 0:
18318
- log.info('getMessagesQuery ... ');
18319
- _context9.p = 1;
18320
- _context9.n = 2;
18339
+ _context9.p = 0;
18340
+ _context9.n = 1;
18321
18341
  return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADING));
18322
- case 2:
18342
+ case 1:
18323
18343
  _action$payload = action.payload, channel = _action$payload.channel, loadWithLastMessage = _action$payload.loadWithLastMessage, messageId = _action$payload.messageId, limit = _action$payload.limit, withDeliveredMessages = _action$payload.withDeliveredMessages, highlight = _action$payload.highlight;
18324
18344
  if (!(channel.id && !channel.isMockChannel)) {
18325
- _context9.n = 49;
18345
+ _context9.n = 47;
18326
18346
  break;
18327
18347
  }
18328
18348
  SceytChatClient = getClient();
18329
18349
  messageQueryBuilder = new SceytChatClient.MessageListQueryBuilder(channel.id);
18330
18350
  messageQueryBuilder.limit(limit || MESSAGES_MAX_LENGTH);
18331
18351
  messageQueryBuilder.reverse(true);
18332
- _context9.n = 3;
18352
+ _context9.n = 2;
18333
18353
  return effects.call(messageQueryBuilder.build);
18334
- case 3:
18354
+ case 2:
18335
18355
  messageQuery = _context9.v;
18336
18356
  query.messageQuery = messageQuery;
18337
18357
  cachedMessages = getMessagesFromMap(channel.id);
@@ -18340,33 +18360,33 @@ function getMessagesQuery(action) {
18340
18360
  hasNext: false
18341
18361
  };
18342
18362
  if (!loadWithLastMessage) {
18343
- _context9.n = 15;
18363
+ _context9.n = 13;
18344
18364
  break;
18345
18365
  }
18346
18366
  allMessages = getAllMessages();
18347
18367
  havLastMessage = allMessages && allMessages.length && channel.lastMessage && allMessages[allMessages.length - 1] && allMessages[allMessages.length - 1].id === channel.lastMessage.id;
18348
18368
  if (!(channel.newMessageCount && channel.newMessageCount > 0 || !havLastMessage)) {
18349
- _context9.n = 10;
18369
+ _context9.n = 8;
18350
18370
  break;
18351
18371
  }
18352
18372
  setHasPrevCached(false);
18353
18373
  setAllMessages([]);
18354
- _context9.n = 4;
18374
+ _context9.n = 3;
18355
18375
  return effects.call(messageQuery.loadPreviousMessageId, '0');
18356
- case 4:
18376
+ case 3:
18357
18377
  result = _context9.v;
18358
18378
  if (!(result.messages.length === 50)) {
18359
- _context9.n = 6;
18379
+ _context9.n = 5;
18360
18380
  break;
18361
18381
  }
18362
18382
  messageQuery.limit = 30;
18363
- _context9.n = 5;
18383
+ _context9.n = 4;
18364
18384
  return effects.call(messageQuery.loadPreviousMessageId, result.messages[0].id);
18365
- case 5:
18385
+ case 4:
18366
18386
  secondResult = _context9.v;
18367
18387
  result.messages = [].concat(secondResult.messages, result.messages);
18368
18388
  result.hasNext = secondResult.hasNext;
18369
- case 6:
18389
+ case 5:
18370
18390
  sentMessages = [];
18371
18391
  if (withDeliveredMessages) {
18372
18392
  sentMessages = getFromAllMessagesByMessageId('', '', true);
@@ -18379,43 +18399,40 @@ function getMessagesQuery(action) {
18379
18399
  return !messagesMap[msg.tid || ''];
18380
18400
  });
18381
18401
  result.messages = [].concat(result.messages, filteredSentMessages).slice(filteredSentMessages.length);
18382
- _context9.n = 7;
18402
+ _context9.n = 6;
18383
18403
  return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
18384
- case 7:
18404
+ case 6:
18385
18405
  setMessagesToMap(channel.id, result.messages);
18386
18406
  setAllMessages(result.messages);
18387
- _context9.n = 8;
18407
+ _context9.n = 7;
18388
18408
  return effects.put(setMessagesHasPrevAC(true));
18409
+ case 7:
18410
+ _context9.n = 10;
18411
+ break;
18389
18412
  case 8:
18413
+ result.messages = getFromAllMessagesByMessageId('', '', true);
18390
18414
  _context9.n = 9;
18391
- return effects.put(markChannelAsReadAC(channel.id));
18415
+ return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
18392
18416
  case 9:
18393
- _context9.n = 12;
18394
- break;
18417
+ _context9.n = 10;
18418
+ return effects.put(setMessagesHasPrevAC(true));
18395
18419
  case 10:
18396
- result.messages = getFromAllMessagesByMessageId('', '', true);
18397
18420
  _context9.n = 11;
18398
- return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
18399
- case 11:
18400
- _context9.n = 12;
18401
- return effects.put(setMessagesHasPrevAC(true));
18402
- case 12:
18403
- _context9.n = 13;
18404
18421
  return effects.put(setMessagesHasNextAC(false));
18405
- case 13:
18422
+ case 11:
18406
18423
  setHasNextCached(false);
18407
18424
  if (!messageId) {
18408
- _context9.n = 14;
18425
+ _context9.n = 12;
18409
18426
  break;
18410
18427
  }
18411
- _context9.n = 14;
18428
+ _context9.n = 12;
18412
18429
  return effects.put(setScrollToMessagesAC(messageId, highlight));
18413
- case 14:
18414
- _context9.n = 46;
18430
+ case 12:
18431
+ _context9.n = 44;
18415
18432
  break;
18416
- case 15:
18433
+ case 13:
18417
18434
  if (!messageId) {
18418
- _context9.n = 27;
18435
+ _context9.n = 25;
18419
18436
  break;
18420
18437
  }
18421
18438
  _allMessages = getAllMessages();
@@ -18424,160 +18441,160 @@ function getMessagesQuery(action) {
18424
18441
  });
18425
18442
  maxLengthPart = MESSAGES_MAX_LENGTH / 2;
18426
18443
  if (!(messageIndex >= maxLengthPart)) {
18427
- _context9.n = 17;
18444
+ _context9.n = 15;
18428
18445
  break;
18429
18446
  }
18430
18447
  result.messages = _allMessages.slice(messageIndex - maxLengthPart, messageIndex + maxLengthPart);
18431
- _context9.n = 16;
18448
+ _context9.n = 14;
18432
18449
  return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
18433
- case 16:
18450
+ case 14:
18434
18451
  setHasPrevCached(messageIndex > maxLengthPart);
18435
18452
  setHasNextCached(_allMessages.length > maxLengthPart);
18436
- _context9.n = 24;
18453
+ _context9.n = 22;
18437
18454
  break;
18438
- case 17:
18455
+ case 15:
18439
18456
  messageQuery.limit = MESSAGES_MAX_LENGTH;
18440
18457
  log.info('load by message id from server ...............', messageId);
18441
- _context9.n = 18;
18458
+ _context9.n = 16;
18442
18459
  return effects.call(messageQuery.loadNearMessageId, messageId);
18443
- case 18:
18460
+ case 16:
18444
18461
  result = _context9.v;
18445
18462
  if (!(result.messages.length === 50)) {
18446
- _context9.n = 21;
18463
+ _context9.n = 19;
18447
18464
  break;
18448
18465
  }
18449
18466
  messageQuery.limit = (MESSAGES_MAX_LENGTH - 50) / 2;
18450
- _context9.n = 19;
18467
+ _context9.n = 17;
18451
18468
  return effects.call(messageQuery.loadPreviousMessageId, result.messages[0].id);
18452
- case 19:
18469
+ case 17:
18453
18470
  _secondResult = _context9.v;
18454
18471
  messageQuery.reverse = false;
18455
- _context9.n = 20;
18472
+ _context9.n = 18;
18456
18473
  return effects.call(messageQuery.loadNextMessageId, result.messages[result.messages.length - 1].id);
18457
- case 20:
18474
+ case 18:
18458
18475
  thirdResult = _context9.v;
18459
18476
  result.messages = [].concat(_secondResult.messages, result.messages, thirdResult.messages);
18460
18477
  result.hasNext = _secondResult.hasNext;
18461
18478
  messageQuery.reverse = true;
18462
- case 21:
18479
+ case 19:
18463
18480
  log.info('result from server ....... ', result);
18464
- _context9.n = 22;
18481
+ _context9.n = 20;
18465
18482
  return effects.put(setMessagesHasNextAC(true));
18466
- case 22:
18467
- _context9.n = 23;
18483
+ case 20:
18484
+ _context9.n = 21;
18468
18485
  return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
18469
- case 23:
18486
+ case 21:
18470
18487
  setAllMessages([].concat(result.messages));
18471
18488
  setHasPrevCached(false);
18472
18489
  setHasNextCached(false);
18473
- case 24:
18474
- _context9.n = 25;
18490
+ case 22:
18491
+ _context9.n = 23;
18475
18492
  return effects.put(setScrollToMessagesAC(messageId));
18476
- case 25:
18477
- _context9.n = 26;
18493
+ case 23:
18494
+ _context9.n = 24;
18478
18495
  return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
18479
- case 26:
18480
- _context9.n = 46;
18496
+ case 24:
18497
+ _context9.n = 44;
18481
18498
  break;
18482
- case 27:
18499
+ case 25:
18483
18500
  if (!(channel.newMessageCount && channel.lastDisplayedMessageId)) {
18484
- _context9.n = 40;
18501
+ _context9.n = 38;
18485
18502
  break;
18486
18503
  }
18487
18504
  setAllMessages([]);
18488
18505
  messageQuery.limit = MESSAGES_MAX_LENGTH;
18489
18506
  if (!Number(channel.lastDisplayedMessageId)) {
18490
- _context9.n = 33;
18507
+ _context9.n = 31;
18491
18508
  break;
18492
18509
  }
18493
- _context9.n = 28;
18510
+ _context9.n = 26;
18494
18511
  return effects.call(messageQuery.loadNearMessageId, channel.lastDisplayedMessageId);
18495
- case 28:
18512
+ case 26:
18496
18513
  result = _context9.v;
18497
18514
  if (!(result.messages.length === 50)) {
18498
- _context9.n = 32;
18515
+ _context9.n = 30;
18499
18516
  break;
18500
18517
  }
18501
18518
  messageQuery.limit = channel.newMessageCount > 25 ? (MESSAGES_MAX_LENGTH - 50) / 2 : MESSAGES_MAX_LENGTH - 50;
18502
- _context9.n = 29;
18519
+ _context9.n = 27;
18503
18520
  return effects.call(messageQuery.loadPreviousMessageId, result.messages[0].id);
18504
- case 29:
18521
+ case 27:
18505
18522
  _secondResult2 = _context9.v;
18506
18523
  if (!(channel.newMessageCount > 25)) {
18507
- _context9.n = 31;
18524
+ _context9.n = 29;
18508
18525
  break;
18509
18526
  }
18510
18527
  messageQuery.reverse = false;
18511
- _context9.n = 30;
18528
+ _context9.n = 28;
18512
18529
  return effects.call(messageQuery.loadNextMessageId, result.messages[result.messages.length - 1].id);
18513
- case 30:
18530
+ case 28:
18514
18531
  _thirdResult = _context9.v;
18515
18532
  result.messages = [].concat(_secondResult2.messages, result.messages, _thirdResult.messages);
18516
18533
  messageQuery.reverse = true;
18517
- _context9.n = 32;
18534
+ _context9.n = 30;
18518
18535
  break;
18519
- case 31:
18536
+ case 29:
18520
18537
  result.messages = [].concat(_secondResult2.messages, result.messages);
18521
- case 32:
18522
- _context9.n = 36;
18523
- break;
18524
- case 33:
18538
+ case 30:
18525
18539
  _context9.n = 34;
18540
+ break;
18541
+ case 31:
18542
+ _context9.n = 32;
18526
18543
  return effects.call(messageQuery.loadPrevious);
18527
- case 34:
18544
+ case 32:
18528
18545
  result = _context9.v;
18529
18546
  if (!(result.messages.length === 50)) {
18530
- _context9.n = 36;
18547
+ _context9.n = 34;
18531
18548
  break;
18532
18549
  }
18533
18550
  messageQuery.limit = MESSAGES_MAX_LENGTH - 50;
18534
- _context9.n = 35;
18551
+ _context9.n = 33;
18535
18552
  return effects.call(messageQuery.loadPreviousMessageId, result.messages[0].id);
18536
- case 35:
18553
+ case 33:
18537
18554
  _secondResult3 = _context9.v;
18538
18555
  result.messages = [].concat(_secondResult3.messages, result.messages);
18539
18556
  result.hasNext = _secondResult3.hasNext;
18540
- case 36:
18557
+ case 34:
18541
18558
  setMessagesToMap(channel.id, result.messages);
18542
- _context9.n = 37;
18559
+ _context9.n = 35;
18543
18560
  return effects.put(setMessagesHasPrevAC(true));
18544
- case 37:
18545
- _context9.n = 38;
18561
+ case 35:
18562
+ _context9.n = 36;
18546
18563
  return effects.put(setMessagesHasNextAC(channel.lastMessage && result.messages.length > 0 && channel.lastMessage.id !== result.messages[result.messages.length - 1].id));
18547
- case 38:
18564
+ case 36:
18548
18565
  setAllMessages([].concat(result.messages));
18549
- _context9.n = 39;
18566
+ _context9.n = 37;
18550
18567
  return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
18551
- case 39:
18552
- _context9.n = 46;
18568
+ case 37:
18569
+ _context9.n = 44;
18553
18570
  break;
18554
- case 40:
18571
+ case 38:
18555
18572
  setAllMessages([]);
18556
18573
  if (!(cachedMessages && cachedMessages.length)) {
18557
- _context9.n = 41;
18574
+ _context9.n = 39;
18558
18575
  break;
18559
18576
  }
18560
18577
  setAllMessages([].concat(cachedMessages));
18561
- _context9.n = 41;
18578
+ _context9.n = 39;
18562
18579
  return effects.put(setMessagesAC(JSON.parse(JSON.stringify(cachedMessages))));
18563
- case 41:
18580
+ case 39:
18564
18581
  log.info('load message from server');
18565
- _context9.n = 42;
18582
+ _context9.n = 40;
18566
18583
  return effects.call(messageQuery.loadPrevious);
18567
- case 42:
18584
+ case 40:
18568
18585
  result = _context9.v;
18569
18586
  if (!(result.messages.length === 50)) {
18570
- _context9.n = 44;
18587
+ _context9.n = 42;
18571
18588
  break;
18572
18589
  }
18573
18590
  messageQuery.limit = MESSAGES_MAX_LENGTH - 50;
18574
- _context9.n = 43;
18591
+ _context9.n = 41;
18575
18592
  return effects.call(messageQuery.loadPreviousMessageId, result.messages[0].id);
18576
- case 43:
18593
+ case 41:
18577
18594
  _secondResult4 = _context9.v;
18578
18595
  result.messages = [].concat(_secondResult4.messages, result.messages);
18579
18596
  result.hasNext = _secondResult4.hasNext;
18580
- case 44:
18597
+ case 42:
18581
18598
  result.messages.forEach(function (msg) {
18582
18599
  updateMessageOnMap(channel.id, {
18583
18600
  messageId: msg.id,
@@ -18585,15 +18602,15 @@ function getMessagesQuery(action) {
18585
18602
  });
18586
18603
  updateMessageOnAllMessages(msg.id, msg);
18587
18604
  });
18588
- _context9.n = 45;
18605
+ _context9.n = 43;
18589
18606
  return effects.put(setMessagesHasPrevAC(result.hasNext));
18590
- case 45:
18591
- _context9.n = 46;
18607
+ case 43:
18608
+ _context9.n = 44;
18592
18609
  return effects.put(setMessagesHasNextAC(false));
18593
- case 46:
18610
+ case 44:
18594
18611
  pendingMessages = getPendingMessages(channel.id);
18595
18612
  if (!(pendingMessages && pendingMessages.length)) {
18596
- _context9.n = 48;
18613
+ _context9.n = 46;
18597
18614
  break;
18598
18615
  }
18599
18616
  _messagesMap = {};
@@ -18603,40 +18620,40 @@ function getMessagesQuery(action) {
18603
18620
  filteredPendingMessages = pendingMessages.filter(function (msg) {
18604
18621
  return !_messagesMap[msg.tid || ''];
18605
18622
  });
18606
- _context9.n = 47;
18623
+ _context9.n = 45;
18607
18624
  return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
18608
- case 47:
18625
+ case 45:
18609
18626
  for (index = 0; index < filteredPendingMessages.length; index++) {
18610
18627
  mes = filteredPendingMessages[index];
18611
18628
  removePendingMessageFromMap(channel === null || channel === void 0 ? void 0 : channel.id, mes.tid || mes.id);
18612
18629
  }
18613
- case 48:
18614
- _context9.n = 50;
18630
+ case 46:
18631
+ _context9.n = 48;
18615
18632
  break;
18616
- case 49:
18633
+ case 47:
18617
18634
  if (!channel.isMockChannel) {
18618
- _context9.n = 50;
18635
+ _context9.n = 48;
18619
18636
  break;
18620
18637
  }
18621
- _context9.n = 50;
18638
+ _context9.n = 48;
18622
18639
  return effects.put(setMessagesAC([]));
18623
- case 50:
18624
- _context9.n = 52;
18640
+ case 48:
18641
+ _context9.n = 50;
18625
18642
  break;
18626
- case 51:
18627
- _context9.p = 51;
18643
+ case 49:
18644
+ _context9.p = 49;
18628
18645
  _t9 = _context9.v;
18629
18646
  log.error('error in message query', _t9);
18630
- case 52:
18631
- _context9.p = 52;
18632
- _context9.n = 53;
18647
+ case 50:
18648
+ _context9.p = 50;
18649
+ _context9.n = 51;
18633
18650
  return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
18634
- case 53:
18635
- return _context9.f(52);
18636
- case 54:
18651
+ case 51:
18652
+ return _context9.f(50);
18653
+ case 52:
18637
18654
  return _context9.a(2);
18638
18655
  }
18639
- }, _marked7$1, null, [[1, 51, 52, 54]]);
18656
+ }, _marked7$1, null, [[0, 49, 50, 52]]);
18640
18657
  }
18641
18658
  function loadMoreMessages(action) {
18642
18659
  var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result, _t0;
@@ -21014,15 +21031,15 @@ var Channel = function Channel(_ref3) {
21014
21031
  items: filteredItems,
21015
21032
  isTyping: !!filteredItems.find(function (item) {
21016
21033
  return item.typingState;
21034
+ }),
21035
+ isRecording: !!filteredItems.find(function (item) {
21036
+ return item.recordingState;
21017
21037
  })
21018
21038
  };
21019
21039
  }, [typingOrRecordingIndicator]);
21020
- var isTypingOrRecording = React.useMemo(function () {
21021
- return typingOrRecording.items.length > 0;
21022
- }, [typingOrRecording]);
21023
21040
  var MessageText = React.useMemo(function () {
21024
21041
  return /*#__PURE__*/React__default.createElement(ChannelMessageText, {
21025
- isTypingOrRecording: isTypingOrRecording,
21042
+ isTypingOrRecording: (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping) || (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording),
21026
21043
  user: user,
21027
21044
  contactsMap: contactsMap,
21028
21045
  getFromContacts: getFromContacts,
@@ -21036,7 +21053,7 @@ var Channel = function Channel(_ref3) {
21036
21053
  lastMessage: lastMessage,
21037
21054
  isDirectChannel: isDirectChannel
21038
21055
  });
21039
- }, [isTypingOrRecording, draftMessageText, lastMessage, user, contactsMap, getFromContacts, lastMessageMetas, accentColor, typingOrRecording, channel, isDirectChannel]);
21056
+ }, [typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping, typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording, draftMessageText, lastMessage, user, contactsMap, getFromContacts, lastMessageMetas, accentColor, typingOrRecording, channel, isDirectChannel]);
21040
21057
  return /*#__PURE__*/React__default.createElement(Container$2, {
21041
21058
  theme: theme,
21042
21059
  selectedChannel: channel.id === activeChannel.id,
@@ -21079,9 +21096,9 @@ var Channel = function Channel(_ref3) {
21079
21096
  unreadMentions: !!(channel.newMentionCount && channel.newMentionCount > 0),
21080
21097
  fontSize: channelLastMessageFontSize,
21081
21098
  height: channelLastMessageHeight
21082
- }, isTypingOrRecording ? !isDirectChannel ? (/*#__PURE__*/React__default.createElement(LastMessageAuthor, {
21099
+ }, typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping || typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording ? !isDirectChannel ? (/*#__PURE__*/React__default.createElement(LastMessageAuthor, {
21083
21100
  typing: typingOrRecording.isTyping,
21084
- recording: !typingOrRecording.isTyping,
21101
+ recording: typingOrRecording.isRecording,
21085
21102
  color: textPrimary
21086
21103
  }, /*#__PURE__*/React__default.createElement("span", {
21087
21104
  ref: messageAuthorRef
@@ -21099,11 +21116,11 @@ var Channel = function Channel(_ref3) {
21099
21116
  color: textPrimary
21100
21117
  }, /*#__PURE__*/React__default.createElement("span", {
21101
21118
  ref: messageAuthorRef
21102
- }, lastMessage.user.id === user.id ? 'You' : makeUsername(contactsMap && contactsMap[lastMessage.user.id], lastMessage.user, getFromContacts, true)))), !isTypingOrRecording && (isDirectChannel ? !isTypingOrRecording && (draftMessageText || lastMessage.user && lastMessage.state !== MESSAGE_STATUS.DELETE && (channel.lastReactedMessage && channel.newReactions && channel.newReactions[0] ? channel.newReactions[0].user && channel.newReactions[0].user.id === user.id : lastMessage.user.id === user.id)) : isTypingOrRecording && draftMessageText || lastMessage && lastMessage.state !== MESSAGE_STATUS.DELETE && lastMessage.type !== 'system') && (/*#__PURE__*/React__default.createElement(Points, {
21119
+ }, lastMessage.user.id === user.id ? 'You' : makeUsername(contactsMap && contactsMap[lastMessage.user.id], lastMessage.user, getFromContacts, true)))), !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) && !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording) && (isDirectChannel ? !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) && !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording) && (draftMessageText || lastMessage.user && lastMessage.state !== MESSAGE_STATUS.DELETE && (channel.lastReactedMessage && channel.newReactions && channel.newReactions[0] ? channel.newReactions[0].user && channel.newReactions[0].user.id === user.id : lastMessage.user.id === user.id)) : ((typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping) || (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording)) && draftMessageText || lastMessage && lastMessage.state !== MESSAGE_STATUS.DELETE && lastMessage.type !== 'system') && (/*#__PURE__*/React__default.createElement(Points, {
21103
21120
  color: draftMessageText && warningColor || textPrimary
21104
21121
  }, ": ")), /*#__PURE__*/React__default.createElement(LastMessageText, {
21105
21122
  color: textSecondary,
21106
- withAttachments: !!(lastMessage && lastMessage.attachments && lastMessage.attachments.length && lastMessage.attachments[0].type !== attachmentTypes.link) && !isTypingOrRecording,
21123
+ withAttachments: !!(lastMessage && lastMessage.attachments && lastMessage.attachments.length && lastMessage.attachments[0].type !== attachmentTypes.link) && (!(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping) || !(typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isRecording)),
21107
21124
  noBody: lastMessage && !lastMessage.body,
21108
21125
  deletedMessage: lastMessage && lastMessage.state === MESSAGE_STATUS.DELETE
21109
21126
  }, MessageText)))), /*#__PURE__*/React__default.createElement(ChannelStatus, {
@@ -21619,7 +21636,7 @@ var Container$4 = styled__default.div(_templateObject$8 || (_templateObject$8 =
21619
21636
  }, function (props) {
21620
21637
  return props.height ? props.height + "px" : '0px';
21621
21638
  }, function (props) {
21622
- return props.background + "40";
21639
+ return props.background + "66";
21623
21640
  });
21624
21641
 
21625
21642
  var _templateObject$9, _templateObject2$8, _templateObject3$5, _templateObject4$5, _templateObject5$3, _templateObject6$2, _templateObject7$2, _templateObject8$2, _templateObject9$2, _templateObject0$2, _templateObject1$2;
@@ -24063,7 +24080,7 @@ var Container$a = styled__default.div(_templateObject$j || (_templateObject$j =
24063
24080
  }, function (props) {
24064
24081
  return props.dateDividerTextColor;
24065
24082
  }, function (props) {
24066
- return props.dateDividerBackgroundColor + "40";
24083
+ return props.dateDividerBackgroundColor + "66";
24067
24084
  }, function (props) {
24068
24085
  return props.dateDividerBorderRadius || '14px';
24069
24086
  }, function (props) {
@@ -24699,7 +24716,7 @@ var VolumeSlide = styled__default.input(_templateObject9$6 || (_templateObject9$
24699
24716
  var Progress = styled__default.input(_templateObject0$5 || (_templateObject0$5 = _taggedTemplateLiteralLoose(["\n -webkit-appearance: none;\n margin-right: 15px;\n width: 100%;\n height: 4px;\n background: rgba(255, 255, 255, 0.6);\n border-radius: 5px;\n background-image: linear-gradient(#fff, #fff);\n //background-size: 70% 100%;\n background-repeat: no-repeat;\n cursor: pointer;\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer;\n box-shadow: 0 0 2px 0 #555;\n transition: all 0.3s ease-in-out;\n }\n &::-moz-range-thumb {\n -webkit-appearance: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer;\n box-shadow: 0 0 2px 0 #555;\n transition: all 0.3s ease-in-out;\n }\n\n &::-ms-thumb {\n -webkit-appearance: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer;\n box-shadow: 0 0 2px 0 #555;\n transition: all 0.3s ease-in-out;\n }\n\n &::-webkit-slider-thumb:hover {\n background: #fff;\n }\n &::-moz-range-thumb:hover {\n background: #fff;\n }\n &::-ms-thumb:hover {\n background: #fff;\n }\n\n &::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n transition: all 0.3s ease-in-out;\n }\n\n &::-moz-range-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n transition: all 0.3s ease-in-out;\n }\n &::-ms-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n transition: all 0.3s ease-in-out;\n }\n"])));
24700
24717
  var FullScreenWrapper = styled__default.div(_templateObject1$3 || (_templateObject1$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n margin-left: 16px;\n cursor: pointer;\n @media (max-width: 768px) {\n margin-left: 12px;\n & > svg {\n width: 18px;\n height: 18px;\n }\n }\n @media (max-width: 480px) {\n margin-left: auto;\n & > svg {\n width: 16px;\n height: 16px;\n }\n }\n"])));
24701
24718
 
24702
- var _templateObject$l, _templateObject2$i, _templateObject3$e, _templateObject4$c, _templateObject5$a, _templateObject6$8, _templateObject7$7, _templateObject8$7, _templateObject9$7, _templateObject0$6;
24719
+ var _templateObject$l, _templateObject2$i, _templateObject3$e, _templateObject4$c, _templateObject5$a, _templateObject6$8, _templateObject7$7, _templateObject8$7, _templateObject9$7, _templateObject0$6, _templateObject1$4;
24703
24720
  function ForwardMessagePopup(_ref) {
24704
24721
  var title = _ref.title,
24705
24722
  buttonText = _ref.buttonText,
@@ -24949,7 +24966,9 @@ function ForwardMessagePopup(_ref) {
24949
24966
  backgroundColor: 'transparent',
24950
24967
  checkedBackgroundColor: accentColor
24951
24968
  }));
24952
- }))))) : channels.map(function (channel) {
24969
+ }))), !searchedChannels.chats_groups.length && !searchedChannels.channels.length && (/*#__PURE__*/React__default.createElement(NoResults, {
24970
+ color: textSecondary
24971
+ }, "No channels found")))) : channels.map(function (channel) {
24953
24972
  var _channel$metadata3;
24954
24973
  var isDirectChannel = channel.type === DEFAULT_CHANNEL_TYPE.DIRECT;
24955
24974
  var isSelfChannel = isDirectChannel && ((_channel$metadata3 = channel.metadata) === null || _channel$metadata3 === void 0 ? void 0 : _channel$metadata3.s);
@@ -25033,6 +25052,9 @@ var SelectedChannelName = styled__default.span(_templateObject9$7 || (_templateO
25033
25052
  return props.color;
25034
25053
  });
25035
25054
  var StyledSubtractSvg$1 = styled__default(SvgCross)(_templateObject0$6 || (_templateObject0$6 = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin-left: 4px;\n transform: translate(2px, 0);\n"])));
25055
+ var NoResults = styled__default.div(_templateObject1$4 || (_templateObject1$4 = _taggedTemplateLiteralLoose(["\n font-size: 15px;\n line-height: 16px;\n font-weight: 500;\n text-align: center;\n margin-top: 20px;\n color: ", ";\n"])), function (props) {
25056
+ return props.color;
25057
+ });
25036
25058
 
25037
25059
  var _templateObject$m, _templateObject2$j;
25038
25060
  var CustomRadio = function CustomRadio(_ref) {
@@ -25206,7 +25228,7 @@ var DeleteOptionItem = styled__default.div(_templateObject2$k || (_templateObjec
25206
25228
  return props.color;
25207
25229
  });
25208
25230
 
25209
- var _templateObject$o, _templateObject2$l, _templateObject3$f, _templateObject4$d, _templateObject5$b, _templateObject6$9, _templateObject7$8, _templateObject8$8, _templateObject9$8, _templateObject0$7, _templateObject1$4, _templateObject10$2, _templateObject11$2, _templateObject12$2, _templateObject13$2;
25231
+ var _templateObject$o, _templateObject2$l, _templateObject3$f, _templateObject4$d, _templateObject5$b, _templateObject6$9, _templateObject7$8, _templateObject8$8, _templateObject9$8, _templateObject0$7, _templateObject1$5, _templateObject10$2, _templateObject11$2, _templateObject12$2, _templateObject13$2;
25210
25232
  var SliderPopup = function SliderPopup(_ref) {
25211
25233
  var channel = _ref.channel,
25212
25234
  setIsSliderOpen = _ref.setIsSliderOpen,
@@ -25593,7 +25615,7 @@ var SliderPopup = function SliderPopup(_ref) {
25593
25615
  text: '',
25594
25616
  styles: {
25595
25617
  background: {
25596
- fill: overlayBackground2 + "40"
25618
+ fill: overlayBackground2 + "66"
25597
25619
  },
25598
25620
  path: {
25599
25621
  stroke: textOnPrimary,
@@ -25747,7 +25769,7 @@ var FileSize = styled__default.span(_templateObject9$8 || (_templateObject9$8 =
25747
25769
  var UserName = styled__default.h4(_templateObject0$7 || (_templateObject0$7 = _taggedTemplateLiteralLoose(["\n margin: 0;\n color: ", ";\n font-weight: 500;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.2px;\n"])), function (props) {
25748
25770
  return props.color;
25749
25771
  });
25750
- var ActionsWrapper = styled__default.div(_templateObject1$4 || (_templateObject1$4 = _taggedTemplateLiteralLoose(["\n display: flex;\n"])));
25772
+ var ActionsWrapper = styled__default.div(_templateObject1$5 || (_templateObject1$5 = _taggedTemplateLiteralLoose(["\n display: flex;\n"])));
25751
25773
  var IconWrapper = styled__default.span(_templateObject10$2 || (_templateObject10$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n cursor: pointer;\n color: ", ";\n margin: ", ";\n\n & > svg {\n width: 28px;\n height: 28px;\n }\n\n ", "\n"])), function (props) {
25752
25774
  return props.color;
25753
25775
  }, function (props) {
@@ -25848,7 +25870,7 @@ var Container$c = styled__default.div(_templateObject$p || (_templateObject$p =
25848
25870
  }, function (props) {
25849
25871
  return props.textColor;
25850
25872
  }, function (props) {
25851
- return props.backgroundColor + "40";
25873
+ return props.backgroundColor + "66";
25852
25874
  }, function (props) {
25853
25875
  return props.border;
25854
25876
  }, function (props) {
@@ -26896,7 +26918,7 @@ var VideoTime = styled__default.div(_templateObject2$o || (_templateObject2$o =
26896
26918
  }, function (props) {
26897
26919
  return props.isRepliedMessage ? '0 3px' : '4px 6px';
26898
26920
  }, function (props) {
26899
- return props.messageTimeBackgroundColor + "40";
26921
+ return props.messageTimeBackgroundColor + "66";
26900
26922
  }, function (props) {
26901
26923
  return props.color;
26902
26924
  }, function (props) {
@@ -29092,7 +29114,7 @@ var Timer$1 = styled__default.div(_templateObject6$c || (_templateObject6$c = _t
29092
29114
  return props.color;
29093
29115
  });
29094
29116
 
29095
- var _templateObject$u, _templateObject2$q, _templateObject3$k, _templateObject4$h, _templateObject5$f, _templateObject6$d, _templateObject7$b, _templateObject8$a, _templateObject9$a, _templateObject0$9, _templateObject1$5, _templateObject10$3, _templateObject11$3;
29117
+ var _templateObject$u, _templateObject2$q, _templateObject3$k, _templateObject4$h, _templateObject5$f, _templateObject6$d, _templateObject7$b, _templateObject8$a, _templateObject9$a, _templateObject0$9, _templateObject1$6, _templateObject10$3, _templateObject11$3;
29096
29118
  var Attachment = function Attachment(_ref) {
29097
29119
  var attachment = _ref.attachment,
29098
29120
  _ref$isPreview = _ref.isPreview,
@@ -29510,7 +29532,7 @@ var Attachment = function Attachment(_ref) {
29510
29532
  text: '',
29511
29533
  styles: {
29512
29534
  background: {
29513
- fill: overlayBackground2 + "40"
29535
+ fill: overlayBackground2 + "66"
29514
29536
  },
29515
29537
  path: {
29516
29538
  stroke: textOnPrimary,
@@ -29560,7 +29582,7 @@ var Attachment = function Attachment(_ref) {
29560
29582
  text: '',
29561
29583
  styles: {
29562
29584
  background: {
29563
- fill: overlayBackground2 + "40"
29585
+ fill: overlayBackground2 + "66"
29564
29586
  },
29565
29587
  path: {
29566
29588
  stroke: textOnPrimary,
@@ -29667,7 +29689,7 @@ var Attachment = function Attachment(_ref) {
29667
29689
  text: '',
29668
29690
  styles: {
29669
29691
  background: {
29670
- fill: overlayBackground2 + "40"
29692
+ fill: overlayBackground2 + "66"
29671
29693
  },
29672
29694
  path: {
29673
29695
  stroke: textOnPrimary,
@@ -29759,7 +29781,7 @@ var AttachmentSize = styled__default.span(_templateObject0$9 || (_templateObject
29759
29781
  }, function (props) {
29760
29782
  return props.errorColor;
29761
29783
  });
29762
- var AttachmentFileInfo = styled__default.div(_templateObject1$5 || (_templateObject1$5 = _taggedTemplateLiteralLoose(["\n margin-left: 12px;\n ", "\n"])), function (props) {
29784
+ var AttachmentFileInfo = styled__default.div(_templateObject1$6 || (_templateObject1$6 = _taggedTemplateLiteralLoose(["\n margin-left: 12px;\n ", "\n"])), function (props) {
29763
29785
  return props.isPreview && "line-height: 14px;\n max-width: calc(100% - 44px);\n ";
29764
29786
  });
29765
29787
  var AttachmentImg$1 = styled__default.img(_templateObject10$3 || (_templateObject10$3 = _taggedTemplateLiteralLoose(["\n position: ", ";\n border-radius: ", ";\n padding: ", ";\n box-sizing: border-box;\n max-width: 100%;\n max-height: ", ";\n width: ", ";\n height: ", ";\n min-height: ", ";\n min-width: ", ";\n object-fit: cover;\n visibility: ", ";\n z-index: 2;\n"])), function (props) {
@@ -30839,7 +30861,7 @@ var MessageStatusAndTime = function MessageStatusAndTime(_ref) {
30839
30861
  }))));
30840
30862
  };
30841
30863
  var MessageStatusAndTime$1 = /*#__PURE__*/React__default.memo(MessageStatusAndTime, function (prevProps, nextProps) {
30842
- return prevProps.message.state === nextProps.message.state && prevProps.message.deliveryStatus === nextProps.message.deliveryStatus && prevProps.message.createdAt === nextProps.message.createdAt && prevProps.showMessageTimeAndStatusOnlyOnHover === nextProps.showMessageTimeAndStatusOnlyOnHover && prevProps.messageStatusSize === nextProps.messageStatusSize && prevProps.messageStatusColor === nextProps.messageStatusColor && prevProps.messageReadStatusColor === nextProps.messageReadStatusColor && prevProps.messageStateFontSize === nextProps.messageStateFontSize && prevProps.messageStateColor === nextProps.messageStateColor && prevProps.messageTimeFontSize === nextProps.messageTimeFontSize && prevProps.messageStatusAndTimeLineHeight === nextProps.messageStatusAndTimeLineHeight && prevProps.messageTimeColor === nextProps.messageTimeColor && prevProps.messageTimeVisible === nextProps.messageTimeVisible && prevProps.messageStatusVisible === nextProps.messageStatusVisible && prevProps.ownMessageOnRightSide === nextProps.ownMessageOnRightSide && prevProps.bottomOfMessage === nextProps.bottomOfMessage && prevProps.marginBottom === nextProps.marginBottom && prevProps.messageTimeColorOnAttachment === nextProps.messageTimeColorOnAttachment;
30864
+ return prevProps.message.state === nextProps.message.state && prevProps.message.deliveryStatus === nextProps.message.deliveryStatus && prevProps.message.createdAt === nextProps.message.createdAt && prevProps.showMessageTimeAndStatusOnlyOnHover === nextProps.showMessageTimeAndStatusOnlyOnHover && prevProps.messageStatusSize === nextProps.messageStatusSize && prevProps.messageStatusColor === nextProps.messageStatusColor && prevProps.messageReadStatusColor === nextProps.messageReadStatusColor && prevProps.messageStateFontSize === nextProps.messageStateFontSize && prevProps.messageStateColor === nextProps.messageStateColor && prevProps.messageTimeFontSize === nextProps.messageTimeFontSize && prevProps.messageStatusAndTimeLineHeight === nextProps.messageStatusAndTimeLineHeight && prevProps.messageTimeColor === nextProps.messageTimeColor && prevProps.messageTimeVisible === nextProps.messageTimeVisible && prevProps.messageStatusVisible === nextProps.messageStatusVisible && prevProps.ownMessageOnRightSide === nextProps.ownMessageOnRightSide && prevProps.bottomOfMessage === nextProps.bottomOfMessage && prevProps.marginBottom === nextProps.marginBottom && prevProps.messageTimeColorOnAttachment === nextProps.messageTimeColorOnAttachment && prevProps.withAttachment === nextProps.withAttachment;
30843
30865
  });
30844
30866
  var MessageStatus = styled__default.span(_templateObject$z || (_templateObject$z = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n margin-left: 4px;\n text-align: right;\n height: ", ";\n\n & > svg {\n height: 16px;\n width: 16px;\n }\n"])), function (props) {
30845
30867
  return props.height || '14px';
@@ -30858,7 +30880,7 @@ var MessageStatusAndTimeContainer = styled__default.span(_templateObject3$o || (
30858
30880
  }, function (props) {
30859
30881
  return props.withAttachment && '4px 6px';
30860
30882
  }, function (props) {
30861
- return props.withAttachment && !props.fileAttachment && props.messageTimeBackgroundColor + "40";
30883
+ return props.withAttachment && !props.fileAttachment && props.messageTimeBackgroundColor + "66";
30862
30884
  }, function (props) {
30863
30885
  return props.lineHeight || '14px';
30864
30886
  }, function (props) {
@@ -30914,7 +30936,7 @@ var OGMetadata = function OGMetadata(_ref) {
30914
30936
  var queryBuilder = new client.MessageLinkOGQueryBuilder(url);
30915
30937
  return Promise.resolve(queryBuilder.build()).then(function (query) {
30916
30938
  return Promise.resolve(query.loadOGData()).then(function (metadata) {
30917
- return Promise.resolve(storeMetadata(url.replace('https://', ''), metadata)).then(function () {
30939
+ return Promise.resolve(storeMetadata(url.replace('https://', '').replace('http://', ''), metadata)).then(function () {
30918
30940
  setMetadata(metadata);
30919
30941
  });
30920
30942
  });
@@ -30936,7 +30958,7 @@ var OGMetadata = function OGMetadata(_ref) {
30936
30958
  if (attachment !== null && attachment !== void 0 && attachment.id && !metadata) {
30937
30959
  var url = attachment === null || attachment === void 0 ? void 0 : attachment.url;
30938
30960
  if (url) {
30939
- getMetadata(url.replace('https://', '')).then(function (cachedMetadata) {
30961
+ getMetadata(url.replace('https://', '').replace('http://', '')).then(function (cachedMetadata) {
30940
30962
  try {
30941
30963
  if (cachedMetadata) {
30942
30964
  setMetadata(cachedMetadata);
@@ -31504,7 +31526,7 @@ var FrequentlyEmojisContainer = styled__default.div(_templateObject5$i || (_temp
31504
31526
  return props.rtlDirection && '0';
31505
31527
  });
31506
31528
 
31507
- var _templateObject$C, _templateObject2$x, _templateObject3$r, _templateObject4$n, _templateObject5$j, _templateObject6$g, _templateObject7$e, _templateObject8$d, _templateObject9$b, _templateObject0$a, _templateObject1$6, _templateObject10$4, _templateObject11$4, _templateObject12$3;
31529
+ var _templateObject$C, _templateObject2$x, _templateObject3$r, _templateObject4$n, _templateObject5$j, _templateObject6$g, _templateObject7$e, _templateObject8$d, _templateObject9$b, _templateObject0$a, _templateObject1$7, _templateObject10$4, _templateObject11$4, _templateObject12$3;
31508
31530
  var Message$1 = function Message(_ref) {
31509
31531
  var message = _ref.message,
31510
31532
  channel = _ref.channel,
@@ -31833,7 +31855,6 @@ var Message$1 = function Message(_ref) {
31833
31855
  if (isVisible && message.incoming && !(message.userMarkers && message.userMarkers.length && message.userMarkers.find(function (marker) {
31834
31856
  return marker.name === MESSAGE_DELIVERY_STATUS.READ;
31835
31857
  })) && channel.newMessageCount && channel.newMessageCount > 0 && connectionStatus === CONNECTION_STATUS.CONNECTED) {
31836
- log.info('send displayed marker for message ... ', message);
31837
31858
  dispatch(markMessagesAsReadAC(channel.id, [message.id]));
31838
31859
  }
31839
31860
  };
@@ -32282,7 +32303,7 @@ var ReactionsContainer = styled__default.div(_templateObject9$b || (_templateObj
32282
32303
  var MessageReactionsCont = styled__default.div(_templateObject0$a || (_templateObject0$a = _taggedTemplateLiteralLoose(["\n position: relative;\n display: inline-flex;\n max-width: 300px;\n direction: ", ";\n cursor: pointer;\n"])), function (props) {
32283
32304
  return props.rtlDirection && 'ltr';
32284
32305
  });
32285
- var MessageStatus$1 = styled__default.span(_templateObject1$6 || (_templateObject1$6 = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n margin-left: 4px;\n text-align: right;\n height: ", ";\n & > svg {\n height: 16px;\n width: 16px;\n }\n"])), function (props) {
32306
+ var MessageStatus$1 = styled__default.span(_templateObject1$7 || (_templateObject1$7 = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n margin-left: 4px;\n text-align: right;\n height: ", ";\n & > svg {\n height: 16px;\n width: 16px;\n }\n"])), function (props) {
32286
32307
  return props.height || '14px';
32287
32308
  });
32288
32309
  var HiddenMessageTime$1 = styled__default.span(_templateObject10$4 || (_templateObject10$4 = _taggedTemplateLiteralLoose(["\n display: ", ";\n font-weight: 400;\n font-size: ", ";\n color: ", ";\n"])), function (props) {
@@ -32327,7 +32348,7 @@ var HiddenMessageProperty;
32327
32348
  HiddenMessageProperty["hideAfterSendMessage"] = "hideAfterSendMessage";
32328
32349
  })(HiddenMessageProperty || (HiddenMessageProperty = {}));
32329
32350
 
32330
- var _templateObject$D, _templateObject2$y, _templateObject3$s, _templateObject4$o, _templateObject5$k, _templateObject6$h, _templateObject7$f, _templateObject8$e, _templateObject9$c, _templateObject0$b, _templateObject1$7;
32351
+ var _templateObject$D, _templateObject2$y, _templateObject3$s, _templateObject4$o, _templateObject5$k, _templateObject6$h, _templateObject7$f, _templateObject8$e, _templateObject9$c, _templateObject0$b, _templateObject1$8;
32331
32352
  var loadFromServer = false;
32332
32353
  var loadDirection = '';
32333
32354
  var nextDisable = false;
@@ -33337,7 +33358,7 @@ var MessageTopDate = styled__default.div(_templateObject4$o || (_templateObject4
33337
33358
  }, function (props) {
33338
33359
  return props.dateDividerTextColor;
33339
33360
  }, function (props) {
33340
- return props.dateDividerBackgroundColor + "40";
33361
+ return props.dateDividerBackgroundColor + "66";
33341
33362
  }, function (props) {
33342
33363
  return props.dateDividerBorder;
33343
33364
  }, function (props) {
@@ -33377,7 +33398,7 @@ var NoMessagesContainer = styled__default.div(_templateObject9$c || (_templateOb
33377
33398
  var NoMessagesTitle = styled__default.h4(_templateObject0$b || (_templateObject0$b = _taggedTemplateLiteralLoose(["\n margin: 12px 0 8px;\n font-family: Inter, sans-serif;\n text-align: center;\n font-size: 20px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px;\n color: ", ";\n"])), function (props) {
33378
33399
  return props.color;
33379
33400
  });
33380
- var NoMessagesText = styled__default.p(_templateObject1$7 || (_templateObject1$7 = _taggedTemplateLiteralLoose(["\n margin: 0;\n text-align: center;\n font-feature-settings:\n 'clig' off,\n 'liga' off;\n font-family: Inter, sans-serif;\n font-size: 15px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n color: ", ";\n"])), function (props) {
33401
+ var NoMessagesText = styled__default.p(_templateObject1$8 || (_templateObject1$8 = _taggedTemplateLiteralLoose(["\n margin: 0;\n text-align: center;\n font-feature-settings:\n 'clig' off,\n 'liga' off;\n font-family: Inter, sans-serif;\n font-size: 15px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n color: ", ";\n"])), function (props) {
33381
33402
  return props.color;
33382
33403
  });
33383
33404
 
@@ -35381,19 +35402,19 @@ var AudioRecord = function AudioRecord(_ref) {
35381
35402
  }, [currentRecordedFile]);
35382
35403
  var dispatch = reactRedux.useDispatch();
35383
35404
  var handleStartRecording = function handleStartRecording() {
35384
- dispatch(sendRecordingAC(true));
35405
+ dispatch(sendRecordingAC(true, currentChannelId));
35385
35406
  if (sendingInterval) {
35386
35407
  clearInterval(sendingInterval);
35387
35408
  setSendingInterval(null);
35388
35409
  return;
35389
35410
  }
35390
35411
  var interval = setInterval(function () {
35391
- dispatch(sendRecordingAC(true));
35412
+ dispatch(sendRecordingAC(true, currentChannelId));
35392
35413
  }, 1000);
35393
35414
  setSendingInterval(interval);
35394
35415
  };
35395
35416
  var handleStopRecording = function handleStopRecording() {
35396
- dispatch(sendRecordingAC(false));
35417
+ dispatch(sendRecordingAC(false, currentChannelId));
35397
35418
  if (sendingInterval) {
35398
35419
  clearInterval(sendingInterval);
35399
35420
  setSendingInterval(null);
@@ -35547,10 +35568,9 @@ var AudioRecord = function AudioRecord(_ref) {
35547
35568
  return Promise.resolve(_catch(function () {
35548
35569
  var _wavesurfer$current3;
35549
35570
  function _temp3(_result3) {
35571
+ var _wavesurfer$current$i, _wavesurfer$current$i2;
35550
35572
  if (_exit) return _result3;
35551
- if (draft) {
35552
- return;
35553
- }
35573
+ setCurrentTime(((_wavesurfer$current$i = wavesurfer.current[id]) === null || _wavesurfer$current$i === void 0 ? void 0 : (_wavesurfer$current$i2 = _wavesurfer$current$i.decodedData) === null || _wavesurfer$current$i2 === void 0 ? void 0 : _wavesurfer$current$i2.duration) || 0);
35554
35574
  wavesurfer.current[id].on('ready', function () {
35555
35575
  setRecordingIsReadyToPlay(true);
35556
35576
  var audioDuration = wavesurfer.current[id].getDuration();
@@ -35662,7 +35682,6 @@ var AudioRecord = function AudioRecord(_ref) {
35662
35682
  recorder.stop().getMp3().then(function (_ref4) {
35663
35683
  var buffer = _ref4[0],
35664
35684
  blob = _ref4[1];
35665
- setCurrentTime(0);
35666
35685
  var file = new File(buffer, 'record.mp3', {
35667
35686
  type: blob.type,
35668
35687
  lastModified: Date.now()
@@ -35728,15 +35747,12 @@ var AudioRecord = function AudioRecord(_ref) {
35728
35747
  if ((_wavesurfer$current5 = wavesurfer.current) !== null && _wavesurfer$current5 !== void 0 && _wavesurfer$current5[cId || currentChannelId]) {
35729
35748
  if (!wavesurfer.current[cId || currentChannelId].isPlaying()) {
35730
35749
  setPlayAudio(true);
35731
- handleStartRecording();
35732
35750
  intervalRef.current[cId || currentChannelId] = setInterval(function () {
35733
35751
  var currentTime = wavesurfer.current[cId || currentChannelId].getCurrentTime();
35734
35752
  if (currentTime >= 0) {
35735
35753
  setCurrentTime(currentTime);
35736
35754
  }
35737
35755
  }, 10);
35738
- } else {
35739
- handleStopRecording();
35740
35756
  }
35741
35757
  wavesurfer.current[cId || currentChannelId].playPause();
35742
35758
  }
@@ -35852,6 +35868,7 @@ var AudioRecord = function AudioRecord(_ref) {
35852
35868
  setRecordedFile(audioRecording || null);
35853
35869
  setRecordingIsReadyToPlay(!!audioRecording);
35854
35870
  }
35871
+ handleStopRecording();
35855
35872
  setCurrentChannelId(channelId);
35856
35873
  }, [channelId]);
35857
35874
  return /*#__PURE__*/React__default.createElement(Container$j, {
@@ -35966,7 +35983,7 @@ var RecordingAnimation = function RecordingAnimation(_ref2) {
35966
35983
  }));
35967
35984
  };
35968
35985
 
35969
- var _templateObject$J, _templateObject2$E, _templateObject3$x, _templateObject4$s, _templateObject5$o, _templateObject6$k, _templateObject7$i, _templateObject8$g, _templateObject9$d, _templateObject0$c, _templateObject1$8, _templateObject10$5, _templateObject11$5, _templateObject12$4, _templateObject13$3, _templateObject14$2, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$2, _templateObject21$1, _templateObject22$1, _templateObject23$1, _templateObject24$1, _templateObject25$1, _templateObject26$1, _templateObject27$1, _templateObject28$1, _templateObject29$1, _templateObject30$1, _templateObject31$1, _templateObject32$1, _templateObject33$1, _templateObject34$1;
35986
+ var _templateObject$J, _templateObject2$E, _templateObject3$x, _templateObject4$s, _templateObject5$o, _templateObject6$k, _templateObject7$i, _templateObject8$g, _templateObject9$d, _templateObject0$c, _templateObject1$9, _templateObject10$5, _templateObject11$5, _templateObject12$4, _templateObject13$3, _templateObject14$2, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$2, _templateObject21$1, _templateObject22$1, _templateObject23$1, _templateObject24$1, _templateObject25$1, _templateObject26$1, _templateObject27$1, _templateObject28$1, _templateObject29$1, _templateObject30$1, _templateObject31$1, _templateObject32$1, _templateObject33$1, _templateObject34$1;
35970
35987
  function AutoFocusPlugin(_ref) {
35971
35988
  var messageForReply = _ref.messageForReply;
35972
35989
  var _useLexicalComposerCo = LexicalComposerContext.useLexicalComposerContext(),
@@ -36875,7 +36892,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
36875
36892
  }
36876
36893
  var dataFromDb;
36877
36894
  var _temp11 = _catch(function () {
36878
- return Promise.resolve(_getDataFromDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, checksumHash, 'checksum')).then(function (_getDataFromDB) {
36895
+ return Promise.resolve(getDataFromDB(DB_NAMES.FILES_STORAGE, DB_STORE_NAMES.ATTACHMENTS, checksumHash, 'checksum')).then(function (_getDataFromDB) {
36879
36896
  dataFromDb = _getDataFromDB;
36880
36897
  });
36881
36898
  }, function (e) {
@@ -37215,16 +37232,21 @@ var SendMessageInput = function SendMessageInput(_ref3) {
37215
37232
  }
37216
37233
  };
37217
37234
  }, []);
37218
- var filteredTypingOrRecordingIndicator = React.useMemo(function () {
37219
- return typingOrRecordingIndicator ? Object.values(typingOrRecordingIndicator).filter(function (item) {
37235
+ var typingOrRecording = React.useMemo(function () {
37236
+ var dataValues = typingOrRecordingIndicator ? Object.values(typingOrRecordingIndicator) : [];
37237
+ var filteredItems = dataValues.filter(function (item) {
37220
37238
  return item.typingState || item.recordingState;
37221
- }) : [];
37222
- }, [typingOrRecordingIndicator]);
37223
- var isTyping = React.useMemo(function () {
37224
- return !!filteredTypingOrRecordingIndicator.find(function (item) {
37225
- return item.typingState;
37226
37239
  });
37227
- }, [filteredTypingOrRecordingIndicator]);
37240
+ return {
37241
+ items: filteredItems,
37242
+ isTyping: !!filteredItems.find(function (item) {
37243
+ return item.typingState;
37244
+ }),
37245
+ isRecording: !!filteredItems.find(function (item) {
37246
+ return item.recordingState;
37247
+ })
37248
+ };
37249
+ }, [typingOrRecordingIndicator]);
37228
37250
  var formatTypingIndicatorText = function formatTypingIndicatorText(users, maxShownUsers) {
37229
37251
  if (maxShownUsers === void 0) {
37230
37252
  maxShownUsers = 3;
@@ -37233,7 +37255,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
37233
37255
  if (users.length === 1) {
37234
37256
  var _user = users[0];
37235
37257
  var userName = makeUsername(getFromContacts && _user.from && contactsMap[_user.from.id], _user.from, getFromContacts);
37236
- return "" + userName + (isTyping ? activeChannel.type === DEFAULT_CHANNEL_TYPE.DIRECT ? ' is typing' : '' : activeChannel.type === DEFAULT_CHANNEL_TYPE.DIRECT ? ' is recording' : '');
37258
+ return "" + userName + (typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping ? activeChannel.type === DEFAULT_CHANNEL_TYPE.DIRECT ? ' is typing' : '' : activeChannel.type === DEFAULT_CHANNEL_TYPE.DIRECT ? ' is recording' : '');
37237
37259
  }
37238
37260
  if (users.length <= maxShownUsers) {
37239
37261
  var userNames = users.map(function (user) {
@@ -37303,8 +37325,8 @@ var SendMessageInput = function SendMessageInput(_ref3) {
37303
37325
  }, "Join")) : (activeChannel.type === DEFAULT_CHANNEL_TYPE.BROADCAST || activeChannel.type === DEFAULT_CHANNEL_TYPE.PUBLIC ? !(activeChannel.userRole === 'admin' || activeChannel.userRole === 'owner') : activeChannel.type !== DEFAULT_CHANNEL_TYPE.DIRECT && !checkActionPermission('sendMessage')) ? (/*#__PURE__*/React__default.createElement(ReadOnlyCont, {
37304
37326
  color: textPrimary,
37305
37327
  iconColor: accentColor
37306
- }, /*#__PURE__*/React__default.createElement(SvgEye, null), " Read only")) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TypingIndicator$1, null, filteredTypingOrRecordingIndicator.length > 0 && (CustomTypingIndicator ? (/*#__PURE__*/React__default.createElement(CustomTypingIndicator, {
37307
- from: filteredTypingOrRecordingIndicator.map(function (item) {
37328
+ }, /*#__PURE__*/React__default.createElement(SvgEye, null), " Read only")) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TypingIndicator$1, null, (typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.items.length) > 0 && (CustomTypingIndicator ? (/*#__PURE__*/React__default.createElement(CustomTypingIndicator, {
37329
+ from: typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.items.map(function (item) {
37308
37330
  return {
37309
37331
  id: item.from.id,
37310
37332
  name: item.from.name,
@@ -37314,7 +37336,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
37314
37336
  })
37315
37337
  })) : (/*#__PURE__*/React__default.createElement(TypingIndicatorCont, null, /*#__PURE__*/React__default.createElement(TypingFrom, {
37316
37338
  color: textSecondary
37317
- }, formatTypingIndicatorText(filteredTypingOrRecordingIndicator, 3)), isTyping ? (/*#__PURE__*/React__default.createElement(TypingAnimation, {
37339
+ }, formatTypingIndicatorText(typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.items, 3)), typingOrRecording !== null && typingOrRecording !== void 0 && typingOrRecording.isTyping ? (/*#__PURE__*/React__default.createElement(TypingAnimation, {
37318
37340
  borderColor: iconInactive
37319
37341
  }, /*#__PURE__*/React__default.createElement(DotOne, null), /*#__PURE__*/React__default.createElement(DotTwo, null), /*#__PURE__*/React__default.createElement(DotThree, null))) : (/*#__PURE__*/React__default.createElement(RecordingAnimation, {
37320
37342
  borderColor: iconInactive
@@ -37585,7 +37607,7 @@ var AddAttachmentIcon = styled__default.span(_templateObject0$c || (_templateObj
37585
37607
  }, function (props) {
37586
37608
  return props.hoverColor;
37587
37609
  });
37588
- var SendMessageInputContainer = styled__default.div(_templateObject1$8 || (_templateObject1$8 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-end;\n justify-content: space-between;\n position: relative;\n min-height: ", ";\n box-sizing: border-box;\n border-radius: ", ";\n\n & .dropdown-trigger.open {\n color: #ccc;\n\n & ", " {\n & > svg {\n color: ", ";\n }\n ;\n }\n }\n}\n"])), function (props) {
37610
+ var SendMessageInputContainer = styled__default.div(_templateObject1$9 || (_templateObject1$9 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-end;\n justify-content: space-between;\n position: relative;\n min-height: ", ";\n box-sizing: border-box;\n border-radius: ", ";\n\n & .dropdown-trigger.open {\n color: #ccc;\n\n & ", " {\n & > svg {\n color: ", ";\n }\n ;\n }\n }\n}\n"])), function (props) {
37589
37611
  return props.minHeight || '36px';
37590
37612
  }, function (props) {
37591
37613
  return props.messageForReply ? '0 0 4px 4px' : '4px';
@@ -37881,7 +37903,7 @@ function SvgUnpin(props) {
37881
37903
  })));
37882
37904
  }
37883
37905
 
37884
- var _templateObject$K, _templateObject2$F, _templateObject3$y, _templateObject4$t, _templateObject5$p, _templateObject6$l, _templateObject7$j, _templateObject8$h, _templateObject9$e, _templateObject0$d, _templateObject1$9, _templateObject10$6, _templateObject11$6, _templateObject12$5, _templateObject13$4, _templateObject14$3, _templateObject15$3, _templateObject16$3;
37906
+ var _templateObject$K, _templateObject2$F, _templateObject3$y, _templateObject4$t, _templateObject5$p, _templateObject6$l, _templateObject7$j, _templateObject8$h, _templateObject9$e, _templateObject0$d, _templateObject1$a, _templateObject10$6, _templateObject11$6, _templateObject12$5, _templateObject13$4, _templateObject14$3, _templateObject15$3, _templateObject16$3;
37885
37907
  var Actions = function Actions(_ref) {
37886
37908
  var _channel$metadata;
37887
37909
  var setActionsHeight = _ref.setActionsHeight,
@@ -38360,7 +38382,7 @@ var DefaultStarIcon = styled__default(SvgStar)(_templateObject7$j || (_templateO
38360
38382
  var DefaultUnpinIcon = styled__default(SvgUnpin)(_templateObject8$h || (_templateObject8$h = _taggedTemplateLiteralLoose([""])));
38361
38383
  var DefaultPinIcon = styled__default(SvgPin)(_templateObject9$e || (_templateObject9$e = _taggedTemplateLiteralLoose([""])));
38362
38384
  var DefaultMarkAsRead = styled__default(SvgMarkAsRead)(_templateObject0$d || (_templateObject0$d = _taggedTemplateLiteralLoose([""])));
38363
- var DefaultMarkAsUnRead = styled__default(SvgMarkAsUnRead)(_templateObject1$9 || (_templateObject1$9 = _taggedTemplateLiteralLoose([""])));
38385
+ var DefaultMarkAsUnRead = styled__default(SvgMarkAsUnRead)(_templateObject1$a || (_templateObject1$a = _taggedTemplateLiteralLoose([""])));
38364
38386
  var DefaultBlockIcon = styled__default(SvgBlockChannel)(_templateObject10$6 || (_templateObject10$6 = _taggedTemplateLiteralLoose([""])));
38365
38387
  var DefaultReportIcon = styled__default(SvgReport)(_templateObject11$6 || (_templateObject11$6 = _taggedTemplateLiteralLoose([""])));
38366
38388
  var DefaultClearIcon = styled__default(SvgClear)(_templateObject12$5 || (_templateObject12$5 = _taggedTemplateLiteralLoose([""])));
@@ -39084,7 +39106,7 @@ var Files = function Files(_ref) {
39084
39106
  text: '',
39085
39107
  styles: {
39086
39108
  background: {
39087
- fill: overlayBackground2 + "40"
39109
+ fill: overlayBackground2 + "66"
39088
39110
  },
39089
39111
  path: {
39090
39112
  stroke: accentColor,
@@ -39906,7 +39928,7 @@ var EditChannel = function EditChannel(_ref) {
39906
39928
  })));
39907
39929
  };
39908
39930
 
39909
- var _templateObject$V, _templateObject2$O, _templateObject3$F, _templateObject4$z, _templateObject5$u, _templateObject6$p, _templateObject7$n, _templateObject8$l, _templateObject9$g, _templateObject0$e, _templateObject1$a, _templateObject10$7;
39931
+ var _templateObject$V, _templateObject2$O, _templateObject3$F, _templateObject4$z, _templateObject5$u, _templateObject6$p, _templateObject7$n, _templateObject8$l, _templateObject9$g, _templateObject0$e, _templateObject1$b, _templateObject10$7;
39910
39932
  var Details = function Details(_ref) {
39911
39933
  var _activeChannel$metada;
39912
39934
  var detailsTitleText = _ref.detailsTitleText,
@@ -40338,7 +40360,7 @@ var ChannelName$1 = styled__default(SectionHeader)(_templateObject0$e || (_templ
40338
40360
  }, function (props) {
40339
40361
  return props.uppercase && 'uppercase';
40340
40362
  });
40341
- var ChannelNameWrapper = styled__default.div(_templateObject1$a || (_templateObject1$a = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n"])));
40363
+ var ChannelNameWrapper = styled__default.div(_templateObject1$b || (_templateObject1$b = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n"])));
40342
40364
  var EditButton = styled__default.span(_templateObject10$7 || (_templateObject10$7 = _taggedTemplateLiteralLoose(["\n margin-left: 6px;\n cursor: pointer;\n color: #b2b6be;\n"])));
40343
40365
 
40344
40366
  var _templateObject$W;