@flemist/test-variants 1.0.7 → 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.
Files changed (34) hide show
  1. package/dist/bundle/browser.js +437 -212
  2. package/dist/lib/index.cjs +10 -2
  3. package/dist/lib/index.d.ts +6 -2
  4. package/dist/lib/index.mjs +9 -2
  5. package/dist/lib/test-variants/argsToString.cjs +17 -0
  6. package/dist/lib/test-variants/argsToString.d.ts +2 -0
  7. package/dist/lib/test-variants/argsToString.mjs +13 -0
  8. package/dist/lib/test-variants/createTestVariants.cjs +71 -188
  9. package/dist/lib/test-variants/createTestVariants.d.ts +8 -30
  10. package/dist/lib/test-variants/createTestVariants.mjs +71 -188
  11. package/dist/lib/test-variants/createTestVariants.perf.cjs +32 -20
  12. package/dist/lib/test-variants/createTestVariants.perf.mjs +32 -20
  13. package/dist/lib/test-variants/prime.cjs +65 -0
  14. package/dist/lib/test-variants/prime.d.ts +3 -0
  15. package/dist/lib/test-variants/prime.mjs +59 -0
  16. package/dist/lib/test-variants/prime.perf.cjs +30 -0
  17. package/dist/lib/test-variants/prime.perf.d.ts +1 -0
  18. package/dist/lib/test-variants/prime.perf.mjs +28 -0
  19. package/dist/lib/test-variants/saveErrorVariants.cjs +97 -0
  20. package/dist/lib/test-variants/saveErrorVariants.d.ts +9 -0
  21. package/dist/lib/test-variants/saveErrorVariants.mjs +69 -0
  22. package/dist/lib/test-variants/testVariantsCreateTestRun.cjs +80 -0
  23. package/dist/lib/test-variants/testVariantsCreateTestRun.d.ts +22 -0
  24. package/dist/lib/test-variants/testVariantsCreateTestRun.mjs +76 -0
  25. package/dist/lib/test-variants/testVariantsIterable.cjs +67 -0
  26. package/dist/lib/test-variants/testVariantsIterable.d.ts +12 -0
  27. package/dist/lib/test-variants/testVariantsIterable.mjs +63 -0
  28. package/dist/lib/test-variants/testVariantsRun.cjs +235 -0
  29. package/dist/lib/test-variants/testVariantsRun.d.ts +33 -0
  30. package/dist/lib/test-variants/testVariantsRun.mjs +211 -0
  31. package/dist/lib/test-variants/types.cjs +2 -0
  32. package/dist/lib/test-variants/types.d.ts +18 -0
  33. package/dist/lib/test-variants/types.mjs +1 -0
  34. package/package.json +12 -9
