react-luminus-components 1.2.79 → 1.2.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.es.js CHANGED
@@ -1,12 +1,12 @@
1
- import { j as s, c as w, t as re, a as ie, g as cr, T as lr, b as ur, s as jt, E as dr, d as hr, e as mr, f as fr, h as pr, u as V, i as de, k as Qt, F as kt, l as gr, m as wr, n as xr, o as yr, p as br, q as vr, r as _r, v as jr, w as lt, x as ut, y as kr, z as Cr, P as _e, A as he, B as Nr, C as $r, D as dt, S as Ct, G as Pe, H as Ae, I as ht, J as Ir, K as Xt, L as Ie, M as qe, O as Nt, N as Sr, Q as oe, R as Tr, U as Er, V as Jt, W as mt, X as ft, Y as Or, Z as Ze, _ as z, $ as Ve, a0 as ke, a1 as Zt, a2 as xe, a3 as Mr, a4 as Dr, a5 as en, a6 as Pr, a7 as tn, a8 as Ar, a9 as Fr, aa as Wr, ab as Rr, ac as nn, ad as Lr, ae as qr, af as Yr, ag as Br } from "./UserAvatarToggle-ByG1NTlM.js";
2
- import { ai as yl, ah as bl } from "./UserAvatarToggle-ByG1NTlM.js";
1
+ import { j as s, c as w, t as re, a as ie, g as cr, T as lr, b as ur, s as jt, E as dr, d as hr, e as mr, f as fr, h as pr, u as V, i as de, k as Qt, F as kt, l as gr, m as wr, n as xr, o as yr, p as br, q as vr, r as _r, v as jr, w as lt, x as ut, y as kr, z as Cr, P as _e, A as he, B as Nr, C as $r, D as dt, S as Ct, G as Pe, H as Ae, I as ht, J as Ir, K as Xt, L as Ie, M as qe, O as Nt, N as Sr, Q as oe, R as Tr, U as Er, V as Jt, W as mt, X as ft, Y as z, Z as Or, _ as Zt, $ as Mr, a0 as en, a1 as Dr, a2 as Pr, a3 as Ar, a4 as Fr, a5 as tn, a6 as ke, a7 as Wr, a8 as Rr, a9 as Lr, aa as qr, ab as Yr, ac as Ze, ad as Ve, ae as nn, af as xe, ag as Br } from "./NoInputContainer-D_sgAiux.js";
2
+ import { ai as yl, ah as bl } from "./NoInputContainer-D_sgAiux.js";
3
3
  import * as A from "react";
4
- import J, { useCallback as O, useMemo as Q, useEffect as D, useRef as Y, useState as P, useReducer as rn, useContext as F, createElement as Hr, Component as Gr, isValidElement as Vr, Suspense as Ur } from "react";
5
- import { c as le, d as zr, C as Kr, a as on, u as Qr, q as $t, E as Fe, M as We, L as Xr } from "./EventType-CpXqyU6N.js";
4
+ import J, { useCallback as O, useMemo as Q, useEffect as D, useRef as Y, useState as P, useReducer as rn, useContext as F, Component as Hr, isValidElement as Gr, Suspense as Vr, createElement as Ur } from "react";
5
+ import { c as le, d as zr, C as Kr, a as on, u as Qr, q as $t, E as Fe, M as We, L as Xr } from "./EventType-DiHqEDqn.js";
6
6
  import { useFormContext as me, Controller as sn } from "react-hook-form";
7
7
  import { m as Jr, a as an } from "./textUtils-BbxuIsKq.js";
8
- import { u as cn, a as ln, b as un } from "./useFormControlType-oJGqgThz.js";
9
- import { S as _l } from "./SimpleTooltip-Dlu42YM6.js";
8
+ import { u as cn, a as ln, b as un } from "./useFormControlType-BAFqxupC.js";
9
+ import { S as _l } from "./SimpleTooltip-CXeUwU65.js";
10
10
  const qc = ({ fileLoader: t, fileName: e, children: n }) => {
11
11
  const r = O(async () => {
12
12
  var l;
@@ -2963,1016 +2963,1016 @@ const Fa = "_button_1wjon_1", Wa = "_filled_1wjon_7", Ra = "_sm_1wjon_13", La =
2963
2963
  ] });
