@flemist/test-variants 2.0.0-alpha → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/browser.js +420 -237
- package/dist/lib/index.cjs +4 -0
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/index.mjs +3 -0
- package/dist/lib/test-variants/createTestVariants.cjs +3 -0
- package/dist/lib/test-variants/createTestVariants.d.ts +1 -1
- package/dist/lib/test-variants/createTestVariants.mjs +3 -0
- package/dist/lib/test-variants/createTestVariants.perf.cjs +3 -0
- package/dist/lib/test-variants/createTestVariants.perf.mjs +3 -0
- package/dist/lib/test-variants/saveErrorVariants.cjs +97 -0
- package/dist/lib/test-variants/saveErrorVariants.d.ts +9 -0
- package/dist/lib/test-variants/saveErrorVariants.mjs +69 -0
- package/dist/lib/test-variants/testVariantsRun.cjs +55 -7
- package/dist/lib/test-variants/testVariantsRun.d.ts +5 -3
- package/dist/lib/test-variants/testVariantsRun.mjs +36 -8
- package/dist/lib/test-variants/types.d.ts +17 -0
- package/package.json +7 -4
package/dist/bundle/browser.js
CHANGED
|
@@ -1,250 +1,405 @@
|
|
|
1
|
-
!function(t){"use strict";
|
|
2
|
-
return
|
|
3
|
-
|
|
4
|
-
;return t
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
!function(t,e,n){"use strict";function r(t){
|
|
2
|
+
if(t&&t.__esModule)return t
|
|
3
|
+
;var e=Object.create(null)
|
|
4
|
+
;return t&&Object.keys(t).forEach(function(n){
|
|
5
|
+
if("default"!==n){
|
|
6
|
+
var r=Object.getOwnPropertyDescriptor(t,n)
|
|
7
|
+
;Object.defineProperty(e,n,r.get?r:{enumerable:!0,
|
|
8
|
+
get:function(){return t[n]}})}
|
|
9
|
+
}),e.default=t,Object.freeze(e)}
|
|
10
|
+
var s=r(e),i=r(n),o=function(){
|
|
11
|
+
return o=Object.assign||function(t){
|
|
12
|
+
for(var e,n=1,r=arguments.length;n<r;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])
|
|
13
|
+
;return t},o.apply(this,arguments)}
|
|
14
|
+
;function c(t,e,n,r){
|
|
15
|
+
return new(n||(n=Promise))(function(s,i){
|
|
16
|
+
function o(t){try{l(r.next(t))}catch(t){i(t)}}
|
|
17
|
+
function c(t){try{l(r.throw(t))}catch(t){i(t)}}
|
|
18
|
+
function l(t){var e
|
|
19
|
+
;t.done?s(t.value):(e=t.value,e instanceof n?e:new n(function(t){
|
|
20
|
+
t(e)})).then(o,c)}l((r=r.apply(t,e||[])).next())})
|
|
21
|
+
}function l(t,e){var n,r,s,i,o={label:0,
|
|
22
|
+
sent:function(){if(1&s[0])throw s[1];return s[1]},
|
|
23
|
+
trys:[],ops:[]};return i={next:c(0),throw:c(1),
|
|
24
|
+
return:c(2)
|
|
25
|
+
},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){
|
|
26
|
+
return this}),i;function c(c){return function(l){
|
|
27
|
+
return function(c){
|
|
19
28
|
if(n)throw new TypeError("Generator is already executing.")
|
|
20
|
-
;for(;
|
|
21
|
-
if(n=1,r&&(
|
|
22
|
-
0):r.next)&&!(
|
|
23
|
-
;switch(r=0,
|
|
24
|
-
case 1:
|
|
25
|
-
value:
|
|
26
|
-
;continue;case 7:
|
|
29
|
+
;for(;i&&(i=0,c[0]&&(o=0)),o;)try{
|
|
30
|
+
if(n=1,r&&(s=2&c[0]?r.return:c[0]?r.throw||((s=r.return)&&s.call(r),
|
|
31
|
+
0):r.next)&&!(s=s.call(r,c[1])).done)return s
|
|
32
|
+
;switch(r=0,s&&(c=[2&c[0],s.value]),c[0]){case 0:
|
|
33
|
+
case 1:s=c;break;case 4:return o.label++,{
|
|
34
|
+
value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0]
|
|
35
|
+
;continue;case 7:c=o.ops.pop(),o.trys.pop()
|
|
27
36
|
;continue;default:
|
|
28
|
-
if(!(
|
|
37
|
+
if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==c[0]&&2!==c[0])){
|
|
29
38
|
o=0;continue}
|
|
30
|
-
if(3===
|
|
31
|
-
o.label=
|
|
32
|
-
o.label=
|
|
33
|
-
o.label=
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if(5&
|
|
37
|
-
value:
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
;
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
|
|
39
|
+
if(3===c[0]&&(!s||c[1]>s[0]&&c[1]<s[3])){
|
|
40
|
+
o.label=c[1];break}if(6===c[0]&&o.label<s[1]){
|
|
41
|
+
o.label=s[1],s=c;break}if(s&&o.label<s[2]){
|
|
42
|
+
o.label=s[2],o.ops.push(c);break}
|
|
43
|
+
s[2]&&o.ops.pop(),o.trys.pop();continue}
|
|
44
|
+
c=e.call(t,o)}catch(t){c=[6,t],r=0}finally{n=s=0}
|
|
45
|
+
if(5&c[0])throw c[1];return{
|
|
46
|
+
value:c[0]?c[1]:void 0,done:!0}}([c,l])}}}
|
|
47
|
+
function a(t){
|
|
48
|
+
return c(this,void 0,void 0,function(){var e,n
|
|
49
|
+
;return l(this,function(r){switch(r.label){case 0:
|
|
50
|
+
return[4,s.promises.stat(t).catch(function(){
|
|
51
|
+
return null})];case 1:
|
|
52
|
+
if(null==(e=r.sent()))return[2,[]]
|
|
53
|
+
;if(!e.isDirectory())throw new Error("[saveErrorVariants] path is not a directory: ".concat(t))
|
|
54
|
+
;return[4,s.promises.readdir(t)];case 2:
|
|
55
|
+
return n=r.sent(),[2,n.filter(function(t){
|
|
56
|
+
return t.endsWith(".json")}).sort(function(t,e){
|
|
57
|
+
return t>e?-1:t<e?1:0}).map(function(e){
|
|
58
|
+
return i.join(t,e)})]}})})}function u(t,e){
|
|
59
|
+
return c(this,void 0,void 0,function(){var n,r
|
|
60
|
+
;return l(this,function(i){switch(i.label){case 0:
|
|
61
|
+
return[4,s.promises.readFile(t,"utf-8")];case 1:
|
|
62
|
+
n=i.sent();try{r=JSON.parse(n)}catch(e){
|
|
63
|
+
throw new Error("[saveErrorVariants] invalid JSON in file: ".concat(t))
|
|
64
|
+
}if(e)try{return[2,e(r)]}catch(e){
|
|
65
|
+
throw new Error("[saveErrorVariants] jsonToArgs failed for file: ".concat(t))
|
|
66
|
+
}return[2,r]}})})}function h(t){
|
|
67
|
+
return t.sessionDate.toISOString().substring(0,19).replace("T","_").replaceAll(":","-")+".json"
|
|
68
|
+
}function f(t,e,n){
|
|
69
|
+
return c(this,void 0,void 0,function(){var r,o
|
|
70
|
+
;return l(this,function(c){switch(c.label){case 0:
|
|
71
|
+
return n?(o=n(t),r="string"==typeof o?o:JSON.stringify(o,null,2)):r=JSON.stringify(t,null,2),
|
|
72
|
+
[4,s.promises.mkdir(i.dirname(e),{recursive:!0})]
|
|
73
|
+
;case 1:
|
|
74
|
+
return c.sent(),[4,s.promises.writeFile(e,r,"utf-8")]
|
|
75
|
+
;case 2:return c.sent(),[2]}})})}function d(t){
|
|
76
|
+
var e,n=t.argsTemplates
|
|
77
|
+
;return(e={})[Symbol.iterator]=function(){
|
|
78
|
+
var t=Object.keys(n),e=Object.values(n),r=t.length,s={}
|
|
79
|
+
;function i(t){var n=e[t]
|
|
80
|
+
;return"function"==typeof n&&(n=n(s)),n}
|
|
81
|
+
for(var c=[],l=[],a=0;a<r;a++)c[a]=-1,l[a]=[]
|
|
82
|
+
;return l[0]=i(0),{next:function(){
|
|
83
|
+
return function(){for(var e=r-1;e>=0;e--){
|
|
84
|
+
var n=c[e]+1;if(n<l[e].length){
|
|
85
|
+
var o=t[e],a=l[e][n]
|
|
86
|
+
;for(c[e]=n,s[o]=a,e++;e<r;e++){var u=i(e)
|
|
87
|
+
;if(0===u.length)break;c[e]=0,l[e]=u
|
|
88
|
+
;var h=t[e],f=u[0];s[h]=f}if(e>=r)return!0}}
|
|
89
|
+
return!1}()?{done:!1,value:o({},s)}:{done:!0,
|
|
90
|
+
value:null}}}},e}function v(t,e){return t<e}
|
|
91
|
+
class _{
|
|
54
92
|
constructor({objectPool:t,lessThanFunc:e}={}){
|
|
55
|
-
this._size=0,this._root=null,this.merge=
|
|
56
|
-
this.collapse=
|
|
93
|
+
this._size=0,this._root=null,this.merge=y,
|
|
94
|
+
this.collapse=b,this._objectPool=t,this._lessThanFunc=e||v
|
|
57
95
|
}clear(){this._root=null,this._size=0}get size(){
|
|
58
96
|
return this._size}add(t){
|
|
59
97
|
let e=null!=this._objectPool?this._objectPool.get():null
|
|
60
98
|
;return null==e?e={child:null,next:null,prev:null,
|
|
61
99
|
item:t
|
|
62
|
-
}:e.item=t,this._size++,this._root=
|
|
100
|
+
}:e.item=t,this._size++,this._root=y(this._root,e,this._lessThanFunc),e
|
|
63
101
|
}getMin(){const{_root:t}=this
|
|
64
102
|
;return null==t?void 0:t.item}getMinNode(){
|
|
65
103
|
return this._root}deleteMin(){const{_root:t}=this
|
|
66
104
|
;if(null==t)return;const e=t.item
|
|
67
105
|
;return this.delete(t),e}delete(t){var e
|
|
68
|
-
;if(t===this._root)this._root=
|
|
106
|
+
;if(t===this._root)this._root=b(t.child,this._lessThanFunc);else{
|
|
69
107
|
if(null==t.prev){
|
|
70
108
|
if(this._objectPool)throw new Error("The node is already deleted. Don't use the objectPool to prevent this error.")
|
|
71
109
|
;return}
|
|
72
110
|
t.prev.child===t?t.prev.child=t.next:t.prev.next=t.next,null!=t.next&&(t.next.prev=t.prev),
|
|
73
|
-
this._root=
|
|
111
|
+
this._root=y(this._root,b(t.child,this._lessThanFunc),this._lessThanFunc)
|
|
74
112
|
}
|
|
75
113
|
t.child=null,t.prev=null,t.next=null,t.item=void 0,null===(e=this._objectPool)||void 0===e||e.release(t),
|
|
76
114
|
this._size--}decreaseKey(t){
|
|
77
115
|
t!==this._root&&(t.prev.child===t?t.prev.child=t.next:t.prev.next=t.next,
|
|
78
116
|
null!=t.next&&(t.next.prev=t.prev),
|
|
79
|
-
this._root=
|
|
117
|
+
this._root=y(this._root,t,this._lessThanFunc))}
|
|
80
118
|
get isEmpty(){return null==this._root}
|
|
81
119
|
[Symbol.iterator](){return this._iterate(!1)}
|
|
82
120
|
nodes(){return{
|
|
83
121
|
[Symbol.iterator]:()=>this._iterate(!0)}}
|
|
84
122
|
_iterate(t){const e=this._lessThanFunc
|
|
85
123
|
;return function*n(r){
|
|
86
|
-
r&&(t?yield r:yield r.item,r.child&&(null!=r.child.next&&(r.child=
|
|
124
|
+
r&&(t?yield r:yield r.item,r.child&&(null!=r.child.next&&(r.child=b(r.child,e),
|
|
87
125
|
r.child.prev=r),yield*n(r.child)))}(this._root)}}
|
|
88
|
-
function
|
|
126
|
+
function y(t,e,n){let r,s
|
|
89
127
|
;return null==t?e:null==e||t===e?t:(n(e.item,t.item)?(r=e,
|
|
90
|
-
|
|
91
|
-
null!=r.child&&(r.child.prev=
|
|
92
|
-
r.next=null,r.prev=null,r)}function
|
|
93
|
-
let n,r,i,
|
|
94
|
-
;for(
|
|
95
|
-
if(r=s
|
|
96
|
-
s
|
|
97
|
-
for(o=null;null!=n;)
|
|
98
|
-
;return o}function
|
|
99
|
-
then(e,n){n(t)}}}(e))}function
|
|
128
|
+
s=t):(r=t,s=e),s.next=r.child,
|
|
129
|
+
null!=r.child&&(r.child.prev=s),s.prev=r,r.child=s,
|
|
130
|
+
r.next=null,r.prev=null,r)}function b(t,e){
|
|
131
|
+
let n,r,s,i,o;if(null==t)return null
|
|
132
|
+
;for(i=t,n=null;null!=i;){
|
|
133
|
+
if(r=i,s=r.next,null==s){r.prev=n,n=r;break}
|
|
134
|
+
i=s.next,o=y(r,s,e),o.prev=n,n=o}
|
|
135
|
+
for(o=null;null!=n;)i=n.prev,o=y(o,n,e),n=i
|
|
136
|
+
;return o}function p(t,e){t(function(t){return{
|
|
137
|
+
then(e,n){n(t)}}}(e))}function g(t){
|
|
100
138
|
return null!=t&&"object"==typeof t&&"function"==typeof t.then
|
|
101
|
-
}let
|
|
102
|
-
|
|
103
|
-
return
|
|
104
|
-
for(;
|
|
105
|
-
;
|
|
139
|
+
}let m,w=[];function j(t){
|
|
140
|
+
w.push(t),m||(m=function(){
|
|
141
|
+
return c(this,void 0,void 0,function*(){
|
|
142
|
+
for(;w.length>0;){yield 0;const t=w
|
|
143
|
+
;w=[],t.forEach(t=>{try{t()}catch(t){
|
|
106
144
|
console.error("Unhandled promise rejection",t)}})}
|
|
107
|
-
|
|
145
|
+
m=null})}())}function S(t,e,n){j(()=>{try{
|
|
108
146
|
const r=e?e(t):t;n._resolve(r)}catch(t){
|
|
109
|
-
n._reject(t)}})}function
|
|
147
|
+
n._reject(t)}})}function x(t,e,n){j(()=>{if(e)try{
|
|
110
148
|
const r=e(t);n._resolve(r)}catch(t){n._reject(t)
|
|
111
|
-
}else n._reject(t)})}const
|
|
149
|
+
}else n._reject(t)})}const E=function(){};class A{
|
|
112
150
|
constructor(t){
|
|
113
151
|
this.status="pending",this.value=void 0,this.reason=void 0,this._handlers=null
|
|
114
|
-
;const e=this._resolve,n=this._reject,r=this._resolveAsync,
|
|
115
|
-
;this._resolve=function(t){e.call(
|
|
116
|
-
},this._reject=function(t){n.call(
|
|
117
|
-
},this._resolveAsync=function(t){r.call(
|
|
118
|
-
},this._rejectAsync=function(t){
|
|
152
|
+
;const e=this._resolve,n=this._reject,r=this._resolveAsync,s=this._rejectAsync,i=this
|
|
153
|
+
;this._resolve=function(t){e.call(i,t)
|
|
154
|
+
},this._reject=function(t){n.call(i,t)
|
|
155
|
+
},this._resolveAsync=function(t){r.call(i,t)
|
|
156
|
+
},this._rejectAsync=function(t){s.call(i,t)
|
|
119
157
|
},t(this._resolve,this._reject)}_resolve(t){
|
|
120
158
|
"pending"===this.status&&(this.status="fulfilled",
|
|
121
159
|
this._resolveAsync(t))}_resolveAsync(t){
|
|
122
|
-
|
|
160
|
+
g(t)?t.then(this._resolveAsync,this._rejectAsync):this._resolveSync(t)
|
|
123
161
|
}_resolveSync(t){const e=this._handlers
|
|
124
162
|
;if(this.value=t,null!=e){this._handlers=null
|
|
125
|
-
;for(let n=0,r=e.length;n<r;n++){const[r,,
|
|
126
|
-
;
|
|
163
|
+
;for(let n=0,r=e.length;n<r;n++){const[r,,s]=e[n]
|
|
164
|
+
;S(t,r,s)}}}_reject(t){
|
|
127
165
|
"pending"===this.status&&this._rejectAsync(t)}
|
|
128
166
|
_rejectAsync(t){
|
|
129
|
-
this.status="rejected",
|
|
167
|
+
this.status="rejected",g(t)?t.then(this._rejectAsync,this._rejectAsync):this._rejectSync(t)
|
|
130
168
|
}_rejectSync(t){const e=this._handlers
|
|
131
169
|
;if(this.reason=t,null!=e){this._handlers=null
|
|
132
|
-
;for(let n=0,r=e.length;n<r;n++){const[,r,
|
|
133
|
-
;
|
|
170
|
+
;for(let n=0,r=e.length;n<r;n++){const[,r,s]=e[n]
|
|
171
|
+
;x(t,r,s)}}}then(t,e){const n=new A(E)
|
|
134
172
|
;return"pending"===this.status?(null==this._handlers&&(this._handlers=[]),
|
|
135
|
-
this._handlers.push([t,e,n])):"fulfilled"===this.status?
|
|
173
|
+
this._handlers.push([t,e,n])):"fulfilled"===this.status?S(this.value,t,n):x(this.reason,e,n),
|
|
136
174
|
n}catch(t){return this.then(void 0,t)}finally(t){
|
|
137
175
|
const e=t&&function(e){const n=t()
|
|
138
|
-
;return
|
|
176
|
+
;return g(n)?n.then(()=>e):A.resolve(e)
|
|
139
177
|
},n=t&&function(e){const n=t()
|
|
140
|
-
;return
|
|
178
|
+
;return g(n)?n.then(()=>A.reject(e)):A.reject(e)}
|
|
141
179
|
;return this.then(e,n)}static resolve(t){
|
|
142
|
-
const e=new
|
|
143
|
-
static reject(t){const e=new
|
|
180
|
+
const e=new A(E);return e._resolve(t),e}
|
|
181
|
+
static reject(t){const e=new A(E)
|
|
144
182
|
;return e._reject(t),e}get[Symbol.toStringTag](){
|
|
145
183
|
return"Promise"}static get[Symbol.species](){
|
|
146
|
-
return
|
|
147
|
-
let n,r;e||(e=Promise);const
|
|
148
|
-
n=t,r=e});let
|
|
149
|
-
;return t.forEach((t,e)=>{
|
|
150
|
-
o[e]=t,0===--
|
|
151
|
-
}),
|
|
184
|
+
return A}static all(t){return function(t,e){
|
|
185
|
+
let n,r;e||(e=Promise);const s=new e((t,e)=>{
|
|
186
|
+
n=t,r=e});let i=t.length;const o=[]
|
|
187
|
+
;return t.forEach((t,e)=>{g(t)?t.then(t=>{
|
|
188
|
+
o[e]=t,0===--i&&n(o)},r):(o[e]=t,0===--i&&n(o))
|
|
189
|
+
}),s}(t,A)}static allSettled(t){
|
|
152
190
|
return function(t,e){let n;e||(e=Promise)
|
|
153
|
-
;const r=new e((t,e)=>{n=t});let
|
|
154
|
-
;const
|
|
155
|
-
|
|
156
|
-
},0===--
|
|
157
|
-
reason:t},0===--
|
|
158
|
-
status:"fulfilled",value:t},0===--
|
|
159
|
-
}(t,
|
|
160
|
-
;e||(e=Promise);const
|
|
161
|
-
;let
|
|
162
|
-
;return t.forEach((t,e)=>{
|
|
163
|
-
o[e]=t,0===--
|
|
164
|
-
}),
|
|
165
|
-
let n,r;e||(e=Promise);const
|
|
191
|
+
;const r=new e((t,e)=>{n=t});let s=t.length
|
|
192
|
+
;const i=[];return t.forEach((t,e)=>{
|
|
193
|
+
g(t)?t.then(t=>{i[e]={status:"fulfilled",value:t
|
|
194
|
+
},0===--s&&n(i)},t=>{i[e]={status:"rejected",
|
|
195
|
+
reason:t},0===--s&&n(i)}):(i[e]={
|
|
196
|
+
status:"fulfilled",value:t},0===--s&&n(i))}),r
|
|
197
|
+
}(t,A)}static any(t){return function(t,e){let n,r
|
|
198
|
+
;e||(e=Promise);const s=new e((t,e)=>{n=t,r=e})
|
|
199
|
+
;let i=t.length;const o=[]
|
|
200
|
+
;return t.forEach((t,e)=>{g(t)?t.then(n,t=>{
|
|
201
|
+
o[e]=t,0===--i&&r(new AggregateError(o))}):n(t)
|
|
202
|
+
}),s}(t,A)}static race(t){return function(t,e){
|
|
203
|
+
let n,r;e||(e=Promise);const s=new e((t,e)=>{
|
|
166
204
|
n=t,r=e});return t.forEach(t=>{
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
if(this._status="pending",t&&t.aborted)this.promise=
|
|
170
|
-
this.resolve=
|
|
205
|
+
g(t)?t.then(n,r):n(t)}),s}(t,A)}}
|
|
206
|
+
const P=function(){};class k{constructor(t){
|
|
207
|
+
if(this._status="pending",t&&t.aborted)this.promise=A.reject(t.reason),
|
|
208
|
+
this.resolve=P,this.reject=P;else{let e,n
|
|
171
209
|
;if(this.promise=new Promise(function(t){
|
|
172
|
-
e=t,n=function(e){
|
|
210
|
+
e=t,n=function(e){p(t,e)}}),t){
|
|
173
211
|
const r=t.subscribe(function(t){n(t)})
|
|
174
212
|
;this.resolve=function(t){r(),e(t)
|
|
175
213
|
},this.reject=function(t){r(),n(t)}
|
|
176
214
|
}else this.resolve=e,this.reject=n}
|
|
177
215
|
this.promise.then(()=>{this._status="resolved"
|
|
178
216
|
},()=>{this._status="rejected"})}get state(){
|
|
179
|
-
return this._status}}class
|
|
217
|
+
return this._status}}class T extends Error{
|
|
180
218
|
constructor(t,e){
|
|
181
|
-
super(t),Object.setPrototypeOf(this,
|
|
219
|
+
super(t),Object.setPrototypeOf(this,T.prototype),this.reason=e,
|
|
182
220
|
this.name="AbortError",this._internal=!1}}
|
|
183
|
-
const
|
|
221
|
+
const z=()=>{};class O{constructor(){
|
|
184
222
|
this.aborted=!1,this.reason=void 0,this._callbacks=void 0
|
|
185
223
|
}subscribe(t){var e
|
|
186
224
|
;if(null===(e=this._callbacks)||void 0===e?void 0:e.has(t))throw new Error("Already subscribed: "+t)
|
|
187
225
|
;return this.aborted?(t.call(this,this.reason),
|
|
188
|
-
|
|
226
|
+
z):(this._callbacks||(this._callbacks=new Set),
|
|
189
227
|
this._callbacks.add(t),()=>{var e
|
|
190
228
|
;null===(e=this._callbacks)||void 0===e||e.delete(t)
|
|
191
229
|
})}abort(t){var e
|
|
192
230
|
;this.aborted=!0,this.reason=t,null===(e=this._callbacks)||void 0===e||e.forEach(t=>{
|
|
193
231
|
t.call(this,this.reason)}),this._callbacks=void 0}
|
|
194
232
|
throwIfAborted(){if(this.aborted)throw this.reason
|
|
195
|
-
}}class
|
|
233
|
+
}}class M{constructor(){this.signal=new O}
|
|
196
234
|
abort(t){
|
|
197
|
-
this.signal.aborted||(void 0===t&&((t=new
|
|
198
|
-
this.signal.abort(t))}}function
|
|
199
|
-
var
|
|
200
|
-
return
|
|
201
|
-
;return
|
|
202
|
-
return
|
|
203
|
-
},console.error("[test-variants] error variant: ".concat(
|
|
235
|
+
this.signal.aborted||(void 0===t&&((t=new T("Aborted with no reason",t))._internal=!0),
|
|
236
|
+
this.signal.abort(t))}}function F(t,e){
|
|
237
|
+
var n=0,r=null;function s(t,s,i){
|
|
238
|
+
return c(this,void 0,void 0,function(){var o
|
|
239
|
+
;return l(this,function(c){switch(c.label){case 0:
|
|
240
|
+
return r={error:t,args:s,index:i
|
|
241
|
+
},console.error("[test-variants] error variant: ".concat(i,"\n").concat(function(t){
|
|
204
242
|
return JSON.stringify(t,function(t,e){
|
|
205
243
|
return e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor!==Object?e+"":e
|
|
206
244
|
},2)
|
|
207
|
-
}(
|
|
208
|
-
|
|
209
|
-
|
|
245
|
+
}(s))),console.error(t),o=Date.now(),Date.now()-o>50&&n<5?(console.log("[test-variants] DEBUG ITERATION: "+n),
|
|
246
|
+
n++,[2]):e.onError?[4,e.onError(r)]:[3,2];case 1:
|
|
247
|
+
c.sent(),c.label=2;case 2:throw r.error}})})}
|
|
210
248
|
return function(e,n,r){try{var i=t(e,r)
|
|
211
|
-
;if(
|
|
249
|
+
;if(g(i))return i.then(function(t){
|
|
212
250
|
return"number"==typeof t?{iterationsAsync:t,
|
|
213
251
|
iterationsSync:0}:null!==t&&"object"==typeof t?t:{
|
|
214
252
|
iterationsAsync:1,iterationsSync:0}},function(t){
|
|
215
|
-
return
|
|
253
|
+
return s(t,e,n)});return"number"==typeof i?{
|
|
216
254
|
iterationsAsync:0,iterationsSync:i
|
|
217
255
|
}:null!==i&&"object"==typeof i?i:{
|
|
218
256
|
iterationsAsync:0,iterationsSync:1}}catch(t){
|
|
219
|
-
return
|
|
257
|
+
return s(t,e,n)}}}class I{constructor(t,e){
|
|
220
258
|
this._branch=null,this.order=t,this.parent=e}
|
|
221
259
|
get branch(){if(!this._branch){
|
|
222
260
|
const t=[this.order];let e=this.parent
|
|
223
261
|
;for(;null!=e;)t.push(e.order),e=e.parent
|
|
224
262
|
;this._branch=t}return this._branch}}
|
|
225
|
-
|
|
263
|
+
function D(t){
|
|
264
|
+
return null!=t&&"object"==typeof t&&"function"==typeof t.then
|
|
265
|
+
}let C,R=[];function J(t){
|
|
266
|
+
R.push(t),C||(C=function(){
|
|
267
|
+
return c(this,void 0,void 0,function*(){
|
|
268
|
+
for(;R.length>0;){yield 0;const t=R
|
|
269
|
+
;R=[],t.forEach(t=>{try{t()}catch(t){
|
|
270
|
+
console.error("Unhandled promise rejection",t)}})}
|
|
271
|
+
C=null})}())}function N(t,e,n){J(()=>{try{
|
|
272
|
+
const r=e?e(t):t;n._resolve(r)}catch(t){
|
|
273
|
+
n._reject(t)}})}function V(t,e,n){J(()=>{if(e)try{
|
|
274
|
+
const r=e(t);n._resolve(r)}catch(t){n._reject(t)
|
|
275
|
+
}else n._reject(t)})}const $=function(){};class G{
|
|
276
|
+
constructor(t){
|
|
277
|
+
this.status="pending",this.value=void 0,this.reason=void 0,this._handlers=null
|
|
278
|
+
;const e=this._resolve,n=this._reject,r=this._resolveAsync,s=this._rejectAsync,i=this
|
|
279
|
+
;this._resolve=function(t){e.call(i,t)
|
|
280
|
+
},this._reject=function(t){n.call(i,t)
|
|
281
|
+
},this._resolveAsync=function(t){r.call(i,t)
|
|
282
|
+
},this._rejectAsync=function(t){s.call(i,t)
|
|
283
|
+
},t(this._resolve,this._reject)}_resolve(t){
|
|
284
|
+
"pending"===this.status&&(this.status="fulfilled",
|
|
285
|
+
this._resolveAsync(t))}_resolveAsync(t){
|
|
286
|
+
D(t)?t.then(this._resolveAsync,this._rejectAsync):this._resolveSync(t)
|
|
287
|
+
}_resolveSync(t){const e=this._handlers
|
|
288
|
+
;if(this.value=t,null!=e){this._handlers=null
|
|
289
|
+
;for(let n=0,r=e.length;n<r;n++){const[r,,s]=e[n]
|
|
290
|
+
;N(t,r,s)}}}_reject(t){
|
|
291
|
+
"pending"===this.status&&this._rejectAsync(t)}
|
|
292
|
+
_rejectAsync(t){
|
|
293
|
+
this.status="rejected",D(t)?t.then(this._rejectAsync,this._rejectAsync):this._rejectSync(t)
|
|
294
|
+
}_rejectSync(t){const e=this._handlers
|
|
295
|
+
;if(this.reason=t,null!=e){this._handlers=null
|
|
296
|
+
;for(let n=0,r=e.length;n<r;n++){const[,r,s]=e[n]
|
|
297
|
+
;V(t,r,s)}}}then(t,e){const n=new G($)
|
|
298
|
+
;return"pending"===this.status?(null==this._handlers&&(this._handlers=[]),
|
|
299
|
+
this._handlers.push([t,e,n])):"fulfilled"===this.status?N(this.value,t,n):V(this.reason,e,n),
|
|
300
|
+
n}catch(t){return this.then(void 0,t)}finally(t){
|
|
301
|
+
const e=t&&function(e){const n=t()
|
|
302
|
+
;return D(n)?n.then(()=>e):G.resolve(e)
|
|
303
|
+
},n=t&&function(e){const n=t()
|
|
304
|
+
;return D(n)?n.then(()=>G.reject(e)):G.reject(e)}
|
|
305
|
+
;return this.then(e,n)}static resolve(t){
|
|
306
|
+
const e=new G($);return e._resolve(t),e}
|
|
307
|
+
static reject(t){const e=new G($)
|
|
308
|
+
;return e._reject(t),e}get[Symbol.toStringTag](){
|
|
309
|
+
return"Promise"}static get[Symbol.species](){
|
|
310
|
+
return G}static all(t){return function(t,e){
|
|
311
|
+
let n,r;e||(e=Promise);const s=new e((t,e)=>{
|
|
312
|
+
n=t,r=e});let i=t.length;const o=[]
|
|
313
|
+
;return t.forEach((t,e)=>{D(t)?t.then(t=>{
|
|
314
|
+
o[e]=t,0===--i&&n(o)},r):(o[e]=t,0===--i&&n(o))
|
|
315
|
+
}),s}(t,G)}static allSettled(t){
|
|
316
|
+
return function(t,e){let n;e||(e=Promise)
|
|
317
|
+
;const r=new e((t,e)=>{n=t});let s=t.length
|
|
318
|
+
;const i=[];return t.forEach((t,e)=>{
|
|
319
|
+
D(t)?t.then(t=>{i[e]={status:"fulfilled",value:t
|
|
320
|
+
},0===--s&&n(i)},t=>{i[e]={status:"rejected",
|
|
321
|
+
reason:t},0===--s&&n(i)}):(i[e]={
|
|
322
|
+
status:"fulfilled",value:t},0===--s&&n(i))}),r
|
|
323
|
+
}(t,G)}static any(t){return function(t,e){let n,r
|
|
324
|
+
;e||(e=Promise);const s=new e((t,e)=>{n=t,r=e})
|
|
325
|
+
;let i=t.length;const o=[]
|
|
326
|
+
;return t.forEach((t,e)=>{D(t)?t.then(n,t=>{
|
|
327
|
+
o[e]=t,0===--i&&r(new AggregateError(o))}):n(t)
|
|
328
|
+
}),s}(t,G)}static race(t){return function(t,e){
|
|
329
|
+
let n,r;e||(e=Promise);const s=new e((t,e)=>{
|
|
330
|
+
n=t,r=e});return t.forEach(t=>{
|
|
331
|
+
D(t)?t.then(n,r):n(t)}),s}(t,G)}}
|
|
332
|
+
const U=function(){};class W{constructor(t){
|
|
333
|
+
if(this._status="pending",t&&t.aborted)this.promise=G.reject(t.reason),
|
|
334
|
+
this.resolve=U,this.reject=U;else{let e,n
|
|
335
|
+
;if(this.promise=new Promise(function(t){
|
|
336
|
+
e=t,n=function(e){!function(t,e){t(function(t){
|
|
337
|
+
return{then(e,n){n(t)}}}(e))}(t,e)}}),t){
|
|
338
|
+
const r=t.subscribe(function(t){n(t)})
|
|
339
|
+
;this.resolve=function(t){r(),e(t)
|
|
340
|
+
},this.reject=function(t){r(),n(t)}
|
|
341
|
+
}else this.resolve=e,this.reject=n}
|
|
342
|
+
this.promise.then(()=>{this._status="resolved"
|
|
343
|
+
},()=>{this._status="rejected"})}get state(){
|
|
344
|
+
return this._status}}
|
|
345
|
+
var q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}
|
|
346
|
+
;!function(t){if(!t.setImmediate){
|
|
347
|
+
var e,n,r,s,i,o=1,c={},l=!1,a=t.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(t)
|
|
348
|
+
;u=u&&u.setTimeout?u:t,
|
|
349
|
+
"[object process]"==={}.toString.call(t.process)?e=function(t){
|
|
350
|
+
process.nextTick(function(){f(t)})}:!function(){
|
|
351
|
+
if(t.postMessage&&!t.importScripts){
|
|
352
|
+
var e=!0,n=t.onmessage
|
|
353
|
+
;return t.onmessage=function(){e=!1
|
|
354
|
+
},t.postMessage("","*"),t.onmessage=n,e}
|
|
355
|
+
}()?t.MessageChannel?((r=new MessageChannel).port1.onmessage=function(t){
|
|
356
|
+
f(t.data)},e=function(t){r.port2.postMessage(t)
|
|
357
|
+
}):a&&"onreadystatechange"in a.createElement("script")?(n=a.documentElement,
|
|
358
|
+
e=function(t){var e=a.createElement("script")
|
|
359
|
+
;e.onreadystatechange=function(){
|
|
360
|
+
f(t),e.onreadystatechange=null,n.removeChild(e),
|
|
361
|
+
e=null},n.appendChild(e)}):e=function(t){
|
|
362
|
+
setTimeout(f,0,t)
|
|
363
|
+
}:(s="setImmediate$"+Math.random()+"$",i=function(e){
|
|
364
|
+
e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&f(+e.data.slice(s.length))
|
|
365
|
+
},
|
|
366
|
+
t.addEventListener?t.addEventListener("message",i,!1):t.attachEvent("onmessage",i),
|
|
367
|
+
e=function(e){t.postMessage(s+e,"*")
|
|
368
|
+
}),u.setImmediate=function(t){
|
|
369
|
+
"function"!=typeof t&&(t=new Function(""+t))
|
|
370
|
+
;for(var n=new Array(arguments.length-1),r=0;r<n.length;r++)n[r]=arguments[r+1]
|
|
371
|
+
;var s={callback:t,args:n};return c[o]=s,e(o),o++
|
|
372
|
+
},u.clearImmediate=h}function h(t){delete c[t]}
|
|
373
|
+
function f(t){if(l)setTimeout(f,0,t);else{
|
|
374
|
+
var e=c[t];if(e){l=!0;try{!function(t){
|
|
375
|
+
var e=t.callback,n=t.args;switch(n.length){case 0:
|
|
376
|
+
e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1])
|
|
377
|
+
;break;case 3:e(n[0],n[1],n[2]);break;default:
|
|
378
|
+
e.apply(void 0,n)}}(e)}finally{h(t),l=!1}}}}
|
|
379
|
+
}("undefined"==typeof self?q:self)
|
|
380
|
+
;const B=function(t){return t};function L(t,e){
|
|
226
381
|
return function(t,e){
|
|
227
|
-
const n=t&&t.branch,r=e&&e.branch,
|
|
382
|
+
const n=t&&t.branch,r=e&&e.branch,s=n?n.length:0,i=r?r.length:0,o=s>i?s:i
|
|
228
383
|
;for(let t=0;t<o;t++){
|
|
229
|
-
const e=t>=
|
|
384
|
+
const e=t>=s?0:n[s-1-t],o=t>=i?0:r[i-1-t]
|
|
230
385
|
;if(e!==o)return e>o?1:-1}return 0
|
|
231
|
-
}(t.priority,e.priority)<0}let
|
|
232
|
-
constructor(){this._queue=new
|
|
386
|
+
}(t.priority,e.priority)<0}let Q=1;class K{
|
|
387
|
+
constructor(){this._queue=new _({lessThanFunc:L})}
|
|
233
388
|
run(t,e,n){return this._run(!1,t,e,n)}
|
|
234
389
|
runTask(t,e,n){return this._run(!0,t,e,n)}
|
|
235
|
-
_run(t,e,n,r){const
|
|
236
|
-
priority:(o=
|
|
237
|
-
func:e,abortSignal:r,resolve:
|
|
238
|
-
reject:
|
|
239
|
-
;if(this._queue.add(
|
|
240
|
-
result:
|
|
241
|
-
|
|
390
|
+
_run(t,e,n,r){const s=new W(r),i={
|
|
391
|
+
priority:(o=Q++,c=n,null==o?null==c?null:c:new I(o,c)),
|
|
392
|
+
func:e,abortSignal:r,resolve:s.resolve,
|
|
393
|
+
reject:s.reject,readyToRun:!t};var o,c
|
|
394
|
+
;if(this._queue.add(i),t){const t=this;return{
|
|
395
|
+
result:s.promise,setReadyToRun(e){
|
|
396
|
+
i.readyToRun=e,e&&!t._inProcess&&(t._inProcess=!0,
|
|
242
397
|
t._process())}}}
|
|
243
|
-
return this._inProcess||(this._inProcess=!0,this._process()),
|
|
398
|
+
return this._inProcess||(this._inProcess=!0,this._process()),s.promise
|
|
244
399
|
}_process(){
|
|
245
|
-
return
|
|
400
|
+
return c(this,void 0,void 0,function*(){
|
|
246
401
|
const t=this._queue
|
|
247
|
-
;for(yield Promise.resolve().then(
|
|
402
|
+
;for(yield Promise.resolve().then(B);;){
|
|
248
403
|
if(yield 0,t.isEmpty){this._inProcess=!1;break}
|
|
249
404
|
let e=t.getMin()
|
|
250
405
|
;if(e.readyToRun)t.deleteMin();else{let n
|
|
@@ -254,13 +409,13 @@ e=n.item,t.delete(n)}
|
|
|
254
409
|
if(e.abortSignal&&e.abortSignal.aborted)e.reject(e.abortSignal.reason);else try{
|
|
255
410
|
let t=e.func&&e.func(e.abortSignal)
|
|
256
411
|
;t&&"function"==typeof t.then&&(t=yield t),e.resolve(t)
|
|
257
|
-
}catch(t){e.reject(t)}}})}}const
|
|
258
|
-
const t=new
|
|
259
|
-
return t.run(void 0,e,n)}}();class
|
|
412
|
+
}catch(t){e.reject(t)}}})}}const H=function(){
|
|
413
|
+
const t=new K;return function(e,n){
|
|
414
|
+
return t.run(void 0,e,n)}}();class X{
|
|
260
415
|
constructor(t){
|
|
261
|
-
if(this._maxSize=0,this._size=0,this._tickPromise=new
|
|
416
|
+
if(this._maxSize=0,this._size=0,this._tickPromise=new k,!t)throw new Error("maxSize should be > 0")
|
|
262
417
|
;this._maxSize=t,
|
|
263
|
-
this._size=t,this._priorityQueue=new
|
|
418
|
+
this._size=t,this._priorityQueue=new K}
|
|
264
419
|
get maxSize(){return this._maxSize}get size(){
|
|
265
420
|
return this._size}get holdAvailable(){
|
|
266
421
|
return this._size}hold(t){const e=this._size
|
|
@@ -273,94 +428,122 @@ if(!e)throw new Error(`count (${t} > maxReleaseCount (${r}))`)
|
|
|
273
428
|
const t=this._tickPromise
|
|
274
429
|
;this._tickPromise=null,t.resolve()}return t}
|
|
275
430
|
tick(t){
|
|
276
|
-
if(!(this._size>=this._maxSize))return this._tickPromise||(this._tickPromise=new
|
|
431
|
+
if(!(this._size>=this._maxSize))return this._tickPromise||(this._tickPromise=new k),
|
|
277
432
|
function(t,e){return t?new Promise(function(n){
|
|
278
|
-
if(t&&t.aborted)return void
|
|
279
|
-
;function
|
|
433
|
+
if(t&&t.aborted)return void p(n,t.reason);let r,s
|
|
434
|
+
;function i(t){s||(s=!0,r&&r(),p(n,t))}
|
|
280
435
|
e.then(function(t){r&&r(),n(t)
|
|
281
|
-
}).catch(
|
|
282
|
-
}(t,this._tickPromise.promise)}holdWait(t,e,r
|
|
436
|
+
}).catch(i),t&&(r=t.subscribe(i))}):e
|
|
437
|
+
}(t,this._tickPromise.promise)}holdWait(t,e,n,r){
|
|
283
438
|
if(t>this.maxSize)throw new Error(`holdCount (${t} > maxSize (${this.maxSize}))`)
|
|
284
|
-
;return
|
|
285
|
-
this._priorityQueue.run(
|
|
286
|
-
for(;t>this._size;)yield this.tick(
|
|
439
|
+
;return r||(r=H),
|
|
440
|
+
this._priorityQueue.run(n=>c(this,void 0,void 0,function*(){
|
|
441
|
+
for(;t>this._size;)yield this.tick(n),yield r(e,n)
|
|
287
442
|
;if(!this.hold(t))throw new Error("Unexpected behavior")
|
|
288
|
-
}),e,
|
|
443
|
+
}),e,n)}}function Y(t){
|
|
289
444
|
if(null==t||t<=0)throw new Error("Iterations = ".concat(t))
|
|
290
445
|
;t--;var e=new Promise(function(e){
|
|
291
446
|
setTimeout(function(){e(t)},1)})
|
|
292
|
-
;return t<=0?e:e.then(
|
|
293
|
-
var
|
|
294
|
-
;return void 0===
|
|
295
|
-
function
|
|
296
|
-
return
|
|
297
|
-
var
|
|
298
|
-
switch(
|
|
299
|
-
var
|
|
300
|
-
switch(d.label){case 0:return
|
|
301
|
-
seed:null==
|
|
302
|
-
}),
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
;case 2:
|
|
306
|
-
if(null==
|
|
307
|
-
;if(
|
|
308
|
-
return d.trys.push([3,6,,
|
|
309
|
-
;case 4:
|
|
310
|
-
return
|
|
311
|
-
|
|
312
|
-
;case 6:
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
return
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
;
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
return
|
|
329
|
-
|
|
330
|
-
;
|
|
331
|
-
;
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
;
|
|
335
|
-
return
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
;
|
|
339
|
-
[4,
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
return
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
j
|
|
349
|
-
|
|
350
|
-
|
|
447
|
+
;return t<=0?e:e.then(Y)}function Z(t,e,n){
|
|
448
|
+
var r,s,d,v,_,y,b,p,m
|
|
449
|
+
;return void 0===n&&(n={}),c(this,void 0,void 0,function(){
|
|
450
|
+
function w(){
|
|
451
|
+
return c(this,void 0,void 0,function(){
|
|
452
|
+
var n,r=this;return l(this,function(s){
|
|
453
|
+
switch(s.label){case 0:n=function(){
|
|
454
|
+
var e,n,s,i,a,u,h;return l(this,function(d){
|
|
455
|
+
switch(d.label){case 0:return e=q,n=o(o({},B),{
|
|
456
|
+
seed:null==U?void 0:U.value
|
|
457
|
+
}),s=(R||C)&&Date.now(),R&&s-nt>=R&&(console.log(tt),
|
|
458
|
+
nt=s),I&&tt-st>=I||D&&et-it>=D||C&&s-rt>=C?(st=tt,
|
|
459
|
+
it=et,rt=s,[4,Y(1)]):[3,2];case 1:
|
|
460
|
+
d.sent(),d.label=2;case 2:
|
|
461
|
+
if(null==N?void 0:N.aborted)return[2,"continue"]
|
|
462
|
+
;if(ot&&!K.aborted)return[3,10];d.label=3;case 3:
|
|
463
|
+
return d.trys.push([3,6,,9]),g(i=t(n,e,K))?[4,i]:[3,5]
|
|
464
|
+
;case 4:i=d.sent(),d.label=5;case 5:
|
|
465
|
+
return i?(a=i.iterationsAsync,u=i.iterationsSync,
|
|
466
|
+
et+=a,tt+=u+a,[3,9]):(Z=!0,Q.abort(),
|
|
467
|
+
[2,"continue"]);case 6:
|
|
468
|
+
return h=d.sent(),E?[4,f(n,E,j.argsToJson)]:[3,8]
|
|
469
|
+
;case 7:d.sent(),d.label=8;case 8:if(!V)throw h
|
|
470
|
+
;return W={error:h,args:n,index:e},Z=!1,[3,9]
|
|
471
|
+
;case 9:return[3,13];case 10:
|
|
472
|
+
return ot.hold(1)?[3,12]:[4,ot.holdWait(1)]
|
|
473
|
+
;case 11:d.sent(),d.label=12;case 12:
|
|
474
|
+
c(r,void 0,void 0,function(){var r,s,i,o
|
|
475
|
+
;return l(this,function(c){switch(c.label){case 0:
|
|
476
|
+
return c.trys.push([0,3,6,7]),
|
|
477
|
+
(null==K?void 0:K.aborted)?[2]:g(r=t(n,e,K))?[4,r]:[3,2]
|
|
478
|
+
;case 1:r=c.sent(),c.label=2;case 2:
|
|
479
|
+
return r?(s=r.iterationsAsync,i=r.iterationsSync,
|
|
480
|
+
et+=s,tt+=i+s,[3,7]):(Z=!0,Q.abort(),[2]);case 3:
|
|
481
|
+
return o=c.sent(),E?[4,f(n,E,j.argsToJson)]:[3,5]
|
|
482
|
+
;case 4:c.sent(),c.label=5;case 5:if(!V)throw o
|
|
483
|
+
;return W={error:o,args:n,index:e},Z=!1,[3,7]
|
|
484
|
+
;case 6:return ot.release(1),[7];case 7:return[2]}
|
|
485
|
+
})}),d.label=13;case 13:return[2]}})},s.label=1
|
|
486
|
+
;case 1:
|
|
487
|
+
return(null==N?void 0:N.aborted)||!Z&&!function(){
|
|
488
|
+
for(;;){if(q++,U&&U.done)return!1
|
|
489
|
+
;if(null==W||q<W.index){var t=L.next()
|
|
490
|
+
;if(!t.done)return B=t.value,!0}if(!G)return!1
|
|
491
|
+
;if((U=G.next()).done)return!1
|
|
492
|
+
;q=-1,L=e[Symbol.iterator]()}}()?[3,3]:[5,n()]
|
|
493
|
+
;case 2:return s.sent(),[3,1];case 3:
|
|
494
|
+
return ot?[4,ot.holdWait($)]:[3,5];case 4:
|
|
495
|
+
s.sent(),ot.release($),s.label=5;case 5:
|
|
496
|
+
if(null==H?void 0:H.aborted)throw H.reason
|
|
497
|
+
;return J&&console.log("[test-variants] variants: ".concat(q,", iterations: ").concat(tt,", async: ").concat(et)),
|
|
498
|
+
[4,Y(1)];case 6:return s.sent(),[2,tt]}})})}
|
|
499
|
+
var j,S,x,E,A,P,k,T,z,O,F,I,D,C,R,J,N,V,$,G,U,W,q,B,L,Q,K,H,Z,tt,et,nt,rt,st,it,ot,ct,lt
|
|
500
|
+
;return l(this,function(o){switch(o.label){case 0:
|
|
501
|
+
return j=n.saveErrorVariants,S=null!==(r=null==j?void 0:j.retriesPerVariant)&&void 0!==r?r:1,
|
|
502
|
+
x=new Date,
|
|
503
|
+
E=j?i.resolve(j.dir,null!==(d=null===(s=j.getFilePath)||void 0===s?void 0:s.call(j,{
|
|
504
|
+
sessionDate:x}))&&void 0!==d?d:h({sessionDate:x
|
|
505
|
+
})):null,j?[4,a(j.dir)]:[3,12];case 1:
|
|
506
|
+
A=o.sent(),o.label=2;case 2:
|
|
507
|
+
o.trys.push([2,10,11,12]),P=function(t){
|
|
508
|
+
var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0
|
|
509
|
+
;if(n)return n.call(t)
|
|
510
|
+
;if(t&&"number"==typeof t.length)return{
|
|
511
|
+
next:function(){
|
|
512
|
+
return t&&r>=t.length&&(t=void 0),{
|
|
513
|
+
value:t&&t[r++],done:!t}}}
|
|
514
|
+
;throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")
|
|
515
|
+
}(A),k=P.next(),o.label=3;case 3:
|
|
516
|
+
return k.done?[3,9]:[4,u(k.value,j.jsonToArgs)]
|
|
517
|
+
;case 4:T=o.sent(),z=0,o.label=5;case 5:
|
|
518
|
+
return z<S?g(O=t(T,-1,null))?[4,O]:[3,7]:[3,8]
|
|
519
|
+
;case 6:o.sent(),o.label=7;case 7:return z++,[3,5]
|
|
520
|
+
;case 8:return k=P.next(),[3,3];case 9:
|
|
521
|
+
return[3,12];case 10:return F=o.sent(),ct={error:F
|
|
522
|
+
},[3,12];case 11:try{
|
|
523
|
+
k&&!k.done&&(lt=P.return)&<.call(P)}finally{
|
|
524
|
+
if(ct)throw ct.error}return[7];case 12:
|
|
525
|
+
return I=null!==(v=n.GC_Iterations)&&void 0!==v?v:1e6,
|
|
526
|
+
D=null!==(_=n.GC_IterationsAsync)&&void 0!==_?_:1e4,
|
|
527
|
+
C=null!==(y=n.GC_Interval)&&void 0!==y?y:1e3,
|
|
528
|
+
R=null!==(b=n.logInterval)&&void 0!==b?b:5e3,
|
|
529
|
+
J=null===(p=n.logCompleted)||void 0===p||p,
|
|
530
|
+
N=n.abortSignal,V=n.findBestError,$=!0===n.parallel?Math.pow(2,31):!n.parallel||n.parallel<=0?1:n.parallel,
|
|
531
|
+
G=null!==(m=null==V?void 0:V.seeds[Symbol.iterator]())&&void 0!==m?m:null,
|
|
532
|
+
U=null==G?void 0:G.next(),
|
|
533
|
+
W=null,q=-1,B={},L=e[Symbol.iterator](),Q=new M,K=function(...t){
|
|
351
534
|
let e,n;function r(t){e.abort(t)}
|
|
352
|
-
for(let
|
|
353
|
-
if(
|
|
354
|
-
;n?(e||(e=new
|
|
355
|
-
}}return e?e.signal:n||(new
|
|
356
|
-
}(
|
|
357
|
-
|
|
358
|
-
return[2,{iterations:
|
|
359
|
-
t.createTestVariants=function(t){
|
|
360
|
-
return function(e){return function(
|
|
361
|
-
return
|
|
362
|
-
;return
|
|
363
|
-
onError:null==
|
|
364
|
-
argsTemplates:e}),[2,
|
|
365
|
-
},Object.defineProperty(t,"__esModule",{
|
|
366
|
-
}({});
|
|
535
|
+
for(let s=0;s<t.length;s++){const i=t[s];if(i){
|
|
536
|
+
if(i.aborted)return i
|
|
537
|
+
;n?(e||(e=new M,n.subscribe(r)),i.subscribe(r)):n=i
|
|
538
|
+
}}return e?e.signal:n||(new M).signal
|
|
539
|
+
}(N,Q.signal),H=K,Z=!1,tt=0,et=0,nt=Date.now(),
|
|
540
|
+
rt=nt,st=tt,it=et,ot=$<=1?null:new X($),[4,w()]
|
|
541
|
+
;case 13:return[2,{iterations:o.sent(),bestError:W
|
|
542
|
+
}]}})})}t.createTestVariants=function(t){
|
|
543
|
+
return function(e){return function(n){
|
|
544
|
+
return c(this,void 0,void 0,function(){var r,s
|
|
545
|
+
;return l(this,function(i){return r=F(t,{
|
|
546
|
+
onError:null==n?void 0:n.onError}),s=d({
|
|
547
|
+
argsTemplates:e}),[2,Z(r,s,n)]})})}}
|
|
548
|
+
},t.generateErrorVariantFilePath=h,Object.defineProperty(t,"__esModule",{
|
|
549
|
+
value:!0})}({},fs,path);
|