import { encodeUUIDBytesToWebSafeBase64ID , EntityID , EventID , } from "@withorbit/core" ; import { parse as uuidParse , v5 as uuidV5 } from "uuid" ; let _orbitAnkiImportNamespaceUUID = null ; export function convertAnkiID < ID extends EntityID | EventID > ( input ) { if ( ! _orbitAnkiImportNamespaceUUID ) { _orbitAnkiImportNamespaceUUID = uuidParse ( "a430c93f-60dc-4799-b2a6-df402ff941a5" ) ; } const bytes = new Uint8Array ( 16 ) ; uuidV5 ( input , _orbitAnkiImportNamespaceUUID , bytes ) ; return encodeUUIDBytesToWebSafeBase64ID ( bytes ) ; }