@fncts/observable 0.0.10 → 0.0.11

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 (176) hide show
  1. package/Observable/api.d.ts +1 -1
  2. package/ObservableRef/api.d.ts +63 -0
  3. package/ObservableRef/atomic.d.ts +32 -0
  4. package/ObservableRef/definition.d.ts +52 -0
  5. package/_cjs/Action.cjs +0 -7
  6. package/_cjs/Action.cjs.map +1 -1
  7. package/_cjs/AnimationFrameAction.cjs +0 -12
  8. package/_cjs/AnimationFrameAction.cjs.map +1 -1
  9. package/_cjs/AnimationFrameScheduler.cjs +0 -11
  10. package/_cjs/AnimationFrameScheduler.cjs.map +1 -1
  11. package/_cjs/AsyncAction.cjs +0 -25
  12. package/_cjs/AsyncAction.cjs.map +1 -1
  13. package/_cjs/AsyncScheduler.cjs +2 -16
  14. package/_cjs/AsyncScheduler.cjs.map +1 -1
  15. package/_cjs/BehaviorSubject.cjs +0 -12
  16. package/_cjs/BehaviorSubject.cjs.map +1 -1
  17. package/_cjs/Notification.cjs +0 -23
  18. package/_cjs/Notification.cjs.map +1 -1
  19. package/_cjs/Observable/api/connect.cjs +0 -7
  20. package/_cjs/Observable/api/connect.cjs.map +1 -1
  21. package/_cjs/Observable/api/connectable.cjs +0 -14
  22. package/_cjs/Observable/api/connectable.cjs.map +1 -1
  23. package/_cjs/Observable/api/fromCallback.cjs +0 -15
  24. package/_cjs/Observable/api/fromCallback.cjs.map +1 -1
  25. package/_cjs/Observable/api/fromEvent.cjs +0 -5
  26. package/_cjs/Observable/api/fromEvent.cjs.map +1 -1
  27. package/_cjs/Observable/api/index.cjs +0 -28
  28. package/_cjs/Observable/api/index.cjs.map +1 -1
  29. package/_cjs/Observable/api/race.cjs +0 -10
  30. package/_cjs/Observable/api/race.cjs.map +1 -1
  31. package/_cjs/Observable/api/raceWith.cjs +0 -5
  32. package/_cjs/Observable/api/raceWith.cjs.map +1 -1
  33. package/_cjs/Observable/api/repeatWhen.cjs +0 -11
  34. package/_cjs/Observable/api/repeatWhen.cjs.map +1 -1
  35. package/_cjs/Observable/api/retryWhen.cjs +0 -9
  36. package/_cjs/Observable/api/retryWhen.cjs.map +1 -1
  37. package/_cjs/Observable/api/share.cjs +0 -18
  38. package/_cjs/Observable/api/share.cjs.map +1 -1
  39. package/_cjs/Observable/api/window.cjs +0 -8
  40. package/_cjs/Observable/api/window.cjs.map +1 -1
  41. package/_cjs/Observable/api/windowCount.cjs +0 -10
  42. package/_cjs/Observable/api/windowCount.cjs.map +1 -1
  43. package/_cjs/Observable/api/windowTime.cjs +0 -15
  44. package/_cjs/Observable/api/windowTime.cjs.map +1 -1
  45. package/_cjs/Observable/api/windowToggle.cjs +0 -18
  46. package/_cjs/Observable/api/windowToggle.cjs.map +1 -1
  47. package/_cjs/Observable/api/windowWhen.cjs +0 -12
  48. package/_cjs/Observable/api/windowWhen.cjs.map +1 -1
  49. package/_cjs/Observable/api.cjs +14 -404
  50. package/_cjs/Observable/api.cjs.map +1 -1
  51. package/_cjs/Observable/definition.cjs +0 -29
  52. package/_cjs/Observable/definition.cjs.map +1 -1
  53. package/_cjs/Observable/dom/animationFrames.cjs +0 -12
  54. package/_cjs/Observable/dom/animationFrames.cjs.map +1 -1
  55. package/_cjs/Observable.cjs +0 -38
  56. package/_cjs/Observable.cjs.map +1 -1
  57. package/_cjs/ObservableRef/api.cjs +160 -0
  58. package/_cjs/ObservableRef/api.cjs.map +1 -0
  59. package/_cjs/ObservableRef/atomic.cjs +93 -0
  60. package/_cjs/ObservableRef/atomic.cjs.map +1 -0
  61. package/_cjs/ObservableRef/definition.cjs +24 -0
  62. package/_cjs/ObservableRef/definition.cjs.map +1 -0
  63. package/_cjs/Operator.cjs +0 -12
  64. package/_cjs/Operator.cjs.map +1 -1
  65. package/_cjs/Scheduler.cjs +0 -13
  66. package/_cjs/Scheduler.cjs.map +1 -1
  67. package/_cjs/Subject.cjs +0 -47
  68. package/_cjs/Subject.cjs.map +1 -1
  69. package/_cjs/Subscriber.cjs +0 -32
  70. package/_cjs/Subscriber.cjs.map +1 -1
  71. package/_cjs/Subscription.cjs +0 -37
  72. package/_cjs/Subscription.cjs.map +1 -1
  73. package/_cjs/index.cjs +0 -28
  74. package/_cjs/internal/animationFrameProvider.cjs +0 -9
  75. package/_cjs/internal/animationFrameProvider.cjs.map +1 -1
  76. package/_cjs/internal/args.cjs +0 -6
  77. package/_cjs/internal/args.cjs.map +1 -1
  78. package/_cjs/internal/intervalProvider.cjs +0 -2
  79. package/_cjs/internal/intervalProvider.cjs.map +1 -1
  80. package/_cjs/internal/performanceTimestampProvider.cjs +0 -1
  81. package/_cjs/internal/performanceTimestampProvider.cjs.map +1 -1
  82. package/_cjs/internal/timeoutProvider.cjs +0 -2
  83. package/_cjs/internal/timeoutProvider.cjs.map +1 -1
  84. package/_cjs/internal/timestampProvider.cjs +0 -1
  85. package/_cjs/internal/timestampProvider.cjs.map +1 -1
  86. package/_cjs/internal/util.cjs +2 -21
  87. package/_cjs/internal/util.cjs.map +1 -1
  88. package/_mjs/Action.mjs +0 -3
  89. package/_mjs/Action.mjs.map +1 -1
  90. package/_mjs/AnimationFrameAction.mjs +0 -6
  91. package/_mjs/AnimationFrameAction.mjs.map +1 -1
  92. package/_mjs/AnimationFrameScheduler.mjs +0 -5
  93. package/_mjs/AnimationFrameScheduler.mjs.map +1 -1
  94. package/_mjs/AsyncAction.mjs +0 -17
  95. package/_mjs/AsyncAction.mjs.map +1 -1
  96. package/_mjs/AsyncScheduler.mjs +2 -10
  97. package/_mjs/AsyncScheduler.mjs.map +1 -1
  98. package/_mjs/BehaviorSubject.mjs +0 -7
  99. package/_mjs/BehaviorSubject.mjs.map +1 -1
  100. package/_mjs/Notification.mjs +0 -12
  101. package/_mjs/Notification.mjs.map +1 -1
  102. package/_mjs/Observable/api/connect.mjs +0 -1
  103. package/_mjs/Observable/api/connect.mjs.map +1 -1
  104. package/_mjs/Observable/api/connectable.mjs +0 -5
  105. package/_mjs/Observable/api/connectable.mjs.map +1 -1
  106. package/_mjs/Observable/api/fromCallback.mjs +0 -10
  107. package/_mjs/Observable/api/fromCallback.mjs.map +1 -1
  108. package/_mjs/Observable/api/fromEvent.mjs +0 -2
  109. package/_mjs/Observable/api/fromEvent.mjs.map +1 -1
  110. package/_mjs/Observable/api/index.mjs.map +1 -1
  111. package/_mjs/Observable/api/race.mjs +0 -4
  112. package/_mjs/Observable/api/race.mjs.map +1 -1
  113. package/_mjs/Observable/api/raceWith.mjs +0 -1
  114. package/_mjs/Observable/api/raceWith.mjs.map +1 -1
  115. package/_mjs/Observable/api/repeatWhen.mjs +0 -7
  116. package/_mjs/Observable/api/repeatWhen.mjs.map +1 -1
  117. package/_mjs/Observable/api/retryWhen.mjs +0 -5
  118. package/_mjs/Observable/api/retryWhen.mjs.map +1 -1
  119. package/_mjs/Observable/api/share.mjs +0 -12
  120. package/_mjs/Observable/api/share.mjs.map +1 -1
  121. package/_mjs/Observable/api/window.mjs +0 -3
  122. package/_mjs/Observable/api/window.mjs.map +1 -1
  123. package/_mjs/Observable/api/windowCount.mjs +0 -6
  124. package/_mjs/Observable/api/windowCount.mjs.map +1 -1
  125. package/_mjs/Observable/api/windowTime.mjs +0 -6
  126. package/_mjs/Observable/api/windowTime.mjs.map +1 -1
  127. package/_mjs/Observable/api/windowToggle.mjs +0 -10
  128. package/_mjs/Observable/api/windowToggle.mjs.map +1 -1
  129. package/_mjs/Observable/api/windowWhen.mjs +0 -6
  130. package/_mjs/Observable/api/windowWhen.mjs.map +1 -1
  131. package/_mjs/Observable/api.mjs +14 -306
  132. package/_mjs/Observable/api.mjs.map +1 -1
  133. package/_mjs/Observable/definition.mjs +0 -16
  134. package/_mjs/Observable/definition.mjs.map +1 -1
  135. package/_mjs/Observable/dom/animationFrames.mjs +0 -5
  136. package/_mjs/Observable/dom/animationFrames.mjs.map +1 -1
  137. package/_mjs/Observable.mjs +4 -4
  138. package/_mjs/Observable.mjs.map +1 -1
  139. package/_mjs/ObservableRef/api.mjs +141 -0
  140. package/_mjs/ObservableRef/api.mjs.map +1 -0
  141. package/_mjs/ObservableRef/atomic.mjs +82 -0
  142. package/_mjs/ObservableRef/atomic.mjs.map +1 -0
  143. package/_mjs/ObservableRef/definition.mjs +16 -0
  144. package/_mjs/ObservableRef/definition.mjs.map +1 -0
  145. package/_mjs/Operator.mjs +0 -3
  146. package/_mjs/Operator.mjs.map +1 -1
  147. package/_mjs/Scheduler.mjs +0 -3
  148. package/_mjs/Scheduler.mjs.map +1 -1
  149. package/_mjs/Subject.mjs +0 -34
  150. package/_mjs/Subject.mjs.map +1 -1
  151. package/_mjs/Subscriber.mjs +0 -20
  152. package/_mjs/Subscriber.mjs.map +1 -1
  153. package/_mjs/Subscription.mjs +0 -26
  154. package/_mjs/Subscription.mjs.map +1 -1
  155. package/_mjs/index.mjs.map +1 -1
  156. package/_mjs/internal/animationFrameProvider.mjs +0 -5
  157. package/_mjs/internal/animationFrameProvider.mjs.map +1 -1
  158. package/_mjs/internal/args.mjs +0 -2
  159. package/_mjs/internal/args.mjs.map +1 -1
  160. package/_mjs/internal/intervalProvider.mjs +0 -2
  161. package/_mjs/internal/intervalProvider.mjs.map +1 -1
  162. package/_mjs/internal/performanceTimestampProvider.mjs +0 -1
  163. package/_mjs/internal/performanceTimestampProvider.mjs.map +1 -1
  164. package/_mjs/internal/timeoutProvider.mjs +0 -2
  165. package/_mjs/internal/timeoutProvider.mjs.map +1 -1
  166. package/_mjs/internal/timestampProvider.mjs +0 -1
  167. package/_mjs/internal/timestampProvider.mjs.map +1 -1
  168. package/_mjs/internal/util.mjs +2 -7
  169. package/_mjs/internal/util.mjs.map +1 -1
  170. package/_src/Observable/api.ts +12 -11
  171. package/_src/ObservableRef/api.ts +169 -0
  172. package/_src/ObservableRef/atomic.ts +85 -0
  173. package/_src/ObservableRef/definition.ts +57 -0
  174. package/_src/global.ts +5 -1
  175. package/global.d.ts +5 -1
  176. package/package.json +2 -2
