import { getFormDetail } from "../info/pet/serve";
var waiverFormDetailCache = new Map();

/**
 * 缓存 Waiver 表单详情；这是表结构数据，可被 Booking 和 SalesSdk Holder 创建入口共享。
 */
export function getCachedWaiverFormDetail(formId) {
  if (!waiverFormDetailCache.has(formId)) {
    var detailPromise = getFormDetail(formId).catch(function (error) {
      waiverFormDetailCache.delete(formId);
      throw error;
    });
    waiverFormDetailCache.set(formId, detailPromise);
  }
  return waiverFormDetailCache.get(formId);
}