@@ -1,126 +1,154 @@
1
- !function(t){"use strict";var e=function(){
2
- return e=Object.assign||function(t){
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){
3
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])
4
- ;return t},e.apply(this,arguments)}
5
- ;function n(t,e,n,r){
6
- return new(n||(n=Promise))((function(s,i){
7
- function o(t){try{c(r.next(t))}catch(t){i(t)}}
8
- function l(t){try{c(r.throw(t))}catch(t){i(t)}}
9
- function c(t){var e
10
- ;t.done?s(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,s,i,o={label:0,
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,
13
22
  sent:function(){if(1&s[0])throw s[1];return s[1]},
14
- trys:[],ops:[]};return i={next:l(0),throw:l(1),
15
- return:l(2)
23
+ trys:[],ops:[]};return i={next:c(0),throw:c(1),
24
+ return:c(2)
16
25
  },"function"==typeof Symbol&&(i[Symbol.iterator]=function(){
17
- return this}),i;function l(i){return function(l){
18
- return function(i){
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(;o;)try{
21
- if(n=1,r&&(s=2&i[0]?r.return:i[0]?r.throw||((s=r.return)&&s.call(r),
22
- 0):r.next)&&!(s=s.call(r,i[1])).done)return s
23
- ;switch(r=0,s&&(i=[2&i[0],s.value]),i[0]){case 0:
24
- case 1:s=i;break;case 4:return o.label++,{
25
- value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0]
26
- ;continue;case 7:i=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(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[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===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){
31
- o.label=i[1];break}if(6===i[0]&&o.label<s[1]){
32
- o.label=s[1],s=i;break}if(s&&o.label<s[2]){
33
- o.label=s[2],o.ops.push(i);break}
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}
34
43
  s[2]&&o.ops.pop(),o.trys.pop();continue}
35
- i=e.call(t,o)}catch(t){i=[6,t],r=0}finally{n=s=0}
36
- if(5&i[0])throw i[1];return{
37
- value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}
38
- function s(t){
39
- if(null==t||t<=0)throw new Error("Iterations = ".concat(t))
40
- ;t--;var e=new Promise((function(e){
41
- setTimeout((function(){e(t)}),1)}))
42
- ;return t<=0?e:e.then(s)}class i extends Error{
43
- constructor(t,e){
44
- super(t),Object.setPrototypeOf(this,i.prototype),this.reason=e,
45
- this.name="AbortError",this._internal=!1}}
46
- const o=()=>{};class l{constructor(){
47
- this.aborted=!1,this.reason=void 0,this._callbacks=void 0
48
- }subscribe(t){var e
49
- ;if(null===(e=this._callbacks)||void 0===e?void 0:e.has(t))throw new Error("Already subscribed: "+t)
50
- ;return this.aborted?(t.call(this,this.reason),
51
- o):(this._callbacks||(this._callbacks=new Set),
52
- this._callbacks.add(t),()=>{var e
53
- ;null===(e=this._callbacks)||void 0===e||e.delete(t)
54
- })}abort(t){var e
55
- ;this.aborted=!0,this.reason=t,null===(e=this._callbacks)||void 0===e||e.forEach((t=>{
56
- t.call(this,this.reason)})),this._callbacks=void 0
57
- }throwIfAborted(){
58
- if(this.aborted)throw this.reason}}class c{
59
- constructor(){this.signal=new l}abort(t){
60
- this.signal.aborted||(void 0===t&&((t=new i("Aborted with no reason",t))._internal=!0),
61
- this.signal.abort(t))}}function u(t,e){return t<e}
62
- class a{
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 _{
63
92
  constructor({objectPool:t,lessThanFunc:e}={}){
64
- this._size=0,this._root=null,this.merge=h,
65
- this.collapse=f,this._objectPool=t,this._lessThanFunc=e||u
93
+ this._size=0,this._root=null,this.merge=y,
94
+ this.collapse=b,this._objectPool=t,this._lessThanFunc=e||v
66
95
  }clear(){this._root=null,this._size=0}get size(){
67
96
  return this._size}add(t){
68
97
  let e=null!=this._objectPool?this._objectPool.get():null
69
98
  ;return null==e?e={child:null,next:null,prev:null,
70
99
  item:t
71
- }:e.item=t,this._size++,this._root=h(this._root,e,this._lessThanFunc),e
100
+ }:e.item=t,this._size++,this._root=y(this._root,e,this._lessThanFunc),e
72
101
  }getMin(){const{_root:t}=this
73
102
  ;return null==t?void 0:t.item}getMinNode(){
74
103
  return this._root}deleteMin(){const{_root:t}=this
75
104
  ;if(null==t)return;const e=t.item
76
105
  ;return this.delete(t),e}delete(t){var e
77
- ;if(t===this._root)this._root=f(t.child,this._lessThanFunc);else{
106
+ ;if(t===this._root)this._root=b(t.child,this._lessThanFunc);else{
78
107
  if(null==t.prev){
79
108
  if(this._objectPool)throw new Error("The node is already deleted. Don't use the objectPool to prevent this error.")
80
109
  ;return}
81
110
  t.prev.child===t?t.prev.child=t.next:t.prev.next=t.next,null!=t.next&&(t.next.prev=t.prev),
82
- this._root=h(this._root,f(t.child,this._lessThanFunc),this._lessThanFunc)
111
+ this._root=y(this._root,b(t.child,this._lessThanFunc),this._lessThanFunc)
83
112
  }
84
113
  t.child=null,t.prev=null,t.next=null,t.item=void 0,null===(e=this._objectPool)||void 0===e||e.release(t),
85
114
  this._size--}decreaseKey(t){
86
115
  t!==this._root&&(t.prev.child===t?t.prev.child=t.next:t.prev.next=t.next,
87
116
  null!=t.next&&(t.next.prev=t.prev),
88
- this._root=h(this._root,t,this._lessThanFunc))}
117
+ this._root=y(this._root,t,this._lessThanFunc))}
89
118
  get isEmpty(){return null==this._root}
90
119
  [Symbol.iterator](){return this._iterate(!1)}
91
120
  nodes(){return{
92
121
  [Symbol.iterator]:()=>this._iterate(!0)}}
93
122
  _iterate(t){const e=this._lessThanFunc
94
123
  ;return function*n(r){
95
- r&&(t?yield r:yield r.item,r.child&&(null!=r.child.next&&(r.child=f(r.child,e),
124
+ r&&(t?yield r:yield r.item,r.child&&(null!=r.child.next&&(r.child=b(r.child,e),
96
125
  r.child.prev=r),yield*n(r.child)))}(this._root)}}
97
- function h(t,e,n){let r,s
126
+ function y(t,e,n){let r,s
98
127
  ;return null==t?e:null==e||t===e?t:(n(e.item,t.item)?(r=e,
99
128
  s=t):(r=t,s=e),s.next=r.child,
100
129
  null!=r.child&&(r.child.prev=s),s.prev=r,r.child=s,
101
- r.next=null,r.prev=null,r)}function f(t,e){
130
+ r.next=null,r.prev=null,r)}function b(t,e){
102
131
  let n,r,s,i,o;if(null==t)return null
103
132
  ;for(i=t,n=null;null!=i;){
104
133
  if(r=i,s=r.next,null==s){r.prev=n,n=r;break}
105
- i=s.next,o=h(r,s,e),o.prev=n,n=o}
106
- for(o=null;null!=n;)i=n.prev,o=h(o,n,e),n=i
107
- ;return o}function d(t,e){t(function(t){return{
108
- then(e,n){n(t)}}}(e))}function _(t){
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){
109
138
  return null!=t&&"object"==typeof t&&"function"==typeof t.then
110
- }let v,b=[];function p(t){
111
- b.push(t),v||(v=function(){
112
- return n(this,void 0,void 0,(function*(){
113
- for(;b.length>0;){yield 0;const t=b
114
- ;b=[],t.forEach((t=>{try{t()}catch(t){
115
- console.error("Unhandled promise rejection",t)}}))
116
- }v=null}))}())}function y(t,e,n){p((()=>{try{
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){
144
+ console.error("Unhandled promise rejection",t)}})}
145
+ m=null})}())}function S(t,e,n){j(()=>{try{
117
146
  const r=e?e(t):t;n._resolve(r)}catch(t){
118
- n._reject(t)}}))}function w(t,e,n){p((()=>{
119
- if(e)try{const r=e(t);n._resolve(r)}catch(t){
120
- n._reject(t)}else n._reject(t)}))}
121
- const g=function(){};class m{constructor(t){
122
- this.status="pending",this.value=void 0,
123
- this.reason=void 0,this._handlers=null
147
+ n._reject(t)}})}function x(t,e,n){j(()=>{if(e)try{
148
+ const r=e(t);n._resolve(r)}catch(t){n._reject(t)
149
+ }else n._reject(t)})}const E=function(){};class A{
150
+ constructor(t){
151
+ this.status="pending",this.value=void 0,this.reason=void 0,this._handlers=null
124
152
  ;const e=this._resolve,n=this._reject,r=this._resolveAsync,s=this._rejectAsync,i=this
125
153
  ;this._resolve=function(t){e.call(i,t)
126
154
  },this._reject=function(t){n.call(i,t)
@@ -129,91 +157,251 @@ this.reason=void 0,this._handlers=null
129
157
  },t(this._resolve,this._reject)}_resolve(t){
130
158
  "pending"===this.status&&(this.status="fulfilled",
131
159
  this._resolveAsync(t))}_resolveAsync(t){
132
- _(t)?t.then(this._resolveAsync,this._rejectAsync):this._resolveSync(t)
160
+ g(t)?t.then(this._resolveAsync,this._rejectAsync):this._resolveSync(t)
133
161
  }_resolveSync(t){const e=this._handlers
134
162
  ;if(this.value=t,null!=e){this._handlers=null
135
163
  ;for(let n=0,r=e.length;n<r;n++){const[r,,s]=e[n]
136
- ;y(t,r,s)}}}_reject(t){
164
+ ;S(t,r,s)}}}_reject(t){
137
165
  "pending"===this.status&&this._rejectAsync(t)}
138
166
  _rejectAsync(t){
139
- this.status="rejected",_(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)
140
168
  }_rejectSync(t){const e=this._handlers
141
169
  ;if(this.reason=t,null!=e){this._handlers=null
142
170
  ;for(let n=0,r=e.length;n<r;n++){const[,r,s]=e[n]
143
- ;w(t,r,s)}}}then(t,e){const n=new m(g)
171
+ ;x(t,r,s)}}}then(t,e){const n=new A(E)
144
172
  ;return"pending"===this.status?(null==this._handlers&&(this._handlers=[]),
145
- this._handlers.push([t,e,n])):"fulfilled"===this.status?y(this.value,t,n):w(this.reason,e,n),
173
+ this._handlers.push([t,e,n])):"fulfilled"===this.status?S(this.value,t,n):x(this.reason,e,n),
146
174
  n}catch(t){return this.then(void 0,t)}finally(t){
147
175
  const e=t&&function(e){const n=t()
148
- ;return _(n)?n.then((()=>e)):m.resolve(e)
176
+ ;return g(n)?n.then(()=>e):A.resolve(e)
149
177
  },n=t&&function(e){const n=t()
150
- ;return _(n)?n.then((()=>m.reject(e))):m.reject(e)
151
- };return this.then(e,n)}static resolve(t){
152
- const e=new m(g);return e._resolve(t),e}
153
- static reject(t){const e=new m(g)
178
+ ;return g(n)?n.then(()=>A.reject(e)):A.reject(e)}
179
+ ;return this.then(e,n)}static resolve(t){
180
+ const e=new A(E);return e._resolve(t),e}
181
+ static reject(t){const e=new A(E)
154
182
  ;return e._reject(t),e}get[Symbol.toStringTag](){
155
183
  return"Promise"}static get[Symbol.species](){
156
- return m}static all(t){return function(t,e){
157
- let n,r;e||(e=Promise);const s=new e(((t,e)=>{
158
- n=t,r=e}));let i=t.length;const o=[]
159
- ;return t.forEach(((t,e)=>{_(t)?t.then((t=>{
160
- o[e]=t,0==--i&&n(o)}),r):(o[e]=t,0==--i&&n(o))
161
- })),s}(t,m)}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){
162
190
  return function(t,e){let n;e||(e=Promise)
163
- ;const r=new e(((t,e)=>{n=t}));let s=t.length
164
- ;const i=[];return t.forEach(((t,e)=>{
165
- _(t)?t.then((t=>{i[e]={status:"fulfilled",value:t
166
- },0==--s&&n(i)}),(t=>{i[e]={status:"rejected",
167
- reason:t},0==--s&&n(i)})):(i[e]={
168
- status:"fulfilled",value:t},0==--s&&n(i))})),r
169
- }(t,m)}static any(t){return function(t,e){let n,r
170
- ;e||(e=Promise);const s=new e(((t,e)=>{n=t,r=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})
171
199
  ;let i=t.length;const o=[]
172
- ;return t.forEach(((t,e)=>{_(t)?t.then(n,(t=>{
173
- o[e]=t,0==--i&&r(new AggregateError(o))})):n(t)
174
- })),s}(t,m)}static race(t){return function(t,e){
175
- let n,r;e||(e=Promise);const s=new e(((t,e)=>{
176
- n=t,r=e}));return t.forEach((t=>{
177
- _(t)?t.then(n,r):n(t)})),s}(t,m)}}
178
- const j=function(){};class x{constructor(t){
179
- if(this._status="pending",t&&t.aborted)this.promise=m.reject(t.reason),
180
- this.resolve=j,this.reject=j;else{let e,n
181
- ;if(this.promise=new Promise((function(t){
182
- e=t,n=function(e){d(t,e)}})),t){
183
- const r=t.subscribe((function(t){n(t)}))
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)=>{
204
+ n=t,r=e});return t.forEach(t=>{
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
209
+ ;if(this.promise=new Promise(function(t){
210
+ e=t,n=function(e){p(t,e)}}),t){
211
+ const r=t.subscribe(function(t){n(t)})
184
212
  ;this.resolve=function(t){r(),e(t)
185
213
  },this.reject=function(t){r(),n(t)}
186
214
  }else this.resolve=e,this.reject=n}
187
- this.promise.then((()=>{this._status="resolved"
188
- }),(()=>{this._status="rejected"}))}get state(){
189
- return this._status}}class P{constructor(t,e){
215
+ this.promise.then(()=>{this._status="resolved"
216
+ },()=>{this._status="rejected"})}get state(){
217
+ return this._status}}class T extends Error{
218
+ constructor(t,e){
219
+ super(t),Object.setPrototypeOf(this,T.prototype),this.reason=e,
220
+ this.name="AbortError",this._internal=!1}}
221
+ const z=()=>{};class O{constructor(){
222
+ this.aborted=!1,this.reason=void 0,this._callbacks=void 0
223
+ }subscribe(t){var e
224
+ ;if(null===(e=this._callbacks)||void 0===e?void 0:e.has(t))throw new Error("Already subscribed: "+t)
225
+ ;return this.aborted?(t.call(this,this.reason),
226
+ z):(this._callbacks||(this._callbacks=new Set),
227
+ this._callbacks.add(t),()=>{var e
228
+ ;null===(e=this._callbacks)||void 0===e||e.delete(t)
229
+ })}abort(t){var e
230
+ ;this.aborted=!0,this.reason=t,null===(e=this._callbacks)||void 0===e||e.forEach(t=>{
231
+ t.call(this,this.reason)}),this._callbacks=void 0}
232
+ throwIfAborted(){if(this.aborted)throw this.reason
233
+ }}class M{constructor(){this.signal=new O}
234
+ abort(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){
242
+ return JSON.stringify(t,function(t,e){
243
+ return e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor!==Object?e+"":e
244
+ },2)
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}})})}
248
+ return function(e,n,r){try{var i=t(e,r)
249
+ ;if(g(i))return i.then(function(t){
250
+ return"number"==typeof t?{iterationsAsync:t,
251
+ iterationsSync:0}:null!==t&&"object"==typeof t?t:{
252
+ iterationsAsync:1,iterationsSync:0}},function(t){
253
+ return s(t,e,n)});return"number"==typeof i?{
254
+ iterationsAsync:0,iterationsSync:i
255
+ }:null!==i&&"object"==typeof i?i:{
256
+ iterationsAsync:0,iterationsSync:1}}catch(t){
257
+ return s(t,e,n)}}}class I{constructor(t,e){
190
258
  this._branch=null,this.order=t,this.parent=e}
191
259
  get branch(){if(!this._branch){
192
260
  const t=[this.order];let e=this.parent
193
261
  ;for(;null!=e;)t.push(e.order),e=e.parent
194
262
  ;this._branch=t}return this._branch}}
