import {
  TaxRegionProvinceDetailPage
} from "./chunk-5OS2MBRB.js";
import "./chunk-LFATSJPO.js";
import "./chunk-ZBJ56XDB.js";
import {
  getProvinceByIso2,
  isProvinceInCountry
} from "./chunk-N2TQXB44.js";
import "./chunk-LTBX54CI.js";
import "./chunk-QDPLZDMX.js";
import "./chunk-U2EI2ZLM.js";
import "./chunk-JRTZWK77.js";
import "./chunk-E74OUNA3.js";
import "./chunk-ZMC7BKLT.js";
import "./chunk-KAZ5BYTQ.js";
import "./chunk-634XVU3D.js";
import "./chunk-H6MYB7GB.js";
import "./chunk-INNFZYX2.js";
import "./chunk-BDGZ4EQO.js";
import "./chunk-LAVHRER2.js";
import "./chunk-Y7QKP6QU.js";
import "./chunk-MG4GKUJW.js";
import "./chunk-SESTTUVM.js";
import "./chunk-THHRRYRS.js";
import "./chunk-PBQ5M44A.js";
import "./chunk-OH4AABUT.js";
import "./chunk-YKDEE7ZL.js";
import "./chunk-AEMDNTW5.js";
import {
  taxRegionsQueryKeys,
  useTaxRegion
} from "./chunk-LYD3C73Z.js";
import "./chunk-7O5NDICV.js";
import "./chunk-46M463BR.js";
import "./chunk-YFRC6GEN.js";
import "./chunk-N6SI4IIT.js";
import "./chunk-JPNPTILP.js";
import "./chunk-DAXXLQKB.js";
import "./chunk-OHOWEMHO.js";
import "./chunk-GKGLVDDV.js";
import "./chunk-WJJXUXSO.js";
import "./chunk-LAPEZATU.js";
import "./chunk-DBNPVU3L.js";
import "./chunk-U7WZYWGA.js";
import "./chunk-ZN7LWXVC.js";
import "./chunk-VYMODH6P.js";
import "./chunk-LEG67A2R.js";
import "./chunk-PRBE5CM3.js";
import "./chunk-5TRY5IMZ.js";
import "./chunk-TAKEQAZZ.js";
import "./chunk-B6FG7A6W.js";
import "./chunk-EPHVGD5Z.js";
import "./chunk-ESPLVOFC.js";
import "./chunk-FXWKGNRV.js";
import "./chunk-VDKOJ5WD.js";
import "./chunk-DL2ZIXBO.js";
import "./chunk-Z2QQZOG3.js";
import "./chunk-5CK6XEFV.js";
import {
  queryClient
} from "./chunk-RHKRREUU.js";
import "./chunk-ZA2KFUFR.js";
import {
  sdk
} from "./chunk-ZBWL72TB.js";
import "./chunk-NBMM2TZK.js";

// src/pages/tax-regions/tax-region-province-detail/breadcrumb.tsx
import { jsx } from "react/jsx-runtime";
var TaxRegionDetailBreadcrumb = (props) => {
  const { province_id } = props.params || {};
  const { tax_region } = useTaxRegion(province_id, void 0, {
    initialData: props.data,
    enabled: Boolean(province_id)
  });
  if (!tax_region) {
    return null;
  }
  const countryCode = tax_region.country_code?.toUpperCase();
  const provinceCode = tax_region.province_code?.toUpperCase();
  const isValid = isProvinceInCountry(countryCode, provinceCode);
  return /* @__PURE__ */ jsx("span", { children: isValid ? getProvinceByIso2(provinceCode) : provinceCode });
};

// src/pages/tax-regions/tax-region-province-detail/loader.ts
var taxRegionDetailQuery = (id) => ({
  queryKey: taxRegionsQueryKeys.detail(id),
  queryFn: async () => sdk.admin.taxRegions.$id.query({ $id: id })
});
var taxRegionLoader = async ({ params }) => {
  const id = params.province_id;
  const query = taxRegionDetailQuery(id);
  return queryClient.ensureQueryData(query);
};
export {
  TaxRegionDetailBreadcrumb as Breadcrumb,
  TaxRegionProvinceDetailPage as Component,
  TaxRegionProvinceDetailPage,
  taxRegionLoader as loader
};