2964
2964
  }, Qa = "_widget_etgh3_1", Xa = {
2965
2965
  widget: Qa
2966
- }, Hc = ({ heading: t, content: e, placement: n, children: r, trigger: o }) => /* @__PURE__ */ s.jsx(Or, { placement: n, overlay: /* @__PURE__ */ s.jsxs(Ze, { className: "luminus-tooltip", children: [
2967
- /* @__PURE__ */ s.jsx(Ze.Header, { children: typeof t == "string" ? /* @__PURE__ */ s.jsx(z, { variant: "h6", className: "text-primary", children: t }) : t }),
2968
- /* @__PURE__ */ s.jsx(Ze.Body, { children: e })
2969
- ] }), trigger: o ?? "hover", rootClose: !0, children: r }), rr = ({ currentSelection: t, selectedItemNavigateTo: e, children: n }) => {
2970
- const { LinkComponent: r } = F(oe);
2971
- if (!t || !t.id || !e)
2972
- return /* @__PURE__ */ s.jsx("div", { className: "luminus-input-container position-relative w-100", children: n });
2973
- const o = e(t);
2974
- return /* @__PURE__ */ s.jsx(r, { to: o, className: "luminus-input-container position-relative w-100 text-decoration-none", children: n });
2975
- }, Gc = ({ InputContainer: t = Ve, label: e, value: n, onChange: r, hidden: o, disabled: a, className: i, type: l, withoutLabel: c }) => /* @__PURE__ */ s.jsx(t, { isForCheckInput: !0, hidden: o, label: e ?? "", withoutLabel: c, className: i, children: /* @__PURE__ */ s.jsx(ee.Check, { id: `check-${e}`, type: l ?? "checkbox", label: e ?? "", checked: n, onChange: (u) => {
2976
- var d;
2977
- r && r(((d = u.target) == null ? void 0 : d.checked) ?? !1);
2978
- }, className: i ?? "", hidden: o ?? !1, disabled: a ?? !1 }) }), Vc = ({ InputContainer: t = Ve, type: e, value: n, onChange: r, debounceMs: o, label: a, withoutLabel: i, placeholder: l, size: c, hidden: u, disabled: d, showClearIcon: h, clearValue: m, list: p, className: v, step: x }) => {
2979
- const f = e === "number", j = O(() => {
2980
- if (!r)
2981
- return;
2982
- const N = m ?? null;
2983
- r(f ? N ? Number(N) : null : (N == null ? void 0 : N.toString()) ?? "");
2984
- }, [m, f, r]), b = Y(null), [g, C] = P((n == null ? void 0 : n.toString()) ?? ""), k = O((N) => {
2985
- const _ = N;
2986
- r && (f && r(_ == null || _ === "" ? null : Number(_)), r(_ || null));
2987
- }, [f, r]), y = O((N) => {
2988
- var T;
2989
- const _ = (T = N.target) == null ? void 0 : T.value;
2990
- if (!o) {
2991
- k(_);
2992
- return;
2993
- }
2994
- C(_), b.current !== null && window.clearTimeout(b.current), b.current = window.setTimeout(() => {
2995
- k(_);
2996
- }, o);
2997
- }, [o, k]);
2998
- D(() => {
2999
- C(n === null ? "" : n.toString());
3000
- }, [n]);
3001
- const [$, M] = P(!1), S = cn(e, n ? n.toString() ?? null : null, $);
3002
- return /* @__PURE__ */ s.jsxs(t, { withoutLabel: i, label: a ?? "", hidden: u, className: v, children: [
3003
- /* @__PURE__ */ s.jsx(ee.Control, { type: S, placeholder: l ?? a, size: c, value: o ? g : n ?? "", onChange: y, className: v ?? "", hidden: u, disabled: d ?? !1, list: p, onFocus: () => M(!0), onBlur: () => M(!1), step: x }),
3004
- h && n && r && !d && /* @__PURE__ */ s.jsx("div", { className: `luminus-input-remove-icon ${e !== "text" ? "inset" : ""}`, children: /* @__PURE__ */ s.jsx(Z, { color: "secondary", size: "sm", onClick: j, children: /* @__PURE__ */ s.jsx(ke, {}) }) })
3005
- ] });
3006
- }, Uc = ({
3007
- InputContainer: t = Ve,
3008
- value: e,
3009
- options: n,
3010
- onChange: r,
3011
- label: o,
3012
- withoutLabel: a,
3013
- isNumber: i,
3014
- size: l,
3015
- hidden: c,
3016
- disabled: u,
3017
- showClearIcon: d,
3018
- clearValue: h,
3019
- noSortOptions: m,
3020
- className: p,
3021
- noEmptyOption: v
3022
- // it will still add the empty option if there is no value provided or value is empty string or null
3023
- }) => {
3024
- const x = O(() => {
3025
- if (!r)
3026
- return;
3027
- const f = h ?? null;
3028
- r(i ? f ? Number(f) : null : (f == null ? void 0 : f.toString()) ?? "");
3029
- }, [h, i, r]);
3030
- return /* @__PURE__ */ s.jsxs(t, { withoutLabel: a, label: o ?? "", hidden: c, className: p, children: [
3031
- /* @__PURE__ */ s.jsxs(ee.Select, { size: l, value: e ?? "", onChange: (f) => {
3032
- var b;
3033
- if (!r)
3034
- return;
3035
- const j = (b = f.target) == null ? void 0 : b.value;
3036
- i && r(j ? parseInt(j, 10) : null), r(j || null);
3037
- }, className: p ?? "", hidden: c, disabled: u ?? !1, children: [
3038
- v && !(e == null || e === "") ? void 0 : /* @__PURE__ */ s.jsx("option", { value: "" }),
3039
- n == null ? void 0 : n.sort((f, j) => m ? 0 : (f.name ?? "").localeCompare(j.name ?? "")).map((f) => /* @__PURE__ */ s.jsx("option", { value: f.id ?? "", children: f.name }, f.id))
3040
- ] }),
3041
- d && e && r && !u && /* @__PURE__ */ s.jsx("div", { className: "luminus-input-remove-icon inset", children: /* @__PURE__ */ s.jsx(Z, { color: "secondary", size: "sm", onClick: x, children: /* @__PURE__ */ s.jsx(ke, {}) }) })
2966
+ }, Ja = ({ show: t, widgets: e, handleClose: n, onWidgetPicked: r, texts: o }) => /* @__PURE__ */ s.jsxs(We, { show: t, onHide: () => n(), children: [
2967
+ /* @__PURE__ */ s.jsx(We.Header, { closeButton: !0, children: /* @__PURE__ */ s.jsx(We.Title, { children: o.pickWidgetToAdd }) }),
2968
+ /* @__PURE__ */ s.jsx(We.Body, { children: /* @__PURE__ */ s.jsx("div", { className: "list-group", children: e.filter((a) => a.id >= 0).map((a) => /* @__PURE__ */ s.jsx("div", { role: "button", className: "list-group-item bg-white", onClick: () => r(a.id), children: /* @__PURE__ */ s.jsx(z, { variant: "body", children: a.name }) })) }) })
2969
+ ] }), Bt = ({ availableWidgets: t, onAdd: e, texts: n }) => {
2970
+ const [r, o] = P(!1);
2971
+ return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
2972
+ /* @__PURE__ */ s.jsx("div", { className: w("luminus-empty-widget", Xa.widget), children: /* @__PURE__ */ s.jsx(Z, { onClick: () => o(!0), children: /* @__PURE__ */ s.jsx(Or, {}) }) }),
2973
+ /* @__PURE__ */ s.jsx(Ja, { show: r, widgets: t, handleClose: () => o(!1), onWidgetPicked: (a) => {
2974
+ o(!1), e(a);
2975
+ }, texts: n })
3042
2976
  ] });
3043
- }, zc = ({ InputContainer: t = Ve, items: e, defaultSelection: n, selectedItemNavigateTo: r, onSearchQueryChange: o, texts: a, isLoading: i, isNumber: l, onSelect: c, label: u, withoutLabel: d, size: h, dropdownItemsNameWidth: m, additionalColumns: p, hidden: v, disabled: x, displayIdAsName: f, CustomOnChangeComponent: j, className: b }) => {
3044
- var T, W;
3045
- const [g, C] = P(n), [k, y] = P(!1);
3046
- D(() => {
3047
- C(n);
3048
- }, [n]);
3049
- const $ = O((R) => {
3050
- C(R);
3051
- }, []), M = O((R) => {
3052
- y(!1), $(R);
3053
- }, [$]);
2977
+ }, Za = (t) => {
2978
+ const [e, n] = P({ widgets: [] });
3054
2979
  D(() => {
3055
- c && c(g);
3056
- }, [g, c]);
3057
- const S = Y(null), N = r !== void 0, _ = N && g !== null;
3058
- return /* @__PURE__ */ s.jsx(s.Fragment, { children: /* @__PURE__ */ s.jsxs(t, { withoutLabel: d, label: u ?? "", hidden: v, inputContainerClassName: w({ "luminus-dropdown-select-open": k }), className: b, children: [
3059
- /* @__PURE__ */ s.jsxs(rr, { currentSelection: g, selectedItemNavigateTo: r, children: [
3060
- f && (g == null ? void 0 : g.name) && /* @__PURE__ */ s.jsx(z, { variant: "caption", className: "d-flex justify-content-end mt-2 luminus-dropdown-selection-name", children: g.name }),
3061
- /* @__PURE__ */ s.jsxs(ee.Select, { ref: S, size: h, value: (g == null ? void 0 : g.id) ?? "", onChange: (R) => C({
3062
- id: l ? Number(R.target.value) ?? null : R.target.value,
3063
- name: ""
3064
- }), onMouseDown: (R) => {
3065
- R.currentTarget.focus(), R.preventDefault();
3066
- }, onClick: () => {
3067
- !N && !x && y(!0);
3068
- }, className: w("w-100", {
3069
- "luminus-dropdown-picker-disabled": x,
3070
- "luminus-dropdown-picker-link": _
3071
- }), hidden: v, children: [
3072
- /* @__PURE__ */ s.jsx("option", { value: "" }),
3073
- n && /* @__PURE__ */ s.jsx("option", { value: n.id ?? void 0, children: n.name && ((T = n.name) == null ? void 0 : T.length) > 0 ? n.name : n.id }),
3074
- g && /* @__PURE__ */ s.jsx("option", { value: g.id ?? void 0, children: g.name && ((W = g.name) == null ? void 0 : W.length) > 0 ? g.name : g.id })
3075
- ] }),
3076
- j || !x && N ? /* @__PURE__ */ s.jsxs("div", { className: "custom-picker-button", children: [
3077
- !j && !x && N && /* @__PURE__ */ s.jsx(Z, { size: "sm", color: "secondary", onClick: (R) => {
3078
- R.preventDefault(), R.stopPropagation(), y(!0);
3079
- }, children: /* @__PURE__ */ s.jsx(Zt, {}) }),
3080
- j ?? null
3081
- ] }) : null
2980
+ const o = localStorage.getItem("dashboardConfig");
2981
+ o ? n(JSON.parse(o)) : t && n(t);
2982
+ }, [t]);
2983
+ const r = O((o) => {
2984
+ n(o), localStorage.setItem("dashboardConfig", JSON.stringify(o));
2985
+ }, []);
2986
+ return { dashboardConfig: e, onChangeDashboardConfig: r };
2987
+ }, ei = "_dashboard_16plm_1", ti = "_widgets-grid_16plm_1", ni = "_widget-wrapper_16plm_8", ri = "_full-width_16plm_13", oi = "_widget-edit_16plm_16", si = "_remove-icon_16plm_19", ai = "_full-width-icon_16plm_26", ii = "_widget-edit-overlay_16plm_36", ae = {
2988
+ dashboard: ei,
2989
+ "widgets-grid": "_widgets-grid_16plm_1",
2990
+ widgetsGrid: ti,
2991
+ "widget-wrapper": "_widget-wrapper_16plm_8",
2992
+ widgetWrapper: ni,
2993
+ "full-width": "_full-width_16plm_13",
2994
+ fullWidth: ri,
2995
+ "widget-edit": "_widget-edit_16plm_16",
2996
+ widgetEdit: oi,
2997
+ "remove-icon": "_remove-icon_16plm_19",
2998
+ removeIcon: si,
2999
+ "full-width-icon": "_full-width-icon_16plm_26",
3000
+ fullWidthIcon: ai,
3001
+ "widget-edit-overlay": "_widget-edit-overlay_16plm_36",
3002
+ widgetEditOverlay: ii
3003
+ };
3004
+ class ci extends Hr {
3005
+ constructor(e) {
3006
+ super(e), this.state = { hasError: !1 }, this.reload = this.reload.bind(this);
3007
+ }
3008
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3009
+ static getDerivedStateFromError(e) {
3010
+ return { hasError: !0 };
3011
+ }
3012
+ componentDidCatch(e, n) {
3013
+ console.error("Error:", e, n);
3014
+ }
3015
+ reload() {
3016
+ this.setState({ hasError: !1 });
3017
+ }
3018
+ render() {
3019
+ const { fallback: e, children: n, texts: r, reloadButtonDisplay: o = "append-after-child" } = this.props;
3020
+ return this.state.hasError ? o === "inject-to-child" && Gr(e) ? J.cloneElement(e, {
3021
+ ...e.props
3022
+ }, /* @__PURE__ */ s.jsxs("div", { className: "translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2", children: [
3023
+ ...e.props.children,
3024
+ /* @__PURE__ */ s.jsx(ct, { type: "button", onClick: this.reload, children: r.reloadButtonContent })
3025
+ ] })) : /* @__PURE__ */ s.jsxs("div", { className: "translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2", children: [
3026
+ e,
3027
+ o === "none" ? null : /* @__PURE__ */ s.jsx(ct, { type: "button", onClick: this.reload, children: r.reloadButtonContent })
3028
+ ] }) : n;
3029
+ }
3030
+ }
3031
+ const li = (t) => (n) => {
3032
+ const { errorBoundaryTexts: r } = F(oe);
3033
+ return /* @__PURE__ */ s.jsx(t, { texts: r, ...n });
3034
+ }, ui = li(ci), di = "_widget-card_e9tsb_1", hi = {
3035
+ "widget-card": "_widget-card_e9tsb_1",
3036
+ widgetCard: di
3037
+ }, Ht = ({ children: t, title: e, headerContent: n }) => /* @__PURE__ */ s.jsx(gc, { className: w(hi.widgetCard, "luminus-widget"), title: e, headerContent: n, contentClassName: "h-100 overflow-auto", children: t }), mi = ({ children: t, title: e }) => {
3038
+ const { widgetTexts: n } = F(oe);
3039
+ return /* @__PURE__ */ s.jsx(ui, { fallback: /* @__PURE__ */ s.jsx(Ht, { title: e, children: n.fallbackError }), reloadButtonDisplay: "inject-to-child", children: /* @__PURE__ */ s.jsx(Vr, { fallback: /* @__PURE__ */ s.jsx(Ht, { title: e, children: /* @__PURE__ */ s.jsx(Zr, {}) }), children: t }) });
3040
+ }, Hc = ({ availableWidgets: t, editMode: e, defaultDashboardConfig: n }) => {
3041
+ var d;
3042
+ const { homeDashboardTexts: r } = F(oe), { dashboardConfig: o, onChangeDashboardConfig: a } = Za(n), i = O((h, m) => {
3043
+ var p, v;
3044
+ h === ((p = o.widgets) == null ? void 0 : p.length) ? a({
3045
+ ...o,
3046
+ widgets: [...o.widgets, { widgetId: m, fullWidth: !1 }]
3047
+ }) : a({
3048
+ ...o,
3049
+ widgets: ((v = o.widgets) == null ? void 0 : v.map((x, f) => f === h ? { widgetId: m, fullWidth: !1 } : x)) ?? []
3050
+ });
3051
+ }, [o, a]), l = O((h) => {
3052
+ var m, p;
3053
+ ((m = o.widgets[h]) == null ? void 0 : m.widgetId) === -1 ? a({
3054
+ ...o,
3055
+ widgets: ((p = o.widgets) == null ? void 0 : p.filter((v, x) => x !== h)) ?? []
3056
+ }) : i(h, -1);
3057
+ }, [o, a, i]), c = O((h) => {
3058
+ var m;
3059
+ a({
3060
+ ...o,
3061
+ widgets: ((m = o.widgets) == null ? void 0 : m.map((p, v) => v === h ? { ...p, fullWidth: !p.fullWidth } : p)) ?? []
3062
+ });
3063
+ }, [o, a]), u = O((h, m, p) => h ? /* @__PURE__ */ s.jsxs("div", { className: w(ae.widgetWrapper, {
3064
+ [ae.widgetEdit]: e && h.id !== -1
3065
+ }, { [ae.fullWidth]: p }), children: [
3066
+ e && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3067
+ /* @__PURE__ */ s.jsx(Z, { color: "danger", onClick: () => l(m), className: w(ae.removeIcon), children: /* @__PURE__ */ s.jsx(Zt, {}) }),
3068
+ /* @__PURE__ */ s.jsx(Z, { color: p ? "danger" : "primary", onClick: () => c(m), className: w(ae.fullWidthIcon), children: /* @__PURE__ */ s.jsx(Mr, {}) })
3082
3069
  ] }),
3083
- S.current && /* @__PURE__ */ s.jsx(_t, { show: k, onCancel: () => y(!1), items: e, currentSelection: g, onSelectionChange: M, onSearchQueryChange: o, texts: a, itemsNameWidth: m, additionalColumns: p, isLoading: i, disabled: x, inputRef: S })
3070
+ h.id === -1 ? e && /* @__PURE__ */ s.jsx("div", { className: ae.widgetWrapper, children: /* @__PURE__ */ s.jsx(Bt, { availableWidgets: t, onAdd: (v) => i(m, v), texts: r }) }) : /* @__PURE__ */ s.jsx(mi, { title: h.title, children: /* @__PURE__ */ s.jsx(h.WidgetElement, { title: h.title }) }),
3071
+ h.id > -1 && e && /* @__PURE__ */ s.jsx("div", { className: ae.widgetEditOverlay })
3072
+ ] }, m) : /* @__PURE__ */ s.jsx(s.Fragment, {}), [
3073
+ e,
3074
+ i,
3075
+ l,
3076
+ c,
3077
+ t,
3078
+ r
3079
+ ]);
3080
+ return /* @__PURE__ */ s.jsx("div", { className: ae.dashboard, children: /* @__PURE__ */ s.jsxs("div", { className: ae.widgetsGrid, children: [
3081
+ (d = o.widgets) == null ? void 0 : d.map((h, m) => u(t.find((p) => p.id === h.widgetId), m, h.fullWidth)),
3082
+ e && /* @__PURE__ */ s.jsx(Bt, { availableWidgets: t, onAdd: (h) => {
3083
+ var m;
3084
+ return i((m = o.widgets) == null ? void 0 : m.length, h);
3085
+ }, texts: r })
3084
3086
  ] }) });
3085
- }, Kc = ({ InputContainer: t = xe, formField: e, label: n, resetsFields: r, type: o, required: a, hidden: i, disabled: l, withoutLabel: c, className: u }) => {
3086
- const { register: d, formState: h, setValue: m } = me(), [p, v] = P(void 0), [x, f] = P(!1);
3087
- D(() => {
3088
- const b = e.split(".");
3089
- let g = h.errors;
3090
- b.forEach((C) => {
3091
- g !== void 0 && (g = g[C]);
3092
- }), v(g);
3093
- }, [h, e]), D(() => {
3094
- h.isSubmitted && f(!0);
3095
- }, [h]);
3096
- const j = p !== void 0;
3097
- return /* @__PURE__ */ s.jsxs(t, { isForCheckInput: !0, hidden: i, label: `${n}${a ? " *" : ""}`, isInvalid: j, withoutLabel: c, className: u, children: [
3098
- /* @__PURE__ */ s.jsx(ee.Check, { id: `check-${e}`, type: o ?? "checkbox", label: `${n}${a ? " *" : ""}`, ...d(e, {
3099
- onChange: () => {
3100
- r && r.forEach((b) => m(b, null, { shouldDirty: !0, shouldValidate: x }));
3101
- }
3102
- }), isInvalid: j, hidden: i, disabled: l, className: "w-100" }),
3103
- p && /* @__PURE__ */ s.jsx(ye, { message: p.message })
3104
- ] });
3105
- }, Qc = ({ InputContainer: t = xe, label: e, formField: n, options: r, resetsFields: o, required: a, disabled: i, hidden: l, className: c }) => {
3106
- const { register: u, formState: d, setValue: h, watch: m } = me(), [p, v] = P(void 0), [x, f] = P(!1), j = Q(() => r, [r]);
3107
- D(() => {
3108
- const g = n.split(".");
3109
- let C = d.errors;
3110
- g.forEach((k) => {
3111
- C !== void 0 && (C = C[k]);
3112
- }), v(C);
3113
- }, [d, n]), D(() => {
3114
- d.isSubmitted && f(!0);
3115
- }, [d]);
3116
- const b = p !== void 0;
3117
- return /* @__PURE__ */ s.jsxs(t, { isForRadioInput: !0, hidden: l, withoutLabel: !e, label: `${e}${a ? " *" : ""}`, isInvalid: b, className: c, children: [
3118
- j.map((g) => /* @__PURE__ */ s.jsx(ee.Check, { id: `radio-${g.id}`, label: g.name, type: "radio", value: g.id ?? "", checked: m(n) === g.id, ...u(n, {
3119
- onChange: () => {
3120
- o && o.forEach((C) => h(C, null, { shouldDirty: !0, shouldValidate: x }));
3121
- }
3122
- }), isInvalid: b, hidden: l, disabled: i, className: "w-100" }, g.id)),
3123
- p && /* @__PURE__ */ s.jsx(ye, { message: p.message })
3087
+ }, fi = "_badge_nhser_1", pi = "_sm_nhser_1", gi = "_md_nhser_4", wi = "_lg_nhser_7", Gt = {
3088
+ badge: fi,
3089
+ sm: pi,
3090
+ md: gi,
3091
+ lg: wi
3092
+ }, Gc = ({ children: t, color: e = "primary", size: n = "md", className: r }) => /* @__PURE__ */ s.jsx("span", { className: w(`luminus-badge badge bg-${e} ${r ?? ""}`, Gt.badge, Gt[n]), children: t }), xi = "_collapse-icon_1ahhn_1", yi = "_collapsed_1ahhn_6", Vt = {
3093
+ "collapse-icon": "_collapse-icon_1ahhn_1",
3094
+ collapseIcon: xi,
3095
+ collapsed: yi
3096
+ }, Vc = ({ title: t, children: e, className: n, ...r }) => {
3097
+ const o = r.controlled ? !1 : r.defaultOpen ?? !1, [a, i] = P(o), l = r.controlled ? r.isOpen : a;
3098
+ return D(() => {
3099
+ i(o);
3100
+ }, [o]), /* @__PURE__ */ s.jsxs("div", { className: n ?? "", children: [
3101
+ /* @__PURE__ */ s.jsxs("div", { role: "button", className: "d-flex align-items-center justify-content-between pb-3 pt-2", onClick: () => r.controlled ? r.onToggle(!r.isOpen) : i(!a), children: [
3102
+ /* @__PURE__ */ s.jsx(z, { variant: "h6", children: t }),
3103
+ /* @__PURE__ */ s.jsx(en, { className: w(Vt.collapseIcon, {
3104
+ [Vt.collapsed]: l
3105
+ }) })
3106
+ ] }),
3107
+ /* @__PURE__ */ s.jsx(gn, { in: l, children: /* @__PURE__ */ s.jsx("div", { children: e }) }),
3108
+ /* @__PURE__ */ s.jsx("hr", { className: `my-0 ${l ? "mt-3" : ""}` })
3124
3109
  ] });
3125
- }, Xc = ({ InputContainer: t = xe, formField: e, label: n, resetsFields: r, size: o, showClearIcon: a, clearValue: i, required: l, hidden: c, disabled: u, rows: d, withoutLabel: h, customFormControlProps: m, className: p }) => {
3126
- const { register: v, formState: x, setValue: f, watch: j } = me(), [b, g] = P(void 0), [C, k] = P(!1), y = O(() => {
3127
- const S = i ?? null;
3128
- f(e, (S == null ? void 0 : S.toString()) ?? "", { shouldDirty: !0, shouldValidate: C });
3129
- }, [i, f, e, C]), $ = O(() => {
3130
- const S = e.split(".");
3131
- let N = x.errors;
3132
- S.forEach((_) => {
3133
- N !== void 0 && (N = N[_]);
3134
- }), g(N);
3135
- }, [x, e]);
3136
- D(() => {
3137
- $();
3138
- }, [$]), D(() => {
3139
- x.isSubmitted && k(!0);
3140
- }, [x]);
3141
- const M = b !== void 0;
3142
- return /* @__PURE__ */ s.jsxs(t, { label: `${n}${l ? " *" : ""}`, hidden: c, withoutLabel: h, isInvalid: M, className: p, children: [
3143
- /* @__PURE__ */ s.jsx(ee.Control, { as: "textarea", size: o, ...v(e, {
3144
- onChange: () => {
3145
- r && r.forEach((S) => f(S, null, { shouldDirty: !0, shouldValidate: C }));
3110
+ }, bi = "_feedback_esh1j_1", vi = "_feedback-spacer_esh1j_8", Ut = {
3111
+ feedback: bi,
3112
+ "feedback-spacer": "_feedback-spacer_esh1j_8",
3113
+ feedbackSpacer: vi
3114
+ }, ye = ({ message: t }) => /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3115
+ /* @__PURE__ */ s.jsx("div", { className: w("invalid-feedback luminus-invalid-feedback", Ut.feedback), children: t }),
3116
+ /* @__PURE__ */ s.jsx("div", { className: w("invalid-feedback-spacer", Ut.feedbackSpacer), children: t })
3117
+ ] });
3118
+ function _i(t, e, n) {
3119
+ var r = this, o = Y(null), a = Y(0), i = Y(null), l = Y([]), c = Y(), u = Y(), d = Y(t), h = Y(!0);
3120
+ d.current = t;
3121
+ var m = typeof window < "u", p = !e && e !== 0 && m;
3122
+ if (typeof t != "function")
3123
+ throw new TypeError("Expected a function");
3124
+ e = +e || 0;
3125
+ var v = !!(n = n || {}).leading, x = !("trailing" in n) || !!n.trailing, f = "maxWait" in n, j = "debounceOnServer" in n && !!n.debounceOnServer, b = f ? Math.max(+n.maxWait || 0, e) : null;
3126
+ D(function() {
3127
+ return h.current = !0, function() {
3128
+ h.current = !1;
3129
+ };
3130
+ }, []);
3131
+ var g = Q(function() {
3132
+ var C = function(N) {
3133
+ var _ = l.current, T = c.current;
3134
+ return l.current = c.current = null, a.current = N, u.current = d.current.apply(T, _);
3135
+ }, k = function(N, _) {
3136
+ p && cancelAnimationFrame(i.current), i.current = p ? requestAnimationFrame(N) : setTimeout(N, _);
3137
+ }, y = function(N) {
3138
+ if (!h.current)
3139
+ return !1;
3140
+ var _ = N - o.current;
3141
+ return !o.current || _ >= e || _ < 0 || f && N - a.current >= b;
3142
+ }, $ = function(N) {
3143
+ return i.current = null, x && l.current ? C(N) : (l.current = c.current = null, u.current);
3144
+ }, M = function N() {
3145
+ var _ = Date.now();
3146
+ if (y(_))
3147
+ return $(_);
3148
+ if (h.current) {
3149
+ var T = e - (_ - o.current), W = f ? Math.min(T, b - (_ - a.current)) : T;
3150
+ k(N, W);
3146
3151
  }
3147
- }), isInvalid: M, hidden: c, disabled: u, rows: d ?? 2, className: "w-100", ...m }),
3148
- a && j(e) && /* @__PURE__ */ s.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ s.jsx(Z, { color: "secondary", size: "sm", onClick: y, children: /* @__PURE__ */ s.jsx(ke, {}) }) }),
3149
- b && /* @__PURE__ */ s.jsx(ye, { message: b.message })
3150
- ] });
3151
- }, Jc = ({ InputContainer: t = xe, type: e, formField: n, label: r, placeholder: o, size: a, resetsFields: i, showClearIcon: l, clearValue: c, required: u, hidden: d, disabled: h, withoutLabel: m, list: p, step: v, CustomOnChangeComponent: x, className: f }) => {
3152
- const { register: j, formState: b, setValue: g, watch: C } = me(), [k, y] = P(void 0), [$, M] = P(!1), S = O(() => {
3153
- const L = c ?? null;
3154
- e === "number" ? g(n, L !== null ? Number(L) : null, {
3155
- shouldDirty: !0,
3156
- shouldValidate: $
3157
- }) : g(n, (L == null ? void 0 : L.toString()) ?? "", { shouldDirty: !0, shouldValidate: $ });
3158
- }, [c, e, g, n, $]), N = O(() => {
3159
- const L = n.split(".");
3160
- let G = b.errors;
3161
- L.forEach((se) => {
3162
- G !== void 0 && (G = G[se]);
3163
- }), y(G);
3164
- }, [b, n]);
3152
+ }, S = function() {
3153
+ if (m || j) {
3154
+ var N = Date.now(), _ = y(N);
3155
+ if (l.current = [].slice.call(arguments), c.current = r, o.current = N, _) {
3156
+ if (!i.current && h.current)
3157
+ return a.current = o.current, k(M, e), v ? C(o.current) : u.current;
3158
+ if (f)
3159
+ return k(M, e), C(o.current);
3160
+ }
3161
+ return i.current || k(M, e), u.current;
3162
+ }
3163
+ };
3164
+ return S.cancel = function() {
3165
+ i.current && (p ? cancelAnimationFrame(i.current) : clearTimeout(i.current)), a.current = 0, l.current = o.current = c.current = i.current = null;
3166
+ }, S.isPending = function() {
3167
+ return !!i.current;
3168
+ }, S.flush = function() {
3169
+ return i.current ? $(Date.now()) : u.current;
3170
+ }, S;
3171
+ }, [v, f, e, b, x, p, m, j]);
3172
+ return g;
3173
+ }
3174
+ function ji(t, e) {
3175
+ return t === e;
3176
+ }
3177
+ function ki(t, e) {
3178
+ return e;
3179
+ }
3180
+ function rr(t, e, n) {
3181
+ var r = ji, o = rn(ki, t), a = o[0], i = o[1], l = _i(O(function(u) {
3182
+ return i(u);
3183
+ }, [i]), e, n), c = Y(t);
3184
+ return r(c.current, t) || (l(t), c.current = t), [a, l];
3185
+ }
3186
+ const Ci = "_wrapper_uccrb_1", Ni = "_open_uccrb_9", $i = "_dropdown_uccrb_13", Ii = "_search-input-container_uccrb_19", Si = "_search-input_uccrb_19", Ti = "_loading-container_uccrb_25", Ei = "_items-container_uccrb_32", Oi = "_header-row_uccrb_38", Mi = "_item_uccrb_32", Di = "_name_uccrb_57", Pi = "_column-item_uccrb_62", Ai = "_icon_uccrb_66", Fi = "_clear-button_uccrb_74", X = {
3187
+ wrapper: Ci,
3188
+ open: Ni,
3189
+ dropdown: $i,
3190
+ "search-input-container": "_search-input-container_uccrb_19",
3191
+ searchInputContainer: Ii,
3192
+ "search-input": "_search-input_uccrb_19",
3193
+ searchInput: Si,
3194
+ "loading-container": "_loading-container_uccrb_25",
3195
+ loadingContainer: Ti,
3196
+ "items-container": "_items-container_uccrb_32",
3197
+ itemsContainer: Ei,
3198
+ "header-row": "_header-row_uccrb_38",
3199
+ headerRow: Oi,
3200
+ item: Mi,
3201
+ name: Di,
3202
+ "column-item": "_column-item_uccrb_62",
3203
+ columnItem: Pi,
3204
+ icon: Ai,
3205
+ "clear-button": "_clear-button_uccrb_74",
3206
+ clearButton: Fi
3207
+ }, _t = ({ show: t, onCancel: e, items: n, currentSelection: r, onSelectionChange: o, onSearchQueryChange: a, texts: i, itemsNameWidth: l, additionalColumns: c, displayIdAsName: u = !1, autoHideSearch: d = !1, allItemsLength: h, disabled: m, isLoading: p = !1, inputRef: v }) => {
3208
+ var I;
3209
+ const x = Y(null), f = Y(null), j = Y(null), [b, g] = P(""), [C] = rr(b, 500), [, k] = P(!1), y = (I = v.current) == null ? void 0 : I.getBoundingClientRect(), $ = (y == null ? void 0 : y.x) ?? 0, M = ((y == null ? void 0 : y.x) ?? 0) + ((y == null ? void 0 : y.width) ?? 0), S = (y == null ? void 0 : y.y) ?? 0, N = ((y == null ? void 0 : y.y) ?? 0) + ((y == null ? void 0 : y.height) ?? 0), _ = (y == null ? void 0 : y.width) ?? 0, T = (y == null ? void 0 : y.height) ?? 0, W = 5, R = Q(() => $ ? $ > window.innerWidth / 2 : !1, [$]), B = Q(() => S ? S > window.innerHeight / 2 : !1, [S]);
3165
3210
  D(() => {
3166
- N();
3167
- }, [N]), D(() => {
3168
- b.isSubmitted && M(!0);
3169
- }, [b]);
3170
- const _ = k !== void 0, [T, W] = P(!1), R = C(n), B = cn(e, R ?? null, T);
3171
- return /* @__PURE__ */ s.jsxs(t, { label: `${r}${u ? " *" : ""}`, hidden: d, withoutLabel: m, isInvalid: _, className: f, children: [
3172
- /* @__PURE__ */ s.jsxs("div", { className: "luminus-input-container position-relative w-100", children: [
3173
- /* @__PURE__ */ s.jsx(ee.Control, { type: B, placeholder: o ?? r, size: a, onFocus: () => {
3174
- W(!0);
3175
- }, ...j(n, {
3176
- setValueAs: (L) => e === "number" ? L == null || L === "" ? null : Number(L) : L == null || L === "" ? null : L,
3177
- onChange: () => {
3178
- i && i.forEach((L) => g(L, null, { shouldDirty: !0, shouldValidate: $ }));
3179
- },
3180
- onBlur: () => W(!1)
3181
- }), isInvalid: _, hidden: d, disabled: h, list: p, className: "w-100", step: v }),
3182
- x && /* @__PURE__ */ s.jsx("div", { className: "custom-picker-button", children: x })
3211
+ var E;
3212
+ t && ((E = j.current) == null || E.focus());
3213
+ }, [j, t]), D(() => {
3214
+ t || g("");
3215
+ }, [t]), D(() => {
3216
+ a(C);
3217
+ }, [C, a]);
3218
+ const L = O((E) => {
3219
+ switch (E.key) {
3220
+ case "Escape":
3221
+ E.stopPropagation(), e();
3222
+ break;
3223
+ }
3224
+ }, [e]), G = O(() => {
3225
+ k((E) => !E);
3226
+ }, []);
3227
+ D(() => (window.addEventListener("scroll", G), () => {
3228
+ window.removeEventListener("scroll", G);
3229
+ }), [G]), D(() => (window.addEventListener("resize", G), () => {
3230
+ window.removeEventListener("resize", G);
3231
+ }), [G]), cn(L), ln([x, f], e);
3232
+ const se = l ?? (c && c.length > 0 ? 250 : 0), te = (c == null ? void 0 : c.reduce((E, K) => E + (K.width ?? 100), 0)) ?? 0, U = `calc(max(${_}px, ${se}px + ${te}px))`;
3233
+ return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3234
+ /* @__PURE__ */ s.jsx(sr, { show: t, onClick: e }),
3235
+ r && t && !m && /* @__PURE__ */ s.jsx("button", { ref: f, type: "button", className: w("luminus-dropdown-picker-clear-button", X.clearButton), onClick: () => !m && o(null), style: {
3236
+ top: `calc(${S}px + ${T / 2}px - 12px)`,
3237
+ left: `calc(${$}px - 24px - 8px)`
3238
+ }, children: /* @__PURE__ */ s.jsx(z, { variant: "caption", className: "text-danger", children: /* @__PURE__ */ s.jsx(Zt, { size: 16 }) }) }),
3239
+ /* @__PURE__ */ s.jsx("div", { className: w("luminus-dropdown-picker", X.wrapper, {
3240
+ [X.open]: t
3241
+ }), style: {
3242
+ top: B ? `calc(${S}px - 50vh - 8px)` : `calc(${N}px + 8px)`,
3243
+ left: R ? `calc(${M}px - ${U})` : $,
3244
+ right: R ? `${M}px` : `calc(${$}px + ${U})`,
3245
+ width: U,
3246
+ justifyContent: B ? "flex-end" : "flex-start"
3247
+ }, children: /* @__PURE__ */ s.jsx("div", { ref: x, className: w("shadow rounded", X.dropdown), children: !m && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3248
+ d && (h ?? n.length) <= W ? null : /* @__PURE__ */ s.jsx("div", { className: w("search-input-container border-bottom", X.searchInputContainer), children: /* @__PURE__ */ s.jsx(ee.Control, { ref: j, type: "search", size: "sm", className: X.searchInput, placeholder: i.searchPlaceholder, value: b, onChange: (E) => {
3249
+ var K;
3250
+ return g(((K = E.target) == null ? void 0 : K.value) ?? "");
3251
+ } }) }),
3252
+ p ? /* @__PURE__ */ s.jsx("div", { className: X.loadingContainer, children: /* @__PURE__ */ s.jsx(yt, { animation: "border", variant: "primary" }) }) : n.length > 0 && /* @__PURE__ */ s.jsxs("div", { className: w("items", X.itemsContainer), children: [
3253
+ c && c.length > 0 && /* @__PURE__ */ s.jsxs("div", { className: w("header-row border-bottom", X.headerRow), children: [
3254
+ /* @__PURE__ */ s.jsx("div", { className: X.name }),
3255
+ c == null ? void 0 : c.map((E) => /* @__PURE__ */ s.jsx("div", { className: X.columnItem, style: {
3256
+ width: `${E.width ?? 100}px`,
3257
+ minWidth: `${E.width ?? 100}px`,
3258
+ maxWidth: `${E.width ?? 100}px`
3259
+ }, children: /* @__PURE__ */ s.jsx(z, { variant: "caption", children: E.name }) }, E.key))
3260
+ ] }),
3261
+ n == null ? void 0 : n.map((E) => /* @__PURE__ */ s.jsxs("button", { type: "button", className: w("item cursor-pointer", X.item), onClick: () => !m && o(E), children: [
3262
+ /* @__PURE__ */ s.jsx("div", { className: X.name, children: /* @__PURE__ */ s.jsx(z, { variant: "body2", children: u ? E.id : E.name }) }),
3263
+ c == null ? void 0 : c.map((K) => /* @__PURE__ */ s.jsx("div", { className: X.columnItem, style: {
3264
+ width: `${K.width ?? 100}px`,
3265
+ minWidth: `${K.width ?? 100}px`,
3266
+ maxWidth: `${K.width ?? 100}px`
3267
+ }, children: /* @__PURE__ */ s.jsx(z, { variant: "caption", className: w("text-muted"), children: E.additionalColumns && E.additionalColumns[K.key] }) }, K.key))
3268
+ ] }, E.id))
3269
+ ] })
3270
+ ] }) }) })
3271
+ ] });
3272
+ };
3273
+ function Wi(t) {
3274
+ return Dr({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z" }, child: [] }] })(t);
3275
+ }
3276
+ const Ri = "_item_1dy8x_1", or = {
3277
+ item: Ri
3278
+ }, Li = ({
3279
+ color: t = "primary",
3280
+ // icon = <MdOutlineArrowOutward />,
3281
+ icon: e,
3282
+ className: n,
3283
+ children: r,
3284
+ ...o
3285
+ }) => /* @__PURE__ */ s.jsxs(Ee.Item, { className: w(`btn luminus-dropdown-item text-nowrap rounded text-${t} ${n ?? ""}`, or.item), ...o, children: [
3286
+ e,
3287
+ r
3288
+ ] }), qi = (t) => /* @__PURE__ */ s.jsx(Ee.Toggle, { ...t }), Uc = ({ color: t = "primary", icon: e = /* @__PURE__ */ s.jsx(Jt, { size: 12 }), inputId: n = "context-file-input", accept: r = "*", onUpload: o, multiple: a, className: i, children: l, ...c }) => {
3289
+ const u = (d) => {
3290
+ d.target.files && (o(d.target.files), d.target.value = "");
3291
+ };
3292
+ return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3293
+ /* @__PURE__ */ s.jsxs("label", { htmlFor: n, className: w(`btn luminus-dropdown-item text-nowrap rounded text-${t} ${i ?? ""}`, or.item), ...c, children: [
3294
+ e,
3295
+ l
3183
3296
  ] }),
3184
- l && C(n) && /* @__PURE__ */ s.jsx("div", { className: `luminus-input-remove-icon ${e !== "text" ? "inset" : ""}`, children: /* @__PURE__ */ s.jsx(Z, { color: "secondary", size: "sm", onClick: S, children: /* @__PURE__ */ s.jsx(ke, {}) }) }),
3185
- k && /* @__PURE__ */ s.jsx(ye, { message: k.message })
3297
+ /* @__PURE__ */ s.jsx("input", { id: n, type: "file", accept: r, onChange: u, hidden: !0, multiple: a })
3186
3298
  ] });