195
- function S(t,e){return function(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){
381
+ return function(t,e){
196
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
197
383
  ;for(let t=0;t<o;t++){
198
384
  const e=t>=s?0:n[s-1-t],o=t>=i?0:r[i-1-t]
199
385
  ;if(e!==o)return e>o?1:-1}return 0
200
- }(t.priority,e.priority)<0}let k=1;class z{
201
- constructor(){this._queue=new a({lessThanFunc:S})}
386
+ }(t.priority,e.priority)<0}let Q=1;class K{
387
+ constructor(){this._queue=new _({lessThanFunc:L})}
202
388
  run(t,e,n){return this._run(!1,t,e,n)}
203
389
  runTask(t,e,n){return this._run(!0,t,e,n)}
204
- _run(t,e,n,r){const s=new x(r),i={
205
- priority:(o=k++,l=n,null==o?null==l?null:l:new P(o,l)),
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)),
206
392
  func:e,abortSignal:r,resolve:s.resolve,
207
- reject:s.reject,readyToRun:!t};var o,l
393
+ reject:s.reject,readyToRun:!t};var o,c
208
394
  ;if(this._queue.add(i),t){const t=this;return{
209
395
  result:s.promise,setReadyToRun(e){
210
396
  i.readyToRun=e,e&&!t._inProcess&&(t._inProcess=!0,
211
397
  t._process())}}}
