"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "default", {
    enumerable: true,
    get: function() {
        return useUuid;
    }
});
var _react = require("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);
}
function useUuid() {
    var idRef = (0, _react.useRef)(uniqueId());
    return idRef.current;
}
