import { objectEntries } from "@vueuse/core";
import { replaceVariables } from "@scalar/helpers/regex/replace-variables";
//#region src/v2/blocks/operation-block/helpers/get-server-url.ts
var getServerUrl = (server, environmentVariables) => {
	/** Extract the server variables default values*/
	const serverVariables = objectEntries(server?.variables ?? {}).reduce((acc, [name, variable]) => {
		if (variable.default) acc[name] = variable.default;
		return acc;
	}, {});
	return replaceVariables(server?.url ?? "", {
		...environmentVariables,
		...serverVariables
	});
};
//#endregion
export { getServerUrl };

//# sourceMappingURL=get-server-url.js.map