import { EMPTY } from "./empty.mjs";
import { popNumber, popScheduler } from "../util/args.mjs";
import { innerFrom } from "./innerFrom.mjs";
import { from } from "./from.mjs";
import { mergeAll } from "../operators/mergeAll.mjs";

//#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/observable/merge.js
function merge() {
	var args = [];
	for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
	var scheduler = popScheduler(args);
	var concurrent = popNumber(args, Infinity);
	var sources = args;
	return !sources.length ? EMPTY : sources.length === 1 ? innerFrom(sources[0]) : mergeAll(concurrent)(from(sources, scheduler));
}

//#endregion
export { merge };
//# sourceMappingURL=merge.mjs.map