@flemist/test-variants 2.0.5 → 3.0.1

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