const require_zone = require('../zone.js');
const require_systemZone = require('../zones/systemZone.js');
const require_IANAZone = require('../zones/IANAZone.js');
const require_fixedOffsetZone = require('../zones/fixedOffsetZone.js');
const require_invalidZone = require('../zones/invalidZone.js');
const require_util = require('./util.js');

//#region ../../node_modules/.pnpm/luxon@3.5.0/node_modules/luxon/src/impl/zoneUtil.js
function normalizeZone(input, defaultZone) {
	if (require_util.isUndefined(input) || input === null) return defaultZone;
	else if (input instanceof require_zone.default) return input;
	else if (require_util.isString(input)) {
		const lowered = input.toLowerCase();
		if (lowered === "default") return defaultZone;
		else if (lowered === "local" || lowered === "system") return require_systemZone.default.instance;
		else if (lowered === "utc" || lowered === "gmt") return require_fixedOffsetZone.default.utcInstance;
		else return require_fixedOffsetZone.default.parseSpecifier(lowered) || require_IANAZone.default.create(input);
	} else if (require_util.isNumber(input)) return require_fixedOffsetZone.default.instance(input);
	else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") return input;
	else return new require_invalidZone.default(input);
}

//#endregion
exports.normalizeZone = normalizeZone;