diff --git a/.gitignore b/.gitignore
index bb431f0d5..bc867a4b2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,6 +15,10 @@
*.iws
.idea/
+# nodejs modules
+lib/js_service_chainx/node_modules/
+lib/js_service_chainx/test/
+
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
diff --git a/README.md b/README.md
index aab588f81..195f3d1fe 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# polkawallet_plugin_kusama
+# polkawallet_plugin_chainx
-Basic plugin for polkawallet/app. Support Polkadot & Kusama.
+Basic plugin for polkawallet/app. Support ChainX.
## Getting Started
@@ -9,6 +9,6 @@ This project is a starting point for a Dart
a library module containing code that can be shared easily across
multiple Flutter or Dart projects.
-For help getting started with Flutter, view our
-[online documentation](https://flutter.dev/docs), which offers tutorials,
+For help getting started with Flutter, view our
+[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
diff --git a/assets/images/public/bg.png b/assets/images/public/bg.png
new file mode 100644
index 000000000..2968aef35
Binary files /dev/null and b/assets/images/public/bg.png differ
diff --git a/assets/images/public/chainx.png b/assets/images/public/chainx.png
new file mode 100644
index 000000000..984afe7e7
Binary files /dev/null and b/assets/images/public/chainx.png differ
diff --git a/assets/images/public/chainx_gray.png b/assets/images/public/chainx_gray.png
new file mode 100644
index 000000000..bf819b747
Binary files /dev/null and b/assets/images/public/chainx_gray.png differ
diff --git a/assets/images/public/governance_black.png b/assets/images/public/governance_black.png
deleted file mode 100644
index 039fd73f2..000000000
Binary files a/assets/images/public/governance_black.png and /dev/null differ
diff --git a/assets/images/public/governance_pink.png b/assets/images/public/governance_pink.png
deleted file mode 100755
index b498ed5a4..000000000
Binary files a/assets/images/public/governance_pink.png and /dev/null differ
diff --git a/assets/images/public/governance_yellow.png b/assets/images/public/governance_yellow.png
new file mode 100644
index 000000000..6eebe4f49
Binary files /dev/null and b/assets/images/public/governance_yellow.png differ
diff --git a/assets/images/public/kusama.png b/assets/images/public/kusama.png
deleted file mode 100644
index 00dd41637..000000000
Binary files a/assets/images/public/kusama.png and /dev/null differ
diff --git a/assets/images/public/kusama_gray.png b/assets/images/public/kusama_gray.png
deleted file mode 100644
index 457383fd2..000000000
Binary files a/assets/images/public/kusama_gray.png and /dev/null differ
diff --git a/assets/images/public/nav_governance.svg b/assets/images/public/nav_governance.svg
new file mode 100644
index 000000000..043ae8ec4
--- /dev/null
+++ b/assets/images/public/nav_governance.svg
@@ -0,0 +1,21 @@
+
+
\ No newline at end of file
diff --git a/assets/images/public/nav_staking.svg b/assets/images/public/nav_staking.svg
new file mode 100644
index 000000000..47db5381d
--- /dev/null
+++ b/assets/images/public/nav_staking.svg
@@ -0,0 +1,21 @@
+
+
\ No newline at end of file
diff --git a/assets/images/public/polkadot.png b/assets/images/public/polkadot.png
deleted file mode 100644
index 180bfe434..000000000
Binary files a/assets/images/public/polkadot.png and /dev/null differ
diff --git a/assets/images/public/polkadot_gray.png b/assets/images/public/polkadot_gray.png
deleted file mode 100644
index d228d8758..000000000
Binary files a/assets/images/public/polkadot_gray.png and /dev/null differ
diff --git a/assets/images/public/staking_black.png b/assets/images/public/staking_black.png
deleted file mode 100644
index d313d3cdc..000000000
Binary files a/assets/images/public/staking_black.png and /dev/null differ
diff --git a/assets/images/public/staking_pink.png b/assets/images/public/staking_pink.png
deleted file mode 100755
index 88aff3772..000000000
Binary files a/assets/images/public/staking_pink.png and /dev/null differ
diff --git a/assets/images/public/staking_yellow.png b/assets/images/public/staking_yellow.png
new file mode 100644
index 000000000..ede948157
Binary files /dev/null and b/assets/images/public/staking_yellow.png differ
diff --git a/assets/images/tokens/DOT.png b/assets/images/tokens/DOT.png
deleted file mode 100644
index 99062a8fe..000000000
Binary files a/assets/images/tokens/DOT.png and /dev/null differ
diff --git a/assets/images/tokens/KSM.png b/assets/images/tokens/KSM.png
deleted file mode 100644
index 00dd41637..000000000
Binary files a/assets/images/tokens/KSM.png and /dev/null differ
diff --git a/assets/images/tokens/PCX.png b/assets/images/tokens/PCX.png
new file mode 100644
index 000000000..83283e014
Binary files /dev/null and b/assets/images/tokens/PCX.png differ
diff --git a/example/README.md b/example/README.md
index 418ee4ae3..1bae4c547 100644
--- a/example/README.md
+++ b/example/README.md
@@ -1,6 +1,6 @@
# example
-polkawallet_plugin_kusama_example.
+polkawallet_plugin_chainx_example.
## Getting Started
diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle
index 6bc72ecd3..c5793f354 100644
--- a/example/android/app/build.gradle
+++ b/example/android/app/build.gradle
@@ -38,7 +38,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
- applicationId "io.polkawallet.www.plugin.kusama.example"
+ applicationId "io.polkawallet.www.plugin.chainx.example"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml
index 3e6be215c..1c291d063 100644
--- a/example/android/app/src/debug/AndroidManifest.xml
+++ b/example/android/app/src/debug/AndroidManifest.xml
@@ -1,5 +1,5 @@
+ package="io.polkawallet.www.plugin.chainx.example">
diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml
index 1761d237d..c54b88977 100644
--- a/example/android/app/src/main/AndroidManifest.xml
+++ b/example/android/app/src/main/AndroidManifest.xml
@@ -1,5 +1,5 @@
+ package="io.polkawallet.www.plugin.chainx.example">
diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj
index 9e2c905ba..fa5df0cf8 100644
--- a/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/example/ios/Runner.xcodeproj/project.pbxproj
@@ -299,7 +299,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.www.plugin.kusama.example;
+ PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.www.plugin.chainx.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
@@ -431,7 +431,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.www.plugin.kusama.example;
+ PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.www.plugin.chainx.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -458,7 +458,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.www.plugin.kusama.example;
+ PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.www.plugin.chainx.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
diff --git a/example/lib/main.dart b/example/lib/main.dart
index c64e54f76..24cf7f2f8 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -1,17 +1,17 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
-import 'package:polkawallet_plugin_kusama_example/pages/assetsContent.dart';
-import 'package:polkawallet_plugin_kusama_example/pages/profileContent.dart';
-import 'package:polkawallet_plugin_kusama_example/pages/selectListPage.dart';
+import 'package:polkawallet_plugin_chainx_example/pages/assetsContent.dart';
+import 'package:polkawallet_plugin_chainx_example/pages/profileContent.dart';
+import 'package:polkawallet_plugin_chainx_example/pages/selectListPage.dart';
import 'package:polkawallet_sdk/api/types/networkParams.dart';
import 'package:polkawallet_sdk/plugin/index.dart';
import 'package:polkawallet_sdk/storage/keyring.dart';
import 'package:polkawallet_sdk/storage/types/keyPairData.dart';
import 'package:polkawallet_sdk/utils/i18n.dart';
-import 'package:polkawallet_plugin_kusama/polkawallet_plugin_kusama.dart';
-import 'package:polkawallet_plugin_kusama_example/pages/homePage.dart';
+import 'package:polkawallet_plugin_chainx/polkawallet_plugin_chainx.dart';
+import 'package:polkawallet_plugin_chainx_example/pages/homePage.dart';
import 'package:polkawallet_ui/components/passwordInputDialog.dart';
import 'package:polkawallet_ui/pages/accountListPage.dart';
import 'package:polkawallet_ui/pages/qrSenderPage.dart';
@@ -20,8 +20,7 @@ import 'package:polkawallet_ui/pages/txConfirmPage.dart';
void main() {
final _plugins = [
- PluginKusama(name: 'polkadot'),
- PluginKusama(),
+ PluginChainX(),
];
runApp(MyApp(_plugins));
@@ -171,7 +170,7 @@ class _MyAppState extends State {
_changeLang);
final AssetsContent assets = AssetsContent(_network, _keyring);
return MaterialApp(
- title: 'Polkawallet Plugin Kusama Demo',
+ title: 'Polkawallet Plugin ChainX Demo',
theme: _theme ?? _getAppTheme(widget.plugins[0].basic.primaryColor),
localizationsDelegates: [
AppLocalizationsDelegate(_locale ?? Locale('en', '')),
diff --git a/example/lib/pages/assetsContent.dart b/example/lib/pages/assetsContent.dart
index 4ee3f1a58..8b5d74ef6 100644
--- a/example/lib/pages/assetsContent.dart
+++ b/example/lib/pages/assetsContent.dart
@@ -22,14 +22,12 @@ class AssetsContent extends StatefulWidget {
}
class _AssetsContentState extends State {
- bool _loading = false;
-
@override
Widget build(BuildContext context) {
return Observer(
builder: (_) {
- final symbol = (widget.network.networkState.tokenSymbol ?? [''])[0];
- final decimals = (widget.network.networkState.tokenDecimals ?? [12])[0];
+ final symbol = (widget.network.networkState.tokenSymbol ?? ['PCX'])[0];
+ final decimals = (widget.network.networkState.tokenDecimals ?? [8])[0];
final balancesInfo = widget.network.balances.native;
final tokens = widget.network.balances.tokens;
@@ -46,9 +44,8 @@ class _AssetsContentState extends State {
children: [
Text('address'),
Text(widget.keyring.current.address ?? ''),
- Text(
- 'decimals: ${widget.network.networkState.tokenDecimals}'),
- Text('symbol: ${widget.network.networkState.tokenSymbol}'),
+ Text('decimals: $decimals'),
+ Text('symbol: $symbol'),
],
),
),
@@ -83,16 +80,8 @@ class _AssetsContentState extends State {
),
title: Text(symbol),
trailing: Text(
- Fmt.priceFloorBigInt(
- balancesInfo != null
- ? Fmt.balanceTotal(balancesInfo)
- : BigInt.zero,
- decimals,
- lengthFixed: 3),
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 20,
- color: Colors.black54),
+ Fmt.priceFloorBigInt(balancesInfo != null ? Fmt.balanceTotal(balancesInfo) : BigInt.zero, decimals, lengthFixed: 3),
+ style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: Colors.black54),
),
// onTap: () {
// Navigator.pushNamed(context, AssetPage.route);
@@ -130,8 +119,7 @@ class _AssetsContentState extends State {
e,
decimals,
detailPageRoute: e.detailPageRoute,
- icon:
- widget.network.tokenIcons[e.symbol],
+ icon: widget.network.tokenIcons[e.symbol],
))
.toList(),
)
@@ -170,16 +158,13 @@ class TokenItem extends StatelessWidget {
),
title: Text(item.name),
trailing: Text(
- Fmt.priceFloorBigInt(Fmt.balanceInt(item.amount), decimals,
- lengthFixed: 3),
- style: TextStyle(
- fontWeight: FontWeight.bold, fontSize: 20, color: Colors.black54),
+ Fmt.priceFloorBigInt(Fmt.balanceInt(item.amount), decimals, lengthFixed: 3),
+ style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: Colors.black54),
),
onTap: detailPageRoute == null
? null
: () {
- Navigator.of(context)
- .pushNamed(detailPageRoute, arguments: item);
+ Navigator.of(context).pushNamed(detailPageRoute, arguments: item);
},
),
);
diff --git a/example/lib/pages/profileContent.dart b/example/lib/pages/profileContent.dart
index 7ca2f20b3..27556bdf0 100644
--- a/example/lib/pages/profileContent.dart
+++ b/example/lib/pages/profileContent.dart
@@ -1,7 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
-import 'package:polkawallet_plugin_kusama_example/pages/selectListPage.dart';
-import 'package:polkawallet_plugin_kusama_example/utils/i18n.dart';
+import 'package:polkawallet_plugin_chainx_example/pages/selectListPage.dart';
+import 'package:polkawallet_plugin_chainx_example/utils/i18n.dart';
import 'package:polkawallet_sdk/utils/i18n.dart';
import 'package:polkawallet_sdk/api/types/networkParams.dart';
import 'package:polkawallet_sdk/api/apiKeyring.dart';
@@ -62,11 +62,9 @@ class _ProfileContentState extends State {
child: CupertinoPicker(
backgroundColor: Colors.white,
itemExtent: 58,
- scrollController: FixedExtentScrollController(
- initialItem: _langOptions.indexOf(langCurrent)),
+ scrollController: FixedExtentScrollController(initialItem: _langOptions.indexOf(langCurrent)),
children: _langOptions.map((i) {
- return Padding(
- padding: EdgeInsets.all(16), child: Text(_getLang(i)));
+ return Padding(padding: EdgeInsets.all(16), child: Text(_getLang(i)));
}).toList(),
onSelectedItemChanged: (v) {
setState(() {
@@ -89,10 +87,7 @@ class _ProfileContentState extends State {
}
Future _onChangeNetwork() async {
- final selected = await Navigator.of(context).pushNamed(SelectListPage.route,
- arguments: widget.plugins
- .map((e) => ListItemData(title: e.basic.name, subtitle: ''))
- .toList());
+ final selected = await Navigator.of(context).pushNamed(SelectListPage.route, arguments: widget.plugins.map((e) => ListItemData(title: e.basic.name, subtitle: '')).toList());
if (selected != null) {
final net = widget.plugins[selected];
if (net.basic.name != widget.network.basic.name) {
@@ -102,8 +97,7 @@ class _ProfileContentState extends State {
widget.setNetwork(net);
/// we reuse the existing webView instance when we start a new plugin.
- await net.beforeStart(widget.keyring,
- webView: widget.network.sdk.webView);
+ await net.beforeStart(widget.keyring, webView: widget.network.sdk.webView);
final res = await net.start(widget.keyring);
widget.setConnectedNode(res);
widget.keyring.setSS58(res.ss58);
@@ -112,17 +106,13 @@ class _ProfileContentState extends State {
}
Future _onChangeNode() async {
- final selected = await Navigator.of(context).pushNamed(SelectListPage.route,
- arguments: widget.network.nodeList
- .map((e) => ListItemData(title: e.name, subtitle: e.endpoint))
- .toList());
+ final selected = await Navigator.of(context).pushNamed(SelectListPage.route, arguments: widget.network.nodeList.map((e) => ListItemData(title: e.name, subtitle: e.endpoint)).toList());
if (selected != null) {
if (widget.connectedNode != null) {
widget.setConnectedNode(null);
}
final node = widget.network.nodeList[selected];
- final res =
- await widget.network.sdk.api.connectNode(widget.keyring, [node]);
+ final res = await widget.network.sdk.api.connectNode(widget.keyring, [node]);
widget.setConnectedNode(res);
}
}
@@ -132,8 +122,7 @@ class _ProfileContentState extends State {
setState(() {
_loading = true;
});
- await widget.keyring.store
- .deleteAccount(widget.keyring.keyPairs[0].pubKey);
+ await widget.keyring.store.deleteAccount(widget.keyring.keyPairs[0].pubKey);
setState(() {
_loading = false;
});
@@ -175,8 +164,7 @@ class _ProfileContentState extends State {
setState(() {
_loading = true;
});
- await widget.keyring.store
- .deleteAccount(widget.keyring.externals[0].pubKey);
+ await widget.keyring.store.deleteAccount(widget.keyring.externals[0].pubKey);
setState(() {
_loading = false;
});
@@ -188,8 +176,7 @@ class _ProfileContentState extends State {
setState(() {
_loading = true;
});
- final KeyPairData acc =
- await widget.network.sdk.api.keyring.addContact(widget.keyring, {
+ final KeyPairData acc = await widget.network.sdk.api.keyring.addContact(widget.keyring, {
'name': 'external_test',
'address': '14fpQHev6kcQxiW49e5Cg4VgY8QeKwLxwfbAHg81ro8r8AnD',
'observation': true,
@@ -204,6 +191,9 @@ class _ProfileContentState extends State {
@override
Widget build(BuildContext context) {
+ final symbol = (widget.network.networkState.tokenSymbol ?? ['PCX'])[0];
+ final decimals = (widget.network.networkState.tokenDecimals ?? [8])[0];
+
return ListView(
children: [
ListTile(
@@ -230,28 +220,19 @@ class _ProfileContentState extends State {
Column(
children: [
Text('network state'),
- Text('tokenSymbol: ${widget.network.networkState.tokenSymbol[0]}'),
- Text(
- 'tokenDecimals: ${widget.network.networkState.tokenDecimals[0]}'),
+ Text('tokenSymbol: $symbol'),
+ Text('tokenDecimals: $decimals'),
],
),
Divider(),
Column(
children: [
Text('keyPairs:'),
- Text(widget.keyring.keyPairs
- .map((e) => e.address)
- .toList()
- .join(',')),
+ Text(widget.keyring.keyPairs.map((e) => e.address).toList().join(',')),
Text('externals:'),
- Text(widget.keyring.externals
- .map((e) => e.address)
- .toList()
- .join(',')),
+ Text(widget.keyring.externals.map((e) => e.address).toList().join(',')),
RoundedButton(
- text: widget.keyring.keyPairs.length > 0
- ? 'Remove Account'
- : 'Import Account',
+ text: widget.keyring.keyPairs.length > 0 ? 'Remove Account' : 'Import Account',
onPressed: _loading
? null
: widget.keyring.keyPairs.length > 0
@@ -259,9 +240,7 @@ class _ProfileContentState extends State {
: () => _importAccount(),
),
RoundedButton(
- text: widget.keyring.externals.length > 0
- ? 'Remove External'
- : 'Import External',
+ text: widget.keyring.externals.length > 0 ? 'Remove External' : 'Import External',
onPressed: _loading
? null
: widget.keyring.externals.length > 0
diff --git a/example/lib/pages/tx.dart b/example/lib/pages/tx.dart
index 33180bd07..ecec691f5 100644
--- a/example/lib/pages/tx.dart
+++ b/example/lib/pages/tx.dart
@@ -2,12 +2,12 @@ import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
-import 'package:polkawallet_plugin_kusama/polkawallet_plugin_kusama.dart';
+import 'package:polkawallet_plugin_chainx/polkawallet_plugin_chainx.dart';
class NetworkSelectPage extends StatefulWidget {
NetworkSelectPage(this.network);
- final PluginKusama network;
+ final PluginChainX network;
static const String route = '/tx';
diff --git a/example/lib/utils/i18n.dart b/example/lib/utils/i18n.dart
index ba8077048..2968d527f 100644
--- a/example/lib/utils/i18n.dart
+++ b/example/lib/utils/i18n.dart
@@ -1,4 +1,4 @@
-import 'package:polkawallet_plugin_kusama_example/utils/i18n/profile.dart';
+import 'package:polkawallet_plugin_chainx_example/utils/i18n/profile.dart';
const Map>> i18n_full_dic = {
'en': {
diff --git a/example/pubspec.lock b/example/pubspec.lock
index b4dd67225..4a3840c28 100644
--- a/example/pubspec.lock
+++ b/example/pubspec.lock
@@ -1,13 +1,20 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
+ auth_header:
+ dependency: transitive
+ description:
+ name: auth_header
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.4"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
- version: "1.1.0-nullsafety.3"
+ version: "1.1.0"
charcode:
dependency: transitive
description:
@@ -15,13 +22,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
+ clock:
+ dependency: transitive
+ description:
+ name: clock
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
- version: "1.15.0-nullsafety.3"
+ version: "1.15.0"
convert:
dependency: transitive
description:
@@ -29,6 +43,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
+ crypto:
+ dependency: transitive
+ description:
+ name: crypto
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.5"
cupertino_icons:
dependency: "direct main"
description:
@@ -42,7 +63,7 @@ packages:
name: dropdown_search
url: "https://pub.dartlang.org"
source: hosted
- version: "0.4.8"
+ version: "0.4.9"
ffi:
dependency: transitive
description:
@@ -56,7 +77,7 @@ packages:
name: file
url: "https://pub.dartlang.org"
source: hosted
- version: "5.2.1"
+ version: "6.1.0"
flutter:
dependency: "direct main"
description: flutter
@@ -103,7 +124,7 @@ packages:
name: flutter_svg
url: "https://pub.dartlang.org"
source: hosted
- version: "0.18.1"
+ version: "0.19.3"
flutter_web_plugins:
dependency: transitive
description: flutter
@@ -144,6 +165,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.4"
+ http_server:
+ dependency: transitive
+ description:
+ name: http_server
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.9.8+3"
image_picker:
dependency: transitive
description:
@@ -164,7 +192,42 @@ packages:
name: intl
url: "https://pub.dartlang.org"
source: hosted
- version: "0.16.1"
+ version: "0.17.0"
+ jaguar:
+ dependency: transitive
+ description:
+ name: jaguar
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.4.46"
+ jaguar_common:
+ dependency: transitive
+ description:
+ name: jaguar_common
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.4"
+ jaguar_flutter_asset:
+ dependency: transitive
+ description:
+ name: jaguar_flutter_asset
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.2.0"
+ jaguar_serializer:
+ dependency: transitive
+ description:
+ name: jaguar_serializer
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.2.12"
+ js:
+ dependency: transitive
+ description:
+ name: js
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.6.3"
json_annotation:
dependency: transitive
description:
@@ -172,13 +235,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.1"
+ logging:
+ dependency: transitive
+ description:
+ name: logging
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.11.4"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
- version: "1.3.0-nullsafety.3"
+ version: "1.3.0"
+ mime:
+ dependency: transitive
+ description:
+ name: mime
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.9.7"
mobx:
dependency: transitive
description:
@@ -192,7 +269,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
- version: "1.8.0-nullsafety.1"
+ version: "1.8.0"
path_drawing:
dependency: transitive
description:
@@ -242,6 +319,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4+3"
+ path_tree:
+ dependency: transitive
+ description:
+ name: path_tree
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.2.4"
pedantic:
dependency: transitive
description:
@@ -276,7 +360,7 @@ packages:
name: platform
url: "https://pub.dartlang.org"
source: hosted
- version: "2.2.1"
+ version: "3.0.0"
plugin_platform_interface:
dependency: transitive
description:
@@ -284,7 +368,7 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
- polkawallet_plugin_kusama:
+ polkawallet_plugin_chainx:
dependency: "direct dev"
description:
path: ".."
@@ -297,23 +381,23 @@ packages:
name: polkawallet_sdk
url: "https://pub.dartlang.org"
source: hosted
- version: "0.1.0"
+ version: "0.1.6"
polkawallet_ui:
dependency: "direct main"
description:
path: "."
- ref: "9ff8f1ebbaad3bbda904756f650414cf7cfe3163"
- resolved-ref: "9ff8f1ebbaad3bbda904756f650414cf7cfe3163"
+ ref: c4346ecf37f277d6b61480f4782a9e78c99c68e2
+ resolved-ref: c4346ecf37f277d6b61480f4782a9e78c99c68e2
url: "https://github.com/polkawallet-io/ui.git"
source: git
- version: "0.0.2"
+ version: "0.1.4"
process:
dependency: transitive
description:
name: process
url: "https://pub.dartlang.org"
source: hosted
- version: "3.0.13"
+ version: "4.2.1"
qr:
dependency: transitive
description:
@@ -384,6 +468,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
+ stack_trace:
+ dependency: transitive
+ description:
+ name: stack_trace
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.9.6"
string_scanner:
dependency: transitive
description:
@@ -404,7 +495,7 @@ packages:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
- version: "1.3.0-nullsafety.3"
+ version: "1.3.0"
url_launcher:
dependency: transitive
description:
@@ -453,7 +544,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
- version: "2.1.0-nullsafety.3"
+ version: "2.1.0"
webview_flutter:
dependency: transitive
description:
@@ -483,5 +574,5 @@ packages:
source: hosted
version: "4.5.1"
sdks:
- dart: ">=2.10.0 <2.11.0"
- flutter: ">=1.22.0 <2.0.0"
+ dart: ">=2.12.0-0 <3.0.0"
+ flutter: ">=1.24.0-10.1.pre"
diff --git a/example/pubspec.yaml b/example/pubspec.yaml
index 1947325f9..e7d61c443 100644
--- a/example/pubspec.yaml
+++ b/example/pubspec.yaml
@@ -1,9 +1,9 @@
-name: polkawallet_plugin_kusama_example
-description: polkawallet_plugin_kusama_example.
+name: polkawallet_plugin_chainx_example
+description: polkawallet_plugin_chainx_example.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
-publish_to: 'none' # Remove this line if you wish to publish to pub.dev
+publish_to: "none" # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
@@ -29,15 +29,15 @@ dependencies:
polkawallet_ui:
git:
url: https://github.com/polkawallet-io/ui.git
- ref: 9ff8f1ebbaad3bbda904756f650414cf7cfe3163
-# path: ../../ui
+ ref: c4346ecf37f277d6b61480f4782a9e78c99c68e2
+ # path: ../../ui
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.0
dev_dependencies:
- polkawallet_plugin_kusama:
+ polkawallet_plugin_chainx:
path: ../
# For information on the generic Dart part of this file, see the
@@ -45,7 +45,6 @@ dev_dependencies:
# The following section is specific to Flutter.
flutter:
-
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
diff --git a/lib/common/components/UI.dart b/lib/common/components/UI.dart
new file mode 100644
index 000000000..4aa3e54b6
--- /dev/null
+++ b/lib/common/components/UI.dart
@@ -0,0 +1,119 @@
+import 'dart:async';
+
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:polkawallet_sdk/storage/types/keyPairData.dart';
+import 'package:polkawallet_sdk/utils/i18n.dart';
+import 'package:polkawallet_ui/utils/format.dart';
+import 'package:polkawallet_ui/utils/i18n.dart';
+import 'package:polkawallet_ui/utils/numberInputFormatter.dart';
+import 'package:url_launcher/url_launcher.dart';
+
+class UI {
+ static void copyAndNotify(BuildContext context, String text) {
+ Clipboard.setData(ClipboardData(text: text ?? ''));
+
+ showCupertinoDialog(
+ context: context,
+ builder: (BuildContext context) {
+ final Map dic = I18n.of(context).getDic(i18n_full_dic_ui, 'common');
+ return CupertinoAlertDialog(
+ title: Container(),
+ content: Text('${dic['copy']} ${dic['success']}'),
+ );
+ },
+ );
+
+ Timer(Duration(seconds: 2), () {
+ Navigator.of(context).pop();
+ });
+ }
+
+ static String accountName(BuildContext context, KeyPairData acc) {
+ return '${acc.name ?? accountDisplayNameString(acc.address, acc.indexInfo)}${(acc.observation ?? false) ? ' (${I18n.of(context).getDic(i18n_full_dic_ui, 'account')['observe']})' : ''}';
+ }
+
+ static Widget accountDisplayName(
+ String address,
+ Map accInfo, {
+ bool expand = true,
+ }) {
+ bool hasId = false;
+ bool good = false;
+ if (accInfo != null) {
+ if (accInfo['identity']['display'] != null) {
+ hasId = true;
+ }
+ if (accInfo['identity']['judgements'].length > 0) {
+ final judgement = accInfo['identity']['judgements'][0][1];
+ if (Map.of(judgement).keys.contains('knownGood') || Map.of(judgement).keys.contains('reasonable')) {
+ good = true;
+ }
+ }
+ }
+ return Row(
+ children: [
+ hasId
+ ? Container(
+ width: 14,
+ margin: EdgeInsets.only(right: 4),
+ child: good
+ ? Icon(
+ Icons.check_circle,
+ size: 16,
+ color: Colors.lightGreen,
+ )
+ : Icon(
+ Icons.remove_circle,
+ size: 16,
+ color: Colors.black12,
+ ),
+ )
+ : Container(width: 1, height: 2),
+ expand
+ ? Expanded(
+ child: Text(accountDisplayNameString(address, accInfo), overflow: TextOverflow.ellipsis),
+ )
+ : Text(accountDisplayNameString(address, accInfo), overflow: TextOverflow.ellipsis)
+ ],
+ );
+ }
+
+ static String accountDisplayNameString(String address, Map accInfo) {
+ String display = Fmt.address(address, pad: 6);
+ if (accInfo != null) {
+ if (accInfo['referralId'] != null) {
+ display = accInfo['referralId'];
+ } else {
+ if (accInfo['identity']['display'] != null) {
+ display = accInfo['identity']['display'];
+ if (accInfo['identity']['displayParent'] != null) {
+ display = '${accInfo['identity']['displayParent']}/$display';
+ }
+ } else if (accInfo['accountIndex'] != null) {
+ display = accInfo['accountIndex'];
+ }
+ }
+
+ display = display.toUpperCase();
+ }
+ return display;
+ }
+
+ static TextInputFormatter decimalInputFormatter(int decimals) {
+ return NumberInputFormatter.withRegex('^[0-9]{0,$decimals}((\\.|,)[0-9]{0,$decimals})?\$');
+ }
+
+ static Future launchURL(String url) async {
+ if (await canLaunch(url)) {
+ try {
+ await launch(url);
+ } catch (err) {
+ print(err);
+ }
+ } else {
+ print('Could not launch $url');
+ }
+ }
+}
diff --git a/lib/common/components/pageTitleTaps.dart b/lib/common/components/pageTitleTaps.dart
new file mode 100644
index 000000000..7c4120018
--- /dev/null
+++ b/lib/common/components/pageTitleTaps.dart
@@ -0,0 +1,48 @@
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+
+class PageTitleTabs extends StatelessWidget {
+ PageTitleTabs({this.names, this.activeTab, this.onTab});
+
+ final List names;
+ final Function(int) onTab;
+ final int activeTab;
+
+ @override
+ Widget build(BuildContext context) {
+ return Row(
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
+ children: names.map(
+ (title) {
+ int index = names.indexOf(title);
+ return GestureDetector(
+ child: Column(
+ children: [
+ Container(
+ width: 160,
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text(
+ title,
+ style: TextStyle(fontSize: 16, color: activeTab == index ? Theme.of(context).cardColor : Colors.white70, fontWeight: FontWeight.w500),
+ )
+ ],
+ ),
+ ),
+ Container(
+ height: 12,
+ width: 32,
+ decoration: BoxDecoration(
+ border: Border(bottom: BorderSide(width: activeTab == index ? 3 : 0, color: Colors.white)),
+ ),
+ )
+ ],
+ ),
+ onTap: () => onTab(index),
+ );
+ },
+ ).toList(),
+ );
+ }
+}
diff --git a/lib/common/components/topTabs.dart b/lib/common/components/topTabs.dart
new file mode 100644
index 000000000..be0040b4b
--- /dev/null
+++ b/lib/common/components/topTabs.dart
@@ -0,0 +1,48 @@
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+
+class TopTabs extends StatelessWidget {
+ TopTabs({this.names, this.activeTab, this.onTab});
+
+ final List names;
+ final Function(int) onTab;
+ final int activeTab;
+
+ @override
+ Widget build(BuildContext context) {
+ return Row(
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
+ children: names.map(
+ (title) {
+ int index = names.indexOf(title);
+ return GestureDetector(
+ child: Column(
+ children: [
+ Container(
+ width: 150,
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text(
+ title,
+ style: TextStyle(fontSize: 18, color: activeTab == index ? Theme.of(context).cardColor : Colors.white70, fontWeight: FontWeight.w500),
+ )
+ ],
+ ),
+ ),
+ Container(
+ height: 12,
+ width: 32,
+ decoration: BoxDecoration(
+ border: Border(bottom: BorderSide(width: activeTab == index ? 3 : 0, color: Colors.white)),
+ ),
+ )
+ ],
+ ),
+ onTap: () => onTab(index),
+ );
+ },
+ ).toList(),
+ );
+ }
+}
diff --git a/lib/common/constants.dart b/lib/common/constants.dart
index b200543db..ea28c2895 100644
--- a/lib/common/constants.dart
+++ b/lib/common/constants.dart
@@ -3,78 +3,36 @@ import 'package:flutter/material.dart';
const int SECONDS_OF_DAY = 24 * 60 * 60; // seconds of one day
const int SECONDS_OF_YEAR = 365 * 24 * 60 * 60; // seconds of one year
-const node_list_kusama = [
+const node_list_chainx = [
{
- 'name': 'Kusama (Polkadot Canary, hosted by PatractLabs)',
- 'ss58': 2,
- 'endpoint': 'wss://kusama.elara.patract.io',
+ 'name': 'ChainX (Elena Node)',
+ 'ss58': 44,
+ 'endpoint': 'wss://chainx.elara.patract.io',
},
{
- 'name': 'Kusama (Polkadot Canary, hosted by Polkawallet)',
- 'ss58': 2,
- 'endpoint': 'wss://kusama-1.polkawallet.io:9944/',
- },
- {
- 'name': 'Kusama (Polkadot Canary, hosted by Polkawallet Asia)',
- 'ss58': 2,
- 'endpoint': 'wss://kusama-2.polkawallet.io/',
- },
- {
- 'name': 'Kusama (Polkadot Canary, hosted by Parity)',
- 'ss58': 2,
- 'endpoint': 'wss://kusama-rpc.polkadot.io/',
- },
- {
- 'name': 'Kusama (Polkadot Canary, hosted by onfinality)',
- 'ss58': 2,
- 'endpoint': 'wss://kusama.api.onfinality.io/public-ws',
+ 'name': 'ChainX (Overseas Node)',
+ 'ss58': 44,
+ 'endpoint': 'wss://mainnet.chainx.org/ws',
},
];
-const node_list_polkadot = [
- {
- 'name': 'Polkadot (Live, hosted by PatractLabs)',
- 'ss58': 0,
- 'endpoint': 'wss://polkadot.elara.patract.io',
- },
- {
- 'name': 'Polkadot (Live, hosted by Polkawallet CN)',
- 'ss58': 0,
- 'endpoint': 'wss://polkadot-1.polkawallet.io:9944',
- },
- {
- 'name': 'Polkadot (Live, hosted by Polkawallet EU)',
- 'ss58': 0,
- 'endpoint': 'wss://polkadot-2.polkawallet.io',
- },
- {
- 'name': 'Polkadot (Live, hosted by Parity)',
- 'ss58': 0,
- 'endpoint': 'wss://rpc.polkadot.io',
- },
- {
- 'name': 'Polkadot (Live, hosted by onfinality)',
- 'ss58': 0,
- 'endpoint': 'wss://polkadot.api.onfinality.io/public-ws',
- },
-];
-
const home_nav_items = ['staking', 'governance'];
-const MaterialColor kusama_black = const MaterialColor(
- 0xFF222222,
+const MaterialColor chainx_yellow = const MaterialColor(
+ 0xFFF6C94A,
const {
- 50: const Color(0xFF555555),
- 100: const Color(0xFF444444),
- 200: const Color(0xFF444444),
- 300: const Color(0xFF333333),
- 400: const Color(0xFF333333),
- 500: const Color(0xFF222222),
- 600: const Color(0xFF111111),
- 700: const Color(0xFF111111),
- 800: const Color(0xFF000000),
- 900: const Color(0xFF000000),
+ 50: const Color(0xFFFBE8B1),
+ 100: const Color(0xFFFAE29E),
+ 200: const Color(0xFFF9DC8A),
+ 300: const Color(0xFFF9D677),
+ 400: const Color(0xFFF8D063),
+ 500: const Color(0xFFF6C94A),
+ 600: const Color(0xFFF6C43C),
+ 700: const Color(0xFFF5BE29),
+ 800: const Color(0xFFF4B915),
+ 900: const Color(0xFFEAAE0B),
},
);
-const String network_name_kusama = 'kusama';
-const String network_name_polkadot = 'polkadot';
+const String network_name_chainx = 'chainx';
+
+const chainx_genesis_hash = '0x012cfb6997279fed8ff754a5a90cb30627c70fcdd79ee9c480bcef07de754810';
diff --git a/lib/js_service_chainx/.babelrc b/lib/js_service_chainx/.babelrc
new file mode 100644
index 000000000..c81463dd1
--- /dev/null
+++ b/lib/js_service_chainx/.babelrc
@@ -0,0 +1,3 @@
+{
+ "presets": [["@babel/preset-env", { "modules": false }], "@babel/preset-typescript"]
+}
diff --git a/lib/js_service_chainx/dist/index.html b/lib/js_service_chainx/dist/index.html
new file mode 100644
index 000000000..899c17d0b
--- /dev/null
+++ b/lib/js_service_chainx/dist/index.html
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/lib/js_service_chainx/dist/main.js b/lib/js_service_chainx/dist/main.js
new file mode 100644
index 000000000..c153b8bd7
--- /dev/null
+++ b/lib/js_service_chainx/dist/main.js
@@ -0,0 +1,37 @@
+!function(A){var e={};function t(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return A[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=A,t.c=e,t.d=function(A,e,i){t.o(A,e)||Object.defineProperty(A,e,{enumerable:!0,get:i})},t.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},t.t=function(A,e){if(1&e&&(A=t(A)),8&e)return A;if(4&e&&"object"==typeof A&&A&&A.__esModule)return A;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:A}),2&e&&"string"!=typeof A)for(var r in A)t.d(i,r,function(e){return A[e]}.bind(null,r));return i},t.n=function(A){var e=A&&A.__esModule?function(){return A.default}:function(){return A};return t.d(e,"a",e),e},t.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},t.p="",t(t.s=1715)}([function(A,e){A.exports=function(A){return A&&A.__esModule?A:{default:A}},A.exports.default=A.exports,A.exports.__esModule=!0},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={assert:!0,assertReturn:!0,detectPackage:!0,extractTime:!0,logger:!0,promisify:!0};Object.defineProperty(e,"assert",{enumerable:!0,get:function(){return r.assert}}),Object.defineProperty(e,"assertReturn",{enumerable:!0,get:function(){return r.assertReturn}}),Object.defineProperty(e,"detectPackage",{enumerable:!0,get:function(){return n.detectPackage}}),Object.defineProperty(e,"extractTime",{enumerable:!0,get:function(){return o.extractTime}}),Object.defineProperty(e,"logger",{enumerable:!0,get:function(){return a.logger}}),Object.defineProperty(e,"promisify",{enumerable:!0,get:function(){return s.promisify}});var r=t(143),n=t(857),o=t(858),a=t(859),s=t(874),c=t(875);Object.keys(c).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(i,A)||A in e&&e[A]===c[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return c[A]}}))}));var g=t(436);Object.keys(g).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(i,A)||A in e&&e[A]===g[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return g[A]}}))}));var f=t(890);Object.keys(f).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(i,A)||A in e&&e[A]===f[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return f[A]}}))}));var u=t(891);Object.keys(u).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(i,A)||A in e&&e[A]===u[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return u[A]}}))}));var h=t(894);Object.keys(h).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(i,A)||A in e&&e[A]===h[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return h[A]}}))}));var d=t(898);Object.keys(d).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(i,A)||A in e&&e[A]===d[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return d[A]}}))}));var B=t(432);Object.keys(B).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(i,A)||A in e&&e[A]===B[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return B[A]}}))}));var l=t(901);Object.keys(l).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(i,A)||A in e&&e[A]===l[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return l[A]}}))}));var I=t(903);Object.keys(I).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(i,A)||A in e&&e[A]===I[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return I[A]}}))}));var E=t(189);Object.keys(E).forEach((function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(i,A)||A in e&&e[A]===E[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return E[A]}}))}))},function(A,e,t){"use strict";t.r(e),t.d(e,"__extends",(function(){return r})),t.d(e,"__assign",(function(){return n})),t.d(e,"__rest",(function(){return o})),t.d(e,"__decorate",(function(){return a})),t.d(e,"__param",(function(){return s})),t.d(e,"__metadata",(function(){return c})),t.d(e,"__awaiter",(function(){return g})),t.d(e,"__generator",(function(){return f})),t.d(e,"__createBinding",(function(){return u})),t.d(e,"__exportStar",(function(){return h})),t.d(e,"__values",(function(){return d})),t.d(e,"__read",(function(){return B})),t.d(e,"__spread",(function(){return l})),t.d(e,"__spreadArrays",(function(){return I})),t.d(e,"__await",(function(){return E})),t.d(e,"__asyncGenerator",(function(){return C})),t.d(e,"__asyncDelegator",(function(){return Q})),t.d(e,"__asyncValues",(function(){return p})),t.d(e,"__makeTemplateObject",(function(){return w})),t.d(e,"__importStar",(function(){return m})),t.d(e,"__importDefault",(function(){return y})),t.d(e,"__classPrivateFieldGet",(function(){return M})),t.d(e,"__classPrivateFieldSet",(function(){return b}));
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+***************************************************************************** */
+var i=function(A,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)e.hasOwnProperty(t)&&(A[t]=e[t])})(A,e)};function r(A,e){function t(){this.constructor=A}i(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var n=function(){return(n=Object.assign||function(A){for(var e,t=1,i=arguments.length;t=0;a--)(r=A[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o}function s(A,e){return function(t,i){e(t,i,A)}}function c(A,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(A,e)}function g(A,e,t,i){return new(t||(t=Promise))((function(r,n){function o(A){try{s(i.next(A))}catch(A){n(A)}}function a(A){try{s(i.throw(A))}catch(A){n(A)}}function s(A){var e;A.done?r(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(o,a)}s((i=i.apply(A,e||[])).next())}))}function f(A,e){var t,i,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(t)throw new TypeError("Generator is already executing.");for(;o;)try{if(t=1,i&&(r=2&n[0]?i.return:n[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,n[1])).done)return r;switch(i=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]=A.length&&(A=void 0),{value:A&&A[i++],done:!A}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function B(A,e){var t="function"==typeof Symbol&&A[Symbol.iterator];if(!t)return A;var i,r,n=t.call(A),o=[];try{for(;(void 0===e||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(A){r={error:A}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(r)throw r.error}}return o}function l(){for(var A=[],e=0;e1||a(A,e)}))})}function a(A,e){try{(t=r[A](e)).value instanceof E?Promise.resolve(t.value.v).then(s,c):g(n[0][2],t)}catch(A){g(n[0][3],A)}var t}function s(A){a("next",A)}function c(A){a("throw",A)}function g(A,e){A(e),n.shift(),n.length&&a(n[0][0],n[0][1])}}function Q(A){var e,t;return e={},i("next"),i("throw",(function(A){throw A})),i("return"),e[Symbol.iterator]=function(){return this},e;function i(i,r){e[i]=A[i]?function(e){return(t=!t)?{value:E(A[i](e)),done:"return"===i}:r?r(e):e}:r}}function p(A){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,t=A[Symbol.asyncIterator];return t?t.call(A):(A=d(A),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(t){e[t]=A[t]&&function(e){return new Promise((function(i,r){(function(A,e,t,i){Promise.resolve(i).then((function(e){A({value:e,done:t})}),e)})(i,r,(e=A[t](e)).done,e.value)}))}}}function w(A,e){return Object.defineProperty?Object.defineProperty(A,"raw",{value:e}):A.raw=e,A}function m(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)Object.hasOwnProperty.call(A,t)&&(e[t]=A[t]);return e.default=A,e}function y(A){return A&&A.__esModule?A:{default:A}}function M(A,e){if(!e.has(A))throw new TypeError("attempted to get private field on non-instance");return e.get(A)}function b(A,e,t){if(!e.has(A))throw new TypeError("attempted to set private field on non-instance");return e.set(A,t),t}},function(A,e,t){"use strict";t.d(e,"a",(function(){return g}));var i=t(2),r=t(66),n=t(180),o=t(13),a=t(135),s=t(43),c=t(93),g=function(A){function e(t,i,r){var o=A.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=n.a;break;case 1:if(!t){o.destination=n.a;break}if("object"==typeof t){t instanceof e?(o.syncErrorThrowable=t.syncErrorThrowable,o.destination=t,t.add(o)):(o.syncErrorThrowable=!0,o.destination=new f(o,t));break}default:o.syncErrorThrowable=!0,o.destination=new f(o,t,i,r)}return o}return i.__extends(e,A),e.prototype[a.a]=function(){return this},e.create=function(A,t,i){var r=new e(A,t,i);return r.syncErrorThrowable=!1,r},e.prototype.next=function(A){this.isStopped||this._next(A)},e.prototype.error=function(A){this.isStopped||(this.isStopped=!0,this._error(A))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,A.prototype.unsubscribe.call(this))},e.prototype._next=function(A){this.destination.next(A)},e.prototype._error=function(A){this.destination.error(A),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var A=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=A,this},e}(o.a),f=function(A){function e(e,t,i,o){var a,s=A.call(this)||this;s._parentSubscriber=e;var c=s;return Object(r.a)(t)?a=t:t&&(a=t.next,i=t.error,o=t.complete,t!==n.a&&(c=Object.create(t),Object(r.a)(c.unsubscribe)&&s.add(c.unsubscribe.bind(c)),c.unsubscribe=s.unsubscribe.bind(s))),s._context=c,s._next=a,s._error=i,s._complete=o,s}return i.__extends(e,A),e.prototype.next=function(A){if(!this.isStopped&&this._next){var e=this._parentSubscriber;s.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,A)&&this.unsubscribe():this.__tryOrUnsub(this._next,A)}},e.prototype.error=function(A){if(!this.isStopped){var e=this._parentSubscriber,t=s.a.useDeprecatedSynchronousErrorHandling;if(this._error)t&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,A),this.unsubscribe()):(this.__tryOrUnsub(this._error,A),this.unsubscribe());else if(e.syncErrorThrowable)t?(e.syncErrorValue=A,e.syncErrorThrown=!0):Object(c.a)(A),this.unsubscribe();else{if(this.unsubscribe(),t)throw A;Object(c.a)(A)}}},e.prototype.complete=function(){var A=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var t=function(){return A._complete.call(A._context)};s.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(A,e){try{A.call(this._context,e)}catch(A){if(this.unsubscribe(),s.a.useDeprecatedSynchronousErrorHandling)throw A;Object(c.a)(A)}},e.prototype.__tryOrSetError=function(A,e,t){if(!s.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,t)}catch(e){return s.a.useDeprecatedSynchronousErrorHandling?(A.syncErrorValue=e,A.syncErrorThrown=!0,!0):(Object(c.a)(e),!0)}return!1},e.prototype._unsubscribe=function(){var A=this._parentSubscriber;this._context=null,this._parentSubscriber=null,A.unsubscribe()},e}(g)},function(A,e,t){var i=t(21),r=t(37),n=t(56),o=t(50),a=t(67),s=function(A,e,t){var c,g,f,u,h=A&s.F,d=A&s.G,B=A&s.S,l=A&s.P,I=A&s.B,E=d?i:B?i[e]||(i[e]={}):(i[e]||{}).prototype,C=d?r:r[e]||(r[e]={}),Q=C.prototype||(C.prototype={});for(c in d&&(t=e),t)f=((g=!h&&E&&void 0!==E[c])?E:t)[c],u=I&&g?a(f,i):l&&"function"==typeof f?a(Function.call,f):f,E&&o(E,c,f,A&s.U),C[c]!=f&&n(C,c,u),l&&Q[c]!=f&&(Q[c]=f)};i.core=r,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,A.exports=s},function(A,e,t){"use strict";t.d(e,"a",(function(){return a})),t.d(e,"b",(function(){return s})),t.d(e,"c",(function(){return c}));var i=t(2),r=t(3),n=t(8),o=t(92),a=function(A){function e(e){var t=A.call(this)||this;return t.parent=e,t}return i.__extends(e,A),e.prototype._next=function(A){this.parent.notifyNext(A)},e.prototype._error=function(A){this.parent.notifyError(A),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(r.a),s=(r.a,function(A){function e(){return null!==A&&A.apply(this,arguments)||this}return i.__extends(e,A),e.prototype.notifyNext=function(A){this.destination.next(A)},e.prototype.notifyError=function(A){this.destination.error(A)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(r.a));r.a;function c(A,e){if(!e.closed)return A instanceof n.a?A.subscribe(e):Object(o.a)(A)(e)}},function(A,e,t){"use strict";t.r(e),t.d(e,"audit",(function(){return n})),t.d(e,"auditTime",(function(){return g})),t.d(e,"buffer",(function(){return f})),t.d(e,"bufferCount",(function(){return B})),t.d(e,"bufferTime",(function(){return Q})),t.d(e,"bufferToggle",(function(){return k})),t.d(e,"bufferWhen",(function(){return F})),t.d(e,"catchError",(function(){return U})),t.d(e,"combineAll",(function(){return L})),t.d(e,"combineLatest",(function(){return P})),t.d(e,"concat",(function(){return _})),t.d(e,"concatAll",(function(){return q.a})),t.d(e,"concatMap",(function(){return Z})),t.d(e,"concatMapTo",(function(){return V})),t.d(e,"count",(function(){return W})),t.d(e,"debounce",(function(){return $})),t.d(e,"debounceTime",(function(){return tA})),t.d(e,"defaultIfEmpty",(function(){return oA})),t.d(e,"delay",(function(){return fA})),t.d(e,"delayWhen",(function(){return lA})),t.d(e,"dematerialize",(function(){return pA})),t.d(e,"distinct",(function(){return yA})),t.d(e,"distinctUntilChanged",(function(){return DA})),t.d(e,"distinctUntilKeyChanged",(function(){return kA})),t.d(e,"elementAt",(function(){return JA})),t.d(e,"endWith",(function(){return jA})),t.d(e,"every",(function(){return _A})),t.d(e,"exhaust",(function(){return ZA})),t.d(e,"exhaustMap",(function(){return XA})),t.d(e,"expand",(function(){return ee})),t.d(e,"filter",(function(){return NA.a})),t.d(e,"finalize",(function(){return re})),t.d(e,"find",(function(){return ae})),t.d(e,"findIndex",(function(){return ge})),t.d(e,"first",(function(){return ue})),t.d(e,"groupBy",(function(){return he.b})),t.d(e,"ignoreElements",(function(){return de})),t.d(e,"isEmpty",(function(){return Ie})),t.d(e,"last",(function(){return me})),t.d(e,"map",(function(){return zA.a})),t.d(e,"mapTo",(function(){return ye})),t.d(e,"materialize",(function(){return De})),t.d(e,"max",(function(){return Re})),t.d(e,"merge",(function(){return Ye})),t.d(e,"mergeAll",(function(){return xe.a})),t.d(e,"mergeMap",(function(){return T.b})),t.d(e,"flatMap",(function(){return T.a})),t.d(e,"mergeMapTo",(function(){return He})),t.d(e,"mergeScan",(function(){return Le})),t.d(e,"min",(function(){return Pe})),t.d(e,"multicast",(function(){return _e})),t.d(e,"observeOn",(function(){return Te.b})),t.d(e,"onErrorResumeNext",(function(){return Ze})),t.d(e,"pairwise",(function(){return ze})),t.d(e,"partition",(function(){return et})),t.d(e,"pluck",(function(){return tt})),t.d(e,"publish",(function(){return nt})),t.d(e,"publishBehavior",(function(){return at})),t.d(e,"publishLast",(function(){return ct})),t.d(e,"publishReplay",(function(){return ft})),t.d(e,"race",(function(){return ht})),t.d(e,"reduce",(function(){return Oe})),t.d(e,"repeat",(function(){return dt})),t.d(e,"repeatWhen",(function(){return It})),t.d(e,"retry",(function(){return Qt})),t.d(e,"retryWhen",(function(){return mt})),t.d(e,"refCount",(function(){return bt.a})),t.d(e,"sample",(function(){return Dt})),t.d(e,"sampleTime",(function(){return kt})),t.d(e,"scan",(function(){return ke})),t.d(e,"sequenceEqual",(function(){return Ot})),t.d(e,"share",(function(){return Ht})),t.d(e,"shareReplay",(function(){return Lt})),t.d(e,"single",(function(){return Kt})),t.d(e,"skip",(function(){return jt})),t.d(e,"skipLast",(function(){return Tt})),t.d(e,"skipUntil",(function(){return Wt})),t.d(e,"skipWhile",(function(){return $t})),t.d(e,"startWith",(function(){return ti})),t.d(e,"subscribeOn",(function(){return oi})),t.d(e,"switchAll",(function(){return fi})),t.d(e,"switchMap",(function(){return si})),t.d(e,"switchMapTo",(function(){return ui})),t.d(e,"take",(function(){return HA})),t.d(e,"takeLast",(function(){return Qe})),t.d(e,"takeUntil",(function(){return hi})),t.d(e,"takeWhile",(function(){return li})),t.d(e,"tap",(function(){return pi})),t.d(e,"throttle",(function(){return Mi})),t.d(e,"throttleTime",(function(){return vi})),t.d(e,"throwIfEmpty",(function(){return OA})),t.d(e,"timeInterval",(function(){return Fi})),t.d(e,"timeout",(function(){return Li})),t.d(e,"timeoutWith",(function(){return Ui})),t.d(e,"timestamp",(function(){return Ki})),t.d(e,"toArray",(function(){return ji})),t.d(e,"window",(function(){return _i})),t.d(e,"windowCount",(function(){return Zi})),t.d(e,"windowTime",(function(){return zi})),t.d(e,"windowToggle",(function(){return rr})),t.d(e,"windowWhen",(function(){return ar})),t.d(e,"withLatestFrom",(function(){return gr})),t.d(e,"zip",(function(){return dr})),t.d(e,"zipAll",(function(){return Br}));var i=t(2),r=t(5);function n(A){return function(e){return e.lift(new o(A))}}var o=function(){function A(A){this.durationSelector=A}return A.prototype.call=function(A,e){return e.subscribe(new a(A,this.durationSelector))},A}(),a=function(A){function e(e,t){var i=A.call(this,e)||this;return i.durationSelector=t,i.hasValue=!1,i}return i.__extends(e,A),e.prototype._next=function(A){if(this.value=A,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(A)}catch(A){return this.destination.error(A)}var t=Object(r.c)(e,new r.a(this));!t||t.closed?this.clearThrottle():this.add(this.throttled=t)}},e.prototype.clearThrottle=function(){var A=this.value,e=this.hasValue,t=this.throttled;t&&(this.remove(t),this.throttled=void 0,t.unsubscribe()),e&&(this.value=void 0,this.hasValue=!1,this.destination.next(A))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(r.b),s=t(25),c=t(268);function g(A,e){return void 0===e&&(e=s.a),n((function(){return Object(c.a)(A,e)}))}function f(A){return function(e){return e.lift(new u(A))}}var u=function(){function A(A){this.closingNotifier=A}return A.prototype.call=function(A,e){return e.subscribe(new h(A,this.closingNotifier))},A}(),h=function(A){function e(e,t){var i=A.call(this,e)||this;return i.buffer=[],i.add(Object(r.c)(t,new r.a(i))),i}return i.__extends(e,A),e.prototype._next=function(A){this.buffer.push(A)},e.prototype.notifyNext=function(){var A=this.buffer;this.buffer=[],this.destination.next(A)},e}(r.b),d=t(3);function B(A,e){return void 0===e&&(e=null),function(t){return t.lift(new l(A,e))}}var l=function(){function A(A,e){this.bufferSize=A,this.startBufferEvery=e,this.subscriberClass=e&&A!==e?E:I}return A.prototype.call=function(A,e){return e.subscribe(new this.subscriberClass(A,this.bufferSize,this.startBufferEvery))},A}(),I=function(A){function e(e,t){var i=A.call(this,e)||this;return i.bufferSize=t,i.buffer=[],i}return i.__extends(e,A),e.prototype._next=function(A){var e=this.buffer;e.push(A),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},e.prototype._complete=function(){var e=this.buffer;e.length>0&&this.destination.next(e),A.prototype._complete.call(this)},e}(d.a),E=function(A){function e(e,t,i){var r=A.call(this,e)||this;return r.bufferSize=t,r.startBufferEvery=i,r.buffers=[],r.count=0,r}return i.__extends(e,A),e.prototype._next=function(A){var e=this.bufferSize,t=this.startBufferEvery,i=this.buffers,r=this.count;this.count++,r%t==0&&i.push([]);for(var n=i.length;n--;){var o=i[n];o.push(A),o.length===e&&(i.splice(n,1),this.destination.next(o))}},e.prototype._complete=function(){for(var e=this.buffers,t=this.destination;e.length>0;){var i=e.shift();i.length>0&&t.next(i)}A.prototype._complete.call(this)},e}(d.a),C=t(31);function Q(A){var e=arguments.length,t=s.a;Object(C.a)(arguments[arguments.length-1])&&(t=arguments[arguments.length-1],e--);var i=null;e>=2&&(i=arguments[1]);var r=Number.POSITIVE_INFINITY;return e>=3&&(r=arguments[2]),function(e){return e.lift(new p(A,i,r,t))}}var p=function(){function A(A,e,t,i){this.bufferTimeSpan=A,this.bufferCreationInterval=e,this.maxBufferSize=t,this.scheduler=i}return A.prototype.call=function(A,e){return e.subscribe(new m(A,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},A}(),w=function(){return function(){this.buffer=[]}}(),m=function(A){function e(e,t,i,r,n){var o=A.call(this,e)||this;o.bufferTimeSpan=t,o.bufferCreationInterval=i,o.maxBufferSize=r,o.scheduler=n,o.contexts=[];var a=o.openContext();if(o.timespanOnly=null==i||i<0,o.timespanOnly){var s={subscriber:o,context:a,bufferTimeSpan:t};o.add(a.closeAction=n.schedule(y,t,s))}else{var c={subscriber:o,context:a},g={bufferTimeSpan:t,bufferCreationInterval:i,subscriber:o,scheduler:n};o.add(a.closeAction=n.schedule(b,t,c)),o.add(n.schedule(M,i,g))}return o}return i.__extends(e,A),e.prototype._next=function(A){for(var e,t=this.contexts,i=t.length,r=0;r0;){var i=e.shift();t.next(i.buffer)}A.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(A){this.closeContext(A);var e=A.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){A=this.openContext();var t=this.bufferTimeSpan,i={subscriber:this,context:A,bufferTimeSpan:t};this.add(A.closeAction=this.scheduler.schedule(y,t,i))}},e.prototype.openContext=function(){var A=new w;return this.contexts.push(A),A},e.prototype.closeContext=function(A){this.destination.next(A.buffer);var e=this.contexts;(e?e.indexOf(A):-1)>=0&&e.splice(e.indexOf(A),1)},e}(d.a);function y(A){var e=A.subscriber,t=A.context;t&&e.closeContext(t),e.closed||(A.context=e.openContext(),A.context.closeAction=this.schedule(A,A.bufferTimeSpan))}function M(A){var e=A.bufferCreationInterval,t=A.bufferTimeSpan,i=A.subscriber,r=A.scheduler,n=i.openContext();i.closed||(i.add(n.closeAction=r.schedule(b,t,{subscriber:i,context:n})),this.schedule(A,e))}function b(A){var e=A.subscriber,t=A.context;e.closeContext(t)}var D=t(13),v=t(42),S=t(47);function k(A,e){return function(t){return t.lift(new G(A,e))}}var G=function(){function A(A,e){this.openings=A,this.closingSelector=e}return A.prototype.call=function(A,e){return e.subscribe(new N(A,this.openings,this.closingSelector))},A}(),N=function(A){function e(e,t,i){var r=A.call(this,e)||this;return r.closingSelector=i,r.contexts=[],r.add(Object(v.a)(r,t)),r}return i.__extends(e,A),e.prototype._next=function(A){for(var e=this.contexts,t=e.length,i=0;i0;){var i=t.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,A.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var t=e.shift();this.destination.next(t.buffer),t.subscription.unsubscribe(),t.buffer=null,t.subscription=null}this.contexts=null,A.prototype._complete.call(this)},e.prototype.notifyNext=function(A,e){A?this.closeBuffer(A):this.openBuffer(e)},e.prototype.notifyComplete=function(A){this.closeBuffer(A.context)},e.prototype.openBuffer=function(A){try{var e=this.closingSelector.call(this,A);e&&this.trySubscribe(e)}catch(A){this._error(A)}},e.prototype.closeBuffer=function(A){var e=this.contexts;if(e&&A){var t=A.buffer,i=A.subscription;this.destination.next(t),e.splice(e.indexOf(A),1),this.remove(i),i.unsubscribe()}},e.prototype.trySubscribe=function(A){var e=this.contexts,t=new D.a,i={buffer:[],subscription:t};e.push(i);var r=Object(v.a)(this,A,i);!r||r.closed?this.closeBuffer(i):(r.context=i,this.add(r),t.add(r))},e}(S.a);function F(A){return function(e){return e.lift(new O(A))}}var O=function(){function A(A){this.closingSelector=A}return A.prototype.call=function(A,e){return e.subscribe(new R(A,this.closingSelector))},A}(),R=function(A){function e(e,t){var i=A.call(this,e)||this;return i.closingSelector=t,i.subscribing=!1,i.openBuffer(),i}return i.__extends(e,A),e.prototype._next=function(A){this.buffer.push(A)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),A.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var A=this.closingSubscription;A&&(this.remove(A),A.unsubscribe());var e,t=this.buffer;this.buffer&&this.destination.next(t),this.buffer=[];try{e=(0,this.closingSelector)()}catch(A){return this.error(A)}A=new D.a,this.closingSubscription=A,this.add(A),this.subscribing=!0,A.add(Object(r.c)(e,new r.a(this))),this.subscribing=!1},e}(r.b);function U(A){return function(e){var t=new Y(A),i=e.lift(t);return t.caught=i}}var Y=function(){function A(A){this.selector=A}return A.prototype.call=function(A,e){return e.subscribe(new x(A,this.selector,this.caught))},A}(),x=function(A){function e(e,t,i){var r=A.call(this,e)||this;return r.selector=t,r.caught=i,r}return i.__extends(e,A),e.prototype.error=function(e){if(!this.isStopped){var t=void 0;try{t=this.selector(e,this.caught)}catch(e){return void A.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var i=new r.a(this);this.add(i);var n=Object(r.c)(t,i);n!==i&&this.add(n)}},e}(r.b),H=t(173);function L(A){return function(e){return e.lift(new H.a(A))}}var K=t(26),J=t(38);function P(){for(var A=[],e=0;e0&&t[0].time-i.now()<=0;)t.shift().notification.observe(r);if(t.length>0){var n=Math.max(0,t[0].time-i.now());this.schedule(A,n)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(A){this.active=!0,this.destination.add(A.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:A}))},e.prototype.scheduleNotification=function(A){if(!0!==this.errored){var e=this.scheduler,t=new dA(e.now()+this.delay,A);this.queue.push(t),!1===this.active&&this._schedule(e)}},e.prototype._next=function(A){this.scheduleNotification(gA.a.createNext(A))},e.prototype._error=function(A){this.errored=!0,this.queue=[],this.destination.error(A),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(gA.a.createComplete()),this.unsubscribe()},e}(d.a),dA=function(){return function(A,e){this.time=A,this.notification=e}}(),BA=t(8);function lA(A,e){return e?function(t){return new CA(t,e).lift(new IA(A))}:function(e){return e.lift(new IA(A))}}var IA=function(){function A(A){this.delayDurationSelector=A}return A.prototype.call=function(A,e){return e.subscribe(new EA(A,this.delayDurationSelector))},A}(),EA=function(A){function e(e,t){var i=A.call(this,e)||this;return i.delayDurationSelector=t,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return i.__extends(e,A),e.prototype.notifyNext=function(A,e,t,i,r){this.destination.next(A),this.removeSubscription(r),this.tryComplete()},e.prototype.notifyError=function(A,e){this._error(A)},e.prototype.notifyComplete=function(A){var e=this.removeSubscription(A);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(A){var e=this.index++;try{var t=this.delayDurationSelector(A,e);t&&this.tryDelay(t,A)}catch(A){this.destination.error(A)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(A){A.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(A);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),A.outerValue},e.prototype.tryDelay=function(A,e){var t=Object(v.a)(this,A,e);t&&!t.closed&&(this.destination.add(t),this.delayNotifierSubscriptions.push(t))},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(S.a),CA=function(A){function e(e,t){var i=A.call(this)||this;return i.source=e,i.subscriptionDelay=t,i}return i.__extends(e,A),e.prototype._subscribe=function(A){this.subscriptionDelay.subscribe(new QA(A,this.source))},e}(BA.a),QA=function(A){function e(e,t){var i=A.call(this)||this;return i.parent=e,i.source=t,i.sourceSubscribed=!1,i}return i.__extends(e,A),e.prototype._next=function(A){this.subscribeToSource()},e.prototype._error=function(A){this.unsubscribe(),this.parent.error(A)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(d.a);function pA(){return function(A){return A.lift(new wA)}}var wA=function(){function A(){}return A.prototype.call=function(A,e){return e.subscribe(new mA(A))},A}(),mA=function(A){function e(e){return A.call(this,e)||this}return i.__extends(e,A),e.prototype._next=function(A){A.observe(this.destination)},e}(d.a);function yA(A,e){return function(t){return t.lift(new MA(A,e))}}var MA=function(){function A(A,e){this.keySelector=A,this.flushes=e}return A.prototype.call=function(A,e){return e.subscribe(new bA(A,this.keySelector,this.flushes))},A}(),bA=function(A){function e(e,t,i){var n=A.call(this,e)||this;return n.keySelector=t,n.values=new Set,i&&n.add(Object(r.c)(i,new r.a(n))),n}return i.__extends(e,A),e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(A){this._error(A)},e.prototype._next=function(A){this.keySelector?this._useKeySelector(A):this._finalizeNext(A,A)},e.prototype._useKeySelector=function(A){var e,t=this.destination;try{e=this.keySelector(A)}catch(A){return void t.error(A)}this._finalizeNext(e,A)},e.prototype._finalizeNext=function(A,e){var t=this.values;t.has(A)||(t.add(A),this.destination.next(e))},e}(r.b);function DA(A,e){return function(t){return t.lift(new vA(A,e))}}var vA=function(){function A(A,e){this.compare=A,this.keySelector=e}return A.prototype.call=function(A,e){return e.subscribe(new SA(A,this.compare,this.keySelector))},A}(),SA=function(A){function e(e,t,i){var r=A.call(this,e)||this;return r.keySelector=i,r.hasKey=!1,"function"==typeof t&&(r.compare=t),r}return i.__extends(e,A),e.prototype.compare=function(A,e){return A===e},e.prototype._next=function(A){var e;try{var t=this.keySelector;e=t?t(A):A}catch(A){return this.destination.error(A)}var i=!1;if(this.hasKey)try{i=(0,this.compare)(this.key,e)}catch(A){return this.destination.error(A)}else this.hasKey=!0;i||(this.key=e,this.destination.next(A))},e}(d.a);function kA(A,e){return DA((function(t,i){return e?e(t[A],i[A]):t[A]===i[A]}))}var GA=t(65),NA=t(48),FA=t(77);function OA(A){return void 0===A&&(A=YA),function(e){return e.lift(new RA(A))}}var RA=function(){function A(A){this.errorFactory=A}return A.prototype.call=function(A,e){return e.subscribe(new UA(A,this.errorFactory))},A}(),UA=function(A){function e(e,t){var i=A.call(this,e)||this;return i.errorFactory=t,i.hasValue=!1,i}return i.__extends(e,A),e.prototype._next=function(A){this.hasValue=!0,this.destination.next(A)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var A=void 0;try{A=this.errorFactory()}catch(e){A=e}this.destination.error(A)},e}(d.a);function YA(){return new FA.a}var xA=t(36);function HA(A){return function(e){return 0===A?Object(xA.b)():e.lift(new LA(A))}}var LA=function(){function A(A){if(this.total=A,this.total<0)throw new GA.a}return A.prototype.call=function(A,e){return e.subscribe(new KA(A,this.total))},A}(),KA=function(A){function e(e,t){var i=A.call(this,e)||this;return i.total=t,i.count=0,i}return i.__extends(e,A),e.prototype._next=function(A){var e=this.total,t=++this.count;t<=e&&(this.destination.next(A),t===e&&(this.destination.complete(),this.unsubscribe()))},e}(d.a);function JA(A,e){if(A<0)throw new GA.a;var t=arguments.length>=2;return function(i){return i.pipe(Object(NA.a)((function(e,t){return t===A})),HA(1),t?oA(e):OA((function(){return new GA.a})))}}var PA=t(104);function jA(){for(var A=[],e=0;e0&&this._next(A.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(r.b);function re(A){return function(e){return e.lift(new ne(A))}}var ne=function(){function A(A){this.callback=A}return A.prototype.call=function(A,e){return e.subscribe(new oe(A,this.callback))},A}(),oe=function(A){function e(e,t){var i=A.call(this,e)||this;return i.add(new D.a(t)),i}return i.__extends(e,A),e}(d.a);function ae(A,e){if("function"!=typeof A)throw new TypeError("predicate is not a function");return function(t){return t.lift(new se(A,t,!1,e))}}var se=function(){function A(A,e,t,i){this.predicate=A,this.source=e,this.yieldIndex=t,this.thisArg=i}return A.prototype.call=function(A,e){return e.subscribe(new ce(A,this.predicate,this.source,this.yieldIndex,this.thisArg))},A}(),ce=function(A){function e(e,t,i,r,n){var o=A.call(this,e)||this;return o.predicate=t,o.source=i,o.yieldIndex=r,o.thisArg=n,o.index=0,o}return i.__extends(e,A),e.prototype.notifyComplete=function(A){var e=this.destination;e.next(A),e.complete(),this.unsubscribe()},e.prototype._next=function(A){var e=this.predicate,t=this.thisArg,i=this.index++;try{e.call(t||this,A,i,this.source)&&this.notifyComplete(this.yieldIndex?i:A)}catch(A){this.destination.error(A)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(d.a);function ge(A,e){return function(t){return t.lift(new se(A,t,!0,e))}}var fe=t(46);function ue(A,e){var t=arguments.length>=2;return function(i){return i.pipe(A?Object(NA.a)((function(e,t){return A(e,t,i)})):fe.a,HA(1),t?oA(e):OA((function(){return new FA.a})))}}var he=t(257);function de(){return function(A){return A.lift(new Be)}}var Be=function(){function A(){}return A.prototype.call=function(A,e){return e.subscribe(new le(A))},A}(),le=function(A){function e(){return null!==A&&A.apply(this,arguments)||this}return i.__extends(e,A),e.prototype._next=function(A){},e}(d.a);function Ie(){return function(A){return A.lift(new Ee)}}var Ee=function(){function A(){}return A.prototype.call=function(A,e){return e.subscribe(new Ce(A))},A}(),Ce=function(A){function e(e){return A.call(this,e)||this}return i.__extends(e,A),e.prototype.notifyComplete=function(A){var e=this.destination;e.next(A),e.complete()},e.prototype._next=function(A){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(d.a);function Qe(A){return function(e){return 0===A?Object(xA.b)():e.lift(new pe(A))}}var pe=function(){function A(A){if(this.total=A,this.total<0)throw new GA.a}return A.prototype.call=function(A,e){return e.subscribe(new we(A,this.total))},A}(),we=function(A){function e(e,t){var i=A.call(this,e)||this;return i.total=t,i.ring=new Array,i.count=0,i}return i.__extends(e,A),e.prototype._next=function(A){var e=this.ring,t=this.total,i=this.count++;e.length0)for(var t=this.count>=this.total?this.total:this.count,i=this.ring,r=0;r=2;return function(i){return i.pipe(A?Object(NA.a)((function(e,t){return A(e,t,i)})):fe.a,Qe(1),t?oA(e):OA((function(){return new FA.a})))}}function ye(A){return function(e){return e.lift(new Me(A))}}var Me=function(){function A(A){this.value=A}return A.prototype.call=function(A,e){return e.subscribe(new be(A,this.value))},A}(),be=function(A){function e(e,t){var i=A.call(this,e)||this;return i.value=t,i}return i.__extends(e,A),e.prototype._next=function(A){this.destination.next(this.value)},e}(d.a);function De(){return function(A){return A.lift(new ve)}}var ve=function(){function A(){}return A.prototype.call=function(A,e){return e.subscribe(new Se(A))},A}(),Se=function(A){function e(e){return A.call(this,e)||this}return i.__extends(e,A),e.prototype._next=function(A){this.destination.next(gA.a.createNext(A))},e.prototype._error=function(A){var e=this.destination;e.next(gA.a.createError(A)),e.complete()},e.prototype._complete=function(){var A=this.destination;A.next(gA.a.createComplete()),A.complete()},e}(d.a);function ke(A,e){var t=!1;return arguments.length>=2&&(t=!0),function(i){return i.lift(new Ge(A,e,t))}}var Ge=function(){function A(A,e,t){void 0===t&&(t=!1),this.accumulator=A,this.seed=e,this.hasSeed=t}return A.prototype.call=function(A,e){return e.subscribe(new Ne(A,this.accumulator,this.seed,this.hasSeed))},A}(),Ne=function(A){function e(e,t,i,r){var n=A.call(this,e)||this;return n.accumulator=t,n._seed=i,n.hasSeed=r,n.index=0,n}return i.__extends(e,A),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(A){this.hasSeed=!0,this._seed=A},enumerable:!0,configurable:!0}),e.prototype._next=function(A){if(this.hasSeed)return this._tryNext(A);this.seed=A,this.destination.next(A)},e.prototype._tryNext=function(A){var e,t=this.index++;try{e=this.accumulator(this.seed,A,t)}catch(A){this.destination.error(A)}this.seed=e,this.destination.next(e)},e}(d.a),Fe=t(133);function Oe(A,e){return arguments.length>=2?function(t){return Object(Fe.a)(ke(A,e),Qe(1),oA(e))(t)}:function(e){return Object(Fe.a)(ke((function(e,t,i){return A(e,t,i+1)})),Qe(1))(e)}}function Re(A){return Oe("function"==typeof A?function(e,t){return A(e,t)>0?e:t}:function(A,e){return A>e?A:e})}var Ue=t(266);function Ye(){for(var A=[],e=0;e0?this._next(A.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(r.b);function Pe(A){return Oe("function"==typeof A?function(e,t){return A(e,t)<0?e:t}:function(A,e){return A-1&&(this.count=t-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(d.a);function It(A){return function(e){return e.lift(new Et(A))}}var Et=function(){function A(A){this.notifier=A}return A.prototype.call=function(A,e){return e.subscribe(new Ct(A,this.notifier,e))},A}(),Ct=function(A){function e(e,t,i){var r=A.call(this,e)||this;return r.notifier=t,r.source=i,r.sourceIsBeingSubscribedTo=!0,r}return i.__extends(e,A),e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return A.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return A.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var A=this.notifications,e=this.retriesSubscription;A&&(A.unsubscribe(),this.notifications=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,A.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},e.prototype.subscribeToRetries=function(){var e;this.notifications=new rt.a;try{e=(0,this.notifier)(this.notifications)}catch(e){return A.prototype.complete.call(this)}this.retries=e,this.retriesSubscription=Object(r.c)(e,new r.a(this))},e}(r.b);function Qt(A){return void 0===A&&(A=-1),function(e){return e.lift(new pt(A,e))}}var pt=function(){function A(A,e){this.count=A,this.source=e}return A.prototype.call=function(A,e){return e.subscribe(new wt(A,this.count,this.source))},A}(),wt=function(A){function e(e,t,i){var r=A.call(this,e)||this;return r.count=t,r.source=i,r}return i.__extends(e,A),e.prototype.error=function(e){if(!this.isStopped){var t=this.source,i=this.count;if(0===i)return A.prototype.error.call(this,e);i>-1&&(this.count=i-1),t.subscribe(this._unsubscribeAndRecycle())}},e}(d.a);function mt(A){return function(e){return e.lift(new yt(A,e))}}var yt=function(){function A(A,e){this.notifier=A,this.source=e}return A.prototype.call=function(A,e){return e.subscribe(new Mt(A,this.notifier,this.source))},A}(),Mt=function(A){function e(e,t,i){var r=A.call(this,e)||this;return r.notifier=t,r.source=i,r}return i.__extends(e,A),e.prototype.error=function(e){if(!this.isStopped){var t=this.errors,i=this.retries,n=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{t=new rt.a;try{i=(0,this.notifier)(t)}catch(e){return A.prototype.error.call(this,e)}n=Object(r.c)(i,new r.a(this))}this._unsubscribeAndRecycle(),this.errors=t,this.retries=i,this.retriesSubscription=n,t.next(e)}},e.prototype._unsubscribe=function(){var A=this.errors,e=this.retriesSubscription;A&&(A.unsubscribe(),this.errors=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var A=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=A,this.source.subscribe(this)},e}(r.b),bt=t(170);function Dt(A){return function(e){return e.lift(new vt(A))}}var vt=function(){function A(A){this.notifier=A}return A.prototype.call=function(A,e){var t=new St(A),i=e.subscribe(t);return i.add(Object(r.c)(this.notifier,new r.a(t))),i},A}(),St=function(A){function e(){var e=null!==A&&A.apply(this,arguments)||this;return e.hasValue=!1,e}return i.__extends(e,A),e.prototype._next=function(A){this.value=A,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(r.b);function kt(A,e){return void 0===e&&(e=s.a),function(t){return t.lift(new Gt(A,e))}}var Gt=function(){function A(A,e){this.period=A,this.scheduler=e}return A.prototype.call=function(A,e){return e.subscribe(new Nt(A,this.period,this.scheduler))},A}(),Nt=function(A){function e(e,t,i){var r=A.call(this,e)||this;return r.period=t,r.scheduler=i,r.hasValue=!1,r.add(i.schedule(Ft,t,{subscriber:r,period:t})),r}return i.__extends(e,A),e.prototype._next=function(A){this.lastValue=A,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(d.a);function Ft(A){var e=A.subscriber,t=A.period;e.notifyNext(),this.schedule(A,t)}function Ot(A,e){return function(t){return t.lift(new Rt(A,e))}}var Rt=function(){function A(A,e){this.compareTo=A,this.comparator=e}return A.prototype.call=function(A,e){return e.subscribe(new Ut(A,this.compareTo,this.comparator))},A}(),Ut=function(A){function e(e,t,i){var r=A.call(this,e)||this;return r.compareTo=t,r.comparator=i,r._a=[],r._b=[],r._oneComplete=!1,r.destination.add(t.subscribe(new Yt(e,r))),r}return i.__extends(e,A),e.prototype._next=function(A){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(A),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var A=this._a,e=this._b,t=this.comparator;A.length>0&&e.length>0;){var i=A.shift(),r=e.shift(),n=!1;try{n=t?t(i,r):i===r}catch(A){this.destination.error(A)}n||this.emit(!1)}},e.prototype.emit=function(A){var e=this.destination;e.next(A),e.complete()},e.prototype.nextB=function(A){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(A),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e}(d.a),Yt=function(A){function e(e,t){var i=A.call(this,e)||this;return i.parent=t,i}return i.__extends(e,A),e.prototype._next=function(A){this.parent.nextB(A)},e.prototype._error=function(A){this.parent.error(A),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(d.a);function xt(){return new rt.a}function Ht(){return function(A){return Object(bt.a)()(_e(xt)(A))}}function Lt(A,e,t){var i;return i=A&&"object"==typeof A?A:{bufferSize:A,windowTime:e,refCount:!1,scheduler:t},function(A){return A.lift(function(A){var e,t,i=A.bufferSize,r=void 0===i?Number.POSITIVE_INFINITY:i,n=A.windowTime,o=void 0===n?Number.POSITIVE_INFINITY:n,a=A.refCount,s=A.scheduler,c=0,g=!1,f=!1;return function(A){var i;c++,!e||g?(g=!1,e=new gt.a(r,o,s),i=e.subscribe(this),t=A.subscribe({next:function(A){e.next(A)},error:function(A){g=!0,e.error(A)},complete:function(){f=!0,t=void 0,e.complete()}}),f&&(t=void 0)):i=e.subscribe(this),this.add((function(){c--,i.unsubscribe(),i=void 0,t&&!f&&a&&0===c&&(t.unsubscribe(),t=void 0,e=void 0)}))}}(i))}}function Kt(A){return function(e){return e.lift(new Jt(A,e))}}var Jt=function(){function A(A,e){this.predicate=A,this.source=e}return A.prototype.call=function(A,e){return e.subscribe(new Pt(A,this.predicate,this.source))},A}(),Pt=function(A){function e(e,t,i){var r=A.call(this,e)||this;return r.predicate=t,r.source=i,r.seenValue=!1,r.index=0,r}return i.__extends(e,A),e.prototype.applySingleValue=function(A){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=A)},e.prototype._next=function(A){var e=this.index++;this.predicate?this.tryNext(A,e):this.applySingleValue(A)},e.prototype.tryNext=function(A,e){try{this.predicate(A,e,this.source)&&this.applySingleValue(A)}catch(A){this.destination.error(A)}},e.prototype._complete=function(){var A=this.destination;this.index>0?(A.next(this.seenValue?this.singleValue:void 0),A.complete()):A.error(new FA.a)},e}(d.a);function jt(A){return function(e){return e.lift(new _t(A))}}var _t=function(){function A(A){this.total=A}return A.prototype.call=function(A,e){return e.subscribe(new qt(A,this.total))},A}(),qt=function(A){function e(e,t){var i=A.call(this,e)||this;return i.total=t,i.count=0,i}return i.__extends(e,A),e.prototype._next=function(A){++this.count>this.total&&this.destination.next(A)},e}(d.a);function Tt(A){return function(e){return e.lift(new Zt(A))}}var Zt=function(){function A(A){if(this._skipCount=A,this._skipCount<0)throw new GA.a}return A.prototype.call=function(A,e){return 0===this._skipCount?e.subscribe(new d.a(A)):e.subscribe(new Vt(A,this._skipCount))},A}(),Vt=function(A){function e(e,t){var i=A.call(this,e)||this;return i._skipCount=t,i._count=0,i._ring=new Array(t),i}return i.__extends(e,A),e.prototype._next=function(A){var e=this._skipCount,t=this._count++;if(t0?this.startWindowEvery:this.windowSize,t=this.destination,i=this.windowSize,r=this.windows,n=r.length,o=0;o=0&&a%e==0&&!this.closed&&r.shift().complete(),++this.count%e==0&&!this.closed){var s=new rt.a;r.push(s),t.next(s)}},e.prototype._error=function(A){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(A);this.destination.error(A)},e.prototype._complete=function(){var A=this.windows;if(A)for(;A.length>0&&!this.closed;)A.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(d.a);function zi(A){var e=s.a,t=null,i=Number.POSITIVE_INFINITY;return Object(C.a)(arguments[3])&&(e=arguments[3]),Object(C.a)(arguments[2])?e=arguments[2]:Object(ri.a)(arguments[2])&&(i=Number(arguments[2])),Object(C.a)(arguments[1])?e=arguments[1]:Object(ri.a)(arguments[1])&&(t=Number(arguments[1])),function(r){return r.lift(new Xi(A,t,i,e))}}var Xi=function(){function A(A,e,t,i){this.windowTimeSpan=A,this.windowCreationInterval=e,this.maxWindowSize=t,this.scheduler=i}return A.prototype.call=function(A,e){return e.subscribe(new Ar(A,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},A}(),$i=function(A){function e(){var e=null!==A&&A.apply(this,arguments)||this;return e._numberOfNextedValues=0,e}return i.__extends(e,A),e.prototype.next=function(e){this._numberOfNextedValues++,A.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(rt.a),Ar=function(A){function e(e,t,i,r,n){var o=A.call(this,e)||this;o.destination=e,o.windowTimeSpan=t,o.windowCreationInterval=i,o.maxWindowSize=r,o.scheduler=n,o.windows=[];var a=o.openWindow();if(null!==i&&i>=0){var s={subscriber:o,window:a,context:null},c={windowTimeSpan:t,windowCreationInterval:i,subscriber:o,scheduler:n};o.add(n.schedule(ir,t,s)),o.add(n.schedule(tr,i,c))}else{var g={subscriber:o,window:a,windowTimeSpan:t};o.add(n.schedule(er,t,g))}return o}return i.__extends(e,A),e.prototype._next=function(A){for(var e=this.windows,t=e.length,i=0;i=this.maxWindowSize&&this.closeWindow(r))}},e.prototype._error=function(A){for(var e=this.windows;e.length>0;)e.shift().error(A);this.destination.error(A)},e.prototype._complete=function(){for(var A=this.windows;A.length>0;){var e=A.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var A=new $i;return this.windows.push(A),this.destination.next(A),A},e.prototype.closeWindow=function(A){A.complete();var e=this.windows;e.splice(e.indexOf(A),1)},e}(d.a);function er(A){var e=A.subscriber,t=A.windowTimeSpan,i=A.window;i&&e.closeWindow(i),A.window=e.openWindow(),this.schedule(A,t)}function tr(A){var e=A.windowTimeSpan,t=A.subscriber,i=A.scheduler,r=A.windowCreationInterval,n=t.openWindow(),o={action:this,subscription:null},a={subscriber:t,window:n,context:o};o.subscription=i.schedule(ir,e,a),this.add(o.subscription),this.schedule(A,r)}function ir(A){var e=A.subscriber,t=A.window,i=A.context;i&&i.action&&i.subscription&&i.action.remove(i.subscription),e.closeWindow(t)}function rr(A,e){return function(t){return t.lift(new nr(A,e))}}var nr=function(){function A(A,e){this.openings=A,this.closingSelector=e}return A.prototype.call=function(A,e){return e.subscribe(new or(A,this.openings,this.closingSelector))},A}(),or=function(A){function e(e,t,i){var r=A.call(this,e)||this;return r.openings=t,r.closingSelector=i,r.contexts=[],r.add(r.openSubscription=Object(v.a)(r,t,t)),r}return i.__extends(e,A),e.prototype._next=function(A){var e=this.contexts;if(e)for(var t=e.length,i=0;i0){var r=i.indexOf(t);-1!==r&&i.splice(r,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(A){if(0===this.toRespond.length){var e=[A].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(A){var e;try{e=this.project.apply(this,A)}catch(A){return void this.destination.error(A)}this.destination.next(e)},e}(S.a),hr=t(176);function dr(){for(var A=[],e=0;e0?A.prototype.requestAsyncId.call(this,e,t,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame((function(){return e.flush(null)}))))},e.prototype.recycleAsyncId=function(e,t,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return A.prototype.recycleAsyncId.call(this,e,t,i);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)},e}(B.a),I=t(80),E=new(function(A){function e(){return null!==A&&A.apply(this,arguments)||this}return d.__extends(e,A),e.prototype.flush=function(A){this.active=!0,this.scheduled=void 0;var e,t=this.actions,i=-1,r=t.length;A=A||t.shift();do{if(e=A.execute(A.state,A.delay))break}while(++ie.index?1:-1:A.delay>e.delay?1:-1},e}(B.a),w=t(209),m=t(13),y=t(3),M=t(49),b=t(133),D=t(54),v=t(46);function S(A){return!!A&&(A instanceof i.a||"function"==typeof A.lift&&"function"==typeof A.subscribe)}var k=t(65),G=t(77),N=t(63),F=t(136),O=t(264),R=t(29),U=t(178),Y=t(26),x=t(31);function H(A,e,t){if(e){if(!Object(x.a)(e))return function(){for(var i=[],r=0;r1?i.next(Array.prototype.slice.call(arguments)):i.next(A)}),i,t)}))}function tA(A,e,t){return t?tA(A,e).pipe(Object(R.a)((function(A){return Object(Y.a)(A)?t.apply(void 0,A):t(A)}))):new i.a((function(t){var i,r=function(){for(var A=[],e=0;e=e){i.complete();break}if(i.next(n++),i.closed)break}}))}function wA(A){var e=A.start,t=A.index,i=A.count,r=A.subscriber;t>=i?r.complete():(r.next(e),r.closed||(A.index=t+1,A.start=e+1,this.schedule(A)))}var mA=t(172),yA=t(268);function MA(A,e){return new i.a((function(t){var i,r;try{i=A()}catch(A){return void t.error(A)}try{r=e(i)}catch(A){return void t.error(A)}var n=(r?Object(z.a)(r):V.a).subscribe(t);return function(){n.unsubscribe(),i&&i.unsubscribe()}}))}var bA=t(176),DA=t(269),vA=t(43)},function(A,e){"function"==typeof Object.create?A.exports=function(A,e){e&&(A.super_=e,A.prototype=Object.create(e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}))}:A.exports=function(A,e){if(e){A.super_=e;var t=function(){};t.prototype=e.prototype,A.prototype=new t,A.prototype.constructor=A}}},function(A,e,t){"use strict";t.d(e,"a",(function(){return a}));var i=t(26),r=t(177),n=t(66),o=t(136),a=function(){function A(A){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,A&&(this._ctorUnsubscribe=!0,this._unsubscribe=A)}var e;return A.prototype.unsubscribe=function(){var e;if(!this.closed){var t=this._parentOrParents,a=this._ctorUnsubscribe,c=this._unsubscribe,g=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,t instanceof A)t.remove(this);else if(null!==t)for(var f=0;f */
+var i=t(15),r=i.Buffer;function n(A,e){for(var t in A)e[t]=A[t]}function o(A,e,t){return r(A,e,t)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?A.exports=i:(n(i,e),e.Buffer=o),o.prototype=Object.create(r.prototype),n(r,o),o.from=function(A,e,t){if("number"==typeof A)throw new TypeError("Argument must not be a number");return r(A,e,t)},o.alloc=function(A,e,t){if("number"!=typeof A)throw new TypeError("Argument must be a number");var i=r(A);return void 0!==e?"string"==typeof t?i.fill(e,t):i.fill(e):i.fill(0),i},o.allocUnsafe=function(A){if("number"!=typeof A)throw new TypeError("Argument must be a number");return r(A)},o.allocUnsafeSlow=function(A){if("number"!=typeof A)throw new TypeError("Argument must be a number");return i.SlowBuffer(A)}},function(A,e,t){"use strict";(function(A){
+/*!
+ * The buffer module from node.js, for the browser.
+ *
+ * @author Feross Aboukhadijeh
+ * @license MIT
+ */
+var i=t(861),r=t(862),n=t(430);function o(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(A,e){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|A}function d(A,e){if(s.isBuffer(A))return A.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(A)||A instanceof ArrayBuffer))return A.byteLength;"string"!=typeof A&&(A=""+A);var t=A.length;if(0===t)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return L(A).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return K(A).length;default:if(i)return L(A).length;e=(""+e).toLowerCase(),i=!0}}function B(A,e,t){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if((t>>>=0)<=(e>>>=0))return"";for(A||(A="utf8");;)switch(A){case"hex":return S(this,e,t);case"utf8":case"utf-8":return b(this,e,t);case"ascii":return D(this,e,t);case"latin1":case"binary":return v(this,e,t);case"base64":return M(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t);default:if(i)throw new TypeError("Unknown encoding: "+A);A=(A+"").toLowerCase(),i=!0}}function l(A,e,t){var i=A[e];A[e]=A[t],A[t]=i}function I(A,e,t,i,r){if(0===A.length)return-1;if("string"==typeof t?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=r?0:A.length-1),t<0&&(t=A.length+t),t>=A.length){if(r)return-1;t=A.length-1}else if(t<0){if(!r)return-1;t=0}if("string"==typeof e&&(e=s.from(e,i)),s.isBuffer(e))return 0===e.length?-1:E(A,e,t,i,r);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(A,e,t):Uint8Array.prototype.lastIndexOf.call(A,e,t):E(A,[e],t,i,r);throw new TypeError("val must be string, number or Buffer")}function E(A,e,t,i,r){var n,o=1,a=A.length,s=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(A.length<2||e.length<2)return-1;o=2,a/=2,s/=2,t/=2}function c(A,e){return 1===o?A[e]:A.readUInt16BE(e*o)}if(r){var g=-1;for(n=t;na&&(t=a-s),n=t;n>=0;n--){for(var f=!0,u=0;ur&&(i=r):i=r;var n=e.length;if(n%2!=0)throw new TypeError("Invalid hex string");i>n/2&&(i=n/2);for(var o=0;o>8,r=t%256,n.push(r),n.push(i);return n}(e,A.length-t),A,t,i)}function M(A,e,t){return 0===e&&t===A.length?i.fromByteArray(A):i.fromByteArray(A.slice(e,t))}function b(A,e,t){t=Math.min(A.length,t);for(var i=[],r=e;r239?4:c>223?3:c>191?2:1;if(r+f<=t)switch(f){case 1:c<128&&(g=c);break;case 2:128==(192&(n=A[r+1]))&&(s=(31&c)<<6|63&n)>127&&(g=s);break;case 3:n=A[r+1],o=A[r+2],128==(192&n)&&128==(192&o)&&(s=(15&c)<<12|(63&n)<<6|63&o)>2047&&(s<55296||s>57343)&&(g=s);break;case 4:n=A[r+1],o=A[r+2],a=A[r+3],128==(192&n)&&128==(192&o)&&128==(192&a)&&(s=(15&c)<<18|(63&n)<<12|(63&o)<<6|63&a)>65535&&s<1114112&&(g=s)}null===g?(g=65533,f=1):g>65535&&(g-=65536,i.push(g>>>10&1023|55296),g=56320|1023&g),i.push(g),r+=f}return function(A){var e=A.length;if(e<=4096)return String.fromCharCode.apply(String,A);var t="",i=0;for(;i0&&(A=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(A+=" ... ")),""},s.prototype.compare=function(A,e,t,i,r){if(!s.isBuffer(A))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===t&&(t=A?A.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||t>A.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=t)return 0;if(i>=r)return-1;if(e>=t)return 1;if(this===A)return 0;for(var n=(r>>>=0)-(i>>>=0),o=(t>>>=0)-(e>>>=0),a=Math.min(n,o),c=this.slice(i,r),g=A.slice(e,t),f=0;fr)&&(t=r),A.length>0&&(t<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var n=!1;;)switch(i){case"hex":return C(this,A,e,t);case"utf8":case"utf-8":return Q(this,A,e,t);case"ascii":return p(this,A,e,t);case"latin1":case"binary":return w(this,A,e,t);case"base64":return m(this,A,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,A,e,t);default:if(n)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),n=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function D(A,e,t){var i="";t=Math.min(A.length,t);for(var r=e;ri)&&(t=i);for(var r="",n=e;nt)throw new RangeError("Trying to access beyond buffer length")}function N(A,e,t,i,r,n){if(!s.isBuffer(A))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||eA.length)throw new RangeError("Index out of range")}function F(A,e,t,i){e<0&&(e=65535+e+1);for(var r=0,n=Math.min(A.length-t,2);r>>8*(i?r:1-r)}function O(A,e,t,i){e<0&&(e=4294967295+e+1);for(var r=0,n=Math.min(A.length-t,4);r>>8*(i?r:3-r)&255}function R(A,e,t,i,r,n){if(t+i>A.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function U(A,e,t,i,n){return n||R(A,0,t,4),r.write(A,e,t,i,23,4),t+4}function Y(A,e,t,i,n){return n||R(A,0,t,8),r.write(A,e,t,i,52,8),t+8}s.prototype.slice=function(A,e){var t,i=this.length;if((A=~~A)<0?(A+=i)<0&&(A=0):A>i&&(A=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(r*=256);)i+=this[A+--e]*r;return i},s.prototype.readUInt8=function(A,e){return e||G(A,1,this.length),this[A]},s.prototype.readUInt16LE=function(A,e){return e||G(A,2,this.length),this[A]|this[A+1]<<8},s.prototype.readUInt16BE=function(A,e){return e||G(A,2,this.length),this[A]<<8|this[A+1]},s.prototype.readUInt32LE=function(A,e){return e||G(A,4,this.length),(this[A]|this[A+1]<<8|this[A+2]<<16)+16777216*this[A+3]},s.prototype.readUInt32BE=function(A,e){return e||G(A,4,this.length),16777216*this[A]+(this[A+1]<<16|this[A+2]<<8|this[A+3])},s.prototype.readIntLE=function(A,e,t){A|=0,e|=0,t||G(A,e,this.length);for(var i=this[A],r=1,n=0;++n=(r*=128)&&(i-=Math.pow(2,8*e)),i},s.prototype.readIntBE=function(A,e,t){A|=0,e|=0,t||G(A,e,this.length);for(var i=e,r=1,n=this[A+--i];i>0&&(r*=256);)n+=this[A+--i]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readInt8=function(A,e){return e||G(A,1,this.length),128&this[A]?-1*(255-this[A]+1):this[A]},s.prototype.readInt16LE=function(A,e){e||G(A,2,this.length);var t=this[A]|this[A+1]<<8;return 32768&t?4294901760|t:t},s.prototype.readInt16BE=function(A,e){e||G(A,2,this.length);var t=this[A+1]|this[A]<<8;return 32768&t?4294901760|t:t},s.prototype.readInt32LE=function(A,e){return e||G(A,4,this.length),this[A]|this[A+1]<<8|this[A+2]<<16|this[A+3]<<24},s.prototype.readInt32BE=function(A,e){return e||G(A,4,this.length),this[A]<<24|this[A+1]<<16|this[A+2]<<8|this[A+3]},s.prototype.readFloatLE=function(A,e){return e||G(A,4,this.length),r.read(this,A,!0,23,4)},s.prototype.readFloatBE=function(A,e){return e||G(A,4,this.length),r.read(this,A,!1,23,4)},s.prototype.readDoubleLE=function(A,e){return e||G(A,8,this.length),r.read(this,A,!0,52,8)},s.prototype.readDoubleBE=function(A,e){return e||G(A,8,this.length),r.read(this,A,!1,52,8)},s.prototype.writeUIntLE=function(A,e,t,i){(A=+A,e|=0,t|=0,i)||N(this,A,e,t,Math.pow(2,8*t)-1,0);var r=1,n=0;for(this[e]=255&A;++n=0&&(n*=256);)this[e+r]=A/n&255;return e+t},s.prototype.writeUInt8=function(A,e,t){return A=+A,e|=0,t||N(this,A,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(A=Math.floor(A)),this[e]=255&A,e+1},s.prototype.writeUInt16LE=function(A,e,t){return A=+A,e|=0,t||N(this,A,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&A,this[e+1]=A>>>8):F(this,A,e,!0),e+2},s.prototype.writeUInt16BE=function(A,e,t){return A=+A,e|=0,t||N(this,A,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=A>>>8,this[e+1]=255&A):F(this,A,e,!1),e+2},s.prototype.writeUInt32LE=function(A,e,t){return A=+A,e|=0,t||N(this,A,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=A>>>24,this[e+2]=A>>>16,this[e+1]=A>>>8,this[e]=255&A):O(this,A,e,!0),e+4},s.prototype.writeUInt32BE=function(A,e,t){return A=+A,e|=0,t||N(this,A,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=A>>>24,this[e+1]=A>>>16,this[e+2]=A>>>8,this[e+3]=255&A):O(this,A,e,!1),e+4},s.prototype.writeIntLE=function(A,e,t,i){if(A=+A,e|=0,!i){var r=Math.pow(2,8*t-1);N(this,A,e,t,r-1,-r)}var n=0,o=1,a=0;for(this[e]=255&A;++n>0)-a&255;return e+t},s.prototype.writeIntBE=function(A,e,t,i){if(A=+A,e|=0,!i){var r=Math.pow(2,8*t-1);N(this,A,e,t,r-1,-r)}var n=t-1,o=1,a=0;for(this[e+n]=255&A;--n>=0&&(o*=256);)A<0&&0===a&&0!==this[e+n+1]&&(a=1),this[e+n]=(A/o>>0)-a&255;return e+t},s.prototype.writeInt8=function(A,e,t){return A=+A,e|=0,t||N(this,A,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(A=Math.floor(A)),A<0&&(A=255+A+1),this[e]=255&A,e+1},s.prototype.writeInt16LE=function(A,e,t){return A=+A,e|=0,t||N(this,A,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&A,this[e+1]=A>>>8):F(this,A,e,!0),e+2},s.prototype.writeInt16BE=function(A,e,t){return A=+A,e|=0,t||N(this,A,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=A>>>8,this[e+1]=255&A):F(this,A,e,!1),e+2},s.prototype.writeInt32LE=function(A,e,t){return A=+A,e|=0,t||N(this,A,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&A,this[e+1]=A>>>8,this[e+2]=A>>>16,this[e+3]=A>>>24):O(this,A,e,!0),e+4},s.prototype.writeInt32BE=function(A,e,t){return A=+A,e|=0,t||N(this,A,e,4,2147483647,-2147483648),A<0&&(A=4294967295+A+1),s.TYPED_ARRAY_SUPPORT?(this[e]=A>>>24,this[e+1]=A>>>16,this[e+2]=A>>>8,this[e+3]=255&A):O(this,A,e,!1),e+4},s.prototype.writeFloatLE=function(A,e,t){return U(this,A,e,!0,t)},s.prototype.writeFloatBE=function(A,e,t){return U(this,A,e,!1,t)},s.prototype.writeDoubleLE=function(A,e,t){return Y(this,A,e,!0,t)},s.prototype.writeDoubleBE=function(A,e,t){return Y(this,A,e,!1,t)},s.prototype.copy=function(A,e,t,i){if(t||(t=0),i||0===i||(i=this.length),e>=A.length&&(e=A.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),A.length-e=0;--r)A[r+e]=this[r+t];else if(n<1e3||!s.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,t=void 0===t?this.length:t>>>0,A||(A=0),"number"==typeof A)for(n=e;n55295&&t<57344){if(!r){if(t>56319){(e-=3)>-1&&n.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&n.push(239,191,189);continue}r=t;continue}if(t<56320){(e-=3)>-1&&n.push(239,191,189),r=t;continue}t=65536+(r-55296<<10|t-56320)}else r&&(e-=3)>-1&&n.push(239,191,189);if(r=null,t<128){if((e-=1)<0)break;n.push(t)}else if(t<2048){if((e-=2)<0)break;n.push(t>>6|192,63&t|128)}else if(t<65536){if((e-=3)<0)break;n.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;n.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return n}function K(A){return i.toByteArray(function(A){if((A=function(A){return A.trim?A.trim():A.replace(/^\s+|\s+$/g,"")}(A).replace(x,"")).length<2)return"";for(;A.length%4!=0;)A+="=";return A}(A))}function J(A,e,t,i){for(var r=0;r=e.length||r>=A.length);++r)e[r+t]=A[r];return r}}).call(this,t(33))},function(A,e){A.exports=function(A,e){if(!Object.prototype.hasOwnProperty.call(A,e))throw new TypeError("attempted to use private field on non-instance");return A},A.exports.default=A.exports,A.exports.__esModule=!0},function(A,e){var t=0;A.exports=function(A){return"__private_"+t+++"_"+A},A.exports.default=A.exports,A.exports.__esModule=!0},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(910);var i=t(447);Object.keys(i).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===i[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return i[A]}}))}));var r=t(914);Object.keys(r).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===r[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return r[A]}}))}));var n=t(960);Object.keys(n).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===n[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return n[A]}}))}));var o=t(963);Object.keys(o).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===o[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return o[A]}}))}));var a=t(965);Object.keys(a).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===a[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return a[A]}}))}));var s=t(471);Object.keys(s).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===s[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return s[A]}}))}));var c=t(971);Object.keys(c).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===c[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return c[A]}}))}));var g=t(230);Object.keys(g).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===g[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return g[A]}}))}));var f=t(454);Object.keys(f).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===f[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return f[A]}}))}));var u=t(977);Object.keys(u).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===u[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return u[A]}}))}));var h=t(985);Object.keys(h).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===h[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return h[A]}}))}));var d=t(327);Object.keys(d).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===d[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return d[A]}}))}));var B=t(995);Object.keys(B).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===B[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return B[A]}}))}));var l=t(468);Object.keys(l).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===l[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return l[A]}}))}));var I=t(998);Object.keys(I).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===I[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return I[A]}}))}));var E=t(474);Object.keys(E).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===E[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return E[A]}}))}));var C=t(1079);Object.keys(C).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===C[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return C[A]}}))}));var Q=t(1081);Object.keys(Q).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===Q[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return Q[A]}}))}));var p=t(1083);Object.keys(p).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===p[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return p[A]}}))}))},function(A,e,t){(function(A){!function(A,e){"use strict";function i(A,e){if(!A)throw new Error(e||"Assertion failed")}function r(A,e){A.super_=e;var t=function(){};t.prototype=e.prototype,A.prototype=new t,A.prototype.constructor=A}function n(A,e,t){if(n.isBN(A))return A;this.negative=0,this.words=null,this.length=0,this.red=null,null!==A&&("le"!==e&&"be"!==e||(t=e,e=10),this._init(A||0,e||10,t||"be"))}var o;"object"==typeof A?A.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t(909).Buffer}catch(A){}function a(A,e){var t=A.charCodeAt(e);return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void i(!1,"Invalid character in "+A)}function s(A,e,t){var i=a(A,t);return t-1>=e&&(i|=a(A,t-1)<<4),i}function c(A,e,t,r){for(var n=0,o=0,a=Math.min(A.length,t),s=e;s=49?c-49+10:c>=17?c-17+10:c,i(c>=0&&o0?A:e},n.min=function(A,e){return A.cmp(e)<0?A:e},n.prototype._init=function(A,e,t){if("number"==typeof A)return this._initNumber(A,e,t);if("object"==typeof A)return this._initArray(A,e,t);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var r=0;"-"===(A=A.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)o=A[r]|A[r-1]<<8|A[r-2]<<16,this.words[n]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===t)for(r=0,n=0;r>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this._strip()},n.prototype._parseHex=function(A,e,t){this.length=Math.ceil((A.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)r=s(A,e,i)<=18?(n-=18,o+=1,this.words[o]|=r>>>26):n+=8;else for(i=(A.length-e)%2==0?e+1:e;i=18?(n-=18,o+=1,this.words[o]|=r>>>26):n+=8;this._strip()},n.prototype._parseBase=function(A,e,t){this.words=[0],this.length=1;for(var i=0,r=1;r<=67108863;r*=e)i++;i--,r=r/e|0;for(var n=A.length-t,o=n%i,a=Math.min(n,n-o)+t,s=0,g=t;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(A){n.prototype.inspect=f}else n.prototype.inspect=f;function f(){return(this.red?""}var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(A,e){var t;if(e=0|e||1,16===(A=A||10)||"hex"===A){t="";for(var r=0,n=0,o=0;o>>24-r&16777215)||o!==this.length-1?u[6-s.length]+s+t:s+t,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(t=n.toString(16)+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(A===(0|A)&&A>=2&&A<=36){var c=h[A],g=d[A];t="";var f=this.clone();for(f.negative=0;!f.isZero();){var B=f.modrn(g).toString(A);t=(f=f.idivn(g)).isZero()?B+t:u[c-B.length]+B+t}for(this.isZero()&&(t="0"+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}i(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var A=this.words[0];return 2===this.length?A+=67108864*this.words[1]:3===this.length&&1===this.words[2]?A+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-A:A},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(A,e){return this.toArrayLike(o,A,e)}),n.prototype.toArray=function(A,e){return this.toArrayLike(Array,A,e)};function B(A,e,t){t.negative=e.negative^A.negative;var i=A.length+e.length|0;t.length=i,i=i-1|0;var r=0|A.words[0],n=0|e.words[0],o=r*n,a=67108863&o,s=o/67108864|0;t.words[0]=a;for(var c=1;c>>26,f=67108863&s,u=Math.min(c,e.length-1),h=Math.max(0,c-A.length+1);h<=u;h++){var d=c-h|0;g+=(o=(r=0|A.words[d])*(n=0|e.words[h])+f)/67108864|0,f=67108863&o}t.words[c]=0|f,s=0|g}return 0!==s?t.words[c]=0|s:t.length--,t._strip()}n.prototype.toArrayLike=function(A,e,t){this._strip();var r=this.byteLength(),n=t||Math.max(1,r);i(r<=n,"byte array longer than desired length"),i(n>0,"Requested array length <= 0");var o=function(A,e){return A.allocUnsafe?A.allocUnsafe(e):new A(e)}(A,n);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,r),o},n.prototype._toArrayLikeLE=function(A,e){for(var t=0,i=0,r=0,n=0;r>8&255),t>16&255),6===n?(t>24&255),i=0,n=0):(i=o>>>24,n+=2)}if(t=0&&(A[t--]=o>>8&255),t>=0&&(A[t--]=o>>16&255),6===n?(t>=0&&(A[t--]=o>>24&255),i=0,n=0):(i=o>>>24,n+=2)}if(t>=0)for(A[t--]=i;t>=0;)A[t--]=0},Math.clz32?n.prototype._countBits=function(A){return 32-Math.clz32(A)}:n.prototype._countBits=function(A){var e=A,t=0;return e>=4096&&(t+=13,e>>>=13),e>=64&&(t+=7,e>>>=7),e>=8&&(t+=4,e>>>=4),e>=2&&(t+=2,e>>>=2),t+e},n.prototype._zeroBits=function(A){if(0===A)return 26;var e=A,t=0;return 0==(8191&e)&&(t+=13,e>>>=13),0==(127&e)&&(t+=7,e>>>=7),0==(15&e)&&(t+=4,e>>>=4),0==(3&e)&&(t+=2,e>>>=2),0==(1&e)&&t++,t},n.prototype.bitLength=function(){var A=this.words[this.length-1],e=this._countBits(A);return 26*(this.length-1)+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var A=0,e=0;eA.length?this.clone().ior(A):A.clone().ior(this)},n.prototype.uor=function(A){return this.length>A.length?this.clone().iuor(A):A.clone().iuor(this)},n.prototype.iuand=function(A){var e;e=this.length>A.length?A:this;for(var t=0;tA.length?this.clone().iand(A):A.clone().iand(this)},n.prototype.uand=function(A){return this.length>A.length?this.clone().iuand(A):A.clone().iuand(this)},n.prototype.iuxor=function(A){var e,t;this.length>A.length?(e=this,t=A):(e=A,t=this);for(var i=0;iA.length?this.clone().ixor(A):A.clone().ixor(this)},n.prototype.uxor=function(A){return this.length>A.length?this.clone().iuxor(A):A.clone().iuxor(this)},n.prototype.inotn=function(A){i("number"==typeof A&&A>=0);var e=0|Math.ceil(A/26),t=A%26;this._expand(e),t>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-t),this._strip()},n.prototype.notn=function(A){return this.clone().inotn(A)},n.prototype.setn=function(A,e){i("number"==typeof A&&A>=0);var t=A/26|0,r=A%26;return this._expand(t+1),this.words[t]=e?this.words[t]|1<A.length?(t=this,i=A):(t=A,i=this);for(var r=0,n=0;n>>26;for(;0!==r&&n>>26;if(this.length=t.length,0!==r)this.words[this.length]=r,this.length++;else if(t!==this)for(;nA.length?this.clone().iadd(A):A.clone().iadd(this)},n.prototype.isub=function(A){if(0!==A.negative){A.negative=0;var e=this.iadd(A);return A.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(A),this.negative=1,this._normSign();var t,i,r=this.cmp(A);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(t=this,i=A):(t=A,i=this);for(var n=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==n&&o>26,this.words[o]=67108863&e;if(0===n&&o>>13,h=0|o[1],d=8191&h,B=h>>>13,l=0|o[2],I=8191&l,E=l>>>13,C=0|o[3],Q=8191&C,p=C>>>13,w=0|o[4],m=8191&w,y=w>>>13,M=0|o[5],b=8191&M,D=M>>>13,v=0|o[6],S=8191&v,k=v>>>13,G=0|o[7],N=8191&G,F=G>>>13,O=0|o[8],R=8191&O,U=O>>>13,Y=0|o[9],x=8191&Y,H=Y>>>13,L=0|a[0],K=8191&L,J=L>>>13,P=0|a[1],j=8191&P,_=P>>>13,q=0|a[2],T=8191&q,Z=q>>>13,V=0|a[3],W=8191&V,z=V>>>13,X=0|a[4],$=8191&X,AA=X>>>13,eA=0|a[5],tA=8191&eA,iA=eA>>>13,rA=0|a[6],nA=8191&rA,oA=rA>>>13,aA=0|a[7],sA=8191&aA,cA=aA>>>13,gA=0|a[8],fA=8191&gA,uA=gA>>>13,hA=0|a[9],dA=8191&hA,BA=hA>>>13;t.negative=A.negative^e.negative,t.length=19;var lA=(c+(i=Math.imul(f,K))|0)+((8191&(r=(r=Math.imul(f,J))+Math.imul(u,K)|0))<<13)|0;c=((n=Math.imul(u,J))+(r>>>13)|0)+(lA>>>26)|0,lA&=67108863,i=Math.imul(d,K),r=(r=Math.imul(d,J))+Math.imul(B,K)|0,n=Math.imul(B,J);var IA=(c+(i=i+Math.imul(f,j)|0)|0)+((8191&(r=(r=r+Math.imul(f,_)|0)+Math.imul(u,j)|0))<<13)|0;c=((n=n+Math.imul(u,_)|0)+(r>>>13)|0)+(IA>>>26)|0,IA&=67108863,i=Math.imul(I,K),r=(r=Math.imul(I,J))+Math.imul(E,K)|0,n=Math.imul(E,J),i=i+Math.imul(d,j)|0,r=(r=r+Math.imul(d,_)|0)+Math.imul(B,j)|0,n=n+Math.imul(B,_)|0;var EA=(c+(i=i+Math.imul(f,T)|0)|0)+((8191&(r=(r=r+Math.imul(f,Z)|0)+Math.imul(u,T)|0))<<13)|0;c=((n=n+Math.imul(u,Z)|0)+(r>>>13)|0)+(EA>>>26)|0,EA&=67108863,i=Math.imul(Q,K),r=(r=Math.imul(Q,J))+Math.imul(p,K)|0,n=Math.imul(p,J),i=i+Math.imul(I,j)|0,r=(r=r+Math.imul(I,_)|0)+Math.imul(E,j)|0,n=n+Math.imul(E,_)|0,i=i+Math.imul(d,T)|0,r=(r=r+Math.imul(d,Z)|0)+Math.imul(B,T)|0,n=n+Math.imul(B,Z)|0;var CA=(c+(i=i+Math.imul(f,W)|0)|0)+((8191&(r=(r=r+Math.imul(f,z)|0)+Math.imul(u,W)|0))<<13)|0;c=((n=n+Math.imul(u,z)|0)+(r>>>13)|0)+(CA>>>26)|0,CA&=67108863,i=Math.imul(m,K),r=(r=Math.imul(m,J))+Math.imul(y,K)|0,n=Math.imul(y,J),i=i+Math.imul(Q,j)|0,r=(r=r+Math.imul(Q,_)|0)+Math.imul(p,j)|0,n=n+Math.imul(p,_)|0,i=i+Math.imul(I,T)|0,r=(r=r+Math.imul(I,Z)|0)+Math.imul(E,T)|0,n=n+Math.imul(E,Z)|0,i=i+Math.imul(d,W)|0,r=(r=r+Math.imul(d,z)|0)+Math.imul(B,W)|0,n=n+Math.imul(B,z)|0;var QA=(c+(i=i+Math.imul(f,$)|0)|0)+((8191&(r=(r=r+Math.imul(f,AA)|0)+Math.imul(u,$)|0))<<13)|0;c=((n=n+Math.imul(u,AA)|0)+(r>>>13)|0)+(QA>>>26)|0,QA&=67108863,i=Math.imul(b,K),r=(r=Math.imul(b,J))+Math.imul(D,K)|0,n=Math.imul(D,J),i=i+Math.imul(m,j)|0,r=(r=r+Math.imul(m,_)|0)+Math.imul(y,j)|0,n=n+Math.imul(y,_)|0,i=i+Math.imul(Q,T)|0,r=(r=r+Math.imul(Q,Z)|0)+Math.imul(p,T)|0,n=n+Math.imul(p,Z)|0,i=i+Math.imul(I,W)|0,r=(r=r+Math.imul(I,z)|0)+Math.imul(E,W)|0,n=n+Math.imul(E,z)|0,i=i+Math.imul(d,$)|0,r=(r=r+Math.imul(d,AA)|0)+Math.imul(B,$)|0,n=n+Math.imul(B,AA)|0;var pA=(c+(i=i+Math.imul(f,tA)|0)|0)+((8191&(r=(r=r+Math.imul(f,iA)|0)+Math.imul(u,tA)|0))<<13)|0;c=((n=n+Math.imul(u,iA)|0)+(r>>>13)|0)+(pA>>>26)|0,pA&=67108863,i=Math.imul(S,K),r=(r=Math.imul(S,J))+Math.imul(k,K)|0,n=Math.imul(k,J),i=i+Math.imul(b,j)|0,r=(r=r+Math.imul(b,_)|0)+Math.imul(D,j)|0,n=n+Math.imul(D,_)|0,i=i+Math.imul(m,T)|0,r=(r=r+Math.imul(m,Z)|0)+Math.imul(y,T)|0,n=n+Math.imul(y,Z)|0,i=i+Math.imul(Q,W)|0,r=(r=r+Math.imul(Q,z)|0)+Math.imul(p,W)|0,n=n+Math.imul(p,z)|0,i=i+Math.imul(I,$)|0,r=(r=r+Math.imul(I,AA)|0)+Math.imul(E,$)|0,n=n+Math.imul(E,AA)|0,i=i+Math.imul(d,tA)|0,r=(r=r+Math.imul(d,iA)|0)+Math.imul(B,tA)|0,n=n+Math.imul(B,iA)|0;var wA=(c+(i=i+Math.imul(f,nA)|0)|0)+((8191&(r=(r=r+Math.imul(f,oA)|0)+Math.imul(u,nA)|0))<<13)|0;c=((n=n+Math.imul(u,oA)|0)+(r>>>13)|0)+(wA>>>26)|0,wA&=67108863,i=Math.imul(N,K),r=(r=Math.imul(N,J))+Math.imul(F,K)|0,n=Math.imul(F,J),i=i+Math.imul(S,j)|0,r=(r=r+Math.imul(S,_)|0)+Math.imul(k,j)|0,n=n+Math.imul(k,_)|0,i=i+Math.imul(b,T)|0,r=(r=r+Math.imul(b,Z)|0)+Math.imul(D,T)|0,n=n+Math.imul(D,Z)|0,i=i+Math.imul(m,W)|0,r=(r=r+Math.imul(m,z)|0)+Math.imul(y,W)|0,n=n+Math.imul(y,z)|0,i=i+Math.imul(Q,$)|0,r=(r=r+Math.imul(Q,AA)|0)+Math.imul(p,$)|0,n=n+Math.imul(p,AA)|0,i=i+Math.imul(I,tA)|0,r=(r=r+Math.imul(I,iA)|0)+Math.imul(E,tA)|0,n=n+Math.imul(E,iA)|0,i=i+Math.imul(d,nA)|0,r=(r=r+Math.imul(d,oA)|0)+Math.imul(B,nA)|0,n=n+Math.imul(B,oA)|0;var mA=(c+(i=i+Math.imul(f,sA)|0)|0)+((8191&(r=(r=r+Math.imul(f,cA)|0)+Math.imul(u,sA)|0))<<13)|0;c=((n=n+Math.imul(u,cA)|0)+(r>>>13)|0)+(mA>>>26)|0,mA&=67108863,i=Math.imul(R,K),r=(r=Math.imul(R,J))+Math.imul(U,K)|0,n=Math.imul(U,J),i=i+Math.imul(N,j)|0,r=(r=r+Math.imul(N,_)|0)+Math.imul(F,j)|0,n=n+Math.imul(F,_)|0,i=i+Math.imul(S,T)|0,r=(r=r+Math.imul(S,Z)|0)+Math.imul(k,T)|0,n=n+Math.imul(k,Z)|0,i=i+Math.imul(b,W)|0,r=(r=r+Math.imul(b,z)|0)+Math.imul(D,W)|0,n=n+Math.imul(D,z)|0,i=i+Math.imul(m,$)|0,r=(r=r+Math.imul(m,AA)|0)+Math.imul(y,$)|0,n=n+Math.imul(y,AA)|0,i=i+Math.imul(Q,tA)|0,r=(r=r+Math.imul(Q,iA)|0)+Math.imul(p,tA)|0,n=n+Math.imul(p,iA)|0,i=i+Math.imul(I,nA)|0,r=(r=r+Math.imul(I,oA)|0)+Math.imul(E,nA)|0,n=n+Math.imul(E,oA)|0,i=i+Math.imul(d,sA)|0,r=(r=r+Math.imul(d,cA)|0)+Math.imul(B,sA)|0,n=n+Math.imul(B,cA)|0;var yA=(c+(i=i+Math.imul(f,fA)|0)|0)+((8191&(r=(r=r+Math.imul(f,uA)|0)+Math.imul(u,fA)|0))<<13)|0;c=((n=n+Math.imul(u,uA)|0)+(r>>>13)|0)+(yA>>>26)|0,yA&=67108863,i=Math.imul(x,K),r=(r=Math.imul(x,J))+Math.imul(H,K)|0,n=Math.imul(H,J),i=i+Math.imul(R,j)|0,r=(r=r+Math.imul(R,_)|0)+Math.imul(U,j)|0,n=n+Math.imul(U,_)|0,i=i+Math.imul(N,T)|0,r=(r=r+Math.imul(N,Z)|0)+Math.imul(F,T)|0,n=n+Math.imul(F,Z)|0,i=i+Math.imul(S,W)|0,r=(r=r+Math.imul(S,z)|0)+Math.imul(k,W)|0,n=n+Math.imul(k,z)|0,i=i+Math.imul(b,$)|0,r=(r=r+Math.imul(b,AA)|0)+Math.imul(D,$)|0,n=n+Math.imul(D,AA)|0,i=i+Math.imul(m,tA)|0,r=(r=r+Math.imul(m,iA)|0)+Math.imul(y,tA)|0,n=n+Math.imul(y,iA)|0,i=i+Math.imul(Q,nA)|0,r=(r=r+Math.imul(Q,oA)|0)+Math.imul(p,nA)|0,n=n+Math.imul(p,oA)|0,i=i+Math.imul(I,sA)|0,r=(r=r+Math.imul(I,cA)|0)+Math.imul(E,sA)|0,n=n+Math.imul(E,cA)|0,i=i+Math.imul(d,fA)|0,r=(r=r+Math.imul(d,uA)|0)+Math.imul(B,fA)|0,n=n+Math.imul(B,uA)|0;var MA=(c+(i=i+Math.imul(f,dA)|0)|0)+((8191&(r=(r=r+Math.imul(f,BA)|0)+Math.imul(u,dA)|0))<<13)|0;c=((n=n+Math.imul(u,BA)|0)+(r>>>13)|0)+(MA>>>26)|0,MA&=67108863,i=Math.imul(x,j),r=(r=Math.imul(x,_))+Math.imul(H,j)|0,n=Math.imul(H,_),i=i+Math.imul(R,T)|0,r=(r=r+Math.imul(R,Z)|0)+Math.imul(U,T)|0,n=n+Math.imul(U,Z)|0,i=i+Math.imul(N,W)|0,r=(r=r+Math.imul(N,z)|0)+Math.imul(F,W)|0,n=n+Math.imul(F,z)|0,i=i+Math.imul(S,$)|0,r=(r=r+Math.imul(S,AA)|0)+Math.imul(k,$)|0,n=n+Math.imul(k,AA)|0,i=i+Math.imul(b,tA)|0,r=(r=r+Math.imul(b,iA)|0)+Math.imul(D,tA)|0,n=n+Math.imul(D,iA)|0,i=i+Math.imul(m,nA)|0,r=(r=r+Math.imul(m,oA)|0)+Math.imul(y,nA)|0,n=n+Math.imul(y,oA)|0,i=i+Math.imul(Q,sA)|0,r=(r=r+Math.imul(Q,cA)|0)+Math.imul(p,sA)|0,n=n+Math.imul(p,cA)|0,i=i+Math.imul(I,fA)|0,r=(r=r+Math.imul(I,uA)|0)+Math.imul(E,fA)|0,n=n+Math.imul(E,uA)|0;var bA=(c+(i=i+Math.imul(d,dA)|0)|0)+((8191&(r=(r=r+Math.imul(d,BA)|0)+Math.imul(B,dA)|0))<<13)|0;c=((n=n+Math.imul(B,BA)|0)+(r>>>13)|0)+(bA>>>26)|0,bA&=67108863,i=Math.imul(x,T),r=(r=Math.imul(x,Z))+Math.imul(H,T)|0,n=Math.imul(H,Z),i=i+Math.imul(R,W)|0,r=(r=r+Math.imul(R,z)|0)+Math.imul(U,W)|0,n=n+Math.imul(U,z)|0,i=i+Math.imul(N,$)|0,r=(r=r+Math.imul(N,AA)|0)+Math.imul(F,$)|0,n=n+Math.imul(F,AA)|0,i=i+Math.imul(S,tA)|0,r=(r=r+Math.imul(S,iA)|0)+Math.imul(k,tA)|0,n=n+Math.imul(k,iA)|0,i=i+Math.imul(b,nA)|0,r=(r=r+Math.imul(b,oA)|0)+Math.imul(D,nA)|0,n=n+Math.imul(D,oA)|0,i=i+Math.imul(m,sA)|0,r=(r=r+Math.imul(m,cA)|0)+Math.imul(y,sA)|0,n=n+Math.imul(y,cA)|0,i=i+Math.imul(Q,fA)|0,r=(r=r+Math.imul(Q,uA)|0)+Math.imul(p,fA)|0,n=n+Math.imul(p,uA)|0;var DA=(c+(i=i+Math.imul(I,dA)|0)|0)+((8191&(r=(r=r+Math.imul(I,BA)|0)+Math.imul(E,dA)|0))<<13)|0;c=((n=n+Math.imul(E,BA)|0)+(r>>>13)|0)+(DA>>>26)|0,DA&=67108863,i=Math.imul(x,W),r=(r=Math.imul(x,z))+Math.imul(H,W)|0,n=Math.imul(H,z),i=i+Math.imul(R,$)|0,r=(r=r+Math.imul(R,AA)|0)+Math.imul(U,$)|0,n=n+Math.imul(U,AA)|0,i=i+Math.imul(N,tA)|0,r=(r=r+Math.imul(N,iA)|0)+Math.imul(F,tA)|0,n=n+Math.imul(F,iA)|0,i=i+Math.imul(S,nA)|0,r=(r=r+Math.imul(S,oA)|0)+Math.imul(k,nA)|0,n=n+Math.imul(k,oA)|0,i=i+Math.imul(b,sA)|0,r=(r=r+Math.imul(b,cA)|0)+Math.imul(D,sA)|0,n=n+Math.imul(D,cA)|0,i=i+Math.imul(m,fA)|0,r=(r=r+Math.imul(m,uA)|0)+Math.imul(y,fA)|0,n=n+Math.imul(y,uA)|0;var vA=(c+(i=i+Math.imul(Q,dA)|0)|0)+((8191&(r=(r=r+Math.imul(Q,BA)|0)+Math.imul(p,dA)|0))<<13)|0;c=((n=n+Math.imul(p,BA)|0)+(r>>>13)|0)+(vA>>>26)|0,vA&=67108863,i=Math.imul(x,$),r=(r=Math.imul(x,AA))+Math.imul(H,$)|0,n=Math.imul(H,AA),i=i+Math.imul(R,tA)|0,r=(r=r+Math.imul(R,iA)|0)+Math.imul(U,tA)|0,n=n+Math.imul(U,iA)|0,i=i+Math.imul(N,nA)|0,r=(r=r+Math.imul(N,oA)|0)+Math.imul(F,nA)|0,n=n+Math.imul(F,oA)|0,i=i+Math.imul(S,sA)|0,r=(r=r+Math.imul(S,cA)|0)+Math.imul(k,sA)|0,n=n+Math.imul(k,cA)|0,i=i+Math.imul(b,fA)|0,r=(r=r+Math.imul(b,uA)|0)+Math.imul(D,fA)|0,n=n+Math.imul(D,uA)|0;var SA=(c+(i=i+Math.imul(m,dA)|0)|0)+((8191&(r=(r=r+Math.imul(m,BA)|0)+Math.imul(y,dA)|0))<<13)|0;c=((n=n+Math.imul(y,BA)|0)+(r>>>13)|0)+(SA>>>26)|0,SA&=67108863,i=Math.imul(x,tA),r=(r=Math.imul(x,iA))+Math.imul(H,tA)|0,n=Math.imul(H,iA),i=i+Math.imul(R,nA)|0,r=(r=r+Math.imul(R,oA)|0)+Math.imul(U,nA)|0,n=n+Math.imul(U,oA)|0,i=i+Math.imul(N,sA)|0,r=(r=r+Math.imul(N,cA)|0)+Math.imul(F,sA)|0,n=n+Math.imul(F,cA)|0,i=i+Math.imul(S,fA)|0,r=(r=r+Math.imul(S,uA)|0)+Math.imul(k,fA)|0,n=n+Math.imul(k,uA)|0;var kA=(c+(i=i+Math.imul(b,dA)|0)|0)+((8191&(r=(r=r+Math.imul(b,BA)|0)+Math.imul(D,dA)|0))<<13)|0;c=((n=n+Math.imul(D,BA)|0)+(r>>>13)|0)+(kA>>>26)|0,kA&=67108863,i=Math.imul(x,nA),r=(r=Math.imul(x,oA))+Math.imul(H,nA)|0,n=Math.imul(H,oA),i=i+Math.imul(R,sA)|0,r=(r=r+Math.imul(R,cA)|0)+Math.imul(U,sA)|0,n=n+Math.imul(U,cA)|0,i=i+Math.imul(N,fA)|0,r=(r=r+Math.imul(N,uA)|0)+Math.imul(F,fA)|0,n=n+Math.imul(F,uA)|0;var GA=(c+(i=i+Math.imul(S,dA)|0)|0)+((8191&(r=(r=r+Math.imul(S,BA)|0)+Math.imul(k,dA)|0))<<13)|0;c=((n=n+Math.imul(k,BA)|0)+(r>>>13)|0)+(GA>>>26)|0,GA&=67108863,i=Math.imul(x,sA),r=(r=Math.imul(x,cA))+Math.imul(H,sA)|0,n=Math.imul(H,cA),i=i+Math.imul(R,fA)|0,r=(r=r+Math.imul(R,uA)|0)+Math.imul(U,fA)|0,n=n+Math.imul(U,uA)|0;var NA=(c+(i=i+Math.imul(N,dA)|0)|0)+((8191&(r=(r=r+Math.imul(N,BA)|0)+Math.imul(F,dA)|0))<<13)|0;c=((n=n+Math.imul(F,BA)|0)+(r>>>13)|0)+(NA>>>26)|0,NA&=67108863,i=Math.imul(x,fA),r=(r=Math.imul(x,uA))+Math.imul(H,fA)|0,n=Math.imul(H,uA);var FA=(c+(i=i+Math.imul(R,dA)|0)|0)+((8191&(r=(r=r+Math.imul(R,BA)|0)+Math.imul(U,dA)|0))<<13)|0;c=((n=n+Math.imul(U,BA)|0)+(r>>>13)|0)+(FA>>>26)|0,FA&=67108863;var OA=(c+(i=Math.imul(x,dA))|0)+((8191&(r=(r=Math.imul(x,BA))+Math.imul(H,dA)|0))<<13)|0;return c=((n=Math.imul(H,BA))+(r>>>13)|0)+(OA>>>26)|0,OA&=67108863,s[0]=lA,s[1]=IA,s[2]=EA,s[3]=CA,s[4]=QA,s[5]=pA,s[6]=wA,s[7]=mA,s[8]=yA,s[9]=MA,s[10]=bA,s[11]=DA,s[12]=vA,s[13]=SA,s[14]=kA,s[15]=GA,s[16]=NA,s[17]=FA,s[18]=OA,0!==c&&(s[19]=c,t.length++),t};function I(A,e,t){t.negative=e.negative^A.negative,t.length=A.length+e.length;for(var i=0,r=0,n=0;n>>26)|0)>>>26,o&=67108863}t.words[n]=a,i=o,o=r}return 0!==i?t.words[n]=i:t.length--,t._strip()}function E(A,e,t){return I(A,e,t)}function C(A,e){this.x=A,this.y=e}Math.imul||(l=B),n.prototype.mulTo=function(A,e){var t=this.length+A.length;return 10===this.length&&10===A.length?l(this,A,e):t<63?B(this,A,e):t<1024?I(this,A,e):E(this,A,e)},C.prototype.makeRBT=function(A){for(var e=new Array(A),t=n.prototype._countBits(A)-1,i=0;i>=1;return i},C.prototype.permute=function(A,e,t,i,r,n){for(var o=0;o>>=1)r++;return 1<>>=13,t[2*o+1]=8191&n,n>>>=13;for(o=2*e;o>=26,t+=n/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),e?this.ineg():this},n.prototype.muln=function(A){return this.clone().imuln(A)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(A){var e=function(A){for(var e=new Array(A.bitLength()),t=0;t>>r&1}return e}(A);if(0===e.length)return new n(1);for(var t=this,i=0;i=0);var e,t=A%26,r=(A-t)/26,n=67108863>>>26-t<<26-t;if(0!==t){var o=0;for(e=0;e>>26-t}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e=0),r=e?(e-e%26)/26:0;var n=A%26,o=Math.min((A-n)/26,this.length),a=67108863^67108863>>>n<o)for(this.length-=o,c=0;c=0&&(0!==g||c>=r);c--){var f=0|this.words[c];this.words[c]=g<<26-n|f>>>n,g=f&a}return s&&0!==g&&(s.words[s.length++]=g),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(A,e,t){return i(0===this.negative),this.iushrn(A,e,t)},n.prototype.shln=function(A){return this.clone().ishln(A)},n.prototype.ushln=function(A){return this.clone().iushln(A)},n.prototype.shrn=function(A){return this.clone().ishrn(A)},n.prototype.ushrn=function(A){return this.clone().iushrn(A)},n.prototype.testn=function(A){i("number"==typeof A&&A>=0);var e=A%26,t=(A-e)/26,r=1<=0);var e=A%26,t=(A-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==e&&t++,this.length=Math.min(t,this.length),0!==e){var r=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(A){if(i("number"==typeof A),i(A<67108864),A<0)return this.iaddn(-A);if(0!==this.negative)return this.negative=0,this.iaddn(A),this.negative=1,this;if(this.words[0]-=A,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(s/67108864|0),this.words[r+t]=67108863&n}for(;r>26,this.words[r+t]=67108863&n;if(0===a)return this._strip();for(i(-1===a),a=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this._strip()},n.prototype._wordDiv=function(A,e){var t=(this.length,A.length),i=this.clone(),r=A,o=0|r.words[r.length-1];0!==(t=26-this._countBits(o))&&(r=r.ushln(t),i.iushln(t),o=0|r.words[r.length-1]);var a,s=i.length-r.length;if("mod"!==e){(a=new n(null)).length=s+1,a.words=new Array(a.length);for(var c=0;c=0;f--){var u=67108864*(0|i.words[r.length+f])+(0|i.words[r.length+f-1]);for(u=Math.min(u/o|0,67108863),i._ishlnsubmul(r,u,f);0!==i.negative;)u--,i.negative=0,i._ishlnsubmul(r,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=u)}return a&&a._strip(),i._strip(),"div"!==e&&0!==t&&i.iushrn(t),{div:a||null,mod:i}},n.prototype.divmod=function(A,e,t){return i(!A.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===A.negative?(a=this.neg().divmod(A,e),"mod"!==e&&(r=a.div.neg()),"div"!==e&&(o=a.mod.neg(),t&&0!==o.negative&&o.iadd(A)),{div:r,mod:o}):0===this.negative&&0!==A.negative?(a=this.divmod(A.neg(),e),"mod"!==e&&(r=a.div.neg()),{div:r,mod:a.mod}):0!=(this.negative&A.negative)?(a=this.neg().divmod(A.neg(),e),"div"!==e&&(o=a.mod.neg(),t&&0!==o.negative&&o.isub(A)),{div:a.div,mod:o}):A.length>this.length||this.cmp(A)<0?{div:new n(0),mod:this}:1===A.length?"div"===e?{div:this.divn(A.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modrn(A.words[0]))}:{div:this.divn(A.words[0]),mod:new n(this.modrn(A.words[0]))}:this._wordDiv(A,e);var r,o,a},n.prototype.div=function(A){return this.divmod(A,"div",!1).div},n.prototype.mod=function(A){return this.divmod(A,"mod",!1).mod},n.prototype.umod=function(A){return this.divmod(A,"mod",!0).mod},n.prototype.divRound=function(A){var e=this.divmod(A);if(e.mod.isZero())return e.div;var t=0!==e.div.negative?e.mod.isub(A):e.mod,i=A.ushrn(1),r=A.andln(1),n=t.cmp(i);return n<0||1===r&&0===n?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modrn=function(A){var e=A<0;e&&(A=-A),i(A<=67108863);for(var t=(1<<26)%A,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%A;return e?-r:r},n.prototype.modn=function(A){return this.modrn(A)},n.prototype.idivn=function(A){var e=A<0;e&&(A=-A),i(A<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/A|0,t=n%A}return this._strip(),e?this.ineg():this},n.prototype.divn=function(A){return this.clone().idivn(A)},n.prototype.egcd=function(A){i(0===A.negative),i(!A.isZero());var e=this,t=A.clone();e=0!==e.negative?e.umod(A):e.clone();for(var r=new n(1),o=new n(0),a=new n(0),s=new n(1),c=0;e.isEven()&&t.isEven();)e.iushrn(1),t.iushrn(1),++c;for(var g=t.clone(),f=e.clone();!e.isZero();){for(var u=0,h=1;0==(e.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(e.iushrn(u);u-- >0;)(r.isOdd()||o.isOdd())&&(r.iadd(g),o.isub(f)),r.iushrn(1),o.iushrn(1);for(var d=0,B=1;0==(t.words[0]&B)&&d<26;++d,B<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(g),s.isub(f)),a.iushrn(1),s.iushrn(1);e.cmp(t)>=0?(e.isub(t),r.isub(a),o.isub(s)):(t.isub(e),a.isub(r),s.isub(o))}return{a:a,b:s,gcd:t.iushln(c)}},n.prototype._invmp=function(A){i(0===A.negative),i(!A.isZero());var e=this,t=A.clone();e=0!==e.negative?e.umod(A):e.clone();for(var r,o=new n(1),a=new n(0),s=t.clone();e.cmpn(1)>0&&t.cmpn(1)>0;){for(var c=0,g=1;0==(e.words[0]&g)&&c<26;++c,g<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var f=0,u=1;0==(t.words[0]&u)&&f<26;++f,u<<=1);if(f>0)for(t.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);e.cmp(t)>=0?(e.isub(t),o.isub(a)):(t.isub(e),a.isub(o))}return(r=0===e.cmpn(1)?o:a).cmpn(0)<0&&r.iadd(A),r},n.prototype.gcd=function(A){if(this.isZero())return A.abs();if(A.isZero())return this.abs();var e=this.clone(),t=A.clone();e.negative=0,t.negative=0;for(var i=0;e.isEven()&&t.isEven();i++)e.iushrn(1),t.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;t.isEven();)t.iushrn(1);var r=e.cmp(t);if(r<0){var n=e;e=t,t=n}else if(0===r||0===t.cmpn(1))break;e.isub(t)}return t.iushln(i)},n.prototype.invm=function(A){return this.egcd(A).a.umod(A)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(A){return this.words[0]&A},n.prototype.bincn=function(A){i("number"==typeof A);var e=A%26,t=(A-e)/26,r=1<>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(A){var e,t=A<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this._strip(),this.length>1)e=1;else{t&&(A=-A),i(A<=67108863,"Number is too big");var r=0|this.words[0];e=r===A?0:rA.length)return 1;if(this.length=0;t--){var i=0|this.words[t],r=0|A.words[t];if(i!==r){ir&&(e=1);break}}return e},n.prototype.gtn=function(A){return 1===this.cmpn(A)},n.prototype.gt=function(A){return 1===this.cmp(A)},n.prototype.gten=function(A){return this.cmpn(A)>=0},n.prototype.gte=function(A){return this.cmp(A)>=0},n.prototype.ltn=function(A){return-1===this.cmpn(A)},n.prototype.lt=function(A){return-1===this.cmp(A)},n.prototype.lten=function(A){return this.cmpn(A)<=0},n.prototype.lte=function(A){return this.cmp(A)<=0},n.prototype.eqn=function(A){return 0===this.cmpn(A)},n.prototype.eq=function(A){return 0===this.cmp(A)},n.red=function(A){return new b(A)},n.prototype.toRed=function(A){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),A.convertTo(this)._forceRed(A)},n.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(A){return this.red=A,this},n.prototype.forceRed=function(A){return i(!this.red,"Already a number in reduction context"),this._forceRed(A)},n.prototype.redAdd=function(A){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,A)},n.prototype.redIAdd=function(A){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,A)},n.prototype.redSub=function(A){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,A)},n.prototype.redISub=function(A){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,A)},n.prototype.redShl=function(A){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,A)},n.prototype.redMul=function(A){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,A),this.red.mul(this,A)},n.prototype.redIMul=function(A){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,A),this.red.imul(this,A)},n.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(A){return i(this.red&&!A.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,A)};var Q={k256:null,p224:null,p192:null,p25519:null};function p(A,e){this.name=A,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){p.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){p.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){p.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){p.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(A){if("string"==typeof A){var e=n._prime(A);this.m=e.p,this.prime=e}else i(A.gtn(1),"modulus must be greater than 1"),this.m=A,this.prime=null}function D(A){b.call(this,A),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}p.prototype._tmp=function(){var A=new n(null);return A.words=new Array(Math.ceil(this.n/13)),A},p.prototype.ireduce=function(A){var e,t=A;do{this.split(t,this.tmp),e=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},p.prototype.split=function(A,e){A.iushrn(this.n,0,e)},p.prototype.imulK=function(A){return A.imul(this.k)},r(w,p),w.prototype.split=function(A,e){for(var t=Math.min(A.length,9),i=0;i>>22,r=n}r>>>=22,A.words[i-10]=r,0===r&&A.length>10?A.length-=10:A.length-=9},w.prototype.imulK=function(A){A.words[A.length]=0,A.words[A.length+1]=0,A.length+=2;for(var e=0,t=0;t>>=26,A.words[t]=r,e=i}return 0!==e&&(A.words[A.length++]=e),A},n._prime=function(A){if(Q[A])return Q[A];var e;if("k256"===A)e=new w;else if("p224"===A)e=new m;else if("p192"===A)e=new y;else{if("p25519"!==A)throw new Error("Unknown prime "+A);e=new M}return Q[A]=e,e},b.prototype._verify1=function(A){i(0===A.negative,"red works only with positives"),i(A.red,"red works only with red numbers")},b.prototype._verify2=function(A,e){i(0==(A.negative|e.negative),"red works only with positives"),i(A.red&&A.red===e.red,"red works only with red numbers")},b.prototype.imod=function(A){return this.prime?this.prime.ireduce(A)._forceRed(this):(g(A,A.umod(this.m)._forceRed(this)),A)},b.prototype.neg=function(A){return A.isZero()?A.clone():this.m.sub(A)._forceRed(this)},b.prototype.add=function(A,e){this._verify2(A,e);var t=A.add(e);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},b.prototype.iadd=function(A,e){this._verify2(A,e);var t=A.iadd(e);return t.cmp(this.m)>=0&&t.isub(this.m),t},b.prototype.sub=function(A,e){this._verify2(A,e);var t=A.sub(e);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},b.prototype.isub=function(A,e){this._verify2(A,e);var t=A.isub(e);return t.cmpn(0)<0&&t.iadd(this.m),t},b.prototype.shl=function(A,e){return this._verify1(A),this.imod(A.ushln(e))},b.prototype.imul=function(A,e){return this._verify2(A,e),this.imod(A.imul(e))},b.prototype.mul=function(A,e){return this._verify2(A,e),this.imod(A.mul(e))},b.prototype.isqr=function(A){return this.imul(A,A.clone())},b.prototype.sqr=function(A){return this.mul(A,A)},b.prototype.sqrt=function(A){if(A.isZero())return A.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var t=this.m.add(new n(1)).iushrn(2);return this.pow(A,t)}for(var r=this.m.subn(1),o=0;!r.isZero()&&0===r.andln(1);)o++,r.iushrn(1);i(!r.isZero());var a=new n(1).toRed(this),s=a.redNeg(),c=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new n(2*g*g).toRed(this);0!==this.pow(g,c).cmp(s);)g.redIAdd(s);for(var f=this.pow(g,r),u=this.pow(A,r.addn(1).iushrn(1)),h=this.pow(A,r),d=o;0!==h.cmp(a);){for(var B=h,l=0;0!==B.cmp(a);l++)B=B.redSqr();i(l=0;i--){for(var c=e.words[i],g=s-1;g>=0;g--){var f=c>>g&1;r!==t[0]&&(r=this.sqr(r)),0!==f||0!==o?(o<<=1,o|=f,(4===++a||0===i&&0===g)&&(r=this.mul(r,t[o]),a=0,o=0)):a=0}s=26}return r},b.prototype.convertTo=function(A){var e=A.umod(this.m);return e===A?e.clone():e},b.prototype.convertFrom=function(A){var e=A.clone();return e.red=null,e},n.mont=function(A){return new D(A)},r(D,b),D.prototype.convertTo=function(A){return this.imod(A.ushln(this.shift))},D.prototype.convertFrom=function(A){var e=this.imod(A.mul(this.rinv));return e.red=null,e},D.prototype.imul=function(A,e){if(A.isZero()||e.isZero())return A.words[0]=0,A.length=1,A;var t=A.imul(e),i=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=t.isub(i).iushrn(this.shift),n=r;return r.cmp(this.m)>=0?n=r.isub(this.m):r.cmpn(0)<0&&(n=r.iadd(this.m)),n._forceRed(this)},D.prototype.mul=function(A,e){if(A.isZero()||e.isZero())return new n(0)._forceRed(this);var t=A.mul(e),i=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=t.isub(i).iushrn(this.shift),o=r;return r.cmp(this.m)>=0?o=r.isub(this.m):r.cmpn(0)<0&&(o=r.iadd(this.m)),o._forceRed(this)},D.prototype.invm=function(A){return this.imod(A._invmp(this.m).mul(this.r2))._forceRed(this)}}(A,this)}).call(this,t(45)(A))},function(A,e,t){"use strict";t.d(e,"b",(function(){return g})),t.d(e,"a",(function(){return f}));var i=t(2),r=t(8),n=t(3),o=t(13),a=t(63),s=t(271),c=t(135),g=function(A){function e(e){var t=A.call(this,e)||this;return t.destination=e,t}return i.__extends(e,A),e}(n.a),f=function(A){function e(){var e=A.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return i.__extends(e,A),e.prototype[c.a]=function(){return new g(this)},e.prototype.lift=function(A){var e=new u(this,this);return e.operator=A,e},e.prototype.next=function(A){if(this.closed)throw new a.a;if(!this.isStopped)for(var e=this.observers,t=e.length,i=e.slice(),r=0;r1)for(var t=1;t>24&255,A[e+1]=t>>16&255,A[e+2]=t>>8&255,A[e+3]=255&t,A[e+4]=i>>24&255,A[e+5]=i>>16&255,A[e+6]=i>>8&255,A[e+7]=255&i}function B(A,e,t,i,r){var n,o=0;for(n=0;n>>8)-1}function l(A,e,t,i){return B(A,e,t,i,16)}function I(A,e,t,i){return B(A,e,t,i,32)}function E(A,e,t,i){!function(A,e,t,i){for(var r,n=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,a=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,s=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,c=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,f=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,h=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,d=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,B=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,l=255&t[16]|(255&t[17])<<8|(255&t[18])<<16|(255&t[19])<<24,I=255&t[20]|(255&t[21])<<8|(255&t[22])<<16|(255&t[23])<<24,E=255&t[24]|(255&t[25])<<8|(255&t[26])<<16|(255&t[27])<<24,C=255&t[28]|(255&t[29])<<8|(255&t[30])<<16|(255&t[31])<<24,Q=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,p=n,w=o,m=a,y=s,M=c,b=g,D=f,v=u,S=h,k=d,G=B,N=l,F=I,O=E,R=C,U=Q,Y=0;Y<20;Y+=2)p^=(r=(F^=(r=(S^=(r=(M^=(r=p+F|0)<<7|r>>>25)+p|0)<<9|r>>>23)+M|0)<<13|r>>>19)+S|0)<<18|r>>>14,b^=(r=(w^=(r=(O^=(r=(k^=(r=b+w|0)<<7|r>>>25)+b|0)<<9|r>>>23)+k|0)<<13|r>>>19)+O|0)<<18|r>>>14,G^=(r=(D^=(r=(m^=(r=(R^=(r=G+D|0)<<7|r>>>25)+G|0)<<9|r>>>23)+R|0)<<13|r>>>19)+m|0)<<18|r>>>14,U^=(r=(N^=(r=(v^=(r=(y^=(r=U+N|0)<<7|r>>>25)+U|0)<<9|r>>>23)+y|0)<<13|r>>>19)+v|0)<<18|r>>>14,p^=(r=(y^=(r=(m^=(r=(w^=(r=p+y|0)<<7|r>>>25)+p|0)<<9|r>>>23)+w|0)<<13|r>>>19)+m|0)<<18|r>>>14,b^=(r=(M^=(r=(v^=(r=(D^=(r=b+M|0)<<7|r>>>25)+b|0)<<9|r>>>23)+D|0)<<13|r>>>19)+v|0)<<18|r>>>14,G^=(r=(k^=(r=(S^=(r=(N^=(r=G+k|0)<<7|r>>>25)+G|0)<<9|r>>>23)+N|0)<<13|r>>>19)+S|0)<<18|r>>>14,U^=(r=(R^=(r=(O^=(r=(F^=(r=U+R|0)<<7|r>>>25)+U|0)<<9|r>>>23)+F|0)<<13|r>>>19)+O|0)<<18|r>>>14;p=p+n|0,w=w+o|0,m=m+a|0,y=y+s|0,M=M+c|0,b=b+g|0,D=D+f|0,v=v+u|0,S=S+h|0,k=k+d|0,G=G+B|0,N=N+l|0,F=F+I|0,O=O+E|0,R=R+C|0,U=U+Q|0,A[0]=p>>>0&255,A[1]=p>>>8&255,A[2]=p>>>16&255,A[3]=p>>>24&255,A[4]=w>>>0&255,A[5]=w>>>8&255,A[6]=w>>>16&255,A[7]=w>>>24&255,A[8]=m>>>0&255,A[9]=m>>>8&255,A[10]=m>>>16&255,A[11]=m>>>24&255,A[12]=y>>>0&255,A[13]=y>>>8&255,A[14]=y>>>16&255,A[15]=y>>>24&255,A[16]=M>>>0&255,A[17]=M>>>8&255,A[18]=M>>>16&255,A[19]=M>>>24&255,A[20]=b>>>0&255,A[21]=b>>>8&255,A[22]=b>>>16&255,A[23]=b>>>24&255,A[24]=D>>>0&255,A[25]=D>>>8&255,A[26]=D>>>16&255,A[27]=D>>>24&255,A[28]=v>>>0&255,A[29]=v>>>8&255,A[30]=v>>>16&255,A[31]=v>>>24&255,A[32]=S>>>0&255,A[33]=S>>>8&255,A[34]=S>>>16&255,A[35]=S>>>24&255,A[36]=k>>>0&255,A[37]=k>>>8&255,A[38]=k>>>16&255,A[39]=k>>>24&255,A[40]=G>>>0&255,A[41]=G>>>8&255,A[42]=G>>>16&255,A[43]=G>>>24&255,A[44]=N>>>0&255,A[45]=N>>>8&255,A[46]=N>>>16&255,A[47]=N>>>24&255,A[48]=F>>>0&255,A[49]=F>>>8&255,A[50]=F>>>16&255,A[51]=F>>>24&255,A[52]=O>>>0&255,A[53]=O>>>8&255,A[54]=O>>>16&255,A[55]=O>>>24&255,A[56]=R>>>0&255,A[57]=R>>>8&255,A[58]=R>>>16&255,A[59]=R>>>24&255,A[60]=U>>>0&255,A[61]=U>>>8&255,A[62]=U>>>16&255,A[63]=U>>>24&255}(A,e,t,i)}function C(A,e,t,i){!function(A,e,t,i){for(var r,n=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,o=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,a=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,s=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,c=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,f=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,h=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,d=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,B=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,l=255&t[16]|(255&t[17])<<8|(255&t[18])<<16|(255&t[19])<<24,I=255&t[20]|(255&t[21])<<8|(255&t[22])<<16|(255&t[23])<<24,E=255&t[24]|(255&t[25])<<8|(255&t[26])<<16|(255&t[27])<<24,C=255&t[28]|(255&t[29])<<8|(255&t[30])<<16|(255&t[31])<<24,Q=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,p=0;p<20;p+=2)n^=(r=(I^=(r=(h^=(r=(c^=(r=n+I|0)<<7|r>>>25)+n|0)<<9|r>>>23)+c|0)<<13|r>>>19)+h|0)<<18|r>>>14,g^=(r=(o^=(r=(E^=(r=(d^=(r=g+o|0)<<7|r>>>25)+g|0)<<9|r>>>23)+d|0)<<13|r>>>19)+E|0)<<18|r>>>14,B^=(r=(f^=(r=(a^=(r=(C^=(r=B+f|0)<<7|r>>>25)+B|0)<<9|r>>>23)+C|0)<<13|r>>>19)+a|0)<<18|r>>>14,Q^=(r=(l^=(r=(u^=(r=(s^=(r=Q+l|0)<<7|r>>>25)+Q|0)<<9|r>>>23)+s|0)<<13|r>>>19)+u|0)<<18|r>>>14,n^=(r=(s^=(r=(a^=(r=(o^=(r=n+s|0)<<7|r>>>25)+n|0)<<9|r>>>23)+o|0)<<13|r>>>19)+a|0)<<18|r>>>14,g^=(r=(c^=(r=(u^=(r=(f^=(r=g+c|0)<<7|r>>>25)+g|0)<<9|r>>>23)+f|0)<<13|r>>>19)+u|0)<<18|r>>>14,B^=(r=(d^=(r=(h^=(r=(l^=(r=B+d|0)<<7|r>>>25)+B|0)<<9|r>>>23)+l|0)<<13|r>>>19)+h|0)<<18|r>>>14,Q^=(r=(C^=(r=(E^=(r=(I^=(r=Q+C|0)<<7|r>>>25)+Q|0)<<9|r>>>23)+I|0)<<13|r>>>19)+E|0)<<18|r>>>14;A[0]=n>>>0&255,A[1]=n>>>8&255,A[2]=n>>>16&255,A[3]=n>>>24&255,A[4]=g>>>0&255,A[5]=g>>>8&255,A[6]=g>>>16&255,A[7]=g>>>24&255,A[8]=B>>>0&255,A[9]=B>>>8&255,A[10]=B>>>16&255,A[11]=B>>>24&255,A[12]=Q>>>0&255,A[13]=Q>>>8&255,A[14]=Q>>>16&255,A[15]=Q>>>24&255,A[16]=f>>>0&255,A[17]=f>>>8&255,A[18]=f>>>16&255,A[19]=f>>>24&255,A[20]=u>>>0&255,A[21]=u>>>8&255,A[22]=u>>>16&255,A[23]=u>>>24&255,A[24]=h>>>0&255,A[25]=h>>>8&255,A[26]=h>>>16&255,A[27]=h>>>24&255,A[28]=d>>>0&255,A[29]=d>>>8&255,A[30]=d>>>16&255,A[31]=d>>>24&255}(A,e,t,i)}var Q=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function p(A,e,t,i,r,n,o){var a,s,c=new Uint8Array(16),g=new Uint8Array(64);for(s=0;s<16;s++)c[s]=0;for(s=0;s<8;s++)c[s]=n[s];for(;r>=64;){for(E(g,c,o,Q),s=0;s<64;s++)A[e+s]=t[i+s]^g[s];for(a=1,s=8;s<16;s++)a=a+(255&c[s])|0,c[s]=255&a,a>>>=8;r-=64,e+=64,i+=64}if(r>0)for(E(g,c,o,Q),s=0;s=64;){for(E(s,a,r,Q),o=0;o<64;o++)A[e+o]=s[o];for(n=1,o=8;o<16;o++)n=n+(255&a[o])|0,a[o]=255&n,n>>>=8;t-=64,e+=64}if(t>0)for(E(s,a,r,Q),o=0;o>>13|t<<3),i=255&A[4]|(255&A[5])<<8,this.r[2]=7939&(t>>>10|i<<6),r=255&A[6]|(255&A[7])<<8,this.r[3]=8191&(i>>>7|r<<9),n=255&A[8]|(255&A[9])<<8,this.r[4]=255&(r>>>4|n<<12),this.r[5]=n>>>1&8190,o=255&A[10]|(255&A[11])<<8,this.r[6]=8191&(n>>>14|o<<2),a=255&A[12]|(255&A[13])<<8,this.r[7]=8065&(o>>>11|a<<5),s=255&A[14]|(255&A[15])<<8,this.r[8]=8191&(a>>>8|s<<8),this.r[9]=s>>>5&127,this.pad[0]=255&A[16]|(255&A[17])<<8,this.pad[1]=255&A[18]|(255&A[19])<<8,this.pad[2]=255&A[20]|(255&A[21])<<8,this.pad[3]=255&A[22]|(255&A[23])<<8,this.pad[4]=255&A[24]|(255&A[25])<<8,this.pad[5]=255&A[26]|(255&A[27])<<8,this.pad[6]=255&A[28]|(255&A[29])<<8,this.pad[7]=255&A[30]|(255&A[31])<<8};function b(A,e,t,i,r,n){var o=new M(n);return o.update(t,i,r),o.finish(A,e),0}function D(A,e,t,i,r,n){var o=new Uint8Array(16);return b(o,0,t,i,r,n),l(A,e,o,0)}function v(A,e,t,i,r){var n;if(t<32)return-1;for(y(A,0,e,0,t,i,r),b(A,16,A,32,t-32,A),n=0;n<16;n++)A[n]=0;return 0}function S(A,e,t,i,r){var n,o=new Uint8Array(32);if(t<32)return-1;if(m(o,0,32,i,r),0!==D(e,16,e,32,t-32,o))return-1;for(y(A,0,e,0,t,i,r),n=0;n<32;n++)A[n]=0;return 0}function k(A,e){var t;for(t=0;t<16;t++)A[t]=0|e[t]}function G(A){var e,t,i=1;for(e=0;e<16;e++)t=A[e]+i+65535,i=Math.floor(t/65536),A[e]=t-65536*i;A[0]+=i-1+37*(i-1)}function N(A,e,t){for(var i,r=~(t-1),n=0;n<16;n++)i=r&(A[n]^e[n]),A[n]^=i,e[n]^=i}function F(A,t){var i,r,n,o=e(),a=e();for(i=0;i<16;i++)a[i]=t[i];for(G(a),G(a),G(a),r=0;r<2;r++){for(o[0]=a[0]-65517,i=1;i<15;i++)o[i]=a[i]-65535-(o[i-1]>>16&1),o[i-1]&=65535;o[15]=a[15]-32767-(o[14]>>16&1),n=o[15]>>16&1,o[14]&=65535,N(a,o,1-n)}for(i=0;i<16;i++)A[2*i]=255&a[i],A[2*i+1]=a[i]>>8}function O(A,e){var t=new Uint8Array(32),i=new Uint8Array(32);return F(t,A),F(i,e),I(t,0,i,0)}function R(A){var e=new Uint8Array(32);return F(e,A),1&e[0]}function U(A,e){var t;for(t=0;t<16;t++)A[t]=e[2*t]+(e[2*t+1]<<8);A[15]&=32767}function Y(A,e,t){for(var i=0;i<16;i++)A[i]=e[i]+t[i]}function x(A,e,t){for(var i=0;i<16;i++)A[i]=e[i]-t[i]}function H(A,e,t){var i,r,n=0,o=0,a=0,s=0,c=0,g=0,f=0,u=0,h=0,d=0,B=0,l=0,I=0,E=0,C=0,Q=0,p=0,w=0,m=0,y=0,M=0,b=0,D=0,v=0,S=0,k=0,G=0,N=0,F=0,O=0,R=0,U=t[0],Y=t[1],x=t[2],H=t[3],L=t[4],K=t[5],J=t[6],P=t[7],j=t[8],_=t[9],q=t[10],T=t[11],Z=t[12],V=t[13],W=t[14],z=t[15];n+=(i=e[0])*U,o+=i*Y,a+=i*x,s+=i*H,c+=i*L,g+=i*K,f+=i*J,u+=i*P,h+=i*j,d+=i*_,B+=i*q,l+=i*T,I+=i*Z,E+=i*V,C+=i*W,Q+=i*z,o+=(i=e[1])*U,a+=i*Y,s+=i*x,c+=i*H,g+=i*L,f+=i*K,u+=i*J,h+=i*P,d+=i*j,B+=i*_,l+=i*q,I+=i*T,E+=i*Z,C+=i*V,Q+=i*W,p+=i*z,a+=(i=e[2])*U,s+=i*Y,c+=i*x,g+=i*H,f+=i*L,u+=i*K,h+=i*J,d+=i*P,B+=i*j,l+=i*_,I+=i*q,E+=i*T,C+=i*Z,Q+=i*V,p+=i*W,w+=i*z,s+=(i=e[3])*U,c+=i*Y,g+=i*x,f+=i*H,u+=i*L,h+=i*K,d+=i*J,B+=i*P,l+=i*j,I+=i*_,E+=i*q,C+=i*T,Q+=i*Z,p+=i*V,w+=i*W,m+=i*z,c+=(i=e[4])*U,g+=i*Y,f+=i*x,u+=i*H,h+=i*L,d+=i*K,B+=i*J,l+=i*P,I+=i*j,E+=i*_,C+=i*q,Q+=i*T,p+=i*Z,w+=i*V,m+=i*W,y+=i*z,g+=(i=e[5])*U,f+=i*Y,u+=i*x,h+=i*H,d+=i*L,B+=i*K,l+=i*J,I+=i*P,E+=i*j,C+=i*_,Q+=i*q,p+=i*T,w+=i*Z,m+=i*V,y+=i*W,M+=i*z,f+=(i=e[6])*U,u+=i*Y,h+=i*x,d+=i*H,B+=i*L,l+=i*K,I+=i*J,E+=i*P,C+=i*j,Q+=i*_,p+=i*q,w+=i*T,m+=i*Z,y+=i*V,M+=i*W,b+=i*z,u+=(i=e[7])*U,h+=i*Y,d+=i*x,B+=i*H,l+=i*L,I+=i*K,E+=i*J,C+=i*P,Q+=i*j,p+=i*_,w+=i*q,m+=i*T,y+=i*Z,M+=i*V,b+=i*W,D+=i*z,h+=(i=e[8])*U,d+=i*Y,B+=i*x,l+=i*H,I+=i*L,E+=i*K,C+=i*J,Q+=i*P,p+=i*j,w+=i*_,m+=i*q,y+=i*T,M+=i*Z,b+=i*V,D+=i*W,v+=i*z,d+=(i=e[9])*U,B+=i*Y,l+=i*x,I+=i*H,E+=i*L,C+=i*K,Q+=i*J,p+=i*P,w+=i*j,m+=i*_,y+=i*q,M+=i*T,b+=i*Z,D+=i*V,v+=i*W,S+=i*z,B+=(i=e[10])*U,l+=i*Y,I+=i*x,E+=i*H,C+=i*L,Q+=i*K,p+=i*J,w+=i*P,m+=i*j,y+=i*_,M+=i*q,b+=i*T,D+=i*Z,v+=i*V,S+=i*W,k+=i*z,l+=(i=e[11])*U,I+=i*Y,E+=i*x,C+=i*H,Q+=i*L,p+=i*K,w+=i*J,m+=i*P,y+=i*j,M+=i*_,b+=i*q,D+=i*T,v+=i*Z,S+=i*V,k+=i*W,G+=i*z,I+=(i=e[12])*U,E+=i*Y,C+=i*x,Q+=i*H,p+=i*L,w+=i*K,m+=i*J,y+=i*P,M+=i*j,b+=i*_,D+=i*q,v+=i*T,S+=i*Z,k+=i*V,G+=i*W,N+=i*z,E+=(i=e[13])*U,C+=i*Y,Q+=i*x,p+=i*H,w+=i*L,m+=i*K,y+=i*J,M+=i*P,b+=i*j,D+=i*_,v+=i*q,S+=i*T,k+=i*Z,G+=i*V,N+=i*W,F+=i*z,C+=(i=e[14])*U,Q+=i*Y,p+=i*x,w+=i*H,m+=i*L,y+=i*K,M+=i*J,b+=i*P,D+=i*j,v+=i*_,S+=i*q,k+=i*T,G+=i*Z,N+=i*V,F+=i*W,O+=i*z,Q+=(i=e[15])*U,o+=38*(w+=i*x),a+=38*(m+=i*H),s+=38*(y+=i*L),c+=38*(M+=i*K),g+=38*(b+=i*J),f+=38*(D+=i*P),u+=38*(v+=i*j),h+=38*(S+=i*_),d+=38*(k+=i*q),B+=38*(G+=i*T),l+=38*(N+=i*Z),I+=38*(F+=i*V),E+=38*(O+=i*W),C+=38*(R+=i*z),n=(i=(n+=38*(p+=i*Y))+(r=1)+65535)-65536*(r=Math.floor(i/65536)),o=(i=o+r+65535)-65536*(r=Math.floor(i/65536)),a=(i=a+r+65535)-65536*(r=Math.floor(i/65536)),s=(i=s+r+65535)-65536*(r=Math.floor(i/65536)),c=(i=c+r+65535)-65536*(r=Math.floor(i/65536)),g=(i=g+r+65535)-65536*(r=Math.floor(i/65536)),f=(i=f+r+65535)-65536*(r=Math.floor(i/65536)),u=(i=u+r+65535)-65536*(r=Math.floor(i/65536)),h=(i=h+r+65535)-65536*(r=Math.floor(i/65536)),d=(i=d+r+65535)-65536*(r=Math.floor(i/65536)),B=(i=B+r+65535)-65536*(r=Math.floor(i/65536)),l=(i=l+r+65535)-65536*(r=Math.floor(i/65536)),I=(i=I+r+65535)-65536*(r=Math.floor(i/65536)),E=(i=E+r+65535)-65536*(r=Math.floor(i/65536)),C=(i=C+r+65535)-65536*(r=Math.floor(i/65536)),Q=(i=Q+r+65535)-65536*(r=Math.floor(i/65536)),n=(i=(n+=r-1+37*(r-1))+(r=1)+65535)-65536*(r=Math.floor(i/65536)),o=(i=o+r+65535)-65536*(r=Math.floor(i/65536)),a=(i=a+r+65535)-65536*(r=Math.floor(i/65536)),s=(i=s+r+65535)-65536*(r=Math.floor(i/65536)),c=(i=c+r+65535)-65536*(r=Math.floor(i/65536)),g=(i=g+r+65535)-65536*(r=Math.floor(i/65536)),f=(i=f+r+65535)-65536*(r=Math.floor(i/65536)),u=(i=u+r+65535)-65536*(r=Math.floor(i/65536)),h=(i=h+r+65535)-65536*(r=Math.floor(i/65536)),d=(i=d+r+65535)-65536*(r=Math.floor(i/65536)),B=(i=B+r+65535)-65536*(r=Math.floor(i/65536)),l=(i=l+r+65535)-65536*(r=Math.floor(i/65536)),I=(i=I+r+65535)-65536*(r=Math.floor(i/65536)),E=(i=E+r+65535)-65536*(r=Math.floor(i/65536)),C=(i=C+r+65535)-65536*(r=Math.floor(i/65536)),Q=(i=Q+r+65535)-65536*(r=Math.floor(i/65536)),n+=r-1+37*(r-1),A[0]=n,A[1]=o,A[2]=a,A[3]=s,A[4]=c,A[5]=g,A[6]=f,A[7]=u,A[8]=h,A[9]=d,A[10]=B,A[11]=l,A[12]=I,A[13]=E,A[14]=C,A[15]=Q}function L(A,e){H(A,e,e)}function K(A,t){var i,r=e();for(i=0;i<16;i++)r[i]=t[i];for(i=253;i>=0;i--)L(r,r),2!==i&&4!==i&&H(r,r,t);for(i=0;i<16;i++)A[i]=r[i]}function J(A,t){var i,r=e();for(i=0;i<16;i++)r[i]=t[i];for(i=250;i>=0;i--)L(r,r),1!==i&&H(r,r,t);for(i=0;i<16;i++)A[i]=r[i]}function P(A,t,i){var r,n,o=new Uint8Array(32),a=new Float64Array(80),c=e(),g=e(),f=e(),u=e(),h=e(),d=e();for(n=0;n<31;n++)o[n]=t[n];for(o[31]=127&t[31]|64,o[0]&=248,U(a,i),n=0;n<16;n++)g[n]=a[n],u[n]=c[n]=f[n]=0;for(c[0]=u[0]=1,n=254;n>=0;--n)N(c,g,r=o[n>>>3]>>>(7&n)&1),N(f,u,r),Y(h,c,f),x(c,c,f),Y(f,g,u),x(g,g,u),L(u,h),L(d,c),H(c,f,c),H(f,g,h),Y(h,c,f),x(c,c,f),L(g,c),x(f,u,d),H(c,f,s),Y(c,c,u),H(f,f,c),H(c,u,d),H(u,g,a),L(g,h),N(c,g,r),N(f,u,r);for(n=0;n<16;n++)a[n+16]=c[n],a[n+32]=f[n],a[n+48]=g[n],a[n+64]=u[n];var B=a.subarray(32),l=a.subarray(16);return K(B,B),H(l,l,B),F(A,l),0}function j(A,e){return P(A,e,n)}function _(A,e){return i(e,32),j(A,e)}function q(A,e,t){var i=new Uint8Array(32);return P(i,t,e),C(A,r,i,Q)}M.prototype.blocks=function(A,e,t){for(var i,r,n,o,a,s,c,g,f,u,h,d,B,l,I,E,C,Q,p,w=this.fin?0:2048,m=this.h[0],y=this.h[1],M=this.h[2],b=this.h[3],D=this.h[4],v=this.h[5],S=this.h[6],k=this.h[7],G=this.h[8],N=this.h[9],F=this.r[0],O=this.r[1],R=this.r[2],U=this.r[3],Y=this.r[4],x=this.r[5],H=this.r[6],L=this.r[7],K=this.r[8],J=this.r[9];t>=16;)u=f=0,u+=(m+=8191&(i=255&A[e+0]|(255&A[e+1])<<8))*F,u+=(y+=8191&(i>>>13|(r=255&A[e+2]|(255&A[e+3])<<8)<<3))*(5*J),u+=(M+=8191&(r>>>10|(n=255&A[e+4]|(255&A[e+5])<<8)<<6))*(5*K),u+=(b+=8191&(n>>>7|(o=255&A[e+6]|(255&A[e+7])<<8)<<9))*(5*L),f=(u+=(D+=8191&(o>>>4|(a=255&A[e+8]|(255&A[e+9])<<8)<<12))*(5*H))>>>13,u&=8191,u+=(v+=a>>>1&8191)*(5*x),u+=(S+=8191&(a>>>14|(s=255&A[e+10]|(255&A[e+11])<<8)<<2))*(5*Y),u+=(k+=8191&(s>>>11|(c=255&A[e+12]|(255&A[e+13])<<8)<<5))*(5*U),u+=(G+=8191&(c>>>8|(g=255&A[e+14]|(255&A[e+15])<<8)<<8))*(5*R),h=f+=(u+=(N+=g>>>5|w)*(5*O))>>>13,h+=m*O,h+=y*F,h+=M*(5*J),h+=b*(5*K),f=(h+=D*(5*L))>>>13,h&=8191,h+=v*(5*H),h+=S*(5*x),h+=k*(5*Y),h+=G*(5*U),f+=(h+=N*(5*R))>>>13,h&=8191,d=f,d+=m*R,d+=y*O,d+=M*F,d+=b*(5*J),f=(d+=D*(5*K))>>>13,d&=8191,d+=v*(5*L),d+=S*(5*H),d+=k*(5*x),d+=G*(5*Y),B=f+=(d+=N*(5*U))>>>13,B+=m*U,B+=y*R,B+=M*O,B+=b*F,f=(B+=D*(5*J))>>>13,B&=8191,B+=v*(5*K),B+=S*(5*L),B+=k*(5*H),B+=G*(5*x),l=f+=(B+=N*(5*Y))>>>13,l+=m*Y,l+=y*U,l+=M*R,l+=b*O,f=(l+=D*F)>>>13,l&=8191,l+=v*(5*J),l+=S*(5*K),l+=k*(5*L),l+=G*(5*H),I=f+=(l+=N*(5*x))>>>13,I+=m*x,I+=y*Y,I+=M*U,I+=b*R,f=(I+=D*O)>>>13,I&=8191,I+=v*F,I+=S*(5*J),I+=k*(5*K),I+=G*(5*L),E=f+=(I+=N*(5*H))>>>13,E+=m*H,E+=y*x,E+=M*Y,E+=b*U,f=(E+=D*R)>>>13,E&=8191,E+=v*O,E+=S*F,E+=k*(5*J),E+=G*(5*K),C=f+=(E+=N*(5*L))>>>13,C+=m*L,C+=y*H,C+=M*x,C+=b*Y,f=(C+=D*U)>>>13,C&=8191,C+=v*R,C+=S*O,C+=k*F,C+=G*(5*J),Q=f+=(C+=N*(5*K))>>>13,Q+=m*K,Q+=y*L,Q+=M*H,Q+=b*x,f=(Q+=D*Y)>>>13,Q&=8191,Q+=v*U,Q+=S*R,Q+=k*O,Q+=G*F,p=f+=(Q+=N*(5*J))>>>13,p+=m*J,p+=y*K,p+=M*L,p+=b*H,f=(p+=D*x)>>>13,p&=8191,p+=v*Y,p+=S*U,p+=k*R,p+=G*O,m=u=8191&(f=(f=((f+=(p+=N*F)>>>13)<<2)+f|0)+(u&=8191)|0),y=h+=f>>>=13,M=d&=8191,b=B&=8191,D=l&=8191,v=I&=8191,S=E&=8191,k=C&=8191,G=Q&=8191,N=p&=8191,e+=16,t-=16;this.h[0]=m,this.h[1]=y,this.h[2]=M,this.h[3]=b,this.h[4]=D,this.h[5]=v,this.h[6]=S,this.h[7]=k,this.h[8]=G,this.h[9]=N},M.prototype.finish=function(A,e){var t,i,r,n,o=new Uint16Array(10);if(this.leftover){for(n=this.leftover,this.buffer[n++]=1;n<16;n++)this.buffer[n]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(t=this.h[1]>>>13,this.h[1]&=8191,n=2;n<10;n++)this.h[n]+=t,t=this.h[n]>>>13,this.h[n]&=8191;for(this.h[0]+=5*t,t=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=t,t=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=t,o[0]=this.h[0]+5,t=o[0]>>>13,o[0]&=8191,n=1;n<10;n++)o[n]=this.h[n]+t,t=o[n]>>>13,o[n]&=8191;for(o[9]-=8192,i=(1^t)-1,n=0;n<10;n++)o[n]&=i;for(i=~i,n=0;n<10;n++)this.h[n]=this.h[n]&i|o[n];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),r=this.h[0]+this.pad[0],this.h[0]=65535&r,n=1;n<8;n++)r=(this.h[n]+this.pad[n]|0)+(r>>>16)|0,this.h[n]=65535&r;A[e+0]=this.h[0]>>>0&255,A[e+1]=this.h[0]>>>8&255,A[e+2]=this.h[1]>>>0&255,A[e+3]=this.h[1]>>>8&255,A[e+4]=this.h[2]>>>0&255,A[e+5]=this.h[2]>>>8&255,A[e+6]=this.h[3]>>>0&255,A[e+7]=this.h[3]>>>8&255,A[e+8]=this.h[4]>>>0&255,A[e+9]=this.h[4]>>>8&255,A[e+10]=this.h[5]>>>0&255,A[e+11]=this.h[5]>>>8&255,A[e+12]=this.h[6]>>>0&255,A[e+13]=this.h[6]>>>8&255,A[e+14]=this.h[7]>>>0&255,A[e+15]=this.h[7]>>>8&255},M.prototype.update=function(A,e,t){var i,r;if(this.leftover){for((r=16-this.leftover)>t&&(r=t),i=0;i=16&&(r=t-t%16,this.blocks(A,e,r),e+=r,t-=r),t){for(i=0;i=128;){for(w=0;w<16;w++)m=8*w+Z,k[w]=t[m+0]<<24|t[m+1]<<16|t[m+2]<<8|t[m+3],G[w]=t[m+4]<<24|t[m+5]<<16|t[m+6]<<8|t[m+7];for(w=0;w<80;w++)if(r=N,n=F,o=O,a=R,s=U,c=Y,g=x,H,u=L,h=K,d=J,B=P,l=j,I=_,E=q,T,b=65535&(M=T),D=M>>>16,v=65535&(y=H),S=y>>>16,b+=65535&(M=(j>>>14|U<<18)^(j>>>18|U<<14)^(U>>>9|j<<23)),D+=M>>>16,v+=65535&(y=(U>>>14|j<<18)^(U>>>18|j<<14)^(j>>>9|U<<23)),S+=y>>>16,b+=65535&(M=j&_^~j&q),D+=M>>>16,v+=65535&(y=U&Y^~U&x),S+=y>>>16,b+=65535&(M=V[2*w+1]),D+=M>>>16,v+=65535&(y=V[2*w]),S+=y>>>16,y=k[w%16],D+=(M=G[w%16])>>>16,v+=65535&y,S+=y>>>16,v+=(D+=(b+=65535&M)>>>16)>>>16,b=65535&(M=p=65535&b|D<<16),D=M>>>16,v=65535&(y=Q=65535&v|(S+=v>>>16)<<16),S=y>>>16,b+=65535&(M=(L>>>28|N<<4)^(N>>>2|L<<30)^(N>>>7|L<<25)),D+=M>>>16,v+=65535&(y=(N>>>28|L<<4)^(L>>>2|N<<30)^(L>>>7|N<<25)),S+=y>>>16,D+=(M=L&K^L&J^K&J)>>>16,v+=65535&(y=N&F^N&O^F&O),S+=y>>>16,f=65535&(v+=(D+=(b+=65535&M)>>>16)>>>16)|(S+=v>>>16)<<16,C=65535&b|D<<16,b=65535&(M=B),D=M>>>16,v=65535&(y=a),S=y>>>16,D+=(M=p)>>>16,v+=65535&(y=Q),S+=y>>>16,F=r,O=n,R=o,U=a=65535&(v+=(D+=(b+=65535&M)>>>16)>>>16)|(S+=v>>>16)<<16,Y=s,x=c,H=g,N=f,K=u,J=h,P=d,j=B=65535&b|D<<16,_=l,q=I,T=E,L=C,w%16==15)for(m=0;m<16;m++)y=k[m],b=65535&(M=G[m]),D=M>>>16,v=65535&y,S=y>>>16,y=k[(m+9)%16],b+=65535&(M=G[(m+9)%16]),D+=M>>>16,v+=65535&y,S+=y>>>16,Q=k[(m+1)%16],b+=65535&(M=((p=G[(m+1)%16])>>>1|Q<<31)^(p>>>8|Q<<24)^(p>>>7|Q<<25)),D+=M>>>16,v+=65535&(y=(Q>>>1|p<<31)^(Q>>>8|p<<24)^Q>>>7),S+=y>>>16,Q=k[(m+14)%16],D+=(M=((p=G[(m+14)%16])>>>19|Q<<13)^(Q>>>29|p<<3)^(p>>>6|Q<<26))>>>16,v+=65535&(y=(Q>>>19|p<<13)^(p>>>29|Q<<3)^Q>>>6),S+=y>>>16,S+=(v+=(D+=(b+=65535&M)>>>16)>>>16)>>>16,k[m]=65535&v|S<<16,G[m]=65535&b|D<<16;b=65535&(M=L),D=M>>>16,v=65535&(y=N),S=y>>>16,y=A[0],D+=(M=e[0])>>>16,v+=65535&y,S+=y>>>16,S+=(v+=(D+=(b+=65535&M)>>>16)>>>16)>>>16,A[0]=N=65535&v|S<<16,e[0]=L=65535&b|D<<16,b=65535&(M=K),D=M>>>16,v=65535&(y=F),S=y>>>16,y=A[1],D+=(M=e[1])>>>16,v+=65535&y,S+=y>>>16,S+=(v+=(D+=(b+=65535&M)>>>16)>>>16)>>>16,A[1]=F=65535&v|S<<16,e[1]=K=65535&b|D<<16,b=65535&(M=J),D=M>>>16,v=65535&(y=O),S=y>>>16,y=A[2],D+=(M=e[2])>>>16,v+=65535&y,S+=y>>>16,S+=(v+=(D+=(b+=65535&M)>>>16)>>>16)>>>16,A[2]=O=65535&v|S<<16,e[2]=J=65535&b|D<<16,b=65535&(M=P),D=M>>>16,v=65535&(y=R),S=y>>>16,y=A[3],D+=(M=e[3])>>>16,v+=65535&y,S+=y>>>16,S+=(v+=(D+=(b+=65535&M)>>>16)>>>16)>>>16,A[3]=R=65535&v|S<<16,e[3]=P=65535&b|D<<16,b=65535&(M=j),D=M>>>16,v=65535&(y=U),S=y>>>16,y=A[4],D+=(M=e[4])>>>16,v+=65535&y,S+=y>>>16,S+=(v+=(D+=(b+=65535&M)>>>16)>>>16)>>>16,A[4]=U=65535&v|S<<16,e[4]=j=65535&b|D<<16,b=65535&(M=_),D=M>>>16,v=65535&(y=Y),S=y>>>16,y=A[5],D+=(M=e[5])>>>16,v+=65535&y,S+=y>>>16,S+=(v+=(D+=(b+=65535&M)>>>16)>>>16)>>>16,A[5]=Y=65535&v|S<<16,e[5]=_=65535&b|D<<16,b=65535&(M=q),D=M>>>16,v=65535&(y=x),S=y>>>16,y=A[6],D+=(M=e[6])>>>16,v+=65535&y,S+=y>>>16,S+=(v+=(D+=(b+=65535&M)>>>16)>>>16)>>>16,A[6]=x=65535&v|S<<16,e[6]=q=65535&b|D<<16,b=65535&(M=T),D=M>>>16,v=65535&(y=H),S=y>>>16,y=A[7],D+=(M=e[7])>>>16,v+=65535&y,S+=y>>>16,S+=(v+=(D+=(b+=65535&M)>>>16)>>>16)>>>16,A[7]=H=65535&v|S<<16,e[7]=T=65535&b|D<<16,Z+=128,i-=128}return i}function z(A,e,t){var i,r=new Int32Array(8),n=new Int32Array(8),o=new Uint8Array(256),a=t;for(r[0]=1779033703,r[1]=3144134277,r[2]=1013904242,r[3]=2773480762,r[4]=1359893119,r[5]=2600822924,r[6]=528734635,r[7]=1541459225,n[0]=4089235720,n[1]=2227873595,n[2]=4271175723,n[3]=1595750129,n[4]=2917565137,n[5]=725511199,n[6]=4215389547,n[7]=327033209,W(r,n,e,t),t%=128,i=0;i=0;--r)$(A,e,i=t[r/8|0]>>(7&r)&1),X(e,A),X(A,A),$(A,e,i)}function tA(A,t){var i=[e(),e(),e(),e()];k(i[0],f),k(i[1],u),k(i[2],a),H(i[3],f,u),eA(A,i,t)}function iA(A,t,r){var n,o=new Uint8Array(64),a=[e(),e(),e(),e()];for(r||i(t,32),z(o,t,32),o[0]&=248,o[31]&=127,o[31]|=64,tA(a,o),AA(A,a),n=0;n<32;n++)t[n+32]=A[n];return 0}var rA=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function nA(A,e){var t,i,r,n;for(i=63;i>=32;--i){for(t=0,r=i-32,n=i-12;r>4)*rA[r],t=e[r]>>8,e[r]&=255;for(r=0;r<32;r++)e[r]-=t*rA[r];for(i=0;i<32;i++)e[i+1]+=e[i]>>8,A[i]=255&e[i]}function oA(A){var e,t=new Float64Array(64);for(e=0;e<64;e++)t[e]=A[e];for(e=0;e<64;e++)A[e]=0;nA(A,t)}function aA(A,t,i,r){var n,o,a=new Uint8Array(64),s=new Uint8Array(64),c=new Uint8Array(64),g=new Float64Array(64),f=[e(),e(),e(),e()];z(a,r,32),a[0]&=248,a[31]&=127,a[31]|=64;var u=i+64;for(n=0;n>7&&x(A[0],o,A[0]),H(A[3],A[0],A[1]),0)}(u,r))return-1;for(n=0;n=0},A.sign.keyPair=function(){var A=new Uint8Array(32),e=new Uint8Array(64);return iA(A,e),{publicKey:A,secretKey:e}},A.sign.keyPair.fromSecretKey=function(A){if(gA(A),64!==A.length)throw new Error("bad secret key size");for(var e=new Uint8Array(32),t=0;t0?r(i(A),9007199254740991):0}},function(A,e){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(A){"object"==typeof window&&(t=window)}A.exports=t},function(A,e,t){const i=t(911),r=t(912),{allocString:n,allocU8a:o,getWasm:a,initWasm:s,resultString:c,resultU8a:g,withWasm:f}=t(448),u=s(r,i,t(913)).catch(()=>null);A.exports.bip39Generate=f((A,e)=>(A.ext_bip39_generate(8,e),c())),A.exports.bip39ToEntropy=f((A,e)=>{const[t,i]=n(e);return A.ext_bip39_to_entropy(8,t,i),g()}),A.exports.bip39ToMiniSecret=f((A,e,t)=>{const[i,r]=n(e),[o,a]=n(t);return A.ext_bip39_to_mini_secret(8,i,r,o,a),g()}),A.exports.bip39ToSeed=f((A,e,t)=>{const[i,r]=n(e),[o,a]=n(t);return A.ext_bip39_to_seed(8,i,r,o,a),g()}),A.exports.bip39Validate=f((A,e)=>{const[t,i]=n(e);return 0!==A.ext_bip39_validate(t,i)}),A.exports.ed25519KeypairFromSeed=f((A,e)=>{const[t,i]=o(e);return A.ext_ed_from_seed(8,t,i),g()}),A.exports.ed25519Sign=f((A,e,t,i)=>{const[r,n]=o(e),[a,s]=o(t),[c,f]=o(i);return A.ext_ed_sign(8,r,n,a,s,c,f),g()}),A.exports.ed25519Verify=f((A,e,t,i)=>{const[r,n]=o(e),[a,s]=o(t),[c,g]=o(i);return 0!==A.ext_ed_verify(r,n,a,s,c,g)}),A.exports.blake2b=f((A,e,t,i)=>{const[r,n]=o(e),[a,s]=o(t);return A.ext_blake2b(8,r,n,a,s,i),g()}),A.exports.keccak256=f((A,e)=>{const[t,i]=o(e);return A.ext_keccak256(8,t,i),g()}),A.exports.pbkdf2=f((A,e,t,i)=>{const[r,n]=o(e),[a,s]=o(t);return A.ext_pbkdf2(8,r,n,a,s,i),g()}),A.exports.scrypt=f((A,e,t,i,r,n)=>{const[a,s]=o(e),[c,f]=o(t);return A.ext_scrypt(8,a,s,c,f,i,r,n),g()}),A.exports.sha512=f((A,e)=>{const[t,i]=o(e);return A.ext_sha512(8,t,i),g()}),A.exports.twox=f((A,e,t)=>{const[i,r]=o(e);return A.ext_twox(8,i,r,t),g()}),A.exports.sr25519DeriveKeypairHard=f((A,e,t)=>{const[i,r]=o(e),[n,a]=o(t);return A.ext_sr_derive_keypair_hard(8,i,r,n,a),g()}),A.exports.sr25519DeriveKeypairSoft=f((A,e,t)=>{const[i,r]=o(e),[n,a]=o(t);return A.ext_sr_derive_keypair_soft(8,i,r,n,a),g()}),A.exports.sr25519DerivePublicSoft=f((A,e,t)=>{const[i,r]=o(e),[n,a]=o(t);return A.ext_sr_derive_public_soft(8,i,r,n,a),g()}),A.exports.sr25519KeypairFromSeed=f((A,e)=>{const[t,i]=o(e);return A.ext_sr_from_seed(8,t,i),g()}),A.exports.sr25519Sign=f((A,e,t,i)=>{const[r,n]=o(e),[a,s]=o(t),[c,f]=o(i);return A.ext_sr_sign(8,r,n,a,s,c,f),g()}),A.exports.sr25519Verify=f((A,e,t,i)=>{const[r,n]=o(e),[a,s]=o(t),[c,g]=o(i);return 0!==A.ext_sr_verify(r,n,a,s,c,g)}),A.exports.isReady=function(){return!!a()},A.exports.waitReady=function(){return u.then(()=>!!a())}},function(A,e,t){const i=t(575);A.exports=t(1297)(i)},function(A,e,t){"use strict";t.d(e,"a",(function(){return r})),t.d(e,"b",(function(){return n}));var i=t(8),r=new i.a((function(A){return A.complete()}));function n(A){return A?function(A){return new i.a((function(e){return A.schedule((function(){return e.complete()}))}))}(A):r}},function(A,e){var t=A.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},function(A,e,t){"use strict";t.d(e,"a",(function(){return o}));var i=t(8),r=t(92),n=t(269);function o(A,e){return e?Object(n.a)(A,e):A instanceof i.a?A:new i.a(Object(r.a)(A))}},function(A,e,t){A.exports=!t(22)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(A,e,t){var i=t(23),r=t(393),n=t(94),o=Object.defineProperty;e.f=t(39)?Object.defineProperty:function(A,e,t){if(i(A),e=n(e,!0),i(t),r)try{return o(A,e,t)}catch(A){}if("get"in t||"set"in t)throw TypeError("Accessors not supported!");return"value"in t&&(A[e]=t.value),A}},function(A,e,t){var i=t(925).default;function r(){if("function"!=typeof WeakMap)return null;var A=new WeakMap;return r=function(){return A},A}A.exports=function(A){if(A&&A.__esModule)return A;if(null===A||"object"!==i(A)&&"function"!=typeof A)return{default:A};var e=r();if(e&&e.has(A))return e.get(A);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in A)if(Object.prototype.hasOwnProperty.call(A,o)){var a=n?Object.getOwnPropertyDescriptor(A,o):null;a&&(a.get||a.set)?Object.defineProperty(t,o,a):t[o]=A[o]}return t.default=A,e&&e.set(A,t),t},A.exports.default=A.exports,A.exports.__esModule=!0},function(A,e,t){"use strict";t.d(e,"a",(function(){return a}));var i=t(2),r=function(A){function e(e,t,i){var r=A.call(this)||this;return r.parent=e,r.outerValue=t,r.outerIndex=i,r.index=0,r}return i.__extends(e,A),e.prototype._next=function(A){this.parent.notifyNext(this.outerValue,A,this.outerIndex,this.index++,this)},e.prototype._error=function(A){this.parent.notifyError(A,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(t(3).a),n=t(92),o=t(8);function a(A,e,t,i,a){if(void 0===a&&(a=new r(A,t,i)),!a.closed)return e instanceof o.a?e.subscribe(a):Object(n.a)(e)(a)}},function(A,e,t){"use strict";t.d(e,"a",(function(){return r}));var i=!1,r={Promise:void 0,set useDeprecatedSynchronousErrorHandling(A){A&&(new Error).stack;i=A},get useDeprecatedSynchronousErrorHandling(){return i}}},function(A,e,t){var i=t(85);A.exports=function(A){return Object(i(A))}},function(A,e){A.exports=function(A){return A.webpackPolyfill||(A.deprecate=function(){},A.paths=[],A.children||(A.children=[]),Object.defineProperty(A,"loaded",{enumerable:!0,get:function(){return A.l}}),Object.defineProperty(A,"id",{enumerable:!0,get:function(){return A.i}}),A.webpackPolyfill=1),A}},function(A,e,t){"use strict";function i(A){return A}t.d(e,"a",(function(){return i}))},function(A,e,t){"use strict";t.d(e,"a",(function(){return r}));var i=t(2),r=function(A){function e(){return null!==A&&A.apply(this,arguments)||this}return i.__extends(e,A),e.prototype.notifyNext=function(A,e,t,i,r){this.destination.next(e)},e.prototype.notifyError=function(A,e){this.destination.error(A)},e.prototype.notifyComplete=function(A){this.destination.complete()},e}(t(3).a)},function(A,e,t){"use strict";t.d(e,"a",(function(){return n}));var i=t(2),r=t(3);function n(A,e){return function(t){return t.lift(new o(A,e))}}var o=function(){function A(A,e){this.predicate=A,this.thisArg=e}return A.prototype.call=function(A,e){return e.subscribe(new a(A,this.predicate,this.thisArg))},A}(),a=function(A){function e(e,t,i){var r=A.call(this,e)||this;return r.predicate=t,r.thisArg=i,r.count=0,r}return i.__extends(e,A),e.prototype._next=function(A){var e;try{e=this.predicate.call(this.thisArg,A,this.count++)}catch(A){return void this.destination.error(A)}e&&this.destination.next(A)},e}(r.a)},function(A,e,t){"use strict";t.d(e,"b",(function(){return i})),t.d(e,"a",(function(){return a}));var i,r=t(36),n=t(104),o=t(172);i||(i={});var a=function(){function A(A,e,t){this.kind=A,this.value=e,this.error=t,this.hasValue="N"===A}return A.prototype.observe=function(A){switch(this.kind){case"N":return A.next&&A.next(this.value);case"E":return A.error&&A.error(this.error);case"C":return A.complete&&A.complete()}},A.prototype.do=function(A,e,t){switch(this.kind){case"N":return A&&A(this.value);case"E":return e&&e(this.error);case"C":return t&&t()}},A.prototype.accept=function(A,e,t){return A&&"function"==typeof A.next?this.observe(A):this.do(A,e,t)},A.prototype.toObservable=function(){switch(this.kind){case"N":return Object(n.a)(this.value);case"E":return Object(o.a)(this.error);case"C":return Object(r.b)()}throw new Error("unexpected notification kind value")},A.createNext=function(e){return void 0!==e?new A("N",e):A.undefinedValueNotification},A.createError=function(e){return new A("E",void 0,e)},A.createComplete=function(){return A.completeNotification},A.completeNotification=new A("C"),A.undefinedValueNotification=new A("N",void 0),A}()},function(A,e,t){var i=t(21),r=t(56),n=t(55),o=t(106)("src"),a=t(671),s=(""+a).split("toString");t(37).inspectSource=function(A){return a.call(A)},(A.exports=function(A,e,t,a){var c="function"==typeof t;c&&(n(t,"name")||r(t,"name",e)),A[e]!==t&&(c&&(n(t,o)||r(t,o,A[e]?""+A[e]:s.join(String(e)))),A===i?A[e]=t:a?A[e]?A[e]=t:r(A,e,t):(delete A[e],r(A,e,t)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[o]||a.call(this)}))},function(A,e,t){var i=t(4),r=t(22),n=t(85),o=/"/g,a=function(A,e,t,i){var r=String(n(A)),a="<"+e;return""!==t&&(a+=" "+t+'="'+String(i).replace(o,""")+'"'),a+">"+r+""+e+">"};A.exports=function(A,e){var t={};t[A]=e(a),i(i.P+i.F*r((function(){var e=""[A]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",t)}},function(A,e,t){"use strict";t(1291)},function(A,e,t){"use strict";function i(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}t.d(e,"a",(function(){return r}));var r=i()},function(A,e,t){"use strict";function i(){}t.d(e,"a",(function(){return i}))},function(A,e){var t={}.hasOwnProperty;A.exports=function(A,e){return t.call(A,e)}},function(A,e,t){var i=t(40),r=t(105);A.exports=t(39)?function(A,e,t){return i.f(A,e,r(1,t))}:function(A,e,t){return A[e]=t,A}},function(A,e,t){var i=t(181),r=t(85);A.exports=function(A){return i(r(A))}},function(A,e,t){"use strict";var i=e,r=t(88),n=t(59),o=t(463);i.assert=n,i.toArray=o.toArray,i.zero2=o.zero2,i.toHex=o.toHex,i.encode=o.encode,i.getNAF=function(A,e,t){var i=new Array(Math.max(A.bitLength(),t)+1);i.fill(0);for(var r=1<(r>>1)-1?(r>>1)-s:s,n.isubn(a)):a=0,i[o]=a,n.iushrn(1)}return i},i.getJSF=function(A,e){var t=[[],[]];A=A.clone(),e=e.clone();for(var i,r=0,n=0;A.cmpn(-r)>0||e.cmpn(-n)>0;){var o,a,s=A.andln(3)+r&3,c=e.andln(3)+n&3;3===s&&(s=-1),3===c&&(c=-1),o=0==(1&s)?0:3!==(i=A.andln(7)+r&7)&&5!==i||2!==c?s:-s,t[0].push(o),a=0==(1&c)?0:3!==(i=e.andln(7)+n&7)&&5!==i||2!==s?c:-c,t[1].push(a),2*r===o+1&&(r=1-r),2*n===a+1&&(n=1-n),A.iushrn(1),e.iushrn(1)}return t},i.cachedProperty=function(A,e,t){var i="_"+e;A.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=t.call(this)}},i.parseBytes=function(A){return"string"==typeof A?i.toArray(A,"hex"):A},i.intFromLE=function(A){return new r(A,"hex","le")}},function(A,e){function t(A,e){if(!A)throw new Error(e||"Assertion failed")}A.exports=t,t.equal=function(A,e,t){if(A!=e)throw new Error(t||"Assertion failed: "+A+" != "+e)}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"compareArray",{enumerable:!0,get:function(){return i.compareArray}}),Object.defineProperty(e,"compareMap",{enumerable:!0,get:function(){return r.compareMap}}),Object.defineProperty(e,"compareSet",{enumerable:!0,get:function(){return n.compareSet}}),Object.defineProperty(e,"decodeU8a",{enumerable:!0,get:function(){return o.decodeU8a}}),Object.defineProperty(e,"mapToTypeMap",{enumerable:!0,get:function(){return a.mapToTypeMap}}),Object.defineProperty(e,"typeToConstructor",{enumerable:!0,get:function(){return s.typeToConstructor}});var i=t(1094),r=t(1095),n=t(1096),o=t(1097),a=t(1098),s=t(535)},function(A,e,t){"use strict";var i=t(0);Object.defineProperty(e,"__esModule",{value:!0}),e.Struct=void 0;var r=i(t(16)),n=i(t(17)),o=t(1),a=t(60);function s(A,e,t,i){if((0,o.isHex)(t))return s(A,e,(0,o.hexToU8a)(t),i);if((0,o.isU8a)(t)){const i=(0,a.decodeU8a)(A,t,Object.values(e));return Object.keys(e).reduce((A,e,t)=>(A[e]=i[t],A),{})}return t?function(A,e,t,i){let r;return Object.keys(e).reduce((n,a,s)=>{const c=i.get(a)&&!t[a]?i.get(a):a;try{if(Array.isArray(t))n[a]=t[s]instanceof e[a]?t[s]:new e[a](A,t[s]);else if(t instanceof Map){const i=t.get(c);n[a]=i instanceof e[a]?i:new e[a](A,i)}else{if(!(0,o.isObject)(t))throw new Error("Cannot decode value "+JSON.stringify(t));{let i=t[c];(0,o.isUndefined)(i)&&((0,o.isUndefined)(r)&&(r=Object.entries(t).reduce((A,[e,t])=>(A[(0,o.stringCamelCase)(e)]=t,A),{})),i=r[c]),n[a]=i instanceof e[a]?i:new e[a](A,i)}}}catch(t){let i=e[a].name;try{i=new e[a](A).toRawType()}catch(A){}throw new Error(`Struct: failed on ${c}: ${i}:: ${t.message}`)}return n},{})}(A,e,t,i):{}}var c=(0,n.default)("jsonMap"),g=(0,n.default)("Types");class f extends Map{constructor(A,e,t={},i=new Map){super(Object.entries(s(A,(0,a.mapToTypeMap)(A,e),t,i))),this.registry=void 0,Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,g,{writable:!0,value:void 0}),this.registry=A,(0,r.default)(this,c)[c]=i,(0,r.default)(this,g)[g]=(0,a.mapToTypeMap)(A,e)}static with(A,e){return class extends f{constructor(t,i){super(t,A,i,e),Object.keys(A).forEach(A=>{(0,o.isUndefined)(this[A])&&Object.defineProperty(this,A,{enumerable:!0,get:()=>this.get(A)})})}}}static typesToMap(A,e){return Object.entries(e).reduce((e,[t,i])=>(e[t]=A.getClassName(i)||new i(A).toRawType(),e),{})}get defKeys(){return Object.keys((0,r.default)(this,g)[g])}get isEmpty(){const A=this.toArray();for(let e=0;e(A[e]=new t(this.registry).toRawType(),A),{})}get encodedLength(){return this.toArray().reduce((A,e)=>A+=e.encodedLength,0)}get hash(){return this.registry.hash(this.toU8a())}eq(A){return(0,a.compareMap)(this,A)}get(A){return super.get(A)}getAtIndex(A){return this.toArray()[A]}toArray(){return[...this.values()]}toHex(){return(0,o.u8aToHex)(this.toU8a())}toHuman(A){return[...this.keys()].reduce((e,t)=>{const i=this.get(t);return e[t]=i&&i.toHuman(A),e},{})}toJSON(){return[...this.keys()].reduce((A,e)=>{const t=(0,r.default)(this,c)[c].get(e)||e,i=this.get(e);return A[t]=i&&i.toJSON(),A},{})}toRawType(){return JSON.stringify(f.typesToMap(this.registry,(0,r.default)(this,g)[g]))}toString(){return JSON.stringify(this.toJSON())}toU8a(A){const e=[...this.entries()];return(0,o.u8aConcat)(...e.filter(([,A])=>(0,o.isFunction)(null==A?void 0:A.toU8a)).map(([e,t])=>t.toU8a(!A||(0,o.isBoolean)(A)?A:A[e])))}}e.Struct=f},function(A,e,t){"use strict";t.d(e,"a",(function(){return i}));var i=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},function(A,e,t){"use strict";t.d(e,"a",(function(){return i}));var i=function(){function A(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return A.prototype=Object.create(Error.prototype),A}()},function(A,e,t){"use strict";var i=t(22);A.exports=function(A,e){return!!A&&i((function(){e?A.call(null,(function(){}),1):A.call(null)}))}},function(A,e,t){"use strict";t.d(e,"a",(function(){return i}));var i=function(){function A(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return A.prototype=Object.create(Error.prototype),A}()},function(A,e,t){"use strict";function i(A){return"function"==typeof A}t.d(e,"a",(function(){return i}))},function(A,e,t){var i=t(68);A.exports=function(A,e,t){if(i(A),void 0===e)return A;switch(t){case 1:return function(t){return A.call(e,t)};case 2:return function(t,i){return A.call(e,t,i)};case 3:return function(t,i,r){return A.call(e,t,i,r)}}return function(){return A.apply(e,arguments)}}},function(A,e){A.exports=function(A){if("function"!=typeof A)throw TypeError(A+" is not a function!");return A}},function(A,e){var t=Math.ceil,i=Math.floor;A.exports=function(A){return isNaN(A=+A)?0:(A>0?i:t)(A)}},function(A,e,t){var i=t(182),r=t(105),n=t(57),o=t(94),a=t(55),s=t(393),c=Object.getOwnPropertyDescriptor;e.f=t(39)?c:function(A,e){if(A=n(A),e=o(e,!0),s)try{return c(A,e)}catch(A){}if(a(A,e))return r(!i.f.call(A,e),A[e])}},function(A,e,t){var i=t(4),r=t(37),n=t(22);A.exports=function(A,e){var t=(r.Object||{})[A]||Object[A],o={};o[A]=e(t),i(i.S+i.F*n((function(){t(1)})),"Object",o)}},function(A,e,t){var i=t(67),r=t(181),n=t(44),o=t(32),a=t(409);A.exports=function(A,e){var t=1==A,s=2==A,c=3==A,g=4==A,f=6==A,u=5==A||f,h=e||a;return function(e,a,d){for(var B,l,I=n(e),E=r(I),C=i(a,d,3),Q=o(E.length),p=0,w=t?h(e,Q):s?h(e,0):void 0;Q>p;p++)if((u||p in E)&&(l=C(B=E[p],p,I),A))if(t)w[p]=l;else if(l)switch(A){case 3:return!0;case 5:return B;case 6:return p;case 2:w.push(B)}else if(g)return!1;return f?-1:c||g?g:w}}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeAddress=function(A,e,t=-1){if((0,i.isU8a)(A)||(0,i.isHex)(A))return(0,i.u8aToU8a)(A);const a=e=>`Decoding ${A}: ${e}`;let s;try{s=(0,r.base58Decode)(A)}catch(A){throw new Error(a(A.message))}(0,i.assert)(o.defaults.allowedEncodedLengths.includes(s.length),a("Invalid decoded address length"));const[c,g]=(0,n.checkAddressChecksum)(s);return(0,i.assert)(e||c,a("Invalid decoded address checksum")),s.slice(1,g)};var i=t(1),r=t(313),n=t(316),o=t(228)},function(A,e,t){"use strict";var i=e;i.version=t(928).version,i.utils=t(58),i.rand=t(320),i.curve=t(464),i.curves=t(321),i.ec=t(941),i.eddsa=t(945)},function(A,e,t){"use strict";var i=t(59),r=t(12);function n(A,e){return 55296==(64512&A.charCodeAt(e))&&(!(e<0||e+1>=A.length)&&56320==(64512&A.charCodeAt(e+1)))}function o(A){return(A>>>24|A>>>8&65280|A<<8&16711680|(255&A)<<24)>>>0}function a(A){return 1===A.length?"0"+A:A}function s(A){return 7===A.length?"0"+A:6===A.length?"00"+A:5===A.length?"000"+A:4===A.length?"0000"+A:3===A.length?"00000"+A:2===A.length?"000000"+A:1===A.length?"0000000"+A:A}e.inherits=r,e.toArray=function(A,e){if(Array.isArray(A))return A.slice();if(!A)return[];var t=[];if("string"==typeof A)if(e){if("hex"===e)for((A=A.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(A="0"+A),r=0;r>6|192,t[i++]=63&o|128):n(A,r)?(o=65536+((1023&o)<<10)+(1023&A.charCodeAt(++r)),t[i++]=o>>18|240,t[i++]=o>>12&63|128,t[i++]=o>>6&63|128,t[i++]=63&o|128):(t[i++]=o>>12|224,t[i++]=o>>6&63|128,t[i++]=63&o|128)}else for(r=0;r>>0}return o},e.split32=function(A,e){for(var t=new Array(4*A.length),i=0,r=0;i>>24,t[r+1]=n>>>16&255,t[r+2]=n>>>8&255,t[r+3]=255&n):(t[r+3]=n>>>24,t[r+2]=n>>>16&255,t[r+1]=n>>>8&255,t[r]=255&n)}return t},e.rotr32=function(A,e){return A>>>e|A<<32-e},e.rotl32=function(A,e){return A<>>32-e},e.sum32=function(A,e){return A+e>>>0},e.sum32_3=function(A,e,t){return A+e+t>>>0},e.sum32_4=function(A,e,t,i){return A+e+t+i>>>0},e.sum32_5=function(A,e,t,i,r){return A+e+t+i+r>>>0},e.sum64=function(A,e,t,i){var r=A[e],n=i+A[e+1]>>>0,o=(n>>0,A[e+1]=n},e.sum64_hi=function(A,e,t,i){return(e+i>>>0>>0},e.sum64_lo=function(A,e,t,i){return e+i>>>0},e.sum64_4_hi=function(A,e,t,i,r,n,o,a){var s=0,c=e;return s+=(c=c+i>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(A,e,t,i,r,n,o,a){return e+i+n+a>>>0},e.sum64_5_hi=function(A,e,t,i,r,n,o,a,s,c){var g=0,f=e;return g+=(f=f+i>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(A,e,t,i,r,n,o,a,s,c){return e+i+n+a+c>>>0},e.rotr64_hi=function(A,e,t){return(e<<32-t|A>>>t)>>>0},e.rotr64_lo=function(A,e,t){return(A<<32-t|e>>>t)>>>0},e.shr64_hi=function(A,e,t){return A>>>t},e.shr64_lo=function(A,e,t){return(A<<32-t|e>>>t)>>>0}},function(A,e,t){"use strict";var i=t(0);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(A,e,t=99){if((0,r.isU8a)(A)||(0,r.isHex)(A))return(0,r.u8aToU8a)(A);const i=e=>`Decoding ${A}: ${e}`;let s;try{s=(0,n.default)(A)}catch(A){throw new Error(i(A.message))}(0,r.assert)(a.default.allowedEncodedLengths.includes(s.length),i("Invalid decoded address length"));const[c,g]=(0,o.default)(s);return(0,r.assert)(e||c,i("Invalid decoded address checksum")),s.slice(1,g)};var r=t(10),n=i(t(362)),o=i(t(364)),a=i(t(248))},function(A,e,t){"use strict";t.d(e,"a",(function(){return i}));var i=function(){function A(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return A.prototype=Object.create(Error.prototype),A}()},function(A,e,t){"use strict";t.d(e,"b",(function(){return a})),t.d(e,"a",(function(){return g}));var i=t(2),r=t(29),n=t(38),o=t(5);function a(A,e,t){return void 0===t&&(t=Number.POSITIVE_INFINITY),"function"==typeof e?function(i){return i.pipe(a((function(t,i){return Object(n.a)(A(t,i)).pipe(Object(r.a)((function(A,r){return e(t,A,i,r)})))}),t))}:("number"==typeof e&&(t=e),function(e){return e.lift(new s(A,t))})}var s=function(){function A(A,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=A,this.concurrent=e}return A.prototype.call=function(A,e){return e.subscribe(new c(A,this.project,this.concurrent))},A}(),c=function(A){function e(e,t,i){void 0===i&&(i=Number.POSITIVE_INFINITY);var r=A.call(this,e)||this;return r.project=t,r.concurrent=i,r.hasCompleted=!1,r.buffer=[],r.active=0,r.index=0,r}return i.__extends(e,A),e.prototype._next=function(A){this.active0?this._next(A.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(o.b),g=a},function(A,e,t){"use strict";t.d(e,"a",(function(){return o}));var i=t(8),r=t(272),n=t(179);function o(A,e){return e?Object(n.a)(A,e):new i.a(Object(r.a)(A))}},function(A,e,t){"use strict";t.d(e,"a",(function(){return n}));var i=t(2),r=t(209),n=function(A){function e(t,i){void 0===i&&(i=r.a.now);var n=A.call(this,t,(function(){return e.delegate&&e.delegate!==n?e.delegate.now():i()}))||this;return n.actions=[],n.active=!1,n.scheduled=void 0,n}return i.__extends(e,A),e.prototype.schedule=function(t,i,r){return void 0===i&&(i=0),e.delegate&&e.delegate!==this?e.delegate.schedule(t,i,r):A.prototype.schedule.call(this,t,i,r)},e.prototype.flush=function(A){var e=this.actions;if(this.active)e.push(A);else{var t;this.active=!0;do{if(t=A.execute(A.state,A.delay))break}while(A=e.shift());if(this.active=!1,t){for(;A=e.shift();)A.unsubscribe();throw t}}},e}(r.a)},function(A,e,t){"use strict";t.d(e,"a",(function(){return o}));var i=t(2),r=t(20),n=t(13),o=function(A){function e(){var e=null!==A&&A.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return i.__extends(e,A),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),n.a.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),n.a.EMPTY):A.prototype._subscribe.call(this,e)},e.prototype.next=function(A){this.hasCompleted||(this.value=A,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||A.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&A.prototype.next.call(this,this.value),A.prototype.complete.call(this)},e}(r.a)},function(A,e,t){"use strict";t.d(e,"a",(function(){return r}));var i=t(2),r=function(A){function e(e,t){var i=A.call(this,e,t)||this;return i.scheduler=e,i.work=t,i.pending=!1,i}return i.__extends(e,A),e.prototype.schedule=function(A,e){if(void 0===e&&(e=0),this.closed)return this;this.state=A;var t=this.id,i=this.scheduler;return null!=t&&(this.id=this.recycleAsyncId(i,t,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(i,this.id,e),this},e.prototype.requestAsyncId=function(A,e,t){return void 0===t&&(t=0),setInterval(A.flush.bind(A,this),t)},e.prototype.recycleAsyncId=function(A,e,t){if(void 0===t&&(t=0),null!==t&&this.delay===t&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(A,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var t=this._execute(A,e);if(t)return t;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(A,e){var t=!1,i=void 0;try{this.work(A)}catch(A){t=!0,i=!!A&&A||new Error(A)}if(t)return this.unsubscribe(),i},e.prototype._unsubscribe=function(){var A=this.id,e=this.scheduler,t=e.actions,i=t.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==i&&t.splice(i,1),null!=A&&(this.id=this.recycleAsyncId(e,A,null)),this.delay=null},e}(function(A){function e(e,t){return A.call(this)||this}return i.__extends(e,A),e.prototype.schedule=function(A,e){return void 0===e&&(e=0),this},e}(t(13).a))},function(A,e,t){"use strict";t.d(e,"a",(function(){return r}));var i=t(26);function r(A){return!Object(i.a)(A)&&A-parseFloat(A)+1>=0}},function(A,e){var t={}.toString;A.exports=function(A){return t.call(A).slice(8,-1)}},function(A,e){A.exports=function(A){if(null==A)throw TypeError("Can't call method on "+A);return A}},function(A,e,t){"use strict";if(t(39)){var i=t(107),r=t(21),n=t(22),o=t(4),a=t(222),s=t(300),c=t(67),g=t(141),f=t(105),u=t(56),h=t(142),d=t(69),B=t(32),l=t(420),I=t(109),E=t(94),C=t(55),Q=t(183),p=t(24),w=t(44),m=t(292),y=t(110),M=t(112),b=t(111).f,D=t(294),v=t(106),S=t(28),k=t(72),G=t(212),N=t(184),F=t(296),O=t(139),R=t(215),U=t(140),Y=t(295),x=t(411),H=t(40),L=t(70),K=H.f,J=L.f,P=r.RangeError,j=r.TypeError,_=r.Uint8Array,q=Array.prototype,T=s.ArrayBuffer,Z=s.DataView,V=k(0),W=k(2),z=k(3),X=k(4),$=k(5),AA=k(6),eA=G(!0),tA=G(!1),iA=F.values,rA=F.keys,nA=F.entries,oA=q.lastIndexOf,aA=q.reduce,sA=q.reduceRight,cA=q.join,gA=q.sort,fA=q.slice,uA=q.toString,hA=q.toLocaleString,dA=S("iterator"),BA=S("toStringTag"),lA=v("typed_constructor"),IA=v("def_constructor"),EA=a.CONSTR,CA=a.TYPED,QA=a.VIEW,pA=k(1,(function(A,e){return bA(N(A,A[IA]),e)})),wA=n((function(){return 1===new _(new Uint16Array([1]).buffer)[0]})),mA=!!_&&!!_.prototype.set&&n((function(){new _(1).set({})})),yA=function(A,e){var t=d(A);if(t<0||t%e)throw P("Wrong offset!");return t},MA=function(A){if(p(A)&&CA in A)return A;throw j(A+" is not a typed array!")},bA=function(A,e){if(!p(A)||!(lA in A))throw j("It is not a typed array constructor!");return new A(e)},DA=function(A,e){return vA(N(A,A[IA]),e)},vA=function(A,e){for(var t=0,i=e.length,r=bA(A,i);i>t;)r[t]=e[t++];return r},SA=function(A,e,t){K(A,e,{get:function(){return this._d[t]}})},kA=function(A){var e,t,i,r,n,o,a=w(A),s=arguments.length,g=s>1?arguments[1]:void 0,f=void 0!==g,u=D(a);if(null!=u&&!m(u)){for(o=u.call(a),i=[],e=0;!(n=o.next()).done;e++)i.push(n.value);a=i}for(f&&s>2&&(g=c(g,arguments[2],2)),e=0,t=B(a.length),r=bA(this,t);t>e;e++)r[e]=f?g(a[e],e):a[e];return r},GA=function(){for(var A=0,e=arguments.length,t=bA(this,e);e>A;)t[A]=arguments[A++];return t},NA=!!_&&n((function(){hA.call(new _(1))})),FA=function(){return hA.apply(NA?fA.call(MA(this)):MA(this),arguments)},OA={copyWithin:function(A,e){return x.call(MA(this),A,e,arguments.length>2?arguments[2]:void 0)},every:function(A){return X(MA(this),A,arguments.length>1?arguments[1]:void 0)},fill:function(A){return Y.apply(MA(this),arguments)},filter:function(A){return DA(this,W(MA(this),A,arguments.length>1?arguments[1]:void 0))},find:function(A){return $(MA(this),A,arguments.length>1?arguments[1]:void 0)},findIndex:function(A){return AA(MA(this),A,arguments.length>1?arguments[1]:void 0)},forEach:function(A){V(MA(this),A,arguments.length>1?arguments[1]:void 0)},indexOf:function(A){return tA(MA(this),A,arguments.length>1?arguments[1]:void 0)},includes:function(A){return eA(MA(this),A,arguments.length>1?arguments[1]:void 0)},join:function(A){return cA.apply(MA(this),arguments)},lastIndexOf:function(A){return oA.apply(MA(this),arguments)},map:function(A){return pA(MA(this),A,arguments.length>1?arguments[1]:void 0)},reduce:function(A){return aA.apply(MA(this),arguments)},reduceRight:function(A){return sA.apply(MA(this),arguments)},reverse:function(){for(var A,e=MA(this).length,t=Math.floor(e/2),i=0;i1?arguments[1]:void 0)},sort:function(A){return gA.call(MA(this),A)},subarray:function(A,e){var t=MA(this),i=t.length,r=I(A,i);return new(N(t,t[IA]))(t.buffer,t.byteOffset+r*t.BYTES_PER_ELEMENT,B((void 0===e?i:I(e,i))-r))}},RA=function(A,e){return DA(this,fA.call(MA(this),A,e))},UA=function(A){MA(this);var e=yA(arguments[1],1),t=this.length,i=w(A),r=B(i.length),n=0;if(r+e>t)throw P("Wrong length!");for(;n255?255:255&i),r.v[h](t*e+r.o,i,wA)}(this,t,A)},enumerable:!0})};C?(d=t((function(A,t,i,r){g(A,d,c,"_d");var n,o,a,s,f=0,h=0;if(p(t)){if(!(t instanceof T||"ArrayBuffer"==(s=Q(t))||"SharedArrayBuffer"==s))return CA in t?vA(d,t):kA.call(d,t);n=t,h=yA(i,e);var I=t.byteLength;if(void 0===r){if(I%e)throw P("Wrong length!");if((o=I-h)<0)throw P("Wrong length!")}else if((o=B(r)*e)+h>I)throw P("Wrong length!");a=o/e}else a=l(t),n=new T(o=a*e);for(u(A,"_d",{b:n,o:h,l:o,e:a,v:new Z(n)});f=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function s(A,e,t){var i=a(A,t);return t-1>=e&&(i|=a(A,t-1)<<4),i}function c(A,e,t,i){for(var r=0,n=Math.min(A.length,t),o=e;o=49?a-49+10:a>=17?a-17+10:a}return r}n.isBN=function(A){return A instanceof n||null!==A&&"object"==typeof A&&A.constructor.wordSize===n.wordSize&&Array.isArray(A.words)},n.max=function(A,e){return A.cmp(e)>0?A:e},n.min=function(A,e){return A.cmp(e)<0?A:e},n.prototype._init=function(A,e,t){if("number"==typeof A)return this._initNumber(A,e,t);if("object"==typeof A)return this._initArray(A,e,t);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var r=0;"-"===(A=A.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)o=A[r]|A[r-1]<<8|A[r-2]<<16,this.words[n]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===t)for(r=0,n=0;r>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this.strip()},n.prototype._parseHex=function(A,e,t){this.length=Math.ceil((A.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)r=s(A,e,i)<=18?(n-=18,o+=1,this.words[o]|=r>>>26):n+=8;else for(i=(A.length-e)%2==0?e+1:e;i=18?(n-=18,o+=1,this.words[o]|=r>>>26):n+=8;this.strip()},n.prototype._parseBase=function(A,e,t){this.words=[0],this.length=1;for(var i=0,r=1;r<=67108863;r*=e)i++;i--,r=r/e|0;for(var n=A.length-t,o=n%i,a=Math.min(n,n-o)+t,s=0,g=t;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var g=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(A,e,t){t.negative=e.negative^A.negative;var i=A.length+e.length|0;t.length=i,i=i-1|0;var r=0|A.words[0],n=0|e.words[0],o=r*n,a=67108863&o,s=o/67108864|0;t.words[0]=a;for(var c=1;c>>26,f=67108863&s,u=Math.min(c,e.length-1),h=Math.max(0,c-A.length+1);h<=u;h++){var d=c-h|0;g+=(o=(r=0|A.words[d])*(n=0|e.words[h])+f)/67108864|0,f=67108863&o}t.words[c]=0|f,s=0|g}return 0!==s?t.words[c]=0|s:t.length--,t.strip()}n.prototype.toString=function(A,e){var t;if(e=0|e||1,16===(A=A||10)||"hex"===A){t="";for(var r=0,n=0,o=0;o>>24-r&16777215)||o!==this.length-1?g[6-s.length]+s+t:s+t,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(t=n.toString(16)+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(A===(0|A)&&A>=2&&A<=36){var c=f[A],h=u[A];t="";var d=this.clone();for(d.negative=0;!d.isZero();){var B=d.modn(h).toString(A);t=(d=d.idivn(h)).isZero()?B+t:g[c-B.length]+B+t}for(this.isZero()&&(t="0"+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}i(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var A=this.words[0];return 2===this.length?A+=67108864*this.words[1]:3===this.length&&1===this.words[2]?A+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-A:A},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(A,e){return i(void 0!==o),this.toArrayLike(o,A,e)},n.prototype.toArray=function(A,e){return this.toArrayLike(Array,A,e)},n.prototype.toArrayLike=function(A,e,t){var r=this.byteLength(),n=t||Math.max(1,r);i(r<=n,"byte array longer than desired length"),i(n>0,"Requested array length <= 0"),this.strip();var o,a,s="le"===e,c=new A(n),g=this.clone();if(s){for(a=0;!g.isZero();a++)o=g.andln(255),g.iushrn(8),c[a]=o;for(;a=4096&&(t+=13,e>>>=13),e>=64&&(t+=7,e>>>=7),e>=8&&(t+=4,e>>>=4),e>=2&&(t+=2,e>>>=2),t+e},n.prototype._zeroBits=function(A){if(0===A)return 26;var e=A,t=0;return 0==(8191&e)&&(t+=13,e>>>=13),0==(127&e)&&(t+=7,e>>>=7),0==(15&e)&&(t+=4,e>>>=4),0==(3&e)&&(t+=2,e>>>=2),0==(1&e)&&t++,t},n.prototype.bitLength=function(){var A=this.words[this.length-1],e=this._countBits(A);return 26*(this.length-1)+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var A=0,e=0;eA.length?this.clone().ior(A):A.clone().ior(this)},n.prototype.uor=function(A){return this.length>A.length?this.clone().iuor(A):A.clone().iuor(this)},n.prototype.iuand=function(A){var e;e=this.length>A.length?A:this;for(var t=0;tA.length?this.clone().iand(A):A.clone().iand(this)},n.prototype.uand=function(A){return this.length>A.length?this.clone().iuand(A):A.clone().iuand(this)},n.prototype.iuxor=function(A){var e,t;this.length>A.length?(e=this,t=A):(e=A,t=this);for(var i=0;iA.length?this.clone().ixor(A):A.clone().ixor(this)},n.prototype.uxor=function(A){return this.length>A.length?this.clone().iuxor(A):A.clone().iuxor(this)},n.prototype.inotn=function(A){i("number"==typeof A&&A>=0);var e=0|Math.ceil(A/26),t=A%26;this._expand(e),t>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-t),this.strip()},n.prototype.notn=function(A){return this.clone().inotn(A)},n.prototype.setn=function(A,e){i("number"==typeof A&&A>=0);var t=A/26|0,r=A%26;return this._expand(t+1),this.words[t]=e?this.words[t]|1<A.length?(t=this,i=A):(t=A,i=this);for(var r=0,n=0;n>>26;for(;0!==r&&n>>26;if(this.length=t.length,0!==r)this.words[this.length]=r,this.length++;else if(t!==this)for(;nA.length?this.clone().iadd(A):A.clone().iadd(this)},n.prototype.isub=function(A){if(0!==A.negative){A.negative=0;var e=this.iadd(A);return A.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(A),this.negative=1,this._normSign();var t,i,r=this.cmp(A);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(t=this,i=A):(t=A,i=this);for(var n=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==n&&o>26,this.words[o]=67108863&e;if(0===n&&o>>13,h=0|o[1],d=8191&h,B=h>>>13,l=0|o[2],I=8191&l,E=l>>>13,C=0|o[3],Q=8191&C,p=C>>>13,w=0|o[4],m=8191&w,y=w>>>13,M=0|o[5],b=8191&M,D=M>>>13,v=0|o[6],S=8191&v,k=v>>>13,G=0|o[7],N=8191&G,F=G>>>13,O=0|o[8],R=8191&O,U=O>>>13,Y=0|o[9],x=8191&Y,H=Y>>>13,L=0|a[0],K=8191&L,J=L>>>13,P=0|a[1],j=8191&P,_=P>>>13,q=0|a[2],T=8191&q,Z=q>>>13,V=0|a[3],W=8191&V,z=V>>>13,X=0|a[4],$=8191&X,AA=X>>>13,eA=0|a[5],tA=8191&eA,iA=eA>>>13,rA=0|a[6],nA=8191&rA,oA=rA>>>13,aA=0|a[7],sA=8191&aA,cA=aA>>>13,gA=0|a[8],fA=8191&gA,uA=gA>>>13,hA=0|a[9],dA=8191&hA,BA=hA>>>13;t.negative=A.negative^e.negative,t.length=19;var lA=(c+(i=Math.imul(f,K))|0)+((8191&(r=(r=Math.imul(f,J))+Math.imul(u,K)|0))<<13)|0;c=((n=Math.imul(u,J))+(r>>>13)|0)+(lA>>>26)|0,lA&=67108863,i=Math.imul(d,K),r=(r=Math.imul(d,J))+Math.imul(B,K)|0,n=Math.imul(B,J);var IA=(c+(i=i+Math.imul(f,j)|0)|0)+((8191&(r=(r=r+Math.imul(f,_)|0)+Math.imul(u,j)|0))<<13)|0;c=((n=n+Math.imul(u,_)|0)+(r>>>13)|0)+(IA>>>26)|0,IA&=67108863,i=Math.imul(I,K),r=(r=Math.imul(I,J))+Math.imul(E,K)|0,n=Math.imul(E,J),i=i+Math.imul(d,j)|0,r=(r=r+Math.imul(d,_)|0)+Math.imul(B,j)|0,n=n+Math.imul(B,_)|0;var EA=(c+(i=i+Math.imul(f,T)|0)|0)+((8191&(r=(r=r+Math.imul(f,Z)|0)+Math.imul(u,T)|0))<<13)|0;c=((n=n+Math.imul(u,Z)|0)+(r>>>13)|0)+(EA>>>26)|0,EA&=67108863,i=Math.imul(Q,K),r=(r=Math.imul(Q,J))+Math.imul(p,K)|0,n=Math.imul(p,J),i=i+Math.imul(I,j)|0,r=(r=r+Math.imul(I,_)|0)+Math.imul(E,j)|0,n=n+Math.imul(E,_)|0,i=i+Math.imul(d,T)|0,r=(r=r+Math.imul(d,Z)|0)+Math.imul(B,T)|0,n=n+Math.imul(B,Z)|0;var CA=(c+(i=i+Math.imul(f,W)|0)|0)+((8191&(r=(r=r+Math.imul(f,z)|0)+Math.imul(u,W)|0))<<13)|0;c=((n=n+Math.imul(u,z)|0)+(r>>>13)|0)+(CA>>>26)|0,CA&=67108863,i=Math.imul(m,K),r=(r=Math.imul(m,J))+Math.imul(y,K)|0,n=Math.imul(y,J),i=i+Math.imul(Q,j)|0,r=(r=r+Math.imul(Q,_)|0)+Math.imul(p,j)|0,n=n+Math.imul(p,_)|0,i=i+Math.imul(I,T)|0,r=(r=r+Math.imul(I,Z)|0)+Math.imul(E,T)|0,n=n+Math.imul(E,Z)|0,i=i+Math.imul(d,W)|0,r=(r=r+Math.imul(d,z)|0)+Math.imul(B,W)|0,n=n+Math.imul(B,z)|0;var QA=(c+(i=i+Math.imul(f,$)|0)|0)+((8191&(r=(r=r+Math.imul(f,AA)|0)+Math.imul(u,$)|0))<<13)|0;c=((n=n+Math.imul(u,AA)|0)+(r>>>13)|0)+(QA>>>26)|0,QA&=67108863,i=Math.imul(b,K),r=(r=Math.imul(b,J))+Math.imul(D,K)|0,n=Math.imul(D,J),i=i+Math.imul(m,j)|0,r=(r=r+Math.imul(m,_)|0)+Math.imul(y,j)|0,n=n+Math.imul(y,_)|0,i=i+Math.imul(Q,T)|0,r=(r=r+Math.imul(Q,Z)|0)+Math.imul(p,T)|0,n=n+Math.imul(p,Z)|0,i=i+Math.imul(I,W)|0,r=(r=r+Math.imul(I,z)|0)+Math.imul(E,W)|0,n=n+Math.imul(E,z)|0,i=i+Math.imul(d,$)|0,r=(r=r+Math.imul(d,AA)|0)+Math.imul(B,$)|0,n=n+Math.imul(B,AA)|0;var pA=(c+(i=i+Math.imul(f,tA)|0)|0)+((8191&(r=(r=r+Math.imul(f,iA)|0)+Math.imul(u,tA)|0))<<13)|0;c=((n=n+Math.imul(u,iA)|0)+(r>>>13)|0)+(pA>>>26)|0,pA&=67108863,i=Math.imul(S,K),r=(r=Math.imul(S,J))+Math.imul(k,K)|0,n=Math.imul(k,J),i=i+Math.imul(b,j)|0,r=(r=r+Math.imul(b,_)|0)+Math.imul(D,j)|0,n=n+Math.imul(D,_)|0,i=i+Math.imul(m,T)|0,r=(r=r+Math.imul(m,Z)|0)+Math.imul(y,T)|0,n=n+Math.imul(y,Z)|0,i=i+Math.imul(Q,W)|0,r=(r=r+Math.imul(Q,z)|0)+Math.imul(p,W)|0,n=n+Math.imul(p,z)|0,i=i+Math.imul(I,$)|0,r=(r=r+Math.imul(I,AA)|0)+Math.imul(E,$)|0,n=n+Math.imul(E,AA)|0,i=i+Math.imul(d,tA)|0,r=(r=r+Math.imul(d,iA)|0)+Math.imul(B,tA)|0,n=n+Math.imul(B,iA)|0;var wA=(c+(i=i+Math.imul(f,nA)|0)|0)+((8191&(r=(r=r+Math.imul(f,oA)|0)+Math.imul(u,nA)|0))<<13)|0;c=((n=n+Math.imul(u,oA)|0)+(r>>>13)|0)+(wA>>>26)|0,wA&=67108863,i=Math.imul(N,K),r=(r=Math.imul(N,J))+Math.imul(F,K)|0,n=Math.imul(F,J),i=i+Math.imul(S,j)|0,r=(r=r+Math.imul(S,_)|0)+Math.imul(k,j)|0,n=n+Math.imul(k,_)|0,i=i+Math.imul(b,T)|0,r=(r=r+Math.imul(b,Z)|0)+Math.imul(D,T)|0,n=n+Math.imul(D,Z)|0,i=i+Math.imul(m,W)|0,r=(r=r+Math.imul(m,z)|0)+Math.imul(y,W)|0,n=n+Math.imul(y,z)|0,i=i+Math.imul(Q,$)|0,r=(r=r+Math.imul(Q,AA)|0)+Math.imul(p,$)|0,n=n+Math.imul(p,AA)|0,i=i+Math.imul(I,tA)|0,r=(r=r+Math.imul(I,iA)|0)+Math.imul(E,tA)|0,n=n+Math.imul(E,iA)|0,i=i+Math.imul(d,nA)|0,r=(r=r+Math.imul(d,oA)|0)+Math.imul(B,nA)|0,n=n+Math.imul(B,oA)|0;var mA=(c+(i=i+Math.imul(f,sA)|0)|0)+((8191&(r=(r=r+Math.imul(f,cA)|0)+Math.imul(u,sA)|0))<<13)|0;c=((n=n+Math.imul(u,cA)|0)+(r>>>13)|0)+(mA>>>26)|0,mA&=67108863,i=Math.imul(R,K),r=(r=Math.imul(R,J))+Math.imul(U,K)|0,n=Math.imul(U,J),i=i+Math.imul(N,j)|0,r=(r=r+Math.imul(N,_)|0)+Math.imul(F,j)|0,n=n+Math.imul(F,_)|0,i=i+Math.imul(S,T)|0,r=(r=r+Math.imul(S,Z)|0)+Math.imul(k,T)|0,n=n+Math.imul(k,Z)|0,i=i+Math.imul(b,W)|0,r=(r=r+Math.imul(b,z)|0)+Math.imul(D,W)|0,n=n+Math.imul(D,z)|0,i=i+Math.imul(m,$)|0,r=(r=r+Math.imul(m,AA)|0)+Math.imul(y,$)|0,n=n+Math.imul(y,AA)|0,i=i+Math.imul(Q,tA)|0,r=(r=r+Math.imul(Q,iA)|0)+Math.imul(p,tA)|0,n=n+Math.imul(p,iA)|0,i=i+Math.imul(I,nA)|0,r=(r=r+Math.imul(I,oA)|0)+Math.imul(E,nA)|0,n=n+Math.imul(E,oA)|0,i=i+Math.imul(d,sA)|0,r=(r=r+Math.imul(d,cA)|0)+Math.imul(B,sA)|0,n=n+Math.imul(B,cA)|0;var yA=(c+(i=i+Math.imul(f,fA)|0)|0)+((8191&(r=(r=r+Math.imul(f,uA)|0)+Math.imul(u,fA)|0))<<13)|0;c=((n=n+Math.imul(u,uA)|0)+(r>>>13)|0)+(yA>>>26)|0,yA&=67108863,i=Math.imul(x,K),r=(r=Math.imul(x,J))+Math.imul(H,K)|0,n=Math.imul(H,J),i=i+Math.imul(R,j)|0,r=(r=r+Math.imul(R,_)|0)+Math.imul(U,j)|0,n=n+Math.imul(U,_)|0,i=i+Math.imul(N,T)|0,r=(r=r+Math.imul(N,Z)|0)+Math.imul(F,T)|0,n=n+Math.imul(F,Z)|0,i=i+Math.imul(S,W)|0,r=(r=r+Math.imul(S,z)|0)+Math.imul(k,W)|0,n=n+Math.imul(k,z)|0,i=i+Math.imul(b,$)|0,r=(r=r+Math.imul(b,AA)|0)+Math.imul(D,$)|0,n=n+Math.imul(D,AA)|0,i=i+Math.imul(m,tA)|0,r=(r=r+Math.imul(m,iA)|0)+Math.imul(y,tA)|0,n=n+Math.imul(y,iA)|0,i=i+Math.imul(Q,nA)|0,r=(r=r+Math.imul(Q,oA)|0)+Math.imul(p,nA)|0,n=n+Math.imul(p,oA)|0,i=i+Math.imul(I,sA)|0,r=(r=r+Math.imul(I,cA)|0)+Math.imul(E,sA)|0,n=n+Math.imul(E,cA)|0,i=i+Math.imul(d,fA)|0,r=(r=r+Math.imul(d,uA)|0)+Math.imul(B,fA)|0,n=n+Math.imul(B,uA)|0;var MA=(c+(i=i+Math.imul(f,dA)|0)|0)+((8191&(r=(r=r+Math.imul(f,BA)|0)+Math.imul(u,dA)|0))<<13)|0;c=((n=n+Math.imul(u,BA)|0)+(r>>>13)|0)+(MA>>>26)|0,MA&=67108863,i=Math.imul(x,j),r=(r=Math.imul(x,_))+Math.imul(H,j)|0,n=Math.imul(H,_),i=i+Math.imul(R,T)|0,r=(r=r+Math.imul(R,Z)|0)+Math.imul(U,T)|0,n=n+Math.imul(U,Z)|0,i=i+Math.imul(N,W)|0,r=(r=r+Math.imul(N,z)|0)+Math.imul(F,W)|0,n=n+Math.imul(F,z)|0,i=i+Math.imul(S,$)|0,r=(r=r+Math.imul(S,AA)|0)+Math.imul(k,$)|0,n=n+Math.imul(k,AA)|0,i=i+Math.imul(b,tA)|0,r=(r=r+Math.imul(b,iA)|0)+Math.imul(D,tA)|0,n=n+Math.imul(D,iA)|0,i=i+Math.imul(m,nA)|0,r=(r=r+Math.imul(m,oA)|0)+Math.imul(y,nA)|0,n=n+Math.imul(y,oA)|0,i=i+Math.imul(Q,sA)|0,r=(r=r+Math.imul(Q,cA)|0)+Math.imul(p,sA)|0,n=n+Math.imul(p,cA)|0,i=i+Math.imul(I,fA)|0,r=(r=r+Math.imul(I,uA)|0)+Math.imul(E,fA)|0,n=n+Math.imul(E,uA)|0;var bA=(c+(i=i+Math.imul(d,dA)|0)|0)+((8191&(r=(r=r+Math.imul(d,BA)|0)+Math.imul(B,dA)|0))<<13)|0;c=((n=n+Math.imul(B,BA)|0)+(r>>>13)|0)+(bA>>>26)|0,bA&=67108863,i=Math.imul(x,T),r=(r=Math.imul(x,Z))+Math.imul(H,T)|0,n=Math.imul(H,Z),i=i+Math.imul(R,W)|0,r=(r=r+Math.imul(R,z)|0)+Math.imul(U,W)|0,n=n+Math.imul(U,z)|0,i=i+Math.imul(N,$)|0,r=(r=r+Math.imul(N,AA)|0)+Math.imul(F,$)|0,n=n+Math.imul(F,AA)|0,i=i+Math.imul(S,tA)|0,r=(r=r+Math.imul(S,iA)|0)+Math.imul(k,tA)|0,n=n+Math.imul(k,iA)|0,i=i+Math.imul(b,nA)|0,r=(r=r+Math.imul(b,oA)|0)+Math.imul(D,nA)|0,n=n+Math.imul(D,oA)|0,i=i+Math.imul(m,sA)|0,r=(r=r+Math.imul(m,cA)|0)+Math.imul(y,sA)|0,n=n+Math.imul(y,cA)|0,i=i+Math.imul(Q,fA)|0,r=(r=r+Math.imul(Q,uA)|0)+Math.imul(p,fA)|0,n=n+Math.imul(p,uA)|0;var DA=(c+(i=i+Math.imul(I,dA)|0)|0)+((8191&(r=(r=r+Math.imul(I,BA)|0)+Math.imul(E,dA)|0))<<13)|0;c=((n=n+Math.imul(E,BA)|0)+(r>>>13)|0)+(DA>>>26)|0,DA&=67108863,i=Math.imul(x,W),r=(r=Math.imul(x,z))+Math.imul(H,W)|0,n=Math.imul(H,z),i=i+Math.imul(R,$)|0,r=(r=r+Math.imul(R,AA)|0)+Math.imul(U,$)|0,n=n+Math.imul(U,AA)|0,i=i+Math.imul(N,tA)|0,r=(r=r+Math.imul(N,iA)|0)+Math.imul(F,tA)|0,n=n+Math.imul(F,iA)|0,i=i+Math.imul(S,nA)|0,r=(r=r+Math.imul(S,oA)|0)+Math.imul(k,nA)|0,n=n+Math.imul(k,oA)|0,i=i+Math.imul(b,sA)|0,r=(r=r+Math.imul(b,cA)|0)+Math.imul(D,sA)|0,n=n+Math.imul(D,cA)|0,i=i+Math.imul(m,fA)|0,r=(r=r+Math.imul(m,uA)|0)+Math.imul(y,fA)|0,n=n+Math.imul(y,uA)|0;var vA=(c+(i=i+Math.imul(Q,dA)|0)|0)+((8191&(r=(r=r+Math.imul(Q,BA)|0)+Math.imul(p,dA)|0))<<13)|0;c=((n=n+Math.imul(p,BA)|0)+(r>>>13)|0)+(vA>>>26)|0,vA&=67108863,i=Math.imul(x,$),r=(r=Math.imul(x,AA))+Math.imul(H,$)|0,n=Math.imul(H,AA),i=i+Math.imul(R,tA)|0,r=(r=r+Math.imul(R,iA)|0)+Math.imul(U,tA)|0,n=n+Math.imul(U,iA)|0,i=i+Math.imul(N,nA)|0,r=(r=r+Math.imul(N,oA)|0)+Math.imul(F,nA)|0,n=n+Math.imul(F,oA)|0,i=i+Math.imul(S,sA)|0,r=(r=r+Math.imul(S,cA)|0)+Math.imul(k,sA)|0,n=n+Math.imul(k,cA)|0,i=i+Math.imul(b,fA)|0,r=(r=r+Math.imul(b,uA)|0)+Math.imul(D,fA)|0,n=n+Math.imul(D,uA)|0;var SA=(c+(i=i+Math.imul(m,dA)|0)|0)+((8191&(r=(r=r+Math.imul(m,BA)|0)+Math.imul(y,dA)|0))<<13)|0;c=((n=n+Math.imul(y,BA)|0)+(r>>>13)|0)+(SA>>>26)|0,SA&=67108863,i=Math.imul(x,tA),r=(r=Math.imul(x,iA))+Math.imul(H,tA)|0,n=Math.imul(H,iA),i=i+Math.imul(R,nA)|0,r=(r=r+Math.imul(R,oA)|0)+Math.imul(U,nA)|0,n=n+Math.imul(U,oA)|0,i=i+Math.imul(N,sA)|0,r=(r=r+Math.imul(N,cA)|0)+Math.imul(F,sA)|0,n=n+Math.imul(F,cA)|0,i=i+Math.imul(S,fA)|0,r=(r=r+Math.imul(S,uA)|0)+Math.imul(k,fA)|0,n=n+Math.imul(k,uA)|0;var kA=(c+(i=i+Math.imul(b,dA)|0)|0)+((8191&(r=(r=r+Math.imul(b,BA)|0)+Math.imul(D,dA)|0))<<13)|0;c=((n=n+Math.imul(D,BA)|0)+(r>>>13)|0)+(kA>>>26)|0,kA&=67108863,i=Math.imul(x,nA),r=(r=Math.imul(x,oA))+Math.imul(H,nA)|0,n=Math.imul(H,oA),i=i+Math.imul(R,sA)|0,r=(r=r+Math.imul(R,cA)|0)+Math.imul(U,sA)|0,n=n+Math.imul(U,cA)|0,i=i+Math.imul(N,fA)|0,r=(r=r+Math.imul(N,uA)|0)+Math.imul(F,fA)|0,n=n+Math.imul(F,uA)|0;var GA=(c+(i=i+Math.imul(S,dA)|0)|0)+((8191&(r=(r=r+Math.imul(S,BA)|0)+Math.imul(k,dA)|0))<<13)|0;c=((n=n+Math.imul(k,BA)|0)+(r>>>13)|0)+(GA>>>26)|0,GA&=67108863,i=Math.imul(x,sA),r=(r=Math.imul(x,cA))+Math.imul(H,sA)|0,n=Math.imul(H,cA),i=i+Math.imul(R,fA)|0,r=(r=r+Math.imul(R,uA)|0)+Math.imul(U,fA)|0,n=n+Math.imul(U,uA)|0;var NA=(c+(i=i+Math.imul(N,dA)|0)|0)+((8191&(r=(r=r+Math.imul(N,BA)|0)+Math.imul(F,dA)|0))<<13)|0;c=((n=n+Math.imul(F,BA)|0)+(r>>>13)|0)+(NA>>>26)|0,NA&=67108863,i=Math.imul(x,fA),r=(r=Math.imul(x,uA))+Math.imul(H,fA)|0,n=Math.imul(H,uA);var FA=(c+(i=i+Math.imul(R,dA)|0)|0)+((8191&(r=(r=r+Math.imul(R,BA)|0)+Math.imul(U,dA)|0))<<13)|0;c=((n=n+Math.imul(U,BA)|0)+(r>>>13)|0)+(FA>>>26)|0,FA&=67108863;var OA=(c+(i=Math.imul(x,dA))|0)+((8191&(r=(r=Math.imul(x,BA))+Math.imul(H,dA)|0))<<13)|0;return c=((n=Math.imul(H,BA))+(r>>>13)|0)+(OA>>>26)|0,OA&=67108863,s[0]=lA,s[1]=IA,s[2]=EA,s[3]=CA,s[4]=QA,s[5]=pA,s[6]=wA,s[7]=mA,s[8]=yA,s[9]=MA,s[10]=bA,s[11]=DA,s[12]=vA,s[13]=SA,s[14]=kA,s[15]=GA,s[16]=NA,s[17]=FA,s[18]=OA,0!==c&&(s[19]=c,t.length++),t};function B(A,e,t){return(new l).mulp(A,e,t)}function l(A,e){this.x=A,this.y=e}Math.imul||(d=h),n.prototype.mulTo=function(A,e){var t=this.length+A.length;return 10===this.length&&10===A.length?d(this,A,e):t<63?h(this,A,e):t<1024?function(A,e,t){t.negative=e.negative^A.negative,t.length=A.length+e.length;for(var i=0,r=0,n=0;n>>26)|0)>>>26,o&=67108863}t.words[n]=a,i=o,o=r}return 0!==i?t.words[n]=i:t.length--,t.strip()}(this,A,e):B(this,A,e)},l.prototype.makeRBT=function(A){for(var e=new Array(A),t=n.prototype._countBits(A)-1,i=0;i>=1;return i},l.prototype.permute=function(A,e,t,i,r,n){for(var o=0;o>>=1)r++;return 1<>>=13,t[2*o+1]=8191&n,n>>>=13;for(o=2*e;o>=26,e+=r/67108864|0,e+=n>>>26,this.words[t]=67108863&n}return 0!==e&&(this.words[t]=e,this.length++),this},n.prototype.muln=function(A){return this.clone().imuln(A)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(A){var e=function(A){for(var e=new Array(A.bitLength()),t=0;t>>r}return e}(A);if(0===e.length)return new n(1);for(var t=this,i=0;i=0);var e,t=A%26,r=(A-t)/26,n=67108863>>>26-t<<26-t;if(0!==t){var o=0;for(e=0;e>>26-t}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e=0),r=e?(e-e%26)/26:0;var n=A%26,o=Math.min((A-n)/26,this.length),a=67108863^67108863>>>n<o)for(this.length-=o,c=0;c=0&&(0!==g||c>=r);c--){var f=0|this.words[c];this.words[c]=g<<26-n|f>>>n,g=f&a}return s&&0!==g&&(s.words[s.length++]=g),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(A,e,t){return i(0===this.negative),this.iushrn(A,e,t)},n.prototype.shln=function(A){return this.clone().ishln(A)},n.prototype.ushln=function(A){return this.clone().iushln(A)},n.prototype.shrn=function(A){return this.clone().ishrn(A)},n.prototype.ushrn=function(A){return this.clone().iushrn(A)},n.prototype.testn=function(A){i("number"==typeof A&&A>=0);var e=A%26,t=(A-e)/26,r=1<=0);var e=A%26,t=(A-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==e&&t++,this.length=Math.min(t,this.length),0!==e){var r=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(A){if(i("number"==typeof A),i(A<67108864),A<0)return this.iaddn(-A);if(0!==this.negative)return this.negative=0,this.iaddn(A),this.negative=1,this;if(this.words[0]-=A,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(s/67108864|0),this.words[r+t]=67108863&n}for(;r>26,this.words[r+t]=67108863&n;if(0===a)return this.strip();for(i(-1===a),a=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},n.prototype._wordDiv=function(A,e){var t=(this.length,A.length),i=this.clone(),r=A,o=0|r.words[r.length-1];0!==(t=26-this._countBits(o))&&(r=r.ushln(t),i.iushln(t),o=0|r.words[r.length-1]);var a,s=i.length-r.length;if("mod"!==e){(a=new n(null)).length=s+1,a.words=new Array(a.length);for(var c=0;c=0;f--){var u=67108864*(0|i.words[r.length+f])+(0|i.words[r.length+f-1]);for(u=Math.min(u/o|0,67108863),i._ishlnsubmul(r,u,f);0!==i.negative;)u--,i.negative=0,i._ishlnsubmul(r,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=u)}return a&&a.strip(),i.strip(),"div"!==e&&0!==t&&i.iushrn(t),{div:a||null,mod:i}},n.prototype.divmod=function(A,e,t){return i(!A.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===A.negative?(a=this.neg().divmod(A,e),"mod"!==e&&(r=a.div.neg()),"div"!==e&&(o=a.mod.neg(),t&&0!==o.negative&&o.iadd(A)),{div:r,mod:o}):0===this.negative&&0!==A.negative?(a=this.divmod(A.neg(),e),"mod"!==e&&(r=a.div.neg()),{div:r,mod:a.mod}):0!=(this.negative&A.negative)?(a=this.neg().divmod(A.neg(),e),"div"!==e&&(o=a.mod.neg(),t&&0!==o.negative&&o.isub(A)),{div:a.div,mod:o}):A.length>this.length||this.cmp(A)<0?{div:new n(0),mod:this}:1===A.length?"div"===e?{div:this.divn(A.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modn(A.words[0]))}:{div:this.divn(A.words[0]),mod:new n(this.modn(A.words[0]))}:this._wordDiv(A,e);var r,o,a},n.prototype.div=function(A){return this.divmod(A,"div",!1).div},n.prototype.mod=function(A){return this.divmod(A,"mod",!1).mod},n.prototype.umod=function(A){return this.divmod(A,"mod",!0).mod},n.prototype.divRound=function(A){var e=this.divmod(A);if(e.mod.isZero())return e.div;var t=0!==e.div.negative?e.mod.isub(A):e.mod,i=A.ushrn(1),r=A.andln(1),n=t.cmp(i);return n<0||1===r&&0===n?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modn=function(A){i(A<=67108863);for(var e=(1<<26)%A,t=0,r=this.length-1;r>=0;r--)t=(e*t+(0|this.words[r]))%A;return t},n.prototype.idivn=function(A){i(A<=67108863);for(var e=0,t=this.length-1;t>=0;t--){var r=(0|this.words[t])+67108864*e;this.words[t]=r/A|0,e=r%A}return this.strip()},n.prototype.divn=function(A){return this.clone().idivn(A)},n.prototype.egcd=function(A){i(0===A.negative),i(!A.isZero());var e=this,t=A.clone();e=0!==e.negative?e.umod(A):e.clone();for(var r=new n(1),o=new n(0),a=new n(0),s=new n(1),c=0;e.isEven()&&t.isEven();)e.iushrn(1),t.iushrn(1),++c;for(var g=t.clone(),f=e.clone();!e.isZero();){for(var u=0,h=1;0==(e.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(e.iushrn(u);u-- >0;)(r.isOdd()||o.isOdd())&&(r.iadd(g),o.isub(f)),r.iushrn(1),o.iushrn(1);for(var d=0,B=1;0==(t.words[0]&B)&&d<26;++d,B<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(g),s.isub(f)),a.iushrn(1),s.iushrn(1);e.cmp(t)>=0?(e.isub(t),r.isub(a),o.isub(s)):(t.isub(e),a.isub(r),s.isub(o))}return{a:a,b:s,gcd:t.iushln(c)}},n.prototype._invmp=function(A){i(0===A.negative),i(!A.isZero());var e=this,t=A.clone();e=0!==e.negative?e.umod(A):e.clone();for(var r,o=new n(1),a=new n(0),s=t.clone();e.cmpn(1)>0&&t.cmpn(1)>0;){for(var c=0,g=1;0==(e.words[0]&g)&&c<26;++c,g<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var f=0,u=1;0==(t.words[0]&u)&&f<26;++f,u<<=1);if(f>0)for(t.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);e.cmp(t)>=0?(e.isub(t),o.isub(a)):(t.isub(e),a.isub(o))}return(r=0===e.cmpn(1)?o:a).cmpn(0)<0&&r.iadd(A),r},n.prototype.gcd=function(A){if(this.isZero())return A.abs();if(A.isZero())return this.abs();var e=this.clone(),t=A.clone();e.negative=0,t.negative=0;for(var i=0;e.isEven()&&t.isEven();i++)e.iushrn(1),t.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;t.isEven();)t.iushrn(1);var r=e.cmp(t);if(r<0){var n=e;e=t,t=n}else if(0===r||0===t.cmpn(1))break;e.isub(t)}return t.iushln(i)},n.prototype.invm=function(A){return this.egcd(A).a.umod(A)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(A){return this.words[0]&A},n.prototype.bincn=function(A){i("number"==typeof A);var e=A%26,t=(A-e)/26,r=1<>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(A){var e,t=A<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)e=1;else{t&&(A=-A),i(A<=67108863,"Number is too big");var r=0|this.words[0];e=r===A?0:rA.length)return 1;if(this.length=0;t--){var i=0|this.words[t],r=0|A.words[t];if(i!==r){ir&&(e=1);break}}return e},n.prototype.gtn=function(A){return 1===this.cmpn(A)},n.prototype.gt=function(A){return 1===this.cmp(A)},n.prototype.gten=function(A){return this.cmpn(A)>=0},n.prototype.gte=function(A){return this.cmp(A)>=0},n.prototype.ltn=function(A){return-1===this.cmpn(A)},n.prototype.lt=function(A){return-1===this.cmp(A)},n.prototype.lten=function(A){return this.cmpn(A)<=0},n.prototype.lte=function(A){return this.cmp(A)<=0},n.prototype.eqn=function(A){return 0===this.cmpn(A)},n.prototype.eq=function(A){return 0===this.cmp(A)},n.red=function(A){return new m(A)},n.prototype.toRed=function(A){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),A.convertTo(this)._forceRed(A)},n.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(A){return this.red=A,this},n.prototype.forceRed=function(A){return i(!this.red,"Already a number in reduction context"),this._forceRed(A)},n.prototype.redAdd=function(A){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,A)},n.prototype.redIAdd=function(A){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,A)},n.prototype.redSub=function(A){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,A)},n.prototype.redISub=function(A){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,A)},n.prototype.redShl=function(A){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,A)},n.prototype.redMul=function(A){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,A),this.red.mul(this,A)},n.prototype.redIMul=function(A){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,A),this.red.imul(this,A)},n.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(A){return i(this.red&&!A.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,A)};var I={k256:null,p224:null,p192:null,p25519:null};function E(A,e){this.name=A,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function C(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Q(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function p(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function m(A){if("string"==typeof A){var e=n._prime(A);this.m=e.p,this.prime=e}else i(A.gtn(1),"modulus must be greater than 1"),this.m=A,this.prime=null}function y(A){m.call(this,A),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var A=new n(null);return A.words=new Array(Math.ceil(this.n/13)),A},E.prototype.ireduce=function(A){var e,t=A;do{this.split(t,this.tmp),e=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},E.prototype.split=function(A,e){A.iushrn(this.n,0,e)},E.prototype.imulK=function(A){return A.imul(this.k)},r(C,E),C.prototype.split=function(A,e){for(var t=Math.min(A.length,9),i=0;i>>22,r=n}r>>>=22,A.words[i-10]=r,0===r&&A.length>10?A.length-=10:A.length-=9},C.prototype.imulK=function(A){A.words[A.length]=0,A.words[A.length+1]=0,A.length+=2;for(var e=0,t=0;t>>=26,A.words[t]=r,e=i}return 0!==e&&(A.words[A.length++]=e),A},n._prime=function(A){if(I[A])return I[A];var e;if("k256"===A)e=new C;else if("p224"===A)e=new Q;else if("p192"===A)e=new p;else{if("p25519"!==A)throw new Error("Unknown prime "+A);e=new w}return I[A]=e,e},m.prototype._verify1=function(A){i(0===A.negative,"red works only with positives"),i(A.red,"red works only with red numbers")},m.prototype._verify2=function(A,e){i(0==(A.negative|e.negative),"red works only with positives"),i(A.red&&A.red===e.red,"red works only with red numbers")},m.prototype.imod=function(A){return this.prime?this.prime.ireduce(A)._forceRed(this):A.umod(this.m)._forceRed(this)},m.prototype.neg=function(A){return A.isZero()?A.clone():this.m.sub(A)._forceRed(this)},m.prototype.add=function(A,e){this._verify2(A,e);var t=A.add(e);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},m.prototype.iadd=function(A,e){this._verify2(A,e);var t=A.iadd(e);return t.cmp(this.m)>=0&&t.isub(this.m),t},m.prototype.sub=function(A,e){this._verify2(A,e);var t=A.sub(e);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},m.prototype.isub=function(A,e){this._verify2(A,e);var t=A.isub(e);return t.cmpn(0)<0&&t.iadd(this.m),t},m.prototype.shl=function(A,e){return this._verify1(A),this.imod(A.ushln(e))},m.prototype.imul=function(A,e){return this._verify2(A,e),this.imod(A.imul(e))},m.prototype.mul=function(A,e){return this._verify2(A,e),this.imod(A.mul(e))},m.prototype.isqr=function(A){return this.imul(A,A.clone())},m.prototype.sqr=function(A){return this.mul(A,A)},m.prototype.sqrt=function(A){if(A.isZero())return A.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var t=this.m.add(new n(1)).iushrn(2);return this.pow(A,t)}for(var r=this.m.subn(1),o=0;!r.isZero()&&0===r.andln(1);)o++,r.iushrn(1);i(!r.isZero());var a=new n(1).toRed(this),s=a.redNeg(),c=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new n(2*g*g).toRed(this);0!==this.pow(g,c).cmp(s);)g.redIAdd(s);for(var f=this.pow(g,r),u=this.pow(A,r.addn(1).iushrn(1)),h=this.pow(A,r),d=o;0!==h.cmp(a);){for(var B=h,l=0;0!==B.cmp(a);l++)B=B.redSqr();i(l=0;i--){for(var c=e.words[i],g=s-1;g>=0;g--){var f=c>>g&1;r!==t[0]&&(r=this.sqr(r)),0!==f||0!==o?(o<<=1,o|=f,(4===++a||0===i&&0===g)&&(r=this.mul(r,t[o]),a=0,o=0)):a=0}s=26}return r},m.prototype.convertTo=function(A){var e=A.umod(this.m);return e===A?e.clone():e},m.prototype.convertFrom=function(A){var e=A.clone();return e.red=null,e},n.mont=function(A){return new y(A)},r(y,m),y.prototype.convertTo=function(A){return this.imod(A.ushln(this.shift))},y.prototype.convertFrom=function(A){var e=this.imod(A.mul(this.rinv));return e.red=null,e},y.prototype.imul=function(A,e){if(A.isZero()||e.isZero())return A.words[0]=0,A.length=1,A;var t=A.imul(e),i=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=t.isub(i).iushrn(this.shift),n=r;return r.cmp(this.m)>=0?n=r.isub(this.m):r.cmpn(0)<0&&(n=r.iadd(this.m)),n._forceRed(this)},y.prototype.mul=function(A,e){if(A.isZero()||e.isZero())return new n(0)._forceRed(this);var t=A.mul(e),i=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=t.isub(i).iushrn(this.shift),o=r;return r.cmp(this.m)>=0?o=r.isub(this.m):r.cmpn(0)<0&&(o=r.iadd(this.m)),o._forceRed(this)},y.prototype.invm=function(A){return this.imod(A._invmp(this.m).mul(this.r2))._forceRed(this)}}(A,this)}).call(this,t(45)(A))},function(A,e,t){"use strict";var i=t(0);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(A,e=256,t=null,i=!1){const a=Math.ceil(e/8);return(0,o.isReady)()&&!i?(0,o.blake2b)((0,n.u8aToU8a)(A),(0,n.u8aToU8a)(t),a):r.default.blake2b((0,n.u8aToU8a)(A),t,a)};var r=i(t(317)),n=t(10),o=t(35)},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(1091);var i=t(196);Object.keys(i).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===i[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return i[A]}}))}));var r=t(156);Object.keys(r).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===r[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return r[A]}}))}));var n=t(552);Object.keys(n).forEach((function(A){"default"!==A&&"__esModule"!==A&&(A in e&&e[A]===n[A]||Object.defineProperty(e,A,{enumerable:!0,get:function(){return n[A]}}))}))},function(A,e,t){"use strict";t.d(e,"a",(function(){return n}));var i=t(104),r=t(265);function n(){for(var A=[],e=0;e=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function s(A,e,t){var i=a(A,t);return t-1>=e&&(i|=a(A,t-1)<<4),i}function c(A,e,t,i){for(var r=0,n=Math.min(A.length,t),o=e;o=49?a-49+10:a>=17?a-17+10:a}return r}n.isBN=function(A){return A instanceof n||null!==A&&"object"==typeof A&&A.constructor.wordSize===n.wordSize&&Array.isArray(A.words)},n.max=function(A,e){return A.cmp(e)>0?A:e},n.min=function(A,e){return A.cmp(e)<0?A:e},n.prototype._init=function(A,e,t){if("number"==typeof A)return this._initNumber(A,e,t);if("object"==typeof A)return this._initArray(A,e,t);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var r=0;"-"===(A=A.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)o=A[r]|A[r-1]<<8|A[r-2]<<16,this.words[n]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===t)for(r=0,n=0;r>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this.strip()},n.prototype._parseHex=function(A,e,t){this.length=Math.ceil((A.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)r=s(A,e,i)<=18?(n-=18,o+=1,this.words[o]|=r>>>26):n+=8;else for(i=(A.length-e)%2==0?e+1:e;i=18?(n-=18,o+=1,this.words[o]|=r>>>26):n+=8;this.strip()},n.prototype._parseBase=function(A,e,t){this.words=[0],this.length=1;for(var i=0,r=1;r<=67108863;r*=e)i++;i--,r=r/e|0;for(var n=A.length-t,o=n%i,a=Math.min(n,n-o)+t,s=0,g=t;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var g=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(A,e,t){t.negative=e.negative^A.negative;var i=A.length+e.length|0;t.length=i,i=i-1|0;var r=0|A.words[0],n=0|e.words[0],o=r*n,a=67108863&o,s=o/67108864|0;t.words[0]=a;for(var c=1;c>>26,f=67108863&s,u=Math.min(c,e.length-1),h=Math.max(0,c-A.length+1);h<=u;h++){var d=c-h|0;g+=(o=(r=0|A.words[d])*(n=0|e.words[h])+f)/67108864|0,f=67108863&o}t.words[c]=0|f,s=0|g}return 0!==s?t.words[c]=0|s:t.length--,t.strip()}n.prototype.toString=function(A,e){var t;if(e=0|e||1,16===(A=A||10)||"hex"===A){t="";for(var r=0,n=0,o=0;o>>24-r&16777215)||o!==this.length-1?g[6-s.length]+s+t:s+t,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(t=n.toString(16)+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(A===(0|A)&&A>=2&&A<=36){var c=f[A],h=u[A];t="";var d=this.clone();for(d.negative=0;!d.isZero();){var B=d.modn(h).toString(A);t=(d=d.idivn(h)).isZero()?B+t:g[c-B.length]+B+t}for(this.isZero()&&(t="0"+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}i(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var A=this.words[0];return 2===this.length?A+=67108864*this.words[1]:3===this.length&&1===this.words[2]?A+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-A:A},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(A,e){return i(void 0!==o),this.toArrayLike(o,A,e)},n.prototype.toArray=function(A,e){return this.toArrayLike(Array,A,e)},n.prototype.toArrayLike=function(A,e,t){var r=this.byteLength(),n=t||Math.max(1,r);i(r<=n,"byte array longer than desired length"),i(n>0,"Requested array length <= 0"),this.strip();var o,a,s="le"===e,c=new A(n),g=this.clone();if(s){for(a=0;!g.isZero();a++)o=g.andln(255),g.iushrn(8),c[a]=o;for(;a=4096&&(t+=13,e>>>=13),e>=64&&(t+=7,e>>>=7),e>=8&&(t+=4,e>>>=4),e>=2&&(t+=2,e>>>=2),t+e},n.prototype._zeroBits=function(A){if(0===A)return 26;var e=A,t=0;return 0==(8191&e)&&(t+=13,e>>>=13),0==(127&e)&&(t+=7,e>>>=7),0==(15&e)&&(t+=4,e>>>=4),0==(3&e)&&(t+=2,e>>>=2),0==(1&e)&&t++,t},n.prototype.bitLength=function(){var A=this.words[this.length-1],e=this._countBits(A);return 26*(this.length-1)+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var A=0,e=0;eA.length?this.clone().ior(A):A.clone().ior(this)},n.prototype.uor=function(A){return this.length>A.length?this.clone().iuor(A):A.clone().iuor(this)},n.prototype.iuand=function(A){var e;e=this.length>A.length?A:this;for(var t=0;tA.length?this.clone().iand(A):A.clone().iand(this)},n.prototype.uand=function(A){return this.length>A.length?this.clone().iuand(A):A.clone().iuand(this)},n.prototype.iuxor=function(A){var e,t;this.length>A.length?(e=this,t=A):(e=A,t=this);for(var i=0;iA.length?this.clone().ixor(A):A.clone().ixor(this)},n.prototype.uxor=function(A){return this.length>A.length?this.clone().iuxor(A):A.clone().iuxor(this)},n.prototype.inotn=function(A){i("number"==typeof A&&A>=0);var e=0|Math.ceil(A/26),t=A%26;this._expand(e),t>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-t),this.strip()},n.prototype.notn=function(A){return this.clone().inotn(A)},n.prototype.setn=function(A,e){i("number"==typeof A&&A>=0);var t=A/26|0,r=A%26;return this._expand(t+1),this.words[t]=e?this.words[t]|1<A.length?(t=this,i=A):(t=A,i=this);for(var r=0,n=0;n>>26;for(;0!==r&&n>>26;if(this.length=t.length,0!==r)this.words[this.length]=r,this.length++;else if(t!==this)for(;nA.length?this.clone().iadd(A):A.clone().iadd(this)},n.prototype.isub=function(A){if(0!==A.negative){A.negative=0;var e=this.iadd(A);return A.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(A),this.negative=1,this._normSign();var t,i,r=this.cmp(A);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(t=this,i=A):(t=A,i=this);for(var n=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==n&&o>26,this.words[o]=67108863&e;if(0===n&&o>>13,h=0|o[1],d=8191&h,B=h>>>13,l=0|o[2],I=8191&l,E=l>>>13,C=0|o[3],Q=8191&C,p=C>>>13,w=0|o[4],m=8191&w,y=w>>>13,M=0|o[5],b=8191&M,D=M>>>13,v=0|o[6],S=8191&v,k=v>>>13,G=0|o[7],N=8191&G,F=G>>>13,O=0|o[8],R=8191&O,U=O>>>13,Y=0|o[9],x=8191&Y,H=Y>>>13,L=0|a[0],K=8191&L,J=L>>>13,P=0|a[1],j=8191&P,_=P>>>13,q=0|a[2],T=8191&q,Z=q>>>13,V=0|a[3],W=8191&V,z=V>>>13,X=0|a[4],$=8191&X,AA=X>>>13,eA=0|a[5],tA=8191&eA,iA=eA>>>13,rA=0|a[6],nA=8191&rA,oA=rA>>>13,aA=0|a[7],sA=8191&aA,cA=aA>>>13,gA=0|a[8],fA=8191&gA,uA=gA>>>13,hA=0|a[9],dA=8191&hA,BA=hA>>>13;t.negative=A.negative^e.negative,t.length=19;var lA=(c+(i=Math.imul(f,K))|0)+((8191&(r=(r=Math.imul(f,J))+Math.imul(u,K)|0))<<13)|0;c=((n=Math.imul(u,J))+(r>>>13)|0)+(lA>>>26)|0,lA&=67108863,i=Math.imul(d,K),r=(r=Math.imul(d,J))+Math.imul(B,K)|0,n=Math.imul(B,J);var IA=(c+(i=i+Math.imul(f,j)|0)|0)+((8191&(r=(r=r+Math.imul(f,_)|0)+Math.imul(u,j)|0))<<13)|0;c=((n=n+Math.imul(u,_)|0)+(r>>>13)|0)+(IA>>>26)|0,IA&=67108863,i=Math.imul(I,K),r=(r=Math.imul(I,J))+Math.imul(E,K)|0,n=Math.imul(E,J),i=i+Math.imul(d,j)|0,r=(r=r+Math.imul(d,_)|0)+Math.imul(B,j)|0,n=n+Math.imul(B,_)|0;var EA=(c+(i=i+Math.imul(f,T)|0)|0)+((8191&(r=(r=r+Math.imul(f,Z)|0)+Math.imul(u,T)|0))<<13)|0;c=((n=n+Math.imul(u,Z)|0)+(r>>>13)|0)+(EA>>>26)|0,EA&=67108863,i=Math.imul(Q,K),r=(r=Math.imul(Q,J))+Math.imul(p,K)|0,n=Math.imul(p,J),i=i+Math.imul(I,j)|0,r=(r=r+Math.imul(I,_)|0)+Math.imul(E,j)|0,n=n+Math.imul(E,_)|0,i=i+Math.imul(d,T)|0,r=(r=r+Math.imul(d,Z)|0)+Math.imul(B,T)|0,n=n+Math.imul(B,Z)|0;var CA=(c+(i=i+Math.imul(f,W)|0)|0)+((8191&(r=(r=r+Math.imul(f,z)|0)+Math.imul(u,W)|0))<<13)|0;c=((n=n+Math.imul(u,z)|0)+(r>>>13)|0)+(CA>>>26)|0,CA&=67108863,i=Math.imul(m,K),r=(r=Math.imul(m,J))+Math.imul(y,K)|0,n=Math.imul(y,J),i=i+Math.imul(Q,j)|0,r=(r=r+Math.imul(Q,_)|0)+Math.imul(p,j)|0,n=n+Math.imul(p,_)|0,i=i+Math.imul(I,T)|0,r=(r=r+Math.imul(I,Z)|0)+Math.imul(E,T)|0,n=n+Math.imul(E,Z)|0,i=i+Math.imul(d,W)|0,r=(r=r+Math.imul(d,z)|0)+Math.imul(B,W)|0,n=n+Math.imul(B,z)|0;var QA=(c+(i=i+Math.imul(f,$)|0)|0)+((8191&(r=(r=r+Math.imul(f,AA)|0)+Math.imul(u,$)|0))<<13)|0;c=((n=n+Math.imul(u,AA)|0)+(r>>>13)|0)+(QA>>>26)|0,QA&=67108863,i=Math.imul(b,K),r=(r=Math.imul(b,J))+Math.imul(D,K)|0,n=Math.imul(D,J),i=i+Math.imul(m,j)|0,r=(r=r+Math.imul(m,_)|0)+Math.imul(y,j)|0,n=n+Math.imul(y,_)|0,i=i+Math.imul(Q,T)|0,r=(r=r+Math.imul(Q,Z)|0)+Math.imul(p,T)|0,n=n+Math.imul(p,Z)|0,i=i+Math.imul(I,W)|0,r=(r=r+Math.imul(I,z)|0)+Math.imul(E,W)|0,n=n+Math.imul(E,z)|0,i=i+Math.imul(d,$)|0,r=(r=r+Math.imul(d,AA)|0)+Math.imul(B,$)|0,n=n+Math.imul(B,AA)|0;var pA=(c+(i=i+Math.imul(f,tA)|0)|0)+((8191&(r=(r=r+Math.imul(f,iA)|0)+Math.imul(u,tA)|0))<<13)|0;c=((n=n+Math.imul(u,iA)|0)+(r>>>13)|0)+(pA>>>26)|0,pA&=67108863,i=Math.imul(S,K),r=(r=Math.imul(S,J))+Math.imul(k,K)|0,n=Math.imul(k,J),i=i+Math.imul(b,j)|0,r=(r=r+Math.imul(b,_)|0)+Math.imul(D,j)|0,n=n+Math.imul(D,_)|0,i=i+Math.imul(m,T)|0,r=(r=r+Math.imul(m,Z)|0)+Math.imul(y,T)|0,n=n+Math.imul(y,Z)|0,i=i+Math.imul(Q,W)|0,r=(r=r+Math.imul(Q,z)|0)+Math.imul(p,W)|0,n=n+Math.imul(p,z)|0,i=i+Math.imul(I,$)|0,r=(r=r+Math.imul(I,AA)|0)+Math.imul(E,$)|0,n=n+Math.imul(E,AA)|0,i=i+Math.imul(d,tA)|0,r=(r=r+Math.imul(d,iA)|0)+Math.imul(B,tA)|0,n=n+Math.imul(B,iA)|0;var wA=(c+(i=i+Math.imul(f,nA)|0)|0)+((8191&(r=(r=r+Math.imul(f,oA)|0)+Math.imul(u,nA)|0))<<13)|0;c=((n=n+Math.imul(u,oA)|0)+(r>>>13)|0)+(wA>>>26)|0,wA&=67108863,i=Math.imul(N,K),r=(r=Math.imul(N,J))+Math.imul(F,K)|0,n=Math.imul(F,J),i=i+Math.imul(S,j)|0,r=(r=r+Math.imul(S,_)|0)+Math.imul(k,j)|0,n=n+Math.imul(k,_)|0,i=i+Math.imul(b,T)|0,r=(r=r+Math.imul(b,Z)|0)+Math.imul(D,T)|0,n=n+Math.imul(D,Z)|0,i=i+Math.imul(m,W)|0,r=(r=r+Math.imul(m,z)|0)+Math.imul(y,W)|0,n=n+Math.imul(y,z)|0,i=i+Math.imul(Q,$)|0,r=(r=r+Math.imul(Q,AA)|0)+Math.imul(p,$)|0,n=n+Math.imul(p,AA)|0,i=i+Math.imul(I,tA)|0,r=(r=r+Math.imul(I,iA)|0)+Math.imul(E,tA)|0,n=n+Math.imul(E,iA)|0,i=i+Math.imul(d,nA)|0,r=(r=r+Math.imul(d,oA)|0)+Math.imul(B,nA)|0,n=n+Math.imul(B,oA)|0;var mA=(c+(i=i+Math.imul(f,sA)|0)|0)+((8191&(r=(r=r+Math.imul(f,cA)|0)+Math.imul(u,sA)|0))<<13)|0;c=((n=n+Math.imul(u,cA)|0)+(r>>>13)|0)+(mA>>>26)|0,mA&=67108863,i=Math.imul(R,K),r=(r=Math.imul(R,J))+Math.imul(U,K)|0,n=Math.imul(U,J),i=i+Math.imul(N,j)|0,r=(r=r+Math.imul(N,_)|0)+Math.imul(F,j)|0,n=n+Math.imul(F,_)|0,i=i+Math.imul(S,T)|0,r=(r=r+Math.imul(S,Z)|0)+Math.imul(k,T)|0,n=n+Math.imul(k,Z)|0,i=i+Math.imul(b,W)|0,r=(r=r+Math.imul(b,z)|0)+Math.imul(D,W)|0,n=n+Math.imul(D,z)|0,i=i+Math.imul(m,$)|0,r=(r=r+Math.imul(m,AA)|0)+Math.imul(y,$)|0,n=n+Math.imul(y,AA)|0,i=i+Math.imul(Q,tA)|0,r=(r=r+Math.imul(Q,iA)|0)+Math.imul(p,tA)|0,n=n+Math.imul(p,iA)|0,i=i+Math.imul(I,nA)|0,r=(r=r+Math.imul(I,oA)|0)+Math.imul(E,nA)|0,n=n+Math.imul(E,oA)|0,i=i+Math.imul(d,sA)|0,r=(r=r+Math.imul(d,cA)|0)+Math.imul(B,sA)|0,n=n+Math.imul(B,cA)|0;var yA=(c+(i=i+Math.imul(f,fA)|0)|0)+((8191&(r=(r=r+Math.imul(f,uA)|0)+Math.imul(u,fA)|0))<<13)|0;c=((n=n+Math.imul(u,uA)|0)+(r>>>13)|0)+(yA>>>26)|0,yA&=67108863,i=Math.imul(x,K),r=(r=Math.imul(x,J))+Math.imul(H,K)|0,n=Math.imul(H,J),i=i+Math.imul(R,j)|0,r=(r=r+Math.imul(R,_)|0)+Math.imul(U,j)|0,n=n+Math.imul(U,_)|0,i=i+Math.imul(N,T)|0,r=(r=r+Math.imul(N,Z)|0)+Math.imul(F,T)|0,n=n+Math.imul(F,Z)|0,i=i+Math.imul(S,W)|0,r=(r=r+Math.imul(S,z)|0)+Math.imul(k,W)|0,n=n+Math.imul(k,z)|0,i=i+Math.imul(b,$)|0,r=(r=r+Math.imul(b,AA)|0)+Math.imul(D,$)|0,n=n+Math.imul(D,AA)|0,i=i+Math.imul(m,tA)|0,r=(r=r+Math.imul(m,iA)|0)+Math.imul(y,tA)|0,n=n+Math.imul(y,iA)|0,i=i+Math.imul(Q,nA)|0,r=(r=r+Math.imul(Q,oA)|0)+Math.imul(p,nA)|0,n=n+Math.imul(p,oA)|0,i=i+Math.imul(I,sA)|0,r=(r=r+Math.imul(I,cA)|0)+Math.imul(E,sA)|0,n=n+Math.imul(E,cA)|0,i=i+Math.imul(d,fA)|0,r=(r=r+Math.imul(d,uA)|0)+Math.imul(B,fA)|0,n=n+Math.imul(B,uA)|0;var MA=(c+(i=i+Math.imul(f,dA)|0)|0)+((8191&(r=(r=r+Math.imul(f,BA)|0)+Math.imul(u,dA)|0))<<13)|0;c=((n=n+Math.imul(u,BA)|0)+(r>>>13)|0)+(MA>>>26)|0,MA&=67108863,i=Math.imul(x,j),r=(r=Math.imul(x,_))+Math.imul(H,j)|0,n=Math.imul(H,_),i=i+Math.imul(R,T)|0,r=(r=r+Math.imul(R,Z)|0)+Math.imul(U,T)|0,n=n+Math.imul(U,Z)|0,i=i+Math.imul(N,W)|0,r=(r=r+Math.imul(N,z)|0)+Math.imul(F,W)|0,n=n+Math.imul(F,z)|0,i=i+Math.imul(S,$)|0,r=(r=r+Math.imul(S,AA)|0)+Math.imul(k,$)|0,n=n+Math.imul(k,AA)|0,i=i+Math.imul(b,tA)|0,r=(r=r+Math.imul(b,iA)|0)+Math.imul(D,tA)|0,n=n+Math.imul(D,iA)|0,i=i+Math.imul(m,nA)|0,r=(r=r+Math.imul(m,oA)|0)+Math.imul(y,nA)|0,n=n+Math.imul(y,oA)|0,i=i+Math.imul(Q,sA)|0,r=(r=r+Math.imul(Q,cA)|0)+Math.imul(p,sA)|0,n=n+Math.imul(p,cA)|0,i=i+Math.imul(I,fA)|0,r=(r=r+Math.imul(I,uA)|0)+Math.imul(E,fA)|0,n=n+Math.imul(E,uA)|0;var bA=(c+(i=i+Math.imul(d,dA)|0)|0)+((8191&(r=(r=r+Math.imul(d,BA)|0)+Math.imul(B,dA)|0))<<13)|0;c=((n=n+Math.imul(B,BA)|0)+(r>>>13)|0)+(bA>>>26)|0,bA&=67108863,i=Math.imul(x,T),r=(r=Math.imul(x,Z))+Math.imul(H,T)|0,n=Math.imul(H,Z),i=i+Math.imul(R,W)|0,r=(r=r+Math.imul(R,z)|0)+Math.imul(U,W)|0,n=n+Math.imul(U,z)|0,i=i+Math.imul(N,$)|0,r=(r=r+Math.imul(N,AA)|0)+Math.imul(F,$)|0,n=n+Math.imul(F,AA)|0,i=i+Math.imul(S,tA)|0,r=(r=r+Math.imul(S,iA)|0)+Math.imul(k,tA)|0,n=n+Math.imul(k,iA)|0,i=i+Math.imul(b,nA)|0,r=(r=r+Math.imul(b,oA)|0)+Math.imul(D,nA)|0,n=n+Math.imul(D,oA)|0,i=i+Math.imul(m,sA)|0,r=(r=r+Math.imul(m,cA)|0)+Math.imul(y,sA)|0,n=n+Math.imul(y,cA)|0,i=i+Math.imul(Q,fA)|0,r=(r=r+Math.imul(Q,uA)|0)+Math.imul(p,fA)|0,n=n+Math.imul(p,uA)|0;var DA=(c+(i=i+Math.imul(I,dA)|0)|0)+((8191&(r=(r=r+Math.imul(I,BA)|0)+Math.imul(E,dA)|0))<<13)|0;c=((n=n+Math.imul(E,BA)|0)+(r>>>13)|0)+(DA>>>26)|0,DA&=67108863,i=Math.imul(x,W),r=(r=Math.imul(x,z))+Math.imul(H,W)|0,n=Math.imul(H,z),i=i+Math.imul(R,$)|0,r=(r=r+Math.imul(R,AA)|0)+Math.imul(U,$)|0,n=n+Math.imul(U,AA)|0,i=i+Math.imul(N,tA)|0,r=(r=r+Math.imul(N,iA)|0)+Math.imul(F,tA)|0,n=n+Math.imul(F,iA)|0,i=i+Math.imul(S,nA)|0,r=(r=r+Math.imul(S,oA)|0)+Math.imul(k,nA)|0,n=n+Math.imul(k,oA)|0,i=i+Math.imul(b,sA)|0,r=(r=r+Math.imul(b,cA)|0)+Math.imul(D,sA)|0,n=n+Math.imul(D,cA)|0,i=i+Math.imul(m,fA)|0,r=(r=r+Math.imul(m,uA)|0)+Math.imul(y,fA)|0,n=n+Math.imul(y,uA)|0;var vA=(c+(i=i+Math.imul(Q,dA)|0)|0)+((8191&(r=(r=r+Math.imul(Q,BA)|0)+Math.imul(p,dA)|0))<<13)|0;c=((n=n+Math.imul(p,BA)|0)+(r>>>13)|0)+(vA>>>26)|0,vA&=67108863,i=Math.imul(x,$),r=(r=Math.imul(x,AA))+Math.imul(H,$)|0,n=Math.imul(H,AA),i=i+Math.imul(R,tA)|0,r=(r=r+Math.imul(R,iA)|0)+Math.imul(U,tA)|0,n=n+Math.imul(U,iA)|0,i=i+Math.imul(N,nA)|0,r=(r=r+Math.imul(N,oA)|0)+Math.imul(F,nA)|0,n=n+Math.imul(F,oA)|0,i=i+Math.imul(S,sA)|0,r=(r=r+Math.imul(S,cA)|0)+Math.imul(k,sA)|0,n=n+Math.imul(k,cA)|0,i=i+Math.imul(b,fA)|0,r=(r=r+Math.imul(b,uA)|0)+Math.imul(D,fA)|0,n=n+Math.imul(D,uA)|0;var SA=(c+(i=i+Math.imul(m,dA)|0)|0)+((8191&(r=(r=r+Math.imul(m,BA)|0)+Math.imul(y,dA)|0))<<13)|0;c=((n=n+Math.imul(y,BA)|0)+(r>>>13)|0)+(SA>>>26)|0,SA&=67108863,i=Math.imul(x,tA),r=(r=Math.imul(x,iA))+Math.imul(H,tA)|0,n=Math.imul(H,iA),i=i+Math.imul(R,nA)|0,r=(r=r+Math.imul(R,oA)|0)+Math.imul(U,nA)|0,n=n+Math.imul(U,oA)|0,i=i+Math.imul(N,sA)|0,r=(r=r+Math.imul(N,cA)|0)+Math.imul(F,sA)|0,n=n+Math.imul(F,cA)|0,i=i+Math.imul(S,fA)|0,r=(r=r+Math.imul(S,uA)|0)+Math.imul(k,fA)|0,n=n+Math.imul(k,uA)|0;var kA=(c+(i=i+Math.imul(b,dA)|0)|0)+((8191&(r=(r=r+Math.imul(b,BA)|0)+Math.imul(D,dA)|0))<<13)|0;c=((n=n+Math.imul(D,BA)|0)+(r>>>13)|0)+(kA>>>26)|0,kA&=67108863,i=Math.imul(x,nA),r=(r=Math.imul(x,oA))+Math.imul(H,nA)|0,n=Math.imul(H,oA),i=i+Math.imul(R,sA)|0,r=(r=r+Math.imul(R,cA)|0)+Math.imul(U,sA)|0,n=n+Math.imul(U,cA)|0,i=i+Math.imul(N,fA)|0,r=(r=r+Math.imul(N,uA)|0)+Math.imul(F,fA)|0,n=n+Math.imul(F,uA)|0;var GA=(c+(i=i+Math.imul(S,dA)|0)|0)+((8191&(r=(r=r+Math.imul(S,BA)|0)+Math.imul(k,dA)|0))<<13)|0;c=((n=n+Math.imul(k,BA)|0)+(r>>>13)|0)+(GA>>>26)|0,GA&=67108863,i=Math.imul(x,sA),r=(r=Math.imul(x,cA))+Math.imul(H,sA)|0,n=Math.imul(H,cA),i=i+Math.imul(R,fA)|0,r=(r=r+Math.imul(R,uA)|0)+Math.imul(U,fA)|0,n=n+Math.imul(U,uA)|0;var NA=(c+(i=i+Math.imul(N,dA)|0)|0)+((8191&(r=(r=r+Math.imul(N,BA)|0)+Math.imul(F,dA)|0))<<13)|0;c=((n=n+Math.imul(F,BA)|0)+(r>>>13)|0)+(NA>>>26)|0,NA&=67108863,i=Math.imul(x,fA),r=(r=Math.imul(x,uA))+Math.imul(H,fA)|0,n=Math.imul(H,uA);var FA=(c+(i=i+Math.imul(R,dA)|0)|0)+((8191&(r=(r=r+Math.imul(R,BA)|0)+Math.imul(U,dA)|0))<<13)|0;c=((n=n+Math.imul(U,BA)|0)+(r>>>13)|0)+(FA>>>26)|0,FA&=67108863;var OA=(c+(i=Math.imul(x,dA))|0)+((8191&(r=(r=Math.imul(x,BA))+Math.imul(H,dA)|0))<<13)|0;return c=((n=Math.imul(H,BA))+(r>>>13)|0)+(OA>>>26)|0,OA&=67108863,s[0]=lA,s[1]=IA,s[2]=EA,s[3]=CA,s[4]=QA,s[5]=pA,s[6]=wA,s[7]=mA,s[8]=yA,s[9]=MA,s[10]=bA,s[11]=DA,s[12]=vA,s[13]=SA,s[14]=kA,s[15]=GA,s[16]=NA,s[17]=FA,s[18]=OA,0!==c&&(s[19]=c,t.length++),t};function B(A,e,t){return(new l).mulp(A,e,t)}function l(A,e){this.x=A,this.y=e}Math.imul||(d=h),n.prototype.mulTo=function(A,e){var t=this.length+A.length;return 10===this.length&&10===A.length?d(this,A,e):t<63?h(this,A,e):t<1024?function(A,e,t){t.negative=e.negative^A.negative,t.length=A.length+e.length;for(var i=0,r=0,n=0;n>>26)|0)>>>26,o&=67108863}t.words[n]=a,i=o,o=r}return 0!==i?t.words[n]=i:t.length--,t.strip()}(this,A,e):B(this,A,e)},l.prototype.makeRBT=function(A){for(var e=new Array(A),t=n.prototype._countBits(A)-1,i=0;i>=1;return i},l.prototype.permute=function(A,e,t,i,r,n){for(var o=0;o>>=1)r++;return 1<>>=13,t[2*o+1]=8191&n,n>>>=13;for(o=2*e;o>=26,e+=r/67108864|0,e+=n>>>26,this.words[t]=67108863&n}return 0!==e&&(this.words[t]=e,this.length++),this},n.prototype.muln=function(A){return this.clone().imuln(A)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(A){var e=function(A){for(var e=new Array(A.bitLength()),t=0;t>>r}return e}(A);if(0===e.length)return new n(1);for(var t=this,i=0;i=0);var e,t=A%26,r=(A-t)/26,n=67108863>>>26-t<<26-t;if(0!==t){var o=0;for(e=0;e>>26-t}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e=0),r=e?(e-e%26)/26:0;var n=A%26,o=Math.min((A-n)/26,this.length),a=67108863^67108863>>>n<o)for(this.length-=o,c=0;c=0&&(0!==g||c>=r);c--){var f=0|this.words[c];this.words[c]=g<<26-n|f>>>n,g=f&a}return s&&0!==g&&(s.words[s.length++]=g),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(A,e,t){return i(0===this.negative),this.iushrn(A,e,t)},n.prototype.shln=function(A){return this.clone().ishln(A)},n.prototype.ushln=function(A){return this.clone().iushln(A)},n.prototype.shrn=function(A){return this.clone().ishrn(A)},n.prototype.ushrn=function(A){return this.clone().iushrn(A)},n.prototype.testn=function(A){i("number"==typeof A&&A>=0);var e=A%26,t=(A-e)/26,r=1<=0);var e=A%26,t=(A-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==e&&t++,this.length=Math.min(t,this.length),0!==e){var r=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(A){if(i("number"==typeof A),i(A<67108864),A<0)return this.iaddn(-A);if(0!==this.negative)return this.negative=0,this.iaddn(A),this.negative=1,this;if(this.words[0]-=A,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(s/67108864|0),this.words[r+t]=67108863&n}for(;r>26,this.words[r+t]=67108863&n;if(0===a)return this.strip();for(i(-1===a),a=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},n.prototype._wordDiv=function(A,e){var t=(this.length,A.length),i=this.clone(),r=A,o=0|r.words[r.length-1];0!==(t=26-this._countBits(o))&&(r=r.ushln(t),i.iushln(t),o=0|r.words[r.length-1]);var a,s=i.length-r.length;if("mod"!==e){(a=new n(null)).length=s+1,a.words=new Array(a.length);for(var c=0;c=0;f--){var u=67108864*(0|i.words[r.length+f])+(0|i.words[r.length+f-1]);for(u=Math.min(u/o|0,67108863),i._ishlnsubmul(r,u,f);0!==i.negative;)u--,i.negative=0,i._ishlnsubmul(r,1,f),i.isZero()||(i.negative^=1);a&&(a.words[f]=u)}return a&&a.strip(),i.strip(),"div"!==e&&0!==t&&i.iushrn(t),{div:a||null,mod:i}},n.prototype.divmod=function(A,e,t){return i(!A.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===A.negative?(a=this.neg().divmod(A,e),"mod"!==e&&(r=a.div.neg()),"div"!==e&&(o=a.mod.neg(),t&&0!==o.negative&&o.iadd(A)),{div:r,mod:o}):0===this.negative&&0!==A.negative?(a=this.divmod(A.neg(),e),"mod"!==e&&(r=a.div.neg()),{div:r,mod:a.mod}):0!=(this.negative&A.negative)?(a=this.neg().divmod(A.neg(),e),"div"!==e&&(o=a.mod.neg(),t&&0!==o.negative&&o.isub(A)),{div:a.div,mod:o}):A.length>this.length||this.cmp(A)<0?{div:new n(0),mod:this}:1===A.length?"div"===e?{div:this.divn(A.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modn(A.words[0]))}:{div:this.divn(A.words[0]),mod:new n(this.modn(A.words[0]))}:this._wordDiv(A,e);var r,o,a},n.prototype.div=function(A){return this.divmod(A,"div",!1).div},n.prototype.mod=function(A){return this.divmod(A,"mod",!1).mod},n.prototype.umod=function(A){return this.divmod(A,"mod",!0).mod},n.prototype.divRound=function(A){var e=this.divmod(A);if(e.mod.isZero())return e.div;var t=0!==e.div.negative?e.mod.isub(A):e.mod,i=A.ushrn(1),r=A.andln(1),n=t.cmp(i);return n<0||1===r&&0===n?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modn=function(A){i(A<=67108863);for(var e=(1<<26)%A,t=0,r=this.length-1;r>=0;r--)t=(e*t+(0|this.words[r]))%A;return t},n.prototype.idivn=function(A){i(A<=67108863);for(var e=0,t=this.length-1;t>=0;t--){var r=(0|this.words[t])+67108864*e;this.words[t]=r/A|0,e=r%A}return this.strip()},n.prototype.divn=function(A){return this.clone().idivn(A)},n.prototype.egcd=function(A){i(0===A.negative),i(!A.isZero());var e=this,t=A.clone();e=0!==e.negative?e.umod(A):e.clone();for(var r=new n(1),o=new n(0),a=new n(0),s=new n(1),c=0;e.isEven()&&t.isEven();)e.iushrn(1),t.iushrn(1),++c;for(var g=t.clone(),f=e.clone();!e.isZero();){for(var u=0,h=1;0==(e.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(e.iushrn(u);u-- >0;)(r.isOdd()||o.isOdd())&&(r.iadd(g),o.isub(f)),r.iushrn(1),o.iushrn(1);for(var d=0,B=1;0==(t.words[0]&B)&&d<26;++d,B<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(g),s.isub(f)),a.iushrn(1),s.iushrn(1);e.cmp(t)>=0?(e.isub(t),r.isub(a),o.isub(s)):(t.isub(e),a.isub(r),s.isub(o))}return{a:a,b:s,gcd:t.iushln(c)}},n.prototype._invmp=function(A){i(0===A.negative),i(!A.isZero());var e=this,t=A.clone();e=0!==e.negative?e.umod(A):e.clone();for(var r,o=new n(1),a=new n(0),s=t.clone();e.cmpn(1)>0&&t.cmpn(1)>0;){for(var c=0,g=1;0==(e.words[0]&g)&&c<26;++c,g<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var f=0,u=1;0==(t.words[0]&u)&&f<26;++f,u<<=1);if(f>0)for(t.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);e.cmp(t)>=0?(e.isub(t),o.isub(a)):(t.isub(e),a.isub(o))}return(r=0===e.cmpn(1)?o:a).cmpn(0)<0&&r.iadd(A),r},n.prototype.gcd=function(A){if(this.isZero())return A.abs();if(A.isZero())return this.abs();var e=this.clone(),t=A.clone();e.negative=0,t.negative=0;for(var i=0;e.isEven()&&t.isEven();i++)e.iushrn(1),t.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;t.isEven();)t.iushrn(1);var r=e.cmp(t);if(r<0){var n=e;e=t,t=n}else if(0===r||0===t.cmpn(1))break;e.isub(t)}return t.iushln(i)},n.prototype.invm=function(A){return this.egcd(A).a.umod(A)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(A){return this.words[0]&A},n.prototype.bincn=function(A){i("number"==typeof A);var e=A%26,t=(A-e)/26,r=1<>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(A){var e,t=A<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)e=1;else{t&&(A=-A),i(A<=67108863,"Number is too big");var r=0|this.words[0];e=r===A?0:rA.length)return 1;if(this.length=0;t--){var i=0|this.words[t],r=0|A.words[t];if(i!==r){ir&&(e=1);break}}return e},n.prototype.gtn=function(A){return 1===this.cmpn(A)},n.prototype.gt=function(A){return 1===this.cmp(A)},n.prototype.gten=function(A){return this.cmpn(A)>=0},n.prototype.gte=function(A){return this.cmp(A)>=0},n.prototype.ltn=function(A){return-1===this.cmpn(A)},n.prototype.lt=function(A){return-1===this.cmp(A)},n.prototype.lten=function(A){return this.cmpn(A)<=0},n.prototype.lte=function(A){return this.cmp(A)<=0},n.prototype.eqn=function(A){return 0===this.cmpn(A)},n.prototype.eq=function(A){return 0===this.cmp(A)},n.red=function(A){return new m(A)},n.prototype.toRed=function(A){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),A.convertTo(this)._forceRed(A)},n.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(A){return this.red=A,this},n.prototype.forceRed=function(A){return i(!this.red,"Already a number in reduction context"),this._forceRed(A)},n.prototype.redAdd=function(A){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,A)},n.prototype.redIAdd=function(A){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,A)},n.prototype.redSub=function(A){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,A)},n.prototype.redISub=function(A){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,A)},n.prototype.redShl=function(A){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,A)},n.prototype.redMul=function(A){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,A),this.red.mul(this,A)},n.prototype.redIMul=function(A){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,A),this.red.imul(this,A)},n.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(A){return i(this.red&&!A.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,A)};var I={k256:null,p224:null,p192:null,p25519:null};function E(A,e){this.name=A,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function C(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function Q(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function p(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function m(A){if("string"==typeof A){var e=n._prime(A);this.m=e.p,this.prime=e}else i(A.gtn(1),"modulus must be greater than 1"),this.m=A,this.prime=null}function y(A){m.call(this,A),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var A=new n(null);return A.words=new Array(Math.ceil(this.n/13)),A},E.prototype.ireduce=function(A){var e,t=A;do{this.split(t,this.tmp),e=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?t.isub(this.p):void 0!==t.strip?t.strip():t._strip(),t},E.prototype.split=function(A,e){A.iushrn(this.n,0,e)},E.prototype.imulK=function(A){return A.imul(this.k)},r(C,E),C.prototype.split=function(A,e){for(var t=Math.min(A.length,9),i=0;i>>22,r=n}r>>>=22,A.words[i-10]=r,0===r&&A.length>10?A.length-=10:A.length-=9},C.prototype.imulK=function(A){A.words[A.length]=0,A.words[A.length+1]=0,A.length+=2;for(var e=0,t=0;t>>=26,A.words[t]=r,e=i}return 0!==e&&(A.words[A.length++]=e),A},n._prime=function(A){if(I[A])return I[A];var e;if("k256"===A)e=new C;else if("p224"===A)e=new Q;else if("p192"===A)e=new p;else{if("p25519"!==A)throw new Error("Unknown prime "+A);e=new w}return I[A]=e,e},m.prototype._verify1=function(A){i(0===A.negative,"red works only with positives"),i(A.red,"red works only with red numbers")},m.prototype._verify2=function(A,e){i(0==(A.negative|e.negative),"red works only with positives"),i(A.red&&A.red===e.red,"red works only with red numbers")},m.prototype.imod=function(A){return this.prime?this.prime.ireduce(A)._forceRed(this):A.umod(this.m)._forceRed(this)},m.prototype.neg=function(A){return A.isZero()?A.clone():this.m.sub(A)._forceRed(this)},m.prototype.add=function(A,e){this._verify2(A,e);var t=A.add(e);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},m.prototype.iadd=function(A,e){this._verify2(A,e);var t=A.iadd(e);return t.cmp(this.m)>=0&&t.isub(this.m),t},m.prototype.sub=function(A,e){this._verify2(A,e);var t=A.sub(e);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},m.prototype.isub=function(A,e){this._verify2(A,e);var t=A.isub(e);return t.cmpn(0)<0&&t.iadd(this.m),t},m.prototype.shl=function(A,e){return this._verify1(A),this.imod(A.ushln(e))},m.prototype.imul=function(A,e){return this._verify2(A,e),this.imod(A.imul(e))},m.prototype.mul=function(A,e){return this._verify2(A,e),this.imod(A.mul(e))},m.prototype.isqr=function(A){return this.imul(A,A.clone())},m.prototype.sqr=function(A){return this.mul(A,A)},m.prototype.sqrt=function(A){if(A.isZero())return A.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var t=this.m.add(new n(1)).iushrn(2);return this.pow(A,t)}for(var r=this.m.subn(1),o=0;!r.isZero()&&0===r.andln(1);)o++,r.iushrn(1);i(!r.isZero());var a=new n(1).toRed(this),s=a.redNeg(),c=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new n(2*g*g).toRed(this);0!==this.pow(g,c).cmp(s);)g.redIAdd(s);for(var f=this.pow(g,r),u=this.pow(A,r.addn(1).iushrn(1)),h=this.pow(A,r),d=o;0!==h.cmp(a);){for(var B=h,l=0;0!==B.cmp(a);l++)B=B.redSqr();i(l=0;i--){for(var c=e.words[i],g=s-1;g>=0;g--){var f=c>>g&1;r!==t[0]&&(r=this.sqr(r)),0!==f||0!==o?(o<<=1,o|=f,(4===++a||0===i&&0===g)&&(r=this.mul(r,t[o]),a=0,o=0)):a=0}s=26}return r},m.prototype.convertTo=function(A){var e=A.umod(this.m);return e===A?e.clone():e},m.prototype.convertFrom=function(A){var e=A.clone();return e.red=null,e},n.mont=function(A){return new y(A)},r(y,m),y.prototype.convertTo=function(A){return this.imod(A.ushln(this.shift))},y.prototype.convertFrom=function(A){var e=this.imod(A.mul(this.rinv));return e.red=null,e},y.prototype.imul=function(A,e){if(A.isZero()||e.isZero())return A.words[0]=0,A.length=1,A;var t=A.imul(e),i=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=t.isub(i).iushrn(this.shift),n=r;return r.cmp(this.m)>=0?n=r.isub(this.m):r.cmpn(0)<0&&(n=r.iadd(this.m)),n._forceRed(this)},y.prototype.mul=function(A,e){if(A.isZero()||e.isZero())return new n(0)._forceRed(this);var t=A.mul(e),i=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=t.isub(i).iushrn(this.shift),o=r;return r.cmp(this.m)>=0?o=r.isub(this.m):r.cmpn(0)<0&&(o=r.iadd(this.m)),o._forceRed(this)},y.prototype.invm=function(A){return this.imod(A._invmp(this.m).mul(this.r2))._forceRed(this)}}(A,this)}).call(this,t(45)(A))},function(A,e,t){var i=t(14).Buffer,r=t(1013).Transform,n=t(120).StringDecoder;function o(A){r.call(this),this.hashMode="string"==typeof A,this.hashMode?this[A]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}t(12)(o,r),o.prototype.update=function(A,e,t){"string"==typeof A&&(A=i.from(A,e));var r=this._update(A);return this.hashMode?this:(t&&(r=this._toString(r,t)),r)},o.prototype.setAutoPadding=function(){},o.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},o.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},o.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},o.prototype._transform=function(A,e,t){var i;try{this.hashMode?this._update(A):this.push(this._update(A))}catch(A){i=A}finally{t(i)}},o.prototype._flush=function(A){var e;try{this.push(this.__final())}catch(A){e=A}A(e)},o.prototype._finalOrDigest=function(A){var e=this.__final()||i.alloc(0);return A&&(e=this._toString(e,A,!0)),e},o.prototype._toString=function(A,e,t){if(this._decoder||(this._decoder=new n(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(A);return t&&(i+=this._decoder.end()),i},A.exports=o},function(A,e,t){"use strict";var i=t(0);Object.defineProperty(e,"__esModule",{value:!0}),e.default=o,e.assertReturn=function(A,e){return o(!(0,n.default)(A),e),A};var r=i(t(200)),n=i(t(125));function o(A,e){if(!A)throw new Error((0,r.default)(e)?e():e)}},function(A,e,t){"use strict";(function(A){var i=this&&this.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(e,"__esModule",{value:!0});const r=i(t(608)),n=i(t(1406));function o(A){return new Uint8Array(A)}function a(A,e=!1){const t=A.toString("hex");return e?R(t):t}function s(A){return A.toString("utf8")}function c(A){return A.readUIntBE(0,A.length)}function g(A){return n.default(A)}function f(A,e=!1){return a(g(A),e)}function u(A){return s(g(A))}function h(A){return c(g(A))}function d(A){return Array.from(A).map(Q).join("")}function B(e){return A.from(O(e),"hex")}function l(A){return o(B(A))}function I(A){return d(l(A))}function E(e){return A.from(e,"utf8")}function C(A){return o(E(A))}function Q(A){return N((A>>>0).toString(2))}function p(A){return g(w(A))}function w(A){return new Uint8Array(k(A).map(A=>parseInt(A,2)))}function m(A,e){return f(w(A),e)}function y(A){return!("string"!=typeof A||!new RegExp(/^[01]+$/).test(A))&&A.length%8==0}function M(A,e){return!("string"!=typeof A||!A.match(/^0x[0-9A-Fa-f]*$/))&&(!e||A.length===2+2*e)}function b(e){return A.isBuffer(e)}function D(A){return r.default.strict(A)&&!b(A)}function v(A){return!D(A)&&!b(A)&&void 0!==A.byteLength}function S(A,e=8){const t=A%e;return t?(A-t)/e*e+e:A}function k(A,e=8){const t=N(A).match(new RegExp(`.{${e}}`,"gi"));return Array.from(t||[])}function G(A){return k(A).map(U).join("")}function N(A,e=8,t="0"){return F(A,S(A.length,e),t)}function F(A,e,t="0"){return Y(A,e,!0,t)}function O(A){return A.replace(/^0x/,"")}function R(A){return A.startsWith("0x")?A:"0x"+A}function U(A){return A.split("").reverse().join("")}function Y(A,e,t,i="0"){const r=e-A.length;let n=A;if(r>0){const e=i.repeat(r);n=t?e+A:A+e}return n}e.bufferToArray=o,e.bufferToHex=a,e.bufferToUtf8=s,e.bufferToNumber=c,e.bufferToBinary=function(A){return d(o(A))},e.arrayToBuffer=g,e.arrayToHex=f,e.arrayToUtf8=u,e.arrayToNumber=h,e.arrayToBinary=d,e.hexToBuffer=B,e.hexToArray=l,e.hexToUtf8=function(A){return s(B(A))},e.hexToNumber=function(A){return h(l(A))},e.hexToBinary=I,e.utf8ToBuffer=E,e.utf8ToArray=C,e.utf8ToHex=function(A,e=!1){return a(E(A),e)},e.utf8ToNumber=function(A){const e=parseInt(A,10);return function(A,e){if(!A)throw new Error(e)}(!function(A){return void 0===A}(e),"Number can only safely store up to 53 bits"),e},e.utf8ToBinary=function(A){return d(C(A))},e.numberToBuffer=function(A){return p(Q(A))},e.numberToArray=function(A){return w(Q(A))},e.numberToHex=function(A,e){return m(Q(A),e)},e.numberToUtf8=function(A){return""+A},e.numberToBinary=Q,e.binaryToBuffer=p,e.binaryToArray=w,e.binaryToHex=m,e.binaryToUtf8=function(A){return u(w(A))},e.binaryToNumber=function(A){return h(w(A))},e.isBinaryString=y,e.isHexString=M,e.isBuffer=b,e.isTypedArray=D,e.isArrayBuffer=v,e.getType=function(A){return b(A)?"buffer":D(A)?"typed-array":v(A)?"array-buffer":Array.isArray(A)?"array":typeof A},e.getEncoding=function(A){return y(A)?"binary":M(A)?"hex":"utf8"},e.concatBuffers=function(...e){return A.concat(e)},e.concatArrays=function(...A){let e=[];return A.forEach(A=>e=e.concat(Array.from(A))),new Uint8Array([...e])},e.trimLeft=function(A,e){const t=A.length-e;return t>0&&(A=A.slice(t)),A},e.trimRight=function(A,e){return A.slice(0,e)},e.calcByteLength=S,e.splitBytes=k,e.swapBytes=G,e.swapHex=function(A){return m(G(I(A)))},e.sanitizeBytes=N,e.padLeft=F,e.padRight=function(A,e,t="0"){return Y(A,e,!1,t)},e.removeHexPrefix=O,e.addHexPrefix=R,e.sanitizeHex=function(A){return(A=N(A=O(A),2))&&(A=R(A)),A},e.removeHexLeadingZeros=function(A){const e=A.startsWith("0x");return A=(A=O(A)).startsWith("0")?A.substring(1):A,e?R(A):A}}).call(this,t(15).Buffer)},function(A,e,t){"use strict";var i=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t),Object.defineProperty(A,i,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),r=this&&this.__exportStar||function(A,e){for(var t in A)"default"===t||e.hasOwnProperty(t)||i(e,A,t)};Object.defineProperty(e,"__esModule",{value:!0}),r(t(251),e),r(t(612),e),r(t(1442),e),r(t(1443),e),r(t(1444),e)},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isUndefined=function(A){return void 0===A}},function(A,e,t){(function(A){!function(A,e){"use strict";function i(A,e){if(!A)throw new Error(e||"Assertion failed")}function r(A,e){A.super_=e;var t=function(){};t.prototype=e.prototype,A.prototype=new t,A.prototype.constructor=A}function n(A,e,t){if(n.isBN(A))return A;this.negative=0,this.words=null,this.length=0,this.red=null,null!==A&&("le"!==e&&"be"!==e||(t=e,e=10),this._init(A||0,e||10,t||"be"))}var o;"object"==typeof A?A.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t(1468).Buffer}catch(A){}function a(A,e){var t=A.charCodeAt(e);return t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:t-48&15}function s(A,e,t){var i=a(A,t);return t-1>=e&&(i|=a(A,t-1)<<4),i}function c(A,e,t,i){for(var r=0,n=Math.min(A.length,t),o=e;o=49?a-49+10:a>=17?a-17+10:a}return r}n.isBN=function(A){return A instanceof n||null!==A&&"object"==typeof A&&A.constructor.wordSize===n.wordSize&&Array.isArray(A.words)},n.max=function(A,e){return A.cmp(e)>0?A:e},n.min=function(A,e){return A.cmp(e)<0?A:e},n.prototype._init=function(A,e,t){if("number"==typeof A)return this._initNumber(A,e,t);if("object"==typeof A)return this._initArray(A,e,t);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var r=0;"-"===(A=A.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)o=A[r]|A[r-1]<<8|A[r-2]<<16,this.words[n]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===t)for(r=0,n=0;r>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this.strip()},n.prototype._parseHex=function(A,e,t){this.length=Math.ceil((A.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)r=s(A,e,i)<=18?(n-=18,o+=1,this.words[o]|=r>>>26):n+=8;else for(i=(A.length-e)%2==0?e+1:e;i=18?(n-=18,o+=1,this.words[o]|=r>>>26):n+=8;this.strip()},n.prototype._parseBase=function(A,e,t){this.words=[0],this.length=1;for(var i=0,r=1;r<=67108863;r*=e)i++;i--,r=r/e|0;for(var n=A.length-t,o=n%i,a=Math.min(n,n-o)+t,s=0,g=t;g1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"