import { ENV_VARS, init_paths_state, resolveStateDir } from "../../../../src/config/paths-state.js";
import path from "node:path";
//#region extensions/feishu/src/auth/paths.ts
init_paths_state();
function resolveFeishuCredentialsDir() {
	const explicit = process.env[ENV_VARS.CREDENTIALS_DIR]?.trim();
	if (explicit) return explicit;
	return path.join(resolveStateDir(), "credentials");
}
function resolveFeishuFrameworkAllowFromPath(accountId) {
	const base = "xopc-feishu".replace(/[\\/:*?"<>|]/g, "_");
	const safeAccount = accountId.trim().toLowerCase().replace(/[\\/:*?"<>|]/g, "_").replace(/\.\./g, "_");
	return path.join(resolveFeishuCredentialsDir(), `${base}-${safeAccount}-allowFrom.json`);
}
//#endregion
export { resolveFeishuCredentialsDir, resolveFeishuFrameworkAllowFromPath };

//# sourceMappingURL=paths.js.map