stream-chat-react 10.15.0 → 11.0.0-rc.2

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 (133) hide show
  1. package/dist/browser.full-bundle.js +1249 -4491
  2. package/dist/browser.full-bundle.js.map +1 -1
  3. package/dist/browser.full-bundle.min.js +5 -5
  4. package/dist/browser.full-bundle.min.js.map +1 -1
  5. package/dist/components/AutoCompleteTextarea/Item.d.ts.map +1 -1
  6. package/dist/components/AutoCompleteTextarea/Item.js +4 -3
  7. package/dist/components/AutoCompleteTextarea/List.d.ts.map +1 -1
  8. package/dist/components/AutoCompleteTextarea/List.js +9 -7
  9. package/dist/components/AutoCompleteTextarea/Textarea.d.ts +1 -1
  10. package/dist/components/AutoCompleteTextarea/Textarea.d.ts.map +1 -1
  11. package/dist/components/AutoCompleteTextarea/Textarea.js +34 -24
  12. package/dist/components/Channel/Channel.d.ts +7 -13
  13. package/dist/components/Channel/Channel.d.ts.map +1 -1
  14. package/dist/components/Channel/Channel.js +58 -69
  15. package/dist/components/ChatAutoComplete/ChatAutoComplete.d.ts +8 -8
  16. package/dist/components/ChatAutoComplete/ChatAutoComplete.d.ts.map +1 -1
  17. package/dist/components/ChatAutoComplete/ChatAutoComplete.js +24 -14
  18. package/dist/components/Emojis/EmojiPicker.d.ts +10 -0
  19. package/dist/components/Emojis/EmojiPicker.d.ts.map +1 -0
  20. package/dist/components/Emojis/EmojiPicker.js +57 -0
  21. package/dist/components/Emojis/index.cjs.js +89 -0
  22. package/dist/components/Emojis/index.d.ts +2 -0
  23. package/dist/components/Emojis/index.d.ts.map +1 -0
  24. package/dist/components/Emojis/index.js +1 -0
  25. package/dist/components/MessageInput/DefaultTriggerProvider.d.ts +2 -3
  26. package/dist/components/MessageInput/DefaultTriggerProvider.d.ts.map +1 -1
  27. package/dist/components/MessageInput/DefaultTriggerProvider.js +1 -1
  28. package/dist/components/MessageInput/EditMessageForm.d.ts.map +1 -1
  29. package/dist/components/MessageInput/EditMessageForm.js +4 -7
  30. package/dist/components/MessageInput/MessageInput.d.ts +17 -5
  31. package/dist/components/MessageInput/MessageInput.d.ts.map +1 -1
  32. package/dist/components/MessageInput/MessageInput.js +3 -1
  33. package/dist/components/MessageInput/MessageInputFlat.d.ts.map +1 -1
  34. package/dist/components/MessageInput/MessageInputFlat.js +12 -27
  35. package/dist/components/MessageInput/MessageInputSmall.d.ts.map +1 -1
  36. package/dist/components/MessageInput/MessageInputSmall.js +8 -11
  37. package/dist/components/MessageInput/hooks/useCreateMessageInputContext.d.ts.map +1 -1
  38. package/dist/components/MessageInput/hooks/useCreateMessageInputContext.js +3 -9
  39. package/dist/components/MessageInput/hooks/useEmojiTrigger.d.ts +2 -2
  40. package/dist/components/MessageInput/hooks/useEmojiTrigger.d.ts.map +1 -1
  41. package/dist/components/MessageInput/hooks/useEmojiTrigger.js +32 -12
  42. package/dist/components/MessageInput/hooks/useMessageInputState.d.ts +1 -19
  43. package/dist/components/MessageInput/hooks/useMessageInputState.d.ts.map +1 -1
  44. package/dist/components/MessageInput/hooks/useMessageInputState.js +3 -15
  45. package/dist/components/MessageInput/hooks/useMessageInputText.d.ts.map +1 -1
  46. package/dist/components/MessageInput/hooks/useMessageInputText.js +1 -2
  47. package/dist/components/MessageInput/index.d.ts +0 -1
  48. package/dist/components/MessageInput/index.d.ts.map +1 -1
  49. package/dist/components/MessageInput/index.js +0 -1
  50. package/dist/components/Reactions/ReactionSelector.d.ts +3 -8
  51. package/dist/components/Reactions/ReactionSelector.d.ts.map +1 -1
  52. package/dist/components/Reactions/ReactionSelector.js +18 -25
  53. package/dist/components/Reactions/ReactionsList.d.ts +3 -8
  54. package/dist/components/Reactions/ReactionsList.d.ts.map +1 -1
  55. package/dist/components/Reactions/ReactionsList.js +9 -12
  56. package/dist/components/Reactions/SimpleReactionsList.d.ts +2 -5
  57. package/dist/components/Reactions/SimpleReactionsList.d.ts.map +1 -1
  58. package/dist/components/Reactions/SimpleReactionsList.js +12 -15
  59. package/dist/components/Reactions/SpriteImage.d.ts +12 -0
  60. package/dist/components/Reactions/SpriteImage.d.ts.map +1 -0
  61. package/dist/components/Reactions/SpriteImage.js +28 -0
  62. package/dist/components/Reactions/StreamEmoji.d.ts +18 -0
  63. package/dist/components/Reactions/StreamEmoji.d.ts.map +1 -0
  64. package/dist/components/Reactions/StreamEmoji.js +16 -0
  65. package/dist/components/Reactions/hooks/useProcessReactions.d.ts +7 -7
  66. package/dist/components/Reactions/hooks/useProcessReactions.d.ts.map +1 -1
  67. package/dist/components/Reactions/hooks/useProcessReactions.js +14 -18
  68. package/dist/components/Reactions/index.d.ts +3 -0
  69. package/dist/components/Reactions/index.d.ts.map +1 -1
  70. package/dist/components/Reactions/index.js +3 -0
  71. package/dist/components/Reactions/reactionOptions.d.ts +8 -0
  72. package/dist/components/Reactions/reactionOptions.d.ts.map +1 -0
  73. package/dist/components/Reactions/reactionOptions.js +11 -0
  74. package/dist/components/Reactions/utils/utils.d.ts +1 -0
  75. package/dist/components/Reactions/utils/utils.d.ts.map +1 -1
  76. package/dist/components/Reactions/utils/utils.js +12 -0
  77. package/dist/context/ChannelStateContext.d.ts +1 -1
  78. package/dist/context/ChatContext.d.ts +1 -1
  79. package/dist/context/ComponentContext.d.ts +5 -2
  80. package/dist/context/ComponentContext.d.ts.map +1 -1
  81. package/dist/context/MessageInputContext.d.ts +1 -7
  82. package/dist/context/MessageInputContext.d.ts.map +1 -1
  83. package/dist/context/index.d.ts +0 -1
  84. package/dist/context/index.d.ts.map +1 -1
  85. package/dist/context/index.js +0 -1
  86. package/dist/i18n/Streami18n.d.ts +0 -1
  87. package/dist/i18n/Streami18n.d.ts.map +1 -1
  88. package/dist/i18n/de.json +0 -1
  89. package/dist/i18n/en.json +0 -1
  90. package/dist/i18n/es.json +0 -1
  91. package/dist/i18n/fr.json +0 -1
  92. package/dist/i18n/hi.json +0 -1
  93. package/dist/i18n/it.json +0 -1
  94. package/dist/i18n/ja.json +0 -1
  95. package/dist/i18n/ko.json +0 -1
  96. package/dist/i18n/nl.json +0 -1
  97. package/dist/i18n/pt.json +0 -1
  98. package/dist/i18n/ru.json +0 -1
  99. package/dist/i18n/tr.json +0 -1
  100. package/dist/icons-0801b1e9.js +3133 -0
  101. package/dist/index.cjs.js +1038 -4157
  102. package/dist/index_UMD.d.ts +7 -0
  103. package/dist/index_UMD.d.ts.map +1 -0
  104. package/dist/index_UMD.js +8 -0
  105. package/dist/types/types.d.ts +3 -0
  106. package/dist/types/types.d.ts.map +1 -1
  107. package/dist/version.d.ts +1 -1
  108. package/dist/version.d.ts.map +1 -1
  109. package/dist/version.js +1 -1
  110. package/package.json +34 -7
  111. package/dist/components/Channel/emojiData.d.ts +0 -15
  112. package/dist/components/Channel/emojiData.d.ts.map +0 -1
  113. package/dist/components/Channel/emojiData.js +0 -23
  114. package/dist/components/MessageInput/EmojiPicker.d.ts +0 -6
  115. package/dist/components/MessageInput/EmojiPicker.d.ts.map +0 -1
  116. package/dist/components/MessageInput/EmojiPicker.js +0 -23
  117. package/dist/components/MessageInput/hooks/useEmojiIndex.d.ts +0 -3
  118. package/dist/components/MessageInput/hooks/useEmojiIndex.d.ts.map +0 -1
  119. package/dist/components/MessageInput/hooks/useEmojiIndex.js +0 -13
  120. package/dist/components/MessageInput/hooks/useEmojiPicker.d.ts +0 -11
  121. package/dist/components/MessageInput/hooks/useEmojiPicker.d.ts.map +0 -1
  122. package/dist/components/MessageInput/hooks/useEmojiPicker.js +0 -68
  123. package/dist/context/DefaultEmoji.d.ts +0 -3
  124. package/dist/context/DefaultEmoji.d.ts.map +0 -1
  125. package/dist/context/DefaultEmoji.js +0 -3
  126. package/dist/context/DefaultEmojiPicker.d.ts +0 -3
  127. package/dist/context/DefaultEmojiPicker.d.ts.map +0 -1
  128. package/dist/context/DefaultEmojiPicker.js +0 -3
  129. package/dist/context/EmojiContext.d.ts +0 -49
  130. package/dist/context/EmojiContext.d.ts.map +0 -1
  131. package/dist/context/EmojiContext.js +0 -41
  132. package/dist/index.cjs.js.map +0 -1
  133. package/dist/stream-emoji.json +0 -1
