import {
  LOCATION_DETAILS_FIELD,
  LocationDetailPage
} from "./chunk-FB4JUZFB.js";
import "./chunk-4F5GP7J7.js";
import "./chunk-LXSBG6LK.js";
import "./chunk-VW56KWO2.js";
import "./chunk-HC25LNX7.js";
import "./chunk-7AV5EJJ5.js";
import "./chunk-U2EI2ZLM.js";
import "./chunk-W6Y3PPU5.js";
import "./chunk-JRTZWK77.js";
import "./chunk-V5J73NPW.js";
import "./chunk-3EF54XFY.js";
import "./chunk-XIZLPYEE.js";
import "./chunk-INNFZYX2.js";
import "./chunk-BDGZ4EQO.js";
import "./chunk-LAVHRER2.js";
import "./chunk-Y7QKP6QU.js";
import "./chunk-3MDRW5MA.js";
import "./chunk-MFL2TZ3W.js";
import "./chunk-YNIIYGL4.js";
import "./chunk-CBHNHLUZ.js";
import "./chunk-VME3CJER.js";
import "./chunk-XMVTX2EN.js";
import "./chunk-5PUHROK4.js";
import "./chunk-TPPONKYW.js";
import "./chunk-DF3OGJAK.js";
import "./chunk-XRDP2SYY.js";
import "./chunk-FNBKEF54.js";
import "./chunk-EHQESDH2.js";
import "./chunk-XKVXLDSJ.js";
import "./chunk-XDZGOUCR.js";
import "./chunk-K4BGK3CO.js";
import "./chunk-YYTI5JIC.js";
import "./chunk-HAFZQK53.js";
import "./chunk-IJWG755C.js";
import "./chunk-M3YP3NX4.js";
import "./chunk-UU2RQMXS.js";
import "./chunk-O4STPJR2.js";
import "./chunk-R74OHYTB.js";
import "./chunk-22XJUSMM.js";
import {
  stockLocationsQueryKeys,
  useStockLocation
} from "./chunk-OFKUNYQJ.js";
import "./chunk-W5UPPL3W.js";
import "./chunk-LC6TM5OT.js";
import "./chunk-7SJC6BWZ.js";
import "./chunk-N4JU7GWK.js";
import "./chunk-52BRBQMY.js";
import "./chunk-BA2HXHTW.js";
import {
  queryClient
} from "./chunk-RHKRREUU.js";
import "./chunk-ZA2KFUFR.js";
import {
  sdk
} from "./chunk-RIN4CBRB.js";
import "./chunk-NBMM2TZK.js";

// src/pages/locations/location-detail/breadcrumb.tsx
import { jsx } from "react/jsx-runtime";
var LocationDetailBreadcrumb = (props) => {
  const { location_id } = props.params || {};
  const { stock_location } = useStockLocation(
    location_id,
    {
      fields: LOCATION_DETAILS_FIELD
    },
    {
      initialData: props.data,
      enabled: Boolean(location_id)
    }
  );
  if (!stock_location) {
    return null;
  }
  return /* @__PURE__ */ jsx("span", { children: stock_location.name });
};

// src/pages/locations/location-detail/loader.ts
var locationQuery = (id) => ({
  queryKey: stockLocationsQueryKeys.detail(id, {
    fields: LOCATION_DETAILS_FIELD
  }),
  queryFn: async () => sdk.admin.stockLocations.$id.query({
    $id: id,
    fields: LOCATION_DETAILS_FIELD
  })
});
var locationLoader = async ({ params }) => {
  const id = params.location_id;
  const query = locationQuery(id);
  return queryClient.ensureQueryData(query);
};
export {
  LocationDetailBreadcrumb as Breadcrumb,
  LocationDetailPage as Component,
  locationLoader as loader
};
