PURE_IMPORTS_START _Observable,_Subscription,_symbol_iterator,_util_subscribeToIterable PURE_IMPORTS_END
505053
function fromIterable(input, scheduler) {
    if (!input) {
        throw new Error('Iterable cannot be null');
    }
    if (!scheduler) {
        return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeToIterable__WEBPACK_IMPORTED_MODULE_3__["subscribeToIterable"])(input));
    }
    else {
        return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
            var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"]();
            var iterator;
            sub.add(function () {
                if (iterator && typeof iterator.return === 'function') {
                    iterator.return();
                }
            });
            sub.add(scheduler.schedule(function () {
                iterator = input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_2__["iterator"]]();
                sub.add(scheduler.schedule(function () {
                    if (subscriber.closed) {
                        return;
                    }
                    var value;
                    var done;
                    try {
                        var result = iterator.next();
                        value = result.value;
                        done = result.done;
                    }
                    catch (err) {
                        subscriber.error(err);
                        return;
                    }
                    if (done) {
                        subscriber.complete();
                    }
                    else {
                        subscriber.next(value);
                        this.schedule();
                    }
                }));
            }));
            return sub;
        });
    }
}
968373
function subscribe() {
    console.log(' > ', 'init', ['xmlrpc_bin://' + thisHost + ':2031', 'test123']);
    rpcClient.methodCall('init', ['xmlrpc_bin://' + thisHost + ':2031', 'test123'], function (err, res) {
        console.log(err, res);
    });
}
255494
function zip() {
    var observables = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        observables[_i] = arguments[_i];
    }
    return function zipOperatorFunction(source) {
        return source.lift.call(_observable_zip__WEBPACK_IMPORTED_MODULE_0__["zip"].apply(void 0, [source].concat(observables)));
    };
}
363367
function preR3InjectableCompile(injectableType, options) {
    if (options && options.providedIn !== undefined && injectableType.ngInjectableDef === undefined) {
        injectableType.ngInjectableDef = defineInjectable({
            providedIn: options.providedIn,
            factory: convertInjectableProviderToFactory(injectableType, options),
        });
    }
}
208086
function computedBeginDependencyDetectionCallback(subscribable, id) {
    var computedObservable = this.computedObservable,
        state = computedObservable[computedState];
    if (!state.isDisposed) {
        if (this.disposalCount && this.disposalCandidates[id]) {
            // Don't want to dispose this subscription, as it's still being used
            computedObservable.addDependencyTracking(id, subscribable, this.disposalCandidates[id]);
            this.disposalCandidates[id] = null; // No need to actually delete the property - disposalCandidates is a transient object anyway
            --this.disposalCount;
        } else if (!state.dependencyTracking[id]) {
            // Brand new subscription - add it
            computedObservable.addDependencyTracking(id, subscribable, state.isSleeping ? { _target: subscribable } : computedObservable.subscribeToDependency(subscribable));
        }
        // If the observable we've accessed has a pending notification, ensure we get notified of the actual final value (bypass equality checks)
        if (subscribable._notificationIsPending) {
            subscribable._notifyNextChangeIfValueIsDifferent();
        }
    }
}
479821
static Completable wrap(
            CompletableSource source, Collection<ReactiveInstrumenter> instrumentations) {
        if (source instanceof Callable) {
            return new RxInstrumentedCallableCompletable<>(source, instrumentations);
        }
        return new RxInstrumentedCompletable(source, instrumentations);
    }