@@ -0,0 +1,3133 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var ReactDOM = require('react-dom');
5
+ var deepequal = require('react-fast-compare');
6
+ var crypto = require('crypto');
7
+ var Dayjs = require('dayjs');
8
+ var calendar = require('dayjs/plugin/calendar');
9
+ var LocalizedFormat = require('dayjs/plugin/localizedFormat');
10
+ var i18n = require('i18next');
11
+ var updateLocale = require('dayjs/plugin/updateLocale');
12
+ var localeData = require('dayjs/plugin/localeData');
13
+ var relativeTime = require('dayjs/plugin/relativeTime');
14
+ var utc = require('dayjs/plugin/utc');
15
+ var timezone = require('dayjs/plugin/timezone');
16
+ require('dayjs/locale/de');
17
+ require('dayjs/locale/es');
18
+ require('dayjs/locale/fr');
19
+ require('dayjs/locale/hi');
20
+ require('dayjs/locale/it');
21
+ require('dayjs/locale/ja');
22
+ require('dayjs/locale/ko');
23
+ require('dayjs/locale/nl');
24
+ require('dayjs/locale/pt');
25
+ require('dayjs/locale/ru');
26
+ require('dayjs/locale/tr');
27
+ require('dayjs/locale/en');
28
+
29
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
30
+
31
+ function _interopNamespace(e) {
32
+ if (e && e.__esModule) return e;
33
+ var n = Object.create(null);
34
+ if (e) {
35
+ Object.keys(e).forEach(function (k) {
36
+ if (k !== 'default') {
37
+ var d = Object.getOwnPropertyDescriptor(e, k);
38
+ Object.defineProperty(n, k, d.get ? d : {
39
+ enumerable: true,
40
+ get: function () { return e[k]; }
41
+ });
42
+ }
43
+ });
44
+ }
45
+ n["default"] = e;
46
+ return Object.freeze(n);
47
+ }
48
+
49
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
50
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
51
+ var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
52
+ var deepequal__default = /*#__PURE__*/_interopDefaultLegacy(deepequal);
53
+ var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);
54
+ var Dayjs__default = /*#__PURE__*/_interopDefaultLegacy(Dayjs);
55
+ var calendar__default = /*#__PURE__*/_interopDefaultLegacy(calendar);
56
+ var LocalizedFormat__default = /*#__PURE__*/_interopDefaultLegacy(LocalizedFormat);
57
+ var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
58
+ var updateLocale__default = /*#__PURE__*/_interopDefaultLegacy(updateLocale);
59
+ var localeData__default = /*#__PURE__*/_interopDefaultLegacy(localeData);
60
+ var relativeTime__default = /*#__PURE__*/_interopDefaultLegacy(relativeTime);
61
+ var utc__default = /*#__PURE__*/_interopDefaultLegacy(utc);
62
+ var timezone__default = /*#__PURE__*/_interopDefaultLegacy(timezone);
63
+
64
+ /******************************************************************************
65
+ Copyright (c) Microsoft Corporation.
66
+
67
+ Permission to use, copy, modify, and/or distribute this software for any
68
+ purpose with or without fee is hereby granted.
69
+
70
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
71
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
72
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
73
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
74
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
75
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
76
+ PERFORMANCE OF THIS SOFTWARE.
77
+ ***************************************************************************** */
78
+
79
+ exports.__assign = function() {
80
+ exports.__assign = Object.assign || function __assign(t) {
81
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
82
+ s = arguments[i];
83
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
84
+ }
85
+ return t;
86
+ };
87
+ return exports.__assign.apply(this, arguments);
88
+ };
89
+
90
+ function __rest(s, e) {
91
+ var t = {};
92
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
93
+ t[p] = s[p];
94
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
95
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
96
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
97
+ t[p[i]] = s[p[i]];
98
+ }
99
+ return t;
100
+ }
101
+
102
+ function __awaiter(thisArg, _arguments, P, generator) {
103
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
104
+ return new (P || (P = Promise))(function (resolve, reject) {
105
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
106
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
107
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
108
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
109
+ });
110
+ }
111
+
112
+ function __generator(thisArg, body) {
113
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
114
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
115
+ function verb(n) { return function (v) { return step([n, v]); }; }
116
+ function step(op) {
117
+ if (f) throw new TypeError("Generator is already executing.");
118
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
119
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
120
+ if (y = 0, t) op = [op[0] & 2, t.value];
121
+ switch (op[0]) {
122
+ case 0: case 1: t = op; break;
123
+ case 4: _.label++; return { value: op[1], done: false };
124
+ case 5: _.label++; y = op[1]; op = [0]; continue;
125
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
126
+ default:
127
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
128
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
129
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
130
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
131
+ if (t[2]) _.ops.pop();
132
+ _.trys.pop(); continue;
133
+ }
134
+ op = body.call(thisArg, _);
135
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
136
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
137
+ }
138
+ }
139
+
140
+ function __read(o, n) {
141
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
142
+ if (!m) return o;
143
+ var i = m.call(o), r, ar = [], e;
144
+ try {
145
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
146
+ }
147
+ catch (error) { e = { error: error }; }
148
+ finally {
149
+ try {
150
+ if (r && !r.done && (m = i["return"])) m.call(i);
151
+ }
152
+ finally { if (e) throw e.error; }
153
+ }
154
+ return ar;
155
+ }
156
+
157
+ function __spreadArray(to, from, pack) {
158
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
159
+ if (ar || !(i in from)) {
160
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
161
+ ar[i] = from[i];
162
+ }
163
+ }
164
+ return to.concat(ar || Array.prototype.slice.call(from));
165
+ }
166
+
167
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
168
+ var e = new Error(message);
169
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
170
+ };
171
+
172
+ var getDisplayName = function (Component) {
173
+ return Component.displayName || Component.name || 'Component';
174
+ };
175
+
176
+ var ChatContext = React__default["default"].createContext(undefined);
177
+ var ChatProvider = function (_a) {
178
+ var children = _a.children, value = _a.value;
179
+ return (React__default["default"].createElement(ChatContext.Provider, { value: value }, children));
180
+ };
181
+ var useChatContext = function (componentName) {
182
+ var contextValue = React.useContext(ChatContext);
183
+ if (!contextValue) {
184
+ console.warn("The useChatContext hook was called outside of the ChatContext provider. Make sure this hook is called within a child of the Chat component. The errored call is located in the ".concat(componentName, " component."));
185
+ return {};
186
+ }
187
+ return contextValue;
188
+ };
189
+ /**
190
+ * Typescript currently does not support partial inference so if ChatContext
191
+ * typing is desired while using the HOC withChatContext the Props for the
192
+ * wrapped component must be provided as the first generic.
193
+ */
194
+ var withChatContext = function (Component) {
195
+ var WithChatContextComponent = function (props) {
196
+ var chatContext = useChatContext();
197
+ return React__default["default"].createElement(Component, exports.__assign({}, props, chatContext));
198
+ };
199
+ WithChatContextComponent.displayName = "WithChatContext".concat(getDisplayName(Component));
200
+ return WithChatContextComponent;
201
+ };
202
+
203
+ var ChannelActionContext = React__default["default"].createContext(undefined);
204
+ var ChannelActionProvider = function (_a) {
205
+ var children = _a.children, value = _a.value;
206
+ return (React__default["default"].createElement(ChannelActionContext.Provider, { value: value }, children));
207
+ };
208
+ var useChannelActionContext = function (componentName) {
209
+ var contextValue = React.useContext(ChannelActionContext);
210
+ if (!contextValue) {
211
+ console.warn("The useChannelActionContext hook was called outside of the ChannelActionContext provider. Make sure this hook is called within a child of the Channel component. The errored call is located in the ".concat(componentName, " component."));
212
+ return {};
213
+ }
214
+ return contextValue;
215
+ };
216
+ /**
217
+ * Typescript currently does not support partial inference, so if ChannelActionContext
218
+ * typing is desired while using the HOC withChannelActionContext, the Props for the
219
+ * wrapped component must be provided as the first generic.
220
+ */
221
+ var withChannelActionContext = function (Component) {
222
+ var WithChannelActionContextComponent = function (props) {
223
+ var channelActionContext = useChannelActionContext();
224
+ return React__default["default"].createElement(Component, exports.__assign({}, props, channelActionContext));
225
+ };
226
+ WithChannelActionContextComponent.displayName = (Component.displayName ||
227
+ Component.name ||
228
+ 'Component').replace('Base', '');
229
+ return WithChannelActionContextComponent;
230
+ };
231
+
232
+ var ChannelStateContext = React__default["default"].createContext(undefined);
233
+ var ChannelStateProvider = function (_a) {
234
+ var children = _a.children, value = _a.value;
235
+ return (React__default["default"].createElement(ChannelStateContext.Provider, { value: value }, children));
236
+ };
237
+ var useChannelStateContext = function (componentName) {
238
+ var contextValue = React.useContext(ChannelStateContext);
239
+ if (!contextValue) {
240
+ console.warn("The useChannelStateContext hook was called outside of the ChannelStateContext provider. Make sure this hook is called within a child of the Channel component. The errored call is located in the ".concat(componentName, " component."));
241
+ return {};
242
+ }
243
+ return contextValue;
244
+ };
245
+ /**
246
+ * Typescript currently does not support partial inference, so if ChannelStateContext
247
+ * typing is desired while using the HOC withChannelStateContext, the Props for the
248
+ * wrapped component must be provided as the first generic.
249
+ */
250
+ var withChannelStateContext = function (Component) {
251
+ var WithChannelStateContextComponent = function (props) {
252
+ var channelStateContext = useChannelStateContext();
253
+ return React__default["default"].createElement(Component, exports.__assign({}, props, channelStateContext));
254
+ };
255
+ WithChannelStateContextComponent.displayName = (Component.displayName ||
256
+ Component.name ||
257
+ 'Component').replace('Base', '');
258
+ return WithChannelStateContextComponent;
259
+ };
260
+
261
+ var ComponentContext = React__default["default"].createContext(undefined);
262
+ var ComponentProvider = function (_a) {
263
+ var children = _a.children, value = _a.value;
264
+ return (React__default["default"].createElement(ComponentContext.Provider, { value: value }, children));
265
+ };
266
+ var useComponentContext = function (componentName) {
267
+ var contextValue = React.useContext(ComponentContext);
268
+ if (!contextValue) {
269
+ console.warn("The useComponentContext hook was called outside of the ComponentContext provider. Make sure this hook is called within a child of the Channel component. The errored call is located in the ".concat(componentName, " component."));
270
+ return {};
271
+ }
272
+ return contextValue;
273
+ };
274
+ /**
275
+ * Typescript currently does not support partial inference, so if ComponentContext
276
+ * typing is desired while using the HOC withComponentContext, the Props for the
277
+ * wrapped component must be provided as the first generic.
278
+ */
279
+ var withComponentContext = function (Component) {
280
+ var WithComponentContextComponent = function (props) {
281
+ var componentContext = useComponentContext();
282
+ return React__default["default"].createElement(Component, exports.__assign({}, props, componentContext));
283
+ };
284
+ WithComponentContextComponent.displayName = (Component.displayName ||
285
+ Component.name ||
286
+ 'Component').replace('Base', '');
287
+ return WithComponentContextComponent;
288
+ };
289
+
290
+ var MessageContext = React__default["default"].createContext(undefined);
291
+ var MessageProvider = function (_a) {
292
+ var children = _a.children, value = _a.value;
293
+ return (React__default["default"].createElement(MessageContext.Provider, { value: value }, children));
294
+ };
295
+ var useMessageContext = function (componentName) {
296
+ var contextValue = React.useContext(MessageContext);
297
+ if (!contextValue) {
298
+ console.warn("The useMessageContext hook was called outside of the MessageContext provider. Make sure this hook is called within the Message's UI component. The errored call is located in the ".concat(componentName, " component."));
299
+ return {};
300
+ }
301
+ return contextValue;
302
+ };
303
+ /**
304
+ * Typescript currently does not support partial inference, so if MessageContext
305
+ * typing is desired while using the HOC withMessageContext, the Props for the
306
+ * wrapped component must be provided as the first generic.
307
+ */
308
+ var withMessageContext = function (Component) {
309
+ var WithMessageContextComponent = function (props) {
310
+ var messageContext = useMessageContext();
311
+ return React__default["default"].createElement(Component, exports.__assign({}, props, messageContext));
312
+ };
313
+ WithMessageContextComponent.displayName = (Component.displayName ||
314
+ Component.name ||
315
+ 'Component').replace('Base', '');
316
+ return WithMessageContextComponent;
317
+ };
318
+
319
+ var MessageInputContext = React.createContext(undefined);
320
+ var MessageInputContextProvider = function (_a) {
321
+ var children = _a.children, value = _a.value;
322
+ return (React__default["default"].createElement(MessageInputContext.Provider, { value: value }, children));
323
+ };
324
+ var useMessageInputContext = function (componentName) {
325
+ var contextValue = React.useContext(MessageInputContext);
326
+ if (!contextValue) {
327
+ console.warn("The useMessageInputContext hook was called outside of the MessageInputContext provider. Make sure this hook is called within the MessageInput's UI component. The errored call is located in the ".concat(componentName, " component."));
328
+ return {};
329
+ }
330
+ return contextValue;
331
+ };
332
+
333
+ var Cancel$b="Stornieren";var Close$b="Schließen";var Delete$b="Löschen";var Delivered$b="Zugestellt";var Flag$b="Meldung";var Menu$b="Menü";var Mute$b="Stumm schalten";var New$b="Neu";var Pin$b="Pin";var Reply$b="Antworten";var Search$b="Suche";var Send$b="Senden";var Thread$b="Thread";var Unmute$b="Stummschaltung aufheben";var Unpin$b="Pin entfernen";var live$b="live";var replyCount_one$b="1 Antwort";var replyCount_other$b="{{ count }} Antworten";var searchResultsCount_one$b="1 Ergebnis";var searchResultsCount_other$b="{{ count }} Ergebnisse";var deTranslations = {"Attach files":"Dateien anhängen",Cancel:Cancel$b,"Channel Missing":"Kanal fehlt",Close:Close$b,"Close emoji picker":"Emoji-Picker schließen","Commands matching":"Übereinstimmende Befehle","Connection failure, reconnecting now...":"Verbindungsfehler, Wiederherstellung der Verbindung...",Delete:Delete$b,Delivered:Delivered$b,"Drag your files here":"Drag your files here","Edit Message":"Nachricht bearbeiten","Edit message request failed":"Anfrage zum Bearbeiten der Nachricht fehlgeschlagen","Emoji matching":"Emoji passend","Empty message...":"Leere Nachricht...","Error adding flag":"Fehler beim Hinzufügen des Flags","Error connecting to chat, refresh the page to try again.":"Verbindungsfehler zum Chat, Aktualisiere die Seite um es erneut zu versuchen.","Error deleting message":"Fehler beim Löschen der Nachricht","Error muting a user ...":"Fehler beim Stummschalten eines Nutzers.","Error pinning message":"Fehler beim Pinnen der Nachricht","Error removing message pin":"Fehler beim Entfernen der gepinnten Nachricht","Error unmuting a user ...":"Stummschaltung des Nutzers fehlgeschlagen ...","Error uploading file":"Fehler beim Hochladen der Datei","Error uploading image":"Hochladen des Bildes fehlgeschlagen","Error · Unsent":"Fehler nicht gesendet","Error: {{ errorMessage }}":"Fehler: {{ errorMessage }}",Flag:Flag$b,"Latest Messages":"Neueste Nachrichten",Menu:Menu$b,"Message Failed · Click to try again":"Nachricht fehlgeschlagen · Klicken, um es erneut zu versuchen","Message Failed · Unauthorized":"Nachricht fehlgeschlagen · Nicht autorisiert","Message deleted":"Nachricht gelöscht","Message has been successfully flagged":"Nachricht wurde erfolgreich gemeldet","Message pinned":"Nachricht gepinnt",Mute:Mute$b,New:New$b,"New Messages!":"Neue Nachrichten!","No chats here yet…":"Noch keine Chats hier...","No results found":"keine Ergebnisse gefunden","Nothing yet...":"Noch nichts...","Open emoji picker":"Emoji-Picker öffnen","People matching":"Passende Personen",Pin:Pin$b,"Pinned by":"Gepinnt von",Reply:Reply$b,"Reply to Message":"Auf Nachricht antworten",Search:Search$b,"Searching...":"Suchen...",Send:Send$b,"Send message request failed":"Senden der Nachrichtenanfrage fehlgeschlagen","Sending...":"Senden...","Slow Mode ON":"Slow-Mode EIN","Some of the files will not be accepted":"Some of the files will not be accepted","This message was deleted...":"Diese Nachricht wurde gelöscht...",Thread:Thread$b,"Type your message":"Nachricht eingeben",Unmute:Unmute$b,Unpin:Unpin$b,"Upload type: \"{{ type }}\" is not allowed":"Upload-Typ: \"{{ type }}\" ist nicht erlaubt","Wait until all attachments have uploaded":"Bitte warten, bis alle Anhänge hochgeladen wurden","You have no channels currently":"Du hast momentan noch keinen Channels","You've reached the maximum number of files":"Die maximale Dateianzahl ist erreicht",live:live$b,replyCount_one:replyCount_one$b,replyCount_other:replyCount_other$b,searchResultsCount_one:searchResultsCount_one$b,searchResultsCount_other:searchResultsCount_other$b,"this content could not be displayed":"Dieser Inhalt konnte nicht angezeigt werden","{{ commaSeparatedUsers }} and {{ moreCount }} more":"{{ commaSeparatedUsers }} und {{moreCount}} Mehr","{{ commaSeparatedUsers }}, and {{ lastUser }}":"{{ commaSeparatedUsers }} und {{ lastUser }}","{{ firstUser }} and {{ secondUser }}":"{{ firstUser }} und {{ secondUser }}","{{ imageCount }} more":"{{ imageCount }} mehr","{{ memberCount }} members":"{{ memberCount }} Mitglieder","{{ user }} has been muted":"{{ user }} wurde stummgeschaltet","{{ user }} has been unmuted":"{{ user }} wurde nicht stummgeschaltet","{{ user }} is typing...":"{{ user }} tippt...","{{ users }} and more are typing...":"{{ users }} und mehr tippen...","{{ users }} and {{ user }} are typing...":"{{ users }} und {{ user }} tippen...","{{ watcherCount }} online":"{{ watcherCount }} online","🏙 Attachment...":"🏙 Anhang..."};
334
+
335
+ var Cancel$a="Cancel";var Close$a="Close";var Delete$a="Delete";var Delivered$a="Delivered";var Flag$a="Flag";var Menu$a="Menu";var Mute$a="Mute";var New$a="New";var Pin$a="Pin";var Reply$a="Reply";var Search$a="Search";var Send$a="Send";var Thread$a="Thread";var Unmute$a="Unmute";var Unpin$a="Unpin";var live$a="live";var replyCount_one$a="1 reply";var replyCount_other$a="{{ count }} replies";var searchResultsCount_one$a="1 result";var searchResultsCount_other$a="{{ count }} results";var enTranslations = {"Attach files":"Attach files",Cancel:Cancel$a,"Channel Missing":"Channel Missing",Close:Close$a,"Close emoji picker":"Close emoji picker","Commands matching":"Commands matching","Connection failure, reconnecting now...":"Connection failure, reconnecting now...",Delete:Delete$a,Delivered:Delivered$a,"Drag your files here":"Drag your files here","Edit Message":"Edit Message","Edit message request failed":"Edit message request failed","Emoji matching":"Emoji matching","Empty message...":"Empty message...","Error adding flag":"Error adding flag","Error connecting to chat, refresh the page to try again.":"Error connecting to chat, refresh the page to try again.","Error deleting message":"Error deleting message","Error muting a user ...":"Error muting a user ...","Error pinning message":"Error pinning message","Error removing message pin":"Error removing message pin","Error unmuting a user ...":"Error unmuting a user ...","Error uploading file":"Error uploading file","Error uploading image":"Error uploading image","Error · Unsent":"Error · Unsent","Error: {{ errorMessage }}":"Error: {{ errorMessage }}",Flag:Flag$a,"Latest Messages":"Latest Messages",Menu:Menu$a,"Message Failed · Click to try again":"Message Failed · Click to try again","Message Failed · Unauthorized":"Message Failed · Unauthorized","Message deleted":"Message deleted","Message has been successfully flagged":"Message has been successfully flagged","Message pinned":"Message pinned",Mute:Mute$a,New:New$a,"New Messages!":"New Messages!","No chats here yet…":"No chats here yet…","No results found":"No results found","Nothing yet...":"Nothing yet...","Open emoji picker":"Open emoji picker","People matching":"People matching",Pin:Pin$a,"Pinned by":"Pinned by",Reply:Reply$a,"Reply to Message":"Reply to Message",Search:Search$a,"Searching...":"Searching...",Send:Send$a,"Send message request failed":"Send message request failed","Sending...":"Sending...","Slow Mode ON":"Slow Mode ON","Some of the files will not be accepted":"Some of the files will not be accepted","This message was deleted...":"This message was deleted...",Thread:Thread$a,"Type your message":"Type your message",Unmute:Unmute$a,Unpin:Unpin$a,"Upload type: \"{{ type }}\" is not allowed":"Upload type: \"{{ type }}\" is not allowed","Wait until all attachments have uploaded":"Wait until all attachments have uploaded","You have no channels currently":"You have no channels currently","You've reached the maximum number of files":"You've reached the maximum number of files",live:live$a,replyCount_one:replyCount_one$a,replyCount_other:replyCount_other$a,searchResultsCount_one:searchResultsCount_one$a,searchResultsCount_other:searchResultsCount_other$a,"this content could not be displayed":"this content could not be displayed","{{ commaSeparatedUsers }} and {{ moreCount }} more":"{{ commaSeparatedUsers }} and {{ moreCount }} more","{{ commaSeparatedUsers }}, and {{ lastUser }}":"{{ commaSeparatedUsers }}, and {{ lastUser }}","{{ firstUser }} and {{ secondUser }}":"{{ firstUser }} and {{ secondUser }}","{{ imageCount }} more":"{{ imageCount }} more","{{ memberCount }} members":"{{ memberCount }} members","{{ user }} has been muted":"{{ user }} has been muted","{{ user }} has been unmuted":"{{ user }} has been unmuted","{{ user }} is typing...":"{{ user }} is typing...","{{ users }} and more are typing...":"{{ users }} and more are typing...","{{ users }} and {{ user }} are typing...":"{{ users }} and {{ user }} are typing...","{{ watcherCount }} online":"{{ watcherCount }} online","🏙 Attachment...":"🏙 Attachment..."};
336
+
337
+ var Cancel$9="Cancelar";var Close$9="Cerca";var Delete$9="Borrar";var Delivered$9="Entregado";var Flag$9="Bandera";var Menu$9="Menú";var Mute$9="Mudo";var New$9="Nuevo";var Pin$9="Alfiler";var Reply$9="Respuesta";var Search$9="Buscar";var Send$9="Enviar";var Thread$9="Hilo";var Unmute$9="Activar sonido";var Unpin$9="Desprender";var live$9="En Vivo";var replyCount_many$4="{{ count }} respuestas";var replyCount_one$9="1 respuesta";var replyCount_other$9="{{ count }} respuestas";var searchResultsCount_many$4="{{ count }} resultados";var searchResultsCount_one$9="1 resultado";var searchResultsCount_other$9="{{ count }} resultados";var esTranslations = {"Attach files":"Adjuntar archivos",Cancel:Cancel$9,"Channel Missing":"Falta canal",Close:Close$9,"Close emoji picker":"Cerrar el selector de emojis","Commands matching":"Coincidencia de comandos","Connection failure, reconnecting now...":"Fallo de conexión, reconectando ahora ...",Delete:Delete$9,Delivered:Delivered$9,"Drag your files here":"Drag your files here","Edit Message":"Editar mensaje","Edit message request failed":"Error al editar la solicitud de mensaje","Emoji matching":"Coincidencia de emoji","Empty message...":"Mensaje vacío ...","Error adding flag":"Error al agregar la bandera","Error connecting to chat, refresh the page to try again.":"Error al conectarse al chat, actualice la página para volver a intentarlo.","Error deleting message":"Error al eliminar el mensaje","Error muting a user ...":"Error al silenciar a un usuario ...","Error pinning message":"Mensaje de error al fijar","Error removing message pin":"Error al quitar el pin del mensaje","Error unmuting a user ...":"Error al activar el silencio de un usuario ...","Error uploading file":"Error al cargar el archivo","Error uploading image":"Error subiendo imagen","Error · Unsent":"Error · No enviado","Error: {{ errorMessage }}":"Error: {{ errorMessage }}",Flag:Flag$9,"Latest Messages":"Últimos mensajes",Menu:Menu$9,"Message Failed · Click to try again":"Mensaje fallido · Haga clic para volver a intentarlo","Message Failed · Unauthorized":"Mensaje fallido · No autorizado","Message deleted":"Mensaje borrado","Message has been successfully flagged":"El mensaje se marcó correctamente","Message pinned":"Mensaje fijado",Mute:Mute$9,New:New$9,"New Messages!":"¡Nuevos mensajes!","No chats here yet…":"Aún no hay mensajes aquí...","No results found":"No se han encontrado resultados","Nothing yet...":"Nada aún...","Open emoji picker":"Selector de emoji abierto","People matching":"Personas que coinciden",Pin:Pin$9,"Pinned by":"Fijado por",Reply:Reply$9,"Reply to Message":"Responder al mensaje",Search:Search$9,"Searching...":"Buscando...",Send:Send$9,"Send message request failed":"Error al enviar la solicitud de mensaje","Sending...":"Enviando...","Slow Mode ON":"Modo lento activado","Some of the files will not be accepted":"Some of the files will not be accepted","This message was deleted...":"Este mensaje fue eliminado ...",Thread:Thread$9,"Type your message":"Escribe tu mensaje",Unmute:Unmute$9,Unpin:Unpin$9,"Upload type: \"{{ type }}\" is not allowed":"Tipo de carga: \"{{ type }}\" no está permitido","Wait until all attachments have uploaded":"Espere hasta que se hayan cargado todos los archivos adjuntos","You have no channels currently":"Actualmente no tienes canales","You've reached the maximum number of files":"Has alcanzado el número máximo de archivos",live:live$9,replyCount_many:replyCount_many$4,replyCount_one:replyCount_one$9,replyCount_other:replyCount_other$9,searchResultsCount_many:searchResultsCount_many$4,searchResultsCount_one:searchResultsCount_one$9,searchResultsCount_other:searchResultsCount_other$9,"this content could not be displayed":"este contenido no se pudo mostrar","{{ commaSeparatedUsers }} and {{ moreCount }} more":"{{ commaSeparatedUsers }} y {{ moreCount }} más","{{ commaSeparatedUsers }}, and {{ lastUser }}":"{{ commaSeparatedUsers }} y {{ lastUser }}","{{ firstUser }} and {{ secondUser }}":"{{ firstUser }} y {{ secondUser }}","{{ imageCount }} more":"{{ imageCount }} más","{{ memberCount }} members":"{{ memberCount }} miembros","{{ user }} has been muted":"{{ user }} ha sido silenciado","{{ user }} has been unmuted":"{{ user }} se ha desactivado","{{ user }} is typing...":"{{ user }} está escribiendo...","{{ users }} and more are typing...":"{{ users }} y más están escribiendo...","{{ users }} and {{ user }} are typing...":"{{ users }} y {{ user }} están escribiendo...","{{ watcherCount }} online":"{{ watcherCount }} en línea","🏙 Attachment...":"🏙 Adjunto..."};
338
+
339
+ var Cancel$8="Annuler";var Close$8="Fermer";var Delete$8="Supprimer";var Delivered$8="Publié";var Flag$8="Signaler";var Menu$8="Menu";var Mute$8="Muet";var New$8="Nouveaux";var Pin$8="Épingle";var Reply$8="Réponse";var Search$8="Rechercher";var Send$8="Envoyer";var Thread$8="Fil de discussion";var Unmute$8="Désactiver muet";var Unpin$8="Détacher";var live$8="en direct";var replyCount_many$3="{{ count }} réponses";var replyCount_one$8="1 réponse";var replyCount_other$8="{{ count }} réponses";var searchResultsCount_many$3="{{ count }} résultats";var searchResultsCount_one$8="1 résultat";var searchResultsCount_other$8="{{ count }} résultats";var frTranslations = {"Attach files":"Pièces jointes",Cancel:Cancel$8,"Channel Missing":"Canal Manquant",Close:Close$8,"Close emoji picker":"Fermer le sélecteur d'emojis","Commands matching":"Correspondance des commandes","Connection failure, reconnecting now...":"Échec de la connexion, reconnexion en cours...",Delete:Delete$8,Delivered:Delivered$8,"Drag your files here":"Drag your files here","Edit Message":"Éditer un message","Edit message request failed":"Échec de la demande de modification du message","Emoji matching":"Correspondance emoji","Empty message...":"Message vide...","Error adding flag":"Erreur lors de l'ajout du drapeau","Error connecting to chat, refresh the page to try again.":"Erreur de connexion au chat, rafraîchissez la page pour réessayer.","Error deleting message":"Erreur lors de la suppression du message","Error muting a user ...":"Erreur de mise en sourdine d'un utilisateur ...","Error pinning message":"Erreur d'épinglage du message","Error removing message pin":"Erreur lors de la suppression du code PIN du message","Error unmuting a user ...":"Erreur de désactivation de la fonction sourdine pour un utilisateur ...","Error uploading file":"Erreur lors du téléchargement du fichier","Error uploading image":"Erreur lors de l'envoi de l'image","Error · Unsent":"Erreur - Non envoyé","Error: {{ errorMessage }}":"Erreur : {{ errorMessage }}",Flag:Flag$8,"Latest Messages":"Derniers messages",Menu:Menu$8,"Message Failed · Click to try again":"Échec de l'envoi du message - Cliquez pour réessayer","Message Failed · Unauthorized":"Échec de l'envoi du message - Non autorisé","Message deleted":"Message supprimé","Message has been successfully flagged":"Le message a été signalé avec succès","Message pinned":"Message épinglé",Mute:Mute$8,New:New$8,"New Messages!":"Nouveaux Messages!","No chats here yet…":"Pas encore de messages ici...","No results found":"Aucun résultat trouvé","Nothing yet...":"Aucun message...","Open emoji picker":"Ouvrez le sélecteur d'emoji","People matching":"Correspondance de personnes",Pin:Pin$8,"Pinned by":"Épinglé par",Reply:Reply$8,"Reply to Message":"Répondre au message",Search:Search$8,"Searching...":"Recherche...",Send:Send$8,"Send message request failed":"Échec de la demande d'envoi de message","Sending...":"Envoi en cours...","Slow Mode ON":"Mode lent activé","Some of the files will not be accepted":"Some of the files will not be accepted","This message was deleted...":"Ce message a été supprimé...",Thread:Thread$8,"Type your message":"Saisissez votre message",Unmute:Unmute$8,Unpin:Unpin$8,"Upload type: \"{{ type }}\" is not allowed":"Le type de téléchargement: \"{{ type }}\" n'est pas autorisé","Wait until all attachments have uploaded":"Attendez que toutes les pièces jointes soient téléchargées","You have no channels currently":"Vous n'avez actuellement aucun canal","You've reached the maximum number of files":"Vous avez atteint le nombre maximum de fichiers",live:live$8,replyCount_many:replyCount_many$3,replyCount_one:replyCount_one$8,replyCount_other:replyCount_other$8,searchResultsCount_many:searchResultsCount_many$3,searchResultsCount_one:searchResultsCount_one$8,searchResultsCount_other:searchResultsCount_other$8,"this content could not be displayed":"ce contenu n'a pu être affiché","{{ commaSeparatedUsers }} and {{ moreCount }} more":"{{ commaSeparatedUsers }} et {{ moreCount }} autres","{{ commaSeparatedUsers }}, and {{ lastUser }}":"{{ commaSeparatedUsers }} et {{ lastUser }}","{{ firstUser }} and {{ secondUser }}":"{{ firstUser }} et {{ secondUser }}","{{ imageCount }} more":"{{ imageCount }} supplémentaires","{{ memberCount }} members":"{{ memberCount }} membres","{{ user }} has been muted":"{{ user }} a été mis en sourdine","{{ user }} has been unmuted":"{{ user }} n'est plus en sourdine","{{ user }} is typing...":"{{ user }} is typing...","{{ users }} and more are typing...":"{{ users }} and more are typing...","{{ users }} and {{ user }} are typing...":"{{ users }} and {{ user }} are typing...","{{ watcherCount }} online":"{{ watcherCount }} en ligne","🏙 Attachment...":"🏙 Pièce jointe..."};
340
+
341
+ var Cancel$7="रद्द करें";var Close$7="बंद करे";var Delete$7="डिलीट";var Delivered$7="पहुंच गया";var Flag$7="फ्लैग करे";var Menu$7="मेन्यू";var Mute$7="म्यूट करे";var New$7="नए";var Pin$7="पिन";var Reply$7="जवाब दे दो";var Search$7="खोज";var Send$7="भेजे";var Thread$7="रिप्लाई थ्रेड";var Unmute$7="अनम्यूट";var Unpin$7="अनपिन";var live$7="लाइव";var replyCount_one$7="1 रिप्लाई";var replyCount_other$7="{{ count }} रिप्लाई";var searchResultsCount_one$7="1 परिणाम";var searchResultsCount_other$7="{{ count }} परिणाम";var hiTranslations = {"Attach files":"फाइल्स अटैच करे",Cancel:Cancel$7,"Channel Missing":"चैनल उपलब्ध नहीं है",Close:Close$7,"Close emoji picker":"इमोजी पिकर बंद करें","Commands matching":"मेल खाती है","Connection failure, reconnecting now...":"कनेक्शन विफल रहा, अब पुनः कनेक्ट हो रहा है ...",Delete:Delete$7,Delivered:Delivered$7,"Drag your files here":"Drag your files here","Edit Message":"मैसेज में बदलाव करे","Edit message request failed":"संदेश संपादित करने का अनुरोध विफल रहा","Emoji matching":"इमोजी मिलान","Empty message...":"खाली संदेश ...","Error adding flag":"ध्वज जोड़ने में त्रुटि","Error connecting to chat, refresh the page to try again.":"चैट से कनेक्ट करने में त्रुटि, पेज को रिफ्रेश करें","Error deleting message":"संदेश हटाने में त्रुटि","Error muting a user ...":"यूजर को म्यूट करने का प्रयास फेल हुआ","Error pinning message":"संदेश को पिन करने में त्रुटि","Error removing message pin":"संदेश पिन निकालने में त्रुटि","Error unmuting a user ...":"यूजर को अनम्यूट करने का प्रयास फेल हुआ","Error uploading file":"फ़ाइल अपलोड करने में त्रुटि","Error uploading image":"छवि अपलोड करने में त्रुटि","Error · Unsent":"फेल","Error: {{ errorMessage }}":"फेल: {{ errorMessage }}",Flag:Flag$7,"Latest Messages":"नवीनतम संदेश",Menu:Menu$7,"Message Failed · Click to try again":"मैसेज फ़ैल - पुनः कोशिश करें","Message Failed · Unauthorized":"मैसेज फ़ैल - अनधिकृत","Message deleted":"मैसेज हटा दिया गया","Message has been successfully flagged":"मैसेज को फ्लैग कर दिया गया है","Message pinned":"संदेश पिन किया गया",Mute:Mute$7,New:New$7,"New Messages!":"नए मैसेज!","No chats here yet…":"यहां अभी तक कोई चैट नहीं...","No results found":"कोई परिणाम नहीं मिला","Nothing yet...":"कोई मैसेज नहीं है","Open emoji picker":"इमोजी पिकर खोलिये","People matching":"मेल खाते लोग",Pin:Pin$7,"Pinned by":"द्वारा पिन किया गया",Reply:Reply$7,"Reply to Message":"संदेश का जवाब दें",Search:Search$7,"Searching...":"खोज कर...",Send:Send$7,"Send message request failed":"संदेश भेजने का अनुरोध विफल रहा","Sending...":"भेजा जा रहा है","Slow Mode ON":"स्लो मोड ऑन","Some of the files will not be accepted":"Some of the files will not be accepted","This message was deleted...":"मैसेज हटा दिया गया",Thread:Thread$7,"Type your message":"अपना मैसेज लिखे",Unmute:Unmute$7,Unpin:Unpin$7,"Upload type: \"{{ type }}\" is not allowed":"अपलोड प्रकार: \"{{ type }}\" की अनुमति नहीं है","Wait until all attachments have uploaded":"सभी अटैचमेंट अपलोड होने तक प्रतीक्षा करें","You have no channels currently":"आपके पास कोई चैनल नहीं है","You've reached the maximum number of files":"आप अधिकतम फ़ाइलों तक पहुँच गए हैं",live:live$7,replyCount_one:replyCount_one$7,replyCount_other:replyCount_other$7,searchResultsCount_one:searchResultsCount_one$7,searchResultsCount_other:searchResultsCount_other$7,"this content could not be displayed":"यह कॉन्टेंट लोड नहीं हो पाया","{{ commaSeparatedUsers }} and {{ moreCount }} more":"{{ commaSeparatedUsers }} और {{ moreCount }} और","{{ commaSeparatedUsers }}, and {{ lastUser }}":"{{ commaSeparatedUsers }} और {{ lastUser }}","{{ firstUser }} and {{ secondUser }}":"{{ firstUser }} और {{ secondUser }}","{{ imageCount }} more":"{{ imageCount }} और","{{ memberCount }} members":"{{ memberCount }} मेंबर्स","{{ user }} has been muted":"{{ user }} को म्यूट कर दिया गया है","{{ user }} has been unmuted":"{{ user }} को अनम्यूट कर दिया गया है","{{ user }} is typing...":"{{ user }} is typing...","{{ users }} and more are typing...":"{{ users }} and more are typing...","{{ users }} and {{ user }} are typing...":"{{ users }} and {{ user }} are typing...","{{ watcherCount }} online":"{{ watcherCount }} online","🏙 Attachment...":"🏙 अटैचमेंट"};
342
+
343
+ var Cancel$6="Annulla";var Close$6="Chiudi";var Delete$6="Cancella";var Delivered$6="Consegnato";var Flag$6="Segnala";var Menu$6="Menù";var Mute$6="Silenzia";var New$6="Nuovo";var Pin$6="Pin";var Reply$6="Rispondere";var Search$6="Ricerca";var Send$6="Invia";var Thread$6="Thread";var Unmute$6="Riattiva le notifiche";var Unpin$6="Sblocca";var live$6="live";var replyCount_many$2="{{ count }} risposte";var replyCount_one$6="Una risposta";var replyCount_other$6="{{ count }} risposte";var searchResultsCount_many$2="{{ count }} risultati";var searchResultsCount_one$6="1 risultato";var searchResultsCount_other$6="{{ count }} risultati";var itTranslations = {"Attach files":"Allega file",Cancel:Cancel$6,"Channel Missing":"Il canale non esiste",Close:Close$6,"Close emoji picker":"Chiudi il selettore di emoji","Commands matching":"Comandi corrispondenti","Connection failure, reconnecting now...":"Connessione fallitta, riconnessione in corso...",Delete:Delete$6,Delivered:Delivered$6,"Drag your files here":"Drag your files here","Edit Message":"Modifica messaggio","Edit message request failed":"Richiesta di modifica del messaggio non riuscita","Emoji matching":"Abbinamento emoji","Empty message...":"Message vuoto...","Error adding flag":"Errore durante l'aggiunta del flag","Error connecting to chat, refresh the page to try again.":"Errore di connessione alla chat, aggiorna la pagina per riprovare","Error deleting message":"Errore durante l'eliminazione del messaggio","Error muting a user ...":"Errore silenziando un utente ...","Error pinning message":"Errore durante il blocco del messaggio","Error removing message pin":"Errore durante la rimozione del PIN del messaggio","Error unmuting a user ...":"Errore riattivando le notifiche per l'utente ...","Error uploading file":"Errore durante il caricamento del file","Error uploading image":"Errore durante il caricamento dell'immagine","Error · Unsent":"Errore · Non inviato","Error: {{ errorMessage }}":"Errore: {{ errorMessage }}",Flag:Flag$6,"Latest Messages":"Ultimi messaggi",Menu:Menu$6,"Message Failed · Click to try again":"Invio messaggio fallito · Clicca per riprovare","Message Failed · Unauthorized":"Invio messaggio fallito · Non autorizzato","Message deleted":"Messaggio cancellato","Message has been successfully flagged":"Il messaggio é stato segnalato con successo","Message pinned":"Messaggio bloccato",Mute:Mute$6,New:New$6,"New Messages!":"Nuovo messaggio!","No chats here yet…":"Non ci sono ancora messaggi qui...","No results found":"Nessun risultato trovato","Nothing yet...":"Ancora niente...","Open emoji picker":"Apri il selettore dellle emoji","People matching":"Persone che corrispondono",Pin:Pin$6,"Pinned by":"Appuntato da",Reply:Reply$6,"Reply to Message":"Rispondi al messaggio",Search:Search$6,"Searching...":"Ricerca in corso ...",Send:Send$6,"Send message request failed":"Invia messaggio di richiesta non riuscito","Sending...":"Invio in corso...","Slow Mode ON":"Modalità lenta attivata","Some of the files will not be accepted":"Some of the files will not be accepted","This message was deleted...":"Questo messaggio é stato cancellato",Thread:Thread$6,"Type your message":"Scrivi il tuo messaggio",Unmute:Unmute$6,Unpin:Unpin$6,"Upload type: \"{{ type }}\" is not allowed":"Tipo di caricamento: \"{{ type }}\" non è consentito","Wait until all attachments have uploaded":"Attendi il caricamento di tutti gli allegati","You have no channels currently":"Al momento non sono presenti canali","You've reached the maximum number of files":"Hai raggiunto il numero massimo di file",live:live$6,replyCount_many:replyCount_many$2,replyCount_one:replyCount_one$6,replyCount_other:replyCount_other$6,searchResultsCount_many:searchResultsCount_many$2,searchResultsCount_one:searchResultsCount_one$6,searchResultsCount_other:searchResultsCount_other$6,"this content could not be displayed":"questo contenuto non puó essere mostrato","{{ commaSeparatedUsers }} and {{ moreCount }} more":"{{ commaSeparatedUsers }} e altri {{ moreCount }}","{{ commaSeparatedUsers }}, and {{ lastUser }}":"{{ commaSeparatedUsers }} e {{ lastUser }}","{{ firstUser }} and {{ secondUser }}":"{{ firstUser }} e {{ secondUser }}","{{ imageCount }} more":"+ {{ imageCount }}","{{ memberCount }} members":"{{ memberCount }} membri","{{ user }} has been muted":"{{ user }} é stato silenziato","{{ user }} has been unmuted":"Notifiche riattivate per {{ user }}","{{ user }} is typing...":"{{ user }} is typing...","{{ users }} and more are typing...":"{{ users }} and more are typing...","{{ users }} and {{ user }} are typing...":"{{ users }} and {{ user }} are typing...","{{ watcherCount }} online":"{{ watcherCount }} online","🏙 Attachment...":"🏙 Allegato..."};
344
+
345
+ var Cancel$5="キャンセル";var Close$5="閉める";var Delete$5="消去";var Delivered$5="配信しました";var Flag$5="フラグ";var Menu$5="メニュー";var Mute$5="無音";var New$5="新しい";var Pin$5="ピン";var Reply$5="返事";var Search$5="探す";var Send$5="送信";var Thread$5="スレッド";var Unmute$5="無音を解除する";var Unpin$5="ピンを解除する";var live$5="ライブ";var replyCount_one$5="1件の返信";var replyCount_other$5="{{ count }} 返信";var searchResultsCount_one$5="1件の結果";var searchResultsCount_other$5="{{ count }}件の結果";var jaTranslations = {"Attach files":"ファイルを添付する",Cancel:Cancel$5,"Channel Missing":"チャネルがありません",Close:Close$5,"Close emoji picker":"絵文字ピッカーを閉める","Commands matching":"一致するコマンド","Connection failure, reconnecting now...":"接続が失敗しました。再接続中...",Delete:Delete$5,Delivered:Delivered$5,"Drag your files here":"Drag your files here","Edit Message":"メッセージを編集","Edit message request failed":"メッセージの編集要求が失敗しました","Emoji matching":"絵文字マッチング","Empty message...":"空のメッセージ...","Error adding flag":"フラグを追加のエラーが発生しました","Error connecting to chat, refresh the page to try again.":"チャットへの接続ができませんでした。ページを更新してください。","Error deleting message":"メッセージを削除するエラーが発生しました","Error muting a user ...":"ユーザーを無音するエラーが発生しました...","Error pinning message":"メッセージをピンのエラーが発生しました","Error removing message pin":"メッセージのピンを削除のエラーが発生しました","Error unmuting a user ...":"ユーザーの無音解除のエラーが発生しました...","Error uploading file":"ファイルをアップロードのエラーが発生しました","Error uploading image":"画像をアップロードのエラーが発生しました","Error · Unsent":"エラー・未送信","Error: {{ errorMessage }}":"エラー: {{ errorMessage }}",Flag:Flag$5,"Latest Messages":"最新のメッセージ",Menu:Menu$5,"Message Failed · Click to try again":"メッセージが失敗しました · クリックして再試行してください","Message Failed · Unauthorized":"メッセージが失敗しました · 許可されていません","Message deleted":"メッセージが削除されました","Message has been successfully flagged":"メッセージに正常にフラグが付けられました","Message pinned":"メッセージにピンが付けられました",Mute:Mute$5,New:New$5,"New Messages!":"新しいメッセージ!","No chats here yet…":"ここにはまだチャットはありません…","No results found":"結果が見つかりません","Nothing yet...":"まだ何もありません...","Open emoji picker":"絵文字ピッカーを開く","People matching":"一致する人",Pin:Pin$5,"Pinned by":"ピンした方",Reply:Reply$5,"Reply to Message":"メッセージに返信",Search:Search$5,"Searching...":"検索中...",Send:Send$5,"Send message request failed":"メッセージ送信リクエストが失敗しました","Sending...":"送信中...","Slow Mode ON":"スローモードオン","Some of the files will not be accepted":"Some of the files will not be accepted","This message was deleted...":"このメッセージは削除されました...",Thread:Thread$5,"Type your message":"メッセージを入力してください",Unmute:Unmute$5,Unpin:Unpin$5,"Upload type: \"{{ type }}\" is not allowed":"アップロードタイプ:\"{{ type }}\"は許可されていません","Wait until all attachments have uploaded":"すべての添付ファイルがアップロードされるまでお待ちください","You have no channels currently":"現在チャンネルはありません","You've reached the maximum number of files":"ファイルの最大数に達しました",live:live$5,replyCount_one:replyCount_one$5,replyCount_other:replyCount_other$5,searchResultsCount_one:searchResultsCount_one$5,searchResultsCount_other:searchResultsCount_other$5,"this content could not be displayed":"このコンテンツは表示できませんでした","{{ commaSeparatedUsers }} and {{ moreCount }} more":"{{ commaSeparatedUsers }} と {{ moreCount }} 他人","{{ commaSeparatedUsers }}, and {{ lastUser }}":"{{ commaSeparatedUsers }} と {{ lastUser }}","{{ firstUser }} and {{ secondUser }}":"{{ firstUser }} と {{ secondUser }}","{{ imageCount }} more":"{{ imageCount }} イメージ","{{ memberCount }} members":"{{ memberCount }} メンバー","{{ user }} has been muted":"{{ user }} 無音されています","{{ user }} has been unmuted":"{{ user }} 無音されていません","{{ user }} is typing...":"{{ user }} is typing...","{{ users }} and more are typing...":"{{ users }} and more are typing...","{{ users }} and {{ user }} are typing...":"{{ users }} and {{ user }} are typing...","{{ watcherCount }} online":"{{ watcherCount }} オンライン","🏙 Attachment...":"🏙 アタッチメント..."};
346
+
347
+ var Cancel$4="취소";var Close$4="닫기";var Delete$4="삭제";var Delivered$4="배달됨";var Flag$4="플래그";var Menu$4="메뉴";var Mute$4="무음";var New$4="새로운";var Pin$4="핀";var Reply$4="답장";var Search$4="찾다";var Send$4="보내다";var Thread$4="스레드";var Unmute$4="음소거 해제";var Unpin$4="핀 해제";var live$4="라이브";var replyCount_one$4="답장 1개";var replyCount_other$4="{{ count }} 답장";var searchResultsCount_one$4="1개의 결과";var searchResultsCount_other$4="{{ count }}개 결과";var koTranslations = {"Attach files":"파일 첨부",Cancel:Cancel$4,"Channel Missing":"채널 누락",Close:Close$4,"Close emoji picker":"이모티콘 선택기 닫기","Commands matching":"일치하는 명령","Connection failure, reconnecting now...":"연결 실패, 지금 다시 연결 중...",Delete:Delete$4,Delivered:Delivered$4,"Drag your files here":"Drag your files here","Edit Message":"메시지 수정","Edit message request failed":"메시지 수정 요청 실패","Emoji matching":"이모티콘 매칭","Empty message...":"빈 메시지...","Error adding flag":"플래그를 추가하는 동안 오류가 발생했습니다.","Error connecting to chat, refresh the page to try again.":"채팅에 연결하는 동안 오류가 발생했습니다. 페이지를 새로고침하여 다시 시도하세요.","Error deleting message":"메시지를 삭제하는 중에 오류가 발생했습니다.","Error muting a user ...":"사용자를 음소거하는 중에 오류가 발생했습니다...","Error pinning message":"메시지를 핀하는 중에 오류가 발생했습니다.","Error removing message pin":"메시지 핀을 제거하는 중에 오류가 발생했습니다.","Error unmuting a user ...":"사용자 음소거 해제 중 오류 발생...","Error uploading file":"파일 업로드 오류","Error uploading image":"이미지를 업로드하는 동안 오류가 발생했습니다.","Error · Unsent":"오류 · 전송되지 않음","Error: {{ errorMessage }}":"오류: {{ errorMessage }}",Flag:Flag$4,"Latest Messages":"최신 메시지",Menu:Menu$4,"Message Failed · Click to try again":"메시지 실패 · 다시 시도하려면 클릭하세요.","Message Failed · Unauthorized":"메시지 실패 · 승인되지 않음","Message deleted":"메시지가 삭제되었습니다.","Message has been successfully flagged":"메시지에 플래그가 지정되었습니다.","Message pinned":"메시지 핀했습니다",Mute:Mute$4,New:New$4,"New Messages!":"새 메시지!","No chats here yet…":"아직 채팅이 없습니다...","No results found":"검색 결과가 없습니다","Nothing yet...":"아직 아무것도...","Open emoji picker":"이모티콘 선택기 열기","People matching":"일치하는 사람",Pin:Pin$4,"Pinned by":"핀했던 분:",Reply:Reply$4,"Reply to Message":"메시지에 답장",Search:Search$4,"Searching...":"수색...",Send:Send$4,"Send message request failed":"메시지 보내기 요청 실패","Sending...":"배상중...","Slow Mode ON":"슬로우 모드 켜짐","Some of the files will not be accepted":"Some of the files will not be accepted","This message was deleted...":"이 메시지는 삭제되었습니다...",Thread:Thread$4,"Type your message":"메시지 입력",Unmute:Unmute$4,Unpin:Unpin$4,"Upload type: \"{{ type }}\" is not allowed":"업로드 유형: \"{{ type }}\"은(는) 허용되지 않습니다.","Wait until all attachments have uploaded":"모든 첨부 파일이 업로드될 때까지 기다립니다.","You have no channels currently":"현재 채널이 없습니다.","You've reached the maximum number of files":"최대 파일 수에 도달했습니다.",live:live$4,replyCount_one:replyCount_one$4,replyCount_other:replyCount_other$4,searchResultsCount_one:searchResultsCount_one$4,searchResultsCount_other:searchResultsCount_other$4,"this content could not be displayed":"이 콘텐츠를 표시할 수 없습니다","{{ commaSeparatedUsers }} and {{ moreCount }} more":"{{ commaSeparatedUsers }} 그리고 {{ moreCount }}명 더","{{ commaSeparatedUsers }}, and {{ lastUser }}":"{{ commaSeparatedUsers }} 그리고 {{ lastUser }}","{{ firstUser }} and {{ secondUser }}":"{{ firstUser }} 그리고 {{ secondUser }}","{{ imageCount }} more":"{{ imageCount }}개 더","{{ memberCount }} members":"{{ memberCount }}명","{{ user }} has been muted":"{{ user }} 음소거되었습니다","{{ user }} has been unmuted":"{{ user }} 음소거가 해제되었습니다","{{ user }} is typing...":"{{ user }} is typing...","{{ users }} and more are typing...":"{{ users }} and more are typing...","{{ users }} and {{ user }} are typing...":"{{ users }} and {{ user }} are typing...","{{ watcherCount }} online":"{{ watcherCount }} 온라인","🏙 Attachment...":"🏙 부착..."};
348
+
349
+ var Cancel$3="Annuleer";var Close$3="Sluit";var Delete$3="Verwijder";var Delivered$3="Afgeleverd";var Flag$3="Markeer";var Menu$3="Menu";var Mute$3="Mute";var New$3="Nieuwe";var Pin$3="Pin";var Reply$3="Antwoord";var Search$3="Zoeken";var Send$3="Verstuur";var Thread$3="Draadje";var Unmute$3="Unmute";var Unpin$3="Losmaken";var live$3="live";var replyCount_one$3="1 antwoord";var replyCount_other$3="{{ count }} antwoorden";var searchResultsCount_one$3="1 resultaat";var searchResultsCount_other$3="{{ count }} resultaten";var nlTranslations = {"Attach files":"Bijlage toevoegen",Cancel:Cancel$3,"Channel Missing":"Kanaal niet gevonden",Close:Close$3,"Close emoji picker":"Sluit de emoji-kiezer","Commands matching":"Bijpassende opdrachten","Connection failure, reconnecting now...":"Probleem met de verbinding, opnieuw verbinding maken...",Delete:Delete$3,Delivered:Delivered$3,"Drag your files here":"Drag your files here","Edit Message":"Pas bericht aan","Edit message request failed":"Verzoek om bericht bewerken mislukt","Emoji matching":"Emoji-overeenkomsten","Empty message...":"Leeg bericht...","Error adding flag":"Fout bij toevoegen van vlag","Error connecting to chat, refresh the page to try again.":"Fout bij het verbinden, ververs de pagina om nogmaals te proberen","Error deleting message":"Fout bij verwijderen van bericht","Error muting a user ...":"Fout bij het muten van de gebruiker","Error pinning message":"Fout bij vastzetten van bericht","Error removing message pin":"Fout bij verwijderen van berichtpin","Error unmuting a user ...":"Fout bij het unmuten van de gebruiker","Error uploading file":"Fout bij uploaden bestand","Error uploading image":"Fout bij uploaden afbeelding","Error · Unsent":"Error: · niet verzonden","Error: {{ errorMessage }}":"Error: {{ errorMessage }}",Flag:Flag$3,"Latest Messages":"Laatste berichten",Menu:Menu$3,"Message Failed · Click to try again":"Bericht mislukt, klik om het nogmaals te proberen","Message Failed · Unauthorized":"Bericht mislukt, ongeautoriseerd","Message deleted":"Bericht verwijderd","Message has been successfully flagged":"Bericht is succesvol gemarkeerd","Message pinned":"Bericht vastgezet",Mute:Mute$3,New:New$3,"New Messages!":"Nieuwe Berichten!","No chats here yet…":"Nog geen chats hier...","No results found":"Geen resultaten gevonden","Nothing yet...":"Nog niets ...","Open emoji picker":"Open emojipicker","People matching":"Mensen die matchen",Pin:Pin$3,"Pinned by":"Vastgemaakt door",Reply:Reply$3,"Reply to Message":"Antwoord op bericht",Search:Search$3,"Searching...":"Zoeken...",Send:Send$3,"Send message request failed":"Verzoek om bericht te verzenden mislukt","Sending...":"Aan het verzenden...","Slow Mode ON":"Langzame modus aan","Some of the files will not be accepted":"Some of the files will not be accepted","This message was deleted...":"Dit bericht was verwijderd",Thread:Thread$3,"Type your message":"Type je bericht",Unmute:Unmute$3,Unpin:Unpin$3,"Upload type: \"{{ type }}\" is not allowed":"Uploadtype: \"{{ type }}\" is niet toegestaan","Wait until all attachments have uploaded":"Wacht tot alle bijlagen zijn geüpload","You have no channels currently":"Er zijn geen chats beschikbaar","You've reached the maximum number of files":"Je hebt het maximale aantal bestanden bereikt",live:live$3,replyCount_one:replyCount_one$3,replyCount_other:replyCount_other$3,searchResultsCount_one:searchResultsCount_one$3,searchResultsCount_other:searchResultsCount_other$3,"this content could not be displayed":"Deze inhoud kan niet weergegeven worden","{{ commaSeparatedUsers }} and {{ moreCount }} more":"{{ commaSeparatedUsers }} en {{ moreCount }} meer","{{ commaSeparatedUsers }}, and {{ lastUser }}":"{{ commaSeparatedUsers }} en {{ lastUser }}","{{ firstUser }} and {{ secondUser }}":"{{ firstUser }} en {{ secondUser }}","{{ imageCount }} more":"+{{ imageCount }}","{{ memberCount }} members":"{{ memberCount }} deelnemers","{{ user }} has been muted":"{{ user }} is muted","{{ user }} has been unmuted":"{{ user }} is unmuted","{{ user }} is typing...":"{{ user }} is typing...","{{ users }} and more are typing...":"{{ users }} and more are typing...","{{ users }} and {{ user }} are typing...":"{{ users }} and {{ user }} are typing...","{{ watcherCount }} online":"{{ watcherCount }} online","🏙 Attachment...":"🏙 Bijlage..."};
350
+
351
+ var Cancel$2="Cancelar";var Close$2="Fechar";var Delete$2="Excluir";var Delivered$2="Entregue";var Flag$2="Reportar";var Menu$2="Menu";var Mute$2="Mudo";var New$2="Novo";var Pin$2="Fixar";var Reply$2="Responder";var Search$2="Procurar";var Send$2="Enviar";var Thread$2="Fio";var Unmute$2="Ativar som";var Unpin$2="Liberar";var live$2="ao vivo";var replyCount_many$1="{{ count }} respostas";var replyCount_one$2="1 resposta";var replyCount_other$2="{{ count }} respostas";var searchResultsCount_many$1="{{ count }} resultados";var searchResultsCount_one$2="1 resultado";var searchResultsCount_other$2="{{ count }} resultados";var ptTranslations = {"Attach files":"Anexar arquivos",Cancel:Cancel$2,"Channel Missing":"Canal ausente",Close:Close$2,"Close emoji picker":"Fechar seletor de emoji","Commands matching":"Comandos correspondentes","Connection failure, reconnecting now...":"Falha de conexão, reconectando agora...",Delete:Delete$2,Delivered:Delivered$2,"Drag your files here":"Drag your files here","Edit Message":"Editar Mensagem","Edit message request failed":"O pedido de edição da mensagem falhou","Emoji matching":"Emoji correspondente","Empty message...":"Mensagem vazia...","Error adding flag":"Erro ao reportar","Error connecting to chat, refresh the page to try again.":"Erro ao conectar ao bate-papo, atualize a página para tentar novamente.","Error deleting message":"Erro ao deletar mensagem","Error muting a user ...":"Erro ao silenciar um usuário...","Error pinning message":"Erro ao fixar mensagem","Error removing message pin":"Erro ao remover o PIN da mensagem","Error unmuting a user ...":"Erro ao ativar o som de um usuário...","Error uploading file":"Erro ao enviar arquivo","Error uploading image":"Erro ao carregar a imagem","Error · Unsent":"Erro · Não enviado","Error: {{ errorMessage }}":"Erro: {{ errorMessage }}",Flag:Flag$2,"Latest Messages":"Mensagens mais recentes",Menu:Menu$2,"Message Failed · Click to try again":"A mensagem falhou · Clique para tentar novamente","Message Failed · Unauthorized":"A mensagem falhou · não autorizado","Message deleted":"Mensagem apagada","Message has been successfully flagged":"A mensagem foi reportada com sucesso","Message pinned":"Mensagem fixada",Mute:Mute$2,New:New$2,"New Messages!":"Novas mensagens!","No chats here yet…":"Ainda não há conversas aqui...","No results found":"Nenhum resultado encontrado","Nothing yet...":"Nada ainda...","Open emoji picker":"Abrir seletor de emoji","People matching":"Pessoas correspondentes",Pin:Pin$2,"Pinned by":"Fixado por",Reply:Reply$2,"Reply to Message":"Responder a mensagem",Search:Search$2,"Searching...":"Procurando...",Send:Send$2,"Send message request failed":"O pedido de envio de mensagem falhou","Sending...":"Enviando...","Slow Mode ON":"Modo lento LIGADO","Some of the files will not be accepted":"Some of the files will not be accepted","This message was deleted...":"Esta mensagem foi excluída...",Thread:Thread$2,"Type your message":"Digite sua mensagem",Unmute:Unmute$2,Unpin:Unpin$2,"Upload type: \"{{ type }}\" is not allowed":"Tipo de upload: \"{{ type }}\" não é permitido","Wait until all attachments have uploaded":"Espere até que todos os anexos tenham sido carregados","You have no channels currently":"Você não tem canais atualmente","You've reached the maximum number of files":"Você atingiu o número máximo de arquivos",live:live$2,replyCount_many:replyCount_many$1,replyCount_one:replyCount_one$2,replyCount_other:replyCount_other$2,searchResultsCount_many:searchResultsCount_many$1,searchResultsCount_one:searchResultsCount_one$2,searchResultsCount_other:searchResultsCount_other$2,"this content could not be displayed":"este conteúdo não pôde ser exibido","{{ commaSeparatedUsers }} and {{ moreCount }} more":"{{ commaSeparatedUsers }} e mais {{ moreCount }}","{{ commaSeparatedUsers }}, and {{ lastUser }}":"{{ commaSeparatedUsers }} e {{ lastUser }}","{{ firstUser }} and {{ secondUser }}":"{{ firstUser }} e {{ secondUser }}","{{ imageCount }} more":"{{ imageCount }} mais","{{ memberCount }} members":"{{ memberCount }} membros","{{ user }} has been muted":"{{ user }} foi silenciado","{{ user }} has been unmuted":"{{ user }} foi reativado","{{ user }} is typing...":"{{ user }} is typing...","{{ users }} and more are typing...":"{{ users }} and more are typing...","{{ users }} and {{ user }} are typing...":"{{ users }} and {{ user }} are typing...","{{ watcherCount }} online":"{{ watcherCount }} online","🏙 Attachment...":"🏙 Anexo..."};
352
+
353
+ var Cancel$1="Отмена";var Close$1="Закрыть";var Delete$1="Удалить";var Delivered$1="Отправлено";var Flag$1="Пожаловаться";var Menu$1="Меню";var Mute$1="Отключить уведомления";var New$1="Новые";var Pin$1="Штырь";var Reply$1="Отвечать";var Search$1="Поиск";var Send$1="Отправить";var Thread$1="Ветка";var Unmute$1="Включить уведомления";var Unpin$1="Открепить";var live$1="В прямом эфире";var replyCount_few="{{ count }} ответов";var replyCount_many="{{ count }} ответов";var replyCount_one$1="1 ответ";var replyCount_other$1="{{ count }} ответов";var searchResultsCount_few="{{ count }} результата";var searchResultsCount_many="{{ count }} результатов";var searchResultsCount_one$1="1 результат";var searchResultsCount_other$1="{{ count }} результатов";var ruTranslations = {"Attach files":"Прикрепить файлы",Cancel:Cancel$1,"Channel Missing":"Канал не найден",Close:Close$1,"Close emoji picker":"Закрыть окно выбора смайлов","Commands matching":"Соответствие команд","Connection failure, reconnecting now...":"Ошибка соединения, переподключение...",Delete:Delete$1,Delivered:Delivered$1,"Drag your files here":"Drag your files here","Edit Message":"Редактировать сообщение","Edit message request failed":"Не удалось изменить запрос сообщения","Emoji matching":"Соответствие эмодзи","Empty message...":"Пустое сообщение...","Error adding flag":"Ошибка добавления флага","Error connecting to chat, refresh the page to try again.":"Ошибка подключения к чату, обновите страницу чтобы попробовать снова.","Error deleting message":"Ошибка при удалении сообщения","Error muting a user ...":"Ошибка отключения уведомлений от пользователя...","Error pinning message":"Сообщение об ошибке при закреплении","Error removing message pin":"Ошибка при удалении булавки сообщения","Error unmuting a user ...":"Ошибка включения уведомлений...","Error uploading file":"Ошибка при загрузке файла","Error uploading image":"Ошибка загрузки изображения","Error · Unsent":"Ошибка · Не отправлено","Error: {{ errorMessage }}":"Ошибка: {{ errorMessage }}",Flag:Flag$1,"Latest Messages":"Последние сообщения",Menu:Menu$1,"Message Failed · Click to try again":"Ошибка отправки сообщения · Нажмите чтобы повторить","Message Failed · Unauthorized":"Ошибка отправки сообщения · Неавторизованный","Message deleted":"Сообщение удалено","Message has been successfully flagged":"Жалоба на сообщение была принята","Message pinned":"Сообщение закреплено",Mute:Mute$1,New:New$1,"New Messages!":"Новые сообщения!","No chats here yet…":"Здесь еще нет чатов...","No results found":"результаты не найдены","Nothing yet...":"Пока ничего нет...","Open emoji picker":"Выбрать emoji","People matching":"Соответствующие люди",Pin:Pin$1,"Pinned by":"Закреплено",Reply:Reply$1,"Reply to Message":"Ответить на сообщение",Search:Search$1,"Searching...":"Ищем...",Send:Send$1,"Send message request failed":"Не удалось отправить запрос на отправку сообщения","Sending...":"Отправка...","Slow Mode ON":"Медленный режим включен","Some of the files will not be accepted":"Some of the files will not be accepted","This message was deleted...":"Сообщение было удалено...",Thread:Thread$1,"Type your message":"Ваше сообщение",Unmute:Unmute$1,Unpin:Unpin$1,"Upload type: \"{{ type }}\" is not allowed":"Тип загрузки: \"{{ type }}\" не разрешен","Wait until all attachments have uploaded":"Подождите, пока все вложения загрузятся","You have no channels currently":"У вас нет каналов в данный момент","You've reached the maximum number of files":"Вы достигли максимального количества файлов",live:live$1,replyCount_few:replyCount_few,replyCount_many:replyCount_many,replyCount_one:replyCount_one$1,replyCount_other:replyCount_other$1,searchResultsCount_few:searchResultsCount_few,searchResultsCount_many:searchResultsCount_many,searchResultsCount_one:searchResultsCount_one$1,searchResultsCount_other:searchResultsCount_other$1,"this content could not be displayed":"Этот контент не может быть отображен в данный момент","{{ commaSeparatedUsers }} and {{ moreCount }} more":"{{ commaSeparatedUsers }} и {{ moreCount }} еще","{{ commaSeparatedUsers }}, and {{ lastUser }}":"{{ commaSeparatedUsers }} и {{ lastUser }}","{{ firstUser }} and {{ secondUser }}":"{{ firstUser }} и {{ secondUser }}","{{ imageCount }} more":"Ещё {{ imageCount }}","{{ memberCount }} members":"{{ memberCount }} члены","{{ user }} has been muted":"Вы отписались от уведомлений от {{ user }}","{{ user }} has been unmuted":"Уведомления от {{ user }} были включены","{{ user }} is typing...":"{{ user }} is typing...","{{ users }} and more are typing...":"{{ users }} and more are typing...","{{ users }} and {{ user }} are typing...":"{{ users }} and {{ user }} are typing...","{{ watcherCount }} online":"{{ watcherCount }} в сети","🏙 Attachment...":"🏙 Вложение..."};
354
+
355
+ var Cancel="İptal";var Close="Kapat";var Delete="Sil";var Delivered="İletildi";var Flag="Bayrak";var Menu="Menü";var Mute="Sessiz";var New="Yeni";var Pin="Toplu iğne";var Reply="Cevapla";var Search="Arama";var Send="Gönder";var Thread="Konu";var Unmute="Sesini aç";var Unpin="Sabitlemeyi kaldır";var live="canlı";var replyCount_one="1 cevap";var replyCount_other="{{ count }} cevaplar";var searchResultsCount_one="1 sonuç";var searchResultsCount_other="{{ count }} sonuç";var trTranslations = {"Attach files":"Dosya ekle",Cancel:Cancel,"Channel Missing":"Kanal bulunamıyor",Close:Close,"Close emoji picker":"Emoji seçiciyi kapat","Commands matching":"Eşleşen komutlar","Connection failure, reconnecting now...":"Bağlantı hatası, tekrar bağlanılıyor...",Delete:Delete,Delivered:Delivered,"Drag your files here":"Drag your files here","Edit Message":"Mesajı Düzenle","Edit message request failed":"Mesaj düzenleme isteği başarısız oldu","Emoji matching":"Emoji eşleştirme","Empty message...":"Boş mesaj...","Error adding flag":"Bayrak eklenirken hata oluştu","Error connecting to chat, refresh the page to try again.":"Bağlantı hatası, sayfayı yenileyip tekrar deneyin.","Error deleting message":"Mesaj silinirken hata oluştu","Error muting a user ...":"Kullanıcıyı sessize alırken hata oluştu ...","Error pinning message":"Mesaj sabitlenirken hata oluştu","Error removing message pin":"Mesaj PIN'i kaldırılırken hata oluştu","Error unmuting a user ...":"Kullanıcının sesini açarken hata oluştu ...","Error uploading file":"Dosya yüklenirken hata oluştu","Error uploading image":"Resmi yüklerken hata","Error · Unsent":"Hata · Gönderilemedi","Error: {{ errorMessage }}":"Hata: {{ errorMessage }}",Flag:Flag,"Latest Messages":"Son Mesajlar",Menu:Menu,"Message Failed · Click to try again":"Mesaj Başarısız · Tekrar denemek için tıklayın","Message Failed · Unauthorized":"Mesaj Başarısız · Yetkisiz","Message deleted":"Mesaj silindi","Message has been successfully flagged":"Mesaj başarıyla bayraklandı","Message pinned":"Mesaj sabitlendi",Mute:Mute,New:New,"New Messages!":"Yeni Mesajlar!","No chats here yet…":"Henüz burada sohbet yok...","No results found":"Sonuç bulunamadı","Nothing yet...":"Şimdilik hiçbir şey...","Open emoji picker":"Emoji klavyesini aç","People matching":"Eşleşen kişiler",Pin:Pin,"Pinned by":"Sabitleyen",Reply:Reply,"Reply to Message":"Mesajı Cevapla",Search:Search,"Searching...":"Aranıyor...",Send:Send,"Send message request failed":"Mesaj gönderme isteği başarısız oldu","Sending...":"Gönderiliyor...","Slow Mode ON":"Yavaş Mod Açık","Some of the files will not be accepted":"Some of the files will not be accepted","This message was deleted...":"Bu mesaj silindi",Thread:Thread,"Type your message":"Mesajınızı yazın",Unmute:Unmute,Unpin:Unpin,"Upload type: \"{{ type }}\" is not allowed":"Yükleme türü: \"{{ type }}\" izin verilmez","Wait until all attachments have uploaded":"Tüm ekler yüklenene kadar bekleyin","You have no channels currently":"Henüz kanalınız yok","You've reached the maximum number of files":"Maksimum dosya sayısına ulaştınız",live:live,replyCount_one:replyCount_one,replyCount_other:replyCount_other,searchResultsCount_one:searchResultsCount_one,searchResultsCount_other:searchResultsCount_other,"this content could not be displayed":"bu içerik gösterilemiyor","{{ commaSeparatedUsers }} and {{ moreCount }} more":"{{ commaSeparatedUsers }} ve {{ moreCount }} daha","{{ commaSeparatedUsers }}, and {{ lastUser }}":"{{ commaSeparatedUsers }}, ve {{ lastUser }}","{{ firstUser }} and {{ secondUser }}":"{{ firstUser }} ve {{ secondUser }}","{{ imageCount }} more":"{{ imageCount }} adet daha","{{ memberCount }} members":"{{ memberCount }} üyeler","{{ user }} has been muted":"{{ user }} sessize alındı","{{ user }} has been unmuted":"{{ user }} sesi açıldı","{{ user }} is typing...":"{{ user }} is typing...","{{ users }} and more are typing...":"{{ users }} and more are typing...","{{ users }} and {{ user }} are typing...":"{{ users }} and {{ user }} are typing...","{{ watcherCount }} online":"{{ watcherCount }} çevrimiçi","🏙 Attachment...":"🏙 Ek..."};
356
+
357
+ var defaultNS = 'translation';
358
+ var defaultLng = 'en';
359
+ Dayjs__default["default"].extend(updateLocale__default["default"]);
360
+ Dayjs__default["default"].extend(utc__default["default"]);
361
+ Dayjs__default["default"].extend(timezone__default["default"]);
362
+ Dayjs__default["default"].updateLocale('de', {
363
+ calendar: {
364
+ lastDay: '[gestern um] LT',
365
+ lastWeek: '[letzten] dddd [um] LT',
366
+ nextDay: '[morgen um] LT',
367
+ nextWeek: 'dddd [um] LT',
368
+ sameDay: '[heute um] LT',
369
+ sameElse: 'L',
370
+ },
371
+ });
372
+ Dayjs__default["default"].updateLocale('es', {
373
+ calendar: {
374
+ lastDay: '[ayer a las] LT',
375
+ lastWeek: '[pasado] dddd [a] LT',
376
+ nextDay: '[mañana a] LT',
377
+ nextWeek: 'dddd [a] LT',
378
+ sameDay: '[hoy a las] LT',
379
+ sameElse: 'L',
380
+ },
381
+ });
382
+ Dayjs__default["default"].updateLocale('fr', {
383
+ calendar: {
384
+ lastDay: '[Hier à] LT',
385
+ lastWeek: 'dddd [dernier à] LT',
386
+ nextDay: '[Demain à] LT',
387
+ nextWeek: 'dddd [à] LT',
388
+ sameDay: '[Aujourd’hui à] LT',
389
+ sameElse: 'L',
390
+ },
391
+ });
392
+ Dayjs__default["default"].updateLocale('hi', {
393
+ calendar: {
394
+ lastDay: '[कल] LT',
395
+ lastWeek: '[पिछले] dddd, LT',
396
+ nextDay: '[कल] LT',
397
+ nextWeek: 'dddd, LT',
398
+ sameDay: '[आज] LT',
399
+ sameElse: 'L',
400
+ },
401
+ // Hindi notation for meridiems are quite fuzzy in practice. While there exists
402
+ // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
403
+ meridiem: function (hour) {
404
+ if (hour < 4) {
405
+ return 'रात';
406
+ }
407
+ else if (hour < 10) {
408
+ return 'सुबह';
409
+ }
410
+ else if (hour < 17) {
411
+ return 'दोपहर';
412
+ }
413
+ else if (hour < 20) {
414
+ return 'शाम';
415
+ }
416
+ else {
417
+ return 'रात';
418
+ }
419
+ },
420
+ meridiemHour: function (hour, meridiem) {
421
+ if (hour === 12) {
422
+ hour = 0;
423
+ }
424
+ if (meridiem === 'रात') {
425
+ return hour < 4 ? hour : hour + 12;
426
+ }
427
+ else if (meridiem === 'सुबह') {
428
+ return hour;
429
+ }
430
+ else if (meridiem === 'दोपहर') {
431
+ return hour >= 10 ? hour : hour + 12;
432
+ }
433
+ else if (meridiem === 'शाम') {
434
+ return hour + 12;
435
+ }
436
+ return hour;
437
+ },
438
+ meridiemParse: /रात|सुबह|दोपहर|शाम/,
439
+ });
440
+ Dayjs__default["default"].updateLocale('it', {
441
+ calendar: {
442
+ lastDay: '[Ieri alle] LT',
443
+ lastWeek: '[lo scorso] dddd [alle] LT',
444
+ nextDay: '[Domani alle] LT',
445
+ nextWeek: 'dddd [alle] LT',
446
+ sameDay: '[Oggi alle] LT',
447
+ sameElse: 'L',
448
+ },
449
+ });
450
+ Dayjs__default["default"].updateLocale('ja', {
451
+ calendar: {
452
+ lastDay: '[昨日] LT',
453
+ lastWeek: 'dddd LT',
454
+ nextDay: '[明日] LT',
455
+ nextWeek: '[次の] dddd LT',
456
+ sameDay: '[今日] LT',
457
+ sameElse: 'L',
458
+ },
459
+ });
460
+ Dayjs__default["default"].updateLocale('ko', {
461
+ calendar: {
462
+ lastDay: '[어제] LT',
463
+ lastWeek: '[지난] dddd LT',
464
+ nextDay: '[내일] LT',
465
+ nextWeek: 'dddd LT',
466
+ sameDay: '[오늘] LT',
467
+ sameElse: 'L',
468
+ },
469
+ });
470
+ Dayjs__default["default"].updateLocale('nl', {
471
+ calendar: {
472
+ lastDay: '[gisteren om] LT',
473
+ lastWeek: '[afgelopen] dddd [om] LT',
474
+ nextDay: '[morgen om] LT',
475
+ nextWeek: 'dddd [om] LT',
476
+ sameDay: '[vandaag om] LT',
477
+ sameElse: 'L',
478
+ },
479
+ });
480
+ Dayjs__default["default"].updateLocale('pt', {
481
+ calendar: {
482
+ lastDay: '[ontem às] LT',
483
+ lastWeek: 'dddd [passada às] LT',
484
+ nextDay: '[amanhã às] LT',
485
+ nextWeek: 'dddd [às] LT',
486
+ sameDay: '[hoje às] LT',
487
+ sameElse: 'L',
488
+ },
489
+ });
490
+ Dayjs__default["default"].updateLocale('ru', {
491
+ calendar: {
492
+ lastDay: '[Вчера, в] LT',
493
+ nextDay: '[Завтра, в] LT',
494
+ sameDay: '[Сегодня, в] LT',
495
+ },
496
+ });
497
+ Dayjs__default["default"].updateLocale('tr', {
498
+ calendar: {
499
+ lastDay: '[dün] LT',
500
+ lastWeek: '[geçen] dddd [saat] LT',
501
+ nextDay: '[yarın saat] LT',
502
+ nextWeek: '[gelecek] dddd [saat] LT',
503
+ sameDay: '[bugün saat] LT',
504
+ sameElse: 'L',
505
+ },
506
+ });
507
+ var en_locale = {
508
+ formats: {},
509
+ months: [
510
+ 'January',
511
+ 'February',
512
+ 'March',
513
+ 'April',
514
+ 'May',
515
+ 'June',
516
+ 'July',
517
+ 'August',
518
+ 'September',
519
+ 'October',
520
+ 'November',
521
+ 'December',
522
+ ],
523
+ relativeTime: {},
524
+ weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
525
+ };
526
+ // Type guards to check DayJs
527
+ var isDayJs = function (dateTimeParser) {
528
+ return dateTimeParser.extend !== undefined;
529
+ };
530
+ var supportsTz = function (dateTimeParser) {
531
+ return dateTimeParser.tz !== undefined;
532
+ };
533
+ /**
534
+ * Wrapper around [i18next](https://www.i18next.com/) class for Stream related translations.
535
+ * Instance of this class should be provided to Chat component to handle translations.
536
+ * Stream provides following list of in-built translations:
537
+ * 1. English (en)
538
+ * 2. Dutch (nl)
539
+ * 3. Russian (ru)
540
+ * 4. Turkish (tr)
541
+ * 5. French (fr)
542
+ * 6. Italian (it)
543
+ * 7. Hindi (hi)
544
+ * 8. Spanish (es)
545
+ * 9. Portuguese (pt)
546
+ * 10. German (de)
547
+ * 11. Japanese (ja)
548
+ * 12. Korean (ko)
549
+ *
550
+ * Simplest way to start using chat components in one of the in-built languages would be following:
551
+ *
552
+ * ```
553
+ * const i18n = new Streami18n({ language 'nl' });
554
+ * <Chat client={chatClient} i18nInstance={i18n}>
555
+ * ...
556
+ * </Chat>
557
+ * ```
558
+ *
559
+ * If you would like to override certain keys in in-built translation.
560
+ * UI will be automatically updated in this case.
561
+ *
562
+ * ```
563
+ * const i18n = new Streami18n({
564
+ * language: 'nl',
565
+ * translationsForLanguage: {
566
+ * 'Nothing yet...': 'Nog Niet ...',
567
+ * '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} en {{ secondUser }} zijn aan het typen...',
568
+ * }
569
+ * });
570
+ *
571
+ * If you would like to register additional languages, use registerTranslation. You can add as many languages as you want:
572
+ *
573
+ * i18n.registerTranslation('zh', {
574
+ * 'Nothing yet...': 'Nog Niet ...',
575
+ * '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} en {{ secondUser }} zijn aan het typen...',
576
+ * });
577
+ *
578
+ * <Chat client={chatClient} i18nInstance={i18n}>
579
+ * ...
580
+ * </Chat>
581
+ * ```
582
+ *
583
+ * You can use the same function to add whole new language as well.
584
+ *
585
+ * ```
586
+ * const i18n = new Streami18n();
587
+ *
588
+ * i18n.registerTranslation('mr', {
589
+ * 'Nothing yet...': 'काहीही नाही ...',
590
+ * '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} आणि {{ secondUser }} टीपी करत आहेत ',
591
+ * });
592
+ *
593
+ * // Make sure to call setLanguage to reflect new language in UI.
594
+ * i18n.setLanguage('it');
595
+ * <Chat client={chatClient} i18nInstance={i18n}>
596
+ * ...
597
+ * </Chat>
598
+ * ```
599
+ *
600
+ * ## Datetime translations
601
+ *
602
+ * Stream react chat components uses [dayjs](https://day.js.org/en/) internally by default to format datetime stamp.
603
+ * e.g., in ChannelPreview, MessageContent components.
604
+ * Dayjs has locale support as well - https://day.js.org/docs/en/i18n/i18n
605
+ * Dayjs is a lightweight alternative to Momentjs with the same modern API.
606
+ *
607
+ * Dayjs provides locale config for plenty of languages, you can check the whole list of locale configs at following url
608
+ * https://github.com/iamkun/dayjs/tree/dev/src/locale
609
+ *
610
+ * You can either provide the dayjs locale config while registering
611
+ * language with Streami18n (either via constructor or registerTranslation()) or you can provide your own Dayjs or Moment instance
612
+ * to Streami18n constructor, which will be then used internally (using the language locale) in components.
613
+ *
614
+ * 1. Via language registration
615
+ *
616
+ * e.g.,
617
+ * ```
618
+ * const i18n = new Streami18n({
619
+ * language: 'nl',
620
+ * dayjsLocaleConfigForLanguage: {
621
+ * months: [...],
622
+ * monthsShort: [...],
623
+ * calendar: {
624
+ * sameDay: ...'
625
+ * }
626
+ * }
627
+ * });
628
+ * ```
629
+ *
630
+ * Similarly, you can add locale config for moment while registering translation via `registerTranslation` function.
631
+ *
632
+ * e.g.,
633
+ * ```
634
+ * const i18n = new Streami18n();
635
+ *
636
+ * i18n.registerTranslation(
637
+ * 'mr',
638
+ * {
639
+ * 'Nothing yet...': 'काहीही नाही ...',
640
+ * '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} आणि {{ secondUser }} टीपी करत आहेत ',
641
+ * },
642
+ * {
643
+ * months: [...],
644
+ * monthsShort: [...],
645
+ * calendar: {
646
+ * sameDay: ...'
647
+ * }
648
+ * }
649
+ * );
650
+ *```
651
+ * 2. Provide your own Moment object
652
+ *
653
+ * ```js
654
+ * import 'moment/locale/nl';
655
+ * import 'moment/locale/it';
656
+ * // or if you want to include all locales
657
+ * import 'moment/min/locales';
658
+ *
659
+ * import Moment from moment
660
+ *
661
+ * const i18n = new Streami18n({
662
+ * language: 'nl',
663
+ * DateTimeParser: Moment
664
+ * })
665
+ * ```
666
+ *
667
+ * 3. Provide your own Dayjs object
668
+ *
669
+ * ```js
670
+ * import Dayjs from 'dayjs'
671
+ *
672
+ * import 'dayjs/locale/nl';
673
+ * import 'dayjs/locale/it';
674
+ * // or if you want to include all locales
675
+ * import 'dayjs/min/locales';
676
+ *
677
+ * const i18n = new Streami18n({
678
+ * language: 'nl',
679
+ * DateTimeParser: Dayjs
680
+ * })
681
+ * ```
682
+ * If you would like to stick with english language for datetimes in Stream components, you can set `disableDateTimeTranslations` to true.
683
+ *
684
+ */
685
+ var defaultStreami18nOptions = {
686
+ DateTimeParser: Dayjs__default["default"],
687
+ dayjsLocaleConfigForLanguage: null,
688
+ debug: false,
689
+ disableDateTimeTranslations: false,
690
+ language: 'en',
691
+ logger: function (message) { return console.warn(message); },
692
+ };
693
+ var defaultTranslatorFunction = function (key) { return key; };
694
+ var Streami18n = /** @class */ (function () {
695
+ /**
696
+ * Constructor accepts following options:
697
+ * - language (String) default: 'en'
698
+ * Language code e.g., en, tr
699
+ *
700
+ * - translationsForLanguage (object)
701
+ * Translations object. Please check src/i18n/en.json for example.
702
+ *
703
+ * - disableDateTimeTranslations (boolean) default: false
704
+ * Disable translations for date-times
705
+ *
706
+ * - debug (boolean) default: false
707
+ * Enable debug mode in internal i18n class
708
+ *
709
+ * - logger (function) default: () => {}
710
+ * Logger function to log warnings/errors from this class
711
+ *
712
+ * - dayjsLocaleConfigForLanguage (object) default: 'enConfig'
713
+ * [Config object](https://momentjs.com/docs/#/i18n/changing-locale/) for internal moment object,
714
+ * corresponding to language (param)
715
+ *
716
+ * - DateTimeParser (function) Moment or Dayjs instance/function.
717
+ * Make sure to load all the required locales in this Moment or Dayjs instance that you will be provide to Streami18n
718
+ *
719
+ * @param {*} options
720
+ */
721
+ function Streami18n(options) {
722
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
723
+ if (options === void 0) { options = {}; }
724
+ var _this = this;
725
+ this.i18nInstance = i18n__default["default"].createInstance();
726
+ this.Dayjs = null;
727
+ this.setLanguageCallback = function () { return null; };
728
+ this.initialized = false;
729
+ this.t = defaultTranslatorFunction;
730
+ this.translations = {
731
+ de: (_a = {}, _a[defaultNS] = deTranslations, _a),
732
+ en: (_b = {}, _b[defaultNS] = enTranslations, _b),
733
+ es: (_c = {}, _c[defaultNS] = esTranslations, _c),
734
+ fr: (_d = {}, _d[defaultNS] = frTranslations, _d),
735
+ hi: (_e = {}, _e[defaultNS] = hiTranslations, _e),
736
+ it: (_f = {}, _f[defaultNS] = itTranslations, _f),
737
+ ja: (_g = {}, _g[defaultNS] = jaTranslations, _g),
738
+ ko: (_h = {}, _h[defaultNS] = koTranslations, _h),
739
+ nl: (_j = {}, _j[defaultNS] = nlTranslations, _j),
740
+ pt: (_k = {}, _k[defaultNS] = ptTranslations, _k),
741
+ ru: (_l = {}, _l[defaultNS] = ruTranslations, _l),
742
+ tr: (_m = {}, _m[defaultNS] = trTranslations, _m),
743
+ };
744
+ /**
745
+ * dayjs.defineLanguage('nl') also changes the global locale. We don't want to do that
746
+ * when user calls registerTranslation() function. So instead we will store the locale configs
747
+ * given to registerTranslation() function in `dayjsLocales` object, and register the required locale
748
+ * with moment, when setLanguage is called.
749
+ * */
750
+ this.dayjsLocales = {};
751
+ this.localeExists = function (language) {
752
+ if (_this.isCustomDateTimeParser)
753
+ return true;
754
+ return Object.keys(Dayjs__default["default"].Ls).indexOf(language) > -1;
755
+ };
756
+ this.validateCurrentLanguage = function () {
757
+ var availableLanguages = Object.keys(_this.translations);
758
+ if (availableLanguages.indexOf(_this.currentLanguage) === -1) {
759
+ _this.logger("Streami18n: '".concat(_this.currentLanguage, "' language is not registered.") +
760
+ " Please make sure to call streami18n.registerTranslation('".concat(_this.currentLanguage, "', {...}) or ") +
761
+ "use one the built-in supported languages - ".concat(_this.getAvailableLanguages()));
762
+ _this.currentLanguage = defaultLng;
763
+ }
764
+ };
765
+ /** Returns an instance of i18next used within this class instance */
766
+ this.geti18Instance = function () { return _this.i18nInstance; };
767
+ /** Returns list of available languages. */
768
+ this.getAvailableLanguages = function () { return Object.keys(_this.translations); };
769
+ /** Returns all the translation dictionary for all inbuilt-languages */
770
+ this.getTranslations = function () { return _this.translations; };
771
+ var finalOptions = exports.__assign(exports.__assign({}, defaultStreami18nOptions), options);
772
+ // Prepare the i18next configuration.
773
+ this.logger = finalOptions.logger;
774
+ this.currentLanguage = finalOptions.language;
775
+ this.DateTimeParser = finalOptions.DateTimeParser;
776
+ this.timezone = finalOptions.timezone;
777
+ try {
778
+ if (this.DateTimeParser && isDayJs(this.DateTimeParser)) {
779
+ this.DateTimeParser.extend(LocalizedFormat__default["default"]);
780
+ this.DateTimeParser.extend(calendar__default["default"]);
781
+ this.DateTimeParser.extend(localeData__default["default"]);
782
+ this.DateTimeParser.extend(relativeTime__default["default"]);
783
+ }
784
+ }
785
+ catch (error) {
786
+ throw Error("Streami18n: Looks like you wanted to provide Dayjs instance, but something went wrong while adding plugins ".concat(error));
787
+ }
788
+ this.isCustomDateTimeParser = !!options.DateTimeParser;
789
+ var translationsForLanguage = finalOptions.translationsForLanguage;
790
+ if (translationsForLanguage) {
791
+ this.translations[this.currentLanguage] = (_o = {},
792
+ _o[defaultNS] = this.translations[this.currentLanguage] &&
793
+ this.translations[this.currentLanguage][defaultNS]
794
+ ? exports.__assign(exports.__assign({}, this.translations[this.currentLanguage][defaultNS]), translationsForLanguage) : translationsForLanguage,
795
+ _o);
796
+ }
797
+ // If translations don't exist for given language, then set it as empty object.
798
+ if (!this.translations[this.currentLanguage]) {
799
+ this.translations[this.currentLanguage] = (_p = {},
800
+ _p[defaultNS] = {},
801
+ _p);
802
+ }
803
+ this.i18nextConfig = {
804
+ debug: finalOptions.debug,
805
+ fallbackLng: false,
806
+ interpolation: { escapeValue: false },
807
+ keySeparator: false,
808
+ lng: this.currentLanguage,
809
+ nsSeparator: false,
810
+ parseMissingKeyHandler: function (key) {
811
+ _this.logger("Streami18n: Missing translation for key: ".concat(key));
812
+ return key;
813
+ },
814
+ };
815
+ this.validateCurrentLanguage();
816
+ var dayjsLocaleConfigForLanguage = finalOptions.dayjsLocaleConfigForLanguage;
817
+ if (dayjsLocaleConfigForLanguage) {
818
+ this.addOrUpdateLocale(this.currentLanguage, exports.__assign({}, dayjsLocaleConfigForLanguage));
819
+ }
820
+ else if (!this.localeExists(this.currentLanguage)) {
821
+ this.logger("Streami18n: Streami18n(...) - Locale config for ".concat(this.currentLanguage, " does not exist in momentjs.") +
822
+ "Please import the locale file using \"import 'moment/locale/".concat(this.currentLanguage, "';\" in your app or ") +
823
+ "register the locale config with Streami18n using registerTranslation(language, translation, customDayjsLocale)");
824
+ }
825
+ this.tDateTimeParser = function (timestamp) {
826
+ var language = finalOptions.disableDateTimeTranslations || !_this.localeExists(_this.currentLanguage)
827
+ ? defaultLng
828
+ : _this.currentLanguage;
829
+ if (isDayJs(_this.DateTimeParser)) {
830
+ return supportsTz(_this.DateTimeParser)
831
+ ? _this.DateTimeParser(timestamp).tz(_this.timezone).locale(language)
832
+ : _this.DateTimeParser(timestamp).locale(language);
833
+ }
834
+ if (supportsTz(_this.DateTimeParser) && _this.timezone) {
835
+ return _this.DateTimeParser(timestamp).tz(_this.timezone).locale(language);
836
+ }
837
+ return _this.DateTimeParser(timestamp).locale(language);
838
+ };
839
+ }
840
+ /**
841
+ * Initializes the i18next instance with configuration (which enables natural language as default keys)
842
+ */
843
+ Streami18n.prototype.init = function () {
844
+ return __awaiter(this, void 0, void 0, function () {
845
+ var _a, error_1;
846
+ return __generator(this, function (_b) {
847
+ switch (_b.label) {
848
+ case 0:
849
+ this.validateCurrentLanguage();
850
+ _b.label = 1;
851
+ case 1:
852
+ _b.trys.push([1, 3, , 4]);
853
+ _a = this;
854
+ return [4 /*yield*/, this.i18nInstance.init(exports.__assign(exports.__assign({}, this.i18nextConfig), { lng: this.currentLanguage, resources: this.translations }))];
855
+ case 2:
856
+ _a.t = _b.sent();
857
+ this.initialized = true;
858
+ return [3 /*break*/, 4];
859
+ case 3:
860
+ error_1 = _b.sent();
861
+ this.logger("Something went wrong with init: ".concat(JSON.stringify(error_1)));
862
+ return [3 /*break*/, 4];
863
+ case 4: return [2 /*return*/, {
864
+ t: this.t,
865
+ tDateTimeParser: this.tDateTimeParser,
866
+ }];
867
+ }
868
+ });
869
+ });
870
+ };
871
+ /**
872
+ * Returns current version translator function.
873
+ */
874
+ Streami18n.prototype.getTranslators = function () {
875
+ return __awaiter(this, void 0, void 0, function () {
876
+ return __generator(this, function (_a) {
877
+ switch (_a.label) {
878
+ case 0:
879
+ if (!!this.initialized) return [3 /*break*/, 2];
880
+ if (this.dayjsLocales[this.currentLanguage]) {
881
+ this.addOrUpdateLocale(this.currentLanguage, this.dayjsLocales[this.currentLanguage]);
882
+ }
883
+ return [4 /*yield*/, this.init()];
884
+ case 1: return [2 /*return*/, _a.sent()];
885
+ case 2: return [2 /*return*/, {
886
+ t: this.t,
887
+ tDateTimeParser: this.tDateTimeParser,
888
+ }];
889
+ }
890
+ });
891
+ });
892
+ };
893
+ Streami18n.prototype.registerTranslation = function (language, translation, customDayjsLocale) {
894
+ var _a;
895
+ if (!translation) {
896
+ this.logger("Streami18n: registerTranslation(language, translation, customDayjsLocale) called without translation");
897
+ return;
898
+ }
899
+ if (!this.translations[language]) {
900
+ this.translations[language] = (_a = {}, _a[defaultNS] = translation, _a);
901
+ }
902
+ else {
903
+ this.translations[language][defaultNS] = translation;
904
+ }
905
+ if (customDayjsLocale) {
906
+ this.dayjsLocales[language] = exports.__assign({}, customDayjsLocale);
907
+ }
908
+ else if (!this.localeExists(language)) {
909
+ this.logger("Streami18n: registerTranslation(language, translation, customDayjsLocale) - " +
910
+ "Locale config for ".concat(language, " does not exist in Dayjs.") +
911
+ "Please import the locale file using \"import 'dayjs/locale/".concat(language, "';\" in your app or ") +
912
+ "register the locale config with Streami18n using registerTranslation(language, translation, customDayjsLocale)");
913
+ }
914
+ if (this.initialized) {
915
+ this.i18nInstance.addResources(language, defaultNS, translation);
916
+ }
917
+ };
918
+ Streami18n.prototype.addOrUpdateLocale = function (key, config) {
919
+ if (this.localeExists(key)) {
920
+ Dayjs__default["default"].updateLocale(key, exports.__assign({}, config));
921
+ }
922
+ else {
923
+ // Merging the custom locale config with en config, so missing keys can default to english.
924
+ Dayjs__default["default"].locale(exports.__assign(exports.__assign({ name: key }, en_locale), config), undefined, true);
925
+ }
926
+ };
927
+ Streami18n.prototype.setLanguage = function (language) {
928
+ return __awaiter(this, void 0, void 0, function () {
929
+ var t, error_2;
930
+ return __generator(this, function (_a) {
931
+ switch (_a.label) {
932
+ case 0:
933
+ this.currentLanguage = language;
934
+ if (!this.initialized)
935
+ return [2 /*return*/];
936
+ _a.label = 1;
937
+ case 1:
938
+ _a.trys.push([1, 3, , 4]);
939
+ return [4 /*yield*/, this.i18nInstance.changeLanguage(language)];
940
+ case 2:
941
+ t = _a.sent();
942
+ if (this.dayjsLocales[language]) {
943
+ this.addOrUpdateLocale(this.currentLanguage, this.dayjsLocales[this.currentLanguage]);
944
+ }
945
+ this.setLanguageCallback(t);
946
+ return [2 /*return*/, t];
947
+ case 3:
948
+ error_2 = _a.sent();
949
+ this.logger("Failed to set language: ".concat(JSON.stringify(error_2)));
950
+ return [2 /*return*/, this.t];
951
+ case 4: return [2 /*return*/];
952
+ }
953
+ });
954
+ });
955
+ };
956
+ Streami18n.prototype.registerSetLanguageCallback = function (callback) {
957
+ this.setLanguageCallback = callback;
958
+ };
959
+ return Streami18n;
960
+ }());
961
+
962
+ Dayjs__default["default"].extend(calendar__default["default"]);
963
+ Dayjs__default["default"].extend(LocalizedFormat__default["default"]);
964
+ var isLanguageSupported = function (language) {
965
+ var translations = ['de', 'en', 'es', 'fr', 'hi', 'it', 'ja', 'ko', 'nl', 'pt', 'ru', 'tr'];
966
+ return translations.some(function (translation) { return language === translation; });
967
+ };
968
+ var isDayOrMoment = function (output) {
969
+ return !!(output === null || output === void 0 ? void 0 : output.isSame);
970
+ };
971
+ var isDate = function (output) {
972
+ return !!(output === null || output === void 0 ? void 0 : output.getMonth);
973
+ };
974
+ var isNumberOrString = function (output) {
975
+ return typeof output === 'string' || typeof output === 'number';
976
+ };
977
+ var defaultDateTimeParser = function (input) { return Dayjs__default["default"](input); };
978
+ var TranslationContext = React__default["default"].createContext({
979
+ t: defaultTranslatorFunction,
980
+ tDateTimeParser: defaultDateTimeParser,
981
+ userLanguage: 'en',
982
+ });
983
+ var TranslationProvider = function (_a) {
984
+ var children = _a.children, value = _a.value;
985
+ return (React__default["default"].createElement(TranslationContext.Provider, { value: value }, children));
986
+ };
987
+ var useTranslationContext = function (componentName) {
988
+ var contextValue = React.useContext(TranslationContext);
989
+ if (!contextValue) {
990
+ console.warn("The useTranslationContext hook was called outside of the TranslationContext provider. Make sure this hook is called within a child of the Chat component. The errored call is located in the ".concat(componentName, " component."));
991
+ return {};
992
+ }
993
+ return contextValue;
994
+ };
995
+ var withTranslationContext = function (Component) {
996
+ var WithTranslationContextComponent = function (props) {
997
+ var translationContext = useTranslationContext();
998
+ return React__default["default"].createElement(Component, exports.__assign({}, props, translationContext));
999
+ };
1000
+ WithTranslationContextComponent.displayName = "WithTranslationContext".concat(getDisplayName(Component));
1001
+ return WithTranslationContextComponent;
1002
+ };
1003
+
1004
+ var TypingContext = React__default["default"].createContext(undefined);
1005
+ var TypingProvider = function (_a) {
1006
+ var children = _a.children, value = _a.value;
1007
+ return (React__default["default"].createElement(TypingContext.Provider, { value: value }, children));
1008
+ };
1009
+ var useTypingContext = function (componentName) {
1010
+ var contextValue = React.useContext(TypingContext);
1011
+ if (!contextValue) {
1012
+ console.warn("The useTypingContext hook was called outside of the TypingContext provider. Make sure this hook is called within a child of the Channel component. The errored call is located in the ".concat(componentName, " component."));
1013
+ return {};
1014
+ }
1015
+ return contextValue;
1016
+ };
1017
+ /**
1018
+ * Typescript currently does not support partial inference, so if TypingContext
1019
+ * typing is desired while using the HOC withTypingContext, the Props for the
1020
+ * wrapped component must be provided as the first generic.
1021
+ */
1022
+ var withTypingContext = function (Component) {
1023
+ var WithTypingContextComponent = function (props) {
1024
+ var typingContext = useTypingContext();
1025
+ return React__default["default"].createElement(Component, exports.__assign({}, props, typingContext));
1026
+ };
1027
+ WithTypingContextComponent.displayName = (Component.displayName ||
1028
+ Component.name ||
1029
+ 'Component').replace('Base', '');
1030
+ return WithTypingContextComponent;
1031
+ };
1032
+
1033
+ let urlAlphabet =
1034
+ 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
1035
+
1036
+ const POOL_SIZE_MULTIPLIER = 128;
1037
+ let pool, poolOffset;
1038
+ let fillPool = bytes => {
1039
+ if (!pool || pool.length < bytes) {
1040
+ pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
1041
+ crypto__default["default"].randomFillSync(pool);
1042
+ poolOffset = 0;
1043
+ } else if (poolOffset + bytes > pool.length) {
1044
+ crypto__default["default"].randomFillSync(pool);
1045
+ poolOffset = 0;
1046
+ }
1047
+ poolOffset += bytes;
1048
+ };
1049
+ let nanoid = (size = 21) => {
1050
+ fillPool((size -= 0));
1051
+ let id = '';
1052
+ for (let i = poolOffset - size; i < poolOffset; i++) {
1053
+ id += urlAlphabet[pool[i] & 63];
1054
+ }
1055
+ return id
1056
+ };
1057
+
1058
+ React__namespace.createContext();
1059
+ React__namespace.createContext();
1060
+
1061
+ /**
1062
+ * Simple ponyfill for Object.fromEntries
1063
+ */
1064
+
1065
+ var fromEntries = function fromEntries(entries) {
1066
+ return entries.reduce(function (acc, _ref) {
1067
+ var key = _ref[0],
1068
+ value = _ref[1];
1069
+ acc[key] = value;
1070
+ return acc;
1071
+ }, {});
1072
+ };
1073
+ /**
1074
+ * Small wrapper around `useLayoutEffect` to get rid of the warning on SSR envs
1075
+ */
1076
+
1077
+ var useIsomorphicLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? React__namespace.useLayoutEffect : React__namespace.useEffect;
1078
+
1079
+ var top = 'top';
1080
+ var bottom = 'bottom';
1081
+ var right = 'right';
1082
+ var left = 'left';
1083
+ var auto = 'auto';
1084
+ var basePlacements = [top, bottom, right, left];
1085
+ var start = 'start';
1086
+ var end = 'end';
1087
+ var clippingParents = 'clippingParents';
1088
+ var viewport = 'viewport';
1089
+ var popper = 'popper';
1090
+ var reference = 'reference';
1091
+ var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
1092
+ return acc.concat([placement + "-" + start, placement + "-" + end]);
1093
+ }, []);
1094
+ var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
1095
+ return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
1096
+ }, []); // modifiers that need to read the DOM
1097
+
1098
+ var beforeRead = 'beforeRead';
1099
+ var read = 'read';
1100
+ var afterRead = 'afterRead'; // pure-logic modifiers
1101
+
1102
+ var beforeMain = 'beforeMain';
1103
+ var main = 'main';
1104
+ var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
1105
+
1106
+ var beforeWrite = 'beforeWrite';
1107
+ var write = 'write';
1108
+ var afterWrite = 'afterWrite';
1109
+ var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
1110
+
1111
+ function getNodeName(element) {
1112
+ return element ? (element.nodeName || '').toLowerCase() : null;
1113
+ }
1114
+
1115
+ function getWindow(node) {
1116
+ if (node == null) {
1117
+ return window;
1118
+ }
1119
+
1120
+ if (node.toString() !== '[object Window]') {
1121
+ var ownerDocument = node.ownerDocument;
1122
+ return ownerDocument ? ownerDocument.defaultView || window : window;
1123
+ }
1124
+
1125
+ return node;
1126
+ }
1127
+
1128
+ function isElement(node) {
1129
+ var OwnElement = getWindow(node).Element;
1130
+ return node instanceof OwnElement || node instanceof Element;
1131
+ }
1132
+
1133
+ function isHTMLElement(node) {
1134
+ var OwnElement = getWindow(node).HTMLElement;
1135
+ return node instanceof OwnElement || node instanceof HTMLElement;
1136
+ }
1137
+
1138
+ function isShadowRoot(node) {
1139
+ // IE 11 has no ShadowRoot
1140
+ if (typeof ShadowRoot === 'undefined') {
1141
+ return false;
1142
+ }
1143
+
1144
+ var OwnElement = getWindow(node).ShadowRoot;
1145
+ return node instanceof OwnElement || node instanceof ShadowRoot;
1146
+ }
1147
+
1148
+ // and applies them to the HTMLElements such as popper and arrow
1149
+
1150
+ function applyStyles(_ref) {
1151
+ var state = _ref.state;
1152
+ Object.keys(state.elements).forEach(function (name) {
1153
+ var style = state.styles[name] || {};
1154
+ var attributes = state.attributes[name] || {};
1155
+ var element = state.elements[name]; // arrow is optional + virtual elements
1156
+
1157
+ if (!isHTMLElement(element) || !getNodeName(element)) {
1158
+ return;
1159
+ } // Flow doesn't support to extend this property, but it's the most
1160
+ // effective way to apply styles to an HTMLElement
1161
+ // $FlowFixMe[cannot-write]
1162
+
1163
+
1164
+ Object.assign(element.style, style);
1165
+ Object.keys(attributes).forEach(function (name) {
1166
+ var value = attributes[name];
1167
+
1168
+ if (value === false) {
1169
+ element.removeAttribute(name);
1170
+ } else {
1171
+ element.setAttribute(name, value === true ? '' : value);
1172
+ }
1173
+ });
1174
+ });
1175
+ }
1176
+
1177
+ function effect$2(_ref2) {
1178
+ var state = _ref2.state;
1179
+ var initialStyles = {
1180
+ popper: {
1181
+ position: state.options.strategy,
1182
+ left: '0',
1183
+ top: '0',
1184
+ margin: '0'
1185
+ },
1186
+ arrow: {
1187
+ position: 'absolute'
1188
+ },
1189
+ reference: {}
1190
+ };
1191
+ Object.assign(state.elements.popper.style, initialStyles.popper);
1192
+ state.styles = initialStyles;
1193
+
1194
+ if (state.elements.arrow) {
1195
+ Object.assign(state.elements.arrow.style, initialStyles.arrow);
1196
+ }
1197
+
1198
+ return function () {
1199
+ Object.keys(state.elements).forEach(function (name) {
1200
+ var element = state.elements[name];
1201
+ var attributes = state.attributes[name] || {};
1202
+ var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
1203
+
1204
+ var style = styleProperties.reduce(function (style, property) {
1205
+ style[property] = '';
1206
+ return style;
1207
+ }, {}); // arrow is optional + virtual elements
1208
+
1209
+ if (!isHTMLElement(element) || !getNodeName(element)) {
1210
+ return;
1211
+ }
1212
+
1213
+ Object.assign(element.style, style);
1214
+ Object.keys(attributes).forEach(function (attribute) {
1215
+ element.removeAttribute(attribute);
1216
+ });
1217
+ });
1218
+ };
1219
+ } // eslint-disable-next-line import/no-unused-modules
1220
+
1221
+
1222
+ var applyStyles$1 = {
1223
+ name: 'applyStyles',
1224
+ enabled: true,
1225
+ phase: 'write',
1226
+ fn: applyStyles,
1227
+ effect: effect$2,
1228
+ requires: ['computeStyles']
1229
+ };
1230
+
1231
+ function getBasePlacement(placement) {
1232
+ return placement.split('-')[0];
1233
+ }
1234
+
1235
+ var max = Math.max;
1236
+ var min = Math.min;
1237
+ var round = Math.round;
1238
+
1239
+ function getBoundingClientRect(element, includeScale) {
1240
+ if (includeScale === void 0) {
1241
+ includeScale = false;
1242
+ }
1243
+
1244
+ var rect = element.getBoundingClientRect();
1245
+ var scaleX = 1;
1246
+ var scaleY = 1;
1247
+
1248
+ if (isHTMLElement(element) && includeScale) {
1249
+ var offsetHeight = element.offsetHeight;
1250
+ var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
1251
+ // Fallback to 1 in case both values are `0`
1252
+
1253
+ if (offsetWidth > 0) {
1254
+ scaleX = round(rect.width) / offsetWidth || 1;
1255
+ }
1256
+
1257
+ if (offsetHeight > 0) {
1258
+ scaleY = round(rect.height) / offsetHeight || 1;
1259
+ }
1260
+ }
1261
+
1262
+ return {
1263
+ width: rect.width / scaleX,
1264
+ height: rect.height / scaleY,
1265
+ top: rect.top / scaleY,
1266
+ right: rect.right / scaleX,
1267
+ bottom: rect.bottom / scaleY,
1268
+ left: rect.left / scaleX,
1269
+ x: rect.left / scaleX,
1270
+ y: rect.top / scaleY
1271
+ };
1272
+ }
1273
+
1274
+ // means it doesn't take into account transforms.
1275
+
1276
+ function getLayoutRect(element) {
1277
+ var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
1278
+ // Fixes https://github.com/popperjs/popper-core/issues/1223
1279
+
1280
+ var width = element.offsetWidth;
1281
+ var height = element.offsetHeight;
1282
+
1283
+ if (Math.abs(clientRect.width - width) <= 1) {
1284
+ width = clientRect.width;
1285
+ }
1286
+
1287
+ if (Math.abs(clientRect.height - height) <= 1) {
1288
+ height = clientRect.height;
1289
+ }
1290
+
1291
+ return {
1292
+ x: element.offsetLeft,
1293
+ y: element.offsetTop,
1294
+ width: width,
1295
+ height: height
1296
+ };
1297
+ }
1298
+
1299
+ function contains(parent, child) {
1300
+ var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
1301
+
1302
+ if (parent.contains(child)) {
1303
+ return true;
1304
+ } // then fallback to custom implementation with Shadow DOM support
1305
+ else if (rootNode && isShadowRoot(rootNode)) {
1306
+ var next = child;
1307
+
1308
+ do {
1309
+ if (next && parent.isSameNode(next)) {
1310
+ return true;
1311
+ } // $FlowFixMe[prop-missing]: need a better way to handle this...
1312
+
1313
+
1314
+ next = next.parentNode || next.host;
1315
+ } while (next);
1316
+ } // Give up, the result is false
1317
+
1318
+
1319
+ return false;
1320
+ }
1321
+
1322
+ function getComputedStyle(element) {
1323
+ return getWindow(element).getComputedStyle(element);
1324
+ }
1325
+
1326
+ function isTableElement(element) {
1327
+ return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
1328
+ }
1329
+
1330
+ function getDocumentElement(element) {
1331
+ // $FlowFixMe[incompatible-return]: assume body is always available
1332
+ return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
1333
+ element.document) || window.document).documentElement;
1334
+ }
1335
+
1336
+ function getParentNode(element) {
1337
+ if (getNodeName(element) === 'html') {
1338
+ return element;
1339
+ }
1340
+
1341
+ return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
1342
+ // $FlowFixMe[incompatible-return]
1343
+ // $FlowFixMe[prop-missing]
1344
+ element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
1345
+ element.parentNode || ( // DOM Element detected
1346
+ isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
1347
+ // $FlowFixMe[incompatible-call]: HTMLElement is a Node
1348
+ getDocumentElement(element) // fallback
1349
+
1350
+ );
1351
+ }
1352
+
1353
+ function getTrueOffsetParent(element) {
1354
+ if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
1355
+ getComputedStyle(element).position === 'fixed') {
1356
+ return null;
1357
+ }
1358
+
1359
+ return element.offsetParent;
1360
+ } // `.offsetParent` reports `null` for fixed elements, while absolute elements
1361
+ // return the containing block
1362
+
1363
+
1364
+ function getContainingBlock(element) {
1365
+ var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
1366
+ var isIE = navigator.userAgent.indexOf('Trident') !== -1;
1367
+
1368
+ if (isIE && isHTMLElement(element)) {
1369
+ // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
1370
+ var elementCss = getComputedStyle(element);
1371
+
1372
+ if (elementCss.position === 'fixed') {
1373
+ return null;
1374
+ }
1375
+ }
1376
+
1377
+ var currentNode = getParentNode(element);
1378
+
1379
+ if (isShadowRoot(currentNode)) {
1380
+ currentNode = currentNode.host;
1381
+ }
1382
+
1383
+ while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
1384
+ var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
1385
+ // create a containing block.
1386
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1387
+
1388
+ if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
1389
+ return currentNode;
1390
+ } else {
1391
+ currentNode = currentNode.parentNode;
1392
+ }
1393
+ }
1394
+
1395
+ return null;
1396
+ } // Gets the closest ancestor positioned element. Handles some edge cases,
1397
+ // such as table ancestors and cross browser bugs.
1398
+
1399
+
1400
+ function getOffsetParent(element) {
1401
+ var window = getWindow(element);
1402
+ var offsetParent = getTrueOffsetParent(element);
1403
+
1404
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
1405
+ offsetParent = getTrueOffsetParent(offsetParent);
1406
+ }
1407
+
1408
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
1409
+ return window;
1410
+ }
1411
+
1412
+ return offsetParent || getContainingBlock(element) || window;
1413
+ }
1414
+
1415
+ function getMainAxisFromPlacement(placement) {
1416
+ return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
1417
+ }
1418
+
1419
+ function within(min$1, value, max$1) {
1420
+ return max(min$1, min(value, max$1));
1421
+ }
1422
+ function withinMaxClamp(min, value, max) {
1423
+ var v = within(min, value, max);
1424
+ return v > max ? max : v;
1425
+ }
1426
+
1427
+ function getFreshSideObject() {
1428
+ return {
1429
+ top: 0,
1430
+ right: 0,
1431
+ bottom: 0,
1432
+ left: 0
1433
+ };
1434
+ }
1435
+
1436
+ function mergePaddingObject(paddingObject) {
1437
+ return Object.assign({}, getFreshSideObject(), paddingObject);
1438
+ }
1439
+
1440
+ function expandToHashMap(value, keys) {
1441
+ return keys.reduce(function (hashMap, key) {
1442
+ hashMap[key] = value;
1443
+ return hashMap;
1444
+ }, {});
1445
+ }
1446
+
1447
+ var toPaddingObject = function toPaddingObject(padding, state) {
1448
+ padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
1449
+ placement: state.placement
1450
+ })) : padding;
1451
+ return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
1452
+ };
1453
+
1454
+ function arrow(_ref) {
1455
+ var _state$modifiersData$;
1456
+
1457
+ var state = _ref.state,
1458
+ name = _ref.name,
1459
+ options = _ref.options;
1460
+ var arrowElement = state.elements.arrow;
1461
+ var popperOffsets = state.modifiersData.popperOffsets;
1462
+ var basePlacement = getBasePlacement(state.placement);
1463
+ var axis = getMainAxisFromPlacement(basePlacement);
1464
+ var isVertical = [left, right].indexOf(basePlacement) >= 0;
1465
+ var len = isVertical ? 'height' : 'width';
1466
+
1467
+ if (!arrowElement || !popperOffsets) {
1468
+ return;
1469
+ }
1470
+
1471
+ var paddingObject = toPaddingObject(options.padding, state);
1472
+ var arrowRect = getLayoutRect(arrowElement);
1473
+ var minProp = axis === 'y' ? top : left;
1474
+ var maxProp = axis === 'y' ? bottom : right;
1475
+ var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
1476
+ var startDiff = popperOffsets[axis] - state.rects.reference[axis];
1477
+ var arrowOffsetParent = getOffsetParent(arrowElement);
1478
+ var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
1479
+ var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
1480
+ // outside of the popper bounds
1481
+
1482
+ var min = paddingObject[minProp];
1483
+ var max = clientSize - arrowRect[len] - paddingObject[maxProp];
1484
+ var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
1485
+ var offset = within(min, center, max); // Prevents breaking syntax highlighting...
1486
+
1487
+ var axisProp = axis;
1488
+ state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
1489
+ }
1490
+
1491
+ function effect$1(_ref2) {
1492
+ var state = _ref2.state,
1493
+ options = _ref2.options;
1494
+ var _options$element = options.element,
1495
+ arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
1496
+
1497
+ if (arrowElement == null) {
1498
+ return;
1499
+ } // CSS selector
1500
+
1501
+
1502
+ if (typeof arrowElement === 'string') {
1503
+ arrowElement = state.elements.popper.querySelector(arrowElement);
1504
+
1505
+ if (!arrowElement) {
1506
+ return;
1507
+ }
1508
+ }
1509
+
1510
+ if (!contains(state.elements.popper, arrowElement)) {
1511
+
1512
+ return;
1513
+ }
1514
+
1515
+ state.elements.arrow = arrowElement;
1516
+ } // eslint-disable-next-line import/no-unused-modules
1517
+
1518
+
1519
+ var arrow$1 = {
1520
+ name: 'arrow',
1521
+ enabled: true,
1522
+ phase: 'main',
1523
+ fn: arrow,
1524
+ effect: effect$1,
1525
+ requires: ['popperOffsets'],
1526
+ requiresIfExists: ['preventOverflow']
1527
+ };
1528
+
1529
+ function getVariation(placement) {
1530
+ return placement.split('-')[1];
1531
+ }
1532
+
1533
+ var unsetSides = {
1534
+ top: 'auto',
1535
+ right: 'auto',
1536
+ bottom: 'auto',
1537
+ left: 'auto'
1538
+ }; // Round the offsets to the nearest suitable subpixel based on the DPR.
1539
+ // Zooming can change the DPR, but it seems to report a value that will
1540
+ // cleanly divide the values into the appropriate subpixels.
1541
+
1542
+ function roundOffsetsByDPR(_ref) {
1543
+ var x = _ref.x,
1544
+ y = _ref.y;
1545
+ var win = window;
1546
+ var dpr = win.devicePixelRatio || 1;
1547
+ return {
1548
+ x: round(x * dpr) / dpr || 0,
1549
+ y: round(y * dpr) / dpr || 0
1550
+ };
1551
+ }
1552
+
1553
+ function mapToStyles(_ref2) {
1554
+ var _Object$assign2;
1555
+
1556
+ var popper = _ref2.popper,
1557
+ popperRect = _ref2.popperRect,
1558
+ placement = _ref2.placement,
1559
+ variation = _ref2.variation,
1560
+ offsets = _ref2.offsets,
1561
+ position = _ref2.position,
1562
+ gpuAcceleration = _ref2.gpuAcceleration,
1563
+ adaptive = _ref2.adaptive,
1564
+ roundOffsets = _ref2.roundOffsets,
1565
+ isFixed = _ref2.isFixed;
1566
+ var _offsets$x = offsets.x,
1567
+ x = _offsets$x === void 0 ? 0 : _offsets$x,
1568
+ _offsets$y = offsets.y,
1569
+ y = _offsets$y === void 0 ? 0 : _offsets$y;
1570
+
1571
+ var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
1572
+ x: x,
1573
+ y: y
1574
+ }) : {
1575
+ x: x,
1576
+ y: y
1577
+ };
1578
+
1579
+ x = _ref3.x;
1580
+ y = _ref3.y;
1581
+ var hasX = offsets.hasOwnProperty('x');
1582
+ var hasY = offsets.hasOwnProperty('y');
1583
+ var sideX = left;
1584
+ var sideY = top;
1585
+ var win = window;
1586
+
1587
+ if (adaptive) {
1588
+ var offsetParent = getOffsetParent(popper);
1589
+ var heightProp = 'clientHeight';
1590
+ var widthProp = 'clientWidth';
1591
+
1592
+ if (offsetParent === getWindow(popper)) {
1593
+ offsetParent = getDocumentElement(popper);
1594
+
1595
+ if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
1596
+ heightProp = 'scrollHeight';
1597
+ widthProp = 'scrollWidth';
1598
+ }
1599
+ } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
1600
+
1601
+
1602
+ offsetParent = offsetParent;
1603
+
1604
+ if (placement === top || (placement === left || placement === right) && variation === end) {
1605
+ sideY = bottom;
1606
+ var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
1607
+ offsetParent[heightProp];
1608
+ y -= offsetY - popperRect.height;
1609
+ y *= gpuAcceleration ? 1 : -1;
1610
+ }
1611
+
1612
+ if (placement === left || (placement === top || placement === bottom) && variation === end) {
1613
+ sideX = right;
1614
+ var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
1615
+ offsetParent[widthProp];
1616
+ x -= offsetX - popperRect.width;
1617
+ x *= gpuAcceleration ? 1 : -1;
1618
+ }
1619
+ }
1620
+
1621
+ var commonStyles = Object.assign({
1622
+ position: position
1623
+ }, adaptive && unsetSides);
1624
+
1625
+ var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
1626
+ x: x,
1627
+ y: y
1628
+ }) : {
1629
+ x: x,
1630
+ y: y
1631
+ };
1632
+
1633
+ x = _ref4.x;
1634
+ y = _ref4.y;
1635
+
1636
+ if (gpuAcceleration) {
1637
+ var _Object$assign;
1638
+
1639
+ return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
1640
+ }
1641
+
1642
+ return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
1643
+ }
1644
+
1645
+ function computeStyles(_ref5) {
1646
+ var state = _ref5.state,
1647
+ options = _ref5.options;
1648
+ var _options$gpuAccelerat = options.gpuAcceleration,
1649
+ gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
1650
+ _options$adaptive = options.adaptive,
1651
+ adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
1652
+ _options$roundOffsets = options.roundOffsets,
1653
+ roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
1654
+
1655
+ var commonStyles = {
1656
+ placement: getBasePlacement(state.placement),
1657
+ variation: getVariation(state.placement),
1658
+ popper: state.elements.popper,
1659
+ popperRect: state.rects.popper,
1660
+ gpuAcceleration: gpuAcceleration,
1661
+ isFixed: state.options.strategy === 'fixed'
1662
+ };
1663
+
1664
+ if (state.modifiersData.popperOffsets != null) {
1665
+ state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
1666
+ offsets: state.modifiersData.popperOffsets,
1667
+ position: state.options.strategy,
1668
+ adaptive: adaptive,
1669
+ roundOffsets: roundOffsets
1670
+ })));
1671
+ }
1672
+
1673
+ if (state.modifiersData.arrow != null) {
1674
+ state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
1675
+ offsets: state.modifiersData.arrow,
1676
+ position: 'absolute',
1677
+ adaptive: false,
1678
+ roundOffsets: roundOffsets
1679
+ })));
1680
+ }
1681
+
1682
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
1683
+ 'data-popper-placement': state.placement
1684
+ });
1685
+ } // eslint-disable-next-line import/no-unused-modules
1686
+
1687
+
1688
+ var computeStyles$1 = {
1689
+ name: 'computeStyles',
1690
+ enabled: true,
1691
+ phase: 'beforeWrite',
1692
+ fn: computeStyles,
1693
+ data: {}
1694
+ };
1695
+
1696
+ var passive = {
1697
+ passive: true
1698
+ };
1699
+
1700
+ function effect(_ref) {
1701
+ var state = _ref.state,
1702
+ instance = _ref.instance,
1703
+ options = _ref.options;
1704
+ var _options$scroll = options.scroll,
1705
+ scroll = _options$scroll === void 0 ? true : _options$scroll,
1706
+ _options$resize = options.resize,
1707
+ resize = _options$resize === void 0 ? true : _options$resize;
1708
+ var window = getWindow(state.elements.popper);
1709
+ var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
1710
+
1711
+ if (scroll) {
1712
+ scrollParents.forEach(function (scrollParent) {
1713
+ scrollParent.addEventListener('scroll', instance.update, passive);
1714
+ });
1715
+ }
1716
+
1717
+ if (resize) {
1718
+ window.addEventListener('resize', instance.update, passive);
1719
+ }
1720
+
1721
+ return function () {
1722
+ if (scroll) {
1723
+ scrollParents.forEach(function (scrollParent) {
1724
+ scrollParent.removeEventListener('scroll', instance.update, passive);
1725
+ });
1726
+ }
1727
+
1728
+ if (resize) {
1729
+ window.removeEventListener('resize', instance.update, passive);
1730
+ }
1731
+ };
1732
+ } // eslint-disable-next-line import/no-unused-modules
1733
+
1734
+
1735
+ var eventListeners = {
1736
+ name: 'eventListeners',
1737
+ enabled: true,
1738
+ phase: 'write',
1739
+ fn: function fn() {},
1740
+ effect: effect,
1741
+ data: {}
1742
+ };
1743
+
1744
+ var hash$1 = {
1745
+ left: 'right',
1746
+ right: 'left',
1747
+ bottom: 'top',
1748
+ top: 'bottom'
1749
+ };
1750
+ function getOppositePlacement(placement) {
1751
+ return placement.replace(/left|right|bottom|top/g, function (matched) {
1752
+ return hash$1[matched];
1753
+ });
1754
+ }
1755
+
1756
+ var hash = {
1757
+ start: 'end',
1758
+ end: 'start'
1759
+ };
1760
+ function getOppositeVariationPlacement(placement) {
1761
+ return placement.replace(/start|end/g, function (matched) {
1762
+ return hash[matched];
1763
+ });
1764
+ }
1765
+
1766
+ function getWindowScroll(node) {
1767
+ var win = getWindow(node);
1768
+ var scrollLeft = win.pageXOffset;
1769
+ var scrollTop = win.pageYOffset;
1770
+ return {
1771
+ scrollLeft: scrollLeft,
1772
+ scrollTop: scrollTop
1773
+ };
1774
+ }
1775
+
1776
+ function getWindowScrollBarX(element) {
1777
+ // If <html> has a CSS width greater than the viewport, then this will be
1778
+ // incorrect for RTL.
1779
+ // Popper 1 is broken in this case and never had a bug report so let's assume
1780
+ // it's not an issue. I don't think anyone ever specifies width on <html>
1781
+ // anyway.
1782
+ // Browsers where the left scrollbar doesn't cause an issue report `0` for
1783
+ // this (e.g. Edge 2019, IE11, Safari)
1784
+ return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
1785
+ }
1786
+
1787
+ function getViewportRect(element) {
1788
+ var win = getWindow(element);
1789
+ var html = getDocumentElement(element);
1790
+ var visualViewport = win.visualViewport;
1791
+ var width = html.clientWidth;
1792
+ var height = html.clientHeight;
1793
+ var x = 0;
1794
+ var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
1795
+ // can be obscured underneath it.
1796
+ // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
1797
+ // if it isn't open, so if this isn't available, the popper will be detected
1798
+ // to overflow the bottom of the screen too early.
1799
+
1800
+ if (visualViewport) {
1801
+ width = visualViewport.width;
1802
+ height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
1803
+ // In Chrome, it returns a value very close to 0 (+/-) but contains rounding
1804
+ // errors due to floating point numbers, so we need to check precision.
1805
+ // Safari returns a number <= 0, usually < -1 when pinch-zoomed
1806
+ // Feature detection fails in mobile emulation mode in Chrome.
1807
+ // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
1808
+ // 0.001
1809
+ // Fallback here: "Not Safari" userAgent
1810
+
1811
+ if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
1812
+ x = visualViewport.offsetLeft;
1813
+ y = visualViewport.offsetTop;
1814
+ }
1815
+ }
1816
+
1817
+ return {
1818
+ width: width,
1819
+ height: height,
1820
+ x: x + getWindowScrollBarX(element),
1821
+ y: y
1822
+ };
1823
+ }
1824
+
1825
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable
1826
+
1827
+ function getDocumentRect(element) {
1828
+ var _element$ownerDocumen;
1829
+
1830
+ var html = getDocumentElement(element);
1831
+ var winScroll = getWindowScroll(element);
1832
+ var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
1833
+ var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
1834
+ var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
1835
+ var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
1836
+ var y = -winScroll.scrollTop;
1837
+
1838
+ if (getComputedStyle(body || html).direction === 'rtl') {
1839
+ x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
1840
+ }
1841
+
1842
+ return {
1843
+ width: width,
1844
+ height: height,
1845
+ x: x,
1846
+ y: y
1847
+ };
1848
+ }
1849
+
1850
+ function isScrollParent(element) {
1851
+ // Firefox wants us to check `-x` and `-y` variations as well
1852
+ var _getComputedStyle = getComputedStyle(element),
1853
+ overflow = _getComputedStyle.overflow,
1854
+ overflowX = _getComputedStyle.overflowX,
1855
+ overflowY = _getComputedStyle.overflowY;
1856
+
1857
+ return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
1858
+ }
1859
+
1860
+ function getScrollParent(node) {
1861
+ if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
1862
+ // $FlowFixMe[incompatible-return]: assume body is always available
1863
+ return node.ownerDocument.body;
1864
+ }
1865
+
1866
+ if (isHTMLElement(node) && isScrollParent(node)) {
1867
+ return node;
1868
+ }
1869
+
1870
+ return getScrollParent(getParentNode(node));
1871
+ }
1872
+
1873
+ /*
1874
+ given a DOM element, return the list of all scroll parents, up the list of ancesors
1875
+ until we get to the top window object. This list is what we attach scroll listeners
1876
+ to, because if any of these parent elements scroll, we'll need to re-calculate the
1877
+ reference element's position.
1878
+ */
1879
+
1880
+ function listScrollParents(element, list) {
1881
+ var _element$ownerDocumen;
1882
+
1883
+ if (list === void 0) {
1884
+ list = [];
1885
+ }
1886
+
1887
+ var scrollParent = getScrollParent(element);
1888
+ var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
1889
+ var win = getWindow(scrollParent);
1890
+ var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
1891
+ var updatedList = list.concat(target);
1892
+ return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
1893
+ updatedList.concat(listScrollParents(getParentNode(target)));
1894
+ }
1895
+
1896
+ function rectToClientRect(rect) {
1897
+ return Object.assign({}, rect, {
1898
+ left: rect.x,
1899
+ top: rect.y,
1900
+ right: rect.x + rect.width,
1901
+ bottom: rect.y + rect.height
1902
+ });
1903
+ }
1904
+
1905
+ function getInnerBoundingClientRect(element) {
1906
+ var rect = getBoundingClientRect(element);
1907
+ rect.top = rect.top + element.clientTop;
1908
+ rect.left = rect.left + element.clientLeft;
1909
+ rect.bottom = rect.top + element.clientHeight;
1910
+ rect.right = rect.left + element.clientWidth;
1911
+ rect.width = element.clientWidth;
1912
+ rect.height = element.clientHeight;
1913
+ rect.x = rect.left;
1914
+ rect.y = rect.top;
1915
+ return rect;
1916
+ }
1917
+
1918
+ function getClientRectFromMixedType(element, clippingParent) {
1919
+ return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
1920
+ } // A "clipping parent" is an overflowable container with the characteristic of
1921
+ // clipping (or hiding) overflowing elements with a position different from
1922
+ // `initial`
1923
+
1924
+
1925
+ function getClippingParents(element) {
1926
+ var clippingParents = listScrollParents(getParentNode(element));
1927
+ var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
1928
+ var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
1929
+
1930
+ if (!isElement(clipperElement)) {
1931
+ return [];
1932
+ } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
1933
+
1934
+
1935
+ return clippingParents.filter(function (clippingParent) {
1936
+ return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
1937
+ });
1938
+ } // Gets the maximum area that the element is visible in due to any number of
1939
+ // clipping parents
1940
+
1941
+
1942
+ function getClippingRect(element, boundary, rootBoundary) {
1943
+ var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
1944
+ var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
1945
+ var firstClippingParent = clippingParents[0];
1946
+ var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
1947
+ var rect = getClientRectFromMixedType(element, clippingParent);
1948
+ accRect.top = max(rect.top, accRect.top);
1949
+ accRect.right = min(rect.right, accRect.right);
1950
+ accRect.bottom = min(rect.bottom, accRect.bottom);
1951
+ accRect.left = max(rect.left, accRect.left);
1952
+ return accRect;
1953
+ }, getClientRectFromMixedType(element, firstClippingParent));
1954
+ clippingRect.width = clippingRect.right - clippingRect.left;
1955
+ clippingRect.height = clippingRect.bottom - clippingRect.top;
1956
+ clippingRect.x = clippingRect.left;
1957
+ clippingRect.y = clippingRect.top;
1958
+ return clippingRect;
1959
+ }
1960
+
1961
+ function computeOffsets(_ref) {
1962
+ var reference = _ref.reference,
1963
+ element = _ref.element,
1964
+ placement = _ref.placement;
1965
+ var basePlacement = placement ? getBasePlacement(placement) : null;
1966
+ var variation = placement ? getVariation(placement) : null;
1967
+ var commonX = reference.x + reference.width / 2 - element.width / 2;
1968
+ var commonY = reference.y + reference.height / 2 - element.height / 2;
1969
+ var offsets;
1970
+
1971
+ switch (basePlacement) {
1972
+ case top:
1973
+ offsets = {
1974
+ x: commonX,
1975
+ y: reference.y - element.height
1976
+ };
1977
+ break;
1978
+
1979
+ case bottom:
1980
+ offsets = {
1981
+ x: commonX,
1982
+ y: reference.y + reference.height
1983
+ };
1984
+ break;
1985
+
1986
+ case right:
1987
+ offsets = {
1988
+ x: reference.x + reference.width,
1989
+ y: commonY
1990
+ };
1991
+ break;
1992
+
1993
+ case left:
1994
+ offsets = {
1995
+ x: reference.x - element.width,
1996
+ y: commonY
1997
+ };
1998
+ break;
1999
+
2000
+ default:
2001
+ offsets = {
2002
+ x: reference.x,
2003
+ y: reference.y
2004
+ };
2005
+ }
2006
+
2007
+ var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
2008
+
2009
+ if (mainAxis != null) {
2010
+ var len = mainAxis === 'y' ? 'height' : 'width';
2011
+
2012
+ switch (variation) {
2013
+ case start:
2014
+ offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
2015
+ break;
2016
+
2017
+ case end:
2018
+ offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
2019
+ break;
2020
+ }
2021
+ }
2022
+
2023
+ return offsets;
2024
+ }
2025
+
2026
+ function detectOverflow(state, options) {
2027
+ if (options === void 0) {
2028
+ options = {};
2029
+ }
2030
+
2031
+ var _options = options,
2032
+ _options$placement = _options.placement,
2033
+ placement = _options$placement === void 0 ? state.placement : _options$placement,
2034
+ _options$boundary = _options.boundary,
2035
+ boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
2036
+ _options$rootBoundary = _options.rootBoundary,
2037
+ rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
2038
+ _options$elementConte = _options.elementContext,
2039
+ elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
2040
+ _options$altBoundary = _options.altBoundary,
2041
+ altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
2042
+ _options$padding = _options.padding,
2043
+ padding = _options$padding === void 0 ? 0 : _options$padding;
2044
+ var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
2045
+ var altContext = elementContext === popper ? reference : popper;
2046
+ var popperRect = state.rects.popper;
2047
+ var element = state.elements[altBoundary ? altContext : elementContext];
2048
+ var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
2049
+ var referenceClientRect = getBoundingClientRect(state.elements.reference);
2050
+ var popperOffsets = computeOffsets({
2051
+ reference: referenceClientRect,
2052
+ element: popperRect,
2053
+ strategy: 'absolute',
2054
+ placement: placement
2055
+ });
2056
+ var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
2057
+ var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
2058
+ // 0 or negative = within the clipping rect
2059
+
2060
+ var overflowOffsets = {
2061
+ top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
2062
+ bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
2063
+ left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
2064
+ right: elementClientRect.right - clippingClientRect.right + paddingObject.right
2065
+ };
2066
+ var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
2067
+
2068
+ if (elementContext === popper && offsetData) {
2069
+ var offset = offsetData[placement];
2070
+ Object.keys(overflowOffsets).forEach(function (key) {
2071
+ var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
2072
+ var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
2073
+ overflowOffsets[key] += offset[axis] * multiply;
2074
+ });
2075
+ }
2076
+
2077
+ return overflowOffsets;
2078
+ }
2079
+
2080
+ function computeAutoPlacement(state, options) {
2081
+ if (options === void 0) {
2082
+ options = {};
2083
+ }
2084
+
2085
+ var _options = options,
2086
+ placement = _options.placement,
2087
+ boundary = _options.boundary,
2088
+ rootBoundary = _options.rootBoundary,
2089
+ padding = _options.padding,
2090
+ flipVariations = _options.flipVariations,
2091
+ _options$allowedAutoP = _options.allowedAutoPlacements,
2092
+ allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
2093
+ var variation = getVariation(placement);
2094
+ var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
2095
+ return getVariation(placement) === variation;
2096
+ }) : basePlacements;
2097
+ var allowedPlacements = placements$1.filter(function (placement) {
2098
+ return allowedAutoPlacements.indexOf(placement) >= 0;
2099
+ });
2100
+
2101
+ if (allowedPlacements.length === 0) {
2102
+ allowedPlacements = placements$1;
2103
+ } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
2104
+
2105
+
2106
+ var overflows = allowedPlacements.reduce(function (acc, placement) {
2107
+ acc[placement] = detectOverflow(state, {
2108
+ placement: placement,
2109
+ boundary: boundary,
2110
+ rootBoundary: rootBoundary,
2111
+ padding: padding
2112
+ })[getBasePlacement(placement)];
2113
+ return acc;
2114
+ }, {});
2115
+ return Object.keys(overflows).sort(function (a, b) {
2116
+ return overflows[a] - overflows[b];
2117
+ });
2118
+ }
2119
+
2120
+ function getExpandedFallbackPlacements(placement) {
2121
+ if (getBasePlacement(placement) === auto) {
2122
+ return [];
2123
+ }
2124
+
2125
+ var oppositePlacement = getOppositePlacement(placement);
2126
+ return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
2127
+ }
2128
+
2129
+ function flip(_ref) {
2130
+ var state = _ref.state,
2131
+ options = _ref.options,
2132
+ name = _ref.name;
2133
+
2134
+ if (state.modifiersData[name]._skip) {
2135
+ return;
2136
+ }
2137
+
2138
+ var _options$mainAxis = options.mainAxis,
2139
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
2140
+ _options$altAxis = options.altAxis,
2141
+ checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
2142
+ specifiedFallbackPlacements = options.fallbackPlacements,
2143
+ padding = options.padding,
2144
+ boundary = options.boundary,
2145
+ rootBoundary = options.rootBoundary,
2146
+ altBoundary = options.altBoundary,
2147
+ _options$flipVariatio = options.flipVariations,
2148
+ flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
2149
+ allowedAutoPlacements = options.allowedAutoPlacements;
2150
+ var preferredPlacement = state.options.placement;
2151
+ var basePlacement = getBasePlacement(preferredPlacement);
2152
+ var isBasePlacement = basePlacement === preferredPlacement;
2153
+ var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
2154
+ var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
2155
+ return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
2156
+ placement: placement,
2157
+ boundary: boundary,
2158
+ rootBoundary: rootBoundary,
2159
+ padding: padding,
2160
+ flipVariations: flipVariations,
2161
+ allowedAutoPlacements: allowedAutoPlacements
2162
+ }) : placement);
2163
+ }, []);
2164
+ var referenceRect = state.rects.reference;
2165
+ var popperRect = state.rects.popper;
2166
+ var checksMap = new Map();
2167
+ var makeFallbackChecks = true;
2168
+ var firstFittingPlacement = placements[0];
2169
+
2170
+ for (var i = 0; i < placements.length; i++) {
2171
+ var placement = placements[i];
2172
+
2173
+ var _basePlacement = getBasePlacement(placement);
2174
+
2175
+ var isStartVariation = getVariation(placement) === start;
2176
+ var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
2177
+ var len = isVertical ? 'width' : 'height';
2178
+ var overflow = detectOverflow(state, {
2179
+ placement: placement,
2180
+ boundary: boundary,
2181
+ rootBoundary: rootBoundary,
2182
+ altBoundary: altBoundary,
2183
+ padding: padding
2184
+ });
2185
+ var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
2186
+
2187
+ if (referenceRect[len] > popperRect[len]) {
2188
+ mainVariationSide = getOppositePlacement(mainVariationSide);
2189
+ }
2190
+
2191
+ var altVariationSide = getOppositePlacement(mainVariationSide);
2192
+ var checks = [];
2193
+
2194
+ if (checkMainAxis) {
2195
+ checks.push(overflow[_basePlacement] <= 0);
2196
+ }
2197
+
2198
+ if (checkAltAxis) {
2199
+ checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
2200
+ }
2201
+
2202
+ if (checks.every(function (check) {
2203
+ return check;
2204
+ })) {
2205
+ firstFittingPlacement = placement;
2206
+ makeFallbackChecks = false;
2207
+ break;
2208
+ }
2209
+
2210
+ checksMap.set(placement, checks);
2211
+ }
2212
+
2213
+ if (makeFallbackChecks) {
2214
+ // `2` may be desired in some cases – research later
2215
+ var numberOfChecks = flipVariations ? 3 : 1;
2216
+
2217
+ var _loop = function _loop(_i) {
2218
+ var fittingPlacement = placements.find(function (placement) {
2219
+ var checks = checksMap.get(placement);
2220
+
2221
+ if (checks) {
2222
+ return checks.slice(0, _i).every(function (check) {
2223
+ return check;
2224
+ });
2225
+ }
2226
+ });
2227
+
2228
+ if (fittingPlacement) {
2229
+ firstFittingPlacement = fittingPlacement;
2230
+ return "break";
2231
+ }
2232
+ };
2233
+
2234
+ for (var _i = numberOfChecks; _i > 0; _i--) {
2235
+ var _ret = _loop(_i);
2236
+
2237
+ if (_ret === "break") break;
2238
+ }
2239
+ }
2240
+
2241
+ if (state.placement !== firstFittingPlacement) {
2242
+ state.modifiersData[name]._skip = true;
2243
+ state.placement = firstFittingPlacement;
2244
+ state.reset = true;
2245
+ }
2246
+ } // eslint-disable-next-line import/no-unused-modules
2247
+
2248
+
2249
+ var flip$1 = {
2250
+ name: 'flip',
2251
+ enabled: true,
2252
+ phase: 'main',
2253
+ fn: flip,
2254
+ requiresIfExists: ['offset'],
2255
+ data: {
2256
+ _skip: false
2257
+ }
2258
+ };
2259
+
2260
+ function getSideOffsets(overflow, rect, preventedOffsets) {
2261
+ if (preventedOffsets === void 0) {
2262
+ preventedOffsets = {
2263
+ x: 0,
2264
+ y: 0
2265
+ };
2266
+ }
2267
+
2268
+ return {
2269
+ top: overflow.top - rect.height - preventedOffsets.y,
2270
+ right: overflow.right - rect.width + preventedOffsets.x,
2271
+ bottom: overflow.bottom - rect.height + preventedOffsets.y,
2272
+ left: overflow.left - rect.width - preventedOffsets.x
2273
+ };
2274
+ }
2275
+
2276
+ function isAnySideFullyClipped(overflow) {
2277
+ return [top, right, bottom, left].some(function (side) {
2278
+ return overflow[side] >= 0;
2279
+ });
2280
+ }
2281
+
2282
+ function hide(_ref) {
2283
+ var state = _ref.state,
2284
+ name = _ref.name;
2285
+ var referenceRect = state.rects.reference;
2286
+ var popperRect = state.rects.popper;
2287
+ var preventedOffsets = state.modifiersData.preventOverflow;
2288
+ var referenceOverflow = detectOverflow(state, {
2289
+ elementContext: 'reference'
2290
+ });
2291
+ var popperAltOverflow = detectOverflow(state, {
2292
+ altBoundary: true
2293
+ });
2294
+ var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
2295
+ var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
2296
+ var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
2297
+ var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
2298
+ state.modifiersData[name] = {
2299
+ referenceClippingOffsets: referenceClippingOffsets,
2300
+ popperEscapeOffsets: popperEscapeOffsets,
2301
+ isReferenceHidden: isReferenceHidden,
2302
+ hasPopperEscaped: hasPopperEscaped
2303
+ };
2304
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
2305
+ 'data-popper-reference-hidden': isReferenceHidden,
2306
+ 'data-popper-escaped': hasPopperEscaped
2307
+ });
2308
+ } // eslint-disable-next-line import/no-unused-modules
2309
+
2310
+
2311
+ var hide$1 = {
2312
+ name: 'hide',
2313
+ enabled: true,
2314
+ phase: 'main',
2315
+ requiresIfExists: ['preventOverflow'],
2316
+ fn: hide
2317
+ };
2318
+
2319
+ function distanceAndSkiddingToXY(placement, rects, offset) {
2320
+ var basePlacement = getBasePlacement(placement);
2321
+ var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
2322
+
2323
+ var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
2324
+ placement: placement
2325
+ })) : offset,
2326
+ skidding = _ref[0],
2327
+ distance = _ref[1];
2328
+
2329
+ skidding = skidding || 0;
2330
+ distance = (distance || 0) * invertDistance;
2331
+ return [left, right].indexOf(basePlacement) >= 0 ? {
2332
+ x: distance,
2333
+ y: skidding
2334
+ } : {
2335
+ x: skidding,
2336
+ y: distance
2337
+ };
2338
+ }
2339
+
2340
+ function offset(_ref2) {
2341
+ var state = _ref2.state,
2342
+ options = _ref2.options,
2343
+ name = _ref2.name;
2344
+ var _options$offset = options.offset,
2345
+ offset = _options$offset === void 0 ? [0, 0] : _options$offset;
2346
+ var data = placements.reduce(function (acc, placement) {
2347
+ acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
2348
+ return acc;
2349
+ }, {});
2350
+ var _data$state$placement = data[state.placement],
2351
+ x = _data$state$placement.x,
2352
+ y = _data$state$placement.y;
2353
+
2354
+ if (state.modifiersData.popperOffsets != null) {
2355
+ state.modifiersData.popperOffsets.x += x;
2356
+ state.modifiersData.popperOffsets.y += y;
2357
+ }
2358
+
2359
+ state.modifiersData[name] = data;
2360
+ } // eslint-disable-next-line import/no-unused-modules
2361
+
2362
+
2363
+ var offset$1 = {
2364
+ name: 'offset',
2365
+ enabled: true,
2366
+ phase: 'main',
2367
+ requires: ['popperOffsets'],
2368
+ fn: offset
2369
+ };
2370
+
2371
+ function popperOffsets(_ref) {
2372
+ var state = _ref.state,
2373
+ name = _ref.name;
2374
+ // Offsets are the actual position the popper needs to have to be
2375
+ // properly positioned near its reference element
2376
+ // This is the most basic placement, and will be adjusted by
2377
+ // the modifiers in the next step
2378
+ state.modifiersData[name] = computeOffsets({
2379
+ reference: state.rects.reference,
2380
+ element: state.rects.popper,
2381
+ strategy: 'absolute',
2382
+ placement: state.placement
2383
+ });
2384
+ } // eslint-disable-next-line import/no-unused-modules
2385
+
2386
+
2387
+ var popperOffsets$1 = {
2388
+ name: 'popperOffsets',
2389
+ enabled: true,
2390
+ phase: 'read',
2391
+ fn: popperOffsets,
2392
+ data: {}
2393
+ };
2394
+
2395
+ function getAltAxis(axis) {
2396
+ return axis === 'x' ? 'y' : 'x';
2397
+ }
2398
+
2399
+ function preventOverflow(_ref) {
2400
+ var state = _ref.state,
2401
+ options = _ref.options,
2402
+ name = _ref.name;
2403
+ var _options$mainAxis = options.mainAxis,
2404
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
2405
+ _options$altAxis = options.altAxis,
2406
+ checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
2407
+ boundary = options.boundary,
2408
+ rootBoundary = options.rootBoundary,
2409
+ altBoundary = options.altBoundary,
2410
+ padding = options.padding,
2411
+ _options$tether = options.tether,
2412
+ tether = _options$tether === void 0 ? true : _options$tether,
2413
+ _options$tetherOffset = options.tetherOffset,
2414
+ tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
2415
+ var overflow = detectOverflow(state, {
2416
+ boundary: boundary,
2417
+ rootBoundary: rootBoundary,
2418
+ padding: padding,
2419
+ altBoundary: altBoundary
2420
+ });
2421
+ var basePlacement = getBasePlacement(state.placement);
2422
+ var variation = getVariation(state.placement);
2423
+ var isBasePlacement = !variation;
2424
+ var mainAxis = getMainAxisFromPlacement(basePlacement);
2425
+ var altAxis = getAltAxis(mainAxis);
2426
+ var popperOffsets = state.modifiersData.popperOffsets;
2427
+ var referenceRect = state.rects.reference;
2428
+ var popperRect = state.rects.popper;
2429
+ var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
2430
+ placement: state.placement
2431
+ })) : tetherOffset;
2432
+ var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
2433
+ mainAxis: tetherOffsetValue,
2434
+ altAxis: tetherOffsetValue
2435
+ } : Object.assign({
2436
+ mainAxis: 0,
2437
+ altAxis: 0
2438
+ }, tetherOffsetValue);
2439
+ var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
2440
+ var data = {
2441
+ x: 0,
2442
+ y: 0
2443
+ };
2444
+
2445
+ if (!popperOffsets) {
2446
+ return;
2447
+ }
2448
+
2449
+ if (checkMainAxis) {
2450
+ var _offsetModifierState$;
2451
+
2452
+ var mainSide = mainAxis === 'y' ? top : left;
2453
+ var altSide = mainAxis === 'y' ? bottom : right;
2454
+ var len = mainAxis === 'y' ? 'height' : 'width';
2455
+ var offset = popperOffsets[mainAxis];
2456
+ var min$1 = offset + overflow[mainSide];
2457
+ var max$1 = offset - overflow[altSide];
2458
+ var additive = tether ? -popperRect[len] / 2 : 0;
2459
+ var minLen = variation === start ? referenceRect[len] : popperRect[len];
2460
+ var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
2461
+ // outside the reference bounds
2462
+
2463
+ var arrowElement = state.elements.arrow;
2464
+ var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
2465
+ width: 0,
2466
+ height: 0
2467
+ };
2468
+ var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
2469
+ var arrowPaddingMin = arrowPaddingObject[mainSide];
2470
+ var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
2471
+ // to include its full size in the calculation. If the reference is small
2472
+ // and near the edge of a boundary, the popper can overflow even if the
2473
+ // reference is not overflowing as well (e.g. virtual elements with no
2474
+ // width or height)
2475
+
2476
+ var arrowLen = within(0, referenceRect[len], arrowRect[len]);
2477
+ var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
2478
+ var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
2479
+ var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
2480
+ var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
2481
+ var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
2482
+ var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
2483
+ var tetherMax = offset + maxOffset - offsetModifierValue;
2484
+ var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
2485
+ popperOffsets[mainAxis] = preventedOffset;
2486
+ data[mainAxis] = preventedOffset - offset;
2487
+ }
2488
+
2489
+ if (checkAltAxis) {
2490
+ var _offsetModifierState$2;
2491
+
2492
+ var _mainSide = mainAxis === 'x' ? top : left;
2493
+
2494
+ var _altSide = mainAxis === 'x' ? bottom : right;
2495
+
2496
+ var _offset = popperOffsets[altAxis];
2497
+
2498
+ var _len = altAxis === 'y' ? 'height' : 'width';
2499
+
2500
+ var _min = _offset + overflow[_mainSide];
2501
+
2502
+ var _max = _offset - overflow[_altSide];
2503
+
2504
+ var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
2505
+
2506
+ var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
2507
+
2508
+ var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
2509
+
2510
+ var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
2511
+
2512
+ var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
2513
+
2514
+ popperOffsets[altAxis] = _preventedOffset;
2515
+ data[altAxis] = _preventedOffset - _offset;
2516
+ }
2517
+
2518
+ state.modifiersData[name] = data;
2519
+ } // eslint-disable-next-line import/no-unused-modules
2520
+
2521
+
2522
+ var preventOverflow$1 = {
2523
+ name: 'preventOverflow',
2524
+ enabled: true,
2525
+ phase: 'main',
2526
+ fn: preventOverflow,
2527
+ requiresIfExists: ['offset']
2528
+ };
2529
+
2530
+ function getHTMLElementScroll(element) {
2531
+ return {
2532
+ scrollLeft: element.scrollLeft,
2533
+ scrollTop: element.scrollTop
2534
+ };
2535
+ }
2536
+
2537
+ function getNodeScroll(node) {
2538
+ if (node === getWindow(node) || !isHTMLElement(node)) {
2539
+ return getWindowScroll(node);
2540
+ } else {
2541
+ return getHTMLElementScroll(node);
2542
+ }
2543
+ }
2544
+
2545
+ function isElementScaled(element) {
2546
+ var rect = element.getBoundingClientRect();
2547
+ var scaleX = round(rect.width) / element.offsetWidth || 1;
2548
+ var scaleY = round(rect.height) / element.offsetHeight || 1;
2549
+ return scaleX !== 1 || scaleY !== 1;
2550
+ } // Returns the composite rect of an element relative to its offsetParent.
2551
+ // Composite means it takes into account transforms as well as layout.
2552
+
2553
+
2554
+ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
2555
+ if (isFixed === void 0) {
2556
+ isFixed = false;
2557
+ }
2558
+
2559
+ var isOffsetParentAnElement = isHTMLElement(offsetParent);
2560
+ var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
2561
+ var documentElement = getDocumentElement(offsetParent);
2562
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
2563
+ var scroll = {
2564
+ scrollLeft: 0,
2565
+ scrollTop: 0
2566
+ };
2567
+ var offsets = {
2568
+ x: 0,
2569
+ y: 0
2570
+ };
2571
+
2572
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
2573
+ if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
2574
+ isScrollParent(documentElement)) {
2575
+ scroll = getNodeScroll(offsetParent);
2576
+ }
2577
+
2578
+ if (isHTMLElement(offsetParent)) {
2579
+ offsets = getBoundingClientRect(offsetParent, true);
2580
+ offsets.x += offsetParent.clientLeft;
2581
+ offsets.y += offsetParent.clientTop;
2582
+ } else if (documentElement) {
2583
+ offsets.x = getWindowScrollBarX(documentElement);
2584
+ }
2585
+ }
2586
+
2587
+ return {
2588
+ x: rect.left + scroll.scrollLeft - offsets.x,
2589
+ y: rect.top + scroll.scrollTop - offsets.y,
2590
+ width: rect.width,
2591
+ height: rect.height
2592
+ };
2593
+ }
2594
+
2595
+ function order(modifiers) {
2596
+ var map = new Map();
2597
+ var visited = new Set();
2598
+ var result = [];
2599
+ modifiers.forEach(function (modifier) {
2600
+ map.set(modifier.name, modifier);
2601
+ }); // On visiting object, check for its dependencies and visit them recursively
2602
+
2603
+ function sort(modifier) {
2604
+ visited.add(modifier.name);
2605
+ var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
2606
+ requires.forEach(function (dep) {
2607
+ if (!visited.has(dep)) {
2608
+ var depModifier = map.get(dep);
2609
+
2610
+ if (depModifier) {
2611
+ sort(depModifier);
2612
+ }
2613
+ }
2614
+ });
2615
+ result.push(modifier);
2616
+ }
2617
+
2618
+ modifiers.forEach(function (modifier) {
2619
+ if (!visited.has(modifier.name)) {
2620
+ // check for visited object
2621
+ sort(modifier);
2622
+ }
2623
+ });
2624
+ return result;
2625
+ }
2626
+
2627
+ function orderModifiers(modifiers) {
2628
+ // order based on dependencies
2629
+ var orderedModifiers = order(modifiers); // order based on phase
2630
+
2631
+ return modifierPhases.reduce(function (acc, phase) {
2632
+ return acc.concat(orderedModifiers.filter(function (modifier) {
2633
+ return modifier.phase === phase;
2634
+ }));
2635
+ }, []);
2636
+ }
2637
+
2638
+ function debounce(fn) {
2639
+ var pending;
2640
+ return function () {
2641
+ if (!pending) {
2642
+ pending = new Promise(function (resolve) {
2643
+ Promise.resolve().then(function () {
2644
+ pending = undefined;
2645
+ resolve(fn());
2646
+ });
2647
+ });
2648
+ }
2649
+
2650
+ return pending;
2651
+ };
2652
+ }
2653
+
2654
+ function mergeByName(modifiers) {
2655
+ var merged = modifiers.reduce(function (merged, current) {
2656
+ var existing = merged[current.name];
2657
+ merged[current.name] = existing ? Object.assign({}, existing, current, {
2658
+ options: Object.assign({}, existing.options, current.options),
2659
+ data: Object.assign({}, existing.data, current.data)
2660
+ }) : current;
2661
+ return merged;
2662
+ }, {}); // IE11 does not support Object.values
2663
+
2664
+ return Object.keys(merged).map(function (key) {
2665
+ return merged[key];
2666
+ });
2667
+ }
2668
+
2669
+ var DEFAULT_OPTIONS = {
2670
+ placement: 'bottom',
2671
+ modifiers: [],
2672
+ strategy: 'absolute'
2673
+ };
2674
+
2675
+ function areValidElements() {
2676
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2677
+ args[_key] = arguments[_key];
2678
+ }
2679
+
2680
+ return !args.some(function (element) {
2681
+ return !(element && typeof element.getBoundingClientRect === 'function');
2682
+ });
2683
+ }
2684
+
2685
+ function popperGenerator(generatorOptions) {
2686
+ if (generatorOptions === void 0) {
2687
+ generatorOptions = {};
2688
+ }
2689
+
2690
+ var _generatorOptions = generatorOptions,
2691
+ _generatorOptions$def = _generatorOptions.defaultModifiers,
2692
+ defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
2693
+ _generatorOptions$def2 = _generatorOptions.defaultOptions,
2694
+ defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
2695
+ return function createPopper(reference, popper, options) {
2696
+ if (options === void 0) {
2697
+ options = defaultOptions;
2698
+ }
2699
+
2700
+ var state = {
2701
+ placement: 'bottom',
2702
+ orderedModifiers: [],
2703
+ options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
2704
+ modifiersData: {},
2705
+ elements: {
2706
+ reference: reference,
2707
+ popper: popper
2708
+ },
2709
+ attributes: {},
2710
+ styles: {}
2711
+ };
2712
+ var effectCleanupFns = [];
2713
+ var isDestroyed = false;
2714
+ var instance = {
2715
+ state: state,
2716
+ setOptions: function setOptions(setOptionsAction) {
2717
+ var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
2718
+ cleanupModifierEffects();
2719
+ state.options = Object.assign({}, defaultOptions, state.options, options);
2720
+ state.scrollParents = {
2721
+ reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
2722
+ popper: listScrollParents(popper)
2723
+ }; // Orders the modifiers based on their dependencies and `phase`
2724
+ // properties
2725
+
2726
+ var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
2727
+
2728
+ state.orderedModifiers = orderedModifiers.filter(function (m) {
2729
+ return m.enabled;
2730
+ }); // Validate the provided modifiers so that the consumer will get warned
2731
+
2732
+ runModifierEffects();
2733
+ return instance.update();
2734
+ },
2735
+ // Sync update – it will always be executed, even if not necessary. This
2736
+ // is useful for low frequency updates where sync behavior simplifies the
2737
+ // logic.
2738
+ // For high frequency updates (e.g. `resize` and `scroll` events), always
2739
+ // prefer the async Popper#update method
2740
+ forceUpdate: function forceUpdate() {
2741
+ if (isDestroyed) {
2742
+ return;
2743
+ }
2744
+
2745
+ var _state$elements = state.elements,
2746
+ reference = _state$elements.reference,
2747
+ popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
2748
+ // anymore
2749
+
2750
+ if (!areValidElements(reference, popper)) {
2751
+
2752
+ return;
2753
+ } // Store the reference and popper rects to be read by modifiers
2754
+
2755
+
2756
+ state.rects = {
2757
+ reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
2758
+ popper: getLayoutRect(popper)
2759
+ }; // Modifiers have the ability to reset the current update cycle. The
2760
+ // most common use case for this is the `flip` modifier changing the
2761
+ // placement, which then needs to re-run all the modifiers, because the
2762
+ // logic was previously ran for the previous placement and is therefore
2763
+ // stale/incorrect
2764
+
2765
+ state.reset = false;
2766
+ state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
2767
+ // is filled with the initial data specified by the modifier. This means
2768
+ // it doesn't persist and is fresh on each update.
2769
+ // To ensure persistent data, use `${name}#persistent`
2770
+
2771
+ state.orderedModifiers.forEach(function (modifier) {
2772
+ return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
2773
+ });
2774
+
2775
+ for (var index = 0; index < state.orderedModifiers.length; index++) {
2776
+
2777
+ if (state.reset === true) {
2778
+ state.reset = false;
2779
+ index = -1;
2780
+ continue;
2781
+ }
2782
+
2783
+ var _state$orderedModifie = state.orderedModifiers[index],
2784
+ fn = _state$orderedModifie.fn,
2785
+ _state$orderedModifie2 = _state$orderedModifie.options,
2786
+ _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
2787
+ name = _state$orderedModifie.name;
2788
+
2789
+ if (typeof fn === 'function') {
2790
+ state = fn({
2791
+ state: state,
2792
+ options: _options,
2793
+ name: name,
2794
+ instance: instance
2795
+ }) || state;
2796
+ }
2797
+ }
2798
+ },
2799
+ // Async and optimistically optimized update – it will not be executed if
2800
+ // not necessary (debounced to run at most once-per-tick)
2801
+ update: debounce(function () {
2802
+ return new Promise(function (resolve) {
2803
+ instance.forceUpdate();
2804
+ resolve(state);
2805
+ });
2806
+ }),
2807
+ destroy: function destroy() {
2808
+ cleanupModifierEffects();
2809
+ isDestroyed = true;
2810
+ }
2811
+ };
2812
+
2813
+ if (!areValidElements(reference, popper)) {
2814
+
2815
+ return instance;
2816
+ }
2817
+
2818
+ instance.setOptions(options).then(function (state) {
2819
+ if (!isDestroyed && options.onFirstUpdate) {
2820
+ options.onFirstUpdate(state);
2821
+ }
2822
+ }); // Modifiers have the ability to execute arbitrary code before the first
2823
+ // update cycle runs. They will be executed in the same order as the update
2824
+ // cycle. This is useful when a modifier adds some persistent data that
2825
+ // other modifiers need to use, but the modifier is run after the dependent
2826
+ // one.
2827
+
2828
+ function runModifierEffects() {
2829
+ state.orderedModifiers.forEach(function (_ref3) {
2830
+ var name = _ref3.name,
2831
+ _ref3$options = _ref3.options,
2832
+ options = _ref3$options === void 0 ? {} : _ref3$options,
2833
+ effect = _ref3.effect;
2834
+
2835
+ if (typeof effect === 'function') {
2836
+ var cleanupFn = effect({
2837
+ state: state,
2838
+ name: name,
2839
+ instance: instance,
2840
+ options: options
2841
+ });
2842
+
2843
+ var noopFn = function noopFn() {};
2844
+
2845
+ effectCleanupFns.push(cleanupFn || noopFn);
2846
+ }
2847
+ });
2848
+ }
2849
+
2850
+ function cleanupModifierEffects() {
2851
+ effectCleanupFns.forEach(function (fn) {
2852
+ return fn();
2853
+ });
2854
+ effectCleanupFns = [];
2855
+ }
2856
+
2857
+ return instance;
2858
+ };
2859
+ }
2860
+
2861
+ var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
2862
+ var createPopper = /*#__PURE__*/popperGenerator({
2863
+ defaultModifiers: defaultModifiers
2864
+ }); // eslint-disable-next-line import/no-unused-modules
2865
+
2866
+ var EMPTY_MODIFIERS = [];
2867
+ var usePopper = function usePopper(referenceElement, popperElement, options) {
2868
+ if (options === void 0) {
2869
+ options = {};
2870
+ }
2871
+
2872
+ var prevOptions = React__namespace.useRef(null);
2873
+ var optionsWithDefaults = {
2874
+ onFirstUpdate: options.onFirstUpdate,
2875
+ placement: options.placement || 'bottom',
2876
+ strategy: options.strategy || 'absolute',
2877
+ modifiers: options.modifiers || EMPTY_MODIFIERS
2878
+ };
2879
+
2880
+ var _React$useState = React__namespace.useState({
2881
+ styles: {
2882
+ popper: {
2883
+ position: optionsWithDefaults.strategy,
2884
+ left: '0',
2885
+ top: '0'
2886
+ },
2887
+ arrow: {
2888
+ position: 'absolute'
2889
+ }
2890
+ },
2891
+ attributes: {}
2892
+ }),
2893
+ state = _React$useState[0],
2894
+ setState = _React$useState[1];
2895
+
2896
+ var updateStateModifier = React__namespace.useMemo(function () {
2897
+ return {
2898
+ name: 'updateState',
2899
+ enabled: true,
2900
+ phase: 'write',
2901
+ fn: function fn(_ref) {
2902
+ var state = _ref.state;
2903
+ var elements = Object.keys(state.elements);
2904
+ ReactDOM__namespace.flushSync(function () {
2905
+ setState({
2906
+ styles: fromEntries(elements.map(function (element) {
2907
+ return [element, state.styles[element] || {}];
2908
+ })),
2909
+ attributes: fromEntries(elements.map(function (element) {
2910
+ return [element, state.attributes[element]];
2911
+ }))
2912
+ });
2913
+ });
2914
+ },
2915
+ requires: ['computeStyles']
2916
+ };
2917
+ }, []);
2918
+ var popperOptions = React__namespace.useMemo(function () {
2919
+ var newOptions = {
2920
+ onFirstUpdate: optionsWithDefaults.onFirstUpdate,
2921
+ placement: optionsWithDefaults.placement,
2922
+ strategy: optionsWithDefaults.strategy,
2923
+ modifiers: [].concat(optionsWithDefaults.modifiers, [updateStateModifier, {
2924
+ name: 'applyStyles',
2925
+ enabled: false
2926
+ }])
2927
+ };
2928
+
2929
+ if (deepequal__default["default"](prevOptions.current, newOptions)) {
2930
+ return prevOptions.current || newOptions;
2931
+ } else {
2932
+ prevOptions.current = newOptions;
2933
+ return newOptions;
2934
+ }
2935
+ }, [optionsWithDefaults.onFirstUpdate, optionsWithDefaults.placement, optionsWithDefaults.strategy, optionsWithDefaults.modifiers, updateStateModifier]);
2936
+ var popperInstanceRef = React__namespace.useRef();
2937
+ useIsomorphicLayoutEffect(function () {
2938
+ if (popperInstanceRef.current) {
2939
+ popperInstanceRef.current.setOptions(popperOptions);
2940
+ }
2941
+ }, [popperOptions]);
2942
+ useIsomorphicLayoutEffect(function () {
2943
+ if (referenceElement == null || popperElement == null) {
2944
+ return;
2945
+ }
2946
+
2947
+ var createPopper$1 = options.createPopper || createPopper;
2948
+ var popperInstance = createPopper$1(referenceElement, popperElement, popperOptions);
2949
+ popperInstanceRef.current = popperInstance;
2950
+ return function () {
2951
+ popperInstance.destroy();
2952
+ popperInstanceRef.current = null;
2953
+ };
2954
+ }, [referenceElement, popperElement, options.createPopper]);
2955
+ return {
2956
+ state: popperInstanceRef.current ? popperInstanceRef.current.state : null,
2957
+ styles: state.styles,
2958
+ attributes: state.attributes,
2959
+ update: popperInstanceRef.current ? popperInstanceRef.current.update : null,
2960
+ forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null
2961
+ };
2962
+ };
2963
+
2964
+ var Tooltip = function (_a) {
2965
+ var children = _a.children, rest = __rest(_a, ["children"]);
2966
+ return (React__default["default"].createElement("div", exports.__assign({ className: 'str-chat__tooltip' }, rest), children));
2967
+ };
2968
+ var PopperTooltip = function (_a) {
2969
+ var children = _a.children, _b = _a.offset, offset = _b === void 0 ? [0, 10] : _b, referenceElement = _a.referenceElement, _c = _a.placement, placement = _c === void 0 ? 'top' : _c, _d = _a.visible, visible = _d === void 0 ? false : _d;
2970
+ var _e = React.useState(null), popperElement = _e[0], setPopperElement = _e[1];
2971
+ var _f = usePopper(referenceElement, popperElement, {
2972
+ modifiers: [
2973
+ {
2974
+ name: 'offset',
2975
+ options: {
2976
+ offset: offset,
2977
+ },
2978
+ },
2979
+ ],
2980
+ placement: placement,
2981
+ }), attributes = _f.attributes, styles = _f.styles;
2982
+ if (!visible)
2983
+ return null;
2984
+ return (React__default["default"].createElement("div", exports.__assign({ className: 'str-chat__tooltip', ref: setPopperElement, style: styles.popper }, attributes.popper), children));
2985
+ };
2986
+
2987
+ var EmojiIconLarge = function () {
2988
+ var t = useTranslationContext('EmojiIconLarge').t;
2989
+ return (React__default["default"].createElement("svg", { height: '28', width: '28', xmlns: 'http://www.w3.org/2000/svg' },
2990
+ React__default["default"].createElement("title", null, t('Open emoji picker')),
2991
+ React__default["default"].createElement("g", { clipRule: 'evenodd', fillRule: 'evenodd' },
2992
+ React__default["default"].createElement("path", { d: 'M14 4.4C8.6 4.4 4.4 8.6 4.4 14c0 5.4 4.2 9.6 9.6 9.6c5.4 0 9.6-4.2 9.6-9.6c0-5.4-4.2-9.6-9.6-9.6zM2 14c0-6.6 5.4-12 12-12s12 5.4 12 12s-5.4 12-12 12s-12-5.4-12-12zM12.8 11c0 1-.8 1.8-1.8 1.8s-1.8-.8-1.8-1.8s.8-1.8 1.8-1.8s1.8.8 1.8 1.8zM18.8 11c0 1-.8 1.8-1.8 1.8s-1.8-.8-1.8-1.8s.8-1.8 1.8-1.8s1.8.8 1.8 1.8zM8.6 15.4c.6-.4 1.2-.2 1.6.2c.6.8 1.6 1.8 3 2c1.2.4 2.8.2 4.8-2c.4-.4 1.2-.6 1.6 0c.4.4.6 1.2 0 1.6c-2.2 2.6-4.8 3.4-7 3c-2-.4-3.6-1.8-4.4-3c-.4-.6-.2-1.2.4-1.8z' }))));
2993
+ };
2994
+ var EmojiIconSmall = function () {
2995
+ var t = useTranslationContext('EmojiIconSmall').t;
2996
+ return (React__default["default"].createElement("svg", { height: '14', width: '14', xmlns: 'http://www.w3.org/2000/svg' },
2997
+ React__default["default"].createElement("title", null, t('Open emoji picker')),
2998
+ React__default["default"].createElement("g", { clipRule: 'evenodd', fillRule: 'evenodd' },
2999
+ React__default["default"].createElement("path", { d: 'M6.7 1.42C3.73 1.42 1.42 3.73 1.42 6.7c0 2.97 2.31 5.28 5.28 5.28c2.97 0 5.28-2.31 5.28-5.28c0-2.97-2.31-5.28-5.28-5.28zM.1 6.7c0-3.63 2.97-6.6 6.6-6.6s6.6 2.97 6.6 6.6s-2.97 6.6-6.6 6.6s-6.6-2.97-6.6-6.6zM6.04 5.05c0 .55-.44.99-.99.99s-.99-.44-.99-.99s.44-.99.99-.99s.99.44.99.99zM9.34 5.05c0 .55-.44.99-.99.99s-.99-.44-.99-.99s.44-.99.99-.99s.99.44.99.99zM3.73 7.47c.33-.22.66-.11.88.11c.33.44.88.99 1.65 1.1c.66.22 1.54.11 2.64-1.1c.22-.22.66-.33.88 0c.22.22.33.66 0 .88c-1.21 1.43-2.64 1.87-3.85 1.65c-1.1-.22-1.98-.99-2.42-1.65c-.22-.33-.11-.66.22-.99z' }))));
3000
+ };
3001
+ // ThemingV2 icon
3002
+ var EmojiPickerIcon = function () { return (React__default["default"].createElement("svg", { preserveAspectRatio: 'xMinYMin', viewBox: '0 0 28 28', width: '100%', xmlns: 'http://www.w3.org/2000/svg' },
3003
+ React__default["default"].createElement("g", { clipRule: 'evenodd', fillRule: 'evenodd' },
3004
+ React__default["default"].createElement("path", { d: 'M14 4.4C8.6 4.4 4.4 8.6 4.4 14c0 5.4 4.2 9.6 9.6 9.6c5.4 0 9.6-4.2 9.6-9.6c0-5.4-4.2-9.6-9.6-9.6zM2 14c0-6.6 5.4-12 12-12s12 5.4 12 12s-5.4 12-12 12s-12-5.4-12-12zM12.8 11c0 1-.8 1.8-1.8 1.8s-1.8-.8-1.8-1.8s.8-1.8 1.8-1.8s1.8.8 1.8 1.8zM18.8 11c0 1-.8 1.8-1.8 1.8s-1.8-.8-1.8-1.8s.8-1.8 1.8-1.8s1.8.8 1.8 1.8zM8.6 15.4c.6-.4 1.2-.2 1.6.2c.6.8 1.6 1.8 3 2c1.2.4 2.8.2 4.8-2c.4-.4 1.2-.6 1.6 0c.4.4.6 1.2 0 1.6c-2.2 2.6-4.8 3.4-7 3c-2-.4-3.6-1.8-4.4-3c-.4-.6-.2-1.2.4-1.8z' })))); };
3005
+ var FileUploadIcon = function () {
3006
+ var t = useTranslationContext('FileUploadIcon').t;
3007
+ return (React__default["default"].createElement("svg", { height: '14', width: '14', xmlns: 'http://www.w3.org/2000/svg' },
3008
+ React__default["default"].createElement("title", null, t('Attach files')),
3009
+ React__default["default"].createElement("path", { d: 'M7 .5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5S.5 10.59.5 7 3.41.5 7 .5zm0 12c3.031 0 5.5-2.469 5.5-5.5S10.031 1.5 7 1.5A5.506 5.506 0 0 0 1.5 7c0 3.034 2.469 5.5 5.5 5.5zM7.506 3v3.494H11v1.05H7.506V11h-1.05V7.544H3v-1.05h3.456V3h1.05z', fillRule: 'nonzero' })));
3010
+ };
3011
+ var FileUploadIconFlat = function () {
3012
+ var t = useTranslationContext('FileUploadIconFlat').t;
3013
+ return (React__default["default"].createElement("svg", { height: '14', width: '14', xmlns: 'http://www.w3.org/2000/svg' },
3014
+ React__default["default"].createElement("title", null, t('Attach files')),
3015
+ React__default["default"].createElement("path", { d: 'M1.667.333h10.666c.737 0 1.334.597 1.334 1.334v10.666c0 .737-.597 1.334-1.334 1.334H1.667a1.333 1.333 0 0 1-1.334-1.334V1.667C.333.93.93.333 1.667.333zm2 1.334a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333zm-2 9.333v1.333h10.666v-4l-2-2-4 4-2-2L1.667 11z', fillRule: 'nonzero' })));
3016
+ };
3017
+ var LoadingIndicatorIcon = function (_a) {
3018
+ var _b = _a.size, size = _b === void 0 ? 20 : _b;
3019
+ var id = React.useMemo(function () { return nanoid(); }, []);
3020
+ return (React__default["default"].createElement("div", { className: 'str-chat__loading-indicator' },
3021
+ React__default["default"].createElement("svg", { "data-testid": 'loading-indicator', height: size, viewBox: '0 0 30 30', width: size, xmlns: 'http://www.w3.org/2000/svg' },
3022
+ React__default["default"].createElement("defs", null,
3023
+ React__default["default"].createElement("linearGradient", { id: "".concat(id, "-linear-gradient"), x1: '50%', x2: '50%', y1: '0%', y2: '100%' },
3024
+ React__default["default"].createElement("stop", { offset: '0%', stopColor: '#FFF', stopOpacity: '0' }),
3025
+ React__default["default"].createElement("stop", { "data-testid": 'stop-color', offset: '100%', stopOpacity: '1' }))),
3026
+ React__default["default"].createElement("path", { d: 'M2.518 23.321l1.664-1.11A12.988 12.988 0 0 0 15 28c7.18 0 13-5.82 13-13S22.18 2 15 2V0c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-5.206 0-9.792-2.652-12.482-6.679z', fill: "url(#".concat(id, "-linear-gradient)"), fillRule: 'evenodd' }))));
3027
+ };
3028
+ // ThemingV2 icon
3029
+ var UploadIcon = function () { return (React__default["default"].createElement("svg", { "data-testid": 'attach', fill: 'none', height: '24', viewBox: '0 0 24 24', width: '24', xmlns: 'http://www.w3.org/2000/svg' },
3030
+ React__default["default"].createElement("g", { clipPath: 'url(#clip0_10878_5)' },
3031
+ React__default["default"].createElement("path", { d: 'M12.9997 6.99993L10.9997 6.99993L10.9997 10.9999L6.99972 10.9999L6.99972 12.9999L10.9997 12.9999L10.9997 16.9999L12.9997 16.9999L12.9997 12.9999L16.9997 12.9999L16.9997 10.9999L12.9997 10.9999L12.9997 6.99993ZM11.9997 1.99992C6.47972 1.99992 1.99972 6.47993 1.99972 11.9999C1.99972 17.5199 6.47972 21.9999 11.9997 21.9999C17.5197 21.9999 21.9997 17.5199 21.9997 11.9999C21.9997 6.47993 17.5197 1.99992 11.9997 1.99992ZM11.9997 19.9999C7.58972 19.9999 3.99972 16.4099 3.99972 11.9999C3.99972 7.58993 7.58972 3.99993 11.9997 3.99993C16.4097 3.99993 19.9997 7.58993 19.9997 11.9999C19.9997 16.4099 16.4097 19.9999 11.9997 19.9999Z', fill: 'black' })),
3032
+ React__default["default"].createElement("defs", null,
3033
+ React__default["default"].createElement("clipPath", { id: 'clip0_10878_5' },
3034
+ React__default["default"].createElement("rect", { fill: 'white', height: '24', width: '24' }))))); };
3035
+ var CloseIcon = function () { return (React__default["default"].createElement("svg", { "data-testid": 'close-no-outline', fill: 'none', height: '24', viewBox: '0 0 24 24', width: '24', xmlns: 'http://www.w3.org/2000/svg' },
3036
+ React__default["default"].createElement("path", { d: 'M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z', fill: 'black' }))); };
3037
+ var RetryIcon = function () { return (React__default["default"].createElement("svg", { "data-testid": 'retry', fill: 'none', height: '24', viewBox: '0 0 24 24', width: '24', xmlns: 'http://www.w3.org/2000/svg' },
3038
+ React__default["default"].createElement("path", { d: 'M17.6449 6.35C16.1949 4.9 14.2049 4 11.9949 4C7.57488 4 4.00488 7.58 4.00488 12C4.00488 16.42 7.57488 20 11.9949 20C15.7249 20 18.8349 17.45 19.7249 14H17.6449C16.8249 16.33 14.6049 18 11.9949 18C8.68488 18 5.99488 15.31 5.99488 12C5.99488 8.69 8.68488 6 11.9949 6C13.6549 6 15.1349 6.69 16.2149 7.78L12.9949 11H19.9949V4L17.6449 6.35Z', fill: 'black' }))); };
3039
+ var DownloadIcon = function () { return (React__default["default"].createElement("svg", { "data-testid": 'download', fill: 'none', height: '24', viewBox: '0 0 24 24', width: '24', xmlns: 'http://www.w3.org/2000/svg' },
3040
+ React__default["default"].createElement("path", { d: 'M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04ZM19 18H6C3.79 18 2 16.21 2 14C2 11.95 3.53 10.24 5.56 10.03L6.63 9.92L7.13 8.97C8.08 7.14 9.94 6 12 6C14.62 6 16.88 7.86 17.39 10.43L17.69 11.93L19.22 12.04C20.78 12.14 22 13.45 22 15C22 16.65 20.65 18 19 18ZM13.45 10H10.55V13H8L12 17L16 13H13.45V10Z', fill: 'black' }))); };
3041
+ var LinkIcon = function () { return (React__default["default"].createElement("svg", { fill: 'none', height: '11', viewBox: '0 0 20 11', width: '20', xmlns: 'http://www.w3.org/2000/svg' },
3042
+ React__default["default"].createElement("path", { clipRule: 'evenodd', d: 'M1.9 5.5C1.9 3.79 3.29 2.4 5 2.4H8.05C8.57467 2.4 9 1.97467 9 1.45C9 0.925329 8.57467 0.5 8.05 0.5H5C2.24 0.5 0 2.74 0 5.5C0 8.26 2.24 10.5 5 10.5H8.05C8.57467 10.5 9 10.0747 9 9.55C9 9.02533 8.57467 8.6 8.05 8.6H5C3.29 8.6 1.9 7.21 1.9 5.5ZM6 5.5C6 6.05228 6.44772 6.5 7 6.5H13C13.5523 6.5 14 6.05228 14 5.5C14 4.94772 13.5523 4.5 13 4.5H7C6.44772 4.5 6 4.94772 6 5.5ZM15 0.5H11.95C11.4253 0.5 11 0.925329 11 1.45C11 1.97467 11.4253 2.4 11.95 2.4H15C16.71 2.4 18.1 3.79 18.1 5.5C18.1 7.21 16.71 8.6 15 8.6H11.95C11.4253 8.6 11 9.02533 11 9.55C11 10.0747 11.4253 10.5 11.95 10.5H15C17.76 10.5 20 8.26 20 5.5C20 2.74 17.76 0.5 15 0.5Z', fill: '#005DFF', fillRule: 'evenodd' }))); };
3043
+ var SendIconV1 = function () {
3044
+ var t = useTranslationContext('SendButton').t;
3045
+ return (React__default["default"].createElement("svg", { height: '17', viewBox: '0 0 18 17', width: '18', xmlns: 'http://www.w3.org/2000/svg' },
3046
+ React__default["default"].createElement("title", null, t('Send')),
3047
+ React__default["default"].createElement("path", { d: 'M0 17.015l17.333-8.508L0 0v6.617l12.417 1.89L0 10.397z', fill: '#006cff', fillRule: 'evenodd' })));
3048
+ };
3049
+ var SendIconV2 = function () {
3050
+ var t = useTranslationContext('SendButton').t;
3051
+ return (React__default["default"].createElement("svg", { "data-testid": 'send', fill: 'none', height: '24', viewBox: '0 0 24 24', width: '24', xmlns: 'http://www.w3.org/2000/svg' },
3052
+ React__default["default"].createElement("title", null, t('Send')),
3053
+ React__default["default"].createElement("path", { d: 'M4.00952 22L24 12L4.00952 2L4 9.77778L18.2857 12L4 14.2222L4.00952 22Z', fill: 'black' })));
3054
+ };
3055
+ var SendButton = function (_a) {
3056
+ var sendMessage = _a.sendMessage, rest = __rest(_a, ["sendMessage"]);
3057
+ var themeVersion = useChatContext('SendButton').themeVersion;
3058
+ return (React__default["default"].createElement("button", exports.__assign({ "aria-label": 'Send', className: 'str-chat__send-button', "data-testid": 'send-button', onClick: sendMessage, type: 'button' }, rest), themeVersion === '2' ? React__default["default"].createElement(SendIconV2, null) : React__default["default"].createElement(SendIconV1, null)));
3059
+ };
3060
+
3061
+ exports.ChannelActionContext = ChannelActionContext;
3062
+ exports.ChannelActionProvider = ChannelActionProvider;
3063
+ exports.ChannelStateContext = ChannelStateContext;
3064
+ exports.ChannelStateProvider = ChannelStateProvider;
3065
+ exports.ChatContext = ChatContext;
3066
+ exports.ChatProvider = ChatProvider;
3067
+ exports.CloseIcon = CloseIcon;
3068
+ exports.ComponentContext = ComponentContext;
3069
+ exports.ComponentProvider = ComponentProvider;
3070
+ exports.DownloadIcon = DownloadIcon;
3071
+ exports.EmojiIconLarge = EmojiIconLarge;
3072
+ exports.EmojiIconSmall = EmojiIconSmall;
3073
+ exports.EmojiPickerIcon = EmojiPickerIcon;
3074
+ exports.FileUploadIcon = FileUploadIcon;
3075
+ exports.FileUploadIconFlat = FileUploadIconFlat;
3076
+ exports.LinkIcon = LinkIcon;
3077
+ exports.LoadingIndicatorIcon = LoadingIndicatorIcon;
3078
+ exports.MessageContext = MessageContext;
3079
+ exports.MessageInputContext = MessageInputContext;
3080
+ exports.MessageInputContextProvider = MessageInputContextProvider;
3081
+ exports.MessageProvider = MessageProvider;
3082
+ exports.PopperTooltip = PopperTooltip;
3083
+ exports.RetryIcon = RetryIcon;
3084
+ exports.SendButton = SendButton;
3085
+ exports.SendIconV1 = SendIconV1;
3086
+ exports.SendIconV2 = SendIconV2;
3087
+ exports.Streami18n = Streami18n;
3088
+ exports.Tooltip = Tooltip;
3089
+ exports.TranslationContext = TranslationContext;
3090
+ exports.TranslationProvider = TranslationProvider;
3091
+ exports.TypingContext = TypingContext;
3092
+ exports.TypingProvider = TypingProvider;
3093
+ exports.UploadIcon = UploadIcon;
3094
+ exports.__awaiter = __awaiter;
3095
+ exports.__generator = __generator;
3096
+ exports.__read = __read;
3097
+ exports.__rest = __rest;
3098
+ exports.__spreadArray = __spreadArray;
3099
+ exports.deTranslations = deTranslations;
3100
+ exports.defaultDateTimeParser = defaultDateTimeParser;
3101
+ exports.defaultTranslatorFunction = defaultTranslatorFunction;
3102
+ exports.enTranslations = enTranslations;
3103
+ exports.esTranslations = esTranslations;
3104
+ exports.frTranslations = frTranslations;
3105
+ exports.hiTranslations = hiTranslations;
3106
+ exports.isDate = isDate;
3107
+ exports.isDayOrMoment = isDayOrMoment;
3108
+ exports.isLanguageSupported = isLanguageSupported;
3109
+ exports.isNumberOrString = isNumberOrString;
3110
+ exports.itTranslations = itTranslations;
3111
+ exports.jaTranslations = jaTranslations;
3112
+ exports.koTranslations = koTranslations;
3113
+ exports.nanoid = nanoid;
3114
+ exports.nlTranslations = nlTranslations;
3115
+ exports.ptTranslations = ptTranslations;
3116
+ exports.ruTranslations = ruTranslations;
3117
+ exports.trTranslations = trTranslations;
3118
+ exports.useChannelActionContext = useChannelActionContext;
3119
+ exports.useChannelStateContext = useChannelStateContext;
3120
+ exports.useChatContext = useChatContext;
3121
+ exports.useComponentContext = useComponentContext;
3122
+ exports.useMessageContext = useMessageContext;
3123
+ exports.useMessageInputContext = useMessageInputContext;
3124
+ exports.usePopper = usePopper;
3125
+ exports.useTranslationContext = useTranslationContext;
3126
+ exports.useTypingContext = useTypingContext;
3127
+ exports.withChannelActionContext = withChannelActionContext;
3128
+ exports.withChannelStateContext = withChannelStateContext;
3129
+ exports.withChatContext = withChatContext;
3130
+ exports.withComponentContext = withComponentContext;
3131
+ exports.withMessageContext = withMessageContext;
3132
+ exports.withTranslationContext = withTranslationContext;
3133
+ exports.withTypingContext = withTypingContext;