import { useRef } from "react";
var idCounter = {};
function uniqueId() {
    var prefix = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : '$nut$';
    if (!idCounter[prefix]) {
        idCounter[prefix] = 0;
    }
    var id = ++idCounter[prefix];
    if (prefix === '$nut$') {
        return "".concat(id);
    }
    return "".concat(prefix).concat(id);
}
export default function useUuid() {
    var idRef = useRef(uniqueId());
    return idRef.current;
}