3187
- }, Zc = ({ InputContainer: t = xe, formField: e, label: n, size: r, defaultSelection: o, resetsFields: a, isNumber: i, required: l, hidden: c, disabled: u, items: d, onSearchQueryChange: h, selectedItemNavigateTo: m, texts: p, dropdownItemsNameWidth: v, isLoading: x, withoutLabel: f, additionalColumns: j, CustomOnChangeComponent: b, displayIdAsName: g, className: C }) => {
3188
- const { formState: k, setValue: y, watch: $, control: M } = me(), [S, N] = P(void 0), [_, T] = P(!1), [W, R] = P(!1), B = $(e) ?? null, L = B === (o == null ? void 0 : o.id) ? o == null ? void 0 : o.name : $(`${e}-DropdownName`), G = Q(() => B == null ? null : { id: B ?? null, name: L ?? "" }, [B, L]), se = O(() => {
3189
- const H = e.split(".");
3190
- let ce = k.errors;
3191
- H.forEach((Je) => {
3192
- ce !== void 0 && (ce = ce[Je]);
3193
- }), N(ce);
3194
- }, [k, e]), te = O((H) => {
3195
- if ((H == null ? void 0 : H.id) === B)
3196
- return;
3197
- if (a && a.forEach((Je) => y(Je, null, { shouldDirty: !0, shouldValidate: W })), H === null) {
3198
- y(e, null, {
3199
- shouldDirty: !0,
3200
- shouldValidate: W
3201
- }), y(`${e}-DropdownName`, null);
3299
+ }, Yi = "_divider_1e6rk_1", Bi = {
3300
+ divider: Yi
3301
+ }, zc = ({ className: t }) => /* @__PURE__ */ s.jsx(Ee.Divider, { className: w("luminus-dropdown-divider", t, Bi.divider) }), Hi = "_dropdown_1lk66_1", Gi = {
3302
+ dropdown: Hi
3303
+ }, Vi = ({ toggle: t, children: e, ...n }) => /* @__PURE__ */ s.jsxs(Ee, { ...n, children: [
3304
+ t,
3305
+ /* @__PURE__ */ s.jsx(Ee.Menu, { className: w("luminus-dropdown rounded shadow", Gi.dropdown), children: e })
3306
+ ] }), Ui = ({ searchTypes: t, selectedType: e, setSelectedType: n }) => /* @__PURE__ */ s.jsx(Vi, { toggle: /* @__PURE__ */ s.jsx(qi, { as: Pr, icon: null, text: e == null ? void 0 : e.text }), children: t.map((r) => /* @__PURE__ */ s.jsx(Li, { icon: null, onClick: () => n(r), children: r.text }, r.key)) }), zi = "_dropdown_1ddrg_1", Ki = "_open_1ddrg_12", Qi = "_loading-container_1ddrg_15", Xi = "_groups-container_1ddrg_22", Ji = "_group_1ddrg_22", Zi = "_header_1ddrg_26", ec = "_item_1ddrg_33", fe = {
3307
+ dropdown: zi,
3308
+ open: Ki,
3309
+ "loading-container": "_loading-container_1ddrg_15",
3310
+ loadingContainer: Qi,
3311
+ "groups-container": "_groups-container_1ddrg_22",
3312
+ groupsContainer: Xi,
3313
+ group: Ji,
3314
+ header: Zi,
3315
+ item: ec
3316
+ }, tc = ({ show: t, query: e, onCancel: n, groups: r, isLoading: o, searchTypes: a }) => {
3317
+ const { LinkComponent: i, appSearchTexts: l } = F(oe), c = Y(null), u = O((d) => {
3318
+ var m;
3319
+ const h = (m = a.find((p) => p.key === d.type)) == null ? void 0 : m.toPath;
3320
+ return h ? `${h}/${d.searchKey}` : "/not-found";
3321
+ }, [a]);
3322
+ return ln([c], n), /* @__PURE__ */ s.jsx("div", { ref: c, className: w("luminus-app-search-dropdown shadow rounded", fe.dropdown, {
3323
+ [fe.open]: t
3324
+ }), children: o ? /* @__PURE__ */ s.jsx("div", { className: fe.loadingContainer, children: /* @__PURE__ */ s.jsx(yt, { animation: "border", variant: "primary" }) }) : /* @__PURE__ */ s.jsx("div", { className: fe.groupsContainer, children: r == null ? void 0 : r.map((d) => {
3325
+ var h;
3326
+ return /* @__PURE__ */ s.jsxs("div", { className: w(fe.group), children: [
3327
+ /* @__PURE__ */ s.jsxs(i, { to: `/search?query=${e}&type=${d.key.category}`, className: w("group-header", fe.header), onClick: n, children: [
3328
+ /* @__PURE__ */ s.jsx(z, { variant: "body", className: "text-primary", children: d.key.categoryName }),
3329
+ /* @__PURE__ */ s.jsxs(z, { variant: "caption", children: [
3330
+ d.items.length,
3331
+ " ",
3332
+ l.amountFrom,
3333
+ " ",
3334
+ d.key.totalCount
3335
+ ] })
3336
+ ] }),
3337
+ (h = d.items) == null ? void 0 : h.map((m, p) => /* @__PURE__ */ s.jsxs(
3338
+ i,
3339
+ {
3340
+ to: u(m),
3341
+ className: w("search-item d-flex gap-3 align-items-center justify-content-between", fe.item),
3342
+ onClick: n,
3343
+ children: [
3344
+ /* @__PURE__ */ s.jsx(z, { variant: "body2", className: "text-nowrap text-truncate", children: m.name }),
3345
+ /* @__PURE__ */ s.jsx(z, { variant: "caption", className: "text-primary", children: /* @__PURE__ */ s.jsx(Ar, {}) })
3346
+ ]
3347
+ },
3348
+ p
3349
+ ))
3350
+ ] }, d.key.category);
3351
+ }) }) });
3352
+ }, nc = "_input-group_1lkfy_1", rc = "_input-group-text_1lkfy_5", oc = "_left_1lkfy_9", sc = "_right_1lkfy_13", ac = "_input_1lkfy_1", ic = "_submit-button_1lkfy_20", pe = {
3353
+ "input-group": "_input-group_1lkfy_1",
3354
+ inputGroup: nc,
3355
+ "input-group-text": "_input-group-text_1lkfy_5",
3356
+ inputGroupText: rc,
3357
+ left: oc,
3358
+ right: sc,
3359
+ input: ac,
3360
+ "submit-button": "_submit-button_1lkfy_20",
3361
+ submitButton: ic
3362
+ }, cc = (t, e) => {
3363
+ const n = Fr(), [r, o] = P(!1), [a, i] = P([]), l = !t || !t.key, c = O(() => {
3364
+ if (e.length < 3) {
3365
+ i([]);
3202
3366
  return;
3203
3367
  }
3204
- let ce = null;
3205
- i ? ce = (H == null ? void 0 : H.id) !== null && (H == null ? void 0 : H.id) !== "" ? parseInt(H.id.toString(), 10) : null : ce = H.id === null || H.id === void 0 || H.id === "" ? null : H.id, y(e, ce, {
3206
- shouldDirty: !0,
3207
- shouldValidate: W
3208
- }), y(`${e}-DropdownName`, H.name ?? "");
3209
- }, [y, e, W, i, a, B]), U = O((H) => {
3210
- T(!1), te(H);
3211
- }, [te]), I = O(() => {
3212
- T(!1);
3213
- }, []);
3214
- D(() => {
3215
- se();
3216
- }, [se]), D(() => {
3217
- k.isSubmitted && R(!0);
3218
- }, [k]);
3219
- const E = Y(null), K = S !== void 0, De = m !== void 0, ir = De && G !== null;
3220
- return /* @__PURE__ */ s.jsx(s.Fragment, { children: /* @__PURE__ */ s.jsxs(t, { label: `${n}${l ? " *" : ""}`, hidden: c, withoutLabel: f, isInvalid: K, inputContainerClassName: w({ "luminus-dropdown-select-open": _ }), className: C, children: [
3221
- /* @__PURE__ */ s.jsxs(rr, { currentSelection: G, selectedItemNavigateTo: m, children: [
3222
- g && (G == null ? void 0 : G.name) && /* @__PURE__ */ s.jsx(z, { variant: "caption", className: "d-flex justify-content-end mt-2 luminus-dropdown-selection-name", children: G.name }),
3223
- /* @__PURE__ */ s.jsx(sn, { control: M, name: e, render: () => /* @__PURE__ */ s.jsx(ee.Select, { size: r, onMouseDown: (H) => {
3224
- H.currentTarget.focus(), H.preventDefault();
3225
- }, onClick: () => {
3226
- !De && !u && T(!0);
3227
- }, ref: E, value: B ?? "", onChange: () => {
3228
- }, isInvalid: K, hidden: c, className: w("w-100", {
3229
- "luminus-dropdown-picker-disabled": u,
3230
- "luminus-dropdown-picker-link": ir
3231
- }), children: /* @__PURE__ */ s.jsx("option", { value: B, children: g ? B : (L == null ? void 0 : L.length) > 0 ? L : B }) }) }),
3232
- b || !u && De ? /* @__PURE__ */ s.jsxs("div", { className: "custom-picker-button", children: [
3233
- !b && !u && De && /* @__PURE__ */ s.jsx(Z, { size: "sm", color: "secondary", onClick: (H) => {
3234
- H.preventDefault(), H.stopPropagation(), T(!0);
3235
- }, children: /* @__PURE__ */ s.jsx(Zt, {}) }),
3236
- b ?? null
3237
- ] }) : null
3238
- ] }),
3239
- S && /* @__PURE__ */ s.jsx(ye, { message: S.message }),
3240
- E.current && /* @__PURE__ */ s.jsx(_t, { show: _, onCancel: I, items: d, currentSelection: G, onSelectionChange: U, onSearchQueryChange: h, texts: p, itemsNameWidth: v, additionalColumns: j, displayIdAsName: g, isLoading: x, disabled: u, inputRef: E })
3368
+ o(!0), n.get(`/search/${e}?count=${l ? 5 : 20}${l ? "" : `&type=${t.key}`}`).then(({ data: u }) => {
3369
+ i(u), o(!1);
3370
+ }).catch(() => {
3371
+ o(!1);
3372
+ });
3373
+ }, [t, e, n, l]);
3374
+ return D(() => {
3375
+ c();
3376
+ }, [c]), { isLoading: r, searchItems: a };
3377
+ }, Kc = ({ searchTypes: t, navigateFunction: e }) => {
3378
+ const { appSearchTexts: n } = F(oe), [r, o] = P(t.length > 0 ? t[0] : null), [a, i] = P(""), [l, c] = rr(a, 500), { isLoading: u, searchItems: d } = cc(r, l), [h, m] = P(!1);
3379
+ return D(() => {
3380
+ (d.length > 0 || u) && m(!0);
3381
+ }, [d, u]), /* @__PURE__ */ s.jsx(ee, { onSubmit: (p) => {
3382
+ p.preventDefault(), p.stopPropagation(), c.flush(), m(!1), a.length > 2 && e(`/search?query=${a}${r && r.key && `&type=${r == null ? void 0 : r.key}`}`);
3383
+ }, children: /* @__PURE__ */ s.jsxs(nt, { className: pe.inputGroup, children: [
3384
+ /* @__PURE__ */ s.jsx(nt.Text, { className: w("p-1 rounded", pe.inputGroupText, pe.left), children: /* @__PURE__ */ s.jsx(Ui, { searchTypes: t, selectedType: r, setSelectedType: o }) }),
3385
+ /* @__PURE__ */ s.jsx(ee.Control, { placeholder: n.searchPlaceholder, type: "text", size: "sm", className: w("luminus-app-search-input", pe.input), value: a, onChange: (p) => {
3386
+ var v;
3387
+ return i(((v = p.target) == null ? void 0 : v.value) ?? "");
3388
+ }, onFocus: () => d.length > 0 && m(!0) }),
3389
+ /* @__PURE__ */ s.jsx(nt.Text, { className: w("p-0 rounded", pe.inputGroupText, pe.right), children: /* @__PURE__ */ s.jsx("button", { type: "submit", className: w("text-primary", pe.submitButton), children: /* @__PURE__ */ s.jsx(Wi, {}) }) }),
3390
+ /* @__PURE__ */ s.jsx(tc, { query: l, searchTypes: t, show: h, onCancel: () => m(!1), groups: d, isLoading: u })
3241
3391
  ] }) });
3242
- }, el = ({ InputContainer: t = xe, label: e, formField: n, hidden: r, required: o, placeholder: a, disabled: i, showClearIcon: l, resetsFields: c, multiple: u, accept: d, withoutLabel: h, className: m }) => {
3243
- const { watch: p, setValue: v, register: x, formState: f } = me(), [j, b] = P(!1), [g, C] = P(void 0), k = O(() => {
3244
- v(n, "");
3245
- }, [v, n]), y = O(() => {
3246
- const M = n.split(".");
3247
- let S = f.errors;
3248
- M.forEach((N) => {
3249
- S !== void 0 && (S = S[N]);
3250
- }), C(S);
3251
- }, [f, n]);
3252
- D(y, [y]), D(() => {
3253
- f.isSubmitted && b(!0);
3254
- }, [f]);
3255
- const $ = g !== void 0;
3256
- return /* @__PURE__ */ s.jsxs(t, { label: `${e}${o ? "*" : ""}`, hidden: r, withoutLabel: h, isInvalid: $, className: m, children: [
3257
- /* @__PURE__ */ s.jsx(Gn, { type: "file", multiple: u, accept: d.join(", "), placeholder: a ?? e, isInvalid: $, hidden: r, disabled: i, className: "w-100", ...x(n, {
3258
- onChange: () => {
3259
- c && c.forEach((M) => v(M, null, { shouldDirty: !0, shouldValidate: j }));
3260
- }
3261
- }) }),
3262
- l && p(n) && /* @__PURE__ */ s.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ s.jsx(Z, { color: "secondary", size: "sm", onClick: k, children: /* @__PURE__ */ s.jsx(ke, {}) }) }),
3263
- g && /* @__PURE__ */ s.jsx(ye, { message: g.message })
3392
+ }, lc = "_card_19733_1", uc = "_header_19733_6", dc = "_header-content_19733_13", hc = "_title_19733_19", mc = "_collapse-icon_19733_22", fc = "_collapsed_19733_27", pc = "_content_19733_30", ge = {
3393
+ card: lc,
3394
+ header: uc,
3395
+ "header-content": "_header-content_19733_13",
3396
+ headerContent: dc,
3397
+ title: hc,
3398
+ "collapse-icon": "_collapse-icon_19733_22",
3399
+ collapseIcon: mc,
3400
+ collapsed: fc,
3401
+ content: pc
3402
+ }, gc = ({ title: t, headerContent: e, children: n, className: r, headerClassName: o, contentClassName: a, ...i }) => {
3403
+ const l = i.collapsible ? i.controlled ? !1 : i.defaultOpen ?? !1 : !0, [c, u] = P(l), d = i.collapsible ? i.controlled ? i.isOpen : c : !0;
3404
+ return D(() => {
3405
+ u(l);
3406
+ }, [l]), /* @__PURE__ */ s.jsxs("div", { className: w("luminus-card rounded shadow-sm", ge.card, {
3407
+ [r ?? ""]: r
3408
+ }), children: [
3409
+ /* @__PURE__ */ s.jsxs("div", { role: i.collapsible ? "button" : void 0, className: w("header", ge.header, {
3410
+ [o ?? ""]: o
3411
+ }), onClick: () => {
3412
+ i.collapsible && (i.controlled ? i.onToggle(!i.isOpen) : u(!c));
3413
+ }, children: [
3414
+ /* @__PURE__ */ s.jsxs("div", { className: w("header-content", ge.headerContent), children: [
3415
+ /* @__PURE__ */ s.jsx(z, { variant: "h6", className: w("text-primary", ge.title), children: t }),
3416
+ e ?? null
3417
+ ] }),
3418
+ i.collapsible && /* @__PURE__ */ s.jsx(en, { className: w(ge.collapseIcon, {
3419
+ [ge.collapsed]: d
3420
+ }) })
3421
+ ] }),
3422
+ /* @__PURE__ */ s.jsx(gn, { in: d, children: /* @__PURE__ */ s.jsx("div", { className: w("card-content border-top border-primary", ge.content, {
3423
+ [a ?? ""]: a
3424
+ }), children: n }) })
3264
3425
  ] });
3265
- }, tl = ({ children: t, onStorno: e }) => {
3266
- const { formState: n } = me(), [r, o] = P(!1);
3426
+ }, wc = "_lightbox_14acg_1", xc = "_show_14acg_16", yc = "_header_14acg_20", bc = "_photo-actions_14acg_26", vc = "_photo-container_14acg_31", _c = "_photo_14acg_26", jc = "_nav-button_14acg_41", kc = "_photos-preview_14acg_49", Cc = "_selected_14acg_62", Nc = "_default-indicator_14acg_66", ne = {
3427
+ lightbox: wc,
3428
+ show: xc,
3429
+ header: yc,
3430
+ "photo-actions": "_photo-actions_14acg_26",
3431
+ photoActions: bc,
3432
+ "photo-container": "_photo-container_14acg_31",
3433
+ photoContainer: vc,
3434
+ photo: _c,
3435
+ "nav-button": "_nav-button_14acg_41",
3436
+ navButton: jc,
3437
+ "photos-preview": "_photos-preview_14acg_49",
3438
+ photosPreview: kc,
3439
+ selected: Cc,
3440
+ "default-indicator": "_default-indicator_14acg_66",
3441
+ defaultIndicator: Nc
3442
+ }, $c = "_backdrop_3huvf_1", Ic = "_show_3huvf_11", zt = {
3443
+ backdrop: $c,
3444
+ show: Ic
3445
+ }, sr = ({ show: t, onClick: e }) => /* @__PURE__ */ s.jsx("div", { className: w("luminus-backdrop", zt.backdrop, {
3446
+ [zt.show]: t
3447
+ }), onClick: () => e && e() }), Sc = ({ show: t, onClose: e, photos: n, defaultIndex: r, uploadPhotosText: o, noPhotosText: a, onUploadPhotos: i, photoActions: l }) => {
3448
+ const c = Y(null), [u, d] = P(r), h = n.at(u), m = u > 0, p = u < n.length - 1;
3449
+ D(() => {
3450
+ t && d(r);
3451
+ }, [r, t]), D(() => {
3452
+ u >= n.length && d(n.length - 1);
3453
+ }, [n, u]);
3454
+ const v = O((x) => {
3455
+ switch (x.key) {
3456
+ case "ArrowLeft":
3457
+ x.stopPropagation(), m && d((f) => f - 1);
3458
+ break;
3459
+ case "ArrowRight":
3460
+ x.stopPropagation(), p && d((f) => f + 1);
3461
+ break;
3462
+ case "Escape":
3463
+ x.stopPropagation(), e();
3464
+ break;
3465
+ }
3466
+ }, [p, m, e]);
3467
+ return cn(v), /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3468
+ /* @__PURE__ */ s.jsx(sr, { show: t, onClick: e }),
3469
+ /* @__PURE__ */ s.jsxs("div", { ref: c, className: w("luminus-lightbox rounded shadow", ne.lightbox, {
3470
+ [ne.show]: t
3471
+ }), children: [
3472
+ /* @__PURE__ */ s.jsxs("div", { className: ne.header, children: [
3473
+ /* @__PURE__ */ s.jsxs("div", { className: w("rounded", ne.photoActions), children: [
3474
+ i && /* @__PURE__ */ s.jsx(nr, { accept: ".jpg,.jpeg,.png", onUpload: (x) => {
3475
+ x.length > 0 && i(Array.from(x));
3476
+ }, icon: /* @__PURE__ */ s.jsx(tn, { style: { fontSize: 18 } }), multiple: !0, className: "me-3", children: o ?? null }),
3477
+ h && (l == null ? void 0 : l.map(({ label: x, onClick: f, ...j }, b) => /* @__PURE__ */ s.jsx(
3478
+ ct,
3479
+ {
3480
+ onClick: () => f(h.id),
3481
+ ...j,
3482
+ children: x
3483
+ },
3484
+ `action-${b}`
3485
+ )))
3486
+ ] }),
3487
+ /* @__PURE__ */ s.jsx("div", { role: "button", onClick: e, children: /* @__PURE__ */ s.jsx(ke, { style: { fontSize: "32px" } }) })
3488
+ ] }),
3489
+ n.length === 0 && /* @__PURE__ */ s.jsx("div", { className: "w-100 h-100 d-flex align-items-center justify-content-center", children: /* @__PURE__ */ s.jsx(z, { variant: "body", children: a ?? "No photos available" }) }),
3490
+ h && /* @__PURE__ */ s.jsxs("div", { className: ne.photoContainer, children: [
3491
+ /* @__PURE__ */ s.jsx("div", { role: m ? "button" : void 0, className: w("align-items-start", ne.navButton), onClick: () => m && d((x) => x - 1), children: m && /* @__PURE__ */ s.jsx(mt, { style: { fontSize: "40px" } }) }),
3492
+ /* @__PURE__ */ s.jsx("img", { src: h.lgSrc, alt: h.alt, className: w("rounded", ne.photo) }),
3493
+ /* @__PURE__ */ s.jsx("div", { role: p ? "button" : void 0, className: w("align-items-end", ne.navButton), onClick: () => p && d((x) => x + 1), children: p && /* @__PURE__ */ s.jsx(ft, { style: { fontSize: "40px" } }) })
3494
+ ] }),
3495
+ /* @__PURE__ */ s.jsx("div", { className: ne.photosPreview, children: n.map((x, f) => /* @__PURE__ */ s.jsxs("div", { role: "button", onClick: () => d(f), className: "position-relative", children: [
3496
+ /* @__PURE__ */ s.jsx("img", { role: f !== u ? "button" : void 0, src: x.smSrc, alt: x.alt, className: w("rounded", ne.photo, {
3497
+ [ne.selected]: f === u
3498
+ }) }, x.id),
3499
+ x.isDefault && /* @__PURE__ */ s.jsx("div", { className: w("text-primary", ne.defaultIndicator), children: /* @__PURE__ */ s.jsx(Wr, {}) })
3500
+ ] })) })
3501
+ ] })
3502
+ ] });
3503
+ }, Qc = ({ photos: t, onUploadPhotos: e, uploadPhotosText: n, photoActions: r }) => {
3504
+ const [o, a] = P(null), i = o !== null ? t[o] : null, [l, c] = P(!1);
3267
3505
  return D(() => {
3268
- o(Object.keys(n.dirtyFields).length > 0);
3269
- }, [n]), r ? /* @__PURE__ */ s.jsx(Ha, { onStorno: e, children: t }) : null;
3270
- }, nl = ({ InputContainer: t = xe, options: e, formField: n, label: r, size: o, resetsFields: a, isNumber: i, required: l, hidden: c, disabled: u, withoutLabel: d, noSortOptions: h, suffixIdToName: m, className: p }) => {
3271
- const { customSelectTexts: v } = F(oe), { formState: x, setValue: f, watch: j, control: b } = me(), [g, C] = P(void 0), [k, y] = P(!1), [$, M] = P(!1), [S, N] = P(""), _ = j(n), T = Q(() => e.find((I) => I.id === _) ?? null, [e, _]), W = O(() => {
3272
- const I = n.split(".");
3273
- let E = x.errors;
3274
- I.forEach((K) => {
3275
- E !== void 0 && (E = E[K]);
3276
- }), C(E);
3277
- }, [x, n]), R = O((I) => {
3278
- if ((I == null ? void 0 : I.id) === _)
3506
+ if (t.length === 0) {
3507
+ a(null), c(!1);
3279
3508
  return;
3280
- if (a && a.forEach((K) => f(K, null, { shouldDirty: !0, shouldValidate: $ })), I === null) {
3281
- f(n, null, {
3282
- shouldDirty: !0,
3283
- shouldValidate: $
3284
- });
3509
+ }
3510
+ const u = t.findIndex((d) => d.isDefault);
3511
+ a(u > -1 ? u : 0);
3512
+ }, [t]), i ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3513
+ /* @__PURE__ */ s.jsx(
3514
+ "img",
3515
+ {
3516
+ role: "button",
3517
+ src: i.smSrc,
3518
+ alt: i.alt,
3519
+ className: "rounded w-100",
3520
+ onClick: () => c(!0)
3521
+ }
3522
+ ),
3523
+ /* @__PURE__ */ s.jsx(Sc, { show: l, onClose: () => c(!1), photos: t, defaultIndex: o ?? 0, uploadPhotosText: n, onUploadPhotos: e, photoActions: r })
3524
+ ] }) : e ? /* @__PURE__ */ s.jsx(nr, { accept: ".jpg,.jpeg,.png", onUpload: (u) => {
3525
+ u.length > 0 && e(Array.from(u));
3526
+ }, icon: /* @__PURE__ */ s.jsx(tn, { style: { fontSize: 18 } }), multiple: !0, children: n ?? null }) : null;
3527
+ }, Xc = ({ appAccessPermissions: t, children: e }) => {
3528
+ const { NavigateComponent: n } = F(oe), { useMsal: r, msalScopes: o } = F(Rr), { isAuthenticated: a } = Lr(), { user: i, loggingInProgress: l } = F(qr), c = i && (t == null ? void 0 : t.every((u) => {
3529
+ var d;
3530
+ return (d = i.permissions) == null ? void 0 : d.includes(u);
3531
+ }));
3532
+ return r ? /* @__PURE__ */ s.jsx(Aa, { interactionType: qe.Redirect, authenticationRequest: { scopes: o }, children: l || !a() ? /* @__PURE__ */ s.jsx(Xr, {}) : i ? c ? /* @__PURE__ */ s.jsx(s.Fragment, { children: e }) : /* @__PURE__ */ s.jsx(n, { to: "/user-not-permitted", replace: !0 }) : /* @__PURE__ */ s.jsx(n, { to: "/no-user-login", replace: !0 }) }) : !a() || !i ? /* @__PURE__ */ s.jsx(n, { to: "/login", replace: !0 }) : c ? e : /* @__PURE__ */ s.jsx(n, { to: "/user-not-permitted", replace: !0 });
3533
+ }, Jc = (t) => {
3534
+ const { variant: e, children: n, className: r, size: o = "md", typographyVariant: a = o === "sm" ? "body2" : "body", ...i } = { ...t };
3535
+ return /* @__PURE__ */ s.jsx(xs, { variant: e, className: `text-center ${o === "sm" ? "p-1" : o === "md" ? "p-3" : "p-4"} bg-${e} bg-opacity-10 border-none ${r ?? ""}`, ...i, children: /* @__PURE__ */ s.jsx(z, { variant: a, children: n }) });
3536
+ }, Zc = ({ version: t }) => /* @__PURE__ */ s.jsx("div", { className: "rounded", style: {
3537
+ position: "fixed",
3538
+ right: "0px",
3539
+ bottom: "0px",
3540
+ zIndex: "10000",
3541
+ backgroundColor: "rgba(255, 255, 255, 0.5)",
3542
+ padding: "4px",
3543
+ pointerEvents: "all"
3544
+ }, children: /* @__PURE__ */ s.jsxs(z, { variant: "caption", className: "w-100 text-end", children: [
3545
+ "verze ",
3546
+ t
3547
+ ] }) }), el = ({ heading: t, content: e, placement: n, children: r, trigger: o }) => /* @__PURE__ */ s.jsx(Yr, { placement: n, overlay: /* @__PURE__ */ s.jsxs(Ze, { className: "luminus-popover", children: [
3548
+ /* @__PURE__ */ s.jsx(Ze.Header, { children: typeof t == "string" ? /* @__PURE__ */ s.jsx(z, { variant: "h6", className: "text-primary", children: t }) : t }),
3549
+ /* @__PURE__ */ s.jsx(Ze.Body, { children: e })
3550
+ ] }), trigger: o ?? "hover", rootClose: !0, children: r }), ar = ({ currentSelection: t, selectedItemNavigateTo: e, children: n }) => {
3551
+ const { LinkComponent: r } = F(oe);
3552
+ if (!t || !t.id || !e)
3553
+ return /* @__PURE__ */ s.jsx("div", { className: "luminus-input-container position-relative w-100", children: n });
3554
+ const o = e(t);
3555
+ return /* @__PURE__ */ s.jsx(r, { to: o, className: "luminus-input-container position-relative w-100 text-decoration-none", children: n });
3556
+ }, tl = ({ InputContainer: t = Ve, label: e, value: n, onChange: r, hidden: o, disabled: a, className: i, type: l, withoutLabel: c }) => /* @__PURE__ */ s.jsx(t, { isForCheckInput: !0, hidden: o, label: e ?? "", withoutLabel: c, className: i, children: /* @__PURE__ */ s.jsx(ee.Check, { id: `check-${e}`, type: l ?? "checkbox", label: e ?? "", checked: n, onChange: (u) => {
3557
+ var d;
3558
+ r && r(((d = u.target) == null ? void 0 : d.checked) ?? !1);
3559
+ }, className: i ?? "", hidden: o ?? !1, disabled: a ?? !1 }) }), nl = ({ InputContainer: t = Ve, type: e, value: n, onChange: r, debounceMs: o, label: a, withoutLabel: i, placeholder: l, size: c, hidden: u, disabled: d, showClearIcon: h, clearValue: m, list: p, className: v, step: x }) => {
3560
+ const f = e === "number", j = O(() => {
3561
+ if (!r)
3562
+ return;
3563
+ const N = m ?? null;
3564
+ r(f ? N ? Number(N) : null : (N == null ? void 0 : N.toString()) ?? "");
3565
+ }, [m, f, r]), b = Y(null), [g, C] = P((n == null ? void 0 : n.toString()) ?? ""), k = O((N) => {
3566
+ const _ = N;
3567
+ r && (f && r(_ == null || _ === "" ? null : Number(_)), r(_ || null));
3568
+ }, [f, r]), y = O((N) => {
3569
+ var T;
3570
+ const _ = (T = N.target) == null ? void 0 : T.value;
3571
+ if (!o) {
3572
+ k(_);
3285
3573
  return;
3286
3574
  }
3287
- let E = null;
3288
- i ? E = (I == null ? void 0 : I.id) !== null && (I == null ? void 0 : I.id) !== "" ? parseInt(I.id.toString(), 10) : null : E = I.id === null || I.id === void 0 || I.id === "" ? null : I.id, f(n, E, {
3289
- shouldDirty: !0,
3290
- shouldValidate: $
3291
- });
3292
- }, [f, n, i, a, _, $]), B = O((I) => {
3293
- y(!1), R(I);
3294
- }, [R]), L = O((I) => {
3295
- N(I);
3296
- }, []);
3575
+ C(_), b.current !== null && window.clearTimeout(b.current), b.current = window.setTimeout(() => {
3576
+ k(_);
3577
+ }, o);
3578
+ }, [o, k]);
3297
3579
  D(() => {
3298
- W();
3299
- }, [W]), D(() => {
3300
- x.isSubmitted && M(!0);
3301
- }, [x]);
3302
- const G = O((I) => {
3303
- var E;
3304
- return I === null ? "" : !I.name || I.name.length === 0 ? ((E = I.id) == null ? void 0 : E.toString()) ?? "" : m ? `${I.name} (${I.id})` : I.name;
3305
- }, [m]), se = Q(() => e.map((I) => ({
3306
- id: I.id,
3307
- name: G(I)
3308
- })).filter((I) => {
3309
- var E;
3310
- return S ? (E = I.name) == null ? void 0 : E.toLowerCase().includes(S.toLowerCase()) : !0;
3311
- }).sort((I, E) => h ? 0 : (I.name ?? "").localeCompare(E.name ?? "")), [e, h, S, G]), te = Y(null), U = g !== void 0;
3312
- return /* @__PURE__ */ s.jsx(s.Fragment, { children: /* @__PURE__ */ s.jsxs(t, { label: `${r}${l ? " *" : ""}`, hidden: c, withoutLabel: d, isInvalid: U, inputContainerClassName: w({ "luminus-dropdown-select-open": k }), className: p, children: [
3313
- /* @__PURE__ */ s.jsx(sn, { control: b, name: n, render: () => /* @__PURE__ */ s.jsx(ee.Select, { size: o, onMouseDown: (I) => {
3314
- I.currentTarget.focus(), I.preventDefault();
3315
- }, onClick: () => {
3316
- y(!0);
3317
- }, ref: te, value: _ ?? "", onChange: () => {
3318
- }, isInvalid: U, hidden: c, disabled: u, className: "w-100", children: /* @__PURE__ */ s.jsx("option", { value: (T == null ? void 0 : T.id) ?? "", children: G(T) }) }) }),
3319
- g && /* @__PURE__ */ s.jsx(ye, { message: g.message }),
3320
- te.current && /* @__PURE__ */ s.jsx(_t, { show: k, onCancel: () => y(!1), items: se, currentSelection: T ?? null, onSelectionChange: B, onSearchQueryChange: L, texts: v, disabled: u, inputRef: te, autoHideSearch: !0, allItemsLength: e.length })
3321
- ] }) });
3322
- }, Ja = "_item_1dy8x_1", or = {
3323
- item: Ja
3324
- }, Za = ({
3325
- color: t = "primary",
3326
- // icon = <MdOutlineArrowOutward />,
3327
- icon: e,
3328
- className: n,
3329
- children: r,
3330
- ...o
3331
- }) => /* @__PURE__ */ s.jsxs(Ee.Item, { className: w(`btn luminus-dropdown-item text-nowrap rounded text-${t} ${n ?? ""}`, or.item), ...o, children: [
3332
- e,
3333
- r
3334
- ] }), ei = (t) => /* @__PURE__ */ s.jsx(Ee.Toggle, { ...t }), rl = ({ color: t = "primary", icon: e = /* @__PURE__ */ s.jsx(Jt, { size: 12 }), inputId: n = "context-file-input", accept: r = "*", onUpload: o, multiple: a, className: i, children: l, ...c }) => {
3335
- const u = (d) => {
3336
- d.target.files && (o(d.target.files), d.target.value = "");
3337
- };
3338
- return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3339
- /* @__PURE__ */ s.jsxs("label", { htmlFor: n, className: w(`btn luminus-dropdown-item text-nowrap rounded text-${t} ${i ?? ""}`, or.item), ...c, children: [
3340
- e,
3341
- l
3342
- ] }),
3343
- /* @__PURE__ */ s.jsx("input", { id: n, type: "file", accept: r, onChange: u, hidden: !0, multiple: a })
3580
+ C(n === null ? "" : n.toString());
3581
+ }, [n]);
3582
+ const [$, M] = P(!1), S = un(e, n ? n.toString() ?? null : null, $);
3583
+ return /* @__PURE__ */ s.jsxs(t, { withoutLabel: i, label: a ?? "", hidden: u, className: v, children: [
3584
+ /* @__PURE__ */ s.jsx(ee.Control, { type: S, placeholder: l ?? a, size: c, value: o ? g : n ?? "", onChange: y, className: v ?? "", hidden: u, disabled: d ?? !1, list: p, onFocus: () => M(!0), onBlur: () => M(!1), step: x }),
3585
+ h && n && r && !d && /* @__PURE__ */ s.jsx("div", { className: `luminus-input-remove-icon ${e !== "text" ? "inset" : ""}`, children: /* @__PURE__ */ s.jsx(Z, { color: "secondary", size: "sm", onClick: j, children: /* @__PURE__ */ s.jsx(ke, {}) }) })
3344
3586
  ] });
