{"version":3,"file":"ids.cjs","names":[],"sources":["../../src/utils/ids.ts"],"sourcesContent":["/**\n * Generate a collision-resistant id suitable for client-side UI keys.\n *\n * Uses `crypto.randomUUID()` when available, falling back to a\n * timestamp + `Math.random()` combination otherwise. When `prefix` is given,\n * the result is formatted as `${prefix}-${id}`.\n *\n * @example\n * randomId();          // \"9f1c2b3a-...\" (uuid) or \"lq3f8k-4a9z1\" (fallback)\n * randomId(\"user\");    // \"user-9f1c2b3a-...\"\n */\nexport function randomId(prefix?: string): string {\n    let id: string;\n\n    if (typeof crypto !== \"undefined\" && typeof crypto.randomUUID === \"function\") {\n        id = crypto.randomUUID();\n    } else {\n        const time = Date.now().toString(36);\n        const rand = Math.random().toString(36).slice(2, 10);\n        id = `${time}-${rand}`;\n    }\n\n    return prefix ? `${prefix}-${id}` : id;\n}\n"],"mappings":"AAWA,SAAgB,EAAS,EAAyB,CAC9C,IAAI,EAUJ,MARA,CAKI,EALA,OAAO,OAAW,KAAe,OAAO,OAAO,YAAe,WACzD,OAAO,WAAW,EAIlB,GAFQ,KAAK,IAAI,CAAC,CAAC,SAAS,EAEzB,EAAK,GADA,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAG,EACjC,IAGb,EAAS,GAAG,EAAO,GAAG,IAAO,CACxC"}