{
  "version": 3,
  "sources": ["../../src/utils/transactions/getExplorerLink.ts"],
  "sourcesContent": ["let errorMessageDisplayed = false;\n\nfunction logError(error: string) {\n  if (!errorMessageDisplayed) {\n    console.error(error);\n    errorMessageDisplayed = true;\n  }\n}\n\nexport function getExplorerLink({\n  explorerAddress,\n  to\n}: {\n  explorerAddress: string;\n  to: string;\n}) {\n  try {\n    // if a valid url is sent, return the original url\n    const url = new URL(to);\n    return url.href;\n  } catch {\n    if (to && !to.startsWith('/')) {\n      logError(`Link not prepended by / : ${to}`);\n      to = `/${to}`;\n    }\n    return explorerAddress ? `${explorerAddress}${to}` : to;\n  }\n}\n"],
  "mappings": "AAAA,IAAIA,EAAwB,GAE5B,SAASC,EAASC,EAAe,CAC1BF,IACH,QAAQ,MAAME,CAAK,EACnBF,EAAwB,GAE5B,CAEO,SAASG,EAAgB,CAC9B,gBAAAC,EACA,GAAAC,CACF,EAGG,CACD,GAAI,CAGF,OADY,IAAI,IAAIA,CAAE,EACX,IACb,MAAQ,CACN,OAAIA,GAAM,CAACA,EAAG,WAAW,GAAG,IAC1BJ,EAAS,6BAA6BI,CAAE,EAAE,EAC1CA,EAAK,IAAIA,CAAE,IAEND,EAAkB,GAAGA,CAAe,GAAGC,CAAE,GAAKA,CACvD,CACF",
  "names": ["errorMessageDisplayed", "logError", "error", "getExplorerLink", "explorerAddress", "to"]
}
