{"version":3,"file":"uniqueId.mjs","sources":["../../../../../../../web/src/utils/uniqueId.ts"],"sourcesContent":["import { nanoid } from 'nanoid';\nimport { useRef } from 'react';\n\nexport const getUniqueId = (prefix = 's') => prefix + nanoid();\n\n/**\n * Create a unique ID (like React 18's useId()) with a specific prefix. The default 's' prefix\n * should be good enough for most use cases - we always want an alphabet as the first character\n * but we don't want it to be long enough to become selectable, to prevent this from accidentally\n * becoming a stable API.\n */\nexport const useUniqueId = (prefix = 's') => {\n  const id = useRef(nanoid());\n  return prefix + id.current;\n};\n"],"names":["useUniqueId","prefix","id","useRef","nanoid","current"],"mappings":";;;;AAKA;;;;;AAKC,IACM,MAAMA,WAAAA,GAAc,CAACC,SAAS,GAAG,GAAA;AACtC,IAAA,MAAMC,KAAKC,CAAAA,CAAOC,MAAAA,EAAAA,CAAAA;IAClB,OAAOH,MAAAA,GAASC,GAAGG,OAAO;AAC5B;;;;"}