@@ -121,57 +121,31 @@ exports.unit = void 0;
121
121
  exports.zip = zip;
122
122
  exports.zipWith = exports.zipLatest = void 0;
123
123
  exports.zipWithLatest = zipWithLatest;
124
-
125
124
  var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Cause/api"));
126
-
127
125
  var tsplus_module_2 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/observable/internal/util"));
128
-
129
126
  var tsplus_module_3 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/util/predicates"));
130
-
131
127
  var tsplus_module_4 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO"));
132
-
133
128
  var tsplus_module_5 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/observable/AsyncScheduler"));
134
-
135
129
  var tsplus_module_6 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/observable/Subscription"));
136
-
137
130
  var tsplus_module_7 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/observable/Scheduler"));
138
-
139
131
  var tsplus_module_8 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/observable/Operator"));
140
-
141
132
  var tsplus_module_9 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/api/environment"));
142
-
143
133
  var tsplus_module_10 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/IO/runtime"));
144
-
145
134
  var tsplus_module_11 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Exit/api"));
146
-
147
135
  var tsplus_module_12 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/io/Fiber/api/interrupt"));
148
-
149
136
  var tsplus_module_13 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/function/api"));
150
-
151
137
  var tsplus_module_14 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Either/destructors"));
152
-
153
138
  var tsplus_module_15 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/destructors"));
154
-
155
139
  var tsplus_module_16 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Environment/api"));
156
-
157
140
  var tsplus_module_17 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/constructors"));
158
-
159
141
  var tsplus_module_18 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/definition"));
160
-
161
142
  var tsplus_module_19 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Either/constructors"));
162
-
163
143
  var tsplus_module_20 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/observable/Notification"));
164
-
165
144
  var tsplus_module_21 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/collection/immutable/HashSet/api"));
166
-
167
145
  var _args = /*#__PURE__*/require("@fncts/observable/internal/args");
168
-
169
146
  var _definition2 = /*#__PURE__*/require("@fncts/observable/Observable/definition");
170
-
171
147
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
172
-
173
148
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
174
-
175
149
  const fileName_1 = "(@fncts/observable) src/Observable/api.ts";
176
150
  const defer = defer_1;
177
151
  exports.defer = defer;
@@ -275,7 +249,6 @@ const toArray = toArray_1;
275
249
  exports.toArray = toArray;
276
250
  const uniqueUntilChanged = uniqueUntilChanged_1;
277
251
  exports.uniqueUntilChanged = uniqueUntilChanged;
278
-
279
252
  /**
280
253
  * @tsplus static fncts.observable.ObservableOps halt
281
254
  */
