import { ApiResponse } from "../request-response";
async function translatableDataHandler(req, { client }) {
  const body = await req.json();
  const { elementTree } = body;
  if (elementTree == null) {
    return ApiResponse.json({ message: "elementTree must be defined." }, { status: 400 });
  }
  try {
    let translatableData = client.getTranslatableData(elementTree);
    return ApiResponse.json({ translatableData });
  } catch (error) {
    return ApiResponse.json({ message: "Failed to get translatable data." }, { status: 500 });
  }
}
export {
  translatableDataHandler
};
//# sourceMappingURL=translatable-data.js.map