import { am as e, U as t, ag as s, ah as a, an as r, aj as o, ao as i, a as n, ap as l, aq as p, w as c, a6 as m, ar as d, as as g } from "./index-6d97e67f.js";
import "./lodash-226cb5b1.js";
import { lA as j, lR as u, lS as h } from "./ant-design-icons-a81e6d18.js";
import "./loglevel-5e7e37fc.js";
import { memo as f } from "react";
import { d as b } from "./styled-components-b776227d.js";
import { M as v, S as y, D as w } from "./antd-eb0b81b8.js";
import "./axios-0ffd51b8.js";
import "./redux-devtools-36ca30b8.js";
import "./alasql-f59e855e.js";
import "./react-router-38313ddc.js";
import "./fontawesome-7bcd29b1.js";
import "react-dom";
import "./dnd-kit-e0a0bf75.js";
import "./moment-d731d247.js";
import "./crypto-js-8020edb5.js";
import "./dayjs-63343308.js";
import "./numbro-48e81844.js";
import "./papaparse-088c0adc.js";
import "./uuid-82f303b2.js";
import "./supabase-6aa220db.js";
import "./websockets-80729b50.js";
import "./fetch-03ca8116.js";
import "./react-draggable-1ced44e5.js";
import "./clsx-b06d39d3.js";
import "./remark-gfm-72b87c7d.js";
import "./buffer-f89d742d.js";
import "./rehype-raw-49057806.js";
import "./parse5-31d0cb5d.js";
import "./rehype-sanitize-38a120e4.js";
import "./simplebar-react-a37a9b2a.js";
import "./react-best-gradient-color-picker-2e7ff36d.js";
import "./ua-parser-js-1d18a3f8.js";
import "./codemirror-8fe65581.js";
import "./really-relaxed-json-e5391d6a.js";
import "./immer-c0428a8d.js";
import "./redux-saga-3b3a9c7b.js";
import "./hotkeys-js-216206c9.js";
import "./cnchar-8c3eaa86.js";
import "./react-documents-a03b99c9.js";
import "./sql-formatter-69e8df59.js";
import "./rc-trigger-7d152aa4.js";
import "./react-json-view-364658b4.js";
import "./qrcode-react-417e3716.js";
import "./katex-05fb1c31.js";
import "./ecogis-maps-10e82de5.js";
import "./devextreme-be18bda8.js";
import "./exceljs-1678d36b.js";
import "./file-saver-es-c18fae8f.js";
const x = b.div`
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;

  .lang-switch {
    transition: all 0.2s;

    &:hover {
      background: #f3f4f6;
    }
  }
`, C = function() {
  const t2 = { selectedLang: n({}) };
  return new e(t2, (e2, t3) => ({ selectedLang: e2.selectedLang, updateSelection: (e3) => {
    t3(l("selectedLang", e3, true));
  } })).build();
}(), V = { options: p, defaultValue: c(m, "vi"), size: c(m, "20px"), borderRadius: c(m, "0"), selectionControl: C, onEvent: d([{ label: "onOpenChange", value: "onOpenChange", description: "" }]) }, k = f((e2) => {
  var _a;
  if ((t2 = e2.selectionControl.selectedLang) && 0 === Object.keys(t2).length && t2.constructor === Object || !((_a = e2.selectionControl.selectedLang) == null ? void 0 : _a.value)) {
    const t3 = e2.options.find((t4) => t4.value === e2.defaultValue);
    t3 && e2.selectionControl.updateSelection(t3);
  }
  var t2;
  const s2 = e2.options.map((t3) => ({ key: t3.value, label: j(v.Item, { onClick: () => {
    return s3 = t3, e2.selectionControl.updateSelection(s3), void e2.onEvent("onOpenChange");
    var s3;
  }, className: "lang-item", style: { padding: 0, backgroundColor: "transparent" }, children: u(y, { children: [j("img", { src: t3.icon, width: "16px", alt: t3.label }), t3.label] }) }) })), a2 = e2.selectionControl.selectedLang;
  return j(x, { $height: e2.size, children: j(w, { menu: { items: s2 }, className: "lang-dropdown", children: j("div", { className: "lang-switch", style: { height: `calc(${e2.size}px + 10px)`, display: "flex", alignItems: "center" }, children: a2 && j("img", { src: a2.icon, height: e2.size, style: { borderRadius: e2.borderRadius }, alt: a2.label }) }) }) });
});
let L = new t(V, (e2) => {
  const t2 = s({ ...e2 }, "LangComp");
  return j(k, { ...t2 });
}).setPropertyViewFn((e2) => u(h, { children: [u(a, { name: r.basic, children: [e2.options.getPropertyView(), e2.defaultValue.propertyView({ label: "DefaultValue" }), e2.size.propertyView({ label: "Size" }), e2.borderRadius.propertyView({ label: "borderRadius" })] }), j(a, { name: "Interaction", children: e2.onEvent.getPropertyView() })] })).build();
L = g(L, [{ method: { name: "setLanguage", description: "", params: [{ name: "lang", type: "string" }] }, execute: (e2, t2) => {
  const s2 = t2[0];
  if (s2) {
    const t3 = e2.children.options.getView().find((e3) => e3.value === s2);
    t3 && e2.children.selectionControl.children.selectedLang.dispatchChangeValueAction(t3);
  }
} }]);
const z = o(L, [new i("language", (e2) => ({ language: e2.children.selectionControl.children.selectedLang.node() }), (e2) => e2.language, "Get selected language")]);
function N() {
  return { options: { data: JSON.stringify([{ languageCode: "vi", languageName: "Tiếng Việt", flag: "https://vnpt.com.vn/design/images/icon/vi.png" }, { languageCode: "en", languageName: "English", flag: "https://vnpt.com.vn/design/images/icon/en.png" }]) } };
}
export {
  z as LangComp,
  N as defaultLangData
};