224174
private Observable<Boolean> init(@NonNull final Application application, @NonNull final CallbackAdapter adapter) {

        final Looper mainLooper = Looper.getMainLooper();

        return Observable.create(sub -> {

            try {

                //logging
                final LogConfig logConfig = config.getLogConfig() != null ? config.getLogConfig() : LogConfig.getProductionConfig();
                logMgr.init(application.getApplicationContext(), logConfig.getConsoleLevel().getValue(), logConfig.getFileLevel().getValue(), config.getLogSizeLimit());
                log = new Logger(logMgr, LogConstants.TAG + "_" + BaseComapi.getVersion());
                log.i("Comapi SDK " + BaseComapi.getVersion() + " client " + this.hashCode() + " initialising on " + (Thread.currentThread() == Looper.getMainLooper().getThread() ? "main thread." : "background thread."));

                //public listeners
                listenerListAdapter = new ListenerListAdapter(log);
                listenerListAdapter.addListener(config.getMessagingListener());
                listenerListAdapter.addListener(config.getStateListener());
                listenerListAdapter.addListener(config.getProfileListener());

                //data
                dataMgr.init(application, config.getApiSpaceId(), log);
                dataMgr.getDeviceDAO().setApiSpaceId(config.getApiSpaceId());

                //push
                pushMgr.init(application.getApplicationContext(), new Handler(mainLooper), log, config.getPushTokenProvider(), token -> {
                    log.d("Refreshed push token is " + token);
                    if (!TextUtils.isEmpty(token)) {
                        dataMgr.getDeviceDAO().setPushToken(token);
                    }
                }, config.getPushMessageListener());

                //API baseURIs, proxy
                APIConfig.BaseURIs baseURIs = APIConfig.BaseURIs.build(config.getApiConfig(), config.getApiSpaceId(), log);
                if (baseURIs.getProxy() != null) {
                    log.i("Proxy address has been set for COMAPI initialisation.");
                }

                //services
                service = new InternalService(adapter, dataMgr, pushMgr, config.getApiSpaceId(), application.getPackageName(), log);
                RestApi restApi = service.initialiseRestClient(logConfig.getNetworkLevel().getValue(), baseURIs);
                SessionController sessionController = service.initialiseSessionController(
                        new SessionCreateManager(new AtomicBoolean()),
                        pushMgr,
                        state,
                        config.getAuthenticator(),
                        restApi, new Handler(mainLooper),
                        config.isFcmEnabled(),
                        listenerListAdapter);

                //sockets
                SocketController socketController = service.initialiseSocketClient(sessionController, listenerListAdapter, baseURIs);
                lifecycleListeners.add(socketController.createLifecycleListener());
                initialiseLifecycleObserver(application);

                sub.onNext(state.compareAndSet(GlobalState.INITIALISING, GlobalState.INITIALISED));
                sub.onCompleted();

            } catch (Exception e) {
                state.compareAndSet(GlobalState.INITIALISING, GlobalState.NOT_INITIALISED);
                sub.onError(e);
            }
        });
    }
441127
public static <InnerT> Observable<InnerT> convertListToInnerAsync(Observable<List<InnerT>> innerList) {
        return innerList.flatMap(new Func1<List<InnerT>, Observable<InnerT>>() {
            @Override
            public Observable<InnerT> call(List<InnerT> inners) {
                return Observable.from(inners);
            }
        });
    }
1277958
private function start()
    {
        Loop\queue(function () { // Asynchronously start the observable.
            if (null === $this->emitter) {
                return;
            }

            /**
             * Emits a value from the observable.
             *
             * @coroutine
             *
             * @param mixed $value If $value is an instance of \Icicle\Awaitable\Awaitable, the fulfillment value is
             *     used as the value to emit or the rejection reason is thrown from this coroutine.
             *
             * @return \Generator
             *
             * @resolve mixed The emitted value (the resolution value of $value)
             *
             * @throws \Icicle\Observable\Exception\CompletedError If the observable has been completed.
             */
            $emit = function ($value = null): \Generator {
                return $this->queue->push($value);
            };

            try {
                $generator = ($this->emitter)($emit);

                if (!$generator instanceof Generator) {
                    throw new UnexpectedTypeError('Generator', $generator);
                }

                $this->coroutine = new Coroutine($generator);
                $this->coroutine->done([$this->queue, 'complete'], [$this->queue, 'fail']);
            } catch (Throwable $exception) {
                $this->queue->fail(new InvalidEmitterError($this->emitter, $exception));
            }

            $this->emitter = null;
        });
    }