@@ -285,8 +258,6 @@ function halt(defect) {
285
258
  /**
286
259
  * @tsplus static fncts.observable.ObservableOps defer
287
260
  */
288
-
289
-
290
261
  function defer_1(observable) {
291
262
  return new _definition2.Observable((s, environment) => {
292
263
  from_1(observable()).provideEnvironment(environment).subscribe(s);
@@ -295,106 +266,81 @@ function defer_1(observable) {
295
266
  /**
296
267
  * @tsplus static fncts.observable.ObservableOps empty
297
268
  */
298
-
299
-
300
269
  function empty_1() {
301
270
  return _definition2.EMPTY;
302
271
  }
303
272
  /**
304
273
  * @tsplus static fncts.observable.ObservableOps environmentWithObservable
305
274
  */
306
-
307
-
308
275
  function environmentWithObservable_1(f) {
309
276
  return new _definition2.EnvironmentWith(f);
310
277
  }
311
278
  /**
312
279
  * @tsplus static fncts.observable.ObservableOps failCause
313
280
  */
314
-
315
-
316
281
  function failCause(cause) {
317
282
  return new _definition2.Observable(s => s.error(cause));
318
283
  }
319
284
  /**
320
285
  * @tsplus static fncts.observable.ObservableOps fail
321
286
  */
322
-
323
-
324
287
  function fail_1(e) {
325
288
  return new _definition2.Observable(s => s.error(tsplus_module_1.fail(e)));
326
289
  }
327
290
  /**
328
291
  * @tsplus static fncts.observable.ObservableOps from
329
292
  */
330
-
331
-
332
293
  function from_1(input) {
333
294
  if (input instanceof _definition2.Observable) {
334
295
  return input;
335
296
  }
336
-
337
297
  if (tsplus_module_2.isArrayLike(input)) {
338
298
  return fromArrayLike(input);
339
299
  }
340
-
341
300
  if (tsplus_module_2.isPromiseLike(input)) {
342
301
  return fromPromise(input);
343
302
  }
344
-
345
303
  if (tsplus_module_2.isAsyncIterable(input)) {
346
304
  return fromAsyncIterable(input);
347
305
  }
348
-
349
306
  if (tsplus_module_3.isIterable(input)) {
350
307
  return fromIterable(input);
351
308
  }
352
-
353
309
  if (tsplus_module_2.isReadableStream(input)) {
354
310
  return fromReadableStreamLike(input);
355
311
  }
356
-
357
312
  if (tsplus_module_4.isIO(input)) {
358
313
  return fromIO_1(input);
359
314
  }
360
-
361
315
  if ("subscribe" in input) {
362
316
  return fromSubscribable_1(input);
363
317
  }
364
-
365
318
  throw new TypeError("Invalid Observable input");
366
319
  }
367
-
368
320
  function fromArrayLike(input) {
369
321
  return new _definition2.Observable(s => {
370
322
  for (let i = 0; i < input.length && !s.closed; i++) {
371
323
  s.next(input[i]);
372
324
  }
373
-
374
325
  s.complete();
375
326
  });
376
327
  }
377
-
378
328
  function fromAsyncIterable(asyncIterable) {
379
329
  return new _definition2.Observable(s => {
380
330
  process(asyncIterable, s).catch(err => s.error(tsplus_module_1.halt(err)));
381
331
  });
382
332
  }
383
-
384
333
  function fromIterable(iterable) {
385
334
  return new _definition2.Observable(s => {
386
335
  for (const value of iterable) {
387
336
  s.next(value);
388
-
389
337
  if (s.closed) {
390
338
  return;
391
339
  }
392
340
  }
393
-
394
341
  s.complete();
395
342
  });
396
343
  }
397
-
398
344
  function fromPromise(promise) {
399
345
  return new _definition2.Observable(s => {
400
346
  promise.then(value => {
@@ -405,19 +351,15 @@ function fromPromise(promise) {
405
351
  }, err => s.error(tsplus_module_1.halt(err))).then(null, tsplus_module_2.reportUnhandledError);
406
352
  });
407
353
  }
408
-
409
354
  function fromReadableStreamLike(readableStream) {
410
355
  return fromAsyncIterable((0, tsplus_module_2.readableStreamToAsyncGenerator)(readableStream));
411
356
  }
412
357
  /**
413
358
  * @tsplus static fncts.observable.ObservableOps fromSubscribable
414
359
  */
415
-
416
-
417
360
  function fromSubscribable_1(subscribable) {
418
361
  return new _definition2.Observable(subscriber => subscribable.subscribe(subscriber));
419
362
  }
420
-
421
363
  function fromInterop(subscribable) {
422
364
  return new _definition2.Observable(subscriber => subscribable.subscribe({
423
365
  next: value => subscriber.next(value),
@@ -425,11 +367,9 @@ function fromInterop(subscribable) {
425
367
  complete: () => subscriber.complete()
426
368
  }));
427
369
  }
428
-
429
370
  function _if(condition, onTrue, onFalse) {
430
371
  return defer_1(() => condition() ? onTrue : onFalse);
431
372
  }
432
-
433
373
  function iterate(options) {
434
374
  const {
435
375
  initialState,
@@ -437,41 +377,32 @@ function iterate(options) {
437
377
  iterate,
438
378
  scheduler
439
379
  } = options;
440
-
441
380
  function* gen() {
442
381
  for (let state = initialState; !cont || cont(state); state = iterate(state)) {
443
382
  yield state;
444
383
  }
445
384
  }
446
-
447
385
  return defer_1(scheduler ? () => scheduleIterable(gen(), scheduler) : gen);
448
386
  }
449
-
450
387
  async function process(asyncIterable, subscriber) {
451
388
  for await (const value of asyncIterable) {
452
389
  subscriber.next(value);
453
-
454
390
  if (subscriber.closed) {
455
391
  return;
456
392
  }
457
393
  }
458
-
459
394
  subscriber.complete();
460
395
  }
461
396
  /**
462
397
  * @tsplus static fncts.obervable.ObservableOps interval
463
398
  */
464
-
465
-
466
399
  function interval_1(period = 0, scheduler = tsplus_module_5.asyncScheduler) {
467
400
  if (period < 0) {
468
401
  // eslint-disable-next-line no-param-reassign
469
402
  period = 0;
470
403
  }
471
-
472
404
  return timer_1(period, period, scheduler);
473
405
  }
474
-
475
406
  function merge(...sources) {
476
407
  const concurrency = (0, _args.popNumber)(sources, Infinity);
477
408
  return !sources.length ? empty_1() : sources.length === 1 ? from_1(sources[0]) : mergeAll_1(concurrency)(fromArrayLike(sources));
@@ -479,16 +410,12 @@ function merge(...sources) {
479
410
  /**
480
411
  * @tsplus static fncts.observable.ObservableOps of
481
412
  */
482
-
483
-
484
413
  function of_1(...items) {
485
414
  return fromArrayLike(items);
486
415
  }
487
416
  /**
488
417
  * @tsplus static fncts.observable.ObservableOps single
489
418
  */
490
-
491
-
492
419
  function single_1(a) {
493
420
  return new _definition2.Observable(s => {
494
421
  s.next(a);
@@ -499,34 +426,26 @@ function single_1(a) {
499
426
  * @tsplus pipeable fncts.observable.Observable scheduled
500
427
  * @tsplus static fncts.observable.ObservableOps scheduled
501
428
  */
502
-
503
-
504
429
  function scheduled_1(scheduler) {
505
430
  return input => {
506
431
  if (tsplus_module_2.isArrayLike(input)) {
507
432
  return scheduleArray(input, scheduler);
508
433
  }
509
-
510
434
  if (tsplus_module_2.isPromiseLike(input)) {
511
435
  return schedulePromise(input, scheduler);
512
436
  }
513
-
514
437
  if (tsplus_module_3.isIterable(input)) {
515
438
  return scheduleIterable(input, scheduler);
516
439
  }
517
-
518
440
  if (tsplus_module_2.isAsyncIterable(input)) {
519
441
  return scheduleAsyncIterable(input, scheduler);
520
442
  }
521
-
522
443
  if (tsplus_module_2.isReadableStream(input)) {
523
444
  return scheduleReadableStreamLike(input, scheduler);
524
445
  }
525
-
526
446
  return scheduleObservable(from_1(input), scheduler);
527
447
  };
528
448
  }
529
-
530
449
  function scheduleArray(input, scheduler) {
531
450
  return new _definition2.Observable(s => {
532
451
  let i = 0;
@@ -535,7 +454,6 @@ function scheduleArray(input, scheduler) {
535
454
  s.complete();
536
455
  } else {
537
456
  s.next(input[i++]);
538
-
539
457
  if (!s.closed) {
540
458
  this.schedule();
541
459
  }
@@ -543,7 +461,6 @@ function scheduleArray(input, scheduler) {
543
461
  });
544
462
  });
545
463
  }
546
-
547
464
  function scheduleAsyncIterable(input, scheduler) {
548
465
  return new _definition2.Observable(subscriber => {
549
466
  const sub = new tsplus_module_6.Subscription();
@@ -563,7 +480,6 @@ function scheduleAsyncIterable(input, scheduler) {
563
480
  return sub;
564
481
  });
565
482
  }
566
-
567
483
  function scheduleIterable(input, scheduler) {
568
484
  return new _definition2.Observable(s => {
569
485
  let iterator;
@@ -574,7 +490,6 @@ function scheduleIterable(input, scheduler) {
574
490
  value,
575
491
  done
576
492
  } = iterator.next();
577
-
578
493
  if (done) {
579
494
  s.complete();
580
495
  } else {
@@ -586,7 +501,6 @@ function scheduleIterable(input, scheduler) {
586
501
  return () => tsplus_module_3.isFunction(iterator?.return) && iterator.return();
587
502
  });
588
503
  }
589
-
590
504
  function scheduleObservable(input, scheduler) {
591
505
  return new _definition2.Observable((subscriber, environment) => {
592
506
  const sub = new tsplus_module_6.Subscription();
@@ -605,7 +519,6 @@ function scheduleObservable(input, scheduler) {
605
519
  }));
606
520
  });
607
521
  }
608
-
609
522
  function schedulePromise(input, scheduler) {
610
523
  return new _definition2.Observable(subscriber => {
611
524
  return scheduler.schedule(() => {
@@ -620,14 +533,11 @@ function schedulePromise(input, scheduler) {
620
533
  });
621
534
  });
622
535
  }
623
-
624
536
  function scheduleReadableStreamLike(input, scheduler) {
625
537
  return scheduleAsyncIterable((0, tsplus_module_2.readableStreamToAsyncGenerator)(input), scheduler);
626
538
  }
627
-
628
539
  function timer_1(time = 0, intervalOrScheduler, scheduler = tsplus_module_5.asyncScheduler) {
629
540
  let intervalDuration = -1;
630
-
631
541
  if (intervalOrScheduler != null) {
632
542
  if (tsplus_module_7.isScheduler(intervalOrScheduler)) {
633
543
  // eslint-disable-next-line no-param-reassign
@@ -636,19 +546,15 @@ function timer_1(time = 0, intervalOrScheduler, scheduler = tsplus_module_5.asyn
636
546
  intervalDuration = intervalOrScheduler;
637
547
  }
638
548
  }
639
-
640
549
  return new _definition2.Observable(s => {
641
550
  let due = tsplus_module_2.isValidDate(time) ? +time - scheduler.now() : time;
642
-
643
551
  if (due < 0) {
644
552
  due = 0;
645
553
  }
646
-
647
554
  let n = 0;
648
555
  return scheduler.schedule(function () {
649
556
  if (!s.closed) {
650
557
  s.next(n++);
651
-
652
558
  if (0 <= intervalDuration) {
653
559
  this.schedule(undefined, intervalDuration);
654
560
  } else {
@@ -661,8 +567,6 @@ function timer_1(time = 0, intervalOrScheduler, scheduler = tsplus_module_5.asyn
661
567
  /**
662
568
  * @tsplus static fncts.observable.ObservableOps zip
663
569
  */
664
-
665
-
666
570
  function makeZip(...sources) {
667
571
  return sources.length ? new _definition2.Observable((subscriber, environment) => {
668
572
  let buffers = sources.map(() => []);
@@ -670,16 +574,13 @@ function makeZip(...sources) {
670
574
  subscriber.add(() => {
671
575
  buffers = completed = null;
672
576
  });
673
-
674
577
  for (let sourceIndex = 0; !subscriber.closed && sourceIndex < sources.length; sourceIndex++) {
675
578
  from_1(sources[sourceIndex]).provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
676
579
  next: value => {
677
580
  buffers[sourceIndex].push(value);
678
-
679
581
  if (buffers.every(buffer => buffer.length)) {
680
582
  const result = buffers.map(buffer => buffer.shift());
681
583
  subscriber.next(result);
682
-
683
584
  if (buffers.some((buffer, i) => !buffer.length && completed[i])) {
684
585
  subscriber.complete();
685
586
  }
@@ -691,7 +592,6 @@ function makeZip(...sources) {
691
592
  }
692
593
  }));
693
594
  }
694
-
695
595
  return () => {
696
596
  buffers = completed = null;
697
597
  };
@@ -700,38 +600,32 @@ function makeZip(...sources) {
700
600
  /**
701
601
  * @tsplus static fncts.observable.ObservableOps fromIO
702
602
  */
703
-
704
-
705
603
  function fromIO_1(io, scheduler = tsplus_module_5.asyncScheduler) {
706
604
  return new _definition2.Observable((s, env) => {
707
605
  let fiber;
708
606
  const scheduled = scheduler.schedule(() => {
709
607
  fiber = tsplus_module_10.unsafeRunFiber(tsplus_module_9.provideEnvironment(env, fileName_1 + ":489:36")(io), fileName_1 + ":489:56");
710
- fiber.unsafeOnDone(exit => {
608
+ fiber.addObserver(exit => {
711
609
  if (!s.closed) {
712
- tsplus_module_11.match(cause => s.error(cause), a => s.next(a))(tsplus_module_11.flatten(exit));
610
+ tsplus_module_11.match(cause => s.error(cause), a => s.next(a))(exit);
713
611
  s.complete();
714
612
  }
715
613
  });
716
614
  });
717
615
  return () => {
718
616
  scheduled.unsubscribe();
719
- fiber && tsplus_module_10.unsafeRunAsync(tsplus_module_12.interrupt(fiber, fileName_1 + ":502:21"), fileName_1 + ":502:46");
617
+ fiber && tsplus_module_10.unsafeRunAsync(tsplus_module_12.interrupt(fiber), fileName_1 + ":502:46");
720
618
  };
721
619
  });
722
620
  }
723
621
  /**
724
622
  * @tsplus static fncts.observable.ObservableOps unit
725
623
  */
726
-
727
-
728
624
  const unit = /*#__PURE__*/single_1(undefined);
729
625
  /**
730
626
  * @tsplus pipeable fncts.observable.Observable zipWith
731
627
  */
732
-
733
628
  exports.unit = unit;
734
-
735
629
  function zipWith_1(fb, f) {
736
630
  return fa => {
737
631
  return mergeMap_1(a => map_1(b => f(a, b))(fb))(fa);
@@ -740,8 +634,6 @@ function zipWith_1(fb, f) {
740
634
  /**
741
635
  * @tsplus pipeable fncts.observable.Observable zip
742
636
  */
743
-
744
-
745
637
  function zip(fb) {
746
638
  return fa => {
747
639
  return zipWith_1(fb, tsplus_module_13.tuple)(fa);
@@ -750,8 +642,6 @@ function zip(fb) {
750
642
  /**
751
643
  * @tsplus pipeable fncts.observable.Observable ap
752
644
  */
753
-
754
-
755
645
  function ap(fa) {
756
646
  return fab => {
757
647
  return zipWith_1(fa, (f, a) => f(a))(fab);
@@ -760,8 +650,6 @@ function ap(fa) {
760
650
  /**
761
651
  * @tsplus pipeable fncts.observable.Observable mapWithIndex
762
652
  */
763
-
764
-
765
653
  function mapWithIndex_1(f) {
766
654
  return fa => {
767
655
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -777,8 +665,6 @@ function mapWithIndex_1(f) {
777
665
  /**
778
666
  * @tsplus pipeable fncts.observable.Observable map
779
667
  */
780
-
781
-
782
668
  function map_1(f) {
783
669
  return fa => {
784
670
  return mapWithIndex_1((_, a) => f(a))(fa);
@@ -787,8 +673,6 @@ function map_1(f) {
787
673
  /**
788
674
  * @tsplus pipeable fncts.observable.Observable as
789
675
  */
790
-
791
-
792
676
  function as_1(b) {
793
677
  return fa => {
794
678
  return map_1(b)(fa);
@@ -797,8 +681,6 @@ function as_1(b) {
797
681
  /**
798
682
  * @tsplus pipeable fncts.observable.Observable mapError
799
683
  */
800
-
801
-
802
684
  function mapError(f) {
803
685
  return fa => {
804
686
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -813,8 +695,6 @@ function mapError(f) {
813
695
  /**
814
696
  * @tsplus getter fncts.observable.Observable swap
815
697
  */
816
-
817
-
818
698
  function swap(fa) {
819
699
  return tsplus_module_8.operate_((source, subscriber, environment) => {
820
700
  source.provideEnvironment(environment).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
@@ -831,7 +711,6 @@ function swap(fa) {
831
711
  }));
832
712
  })(fa);
833
713
  }
834
-
835
714
  function filterWithIndex_1(predicate) {
836
715
  return fa => {
837
716
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -842,7 +721,6 @@ function filterWithIndex_1(predicate) {
842
721
  })(fa);
843
722
  };
844
723
  }
845
-
846
724
  function filter(predicate) {
847
725
  return fa => {
848
726
  return filterWithIndex_1((_, a) => predicate(a))(fa);
@@ -851,8 +729,6 @@ function filter(predicate) {
851
729
  /**
852
730
  * @tsplus pipeable fncts.observable.Observable filterMapWithIndex
853
731
  */
854
-
855
-
856
732
  function filterMapWithIndex_1(f) {
857
733
  return fa => {
858
734
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -866,20 +742,16 @@ function filterMapWithIndex_1(f) {
866
742
  /**
867
743
  * @tsplus pipeable fncts.observable.Observable filterMap
868
744
  */
869
-
870
-
871
745
  function filterMap(f) {
872
746
  return fa => {
873
747
  return filterMapWithIndex_1((_, a) => f(a))(fa);
874
748
  };
875
749
  }
876
-
877
750
  function partitionWithIndex_1(predicate) {
878
751
  return fa => {
879
752
  return [filterWithIndex_1((i, a) => !predicate(i, a))(fa), filterWithIndex_1(predicate)(fa)];
880
753
  };
881
754
  }
882
-
883
755
  function partition(predicate) {
884
756
  return fa => {
885
757
  return partitionWithIndex_1((_, a) => predicate(a))(fa);
@@ -888,8 +760,6 @@ function partition(predicate) {
888
760
  /**
889
761
  * @tsplus pipeable fncts.observable.Observable partitionMapWithIndex
890
762
  */
891
-
892
-
893
763
  function partitionMapWithIndex_1(f) {
894
764
  return fa => {
895
765
  return [tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -912,8 +782,6 @@ function partitionMapWithIndex_1(f) {
912
782
  /**
913
783
  * @tsplus pipeable fncts.observable.Observable partitionMap
914
784
  */
915
-
916
-
917
785
  function partitionMap(f) {
918
786
  return fa => {
919
787
  return partitionMapWithIndex_1((_, a) => f(a))(fa);
@@ -922,11 +790,7 @@ function partitionMap(f) {
922
790
  /**
923
791
  * @tsplus pipeable fncts.observable.Observable provideService
924
792
  */
925
-
926
-
927
- function provideService(service,
928
- /** @tsplus auto */
929
- tag) {
793
+ function provideService(service, /** @tsplus auto */tag) {
930
794
  return self => {
931
795
  return contramapEnvironment_1(environment => tsplus_module_16.add(service, tag)(environment))(self);
932
796
  };
@@ -934,8 +798,6 @@ tag) {
934
798
  /**
935
799
  * @tsplus pipeable fncts.observable.Observable mergeMapWithIndex
936
800
  */
937
-
938
-
939
801
  function mergeMapWithIndex_1(f, concurrent = Infinity) {
940
802
  return ma => {
941
803
  return tsplus_module_8.operate_((source, sub, environment) => mergeInternal(source, sub, environment, f, concurrent))(ma);
@@ -944,8 +806,6 @@ function mergeMapWithIndex_1(f, concurrent = Infinity) {
944
806
  /**
945
807
  * @tsplus pipeable fncts.observable.Observable mergeMap
946
808
  */
947
-
948
-
949
809
  function mergeMap_1(f, concurrent = Infinity) {
950
810
  return ma => {
951
811
  return mergeMapWithIndex_1((_, a) => f(a), concurrent)(ma);
@@ -954,8 +814,6 @@ function mergeMap_1(f, concurrent = Infinity) {
954
814
  /**
955
815
  * @tsplus pipeable fncts.observable.Observable concatMapWithIndex
956
816
  */
957
-
958
-
959
817
  function concatMapWithIndex(f) {
960
818
  return ma => {
961
819
  return mergeMapWithIndex_1(f, 1)(ma);
@@ -964,8 +822,6 @@ function concatMapWithIndex(f) {
964
822
  /**
965
823
  * @tsplus pipeable fncts.observable.Observable concatMap
966
824
  */
967
-
968
-
969
825
  function concatMap(f) {
970
826
  return ma => {
971
827
  return mergeMapWithIndex_1((_, a) => f(a), 1)(ma);
@@ -974,8 +830,6 @@ function concatMap(f) {
974
830
  /**
975
831
  * @tsplus pipeable fncts.observable.Observable contramapEnvironment
976
832
  */
977
-
978
-
979
833
  function contramapEnvironment_1(f) {
980
834
  return self => {
981
835
  return environmentWithObservable_1(environment => self.provideEnvironment(f(environment)));
@@ -984,16 +838,12 @@ function contramapEnvironment_1(f) {
984
838
  /**
985
839
  * @tsplus getter fncts.observable.Observable flatten
986
840
  */
987
-
988
-
989
841
  function flatten(mma) {
990
842
  return concatAll_1(mma);
991
843
  }
992
844
  /**
993
845
  * @tsplus pipeable fncts.observable.Observable foldLeftWithIndex
994
846
  */
995
-
996
-
997
847
  function foldLeftWithIndex_1(initial, f) {
998
848
  return fa => {
999
849
  return tsplus_module_8.operate_(scanInternal(f, initial, true, false, true))(fa);
@@ -1002,8 +852,6 @@ function foldLeftWithIndex_1(initial, f) {
1002
852
  /**
1003
853
  * @tsplus pipeable fncts.observable.Observable foldLeft
1004
854
  */
1005
-
1006
-
1007
855
  function foldLeft_1(initial, f) {
1008
856
  return fa => {
1009
857
  return foldLeftWithIndex_1(initial, (_, b, a) => f(b, a))(fa);
@@ -1012,8 +860,6 @@ function foldLeft_1(initial, f) {
1012
860
  /**
1013
861
  * @tsplus pipeable fncts.observable.Observable at
1014
862
  */
1015
-
1016
-
1017
863
  function at(index) {
1018
864
  return fa => {
1019
865
  return onEmpty_1(() => tsplus_module_17.nothing())(map_1(tsplus_module_17.just)(take_1(1)(filterWithIndex_1(i => i === index)(fa))));
@@ -1022,19 +868,15 @@ function at(index) {
1022
868
  /**
1023
869
  * @tsplus pipeable fncts.observable.Observable audit
1024
870
  */
1025
-
1026
-
1027
871
  function audit_1(durationSelector) {
1028
872
  return fa => {
1029
873
  return tsplus_module_8.operate_((source, subscriber, environment) => {
1030
874
  let lastValue = tsplus_module_17.nothing();
1031
875
  let durationSubscriber = null;
1032
876
  let isComplete = false;
1033
-
1034
877
  const endDuration = () => {
1035
878
  durationSubscriber?.unsubscribe();
1036
879
  durationSubscriber = null;
1037
-
1038
880
  if (tsplus_module_18.isJust(lastValue)) {
1039
881
  const {
1040
882
  value
@@ -1042,19 +884,15 @@ function audit_1(durationSelector) {
1042
884
  lastValue = tsplus_module_17.nothing();
1043
885
  subscriber.next(value);
1044
886
  }
1045
-
1046
887
  isComplete && subscriber.complete();
1047
888
  };
1048
-
1049
889
  const cleanupDuration = () => {
1050
890
  durationSubscriber = null;
1051
891
  isComplete && subscriber.complete();
1052
892
  };
1053
-
1054
893
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
1055
894
  next: value => {
1056
895
  lastValue = tsplus_module_17.just(value);
1057
-
1058
896
  if (!durationSubscriber) {
1059
897
  from_1(durationSelector(value)).provideEnvironment(environment).subscribe(durationSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
1060
898
  next: endDuration,
@@ -1073,8 +911,6 @@ function audit_1(durationSelector) {
1073
911
  /**
1074
912
  * @tsplus pipeable fncts.observable.Observable auditTime
1075
913
  */
1076
-
1077
-
1078
914
  function auditTime(duration, scheduler = tsplus_module_5.asyncScheduler) {
1079
915
  return fa => {
1080
916
  return audit_1(() => timer_1(duration, scheduler))(fa);
@@ -1083,8 +919,6 @@ function auditTime(duration, scheduler = tsplus_module_5.asyncScheduler) {
1083
919
  /**
1084
920
  * @tsplus pipeable fncts.observable.Observable buffer
1085
921
  */
1086
-
1087
-
1088
922
  function buffer(closingNotifier) {
1089
923
  return fa => {
1090
924
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -1113,8 +947,6 @@ function buffer(closingNotifier) {
1113
947
  /**
1114
948
  * @tsplus pipeable fncts.observable.Observable bufferCount
1115
949
  */
1116
-
1117
-
1118
950
  function bufferCount(bufferSize, startBufferEvery) {
1119
951
  return fa => {
1120
952
  // eslint-disable-next-line no-param-reassign
@@ -1125,20 +957,16 @@ function bufferCount(bufferSize, startBufferEvery) {
1125
957
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
1126
958
  next: value => {
1127
959
  let toEmit = null;
1128
-
1129
960
  if (count++ % startBufferEvery === 0) {
1130
961
  buffers.push([]);
1131
962
  }
1132
-
1133
963
  for (const buffer of buffers) {
1134
964
  buffer.push(value);
1135
-
1136
965
  if (bufferSize <= buffer.length) {
1137
966
  toEmit = toEmit ?? [];
1138
967
  toEmit.push(buffer);
1139
968
  }
1140
969
  }
1141
-
1142
970
  if (toEmit) {
1143
971
  for (const buffer of toEmit) {
1144
972
  (0, tsplus_module_2.arrayRemove)(buffers, buffer);
@@ -1150,7 +978,6 @@ function bufferCount(bufferSize, startBufferEvery) {
1150
978
  for (const buffer of buffers) {
1151
979
  subscriber.next(buffer);
1152
980
  }
1153
-
1154
981
  subscriber.complete();
1155
982
  }
1156
983
  }, () => {
@@ -1162,8 +989,6 @@ function bufferCount(bufferSize, startBufferEvery) {
1162
989
  /**
1163
990
  * @tsplus pipeable fncts.observable.Observable bufferTime
1164
991
  */
1165
-
1166
-
1167
992
  function bufferTime(config) {
1168
993
  return fa => {
1169
994
  const {
@@ -1175,7 +1000,6 @@ function bufferTime(config) {
1175
1000
  return tsplus_module_8.operate_((source, subscriber, environment) => {
1176
1001
  let bufferRecords = [];
1177
1002
  let restartOnEmit = true;
1178
-
1179
1003
  const emit = record => {
1180
1004
  const {
1181
1005
  buffer,
@@ -1186,7 +1010,6 @@ function bufferTime(config) {
1186
1010
  subscriber.next(buffer);
1187
1011
  restartOnEmit && startBuffer();
1188
1012
  };
1189
-
1190
1013
  const startBuffer = () => {
1191
1014
  if (bufferRecords) {
1192
1015
  const subs = new tsplus_module_6.Subscription();
@@ -1200,7 +1023,6 @@ function bufferTime(config) {
1200
1023
  subs.add(scheduler.schedule(() => emit(record), bufferTimeSpan));
1201
1024
  }
1202
1025
  };
1203
-
1204
1026
  bufferCreationInterval !== null && bufferCreationInterval >= 0 ? subscriber.add(scheduler.schedule(function () {
1205
1027
  startBuffer();
1206
1028
  !this.closed && subscriber.add(this.schedule(null, bufferCreationInterval));
@@ -1209,7 +1031,6 @@ function bufferTime(config) {
1209
1031
  const bufferTimeSubscriber = tsplus_module_8.operatorSubscriber(subscriber, {
1210
1032
  next: value => {
1211
1033
  const recordsCopy = bufferRecords.slice();
1212
-
1213
1034
  for (const record of recordsCopy) {
1214
1035
  const {
1215
1036
  buffer
@@ -1222,7 +1043,6 @@ function bufferTime(config) {
1222
1043
  while (bufferRecords?.length) {
1223
1044
  subscriber.next(bufferRecords.shift().buffer);
1224
1045
  }
1225
-
1226
1046
  bufferTimeSubscriber?.unsubscribe();
1227
1047
  subscriber.complete();
1228
1048
  subscriber.unsubscribe();
@@ -1235,8 +1055,6 @@ function bufferTime(config) {
1235
1055
  /**
1236
1056
  * @tsplus pipeable fncts.observable.Observable bufferToggle
1237
1057
  */
1238
-
1239
-
1240
1058
  function bufferToggle(openings, closingSelector) {
1241
1059
  return fa => {
1242
1060
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -1246,13 +1064,11 @@ function bufferToggle(openings, closingSelector) {
1246
1064
  const buffer = [];
1247
1065
  buffers.push(buffer);
1248
1066
  const closingSubscription = new tsplus_module_6.Subscription();
1249
-
1250
1067
  const emitBuffer = () => {
1251
1068
  (0, tsplus_module_2.arrayRemove)(buffers, buffer);
1252
1069
  subscriber.next(buffer);
1253
1070
  closingSubscription.unsubscribe();
1254
1071
  };
1255
-
1256
1072
  closingSubscription.add(from_1(closingSelector(openValue)).provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
1257
1073
  next: emitBuffer,
1258
1074
  complete: tsplus_module_2.noop
@@ -1270,7 +1086,6 @@ function bufferToggle(openings, closingSelector) {
1270
1086
  while (buffers.length > 0) {
1271
1087
  subscriber.next(buffers.shift());
1272
1088
  }
1273
-
1274
1089
  subscriber.complete();
1275
1090
  }
1276
1091
  }));
@@ -1280,14 +1095,11 @@ function bufferToggle(openings, closingSelector) {
1280
1095
  /**
1281
1096
  * @tsplus pipeable fncts.observable.Observable bufferWhen
1282
1097
  */
1283
-
1284
-
1285
1098
  function bufferWhen(closingSelector) {
1286
1099
  return fa => {
1287
1100
  return tsplus_module_8.operate_((source, subscriber, environment) => {
1288
1101
  let buffer = null;
1289
1102
  let closingSubscriber = null;
1290
-
1291
1103
  const openBuffer = () => {
1292
1104
  closingSubscriber?.unsubscribe();
1293
1105
  const b = buffer;
@@ -1298,7 +1110,6 @@ function bufferWhen(closingSelector) {
1298
1110
  complete: tsplus_module_2.noop
1299
1111
  }));
1300
1112
  };
1301
-
1302
1113
  openBuffer();
1303
1114
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
1304
1115
  next: value => buffer?.push(value),
@@ -1313,8 +1124,6 @@ function bufferWhen(closingSelector) {
1313
1124
  /**
1314
1125
  * @tsplus pipeable fncts.observable.Observable catchAllCause
1315
1126
  */
1316
-
1317
-
1318
1127
  function catchAllCause_1(f) {
1319
1128
  return self => {
1320
1129
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -1324,7 +1133,6 @@ function catchAllCause_1(f) {
1324
1133
  innerSub = source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
1325
1134
  error: cause => {
1326
1135
  handledResult = from_1(f(cause, catchAllCause_1(f)(source)));
1327
-
1328
1136
  if (innerSub) {
1329
1137
  innerSub.unsubscribe();
1330
1138
  innerSub = null;
@@ -1334,7 +1142,6 @@ function catchAllCause_1(f) {
1334
1142
  }
1335
1143
  }
1336
1144
  }));
1337
-
1338
1145
  if (syncUnsub) {
1339
1146
  innerSub.unsubscribe();
1340
1147
  innerSub = null;
@@ -1346,16 +1153,12 @@ function catchAllCause_1(f) {
1346
1153
  /**
1347
1154
  * @tsplus getter fncts.observable.Observable concatAll
1348
1155
  */
1349
-
1350
-
1351
1156
  function concatAll_1(ffa) {
1352
1157
  return mergeAll_1(1)(ffa);
1353
1158
  }
1354
1159
  /**
1355
1160
  * @tsplus pipeable fncts.observable.Observable concat
1356
1161
  */
1357
-
1358
-
1359
1162
  function concat_1(...sources) {
1360
1163
  return fa => {
1361
1164
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -1366,16 +1169,12 @@ function concat_1(...sources) {
1366
1169
  /**
1367
1170
  * @tsplus getter fncts.observable.Observable count
1368
1171
  */
1369
-
1370
-
1371
1172
  function count(fa) {
1372
1173
  return foldLeft_1(0, (total, _) => total + 1)(fa);
1373
1174
  }
1374
1175
  /**
1375
1176
  * @tsplus pipeable fncts.observable.Observable countWithIndex
1376
1177
  */
1377
-
1378
-
1379
1178
  function countWithIndex_1(predicate) {
1380
1179
  return fa => {
1381
1180
  return foldLeftWithIndex_1(0, (i, total, v) => predicate(i, v) ? total + 1 : total)(fa);
@@ -1384,8 +1183,6 @@ function countWithIndex_1(predicate) {
1384
1183
  /**
1385
1184
  * @tsplus pipeable fncts.observable.Observable countWith
1386
1185
  */
1387
-
1388
-
1389
1186
  function countWith(predicate) {
1390
1187
  return fa => {
1391
1188
  return countWithIndex_1((_, a) => predicate(a))(fa);
@@ -1394,22 +1191,17 @@ function countWith(predicate) {
1394
1191
  /**
1395
1192
  * @tsplus getter fncts.observable.Observable combineLatestAll
1396
1193
  */
1397
-
1398
-
1399
1194
  function combineLatestAll(fa) {
1400
1195
  return joinAllInternal(fa, sources => !sources.length ? empty_1() : zipLatest_1(sources[0], ...sources.slice(1)));
1401
1196
  }
1402
1197
  /**
1403
1198
  * @tsplus pipeable fncts.observable.Observable zipLatest
1404
1199
  */
1405
-
1406
-
1407
1200
  function zipLatest_1(...sources) {
1408
1201
  return self => {
1409
1202
  if (!sources.length) {
1410
1203
  return from_1(self).unsafeCoerce();
1411
1204
  }
1412
-
1413
1205
  return tsplus_module_8.operate_((source, subscriber, environment) => {
1414
1206
  combineLatestInternal(subscriber, environment, [source, ...sources]);
1415
1207
  })(from_1(self));
@@ -1418,8 +1210,6 @@ function zipLatest_1(...sources) {
1418
1210
  /**
1419
1211
  * @tsplus pipeable fncts.observable.Observable zipWithLatest
1420
1212
  */
1421
-
1422
-
1423
1213
  function zipWithLatest(that, f) {
1424
1214
  return self => {
1425
1215
  return map_1(tsplus_module_13.tupled(f))(zipLatest_1(from_1(that))(self));
@@ -1428,18 +1218,14 @@ function zipWithLatest(that, f) {
1428
1218
  /**
1429
1219
  * @tsplus pipeable fncts.observable.Observable debounceWith
1430
1220
  */
1431
-
1432
-
1433
1221
  function debounceWith(durationSelector) {
1434
1222
  return fa => {
1435
1223
  return tsplus_module_8.operate_((source, subscriber, environment) => {
1436
1224
  let lastValue = tsplus_module_17.nothing();
1437
1225
  let durationSubscriber = null;
1438
-
1439
1226
  const emit = () => {
1440
1227
  durationSubscriber?.unsubscribe();
1441
1228
  durationSubscriber = null;
1442
-
1443
1229
  if (tsplus_module_18.isJust(lastValue)) {
1444
1230
  const {
1445
1231
  value
@@ -1448,7 +1234,6 @@ function debounceWith(durationSelector) {
1448
1234
  subscriber.next(value);
1449
1235
  }
1450
1236
  };
1451
-
1452
1237
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
1453
1238
  next: value => {
1454
1239
  durationSubscriber?.unsubscribe();
@@ -1472,15 +1257,12 @@ function debounceWith(durationSelector) {
1472
1257
  /**
1473
1258
  * @tsplus pipeable fncts.observable.Observable debounce
1474
1259
  */
1475
-
1476
-
1477
1260
  function debounce(dueTime, scheduler = tsplus_module_5.asyncScheduler) {
1478
1261
  return fa => {
1479
1262
  return tsplus_module_8.operate_((source, subscriber, environment) => {
1480
1263
  let activeTask = null;
1481
1264
  let lastValue = null;
1482
1265
  let lastTime = null;
1483
-
1484
1266
  const emit = () => {
1485
1267
  if (activeTask) {
1486
1268
  activeTask.unsubscribe();
@@ -1490,25 +1272,20 @@ function debounce(dueTime, scheduler = tsplus_module_5.asyncScheduler) {
1490
1272
  subscriber.next(value);
1491
1273
  }
1492
1274
  };
1493
-
1494
1275
  function emitWhenIdle() {
1495
1276
  const targetTime = lastTime + dueTime;
1496
1277
  const now = scheduler.now();
1497
-
1498
1278
  if (now < targetTime) {
1499
1279
  activeTask = this.schedule(undefined, targetTime - now);
1500
1280
  subscriber.add(activeTask);
1501
1281
  return;
1502
1282
  }
1503
-
1504
1283
  emit();
1505
1284
  }
1506
-
1507
1285
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
1508
1286
  next: value => {
1509
1287
  lastValue = value;
1510
1288
  lastTime = scheduler.now();
1511
-
1512
1289
  if (!activeTask) {
1513
1290
  activeTask = scheduler.schedule(emitWhenIdle, dueTime);
1514
1291
  subscriber.add(activeTask);
@@ -1527,8 +1304,6 @@ function debounce(dueTime, scheduler = tsplus_module_5.asyncScheduler) {
1527
1304
  /**
1528
1305
  * @tsplus getter fncts.observable.Observable either
1529
1306
  */
1530
-
1531
-
1532
1307
  function either(fa) {
1533
1308
  return tsplus_module_8.operate_((source, subscriber, environment) => {
1534
1309
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
@@ -1544,8 +1319,6 @@ function either(fa) {
1544
1319
  /**
1545
1320
  * @tsplus pipeable fncts.observable.Observable delayWithIndex
1546
1321
  */
1547
-
1548
-
1549
1322
  function delayWithIndex_1(f) {
1550
1323
  return fa => {
1551
1324
  return mergeMapWithIndex_1((i, a) => as_1(() => a)(take_1(1)(f(i, a))))(fa);
@@ -1554,8 +1327,6 @@ function delayWithIndex_1(f) {
1554
1327
  /**
1555
1328
  * @tsplus pipeable fncts.observable.Observable delayWith
1556
1329
  */
1557
-
1558
-
1559
1330
  function delayWith_1(f) {
1560
1331
  return fa => {
1561
1332
  return delayWithIndex_1((_, a) => f(a))(fa);
@@ -1564,8 +1335,6 @@ function delayWith_1(f) {
1564
1335
  /**
1565
1336
  * @tsplus pipeable fncts.observable.Observable delay
1566
1337
  */
1567
-
1568
-
1569
1338
  function delay(due, scheduler = tsplus_module_5.asyncScheduler) {
1570
1339
  return fa => {
1571
1340
  const duration = timer_1(due, scheduler);
@@ -1575,8 +1344,6 @@ function delay(due, scheduler = tsplus_module_5.asyncScheduler) {
1575
1344
  /**
1576
1345
  * @tsplus getter fncts.observable.Observable dematerialize
1577
1346
  */
1578
-
1579
-
1580
1347
  function dematerialize(fa) {
1581
1348
  return tsplus_module_8.operate_((source, subscriber, environment) => {
1582
1349
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
@@ -1587,8 +1354,6 @@ function dematerialize(fa) {
1587
1354
  /**
1588
1355
  * @tsplus pipeable fncts.observable.Observable ensuring
1589
1356
  */
1590
-
1591
-
1592
1357
  function ensuring(finalizer) {
1593
1358
  return fa => {
1594
1359
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -1600,8 +1365,6 @@ function ensuring(finalizer) {
1600
1365
  /**
1601
1366
  * @tsplus getter fncts.observable.Observable exhaustAll
1602
1367
  */
1603
-
1604
-
1605
1368
  function exhaustAll(ffa) {
1606
1369
  return tsplus_module_8.operate_((source, subscriber, environment) => {
1607
1370
  let isComplete = false;
@@ -1627,8 +1390,6 @@ function exhaustAll(ffa) {
1627
1390
  /**
1628
1391
  * @tsplus pipeable fncts.observable.Observable exhaustMapWithIndex
1629
1392
  */
1630
-
1631
-
1632
1393
  function exhaustMapWithIndex_1(f) {
1633
1394
  return self => {
1634
1395
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -1658,8 +1419,6 @@ function exhaustMapWithIndex_1(f) {
1658
1419
  /**
1659
1420
  * @tsplus pipeable fncts.observable.Observable exhaustMap
1660
1421
  */
1661
-
1662
-
1663
1422
  function exhaustMap(f) {
1664
1423
  return self => {
1665
1424
  return exhaustMapWithIndex_1((_, a) => f(a))(self);
@@ -1668,8 +1427,6 @@ function exhaustMap(f) {
1668
1427
  /**
1669
1428
  * @tsplus pipeable fncts.observable.Observable expandWithIndex
1670
1429
  */
1671
-
1672
-
1673
1430
  function expandWithIndex_1(f, concurrent = Infinity) {
1674
1431
  return fa => {
1675
1432
  concurrent = (concurrent || 0) < 1 ? Infinity : concurrent;
@@ -1679,38 +1436,31 @@ function expandWithIndex_1(f, concurrent = Infinity) {
1679
1436
  /**
1680
1437
  * @tsplus pipeable fncts.observable.Observable expand
1681
1438
  */
1682
-
1683
-
1684
1439
  function expand(f, concurrent = Infinity) {
1685
1440
  return fa => {
1686
1441
  return expandWithIndex_1((_, a) => f(a), concurrent)(fa);
1687
1442
  };
1688
1443
  }
1689
-
1690
1444
  function findWithIndex_1(predicate) {
1691
1445
  return fa => {
1692
1446
  return tsplus_module_8.operate_(findInternal(predicate, "value"))(fa);
1693
1447
  };
1694
1448
  }
1695
-
1696
1449
  function find(predicate) {
1697
1450
  return fa => {
1698
1451
  return findWithIndex_1((_, a) => predicate(a))(fa);
1699
1452
  };
1700
1453
  }
1701
-
1702
1454
  function findIndexWithIndex_1(predicate) {
1703
1455
  return fa => {
1704
1456
  return tsplus_module_8.operate_(findInternal(predicate, "index"))(fa);
1705
1457
  };
1706
1458
  }
1707
-
1708
1459
  function findIndex(predicate) {
1709
1460
  return fa => {
1710
1461
  return findIndexWithIndex_1((_, a) => predicate(a))(fa);
1711
1462
  };
1712
1463
  }
1713
-
1714
1464
  function forkJoin(...args) {
1715
1465
  const {
1716
1466
  args: sources,
@@ -1718,16 +1468,13 @@ function forkJoin(...args) {
1718
1468
  } = (0, tsplus_module_2.arrayOrObject)(args);
1719
1469
  return new _definition2.Observable(s => {
1720
1470
  const length = sources.length;
1721
-
1722
1471
  if (!length) {
1723
1472
  s.complete();
1724
1473
  return;
1725
1474
  }
1726
-
1727
1475
  const values = new Array(length);
1728
1476
  let remainingCompletions = length;
1729
1477
  let remainingEmissions = length;
1730
-
1731
1478
  for (let sourceIndex = 0; sourceIndex < length; sourceIndex++) {
1732
1479
  let hasValue = false;
1733
1480
  from_1(sources[sourceIndex]).subscribe(tsplus_module_8.operatorSubscriber(s, {
@@ -1736,7 +1483,6 @@ function forkJoin(...args) {
1736
1483
  hasValue = true;
1737
1484
  remainingEmissions--;
1738
1485
  }
1739
-
1740
1486
  values[sourceIndex] = value;
1741
1487
  },
1742
1488
  complete: () => {
@@ -1747,7 +1493,6 @@ function forkJoin(...args) {
1747
1493
  return b;
1748
1494
  }, {}) : values);
1749
1495
  }
1750
-
1751
1496
  s.complete();
1752
1497
  }
1753
1498
  }
@@ -1758,8 +1503,6 @@ function forkJoin(...args) {
1758
1503
  /**
1759
1504
  * @tsplus getter fncts.observable.Observable ignore
1760
1505
  */
1761
-
1762
-
1763
1506
  function ignore(fa) {
1764
1507
  return tsplus_module_8.operate_((source, subscriber, environment) => {
1765
1508
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
@@ -1770,8 +1513,6 @@ function ignore(fa) {
1770
1513
  /**
1771
1514
  * @tsplus getter fncts.observable.Observable isEmpty
1772
1515
  */
1773
-
1774
-
1775
1516
  function isEmpty(fa) {
1776
1517
  return tsplus_module_8.operate_((source, subscriber, environment) => {
1777
1518
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
@@ -1789,8 +1530,6 @@ function isEmpty(fa) {
1789
1530
  /**
1790
1531
  * @tsplus getter fncts.observable.Observable materialize
1791
1532
  */
1792
-
1793
-
1794
1533
  function materialize(fa) {
1795
1534
  return tsplus_module_8.operate_((source, subscriber, environment) => {
1796
1535
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
@@ -1809,8 +1548,6 @@ function materialize(fa) {
1809
1548
  /**
1810
1549
  * @tsplus pipeable fncts.observable.Observable mergeAll
1811
1550
  */
1812
-
1813
-
1814
1551
  function mergeAll_1(concurrent = Infinity) {
1815
1552
  return self => {
1816
1553
  return mergeMap_1(tsplus_module_13.identity, concurrent)(self);
@@ -1819,8 +1556,6 @@ function mergeAll_1(concurrent = Infinity) {
1819
1556
  /**
1820
1557
  * @tsplus pipeable fncts.observable.Observable mergeScanWithIndex
1821
1558
  */
1822
-
1823
-
1824
1559
  function mergeScanWithIndex_1(initial, f, concurrent = Infinity) {
1825
1560
  return fa => {
1826
1561
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -1834,30 +1569,24 @@ function mergeScanWithIndex_1(initial, f, concurrent = Infinity) {
1834
1569
  /**
1835
1570
  * @tsplus pipeable fncts.observable.Observable mergeScan
1836
1571
  */
1837
-
1838
-
1839
1572
  function mergeScan(initial, f, concurrent = Infinity) {
1840
1573
  return fa => {
1841
1574
  return mergeScanWithIndex_1(initial, (_, b, a) => f(b, a), concurrent)(fa);
1842
1575
  };
1843
1576
  }
1844
-
1845
1577
  function onErrorResumeNext(fa, ...sources) {
1846
1578
  return tsplus_module_8.operate_((source, subscriber, environment) => {
1847
1579
  const remaining = [source, ...sources];
1848
-
1849
1580
  const subscribeNext = () => {
1850
1581
  if (!subscriber.closed) {
1851
1582
  if (remaining.length > 0) {
1852
1583
  let nextSource;
1853
-
1854
1584
  try {
1855
1585
  nextSource = from_1(remaining.shift());
1856
1586
  } catch (err) {
1857
1587
  subscribeNext();
1858
1588
  return;
1859
1589
  }
1860
-
1861
1590
  const innerSub = tsplus_module_8.operatorSubscriber(subscriber, {
1862
1591
  error: tsplus_module_2.noop,
1863
1592
  complete: tsplus_module_2.noop
@@ -1869,15 +1598,12 @@ function onErrorResumeNext(fa, ...sources) {
1869
1598
  }
1870
1599
  }
1871
1600
  };
1872
-
1873
1601
  subscribeNext();
1874
1602
  })(fa);
1875
1603
  }
1876
1604
  /**
1877
1605
  * @tsplus pipeable fncts.observable.Observable onEmpty
1878
1606
  */
1879
-
1880
-
1881
1607
  function onEmpty_1(f) {
1882
1608
  return fa => {
1883
1609
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -1891,7 +1617,6 @@ function onEmpty_1(f) {
1891
1617
  if (!hasValue) {
1892
1618
  subscriber.next(f());
1893
1619
  }
1894
-
1895
1620
  subscriber.complete();
1896
1621
  }
1897
1622
  }));
@@ -1901,14 +1626,11 @@ function onEmpty_1(f) {
1901
1626
  /**
1902
1627
  * @tsplus pipeable fncts.observable.Observable repeat
1903
1628
  */
1904
-
1905
-
1906
1629
  function repeat(count = Infinity) {
1907
1630
  return fa => {
1908
1631
  return count <= 0 ? empty_1() : tsplus_module_8.operate_((source, subscriber, environment) => {
1909
1632
  let repeats = 0;
1910
1633
  let innerSub;
1911
-
1912
1634
  const loop = () => {
1913
1635
  let syncUnsub = false;
1914
1636
  innerSub = source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
@@ -1926,23 +1648,19 @@ function repeat(count = Infinity) {
1926
1648
  }
1927
1649
  }
1928
1650
  }));
1929
-
1930
1651
  if (syncUnsub) {
1931
1652
  innerSub.unsubscribe();
1932
1653
  innerSub = null;
1933
1654
  loop();
1934
1655
  }
1935
1656
  };
1936
-
1937
1657
  loop();
1938
1658
  })(fa);
1939
1659
  };
1940
1660
  }
1941
-
1942
1661
  function retry(configOrCount = Infinity) {
1943
1662
  return fa => {
1944
1663
  let config;
1945
-
1946
1664
  if (configOrCount && typeof configOrCount === "object") {
1947
1665
  config = configOrCount;
1948
1666
  } else {
@@ -1950,7 +1668,6 @@ function retry(configOrCount = Infinity) {
1950
1668
  count: configOrCount
1951
1669
  };
1952
1670
  }
1953
-
1954
1671
  const {
1955
1672
  count,
1956
1673
  resetOnSuccess = false
@@ -1958,7 +1675,6 @@ function retry(configOrCount = Infinity) {
1958
1675
  return count <= 0 ? fa : tsplus_module_8.operate_((source, subscriber, environment) => {
1959
1676
  let retries = 0;
1960
1677
  let innerSub;
1961
-
1962
1678
  const loop = () => {
1963
1679
  let syncUnsub = false;
1964
1680
  innerSub = source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
@@ -1966,7 +1682,6 @@ function retry(configOrCount = Infinity) {
1966
1682
  if (resetOnSuccess) {
1967
1683
  retries = 0;
1968
1684
  }
1969
-
1970
1685
  subscriber.next(value);
1971
1686
  },
1972
1687
  error: err => {
@@ -1983,14 +1698,12 @@ function retry(configOrCount = Infinity) {
1983
1698
  }
1984
1699
  }
1985
1700
  }));
1986
-
1987
1701
  if (syncUnsub) {
1988
1702
  innerSub.unsubscribe();
1989
1703
  innerSub = null;
1990
1704
  loop();
1991
1705
  }
1992
1706
  };
1993
-
1994
1707
  loop();
1995
1708
  })(fa);
1996
1709
  };
@@ -1998,8 +1711,6 @@ function retry(configOrCount = Infinity) {
1998
1711
  /**
1999
1712
  * @tsplus pipeable fncts.observable.Observable sample
2000
1713
  */
2001
-
2002
-
2003
1714
  function sample_1(notifier) {
2004
1715
  return fa => {
2005
1716
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -2011,7 +1722,6 @@ function sample_1(notifier) {
2011
1722
  lastValue = value;
2012
1723
  }
2013
1724
  }));
2014
-
2015
1725
  const emit = () => {
2016
1726
  if (hasValue) {
2017
1727
  hasValue = false;
@@ -2020,7 +1730,6 @@ function sample_1(notifier) {
2020
1730
  subscriber.next(value);
2021
1731
  }
2022
1732
  };
2023
-
2024
1733
  notifier.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
2025
1734
  next: emit,
2026
1735
  complete: tsplus_module_2.noop
@@ -2031,8 +1740,6 @@ function sample_1(notifier) {
2031
1740
  /**
2032
1741
  * @tsplus pipeable fncts.observable.Observable sampleTime
2033
1742
  */
2034
-
2035
-
2036
1743
  function sampleTime(period, scheduler = tsplus_module_5.asyncScheduler) {
2037
1744
  return fa => {
2038
1745
  return sample_1(interval_1(period, scheduler))(fa);
@@ -2041,8 +1748,6 @@ function sampleTime(period, scheduler = tsplus_module_5.asyncScheduler) {
2041
1748
  /**
2042
1749
  * @tsplus pipeable fncts.observable.Observable scanLeftWithIndex
2043
1750
  */
2044
-
2045
-
2046
1751
  function scanLeftWithIndex_1(initial, f) {
2047
1752
  return fa => {
2048
1753
  return tsplus_module_8.operate_(scanInternal(f, initial, true, true))(fa);
@@ -2051,8 +1756,6 @@ function scanLeftWithIndex_1(initial, f) {
2051
1756
  /**
2052
1757
  * @tsplus pipeable fncts.observable.Observable scanLeft
2053
1758
  */
2054
-
2055
-
2056
1759
  function scanLeft(initial, f) {
2057
1760
  return fa => {
2058
1761
  return scanLeftWithIndex_1(initial, (_, b, a) => f(b, a))(fa);
@@ -2061,38 +1764,24 @@ function scanLeft(initial, f) {
2061
1764
  /**
2062
1765
  * @tsplus static fncts.observable.ObservableOps service
2063
1766
  */
2064
-
2065
-
2066
- function service(
2067
- /** @tsplus auto */
2068
- tag) {
1767
+ function service( /** @tsplus auto */tag) {
2069
1768
  return serviceWithObservable_1(service => of_1(service), tag);
2070
1769
  }
2071
1770
  /**
2072
1771
  * @tsplus static fncts.observable.ObservableOps serviceWith
2073
1772
  */
2074
-
2075
-
2076
- function serviceWith(f,
2077
- /** @tsplus auto */
2078
- tag) {
1773
+ function serviceWith(f, /** @tsplus auto */tag) {
2079
1774
  return serviceWithObservable_1(service => of_1(f(service)), tag);
2080
1775
  }
2081
1776
  /**
2082
1777
  * @tsplus static fncts.observable.ObservableOps serviceWithObservable
2083
1778
  */
2084
-
2085
-
2086
- function serviceWithObservable_1(f,
2087
- /** @tsplus auto */
2088
- tag) {
1779
+ function serviceWithObservable_1(f, /** @tsplus auto */tag) {
2089
1780
  return environmentWithObservable_1(environment => f(tsplus_module_16.unsafeGet(tag)(environment)));
2090
1781
  }
2091
1782
  /**
2092
1783
  * @tsplus pipeable fncts.observable.Observable skip
2093
1784
  */
2094
-
2095
-
2096
1785
  function skip(count) {
2097
1786
  return fa => {
2098
1787
  return filterWithIndex_1((index, _) => count <= index)(fa);
@@ -2101,8 +1790,6 @@ function skip(count) {
2101
1790
  /**
2102
1791
  * @tsplus pipeable fncts.observable.Observable skipLast
2103
1792
  */
2104
-
2105
-
2106
1793
  function skipLast(skipCount) {
2107
1794
  return fa => {
2108
1795
  return skipCount <= 0 ? fa : tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -2111,7 +1798,6 @@ function skipLast(skipCount) {
2111
1798
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
2112
1799
  next: value => {
2113
1800
  const valueIndex = seen++;
2114
-
2115
1801
  if (valueIndex < skipCount) {
2116
1802
  ring[valueIndex] = value;
2117
1803
  } else {
@@ -2131,8 +1817,6 @@ function skipLast(skipCount) {
2131
1817
  /**
2132
1818
  * @tsplus pipeable fncts.observable.Observable skipUntil
2133
1819
  */
2134
-
2135
-
2136
1820
  function skipUntil(notifier) {
2137
1821
  return fa => {
2138
1822
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -2154,8 +1838,6 @@ function skipUntil(notifier) {
2154
1838
  /**
2155
1839
  * @tsplus pipeable fncts.observable.Observable skipWhile
2156
1840
  */
2157
-
2158
-
2159
1841
  function skipWhile(predicate) {
2160
1842
  return fa => {
2161
1843
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -2170,8 +1852,6 @@ function skipWhile(predicate) {
2170
1852
  /**
2171
1853
  * @tsplus pipeable fncts.observable.Observable startWith
2172
1854
  */
2173
-
2174
-
2175
1855
  function startWith(...values) {
2176
1856
  return fa => {
2177
1857
  return tsplus_module_8.operate_((source, subscriber) => {
@@ -2183,8 +1863,6 @@ function startWith(...values) {
2183
1863
  /**
2184
1864
  * @tsplus pipeable fncts.observable.Observable subscribeOn
2185
1865
  */
2186
-
2187
-
2188
1866
  function subscribeOn(scheduler, delay = 0) {
2189
1867
  return fa => {
2190
1868
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -2195,25 +1873,19 @@ function subscribeOn(scheduler, delay = 0) {
2195
1873
  /**
2196
1874
  * @tsplus getter fncts.observable.Observable switchAll
2197
1875
  */
2198
-
2199
-
2200
1876
  function switchAll(ffa) {
2201
1877
  return switchMap_1(tsplus_module_13.identity)(ffa);
2202
1878
  }
2203
1879
  /**
2204
1880
  * @tsplus pipeable fncts.observable.Observable switchMapWithIndex
2205
1881
  */
2206
-
2207
-
2208
1882
  function switchMapWithIndex_1(f) {
2209
1883
  return fa => {
2210
1884
  return tsplus_module_8.operate_((source, subscriber, environment) => {
2211
1885
  let innerSubscriber = null;
2212
1886
  let index = 0;
2213
1887
  let isComplete = false;
2214
-
2215
1888
  const checkComplete = () => isComplete && !innerSubscriber && subscriber.complete();
2216
-
2217
1889
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
2218
1890
  next: value => {
2219
1891
  innerSubscriber?.unsubscribe();
@@ -2236,8 +1908,6 @@ function switchMapWithIndex_1(f) {
2236
1908
  /**
2237
1909
  * @tsplus pipeable fncts.observable.Observable switchMap
2238
1910
  */
2239
-
2240
-
2241
1911
  function switchMap_1(f) {
2242
1912
  return fa => {
2243
1913
  return switchMapWithIndex_1((_, a) => f(a))(fa);
@@ -2246,8 +1916,6 @@ function switchMap_1(f) {
2246
1916
  /**
2247
1917
  * @tsplus pipeable fncts.observable.Observable switchScanWithIndex
2248
1918
  */
2249
-
2250
-
2251
1919
  function switchScanWithIndex_1(initial, f) {
2252
1920
  return fa => {
2253
1921
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -2262,8 +1930,6 @@ function switchScanWithIndex_1(initial, f) {
2262
1930
  /**
2263
1931
  * @tsplus pipeable fncts.observable.Observable switchScan
2264
1932
  */
2265
-
2266
-
2267
1933
  function switchScan(initial, f) {
2268
1934
  return fa => {
2269
1935
  return switchScanWithIndex_1(initial, (_, b, a) => f(b, a))(fa);
@@ -2272,8 +1938,6 @@ function switchScan(initial, f) {
2272
1938
  /**
2273
1939
  * @tsplus pipeable fncts.observable.Observable take
2274
1940
  */
2275
-
2276
-
2277
1941
  function take_1(count) {
2278
1942
  return fa => {
2279
1943
  return count <= 0 ? empty_1() : tsplus_module_8.operate_((source, sub, environment) => {
@@ -2282,7 +1946,6 @@ function take_1(count) {
2282
1946
  next: value => {
2283
1947
  if (++seen <= count) {
2284
1948
  sub.next(value);
2285
-
2286
1949
  if (count <= seen) {
2287
1950
  sub.complete();
2288
1951
  }
@@ -2295,8 +1958,6 @@ function take_1(count) {
2295
1958
  /**
2296
1959
  * @tsplus pipeable fncts.observable.Observable takeLast
2297
1960
  */
2298
-
2299
-
2300
1961
  function takeLast(count) {
2301
1962
  return fa => {
2302
1963
  return count <= 0 ? empty_1() : tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -2310,7 +1971,6 @@ function takeLast(count) {
2310
1971
  for (const value of buffer) {
2311
1972
  subscriber.next(value);
2312
1973
  }
2313
-
2314
1974
  subscriber.complete();
2315
1975
  }
2316
1976
  }, () => {
@@ -2322,8 +1982,6 @@ function takeLast(count) {
2322
1982
  /**
2323
1983
  * @tsplus pipeable fncts.observable.Observable takeUntil
2324
1984
  */
2325
-
2326
-
2327
1985
  function takeUntil(notifier) {
2328
1986
  return fa => {
2329
1987
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -2335,7 +1993,6 @@ function takeUntil(notifier) {
2335
1993
  })(fa);
2336
1994
  };
2337
1995
  }
2338
-
2339
1996
  function takeWhileWithIndex_1(predicate, inclusive) {
2340
1997
  return fa => {
2341
1998
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -2350,7 +2007,6 @@ function takeWhileWithIndex_1(predicate, inclusive) {
2350
2007
  })(fa);
2351
2008
  };
2352
2009
  }
2353
-
2354
2010
  function takeWhile(predicate, inclusive) {
2355
2011
  return fa => {
2356
2012
  return takeWhileWithIndex_1((_, a) => predicate(a), inclusive)(fa);
@@ -2359,8 +2015,6 @@ function takeWhile(predicate, inclusive) {
2359
2015
  /**
2360
2016
  * @tsplus pipeable fncts.observable.Observable tap
2361
2017
  */
2362
-
2363
-
2364
2018
  function tap(observer) {
2365
2019
  return fa => {
2366
2020
  return tsplus_module_8.operate_((source, subscriber, environment) => {
@@ -2381,7 +2035,6 @@ function tap(observer) {
2381
2035
  })(fa);
2382
2036
  };
2383
2037
  }
2384
-
2385
2038
  const defaultThrottleConfig = {
2386
2039
  leading: true,
2387
2040
  trailing: false
@@ -2389,9 +2042,7 @@ const defaultThrottleConfig = {
2389
2042
  /**
2390
2043
  * @tsplus pipeable fncts.observable.Observable throttle
2391
2044
  */
2392
-
2393
2045
  exports.defaultThrottleConfig = defaultThrottleConfig;
2394
-
2395
2046
  function throttle_1(durationSelector, {
2396
2047
  leading,
2397
2048
  trailing
@@ -2401,27 +2052,22 @@ function throttle_1(durationSelector, {
2401
2052
  let sendValue = tsplus_module_17.nothing();
2402
2053
  let throttled = null;
2403
2054
  let isComplete = false;
2404
-
2405
2055
  const endThrottling = () => {
2406
2056
  throttled?.unsubscribe();
2407
2057
  throttled = null;
2408
-
2409
2058
  if (trailing) {
2410
2059
  send();
2411
2060
  isComplete && subscriber.complete();
2412
2061
  }
2413
2062
  };
2414
-
2415
2063
  const cleanupThrottling = () => {
2416
2064
  throttled = null;
2417
2065
  isComplete && subscriber.complete();
2418
2066
  };
2419
-
2420
2067
  const startThrottling = value => throttled = from_1(durationSelector(value)).provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
2421
2068
  next: endThrottling,
2422
2069
  complete: cleanupThrottling
2423
2070
  }));
2424
-
2425
2071
  const send = () => {
2426
2072
  if (tsplus_module_18.isJust(sendValue)) {
2427
2073
  const {
@@ -2432,7 +2078,6 @@ function throttle_1(durationSelector, {
2432
2078
  !isComplete && startThrottling(value);
2433
2079
  }
2434
2080
  };
2435
-
2436
2081
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
2437
2082
  next: value => {
2438
2083
  sendValue = tsplus_module_17.just(value);
@@ -2449,26 +2094,20 @@ function throttle_1(durationSelector, {
2449
2094
  /**
2450
2095
  * @tsplus pipeable fncts.observable.Observable throttleTime
2451
2096
  */
2452
-
2453
-
2454
2097
  function throttleTime(duration, scheduler = tsplus_module_5.asyncScheduler, config = defaultThrottleConfig) {
2455
2098
  return fa => {
2456
2099
  const duration$ = timer_1(duration, scheduler);
2457
2100
  return throttle_1(() => duration$, config)(fa);
2458
2101
  };
2459
2102
  }
2460
-
2461
2103
  class TimeoutError extends Error {
2462
2104
  constructor(info) {
2463
2105
  super("Timeout has occurred");
2464
2106
  this.info = info;
2465
2107
  this.name = "TimeoutError";
2466
2108
  }
2467
-
2468
2109
  }
2469
-
2470
2110
  exports.TimeoutError = TimeoutError;
2471
-
2472
2111
  function timeout(config) {
2473
2112
  return fa => {
2474
2113
  const {
@@ -2484,7 +2123,6 @@ function timeout(config) {
2484
2123
  let timerSubscription;
2485
2124
  let lastValue = tsplus_module_17.nothing();
2486
2125
  let seen = 0;
2487
-
2488
2126
  const startTimer = delay => {
2489
2127
  timerSubscription = (0, tsplus_module_7.caughtSchedule)(subscriber, scheduler, () => {
2490
2128
  originalSourceSubscription.unsubscribe();
@@ -2495,7 +2133,6 @@ function timeout(config) {
2495
2133
  })).provideEnvironment(environment).subscribe(subscriber);
2496
2134
  }, delay);
2497
2135
  };
2498
-
2499
2136
  originalSourceSubscription = source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
2500
2137
  next: value => {
2501
2138
  timerSubscription?.unsubscribe();
@@ -2508,26 +2145,21 @@ function timeout(config) {
2508
2145
  if (!timerSubscription?.closed) {
2509
2146
  timerSubscription?.unsubscribe();
2510
2147
  }
2511
-
2512
2148
  lastValue = tsplus_module_17.nothing();
2513
2149
  }));
2514
2150
  startTimer(first != null ? typeof first === "number" ? first : +first - scheduler.now() : each);
2515
2151
  })(fa);
2516
2152
  };
2517
2153
  }
2518
-
2519
2154
  function timeoutError(info) {
2520
2155
  return fail_1(new TimeoutError(info));
2521
2156
  }
2522
-
2523
2157
  function toArrayAccumulator(arr, value) {
2524
2158
  return arr.push(value), arr;
2525
2159
  }
2526
2160
  /**
2527
2161
  * @tsplus getter fncts.observable.Observable toArray
2528
2162
  */
2529
-
2530
-
2531
2163
  function toArray_1(fa) {
2532
2164
  return tsplus_module_8.operate_((source, subscriber, environment) => {
2533
2165
  foldLeft_1([], toArrayAccumulator)(source).provideEnvironment(environment).subscribe(subscriber);
@@ -2536,16 +2168,13 @@ function toArray_1(fa) {
2536
2168
  /**
2537
2169
  * @tsplus pipeable fncts.observable.Observable unique
2538
2170
  */
2539
-
2540
-
2541
2171
  function unique(toKey, flushes) {
2542
2172
  return fa => {
2543
2173
  return tsplus_module_8.operate_((source, subscriber, environment) => {
2544
- let distinctKeys = tsplus_module_21.makeDefault();
2174
+ let distinctKeys = tsplus_module_21.empty();
2545
2175
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
2546
2176
  next: value => {
2547
2177
  const key = toKey ? toKey(value) : value;
2548
-
2549
2178
  if (!tsplus_module_21.has(key)(distinctKeys)) {
2550
2179
  tsplus_module_21.add(key)(distinctKeys);
2551
2180
  subscriber.next(value);
@@ -2553,13 +2182,12 @@ function unique(toKey, flushes) {
2553
2182
  }
2554
2183
  }));
2555
2184
  flushes?.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
2556
- next: () => distinctKeys = tsplus_module_21.makeDefault(),
2185
+ next: () => distinctKeys = tsplus_module_21.empty(),
2557
2186
  complete: tsplus_module_2.noop
2558
2187
  }));
2559
2188
  })(fa);
2560
2189
  };
2561
2190
  }
2562
-
2563
2191
  function uniqueUntilChanged_1(E, keySelector = tsplus_module_13.identity) {
2564
2192
  return fa => {
2565
2193
  const compare = "equals" in E ? E.equals : E;
@@ -2569,7 +2197,6 @@ function uniqueUntilChanged_1(E, keySelector = tsplus_module_13.identity) {
2569
2197
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
2570
2198
  next: value => {
2571
2199
  const currentKey = keySelector(value);
2572
-
2573
2200
  if (first || !compare(previousKey, currentKey)) {
2574
2201
  first = false;
2575
2202
  previousKey = currentKey;
@@ -2580,14 +2207,13 @@ function uniqueUntilChanged_1(E, keySelector = tsplus_module_13.identity) {
2580
2207
  })(fa);
2581
2208
  };
2582
2209
  }
2583
-
2584
2210
  function uniqueUntilKeyChanged(key, equals) {
2585
- return fa => {
2586
- const compare = "equals" in equals ? equals.equals : equals;
2587
- return uniqueUntilChanged_1((x, y) => compare(x[key], y[key]))(fa);
2588
- };
2211
+ if ("equals" in equals) {
2212
+ return fa => uniqueUntilChanged_1((x, y) => equals.equals(y[key])(x[key]))(fa);
2213
+ } else {
2214
+ return fa => uniqueUntilChanged_1((x, y) => equals(x[key], y[key]))(fa);
2215
+ }
2589
2216
  }
2590
-
2591
2217
  function combineLatestInternal(subscriber, environment, observables, scheduler, valueTransform = tsplus_module_13.identity) {
2592
2218
  return maybeSchedule(subscriber, scheduler, () => {
2593
2219
  const {
@@ -2596,7 +2222,6 @@ function combineLatestInternal(subscriber, environment, observables, scheduler,
2596
2222
  const values = new Array(length);
2597
2223
  let active = length;
2598
2224
  let remainingFirstValues = length;
2599
-
2600
2225
  for (let i = 0; i < length; i++) {
2601
2226
  maybeSchedule(subscriber, scheduler, () => {
2602
2227
  const source = scheduler ? scheduled_1(scheduler)(observables[i]) : from_1(observables[i]);
@@ -2604,12 +2229,10 @@ function combineLatestInternal(subscriber, environment, observables, scheduler,
2604
2229
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
2605
2230
  next: value => {
2606
2231
  values[i] = value;
2607
-
2608
2232
  if (!hasFirstValue) {
2609
2233
  hasFirstValue = true;
2610
2234
  remainingFirstValues--;
2611
2235
  }
2612
-
2613
2236
  if (!remainingFirstValues) {
2614
2237
  subscriber.next(valueTransform(values.slice()));
2615
2238
  }
@@ -2624,7 +2247,6 @@ function combineLatestInternal(subscriber, environment, observables, scheduler,
2624
2247
  }
2625
2248
  });
2626
2249
  }
2627
-
2628
2250
  function findInternal(predicate, emit) {
2629
2251
  const findIndex = emit === "index";
2630
2252
  return (source, subscriber, environment) => {
@@ -2632,7 +2254,6 @@ function findInternal(predicate, emit) {
2632
2254
  source.provideEnvironment(environment).subscribe(tsplus_module_8.operatorSubscriber(subscriber, {
2633
2255
  next: value => {
2634
2256
  const i = index++;
2635
-
2636
2257
  if (predicate(index++, value)) {
2637
2258
  subscriber.next(findIndex ? i : tsplus_module_17.just(value));
2638
2259
  subscriber.complete();
@@ -2645,11 +2266,9 @@ function findInternal(predicate, emit) {
2645
2266
  }));
2646
2267
  };
2647
2268
  }
2648
-
2649
2269
  function joinAllInternal(fa, joiner) {
2650
2270
  return mergeMap_1(joiner)(toArray_1(fa));
2651
2271
  }
2652
-
2653
2272
  function maybeSchedule(subscription, scheduler, execute) {
2654
2273
  if (scheduler) {
2655
2274
  subscription.add(scheduler.schedule(execute));
@@ -2657,21 +2276,17 @@ function maybeSchedule(subscription, scheduler, execute) {
2657
2276
  execute();
2658
2277
  }
2659
2278
  }
2660
-
2661
2279
  function mergeInternal(source, subscriber, environment, f, concurrent, onBeforeNext, expand, innerSubScheduler, additionalTeardown) {
2662
2280
  const buffer = [];
2663
2281
  let active = 0;
2664
2282
  let index = 0;
2665
2283
  let isComplete = false;
2666
-
2667
2284
  const checkComplete = () => {
2668
2285
  if (isComplete && !buffer.length && !active) {
2669
2286
  subscriber.complete();
2670
2287
  }
2671
2288
  };
2672
-
2673
2289
  const outerNext = a => active < concurrent ? doInnerSub(a) : buffer.push(a);
2674
-
2675
2290
  const doInnerSub = a => {
2676
2291
  expand && subscriber.next(a);
2677
2292
  active++;
@@ -2679,7 +2294,6 @@ function mergeInternal(source, subscriber, environment, f, concurrent, onBeforeN
2679
2294
  from_1(f(index++, a)).provideEnvironment(environment).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
2680
2295
  next: b => {
2681
2296
  onBeforeNext?.(b);
2682
-
2683
2297
  if (expand) {
2684
2298
  outerNext(b);
2685
2299
  } else {
@@ -2693,12 +2307,10 @@ function mergeInternal(source, subscriber, environment, f, concurrent, onBeforeN
2693
2307
  if (innerComplete) {
2694
2308
  try {
2695
2309
  active--;
2696
-
2697
2310
  while (buffer.length && active < concurrent) {
2698
2311
  const bufferedValue = buffer.shift();
2699
2312
  innerSubScheduler ? subscriber.add(innerSubScheduler.schedule(() => doInnerSub(bufferedValue))) : doInnerSub(bufferedValue);
2700
2313
  }
2701
-
2702
2314
  checkComplete();
2703
2315
  } catch (err) {
2704
2316
  subscriber.error(tsplus_module_1.halt(err));
@@ -2706,7 +2318,6 @@ function mergeInternal(source, subscriber, environment, f, concurrent, onBeforeN
2706
2318
  }
2707
2319
  }));
2708
2320
  };
2709
-
2710
2321
  source.provideEnvironment(environment).subscribe(new tsplus_module_8.OperatorSubscriber(subscriber, {
2711
2322
  next: outerNext,
2712
2323
  complete: () => {
@@ -2718,7 +2329,6 @@ function mergeInternal(source, subscriber, environment, f, concurrent, onBeforeN
2718
2329
  additionalTeardown?.();
2719
2330
  };
2720
2331
  }
2721
-
2722
2332
  function scanInternal(f, initial, hasInitial, emitOnNext, emitBeforeComplete) {
2723
2333
  return (source, subscriber, environment) => {
2724
2334
  let hasState = hasInitial;