This repository has been archived by the owner on Aug 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathutils-cf944c28.js
52 lines (44 loc) · 2.06 KB
/
utils-cf944c28.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { g as format } from './index-4456ba1e.js';
import { M as MessageStatusType } from './type-d77d0e67.js';
var copyToClipboard = function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
// Internet Explorer-specific code path to prevent textarea being shown while dialog is visible.
return window.clipboardData.setData('Text', text);
}
if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
var textarea = document.createElement('textarea');
textarea.textContent = text;
textarea.style.position = 'fixed'; // Prevent scrolling to bottom of page in Microsoft Edge.
document.body.appendChild(textarea);
textarea.select();
try {
return document.execCommand('copy'); // Security exception may be thrown by some browsers.
} catch (ex) {
return false;
} finally {
document.body.removeChild(textarea);
}
}
return false;
};
var getMessageCreatedAt = function getMessageCreatedAt(message) {
return format(message.createdAt || 0, 'p');
};
var getSenderName = function getSenderName(message) {
return message.sender && (message.sender.friendName || message.sender.nickname || message.sender.userId);
};
var getSenderProfileUrl = function getSenderProfileUrl(message) {
return message.sender && message.sender.profileUrl;
};
var getIsSentFromStatus = function getIsSentFromStatus(status) {
return status === MessageStatusType.SENT || status === MessageStatusType.DELIVERED || status === MessageStatusType.READ;
};
var getIsSentFromSendingStatus = function getIsSentFromSendingStatus() {
var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
if (message.sendingStatus && typeof message.sendingStatus === 'string') {
return message.sendingStatus === 'none' || message.sendingStatus === 'succeeded';
}
return false;
};
export { getSenderProfileUrl as a, getSenderName as b, copyToClipboard as c, getMessageCreatedAt as d, getIsSentFromStatus as e, getIsSentFromSendingStatus as g };
//# sourceMappingURL=utils-cf944c28.js.map