{"version":3,"file":"generateGoogleReCaptchaScriptSrc.cjs","sources":["../../../src/helpers/generateGoogleReCaptchaScriptSrc.ts"],"sourcesContent":["import type { GoogleReCaptcha } from '../types';\n\ninterface GenerateGoogleReCaptchaSrcParams {\n  badge?: Exclude<GoogleReCaptcha.Badge, 'hidden'>;\n  hl?: string;\n  host?: GoogleReCaptcha.Host;\n  isEnterprise?: boolean;\n  render: string;\n}\n\n/**\n * Generates the script source URL for the Google reCAPTCHA.\n *\n * @param {GenerateGoogleReCaptchaSrcParams} params - The parameters for generating the script source URL.\n * @param {string} params.host - The host for the script source URL.\n * @param {boolean} params.isEnterprise - Indicates if the enterprise version of reCAPTCHA should be used.\n * @param {string} params.render - The render parameter for the script source URL.\n * @param {string} params.hl - The hl parameter for the script source URL.\n * @param {string} params.badge - The badge parameter for the script source URL.\n * @return {string} The script source URL for the Google reCAPTCHA.\n */\nexport const generateGoogleReCaptchaScriptSrc = ({\n  host = 'google.com',\n  isEnterprise = false,\n  render,\n  hl,\n  badge\n}: GenerateGoogleReCaptchaSrcParams) => {\n  const queries = new URLSearchParams({\n    ...(hl && { hl }),\n    ...(badge && { badge }),\n    render\n  });\n\n  const file = isEnterprise ? 'enterprise.js' : 'api.js';\n\n  return `https://www.${host}/recaptcha/${file}?${queries}`;\n};\n"],"names":["generateGoogleReCaptchaScriptSrc","host","isEnterprise","render","hl","badge","queries"],"mappings":"gFAqBO,MAAMA,EAAmC,CAAC,CAC/C,KAAAC,EAAO,aACP,aAAAC,EAAe,GACf,OAAAC,EACA,GAAAC,EACA,MAAAC,CACF,IAAwC,CACtC,MAAMC,EAAU,IAAI,gBAAgB,CAClC,GAAIF,GAAM,CAAE,GAAAA,CAAA,EACZ,GAAIC,GAAS,CAAE,MAAAA,CAAA,EACf,OAAAF,CAAA,CACD,EAID,MAAO,eAAeF,CAAI,cAFbC,EAAe,gBAAkB,QAEF,IAAII,CAAO,EACzD"}