amazon-ivs-web-broadcast 1.0.0
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/LICENSE.txt +332 -0
- package/README.md +12 -0
- package/dist/amazon-ivs-web-broadcast.js +2 -0
- package/package.json +111 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
Amazon Interactive Video Service (IVS) [Amazon IVS Web Broadcast] (https://docs.aws.amazon.com/ivs/)
|
|
2
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
Provided as AWS Content and subject to the AWS Customer Agreement
|
|
7
|
+
|
|
8
|
+
(https://aws.amazon.com/agreement/) and any other agreement with AWS
|
|
9
|
+
|
|
10
|
+
governing your use of AWS services.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
This product includes the following third-party software/licensing:
|
|
15
|
+
|
|
16
|
+
** reflect-metadata; version ^0.1.13 -- https://github.com/rbuckton/reflect-metadata
|
|
17
|
+
|
|
18
|
+
Apache License
|
|
19
|
+
|
|
20
|
+
Version 2.0, January 2004
|
|
21
|
+
|
|
22
|
+
http://www.apache.org/licenses/
|
|
23
|
+
|
|
24
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
25
|
+
|
|
26
|
+
1. Definitions.
|
|
27
|
+
|
|
28
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
29
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
30
|
+
|
|
31
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
|
32
|
+
owner that is granting the License.
|
|
33
|
+
|
|
34
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities
|
|
35
|
+
that control, are controlled by, or are under common control with that entity.
|
|
36
|
+
For the purposes of this definition, "control" means (i) the power, direct or
|
|
37
|
+
indirect, to cause the direction or management of such entity, whether by
|
|
38
|
+
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
39
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
40
|
+
|
|
41
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
42
|
+
permissions granted by this License.
|
|
43
|
+
|
|
44
|
+
"Source" form shall mean the preferred form for making modifications, including
|
|
45
|
+
but not limited to software source code, documentation source, and configuration
|
|
46
|
+
files.
|
|
47
|
+
|
|
48
|
+
"Object" form shall mean any form resulting from mechanical transformation or
|
|
49
|
+
translation of a Source form, including but not limited to compiled object code,
|
|
50
|
+
generated documentation, and conversions to other media types.
|
|
51
|
+
|
|
52
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made
|
|
53
|
+
available under the License, as indicated by a copyright notice that is included
|
|
54
|
+
in or attached to the work (an example is provided in the Appendix below).
|
|
55
|
+
|
|
56
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
|
57
|
+
is based on (or derived from) the Work and for which the editorial revisions,
|
|
58
|
+
annotations, elaborations, or other modifications represent, as a whole, an
|
|
59
|
+
original work of authorship. For the purposes of this License, Derivative Works
|
|
60
|
+
shall not include works that remain separable from, or merely link (or bind by
|
|
61
|
+
name) to the interfaces of, the Work and Derivative Works thereof.
|
|
62
|
+
|
|
63
|
+
"Contribution" shall mean any work of authorship, including the original version
|
|
64
|
+
of the Work and any modifications or additions to that Work or Derivative Works
|
|
65
|
+
thereof, that is intentionally submitted to Licensor for inclusion in the Work
|
|
66
|
+
by the copyright owner or by an individual or Legal Entity authorized to submit
|
|
67
|
+
on behalf of the copyright owner. For the purposes of this definition,
|
|
68
|
+
"submitted" means any form of electronic, verbal, or written communication sent
|
|
69
|
+
to the Licensor or its representatives, including but not limited to
|
|
70
|
+
communication on electronic mailing lists, source code control systems, and
|
|
71
|
+
issue tracking systems that are managed by, or on behalf of, the Licensor for
|
|
72
|
+
the purpose of discussing and improving the Work, but excluding communication
|
|
73
|
+
that is conspicuously marked or otherwise designated in writing by the copyright
|
|
74
|
+
owner as "Not a Contribution."
|
|
75
|
+
|
|
76
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
|
77
|
+
of whom a Contribution has been received by Licensor and subsequently
|
|
78
|
+
incorporated within the Work.
|
|
79
|
+
|
|
80
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
81
|
+
License, each Contributor hereby grants to You a perpetual, worldwide, non-
|
|
82
|
+
exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce,
|
|
83
|
+
prepare Derivative Works of, publicly display, publicly perform, sublicense, and
|
|
84
|
+
distribute the Work and such Derivative Works in Source or Object form.
|
|
85
|
+
|
|
86
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License,
|
|
87
|
+
each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-
|
|
88
|
+
charge, royalty-free, irrevocable (except as stated in this section) patent
|
|
89
|
+
license to make, have made, use, offer to sell, sell, import, and otherwise
|
|
90
|
+
transfer the Work, where such license applies only to those patent claims
|
|
91
|
+
licensable by such Contributor that are necessarily infringed by their
|
|
92
|
+
Contribution(s) alone or by combination of their Contribution(s) with the Work
|
|
93
|
+
to which such Contribution(s) was submitted. If You institute patent litigation
|
|
94
|
+
against any entity (including a cross-claim or counterclaim in a lawsuit)
|
|
95
|
+
alleging that the Work or a Contribution incorporated within the Work
|
|
96
|
+
constitutes direct or contributory patent infringement, then any patent licenses
|
|
97
|
+
granted to You under this License for that Work shall terminate as of the date
|
|
98
|
+
such litigation is filed.
|
|
99
|
+
|
|
100
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
101
|
+
Derivative Works thereof in any medium, with or without modifications, and in
|
|
102
|
+
Source or Object form, provided that You meet the following conditions:
|
|
103
|
+
|
|
104
|
+
You must give any other recipients of the Work or Derivative Works a copy of
|
|
105
|
+
this License; and
|
|
106
|
+
|
|
107
|
+
You must cause any modified files to carry prominent notices stating that You
|
|
108
|
+
changed the files; and
|
|
109
|
+
|
|
110
|
+
You must retain, in the Source form of any Derivative Works that You distribute,
|
|
111
|
+
all copyright, patent, trademark, and attribution notices from the Source form
|
|
112
|
+
of the Work, excluding those notices that do not pertain to any part of the
|
|
113
|
+
Derivative Works; and
|
|
114
|
+
|
|
115
|
+
If the Work includes a "NOTICE" text file as part of its distribution, then any
|
|
116
|
+
Derivative Works that You distribute must include a readable copy of the
|
|
117
|
+
attribution notices contained within such NOTICE file, excluding those notices
|
|
118
|
+
that do not pertain to any part of the Derivative Works, in at least one of the
|
|
119
|
+
following places: within a NOTICE text file distributed as part of the
|
|
120
|
+
Derivative Works; within the Source form or documentation, if provided along
|
|
121
|
+
with the Derivative Works; or, within a display generated by the Derivative
|
|
122
|
+
Works, if and wherever such third-party notices normally appear. The contents of
|
|
123
|
+
the NOTICE file are for informational purposes only and do not modify the
|
|
124
|
+
License. You may add Your own attribution notices within Derivative Works that
|
|
125
|
+
You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
|
126
|
+
provided that such additional attribution notices cannot be construed as
|
|
127
|
+
modifying the License. You may add Your own copyright statement to Your
|
|
128
|
+
modifications and may provide additional or different license terms and
|
|
129
|
+
conditions for use, reproduction, or distribution of Your modifications, or for
|
|
130
|
+
any such Derivative Works as a whole, provided Your use, reproduction, and
|
|
131
|
+
distribution of the Work otherwise complies with the conditions stated in this
|
|
132
|
+
License.
|
|
133
|
+
|
|
134
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
135
|
+
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
136
|
+
Licensor shall be under the terms and conditions of this License, without any
|
|
137
|
+
additional terms or conditions. Notwithstanding the above, nothing herein shall
|
|
138
|
+
supersede or modify the terms of any separate license agreement you may have
|
|
139
|
+
executed with Licensor regarding such Contributions.
|
|
140
|
+
|
|
141
|
+
6. Trademarks. This License does not grant permission to use the trade names,
|
|
142
|
+
trademarks, service marks, or product names of the Licensor, except as required
|
|
143
|
+
for reasonable and customary use in describing the origin of the Work and
|
|
144
|
+
reproducing the content of the NOTICE file.
|
|
145
|
+
|
|
146
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
147
|
+
writing, Licensor provides the Work (and each Contributor provides its
|
|
148
|
+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
149
|
+
KIND, either express or implied, including, without limitation, any warranties
|
|
150
|
+
or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
151
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
152
|
+
appropriateness of using or redistributing the Work and assume any risks
|
|
153
|
+
associated with Your exercise of permissions under this License.
|
|
154
|
+
|
|
155
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
156
|
+
tort (including negligence), contract, or otherwise, unless required by
|
|
157
|
+
applicable law (such as deliberate and grossly negligent acts) or agreed to in
|
|
158
|
+
writing, shall any Contributor be liable to You for damages, including any
|
|
159
|
+
direct, indirect, special, incidental, or consequential damages of any character
|
|
160
|
+
arising as a result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill, work stoppage,
|
|
162
|
+
computer failure or malfunction, or any and all other commercial damages or
|
|
163
|
+
losses), even if such Contributor has been advised of the possibility of such
|
|
164
|
+
damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or
|
|
167
|
+
Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
168
|
+
acceptance of support, warranty, indemnity, or other liability obligations
|
|
169
|
+
and/or rights consistent with this License. However, in accepting such
|
|
170
|
+
obligations, You may act only on Your own behalf and on Your sole
|
|
171
|
+
responsibility, not on behalf of any other Contributor, and only if You agree to
|
|
172
|
+
indemnify, defend, and hold each Contributor harmless for any liability incurred
|
|
173
|
+
by, or claims asserted against, such Contributor by reason of your accepting any
|
|
174
|
+
such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
* For reflect-metadata see also this required NOTICE:
|
|
178
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
------
|
|
182
|
+
|
|
183
|
+
** WebRTC adapter; version 8.1.1 -- https://github.com/webrtcHacks/adapter
|
|
184
|
+
Copyright (c) 2014, The WebRTC project authors. All rights reserved. Copyright
|
|
185
|
+
(c) 2018, The adapter.js project authors. All rights reserved.
|
|
186
|
+
|
|
187
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
188
|
+
are permitted provided that the following conditions are met:
|
|
189
|
+
|
|
190
|
+
Redistributions of source code must retain the above copyright notice, this list
|
|
191
|
+
of conditions and the following disclaimer.
|
|
192
|
+
|
|
193
|
+
Redistributions in binary form must reproduce the above copyright notice, this
|
|
194
|
+
list of conditions and the following disclaimer in the documentation and/or
|
|
195
|
+
other materials provided with the distribution.
|
|
196
|
+
|
|
197
|
+
Neither the name of Google nor the names of its contributors may be used to
|
|
198
|
+
endorse or promote products derived from this software without specific prior
|
|
199
|
+
written permission.
|
|
200
|
+
|
|
201
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
202
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
203
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
204
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
205
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
206
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
207
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
208
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
209
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
210
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
211
|
+
|
|
212
|
+
------
|
|
213
|
+
|
|
214
|
+
** inversify; version 6.0.1 -- https://github.com/inversify/InversifyJS
|
|
215
|
+
Copyright © 2015-2017 Remo H. Jansen
|
|
216
|
+
|
|
217
|
+
The MIT License (MIT)
|
|
218
|
+
|
|
219
|
+
Copyright (c) 2015-2017 Remo H. Jansen
|
|
220
|
+
|
|
221
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
222
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
223
|
+
in the Software without restriction, including without limitation the rights
|
|
224
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
225
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
226
|
+
furnished to do so, subject to the following conditions:
|
|
227
|
+
|
|
228
|
+
The above copyright notice and this permission notice shall be included in all
|
|
229
|
+
copies or substantial portions of the Software.
|
|
230
|
+
|
|
231
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
232
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
233
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
234
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
235
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
236
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
237
|
+
SOFTWARE.
|
|
238
|
+
|
|
239
|
+
------
|
|
240
|
+
|
|
241
|
+
** inversify-inject-decorators; version 3.1.0 -- https://github.com/inversify/inversify-inject-decorators
|
|
242
|
+
Copyright (c) 2016 inversify
|
|
243
|
+
|
|
244
|
+
The MIT License (MIT)
|
|
245
|
+
|
|
246
|
+
Copyright (c) 2016 inversify
|
|
247
|
+
|
|
248
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
249
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
250
|
+
in the Software without restriction, including without limitation the rights
|
|
251
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
252
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
253
|
+
furnished to do so, subject to the following conditions:
|
|
254
|
+
|
|
255
|
+
The above copyright notice and this permission notice shall be included in all
|
|
256
|
+
copies or substantial portions of the Software.
|
|
257
|
+
|
|
258
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
259
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
260
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
261
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
262
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
263
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
264
|
+
SOFTWARE.
|
|
265
|
+
|
|
266
|
+
------
|
|
267
|
+
|
|
268
|
+
** eventemitter3; version 4.0.7 -- https://www.npmjs.com/package/eventemitter3
|
|
269
|
+
Copyright (c) 2014 Arnout Kazemier
|
|
270
|
+
** lodash.js; version 4.5.0 -- http://lodash.com
|
|
271
|
+
Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
|
272
|
+
Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
|
|
273
|
+
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
274
|
+
|
|
275
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
276
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
277
|
+
in the Software without restriction, including without limitation the rights
|
|
278
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
279
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
280
|
+
furnished to do so, subject to the following conditions:
|
|
281
|
+
|
|
282
|
+
The above copyright notice and this permission notice shall be included in all
|
|
283
|
+
copies or substantial portions of the Software.
|
|
284
|
+
|
|
285
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
286
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
287
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
288
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
289
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
290
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
291
|
+
SOFTWARE.
|
|
292
|
+
|
|
293
|
+
------
|
|
294
|
+
|
|
295
|
+
** bowser; version 2.11.0 -- https://github.com/lancedikson/bowser
|
|
296
|
+
Copyright 2015, Dustin Diaz (the "Original Author")
|
|
297
|
+
All rights reserved.
|
|
298
|
+
|
|
299
|
+
Permission is hereby granted, free of charge, to any person
|
|
300
|
+
obtaining a copy of this software and associated documentation
|
|
301
|
+
files (the "Software"), to deal in the Software without
|
|
302
|
+
restriction, including without limitation the rights to use,
|
|
303
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
304
|
+
copies of the Software, and to permit persons to whom the
|
|
305
|
+
Software is furnished to do so, subject to the following
|
|
306
|
+
conditions:
|
|
307
|
+
|
|
308
|
+
The above copyright notice and this permission notice shall be
|
|
309
|
+
included in all copies or substantial portions of the Software.
|
|
310
|
+
|
|
311
|
+
Distributions of all or part of the Software intended to be used
|
|
312
|
+
by the recipients as they would use the unmodified Software,
|
|
313
|
+
containing modifications that substantially alter, remove, or
|
|
314
|
+
disable functionality of the Software, outside of the documented
|
|
315
|
+
configuration mechanisms provided by the Software, shall be
|
|
316
|
+
modified such that the Original Author's bug reporting email
|
|
317
|
+
addresses and urls are either replaced with the contact information
|
|
318
|
+
of the parties responsible for the changes, or removed entirely.
|
|
319
|
+
|
|
320
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
321
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
322
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
323
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
324
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
325
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
326
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
327
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
Except where noted, this license applies to any and all software
|
|
331
|
+
programs and associated documentation files created by the
|
|
332
|
+
Original Author, when distributed with the Software.
|
package/README.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Amazon IVS Web Broadcast SDK
|
|
2
|
+
|
|
3
|
+
Amazon Interactive Video Service (Amazon IVS) web broadcast SDK gives you the ability to capture live video from web browsers and send as an input to an Amazon IVS channel. You can include it on new and existing websites, with support for both desktop and mobile web browsers.
|
|
4
|
+
|
|
5
|
+
## Copyright and License
|
|
6
|
+
|
|
7
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
8
|
+
|
|
9
|
+
Provided as AWS Content and subject to the [AWS Customer Agreement](https://aws.amazon.com/agreement/) and any other
|
|
10
|
+
agreement with AWS governing your use of AWS services.
|
|
11
|
+
|
|
12
|
+
See [full license text](https://web-broadcast.live-video.net/latest/LICENSE.txt) for more information.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see amazon-ivs-web-broadcast.js.LICENSE.txt */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.IVSBroadcastClient=t():e.IVSBroadcastClient=t()}(self,(()=>(()=>{var e={1206:function(e){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(n),s=Math.max(i,o),a=0,c=e.map([t,n],(function(t){var n=s-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(a=s-Math.min(i,o)),s-=1;s>=a;){if(c[0][s]>c[1][s])return 1;if(c[0][s]===c[1][s]){if(s===a)return 0;s-=1}else if(c[0][s]<c[1][s])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=e,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];if(Object.assign)return Object.assign.apply(Object,[e].concat(o));var a=function(){var e=o[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,n=o.length;t<n;t+=1)a();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,n){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},o=n(18);function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(){}var t,n;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,n=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}],null&&s(t.prototype,null),n&&s(t,n),e}();t.default=a,e.exports=t.default},91:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=c(n(92)),i=c(n(93)),o=c(n(94)),s=c(n(95)),a=c(n(17));function c(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=a.default.find(r.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=a.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=a.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=a.default.find(s.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return a.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},o=0;if(Object.keys(e).forEach((function(t){var s=e[t];"string"==typeof s?(i[t]=s,o+=1):"object"==typeof s&&(n[t]=s,r+=1)})),r>0){var s=Object.keys(n),c=a.default.find(s,(function(e){return t.isOS(e)}));if(c){var u=this.satisfies(n[c]);if(void 0!==u)return u}var d=a.default.find(s,(function(e){return t.isPlatform(e)}));if(d){var p=this.satisfies(n[d]);if(void 0!==p)return p}}if(o>0){var l=Object.keys(i),f=a.default.find(l,(function(e){return t.isBrowser(e,!0)}));if(void 0!==f)return this.compareVersion(i[f])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=a.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(a.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=u,e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=/version\/(\d+(\.?_?\d+)+)/i,s=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=s,e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:o.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:o.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:o.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=s,e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=s,e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=s,e.exports=t.default}})},6729:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new i(r,o||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=new Array(o);i<o;i++)s[i]=r[i].fn;return s},a.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},a.prototype.emit=function(e,t,r,i,o,s){var a=n?n+e:e;if(!this._events[a])return!1;var c,u,d=this._events[a],p=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),p){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,r),!0;case 4:return d.fn.call(d.context,t,r,i),!0;case 5:return d.fn.call(d.context,t,r,i,o),!0;case 6:return d.fn.call(d.context,t,r,i,o,s),!0}for(u=1,c=new Array(p-1);u<p;u++)c[u-1]=arguments[u];d.fn.apply(d.context,c)}else{var l,f=d.length;for(u=0;u<f;u++)switch(d[u].once&&this.removeListener(e,d[u].fn,void 0,!0),p){case 1:d[u].fn.call(d[u].context);break;case 2:d[u].fn.call(d[u].context,t);break;case 3:d[u].fn.call(d[u].context,t,r);break;case 4:d[u].fn.call(d[u].context,t,r,i);break;default:if(!c)for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];d[u].fn.apply(d[u].context,c)}}return!0},a.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||i&&!a.once||r&&a.context!==r||s(this,o);else{for(var c=0,u=[],d=a.length;c<d;c++)(a[c].fn!==t||i&&!a[c].once||r&&a[c].context!==r)&&u.push(a[c]);u.length?this._events[o]=1===u.length?u[0]:u:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a},7375:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Symbol.for("INJECTION");function r(e,t,r,i){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return i&&!Reflect.hasMetadata(n,this,t)&&Reflect.defineMetadata(n,r(),this,t),Reflect.hasMetadata(n,this,t)?Reflect.getMetadata(n,this,t):r()},set:function(e){Reflect.defineMetadata(n,e,this,t)}})}t.makePropertyInjectDecorator=function(e,t){return function(n){return function(i,o){r(i,o,(function(){return e.get(n)}),t)}}},t.makePropertyInjectNamedDecorator=function(e,t){return function(n,i){return function(o,s){r(o,s,(function(){return e.getNamed(n,i)}),t)}}},t.makePropertyInjectTaggedDecorator=function(e,t){return function(n,i,o){return function(s,a){r(s,a,(function(){return e.getTagged(n,i,o)}),t)}}},t.makePropertyMultiInjectDecorator=function(e,t){return function(n){return function(i,o){r(i,o,(function(){return e.getAll(n)}),t)}}}},4879:(e,t,n)=>{"use strict";var r=n(7375);t.Z=function(e,t){return void 0===t&&(t=!0),{lazyInject:r.makePropertyInjectDecorator(e,t),lazyInjectNamed:r.makePropertyInjectNamedDecorator(e,t),lazyInjectTagged:r.makePropertyInjectTaggedDecorator(e,t),lazyMultiInject:r.makePropertyMultiInjectDecorator(e,t)}}},1989:(e,t,n)=>{var r=n(1789),i=n(401),o=n(7667),s=n(1327),a=n(1866);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=s,c.prototype.set=a,e.exports=c},8407:(e,t,n)=>{var r=n(7040),i=n(4125),o=n(2117),s=n(7518),a=n(4705);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=s,c.prototype.set=a,e.exports=c},7071:(e,t,n)=>{var r=n(852)(n(5639),"Map");e.exports=r},3369:(e,t,n)=>{var r=n(4785),i=n(1285),o=n(6e3),s=n(9916),a=n(5265);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=s,c.prototype.set=a,e.exports=c},6384:(e,t,n)=>{var r=n(8407),i=n(7465),o=n(3779),s=n(7599),a=n(4758),c=n(4309);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=s,u.prototype.has=a,u.prototype.set=c,e.exports=u},2705:(e,t,n)=>{var r=n(5639).Symbol;e.exports=r},1149:(e,t,n)=>{var r=n(5639).Uint8Array;e.exports=r},6874:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},4636:(e,t,n)=>{var r=n(2545),i=n(5694),o=n(1469),s=n(4144),a=n(5776),c=n(6719),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),d=!n&&i(e),p=!n&&!d&&s(e),l=!n&&!d&&!p&&c(e),f=n||d||p||l,h=f?r(e.length,String):[],m=h.length;for(var v in e)!t&&!u.call(e,v)||f&&("length"==v||p&&("offset"==v||"parent"==v)||l&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||a(v,m))||h.push(v);return h}},6556:(e,t,n)=>{var r=n(9465),i=n(7813);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},4865:(e,t,n)=>{var r=n(9465),i=n(7813),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var s=e[t];o.call(e,t)&&i(s,n)&&(void 0!==n||t in e)||r(e,t,n)}},8470:(e,t,n)=>{var r=n(7813);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},9465:(e,t,n)=>{var r=n(8777);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},3118:(e,t,n)=>{var r=n(3218),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},8483:(e,t,n)=>{var r=n(5063)();e.exports=r},4239:(e,t,n)=>{var r=n(2705),i=n(9607),o=n(2333),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},9454:(e,t,n)=>{var r=n(4239),i=n(7005);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},8458:(e,t,n)=>{var r=n(3560),i=n(5346),o=n(3218),s=n(346),a=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,d=c.toString,p=u.hasOwnProperty,l=RegExp("^"+d.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?l:a).test(s(e))}},8749:(e,t,n)=>{var r=n(4239),i=n(1780),o=n(7005),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!s[r(e)]}},313:(e,t,n)=>{var r=n(3218),i=n(5726),o=n(3498),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var a in e)("constructor"!=a||!t&&s.call(e,a))&&n.push(a);return n}},2980:(e,t,n)=>{var r=n(6384),i=n(6556),o=n(8483),s=n(9783),a=n(3218),c=n(1704),u=n(6390);e.exports=function e(t,n,d,p,l){t!==n&&o(n,(function(o,c){if(l||(l=new r),a(o))s(t,n,c,d,e,p,l);else{var f=p?p(u(t,c),o,c+"",t,n,l):void 0;void 0===f&&(f=o),i(t,c,f)}}),c)}},9783:(e,t,n)=>{var r=n(6556),i=n(4626),o=n(7133),s=n(278),a=n(8517),c=n(5694),u=n(1469),d=n(9246),p=n(4144),l=n(3560),f=n(3218),h=n(8630),m=n(6719),v=n(6390),g=n(9881);e.exports=function(e,t,n,y,b,_,w){var S=v(e,n),C=v(t,n),T=w.get(C);if(T)r(e,n,T);else{var E=_?_(S,C,n+"",e,t,w):void 0,R=void 0===E;if(R){var O=u(C),P=!O&&p(C),A=!O&&!P&&m(C);E=C,O||P||A?u(S)?E=S:d(S)?E=s(S):P?(R=!1,E=i(C,!0)):A?(R=!1,E=o(C,!0)):E=[]:h(C)||c(C)?(E=S,c(S)?E=g(S):f(S)&&!l(S)||(E=a(C))):R=!1}R&&(w.set(C,E),b(E,C,y,_,w),w.delete(C)),r(e,n,E)}}},5976:(e,t,n)=>{var r=n(6557),i=n(5357),o=n(61);e.exports=function(e,t){return o(i(e,t,r),e+"")}},6560:(e,t,n)=>{var r=n(5703),i=n(8777),o=n(6557),s=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=s},2545:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},1717:e=>{e.exports=function(e){return function(t){return e(t)}}},4318:(e,t,n)=>{var r=n(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},4626:(e,t,n)=>{e=n.nmd(e);var r=n(5639),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i?r.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}},7133:(e,t,n)=>{var r=n(4318);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},278:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},8363:(e,t,n)=>{var r=n(4865),i=n(9465);e.exports=function(e,t,n,o){var s=!n;n||(n={});for(var a=-1,c=t.length;++a<c;){var u=t[a],d=o?o(n[u],e[u],u,n,e):void 0;void 0===d&&(d=e[u]),s?i(n,u,d):r(n,u,d)}return n}},4429:(e,t,n)=>{var r=n(5639)["__core-js_shared__"];e.exports=r},1463:(e,t,n)=>{var r=n(5976),i=n(6612);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(o--,s):void 0,a&&i(n[0],n[1],a)&&(s=o<3?void 0:s,o=1),t=Object(t);++r<o;){var c=n[r];c&&e(t,c,r,s)}return t}))}},5063:e=>{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var c=s[e?a:++i];if(!1===n(o[c],c,o))break}return t}}},8777:(e,t,n)=>{var r=n(852),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},1957:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},5050:(e,t,n)=>{var r=n(7019);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},852:(e,t,n)=>{var r=n(8458),i=n(7801);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},5924:(e,t,n)=>{var r=n(5569)(Object.getPrototypeOf,Object);e.exports=r},9607:(e,t,n)=>{var r=n(2705),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[a]=n:delete e[a]),i}},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},1789:(e,t,n)=>{var r=n(4536);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,n)=>{var r=n(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},1327:(e,t,n)=>{var r=n(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},1866:(e,t,n)=>{var r=n(4536);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},8517:(e,t,n)=>{var r=n(3118),i=n(5924),o=n(5726);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},6612:(e,t,n)=>{var r=n(7813),i=n(8612),o=n(5776),s=n(3218);e.exports=function(e,t,n){if(!s(n))return!1;var a=typeof t;return!!("number"==a?i(n)&&o(t,n.length):"string"==a&&t in n)&&r(n[t],e)}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},5346:(e,t,n)=>{var r,i=n(4429),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,n)=>{var r=n(8470),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},2117:(e,t,n)=>{var r=n(8470);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},7518:(e,t,n)=>{var r=n(8470);e.exports=function(e){return r(this.__data__,e)>-1}},4705:(e,t,n)=>{var r=n(8470);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},4785:(e,t,n)=>{var r=n(1989),i=n(8407),o=n(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},1285:(e,t,n)=>{var r=n(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,n)=>{var r=n(5050);e.exports=function(e){return r(this,e).get(e)}},9916:(e,t,n)=>{var r=n(5050);e.exports=function(e){return r(this,e).has(e)}},5265:(e,t,n)=>{var r=n(5050);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},4536:(e,t,n)=>{var r=n(852)(Object,"create");e.exports=r},3498:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},1167:(e,t,n)=>{e=n.nmd(e);var r=n(1957),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i&&r.process,a=function(){try{return o&&o.require&&o.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},5357:(e,t,n)=>{var r=n(6874),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,s=-1,a=i(o.length-t,0),c=Array(a);++s<a;)c[s]=o[t+s];s=-1;for(var u=Array(t+1);++s<t;)u[s]=o[s];return u[t]=n(c),r(e,this,u)}}},5639:(e,t,n)=>{var r=n(1957),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},6390:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},61:(e,t,n)=>{var r=n(6560),i=n(1275)(r);e.exports=i},1275:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},7465:(e,t,n)=>{var r=n(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,n)=>{var r=n(8407),i=n(7071),o=n(3369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(s)}return n.set(e,t),this.size=n.size,this}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5703:e=>{e.exports=function(e){return function(){return e}}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},6557:e=>{e.exports=function(e){return e}},5694:(e,t,n)=>{var r=n(9454),i=n(7005),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return i(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=c},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,n)=>{var r=n(3560),i=n(1780);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},9246:(e,t,n)=>{var r=n(8612),i=n(7005);e.exports=function(e){return i(e)&&r(e)}},4144:(e,t,n)=>{e=n.nmd(e);var r=n(5639),i=n(5062),o=t&&!t.nodeType&&t,s=o&&e&&!e.nodeType&&e,a=s&&s.exports===o?r.Buffer:void 0,c=(a?a.isBuffer:void 0)||i;e.exports=c},3560:(e,t,n)=>{var r=n(4239),i=n(3218);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8630:(e,t,n)=>{var r=n(4239),i=n(5924),o=n(7005),s=Function.prototype,a=Object.prototype,c=s.toString,u=a.hasOwnProperty,d=c.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==d}},6719:(e,t,n)=>{var r=n(8749),i=n(1717),o=n(1167),s=o&&o.isTypedArray,a=s?i(s):r;e.exports=a},1704:(e,t,n)=>{var r=n(4636),i=n(313),o=n(8612);e.exports=function(e){return o(e)?r(e,!0):i(e)}},2492:(e,t,n)=>{var r=n(2980),i=n(1463)((function(e,t,n){r(e,t,n)}));e.exports=i},5062:e=>{e.exports=function(){return!1}},9881:(e,t,n)=>{var r=n(8363),i=n(1704);e.exports=function(e){return r(e,i(e))}},8660:(e,t,n)=>{var r;!function(e){!function(t){var r="object"==typeof n.g?n.g:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(e);function o(e,t){return function(n,r){"function"!=typeof e[n]&&Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0===r.Reflect?r.Reflect=e:i=o(r.Reflect,i),function(e){var t=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,s={__proto__:[]}instanceof Array,a=!o&&!s,c={create:o?function(){return j(Object.create(null))}:s?function(){return j({__proto__:null})}:function(){return j({})},has:a?function(e,n){return t.call(e,n)}:function(e,t){return t in e},get:a?function(e,n){return t.call(e,n)?e[n]:void 0}:function(e,t){return e[t]}},u=Object.getPrototypeOf(Function),d="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,p=d||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,s)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function s(e,t){return[e,t]}}():Map,l=d||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function e(){this._map=new p}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}():Set,f=new(d||"function"!=typeof WeakMap?function(){var e=c.create(),n=r();return function(){function e(){this._key=r()}return e.prototype.has=function(e){var t=i(e,!1);return void 0!==t&&c.has(t,this._key)},e.prototype.get=function(e){var t=i(e,!1);return void 0!==t?c.get(t,this._key):void 0},e.prototype.set=function(e,t){return i(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=i(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=r()},e}();function r(){var t;do{t="@@WeakMap@@"+s()}while(c.has(e,t));return e[t]=!0,t}function i(e,r){if(!t.call(e,n)){if(!r)return;Object.defineProperty(e,n,{value:c.create()})}return e[n]}function o(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function s(){var e,t=(e=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):o(new Uint8Array(e),e):o(new Array(e),e));t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;r<16;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}():WeakMap);function h(e,t,n){var r=f.get(e);if(C(r)){if(!n)return;r=new p,f.set(e,r)}var i=r.get(t);if(C(i)){if(!n)return;i=new p,r.set(t,i)}return i}function m(e,t,n){if(v(e,t,n))return!0;var r=D(t);return!T(r)&&m(e,r,n)}function v(e,t,n){var r=h(t,n,!1);return!C(r)&&!!r.has(e)}function g(e,t,n){if(v(e,t,n))return y(e,t,n);var r=D(t);return T(r)?void 0:g(e,r,n)}function y(e,t,n){var r=h(t,n,!1);if(!C(r))return r.get(e)}function b(e,t,n,r){h(n,r,!0).set(e,t)}function _(e,t){var n=w(e,t),r=D(e);if(null===r)return n;var i=_(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new l,s=[],a=0,c=n;a<c.length;a++){var u=c[a];o.has(u)||(o.add(u),s.push(u))}for(var d=0,p=i;d<p.length;d++)u=p[d],o.has(u)||(o.add(u),s.push(u));return s}function w(e,t){var n=[],r=h(e,t,!1);if(C(r))return n;for(var o=function(e){var t=M(e,i);if(!A(t))throw new TypeError;var n=t.call(e);if(!E(n))throw new TypeError;return n}(r.keys()),s=0;;){var a=I(o);if(!a)return n.length=s,n;var c=a.value;try{n[s]=c}catch(e){try{k(o)}finally{throw e}}s++}}function S(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function C(e){return void 0===e}function T(e){return null===e}function E(e){return"object"==typeof e?null!==e:"function"==typeof e}function R(e,t){switch(S(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",i=M(e,r);if(void 0!==i){var o=i.call(e,n);if(E(o))throw new TypeError;return o}return function(e,t){if("string"===t){var n=e.toString;if(A(n)&&!E(i=n.call(e)))return i;if(A(r=e.valueOf)&&!E(i=r.call(e)))return i}else{var r;if(A(r=e.valueOf)&&!E(i=r.call(e)))return i;var i,o=e.toString;if(A(o)&&!E(i=o.call(e)))return i}throw new TypeError}(e,"default"===n?"number":n)}function O(e){var t=R(e,3);return"symbol"==typeof t?t:function(e){return""+e}(t)}function P(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function A(e){return"function"==typeof e}function x(e){return"function"==typeof e}function M(e,t){var n=e[t];if(null!=n){if(!A(n))throw new TypeError;return n}}function I(e){var t=e.next();return!t.done&&t}function k(e){var t=e.return;t&&t.call(e)}function D(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===u)return t;if(t!==u)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function j(e){return e.__=void 0,delete e.__,e}e("decorate",(function(e,t,n,r){if(C(n)){if(!P(e))throw new TypeError;if(!x(t))throw new TypeError;return function(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!C(r)&&!T(r)){if(!x(r))throw new TypeError;t=r}}return t}(e,t)}if(!P(e))throw new TypeError;if(!E(t))throw new TypeError;if(!E(r)&&!C(r)&&!T(r))throw new TypeError;return T(r)&&(r=void 0),function(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!C(o)&&!T(o)){if(!E(o))throw new TypeError;r=o}}return r}(e,t,n=O(n),r)})),e("metadata",(function(e,t){return function(n,r){if(!E(n))throw new TypeError;if(!C(r)&&!function(e){switch(S(e)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;b(e,t,n,r)}})),e("defineMetadata",(function(e,t,n,r){if(!E(n))throw new TypeError;return C(r)||(r=O(r)),b(e,t,n,r)})),e("hasMetadata",(function(e,t,n){if(!E(t))throw new TypeError;return C(n)||(n=O(n)),m(e,t,n)})),e("hasOwnMetadata",(function(e,t,n){if(!E(t))throw new TypeError;return C(n)||(n=O(n)),v(e,t,n)})),e("getMetadata",(function(e,t,n){if(!E(t))throw new TypeError;return C(n)||(n=O(n)),g(e,t,n)})),e("getOwnMetadata",(function(e,t,n){if(!E(t))throw new TypeError;return C(n)||(n=O(n)),y(e,t,n)})),e("getMetadataKeys",(function(e,t){if(!E(e))throw new TypeError;return C(t)||(t=O(t)),_(e,t)})),e("getOwnMetadataKeys",(function(e,t){if(!E(e))throw new TypeError;return C(t)||(t=O(t)),w(e,t)})),e("deleteMetadata",(function(e,t,n){if(!E(t))throw new TypeError;C(n)||(n=O(n));var r=h(t,n,!1);if(C(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=f.get(t);return i.delete(n),i.size>0||f.delete(t),!0}))}(i)}()}(r||(r={}))},7539:e=>{"use strict";const t={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split("\n").map((e=>e.trim()))},t.splitSections=function(e){return e.split("\nm=").map(((e,t)=>(t>0?"m="+e:e).trim()+"\r\n"))},t.getDescription=function(e){const n=t.splitSections(e);return n&&n[0]},t.getMediaSections=function(e){const n=t.splitSections(e);return n.shift(),n},t.matchPrefix=function(e,n){return t.splitLines(e).filter((e=>0===e.indexOf(n)))},t.parseCandidate=function(e){let t;t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" ");const n={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case"raddr":n.relatedAddress=t[e+1];break;case"rport":n.relatedPort=parseInt(t[e+1],10);break;case"tcptype":n.tcpType=t[e+1];break;case"ufrag":n.ufrag=t[e+1],n.usernameFragment=t[e+1];break;default:void 0===n[t[e]]&&(n[t[e]]=t[e+1])}return n},t.writeCandidate=function(e){const t=[];t.push(e.foundation);const n=e.component;"rtp"===n?t.push(1):"rtcp"===n?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);const r=e.type;return t.push("typ"),t.push(r),"host"!==r&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(e){return e.substr(14).split(" ")},t.parseRtpMap=function(e){let t=e.substr(9).split(" ");const n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},t.writeRtpMap=function(e){let t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);const n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},t.parseExtmap=function(e){const t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},t.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},t.parseFmtp=function(e){const t={};let n;const r=e.substr(e.indexOf(" ")+1).split(";");for(let e=0;e<r.length;e++)n=r[e].trim().split("="),t[n[0].trim()]=n[1];return t},t.writeFmtp=function(e){let t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){const r=[];Object.keys(e.parameters).forEach((t=>{void 0!==e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)})),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},t.parseRtcpFb=function(e){const t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(e){let t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((e=>{t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(e){const t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},t.parseSsrcGroup=function(e){const t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((e=>parseInt(e,10)))}},t.getMid=function(e){const n=t.matchPrefix(e,"a=mid:")[0];if(n)return n.substr(6)},t.parseFingerprint=function(e){const t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(e,n){return{role:"auto",fingerprints:t.matchPrefix(e+n,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(e,t){let n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((e=>{n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},t.parseCryptoLine=function(e){const t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?t.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;const t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},t.getCryptoParameters=function(e,n){return t.matchPrefix(e+n,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(e,n){const r=t.matchPrefix(e+n,"a=ice-ufrag:")[0],i=t.matchPrefix(e+n,"a=ice-pwd:")[0];return r&&i?{usernameFragment:r.substr(12),password:i.substr(10)}:null},t.writeIceParameters=function(e){let t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(e){const n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=t.splitLines(e)[0].split(" ");for(let i=3;i<r.length;i++){const o=r[i],s=t.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){const r=t.parseRtpMap(s),i=t.matchPrefix(e,"a=fmtp:"+o+" ");switch(r.parameters=i.length?t.parseFmtp(i[0]):{},r.rtcpFeedback=t.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(t.parseRtcpFb),n.codecs.push(r),r.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(r.name.toUpperCase())}}}return t.matchPrefix(e,"a=extmap:").forEach((e=>{n.headerExtensions.push(t.parseExtmap(e))})),n},t.writeRtpDescription=function(e,n){let r="";r+="m="+e+" ",r+=n.codecs.length>0?"9":"0",r+=" UDP/TLS/RTP/SAVPF ",r+=n.codecs.map((e=>void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType)).join(" ")+"\r\n",r+="c=IN IP4 0.0.0.0\r\n",r+="a=rtcp:9 IN IP4 0.0.0.0\r\n",n.codecs.forEach((e=>{r+=t.writeRtpMap(e),r+=t.writeFmtp(e),r+=t.writeRtcpFb(e)}));let i=0;return n.codecs.forEach((e=>{e.maxptime>i&&(i=e.maxptime)})),i>0&&(r+="a=maxptime:"+i+"\r\n"),n.headerExtensions&&n.headerExtensions.forEach((e=>{r+=t.writeExtmap(e)})),r},t.parseRtpEncodingParameters=function(e){const n=[],r=t.parseRtpParameters(e),i=-1!==r.fecMechanisms.indexOf("RED"),o=-1!==r.fecMechanisms.indexOf("ULPFEC"),s=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute)),a=s.length>0&&s[0].ssrc;let c;const u=t.matchPrefix(e,"a=ssrc-group:FID").map((e=>e.substr(17).split(" ").map((e=>parseInt(e,10)))));u.length>0&&u[0].length>1&&u[0][0]===a&&(c=u[0][1]),r.codecs.forEach((e=>{if("RTX"===e.name.toUpperCase()&&e.parameters.apt){let t={ssrc:a,codecPayloadType:parseInt(e.parameters.apt,10)};a&&c&&(t.rtx={ssrc:c}),n.push(t),i&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:a,mechanism:o?"red+ulpfec":"red"},n.push(t))}})),0===n.length&&a&&n.push({ssrc:a});let d=t.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,n.forEach((e=>{e.maxBitrate=d}))),n},t.parseRtcpParameters=function(e){const n={},r=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"cname"===e.attribute))[0];r&&(n.cname=r.value,n.ssrc=r.ssrc);const i=t.matchPrefix(e,"a=rtcp-rsize");n.reducedSize=i.length>0,n.compound=0===i.length;const o=t.matchPrefix(e,"a=rtcp-mux");return n.mux=o.length>0,n},t.writeRtcpParameters=function(e){let t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},t.parseMsid=function(e){let n;const r=t.matchPrefix(e,"a=msid:");if(1===r.length)return n=r[0].substr(7).split(" "),{stream:n[0],track:n[1]};const i=t.matchPrefix(e,"a=ssrc:").map((e=>t.parseSsrcMedia(e))).filter((e=>"msid"===e.attribute));return i.length>0?(n=i[0].value.split(" "),{stream:n[0],track:n[1]}):void 0},t.parseSctpDescription=function(e){const n=t.parseMLine(e),r=t.matchPrefix(e,"a=max-message-size:");let i;r.length>0&&(i=parseInt(r[0].substr(19),10)),isNaN(i)&&(i=65536);const o=t.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:n.fmt,maxMessageSize:i};const s=t.matchPrefix(e,"a=sctpmap:");if(s.length>0){const e=s[0].substr(10).split(" ");return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},t.writeSctpDescription=function(e,t){let n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,21)},t.writeSessionBoilerplate=function(e,n,r){let i;const o=void 0!==n?n:2;return i=e||t.generateSessionId(),"v=0\r\no="+(r||"thisisadapterortc")+" "+i+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(e,n){const r=t.splitLines(e);for(let e=0;e<r.length;e++)switch(r[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return r[e].substr(2)}return n?t.getDirection(n):"sendrecv"},t.getKind=function(e){return t.splitLines(e)[0].split(" ")[0].substr(2)},t.isRejected=function(e){return"0"===e.split(" ",2)[1]},t.parseMLine=function(e){const n=t.splitLines(e)[0].substr(2).split(" ");return{kind:n[0],port:parseInt(n[1],10),protocol:n[2],fmt:n.slice(3).join(" ")}},t.parseOLine=function(e){const n=t.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:n[0],sessionId:n[1],sessionVersion:parseInt(n[2],10),netType:n[3],addressType:n[4],address:n[5]}},t.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;const n=t.splitLines(e);for(let e=0;e<n.length;e++)if(n[e].length<2||"="!==n[e].charAt(1))return!1;return!0},e.exports=t},477:e=>{"use strict";e.exports=function(e,t,n,r){var i=self||window;try{try{var o;try{o=new i.Blob([e])}catch(t){(o=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(e),o=o.getBlob()}var s=i.URL||i.webkitURL,a=s.createObjectURL(o),c=new i[t](a,n);return s.revokeObjectURL(a),c}catch(r){return new i[t]("data:application/javascript,".concat(encodeURIComponent(e)),n)}}catch(e){if(!r)throw Error("Inline worker is not supported");return new i[t](r,n)}}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};return(()=>{"use strict";n.d(r,{default:()=>bi});var e={};n.r(e),n.d(e,{fixNegotiationNeeded:()=>x,shimAddTrackRemoveTrack:()=>P,shimAddTrackRemoveTrackWithNative:()=>O,shimGetDisplayMedia:()=>w,shimGetSendersWithDtmf:()=>T,shimGetStats:()=>E,shimGetUserMedia:()=>_,shimMediaStream:()=>S,shimOnTrack:()=>C,shimPeerConnection:()=>A,shimSenderReceiverGetStats:()=>R});var t={};n.r(t),n.d(t,{shimAddTransceiver:()=>B,shimCreateAnswer:()=>G,shimCreateOffer:()=>U,shimGetDisplayMedia:()=>I,shimGetParameters:()=>V,shimGetUserMedia:()=>M,shimOnTrack:()=>k,shimPeerConnection:()=>D,shimRTCDataChannel:()=>L,shimReceiverGetStats:()=>N,shimRemoveStream:()=>F,shimSenderGetStats:()=>j});var i={};n.r(i),n.d(i,{shimAudioContext:()=>Q,shimCallbacksAPI:()=>q,shimConstraints:()=>H,shimCreateOfferLegacy:()=>Y,shimGetUserMedia:()=>K,shimLocalStreamsAPI:()=>W,shimRTCIceServerUrls:()=>J,shimRemoteStreamsAPI:()=>z,shimTrackEventTransceiver:()=>$});var o={};n.r(o),n.d(o,{removeExtmapAllowMixed:()=>ie,shimAddIceCandidateNullOrEmpty:()=>oe,shimConnectionState:()=>re,shimMaxMessageSize:()=>te,shimParameterlessSetLocalDescription:()=>se,shimRTCIceCandidate:()=>ee,shimSendThrowTypeError:()=>ne});var s={};n.r(s),n.d(s,{ADD_DEVICE_COMPOSITION_INDEX_MISSING_ERROR:()=>vn,ADD_DEVICE_COMPOSITION_MISSING_ERROR:()=>mn,ADD_DEVICE_DEVICE_ERROR:()=>fn,ADD_DEVICE_NAME_EXISTS_ERROR:()=>hn,ADD_DEVICE_NAME_MISSING_ERROR:()=>gn,ADD_DEVICE_UNSUPPORTED:()=>yn,BROADCAST_CONFIGURATION_ERROR:()=>An,BROADCAST_ERROR:()=>dn,CAMERA_ERROR:()=>pn,CLIENT_INVALID_ERROR:()=>jn,EXCHANGE_POSITION_DEVICE_NOT_FOUND_ERROR:()=>Tn,FAILED_TO_ADD_IMAGE_ERROR:()=>En,INGEST_ENDPOINT_TYPE_ERROR:()=>Mn,INGEST_ENDPOINT_URL_ERROR:()=>In,INPUT_ERROR:()=>ln,INVALID_STREAM_KEY:()=>Pn,LOGGER_TYPE_ERROR:()=>Dn,LOG_LEVEL_TYPE_ERROR:()=>kn,PEER_CONNECTION_ERROR:()=>On,PEER_SETUP_ERROR:()=>Rn,REMOVE_DEVICE_NOT_FOUND_ERROR:()=>bn,REMOVE_IMAGE_NOT_FOUND_ERROR:()=>_n,STREAM_CONFIGURATION_ERROR:()=>xn,UPDATE_VIDEO_DEVICE_COMPOSITION_INDEX_MISSING_ERROR:()=>Sn,UPDATE_VIDEO_DEVICE_COMPOSITION_MISSING_ERROR:()=>wn,UPDATE_VIDEO_DEVICE_COMPOSITION_NAME_NOT_FOUND_ERROR:()=>Cn});let a=!0,c=!0;function u(e,t,n){const r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}function d(e,t,n){if(!e.RTCPeerConnection)return;const r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);const o=e=>{const t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,o),i.apply(this,[e,o])};const o=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(n))return o.apply(this,arguments);const r=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get(){return this["_on"+t]},set(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}function p(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(a=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function l(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(c=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function f(){if("object"==typeof window){if(a)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function h(e,t){c&&console.warn(e+" is deprecated, please use "+t+" instead.")}function m(e){return"[object Object]"===Object.prototype.toString.call(e)}function v(e){return m(e)?Object.keys(e).reduce((function(t,n){const r=m(e[n]),i=r?v(e[n]):e[n],o=r&&!Object.keys(i).length;return void 0===i||o?t:Object.assign(t,{[n]:i})}),{}):e}function g(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach((r=>{r.endsWith("Id")?g(e,e.get(t[r]),n):r.endsWith("Ids")&&t[r].forEach((t=>{g(e,e.get(t),n)}))})))}function y(e,t,n){const r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;const o=[];return e.forEach((e=>{"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((t=>{e.forEach((n=>{n.type===r&&n.trackId===t.id&&g(e,n,i)}))})),i}const b=f;function _(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const r=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const t={};return Object.keys(e).forEach((n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);const i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];let e={};"number"==typeof r.ideal?(e[i("min",n)]=r.ideal,t.optional.push(e),e={},e[i("max",n)]=r.ideal,t.optional.push(e)):(e[i("",n)]=r.ideal,t.optional.push(e))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",n)]=r.exact):["min","max"].forEach((e=>{void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])}))})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){const t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};t((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),t(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=r(e.audio)}if(e&&"object"==typeof e.video){let o=e.video.facingMode;o=o&&("object"==typeof o?o:{ideal:o});const s=t.version<66;if(o&&("user"===o.exact||"environment"===o.exact||"user"===o.ideal||"environment"===o.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||s)){let t;if(delete e.video.facingMode,"environment"===o.exact||"environment"===o.ideal?t=["back","rear"]:"user"!==o.exact&&"user"!==o.ideal||(t=["front"]),t)return n.mediaDevices.enumerateDevices().then((n=>{let s=(n=n.filter((e=>"videoinput"===e.kind))).find((e=>t.some((t=>e.label.toLowerCase().includes(t)))));return!s&&n.length&&t.includes("back")&&(s=n[n.length-1]),s&&(e.video.deviceId=o.exact?{exact:s.deviceId}:{ideal:s.deviceId}),e.video=r(e.video),b("chrome: "+JSON.stringify(e)),i(e)}))}e.video=r(e.video)}return b("chrome: "+JSON.stringify(e)),i(e)},o=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(e,t,r){i(e,(e=>{n.webkitGetUserMedia(e,t,(e=>{r&&r(o(e))}))}))}.bind(n),n.mediaDevices.getUserMedia){const e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return i(t,(t=>e(t).then((e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(o(e))))))}}}function w(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((t=>{const r=n.video&&n.video.width,i=n.video&&n.video.height,o=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},r&&(n.video.mandatory.maxWidth=r),i&&(n.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(n)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function S(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function C(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener("addtrack",(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.track.id)):{track:n.track};const i=new Event("track");i.track=n.track,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)})),t.stream.getTracks().forEach((n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((e=>e.track&&e.track.id===n.id)):{track:n};const i=new Event("track");i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else d(e,"track",(e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e)))}function T(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){let i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};const r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);const t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach((e=>{this._senders.push(t(this,e))}))};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach((e=>{const t=this._senders.find((t=>t.track===e));t&&this._senders.splice(this._senders.indexOf(t),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function E(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,n,r]=arguments;if(arguments.length>0&&"function"==typeof e)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof e))return t.apply(this,[]);const i=function(e){const t={};return e.result().forEach((e=>{const n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((t=>{n[t]=e.stat(t)})),t[n.id]=n})),t},o=function(e){return new Map(Object.keys(e).map((t=>[t,e[t]])))};if(arguments.length>=2){const r=function(e){n(o(i(e)))};return t.apply(this,[r,e])}return new Promise(((e,n)=>{t.apply(this,[function(t){e(o(i(t)))},n])})).then(n,r)}}function R(e){if(!("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>y(t,e.track,!0)))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),d(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){const e=this;return this._pc.getStats().then((t=>y(t,e.track,!1)))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const e=arguments[0];let t,n,r;return this.getSenders().forEach((n=>{n.track===e&&(t?r=!0:t=n)})),this.getReceivers().forEach((t=>(t.track===e&&(n?r=!0:n=t),t.track===e))),r||t&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function O(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((e=>this._shimmedLocalStreams[e][0]))};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();n.apply(this,arguments);const r=this.getSenders().filter((e=>-1===t.indexOf(e)));this._shimmedLocalStreams[e.id]=[e].concat(r)};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((t=>{const n=this._shimmedLocalStreams[t].indexOf(e);-1!==n&&this._shimmedLocalStreams[t].splice(n,1),1===this._shimmedLocalStreams[t].length&&delete this._shimmedLocalStreams[t]})),i.apply(this,arguments)}}function P(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return O(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map((e=>this._reverseStreams[e.id]))};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((e=>{if(this.getSenders().find((t=>t.track===e)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){const n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}r.apply(this,[t])};const i=e.RTCPeerConnection.prototype.removeStream;function o(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)})),new RTCSessionDescription({type:t.type,sdp:n})}function s(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((t=>{const r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:n})}e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const r=[].slice.call(arguments,1);if(1!==r.length||!r[0].getTracks().find((e=>e===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const i=this.getSenders().find((e=>e.track===t));if(i)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const o=this._streams[n.id];if(o)o.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find((e=>e.track===t))},["createOffer","createAnswer"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){const e=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[t=>{const n=o(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then((e=>o(this,e)))}};e.RTCPeerConnection.prototype[t]=r[t]}));const a=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=s(this,arguments[0]),a.apply(this,arguments)):a.apply(this,arguments)};const c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const e=c.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this._streams=this._streams||{},Object.keys(this._streams).forEach((n=>{this._streams[n].getTracks().find((t=>e.track===t))&&(t=this._streams[n])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function A(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}))}function x(e,t){d(e,"negotiationneeded",(e=>{const n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e}))}function M(e,t){const n=e&&e.navigator,r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){h("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,"autoGainControl","mozAutoGainControl"),e(n.audio,"noiseSuppression","mozNoiseSuppression")),t(n)},r&&r.prototype.getSettings){const t=r.prototype.getSettings;r.prototype.getSettings=function(){const n=t.apply(this,arguments);return e(n,"mozAutoGainControl","autoGainControl"),e(n,"mozNoiseSuppression","noiseSuppression"),n}}if(r&&r.prototype.applyConstraints){const t=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),e(n,"autoGainControl","mozAutoGainControl"),e(n,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[n])}}}}function I(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const e=new DOMException("getDisplayMedia without video constraints is undefined");return e.name="NotFoundError",e.code=8,Promise.reject(e)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}function k(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function D(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,i,o]=arguments;return r.apply(this,[e||null]).then((e=>{if(t.version<53&&!i)try{e.forEach((e=>{e.type=n[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))}))}return e})).then(i,o)}}function j(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function N(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),d(e,"track",(e=>(e.receiver._pc=e.srcElement,e))),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function F(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){h("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function L(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function B(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const e=arguments[1],n=e&&"sendEncodings"in e;n&&e.sendEncodings.forEach((e=>{if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const r=t.apply(this,arguments);if(n){const{sender:t}=r,n=t.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=e.sendEncodings,t.sendEncodings=e.sendEncodings,this.setParametersPromises.push(t.setParameters(n).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return r})}function V(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function U(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function G(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function W(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((n=>t.call(this,n,e))),e.getVideoTracks().forEach((n=>t.call(this,n,e)))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach((e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);const t=this._localStreams.indexOf(e);if(-1===t)return;this._localStreams.splice(t,1);const n=e.getTracks();this.getSenders().forEach((e=>{n.includes(e.track)&&this.removeTrack(e)}))})}}function z(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=e=>{e.streams.forEach((e=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(e))return;this._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,this.dispatchEvent(t)}))})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((t=>{if(e._remoteStreams||(e._remoteStreams=[]),e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);const n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}))}),t.apply(e,arguments)}}}function q(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};let a=function(e,t,n){const r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=a,a=function(e,t,n){const r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=a,a=function(e,t,n){const r=s.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=a}function K(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(H(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function H(e){return e&&void 0!==e.video?Object.assign({},e,{video:v(e.video)}):e}function J(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){const t=[];for(let n=0;n<e.iceServers.length;n++){let r=e.iceServers[n];!r.hasOwnProperty("urls")&&r.hasOwnProperty("url")?(h("RTCIceServer.url","RTCIceServer.urls"),r=JSON.parse(JSON.stringify(r)),r.urls=r.url,delete r.url,t.push(r)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function $(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Y(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);const t=this.getTransceivers().find((e=>"audio"===e.receiver.track.kind));!1===e.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==e.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);const n=this.getTransceivers().find((e=>"video"===e.receiver.track.kind));!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function Q(e){"object"!=typeof e||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var Z=n(7539),X=n.n(Z);function ee(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){const n=new t(e),r=X().parseCandidate(e.candidate),i=Object.assign(n,r);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,d(e,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function te(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=function(e){if(!e||!e.sdp)return!1;const t=X().splitSections(e.sdp);return t.shift(),t.some((e=>{const t=X().parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},r=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n},i=function(e){let n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},o=function(e,n){let r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);const i=X().matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?r=parseInt(i[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r},s=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const e=r(arguments[0]),t=i(e),n=o(arguments[0],e);let s;s=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const a={};Object.defineProperty(a,"maxMessageSize",{get:()=>s}),this._sctp=a}return s.apply(this,arguments)}}function ne(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(e,t){const n=e.send;e.send=function(){const r=arguments[0],i=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=n.apply(this,arguments);return t(e,this),e},d(e,"datachannel",(e=>(t(e.channel,e.target),e)))}function re(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}function ie(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const n=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function oe(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function se(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return n.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}if(e.sdp||"offer"!==e.type&&"answer"!==e.type)return n.apply(this,[e]);const t="offer"===e.type?this.createOffer:this.createAnswer;return t.apply(this).then((e=>n.apply(this,[e])))})}!function({window:n}={},r={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const s=f,a=function(e){const t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;const{navigator:n}=e;if(n.mozGetUserMedia)t.browser="firefox",t.version=u(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=u(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=u(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}(n),c={browserDetails:a,commonShim:o,extractVersion:u,disableLog:p,disableWarnings:l,sdp:Z};switch(a.browser){case"chrome":if(!e||!A||!r.shimChrome)return s("Chrome shim is not included in this adapter release."),c;if(null===a.version)return s("Chrome shim can not determine version, not shimming."),c;s("adapter.js shimming chrome."),c.browserShim=e,oe(n,a),se(n),_(n,a),S(n),A(n,a),C(n),P(n,a),T(n),E(n),R(n),x(n,a),ee(n),re(n),te(n,a),ne(n),ie(n,a);break;case"firefox":if(!t||!D||!r.shimFirefox)return s("Firefox shim is not included in this adapter release."),c;s("adapter.js shimming firefox."),c.browserShim=t,oe(n,a),se(n),M(n,a),D(n,a),k(n),F(n),j(n),N(n),L(n),B(n),V(n),U(n),G(n),ee(n),re(n),te(n,a),ne(n);break;case"safari":if(!i||!r.shimSafari)return s("Safari shim is not included in this adapter release."),c;s("adapter.js shimming safari."),c.browserShim=i,oe(n,a),se(n),J(n),Y(n),q(n),W(n),z(n),$(n),K(n),Q(n),ee(n),te(n,a),ne(n),ie(n,a);break;default:s("Unsupported browser!")}}({window:"undefined"==typeof window?void 0:window}),n(8660);var ae=n(6729),ce="Request",ue="Singleton",de="Transient",pe="ConstantValue",le="Constructor",fe="DynamicValue",he="Factory",me="Function",ve="Instance",ge="Provider",ye="ConstructorArgument",be="Variable",_e=0;function we(){return _e++}var Se=function(){function e(e,t){this.id=we(),this.activated=!1,this.serviceIdentifier=e,this.scope=t,this.type="Invalid",this.constraint=function(e){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return e.prototype.clone=function(){var t=new e(this.serviceIdentifier,this.scope);return t.activated=t.scope===ue&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.factory=this.factory,t.provider=this.provider,t.constraint=this.constraint,t.onActivation=this.onActivation,t.onDeactivation=this.onDeactivation,t.cache=this.cache,t},e}(),Ce="Metadata key was used more than once in a parameter:",Te="NULL argument",Ee="Key Not Found",Re="Missing required @injectable annotation in:",Oe="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",Pe=function(e,t){return"onDeactivation() error in class "+e+": "+t},Ae="named",xe="unmanaged",Me="optional",Ie="inject",ke="multi_inject",De="inversify:tagged",je="inversify:tagged_props",Ne="inversify:paramtypes",Fe="post_construct",Le="pre_destroy",Be=[Ie,ke,"name",xe,Ae,Me],Ve=function(){function e(){}return e.prototype.getConstructorMetadata=function(e){return{compilerGeneratedMetadata:Reflect.getMetadata(Ne,e),userGeneratedMetadata:Reflect.getMetadata(De,e)||{}}},e.prototype.getPropertiesMetadata=function(e){return Reflect.getMetadata(je,e)||[]},e}();function Ue(e){return e instanceof RangeError||"Maximum call stack size exceeded"===e.message}function Ge(e){return"function"==typeof e?e.name:"symbol"==typeof e?e.toString():e}function We(e,t,n){var r="",i=n(e,t);return 0!==i.length&&(r="\nRegistered bindings:",i.forEach((function(e){var t="Object";null!==e.implementationType&&(t=Ke(e.implementationType)),r=r+"\n "+t,e.constraint.metaData&&(r=r+" - "+e.constraint.metaData)}))),r}function ze(e,t){return null!==e.parentRequest&&(e.parentRequest.serviceIdentifier===t||ze(e.parentRequest,t))}function qe(e){e.childRequests.forEach((function(e){if(ze(e,e.serviceIdentifier)){var t=function(e){return function e(t,n){void 0===n&&(n=[]);var r=Ge(t.serviceIdentifier);return n.push(r),null!==t.parentRequest?e(t.parentRequest,n):n}(e).reverse().join(" --\x3e ")}(e);throw new Error("Circular dependency found: "+t)}qe(e)}))}function Ke(e){if(e.name)return e.name;var t=e.toString(),n=t.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+t}var He=function(){function e(e){this.id=we(),this.container=e}return e.prototype.addPlan=function(e){this.plan=e},e.prototype.setCurrentRequest=function(e){this.currentRequest=e},e}(),Je=function(){function e(e,t){this.key=e,this.value=t}return e.prototype.toString=function(){return this.key===Ae?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},e}(),$e=function(e,t){this.parentContext=e,this.rootRequest=t},Ye=function(){function e(e){this._cb=e}return e.prototype.unwrap=function(){return this._cb()},e}(),Qe=function(){function e(e){this.str=e}return e.prototype.startsWith=function(e){return 0===this.str.indexOf(e)},e.prototype.endsWith=function(e){var t,n=e.split("").reverse().join("");return t=this.str.split("").reverse().join(""),this.startsWith.call({str:t},n)},e.prototype.contains=function(e){return-1!==this.str.indexOf(e)},e.prototype.equals=function(e){return this.str===e},e.prototype.value=function(){return this.str},e}(),Ze=function(){function e(e,t,n,r){this.id=we(),this.type=e,this.serviceIdentifier=n;var i="symbol"==typeof t?t.toString().slice(7,-1):t;this.name=new Qe(i||""),this.identifier=t,this.metadata=new Array;var o=null;"string"==typeof r?o=new Je(Ae,r):r instanceof Je&&(o=r),null!==o&&this.metadata.push(o)}return e.prototype.hasTag=function(e){for(var t=0,n=this.metadata;t<n.length;t++)if(n[t].key===e)return!0;return!1},e.prototype.isArray=function(){return this.hasTag(ke)},e.prototype.matchesArray=function(e){return this.matchesTag(ke)(e)},e.prototype.isNamed=function(){return this.hasTag(Ae)},e.prototype.isTagged=function(){return this.metadata.some((function(e){return Be.every((function(t){return e.key!==t}))}))},e.prototype.isOptional=function(){return this.matchesTag(Me)(!0)},e.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(e){return e.key===Ae}))[0]:null},e.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(e){return Be.every((function(t){return e.key!==t}))})):null},e.prototype.matchesNamedTag=function(e){return this.matchesTag(Ae)(e)},e.prototype.matchesTag=function(e){var t=this;return function(n){for(var r=0,i=t.metadata;r<i.length;r++){var o=i[r];if(o.key===e&&o.value===n)return!0}return!1}},e}(),Xe=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};function et(e,t,n,r){var i=e.getConstructorMetadata(n),o=i.compilerGeneratedMetadata;if(void 0===o)throw new Error(Re+" "+t+".");var s=i.userGeneratedMetadata,a=Object.keys(s),c=0===n.length&&a.length>0,u=a.length>n.length,d=function(e,t,n,r,i){for(var o=[],s=0;s<i;s++){var a=tt(s,e,t,n,r);null!==a&&o.push(a)}return o}(r,t,o,s,c||u?a.length:n.length),p=rt(e,n,t);return Xe(Xe([],d,!0),p,!0)}function tt(e,t,n,r,i){var o=i[e.toString()]||[],s=ot(o),a=!0!==s.unmanaged,c=r[e];if((c=s.inject||s.multiInject||c)instanceof Ye&&(c=c.unwrap()),a){if(!t&&(c===Object||c===Function||void 0===c))throw new Error("Missing required @inject or @multiInject annotation in: argument "+e+" in class "+n+".");var u=new Ze(ye,s.targetName,c);return u.metadata=o,u}return null}function nt(e,t,n,r){var i=e||t;if(void 0===i){var o=Re+" for property "+String(n)+" in class "+r+".";throw new Error(o)}return i}function rt(e,t,n){for(var r=e.getPropertiesMetadata(t),i=[],o=Object.getOwnPropertySymbols(r),s=0,a=Object.keys(r).concat(o);s<a.length;s++){var c=a[s],u=r[c],d=ot(u),p=d.targetName||c,l=nt(d.inject,d.multiInject,c,n),f=new Ze("ClassProperty",p,l);f.metadata=u,i.push(f)}var h=Object.getPrototypeOf(t.prototype).constructor;if(h!==Object){var m=rt(e,h,n);i=Xe(Xe([],i,!0),m,!0)}return i}function it(e,t){var n=Object.getPrototypeOf(t.prototype).constructor;if(n!==Object){var r=et(e,Ke(n),n,!0),i=r.map((function(e){return e.metadata.filter((function(e){return e.key===xe}))})),o=[].concat.apply([],i).length,s=r.length-o;return s>0?s:it(e,n)}return 0}function ot(e){var t={};return e.forEach((function(e){t[e.key.toString()]=e.value})),{inject:t.inject,multiInject:t.multi_inject,targetName:t.name,unmanaged:t.unmanaged}}var st=function(){function e(e,t,n,r,i){this.id=we(),this.serviceIdentifier=e,this.parentContext=t,this.parentRequest=n,this.target=i,this.childRequests=[],this.bindings=Array.isArray(r)?r:[r],this.requestScope=null===n?new Map:null}return e.prototype.addChildRequest=function(t,n,r){var i=new e(t,this.parentContext,this,n,r);return this.childRequests.push(i),i},e}();function at(e){return e._bindingDictionary}function ct(e,t,n,r,i){var o,s=dt(n.container,i.serviceIdentifier);return 0===s.length&&n.container.options.autoBindInjectable&&"function"==typeof i.serviceIdentifier&&e.getConstructorMetadata(i.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(i.serviceIdentifier).toSelf(),s=dt(n.container,i.serviceIdentifier)),o=t?s:s.filter((function(e){var t=new st(e.serviceIdentifier,n,r,e,i);return e.constraint(t)})),function(e,t,n,r){switch(t.length){case 0:if(n.isOptional())return t;var i=Ge(e),o="No matching bindings found for serviceIdentifier:";throw o+=function(e,t){if(t.isTagged()||t.isNamed()){var n="",r=t.getNamedTag(),i=t.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach((function(e){n+=e.toString()+"\n"}))," "+e+"\n "+e+" - "+n}return" "+e}(i,n),o+=We(r,i,dt),new Error(o);case 1:return t;default:if(n.isArray())return t;throw o="Ambiguous match found for serviceIdentifier: "+(i=Ge(e)),o+=We(r,i,dt),new Error(o)}}(i.serviceIdentifier,o,i,n.container),o}function ut(e,t,n,r,i,o){var s,a;if(null===i){s=ct(e,t,r,null,o),a=new st(n,r,null,s,o);var c=new $e(r,a);r.addPlan(c)}else s=ct(e,t,r,i,o),a=i.addChildRequest(o.serviceIdentifier,s,o);s.forEach((function(t){var n=null;if(o.isArray())n=a.addChildRequest(t.serviceIdentifier,t,o);else{if(t.cache)return;n=a}if(t.type===ve&&null!==t.implementationType){var i=function(e,t){return et(e,Ke(t),t,!1)}(e,t.implementationType);if(!r.container.options.skipBaseClassChecks){var s=it(e,t.implementationType);if(i.length<s){var c=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"The number of constructor arguments in the derived class "+e[0]+" must be >= than the number of constructor arguments of its base class."}(Ke(t.implementationType));throw new Error(c)}}i.forEach((function(t){ut(e,!1,t.serviceIdentifier,r,n,t)}))}}))}function dt(e,t){var n=[],r=at(e);return r.hasKey(t)?n=r.get(t):null!==e.parent&&(n=dt(e.parent,t)),n}function pt(e){return("object"==typeof e&&null!==e||"function"==typeof e)&&"function"==typeof e.then}function lt(e){return!!pt(e)||Array.isArray(e)&&e.some(pt)}var ft,ht=function(e,t){return n=void 0,r=void 0,o=function(){var n,r;return function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t];case 1:return n=i.sent(),e.cache=n,[3,3];case 2:throw r=i.sent(),e.cache=null,e.activated=!1,r;case 3:return[2]}}))},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{c(o.next(e))}catch(e){t(e)}}function a(e){try{c(o.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(s,a)}c((o=o.apply(n,r||[])).next())}));var n,r,i,o};!function(e){e.DynamicValue="toDynamicValue",e.Factory="toFactory",e.Provider="toProvider"}(ft||(ft={}));var mt=function(){return mt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mt.apply(this,arguments)},vt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},gt=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};function yt(e){var t,n=new((t=e.constr).bind.apply(t,function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([void 0],e.constructorInjections,!1)));return e.propertyRequests.forEach((function(t,r){var i=t.target.identifier,o=e.propertyInjections[r];n[i]=o})),n}function bt(e){return vt(this,void 0,void 0,(function(){var t,n,r,i;return gt(this,(function(o){for(t=[],n=0,r=e;n<r.length;n++)i=r[n],Array.isArray(i)?t.push(Promise.all(i)):t.push(i);return[2,Promise.all(t)]}))}))}function _t(e,t){var n=function(e,t){var n,r;if(Reflect.hasMetadata(Fe,e)){var i=Reflect.getMetadata(Fe,e);try{return null===(r=(n=t)[i.value])||void 0===r?void 0:r.call(n)}catch(t){throw new Error("@postConstruct error in class "+e.name+": "+t.message)}}}(e,t);return pt(n)?n.then((function(){return t})):t}var wt=function(e){return function(t){t.parentContext.setCurrentRequest(t);var n=t.bindings,r=t.childRequests,i=t.target&&t.target.isArray(),o=!(t.parentRequest&&t.parentRequest.target&&t.target&&t.parentRequest.target.matchesArray(t.target.serviceIdentifier));if(i&&o)return r.map((function(t){return wt(e)(t)}));if(!t.target.isOptional()||0!==n.length){var s=n[0];return Et(e,t,s)}}},St=function(e,t){var n=function(e){switch(e.type){case he:return{factory:e.factory,factoryType:ft.Factory};case ge:return{factory:e.provider,factoryType:ft.Provider};case fe:return{factory:e.dynamicValue,factoryType:ft.DynamicValue};default:throw new Error("Unexpected factory type "+e.type)}}(e);return function(r,i){try{return n.factory.bind(e)(t)}catch(e){throw Ue(e)&&(e=new Error((o=n.factoryType,s=t.currentRequest.serviceIdentifier.toString(),"It looks like there is a circular dependency in one of the '"+o+"' bindings. Please investigate bindings withservice identifier '"+s+"'."))),e}var o,s}()},Ct=function(e,t,n){var r,i=t.childRequests;switch(function(e){var t=null;switch(e.type){case pe:case me:t=e.cache;break;case le:case ve:t=e.implementationType;break;case fe:t=e.dynamicValue;break;case ge:t=e.provider;break;case he:t=e.factory}if(null===t){var n=Ge(e.serviceIdentifier);throw new Error("Invalid binding type: "+n)}}(n),n.type){case pe:case me:r=n.cache;break;case le:r=n.implementationType;break;case ve:r=function(e,t,n,r){!function(e,t){e.scope!==ue&&function(e,t){var n="Class cannot be instantiated in "+(e.scope===ce?"request":"transient")+" scope.";if("function"==typeof e.onDeactivation)throw new Error(Pe(t.name,n));if(Reflect.hasMetadata(Le,t))throw new Error("@preDestroy error in class "+t.name+": "+n)}(e,t)}(e,t);var i=function(e,t,n){var r;if(t.length>0){var i=function(e,t){return e.reduce((function(e,n){var r=t(n);return n.target.type===ye?e.constructorInjections.push(r):(e.propertyRequests.push(n),e.propertyInjections.push(r)),e.isAsync||(e.isAsync=lt(r)),e}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(t,n),o=mt(mt({},i),{constr:e});r=i.isAsync?function(e){return vt(this,void 0,void 0,(function(){var t,n;return gt(this,(function(r){switch(r.label){case 0:return[4,bt(e.constructorInjections)];case 1:return t=r.sent(),[4,bt(e.propertyInjections)];case 2:return n=r.sent(),[2,yt(mt(mt({},e),{constructorInjections:t,propertyInjections:n}))]}}))}))}(o):yt(o)}else r=new e;return r}(t,n,r);return pt(i)?i.then((function(e){return _t(t,e)})):_t(t,i)}(n,n.implementationType,i,wt(e));break;default:r=St(n,t.parentContext)}return r},Tt=function(e,t,n){var r=function(e,t){return t.scope===ue&&t.activated?t.cache:t.scope===ce&&e.has(t.id)?e.get(t.id):null}(e,t);return null!==r||function(e,t,n){t.scope===ue&&function(e,t){e.cache=t,e.activated=!0,pt(t)&&ht(e,t)}(t,n),t.scope===ce&&function(e,t,n){e.has(t.id)||e.set(t.id,n)}(e,t,n)}(e,t,r=n()),r},Et=function(e,t,n){return Tt(e,n,(function(){var r=Ct(e,t,n);return pt(r)?r.then((function(e){return Rt(t,n,e)})):Rt(t,n,r)}))};function Rt(e,t,n){var r,i=Ot(e.parentContext,t,n),o=Mt(e.parentContext.container),s=o.next();do{r=s.value;var a=e.parentContext,c=e.serviceIdentifier,u=xt(r,c);i=pt(i)?At(u,a,i):Pt(u,a,i),s=o.next()}while(!0!==s.done&&!at(r).hasKey(e.serviceIdentifier));return i}var Ot=function(e,t,n){return"function"==typeof t.onActivation?t.onActivation(e,n):n},Pt=function(e,t,n){for(var r=e.next();!r.done;){if(pt(n=r.value(t,n)))return At(e,t,n);r=e.next()}return n},At=function(e,t,n){return r=void 0,i=void 0,s=function(){var r,i;return function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(o){switch(o.label){case 0:return[4,n];case 1:r=o.sent(),i=e.next(),o.label=2;case 2:return i.done?[3,4]:[4,i.value(t,r)];case 3:return r=o.sent(),i=e.next(),[3,2];case 4:return[2,r]}}))},new((o=void 0)||(o=Promise))((function(e,t){function n(e){try{c(s.next(e))}catch(e){t(e)}}function a(e){try{c(s.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(n,a)}c((s=s.apply(r,i||[])).next())}));var r,i,o,s},xt=function(e,t){var n=e._activations;return n.hasKey(t)?n.get(t).values():[].values()},Mt=function(e){for(var t=[e],n=e.parent;null!==n;)t.push(n),n=n.parent;return{next:function(){var e=t.pop();return void 0!==e?{done:!1,value:e}:{done:!0,value:void 0}}}},It=function(e,t){var n=e.parentRequest;return null!==n&&(!!t(n)||It(n,t))},kt=function(e){return function(t){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(e)(t)};return n.metaData=new Je(e,t),n}},Dt=kt(Ae),jt=function(e){return function(t){var n=null;if(null!==t){if(n=t.bindings[0],"string"==typeof e)return n.serviceIdentifier===e;var r=t.bindings[0].implementationType;return e===r}return!1}},Nt=function(){function e(e){this._binding=e}return e.prototype.when=function(e){return this._binding.constraint=e,new Ft(this._binding)},e.prototype.whenTargetNamed=function(e){return this._binding.constraint=Dt(e),new Ft(this._binding)},e.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(e){return null!==e&&null!==e.target&&!e.target.isNamed()&&!e.target.isTagged()},new Ft(this._binding)},e.prototype.whenTargetTagged=function(e,t){return this._binding.constraint=kt(e)(t),new Ft(this._binding)},e.prototype.whenInjectedInto=function(e){return this._binding.constraint=function(t){return null!==t&&jt(e)(t.parentRequest)},new Ft(this._binding)},e.prototype.whenParentNamed=function(e){return this._binding.constraint=function(t){return null!==t&&Dt(e)(t.parentRequest)},new Ft(this._binding)},e.prototype.whenParentTagged=function(e,t){return this._binding.constraint=function(n){return null!==n&&kt(e)(t)(n.parentRequest)},new Ft(this._binding)},e.prototype.whenAnyAncestorIs=function(e){return this._binding.constraint=function(t){return null!==t&&It(t,jt(e))},new Ft(this._binding)},e.prototype.whenNoAncestorIs=function(e){return this._binding.constraint=function(t){return null!==t&&!It(t,jt(e))},new Ft(this._binding)},e.prototype.whenAnyAncestorNamed=function(e){return this._binding.constraint=function(t){return null!==t&&It(t,Dt(e))},new Ft(this._binding)},e.prototype.whenNoAncestorNamed=function(e){return this._binding.constraint=function(t){return null!==t&&!It(t,Dt(e))},new Ft(this._binding)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._binding.constraint=function(n){return null!==n&&It(n,kt(e)(t))},new Ft(this._binding)},e.prototype.whenNoAncestorTagged=function(e,t){return this._binding.constraint=function(n){return null!==n&&!It(n,kt(e)(t))},new Ft(this._binding)},e.prototype.whenAnyAncestorMatches=function(e){return this._binding.constraint=function(t){return null!==t&&It(t,e)},new Ft(this._binding)},e.prototype.whenNoAncestorMatches=function(e){return this._binding.constraint=function(t){return null!==t&&!It(t,e)},new Ft(this._binding)},e}(),Ft=function(){function e(e){this._binding=e}return e.prototype.onActivation=function(e){return this._binding.onActivation=e,new Nt(this._binding)},e.prototype.onDeactivation=function(e){return this._binding.onDeactivation=e,new Nt(this._binding)},e}(),Lt=function(){function e(e){this._binding=e,this._bindingWhenSyntax=new Nt(this._binding),this._bindingOnSyntax=new Ft(this._binding)}return e.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},e.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},e.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},e.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},e.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},e.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},e.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},e.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},e.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},e.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},e.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},e.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},e.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},e.prototype.onDeactivation=function(e){return this._bindingOnSyntax.onDeactivation(e)},e}(),Bt=function(){function e(e){this._binding=e}return e.prototype.inRequestScope=function(){return this._binding.scope=ce,new Lt(this._binding)},e.prototype.inSingletonScope=function(){return this._binding.scope=ue,new Lt(this._binding)},e.prototype.inTransientScope=function(){return this._binding.scope=de,new Lt(this._binding)},e}(),Vt=function(){function e(e){this._binding=e,this._bindingWhenSyntax=new Nt(this._binding),this._bindingOnSyntax=new Ft(this._binding),this._bindingInSyntax=new Bt(e)}return e.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},e.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},e.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},e.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},e.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},e.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},e.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},e.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},e.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},e.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},e.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},e.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},e.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},e.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},e.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},e.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},e.prototype.onDeactivation=function(e){return this._bindingOnSyntax.onDeactivation(e)},e}(),Ut=function(){function e(e){this._binding=e}return e.prototype.to=function(e){return this._binding.type=ve,this._binding.implementationType=e,new Vt(this._binding)},e.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error("The toSelf function can only be applied when a constructor is used as service identifier");var e=this._binding.serviceIdentifier;return this.to(e)},e.prototype.toConstantValue=function(e){return this._binding.type=pe,this._binding.cache=e,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=ue,new Lt(this._binding)},e.prototype.toDynamicValue=function(e){return this._binding.type=fe,this._binding.cache=null,this._binding.dynamicValue=e,this._binding.implementationType=null,new Vt(this._binding)},e.prototype.toConstructor=function(e){return this._binding.type=le,this._binding.implementationType=e,this._binding.scope=ue,new Lt(this._binding)},e.prototype.toFactory=function(e){return this._binding.type=he,this._binding.factory=e,this._binding.scope=ue,new Lt(this._binding)},e.prototype.toFunction=function(e){if("function"!=typeof e)throw new Error("Value provided to function binding must be a function!");var t=this.toConstantValue(e);return this._binding.type=me,this._binding.scope=ue,t},e.prototype.toAutoFactory=function(e){return this._binding.type=he,this._binding.factory=function(t){return function(){return t.container.get(e)}},this._binding.scope=ue,new Lt(this._binding)},e.prototype.toAutoNamedFactory=function(e){return this._binding.type=he,this._binding.factory=function(t){return function(n){return t.container.getNamed(e,n)}},new Lt(this._binding)},e.prototype.toProvider=function(e){return this._binding.type=ge,this._binding.provider=e,this._binding.scope=ue,new Lt(this._binding)},e.prototype.toService=function(e){this.toDynamicValue((function(t){return t.container.get(e)}))},e}(),Gt=function(){function e(){}return e.of=function(t,n,r,i,o){var s=new e;return s.bindings=t,s.middleware=n,s.deactivations=i,s.activations=r,s.moduleActivationStore=o,s},e}(),Wt=function(){function e(){this._map=new Map}return e.prototype.getMap=function(){return this._map},e.prototype.add=function(e,t){if(null==e)throw new Error(Te);if(null==t)throw new Error(Te);var n=this._map.get(e);void 0!==n?n.push(t):this._map.set(e,[t])},e.prototype.get=function(e){if(null==e)throw new Error(Te);var t=this._map.get(e);if(void 0!==t)return t;throw new Error(Ee)},e.prototype.remove=function(e){if(null==e)throw new Error(Te);if(!this._map.delete(e))throw new Error(Ee)},e.prototype.removeIntersection=function(e){var t=this;this.traverse((function(n,r){var i=e.hasKey(n)?e.get(n):void 0;if(void 0!==i){var o=r.filter((function(e){return!i.some((function(t){return e===t}))}));t._setValue(n,o)}}))},e.prototype.removeByCondition=function(e){var t=this,n=[];return this._map.forEach((function(r,i){for(var o=[],s=0,a=r;s<a.length;s++){var c=a[s];e(c)?n.push(c):o.push(c)}t._setValue(i,o)})),n},e.prototype.hasKey=function(e){if(null==e)throw new Error(Te);return this._map.has(e)},e.prototype.clone=function(){var t=new e;return this._map.forEach((function(e,n){e.forEach((function(e){return t.add(n,"object"==typeof(r=e)&&null!==r&&"clone"in r&&"function"==typeof r.clone?e.clone():e);var r}))})),t},e.prototype.traverse=function(e){this._map.forEach((function(t,n){e(n,t)}))},e.prototype._setValue=function(e,t){t.length>0?this._map.set(e,t):this._map.delete(e)},e}(),zt=function(){function e(){this._map=new Map}return e.prototype.remove=function(e){if(this._map.has(e)){var t=this._map.get(e);return this._map.delete(e),t}return this._getEmptyHandlersStore()},e.prototype.addDeactivation=function(e,t,n){this._getModuleActivationHandlers(e).onDeactivations.add(t,n)},e.prototype.addActivation=function(e,t,n){this._getModuleActivationHandlers(e).onActivations.add(t,n)},e.prototype.clone=function(){var t=new e;return this._map.forEach((function(e,n){t._map.set(n,{onActivations:e.onActivations.clone(),onDeactivations:e.onDeactivations.clone()})})),t},e.prototype._getModuleActivationHandlers=function(e){var t=this._map.get(e);return void 0===t&&(t=this._getEmptyHandlersStore(),this._map.set(e,t)),t},e.prototype._getEmptyHandlersStore=function(){return{onActivations:new Wt,onDeactivations:new Wt}},e}(),qt=function(){return qt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},qt.apply(this,arguments)},Kt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},Ht=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},Jt=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},$t=function(){function e(e){var t=e||{};if("object"!=typeof t)throw new Error("Invalid Container constructor argument. Container options must be an object.");if(void 0===t.defaultScope)t.defaultScope=de;else if(t.defaultScope!==ue&&t.defaultScope!==de&&t.defaultScope!==ce)throw new Error("Invalid Container option. Default scope must be a string ('singleton' or 'transient').");if(void 0===t.autoBindInjectable)t.autoBindInjectable=!1;else if("boolean"!=typeof t.autoBindInjectable)throw new Error("Invalid Container option. Auto bind injectable must be a boolean");if(void 0===t.skipBaseClassChecks)t.skipBaseClassChecks=!1;else if("boolean"!=typeof t.skipBaseClassChecks)throw new Error("Invalid Container option. Skip base check must be a boolean");this.options={autoBindInjectable:t.autoBindInjectable,defaultScope:t.defaultScope,skipBaseClassChecks:t.skipBaseClassChecks},this.id=we(),this._bindingDictionary=new Wt,this._snapshots=[],this._middleware=null,this._activations=new Wt,this._deactivations=new Wt,this.parent=null,this._metadataReader=new Ve,this._moduleActivationStore=new zt}return e.merge=function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o=new e,s=Jt([t,n],r,!0).map((function(e){return at(e)})),a=at(o);function c(e,t){e.traverse((function(e,n){n.forEach((function(e){t.add(e.serviceIdentifier,e.clone())}))}))}return s.forEach((function(e){c(e,a)})),o},e.prototype.load=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=this._getContainerModuleHelpersFactory(),r=0,i=e;r<i.length;r++){var o=i[r],s=n(o.id);o.registry(s.bindFunction,s.unbindFunction,s.isboundFunction,s.rebindFunction,s.unbindAsyncFunction,s.onActivationFunction,s.onDeactivationFunction)}},e.prototype.loadAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kt(this,void 0,void 0,(function(){var t,n,r,i,o;return Ht(this,(function(s){switch(s.label){case 0:t=this._getContainerModuleHelpersFactory(),n=0,r=e,s.label=1;case 1:return n<r.length?(i=r[n],o=t(i.id),[4,i.registry(o.bindFunction,o.unbindFunction,o.isboundFunction,o.rebindFunction,o.unbindAsyncFunction,o.onActivationFunction,o.onDeactivationFunction)]):[3,4];case 2:s.sent(),s.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},e.prototype.unload=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.forEach((function(t){var n=e._removeModuleBindings(t.id);e._deactivateSingletons(n),e._removeModuleHandlers(t.id)}))},e.prototype.unloadAsync=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kt(this,void 0,void 0,(function(){var t,n,r,i;return Ht(this,(function(o){switch(o.label){case 0:t=0,n=e,o.label=1;case 1:return t<n.length?(r=n[t],i=this._removeModuleBindings(r.id),[4,this._deactivateSingletonsAsync(i)]):[3,4];case 2:o.sent(),this._removeModuleHandlers(r.id),o.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},e.prototype.bind=function(e){var t=this.options.defaultScope||de,n=new Se(e,t);return this._bindingDictionary.add(e,n),new Ut(n)},e.prototype.rebind=function(e){return this.unbind(e),this.bind(e)},e.prototype.rebindAsync=function(e){return Kt(this,void 0,void 0,(function(){return Ht(this,(function(t){switch(t.label){case 0:return[4,this.unbindAsync(e)];case 1:return t.sent(),[2,this.bind(e)]}}))}))},e.prototype.unbind=function(e){if(this._bindingDictionary.hasKey(e)){var t=this._bindingDictionary.get(e);this._deactivateSingletons(t)}this._removeServiceFromDictionary(e)},e.prototype.unbindAsync=function(e){return Kt(this,void 0,void 0,(function(){var t;return Ht(this,(function(n){switch(n.label){case 0:return this._bindingDictionary.hasKey(e)?(t=this._bindingDictionary.get(e),[4,this._deactivateSingletonsAsync(t)]):[3,2];case 1:n.sent(),n.label=2;case 2:return this._removeServiceFromDictionary(e),[2]}}))}))},e.prototype.unbindAll=function(){var e=this;this._bindingDictionary.traverse((function(t,n){e._deactivateSingletons(n)})),this._bindingDictionary=new Wt},e.prototype.unbindAllAsync=function(){return Kt(this,void 0,void 0,(function(){var e,t=this;return Ht(this,(function(n){switch(n.label){case 0:return e=[],this._bindingDictionary.traverse((function(n,r){e.push(t._deactivateSingletonsAsync(r))})),[4,Promise.all(e)];case 1:return n.sent(),this._bindingDictionary=new Wt,[2]}}))}))},e.prototype.onActivation=function(e,t){this._activations.add(e,t)},e.prototype.onDeactivation=function(e,t){this._deactivations.add(e,t)},e.prototype.isBound=function(e){var t=this._bindingDictionary.hasKey(e);return!t&&this.parent&&(t=this.parent.isBound(e)),t},e.prototype.isCurrentBound=function(e){return this._bindingDictionary.hasKey(e)},e.prototype.isBoundNamed=function(e,t){return this.isBoundTagged(e,Ae,t)},e.prototype.isBoundTagged=function(e,t,n){var r=!1;if(this._bindingDictionary.hasKey(e)){var i=this._bindingDictionary.get(e),o=function(e,t,n,r){var i=new Ze(be,"",t,new Je(n,r)),o=new He(e);return new st(t,o,null,[],i)}(this,e,t,n);r=i.some((function(e){return e.constraint(o)}))}return!r&&this.parent&&(r=this.parent.isBoundTagged(e,t,n)),r},e.prototype.snapshot=function(){this._snapshots.push(Gt.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},e.prototype.restore=function(){var e=this._snapshots.pop();if(void 0===e)throw new Error("No snapshot available to restore.");this._bindingDictionary=e.bindings,this._activations=e.activations,this._deactivations=e.deactivations,this._middleware=e.middleware,this._moduleActivationStore=e.moduleActivationStore},e.prototype.createChild=function(t){var n=new e(t||this.options);return n.parent=this,n},e.prototype.applyMiddleware=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=e.reduce((function(e,t){return t(e)}),n)},e.prototype.applyCustomMetadataReader=function(e){this._metadataReader=e},e.prototype.get=function(e){var t=this._getNotAllArgs(e,!1);return this._getButThrowIfAsync(t)},e.prototype.getAsync=function(e){return Kt(this,void 0,void 0,(function(){var t;return Ht(this,(function(n){return t=this._getNotAllArgs(e,!1),[2,this._get(t)]}))}))},e.prototype.getTagged=function(e,t,n){var r=this._getNotAllArgs(e,!1,t,n);return this._getButThrowIfAsync(r)},e.prototype.getTaggedAsync=function(e,t,n){return Kt(this,void 0,void 0,(function(){var r;return Ht(this,(function(i){return r=this._getNotAllArgs(e,!1,t,n),[2,this._get(r)]}))}))},e.prototype.getNamed=function(e,t){return this.getTagged(e,Ae,t)},e.prototype.getNamedAsync=function(e,t){return this.getTaggedAsync(e,Ae,t)},e.prototype.getAll=function(e){var t=this._getAllArgs(e);return this._getButThrowIfAsync(t)},e.prototype.getAllAsync=function(e){var t=this._getAllArgs(e);return this._getAll(t)},e.prototype.getAllTagged=function(e,t,n){var r=this._getNotAllArgs(e,!0,t,n);return this._getButThrowIfAsync(r)},e.prototype.getAllTaggedAsync=function(e,t,n){var r=this._getNotAllArgs(e,!0,t,n);return this._getAll(r)},e.prototype.getAllNamed=function(e,t){return this.getAllTagged(e,Ae,t)},e.prototype.getAllNamedAsync=function(e,t){return this.getAllTaggedAsync(e,Ae,t)},e.prototype.resolve=function(e){var t=this.isBound(e);t||this.bind(e).toSelf();var n=this.get(e);return t||this.unbind(e),n},e.prototype._preDestroy=function(e,t){if(Reflect.hasMetadata(Le,e))return t[Reflect.getMetadata(Le,e).value]()},e.prototype._removeModuleHandlers=function(e){var t=this._moduleActivationStore.remove(e);this._activations.removeIntersection(t.onActivations),this._deactivations.removeIntersection(t.onDeactivations)},e.prototype._removeModuleBindings=function(e){return this._bindingDictionary.removeByCondition((function(t){return t.moduleId===e}))},e.prototype._deactivate=function(e,t){var n=this,r=Object.getPrototypeOf(t).constructor;try{if(this._deactivations.hasKey(e.serviceIdentifier)){var i=this._deactivateContainer(t,this._deactivations.get(e.serviceIdentifier).values());if(pt(i))return this._handleDeactivationError(i.then((function(){return n._propagateContainerDeactivationThenBindingAndPreDestroyAsync(e,t,r)})),r)}var o=this._propagateContainerDeactivationThenBindingAndPreDestroy(e,t,r);if(pt(o))return this._handleDeactivationError(o,r)}catch(e){throw new Error(Pe(r.name,e.message))}},e.prototype._handleDeactivationError=function(e,t){return Kt(this,void 0,void 0,(function(){var n;return Ht(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e];case 1:return r.sent(),[3,3];case 2:throw n=r.sent(),new Error(Pe(t.name,n.message));case 3:return[2]}}))}))},e.prototype._deactivateContainer=function(e,t){for(var n=this,r=t.next();r.value;){var i=r.value(e);if(pt(i))return i.then((function(){return n._deactivateContainerAsync(e,t)}));r=t.next()}},e.prototype._deactivateContainerAsync=function(e,t){return Kt(this,void 0,void 0,(function(){var n;return Ht(this,(function(r){switch(r.label){case 0:n=t.next(),r.label=1;case 1:return n.value?[4,n.value(e)]:[3,3];case 2:return r.sent(),n=t.next(),[3,1];case 3:return[2]}}))}))},e.prototype._getContainerModuleHelpersFactory=function(){var e=this,t=function(e,t){e._binding.moduleId=t},n=function(n){return function(r){var i=e.rebind(r);return t(i,n),i}},r=function(t){return function(n,r){e._moduleActivationStore.addActivation(t,n,r),e.onActivation(n,r)}},i=function(t){return function(n,r){e._moduleActivationStore.addDeactivation(t,n,r),e.onDeactivation(n,r)}};return function(o){return{bindFunction:(s=o,function(n){var r=e.bind(n);return t(r,s),r}),isboundFunction:function(t){return e.isBound(t)},onActivationFunction:r(o),onDeactivationFunction:i(o),rebindFunction:n(o),unbindFunction:function(t){return e.unbind(t)},unbindAsyncFunction:function(t){return e.unbindAsync(t)}};var s}},e.prototype._getAll=function(e){return Promise.all(this._get(e))},e.prototype._get=function(e){var t=qt(qt({},e),{contextInterceptor:function(e){return e},targetType:be});if(this._middleware){var n=this._middleware(t);if(null==n)throw new Error("Invalid return type in middleware. Middleware must return!");return n}return this._planAndResolve()(t)},e.prototype._getButThrowIfAsync=function(e){var t=this._get(e);if(lt(t))throw new Error("You are attempting to construct '"+e.serviceIdentifier+"' in a synchronous way\n but it has asynchronous dependencies.");return t},e.prototype._getAllArgs=function(e){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:e}},e.prototype._getNotAllArgs=function(e,t,n,r){return{avoidConstraints:!1,isMultiInject:t,serviceIdentifier:e,key:n,value:r}},e.prototype._planAndResolve=function(){var e=this;return function(t){var n=function(e,t,n,r,i,o,s,a){void 0===a&&(a=!1);var c=new He(t),u=function(e,t,n,r,i,o){var s=new Je(e?ke:Ie,n),a=new Ze(t,"",n,s);if(void 0!==i){var c=new Je(i,o);a.metadata.push(c)}return a}(n,r,i,0,o,s);try{return ut(e,a,i,c,null,u),c}catch(e){throw Ue(e)&&qe(c.plan.rootRequest),e}}(e._metadataReader,e,t.isMultiInject,t.targetType,t.serviceIdentifier,t.key,t.value,t.avoidConstraints);return function(e){return wt(e.plan.rootRequest.requestScope)(e.plan.rootRequest)}(n=t.contextInterceptor(n))}},e.prototype._deactivateIfSingleton=function(e){var t=this;if(e.activated)return pt(e.cache)?e.cache.then((function(n){return t._deactivate(e,n)})):this._deactivate(e,e.cache)},e.prototype._deactivateSingletons=function(e){for(var t=0,n=e;t<n.length;t++){var r=n[t];if(pt(this._deactivateIfSingleton(r)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}},e.prototype._deactivateSingletonsAsync=function(e){return Kt(this,void 0,void 0,(function(){var t=this;return Ht(this,(function(n){switch(n.label){case 0:return[4,Promise.all(e.map((function(e){return t._deactivateIfSingleton(e)})))];case 1:return n.sent(),[2]}}))}))},e.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(e,t,n){return this.parent?this._deactivate.bind(this.parent)(e,t):this._bindingDeactivationAndPreDestroy(e,t,n)},e.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(e,t,n){return Kt(this,void 0,void 0,(function(){return Ht(this,(function(r){switch(r.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(e,t)]:[3,2];case 1:return r.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(e,t,n)];case 3:r.sent(),r.label=4;case 4:return[2]}}))}))},e.prototype._removeServiceFromDictionary=function(e){try{this._bindingDictionary.remove(e)}catch(t){throw new Error("Could not unbind serviceIdentifier: "+Ge(e))}},e.prototype._bindingDeactivationAndPreDestroy=function(e,t,n){var r=this;if("function"==typeof e.onDeactivation){var i=e.onDeactivation(t);if(pt(i))return i.then((function(){return r._preDestroy(n,t)}))}return this._preDestroy(n,t)},e.prototype._bindingDeactivationAndPreDestroyAsync=function(e,t,n){return Kt(this,void 0,void 0,(function(){return Ht(this,(function(r){switch(r.label){case 0:return"function"!=typeof e.onDeactivation?[3,2]:[4,e.onDeactivation(t)];case 1:r.sent(),r.label=2;case 2:return[4,this._preDestroy(n,t)];case 3:return r.sent(),[2]}}))}))},e}(),Yt=n(4879),Qt=n(1206);function Zt(){return function(e){if(Reflect.hasOwnMetadata(Ne,e))throw new Error("Cannot apply @injectable decorator multiple times.");var t=Reflect.getMetadata("design:paramtypes",e)||[];return Reflect.defineMetadata(Ne,t,e),e}}function Xt(e,t,n,r){var i=function(e){var t=[];if(Array.isArray(e)){var n=function(e){for(var t=new Set,n=0,r=e;n<r.length;n++){var i=r[n];if(t.has(i))return i;t.add(i)}}((t=e).map((function(e){return e.key})));if(void 0!==n)throw new Error(Ce+" "+n.toString())}else t=[e];return t}(r),o={};Reflect.hasOwnMetadata(e,t)&&(o=Reflect.getMetadata(e,t));var s=o[n];if(void 0===s)s=[];else for(var a=function(e){if(i.some((function(t){return t.key===e.key})))throw new Error(Ce+" "+e.key.toString())},c=0,u=s;c<u.length;c++)a(u[c]);s.push.apply(s,i),o[n]=s,Reflect.defineMetadata(e,o,t)}function en(e){return function(t,n,r){"number"==typeof r?function(e,t,n,r){!function(e){if(void 0!==e)throw new Error(Oe)}(t),Xt(De,e,n.toString(),r)}(t,n,r,e):function(e,t,n){if(void 0!==e.prototype)throw new Error(Oe);Xt(je,e.constructor,t,n)}(t,n,e)}}var tn=(Ie,function(e){return function(t,n,r){if(void 0===e){var i="function"==typeof t?t.name:t.constructor.name;throw new Error("@inject called with undefined this could mean that the class "+i+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation.")}return en(new Je("inject",e))(t,n,r)}});const nn={SPADE_URL:Symbol.for("spade_url"),EMITTER:Symbol.for("emitter"),WORKER:Symbol.for("worker"),MEDIA_STREAM_MANAGER:Symbol.for("media_stream_manager"),CONFIG:Symbol.for("config"),PEER_CLIENT:Symbol.for("peer_client"),ANALYTICS_TRACKER:Symbol.for("analytics_tracker"),PEER_STATS_TRACKER:Symbol.for("peer_stats_tracker"),LOGGER:Symbol.for("logger")};var rn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};class on{constructor(e="https://player.stats.live-video.net/"){this.spadeUrl=e}send(e){return rn(this,void 0,void 0,(function*(){const t=`data=${this.b64EncodeUnicode(JSON.stringify(e))}`;!function(e,t,n={},r=""){rn(this,void 0,void 0,(function*(){const i=new XMLHttpRequest;return i.open(e,t,!0),n&&Object.keys(n).forEach((e=>{n.hasOwnProperty(e)&&i.setRequestHeader(e,n[e])})),new Promise(((n,o)=>{i.onreadystatechange=()=>{4===i.readyState&&(i.status>=200&&i.status<300?n(i.responseText):o(new Error(`Spade ${e} ${t} responded ${i.status}\n${i.responseText}`)))},i.send(r)}))}))}("POST",this.spadeUrl,{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},t)}))}b64EncodeUnicode(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(Number(`0x${t}`)))))}}function sn(e){if(!e)throw new Error("SpadeClient is not defined")}let an=class{constructor(e){this.sharedProperties={},this.spadeClient={},this.init({spadeUrl:e})}start(){this.sessionId=this.newGuid(),this.sharedProperties.session_id=this.sessionId}trackEvent(e){sn(this.spadeClient),e.data.properties=Object.assign({},this.sharedProperties,e.data.properties),this.spadeClient.send([e.data])}batchEvents(e){sn(this.spadeClient);const t=e.map((e=>(e.data.properties=Object.assign({},this.sharedProperties,e.data.properties),e.data)));this.spadeClient.send(t)}init({spadeUrl:e}){this.spadeClient=new on(e);const t=Qt.getParser(navigator.userAgent),n=this.parseSemver(String(t.getBrowserVersion()));this.sharedProperties={browser:navigator.appVersion,browser_family:t.getBrowserName().toLowerCase(),browser_version:`${n.major}.${n.minor}`,customer_id:"ivs",os_name:t.getOSName(),os_version:String(t.getOSVersion()),platform:"web",session_id:this.sessionId,sdk_version:"1.0.0",user_agent:navigator.userAgent}}newGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}parseSemver(e){const t=/^(\d+)\.(\d+)\.(\d+)[+|-]?(.*)?$/.exec(e)||/^(\d+)\.(\d+)[+|-]?(.*)?$/.exec(e)||/^(\d+)$/.exec(e)||[];return{major:parseInt(t[1],10)||0,minor:parseInt(t[2],10)||0,patch:parseInt(t[3],10)||0}}};var cn,un;an=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}([Zt(),(cn=0,un=tn(nn.SPADE_URL),function(e,t){un(e,t,cn)}),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[String])],an);const dn={name:"BroadcastError",code:1e3,message:"Unable to broadcast"},pn={name:"CameraError",code:2e3,message:"Camera could not be captured"},ln={name:"InputError",code:3e3,message:"Input could not be attached"},fn={name:"AddDeviceError",code:4e3,message:"Device is missing"},hn={name:"AddDeviceNameExistsError",code:4001,message:"Name is already registered"},mn={name:"AddDeviceCompositionMissingError",code:4002,message:"VideoComposition is missing"},vn={name:"AddDeviceCompositionIndexMissingError",code:4003,message:'VideoComposition\'s "index" property is missing'},gn={name:"AddDeviceNameMissingError",code:4004,message:"Name property is missing"},yn={name:"AddDeviceUnsupported",code:4005,message:"Unsupported device"},bn={name:"RemoveDeviceNotFoundError",code:5e3,message:"Device not found"},_n={name:"RemoveImageNotFoundError",code:6e3,message:"Image not found"},wn={name:"UpdateVideoDeviceCompositionMissingError",code:7e3,message:"VideoComposition is missing"},Sn={name:"UpdateVideoDeviceCompositionIndexMissingError",code:7001,message:'VideoComposition\'s "index" property is missing'},Cn={name:"UpdateVideoDeviceCompositionNameMissingError",code:7002,message:"Video device with that name is not found"},Tn={name:"ExchangePositionDeviceNotFoundError",code:8e3,message:"Device with that name is not found"},En={name:"FailedToAddImageError",code:9e3,message:"Failed to add image"},Rn={name:"PeerSetupError",code:1e4,message:"Unexpected return value from setup request"},On={name:"PeerConnectionError",code:10001,message:"Peer connection has failed."},Pn={name:"InvalidStreamKey",code:10003,message:"Invalid Stream Key."},An={name:"BroadcastConfigurationError",code:11e3,message:"Error when configuring broadcast client"},xn={name:"StreamConfigurationError",code:12e3,message:"Error when configuring stream"},Mn={name:"IngestEndpointTypeError",code:13e3,message:"Ingest endpoint must be a string"},In={name:"IngestEndpointUrlError",code:13001,message:"Ingest endpoint must be a valid https or rtmps URL"},kn={name:"LogLevelTypeError",code:14e3,message:"Log Level must be a valid integer between [0..5]"},Dn={name:"LoggerTypeError",code:15e3,message:"Logger must be an object"},jn={name:"ClientInvalidError",code:16e3,message:"Client is no longer valid, possibly due to delete() invocation."};class Nn extends Error{constructor({name:e,message:t,code:n,details:r,cause:i,params:o}){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,Nn),this.name=e||"BroadcastClientError",this.message=t,this.code=n,this.details=r,this.cause=i,this.params=o}}var Fn,Ln;!function(e){e[e.TRACE=0]="TRACE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(Fn||(Fn={})),function(e){e.SPADE="SPADE",e.TIME="Time",e.WEBRTC="WebRTC",e.EMITTER="Emitter",e.MEDIA="Media"}(Ln||(Ln={}));var Bn,Vn,Un,Gn,Wn,zn,qn,Kn=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},Hn=function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n};const Jn=1920,$n=Fn.ERROR,Yn={maxResolution:{width:852,height:480},maxFramerate:30,maxBitrate:1500},Qn={maxResolution:{width:480,height:852},maxFramerate:30,maxBitrate:1500},Zn={maxResolution:{width:1920,height:1080},maxFramerate:30,maxBitrate:8500},Xn={maxResolution:{width:1080,height:1920},maxFramerate:30,maxBitrate:8500};function er(e){var t,n;if("string"!=typeof e&&void 0!==e)throw new Nn(Mn);if(e){if(e.startsWith("https"))return e;{const r=/(?<protocol>(rtmps|https):\/\/)?(?<id>.+)\.(?<environment>(?=\S*['-])([a-zA-Z'-]+))\.live-video\.net.*/.exec(e);if("rtmps"===(null===(t=null==r?void 0:r.groups)||void 0===t?void 0:t.protocol)&&console.warn("rtmps server url detected; please pass in the ingest endpoint (no rtmps:// protocol) instead"),null===(n=null==r?void 0:r.groups)||void 0===n?void 0:n.id)return`https://${r.groups.id}.webrtc.live-video.net:4443`;throw new Nn(In)}}return""}let tr=class{constructor(){this.LOG_LEVEL=Fn,this.BASIC_LANDSCAPE=Yn,this.BASIC_PORTRAIT=Qn,this.STANDARD_LANDSCAPE=Zn,this.STANDARD_PORTRAIT=Xn,Bn.set(this,void 0),Vn.set(this,void 0),Un.set(this,Yn),Gn.set(this,void 0),Wn.set(this,(e=>{if(!e)throw new Nn(Object.assign(Object.assign({},xn),{details:"missing stream configuration"}));if(!(e.maxBitrate<=8500&&e.maxBitrate>=200))throw new Nn(Object.assign(Object.assign({},xn),{details:"maxBitrate must be between 200 and 8500"}));if(!(e.maxFramerate<=60&&e.maxFramerate>=10))throw new Nn(Object.assign(Object.assign({},xn),{details:"maxFramerate must be between 10 and 60"}));const t=e.maxResolution.width,n=e.maxResolution.height;if(t>Jn||n>Jn||t<160||n<160||t===Jn&&n>1080||n===Jn&&t>1080)throw new Nn(Object.assign(Object.assign({},xn),{details:"maxResolution values must be between 1080x1920 or 1920x1080"}))})),zn.set(this,(e=>{if(!e)return;const t=Number(e),n=Number.isInteger(t),r=t>=Fn.TRACE,i=t<=Fn.SILENT;if(!n||!r||!i)throw new Nn(kn)})),qn.set(this,(e=>{if(e&&"object"!=typeof e)throw new Nn(Dn)}))}get ingestEndpoint(){return Kn(this,Bn,"f")}set ingestEndpoint(e){Hn(this,Bn,er(e),"f")}get streamConfig(){return Kn(this,Un,"f")}set streamConfig(e){Kn(this,Wn,"f").call(this,e),Hn(this,Un,e,"f")}get logLevel(){return Kn(this,Vn,"f")}set logLevel(e){Kn(this,zn,"f").call(this,e),Hn(this,Vn,e,"f")}get logger(){return Kn(this,Gn,"f")}set logger(e){Kn(this,qn,"f").call(this,e),Hn(this,Gn,e,"f")}};Bn=new WeakMap,Vn=new WeakMap,Un=new WeakMap,Gn=new WeakMap,Wn=new WeakMap,zn=new WeakMap,qn=new WeakMap,tr=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}([Zt()],tr);const nr={[Fn.INFO]:"#528bff",[Fn.WARN]:"#ffb31a",[Fn.DEBUG]:"#00f593",[Fn.ERROR]:"#ff4f4d",[Fn.TRACE]:"",[Fn.SILENT]:"",[Ln.SPADE]:"#a970ff",[Ln.TIME]:"#53535f",[Ln.WEBRTC]:"#0e9bd8",[Ln.EMITTER]:"#adadb8",details:"#808080"},rr=({label:e})=>`background: ${nr[e]}; color: white; padding: 3px; margin-left: 3px;`,ir=Object.entries(Fn),or=(e,t,n)=>{const r=rr({label:e}),[i]=ir.find((([,t])=>t===Number(e)))||[],o=`%c${i}`,s=rr({label:t}),a=`%c${t}`,c=rr({label:Ln.TIME}),u=`%c[${(new Date).toISOString()}]`,d=rr({label:"details"}),p=`%c[${n}]`,l=[u,o,a],f=[c,r,s];return n&&(l.push(p),f.push(d)),[l.join(""),...f]},sr={debug(e){console.groupCollapsed(...or(Fn.DEBUG,e.scope,e.label)),console.debug(Object.assign(Object.assign({},e),{level:"debug"})),console.groupEnd()},info(e){console.groupCollapsed(...or(Fn.INFO,e.scope,e.label)),console.info(Object.assign(Object.assign({},e),{level:"info"})),console.groupEnd()},warn(e){console.groupCollapsed(...or(Fn.WARN,e.scope,e.label)),console.warn(Object.assign(Object.assign({},e),{level:"warn"})),console.groupEnd()},error(e){console.error(e)}};var ar,cr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const ur=Object.entries(Fn);let dr=class{constructor(e){var t;this.config=e;const n=this.config.logLevel,r=Fn[null==n?void 0:n.toString().toUpperCase()],[,i]=ur.find((([,e])=>e===Number(n)))||[];this.logLevel=null!==(t=null!=r?r:i)&&void 0!==t?t:$n;const o=e.logger;this.loggerInstance=o||sr}debug(e){var t,n;this.logLevel>Fn.DEBUG||null===(n=(t=this.loggerInstance).debug)||void 0===n||n.call(t,JSON.parse(JSON.stringify(Object.assign(Object.assign({},e),{level:"debug"}))))}info(e){var t,n;this.logLevel>Fn.INFO||null===(n=(t=this.loggerInstance).info)||void 0===n||n.call(t,JSON.parse(JSON.stringify(Object.assign(Object.assign({},e),{level:"info"}))))}warn(e){var t,n;this.logLevel>Fn.WARN||null===(n=(t=this.loggerInstance).warn)||void 0===n||n.call(t,JSON.parse(JSON.stringify(Object.assign(Object.assign({},e),{level:"warn"}))))}error(e){var t,n,{err:r}=e,i=cr(e,["err"]);this.logLevel>Fn.ERROR||null===(n=(t=this.loggerInstance).error)||void 0===n||n.call(t,Object.assign({err:r},i))}};dr=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}([Zt(),function(e,t){return function(n,r){t(n,r,e)}}(0,tn(nn.CONFIG)),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",["function"==typeof(ar=void 0!==tr&&tr)?ar:Object])],dr);class pr{constructor(e,t){this.logger=e,this.scope=t}debug(e){var t,n;null===(n=(t=this.logger).debug)||void 0===n||n.call(t,JSON.parse(JSON.stringify(Object.assign(Object.assign({},e),{scope:this.scope}))))}info(e){var t,n;null===(n=(t=this.logger).info)||void 0===n||n.call(t,JSON.parse(JSON.stringify(Object.assign(Object.assign({},e),{scope:this.scope}))))}warn(e){var t,n;null===(n=(t=this.logger).warn)||void 0===n||n.call(t,JSON.parse(JSON.stringify(Object.assign(Object.assign({},e),{scope:this.scope}))))}error(e){var t,n,{err:r}=e,i=cr(e,["err"]);null===(n=(t=this.logger).error)||void 0===n||n.call(t,Object.assign(Object.assign({err:r},i),{scope:this.scope}))}}class lr{constructor(e,t){this.transformProperties=(e,t)=>({sum:e.sum,median:e.median(),min:e.min,max:e.max,p90:e.percentile(.9),event_count:e.data.length,period:t});const n=this.transformProperties(e,t);this.data={event:Mr.CONGESTION_TIME,properties:n}}}class fr{constructor(e,t,n){this.transformProperties=(e,t,n)=>({duration:(e.getTime()-((null==t?void 0:t.getTime())||0))/1e3,ecn_negotiated:!1,ingest_session_id:n});const r=this.transformProperties(e,t,n);this.data={event:Mr.CONNECTION_ESTABLISHED,properties:r}}}class hr{constructor(e,t){this.transformProperties=(e,t)=>({sum:e.sum,median:e.median(),min:e.min,max:e.max,p90:e.percentile(.9),event_count:e.data.length,period:t});const n=this.transformProperties(e,t);this.data={event:Mr.CONNECTION_RTT,properties:n}}}class mr{constructor(e){this.transformProperties=e=>{var t;return{is_fatal:null!==(t=e.isFatal)&&void 0!==t&&t,value:e.value,code:e.code,description:e.description}};const t=this.transformProperties(e);this.data={event:Mr.ERROR,properties:t}}}class vr{constructor(e,t){this.transformProperties=(e,t)=>({type:e,input_device_id:t.deviceId,position:t.facingMode||"unknown"});const n=this.transformProperties(e,t);this.data={event:Mr.INPUT_DEVICE_ATTACHED,properties:n}}}class gr{constructor(e,t){this.transformProperties=(e,t)=>({type:e,input_device_id:t.deviceId,position:t.facingMode||"unknown"});const n=this.transformProperties(e,t);this.data={event:Mr.INPUT_DEVICE_DETACHED,properties:n}}}class yr{constructor(e,t){this.transformProperties=(e,t)=>({sum:e.sum,median:e.median(),min:e.min,max:e.max,p90:e.percentile(.9),event_count:e.data.length,period:t});const n=this.transformProperties(e,t);this.data={event:Mr.MEASURED_BITRATE,properties:n}}}class br{constructor(e,t){this.transformProperties=(e,t)=>({minutes_logged:Math.round((e.timestamp-t)/6e4)});const n=this.transformProperties(e,t);this.data={event:Mr.MINUTE_BROADCAST,properties:n}}}class _r{constructor(e,t){this.transformProperties=(e,t)=>({sum:e.sum,median:e.median(),min:e.min,max:e.max,p90:e.percentile(.9),event_count:e.data.length,period:t});const n=this.transformProperties(e,t);this.data={event:Mr.RECOMMENDED_BITRATE,properties:n}}}class wr{constructor(e){this.transformProperties=e=>({codec:e.mimeType,bitrate:0,sample_rate:e.clockRate,channel_count:e.channels});const t=this.transformProperties(e);this.data={event:Mr.SESSION_AUDIO_ENCODER_CONFIGURED,properties:t}}}class Sr{constructor(e){this.transformProperties=e=>({codec:"audio",bitrate:32e3,sample_rate:e.sampleRate,channel_count:e.channelCount});const t=this.transformProperties(e);this.data={event:Mr.SESSION_AUDIO_PROPERTIES,properties:t}}}class Cr{constructor(e,t,n){this.transformProperties=(e,t,n)=>({codec:n.mimeType,codec_profile:t.profile,codec_level:t.level,rate_mode:"vbr",initial_bitrate:0,keyframe_interval:2,width:e.width,height:e.height,bframe_count:0,target_fps:e.frameRate});const r=this.transformProperties(e,t,n);this.data={event:Mr.SESSION_VIDEO_ENCODER_CONFIGURED,properties:r}}}class Tr{constructor(e){this.transformProperties=e=>({codec:"video",initial_bitrate:32e3,min_bitrate:0,max_bitrate:0,keyframe_interval:2,width:e.width,height:e.height,auto_bitrate_enabled:!0,bframes_enabled:!1,target_fps:e.frameRate});const t=this.transformProperties(e);this.data={event:Mr.SESSION_VIDEO_PROPERTIES,properties:t}}}class Er{constructor(e,t){this.transformProperties=(e,t)=>({sum:e.sum,median:e.median(),min:e.min,max:e.max,p90:e.percentile(.9),event_count:e.data.length,period:t});const n=this.transformProperties(e,t);this.data={event:Mr.SOURCE_AUDIO_LATENCY,properties:n}}}class Rr{constructor(e,t){this.transformProperties=(e,t)=>({sum:e.sum,median:e.median(),min:e.min,max:e.max,p90:e.percentile(.9),event_count:e.data.length,period:t});const n=this.transformProperties(e,t);this.data={event:Mr.SOURCE_VIDEO_LATENCY,properties:n}}}class Or{constructor(e){this.transformProperties=({protocol:e,hostname:t,port:n})=>({protocol:e,endpoint_host:t,endpoint_port:n});const t=this.transformProperties(e);this.data={event:Mr.START_BROADCAST,properties:t}}}class Pr{constructor(e){this.transformProperties=({protocol:e,hostname:t,port:n})=>({protocol:e,endpoint_host:t,endpoint_port:n});const t=this.transformProperties(e);this.data={event:Mr.STOP_BROADCAST,properties:t}}}class Ar{constructor(e){this.transformProperties=e=>({bytes_sent:e.bytesSent,header_bytes_sent:e.headerBytesSent,nack_count:e.nackCount,packets_sent:e.packetsSent,retransmitted_bytes_sent:e.retransmittedBytesSent,retransmitted_packets_sent:e.retransmittedPacketsSent});const t=this.transformProperties(e);this.data={event:Mr.WEBRTC_AUDIO_STATS,properties:t}}}class xr{constructor(e){this.transformProperties=e=>({bytes_sent:e.bytesSent,fir_count:e.firCount,frames_encoded:e.framesEncoded,frames_sent:e.framesSent,header_bytes_sent:e.headerBytesSent,huge_frames_sent:e.hugeFramesSent,key_frames_encoded:e.keyFramesEncoded,nack_count:e.nackCount,packets_sent:e.packetsSent,pli_count:e.pliCount,quality_limitation_reason:e.qualityLimitationReason,quality_limitation_resolution_changes:e.qualityLimitationResolutionChanges,retransmitted_bytes_sent:e.retransmittedBytesSent,retransmitted_packets_sent:e.retransmittedPacketsSent,total_encode_time:e.totalEncodeTime,total_encoded_bytes_target:e.totalEncodedBytesTarget,total_packet_send_delay:e.totalPacketsSendDelay});const t=this.transformProperties(e);this.data={event:Mr.WEBRTC_VIDEO_STATS,properties:t}}}var Mr;!function(e){e.START_BROADCAST="ivs_broadcast_start_broadcast",e.STOP_BROADCAST="ivs_broadcast_stop_broadcast",e.MINUTE_BROADCAST="ivs_broadcast_minute_broadcast",e.WEBRTC_AUDIO_STATS="ivs_broadcast_webrtc_audio_stats",e.WEBRTC_VIDEO_STATS="ivs_broadcast_webrtc_video_stats",e.CONNECTION_ESTABLISHED="ivs_broadcast_connection_established",e.SESSION_VIDEO_PROPERTIES="ivs_broadcast_session_video_properties",e.SESSION_AUDIO_PROPERTIES="ivs_broadcast_session_audio_properties",e.SESSION_VIDEO_ENCODER_CONFIGURED="ivs_broadcast_session_video_encoder_configured",e.SESSION_AUDIO_ENCODER_CONFIGURED="ivs_broadcast_session_audio_encoder_configured",e.SOURCE_AUDIO_LATENCY="ivs_broadcast_source_audio_latency",e.SOURCE_VIDEO_LATENCY="ivs_broadcast_source_video_latency",e.INPUT_DEVICE_ATTACHED="ivs_broadcast_input_device_attached",e.INPUT_DEVICE_DETACHED="ivs_broadcast_input_device_detached",e.CONGESTION_TIME="ivs_broadcast_congestion_time",e.BUFFER_DURATION="ivs_broadcast_buffer_duration",e.MEASURED_BITRATE="ivs_broadcast_measured_bitrate",e.RECOMMENDED_BITRATE="ivs_broadcast_recommended_bitrate",e.CONNECTION_RTT="ivs_broadcast_connection_rtt",e.ERROR="ivs_broadcast_error"}(Mr||(Mr={}));class Ir{constructor(){this.min=0,this.max=0,this.sum=0,this.data=[]}push(e){(0===this.min||e<this.min)&&(this.min=e),e>=this.max&&(this.max=e),this.data.push(e),this.sum+=e}median(){this.data.sort();const e=this.data.length>>1;return this.data.length%2==0?this.data[e-1]+this.data[e]>>1:this.data[e]}percentile(e){if(0===this.data.length)return 0;if(e<=0)return this.data[0];if(e>=1)return this.data[this.data.length-1];const t=(this.data.length-1)*e,n=Math.floor(t),r=n+1,i=t%1;return r>=this.data.length?this.data[n]:this.data[n]*(1-i)+this.data[r]*i}}var kr,Dr=function(e,t){return function(n,r){t(n,r,e)}},jr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};let Nr=class{constructor(e,t,n,r){this.analyticsTracker=e,this.peerClient=t,this.mediaStreamManager=n,this.logger=new pr(r,Ln.EMITTER),this.previousBytesSent=0,this.startTimestamp=0,this.initializeSamples()}start(){this.logger.info({msg:"start emitter"}),this.collectSamplesTimerId=window.setInterval((()=>{this.collectSamples()}),1e3),this.trackSamplesTimerId=window.setInterval((()=>{this.trackSamples()}),3e4),this.trackPeerConnectionStatsTimerId=window.setInterval((()=>{this.trackPeerConnectionStats()}),6e4),this.trackSamples()}stop(){clearInterval(this.collectSamplesTimerId),clearInterval(this.trackSamplesTimerId),clearInterval(this.trackPeerConnectionStatsTimerId),this.collectSamplesTimerId=void 0,this.trackSamplesTimerId=void 0,this.trackPeerConnectionStatsTimerId=void 0}trackPeerConnectionStats(){return jr(this,void 0,void 0,(function*(){(yield this.peerClient.getReports()).forEach((e=>{if("outbound-rtp"===e.type)switch(e.kind){case"audio":this.analyticsTracker.trackEvent(new Ar(e));break;case"video":{const t=new xr(e),n=new br(e,this.startTimestamp);this.analyticsTracker.batchEvents([t,n]);break}default:this.logger.warn({msg:"unknown report kind: ",reportKind:e.kind})}}))}))}collectSamples(){return jr(this,void 0,void 0,(function*(){let e=0;this.audioLatencySamples.push(this.mediaStreamManager.getAudioLatency()),this.videoLatencySamples.push(this.mediaStreamManager.getVideoLatency()),(yield this.peerClient.getReports()).forEach((t=>{switch(t.type){case"candidate-pair":t.nominated&&(this.rttSamples.push(t.currentRoundTripTime),this.recommendedBitrateSamples.push(t.availableOutgoingBitrate));break;case"outbound-rtp":e+=t.bytesSent||0,0===this.startTimestamp&&"video"===t.kind&&(this.startTimestamp=t.timestamp)}}));const t=8*Math.round(e-this.previousBytesSent);this.previousBytesSent=e,this.measuredBitrateSamples.push(t)}))}trackSamples(){const e=30,t=new Er(this.audioLatencySamples,e),n=new Rr(this.videoLatencySamples,e),r=new lr(this.congestionTimeSamples,e),i=new yr(this.measuredBitrateSamples,e),o=new _r(this.recommendedBitrateSamples,e),s=new hr(this.rttSamples,e);this.analyticsTracker.batchEvents([t,n,r,i,o,s]),this.initializeSamples()}initializeSamples(){this.audioLatencySamples=new Ir,this.videoLatencySamples=new Ir,this.congestionTimeSamples=new Ir,this.measuredBitrateSamples=new Ir,this.recommendedBitrateSamples=new Ir,this.rttSamples=new Ir}};Nr=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}([Zt(),Dr(0,tn(nn.ANALYTICS_TRACKER)),Dr(1,tn(nn.PEER_CLIENT)),Dr(2,tn(nn.MEDIA_STREAM_MANAGER)),Dr(3,tn(nn.LOGGER)),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Object,Object,Object,"function"==typeof(kr=void 0!==dr&&dr)?kr:Object])],Nr);const Fr={CONNECTION_STATE_CHANGE:"connectionStateChange",ERROR:"clientError",ACTIVE_STATE_CHANGE:"activeStateChange"};var Lr;!function(e){e.CLOSED="closed",e.COMPLETED="completed",e.CONNECTED="connected",e.CONNECTING="connecting",e.DISCONNECTED="disconnected",e.FAILED="failed",e.IDLE="idle",e.NEW="new",e.NONE="none"}(Lr||(Lr={}));const Br=new Map;var Vr,Ur,Gr=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Wr=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},zr=function(e,t){return function(n,r){t(n,r,e)}},qr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};let Kr=Vr=class{constructor(e,t,n,r,i,o){this.emitter=e,this.config=t,this.mediaStreamManager=n,this.peerClient=r,this.peerStatsTracker=i,this.analyticsTracker=o,this.isValid=!0,this.config.ingestEndpoint&&(this.url=new URL(this.config.ingestEndpoint)),this.mediaStreamManager.start(),Object.getOwnPropertyNames(Vr.prototype).forEach((e=>{this[e]=new Proxy(this[e],{apply:(e,t,n)=>{if(!t.isValid)throw new Nn(Object.assign({},jn));return Reflect.apply(e,t,n)}})}))}delete(){this.isValid=!1,this.peerClient.stop(),this.mediaStreamManager.stop()}startBroadcast(e,t){return qr(this,void 0,void 0,(function*(){const n=er(t||this.config.ingestEndpoint);this.analyticsTracker.start(),this.peerStatsTracker.start(),yield this.peerClient.start(n,e),this.emitter.emit(Fr.ACTIVE_STATE_CHANGE,!0),this.url=new URL(n),this.url&&this.analyticsTracker.trackEvent(new Or({protocol:"webrtc",hostname:this.url.hostname,port:this.url.port}))}))}stopBroadcast(){this.url&&this.analyticsTracker.trackEvent(new Pr({protocol:"webrtc",hostname:this.url.hostname,port:this.url.port})),this.peerStatsTracker.stop(),this.peerClient.stop(),this.emitter.emit(Fr.ACTIVE_STATE_CHANGE,!1)}getCanvasDimensions(){return this.mediaStreamManager.getCanvasDimensions()}addVideoInputDevice(e,t,n){return qr(this,void 0,void 0,(function*(){return this.mediaStreamManager.addVideoInputDevice(e,t,n)}))}addImageSource(e,t,n){return qr(this,void 0,void 0,(function*(){return this.mediaStreamManager.addImageSource(e,t,n)}))}addAudioInputDevice(e,t){return qr(this,void 0,void 0,(function*(){return this.mediaStreamManager.addAudioInputDevice(e,t)}))}removeVideoInputDevice(e){this.mediaStreamManager.removeVideoInputDevice(e)}removeAudioInputDevice(e){this.mediaStreamManager.removeAudioInputDevice(e)}removeImage(e){this.mediaStreamManager.removeImage(e)}updateVideoDeviceComposition(e,t){this.mediaStreamManager.updateVideoDeviceComposition(e,t)}exchangeVideoDevicePositions(e,t){this.mediaStreamManager.exchangeVideoDevicePositions(e,t)}getAudioInputDevice(e){return this.mediaStreamManager.getAudioInputDevice(e)}getVideoInputDevice(e){return this.mediaStreamManager.getVideoInputDevice(e)}getConnectionState(){return this.peerClient.getConnectionState()}getSessionId(){return this.peerClient.getSessionId()}on(e,t){this.emitter.on(e,t)}off(e,t){this.emitter.off(e,t)}getAudioContext(){return this.mediaStreamManager.audioContext}attachPreview(e){this.mediaStreamManager.attachPreview(e)}detachPreview(){this.mediaStreamManager.detachPreview()}disableVideo(){this.mediaStreamManager.disableVideo()}enableVideo(){this.mediaStreamManager.enableVideo()}disableAudio(){this.mediaStreamManager.disableAudio()}enableAudio(){this.mediaStreamManager.enableAudio()}};var Hr;Gr([(Hr=Fr.ERROR,function(e,t,n){if(!Br.has(Hr))return void Br.set(Hr,[{instance:e,methodKey:t}]);const r=Br.get(Hr)||[];if(r.every((e=>e.instance[e.methodKey].toString()===n.value.toString())))return;const i=r.concat({instance:e,methodKey:t});Br.set(Hr,i)}),Wr("design:type",Function),Wr("design:paramtypes",[]),Wr("design:returntype",void 0)],Kr.prototype,"stopBroadcast",null),Kr=Vr=Gr([Zt(),zr(0,tn(nn.EMITTER)),zr(1,tn(nn.CONFIG)),zr(2,tn(nn.MEDIA_STREAM_MANAGER)),zr(3,tn(nn.PEER_CLIENT)),zr(4,tn(nn.PEER_STATS_TRACKER)),zr(5,tn(nn.ANALYTICS_TRACKER)),Wr("design:paramtypes",[Object,"function"==typeof(Ur=void 0!==tr&&tr)?Ur:Object,Object,Object,Object,Object])],Kr);var Jr,$r=n(2492);!function(e){e.CONFIG="config",e.UPDATE="update",e.START="start",e.STOP="stop"}(Jr||(Jr={}));const Yr=e=>{const t=e=>{var t;return(null===(t=e.deviceId)||void 0===t?void 0:t.startsWith("web-contents-media-stream"))?"tab":void 0},n=e=>{var t;return(null===(t=e.deviceId)||void 0===t?void 0:t.startsWith("window"))&&"window"===e.displaySurface?"window":void 0},r=e=>{var t;return(null===(t=e.deviceId)||void 0===t?void 0:t.startsWith("screen"))&&"monitor"===e.displaySurface?"screen":void 0};return(t(i=e)||n(i)||r(i)?void 0:"camera")||r(e)||n(e)||t(e)||"unknown";var i};var Qr,Zr=function(e,t){return function(n,r){t(n,r,e)}},Xr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};!function(e){e.video="video",e.audio="audio"}(Qr||(Qr={}));const ei=new Map([["video",void 0],["audio",void 0]]);let ti=class{constructor(e,t,n){this.config=e,this.analyticsTracker=t,this.schedulerWorker=n,this.handleWorkerEvent=e=>{var t;(null===(t=e.data)||void 0===t?void 0:t.type)===Jr.UPDATE&&this.drawComposite()},this.mixer={video:[],audio:[]},this.running=!1,this.compositeEl=document.createElement("canvas"),this.compositeEl.height=this.config.streamConfig.maxResolution.height,this.compositeEl.width=this.config.streamConfig.maxResolution.width;const r=this.compositeEl.getContext("2d");if(null===r)throw new Nn(Object.assign({},dn));this.compositeContext=r,this.compositeStream=this.compositeEl.captureStream(void 0!==typeof CanvasCaptureMediaStreamTrack?0:30);const i=ni(this.compositeStream.getTracks(),Qr.video);this.audioContext=new AudioContext,this.unlockAudioContext(),this.audioDestination=this.audioContext.createMediaStreamDestination(),this.setupSilence();const o=ni(this.audioDestination.stream.getTracks(),Qr.audio);ei.set("video",i),ei.set("audio",o),this.schedulerWorker.addEventListener("message",this.handleWorkerEvent),this.schedulerWorker.postMessage({type:Jr.CONFIG,payload:{frameRate:this.config.streamConfig.maxFramerate}}),this.previewElement=null,this.previewCtx=null,this.nextMix=(new Date).getTime()}attachPreview(e){this.previewElement=e;const{width:t,height:n}=this.config.streamConfig.maxResolution;this.previewElement.width=t,this.previewElement.height=n,this.previewCtx=this.previewElement.getContext("2d")}detachPreview(){this.previewElement=null,this.previewCtx=null}setupSilence(){const e=this.audioContext.createConstantSource(),t=this.audioContext.createGain();t.gain.value=.001,e.connect(t),t.connect(this.audioDestination),e.start()}unlockAudioContext(){if("suspended"!==this.audioContext.state)return;const e=document.body,t=["touchstart","touchend","mousedown","keydown"],n=()=>{t.forEach((t=>{e.removeEventListener(t,r)}))},r=()=>{this.audioContext.resume().then(n)};t.forEach((t=>{e.addEventListener(t,r,!1)}))}getTracks(){return[ei.get("video"),ei.get("audio")]}getCanvasVideoTrack(){return ei.get("video")}getAudioInputDevice(e){if("string"!=typeof e)return;const t=this.mixer.audio.find((t=>{if(t.name===e)return t.source}));return null==t?void 0:t.source}getVideoInputDevice(e){if("string"==typeof e)return this.mixer.video.find((t=>t.name===e))}getCanvasDimensions(){return{height:this.compositeEl.height,width:this.compositeEl.width}}addVideoInputDevice(e,t,n){var r;return Xr(this,void 0,void 0,(function*(){if("object"!=typeof e)throw new Nn(Object.assign({},fn));if(!t||"string"!=typeof t)throw new Nn(Object.assign({},gn));if(this.mixer.video.some((e=>e.name===t)))throw new Nn(Object.assign({},hn));if(!n)throw new Nn(Object.assign({},mn));if("number"!=typeof n.index)throw new Nn(Object.assign({},vn));const i=function(){const e=document.createElement("video");return e.autoplay=!0,e.muted=!0,e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e}(),o=e.getVideoTracks(),[s]=o;if(!o.length)throw new Nn(Object.assign({},pn));const a=s.getConstraints(),c=$r({},a,{frameRate:this.config.streamConfig.maxFramerate});yield s.applyConstraints(c);const u=new MediaStream([s]);i.srcObject=u;try{yield i.play();const e={name:t,element:i,position:n,source:u,render:!0},o=(null===(r=s.getSettings)||void 0===r?void 0:r.call(s))||{};this.analyticsTracker.trackEvent(new vr(Yr(o),o)),this.mixer.video.push(e)}catch(e){throw new Nn(Object.assign(Object.assign({},pn),{cause:e}))}}))}addImageSource(e,t,n){var r;return Xr(this,void 0,void 0,(function*(){if(!e)throw new Nn(Object.assign({},fn));if(!t||"string"!=typeof t)throw new Nn(Object.assign({},gn));if("image"===e.tagName)throw new Nn(Object.assign({},yn));if(this.mixer.video.some((e=>e.name===t)))throw new Nn(Object.assign({},hn));if(!n)throw new Nn(Object.assign({},mn));if("number"!=typeof n.index)throw new Nn(Object.assign({},vn));if(e instanceof Image){const t=null===(r=e.src)||void 0===r?void 0:r.slice();try{const t=e.src?new URL(e.src):{};if(t.host&&t.hostname){const t=yield fetch(e.src).then((e=>Xr(this,void 0,void 0,(function*(){return e.blob()})))),n=yield new Promise((e=>{const n=new FileReader;n.onload=()=>{e(n.result)},n.readAsDataURL(t)}));e.src=n}}catch(e){throw new Nn(Object.assign(Object.assign({},En),{params:{details:`Image URL: ${t}`}}))}}const i={name:t,element:e,position:n,render:!0};this.mixer.video.push(i)}))}addAudioInputDevice(e,t){return Xr(this,void 0,void 0,(function*(){if("object"!=typeof e)throw new Nn(Object.assign({},fn));if(!t||"string"!=typeof t)throw new Nn(Object.assign({},gn));if(this.mixer.audio.some((e=>e.name===t)))throw new Nn(Object.assign({},hn));const n=e.getAudioTracks();if(!n.length)throw new Nn(Object.assign({},ln));const r=this.audioContext.createMediaStreamSource(new MediaStream(n)),i=this.audioContext.createGain();i.gain.value=1,r.connect(i),i.connect(this.audioDestination);const o={name:t,source:e,audioTrackSource:r,gainNode:i};this.analyticsTracker.trackEvent(new vr("audio",{deviceId:e.id})),this.mixer.audio.push(o)}))}removeImage(e){const t=this.mixer.video.findIndex((t=>t.name===e));if(t<0)throw new Nn(Object.assign({},_n));this.mixer.video.splice(t,1)}removeVideoInputDevice(e){var t;const n=this.removeDevice(e,this.mixer.video);if(!n)throw new Nn(Object.assign({},bn));{const e=ni(n.source.getTracks(),Qr.video);if(!e)throw new Nn(Object.assign({},bn));n.element.srcObject=null,e.stop();const r=(null===(t=null==e?void 0:e.getSettings)||void 0===t?void 0:t.call(e))||{};this.analyticsTracker.trackEvent(new gr(Yr(r),r))}}removeAudioInputDevice(e){const t=this.removeDevice(e,this.mixer.audio);if(null==t?void 0:t.audioTrackSource){for(const e of t.source.getTracks())e.stop(),this.analyticsTracker.trackEvent(new gr("audio",{deviceId:e.id}));t.gainNode.disconnect(this.audioDestination)}else if(!t)throw new Nn(Object.assign({},bn))}updateVideoDeviceComposition(e,t){if(!e||"string"!=typeof e)throw new Nn(Object.assign({},Cn));if(!t)throw new Nn(Object.assign({},wn));if("number"!=typeof t.index)throw new Nn(Object.assign({},Sn));this.mixer.video.forEach(((n,r)=>{n.name===e&&(n.position=t)}))}exchangeVideoDevicePositions(e,t){const n=this.getVideoInputDevice(e),r=this.getVideoInputDevice(t);if(!n)throw new Nn(Object.assign(Object.assign({},Tn),{params:{details:`device with name: "${e}" not found`}}));if(!r)throw new Nn(Object.assign(Object.assign({},Tn),{params:{details:`device with name: "${t}" not found`}}));const i=Object.assign({},n.position),o=Object.assign({},r.position);for(const n of this.mixer.video)n.name===e&&(ri(o.x)?n.position=Object.assign(Object.assign({},n.position),o):n.position={index:o.index}),n.name===t&&(ri(i.x)?n.position=Object.assign(Object.assign({},n.position),i):n.position={index:i.index})}start(){this.running||(this.running=!0,this.schedulerWorker.postMessage({type:Jr.CONFIG,payload:{frameRate:this.config.streamConfig.maxFramerate}}),this.schedulerWorker.postMessage({type:Jr.START}))}stop(){this.running&&(this.running=!1,this.schedulerWorker.removeEventListener("message",this.handleWorkerEvent))}isCapturing(){return this.running}getAudioLatency(){return this.audioContext.baseLatency}getVideoLatency(){var e;return(null===(e=ei.get("video"))||void 0===e?void 0:e.getConstraints().latency)||0}disableVideo(){this.mixer.video.forEach((e=>{e.render=!1}))}enableVideo(){this.mixer.video.forEach((e=>{e.render=!0}))}disableAudio(){this.mixer.audio.forEach((e=>{e.audioTrackSource&&(e.gainNode.gain.value=0)}))}enableAudio(){this.mixer.audio.forEach((e=>{e.audioTrackSource&&(e.gainNode.gain.value=1)}))}getDrawRegion(e,t,n){var r,i,o,s;let a=null!==(r=e.position.x)&&void 0!==r?r:0,c=null!==(i=e.position.y)&&void 0!==i?i:0;const u=null!==(o=e.position.width)&&void 0!==o?o:t-a,d=null!==(s=e.position.height)&&void 0!==s?s:n-c,p=u/d;let l=e.element.width,f=e.element.height;e.element instanceof HTMLVideoElement&&(l=e.element.videoWidth,f=e.element.videoHeight);const h=l/f;let m=u,v=d;return h>p?(m=u,v=2*Math.round(u/h/2),c+=(d-v)/2):h<p&&(v=d,m=2*Math.round(d*h/2),a+=(u-m)/2),{x:a,y:c,width:m,height:v}}drawComposite(){if(!this.shouldMix(new Date))return;this.compositeContext.clearRect(0,0,this.compositeEl.width,this.compositeEl.height),this.drawBlackScreen();const e=this.mixer.video.filter((e=>e.render));e.sort(((e,t)=>e.position.index-t.position.index));for(const t of e){const{x:e,y:n,width:r,height:i}=this.getDrawRegion(t,this.compositeEl.width,this.compositeEl.height);this.compositeContext.drawImage(t.element,e,n,r,i)}this.previewElement&&this.previewCtx&&this.previewCtx.drawImage(this.compositeEl,0,0,this.previewElement.width,this.previewElement.height),this.requestCanvasCapture()}requestCanvasCapture(){void 0!==typeof CanvasCaptureMediaStreamTrack&&("function"==typeof this.compositeStream.requestFrame?this.compositeStream.requestFrame():ei.get("video").requestFrame())}drawBlackScreen(){this.compositeContext.fillStyle="#000000",this.compositeContext.fillRect(0,0,this.compositeEl.width,this.compositeEl.height)}removeDevice(e,t){const n=t.findIndex((t=>(t=>t.name===e)(t)));if(!(n<0))return t.splice(n,1)[0]}shouldMix(e){if(e.getTime()<this.nextMix)return!1;for(;this.nextMix<=e.getTime();)this.nextMix+=1e3/this.config.streamConfig.maxFramerate;return!0}};function ni(e,t){return e.find((e=>e.kind===t))}function ri(e){return Number.isSafeInteger(e)}ti=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}([Zt(),Zr(0,tn(nn.CONFIG)),Zr(1,tn(nn.ANALYTICS_TRACKER)),Zr(2,tn(nn.WORKER)),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Object,Object,Object])],ti);class ii{constructor(){this.levelAsymmetryAllowed=!1,this.packetisationMode=!1,this.profile="",this.level=0}extractVideoSdpFmtpLine(e){return e?(e.split("\r").join(";").split("\n").join(";").split(" ").join(";").split(";").map((e=>e.trim())).filter(Boolean).forEach((e=>{const t=e.split("=");if(2===t.length)switch(t[0]){case"level-asymmetry-allowed":"1"===t[1]?this.levelAsymmetryAllowed=!0:this.levelAsymmetryAllowed=!1;break;case"packetization-mode":"1"===t[1]?this.packetisationMode=!0:this.packetisationMode=!1;break;case"profile-level-id":this.profile=this.getProfileFromId(t[1]),this.level=this.getLevelFromId(t[1])}})),{levelAsymmetryAllowed:this.levelAsymmetryAllowed,packetisationMode:this.packetisationMode,profile:this.profile,level:this.level}):{levelAsymmetryAllowed:this.levelAsymmetryAllowed,packetisationMode:this.packetisationMode,profile:this.profile,level:this.level}}getProfileFromId(e){const t=e.substr(0,2),n=e.substr(2,2);switch(t.substr(0,2)){case"42":return"baseline";case"4d":return"main";case"58":return"extended";case"64":return"high";case"6e":return"00"===n?"high 10":"high 10 intra";case"7a":return"00"===n?"high 42":"high 42 intra";case"f4":return"00"===n?"high 44":"high 44 intra";default:return"unknown"}}getLevelFromId(e){return parseInt(e.substr(4,2),16)}}function oi(e){return btoa(JSON.stringify(e))}var si,ai,ci=function(e,t){return function(n,r){t(n,r,e)}},ui=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};const di=e=>!!e;function pi(e){if(!e)throw new Error("PeerConnection is not defined")}const li={bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",enableDtlsSrtp:{exact:!0},enableRtpDataChannels:{exact:!1},optional:[{googHighStartBitrate:{exact:0}},{googPayloadPadding:{exact:!0}},{googScreencastMinBitrate:{exact:100}},{googCpuOveruseDetection:{exact:!0}},{googCpuOveruseEncodeUsage:{exact:!0}},{googCpuUnderuseThreshold:{exact:55}},{googCpuOveruseThreshold:{exact:85}},{enableDscp:{exact:!0}}]};let fi=class{constructor(e,t,n,r){this.config=e,this.analyticsTracker=t,this.emitter=n,this.establishConnection=(e,t)=>ui(this,void 0,void 0,(function*(){var n,r;pi(this.peerConnection);try{const n=yield this.peerConnection.createOffer({offerToReceiveAudio:!1,offerToReceiveVideo:!1});yield this.handleLocalDescription(n),yield this.sendSetupRequest(e,t,n)}catch(e){if(e instanceof Error){null!==(n=(r=e).code)&&void 0!==n||(r.code=Rn.code);const t=new Nn(Object.assign(Object.assign({},Rn),{name:e.name,message:e.message,code:null==e?void 0:e.code,cause:e}));throw this.handleError(e.code,e.message),this.stop(),t}}})),this.getSessionId=()=>this.ingestSessionId,this.getConnectionState=()=>{if(!this.peerConnection)return Lr.NONE;const e=this.peerConnection.connectionState||this.peerConnection.iceConnectionState;switch(e){case"new":return Lr.NEW;case"closed":return Lr.CLOSED;case"disconnected":return Lr.DISCONNECTED;case"failed":return Lr.FAILED;case"idle":return Lr.IDLE;case"checking":case"connecting":return Lr.CONNECTING;case"completed":case"connected":return Lr.CONNECTED;default:return this.logger.warn({msg:"Unhandled connection state:",rawState:e}),Lr.IDLE}},this.onConnectionStateChange=()=>{var e;const t=this.getConnectionState();switch(this.emitter.emit(Fr.CONNECTION_STATE_CHANGE,t),t){case Lr.CONNECTED:{const t=new Date;this.analyticsTracker.trackEvent(new fr(t,this.connectionStartDate,this.ingestSessionId));const n=ei.get("audio"),r=ei.get("video");if(r){const e=r.getSettings();this.analyticsTracker.trackEvent(new Tr(e))}if(n){const e=n.getSettings();this.analyticsTracker.trackEvent(new Sr(e))}((null===(e=this.peerConnection)||void 0===e?void 0:e.getSenders())||[]).forEach((e=>{var t;((null===(t=e.getParameters())||void 0===t?void 0:t.codecs)||[]).forEach((t=>{var i;switch(null===(i=e.track)||void 0===i?void 0:i.kind){case"video":{if(!r)break;const e=(new ii).extractVideoSdpFmtpLine(t.sdpFmtpLine),n=r.getSettings();this.analyticsTracker.trackEvent(new Cr(n,e,t));break}case"audio":if(!n)break;this.analyticsTracker.trackEvent(new wr(t))}}))}));break}case Lr.CONNECTING:this.connectionStartDate=new Date;break;case Lr.FAILED:{const e=new Nn(On);this.handleError(e.code,e.message);break}}},this.handleLocalDescription=e=>ui(this,void 0,void 0,(function*(){var t;return null===(t=this.peerConnection)||void 0===t?void 0:t.setLocalDescription(e)})),si.set(this,(e=>{if("string"!=typeof e)throw new Nn(Mn);try{new URL(e)}catch(e){throw new Nn(In)}})),this.logger=new pr(r,Ln.WEBRTC)}start(e,t){return ui(this,void 0,void 0,(function*(){(function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)})(this,si,"f").call(this,e);const n=[ei.get("video"),ei.get("audio")].filter(di);this.createPeerConnection(),this.addTracks({tracks:n}),yield this.establishConnection(e,t)}))}stop(){var e,t,n;this.stateCheckInterval&&(clearInterval(this.stateCheckInterval),this.stateCheckInterval=void 0),this.stopStreamDataChannel&&"open"===this.stopStreamDataChannel.readyState&&this.stopStreamDataChannel.send(" "),[Lr.NEW,Lr.CONNECTING,Lr.CONNECTED].includes(this.getConnectionState())&&this.emitter.emit(Fr.CONNECTION_STATE_CHANGE,Lr.CLOSED),null===(e=this.peerConnection)||void 0===e||e.close(),null===(t=this.peerConnection)||void 0===t||t.removeEventListener("connectionstatechange",this.onConnectionStateChange),null===(n=this.peerConnection)||void 0===n||n.removeEventListener("iceconnectionstatechange",this.onConnectionStateChange),this.ingestSessionId=void 0}addTracks(e){var t;if(pi(this.peerConnection),!e)return;const n=this.peerConnection.getSenders().map((e=>{var t;return null===(t=e.track)||void 0===t?void 0:t.id})),r=e.tracks.filter((e=>!n.includes(e.id)));for(const e of r)null===(t=this.peerConnection)||void 0===t||t.addTrack(e)}getReports(){var e;return ui(this,void 0,void 0,(function*(){const t=(yield null===(e=this.peerConnection)||void 0===e?void 0:e.getStats())||[],n=[];for(const[,e]of t)n.push(e);return n}))}sendSetupRequest(e,t,n){var r;return ui(this,void 0,void 0,(function*(){const i=yield fetch(`${e}/offer`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Object.assign({offer:oi(n),streamKey:t},this.config.streamConfig))});if(!i.ok)throw function(e){let t=new Nn(Object.assign({},Rn));return 1007===(null==e?void 0:e.code)&&(t=new Nn(Object.assign({},Pn))),(null==e?void 0:e.message)&&(t.message=e.message),t}(yield i.json());const o=yield i.json();(null==o?void 0:o.answer)&&(yield null===(r=this.peerConnection)||void 0===r?void 0:r.setRemoteDescription(function(e){return JSON.parse(atob(e))}(o.answer)),this.ingestSessionId=o.ingestSessionId)}))}handleError(e,t){this.analyticsTracker.trackEvent(new mr({code:e,description:t,isFatal:!0})),this.emitter.emit(Fr.ERROR,{code:e,message:t})}createPeerConnection(){const e=this.getConnectionState(),t=e!==Lr.NONE,n=e!==Lr.CLOSED;t&&n||(this.stateCheckInterval&&(clearInterval(this.stateCheckInterval),this.stateCheckInterval=void 0),this.stateCheckInterval=window.setInterval((()=>{if(this.getConnectionState()===Lr.CLOSED){const e=new Nn(On);this.handleError(e.code,e.message),clearInterval(this.stateCheckInterval),this.stateCheckInterval=void 0}}),1e3),this.peerConnection=new RTCPeerConnection(li),this.stopStreamDataChannel=this.peerConnection.createDataChannel("stopStream"),this.peerConnection.addEventListener("connectionstatechange",this.onConnectionStateChange),this.peerConnection.addEventListener("iceconnectionstatechange",this.onConnectionStateChange))}};si=new WeakMap,fi=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}([Zt(),ci(0,tn(nn.CONFIG)),ci(1,tn(nn.ANALYTICS_TRACKER)),ci(2,tn(nn.EMITTER)),ci(3,tn(nn.LOGGER)),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Object,Object,Object,"function"==typeof(ai=void 0!==dr&&dr)?ai:Object])],fi);var hi=n(477),mi=n.n(hi);const vi=new $t({defaultScope:"Request"}),{lazyInject:gi}=(0,Yt.Z)(vi),yi=(e,t)=>{const n=e.container.get(nn.EMITTER);for(const[e,r]of Br.entries())for(const{instance:i,methodKey:o}of r)i.constructor.toString()===t.constructor.toString()&&n.on(e,t[o].bind(t));return t};class bi{static create(e){const t=(e=>{const t=vi.createChild(),n=new tr;return n.streamConfig=e.streamConfig,n.ingestEndpoint=e.ingestEndpoint,n.logger=e.logger,n.logLevel=e.logLevel,t.bind(nn.CONFIG).toConstantValue(n),t.bind(nn.EMITTER).toConstantValue(new ae),t})(e);return t.get(Kr)}static isSupported(){return"function"==typeof RTCPeerConnection}}vi.bind(Kr).toSelf().onActivation(yi),vi.bind(nn.SPADE_URL).toConstantValue("https://player.stats.live-video.net/"),vi.bind(nn.WORKER).toConstantValue(new function(){return mi()('/*! For license information please see amazon-ivs-web-broadcast.worker.js.LICENSE.txt */\n(()=>{"use strict";var t;!function(t){t.CONFIG="config",t.UPDATE="update",t.START="start",t.STOP="stop"}(t||(t={}));const i=self,s=new class{constructor(){this.config={frameRate:60,isRunning:!1}}setConfig(t){this.config=Object.assign(Object.assign({},this.config),t),this.config.isRunning&&(this.stop(),this.start())}start(){this.config.isRunning||(this.intervalId=setInterval((()=>{i.postMessage({type:t.UPDATE})}),1e3/this.config.frameRate),this.config.isRunning=!0)}stop(){this.config.isRunning&&(clearInterval(this.intervalId),this.intervalId=void 0,this.config.isRunning=!1)}};i.addEventListener("message",(function(i){var n;if(null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.type)switch(i.data.type){case t.CONFIG:s.setConfig(i.data.payload||{});break;case t.START:s.start();break;case t.STOP:s.stop()}}))})();',"Worker",void 0,void 0)}),vi.bind(nn.MEDIA_STREAM_MANAGER).to(ti).onActivation(yi),vi.bind(nn.PEER_STATS_TRACKER).to(Nr).onActivation(yi),vi.bind(nn.PEER_CLIENT).to(fi).onActivation(yi),vi.bind(nn.ANALYTICS_TRACKER).to(an).onActivation(yi),vi.bind(nn.LOGGER).to(dr).inSingletonScope(),bi.__version="1.0.0",bi.BroadcastClientEvents=Fr,bi.ConnectionState=Lr,bi.BASIC_LANDSCAPE=Yn,bi.BASIC_PORTRAIT=Qn,bi.STANDARD_LANDSCAPE=Zn,bi.STANDARD_PORTRAIT=Xn,bi.LOG_LEVEL=Fn,bi.Errors=s})(),r.default})()));
|
package/package.json
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "amazon-ivs-web-broadcast",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Amazon IVS Web Broadcast SDK",
|
|
5
|
+
"main": "dist/amazon-ivs-web-broadcast.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/amazon-ivs-web-broadcast.js"
|
|
8
|
+
],
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"homepage": "https://aws.amazon.com/ivs/",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://aws.amazon.com/contact-us/"
|
|
13
|
+
},
|
|
14
|
+
"author": {
|
|
15
|
+
"name": "Amazon Web Services",
|
|
16
|
+
"url": "https://aws.amazon.com/"
|
|
17
|
+
},
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=16"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "npm run build:types && npm run build:js",
|
|
23
|
+
"build:js": "npx webpack --config ./webpack.config.js",
|
|
24
|
+
"build:prod": "NODE_ENV=production npm run build",
|
|
25
|
+
"build:types": "npx tsc",
|
|
26
|
+
"build:examples": "NODE_ENV=production npx webpack --config ./examples/webpack.config.js",
|
|
27
|
+
"build:ci": "npm run build:prod && npm run build:examples",
|
|
28
|
+
"format": "npx prettier --config .prettierrc --ignore-path .prettierignore --write .",
|
|
29
|
+
"format:check": "npx prettier --config .prettierrc --ignore-path .prettierignore --check .",
|
|
30
|
+
"start": "npx npm-run-all --parallel start:*",
|
|
31
|
+
"start:types": "npx tsc --watch",
|
|
32
|
+
"start:js": "npx webpack --config ./webpack.config.js --watch",
|
|
33
|
+
"lint": "npx eslint ./src --ext .js,.jsx,.ts,.tsx,.json",
|
|
34
|
+
"test": "npx jest --runInBand --collect-coverage --config ./jest.config.js --forceExit",
|
|
35
|
+
"pretest:e2e": "npx rimraf ./tests-out && tsc --incremental -p e2e/tsconfig.json",
|
|
36
|
+
"test:e2e": "npx playwright test -c tests-out/e2e",
|
|
37
|
+
"typedoc": "npx typedoc --options ./typedoc.config.js",
|
|
38
|
+
"examples": "npx webpack serve --config ./examples/webpack.config.js",
|
|
39
|
+
"release": "release-it",
|
|
40
|
+
"bootstrap": "husky install",
|
|
41
|
+
"app": "npm run --prefix test-app/ start"
|
|
42
|
+
},
|
|
43
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@playwright/test": "^1.16.3",
|
|
46
|
+
"@release-it/bumper": "^3.0.1",
|
|
47
|
+
"@release-it/keep-a-changelog": "^2.3.0",
|
|
48
|
+
"@types/chai": "^4.2.22",
|
|
49
|
+
"@types/chai-as-promised": "^7.1.4",
|
|
50
|
+
"@types/jest": "^27.0.2",
|
|
51
|
+
"@types/lodash": "^4.14.181",
|
|
52
|
+
"@types/mocha": "^5.2.7",
|
|
53
|
+
"@types/node": "^16.11.9",
|
|
54
|
+
"@types/offscreencanvas": "^2019.6.4",
|
|
55
|
+
"@types/pixelmatch": "^5.2.4",
|
|
56
|
+
"@types/pngjs": "^6.0.1",
|
|
57
|
+
"@types/react-beautiful-dnd": "^13.1.2",
|
|
58
|
+
"@types/webrtc": "0.0.31",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^5.1.0",
|
|
60
|
+
"@typescript-eslint/parser": "^5.1.0",
|
|
61
|
+
"@webpack-cli/serve": "^1.6.0",
|
|
62
|
+
"babel-loader": "^8.1.0",
|
|
63
|
+
"clean-webpack-plugin": "^4.0.0",
|
|
64
|
+
"copy-webpack-plugin": "^6.4.1",
|
|
65
|
+
"eslint": "^8.3.0",
|
|
66
|
+
"eslint-config-prettier": "^8.3.0",
|
|
67
|
+
"eslint-plugin-header": "^3.1.1",
|
|
68
|
+
"eslint-plugin-import": "^2.25.2",
|
|
69
|
+
"eslint-plugin-jsdoc": "^37.6.1",
|
|
70
|
+
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
71
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
72
|
+
"fast-check": "^2.18.0",
|
|
73
|
+
"html-webpack-plugin": "^5.5.0",
|
|
74
|
+
"husky": "^7.0.4",
|
|
75
|
+
"jest": "^27.3.1",
|
|
76
|
+
"jest-canvas-mock": "^2.3.1",
|
|
77
|
+
"jest-fetch-mock": "^3.0.3",
|
|
78
|
+
"jest-junit": "^13.0.0",
|
|
79
|
+
"npm-run-all": "^4.1.5",
|
|
80
|
+
"pixelmatch": "^5.2.1",
|
|
81
|
+
"playwright": "^1.16.3",
|
|
82
|
+
"pngjs": "^6.0.0",
|
|
83
|
+
"prettier": "^2.1.2",
|
|
84
|
+
"release-it": "^14.12.5",
|
|
85
|
+
"rimraf": "^3.0.2",
|
|
86
|
+
"serve-handler": "^6.1.3",
|
|
87
|
+
"standardized-audio-context-mock": "^9.0.0",
|
|
88
|
+
"ts-jest": "^27.0.7",
|
|
89
|
+
"ts-loader": "^8.3.0",
|
|
90
|
+
"typedoc": "^0.22.15",
|
|
91
|
+
"typedoc-plugin-mdn-links": "^1.0.4",
|
|
92
|
+
"typedoc-plugin-missing-exports": "^0.22.6",
|
|
93
|
+
"typescript": "^4.6.2",
|
|
94
|
+
"uuid": "^8.3.2",
|
|
95
|
+
"webpack": "^5.73.0",
|
|
96
|
+
"webpack-cli": "^4.10.0",
|
|
97
|
+
"webpack-dev-server": "^4.9.2",
|
|
98
|
+
"webpack-merge": "^5.8.0",
|
|
99
|
+
"worker-loader": "^3.0.8",
|
|
100
|
+
"wrtc": "^0.4.7"
|
|
101
|
+
},
|
|
102
|
+
"dependencies": {
|
|
103
|
+
"bowser": "^2.11.0",
|
|
104
|
+
"eventemitter3": "^4.0.7",
|
|
105
|
+
"inversify": "^6.0.1",
|
|
106
|
+
"inversify-inject-decorators": "^3.1.0",
|
|
107
|
+
"lodash": "^4.5.0",
|
|
108
|
+
"reflect-metadata": "^0.1.13",
|
|
109
|
+
"webrtc-adapter": "^8.1.1"
|
|
110
|
+
}
|
|
111
|
+
}
|