"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseUserAgentProperties = parseUserAgentProperties;
const ua_parser_js_1 = __importDefault(require("@amplitude/ua-parser-js"));
function parseUserAgentProperties(userAgent, userAgentData) {
    if (!userAgent) {
        return {};
    }
    const parser = new ua_parser_js_1.default(userAgent);
    const device = parser.getDevice();
    const os = parser.getOS();
    const browser = parser.getBrowser();
    return {
        os_name: os.name ?? browser.name,
        os_version: userAgentData?.platformVersion ?? browser.major,
        device_manufacturer: device.vendor,
        device_model: userAgentData?.model ?? device.model ?? os.name,
        device_type: device.type
    };
}
//# sourceMappingURL=user-agent.js.map