@100mslive/roomkit-react 0.5.4-alpha.0 → 0.5.4-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Diagnostics/index.d.ts +1 -2
- package/dist/Prebuilt/components/PIP/PIPManager.d.ts +11 -0
- package/dist/index.cjs.css +1 -1
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +35187 -38581
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +37176 -68
- package/dist/index.js.map +4 -4
- package/dist/meta.cjs.json +1364 -1555
- package/dist/meta.esbuild.json +1127 -1947
- package/package.json +7 -7
- package/dist/Diagnostics-IVT65BTD.css +0 -2771
- package/dist/Diagnostics-IVT65BTD.css.map +0 -7
- package/dist/Diagnostics-XZRJZN6F.js +0 -1638
- package/dist/Diagnostics-XZRJZN6F.js.map +0 -7
- package/dist/EmojiPickerContent-7HLGDLO5.js +0 -16
- package/dist/EmojiPickerContent-7HLGDLO5.js.map +0 -7
- package/dist/HLSView-KDT33XIC.js +0 -1642
- package/dist/HLSView-KDT33XIC.js.map +0 -7
- package/dist/HLSView-PIED5LDA.css +0 -2771
- package/dist/HLSView-PIED5LDA.css.map +0 -7
- package/dist/Prebuilt/components/Chat/EmojiPickerContent.d.ts +0 -12
- package/dist/Prebuilt/components/Footer/emojiData.d.ts +0 -2
- package/dist/Prebuilt/components/LazyLoad.d.ts +0 -60
- package/dist/StatsForNerds-HJRRP6CJ.css +0 -2771
- package/dist/StatsForNerds-HJRRP6CJ.css.map +0 -7
- package/dist/StatsForNerds-NEKFDD6A.js +0 -277
- package/dist/StatsForNerds-NEKFDD6A.js.map +0 -7
- package/dist/VBPicker-FAHHMUQI.js +0 -313
- package/dist/VBPicker-FAHHMUQI.js.map +0 -7
- package/dist/VBPicker-PYLU7FGM.css +0 -2771
- package/dist/VBPicker-PYLU7FGM.css.map +0 -7
- package/dist/WhiteboardLayout-MYWNACKM.js +0 -85
- package/dist/WhiteboardLayout-MYWNACKM.js.map +0 -7
- package/dist/WhiteboardLayout-OOFKQWLV.css +0 -2771
- package/dist/WhiteboardLayout-OOFKQWLV.css.map +0 -7
- package/dist/chunk-NBFKVN6C.js +0 -33410
- package/dist/chunk-NBFKVN6C.js.map +0 -7
- package/dist/chunk-WS5Q67XX.js +0 -125
- package/dist/chunk-WS5Q67XX.js.map +0 -7
|
@@ -1,1638 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Box,
|
|
3
|
-
Button,
|
|
4
|
-
DialogDropdownTrigger,
|
|
5
|
-
Dropdown,
|
|
6
|
-
Flex,
|
|
7
|
-
HMSThemeProvider,
|
|
8
|
-
Loading,
|
|
9
|
-
PermissionErrorModal,
|
|
10
|
-
Progress,
|
|
11
|
-
StyledVideoTile,
|
|
12
|
-
TEST_AUDIO_URL,
|
|
13
|
-
Text,
|
|
14
|
-
Video,
|
|
15
|
-
formatBytes,
|
|
16
|
-
useAudioOutputTest
|
|
17
|
-
} from "./chunk-NBFKVN6C.js";
|
|
18
|
-
import {
|
|
19
|
-
__async,
|
|
20
|
-
__commonJS,
|
|
21
|
-
__spreadProps,
|
|
22
|
-
__spreadValues,
|
|
23
|
-
__toESM,
|
|
24
|
-
init_define_process_env
|
|
25
|
-
} from "./chunk-WS5Q67XX.js";
|
|
26
|
-
|
|
27
|
-
// ../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
|
|
28
|
-
var require_react_is_development = __commonJS({
|
|
29
|
-
"../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
30
|
-
"use strict";
|
|
31
|
-
init_define_process_env();
|
|
32
|
-
if (true) {
|
|
33
|
-
(function() {
|
|
34
|
-
"use strict";
|
|
35
|
-
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
36
|
-
var REACT_ELEMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
|
|
37
|
-
var REACT_PORTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.portal") : 60106;
|
|
38
|
-
var REACT_FRAGMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107;
|
|
39
|
-
var REACT_STRICT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108;
|
|
40
|
-
var REACT_PROFILER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114;
|
|
41
|
-
var REACT_PROVIDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.provider") : 60109;
|
|
42
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.context") : 60110;
|
|
43
|
-
var REACT_ASYNC_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111;
|
|
44
|
-
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111;
|
|
45
|
-
var REACT_FORWARD_REF_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112;
|
|
46
|
-
var REACT_SUSPENSE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113;
|
|
47
|
-
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120;
|
|
48
|
-
var REACT_MEMO_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.memo") : 60115;
|
|
49
|
-
var REACT_LAZY_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116;
|
|
50
|
-
var REACT_BLOCK_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.block") : 60121;
|
|
51
|
-
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117;
|
|
52
|
-
var REACT_RESPONDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.responder") : 60118;
|
|
53
|
-
var REACT_SCOPE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
|
|
54
|
-
function isValidElementType(type) {
|
|
55
|
-
return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
56
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
57
|
-
}
|
|
58
|
-
function typeOf(object) {
|
|
59
|
-
if (typeof object === "object" && object !== null) {
|
|
60
|
-
var $$typeof = object.$$typeof;
|
|
61
|
-
switch ($$typeof) {
|
|
62
|
-
case REACT_ELEMENT_TYPE:
|
|
63
|
-
var type = object.type;
|
|
64
|
-
switch (type) {
|
|
65
|
-
case REACT_ASYNC_MODE_TYPE:
|
|
66
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
67
|
-
case REACT_FRAGMENT_TYPE:
|
|
68
|
-
case REACT_PROFILER_TYPE:
|
|
69
|
-
case REACT_STRICT_MODE_TYPE:
|
|
70
|
-
case REACT_SUSPENSE_TYPE:
|
|
71
|
-
return type;
|
|
72
|
-
default:
|
|
73
|
-
var $$typeofType = type && type.$$typeof;
|
|
74
|
-
switch ($$typeofType) {
|
|
75
|
-
case REACT_CONTEXT_TYPE:
|
|
76
|
-
case REACT_FORWARD_REF_TYPE:
|
|
77
|
-
case REACT_LAZY_TYPE:
|
|
78
|
-
case REACT_MEMO_TYPE:
|
|
79
|
-
case REACT_PROVIDER_TYPE:
|
|
80
|
-
return $$typeofType;
|
|
81
|
-
default:
|
|
82
|
-
return $$typeof;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
case REACT_PORTAL_TYPE:
|
|
86
|
-
return $$typeof;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return void 0;
|
|
90
|
-
}
|
|
91
|
-
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
92
|
-
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
93
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
94
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
95
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
96
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
97
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
98
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
99
|
-
var Memo = REACT_MEMO_TYPE;
|
|
100
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
101
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
102
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
103
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
104
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
105
|
-
function isAsyncMode(object) {
|
|
106
|
-
{
|
|
107
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
108
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
109
|
-
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
113
|
-
}
|
|
114
|
-
function isConcurrentMode(object) {
|
|
115
|
-
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
116
|
-
}
|
|
117
|
-
function isContextConsumer(object) {
|
|
118
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
119
|
-
}
|
|
120
|
-
function isContextProvider(object) {
|
|
121
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
122
|
-
}
|
|
123
|
-
function isElement(object) {
|
|
124
|
-
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
125
|
-
}
|
|
126
|
-
function isForwardRef(object) {
|
|
127
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
128
|
-
}
|
|
129
|
-
function isFragment(object) {
|
|
130
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
131
|
-
}
|
|
132
|
-
function isLazy(object) {
|
|
133
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
134
|
-
}
|
|
135
|
-
function isMemo(object) {
|
|
136
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
137
|
-
}
|
|
138
|
-
function isPortal(object) {
|
|
139
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
140
|
-
}
|
|
141
|
-
function isProfiler(object) {
|
|
142
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
143
|
-
}
|
|
144
|
-
function isStrictMode(object) {
|
|
145
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
146
|
-
}
|
|
147
|
-
function isSuspense(object) {
|
|
148
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
149
|
-
}
|
|
150
|
-
exports.AsyncMode = AsyncMode;
|
|
151
|
-
exports.ConcurrentMode = ConcurrentMode;
|
|
152
|
-
exports.ContextConsumer = ContextConsumer;
|
|
153
|
-
exports.ContextProvider = ContextProvider;
|
|
154
|
-
exports.Element = Element;
|
|
155
|
-
exports.ForwardRef = ForwardRef;
|
|
156
|
-
exports.Fragment = Fragment;
|
|
157
|
-
exports.Lazy = Lazy;
|
|
158
|
-
exports.Memo = Memo;
|
|
159
|
-
exports.Portal = Portal;
|
|
160
|
-
exports.Profiler = Profiler;
|
|
161
|
-
exports.StrictMode = StrictMode;
|
|
162
|
-
exports.Suspense = Suspense;
|
|
163
|
-
exports.isAsyncMode = isAsyncMode;
|
|
164
|
-
exports.isConcurrentMode = isConcurrentMode;
|
|
165
|
-
exports.isContextConsumer = isContextConsumer;
|
|
166
|
-
exports.isContextProvider = isContextProvider;
|
|
167
|
-
exports.isElement = isElement;
|
|
168
|
-
exports.isForwardRef = isForwardRef;
|
|
169
|
-
exports.isFragment = isFragment;
|
|
170
|
-
exports.isLazy = isLazy;
|
|
171
|
-
exports.isMemo = isMemo;
|
|
172
|
-
exports.isPortal = isPortal;
|
|
173
|
-
exports.isProfiler = isProfiler;
|
|
174
|
-
exports.isStrictMode = isStrictMode;
|
|
175
|
-
exports.isSuspense = isSuspense;
|
|
176
|
-
exports.isValidElementType = isValidElementType;
|
|
177
|
-
exports.typeOf = typeOf;
|
|
178
|
-
})();
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
// ../../node_modules/prop-types/node_modules/react-is/index.js
|
|
184
|
-
var require_react_is = __commonJS({
|
|
185
|
-
"../../node_modules/prop-types/node_modules/react-is/index.js"(exports, module) {
|
|
186
|
-
"use strict";
|
|
187
|
-
init_define_process_env();
|
|
188
|
-
if (false) {
|
|
189
|
-
module.exports = null;
|
|
190
|
-
} else {
|
|
191
|
-
module.exports = require_react_is_development();
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
// ../../node_modules/object-assign/index.js
|
|
197
|
-
var require_object_assign = __commonJS({
|
|
198
|
-
"../../node_modules/object-assign/index.js"(exports, module) {
|
|
199
|
-
"use strict";
|
|
200
|
-
init_define_process_env();
|
|
201
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
202
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
203
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
204
|
-
function toObject(val) {
|
|
205
|
-
if (val === null || val === void 0) {
|
|
206
|
-
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
207
|
-
}
|
|
208
|
-
return Object(val);
|
|
209
|
-
}
|
|
210
|
-
function shouldUseNative() {
|
|
211
|
-
try {
|
|
212
|
-
if (!Object.assign) {
|
|
213
|
-
return false;
|
|
214
|
-
}
|
|
215
|
-
var test1 = new String("abc");
|
|
216
|
-
test1[5] = "de";
|
|
217
|
-
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
218
|
-
return false;
|
|
219
|
-
}
|
|
220
|
-
var test2 = {};
|
|
221
|
-
for (var i = 0; i < 10; i++) {
|
|
222
|
-
test2["_" + String.fromCharCode(i)] = i;
|
|
223
|
-
}
|
|
224
|
-
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
|
|
225
|
-
return test2[n];
|
|
226
|
-
});
|
|
227
|
-
if (order2.join("") !== "0123456789") {
|
|
228
|
-
return false;
|
|
229
|
-
}
|
|
230
|
-
var test3 = {};
|
|
231
|
-
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
232
|
-
test3[letter] = letter;
|
|
233
|
-
});
|
|
234
|
-
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
235
|
-
return false;
|
|
236
|
-
}
|
|
237
|
-
return true;
|
|
238
|
-
} catch (err) {
|
|
239
|
-
return false;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
module.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
|
243
|
-
var from;
|
|
244
|
-
var to = toObject(target);
|
|
245
|
-
var symbols;
|
|
246
|
-
for (var s = 1; s < arguments.length; s++) {
|
|
247
|
-
from = Object(arguments[s]);
|
|
248
|
-
for (var key in from) {
|
|
249
|
-
if (hasOwnProperty.call(from, key)) {
|
|
250
|
-
to[key] = from[key];
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
if (getOwnPropertySymbols) {
|
|
254
|
-
symbols = getOwnPropertySymbols(from);
|
|
255
|
-
for (var i = 0; i < symbols.length; i++) {
|
|
256
|
-
if (propIsEnumerable.call(from, symbols[i])) {
|
|
257
|
-
to[symbols[i]] = from[symbols[i]];
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
return to;
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
// ../../node_modules/prop-types/lib/ReactPropTypesSecret.js
|
|
268
|
-
var require_ReactPropTypesSecret = __commonJS({
|
|
269
|
-
"../../node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) {
|
|
270
|
-
"use strict";
|
|
271
|
-
init_define_process_env();
|
|
272
|
-
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
273
|
-
module.exports = ReactPropTypesSecret;
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
// ../../node_modules/prop-types/lib/has.js
|
|
278
|
-
var require_has = __commonJS({
|
|
279
|
-
"../../node_modules/prop-types/lib/has.js"(exports, module) {
|
|
280
|
-
init_define_process_env();
|
|
281
|
-
module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
// ../../node_modules/prop-types/checkPropTypes.js
|
|
286
|
-
var require_checkPropTypes = __commonJS({
|
|
287
|
-
"../../node_modules/prop-types/checkPropTypes.js"(exports, module) {
|
|
288
|
-
"use strict";
|
|
289
|
-
init_define_process_env();
|
|
290
|
-
var printWarning = function() {
|
|
291
|
-
};
|
|
292
|
-
if (true) {
|
|
293
|
-
ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
294
|
-
loggedTypeFailures = {};
|
|
295
|
-
has = require_has();
|
|
296
|
-
printWarning = function(text) {
|
|
297
|
-
var message = "Warning: " + text;
|
|
298
|
-
if (typeof console !== "undefined") {
|
|
299
|
-
console.error(message);
|
|
300
|
-
}
|
|
301
|
-
try {
|
|
302
|
-
throw new Error(message);
|
|
303
|
-
} catch (x) {
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
var ReactPropTypesSecret;
|
|
308
|
-
var loggedTypeFailures;
|
|
309
|
-
var has;
|
|
310
|
-
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
311
|
-
if (true) {
|
|
312
|
-
for (var typeSpecName in typeSpecs) {
|
|
313
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
314
|
-
var error;
|
|
315
|
-
try {
|
|
316
|
-
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
317
|
-
var err = Error(
|
|
318
|
-
(componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
319
|
-
);
|
|
320
|
-
err.name = "Invariant Violation";
|
|
321
|
-
throw err;
|
|
322
|
-
}
|
|
323
|
-
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
324
|
-
} catch (ex) {
|
|
325
|
-
error = ex;
|
|
326
|
-
}
|
|
327
|
-
if (error && !(error instanceof Error)) {
|
|
328
|
-
printWarning(
|
|
329
|
-
(componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
330
|
-
);
|
|
331
|
-
}
|
|
332
|
-
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
333
|
-
loggedTypeFailures[error.message] = true;
|
|
334
|
-
var stack = getStack ? getStack() : "";
|
|
335
|
-
printWarning(
|
|
336
|
-
"Failed " + location + " type: " + error.message + (stack != null ? stack : "")
|
|
337
|
-
);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
checkPropTypes.resetWarningCache = function() {
|
|
344
|
-
if (true) {
|
|
345
|
-
loggedTypeFailures = {};
|
|
346
|
-
}
|
|
347
|
-
};
|
|
348
|
-
module.exports = checkPropTypes;
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
// ../../node_modules/prop-types/factoryWithTypeCheckers.js
|
|
353
|
-
var require_factoryWithTypeCheckers = __commonJS({
|
|
354
|
-
"../../node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) {
|
|
355
|
-
"use strict";
|
|
356
|
-
init_define_process_env();
|
|
357
|
-
var ReactIs = require_react_is();
|
|
358
|
-
var assign = require_object_assign();
|
|
359
|
-
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
360
|
-
var has = require_has();
|
|
361
|
-
var checkPropTypes = require_checkPropTypes();
|
|
362
|
-
var printWarning = function() {
|
|
363
|
-
};
|
|
364
|
-
if (true) {
|
|
365
|
-
printWarning = function(text) {
|
|
366
|
-
var message = "Warning: " + text;
|
|
367
|
-
if (typeof console !== "undefined") {
|
|
368
|
-
console.error(message);
|
|
369
|
-
}
|
|
370
|
-
try {
|
|
371
|
-
throw new Error(message);
|
|
372
|
-
} catch (x) {
|
|
373
|
-
}
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
function emptyFunctionThatReturnsNull() {
|
|
377
|
-
return null;
|
|
378
|
-
}
|
|
379
|
-
module.exports = function(isValidElement, throwOnDirectAccess) {
|
|
380
|
-
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
381
|
-
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
382
|
-
function getIteratorFn(maybeIterable) {
|
|
383
|
-
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
384
|
-
if (typeof iteratorFn === "function") {
|
|
385
|
-
return iteratorFn;
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
var ANONYMOUS = "<<anonymous>>";
|
|
389
|
-
var ReactPropTypes = {
|
|
390
|
-
array: createPrimitiveTypeChecker("array"),
|
|
391
|
-
bigint: createPrimitiveTypeChecker("bigint"),
|
|
392
|
-
bool: createPrimitiveTypeChecker("boolean"),
|
|
393
|
-
func: createPrimitiveTypeChecker("function"),
|
|
394
|
-
number: createPrimitiveTypeChecker("number"),
|
|
395
|
-
object: createPrimitiveTypeChecker("object"),
|
|
396
|
-
string: createPrimitiveTypeChecker("string"),
|
|
397
|
-
symbol: createPrimitiveTypeChecker("symbol"),
|
|
398
|
-
any: createAnyTypeChecker(),
|
|
399
|
-
arrayOf: createArrayOfTypeChecker,
|
|
400
|
-
element: createElementTypeChecker(),
|
|
401
|
-
elementType: createElementTypeTypeChecker(),
|
|
402
|
-
instanceOf: createInstanceTypeChecker,
|
|
403
|
-
node: createNodeChecker(),
|
|
404
|
-
objectOf: createObjectOfTypeChecker,
|
|
405
|
-
oneOf: createEnumTypeChecker,
|
|
406
|
-
oneOfType: createUnionTypeChecker,
|
|
407
|
-
shape: createShapeTypeChecker,
|
|
408
|
-
exact: createStrictShapeTypeChecker
|
|
409
|
-
};
|
|
410
|
-
function is(x, y) {
|
|
411
|
-
if (x === y) {
|
|
412
|
-
return x !== 0 || 1 / x === 1 / y;
|
|
413
|
-
} else {
|
|
414
|
-
return x !== x && y !== y;
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
function PropTypeError(message, data) {
|
|
418
|
-
this.message = message;
|
|
419
|
-
this.data = data && typeof data === "object" ? data : {};
|
|
420
|
-
this.stack = "";
|
|
421
|
-
}
|
|
422
|
-
PropTypeError.prototype = Error.prototype;
|
|
423
|
-
function createChainableTypeChecker(validate) {
|
|
424
|
-
if (true) {
|
|
425
|
-
var manualPropTypeCallCache = {};
|
|
426
|
-
var manualPropTypeWarningCount = 0;
|
|
427
|
-
}
|
|
428
|
-
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
429
|
-
componentName = componentName || ANONYMOUS;
|
|
430
|
-
propFullName = propFullName || propName;
|
|
431
|
-
if (secret !== ReactPropTypesSecret) {
|
|
432
|
-
if (throwOnDirectAccess) {
|
|
433
|
-
var err = new Error(
|
|
434
|
-
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
435
|
-
);
|
|
436
|
-
err.name = "Invariant Violation";
|
|
437
|
-
throw err;
|
|
438
|
-
} else if (typeof console !== "undefined") {
|
|
439
|
-
var cacheKey = componentName + ":" + propName;
|
|
440
|
-
if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
441
|
-
manualPropTypeWarningCount < 3) {
|
|
442
|
-
printWarning(
|
|
443
|
-
"You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
444
|
-
);
|
|
445
|
-
manualPropTypeCallCache[cacheKey] = true;
|
|
446
|
-
manualPropTypeWarningCount++;
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
if (props[propName] == null) {
|
|
451
|
-
if (isRequired) {
|
|
452
|
-
if (props[propName] === null) {
|
|
453
|
-
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
|
|
454
|
-
}
|
|
455
|
-
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
|
|
456
|
-
}
|
|
457
|
-
return null;
|
|
458
|
-
} else {
|
|
459
|
-
return validate(props, propName, componentName, location, propFullName);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
var chainedCheckType = checkType.bind(null, false);
|
|
463
|
-
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
464
|
-
return chainedCheckType;
|
|
465
|
-
}
|
|
466
|
-
function createPrimitiveTypeChecker(expectedType) {
|
|
467
|
-
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
468
|
-
var propValue = props[propName];
|
|
469
|
-
var propType = getPropType(propValue);
|
|
470
|
-
if (propType !== expectedType) {
|
|
471
|
-
var preciseType = getPreciseType(propValue);
|
|
472
|
-
return new PropTypeError(
|
|
473
|
-
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
|
|
474
|
-
{ expectedType }
|
|
475
|
-
);
|
|
476
|
-
}
|
|
477
|
-
return null;
|
|
478
|
-
}
|
|
479
|
-
return createChainableTypeChecker(validate);
|
|
480
|
-
}
|
|
481
|
-
function createAnyTypeChecker() {
|
|
482
|
-
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
483
|
-
}
|
|
484
|
-
function createArrayOfTypeChecker(typeChecker) {
|
|
485
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
486
|
-
if (typeof typeChecker !== "function") {
|
|
487
|
-
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
|
488
|
-
}
|
|
489
|
-
var propValue = props[propName];
|
|
490
|
-
if (!Array.isArray(propValue)) {
|
|
491
|
-
var propType = getPropType(propValue);
|
|
492
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
|
|
493
|
-
}
|
|
494
|
-
for (var i = 0; i < propValue.length; i++) {
|
|
495
|
-
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
|
|
496
|
-
if (error instanceof Error) {
|
|
497
|
-
return error;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
return null;
|
|
501
|
-
}
|
|
502
|
-
return createChainableTypeChecker(validate);
|
|
503
|
-
}
|
|
504
|
-
function createElementTypeChecker() {
|
|
505
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
506
|
-
var propValue = props[propName];
|
|
507
|
-
if (!isValidElement(propValue)) {
|
|
508
|
-
var propType = getPropType(propValue);
|
|
509
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
510
|
-
}
|
|
511
|
-
return null;
|
|
512
|
-
}
|
|
513
|
-
return createChainableTypeChecker(validate);
|
|
514
|
-
}
|
|
515
|
-
function createElementTypeTypeChecker() {
|
|
516
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
517
|
-
var propValue = props[propName];
|
|
518
|
-
if (!ReactIs.isValidElementType(propValue)) {
|
|
519
|
-
var propType = getPropType(propValue);
|
|
520
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
|
|
521
|
-
}
|
|
522
|
-
return null;
|
|
523
|
-
}
|
|
524
|
-
return createChainableTypeChecker(validate);
|
|
525
|
-
}
|
|
526
|
-
function createInstanceTypeChecker(expectedClass) {
|
|
527
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
528
|
-
if (!(props[propName] instanceof expectedClass)) {
|
|
529
|
-
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
530
|
-
var actualClassName = getClassName(props[propName]);
|
|
531
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
532
|
-
}
|
|
533
|
-
return null;
|
|
534
|
-
}
|
|
535
|
-
return createChainableTypeChecker(validate);
|
|
536
|
-
}
|
|
537
|
-
function createEnumTypeChecker(expectedValues) {
|
|
538
|
-
if (!Array.isArray(expectedValues)) {
|
|
539
|
-
if (true) {
|
|
540
|
-
if (arguments.length > 1) {
|
|
541
|
-
printWarning(
|
|
542
|
-
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
543
|
-
);
|
|
544
|
-
} else {
|
|
545
|
-
printWarning("Invalid argument supplied to oneOf, expected an array.");
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
return emptyFunctionThatReturnsNull;
|
|
549
|
-
}
|
|
550
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
551
|
-
var propValue = props[propName];
|
|
552
|
-
for (var i = 0; i < expectedValues.length; i++) {
|
|
553
|
-
if (is(propValue, expectedValues[i])) {
|
|
554
|
-
return null;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
558
|
-
var type = getPreciseType(value);
|
|
559
|
-
if (type === "symbol") {
|
|
560
|
-
return String(value);
|
|
561
|
-
}
|
|
562
|
-
return value;
|
|
563
|
-
});
|
|
564
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
|
565
|
-
}
|
|
566
|
-
return createChainableTypeChecker(validate);
|
|
567
|
-
}
|
|
568
|
-
function createObjectOfTypeChecker(typeChecker) {
|
|
569
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
570
|
-
if (typeof typeChecker !== "function") {
|
|
571
|
-
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
|
572
|
-
}
|
|
573
|
-
var propValue = props[propName];
|
|
574
|
-
var propType = getPropType(propValue);
|
|
575
|
-
if (propType !== "object") {
|
|
576
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
|
|
577
|
-
}
|
|
578
|
-
for (var key in propValue) {
|
|
579
|
-
if (has(propValue, key)) {
|
|
580
|
-
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
581
|
-
if (error instanceof Error) {
|
|
582
|
-
return error;
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
return null;
|
|
587
|
-
}
|
|
588
|
-
return createChainableTypeChecker(validate);
|
|
589
|
-
}
|
|
590
|
-
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
591
|
-
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
592
|
-
true ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
|
|
593
|
-
return emptyFunctionThatReturnsNull;
|
|
594
|
-
}
|
|
595
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
596
|
-
var checker = arrayOfTypeCheckers[i];
|
|
597
|
-
if (typeof checker !== "function") {
|
|
598
|
-
printWarning(
|
|
599
|
-
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
|
|
600
|
-
);
|
|
601
|
-
return emptyFunctionThatReturnsNull;
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
605
|
-
var expectedTypes = [];
|
|
606
|
-
for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
|
|
607
|
-
var checker2 = arrayOfTypeCheckers[i2];
|
|
608
|
-
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
609
|
-
if (checkerResult == null) {
|
|
610
|
-
return null;
|
|
611
|
-
}
|
|
612
|
-
if (checkerResult.data && has(checkerResult.data, "expectedType")) {
|
|
613
|
-
expectedTypes.push(checkerResult.data.expectedType);
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
|
617
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
|
618
|
-
}
|
|
619
|
-
return createChainableTypeChecker(validate);
|
|
620
|
-
}
|
|
621
|
-
function createNodeChecker() {
|
|
622
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
623
|
-
if (!isNode(props[propName])) {
|
|
624
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
|
625
|
-
}
|
|
626
|
-
return null;
|
|
627
|
-
}
|
|
628
|
-
return createChainableTypeChecker(validate);
|
|
629
|
-
}
|
|
630
|
-
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
631
|
-
return new PropTypeError(
|
|
632
|
-
(componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
|
|
633
|
-
);
|
|
634
|
-
}
|
|
635
|
-
function createShapeTypeChecker(shapeTypes) {
|
|
636
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
637
|
-
var propValue = props[propName];
|
|
638
|
-
var propType = getPropType(propValue);
|
|
639
|
-
if (propType !== "object") {
|
|
640
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
641
|
-
}
|
|
642
|
-
for (var key in shapeTypes) {
|
|
643
|
-
var checker = shapeTypes[key];
|
|
644
|
-
if (typeof checker !== "function") {
|
|
645
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
646
|
-
}
|
|
647
|
-
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
648
|
-
if (error) {
|
|
649
|
-
return error;
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
return null;
|
|
653
|
-
}
|
|
654
|
-
return createChainableTypeChecker(validate);
|
|
655
|
-
}
|
|
656
|
-
function createStrictShapeTypeChecker(shapeTypes) {
|
|
657
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
658
|
-
var propValue = props[propName];
|
|
659
|
-
var propType = getPropType(propValue);
|
|
660
|
-
if (propType !== "object") {
|
|
661
|
-
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
662
|
-
}
|
|
663
|
-
var allKeys = assign({}, props[propName], shapeTypes);
|
|
664
|
-
for (var key in allKeys) {
|
|
665
|
-
var checker = shapeTypes[key];
|
|
666
|
-
if (has(shapeTypes, key) && typeof checker !== "function") {
|
|
667
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
668
|
-
}
|
|
669
|
-
if (!checker) {
|
|
670
|
-
return new PropTypeError(
|
|
671
|
-
"Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
|
|
672
|
-
);
|
|
673
|
-
}
|
|
674
|
-
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
675
|
-
if (error) {
|
|
676
|
-
return error;
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
return null;
|
|
680
|
-
}
|
|
681
|
-
return createChainableTypeChecker(validate);
|
|
682
|
-
}
|
|
683
|
-
function isNode(propValue) {
|
|
684
|
-
switch (typeof propValue) {
|
|
685
|
-
case "number":
|
|
686
|
-
case "string":
|
|
687
|
-
case "undefined":
|
|
688
|
-
return true;
|
|
689
|
-
case "boolean":
|
|
690
|
-
return !propValue;
|
|
691
|
-
case "object":
|
|
692
|
-
if (Array.isArray(propValue)) {
|
|
693
|
-
return propValue.every(isNode);
|
|
694
|
-
}
|
|
695
|
-
if (propValue === null || isValidElement(propValue)) {
|
|
696
|
-
return true;
|
|
697
|
-
}
|
|
698
|
-
var iteratorFn = getIteratorFn(propValue);
|
|
699
|
-
if (iteratorFn) {
|
|
700
|
-
var iterator = iteratorFn.call(propValue);
|
|
701
|
-
var step;
|
|
702
|
-
if (iteratorFn !== propValue.entries) {
|
|
703
|
-
while (!(step = iterator.next()).done) {
|
|
704
|
-
if (!isNode(step.value)) {
|
|
705
|
-
return false;
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
} else {
|
|
709
|
-
while (!(step = iterator.next()).done) {
|
|
710
|
-
var entry = step.value;
|
|
711
|
-
if (entry) {
|
|
712
|
-
if (!isNode(entry[1])) {
|
|
713
|
-
return false;
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
} else {
|
|
719
|
-
return false;
|
|
720
|
-
}
|
|
721
|
-
return true;
|
|
722
|
-
default:
|
|
723
|
-
return false;
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
function isSymbol(propType, propValue) {
|
|
727
|
-
if (propType === "symbol") {
|
|
728
|
-
return true;
|
|
729
|
-
}
|
|
730
|
-
if (!propValue) {
|
|
731
|
-
return false;
|
|
732
|
-
}
|
|
733
|
-
if (propValue["@@toStringTag"] === "Symbol") {
|
|
734
|
-
return true;
|
|
735
|
-
}
|
|
736
|
-
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
|
737
|
-
return true;
|
|
738
|
-
}
|
|
739
|
-
return false;
|
|
740
|
-
}
|
|
741
|
-
function getPropType(propValue) {
|
|
742
|
-
var propType = typeof propValue;
|
|
743
|
-
if (Array.isArray(propValue)) {
|
|
744
|
-
return "array";
|
|
745
|
-
}
|
|
746
|
-
if (propValue instanceof RegExp) {
|
|
747
|
-
return "object";
|
|
748
|
-
}
|
|
749
|
-
if (isSymbol(propType, propValue)) {
|
|
750
|
-
return "symbol";
|
|
751
|
-
}
|
|
752
|
-
return propType;
|
|
753
|
-
}
|
|
754
|
-
function getPreciseType(propValue) {
|
|
755
|
-
if (typeof propValue === "undefined" || propValue === null) {
|
|
756
|
-
return "" + propValue;
|
|
757
|
-
}
|
|
758
|
-
var propType = getPropType(propValue);
|
|
759
|
-
if (propType === "object") {
|
|
760
|
-
if (propValue instanceof Date) {
|
|
761
|
-
return "date";
|
|
762
|
-
} else if (propValue instanceof RegExp) {
|
|
763
|
-
return "regexp";
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
return propType;
|
|
767
|
-
}
|
|
768
|
-
function getPostfixForTypeWarning(value) {
|
|
769
|
-
var type = getPreciseType(value);
|
|
770
|
-
switch (type) {
|
|
771
|
-
case "array":
|
|
772
|
-
case "object":
|
|
773
|
-
return "an " + type;
|
|
774
|
-
case "boolean":
|
|
775
|
-
case "date":
|
|
776
|
-
case "regexp":
|
|
777
|
-
return "a " + type;
|
|
778
|
-
default:
|
|
779
|
-
return type;
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
function getClassName(propValue) {
|
|
783
|
-
if (!propValue.constructor || !propValue.constructor.name) {
|
|
784
|
-
return ANONYMOUS;
|
|
785
|
-
}
|
|
786
|
-
return propValue.constructor.name;
|
|
787
|
-
}
|
|
788
|
-
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
789
|
-
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
790
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
791
|
-
return ReactPropTypes;
|
|
792
|
-
};
|
|
793
|
-
}
|
|
794
|
-
});
|
|
795
|
-
|
|
796
|
-
// ../../node_modules/prop-types/index.js
|
|
797
|
-
var require_prop_types = __commonJS({
|
|
798
|
-
"../../node_modules/prop-types/index.js"(exports, module) {
|
|
799
|
-
init_define_process_env();
|
|
800
|
-
if (true) {
|
|
801
|
-
ReactIs = require_react_is();
|
|
802
|
-
throwOnDirectAccess = true;
|
|
803
|
-
module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
804
|
-
} else {
|
|
805
|
-
module.exports = null();
|
|
806
|
-
}
|
|
807
|
-
var ReactIs;
|
|
808
|
-
var throwOnDirectAccess;
|
|
809
|
-
}
|
|
810
|
-
});
|
|
811
|
-
|
|
812
|
-
// src/Diagnostics/Diagnostics.tsx
|
|
813
|
-
init_define_process_env();
|
|
814
|
-
import React8, { useCallback as useCallback2, useRef as useRef2, useState as useState6 } from "react";
|
|
815
|
-
import { HMSRoomProvider, useHMSActions as useHMSActions2 } from "@100mslive/react-sdk";
|
|
816
|
-
import {
|
|
817
|
-
CheckCircleIcon as CheckCircleIcon2,
|
|
818
|
-
ConnectivityIcon,
|
|
819
|
-
CrossCircleIcon as CrossCircleIcon2,
|
|
820
|
-
GlobeIcon,
|
|
821
|
-
MicOnIcon as MicOnIcon2,
|
|
822
|
-
VideoOnIcon as VideoOnIcon2
|
|
823
|
-
} from "@100mslive/react-icons";
|
|
824
|
-
|
|
825
|
-
// src/Diagnostics/AudioTest.tsx
|
|
826
|
-
init_define_process_env();
|
|
827
|
-
import React4, { useCallback, useEffect, useState as useState2 } from "react";
|
|
828
|
-
import {
|
|
829
|
-
selectDevices,
|
|
830
|
-
selectLocalAudioTrackID,
|
|
831
|
-
selectLocalMediaSettings,
|
|
832
|
-
selectTrackAudioByID,
|
|
833
|
-
useHMSActions,
|
|
834
|
-
useHMSStore
|
|
835
|
-
} from "@100mslive/react-sdk";
|
|
836
|
-
import { MicOnIcon, SpeakerIcon, StopIcon } from "@100mslive/react-icons";
|
|
837
|
-
|
|
838
|
-
// src/Diagnostics/components.tsx
|
|
839
|
-
init_define_process_env();
|
|
840
|
-
import React2 from "react";
|
|
841
|
-
|
|
842
|
-
// src/Diagnostics/DiagnosticsContext.ts
|
|
843
|
-
init_define_process_env();
|
|
844
|
-
import React, { useContext } from "react";
|
|
845
|
-
var DiagnosticsStep = /* @__PURE__ */ ((DiagnosticsStep2) => {
|
|
846
|
-
DiagnosticsStep2[DiagnosticsStep2["BROWSER"] = 0] = "BROWSER";
|
|
847
|
-
DiagnosticsStep2[DiagnosticsStep2["VIDEO"] = 1] = "VIDEO";
|
|
848
|
-
DiagnosticsStep2[DiagnosticsStep2["AUDIO"] = 2] = "AUDIO";
|
|
849
|
-
DiagnosticsStep2[DiagnosticsStep2["CONNECTIVITY"] = 3] = "CONNECTIVITY";
|
|
850
|
-
return DiagnosticsStep2;
|
|
851
|
-
})(DiagnosticsStep || {});
|
|
852
|
-
var initialSteps = {
|
|
853
|
-
[0 /* BROWSER */]: { name: "Browser Support" },
|
|
854
|
-
[1 /* VIDEO */]: { name: "Test Video" },
|
|
855
|
-
[2 /* AUDIO */]: { name: "Test Audio" },
|
|
856
|
-
[3 /* CONNECTIVITY */]: { name: "Connection Quality" }
|
|
857
|
-
};
|
|
858
|
-
var DiagnosticsContext = React.createContext({
|
|
859
|
-
activeStepIndex: 0,
|
|
860
|
-
setActiveStep: () => {
|
|
861
|
-
return;
|
|
862
|
-
},
|
|
863
|
-
steps: initialSteps,
|
|
864
|
-
updateStep: () => {
|
|
865
|
-
return;
|
|
866
|
-
}
|
|
867
|
-
});
|
|
868
|
-
var useDiagnostics = () => {
|
|
869
|
-
const context = useContext(DiagnosticsContext);
|
|
870
|
-
const activeStep = context.steps[context.activeStepIndex];
|
|
871
|
-
return __spreadProps(__spreadValues({}, context), { activeStep });
|
|
872
|
-
};
|
|
873
|
-
|
|
874
|
-
// src/Diagnostics/components.tsx
|
|
875
|
-
var TestContainer = ({ css, children }) => {
|
|
876
|
-
return /* @__PURE__ */ React2.createElement(Box, { css: __spreadValues({ p: "$10" }, css) }, children);
|
|
877
|
-
};
|
|
878
|
-
var TestFooter = ({
|
|
879
|
-
error,
|
|
880
|
-
ctaText,
|
|
881
|
-
children
|
|
882
|
-
}) => {
|
|
883
|
-
const { hmsDiagnostics, activeStepIndex: activeStep, setActiveStep } = useDiagnostics();
|
|
884
|
-
const onNextStep = () => {
|
|
885
|
-
if (activeStep === 2 /* AUDIO */) {
|
|
886
|
-
hmsDiagnostics == null ? void 0 : hmsDiagnostics.stopMicCheck();
|
|
887
|
-
} else if (activeStep === 1 /* VIDEO */) {
|
|
888
|
-
hmsDiagnostics == null ? void 0 : hmsDiagnostics.stopCameraCheck();
|
|
889
|
-
} else if (activeStep === 3 /* CONNECTIVITY */) {
|
|
890
|
-
hmsDiagnostics == null ? void 0 : hmsDiagnostics.stopConnectivityCheck();
|
|
891
|
-
}
|
|
892
|
-
setActiveStep((step) => step + 1);
|
|
893
|
-
};
|
|
894
|
-
return /* @__PURE__ */ React2.createElement(
|
|
895
|
-
Flex,
|
|
896
|
-
{
|
|
897
|
-
css: {
|
|
898
|
-
py: "$8",
|
|
899
|
-
px: "$10",
|
|
900
|
-
background: "$background_dim",
|
|
901
|
-
justifyContent: "space-between",
|
|
902
|
-
alignItems: "center",
|
|
903
|
-
borderTop: "1px solid $border_default",
|
|
904
|
-
fontSize: "$sm",
|
|
905
|
-
borderBottomLeftRadius: "$1",
|
|
906
|
-
borderBottomRightRadius: "$1",
|
|
907
|
-
lineHeight: "$sm",
|
|
908
|
-
zIndex: 1001,
|
|
909
|
-
"@lg": { flexDirection: "column", gap: "$8" }
|
|
910
|
-
}
|
|
911
|
-
},
|
|
912
|
-
/* @__PURE__ */ React2.createElement(Box, null, error && /* @__PURE__ */ React2.createElement(Text, { css: { c: "$alert_error_default" } }, "Error: ", error.message)),
|
|
913
|
-
children ? children : /* @__PURE__ */ React2.createElement(Flex, { align: "center", css: { gap: "$8", "@lg": { flexDirection: "column" } } }, /* @__PURE__ */ React2.createElement(Text, { css: { c: "$on_primary_medium" } }, ctaText), /* @__PURE__ */ React2.createElement(Flex, { align: "center", gap: "4" }, /* @__PURE__ */ React2.createElement(Button, { onClick: onNextStep, variant: "standard", outlined: true }, "Skip"), /* @__PURE__ */ React2.createElement(Button, { disabled: !!error, onClick: onNextStep }, "Yes")))
|
|
914
|
-
);
|
|
915
|
-
};
|
|
916
|
-
|
|
917
|
-
// src/Diagnostics/DeviceSelector.jsx
|
|
918
|
-
init_define_process_env();
|
|
919
|
-
var import_prop_types = __toESM(require_prop_types());
|
|
920
|
-
import React3, { useRef, useState } from "react";
|
|
921
|
-
var DeviceSelector = ({ title, devices, selection, onChange, icon, children = null }) => {
|
|
922
|
-
var _a, _b;
|
|
923
|
-
const [open, setOpen] = useState(false);
|
|
924
|
-
const ref = useRef(null);
|
|
925
|
-
return /* @__PURE__ */ React3.createElement(Box, { css: { mb: "$6" } }, /* @__PURE__ */ React3.createElement(Text, { css: { mb: "$4" } }, title), /* @__PURE__ */ React3.createElement(
|
|
926
|
-
Flex,
|
|
927
|
-
{
|
|
928
|
-
align: "center",
|
|
929
|
-
css: {
|
|
930
|
-
gap: "$4",
|
|
931
|
-
"@md": {
|
|
932
|
-
flexDirection: children ? "column" : "row",
|
|
933
|
-
alignItems: children ? "start" : "center"
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
},
|
|
937
|
-
/* @__PURE__ */ React3.createElement(Dropdown.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React3.createElement(
|
|
938
|
-
DialogDropdownTrigger,
|
|
939
|
-
{
|
|
940
|
-
ref,
|
|
941
|
-
icon,
|
|
942
|
-
title: ((_a = devices.find(({ deviceId }) => deviceId === selection)) == null ? void 0 : _a.label) || "Select device from list",
|
|
943
|
-
open
|
|
944
|
-
}
|
|
945
|
-
), /* @__PURE__ */ React3.createElement(Dropdown.Portal, null, /* @__PURE__ */ React3.createElement(
|
|
946
|
-
Dropdown.Content,
|
|
947
|
-
{
|
|
948
|
-
align: "start",
|
|
949
|
-
sideOffset: 8,
|
|
950
|
-
css: {
|
|
951
|
-
w: (
|
|
952
|
-
// @ts-ignore
|
|
953
|
-
(_b = ref.current) == null ? void 0 : _b.clientWidth
|
|
954
|
-
),
|
|
955
|
-
zIndex: 1001
|
|
956
|
-
}
|
|
957
|
-
},
|
|
958
|
-
devices.map((device) => {
|
|
959
|
-
return /* @__PURE__ */ React3.createElement(
|
|
960
|
-
Dropdown.Item,
|
|
961
|
-
{
|
|
962
|
-
key: device.label,
|
|
963
|
-
onSelect: () => onChange(device.deviceId),
|
|
964
|
-
css: {
|
|
965
|
-
px: "$9"
|
|
966
|
-
}
|
|
967
|
-
},
|
|
968
|
-
device.label
|
|
969
|
-
);
|
|
970
|
-
})
|
|
971
|
-
))),
|
|
972
|
-
children
|
|
973
|
-
));
|
|
974
|
-
};
|
|
975
|
-
DeviceSelector.propTypes = {
|
|
976
|
-
title: import_prop_types.default.string.isRequired,
|
|
977
|
-
devices: import_prop_types.default.array.isRequired,
|
|
978
|
-
selection: import_prop_types.default.string,
|
|
979
|
-
onChange: import_prop_types.default.func.isRequired,
|
|
980
|
-
icon: import_prop_types.default.node,
|
|
981
|
-
children: import_prop_types.default.node
|
|
982
|
-
};
|
|
983
|
-
|
|
984
|
-
// src/Diagnostics/AudioTest.tsx
|
|
985
|
-
var SelectContainer = ({ children }) => /* @__PURE__ */ React4.createElement(Box, { css: { w: "calc(50% - 0.75rem)", "@lg": { w: "100%" } } }, children);
|
|
986
|
-
var MicTest = ({ setError }) => {
|
|
987
|
-
var _a, _b;
|
|
988
|
-
const { hmsDiagnostics } = useDiagnostics();
|
|
989
|
-
const devices = useHMSStore(selectDevices);
|
|
990
|
-
const [isRecording, setIsRecording] = useState2(false);
|
|
991
|
-
const [selectedMic, setSelectedMic] = useState2(((_a = devices.audioInput[0]) == null ? void 0 : _a.deviceId) || "default");
|
|
992
|
-
const trackID = useHMSStore(selectLocalAudioTrackID);
|
|
993
|
-
const audioLevel = useHMSStore(selectTrackAudioByID(trackID));
|
|
994
|
-
const { audioOutputDeviceId } = useHMSStore(selectLocalMediaSettings);
|
|
995
|
-
const { playing, setPlaying, audioRef } = useAudioOutputTest({
|
|
996
|
-
deviceId: audioOutputDeviceId || ((_b = devices.audioOutput[0]) == null ? void 0 : _b.deviceId)
|
|
997
|
-
});
|
|
998
|
-
return /* @__PURE__ */ React4.createElement(SelectContainer, null, /* @__PURE__ */ React4.createElement(
|
|
999
|
-
DeviceSelector,
|
|
1000
|
-
{
|
|
1001
|
-
title: "Microphone (Input)",
|
|
1002
|
-
devices: devices.audioInput,
|
|
1003
|
-
selection: selectedMic,
|
|
1004
|
-
icon: /* @__PURE__ */ React4.createElement(MicOnIcon, null),
|
|
1005
|
-
onChange: (deviceId) => {
|
|
1006
|
-
setError(void 0);
|
|
1007
|
-
setSelectedMic(deviceId);
|
|
1008
|
-
hmsDiagnostics == null ? void 0 : hmsDiagnostics.stopMicCheck();
|
|
1009
|
-
}
|
|
1010
|
-
}
|
|
1011
|
-
), /* @__PURE__ */ React4.createElement(Flex, { css: { gap: "$6", alignItems: "center" } }, /* @__PURE__ */ React4.createElement(
|
|
1012
|
-
Button,
|
|
1013
|
-
{
|
|
1014
|
-
variant: "standard",
|
|
1015
|
-
icon: true,
|
|
1016
|
-
onClick: () => {
|
|
1017
|
-
isRecording ? hmsDiagnostics == null ? void 0 : hmsDiagnostics.stopMicCheck() : hmsDiagnostics == null ? void 0 : hmsDiagnostics.startMicCheck({
|
|
1018
|
-
inputDevice: selectedMic,
|
|
1019
|
-
onError: (err) => {
|
|
1020
|
-
setError(err);
|
|
1021
|
-
},
|
|
1022
|
-
onStop: () => {
|
|
1023
|
-
setIsRecording(false);
|
|
1024
|
-
}
|
|
1025
|
-
}).then(() => {
|
|
1026
|
-
setIsRecording(true);
|
|
1027
|
-
});
|
|
1028
|
-
},
|
|
1029
|
-
disabled: devices.audioInput.length === 0 || playing
|
|
1030
|
-
},
|
|
1031
|
-
isRecording ? /* @__PURE__ */ React4.createElement(StopIcon, null) : /* @__PURE__ */ React4.createElement(MicOnIcon, null),
|
|
1032
|
-
isRecording ? "Stop Recording" : "Record"
|
|
1033
|
-
), /* @__PURE__ */ React4.createElement(
|
|
1034
|
-
Button,
|
|
1035
|
-
{
|
|
1036
|
-
icon: true,
|
|
1037
|
-
variant: "standard",
|
|
1038
|
-
outlined: (hmsDiagnostics == null ? void 0 : hmsDiagnostics.getRecordedAudio()) === TEST_AUDIO_URL,
|
|
1039
|
-
onClick: () => {
|
|
1040
|
-
if (audioRef.current) {
|
|
1041
|
-
audioRef.current.src = (hmsDiagnostics == null ? void 0 : hmsDiagnostics.getRecordedAudio()) || "";
|
|
1042
|
-
audioRef.current.play();
|
|
1043
|
-
}
|
|
1044
|
-
},
|
|
1045
|
-
disabled: playing || (hmsDiagnostics == null ? void 0 : hmsDiagnostics.getRecordedAudio()) === TEST_AUDIO_URL
|
|
1046
|
-
},
|
|
1047
|
-
/* @__PURE__ */ React4.createElement(SpeakerIcon, null),
|
|
1048
|
-
playing ? "Playing..." : "Playback"
|
|
1049
|
-
), /* @__PURE__ */ React4.createElement(
|
|
1050
|
-
"audio",
|
|
1051
|
-
{
|
|
1052
|
-
ref: audioRef,
|
|
1053
|
-
onEnded: () => setPlaying(false),
|
|
1054
|
-
onPlay: () => setPlaying(true),
|
|
1055
|
-
style: { display: "none" }
|
|
1056
|
-
}
|
|
1057
|
-
)), /* @__PURE__ */ React4.createElement(Flex, { align: "center", css: { mt: "$4", maxWidth: "10rem", opacity: isRecording ? "1" : "0", gap: "$4" } }, /* @__PURE__ */ React4.createElement(Text, null, /* @__PURE__ */ React4.createElement(MicOnIcon, null)), /* @__PURE__ */ React4.createElement(Progress.Root, { value: audioLevel, css: { h: "$2" } }, /* @__PURE__ */ React4.createElement(
|
|
1058
|
-
Progress.Content,
|
|
1059
|
-
{
|
|
1060
|
-
style: {
|
|
1061
|
-
transform: `translateX(-${100 - audioLevel}%)`,
|
|
1062
|
-
transition: "transform 0.3s"
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
))));
|
|
1066
|
-
};
|
|
1067
|
-
var SpeakerTest = () => {
|
|
1068
|
-
var _a;
|
|
1069
|
-
const actions = useHMSActions();
|
|
1070
|
-
const devices = useHMSStore(selectDevices);
|
|
1071
|
-
const { audioOutputDeviceId } = useHMSStore(selectLocalMediaSettings);
|
|
1072
|
-
if (devices.audioOutput.length === 0) {
|
|
1073
|
-
return /* @__PURE__ */ React4.createElement(React4.Fragment, null);
|
|
1074
|
-
}
|
|
1075
|
-
return /* @__PURE__ */ React4.createElement(SelectContainer, null, /* @__PURE__ */ React4.createElement(
|
|
1076
|
-
DeviceSelector,
|
|
1077
|
-
{
|
|
1078
|
-
title: "Speaker (Output)",
|
|
1079
|
-
devices: devices.audioOutput,
|
|
1080
|
-
selection: audioOutputDeviceId || ((_a = devices.audioOutput[0]) == null ? void 0 : _a.deviceId),
|
|
1081
|
-
icon: /* @__PURE__ */ React4.createElement(SpeakerIcon, null),
|
|
1082
|
-
onChange: (deviceId) => {
|
|
1083
|
-
actions.setAudioOutputDevice(deviceId);
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
));
|
|
1087
|
-
};
|
|
1088
|
-
var AudioTest = () => {
|
|
1089
|
-
const { hmsDiagnostics, updateStep } = useDiagnostics();
|
|
1090
|
-
const [error, setErrorAlone] = useState2();
|
|
1091
|
-
const setError = useCallback(
|
|
1092
|
-
(err) => {
|
|
1093
|
-
updateStep(2 /* AUDIO */, { hasFailed: !!err });
|
|
1094
|
-
setErrorAlone(err);
|
|
1095
|
-
},
|
|
1096
|
-
[updateStep, setErrorAlone]
|
|
1097
|
-
);
|
|
1098
|
-
useEffect(() => {
|
|
1099
|
-
hmsDiagnostics == null ? void 0 : hmsDiagnostics.requestPermission({ audio: true }).catch((error2) => setError(error2));
|
|
1100
|
-
}, [hmsDiagnostics, setError]);
|
|
1101
|
-
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(TestContainer, null, /* @__PURE__ */ React4.createElement(Text, { variant: "body2", css: { c: "$on_primary_medium" } }, "Record a 10 second audio clip and play it back to check that your microphone and speaker are working. If they aren't, make sure your volume is turned up, try a different speaker or microphone, or check your bluetooth settings."), /* @__PURE__ */ React4.createElement(
|
|
1102
|
-
Flex,
|
|
1103
|
-
{
|
|
1104
|
-
css: {
|
|
1105
|
-
mt: "$10",
|
|
1106
|
-
gap: "$10",
|
|
1107
|
-
"@lg": {
|
|
1108
|
-
flexDirection: "column",
|
|
1109
|
-
gap: "$8"
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
},
|
|
1113
|
-
/* @__PURE__ */ React4.createElement(MicTest, { setError }),
|
|
1114
|
-
/* @__PURE__ */ React4.createElement(SpeakerTest, null)
|
|
1115
|
-
)), /* @__PURE__ */ React4.createElement(TestFooter, { error, ctaText: "Does your audio sound good?" }), /* @__PURE__ */ React4.createElement(PermissionErrorModal, { error }));
|
|
1116
|
-
};
|
|
1117
|
-
|
|
1118
|
-
// src/Diagnostics/BrowserTest.tsx
|
|
1119
|
-
init_define_process_env();
|
|
1120
|
-
import React5, { useEffect as useEffect2, useState as useState3 } from "react";
|
|
1121
|
-
import { parsedUserAgent } from "@100mslive/react-sdk";
|
|
1122
|
-
var CMS_MEDIA_SERVER = "https://storage.googleapis.com/100ms-cms-prod/";
|
|
1123
|
-
var operatingSystemIconInfo = {
|
|
1124
|
-
tizen: {
|
|
1125
|
-
key: "tizen",
|
|
1126
|
-
val: "Tizen",
|
|
1127
|
-
icon: `${CMS_MEDIA_SERVER}cms/Tizen_b99350214e/Tizen_b99350214e.svg`
|
|
1128
|
-
},
|
|
1129
|
-
"mac os": {
|
|
1130
|
-
key: "macos",
|
|
1131
|
-
val: "Mac OS",
|
|
1132
|
-
icon: `${CMS_MEDIA_SERVER}cms/mac_OS_804456afd8/mac_OS_804456afd8.png`
|
|
1133
|
-
},
|
|
1134
|
-
windows: {
|
|
1135
|
-
key: "windows",
|
|
1136
|
-
val: "Windows",
|
|
1137
|
-
icon: `${CMS_MEDIA_SERVER}cms/Windows_fdfe6749b6/Windows_fdfe6749b6.svg`
|
|
1138
|
-
},
|
|
1139
|
-
linux: {
|
|
1140
|
-
key: "linux",
|
|
1141
|
-
val: "Linux",
|
|
1142
|
-
icon: `${CMS_MEDIA_SERVER}cms/Linux_31f8353a2e/Linux_31f8353a2e.svg`
|
|
1143
|
-
},
|
|
1144
|
-
chromium: {
|
|
1145
|
-
key: "chromium",
|
|
1146
|
-
val: "Chromium",
|
|
1147
|
-
icon: `${CMS_MEDIA_SERVER}cms/Chromium_3df17710bd/Chromium_3df17710bd.svg`
|
|
1148
|
-
},
|
|
1149
|
-
ubuntu: {
|
|
1150
|
-
key: "ubuntu",
|
|
1151
|
-
val: "Ubuntu",
|
|
1152
|
-
icon: `${CMS_MEDIA_SERVER}cms/Ubuntu_966dd923c5/Ubuntu_966dd923c5.svg`
|
|
1153
|
-
},
|
|
1154
|
-
ios: {
|
|
1155
|
-
key: "ios",
|
|
1156
|
-
val: "iOS",
|
|
1157
|
-
icon: `${CMS_MEDIA_SERVER}cms/i_OS_3cdc9d9b71/i_OS_3cdc9d9b71.svg`
|
|
1158
|
-
},
|
|
1159
|
-
android: {
|
|
1160
|
-
key: "android",
|
|
1161
|
-
val: "Android",
|
|
1162
|
-
icon: `${CMS_MEDIA_SERVER}cms/Android_49dcfdc934/Android_49dcfdc934.svg`
|
|
1163
|
-
}
|
|
1164
|
-
};
|
|
1165
|
-
var browserTypeIconInfo = {
|
|
1166
|
-
brave: {
|
|
1167
|
-
key: "brave",
|
|
1168
|
-
val: "Brave",
|
|
1169
|
-
icon: `${CMS_MEDIA_SERVER}cms/Brave_7e66131f09/Brave_7e66131f09.svg`
|
|
1170
|
-
},
|
|
1171
|
-
chrome: {
|
|
1172
|
-
key: "chrome",
|
|
1173
|
-
val: "Chrome",
|
|
1174
|
-
icon: `${CMS_MEDIA_SERVER}cms/Chrome_7bf77fbdd7/Chrome_7bf77fbdd7.svg`
|
|
1175
|
-
},
|
|
1176
|
-
firefox: {
|
|
1177
|
-
key: "firefox",
|
|
1178
|
-
val: "Firefox",
|
|
1179
|
-
icon: `${CMS_MEDIA_SERVER}cms/Firefox_30f3976fb8/Firefox_30f3976fb8.svg`
|
|
1180
|
-
},
|
|
1181
|
-
safari: {
|
|
1182
|
-
key: "safari",
|
|
1183
|
-
val: "Safari",
|
|
1184
|
-
icon: `${CMS_MEDIA_SERVER}cms/Safari_254e74ed94/Safari_254e74ed94.svg`
|
|
1185
|
-
},
|
|
1186
|
-
"mobile safari": {
|
|
1187
|
-
key: "safari",
|
|
1188
|
-
val: "Safari",
|
|
1189
|
-
icon: `${CMS_MEDIA_SERVER}cms/Safari_254e74ed94/Safari_254e74ed94.svg`
|
|
1190
|
-
},
|
|
1191
|
-
edge: {
|
|
1192
|
-
key: "edge",
|
|
1193
|
-
val: "Edge",
|
|
1194
|
-
icon: `${CMS_MEDIA_SERVER}cms/Edge_23add4a83f/Edge_23add4a83f.svg`
|
|
1195
|
-
},
|
|
1196
|
-
opera: {
|
|
1197
|
-
key: "opera",
|
|
1198
|
-
val: "Opera",
|
|
1199
|
-
icon: `${CMS_MEDIA_SERVER}cms/Opera_0f3bf4eb19/Opera_0f3bf4eb19.svg`
|
|
1200
|
-
}
|
|
1201
|
-
};
|
|
1202
|
-
var CheckDetails = ({ title, value, iconURL }) => /* @__PURE__ */ React5.createElement(Box, { css: { w: "100%", my: "$10", p: "$10", r: "$1", bg: "$surface_default", "@lg": { w: "auto" } } }, /* @__PURE__ */ React5.createElement(Text, { css: { c: "$on_primary_medium", mb: "$6" } }, title), /* @__PURE__ */ React5.createElement(Flex, { align: "center" }, iconURL && /* @__PURE__ */ React5.createElement(Box, { css: { size: "2rem", r: "$round", bg: "$surface_brighter", mr: "$4" } }, /* @__PURE__ */ React5.createElement("img", { style: { objectFit: "contain", width: "2rem" }, src: iconURL, alt: value })), /* @__PURE__ */ React5.createElement(Text, null, value)));
|
|
1203
|
-
var BrowserTest = () => {
|
|
1204
|
-
var _a, _b, _c, _d;
|
|
1205
|
-
const { hmsDiagnostics, updateStep } = useDiagnostics();
|
|
1206
|
-
const [error, setError] = useState3();
|
|
1207
|
-
useEffect2(() => {
|
|
1208
|
-
try {
|
|
1209
|
-
hmsDiagnostics == null ? void 0 : hmsDiagnostics.checkBrowserSupport();
|
|
1210
|
-
} catch (err) {
|
|
1211
|
-
updateStep(0 /* BROWSER */, { hasFailed: true });
|
|
1212
|
-
setError(err);
|
|
1213
|
-
}
|
|
1214
|
-
}, [hmsDiagnostics, updateStep]);
|
|
1215
|
-
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(TestContainer, { css: { display: "flex", gap: "$8", "@lg": { display: "block" } } }, /* @__PURE__ */ React5.createElement(
|
|
1216
|
-
CheckDetails,
|
|
1217
|
-
{
|
|
1218
|
-
title: "Browser",
|
|
1219
|
-
iconURL: parsedUserAgent.getBrowser().name && ((_b = browserTypeIconInfo[(_a = parsedUserAgent.getBrowser().name) == null ? void 0 : _a.toLowerCase()]) == null ? void 0 : _b.icon),
|
|
1220
|
-
value: `${parsedUserAgent.getBrowser().name} ${parsedUserAgent.getBrowser().version}`
|
|
1221
|
-
}
|
|
1222
|
-
), /* @__PURE__ */ React5.createElement(
|
|
1223
|
-
CheckDetails,
|
|
1224
|
-
{
|
|
1225
|
-
title: "Operating system",
|
|
1226
|
-
iconURL: parsedUserAgent.getOS().name && ((_d = operatingSystemIconInfo[(_c = parsedUserAgent.getOS().name) == null ? void 0 : _c.toLowerCase()]) == null ? void 0 : _d.icon),
|
|
1227
|
-
value: `${parsedUserAgent.getOS().name} ${parsedUserAgent.getOS().version}`
|
|
1228
|
-
}
|
|
1229
|
-
)), /* @__PURE__ */ React5.createElement(TestFooter, { error, ctaText: "Is your device information correct?" }));
|
|
1230
|
-
};
|
|
1231
|
-
|
|
1232
|
-
// src/Diagnostics/ConnectivityTest.tsx
|
|
1233
|
-
init_define_process_env();
|
|
1234
|
-
import React6, { useState as useState4 } from "react";
|
|
1235
|
-
import { ConnectivityState } from "@100mslive/react-sdk";
|
|
1236
|
-
import { CheckCircleIcon, CrossCircleIcon, EyeCloseIcon, EyeOpenIcon, LinkIcon } from "@100mslive/react-icons";
|
|
1237
|
-
var Regions = {
|
|
1238
|
-
in: "India",
|
|
1239
|
-
us: "United States"
|
|
1240
|
-
};
|
|
1241
|
-
var ConnectivityStateMessage = {
|
|
1242
|
-
[ConnectivityState.STARTING]: "Fetching Init",
|
|
1243
|
-
[ConnectivityState.INIT_FETCHED]: "Connecting to signal server",
|
|
1244
|
-
[ConnectivityState.SIGNAL_CONNECTED]: "Establishing ICE connection",
|
|
1245
|
-
[ConnectivityState.ICE_ESTABLISHED]: "Capturing Media",
|
|
1246
|
-
[ConnectivityState.MEDIA_CAPTURED]: "Publishing Media",
|
|
1247
|
-
[ConnectivityState.MEDIA_PUBLISHED]: "Finishing Up",
|
|
1248
|
-
[ConnectivityState.COMPLETED]: "Completed"
|
|
1249
|
-
};
|
|
1250
|
-
var ConnectivityTestStepResult = ({
|
|
1251
|
-
title,
|
|
1252
|
-
status = "Connected",
|
|
1253
|
-
success,
|
|
1254
|
-
children
|
|
1255
|
-
}) => {
|
|
1256
|
-
const [hideDetails, setHideDetails] = useState4(true);
|
|
1257
|
-
return /* @__PURE__ */ React6.createElement(Box, { css: { my: "$10", p: "$10", r: "$1", bg: "$surface_bright" } }, /* @__PURE__ */ React6.createElement(Text, { css: { c: "$on_primary_medium", mb: "$6" } }, title), success ? /* @__PURE__ */ React6.createElement(Flex, null, /* @__PURE__ */ React6.createElement(Text, { css: { c: "$alert_success" } }, /* @__PURE__ */ React6.createElement(CheckCircleIcon, { width: "1.5rem", height: "1.5rem" })), /* @__PURE__ */ React6.createElement(Text, { variant: "lg", css: { ml: "$4" } }, status)) : /* @__PURE__ */ React6.createElement(Flex, null, /* @__PURE__ */ React6.createElement(Text, { css: { c: "$alert_error_bright" } }, /* @__PURE__ */ React6.createElement(CrossCircleIcon, { width: "1.5rem", height: "1.5rem" })), /* @__PURE__ */ React6.createElement(Text, { variant: "lg", css: { ml: "$4" } }, "Failed")), /* @__PURE__ */ React6.createElement(
|
|
1258
|
-
Flex,
|
|
1259
|
-
{
|
|
1260
|
-
onClick: () => setHideDetails(!hideDetails),
|
|
1261
|
-
align: "center",
|
|
1262
|
-
gap: "2",
|
|
1263
|
-
css: {
|
|
1264
|
-
color: "$primary_bright"
|
|
1265
|
-
}
|
|
1266
|
-
},
|
|
1267
|
-
hideDetails ? /* @__PURE__ */ React6.createElement(EyeOpenIcon, null) : /* @__PURE__ */ React6.createElement(EyeCloseIcon, null),
|
|
1268
|
-
/* @__PURE__ */ React6.createElement(
|
|
1269
|
-
Text,
|
|
1270
|
-
{
|
|
1271
|
-
variant: "caption",
|
|
1272
|
-
css: {
|
|
1273
|
-
color: "$primary_bright"
|
|
1274
|
-
}
|
|
1275
|
-
},
|
|
1276
|
-
hideDetails ? "View" : "Hide",
|
|
1277
|
-
" detailed information"
|
|
1278
|
-
)
|
|
1279
|
-
), !hideDetails ? /* @__PURE__ */ React6.createElement(Box, null, children) : null);
|
|
1280
|
-
};
|
|
1281
|
-
var DetailedInfo = ({
|
|
1282
|
-
title,
|
|
1283
|
-
value,
|
|
1284
|
-
Icon
|
|
1285
|
-
}) => {
|
|
1286
|
-
return /* @__PURE__ */ React6.createElement(Box, { css: { flex: "50%", mt: "$6" } }, /* @__PURE__ */ React6.createElement(Text, { variant: "caption", css: { fontWeight: "$semiBold", c: "$on_primary_medium" } }, title), /* @__PURE__ */ React6.createElement(Flex, { css: { mt: "$xs", alignItems: "flex-start" } }, Icon && /* @__PURE__ */ React6.createElement(Text, { css: { mr: "$4" } }, /* @__PURE__ */ React6.createElement(Icon, { width: "1rem", height: "1rem" })), /* @__PURE__ */ React6.createElement(Text, { variant: "caption" }, value)));
|
|
1287
|
-
};
|
|
1288
|
-
var MediaServerResult = ({ result }) => {
|
|
1289
|
-
var _a, _b, _c, _d;
|
|
1290
|
-
return /* @__PURE__ */ React6.createElement(
|
|
1291
|
-
ConnectivityTestStepResult,
|
|
1292
|
-
{
|
|
1293
|
-
title: "Media server connection test",
|
|
1294
|
-
success: (result == null ? void 0 : result.isPublishICEConnected) && result.isSubscribeICEConnected
|
|
1295
|
-
},
|
|
1296
|
-
/* @__PURE__ */ React6.createElement(Flex, { css: { flexWrap: "wrap" } }, /* @__PURE__ */ React6.createElement(
|
|
1297
|
-
DetailedInfo,
|
|
1298
|
-
{
|
|
1299
|
-
title: "Media Captured",
|
|
1300
|
-
value: ((_a = result == null ? void 0 : result.stats) == null ? void 0 : _a.audio.bytesSent) ? "Yes" : "No",
|
|
1301
|
-
Icon: ((_b = result == null ? void 0 : result.stats) == null ? void 0 : _b.audio.bytesSent) ? CheckCircleIcon : CrossCircleIcon
|
|
1302
|
-
}
|
|
1303
|
-
), /* @__PURE__ */ React6.createElement(
|
|
1304
|
-
DetailedInfo,
|
|
1305
|
-
{
|
|
1306
|
-
title: "Media Published",
|
|
1307
|
-
value: ((_c = result == null ? void 0 : result.stats) == null ? void 0 : _c.audio.bitrateSent) ? "Yes" : "No",
|
|
1308
|
-
Icon: ((_d = result == null ? void 0 : result.stats) == null ? void 0 : _d.audio.bytesSent) ? CheckCircleIcon : CrossCircleIcon
|
|
1309
|
-
}
|
|
1310
|
-
), (result == null ? void 0 : result.connectionQualityScore) ? /* @__PURE__ */ React6.createElement(
|
|
1311
|
-
DetailedInfo,
|
|
1312
|
-
{
|
|
1313
|
-
title: "Connection Quality Score (CQS)",
|
|
1314
|
-
value: `${result.connectionQualityScore.toFixed(2)} (out of 5)`
|
|
1315
|
-
}
|
|
1316
|
-
) : null)
|
|
1317
|
-
);
|
|
1318
|
-
};
|
|
1319
|
-
var SignallingResult = ({ result }) => {
|
|
1320
|
-
return /* @__PURE__ */ React6.createElement(ConnectivityTestStepResult, { title: "Signalling server connection test", success: result == null ? void 0 : result.isConnected }, /* @__PURE__ */ React6.createElement(Flex, { css: { flexWrap: "wrap" } }, /* @__PURE__ */ React6.createElement(
|
|
1321
|
-
DetailedInfo,
|
|
1322
|
-
{
|
|
1323
|
-
title: "Signalling Gateway",
|
|
1324
|
-
value: (result == null ? void 0 : result.isConnected) ? "Reachable" : "Unreachable",
|
|
1325
|
-
Icon: (result == null ? void 0 : result.isConnected) ? CheckCircleIcon : CrossCircleIcon
|
|
1326
|
-
}
|
|
1327
|
-
), /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Websocket URL", value: (result == null ? void 0 : result.websocketUrl) || "N/A", Icon: LinkIcon })));
|
|
1328
|
-
};
|
|
1329
|
-
var AudioStats = ({ stats }) => {
|
|
1330
|
-
return /* @__PURE__ */ React6.createElement(ConnectivityTestStepResult, { title: "Audio", status: "Received", success: !!(stats == null ? void 0 : stats.bytesSent) }, stats && /* @__PURE__ */ React6.createElement(Flex, { css: { flexWrap: "wrap" } }, /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Bytes Sent", value: formatBytes(stats.bytesSent) }), /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Bytes Received", value: formatBytes(stats.bytesReceived) }), /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Packets Received", value: stats.packetsReceived.toString() }), /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Packets Lost", value: stats.packetsLost.toString() }), /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Bitrate Sent", value: formatBytes(stats.bitrateSent, "b/s") }), /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Bitrate Received", value: formatBytes(stats.bitrateReceived, "b/s") }), /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Round Trip Time", value: `${stats.roundTripTime} ms` }), /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Jitter", value: `${stats.jitter * 1e3} ms` })));
|
|
1331
|
-
};
|
|
1332
|
-
var VideoStats = ({ stats }) => {
|
|
1333
|
-
return /* @__PURE__ */ React6.createElement(ConnectivityTestStepResult, { title: "Video", status: "Received", success: !!(stats == null ? void 0 : stats.bytesSent) }, stats && /* @__PURE__ */ React6.createElement(Flex, { css: { flexWrap: "wrap" } }, /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Bytes Sent", value: formatBytes(stats.bytesSent) }), /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Bytes Received", value: formatBytes(stats.bytesReceived) }), /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Packets Received", value: stats.packetsReceived.toString() }), /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Packets Lost", value: stats.packetsLost.toString() }), /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Bitrate Sent", value: formatBytes(stats.bitrateSent, "b/s") }), /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Bitrate Received", value: formatBytes(stats.bitrateReceived, "b/s") }), /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Round Trip Time", value: `${stats.roundTripTime} ms` }), /* @__PURE__ */ React6.createElement(DetailedInfo, { title: "Jitter", value: `${stats.jitter * 1e3} ms` })));
|
|
1334
|
-
};
|
|
1335
|
-
var Footer = ({
|
|
1336
|
-
error,
|
|
1337
|
-
result,
|
|
1338
|
-
restart
|
|
1339
|
-
}) => {
|
|
1340
|
-
return /* @__PURE__ */ React6.createElement(TestFooter, { error }, /* @__PURE__ */ React6.createElement(Flex, { css: { gap: "$8", "@lg": { flexDirection: "column" } } }, /* @__PURE__ */ React6.createElement(Button, { variant: "standard", onClick: restart }, "Restart Test"), /* @__PURE__ */ React6.createElement(Button, { disabled: !result, onClick: () => result && downloadJson(result, "hms_diagnostics_results") }, "Download Test Report")));
|
|
1341
|
-
};
|
|
1342
|
-
var ConnectivityTestReport = ({
|
|
1343
|
-
error,
|
|
1344
|
-
result,
|
|
1345
|
-
progress,
|
|
1346
|
-
startTest
|
|
1347
|
-
}) => {
|
|
1348
|
-
var _a, _b, _c, _d;
|
|
1349
|
-
if (error) {
|
|
1350
|
-
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(TestContainer, { css: { textAlign: "center" } }, /* @__PURE__ */ React6.createElement(Text, { css: { c: "$alert_error_default", mb: "$4" } }, /* @__PURE__ */ React6.createElement(CrossCircleIcon, null)), /* @__PURE__ */ React6.createElement(Text, { variant: "h6" }, "Connectivity Test Failed"), /* @__PURE__ */ React6.createElement(Text, { variant: "body2", css: { c: "$on_primary_medium" } }, error.message)), /* @__PURE__ */ React6.createElement(Footer, { restart: startTest, error }));
|
|
1351
|
-
}
|
|
1352
|
-
if (result) {
|
|
1353
|
-
console.log(result);
|
|
1354
|
-
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(TestContainer, null, /* @__PURE__ */ React6.createElement(Text, { css: { c: "$on_primary_medium" } }, "Connectivity test has been completed."), /* @__PURE__ */ React6.createElement(SignallingResult, { result: result == null ? void 0 : result.signallingReport }), /* @__PURE__ */ React6.createElement(MediaServerResult, { result: result == null ? void 0 : result.mediaServerReport }), /* @__PURE__ */ React6.createElement(AudioStats, { stats: (_b = (_a = result == null ? void 0 : result.mediaServerReport) == null ? void 0 : _a.stats) == null ? void 0 : _b.audio }), /* @__PURE__ */ React6.createElement(VideoStats, { stats: (_d = (_c = result == null ? void 0 : result.mediaServerReport) == null ? void 0 : _c.stats) == null ? void 0 : _d.video })), /* @__PURE__ */ React6.createElement(Footer, { result, restart: startTest, error }));
|
|
1355
|
-
}
|
|
1356
|
-
if (progress !== void 0) {
|
|
1357
|
-
return /* @__PURE__ */ React6.createElement(TestContainer, { css: { textAlign: "center" } }, /* @__PURE__ */ React6.createElement(Text, { css: { c: "$primary_bright", display: "flex", justifyContent: "center" } }, /* @__PURE__ */ React6.createElement(Loading, { size: "3.5rem", color: "currentColor" })), /* @__PURE__ */ React6.createElement(Text, { variant: "h6", css: { mt: "$8" } }, "Checking your connection..."), /* @__PURE__ */ React6.createElement(
|
|
1358
|
-
Text,
|
|
1359
|
-
{
|
|
1360
|
-
variant: "body2",
|
|
1361
|
-
css: { c: "$on_primary_medium", mt: "$4" }
|
|
1362
|
-
},
|
|
1363
|
-
`${ConnectivityStateMessage[progress]}...`
|
|
1364
|
-
));
|
|
1365
|
-
}
|
|
1366
|
-
return null;
|
|
1367
|
-
};
|
|
1368
|
-
var RegionSelector = ({
|
|
1369
|
-
region,
|
|
1370
|
-
setRegion,
|
|
1371
|
-
startTest
|
|
1372
|
-
}) => {
|
|
1373
|
-
return /* @__PURE__ */ React6.createElement(TestContainer, { css: { borderBottom: "1px solid $border_default" } }, /* @__PURE__ */ React6.createElement(Text, { variant: "body1" }, "Select a region"), /* @__PURE__ */ React6.createElement(Text, { variant: "body2", css: { c: "$on_secondary_low" } }, "Select the closest region for best results"), /* @__PURE__ */ React6.createElement(
|
|
1374
|
-
Flex,
|
|
1375
|
-
{
|
|
1376
|
-
justify: "between",
|
|
1377
|
-
css: {
|
|
1378
|
-
mt: "$md",
|
|
1379
|
-
"@lg": {
|
|
1380
|
-
flexDirection: "column",
|
|
1381
|
-
gap: "$8"
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
},
|
|
1385
|
-
/* @__PURE__ */ React6.createElement(
|
|
1386
|
-
Flex,
|
|
1387
|
-
{
|
|
1388
|
-
css: {
|
|
1389
|
-
gap: "$4",
|
|
1390
|
-
"@lg": {
|
|
1391
|
-
flexDirection: "column"
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
},
|
|
1395
|
-
Object.entries(Regions).map(([key, value]) => /* @__PURE__ */ React6.createElement(
|
|
1396
|
-
Button,
|
|
1397
|
-
{
|
|
1398
|
-
key,
|
|
1399
|
-
outlined: region !== key,
|
|
1400
|
-
variant: region === key ? "primary" : "standard",
|
|
1401
|
-
css: region === key ? { bg: "$primary_dim" } : {},
|
|
1402
|
-
onClick: () => setRegion(key)
|
|
1403
|
-
},
|
|
1404
|
-
value
|
|
1405
|
-
))
|
|
1406
|
-
),
|
|
1407
|
-
/* @__PURE__ */ React6.createElement(Flex, { css: { "@lg": { flexDirection: "column" } } }, /* @__PURE__ */ React6.createElement(Button, { variant: "primary", onClick: startTest, disabled: !startTest }, startTest ? "Start Test" : "Testing..."))
|
|
1408
|
-
));
|
|
1409
|
-
};
|
|
1410
|
-
var ConnectivityTest = () => {
|
|
1411
|
-
const { hmsDiagnostics, updateStep } = useDiagnostics();
|
|
1412
|
-
const [region, setRegion] = useState4(Object.keys(Regions)[0]);
|
|
1413
|
-
const [error, setError] = useState4();
|
|
1414
|
-
const [progress, setProgress] = useState4();
|
|
1415
|
-
const [result, setResult] = useState4();
|
|
1416
|
-
const startTest = () => {
|
|
1417
|
-
updateStep(3 /* CONNECTIVITY */, { hasFailed: false, isCompleted: false });
|
|
1418
|
-
setError(void 0);
|
|
1419
|
-
setResult(void 0);
|
|
1420
|
-
hmsDiagnostics == null ? void 0 : hmsDiagnostics.startConnectivityCheck(
|
|
1421
|
-
(state) => {
|
|
1422
|
-
setProgress(state);
|
|
1423
|
-
},
|
|
1424
|
-
(result2) => {
|
|
1425
|
-
updateStep(3 /* CONNECTIVITY */, { isCompleted: true });
|
|
1426
|
-
setResult(result2);
|
|
1427
|
-
},
|
|
1428
|
-
region
|
|
1429
|
-
).catch((error2) => {
|
|
1430
|
-
updateStep(3 /* CONNECTIVITY */, { hasFailed: true });
|
|
1431
|
-
setError(error2);
|
|
1432
|
-
});
|
|
1433
|
-
};
|
|
1434
|
-
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(
|
|
1435
|
-
RegionSelector,
|
|
1436
|
-
{
|
|
1437
|
-
region,
|
|
1438
|
-
setRegion,
|
|
1439
|
-
startTest: progress === void 0 || progress === ConnectivityState.COMPLETED ? startTest : void 0
|
|
1440
|
-
}
|
|
1441
|
-
), /* @__PURE__ */ React6.createElement(ConnectivityTestReport, { error, result, progress, startTest }));
|
|
1442
|
-
};
|
|
1443
|
-
var downloadJson = (obj, fileName) => {
|
|
1444
|
-
const a = document.createElement("a");
|
|
1445
|
-
const file = new Blob([JSON.stringify(obj, null, 2)], {
|
|
1446
|
-
type: "application/json"
|
|
1447
|
-
});
|
|
1448
|
-
a.href = URL.createObjectURL(file);
|
|
1449
|
-
a.download = `${fileName}.json`;
|
|
1450
|
-
a.click();
|
|
1451
|
-
};
|
|
1452
|
-
|
|
1453
|
-
// src/Diagnostics/VideoTest.tsx
|
|
1454
|
-
init_define_process_env();
|
|
1455
|
-
import React7, { useEffect as useEffect3, useState as useState5 } from "react";
|
|
1456
|
-
import {
|
|
1457
|
-
selectDevices as selectDevices2,
|
|
1458
|
-
selectLocalMediaSettings as selectLocalMediaSettings2,
|
|
1459
|
-
selectLocalVideoTrackID,
|
|
1460
|
-
useHMSStore as useHMSStore2
|
|
1461
|
-
} from "@100mslive/react-sdk";
|
|
1462
|
-
import { VideoOnIcon } from "@100mslive/react-icons";
|
|
1463
|
-
var VideoTest = () => {
|
|
1464
|
-
const { hmsDiagnostics, updateStep } = useDiagnostics();
|
|
1465
|
-
const allDevices = useHMSStore2(selectDevices2);
|
|
1466
|
-
const { videoInput } = allDevices;
|
|
1467
|
-
const trackID = useHMSStore2(selectLocalVideoTrackID);
|
|
1468
|
-
const sdkSelectedDevices = useHMSStore2(selectLocalMediaSettings2);
|
|
1469
|
-
const [error, setError] = useState5();
|
|
1470
|
-
useEffect3(() => {
|
|
1471
|
-
hmsDiagnostics == null ? void 0 : hmsDiagnostics.startCameraCheck().catch((err) => {
|
|
1472
|
-
updateStep(1 /* VIDEO */, { hasFailed: true });
|
|
1473
|
-
setError(err);
|
|
1474
|
-
});
|
|
1475
|
-
}, [hmsDiagnostics, updateStep]);
|
|
1476
|
-
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(TestContainer, { css: { display: "flex", "@lg": { flexDirection: "column", alignItems: "center" } } }, trackID && /* @__PURE__ */ React7.createElement(
|
|
1477
|
-
StyledVideoTile.Container,
|
|
1478
|
-
{
|
|
1479
|
-
css: {
|
|
1480
|
-
width: "90%",
|
|
1481
|
-
aspectRatio: "16/9",
|
|
1482
|
-
mr: "$10",
|
|
1483
|
-
"@lg": { mr: 0, mb: "$10", aspectRatio: "1/1" }
|
|
1484
|
-
}
|
|
1485
|
-
},
|
|
1486
|
-
/* @__PURE__ */ React7.createElement(Video, { mirror: true, trackId: trackID })
|
|
1487
|
-
), /* @__PURE__ */ React7.createElement(Flex, { direction: "column", css: { w: "100%" } }, /* @__PURE__ */ React7.createElement(Text, { variant: "body2", css: { c: "$on_primary_medium", mb: "$10" } }, "Move in front of your camera to make sure it's working. If you don't see your video, try changing the selected camera. If the camera isn't part of your computer, check your settings to make sure your system recognizes it."), /* @__PURE__ */ React7.createElement(
|
|
1488
|
-
DeviceSelector,
|
|
1489
|
-
{
|
|
1490
|
-
title: "Video",
|
|
1491
|
-
devices: videoInput || [],
|
|
1492
|
-
icon: /* @__PURE__ */ React7.createElement(VideoOnIcon, null),
|
|
1493
|
-
selection: sdkSelectedDevices.videoInputDeviceId,
|
|
1494
|
-
onChange: (deviceId) => __async(null, null, function* () {
|
|
1495
|
-
hmsDiagnostics == null ? void 0 : hmsDiagnostics.stopCameraCheck();
|
|
1496
|
-
hmsDiagnostics == null ? void 0 : hmsDiagnostics.startCameraCheck(deviceId);
|
|
1497
|
-
})
|
|
1498
|
-
}
|
|
1499
|
-
))), /* @__PURE__ */ React7.createElement(TestFooter, { error, ctaText: "Does your video look good?" }), /* @__PURE__ */ React7.createElement(PermissionErrorModal, { error }));
|
|
1500
|
-
};
|
|
1501
|
-
|
|
1502
|
-
// src/Diagnostics/Diagnostics.tsx
|
|
1503
|
-
var DiagnosticsStepIcon = {
|
|
1504
|
-
[1 /* VIDEO */]: /* @__PURE__ */ React8.createElement(VideoOnIcon2, { width: "2rem", height: "2rem" }),
|
|
1505
|
-
[2 /* AUDIO */]: /* @__PURE__ */ React8.createElement(MicOnIcon2, { width: "2rem", height: "2rem" }),
|
|
1506
|
-
[0 /* BROWSER */]: /* @__PURE__ */ React8.createElement(GlobeIcon, { width: "2rem", height: "2rem" }),
|
|
1507
|
-
[3 /* CONNECTIVITY */]: /* @__PURE__ */ React8.createElement(ConnectivityIcon, { width: "2rem", height: "2rem" })
|
|
1508
|
-
};
|
|
1509
|
-
var Container = ({ children }) => /* @__PURE__ */ React8.createElement(
|
|
1510
|
-
Box,
|
|
1511
|
-
{
|
|
1512
|
-
css: {
|
|
1513
|
-
px: "120px",
|
|
1514
|
-
pt: "120px",
|
|
1515
|
-
pb: "24px",
|
|
1516
|
-
bg: "$background_dim",
|
|
1517
|
-
lineHeight: "1.5",
|
|
1518
|
-
"-webkit-text-size-adjust": "100%",
|
|
1519
|
-
position: "relative",
|
|
1520
|
-
h: "100%",
|
|
1521
|
-
"@lg": {
|
|
1522
|
-
p: "$12"
|
|
1523
|
-
},
|
|
1524
|
-
overflowY: "auto",
|
|
1525
|
-
boxSizing: "border-box",
|
|
1526
|
-
"& *": {
|
|
1527
|
-
boxSizing: "border-box"
|
|
1528
|
-
},
|
|
1529
|
-
"::-webkit-scrollbar-track": {
|
|
1530
|
-
WebkitBoxShadow: "inset 0 0 6px rgba(0, 0, 0, 0.3)",
|
|
1531
|
-
boxShadow: "inset 0 0 6px rgba(0, 0, 0, 0.3)",
|
|
1532
|
-
backgroundColor: "transparent"
|
|
1533
|
-
},
|
|
1534
|
-
"::-webkit-scrollbar": {
|
|
1535
|
-
width: "6px",
|
|
1536
|
-
height: "6px",
|
|
1537
|
-
backgroundColor: "transparent"
|
|
1538
|
-
},
|
|
1539
|
-
"::-webkit-scrollbar-thumb": {
|
|
1540
|
-
backgroundColor: "#657080",
|
|
1541
|
-
borderRadius: "5px"
|
|
1542
|
-
}
|
|
1543
|
-
}
|
|
1544
|
-
},
|
|
1545
|
-
children
|
|
1546
|
-
);
|
|
1547
|
-
var DiagnosticsStepTest = () => {
|
|
1548
|
-
const { activeStepIndex } = useDiagnostics();
|
|
1549
|
-
let TestComponent = () => /* @__PURE__ */ React8.createElement(React8.Fragment, null);
|
|
1550
|
-
if (activeStepIndex === 2 /* AUDIO */) {
|
|
1551
|
-
TestComponent = AudioTest;
|
|
1552
|
-
} else if (activeStepIndex === 1 /* VIDEO */) {
|
|
1553
|
-
TestComponent = VideoTest;
|
|
1554
|
-
} else if (activeStepIndex === 0 /* BROWSER */) {
|
|
1555
|
-
TestComponent = BrowserTest;
|
|
1556
|
-
} else if (activeStepIndex === 3 /* CONNECTIVITY */) {
|
|
1557
|
-
TestComponent = ConnectivityTest;
|
|
1558
|
-
}
|
|
1559
|
-
return /* @__PURE__ */ React8.createElement(TestComponent, { key: activeStepIndex });
|
|
1560
|
-
};
|
|
1561
|
-
var DiagnosticsStepHeader = () => {
|
|
1562
|
-
const { activeStepIndex, activeStep } = useDiagnostics();
|
|
1563
|
-
return /* @__PURE__ */ React8.createElement(Flex, { css: { py: "$8", px: "$10", alignItems: "center", borderBottom: "1px solid $border_default" } }, /* @__PURE__ */ React8.createElement(Text, { css: { c: "$primary_bright", mt: "$xs" } }, DiagnosticsStepIcon[activeStepIndex]), /* @__PURE__ */ React8.createElement(Text, { css: { fontSize: "$h6", ml: "$9" } }, activeStep.name));
|
|
1564
|
-
};
|
|
1565
|
-
var DiagnosticsStepContainer = () => {
|
|
1566
|
-
return /* @__PURE__ */ React8.createElement(Box, { css: { border: "1px solid $border_default", r: "$1", w: "75%", maxWidth: "65rem", "@lg": { w: "100%" } } }, /* @__PURE__ */ React8.createElement(DiagnosticsStepHeader, null), /* @__PURE__ */ React8.createElement(DiagnosticsStepTest, null));
|
|
1567
|
-
};
|
|
1568
|
-
var DiagnosticsStepsList = () => {
|
|
1569
|
-
const { activeStepIndex, activeStep, steps } = useDiagnostics();
|
|
1570
|
-
return /* @__PURE__ */ React8.createElement(Box, { css: { w: "25%", "@lg": { display: "none" } } }, Object.keys(DiagnosticsStep).filter((key) => !isNaN(Number(key))).map((key) => {
|
|
1571
|
-
const keyIndex = Number(key);
|
|
1572
|
-
const step = steps[keyIndex];
|
|
1573
|
-
const isStepCompleted = activeStepIndex > keyIndex || activeStep.isCompleted;
|
|
1574
|
-
let color = "$on_primary_low";
|
|
1575
|
-
let icon = /* @__PURE__ */ React8.createElement(Text, { css: { c: color, fontSize: "1.75rem" } }, "\u2022");
|
|
1576
|
-
if (activeStepIndex === keyIndex) {
|
|
1577
|
-
color = "$on_primary_high";
|
|
1578
|
-
icon = /* @__PURE__ */ React8.createElement(Text, { css: { c: color, fontSize: "1.75rem" } }, "\u2022");
|
|
1579
|
-
}
|
|
1580
|
-
if (isStepCompleted) {
|
|
1581
|
-
color = "$primary_bright";
|
|
1582
|
-
icon = /* @__PURE__ */ React8.createElement(CheckCircleIcon2, { width: "1rem", height: "1rem" });
|
|
1583
|
-
}
|
|
1584
|
-
if (step.hasFailed) {
|
|
1585
|
-
color = "$alert_error_default";
|
|
1586
|
-
icon = /* @__PURE__ */ React8.createElement(CrossCircleIcon2, { width: "1rem", height: "1rem" });
|
|
1587
|
-
}
|
|
1588
|
-
return /* @__PURE__ */ React8.createElement(Flex, { key, css: { mb: "$10", c: color, gap: "$4", alignItems: "center" } }, icon, /* @__PURE__ */ React8.createElement(Text, { css: { c: color } }, step.name));
|
|
1589
|
-
}));
|
|
1590
|
-
};
|
|
1591
|
-
var DiagnosticsProvider = () => {
|
|
1592
|
-
const actions = useHMSActions2();
|
|
1593
|
-
const [activeStep, setActiveStep] = useState6(0);
|
|
1594
|
-
const [steps, setSteps] = useState6(initialSteps);
|
|
1595
|
-
const diagnosticsRef = useRef2(actions.initDiagnostics());
|
|
1596
|
-
const updateStep = useCallback2((step, value) => {
|
|
1597
|
-
setSteps((prevSteps) => __spreadProps(__spreadValues({}, prevSteps), { [step]: __spreadValues(__spreadValues({}, prevSteps[step]), value) }));
|
|
1598
|
-
}, []);
|
|
1599
|
-
return /* @__PURE__ */ React8.createElement(
|
|
1600
|
-
DiagnosticsContext.Provider,
|
|
1601
|
-
{
|
|
1602
|
-
value: {
|
|
1603
|
-
hmsDiagnostics: diagnosticsRef.current,
|
|
1604
|
-
activeStepIndex: activeStep,
|
|
1605
|
-
setActiveStep,
|
|
1606
|
-
steps,
|
|
1607
|
-
updateStep
|
|
1608
|
-
}
|
|
1609
|
-
},
|
|
1610
|
-
/* @__PURE__ */ React8.createElement(Container, null, /* @__PURE__ */ React8.createElement(Text, { variant: "h4" }, "Pre-call Test"), /* @__PURE__ */ React8.createElement(Text, { variant: "md", css: { c: "$on_primary_medium" } }, "Make sure your devices and network are good to go, let's get started."), /* @__PURE__ */ React8.createElement(Flex, { css: { direction: "column", mt: "$12", justifyItems: "center" } }, /* @__PURE__ */ React8.createElement(DiagnosticsStepsList, null), /* @__PURE__ */ React8.createElement(DiagnosticsStepContainer, null)))
|
|
1611
|
-
);
|
|
1612
|
-
};
|
|
1613
|
-
var Diagnostics = () => {
|
|
1614
|
-
return /* @__PURE__ */ React8.createElement(HMSRoomProvider, null, /* @__PURE__ */ React8.createElement(HMSThemeProvider, { themeType: "default" }, /* @__PURE__ */ React8.createElement(DiagnosticsProvider, null)));
|
|
1615
|
-
};
|
|
1616
|
-
export {
|
|
1617
|
-
Diagnostics
|
|
1618
|
-
};
|
|
1619
|
-
/*! Bundled license information:
|
|
1620
|
-
|
|
1621
|
-
react-is/cjs/react-is.development.js:
|
|
1622
|
-
(** @license React v16.13.1
|
|
1623
|
-
* react-is.development.js
|
|
1624
|
-
*
|
|
1625
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1626
|
-
*
|
|
1627
|
-
* This source code is licensed under the MIT license found in the
|
|
1628
|
-
* LICENSE file in the root directory of this source tree.
|
|
1629
|
-
*)
|
|
1630
|
-
|
|
1631
|
-
object-assign/index.js:
|
|
1632
|
-
(*
|
|
1633
|
-
object-assign
|
|
1634
|
-
(c) Sindre Sorhus
|
|
1635
|
-
@license MIT
|
|
1636
|
-
*)
|
|
1637
|
-
*/
|
|
1638
|
-
//# sourceMappingURL=Diagnostics-XZRJZN6F.js.map
|