280712
function concat() {
    var observables = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        observables[_i] = arguments[_i];
    }
    return function (source) { return source.lift.call(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"].apply(void 0, [source].concat(observables))); };
}
502953
function Subscriber(opts) {
  opts = opts || {};

  this._channel = opts.channel || 'default';
  this._subscribers = [];

  /* for mocking */
  var addEventListener = opts.addEventListener || window.addEventListener;
  var attachEvent = opts.attachEvent || window.attachEvent;

  var _this = this;
  function onMessage(e) {
    var event = parse(e.data);
    if (event.channel === _this._channel) {
      for (var i = 0, len = _this._subscribers.length; i < len; i++) {
        _this._subscribers[i].apply({}, event.args);
      }
    }
  }

  if (addEventListener) {
    addEventListener('message', onMessage, false);
  } else {
    attachEvent('onmessage', onMessage, false);
  }
}
1220143
function timeoutWith(due, withObservable, scheduler) {
    if (scheduler === void 0) {
        scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"];
    }
    return function (source) {
        var absoluteTimeout = Object(_util_isDate__WEBPACK_IMPORTED_MODULE_2__["isDate"])(due);
        var waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due);
        return source.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler));
    };
}
494519
function componentStillLoadingError(compType) {
    var /** @type {?} */ error = Error("Can't compile synchronously as " + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* ɵstringify */])(compType) + " is still being loaded!");
    ((error))[__WEBPACK_IMPORTED_MODULE_0__angular_core__["_47" /* ɵERROR_COMPONENT_TYPE */]] = compType;
    return error;
}
583255
async function subscribe (ant, field, directiveArgs, fieldArgs) {
  if (ant && field && directiveArgs && directiveArgs.to) {
    const antFunction =  ant.functionController.getFunction(directiveArgs.to);
    if (!antFunction) {
      logger.error(new AntError(
        `Could not find "${directiveArgs.to}" function`
      ));
      return null;
    }
    try {
      const currentValue = antFunction.run(fieldArgs);
      if (currentValue instanceof Observable) {
        return new AsyncIterableObserver(field.fieldName, currentValue);
      }
      return currentValue;
    } catch (e) {
      logger.error(new AntError(
        `Could not run "${directiveArgs.to}" function`,
        e
      ));
    }
  }
  return null;
}
1012108
function race() {
    var observables = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        observables[_i] = arguments[_i];
    }
    return function raceOperatorFunction(source) {
        if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(observables[0])) {
            observables = observables[0];
        }
        return source.lift.call(_observable_race__WEBPACK_IMPORTED_MODULE_1__["race"].apply(void 0, [source].concat(observables)));
    };
}
901525
@PostConstruct
    void init() {
        if (CollectionUtils.isNotEmpty(reactiveInstrumenters)) {
            oldCompletableHook =
                    RxJavaPlugins.getOnCompletableAssembly();
            oldMaybeHook = RxJavaPlugins.getOnMaybeAssembly();
            oldSingleHook = RxJavaPlugins.getOnSingleAssembly();
            oldObservableHook =
                    RxJavaPlugins.getOnObservableAssembly();
            oldFlowableHook =
                    RxJavaPlugins.getOnFlowableAssembly();
            oldConnectableFlowableHook =
                    RxJavaPlugins.getOnConnectableFlowableAssembly();
            oldConnectableObservableHook =
                    RxJavaPlugins.getOnConnectableObservableAssembly();
            oldParallelFlowableHook =
                    RxJavaPlugins.getOnParallelAssembly();

            RxJavaPlugins.setOnCompletableAssembly(completable -> {
                final Completable wrapped = RxInstrumentedWrappers.wrap(completable, reactiveInstrumenters);
                if (oldCompletableHook != null) {
                    return oldCompletableHook.apply(wrapped);
                }
                return wrapped;
            });

            RxJavaPlugins.setOnMaybeAssembly(maybe -> {
                final Maybe wrapped = RxInstrumentedWrappers.wrap(maybe, reactiveInstrumenters);
                if (oldMaybeHook != null) {
                    return oldMaybeHook.apply(wrapped);
                }
                return wrapped;
            });

            RxJavaPlugins.setOnSingleAssembly(single -> {
                final Single wrapped = RxInstrumentedWrappers.wrap(single, reactiveInstrumenters);
                if (oldSingleHook != null) {
                    return oldSingleHook.apply(wrapped);
                }
                return wrapped;
            });

            RxJavaPlugins.setOnObservableAssembly(observable -> {
                final Observable wrapped = RxInstrumentedWrappers.wrap(observable, reactiveInstrumenters);
                if (oldObservableHook != null) {
                    return oldObservableHook.apply(wrapped);
                }
                return wrapped;
            });

            RxJavaPlugins.setOnFlowableAssembly(flowable -> {
                final Flowable wrapped = RxInstrumentedWrappers.wrap(flowable, reactiveInstrumenters);
                if (oldFlowableHook != null) {
                    return oldFlowableHook.apply(wrapped);
                }
                return wrapped;
            });

            RxJavaPlugins.setOnConnectableFlowableAssembly(
                    connectableFlowable -> {
                        final ConnectableFlowable wrapped = RxInstrumentedWrappers.wrap(connectableFlowable, reactiveInstrumenters);
                        if (oldConnectableFlowableHook != null) {
                            return oldConnectableFlowableHook.apply(wrapped);
                        }
                        return wrapped;
                    });

            RxJavaPlugins.setOnConnectableObservableAssembly(connectableObservable -> {
                final ConnectableObservable wrapped = RxInstrumentedWrappers.wrap(connectableObservable, reactiveInstrumenters);
                if (oldConnectableObservableHook != null) {
                    return oldConnectableObservableHook.apply(connectableObservable);
                }
                return wrapped;
            });

            RxJavaPlugins.setOnParallelAssembly(parallelFlowable -> {
                final ParallelFlowable wrapped = RxInstrumentedWrappers.wrap(parallelFlowable, reactiveInstrumenters);
                if (oldParallelFlowableHook != null) {
                    return oldParallelFlowableHook.apply(wrapped);
                }
                return wrapped;
            });

        }

        if (CollectionUtils.isNotEmpty(instrumenters)) {
            Function<? super Runnable, ? extends Runnable> existing = RxJavaPlugins.getScheduleHandler();
            if (existing != null && !(existing instanceof RxJava2Instrumentation)) {
                RxJavaPlugins.setScheduleHandler(runnable -> this.apply(existing.apply(runnable)));
            } else {
                RxJavaPlugins.setScheduleHandler(this);
            }
        }
    }
1170058
function () {
            return new me.ObservableVector2d(Math.floor(this._x), Math.floor(this._y), {onUpdate: this.onUpdate});
        }