3345
- }, ti = "_divider_1e6rk_1", ni = {
3346
- divider: ti
3347
- }, ol = ({ className: t }) => /* @__PURE__ */ s.jsx(Ee.Divider, { className: w("luminus-dropdown-divider", t, ni.divider) }), ri = "_dropdown_1lk66_1", oi = {
3348
- dropdown: ri
3349
- }, si = ({ toggle: t, children: e, ...n }) => /* @__PURE__ */ s.jsxs(Ee, { ...n, children: [
3350
- t,
3351
- /* @__PURE__ */ s.jsx(Ee.Menu, { className: w("luminus-dropdown rounded shadow", oi.dropdown), children: e })
3352
- ] }), sl = ({ cell: { value: t } }) => /* @__PURE__ */ s.jsx(s.Fragment, { children: t ? /* @__PURE__ */ s.jsx(Mr, { name: t, size: 21, fontSize: 12 }) : /* @__PURE__ */ s.jsx(s.Fragment, {}) }), ai = "_tab-panel_qgi9v_1", ii = "_full-height-no-overflow_qgi9v_5", ci = "_disabled_qgi9v_10", ot = {
3353
- "tab-panel": "_tab-panel_qgi9v_1",
3354
- tabPanel: ai,
3355
- "full-height-no-overflow": "_full-height-no-overflow_qgi9v_5",
3356
- fullHeightNoOverflow: ii,
3357
- disabled: ci
3358
- }, al = ({ eventKey: t, activeTab: e, fullHeightNoOverflow: n, disabled: r, className: o, children: a }) => t !== e ? null : /* @__PURE__ */ s.jsx("div", { className: w("luminus-tab-panel", ot.tabPanel, { [ot.fullHeightNoOverflow]: n }, { disabled: r }, { [ot.disabled]: r }, o), children: a }), il = ({ activeTab: t, onSelect: e, children: n }) => /* @__PURE__ */ s.jsx("div", { className: w("luminus-tabs d-flex gap-1 mb-2"), children: n.map((r) => {
3359
- const o = r.type, a = r.props;
3360
- if (!a)
3361
- return null;
3362
- const i = a.eventKey, l = a.children, c = a.className, u = a.onClick;
3363
- return /* @__PURE__ */ Hr(o, { ...a, key: a.eventKey, className: w({ active: t === i }, c), onClick: () => {
3364
- e(i), u && u(i);
3365
- } }, l);
3366
- }) }), li = "_tab_1hdhk_1", ui = "_disabled_1hdhk_8", Bt = {
3367
- tab: li,
3368
- disabled: ui
3369
- }, cl = ({ eventKey: t, className: e, onClick: n, disabled: r, children: o }) => /* @__PURE__ */ s.jsx("div", { role: "button", className: w("luminus-tab text-primary rounded", Bt.tab, e, {
3370
- disabled: r
3371
- }, { [Bt.disabled]: r }), onClick: () => n && !r && n(t), children: typeof o == "string" ? /* @__PURE__ */ s.jsx(z, { variant: "h6", className: "text-primary", children: o }) : o }), di = ({ show: t, widgets: e, handleClose: n, onWidgetPicked: r, texts: o }) => /* @__PURE__ */ s.jsxs(We, { show: t, onHide: () => n(), children: [
3372
- /* @__PURE__ */ s.jsx(We.Header, { closeButton: !0, children: /* @__PURE__ */ s.jsx(We.Title, { children: o.pickWidgetToAdd }) }),
3373
- /* @__PURE__ */ s.jsx(We.Body, { children: /* @__PURE__ */ s.jsx("div", { className: "list-group", children: e.filter((a) => a.id >= 0).map((a) => /* @__PURE__ */ s.jsx("div", { role: "button", className: "list-group-item bg-white", onClick: () => r(a.id), children: /* @__PURE__ */ s.jsx(z, { variant: "body", children: a.name }) })) }) })
3374
- ] }), Ht = ({ availableWidgets: t, onAdd: e, texts: n }) => {
3375
- const [r, o] = P(!1);
3376
- return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3377
- /* @__PURE__ */ s.jsx("div", { className: w("luminus-empty-widget", Xa.widget), children: /* @__PURE__ */ s.jsx(Z, { onClick: () => o(!0), children: /* @__PURE__ */ s.jsx(Dr, {}) }) }),
3378
- /* @__PURE__ */ s.jsx(di, { show: r, widgets: t, handleClose: () => o(!1), onWidgetPicked: (a) => {
3379
- o(!1), e(a);
3380
- }, texts: n })
3587
+ }, rl = ({
3588
+ InputContainer: t = Ve,
3589
+ value: e,
3590
+ options: n,
3591
+ onChange: r,
3592
+ label: o,
3593
+ withoutLabel: a,
3594
+ isNumber: i,
3595
+ size: l,
3596
+ hidden: c,
3597
+ disabled: u,
3598
+ showClearIcon: d,
3599
+ clearValue: h,
3600
+ noSortOptions: m,
3601
+ className: p,
3602
+ noEmptyOption: v
3603
+ // it will still add the empty option if there is no value provided or value is empty string or null
3604
+ }) => {
3605
+ const x = O(() => {
3606
+ if (!r)
3607
+ return;
3608
+ const f = h ?? null;
3609
+ r(i ? f ? Number(f) : null : (f == null ? void 0 : f.toString()) ?? "");
3610
+ }, [h, i, r]);
3611
+ return /* @__PURE__ */ s.jsxs(t, { withoutLabel: a, label: o ?? "", hidden: c, className: p, children: [
3612
+ /* @__PURE__ */ s.jsxs(ee.Select, { size: l, value: e ?? "", onChange: (f) => {
3613
+ var b;
3614
+ if (!r)
3615
+ return;
3616
+ const j = (b = f.target) == null ? void 0 : b.value;
3617
+ i && r(j ? parseInt(j, 10) : null), r(j || null);
3618
+ }, className: p ?? "", hidden: c, disabled: u ?? !1, children: [
3619
+ v && !(e == null || e === "") ? void 0 : /* @__PURE__ */ s.jsx("option", { value: "" }),
3620
+ n == null ? void 0 : n.sort((f, j) => m ? 0 : (f.name ?? "").localeCompare(j.name ?? "")).map((f) => /* @__PURE__ */ s.jsx("option", { value: f.id ?? "", children: f.name }, f.id))
3621
+ ] }),
3622
+ d && e && r && !u && /* @__PURE__ */ s.jsx("div", { className: "luminus-input-remove-icon inset", children: /* @__PURE__ */ s.jsx(Z, { color: "secondary", size: "sm", onClick: x, children: /* @__PURE__ */ s.jsx(ke, {}) }) })
3381
3623
  ] });
3382
- }, hi = (t) => {
3383
- const [e, n] = P({ widgets: [] });
3624
+ }, ol = ({ InputContainer: t = Ve, items: e, defaultSelection: n, selectedItemNavigateTo: r, onSearchQueryChange: o, texts: a, isLoading: i, isNumber: l, onSelect: c, label: u, withoutLabel: d, size: h, dropdownItemsNameWidth: m, additionalColumns: p, hidden: v, disabled: x, displayIdAsName: f, CustomOnChangeComponent: j, className: b }) => {
3625
+ var T, W;
3626
+ const [g, C] = P(n), [k, y] = P(!1);
3384
3627
  D(() => {
3385
- const o = localStorage.getItem("dashboardConfig");
3386
- o ? n(JSON.parse(o)) : t && n(t);
3387
- }, [t]);
3388
- const r = O((o) => {
3389
- n(o), localStorage.setItem("dashboardConfig", JSON.stringify(o));
3390
- }, []);
3391
- return { dashboardConfig: e, onChangeDashboardConfig: r };
3392
- }, mi = "_dashboard_16plm_1", fi = "_widgets-grid_16plm_1", pi = "_widget-wrapper_16plm_8", gi = "_full-width_16plm_13", wi = "_widget-edit_16plm_16", xi = "_remove-icon_16plm_19", yi = "_full-width-icon_16plm_26", bi = "_widget-edit-overlay_16plm_36", ae = {
3393
- dashboard: mi,
3394
- "widgets-grid": "_widgets-grid_16plm_1",
3395
- widgetsGrid: fi,
3396
- "widget-wrapper": "_widget-wrapper_16plm_8",
3397
- widgetWrapper: pi,
3398
- "full-width": "_full-width_16plm_13",
3399
- fullWidth: gi,
3400
- "widget-edit": "_widget-edit_16plm_16",
3401
- widgetEdit: wi,
3402
- "remove-icon": "_remove-icon_16plm_19",
3403
- removeIcon: xi,
3404
- "full-width-icon": "_full-width-icon_16plm_26",
3405
- fullWidthIcon: yi,
3406
- "widget-edit-overlay": "_widget-edit-overlay_16plm_36",
3407
- widgetEditOverlay: bi
3408
- };
3409
- class vi extends Gr {
3410
- constructor(e) {
3411
- super(e), this.state = { hasError: !1 }, this.reload = this.reload.bind(this);
3412
- }
3413
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
3414
- static getDerivedStateFromError(e) {
3415
- return { hasError: !0 };
3416
- }
3417
- componentDidCatch(e, n) {
3418
- console.error("Error:", e, n);
3419
- }
3420
- reload() {
3421
- this.setState({ hasError: !1 });
3422
- }
3423
- render() {
3424
- const { fallback: e, children: n, texts: r, reloadButtonDisplay: o = "append-after-child" } = this.props;
3425
- return this.state.hasError ? o === "inject-to-child" && Vr(e) ? J.cloneElement(e, {
3426
- ...e.props
3427
- }, /* @__PURE__ */ s.jsxs("div", { className: "translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2", children: [
3428
- ...e.props.children,
3429
- /* @__PURE__ */ s.jsx(ct, { type: "button", onClick: this.reload, children: r.reloadButtonContent })
3430
- ] })) : /* @__PURE__ */ s.jsxs("div", { className: "translate-middle top-50 start-50 position-absolute d-flex flex-column align-items-center gap-2", children: [
3431
- e,
3432
- o === "none" ? null : /* @__PURE__ */ s.jsx(ct, { type: "button", onClick: this.reload, children: r.reloadButtonContent })
3433
- ] }) : n;
3434
- }
3435
- }
3436
- const _i = (t) => (n) => {
3437
- const { errorBoundaryTexts: r } = F(oe);
3438
- return /* @__PURE__ */ s.jsx(t, { texts: r, ...n });
3439
- }, ji = _i(vi), ki = "_widget-card_e9tsb_1", Ci = {
3440
- "widget-card": "_widget-card_e9tsb_1",
3441
- widgetCard: ki
3442
- }, Gt = ({ children: t, title: e, headerContent: n }) => /* @__PURE__ */ s.jsx(vc, { className: w(Ci.widgetCard, "luminus-widget"), title: e, headerContent: n, contentClassName: "h-100 overflow-auto", children: t }), Ni = ({ children: t, title: e }) => {
3443
- const { widgetTexts: n } = F(oe);
3444
- return /* @__PURE__ */ s.jsx(ji, { fallback: /* @__PURE__ */ s.jsx(Gt, { title: e, children: n.fallbackError }), reloadButtonDisplay: "inject-to-child", children: /* @__PURE__ */ s.jsx(Ur, { fallback: /* @__PURE__ */ s.jsx(Gt, { title: e, children: /* @__PURE__ */ s.jsx(Zr, {}) }), children: t }) });
3445
- }, ll = ({ availableWidgets: t, editMode: e, defaultDashboardConfig: n }) => {
3446
- var d;
3447
- const { homeDashboardTexts: r } = F(oe), { dashboardConfig: o, onChangeDashboardConfig: a } = hi(n), i = O((h, m) => {
3448
- var p, v;
3449
- h === ((p = o.widgets) == null ? void 0 : p.length) ? a({
3450
- ...o,
3451
- widgets: [...o.widgets, { widgetId: m, fullWidth: !1 }]
3452
- }) : a({
3453
- ...o,
3454
- widgets: ((v = o.widgets) == null ? void 0 : v.map((x, f) => f === h ? { widgetId: m, fullWidth: !1 } : x)) ?? []
3455
- });
3456
- }, [o, a]), l = O((h) => {
3457
- var m, p;
3458
- ((m = o.widgets[h]) == null ? void 0 : m.widgetId) === -1 ? a({
3459
- ...o,
3460
- widgets: ((p = o.widgets) == null ? void 0 : p.filter((v, x) => x !== h)) ?? []
3461
- }) : i(h, -1);
3462
- }, [o, a, i]), c = O((h) => {
3463
- var m;
3464
- a({
3465
- ...o,
3466
- widgets: ((m = o.widgets) == null ? void 0 : m.map((p, v) => v === h ? { ...p, fullWidth: !p.fullWidth } : p)) ?? []
3467
- });
3468
- }, [o, a]), u = O((h, m, p) => h ? /* @__PURE__ */ s.jsxs("div", { className: w(ae.widgetWrapper, {
3469
- [ae.widgetEdit]: e && h.id !== -1
3470
- }, { [ae.fullWidth]: p }), children: [
3471
- e && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3472
- /* @__PURE__ */ s.jsx(Z, { color: "danger", onClick: () => l(m), className: w(ae.removeIcon), children: /* @__PURE__ */ s.jsx(en, {}) }),
3473
- /* @__PURE__ */ s.jsx(Z, { color: p ? "danger" : "primary", onClick: () => c(m), className: w(ae.fullWidthIcon), children: /* @__PURE__ */ s.jsx(Pr, {}) })
3628
+ C(n);
3629
+ }, [n]);
3630
+ const $ = O((R) => {
3631
+ C(R);
3632
+ }, []), M = O((R) => {
3633
+ y(!1), $(R);
3634
+ }, [$]);
3635
+ D(() => {
3636
+ c && c(g);
3637
+ }, [g, c]);
3638
+ const S = Y(null), N = r !== void 0, _ = N && g !== null;
3639
+ return /* @__PURE__ */ s.jsx(s.Fragment, { children: /* @__PURE__ */ s.jsxs(t, { withoutLabel: d, label: u ?? "", hidden: v, inputContainerClassName: w({ "luminus-dropdown-select-open": k }), className: b, children: [
3640
+ /* @__PURE__ */ s.jsxs(ar, { currentSelection: g, selectedItemNavigateTo: r, children: [
3641
+ f && (g == null ? void 0 : g.name) && /* @__PURE__ */ s.jsx(z, { variant: "caption", className: "d-flex justify-content-end mt-2 luminus-dropdown-selection-name", children: g.name }),
3642
+ /* @__PURE__ */ s.jsxs(ee.Select, { ref: S, size: h, value: (g == null ? void 0 : g.id) ?? "", onChange: (R) => C({
3643
+ id: l ? Number(R.target.value) ?? null : R.target.value,
3644
+ name: ""
3645
+ }), onMouseDown: (R) => {
3646
+ R.currentTarget.focus(), R.preventDefault();
3647
+ }, onClick: () => {
3648
+ !N && !x && y(!0);
3649
+ }, className: w("w-100", {
3650
+ "luminus-dropdown-picker-disabled": x,
3651
+ "luminus-dropdown-picker-link": _
3652
+ }), hidden: v, children: [
3653
+ /* @__PURE__ */ s.jsx("option", { value: "" }),
3654
+ n && /* @__PURE__ */ s.jsx("option", { value: n.id ?? void 0, children: n.name && ((T = n.name) == null ? void 0 : T.length) > 0 ? n.name : n.id }),
3655
+ g && /* @__PURE__ */ s.jsx("option", { value: g.id ?? void 0, children: g.name && ((W = g.name) == null ? void 0 : W.length) > 0 ? g.name : g.id })
3656
+ ] }),
3657
+ j || !x && N ? /* @__PURE__ */ s.jsxs("div", { className: "custom-picker-button", children: [
3658
+ !j && !x && N && /* @__PURE__ */ s.jsx(Z, { size: "sm", color: "secondary", onClick: (R) => {
3659
+ R.preventDefault(), R.stopPropagation(), y(!0);
3660
+ }, children: /* @__PURE__ */ s.jsx(nn, {}) }),
3661
+ j ?? null
3662
+ ] }) : null
3474
3663
  ] }),
3475
- h.id === -1 ? e && /* @__PURE__ */ s.jsx("div", { className: ae.widgetWrapper, children: /* @__PURE__ */ s.jsx(Ht, { availableWidgets: t, onAdd: (v) => i(m, v), texts: r }) }) : /* @__PURE__ */ s.jsx(Ni, { title: h.title, children: /* @__PURE__ */ s.jsx(h.WidgetElement, { title: h.title }) }),
3476
- h.id > -1 && e && /* @__PURE__ */ s.jsx("div", { className: ae.widgetEditOverlay })
3477
- ] }, m) : /* @__PURE__ */ s.jsx(s.Fragment, {}), [
3478
- e,
3479
- i,
3480
- l,
3481
- c,
3482
- t,
3483
- r
3484
- ]);
3485
- return /* @__PURE__ */ s.jsx("div", { className: ae.dashboard, children: /* @__PURE__ */ s.jsxs("div", { className: ae.widgetsGrid, children: [
3486
- (d = o.widgets) == null ? void 0 : d.map((h, m) => u(t.find((p) => p.id === h.widgetId), m, h.fullWidth)),
3487
- e && /* @__PURE__ */ s.jsx(Ht, { availableWidgets: t, onAdd: (h) => {
3488
- var m;
3489
- return i((m = o.widgets) == null ? void 0 : m.length, h);
3490
- }, texts: r })
3664
+ S.current && /* @__PURE__ */ s.jsx(_t, { show: k, onCancel: () => y(!1), items: e, currentSelection: g, onSelectionChange: M, onSearchQueryChange: o, texts: a, itemsNameWidth: m, additionalColumns: p, isLoading: i, disabled: x, inputRef: S })
3491
3665
  ] }) });
3492
- }, $i = "_badge_nhser_1", Ii = "_sm_nhser_1", Si = "_md_nhser_4", Ti = "_lg_nhser_7", Vt = {
3493
- badge: $i,
3494
- sm: Ii,
3495
- md: Si,
3496
- lg: Ti
3497
- }, ul = ({ children: t, color: e = "primary", size: n = "md", className: r }) => /* @__PURE__ */ s.jsx("span", { className: w(`luminus-badge badge bg-${e} ${r ?? ""}`, Vt.badge, Vt[n]), children: t }), Ei = "_collapse-icon_1ahhn_1", Oi = "_collapsed_1ahhn_6", Ut = {
3498
- "collapse-icon": "_collapse-icon_1ahhn_1",
3499
- collapseIcon: Ei,
3500
- collapsed: Oi
3501
- }, dl = ({ title: t, children: e, className: n, ...r }) => {
3502
- const o = r.controlled ? !1 : r.defaultOpen ?? !1, [a, i] = P(o), l = r.controlled ? r.isOpen : a;
3503
- return D(() => {
3504
- i(o);
3505
- }, [o]), /* @__PURE__ */ s.jsxs("div", { className: n ?? "", children: [
3506
- /* @__PURE__ */ s.jsxs("div", { role: "button", className: "d-flex align-items-center justify-content-between pb-3 pt-2", onClick: () => r.controlled ? r.onToggle(!r.isOpen) : i(!a), children: [
3507
- /* @__PURE__ */ s.jsx(z, { variant: "h6", children: t }),
3508
- /* @__PURE__ */ s.jsx(tn, { className: w(Ut.collapseIcon, {
3509
- [Ut.collapsed]: l
3510
- }) })
3511
- ] }),
3512
- /* @__PURE__ */ s.jsx(gn, { in: l, children: /* @__PURE__ */ s.jsx("div", { children: e }) }),
3513
- /* @__PURE__ */ s.jsx("hr", { className: `my-0 ${l ? "mt-3" : ""}` })
3514
- ] });
3515
- }, Mi = "_feedback_esh1j_1", Di = "_feedback-spacer_esh1j_8", zt = {
3516
- feedback: Mi,
3517
- "feedback-spacer": "_feedback-spacer_esh1j_8",
3518
- feedbackSpacer: Di
3519
- }, ye = ({ message: t }) => /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3520
- /* @__PURE__ */ s.jsx("div", { className: w("invalid-feedback luminus-invalid-feedback", zt.feedback), children: t }),
3521
- /* @__PURE__ */ s.jsx("div", { className: w("invalid-feedback-spacer", zt.feedbackSpacer), children: t })
3522
- ] });
3523
- function Pi(t, e, n) {
3524
- var r = this, o = Y(null), a = Y(0), i = Y(null), l = Y([]), c = Y(), u = Y(), d = Y(t), h = Y(!0);
3525
- d.current = t;
3526
- var m = typeof window < "u", p = !e && e !== 0 && m;
3527
- if (typeof t != "function")
3528
- throw new TypeError("Expected a function");
3529
- e = +e || 0;
3530
- var v = !!(n = n || {}).leading, x = !("trailing" in n) || !!n.trailing, f = "maxWait" in n, j = "debounceOnServer" in n && !!n.debounceOnServer, b = f ? Math.max(+n.maxWait || 0, e) : null;
3531
- D(function() {
3532
- return h.current = !0, function() {
3533
- h.current = !1;
3534
- };
3535
- }, []);
3536
- var g = Q(function() {
3537
- var C = function(N) {
3538
- var _ = l.current, T = c.current;
3539
- return l.current = c.current = null, a.current = N, u.current = d.current.apply(T, _);
3540
- }, k = function(N, _) {
3541
- p && cancelAnimationFrame(i.current), i.current = p ? requestAnimationFrame(N) : setTimeout(N, _);
3542
- }, y = function(N) {
3543
- if (!h.current)
3544
- return !1;
3545
- var _ = N - o.current;
3546
- return !o.current || _ >= e || _ < 0 || f && N - a.current >= b;
3547
- }, $ = function(N) {
3548
- return i.current = null, x && l.current ? C(N) : (l.current = c.current = null, u.current);
3549
- }, M = function N() {
3550
- var _ = Date.now();
3551
- if (y(_))
3552
- return $(_);
3553
- if (h.current) {
3554
- var T = e - (_ - o.current), W = f ? Math.min(T, b - (_ - a.current)) : T;
3555
- k(N, W);
3556
- }
3557
- }, S = function() {
3558
- if (m || j) {
3559
- var N = Date.now(), _ = y(N);
3560
- if (l.current = [].slice.call(arguments), c.current = r, o.current = N, _) {
3561
- if (!i.current && h.current)
3562
- return a.current = o.current, k(M, e), v ? C(o.current) : u.current;
3563
- if (f)
3564
- return k(M, e), C(o.current);
3565
- }
3566
- return i.current || k(M, e), u.current;
3666
+ }, sl = ({ InputContainer: t = xe, formField: e, label: n, resetsFields: r, type: o, required: a, hidden: i, disabled: l, withoutLabel: c, className: u }) => {
3667
+ const { register: d, formState: h, setValue: m } = me(), [p, v] = P(void 0), [x, f] = P(!1);
3668
+ D(() => {
3669
+ const b = e.split(".");
3670
+ let g = h.errors;
3671
+ b.forEach((C) => {
3672
+ g !== void 0 && (g = g[C]);
3673
+ }), v(g);
3674
+ }, [h, e]), D(() => {
3675
+ h.isSubmitted && f(!0);
3676
+ }, [h]);
3677
+ const j = p !== void 0;
3678
+ return /* @__PURE__ */ s.jsxs(t, { isForCheckInput: !0, hidden: i, label: `${n}${a ? " *" : ""}`, isInvalid: j, withoutLabel: c, className: u, children: [
3679
+ /* @__PURE__ */ s.jsx(ee.Check, { id: `check-${e}`, type: o ?? "checkbox", label: `${n}${a ? " *" : ""}`, ...d(e, {
3680
+ onChange: () => {
3681
+ r && r.forEach((b) => m(b, null, { shouldDirty: !0, shouldValidate: x }));
3567
3682
  }
3568
- };
3569
- return S.cancel = function() {
3570
- i.current && (p ? cancelAnimationFrame(i.current) : clearTimeout(i.current)), a.current = 0, l.current = o.current = c.current = i.current = null;
3571
- }, S.isPending = function() {
3572
- return !!i.current;
3573
- }, S.flush = function() {
3574
- return i.current ? $(Date.now()) : u.current;
3575
- }, S;
3576
- }, [v, f, e, b, x, p, m, j]);
3577
- return g;
3578
- }
3579
- function Ai(t, e) {
3580
- return t === e;
3581
- }
3582
- function Fi(t, e) {
3583
- return e;
3584
- }
3585
- function sr(t, e, n) {
3586
- var r = Ai, o = rn(Fi, t), a = o[0], i = o[1], l = Pi(O(function(u) {
3587
- return i(u);
3588
- }, [i]), e, n), c = Y(t);
3589
- return r(c.current, t) || (l(t), c.current = t), [a, l];
3590
- }
3591
- const Wi = "_wrapper_uccrb_1", Ri = "_open_uccrb_9", Li = "_dropdown_uccrb_13", qi = "_search-input-container_uccrb_19", Yi = "_search-input_uccrb_19", Bi = "_loading-container_uccrb_25", Hi = "_items-container_uccrb_32", Gi = "_header-row_uccrb_38", Vi = "_item_uccrb_32", Ui = "_name_uccrb_57", zi = "_column-item_uccrb_62", Ki = "_icon_uccrb_66", Qi = "_clear-button_uccrb_74", X = {
3592
- wrapper: Wi,
3593
- open: Ri,
3594
- dropdown: Li,
3595
- "search-input-container": "_search-input-container_uccrb_19",
3596
- searchInputContainer: qi,
3597
- "search-input": "_search-input_uccrb_19",
3598
- searchInput: Yi,
3599
- "loading-container": "_loading-container_uccrb_25",
3600
- loadingContainer: Bi,
3601
- "items-container": "_items-container_uccrb_32",
3602
- itemsContainer: Hi,
3603
- "header-row": "_header-row_uccrb_38",
3604
- headerRow: Gi,
3605
- item: Vi,
3606
- name: Ui,
3607
- "column-item": "_column-item_uccrb_62",
3608
- columnItem: zi,
3609
- icon: Ki,
3610
- "clear-button": "_clear-button_uccrb_74",
3611
- clearButton: Qi
3612
- }, _t = ({ show: t, onCancel: e, items: n, currentSelection: r, onSelectionChange: o, onSearchQueryChange: a, texts: i, itemsNameWidth: l, additionalColumns: c, displayIdAsName: u = !1, autoHideSearch: d = !1, allItemsLength: h, disabled: m, isLoading: p = !1, inputRef: v }) => {
3613
- var I;
3614
- const x = Y(null), f = Y(null), j = Y(null), [b, g] = P(""), [C] = sr(b, 500), [, k] = P(!1), y = (I = v.current) == null ? void 0 : I.getBoundingClientRect(), $ = (y == null ? void 0 : y.x) ?? 0, M = ((y == null ? void 0 : y.x) ?? 0) + ((y == null ? void 0 : y.width) ?? 0), S = (y == null ? void 0 : y.y) ?? 0, N = ((y == null ? void 0 : y.y) ?? 0) + ((y == null ? void 0 : y.height) ?? 0), _ = (y == null ? void 0 : y.width) ?? 0, T = (y == null ? void 0 : y.height) ?? 0, W = 5, R = Q(() => $ ? $ > window.innerWidth / 2 : !1, [$]), B = Q(() => S ? S > window.innerHeight / 2 : !1, [S]);
3683
+ }), isInvalid: j, hidden: i, disabled: l, className: "w-100" }),
3684
+ p && /* @__PURE__ */ s.jsx(ye, { message: p.message })
3685
+ ] });
3686
+ }, al = ({ InputContainer: t = xe, label: e, formField: n, options: r, resetsFields: o, required: a, disabled: i, hidden: l, className: c }) => {
3687
+ const { register: u, formState: d, setValue: h, watch: m } = me(), [p, v] = P(void 0), [x, f] = P(!1), j = Q(() => r, [r]);
3615
3688
  D(() => {
3616
- var E;
3617
- t && ((E = j.current) == null || E.focus());
3618
- }, [j, t]), D(() => {
3619
- t || g("");
3620
- }, [t]), D(() => {
3621
- a(C);
3622
- }, [C, a]);
3623
- const L = O((E) => {
3624
- switch (E.key) {
3625
- case "Escape":
3626
- E.stopPropagation(), e();
3627
- break;
3628
- }
3629
- }, [e]), G = O(() => {
3630
- k((E) => !E);
3631
- }, []);
3632
- D(() => (window.addEventListener("scroll", G), () => {
3633
- window.removeEventListener("scroll", G);
3634
- }), [G]), D(() => (window.addEventListener("resize", G), () => {
3635
- window.removeEventListener("resize", G);
3636
- }), [G]), ln(L), un([x, f], e);
3637
- const se = l ?? (c && c.length > 0 ? 250 : 0), te = (c == null ? void 0 : c.reduce((E, K) => E + (K.width ?? 100), 0)) ?? 0, U = `calc(max(${_}px, ${se}px + ${te}px))`;
3638
- return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3639
- /* @__PURE__ */ s.jsx(ar, { show: t, onClick: e }),
3640
- r && t && !m && /* @__PURE__ */ s.jsx("button", { ref: f, type: "button", className: w("luminus-dropdown-picker-clear-button", X.clearButton), onClick: () => !m && o(null), style: {
3641
- top: `calc(${S}px + ${T / 2}px - 12px)`,
3642
- left: `calc(${$}px - 24px - 8px)`
3643
- }, children: /* @__PURE__ */ s.jsx(z, { variant: "caption", className: "text-danger", children: /* @__PURE__ */ s.jsx(en, { size: 16 }) }) }),
3644
- /* @__PURE__ */ s.jsx("div", { className: w("luminus-dropdown-picker", X.wrapper, {
3645
- [X.open]: t
3646
- }), style: {
3647
- top: B ? `calc(${S}px - 50vh - 8px)` : `calc(${N}px + 8px)`,
3648
- left: R ? `calc(${M}px - ${U})` : $,
3649
- right: R ? `${M}px` : `calc(${$}px + ${U})`,
3650
- width: U,
3651
- justifyContent: B ? "flex-end" : "flex-start"
3652
- }, children: /* @__PURE__ */ s.jsx("div", { ref: x, className: w("shadow rounded", X.dropdown), children: !m && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3653
- d && (h ?? n.length) <= W ? null : /* @__PURE__ */ s.jsx("div", { className: w("search-input-container border-bottom", X.searchInputContainer), children: /* @__PURE__ */ s.jsx(ee.Control, { ref: j, type: "search", size: "sm", className: X.searchInput, placeholder: i.searchPlaceholder, value: b, onChange: (E) => {
3654
- var K;
3655
- return g(((K = E.target) == null ? void 0 : K.value) ?? "");
3656
- } }) }),
3657
- p ? /* @__PURE__ */ s.jsx("div", { className: X.loadingContainer, children: /* @__PURE__ */ s.jsx(yt, { animation: "border", variant: "primary" }) }) : n.length > 0 && /* @__PURE__ */ s.jsxs("div", { className: w("items", X.itemsContainer), children: [
3658
- c && c.length > 0 && /* @__PURE__ */ s.jsxs("div", { className: w("header-row border-bottom", X.headerRow), children: [
3659
- /* @__PURE__ */ s.jsx("div", { className: X.name }),
3660
- c == null ? void 0 : c.map((E) => /* @__PURE__ */ s.jsx("div", { className: X.columnItem, style: {
3661
- width: `${E.width ?? 100}px`,
3662
- minWidth: `${E.width ?? 100}px`,
3663
- maxWidth: `${E.width ?? 100}px`
3664
- }, children: /* @__PURE__ */ s.jsx(z, { variant: "caption", children: E.name }) }, E.key))
3665
- ] }),
3666
- n == null ? void 0 : n.map((E) => /* @__PURE__ */ s.jsxs("button", { type: "button", className: w("item cursor-pointer", X.item), onClick: () => !m && o(E), children: [
3667
- /* @__PURE__ */ s.jsx("div", { className: X.name, children: /* @__PURE__ */ s.jsx(z, { variant: "body2", children: u ? E.id : E.name }) }),
3668
- c == null ? void 0 : c.map((K) => /* @__PURE__ */ s.jsx("div", { className: X.columnItem, style: {
3669
- width: `${K.width ?? 100}px`,
3670
- minWidth: `${K.width ?? 100}px`,
3671
- maxWidth: `${K.width ?? 100}px`
3672
- }, children: /* @__PURE__ */ s.jsx(z, { variant: "caption", className: w("text-muted"), children: E.additionalColumns && E.additionalColumns[K.key] }) }, K.key))
3673
- ] }, E.id))
3674
- ] })
3675
- ] }) }) })
3689
+ const g = n.split(".");
3690
+ let C = d.errors;
3691
+ g.forEach((k) => {
3692
+ C !== void 0 && (C = C[k]);
3693
+ }), v(C);
3694
+ }, [d, n]), D(() => {
3695
+ d.isSubmitted && f(!0);
3696
+ }, [d]);
3697
+ const b = p !== void 0;
3698
+ return /* @__PURE__ */ s.jsxs(t, { isForRadioInput: !0, hidden: l, withoutLabel: !e, label: `${e}${a ? " *" : ""}`, isInvalid: b, className: c, children: [
3699
+ j.map((g) => /* @__PURE__ */ s.jsx(ee.Check, { id: `radio-${g.id}`, label: g.name, type: "radio", value: g.id ?? "", checked: m(n) === g.id, ...u(n, {
3700
+ onChange: () => {
3701
+ o && o.forEach((C) => h(C, null, { shouldDirty: !0, shouldValidate: x }));
3702
+ }
3703
+ }), isInvalid: b, hidden: l, disabled: i, className: "w-100" }, g.id)),
3704
+ p && /* @__PURE__ */ s.jsx(ye, { message: p.message })
3676
3705
  ] });