212
398
  return this._inProcess||(this._inProcess=!0,this._process()),s.promise
213
399
  }_process(){
214
- return n(this,void 0,void 0,(function*(){
215
- const t=this._queue;for(;;){if(yield 0,t.isEmpty){
216
- this._inProcess=!1;break}let e=t.getMin()
400
+ return c(this,void 0,void 0,function*(){
401
+ const t=this._queue
402
+ ;for(yield Promise.resolve().then(B);;){
403
+ if(yield 0,t.isEmpty){this._inProcess=!1;break}
404
+ let e=t.getMin()
217
405
  ;if(e.readyToRun)t.deleteMin();else{let n
218
406
  ;for(const e of t.nodes())if(e.item.readyToRun){
219
407
  n=e;break}if(!n){this._inProcess=!1;break}
@@ -221,13 +409,13 @@ e=n.item,t.delete(n)}
221
409
  if(e.abortSignal&&e.abortSignal.aborted)e.reject(e.abortSignal.reason);else try{
222
410
  let t=e.func&&e.func(e.abortSignal)
223
411
  ;t&&"function"==typeof t.then&&(t=yield t),e.resolve(t)
224
- }catch(t){e.reject(t)}}}))}}const A=function(){
225
- const t=new z;return function(e,n){
226
- return t.run(void 0,e,n)}}();class E{
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{
227
415
  constructor(t){
228
- if(this._maxSize=0,this._size=0,this._tickPromise=new x,!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")
229
417
  ;this._maxSize=t,
230
- this._size=t,this._priorityQueue=new z}
418
+ this._size=t,this._priorityQueue=new K}
231
419
  get maxSize(){return this._maxSize}get size(){
232
420
  return this._size}get holdAvailable(){
233
421
  return this._size}hold(t){const e=this._size
@@ -240,85 +428,122 @@ if(!e)throw new Error(`count (${t} > maxReleaseCount (${r}))`)
240
428
  const t=this._tickPromise
241
429
  ;this._tickPromise=null,t.resolve()}return t}
242
430
  tick(t){
243
- if(!(this._size>=this._maxSize))return this._tickPromise||(this._tickPromise=new x),
244
- function(t,e){return t?new Promise((function(n){
245
- if(t&&t.aborted)return void d(n,t.reason);let r,s
246
- ;function i(t){s||(s=!0,r&&r(),d(n,t))}
247
- e.then((function(t){r&&r(),n(t)
248
- })).catch(i),t&&(r=t.subscribe(i))})):e
249
- }(t,this._tickPromise.promise)}holdWait(t,e,r,s){
431
+ if(!(this._size>=this._maxSize))return this._tickPromise||(this._tickPromise=new k),
432
+ function(t,e){return t?new Promise(function(n){
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))}
435
+ e.then(function(t){r&&r(),n(t)
436
+ }).catch(i),t&&(r=t.subscribe(i))}):e
437
+ }(t,this._tickPromise.promise)}holdWait(t,e,n,r){
250
438
  if(t>this.maxSize)throw new Error(`holdCount (${t} > maxSize (${this.maxSize}))`)
251
- ;return s||(s=A),
252
- this._priorityQueue.run((r=>n(this,void 0,void 0,(function*(){
253
- for(;t>this._size;)yield this.tick(r),yield s(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)
254
442
  ;if(!this.hold(t))throw new Error("Unexpected behavior")
255
- }))),e,r)}}t.createTestVariants=function(t){
256
- return function(i){return function(o){
257
- var l=void 0===o?{}:o,u=l.GC_Iterations,a=void 0===u?1e6:u,h=l.GC_IterationsAsync,f=void 0===h?1e4:h,d=l.GC_Interval,_=void 0===d?1e3:d,v=l.logInterval,b=void 0===v?5e3:v,p=l.logCompleted,y=void 0===p||p,w=l.onError,g=void 0===w?null:w,m=l.abortSignal,j=void 0===m?null:m,x=l.parallel,P=new c,S=function(...t){
443
+ }),e,n)}}function Y(t){
444
+ if(null==t||t<=0)throw new Error("Iterations = ".concat(t))
445
+ ;t--;var e=new Promise(function(e){
446
+ setTimeout(function(){e(t)},1)})
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){
258
534
  let e,n;function r(t){e.abort(t)}
259
535
  for(let s=0;s<t.length;s++){const i=t[s];if(i){
260
- if(i.aborted){r.call(i);break}
261
- n?(e||(e=new c,n.subscribe(r)),i.subscribe(r)):n=i
262
- }}return e?e.signal:n||(new c).signal
263
- }(j,P.signal),k=S,z=Object.keys(i),A=Object.values(i),T=z.length,O={}
264
- ;function F(t){var e=A[t]
265
- ;return"function"==typeof e&&(e=e(O)),e}
266
- for(var I=[],R=[],M=0;M<T;M++)I[M]=-1,R[M]=[]
267
- ;R[0]=F(0);var C=0,D=0,G=!1,$=0,q=!0
268
- ;function N(t,e,s){
269
- return n(this,void 0,void 0,(function(){var n,i
270
- ;return r(this,(function(r){switch(r.label){
271
- case 0:
272
- return n=q,q=!1,n&&(P.abort(t),console.error("error variant: ".concat(e,"\r\n").concat(JSON.stringify(s,(function(t,e){
273
- return e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor!==Object?e+"":e
274
- }),2))),
275
- console.error(t)),i=Date.now(),Date.now()-i>50&&$<5?(console.log("DEBUG ITERATION: "+$),
276
- G=!0,[4,H()]):[3,2];case 1:r.sent(),$++,r.label=2
277
- ;case 2:if(n)throw g&&g({iteration:e,variant:s,
278
- error:t}),t;return[2]}}))}))}
279
- var U=Date.now(),W=U,Q=C,B=D,J=!0===x?Math.pow(2,31):!x||x<=0?1:x,K=J<=1?null:new E(J)
280
- ;function V(e,s,i){
281
- return n(this,void 0,void 0,(function(){var n,o,l
282
- ;return r(this,(function(r){switch(r.label){
283
- case 0:return r.trys.push([0,3,,5]),function(t){
284
- return"object"==typeof t&&t&&"function"==typeof t.then
285
- }(n=t(s,i))?[4,n]:[3,2];case 1:
286
- return o=r.sent(),D+=l="number"==typeof o?o:1,C+=l,
287
- [2];case 2:return C+="number"==typeof n?n:1,[3,5]
288
- ;case 3:return[4,N(r.sent(),e,s)];case 4:
289
- return r.sent(),[3,5];case 5:return[2]}}))}))}
290
- function H(){
291
- return n(this,void 0,void 0,(function(){
292
- var t,i=this;return r(this,(function(o){
293
- switch(o.label){case 0:t=function(){var t,o,l
294
- ;return r(this,(function(c){switch(c.label){
295
- case 0:
296
- return t=C,o=K?e({},O):O,l=(b||_)&&Date.now(),b&&l-U>=b&&(console.log(C),
297
- U=l),a&&C-Q>=a||f&&D-B>=f||_&&l-W>=_?(Q=C,
298
- B=D,W=l,[4,s(1)]):[3,2];case 1:c.sent(),c.label=2
299
- ;case 2:
300
- return(null==j?void 0:j.aborted)?[2,"continue"]:K&&!S.aborted?[3,4]:[4,V(t,o,j)]
301
- ;case 3:return c.sent(),[3,7];case 4:
302
- return K.hold(1)?[3,6]:[4,K.holdWait(1)];case 5:
303
- c.sent(),c.label=6;case 6:
304
- n(i,void 0,void 0,(function(){
305
- return r(this,(function(e){switch(e.label){case 0:
306
- return e.trys.push([0,,2,3]),(null==S?void 0:S.aborted)?[2]:[4,V(t,o,S)]
307
- ;case 1:return e.sent(),[3,3];case 2:
308
- return K.release(1),[7];case 3:return[2]}}))
309
- })),c.label=7;case 7:return[2]}}))},o.label=1
310
- ;case 1:
311
- return(null==j?void 0:j.aborted)||!G&&!function(){
312
- for(var t=T-1;t>=0;t--){var e=I[t]+1
313
- ;if(e<R[t].length){
314
- for(I[t]=e,O[z[t]]=R[t][e],t++;t<T;t++){var n=F(t)
315
- ;if(0===n.length)break;I[t]=0,R[t]=n,O[z[t]]=n[0]}
316
- if(t>=T)return!0}}return!1}()?[3,3]:[5,t()]
317
- ;case 2:return o.sent(),[3,1];case 3:
318
- return K?[4,K.holdWait(J)]:[3,5];case 4:
319
- o.sent(),K.release(J),o.label=5;case 5:
320
- if(null==k?void 0:k.aborted)throw k.reason
321
- ;return y&&console.log("variants: "+C),[4,s(1)]
322
- ;case 6:return o.sent(),[2,C]}}))}))}return H()}}
323
- },Object.defineProperty(t,"__esModule",{value:!0})
324
- }({});
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);