@linagora/linid-im-front-corelib 0.0.13 → 0.0.14

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.
@@ -1,107 +1,107 @@
1
- import { defineAsyncComponent as ye, hasInjectionContext as W, inject as q, getCurrentInstance as _e, ref as k, reactive as Ne, markRaw as I, effectScope as be, isRef as j, isReactive as G, toRef as B, toRaw as De, nextTick as ne, computed as X, getCurrentScope as Oe, onScopeDispose as Pe, watch as we, toRefs as oe, defineComponent as Ce, watchEffect as Ve, createElementBlock as re, openBlock as M, Fragment as se, renderSlot as Se, createCommentVNode as Ie, renderList as $e, createBlock as je, resolveDynamicComponent as Le, mergeProps as Re, createElementVNode as ke } from "vue";
2
- let z = null;
3
- function Je(e) {
4
- if (z !== null) {
1
+ import { defineAsyncComponent as be, hasInjectionContext as q, inject as J, getCurrentInstance as Ne, ref as R, reactive as De, markRaw as I, effectScope as Oe, isRef as $, isReactive as X, toRef as M, toRaw as Pe, nextTick as oe, computed as K, getCurrentScope as Ce, onScopeDispose as we, watch as Se, toRefs as re, defineComponent as Ve, watchEffect as Ie, createElementBlock as se, openBlock as Z, Fragment as ie, renderSlot as Le, createCommentVNode as $e, renderList as je, createBlock as ze, resolveDynamicComponent as Re, mergeProps as ke, createElementVNode as Fe } from "vue";
2
+ let k = null;
3
+ function Xe(e) {
4
+ if (k !== null) {
5
5
  console.warn(
6
6
  "[LinID CoreLib] Module Federation has already been initialized. Re-initialization is ignored."
7
7
  );
8
8
  return;
9
9
  }
10
- z = e;
10
+ k = e;
11
11
  }
12
- function ze() {
13
- if (z === null)
12
+ function Ue() {
13
+ if (k === null)
14
14
  throw new Error(
15
15
  "[LinID CoreLib] Module Federation is not initialized. Call setModuleFederation() first."
16
16
  );
17
- return z;
17
+ return k;
18
18
  }
19
- const Fe = (e) => ye(
20
- () => ze().loadRemote(e).then((o) => {
19
+ const xe = (e) => be(
20
+ () => Ue().loadRemote(e).then((o) => {
21
21
  if (!o?.default)
22
22
  throw new Error(`Failed to load component from ${e}`);
23
23
  return o.default;
24
24
  })
25
25
  );
26
- const C = typeof window < "u";
27
- let b;
28
- const F = (e) => b = e;
26
+ const w = typeof window < "u";
27
+ let N;
28
+ const F = (e) => N = e;
29
29
  process.env.NODE_ENV;
30
- const J = process.env.NODE_ENV !== "production" ? Symbol("pinia") : (
30
+ const Q = process.env.NODE_ENV !== "production" ? Symbol("pinia") : (
31
31
  /* istanbul ignore next */
32
32
  Symbol()
33
33
  );
34
34
  function D(e) {
35
35
  return e && typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" && typeof e.toJSON != "function";
36
36
  }
37
- var $;
37
+ var L;
38
38
  (function(e) {
39
39
  e.direct = "direct", e.patchObject = "patch object", e.patchFunction = "patch function";
40
- })($ || ($ = {}));
41
- function fe(e, o) {
40
+ })(L || (L = {}));
41
+ function de(e, o) {
42
42
  for (const n in o) {
43
43
  const t = o[n];
44
44
  if (!(n in e))
45
45
  continue;
46
46
  const i = e[n];
47
- D(i) && D(t) && !j(t) && !G(t) ? e[n] = fe(i, t) : e[n] = t;
47
+ D(i) && D(t) && !$(t) && !X(t) ? e[n] = de(i, t) : e[n] = t;
48
48
  }
49
49
  return e;
50
50
  }
51
- const de = () => {
51
+ const pe = () => {
52
52
  };
53
- function ie(e, o, n, t = de) {
53
+ function ce(e, o, n, t = pe) {
54
54
  e.add(o);
55
55
  const i = () => {
56
56
  e.delete(o) && t();
57
57
  };
58
- return !n && Oe() && Pe(i), i;
58
+ return !n && Ce() && we(i), i;
59
59
  }
60
- function w(e, ...o) {
60
+ function C(e, ...o) {
61
61
  e.forEach((n) => {
62
62
  n(...o);
63
63
  });
64
64
  }
65
- const Ue = (e) => e(), ce = Symbol(), Z = Symbol();
66
- function Q(e, o) {
65
+ const Ae = (e) => e(), ae = Symbol(), W = Symbol();
66
+ function Y(e, o) {
67
67
  e instanceof Map && o instanceof Map ? o.forEach((n, t) => e.set(t, n)) : e instanceof Set && o instanceof Set && o.forEach(e.add, e);
68
68
  for (const n in o) {
69
69
  if (!o.hasOwnProperty(n))
70
70
  continue;
71
71
  const t = o[n], i = e[n];
72
- D(i) && D(t) && e.hasOwnProperty(n) && !j(t) && !G(t) ? e[n] = Q(i, t) : e[n] = t;
72
+ D(i) && D(t) && e.hasOwnProperty(n) && !$(t) && !X(t) ? e[n] = Y(i, t) : e[n] = t;
73
73
  }
74
74
  return e;
75
75
  }
76
- const xe = process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
76
+ const He = process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
77
77
  /* istanbul ignore next */
78
78
  Symbol()
79
79
  );
80
- function Ae(e) {
81
- return !D(e) || !Object.prototype.hasOwnProperty.call(e, xe);
80
+ function Te(e) {
81
+ return !D(e) || !Object.prototype.hasOwnProperty.call(e, He);
82
82
  }
83
83
  const { assign: v } = Object;
84
- function ae(e) {
85
- return !!(j(e) && e.effect);
84
+ function ue(e) {
85
+ return !!($(e) && e.effect);
86
86
  }
87
- function ue(e, o, n, t) {
87
+ function le(e, o, n, t) {
88
88
  const { state: i, actions: f, getters: a } = o, d = n.state.value[e];
89
89
  let _;
90
90
  function p() {
91
91
  !d && (process.env.NODE_ENV === "production" || !t) && (n.state.value[e] = i ? i() : {});
92
92
  const l = process.env.NODE_ENV !== "production" && t ? (
93
93
  // use ref() to unwrap refs inside state TODO: check if this is still necessary
94
- oe(k(i ? i() : {}).value)
95
- ) : oe(n.state.value[e]);
96
- return v(l, f, Object.keys(a || {}).reduce((h, m) => (process.env.NODE_ENV !== "production" && m in l && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${m}" in store "${e}".`), h[m] = I(X(() => {
94
+ re(R(i ? i() : {}).value)
95
+ ) : re(n.state.value[e]);
96
+ return v(l, f, Object.keys(a || {}).reduce((h, m) => (process.env.NODE_ENV !== "production" && m in l && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${m}" in store "${e}".`), h[m] = I(K(() => {
97
97
  F(n);
98
98
  const y = n._s.get(e);
99
99
  return a[m].call(y, y);
100
100
  })), h), {}));
101
101
  }
102
- return _ = Y(e, p, o, n, t, !0), _;
102
+ return _ = G(e, p, o, n, t, !0), _;
103
103
  }
104
- function Y(e, o, n = {}, t, i, f) {
104
+ function G(e, o, n = {}, t, i, f) {
105
105
  let a;
106
106
  const d = v({ actions: {} }, n);
107
107
  if (process.env.NODE_ENV !== "production" && !t._e.active)
@@ -113,26 +113,26 @@ function Y(e, o, n = {}, t, i, f) {
113
113
  let p, l, h = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set(), y;
114
114
  const P = t.state.value[e];
115
115
  !f && !P && (process.env.NODE_ENV === "production" || !i) && (t.state.value[e] = {});
116
- const A = k({});
117
- let K;
118
- function ee(s) {
116
+ const H = R({});
117
+ let ee;
118
+ function te(s) {
119
119
  let r;
120
120
  p = l = !1, process.env.NODE_ENV !== "production" && (y = []), typeof s == "function" ? (s(t.state.value[e]), r = {
121
- type: $.patchFunction,
121
+ type: L.patchFunction,
122
122
  storeId: e,
123
123
  events: y
124
- }) : (Q(t.state.value[e], s), r = {
125
- type: $.patchObject,
124
+ }) : (Y(t.state.value[e], s), r = {
125
+ type: L.patchObject,
126
126
  payload: s,
127
127
  storeId: e,
128
128
  events: y
129
129
  });
130
- const u = K = Symbol();
131
- ne().then(() => {
132
- K === u && (p = !0);
133
- }), l = !0, w(h, r, t.state.value[e]);
130
+ const u = ee = Symbol();
131
+ oe().then(() => {
132
+ ee === u && (p = !0);
133
+ }), l = !0, C(h, r, t.state.value[e]);
134
134
  }
135
- const Ee = f ? function() {
135
+ const ve = f ? function() {
136
136
  const { state: r } = n, u = r ? r() : {};
137
137
  this.$patch((E) => {
138
138
  v(E, u);
@@ -141,93 +141,93 @@ function Y(e, o, n = {}, t, i, f) {
141
141
  /* istanbul ignore next */
142
142
  process.env.NODE_ENV !== "production" ? () => {
143
143
  throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`);
144
- } : de
144
+ } : pe
145
145
  );
146
- function ge() {
146
+ function me() {
147
147
  a.stop(), h.clear(), m.clear(), t._s.delete(e);
148
148
  }
149
- const H = (s, r = "") => {
150
- if (ce in s)
151
- return s[Z] = r, s;
149
+ const T = (s, r = "") => {
150
+ if (ae in s)
151
+ return s[W] = r, s;
152
152
  const u = function() {
153
153
  F(t);
154
- const E = Array.from(arguments), V = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Set();
155
- function ve(g) {
156
- V.add(g);
154
+ const E = Array.from(arguments), S = /* @__PURE__ */ new Set(), B = /* @__PURE__ */ new Set();
155
+ function ye(g) {
156
+ S.add(g);
157
157
  }
158
- function me(g) {
159
- T.add(g);
158
+ function _e(g) {
159
+ B.add(g);
160
160
  }
161
- w(m, {
161
+ C(m, {
162
162
  args: E,
163
- name: u[Z],
163
+ name: u[W],
164
164
  store: c,
165
- after: ve,
166
- onError: me
165
+ after: ye,
166
+ onError: _e
167
167
  });
168
- let S;
168
+ let V;
169
169
  try {
170
- S = s.apply(this && this.$id === e ? this : c, E);
170
+ V = s.apply(this && this.$id === e ? this : c, E);
171
171
  } catch (g) {
172
- throw w(T, g), g;
172
+ throw C(B, g), g;
173
173
  }
174
- return S instanceof Promise ? S.then((g) => (w(V, g), g)).catch((g) => (w(T, g), Promise.reject(g))) : (w(V, S), S);
174
+ return V instanceof Promise ? V.then((g) => (C(S, g), g)).catch((g) => (C(B, g), Promise.reject(g))) : (C(S, V), V);
175
175
  };
176
- return u[ce] = !0, u[Z] = r, u;
177
- }, R = /* @__PURE__ */ I({
176
+ return u[ae] = !0, u[W] = r, u;
177
+ }, z = /* @__PURE__ */ I({
178
178
  actions: {},
179
179
  getters: {},
180
180
  state: [],
181
- hotState: A
182
- }), te = {
181
+ hotState: H
182
+ }), ne = {
183
183
  _p: t,
184
184
  // _s: scope,
185
185
  $id: e,
186
- $onAction: ie.bind(null, m),
187
- $patch: ee,
188
- $reset: Ee,
186
+ $onAction: ce.bind(null, m),
187
+ $patch: te,
188
+ $reset: ve,
189
189
  $subscribe(s, r = {}) {
190
- const u = ie(h, s, r.detached, () => E()), E = a.run(() => we(() => t.state.value[e], (V) => {
190
+ const u = ce(h, s, r.detached, () => E()), E = a.run(() => Se(() => t.state.value[e], (S) => {
191
191
  (r.flush === "sync" ? l : p) && s({
192
192
  storeId: e,
193
- type: $.direct,
193
+ type: L.direct,
194
194
  events: y
195
- }, V);
195
+ }, S);
196
196
  }, v({}, _, r)));
197
197
  return u;
198
198
  },
199
- $dispose: ge
200
- }, c = Ne(process.env.NODE_ENV !== "production" || process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && C ? v(
199
+ $dispose: me
200
+ }, c = De(process.env.NODE_ENV !== "production" || process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && w ? v(
201
201
  {
202
- _hmrPayload: R,
202
+ _hmrPayload: z,
203
203
  _customProperties: I(/* @__PURE__ */ new Set())
204
204
  // devtools custom properties
205
205
  },
206
- te
206
+ ne
207
207
  // must be added later
208
208
  // setupStore
209
- ) : te);
209
+ ) : ne);
210
210
  t._s.set(e, c);
211
- const N = (t._a && t._a.runWithContext || Ue)(() => t._e.run(() => (a = be()).run(() => o({ action: H }))));
212
- for (const s in N) {
213
- const r = N[s];
214
- if (j(r) && !ae(r) || G(r))
215
- process.env.NODE_ENV !== "production" && i ? A.value[s] = B(N, s) : f || (P && Ae(r) && (j(r) ? r.value = P[s] : Q(r, P[s])), t.state.value[e][s] = r), process.env.NODE_ENV !== "production" && R.state.push(s);
211
+ const b = (t._a && t._a.runWithContext || Ae)(() => t._e.run(() => (a = Oe()).run(() => o({ action: T }))));
212
+ for (const s in b) {
213
+ const r = b[s];
214
+ if ($(r) && !ue(r) || X(r))
215
+ process.env.NODE_ENV !== "production" && i ? H.value[s] = M(b, s) : f || (P && Te(r) && ($(r) ? r.value = P[s] : Y(r, P[s])), t.state.value[e][s] = r), process.env.NODE_ENV !== "production" && z.state.push(s);
216
216
  else if (typeof r == "function") {
217
- const u = process.env.NODE_ENV !== "production" && i ? r : H(r, s);
218
- N[s] = u, process.env.NODE_ENV !== "production" && (R.actions[s] = r), d.actions[s] = r;
219
- } else process.env.NODE_ENV !== "production" && ae(r) && (R.getters[s] = f ? (
217
+ const u = process.env.NODE_ENV !== "production" && i ? r : T(r, s);
218
+ b[s] = u, process.env.NODE_ENV !== "production" && (z.actions[s] = r), d.actions[s] = r;
219
+ } else process.env.NODE_ENV !== "production" && ue(r) && (z.getters[s] = f ? (
220
220
  // @ts-expect-error
221
221
  n.getters[s]
222
- ) : r, C && (N._getters || // @ts-expect-error: same
223
- (N._getters = I([]))).push(s));
222
+ ) : r, w && (b._getters || // @ts-expect-error: same
223
+ (b._getters = I([]))).push(s));
224
224
  }
225
- if (v(c, N), v(De(c), N), Object.defineProperty(c, "$state", {
226
- get: () => process.env.NODE_ENV !== "production" && i ? A.value : t.state.value[e],
225
+ if (v(c, b), v(Pe(c), b), Object.defineProperty(c, "$state", {
226
+ get: () => process.env.NODE_ENV !== "production" && i ? H.value : t.state.value[e],
227
227
  set: (s) => {
228
228
  if (process.env.NODE_ENV !== "production" && i)
229
229
  throw new Error("cannot set hotState");
230
- ee((r) => {
230
+ te((r) => {
231
231
  v(r, s);
232
232
  });
233
233
  }
@@ -235,23 +235,23 @@ function Y(e, o, n = {}, t, i, f) {
235
235
  c._hotUpdating = !0, s._hmrPayload.state.forEach((r) => {
236
236
  if (r in c.$state) {
237
237
  const u = s.$state[r], E = c.$state[r];
238
- typeof u == "object" && D(u) && D(E) ? fe(u, E) : s.$state[r] = E;
238
+ typeof u == "object" && D(u) && D(E) ? de(u, E) : s.$state[r] = E;
239
239
  }
240
- c[r] = B(s.$state, r);
240
+ c[r] = M(s.$state, r);
241
241
  }), Object.keys(c.$state).forEach((r) => {
242
242
  r in s.$state || delete c[r];
243
- }), p = !1, l = !1, t.state.value[e] = B(s._hmrPayload, "hotState"), l = !0, ne().then(() => {
243
+ }), p = !1, l = !1, t.state.value[e] = M(s._hmrPayload, "hotState"), l = !0, oe().then(() => {
244
244
  p = !0;
245
245
  });
246
246
  for (const r in s._hmrPayload.actions) {
247
247
  const u = s[r];
248
248
  c[r] = //
249
- H(u, r);
249
+ T(u, r);
250
250
  }
251
251
  for (const r in s._hmrPayload.getters) {
252
252
  const u = s._hmrPayload.getters[r], E = f ? (
253
253
  // special handling of options api
254
- X(() => (F(t), u.call(c, c)))
254
+ K(() => (F(t), u.call(c, c)))
255
255
  ) : u;
256
256
  c[r] = //
257
257
  E;
@@ -261,7 +261,7 @@ function Y(e, o, n = {}, t, i, f) {
261
261
  }), Object.keys(c._hmrPayload.actions).forEach((r) => {
262
262
  r in s._hmrPayload.actions || delete c[r];
263
263
  }), c._hmrPayload = s._hmrPayload, c._getters = s._getters, c._hotUpdating = !1;
264
- })), process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && C) {
264
+ })), process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && w) {
265
265
  const s = {
266
266
  writable: !0,
267
267
  configurable: !0,
@@ -273,7 +273,7 @@ function Y(e, o, n = {}, t, i, f) {
273
273
  });
274
274
  }
275
275
  return t._p.forEach((s) => {
276
- if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && C) {
276
+ if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && w) {
277
277
  const r = a.run(() => s({
278
278
  store: c,
279
279
  app: t._a,
@@ -293,26 +293,26 @@ function Y(e, o, n = {}, t, i, f) {
293
293
  Found in store "${c.$id}".`), P && f && n.hydrate && n.hydrate(c.$state, P), p = !0, l = !0, c;
294
294
  }
295
295
  // @__NO_SIDE_EFFECTS__
296
- function pe(e, o, n) {
296
+ function he(e, o, n) {
297
297
  let t;
298
298
  const i = typeof o == "function";
299
299
  t = i ? n : o;
300
300
  function f(a, d) {
301
- const _ = W();
301
+ const _ = q();
302
302
  if (a = // in test mode, ignore the argument provided as we can always retrieve a
303
303
  // pinia instance with getActivePinia()
304
- (process.env.NODE_ENV === "test" && b && b._testing ? null : a) || (_ ? q(J, null) : null), a && F(a), process.env.NODE_ENV !== "production" && !b)
304
+ (process.env.NODE_ENV === "test" && N && N._testing ? null : a) || (_ ? J(Q, null) : null), a && F(a), process.env.NODE_ENV !== "production" && !N)
305
305
  throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
306
306
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
307
307
  This will fail in production.`);
308
- a = b, a._s.has(e) || (i ? Y(e, o, t, a) : ue(e, t, a), process.env.NODE_ENV !== "production" && (f._pinia = a));
308
+ a = N, a._s.has(e) || (i ? G(e, o, t, a) : le(e, t, a), process.env.NODE_ENV !== "production" && (f._pinia = a));
309
309
  const p = a._s.get(e);
310
310
  if (process.env.NODE_ENV !== "production" && d) {
311
- const l = "__hot:" + e, h = i ? Y(l, o, t, a, !0) : ue(l, v({}, t), a, !0);
311
+ const l = "__hot:" + e, h = i ? G(l, o, t, a, !0) : le(l, v({}, t), a, !0);
312
312
  d._hotUpdate(h), delete a.state.value[l], a._s.delete(l);
313
313
  }
314
- if (process.env.NODE_ENV !== "production" && C) {
315
- const l = _e();
314
+ if (process.env.NODE_ENV !== "production" && w) {
315
+ const l = Ne();
316
316
  if (l && l.proxy && // avoid adding stores that are just built for hot module replacement
317
317
  !d) {
318
318
  const h = l.proxy, m = "_pStores" in h ? h._pStores : h._pStores = {};
@@ -323,7 +323,24 @@ This will fail in production.`);
323
323
  }
324
324
  return f.$id = e, f;
325
325
  }
326
- const He = /* @__PURE__ */ pe("linidZoneStore", {
326
+ let U = null;
327
+ function Ke(e) {
328
+ if (U !== null) {
329
+ console.warn(
330
+ "[LinID CoreLib] Pinia store has already been initialized. Re-initialization is ignored."
331
+ );
332
+ return;
333
+ }
334
+ U = e;
335
+ }
336
+ function Ee() {
337
+ if (U === null)
338
+ throw new Error(
339
+ "[LinID CoreLib] Pinia store is not initialized. Call setPiniaStore() first."
340
+ );
341
+ return U;
342
+ }
343
+ const Be = () => Me(Ee()), Me = /* @__PURE__ */ he("linidZoneStore", {
327
344
  state: () => ({
328
345
  zones: {}
329
346
  }),
@@ -337,33 +354,33 @@ const He = /* @__PURE__ */ pe("linidZoneStore", {
337
354
  this.zones[e] || (this.zones[e] = []), this.zones[e].push(o);
338
355
  }
339
356
  }
340
- }), Qe = /* @__PURE__ */ Ce({
357
+ }), et = /* @__PURE__ */ Ve({
341
358
  __name: "LinidZoneRenderer",
342
359
  props: {
343
360
  zone: {}
344
361
  },
345
362
  setup(e) {
346
- const o = e, n = He(), t = k([]), i = k(!1);
347
- return Ve(() => {
363
+ const o = e, n = Be(), t = R([]), i = R(!1);
364
+ return Ie(() => {
348
365
  i.value = !1;
349
366
  const f = n.zones[o.zone] || [];
350
367
  t.value = f.map((a) => ({
351
368
  ...a,
352
- component: Fe(a.plugin)
369
+ component: xe(a.plugin)
353
370
  })), Promise.resolve().then(() => {
354
371
  i.value = !0;
355
372
  });
356
- }), (f, a) => (M(), re(se, null, [
357
- (M(!0), re(se, null, $e(t.value, (d, _) => (M(), je(Le(d.component), Re({
373
+ }), (f, a) => (Z(), se(ie, null, [
374
+ (Z(!0), se(ie, null, je(t.value, (d, _) => (Z(), ze(Re(d.component), ke({
358
375
  key: d.plugin + _
359
376
  }, { ref_for: !0 }, d.props), null, 16))), 128)),
360
- i.value && t.value.length === 0 ? Se(f.$slots, "default", { key: 0 }, () => [
361
- a[0] || (a[0] = ke("div", null, "No components to render in this zone.", -1))
362
- ]) : Ie("", !0)
377
+ i.value && t.value.length === 0 ? Le(f.$slots, "default", { key: 0 }, () => [
378
+ a[0] || (a[0] = Fe("div", null, "No components to render in this zone.", -1))
379
+ ]) : $e("", !0)
363
380
  ], 64));
364
381
  }
365
382
  });
366
- function Ye() {
383
+ function tt() {
367
384
  function e(n) {
368
385
  return {
369
386
  page: (n.page || 1) - 1,
@@ -384,34 +401,34 @@ function Ye() {
384
401
  toQuasarPagination: o
385
402
  };
386
403
  }
387
- let U = null;
388
- function Ge(e) {
389
- if (U !== null) {
404
+ let x = null;
405
+ function nt(e) {
406
+ if (x !== null) {
390
407
  console.warn(
391
408
  "[LinID CoreLib] UI Design has already been initialized. Re-initialization is ignored."
392
409
  );
393
410
  return;
394
411
  }
395
- U = e;
412
+ x = e;
396
413
  }
397
- function Te() {
398
- if (U === null)
414
+ function Ze() {
415
+ if (x === null)
399
416
  throw new Error(
400
417
  "[LinID CoreLib] UI Design is not initialized. Call setUiDesign() first."
401
418
  );
402
- return U;
419
+ return x;
403
420
  }
404
- function le(e, o) {
421
+ function fe(e, o) {
405
422
  return o.split(".").reduce((n, t) => {
406
423
  if (n && typeof n == "object")
407
424
  return n[t];
408
425
  }, e);
409
426
  }
410
- function Xe() {
411
- const e = X(() => Te());
427
+ function ot() {
428
+ const e = K(() => Ze());
412
429
  function o(n, t) {
413
- let i = le(e.value, `${n}.${t}`);
414
- if (i === void 0 && (i = le(e.value, `default.${t}`)), i === void 0)
430
+ let i = fe(e.value, `${n}.${t}`);
431
+ if (i === void 0 && (i = fe(e.value, `default.${t}`)), i === void 0)
415
432
  throw new Error(
416
433
  `[UiDesign] Value not found for '${n}.${t}' and no default fallback.`
417
434
  );
@@ -423,112 +440,109 @@ function Xe() {
423
440
  }
424
441
  return { ui: o };
425
442
  }
426
- let x = null;
427
- function Ke(e) {
428
- if (x !== null) {
443
+ let A = null;
444
+ function rt(e) {
445
+ if (A !== null) {
429
446
  console.warn(
430
447
  "[LinID CoreLib] HTTP client has already been initialized. Re-initialization is ignored."
431
448
  );
432
449
  return;
433
450
  }
434
- x = e;
451
+ A = e;
435
452
  }
436
453
  function O() {
437
- if (x === null)
454
+ if (A === null)
438
455
  throw new Error(
439
456
  "[LinID CoreLib] HTTP client is not initialized. Call setHttpClient() first."
440
457
  );
441
- return x;
458
+ return A;
442
459
  }
443
- async function Be() {
460
+ async function We() {
444
461
  return (await O().get("/metadata/entities")).data;
445
462
  }
446
- async function Me() {
463
+ async function qe() {
447
464
  return (await O().get(
448
465
  "/metadata/routes"
449
466
  )).data;
450
467
  }
451
- const et = /* @__PURE__ */ pe(
452
- "LinidConfigurationStore",
453
- {
454
- state: () => ({
455
- entities: [],
456
- apiEndpoints: [],
457
- loading: !1,
458
- error: null
459
- }),
460
- getters: {
461
- /**
462
- * Returns an entity configuration by name.
463
- * @param state - The store state.
464
- * @returns A function that takes an entity name and returns the configuration.
465
- */
466
- getEntityByName: (e) => (o) => e.entities.find((n) => n.name === o),
467
- /**
468
- * Returns all api endpoints for a specific entity.
469
- * @param state - The store state.
470
- * @returns A function that takes an entity name and returns its api endpoints.
471
- */
472
- getApiEndpointsByEntity: (e) => (o) => e.apiEndpoints.filter(
473
- (n) => n.entity === o
474
- )
475
- },
476
- actions: {
477
- /**
478
- * Fetches all entity and api endpoint configurations from the backend.
479
- */
480
- async fetchConfiguration() {
481
- this.loading = !0, this.error = null;
482
- try {
483
- const [e, o] = await Promise.all([
484
- Be(),
485
- Me()
486
- ]);
487
- this.entities = e, this.apiEndpoints = o;
488
- } catch (e) {
489
- this.error = e instanceof Error ? e.message : "Failed to fetch configuration", console.error("[Linid CoreLib] Failed to fetch configuration:", e);
490
- } finally {
491
- this.loading = !1;
492
- }
468
+ const st = () => Je(Ee()), Je = /* @__PURE__ */ he("LinidConfigurationStore", {
469
+ state: () => ({
470
+ entities: [],
471
+ apiEndpoints: [],
472
+ loading: !1,
473
+ error: null
474
+ }),
475
+ getters: {
476
+ /**
477
+ * Returns an entity configuration by name.
478
+ * @param state - The store state.
479
+ * @returns A function that takes an entity name and returns the configuration.
480
+ */
481
+ getEntityByName: (e) => (o) => e.entities.find((n) => n.name === o),
482
+ /**
483
+ * Returns all api endpoints for a specific entity.
484
+ * @param state - The store state.
485
+ * @returns A function that takes an entity name and returns its api endpoints.
486
+ */
487
+ getApiEndpointsByEntity: (e) => (o) => e.apiEndpoints.filter(
488
+ (n) => n.entity === o
489
+ )
490
+ },
491
+ actions: {
492
+ /**
493
+ * Fetches all entity and api endpoint configurations from the backend.
494
+ */
495
+ async fetchConfiguration() {
496
+ this.loading = !0, this.error = null;
497
+ try {
498
+ const [e, o] = await Promise.all([
499
+ We(),
500
+ qe()
501
+ ]);
502
+ this.entities = e, this.apiEndpoints = o;
503
+ } catch (e) {
504
+ this.error = e instanceof Error ? e.message : "Failed to fetch configuration", console.error("[Linid CoreLib] Failed to fetch configuration:", e);
505
+ } finally {
506
+ this.loading = !1;
493
507
  }
494
508
  }
495
509
  }
496
- ), he = /* @__PURE__ */ new Map();
497
- function tt(e) {
498
- he.set(e.instanceId, e);
510
+ }), ge = /* @__PURE__ */ new Map();
511
+ function it(e) {
512
+ ge.set(e.instanceId, e);
499
513
  }
500
- function L(e) {
501
- const o = he.get(e);
514
+ function j(e) {
515
+ const o = ge.get(e);
502
516
  if (!o)
503
517
  throw new Error(
504
518
  `[LinID CoreLib] No module host configuration found for instanceId: ${e}`
505
519
  );
506
520
  return o;
507
521
  }
508
- async function nt(e, o) {
509
- const n = L(e);
522
+ async function ct(e, o) {
523
+ const n = j(e);
510
524
  return O().post(`/${n.apiEndpoint}`, o).then(({ data: t }) => t);
511
525
  }
512
- async function ot(e, o, n) {
513
- const t = L(e);
526
+ async function at(e, o, n) {
527
+ const t = j(e);
514
528
  return O().put(`/${t.apiEndpoint}/${o}`, n).then(({ data: i }) => i);
515
529
  }
516
- async function rt(e, o, n) {
517
- const t = L(e);
530
+ async function ut(e, o, n) {
531
+ const t = j(e);
518
532
  return O().get(`/${t.apiEndpoint}`, {
519
533
  params: { ...o, ...n }
520
534
  }).then(({ data: i }) => i);
521
535
  }
522
- async function st(e, o) {
523
- const n = L(e);
536
+ async function lt(e, o) {
537
+ const n = j(e);
524
538
  return O().get(`/${n.apiEndpoint}/${o}`).then(({ data: t }) => t);
525
539
  }
526
- async function it(e, o) {
527
- const n = L(e);
540
+ async function ft(e, o) {
541
+ const n = j(e);
528
542
  return O().delete(`/${n.apiEndpoint}/${o}`);
529
543
  }
530
- var Ze = /* @__PURE__ */ ((e) => (e.SETUP = "setup", e.CONFIGURE = "configure", e.INITIALIZE = "initialize", e.READY = "ready", e.POST_INIT = "postInit", e))(Ze || {});
531
- class ct {
544
+ var Qe = /* @__PURE__ */ ((e) => (e.SETUP = "setup", e.CONFIGURE = "configure", e.INITIALIZE = "initialize", e.READY = "ready", e.POST_INIT = "postInit", e))(Qe || {});
545
+ class dt {
532
546
  /**
533
547
  * Unique identifier for the module.
534
548
  *
@@ -625,25 +639,27 @@ class ct {
625
639
  }
626
640
  }
627
641
  export {
628
- ct as BasicRemoteModule,
629
- Qe as LinidZoneRenderer,
630
- Ze as ModuleLifecyclePhase,
631
- it as deleteEntityById,
632
- rt as getEntities,
633
- st as getEntityById,
642
+ dt as BasicRemoteModule,
643
+ et as LinidZoneRenderer,
644
+ Qe as ModuleLifecyclePhase,
645
+ ft as deleteEntityById,
646
+ ut as getEntities,
647
+ lt as getEntityById,
634
648
  O as getHttpClient,
635
- ze as getModuleFederation,
636
- L as getModuleHostConfiguration,
637
- Te as getUiDesign,
638
- Fe as loadAsyncComponent,
639
- tt as registerModuleHostConfiguration,
640
- nt as saveEntity,
641
- Ke as setHttpClient,
642
- Je as setModuleFederation,
643
- Ge as setUiDesign,
644
- ot as updateEntity,
645
- et as useLinidConfigurationStore,
646
- He as useLinidZoneStore,
647
- Ye as usePagination,
648
- Xe as useUiDesign
649
+ Ue as getModuleFederation,
650
+ j as getModuleHostConfiguration,
651
+ Ee as getPiniaStore,
652
+ Ze as getUiDesign,
653
+ xe as loadAsyncComponent,
654
+ it as registerModuleHostConfiguration,
655
+ ct as saveEntity,
656
+ rt as setHttpClient,
657
+ Xe as setModuleFederation,
658
+ Ke as setPiniaStore,
659
+ nt as setUiDesign,
660
+ at as updateEntity,
661
+ st as useLinidConfigurationStore,
662
+ Be as useLinidZoneStore,
663
+ tt as usePagination,
664
+ ot as useUiDesign
649
665
  };