var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/plus/pisellReservation/serve/formResourcePage.ts
var formResourcePage_exports = {};
__export(formResourcePage_exports, {
  getFormResourcePage: () => getFormResourcePage
});
module.exports = __toCommonJS(formResourcePage_exports);
var import_utils = require("../../../utils");
function buildQuery(params) {
  var _a;
  const q = {
    num: params.num ?? 999
  };
  if (params.skip !== void 0) {
    q.skip = params.skip;
  }
  if ((_a = params.ids) == null ? void 0 : _a.length) {
    q["ids"] = params.ids;
  }
  return q;
}
async function getFormResourcePage(params = {}) {
  const res = await import_utils.request.getRequest().get(`/shop/form/resource/page`, buildQuery(params), {
    fullResult: true,
    isShopApi: true,
    osServer: true
  });
  const body = (res == null ? void 0 : res.data) ?? res;
  const payload = body && typeof body === "object" && "data" in body ? body.data : body;
  const rawList = payload == null ? void 0 : payload.list;
  const list = Array.isArray(rawList) ? rawList : [];
  const count = typeof (payload == null ? void 0 : payload.count) === "number" && Number.isFinite(payload.count) ? payload.count : list.length;
  return {
    list,
    count,
    skip: payload == null ? void 0 : payload.skip,
    size: payload == null ? void 0 : payload.size
  };
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  getFormResourcePage
});