3677
- };
3678
- function Xi(t) {
3679
- return Ar({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z" }, child: [] }] })(t);
3680
- }
3681
- const Ji = ({ searchTypes: t, selectedType: e, setSelectedType: n }) => /* @__PURE__ */ s.jsx(si, { toggle: /* @__PURE__ */ s.jsx(ei, { as: Fr, icon: null, text: e == null ? void 0 : e.text }), children: t.map((r) => /* @__PURE__ */ s.jsx(Za, { icon: null, onClick: () => n(r), children: r.text }, r.key)) }), Zi = "_dropdown_1ddrg_1", ec = "_open_1ddrg_12", tc = "_loading-container_1ddrg_15", nc = "_groups-container_1ddrg_22", rc = "_group_1ddrg_22", oc = "_header_1ddrg_26", sc = "_item_1ddrg_33", fe = {
3682
- dropdown: Zi,
3683
- open: ec,
3684
- "loading-container": "_loading-container_1ddrg_15",
3685
- loadingContainer: tc,
3686
- "groups-container": "_groups-container_1ddrg_22",
3687
- groupsContainer: nc,
3688
- group: rc,
3689
- header: oc,
3690
- item: sc
3691
- }, ac = ({ show: t, query: e, onCancel: n, groups: r, isLoading: o, searchTypes: a }) => {
3692
- const { LinkComponent: i, appSearchTexts: l } = F(oe), c = Y(null), u = O((d) => {
3693
- var m;
3694
- const h = (m = a.find((p) => p.key === d.type)) == null ? void 0 : m.toPath;
3695
- return h ? `${h}/${d.searchKey}` : "/not-found";
3696
- }, [a]);
3697
- return un([c], n), /* @__PURE__ */ s.jsx("div", { ref: c, className: w("luminus-app-search-dropdown shadow rounded", fe.dropdown, {
3698
- [fe.open]: t
3699
- }), children: o ? /* @__PURE__ */ s.jsx("div", { className: fe.loadingContainer, children: /* @__PURE__ */ s.jsx(yt, { animation: "border", variant: "primary" }) }) : /* @__PURE__ */ s.jsx("div", { className: fe.groupsContainer, children: r == null ? void 0 : r.map((d) => {
3700
- var h;
3701
- return /* @__PURE__ */ s.jsxs("div", { className: w(fe.group), children: [
3702
- /* @__PURE__ */ s.jsxs(i, { to: `/search?query=${e}&type=${d.key.category}`, className: w("group-header", fe.header), onClick: n, children: [
3703
- /* @__PURE__ */ s.jsx(z, { variant: "body", className: "text-primary", children: d.key.categoryName }),
3704
- /* @__PURE__ */ s.jsxs(z, { variant: "caption", children: [
3705
- d.items.length,
3706
- " ",
3707
- l.amountFrom,
3708
- " ",
3709
- d.key.totalCount
3710
- ] })
3711
- ] }),
3712
- (h = d.items) == null ? void 0 : h.map((m, p) => /* @__PURE__ */ s.jsxs(
3713
- i,
3714
- {
3715
- to: u(m),
3716
- className: w("search-item d-flex gap-3 align-items-center justify-content-between", fe.item),
3717
- onClick: n,
3718
- children: [
3719
- /* @__PURE__ */ s.jsx(z, { variant: "body2", className: "text-nowrap text-truncate", children: m.name }),
3720
- /* @__PURE__ */ s.jsx(z, { variant: "caption", className: "text-primary", children: /* @__PURE__ */ s.jsx(Wr, {}) })
3721
- ]
3722
- },
3723
- p
3724
- ))
3725
- ] }, d.key.category);
3726
- }) }) });
3727
- }, ic = "_input-group_1lkfy_1", cc = "_input-group-text_1lkfy_5", lc = "_left_1lkfy_9", uc = "_right_1lkfy_13", dc = "_input_1lkfy_1", hc = "_submit-button_1lkfy_20", pe = {
3728
- "input-group": "_input-group_1lkfy_1",
3729
- inputGroup: ic,
3730
- "input-group-text": "_input-group-text_1lkfy_5",
3731
- inputGroupText: cc,
3732
- left: lc,
3733
- right: uc,
3734
- input: dc,
3735
- "submit-button": "_submit-button_1lkfy_20",
3736
- submitButton: hc
3737
- }, mc = (t, e) => {
3738
- const n = Rr(), [r, o] = P(!1), [a, i] = P([]), l = !t || !t.key, c = O(() => {
3739
- if (e.length < 3) {
3740
- i([]);
3741
- return;
3742
- }
3743
- o(!0), n.get(`/search/${e}?count=${l ? 5 : 20}${l ? "" : `&type=${t.key}`}`).then(({ data: u }) => {
3744
- i(u), o(!1);
3745
- }).catch(() => {
3746
- o(!1);
3747
- });
3748
- }, [t, e, n, l]);
3749
- return D(() => {
3750
- c();
3751
- }, [c]), { isLoading: r, searchItems: a };
3752
- }, hl = ({ searchTypes: t, navigateFunction: e }) => {
3753
- const { appSearchTexts: n } = F(oe), [r, o] = P(t.length > 0 ? t[0] : null), [a, i] = P(""), [l, c] = sr(a, 500), { isLoading: u, searchItems: d } = mc(r, l), [h, m] = P(!1);
3754
- return D(() => {
3755
- (d.length > 0 || u) && m(!0);
3756
- }, [d, u]), /* @__PURE__ */ s.jsx(ee, { onSubmit: (p) => {
3757
- p.preventDefault(), p.stopPropagation(), c.flush(), m(!1), a.length > 2 && e(`/search?query=${a}${r && r.key && `&type=${r == null ? void 0 : r.key}`}`);
3758
- }, children: /* @__PURE__ */ s.jsxs(nt, { className: pe.inputGroup, children: [
3759
- /* @__PURE__ */ s.jsx(nt.Text, { className: w("p-1 rounded", pe.inputGroupText, pe.left), children: /* @__PURE__ */ s.jsx(Ji, { searchTypes: t, selectedType: r, setSelectedType: o }) }),
3760
- /* @__PURE__ */ s.jsx(ee.Control, { placeholder: n.searchPlaceholder, type: "text", size: "sm", className: w("luminus-app-search-input", pe.input), value: a, onChange: (p) => {
3761
- var v;
3762
- return i(((v = p.target) == null ? void 0 : v.value) ?? "");
3763
- }, onFocus: () => d.length > 0 && m(!0) }),
3764
- /* @__PURE__ */ s.jsx(nt.Text, { className: w("p-0 rounded", pe.inputGroupText, pe.right), children: /* @__PURE__ */ s.jsx("button", { type: "submit", className: w("text-primary", pe.submitButton), children: /* @__PURE__ */ s.jsx(Xi, {}) }) }),
3765
- /* @__PURE__ */ s.jsx(ac, { query: l, searchTypes: t, show: h, onCancel: () => m(!1), groups: d, isLoading: u })
3766
- ] }) });
3767
- }, fc = "_card_19733_1", pc = "_header_19733_6", gc = "_header-content_19733_13", wc = "_title_19733_19", xc = "_collapse-icon_19733_22", yc = "_collapsed_19733_27", bc = "_content_19733_30", ge = {
3768
- card: fc,
3769
- header: pc,
3770
- "header-content": "_header-content_19733_13",
3771
- headerContent: gc,
3772
- title: wc,
3773
- "collapse-icon": "_collapse-icon_19733_22",
3774
- collapseIcon: xc,
3775
- collapsed: yc,
3776
- content: bc
3777
- }, vc = ({ title: t, headerContent: e, children: n, className: r, headerClassName: o, contentClassName: a, ...i }) => {
3778
- const l = i.collapsible ? i.controlled ? !1 : i.defaultOpen ?? !1 : !0, [c, u] = P(l), d = i.collapsible ? i.controlled ? i.isOpen : c : !0;
3779
- return D(() => {
3780
- u(l);
3781
- }, [l]), /* @__PURE__ */ s.jsxs("div", { className: w("luminus-card rounded shadow-sm", ge.card, {
3782
- [r ?? ""]: r
3783
- }), children: [
3784
- /* @__PURE__ */ s.jsxs("div", { role: i.collapsible ? "button" : void 0, className: w("header", ge.header, {
3785
- [o ?? ""]: o
3786
- }), onClick: () => {
3787
- i.collapsible && (i.controlled ? i.onToggle(!i.isOpen) : u(!c));
3788
- }, children: [
3789
- /* @__PURE__ */ s.jsxs("div", { className: w("header-content", ge.headerContent), children: [
3790
- /* @__PURE__ */ s.jsx(z, { variant: "h6", className: w("text-primary", ge.title), children: t }),
3791
- e ?? null
3792
- ] }),
3793
- i.collapsible && /* @__PURE__ */ s.jsx(tn, { className: w(ge.collapseIcon, {
3794
- [ge.collapsed]: d
3795
- }) })
3796
- ] }),
3797
- /* @__PURE__ */ s.jsx(gn, { in: d, children: /* @__PURE__ */ s.jsx("div", { className: w("card-content border-top border-primary", ge.content, {
3798
- [a ?? ""]: a
3799
- }), children: n }) })
3706
+ }, il = ({ InputContainer: t = xe, formField: e, label: n, resetsFields: r, size: o, showClearIcon: a, clearValue: i, required: l, hidden: c, disabled: u, rows: d, withoutLabel: h, customFormControlProps: m, className: p }) => {
3707
+ const { register: v, formState: x, setValue: f, watch: j } = me(), [b, g] = P(void 0), [C, k] = P(!1), y = O(() => {
3708
+ const S = i ?? null;
3709
+ f(e, (S == null ? void 0 : S.toString()) ?? "", { shouldDirty: !0, shouldValidate: C });
3710
+ }, [i, f, e, C]), $ = O(() => {
3711
+ const S = e.split(".");
3712
+ let N = x.errors;
3713
+ S.forEach((_) => {
3714
+ N !== void 0 && (N = N[_]);
3715
+ }), g(N);
3716
+ }, [x, e]);
3717
+ D(() => {
3718
+ $();
3719
+ }, [$]), D(() => {
3720
+ x.isSubmitted && k(!0);
3721
+ }, [x]);
3722
+ const M = b !== void 0;
3723
+ return /* @__PURE__ */ s.jsxs(t, { label: `${n}${l ? " *" : ""}`, hidden: c, withoutLabel: h, isInvalid: M, className: p, children: [
3724
+ /* @__PURE__ */ s.jsx(ee.Control, { as: "textarea", size: o, ...v(e, {
3725
+ onChange: () => {
3726
+ r && r.forEach((S) => f(S, null, { shouldDirty: !0, shouldValidate: C }));
3727
+ }
3728
+ }), isInvalid: M, hidden: c, disabled: u, rows: d ?? 2, className: "w-100", ...m }),
3729
+ a && j(e) && /* @__PURE__ */ s.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ s.jsx(Z, { color: "secondary", size: "sm", onClick: y, children: /* @__PURE__ */ s.jsx(ke, {}) }) }),
3730
+ b && /* @__PURE__ */ s.jsx(ye, { message: b.message })
3800
3731
  ] });
3801
- }, _c = "_lightbox_14acg_1", jc = "_show_14acg_16", kc = "_header_14acg_20", Cc = "_photo-actions_14acg_26", Nc = "_photo-container_14acg_31", $c = "_photo_14acg_26", Ic = "_nav-button_14acg_41", Sc = "_photos-preview_14acg_49", Tc = "_selected_14acg_62", Ec = "_default-indicator_14acg_66", ne = {
3802
- lightbox: _c,
3803
- show: jc,
3804
- header: kc,
3805
- "photo-actions": "_photo-actions_14acg_26",
3806
- photoActions: Cc,
3807
- "photo-container": "_photo-container_14acg_31",
3808
- photoContainer: Nc,
3809
- photo: $c,
3810
- "nav-button": "_nav-button_14acg_41",
3811
- navButton: Ic,
3812
- "photos-preview": "_photos-preview_14acg_49",
3813
- photosPreview: Sc,
3814
- selected: Tc,
3815
- "default-indicator": "_default-indicator_14acg_66",
3816
- defaultIndicator: Ec
3817
- }, Oc = "_backdrop_3huvf_1", Mc = "_show_3huvf_11", Kt = {
3818
- backdrop: Oc,
3819
- show: Mc
3820
- }, ar = ({ show: t, onClick: e }) => /* @__PURE__ */ s.jsx("div", { className: w("luminus-backdrop", Kt.backdrop, {
3821
- [Kt.show]: t
3822
- }), onClick: () => e && e() }), Dc = ({ show: t, onClose: e, photos: n, defaultIndex: r, uploadPhotosText: o, noPhotosText: a, onUploadPhotos: i, photoActions: l }) => {
3823
- const c = Y(null), [u, d] = P(r), h = n.at(u), m = u > 0, p = u < n.length - 1;
3732
+ }, cl = ({ InputContainer: t = xe, type: e, formField: n, label: r, placeholder: o, size: a, resetsFields: i, showClearIcon: l, clearValue: c, required: u, hidden: d, disabled: h, withoutLabel: m, list: p, step: v, CustomOnChangeComponent: x, className: f }) => {
3733
+ const { register: j, formState: b, setValue: g, watch: C } = me(), [k, y] = P(void 0), [$, M] = P(!1), S = O(() => {
3734
+ const L = c ?? null;
3735
+ e === "number" ? g(n, L !== null ? Number(L) : null, {
3736
+ shouldDirty: !0,
3737
+ shouldValidate: $
3738
+ }) : g(n, (L == null ? void 0 : L.toString()) ?? "", { shouldDirty: !0, shouldValidate: $ });
3739
+ }, [c, e, g, n, $]), N = O(() => {
3740
+ const L = n.split(".");
3741
+ let G = b.errors;
3742
+ L.forEach((se) => {
3743
+ G !== void 0 && (G = G[se]);
3744
+ }), y(G);
3745
+ }, [b, n]);
3824
3746
  D(() => {
3825
- t && d(r);
3826
- }, [r, t]), D(() => {
3827
- u >= n.length && d(n.length - 1);
3828
- }, [n, u]);
3829
- const v = O((x) => {
3830
- switch (x.key) {
3831
- case "ArrowLeft":
3832
- x.stopPropagation(), m && d((f) => f - 1);
3833
- break;
3834
- case "ArrowRight":
3835
- x.stopPropagation(), p && d((f) => f + 1);
3836
- break;
3837
- case "Escape":
3838
- x.stopPropagation(), e();
3839
- break;
3747
+ N();
3748
+ }, [N]), D(() => {
3749
+ b.isSubmitted && M(!0);
3750
+ }, [b]);
3751
+ const _ = k !== void 0, [T, W] = P(!1), R = C(n), B = un(e, R ?? null, T);
3752
+ return /* @__PURE__ */ s.jsxs(t, { label: `${r}${u ? " *" : ""}`, hidden: d, withoutLabel: m, isInvalid: _, className: f, children: [
3753
+ /* @__PURE__ */ s.jsxs("div", { className: "luminus-input-container position-relative w-100", children: [
3754
+ /* @__PURE__ */ s.jsx(ee.Control, { type: B, placeholder: o ?? r, size: a, onFocus: () => {
3755
+ W(!0);
3756
+ }, ...j(n, {
3757
+ setValueAs: (L) => e === "number" ? L == null || L === "" ? null : Number(L) : L == null || L === "" ? null : L,
3758
+ onChange: () => {
3759
+ i && i.forEach((L) => g(L, null, { shouldDirty: !0, shouldValidate: $ }));
3760
+ },
3761
+ onBlur: () => W(!1)
3762
+ }), isInvalid: _, hidden: d, disabled: h, list: p, className: "w-100", step: v }),
3763
+ x && /* @__PURE__ */ s.jsx("div", { className: "custom-picker-button", children: x })
3764
+ ] }),
3765
+ l && C(n) && /* @__PURE__ */ s.jsx("div", { className: `luminus-input-remove-icon ${e !== "text" ? "inset" : ""}`, children: /* @__PURE__ */ s.jsx(Z, { color: "secondary", size: "sm", onClick: S, children: /* @__PURE__ */ s.jsx(ke, {}) }) }),
3766
+ k && /* @__PURE__ */ s.jsx(ye, { message: k.message })
3767
+ ] });
3768
+ }, ll = ({ InputContainer: t = xe, formField: e, label: n, size: r, defaultSelection: o, resetsFields: a, isNumber: i, required: l, hidden: c, disabled: u, items: d, onSearchQueryChange: h, selectedItemNavigateTo: m, texts: p, dropdownItemsNameWidth: v, isLoading: x, withoutLabel: f, additionalColumns: j, CustomOnChangeComponent: b, displayIdAsName: g, className: C }) => {
3769
+ const { formState: k, setValue: y, watch: $, control: M } = me(), [S, N] = P(void 0), [_, T] = P(!1), [W, R] = P(!1), B = $(e) ?? null, L = B === (o == null ? void 0 : o.id) ? o == null ? void 0 : o.name : $(`${e}-DropdownName`), G = Q(() => B == null ? null : { id: B ?? null, name: L ?? "" }, [B, L]), se = O(() => {
3770
+ const H = e.split(".");
3771
+ let ce = k.errors;
3772
+ H.forEach((Je) => {
3773
+ ce !== void 0 && (ce = ce[Je]);
3774
+ }), N(ce);
3775
+ }, [k, e]), te = O((H) => {
3776
+ if ((H == null ? void 0 : H.id) === B)
3777
+ return;
3778
+ if (a && a.forEach((Je) => y(Je, null, { shouldDirty: !0, shouldValidate: W })), H === null) {
3779
+ y(e, null, {
3780
+ shouldDirty: !0,
3781
+ shouldValidate: W
3782
+ }), y(`${e}-DropdownName`, null);
3783
+ return;
3840
3784
  }
3841
- }, [p, m, e]);
3842
- return ln(v), /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3843
- /* @__PURE__ */ s.jsx(ar, { show: t, onClick: e }),
3844
- /* @__PURE__ */ s.jsxs("div", { ref: c, className: w("luminus-lightbox rounded shadow", ne.lightbox, {
3845
- [ne.show]: t
3846
- }), children: [
3847
- /* @__PURE__ */ s.jsxs("div", { className: ne.header, children: [
3848
- /* @__PURE__ */ s.jsxs("div", { className: w("rounded", ne.photoActions), children: [
3849
- i && /* @__PURE__ */ s.jsx(nr, { accept: ".jpg,.jpeg,.png", onUpload: (x) => {
3850
- x.length > 0 && i(Array.from(x));
3851
- }, icon: /* @__PURE__ */ s.jsx(nn, { style: { fontSize: 18 } }), multiple: !0, className: "me-3", children: o ?? null }),
3852
- h && (l == null ? void 0 : l.map(({ label: x, onClick: f, ...j }, b) => /* @__PURE__ */ s.jsx(
3853
- ct,
3854
- {
3855
- onClick: () => f(h.id),
3856
- ...j,
3857
- children: x
3858
- },
3859
- `action-${b}`
3860
- )))
3861
- ] }),
3862
- /* @__PURE__ */ s.jsx("div", { role: "button", onClick: e, children: /* @__PURE__ */ s.jsx(ke, { style: { fontSize: "32px" } }) })
3863
- ] }),
3864
- n.length === 0 && /* @__PURE__ */ s.jsx("div", { className: "w-100 h-100 d-flex align-items-center justify-content-center", children: /* @__PURE__ */ s.jsx(z, { variant: "body", children: a ?? "No photos available" }) }),
3865
- h && /* @__PURE__ */ s.jsxs("div", { className: ne.photoContainer, children: [
3866
- /* @__PURE__ */ s.jsx("div", { role: m ? "button" : void 0, className: w("align-items-start", ne.navButton), onClick: () => m && d((x) => x - 1), children: m && /* @__PURE__ */ s.jsx(mt, { style: { fontSize: "40px" } }) }),
3867
- /* @__PURE__ */ s.jsx("img", { src: h.lgSrc, alt: h.alt, className: w("rounded", ne.photo) }),
3868
- /* @__PURE__ */ s.jsx("div", { role: p ? "button" : void 0, className: w("align-items-end", ne.navButton), onClick: () => p && d((x) => x + 1), children: p && /* @__PURE__ */ s.jsx(ft, { style: { fontSize: "40px" } }) })
3869
- ] }),
3870
- /* @__PURE__ */ s.jsx("div", { className: ne.photosPreview, children: n.map((x, f) => /* @__PURE__ */ s.jsxs("div", { role: "button", onClick: () => d(f), className: "position-relative", children: [
3871
- /* @__PURE__ */ s.jsx("img", { role: f !== u ? "button" : void 0, src: x.smSrc, alt: x.alt, className: w("rounded", ne.photo, {
3872
- [ne.selected]: f === u
3873
- }) }, x.id),
3874
- x.isDefault && /* @__PURE__ */ s.jsx("div", { className: w("text-primary", ne.defaultIndicator), children: /* @__PURE__ */ s.jsx(Lr, {}) })
3875
- ] })) })
3876
- ] })
3785
+ let ce = null;
3786
+ i ? ce = (H == null ? void 0 : H.id) !== null && (H == null ? void 0 : H.id) !== "" ? parseInt(H.id.toString(), 10) : null : ce = H.id === null || H.id === void 0 || H.id === "" ? null : H.id, y(e, ce, {
3787
+ shouldDirty: !0,
3788
+ shouldValidate: W
3789
+ }), y(`${e}-DropdownName`, H.name ?? "");
3790
+ }, [y, e, W, i, a, B]), U = O((H) => {
3791
+ T(!1), te(H);
3792
+ }, [te]), I = O(() => {
3793
+ T(!1);
3794
+ }, []);
3795
+ D(() => {
3796
+ se();
3797
+ }, [se]), D(() => {
3798
+ k.isSubmitted && R(!0);
3799
+ }, [k]);
3800
+ const E = Y(null), K = S !== void 0, De = m !== void 0, ir = De && G !== null;
3801
+ return /* @__PURE__ */ s.jsx(s.Fragment, { children: /* @__PURE__ */ s.jsxs(t, { label: `${n}${l ? " *" : ""}`, hidden: c, withoutLabel: f, isInvalid: K, inputContainerClassName: w({ "luminus-dropdown-select-open": _ }), className: C, children: [
3802
+ /* @__PURE__ */ s.jsxs(ar, { currentSelection: G, selectedItemNavigateTo: m, children: [
3803
+ g && (G == null ? void 0 : G.name) && /* @__PURE__ */ s.jsx(z, { variant: "caption", className: "d-flex justify-content-end mt-2 luminus-dropdown-selection-name", children: G.name }),
3804
+ /* @__PURE__ */ s.jsx(sn, { control: M, name: e, render: () => /* @__PURE__ */ s.jsx(ee.Select, { size: r, onMouseDown: (H) => {
3805
+ H.currentTarget.focus(), H.preventDefault();
3806
+ }, onClick: () => {
3807
+ !De && !u && T(!0);
3808
+ }, ref: E, value: B ?? "", onChange: () => {
3809
+ }, isInvalid: K, hidden: c, className: w("w-100", {
3810
+ "luminus-dropdown-picker-disabled": u,
3811
+ "luminus-dropdown-picker-link": ir
3812
+ }), children: /* @__PURE__ */ s.jsx("option", { value: B, children: g ? B : (L == null ? void 0 : L.length) > 0 ? L : B }) }) }),
3813
+ b || !u && De ? /* @__PURE__ */ s.jsxs("div", { className: "custom-picker-button", children: [
3814
+ !b && !u && De && /* @__PURE__ */ s.jsx(Z, { size: "sm", color: "secondary", onClick: (H) => {
3815
+ H.preventDefault(), H.stopPropagation(), T(!0);
3816
+ }, children: /* @__PURE__ */ s.jsx(nn, {}) }),
3817
+ b ?? null
3818
+ ] }) : null
3819
+ ] }),
3820
+ S && /* @__PURE__ */ s.jsx(ye, { message: S.message }),
3821
+ E.current && /* @__PURE__ */ s.jsx(_t, { show: _, onCancel: I, items: d, currentSelection: G, onSelectionChange: U, onSearchQueryChange: h, texts: p, itemsNameWidth: v, additionalColumns: j, displayIdAsName: g, isLoading: x, disabled: u, inputRef: E })
3822
+ ] }) });
3823
+ }, ul = ({ InputContainer: t = xe, label: e, formField: n, hidden: r, required: o, placeholder: a, disabled: i, showClearIcon: l, resetsFields: c, multiple: u, accept: d, withoutLabel: h, className: m }) => {
3824
+ const { watch: p, setValue: v, register: x, formState: f } = me(), [j, b] = P(!1), [g, C] = P(void 0), k = O(() => {
3825
+ v(n, "");
3826
+ }, [v, n]), y = O(() => {
3827
+ const M = n.split(".");
3828
+ let S = f.errors;
3829
+ M.forEach((N) => {
3830
+ S !== void 0 && (S = S[N]);
3831
+ }), C(S);
3832
+ }, [f, n]);
3833
+ D(y, [y]), D(() => {
3834
+ f.isSubmitted && b(!0);
3835
+ }, [f]);
3836
+ const $ = g !== void 0;
3837
+ return /* @__PURE__ */ s.jsxs(t, { label: `${e}${o ? "*" : ""}`, hidden: r, withoutLabel: h, isInvalid: $, className: m, children: [
3838
+ /* @__PURE__ */ s.jsx(Gn, { type: "file", multiple: u, accept: d.join(", "), placeholder: a ?? e, isInvalid: $, hidden: r, disabled: i, className: "w-100", ...x(n, {
3839
+ onChange: () => {
3840
+ c && c.forEach((M) => v(M, null, { shouldDirty: !0, shouldValidate: j }));
3841
+ }
3842
+ }) }),
3843
+ l && p(n) && /* @__PURE__ */ s.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ s.jsx(Z, { color: "secondary", size: "sm", onClick: k, children: /* @__PURE__ */ s.jsx(ke, {}) }) }),
3844
+ g && /* @__PURE__ */ s.jsx(ye, { message: g.message })
3877
3845
  ] });
3878
- }, ml = ({ photos: t, onUploadPhotos: e, uploadPhotosText: n, photoActions: r }) => {
3879
- const [o, a] = P(null), i = o !== null ? t[o] : null, [l, c] = P(!1);
3846
+ }, dl = ({ children: t, onStorno: e }) => {
3847
+ const { formState: n } = me(), [r, o] = P(!1);
3880
3848
  return D(() => {
3881
- if (t.length === 0) {
3882
- a(null), c(!1);
3849
+ o(Object.keys(n.dirtyFields).length > 0);
3850
+ }, [n]), r ? /* @__PURE__ */ s.jsx(Ha, { onStorno: e, children: t }) : null;
3851
+ }, hl = ({ InputContainer: t = xe, options: e, formField: n, label: r, size: o, resetsFields: a, isNumber: i, required: l, hidden: c, disabled: u, withoutLabel: d, noSortOptions: h, suffixIdToName: m, className: p }) => {
3852
+ const { customSelectTexts: v } = F(oe), { formState: x, setValue: f, watch: j, control: b } = me(), [g, C] = P(void 0), [k, y] = P(!1), [$, M] = P(!1), [S, N] = P(""), _ = j(n), T = Q(() => e.find((I) => I.id === _) ?? null, [e, _]), W = O(() => {
3853
+ const I = n.split(".");
3854
+ let E = x.errors;
3855
+ I.forEach((K) => {
3856
+ E !== void 0 && (E = E[K]);
3857
+ }), C(E);
3858
+ }, [x, n]), R = O((I) => {
3859
+ if ((I == null ? void 0 : I.id) === _)
3860
+ return;
3861
+ if (a && a.forEach((K) => f(K, null, { shouldDirty: !0, shouldValidate: $ })), I === null) {
3862
+ f(n, null, {
3863
+ shouldDirty: !0,
3864
+ shouldValidate: $
3865
+ });
3883
3866
  return;
3884
3867
  }
3885
- const u = t.findIndex((d) => d.isDefault);
3886
- a(u > -1 ? u : 0);
3887
- }, [t]), i ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3888
- /* @__PURE__ */ s.jsx(
3889
- "img",
3890
- {
3891
- role: "button",
3892
- src: i.smSrc,
3893
- alt: i.alt,
3894
- className: "rounded w-100",
3895
- onClick: () => c(!0)
3896
- }
3897
- ),
3898
- /* @__PURE__ */ s.jsx(Dc, { show: l, onClose: () => c(!1), photos: t, defaultIndex: o ?? 0, uploadPhotosText: n, onUploadPhotos: e, photoActions: r })
3899
- ] }) : e ? /* @__PURE__ */ s.jsx(nr, { accept: ".jpg,.jpeg,.png", onUpload: (u) => {
3900
- u.length > 0 && e(Array.from(u));
3901
- }, icon: /* @__PURE__ */ s.jsx(nn, { style: { fontSize: 18 } }), multiple: !0, children: n ?? null }) : null;
3902
- }, fl = ({ appAccessPermissions: t, children: e }) => {
3903
- const { NavigateComponent: n } = F(oe), { useMsal: r, msalScopes: o } = F(qr), { isAuthenticated: a } = Yr(), { user: i, loggingInProgress: l } = F(Br), c = i && (t == null ? void 0 : t.every((u) => {
3904
- var d;
3905
- return (d = i.permissions) == null ? void 0 : d.includes(u);
3906
- }));
3907
- return r ? /* @__PURE__ */ s.jsx(Aa, { interactionType: qe.Redirect, authenticationRequest: { scopes: o }, children: l || !a() ? /* @__PURE__ */ s.jsx(Xr, {}) : i ? c ? /* @__PURE__ */ s.jsx(s.Fragment, { children: e }) : /* @__PURE__ */ s.jsx(n, { to: "/user-not-permitted", replace: !0 }) : /* @__PURE__ */ s.jsx(n, { to: "/no-user-login", replace: !0 }) }) : !a() || !i ? /* @__PURE__ */ s.jsx(n, { to: "/login", replace: !0 }) : c ? e : /* @__PURE__ */ s.jsx(n, { to: "/user-not-permitted", replace: !0 });
3908
- }, pl = (t) => {
3909
- const { variant: e, children: n, className: r, size: o = "md", typographyVariant: a = o === "sm" ? "body2" : "body", ...i } = { ...t };
3910
- return /* @__PURE__ */ s.jsx(xs, { variant: e, className: `text-center ${o === "sm" ? "p-1" : o === "md" ? "p-3" : "p-4"} bg-${e} bg-opacity-10 border-none ${r ?? ""}`, ...i, children: /* @__PURE__ */ s.jsx(z, { variant: a, children: n }) });
3911
- }, gl = ({ version: t }) => /* @__PURE__ */ s.jsx("div", { className: "rounded", style: {
3912
- position: "fixed",
3913
- right: "0px",
3914
- bottom: "0px",
3915
- zIndex: "10000",
3916
- backgroundColor: "rgba(255, 255, 255, 0.5)",
3917
- padding: "4px",
3918
- pointerEvents: "all"
3919
- }, children: /* @__PURE__ */ s.jsxs(z, { variant: "caption", className: "w-100 text-end", children: [
3920
- "verze ",
3921
- t
3922
- ] }) });
3868
+ let E = null;
3869
+ i ? E = (I == null ? void 0 : I.id) !== null && (I == null ? void 0 : I.id) !== "" ? parseInt(I.id.toString(), 10) : null : E = I.id === null || I.id === void 0 || I.id === "" ? null : I.id, f(n, E, {
3870
+ shouldDirty: !0,
3871
+ shouldValidate: $
3872
+ });
3873
+ }, [f, n, i, a, _, $]), B = O((I) => {
3874
+ y(!1), R(I);
3875
+ }, [R]), L = O((I) => {
3876
+ N(I);
3877
+ }, []);
3878
+ D(() => {
3879
+ W();
3880
+ }, [W]), D(() => {
3881
+ x.isSubmitted && M(!0);
3882
+ }, [x]);
3883
+ const G = O((I) => {
3884
+ var E;
3885
+ return I === null ? "" : !I.name || I.name.length === 0 ? ((E = I.id) == null ? void 0 : E.toString()) ?? "" : m ? `${I.name} (${I.id})` : I.name;
3886
+ }, [m]), se = Q(() => e.map((I) => ({
3887
+ id: I.id,
3888
+ name: G(I)
3889
+ })).filter((I) => {
3890
+ var E;
3891
+ return S ? (E = I.name) == null ? void 0 : E.toLowerCase().includes(S.toLowerCase()) : !0;
3892
+ }).sort((I, E) => h ? 0 : (I.name ?? "").localeCompare(E.name ?? "")), [e, h, S, G]), te = Y(null), U = g !== void 0;
3893
+ return /* @__PURE__ */ s.jsx(s.Fragment, { children: /* @__PURE__ */ s.jsxs(t, { label: `${r}${l ? " *" : ""}`, hidden: c, withoutLabel: d, isInvalid: U, inputContainerClassName: w({ "luminus-dropdown-select-open": k }), className: p, children: [
3894
+ /* @__PURE__ */ s.jsx(sn, { control: b, name: n, render: () => /* @__PURE__ */ s.jsx(ee.Select, { size: o, onMouseDown: (I) => {
3895
+ I.currentTarget.focus(), I.preventDefault();
3896
+ }, onClick: () => {
3897
+ y(!0);
3898
+ }, ref: te, value: _ ?? "", onChange: () => {
3899
+ }, isInvalid: U, hidden: c, disabled: u, className: "w-100", children: /* @__PURE__ */ s.jsx("option", { value: (T == null ? void 0 : T.id) ?? "", children: G(T) }) }) }),
3900
+ g && /* @__PURE__ */ s.jsx(ye, { message: g.message }),
3901
+ te.current && /* @__PURE__ */ s.jsx(_t, { show: k, onCancel: () => y(!1), items: se, currentSelection: T ?? null, onSelectionChange: B, onSearchQueryChange: L, texts: v, disabled: u, inputRef: te, autoHideSearch: !0, allItemsLength: e.length })
3902
+ ] }) });
3903
+ }, ml = ({ cell: { value: t } }) => /* @__PURE__ */ s.jsx(s.Fragment, { children: t ? /* @__PURE__ */ s.jsx(Br, { name: t, size: 21, fontSize: 12 }) : /* @__PURE__ */ s.jsx(s.Fragment, {}) }), Tc = "_tab-panel_qgi9v_1", Ec = "_full-height-no-overflow_qgi9v_5", Oc = "_disabled_qgi9v_10", ot = {
3904
+ "tab-panel": "_tab-panel_qgi9v_1",
3905
+ tabPanel: Tc,
3906
+ "full-height-no-overflow": "_full-height-no-overflow_qgi9v_5",
3907
+ fullHeightNoOverflow: Ec,
3908
+ disabled: Oc
3909
+ }, fl = ({ eventKey: t, activeTab: e, fullHeightNoOverflow: n, disabled: r, className: o, children: a }) => t !== e ? null : /* @__PURE__ */ s.jsx("div", { className: w("luminus-tab-panel", ot.tabPanel, { [ot.fullHeightNoOverflow]: n }, { disabled: r }, { [ot.disabled]: r }, o), children: a }), pl = ({ activeTab: t, onSelect: e, children: n }) => /* @__PURE__ */ s.jsx("div", { className: w("luminus-tabs d-flex gap-1 mb-2"), children: n.map((r) => {
3910
+ const o = r.type, a = r.props;
3911
+ if (!a)
3912
+ return null;
3913
+ const i = a.eventKey, l = a.children, c = a.className, u = a.onClick;
3914
+ return /* @__PURE__ */ Ur(o, { ...a, key: a.eventKey, className: w({ active: t === i }, c), onClick: () => {
3915
+ e(i), u && u(i);
3916
+ } }, l);
3917
+ }) }), Mc = "_tab_1hdhk_1", Dc = "_disabled_1hdhk_8", Kt = {
3918
+ tab: Mc,
3919
+ disabled: Dc
3920
+ }, gl = ({ eventKey: t, className: e, onClick: n, disabled: r, children: o }) => /* @__PURE__ */ s.jsx("div", { role: "button", className: w("luminus-tab text-primary rounded", Kt.tab, e, {
3921
+ disabled: r
3922
+ }, { [Kt.disabled]: r }), onClick: () => n && !r && n(t), children: typeof o == "string" ? /* @__PURE__ */ s.jsx(z, { variant: "h6", className: "text-primary", children: o }) : o });
3923
3923
  export {
3924
- pl as Alert,
3924
+ Jc as Alert,
3925
3925
  qc as ApiFileDownloadButton,
3926
- hl as AppSearch,
3927
- fl as AuthTemplate,
3928
- Mr as AvatarIcon,
3929
- ar as Backdrop,
3930
- ul as Badge,
3931
- vc as Card,
3932
- Gc as CheckInput,
3933
- dl as Collapse,
3926
+ Kc as AppSearch,
3927
+ Xc as AuthTemplate,
3928
+ Br as AvatarIcon,
3929
+ sr as Backdrop,
3930
+ Gc as Badge,
3931
+ gc as Card,
3932
+ tl as CheckInput,
3933
+ Vc as Collapse,
3934
3934
  ct as ContextButton,
3935
- si as Dropdown,
3936
- ol as DropdownDivider,
3937
- Za as DropdownItem,
3938
- zc as DropdownPicker,
3939
- ei as DropdownToggle,
3935
+ Vi as Dropdown,
3936
+ zc as DropdownDivider,
3937
+ Li as DropdownItem,
3938
+ ol as DropdownPicker,
3939
+ qi as DropdownToggle,
3940
3940
  nr as FileUploadContextButton,
3941
- rl as FileUploadDropdownItem,
3941
+ Uc as FileUploadDropdownItem,
3942
3942
  Ha as FloatingFormSubmit,
3943
3943
  Ve as FloatingLabelInput,
3944
- ll as HomeDashboard,
3945
- Kc as HookFormCheckInput,
3946
- Zc as HookFormDropdownPicker,
3947
- el as HookFormFileInput,
3948
- tl as HookFormFloatingSubmit,
3949
- Qc as HookFormRadioInput,
3950
- nl as HookFormSelectInput,
3951
- Xc as HookFormTextAreaInput,
3952
- Jc as HookFormTextInput,
3953
- Hc as HtmlTooltip,
3944
+ Hc as HomeDashboard,
3945
+ sl as HookFormCheckInput,
3946
+ ll as HookFormDropdownPicker,
3947
+ ul as HookFormFileInput,
3948
+ dl as HookFormFloatingSubmit,
3949
+ al as HookFormRadioInput,
3950
+ hl as HookFormSelectInput,
3951
+ il as HookFormTextAreaInput,
3952
+ cl as HookFormTextInput,
3953
+ el as HtmlTooltip,
3954
3954
  Z as IconButton,
3955
3955
  ye as InvalidFeedback,
3956
3956
  Xr as Loading,
3957
3957
  Zr as LoadingBlock,
3958
3958
  Yc as MonthPicker,
3959
3959
  yl as NoInputContainer,
3960
- ml as PhotoLibrary,
3961
- Dc as PhotoLightbox,
3960
+ Qc as PhotoLibrary,
3961
+ Sc as PhotoLightbox,
3962
3962
  qt as PrimaryButton,
3963
3963
  xe as RowLabelInput,
3964
- Uc as SelectInput,
3964
+ rl as SelectInput,
3965
3965
  _t as SimplePicker,
3966
- Fr as SimpleToggle,
3966
+ Pr as SimpleToggle,
3967
3967
  _l as SimpleTooltip,
3968
- cl as Tab,
3969
- al as TabPanel,
3970
- il as Tabs,
3971
- Vc as TextInput,
3968
+ gl as Tab,
3969
+ fl as TabPanel,
3970
+ pl as Tabs,
3971
+ nl as TextInput,
3972
3972
  z as Typography,
3973
3973
  bl as UserAvatarToggle,
3974
- sl as UserAvatarValueFormat,
3975
- gl as VersionInfo,
3976
- Gt as WidgetCard,
3974
+ ml as UserAvatarValueFormat,
3975
+ Zc as VersionInfo,
3976
+ Ht as WidgetCard,
3977
3977
  Bc as YearPicker
3978
3978
  };