import { l as listCategories, a as listDevices } from '../../../chunks/queries.js-BUUEc74j.js';

const load = async ({ url }) => {
  const search = url.searchParams.get("q")?.trim() || void 0;
  const status = url.searchParams.get("status") || void 0;
  const categoryId = url.searchParams.get("cat") ? Number(url.searchParams.get("cat")) : void 0;
  return {
    devices: listDevices({ search, status, categoryId }),
    categories: listCategories(),
    filters: { search: search ?? "", status: status ?? "", categoryId: categoryId ?? "" }
  };
};

var _page_server_ts = /*#__PURE__*/Object.freeze({
  __proto__: null,
  load: load
});

export { _page_server_ts as _ };
//# sourceMappingURL=_page.server.ts.js-BU8oNkK6.js.map
