decidim-bulletin_board 0.21.0 → 0.22.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +89 -75
- data/app/assets/javascripts/decidim/bulletin_board/decidim-bulletin_board.js +2 -2
- data/decidim-bulletin_board.gemspec +1 -2
- data/lib/decidim/bulletin_board/authority/report_missing_trustee.rb +59 -0
- data/lib/decidim/bulletin_board/client.rb +11 -2
- data/lib/decidim/bulletin_board/engine.rb +4 -2
- data/lib/decidim/bulletin_board/graphql/bb_schema.json +82 -0
- data/lib/decidim/bulletin_board/version.rb +1 -1
- metadata +12 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fad7617a481006541d81531b3de0bc3ace38161dd79866fea028ddc9f20188c8
|
4
|
+
data.tar.gz: d0a8a579475684846e93f5a2c9735588f6af02c8a9922f269fa32accfbbd2253
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3dabf6fec69920f6a15808f043ad2753a56b02e586dec3e1a9e4531d3a0a1f00b99f3257dd641e8a1df655ef64e3bf422ebf4d737374f00e14edee0319cee99
|
7
|
+
data.tar.gz: 548b63d0f3119f4ca6dd03745cf1b690946f05867c685ab823db9f5fc3a2d38f7a13f23bade5cb675628f26e19eb5e407d2b9ddc896c16ee46618ed6296b431f
|
data/Gemfile.lock
CHANGED
@@ -1,76 +1,76 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
decidim-bulletin_board (0.
|
4
|
+
decidim-bulletin_board (0.22.1)
|
5
5
|
byebug (~> 11.0)
|
6
6
|
graphlient (~> 0.4.0)
|
7
7
|
jwt (~> 2.2.2)
|
8
|
-
rails (>= 5.0.0)
|
8
|
+
rails (~> 6.0, >= 5.0.0)
|
9
9
|
wisper (~> 2.0.0)
|
10
10
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
actioncable (6.1.
|
15
|
-
actionpack (= 6.1.
|
16
|
-
activesupport (= 6.1.
|
14
|
+
actioncable (6.1.4.1)
|
15
|
+
actionpack (= 6.1.4.1)
|
16
|
+
activesupport (= 6.1.4.1)
|
17
17
|
nio4r (~> 2.0)
|
18
18
|
websocket-driver (>= 0.6.1)
|
19
|
-
actionmailbox (6.1.
|
20
|
-
actionpack (= 6.1.
|
21
|
-
activejob (= 6.1.
|
22
|
-
activerecord (= 6.1.
|
23
|
-
activestorage (= 6.1.
|
24
|
-
activesupport (= 6.1.
|
19
|
+
actionmailbox (6.1.4.1)
|
20
|
+
actionpack (= 6.1.4.1)
|
21
|
+
activejob (= 6.1.4.1)
|
22
|
+
activerecord (= 6.1.4.1)
|
23
|
+
activestorage (= 6.1.4.1)
|
24
|
+
activesupport (= 6.1.4.1)
|
25
25
|
mail (>= 2.7.1)
|
26
|
-
actionmailer (6.1.
|
27
|
-
actionpack (= 6.1.
|
28
|
-
actionview (= 6.1.
|
29
|
-
activejob (= 6.1.
|
30
|
-
activesupport (= 6.1.
|
26
|
+
actionmailer (6.1.4.1)
|
27
|
+
actionpack (= 6.1.4.1)
|
28
|
+
actionview (= 6.1.4.1)
|
29
|
+
activejob (= 6.1.4.1)
|
30
|
+
activesupport (= 6.1.4.1)
|
31
31
|
mail (~> 2.5, >= 2.5.4)
|
32
32
|
rails-dom-testing (~> 2.0)
|
33
|
-
actionpack (6.1.
|
34
|
-
actionview (= 6.1.
|
35
|
-
activesupport (= 6.1.
|
33
|
+
actionpack (6.1.4.1)
|
34
|
+
actionview (= 6.1.4.1)
|
35
|
+
activesupport (= 6.1.4.1)
|
36
36
|
rack (~> 2.0, >= 2.0.9)
|
37
37
|
rack-test (>= 0.6.3)
|
38
38
|
rails-dom-testing (~> 2.0)
|
39
39
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
40
|
-
actiontext (6.1.
|
41
|
-
actionpack (= 6.1.
|
42
|
-
activerecord (= 6.1.
|
43
|
-
activestorage (= 6.1.
|
44
|
-
activesupport (= 6.1.
|
40
|
+
actiontext (6.1.4.1)
|
41
|
+
actionpack (= 6.1.4.1)
|
42
|
+
activerecord (= 6.1.4.1)
|
43
|
+
activestorage (= 6.1.4.1)
|
44
|
+
activesupport (= 6.1.4.1)
|
45
45
|
nokogiri (>= 1.8.5)
|
46
|
-
actionview (6.1.
|
47
|
-
activesupport (= 6.1.
|
46
|
+
actionview (6.1.4.1)
|
47
|
+
activesupport (= 6.1.4.1)
|
48
48
|
builder (~> 3.1)
|
49
49
|
erubi (~> 1.4)
|
50
50
|
rails-dom-testing (~> 2.0)
|
51
51
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
52
|
-
activejob (6.1.
|
53
|
-
activesupport (= 6.1.
|
52
|
+
activejob (6.1.4.1)
|
53
|
+
activesupport (= 6.1.4.1)
|
54
54
|
globalid (>= 0.3.6)
|
55
|
-
activemodel (6.1.
|
56
|
-
activesupport (= 6.1.
|
57
|
-
activerecord (6.1.
|
58
|
-
activemodel (= 6.1.
|
59
|
-
activesupport (= 6.1.
|
60
|
-
activestorage (6.1.
|
61
|
-
actionpack (= 6.1.
|
62
|
-
activejob (= 6.1.
|
63
|
-
activerecord (= 6.1.
|
64
|
-
activesupport (= 6.1.
|
55
|
+
activemodel (6.1.4.1)
|
56
|
+
activesupport (= 6.1.4.1)
|
57
|
+
activerecord (6.1.4.1)
|
58
|
+
activemodel (= 6.1.4.1)
|
59
|
+
activesupport (= 6.1.4.1)
|
60
|
+
activestorage (6.1.4.1)
|
61
|
+
actionpack (= 6.1.4.1)
|
62
|
+
activejob (= 6.1.4.1)
|
63
|
+
activerecord (= 6.1.4.1)
|
64
|
+
activesupport (= 6.1.4.1)
|
65
65
|
marcel (~> 1.0.0)
|
66
|
-
mini_mime (
|
67
|
-
activesupport (6.1.
|
66
|
+
mini_mime (>= 1.1.0)
|
67
|
+
activesupport (6.1.4.1)
|
68
68
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
69
69
|
i18n (>= 1.6, < 2)
|
70
70
|
minitest (>= 5.1)
|
71
71
|
tzinfo (~> 2.0)
|
72
72
|
zeitwerk (~> 2.3)
|
73
|
-
addressable (2.
|
73
|
+
addressable (2.8.0)
|
74
74
|
public_suffix (>= 2.0.2, < 5.0)
|
75
75
|
ast (2.4.1)
|
76
76
|
builder (3.2.4)
|
@@ -83,24 +83,34 @@ GEM
|
|
83
83
|
erubi (1.10.0)
|
84
84
|
faker (2.15.1)
|
85
85
|
i18n (>= 1.6, < 2)
|
86
|
-
faraday (1.
|
86
|
+
faraday (1.7.1)
|
87
|
+
faraday-em_http (~> 1.0)
|
88
|
+
faraday-em_synchrony (~> 1.0)
|
87
89
|
faraday-excon (~> 1.1)
|
90
|
+
faraday-httpclient (~> 1.0.1)
|
88
91
|
faraday-net_http (~> 1.0)
|
89
92
|
faraday-net_http_persistent (~> 1.1)
|
93
|
+
faraday-patron (~> 1.0)
|
94
|
+
faraday-rack (~> 1.0)
|
90
95
|
multipart-post (>= 1.2, < 3)
|
91
96
|
ruby2_keywords (>= 0.0.4)
|
97
|
+
faraday-em_http (1.0.0)
|
98
|
+
faraday-em_synchrony (1.0.0)
|
92
99
|
faraday-excon (1.1.0)
|
100
|
+
faraday-httpclient (1.0.1)
|
93
101
|
faraday-net_http (1.0.1)
|
94
|
-
faraday-net_http_persistent (1.
|
95
|
-
|
102
|
+
faraday-net_http_persistent (1.2.0)
|
103
|
+
faraday-patron (1.0.0)
|
104
|
+
faraday-rack (1.0.0)
|
105
|
+
faraday_middleware (1.1.0)
|
96
106
|
faraday (~> 1.0)
|
97
|
-
globalid (0.
|
98
|
-
activesupport (>=
|
107
|
+
globalid (0.5.2)
|
108
|
+
activesupport (>= 5.0)
|
99
109
|
graphlient (0.4.0)
|
100
110
|
faraday (>= 1.0)
|
101
111
|
faraday_middleware
|
102
112
|
graphql-client
|
103
|
-
graphql (1.12.
|
113
|
+
graphql (1.12.16)
|
104
114
|
graphql-client (0.16.0)
|
105
115
|
activesupport (>= 3.0)
|
106
116
|
graphql (~> 1.8)
|
@@ -108,20 +118,24 @@ GEM
|
|
108
118
|
i18n (1.8.10)
|
109
119
|
concurrent-ruby (~> 1.0)
|
110
120
|
jwt (2.2.3)
|
111
|
-
loofah (2.
|
121
|
+
loofah (2.12.0)
|
112
122
|
crass (~> 1.0.2)
|
113
123
|
nokogiri (>= 1.5.9)
|
114
124
|
mail (2.7.1)
|
115
125
|
mini_mime (>= 0.1.1)
|
116
126
|
marcel (1.0.1)
|
117
127
|
method_source (1.0.0)
|
118
|
-
mini_mime (1.
|
119
|
-
mini_portile2 (2.
|
128
|
+
mini_mime (1.1.1)
|
129
|
+
mini_portile2 (2.6.1)
|
120
130
|
minitest (5.14.4)
|
121
131
|
multipart-post (2.1.1)
|
122
|
-
nio4r (2.5.
|
123
|
-
nokogiri (1.
|
124
|
-
mini_portile2 (~> 2.
|
132
|
+
nio4r (2.5.8)
|
133
|
+
nokogiri (1.12.4)
|
134
|
+
mini_portile2 (~> 2.6.1)
|
135
|
+
racc (~> 1.4)
|
136
|
+
nokogiri (1.12.4-x86_64-darwin)
|
137
|
+
racc (~> 1.4)
|
138
|
+
nokogiri (1.12.4-x86_64-linux)
|
125
139
|
racc (~> 1.4)
|
126
140
|
parallel (1.20.1)
|
127
141
|
parser (2.7.2.0)
|
@@ -131,36 +145,36 @@ GEM
|
|
131
145
|
rack (2.2.3)
|
132
146
|
rack-test (1.1.0)
|
133
147
|
rack (>= 1.0, < 3)
|
134
|
-
rails (6.1.
|
135
|
-
actioncable (= 6.1.
|
136
|
-
actionmailbox (= 6.1.
|
137
|
-
actionmailer (= 6.1.
|
138
|
-
actionpack (= 6.1.
|
139
|
-
actiontext (= 6.1.
|
140
|
-
actionview (= 6.1.
|
141
|
-
activejob (= 6.1.
|
142
|
-
activemodel (= 6.1.
|
143
|
-
activerecord (= 6.1.
|
144
|
-
activestorage (= 6.1.
|
145
|
-
activesupport (= 6.1.
|
148
|
+
rails (6.1.4.1)
|
149
|
+
actioncable (= 6.1.4.1)
|
150
|
+
actionmailbox (= 6.1.4.1)
|
151
|
+
actionmailer (= 6.1.4.1)
|
152
|
+
actionpack (= 6.1.4.1)
|
153
|
+
actiontext (= 6.1.4.1)
|
154
|
+
actionview (= 6.1.4.1)
|
155
|
+
activejob (= 6.1.4.1)
|
156
|
+
activemodel (= 6.1.4.1)
|
157
|
+
activerecord (= 6.1.4.1)
|
158
|
+
activestorage (= 6.1.4.1)
|
159
|
+
activesupport (= 6.1.4.1)
|
146
160
|
bundler (>= 1.15.0)
|
147
|
-
railties (= 6.1.
|
161
|
+
railties (= 6.1.4.1)
|
148
162
|
sprockets-rails (>= 2.0.0)
|
149
163
|
rails-dom-testing (2.0.3)
|
150
164
|
activesupport (>= 4.2.0)
|
151
165
|
nokogiri (>= 1.6)
|
152
|
-
rails-html-sanitizer (1.
|
166
|
+
rails-html-sanitizer (1.4.2)
|
153
167
|
loofah (~> 2.3)
|
154
|
-
railties (6.1.
|
155
|
-
actionpack (= 6.1.
|
156
|
-
activesupport (= 6.1.
|
168
|
+
railties (6.1.4.1)
|
169
|
+
actionpack (= 6.1.4.1)
|
170
|
+
activesupport (= 6.1.4.1)
|
157
171
|
method_source
|
158
|
-
rake (>= 0.
|
172
|
+
rake (>= 0.13)
|
159
173
|
thor (~> 1.0)
|
160
174
|
rainbow (3.0.0)
|
161
175
|
rake (13.0.3)
|
162
176
|
regexp_parser (2.0.0)
|
163
|
-
rexml (3.2.
|
177
|
+
rexml (3.2.5)
|
164
178
|
rspec (3.9.0)
|
165
179
|
rspec-core (~> 3.9.0)
|
166
180
|
rspec-expectations (~> 3.9.0)
|
@@ -192,7 +206,7 @@ GEM
|
|
192
206
|
rubocop (~> 0.87)
|
193
207
|
rubocop-ast (>= 0.7.1)
|
194
208
|
ruby-progressbar (1.10.1)
|
195
|
-
ruby2_keywords (0.0.
|
209
|
+
ruby2_keywords (0.0.5)
|
196
210
|
sprockets (4.0.2)
|
197
211
|
concurrent-ruby (~> 1.0)
|
198
212
|
rack (> 1, < 3)
|
@@ -208,7 +222,7 @@ GEM
|
|
208
222
|
addressable (>= 2.3.6)
|
209
223
|
crack (>= 0.3.2)
|
210
224
|
hashdiff (>= 0.4.0, < 2.0.0)
|
211
|
-
websocket-driver (0.7.
|
225
|
+
websocket-driver (0.7.5)
|
212
226
|
websocket-extensions (>= 0.1.0)
|
213
227
|
websocket-extensions (0.1.5)
|
214
228
|
wisper (2.0.1)
|
@@ -231,4 +245,4 @@ DEPENDENCIES
|
|
231
245
|
wisper-rspec (~> 1.1.0)
|
232
246
|
|
233
247
|
BUNDLED WITH
|
234
|
-
2.2.
|
248
|
+
2.2.27
|
@@ -12,7 +12,7 @@
|
|
12
12
|
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
13
13
|
* @version v4.2.8+1e68dce6
|
14
14
|
*/
|
15
|
-
e.exports=function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,a=void 0,o=void 0,s=function(e,t){E[i]=e,E[i+1]=t,2===(i+=2)&&(o?o(S):w())};function u(e){o=e}function c(e){s=e}var l="undefined"!=typeof window?window:void 0,f=l||{},h=f.MutationObserver||f.WebKitMutationObserver,p="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function y(){return function(){return process.nextTick(S)}}function v(){return void 0!==a?function(){a(S)}:b()}function g(){var e=0,t=new h(S),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function m(){var e=new MessageChannel;return e.port1.onmessage=S,function(){return e.port2.postMessage(0)}}function b(){var e=setTimeout;return function(){return e(S,1)}}var E=new Array(1e3);function S(){for(var e=0;e<i;e+=2)(0,E[e])(E[e+1]),E[e]=void 0,E[e+1]=void 0;i=0}function C(){try{var e=Function("return this")().require("vertx");return a=e.runOnLoop||e.runOnContext,v()}catch(e){return b()}}var w=void 0;function T(e,t){var r=this,n=new this.constructor(k);void 0===n[I]&&Q(n);var i=r._state;if(i){var a=arguments[i-1];s((function(){return q(i,n,a,r._result)}))}else K(r,n,e,t);return n}function A(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var r=new t(k);return L(r,e),r}w=p?y():h?g():d?m():void 0===l?C():b();var I=Math.random().toString(36).substring(2);function k(){}var _=void 0,B=1,N=2;function O(){return new TypeError("You cannot resolve a promise with itself")}function R(){return new TypeError("A promises callback cannot return that same promise.")}function x(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}function P(e,t,r){s((function(e){var n=!1,i=x(r,t,(function(r){n||(n=!0,t!==r?L(e,r):j(e,r))}),(function(t){n||(n=!0,V(e,t))}),"Settle: "+(e._label||" unknown promise"));!n&&i&&(n=!0,V(e,i))}),e)}function F(e,t){t._state===B?j(e,t._result):t._state===N?V(e,t._result):K(t,void 0,(function(t){return L(e,t)}),(function(t){return V(e,t)}))}function D(e,r,n){r.constructor===e.constructor&&n===T&&r.constructor.resolve===A?F(e,r):void 0===n?j(e,r):t(n)?P(e,r,n):j(e,r)}function L(t,r){if(t===r)V(t,O());else if(e(r)){var n=void 0;try{n=r.then}catch(e){return void V(t,e)}D(t,r,n)}else j(t,r)}function U(e){e._onerror&&e._onerror(e._result),M(e)}function j(e,t){e._state===_&&(e._result=t,e._state=B,0!==e._subscribers.length&&s(M,e))}function V(e,t){e._state===_&&(e._state=N,e._result=t,s(U,e))}function K(e,t,r,n){var i=e._subscribers,a=i.length;e._onerror=null,i[a]=t,i[a+B]=r,i[a+N]=n,0===a&&e._state&&s(M,e)}function M(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,i=void 0,a=e._result,o=0;o<t.length;o+=3)n=t[o],i=t[o+r],n?q(r,n,i,a):i(a);e._subscribers.length=0}}function q(e,r,n,i){var a=t(n),o=void 0,s=void 0,u=!0;if(a){try{o=n(i)}catch(e){u=!1,s=e}if(r===o)return void V(r,R())}else o=i;r._state!==_||(a&&u?L(r,o):!1===u?V(r,s):e===B?j(r,o):e===N&&V(r,o))}function z(e,t){try{t((function(t){L(e,t)}),(function(t){V(e,t)}))}catch(t){V(e,t)}}var H=0;function G(){return H++}function Q(e){e[I]=H++,e._state=void 0,e._result=void 0,e._subscribers=[]}function W(){return new Error("Array Methods must be provided an Array")}var Y=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(k),this.promise[I]||Q(this.promise),n(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&j(this.promise,this._result))):V(this.promise,W())}return e.prototype._enumerate=function(e){for(var t=0;this._state===_&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===A){var i=void 0,a=void 0,o=!1;try{i=e.then}catch(e){o=!0,a=e}if(i===T&&e._state!==_)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(r===te){var s=new r(k);o?V(s,a):D(s,e,i),this._willSettleAt(s,t)}else this._willSettleAt(new r((function(t){return t(e)})),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===_&&(this._remaining--,e===N?V(n,r):this._result[t]=r),0===this._remaining&&j(n,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;K(e,void 0,(function(e){return r._settledAt(B,t,e)}),(function(e){return r._settledAt(N,t,e)}))},e}();function Z(e){return new Y(this,e).promise}function J(e){var t=this;return n(e)?new t((function(r,n){for(var i=e.length,a=0;a<i;a++)t.resolve(e[a]).then(r,n)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))}function X(e){var t=new this(k);return V(t,e),t}function $(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function ee(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var te=function(){function e(t){this[I]=G(),this._result=this._state=void 0,this._subscribers=[],k!==t&&("function"!=typeof t&&$(),this instanceof e?z(this,t):ee())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var r=this,n=r.constructor;return t(e)?r.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):r.then(e,e)},e}();function re(){var e=void 0;if(void 0!==r.g)e=r.g;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=te}return te.prototype.then=T,te.all=Z,te.race=J,te.resolve=A,te.reject=X,te._setScheduler=u,te._setAsap=c,te._asap=s,te.polyfill=re,te.Promise=te,te}()},5035:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},a={key:n,value:e[n]};return r(i,a)}}),a=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,o;if(Array.isArray(t)){for(o="[",r=0;r<t.length;r++)r&&(o+=","),o+=e(t[r])||"null";return o+"]"}if(null===t)return"null";if(-1!==a.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=a.push(t)-1,u=Object.keys(t).sort(i&&i(t));for(o="",r=0;r<u.length;r++){var c=u[r],l=e(t[c]);l&&(o&&(o+=","),o+=JSON.stringify(c)+":"+l)}return a.splice(s,1),"{"+o+"}"}}(e)}},2527:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>ee});var n=r(655);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"function"==typeof Symbol&&null!=Symbol.iterator&&Symbol.iterator,"function"==typeof Symbol&&null!=Symbol.asyncIterator&&Symbol.asyncIterator;var a="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";function o(e,t){for(var r,n=/\r\n|[\n\r]/g,i=1,a=t+1;(r=n.exec(e.body))&&r.index<t;)i+=1,a=t+1-(r.index+r[0].length);return{line:i,column:a}}function s(e){return u(e.source,o(e.source,e.start))}function u(e,t){var r=e.locationOffset.column-1,n=l(r)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=1===t.line?r:0,u=t.column+s,f="".concat(e.name,":").concat(o,":").concat(u,"\n"),h=n.split(/\r\n|[\n\r]/g),p=h[i];if(p.length>120){for(var d=Math.floor(u/80),y=u%80,v=[],g=0;g<p.length;g+=80)v.push(p.slice(g,g+80));return f+c([["".concat(o),v[0]]].concat(v.slice(1,d+1).map((function(e){return["",e]})),[[" ",l(y-1)+"^"],["",v[d+1]]]))}return f+c([["".concat(o-1),h[i-1]],["".concat(o),p],["",l(u-1)+"^"],["".concat(o+1),h[i+1]]])}function c(e){var t=e.filter((function(e){e[0];return void 0!==e[1]})),r=Math.max.apply(Math,t.map((function(e){return e[0].length})));return t.map((function(e){var t,n=e[0],i=e[1];return l(r-(t=n).length)+t+(i?" | "+i:" |")})).join("\n")}function l(e){return Array(e+1).join(" ")}function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?d(e):t}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){var t="function"==typeof Map?new Map:void 0;return(y=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return v(e,arguments,b(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),m(n,e)})(e)}function v(e,t,r){return(v=g()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&m(i,r.prototype),i}).apply(null,arguments)}function g(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(y,e);var t,r,n,c,l,f=(t=y,r=g(),function(){var e,n=b(t);if(r){var i=b(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return p(this,e)});function y(e,t,r,n,a,s,u){var c,l,h,v,g;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),g=f.call(this,e);var m,b=Array.isArray(t)?0!==t.length?t:void 0:t?[t]:void 0,E=r;!E&&b&&(E=null===(m=b[0].loc)||void 0===m?void 0:m.source);var S,C=n;!C&&b&&(C=b.reduce((function(e,t){return t.loc&&e.push(t.loc.start),e}),[])),C&&0===C.length&&(C=void 0),n&&r?S=n.map((function(e){return o(r,e)})):b&&(S=b.reduce((function(e,t){return t.loc&&e.push(o(t.loc.source,t.loc.start)),e}),[]));var w,T=u;if(null==T&&null!=s){var A=s.extensions;"object"==i(w=A)&&null!==w&&(T=A)}return Object.defineProperties(d(g),{name:{value:"GraphQLError"},message:{value:e,enumerable:!0,writable:!0},locations:{value:null!==(c=S)&&void 0!==c?c:void 0,enumerable:null!=S},path:{value:null!=a?a:void 0,enumerable:null!=a},nodes:{value:null!=b?b:void 0},source:{value:null!==(l=E)&&void 0!==l?l:void 0},positions:{value:null!==(h=C)&&void 0!==h?h:void 0},originalError:{value:s},extensions:{value:null!==(v=T)&&void 0!==v?v:void 0,enumerable:null!=T}}),null!=s&&s.stack?(Object.defineProperty(d(g),"stack",{value:s.stack,writable:!0,configurable:!0}),p(g)):(Error.captureStackTrace?Error.captureStackTrace(d(g),y):Object.defineProperty(d(g),"stack",{value:Error().stack,writable:!0,configurable:!0}),g)}return n=y,(c=[{key:"toString",value:function(){return function(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r<n.length;r++){var i=n[r];i.loc&&(t+="\n\n"+s(i.loc))}else if(e.source&&e.locations)for(var a=0,o=e.locations;a<o.length;a++){var c=o[a];t+="\n\n"+u(e.source,c)}return t}(this)}},{key:a,get:function(){return"Object"}}])&&h(n.prototype,c),l&&h(n,l),y}(y(Error));function S(e,t,r){return new E("Syntax Error: ".concat(r),void 0,e,[t])}var C=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"}),w=r(3059),T=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),A=r(6589);function I(e,t){if(!Boolean(e))throw new Error(t)}const k=function(e,t){return e instanceof t};function _(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var B=function(){function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||I(0,"Body must be a string. Received: ".concat((0,A.Z)(e),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||I(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||I(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r,n;return t=e,(r=[{key:a,get:function(){return"Source"}}])&&_(t.prototype,r),n&&_(t,n),e}();var N=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"}),O=r(7420),R=function(){function e(e){var t=new w.WU(T.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==T.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=P(this,e)}while(e.kind===T.COMMENT);return e},e}();function x(e){return isNaN(e)?T.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function P(e,t){for(var r=e.source,n=r.body,i=n.length,a=t.end;a<i;){var o=n.charCodeAt(a),s=e.line,u=1+a-e.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++e.line,e.lineStart=a;continue;case 13:10===n.charCodeAt(a+1)?a+=2:++a,++e.line,e.lineStart=a;continue;case 33:return new w.WU(T.BANG,a,a+1,s,u,t);case 35:return D(r,a,s,u,t);case 36:return new w.WU(T.DOLLAR,a,a+1,s,u,t);case 38:return new w.WU(T.AMP,a,a+1,s,u,t);case 40:return new w.WU(T.PAREN_L,a,a+1,s,u,t);case 41:return new w.WU(T.PAREN_R,a,a+1,s,u,t);case 46:if(46===n.charCodeAt(a+1)&&46===n.charCodeAt(a+2))return new w.WU(T.SPREAD,a,a+3,s,u,t);break;case 58:return new w.WU(T.COLON,a,a+1,s,u,t);case 61:return new w.WU(T.EQUALS,a,a+1,s,u,t);case 64:return new w.WU(T.AT,a,a+1,s,u,t);case 91:return new w.WU(T.BRACKET_L,a,a+1,s,u,t);case 93:return new w.WU(T.BRACKET_R,a,a+1,s,u,t);case 123:return new w.WU(T.BRACE_L,a,a+1,s,u,t);case 124:return new w.WU(T.PIPE,a,a+1,s,u,t);case 125:return new w.WU(T.BRACE_R,a,a+1,s,u,t);case 34:return 34===n.charCodeAt(a+1)&&34===n.charCodeAt(a+2)?V(r,a,s,u,t,e):j(r,a,s,u,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return L(r,a,o,s,u,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return M(r,a,s,u,t)}throw S(r,a,F(o))}var c=e.line,l=1+a-e.lineStart;return new w.WU(T.EOF,i,i,c,l,t)}function F(e){return e<32&&9!==e&&10!==e&&13!==e?"Cannot contain the invalid character ".concat(x(e),"."):39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character ".concat(x(e),".")}function D(e,t,r,n,i){var a,o=e.body,s=t;do{a=o.charCodeAt(++s)}while(!isNaN(a)&&(a>31||9===a));return new w.WU(T.COMMENT,t,s,r,n,i,o.slice(t+1,s))}function L(e,t,r,n,i,a){var o=e.body,s=r,u=t,c=!1;if(45===s&&(s=o.charCodeAt(++u)),48===s){if((s=o.charCodeAt(++u))>=48&&s<=57)throw S(e,u,"Invalid number, unexpected digit after 0: ".concat(x(s),"."))}else u=U(e,u,s),s=o.charCodeAt(u);if(46===s&&(c=!0,s=o.charCodeAt(++u),u=U(e,u,s),s=o.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=o.charCodeAt(++u))&&45!==s||(s=o.charCodeAt(++u)),u=U(e,u,s),s=o.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw S(e,u,"Invalid number, expected digit but got: ".concat(x(s),"."));return new w.WU(c?T.FLOAT:T.INT,t,u,n,i,a,o.slice(t,u))}function U(e,t,r){var n=e.body,i=t,a=r;if(a>=48&&a<=57){do{a=n.charCodeAt(++i)}while(a>=48&&a<=57);return i}throw S(e,i,"Invalid number, expected digit but got: ".concat(x(a),"."))}function j(e,t,r,n,i){for(var a,o,s,u,c=e.body,l=t+1,f=l,h=0,p="";l<c.length&&!isNaN(h=c.charCodeAt(l))&&10!==h&&13!==h;){if(34===h)return p+=c.slice(f,l),new w.WU(T.STRING,t,l+1,r,n,i,p);if(h<32&&9!==h)throw S(e,l,"Invalid character within String: ".concat(x(h),"."));if(++l,92===h){switch(p+=c.slice(f,l-1),h=c.charCodeAt(l)){case 34:p+='"';break;case 47:p+="/";break;case 92:p+="\\";break;case 98:p+="\b";break;case 102:p+="\f";break;case 110:p+="\n";break;case 114:p+="\r";break;case 116:p+="\t";break;case 117:var d=(a=c.charCodeAt(l+1),o=c.charCodeAt(l+2),s=c.charCodeAt(l+3),u=c.charCodeAt(l+4),K(a)<<12|K(o)<<8|K(s)<<4|K(u));if(d<0){var y=c.slice(l+1,l+5);throw S(e,l,"Invalid character escape sequence: \\u".concat(y,"."))}p+=String.fromCharCode(d),l+=4;break;default:throw S(e,l,"Invalid character escape sequence: \\".concat(String.fromCharCode(h),"."))}f=++l}}throw S(e,l,"Unterminated string.")}function V(e,t,r,n,i,a){for(var o=e.body,s=t+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(34===c&&34===o.charCodeAt(s+1)&&34===o.charCodeAt(s+2))return l+=o.slice(u,s),new w.WU(T.BLOCK_STRING,t,s+3,r,n,i,(0,O.W7)(l));if(c<32&&9!==c&&10!==c&&13!==c)throw S(e,s,"Invalid character within String: ".concat(x(c),"."));10===c?(++s,++a.line,a.lineStart=s):13===c?(10===o.charCodeAt(s+1)?s+=2:++s,++a.line,a.lineStart=s):92===c&&34===o.charCodeAt(s+1)&&34===o.charCodeAt(s+2)&&34===o.charCodeAt(s+3)?(l+=o.slice(u,s)+'"""',u=s+=4):++s}throw S(e,s,"Unterminated string.")}function K(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function M(e,t,r,n,i){for(var a=e.body,o=a.length,s=t+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new w.WU(T.NAME,t,s,r,n,i,a.slice(t,s))}var q=function(){function e(e,t){var r=function(e){return k(e,B)}(e)?e:new B(e);this._lexer=new R(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(T.NAME);return{kind:C.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:C.DOCUMENT,definitions:this.many(T.SOF,this.parseDefinition,T.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(T.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(T.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(T.BRACE_L))return{kind:C.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(T.NAME)&&(t=this.parseName()),{kind:C.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(T.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(T.PAREN_L,this.parseVariableDefinition,T.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:C.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(T.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(T.DOLLAR),{kind:C.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:C.SELECTION_SET,selections:this.many(T.BRACE_L,this.parseSelection,T.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(T.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(T.COLON)?(e=n,t=this.parseName()):t=n,{kind:C.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(T.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(T.PAREN_L,t,T.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(T.COLON),{kind:C.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:C.ARGUMENT,name:this.parseName(),value:(this.expectToken(T.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(T.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(T.NAME)?{kind:C.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:C.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case T.BRACKET_L:return this.parseList(e);case T.BRACE_L:return this.parseObject(e);case T.INT:return this._lexer.advance(),{kind:C.INT,value:t.value,loc:this.loc(t)};case T.FLOAT:return this._lexer.advance(),{kind:C.FLOAT,value:t.value,loc:this.loc(t)};case T.STRING:case T.BLOCK_STRING:return this.parseStringLiteral();case T.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:C.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:C.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:C.NULL,loc:this.loc(t)};default:return{kind:C.ENUM,value:t.value,loc:this.loc(t)}}case T.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:C.STRING,value:e.value,block:e.kind===T.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:C.LIST,values:this.any(T.BRACKET_L,(function(){return t.parseValueLiteral(e)}),T.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:C.OBJECT,fields:this.any(T.BRACE_L,(function(){return t.parseObjectField(e)}),T.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(T.COLON),{kind:C.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(T.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(T.AT),{kind:C.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(T.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(T.BRACKET_R),e={kind:C.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(T.BANG)?{kind:C.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:C.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(T.STRING)||this.peek(T.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);return{kind:C.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(T.COLON);var r=this.parseNamedType();return{kind:C.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(T.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(T.AMP)||this.peek(T.NAME));return t}return this.delimitedMany(T.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(T.BRACE_L)&&this._lexer.lookahead().kind===T.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(T.BRACE_L,this.parseFieldDefinition,T.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(T.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:C.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:a,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(T.PAREN_L,this.parseInputValueDef,T.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(T.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(T.EQUALS)&&(n=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:C.INPUT_VALUE_DEFINITION,description:t,name:r,type:i,defaultValue:n,directives:a,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:C.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(T.EQUALS)?this.delimitedMany(T.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:C.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseEnumValueDefinition,T.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:C.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseInputValueDef,T.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),r=this.optionalMany(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:C.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:C.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.UNION_TYPE_EXTENSION,name:t,directives:r,types:n,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(T.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:C.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:a,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(T.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==N[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new w.Ye(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw S(this._lexer.source,t.start,"Expected ".concat(H(e),", found ").concat(z(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==T.NAME||t.value!==e)throw S(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(z(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===T.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return S(this._lexer.source,t.start,"Unexpected ".concat(z(t),"."))},t.any=function(e,t,r){this.expectToken(e);for(var n=[];!this.expectOptionalToken(r);)n.push(t.call(this));return n},t.optionalMany=function(e,t,r){if(this.expectOptionalToken(e)){var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}return[]},t.many=function(e,t,r){this.expectToken(e);var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r},e}();function z(e){var t=e.value;return H(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function H(e){return function(e){return e===T.BANG||e===T.DOLLAR||e===T.AMP||e===T.PAREN_L||e===T.PAREN_R||e===T.SPREAD||e===T.COLON||e===T.EQUALS||e===T.AT||e===T.BRACKET_L||e===T.BRACKET_R||e===T.BRACE_L||e===T.PIPE||e===T.BRACE_R}(e)?'"'.concat(e,'"'):e}var G=new Map,Q=new Map,W=!0,Y=!1;function Z(e){return e.replace(/[\s,]+/g," ").trim()}function J(e){var t=new Set,r=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var n=e.name.value,i=Z((o=e.loc).source.body.substring(o.start,o.end)),a=Q.get(n);a&&!a.has(i)?W&&console.warn("Warning: fragment with name "+n+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):a||Q.set(n,a=new Set),a.add(i),t.has(i)||(t.add(i),r.push(e))}else r.push(e);var o})),(0,n.pi)((0,n.pi)({},e),{definitions:r})}function X(e){var t=Z(e);if(!G.has(t)){var r=function(e,t){return new q(e,t).parseDocument()}(e,{experimentalFragmentVariables:Y});if(!r||"Document"!==r.kind)throw new Error("Not a valid GraphQL document.");G.set(t,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)}))}));var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}(J(r)))}return G.get(t)}function $(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach((function(t,r){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[r+1]})),X(n)}const ee=Object.assign($,{gql:$,default:$,resetCaches:function(){G.clear(),Q.clear()},disableFragmentWarnings:function(){W=!1},enableExperimentalFragmentVariables:function(){Y=!0},disableExperimentalFragmentVariables:function(){Y=!1}})},4206:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetElectionLogEntries"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"types"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"election"},arguments:[{kind:"Argument",name:{kind:"Name",value:"uniqueId"},value:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"logEntries"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"Variable",name:{kind:"Name",value:"types"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"messageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:242}};t.loc.source={body:"query GetElectionLogEntries(\n $electionUniqueId: String!\n $after: String\n $types: [String!]\n) {\n election(uniqueId: $electionUniqueId) {\n logEntries(after: $after, types: $types) {\n id\n messageId\n signedData\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.GetElectionLogEntries=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetElectionLogEntries")},5073:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetLogEntry"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"contentHash"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"logEntry"},arguments:[{kind:"Argument",name:{kind:"Name",value:"electionUniqueId"},value:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}}},{kind:"Argument",name:{kind:"Name",value:"contentHash"},value:{kind:"Variable",name:{kind:"Name",value:"contentHash"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"messageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contentHash"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:199}};t.loc.source={body:"query GetLogEntry($electionUniqueId: String!, $contentHash: String!) {\n logEntry(electionUniqueId: $electionUniqueId, contentHash: $contentHash) {\n messageId\n signedData\n contentHash\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.GetLogEntry=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetLogEntry")},5053:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetPendingMessageByMessageId"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:117}};t.loc.source={body:"query GetPendingMessageByMessageId($messageId: String!) {\n pendingMessage(messageId: $messageId) {\n status\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.GetPendingMessageByMessageId=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetPendingMessageByMessageId")},9120:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProcessKeyCeremonyStep"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"signedData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"processKeyCeremonyStep"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}},{kind:"Argument",name:{kind:"Name",value:"signedData"},value:{kind:"Variable",name:{kind:"Name",value:"signedData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:212}};t.loc.source={body:"mutation ProcessKeyCeremonyStep($messageId: String!, $signedData: String!) {\n processKeyCeremonyStep(messageId: $messageId, signedData: $signedData) {\n pendingMessage {\n signedData\n }\n error\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.ProcessKeyCeremonyStep=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"ProcessKeyCeremonyStep")},1798:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProcessTallyStep"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"signedData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"processTallyStep"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}},{kind:"Argument",name:{kind:"Name",value:"signedData"},value:{kind:"Variable",name:{kind:"Name",value:"signedData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:200}};t.loc.source={body:"mutation ProcessTallyStep($messageId: String!, $signedData: String!) {\n processTallyStep(messageId: $messageId, signedData: $signedData) {\n pendingMessage {\n signedData\n }\n error\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.ProcessTallyStep=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"ProcessTallyStep")},972:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,n.default)(0),e.prototype.inspect=t,i.default&&(e.prototype[i.default]=t)};var n=a(r(7706)),i=a(r(8554));function a(e){return e&&e.__esModule?e:{default:e}}},8002:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return o(e,[])};var n,i=(n=r(8554))&&n.__esModule?n:{default:n};function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){switch(a(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(i.default)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==n){var a=n.call(e);if(a!==e)return"string"==typeof a?a:o(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a<r;++a)i.push(o(e[a],t));1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]";return"{ "+r.map((function(r){return r+": "+o(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},6589:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(7986);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return o(e,[])}function o(e,t){switch(i(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),i=function(e){var t=e[String(n.Z)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==i){var a=i.call(e);if(a!==e)return"string"==typeof a?a:o(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a<r;++a)i.push(o(e[a],t));1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]";return"{ "+r.map((function(r){return r+": "+o(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},7706:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},8554:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.default=r},7986:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0},1807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=function(e){return null!=e&&"string"==typeof e.kind},t.Token=t.Location=void 0;var n,i=(n=r(972))&&n.__esModule?n:{default:n};var a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();t.Location=a,(0,i.default)(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();t.Token=o,(0,i.default)(o)},3059:(e,t,r)=>{"use strict";r.d(t,{Ye:()=>a,WU:()=>o,UG:()=>s});var n=r(7986);function i(e){var t=e.prototype.toJSON;"function"==typeof t||function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}(0),e.prototype.inspect=t,n.Z&&(e.prototype[n.Z]=t)}var a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();i(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function s(e){return null!=e&&"string"==typeof e.kind}i(o)},7420:(e,t,r)=>{"use strict";function n(e){var t=e.split(/\r\n|[\n\r]/g),r=function(e){for(var t,r=!0,n=!0,i=0,a=null,o=0;o<e.length;++o)switch(e.charCodeAt(o)){case 13:10===e.charCodeAt(o+1)&&++o;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(null===a||i<a)&&(a=i),n=!1}return null!==(t=a)&&void 0!==t?t:0}(e);if(0!==r)for(var n=1;n<t.length;n++)t[n]=t[n].slice(r);for(var a=0;a<t.length&&i(t[a]);)++a;for(var o=t.length;o>a&&i(t[o-1]);)--o;return t.slice(a,o).join("\n")}function i(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],a='"'===e[e.length-1],o="\\"===e[e.length-1],s=!n||a||o||r,u="";return!s||n&&i||(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}r.d(t,{W7:()=>n,LZ:()=>a})},285:(e,t,r)=>{"use strict";t.Vn=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,y=void 0,v=[],g=[],m=e;do{var b=++f===l.length,E=b&&0!==h.length;if(b){if(d=0===g.length?void 0:v[v.length-1],p=y,y=g.pop(),E){if(c)p=p.slice();else{for(var S={},C=0,w=Object.keys(p);C<w.length;C++){var T=w[C];S[T]=p[T]}p=S}for(var A=0,I=0;I<h.length;I++){var k=h[I][0],_=h[I][1];c&&(k-=A),c&&null===_?(p.splice(k,1),A++):p[k]=_}}f=n.index,l=n.keys,h=n.edits,c=n.inArray,n=n.prev}else{if(d=y?c?f:l[f]:void 0,null==(p=y?y[d]:m))continue;y&&v.push(d)}var B,N=void 0;if(!Array.isArray(p)){if(!(0,a.isNode)(p))throw new Error("Invalid AST Node: ".concat((0,i.default)(p),"."));var O=u(t,p.kind,b);if(O){if((N=O.call(t,p,d,y,v,g))===s)break;if(!1===N){if(!b){v.pop();continue}}else if(void 0!==N&&(h.push([d,N]),!b)){if(!(0,a.isNode)(N)){v.pop();continue}p=N}}}if(void 0===N&&E&&h.push([d,p]),b)v.pop();else n={inArray:c,index:f,keys:l,edits:h,prev:n},c=Array.isArray(p),l=c?p:null!==(B=r[p.kind])&&void 0!==B?B:[],f=-1,h=[],y&&g.push(y),y=p}while(void 0!==n);0!==h.length&&(m=h[h.length-1][1]);return m};var n,i=(n=r(8002))&&n.__esModule?n:{default:n},a=r(1807);var o={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};var s=Object.freeze({});function u(e,t,r){var n=e[t];if(n){if(!r&&"function"==typeof n)return n;var i=r?n.leave:n.enter;if("function"==typeof i)return i}else{var a=r?e.leave:e.enter;if(a){if("function"==typeof a)return a;var o=a[t];if("function"==typeof o)return o}}}},7636:(e,t,r)=>{"use strict";r.d(t,{$_:()=>o,Vn:()=>s});var n=r(6589),i=r(3059),a={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},o=Object.freeze({});function s(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,s=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,y=void 0,v=[],g=[],m=e;do{var b=++f===l.length,E=b&&0!==h.length;if(b){if(d=0===g.length?void 0:v[v.length-1],p=y,y=g.pop(),E){if(c)p=p.slice();else{for(var S={},C=0,w=Object.keys(p);C<w.length;C++){var T=w[C];S[T]=p[T]}p=S}for(var A=0,I=0;I<h.length;I++){var k=h[I][0],_=h[I][1];c&&(k-=A),c&&null===_?(p.splice(k,1),A++):p[k]=_}}f=s.index,l=s.keys,h=s.edits,c=s.inArray,s=s.prev}else{if(d=y?c?f:l[f]:void 0,null==(p=y?y[d]:m))continue;y&&v.push(d)}var B,N=void 0;if(!Array.isArray(p)){if(!(0,i.UG)(p))throw new Error("Invalid AST Node: ".concat((0,n.Z)(p),"."));var O=u(t,p.kind,b);if(O){if((N=O.call(t,p,d,y,v,g))===o)break;if(!1===N){if(!b){v.pop();continue}}else if(void 0!==N&&(h.push([d,N]),!b)){if(!(0,i.UG)(N)){v.pop();continue}p=N}}}if(void 0===N&&E&&h.push([d,p]),b)v.pop();else s={inArray:c,index:f,keys:l,edits:h,prev:s},l=(c=Array.isArray(p))?p:null!==(B=r[p.kind])&&void 0!==B?B:[],f=-1,h=[],y&&g.push(y),y=p}while(void 0!==s);return 0!==h.length&&(m=h[h.length-1][1]),m}function u(e,t,r){var n=e[t];if(n){if(!r&&"function"==typeof n)return n;var i=r?n.leave:n.enter;if("function"==typeof i)return i}else{var a=r?e.leave:e.enter;if(a){if("function"==typeof a)return a;var o=a[t];if("function"==typeof o)return o}}}},645:(e,t)=>{
|
15
|
+
e.exports=function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,a=void 0,o=void 0,s=function(e,t){E[i]=e,E[i+1]=t,2===(i+=2)&&(o?o(S):w())};function u(e){o=e}function c(e){s=e}var l="undefined"!=typeof window?window:void 0,f=l||{},h=f.MutationObserver||f.WebKitMutationObserver,p="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function y(){return function(){return process.nextTick(S)}}function v(){return void 0!==a?function(){a(S)}:b()}function g(){var e=0,t=new h(S),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function m(){var e=new MessageChannel;return e.port1.onmessage=S,function(){return e.port2.postMessage(0)}}function b(){var e=setTimeout;return function(){return e(S,1)}}var E=new Array(1e3);function S(){for(var e=0;e<i;e+=2)(0,E[e])(E[e+1]),E[e]=void 0,E[e+1]=void 0;i=0}function C(){try{var e=Function("return this")().require("vertx");return a=e.runOnLoop||e.runOnContext,v()}catch(e){return b()}}var w=void 0;function T(e,t){var r=this,n=new this.constructor(k);void 0===n[I]&&Q(n);var i=r._state;if(i){var a=arguments[i-1];s((function(){return q(i,n,a,r._result)}))}else K(r,n,e,t);return n}function A(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var r=new t(k);return L(r,e),r}w=p?y():h?g():d?m():void 0===l?C():b();var I=Math.random().toString(36).substring(2);function k(){}var _=void 0,B=1,N=2;function O(){return new TypeError("You cannot resolve a promise with itself")}function R(){return new TypeError("A promises callback cannot return that same promise.")}function x(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}function P(e,t,r){s((function(e){var n=!1,i=x(r,t,(function(r){n||(n=!0,t!==r?L(e,r):j(e,r))}),(function(t){n||(n=!0,V(e,t))}),"Settle: "+(e._label||" unknown promise"));!n&&i&&(n=!0,V(e,i))}),e)}function F(e,t){t._state===B?j(e,t._result):t._state===N?V(e,t._result):K(t,void 0,(function(t){return L(e,t)}),(function(t){return V(e,t)}))}function D(e,r,n){r.constructor===e.constructor&&n===T&&r.constructor.resolve===A?F(e,r):void 0===n?j(e,r):t(n)?P(e,r,n):j(e,r)}function L(t,r){if(t===r)V(t,O());else if(e(r)){var n=void 0;try{n=r.then}catch(e){return void V(t,e)}D(t,r,n)}else j(t,r)}function U(e){e._onerror&&e._onerror(e._result),M(e)}function j(e,t){e._state===_&&(e._result=t,e._state=B,0!==e._subscribers.length&&s(M,e))}function V(e,t){e._state===_&&(e._state=N,e._result=t,s(U,e))}function K(e,t,r,n){var i=e._subscribers,a=i.length;e._onerror=null,i[a]=t,i[a+B]=r,i[a+N]=n,0===a&&e._state&&s(M,e)}function M(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,i=void 0,a=e._result,o=0;o<t.length;o+=3)n=t[o],i=t[o+r],n?q(r,n,i,a):i(a);e._subscribers.length=0}}function q(e,r,n,i){var a=t(n),o=void 0,s=void 0,u=!0;if(a){try{o=n(i)}catch(e){u=!1,s=e}if(r===o)return void V(r,R())}else o=i;r._state!==_||(a&&u?L(r,o):!1===u?V(r,s):e===B?j(r,o):e===N&&V(r,o))}function z(e,t){try{t((function(t){L(e,t)}),(function(t){V(e,t)}))}catch(t){V(e,t)}}var H=0;function G(){return H++}function Q(e){e[I]=H++,e._state=void 0,e._result=void 0,e._subscribers=[]}function W(){return new Error("Array Methods must be provided an Array")}var Y=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(k),this.promise[I]||Q(this.promise),n(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&j(this.promise,this._result))):V(this.promise,W())}return e.prototype._enumerate=function(e){for(var t=0;this._state===_&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===A){var i=void 0,a=void 0,o=!1;try{i=e.then}catch(e){o=!0,a=e}if(i===T&&e._state!==_)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(r===te){var s=new r(k);o?V(s,a):D(s,e,i),this._willSettleAt(s,t)}else this._willSettleAt(new r((function(t){return t(e)})),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===_&&(this._remaining--,e===N?V(n,r):this._result[t]=r),0===this._remaining&&j(n,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;K(e,void 0,(function(e){return r._settledAt(B,t,e)}),(function(e){return r._settledAt(N,t,e)}))},e}();function Z(e){return new Y(this,e).promise}function J(e){var t=this;return n(e)?new t((function(r,n){for(var i=e.length,a=0;a<i;a++)t.resolve(e[a]).then(r,n)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))}function X(e){var t=new this(k);return V(t,e),t}function $(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function ee(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var te=function(){function e(t){this[I]=G(),this._result=this._state=void 0,this._subscribers=[],k!==t&&("function"!=typeof t&&$(),this instanceof e?z(this,t):ee())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var r=this,n=r.constructor;return t(e)?r.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):r.then(e,e)},e}();function re(){var e=void 0;if(void 0!==r.g)e=r.g;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=te}return te.prototype.then=T,te.all=Z,te.race=J,te.resolve=A,te.reject=X,te._setScheduler=u,te._setAsap=c,te._asap=s,te.polyfill=re,te.Promise=te,te}()},5035:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},a={key:n,value:e[n]};return r(i,a)}}),a=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,o;if(Array.isArray(t)){for(o="[",r=0;r<t.length;r++)r&&(o+=","),o+=e(t[r])||"null";return o+"]"}if(null===t)return"null";if(-1!==a.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=a.push(t)-1,u=Object.keys(t).sort(i&&i(t));for(o="",r=0;r<u.length;r++){var c=u[r],l=e(t[c]);l&&(o&&(o+=","),o+=JSON.stringify(c)+":"+l)}return a.splice(s,1),"{"+o+"}"}}(e)}},2527:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>ee});var n=r(655);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"function"==typeof Symbol&&null!=Symbol.iterator&&Symbol.iterator,"function"==typeof Symbol&&null!=Symbol.asyncIterator&&Symbol.asyncIterator;var a="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";function o(e,t){for(var r,n=/\r\n|[\n\r]/g,i=1,a=t+1;(r=n.exec(e.body))&&r.index<t;)i+=1,a=t+1-(r.index+r[0].length);return{line:i,column:a}}function s(e){return u(e.source,o(e.source,e.start))}function u(e,t){var r=e.locationOffset.column-1,n=l(r)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=1===t.line?r:0,u=t.column+s,f="".concat(e.name,":").concat(o,":").concat(u,"\n"),h=n.split(/\r\n|[\n\r]/g),p=h[i];if(p.length>120){for(var d=Math.floor(u/80),y=u%80,v=[],g=0;g<p.length;g+=80)v.push(p.slice(g,g+80));return f+c([["".concat(o),v[0]]].concat(v.slice(1,d+1).map((function(e){return["",e]})),[[" ",l(y-1)+"^"],["",v[d+1]]]))}return f+c([["".concat(o-1),h[i-1]],["".concat(o),p],["",l(u-1)+"^"],["".concat(o+1),h[i+1]]])}function c(e){var t=e.filter((function(e){e[0];return void 0!==e[1]})),r=Math.max.apply(Math,t.map((function(e){return e[0].length})));return t.map((function(e){var t,n=e[0],i=e[1];return l(r-(t=n).length)+t+(i?" | "+i:" |")})).join("\n")}function l(e){return Array(e+1).join(" ")}function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?d(e):t}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){var t="function"==typeof Map?new Map:void 0;return(y=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return v(e,arguments,b(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),m(n,e)})(e)}function v(e,t,r){return(v=g()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&m(i,r.prototype),i}).apply(null,arguments)}function g(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(y,e);var t,r,n,c,l,f=(t=y,r=g(),function(){var e,n=b(t);if(r){var i=b(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return p(this,e)});function y(e,t,r,n,a,s,u){var c,l,h,v,g;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),g=f.call(this,e);var m,b=Array.isArray(t)?0!==t.length?t:void 0:t?[t]:void 0,E=r;!E&&b&&(E=null===(m=b[0].loc)||void 0===m?void 0:m.source);var S,C=n;!C&&b&&(C=b.reduce((function(e,t){return t.loc&&e.push(t.loc.start),e}),[])),C&&0===C.length&&(C=void 0),n&&r?S=n.map((function(e){return o(r,e)})):b&&(S=b.reduce((function(e,t){return t.loc&&e.push(o(t.loc.source,t.loc.start)),e}),[]));var w,T=u;if(null==T&&null!=s){var A=s.extensions;"object"==i(w=A)&&null!==w&&(T=A)}return Object.defineProperties(d(g),{name:{value:"GraphQLError"},message:{value:e,enumerable:!0,writable:!0},locations:{value:null!==(c=S)&&void 0!==c?c:void 0,enumerable:null!=S},path:{value:null!=a?a:void 0,enumerable:null!=a},nodes:{value:null!=b?b:void 0},source:{value:null!==(l=E)&&void 0!==l?l:void 0},positions:{value:null!==(h=C)&&void 0!==h?h:void 0},originalError:{value:s},extensions:{value:null!==(v=T)&&void 0!==v?v:void 0,enumerable:null!=T}}),null!=s&&s.stack?(Object.defineProperty(d(g),"stack",{value:s.stack,writable:!0,configurable:!0}),p(g)):(Error.captureStackTrace?Error.captureStackTrace(d(g),y):Object.defineProperty(d(g),"stack",{value:Error().stack,writable:!0,configurable:!0}),g)}return n=y,(c=[{key:"toString",value:function(){return function(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r<n.length;r++){var i=n[r];i.loc&&(t+="\n\n"+s(i.loc))}else if(e.source&&e.locations)for(var a=0,o=e.locations;a<o.length;a++){var c=o[a];t+="\n\n"+u(e.source,c)}return t}(this)}},{key:a,get:function(){return"Object"}}])&&h(n.prototype,c),l&&h(n,l),y}(y(Error));function S(e,t,r){return new E("Syntax Error: ".concat(r),void 0,e,[t])}var C=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"}),w=r(3059),T=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),A=r(6589);function I(e,t){if(!Boolean(e))throw new Error(t)}const k=function(e,t){return e instanceof t};function _(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var B=function(){function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||I(0,"Body must be a string. Received: ".concat((0,A.Z)(e),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||I(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||I(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r,n;return t=e,(r=[{key:a,get:function(){return"Source"}}])&&_(t.prototype,r),n&&_(t,n),e}();var N=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"}),O=r(7420),R=function(){function e(e){var t=new w.WU(T.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==T.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=P(this,e)}while(e.kind===T.COMMENT);return e},e}();function x(e){return isNaN(e)?T.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function P(e,t){for(var r=e.source,n=r.body,i=n.length,a=t.end;a<i;){var o=n.charCodeAt(a),s=e.line,u=1+a-e.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++e.line,e.lineStart=a;continue;case 13:10===n.charCodeAt(a+1)?a+=2:++a,++e.line,e.lineStart=a;continue;case 33:return new w.WU(T.BANG,a,a+1,s,u,t);case 35:return D(r,a,s,u,t);case 36:return new w.WU(T.DOLLAR,a,a+1,s,u,t);case 38:return new w.WU(T.AMP,a,a+1,s,u,t);case 40:return new w.WU(T.PAREN_L,a,a+1,s,u,t);case 41:return new w.WU(T.PAREN_R,a,a+1,s,u,t);case 46:if(46===n.charCodeAt(a+1)&&46===n.charCodeAt(a+2))return new w.WU(T.SPREAD,a,a+3,s,u,t);break;case 58:return new w.WU(T.COLON,a,a+1,s,u,t);case 61:return new w.WU(T.EQUALS,a,a+1,s,u,t);case 64:return new w.WU(T.AT,a,a+1,s,u,t);case 91:return new w.WU(T.BRACKET_L,a,a+1,s,u,t);case 93:return new w.WU(T.BRACKET_R,a,a+1,s,u,t);case 123:return new w.WU(T.BRACE_L,a,a+1,s,u,t);case 124:return new w.WU(T.PIPE,a,a+1,s,u,t);case 125:return new w.WU(T.BRACE_R,a,a+1,s,u,t);case 34:return 34===n.charCodeAt(a+1)&&34===n.charCodeAt(a+2)?V(r,a,s,u,t,e):j(r,a,s,u,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return L(r,a,o,s,u,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return M(r,a,s,u,t)}throw S(r,a,F(o))}var c=e.line,l=1+a-e.lineStart;return new w.WU(T.EOF,i,i,c,l,t)}function F(e){return e<32&&9!==e&&10!==e&&13!==e?"Cannot contain the invalid character ".concat(x(e),"."):39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character ".concat(x(e),".")}function D(e,t,r,n,i){var a,o=e.body,s=t;do{a=o.charCodeAt(++s)}while(!isNaN(a)&&(a>31||9===a));return new w.WU(T.COMMENT,t,s,r,n,i,o.slice(t+1,s))}function L(e,t,r,n,i,a){var o=e.body,s=r,u=t,c=!1;if(45===s&&(s=o.charCodeAt(++u)),48===s){if((s=o.charCodeAt(++u))>=48&&s<=57)throw S(e,u,"Invalid number, unexpected digit after 0: ".concat(x(s),"."))}else u=U(e,u,s),s=o.charCodeAt(u);if(46===s&&(c=!0,s=o.charCodeAt(++u),u=U(e,u,s),s=o.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=o.charCodeAt(++u))&&45!==s||(s=o.charCodeAt(++u)),u=U(e,u,s),s=o.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw S(e,u,"Invalid number, expected digit but got: ".concat(x(s),"."));return new w.WU(c?T.FLOAT:T.INT,t,u,n,i,a,o.slice(t,u))}function U(e,t,r){var n=e.body,i=t,a=r;if(a>=48&&a<=57){do{a=n.charCodeAt(++i)}while(a>=48&&a<=57);return i}throw S(e,i,"Invalid number, expected digit but got: ".concat(x(a),"."))}function j(e,t,r,n,i){for(var a,o,s,u,c=e.body,l=t+1,f=l,h=0,p="";l<c.length&&!isNaN(h=c.charCodeAt(l))&&10!==h&&13!==h;){if(34===h)return p+=c.slice(f,l),new w.WU(T.STRING,t,l+1,r,n,i,p);if(h<32&&9!==h)throw S(e,l,"Invalid character within String: ".concat(x(h),"."));if(++l,92===h){switch(p+=c.slice(f,l-1),h=c.charCodeAt(l)){case 34:p+='"';break;case 47:p+="/";break;case 92:p+="\\";break;case 98:p+="\b";break;case 102:p+="\f";break;case 110:p+="\n";break;case 114:p+="\r";break;case 116:p+="\t";break;case 117:var d=(a=c.charCodeAt(l+1),o=c.charCodeAt(l+2),s=c.charCodeAt(l+3),u=c.charCodeAt(l+4),K(a)<<12|K(o)<<8|K(s)<<4|K(u));if(d<0){var y=c.slice(l+1,l+5);throw S(e,l,"Invalid character escape sequence: \\u".concat(y,"."))}p+=String.fromCharCode(d),l+=4;break;default:throw S(e,l,"Invalid character escape sequence: \\".concat(String.fromCharCode(h),"."))}f=++l}}throw S(e,l,"Unterminated string.")}function V(e,t,r,n,i,a){for(var o=e.body,s=t+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(34===c&&34===o.charCodeAt(s+1)&&34===o.charCodeAt(s+2))return l+=o.slice(u,s),new w.WU(T.BLOCK_STRING,t,s+3,r,n,i,(0,O.W7)(l));if(c<32&&9!==c&&10!==c&&13!==c)throw S(e,s,"Invalid character within String: ".concat(x(c),"."));10===c?(++s,++a.line,a.lineStart=s):13===c?(10===o.charCodeAt(s+1)?s+=2:++s,++a.line,a.lineStart=s):92===c&&34===o.charCodeAt(s+1)&&34===o.charCodeAt(s+2)&&34===o.charCodeAt(s+3)?(l+=o.slice(u,s)+'"""',u=s+=4):++s}throw S(e,s,"Unterminated string.")}function K(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function M(e,t,r,n,i){for(var a=e.body,o=a.length,s=t+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new w.WU(T.NAME,t,s,r,n,i,a.slice(t,s))}var q=function(){function e(e,t){var r=function(e){return k(e,B)}(e)?e:new B(e);this._lexer=new R(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(T.NAME);return{kind:C.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:C.DOCUMENT,definitions:this.many(T.SOF,this.parseDefinition,T.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(T.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(T.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(T.BRACE_L))return{kind:C.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(T.NAME)&&(t=this.parseName()),{kind:C.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(T.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(T.PAREN_L,this.parseVariableDefinition,T.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:C.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(T.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(T.DOLLAR),{kind:C.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:C.SELECTION_SET,selections:this.many(T.BRACE_L,this.parseSelection,T.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(T.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(T.COLON)?(e=n,t=this.parseName()):t=n,{kind:C.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(T.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(T.PAREN_L,t,T.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(T.COLON),{kind:C.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:C.ARGUMENT,name:this.parseName(),value:(this.expectToken(T.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(T.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(T.NAME)?{kind:C.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:C.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case T.BRACKET_L:return this.parseList(e);case T.BRACE_L:return this.parseObject(e);case T.INT:return this._lexer.advance(),{kind:C.INT,value:t.value,loc:this.loc(t)};case T.FLOAT:return this._lexer.advance(),{kind:C.FLOAT,value:t.value,loc:this.loc(t)};case T.STRING:case T.BLOCK_STRING:return this.parseStringLiteral();case T.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:C.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:C.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:C.NULL,loc:this.loc(t)};default:return{kind:C.ENUM,value:t.value,loc:this.loc(t)}}case T.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:C.STRING,value:e.value,block:e.kind===T.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:C.LIST,values:this.any(T.BRACKET_L,(function(){return t.parseValueLiteral(e)}),T.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:C.OBJECT,fields:this.any(T.BRACE_L,(function(){return t.parseObjectField(e)}),T.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(T.COLON),{kind:C.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(T.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(T.AT),{kind:C.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(T.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(T.BRACKET_R),e={kind:C.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(T.BANG)?{kind:C.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:C.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(T.STRING)||this.peek(T.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);return{kind:C.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(T.COLON);var r=this.parseNamedType();return{kind:C.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(T.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(T.AMP)||this.peek(T.NAME));return t}return this.delimitedMany(T.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(T.BRACE_L)&&this._lexer.lookahead().kind===T.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(T.BRACE_L,this.parseFieldDefinition,T.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(T.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:C.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:a,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(T.PAREN_L,this.parseInputValueDef,T.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(T.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(T.EQUALS)&&(n=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:C.INPUT_VALUE_DEFINITION,description:t,name:r,type:i,defaultValue:n,directives:a,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:C.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(T.EQUALS)?this.delimitedMany(T.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:C.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseEnumValueDefinition,T.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:C.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseInputValueDef,T.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),r=this.optionalMany(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:C.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:C.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.UNION_TYPE_EXTENSION,name:t,directives:r,types:n,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(T.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:C.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:a,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(T.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==N[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new w.Ye(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw S(this._lexer.source,t.start,"Expected ".concat(H(e),", found ").concat(z(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==T.NAME||t.value!==e)throw S(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(z(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===T.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return S(this._lexer.source,t.start,"Unexpected ".concat(z(t),"."))},t.any=function(e,t,r){this.expectToken(e);for(var n=[];!this.expectOptionalToken(r);)n.push(t.call(this));return n},t.optionalMany=function(e,t,r){if(this.expectOptionalToken(e)){var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}return[]},t.many=function(e,t,r){this.expectToken(e);var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r},e}();function z(e){var t=e.value;return H(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function H(e){return function(e){return e===T.BANG||e===T.DOLLAR||e===T.AMP||e===T.PAREN_L||e===T.PAREN_R||e===T.SPREAD||e===T.COLON||e===T.EQUALS||e===T.AT||e===T.BRACKET_L||e===T.BRACKET_R||e===T.BRACE_L||e===T.PIPE||e===T.BRACE_R}(e)?'"'.concat(e,'"'):e}var G=new Map,Q=new Map,W=!0,Y=!1;function Z(e){return e.replace(/[\s,]+/g," ").trim()}function J(e){var t=new Set,r=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var n=e.name.value,i=Z((o=e.loc).source.body.substring(o.start,o.end)),a=Q.get(n);a&&!a.has(i)?W&&console.warn("Warning: fragment with name "+n+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):a||Q.set(n,a=new Set),a.add(i),t.has(i)||(t.add(i),r.push(e))}else r.push(e);var o})),(0,n.pi)((0,n.pi)({},e),{definitions:r})}function X(e){var t=Z(e);if(!G.has(t)){var r=function(e,t){return new q(e,t).parseDocument()}(e,{experimentalFragmentVariables:Y});if(!r||"Document"!==r.kind)throw new Error("Not a valid GraphQL document.");G.set(t,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)}))}));var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}(J(r)))}return G.get(t)}function $(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach((function(t,r){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[r+1]})),X(n)}const ee=Object.assign($,{gql:$,default:$,resetCaches:function(){G.clear(),Q.clear()},disableFragmentWarnings:function(){W=!1},enableExperimentalFragmentVariables:function(){Y=!0},disableExperimentalFragmentVariables:function(){Y=!1}})},4206:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetElectionLogEntries"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"types"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"election"},arguments:[{kind:"Argument",name:{kind:"Name",value:"uniqueId"},value:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"logEntries"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"Variable",name:{kind:"Name",value:"types"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"messageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"chainedHash"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:260}};t.loc.source={body:"query GetElectionLogEntries(\n $electionUniqueId: String!\n $after: String\n $types: [String!]\n) {\n election(uniqueId: $electionUniqueId) {\n logEntries(after: $after, types: $types) {\n id\n messageId\n signedData\n chainedHash\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.GetElectionLogEntries=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetElectionLogEntries")},5073:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetLogEntry"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"contentHash"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"logEntry"},arguments:[{kind:"Argument",name:{kind:"Name",value:"electionUniqueId"},value:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}}},{kind:"Argument",name:{kind:"Name",value:"contentHash"},value:{kind:"Variable",name:{kind:"Name",value:"contentHash"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"messageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contentHash"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:199}};t.loc.source={body:"query GetLogEntry($electionUniqueId: String!, $contentHash: String!) {\n logEntry(electionUniqueId: $electionUniqueId, contentHash: $contentHash) {\n messageId\n signedData\n contentHash\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.GetLogEntry=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetLogEntry")},5053:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetPendingMessageByMessageId"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:117}};t.loc.source={body:"query GetPendingMessageByMessageId($messageId: String!) {\n pendingMessage(messageId: $messageId) {\n status\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.GetPendingMessageByMessageId=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetPendingMessageByMessageId")},9120:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProcessKeyCeremonyStep"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"signedData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"processKeyCeremonyStep"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}},{kind:"Argument",name:{kind:"Name",value:"signedData"},value:{kind:"Variable",name:{kind:"Name",value:"signedData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:212}};t.loc.source={body:"mutation ProcessKeyCeremonyStep($messageId: String!, $signedData: String!) {\n processKeyCeremonyStep(messageId: $messageId, signedData: $signedData) {\n pendingMessage {\n signedData\n }\n error\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.ProcessKeyCeremonyStep=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"ProcessKeyCeremonyStep")},1798:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProcessTallyStep"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"signedData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"processTallyStep"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}},{kind:"Argument",name:{kind:"Name",value:"signedData"},value:{kind:"Variable",name:{kind:"Name",value:"signedData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:200}};t.loc.source={body:"mutation ProcessTallyStep($messageId: String!, $signedData: String!) {\n processTallyStep(messageId: $messageId, signedData: $signedData) {\n pendingMessage {\n signedData\n }\n error\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.ProcessTallyStep=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"ProcessTallyStep")},972:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,n.default)(0),e.prototype.inspect=t,i.default&&(e.prototype[i.default]=t)};var n=a(r(7706)),i=a(r(8554));function a(e){return e&&e.__esModule?e:{default:e}}},8002:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return o(e,[])};var n,i=(n=r(8554))&&n.__esModule?n:{default:n};function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){switch(a(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(i.default)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==n){var a=n.call(e);if(a!==e)return"string"==typeof a?a:o(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a<r;++a)i.push(o(e[a],t));1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]";return"{ "+r.map((function(r){return r+": "+o(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},6589:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(7986);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return o(e,[])}function o(e,t){switch(i(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),i=function(e){var t=e[String(n.Z)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==i){var a=i.call(e);if(a!==e)return"string"==typeof a?a:o(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a<r;++a)i.push(o(e[a],t));1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]";return"{ "+r.map((function(r){return r+": "+o(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},7706:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},8554:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.default=r},7986:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0},1807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=function(e){return null!=e&&"string"==typeof e.kind},t.Token=t.Location=void 0;var n,i=(n=r(972))&&n.__esModule?n:{default:n};var a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();t.Location=a,(0,i.default)(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();t.Token=o,(0,i.default)(o)},3059:(e,t,r)=>{"use strict";r.d(t,{Ye:()=>a,WU:()=>o,UG:()=>s});var n=r(7986);function i(e){var t=e.prototype.toJSON;"function"==typeof t||function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}(0),e.prototype.inspect=t,n.Z&&(e.prototype[n.Z]=t)}var a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();i(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function s(e){return null!=e&&"string"==typeof e.kind}i(o)},7420:(e,t,r)=>{"use strict";function n(e){var t=e.split(/\r\n|[\n\r]/g),r=function(e){for(var t,r=!0,n=!0,i=0,a=null,o=0;o<e.length;++o)switch(e.charCodeAt(o)){case 13:10===e.charCodeAt(o+1)&&++o;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(null===a||i<a)&&(a=i),n=!1}return null!==(t=a)&&void 0!==t?t:0}(e);if(0!==r)for(var n=1;n<t.length;n++)t[n]=t[n].slice(r);for(var a=0;a<t.length&&i(t[a]);)++a;for(var o=t.length;o>a&&i(t[o-1]);)--o;return t.slice(a,o).join("\n")}function i(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],a='"'===e[e.length-1],o="\\"===e[e.length-1],s=!n||a||o||r,u="";return!s||n&&i||(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}r.d(t,{W7:()=>n,LZ:()=>a})},285:(e,t,r)=>{"use strict";t.Vn=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,y=void 0,v=[],g=[],m=e;do{var b=++f===l.length,E=b&&0!==h.length;if(b){if(d=0===g.length?void 0:v[v.length-1],p=y,y=g.pop(),E){if(c)p=p.slice();else{for(var S={},C=0,w=Object.keys(p);C<w.length;C++){var T=w[C];S[T]=p[T]}p=S}for(var A=0,I=0;I<h.length;I++){var k=h[I][0],_=h[I][1];c&&(k-=A),c&&null===_?(p.splice(k,1),A++):p[k]=_}}f=n.index,l=n.keys,h=n.edits,c=n.inArray,n=n.prev}else{if(d=y?c?f:l[f]:void 0,null==(p=y?y[d]:m))continue;y&&v.push(d)}var B,N=void 0;if(!Array.isArray(p)){if(!(0,a.isNode)(p))throw new Error("Invalid AST Node: ".concat((0,i.default)(p),"."));var O=u(t,p.kind,b);if(O){if((N=O.call(t,p,d,y,v,g))===s)break;if(!1===N){if(!b){v.pop();continue}}else if(void 0!==N&&(h.push([d,N]),!b)){if(!(0,a.isNode)(N)){v.pop();continue}p=N}}}if(void 0===N&&E&&h.push([d,p]),b)v.pop();else n={inArray:c,index:f,keys:l,edits:h,prev:n},c=Array.isArray(p),l=c?p:null!==(B=r[p.kind])&&void 0!==B?B:[],f=-1,h=[],y&&g.push(y),y=p}while(void 0!==n);0!==h.length&&(m=h[h.length-1][1]);return m};var n,i=(n=r(8002))&&n.__esModule?n:{default:n},a=r(1807);var o={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};var s=Object.freeze({});function u(e,t,r){var n=e[t];if(n){if(!r&&"function"==typeof n)return n;var i=r?n.leave:n.enter;if("function"==typeof i)return i}else{var a=r?e.leave:e.enter;if(a){if("function"==typeof a)return a;var o=a[t];if("function"==typeof o)return o}}}},7636:(e,t,r)=>{"use strict";r.d(t,{$_:()=>o,Vn:()=>s});var n=r(6589),i=r(3059),a={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},o=Object.freeze({});function s(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,s=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,y=void 0,v=[],g=[],m=e;do{var b=++f===l.length,E=b&&0!==h.length;if(b){if(d=0===g.length?void 0:v[v.length-1],p=y,y=g.pop(),E){if(c)p=p.slice();else{for(var S={},C=0,w=Object.keys(p);C<w.length;C++){var T=w[C];S[T]=p[T]}p=S}for(var A=0,I=0;I<h.length;I++){var k=h[I][0],_=h[I][1];c&&(k-=A),c&&null===_?(p.splice(k,1),A++):p[k]=_}}f=s.index,l=s.keys,h=s.edits,c=s.inArray,s=s.prev}else{if(d=y?c?f:l[f]:void 0,null==(p=y?y[d]:m))continue;y&&v.push(d)}var B,N=void 0;if(!Array.isArray(p)){if(!(0,i.UG)(p))throw new Error("Invalid AST Node: ".concat((0,n.Z)(p),"."));var O=u(t,p.kind,b);if(O){if((N=O.call(t,p,d,y,v,g))===o)break;if(!1===N){if(!b){v.pop();continue}}else if(void 0!==N&&(h.push([d,N]),!b)){if(!(0,i.UG)(N)){v.pop();continue}p=N}}}if(void 0===N&&E&&h.push([d,p]),b)v.pop();else s={inArray:c,index:f,keys:l,edits:h,prev:s},l=(c=Array.isArray(p))?p:null!==(B=r[p.kind])&&void 0!==B?B:[],f=-1,h=[],y&&g.push(y),y=p}while(void 0!==s);return 0!==h.length&&(m=h[h.length-1][1]),m}function u(e,t,r){var n=e[t];if(n){if(!r&&"function"==typeof n)return n;var i=r?n.leave:n.enter;if("function"==typeof i)return i}else{var a=r?e.leave:e.enter;if(a){if("function"==typeof a)return a;var o=a[t];if("function"==typeof o)return o}}}},645:(e,t)=>{
|
16
16
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
17
17
|
t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,p=e[t+f];for(f+=h,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=h,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,c=8*a-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+p]=255&o,p+=d,o/=256,c-=8);e[r+p-d]|=128*y}},8552:(e,t,r)=>{var n=r(852)(r(5639),"DataView");e.exports=n},1989:(e,t,r)=>{var n=r(1789),i=r(401),a=r(7667),o=r(1327),s=r(1866);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},6425:(e,t,r)=>{var n=r(3118),i=r(9435);function a(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}a.prototype=n(i.prototype),a.prototype.constructor=a,e.exports=a},8407:(e,t,r)=>{var n=r(7040),i=r(4125),a=r(2117),o=r(7518),s=r(4705);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},7548:(e,t,r)=>{var n=r(3118),i=r(9435);function a(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}a.prototype=n(i.prototype),a.prototype.constructor=a,e.exports=a},7071:(e,t,r)=>{var n=r(852)(r(5639),"Map");e.exports=n},3369:(e,t,r)=>{var n=r(4785),i=r(1285),a=r(6e3),o=r(9916),s=r(5265);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},3818:(e,t,r)=>{var n=r(852)(r(5639),"Promise");e.exports=n},8525:(e,t,r)=>{var n=r(852)(r(5639),"Set");e.exports=n},8668:(e,t,r)=>{var n=r(3369),i=r(619),a=r(2385);function o(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}o.prototype.add=o.prototype.push=i,o.prototype.has=a,e.exports=o},6384:(e,t,r)=>{var n=r(8407),i=r(7465),a=r(3779),o=r(7599),s=r(4758),u=r(4309);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=a,c.prototype.get=o,c.prototype.has=s,c.prototype.set=u,e.exports=c},2705:(e,t,r)=>{var n=r(5639).Symbol;e.exports=n},1149:(e,t,r)=>{var n=r(5639).Uint8Array;e.exports=n},577:(e,t,r)=>{var n=r(852)(r(5639),"WeakMap");e.exports=n},6874:e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},7412:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},4963:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}},7443:(e,t,r)=>{var n=r(2118);e.exports=function(e,t){return!!(null==e?0:e.length)&&n(e,t,0)>-1}},1196:e=>{e.exports=function(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}},4636:(e,t,r)=>{var n=r(2545),i=r(5694),a=r(1469),o=r(4144),s=r(5776),u=r(6719),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=a(e),l=!r&&i(e),f=!r&&!l&&o(e),h=!r&&!l&&!f&&u(e),p=r||l||f||h,d=p?n(e.length,String):[],y=d.length;for(var v in e)!t&&!c.call(e,v)||p&&("length"==v||f&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,y))||d.push(v);return d}},9932:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}},2488:e=>{e.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},6556:(e,t,r)=>{var n=r(9465),i=r(7813);e.exports=function(e,t,r){(void 0!==r&&!i(e[t],r)||void 0===r&&!(t in e))&&n(e,t,r)}},4865:(e,t,r)=>{var n=r(9465),i=r(7813),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var o=e[t];a.call(e,t)&&i(o,r)&&(void 0!==r||t in e)||n(e,t,r)}},8470:(e,t,r)=>{var n=r(7813);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},4037:(e,t,r)=>{var n=r(8363),i=r(3674);e.exports=function(e,t){return e&&n(t,i(t),e)}},3886:(e,t,r)=>{var n=r(8363),i=r(1704);e.exports=function(e,t){return e&&n(t,i(t),e)}},9465:(e,t,r)=>{var n=r(8777);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},9750:e=>{e.exports=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}},5990:(e,t,r)=>{var n=r(6384),i=r(7412),a=r(4865),o=r(4037),s=r(3886),u=r(4626),c=r(278),l=r(8805),f=r(1911),h=r(8234),p=r(6904),d=r(4160),y=r(3824),v=r(9148),g=r(8517),m=r(1469),b=r(4144),E=r(6688),S=r(3218),C=r(2928),w=r(3674),T=r(1704),A="[object Arguments]",I="[object Function]",k="[object Object]",_={};_[A]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object DataView]"]=_["[object Boolean]"]=_["[object Date]"]=_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Map]"]=_["[object Number]"]=_[k]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object Symbol]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_["[object Error]"]=_[I]=_["[object WeakMap]"]=!1,e.exports=function e(t,r,B,N,O,R){var x,P=1&r,F=2&r,D=4&r;if(B&&(x=O?B(t,N,O,R):B(t)),void 0!==x)return x;if(!S(t))return t;var L=m(t);if(L){if(x=y(t),!P)return c(t,x)}else{var U=d(t),j=U==I||"[object GeneratorFunction]"==U;if(b(t))return u(t,P);if(U==k||U==A||j&&!O){if(x=F||j?{}:g(t),!P)return F?f(t,s(x,t)):l(t,o(x,t))}else{if(!_[U])return O?t:{};x=v(t,U,P)}}R||(R=new n);var V=R.get(t);if(V)return V;R.set(t,x),C(t)?t.forEach((function(n){x.add(e(n,r,B,n,t,R))})):E(t)&&t.forEach((function(n,i){x.set(i,e(n,r,B,i,t,R))}));var K=L?void 0:(D?F?p:h:F?T:w)(t);return i(K||t,(function(n,i){K&&(n=t[i=n]),a(x,i,e(n,r,B,i,t,R))})),x}},3118:(e,t,r)=>{var n=r(3218),i=Object.create,a=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=a},5082:(e,t,r)=>{var n=r(554),i=r(8958);e.exports=function(e,t,r,a){var o=e.length;for((r=n(r))<0&&(r=-r>o?0:o+r),(a=void 0===a||a>o?o:n(a))<0&&(a+=o),a=r>a?0:i(a);r<a;)e[r++]=t;return e}},1848:e=>{e.exports=function(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}},1078:(e,t,r)=>{var n=r(2488),i=r(7285);e.exports=function e(t,r,a,o,s){var u=-1,c=t.length;for(a||(a=i),s||(s=[]);++u<c;){var l=t[u];r>0&&a(l)?r>1?e(l,r-1,a,o,s):n(s,l):o||(s[s.length]=l)}return s}},8483:(e,t,r)=>{var n=r(5063)();e.exports=n},7786:(e,t,r)=>{var n=r(1811),i=r(327);e.exports=function(e,t){for(var r=0,a=(t=n(t,e)).length;null!=e&&r<a;)e=e[i(t[r++])];return r&&r==a?e:void 0}},8866:(e,t,r)=>{var n=r(2488),i=r(1469);e.exports=function(e,t,r){var a=t(e);return i(e)?a:n(a,r(e))}},4239:(e,t,r)=>{var n=r(2705),i=r(9607),a=r(2333),o=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):a(e)}},13:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},2118:(e,t,r)=>{var n=r(1848),i=r(2722),a=r(2351);e.exports=function(e,t,r){return t==t?a(e,t,r):n(e,i,r)}},7556:(e,t,r)=>{var n=r(8668),i=r(7443),a=r(1196),o=r(9932),s=r(1717),u=r(4757),c=Math.min;e.exports=function(e,t,r){for(var l=r?a:i,f=e[0].length,h=e.length,p=h,d=Array(h),y=1/0,v=[];p--;){var g=e[p];p&&t&&(g=o(g,s(t))),y=c(g.length,y),d[p]=!r&&(t||f>=120&&g.length>=120)?new n(p&&g):void 0}g=e[0];var m=-1,b=d[0];e:for(;++m<f&&v.length<y;){var E=g[m],S=t?t(E):E;if(E=r||0!==E?E:0,!(b?u(b,S):l(v,S,r))){for(p=h;--p;){var C=d[p];if(!(C?u(C,S):l(e[p],S,r)))continue e}b&&b.push(S),v.push(E)}}return v}},9454:(e,t,r)=>{var n=r(4239),i=r(7005);e.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},5588:(e,t,r)=>{var n=r(4160),i=r(7005);e.exports=function(e){return i(e)&&"[object Map]"==n(e)}},2722:e=>{e.exports=function(e){return e!=e}},8458:(e,t,r)=>{var n=r(3560),i=r(5346),a=r(3218),o=r(346),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,f=c.hasOwnProperty,h=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||i(e))&&(n(e)?h:s).test(o(e))}},9221:(e,t,r)=>{var n=r(4160),i=r(7005);e.exports=function(e){return i(e)&&"[object Set]"==n(e)}},8749:(e,t,r)=>{var n=r(4239),i=r(1780),a=r(7005),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&i(e.length)&&!!o[n(e)]}},280:(e,t,r)=>{var n=r(5726),i=r(6916),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))a.call(e,r)&&"constructor"!=r&&t.push(r);return t}},313:(e,t,r)=>{var n=r(3218),i=r(5726),a=r(3498),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return a(e);var t=i(e),r=[];for(var s in e)("constructor"!=s||!t&&o.call(e,s))&&r.push(s);return r}},9435:e=>{e.exports=function(){}},2980:(e,t,r)=>{var n=r(6384),i=r(6556),a=r(8483),o=r(9783),s=r(3218),u=r(1704),c=r(6390);e.exports=function e(t,r,l,f,h){t!==r&&a(r,(function(a,u){if(h||(h=new n),s(a))o(t,r,u,l,e,f,h);else{var p=f?f(c(t,u),a,u+"",t,r,h):void 0;void 0===p&&(p=a),i(t,u,p)}}),u)}},9783:(e,t,r)=>{var n=r(6556),i=r(4626),a=r(7133),o=r(278),s=r(8517),u=r(5694),c=r(1469),l=r(9246),f=r(4144),h=r(3560),p=r(3218),d=r(8630),y=r(6719),v=r(6390),g=r(9881);e.exports=function(e,t,r,m,b,E,S){var C=v(e,r),w=v(t,r),T=S.get(w);if(T)n(e,r,T);else{var A=E?E(C,w,r+"",e,t,S):void 0,I=void 0===A;if(I){var k=c(w),_=!k&&f(w),B=!k&&!_&&y(w);A=w,k||_||B?c(C)?A=C:l(C)?A=o(C):_?(I=!1,A=i(w,!0)):B?(I=!1,A=a(w,!0)):A=[]:d(w)||u(w)?(A=C,u(C)?A=g(C):p(C)&&!h(C)||(A=s(w))):I=!1}I&&(S.set(w,A),b(A,w,m,E,S),S.delete(w)),n(e,r,A)}}},5970:(e,t,r)=>{var n=r(3012),i=r(9095);e.exports=function(e,t){return n(e,t,(function(t,r){return i(e,r)}))}},3012:(e,t,r)=>{var n=r(7786),i=r(611),a=r(1811);e.exports=function(e,t,r){for(var o=-1,s=t.length,u={};++o<s;){var c=t[o],l=n(e,c);r(l,c)&&i(u,a(c,e),l)}return u}},5976:(e,t,r)=>{var n=r(6557),i=r(5357),a=r(61);e.exports=function(e,t){return a(i(e,t,n),e+"")}},611:(e,t,r)=>{var n=r(4865),i=r(1811),a=r(5776),o=r(3218),s=r(327);e.exports=function(e,t,r,u){if(!o(e))return e;for(var c=-1,l=(t=i(t,e)).length,f=l-1,h=e;null!=h&&++c<l;){var p=s(t[c]),d=r;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(c!=f){var y=h[p];void 0===(d=u?u(y,p,h):void 0)&&(d=o(y)?y:a(t[c+1])?[]:{})}n(h,p,d),h=h[p]}return e}},8045:(e,t,r)=>{var n=r(6557),i=r(9250),a=i?function(e,t){return i.set(e,t),e}:n;e.exports=a},6560:(e,t,r)=>{var n=r(5703),i=r(8777),a=r(6557),o=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:a;e.exports=o},4259:e=>{e.exports=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n<i;)a[n]=e[n+t];return a}},2545:e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},531:(e,t,r)=>{var n=r(2705),i=r(9932),a=r(1469),o=r(3448),s=n?n.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return i(t,e)+"";if(o(t))return u?u.call(t):"";var r=t+"";return"0"==r&&1/t==-Infinity?"-0":r}},7561:(e,t,r)=>{var n=r(7990),i=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(i,""):e}},1717:e=>{e.exports=function(e){return function(t){return e(t)}}},5652:(e,t,r)=>{var n=r(8668),i=r(7443),a=r(1196),o=r(4757),s=r(3593),u=r(1814);e.exports=function(e,t,r){var c=-1,l=i,f=e.length,h=!0,p=[],d=p;if(r)h=!1,l=a;else if(f>=200){var y=t?null:s(e);if(y)return u(y);h=!1,l=o,d=new n}else d=t?[]:p;e:for(;++c<f;){var v=e[c],g=t?t(v):v;if(v=r||0!==v?v:0,h&&g==g){for(var m=d.length;m--;)if(d[m]===g)continue e;t&&d.push(g),p.push(v)}else l(d,g,r)||(d!==p&&d.push(g),p.push(v))}return p}},7406:(e,t,r)=>{var n=r(1811),i=r(928),a=r(292),o=r(327);e.exports=function(e,t){return t=n(t,e),null==(e=a(e,t))||delete e[o(i(t))]}},4757:e=>{e.exports=function(e,t){return e.has(t)}},4387:(e,t,r)=>{var n=r(9246);e.exports=function(e){return n(e)?e:[]}},1811:(e,t,r)=>{var n=r(1469),i=r(5403),a=r(5514),o=r(9833);e.exports=function(e,t){return n(e)?e:i(e,t)?[e]:a(o(e))}},4318:(e,t,r)=>{var n=r(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},4626:(e,t,r)=>{e=r.nmd(e);var n=r(5639),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i?n.Buffer:void 0,s=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}},7157:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},3147:e=>{var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},419:(e,t,r)=>{var n=r(2705),i=n?n.prototype:void 0,a=i?i.valueOf:void 0;e.exports=function(e){return a?Object(a.call(e)):{}}},7133:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},2157:e=>{var t=Math.max;e.exports=function(e,r,n,i){for(var a=-1,o=e.length,s=n.length,u=-1,c=r.length,l=t(o-s,0),f=Array(c+l),h=!i;++u<c;)f[u]=r[u];for(;++a<s;)(h||a<o)&&(f[n[a]]=e[a]);for(;l--;)f[u++]=e[a++];return f}},4054:e=>{var t=Math.max;e.exports=function(e,r,n,i){for(var a=-1,o=e.length,s=-1,u=n.length,c=-1,l=r.length,f=t(o-u,0),h=Array(f+l),p=!i;++a<f;)h[a]=e[a];for(var d=a;++c<l;)h[d+c]=r[c];for(;++s<u;)(p||a<o)&&(h[d+n[s]]=e[a++]);return h}},278:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},8363:(e,t,r)=>{var n=r(4865),i=r(9465);e.exports=function(e,t,r,a){var o=!r;r||(r={});for(var s=-1,u=t.length;++s<u;){var c=t[s],l=a?a(r[c],e[c],c,r,e):void 0;void 0===l&&(l=e[c]),o?i(r,c,l):n(r,c,l)}return r}},8805:(e,t,r)=>{var n=r(8363),i=r(9551);e.exports=function(e,t){return n(e,i(e),t)}},1911:(e,t,r)=>{var n=r(8363),i=r(1442);e.exports=function(e,t){return n(e,i(e),t)}},4429:(e,t,r)=>{var n=r(5639)["__core-js_shared__"];e.exports=n},7991:e=>{e.exports=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}},1463:(e,t,r)=>{var n=r(5976),i=r(6612);e.exports=function(e){return n((function(t,r){var n=-1,a=r.length,o=a>1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,s&&i(r[0],r[1],s)&&(o=a<3?void 0:o,a=1),t=Object(t);++n<a;){var u=r[n];u&&e(t,u,n,o)}return t}))}},5063:e=>{e.exports=function(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var u=o[e?s:++i];if(!1===r(a[u],u,a))break}return t}}},2402:(e,t,r)=>{var n=r(1774),i=r(5639);e.exports=function(e,t,r){var a=1&t,o=n(e);return function t(){var n=this&&this!==i&&this instanceof t?o:e;return n.apply(a?r:this,arguments)}}},1774:(e,t,r)=>{var n=r(3118),i=r(3218);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=n(e.prototype),a=e.apply(r,t);return i(a)?a:r}}},6347:(e,t,r)=>{var n=r(6874),i=r(1774),a=r(6935),o=r(4487),s=r(893),u=r(6460),c=r(5639);e.exports=function(e,t,r){var l=i(e);return function i(){for(var f=arguments.length,h=Array(f),p=f,d=s(i);p--;)h[p]=arguments[p];var y=f<3&&h[0]!==d&&h[f-1]!==d?[]:u(h,d);if((f-=y.length)<r)return o(e,t,a,i.placeholder,void 0,h,y,void 0,void 0,r-f);var v=this&&this!==c&&this instanceof i?l:e;return n(v,this,h)}}},6935:(e,t,r)=>{var n=r(2157),i=r(4054),a=r(7991),o=r(1774),s=r(4487),u=r(893),c=r(451),l=r(6460),f=r(5639);e.exports=function e(t,r,h,p,d,y,v,g,m,b){var E=128&r,S=1&r,C=2&r,w=24&r,T=512&r,A=C?void 0:o(t);return function I(){for(var k=arguments.length,_=Array(k),B=k;B--;)_[B]=arguments[B];if(w)var N=u(I),O=a(_,N);if(p&&(_=n(_,p,d,w)),y&&(_=i(_,y,v,w)),k-=O,w&&k<b){var R=l(_,N);return s(t,r,e,I.placeholder,h,_,R,g,m,b-k)}var x=S?h:this,P=C?x[t]:t;return k=_.length,g?_=c(_,g):T&&k>1&&_.reverse(),E&&m<k&&(_.length=m),this&&this!==f&&this instanceof I&&(P=A||o(P)),P.apply(x,_)}}},4375:(e,t,r)=>{var n=r(6874),i=r(1774),a=r(5639);e.exports=function(e,t,r,o){var s=1&t,u=i(e);return function t(){for(var i=-1,c=arguments.length,l=-1,f=o.length,h=Array(f+c),p=this&&this!==a&&this instanceof t?u:e;++l<f;)h[l]=o[l];for(;c--;)h[l++]=arguments[++i];return n(p,s?r:this,h)}}},4487:(e,t,r)=>{var n=r(6528),i=r(258),a=r(9255);e.exports=function(e,t,r,o,s,u,c,l,f,h){var p=8&t;t|=p?32:64,4&(t&=~(p?64:32))||(t&=-4);var d=[e,t,s,p?u:void 0,p?c:void 0,p?void 0:u,p?void 0:c,l,f,h],y=r.apply(void 0,d);return n(e)&&i(y,d),y.placeholder=o,a(y,e,t)}},3593:(e,t,r)=>{var n=r(8525),i=r(308),a=r(1814),o=n&&1/a(new n([,-0]))[1]==1/0?function(e){return new n(e)}:i;e.exports=o},7727:(e,t,r)=>{var n=r(8045),i=r(2402),a=r(6347),o=r(6935),s=r(4375),u=r(6833),c=r(3833),l=r(258),f=r(9255),h=r(554),p=Math.max;e.exports=function(e,t,r,d,y,v,g,m){var b=2&t;if(!b&&"function"!=typeof e)throw new TypeError("Expected a function");var E=d?d.length:0;if(E||(t&=-97,d=y=void 0),g=void 0===g?g:p(h(g),0),m=void 0===m?m:h(m),E-=y?y.length:0,64&t){var S=d,C=y;d=y=void 0}var w=b?void 0:u(e),T=[e,t,r,d,y,S,C,v,g,m];if(w&&c(T,w),e=T[0],t=T[1],r=T[2],d=T[3],y=T[4],!(m=T[9]=void 0===T[9]?b?0:e.length:p(T[9]-E,0))&&24&t&&(t&=-25),t&&1!=t)A=8==t||16==t?a(e,t,m):32!=t&&33!=t||y.length?o.apply(void 0,T):s(e,t,r,d);else var A=i(e,t,r);return f((w?n:l)(A,T),e,t)}},696:(e,t,r)=>{var n=r(8630);e.exports=function(e){return n(e)?void 0:e}},8777:(e,t,r)=>{var n=r(852),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},9021:(e,t,r)=>{var n=r(5564),i=r(5357),a=r(61);e.exports=function(e){return a(i(e,void 0,n),e+"")}},1957:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},8234:(e,t,r)=>{var n=r(8866),i=r(9551),a=r(3674);e.exports=function(e){return n(e,a,i)}},6904:(e,t,r)=>{var n=r(8866),i=r(1442),a=r(1704);e.exports=function(e){return n(e,a,i)}},6833:(e,t,r)=>{var n=r(9250),i=r(308),a=n?function(e){return n.get(e)}:i;e.exports=a},7658:(e,t,r)=>{var n=r(2060),i=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",r=n[t],a=i.call(n,t)?r.length:0;a--;){var o=r[a],s=o.func;if(null==s||s==e)return o.name}return t}},893:e=>{e.exports=function(e){return e.placeholder}},5050:(e,t,r)=>{var n=r(7019);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},852:(e,t,r)=>{var n=r(8458),i=r(7801);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},5924:(e,t,r)=>{var n=r(5569)(Object.getPrototypeOf,Object);e.exports=n},9607:(e,t,r)=>{var n=r(2705),i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=o.call(e);return n&&(t?e[s]=r:delete e[s]),i}},9551:(e,t,r)=>{var n=r(4963),i=r(479),a=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,s=o?function(e){return null==e?[]:(e=Object(e),n(o(e),(function(t){return a.call(e,t)})))}:i;e.exports=s},1442:(e,t,r)=>{var n=r(2488),i=r(5924),a=r(9551),o=r(479),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,a(e)),e=i(e);return t}:o;e.exports=s},4160:(e,t,r)=>{var n=r(8552),i=r(7071),a=r(3818),o=r(8525),s=r(577),u=r(4239),c=r(346),l="[object Map]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",d="[object DataView]",y=c(n),v=c(i),g=c(a),m=c(o),b=c(s),E=u;(n&&E(new n(new ArrayBuffer(1)))!=d||i&&E(new i)!=l||a&&E(a.resolve())!=f||o&&E(new o)!=h||s&&E(new s)!=p)&&(E=function(e){var t=u(e),r="[object Object]"==t?e.constructor:void 0,n=r?c(r):"";if(n)switch(n){case y:return d;case v:return l;case g:return f;case m:return h;case b:return p}return t}),e.exports=E},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},8775:e=>{var t=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;e.exports=function(e){var n=e.match(t);return n?n[1].split(r):[]}},222:(e,t,r)=>{var n=r(1811),i=r(5694),a=r(1469),o=r(5776),s=r(1780),u=r(327);e.exports=function(e,t,r){for(var c=-1,l=(t=n(t,e)).length,f=!1;++c<l;){var h=u(t[c]);if(!(f=null!=e&&r(e,h)))break;e=e[h]}return f||++c!=l?f:!!(l=null==e?0:e.length)&&s(l)&&o(h,l)&&(a(e)||i(e))}},1789:(e,t,r)=>{var n=r(4536);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,r)=>{var n=r(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},1327:(e,t,r)=>{var n=r(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},1866:(e,t,r)=>{var n=r(4536);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},3824:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},9148:(e,t,r)=>{var n=r(4318),i=r(7157),a=r(3147),o=r(419),s=r(7133);e.exports=function(e,t,r){var u=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new u(+e);case"[object DataView]":return i(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,r);case"[object Map]":return new u;case"[object Number]":case"[object String]":return new u(e);case"[object RegExp]":return a(e);case"[object Set]":return new u;case"[object Symbol]":return o(e)}}},8517:(e,t,r)=>{var n=r(3118),i=r(5924),a=r(5726);e.exports=function(e){return"function"!=typeof e.constructor||a(e)?{}:n(i(e))}},3112:e=>{var t=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;e.exports=function(e,r){var n=r.length;if(!n)return e;var i=n-1;return r[i]=(n>1?"& ":"")+r[i],r=r.join(n>2?", ":" "),e.replace(t,"{\n/* [wrapped with "+r+"] */\n")}},7285:(e,t,r)=>{var n=r(2705),i=r(5694),a=r(1469),o=n?n.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||i(e)||!!(o&&e&&e[o])}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},6612:(e,t,r)=>{var n=r(7813),i=r(8612),a=r(5776),o=r(3218);e.exports=function(e,t,r){if(!o(r))return!1;var s=typeof t;return!!("number"==s?i(r)&&a(t,r.length):"string"==s&&t in r)&&n(r[t],e)}},5403:(e,t,r)=>{var n=r(1469),i=r(3448),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i(e))||(o.test(e)||!a.test(e)||null!=t&&e in Object(t))}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},6528:(e,t,r)=>{var n=r(6425),i=r(6833),a=r(7658),o=r(8111);e.exports=function(e){var t=a(e),r=o[t];if("function"!=typeof r||!(t in n.prototype))return!1;if(e===r)return!0;var s=i(r);return!!s&&e===s[0]}},5346:(e,t,r)=>{var n,i=r(4429),a=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!a&&a in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,r)=>{var n=r(8470),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():i.call(t,r,1),--this.size,!0)}},2117:(e,t,r)=>{var n=r(8470);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},7518:(e,t,r)=>{var n=r(8470);e.exports=function(e){return n(this.__data__,e)>-1}},4705:(e,t,r)=>{var n=r(8470);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},4785:(e,t,r)=>{var n=r(1989),i=r(8407),a=r(7071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||i),string:new n}}},1285:(e,t,r)=>{var n=r(5050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).get(e)}},9916:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).has(e)}},5265:(e,t,r)=>{var n=r(5050);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},4523:(e,t,r)=>{var n=r(8306);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},3833:(e,t,r)=>{var n=r(2157),i=r(4054),a=r(6460),o="__lodash_placeholder__",s=128,u=Math.min;e.exports=function(e,t){var r=e[1],c=t[1],l=r|c,f=l<131,h=c==s&&8==r||c==s&&256==r&&e[7].length<=t[8]||384==c&&t[7].length<=t[8]&&8==r;if(!f&&!h)return e;1&c&&(e[2]=t[2],l|=1&r?0:4);var p=t[3];if(p){var d=e[3];e[3]=d?n(d,p,t[4]):p,e[4]=d?a(e[3],o):t[4]}return(p=t[5])&&(d=e[5],e[5]=d?i(d,p,t[6]):p,e[6]=d?a(e[5],o):t[6]),(p=t[7])&&(e[7]=p),c&s&&(e[8]=null==e[8]?t[8]:u(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=l,e}},9250:(e,t,r)=>{var n=r(577),i=n&&new n;e.exports=i},4536:(e,t,r)=>{var n=r(852)(Object,"create");e.exports=n},6916:(e,t,r)=>{var n=r(5569)(Object.keys,Object);e.exports=n},3498:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},1167:(e,t,r)=>{e=r.nmd(e);var n=r(1957),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},5357:(e,t,r)=>{var n=r(6874),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=i(a.length-t,0),u=Array(s);++o<s;)u[o]=a[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=a[o];return c[t]=r(u),n(e,this,c)}}},292:(e,t,r)=>{var n=r(7786),i=r(4259);e.exports=function(e,t){return t.length<2?e:n(e,i(t,0,-1))}},2060:e=>{e.exports={}},451:(e,t,r)=>{var n=r(278),i=r(5776),a=Math.min;e.exports=function(e,t){for(var r=e.length,o=a(t.length,r),s=n(e);o--;){var u=t[o];e[o]=i(u,r)?s[u]:void 0}return e}},6460:e=>{var t="__lodash_placeholder__";e.exports=function(e,r){for(var n=-1,i=e.length,a=0,o=[];++n<i;){var s=e[n];s!==r&&s!==t||(e[n]=t,o[a++]=n)}return o}},5639:(e,t,r)=>{var n=r(1957),i="object"==typeof self&&self&&self.Object===Object&&self,a=n||i||Function("return this")();e.exports=a},6390:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},619:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:e=>{e.exports=function(e){return this.__data__.has(e)}},258:(e,t,r)=>{var n=r(8045),i=r(1275)(n);e.exports=i},1814:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},61:(e,t,r)=>{var n=r(6560),i=r(1275)(n);e.exports=i},9255:(e,t,r)=>{var n=r(8775),i=r(3112),a=r(61),o=r(7241);e.exports=function(e,t,r){var s=t+"";return a(e,i(s,o(n(s),r)))}},1275:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var i=t(),a=16-(i-n);if(n=i,a>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},7465:(e,t,r)=>{var n=r(8407);e.exports=function(){this.__data__=new n,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,r)=>{var n=r(8407),i=r(7071),a=r(3369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var o=r.__data__;if(!i||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(o)}return r.set(e,t),this.size=r.size,this}},2351:e=>{e.exports=function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}},5514:(e,t,r)=>{var n=r(4523),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,o=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,r,n,i){t.push(n?i.replace(a,"$1"):r||e)})),t}));e.exports=o},327:(e,t,r)=>{var n=r(3448);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7990:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},7241:(e,t,r)=>{var n=r(7412),i=r(7443),a=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];e.exports=function(e,t){return n(a,(function(r){var n="_."+r[0];t&r[1]&&!i(e,n)&&e.push(n)})),e.sort()}},1913:(e,t,r)=>{var n=r(6425),i=r(7548),a=r(278);e.exports=function(e){if(e instanceof n)return e.clone();var t=new i(e.__wrapped__,e.__chain__);return t.__actions__=a(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},8583:(e,t,r)=>{var n=r(4865),i=r(8363),a=r(1463),o=r(8612),s=r(5726),u=r(3674),c=Object.prototype.hasOwnProperty,l=a((function(e,t){if(s(t)||o(t))i(t,u(t),e);else for(var r in t)c.call(t,r)&&n(e,r,t[r])}));e.exports=l},6678:(e,t,r)=>{var n=r(5990);e.exports=function(e){return n(e,4)}},5703:e=>{e.exports=function(e){return function(){return e}}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},9873:(e,t,r)=>{var n=r(5082),i=r(6612);e.exports=function(e,t,r,a){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&i(e,t,r)&&(r=0,a=o),n(e,t,r,a)):[]}},5564:(e,t,r)=>{var n=r(1078);e.exports=function(e){return(null==e?0:e.length)?n(e,1):[]}},9095:(e,t,r)=>{var n=r(13),i=r(222);e.exports=function(e,t){return null!=e&&i(e,t,n)}},6557:e=>{e.exports=function(e){return e}},5325:(e,t,r)=>{var n=r(9932),i=r(7556),a=r(5976),o=r(4387),s=a((function(e){var t=n(e,o);return t.length&&t[0]===e[0]?i(t):[]}));e.exports=s},5694:(e,t,r)=>{var n=r(9454),i=r(7005),a=Object.prototype,o=a.hasOwnProperty,s=a.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&o.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,r)=>{var n=r(3560),i=r(1780);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},9246:(e,t,r)=>{var n=r(8612),i=r(7005);e.exports=function(e){return i(e)&&n(e)}},4144:(e,t,r)=>{e=r.nmd(e);var n=r(5639),i=r(5062),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,s=o&&o.exports===a?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u},3560:(e,t,r)=>{var n=r(4239),i=r(3218);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},6688:(e,t,r)=>{var n=r(5588),i=r(1717),a=r(1167),o=a&&a.isMap,s=o?i(o):n;e.exports=s},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8630:(e,t,r)=>{var n=r(4239),i=r(5924),a=r(7005),o=Function.prototype,s=Object.prototype,u=o.toString,c=s.hasOwnProperty,l=u.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==l}},2928:(e,t,r)=>{var n=r(9221),i=r(1717),a=r(1167),o=a&&a.isSet,s=o?i(o):n;e.exports=s},3448:(e,t,r)=>{var n=r(4239),i=r(7005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},6719:(e,t,r)=>{var n=r(8749),i=r(1717),a=r(1167),o=a&&a.isTypedArray,s=o?i(o):n;e.exports=s},3674:(e,t,r)=>{var n=r(4636),i=r(280),a=r(8612);e.exports=function(e){return a(e)?n(e):i(e)}},1704:(e,t,r)=>{var n=r(4636),i=r(313),a=r(8612);e.exports=function(e){return a(e)?n(e,!0):i(e)}},928:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},8306:(e,t,r)=>{var n=r(3369);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},2492:(e,t,r)=>{var n=r(2980),i=r(1463)((function(e,t,r){n(e,t,r)}));e.exports=i},308:e=>{e.exports=function(){}},7557:(e,t,r)=>{var n=r(9932),i=r(5990),a=r(7406),o=r(1811),s=r(8363),u=r(696),c=r(9021),l=r(6904),f=c((function(e,t){var r={};if(null==e)return r;var c=!1;t=n(t,(function(t){return t=o(t,e),c||(c=t.length>1),t})),s(e,l(e),r),c&&(r=i(r,7,u));for(var f=t.length;f--;)a(r,t[f]);return r}));e.exports=f},5544:(e,t,r)=>{var n=r(5976),i=r(7727),a=r(893),o=r(6460),s=n((function(e,t){var r=o(t,a(s));return i(e,64,void 0,t,r)}));s.placeholder={},e.exports=s},8718:(e,t,r)=>{var n=r(5970),i=r(9021)((function(e,t){return null==e?{}:n(e,t)}));e.exports=i},479:e=>{e.exports=function(){return[]}},5062:e=>{e.exports=function(){return!1}},8601:(e,t,r)=>{var n=r(4841),i=1/0;e.exports=function(e){return e?(e=n(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},554:(e,t,r)=>{var n=r(8601);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},8958:(e,t,r)=>{var n=r(9750),i=r(554);e.exports=function(e){return e?n(i(e),0,4294967295):0}},4841:(e,t,r)=>{var n=r(7561),i=r(3218),a=r(3448),o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):o.test(e)?NaN:+e}},9881:(e,t,r)=>{var n=r(8363),i=r(1704);e.exports=function(e){return n(e,i(e))}},9833:(e,t,r)=>{var n=r(531);e.exports=function(e){return null==e?"":n(e)}},4908:(e,t,r)=>{var n=r(5652);e.exports=function(e){return e&&e.length?n(e):[]}},8111:(e,t,r)=>{var n=r(6425),i=r(7548),a=r(9435),o=r(1469),s=r(7005),u=r(1913),c=Object.prototype.hasOwnProperty;function l(e){if(s(e)&&!o(e)&&!(e instanceof n)){if(e instanceof i)return e;if(c.call(e,"__wrapped__"))return u(e)}return new i(e)}l.prototype=a.prototype,l.prototype.constructor=l,e.exports=l},3720:e=>{e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var i={},a={};function o(e,t){var r,n,o;return t?(o=0<=(e>>>=0)&&e<256)&&(n=a[e])?n:(r=u(e,(0|e)<0?-1:0,!0),o&&(a[e]=r),r):(o=-128<=(e|=0)&&e<128)&&(n=i[e])?n:(r=u(e,e<0?-1:0,!1),o&&(i[e]=r),r)}function s(e,t){if(isNaN(e))return t?g:v;if(t){if(e<0)return g;if(e>=p)return C}else{if(e<=-d)return w;if(e+1>=d)return S}return e<0?s(-e,t).neg():u(e%h|0,e/h|0,t)}function u(e,t,n){return new r(e,t,n)}r.fromInt=o,r.fromNumber=s,r.fromBits=u;var c=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(e.substring(1),t,r).neg();for(var i=s(c(r,8)),a=v,o=0;o<e.length;o+=8){var u=Math.min(8,e.length-o),f=parseInt(e.substring(o,o+u),r);if(u<8){var h=s(c(r,u));a=a.mul(h).add(s(f))}else a=(a=a.mul(i)).add(s(f))}return a.unsigned=t,a}function f(e,t){return"number"==typeof e?s(e,t):"string"==typeof e?l(e,t):u(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=l,r.fromValue=f;var h=4294967296,p=h*h,d=p/2,y=o(1<<24),v=o(0);r.ZERO=v;var g=o(0,!0);r.UZERO=g;var m=o(1);r.ONE=m;var b=o(1,!0);r.UONE=b;var E=o(-1);r.NEG_ONE=E;var S=u(-1,2147483647,!1);r.MAX_VALUE=S;var C=u(-1,-1,!0);r.MAX_UNSIGNED_VALUE=C;var w=u(0,-2147483648,!1);r.MIN_VALUE=w;var T=r.prototype;T.toInt=function(){return this.unsigned?this.low>>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},T.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(w)){var t=s(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=s(c(e,6),this.unsigned),a=this,o="";;){var u=a.div(i),l=(a.sub(u.mul(i)).toInt()>>>0).toString(e);if((a=u).isZero())return l+o;for(;l.length<6;)l="0"+l;o=""+l+o}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},T.isZero=function(){return 0===this.high&&0===this.low},T.eqz=T.isZero,T.isNegative=function(){return!this.unsigned&&this.high<0},T.isPositive=function(){return this.unsigned||this.high>=0},T.isOdd=function(){return 1==(1&this.low)},T.isEven=function(){return 0==(1&this.low)},T.equals=function(e){return n(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},T.eq=T.equals,T.notEquals=function(e){return!this.eq(e)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(e){return this.comp(e)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(e){return this.comp(e)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(e){return this.comp(e)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(e){return this.comp(e)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(e){if(n(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(m)},T.neg=T.negate,T.add=function(e){n(e)||(e=f(e));var t=this.high>>>16,r=65535&this.high,i=this.low>>>16,a=65535&this.low,o=e.high>>>16,s=65535&e.high,c=e.low>>>16,l=0,h=0,p=0,d=0;return p+=(d+=a+(65535&e.low))>>>16,h+=(p+=i+c)>>>16,l+=(h+=r+s)>>>16,l+=t+o,u((p&=65535)<<16|(d&=65535),(l&=65535)<<16|(h&=65535),this.unsigned)},T.subtract=function(e){return n(e)||(e=f(e)),this.add(e.neg())},T.sub=T.subtract,T.multiply=function(e){if(this.isZero())return v;if(n(e)||(e=f(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return v;if(this.eq(w))return e.isOdd()?w:v;if(e.eq(w))return this.isOdd()?w:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(y)&&e.lt(y))return s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,a=this.low>>>16,o=65535&this.low,c=e.high>>>16,l=65535&e.high,h=e.low>>>16,p=65535&e.low,d=0,g=0,m=0,b=0;return m+=(b+=o*p)>>>16,g+=(m+=a*p)>>>16,m&=65535,g+=(m+=o*h)>>>16,d+=(g+=i*p)>>>16,g&=65535,d+=(g+=a*h)>>>16,g&=65535,d+=(g+=o*l)>>>16,d+=r*p+i*h+a*l+o*c,u((m&=65535)<<16|(b&=65535),(d&=65535)<<16|(g&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(e){if(n(e)||(e=f(e)),e.isZero())throw Error("division by zero");var r,i,a;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?g:v;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return b;a=g}else{if(this.eq(w))return e.eq(m)||e.eq(E)?w:e.eq(w)?m:(r=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?m:E:(i=this.sub(e.mul(r)),a=r.add(i.div(e)));if(e.eq(w))return this.unsigned?g:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=v}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),l=o<=48?1:c(2,o-48),h=s(r),p=h.mul(e);p.isNegative()||p.gt(i);)p=(h=s(r-=l,this.unsigned)).mul(e);h.isZero()&&(h=m),a=a.add(h),i=i.sub(p)}return a},T.div=T.divide,T.modulo=function(e){return n(e)||(e=f(e)),t?u((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return u(~this.low,~this.high,this.unsigned)},T.and=function(e){return n(e)||(e=f(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},T.or=function(e){return n(e)||(e=f(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},T.xor=function(e){return n(e)||(e=f(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},T.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):u(0,this.low<<e-32,this.unsigned)},T.shl=T.shiftLeft,T.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},T.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},T.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},8925:(e,t,r)=>{var n=r(3832);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(5649),r(1967),r(7116),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){l||f();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return p(r._w,e,t,!1)},decrypt:function(e,t){return p(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var i=0;i<t.length;++i)r.putByte(t[i])}}else r=n.util.createBuffer(r);if(!n.util.isArray(r)){t=r,r=[];var a=t.length();if(16===a||24===a||32===a){a>>>=2;for(i=0;i<a;++i)r.push(t.getInt32())}}if(!n.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var o=this.mode.name,s=-1!==["CFB","OFB","CTR","GCM"].indexOf(o);this._w=h(r,e.decrypt&&!s),this._init=!0}},n.aes._expandKey=function(e,t){return l||f(),h(e,t)},n.aes._updateBlock=p,i("AES-ECB",n.cipher.modes.ecb),i("AES-CBC",n.cipher.modes.cbc),i("AES-CFB",n.cipher.modes.cfb),i("AES-OFB",n.cipher.modes.ofb),i("AES-CTR",n.cipher.modes.ctr),i("AES-GCM",n.cipher.modes.gcm);var a,o,s,u,c,l=!1;function f(){l=!0,s=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;a=new Array(256),o=new Array(256),u=new Array(4),c=new Array(4);for(t=0;t<4;++t)u[t]=new Array(256),c[t]=new Array(256);var r,n,i,f,h,p,d,y=0,v=0;for(t=0;t<256;++t){f=(f=v^v<<1^v<<2^v<<3^v<<4)>>8^255&f^99,a[y]=f,o[f]=y,p=(h=e[f])<<24^f<<16^f<<8^f^h,d=((r=e[y])^(n=e[r])^(i=e[n]))<<24^(y^i)<<16^(y^n^i)<<8^y^r^i;for(var g=0;g<4;++g)u[g][y]=p,c[g][f]=d,p=p<<24|p>>>8,d=d<<24|d>>>8;0===y?y=v=1:(y=r^e[e[e[r^i]]],v^=e[e[v]])}}function h(e,t){for(var r,n=e.slice(0),i=1,o=n.length,u=4*(o+6+1),l=o;l<u;++l)r=n[l-1],l%o==0?(r=a[r>>>16&255]<<24^a[r>>>8&255]<<16^a[255&r]<<8^a[r>>>24]^s[i]<<24,i++):o>6&&l%o==4&&(r=a[r>>>24]<<24^a[r>>>16&255]<<16^a[r>>>8&255]<<8^a[255&r]),n[l]=n[l-o]^r;if(t){for(var f,h=c[0],p=c[1],d=c[2],y=c[3],v=n.slice(0),g=(l=0,(u=n.length)-4);l<u;l+=4,g-=4)if(0===l||l===u-4)v[l]=n[g],v[l+1]=n[g+3],v[l+2]=n[g+2],v[l+3]=n[g+1];else for(var m=0;m<4;++m)f=n[g+m],v[l+(3&-m)]=h[a[f>>>24]]^p[a[f>>>16&255]]^d[a[f>>>8&255]]^y[a[255&f]];n=v}return n}function p(e,t,r,n){var i,s,l,f,h,p,d,y,v,g,m,b,E=e.length/4-1;n?(i=c[0],s=c[1],l=c[2],f=c[3],h=o):(i=u[0],s=u[1],l=u[2],f=u[3],h=a),p=t[0]^e[0],d=t[n?3:1]^e[1],y=t[2]^e[2],v=t[n?1:3]^e[3];for(var S=3,C=1;C<E;++C)g=i[p>>>24]^s[d>>>16&255]^l[y>>>8&255]^f[255&v]^e[++S],m=i[d>>>24]^s[y>>>16&255]^l[v>>>8&255]^f[255&p]^e[++S],b=i[y>>>24]^s[v>>>16&255]^l[p>>>8&255]^f[255&d]^e[++S],v=i[v>>>24]^s[p>>>16&255]^l[d>>>8&255]^f[255&y]^e[++S],p=g,d=m,y=b;r[0]=h[p>>>24]<<24^h[d>>>16&255]<<16^h[y>>>8&255]<<8^h[255&v]^e[++S],r[n?3:1]=h[d>>>24]<<24^h[y>>>16&255]<<16^h[v>>>8&255]<<8^h[255&p]^e[++S],r[2]=h[y>>>24]<<24^h[v>>>16&255]<<16^h[p>>>8&255]<<8^h[255&d]^e[++S],r[n?1:3]=h[v>>>24]<<24^h[p>>>16&255]<<16^h[d>>>8&255]<<8^h[255&y]^e[++S]}function d(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},3068:(e,t,r)=>{var n=r(3832);r(7116),r(6270);var i=e.exports=n.asn1=n.asn1||{};function a(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,a,o){if(n.util.isArray(a)){for(var s=[],u=0;u<a.length;++u)void 0!==a[u]&&s.push(a[u]);a=s}var c={tagClass:e,type:t,constructed:r,composed:r||n.util.isArray(a),value:a};return o&&"bitStringContents"in o&&(c.bitStringContents=o.bitStringContents,c.original=i.copy(c)),c},i.copy=function(e,t){var r;if(n.util.isArray(e)){r=[];for(var a=0;a<e.length;++a)r.push(i.copy(e[a],t));return r}return"string"==typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:i.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},i.equals=function(e,t,r){if(n.util.isArray(e)){if(!n.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var a=0;a<e.length;++a)if(!i.equals(e[a],t[a]))return!1;return!0}if(typeof e!=typeof t)return!1;if("string"==typeof e)return e===t;var o=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&i.equals(e.value,t.value);return r&&r.includeBitStringContents&&(o=o&&e.bitStringContents===t.bitStringContents),o},i.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};function o(e,t,r,n){var s;a(e,t,2);var u=e.getByte();t--;var c=192&u,l=31&u;s=e.length();var f,h,p=function(e,t){var r=e.getByte();if(t--,128!==r){var n;if(128&r){var i=127&r;a(e,t,i),n=e.getInt(i<<3)}else n=r;if(n<0)throw new Error("Negative length: "+n);return n}}(e,t);if(t-=s-e.length(),void 0!==p&&p>t){if(n.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=e.length(),d.remaining=t,d.requested=p,d}p=t}var y=32==(32&u);if(y)if(f=[],void 0===p)for(;;){if(a(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}s=e.length(),f.push(o(e,t,r+1,n)),t-=s-e.length()}else for(;p>0;)s=e.length(),f.push(o(e,p,r+1,n)),t-=s-e.length(),p-=s-e.length();if(void 0===f&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&(h=e.bytes(p)),void 0===f&&n.decodeBitStrings&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&p>1){var v=e.read,g=t,m=0;if(l===i.Type.BITSTRING&&(a(e,t,1),m=e.getByte(),t--),0===m)try{s=e.length();var b=o(e,t,r+1,{verbose:n.verbose,strict:!0,decodeBitStrings:!0}),E=s-e.length();t-=E,l==i.Type.BITSTRING&&E++;var S=b.tagClass;E!==p||S!==i.Class.UNIVERSAL&&S!==i.Class.CONTEXT_SPECIFIC||(f=[b])}catch(e){}void 0===f&&(e.read=v,t=g)}if(void 0===f){if(void 0===p){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");p=t}if(l===i.Type.BMPSTRING)for(f="";p>0;p-=2)a(e,t,2),f+=String.fromCharCode(e.getInt16()),t-=2;else f=e.getBytes(p)}var C=void 0===h?null:{bitStringContents:h};return i.create(c,l,y,f,C)}i.fromDer=function(e,t){return void 0===t&&(t={strict:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"==typeof e&&(e=n.util.createBuffer(e)),o(e,e.length(),0,t)},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,a=n.util.createBuffer(),o=!1;if("bitStringContents"in e&&(o=!0,e.original&&(o=i.equals(e,e.original))),o)a.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:a.putByte(0);for(var s=0;s<e.value.length;++s)void 0!==e.value[s]&&a.putBuffer(i.toDer(e.value[s]))}else if(e.type===i.Type.BMPSTRING)for(s=0;s<e.value.length;++s)a.putInt16(e.value.charCodeAt(s));else e.type===i.Type.INTEGER&&e.value.length>1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?a.putBytes(e.value.substr(1)):a.putBytes(e.value);if(t.putByte(r),a.length()<=127)t.putByte(127&a.length());else{var u=a.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);t.putByte(128|c.length);for(s=c.length-1;s>=0;--s)t.putByte(c.charCodeAt(s))}return t.putBuffer(a),t},i.oidToDer=function(e){var t,r,i,a,o=e.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(o[0],10)+parseInt(o[1],10));for(var u=2;u<o.length;++u){t=!0,r=[],i=parseInt(o[u],10);do{a=127&i,i>>>=7,t||(a|=128),r.push(a),t=!1}while(i>0);for(var c=r.length-1;c>=0;--c)s.putByte(r[c])}return s},i.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var u=e.charAt(10),c=10;"+"!==u&&"-"!==u&&(s=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,0),c&&("+"===(u=e.charAt(c))||"-"===u)){var l=60*parseInt(e.substr(c+1,2),10)+parseInt(e.substr(c+4,2),10);l*=6e4,"+"===u?t.setTime(+t-l):t.setTime(+t+l)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),u=0,c=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var f=e.length-5,h=e.charAt(f);"+"!==h&&"-"!==h||(c=60*parseInt(e.substr(f+1,2),10)+parseInt(e.substr(f+4,2),10),c*=6e4,"+"===h&&(c*=-1),l=!0);return"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,u),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(a,o,s,u)),t},i.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.dateToGeneralizedTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.integerToDer=function(e){var t=n.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,a){var o=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)a&&(e.tagClass!==t.tagClass&&a.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&a.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(o=!0,t.value&&n.util.isArray(t.value))for(var s=0,u=0;o&&u<t.value.length;++u)o=t.value[u].optional||!1,e.value[s]&&((o=i.validate(e.value[s],t.value[u],r,a))?++s:t.value[u].optional&&(o=!0)),!o&&a&&a.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(o&&r)if(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e)if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else{if(0!==e.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else a&&a.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');return o};var s=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(e,t,r){var a="";r=r||2,(t=t||0)>0&&(a+="\n");for(var o="",u=0;u<t*r;++u)o+=" ";switch(a+=o+"Tag: ",e.tagClass){case i.Class.UNIVERSAL:a+="Universal:";break;case i.Class.APPLICATION:a+="Application:";break;case i.Class.CONTEXT_SPECIFIC:a+="Context-Specific:";break;case i.Class.PRIVATE:a+="Private:"}if(e.tagClass===i.Class.UNIVERSAL)switch(a+=e.type,e.type){case i.Type.NONE:a+=" (None)";break;case i.Type.BOOLEAN:a+=" (Boolean)";break;case i.Type.INTEGER:a+=" (Integer)";break;case i.Type.BITSTRING:a+=" (Bit string)";break;case i.Type.OCTETSTRING:a+=" (Octet string)";break;case i.Type.NULL:a+=" (Null)";break;case i.Type.OID:a+=" (Object Identifier)";break;case i.Type.ODESC:a+=" (Object Descriptor)";break;case i.Type.EXTERNAL:a+=" (External or Instance of)";break;case i.Type.REAL:a+=" (Real)";break;case i.Type.ENUMERATED:a+=" (Enumerated)";break;case i.Type.EMBEDDED:a+=" (Embedded PDV)";break;case i.Type.UTF8:a+=" (UTF8)";break;case i.Type.ROID:a+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:a+=" (Sequence)";break;case i.Type.SET:a+=" (Set)";break;case i.Type.PRINTABLESTRING:a+=" (Printable String)";break;case i.Type.IA5String:a+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:a+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:a+=" (Generalized time)";break;case i.Type.BMPSTRING:a+=" (BMP String)"}else a+=e.type;if(a+="\n",a+=o+"Constructed: "+e.constructed+"\n",e.composed){var c=0,l="";for(u=0;u<e.value.length;++u)void 0!==e.value[u]&&(c+=1,l+=i.prettyPrint(e.value[u],t+1,r),u+1<e.value.length&&(l+=","));a+=o+"Sub values: "+c+l}else{if(a+=o+"Value: ",e.type===i.Type.OID){var f=i.derToOid(e.value);a+=f,n.pki&&n.pki.oids&&f in n.pki.oids&&(a+=" ("+n.pki.oids[f]+") ")}if(e.type===i.Type.INTEGER)try{a+=i.derToInteger(e.value)}catch(t){a+="0x"+n.util.bytesToHex(e.value)}else if(e.type===i.Type.BITSTRING){if(e.value.length>1?a+="0x"+n.util.bytesToHex(e.value.slice(1)):a+="(none)",e.value.length>0){var h=e.value.charCodeAt(0);1==h?a+=" (1 unused bit shown)":h>1&&(a+=" ("+h+" unused bits shown)")}}else e.type===i.Type.OCTETSTRING?(s.test(e.value)||(a+="("+e.value+") "),a+="0x"+n.util.bytesToHex(e.value)):e.type===i.Type.UTF8?a+=n.util.decodeUtf8(e.value):e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?a+=e.value:s.test(e.value)?a+="0x"+n.util.bytesToHex(e.value):0===e.value.length?a+="[null]":a+=e.value}return a}},8807:e=>{var t={};e.exports=t;var r={};t.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,a=t.length,o=t.charAt(0),s=[0];for(i=0;i<e.length;++i){for(var u=0,c=e[i];u<s.length;++u)c+=s[u]<<8,s[u]=c%a,c=c/a|0;for(;c>0;)s.push(c%a),c=c/a|0}for(i=0;0===e[i]&&i<e.length-1;++i)n+=o;for(i=s.length-1;i>=0;--i)n+=t[s[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r<e.length();++r){for(var o=0,s=e.at(r);o<a.length;++o)s+=a[o]<<8,a[o]=s%n,s=s/n|0;for(;s>0;)a.push(s%n),s=s/n|0}var u="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)u+=i;for(r=a.length-1;r>=0;--r)u+=t[a[r]];return u}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},t.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var n=r[t];if(!n){n=r[t]=[];for(var i=0;i<t.length;++i)n[t.charCodeAt(i)]=i}e=e.replace(/\s/g,"");var a=t.length,o=t.charAt(0),s=[0];for(i=0;i<e.length;i++){var u=n[e.charCodeAt(i)];if(void 0===u)return;for(var c=0,l=u;c<s.length;++c)l+=s[c]*a,s[c]=255&l,l>>=8;for(;l>0;)s.push(255&l),l>>=8}for(var f=0;e[f]===o&&f<e.length-1;++f)s.push(0);return"undefined"!=typeof Buffer?Buffer.from(s.reverse()):new Uint8Array(s.reverse())}},5649:(e,t,r)=>{var n=r(3832);r(7116),e.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[e]:null};var i=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},1967:(e,t,r)=>{var n=r(3832);r(7116),n.cipher=n.cipher||{};var i=e.exports=n.cipher.modes=n.cipher.modes||{};function a(e,t){if("string"==typeof e&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var r=e;e=n.util.createBuffer();for(var i=0;i<r.length;++i)e.putByte(r[i])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!n.util.isArray(e)){var a=[],o=t/4;for(i=0;i<o;++i)a.push(e.getInt32());e=a}return e}function o(e){e[e.length-1]=e[e.length-1]+1&4294967295}function s(e){return[e/4294967296|0,4294967295&e]}i.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.ecb.prototype.start=function(e){},i.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}o(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*i)))}this._inBlock=this._j0.slice(0),o(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=s(8*t.length());var a=t.length()%this.blockSize;for(a&&t.fillWithByte(0,this.blockSize-a),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a<=0||r){if(r){var s=n%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),o(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),o(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=n.util.createBuffer();var i=this._aDataLength.concat(s(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var a=[];this.cipher.encrypt(this._j0,a);for(var o=0;o<this._ints;++o)this.tag.putInt32(this._s[o]^a[o]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i){e[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r},i.gcm.prototype.pow=function(e,t){for(var r=1&e[3],n=3;n>0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),o=0;o<i;++o){var s=[0,0,0,0],u=(n-1-o%n)*t;s[o/n|0]=1<<t-1<<u,a[o]=this.generateSubHashTable(this.multiply(s,e),t)}return a},i.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var o=1;o<a;++o){var s=i[a],u=i[o];i[a+o]=[s[0]^u[0],s[1]^u[1],s[2]^u[2],s[3]^u[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var c=i[a^n];i[a]=[e[0]^c[0],e[1]^c[1],e[2]^c[2],e[3]^c[3]]}return i}},3480:(e,t,r)=>{var n=r(3832);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.des.Algorithm(e,t)}))}r(5649),r(1967),r(7116),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return p(r._keys,e,t,!1)},decrypt:function(e,t){return p(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],o=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],v=e.length()>8?3:1,g=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,E=0;E<v;E++){var S=e.getInt32(),C=e.getInt32();S^=(t=252645135&(S>>>4^C))<<4,S^=t=65535&((C^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(C^=t<<-16)))<<2,S^=t=65535&((C^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(C^=t<<-16)))<<1,S^=t=16711935&((C^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(C^=t<<8)))<<1)<<8|(C^=t)>>>20&240,S=C<<24|C<<8&16711680|C>>>8&65280|C>>>24&240,C=t;for(var w=0;w<m.length;++w){m[w]?(S=S<<2|S>>>26,C=C<<2|C>>>26):(S=S<<1|S>>>27,C=C<<1|C>>>27),C&=-15;var T=r[(S&=-15)>>>28]|n[S>>>24&15]|i[S>>>20&15]|a[S>>>16&15]|o[S>>>12&15]|s[S>>>8&15]|u[S>>>4&15],A=c[C>>>28]|l[C>>>24&15]|f[C>>>20&15]|h[C>>>16&15]|p[C>>>12&15]|d[C>>>8&15]|y[C>>>4&15];t=65535&(A>>>16^T),g[b++]=T^t,g[b++]=A^t<<16}}return g}(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var a=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],o=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],c=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],h=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function p(e,t,r,n){var i,p,d=32===e.length?3:9;i=3===d?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],v=t[1];y^=(p=252645135&(y>>>4^v))<<4,y^=(p=65535&(y>>>16^(v^=p)))<<16,y^=p=858993459&((v^=p)>>>2^y),y^=p=16711935&((v^=p<<2)>>>8^y),y=(y^=(p=1431655765&(y>>>1^(v^=p<<8)))<<1)<<1|y>>>31,v=(v^=p)<<1|v>>>31;for(var g=0;g<d;g+=3){for(var m=i[g+1],b=i[g+2],E=i[g];E!=m;E+=b){var S=v^e[E],C=(v>>>4|v<<28)^e[E+1];p=y,y=v,v=p^(o[S>>>24&63]|u[S>>>16&63]|l[S>>>8&63]|h[63&S]|a[C>>>24&63]|s[C>>>16&63]|c[C>>>8&63]|f[63&C])}p=y,y=v,v=p}v=v>>>1|v<<31,v^=p=1431655765&((y=y>>>1|y<<31)>>>1^v),v^=(p=16711935&(v>>>8^(y^=p<<1)))<<8,v^=(p=858993459&(v>>>2^(y^=p)))<<2,v^=p=65535&((y^=p)>>>16^v),v^=p=252645135&((y^=p<<16)>>>4^v),y^=p<<4,r[0]=y,r[1]=v}function d(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},3832:e=>{e.exports={options:{usePureJavaScript:!1}}},6607:(e,t,r)=>{var n=r(3832);r(8991),r(7116),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,a={start:function(a,o){if(null!==a)if("string"==typeof a){if(!((a=a.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+a+'"');t=n.md.algorithms[a].create()}else t=a;if(null===o)o=e;else{if("string"==typeof o)o=n.util.createBuffer(o);else if(n.util.isArray(o)){var s=o;o=n.util.createBuffer();for(var u=0;u<s.length;++u)o.putByte(s[u])}var c=o.length();c>t.blockLength&&(t.start(),t.update(o.bytes()),o=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=o.length();for(u=0;u<c;++u){s=o.at(u);r.putByte(54^s),i.putByte(92^s)}if(c<t.blockLength)for(s=t.blockLength-c,u=0;u<s;++u)r.putByte(54),i.putByte(92);e=o,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()}};return a.digest=a.getMac,a}},5764:(e,t,r)=>{var n,i=r(3832);e.exports=i.jsbn=i.jsbn||{};function a(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function o(){return new a(null)}function s(e,t,r,n,i,a){for(var o=16383&t,s=t>>14;--a>=0;){var u=16383&this.data[e],c=this.data[e++]>>14,l=s*u+c*o;i=((u=o*u+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+s*c,r.data[n++]=268435455&u}return i}i.jsbn.BigInteger=a,"undefined"==typeof navigator?(a.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(var o=32767&t,s=t>>15;--a>=0;){var u=32767&this.data[e],c=this.data[e++]>>15,l=s*u+c*o;i=((u=o*u+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+s*c+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var o=t*this.data[e++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=67108863&o}return i},n=26):(a.prototype.am=s,n=28),a.prototype.DB=n,a.prototype.DM=(1<<n)-1,a.prototype.DV=1<<n;a.prototype.FV=Math.pow(2,52),a.prototype.F1=52-n,a.prototype.F2=2*n-52;var u,c,l=new Array;for(u="0".charCodeAt(0),c=0;c<=9;++c)l[u++]=c;for(u="a".charCodeAt(0),c=10;c<36;++c)l[u++]=c;for(u="A".charCodeAt(0),c=10;c<36;++c)l[u++]=c;function f(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function h(e,t){var r=l[e.charCodeAt(t)];return null==r?-1:r}function p(e){var t=o();return t.fromInt(e),t}function d(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function v(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function g(e,t){return e&t}function m(e,t){return e|t}function b(e,t){return e^t}function E(e,t){return e&~t}function S(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function C(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function w(){}function T(e){return e}function A(e){this.r2=o(),this.q3=o(),a.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},v.prototype.convert=function(e){var t=o();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(a.ZERO)>0&&this.m.subTo(t,t),t},v.prototype.revert=function(e){var t=o();return e.copyTo(t),this.reduce(t),t},v.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},a.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},a.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},a.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,o=0;--n>=0;){var s=8==r?255&e[n]:h(e,n);s<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this.data[this.t++]=s:o+r>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this.data[this.t++]=s>>this.DB-o):this.data[this.t-1]|=s<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this.data[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&a.ZERO.subTo(this,this)},a.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},a.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},a.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s},a.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,a=(1<<i)-1,o=Math.floor(e/this.DB),s=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+o+1]=this.data[r]>>i|s,s=(this.data[r]&a)<<n;for(r=o-1;r>=0;--r)t.data[r]=0;t.data[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()},a.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var o=r+1;o<this.t;++o)t.data[o-r-1]|=(this.data[o]&a)<<i,t.data[o-r]=this.data[o]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}},a.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},a.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&a.ZERO.subTo(t,t)},a.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},a.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=o());var s=o(),u=this.s,c=e.s,l=this.DB-d(n.data[n.t-1]);l>0?(n.lShiftTo(l,s),i.lShiftTo(l,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,h=s.data[f-1];if(0!=h){var p=h*(1<<this.F1)+(f>1?s.data[f-2]>>this.F2:0),y=this.FV/p,v=(1<<this.F1)/p,g=1<<this.F2,m=r.t,b=m-f,E=null==t?o():t;for(s.dlShiftTo(b,E),r.compareTo(E)>=0&&(r.data[r.t++]=1,r.subTo(E,r)),a.ONE.dlShiftTo(f,E),E.subTo(s,s);s.t<f;)s.data[s.t++]=0;for(;--b>=0;){var S=r.data[--m]==h?this.DM:Math.floor(r.data[m]*y+(r.data[m-1]+g)*v);if((r.data[m]+=s.am(0,S,r,b,0,f))<S)for(s.dlShiftTo(b,E),r.subTo(E,r);r.data[m]<--S;)r.subTo(E,r)}null!=t&&(r.drShiftTo(f,t),u!=c&&a.ZERO.subTo(t,t)),r.t=f,r.clamp(),l>0&&r.rShiftTo(l,r),u<0&&a.ZERO.subTo(r,r)}}},a.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},a.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},a.prototype.exp=function(e,t){if(e>4294967295||e<1)return a.ONE;var r=o(),n=o(),i=t.convert(this),s=d(e)-1;for(i.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<<s)>0)t.mulTo(n,i,r);else{var u=r;r=n,n=u}return t.revert(r)},a.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this.data[o]>>s)>0&&(i=!0,a=f(r));o>=0;)s<t?(r=(this.data[o]&(1<<s)-1)<<t-s,r|=this.data[--o]>>(s+=this.DB-t)):(r=this.data[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=f(r));return i?a:"0"},a.prototype.negate=function(){var e=o();return a.ZERO.subTo(this,e),e},a.prototype.abs=function(){return this.s<0?this.negate():this},a.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},a.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},a.prototype.mod=function(e){var t=o();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(a.ZERO)>0&&e.subTo(t,t),t},a.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new v(t),this.exp(e,r)},a.ZERO=p(0),a.ONE=p(1),w.prototype.convert=T,w.prototype.revert=T,w.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},w.prototype.sqrTo=function(e,t){e.squareTo(t)},A.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=o();return e.copyTo(t),this.reduce(t),t},A.prototype.revert=function(e){return e},A.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},A.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},A.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var I=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],k=(1<<26)/I[I.length-1];a.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},a.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=p(r),i=o(),a=o(),s="";for(this.divRemTo(n,i,a);i.signum()>0;)s=(r+a.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,a);return a.intValue().toString(e)+s},a.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,o=0,s=0,u=0;u<e.length;++u){var c=h(e,u);c<0?"-"==e.charAt(u)&&0==this.signum()&&(i=!0):(s=t*s+c,++o>=r&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0)),i&&a.ZERO.subTo(this,this)},a.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(a.ONE.shiftLeft(e-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(a.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},a.prototype.bitwiseTo=function(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},a.prototype.changeBit=function(e,t){var r=a.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},a.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},a.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},a.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},a.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i<n;++i)r.data[i+this.t]=this.am(0,e.data[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e.data[i],r,i,0,t-i);r.clamp()},a.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},a.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},a.prototype.millerRabin=function(e){var t=this.subtract(a.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),o={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},s=0;s<e;++s){do{n=new a(this.bitLength(),o)}while(n.compareTo(a.ONE)<=0||n.compareTo(t)>=0);var u=n.modPow(i,this);if(0!=u.compareTo(a.ONE)&&0!=u.compareTo(t)){for(var c=1;c++<r&&0!=u.compareTo(t);)if(0==(u=u.modPowInt(2,this)).compareTo(a.ONE))return!1;if(0!=u.compareTo(t))return!1}}return!0},a.prototype.clone=function(){var e=o();return this.copyTo(e),e},a.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},a.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},a.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},a.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},a.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},a.prototype.equals=function(e){return 0==this.compareTo(e)},a.prototype.min=function(e){return this.compareTo(e)<0?this:e},a.prototype.max=function(e){return this.compareTo(e)>0?this:e},a.prototype.and=function(e){var t=o();return this.bitwiseTo(e,g,t),t},a.prototype.or=function(e){var t=o();return this.bitwiseTo(e,m,t),t},a.prototype.xor=function(e){var t=o();return this.bitwiseTo(e,b,t),t},a.prototype.andNot=function(e){var t=o();return this.bitwiseTo(e,E,t),t},a.prototype.not=function(){for(var e=o(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},a.prototype.shiftLeft=function(e){var t=o();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},a.prototype.shiftRight=function(e){var t=o();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},a.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+S(this.data[e]);return this.s<0?this.t*this.DB:-1},a.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=C(this.data[r]^t);return e},a.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this.data[t]&1<<e%this.DB)},a.prototype.setBit=function(e){return this.changeBit(e,m)},a.prototype.clearBit=function(e){return this.changeBit(e,E)},a.prototype.flipBit=function(e){return this.changeBit(e,b)},a.prototype.add=function(e){var t=o();return this.addTo(e,t),t},a.prototype.subtract=function(e){var t=o();return this.subTo(e,t),t},a.prototype.multiply=function(e){var t=o();return this.multiplyTo(e,t),t},a.prototype.divide=function(e){var t=o();return this.divRemTo(e,t,null),t},a.prototype.remainder=function(e){var t=o();return this.divRemTo(e,null,t),t},a.prototype.divideAndRemainder=function(e){var t=o(),r=o();return this.divRemTo(e,t,r),new Array(t,r)},a.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),a=p(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new y(t):t.isEven()?new A(t):new v(t);var s=new Array,u=3,c=r-1,l=(1<<r)-1;if(s[1]=n.convert(this),r>1){var f=o();for(n.sqrTo(s[1],f);u<=l;)s[u]=o(),n.mulTo(f,s[u-2],s[u]),u+=2}var h,g,m=e.t-1,b=!0,E=o();for(i=d(e.data[m])-1;m>=0;){for(i>=c?h=e.data[m]>>i-c&l:(h=(e.data[m]&(1<<i+1)-1)<<c-i,m>0&&(h|=e.data[m-1]>>this.DB+i-c)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--m),b)s[h].copyTo(a),b=!1;else{for(;u>1;)n.sqrTo(a,E),n.sqrTo(E,a),u-=2;u>0?n.sqrTo(a,E):(g=a,a=E,E=g),n.mulTo(E,s[h],a)}for(;m>=0&&0==(e.data[m]&1<<i);)n.sqrTo(a,E),g=a,a=E,E=g,--i<0&&(i=this.DB-1,--m)}return n.revert(a)},a.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return a.ZERO;for(var r=e.clone(),n=this.clone(),i=p(1),o=p(0),s=p(0),u=p(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),t?(s.isEven()&&u.isEven()||(s.addTo(this,s),u.subTo(e,u)),s.rShiftTo(1,s)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(s,i),o.subTo(u,o)):(n.subTo(r,n),t&&s.subTo(i,s),u.subTo(o,u))}return 0!=n.compareTo(a.ONE)?a.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},a.prototype.pow=function(e){return this.exp(e,new w)},a.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},a.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=I[I.length-1]){for(t=0;t<I.length;++t)if(r.data[0]==I[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<I.length;){for(var n=I[t],i=t+1;i<I.length&&n<k;)n*=I[i++];for(n=r.modInt(n);t<i;)if(n%I[t++]==0)return!1}return r.millerRabin(e)}},8991:(e,t,r)=>{var n=r(3832);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},6971:(e,t,r)=>{var n=r(3832);r(3453),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},3453:(e,t,r)=>{var n=r(3832);r(7116),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var i=new n.util.ByteBuffer,a=Math.ceil(r/e.digestLength),o=0;o<a;o++){var s=new n.util.ByteBuffer;s.putInt32(o),e.start(),e.update(t+s.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}}}},6270:(e,t,r)=>{var n=r(3832);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function a(e,t){i[e]=t,i[t]=e}function o(e,t){i[e]=t}a("1.2.840.113549.1.1.1","rsaEncryption"),a("1.2.840.113549.1.1.4","md5WithRSAEncryption"),a("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),a("1.2.840.113549.1.1.7","RSAES-OAEP"),a("1.2.840.113549.1.1.8","mgf1"),a("1.2.840.113549.1.1.9","pSpecified"),a("1.2.840.113549.1.1.10","RSASSA-PSS"),a("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),a("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),a("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),a("1.3.101.112","EdDSA25519"),a("1.2.840.10040.4.3","dsa-with-sha1"),a("1.3.14.3.2.7","desCBC"),a("1.3.14.3.2.26","sha1"),a("2.16.840.1.101.3.4.2.1","sha256"),a("2.16.840.1.101.3.4.2.2","sha384"),a("2.16.840.1.101.3.4.2.3","sha512"),a("1.2.840.113549.2.5","md5"),a("1.2.840.113549.1.7.1","data"),a("1.2.840.113549.1.7.2","signedData"),a("1.2.840.113549.1.7.3","envelopedData"),a("1.2.840.113549.1.7.4","signedAndEnvelopedData"),a("1.2.840.113549.1.7.5","digestedData"),a("1.2.840.113549.1.7.6","encryptedData"),a("1.2.840.113549.1.9.1","emailAddress"),a("1.2.840.113549.1.9.2","unstructuredName"),a("1.2.840.113549.1.9.3","contentType"),a("1.2.840.113549.1.9.4","messageDigest"),a("1.2.840.113549.1.9.5","signingTime"),a("1.2.840.113549.1.9.6","counterSignature"),a("1.2.840.113549.1.9.7","challengePassword"),a("1.2.840.113549.1.9.8","unstructuredAddress"),a("1.2.840.113549.1.9.14","extensionRequest"),a("1.2.840.113549.1.9.20","friendlyName"),a("1.2.840.113549.1.9.21","localKeyId"),a("1.2.840.113549.1.9.22.1","x509Certificate"),a("1.2.840.113549.1.12.10.1.1","keyBag"),a("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),a("1.2.840.113549.1.12.10.1.3","certBag"),a("1.2.840.113549.1.12.10.1.4","crlBag"),a("1.2.840.113549.1.12.10.1.5","secretBag"),a("1.2.840.113549.1.12.10.1.6","safeContentsBag"),a("1.2.840.113549.1.5.13","pkcs5PBES2"),a("1.2.840.113549.1.5.12","pkcs5PBKDF2"),a("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),a("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),a("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),a("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),a("1.2.840.113549.2.7","hmacWithSHA1"),a("1.2.840.113549.2.8","hmacWithSHA224"),a("1.2.840.113549.2.9","hmacWithSHA256"),a("1.2.840.113549.2.10","hmacWithSHA384"),a("1.2.840.113549.2.11","hmacWithSHA512"),a("1.2.840.113549.3.7","des-EDE3-CBC"),a("2.16.840.1.101.3.4.1.2","aes128-CBC"),a("2.16.840.1.101.3.4.1.22","aes192-CBC"),a("2.16.840.1.101.3.4.1.42","aes256-CBC"),a("2.5.4.3","commonName"),a("2.5.4.5","serialName"),a("2.5.4.6","countryName"),a("2.5.4.7","localityName"),a("2.5.4.8","stateOrProvinceName"),a("2.5.4.9","streetAddress"),a("2.5.4.10","organizationName"),a("2.5.4.11","organizationalUnitName"),a("2.5.4.13","description"),a("2.5.4.15","businessCategory"),a("2.5.4.17","postalCode"),a("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),a("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),a("2.16.840.1.113730.1.1","nsCertType"),a("2.16.840.1.113730.1.13","nsComment"),o("2.5.29.1","authorityKeyIdentifier"),o("2.5.29.2","keyAttributes"),o("2.5.29.3","certificatePolicies"),o("2.5.29.4","keyUsageRestriction"),o("2.5.29.5","policyMapping"),o("2.5.29.6","subtreesConstraint"),o("2.5.29.7","subjectAltName"),o("2.5.29.8","issuerAltName"),o("2.5.29.9","subjectDirectoryAttributes"),o("2.5.29.10","basicConstraints"),o("2.5.29.11","nameConstraints"),o("2.5.29.12","policyConstraints"),o("2.5.29.13","basicConstraints"),a("2.5.29.14","subjectKeyIdentifier"),a("2.5.29.15","keyUsage"),o("2.5.29.16","privateKeyUsagePeriod"),a("2.5.29.17","subjectAltName"),a("2.5.29.18","issuerAltName"),a("2.5.29.19","basicConstraints"),o("2.5.29.20","cRLNumber"),o("2.5.29.21","cRLReason"),o("2.5.29.22","expirationDate"),o("2.5.29.23","instructionCode"),o("2.5.29.24","invalidityDate"),o("2.5.29.25","cRLDistributionPoints"),o("2.5.29.26","issuingDistributionPoint"),o("2.5.29.27","deltaCRLIndicator"),o("2.5.29.28","issuingDistributionPoint"),o("2.5.29.29","certificateIssuer"),o("2.5.29.30","nameConstraints"),a("2.5.29.31","cRLDistributionPoints"),a("2.5.29.32","certificatePolicies"),o("2.5.29.33","policyMappings"),o("2.5.29.34","policyConstraints"),a("2.5.29.35","authorityKeyIdentifier"),o("2.5.29.36","policyConstraints"),a("2.5.29.37","extKeyUsage"),o("2.5.29.46","freshestCRL"),o("2.5.29.54","inhibitAnyPolicy"),a("1.3.6.1.4.1.11129.2.4.2","timestampList"),a("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),a("1.3.6.1.5.5.7.3.1","serverAuth"),a("1.3.6.1.5.5.7.3.2","clientAuth"),a("1.3.6.1.5.5.7.3.3","codeSigning"),a("1.3.6.1.5.5.7.3.4","emailProtection"),a("1.3.6.1.5.5.7.3.8","timeStamping")},7450:(e,t,r)=>{var n=r(3832);if(r(8925),r(3068),r(3480),r(8991),r(6270),r(8960),r(6953),r(9563),r(9372),r(8095),r(7116),void 0===i)var i=n.jsbn.BigInteger;var a=n.asn1,o=n.pki=n.pki||{};e.exports=o.pbe=n.pbe=n.pbe||{};var s=o.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},c={name:"PBES2Algorithms",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},l={name:"pkcs-12PbeParams",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"iterations"}]};function f(e,t){return e.start().update(t).digest().getBytes()}function h(e){var t;if(e){if(!(t=o.oids[a.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return p(t)}function p(e){var t=n.md;switch(e){case"hmacWithSHA224":t=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}o.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,u,c,l=n.random.getBytesSync(r.saltSize),f=r.count,h=a.integerToDer(f);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var d,y,v;switch(r.algorithm){case"aes128":i=16,d=16,y=s["aes128-CBC"],v=n.aes.createEncryptionCipher;break;case"aes192":i=24,d=16,y=s["aes192-CBC"],v=n.aes.createEncryptionCipher;break;case"aes256":i=32,d=16,y=s["aes256-CBC"],v=n.aes.createEncryptionCipher;break;case"des":i=8,d=8,y=s.desCBC,v=n.des.createEncryptionCipher;break;default:throw(C=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,C}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),m=p(g),b=n.pkcs5.pbkdf2(t,l,f,i,m),E=n.random.getBytesSync(d);(w=v(b)).start(E),w.update(a.toDer(e)),w.finish(),c=w.output.getBytes();var S=function(e,t,r,i){var s=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,e),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,t.getBytes())]);"hmacWithSHA1"!==i&&s.value.push(a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o.oids[i]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]));return s}(l,h,i,g);u=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s.pkcs5PBES2).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s.pkcs5PBKDF2).getBytes()),S]),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(y).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,E)])])])}else{var C;if("3des"!==r.algorithm)throw(C=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,C;i=24;var w,T=new n.util.ByteBuffer(l);b=o.pbe.generatePkcs12Key(t,T,1,f,i),E=o.pbe.generatePkcs12Key(t,T,2,f,i);(w=n.des.createEncryptionCipher(b)).start(E),w.update(a.toDer(e)),w.finish(),c=w.output.getBytes(),u=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,l),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,h.getBytes())])])}return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[u,a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,c)])},o.decryptPrivateKeyInfo=function(e,t){var r=null,i={},s=[];if(!a.validate(e,u,i,s)){var c=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw c.errors=s,c}var l=a.derToOid(i.encryptionOid),f=o.pbe.getCipher(l,i.encryptionParams,t),h=n.util.createBuffer(i.encryptedData);return f.update(h),f.finish()&&(r=a.fromDer(f.output)),r},o.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:a.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},o.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return a.fromDer(t.body)},o.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=o.wrapRsaPrivateKey(o.privateKeyToAsn1(e));return i=o.encryptPrivateKeyInfo(i,t,r),o.encryptedPrivateKeyToPem(i)}var s,u,c,l;switch(r.algorithm){case"aes128":s="AES-128-CBC",c=16,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",c=24,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",c=32,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",c=24,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;case"des":s="DES-CBC",c=8,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;default:var f=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw f.algorithm=r.algorithm,f}var h=l(n.pbe.opensslDeriveBytes(t,u.substr(0,8),c));h.start(u),h.update(a.toDer(o.privateKeyToAsn1(e))),h.finish();var p={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:s,parameters:n.util.bytesToHex(u).toUpperCase()},body:h.output.getBytes()};return n.pem.encode(p)},o.decryptRsaPrivateKey=function(e,t){var r=null,i=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(c=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=c,c;if(i.procType&&"ENCRYPTED"===i.procType.type){var s,u;switch(i.dekInfo.algorithm){case"DES-CBC":s=8,u=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,u=n.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,u=n.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,u=n.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,u=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,u=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":s=8,u=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":s=16,u=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var c;throw(c=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,c}var l=n.util.hexToBytes(i.dekInfo.parameters),f=u(n.pbe.opensslDeriveBytes(t,l.substr(0,8),s));if(f.start(l),f.update(n.util.createBuffer(i.body)),!f.finish())return r;r=f.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?o.decryptPrivateKeyInfo(a.fromDer(r),t):a.fromDer(r))&&(r=o.privateKeyFromAsn1(r)),r},o.pbe.generatePkcs12Key=function(e,t,r,i,a,o){var s,u;if(null==o){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');o=n.md.sha1.create()}var c=o.digestLength,l=o.blockLength,f=new n.util.ByteBuffer,h=new n.util.ByteBuffer;if(null!=e){for(u=0;u<e.length;u++)h.putInt16(e.charCodeAt(u));h.putInt16(0)}var p=h.length(),d=t.length(),y=new n.util.ByteBuffer;y.fillWithByte(r,l);var v=l*Math.ceil(d/l),g=new n.util.ByteBuffer;for(u=0;u<v;u++)g.putByte(t.at(u%d));var m=l*Math.ceil(p/l),b=new n.util.ByteBuffer;for(u=0;u<m;u++)b.putByte(h.at(u%p));var E=g;E.putBuffer(b);for(var S=Math.ceil(a/c),C=1;C<=S;C++){var w=new n.util.ByteBuffer;w.putBytes(y.bytes()),w.putBytes(E.bytes());for(var T=0;T<i;T++)o.start(),o.update(w.getBytes()),w=o.digest();var A=new n.util.ByteBuffer;for(u=0;u<l;u++)A.putByte(w.at(u%c));var I=Math.ceil(d/l)+Math.ceil(p/l),k=new n.util.ByteBuffer;for(s=0;s<I;s++){var _=new n.util.ByteBuffer(E.getBytes(l)),B=511;for(u=A.length()-1;u>=0;u--)B>>=8,B+=A.at(u)+_.at(u),_.setAt(u,255&B);k.putBuffer(_)}E=k,f.putBuffer(w)}return f.truncate(f.length()-a),f},o.pbe.getCipher=function(e,t,r){switch(e){case o.oids.pkcs5PBES2:return o.pbe.getCipherForPBES2(e,t,r);case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case o.oids["pbewithSHAAnd40BitRC2-CBC"]:return o.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},o.pbe.getCipherForPBES2=function(e,t,r){var i,s={},u=[];if(!a.validate(t,c,s,u))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,i;if((e=a.derToOid(s.kdfOid))!==o.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=a.derToOid(s.encOid))!==o.oids["aes128-CBC"]&&e!==o.oids["aes192-CBC"]&&e!==o.oids["aes256-CBC"]&&e!==o.oids["des-EDE3-CBC"]&&e!==o.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var l,f,p=s.kdfSalt,d=n.util.createBuffer(s.kdfIterationCount);switch(d=d.getInt(d.length()<<3),o.oids[e]){case"aes128-CBC":l=16,f=n.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,f=n.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,f=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,f=n.des.createDecryptionCipher;break;case"desCBC":l=8,f=n.des.createDecryptionCipher}var y=h(s.prfOid),v=n.pkcs5.pbkdf2(r,p,d,l,y),g=s.encIv,m=f(v);return m.start(g),m},o.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},s=[];if(!a.validate(t,l,i,s))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,y;var u,c,f,p=n.util.createBuffer(i.salt),d=n.util.createBuffer(i.iterations);switch(d=d.getInt(d.length()<<3),e){case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,c=8,f=n.des.startDecrypting;break;case o.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,c=8,f=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,y}var v=h(i.prfOid),g=o.pbe.generatePkcs12Key(r,p,1,d,u,v);return v.start(),f(g,o.pbe.generatePkcs12Key(r,p,2,d,c,v))},o.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var a=[f(i,e+t)],o=16,s=1;o<r;++s,o+=16)a.push(f(i,a[s-1]+e+t));return a.join("").substr(0,r)}},8960:(e,t,r)=>{var n=r(3832);r(6607),r(8991),r(7116);var i,a=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(i=r(5819)),e.exports=n.pbkdf2=a.pbkdf2=function(e,t,r,a,o,s){if("function"==typeof o&&(s=o,o=null),n.util.isNodejs&&!n.options.usePureJavaScript&&i.pbkdf2&&(null===o||"object"!=typeof o)&&(i.pbkdf2Sync.length>4||!o||"sha1"===o))return"string"!=typeof o&&(o="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),s?4===i.pbkdf2Sync.length?i.pbkdf2(e,t,r,a,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):i.pbkdf2(e,t,r,a,o,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):4===i.pbkdf2Sync.length?i.pbkdf2Sync(e,t,r,a).toString("binary"):i.pbkdf2Sync(e,t,r,a,o).toString("binary");if(null==o&&(o="sha1"),"string"==typeof o){if(!(o in n.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=n.md[o].create()}var u=o.digestLength;if(a>4294967295*u){var c=new Error("Derived key is too long.");if(s)return s(c);throw c}var l=Math.ceil(a/u),f=a-(l-1)*u,h=n.hmac.create();h.start(o,e);var p,d,y,v="";if(!s){for(var g=1;g<=l;++g){h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(g)),p=y=h.digest().getBytes();for(var m=2;m<=r;++m)h.start(null,null),h.update(y),d=h.digest().getBytes(),p=n.util.xorBytes(p,d,u),y=d;v+=g<l?p:p.substr(0,f)}return v}g=1;function b(){if(g>l)return s(null,v);h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(g)),p=y=h.digest().getBytes(),m=2,E()}function E(){if(m<=r)return h.start(null,null),h.update(y),d=h.digest().getBytes(),p=n.util.xorBytes(p,d,u),y=d,++m,n.util.setImmediate(E);v+=g<l?p:p.substr(0,f),++g,b()}b()}},6953:(e,t,r)=>{var n=r(3832);r(7116);var i=e.exports=n.pem=n.pem||{};function a(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+"\r\n";var a=0,o=-1;for(i=0;i<t.length;++i,++a)if(a>65&&-1!==o){var s=t[o];","===s?(++o,t=t.substr(0,o)+"\r\n "+t.substr(o)):t=t.substr(0,o)+"\r\n"+s+t.substr(o+1),a=i-o-1,o=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(o=i);return t}function o(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=a(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=a(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=a(r)),e.headers)for(var o=0;o<e.headers.length;++o)i+=a(e.headers[o]);return e.procType&&(i+="\r\n"),i+=n.util.encode64(e.body,t.maxline||64)+"\r\n",i+="-----END "+e.type+"-----\r\n"},i.decode=function(e){for(var t,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,a=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,s=/\r?\n/;t=i.exec(e);){var u={type:t[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:n.util.decode64(t[3])};if(r.push(u),t[2]){for(var c=t[2].split(s),l=0;t&&l<c.length;){for(var f=c[l].replace(/\s+$/,""),h=l+1;h<c.length;++h){var p=c[h];if(!/\s/.test(p[0]))break;f+=p,l=h}if(t=f.match(a)){for(var d={name:t[1],values:[]},y=t[2].split(","),v=0;v<y.length;++v)d.values.push(o(y[v]));if(u.procType)if(u.contentDomain||"Content-Domain"!==d.name)if(u.dekInfo||"DEK-Info"!==d.name)u.headers.push(d);else{if(0===d.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');u.dekInfo={algorithm:y[0],parameters:y[1]||null}}else u.contentDomain=y[0]||"";else{if("Proc-Type"!==d.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==d.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');u.procType={version:y[0],type:y[1]}}}++l}if("ENCRYPTED"===u.procType&&!u.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}},8936:(e,t,r)=>{var n=r(3832);r(7116),r(9563),r(137);var i=e.exports=n.pkcs1=n.pkcs1||{};function a(e,t,r){r||(r=n.md.sha1.create());for(var i="",a=Math.ceil(t/r.digestLength),o=0;o<a;++o){var s=String.fromCharCode(o>>24&255,o>>16&255,o>>8&255,255&o);r.start(),r.update(e+s),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,o,s,u;"string"==typeof r?(i=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(i=r.label||void 0,o=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),s?s.start():s=n.md.sha1.create(),u||(u=s);var c=Math.ceil(e.n.bitLength()/8),l=c-2*s.digestLength-2;if(t.length>l)throw(v=new Error("RSAES-OAEP input message length is too long.")).length=t.length,v.maxLength=l,v;i||(i=""),s.update(i,"raw");for(var f=s.digest(),h="",p=l-t.length,d=0;d<p;d++)h+="\0";var y=f.getBytes()+h+""+t;if(o){if(o.length!==s.digestLength){var v;throw(v=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=o.length,v.digestLength=s.digestLength,v}}else o=n.random.getBytes(s.digestLength);var g=a(o,c-s.digestLength-1,u),m=n.util.xorBytes(y,g,y.length),b=a(m,s.digestLength,u),E=n.util.xorBytes(o,b,o.length);return"\0"+E+m},i.decode_rsa_oaep=function(e,t,r){var i,o,s;"string"==typeof r?(i=r,o=arguments[3]||void 0):r&&(i=r.label||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(s=r.mgf1.md));var u=Math.ceil(e.n.bitLength()/8);if(t.length!==u)throw(m=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,m.expectedLength=u,m;if(void 0===o?o=n.md.sha1.create():o.start(),s||(s=o),u<2*o.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),o.update(i,"raw");for(var c=o.digest().getBytes(),l=t.charAt(0),f=t.substring(1,o.digestLength+1),h=t.substring(1+o.digestLength),p=a(h,o.digestLength,s),d=n.util.xorBytes(f,p,f.length),y=a(d,u-o.digestLength-1,s),v=n.util.xorBytes(h,y,h.length),g=v.substring(0,o.digestLength),m="\0"!==l,b=0;b<o.digestLength;++b)m|=c.charAt(b)!==g.charAt(b);for(var E=1,S=o.digestLength,C=o.digestLength;C<v.length;C++){var w=v.charCodeAt(C),T=1&w^1,A=E?65534:0;m|=w&A,S+=E&=T}if(m||1!==v.charCodeAt(S))throw new Error("Invalid RSAES-OAEP padding.");return v.substring(S+1)}},5147:(e,t,r)=>{var n=r(3832);r(3068),r(6607),r(6270),r(5496),r(7450),r(9563),r(8095),r(137),r(7116),r(5414);var i=n.asn1,a=n.pki,o=e.exports=n.pkcs12=n.pkcs12||{},s={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},u={name:"PFX",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},s,{name:"PFX.macData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},c={name:"SafeBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},l={name:"Attribute",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,capture:"values"}]},f={name:"CertBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:i.Class.UNIVERSAL,type:i.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function h(e,t,r,n){for(var i=[],a=0;a<e.length;a++)for(var o=0;o<e[a].safeBags.length;o++){var s=e[a].safeBags[o];void 0!==n&&s.type!==n||(null!==t?void 0!==s.attributes[t]&&s.attributes[t].indexOf(r)>=0&&i.push(s):i.push(s))}return i}function p(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function d(e,t){var r={},o=[];if(!i.validate(e,n.pkcs7.asn1.encryptedDataValidator,r,o))throw(s=new Error("Cannot read EncryptedContentInfo.")).errors=o,s;var s,u=i.derToOid(r.contentType);if(u!==a.oids.data)throw(s=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=u,s;u=i.derToOid(r.encAlgorithm);var c=a.pbe.getCipher(u,r.encParameter,t),l=p(r.encryptedContentAsn1),f=n.util.createBuffer(l.value);if(c.update(f),!c.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return c.output.getBytes()}function y(e,t,r){if(!t&&0===e.length)return[];if((e=i.fromDer(e,t)).tagClass!==i.Class.UNIVERSAL||e.type!==i.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var n=[],o=0;o<e.value.length;o++){var s=e.value[o],u={},l=[];if(!i.validate(s,c,u,l))throw(g=new Error("Cannot read SafeBag.")).errors=l,g;var h,p,d={type:i.derToOid(u.bagId),attributes:v(u.bagAttributes)};n.push(d);var y=u.bagValue.value[0];switch(d.type){case a.oids.pkcs8ShroudedKeyBag:if(null===(y=a.decryptPrivateKeyInfo(y,r)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case a.oids.keyBag:try{d.key=a.privateKeyFromAsn1(y)}catch(e){d.key=null,d.asn1=y}continue;case a.oids.certBag:h=f,p=function(){if(i.derToOid(u.certId)!==a.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=i.derToOid(u.certId),e}var r=i.fromDer(u.cert,t);try{d.cert=a.certificateFromAsn1(r,!0)}catch(e){d.cert=null,d.asn1=r}};break;default:var g;throw(g=new Error("Unsupported PKCS#12 SafeBag type.")).oid=d.type,g}if(void 0!==h&&!i.validate(y,h,u,l))throw(g=new Error("Cannot read PKCS#12 "+h.name)).errors=l,g;p()}return n}function v(e){var t={};if(void 0!==e)for(var r=0;r<e.length;++r){var n={},o=[];if(!i.validate(e[r],l,n,o)){var s=new Error("Cannot read PKCS#12 BagAttribute.");throw s.errors=o,s}var u=i.derToOid(n.oid);if(void 0!==a.oids[u]){t[a.oids[u]]=[];for(var c=0;c<n.values.length;++c)t[a.oids[u]].push(n.values[c].value)}}return t}o.pkcs12FromAsn1=function(e,t,r){"string"==typeof t?(r=t,t=!0):void 0===t&&(t=!0);var c={};if(!i.validate(e,u,c,[]))throw(l=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=l,l;var l,f={version:c.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=n.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(r[e.bagType]=h(f.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=h(f.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(r.friendlyName=h(f.safeContents,"friendlyName",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return h(f.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return h(f.safeContents,"localKeyId",e,t)}};if(3!==c.version.charCodeAt(0))throw(l=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=c.version.charCodeAt(0),l;if(i.derToOid(c.contentType)!==a.oids.data)throw(l=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=i.derToOid(c.contentType),l;var v=c.content.value[0];if(v.tagClass!==i.Class.UNIVERSAL||v.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(v=p(v),c.mac){var g=null,m=0,b=i.derToOid(c.macAlgorithm);switch(b){case a.oids.sha1:g=n.md.sha1.create(),m=20;break;case a.oids.sha256:g=n.md.sha256.create(),m=32;break;case a.oids.sha384:g=n.md.sha384.create(),m=48;break;case a.oids.sha512:g=n.md.sha512.create(),m=64;break;case a.oids.md5:g=n.md.md5.create(),m=16}if(null===g)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+b);var E=new n.util.ByteBuffer(c.macSalt),S="macIterations"in c?parseInt(n.util.bytesToHex(c.macIterations),16):1,C=o.generateKey(r,E,3,S,m,g),w=n.hmac.create();if(w.start(g,C),w.update(v.value),w.getMac().getBytes()!==c.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return function(e,t,r,n){if((t=i.fromDer(t,r)).tagClass!==i.Class.UNIVERSAL||t.type!==i.Type.SEQUENCE||!0!==t.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var o=0;o<t.value.length;o++){var u=t.value[o],c={},l=[];if(!i.validate(u,s,c,l))throw(g=new Error("Cannot read ContentInfo.")).errors=l,g;var f={encrypted:!1},h=null,v=c.content.value[0];switch(i.derToOid(c.contentType)){case a.oids.data:if(v.tagClass!==i.Class.UNIVERSAL||v.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");h=p(v).value;break;case a.oids.encryptedData:h=d(v,n),f.encrypted=!0;break;default:var g;throw(g=new Error("Unsupported PKCS#12 contentType.")).contentType=i.derToOid(c.contentType),g}f.safeBags=y(h,r,n),e.safeContents.push(f)}}(f,v.value,t,r),f},o.toPkcs12Asn1=function(e,t,r,s){(s=s||{}).saltSize=s.saltSize||8,s.count=s.count||2048,s.algorithm=s.algorithm||s.encAlgorithm||"aes128","useMac"in s||(s.useMac=!0),"localKeyId"in s||(s.localKeyId=null),"generateLocalKeyId"in s||(s.generateLocalKeyId=!0);var u,c=s.localKeyId;if(null!==c)c=n.util.hexToBytes(c);else if(s.generateLocalKeyId)if(t){var l=n.util.isArray(t)?t[0]:t;"string"==typeof l&&(l=a.certificateFromPem(l)),(k=n.md.sha1.create()).update(i.toDer(a.certificateToAsn1(l)).getBytes()),c=k.digest().getBytes()}else c=n.random.getBytes(20);var f=[];null!==c&&f.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.localKeyId).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,c)])])),"friendlyName"in s&&f.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.friendlyName).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.BMPSTRING,!1,s.friendlyName)])])),f.length>0&&(u=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,f));var h=[],p=[];null!==t&&(p=n.util.isArray(t)?t:[t]);for(var d=[],y=0;y<p.length;++y){"string"==typeof(t=p[y])&&(t=a.certificateFromPem(t));var v=0===y?u:void 0,g=a.certificateToAsn1(t),m=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.certBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.x509Certificate).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(g).getBytes())])])]),v]);d.push(m)}if(d.length>0){var b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,d),E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(b).getBytes())])]);h.push(E)}var S=null;if(null!==e){var C=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));S=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[C]),u]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[a.encryptPrivateKeyInfo(C,r,s)]),u]);var w=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[S]),T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(w).getBytes())])]);h.push(T)}var A,I=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,h);if(s.useMac){var k=n.md.sha1.create(),_=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),B=s.count,N=(e=o.generateKey(r,_,3,B,20),n.hmac.create());N.start(k,e),N.update(i.toDer(I).getBytes());var O=N.getMac();A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,O.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,_.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(B).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(I).getBytes())])]),A])},o.generateKey=n.pbe.generatePkcs12Key},9437:(e,t,r)=>{var n=r(3832);r(8925),r(3068),r(3480),r(6270),r(6953),r(5496),r(9563),r(7116),r(5414);var i=n.asn1,a=e.exports=n.pkcs7=n.pkcs7||{};function o(e){var t={},r=[];if(!i.validate(e,a.asn1.recipientInfoValidator,t,r)){var o=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw o.errors=r,o}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function s(e){for(var t,r=[],a=0;a<e.length;++a)r.push((t=e[a],i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:t.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(t.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.encryptedContent.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.encryptedContent.content)])));return r}function u(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.digestAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),a=0;a<e.unauthenticatedAttributes.length;++a){var o=e.unauthenticatedAttributes[a];r.values.push(c(o))}t.value.push(r)}return t}function c(e){var t;if(e.type===n.pki.oids.contentType)t=i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.value).getBytes());else if(e.type===n.pki.oids.messageDigest)t=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===n.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),a=new Date("2050-01-01T00:00:00Z"),o=e.value;if("string"==typeof o){var s=Date.parse(o);o=isNaN(s)?13===o.length?i.utcTimeToDate(o):i.generalizedTimeToDate(o):new Date(s)}t=o>=r&&o<a?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(o)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(o))}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[t])])}function l(e,t,r){var a={};if(!i.validate(t,r,a,[])){var o=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw o.errors=o,o}if(i.derToOid(a.contentType)!==n.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(a.encryptedContent){var s="";if(n.util.isArray(a.encryptedContent))for(var u=0;u<a.encryptedContent.length;++u){if(a.encryptedContent[u].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");s+=a.encryptedContent[u].value}else s=a.encryptedContent;e.encryptedContent={algorithm:i.derToOid(a.encAlgorithm),parameter:n.util.createBuffer(a.encParameter.value),content:n.util.createBuffer(s)}}if(a.content){s="";if(n.util.isArray(a.content))for(u=0;u<a.content.length;++u){if(a.content[u].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");s+=a.content[u].value}else s=a.content;e.content=n.util.createBuffer(s)}return e.version=a.version.charCodeAt(0),e.rawCapture=a,a}function f(e){if(void 0===e.encryptedContent.key)throw new Error("Symmetric key not available.");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case n.pki.oids["aes128-CBC"]:case n.pki.oids["aes192-CBC"]:case n.pki.oids["aes256-CBC"]:t=n.aes.createDecryptionCipher(e.encryptedContent.key);break;case n.pki.oids.desCBC:case n.pki.oids["des-EDE3-CBC"]:t=n.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}a.messageFromPem=function(e){var t=n.pem.decode(e)[0];if("PKCS7"!==t.type){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var o=i.fromDer(t.body);return a.messageFromAsn1(o)},a.messageToPem=function(e,t){var r={type:"PKCS7",body:i.toDer(e.toAsn1()).getBytes()};return n.pem.encode(r,{maxline:t})},a.messageFromAsn1=function(e){var t={},r=[];if(!i.validate(e,a.asn1.contentInfoValidator,t,r)){var o=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw o.errors=r,o}var s,u=i.derToOid(t.contentType);switch(u){case n.pki.oids.envelopedData:s=a.createEnvelopedData();break;case n.pki.oids.encryptedData:s=a.createEncryptedData();break;case n.pki.oids.signedData:s=a.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+u+" is not (yet) supported.")}return s.fromAsn1(t.content.value[0]),s},a.createSignedData=function(){var e=null;return e={type:n.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(l(e,t,a.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var r=e.rawCapture.certificates.value,i=0;i<r.length;++i)e.certificates.push(n.pki.certificateFromAsn1(r[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],r=0;r<e.certificates.length;++r)t.push(n.pki.certificateToAsn1(e.certificates[r]));var a=[],o=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),a.length>0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,a)),o.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),o])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var a=t.certificate;"string"==typeof a&&(a=n.pki.certificateFromPem(a)),r=a.issuer.attributes,i=a.serialNumber}var o=t.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof o&&(o=n.pki.privateKeyFromPem(o));var s=t.digestAlgorithm||n.pki.oids.sha1;switch(s){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+s)}var u=t.authenticatedAttributes||[];if(u.length>0){for(var c=!1,l=!1,f=0;f<u.length;++f){var h=u[f];if(c||h.type!==n.pki.oids.contentType){if(l||h.type!==n.pki.oids.messageDigest);else if(l=!0,c)break}else if(c=!0,l)break}if(!c||!l)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:o,version:1,issuer:r,serialNumber:i,digestAlgorithm:s,signatureAlgorithm:n.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:u,unauthenticatedAttributes:[]})},sign:function(t){var r;(t=t||{},"object"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes())]),"content"in e&&(e.content instanceof n.util.ByteBuffer?r=e.content.bytes():"string"==typeof e.content&&(r=n.util.encodeUtf8(e.content)),t.detached?e.detachedContent=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r):e.contentInfo.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)]))));0!==e.signers.length&&function(t){var r;r=e.detachedContent?e.detachedContent:(r=e.contentInfo.value[1]).value[0];if(!r)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var a=i.derToOid(e.contentInfo.value[0].value),o=i.toDer(r);for(var s in o.getByte(),i.getBerValueLength(o),o=o.getBytes(),t)t[s].start().update(o);for(var l=new Date,f=0;f<e.signers.length;++f){var h=e.signers[f];if(0===h.authenticatedAttributes.length){if(a!==n.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{h.authenticatedAttributesAsn1=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var p=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[]),d=0;d<h.authenticatedAttributes.length;++d){var y=h.authenticatedAttributes[d];y.type===n.pki.oids.messageDigest?y.value=t[h.digestAlgorithm].digest():y.type===n.pki.oids.signingTime&&(y.value||(y.value=l)),p.value.push(c(y)),h.authenticatedAttributesAsn1.value.push(c(y))}o=i.toDer(p).getBytes(),h.md.start().update(o)}h.signature=h.key.sign(h.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=function(e){for(var t=[],r=0;r<e.length;++r)t.push(u(e[r]));return t}(e.signers)}(function(){for(var t={},r=0;r<e.signers.length;++r){var a=e.signers[r];(o=a.digestAlgorithm)in t||(t[o]=n.md[n.pki.oids[o]].create()),0===a.authenticatedAttributes.length?a.md=t[o]:a.md=n.md[n.pki.oids[o]].create()}for(var o in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]));return t}())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=n.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}}},a.createEncryptedData=function(){var e=null;return e={type:n.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){l(e,t,a.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),f(e)}}},a.createEnvelopedData=function(){var e=null;return e={type:n.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=l(e,t,a.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(o(e[r]));return t}(r.recipientInfos.value)},toAsn1:function(){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,s(e.recipients)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,(t=e.encryptedContent,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.parameter.getBytes())]),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.content.getBytes())])]))])])]);var t},findRecipient:function(t){for(var r=t.issuer.attributes,n=0;n<e.recipients.length;++n){var i=e.recipients[n],a=i.issuer;if(i.serialNumber===t.serialNumber&&a.length===r.length){for(var o=!0,s=0;s<r.length;++s)if(a[s].type!==r[s].type||a[s].value!==r[s].value){o=!1;break}if(o)return i}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:case n.pki.oids.desCBC:var i=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=n.util.createBuffer(i);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}f(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:n.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){var i,a,o;switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case n.pki.oids["aes128-CBC"]:i=16,a=16,o=n.aes.createEncryptionCipher;break;case n.pki.oids["aes192-CBC"]:i=24,a=16,o=n.aes.createEncryptionCipher;break;case n.pki.oids["aes256-CBC"]:i=32,a=16,o=n.aes.createEncryptionCipher;break;case n.pki.oids["des-EDE3-CBC"]:i=24,a=8,o=n.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=n.util.createBuffer(n.random.getBytes(i));else if(t.length()!=i)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+i+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=n.util.createBuffer(n.random.getBytes(a));var s=o(t);if(s.start(e.encryptedContent.parameter.copy()),s.update(e.content),!s.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=s.output}for(var u=0;u<e.recipients.length;++u){var c=e.recipients[u];if(void 0===c.encryptedContent.content)switch(c.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:c.encryptedContent.content=c.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm)}}}}}},5496:(e,t,r)=>{var n=r(3832);r(3068),r(7116);var i=n.asn1,a=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=a;var o={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};a.contentInfoValidator=o;var s={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};a.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(s)},a.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(s)};var u={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};a.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},o,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},a.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},4742:(e,t,r)=>{var n=r(3832);r(3068),r(6270),r(7450),r(6953),r(8960),r(5147),r(6007),r(8095),r(7116),r(5414);var i=n.asn1,a=e.exports=n.pki=n.pki||{};a.pemToDer=function(e){var t=n.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return n.util.createBuffer(t.body)},a.privateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var o=i.fromDer(t.body);return a.privateKeyFromAsn1(o)},a.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(a.privateKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:i.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})}},9654:(e,t,r)=>{var n=r(3832);r(7116),r(5764),r(9563),function(){if(n.prime)e.exports=n.prime;else{var t=e.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],a=new r(null);a.fromInt(30);var o=function(e,t){return e|t};t.generateProbablePrime=function(e,t,i){"function"==typeof t&&(i=t,t={});var a=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof a&&(a={name:a}),a.options=a.options||{};var o=t.prng||n.random,u={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===a.name)return function(e,t,i,a){if("workers"in i)return function(e,t,i,a){if("undefined"==typeof Worker)return s(e,t,i,a);var o=c(e,t),u=i.workers,l=i.workLoad||100,f=30*l/8,h=i.workerScript||"forge/prime.worker.js";if(-1===u)return n.util.estimateCores((function(e,t){e&&(t=2),u=t-1,p()}));function p(){u=Math.max(1,u);for(var n=[],i=0;i<u;++i)n[i]=new Worker(h);for(i=0;i<u;++i)n[i].addEventListener("message",p);var s=!1;function p(i){if(!s){0;var u=i.data;if(u.found){for(var h=0;h<n.length;++h)n[h].terminate();return s=!0,a(null,new r(u.prime,16))}o.bitLength()>e&&(o=c(e,t));var p=o.toString(16);i.target.postMessage({hex:p,workLoad:l}),o.dAddOffset(f,0)}}}p()}(e,t,i,a);return s(e,t,i,a)}(e,u,a.options,i);throw new Error("Invalid prime generation algorithm: "+a.name)}}function s(e,t,r,n){var i=c(e,t),a=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(i.bitLength());"millerRabinTests"in r&&(a=r.millerRabinTests);var o=10;"maxBlockTime"in r&&(o=r.maxBlockTime),u(i,e,t,0,a,o,n)}function u(e,t,r,a,o,s,l){var f=+new Date;do{if(e.bitLength()>t&&(e=c(t,r)),e.isProbablePrime(o))return l(null,e);e.dAddOffset(i[a++%8],0)}while(s<0||+new Date-f<s);n.util.setImmediate((function(){u(e,t,r,a,o,s,l)}))}function c(e,t){var n=new r(e,t),i=e-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),o,n),n.dAddOffset(31-n.mod(a).byteValue(),0),n}}()},4933:(e,t,r)=>{var n=r(3832);r(7116);var i=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(i=r(5819)),(e.exports=n.prng=n.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,a=new Array(32),o=0;o<32;++o)a[o]=r.create();function s(){if(t.pools[0].messageLength>=32)return u();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),u()}function u(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function c(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var a=n.util.createBuffer();if(t)for(;a.length()<e;){var o=Math.max(1,Math.min(e-a.length(),65536)/4),s=new Uint32Array(Math.floor(o));try{t(s);for(var u=0;u<s.length;++u)a.putInt32(s[u])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(a.length()<e)for(var c,l,f,h=Math.floor(65536*Math.random());a.length()<e;){l=16807*(65535&h),l+=(32767&(c=16807*(h>>16)))<<16,h=4294967295&(l=(2147483647&(l+=c>>15))+(l>>31));for(u=0;u<3;++u)f=h>>>(u<<3),f^=Math.floor(256*Math.random()),a.putByte(String.fromCharCode(255&f))}return a.getBytes(e)}return t.pools=a,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,a=t.plugin.increment,o=t.plugin.formatKey,s=t.plugin.formatSeed,c=n.util.createBuffer();t.key=null,function l(f){if(f)return r(f);if(c.length()>=e)return r(null,c.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return n.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return u(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),u(),e()}))}(l)}));var h=i(t.key,t.seed);t.generated+=h.length,c.putBytes(h),t.key=o(i(t.key,a(t.seed))),t.seed=s(i(t.key,t.seed)),n.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,a=t.plugin.formatKey,o=t.plugin.formatSeed;t.key=null;for(var u=n.util.createBuffer();u.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&s();var c=r(t.key,t.seed);t.generated+=c.length,u.putBytes(c),t.key=a(r(t.key,i(t.seed))),t.seed=o(r(t.key,t.seed))}return u.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,c(e))}catch(e){t(e)}},t.seedFileSync=c),t.collect=function(e){for(var r=e.length,n=0;n<r;++n)t.pools[t.pool].update(e.substr(n,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(e>>i&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))}},t}},6007:(e,t,r)=>{var n=r(3832);r(9563),r(7116),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,a=r.digestLength,o=e.salt||null;if("string"==typeof o&&(o=n.util.createBuffer(o)),"saltLength"in e)t=e.saltLength;else{if(null===o)throw new Error("Salt length not specified or specific salt not given.");t=o.length()}if(null!==o&&o.length()!==t)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||n.random,u={encode:function(e,u){var c,l,f=u-1,h=Math.ceil(f/8),p=e.digest().getBytes();if(h<a+t+2)throw new Error("Message is too long to encrypt.");l=null===o?s.getBytesSync(t):o.bytes();var d=new n.util.ByteBuffer;d.fillWithByte(0,8),d.putBytes(p),d.putBytes(l),r.start(),r.update(d.getBytes());var y=r.digest().getBytes(),v=new n.util.ByteBuffer;v.fillWithByte(0,h-t-a-2),v.putByte(1),v.putBytes(l);var g=v.getBytes(),m=h-a-1,b=i.generate(y,m),E="";for(c=0;c<m;c++)E+=String.fromCharCode(g.charCodeAt(c)^b.charCodeAt(c));var S=65280>>8*h-f&255;return(E=String.fromCharCode(E.charCodeAt(0)&~S)+E.substr(1))+y+String.fromCharCode(188)},verify:function(e,o,s){var u,c=s-1,l=Math.ceil(c/8);if(o=o.substr(-l),l<a+t+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==o.charCodeAt(l-1))throw new Error("Encoded message does not end in 0xBC.");var f=l-a-1,h=o.substr(0,f),p=o.substr(f,a),d=65280>>8*l-c&255;if(0!=(h.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=i.generate(p,f),v="";for(u=0;u<f;u++)v+=String.fromCharCode(h.charCodeAt(u)^y.charCodeAt(u));v=String.fromCharCode(v.charCodeAt(0)&~d)+v.substr(1);var g=l-a-t-2;for(u=0;u<g;u++)if(0!==v.charCodeAt(u))throw new Error("Leftmost octets not zero as expected");if(1!==v.charCodeAt(g))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var m=v.substr(-t),b=new n.util.ByteBuffer;return b.fillWithByte(0,8),b.putBytes(e),b.putBytes(m),r.start(),r.update(b.getBytes()),p===r.digest().getBytes()}};return u}},9563:(e,t,r)=>{var n=r(3832);r(8925),r(1668),r(4933),r(7116),n.random&&n.random.getBytes?e.exports=n.random:function(t){var r={},i=new Array(4),a=n.util.createBuffer();function o(){var e=n.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return n.aes._updateBlock(e,t,i,!1),a.putInt32(i[0]),a.putInt32(i[1]),a.putInt32(i[2]),a.putInt32(i[3]),a.getBytes()},r.increment=function(e){return++e[3],e},r.md=n.md.sha256;var s=o(),u=null,c=n.util.globalScope,l=c.crypto||c.msCrypto;if(l&&l.getRandomValues&&(u=function(e){return l.getRandomValues(e)}),n.options.usePureJavaScript||!n.util.isNodejs&&!u){if("undefined"==typeof window||window.document,s.collectInt(+new Date,32),"undefined"!=typeof navigator){var f="";for(var h in navigator)try{"string"==typeof navigator[h]&&(f+=navigator[h])}catch(e){}s.collect(f),f=null}t&&(t().mousemove((function(e){s.collectInt(e.clientX,16),s.collectInt(e.clientY,16)})),t().keypress((function(e){s.collectInt(e.charCode,8)})))}if(n.random)for(var h in s)n.random[h]=s[h];else n.random=s;n.random.createInstance=o,e.exports=n.random}("undefined"!=typeof jQuery?jQuery:null)},9372:(e,t,r)=>{var n=r(3832);r(7116);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],a=[1,2,3,5],o=function(e,t){return e<<t&65535|(65535&e)>>16-t},s=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,a=e,o=e.length(),s=t,u=Math.ceil(s/8),c=255>>(7&s);for(r=o;r<128;r++)a.putByte(i[a.at(r-1)+a.at(r-o)&255]);for(a.setAt(128-u,i[a.at(128-u)&c]),r=127-u;r>=0;r--)a.setAt(r,i[a.at(r+1)^a.at(r+u)]);return a};var u=function(e,t,r){var i,u,c,l,f=!1,h=null,p=null,d=null,y=[];for(e=n.rc2.expandKey(e,t),c=0;c<64;c++)y.push(e.getInt16Le());r?(i=function(e){for(c=0;c<4;c++)e[c]+=y[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),e[c]=o(e[c],a[c]),l++},u=function(e){for(c=0;c<4;c++)e[c]+=y[63&e[(c+3)%4]]}):(i=function(e){for(c=3;c>=0;c--)e[c]=s(e[c],a[c]),e[c]-=y[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),l--},u=function(e){for(c=3;c>=0;c--)e[c]-=y[63&e[(c+3)%4]]});var v=function(e){var t=[];for(c=0;c<4;c++){var n=h.getInt16Le();null!==d&&(r?n^=d.getInt16Le():d.putInt16Le(n)),t.push(65535&n)}l=r?0:63;for(var i=0;i<e.length;i++)for(var a=0;a<e[i][0];a++)e[i][1](t);for(c=0;c<4;c++)null!==d&&(r?d.putInt16Le(t[c]):t[c]^=d.getInt16Le()),p.putInt16Le(t[c])},g=null;return g={start:function(e,t){e&&"string"==typeof e&&(e=n.util.createBuffer(e)),f=!1,h=n.util.createBuffer(),p=t||new n.util.createBuffer,d=e,g.output=p},update:function(e){for(f||h.putBuffer(e);h.length()>=8;)v([[5,i],[1,u],[6,i],[1,u],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,h,!r);else{var n=8===h.length()?8:8-h.length();h.fillWithByte(n,n)}if(t&&(f=!0,g.update()),!r&&(t=0===h.length()))if(e)t=e(8,p,!r);else{var i=p.length(),a=p.at(i-1);a>i?t=!1:p.truncate(a)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return u(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return u(e,t,!1)}},8095:(e,t,r)=>{var n=r(3832);if(r(3068),r(5764),r(6270),r(8936),r(9654),r(9563),r(7116),void 0===i)var i=n.jsbn.BigInteger;var a=n.util.isNodejs?r(5819):null,o=n.asn1,s=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,c=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},f={name:"RSAPrivateKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},h={name:"RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},p=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d=function(e){var t;if(!(e.algorithm in u.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=u.oids[e.algorithm];var n=o.oidToDer(t).getBytes(),i=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),a=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]);a.value.push(o.create(o.Class.UNIVERSAL,o.Type.OID,!1,n)),a.value.push(o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,""));var s=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(s),o.toDer(i).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var a;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{a=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(a.compareTo(t.n)>=0||!a.gcd(t.n).equals(i.ONE));for(var o=(e=e.multiply(a.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);o.compareTo(s)<0;)o=o.add(t.p);var u=o.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return u=u.multiply(a.modInverse(t.n)).mod(t.n)};function v(e,t,r){var i=n.util.createBuffer(),a=Math.ceil(t.n.bitLength()/8);if(e.length>a-11){var o=new Error("Message is too long for PKCS#1 v1.5 padding.");throw o.length=e.length,o.max=a-11,o}i.putByte(0),i.putByte(r);var s,u=a-3-e.length;if(0===r||1===r){s=0===r?0:255;for(var c=0;c<u;++c)i.putByte(s)}else for(;u>0;){var l=0,f=n.random.getBytes(u);for(c=0;c<u;++c)0===(s=f.charCodeAt(c))?++l:i.putByte(s);u=l}return i.putByte(0),i.putBytes(e),i}function g(e,t,r,i){var a=Math.ceil(t.n.bitLength()/8),o=n.util.createBuffer(e),s=o.getByte(),u=o.getByte();if(0!==s||r&&0!==u&&1!==u||!r&&2!=u||r&&0===u&&void 0===i)throw new Error("Encryption block is invalid.");var c=0;if(0===u){c=a-3-i;for(var l=0;l<c;++l)if(0!==o.getByte())throw new Error("Encryption block is invalid.")}else if(1===u)for(c=0;o.length()>1;){if(255!==o.getByte()){--o.read;break}++c}else if(2===u)for(c=0;o.length()>1;){if(0===o.getByte()){--o.read;break}++c}if(0!==o.getByte()||c!==a-3-o.length())throw new Error("Encryption block is invalid.");return o.getBytes()}function m(e,t,r){"function"==typeof t&&(r=t,t={});var a={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function o(){s(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?c(t,e.q):void s(e.qBits,c))}))}function s(e,t){n.prime.generateProbablePrime(e,a,t)}function c(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var a=e.p;e.p=e.q,e.q=a}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void o();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void s(e.qBits,c);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void o();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void s(e.qBits,c);var l=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(a.prng=t.prng),o()}function b(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function E(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function S(e){return n.util.isNodejs&&"function"==typeof a[e]}function C(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.crypto&&"object"==typeof s.globalScope.crypto.subtle&&"function"==typeof s.globalScope.crypto.subtle[e]}function w(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.msCrypto&&"object"==typeof s.globalScope.msCrypto.subtle&&"function"==typeof s.globalScope.msCrypto.subtle[e]}function T(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}u.rsa.encrypt=function(e,t,r){var a,o=r,s=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(o=2===r,a=v(e,t,r)):(a=n.util.createBuffer()).putBytes(e);for(var u=new i(a.toHex(),16),c=y(u,t,o).toString(16),l=n.util.createBuffer(),f=s-Math.ceil(c.length/2);f>0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),l.getBytes()},u.rsa.decrypt=function(e,t,r,a){var o=Math.ceil(t.n.bitLength()/8);if(e.length!==o){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=o,s}var u=new i(n.util.createBuffer(e).toHex(),16);if(u.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var c=y(u,t,r).toString(16),l=n.util.createBuffer(),f=o-Math.ceil(c.length/2);f>0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),!1!==a?g(l.getBytes(),t,r):l.getBytes()},u.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var a,o=(r=r||{}).prng||n.random,s={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},u=r.algorithm||"PRIMEINC";if("PRIMEINC"!==u)throw new Error("Invalid key generation algorithm: "+u);return(a={algorithm:u,state:0,bits:e,rng:s,eInt:t||65537,e:new i(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(a.eInt),a},u.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,a=0,o=function(e,t){return e|t},s=+new Date,l=0;null===e.keys&&(t<=0||l<t);){if(0===e.state){var f=null===e.p?e.pBits:e.qBits,h=f-1;0===e.pqState?(e.num=new i(f,e.rng),e.num.testBit(h)||e.num.bitwiseTo(i.ONE.shiftLeft(h),o,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),a=0,++e.pqState):1===e.pqState?e.num.bitLength()>f?e.pqState=0:e.num.isProbablePrime(E(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(c[a++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var p=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,p,e.p,e.q,p.mod(e.p1),p.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)}}l+=(n=+new Date)-s,s=n}return null!==e.keys},u.rsa.generateKeyPair=function(e,t,r,i){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(i=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(i=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,i=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(i=r,r=void 0):(i=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(i){if(S("generateKeyPair"))return a.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return i(e);i(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(t)})}));if(C("generateKey")&&C("exportKey"))return s.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:T(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return s.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){i(e)})).then((function(e){if(e){var t=u.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(e)));i(null,{privateKey:t,publicKey:u.setRsaPublicKey(t.n,t.e)})}}));if(w("generateKey")&&w("exportKey")){var c=s.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:T(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(e){var t=e.target.result,r=s.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=u.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(t)));i(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){i(e)}},void(c.onerror=function(e){i(e)})}}else if(S("generateKeyPairSync")){var l=a.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(l.privateKey),publicKey:u.publicKeyFromPem(l.publicKey)}}var f=u.rsa.createKeyPairGenerationState(e,t,r);if(!i)return u.rsa.stepKeyPairGenerationState(f,0),f.keys;m(f,r,i)},u.setRsaPublicKey=u.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return v(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var a=t.encode(e,r,!0);return u.rsa.encrypt(a,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=g(t,r,!0),e===o.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=g(t,r,!0))}});var i=u.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(e,t,r,i,a,o,s,c){var l={n:e,e:t,d:r,p:i,q:a,dP:o,dQ:s,qInv:c,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=u.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:g};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,l,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:d},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,l.n.bitLength());return u.rsa.encrypt(n,l,r)}};return l},u.wrapRsaPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(e).getBytes())])},u.privateKeyFromAsn1=function(e){var t,r,a,s,c,h,p,d,y={},v=[];if(o.validate(e,l,y,v)&&(e=o.fromDer(n.util.createBuffer(y.privateKey))),y={},v=[],!o.validate(e,f,y,v)){var g=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw g.errors=v,g}return t=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),a=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),s=n.util.createBuffer(y.privateKeyPrime1).toHex(),c=n.util.createBuffer(y.privateKeyPrime2).toHex(),h=n.util.createBuffer(y.privateKeyExponent1).toHex(),p=n.util.createBuffer(y.privateKeyExponent2).toHex(),d=n.util.createBuffer(y.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(t,16),new i(r,16),new i(a,16),new i(s,16),new i(c,16),new i(h,16),new i(p,16),new i(d,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.d)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.p)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.q)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dP)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dQ)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.qInv))])},u.publicKeyFromAsn1=function(e){var t={},r=[];if(o.validate(e,p,t,r)){var a,s=o.derToOid(t.publicKeyOid);if(s!==u.oids.rsaEncryption)throw(a=new Error("Cannot read public key. Unknown OID.")).oid=s,a;e=t.rsaPublicKey}if(r=[],!o.validate(e,h,t,r))throw(a=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,a;var c=n.util.createBuffer(t.publicKeyModulus).toHex(),l=n.util.createBuffer(t.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(c,16),new i(l,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(e)])])},u.publicKeyToRSAPublicKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e))])}},137:(e,t,r)=>{var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),o=!0);var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a<r;++a)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(a,o){"utf8"===o&&(a=n.util.encodeUtf8(a));var u=a.length;i.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(a),s(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var u,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f<i.fullMessageLength.length-1;++f)l+=(u=8*i.fullMessageLength[f+1])/4294967296>>>0,o.putInt32(l>>>0),l=u>>>0;o.putInt32(l);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};s(h,r,o);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p},i};var a=null,o=!1;function s(e,t,r){for(var n,i,a,o,s,u,c,l=r.length();l>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,u=e.h4,c=0;c<16;++c)n=r.getInt32(),t[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<20;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<32;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<40;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<60;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a&o|s&(a^o))+u+2400959708+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<80;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+3395469782+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,l-=64}}},1668:(e,t,r)=>{var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],o=!0);var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a<r;++a)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(a,o){"utf8"===o&&(a=n.util.encodeUtf8(a));var s=a.length;i.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=s[1],s[1]=s[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var s,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f<i.fullMessageLength.length-1;++f)l+=(s=8*i.fullMessageLength[f+1])/4294967296>>>0,o.putInt32(l>>>0),l=s>>>0;o.putInt32(l);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};u(h,r,o);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p.putInt32(h.h5),p.putInt32(h.h6),p.putInt32(h.h7),p},i};var a=null,o=!1,s=null;function u(e,t,r){for(var n,i,a,o,u,c,l,f,h,p,d,y,v,g=r.length();g>=64;){for(u=0;u<16;++u)t[u]=r.getInt32();for(;u<64;++u)n=((n=t[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[u]=n+t[u-7]+i+t[u-16]|0;for(c=e.h0,l=e.h1,f=e.h2,h=e.h3,p=e.h4,d=e.h5,y=e.h6,v=e.h7,u=0;u<64;++u)a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),o=c&l|f&(c^l),n=v+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(y^p&(d^y))+s[u]+t[u],v=y,y=d,d=p,p=h+n>>>0,h=f,f=l,l=c,c=n+(i=a+o)>>>0;e.h0=e.h0+c|0,e.h1=e.h1+l|0,e.h2=e.h2+f|0,e.h3=e.h3+h|0,e.h4=e.h4+p|0,e.h5=e.h5+d|0,e.h6=e.h6+y|0,e.h7=e.h7+v|0,g-=64}}},3219:(e,t,r)=>{var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var a=n.sha384=n.sha512.sha384=n.sha512.sha384||{};a.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=a,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(e){if(s||(o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),128),u=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],(c={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],c["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],c["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],c["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],s=!0),void 0===e&&(e="SHA-512"),!(e in c))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=c[e],r=null,i=n.util.createBuffer(),a=new Array(80),f=0;f<80;++f)a[f]=new Array(2);var h=64;switch(e){case"SHA-384":h=48;break;case"SHA-512/256":h=32;break;case"SHA-512/224":h=28}var p={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:h,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){p.messageLength=0,p.fullMessageLength=p.messageLength128=[];for(var e=p.messageLengthSize/4,a=0;a<e;++a)p.fullMessageLength.push(0);i=n.util.createBuffer(),r=new Array(t.length);for(a=0;a<t.length;++a)r[a]=t[a].slice(0);return p}};return p.start(),p.update=function(e,t){"utf8"===t&&(e=n.util.encodeUtf8(e));var o=e.length;p.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=p.fullMessageLength.length-1;s>=0;--s)p.fullMessageLength[s]+=o[1],o[1]=o[0]+(p.fullMessageLength[s]/4294967296>>>0),p.fullMessageLength[s]=p.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return i.putBytes(e),l(r,a,i),(i.read>2048||0===i.length())&&i.compact(),p},p.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var s,u=p.fullMessageLength[p.fullMessageLength.length-1]+p.messageLengthSize&p.blockLength-1;t.putBytes(o.substr(0,p.blockLength-u));for(var c=8*p.fullMessageLength[0],f=0;f<p.fullMessageLength.length-1;++f)c+=(s=8*p.fullMessageLength[f+1])/4294967296>>>0,t.putInt32(c>>>0),c=s>>>0;t.putInt32(c);var h=new Array(r.length);for(f=0;f<r.length;++f)h[f]=r[f].slice(0);l(h,a,t);var d,y=n.util.createBuffer();d="SHA-512"===e?h.length:"SHA-384"===e?h.length-2:h.length-4;for(f=0;f<d;++f)y.putInt32(h[f][0]),f===d-1&&"SHA-512/224"===e||y.putInt32(h[f][1]);return y},p};var o=null,s=!1,u=null,c=null;function l(e,t,r){for(var n,i,a,o,s,c,l,f,h,p,d,y,v,g,m,b,E,S,C,w,T,A,I,k,_,B,N,O,R,x,P,F,D,L=r.length();L>=128;){for(N=0;N<16;++N)t[N][0]=r.getInt32()>>>0,t[N][1]=r.getInt32()>>>0;for(;N<80;++N)n=(((O=(x=t[N-2])[0])>>>19|(R=x[1])<<13)^(R>>>29|O<<3)^O>>>6)>>>0,i=((O<<13|R>>>19)^(R<<3|O>>>29)^(O<<26|R>>>6))>>>0,a=(((O=(F=t[N-15])[0])>>>1|(R=F[1])<<31)^(O>>>8|R<<24)^O>>>7)>>>0,o=((O<<31|R>>>1)^(O<<24|R>>>8)^(O<<25|R>>>7))>>>0,P=t[N-7],D=t[N-16],R=i+P[1]+o+D[1],t[N][0]=n+P[0]+a+D[0]+(R/4294967296>>>0)>>>0,t[N][1]=R>>>0;for(d=e[0][0],y=e[0][1],v=e[1][0],g=e[1][1],m=e[2][0],b=e[2][1],E=e[3][0],S=e[3][1],C=e[4][0],w=e[4][1],T=e[5][0],A=e[5][1],I=e[6][0],k=e[6][1],_=e[7][0],B=e[7][1],N=0;N<80;++N)l=((C>>>14|w<<18)^(C>>>18|w<<14)^(w>>>9|C<<23))>>>0,f=(I^C&(T^I))>>>0,s=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,c=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,h=(d&v|m&(d^v))>>>0,p=(y&g|b&(y^g))>>>0,R=B+(((C<<18|w>>>14)^(C<<14|w>>>18)^(w<<23|C>>>9))>>>0)+((k^w&(A^k))>>>0)+u[N][1]+t[N][1],n=_+l+f+u[N][0]+t[N][0]+(R/4294967296>>>0)>>>0,i=R>>>0,a=s+h+((R=c+p)/4294967296>>>0)>>>0,o=R>>>0,_=I,B=k,I=T,k=A,T=C,A=w,C=E+n+((R=S+i)/4294967296>>>0)>>>0,w=R>>>0,E=m,S=b,m=v,b=g,v=d,g=y,d=n+a+((R=i+o)/4294967296>>>0)>>>0,y=R>>>0;R=e[0][1]+y,e[0][0]=e[0][0]+d+(R/4294967296>>>0)>>>0,e[0][1]=R>>>0,R=e[1][1]+g,e[1][0]=e[1][0]+v+(R/4294967296>>>0)>>>0,e[1][1]=R>>>0,R=e[2][1]+b,e[2][0]=e[2][0]+m+(R/4294967296>>>0)>>>0,e[2][1]=R>>>0,R=e[3][1]+S,e[3][0]=e[3][0]+E+(R/4294967296>>>0)>>>0,e[3][1]=R>>>0,R=e[4][1]+w,e[4][0]=e[4][0]+C+(R/4294967296>>>0)>>>0,e[4][1]=R>>>0,R=e[5][1]+A,e[5][0]=e[5][0]+T+(R/4294967296>>>0)>>>0,e[5][1]=R>>>0,R=e[6][1]+k,e[6][0]=e[6][0]+I+(R/4294967296>>>0)>>>0,e[6][1]=R>>>0,R=e[7][1]+B,e[7][0]=e[7][0]+_+(R/4294967296>>>0)>>>0,e[7][1]=R>>>0,L-=128}}},7116:(e,t,r)=>{var n=r(3832),i=r(8807),a=e.exports=n.util=n.util||{};function o(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function s(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(a.isArrayBuffer(e)||a.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof s||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser)return a.nextTick=process.nextTick,void("function"==typeof setImmediate?a.setImmediate=setImmediate:a.setImmediate=a.nextTick);if("function"==typeof setImmediate)return a.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(a.nextTick=function(e){return setImmediate(e)});if(a.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",t=[];a.setImmediate=function(r){t.push(r),1===t.length&&window.postMessage(e,"*")},window.addEventListener("message",(function(r){if(r.source===window&&r.data===e){r.stopPropagation();var n=t.slice();t.length=0,n.forEach((function(e){e()}))}}),!0)}if("undefined"!=typeof MutationObserver){var r=Date.now(),n=!0,i=document.createElement("div");t=[];new MutationObserver((function(){var e=t.slice();t.length=0,e.forEach((function(e){e()}))})).observe(i,{attributes:!0});var o=a.setImmediate;a.setImmediate=function(e){Date.now()-r>15?(r=Date.now(),o(e)):(t.push(e),1===t.length&&i.setAttribute("a",n=!n))}}a.nextTick=a.setImmediate}(),a.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,a.globalScope=a.isNodejs?r.g:"undefined"==typeof self?window:self,a.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},a.isArrayBufferView=function(e){return e&&a.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},a.ByteBuffer=s,a.ByteStringBuffer=s;a.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},a.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},a.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},a.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},a.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},a.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},a.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(a.encodeUtf8(e))},a.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},a.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},a.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},a.ByteStringBuffer.prototype.putInt=function(e,t){o(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},a.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},a.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},a.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},a.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},a.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},a.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},a.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},a.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},a.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},a.ByteStringBuffer.prototype.getInt=function(e){o(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},a.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},a.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},a.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},a.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},a.ByteStringBuffer.prototype.copy=function(){var e=a.createBuffer(this.data);return e.read=this.read,e},a.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},a.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},a.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},a.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},a.ByteStringBuffer.prototype.toString=function(){return a.decodeUtf8(this.bytes())},a.DataBuffer=function(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=a.isArrayBuffer(e),n=a.isArrayBufferView(e);if(r||n)return this.data=r?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in t?t.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)},a.DataBuffer.prototype.length=function(){return this.write-this.read},a.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},a.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},a.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},a.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},a.DataBuffer.prototype.putBytes=function(e,t){if(a.isArrayBufferView(e)){var r=(n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-n.byteOffset;return this.accommodate(r),new Uint8Array(this.data.buffer,this.write).set(n),this.write+=r,this}if(a.isArrayBuffer(e)){var n=new Uint8Array(e);return this.accommodate(n.byteLength),new Uint8Array(this.data.buffer).set(n,this.write),this.write+=n.byteLength,this}if(e instanceof a.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&a.isArrayBufferView(e.data)){n=new Uint8Array(e.data.byteLength,e.read,e.length());return this.accommodate(n.byteLength),new Uint8Array(e.data.byteLength,this.write).set(n),this.write+=n.byteLength,this}if(e instanceof a.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary","string"==typeof e){var i;if("hex"===t)return this.accommodate(Math.ceil(e.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.hex.decode(e,i,this.write),this;if("base64"===t)return this.accommodate(3*Math.ceil(e.length/4)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.base64.decode(e,i,this.write),this;if("utf8"===t&&(e=a.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.raw.decode(i),this;if("utf16"===t)return this.accommodate(2*e.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=a.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},a.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},a.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},a.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},a.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},a.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},a.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},a.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},a.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},a.DataBuffer.prototype.putInt=function(e,t){o(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},a.DataBuffer.prototype.putSignedInt=function(e,t){return o(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},a.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},a.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},a.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},a.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},a.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},a.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},a.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},a.DataBuffer.prototype.getInt=function(e){o(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},a.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},a.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},a.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},a.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},a.DataBuffer.prototype.copy=function(){return new a.DataBuffer(this)},a.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},a.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},a.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},a.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},a.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return a.binary.raw.encode(t);if("hex"===e)return a.binary.hex.encode(t);if("base64"===e)return a.binary.base64.encode(t);if("utf8"===e)return a.text.utf8.decode(t);if("utf16"===e)return a.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},a.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=a.encodeUtf8(e)),new a.ByteBuffer(e)},a.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},a.xorBytes=function(e,t,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+=a},a.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},a.bytesToHex=function(e){return a.createBuffer(e).toHex()},a.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";a.encode64=function(e,t){for(var r,n,i,a="",o="",s=0;s<e.length;)r=e.charCodeAt(s++),n=e.charCodeAt(s++),i=e.charCodeAt(s++),a+=u.charAt(r>>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+=a},a.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",o=0;o<e.length;)t=c[e.charCodeAt(o++)-43],r=c[e.charCodeAt(o++)-43],n=c[e.charCodeAt(o++)-43],i=c[e.charCodeAt(o++)-43],a+=String.fromCharCode(t<<2|r>>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},a.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},a.decodeUtf8=function(e){return decodeURIComponent(escape(e))},a.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i.encode,decode:i.decode}},a.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},a.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n},a.binary.hex.encode=a.bytesToHex,a.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2)));var i=0,a=r=r||0;for(1&e.length&&(i=1,n[a++]=parseInt(e[0],16));i<e.length;i+=2)n[a++]=parseInt(e.substr(i,2),16);return t?a-r:n},a.binary.base64.encode=function(e,t){for(var r,n,i,a="",o="",s=0;s<e.byteLength;)r=e[s++],n=e[s++],i=e[s++],a+=u.charAt(r>>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+=a},a.binary.base64.decode=function(e,t,r){var n,i,a,o,s=t;s||(s=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u<e.length;)n=c[e.charCodeAt(u++)-43],i=c[e.charCodeAt(u++)-43],a=c[e.charCodeAt(u++)-43],o=c[e.charCodeAt(u++)-43],s[l++]=n<<2|i>>4,64!==a&&(s[l++]=(15&i)<<4|a>>2,64!==o&&(s[l++]=(3&a)<<6|o));return t?l-r:s.subarray(0,l)},a.binary.base58.encode=function(e,t){return a.binary.baseN.encode(e,l,t)},a.binary.base58.decode=function(e,t){return a.binary.baseN.decode(e,l,t)},a.text={utf8:{},utf16:{}},a.text.utf8.encode=function(e,t,r){e=a.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o<e.length;++o)n[i++]=e.charCodeAt(o);return t?i-r:n},a.text.utf8.decode=function(e){return a.decodeUtf8(String.fromCharCode.apply(null,e))},a.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));for(var i=new Uint16Array(n.buffer),a=r=r||0,o=r,s=0;s<e.length;++s)i[o++]=e.charCodeAt(s),a+=2;return t?a-r:n},a.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},a.deflate=function(e,t,r){if(t=a.decode64(e.deflate(a.encode64(t)).rval),r){var n=2;32&t.charCodeAt(1)&&(n=6),t=t.substring(n,t.length-4)}return t},a.inflate=function(e,t,r){var n=e.inflate(a.encode64(t)).rval;return null===n?null:a.decode64(n)};var f=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(null===r?n=e.removeItem(t):(r=a.encode64(JSON.stringify(r)),n=e.setItem(t,r)),void 0!==n&&!0!==n.rval){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},h=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(null===r.rval){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(a.decode64(r))),r},p=function(e,t,r,n){var i=h(e,t);null===i&&(i={}),i[r]=n,f(e,t,i)},d=function(e,t,r){var n=h(e,t);return null!==n&&(n=r in n?n[r]:null),n},y=function(e,t,r){var n=h(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),f(e,t,n)}},v=function(e,t){f(e,t,null)},g=function(e,t,r){var n,i=null;void 0===r&&(r=["web","flash"]);var a=!1,o=null;for(var s in r){n=r[s];try{if("flash"===n||"both"===n){if(null===t[0])throw new Error("Flash local storage not available.");i=e.apply(this,t),a="flash"===n}"web"!==n&&"both"!==n||(t[0]=localStorage,i=e.apply(this,t),a=!0)}catch(e){o=e}if(a)break}if(!a)throw o;return i};a.setItem=function(e,t,r,n,i){g(p,arguments,i)},a.getItem=function(e,t,r,n){return g(d,arguments,n)},a.removeItem=function(e,t,r,n){g(y,arguments,n)},a.clearItems=function(e,t,r){g(v,arguments,r)},a.parseUrl=function(e){var t=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;t.lastIndex=0;var r=t.exec(e),n=null===r?null:{full:e,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?(80!==n.port&&"http"===n.scheme||443!==n.port&&"https"===n.scheme)&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var m=null;a.getQueryVariables=function(e){var t,r=function(e){for(var t={},r=e.split("&"),n=0;n<r.length;n++){var i,a,o=r[n].indexOf("=");o>0?(i=r[n].substring(0,o),a=r[n].substring(o+1)):(i=r[n],a=null),i in t||(t[i]=[]),i in Object.prototype||null===a||t[i].push(unescape(a))}return t};return void 0===e?(null===m&&(m="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=m):t=r(e),t},a.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:a.getQueryVariables(r)}},a.makeRequest=function(e){var t=a.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var n;return void 0===e?n=t.query:(n=t.query[e])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},a.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},a.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},a.format=function(e){for(var t,r,n=/%./g,i=0,a=[],o=0;t=n.exec(e);){(r=e.substring(o,n.lastIndex-2)).length>0&&a.push(r),o=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":i<arguments.length?a.push(arguments[1+i++]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")},a.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+s:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-c).toFixed(a).slice(2):"")},a.formatSize=function(e){return e=e>=1073741824?a.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?a.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?a.formatNumber(e/1024,0)+" KiB":a.formatNumber(e,0)+" bytes"},a.bytesFromIP=function(e){return-1!==e.indexOf(".")?a.bytesFromIPv4(e):-1!==e.indexOf(":")?a.bytesFromIPv6(e):null},a.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=a.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()},a.bytesFromIPv6=function(e){for(var t=0,r=2*(8-(e=e.split(":").filter((function(e){return 0===e.length&&++t,!0}))).length+t),n=a.createBuffer(),i=0;i<8;++i)if(e[i]&&0!==e[i].length){var o=a.hexToBytes(e[i]);o.length<2&&n.putByte(0),n.putBytes(o)}else n.fillWithByte(0,r),r=0;return n.getBytes()},a.bytesToIP=function(e){return 4===e.length?a.bytesToIPv4(e):16===e.length?a.bytesToIPv6(e):null},a.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},a.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var o=a.bytesToHex(e[i]+e[i+1]);"0"===o[0]&&"0"!==o;)o=o.substr(1);if("0"===o){var s=r[r.length-1],u=t.length;s&&u===s.end+1?(s.end=u,s.end-s.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}t.push(o)}if(r.length>0){var c=r[n];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),0===c.start&&t.unshift(""),7===c.end&&t.push(""))}return t.join(":")},a.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in a&&!e.update)return t(null,a.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return a.cores=navigator.hardwareConcurrency,t(null,a.cores);if("undefined"==typeof Worker)return a.cores=1,t(null,a.cores);if("undefined"==typeof Blob)return a.cores=2,t(null,a.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()<r;);self.postMessage({st:t,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function e(n,i,o){if(0===i){var s=Math.floor(n.reduce((function(e,t){return e+t}),0)/n.length);return a.cores=Math.max(1,s),URL.revokeObjectURL(r),t(null,a.cores)}!function(e,t){for(var n=[],i=[],a=0;a<e;++a){var o=new Worker(r);o.addEventListener("message",(function(r){if(i.push(r.data),i.length===e){for(var a=0;a<e;++a)n[a].terminate();t(null,i)}})),n.push(o)}for(a=0;a<e;++a)n[a].postMessage(a)}(o,(function(t,r){n.push(function(e,t){for(var r=[],n=0;n<e;++n)for(var i=t[n],a=r[n]=[],o=0;o<e;++o)if(n!==o){var s=t[o];(i.st>s.st&&i.st<s.et||s.st>i.st&&s.st<i.et)&&a.push(o)}return r.reduce((function(e,t){return Math.max(e,t.length)}),0)}(o,r)),e(n,i-1,o)}))}([],5,16)}},5414:(e,t,r)=>{var n=r(3832);r(8925),r(3068),r(3480),r(8991),r(6971),r(6270),r(6953),r(6007),r(8095),r(7116);var i=n.asn1,a=e.exports=n.pki=n.pki||{},o=a.oids,s={};s.CN=o.commonName,s.commonName="CN",s.C=o.countryName,s.countryName="C",s.L=o.localityName,s.localityName="L",s.ST=o.stateOrProvinceName,s.stateOrProvinceName="ST",s.O=o.organizationName,s.organizationName="O",s.OU=o.organizationalUnitName,s.organizationalUnitName="OU",s.E=o.emailAddress,s.emailAddress="E";var u=n.pki.rsa.publicKeyValidator,c={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},l={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},f={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},u,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},h={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[f,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function p(e,t){"string"==typeof t&&(t={shortName:t});for(var r,n=null,i=0;null===n&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}a.RDNAttributesAsArray=function(e,t){for(var r,n,a,u=[],c=0;c<e.value.length;++c){r=e.value[c];for(var l=0;l<r.value.length;++l)a={},n=r.value[l],a.type=i.derToOid(n.value[0].value),a.value=n.value[1].value,a.valueTagClass=n.value[1].type,a.type in o&&(a.name=o[a.type],a.name in s&&(a.shortName=s[a.name])),t&&(t.update(a.type),t.update(a.value)),u.push(a)}return u},a.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var n=e[r],u=i.derToOid(n.value[0].value),c=n.value[1].value,l=0;l<c.length;++l){var f={};if(f.type=u,f.value=c[l].value,f.valueTagClass=c[l].type,f.type in o&&(f.name=o[f.type],f.name in s&&(f.shortName=s[f.name])),f.type===o.extensionRequest){f.extensions=[];for(var h=0;h<f.value.length;++h)f.extensions.push(a.certificateExtensionFromAsn1(f.value[h]))}t.push(f)}return t};var d=function(e,t,r){var n={};if(e!==o["RSASSA-PSS"])return n;r&&(n={hash:{algorithmOid:o.sha1},mgf:{algorithmOid:o.mgf1,hash:{algorithmOid:o.sha1}},saltLength:20});var a={},s=[];if(!i.validate(t,l,a,s)){var u=new Error("Cannot read RSASSA-PSS parameter block.");throw u.errors=s,u}return void 0!==a.hashOid&&(n.hash=n.hash||{},n.hash.algorithmOid=i.derToOid(a.hashOid)),void 0!==a.maskGenOid&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=i.derToOid(a.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=i.derToOid(a.maskGenHashOid)),void 0!==a.saltLength&&(n.saltLength=a.saltLength.charCodeAt(0)),n};function y(e){for(var t,r,a=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),o=e.attributes,s=0;s<o.length;++s){var u=(t=o[s]).value,c=i.Type.PRINTABLESTRING;"valueTagClass"in t&&(c=t.valueTagClass)===i.Type.UTF8&&(u=n.util.encodeUtf8(u)),r=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),i.create(i.Class.UNIVERSAL,c,!1,u)])]),a.value.push(r)}return a}function v(e){for(var t,r=0;r<e.length;++r){if(void 0===(t=e[r]).name&&(t.type&&t.type in a.oids?t.name=a.oids[t.type]:t.shortName&&t.shortName in s&&(t.name=a.oids[s[t.shortName]])),void 0===t.type){if(!t.name||!(t.name in a.oids))throw(u=new Error("Attribute type not specified.")).attribute=t,u;t.type=a.oids[t.name]}if(void 0===t.shortName&&t.name&&t.name in s&&(t.shortName=s[t.name]),t.type===o.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=i.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var n=0;n<t.extensions.length;++n)t.value.push(a.certificateExtensionToAsn1(g(t.extensions[n])))}var u;if(void 0===t.value)throw(u=new Error("Attribute value not specified.")).attribute=t,u}}function g(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in a.oids&&(e.name=a.oids[e.id]),void 0===e.id){if(!e.name||!(e.name in a.oids))throw(S=new Error("Extension ID not specified.")).extension=e,S;e.id=a.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var r=0,s=0,u=0;e.digitalSignature&&(s|=128,r=7),e.nonRepudiation&&(s|=64,r=6),e.keyEncipherment&&(s|=32,r=5),e.dataEncipherment&&(s|=16,r=4),e.keyAgreement&&(s|=8,r=3),e.keyCertSign&&(s|=4,r=2),e.cRLSign&&(s|=2,r=1),e.encipherOnly&&(s|=1,r=0),e.decipherOnly&&(u|=128,r=7);var c=String.fromCharCode(r);0!==u?c+=String.fromCharCode(s)+String.fromCharCode(u):0!==s&&(c+=String.fromCharCode(s)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,c)}else if("basicConstraints"===e.name)e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var l=e.value.value;for(var f in e)!0===e[f]&&(f in o?l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o[f]).getBytes())):-1!==f.indexOf(".")&&l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(f).getBytes())))}else if("nsCertType"===e.name){r=0,s=0;e.client&&(s|=128,r=7),e.server&&(s|=64,r=6),e.email&&(s|=32,r=5),e.objsign&&(s|=16,r=4),e.reserved&&(s|=8,r=3),e.sslCA&&(s|=4,r=2),e.emailCA&&(s|=2,r=1),e.objCA&&(s|=1,r=0);c=String.fromCharCode(r);0!==s&&(c+=String.fromCharCode(s)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,c)}else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var h=0;h<e.altNames.length;++h){c=(m=e.altNames[h]).value;if(7===m.type&&m.ip){if(null===(c=n.util.bytesFromIP(m.ip)))throw(S=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,S}else 8===m.type&&(c=m.oid?i.oidToDer(i.oidToDer(m.oid)):i.oidToDer(c));e.value.value.push(i.create(i.Class.CONTEXT_SPECIFIC,m.type,!1,c))}}else if("nsComment"===e.name&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var p=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=p.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,p.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;if(e.keyIdentifier){var d=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var v=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[y(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,v))}if(e.serialNumber){var g=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;var m,b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),E=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(h=0;h<e.altNames.length;++h){c=(m=e.altNames[h]).value;if(7===m.type&&m.ip){if(null===(c=n.util.bytesFromIP(m.ip)))throw(S=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,S}else 8===m.type&&(c=m.oid?i.oidToDer(i.oidToDer(m.oid)):i.oidToDer(c));E.value.push(i.create(i.Class.CONTEXT_SPECIFIC,m.type,!1,c))}b.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[E])),l.push(b)}var S;if(void 0===e.value)throw(S=new Error("Extension value not specified.")).extension=e,S;return e}function m(e,t){switch(e){case o["RSASSA-PSS"]:var r=[];return void 0!==t.hash.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.saltLength).getBytes())])),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,r);default:return i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")}}function b(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,a=0;a<r.length;++a){var o=r[a],s=o.value,u=i.Type.UTF8;"valueTagClass"in o&&(u=o.valueTagClass),u===i.Type.UTF8&&(s=n.util.encodeUtf8(s));var c=!1;"valueConstructed"in o&&(c=o.valueConstructed);var l=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,u,c,s)])]);t.value.push(l)}return t}a.certificateFromPem=function(e,t,r){var o=n.pem.decode(e)[0];if("CERTIFICATE"!==o.type&&"X509 CERTIFICATE"!==o.type&&"TRUSTED CERTIFICATE"!==o.type){var s=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw s.headerType=o.type,s}if(o.procType&&"ENCRYPTED"===o.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=i.fromDer(o.body,r);return a.certificateFromAsn1(u,t)},a.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:i.toDer(a.certificateToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.publicKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PUBLIC KEY"!==t.type&&"RSA PUBLIC KEY"!==t.type){var r=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var o=i.fromDer(t.body);return a.publicKeyFromAsn1(o)},a.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:i.toDer(a.publicKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:i.toDer(a.publicKeyToRSAPublicKey(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.getPublicKeyFingerprint=function(e,t){var r,o=(t=t||{}).md||n.md.sha1.create();switch(t.type||"RSAPublicKey"){case"RSAPublicKey":r=i.toDer(a.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":r=i.toDer(a.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}o.start(),o.update(r);var s=o.digest();if("hex"===t.encoding){var u=s.toHex();return t.delimiter?u.match(/.{2}/g).join(t.delimiter):u}if("binary"===t.encoding)return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return s},a.certificationRequestFromPem=function(e,t,r){var o=n.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==o.type){var s=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw s.headerType=o.type,s}if(o.procType&&"ENCRYPTED"===o.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var u=i.fromDer(o.body,r);return a.certificationRequestFromAsn1(u,t)},a.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:i.toDer(a.certificationRequestToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.createCertificate=function(){var e={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return p(e.issuer,t)},e.issuer.addField=function(t){v([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return p(e.subject,t)},e.subject.addField=function(t){v([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){v(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){v(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)g(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){"string"==typeof t&&(t={name:t});for(var r,n=null,i=0;null===n&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(t,r){e.md=r||n.md.sha1.create();var s=o[e.md.algorithm+"WithRSAEncryption"];if(!s){var u=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw u.algorithm=e.md.algorithm,u}e.signatureOid=e.siginfo.algorithmOid=s,e.tbsCertificate=a.getTBSCertificate(e);var c=i.toDer(e.tbsCertificate);e.md.update(c.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var s=t.issuer,u=e.subject;throw(y=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.")).expectedIssuer=s.attributes,y.actualIssuer=u.attributes,y}var c=t.md;if(null===c){if(t.signatureOid in o)switch(o[t.signatureOid]){case"sha1WithRSAEncryption":c=n.md.sha1.create();break;case"md5WithRSAEncryption":c=n.md.md5.create();break;case"sha256WithRSAEncryption":c=n.md.sha256.create();break;case"sha384WithRSAEncryption":c=n.md.sha384.create();break;case"sha512WithRSAEncryption":c=n.md.sha512.create();break;case"RSASSA-PSS":c=n.md.sha256.create()}if(null===c)throw(y=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=t.signatureOid,y;var l=t.tbsCertificate||a.getTBSCertificate(t),f=i.toDer(l);c.update(f.getBytes())}if(null!==c){var h;switch(t.signatureOid){case o.sha1WithRSAEncryption:h=void 0;break;case o["RSASSA-PSS"]:var p,d,y;if(void 0===(p=o[t.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[p])throw(y=new Error("Unsupported MGF hash function.")).oid=t.signatureParameters.mgf.hash.algorithmOid,y.name=p,y;if(void 0===(d=o[t.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[d])throw(y=new Error("Unsupported MGF function.")).oid=t.signatureParameters.mgf.algorithmOid,y.name=d,y;if(d=n.mgf[d].create(n.md[p].create()),void 0===(p=o[t.signatureParameters.hash.algorithmOid])||void 0===n.md[p])throw{message:"Unsupported RSASSA-PSS hash function.",oid:t.signatureParameters.hash.algorithmOid,name:p};h=n.pss.create(n.md[p].create(),d,t.signatureParameters.saltLength)}r=e.publicKey.verify(c.digest().getBytes(),t.signature,h)}return r},e.isIssuer=function(t){var r=!1,n=e.issuer,i=t.subject;if(n.hash&&i.hash)r=n.hash===i.hash;else if(n.attributes.length===i.attributes.length){var a,o;r=!0;for(var s=0;r&&s<n.attributes.length;++s)a=n.attributes[s],o=i.attributes[s],a.type===o.type&&a.value===o.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return a.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=o.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var i=e.extensions[r];if(i.id===t){var a=e.generateSubjectKeyIdentifier().getBytes();return n.util.hexToBytes(i.subjectKeyIdentifier)===a}}return!1},e},a.certificateFromAsn1=function(e,t){var r={},s=[];if(!i.validate(e,c,r,s))throw(h=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=s,h;if(i.derToOid(r.publicKeyOid)!==a.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var u=a.createCertificate();u.version=r.certVersion?r.certVersion.charCodeAt(0):0;var l=n.util.createBuffer(r.certSerialNumber);u.serialNumber=l.toHex(),u.signatureOid=n.asn1.derToOid(r.certSignatureOid),u.signatureParameters=d(u.signatureOid,r.certSignatureParams,!0),u.siginfo.algorithmOid=n.asn1.derToOid(r.certinfoSignatureOid),u.siginfo.parameters=d(u.siginfo.algorithmOid,r.certinfoSignatureParams,!1),u.signature=r.certSignature;var f=[];if(void 0!==r.certValidity1UTCTime&&f.push(i.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&f.push(i.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&f.push(i.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&f.push(i.generalizedTimeToDate(r.certValidity4GeneralizedTime)),f.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=f[0],u.validity.notAfter=f[1],u.tbsCertificate=r.tbsCertificate,t){var h;if(u.md=null,u.signatureOid in o)switch(o[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create();break;case"RSASSA-PSS":u.md=n.md.sha256.create()}if(null===u.md)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=u.signatureOid,h;var y=i.toDer(u.tbsCertificate);u.md.update(y.getBytes())}var g=n.md.sha1.create();u.issuer.getField=function(e){return p(u.issuer,e)},u.issuer.addField=function(e){v([e]),u.issuer.attributes.push(e)},u.issuer.attributes=a.RDNAttributesAsArray(r.certIssuer,g),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=g.digest().toHex();var m=n.md.sha1.create();return u.subject.getField=function(e){return p(u.subject,e)},u.subject.addField=function(e){v([e]),u.subject.attributes.push(e)},u.subject.attributes=a.RDNAttributesAsArray(r.certSubject,m),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=m.digest().toHex(),r.certExtensions?u.extensions=a.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},a.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r<e.value.length;++r)for(var n=e.value[r],i=0;i<n.value.length;++i)t.push(a.certificateExtensionFromAsn1(n.value[i]));return t},a.certificateExtensionFromAsn1=function(e){var t={};if(t.id=i.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===i.Type.BOOLEAN?(t.critical=0!==e.value[1].value.charCodeAt(0),t.value=e.value[2].value):t.value=e.value[1].value,t.id in o)if(t.name=o[t.id],"keyUsage"===t.name){var r=0,a=0;(u=i.fromDer(t.value)).value.length>1&&(r=u.value.charCodeAt(1),a=u.value.length>2?u.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&a)}else if("basicConstraints"===t.name){(u=i.fromDer(t.value)).value.length>0&&u.value[0].type===i.Type.BOOLEAN?t.cA=0!==u.value[0].value.charCodeAt(0):t.cA=!1;var s=null;u.value.length>0&&u.value[0].type===i.Type.INTEGER?s=u.value[0].value:u.value.length>1&&(s=u.value[1].value),null!==s&&(t.pathLenConstraint=i.derToInteger(s))}else if("extKeyUsage"===t.name)for(var u=i.fromDer(t.value),c=0;c<u.value.length;++c){var l=i.derToOid(u.value[c].value);l in o?t[o[l]]=!0:t[l]=!0}else if("nsCertType"===t.name){r=0;(u=i.fromDer(t.value)).value.length>1&&(r=u.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var f;t.altNames=[];u=i.fromDer(t.value);for(var h=0;h<u.value.length;++h){var p={type:(f=u.value[h]).type,value:f.value};switch(t.altNames.push(p),f.type){case 1:case 2:case 6:break;case 7:p.ip=n.util.bytesToIP(f.value);break;case 8:p.oid=i.derToOid(f.value)}}}else if("subjectKeyIdentifier"===t.name){u=i.fromDer(t.value);t.subjectKeyIdentifier=n.util.bytesToHex(u.value)}return t},a.certificationRequestFromAsn1=function(e,t){var r={},s=[];if(!i.validate(e,h,r,s))throw(c=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=s,c;if(i.derToOid(r.publicKeyOid)!==a.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var u=a.createCertificationRequest();if(u.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,u.signatureOid=n.asn1.derToOid(r.csrSignatureOid),u.signatureParameters=d(u.signatureOid,r.csrSignatureParams,!0),u.siginfo.algorithmOid=n.asn1.derToOid(r.csrSignatureOid),u.siginfo.parameters=d(u.siginfo.algorithmOid,r.csrSignatureParams,!1),u.signature=r.csrSignature,u.certificationRequestInfo=r.certificationRequestInfo,t){var c;if(u.md=null,u.signatureOid in o)switch(o[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create();break;case"RSASSA-PSS":u.md=n.md.sha256.create()}if(null===u.md)throw(c=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=u.signatureOid,c;var l=i.toDer(u.certificationRequestInfo);u.md.update(l.getBytes())}var f=n.md.sha1.create();return u.subject.getField=function(e){return p(u.subject,e)},u.subject.addField=function(e){v([e]),u.subject.attributes.push(e)},u.subject.attributes=a.RDNAttributesAsArray(r.certificationRequestInfoSubject,f),u.subject.hash=f.digest().toHex(),u.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),u.getAttribute=function(e){return p(u,e)},u.addAttribute=function(e){v([e]),u.attributes.push(e)},u.attributes=a.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),u},a.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return p(e.subject,t)},e.subject.addField=function(t){v([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return p(e,t)},e.addAttribute=function(t){v([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){v(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){v(t),e.attributes=t},e.sign=function(t,r){e.md=r||n.md.sha1.create();var s=o[e.md.algorithm+"WithRSAEncryption"];if(!s){var u=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw u.algorithm=e.md.algorithm,u}e.signatureOid=e.siginfo.algorithmOid=s,e.certificationRequestInfo=a.getCertificationRequestInfo(e);var c=i.toDer(e.certificationRequestInfo);e.md.update(c.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(null===r){if(e.signatureOid in o)switch(o[e.signatureOid]){case"sha1WithRSAEncryption":r=n.md.sha1.create();break;case"md5WithRSAEncryption":r=n.md.md5.create();break;case"sha256WithRSAEncryption":r=n.md.sha256.create();break;case"sha384WithRSAEncryption":r=n.md.sha384.create();break;case"sha512WithRSAEncryption":r=n.md.sha512.create();break;case"RSASSA-PSS":r=n.md.sha256.create()}if(null===r)throw(h=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=e.signatureOid,h;var s=e.certificationRequestInfo||a.getCertificationRequestInfo(e),u=i.toDer(s);r.update(u.getBytes())}if(null!==r){var c;switch(e.signatureOid){case o.sha1WithRSAEncryption:break;case o["RSASSA-PSS"]:var l,f,h;if(void 0===(l=o[e.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[l])throw(h=new Error("Unsupported MGF hash function.")).oid=e.signatureParameters.mgf.hash.algorithmOid,h.name=l,h;if(void 0===(f=o[e.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[f])throw(h=new Error("Unsupported MGF function.")).oid=e.signatureParameters.mgf.algorithmOid,h.name=f,h;if(f=n.mgf[f].create(n.md[l].create()),void 0===(l=o[e.signatureParameters.hash.algorithmOid])||void 0===n.md[l])throw(h=new Error("Unsupported RSASSA-PSS hash function.")).oid=e.signatureParameters.hash.algorithmOid,h.name=l,h;c=n.pss.create(n.md[l].create(),f,e.signatureParameters.saltLength)}t=e.publicKey.verify(r.digest().getBytes(),e.signature,c)}return t},e};var E=new Date("1950-01-01T00:00:00Z"),S=new Date("2050-01-01T00:00:00Z");function C(e){return e>=E&&e<S?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(e)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(e))}a.getTBSCertificate=function(e){var t=C(e.validity.notBefore),r=C(e.validity.notAfter),o=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.siginfo.algorithmOid).getBytes()),m(e.siginfo.algorithmOid,e.siginfo.parameters)]),y(e.issuer),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,r]),y(e.subject),a.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&o.value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&o.value.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&o.value.push(a.certificateExtensionsToAsn1(e.extensions)),o},a.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),y(e.subject),a.publicKeyToAsn1(e.publicKey),b(e)])},a.distinguishedNameToAsn1=function(e){return y(e)},a.certificateToAsn1=function(e){var t=e.tbsCertificate||a.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),m(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;n<e.length;++n)r.value.push(a.certificateExtensionToAsn1(e[n]));return t},a.certificateExtensionToAsn1=function(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.id).getBytes())),e.critical&&t.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return"string"!=typeof e.value&&(r=i.toDer(r).getBytes()),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)),t},a.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||a.getCertificationRequestInfo(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),m(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.createCaStore=function(e){var t={certs:{}};function r(e){return o(e),t.certs[e.hash]||null}function o(e){if(!e.hash){var t=n.md.sha1.create();e.attributes=a.RDNAttributesAsArray(y(e),t),e.hash=t.digest().toHex()}}if(t.getIssuer=function(e){return r(e.issuer)},t.addCertificate=function(e){if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),o(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var r=t.certs[e.subject.hash];n.util.isArray(r)||(r=[r]),r.push(e),t.certs[e.subject.hash]=r}else t.certs[e.subject.hash]=e},t.hasCertificate=function(e){"string"==typeof e&&(e=n.pki.certificateFromPem(e));var t=r(e.subject);if(!t)return!1;n.util.isArray(t)||(t=[t]);for(var o=i.toDer(a.certificateToAsn1(e)).getBytes(),s=0;s<t.length;++s){if(o===i.toDer(a.certificateToAsn1(t[s])).getBytes())return!0}return!1},t.listAllCertificates=function(){var e=[];for(var r in t.certs)if(t.certs.hasOwnProperty(r)){var i=t.certs[r];if(n.util.isArray(i))for(var a=0;a<i.length;++a)e.push(i[a]);else e.push(i)}return e},t.removeCertificate=function(e){var s;if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),o(e.subject),!t.hasCertificate(e))return null;var u=r(e.subject);if(!n.util.isArray(u))return s=t.certs[e.subject.hash],delete t.certs[e.subject.hash],s;for(var c=i.toDer(a.certificateToAsn1(e)).getBytes(),l=0;l<u.length;++l){c===i.toDer(a.certificateToAsn1(u[l])).getBytes()&&(s=u[l],u.splice(l,1))}return 0===u.length&&delete t.certs[e.subject.hash],s},e)for(var s=0;s<e.length;++s){var u=e[s];t.addCertificate(u)}return t},a.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},a.verifyCertificateChain=function(e,t,r){"function"==typeof r&&(r={verify:r}),r=r||{};var i=(t=t.slice(0)).slice(0),o=r.validityCheckDate;void 0===o&&(o=new Date);var s=!0,u=null,c=0;do{var l=t.shift(),f=null,h=!1;if(o&&(o<l.validity.notBefore||o>l.validity.notAfter)&&(u={message:"Certificate is not valid yet or has expired.",error:a.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:o}),null===u){if(null===(f=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(h=!0,f=l),f){var p=f;n.util.isArray(p)||(p=[p]);for(var d=!1;!d&&p.length>0;){f=p.shift();try{d=f.verify(l)}catch(e){}}d||(u={message:"Certificate signature is invalid.",error:a.certificateError.bad_certificate})}null!==u||f&&!h||e.hasCertificate(l)||(u={message:"Certificate is not trusted.",error:a.certificateError.unknown_ca})}if(null===u&&f&&!l.isIssuer(f)&&(u={message:"Certificate issuer is invalid.",error:a.certificateError.bad_certificate}),null===u)for(var y={keyUsage:!0,basicConstraints:!0},v=0;null===u&&v<l.extensions.length;++v){var g=l.extensions[v];g.critical&&!(g.name in y)&&(u={message:"Certificate has an unsupported critical extension.",error:a.certificateError.unsupported_certificate})}if(null===u&&(!s||0===t.length&&(!f||h))){var m=l.getExtension("basicConstraints"),b=l.getExtension("keyUsage");if(null!==b&&(b.keyCertSign&&null!==m||(u={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:a.certificateError.bad_certificate})),null!==u||null===m||m.cA||(u={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:a.certificateError.bad_certificate}),null===u&&null!==b&&"pathLenConstraint"in m)c-1>m.pathLenConstraint&&(u={message:"Certificate basicConstraints pathLenConstraint violated.",error:a.certificateError.bad_certificate})}var E=null===u||u.error,S=r.verify?r.verify(E,c,i):E;if(!0!==S)throw!0===E&&(u={message:"The application rejected the certificate.",error:a.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||n.util.isArray(S)?"string"==typeof S&&(u.error=S):(S.message&&(u.message=S.message),S.error&&(u.error=S.error))),u;u=null,s=!1,++c}while(t.length>0);return!0}},1379:(e,t,r)=>{"use strict";
|
18
18
|
/*!
|
@@ -290,4 +290,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
290
290
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
291
291
|
PERFORMANCE OF THIS SOFTWARE.
|
292
292
|
***************************************************************************** */
|
293
|
-
var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function s(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))}function u(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function c(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}},5877:(e,t,r)=>{var n=r(3570),i=r(1171),a=i;a.v1=n,a.v4=i,e.exports=a},5327:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,i=t;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}},5217:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},3570:(e,t,r)=>{var n,i,a=r(5217),o=r(5327),s=0,u=0;e.exports=function(e,t,r){var c=t&&r||0,l=t||[],f=(e=e||{}).node||n,h=void 0!==e.clockseq?e.clockseq:i;if(null==f||null==h){var p=a();null==f&&(f=n=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==h&&(h=i=16383&(p[6]<<8|p[7]))}var d=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:u+1,v=d-s+(y-u)/1e4;if(v<0&&void 0===e.clockseq&&(h=h+1&16383),(v<0||d>s)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=d,u=y,i=h;var g=(1e4*(268435455&(d+=122192928e5))+y)%4294967296;l[c++]=g>>>24&255,l[c++]=g>>>16&255,l[c++]=g>>>8&255,l[c++]=255&g;var m=d/4294967296*1e4&268435455;l[c++]=m>>>8&255,l[c++]=255&m,l[c++]=m>>>24&15|16,l[c++]=m>>>16&255,l[c++]=h>>>8|128,l[c++]=255&h;for(var b=0;b<6;++b)l[c+b]=f[b];return t||o(l)}},1171:(e,t,r)=>{var n=r(5217),i=r(5327);e.exports=function(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;++s)t[a+s]=o[s];return t||i(o)}},9329:(e,t,r)=>{e.exports=r(516).Observable},516:(e,t)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}t.Observable=void 0;var a=function(){return"function"==typeof Symbol},o=function(e){return a()&&Boolean(Symbol[e])},s=function(e){return o(e)?Symbol[e]:"@@"+e};a()&&!o("observable")&&(Symbol.observable=Symbol("observable"));var u=s("iterator"),c=s("observable"),l=s("species");function f(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function h(e){var t=e.constructor;return void 0!==t&&null===(t=t[l])&&(t=void 0),void 0!==t?t:C}function p(e){return e instanceof C}function d(e){d.log?d.log(e):setTimeout((function(){throw e}))}function y(e){Promise.resolve().then((function(){try{e()}catch(e){d(e)}}))}function v(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=f(t,"unsubscribe");r&&r.call(t)}}catch(e){d(e)}}function g(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function m(e,t,r){e._state="running";var n=e._observer;try{var i=f(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(g(e),!i)throw r;i.call(n,r);break;case"complete":g(e),i&&i.call(n)}}catch(e){d(e)}"closed"===e._state?v(e):"running"===e._state&&(e._state="ready")}function b(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void y((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(m(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e)}))):void m(e,t,r);e._queue.push({type:t,value:r})}}var E=function(){function e(t,n){r(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new S(this);try{this._cleanup=n.call(void 0,i)}catch(e){i.error(e)}"initializing"===this._state&&(this._state="ready")}return i(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(g(this),v(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),S=function(){function e(t){r(this,e),this._subscription=t}return i(e,[{key:"next",value:function(e){b(this._subscription,"next",e)}},{key:"error",value:function(e){b(this._subscription,"error",e)}},{key:"complete",value:function(){b(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),C=function(){function e(t){if(r(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return i(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new E(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise((function(r,n){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,a)}catch(e){n(e),i.unsubscribe()}},error:n,complete:r});else n(new TypeError(e+" is not a function"));function a(){i.unsubscribe(),r()}}))}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(r){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(r){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=h(this),n=arguments.length>1,i=!1,a=arguments[1],o=a;return new r((function(r){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||n)try{o=e(o,t)}catch(e){return r.error(e)}else o=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(o),r.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=h(this);return new i((function(t){var n,a=0;return function e(o){n=o.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){a===r.length?(n=void 0,t.complete()):e(i.from(r[a++]))}})}(e),function(){n&&(n.unsubscribe(),n=void 0)}}))}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=h(this);return new r((function(n){var i=[],a=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return n.error(e)}var a=r.from(t).subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){var e=i.indexOf(a);e>=0&&i.splice(e,1),o()}});i.push(a)},error:function(e){n.error(e)},complete:function(){o()}});function o(){a.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),a.unsubscribe()}}))}},{key:c,value:function(){return this}}],[{key:"from",value:function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=f(t,c);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return p(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(o("iterator")&&(n=f(t,u)))return new r((function(e){y((function(){if(!e.closed){var r=!0,i=!1,a=void 0;try{for(var o,s=n.call(t)[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;if(e.next(u),e.closed)return}}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){y((function(){if(!e.closed){for(var r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i="function"==typeof this?this:e;return new i((function(e){y((function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}}))}))}},{key:l,get:function(){return this}}]),e}();t.Observable=C,a()&&Object.defineProperty(C,Symbol("extensions"),{value:{symbol:c,hostReportError:d},configurable:!0})},5819:()=>{},3438:()=>{}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";r.r(n),r.d(n,{Client:()=>d,Election:()=>m,IdentificationKeys:()=>$,KeyCeremonyComponent:()=>te,MESSAGE_PROCESSED:()=>G,MESSAGE_RECEIVED:()=>H,MessageIdentifier:()=>g,TallyComponent:()=>re,Trustee:()=>J,VoteComponent:()=>ne,Voter:()=>X});var e=r(1439),t=r(4206),i=r.n(t),a=r(9120),o=r.n(a),s=r(1798),u=r.n(s),c=r(5073),l=r.n(c),f=r(5053),h=r.n(f);class p{constructor({apiEndpointUrl:t,headers:r}){const n=new e.HttpLink({uri:t,headers:r});this.apolloClient=new e.fe({link:n,cache:new e.h4})}async getLogEntry({electionUniqueId:e,contentHash:t}){return(await this.apolloClient.query({query:l(),variables:{electionUniqueId:e,contentHash:t}})).data.logEntry}async getElectionLogEntries({electionUniqueId:e,after:t,types:r}){return(await this.apolloClient.query({query:i(),variables:{electionUniqueId:e,after:t,types:r},fetchPolicy:"no-cache"})).data.election.logEntries}async processKeyCeremonyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:o(),variables:{messageId:e,signedData:t}});if(r.data.processKeyCeremonyStep.error)throw new Error(r.data.processKeyCeremonyStep.error);return r.data.processKeyCeremonyStep.pendingMessage}async getPendingMessageByMessageId({messageId:e}){return(await this.apolloClient.query({query:h(),variables:{messageId:e}})).data.pendingMessage}async processTallyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:u(),variables:{messageId:e,signedData:t}});if(r.data.processTallyStep.error)throw new Error(r.data.processTallyStep.error);return r.data.processTallyStep.pendingMessage}}class d{constructor(e){this.apiClient=new p(e)}getLogEntry({electionUniqueId:e,contentHash:t}){return this.apiClient.getLogEntry({electionUniqueId:e,contentHash:t})}getElectionLogEntries(e){return this.apiClient.getElectionLogEntries(e)}processKeyCeremonyStep(e){return this.apiClient.processKeyCeremonyStep(e)}processTallyStep(e){return this.apiClient.processTallyStep(e)}waitForPendingMessageToBeProcessed(e,t=1e3){return new Promise((r=>{const n=setInterval((()=>{this.apiClient.getPendingMessageByMessageId({messageId:e}).then((e=>{"enqueued"!==e.status&&(clearInterval(n),r(e))}))}),t)}))}}const y="t",v=["a","b","v",y];class g{static parse(e){const[t,r]=e.split("+"),[n,i,a,o]=t.split(".",4),[s,u]=r.split(".",2),c=o?`.${o}`:"";if(!v.includes(s))throw new Error("Invalid message identifier format");return{electionId:`${n}.${i}`,type:a,subtype:o,typeSubtype:`${a}${c}`,author:{type:s,id:u}}}static format(e,t,r,n){return`${e}.${t}+${r}.${n}`}}class m{constructor({uniqueId:e,bulletinBoardClient:t,typesFilter:r,options:n}){this.uniqueId=e,this.bulletinBoardClient=t,this.logEntries=[],this.typesFilter=r,this.subscriptionId=null,this.options=n||{waitUntilNextCheck:2e3}}async subscribeToLogEntriesChanges(){this.unsubscribeToLogEntriesChanges(),await this.getLogEntries(),this.subscriptionId=setInterval((()=>{this.getLogEntries()}),this.options.waitUntilNextCheck)}unsubscribeToLogEntriesChanges(){null!==this.subscriptionId&&(clearInterval(this.subscriptionId),this.subscriptionId=null)}getLastMessageFromTrustee(e){for(let t=this.logEntries.length-1;t>=0;t--){const r=this.logEntries[t],n=g.parse(r.messageId);if(n.author.type===y&&n.author.id===e)return r}return null}getLogEntries(){const e=this.logEntries[this.logEntries.length-1],t=e&&e.id||null;return new Promise((e=>{this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.uniqueId,after:t,types:this.typesFilter}).then((t=>{t.length&&(this.logEntries=[...this.logEntries,...t]),e()}))}))}}var b=r(655);function E(e){return"function"==typeof e}var S=!1,C={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;S=e},get useDeprecatedSynchronousErrorHandling(){return S}};function w(e){setTimeout((function(){throw e}),0)}var T={closed:!0,next:function(e){},error:function(e){if(C.useDeprecatedSynchronousErrorHandling)throw e;w(e)},complete:function(){}},A=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();var I=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),k=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r,n=this,i=n._parentOrParents,a=n._ctorUnsubscribe,o=n._unsubscribe,s=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof e)i.remove(this);else if(null!==i)for(var u=0;u<i.length;++u){i[u].remove(this)}if(E(o)){a&&(this._unsubscribe=void 0);try{o.call(this)}catch(e){t=e instanceof I?_(e.errors):[e]}}if(A(s)){u=-1;for(var c=s.length;++u<c;){var l=s[u];if(null!==(r=l)&&"object"==typeof r)try{l.unsubscribe()}catch(e){t=t||[],e instanceof I?t=t.concat(_(e.errors)):t.push(e)}}}if(t)throw new I(t)}},e.prototype.add=function(t){var r=t;if(!t)return e.EMPTY;switch(typeof t){case"function":r=new e(t);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof e)){var n=r;(r=new e)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof e){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var a=this._subscriptions;return null===a?this._subscriptions=[r]:a.push(r),r},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function _(e){return e.reduce((function(e,t){return e.concat(t instanceof I?t.errors:t)}),[])}var B=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),N=function(e){function t(r,n,i){var a=e.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,arguments.length){case 0:a.destination=T;break;case 1:if(!r){a.destination=T;break}if("object"==typeof r){r instanceof t?(a.syncErrorThrowable=r.syncErrorThrowable,a.destination=r,r.add(a)):(a.syncErrorThrowable=!0,a.destination=new O(a,r));break}default:a.syncErrorThrowable=!0,a.destination=new O(a,r,n,i)}return a}return b.ZT(t,e),t.prototype[B]=function(){return this},t.create=function(e,r,n){var i=new t(e,r,n);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(k),O=function(e){function t(t,r,n,i){var a,o=e.call(this)||this;o._parentSubscriber=t;var s=o;return E(r)?a=r:r&&(a=r.next,n=r.error,i=r.complete,r!==T&&(E((s=Object.create(r)).unsubscribe)&&o.add(s.unsubscribe.bind(s)),s.unsubscribe=o.unsubscribe.bind(o))),o._context=s,o._next=a,o._error=n,o._complete=i,o}return b.ZT(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;C.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,r=C.useDeprecatedSynchronousErrorHandling;if(this._error)r&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)r?(t.syncErrorValue=e,t.syncErrorThrown=!0):w(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;w(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};C.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),C.useDeprecatedSynchronousErrorHandling)throw e;w(e)}},t.prototype.__tryOrSetError=function(e,t,r){if(!C.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,r)}catch(t){return C.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(w(t),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(N);var R=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function x(e){return e}function P(e){return 0===e.length?x:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var F=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this.operator,i=function(e,t,r){if(e){if(e instanceof N)return e;if(e[B])return e[B]()}return e||t||r?new N(e,t,r):new N(T)}(e,t,r);if(n?i.add(n.call(i,this.source)):i.add(this.source||C.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),C.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){C.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),!function(e){for(;e;){var t=e,r=t.closed,n=t.destination,i=t.isStopped;if(r||i)return!1;e=n&&n instanceof N?n:null}return!0}(e)?console.warn(t):e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=D(t))((function(t,n){var i;i=r.subscribe((function(t){try{e(t)}catch(e){n(e),i&&i.unsubscribe()}}),n,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[R]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:P(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=D(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function D(e){if(e||(e=C.Promise||Promise),!e)throw new Error("no Promise impl found");return e}var L=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),U=function(e){function t(t,r){var n=e.call(this)||this;return n.subject=t,n.subscriber=r,n.closed=!1,n}return b.ZT(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}},t}(k),j=function(e){function t(t){var r=e.call(this,t)||this;return r.destination=t,r}return b.ZT(t,e),t}(N),V=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return b.ZT(t,e),t.prototype[B]=function(){return new j(this)},t.prototype.lift=function(e){var t=new K(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new L;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new L;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new L;this.isStopped=!0;for(var e=this.observers,t=e.length,r=e.slice(),n=0;n<t;n++)r[n].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new L;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new L;return this.hasError?(e.error(this.thrownError),k.EMPTY):this.isStopped?(e.complete(),k.EMPTY):(this.observers.push(e),new U(this,e))},t.prototype.asObservable=function(){var e=new F;return e.source=this,e},t.create=function(e,t){return new K(e,t)},t}(F),K=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return b.ZT(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):k.EMPTY},t}(V);function M(){}var q=function(){function e(e,t,r){this.nextOrObserver=e,this.error=t,this.complete=r}return e.prototype.call=function(e,t){return t.subscribe(new z(e,this.nextOrObserver,this.error,this.complete))},e}(),z=function(e){function t(t,r,n,i){var a=e.call(this,t)||this;return a._tapNext=M,a._tapError=M,a._tapComplete=M,a._tapError=n||M,a._tapComplete=i||M,E(r)?(a._context=a,a._tapNext=r):r&&(a._context=r,a._tapNext=r.next||M,a._tapError=r.error||M,a._tapComplete=r.complete||M),a}return b.ZT(t,e),t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.next(e)},t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()},t}(N);const H="[Message] Received",G="[Message] Processed";class Q{constructor(){this.events=new V}subscribe(e){return this.events.pipe((t=e,function(e){return e.lift(new q(t,r,n))})).subscribe();var t,r,n}broadcastMessageReceived(e){this.events.next({type:H,message:e})}broadcastMessageProcessed(e,t){this.events.next({type:G,message:e,result:t})}}var W=r(1217);function Y(e,t){const r="string"==typeof e?JSON.parse(e):e,n="string"==typeof t?JSON.parse(t):t;if(r&&n){const{n:e,e:t,kty:i}=r,{n:a,e:o,kty:s}=n;return e===a&&t===o&&i===s}return!1}class Z{constructor({authorityPublicKeyJSON:e}){this.authorityPublicKeyJSON=e,this.authorityPublicKey=W.JWK.asKey(e,"json"),this.keys=null}async parse({messageId:e,signedData:t}){const r=g.parse(e),n=await(this.keys?this.keys[r.author.type][r.author.id]:this.authorityPublicKey);if(!t)return{messageIdentifier:r,decodedData:null};const i=await W.JWS.createVerify(n).verify(t,{algorithms:["RS256"]}),a=JSON.parse(new TextDecoder("utf-8").decode(i.payload));return this.keys||(this.keys=await this.parseCreateElection(a)),{messageIdentifier:r,decodedData:a}}async parseCreateElection({authority:e,bulletin_board:t,trustees:r}){if(!Y(e.public_key,this.authorityPublicKeyJSON))throw new Error("The authority public key doesn't match the election's authority public key.");const n={a:{[e.slug]:this.authorityPublicKey},b:{},[y]:{}},i=[];i.push(this.loadKey(t).then((e=>{n.b[t.slug]=e})));for(const e of r)i.push(this.loadKey(e).then((t=>{n.t[e.slug]=t})));return await Promise.all(i),n}loadKey(e){return W.JWK.asKey(e.public_key,"json")}}class J{constructor({uniqueId:e,authorityPublicKeyJSON:t,identificationKeys:r,wrapperAdapter:n,options:i}){this.uniqueId=e,this.identificationKeys=r,this.election=null,this.options=i||{waitUntilNextCheck:100},this.wrapperAdapter=n,this.parser=new Z({authorityPublicKeyJSON:t}),this.events=new Q,this.nextLogEntryIndexToProcess=0,this.lastMessageProcessedWithResult=null,this.hasSetupKeyCeremony=!1}async setup(){if(null===this.election)throw new Error("election is not set.");return await this.wrapperAdapter.setup(),this.election.subscribeToLogEntriesChanges()}tearDown(){this.election.unsubscribeToLogEntriesChanges()}async*setupKeyCeremony(){let e;for(;!e;)e=await this.waitForNextLogEntryResult();return yield await this.wrapperAdapter.backup(),await this.processKeyCeremonyStep(e),this.hasSetupKeyCeremony=!0,this.hasSetupKeyCeremony}async runKeyCeremony(){if(!this.hasSetupKeyCeremony)throw new Error("The key ceremony has not been setup yet");if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processKeyCeremonyStep(e),await this.wrapperAdapter.isKeyCeremonyDone()?this.tearDown():this.runKeyCeremony())))}async runTally(){if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processTallyStep(e),await this.wrapperAdapter.isTallyDone()?this.tearDown():this.runTally())))}async needsToBeRestored(){return this.election.getLastMessageFromTrustee(this.uniqueId)&&await this.wrapperAdapter.isFresh()}async restore(e){const t=this.election.getLastMessageFromTrustee(this.uniqueId);return this.hasSetupKeyCeremony=t&&await this.wrapperAdapter.restore(e),this.hasSetupKeyCeremony}async waitForNextLogEntryResult(){return await new Promise((e=>{const t=setInterval((async()=>{const{logEntries:r}=this.election;r.length>this.nextLogEntryIndexToProcess&&(clearInterval(t),e())}),this.options.waitUntilNextCheck)})),this.processNextLogEntry()}async processNextLogEntry(){const{logEntries:e}=this.election,t=e[this.nextLogEntryIndexToProcess];this.events.broadcastMessageReceived(t);const{messageIdentifier:r,decodedData:n}=await this.parser.parse(t),i=await this.wrapperAdapter.processMessage(r.typeSubtype,n);if(this.events.broadcastMessageProcessed(t,i),this.nextLogEntryIndexToProcess+=1,i){const{messageType:e,content:t}=i;return{message_id:g.format(this.election.uniqueId,e,y,this.uniqueId),content:t}}return i}async processKeyCeremonyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.election.bulletinBoardClient.processKeyCeremonyStep({messageId:e.message_id,signedData:t})}}async processTallyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.election.bulletinBoardClient.processTallyStep({messageId:e.message_id,signedData:t})}}isMessageAlreadyLogged({message_id:e}){const{logEntries:t}=this.election;return t.find((t=>t.messageId===e))}signMessage(e){return this.identificationKeys.sign({iat:Math.floor(new Date/1e3),...e})}}class X{constructor({bulletinBoardClient:e,authorityPublicKeyJSON:t,election:r,uniqueId:n,wrapperAdapter:i}){this.uniqueId=n,this.election=r,this.bulletinBoardClient=e,this.wrapperAdapter=i,this.parser=new Z({authorityPublicKeyJSON:t})}async setup(){return await this.wrapperAdapter.setup(),this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.election.uniqueId,types:["create_election","end_key_ceremony"]}).then((async e=>{for(const t of e){const{messageIdentifier:e,decodedData:r}=await this.parser.parse(t);await this.wrapperAdapter.processMessage(e.typeSubtype,r)}}))}async encrypt(e,t){const{encryptedData:r,auditableData:n}=await this.wrapperAdapter.encrypt(e,t);return{encryptedData:r,encryptedDataHash:await this.hash(r),auditableData:n,plainVote:e,electionUniqueId:this.election.uniqueId}}async hash(e){return window.crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e)).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))}verifyVote(e){const{uniqueId:t}=this.election;return this.bulletinBoardClient.getLogEntry({electionUniqueId:t,contentHash:e})}}class ${constructor(e,t){this.format="jwk",this.algorithm={name:"RSASSA-PKCS1-v1_5",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},this.usages=["sign"],this.publicKeyAttrs=["alg","e","kty","n"],this.jwtHeader=this._encode64(JSON.stringify({alg:"RS256",typ:"JWT"})),this.trusteeUniqueId=e,this.privateKey=null,this.publicKey=null,this.storedPublicKey=JSON.parse(t||null),this.keyIdentifier=`${e}-private-key`,this.browserSupport=this._checkBrowserSupport(),this.textEncoder=new TextEncoder("utf-8"),this.dbName="identification_keys",this.dbVersion=1,this.presentPromise=this._read()}present(e){this.presentPromise.then((()=>{this._matchesStoredPublicKey(this.publicKey)?e(this.browserSupport&&null!==this.privateKey):this.reset().then(e(!1))}))}async generate(){return!(!this.browserSupport||this.storedPublicKey)&&new Promise(((e,t)=>{try{return this.crypto.subtle.generateKey(this.algorithm,!0,this.usages).then((t=>this.crypto.subtle.exportKey(this.format,t.privateKey).then((t=>{this.publicKey=this._publicKeyFromPrivateKey(t);const r=document.createElement("a");return r.setAttribute("href",`data:text/plain;charset=utf-8,${encodeURIComponent(JSON.stringify(t))}`),r.setAttribute("download",`${this.keyIdentifier}.jwk`),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),e()})).catch(this._handleErrors)))}catch(e){return t(e)}}))}async upload(e){return!(!this.browserSupport||null!==this.privateKey)&&new Promise(((t,r)=>{if(e)this.onUploadInputChange(e,t,r);else{const e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept",".jwk"),e.style.display="none",document.body.appendChild(e),e.addEventListener("change",(n=>{document.body.removeChild(e),this.onUploadInputChange(n,t,r)})),e.click()}}))}onUploadInputChange(e,t,r){const n=new FileReader;n.readAsText(e.target.files[0]),n.onload=e=>{let n="";try{n=JSON.parse(e.target.result)}catch(e){return r("invalid_format")}return this.crypto.subtle.importKey(this.format,n,this.algorithm,!1,this.usages).then((e=>{const i=this._publicKeyFromPrivateKey(n);this._matchesStoredPublicKey(i)?(this.publicKey=i,this.privateKey=e,this._save().then((()=>t(!0))).catch((()=>{r("could not be saved")}))):r("invalid_public_key")})).catch((()=>{r("invalid_key")}))}}reset(){return this.privateKey=this.publicKey=null,this._clear()}async sign(e){if(!this.browserSupport||null===this.privateKey)return!1;const t=`${this.jwtHeader}.${this._encode64(JSON.stringify(e))}`,r=await this.crypto.subtle.sign(this.algorithm,this.privateKey,this.textEncoder.encode(t));return`${t}.${btoa(Reflect.apply(String.fromCharCode,null,new Uint8Array(r))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}`}_checkBrowserSupport(){return this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,this.crypto=window.crypto||window.msCrypto,window.indexedDB&&window.crypto}_handleErrors(e){throw e}_publicKeyFromPrivateKey(e){return Object.keys(e).filter((e=>this.publicKeyAttrs.includes(e))).reduce(((t,r)=>(t[r]=e[r],t)),{})}_matchesStoredPublicKey(e){return Y(e,this.storedPublicKey)}_encode64(e){return btoa(unescape(encodeURIComponent(e))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}async _read(){return this._useDb("readonly",(e=>{e.get(this.keyIdentifier).onsuccess=e=>{e.target.result&&(this.privateKey=e.target.result.privateKey,this.publicKey=e.target.result.publicKey)}}))}async _save(){return this._useDb("readwrite",(e=>{e.add({privateKey:this.privateKey,publicKey:this.publicKey},this.keyIdentifier)}))}async _clear(){return this._useDb("readwrite",(e=>{e.delete(this.keyIdentifier)}))}async _useDb(e,t){return new Promise(((r,n)=>{let i=null;const a=this.indexedDB.open(this.dbName,this.dbVersion);a.onerror=e=>{i=null,n(e)},a.onupgradeneeded=()=>{i=a.result,i.createObjectStore("IdentificationKeys")},a.onsuccess=()=>{i=a.result;const n=i.transaction(["IdentificationKeys"],e);t(n.objectStore("IdentificationKeys")),n.oncomplete=()=>{i.close(),r()}}}))}}class ee{constructor({authorityPublicKeyJSON:e,trusteeUniqueId:t,trusteeIdentificationKeys:r,trusteeWrapperAdapter:n}){this.trustee=new J({uniqueId:t,authorityPublicKeyJSON:e,identificationKeys:r,wrapperAdapter:n})}async setupElection(){throw new Error("not implemented")}async setupElectionWithTypesFilter({bulletinBoardClientParams:e,electionUniqueId:t,authorizationExpirationTimestamp:r,typesFilter:n}){const[i]=t.split("."),a=`${i}.${this.trustee.uniqueId}`,o=await this.trustee.signMessage({trustee_unique_id:a,exp:r}),s=new d({...e,headers:{Authorization:o,TrusteeUniqueId:a}}),u=new m({uniqueId:t,bulletinBoardClient:s,typesFilter:n});this.trustee.election=u}async bindEvents(){throw new Error("not implemented")}}class te extends ee{setupElection({bulletinBoardClientParams:e,electionUniqueId:t,authorizationExpirationTimestamp:r}){return this.setupElectionWithTypesFilter({electionUniqueId:t,bulletinBoardClientParams:e,authorizationExpirationTimestamp:r,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony"]})}async bindEvents({onEvent:e,onBindRestoreButton:t,onBindStartButton:r,onRestore:n,onComplete:i,onStart:a,onTrusteeNeedsToBeRestored:o,onBackupNeeded:s,onBindBackupButton:u,onBackupStarted:c}){const l=this.trustee.setup();this.trustee.events.subscribe(e),r((async e=>{if(a(),e.preventDefault(),await l,await this.trustee.needsToBeRestored())o();else{const e=this.trustee.setupKeyCeremony(),{value:t}=await e.next();s(),u(t,`${this.trustee.uniqueId}-election-${this.trustee.election.uniqueId}.bak`,(async()=>{c(),await e.next(),await this.trustee.runKeyCeremony(),i()}))}})),t((async e=>{await l;const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(n(),await this.trustee.runKeyCeremony(),i())},r.readAsText(t)}))}}class re extends ee{setupElection({bulletinBoardClientParams:e,electionUniqueId:t,authorizationExpirationTimestamp:r}){return this.setupElectionWithTypesFilter({electionUniqueId:t,bulletinBoardClientParams:e,authorizationExpirationTimestamp:r,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony","start_tally","tally","end_tally"]})}async bindEvents({onEvent:e,onBindRestoreButton:t,onBindStartButton:r,onRestore:n,onComplete:i,onStart:a,onTrusteeNeedsToBeRestored:o}){const s=this.trustee.setup();this.trustee.events.subscribe(e),r((async e=>{a(),e.preventDefault(),await s,await this.trustee.needsToBeRestored()?o():(await this.trustee.runTally(),i())})),t((async e=>{await s;const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(n(),await this.trustee.runTally(),i())},r.readAsText(t)}))}}class ne{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,voterUniqueId:n,voterWrapperAdapter:i}){this.bulletinBoardClient=new d(e);const a=new m({uniqueId:r,bulletinBoardClient:this.bulletinBoardClient});this.voter=new X({bulletinBoardClient:this.bulletinBoardClient,authorityPublicKeyJSON:t,election:a,uniqueId:n,wrapperAdapter:i})}async bindEvents({onBindEncryptButton:e,onStart:t,onVoteEncryption:r,castOrAuditBallot:n,onBindAuditBallotButton:i,onBindCastBallotButton:a,onAuditBallot:o,onCastBallot:s,onAuditComplete:u,onCastComplete:c,onInvalid:l}){const f=this.voter.setup();e((async()=>{t(),await f,r(((e,t)=>{this.voter.encrypt(e,t).then((e=>{n(e),i((()=>{o(e,`${this.voter.uniqueId}-election-${this.voter.election.uniqueId}.txt`),u()})),a((async()=>{try{const t=await s(e);c(t)}catch{l()}}))}))}),(()=>{l()}))}))}}})(),window.decidimBulletinBoard=n})();
|
293
|
+
var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function s(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))}function u(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function c(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}},5877:(e,t,r)=>{var n=r(3570),i=r(1171),a=i;a.v1=n,a.v4=i,e.exports=a},5327:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,i=t;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}},5217:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},3570:(e,t,r)=>{var n,i,a=r(5217),o=r(5327),s=0,u=0;e.exports=function(e,t,r){var c=t&&r||0,l=t||[],f=(e=e||{}).node||n,h=void 0!==e.clockseq?e.clockseq:i;if(null==f||null==h){var p=a();null==f&&(f=n=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==h&&(h=i=16383&(p[6]<<8|p[7]))}var d=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:u+1,v=d-s+(y-u)/1e4;if(v<0&&void 0===e.clockseq&&(h=h+1&16383),(v<0||d>s)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=d,u=y,i=h;var g=(1e4*(268435455&(d+=122192928e5))+y)%4294967296;l[c++]=g>>>24&255,l[c++]=g>>>16&255,l[c++]=g>>>8&255,l[c++]=255&g;var m=d/4294967296*1e4&268435455;l[c++]=m>>>8&255,l[c++]=255&m,l[c++]=m>>>24&15|16,l[c++]=m>>>16&255,l[c++]=h>>>8|128,l[c++]=255&h;for(var b=0;b<6;++b)l[c+b]=f[b];return t||o(l)}},1171:(e,t,r)=>{var n=r(5217),i=r(5327);e.exports=function(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;++s)t[a+s]=o[s];return t||i(o)}},9329:(e,t,r)=>{e.exports=r(516).Observable},516:(e,t)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}t.Observable=void 0;var a=function(){return"function"==typeof Symbol},o=function(e){return a()&&Boolean(Symbol[e])},s=function(e){return o(e)?Symbol[e]:"@@"+e};a()&&!o("observable")&&(Symbol.observable=Symbol("observable"));var u=s("iterator"),c=s("observable"),l=s("species");function f(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function h(e){var t=e.constructor;return void 0!==t&&null===(t=t[l])&&(t=void 0),void 0!==t?t:C}function p(e){return e instanceof C}function d(e){d.log?d.log(e):setTimeout((function(){throw e}))}function y(e){Promise.resolve().then((function(){try{e()}catch(e){d(e)}}))}function v(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=f(t,"unsubscribe");r&&r.call(t)}}catch(e){d(e)}}function g(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function m(e,t,r){e._state="running";var n=e._observer;try{var i=f(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(g(e),!i)throw r;i.call(n,r);break;case"complete":g(e),i&&i.call(n)}}catch(e){d(e)}"closed"===e._state?v(e):"running"===e._state&&(e._state="ready")}function b(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void y((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(m(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e)}))):void m(e,t,r);e._queue.push({type:t,value:r})}}var E=function(){function e(t,n){r(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new S(this);try{this._cleanup=n.call(void 0,i)}catch(e){i.error(e)}"initializing"===this._state&&(this._state="ready")}return i(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(g(this),v(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),S=function(){function e(t){r(this,e),this._subscription=t}return i(e,[{key:"next",value:function(e){b(this._subscription,"next",e)}},{key:"error",value:function(e){b(this._subscription,"error",e)}},{key:"complete",value:function(){b(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),C=function(){function e(t){if(r(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return i(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new E(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise((function(r,n){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,a)}catch(e){n(e),i.unsubscribe()}},error:n,complete:r});else n(new TypeError(e+" is not a function"));function a(){i.unsubscribe(),r()}}))}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(r){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(r){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=h(this),n=arguments.length>1,i=!1,a=arguments[1],o=a;return new r((function(r){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||n)try{o=e(o,t)}catch(e){return r.error(e)}else o=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(o),r.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=h(this);return new i((function(t){var n,a=0;return function e(o){n=o.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){a===r.length?(n=void 0,t.complete()):e(i.from(r[a++]))}})}(e),function(){n&&(n.unsubscribe(),n=void 0)}}))}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=h(this);return new r((function(n){var i=[],a=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return n.error(e)}var a=r.from(t).subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){var e=i.indexOf(a);e>=0&&i.splice(e,1),o()}});i.push(a)},error:function(e){n.error(e)},complete:function(){o()}});function o(){a.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),a.unsubscribe()}}))}},{key:c,value:function(){return this}}],[{key:"from",value:function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=f(t,c);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return p(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(o("iterator")&&(n=f(t,u)))return new r((function(e){y((function(){if(!e.closed){var r=!0,i=!1,a=void 0;try{for(var o,s=n.call(t)[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;if(e.next(u),e.closed)return}}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){y((function(){if(!e.closed){for(var r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i="function"==typeof this?this:e;return new i((function(e){y((function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}}))}))}},{key:l,get:function(){return this}}]),e}();t.Observable=C,a()&&Object.defineProperty(C,Symbol("extensions"),{value:{symbol:c,hostReportError:d},configurable:!0})},5819:()=>{},3438:()=>{}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";r.r(n),r.d(n,{Client:()=>d,Election:()=>m,IdentificationKeys:()=>$,KeyCeremonyComponent:()=>te,MESSAGE_PROCESSED:()=>G,MESSAGE_RECEIVED:()=>H,MessageIdentifier:()=>g,MessageParser:()=>Z,TallyComponent:()=>re,Trustee:()=>J,VoteComponent:()=>ne,Voter:()=>X});var e=r(1439),t=r(4206),i=r.n(t),a=r(9120),o=r.n(a),s=r(1798),u=r.n(s),c=r(5073),l=r.n(c),f=r(5053),h=r.n(f);class p{constructor({apiEndpointUrl:t,headers:r}){const n=new e.HttpLink({uri:t,headers:r});this.apolloClient=new e.fe({link:n,cache:new e.h4})}async getLogEntry({electionUniqueId:e,contentHash:t}){return(await this.apolloClient.query({query:l(),variables:{electionUniqueId:e,contentHash:t}})).data.logEntry}async getElectionLogEntries({electionUniqueId:e,after:t,types:r}){return(await this.apolloClient.query({query:i(),variables:{electionUniqueId:e,after:t,types:r},fetchPolicy:"no-cache"})).data.election.logEntries}async processKeyCeremonyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:o(),variables:{messageId:e,signedData:t}});if(r.data.processKeyCeremonyStep.error)throw new Error(r.data.processKeyCeremonyStep.error);return r.data.processKeyCeremonyStep.pendingMessage}async getPendingMessageByMessageId({messageId:e}){return(await this.apolloClient.query({query:h(),variables:{messageId:e}})).data.pendingMessage}async processTallyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:u(),variables:{messageId:e,signedData:t}});if(r.data.processTallyStep.error)throw new Error(r.data.processTallyStep.error);return r.data.processTallyStep.pendingMessage}}class d{constructor(e){this.apiClient=new p(e)}getLogEntry({electionUniqueId:e,contentHash:t}){return this.apiClient.getLogEntry({electionUniqueId:e,contentHash:t})}getElectionLogEntries(e){return this.apiClient.getElectionLogEntries(e)}processKeyCeremonyStep(e){return this.apiClient.processKeyCeremonyStep(e)}processTallyStep(e){return this.apiClient.processTallyStep(e)}waitForPendingMessageToBeProcessed(e,t=1e3){return new Promise((r=>{const n=setInterval((()=>{this.apiClient.getPendingMessageByMessageId({messageId:e}).then((e=>{"enqueued"!==e.status&&(clearInterval(n),r(e))}))}),t)}))}}const y="t",v=["a","b","v",y];class g{static parse(e){const[t,r]=e.split("+"),[n,i,a,o]=t.split(".",4),[s,u]=r.split(".",2),c=o?`.${o}`:"";if(!v.includes(s))throw new Error("Invalid message identifier format");return{electionId:`${n}.${i}`,type:a,subtype:o,typeSubtype:`${a}${c}`,author:{type:s,id:u}}}static format(e,t,r,n){return`${e}.${t}+${r}.${n}`}}class m{constructor({uniqueId:e,bulletinBoardClient:t,typesFilter:r,options:n}){this.uniqueId=e,this.bulletinBoardClient=t,this.logEntries=[],this.typesFilter=r,this.subscriptionId=null,this.options=n||{waitUntilNextCheck:2e3}}async subscribeToLogEntriesChanges(){this.unsubscribeToLogEntriesChanges(),await this.getLogEntries(),this.subscriptionId=setInterval((()=>{this.getLogEntries()}),this.options.waitUntilNextCheck)}unsubscribeToLogEntriesChanges(){null!==this.subscriptionId&&(clearInterval(this.subscriptionId),this.subscriptionId=null)}getLastMessageFromTrustee(e){for(let t=this.logEntries.length-1;t>=0;t--){const r=this.logEntries[t],n=g.parse(r.messageId);if(n.author.type===y&&n.author.id===e)return r}return null}getLogEntries(){const e=this.logEntries[this.logEntries.length-1],t=e&&e.id||null;return new Promise((e=>{this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.uniqueId,after:t,types:this.typesFilter}).then((t=>{t.length&&(this.logEntries=[...this.logEntries,...t]),e()}))}))}}var b=r(655);function E(e){return"function"==typeof e}var S=!1,C={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;S=e},get useDeprecatedSynchronousErrorHandling(){return S}};function w(e){setTimeout((function(){throw e}),0)}var T={closed:!0,next:function(e){},error:function(e){if(C.useDeprecatedSynchronousErrorHandling)throw e;w(e)},complete:function(){}},A=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();var I=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),k=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r,n=this,i=n._parentOrParents,a=n._ctorUnsubscribe,o=n._unsubscribe,s=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof e)i.remove(this);else if(null!==i)for(var u=0;u<i.length;++u){i[u].remove(this)}if(E(o)){a&&(this._unsubscribe=void 0);try{o.call(this)}catch(e){t=e instanceof I?_(e.errors):[e]}}if(A(s)){u=-1;for(var c=s.length;++u<c;){var l=s[u];if(null!==(r=l)&&"object"==typeof r)try{l.unsubscribe()}catch(e){t=t||[],e instanceof I?t=t.concat(_(e.errors)):t.push(e)}}}if(t)throw new I(t)}},e.prototype.add=function(t){var r=t;if(!t)return e.EMPTY;switch(typeof t){case"function":r=new e(t);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof e)){var n=r;(r=new e)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof e){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var a=this._subscriptions;return null===a?this._subscriptions=[r]:a.push(r),r},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function _(e){return e.reduce((function(e,t){return e.concat(t instanceof I?t.errors:t)}),[])}var B=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),N=function(e){function t(r,n,i){var a=e.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,arguments.length){case 0:a.destination=T;break;case 1:if(!r){a.destination=T;break}if("object"==typeof r){r instanceof t?(a.syncErrorThrowable=r.syncErrorThrowable,a.destination=r,r.add(a)):(a.syncErrorThrowable=!0,a.destination=new O(a,r));break}default:a.syncErrorThrowable=!0,a.destination=new O(a,r,n,i)}return a}return b.ZT(t,e),t.prototype[B]=function(){return this},t.create=function(e,r,n){var i=new t(e,r,n);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(k),O=function(e){function t(t,r,n,i){var a,o=e.call(this)||this;o._parentSubscriber=t;var s=o;return E(r)?a=r:r&&(a=r.next,n=r.error,i=r.complete,r!==T&&(E((s=Object.create(r)).unsubscribe)&&o.add(s.unsubscribe.bind(s)),s.unsubscribe=o.unsubscribe.bind(o))),o._context=s,o._next=a,o._error=n,o._complete=i,o}return b.ZT(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;C.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,r=C.useDeprecatedSynchronousErrorHandling;if(this._error)r&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)r?(t.syncErrorValue=e,t.syncErrorThrown=!0):w(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;w(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};C.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),C.useDeprecatedSynchronousErrorHandling)throw e;w(e)}},t.prototype.__tryOrSetError=function(e,t,r){if(!C.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,r)}catch(t){return C.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(w(t),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(N);var R=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function x(e){return e}function P(e){return 0===e.length?x:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var F=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this.operator,i=function(e,t,r){if(e){if(e instanceof N)return e;if(e[B])return e[B]()}return e||t||r?new N(e,t,r):new N(T)}(e,t,r);if(n?i.add(n.call(i,this.source)):i.add(this.source||C.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),C.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){C.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),!function(e){for(;e;){var t=e,r=t.closed,n=t.destination,i=t.isStopped;if(r||i)return!1;e=n&&n instanceof N?n:null}return!0}(e)?console.warn(t):e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=D(t))((function(t,n){var i;i=r.subscribe((function(t){try{e(t)}catch(e){n(e),i&&i.unsubscribe()}}),n,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[R]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:P(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=D(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function D(e){if(e||(e=C.Promise||Promise),!e)throw new Error("no Promise impl found");return e}var L=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),U=function(e){function t(t,r){var n=e.call(this)||this;return n.subject=t,n.subscriber=r,n.closed=!1,n}return b.ZT(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}},t}(k),j=function(e){function t(t){var r=e.call(this,t)||this;return r.destination=t,r}return b.ZT(t,e),t}(N),V=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return b.ZT(t,e),t.prototype[B]=function(){return new j(this)},t.prototype.lift=function(e){var t=new K(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new L;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new L;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new L;this.isStopped=!0;for(var e=this.observers,t=e.length,r=e.slice(),n=0;n<t;n++)r[n].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new L;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new L;return this.hasError?(e.error(this.thrownError),k.EMPTY):this.isStopped?(e.complete(),k.EMPTY):(this.observers.push(e),new U(this,e))},t.prototype.asObservable=function(){var e=new F;return e.source=this,e},t.create=function(e,t){return new K(e,t)},t}(F),K=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return b.ZT(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):k.EMPTY},t}(V);function M(){}var q=function(){function e(e,t,r){this.nextOrObserver=e,this.error=t,this.complete=r}return e.prototype.call=function(e,t){return t.subscribe(new z(e,this.nextOrObserver,this.error,this.complete))},e}(),z=function(e){function t(t,r,n,i){var a=e.call(this,t)||this;return a._tapNext=M,a._tapError=M,a._tapComplete=M,a._tapError=n||M,a._tapComplete=i||M,E(r)?(a._context=a,a._tapNext=r):r&&(a._context=r,a._tapNext=r.next||M,a._tapError=r.error||M,a._tapComplete=r.complete||M),a}return b.ZT(t,e),t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.next(e)},t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()},t}(N);const H="[Message] Received",G="[Message] Processed";class Q{constructor(){this.events=new V}subscribe(e){return this.events.pipe((t=e,function(e){return e.lift(new q(t,r,n))})).subscribe();var t,r,n}broadcastMessageReceived(e){this.events.next({type:H,message:e})}broadcastMessageProcessed(e,t){this.events.next({type:G,message:e,result:t})}}var W=r(1217);function Y(e,t){const r="string"==typeof e?JSON.parse(e):e,n="string"==typeof t?JSON.parse(t):t;if(r&&n){const{n:e,e:t,kty:i}=r,{n:a,e:o,kty:s}=n;return e===a&&t===o&&i===s}return!1}class Z{constructor({authorityPublicKeyJSON:e}){this.authorityPublicKeyJSON=e,this.authorityPublicKey=W.JWK.asKey(e,"json"),this.keys=null}async parse({messageId:e,signedData:t}){const r=g.parse(e),n=await(this.keys?this.keys[r.author.type][r.author.id]:this.authorityPublicKey);if(!t)return{messageIdentifier:r,decodedData:null};const i=await W.JWS.createVerify(n).verify(t,{algorithms:["RS256"]}),a=JSON.parse(new TextDecoder("utf-8").decode(i.payload));return this.keys||(this.keys=await this.parseCreateElection(a)),{messageIdentifier:r,decodedData:a}}async parseCreateElection({authority:e,bulletin_board:t,trustees:r}){if(!Y(e.public_key,this.authorityPublicKeyJSON))throw new Error("The authority public key doesn't match the election's authority public key.");const n={a:{[e.slug]:this.authorityPublicKey},b:{},[y]:{}},i=[];i.push(this.loadKey(t).then((e=>{n.b[t.slug]=e})));for(const e of r)i.push(this.loadKey(e).then((t=>{n.t[e.slug]=t})));return await Promise.all(i),n}loadKey(e){return W.JWK.asKey(e.public_key,"json")}}class J{constructor({uniqueId:e,authorityPublicKeyJSON:t,identificationKeys:r,wrapperAdapter:n,options:i}){this.uniqueId=e,this.identificationKeys=r,this.election=null,this.options=i||{waitUntilNextCheck:100},this.wrapperAdapter=n,this.parser=new Z({authorityPublicKeyJSON:t}),this.events=new Q,this.nextLogEntryIndexToProcess=0,this.lastMessageProcessedWithResult=null,this.hasSetupKeyCeremony=!1}async setup(){if(null===this.election)throw new Error("election is not set.");return await this.wrapperAdapter.setup(),this.election.subscribeToLogEntriesChanges()}tearDown(){this.election.unsubscribeToLogEntriesChanges()}async*setupKeyCeremony(){let e;for(;!e;)e=await this.waitForNextLogEntryResult();return yield await this.wrapperAdapter.backup(),await this.processKeyCeremonyStep(e),this.hasSetupKeyCeremony=!0,this.hasSetupKeyCeremony}async runKeyCeremony(){if(!this.hasSetupKeyCeremony)throw new Error("The key ceremony has not been setup yet");if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processKeyCeremonyStep(e),await this.wrapperAdapter.isKeyCeremonyDone()?this.tearDown():this.runKeyCeremony())))}async runTally(){if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processTallyStep(e),await this.wrapperAdapter.isTallyDone()?this.tearDown():this.runTally())))}async needsToBeRestored(){return this.election.getLastMessageFromTrustee(this.uniqueId)&&await this.wrapperAdapter.isFresh()}async restore(e){const t=this.election.getLastMessageFromTrustee(this.uniqueId);return this.hasSetupKeyCeremony=t&&await this.wrapperAdapter.restore(e),this.hasSetupKeyCeremony}async waitForNextLogEntryResult(){return await new Promise((e=>{const t=setInterval((async()=>{const{logEntries:r}=this.election;r.length>this.nextLogEntryIndexToProcess&&(clearInterval(t),e())}),this.options.waitUntilNextCheck)})),this.processNextLogEntry()}async processNextLogEntry(){const{logEntries:e}=this.election,t=e[this.nextLogEntryIndexToProcess];this.events.broadcastMessageReceived(t);const{messageIdentifier:r,decodedData:n}=await this.parser.parse(t),i=await this.wrapperAdapter.processMessage(r.typeSubtype,n);if(this.events.broadcastMessageProcessed(t,i),this.nextLogEntryIndexToProcess+=1,i){const{messageType:e,content:t}=i;return{message_id:g.format(this.election.uniqueId,e,y,this.uniqueId),content:t}}return i}async processKeyCeremonyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.election.bulletinBoardClient.processKeyCeremonyStep({messageId:e.message_id,signedData:t})}}async processTallyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.election.bulletinBoardClient.processTallyStep({messageId:e.message_id,signedData:t})}}isMessageAlreadyLogged({message_id:e}){const{logEntries:t}=this.election;return t.find((t=>t.messageId===e))}signMessage(e){return this.identificationKeys.sign({iat:Math.floor(new Date/1e3),...e})}}class X{constructor({bulletinBoardClient:e,authorityPublicKeyJSON:t,election:r,uniqueId:n,wrapperAdapter:i}){this.uniqueId=n,this.election=r,this.bulletinBoardClient=e,this.wrapperAdapter=i,this.parser=new Z({authorityPublicKeyJSON:t})}async setup(){return await this.wrapperAdapter.setup(),this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.election.uniqueId,types:["create_election","end_key_ceremony"]}).then((async e=>{for(const t of e){const{messageIdentifier:e,decodedData:r}=await this.parser.parse(t);await this.wrapperAdapter.processMessage(e.typeSubtype,r)}}))}async encrypt(e,t){const{encryptedData:r,auditableData:n}=await this.wrapperAdapter.encrypt(e,t);return{encryptedData:r,encryptedDataHash:await this.hash(r),auditableData:n,plainVote:e,electionUniqueId:this.election.uniqueId}}async hash(e){return window.crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e)).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))}verifyVote(e){const{uniqueId:t}=this.election;return this.bulletinBoardClient.getLogEntry({electionUniqueId:t,contentHash:e})}}class ${constructor(e,t){this.format="jwk",this.algorithm={name:"RSASSA-PKCS1-v1_5",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},this.usages=["sign"],this.publicKeyAttrs=["alg","e","kty","n"],this.jwtHeader=this._encode64(JSON.stringify({alg:"RS256",typ:"JWT"})),this.trusteeUniqueId=e,this.privateKey=null,this.publicKey=null,this.storedPublicKey=JSON.parse(t||null),this.keyIdentifier=`${e}-private-key`,this.browserSupport=this._checkBrowserSupport(),this.textEncoder=new TextEncoder("utf-8"),this.dbName="identification_keys",this.dbVersion=1,this.presentPromise=this._read()}present(e){this.presentPromise.then((()=>{this._matchesStoredPublicKey(this.publicKey)?e(this.browserSupport&&null!==this.privateKey):this.reset().then(e(!1))}))}async generate(){return!(!this.browserSupport||this.storedPublicKey)&&new Promise(((e,t)=>{try{return this.crypto.subtle.generateKey(this.algorithm,!0,this.usages).then((t=>this.crypto.subtle.exportKey(this.format,t.privateKey).then((t=>{this.publicKey=this._publicKeyFromPrivateKey(t);const r=document.createElement("a");return r.setAttribute("href",`data:text/plain;charset=utf-8,${encodeURIComponent(JSON.stringify(t))}`),r.setAttribute("download",`${this.keyIdentifier}.jwk`),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),e()})).catch(this._handleErrors)))}catch(e){return t(e)}}))}async upload(e){return!(!this.browserSupport||null!==this.privateKey)&&new Promise(((t,r)=>{if(e)this.onUploadInputChange(e,t,r);else{const e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept",".jwk"),e.style.display="none",document.body.appendChild(e),e.addEventListener("change",(n=>{document.body.removeChild(e),this.onUploadInputChange(n,t,r)})),e.click()}}))}onUploadInputChange(e,t,r){const n=new FileReader;n.readAsText(e.target.files[0]),n.onload=e=>{let n="";try{n=JSON.parse(e.target.result)}catch(e){return r("invalid_format")}return this.crypto.subtle.importKey(this.format,n,this.algorithm,!1,this.usages).then((e=>{const i=this._publicKeyFromPrivateKey(n);this._matchesStoredPublicKey(i)?(this.publicKey=i,this.privateKey=e,this._save().then((()=>t(!0))).catch((()=>{r("could not be saved")}))):r("invalid_public_key")})).catch((()=>{r("invalid_key")}))}}reset(){return this.privateKey=this.publicKey=null,this._clear()}async sign(e){if(!this.browserSupport||null===this.privateKey)return!1;const t=`${this.jwtHeader}.${this._encode64(JSON.stringify(e))}`,r=await this.crypto.subtle.sign(this.algorithm,this.privateKey,this.textEncoder.encode(t));return`${t}.${btoa(Reflect.apply(String.fromCharCode,null,new Uint8Array(r))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}`}_checkBrowserSupport(){return this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,this.crypto=window.crypto||window.msCrypto,window.indexedDB&&window.crypto}_handleErrors(e){throw e}_publicKeyFromPrivateKey(e){return Object.keys(e).filter((e=>this.publicKeyAttrs.includes(e))).reduce(((t,r)=>(t[r]=e[r],t)),{})}_matchesStoredPublicKey(e){return Y(e,this.storedPublicKey)}_encode64(e){return btoa(unescape(encodeURIComponent(e))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}async _read(){return this._useDb("readonly",(e=>{e.get(this.keyIdentifier).onsuccess=e=>{e.target.result&&(this.privateKey=e.target.result.privateKey,this.publicKey=e.target.result.publicKey)}}))}async _save(){return this._useDb("readwrite",(e=>{e.add({privateKey:this.privateKey,publicKey:this.publicKey},this.keyIdentifier)}))}async _clear(){return this._useDb("readwrite",(e=>{e.delete(this.keyIdentifier)}))}async _useDb(e,t){return new Promise(((r,n)=>{let i=null;const a=this.indexedDB.open(this.dbName,this.dbVersion);a.onerror=e=>{i=null,n(e)},a.onupgradeneeded=()=>{i=a.result,i.createObjectStore("IdentificationKeys")},a.onsuccess=()=>{i=a.result;const n=i.transaction(["IdentificationKeys"],e);t(n.objectStore("IdentificationKeys")),n.oncomplete=()=>{i.close(),r()}}}))}}class ee{constructor({authorityPublicKeyJSON:e,trusteeUniqueId:t,trusteeIdentificationKeys:r,trusteeWrapperAdapter:n}){this.trustee=new J({uniqueId:t,authorityPublicKeyJSON:e,identificationKeys:r,wrapperAdapter:n})}async setupElection(){throw new Error("not implemented")}async setupElectionWithTypesFilter({bulletinBoardClientParams:e,electionUniqueId:t,authorizationExpirationTimestamp:r,typesFilter:n}){const[i]=t.split("."),a=`${i}.${this.trustee.uniqueId}`,o=await this.trustee.signMessage({trustee_unique_id:a,exp:r}),s=new d({...e,headers:{Authorization:o,TrusteeUniqueId:a}}),u=new m({uniqueId:t,bulletinBoardClient:s,typesFilter:n});this.trustee.election=u}async bindEvents(){throw new Error("not implemented")}}class te extends ee{setupElection({bulletinBoardClientParams:e,electionUniqueId:t,authorizationExpirationTimestamp:r}){return this.setupElectionWithTypesFilter({electionUniqueId:t,bulletinBoardClientParams:e,authorizationExpirationTimestamp:r,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony"]})}async bindEvents({onEvent:e,onBindRestoreButton:t,onBindStartButton:r,onRestore:n,onComplete:i,onStart:a,onTrusteeNeedsToBeRestored:o,onBackupNeeded:s,onBindBackupButton:u,onBackupStarted:c}){const l=this.trustee.setup();this.trustee.events.subscribe(e),r((async e=>{if(a(),e.preventDefault(),await l,await this.trustee.needsToBeRestored())o();else{const e=this.trustee.setupKeyCeremony(),{value:t}=await e.next();s(),u(t,`${this.trustee.uniqueId}-election-${this.trustee.election.uniqueId}.bak`,(async()=>{c(),await e.next(),await this.trustee.runKeyCeremony(),i()}))}})),t((async e=>{await l;const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(n(),await this.trustee.runKeyCeremony(),i())},r.readAsText(t)}))}}class re extends ee{setupElection({bulletinBoardClientParams:e,electionUniqueId:t,authorizationExpirationTimestamp:r}){return this.setupElectionWithTypesFilter({electionUniqueId:t,bulletinBoardClientParams:e,authorizationExpirationTimestamp:r,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony","start_tally","tally","end_tally"]})}async bindEvents({onEvent:e,onBindRestoreButton:t,onBindStartButton:r,onRestore:n,onComplete:i,onStart:a,onTrusteeNeedsToBeRestored:o}){const s=this.trustee.setup();this.trustee.events.subscribe(e),r((async e=>{a(),e.preventDefault(),await s,await this.trustee.needsToBeRestored()?o():(await this.trustee.runTally(),i())})),t((async e=>{await s;const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(n(),await this.trustee.runTally(),i())},r.readAsText(t)}))}}class ne{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,voterUniqueId:n,voterWrapperAdapter:i}){this.bulletinBoardClient=new d(e);const a=new m({uniqueId:r,bulletinBoardClient:this.bulletinBoardClient});this.voter=new X({bulletinBoardClient:this.bulletinBoardClient,authorityPublicKeyJSON:t,election:a,uniqueId:n,wrapperAdapter:i})}async bindEvents({onBindEncryptButton:e,onStart:t,onVoteEncryption:r,castOrAuditBallot:n,onBindAuditBallotButton:i,onBindCastBallotButton:a,onAuditBallot:o,onCastBallot:s,onAuditComplete:u,onCastComplete:c,onInvalid:l}){const f=this.voter.setup();e((async()=>{t(),await f,r(((e,t)=>{this.voter.encrypt(e,t).then((e=>{n(e),i((()=>{o(e,`${this.voter.uniqueId}-election-${this.voter.election.uniqueId}.txt`),u()})),a((async()=>{try{const t=await s(e);c(t)}catch{l()}}))}))}),(()=>{l()}))}))}}})(),window.decidimBulletinBoard=n})();
|
@@ -24,8 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.bindir = "exe"
|
25
25
|
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
26
|
s.require_paths = ["lib"]
|
27
|
-
|
28
|
-
s.add_dependency "rails", ">= 5.0.0"
|
27
|
+
s.add_dependency "rails", "~> 6.0", ">= 5.0.0"
|
29
28
|
|
30
29
|
s.add_dependency "byebug", "~> 11.0"
|
31
30
|
s.add_dependency "graphlient", "~> 0.4.0"
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module BulletinBoard
|
5
|
+
module Authority
|
6
|
+
# This command uses the GraphQL client to report a missing trustee during the tally process.
|
7
|
+
class ReportMissingTrustee < Decidim::BulletinBoard::Command
|
8
|
+
# Public: Initializes the command.
|
9
|
+
#
|
10
|
+
# election_id - The local election identifier
|
11
|
+
# trustee_id - The trustee identifier
|
12
|
+
def initialize(election_id, trustee_id)
|
13
|
+
@election_id = election_id
|
14
|
+
@trustee_id = trustee_id
|
15
|
+
end
|
16
|
+
|
17
|
+
# Returns the message_id related to the operation
|
18
|
+
def message_id
|
19
|
+
@message_id ||= build_message_id(unique_election_id(election_id), "tally.missing_trustee")
|
20
|
+
end
|
21
|
+
|
22
|
+
# Executes the command. Broadcasts these events:
|
23
|
+
#
|
24
|
+
# - :ok when everything is valid and the query operation is successful.
|
25
|
+
# - :error if query operation was not successful.
|
26
|
+
#
|
27
|
+
# Returns nothing.
|
28
|
+
def call
|
29
|
+
# arguments used inside the graphql operation
|
30
|
+
args = {
|
31
|
+
message_id: message_id,
|
32
|
+
signed_data: sign_message(message_id, { trustee_id: trustee_id })
|
33
|
+
}
|
34
|
+
|
35
|
+
response = graphql.query do
|
36
|
+
mutation do
|
37
|
+
reportMissingTrustee(messageId: args[:message_id], signedData: args[:signed_data]) do
|
38
|
+
pendingMessage do
|
39
|
+
status
|
40
|
+
end
|
41
|
+
error
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
return broadcast(:error, response.data.report_missing_trustee.error) if response.data.report_missing_trustee.error.present?
|
47
|
+
|
48
|
+
broadcast(:ok, response.data.report_missing_trustee.pending_message)
|
49
|
+
rescue Graphlient::Errors::ServerError
|
50
|
+
broadcast(:error, "Sorry, something went wrong")
|
51
|
+
end
|
52
|
+
|
53
|
+
private
|
54
|
+
|
55
|
+
attr_reader :election_id, :trustee_id
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -6,12 +6,13 @@ require "decidim/bulletin_board/settings"
|
|
6
6
|
|
7
7
|
require "decidim/bulletin_board/authority/create_election"
|
8
8
|
require "decidim/bulletin_board/authority/end_vote"
|
9
|
+
require "decidim/bulletin_board/authority/get_election_results"
|
9
10
|
require "decidim/bulletin_board/authority/get_election_status"
|
11
|
+
require "decidim/bulletin_board/authority/publish_results"
|
12
|
+
require "decidim/bulletin_board/authority/report_missing_trustee"
|
10
13
|
require "decidim/bulletin_board/authority/start_key_ceremony"
|
11
14
|
require "decidim/bulletin_board/authority/start_tally"
|
12
15
|
require "decidim/bulletin_board/authority/start_vote"
|
13
|
-
require "decidim/bulletin_board/authority/publish_results"
|
14
|
-
require "decidim/bulletin_board/authority/get_election_results"
|
15
16
|
require "decidim/bulletin_board/voter/cast_vote"
|
16
17
|
require "decidim/bulletin_board/voter/get_pending_message_status"
|
17
18
|
require "decidim/bulletin_board/voter/in_person_vote"
|
@@ -101,6 +102,14 @@ module Decidim
|
|
101
102
|
start_tally.call
|
102
103
|
end
|
103
104
|
|
105
|
+
def report_missing_trustee(election_id, trustee_id)
|
106
|
+
report_missing_trustee = configure Authority::ReportMissingTrustee.new(election_id, trustee_id)
|
107
|
+
yield report_missing_trustee.message_id if block_given?
|
108
|
+
report_missing_trustee.on(:ok) { |pending_message| return pending_message }
|
109
|
+
report_missing_trustee.on(:error) { |error_message| raise StandardError, error_message }
|
110
|
+
report_missing_trustee.call
|
111
|
+
end
|
112
|
+
|
104
113
|
def get_election_results(election_id)
|
105
114
|
get_log_entries = configure Authority::GetElectionResults.new(election_id)
|
106
115
|
get_log_entries.on(:ok) { |result| return result }
|
@@ -7,8 +7,10 @@ module Decidim
|
|
7
7
|
class Engine < ::Rails::Engine
|
8
8
|
isolate_namespace Decidim::BulletinBoard
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
if defined?(Sprockets) && Sprockets::VERSION.chr.to_i >= 4
|
11
|
+
initializer "decidim_bulletin_board.assets" do |app|
|
12
|
+
app.config.assets.precompile += %w(decidim_bulletin_board_manifest.js)
|
13
|
+
end
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
@@ -885,6 +885,47 @@
|
|
885
885
|
"isDeprecated": false,
|
886
886
|
"deprecationReason": null
|
887
887
|
},
|
888
|
+
{
|
889
|
+
"name": "reportMissingTrustee",
|
890
|
+
"description": null,
|
891
|
+
"args": [
|
892
|
+
{
|
893
|
+
"name": "messageId",
|
894
|
+
"description": null,
|
895
|
+
"type": {
|
896
|
+
"kind": "NON_NULL",
|
897
|
+
"name": null,
|
898
|
+
"ofType": {
|
899
|
+
"kind": "SCALAR",
|
900
|
+
"name": "String",
|
901
|
+
"ofType": null
|
902
|
+
}
|
903
|
+
},
|
904
|
+
"defaultValue": null
|
905
|
+
},
|
906
|
+
{
|
907
|
+
"name": "signedData",
|
908
|
+
"description": null,
|
909
|
+
"type": {
|
910
|
+
"kind": "NON_NULL",
|
911
|
+
"name": null,
|
912
|
+
"ofType": {
|
913
|
+
"kind": "SCALAR",
|
914
|
+
"name": "String",
|
915
|
+
"ofType": null
|
916
|
+
}
|
917
|
+
},
|
918
|
+
"defaultValue": null
|
919
|
+
}
|
920
|
+
],
|
921
|
+
"type": {
|
922
|
+
"kind": "OBJECT",
|
923
|
+
"name": "ReportMissingTrusteeMutationPayload",
|
924
|
+
"ofType": null
|
925
|
+
},
|
926
|
+
"isDeprecated": false,
|
927
|
+
"deprecationReason": null
|
928
|
+
},
|
888
929
|
{
|
889
930
|
"name": "resetTestDatabase",
|
890
931
|
"description": null,
|
@@ -1499,6 +1540,47 @@
|
|
1499
1540
|
"enumValues": null,
|
1500
1541
|
"possibleTypes": null
|
1501
1542
|
},
|
1543
|
+
{
|
1544
|
+
"kind": "OBJECT",
|
1545
|
+
"name": "ReportMissingTrusteeMutationPayload",
|
1546
|
+
"description": "Autogenerated return type of ReportMissingTrusteeMutation",
|
1547
|
+
"fields": [
|
1548
|
+
{
|
1549
|
+
"name": "error",
|
1550
|
+
"description": null,
|
1551
|
+
"args": [
|
1552
|
+
|
1553
|
+
],
|
1554
|
+
"type": {
|
1555
|
+
"kind": "SCALAR",
|
1556
|
+
"name": "String",
|
1557
|
+
"ofType": null
|
1558
|
+
},
|
1559
|
+
"isDeprecated": false,
|
1560
|
+
"deprecationReason": null
|
1561
|
+
},
|
1562
|
+
{
|
1563
|
+
"name": "pendingMessage",
|
1564
|
+
"description": null,
|
1565
|
+
"args": [
|
1566
|
+
|
1567
|
+
],
|
1568
|
+
"type": {
|
1569
|
+
"kind": "OBJECT",
|
1570
|
+
"name": "PendingMessage",
|
1571
|
+
"ofType": null
|
1572
|
+
},
|
1573
|
+
"isDeprecated": false,
|
1574
|
+
"deprecationReason": null
|
1575
|
+
}
|
1576
|
+
],
|
1577
|
+
"inputFields": null,
|
1578
|
+
"interfaces": [
|
1579
|
+
|
1580
|
+
],
|
1581
|
+
"enumValues": null,
|
1582
|
+
"possibleTypes": null
|
1583
|
+
},
|
1502
1584
|
{
|
1503
1585
|
"kind": "OBJECT",
|
1504
1586
|
"name": "ResetTestDatabaseMutationPayload",
|