import { defineComponent as se, computed as x, resolveComponent as _, createBlock as V, openBlock as p, createVNode as o, ref as G, createElementBlock as F, Fragment as K, renderSlot as be, unref as e, withCtx as g, createElementVNode as v, createCommentVNode as z, renderList as X, createTextVNode as xe, toDisplayString as N, markRaw as Ce, toRaw as ke, h as J, withModifiers as Q, normalizeClass as he } from "vue";
import { useRouter as Fe } from "vue-router";
import { u as pe, A as M, Q as fe, G as ge, D as re, B as Oe, I as le, M as ve, ae as ie, a5 as Me } from "./index.vue_vue_type_script_setup_true_lang-BMVa5UfU.js";
import { useI18n as ue, useCoreStore as _e } from "@feedmepos/mf-common";
import { useSnackbar as ye, components as ne, FmButtonVariant as W, FmButtonColorThemeVariant as Z, useDialog as Ve, useBreakpoints as De } from "@feedmepos/ui-library";
import { _ as Se, R as ce } from "./app-D-J2cjak.js";
import { _ as Te } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
import { _ as te } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
import { _ as Ue } from "./RuleView.vue_vue_type_script_setup_true_lang-DRUQOy4h.js";
import { _ as me, a as we } from "./GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BFroO4RA.js";
import { c as Ee } from "./check-C9mY6LiX.js";
import { C as B, a as P } from "./catalogSetting-B_CqlQ0S.js";
import { _ as Ae } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
import { C as Ne } from "./catalog-rNLjUMn-.js";
const Re = /* @__PURE__ */ se({
  __name: "CatalogUsageTable",
  props: {
    catalog: {}
  },
  setup(ee) {
    const D = ee, {
      t: d
    } = ue(), S = x(() => D.catalog.restaurants.length === 0 ? [{
      name: "--",
      usage: []
    }] : D.catalog.restaurants), R = [{
      accessorKey: "name",
      header: () => o("div", {
        class: "flex flex-col"
      }, [o("p", null, [D.catalog.name]), o("p", {
        class: "text-fm-color-typo-secondary fm-typo-en-body-md-400"
      }, [d("menu.catalog.usage.tax_calculation") + `: ${D.catalog.taxMode}`])]),
      cell: ({
        row: y
      }) => o("div", {
        class: "space-y-4"
      }, [o("p", null, [y.original.name]), o("p", {
        class: "text-fm-color-typo-secondary"
      }, [y.original.id])]),
      enableSorting: !1,
      meta: {
        headerClass: "px-16 py-4"
      }
    }, {
      header: () => o("div", {
        class: "w-full flex justify-between"
      }, [o("p", null, [d("menu.catalog.usage.usage")]), o(Te, {
        label: `${d("menu.catalog.usage.products", {
          count: D.catalog.totalProducts
        })}`,
        variant: "info",
        class: "px-8 py-4"
      }, null)]),
      accessorKey: "usage",
      cell: ({
        row: y
      }) => {
        const C = y.original.usage.join(", ") || "--";
        return o("p", {
          class: "flex py-8"
        }, [C]);
      },
      enableSorting: !1,
      meta: {
        headerClass: "px-16 py-4"
      }
    }];
    return (y, C) => {
      const E = _("FmTable");
      return p(), V(E, {
        "column-defs": R,
        "row-data": S.value,
        "page-size": S.value.length,
        virtual: !0,
        "hide-footer": !0,
        "shrink-at": !1
      }, null, 8, ["row-data", "page-size"]);
    };
  }
}), Le = { class: "space-y-32" }, $e = {
  key: 0,
  class: "pl-32 space-x-8"
}, Ie = { class: "pl-[60px] space-y-16" }, Be = { class: "space-x-16 flex items-center" }, Pe = { class: "flex-1 space-y-4" }, ze = { class: "fm-typo-en-body-lg-400" }, Ge = { class: "fm-typo-en-body-md-400" }, Ke = { class: "flex gap-8 items-center justify-start" }, je = /* @__PURE__ */ se({
  __name: "Form",
  setup(ee, { expose: D }) {
    const d = G(!1), S = G(!1), R = (c, u) => {
      Ee.isBoolean(c) ? d.value = c : d.value = !d.value, d.value && (r.value = B.fromCatalog(
        u ?? re.generator.initMenuV4Catalog(),
        y.value
      ));
    }, y = x(() => C.version === M.F_MENU_VERSION.enum.v4), C = pe(), E = _e(), m = fe(ge(ye())), r = G(
      B.fromCatalog(re.generator.initMenuV4Catalog(), y.value)
    ), ae = x(() => C.catalogs.map((c) => c.name)), j = x({
      get: () => r.value.taxSetting,
      set: (c) => {
        r.value.taxSetting = c;
      }
    }), Y = x(() => {
      var f, k;
      if (!E.currentCountry.value) return [];
      const c = ((f = r.value.taxSetting) == null ? void 0 : f.mode) === P.MANUAL ? ((k = r.value.taxSetting) == null ? void 0 : k.inclusive) ?? [] : [];
      return Oe.Country.getCountry(E.currentCountry.value).taxSystems.map((w) => {
        const A = c.find(($) => $.systemCode === w.code);
        return {
          inclusive: (A == null ? void 0 : A.inclusive) || !1,
          systemCode: w.code
        };
      });
    });
    function L(c) {
      const u = r.value.taxSetting, f = u.mode === P.AUTO ? B.manualTax(Y.value) : le(u);
      f.inclusive ?? (f.inclusive = []);
      const k = f.inclusive.findIndex((w) => w.systemCode === c.systemCode);
      k < 0 ? f.inclusive.push(c) : f.inclusive.splice(k, 1, c), j.value = f;
    }
    function U(c, u) {
      const f = le(r.value);
      f.markupOptions && (f.markupOptions[c] = u, r.value = f);
    }
    function q(c) {
      const u = le(r.value);
      u.markupOptions && (u.markupOptions.splice(c, 1), r.value = u);
    }
    async function H() {
      S.value = !0;
      const c = {
        ...r.value,
        ...B.toCatalog(r.value)
      };
      try {
        await m.updateMenu(
          {
            module: M.F_MENU_MODULE_V4_KEY.enum.catalog,
            operation: ve.F_OPERATION_TYPE.create,
            data: c
          },
          c.name
        ), d.value = !1;
      } finally {
        S.value = !1;
      }
    }
    const { t: i } = ue();
    return D({ trigger: R }), (c, u) => {
      const f = _("fm-text-field"), k = _("fm-radio"), w = _("fm-radio-group"), A = _("fm-checkbox"), $ = _("fm-switch"), s = _("fm-select"), a = _("fm-button"), l = _("fm-chip"), O = _("fm-card"), I = _("fm-side-sheet");
      return p(), F(K, null, [
        be(c.$slots, "default", { trigger: R }),
        o(I, {
          modelValue: d.value,
          "onUpdate:modelValue": u[8] || (u[8] = (t) => d.value = t),
          "is-container": e(ne).FmForm,
          "is-container-props": {
            onValidationSuccess: H,
            blameFormChildOnValidationFailed: !0
          },
          "max-width": 560
        }, {
          "side-sheet-footer": g(() => [
            v("div", Ke, [
              o(a, {
                loading: S.value,
                label: e(i)("menu.common.actions.add"),
                size: "lg",
                type: "submit",
                variant: "primary"
              }, null, 8, ["loading", "label"]),
              o(a, {
                label: e(i)("menu.common.actions.cancel"),
                size: "lg",
                variant: "tertiary",
                onClick: u[7] || (u[7] = () => d.value = !1)
              }, null, 8, ["label"])
            ])
          ]),
          default: g(() => [
            v("div", Le, [
              o(Ue, {
                title: e(i)("menu.catalog.detail")
              }, {
                default: g(() => [
                  o(f, {
                    modelValue: r.value.name,
                    "onUpdate:modelValue": u[0] || (u[0] = (t) => r.value.name = t),
                    rules: [
                      (t) => !ae.value.includes(t.trim()) || e(i)("menu.catalog.validation.name_used"),
                      (t) => !!t || e(i)("menu.catalog.validation.name_required")
                    ],
                    autofocus: "",
                    label: e(i)("menu.catalog.form.name")
                  }, null, 8, ["modelValue", "rules", "label"]),
                  o(te, {
                    label: e(i)("menu.catalog.form.tax.title")
                  }, {
                    default: g(() => {
                      var t, b;
                      return [
                        o(w, {
                          "model-value": (t = r.value.taxSetting) == null ? void 0 : t.mode,
                          "onUpdate:modelValue": u[1] || (u[1] = (n) => {
                            n === e(P).AUTO ? j.value = e(B).autoTax() : j.value = e(B).manualTax(Y.value);
                          })
                        }, {
                          default: g(() => [
                            o(k, {
                              value: e(P).AUTO,
                              label: e(i)("menu.catalog.form.tax.auto.label"),
                              sublabel: e(i)("menu.catalog.form.tax.auto.sublabel")
                            }, null, 8, ["value", "label", "sublabel"]),
                            o(k, {
                              value: e(P).MANUAL,
                              label: e(i)("menu.catalog.form.tax.manual.label"),
                              sublabel: e(i)("menu.catalog.form.tax.manual.sublabel")
                            }, null, 8, ["value", "label", "sublabel"])
                          ]),
                          _: 1
                        }, 8, ["model-value"]),
                        ((b = r.value.taxSetting) == null ? void 0 : b.mode) === e(P).MANUAL ? (p(), F("div", $e, [
                          (p(!0), F(K, null, X(Y.value, (n) => (p(), V(A, {
                            key: n.systemCode,
                            "model-value": n.inclusive,
                            value: !0,
                            label: e(i)("menu.catalog.form.tax.inclusive", { code: n.systemCode }),
                            "onUpdate:modelValue": (h) => {
                              L({
                                ...n,
                                inclusive: h
                              });
                            }
                          }, null, 8, ["model-value", "label", "onUpdate:modelValue"]))), 128))
                        ])) : z("", !0)
                      ];
                    }),
                    _: 1
                  }, 8, ["label"])
                ]),
                _: 1
              }, 8, ["title"]),
              y.value ? (p(), V(te, {
                key: 0,
                label: e(i)("menu.catalog.form.link.title")
              }, {
                default: g(() => [
                  o($, {
                    "model-value": r.value.orderFrom && r.value.orderFrom !== e(M.F_ORDER_FROM).enum.NONE,
                    label: e(i)("menu.catalog.form.link.auto_link.label"),
                    "label-placement": "right",
                    sublabel: e(i)("menu.catalog.form.link.auto_link.sublabel"),
                    "onUpdate:modelValue": u[2] || (u[2] = (t) => r.value.orderFrom = t ? e(M.F_ORDER_FROM).enum.ALL : e(M.F_ORDER_FROM).enum.NONE)
                  }, null, 8, ["model-value", "label", "sublabel"]),
                  r.value.orderFrom !== e(M.F_ORDER_FROM).enum.NONE ? (p(), V(s, {
                    key: 0,
                    class: "ml-[60px]",
                    items: [
                      {
                        label: e(i)("menu.catalog.form.link.options.all"),
                        value: e(M.F_ORDER_FROM).enum.ALL
                      },
                      {
                        label: e(i)("menu.catalog.form.link.options.pos_only"),
                        value: e(M.F_ORDER_FROM).enum.POS_ONLY
                      }
                    ],
                    "model-value": r.value.orderFrom,
                    "onUpdate:modelValue": u[3] || (u[3] = (t) => r.value.orderFrom = t)
                  }, null, 8, ["items", "model-value"])) : z("", !0)
                ]),
                _: 1
              }, 8, ["label"])) : z("", !0),
              y.value ? (p(), V(te, {
                key: 1,
                label: e(i)("menu.catalog.form.markup.title")
              }, {
                default: g(() => [
                  o($, {
                    "model-value": !!r.value.markupOptions,
                    label: e(i)("menu.catalog.form.markup.auto.label"),
                    "label-placement": "right",
                    sublabel: e(i)("menu.catalog.form.markup.auto.sublabel"),
                    "onUpdate:modelValue": u[4] || (u[4] = (t) => r.value.markupOptions = t ? [] : null)
                  }, null, 8, ["model-value", "label", "sublabel"]),
                  v("div", Ie, [
                    o(me, {
                      categories: e(C).categories,
                      items: e(C).items,
                      action: "add",
                      "onUpdate:modelValue": u[5] || (u[5] = (t) => t && (r.value.markupOptions = [...r.value.markupOptions ?? [], t]))
                    }, {
                      default: g(({ trigger: t }) => [
                        o(a, {
                          "text-color": e(Z).ColorPrimary,
                          "border-color": e(Z).ColorPrimary,
                          variant: e(W).Secondary,
                          label: e(i)("menu.catalog.form.markup.add"),
                          "prepend-icon": "add",
                          onClick: t
                        }, null, 8, ["text-color", "border-color", "variant", "label", "onClick"])
                      ]),
                      _: 1
                    }, 8, ["categories", "items"]),
                    (p(!0), F(K, null, X(r.value.markupOptions, (t, b) => (p(), V(me, {
                      key: b,
                      categories: e(C).categories,
                      items: e(C).items,
                      "model-value": t,
                      action: "update",
                      "onUpdate:modelValue": (n) => n && U(b, n)
                    }, {
                      default: g(({ trigger: n }) => [
                        o(O, {
                          id: JSON.stringify(t),
                          class: "py-12 px-16 cursor-pointer",
                          variant: "outlined",
                          onClick: n
                        }, {
                          default: g(() => [
                            v("div", Be, [
                              v("div", Pe, [
                                o(l, { class: "text-fm-color-typo-info bg-fm-color-system-info-100 font-semibold" }, {
                                  default: g(() => [
                                    xe(N(e(i)("menu.catalog.form.markup.percentage", { value: t.percentage })), 1)
                                  ]),
                                  _: 2
                                }, 1024),
                                v("p", ze, N(e(i)("menu.catalog.form.markup.config", { number: b + 1 })), 1),
                                v("p", Ge, N(t.includeItems ? e(i)("menu.catalog.form.markup.products", {
                                  count: t.includeItems.length
                                }) : e(i)("menu.catalog.form.markup.all_items")), 1)
                              ]),
                              o(a, {
                                variant: e(W).Tertiary,
                                "prepend-icon": "delete",
                                onClick: (h) => q(b)
                              }, null, 8, ["variant", "onClick"])
                            ])
                          ]),
                          _: 2
                        }, 1032, ["id", "onClick"])
                      ]),
                      _: 2
                    }, 1032, ["categories", "items", "model-value", "onUpdate:modelValue"]))), 128))
                  ])
                ]),
                _: 1
              }, 8, ["label"])) : z("", !0),
              o(we, {
                modelValue: r.value,
                "onUpdate:modelValue": u[6] || (u[6] = (t) => r.value = t),
                "is-main-catalog": !1,
                "is-v4": y.value
              }, null, 8, ["modelValue", "is-v4"])
            ])
          ]),
          _: 1
        }, 8, ["modelValue", "is-container", "is-container-props"])
      ], 64);
    };
  }
}), de = je, Ye = {
  key: 0
}, He = {
  class: "flex justify-end items-center"
}, We = {
  class: "w-[320px]"
}, qe = {
  key: 1,
  class: "flex-1 flex flex-col min-h-0"
}, Je = {
  class: "p-8"
}, Qe = {
  class: "flex flex-1 flex-col min-h-0 overflow-scroll divide-y divide-fm-color-neutral-gray-100 pb-64"
}, Xe = ["onClick"], Ze = {
  class: "flex-1 space-y-4"
}, ea = {
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
}, aa = {
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
}, la = {
  class: "fm-typo-en-body-lg-600"
}, ta = {
  class: "flex flex-row"
}, oa = {
  class: "fm-typo-en-title-md-600"
}, na = {
  key: 0,
  class: "space-y-24"
}, oe = "main", xa = /* @__PURE__ */ se({
  __name: "Catalog",
  setup(ee) {
    const D = _e(), d = pe(), S = ye(), R = ge(S), y = Ve(), C = fe(R), E = Fe(), {
      t: m
    } = ue(), r = x(() => {
      const s = {};
      return D.restaurants.value.forEach((a) => {
        s[a._id] = a;
      }), s;
    }), ae = x(() => new Map(d.state.menu.modules.item.map((s) => [s._id, s])));
    function j(s, a) {
      var t, b, n, h;
      const l = r.value[a._id], O = [...a.linkedDeliveryCatalogs.map((T) => ({
        label: `Delivery (${T.name})`,
        selector: T.catalog
      })), {
        label: "Delivery (FoodPanda integration)",
        selector: (t = l == null ? void 0 : l.foodpandaDelivery) == null ? void 0 : t.catalogId
      }, {
        label: "Delivery (GrabFood integration)",
        selector: (b = l == null ? void 0 : l.grabfoodDelivery) == null ? void 0 : b.catalogId
      }, {
        label: "Delivery (ShopeeFood integration)",
        selector: (n = l == null ? void 0 : l.shopeefoodDelivery) == null ? void 0 : n.catalogId
      }];
      return [{
        label: "Dine-in",
        selector: a.catalogId
      }, {
        label: "Takeaway",
        selector: a.takeawayCatalog || a.catalogId
      }, {
        label: "Pickup",
        selector: a.pickupCatalog || null
      }, {
        label: "Additional",
        selector: a.additionalCatalogs
      }, {
        label: "Delivery (In house)",
        selector: a.inHouseDelivery
      }, {
        label: "Delivery (Feedme express)",
        selector: (h = l == null ? void 0 : l.feedmeDelivery) == null ? void 0 : h.catalogId
      }, ...ie(O, {
        selector: "label"
      })].filter((T) => s ? Array.isArray(T.selector) ? T.selector.includes(s) : T.selector === s : T.selector === null).map((T) => T.label);
    }
    function Y(s) {
      return d.state.restaurants.map((a) => ({
        id: a._id,
        name: a.name,
        usage: j(s, a)
      })).filter((a) => a.usage.length > 0);
    }
    const L = G(!1), U = G(""), q = x(() => {
      var a;
      return [{
        id: oe,
        name: m("menu.catalog.main"),
        taxes: ((a = d.state.menu.masterCatalogSetting) == null ? void 0 : a.inclusiveTaxes) || null,
        doc: null,
        disableDelete: !0,
        defaultOrderFrom: null
      }, ...d.catalogs.map((l) => ({
        id: l._id,
        name: l.name,
        taxes: l.inclusiveTaxes || null,
        // Use markRaw + toRaw to avoid making a giant proxy while preventing Vue from
        // trying to wrap it again. Object.freeze on a reactive proxy caused runtime
        // errors with read-only property traps ("get on proxy: property 'override' ...").
        // markRaw ensures the catalog snapshot stays non-reactive here without those errors.
        doc: Ce(ke(l)),
        disableDelete: !1,
        defaultOrderFrom: l.defaultOrderFrom
      }))].map((l) => {
        var t;
        const O = Y(((t = l.doc) == null ? void 0 : t._id) || null), I = l.doc ? Ne.getSellingItem(l.doc, ae.value) : d.state.menu.modules.item;
        return {
          ...l,
          taxMode: l.taxes ? "Manual" : "Automatic",
          autoLink: l.defaultOrderFrom !== M.F_ORDER_FROM.enum.NONE ? "Activated" : "Deactivated",
          restaurants: ie(O, {
            selector: "name"
          }),
          totalProducts: I.length,
          disableDelete: l.disableDelete
        };
      });
    }), H = x(() => q.value.filter((s) => s.id !== oe)), i = x(() => H.value.filter((s) => s.name.toLowerCase().includes(U.value.toLowerCase()))), c = (s) => {
      d.selectCatalog(s === oe ? null : s), E.push({
        name: ce.EDIT_CATALOG_PRODUCT,
        params: {
          id: s
        }
      });
    }, u = G(null);
    function f(s) {
      var a;
      (a = u.value) == null || a.trigger(null, {
        ...s.doc,
        name: `${s.name} copy`
      });
    }
    async function k(s) {
      const a = d.state.restaurants.filter((l) => [...l.additionalCatalogs, l.inHouseDelivery, ...l.linkedDeliveryCatalogs.map((O) => O.catalog), l.pickupCatalog, l.takeawayCatalog, l.catalogId].includes(s.id)).map((l) => l.name);
      a.length > 0 ? S.open({
        type: "error",
        message: m("menu.catalog.dialogs.remove.error", {
          restaurants: a
        })
      }) : y.open({
        title: m("menu.catalog.dialogs.remove.title"),
        message: m("menu.catalog.dialogs.remove.message", {
          name: s.name
        }),
        primaryActions: {
          text: m("menu.common.actions.remove"),
          close: !0,
          variant: W.Destructive
        },
        secondaryActions: {
          text: m("menu.common.actions.cancel"),
          close: !0
        }
      }).onPrimary(async () => {
        await C.updateMenu({
          module: M.F_MENU_MODULE_V4_KEY.enum.catalog,
          operation: ve.F_OPERATION_TYPE.delete,
          data: s.id
        }, s.name, !0), d.selectCatalog(null), await E.push({
          name: ce.CATALOG
        });
      });
    }
    const w = x(() => [{
      accessorKey: "name",
      header: () => m("menu.catalog.table.columns.title"),
      enableSorting: !1
    }, {
      accessorKey: "taxMode",
      header: () => m("menu.catalog.table.columns.tax_calculation"),
      enableSorting: !1
    }, {
      accessorKey: "autoLink",
      header: () => m("menu.catalog.table.columns.auto_link"),
      enableSorting: !1,
      cell: (s) => {
        const a = s.row.original;
        return J("div", {
          class: "flex justify-between"
        }, [a.autoLink]);
      }
    }, {
      id: "actions",
      size: 52,
      meta: {
        cellClass: "pl-16",
        headerContentClass: "-mx-16"
      },
      header: "",
      cell: (s) => {
        const a = s.row.original;
        return J("div", {
          class: "flex justify-end"
        }, [J(ne.FmButton, {
          icon: "file_copy",
          disabled: !a.id,
          variant: "tertiary",
          textColor: "neutral-gray-400",
          onClick: Q(async () => {
            await f(a);
          }, ["stop", "prevent"])
        }), J(ne.FmButton, {
          icon: "delete",
          disabled: !a.id,
          variant: "tertiary",
          textColor: "neutral-gray-400",
          onClick: Q(async () => {
            await k(a);
          }, ["stop", "prevent"])
        })]);
      }
    }]), A = De(), $ = x(() => A.breakpoints.value.xs);
    return (s, a) => {
      const l = _("fm-button"), O = _("FmSearch"), I = _("FmTable"), t = _("FmButton"), b = _("fm-side-sheet");
      return p(), V(Ae, {
        heading: e(m)("menu.catalog.title")
      }, {
        "append-heading": g(() => [H.value.length > 0 ? (p(), V(e(de), {
          key: 0,
          ref_key: "createCatalogManagerFormRef",
          ref: u
        }, {
          default: g(({
            trigger: n
          }) => [v("div", {
            class: he([["xs:fixed xs:z-10 xs:bottom-[68px] xs:right-16"], "ml-auto xs:ml-0 flex flex-row gap-8"])
          }, [o(l, {
            label: e(m)("menu.catalog.actions.view_usage"),
            onClick: a[0] || (a[0] = (h) => L.value = !0),
            variant: "secondary"
          }, null, 8, ["label"]), o(l, {
            label: e(m)("menu.catalog.actions.add"),
            "prepend-icon": "add",
            onClick: n
          }, null, 8, ["label", "onClick"])])]),
          _: 1
        }, 512)) : z("", !0)]),
        default: g(() => [H.value.length === 0 ? (p(), V(e(Me), {
          key: 0,
          subtitle: e(m)("menu.catalog.empty.subtitle"),
          title: e(m)("menu.catalog.empty.title")
        }, {
          action: g(() => [o(e(de), null, {
            default: g(({
              trigger: n
            }) => [o(l, {
              label: e(m)("menu.catalog.actions.add"),
              "prepend-icon": "add",
              onClick: n
            }, null, 8, ["label", "onClick"])]),
            _: 1
          })]),
          _: 1
        }, 8, ["subtitle", "title"])) : (p(), F(K, {
          key: 1
        }, [$.value ? (p(), F("div", qe, [v("div", Je, [o(O, {
          autofocus: "",
          modelValue: U.value,
          "onUpdate:modelValue": a[3] || (a[3] = (n) => U.value = n),
          class: "w-full",
          placeholder: e(m)("menu.common.labels.search_placeholder", {
            type: e(m)("menu.catalog.title")
          })
        }, null, 8, ["modelValue", "placeholder"])]), v("div", Qe, [(p(!0), F(K, null, X(i.value, (n) => (p(), F("div", {
          key: n.id,
          class: "flex flex-row py-12 px-16 items-center",
          onClick: (h) => c(n.id)
        }, [v("div", Ze, [v("p", ea, " Tax calculation: " + N(n.taxMode), 1), v("p", aa, " Auto link product: " + N(n.autoLink), 1), v("p", la, N(n.name), 1)]), v("div", ta, [o(t, {
          "text-color": e(Z).NeutralGray400,
          variant: e(W).Tertiary,
          "prepend-icon": "file_copy",
          onClick: Q((h) => f(n), ["stop"])
        }, null, 8, ["text-color", "variant", "onClick"]), o(t, {
          "text-color": e(Z).NeutralGray400,
          variant: e(W).Tertiary,
          "prepend-icon": "delete",
          onClick: Q((h) => k(n), ["stop"])
        }, null, 8, ["text-color", "variant", "onClick"])])], 8, Xe))), 128))])])) : (p(), F("div", Ye, [v("div", He, [v("div", We, [o(O, {
          modelValue: U.value,
          "onUpdate:modelValue": a[1] || (a[1] = (n) => U.value = n),
          autofocus: "",
          class: "mb-8",
          placeholder: e(m)("menu.common.labels.search_placeholder", {
            type: e(m)("menu.catalog.title")
          })
        }, null, 8, ["modelValue", "placeholder"])])]), o(Se, null, {
          default: g(() => [o(I, {
            "column-defs": w.value,
            "row-data": i.value,
            "page-size": i.value.length,
            "hide-footer": !0,
            "shrink-at": !1,
            virtual: !0,
            "search-value": U.value,
            onRowClick: a[2] || (a[2] = (n) => c(n.original.id))
          }, null, 8, ["column-defs", "row-data", "page-size", "search-value"])]),
          _: 1
        })])), o(b, {
          modelValue: L.value,
          "onUpdate:modelValue": a[4] || (a[4] = (n) => L.value = n),
          "max-width": 1e3,
          "dismiss-away": ""
        }, {
          "side-sheet-header": g(() => [v("p", oa, N(e(m)("menu.catalog.usage.title")), 1)]),
          default: g(() => [L.value ? (p(), F("div", na, [(p(!0), F(K, null, X(q.value, (n, h) => (p(), V(Re, {
            key: h,
            catalog: n
          }, null, 8, ["catalog"]))), 128))])) : z("", !0)]),
          _: 1
        }, 8, ["modelValue"])], 64))]),
        _: 1
      }, 8, ["heading"]);
    };
  }
});
export {
  xa as default
};
