@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.
@@ -1,250 +1,405 @@
1
- !function(t){"use strict";var e=function(){
2
- return e=Object.assign||function(t){
3
- for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])
4
- ;return t},e.apply(this,arguments)}
5
- ;function n(t,e,n,r){
6
- return new(n||(n=Promise))(function(i,s){
7
- function o(t){try{c(r.next(t))}catch(t){s(t)}}
8
- function l(t){try{c(r.throw(t))}catch(t){s(t)}}
9
- function c(t){var e
10
- ;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){
11
- t(e)})).then(o,l)}c((r=r.apply(t,e||[])).next())})
12
- }function r(t,e){var n,r,i,s,o={label:0,
13
- sent:function(){if(1&i[0])throw i[1];return i[1]},
14
- trys:[],ops:[]};return s={next:l(0),throw:l(1),
15
- return:l(2)
16
- },"function"==typeof Symbol&&(s[Symbol.iterator]=function(){
17
- return this}),s;function l(l){return function(c){
18
- return function(l){
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(;s&&(s=0,l[0]&&(o=0)),o;)try{
21
- if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),
22
- 0):r.next)&&!(i=i.call(r,l[1])).done)return i
23
- ;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:
24
- case 1:i=l;break;case 4:return o.label++,{
25
- value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0]
26
- ;continue;case 7:l=o.ops.pop(),o.trys.pop()
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(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){
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===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){
31
- o.label=l[1];break}if(6===l[0]&&o.label<i[1]){
32
- o.label=i[1],i=l;break}if(i&&o.label<i[2]){
33
- o.label=i[2],o.ops.push(l);break}
34
- i[2]&&o.ops.pop(),o.trys.pop();continue}
35
- l=e.call(t,o)}catch(t){l=[6,t],r=0}finally{n=i=0}
36
- if(5&l[0])throw l[1];return{
37
- value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}
38
- function i(t){var n,r=t.argsTemplates
39
- ;return(n={})[Symbol.iterator]=function(){
40
- var t=Object.keys(r),n=Object.values(r),i=t.length,s={}
41
- ;function o(t){var e=n[t]
42
- ;return"function"==typeof e&&(e=e(s)),e}
43
- for(var l=[],c=[],u=0;u<i;u++)l[u]=-1,c[u]=[]
44
- ;return c[0]=o(0),{next:function(){
45
- return function(){for(var e=i-1;e>=0;e--){
46
- var n=l[e]+1;if(n<c[e].length){
47
- var r=t[e],u=c[e][n]
48
- ;for(l[e]=n,s[r]=u,e++;e<i;e++){var a=o(e)
49
- ;if(0===a.length)break;l[e]=0,c[e]=a
50
- ;var h=t[e],f=a[0];s[h]=f}if(e>=i)return!0}}
51
- return!1}()?{done:!1,value:e({},s)}:{done:!0,
52
- value:null}}}},n}function s(t,e){return t<e}
53
- class o{
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=l,
56
- this.collapse=c,this._objectPool=t,this._lessThanFunc=e||s
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=l(this._root,e,this._lessThanFunc),e
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=c(t.child,this._lessThanFunc);else{
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=l(this._root,c(t.child,this._lessThanFunc),this._lessThanFunc)
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=l(this._root,t,this._lessThanFunc))}
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=c(r.child,e),
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 l(t,e,n){let r,i
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
- i=t):(r=t,i=e),i.next=r.child,
91
- null!=r.child&&(r.child.prev=i),i.prev=r,r.child=i,
92
- r.next=null,r.prev=null,r)}function c(t,e){
93
- let n,r,i,s,o;if(null==t)return null
94
- ;for(s=t,n=null;null!=s;){
95
- if(r=s,i=r.next,null==i){r.prev=n,n=r;break}
96
- s=i.next,o=l(r,i,e),o.prev=n,n=o}
97
- for(o=null;null!=n;)s=n.prev,o=l(o,n,e),n=s
98
- ;return o}function u(t,e){t(function(t){return{
99
- then(e,n){n(t)}}}(e))}function a(t){
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 h,f=[];function d(t){
102
- f.push(t),h||(h=function(){
103
- return n(this,void 0,void 0,function*(){
104
- for(;f.length>0;){yield 0;const t=f
105
- ;f=[],t.forEach(t=>{try{t()}catch(t){
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
- h=null})}())}function v(t,e,n){d(()=>{try{
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 _(t,e,n){d(()=>{if(e)try{
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 b=function(){};class y{
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,i=this._rejectAsync,s=this
115
- ;this._resolve=function(t){e.call(s,t)
116
- },this._reject=function(t){n.call(s,t)
117
- },this._resolveAsync=function(t){r.call(s,t)
118
- },this._rejectAsync=function(t){i.call(s,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
- a(t)?t.then(this._resolveAsync,this._rejectAsync):this._resolveSync(t)
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,,i]=e[n]
126
- ;v(t,r,i)}}}_reject(t){
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",a(t)?t.then(this._rejectAsync,this._rejectAsync):this._rejectSync(t)
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,i]=e[n]
133
- ;_(t,r,i)}}}then(t,e){const n=new y(b)
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?v(this.value,t,n):_(this.reason,e,n),
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 a(n)?n.then(()=>e):y.resolve(e)
176
+ ;return g(n)?n.then(()=>e):A.resolve(e)
139
177
  },n=t&&function(e){const n=t()
140
- ;return a(n)?n.then(()=>y.reject(e)):y.reject(e)}
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 y(b);return e._resolve(t),e}
143
- static reject(t){const e=new y(b)
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 y}static all(t){return function(t,e){
147
- let n,r;e||(e=Promise);const i=new e((t,e)=>{
148
- n=t,r=e});let s=t.length;const o=[]
149
- ;return t.forEach((t,e)=>{a(t)?t.then(t=>{
150
- o[e]=t,0===--s&&n(o)},r):(o[e]=t,0===--s&&n(o))
151
- }),i}(t,y)}static allSettled(t){
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 i=t.length
154
- ;const s=[];return t.forEach((t,e)=>{
155
- a(t)?t.then(t=>{s[e]={status:"fulfilled",value:t
156
- },0===--i&&n(s)},t=>{s[e]={status:"rejected",
157
- reason:t},0===--i&&n(s)}):(s[e]={
158
- status:"fulfilled",value:t},0===--i&&n(s))}),r
159
- }(t,y)}static any(t){return function(t,e){let n,r
160
- ;e||(e=Promise);const i=new e((t,e)=>{n=t,r=e})
161
- ;let s=t.length;const o=[]
162
- ;return t.forEach((t,e)=>{a(t)?t.then(n,t=>{
163
- o[e]=t,0===--s&&r(new AggregateError(o))}):n(t)
164
- }),i}(t,y)}static race(t){return function(t,e){
165
- let n,r;e||(e=Promise);const i=new e((t,e)=>{
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
- a(t)?t.then(n,r):n(t)}),i}(t,y)}}
168
- const p=function(){};class w{constructor(t){
169
- if(this._status="pending",t&&t.aborted)this.promise=y.reject(t.reason),
170
- this.resolve=p,this.reject=p;else{let e,n
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){u(t,e)}}),t){
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 m extends Error{
217
+ return this._status}}class T extends Error{
180
218
  constructor(t,e){
181
- super(t),Object.setPrototypeOf(this,m.prototype),this.reason=e,
219
+ super(t),Object.setPrototypeOf(this,T.prototype),this.reason=e,
182
220
  this.name="AbortError",this._internal=!1}}
183
- const g=()=>{};class j{constructor(){
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
- g):(this._callbacks||(this._callbacks=new Set),
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 x{constructor(){this.signal=new j}
233
+ }}class M{constructor(){this.signal=new O}
196
234
  abort(t){
197
- this.signal.aborted||(void 0===t&&((t=new m("Aborted with no reason",t))._internal=!0),
198
- this.signal.abort(t))}}function S(t,e){
199
- var i=0,s=null;function o(t,o,l){
200
- return n(this,void 0,void 0,function(){var n
201
- ;return r(this,function(r){switch(r.label){case 0:
202
- return s={error:t,args:o,index:l
203
- },console.error("[test-variants] error variant: ".concat(l,"\n").concat(function(t){
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
- }(o))),console.error(t),n=Date.now(),Date.now()-n>50&&i<5?(console.log("[test-variants] DEBUG ITERATION: "+i),
208
- i++,[2]):e.onError?[4,e.onError(s)]:[3,2];case 1:
209
- r.sent(),r.label=2;case 2:throw s.error}})})}
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(a(i))return i.then(function(t){
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 o(t,e,n)});return"number"==typeof i?{
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 o(t,e,n)}}}class P{constructor(t,e){
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
- const z=function(t){return t};function A(t,e){
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,i=n?n.length:0,s=r?r.length:0,o=i>s?i:s
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>=i?0:n[i-1-t],o=t>=s?0:r[s-1-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 k=1;class E{
232
- constructor(){this._queue=new o({lessThanFunc:A})}
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 i=new w(r),s={
236
- priority:(o=k++,l=n,null==o?null==l?null:l:new P(o,l)),
237
- func:e,abortSignal:r,resolve:i.resolve,
238
- reject:i.reject,readyToRun:!t};var o,l
239
- ;if(this._queue.add(s),t){const t=this;return{
240
- result:i.promise,setReadyToRun(e){
241
- s.readyToRun=e,e&&!t._inProcess&&(t._inProcess=!0,
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()),i.promise
398
+ return this._inProcess||(this._inProcess=!0,this._process()),s.promise
244
399
  }_process(){
245
- return n(this,void 0,void 0,function*(){
400
+ return c(this,void 0,void 0,function*(){
246
401
  const t=this._queue
247
- ;for(yield Promise.resolve().then(z);;){
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 T=function(){
258
- const t=new E;return function(e,n){
259
- return t.run(void 0,e,n)}}();class O{
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 w,!t)throw new Error("maxSize should be > 0")
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 E}
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 w),
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 u(n,t.reason);let r,i
279
- ;function s(t){i||(i=!0,r&&r(),u(n,t))}
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(s),t&&(r=t.subscribe(s))}):e
282
- }(t,this._tickPromise.promise)}holdWait(t,e,r,i){
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 i||(i=T),
285
- this._priorityQueue.run(r=>n(this,void 0,void 0,function*(){
286
- for(;t>this._size;)yield this.tick(r),yield i(e,r)
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,r)}}function F(t){
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(F)}function I(t,i,s){
293
- var o,l,c,u,h,f
294
- ;return void 0===s&&(s={}),n(this,void 0,void 0,function(){
295
- function d(){
296
- return n(this,void 0,void 0,function(){
297
- var s,o=this;return r(this,function(l){
298
- switch(l.label){case 0:s=function(){
299
- var i,s,l,c,u,h,f;return r(this,function(d){
300
- switch(d.label){case 0:return i=z,s=e(e({},A),{
301
- seed:null==S?void 0:S.value
302
- }),l=(y||b)&&Date.now(),y&&l-D>=y&&(console.log(M),D=l),
303
- v&&M-$>=v||_&&C-q>=_||b&&l-G>=b?($=M,
304
- q=C,G=l,[4,F(1)]):[3,2];case 1:d.sent(),d.label=2
305
- ;case 2:
306
- if(null==w?void 0:w.aborted)return[2,"continue"]
307
- ;if(N&&!T.aborted)return[3,8];d.label=3;case 3:
308
- return d.trys.push([3,6,,7]),a(c=t(s,i,T))?[4,c]:[3,5]
309
- ;case 4:c=d.sent(),d.label=5;case 5:
310
- return c?(u=c.iterationsAsync,h=c.iterationsSync,
311
- C+=u,M+=h+u,[3,7]):(R=!0,E.abort(),[2,"continue"])
312
- ;case 6:if(f=d.sent(),!m)throw f;return P={
313
- error:f,args:s,index:i},R=!1,[3,7];case 7:
314
- return[3,11];case 8:
315
- return N.hold(1)?[3,10]:[4,N.holdWait(1)];case 9:
316
- d.sent(),d.label=10;case 10:
317
- n(o,void 0,void 0,function(){var e,n,o,l
318
- ;return r(this,function(r){switch(r.label){case 0:
319
- return r.trys.push([0,3,4,5]),
320
- (null==T?void 0:T.aborted)?[2]:a(e=t(s,i,T))?[4,e]:[3,2]
321
- ;case 1:e=r.sent(),r.label=2;case 2:
322
- return e?(n=e.iterationsAsync,o=e.iterationsSync,
323
- C+=n,M+=o+n,[3,5]):(R=!0,E.abort(),[2]);case 3:
324
- if(l=r.sent(),!m)throw l;return P={error:l,args:s,
325
- index:i},R=!1,[3,5];case 4:return N.release(1),[7]
326
- ;case 5:return[2]}})}),d.label=11;case 11:
327
- return[2]}})},l.label=1;case 1:
328
- return(null==w?void 0:w.aborted)||!R&&!function(){
329
- for(;;){if(z++,S&&S.done)return!1
330
- ;if(null==P||z<P.index){var t=k.next()
331
- ;if(!t.done)return A=t.value,!0}if(!j)return!1
332
- ;if((S=j.next()).done)return!1
333
- ;z=-1,k=i[Symbol.iterator]()}}()?[3,3]:[5,s()]
334
- ;case 2:return l.sent(),[3,1];case 3:
335
- return N?[4,N.holdWait(g)]:[3,5];case 4:
336
- l.sent(),N.release(g),l.label=5;case 5:
337
- if(null==I?void 0:I.aborted)throw I.reason
338
- ;return p&&console.log("[test-variants] variants: ".concat(z,", iterations: ").concat(M,", async: ").concat(C)),
339
- [4,F(1)];case 6:return l.sent(),[2,M]}})})}
340
- var v,_,b,y,p,w,m,g,j,S,P,z,A,k,E,T,I,R,M,C,D,G,$,q,N
341
- ;return r(this,function(t){switch(t.label){case 0:
342
- return v=null!==(o=s.GC_Iterations)&&void 0!==o?o:1e6,
343
- _=null!==(l=s.GC_IterationsAsync)&&void 0!==l?l:1e4,
344
- b=null!==(c=s.GC_Interval)&&void 0!==c?c:1e3,
345
- y=null!==(u=s.logInterval)&&void 0!==u?u:5e3,
346
- p=null===(h=s.logCompleted)||void 0===h||h,
347
- w=s.abortSignal,m=s.findBestError,g=!0===s.parallel?Math.pow(2,31):!s.parallel||s.parallel<=0?1:s.parallel,
348
- j=null!==(f=null==m?void 0:m.seeds[Symbol.iterator]())&&void 0!==f?f:null,
349
- S=null==j?void 0:j.next(),
350
- P=null,z=-1,A={},k=i[Symbol.iterator](),E=new x,T=function(...t){
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)&&lt.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 i=0;i<t.length;i++){const s=t[i];if(s){
353
- if(s.aborted)return s
354
- ;n?(e||(e=new x,n.subscribe(r)),s.subscribe(r)):n=s
355
- }}return e?e.signal:n||(new x).signal
356
- }(w,E.signal),I=T,R=!1,M=0,C=0,D=Date.now(),
357
- G=D,$=M,q=C,N=g<=1?null:new O(g),[4,d()];case 1:
358
- return[2,{iterations:t.sent(),bestError:P}]}})})}
359
- t.createTestVariants=function(t){
360
- return function(e){return function(s){
361
- return n(this,void 0,void 0,function(){var n,o
362
- ;return r(this,function(r){return n=S(t,{
363
- onError:null==s?void 0:s.onError}),o=i({
364
- argsTemplates:e}),[2,I(n,o,s)]})})}}
365
- },Object.defineProperty(t,"__esModule",{value:!0})
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);