{"version":3,"file":"resolveRequestFunctionPaths.mjs","names":[],"sources":["../../../src/config-dir/utils/resolveRequestFunctionPaths.ts"],"sourcesContent":["import { RequestFunctions, REQUEST_FUNCTIONS } from '../../request/types';\nimport {\n  type BaseWithGTConfigProps,\n  REQUEST_FUNCTION_TO_CONFIG_KEY,\n} from '../props/withGTConfigProps';\nimport { resolveConfigFilepath } from './resolveConfigFilepath';\n\nexport const REQUEST_FUNCTION_ALIASES = {\n  getLocale: 'gt-next/internal/_getLocale',\n  getRegion: 'gt-next/internal/_getRegion',\n} as const;\n\nexport type RequestFunctionPaths = Partial<Record<RequestFunctions, string>>;\n\n/**\n * Resolves paths for request functions\n * @param mergedConfig Configuration object containing path settings\n * @returns Object mapping function names to their resolved paths and enabled status\n */\nexport function resolveRequestFunctionPaths(\n  mergedConfig: BaseWithGTConfigProps\n): RequestFunctionPaths {\n  const result = {} as RequestFunctionPaths;\n\n  for (const functionName of REQUEST_FUNCTIONS) {\n    const configKey = REQUEST_FUNCTION_TO_CONFIG_KEY[functionName];\n    const path =\n      typeof mergedConfig[configKey] === 'string'\n        ? mergedConfig[configKey]\n        : resolveConfigFilepath(functionName, ['.ts', '.js']);\n\n    if (path) {\n      result[functionName] = path;\n    }\n  }\n\n  return result;\n}\n"],"mappings":";;;;AAOA,MAAa,2BAA2B;CACtC,WAAW;CACX,WAAW;CACZ;;;;;;AASD,SAAgB,4BACd,cACsB;CACtB,MAAM,SAAS,EAAE;AAEjB,MAAK,MAAM,gBAAgB,mBAAmB;EAC5C,MAAM,YAAY,+BAA+B;EACjD,MAAM,OACJ,OAAO,aAAa,eAAe,WAC/B,aAAa,aACb,sBAAsB,cAAc,CAAC,OAAO,MAAM,CAAC;AAEzD,MAAI,KACF,QAAO,gBAAgB;;AAI3B,QAAO"}