{"version":3,"sources":["jsdelivr-header.js","/npm/metascraper-clearbit-logo@5.3.0/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,MAAM,UAAE,WAAc,QAAQ,gBACxB,IAAE,KAAQ,QAAQ,OAClB,IAAM,QAAQ,OAEd,SAAW,4BAEX,OAAS,CAAC,EAAK,KACnB,MAAM,SAAE,GAAa,IAAI,IAAI,GACvB,EAAS,GAAG,YAAY,IAC9B,OAAO,EAAO,GAAG,KAAU,UAAU,KAAU,GAGjD,OAAO,QAAU,IAYR,CACL,KAZmB,OAAS,UAC5B,MAAM,EAAU,OAAO,EAAK,GAE5B,IAEE,aADM,IAAI,KAAK,EAAS,CAAE,MAAO,EAAG,QAAS,MACtC,CACT,CAAE,MAAO,GACP,OAAO,IACT,KAQJ,OAAO,QAAQ,OAAS","file":"/npm/metascraper-clearbit-logo@5.3.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/metascraper-clearbit-logo@5.3.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict'\n\nconst { stringify } = require('querystring')\nconst { URL } = require('url')\nconst got = require('got')\n\nconst ENDPOINT = 'https://logo.clearbit.com'\n\nconst apiUrl = (url, opts) => {\n  const { hostname } = new URL(url)\n  const apiUrl = `${ENDPOINT}/${hostname}`\n  return opts ? `${apiUrl}?${stringify(opts)}` : apiUrl\n}\n\nmodule.exports = opts => {\n  const clearbitLogo = async ({ url }) => {\n    const logoUrl = apiUrl(url, opts)\n\n    try {\n      await got.head(logoUrl, { retry: 0, timeout: 1000 })\n      return logoUrl\n    } catch (err) {\n      return null\n    }\n  }\n\n  return {\n    logo: clearbitLogo\n  }\n}\n\nmodule.exports.apiUrl = apiUrl\n"]}