/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
'use strict';

var bundle = require('./bundle-BhTmftd-.js');

function getMouseClientPosition(event, offsets) {
    const pt = bundle.point.create(event.clientX, event.clientY);
    if (offsets == null) {
        return pt;
    }
    else {
        return bundle.point.subtract(pt, bundle.point.create(offsets.left, offsets.top));
    }
}
/**
 * Returns a CSS transform that will center an element at the given position.
 */
function cssTransformCenterAt(position) {
    const { x, y } = position;
    return `translate(-50%, -50%) translate(${x}px, ${y}px)`;
}
/**
 * Returns a CSS value for a cursor.
 */
function cssCursor(cursor) {
    var _a, _b;
    if (typeof cursor === 'string') {
        return cursor;
    }
    else {
        const parts = [
            `url("${cursor.url}")`,
            (_a = cursor.offsetX) !== null && _a !== void 0 ? _a : 0,
            (_b = cursor.offsetY) !== null && _b !== void 0 ? _b : 0,
            ', auto',
        ];
        return parts.join(' ');
    }
}
function getWindowDevicePixelRatio() {
    if (typeof window !== 'undefined') {
        return window.devicePixelRatio;
    }
    return 1;
}

exports.cssCursor = cssCursor;
exports.cssTransformCenterAt = cssTransformCenterAt;
exports.getMouseClientPosition = getMouseClientPosition;
exports.getWindowDevicePixelRatio = getWindowDevicePixelRatio;
//# sourceMappingURL=dom-CXWXs9Hx.js.map

//# sourceMappingURL=dom-CXWXs9Hx.js.map