@antglobal/rlog-sdk 0.0.0 → 0.0.1755855517-dev.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/README.md +369 -2
- package/dist/rlog-sdk.min.js +1 -0
- package/package.json +25 -6
- package/LEGAL.md +0 -7
package/README.md
CHANGED
|
@@ -1,3 +1,370 @@
|
|
|
1
|
-
|
|
1
|
+
# rlog-sdk 性能与安全设计文档
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 动态配置功能
|
|
4
|
+
|
|
5
|
+
### 1. CDN 配置支持
|
|
6
|
+
SDK 现在支持从 CDN 获取动态配置,可以实时调整以下参数:
|
|
7
|
+
- 采集总开关
|
|
8
|
+
- Canvas 录制采样率
|
|
9
|
+
- 数据上传时间间隔
|
|
10
|
+
|
|
11
|
+
### 2. 配置参数说明
|
|
12
|
+
CDN 配置文件应为 JSON 格式,包含以下字段:
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"enable": true, // 采集总开关
|
|
16
|
+
"samplingRate": 15, // Canvas 采样率 (帧/秒)
|
|
17
|
+
"uploadInterval": 2000, // 数据上传时间间隔 (毫秒)
|
|
18
|
+
"configUpdateInterval": 300000 // 配置更新时间间隔 (毫秒),默认 5 分钟
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### 3. 使用方式
|
|
23
|
+
```javascript
|
|
24
|
+
// 初始化时传入 CDN 配置 URL
|
|
25
|
+
Rlog.init({
|
|
26
|
+
appId: 'your-app-id',
|
|
27
|
+
serv: 'your-upload-server',
|
|
28
|
+
cdnConfigUrl: 'https://your-cdn.com/rlog-config.json'
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 请求头注入功能
|
|
33
|
+
|
|
34
|
+
### 1. 功能说明
|
|
35
|
+
SDK 支持在所有 XMLHttpRequest 和 fetch 请求中自动注入全局自定义请求头,方便添加认证信息、跟踪标识等。
|
|
36
|
+
|
|
37
|
+
### 2. 使用方式
|
|
38
|
+
```javascript
|
|
39
|
+
// 设置全局自定义请求头
|
|
40
|
+
Rlog.setCustomHeaders({
|
|
41
|
+
'Authorization': 'Bearer your-token',
|
|
42
|
+
'X-Request-Id': 'unique-request-id',
|
|
43
|
+
'X-Client-Version': '1.0.0'
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// 设置白名单URL(只有这些URL的请求会被监控和注入请求头)
|
|
47
|
+
Rlog.setWhiteListUrls([
|
|
48
|
+
'https://api.your-app.com',
|
|
49
|
+
'https://analytics.your-app.com'
|
|
50
|
+
]);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 3. 实现原理
|
|
54
|
+
- 拦截 XMLHttpRequest 和 fetch API
|
|
55
|
+
- 在发送请求前自动添加自定义请求头
|
|
56
|
+
- 只对白名单中的 URL 注入请求头
|
|
57
|
+
- 监控请求结果并记录成功/失败事件
|
|
58
|
+
|
|
59
|
+
## 代码结构优化
|
|
60
|
+
|
|
61
|
+
### 1. 入口文件精简
|
|
62
|
+
入口文件 [`src/index.ts`](src/index.ts) 已经优化得更加精简,只包含必要的导入和导出:
|
|
63
|
+
- 导入核心初始化函数
|
|
64
|
+
- 导出初始化接口
|
|
65
|
+
- 导出自定义事件接口
|
|
66
|
+
|
|
67
|
+
### 2. 模块化设计
|
|
68
|
+
项目现在采用更好的模块化设计:
|
|
69
|
+
- [`src/lib/init.ts`](src/lib/init.ts): 初始化逻辑
|
|
70
|
+
- [`src/lib/uploader.ts`](src/lib/uploader.ts): 数据上传逻辑
|
|
71
|
+
- [`src/lib/request.ts`](src/lib/request.ts): 网络请求工具
|
|
72
|
+
- [`src/lib/config.ts`](src/lib/config.ts): 配置管理
|
|
73
|
+
- [`src/lib/rrweb.ts`](src/lib/rrweb.ts): 录制功能
|
|
74
|
+
- [`src/lib/api.ts`](src/lib/api.ts): API 接口
|
|
75
|
+
- [`src/lib/storage-manager.ts`](src/lib/storage-manager.ts): 存储管理
|
|
76
|
+
- [`src/lib/net.ts`](src/lib/net.ts): 网络监控
|
|
77
|
+
- [`src/lib/utils.ts`](src/lib/utils.ts): 工具函数
|
|
78
|
+
|
|
79
|
+
## 请求工具
|
|
80
|
+
|
|
81
|
+
### 1. 工具说明
|
|
82
|
+
项目中封装了兼容性更好的请求工具 [`src/lib/request.ts`](src/lib/request.ts),提供以下功能:
|
|
83
|
+
- 兼容性更好的 HTTP 请求(基于 XMLHttpRequest)
|
|
84
|
+
- 支持 GET/POST 方法
|
|
85
|
+
- 支持超时设置
|
|
86
|
+
- 统一的错误处理
|
|
87
|
+
|
|
88
|
+
### 2. 使用方式
|
|
89
|
+
```typescript
|
|
90
|
+
import { get, post, request } from './lib/request';
|
|
91
|
+
|
|
92
|
+
// GET 请求
|
|
93
|
+
const response = await get('https://api.example.com/data');
|
|
94
|
+
|
|
95
|
+
// POST 请求
|
|
96
|
+
const response = await post('https://api.example.com/data', { key: 'value' });
|
|
97
|
+
|
|
98
|
+
// 自定义请求
|
|
99
|
+
const response = await request('https://api.example.com/data', {
|
|
100
|
+
method: 'POST',
|
|
101
|
+
headers: { 'Content-Type': 'application/json' },
|
|
102
|
+
body: JSON.stringify({ key: 'value' }),
|
|
103
|
+
timeout: 5000
|
|
104
|
+
});
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## 性能优化方案
|
|
108
|
+
|
|
109
|
+
### 1. Canvas录制动态采样
|
|
110
|
+
**自适应采样算法**:
|
|
111
|
+
```ts
|
|
112
|
+
class SamplingController {
|
|
113
|
+
// 设备性能评估
|
|
114
|
+
static getSamplingRate(): number {
|
|
115
|
+
const isMobile = /Mobi/.test(navigator.userAgent);
|
|
116
|
+
const deviceMemory = (navigator as any).deviceMemory || 4;
|
|
117
|
+
|
|
118
|
+
// 动态计算采样率:
|
|
119
|
+
// 1. 根据设备类型选择基准值
|
|
120
|
+
// 2. 根据内存大小动态调整(4GB基准,每增加1GB降低1帧)
|
|
121
|
+
// 3. 最低不低于5帧保证录制可用性
|
|
122
|
+
const baseRate = isMobile ? 8 : 15;
|
|
123
|
+
const memoryFactor = Math.max(0, 4 - (deviceMemory - 4));
|
|
124
|
+
|
|
125
|
+
return Math.max(5, baseRate - memoryFactor);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// 实时性能监控(每5秒检测一次)
|
|
129
|
+
static startPerformanceMonitor() {
|
|
130
|
+
setInterval(() => {
|
|
131
|
+
const fps = this.calculateFPS();
|
|
132
|
+
if (fps < 15) { // 低性能预警
|
|
133
|
+
this.throttleRecording();
|
|
134
|
+
} else if (fps > 25) { // 高性能提升
|
|
135
|
+
this.boostSampling();
|
|
136
|
+
}
|
|
137
|
+
}, 5000);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// 在rrweb初始化时应用
|
|
142
|
+
rrweb.record({
|
|
143
|
+
sampling: {
|
|
144
|
+
canvas: SamplingController.getSamplingRate()
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**性能指标**:
|
|
150
|
+
| 指标 | 目标值 | 监控方式 |
|
|
151
|
+
|------|-------|---------|
|
|
152
|
+
| FPS | ≥15 | requestAnimationFrame |
|
|
153
|
+
| 内存占用 | ≤15MB | performance.memory |
|
|
154
|
+
| CPU使用率 | ≤30% | navigator.hardwareConcurrency |
|
|
155
|
+
|
|
156
|
+
### 2. 存储性能优化
|
|
157
|
+
**批量写入策略**:
|
|
158
|
+
```ts
|
|
159
|
+
// IndexedDBAdapter增强
|
|
160
|
+
async push(deviceId: string, data: any): Promise<void> {
|
|
161
|
+
// 实现批量缓冲
|
|
162
|
+
if (!this.writeBuffer) {
|
|
163
|
+
this.writeBuffer = [];
|
|
164
|
+
// 500ms批量提交
|
|
165
|
+
setTimeout(() => this.flushBuffer(), 500);
|
|
166
|
+
}
|
|
167
|
+
this.writeBuffer.push({ deviceId, data });
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
private async flushBuffer(): Promise<void> {
|
|
171
|
+
if (!this.db || !this.writeBuffer) return;
|
|
172
|
+
|
|
173
|
+
const transaction = this.db.transaction(STORE_NAME, 'readwrite');
|
|
174
|
+
const store = transaction.objectStore(STORE_NAME);
|
|
175
|
+
|
|
176
|
+
// 使用游标批量更新
|
|
177
|
+
const cursor = await store.openCursor();
|
|
178
|
+
while (cursor) {
|
|
179
|
+
const updated = this.writeBuffer.find(
|
|
180
|
+
item => item.deviceId === cursor.key
|
|
181
|
+
);
|
|
182
|
+
if (updated) {
|
|
183
|
+
await cursor.update({
|
|
184
|
+
...cursor.value,
|
|
185
|
+
data: [...cursor.value.data, ...updated.data]
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
await cursor.continue();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
this.writeBuffer = null;
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## 加密模块设计
|
|
196
|
+
|
|
197
|
+
### 1. 加密架构设计
|
|
198
|
+
```mermaid
|
|
199
|
+
sequenceDiagram
|
|
200
|
+
participant SDK
|
|
201
|
+
participant Crypto
|
|
202
|
+
participant Storage
|
|
203
|
+
|
|
204
|
+
SDK->>Crypto: setEncryptionKey() 设置密钥
|
|
205
|
+
SDK->>Crypto: encryptData() 请求加密
|
|
206
|
+
Crypto->>Crypto: 生成IV (12字节)
|
|
207
|
+
Crypto->>Crypto: 使用AES-GCM加密
|
|
208
|
+
Crypto-->>SDK: 返回Base64加密数据
|
|
209
|
+
SDK->>Storage: 存储加密数据
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### 2. 加密实现细节
|
|
213
|
+
```ts
|
|
214
|
+
// 加密配置接口
|
|
215
|
+
interface EncryptionConfig {
|
|
216
|
+
enabled: boolean; // 加密开关
|
|
217
|
+
algorithm: 'AES-GCM' | 'AES-CBC'; // 算法选择
|
|
218
|
+
keyLength: 128 | 192 | 256; // 密钥长度
|
|
219
|
+
autoRotate: boolean; // 密钥自动轮换
|
|
220
|
+
rotationInterval: number; // 轮换间隔(小时)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// 加密服务实现
|
|
224
|
+
class EncryptionService {
|
|
225
|
+
private key: CryptoKey | null = null;
|
|
226
|
+
private config: EncryptionConfig = {
|
|
227
|
+
enabled: false,
|
|
228
|
+
algorithm: 'AES-GCM',
|
|
229
|
+
keyLength: 256,
|
|
230
|
+
autoRotate: true,
|
|
231
|
+
rotationInterval: 24
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
async setKey(key: CryptoKey): Promise<void> {
|
|
235
|
+
this.key = key;
|
|
236
|
+
if (this.config.autoRotate) {
|
|
237
|
+
this.scheduleKeyRotation();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
async encrypt(data: any): Promise<string> {
|
|
242
|
+
if (!this.config.enabled || !this.key) {
|
|
243
|
+
return JSON.stringify(data);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const iv = crypto.getRandomValues(new Uint8Array(12));
|
|
247
|
+
const encoder = new TextEncoder();
|
|
248
|
+
const encrypted = await crypto.subtle.encrypt(
|
|
249
|
+
{
|
|
250
|
+
name: this.config.algorithm,
|
|
251
|
+
iv
|
|
252
|
+
},
|
|
253
|
+
this.key,
|
|
254
|
+
encoder.encode(JSON.stringify(data))
|
|
255
|
+
);
|
|
256
|
+
|
|
257
|
+
// 返回包含元数据的加密数据
|
|
258
|
+
return JSON.stringify({
|
|
259
|
+
v: 1, // 版本号
|
|
260
|
+
alg: this.config.algorithm,
|
|
261
|
+
iv: arrayBufferToBase64(iv),
|
|
262
|
+
data: arrayBufferToBase64(encrypted)
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
private scheduleKeyRotation(): void {
|
|
267
|
+
setInterval(async () => {
|
|
268
|
+
const newKey = await this.generateKey();
|
|
269
|
+
await this.rotateKey(newKey);
|
|
270
|
+
}, this.config.rotationInterval * 3600000);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### 3. 敏感数据脱敏
|
|
276
|
+
```ts
|
|
277
|
+
// 脱敏配置
|
|
278
|
+
interface SanitizationRule {
|
|
279
|
+
selector: string; // CSS选择器
|
|
280
|
+
type: 'mask' | 'hash' | 'remove'; // 脱敏类型
|
|
281
|
+
hashAlgorithm?: 'SHA-1' | 'SHA-256'; // 哈希算法
|
|
282
|
+
maskChar?: string; // 掩码字符
|
|
283
|
+
maskLength?: number; // 掩码长度
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// 脱敏处理器
|
|
287
|
+
class DataSanitizer {
|
|
288
|
+
private rules: SanitizationRule[] = [
|
|
289
|
+
{
|
|
290
|
+
selector: 'input[type="password"]',
|
|
291
|
+
type: 'mask',
|
|
292
|
+
maskChar: '*',
|
|
293
|
+
maskLength: 8
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
selector: 'input[name="credit-card"]',
|
|
297
|
+
type: 'hash',
|
|
298
|
+
hashAlgorithm: 'SHA-256'
|
|
299
|
+
}
|
|
300
|
+
];
|
|
301
|
+
|
|
302
|
+
sanitize(data: any): any {
|
|
303
|
+
const result = { ...data };
|
|
304
|
+
|
|
305
|
+
// 遍历DOM节点应用脱敏规则
|
|
306
|
+
document.querySelectorAll('*').forEach(node => {
|
|
307
|
+
const element = node as HTMLElement;
|
|
308
|
+
this.rules.forEach(rule => {
|
|
309
|
+
if (element.matches(rule.selector)) {
|
|
310
|
+
switch (rule.type) {
|
|
311
|
+
case 'mask':
|
|
312
|
+
result.textContent = this.applyMask(
|
|
313
|
+
element.textContent || '',
|
|
314
|
+
rule.maskChar || '*',
|
|
315
|
+
rule.maskLength || 8
|
|
316
|
+
);
|
|
317
|
+
break;
|
|
318
|
+
case 'hash':
|
|
319
|
+
result.textContent = this.hashContent(
|
|
320
|
+
element.textContent || '',
|
|
321
|
+
rule.hashAlgorithm || 'SHA-256'
|
|
322
|
+
);
|
|
323
|
+
break;
|
|
324
|
+
case 'remove':
|
|
325
|
+
result.remove();
|
|
326
|
+
break;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
return result;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## 改进建议实施状态
|
|
338
|
+
| 改进项 | 实施状态 | 完成度 |
|
|
339
|
+
|-------|----------|--------|
|
|
340
|
+
| IndexedDB降级修复 | 已完成 | 100% |
|
|
341
|
+
| 动态采样率调整 | 已完成 | 100% |
|
|
342
|
+
| 数据加密模块 | 设计完成 | 100% |
|
|
343
|
+
| 上传重试机制 | 未开始 | 0% |
|
|
344
|
+
| 移动端触控增强 | 未开始 | 0% |
|
|
345
|
+
|
|
346
|
+
## 错误处理优化
|
|
347
|
+
|
|
348
|
+
### 1. 功能说明
|
|
349
|
+
SDK 现在支持更全面的错误监控,包括:
|
|
350
|
+
- JavaScript 运行时错误
|
|
351
|
+
- 未处理的 Promise 错误
|
|
352
|
+
- 资源加载失败(图片、CSS、JS等)
|
|
353
|
+
- 网络连接状态变化
|
|
354
|
+
- 页面加载和卸载事件
|
|
355
|
+
- 用户交互事件
|
|
356
|
+
|
|
357
|
+
### 2. 实现原理
|
|
358
|
+
- 使用 `window.addEventListener` 监听各种错误事件
|
|
359
|
+
- 区分 JavaScript 错误和资源加载错误
|
|
360
|
+
- 收集详细的错误信息,包括堆栈跟踪
|
|
361
|
+
- 发送错误数据到分析系统
|
|
362
|
+
|
|
363
|
+
### 3. 错误类型
|
|
364
|
+
- `JS_ERROR`: JavaScript 运行时错误
|
|
365
|
+
- `PROMISE_REJECTION`: 未处理的 Promise 错误
|
|
366
|
+
- `RESOURCE_LOAD_ERROR`: 资源加载失败
|
|
367
|
+
- `NETWORK_ONLINE`: 网络连接恢复
|
|
368
|
+
- `NETWORK_OFFLINE`: 网络连接断开
|
|
369
|
+
- `PAGE_LOAD`: 页面加载完成
|
|
370
|
+
- `PAGE_UNLOAD`: 页面即将卸载
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Rlog=e():t.Rlog=e()}(self,(function(){return function(){var t={738:function(t,e){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=u(t),a=i[0],s=i[1],c=new o(function(t,e,r){return 3*(e+r)/4-r}(0,a,s)),l=0,d=s>0?a-4:a;for(r=0;r<d;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[l++]=e>>16&255,c[l++]=e>>8&255,c[l++]=255&e;2===s&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[l++]=255&e);1===s&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[l++]=e>>8&255,c[l++]=255&e);return c},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],a=16383,s=0,u=n-o;s<u;s+=a)i.push(c(t,s,s+a>u?u:s+a));1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a<s;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var o,i,a=[],s=e;s<n;s+=3)o=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},579:function(t,e,r){"use strict";var n=r(738),o=r(55),i=r(937);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return d(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=f(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(e,r);t=s(t,n);var o=t.write(e,r);o!==n&&(t=t.slice(0,o));return t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|p(e.length);return 0===(t=s(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?s(t,0):f(t,e);if("Buffer"===e.type&&i(e.data))return f(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function d(t,e){if(l(e),t=s(t,e<0?0:0|p(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function f(t,e){var r=e.length<0?0:0|p(e.length);t=s(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function h(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(n)return G(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return M(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,o);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,o){var i,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var l=-1;for(i=r;i<s;i++)if(c(t,i)===c(e,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){for(var d=!0,f=0;f<u;f++)if(c(t,i+f)!==c(e,f)){d=!1;break}if(d)return i}return-1}function I(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[r+a]=s}return a}function C(t,e,r,n){return V(G(e,t.length-r),t,r,n)}function b(t,e,r,n){return V(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function S(t,e,r,n){return b(t,e,r,n)}function w(t,e,r,n){return V(Z(e),t,r,n)}function A(t,e,r,n){return V(function(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function k(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,s,u,c=t[o],l=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=r)switch(d){case 1:c<128&&(l=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,d=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=d}return function(t){var e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=T));return r}(n)}e.lW=u,e.h2=50,u.TYPED_ARRAY_SUPPORT=void 0!==r.g.TYPED_ARRAY_SUPPORT?r.g.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),a(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return c(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return function(t,e,r,n){return l(e),e<=0?s(t,e):void 0!==r?"string"==typeof n?s(t,e).fill(r,n):s(t,e).fill(r):s(t,e)}(null,t,e,r)},u.allocUnsafe=function(t){return d(null,t)},u.allocUnsafeSlow=function(t){return d(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},u.byteLength=h,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?x(this,0,t):g.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.h2;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,o){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(i,a),c=this.slice(n,o),l=t.slice(e,r),d=0;d<s;++d)if(c[d]!==l[d]){i=c[d],a=l[d];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return v(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return v(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return I(this,t,e,r);case"utf8":case"utf-8":return C(this,t,e,r);case"ascii":return b(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function M(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function R(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=P(t[i]);return o}function O(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function N(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function F(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function _(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function D(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(t,e,r,n,i){return i||D(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,i){return i||D(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var o=e-t;r=new u(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUInt8=function(t,e){return e||N(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||N(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||N(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||N(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||N(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||N(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||N(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||N(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||N(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):F(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):F(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):_(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):_(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);L(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);L(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):F(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):F(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):_(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):_(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return B(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return B(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=u.isBuffer(t)?t:G(new u(t,n).toString()),s=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%s]}return this};var W=/[^+\/0-9A-Za-z-_]/g;function P(t){return t<16?"0"+t.toString(16):t.toString(16)}function G(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function Z(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}},55:function(t,e){e.read=function(t,e,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,d=r?o-1:0,f=r?-1:1,p=t[e+d];for(d+=f,i=p&(1<<-l)-1,p>>=-l,l+=s;l>0;i=256*i+t[e+d],d+=f,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+t[e+d],d+=f,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=c}return(p?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,d=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,h=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+d>=1?f/u:f*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(e*u-1)*Math.pow(2,o),a+=d):(s=e*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;t[r+p]=255&s,p+=h,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;t[r+p]=255&a,p+=h,a/=256,c-=8);t[r+p-h]|=128*g}},937:function(t){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},256:function(t){var e,r,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(t){r=i}}();var s,u=[],c=!1,l=-1;function d(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&f())}function f(){if(!c){var t=a(d);c=!0;for(var e=u.length;e;){for(s=u,u=[];++l<e;)s&&s[l].run();l=-1,e=u.length}s=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function h(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new p(t,e)),1!==u.length||c||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=h,n.addListener=h,n.once=h,n.off=h,n.removeListener=h,n.removeAllListeners=h,n.emit=h,n.prependListener=h,n.prependOnceListener=h,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},933:function(t){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.__esModule=!0,t.exports.default=t.exports},956:function(t){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},894:function(t,e,r){var n=r(933);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.__esModule=!0,t.exports.default=t.exports},915:function(t){function e(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=t.apply(r,n);function s(t){e(a,o,i,s,u,"next",t)}function u(t){e(a,o,i,s,u,"throw",t)}s(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},165:function(t){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},534:function(t,e,r){var n=r(36);function o(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}t.exports=function(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},903:function(t,e,r){var n=r(931);t.exports=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=n(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}},t.exports.__esModule=!0,t.exports.default=t.exports},150:function(t,e,r){var n=r(36);t.exports=function(t,e,r){return(e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.__esModule=!0,t.exports.default=t.exports},749:function(t){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},955:function(t){t.exports=function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}},t.exports.__esModule=!0,t.exports.default=t.exports},17:function(t){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},545:function(t){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},378:function(t,e,r){var n=r(150);function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}t.exports=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t},t.exports.__esModule=!0,t.exports.default=t.exports},177:function(t,e,r){var n=r(775).default;function o(){"use strict";t.exports=o=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var e,r={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",d=u.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(e){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof I?e:I,i=Object.create(o.prototype),a=new N(n||[]);return s(i,"_invoke",{value:E(t,r,a)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var g="suspendedStart",m="executing",v="completed",y={};function I(){}function C(){}function b(){}var S={};f(S,c,(function(){return this}));var w=Object.getPrototypeOf,A=w&&w(w(L([])));A&&A!==i&&a.call(A,c)&&(S=A);var k=b.prototype=I.prototype=Object.create(S);function x(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(o,i,s,u){var c=h(t[o],t,i);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==n(d)&&a.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):e.resolve(d).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,u)}))}u(c.arg)}var o;s(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function E(t,r,n){var o=g;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=M(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===g)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=h(t,r,n);if("normal"===c.type){if(o=n.done?v:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function M(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,M(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=h(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return C.prototype=b,s(k,"constructor",{value:b,configurable:!0}),s(b,"constructor",{value:C,configurable:!0}),C.displayName=f(b,d,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===C||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,f(t,d,"GeneratorFunction")),t.prototype=Object.create(k),t},r.awrap=function(t){return{__await:t}},x(T.prototype),f(T.prototype,l,(function(){return this})),r.AsyncIterator=T,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new T(p(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(k),f(k,d,"Generator"),f(k,c,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=L,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},r}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},377:function(t,e,r){var n=r(956),o=r(955),i=r(931),a=r(17);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},958:function(t,e,r){var n=r(894),o=r(749),i=r(931),a=r(545);t.exports=function(t){return n(t)||o(t)||i(t)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},24:function(t,e,r){var n=r(775).default;t.exports=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},36:function(t,e,r){var n=r(775).default,o=r(24);t.exports=function(t){var e=o(t,"string");return"symbol"==n(e)?e:String(e)},t.exports.__esModule=!0,t.exports.default=t.exports},775:function(t){function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},931:function(t,e,r){var n=r(933);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return function(){"use strict";r.r(n),r.d(n,{addCustomEvent:function(){return pr},init:function(){return dr},setCustomHeaders:function(){return Ke},setWhiteListUrls:function(){return Ye},stop:function(){return fr}});var t,e=r(903),o=r(775),i=r.n(o);function a(t){return t.nodeType===t.ELEMENT_NODE}function s(t){var e=null==t?void 0:t.host;return Boolean((null==e?void 0:e.shadowRoot)===t)}function u(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function c(t){try{var e=t.rules||t.cssRules;return e?((r=Array.from(e).map(l).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(t){return null}var r}function l(t){var e=t.cssText;if(function(t){return"styleSheet"in t}(t))try{e=c(t.styleSheet)||e}catch(t){}return e}!function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"}(t||(t={}));var d=function(){function t(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return t.prototype.getId=function(t){var e;if(!t)return-1;var r=null===(e=this.getMeta(t))||void 0===e?void 0:e.id;return null!=r?r:-1},t.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},t.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},t.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},t.prototype.removeNodeFromMap=function(t){var e=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach((function(t){return e.removeNodeFromMap(t)}))},t.prototype.has=function(t){return this.idNodeMap.has(t)},t.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},t.prototype.add=function(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)},t.prototype.replace=function(t,e){var r=this.getNode(t);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(e,n)}this.idNodeMap.set(t,e)},t.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},t}();function f(t){var e=t.maskInputOptions,r=t.tagName,n=t.type,o=t.value,i=t.maskInputFn,a=o||"";return(e[r.toLowerCase()]||e[n])&&(a=i?i(a):"*".repeat(a.length)),a}var p="__rrweb_original__";var h,g,m=1,v=new RegExp("[^a-z0-9-_:]");function y(){return m++}var I=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,C=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,b=/^(data:)([^,]*),(.*)/i;function S(t,e){return(t||"").replace(I,(function(t,r,n,o,i,a){var s,u=n||i||a,c=r||o||"";if(!u)return t;if(!C.test(u))return"url(".concat(c).concat(u).concat(c,")");if(b.test(u))return"url(".concat(c).concat(u).concat(c,")");if("/"===u[0])return"url(".concat(c).concat((s=e,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)).concat(c,")");var l=e.split("/"),d=u.split("/");l.pop();for(var f=0,p=d;f<p.length;f++){var h=p[f];"."!==h&&(".."===h?l.pop():l.push(h))}return"url(".concat(c).concat(l.join("/")).concat(c,")")}))}var w=/^[^ \t\n\r\u000c]+/,A=/^[, \t\n\r\u000c]+/;function k(t,e){if(!e||""===e.trim())return e;var r=t.createElement("a");return r.href=e,r.href}function x(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function T(){var t=document.createElement("a");return t.href="",t.href}function E(t,e,r,n){return"src"===r||"href"===r&&n&&("use"!==e||"#"!==n[0])||"xlink:href"===r&&n&&"#"!==n[0]?k(t,n):"background"!==r||!n||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r&&n?function(t,e){if(""===e.trim())return e;var r=0;function n(t){var n,o=t.exec(e.substring(r));return o?(n=o[0],r+=n.length,n):""}for(var o=[];n(A),!(r>=e.length);){var i=n(w);if(","===i.slice(-1))i=k(t,i.substring(0,i.length-1)),o.push(i);else{var a="";i=k(t,i);for(var s=!1;;){var u=e.charAt(r);if(""===u){o.push((i+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,o.push((i+a).trim());break}"("===u&&(s=!0)}a+=u,r+=1}}}return o.join(", ")}(t,n):"style"===r&&n?S(n,T()):"object"===e&&"data"===r&&n?k(t,n):n:k(t,n)}function M(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&M(t.parentNode,e,r);for(var n=t.classList.length;n--;){var o=t.classList[n];if(e.test(o))return!0}return!!r&&M(t.parentNode,e,r)}function R(t,e,r){var n=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(null===n)return!1;if("string"==typeof e){if(n.classList.contains(e))return!0;if(n.closest(".".concat(e)))return!0}else if(M(n,e,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}return!1}function O(e,r){var n=r.doc,o=r.mirror,i=r.blockClass,a=r.blockSelector,s=r.maskTextClass,u=r.maskTextSelector,l=r.inlineStylesheet,d=r.maskInputOptions,m=void 0===d?{}:d,y=r.maskTextFn,I=r.maskInputFn,C=r.dataURLOptions,b=void 0===C?{}:C,w=r.inlineImages,A=r.recordCanvas,k=r.keepIframeSrcFn,M=r.newlyAddedElement,O=void 0!==M&&M,N=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(n,o);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:t.Document,childNodes:[],compatMode:e.compatMode}:{type:t.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:N};case e.ELEMENT_NODE:return function(e,r){for(var n=r.doc,o=r.blockClass,i=r.blockSelector,a=r.inlineStylesheet,s=r.maskInputOptions,u=void 0===s?{}:s,l=r.maskInputFn,d=r.dataURLOptions,m=void 0===d?{}:d,y=r.inlineImages,I=r.recordCanvas,C=r.keepIframeSrcFn,b=r.newlyAddedElement,w=void 0!==b&&b,A=r.rootId,k=function(t,e,r){if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var n=t.classList.length;n--;){var o=t.classList[n];if(e.test(o))return!0}return!!r&&t.matches(r)}(e,o,i),M=function(t){if(t instanceof HTMLFormElement)return"form";var e=t.tagName.toLowerCase().trim();return v.test(e)?"div":e}(e),R={},O=e.attributes.length,N=0;N<O;N++){var L=e.attributes[N];R[L.name]=E(n,M,L.name,L.value)}if("link"===M&&a){var F=Array.from(n.styleSheets).find((function(t){return t.href===e.href})),_=null;F&&(_=c(F)),_&&(delete R.rel,delete R.href,R._cssText=S(_,F.href))}if("style"===M&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(_=c(e.sheet))&&(R._cssText=S(_,T()))}if("input"===M||"textarea"===M||"select"===M){var D=e.value,B=e.checked;"radio"!==R.type&&"checkbox"!==R.type&&"submit"!==R.type&&"button"!==R.type&&D?R.value=f({type:R.type,tagName:M,value:D,maskInputOptions:u,maskInputFn:l}):B&&(R.checked=B)}"option"===M&&(e.selected&&!u.select?R.selected=!0:delete R.selected);if("canvas"===M&&I)if("2d"===e.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;r<t.width;r+=50)for(var n=0;n<t.height;n+=50){var o=e.getImageData,i=p in o?o[p]:o;if(new Uint32Array(i.call(e,r,n,Math.min(50,t.width-r),Math.min(50,t.height-n)).data.buffer).some((function(t){return 0!==t})))return!1}return!0})(e)||(R.rr_dataURL=e.toDataURL(m.type,m.quality));else if(!("__context"in e)){var U=e.toDataURL(m.type,m.quality),W=document.createElement("canvas");W.width=e.width,W.height=e.height,U!==W.toDataURL(m.type,m.quality)&&(R.rr_dataURL=U)}if("img"===M&&y){h||(h=n.createElement("canvas"),g=h.getContext("2d"));var P=e,G=P.crossOrigin;P.crossOrigin="anonymous";var Z=function(){try{h.width=P.naturalWidth,h.height=P.naturalHeight,g.drawImage(P,0,0),R.rr_dataURL=h.toDataURL(m.type,m.quality)}catch(t){console.warn("Cannot inline img src=".concat(P.currentSrc,"! Error: ").concat(t))}G?R.crossOrigin=G:P.removeAttribute("crossorigin")};P.complete&&0!==P.naturalWidth?Z():P.onload=Z}"audio"!==M&&"video"!==M||(R.rr_mediaState=e.paused?"paused":"played",R.rr_mediaCurrentTime=e.currentTime);w||(e.scrollLeft&&(R.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(R.rr_scrollTop=e.scrollTop));if(k){var V=e.getBoundingClientRect(),Y=V.width,K=V.height;R={class:R.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(K,"px")}}"iframe"!==M||C(R.src)||(e.contentDocument||(R.rr_src=R.src),delete R.src);return{type:t.Element,tagName:M,attributes:R,childNodes:[],isSVG:x(e)||void 0,needBlock:k,rootId:A}}(e,{doc:n,blockClass:i,blockSelector:a,inlineStylesheet:l,maskInputOptions:m,maskInputFn:I,dataURLOptions:b,inlineImages:w,recordCanvas:A,keepIframeSrcFn:k,newlyAddedElement:O,rootId:N});case e.TEXT_NODE:return function(e,r){var n,o=r.maskTextClass,i=r.maskTextSelector,a=r.maskTextFn,s=r.rootId,u=e.parentNode&&e.parentNode.tagName,c=e.textContent,l="STYLE"===u||void 0,d="SCRIPT"===u||void 0;if(l&&c){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(c=(f=e.parentNode.sheet).cssRules?Array.from(f.cssRules).map((function(t){return t.cssText||""})).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}c=S(c,T())}var f;d&&(c="SCRIPT_PLACEHOLDER");!l&&!d&&c&&R(e,o,i)&&(c=a?a(c):c.replace(/[\S]/g,"*"));return{type:t.Text,textContent:c||"",isStyle:l,rootId:s}}(e,{maskTextClass:s,maskTextSelector:u,maskTextFn:y,rootId:N});case e.CDATA_SECTION_NODE:return{type:t.CDATA,textContent:"",rootId:N};case e.COMMENT_NODE:return{type:t.Comment,textContent:e.textContent||"",rootId:N};default:return!1}}function N(t){return void 0===t?"":t.toLowerCase()}function L(e,r){var n,o=r.doc,i=r.mirror,c=r.blockClass,l=r.blockSelector,d=r.maskTextClass,f=r.maskTextSelector,p=r.skipChild,h=void 0!==p&&p,g=r.inlineStylesheet,m=void 0===g||g,v=r.maskInputOptions,I=void 0===v?{}:v,C=r.maskTextFn,b=r.maskInputFn,S=r.slimDOMOptions,w=r.dataURLOptions,A=void 0===w?{}:w,k=r.inlineImages,x=void 0!==k&&k,T=r.recordCanvas,E=void 0!==T&&T,M=r.onSerialize,R=r.onIframeLoad,F=r.iframeLoadTimeout,_=void 0===F?5e3:F,D=r.onStylesheetLoad,B=r.stylesheetLoadTimeout,U=void 0===B?5e3:B,W=r.keepIframeSrcFn,P=void 0===W?function(){return!1}:W,G=r.newlyAddedElement,Z=void 0!==G&&G,V=r.preserveWhiteSpace,Y=void 0===V||V,K=O(e,{doc:o,mirror:i,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:f,inlineStylesheet:m,maskInputOptions:I,maskTextFn:C,maskInputFn:b,dataURLOptions:A,inlineImages:x,recordCanvas:E,keepIframeSrcFn:P,newlyAddedElement:Z});if(!K)return console.warn(e,"not serialized"),null;n=i.hasNode(e)?i.getId(e):!function(e,r){if(r.comment&&e.type===t.Comment)return!0;if(e.type===t.Element){if(r.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(r.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(N(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===N(e.attributes.name)||"icon"===N(e.attributes.rel)||"apple-touch-icon"===N(e.attributes.rel)||"shortcut icon"===N(e.attributes.rel))))return!0;if("meta"===e.tagName){if(r.headMetaDescKeywords&&N(e.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(N(e.attributes.property).match(/^(og|twitter|fb):/)||N(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===N(e.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===N(e.attributes.name)||"googlebot"===N(e.attributes.name)||"bingbot"===N(e.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===N(e.attributes.name)||"generator"===N(e.attributes.name)||"framework"===N(e.attributes.name)||"publisher"===N(e.attributes.name)||"progid"===N(e.attributes.name)||N(e.attributes.property).match(/^article:/)||N(e.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===N(e.attributes.name)||"yandex-verification"===N(e.attributes.name)||"csrf-token"===N(e.attributes.name)||"p:domain_verify"===N(e.attributes.name)||"verify-v1"===N(e.attributes.name)||"verification"===N(e.attributes.name)||"shopify-checkout-api-token"===N(e.attributes.name)))return!0}}return!1}(K,S)&&(Y||K.type!==t.Text||K.isStyle||K.textContent.replace(/^\s+|\s+$/gm,"").length)?y():-2;var j=Object.assign(K,{id:n});if(i.add(e,j),-2===n)return null;M&&M(e);var z=!h;if(j.type===t.Element){z=z&&!j.needBlock,delete j.needBlock;var J=e.shadowRoot;J&&u(J)&&(j.isShadowHost=!0)}if((j.type===t.Document||j.type===t.Element)&&z){S.headWhitespace&&j.type===t.Element&&"head"===j.tagName&&(Y=!1);for(var Q={doc:o,mirror:i,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:f,skipChild:h,inlineStylesheet:m,maskInputOptions:I,maskTextFn:C,maskInputFn:b,slimDOMOptions:S,dataURLOptions:A,inlineImages:x,recordCanvas:E,preserveWhiteSpace:Y,onSerialize:M,onIframeLoad:R,iframeLoadTimeout:_,onStylesheetLoad:D,stylesheetLoadTimeout:U,keepIframeSrcFn:P},H=0,q=Array.from(e.childNodes);H<q.length;H++){(tt=L(q[H],Q))&&j.childNodes.push(tt)}if(a(e)&&e.shadowRoot)for(var X=0,$=Array.from(e.shadowRoot.childNodes);X<$.length;X++){var tt;(tt=L($[X],Q))&&(u(e.shadowRoot)&&(tt.isShadow=!0),j.childNodes.push(tt))}}return e.parentNode&&s(e.parentNode)&&u(e.parentNode)&&(j.isShadow=!0),j.type===t.Element&&"iframe"===j.tagName&&function(t,e,r){var n=t.contentWindow;if(n){var o,i=!1;try{o=n.document.readyState}catch(t){return}if("complete"===o){var a="about:blank";if(n.location.href!==a||t.src===a||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var s=setTimeout((function(){i||(e(),i=!0)}),r);t.addEventListener("load",(function(){clearTimeout(s),i=!0,e()}))}}}(e,(function(){var t=e.contentDocument;if(t&&R){var r=L(t,{doc:t,mirror:i,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:f,skipChild:!1,inlineStylesheet:m,maskInputOptions:I,maskTextFn:C,maskInputFn:b,slimDOMOptions:S,dataURLOptions:A,inlineImages:x,recordCanvas:E,preserveWhiteSpace:Y,onSerialize:M,onIframeLoad:R,iframeLoadTimeout:_,onStylesheetLoad:D,stylesheetLoadTimeout:U,keepIframeSrcFn:P});r&&R(e,r)}}),_),j.type===t.Element&&"link"===j.tagName&&"stylesheet"===j.attributes.rel&&function(t,e,r){var n,o=!1;try{n=t.sheet}catch(t){return}if(!n){var i=setTimeout((function(){o||(e(),o=!0)}),r);t.addEventListener("load",(function(){clearTimeout(i),o=!0,e()}))}}(e,(function(){if(D){var t=L(e,{doc:o,mirror:i,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:f,skipChild:!1,inlineStylesheet:m,maskInputOptions:I,maskTextFn:C,maskInputFn:b,slimDOMOptions:S,dataURLOptions:A,inlineImages:x,recordCanvas:E,preserveWhiteSpace:Y,onSerialize:M,onIframeLoad:R,iframeLoadTimeout:_,onStylesheetLoad:D,stylesheetLoadTimeout:U,keepIframeSrcFn:P});t&&D(e,t)}}),U),j}function F(t,e){var r=e||{},n=r.mirror,o=void 0===n?new d:n,i=r.blockClass,a=void 0===i?"rr-block":i,s=r.blockSelector,u=void 0===s?null:s,c=r.maskTextClass,l=void 0===c?"rr-mask":c,f=r.maskTextSelector,p=void 0===f?null:f,h=r.inlineStylesheet,g=void 0===h||h,m=r.inlineImages,v=void 0!==m&&m,y=r.recordCanvas,I=void 0!==y&&y,C=r.maskAllInputs,b=void 0!==C&&C,S=r.maskTextFn,w=r.maskInputFn,A=r.slimDOM,k=void 0!==A&&A,x=r.dataURLOptions,T=r.preserveWhiteSpace,E=r.onSerialize,M=r.onIframeLoad,R=r.iframeLoadTimeout,O=r.onStylesheetLoad,N=r.stylesheetLoadTimeout,F=r.keepIframeSrcFn;return L(t,{doc:t,mirror:o,blockClass:a,blockSelector:u,maskTextClass:l,maskTextSelector:p,skipChild:!1,inlineStylesheet:g,maskInputOptions:!0===b?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===b?{password:!0}:b,maskTextFn:S,maskInputFn:w,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:x,inlineImages:v,recordCanvas:I,preserveWhiteSpace:T,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onStylesheetLoad:O,stylesheetLoadTimeout:N,keepIframeSrcFn:void 0===F?function(){return!1}:F,newlyAddedElement:!1})}var _=/([^\\]):hover/;new RegExp(_.source,"g");var D=r(377),B=r.n(D),U=r(958),W=r.n(U),P=r(165),G=r.n(P),Z=r(534),V=r.n(Z);function Y(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,n={capture:!0,passive:!0};return r.addEventListener(t,e,n),function(){return r.removeEventListener(t,e,n)}}var K="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",j={map:{},getId:function(){return console.error(K),-1},getNode:function(){return console.error(K),null},removeNodeFromMap:function(){console.error(K)},has:function(){return console.error(K),!1},reset:function(){console.error(K)}};function z(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=null,o=0;return function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var u=Date.now();o||!1!==r.leading||(o=u);var c=e-(u-o),l=this;c<=0||c>e?(n&&(clearTimeout(n),n=null),o=u,t.apply(l,a)):n||!1===r.trailing||(n=setTimeout((function(){o=!1===r.leading?0:Date.now(),n=null,t.apply(l,a)}),c))}}function J(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,i=o.Object.getOwnPropertyDescriptor(t,e);return o.Object.defineProperty(t,e,n?r:{set:function(t){var e=this;setTimeout((function(){r.set.call(e,t)}),0),i&&i.set&&i.set.call(this,t)}}),function(){return J(t,e,i||{},!0)}}function Q(t,e,r){try{if(!(e in t))return function(){};var n=t[e],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),t[e]=o,function(){t[e]=n}}catch(t){return function(){}}}function H(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function q(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function X(t,e,r,n){if(!t)return!1;var o=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(!o)return!1;if("string"==typeof e){if(o.classList.contains(e))return!0;if(n&&null!==o.closest("."+e))return!0}else if(M(o,e,n))return!0;if(r){if(t.matches(r))return!0;if(n&&null!==o.closest(r))return!0}return!1}function $(t,e){return-2===e.getId(t)}function tt(t,e){if(s(t))return!1;var r=e.getId(t);return!e.has(r)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||tt(t.parentNode,e))}function et(t){return Boolean(t.changedTouches)}function rt(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var o=r[0];if(!(0 in r))throw new TypeError("1 argument is required");do{if(t===o)return!0}while(o=o&&o.parentNode);return!1})}function nt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function ot(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function it(t){return Boolean(null==t?void 0:t.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(j=new Proxy(j,{get:function(t,e,r){return"map"===e&&console.error(K),Reflect.get(t,e,r)}}));var at=function(){function t(){P(this,t),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return Z(t,[{key:"getId",value:function(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}},{key:"has",value:function(t){return this.styleIDMap.has(t)}},{key:"add",value:function(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}},{key:"getStyle",value:function(t){return this.idStyleMap.get(t)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]),t}(),st=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}(st||{}),ut=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t}(ut||{}),ct=function(t){return t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t}(ct||{}),lt=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}(lt||{});function dt(t){return"__ln"in t}var ft=function(){function t(){P(this,t),this.length=0,this.head=null}return Z(t,[{key:"get",value:function(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;r<t;r++)e=(null==e?void 0:e.next)||null;return e}},{key:"addNode",value:function(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&dt(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&dt(t.nextSibling)&&t.nextSibling.__ln.previous){var n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;this.length++}},{key:"removeNode",value:function(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next&&(e.next.previous=e.previous)):(this.head=e.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}]),t}(),pt=function(t,e){return"".concat(t,"@").concat(e)},ht=function(){function t(){var e=this;P(this,t),this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){if(!e.frozen&&!e.locked){for(var t=[],r=new ft,n=function(t){for(var r=t,n=-2;-2===n;)n=(r=r&&r.nextSibling)&&e.mirror.getId(r);return n},o=function(o){var i,a,u,c,l=null;(null===(a=null===(i=o.getRootNode)||void 0===i?void 0:i.call(o))||void 0===a?void 0:a.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&o.getRootNode().host&&(l=o.getRootNode().host);for(var d=l;(null===(c=null===(u=null==d?void 0:d.getRootNode)||void 0===u?void 0:u.call(d))||void 0===c?void 0:c.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&d.getRootNode().host;)d=d.getRootNode().host;var f=!(e.doc.contains(o)||d&&e.doc.contains(d));if(o.parentNode&&!f){var p=s(o.parentNode)?e.mirror.getId(l):e.mirror.getId(o.parentNode),h=n(o);if(-1===p||-1===h)return r.addNode(o);var g=L(o,{doc:e.doc,mirror:e.mirror,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,dataURLOptions:e.dataURLOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(t){nt(t,e.mirror)&&e.iframeManager.addIframe(t),ot(t,e.mirror)&&e.stylesheetManager.trackLinkElement(t),it(o)&&e.shadowDomManager.addShadowRoot(o.shadowRoot,e.doc)},onIframeLoad:function(t,r){e.iframeManager.attachIframe(t,r),e.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:function(t,r){e.stylesheetManager.attachLinkElement(t,r)}});g&&t.push({parentId:p,nextId:h,node:g})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());for(var i=0,a=Array.from(e.movedSet.values());i<a.length;i++){var u=a[i];mt(e.removes,u,e.mirror)&&!e.movedSet.has(u.parentNode)||o(u)}for(var c=0,l=Array.from(e.addedSet.values());c<l.length;c++){var d=l[c];yt(e.droppedSet,d)||mt(e.removes,d,e.mirror)?yt(e.movedSet,d)?o(d):e.droppedSet.add(d):o(d)}for(var f=null;r.length;){var p=null;if(f){var h=e.mirror.getId(f.value.parentNode),g=n(f.value);-1!==h&&-1!==g&&(p=f)}if(!p)for(var m=r.length-1;m>=0;m--){var v=r.get(m);if(v){var y=e.mirror.getId(v.value.parentNode);if(-1===n(v.value))continue;if(-1!==y){p=v;break}var I=v.value;if(I.parentNode&&I.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var C=I.parentNode.host;if(-1!==e.mirror.getId(C)){p=v;break}}}}if(!p){for(;r.head;)r.removeNode(r.head.value);break}f=p.previous,r.removeNode(p.value),o(p.value)}var b={texts:e.texts.map((function(t){return{id:e.mirror.getId(t.node),value:t.value}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:t};(b.texts.length||b.attributes.length||b.removes.length||b.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(b))}},this.processMutation=function(t){if(!$(t.target,e.mirror))switch(t.type){case"characterData":var r=t.target.textContent;X(t.target,e.blockClass,e.blockSelector,!1)||r===t.oldValue||e.texts.push({value:R(t.target,e.maskTextClass,e.maskTextSelector)&&r?e.maskTextFn?e.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break;case"attributes":var n=t.target,o=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(o=f({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:o,maskInputFn:e.maskInputFn})),X(t.target,e.blockClass,e.blockSelector,!1)||o===t.oldValue)return;var i=e.attributes.find((function(e){return e.node===t.target}));if("IFRAME"===n.tagName&&"src"===t.attributeName&&!e.keepIframeSrcFn(o)){if(n.contentDocument)return;t.attributeName="rr_src"}if(i||(i={node:t.target,attributes:{}},e.attributes.push(i)),"style"===t.attributeName){var a=e.doc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue),void 0!==i.attributes.style&&null!==i.attributes.style||(i.attributes.style={});for(var c=i.attributes.style,l=0,d=Array.from(n.style);l<d.length;l++){var p=d[l],h=n.style.getPropertyValue(p),g=n.style.getPropertyPriority(p);h===a.style.getPropertyValue(p)&&g===a.style.getPropertyPriority(p)||(c[p]=""===g?h:[h,g])}for(var m=0,v=Array.from(a.style);m<v.length;m++){var y=v[m];""===n.style.getPropertyValue(y)&&(c[y]=!1)}}else i.attributes[t.attributeName]=E(e.doc,n.tagName,t.attributeName,o);break;case"childList":if(X(t.target,e.blockClass,e.blockSelector,!0))return;t.addedNodes.forEach((function(r){return e.genAdds(r,t.target)})),t.removedNodes.forEach((function(r){var n=e.mirror.getId(r),o=s(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);X(t.target,e.blockClass,e.blockSelector,!1)||$(r,e.mirror)||!function(t,e){return-1!==e.getId(t)}(r,e.mirror)||(e.addedSet.has(r)?(gt(e.addedSet,r),e.droppedSet.add(r)):e.addedSet.has(t.target)&&-1===n||tt(t.target,e.mirror)||(e.movedSet.has(r)&&e.movedMap[pt(n,o)]?gt(e.movedSet,r):e.removes.push({parentId:o,id:n,isShadow:!(!s(t.target)||!u(t.target))||void 0})),e.mapRemoves.push(r))}))}},this.genAdds=function(t,r){if(e.mirror.hasNode(t)){if($(t,e.mirror))return;e.movedSet.add(t);var n=null;r&&e.mirror.hasNode(r)&&(n=e.mirror.getId(r)),n&&-1!==n&&(e.movedMap[pt(e.mirror.getId(t),n)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);X(t,e.blockClass,e.blockSelector,!1)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}return Z(t,[{key:"init",value:function(t){var e=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach((function(r){e[r]=t[r]}))}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]),t}();function gt(t,e){t.delete(e),e.childNodes.forEach((function(e){return gt(t,e)}))}function mt(t,e,r){return 0!==t.length&&vt(t,e,r)}function vt(t,e,r){var n=e.parentNode;if(!n)return!1;var o=r.getId(n);return!!t.some((function(t){return t.id===o}))||vt(t,n,r)}function yt(t,e){return 0!==t.size&&It(t,e)}function It(t,e){var r=e.parentNode;return!!r&&(!!t.has(r)||It(t,r))}var Ct=[],bt="undefined"!=typeof CSSGroupingRule,St="undefined"!=typeof CSSMediaRule,wt="undefined"!=typeof CSSSupportsRule,At="undefined"!=typeof CSSConditionRule;function kt(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0];return t.target}catch(e){return t.target}}function xt(t,e){var r,n,o=new ht;Ct.push(o),o.init(t);var i=window.MutationObserver||window.__rrMutationObserver,a=null===(n=null===(r=null===window||void 0===window?void 0:window.Zone)||void 0===r?void 0:r.__symbol__)||void 0===n?void 0:n.call(r,"MutationObserver");a&&window[a]&&(i=window[a]);var s=new i(o.processMutations.bind(o));return s.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Tt(t){var e=t.mousemoveCb,r=t.sampling,n=t.doc,o=t.mirror;if(!1===r.mousemove)return function(){};var i,a="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],c=z((function(t){var r=Date.now()-i;e(u.map((function(t){return t.timeOffset-=r,t})),t),u=[],i=null}),s),l=z((function(t){var e=kt(t),r=et(t)?t.changedTouches[0]:t,n=r.clientX,a=r.clientY;i||(i=Date.now()),u.push({x:n,y:a,id:o.getId(e),timeOffset:Date.now()-i}),c("undefined"!=typeof DragEvent&&t instanceof DragEvent?ut.Drag:t instanceof MouseEvent?ut.MouseMove:ut.TouchMove)}),a,{trailing:!1}),d=[Y("mousemove",l,n),Y("touchmove",l,n),Y("drag",l,n)];return function(){d.forEach((function(t){return t()}))}}function Et(t){var e=t.mouseInteractionCb,r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return function(){};var s=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[];return Object.keys(ct).filter((function(t){return Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==s[t]})).forEach((function(t){var a=t.toLowerCase(),s=function(t){return function(r){var a=kt(r);if(!X(a,o,i,!0)){var s=et(r)?r.changedTouches[0]:r;if(s){var u=n.getId(a),c=s.clientX,l=s.clientY;e({type:ct[t],id:u,x:c,y:l})}}}}(t);u.push(Y(a,s,r))})),function(){u.forEach((function(t){return t()}))}}function Mt(t){var e=t.scrollCb,r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector;return Y("scroll",z((function(t){var a=kt(t);if(a&&!X(a,o,i,!0)){var s=n.getId(a);if(a===r){var u=r.scrollingElement||r.documentElement;e({id:s,x:u.scrollLeft,y:u.scrollTop})}else e({id:s,x:a.scrollLeft,y:a.scrollTop})}}),t.sampling.scroll||100),r)}function Rt(t){var e=t.viewportResizeCb,r=-1,n=-1;return Y("resize",z((function(){var t=H(),o=q();r===t&&n===o||(e({width:Number(o),height:Number(t)}),r=t,n=o)}),200),window)}function Ot(t,e){var r=Object.assign({},t);return e||delete r.userTriggered,r}var Nt=["INPUT","TEXTAREA","SELECT"],Lt=new WeakMap;function Ft(t){var e=t.inputCb,r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.ignoreClass,s=t.maskInputOptions,u=t.maskInputFn,c=t.sampling,l=t.userTriggeredOnInput;function d(t){var e=kt(t),n=t.isTrusted;if(e&&"OPTION"===e.tagName&&(e=e.parentElement),e&&e.tagName&&!(Nt.indexOf(e.tagName)<0)&&!X(e,o,i,!0)){var c=e.type;if(!e.classList.contains(a)){var d=e.value,h=!1;"radio"===c||"checkbox"===c?h=e.checked:(s[e.tagName.toLowerCase()]||s[c])&&(d=f({maskInputOptions:s,tagName:e.tagName,type:c,value:d,maskInputFn:u})),p(e,Ot({text:d,isChecked:h,userTriggered:n},l));var g=e.name;"radio"===c&&g&&h&&r.querySelectorAll('input[type="radio"][name="'.concat(g,'"]')).forEach((function(t){t!==e&&p(t,Ot({text:t.value,isChecked:!h,userTriggered:!1},l))}))}}}function p(t,r){var o=Lt.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Lt.set(t,r);var i=n.getId(t);e(Object.assign(Object.assign({},r),{id:i}))}}var h=("last"===c.input?["change"]:["input","change"]).map((function(t){return Y(t,d,r)})),g=r.defaultView;if(!g)return function(){h.forEach((function(t){return t()}))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),v=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&h.push.apply(h,U(v.map((function(t){return J(t[0],t[1],{set:function(){d({target:this})}},!1,g)})))),function(){h.forEach((function(t){return t()}))}}function _t(t){return function(t,e){if(bt&&t.parentRule instanceof CSSGroupingRule||St&&t.parentRule instanceof CSSMediaRule||wt&&t.parentRule instanceof CSSSupportsRule||At&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(n)}return e}(t,[])}function Dt(t,e,r){var n,o;return t?(t.ownerNode?n=e.getId(t.ownerNode):o=r.getId(t),{styleId:o,id:n}):{}}function Bt(t,e){var r=t.styleSheetRuleCb,n=t.mirror,o=t.stylesheetManager,i=e.win,a=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=function(t,e){var i=Dt(this,n,o.styleMirror),s=i.id,u=i.styleId;return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,adds:[{rule:t,index:e}]}),a.apply(this,[t,e])};var s,u,c=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=function(t){var e=Dt(this,n,o.styleMirror),i=e.id,a=e.styleId;return(i&&-1!==i||a&&-1!==a)&&r({id:i,styleId:a,removes:[{index:t}]}),c.apply(this,[t])},i.CSSStyleSheet.prototype.replace&&(s=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=function(t){var e=Dt(this,n,o.styleMirror),i=e.id,a=e.styleId;return(i&&-1!==i||a&&-1!==a)&&r({id:i,styleId:a,replace:t}),s.apply(this,[t])}),i.CSSStyleSheet.prototype.replaceSync&&(u=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=function(t){var e=Dt(this,n,o.styleMirror),i=e.id,a=e.styleId;return(i&&-1!==i||a&&-1!==a)&&r({id:i,styleId:a,replaceSync:t}),u.apply(this,[t])});var l={};bt?l.CSSGroupingRule=i.CSSGroupingRule:(St&&(l.CSSMediaRule=i.CSSMediaRule),At&&(l.CSSConditionRule=i.CSSConditionRule),wt&&(l.CSSSupportsRule=i.CSSSupportsRule));var d={};return Object.entries(l).forEach((function(t){var e=D(t,2),i=e[0],a=e[1];d[i]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=function(t,e){var a=Dt(this.parentStyleSheet,n,o.styleMirror),s=a.id,u=a.styleId;return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,adds:[{rule:t,index:[].concat(U(_t(this)),[e||0])}]}),d[i].insertRule.apply(this,[t,e])},a.prototype.deleteRule=function(t){var e=Dt(this.parentStyleSheet,n,o.styleMirror),a=e.id,s=e.styleId;return(a&&-1!==a||s&&-1!==s)&&r({id:a,styleId:s,removes:[{index:[].concat(U(_t(this)),[t])}]}),d[i].deleteRule.apply(this,[t])}})),function(){i.CSSStyleSheet.prototype.insertRule=a,i.CSSStyleSheet.prototype.deleteRule=c,s&&(i.CSSStyleSheet.prototype.replace=s),u&&(i.CSSStyleSheet.prototype.replaceSync=u),Object.entries(l).forEach((function(t){var e=D(t,2),r=e[0],n=e[1];n.prototype.insertRule=d[r].insertRule,n.prototype.deleteRule=d[r].deleteRule}))}}function Ut(t,e){var r,n,o,i=t.mirror,a=t.stylesheetManager,s=null;s="#document"===e.nodeName?i.getId(e):i.getId(e.host);var u="#document"===e.nodeName?null===(r=e.defaultView)||void 0===r?void 0:r.Document:null===(o=null===(n=e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===o?void 0:o.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets");return null!==s&&-1!==s&&u&&c?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:function(){var t;return null===(t=c.get)||void 0===t?void 0:t.call(this)},set:function(t){var e,r=null===(e=c.set)||void 0===e?void 0:e.call(this,t);if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return r}}),function(){Object.defineProperty(e,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}):function(){}}function Wt(t,e){var r=t.styleDeclarationCb,n=t.mirror,o=t.ignoreCSSAttributes,i=t.stylesheetManager,a=e.win,s=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=function(t,e,a){var u;if(o.has(t))return s.apply(this,[t,e,a]);var c=Dt(null===(u=this.parentRule)||void 0===u?void 0:u.parentStyleSheet,n,i.styleMirror),l=c.id,d=c.styleId;return(l&&-1!==l||d&&-1!==d)&&r({id:l,styleId:d,set:{property:t,value:e,priority:a},index:_t(this.parentRule)}),s.apply(this,[t,e,a])};var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=function(t){var e;if(o.has(t))return u.apply(this,[t]);var a=Dt(null===(e=this.parentRule)||void 0===e?void 0:e.parentStyleSheet,n,i.styleMirror),s=a.id,c=a.styleId;return(s&&-1!==s||c&&-1!==c)&&r({id:s,styleId:c,remove:{property:t},index:_t(this.parentRule)}),u.apply(this,[t])},function(){a.CSSStyleDeclaration.prototype.setProperty=s,a.CSSStyleDeclaration.prototype.removeProperty=u}}function Pt(t){var e=t.mediaInteractionCb,r=t.blockClass,n=t.blockSelector,o=t.mirror,i=t.sampling,a=function(t){return z((function(i){var a=kt(i);if(a&&!X(a,r,n,!0)){var s=a.currentTime,u=a.volume,c=a.muted,l=a.playbackRate;e({type:t,id:o.getId(a),currentTime:s,volume:u,muted:c,playbackRate:l})}}),i.media||500)},s=[Y("play",a(0)),Y("pause",a(1)),Y("seeked",a(2)),Y("volumechange",a(3)),Y("ratechange",a(4))];return function(){s.forEach((function(t){return t()}))}}function Gt(t){var e=t.fontCb,r=t.doc,n=r.defaultView;if(!n)return function(){};var o=[],i=new WeakMap,a=n.FontFace;n.FontFace=function(t,e,r){var n=new a(t,e,r);return i.set(n,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),n};var s=Q(r.fonts,"add",(function(t){return function(r){return setTimeout((function(){var t=i.get(r);t&&(e(t),i.delete(r))}),0),t.apply(this,[r])}}));return o.push((function(){n.FontFace=a})),o.push(s),function(){o.forEach((function(t){return t()}))}}function Zt(t){var e=t.doc,r=t.mirror,n=t.blockClass,o=t.blockSelector,i=t.selectionCb,a=!0,s=function(){var t=e.getSelection();if(!(!t||a&&(null==t?void 0:t.isCollapsed))){a=t.isCollapsed||!1;for(var s=[],u=t.rangeCount||0,c=0;c<u;c++){var l=t.getRangeAt(c),d=l.startContainer,f=l.startOffset,p=l.endContainer,h=l.endOffset;X(d,n,o,!0)||X(p,n,o,!0)||s.push({start:r.getId(d),startOffset:f,end:r.getId(p),endOffset:h})}i({ranges:s})}};return s(),Y("selectionchange",s)}function Vt(t,e){var r=t.mutationCb,n=t.mousemoveCb,o=t.mouseInteractionCb,i=t.scrollCb,a=t.viewportResizeCb,s=t.inputCb,u=t.mediaInteractionCb,c=t.styleSheetRuleCb,l=t.styleDeclarationCb,d=t.canvasMutationCb,f=t.fontCb,p=t.selectionCb;t.mutationCb=function(){e.mutation&&e.mutation.apply(e,arguments),r.apply(void 0,arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove.apply(e,arguments),n.apply(void 0,arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction.apply(e,arguments),o.apply(void 0,arguments)},t.scrollCb=function(){e.scroll&&e.scroll.apply(e,arguments),i.apply(void 0,arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize.apply(e,arguments),a.apply(void 0,arguments)},t.inputCb=function(){e.input&&e.input.apply(e,arguments),s.apply(void 0,arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction.apply(e,arguments),u.apply(void 0,arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule.apply(e,arguments),c.apply(void 0,arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration.apply(e,arguments),l.apply(void 0,arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation.apply(e,arguments),d.apply(void 0,arguments)},t.fontCb=function(){e.font&&e.font.apply(e,arguments),f.apply(void 0,arguments)},t.selectionCb=function(){e.selection&&e.selection.apply(e,arguments),p.apply(void 0,arguments)}}function Yt(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.doc.defaultView;if(!n)return function(){};Vt(t,r);var o,i=xt(t,t.doc),a=Tt(t),s=Et(t),u=Mt(t),c=Rt(t),l=Ft(t),d=Pt(t),f=Bt(t,{win:n}),p=Ut(t,t.doc),h=Wt(t,{win:n}),g=t.collectFonts?Gt(t):function(){},m=Zt(t),v=[],y=e(t.plugins);try{for(y.s();!(o=y.n()).done;){var I=o.value;v.push(I.observer(I.callback,n,I.options))}}catch(t){y.e(t)}finally{y.f()}return function(){Ct.forEach((function(t){return t.reset()})),i.disconnect(),a(),s(),u(),c(),l(),d(),f(),p(),h(),g(),m(),v.forEach((function(t){return t()}))}}var Kt=function(){function t(e){P(this,t),this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}return Z(t,[{key:"getId",value:function(t,e,r,n){var o=r||this.getIdToRemoteIdMap(t),i=n||this.getRemoteIdToIdMap(t),a=o.get(e);return a||(a=this.generateIdFn(),o.set(e,a),i.set(a,e)),a}},{key:"getIds",value:function(t,e){var r=this,n=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return e.map((function(e){return r.getId(t,e,n,o)}))}},{key:"getRemoteId",value:function(t,e,r){var n=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var o=n.get(e);return o||-1}},{key:"getRemoteIds",value:function(t,e){var r=this,n=this.getRemoteIdToIdMap(t);return e.map((function(e){return r.getRemoteId(t,e,n)}))}},{key:"reset",value:function(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}},{key:"getIdToRemoteIdMap",value:function(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}},{key:"getRemoteIdToIdMap",value:function(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}]),t}(),jt=function(){function t(e){P(this,t),this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Kt(y),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Kt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}return Z(t,[{key:"addIframe",value:function(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}},{key:"addLoadListener",value:function(t){this.loadListener=t}},{key:"attachIframe",value:function(t,e){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(r=this.loadListener)||void 0===r||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}},{key:"handleMessage",value:function(t){if("rrweb"===t.data.type){if(!t.source)return;var e=this.crossOriginIframeMap.get(t.source);if(!e)return;var r=this.transformCrossOriginEvent(e,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}},{key:"transformCrossOriginEvent",value:function(t,e){var r,n=this;switch(e.type){case st.FullSnapshot:return this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t),{timestamp:e.timestamp,type:st.IncrementalSnapshot,data:{source:ut.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case st.Meta:case st.Load:case st.DomContentLoaded:return!1;case st.Plugin:return e;case st.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case st.IncrementalSnapshot:switch(e.data.source){case ut.Mutation:return e.data.adds.forEach((function(e){n.replaceIds(e,t,["parentId","nextId","previousId"]),n.replaceIdOnNode(e.node,t)})),e.data.removes.forEach((function(e){n.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((function(e){n.replaceIds(e,t,["id"])})),e.data.texts.forEach((function(e){n.replaceIds(e,t,["id"])})),e;case ut.Drag:case ut.TouchMove:case ut.MouseMove:return e.data.positions.forEach((function(e){n.replaceIds(e,t,["id"])})),e;case ut.ViewportResize:return!1;case ut.MediaInteraction:case ut.MouseInteraction:case ut.Scroll:case ut.CanvasMutation:case ut.Input:return this.replaceIds(e.data,t,["id"]),e;case ut.StyleSheetRule:case ut.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case ut.Font:return e;case ut.Selection:return e.data.ranges.forEach((function(e){n.replaceIds(e,t,["start","end"])})),e;case ut.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(r=e.data.styles)||void 0===r||r.forEach((function(e){n.replaceStyleIds(e,t,["styleId"])})),e}}}},{key:"replace",value:function(t,r,n,o){var i,a=e(o);try{for(a.s();!(i=a.n()).done;){var s=i.value;(Array.isArray(r[s])||"number"==typeof r[s])&&(Array.isArray(r[s])?r[s]=t.getIds(n,r[s]):r[s]=t.getId(n,r[s]))}}catch(t){a.e(t)}finally{a.f()}return r}},{key:"replaceIds",value:function(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}},{key:"replaceStyleIds",value:function(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}},{key:"replaceIdOnNode",value:function(t,e){var r=this;this.replaceIds(t,e,["id"]),"childNodes"in t&&t.childNodes.forEach((function(t){r.replaceIdOnNode(t,e)}))}}]),t}(),zt=function(){function t(e){P(this,t),this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var r=this;this.restorePatches.push(Q(Element.prototype,"attachShadow",(function(t){return function(e){var n=t.call(this,e);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}return Z(t,[{key:"addShadowRoot",value:function(t,e){var r=this;u(t)&&(this.shadowDoms.has(t)||(this.shadowDoms.add(t),xt(Object.assign(Object.assign({},this.bypassOptions),{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Mt(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout((function(){t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&r.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,r.mirror.getId(t.host)),Ut({mirror:r.mirror,stylesheetManager:r.bypassOptions.stylesheetManager},t)}),0)))}},{key:"observeAttachShadow",value:function(t){if(t.contentWindow){var e=this;this.restorePatches.push(Q(t.contentWindow.HTMLElement.prototype,"attachShadow",(function(r){return function(n){var o=r.call(this,n);return this.shadowRoot&&e.addShadowRoot(this.shadowRoot,t.contentDocument),o}})))}}},{key:"reset",value:function(){this.restorePatches.forEach((function(t){return t()})),this.shadowDoms=new WeakSet}}]),t}(),Jt=r(177),Qt=r.n(Jt);function Ht(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))}for(var qt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),$t=0;$t<qt.length;$t++)Xt[qt.charCodeAt($t)]=$t;var te=new Map;var ee=function(t,e,r){if(t&&(oe(t,e)||"object"===o(t))){var n=function(t,e){var r=te.get(t);return r||(r=new Map,te.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),i=n.indexOf(t);return-1===i&&(i=n.length,n.push(t)),i}};function re(t,e,r){if(t instanceof Array)return t.map((function(t){return re(t,e,r)}));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){var n=t.constructor.name,i=function(t){var e,r=new Uint8Array(t),n=r.length,o="";for(e=0;e<n;e+=3)o+=qt[r[e]>>2],o+=qt[(3&r[e])<<4|r[e+1]>>4],o+=qt[(15&r[e+1])<<2|r[e+2]>>6],o+=qt[63&r[e+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(t);return{rr_type:n,base64:i}}if(t instanceof DataView)return{rr_type:t.constructor.name,args:[re(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement)return{rr_type:t.constructor.name,src:t.src};if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[re(t.data,e,r),t.width,t.height]}:oe(t,e)||"object"===o(t)?{rr_type:t.constructor.name,index:ee(t,e,r)}:t}var ne=function(t,e,r){return U(t).map((function(t){return re(t,e,r)}))},oe=function(t,e){var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(t){return"function"==typeof e[t]}));return Boolean(r.find((function(r){return t instanceof e[r]})))};function ie(t,e,r){var n=[];try{var o=Q(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){X(this,e,r,!0)||"__context"in this||(this.__context=n);for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return t.apply(this,[n].concat(i))}}));n.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(t){return t()}))}}function ae(t,r,n,o,i,a,s){var u,c=[],l=Object.getOwnPropertyNames(t),d=e(l);try{var f=function(){var e=u.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(e))return 0;try{if("function"!=typeof t[e])return 0;var a=Q(t,e,(function(t){return function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];var l=t.apply(this,u);if(ee(l,s,this),!X(this.canvas,o,i,!0)){var d=ne([].concat(u),s,this),f={type:r,property:e,args:d};n(this.canvas,f)}return l}}));c.push(a)}catch(o){var l=J(t,e,{set:function(t){n(this.canvas,{type:r,property:e,args:[t],setter:!0})}});c.push(l)}};for(d.s();!(u=d.n()).done;)f()}catch(t){d.e(t)}finally{d.f()}return c}var se=null;try{var ue="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof require&&require("worker_threads")||"function"==typeof require&&require("worker_threads");se=ue.Worker}catch(t){}var ce=r(579).lW;function le(t,e,r){var n=void 0===e?null:e,o=function(t,e){return ce.from(t,"base64").toString(e?"utf16":"utf8")}(t,void 0!==r&&r),i=o.indexOf("\n",10)+1,a=o.substring(i)+(n?"//# sourceMappingURL="+n:"");return function(t){return new se(a,Object.assign({},t,{eval:!0}))}}function de(t,e,r){var n=void 0===e?null:e,o=function(t,e){var r=atob(t);if(e){for(var n=new Uint8Array(r.length),o=0,i=r.length;o<i;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}(t,void 0!==r&&r),i=o.indexOf("\n",10)+1,a=o.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(s)}var fe=r(256),pe="[object process]"===Object.prototype.toString.call(void 0!==fe?fe:0);var he,ge,me,ve,ye,Ie,Ce=(he="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",ge=null,me=!1,pe?le(he,ge,me):function(t,e,r){var n;return function(o){return n=n||de(t,e,r),new Worker(n,o)}}(he,ge,me)),be=function(){function t(e){var r=this;P(this,t),this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(t,e){!(r.rafStamps.invokeId&&r.rafStamps.latestId!==r.rafStamps.invokeId)&&r.rafStamps.invokeId||(r.rafStamps.invokeId=r.rafStamps.latestId),r.pendingCanvasMutations.has(t)||r.pendingCanvasMutations.set(t,[]),r.pendingCanvasMutations.get(t).push(e)};var n=e.sampling,o=void 0===n?"all":n,i=e.win,a=e.blockClass,s=e.blockSelector,u=e.recordCanvas,c=e.dataURLOptions;this.mutationCb=e.mutationCb,this.mirror=e.mirror,u&&"all"===o&&this.initCanvasMutationObserver(i,a,s),u&&"number"==typeof o&&this.initCanvasFPSObserver(o,i,a,s,{dataURLOptions:c})}return Z(t,[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(t,e,r,n,o){var i=this,a=ie(e,r,n),s=new Map,u=new Ce;u.onmessage=function(t){var e=t.data.id;if(s.set(e,!1),"base64"in t.data){var r=t.data,n=r.base64,o=r.type,a=r.width,u=r.height;i.mutationCb({id:e,type:lt["2D"],commands:[{property:"clearRect",args:[0,0,a,u]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:o}]},0,0]}]})}};var c,l=1e3/t,d=0;c=requestAnimationFrame((function t(a){var f;d&&a-d<l?c=requestAnimationFrame(t):(d=a,(f=[],e.document.querySelectorAll("canvas").forEach((function(t){X(t,r,n,!0)||f.push(t)})),f).forEach((function(t){return Ht(i,void 0,void 0,Jt().mark((function e(){var r,n,i,a;return Jt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.mirror.getId(t),!s.get(n)){e.next=3;break}return e.abrupt("return");case 3:return s.set(n,!0),["webgl","webgl2"].includes(t.__context)&&(i=t.getContext(t.__context),!1===(null===(r=null==i?void 0:i.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&(null==i||i.clear(i.COLOR_BUFFER_BIT))),e.next=7,createImageBitmap(t);case 7:a=e.sent,u.postMessage({id:n,bitmap:a,width:t.width,height:t.height,dataURLOptions:o.dataURLOptions},[a]);case 9:case"end":return e.stop()}}),e,this)})))})),c=requestAnimationFrame(t))})),this.resetObservers=function(){a(),cancelAnimationFrame(c)}}},{key:"initCanvasMutationObserver",value:function(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var o=ie(t,r,n),i=function(t,r,n,o){var i,a=[],s=Object.getOwnPropertyNames(r.CanvasRenderingContext2D.prototype),u=e(s);try{var c=function(){var e=i.value;try{if("function"!=typeof r.CanvasRenderingContext2D.prototype[e])return 1;var s=Q(r.CanvasRenderingContext2D.prototype,e,(function(i){return function(){for(var a=this,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return X(this.canvas,n,o,!0)||setTimeout((function(){var n=ne([].concat(u),r,a);t(a.canvas,{type:lt["2D"],property:e,args:n})}),0),i.apply(this,u)}}));a.push(s)}catch(n){var u=J(r.CanvasRenderingContext2D.prototype,e,{set:function(r){t(this.canvas,{type:lt["2D"],property:e,args:[r],setter:!0})}});a.push(u)}};for(u.s();!(i=u.n()).done;)c()}catch(t){u.e(t)}finally{u.f()}return function(){a.forEach((function(t){return t()}))}}(this.processMutation.bind(this),t,r,n),a=function(t,e,r,n,o){var i=[];return i.push.apply(i,U(ae(e.WebGLRenderingContext.prototype,lt.WebGL,t,r,n,0,e))),void 0!==e.WebGL2RenderingContext&&i.push.apply(i,U(ae(e.WebGL2RenderingContext.prototype,lt.WebGL2,t,r,n,0,e))),function(){i.forEach((function(t){return t()}))}}(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=function(){o(),i(),a()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var t=this;requestAnimationFrame((function(){return t.flushPendingCanvasMutations()}))}},{key:"startRAFTimestamping",value:function(){var t=this;requestAnimationFrame((function e(r){t.rafStamps.latestId=r,requestAnimationFrame(e)}))}},{key:"flushPendingCanvasMutations",value:function(){var t=this;this.pendingCanvasMutations.forEach((function(e,r){var n=t.mirror.getId(r);t.flushPendingCanvasMutationFor(r,n)})),requestAnimationFrame((function(){return t.flushPendingCanvasMutations()}))}},{key:"flushPendingCanvasMutationFor",value:function(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((function(t){var e=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}(t,["type"]);return e})),o=r[0].type;this.mutationCb({id:e,type:o,commands:n}),this.pendingCanvasMutations.delete(t)}}}}]),t}(),Se=function(){function t(e){P(this,t),this.trackedLinkElements=new WeakSet,this.styleMirror=new at,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}return Z(t,[{key:"attachLinkElement",value:function(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}},{key:"trackLinkElement",value:function(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}},{key:"adoptStyleSheets",value:function(t,r){if(0!==t.length){var n,o={id:r,styleIds:[]},i=[],a=e(t);try{for(a.s();!(n=a.n()).done;){var s=n.value,u=void 0;if(this.styleMirror.has(s))u=this.styleMirror.getId(s);else{u=this.styleMirror.add(s);var c=Array.from(s.rules||CSSRule);i.push({styleId:u,rules:c.map((function(t,e){return{rule:l(t),index:e}}))})}o.styleIds.push(u)}}catch(t){a.e(t)}finally{a.f()}i.length>0&&(o.styles=i),this.adoptedStyleSheetCb(o)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(t){}}]),t}();function we(t){return Object.assign(Object.assign({},t),{timestamp:Date.now()})}var Ae=!1,ke=new d;function xe(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.emit,n=t.checkoutEveryNms,o=t.checkoutEveryNth,i=t.blockClass,a=void 0===i?"rr-block":i,s=t.blockSelector,u=void 0===s?null:s,c=t.ignoreClass,l=void 0===c?"rr-ignore":c,d=t.maskTextClass,f=void 0===d?"rr-mask":d,p=t.maskTextSelector,h=void 0===p?null:p,g=t.inlineStylesheet,m=void 0===g||g,v=t.maskAllInputs,y=t.maskInputOptions,I=t.slimDOMOptions,C=t.maskInputFn,b=t.maskTextFn,S=t.hooks,w=t.packFn,A=t.sampling,k=void 0===A?{}:A,x=t.dataURLOptions,T=void 0===x?{}:x,E=t.mousemoveWait,M=t.recordCanvas,R=void 0!==M&&M,O=t.recordCrossOriginIframes,N=void 0!==O&&O,L=t.userTriggeredOnInput,_=void 0!==L&&L,D=t.collectFonts,B=void 0!==D&&D,U=t.inlineImages,W=void 0!==U&&U,P=t.plugins,G=t.keepIframeSrcFn,Z=void 0===G?function(){return!1}:G,V=t.ignoreCSSAttributes,K=void 0===V?new Set([]):V,j=!N||window.parent===window,z=!1;if(!j)try{window.parent.document,z=!1}catch(t){z=!0}if(j&&!r)throw new Error("emit function is required");void 0!==E&&void 0===k.mousemove&&(k.mousemove=E),ke.reset();var J,Q=!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==y?y:{password:!0},X=!0===I||"all"===I?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===I,headMetaDescKeywords:"all"===I}:I||{};rt();var $=0,tt=function(t){var r,n=e(P||[]);try{for(n.s();!(r=n.n()).done;){var o=r.value;o.eventProcessor&&(t=o.eventProcessor(t))}}catch(t){n.e(t)}finally{n.f()}return w&&(t=w(t)),t};ve=function(t,e){var i;if(!(null===(i=Ct[0])||void 0===i?void 0:i.isFrozen())||t.type===st.FullSnapshot||t.type===st.IncrementalSnapshot&&t.data.source===ut.Mutation||Ct.forEach((function(t){return t.unfreeze()})),j)null==r||r(tt(t),e);else if(z){var a={type:"rrweb",event:tt(t),isCheckout:e};window.parent.postMessage(a,"*")}if(t.type===st.FullSnapshot)J=t,$=0;else if(t.type===st.IncrementalSnapshot){if(t.data.source===ut.Mutation&&t.data.isAttachIframe)return;$++;var s=o&&$>=o,u=n&&t.timestamp-J.timestamp>n;(s||u)&&ye(!0)}};var et,at=function(t){ve(we({type:st.IncrementalSnapshot,data:Object.assign({source:ut.Mutation},t)}))},ct=function(t){return ve(we({type:st.IncrementalSnapshot,data:Object.assign({source:ut.Scroll},t)}))},lt=function(t){return ve(we({type:st.IncrementalSnapshot,data:Object.assign({source:ut.CanvasMutation},t)}))},dt=function(t){return ve(we({type:st.IncrementalSnapshot,data:Object.assign({source:ut.AdoptedStyleSheet},t)}))},ft=new Se({mutationCb:at,adoptedStyleSheetCb:dt}),pt=new jt({mirror:ke,mutationCb:at,stylesheetManager:ft,recordCrossOriginIframes:N,wrappedEmit:ve}),ht=e(P||[]);try{for(ht.s();!(et=ht.n()).done;){var gt=et.value;gt.getMirror&>.getMirror({nodeMirror:ke,crossOriginIframeMirror:pt.crossOriginIframeMirror,crossOriginIframeStyleMirror:pt.crossOriginIframeStyleMirror})}}catch(t){ht.e(t)}finally{ht.f()}Ie=new be({recordCanvas:R,mutationCb:lt,win:window,blockClass:a,blockSelector:u,mirror:ke,sampling:k.canvas,dataURLOptions:T});var mt=new zt({mutationCb:at,scrollCb:ct,bypassOptions:{blockClass:a,blockSelector:u,maskTextClass:f,maskTextSelector:h,inlineStylesheet:m,maskInputOptions:Q,dataURLOptions:T,maskTextFn:b,maskInputFn:C,recordCanvas:R,inlineImages:W,sampling:k,slimDOMOptions:X,iframeManager:pt,stylesheetManager:ft,canvasManager:Ie,keepIframeSrcFn:Z},mirror:ke});ye=function(){var t,e,r,n,o,i,s=arguments.length>0&&void 0!==arguments[0]&&arguments[0];ve(we({type:st.Meta,data:{href:window.location.href,width:q(),height:H()}}),s),ft.reset(),Ct.forEach((function(t){return t.lock()}));var c=F(document,{mirror:ke,blockClass:a,blockSelector:u,maskTextClass:f,maskTextSelector:h,inlineStylesheet:m,maskAllInputs:Q,maskTextFn:b,slimDOM:X,dataURLOptions:T,recordCanvas:R,inlineImages:W,onSerialize:function(t){nt(t,ke)&&pt.addIframe(t),ot(t,ke)&&ft.trackLinkElement(t),it(t)&&mt.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,e){pt.attachIframe(t,e),mt.observeAttachShadow(t)},onStylesheetLoad:function(t,e){ft.attachLinkElement(t,e)},keepIframeSrcFn:Z});if(!c)return console.warn("Failed to snapshot the document");ve(we({type:st.FullSnapshot,data:{node:c,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(e=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===e?void 0:e.scrollLeft)||(null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(o=null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.parentElement)||void 0===o?void 0:o.scrollTop)||(null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.scrollTop)||0}}})),Ct.forEach((function(t){return t.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ft.adoptStyleSheets(document.adoptedStyleSheets,ke.getId(document))};try{var vt=[];vt.push(Y("DOMContentLoaded",(function(){ve(we({type:st.DomContentLoaded,data:{}}))})));var yt=function(t){var e;return Yt({mutationCb:at,mousemoveCb:function(t,e){return ve(we({type:st.IncrementalSnapshot,data:{source:e,positions:t}}))},mouseInteractionCb:function(t){return ve(we({type:st.IncrementalSnapshot,data:Object.assign({source:ut.MouseInteraction},t)}))},scrollCb:ct,viewportResizeCb:function(t){return ve(we({type:st.IncrementalSnapshot,data:Object.assign({source:ut.ViewportResize},t)}))},inputCb:function(t){return ve(we({type:st.IncrementalSnapshot,data:Object.assign({source:ut.Input},t)}))},mediaInteractionCb:function(t){return ve(we({type:st.IncrementalSnapshot,data:Object.assign({source:ut.MediaInteraction},t)}))},styleSheetRuleCb:function(t){return ve(we({type:st.IncrementalSnapshot,data:Object.assign({source:ut.StyleSheetRule},t)}))},styleDeclarationCb:function(t){return ve(we({type:st.IncrementalSnapshot,data:Object.assign({source:ut.StyleDeclaration},t)}))},canvasMutationCb:lt,fontCb:function(t){return ve(we({type:st.IncrementalSnapshot,data:Object.assign({source:ut.Font},t)}))},selectionCb:function(t){ve(we({type:st.IncrementalSnapshot,data:Object.assign({source:ut.Selection},t)}))},blockClass:a,ignoreClass:l,maskTextClass:f,maskTextSelector:h,maskInputOptions:Q,inlineStylesheet:m,sampling:k,recordCanvas:R,inlineImages:W,userTriggeredOnInput:_,collectFonts:B,doc:t,maskInputFn:C,maskTextFn:b,keepIframeSrcFn:Z,blockSelector:u,slimDOMOptions:X,dataURLOptions:T,mirror:ke,iframeManager:pt,stylesheetManager:ft,shadowDomManager:mt,canvasManager:Ie,ignoreCSSAttributes:K,plugins:(null===(e=null==P?void 0:P.filter((function(t){return t.observer})))||void 0===e?void 0:e.map((function(t){return{observer:t.observer,options:t.options,callback:function(e){return ve(we({type:st.Plugin,data:{plugin:t.name,payload:e}}))}}})))||[]},S)};pt.addLoadListener((function(t){vt.push(yt(t.contentDocument))}));var It=function(){ye(),vt.push(yt(document)),Ae=!0};return"interactive"===document.readyState||"complete"===document.readyState?It():vt.push(Y("load",(function(){ve(we({type:st.Load,data:{}})),It()}),window)),function(){vt.forEach((function(t){return t()})),Ae=!1}}catch(t){console.warn(t)}}xe.addCustomEvent=function(t,e){if(!Ae)throw new Error("please add custom event after start recording");ve(we({type:st.Custom,data:{tag:t,payload:e}}))},xe.freezePage=function(){Ct.forEach((function(t){return t.freeze()}))},xe.takeFullSnapshot=function(t){if(!Ae)throw new Error("please take full snapshot after start recording");ye(t)},xe.mirror=ke;var Te=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},Ee=function(){var t,e,r;if(localStorage.getItem("rlog-deviceId"))return localStorage.getItem("rlog-deviceId");var n=(null===(t=localStorage)||void 0===t?void 0:t.getItem("utoken"))||(null===(e=localStorage)||void 0===e?void 0:e.getItem("IWP-iwp-deivceTag"))||Te();return null===(r=localStorage)||void 0===r||r.setItem("rlog-deviceId",n),n},Me=r(915),Re=r.n(Me),Oe=r(150),Ne=r.n(Oe),Le=function(){function t(){G()(this,t),Ne()(this,"storage",new Map)}var e,r;return V()(t,[{key:"push",value:(r=Re()(Qt()().mark((function t(e,r){return Qt()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.storage.has(e)||this.storage.set(e,[]),this.storage.get(e).push(r);case 2:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"pull",value:(e=Re()(Qt()().mark((function t(e,r){var n,o,i;return Qt()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.storage.get(e)||[],o=Math.min(r,n.length),i=n.slice(0,o),this.storage.set(e,n.slice(o)),t.abrupt("return",i);case 5:case"end":return t.stop()}}),t,this)}))),function(t,r){return e.apply(this,arguments)})}],[{key:"getInstance",value:function(){return t.instance||(t.instance=new t),t.instance}}]),t}();Ne()(Le,"instance",void 0);var Fe=function(){function t(){G()(this,t)}var e,r;return V()(t,[{key:"push",value:(r=Re()(Qt()().mark((function t(e,r){var n,o,i,a,s;return Qt()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,n="log_".concat(e),o=3;case 3:if(!(o-- >0)){t.next=17;break}if(i=localStorage.getItem(n),a=i?JSON.parse(i):[],s=a.length,a.push(r),localStorage.getItem(n)!==i){t.next=11;break}return localStorage.setItem(n,JSON.stringify(a)),t.abrupt("return");case 11:if(!(a.length>=s)){t.next=13;break}return t.abrupt("return");case 13:return t.next=15,new Promise((function(t){return setTimeout(t,50)}));case 15:t.next=3;break;case 17:throw new Error("Push operation failed due to concurrent modifications");case 20:return t.prev=20,t.t0=t.catch(0),console.warn("LocalStorage不可用,将使用内存缓存"),t.abrupt("return",Le.getInstance().push(e,r));case 24:case"end":return t.stop()}}),t,null,[[0,20]])}))),function(t,e){return r.apply(this,arguments)})},{key:"pull",value:(e=Re()(Qt()().mark((function t(e,r){var n,o,i,a,s;return Qt()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n="log_".concat(e),o=localStorage.getItem(n),i=o?JSON.parse(o):[],a=Math.min(r,i.length),s=i.slice(0,a),localStorage.setItem(n,JSON.stringify(i.slice(a))),t.abrupt("return",s);case 10:return t.prev=10,t.t0=t.catch(0),t.abrupt("return",Le.getInstance().pull(e,r));case 13:case"end":return t.stop()}}),t,null,[[0,10]])}))),function(t,r){return e.apply(this,arguments)})}]),t}(),_e=function(){function t(){G()(this,t),Ne()(this,"adapter",void 0),this.adapter=this.selectAdapter()}var e,r;return V()(t,[{key:"selectAdapter",value:function(){if(window.localStorage)try{var t="__storage_test";return window.localStorage.setItem(t,"test"),window.localStorage.removeItem(t),new Fe}catch(t){console.warn("LocalStorage不可用,降级使用内存缓存")}return Le.getInstance()}},{key:"push",value:(r=Re()(Qt()().mark((function t(e,r){return Qt()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.push(e,r));case 1:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"pull",value:(e=Re()(Qt()().mark((function t(e,r){return Qt()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.adapter.pull(e,r));case 1:case"end":return t.stop()}}),t,this)}))),function(t,r){return e.apply(this,arguments)})}]),t}(),De=new _e,Be=r(378),Ue=r.n(Be),We=["https://api.example.com","https://analytics.example.org"],Pe={},Ge=XMLHttpRequest.prototype.open,Ze=XMLHttpRequest.prototype.send,Ve=window.fetch;function Ye(t){We.splice.apply(We,[0,We.length].concat(W()(t)))}function Ke(t){Object.assign(Pe,t)}function je(t){return ze.apply(this,arguments)}function ze(){return ze=Re()(Qt()().mark((function t(e){var r,n=arguments;return Qt()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},t.abrupt("return",new Promise((function(t,n){var o=r.method,a=void 0===o?"GET":o,s=r.headers,u=void 0===s?{}:s,c=r.body,l=r.timeout,d=void 0===l?1e4:l,f=new XMLHttpRequest;f.timeout=d,f.onreadystatechange=function(){if(4===f.readyState){var e={ok:f.status>=200&&f.status<300,status:f.status,statusText:f.statusText,data:null,json:function(){return Promise.resolve(JSON.parse(f.responseText))},text:function(){return Promise.resolve(f.responseText)}};try{e.data=JSON.parse(f.responseText)}catch(t){e.data=f.responseText}e.ok?t(e):n(new Error("HTTP ".concat(f.status,": ").concat(f.statusText)))}},f.onerror=function(){n(new Error("Network error"))},f.ontimeout=function(){n(new Error("Request timeout"))},f.open(a,e,!0),Object.keys(u).forEach((function(t){f.setRequestHeader(t,u[t])})),c instanceof FormData?f.send(c):"object"===i()(c)?(f.setRequestHeader("Content-Type","application/json"),f.send(JSON.stringify(c))):f.send(c||null)})));case 2:case"end":return t.stop()}}),t)}))),ze.apply(this,arguments)}function Je(t){return Qe.apply(this,arguments)}function Qe(){return Qe=Re()(Qt()().mark((function t(e){var r,n=arguments;return Qt()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},t.abrupt("return",je(e,Ue()(Ue()({},r),{},{method:"GET"})));case 2:case"end":return t.stop()}}),t)}))),Qe.apply(this,arguments)}function He(t,e){return qe.apply(this,arguments)}function qe(){return qe=Re()(Qt()().mark((function t(e,r){var n,o=arguments;return Qt()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:{},t.abrupt("return",je(e,Ue()(Ue()({},n),{},{method:"POST",body:r})));case 2:case"end":return t.stop()}}),t)}))),qe.apply(this,arguments)}var Xe={enable:!0,samplingRate:15,uploadInterval:2e3,configUpdateInterval:3e5},$e=Ue()({},Xe);function tr(t){return er.apply(this,arguments)}function er(){return(er=Re()(Qt()().mark((function t(e){var r,n;return Qt()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Je(e);case 3:if((r=t.sent).ok){t.next=6;break}throw new Error("Failed to fetch config: ".concat(r.status));case 6:return n=r.data,t.abrupt("return",Ue()(Ue()({},Xe),n));case 10:return t.prev=10,t.t0=t.catch(0),console.warn("Failed to fetch config from CDN, using default config:",t.t0),t.abrupt("return",Ue()({},Xe));case 14:case"end":return t.stop()}}),t,null,[[0,10]])})))).apply(this,arguments)}function rr(t){$e=Ue()(Ue()({},$e),t)}function nr(){return Ue()({},$e)}function or(){return(or=Re()(Qt()().mark((function t(e){var r,n;return Qt()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=7;break}return t.next=3,tr(e);case 3:rr(r=t.sent),(n=r.configUpdateInterval||Xe.configUpdateInterval)&&setInterval(Re()(Qt()().mark((function t(){return Qt()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,tr(e);case 3:rr(t.sent),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.warn("Failed to update config from CDN:",t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])}))),n);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ir=null,ar=function(){var t=nr();if(t.enable){var e,r=Ee();ir=xe({emit:function(t){console.log("event",t),De.push(r,t)},recordCanvas:!0,sampling:{canvas:t.samplingRate},dataURLOptions:{type:"image/webp",quality:.6},collectFonts:!0,recordCrossOriginIframes:!0}),Ke({"rlog-deviceId":r}),Ye(["http://alipay-rmsdeploy-image.cn-hangzhou.alipay.aliyun-inc.com"]),e=xe,XMLHttpRequest.prototype.open=function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return this._rlogRequest={method:t,url:e.toString(),startTime:0,endTime:0},Ge.apply(this,[t,e,r,n,o])},XMLHttpRequest.prototype.send=function(t){var r=this,n=this._rlogRequest;return n.startTime=Date.now(),n.method,Object.entries(Pe).forEach((function(t){var e=B()(t,2),n=e[0],o=e[1];r.setRequestHeader(n,o)})),this.addEventListener("load",(function(){n.endTime=Date.now(),We.some((function(t){return n.url.startsWith(t)}))&&e.addCustomEvent("http-success",Ue()(Ue()({},n),{},{dur:n.endTime-n.startTime}))})),this.addEventListener("error",(function(){e.addCustomEvent("http-error",Ue()(Ue()({},n),{},{dur:n.endTime-n.startTime}))})),Ze.apply(this,[t])},window.fetch=function(){var t=Re()(Qt()().mark((function t(r,n){var o,i,a,s,u,c;return Qt()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=r instanceof Request?r.url:r.toString(),i=(null==n?void 0:n.method)||(r instanceof Request?r.method:"GET").toUpperCase(),a=Date.now(),t.prev=3,(s=Ue()({},n)).headers=Ue()(Ue()({},(null==n?void 0:n.headers)||{}),Pe),t.next=8,Ve(r,s);case 8:return u=t.sent,c=Date.now(),We.some((function(t){return o.startsWith(t)}))&&(console.log("[Fetch] ".concat(i," ").concat(o," - ").concat(c-a,"ms")),e.addCustomEvent("http-success",{url:o,method:i,dur:c-a})),t.abrupt("return",u);case 14:throw t.prev=14,t.t0=t.catch(3),console.error("[Fetch Error] ".concat(i," ").concat(o),t.t0),e.addCustomEvent("http-error",{url:o,method:i}),t.t0;case 19:case"end":return t.stop()}}),t,null,[[3,14]])})));return function(e,r){return t.apply(this,arguments)}}()}else console.log("RLog recording is disabled by config")},sr=function(){var t=nr().urlParamsToCache||["taskId"],e=new URLSearchParams(window.location.search);t.forEach((function(t){var r=e.get(t);r&&sessionStorage.setItem("rlog-".concat(t),r)}))},ur=function(t){return sessionStorage.getItem("rlog-".concat(t))},cr=function(){var t=Re()(Qt()().mark((function t(e){var r,n,o,i,a,s,u;return Qt()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return sr(),o={deviceId:e.deviceId,appId:e.appId,startTime:null===(r=e.data)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.timestamp,endTime:null===(n=e.data)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.timestamp},i=nr(),(i.urlParamsToCache||["taskId"]).forEach((function(t){var e=ur(t);e&&(o[t]=e)})),a=new URLSearchParams(o),s="".concat(e.url).concat(a?"?".concat(a):""),(u=new FormData).append("file",new Blob([JSON.stringify(e.data)]),Te()+".json"),t.next=11,He(s,u);case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();function lr(t,e,r){(function(t){return or.apply(this,arguments)})(r).then((function(){nr().enable?(ar(),function(t,e){var r=function(){var n=Re()(Qt()().mark((function n(){var o,i;return Qt()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if((o=nr()).enable){n.next=4;break}return console.log("RLog is disabled by config, stopping upload"),n.abrupt("return");case 4:return n.next=6,De.pull(Ee(),100);case 6:if((i=n.sent)&&0!==i.length){n.next=10;break}return setTimeout((function(){r()}),o.uploadInterval),n.abrupt("return");case 10:if(!sessionStorage.getItem("RLOG_CONSUME_ONLY")){n.next=14;break}console.log("RLog consume only mode, skip upload"),n.next=16;break;case 14:return n.next=16,cr({appId:e,data:i,deviceId:Ee(),url:t});case 16:setTimeout((function(){r()}),o.uploadInterval);case 17:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}();r()}(t,e)):console.log("RLog is disabled by config")})).catch((function(t){console.error("Failed to initialize RLog:",t)}))}function dr(t){return lr(t.serv,t.appId,t.cdnConfigUrl),{cancel:function(){}}}function fr(){ir&&ir()}function pr(t,e){xe.addCustomEvent(t,e)}}(),n}()}));
|
package/package.json
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antglobal/rlog-sdk",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"description": "",
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.1755855517-dev.0",
|
|
4
|
+
"description": "日志上报sdk",
|
|
5
|
+
"module": "dist/esm/index.js",
|
|
6
|
+
"types": "dist/esm/index.d.ts",
|
|
6
7
|
"scripts": {
|
|
7
|
-
"
|
|
8
|
+
"dev": "father dev",
|
|
9
|
+
"build": "father build",
|
|
10
|
+
"build:deps": "father prebundle"
|
|
8
11
|
},
|
|
9
12
|
"keywords": [],
|
|
10
|
-
"
|
|
11
|
-
|
|
13
|
+
"authors": [
|
|
14
|
+
"shican.lsc"
|
|
15
|
+
],
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"compiled"
|
|
20
|
+
],
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"father": "^4.5.6"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@rrweb/rrweb-plugin-console-record": "^2.0.0-alpha.18",
|
|
29
|
+
"rrweb": "^2.0.0-alpha.4"
|
|
30
|
+
}
|
|
12
31
|
}
|
package/LEGAL.md
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
Legal Disclaimer
|
|
2
|
-
|
|
3
|
-
Within this source code, the comments in Chinese shall be the original, governing version. Any comment in other languages are for reference only. In the event of any conflict between the Chinese language version comments and other language version comments, the Chinese language version shall prevail.
|
|
4
|
-
|
|
5
|
-
法律免责声明
|
|
6
|
-
|
|
7
|
-
关于代码注释部分,中文注释为官方版本,其它语言注释仅做参考。中文注释可能与其它语言注释存在不一致,当中文注释与其它语言注释存在不一致时,请以中文注释为准。
|