@keenmate/web-multiselect 1.8.6 → 1.10.0

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,272 +1,272 @@
1
- var lt = Object.defineProperty;
2
- var ct = (o, e, t) => e in o ? lt(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var m = (o, e, t) => ct(o, typeof e != "symbol" ? e + "" : e, t);
4
- const ce = Math.min, N = Math.max, de = Math.round, ne = Math.floor, $ = (o) => ({
5
- x: o,
6
- y: o
7
- }), dt = {
1
+ var dt = Object.defineProperty;
2
+ var ht = (s, e, t) => e in s ? dt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var d = (s, e, t) => ht(s, typeof e != "symbol" ? e + "" : e, t);
4
+ const ie = Math.min, F = Math.max, re = Math.round, se = Math.floor, P = (s) => ({
5
+ x: s,
6
+ y: s
7
+ }), mt = {
8
8
  left: "right",
9
9
  right: "left",
10
10
  bottom: "top",
11
11
  top: "bottom"
12
- }, ht = {
12
+ }, pt = {
13
13
  start: "end",
14
14
  end: "start"
15
15
  };
16
- function $e(o, e, t) {
17
- return N(o, ce(e, t));
16
+ function ze(s, e, t) {
17
+ return F(s, ie(e, t));
18
18
  }
19
- function pe(o, e) {
20
- return typeof o == "function" ? o(e) : o;
19
+ function le(s, e) {
20
+ return typeof s == "function" ? s(e) : s;
21
21
  }
22
- function F(o) {
23
- return o.split("-")[0];
22
+ function N(s) {
23
+ return s.split("-")[0];
24
24
  }
25
- function ue(o) {
26
- return o.split("-")[1];
25
+ function ce(s) {
26
+ return s.split("-")[1];
27
27
  }
28
- function Fe(o) {
29
- return o === "x" ? "y" : "x";
28
+ function Ue(s) {
29
+ return s === "x" ? "y" : "x";
30
30
  }
31
- function We(o) {
32
- return o === "y" ? "height" : "width";
31
+ function Ke(s) {
32
+ return s === "y" ? "height" : "width";
33
33
  }
34
- const mt = /* @__PURE__ */ new Set(["top", "bottom"]);
35
- function P(o) {
36
- return mt.has(F(o)) ? "y" : "x";
34
+ const ut = /* @__PURE__ */ new Set(["top", "bottom"]);
35
+ function B(s) {
36
+ return ut.has(N(s)) ? "y" : "x";
37
37
  }
38
- function Ge(o) {
39
- return Fe(P(o));
38
+ function qe(s) {
39
+ return Ue(B(s));
40
40
  }
41
- function pt(o, e, t) {
41
+ function gt(s, e, t) {
42
42
  t === void 0 && (t = !1);
43
- const s = ue(o), i = Ge(o), r = We(i);
44
- let n = i === "x" ? s === (t ? "end" : "start") ? "right" : "left" : s === "start" ? "bottom" : "top";
45
- return e.reference[r] > e.floating[r] && (n = he(n)), [n, he(n)];
43
+ const o = ce(s), i = qe(s), r = Ke(i);
44
+ let n = i === "x" ? o === (t ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
45
+ return e.reference[r] > e.floating[r] && (n = ne(n)), [n, ne(n)];
46
46
  }
47
- function ut(o) {
48
- const e = he(o);
49
- return [ye(o), e, ye(e)];
47
+ function bt(s) {
48
+ const e = ne(s);
49
+ return [fe(s), e, fe(e)];
50
50
  }
51
- function ye(o) {
52
- return o.replace(/start|end/g, (e) => ht[e]);
51
+ function fe(s) {
52
+ return s.replace(/start|end/g, (e) => pt[e]);
53
53
  }
54
- const Me = ["left", "right"], ze = ["right", "left"], gt = ["top", "bottom"], bt = ["bottom", "top"];
55
- function vt(o, e, t) {
56
- switch (o) {
54
+ const Ve = ["left", "right"], Be = ["right", "left"], ft = ["top", "bottom"], vt = ["bottom", "top"];
55
+ function wt(s, e, t) {
56
+ switch (s) {
57
57
  case "top":
58
58
  case "bottom":
59
- return t ? e ? ze : Me : e ? Me : ze;
59
+ return t ? e ? Be : Ve : e ? Ve : Be;
60
60
  case "left":
61
61
  case "right":
62
- return e ? gt : bt;
62
+ return e ? ft : vt;
63
63
  default:
64
64
  return [];
65
65
  }
66
66
  }
67
- function ft(o, e, t, s) {
68
- const i = ue(o);
69
- let r = vt(F(o), t === "start", s);
70
- return i && (r = r.map((n) => n + "-" + i), e && (r = r.concat(r.map(ye)))), r;
67
+ function _t(s, e, t, o) {
68
+ const i = ce(s);
69
+ let r = wt(N(s), t === "start", o);
70
+ return i && (r = r.map((n) => n + "-" + i), e && (r = r.concat(r.map(fe)))), r;
71
71
  }
72
- function he(o) {
73
- return o.replace(/left|right|bottom|top/g, (e) => dt[e]);
72
+ function ne(s) {
73
+ return s.replace(/left|right|bottom|top/g, (e) => mt[e]);
74
74
  }
75
- function wt(o) {
75
+ function kt(s) {
76
76
  return {
77
77
  top: 0,
78
78
  right: 0,
79
79
  bottom: 0,
80
80
  left: 0,
81
- ...o
81
+ ...s
82
82
  };
83
83
  }
84
- function _t(o) {
85
- return typeof o != "number" ? wt(o) : {
86
- top: o,
87
- right: o,
88
- bottom: o,
89
- left: o
84
+ function yt(s) {
85
+ return typeof s != "number" ? kt(s) : {
86
+ top: s,
87
+ right: s,
88
+ bottom: s,
89
+ left: s
90
90
  };
91
91
  }
92
- function me(o) {
92
+ function ae(s) {
93
93
  const {
94
94
  x: e,
95
95
  y: t,
96
- width: s,
96
+ width: o,
97
97
  height: i
98
- } = o;
98
+ } = s;
99
99
  return {
100
- width: s,
100
+ width: o,
101
101
  height: i,
102
102
  top: t,
103
103
  left: e,
104
- right: e + s,
104
+ right: e + o,
105
105
  bottom: t + i,
106
106
  x: e,
107
107
  y: t
108
108
  };
109
109
  }
110
- function Ve(o, e, t) {
110
+ function De(s, e, t) {
111
111
  let {
112
- reference: s,
112
+ reference: o,
113
113
  floating: i
114
- } = o;
115
- const r = P(e), n = Ge(e), a = We(n), l = F(e), c = r === "y", d = s.x + s.width / 2 - i.width / 2, p = s.y + s.height / 2 - i.height / 2, u = s[a] / 2 - i[a] / 2;
116
- let h;
114
+ } = s;
115
+ const r = B(e), n = qe(e), a = Ke(n), l = N(e), c = r === "y", h = o.x + o.width / 2 - i.width / 2, p = o.y + o.height / 2 - i.height / 2, u = o[a] / 2 - i[a] / 2;
116
+ let m;
117
117
  switch (l) {
118
118
  case "top":
119
- h = {
120
- x: d,
121
- y: s.y - i.height
119
+ m = {
120
+ x: h,
121
+ y: o.y - i.height
122
122
  };
123
123
  break;
124
124
  case "bottom":
125
- h = {
126
- x: d,
127
- y: s.y + s.height
125
+ m = {
126
+ x: h,
127
+ y: o.y + o.height
128
128
  };
129
129
  break;
130
130
  case "right":
131
- h = {
132
- x: s.x + s.width,
131
+ m = {
132
+ x: o.x + o.width,
133
133
  y: p
134
134
  };
135
135
  break;
136
136
  case "left":
137
- h = {
138
- x: s.x - i.width,
137
+ m = {
138
+ x: o.x - i.width,
139
139
  y: p
140
140
  };
141
141
  break;
142
142
  default:
143
- h = {
144
- x: s.x,
145
- y: s.y
143
+ m = {
144
+ x: o.x,
145
+ y: o.y
146
146
  };
147
147
  }
148
- switch (ue(e)) {
148
+ switch (ce(e)) {
149
149
  case "start":
150
- h[n] -= u * (t && c ? -1 : 1);
150
+ m[n] -= u * (t && c ? -1 : 1);
151
151
  break;
152
152
  case "end":
153
- h[n] += u * (t && c ? -1 : 1);
153
+ m[n] += u * (t && c ? -1 : 1);
154
154
  break;
155
155
  }
156
- return h;
156
+ return m;
157
157
  }
158
- const xt = async (o, e, t) => {
158
+ const xt = async (s, e, t) => {
159
159
  const {
160
- placement: s = "bottom",
160
+ placement: o = "bottom",
161
161
  strategy: i = "absolute",
162
162
  middleware: r = [],
163
163
  platform: n
164
164
  } = t, a = r.filter(Boolean), l = await (n.isRTL == null ? void 0 : n.isRTL(e));
165
165
  let c = await n.getElementRects({
166
- reference: o,
166
+ reference: s,
167
167
  floating: e,
168
168
  strategy: i
169
169
  }), {
170
- x: d,
170
+ x: h,
171
171
  y: p
172
- } = Ve(c, s, l), u = s, h = {}, g = 0;
172
+ } = De(c, o, l), u = o, m = {}, g = 0;
173
173
  for (let b = 0; b < a.length; b++) {
174
174
  const {
175
175
  name: f,
176
- fn: w
176
+ fn: v
177
177
  } = a[b], {
178
178
  x: _,
179
- y,
180
- data: k,
181
- reset: C
182
- } = await w({
183
- x: d,
179
+ y: k,
180
+ data: C,
181
+ reset: y
182
+ } = await v({
183
+ x: h,
184
184
  y: p,
185
- initialPlacement: s,
185
+ initialPlacement: o,
186
186
  placement: u,
187
187
  strategy: i,
188
- middlewareData: h,
188
+ middlewareData: m,
189
189
  rects: c,
190
190
  platform: n,
191
191
  elements: {
192
- reference: o,
192
+ reference: s,
193
193
  floating: e
194
194
  }
195
195
  });
196
- d = _ ?? d, p = y ?? p, h = {
197
- ...h,
196
+ h = _ ?? h, p = k ?? p, m = {
197
+ ...m,
198
198
  [f]: {
199
- ...h[f],
200
- ...k
199
+ ...m[f],
200
+ ...C
201
201
  }
202
- }, C && g <= 50 && (g++, typeof C == "object" && (C.placement && (u = C.placement), C.rects && (c = C.rects === !0 ? await n.getElementRects({
203
- reference: o,
202
+ }, y && g <= 50 && (g++, typeof y == "object" && (y.placement && (u = y.placement), y.rects && (c = y.rects === !0 ? await n.getElementRects({
203
+ reference: s,
204
204
  floating: e,
205
205
  strategy: i
206
- }) : C.rects), {
207
- x: d,
206
+ }) : y.rects), {
207
+ x: h,
208
208
  y: p
209
- } = Ve(c, u, l)), b = -1);
209
+ } = De(c, u, l)), b = -1);
210
210
  }
211
211
  return {
212
- x: d,
212
+ x: h,
213
213
  y: p,
214
214
  placement: u,
215
215
  strategy: i,
216
- middlewareData: h
216
+ middlewareData: m
217
217
  };
218
218
  };
219
- async function je(o, e) {
219
+ async function Ye(s, e) {
220
220
  var t;
221
221
  e === void 0 && (e = {});
222
222
  const {
223
- x: s,
223
+ x: o,
224
224
  y: i,
225
225
  platform: r,
226
226
  rects: n,
227
227
  elements: a,
228
228
  strategy: l
229
- } = o, {
229
+ } = s, {
230
230
  boundary: c = "clippingAncestors",
231
- rootBoundary: d = "viewport",
231
+ rootBoundary: h = "viewport",
232
232
  elementContext: p = "floating",
233
233
  altBoundary: u = !1,
234
- padding: h = 0
235
- } = pe(e, o), g = _t(h), f = a[u ? p === "floating" ? "reference" : "floating" : p], w = me(await r.getClippingRect({
234
+ padding: m = 0
235
+ } = le(e, s), g = yt(m), f = a[u ? p === "floating" ? "reference" : "floating" : p], v = ae(await r.getClippingRect({
236
236
  element: (t = await (r.isElement == null ? void 0 : r.isElement(f))) == null || t ? f : f.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(a.floating)),
237
237
  boundary: c,
238
- rootBoundary: d,
238
+ rootBoundary: h,
239
239
  strategy: l
240
240
  })), _ = p === "floating" ? {
241
- x: s,
241
+ x: o,
242
242
  y: i,
243
243
  width: n.floating.width,
244
244
  height: n.floating.height
245
- } : n.reference, y = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a.floating)), k = await (r.isElement == null ? void 0 : r.isElement(y)) ? await (r.getScale == null ? void 0 : r.getScale(y)) || {
245
+ } : n.reference, k = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a.floating)), C = await (r.isElement == null ? void 0 : r.isElement(k)) ? await (r.getScale == null ? void 0 : r.getScale(k)) || {
246
246
  x: 1,
247
247
  y: 1
248
248
  } : {
249
249
  x: 1,
250
250
  y: 1
251
- }, C = me(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
251
+ }, y = ae(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
252
252
  elements: a,
253
253
  rect: _,
254
- offsetParent: y,
254
+ offsetParent: k,
255
255
  strategy: l
256
256
  }) : _);
257
257
  return {
258
- top: (w.top - C.top + g.top) / k.y,
259
- bottom: (C.bottom - w.bottom + g.bottom) / k.y,
260
- left: (w.left - C.left + g.left) / k.x,
261
- right: (C.right - w.right + g.right) / k.x
258
+ top: (v.top - y.top + g.top) / C.y,
259
+ bottom: (y.bottom - v.bottom + g.bottom) / C.y,
260
+ left: (v.left - y.left + g.left) / C.x,
261
+ right: (y.right - v.right + g.right) / C.x
262
262
  };
263
263
  }
264
- const yt = function(o) {
265
- return o === void 0 && (o = {}), {
264
+ const Ct = function(s) {
265
+ return s === void 0 && (s = {}), {
266
266
  name: "flip",
267
- options: o,
267
+ options: s,
268
268
  async fn(e) {
269
- var t, s;
269
+ var t, o;
270
270
  const {
271
271
  placement: i,
272
272
  middlewareData: r,
@@ -275,83 +275,83 @@ const yt = function(o) {
275
275
  platform: l,
276
276
  elements: c
277
277
  } = e, {
278
- mainAxis: d = !0,
278
+ mainAxis: h = !0,
279
279
  crossAxis: p = !0,
280
280
  fallbackPlacements: u,
281
- fallbackStrategy: h = "bestFit",
281
+ fallbackStrategy: m = "bestFit",
282
282
  fallbackAxisSideDirection: g = "none",
283
283
  flipAlignment: b = !0,
284
284
  ...f
285
- } = pe(o, e);
285
+ } = le(s, e);
286
286
  if ((t = r.arrow) != null && t.alignmentOffset)
287
287
  return {};
288
- const w = F(i), _ = P(a), y = F(a) === a, k = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), C = u || (y || !b ? [he(a)] : ut(a)), J = g !== "none";
289
- !u && J && C.push(...ft(a, b, g, k));
290
- const G = [a, ...C], we = await je(e, f), re = [];
291
- let j = ((s = r.flip) == null ? void 0 : s.overflows) || [];
292
- if (d && re.push(we[w]), p) {
293
- const D = pt(i, n, k);
294
- re.push(we[D[0]], we[D[1]]);
288
+ const v = N(i), _ = B(a), k = N(a) === a, C = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), y = u || (k || !b ? [ne(a)] : bt(a)), Y = g !== "none";
289
+ !u && Y && y.push(..._t(a, b, g, C));
290
+ const j = [a, ...y], ue = await Ye(e, f), te = [];
291
+ let G = ((o = r.flip) == null ? void 0 : o.overflows) || [];
292
+ if (h && te.push(ue[v]), p) {
293
+ const $ = gt(i, n, C);
294
+ te.push(ue[$[0]], ue[$[1]]);
295
295
  }
296
- if (j = [...j, {
296
+ if (G = [...G, {
297
297
  placement: i,
298
- overflows: re
299
- }], !re.every((D) => D <= 0)) {
300
- var Oe, Le;
301
- const D = (((Oe = r.flip) == null ? void 0 : Oe.index) || 0) + 1, _e = G[D];
302
- if (_e && (!(p === "alignment" ? _ !== P(_e) : !1) || // We leave the current main axis only if every placement on that axis
298
+ overflows: te
299
+ }], !te.every(($) => $ <= 0)) {
300
+ var Me, Pe;
301
+ const $ = (((Me = r.flip) == null ? void 0 : Me.index) || 0) + 1, ge = j[$];
302
+ if (ge && (!(p === "alignment" ? _ !== B(ge) : !1) || // We leave the current main axis only if every placement on that axis
303
303
  // overflows the main axis.
304
- j.every((I) => P(I.placement) === _ ? I.overflows[0] > 0 : !0)))
304
+ G.every((I) => B(I.placement) === _ ? I.overflows[0] > 0 : !0)))
305
305
  return {
306
306
  data: {
307
- index: D,
308
- overflows: j
307
+ index: $,
308
+ overflows: G
309
309
  },
310
310
  reset: {
311
- placement: _e
311
+ placement: ge
312
312
  }
313
313
  };
314
- let X = (Le = j.filter((H) => H.overflows[0] <= 0).sort((H, I) => H.overflows[1] - I.overflows[1])[0]) == null ? void 0 : Le.placement;
315
- if (!X)
316
- switch (h) {
314
+ let J = (Pe = G.filter((H) => H.overflows[0] <= 0).sort((H, I) => H.overflows[1] - I.overflows[1])[0]) == null ? void 0 : Pe.placement;
315
+ if (!J)
316
+ switch (m) {
317
317
  case "bestFit": {
318
318
  var Ee;
319
- const H = (Ee = j.filter((I) => {
320
- if (J) {
321
- const V = P(I.placement);
319
+ const H = (Ee = G.filter((I) => {
320
+ if (Y) {
321
+ const V = B(I.placement);
322
322
  return V === _ || // Create a bias to the `y` side axis due to horizontal
323
323
  // reading directions favoring greater width.
324
324
  V === "y";
325
325
  }
326
326
  return !0;
327
- }).map((I) => [I.placement, I.overflows.filter((V) => V > 0).reduce((V, at) => V + at, 0)]).sort((I, V) => I[1] - V[1])[0]) == null ? void 0 : Ee[0];
328
- H && (X = H);
327
+ }).map((I) => [I.placement, I.overflows.filter((V) => V > 0).reduce((V, ct) => V + ct, 0)]).sort((I, V) => I[1] - V[1])[0]) == null ? void 0 : Ee[0];
328
+ H && (J = H);
329
329
  break;
330
330
  }
331
331
  case "initialPlacement":
332
- X = a;
332
+ J = a;
333
333
  break;
334
334
  }
335
- if (i !== X)
335
+ if (i !== J)
336
336
  return {
337
337
  reset: {
338
- placement: X
338
+ placement: J
339
339
  }
340
340
  };
341
341
  }
342
342
  return {};
343
343
  }
344
344
  };
345
- }, Ct = /* @__PURE__ */ new Set(["left", "top"]);
346
- async function kt(o, e) {
345
+ }, St = /* @__PURE__ */ new Set(["left", "top"]);
346
+ async function Tt(s, e) {
347
347
  const {
348
348
  placement: t,
349
- platform: s,
349
+ platform: o,
350
350
  elements: i
351
- } = o, r = await (s.isRTL == null ? void 0 : s.isRTL(i.floating)), n = F(t), a = ue(t), l = P(t) === "y", c = Ct.has(n) ? -1 : 1, d = r && l ? -1 : 1, p = pe(e, o);
351
+ } = s, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), n = N(t), a = ce(t), l = B(t) === "y", c = St.has(n) ? -1 : 1, h = r && l ? -1 : 1, p = le(e, s);
352
352
  let {
353
353
  mainAxis: u,
354
- crossAxis: h,
354
+ crossAxis: m,
355
355
  alignmentAxis: g
356
356
  } = typeof p == "number" ? {
357
357
  mainAxis: p,
@@ -362,27 +362,27 @@ async function kt(o, e) {
362
362
  crossAxis: p.crossAxis || 0,
363
363
  alignmentAxis: p.alignmentAxis
364
364
  };
365
- return a && typeof g == "number" && (h = a === "end" ? g * -1 : g), l ? {
366
- x: h * d,
365
+ return a && typeof g == "number" && (m = a === "end" ? g * -1 : g), l ? {
366
+ x: m * h,
367
367
  y: u * c
368
368
  } : {
369
369
  x: u * c,
370
- y: h * d
370
+ y: m * h
371
371
  };
372
372
  }
373
- const St = function(o) {
374
- return o === void 0 && (o = 0), {
373
+ const It = function(s) {
374
+ return s === void 0 && (s = 0), {
375
375
  name: "offset",
376
- options: o,
376
+ options: s,
377
377
  async fn(e) {
378
- var t, s;
378
+ var t, o;
379
379
  const {
380
380
  x: i,
381
381
  y: r,
382
382
  placement: n,
383
383
  middlewareData: a
384
- } = e, l = await kt(e, o);
385
- return n === ((t = a.offset) == null ? void 0 : t.placement) && (s = a.arrow) != null && s.alignmentOffset ? {} : {
384
+ } = e, l = await Tt(e, s);
385
+ return n === ((t = a.offset) == null ? void 0 : t.placement) && (o = a.arrow) != null && o.alignmentOffset ? {} : {
386
386
  x: i + l.x,
387
387
  y: r + l.y,
388
388
  data: {
@@ -392,14 +392,14 @@ const St = function(o) {
392
392
  };
393
393
  }
394
394
  };
395
- }, Tt = function(o) {
396
- return o === void 0 && (o = {}), {
395
+ }, Ot = function(s) {
396
+ return s === void 0 && (s = {}), {
397
397
  name: "shift",
398
- options: o,
398
+ options: s,
399
399
  async fn(e) {
400
400
  const {
401
401
  x: t,
402
- y: s,
402
+ y: o,
403
403
  placement: i
404
404
  } = e, {
405
405
  mainAxis: r = !0,
@@ -407,39 +407,39 @@ const St = function(o) {
407
407
  limiter: a = {
408
408
  fn: (f) => {
409
409
  let {
410
- x: w,
410
+ x: v,
411
411
  y: _
412
412
  } = f;
413
413
  return {
414
- x: w,
414
+ x: v,
415
415
  y: _
416
416
  };
417
417
  }
418
418
  },
419
419
  ...l
420
- } = pe(o, e), c = {
420
+ } = le(s, e), c = {
421
421
  x: t,
422
- y: s
423
- }, d = await je(e, l), p = P(F(i)), u = Fe(p);
424
- let h = c[u], g = c[p];
422
+ y: o
423
+ }, h = await Ye(e, l), p = B(N(i)), u = Ue(p);
424
+ let m = c[u], g = c[p];
425
425
  if (r) {
426
- const f = u === "y" ? "top" : "left", w = u === "y" ? "bottom" : "right", _ = h + d[f], y = h - d[w];
427
- h = $e(_, h, y);
426
+ const f = u === "y" ? "top" : "left", v = u === "y" ? "bottom" : "right", _ = m + h[f], k = m - h[v];
427
+ m = ze(_, m, k);
428
428
  }
429
429
  if (n) {
430
- const f = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right", _ = g + d[f], y = g - d[w];
431
- g = $e(_, g, y);
430
+ const f = p === "y" ? "top" : "left", v = p === "y" ? "bottom" : "right", _ = g + h[f], k = g - h[v];
431
+ g = ze(_, g, k);
432
432
  }
433
433
  const b = a.fn({
434
434
  ...e,
435
- [u]: h,
435
+ [u]: m,
436
436
  [p]: g
437
437
  });
438
438
  return {
439
439
  ...b,
440
440
  data: {
441
441
  x: b.x - t,
442
- y: b.y - s,
442
+ y: b.y - o,
443
443
  enabled: {
444
444
  [u]: r,
445
445
  [p]: n
@@ -449,247 +449,247 @@ const St = function(o) {
449
449
  }
450
450
  };
451
451
  };
452
- function ge() {
452
+ function de() {
453
453
  return typeof window < "u";
454
454
  }
455
- function Y(o) {
456
- return Ue(o) ? (o.nodeName || "").toLowerCase() : "#document";
455
+ function q(s) {
456
+ return Je(s) ? (s.nodeName || "").toLowerCase() : "#document";
457
457
  }
458
- function A(o) {
458
+ function T(s) {
459
459
  var e;
460
- return (o == null || (e = o.ownerDocument) == null ? void 0 : e.defaultView) || window;
460
+ return (s == null || (e = s.ownerDocument) == null ? void 0 : e.defaultView) || window;
461
461
  }
462
- function z(o) {
462
+ function z(s) {
463
463
  var e;
464
- return (e = (Ue(o) ? o.ownerDocument : o.document) || window.document) == null ? void 0 : e.documentElement;
464
+ return (e = (Je(s) ? s.ownerDocument : s.document) || window.document) == null ? void 0 : e.documentElement;
465
465
  }
466
- function Ue(o) {
467
- return ge() ? o instanceof Node || o instanceof A(o).Node : !1;
466
+ function Je(s) {
467
+ return de() ? s instanceof Node || s instanceof T(s).Node : !1;
468
468
  }
469
- function L(o) {
470
- return ge() ? o instanceof Element || o instanceof A(o).Element : !1;
469
+ function L(s) {
470
+ return de() ? s instanceof Element || s instanceof T(s).Element : !1;
471
471
  }
472
- function M(o) {
473
- return ge() ? o instanceof HTMLElement || o instanceof A(o).HTMLElement : !1;
472
+ function E(s) {
473
+ return de() ? s instanceof HTMLElement || s instanceof T(s).HTMLElement : !1;
474
474
  }
475
- function Pe(o) {
476
- return !ge() || typeof ShadowRoot > "u" ? !1 : o instanceof ShadowRoot || o instanceof A(o).ShadowRoot;
475
+ function $e(s) {
476
+ return !de() || typeof ShadowRoot > "u" ? !1 : s instanceof ShadowRoot || s instanceof T(s).ShadowRoot;
477
477
  }
478
- const At = /* @__PURE__ */ new Set(["inline", "contents"]);
479
- function ie(o) {
478
+ const Lt = /* @__PURE__ */ new Set(["inline", "contents"]);
479
+ function ee(s) {
480
480
  const {
481
481
  overflow: e,
482
482
  overflowX: t,
483
- overflowY: s,
483
+ overflowY: o,
484
484
  display: i
485
- } = E(o);
486
- return /auto|scroll|overlay|hidden|clip/.test(e + s + t) && !At.has(i);
485
+ } = A(s);
486
+ return /auto|scroll|overlay|hidden|clip/.test(e + o + t) && !Lt.has(i);
487
487
  }
488
- const It = /* @__PURE__ */ new Set(["table", "td", "th"]);
489
- function Ot(o) {
490
- return It.has(Y(o));
488
+ const At = /* @__PURE__ */ new Set(["table", "td", "th"]);
489
+ function Mt(s) {
490
+ return At.has(q(s));
491
491
  }
492
- const Lt = [":popover-open", ":modal"];
493
- function be(o) {
494
- return Lt.some((e) => {
492
+ const Pt = [":popover-open", ":modal"];
493
+ function he(s) {
494
+ return Pt.some((e) => {
495
495
  try {
496
- return o.matches(e);
496
+ return s.matches(e);
497
497
  } catch {
498
498
  return !1;
499
499
  }
500
500
  });
501
501
  }
502
- const Et = ["transform", "translate", "scale", "rotate", "perspective"], $t = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Mt = ["paint", "layout", "strict", "content"];
503
- function Te(o) {
504
- const e = Ae(), t = L(o) ? E(o) : o;
505
- return Et.some((s) => t[s] ? t[s] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !e && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !e && (t.filter ? t.filter !== "none" : !1) || $t.some((s) => (t.willChange || "").includes(s)) || Mt.some((s) => (t.contain || "").includes(s));
502
+ const Et = ["transform", "translate", "scale", "rotate", "perspective"], zt = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Vt = ["paint", "layout", "strict", "content"];
503
+ function Te(s) {
504
+ const e = Ie(), t = L(s) ? A(s) : s;
505
+ return Et.some((o) => t[o] ? t[o] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !e && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !e && (t.filter ? t.filter !== "none" : !1) || zt.some((o) => (t.willChange || "").includes(o)) || Vt.some((o) => (t.contain || "").includes(o));
506
506
  }
507
- function zt(o) {
508
- let e = B(o);
509
- for (; M(e) && !K(e); ) {
507
+ function Bt(s) {
508
+ let e = D(s);
509
+ for (; E(e) && !K(e); ) {
510
510
  if (Te(e))
511
511
  return e;
512
- if (be(e))
512
+ if (he(e))
513
513
  return null;
514
- e = B(e);
514
+ e = D(e);
515
515
  }
516
516
  return null;
517
517
  }
518
- function Ae() {
518
+ function Ie() {
519
519
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
520
520
  }
521
- const Vt = /* @__PURE__ */ new Set(["html", "body", "#document"]);
522
- function K(o) {
523
- return Vt.has(Y(o));
521
+ const Dt = /* @__PURE__ */ new Set(["html", "body", "#document"]);
522
+ function K(s) {
523
+ return Dt.has(q(s));
524
524
  }
525
- function E(o) {
526
- return A(o).getComputedStyle(o);
525
+ function A(s) {
526
+ return T(s).getComputedStyle(s);
527
527
  }
528
- function ve(o) {
529
- return L(o) ? {
530
- scrollLeft: o.scrollLeft,
531
- scrollTop: o.scrollTop
528
+ function me(s) {
529
+ return L(s) ? {
530
+ scrollLeft: s.scrollLeft,
531
+ scrollTop: s.scrollTop
532
532
  } : {
533
- scrollLeft: o.scrollX,
534
- scrollTop: o.scrollY
533
+ scrollLeft: s.scrollX,
534
+ scrollTop: s.scrollY
535
535
  };
536
536
  }
537
- function B(o) {
538
- if (Y(o) === "html")
539
- return o;
537
+ function D(s) {
538
+ if (q(s) === "html")
539
+ return s;
540
540
  const e = (
541
541
  // Step into the shadow DOM of the parent of a slotted node.
542
- o.assignedSlot || // DOM Element detected.
543
- o.parentNode || // ShadowRoot detected.
544
- Pe(o) && o.host || // Fallback.
545
- z(o)
542
+ s.assignedSlot || // DOM Element detected.
543
+ s.parentNode || // ShadowRoot detected.
544
+ $e(s) && s.host || // Fallback.
545
+ z(s)
546
546
  );
547
- return Pe(e) ? e.host : e;
547
+ return $e(e) ? e.host : e;
548
548
  }
549
- function Ke(o) {
550
- const e = B(o);
551
- return K(e) ? o.ownerDocument ? o.ownerDocument.body : o.body : M(e) && ie(e) ? e : Ke(e);
549
+ function Xe(s) {
550
+ const e = D(s);
551
+ return K(e) ? s.ownerDocument ? s.ownerDocument.body : s.body : E(e) && ee(e) ? e : Xe(e);
552
552
  }
553
- function se(o, e, t) {
554
- var s;
553
+ function Q(s, e, t) {
554
+ var o;
555
555
  e === void 0 && (e = []), t === void 0 && (t = !0);
556
- const i = Ke(o), r = i === ((s = o.ownerDocument) == null ? void 0 : s.body), n = A(i);
556
+ const i = Xe(s), r = i === ((o = s.ownerDocument) == null ? void 0 : o.body), n = T(i);
557
557
  if (r) {
558
- const a = Ce(n);
559
- return e.concat(n, n.visualViewport || [], ie(i) ? i : [], a && t ? se(a) : []);
558
+ const a = ve(n);
559
+ return e.concat(n, n.visualViewport || [], ee(i) ? i : [], a && t ? Q(a) : []);
560
560
  }
561
- return e.concat(i, se(i, [], t));
561
+ return e.concat(i, Q(i, [], t));
562
562
  }
563
- function Ce(o) {
564
- return o.parent && Object.getPrototypeOf(o.parent) ? o.frameElement : null;
563
+ function ve(s) {
564
+ return s.parent && Object.getPrototypeOf(s.parent) ? s.frameElement : null;
565
565
  }
566
- function Ye(o) {
567
- const e = E(o);
568
- let t = parseFloat(e.width) || 0, s = parseFloat(e.height) || 0;
569
- const i = M(o), r = i ? o.offsetWidth : t, n = i ? o.offsetHeight : s, a = de(t) !== r || de(s) !== n;
570
- return a && (t = r, s = n), {
566
+ function Qe(s) {
567
+ const e = A(s);
568
+ let t = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
569
+ const i = E(s), r = i ? s.offsetWidth : t, n = i ? s.offsetHeight : o, a = re(t) !== r || re(o) !== n;
570
+ return a && (t = r, o = n), {
571
571
  width: t,
572
- height: s,
572
+ height: o,
573
573
  $: a
574
574
  };
575
575
  }
576
- function Ie(o) {
577
- return L(o) ? o : o.contextElement;
576
+ function Oe(s) {
577
+ return L(s) ? s : s.contextElement;
578
578
  }
579
- function U(o) {
580
- const e = Ie(o);
581
- if (!M(e))
582
- return $(1);
579
+ function U(s) {
580
+ const e = Oe(s);
581
+ if (!E(e))
582
+ return P(1);
583
583
  const t = e.getBoundingClientRect(), {
584
- width: s,
584
+ width: o,
585
585
  height: i,
586
586
  $: r
587
- } = Ye(e);
588
- let n = (r ? de(t.width) : t.width) / s, a = (r ? de(t.height) : t.height) / i;
587
+ } = Qe(e);
588
+ let n = (r ? re(t.width) : t.width) / o, a = (r ? re(t.height) : t.height) / i;
589
589
  return (!n || !Number.isFinite(n)) && (n = 1), (!a || !Number.isFinite(a)) && (a = 1), {
590
590
  x: n,
591
591
  y: a
592
592
  };
593
593
  }
594
- const Pt = /* @__PURE__ */ $(0);
595
- function Je(o) {
596
- const e = A(o);
597
- return !Ae() || !e.visualViewport ? Pt : {
594
+ const $t = /* @__PURE__ */ P(0);
595
+ function Ze(s) {
596
+ const e = T(s);
597
+ return !Ie() || !e.visualViewport ? $t : {
598
598
  x: e.visualViewport.offsetLeft,
599
599
  y: e.visualViewport.offsetTop
600
600
  };
601
601
  }
602
- function Bt(o, e, t) {
603
- return e === void 0 && (e = !1), !t || e && t !== A(o) ? !1 : e;
602
+ function Ht(s, e, t) {
603
+ return e === void 0 && (e = !1), !t || e && t !== T(s) ? !1 : e;
604
604
  }
605
- function W(o, e, t, s) {
605
+ function W(s, e, t, o) {
606
606
  e === void 0 && (e = !1), t === void 0 && (t = !1);
607
- const i = o.getBoundingClientRect(), r = Ie(o);
608
- let n = $(1);
609
- e && (s ? L(s) && (n = U(s)) : n = U(o));
610
- const a = Bt(r, t, s) ? Je(r) : $(0);
611
- let l = (i.left + a.x) / n.x, c = (i.top + a.y) / n.y, d = i.width / n.x, p = i.height / n.y;
607
+ const i = s.getBoundingClientRect(), r = Oe(s);
608
+ let n = P(1);
609
+ e && (o ? L(o) && (n = U(o)) : n = U(s));
610
+ const a = Ht(r, t, o) ? Ze(r) : P(0);
611
+ let l = (i.left + a.x) / n.x, c = (i.top + a.y) / n.y, h = i.width / n.x, p = i.height / n.y;
612
612
  if (r) {
613
- const u = A(r), h = s && L(s) ? A(s) : s;
614
- let g = u, b = Ce(g);
615
- for (; b && s && h !== g; ) {
616
- const f = U(b), w = b.getBoundingClientRect(), _ = E(b), y = w.left + (b.clientLeft + parseFloat(_.paddingLeft)) * f.x, k = w.top + (b.clientTop + parseFloat(_.paddingTop)) * f.y;
617
- l *= f.x, c *= f.y, d *= f.x, p *= f.y, l += y, c += k, g = A(b), b = Ce(g);
613
+ const u = T(r), m = o && L(o) ? T(o) : o;
614
+ let g = u, b = ve(g);
615
+ for (; b && o && m !== g; ) {
616
+ const f = U(b), v = b.getBoundingClientRect(), _ = A(b), k = v.left + (b.clientLeft + parseFloat(_.paddingLeft)) * f.x, C = v.top + (b.clientTop + parseFloat(_.paddingTop)) * f.y;
617
+ l *= f.x, c *= f.y, h *= f.x, p *= f.y, l += k, c += C, g = T(b), b = ve(g);
618
618
  }
619
619
  }
620
- return me({
621
- width: d,
620
+ return ae({
621
+ width: h,
622
622
  height: p,
623
623
  x: l,
624
624
  y: c
625
625
  });
626
626
  }
627
- function fe(o, e) {
628
- const t = ve(o).scrollLeft;
629
- return e ? e.left + t : W(z(o)).left + t;
627
+ function pe(s, e) {
628
+ const t = me(s).scrollLeft;
629
+ return e ? e.left + t : W(z(s)).left + t;
630
630
  }
631
- function Xe(o, e) {
632
- const t = o.getBoundingClientRect(), s = t.left + e.scrollLeft - fe(o, t), i = t.top + e.scrollTop;
631
+ function et(s, e) {
632
+ const t = s.getBoundingClientRect(), o = t.left + e.scrollLeft - pe(s, t), i = t.top + e.scrollTop;
633
633
  return {
634
- x: s,
634
+ x: o,
635
635
  y: i
636
636
  };
637
637
  }
638
- function Dt(o) {
638
+ function Rt(s) {
639
639
  let {
640
640
  elements: e,
641
641
  rect: t,
642
- offsetParent: s,
642
+ offsetParent: o,
643
643
  strategy: i
644
- } = o;
645
- const r = i === "fixed", n = z(s), a = e ? be(e.floating) : !1;
646
- if (s === n || a && r)
644
+ } = s;
645
+ const r = i === "fixed", n = z(o), a = e ? he(e.floating) : !1;
646
+ if (o === n || a && r)
647
647
  return t;
648
648
  let l = {
649
649
  scrollLeft: 0,
650
650
  scrollTop: 0
651
- }, c = $(1);
652
- const d = $(0), p = M(s);
653
- if ((p || !p && !r) && ((Y(s) !== "body" || ie(n)) && (l = ve(s)), M(s))) {
654
- const h = W(s);
655
- c = U(s), d.x = h.x + s.clientLeft, d.y = h.y + s.clientTop;
651
+ }, c = P(1);
652
+ const h = P(0), p = E(o);
653
+ if ((p || !p && !r) && ((q(o) !== "body" || ee(n)) && (l = me(o)), E(o))) {
654
+ const m = W(o);
655
+ c = U(o), h.x = m.x + o.clientLeft, h.y = m.y + o.clientTop;
656
656
  }
657
- const u = n && !p && !r ? Xe(n, l) : $(0);
657
+ const u = n && !p && !r ? et(n, l) : P(0);
658
658
  return {
659
659
  width: t.width * c.x,
660
660
  height: t.height * c.y,
661
- x: t.x * c.x - l.scrollLeft * c.x + d.x + u.x,
662
- y: t.y * c.y - l.scrollTop * c.y + d.y + u.y
661
+ x: t.x * c.x - l.scrollLeft * c.x + h.x + u.x,
662
+ y: t.y * c.y - l.scrollTop * c.y + h.y + u.y
663
663
  };
664
664
  }
665
- function Ht(o) {
666
- return Array.from(o.getClientRects());
665
+ function Ft(s) {
666
+ return Array.from(s.getClientRects());
667
667
  }
668
- function Rt(o) {
669
- const e = z(o), t = ve(o), s = o.ownerDocument.body, i = N(e.scrollWidth, e.clientWidth, s.scrollWidth, s.clientWidth), r = N(e.scrollHeight, e.clientHeight, s.scrollHeight, s.clientHeight);
670
- let n = -t.scrollLeft + fe(o);
668
+ function Nt(s) {
669
+ const e = z(s), t = me(s), o = s.ownerDocument.body, i = F(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), r = F(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
670
+ let n = -t.scrollLeft + pe(s);
671
671
  const a = -t.scrollTop;
672
- return E(s).direction === "rtl" && (n += N(e.clientWidth, s.clientWidth) - i), {
672
+ return A(o).direction === "rtl" && (n += F(e.clientWidth, o.clientWidth) - i), {
673
673
  width: i,
674
674
  height: r,
675
675
  x: n,
676
676
  y: a
677
677
  };
678
678
  }
679
- const Be = 25;
680
- function Nt(o, e) {
681
- const t = A(o), s = z(o), i = t.visualViewport;
682
- let r = s.clientWidth, n = s.clientHeight, a = 0, l = 0;
679
+ const He = 25;
680
+ function Wt(s, e) {
681
+ const t = T(s), o = z(s), i = t.visualViewport;
682
+ let r = o.clientWidth, n = o.clientHeight, a = 0, l = 0;
683
683
  if (i) {
684
684
  r = i.width, n = i.height;
685
- const d = Ae();
686
- (!d || d && e === "fixed") && (a = i.offsetLeft, l = i.offsetTop);
685
+ const h = Ie();
686
+ (!h || h && e === "fixed") && (a = i.offsetLeft, l = i.offsetTop);
687
687
  }
688
- const c = fe(s);
688
+ const c = pe(o);
689
689
  if (c <= 0) {
690
- const d = s.ownerDocument, p = d.body, u = getComputedStyle(p), h = d.compatMode === "CSS1Compat" && parseFloat(u.marginLeft) + parseFloat(u.marginRight) || 0, g = Math.abs(s.clientWidth - p.clientWidth - h);
691
- g <= Be && (r -= g);
692
- } else c <= Be && (r += c);
690
+ const h = o.ownerDocument, p = h.body, u = getComputedStyle(p), m = h.compatMode === "CSS1Compat" && parseFloat(u.marginLeft) + parseFloat(u.marginRight) || 0, g = Math.abs(o.clientWidth - p.clientWidth - m);
691
+ g <= He && (r -= g);
692
+ } else c <= He && (r += c);
693
693
  return {
694
694
  width: r,
695
695
  height: n,
@@ -697,9 +697,9 @@ function Nt(o, e) {
697
697
  y: l
698
698
  };
699
699
  }
700
- const Ft = /* @__PURE__ */ new Set(["absolute", "fixed"]);
701
- function Wt(o, e) {
702
- const t = W(o, !0, e === "fixed"), s = t.top + o.clientTop, i = t.left + o.clientLeft, r = M(o) ? U(o) : $(1), n = o.clientWidth * r.x, a = o.clientHeight * r.y, l = i * r.x, c = s * r.y;
700
+ const jt = /* @__PURE__ */ new Set(["absolute", "fixed"]);
701
+ function Gt(s, e) {
702
+ const t = W(s, !0, e === "fixed"), o = t.top + s.clientTop, i = t.left + s.clientLeft, r = E(s) ? U(s) : P(1), n = s.clientWidth * r.x, a = s.clientHeight * r.y, l = i * r.x, c = o * r.y;
703
703
  return {
704
704
  width: n,
705
705
  height: a,
@@ -707,53 +707,53 @@ function Wt(o, e) {
707
707
  y: c
708
708
  };
709
709
  }
710
- function De(o, e, t) {
711
- let s;
710
+ function Re(s, e, t) {
711
+ let o;
712
712
  if (e === "viewport")
713
- s = Nt(o, t);
713
+ o = Wt(s, t);
714
714
  else if (e === "document")
715
- s = Rt(z(o));
715
+ o = Nt(z(s));
716
716
  else if (L(e))
717
- s = Wt(e, t);
717
+ o = Gt(e, t);
718
718
  else {
719
- const i = Je(o);
720
- s = {
719
+ const i = Ze(s);
720
+ o = {
721
721
  x: e.x - i.x,
722
722
  y: e.y - i.y,
723
723
  width: e.width,
724
724
  height: e.height
725
725
  };
726
726
  }
727
- return me(s);
727
+ return ae(o);
728
728
  }
729
- function Ze(o, e) {
730
- const t = B(o);
731
- return t === e || !L(t) || K(t) ? !1 : E(t).position === "fixed" || Ze(t, e);
729
+ function tt(s, e) {
730
+ const t = D(s);
731
+ return t === e || !L(t) || K(t) ? !1 : A(t).position === "fixed" || tt(t, e);
732
732
  }
733
- function Gt(o, e) {
734
- const t = e.get(o);
733
+ function Ut(s, e) {
734
+ const t = e.get(s);
735
735
  if (t)
736
736
  return t;
737
- let s = se(o, [], !1).filter((a) => L(a) && Y(a) !== "body"), i = null;
738
- const r = E(o).position === "fixed";
739
- let n = r ? B(o) : o;
737
+ let o = Q(s, [], !1).filter((a) => L(a) && q(a) !== "body"), i = null;
738
+ const r = A(s).position === "fixed";
739
+ let n = r ? D(s) : s;
740
740
  for (; L(n) && !K(n); ) {
741
- const a = E(n), l = Te(n);
742
- !l && a.position === "fixed" && (i = null), (r ? !l && !i : !l && a.position === "static" && !!i && Ft.has(i.position) || ie(n) && !l && Ze(o, n)) ? s = s.filter((d) => d !== n) : i = a, n = B(n);
741
+ const a = A(n), l = Te(n);
742
+ !l && a.position === "fixed" && (i = null), (r ? !l && !i : !l && a.position === "static" && !!i && jt.has(i.position) || ee(n) && !l && tt(s, n)) ? o = o.filter((h) => h !== n) : i = a, n = D(n);
743
743
  }
744
- return e.set(o, s), s;
744
+ return e.set(s, o), o;
745
745
  }
746
- function jt(o) {
746
+ function Kt(s) {
747
747
  let {
748
748
  element: e,
749
749
  boundary: t,
750
- rootBoundary: s,
750
+ rootBoundary: o,
751
751
  strategy: i
752
- } = o;
753
- const n = [...t === "clippingAncestors" ? be(e) ? [] : Gt(e, this._c) : [].concat(t), s], a = n[0], l = n.reduce((c, d) => {
754
- const p = De(e, d, i);
755
- return c.top = N(p.top, c.top), c.right = ce(p.right, c.right), c.bottom = ce(p.bottom, c.bottom), c.left = N(p.left, c.left), c;
756
- }, De(e, a, i));
752
+ } = s;
753
+ const n = [...t === "clippingAncestors" ? he(e) ? [] : Ut(e, this._c) : [].concat(t), o], a = n[0], l = n.reduce((c, h) => {
754
+ const p = Re(e, h, i);
755
+ return c.top = F(p.top, c.top), c.right = ie(p.right, c.right), c.bottom = ie(p.bottom, c.bottom), c.left = F(p.left, c.left), c;
756
+ }, Re(e, a, i));
757
757
  return {
758
758
  width: l.right - l.left,
759
759
  height: l.bottom - l.top,
@@ -761,33 +761,33 @@ function jt(o) {
761
761
  y: l.top
762
762
  };
763
763
  }
764
- function Ut(o) {
764
+ function qt(s) {
765
765
  const {
766
766
  width: e,
767
767
  height: t
768
- } = Ye(o);
768
+ } = Qe(s);
769
769
  return {
770
770
  width: e,
771
771
  height: t
772
772
  };
773
773
  }
774
- function Kt(o, e, t) {
775
- const s = M(e), i = z(e), r = t === "fixed", n = W(o, !0, r, e);
774
+ function Yt(s, e, t) {
775
+ const o = E(e), i = z(e), r = t === "fixed", n = W(s, !0, r, e);
776
776
  let a = {
777
777
  scrollLeft: 0,
778
778
  scrollTop: 0
779
779
  };
780
- const l = $(0);
780
+ const l = P(0);
781
781
  function c() {
782
- l.x = fe(i);
782
+ l.x = pe(i);
783
783
  }
784
- if (s || !s && !r)
785
- if ((Y(e) !== "body" || ie(i)) && (a = ve(e)), s) {
786
- const h = W(e, !0, r, e);
787
- l.x = h.x + e.clientLeft, l.y = h.y + e.clientTop;
784
+ if (o || !o && !r)
785
+ if ((q(e) !== "body" || ee(i)) && (a = me(e)), o) {
786
+ const m = W(e, !0, r, e);
787
+ l.x = m.x + e.clientLeft, l.y = m.y + e.clientTop;
788
788
  } else i && c();
789
- r && !s && i && c();
790
- const d = i && !s && !r ? Xe(i, a) : $(0), p = n.left + a.scrollLeft - l.x - d.x, u = n.top + a.scrollTop - l.y - d.y;
789
+ r && !o && i && c();
790
+ const h = i && !o && !r ? et(i, a) : P(0), p = n.left + a.scrollLeft - l.x - h.x, u = n.top + a.scrollTop - l.y - h.y;
791
791
  return {
792
792
  x: p,
793
793
  y: u,
@@ -795,215 +795,215 @@ function Kt(o, e, t) {
795
795
  height: n.height
796
796
  };
797
797
  }
798
- function xe(o) {
799
- return E(o).position === "static";
798
+ function be(s) {
799
+ return A(s).position === "static";
800
800
  }
801
- function He(o, e) {
802
- if (!M(o) || E(o).position === "fixed")
801
+ function Fe(s, e) {
802
+ if (!E(s) || A(s).position === "fixed")
803
803
  return null;
804
804
  if (e)
805
- return e(o);
806
- let t = o.offsetParent;
807
- return z(o) === t && (t = t.ownerDocument.body), t;
805
+ return e(s);
806
+ let t = s.offsetParent;
807
+ return z(s) === t && (t = t.ownerDocument.body), t;
808
808
  }
809
- function Qe(o, e) {
810
- const t = A(o);
811
- if (be(o))
809
+ function st(s, e) {
810
+ const t = T(s);
811
+ if (he(s))
812
812
  return t;
813
- if (!M(o)) {
814
- let i = B(o);
813
+ if (!E(s)) {
814
+ let i = D(s);
815
815
  for (; i && !K(i); ) {
816
- if (L(i) && !xe(i))
816
+ if (L(i) && !be(i))
817
817
  return i;
818
- i = B(i);
818
+ i = D(i);
819
819
  }
820
820
  return t;
821
821
  }
822
- let s = He(o, e);
823
- for (; s && Ot(s) && xe(s); )
824
- s = He(s, e);
825
- return s && K(s) && xe(s) && !Te(s) ? t : s || zt(o) || t;
822
+ let o = Fe(s, e);
823
+ for (; o && Mt(o) && be(o); )
824
+ o = Fe(o, e);
825
+ return o && K(o) && be(o) && !Te(o) ? t : o || Bt(s) || t;
826
826
  }
827
- const Yt = async function(o) {
828
- const e = this.getOffsetParent || Qe, t = this.getDimensions, s = await t(o.floating);
827
+ const Jt = async function(s) {
828
+ const e = this.getOffsetParent || st, t = this.getDimensions, o = await t(s.floating);
829
829
  return {
830
- reference: Kt(o.reference, await e(o.floating), o.strategy),
830
+ reference: Yt(s.reference, await e(s.floating), s.strategy),
831
831
  floating: {
832
832
  x: 0,
833
833
  y: 0,
834
- width: s.width,
835
- height: s.height
834
+ width: o.width,
835
+ height: o.height
836
836
  }
837
837
  };
838
838
  };
839
- function Jt(o) {
840
- return E(o).direction === "rtl";
839
+ function Xt(s) {
840
+ return A(s).direction === "rtl";
841
841
  }
842
- const Xt = {
843
- convertOffsetParentRelativeRectToViewportRelativeRect: Dt,
842
+ const Qt = {
843
+ convertOffsetParentRelativeRectToViewportRelativeRect: Rt,
844
844
  getDocumentElement: z,
845
- getClippingRect: jt,
846
- getOffsetParent: Qe,
847
- getElementRects: Yt,
848
- getClientRects: Ht,
849
- getDimensions: Ut,
845
+ getClippingRect: Kt,
846
+ getOffsetParent: st,
847
+ getElementRects: Jt,
848
+ getClientRects: Ft,
849
+ getDimensions: qt,
850
850
  getScale: U,
851
851
  isElement: L,
852
- isRTL: Jt
852
+ isRTL: Xt
853
853
  };
854
- function qe(o, e) {
855
- return o.x === e.x && o.y === e.y && o.width === e.width && o.height === e.height;
854
+ function ot(s, e) {
855
+ return s.x === e.x && s.y === e.y && s.width === e.width && s.height === e.height;
856
856
  }
857
- function Zt(o, e) {
858
- let t = null, s;
859
- const i = z(o);
857
+ function Zt(s, e) {
858
+ let t = null, o;
859
+ const i = z(s);
860
860
  function r() {
861
861
  var a;
862
- clearTimeout(s), (a = t) == null || a.disconnect(), t = null;
862
+ clearTimeout(o), (a = t) == null || a.disconnect(), t = null;
863
863
  }
864
864
  function n(a, l) {
865
865
  a === void 0 && (a = !1), l === void 0 && (l = 1), r();
866
- const c = o.getBoundingClientRect(), {
867
- left: d,
866
+ const c = s.getBoundingClientRect(), {
867
+ left: h,
868
868
  top: p,
869
869
  width: u,
870
- height: h
870
+ height: m
871
871
  } = c;
872
- if (a || e(), !u || !h)
872
+ if (a || e(), !u || !m)
873
873
  return;
874
- const g = ne(p), b = ne(i.clientWidth - (d + u)), f = ne(i.clientHeight - (p + h)), w = ne(d), y = {
875
- rootMargin: -g + "px " + -b + "px " + -f + "px " + -w + "px",
876
- threshold: N(0, ce(1, l)) || 1
874
+ const g = se(p), b = se(i.clientWidth - (h + u)), f = se(i.clientHeight - (p + m)), v = se(h), k = {
875
+ rootMargin: -g + "px " + -b + "px " + -f + "px " + -v + "px",
876
+ threshold: F(0, ie(1, l)) || 1
877
877
  };
878
- let k = !0;
879
- function C(J) {
880
- const G = J[0].intersectionRatio;
881
- if (G !== l) {
882
- if (!k)
878
+ let C = !0;
879
+ function y(Y) {
880
+ const j = Y[0].intersectionRatio;
881
+ if (j !== l) {
882
+ if (!C)
883
883
  return n();
884
- G ? n(!1, G) : s = setTimeout(() => {
884
+ j ? n(!1, j) : o = setTimeout(() => {
885
885
  n(!1, 1e-7);
886
886
  }, 1e3);
887
887
  }
888
- G === 1 && !qe(c, o.getBoundingClientRect()) && n(), k = !1;
888
+ j === 1 && !ot(c, s.getBoundingClientRect()) && n(), C = !1;
889
889
  }
890
890
  try {
891
- t = new IntersectionObserver(C, {
892
- ...y,
891
+ t = new IntersectionObserver(y, {
892
+ ...k,
893
893
  // Handle <iframe>s
894
894
  root: i.ownerDocument
895
895
  });
896
896
  } catch {
897
- t = new IntersectionObserver(C, y);
897
+ t = new IntersectionObserver(y, k);
898
898
  }
899
- t.observe(o);
899
+ t.observe(s);
900
900
  }
901
901
  return n(!0), r;
902
902
  }
903
- function Z(o, e, t, s) {
904
- s === void 0 && (s = {});
903
+ function we(s, e, t, o) {
904
+ o === void 0 && (o = {});
905
905
  const {
906
906
  ancestorScroll: i = !0,
907
907
  ancestorResize: r = !0,
908
908
  elementResize: n = typeof ResizeObserver == "function",
909
909
  layoutShift: a = typeof IntersectionObserver == "function",
910
910
  animationFrame: l = !1
911
- } = s, c = Ie(o), d = i || r ? [...c ? se(c) : [], ...se(e)] : [];
912
- d.forEach((w) => {
913
- i && w.addEventListener("scroll", t, {
911
+ } = o, c = Oe(s), h = i || r ? [...c ? Q(c) : [], ...Q(e)] : [];
912
+ h.forEach((v) => {
913
+ i && v.addEventListener("scroll", t, {
914
914
  passive: !0
915
- }), r && w.addEventListener("resize", t);
915
+ }), r && v.addEventListener("resize", t);
916
916
  });
917
917
  const p = c && a ? Zt(c, t) : null;
918
- let u = -1, h = null;
919
- n && (h = new ResizeObserver((w) => {
920
- let [_] = w;
921
- _ && _.target === c && h && (h.unobserve(e), cancelAnimationFrame(u), u = requestAnimationFrame(() => {
922
- var y;
923
- (y = h) == null || y.observe(e);
918
+ let u = -1, m = null;
919
+ n && (m = new ResizeObserver((v) => {
920
+ let [_] = v;
921
+ _ && _.target === c && m && (m.unobserve(e), cancelAnimationFrame(u), u = requestAnimationFrame(() => {
922
+ var k;
923
+ (k = m) == null || k.observe(e);
924
924
  })), t();
925
- }), c && !l && h.observe(c), h.observe(e));
926
- let g, b = l ? W(o) : null;
925
+ }), c && !l && m.observe(c), m.observe(e));
926
+ let g, b = l ? W(s) : null;
927
927
  l && f();
928
928
  function f() {
929
- const w = W(o);
930
- b && !qe(b, w) && t(), b = w, g = requestAnimationFrame(f);
929
+ const v = W(s);
930
+ b && !ot(b, v) && t(), b = v, g = requestAnimationFrame(f);
931
931
  }
932
932
  return t(), () => {
933
- var w;
934
- d.forEach((_) => {
933
+ var v;
934
+ h.forEach((_) => {
935
935
  i && _.removeEventListener("scroll", t), r && _.removeEventListener("resize", t);
936
- }), p == null || p(), (w = h) == null || w.disconnect(), h = null, l && cancelAnimationFrame(g);
936
+ }), p == null || p(), (v = m) == null || v.disconnect(), m = null, l && cancelAnimationFrame(g);
937
937
  };
938
938
  }
939
- const Q = St, q = Tt, ae = yt, ee = (o, e, t) => {
940
- const s = /* @__PURE__ */ new Map(), i = {
941
- platform: Xt,
939
+ const _e = It, ke = Ot, it = Ct, ye = (s, e, t) => {
940
+ const o = /* @__PURE__ */ new Map(), i = {
941
+ platform: Qt,
942
942
  ...t
943
943
  }, r = {
944
944
  ...i.platform,
945
- _c: s
945
+ _c: o
946
946
  };
947
- return xt(o, e, {
947
+ return xt(s, e, {
948
948
  ...i,
949
949
  platform: r
950
950
  });
951
951
  };
952
- var et = function() {
953
- }, O = "undefined", Qt = typeof window !== O && typeof window.navigator !== O && /Trident\/|MSIE /.test(window.navigator.userAgent), ke = [
952
+ var rt = function() {
953
+ }, O = "undefined", es = typeof window !== O && typeof window.navigator !== O && /Trident\/|MSIE /.test(window.navigator.userAgent), xe = [
954
954
  "trace",
955
955
  "debug",
956
956
  "info",
957
957
  "warn",
958
958
  "error"
959
- ], oe = {}, x = null;
960
- function Re(o, e) {
961
- var t = o[e];
959
+ ], Z = {}, w = null;
960
+ function Ne(s, e) {
961
+ var t = s[e];
962
962
  if (typeof t.bind == "function")
963
- return t.bind(o);
963
+ return t.bind(s);
964
964
  try {
965
- return Function.prototype.bind.call(t, o);
965
+ return Function.prototype.bind.call(t, s);
966
966
  } catch {
967
967
  return function() {
968
- return Function.prototype.apply.apply(t, [o, arguments]);
968
+ return Function.prototype.apply.apply(t, [s, arguments]);
969
969
  };
970
970
  }
971
971
  }
972
- function qt() {
972
+ function ts() {
973
973
  console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
974
974
  }
975
- function es(o) {
976
- return o === "debug" && (o = "log"), typeof console === O ? !1 : o === "trace" && Qt ? qt : console[o] !== void 0 ? Re(console, o) : console.log !== void 0 ? Re(console, "log") : et;
975
+ function ss(s) {
976
+ return s === "debug" && (s = "log"), typeof console === O ? !1 : s === "trace" && es ? ts : console[s] !== void 0 ? Ne(console, s) : console.log !== void 0 ? Ne(console, "log") : rt;
977
977
  }
978
- function te() {
979
- for (var o = this.getLevel(), e = 0; e < ke.length; e++) {
980
- var t = ke[e];
981
- this[t] = e < o ? et : this.methodFactory(t, o, this.name);
978
+ function X() {
979
+ for (var s = this.getLevel(), e = 0; e < xe.length; e++) {
980
+ var t = xe[e];
981
+ this[t] = e < s ? rt : this.methodFactory(t, s, this.name);
982
982
  }
983
- if (this.log = this.debug, typeof console === O && o < this.levels.SILENT)
983
+ if (this.log = this.debug, typeof console === O && s < this.levels.SILENT)
984
984
  return "No console available for logging";
985
985
  }
986
- function ts(o) {
986
+ function os(s) {
987
987
  return function() {
988
- typeof console !== O && (te.call(this), this[o].apply(this, arguments));
988
+ typeof console !== O && (X.call(this), this[s].apply(this, arguments));
989
989
  };
990
990
  }
991
- function ss(o, e, t) {
992
- return es(o) || ts.apply(this, arguments);
991
+ function is(s, e, t) {
992
+ return ss(s) || os.apply(this, arguments);
993
993
  }
994
- function tt(o, e) {
995
- var t = this, s, i, r, n = "loglevel";
996
- typeof o == "string" ? n += ":" + o : typeof o == "symbol" && (n = void 0);
994
+ function nt(s, e) {
995
+ var t = this, o, i, r, n = "loglevel";
996
+ typeof s == "string" ? n += ":" + s : typeof s == "symbol" && (n = void 0);
997
997
  function a(u) {
998
- var h = (ke[u] || "silent").toUpperCase();
998
+ var m = (xe[u] || "silent").toUpperCase();
999
999
  if (!(typeof window === O || !n)) {
1000
1000
  try {
1001
- window.localStorage[n] = h;
1001
+ window.localStorage[n] = m;
1002
1002
  return;
1003
1003
  } catch {
1004
1004
  }
1005
1005
  try {
1006
- window.document.cookie = encodeURIComponent(n) + "=" + h + ";";
1006
+ window.document.cookie = encodeURIComponent(n) + "=" + m + ";";
1007
1007
  } catch {
1008
1008
  }
1009
1009
  }
@@ -1017,9 +1017,9 @@ function tt(o, e) {
1017
1017
  }
1018
1018
  if (typeof u === O)
1019
1019
  try {
1020
- var h = window.document.cookie, g = encodeURIComponent(n), b = h.indexOf(g + "=");
1020
+ var m = window.document.cookie, g = encodeURIComponent(n), b = m.indexOf(g + "=");
1021
1021
  b !== -1 && (u = /^([^;]+)/.exec(
1022
- h.slice(b + g.length + 1)
1022
+ m.slice(b + g.length + 1)
1023
1023
  )[1]);
1024
1024
  } catch {
1025
1025
  }
@@ -1038,104 +1038,104 @@ function tt(o, e) {
1038
1038
  }
1039
1039
  }
1040
1040
  }
1041
- function d(u) {
1042
- var h = u;
1043
- if (typeof h == "string" && t.levels[h.toUpperCase()] !== void 0 && (h = t.levels[h.toUpperCase()]), typeof h == "number" && h >= 0 && h <= t.levels.SILENT)
1044
- return h;
1041
+ function h(u) {
1042
+ var m = u;
1043
+ if (typeof m == "string" && t.levels[m.toUpperCase()] !== void 0 && (m = t.levels[m.toUpperCase()]), typeof m == "number" && m >= 0 && m <= t.levels.SILENT)
1044
+ return m;
1045
1045
  throw new TypeError("log.setLevel() called with invalid level: " + u);
1046
1046
  }
1047
- t.name = o, t.levels = {
1047
+ t.name = s, t.levels = {
1048
1048
  TRACE: 0,
1049
1049
  DEBUG: 1,
1050
1050
  INFO: 2,
1051
1051
  WARN: 3,
1052
1052
  ERROR: 4,
1053
1053
  SILENT: 5
1054
- }, t.methodFactory = e || ss, t.getLevel = function() {
1055
- return r ?? i ?? s;
1056
- }, t.setLevel = function(u, h) {
1057
- return r = d(u), h !== !1 && a(r), te.call(t);
1054
+ }, t.methodFactory = e || is, t.getLevel = function() {
1055
+ return r ?? i ?? o;
1056
+ }, t.setLevel = function(u, m) {
1057
+ return r = h(u), m !== !1 && a(r), X.call(t);
1058
1058
  }, t.setDefaultLevel = function(u) {
1059
- i = d(u), l() || t.setLevel(u, !1);
1059
+ i = h(u), l() || t.setLevel(u, !1);
1060
1060
  }, t.resetLevel = function() {
1061
- r = null, c(), te.call(t);
1061
+ r = null, c(), X.call(t);
1062
1062
  }, t.enableAll = function(u) {
1063
1063
  t.setLevel(t.levels.TRACE, u);
1064
1064
  }, t.disableAll = function(u) {
1065
1065
  t.setLevel(t.levels.SILENT, u);
1066
1066
  }, t.rebuild = function() {
1067
- if (x !== t && (s = d(x.getLevel())), te.call(t), x === t)
1068
- for (var u in oe)
1069
- oe[u].rebuild();
1070
- }, s = d(
1071
- x ? x.getLevel() : "WARN"
1067
+ if (w !== t && (o = h(w.getLevel())), X.call(t), w === t)
1068
+ for (var u in Z)
1069
+ Z[u].rebuild();
1070
+ }, o = h(
1071
+ w ? w.getLevel() : "WARN"
1072
1072
  );
1073
1073
  var p = l();
1074
- p != null && (r = d(p)), te.call(t);
1074
+ p != null && (r = h(p)), X.call(t);
1075
1075
  }
1076
- x = new tt();
1077
- x.getLogger = function(e) {
1076
+ w = new nt();
1077
+ w.getLogger = function(e) {
1078
1078
  if (typeof e != "symbol" && typeof e != "string" || e === "")
1079
1079
  throw new TypeError("You must supply a name when creating a logger.");
1080
- var t = oe[e];
1081
- return t || (t = oe[e] = new tt(
1080
+ var t = Z[e];
1081
+ return t || (t = Z[e] = new nt(
1082
1082
  e,
1083
- x.methodFactory
1083
+ w.methodFactory
1084
1084
  )), t;
1085
1085
  };
1086
- var os = typeof window !== O ? window.log : void 0;
1087
- x.noConflict = function() {
1088
- return typeof window !== O && window.log === x && (window.log = os), x;
1086
+ var rs = typeof window !== O ? window.log : void 0;
1087
+ w.noConflict = function() {
1088
+ return typeof window !== O && window.log === w && (window.log = rs), w;
1089
1089
  };
1090
- x.getLoggers = function() {
1091
- return oe;
1090
+ w.getLoggers = function() {
1091
+ return Z;
1092
1092
  };
1093
- x.default = x;
1094
- var is = function(o) {
1095
- for (var e = 1, t = arguments.length, s; e < t; e++)
1096
- for (s in arguments[e])
1097
- Object.prototype.hasOwnProperty.call(arguments[e], s) && (o[s] = arguments[e][s]);
1098
- return o;
1099
- }, rs = {
1093
+ w.default = w;
1094
+ var ns = function(s) {
1095
+ for (var e = 1, t = arguments.length, o; e < t; e++)
1096
+ for (o in arguments[e])
1097
+ Object.prototype.hasOwnProperty.call(arguments[e], o) && (s[o] = arguments[e][o]);
1098
+ return s;
1099
+ }, as = {
1100
1100
  template: "[%t] %l:",
1101
- levelFormatter: function(o) {
1102
- return o.toUpperCase();
1101
+ levelFormatter: function(s) {
1102
+ return s.toUpperCase();
1103
1103
  },
1104
- nameFormatter: function(o) {
1105
- return o || "root";
1104
+ nameFormatter: function(s) {
1105
+ return s || "root";
1106
1106
  },
1107
- timestampFormatter: function(o) {
1108
- return o.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1");
1107
+ timestampFormatter: function(s) {
1108
+ return s.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1");
1109
1109
  },
1110
1110
  format: void 0
1111
- }, st, R = {}, ns = function(o) {
1112
- if (!o || !o.getLogger)
1111
+ }, at, R = {}, ls = function(s) {
1112
+ if (!s || !s.getLogger)
1113
1113
  throw new TypeError("Argument is not a root logger");
1114
- st = o;
1115
- }, as = function(o, e) {
1116
- if (!o || !o.setLevel)
1114
+ at = s;
1115
+ }, cs = function(s, e) {
1116
+ if (!s || !s.setLevel)
1117
1117
  throw new TypeError("Argument is not a logger");
1118
- var t = o.methodFactory, s = o.name || "", i = R[s] || R[""] || rs;
1118
+ var t = s.methodFactory, o = s.name || "", i = R[o] || R[""] || as;
1119
1119
  function r(n, a, l) {
1120
- var c = t(n, a, l), d = R[l] || R[""], p = d.template.indexOf("%t") !== -1, u = d.template.indexOf("%l") !== -1, h = d.template.indexOf("%n") !== -1;
1120
+ var c = t(n, a, l), h = R[l] || R[""], p = h.template.indexOf("%t") !== -1, u = h.template.indexOf("%l") !== -1, m = h.template.indexOf("%n") !== -1;
1121
1121
  return function() {
1122
- for (var g = "", b = arguments.length, f = Array(b), w = 0; w < b; w++)
1123
- f[w] = arguments[w];
1124
- if (s || !R[l]) {
1125
- var _ = d.timestampFormatter(/* @__PURE__ */ new Date()), y = d.levelFormatter(n), k = d.nameFormatter(l);
1126
- d.format ? g += d.format(y, k, _) : (g += d.template, p && (g = g.replace(/%t/, _)), u && (g = g.replace(/%l/, y)), h && (g = g.replace(/%n/, k))), f.length && typeof f[0] == "string" ? f[0] = g + " " + f[0] : f.unshift(g);
1122
+ for (var g = "", b = arguments.length, f = Array(b), v = 0; v < b; v++)
1123
+ f[v] = arguments[v];
1124
+ if (o || !R[l]) {
1125
+ var _ = h.timestampFormatter(/* @__PURE__ */ new Date()), k = h.levelFormatter(n), C = h.nameFormatter(l);
1126
+ h.format ? g += h.format(k, C, _) : (g += h.template, p && (g = g.replace(/%t/, _)), u && (g = g.replace(/%l/, k)), m && (g = g.replace(/%n/, C))), f.length && typeof f[0] == "string" ? f[0] = g + " " + f[0] : f.unshift(g);
1127
1127
  }
1128
1128
  c.apply(void 0, f);
1129
1129
  };
1130
1130
  }
1131
- return R[s] || (o.methodFactory = r), e = e || {}, e.template && (e.format = void 0), R[s] = is({}, i, e), o.setLevel(o.getLevel()), st || o.warn(
1131
+ return R[o] || (s.methodFactory = r), e = e || {}, e.template && (e.format = void 0), R[o] = ns({}, i, e), s.setLevel(s.getLevel()), at || s.warn(
1132
1132
  "It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md"
1133
- ), o;
1134
- }, ot = {
1135
- reg: ns,
1136
- apply: as
1133
+ ), s;
1134
+ }, ds = {
1135
+ reg: ls,
1136
+ apply: cs
1137
1137
  };
1138
- const it = {
1138
+ const hs = {
1139
1139
  debug: "#0ea5e9",
1140
1140
  // Blue
1141
1141
  info: "#10b981",
@@ -1145,79 +1145,55 @@ const it = {
1145
1145
  error: "#ef4444"
1146
1146
  // Red
1147
1147
  };
1148
- ot.reg(x);
1149
- ot.apply(x, {
1150
- format(o, e, t) {
1151
- return it[o.toLowerCase()], `%c[${t}]%c %c[${o}]%c ${e ? `%c[${e}]%c ` : ""}`;
1152
- },
1153
- timestampFormatter(o) {
1154
- return o.toTimeString().split(" ")[0] + "." + o.getMilliseconds().toString().padStart(3, "0");
1155
- }
1156
- });
1157
- const ls = x.methodFactory;
1158
- x.methodFactory = function(o, e, t) {
1159
- const s = ls(o, e, t);
1160
- return function(...i) {
1161
- if (i.length > 0 && typeof i[0] == "string" && i[0].includes("%c")) {
1162
- const r = it[o] || "#666", n = [
1163
- i[0],
1164
- `color: ${r}; font-weight: bold;`,
1165
- // timestamp color
1166
- "color: inherit;",
1167
- // reset
1168
- `color: ${r}; font-weight: bold;`,
1169
- // level color
1170
- "color: inherit;",
1171
- // reset
1172
- ...t ? [
1173
- `color: ${r}; font-weight: bold;`,
1174
- // name color
1175
- "color: inherit;"
1176
- // reset
1177
- ] : [],
1178
- ...i.slice(1)
1179
- ];
1180
- s(...n);
1181
- } else
1182
- s(...i);
1148
+ ds.reg(w);
1149
+ const ms = (s) => s.toTimeString().split(" ")[0] + "." + s.getMilliseconds().toString().padStart(3, "0"), ps = w.methodFactory;
1150
+ w.methodFactory = function(s, e, t) {
1151
+ const o = ps(s, e, t), r = `color: ${hs[s] || "#666"}; font-weight: bold;`, n = "color: inherit;";
1152
+ return function(...a) {
1153
+ const l = ms(/* @__PURE__ */ new Date()), c = s.toUpperCase(), h = t ? `%c[${l}]%c %c[${c}]%c %c[${t}]%c` : `%c[${l}]%c %c[${c}]%c`;
1154
+ o(h, ...t ? [r, n, r, n, r, n] : [r, n, r, n], ...a);
1183
1155
  };
1184
1156
  };
1185
- x.setLevel("silent");
1186
- const le = x.getLogger("MULTISELECT:INIT"), S = x.getLogger("MULTISELECT:DATA"), v = x.getLogger("MULTISELECT:UI"), T = x.getLogger("MULTISELECT:INTERACTION"), cs = [
1157
+ typeof w.setDefaultLevel == "function" ? w.setDefaultLevel("silent") : w.setLevel("silent", !1);
1158
+ const oe = w.getLogger("MULTISELECT:INIT"), x = w.getLogger("MULTISELECT:DATA"), M = w.getLogger("MULTISELECT:UI"), S = w.getLogger("MULTISELECT:INTERACTION"), us = [
1187
1159
  "MULTISELECT:INIT",
1188
1160
  "MULTISELECT:DATA",
1189
1161
  "MULTISELECT:UI",
1190
1162
  "MULTISELECT:INTERACTION"
1191
1163
  ];
1192
- function ds() {
1193
- x.setLevel("debug");
1164
+ function Le() {
1165
+ typeof w.rebuild == "function" && w.rebuild();
1194
1166
  }
1195
- function hs() {
1196
- x.setLevel("silent");
1167
+ function gs() {
1168
+ w.setLevel("debug"), Le();
1197
1169
  }
1198
- function ms(o) {
1199
- x.setLevel(o);
1170
+ function bs() {
1171
+ w.setLevel("silent"), Le();
1200
1172
  }
1201
- function ps(o, e) {
1202
- x.getLogger(o).setLevel(e);
1173
+ function fs(s) {
1174
+ w.setLevel(s), Le();
1203
1175
  }
1204
- class Ne {
1176
+ function vs(s, e) {
1177
+ const t = s.includes(":") ? s : `MULTISELECT:${s}`;
1178
+ w.getLogger(t).setLevel(e);
1179
+ }
1180
+ class We {
1205
1181
  constructor(e) {
1206
- m(this, "container");
1207
- m(this, "wrapper");
1208
- m(this, "viewport");
1209
- m(this, "itemHeight");
1210
- m(this, "items");
1211
- m(this, "renderItem");
1212
- m(this, "bufferSize");
1213
- m(this, "onVisibleRangeChange");
1214
- m(this, "onScroll");
1215
- m(this, "scrollTop", 0);
1216
- m(this, "viewportHeight", 0);
1217
- m(this, "visibleStart", 0);
1218
- m(this, "visibleEnd", 0);
1219
- m(this, "scrollHandler");
1220
- m(this, "resizeObserver");
1182
+ d(this, "container");
1183
+ d(this, "wrapper");
1184
+ d(this, "viewport");
1185
+ d(this, "itemHeight");
1186
+ d(this, "items");
1187
+ d(this, "renderItem");
1188
+ d(this, "bufferSize");
1189
+ d(this, "onVisibleRangeChange");
1190
+ d(this, "onScroll");
1191
+ d(this, "scrollTop", 0);
1192
+ d(this, "viewportHeight", 0);
1193
+ d(this, "visibleStart", 0);
1194
+ d(this, "visibleEnd", 0);
1195
+ d(this, "scrollHandler");
1196
+ d(this, "resizeObserver");
1221
1197
  this.container = e.container, this.itemHeight = e.itemHeight, this.items = e.items, this.renderItem = e.renderItem, this.bufferSize = e.bufferSize ?? 10, this.onVisibleRangeChange = e.onVisibleRangeChange, this.onScroll = e.onScroll, this.scrollHandler = this.handleScroll.bind(this), this.init();
1222
1198
  }
1223
1199
  /**
@@ -1251,8 +1227,8 @@ class Ne {
1251
1227
  * Calculate visible range based on scroll position
1252
1228
  */
1253
1229
  calculateVisibleRange() {
1254
- const e = Math.floor(this.scrollTop / this.itemHeight), t = Math.ceil((this.scrollTop + this.viewportHeight) / this.itemHeight), s = Math.max(0, e - this.bufferSize), i = Math.min(this.items.length, t + this.bufferSize);
1255
- return { start: s, end: i };
1230
+ const e = Math.floor(this.scrollTop / this.itemHeight), t = Math.ceil((this.scrollTop + this.viewportHeight) / this.itemHeight), o = Math.max(0, e - this.bufferSize), i = Math.min(this.items.length, t + this.bufferSize);
1231
+ return { start: o, end: i };
1256
1232
  }
1257
1233
  /**
1258
1234
  * Render visible items
@@ -1262,18 +1238,18 @@ class Ne {
1262
1238
  if (e === this.visibleStart && t === this.visibleEnd)
1263
1239
  return;
1264
1240
  this.visibleStart = e, this.visibleEnd = t, this.onVisibleRangeChange && this.onVisibleRangeChange(e, t);
1265
- let s = "";
1241
+ let o = "";
1266
1242
  for (let i = e; i < t; i++) {
1267
1243
  const r = this.items[i], n = this.renderItem(r, i), a = i * this.itemHeight;
1268
- s += `<div class="ms__virtual-item" style="position: absolute; top: ${a}px; left: 0; right: 0; height: ${this.itemHeight}px;" data-index="${i}">`, s += n, s += "</div>";
1244
+ o += `<div class="ms__virtual-item" style="position: absolute; top: ${a}px; left: 0; right: 0; height: ${this.itemHeight}px;" data-index="${i}">`, o += n, o += "</div>";
1269
1245
  }
1270
- this.viewport.innerHTML = s;
1246
+ this.viewport.innerHTML = o;
1271
1247
  }
1272
1248
  /**
1273
1249
  * Update items and re-render
1274
1250
  */
1275
1251
  setItems(e) {
1276
- const t = e !== this.items && e.length !== this.items.length;
1252
+ const t = e !== this.items || e.length !== this.items.length;
1277
1253
  this.items = e, this.wrapper.style.height = `${e.length * this.itemHeight}px`, this.updateViewportHeight(), t && (this.scrollTop = 0, this.container.scrollTop = 0), this.visibleStart = -1, this.visibleEnd = -1, this.render();
1278
1254
  }
1279
1255
  /**
@@ -1283,8 +1259,8 @@ class Ne {
1283
1259
  scrollToIndex(e) {
1284
1260
  if (e < 0 || e >= this.items.length)
1285
1261
  return;
1286
- const t = e * this.itemHeight, s = t + this.itemHeight, i = this.container.scrollTop, r = i + this.viewportHeight;
1287
- t < i ? this.container.scrollTop = t : s > r && (this.container.scrollTop = s - this.viewportHeight);
1262
+ const t = e * this.itemHeight, o = t + this.itemHeight, i = this.container.scrollTop, r = i + this.viewportHeight;
1263
+ t < i ? this.container.scrollTop = t : o > r && (this.container.scrollTop = o - this.viewportHeight);
1288
1264
  }
1289
1265
  /**
1290
1266
  * Get currently visible range
@@ -1323,56 +1299,108 @@ class Ne {
1323
1299
  this.container.removeEventListener("scroll", this.scrollHandler), this.resizeObserver && this.resizeObserver.disconnect(), this.container.innerHTML = "";
1324
1300
  }
1325
1301
  }
1326
- class us {
1302
+ class ws {
1303
+ constructor(e) {
1304
+ d(this, "element");
1305
+ d(this, "trigger");
1306
+ d(this, "container");
1307
+ d(this, "placement");
1308
+ d(this, "offsetDistance");
1309
+ d(this, "showDelay");
1310
+ d(this, "hideDelay");
1311
+ d(this, "visibleClass");
1312
+ d(this, "onBeforeShow");
1313
+ d(this, "showTimer", null);
1314
+ d(this, "hideTimer", null);
1315
+ d(this, "positionCleanup", null);
1316
+ d(this, "handleMouseEnter");
1317
+ d(this, "handleMouseLeave");
1318
+ this.trigger = e.trigger, this.container = e.container, this.placement = e.placement ?? "top", this.offsetDistance = e.offsetDistance ?? 8, this.showDelay = e.showDelay ?? 100, this.hideDelay = e.hideDelay ?? 100, this.visibleClass = e.visibleClass ?? "ms__badge-tooltip--visible", this.onBeforeShow = e.onBeforeShow, this.element = document.createElement("div"), this.element.className = e.cssClass ?? "ms__badge-tooltip", typeof e.content == "string" ? this.element.textContent = e.content : this.element.appendChild(e.content), this.container.appendChild(this.element), this.handleMouseEnter = () => this.scheduleShow(), this.handleMouseLeave = () => this.scheduleHide(), this.trigger.addEventListener("mouseenter", this.handleMouseEnter), this.trigger.addEventListener("mouseleave", this.handleMouseLeave);
1319
+ }
1320
+ scheduleShow() {
1321
+ this.hideTimer !== null && (clearTimeout(this.hideTimer), this.hideTimer = null), this.showTimer === null && (this.showTimer = window.setTimeout(() => {
1322
+ this.showTimer = null, this.show();
1323
+ }, this.showDelay));
1324
+ }
1325
+ scheduleHide() {
1326
+ this.showTimer !== null && (clearTimeout(this.showTimer), this.showTimer = null), this.hideTimer === null && (this.hideTimer = window.setTimeout(() => {
1327
+ this.hideTimer = null, this.hide();
1328
+ }, this.hideDelay));
1329
+ }
1330
+ show() {
1331
+ var e;
1332
+ (e = this.onBeforeShow) == null || e.call(this), this.element.classList.add(this.visibleClass), this.positionCleanup && this.positionCleanup(), this.positionCleanup = we(this.trigger, this.element, () => {
1333
+ ye(this.trigger, this.element, {
1334
+ placement: this.placement,
1335
+ strategy: "fixed",
1336
+ middleware: [
1337
+ _e(this.offsetDistance),
1338
+ it(),
1339
+ ke({ padding: 8 })
1340
+ ]
1341
+ }).then(({ x: t, y: o }) => {
1342
+ Object.assign(this.element.style, {
1343
+ left: `${t}px`,
1344
+ top: `${o}px`
1345
+ });
1346
+ });
1347
+ });
1348
+ }
1349
+ hide() {
1350
+ this.element.classList.remove(this.visibleClass), this.positionCleanup && (this.positionCleanup(), this.positionCleanup = null);
1351
+ }
1352
+ /** Hide synchronously (skip the hideDelay). Used by parent tooltips when a child tooltip is about to show. */
1353
+ hideImmediate() {
1354
+ this.showTimer !== null && (clearTimeout(this.showTimer), this.showTimer = null), this.hideTimer !== null && (clearTimeout(this.hideTimer), this.hideTimer = null), this.hide();
1355
+ }
1356
+ destroy() {
1357
+ this.showTimer !== null && clearTimeout(this.showTimer), this.hideTimer !== null && clearTimeout(this.hideTimer), this.showTimer = null, this.hideTimer = null, this.positionCleanup && (this.positionCleanup(), this.positionCleanup = null), this.trigger.removeEventListener("mouseenter", this.handleMouseEnter), this.trigger.removeEventListener("mouseleave", this.handleMouseLeave), this.element.remove();
1358
+ }
1359
+ }
1360
+ class _s {
1327
1361
  constructor(e, t = {}) {
1328
- m(this, "element");
1329
- m(this, "instanceId");
1330
- m(this, "options");
1331
- m(this, "isOpen", !1);
1332
- m(this, "selectedValues", /* @__PURE__ */ new Set());
1333
- m(this, "selectedOptions", /* @__PURE__ */ new Map());
1334
- m(this, "allOptions", []);
1335
- m(this, "filteredOptions", []);
1336
- m(this, "hiddenInputs", []);
1337
- m(this, "focusedIndex", -1);
1338
- m(this, "matchingIndices", /* @__PURE__ */ new Set());
1339
- m(this, "searchTerm", "");
1340
- m(this, "isLoading", !1);
1341
- m(this, "showSelectedPopover", !1);
1342
- m(this, "selectedPopoverPlacement", null);
1343
- m(this, "dropdownPlacement", null);
1344
- m(this, "isRTL", !1);
1345
- m(this, "effectiveBadgesPosition", "bottom");
1346
- m(this, "justClosedViaClick", !1);
1362
+ d(this, "element");
1363
+ d(this, "instanceId");
1364
+ d(this, "options");
1365
+ d(this, "isOpen", !1);
1366
+ d(this, "selectedValues", /* @__PURE__ */ new Set());
1367
+ d(this, "selectedOptions", /* @__PURE__ */ new Map());
1368
+ d(this, "allOptions", []);
1369
+ d(this, "filteredOptions", []);
1370
+ d(this, "hiddenInputs", []);
1371
+ d(this, "focusedIndex", -1);
1372
+ d(this, "matchingIndices", /* @__PURE__ */ new Set());
1373
+ d(this, "searchTerm", "");
1374
+ d(this, "isLoading", !1);
1375
+ d(this, "showSelectedPopover", !1);
1376
+ d(this, "selectedPopoverPlacement", null);
1377
+ d(this, "dropdownPlacement", null);
1378
+ d(this, "isRTL", !1);
1379
+ d(this, "effectiveBadgesPosition", "bottom");
1380
+ d(this, "justClosedViaClick", !1);
1347
1381
  // Floating UI cleanup functions
1348
- m(this, "dropdownCleanup", null);
1349
- m(this, "hintCleanup", null);
1350
- m(this, "selectedPopoverCleanup", null);
1351
- // Badge tooltip storage
1352
- m(this, "badgeTooltips", /* @__PURE__ */ new Map());
1353
- m(this, "badgeTooltipCleanups", /* @__PURE__ */ new Map());
1354
- m(this, "badgeTooltipShowTimeouts", /* @__PURE__ */ new Map());
1355
- m(this, "badgeTooltipHideTimeouts", /* @__PURE__ */ new Map());
1356
- // Action button tooltip storage
1357
- m(this, "actionButtonTooltips", /* @__PURE__ */ new Map());
1358
- m(this, "actionButtonTooltipCleanups", /* @__PURE__ */ new Map());
1382
+ d(this, "dropdownCleanup", null);
1383
+ d(this, "hintCleanup", null);
1384
+ d(this, "selectedPopoverCleanup", null);
1385
+ // All hover tooltips (badge text, badge-remove buttons, action buttons), keyed by id.
1386
+ d(this, "tooltips", /* @__PURE__ */ new Map());
1359
1387
  // Virtual scroll instance
1360
- m(this, "virtualScroll", null);
1361
- m(this, "optionsContainer", null);
1362
- m(this, "selectedPopoverVirtualScroll", null);
1363
- m(this, "selectedPopoverContainer", null);
1388
+ d(this, "virtualScroll", null);
1389
+ d(this, "optionsContainer", null);
1390
+ d(this, "selectedPopoverVirtualScroll", null);
1391
+ d(this, "selectedPopoverContainer", null);
1364
1392
  // DOM elements
1365
- m(this, "input");
1366
- m(this, "dropdown");
1367
- m(this, "dropdownInner");
1368
- m(this, "badgesContainer");
1369
- m(this, "counter");
1370
- m(this, "hint");
1371
- m(this, "selectedPopover");
1393
+ d(this, "input");
1394
+ d(this, "dropdown");
1395
+ d(this, "dropdownInner");
1396
+ d(this, "badgesContainer");
1397
+ d(this, "counter");
1398
+ d(this, "hint");
1399
+ d(this, "selectedPopover");
1372
1400
  // Document-level event handlers (stored for cleanup)
1373
- m(this, "documentKeydownHandler", null);
1374
- m(this, "documentClickHandler", null);
1375
- this.element = e, this.instanceId = `MS-${Math.random().toString(36).substr(2, 9)}`, this.options = {
1401
+ d(this, "documentKeydownHandler", null);
1402
+ d(this, "documentClickHandler", null);
1403
+ this.element = e, this.instanceId = `MS-${Math.random().toString(36).slice(2, 11)}`, this.options = {
1376
1404
  // String options
1377
1405
  searchHint: e.dataset.searchHint || "",
1378
1406
  searchPlaceholder: e.dataset.searchPlaceholder || "Search...",
@@ -1412,75 +1440,104 @@ class us {
1412
1440
  // DATA EXTRACTION METHODS (following svelte-treeview pattern)
1413
1441
  // ========================================================================
1414
1442
  /**
1415
- * Extract value/ID from item
1416
- * Precedence: tuple[0] -> valueMember -> getValueCallback -> '[N/A]'
1443
+ * Generic field extractor with the precedence:
1444
+ * tuple short-circuit -> member property -> callback -> fallback
1445
+ *
1446
+ * Tuple handling:
1447
+ * - `tupleIndex` (0 | 1): for `[key, value]` items, return that slot.
1448
+ * - `tupleSkip: true`: for any tuple, skip directly to fallback (used for icon/subtitle/group/disabled —
1449
+ * fields that don't make sense on a 2-element array).
1450
+ * - neither: tuples flow through the member/callback/fallback chain as if they were objects.
1451
+ *
1452
+ * `transform` is applied to tuple-slot and member-property reads (not to callback returns or the fallback),
1453
+ * so e.g. you can pass `String` to coerce numeric members to strings while letting a typed callback return its
1454
+ * own type unchanged.
1417
1455
  */
1456
+ extractField(e, t) {
1457
+ if (Array.isArray(e) && e.length === 2) {
1458
+ if (t.tupleSkip)
1459
+ return typeof t.fallback == "function" ? t.fallback() : t.fallback;
1460
+ if (t.tupleIndex !== void 0) {
1461
+ const i = e[t.tupleIndex];
1462
+ return t.transform ? t.transform(i) : i;
1463
+ }
1464
+ }
1465
+ if (t.member && e[t.member] !== void 0) {
1466
+ const i = e[t.member];
1467
+ return t.transform ? t.transform(i) : i;
1468
+ }
1469
+ return t.callback ? t.callback(e) : typeof t.fallback == "function" ? t.fallback() : t.fallback;
1470
+ }
1418
1471
  getItemValue(e) {
1419
- return Array.isArray(e) && e.length === 2 ? e[0] : this.options.valueMember && e[this.options.valueMember] !== void 0 ? e[this.options.valueMember] : this.options.getValueCallback ? this.options.getValueCallback(e) : "[N/A]";
1472
+ return this.extractField(e, {
1473
+ tupleIndex: 0,
1474
+ member: this.options.valueMember,
1475
+ callback: this.options.getValueCallback,
1476
+ fallback: "[N/A]"
1477
+ });
1420
1478
  }
1421
- /**
1422
- * Extract display value from item
1423
- * Precedence: tuple[1] -> displayValueMember -> getDisplayValueCallback -> '[N/A]'
1424
- */
1425
1479
  getItemDisplayValue(e) {
1426
- return Array.isArray(e) && e.length === 2 ? String(e[1]) : this.options.displayValueMember && e[this.options.displayValueMember] !== void 0 ? String(e[this.options.displayValueMember]) : this.options.getDisplayValueCallback ? this.options.getDisplayValueCallback(e) : "[N/A]";
1480
+ return this.extractField(e, {
1481
+ tupleIndex: 1,
1482
+ member: this.options.displayValueMember,
1483
+ callback: this.options.getDisplayValueCallback,
1484
+ transform: String,
1485
+ fallback: "[N/A]"
1486
+ });
1427
1487
  }
1428
1488
  /**
1429
- * Extract badge display value from item
1430
- * Precedence: getBadgeDisplayCallback -> getItemDisplayValue()
1431
- * This allows customizing badge text separately from dropdown display text
1489
+ * Badge display falls back to the regular display value rather than '[N/A]', so consumers can override badge
1490
+ * text independently. Doesn't fit the extractField shape (no tuple/member layer of its own).
1432
1491
  */
1433
1492
  getItemBadgeDisplayValue(e) {
1434
1493
  return this.options.getBadgeDisplayCallback ? this.options.getBadgeDisplayCallback(e) : this.getItemDisplayValue(e);
1435
1494
  }
1436
- /**
1437
- * Extract search value from item
1438
- * Precedence: searchValueMember -> getSearchValueCallback -> displayValue
1439
- */
1440
1495
  getItemSearchValue(e) {
1441
- return this.options.searchValueMember && e[this.options.searchValueMember] !== void 0 ? String(e[this.options.searchValueMember]) : this.options.getSearchValueCallback ? this.options.getSearchValueCallback(e) : this.getItemDisplayValue(e);
1496
+ return this.extractField(e, {
1497
+ member: this.options.searchValueMember,
1498
+ callback: this.options.getSearchValueCallback,
1499
+ transform: String,
1500
+ fallback: () => this.getItemDisplayValue(e)
1501
+ });
1442
1502
  }
1443
- /**
1444
- * Extract icon from item
1445
- */
1446
1503
  getItemIcon(e) {
1447
- if (!Array.isArray(e)) {
1448
- if (this.options.iconMember && e[this.options.iconMember] !== void 0)
1449
- return String(e[this.options.iconMember]);
1450
- if (this.options.getIconCallback)
1451
- return this.options.getIconCallback(e);
1452
- }
1504
+ return this.extractField(e, {
1505
+ tupleSkip: !0,
1506
+ member: this.options.iconMember,
1507
+ callback: this.options.getIconCallback,
1508
+ transform: String,
1509
+ fallback: void 0
1510
+ });
1453
1511
  }
1454
- /**
1455
- * Extract subtitle from item
1456
- */
1457
1512
  getItemSubtitle(e) {
1458
- if (!Array.isArray(e)) {
1459
- if (this.options.subtitleMember && e[this.options.subtitleMember] !== void 0)
1460
- return String(e[this.options.subtitleMember]);
1461
- if (this.options.getSubtitleCallback)
1462
- return this.options.getSubtitleCallback(e);
1463
- }
1513
+ return this.extractField(e, {
1514
+ tupleSkip: !0,
1515
+ member: this.options.subtitleMember,
1516
+ callback: this.options.getSubtitleCallback,
1517
+ transform: String,
1518
+ fallback: void 0
1519
+ });
1464
1520
  }
1465
- /**
1466
- * Extract group from item
1467
- */
1468
1521
  getItemGroup(e) {
1469
- if (!Array.isArray(e)) {
1470
- if (this.options.groupMember && e[this.options.groupMember] !== void 0)
1471
- return String(e[this.options.groupMember]);
1472
- if (this.options.getGroupCallback)
1473
- return this.options.getGroupCallback(e);
1474
- }
1522
+ return this.extractField(e, {
1523
+ tupleSkip: !0,
1524
+ member: this.options.groupMember,
1525
+ callback: this.options.getGroupCallback,
1526
+ transform: String,
1527
+ fallback: void 0
1528
+ });
1475
1529
  }
1476
- /**
1477
- * Extract disabled state from item
1478
- */
1479
1530
  getItemDisabled(e) {
1480
- return Array.isArray(e) ? !1 : this.options.disabledMember && e[this.options.disabledMember] !== void 0 ? !!e[this.options.disabledMember] : this.options.getDisabledCallback ? this.options.getDisabledCallback(e) : !1;
1531
+ return this.extractField(e, {
1532
+ tupleSkip: !0,
1533
+ member: this.options.disabledMember,
1534
+ callback: this.options.getDisabledCallback,
1535
+ transform: Boolean,
1536
+ fallback: !1
1537
+ });
1481
1538
  }
1482
1539
  init() {
1483
- this.parseOptions(), this.buildHTML(), this.attachEvents(), this.parseInitialSelection(), le.debug(`Initialized [${this.instanceId}] with options:`, {
1540
+ this.parseOptions(), this.buildHTML(), this.attachEvents(), this.parseInitialSelection(), oe.debug(`Initialized [${this.instanceId}] with options:`, {
1484
1541
  placeholder: this.options.searchPlaceholder,
1485
1542
  totalOptions: this.allOptions.length,
1486
1543
  isCloseOnSelect: this.options.isCloseOnSelect,
@@ -1493,21 +1550,21 @@ class us {
1493
1550
  try {
1494
1551
  this.allOptions = JSON.parse(e);
1495
1552
  } catch (t) {
1496
- S.error(`[${this.instanceId}] Failed to parse data-options:`, t), this.allOptions = [];
1553
+ x.error(`[${this.instanceId}] Failed to parse data-options:`, t), this.allOptions = [];
1497
1554
  }
1498
1555
  else this.options.options && (this.allOptions = this.options.options);
1499
1556
  this.filteredOptions = [...this.allOptions];
1500
1557
  }
1501
1558
  buildHTML() {
1502
- const e = this.options.container || document.body, t = this.element.getRootNode(), s = t instanceof ShadowRoot ? t.host : this.element, i = s.getAttribute("dir") === "rtl", r = s.closest('[dir="rtl"]') !== null;
1503
- this.isRTL = i || r, le.debug(`[${this.instanceId}] RTL Debug:`, {
1559
+ const e = this.options.container || document.body, t = this.element.getRootNode(), o = t instanceof ShadowRoot ? t.host : this.element, i = o.getAttribute("dir") === "rtl", r = o.closest('[dir="rtl"]') !== null;
1560
+ this.isRTL = i || r, oe.debug(`[${this.instanceId}] RTL Debug:`, {
1504
1561
  isShadowRoot: t instanceof ShadowRoot,
1505
- hostElement: s,
1506
- elementDir: s.getAttribute("dir"),
1562
+ hostElement: o,
1563
+ elementDir: o.getAttribute("dir"),
1507
1564
  hasElementDir: i,
1508
1565
  hasAncestorDir: r,
1509
1566
  isRTL: this.isRTL
1510
- }), this.effectiveBadgesPosition = this.options.badgesPosition || "bottom", this.isRTL && (this.effectiveBadgesPosition === "left" ? this.effectiveBadgesPosition = "right" : this.effectiveBadgesPosition === "right" && (this.effectiveBadgesPosition = "left")), this.element.classList.add("ms"), this.isRTL && (this.element.classList.add("ms--rtl"), le.debug(`[${this.instanceId}] Added ms--rtl class to element`)), (!this.options.isCheckboxesShown || !this.options.isMultipleEnabled) && this.element.classList.add("ms--no-checkboxes");
1567
+ }), this.effectiveBadgesPosition = this.options.badgesPosition || "bottom", this.isRTL && (this.effectiveBadgesPosition === "left" ? this.effectiveBadgesPosition = "right" : this.effectiveBadgesPosition === "right" && (this.effectiveBadgesPosition = "left")), this.element.classList.add("ms"), this.isRTL && (this.element.classList.add("ms--rtl"), oe.debug(`[${this.instanceId}] Added ms--rtl class to element`)), (!this.options.isCheckboxesShown || !this.options.isMultipleEnabled) && this.element.classList.add("ms--no-checkboxes");
1511
1568
  const n = document.createElement("div");
1512
1569
  n.className = "ms__input-wrapper", this.input = document.createElement("input"), this.input.type = "text", this.input.className = "ms__input", this.input.placeholder = this.options.searchPlaceholder, this.input.autocomplete = "off", this.options.searchInputMode === "readonly" ? this.input.readOnly = !0 : this.options.searchInputMode === "hidden" && (this.input.style.display = "none");
1513
1570
  const a = document.createElement("span");
@@ -1543,42 +1600,28 @@ class us {
1543
1600
  e += '<div class="ms__loader">', e += '<div class="pa-loader pa-loader--sm"></div>', e += `<div class="ms__loading-text">${this.options.loadingMessage}</div>`, e += "</div>", this.dropdownInner.innerHTML = e;
1544
1601
  return;
1545
1602
  }
1546
- if (this.options.isMultipleEnabled && this.options.actionButtons && this.options.actionButtons.length > 0) {
1547
- const t = this.options.isActionsSticky ? " ms__actions--sticky" : "", s = this.options.actionsLayout === "wrap" ? " ms__actions--wrap" : "";
1548
- e += `<div class="ms__actions${t}${s}">`, this.options.actionButtons.forEach((i) => {
1549
- if (!(i.isVisibleCallback ? i.isVisibleCallback(this) : i.isVisible ?? !0))
1550
- return;
1551
- const a = (i.isDisabledCallback ? i.isDisabledCallback(this) : i.isDisabled ?? !1) ? " disabled" : "", l = i.getTextCallback ? i.getTextCallback(this) : i.text;
1552
- let c = "";
1553
- if (i.getClassCallback) {
1554
- const d = i.getClassCallback(this);
1555
- c = Array.isArray(d) ? ` ${d.join(" ")}` : d ? ` ${d}` : "";
1556
- } else i.cssClass && (c = ` ${i.cssClass}`);
1557
- e += `<button type="button"${a} class="ms__action-btn${c}" data-action="${i.action}">${l}</button>`;
1558
- }), e += "</div>";
1559
- }
1560
- if (e += '<div class="ms__options">', this.filteredOptions.length === 0)
1603
+ if (e += this.renderActionsHTML(), e += '<div class="ms__options">', this.filteredOptions.length === 0)
1561
1604
  e += `<div class="ms__empty">${this.options.emptyMessage}</div>`;
1562
1605
  else if (this.options.isGroupsAllowed) {
1563
- const t = this.groupOptions(this.filteredOptions);
1564
- Object.keys(t).forEach((s) => {
1565
- if (e += '<div class="ms__group">', s !== "__ungrouped__")
1606
+ const t = this.groupOptions(this.filteredOptions), o = /* @__PURE__ */ new Map();
1607
+ this.filteredOptions.forEach((i, r) => o.set(i, r)), Object.keys(t).forEach((i) => {
1608
+ if (e += '<div class="ms__group">', i !== "__ungrouped__")
1566
1609
  if (this.options.renderGroupLabelContentCallback) {
1567
- const i = this.options.renderGroupLabelContentCallback(s);
1568
- if (i instanceof HTMLElement) {
1569
- const r = document.createElement("div");
1570
- r.className = "ms__group-label", r.appendChild(i), e += r.outerHTML;
1610
+ const r = this.options.renderGroupLabelContentCallback(i);
1611
+ if (r instanceof HTMLElement) {
1612
+ const n = document.createElement("div");
1613
+ n.className = "ms__group-label", n.appendChild(r), e += n.outerHTML;
1571
1614
  } else
1572
- e += `<div class="ms__group-label">${i}</div>`;
1615
+ e += `<div class="ms__group-label">${r}</div>`;
1573
1616
  } else
1574
- e += `<div class="ms__group-label">${s}</div>`;
1575
- t[s].forEach((i, r) => {
1576
- e += this.renderOption(i, r);
1617
+ e += `<div class="ms__group-label">${i}</div>`;
1618
+ t[i].forEach((r) => {
1619
+ e += this.renderOption(r, o.get(r) ?? -1);
1577
1620
  }), e += "</div>";
1578
1621
  });
1579
1622
  } else
1580
- this.filteredOptions.forEach((t, s) => {
1581
- e += this.renderOption(t, s);
1623
+ this.filteredOptions.forEach((t, o) => {
1624
+ e += this.renderOption(t, o);
1582
1625
  });
1583
1626
  e += "</div>", this.dropdownInner.innerHTML = e, this.attachActionButtonTooltips();
1584
1627
  }
@@ -1587,23 +1630,10 @@ class us {
1587
1630
  */
1588
1631
  renderDropdownVirtual() {
1589
1632
  if (this.destroyAllActionButtonTooltips(), !this.virtualScroll) {
1590
- let s = "";
1591
- if (this.options.isMultipleEnabled && this.options.actionButtons && this.options.actionButtons.length > 0) {
1592
- const n = this.options.isActionsSticky ? " ms__actions--sticky" : "", a = this.options.actionsLayout === "wrap" ? " ms__actions--wrap" : "";
1593
- s += `<div class="ms__actions${n}${a}">`, this.options.actionButtons.forEach((l) => {
1594
- if (!(l.isVisibleCallback ? l.isVisibleCallback(this) : l.isVisible ?? !0))
1595
- return;
1596
- const p = (l.isDisabledCallback ? l.isDisabledCallback(this) : l.isDisabled ?? !1) ? " disabled" : "", u = l.getTextCallback ? l.getTextCallback(this) : l.text;
1597
- let h = "";
1598
- if (l.getClassCallback) {
1599
- const g = l.getClassCallback(this);
1600
- h = Array.isArray(g) ? ` ${g.join(" ")}` : g ? ` ${g}` : "";
1601
- } else l.cssClass && (h = ` ${l.cssClass}`);
1602
- s += `<button type="button"${p} class="ms__action-btn${h}" data-action="${l.action}">${u}</button>`;
1603
- }), s += "</div>";
1604
- }
1633
+ let o = "";
1634
+ o += this.renderActionsHTML();
1605
1635
  const i = this.options.maxHeight || "20rem", r = this.options.optionHeight ?? 50;
1606
- s += `<div class="ms__options ms__options--virtual" style="height: ${i}; max-height: ${i}; overflow-y: auto; position: relative; --ms-option-height: ${r}px;"></div>`, this.dropdownInner.innerHTML = s, this.optionsContainer = this.dropdownInner.querySelector(".ms__options");
1636
+ o += `<div class="ms__options ms__options--virtual" style="height: ${i}; max-height: ${i}; overflow-y: auto; position: relative; --ms-option-height: ${r}px;"></div>`, this.dropdownInner.innerHTML = o, this.optionsContainer = this.dropdownInner.querySelector(".ms__options");
1607
1637
  }
1608
1638
  if (this.filteredOptions.length === 0) {
1609
1639
  this.virtualScroll && (this.virtualScroll.destroy(), this.virtualScroll = null), this.optionsContainer.innerHTML = `<div class="ms__empty">${this.options.emptyMessage}</div>`;
@@ -1611,43 +1641,62 @@ class us {
1611
1641
  }
1612
1642
  const e = this.options.optionHeight ?? 50, t = this.options.virtualScrollBuffer ?? 10;
1613
1643
  requestAnimationFrame(() => {
1614
- this.optionsContainer && (this.virtualScroll ? this.virtualScroll.setItems(this.filteredOptions) : this.virtualScroll = new Ne({
1644
+ this.optionsContainer && (this.virtualScroll ? this.virtualScroll.setItems(this.filteredOptions) : this.virtualScroll = new We({
1615
1645
  container: this.optionsContainer,
1616
1646
  itemHeight: e,
1617
1647
  items: this.filteredOptions,
1618
- renderItem: (s, i) => this.renderOption(s, i),
1648
+ renderItem: (o, i) => this.renderOption(o, i),
1619
1649
  bufferSize: t
1620
1650
  }), this.attachActionButtonTooltips());
1621
1651
  });
1622
1652
  }
1653
+ /**
1654
+ * Render the Select All / Clear All / custom action buttons row.
1655
+ * Returns the empty string if multiple-select is off or no buttons are configured.
1656
+ */
1657
+ renderActionsHTML() {
1658
+ const e = this.options.actionButtons;
1659
+ if (!this.options.isMultipleEnabled || !e || e.length === 0) return "";
1660
+ const t = this.options.isActionsSticky ? " ms__actions--sticky" : "", o = this.options.actionsLayout === "wrap" ? " ms__actions--wrap" : "", i = e.map((r, n) => {
1661
+ if (!(r.isVisibleCallback ? r.isVisibleCallback(this) : r.isVisible ?? !0)) return "";
1662
+ const c = (r.isDisabledCallback ? r.isDisabledCallback(this) : r.isDisabled ?? !1) ? " disabled" : "", h = r.getTextCallback ? r.getTextCallback(this) : r.text;
1663
+ let p = "";
1664
+ if (r.getClassCallback) {
1665
+ const u = r.getClassCallback(this);
1666
+ p = Array.isArray(u) ? ` ${u.join(" ")}` : u ? ` ${u}` : "";
1667
+ } else r.cssClass && (p = ` ${r.cssClass}`);
1668
+ return `<button type="button"${c} class="ms__action-btn${p}" data-action="${r.action}" data-button-index="${n}">${h}</button>`;
1669
+ }).join("");
1670
+ return `<div class="ms__actions${t}${o}">${i}</div>`;
1671
+ }
1623
1672
  renderOption(e, t) {
1624
- const s = this.getItemValue(e), i = this.getItemDisplayValue(e), r = this.getItemIcon(e), n = this.getItemSubtitle(e), a = this.getItemDisabled(e), l = this.selectedValues.has(String(s)), c = t === this.focusedIndex, d = this.matchingIndices.has(t), p = ["ms__option"];
1625
- l && p.push("ms__option--selected"), c && p.push("ms__option--focused"), d && p.push("ms__option--matched"), a && p.push("ms__option--disabled");
1673
+ const o = this.getItemValue(e), i = this.getItemDisplayValue(e), r = this.getItemIcon(e), n = this.getItemSubtitle(e), a = this.getItemDisabled(e), l = this.selectedValues.has(String(o)), c = t === this.focusedIndex, h = this.matchingIndices.has(t), p = ["ms__option"];
1674
+ l && p.push("ms__option--selected"), c && p.push("ms__option--focused"), h && p.push("ms__option--matched"), a && p.push("ms__option--disabled");
1626
1675
  const u = this.options.checkboxAlign && this.options.checkboxAlign !== "center" ? ` data-checkbox-align="${this.options.checkboxAlign}"` : "";
1627
- let h = `<div class="${p.join(" ")}" data-value="${s}" data-index="${t}"${u}>`;
1628
- if (this.options.isCheckboxesShown && this.options.isMultipleEnabled && (h += `<input type="checkbox" class="ms__checkbox" ${l ? "checked" : ""} ${a ? "disabled" : ""}>`), h += '<div class="ms__option-content">', this.options.renderOptionContentCallback) {
1676
+ let m = `<div class="${p.join(" ")}" data-value="${o}" data-index="${t}"${u}>`;
1677
+ if (this.options.isCheckboxesShown && this.options.isMultipleEnabled && (m += `<input type="checkbox" class="ms__checkbox" ${l ? "checked" : ""} ${a ? "disabled" : ""}>`), m += '<div class="ms__option-content">', this.options.renderOptionContentCallback) {
1629
1678
  const g = {
1630
1679
  index: t,
1631
1680
  isSelected: l,
1632
1681
  isFocused: c,
1633
- isMatched: d,
1682
+ isMatched: h,
1634
1683
  isDisabled: a
1635
1684
  }, b = this.options.renderOptionContentCallback(e, g);
1636
- typeof b == "string" ? h += b : h += b.outerHTML;
1685
+ typeof b == "string" ? m += b : m += b.outerHTML;
1637
1686
  } else
1638
- r && (h += `<span class="ms__option-icon">${r}</span>`), h += '<div class="ms__option-text">', h += `<div class="ms__option-title">${this.highlightMatch(i, this.searchTerm)}</div>`, n && (h += `<div class="ms__option-subtitle">${n}</div>`), h += "</div>";
1639
- return h += "</div>", h += "</div>", h;
1687
+ r && (m += `<span class="ms__option-icon">${r}</span>`), m += '<div class="ms__option-text">', m += `<div class="ms__option-title">${this.highlightMatch(i, this.searchTerm)}</div>`, n && (m += `<div class="ms__option-subtitle">${n}</div>`), m += "</div>";
1688
+ return m += "</div>", m += "</div>", m;
1640
1689
  }
1641
1690
  highlightMatch(e, t) {
1642
1691
  if (!t) return e;
1643
- const s = new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "gi");
1644
- return e.replace(s, "<mark>$1</mark>");
1692
+ const o = new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "gi");
1693
+ return e.replace(o, "<mark>$1</mark>");
1645
1694
  }
1646
1695
  groupOptions(e) {
1647
1696
  const t = {};
1648
- return e.forEach((s) => {
1649
- const i = this.getItemGroup(s) || "__ungrouped__";
1650
- t[i] || (t[i] = []), t[i].push(s);
1697
+ return e.forEach((o) => {
1698
+ const i = this.getItemGroup(o) || "__ungrouped__";
1699
+ t[i] || (t[i] = []), t[i].push(o);
1651
1700
  }), t;
1652
1701
  }
1653
1702
  renderBadges() {
@@ -1656,75 +1705,25 @@ class us {
1656
1705
  if (!this.options.isMultipleEnabled) {
1657
1706
  this.badgesContainer.innerHTML = "", this.counter.style.display = "none";
1658
1707
  let r;
1659
- e[0] && (this.options.renderSelectedContentCallback ? r = this.options.renderSelectedContentCallback(e[0]) : r = this.getItemDisplayValue(e[0])), v.warn(`[${this.instanceId}] renderBadges() single-select mode`, {
1660
- isOpen: this.isOpen,
1661
- count: t,
1662
- selectedOptionsLength: e.length,
1663
- willSetValue: !this.isOpen && t > 0 && e.length > 0,
1664
- selectedLabel: r
1665
- }), !this.isOpen && t > 0 && e.length > 0 ? (v.info(`[${this.instanceId}] ✅ SETTING input.value = "${r}"`), this.input.value = r, v.info(`[${this.instanceId}] 🔍 VERIFY input.value = "${this.input.value}"`)) : this.isOpen ? v.info(`[${this.instanceId}] ⏭️ SKIPPING input update (dropdown is open)`) : (v.info(`[${this.instanceId}] ❌ CLEARING input.value (no selection)`), this.input.value = "");
1708
+ e[0] && (this.options.renderSelectedContentCallback ? r = this.options.renderSelectedContentCallback(e[0]) : r = this.getItemDisplayValue(e[0])), !this.isOpen && t > 0 && e.length > 0 ? this.input.value = r : this.isOpen || (this.input.value = "");
1666
1709
  return;
1667
1710
  }
1668
- let s = this.options.badgesDisplayMode;
1669
- if (this.options.badgesThreshold !== null && t > this.options.badgesThreshold && s !== "none" && (s = this.options.badgesThresholdMode || "count"), !this.isOpen)
1670
- if (t > 0 && s === "count") {
1711
+ let o = this.options.badgesDisplayMode;
1712
+ if (this.options.badgesThreshold !== null && t > this.options.badgesThreshold && o !== "none" && (o = this.options.badgesThresholdMode || "count"), !this.isOpen)
1713
+ if (t > 0 && o === "count") {
1671
1714
  const r = this.options.getCounterCallback ? this.options.getCounterCallback(t) : `${t} selected`;
1672
1715
  this.input.placeholder = r;
1673
1716
  } else
1674
1717
  this.input.placeholder = this.options.searchPlaceholder;
1675
- if (this.options.isCounterShown && t > 0 ? (this.counter.textContent = `[${t}]`, this.counter.style.display = "") : this.counter.style.display = "none", s === "none") {
1718
+ if (this.options.isCounterShown && t > 0 ? (this.counter.textContent = `[${t}]`, this.counter.style.display = "") : this.counter.style.display = "none", o === "none") {
1676
1719
  this.badgesContainer.innerHTML = "";
1677
1720
  return;
1678
1721
  }
1679
- if (s === "badges")
1680
- this.badgesContainer.className = `ms__badges ms__badges--${this.effectiveBadgesPosition}`, this.badgesContainer.innerHTML = e.map((r) => {
1681
- const n = this.getItemValue(r);
1682
- let a;
1683
- if (this.options.renderBadgeContentCallback) {
1684
- const c = {
1685
- displayMode: "badges",
1686
- isInPopover: !1
1687
- }, d = this.options.renderBadgeContentCallback(r, c);
1688
- a = typeof d == "string" ? d : d.outerHTML;
1689
- } else
1690
- a = this.getItemBadgeDisplayValue(r);
1691
- let l = "ms__badge";
1692
- if (this.options.getBadgeClassCallback) {
1693
- const c = this.options.getBadgeClassCallback(r), d = Array.isArray(c) ? c : [c];
1694
- l += " " + d.filter((p) => p).join(" ");
1695
- }
1696
- return `
1697
- <div class="${l}">
1698
- <span class="ms__badge-text">${a}</span>
1699
- <button type="button" class="ms__badge-remove" data-value="${n}" aria-label="Remove ${this.getItemBadgeDisplayValue(r)}"></button>
1700
- </div>
1701
- `;
1702
- }).join("");
1703
- else if (s === "partial") {
1722
+ if (o === "badges")
1723
+ this.badgesContainer.className = `ms__badges ms__badges--${this.effectiveBadgesPosition}`, this.badgesContainer.innerHTML = e.map((r) => this.renderBadgeHTML(r, { displayMode: "badges", isInPopover: !1 })).join("");
1724
+ else if (o === "partial") {
1704
1725
  this.badgesContainer.className = `ms__badges ms__badges--${this.effectiveBadgesPosition}`;
1705
- const r = this.options.badgesMaxVisible || 3, n = e.slice(0, r), a = t - r, l = n.map((d) => {
1706
- const p = this.getItemValue(d);
1707
- let u;
1708
- if (this.options.renderBadgeContentCallback) {
1709
- const g = {
1710
- displayMode: "partial",
1711
- isInPopover: !1
1712
- }, b = this.options.renderBadgeContentCallback(d, g);
1713
- u = typeof b == "string" ? b : b.outerHTML;
1714
- } else
1715
- u = this.getItemBadgeDisplayValue(d);
1716
- let h = "ms__badge";
1717
- if (this.options.getBadgeClassCallback) {
1718
- const g = this.options.getBadgeClassCallback(d), b = Array.isArray(g) ? g : [g];
1719
- h += " " + b.filter((f) => f).join(" ");
1720
- }
1721
- return `
1722
- <div class="${h}">
1723
- <span class="ms__badge-text">${u}</span>
1724
- <button type="button" class="ms__badge-remove" data-value="${p}" aria-label="Remove ${this.getItemBadgeDisplayValue(d)}"></button>
1725
- </div>
1726
- `;
1727
- }).join("");
1726
+ const r = this.options.badgesMaxVisible || 3, n = e.slice(0, r), a = t - r, l = n.map((h) => this.renderBadgeHTML(h, { displayMode: "partial", isInPopover: !1 })).join("");
1728
1727
  let c = "";
1729
1728
  a > 0 && (c = `
1730
1729
  <div class="ms__badge ms__badge--counter ms__badge--more" data-action="show-selected">
@@ -1732,7 +1731,7 @@ class us {
1732
1731
  <button type="button" class="ms__badge-remove" data-action="remove-hidden" aria-label="Remove ${a} hidden items"></button>
1733
1732
  </div>
1734
1733
  `), this.badgesContainer.innerHTML = l + c;
1735
- } else if (s === "compact")
1734
+ } else if (o === "compact")
1736
1735
  if (this.badgesContainer.className = `ms__badges ms__badges--${this.effectiveBadgesPosition}`, t > 0) {
1737
1736
  const r = e[0], n = this.getItemBadgeDisplayValue(r), a = t - 1;
1738
1737
  let l = n;
@@ -1777,8 +1776,8 @@ class us {
1777
1776
  }, document.addEventListener("keydown", this.documentKeydownHandler), this.dropdown.addEventListener("click", (e) => this.handleDropdownClick(e)), this.dropdownInner.addEventListener("wheel", (e) => {
1778
1777
  if (this.virtualScroll)
1779
1778
  return;
1780
- const t = e.currentTarget, s = t.scrollTop === 0, i = t.scrollTop + t.clientHeight >= t.scrollHeight;
1781
- (e.deltaY < 0 && s || e.deltaY > 0 && i) && e.preventDefault(), e.stopPropagation();
1779
+ const t = e.currentTarget, o = t.scrollTop === 0, i = t.scrollTop + t.clientHeight >= t.scrollHeight;
1780
+ (e.deltaY < 0 && o || e.deltaY > 0 && i) && e.preventDefault(), e.stopPropagation();
1782
1781
  }, { passive: !1 }), this.badgesContainer.addEventListener("mousedown", (e) => {
1783
1782
  e.target.closest('[data-action="show-selected"]') && !this.showSelectedPopover && e.stopPropagation();
1784
1783
  }), this.badgesContainer.addEventListener("click", (e) => this.handleBadgeClick(e)), this.counter.addEventListener("mousedown", (e) => {
@@ -1792,41 +1791,41 @@ class us {
1792
1791
  return;
1793
1792
  let t = e;
1794
1793
  if (this.options.beforeSearchCallback) {
1795
- const s = this.options.beforeSearchCallback(e);
1796
- if (s === null) {
1797
- S.debug(`[${this.instanceId}] beforeSearchCallback blocked search for term:`, e), this.filteredOptions = [...this.allOptions], this.matchingIndices.clear(), this.renderDropdown();
1794
+ const o = this.options.beforeSearchCallback(e);
1795
+ if (o === null) {
1796
+ x.debug(`[${this.instanceId}] beforeSearchCallback blocked search for term:`, e), this.filteredOptions = [...this.allOptions], this.matchingIndices.clear(), this.renderDropdown();
1798
1797
  return;
1799
1798
  }
1800
- t = s, t !== e && S.debug(`[${this.instanceId}] beforeSearchCallback transformed: "${e}" -> "${t}"`);
1799
+ t = o, t !== e && x.debug(`[${this.instanceId}] beforeSearchCallback transformed: "${e}" -> "${t}"`);
1801
1800
  }
1802
1801
  if (this.options.searchCallback) {
1803
1802
  if (t.length < this.options.minSearchLength) {
1804
- this.isLoading = !1, this.options.isKeepOptionsOnSearch ? (this.filteredOptions = [...this.allOptions], S.debug(`[${this.instanceId}] Search term below minimum, showing ${this.allOptions.length} initial options`)) : this.filteredOptions = [], this.matchingIndices.clear(), this.renderDropdown();
1803
+ this.isLoading = !1, this.options.isKeepOptionsOnSearch ? (this.filteredOptions = [...this.allOptions], x.debug(`[${this.instanceId}] Search term below minimum, showing ${this.allOptions.length} initial options`)) : this.filteredOptions = [], this.matchingIndices.clear(), this.renderDropdown();
1805
1804
  return;
1806
1805
  }
1807
- this.isLoading = !0, this.renderDropdown(), S.debug(`[${this.instanceId}] Loading data for search term:`, t);
1806
+ this.isLoading = !0, this.renderDropdown(), x.debug(`[${this.instanceId}] Loading data for search term:`, t);
1808
1807
  try {
1809
- const s = await this.options.searchCallback(t);
1808
+ const o = await this.options.searchCallback(t);
1810
1809
  if (this.searchTerm === e) {
1811
- const i = s || [];
1812
- this.filteredOptions = [...i], this.isLoading = !1, this.matchingIndices.clear(), this.focusedIndex = this.options.isSearchEnabled && this.filteredOptions.length > 0 ? 0 : -1, this.renderDropdown(), S.debug(`[${this.instanceId}] Loaded ${i.length} results`);
1810
+ const i = o || [];
1811
+ this.filteredOptions = [...i], this.isLoading = !1, this.matchingIndices.clear(), this.focusedIndex = this.options.isSearchEnabled && this.filteredOptions.length > 0 ? 0 : -1, this.renderDropdown(), x.debug(`[${this.instanceId}] Loaded ${i.length} results`);
1813
1812
  }
1814
- } catch (s) {
1815
- S.error(`[${this.instanceId}] Error loading data:`, s), this.isLoading = !1, this.options.isKeepOptionsOnSearch ? this.filteredOptions = [...this.allOptions] : this.filteredOptions = [], this.matchingIndices.clear(), this.renderDropdown();
1813
+ } catch (o) {
1814
+ x.error(`[${this.instanceId}] Error loading data:`, o), this.isLoading = !1, this.options.isKeepOptionsOnSearch ? this.filteredOptions = [...this.allOptions] : this.filteredOptions = [], this.matchingIndices.clear(), this.renderDropdown();
1816
1815
  }
1817
1816
  } else {
1818
1817
  if (!t)
1819
1818
  this.filteredOptions = [...this.allOptions], this.matchingIndices.clear(), this.focusedIndex = this.filteredOptions.length > 0 ? 0 : -1;
1820
1819
  else {
1821
- const s = this.options.searchMode || "filter", i = t.toLowerCase();
1822
- if (s === "filter")
1823
- this.filteredOptions = this.allOptions.filter((r) => this.getItemSearchValue(r).toLowerCase().includes(i)), this.matchingIndices.clear(), this.focusedIndex = this.filteredOptions.length > 0 ? 0 : -1, S.debug(`[${this.instanceId}] Filter mode: ${this.filteredOptions.length} matches for "${t}"`);
1820
+ const o = this.options.searchMode || "filter", i = t.toLowerCase();
1821
+ if (o === "filter")
1822
+ this.filteredOptions = this.allOptions.filter((r) => this.getItemSearchValue(r).toLowerCase().includes(i)), this.matchingIndices.clear(), this.focusedIndex = this.filteredOptions.length > 0 ? 0 : -1, x.debug(`[${this.instanceId}] Filter mode: ${this.filteredOptions.length} matches for "${t}"`);
1824
1823
  else {
1825
1824
  this.filteredOptions = [...this.allOptions], this.matchingIndices.clear();
1826
1825
  let r = -1;
1827
1826
  this.allOptions.forEach((n, a) => {
1828
1827
  this.getItemSearchValue(n).toLowerCase().includes(i) && (this.matchingIndices.add(a), r === -1 && (r = a));
1829
- }), r >= 0 ? (this.focusedIndex = r, S.debug(`[${this.instanceId}] Navigate mode: ${this.matchingIndices.size} matches, jumped to index ${r}`)) : S.debug(`[${this.instanceId}] Navigate mode: No matches found, keeping previous focus`);
1828
+ }), r >= 0 ? (this.focusedIndex = r, x.debug(`[${this.instanceId}] Navigate mode: ${this.matchingIndices.size} matches, jumped to index ${r}`)) : x.debug(`[${this.instanceId}] Navigate mode: No matches found, keeping previous focus`);
1830
1829
  }
1831
1830
  }
1832
1831
  this.renderDropdown(), this.options.searchMode === "navigate" && this.focusedIndex >= 0 && this.scrollToFocused();
@@ -1838,8 +1837,8 @@ class us {
1838
1837
  return;
1839
1838
  }
1840
1839
  if (!this.options.isSearchEnabled) {
1841
- const t = e.key.length === 1 || e.key === "Backspace" || e.key === "Delete", s = ["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", "Enter", "Escape", "Tab"].includes(e.key);
1842
- if (t && !s) {
1840
+ const t = e.key.length === 1 || e.key === "Backspace" || e.key === "Delete", o = ["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", "Enter", "Escape", "Tab"].includes(e.key);
1841
+ if (t && !o) {
1843
1842
  e.preventDefault();
1844
1843
  return;
1845
1844
  }
@@ -1876,40 +1875,36 @@ class us {
1876
1875
  }
1877
1876
  handleDropdownClick(e) {
1878
1877
  var i;
1879
- T.debug(`[${this.instanceId}] Dropdown clicked`, { target: e.target.className }), e.stopPropagation();
1878
+ S.debug(`[${this.instanceId}] Dropdown clicked`, { target: e.target.className }), e.stopPropagation();
1880
1879
  const t = e.target.closest("[data-action]");
1881
1880
  if (t) {
1882
1881
  e.preventDefault();
1883
1882
  const r = t.dataset.action;
1884
- if (T.debug(`[${this.instanceId}] Action button clicked:`, r), r === "select-all")
1883
+ if (S.debug(`[${this.instanceId}] Action button clicked:`, r), r === "select-all")
1885
1884
  this.selectAll();
1886
1885
  else if (r === "clear-all")
1887
1886
  this.clearAll();
1888
1887
  else if (r === "custom") {
1889
- const n = (i = this.options.actionButtons) == null ? void 0 : i.find(
1890
- (a) => {
1891
- var l;
1892
- return a.action === "custom" && a.text === ((l = t.textContent) == null ? void 0 : l.trim());
1893
- }
1894
- );
1895
- n != null && n.onClick && n.onClick(this);
1888
+ const n = parseInt(t.dataset.buttonIndex || "-1"), a = (i = this.options.actionButtons) == null ? void 0 : i[n];
1889
+ a != null && a.onClick && a.onClick(this);
1896
1890
  }
1897
1891
  return;
1898
1892
  }
1899
- const s = e.target.closest(".ms__option");
1900
- if (s && !s.classList.contains("ms__option--disabled")) {
1893
+ const o = e.target.closest(".ms__option");
1894
+ if (o && !o.classList.contains("ms__option--disabled")) {
1901
1895
  e.preventDefault();
1902
- const r = s.dataset.value, n = this.filteredOptions.find((a) => String(this.getItemValue(a)) === r);
1903
- T.debug(`[${this.instanceId}] Option clicked:`, {
1896
+ const r = o.dataset.value, n = this.filteredOptions.findIndex((a) => String(this.getItemValue(a)) === r);
1897
+ S.debug(`[${this.instanceId}] Option clicked:`, {
1904
1898
  value: r,
1899
+ optionIndex: n,
1905
1900
  closeOnSelect: this.options.isCloseOnSelect,
1906
1901
  placeholder: this.options.searchPlaceholder
1907
- }), n && this.toggleOption(n);
1902
+ }), n >= 0 && (this.focusedIndex = n, this.toggleOption(this.filteredOptions[n]), this.isOpen && this.input.focus());
1908
1903
  }
1909
1904
  }
1910
1905
  handleBadgeClick(e) {
1911
1906
  if (e.target.closest('[data-action="clear-count"]')) {
1912
- e.preventDefault(), e.stopPropagation(), T.debug(`[${this.instanceId}] Clear count button clicked`), this.clearAll();
1907
+ e.preventDefault(), e.stopPropagation(), S.debug(`[${this.instanceId}] Clear count button clicked`), this.clearAll();
1913
1908
  return;
1914
1909
  }
1915
1910
  if (e.target.closest('[data-action="show-selected"]')) {
@@ -1919,7 +1914,7 @@ class us {
1919
1914
  const i = e.target.closest(".ms__badge-remove");
1920
1915
  if (i) {
1921
1916
  if (e.preventDefault(), e.stopPropagation(), i.dataset.action === "remove-hidden") {
1922
- T.debug(`[${this.instanceId}] Remove hidden items button clicked`);
1917
+ S.debug(`[${this.instanceId}] Remove hidden items button clicked`);
1923
1918
  const l = this.options.badgesMaxVisible || 3;
1924
1919
  Array.from(this.selectedOptions.values()).slice(l).forEach((p) => this.deselectOption(p));
1925
1920
  return;
@@ -1929,7 +1924,7 @@ class us {
1929
1924
  return;
1930
1925
  }
1931
1926
  if (e.target.closest(".ms__badge--more") && !e.target.closest(".ms__badge-remove")) {
1932
- e.preventDefault(), e.stopPropagation(), T.debug(`[${this.instanceId}] '+X more' badge clicked, showing popover`), this.toggleSelectedPopover();
1927
+ e.preventDefault(), e.stopPropagation(), S.debug(`[${this.instanceId}] '+X more' badge clicked, showing popover`), this.toggleSelectedPopover();
1933
1928
  return;
1934
1929
  }
1935
1930
  }
@@ -1939,51 +1934,61 @@ class us {
1939
1934
  if (this.showSelectedPopover && !t.some(
1940
1935
  (n) => n instanceof Node && (this.selectedPopover.contains(n) || this.counter.contains(n) || n.closest && n.closest('[data-action="show-selected"]'))
1941
1936
  )) {
1942
- v.debug(`[${this.instanceId}] Closing selected popover due to click outside`), this.hideSelectedPopover();
1937
+ M.debug(`[${this.instanceId}] Closing selected popover due to click outside`), this.hideSelectedPopover();
1943
1938
  return;
1944
1939
  }
1945
1940
  if (!this.isOpen) return;
1946
- const s = t.some(
1941
+ const o = t.some(
1947
1942
  (r) => r instanceof Node && (this.element.contains(r) || this.dropdown.contains(r) || this.hint && this.hint.contains(r))
1948
1943
  );
1949
- T.debug(`[${this.instanceId}] handleClickOutside`, {
1944
+ S.debug(`[${this.instanceId}] handleClickOutside`, {
1950
1945
  target: e.target.className,
1951
1946
  targetTag: e.target.tagName,
1952
- clickedInside: s,
1947
+ clickedInside: o,
1953
1948
  pathLength: t.length,
1954
1949
  firstInPath: (i = t[0]) == null ? void 0 : i.tagName,
1955
1950
  elementContains: t.some((r) => r instanceof Node && this.element.contains(r)),
1956
1951
  dropdownContains: t.some((r) => r instanceof Node && this.dropdown.contains(r)),
1957
1952
  isConnected: this.dropdown.isConnected
1958
- }), s || (T.warn(`[${this.instanceId}] Closing dropdown due to click outside`), this.close());
1953
+ }), o || (S.warn(`[${this.instanceId}] Closing dropdown due to click outside`), this.close());
1954
+ }
1955
+ /**
1956
+ * Move focus by computing a new index from (current, total).
1957
+ * Returning -1 from `compute` is a no-op (used for empty list / no match).
1958
+ */
1959
+ focusBy(e) {
1960
+ const t = this.filteredOptions.length;
1961
+ if (t === 0) return;
1962
+ const o = e(this.focusedIndex, t);
1963
+ o < 0 || (this.focusedIndex = o, this.renderDropdown(), this.scrollToFocused());
1959
1964
  }
1960
1965
  focusNext() {
1961
- this.filteredOptions.length !== 0 && (this.focusedIndex = Math.min(this.filteredOptions.length - 1, this.focusedIndex + 1), this.renderDropdown(), this.scrollToFocused());
1966
+ this.focusBy((e, t) => Math.min(t - 1, e + 1));
1962
1967
  }
1963
1968
  focusPrevious() {
1964
- this.filteredOptions.length !== 0 && (this.focusedIndex = Math.max(0, this.focusedIndex - 1), this.renderDropdown(), this.scrollToFocused());
1969
+ this.focusBy((e) => Math.max(0, e - 1));
1965
1970
  }
1966
1971
  focusFirst() {
1967
- this.filteredOptions.length !== 0 && (this.focusedIndex = 0, this.renderDropdown(), this.scrollToFocused());
1972
+ this.focusBy(() => 0);
1968
1973
  }
1969
1974
  focusLast() {
1970
- this.filteredOptions.length !== 0 && (this.focusedIndex = this.filteredOptions.length - 1, this.renderDropdown(), this.scrollToFocused());
1975
+ this.focusBy((e, t) => t - 1);
1976
+ }
1977
+ focusPageUp() {
1978
+ this.focusBy((e) => Math.max(0, e - 10));
1979
+ }
1980
+ focusPageDown() {
1981
+ this.focusBy((e, t) => Math.min(t - 1, e + 10));
1971
1982
  }
1972
1983
  focusNextMatch() {
1973
1984
  if (this.matchingIndices.size === 0) return;
1974
- const e = Array.from(this.matchingIndices).sort((i, r) => i - r), t = e.findIndex((i) => i === this.focusedIndex), s = (t + 1) % e.length;
1975
- this.focusedIndex = e[s], this.renderDropdown(), this.scrollToFocused(), T.debug(`[${this.instanceId}] Jumped to next match: index ${this.focusedIndex} (${t + 1} of ${e.length})`);
1985
+ const e = Array.from(this.matchingIndices).sort((i, r) => i - r), t = e.findIndex((i) => i === this.focusedIndex), o = (t + 1) % e.length;
1986
+ this.focusBy(() => e[o]), S.debug(`[${this.instanceId}] Jumped to next match: index ${this.focusedIndex} (${t + 1} of ${e.length})`);
1976
1987
  }
1977
1988
  focusPreviousMatch() {
1978
1989
  if (this.matchingIndices.size === 0) return;
1979
- const e = Array.from(this.matchingIndices).sort((i, r) => i - r), t = e.findIndex((i) => i === this.focusedIndex), s = t <= 0 ? e.length - 1 : t - 1;
1980
- this.focusedIndex = e[s], this.renderDropdown(), this.scrollToFocused(), T.debug(`[${this.instanceId}] Jumped to previous match: index ${this.focusedIndex} (${t + 1} of ${e.length})`);
1981
- }
1982
- focusPageUp() {
1983
- this.filteredOptions.length !== 0 && (this.focusedIndex = Math.max(0, this.focusedIndex - 10), this.renderDropdown(), this.scrollToFocused());
1984
- }
1985
- focusPageDown() {
1986
- this.filteredOptions.length !== 0 && (this.focusedIndex = Math.min(this.filteredOptions.length - 1, this.focusedIndex + 10), this.renderDropdown(), this.scrollToFocused());
1990
+ const e = Array.from(this.matchingIndices).sort((i, r) => i - r), t = e.findIndex((i) => i === this.focusedIndex), o = t <= 0 ? e.length - 1 : t - 1;
1991
+ this.focusBy(() => e[o]), S.debug(`[${this.instanceId}] Jumped to previous match: index ${this.focusedIndex} (${t + 1} of ${e.length})`);
1987
1992
  }
1988
1993
  scrollToFocused() {
1989
1994
  if (this.virtualScroll && this.focusedIndex >= 0)
@@ -1994,106 +1999,123 @@ class us {
1994
1999
  }
1995
2000
  }
1996
2001
  toggleOption(e) {
1997
- const t = this.getItemValue(e), s = String(t);
1998
- if (T.debug(`[${this.instanceId}] toggleOption called`, { value: t, multiple: this.options.isMultipleEnabled }), !this.options.isMultipleEnabled) {
1999
- this.selectedValues.has(s) ? (T.debug(`[${this.instanceId}] Deselecting option in single-select mode`, { value: t }), this.deselectOption(e)) : (T.debug(`[${this.instanceId}] Clearing previous selections and selecting new option`, { value: t }), this.selectedValues.clear(), this.selectedOptions.clear(), this.selectOption(e)), v.info(`[${this.instanceId}] ❌ Closing dropdown (single-select mode)`), this.close();
2002
+ if (this.getItemDisabled(e)) {
2003
+ S.debug(`[${this.instanceId}] toggleOption ignored option is disabled`);
2000
2004
  return;
2001
2005
  }
2002
- this.selectedValues.has(s) ? (T.debug(`[${this.instanceId}] Deselecting option`, { value: t }), this.deselectOption(e)) : (T.debug(`[${this.instanceId}] Selecting option`, { value: t }), this.selectOption(e)), T.debug(`[${this.instanceId}] Checking closeOnSelect`, {
2003
- closeOnSelect: this.options.isCloseOnSelect,
2004
- willClose: this.options.isCloseOnSelect === !0,
2005
- placeholder: this.options.searchPlaceholder
2006
- }), this.options.isCloseOnSelect ? (v.info(`[${this.instanceId}] ❌ Closing dropdown (closeOnSelect=true)`), this.close()) : v.info(`[${this.instanceId}] ✅ Keeping dropdown open (closeOnSelect=false)`);
2006
+ const t = this.getItemValue(e), o = String(t);
2007
+ if (S.debug(`[${this.instanceId}] toggleOption called`, { value: t, multiple: this.options.isMultipleEnabled }), !this.options.isMultipleEnabled) {
2008
+ this.selectedValues.has(o) ? (S.debug(`[${this.instanceId}] Deselecting option in single-select mode`, { value: t }), this.deselectOption(e)) : (S.debug(`[${this.instanceId}] Clearing previous selections and selecting new option`, { value: t }), this.selectedValues.clear(), this.selectedOptions.clear(), this.selectOption(e)), this.close();
2009
+ return;
2010
+ }
2011
+ this.selectedValues.has(o) ? (S.debug(`[${this.instanceId}] Deselecting option`, { value: t }), this.deselectOption(e)) : (S.debug(`[${this.instanceId}] Selecting option`, { value: t }), this.selectOption(e)), this.options.isCloseOnSelect && this.close();
2007
2012
  }
2008
2013
  async handleAddNew(e) {
2009
2014
  if (this.options.addNewCallback)
2010
2015
  try {
2011
- S.debug(`[${this.instanceId}] Adding new option:`, e);
2016
+ x.debug(`[${this.instanceId}] Adding new option:`, e);
2012
2017
  const t = await this.options.addNewCallback(e);
2013
2018
  this.allOptions.push(t), this.filteredOptions.push(t), this.selectOption(t), this.input.value = "", this.renderDropdown(), this.renderBadges(), this.options.isCloseOnSelect && this.close();
2014
2019
  } catch (t) {
2015
- S.error(`[${this.instanceId}] Error adding new option:`, t);
2020
+ x.error(`[${this.instanceId}] Error adding new option:`, t);
2016
2021
  }
2017
2022
  }
2018
2023
  selectOption(e) {
2019
- const t = this.getItemValue(e), s = String(t);
2020
- this.selectedValues.add(s), this.selectedOptions.set(s, e), this.renderDropdown(), this.renderBadges(), this.updateHiddenInput(), this.options.selectCallback && this.options.selectCallback(e), this.options.changeCallback && this.options.changeCallback(this.getSelected());
2024
+ const t = this.getItemValue(e), o = String(t);
2025
+ this.selectedValues.add(o), this.selectedOptions.set(o, e), this.commit({ added: [e] });
2021
2026
  }
2022
2027
  deselectOption(e) {
2023
- const t = this.getItemValue(e), s = String(t);
2024
- this.selectedValues.delete(s), this.selectedOptions.delete(s), this.renderDropdown(), this.renderBadges(), this.updateHiddenInput(), this.options.deselectCallback && this.options.deselectCallback(e), this.options.changeCallback && this.options.changeCallback(this.getSelected());
2028
+ const t = this.getItemValue(e), o = String(t);
2029
+ this.selectedValues.delete(o), this.selectedOptions.delete(o), this.commit({ removed: [e] });
2025
2030
  }
2026
2031
  selectAll() {
2027
- this.filteredOptions.forEach((e) => {
2028
- if (!this.getItemDisabled(e)) {
2029
- const t = this.getItemValue(e), s = String(t);
2030
- this.selectedValues.add(s), this.selectedOptions.set(s, e);
2031
- }
2032
- }), this.renderDropdown(), this.renderBadges(), this.updateHiddenInput(), this.options.changeCallback && this.options.changeCallback(this.getSelected());
2032
+ const e = [];
2033
+ this.filteredOptions.forEach((t) => {
2034
+ if (this.getItemDisabled(t)) return;
2035
+ const o = String(this.getItemValue(t));
2036
+ this.selectedValues.has(o) || (this.selectedValues.add(o), this.selectedOptions.set(o, t), e.push(t));
2037
+ }), this.commit({ added: e });
2033
2038
  }
2034
2039
  clearAll() {
2035
- this.selectedValues.clear(), this.selectedOptions.clear(), this.renderDropdown(), this.renderBadges(), this.updateHiddenInput(), this.options.changeCallback && this.options.changeCallback(this.getSelected());
2040
+ const e = Array.from(this.selectedOptions.values());
2041
+ this.selectedValues.clear(), this.selectedOptions.clear(), this.commit({ removed: e });
2042
+ }
2043
+ /**
2044
+ * Re-render and fire callbacks after a selection state change.
2045
+ * `added` / `removed` drive per-item select/deselect callbacks.
2046
+ * `changeCallback` fires once if anything actually changed.
2047
+ */
2048
+ commit(e) {
2049
+ this.renderDropdown(), this.renderBadges(), this.updateHiddenInput();
2050
+ const t = e.added ?? [], o = e.removed ?? [];
2051
+ this.options.selectCallback && t.forEach((i) => this.options.selectCallback(i)), this.options.deselectCallback && o.forEach((i) => this.options.deselectCallback(i)), (t.length > 0 || o.length > 0) && this.options.changeCallback && this.options.changeCallback(this.getSelected());
2036
2052
  }
2037
2053
  open() {
2038
- v.debug(`[${this.instanceId}] open() called`, { isOpen: this.isOpen }), !this.isOpen && (this.isOpen = !0, this.element.classList.add("ms--open"), this.dropdown.classList.add("ms__dropdown--visible"), v.info(`[${this.instanceId}] Dropdown opened`), this.input.placeholder = this.options.searchPlaceholder, !this.options.isMultipleEnabled && this.options.isSearchEnabled && (this.input.value = ""), this.options.searchCallback && this.options.isKeepOptionsOnSearch && !this.searchTerm && (this.filteredOptions = [...this.allOptions], v.debug(`[${this.instanceId}] Showing ${this.allOptions.length} initial options on open`)), this.renderDropdown(), this.positionDropdown(), this.hint && (this.hint.classList.add("ms__hint--visible"), this.positionHint()));
2054
+ M.debug(`[${this.instanceId}] open() called`, { isOpen: this.isOpen }), !this.isOpen && (this.isOpen = !0, this.element.classList.add("ms--open"), this.dropdown.classList.add("ms__dropdown--visible"), M.info(`[${this.instanceId}] Dropdown opened`), this.input.placeholder = this.options.searchPlaceholder, !this.options.isMultipleEnabled && this.options.isSearchEnabled && (this.input.value = ""), this.options.searchCallback && this.options.isKeepOptionsOnSearch && !this.searchTerm && (this.filteredOptions = [...this.allOptions], M.debug(`[${this.instanceId}] Showing ${this.allOptions.length} initial options on open`)), this.renderDropdown(), this.positionDropdown(), this.hint && (this.hint.classList.add("ms__hint--visible"), this.positionHint()));
2039
2055
  }
2040
2056
  close() {
2041
- if (v.debug(`[${this.instanceId}] close() called`, { isOpen: this.isOpen }), !!this.isOpen) {
2042
- if (this.isOpen = !1, this.element.classList.remove("ms--open"), this.dropdown.classList.remove("ms__dropdown--visible"), this.hint && this.hint.classList.remove("ms__hint--visible"), !this.options.shouldKeepSearchOnClose) {
2043
- this.searchTerm = "";
2044
- const e = this.options.isMultipleEnabled || this.options.isSearchEnabled;
2045
- v.warn(`[${this.instanceId}] close() - input clearing decision`, {
2046
- multiple: this.options.isMultipleEnabled,
2047
- enableSearch: this.options.isSearchEnabled,
2048
- willClearInput: e,
2049
- currentInputValue: this.input.value
2050
- }), e ? (v.info(`[${this.instanceId}] 🧹 close() CLEARING input.value`), this.input.value = "") : v.info(`[${this.instanceId}] 🔒 close() KEEPING input.value = "${this.input.value}"`), this.filteredOptions = [...this.allOptions];
2051
- }
2052
- this.focusedIndex = -1, v.info(`[${this.instanceId}] 📞 close() CALLING renderBadges()`), this.renderBadges(), v.info(`[${this.instanceId}] ✅ close() AFTER renderBadges(), input.value = "${this.input.value}"`), this.dropdownCleanup && (this.dropdownCleanup(), this.dropdownCleanup = null), this.hintCleanup && (this.hintCleanup(), this.hintCleanup = null), this.dropdownPlacement = null, v.info(`[${this.instanceId}] Dropdown closed. Stack trace:`), v.trace();
2053
- }
2057
+ M.debug(`[${this.instanceId}] close() called`, { isOpen: this.isOpen }), this.isOpen && (this.isOpen = !1, this.element.classList.remove("ms--open"), this.dropdown.classList.remove("ms__dropdown--visible"), this.hint && this.hint.classList.remove("ms__hint--visible"), this.options.shouldKeepSearchOnClose || (this.searchTerm = "", (this.options.isMultipleEnabled || this.options.isSearchEnabled) && (this.input.value = ""), this.filteredOptions = [...this.allOptions]), this.focusedIndex = -1, this.renderBadges(), this.dropdownCleanup && (this.dropdownCleanup(), this.dropdownCleanup = null), this.hintCleanup && (this.hintCleanup(), this.hintCleanup = null), this.dropdownPlacement = null, M.debug(`[${this.instanceId}] Dropdown closed`));
2058
+ }
2059
+ /**
2060
+ * Anchor a floating panel (dropdown or selected-items popover) below/above the input with
2061
+ * placement-locking and width-syncing. Returns the `autoUpdate` cleanup.
2062
+ *
2063
+ * Both panels share: anchor on input, sync width, default to 'bottom-start', flip on first
2064
+ * compute then lock the resulting placement, optionally clamp by dropdownMin/MaxWidth.
2065
+ */
2066
+ anchorFloatingPanel(e, t) {
2067
+ return we(this.input, e, () => {
2068
+ var a;
2069
+ const o = ((a = t.isLocked) == null ? void 0 : a.call(t)) ?? !0, i = t.getPlacement(), r = o && i ? i : "bottom-start", n = [
2070
+ _e(4),
2071
+ ...o && i ? [] : [it()],
2072
+ ke({ padding: 8 })
2073
+ ];
2074
+ ye(this.input, e, { placement: r, strategy: "fixed", middleware: n }).then(({ x: l, y: c, placement: h }) => {
2075
+ var u;
2076
+ i || t.setPlacement(h);
2077
+ const p = {
2078
+ position: "fixed",
2079
+ left: `${l}px`,
2080
+ top: `${c}px`,
2081
+ width: `${this.input.offsetWidth}px`
2082
+ };
2083
+ this.options.dropdownMinWidth && (p.minWidth = this.options.dropdownMinWidth), t.applyMaxWidth && this.options.dropdownMaxWidth && (p.maxWidth = this.options.dropdownMaxWidth), Object.assign(e.style, p), (u = t.afterPosition) == null || u.call(t);
2084
+ });
2085
+ });
2054
2086
  }
2055
2087
  positionDropdown() {
2056
- this.dropdownCleanup = Z(
2057
- this.input,
2058
- this.dropdown,
2059
- () => {
2060
- const e = this.options.isPlacementLocked && this.dropdownPlacement ? this.dropdownPlacement : "bottom-start", t = [
2061
- Q(4),
2062
- ...this.options.isPlacementLocked && this.dropdownPlacement ? [] : [ae()],
2063
- q({ padding: 8 })
2064
- ];
2065
- ee(this.input, this.dropdown, {
2066
- placement: e,
2067
- middleware: t
2068
- }).then(({ x: s, y: i, placement: r }) => {
2069
- this.options.isPlacementLocked && !this.dropdownPlacement && (this.dropdownPlacement = r, v.debug(`[${this.instanceId}] Locked dropdown placement:`, r));
2070
- const n = {
2071
- left: `${s}px`,
2072
- top: `${i}px`,
2073
- width: `${this.input.offsetWidth}px`
2074
- };
2075
- this.options.dropdownMinWidth && (n.minWidth = this.options.dropdownMinWidth), this.options.dropdownMaxWidth && (n.maxWidth = this.options.dropdownMaxWidth), Object.assign(this.dropdown.style, n), this.hint && this.isOpen && this.positionHint();
2076
- });
2088
+ this.dropdownCleanup = this.anchorFloatingPanel(this.dropdown, {
2089
+ getPlacement: () => this.dropdownPlacement,
2090
+ setPlacement: (e) => {
2091
+ this.dropdownPlacement = e, M.debug(`[${this.instanceId}] Locked dropdown placement:`, e);
2092
+ },
2093
+ isLocked: () => !!this.options.isPlacementLocked,
2094
+ applyMaxWidth: !0,
2095
+ afterPosition: () => {
2096
+ this.hint && this.isOpen && this.positionHint();
2077
2097
  }
2078
- );
2098
+ });
2079
2099
  }
2080
2100
  positionHint() {
2081
- this.hint && (this.hintCleanup && this.hintCleanup(), this.hintCleanup = Z(
2101
+ this.hint && (this.hintCleanup && this.hintCleanup(), this.hintCleanup = we(
2082
2102
  this.input,
2083
2103
  this.hint,
2084
2104
  () => {
2085
2105
  let e = "top-start";
2086
- this.dropdownPlacement && (this.dropdownPlacement.startsWith("bottom") ? e = this.dropdownPlacement.replace("bottom", "top") : this.dropdownPlacement.startsWith("top") && (e = this.dropdownPlacement.replace("top", "bottom"))), ee(this.input, this.hint, {
2106
+ this.dropdownPlacement && (this.dropdownPlacement.startsWith("bottom") ? e = this.dropdownPlacement.replace("bottom", "top") : this.dropdownPlacement.startsWith("top") && (e = this.dropdownPlacement.replace("top", "bottom"))), ye(this.input, this.hint, {
2087
2107
  placement: e,
2108
+ strategy: "fixed",
2088
2109
  middleware: [
2089
- Q(4),
2110
+ _e(4),
2090
2111
  // Don't use flip() - we want hint to stay opposite of dropdown
2091
- q({ padding: 8 })
2112
+ ke({ padding: 8 })
2092
2113
  ]
2093
- }).then(({ x: t, y: s }) => {
2114
+ }).then(({ x: t, y: o }) => {
2094
2115
  Object.assign(this.hint.style, {
2116
+ position: "fixed",
2095
2117
  left: `${t}px`,
2096
- top: `${s}px`
2118
+ top: `${o}px`
2097
2119
  });
2098
2120
  });
2099
2121
  }
@@ -2103,38 +2125,55 @@ class us {
2103
2125
  const e = this.element.dataset.initialValues;
2104
2126
  if (e)
2105
2127
  try {
2106
- JSON.parse(e).forEach((s) => {
2107
- const i = String(s);
2108
- this.selectedValues.add(i);
2109
- const r = this.allOptions.find((n) => String(this.getItemValue(n)) === i);
2110
- r && this.selectedOptions.set(i, r);
2111
- }), this.renderBadges();
2128
+ JSON.parse(e).forEach((o) => {
2129
+ this.selectedValues.add(String(o));
2130
+ }), this.reconcileSelectedOptions(), this.renderBadges();
2112
2131
  } catch (t) {
2113
- S.error(`[${this.instanceId}] Failed to parse initial values:`, t);
2132
+ x.error(`[${this.instanceId}] Failed to parse initial values:`, t);
2114
2133
  }
2115
2134
  }
2135
+ /**
2136
+ * Resolve any `selectedValues` entries that don't yet have a matching
2137
+ * `selectedOptions` object by looking them up in the current `allOptions`.
2138
+ * Idempotent; safe to call after init *and* after `options` is replaced
2139
+ * (e.g., async fetch, `searchCallback` result, or late `element.options =`
2140
+ * assignment). Without this, `initial-values` declared before options
2141
+ * arrive ends up with phantom values that `getValue()` can never report.
2142
+ */
2143
+ reconcileSelectedOptions() {
2144
+ this.selectedValues.size === 0 || this.allOptions.length === 0 || this.selectedValues.forEach((e) => {
2145
+ if (this.selectedOptions.has(e)) return;
2146
+ const t = this.allOptions.find((o) => String(this.getItemValue(o)) === e);
2147
+ t && this.selectedOptions.set(e, t);
2148
+ });
2149
+ }
2116
2150
  toggleSelectedPopover() {
2117
2151
  this.showSelectedPopover ? this.hideSelectedPopover() : this.showPopover();
2118
2152
  }
2119
2153
  showPopover() {
2120
- v.debug(`[${this.instanceId}] showPopover() called`), this.isOpen && this.close(), this.showSelectedPopover = !0, this.renderSelectedPopover(), this.selectedPopover.classList.add("ms__selected-popover--visible"), this.selectedValues.size >= 100 && this.selectedPopover.classList.add("ms__selected-popover--virtual"), this.positionSelectedPopover();
2154
+ M.debug(`[${this.instanceId}] showPopover() called`), this.isOpen && this.close(), this.showSelectedPopover = !0, this.renderSelectedPopover(), this.selectedPopover.classList.add("ms__selected-popover--visible");
2155
+ const e = this.options.virtualScrollThreshold ?? 100;
2156
+ this.selectedValues.size >= e && this.selectedPopover.classList.add("ms__selected-popover--virtual"), this.positionSelectedPopover();
2121
2157
  }
2122
2158
  hideSelectedPopover() {
2123
- v.debug(`[${this.instanceId}] hideSelectedPopover() called`), this.showSelectedPopover = !1, this.selectedPopover.classList.remove("ms__selected-popover--visible"), this.selectedPopover.classList.remove("ms__selected-popover--virtual"), this.selectedPopoverPlacement = null, this.selectedPopoverVirtualScroll && (this.selectedPopoverVirtualScroll.destroy(), this.selectedPopoverVirtualScroll = null, this.selectedPopoverContainer = null), this.selectedPopoverCleanup && (this.selectedPopoverCleanup(), this.selectedPopoverCleanup = null);
2159
+ var e;
2160
+ M.debug(`[${this.instanceId}] hideSelectedPopover() called`), this.showSelectedPopover = !1, this.selectedPopover.classList.remove("ms__selected-popover--visible"), this.selectedPopover.classList.remove("ms__selected-popover--virtual"), this.selectedPopoverPlacement = null, this.selectedPopoverVirtualScroll && (this.selectedPopoverVirtualScroll.destroy(), this.selectedPopoverVirtualScroll = null, this.selectedPopoverContainer = null), this.selectedPopoverCleanup && (this.selectedPopoverCleanup(), this.selectedPopoverCleanup = null);
2161
+ for (const t of Array.from(this.tooltips.keys()))
2162
+ t.startsWith("popover-") && ((e = this.tooltips.get(t)) == null || e.destroy(), this.tooltips.delete(t));
2124
2163
  }
2125
2164
  renderSelectedPopover() {
2126
- const e = Array.from(this.selectedOptions.values()), t = this.selectedValues.size;
2127
- if (t >= 100) {
2165
+ const e = Array.from(this.selectedOptions.values()), t = this.selectedValues.size, o = this.options.virtualScrollThreshold ?? 100;
2166
+ if (t >= o) {
2128
2167
  this.renderSelectedPopoverVirtual(e, t);
2129
2168
  return;
2130
2169
  }
2131
2170
  this.selectedPopover.innerHTML = `
2132
2171
  <div class="ms__selected-popover-header">
2133
2172
  <span>Selected Items (${t})</span>
2134
- <button type="button" class="ms__selected-popover-close" aria-label="Close">&times;</button>
2173
+ <button type="button" class="ms__selected-popover-close" aria-label="Close"></button>
2135
2174
  </div>
2136
2175
  <div class="ms__selected-popover-body">
2137
- ${e.map((i) => this.renderBadgeForPopover(i)).join("")}
2176
+ ${e.map((i) => this.renderBadgeHTML(i, { displayMode: this.options.badgesDisplayMode || "badges", isInPopover: !0 })).join("")}
2138
2177
  </div>
2139
2178
  `, this.attachBadgeTooltips(this.selectedPopover);
2140
2179
  }
@@ -2146,20 +2185,20 @@ class us {
2146
2185
  const a = this.options.badgeHeight ?? 36, l = `
2147
2186
  <div class="ms__selected-popover-header">
2148
2187
  <span>Selected Items (${t})</span>
2149
- <button type="button" class="ms__selected-popover-close" aria-label="Close">&times;</button>
2188
+ <button type="button" class="ms__selected-popover-close" aria-label="Close"></button>
2150
2189
  </div>
2151
- <div class="ms__selected-popover-body ms__selected-popover-body--virtual" style="height: 18rem; overflow-y: auto; position: relative; --ml-badge-height-virtual: ${a}px;"></div>
2190
+ <div class="ms__selected-popover-body ms__selected-popover-body--virtual" style="height: 18rem; overflow-y: auto; position: relative; --ms-badge-height-virtual: ${a}px;"></div>
2152
2191
  `;
2153
2192
  this.selectedPopover.innerHTML = l, this.selectedPopoverContainer = this.selectedPopover.querySelector(".ms__selected-popover-body");
2154
2193
  }
2155
2194
  if (!this.selectedPopoverContainer) return;
2156
2195
  const r = (this.options.badgeHeight ?? 36) + 4, n = this.options.virtualScrollBuffer ?? 10;
2157
2196
  requestAnimationFrame(() => {
2158
- this.selectedPopoverContainer && (this.selectedPopoverVirtualScroll ? this.selectedPopoverVirtualScroll.setItems(e) : this.selectedPopoverVirtualScroll = new Ne({
2197
+ this.selectedPopoverContainer && (this.selectedPopoverVirtualScroll ? this.selectedPopoverVirtualScroll.setItems(e) : this.selectedPopoverVirtualScroll = new We({
2159
2198
  container: this.selectedPopoverContainer,
2160
2199
  itemHeight: r,
2161
2200
  items: e,
2162
- renderItem: (a) => this.renderBadgeForPopover(a),
2201
+ renderItem: (a) => this.renderBadgeHTML(a, { displayMode: this.options.badgesDisplayMode || "badges", isInPopover: !0 }),
2163
2202
  bufferSize: n,
2164
2203
  onVisibleRangeChange: () => {
2165
2204
  this.attachBadgeTooltips(this.selectedPopoverContainer);
@@ -2167,30 +2206,38 @@ class us {
2167
2206
  }));
2168
2207
  });
2169
2208
  }
2170
- renderBadgeForPopover(e) {
2171
- const t = this.getItemValue(e);
2172
- let s;
2173
- if (this.options.renderSelectedItemContentCallback) {
2174
- const n = this.options.renderSelectedItemContentCallback(e);
2175
- s = typeof n == "string" ? n : n.outerHTML;
2209
+ /**
2210
+ * Render a removable badge for a selected option (used by the badges/partial display modes
2211
+ * and by the selected-items popover).
2212
+ *
2213
+ * - In the popover, `renderSelectedItemContentCallback` and `getSelectedItemClassCallback` win
2214
+ * over the regular badge callbacks; that's how consumers customize popover items independently.
2215
+ * - The `data-value` and aria-label both go through `getItemBadgeDisplayValue` so badge text and
2216
+ * accessible name stay in sync.
2217
+ */
2218
+ renderBadgeHTML(e, t) {
2219
+ const o = this.getItemValue(e);
2220
+ let i;
2221
+ const r = t.isInPopover ? this.options.renderSelectedItemContentCallback : void 0;
2222
+ if (r) {
2223
+ const c = r(e);
2224
+ i = typeof c == "string" ? c : c.outerHTML;
2176
2225
  } else if (this.options.renderBadgeContentCallback) {
2177
- const n = {
2178
- displayMode: this.options.badgesDisplayMode || "badges",
2179
- isInPopover: !0
2180
- }, a = this.options.renderBadgeContentCallback(e, n);
2181
- s = typeof a == "string" ? a : a.outerHTML;
2226
+ const c = this.options.renderBadgeContentCallback(e, t);
2227
+ i = typeof c == "string" ? c : c.outerHTML;
2182
2228
  } else
2183
- s = this.getItemBadgeDisplayValue(e);
2184
- let i = "ms__badge";
2185
- const r = this.options.getSelectedItemClassCallback || this.options.getBadgeClassCallback;
2186
- if (r) {
2187
- const n = r(e), a = Array.isArray(n) ? n : [n];
2188
- i += " " + a.filter((l) => l).join(" ");
2229
+ i = this.getItemBadgeDisplayValue(e);
2230
+ const n = t.isInPopover ? this.options.getSelectedItemClassCallback || this.options.getBadgeClassCallback : this.options.getBadgeClassCallback;
2231
+ let a = "ms__badge";
2232
+ if (n) {
2233
+ const c = n(e), h = Array.isArray(c) ? c : [c];
2234
+ a += " " + h.filter((p) => p).join(" ");
2189
2235
  }
2236
+ const l = this.getItemBadgeDisplayValue(e);
2190
2237
  return `
2191
- <div class="${i}">
2192
- <span class="ms__badge-text">${s}</span>
2193
- <button type="button" class="ms__badge-remove" data-value="${t}" aria-label="Remove ${this.getItemBadgeDisplayValue(e)}"></button>
2238
+ <div class="${a}">
2239
+ <span class="ms__badge-text">${i}</span>
2240
+ <button type="button" class="ms__badge-remove" data-value="${o}" aria-label="Remove ${l}"></button>
2194
2241
  </div>
2195
2242
  `;
2196
2243
  }
@@ -2199,37 +2246,20 @@ class us {
2199
2246
  e.preventDefault(), this.hideSelectedPopover();
2200
2247
  return;
2201
2248
  }
2202
- const s = e.target.closest(".ms__badge-remove");
2203
- if (s) {
2249
+ const o = e.target.closest(".ms__badge-remove");
2250
+ if (o) {
2204
2251
  e.preventDefault();
2205
- const i = s.dataset.value, r = this.selectedOptions.get(i);
2252
+ const i = o.dataset.value, r = this.selectedOptions.get(i);
2206
2253
  r && (this.deselectOption(r), this.renderSelectedPopover(), this.selectedValues.size === 0 && this.hideSelectedPopover());
2207
2254
  }
2208
2255
  }
2209
2256
  positionSelectedPopover() {
2210
- this.selectedPopoverCleanup = Z(
2211
- this.input,
2212
- this.selectedPopover,
2213
- () => {
2214
- const e = this.selectedPopoverPlacement || "bottom-start";
2215
- ee(this.input, this.selectedPopover, {
2216
- placement: e,
2217
- middleware: [
2218
- Q(4),
2219
- ...this.selectedPopoverPlacement ? [] : [ae()],
2220
- q({ padding: 8 })
2221
- ]
2222
- }).then(({ x: t, y: s, placement: i }) => {
2223
- this.selectedPopoverPlacement || (this.selectedPopoverPlacement = i, v.debug(`[${this.instanceId}] Locked popover placement:`, i));
2224
- const r = {
2225
- left: `${t}px`,
2226
- top: `${s}px`,
2227
- width: `${this.input.offsetWidth}px`
2228
- };
2229
- this.options.dropdownMinWidth && (r.minWidth = this.options.dropdownMinWidth), Object.assign(this.selectedPopover.style, r);
2230
- });
2257
+ this.selectedPopoverCleanup = this.anchorFloatingPanel(this.selectedPopover, {
2258
+ getPlacement: () => this.selectedPopoverPlacement,
2259
+ setPlacement: (e) => {
2260
+ this.selectedPopoverPlacement = e, M.debug(`[${this.instanceId}] Locked popover placement:`, e);
2231
2261
  }
2232
- );
2262
+ });
2233
2263
  }
2234
2264
  // ========================================================================
2235
2265
  // FORM INTEGRATION
@@ -2237,19 +2267,19 @@ class us {
2237
2267
  updateHiddenInput() {
2238
2268
  if (!this.options.formFieldId) return;
2239
2269
  this.hiddenInputs.forEach((i) => i.remove()), this.hiddenInputs = [];
2240
- const e = this.options.valueFormat || "json", t = Array.from(this.selectedOptions.values()).map((i) => this.getItemValue(i)), s = this.options.hostElement || this.element;
2270
+ const e = this.options.valueFormat || "json", t = Array.from(this.selectedOptions.values()).map((i) => this.getItemValue(i)), o = this.options.hostElement || this.element;
2241
2271
  if (e === "array")
2242
2272
  t.forEach((i) => {
2243
2273
  const r = document.createElement("input");
2244
- r.type = "hidden", r.name = `${this.options.formFieldId}[]`, r.value = String(i), s.appendChild(r), this.hiddenInputs.push(r);
2274
+ r.type = "hidden", r.name = `${this.options.formFieldId}[]`, r.value = String(i), o.appendChild(r), this.hiddenInputs.push(r);
2245
2275
  });
2246
2276
  else {
2247
2277
  const i = document.createElement("input");
2248
- i.type = "hidden", i.name = this.options.formFieldId, i.id = this.options.formFieldId, i.value = this.getFormValue(), s.appendChild(i), this.hiddenInputs.push(i);
2278
+ i.type = "hidden", i.name = this.options.formFieldId, i.id = this.options.formFieldId, i.value = this.getFormValue(), o.appendChild(i), this.hiddenInputs.push(i);
2249
2279
  }
2250
2280
  }
2251
2281
  getFormValue() {
2252
- const e = Array.from(this.selectedOptions.values()).map((s) => this.getItemValue(s));
2282
+ const e = Array.from(this.selectedOptions.values()).map((o) => this.getItemValue(o));
2253
2283
  return this.options.getValueFormatCallback ? this.options.getValueFormatCallback(e) : (this.options.valueFormat || "json") === "csv" ? e.join(",") : JSON.stringify(e);
2254
2284
  }
2255
2285
  // ========================================================================
@@ -2260,10 +2290,37 @@ class us {
2260
2290
  }
2261
2291
  setSelected(e) {
2262
2292
  this.selectedValues = new Set(e.map((t) => String(t))), this.selectedOptions.clear(), e.forEach((t) => {
2263
- const s = String(t), i = this.allOptions.find((r) => String(this.getItemValue(r)) === s);
2264
- i && this.selectedOptions.set(s, i);
2293
+ const o = String(t), i = this.allOptions.find((r) => String(this.getItemValue(r)) === o);
2294
+ i && this.selectedOptions.set(o, i);
2265
2295
  }), this.renderDropdown(), this.renderBadges(), this.updateHiddenInput();
2266
2296
  }
2297
+ /**
2298
+ * Merge a partial config update into the live picker without tearing down the DOM.
2299
+ *
2300
+ * Handles the cheap structural toggles inline (no-checkboxes class, badges-position class,
2301
+ * input placeholder, search-input mode) and re-renders dropdown + badges + hidden inputs.
2302
+ *
2303
+ * Returns `true` if the change could be applied in place. Returns `false` for changes that
2304
+ * truly require rebuilding the DOM scaffolding (currently: adding/removing the `searchHint`
2305
+ * element, since it's only created in `buildHTML` if a hint string was provided). The caller
2306
+ * should fall back to destroy + re-init in that case.
2307
+ */
2308
+ updateOptions(e) {
2309
+ const t = !!this.hint, o = "searchHint" in e ? !!e.searchHint : t;
2310
+ if (t !== o) return !1;
2311
+ if (Object.assign(this.options, e), "options" in e && e.options !== void 0 && (this.allOptions = e.options, this.filteredOptions = this.searchTerm ? this.filteredOptions : [...this.allOptions], this.reconcileSelectedOptions()), this.element.classList.toggle(
2312
+ "ms--no-checkboxes",
2313
+ !this.options.isCheckboxesShown || !this.options.isMultipleEnabled
2314
+ ), "badgesPosition" in e) {
2315
+ this.effectiveBadgesPosition = this.options.badgesPosition || "bottom", this.isRTL && (this.effectiveBadgesPosition === "left" ? this.effectiveBadgesPosition = "right" : this.effectiveBadgesPosition === "right" && (this.effectiveBadgesPosition = "left"));
2316
+ const i = this.element.querySelector(".ms-wrapper");
2317
+ i == null || i.classList.toggle(
2318
+ "ms-wrapper--inline",
2319
+ this.effectiveBadgesPosition === "left" || this.effectiveBadgesPosition === "right"
2320
+ );
2321
+ }
2322
+ return "searchPlaceholder" in e && !this.isOpen && (this.input.placeholder = this.options.searchPlaceholder), "searchInputMode" in e && (this.input.readOnly = this.options.searchInputMode === "readonly", this.input.style.display = this.options.searchInputMode === "hidden" ? "none" : ""), "searchHint" in e && this.hint && (this.hint.textContent = this.options.searchHint || ""), this.renderDropdown(), this.renderBadges(), this.updateHiddenInput(), !0;
2323
+ }
2267
2324
  get selectedItem() {
2268
2325
  return this.selectedOptions.size === 0 ? null : Array.from(this.selectedOptions.values())[0];
2269
2326
  }
@@ -2282,322 +2339,366 @@ class us {
2282
2339
  return this.options.isMultipleEnabled ? e : e[0] ?? null;
2283
2340
  }
2284
2341
  // ========================================================================
2285
- // BADGE TOOLTIP METHODS
2342
+ // TOOLTIPS (badge text, badge-remove buttons, action buttons)
2286
2343
  // ========================================================================
2287
- attachBadgeTooltips(e) {
2288
- if (!this.options.isBadgeTooltipsEnabled) {
2289
- v.debug(`[${this.instanceId}] Tooltips disabled - isBadgeTooltipsEnabled is false`);
2290
- return;
2291
- }
2292
- const s = (e || this.badgesContainer).querySelectorAll(".ms__badge:not(.ms__badge--more)");
2293
- if (v.debug(`[${this.instanceId}] Found ${s.length} badges to attach tooltips to`), s.forEach((i) => {
2294
- const r = i, n = r.querySelector(".ms__badge-remove");
2295
- if (!n) return;
2296
- const a = n.dataset.value, l = this.selectedOptions.get(a);
2297
- if (!l) return;
2298
- const c = r.querySelector(".ms__badge-text");
2299
- c && this.createTooltipForElement(c, l, a);
2300
- const d = this.getItemBadgeDisplayValue(l);
2301
- this.createRemoveButtonTooltip(n, d, a, l);
2302
- }), !e) {
2303
- const i = this.badgesContainer.querySelector(".ms__badge--more");
2304
- if (i) {
2305
- const r = i.querySelector(".ms__badge-remove");
2306
- if (r && r.dataset.action === "remove-hidden") {
2307
- const n = this.options.badgesMaxVisible || 3, l = Array.from(this.selectedOptions.values()).length - n;
2308
- this.createRemoveButtonTooltip(r, `${l} hidden items`, "more-badge-remove");
2309
- }
2310
- }
2311
- }
2344
+ /**
2345
+ * Create or replace a tracked tooltip with the given id. Replacing destroys the old one,
2346
+ * which is the normal flow when re-rendering badges/actions.
2347
+ */
2348
+ spawnTooltip(e) {
2349
+ var o;
2350
+ (o = this.tooltips.get(e.id)) == null || o.destroy();
2351
+ const t = new ws({
2352
+ trigger: e.trigger,
2353
+ container: this.options.container || document.body,
2354
+ content: e.content,
2355
+ placement: this.options.badgeTooltipPlacement || "top",
2356
+ offsetDistance: this.options.badgeTooltipOffset ?? 8,
2357
+ showDelay: this.options.badgeTooltipDelay ?? 100,
2358
+ onBeforeShow: e.onBeforeShow
2359
+ });
2360
+ this.tooltips.set(e.id, t);
2312
2361
  }
2313
- createTooltipForElement(e, t, s) {
2314
- const i = document.createElement("div");
2315
- i.className = "ms__badge-tooltip";
2316
- let r;
2317
- if (this.options.getBadgeTooltipCallback)
2318
- r = this.options.getBadgeTooltipCallback(t), v.debug(`[${this.instanceId}] Using custom callback for tooltip content`);
2319
- else {
2320
- const c = this.getItemBadgeDisplayValue(t), d = this.getItemSubtitle(t);
2321
- r = d ? `${c}
2322
- ${d}` : c, v.debug(`[${this.instanceId}] Using default content: "${r}"`);
2323
- }
2324
- typeof r == "string" ? i.textContent = r : i.appendChild(r), (this.options.container || document.body).appendChild(i), v.debug(`[${this.instanceId}] Tooltip element created and appended for "${s}"`), this.badgeTooltips.set(s, i);
2325
- const a = () => {
2326
- const c = this.badgeTooltipHideTimeouts.get(s);
2327
- c && (clearTimeout(c), this.badgeTooltipHideTimeouts.delete(s)), v.debug(`[${this.instanceId}] Mouse entered badge "${s}", will show tooltip in ${this.options.badgeTooltipDelay ?? 100}ms`);
2328
- const d = window.setTimeout(() => {
2329
- v.debug(`[${this.instanceId}] Showing tooltip for "${s}"`), i.classList.add("ms__badge-tooltip--visible"), this.positionBadgeTooltip(e, i, s), this.badgeTooltipShowTimeouts.delete(s);
2330
- }, this.options.badgeTooltipDelay ?? 100);
2331
- this.badgeTooltipShowTimeouts.set(s, d);
2332
- }, l = () => {
2333
- const c = this.badgeTooltipShowTimeouts.get(s);
2334
- c && (clearTimeout(c), this.badgeTooltipShowTimeouts.delete(s));
2335
- const d = window.setTimeout(() => {
2336
- i.classList.remove("ms__badge-tooltip--visible"), this.cleanupBadgeTooltip(s), this.badgeTooltipHideTimeouts.delete(s);
2337
- }, 100);
2338
- this.badgeTooltipHideTimeouts.set(s, d);
2339
- };
2340
- e.addEventListener("mouseenter", a), e.addEventListener("mouseleave", l);
2341
- }
2342
- createRemoveButtonTooltip(e, t, s, i) {
2343
- const r = document.createElement("div");
2344
- r.className = "ms__badge-tooltip";
2345
- let n;
2346
- i && this.options.getRemoveButtonTooltipCallback ? n = this.options.getRemoveButtonTooltipCallback(i) : this.options.removeButtonTooltipText ? n = this.options.removeButtonTooltipText.replace("{0}", t) : n = `Remove ${t}`, r.textContent = n, (this.options.container || document.body).appendChild(r);
2347
- const l = `${s}-remove`;
2348
- this.badgeTooltips.set(l, r);
2349
- const c = () => {
2350
- const p = this.badgeTooltipHideTimeouts.get(l);
2351
- p && (clearTimeout(p), this.badgeTooltipHideTimeouts.delete(l));
2352
- const u = this.badgeTooltips.get(s);
2353
- u && u.classList.remove("ms__badge-tooltip--visible");
2354
- const h = window.setTimeout(() => {
2355
- r.classList.add("ms__badge-tooltip--visible"), this.positionBadgeTooltip(e, r, l), this.badgeTooltipShowTimeouts.delete(l);
2356
- }, this.options.badgeTooltipDelay ?? 100);
2357
- this.badgeTooltipShowTimeouts.set(l, h);
2358
- }, d = () => {
2359
- const p = this.badgeTooltipShowTimeouts.get(l);
2360
- p && (clearTimeout(p), this.badgeTooltipShowTimeouts.delete(l));
2361
- const u = window.setTimeout(() => {
2362
- r.classList.remove("ms__badge-tooltip--visible"), this.cleanupBadgeTooltip(l), this.badgeTooltipHideTimeouts.delete(l);
2363
- }, 100);
2364
- this.badgeTooltipHideTimeouts.set(l, u);
2365
- };
2366
- e.addEventListener("mouseenter", c), e.addEventListener("mouseleave", d);
2362
+ destroyAllTooltips() {
2363
+ this.tooltips.forEach((e) => e.destroy()), this.tooltips.clear();
2367
2364
  }
2368
- positionBadgeTooltip(e, t, s) {
2369
- const i = Z(e, t, () => {
2370
- ee(e, t, {
2371
- placement: this.options.badgeTooltipPlacement || "top",
2372
- strategy: "fixed",
2373
- middleware: [
2374
- Q(this.options.badgeTooltipOffset || 8),
2375
- ae(),
2376
- q({ padding: 8 })
2377
- ]
2378
- }).then(({ x: r, y: n }) => {
2379
- Object.assign(t.style, {
2380
- left: `${r}px`,
2381
- top: `${n}px`
2382
- }), v.debug(`[${this.instanceId}] Positioned tooltip "${s}" at x:${r}, y:${n}`, {
2383
- placement: this.options.badgeTooltipPlacement || "top",
2384
- tooltipClasses: t.className,
2385
- tooltipDisplay: window.getComputedStyle(t).display,
2386
- tooltipOpacity: window.getComputedStyle(t).opacity,
2387
- tooltipVisibility: window.getComputedStyle(t).visibility,
2388
- tooltipZIndex: window.getComputedStyle(t).zIndex,
2389
- tooltipPosition: window.getComputedStyle(t).position
2390
- });
2391
- });
2392
- });
2393
- this.badgeTooltipCleanups.set(s, i);
2365
+ /** Build the badge-text tooltip content (callback overrides; default = displayValue + optional subtitle on next line). */
2366
+ buildBadgeTooltipContent(e) {
2367
+ if (this.options.getBadgeTooltipCallback) return this.options.getBadgeTooltipCallback(e);
2368
+ const t = this.getItemBadgeDisplayValue(e), o = this.getItemSubtitle(e);
2369
+ return o ? `${t}
2370
+ ${o}` : t;
2394
2371
  }
2395
- cleanupBadgeTooltip(e) {
2396
- const t = this.badgeTooltipShowTimeouts.get(e);
2397
- t && (clearTimeout(t), this.badgeTooltipShowTimeouts.delete(e));
2398
- const s = this.badgeTooltipHideTimeouts.get(e);
2399
- s && (clearTimeout(s), this.badgeTooltipHideTimeouts.delete(e));
2400
- const i = this.badgeTooltipCleanups.get(e);
2401
- i && (i(), this.badgeTooltipCleanups.delete(e));
2372
+ /** Build the remove-button tooltip text (callback > format string with {0} > "Remove {name}"). */
2373
+ buildRemoveButtonTooltipText(e, t) {
2374
+ return t && this.options.getRemoveButtonTooltipCallback ? this.options.getRemoveButtonTooltipCallback(t) : this.options.removeButtonTooltipText ? this.options.removeButtonTooltipText.replace("{0}", e) : `Remove ${e}`;
2402
2375
  }
2403
- destroyAllBadgeTooltips() {
2404
- this.badgeTooltipShowTimeouts.forEach((e) => clearTimeout(e)), this.badgeTooltipShowTimeouts.clear(), this.badgeTooltipHideTimeouts.forEach((e) => clearTimeout(e)), this.badgeTooltipHideTimeouts.clear(), this.badgeTooltipCleanups.forEach((e) => e()), this.badgeTooltipCleanups.clear(), this.badgeTooltips.forEach((e) => e.remove()), this.badgeTooltips.clear();
2376
+ attachBadgeTooltips(e) {
2377
+ if (!this.options.isBadgeTooltipsEnabled) return;
2378
+ const t = !!e, o = e || this.badgesContainer, i = t ? "popover-" : "";
2379
+ if (o.querySelectorAll(".ms__badge:not(.ms__badge--more)").forEach((n) => {
2380
+ const a = n.querySelector(".ms__badge-remove");
2381
+ if (!a) return;
2382
+ const l = a.dataset.value, c = this.selectedOptions.get(l);
2383
+ if (!c) return;
2384
+ const h = `${i}${l}`, p = `${i}${l}-remove`, u = n.querySelector(".ms__badge-text");
2385
+ u && this.spawnTooltip({
2386
+ id: h,
2387
+ trigger: u,
2388
+ content: this.buildBadgeTooltipContent(c)
2389
+ });
2390
+ const m = this.getItemBadgeDisplayValue(c);
2391
+ this.spawnTooltip({
2392
+ id: p,
2393
+ trigger: a,
2394
+ content: this.buildRemoveButtonTooltipText(m, c),
2395
+ // Keep parent badge tooltip from overlapping the remove-button tooltip.
2396
+ onBeforeShow: () => {
2397
+ var g;
2398
+ return (g = this.tooltips.get(h)) == null ? void 0 : g.hideImmediate();
2399
+ }
2400
+ });
2401
+ }), !t) {
2402
+ const n = this.badgesContainer.querySelector(".ms__badge--more"), a = n == null ? void 0 : n.querySelector(".ms__badge-remove");
2403
+ if (a && a.dataset.action === "remove-hidden") {
2404
+ const l = this.options.badgesMaxVisible || 3, c = this.selectedOptions.size - l;
2405
+ this.spawnTooltip({
2406
+ id: "more-badge-remove",
2407
+ trigger: a,
2408
+ content: this.buildRemoveButtonTooltipText(`${c} hidden items`)
2409
+ });
2410
+ }
2411
+ }
2405
2412
  }
2406
- // ========================================================================
2407
- // ACTION BUTTON TOOLTIP METHODS
2408
- // ========================================================================
2409
2413
  attachActionButtonTooltips() {
2410
- const e = this.dropdown.querySelectorAll(".ms__action-btn");
2411
- v.debug(`[${this.instanceId}] Found ${e.length} action buttons to attach tooltips to`), e.forEach((t) => {
2412
- var l;
2413
- const s = t, i = s.dataset.action;
2414
+ this.dropdown.querySelectorAll(".ms__action-btn").forEach((t) => {
2415
+ var c, h;
2416
+ const o = t, i = o.dataset.action;
2414
2417
  if (!i) return;
2415
- const r = (l = this.options.actionButtons) == null ? void 0 : l.find((c) => c.action === "custom" ? s.dataset.customAction === s.dataset.action : c.action === i);
2416
- if (!r) return;
2417
- let n;
2418
- if (r.getTooltipCallback ? (n = r.getTooltipCallback(this), v.debug(`[${this.instanceId}] Using getTooltipCallback for action button "${i}": "${n}"`)) : (n = r.tooltip, v.debug(`[${this.instanceId}] Using static tooltip for action button "${i}": "${n}"`)), !n) {
2419
- v.debug(`[${this.instanceId}] No tooltip for action button "${i}"`);
2420
- return;
2421
- }
2422
- const a = `action-${i}-${Date.now()}`;
2423
- this.createActionButtonTooltip(s, n, a);
2424
- });
2425
- }
2426
- createActionButtonTooltip(e, t, s) {
2427
- const i = document.createElement("div");
2428
- i.className = "ms__badge-tooltip", i.textContent = t, (this.options.container || document.body).appendChild(i), v.debug(`[${this.instanceId}] Tooltip element created for action button "${s}"`), this.actionButtonTooltips.set(s, i);
2429
- let n, a;
2430
- const l = () => {
2431
- clearTimeout(a), v.debug(`[${this.instanceId}] Mouse entered action button "${s}", will show tooltip in ${this.options.badgeTooltipDelay ?? 100}ms`), n = window.setTimeout(() => {
2432
- v.debug(`[${this.instanceId}] Showing tooltip for action button "${s}"`), i.classList.add("ms__badge-tooltip--visible"), this.positionActionButtonTooltip(e, i, s);
2433
- }, this.options.badgeTooltipDelay ?? 100);
2434
- }, c = () => {
2435
- clearTimeout(n), a = window.setTimeout(() => {
2436
- i.classList.remove("ms__badge-tooltip--visible"), this.cleanupActionButtonTooltip(s);
2437
- }, 100);
2438
- };
2439
- e.addEventListener("mouseenter", l), e.addEventListener("mouseleave", c);
2440
- }
2441
- positionActionButtonTooltip(e, t, s) {
2442
- const i = Z(e, t, () => {
2443
- ee(e, t, {
2444
- placement: this.options.badgeTooltipPlacement || "top",
2445
- strategy: "fixed",
2446
- middleware: [
2447
- Q(this.options.badgeTooltipOffset || 8),
2448
- ae(),
2449
- q({ padding: 8 })
2450
- ]
2451
- }).then(({ x: r, y: n }) => {
2452
- Object.assign(t.style, {
2453
- left: `${r}px`,
2454
- top: `${n}px`
2455
- }), v.debug(`[${this.instanceId}] Positioned action button tooltip "${s}" at x:${r}, y:${n}`);
2456
- });
2418
+ const r = parseInt(o.dataset.buttonIndex || "-1"), n = r >= 0 ? (c = this.options.actionButtons) == null ? void 0 : c[r] : (h = this.options.actionButtons) == null ? void 0 : h.find((p) => p.action === i);
2419
+ if (!n) return;
2420
+ const a = n.getTooltipCallback ? n.getTooltipCallback(this) : n.tooltip;
2421
+ if (!a) return;
2422
+ const l = `action-${r >= 0 ? r : i}`;
2423
+ this.spawnTooltip({ id: l, trigger: o, content: a });
2457
2424
  });
2458
- this.actionButtonTooltipCleanups.set(s, i);
2459
- }
2460
- cleanupActionButtonTooltip(e) {
2461
- const t = this.actionButtonTooltipCleanups.get(e);
2462
- t && (t(), this.actionButtonTooltipCleanups.delete(e));
2463
2425
  }
2426
+ /**
2427
+ * Destroy only the action-button tooltips. Called from `renderDropdown`/`renderDropdownVirtual`
2428
+ * before rebuilding the actions row, so per-button tooltip state doesn't leak.
2429
+ */
2464
2430
  destroyAllActionButtonTooltips() {
2465
- this.actionButtonTooltipCleanups.forEach((e) => e()), this.actionButtonTooltipCleanups.clear(), this.actionButtonTooltips.forEach((e) => e.remove()), this.actionButtonTooltips.clear();
2431
+ var e;
2432
+ for (const t of Array.from(this.tooltips.keys()))
2433
+ t.startsWith("action-") && ((e = this.tooltips.get(t)) == null || e.destroy(), this.tooltips.delete(t));
2434
+ }
2435
+ /**
2436
+ * Destroy main-badges-container tooltips. Called before re-rendering the badges container.
2437
+ * Popover tooltips (prefixed `popover-`) survive — they're owned by the popover lifecycle and
2438
+ * cleaned up in `hideSelectedPopover`. Action-button tooltips (prefixed `action-`) survive too.
2439
+ */
2440
+ destroyAllBadgeTooltips() {
2441
+ var e;
2442
+ for (const t of Array.from(this.tooltips.keys()))
2443
+ !t.startsWith("action-") && !t.startsWith("popover-") && ((e = this.tooltips.get(t)) == null || e.destroy(), this.tooltips.delete(t));
2466
2444
  }
2467
2445
  // ========================================================================
2468
2446
  // PUBLIC API
2469
2447
  // ========================================================================
2470
2448
  destroy() {
2471
- this.destroyAllBadgeTooltips(), this.destroyAllActionButtonTooltips(), this.dropdownCleanup && this.dropdownCleanup(), this.hintCleanup && this.hintCleanup(), this.selectedPopoverCleanup && this.selectedPopoverCleanup(), this.documentClickHandler && (document.removeEventListener("click", this.documentClickHandler), this.documentClickHandler = null), this.documentKeydownHandler && (document.removeEventListener("keydown", this.documentKeydownHandler), this.documentKeydownHandler = null), this.virtualScroll && (this.virtualScroll.destroy(), this.virtualScroll = null), this.dropdown && this.dropdown.remove(), this.hint && this.hint.remove(), this.selectedPopover && this.selectedPopover.remove(), this.element.innerHTML = "", this.element.classList.remove("ms", "ms--open", "ms--no-checkboxes"), le.info(`[${this.instanceId}] Component destroyed`);
2449
+ this.destroyAllTooltips(), this.dropdownCleanup && this.dropdownCleanup(), this.hintCleanup && this.hintCleanup(), this.selectedPopoverCleanup && this.selectedPopoverCleanup(), this.documentClickHandler && (document.removeEventListener("click", this.documentClickHandler), this.documentClickHandler = null), this.documentKeydownHandler && (document.removeEventListener("keydown", this.documentKeydownHandler), this.documentKeydownHandler = null), this.virtualScroll && (this.virtualScroll.destroy(), this.virtualScroll = null), this.dropdown && this.dropdown.remove(), this.hint && this.hint.remove(), this.selectedPopover && this.selectedPopover.remove(), this.element.innerHTML = "", this.element.classList.remove("ms", "ms--open", "ms--no-checkboxes"), oe.info(`[${this.instanceId}] Component destroyed`);
2450
+ }
2451
+ }
2452
+ const ks = `:host{--ms-rem: 10px;font-family:var(--ms-font-family, var(--base-font-family, inherit));display:block;--ms-accent-color: var(--base-accent-color, #3b82f6);--ms-accent-color-hover: var(--base-accent-color-hover, #2563eb);--ms-accent-color-active: var(--base-accent-color-active, #1d4ed8);--ms-accent-color-light: var(--base-accent-color-light, #eff6ff);--ms-accent-color-light-hover: var(--base-accent-color-light-hover, #e0f2fe);--ms-text-color-1: var(--base-text-color-1, #111827);--ms-text-color-2: var(--base-text-color-2, #353b47);--ms-text-color-3: var(--base-text-color-3, #6b7280);--ms-text-color-4: var(--base-text-color-4, #a0a3a9);--ms-text-color-on-accent: var(--base-text-color-on-accent, #ffffff);--ms-text-primary: var(--ms-text-color-1);--ms-text-secondary: var(--ms-text-color-3);--ms-primary-bg: var(--base-primary-bg, var(--base-main-bg, #f3f4f6));--ms-primary-bg-hover: var(--base-hover-bg, #e5e7eb);--ms-border-color: var(--base-border-color, #e5e7eb);--ms-border: var(--base-border, 1px solid var(--ms-border-color));--ms-input-bg: var(--base-input-bg, #ffffff);--ms-input-color: var(--base-input-color, var(--ms-text-color-1));--ms-input-border: var(--base-input-border, 1px solid var(--ms-border-color));--ms-input-border-hover: var(--base-input-border-hover, 1px solid var(--ms-accent-color));--ms-input-border-focus: var(--base-input-border-focus, 1px solid var(--ms-accent-color));--ms-input-placeholder-color: var(--base-input-placeholder-color, var(--ms-text-color-4));--ms-input-bg-disabled: var(--base-input-bg-disabled, rgba(107, 114, 128, .05));--ms-toggle-icon-color: var(--ms-text-color-3);--ms-toggle-icon-color-open: var(--ms-text-color-3);--ms-counter-badge-bg: var(--ms-accent-color);--ms-counter-badge-bg-hover: var(--ms-accent-color-hover);--ms-counter-badge-color: var(--ms-text-color-on-accent);--ms-hint-bg: var(--base-main-bg, #ffffff);--ms-hint-color: var(--ms-text-color-4);--ms-hint-border-color: var(--ms-border-color);--ms-dropdown-bg: var(--base-dropdown-bg, #ffffff);--ms-dropdown-text-color: var(--ms-text-color-1);--ms-dropdown-border-color: var(--ms-border-color);--ms-dropdown-box-shadow-semantic: var(--base-dropdown-box-shadow, 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1));--ms-actions-bg: var(--base-main-bg, #ffffff);--ms-actions-border-color: var(--ms-border-color);--ms-action-button-bg: transparent;--ms-action-button-bg-hover: var(--ms-primary-bg);--ms-action-button-border-color: var(--ms-border-color);--ms-action-button-border-color-hover: var(--ms-accent-color);--ms-action-button-color: var(--ms-text-color-1);--ms-group-border-color: var(--ms-border-color);--ms-option-text-color: var(--ms-text-color-1);--ms-option-bg: transparent;--ms-option-bg-hover: var(--ms-primary-bg);--ms-option-color-hover: inherit;--ms-option-bg-focused: var(--ms-primary-bg);--ms-option-color-focused: inherit;--ms-option-outline-color-focused: var(--ms-accent-color);--ms-option-bg-selected: color-mix(in srgb, var(--ms-accent-color) 10%, transparent);--ms-option-bg-matched: color-mix(in srgb, var(--ms-accent-color) 8%, transparent);--ms-option-color-matched: inherit;--ms-option-border-matched-color: color-mix(in srgb, var(--ms-accent-color) 40%, transparent);--ms-option-title-color: var(--ms-text-color-1);--ms-option-subtitle-color: var(--ms-text-color-3);--ms-option-mark-bg: color-mix(in srgb, var(--ms-accent-color) 20%, transparent);--ms-option-mark-color: inherit;--ms-loading-color: var(--ms-text-color-3);--ms-badge-bg: var(--ms-accent-color-light);--ms-badge-bg-hover: var(--base-hover-bg, var(--ms-input-bg));--ms-badge-bg-active: var(--ms-accent-color-light-hover);--ms-badge-text-bg-hover: var(--base-hover-bg, var(--ms-input-bg));--ms-badge-text-color-hover: var(--ms-badge-text-color);--ms-badge-counter-border-color: var(--ms-border-color);--ms-badge-counter-text-bg: var(--ms-primary-bg-hover);--ms-badge-counter-text-color: var(--ms-text-color-1);--ms-badge-counter-remove-bg: var(--ms-text-color-3);--ms-badge-counter-remove-bg-hover: var(--ms-text-color-1);--ms-badge-counter-remove-color: var(--ms-text-color-on-accent);--ms-counter-wrapper-border-color: var(--ms-border-color);--ms-count-clear-bg-hover: var(--ms-accent-color);--ms-tooltip-bg: var(--base-tooltip-bg, #333333);--ms-tooltip-text-color: var(--base-tooltip-text-color, #ffffff);--ms-selected-popover-bg: var(--base-dropdown-bg, #ffffff);--ms-selected-popover-border-color: var(--ms-border-color);--ms-selected-popover-header-border-color: var(--ms-border-color);--ms-selected-popover-close-bg-hover: var(--ms-accent-color);--ms-input-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-input-padding-right: calc(4 * var(--ms-rem));--ms-input-padding-h: calc(1.2 * var(--ms-rem));--ms-input-height: calc(var(--base-input-size-md-height, 3.5) * var(--ms-rem));--ms-input-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-input-border-width: 1px;--ms-input-border-radius: var(--ms-border-radius-md);--ms-input-text: var(--ms-text-color-1);--ms-input-bg-disabled: rgba(107, 114, 128, .05);--ms-input-size-xs-font: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-input-size-xs-padding-v: calc(.4 * var(--ms-rem));--ms-input-size-xs-padding-h: calc(.8 * var(--ms-rem));--ms-input-size-xs-height: calc(var(--base-input-size-xs-height, 3.1) * var(--ms-rem));--ms-input-size-sm-font: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-input-size-sm-padding-v: calc(.5 * var(--ms-rem));--ms-input-size-sm-padding-h: calc(1 * var(--ms-rem));--ms-input-size-sm-height: calc(var(--base-input-size-sm-height, 3.3) * var(--ms-rem));--ms-input-size-md-font: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-input-size-md-padding-v: calc(.8 * var(--ms-rem));--ms-input-size-md-padding-h: calc(1.2 * var(--ms-rem));--ms-input-size-md-height: calc(var(--base-input-size-md-height, 3.5) * var(--ms-rem));--ms-input-size-lg-font: calc(var(--base-font-size-base, 1.6) * var(--ms-rem));--ms-input-size-lg-padding-v: calc(1 * var(--ms-rem));--ms-input-size-lg-padding-h: calc(1.4 * var(--ms-rem));--ms-input-size-lg-height: calc(var(--base-input-size-lg-height, 3.8) * var(--ms-rem));--ms-input-size-xl-font: calc(var(--base-font-size-lg, 1.8) * var(--ms-rem));--ms-input-size-xl-padding-v: calc(1.2 * var(--ms-rem));--ms-input-size-xl-padding-h: calc(1.6 * var(--ms-rem));--ms-input-size-xl-height: calc(var(--base-input-size-xl-height, 4.1) * var(--ms-rem));--ms-toggle-right: calc(1.2 * var(--ms-rem));--ms-toggle-color: var(--ms-text-color-3);--ms-transform-center-y: translateY(-50%);--ms-transform-rotate-180: 180deg;--ms-counter-offset: calc(3.2 * var(--ms-rem));--ms-counter-padding: calc(.2 * var(--ms-rem)) calc(.4 * var(--ms-rem));--ms-counter-bg: var(--ms-accent-color);--ms-counter-color: var(--ms-text-color-on-accent);--ms-counter-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-counter-font-weight: var(--base-font-weight-semibold, 600);--ms-counter-border-radius: var(--ms-border-radius-sm);--ms-counter-bg-hover: var(--ms-accent-color-hover);--ms-transform-scale-hover: 1.1;--ms-hint-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-hint-border: 1px solid var(--ms-hint-border-color);--ms-hint-border-radius: var(--ms-border-radius-lg);--ms-hint-box-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--ms-hint-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-dropdown-border: var(--base-dropdown-border, 1px solid var(--ms-dropdown-border-color));--ms-dropdown-border-radius: var(--ms-border-radius-lg);--ms-dropdown-box-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--ms-options-max-height: calc(32 * var(--ms-rem));--ms-option-color: var(--ms-text-color-1);--ms-z-index-dropdown: 9999;--ms-z-index-sticky: 1;--ms-actions-gap: calc(.4 * var(--ms-rem));--ms-actions-padding: calc(.8 * var(--ms-rem));--ms-actions-border-bottom: 1px solid var(--ms-actions-border-color);--ms-action-btn-padding: calc(.4 * var(--ms-rem)) calc(.8 * var(--ms-rem));--ms-action-btn-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-action-btn-border: var(--ms-border);--ms-action-btn-border-radius: var(--ms-border-radius-sm);--ms-action-btn-bg: transparent;--ms-action-btn-color: inherit;--ms-action-btn-bg-hover: var(--ms-primary-bg);--ms-action-btn-border-color-hover: var(--ms-accent-color);--ms-transform-scale-active: .98;--ms-options-padding: 0;--ms-group-border-top: 1px solid var(--ms-group-border-color);--ms-group-margin-top: calc(.4 * var(--ms-rem));--ms-group-padding-top: calc(.4 * var(--ms-rem));--ms-group-label-padding: calc(.4 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-group-label-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-group-label-font-weight: var(--base-font-weight-semibold, 600);--ms-group-label-color: var(--ms-text-color-3);--ms-group-label-transform: uppercase;--ms-group-label-letter-spacing: .05em;--ms-option-gap: calc(.8 * var(--ms-rem));--ms-option-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-option-padding-h: calc(1.2 * var(--ms-rem));--ms-option-outline-focused: 2px solid var(--ms-option-outline-color-focused);--ms-option-focus-outline-offset: -2px;--ms-option-border-matched: 3px solid var(--ms-option-border-matched-color);--ms-option-bg-focused-hover: var(--ms-primary-bg);--ms-option-bg-matched-hover: color-mix(in srgb, var(--ms-accent-color) 12%, transparent);--ms-option-bg-selected-focused: color-mix(in srgb, var(--ms-accent-color) 15%, transparent);--ms-option-bg-selected-matched: color-mix(in srgb, var(--ms-accent-color) 15%, transparent);--ms-option-disabled-bg: var(--base-disabled-bg, transparent);--ms-option-bg-disabled-selected: color-mix(in srgb, var(--ms-accent-color) 10%, transparent);--ms-disabled-opacity: .5;--ms-option-content-gap: calc(.8 * var(--ms-rem));--ms-option-icon-size: calc(2 * var(--ms-rem));--ms-option-icon-font-size: calc(var(--base-font-size-base, 1.6) * var(--ms-rem));--ms-option-title-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-option-mark-font-weight: var(--base-font-weight-semibold, 600);--ms-option-subtitle-margin-top: calc(.4 * var(--ms-rem));--ms-option-subtitle-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-option-subtitle-line-height: var(--base-line-height-tight, 1.25);--ms-checkbox-margin-top: calc(.2 * var(--ms-rem));--ms-checkbox-margin-right: 0;--ms-checkbox-margin-bottom: 0;--ms-checkbox-margin-left: 0;--ms-checkbox-size: calc(1.6 * var(--ms-rem));--ms-checkbox-scale: 1;--ms-checkbox-align: center;--ms-checkbox-bg: var(--ms-input-bg);--ms-checkbox-border: var(--ms-border);--ms-checkbox-border-radius: calc(.3 * var(--ms-rem));--ms-checkbox-checked-bg: var(--ms-accent-color);--ms-checkbox-checked-border: 1px solid var(--ms-accent-color);--ms-checkbox-checkmark-color: var(--ms-text-color-on-accent);--ms-checkbox-hover-border-color: var(--ms-accent-color);--ms-checkbox-disabled-bg: var(--ms-primary-bg);--ms-checkbox-disabled-border: var(--ms-border);--ms-checkbox-checked-bg-hover: var(--ms-accent-color-hover);--ms-checkbox-checked-border-color-hover: var(--ms-accent-color-hover);--ms-empty-padding: calc(1.6 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-empty-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-empty-color: var(--ms-text-color-3);--ms-loader-padding: calc(1.6 * var(--ms-rem));--ms-loader-gap: calc(.8 * var(--ms-rem));--ms-loading-text-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-loading-text-color: var(--ms-text-color-3);--ms-badges-gap: calc(.8 * var(--ms-rem));--ms-badges-margin-bottom: calc(.8 * var(--ms-rem));--ms-badges-margin-top: calc(.8 * var(--ms-rem));--ms-badges-margin-left: calc(.4 * var(--ms-rem));--ms-badges-margin-right: calc(.4 * var(--ms-rem));--ms-inline-align: center;--ms-badge-gap: calc(.8 * var(--ms-rem));--ms-badge-height: calc(2.7 * var(--ms-rem));--ms-badge-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-badge-font-weight: var(--base-font-weight-semibold, 600);--ms-badge-border-radius: var(--ms-border-radius-sm);--ms-order-first: -1;--ms-badge-text-padding: 0 calc(.8 * var(--ms-rem));--ms-badge-text-bg: var(--ms-accent-color-light);--ms-badge-text-color: var(--ms-accent-color);--ms-badge-text-border: none;--ms-badge-remove-width: calc(2.7 * var(--ms-rem));--ms-badge-remove-bg: var(--ms-accent-color);--ms-badge-remove-color: var(--ms-text-color-on-accent);--ms-badge-remove-border: none;--ms-badge-remove-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-badge-remove-bg-hover: var(--ms-accent-color-hover);--ms-badge-remove-box-shadow-focus: 0 0 0 2px color-mix(in srgb, var(--ms-accent-color) 50%, transparent);--ms-badge-remove-icon-size: calc(1 * var(--ms-rem));--ms-icon-remove: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 6L18 18M18 6L6 18' stroke='black' stroke-width='2.5' stroke-linecap='round' fill='none'/></svg>");--ms-badge-counter-bg: transparent;--ms-badge-counter-border: 1px solid var(--ms-badge-counter-border-color);--ms-badge-counter-border-radius: var(--ms-border-radius-sm);--ms-more-badge-bg: var(--ms-accent-color-light);--ms-more-badge-hover-bg: var(--ms-badge-bg-hover);--ms-more-badge-active-bg: var(--ms-accent-color-light-hover);--ms-count-display-margin-bottom: calc(.8 * var(--ms-rem));--ms-count-display-margin-top: calc(.8 * var(--ms-rem));--ms-count-display-margin-left: calc(.8 * var(--ms-rem));--ms-count-display-margin-right: calc(.8 * var(--ms-rem));--ms-counter-wrapper-bg: transparent;--ms-counter-wrapper-border: var(--ms-border);--ms-counter-wrapper-border-radius: var(--ms-border-radius-sm);--ms-counter-wrapper-padding: calc(.4 * var(--ms-rem)) calc(.8 * var(--ms-rem));--ms-counter-wrapper-gap: calc(.4 * var(--ms-rem));--ms-counter-wrapper-bg-hover: var(--ms-primary-bg);--ms-counter-wrapper-border-color-hover: var(--ms-accent-color);--ms-count-text-bg: transparent;--ms-count-text-border: none;--ms-count-text-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-count-text-color: var(--ms-text-color-1);--ms-count-clear-size: calc(1.6 * var(--ms-rem));--ms-count-clear-bg: transparent;--ms-count-clear-color: var(--ms-text-color-3);--ms-count-clear-font-size: calc(var(--base-font-size-lg, 1.8) * var(--ms-rem));--ms-count-clear-border-radius: var(--ms-border-radius-sm);--ms-count-clear-bg-hover: color-mix(in srgb, var(--ms-accent-color) 20%, transparent);--ms-count-clear-color-hover: var(--ms-accent-color);--ms-count-clear-icon-size: calc(1.4 * var(--ms-rem));--ms-icon-clear: var(--ms-icon-remove);--ms-tooltip-color: var(--ms-tooltip-text-color);--ms-tooltip-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-tooltip-border-radius: var(--ms-border-radius-lg);--ms-tooltip-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-tooltip-max-width: calc(32 * var(--ms-rem));--ms-tooltip-shadow: 0 2px 8px rgba(0, 0, 0, .15);--ms-tooltip-z-index: 10000;--ms-z-index-popover: 10000;--ms-selected-popover-width: calc(32 * var(--ms-rem));--ms-selected-popover-max-height: calc(32 * var(--ms-rem));--ms-selected-popover-border: 1px solid var(--ms-selected-popover-border-color);--ms-selected-popover-border-radius: var(--ms-border-radius-lg);--ms-selected-popover-box-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--ms-selected-popover-header-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-selected-popover-header-bg: color-mix(in srgb, var(--ms-accent-color) 10%, transparent);--ms-selected-popover-header-border-bottom: 1px solid var(--ms-selected-popover-header-border-color);--ms-selected-popover-header-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-selected-popover-header-font-weight: var(--base-font-weight-semibold, 600);--ms-selected-popover-header-color: var(--ms-text-color-1);--ms-popover-close-size: calc(2.4 * var(--ms-rem));--ms-selected-popover-close-bg: transparent;--ms-selected-popover-close-color: var(--ms-text-color-3);--ms-selected-popover-close-font-size: calc(var(--base-font-size-xl, 2) * var(--ms-rem));--ms-selected-popover-close-border-radius: var(--ms-border-radius-sm);--ms-selected-popover-close-bg-hover: color-mix(in srgb, var(--ms-accent-color) 20%, transparent);--ms-selected-popover-close-color-hover: var(--ms-accent-color);--ms-selected-popover-close-icon-size: calc(1.4 * var(--ms-rem));--ms-selected-popover-body-gap: calc(.4 * var(--ms-rem));--ms-selected-popover-body-padding: calc(.8 * var(--ms-rem));--ms-selected-popover-body-max-height: calc(28.8 * var(--ms-rem));--ms-font-size-2xs: calc(var(--base-font-size-2xs, 1) * var(--ms-rem));--ms-font-size-xs: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-font-size-sm: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-font-size-base: calc(var(--base-font-size-base, 1.6) * var(--ms-rem));--ms-font-size-lg: calc(var(--base-font-size-lg, 1.8) * var(--ms-rem));--ms-font-weight-normal: var(--base-font-weight-normal, 400);--ms-font-weight-medium: var(--base-font-weight-medium, 500);--ms-font-weight-semibold: var(--base-font-weight-semibold, 600);--ms-line-height-none: 1;--ms-line-height-tight: var(--base-line-height-tight, 1.25);--ms-line-height-normal: var(--base-line-height-normal, 1.5);--ms-line-height-relaxed: var(--base-line-height-relaxed, 1.75);--ms-border-radius-sm: calc(var(--base-border-radius-sm, .4) * var(--ms-rem));--ms-border-radius-md: calc(var(--base-border-radius-md, .6) * var(--ms-rem));--ms-border-radius-lg: calc(var(--base-border-radius-lg, .8) * var(--ms-rem));--ms-border-radius: var(--ms-border-radius-md);--ms-spacing-xs: calc(.4 * var(--ms-rem));--ms-spacing-sm: calc(.8 * var(--ms-rem));--ms-spacing-md: calc(1.2 * var(--ms-rem));--ms-spacing-lg: calc(1.6 * var(--ms-rem));--ms-transition-fast: .15s;--ms-transition-normal: .2s;--ms-easing-snappy: cubic-bezier(.4, 0, .2, 1);--ms-placeholder-opacity: .6;--ms-disabled-input-opacity: .6;--ms-scrollbar-width: 8px;--ms-scrollbar-track-bg: transparent;--ms-scrollbar-thumb-bg: var(--ms-border-color);--ms-scrollbar-thumb-bg-hover: var(--ms-text-color-3);--ms-scrollbar-thumb-border-radius: 4px}multi-select:not(:defined){display:block;min-height:calc(3.5 * var(--ms-rem));color:transparent!important;background:transparent}.ms-wrapper{display:flex;flex-direction:column;align-items:stretch}.ms-wrapper--inline{flex-direction:row;align-items:var(--ms-inline-align, center)}.ms{position:relative;width:100%}.ms__input-wrapper{position:relative;display:flex;align-items:center}.ms__input{box-sizing:border-box;width:100%;font-family:inherit;height:var(--ms-input-height);padding:var(--ms-input-padding);padding-right:var(--ms-input-padding-right);font-size:var(--ms-input-font-size);border:var(--ms-input-border);border-radius:var(--ms-input-border-radius);background:var(--ms-input-bg);color:var(--ms-input-color);cursor:pointer;transition:border var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__input:hover:not(:focus):not(:disabled){border:var(--ms-input-border-hover)}.ms__input:focus{outline:none;border:var(--ms-input-border-focus)}.ms__input::placeholder{color:var(--ms-input-placeholder-color);opacity:0;transition:opacity var(--ms-transition-fast) var(--ms-easing-snappy)}:host([data-ready]) .ms__input::placeholder{opacity:var(--ms-placeholder-opacity)}.ms__input.ms__input--xs{font-size:var(--ms-input-size-xs-font);padding:var(--ms-input-size-xs-padding-v) var(--ms-input-size-xs-padding-h);padding-right:calc(var(--ms-input-size-xs-padding-h) * 2.5);height:var(--ms-input-size-xs-height)}.ms__input.ms__input--sm{font-size:var(--ms-input-size-sm-font);padding:var(--ms-input-size-sm-padding-v) var(--ms-input-size-sm-padding-h);padding-right:calc(var(--ms-input-size-sm-padding-h) * 2.5);height:var(--ms-input-size-sm-height)}.ms__input.ms__input--lg{font-size:var(--ms-input-size-lg-font);padding:var(--ms-input-size-lg-padding-v) var(--ms-input-size-lg-padding-h);padding-right:calc(var(--ms-input-size-lg-padding-h) * 2.5);height:var(--ms-input-size-lg-height)}.ms__input.ms__input--xl{font-size:var(--ms-input-size-xl-font);padding:var(--ms-input-size-xl-padding-v) var(--ms-input-size-xl-padding-h);padding-right:calc(var(--ms-input-size-xl-padding-h) * 2.5);height:var(--ms-input-size-xl-height)}.ms__toggle{position:absolute;right:var(--ms-toggle-right);top:50%;transform:var(--ms-transform-center-y);pointer-events:none;color:var(--ms-toggle-icon-color);transition:transform var(--ms-transition-fast) var(--ms-easing-snappy)}.ms--open .ms__toggle{transform:var(--ms-transform-center-y) rotate(var(--ms-transform-rotate-180));color:var(--ms-toggle-icon-color-open)}.ms__counter{position:absolute;right:var(--ms-counter-offset);top:50%;transform:var(--ms-transform-center-y);padding:var(--ms-counter-padding);background:var(--ms-counter-badge-bg);color:var(--ms-counter-badge-color);font-size:var(--ms-counter-font-size);font-weight:var(--ms-counter-font-weight);border-radius:var(--ms-counter-border-radius);cursor:pointer;transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__counter:hover{background:var(--ms-counter-badge-bg-hover);transform:var(--ms-transform-center-y) scale(var(--ms-transform-scale-hover))}.ms__hint{display:none;position:fixed;z-index:var(--ms-z-index-popover);padding:var(--ms-hint-padding);background:var(--ms-hint-bg);border:var(--ms-hint-border);border-radius:var(--ms-hint-border-radius);box-shadow:var(--ms-hint-box-shadow);font-size:var(--ms-hint-font-size);color:var(--ms-hint-color);line-height:var(--ms-line-height-relaxed);max-width:100%}.ms__hint--visible{display:block}.ms__dropdown{display:none;position:fixed;font-family:inherit;z-index:var(--ms-z-index-dropdown);background:var(--ms-dropdown-bg);border:var(--ms-dropdown-border);border-radius:var(--ms-dropdown-border-radius);box-shadow:var(--ms-dropdown-box-shadow);max-height:var(--ms-options-max-height);overflow:hidden;color:var(--ms-dropdown-text-color)}.ms__dropdown--visible{display:flex;flex-direction:column}.ms__dropdown-inner{flex:1;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:var(--ms-scrollbar-thumb-bg) var(--ms-scrollbar-track-bg)}.ms__dropdown-inner::-webkit-scrollbar{width:var(--ms-scrollbar-width)}.ms__dropdown-inner::-webkit-scrollbar-track{background:var(--ms-scrollbar-track-bg)}.ms__dropdown-inner::-webkit-scrollbar-thumb{background:var(--ms-scrollbar-thumb-bg);border-radius:var(--ms-scrollbar-thumb-border-radius)}.ms__dropdown-inner::-webkit-scrollbar-thumb:hover{background:var(--ms-scrollbar-thumb-bg-hover)}.ms__dropdown--virtual{max-height:none}.ms__dropdown--virtual .ms__dropdown-inner{overflow-y:visible}.ms__actions{display:flex;flex-wrap:nowrap;gap:var(--ms-actions-gap);padding:var(--ms-actions-padding);border-bottom:var(--ms-actions-border-bottom)}.ms__actions--wrap{flex-wrap:wrap}.ms__actions--sticky{position:sticky;top:0;z-index:var(--ms-z-index-sticky);background:var(--ms-actions-bg)}.ms__action-btn{flex:1;font-family:inherit;padding:var(--ms-action-btn-padding);font-size:var(--ms-action-btn-font-size);border:var(--ms-action-btn-border);border-radius:var(--ms-action-btn-border-radius);background:var(--ms-action-button-bg);color:var(--ms-action-button-color);cursor:pointer;transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__action-btn:hover{background:var(--ms-action-button-bg-hover);border-color:var(--ms-action-button-border-color-hover)}.ms__action-btn:active{transform:scale(var(--ms-transform-scale-active))}.ms__action-btn:disabled,.ms__action-btn[disabled]{opacity:var(--ms-disabled-opacity);cursor:not-allowed;pointer-events:none}.ms__options{padding:var(--ms-options-padding);scrollbar-width:thin;scrollbar-color:var(--ms-scrollbar-thumb-bg) var(--ms-scrollbar-track-bg)}.ms__options::-webkit-scrollbar{width:var(--ms-scrollbar-width)}.ms__options::-webkit-scrollbar-track{background:var(--ms-scrollbar-track-bg)}.ms__options::-webkit-scrollbar-thumb{background:var(--ms-scrollbar-thumb-bg);border-radius:var(--ms-scrollbar-thumb-border-radius)}.ms__options::-webkit-scrollbar-thumb:hover{background:var(--ms-scrollbar-thumb-bg-hover)}.ms__options--virtual .ms__option{height:var(--ms-option-height, 50px);min-height:var(--ms-option-height, 50px);max-height:var(--ms-option-height, 50px);overflow:hidden;box-sizing:border-box}.ms__group+.ms__group{border-top:var(--ms-group-border-top);margin-top:var(--ms-group-margin-top);padding-top:var(--ms-group-padding-top)}.ms__group-label{padding:var(--ms-group-label-padding);font-size:var(--ms-group-label-font-size);font-weight:var(--ms-group-label-font-weight);color:var(--ms-group-label-color);text-transform:var(--ms-group-label-transform);letter-spacing:var(--ms-group-label-letter-spacing)}.ms__option{display:flex;align-items:var(--ms-checkbox-align, center);gap:var(--ms-option-gap);padding:var(--ms-option-padding);color:var(--ms-option-text-color);background:var(--ms-option-bg);cursor:pointer}.ms__option:hover{background:var(--ms-option-bg-hover);color:var(--ms-option-color-hover, inherit)}.ms__option--focused{background:var(--ms-option-bg-focused);color:var(--ms-option-color-focused, inherit);outline:var(--ms-option-outline-focused);outline-offset:var(--ms-option-focus-outline-offset)}.ms__option--matched{background:var(--ms-option-bg-matched);color:var(--ms-option-color-matched, inherit);border-left:var(--ms-option-border-matched)}.ms__option--selected{background:var(--ms-option-bg-selected)}.ms__option--selected:hover{background:var(--ms-option-bg-selected-hover, var(--ms-option-bg-selected))}.ms__option--disabled{opacity:var(--ms-disabled-opacity);cursor:not-allowed;background:var(--ms-option-disabled-bg)}.ms__option--disabled:hover{background:var(--ms-option-disabled-bg)}.ms__option--focused:hover{background:var(--ms-option-bg-focused-hover);color:var(--ms-option-color-focused-hover, var(--ms-option-color-focused, var(--ms-option-text-color)))}.ms__option--matched:hover{background:var(--ms-option-bg-matched-hover);color:var(--ms-option-color-matched-hover, var(--ms-option-color-matched, var(--ms-option-text-color)))}.ms__option--selected.ms__option--focused{background:var(--ms-option-bg-selected-focused);outline:var(--ms-option-outline-focused);outline-offset:var(--ms-option-focus-outline-offset)}.ms__option--selected.ms__option--matched{background:var(--ms-option-bg-selected-matched);border-left:var(--ms-option-border-matched)}.ms__option--disabled.ms__option--selected{background:var(--ms-option-bg-disabled-selected)}.ms__option--disabled.ms__option--focused{outline:none}.ms__option[data-checkbox-align=top]{--ms-checkbox-align: flex-start}.ms__option[data-checkbox-align=bottom]{--ms-checkbox-align: flex-end}.ms__checkbox{appearance:none;-webkit-appearance:none;-moz-appearance:none;flex-shrink:0;position:relative;margin-top:var(--ms-checkbox-margin-top);margin-right:var(--ms-checkbox-margin-right);margin-bottom:var(--ms-checkbox-margin-bottom);margin-left:var(--ms-checkbox-margin-left);width:var(--ms-checkbox-size);height:var(--ms-checkbox-size);transform:scale(var(--ms-checkbox-scale));transform-origin:top left;cursor:pointer;background:var(--ms-checkbox-bg);border:var(--ms-checkbox-border);border-radius:var(--ms-checkbox-border-radius);transition:background-color .15s ease,border-color .15s ease}.ms__checkbox:after{content:"";position:absolute;display:none;left:50%;top:40%;width:30%;height:55%;transform:translate(-50%,-50%) rotate(45deg);border:solid var(--ms-checkbox-checkmark-color);border-width:0 2px 2px 0}.ms__checkbox:hover:not(:disabled){border-color:var(--ms-checkbox-hover-border-color)}.ms__checkbox:checked{background:var(--ms-checkbox-checked-bg);border:var(--ms-checkbox-checked-border)}.ms__checkbox:checked:after{display:block}.ms__checkbox:checked:hover:not(:disabled){background:var(--ms-checkbox-checked-bg-hover);border-color:var(--ms-checkbox-checked-border-color-hover)}.ms__checkbox:focus-visible{outline:2px solid var(--ms-checkbox-checked-bg);outline-offset:2px}.ms__checkbox:disabled{cursor:not-allowed;background:var(--ms-checkbox-disabled-bg);border:var(--ms-checkbox-disabled-border);opacity:.6}.ms__checkbox:disabled:checked{background:var(--ms-checkbox-disabled-bg)}.ms__option--disabled .ms__checkbox{cursor:not-allowed}.ms__option-content{flex:1;display:flex;align-items:center;gap:var(--ms-option-content-gap);min-width:0}.ms__option-icon{flex-shrink:0;width:var(--ms-option-icon-size);height:var(--ms-option-icon-size);display:flex;align-items:center;justify-content:center;font-size:var(--ms-option-icon-font-size)}.ms__option-icon svg{width:100%;height:100%;fill:currentColor}.ms__option-text{flex:1;min-width:0}.ms__option-title{font-size:var(--ms-option-title-font-size);color:var(--ms-option-title-color);line-height:var(--ms-line-height-relaxed)}.ms__option:hover .ms__option-title{color:var(--ms-option-title-color-hover, var(--ms-option-title-color))}.ms__option--selected .ms__option-title{color:var(--ms-option-title-color-selected, var(--ms-option-title-color))}.ms__option--selected:hover .ms__option-title{color:var(--ms-option-title-color-selected-hover, var(--ms-option-title-color-selected, var(--ms-option-title-color)))}.ms__option-title mark{background:var(--ms-option-mark-bg);color:var(--ms-option-mark-color);font-weight:var(--ms-option-mark-font-weight)}.ms__option-subtitle{margin-top:var(--ms-option-subtitle-margin-top);font-size:var(--ms-option-subtitle-font-size);color:var(--ms-option-subtitle-color);line-height:var(--ms-option-subtitle-line-height)}.ms__option:hover .ms__option-subtitle{color:var(--ms-option-subtitle-color-hover, var(--ms-option-subtitle-color))}.ms__option--selected .ms__option-subtitle{color:var(--ms-option-subtitle-color-selected, var(--ms-option-subtitle-color))}.ms__option--selected:hover .ms__option-subtitle{color:var(--ms-option-subtitle-color-selected-hover, var(--ms-option-subtitle-color-selected, var(--ms-option-subtitle-color)))}.ms__empty{padding:var(--ms-empty-padding);text-align:center;font-size:var(--ms-empty-font-size);color:var(--ms-empty-color)}.ms__loader{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--ms-loader-padding);gap:var(--ms-loader-gap)}.ms__loading-text{font-size:var(--ms-loading-text-font-size);color:var(--ms-loading-color)}.ms__badges{display:flex;flex-wrap:wrap;gap:var(--ms-badges-gap);padding:0}.ms__badges:empty{display:none}.ms__badges--bottom{margin-top:var(--ms-badges-margin-bottom)}.ms__badges--top{margin-bottom:var(--ms-badges-margin-top);order:var(--ms-order-first)}.ms__badges--left{order:var(--ms-order-first);margin-right:var(--ms-badges-margin-left);justify-content:flex-end}.ms__badges--right{margin-left:var(--ms-badges-margin-right);justify-content:flex-start}.ms__count-display{display:flex;align-items:center}.ms__count-display:empty{display:none}.ms__count-display--bottom{margin-top:var(--ms-count-display-margin-bottom)}.ms__count-display--top{margin-bottom:var(--ms-count-display-margin-top);order:var(--ms-order-first)}.ms__count-display--left{order:var(--ms-order-first);margin-right:var(--ms-count-display-margin-left);justify-content:flex-start}.ms__count-display--right{margin-left:var(--ms-count-display-margin-right);justify-content:flex-end}.ms__counter-wrapper{display:inline-flex;align-items:center;gap:var(--ms-counter-wrapper-gap);background:var(--ms-counter-wrapper-bg);border:var(--ms-counter-wrapper-border);border-radius:var(--ms-counter-wrapper-border-radius);padding:var(--ms-counter-wrapper-padding);transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__counter-wrapper:hover{background:var(--ms-counter-wrapper-bg-hover);border-color:var(--ms-counter-wrapper-border-color-hover)}.ms__count-text{display:inline-flex;align-items:center;background:var(--ms-count-text-bg);border:var(--ms-count-text-border);padding:0;font-size:var(--ms-count-text-font-size);color:var(--ms-count-text-color);cursor:pointer;transition:color var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__count-clear{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:var(--ms-count-clear-size);height:var(--ms-count-clear-size);padding:0;border:none;background:var(--ms-count-clear-bg);color:var(--ms-count-clear-color);font-size:var(--ms-count-clear-font-size);line-height:var(--ms-line-height-none);cursor:pointer;border-radius:var(--ms-count-clear-border-radius);transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__count-clear:hover{background:var(--ms-count-clear-bg-hover);color:var(--ms-count-clear-color-hover)}.ms__count-clear:before{content:"";display:block;width:var(--ms-count-clear-icon-size);height:var(--ms-count-clear-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-clear) center / contain no-repeat;mask:var(--ms-icon-clear) center / contain no-repeat}.ms__badge{display:inline-flex;align-items:center;height:var(--ms-badge-height);font-size:var(--ms-badge-font-size);font-weight:var(--ms-badge-font-weight);line-height:var(--ms-line-height-none);border-radius:var(--ms-badge-border-radius);overflow:hidden;max-width:100%}.ms__badge-text{display:flex;align-items:center;box-sizing:border-box;height:100%;padding:var(--ms-badge-text-padding);background:var(--ms-badge-text-bg);color:var(--ms-badge-text-color);border:var(--ms-badge-text-border);border-right:none;border-radius:var(--ms-badge-border-radius) 0 0 var(--ms-badge-border-radius);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:background-color var(--ms-transition-normal) ease,color var(--ms-transition-normal) ease}.ms__badge:hover .ms__badge-text{background:var(--ms-badge-text-bg-hover, var(--ms-badge-text-bg));color:var(--ms-badge-text-color-hover, var(--ms-badge-text-color))}.ms__badge-remove{display:flex;align-items:center;justify-content:center;box-sizing:border-box;font-family:inherit;width:var(--ms-badge-remove-width);height:100%;flex-shrink:0;background:var(--ms-badge-remove-bg);color:var(--ms-badge-remove-color);border:var(--ms-badge-remove-border);border-left:none;border-radius:0 var(--ms-badge-border-radius) var(--ms-badge-border-radius) 0;cursor:pointer;transition:background-color var(--ms-transition-normal) ease;font-size:var(--ms-badge-remove-font-size)}.ms__badge-remove:hover{background:var(--ms-badge-remove-bg-hover)}.ms__badge-remove:focus{outline:none}.ms__badge-remove:focus-visible{outline:none;box-shadow:var(--ms-badge-remove-box-shadow-focus)}.ms__badge-remove:before{content:"";display:block;width:var(--ms-badge-remove-icon-size);height:var(--ms-badge-remove-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-remove) center / contain no-repeat;mask:var(--ms-icon-remove) center / contain no-repeat}.ms__badge--counter{cursor:pointer}.ms__badge--counter .ms__badge-text{background:var(--ms-badge-counter-text-bg);color:var(--ms-badge-counter-text-color);border:var(--ms-badge-counter-border);border-right:none}.ms__badge--counter .ms__badge-remove{background:var(--ms-badge-counter-remove-bg);color:var(--ms-badge-counter-remove-color);border:var(--ms-badge-counter-border);border-left:none}.ms__badge--counter .ms__badge-remove:hover{background:var(--ms-badge-counter-remove-bg-hover)}.ms__badge--more,.ms__badge[data-action=show-selected]{cursor:pointer}.ms__badge-tooltip{position:fixed;z-index:var(--ms-tooltip-z-index);opacity:0;visibility:hidden;transition:opacity var(--ms-transition-normal) ease,visibility var(--ms-transition-normal) ease;background:var(--ms-tooltip-bg);color:var(--ms-tooltip-text-color);padding:var(--ms-tooltip-padding);border-radius:var(--ms-tooltip-border-radius);font-size:var(--ms-tooltip-font-size);line-height:var(--ms-line-height-relaxed);max-width:var(--ms-tooltip-max-width);word-wrap:break-word;white-space:pre-wrap;box-shadow:var(--ms-tooltip-shadow);pointer-events:none}.ms__badge-tooltip--visible{opacity:1;visibility:visible}.ms__selected-popover{display:none;position:fixed;z-index:var(--ms-z-index-popover);background:var(--ms-selected-popover-bg);border:var(--ms-selected-popover-border);border-radius:var(--ms-selected-popover-border-radius);box-shadow:var(--ms-selected-popover-box-shadow);width:var(--ms-selected-popover-width);max-height:var(--ms-selected-popover-max-height);overflow:hidden}.ms__selected-popover--visible{display:flex;flex-direction:column}.ms__selected-popover--virtual{display:block;overflow:visible;max-height:none}.ms__selected-popover-header{display:flex;align-items:center;justify-content:space-between;padding:var(--ms-selected-popover-header-padding);background:var(--ms-selected-popover-header-bg);border-bottom:var(--ms-selected-popover-header-border-bottom);font-size:var(--ms-selected-popover-header-font-size);font-weight:var(--ms-selected-popover-header-font-weight);color:var(--ms-selected-popover-header-color)}.ms__selected-popover-close{display:flex;align-items:center;justify-content:center;width:var(--ms-popover-close-size);height:var(--ms-popover-close-size);padding:0;border:none;background:var(--ms-selected-popover-close-bg);color:var(--ms-selected-popover-close-color);font-size:var(--ms-selected-popover-close-font-size);line-height:var(--ms-line-height-none);cursor:pointer;border-radius:var(--ms-selected-popover-close-border-radius);transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__selected-popover-close:hover{background:var(--ms-selected-popover-close-bg-hover);color:var(--ms-selected-popover-close-color-hover)}.ms__selected-popover-close:before{content:"";display:block;width:var(--ms-selected-popover-close-icon-size);height:var(--ms-selected-popover-close-icon-size);background-color:currentColor;-webkit-mask:var(--ms-icon-remove) center / contain no-repeat;mask:var(--ms-icon-remove) center / contain no-repeat}.ms__selected-popover-body{display:flex;flex-direction:column;gap:var(--ms-selected-popover-body-gap);padding:var(--ms-selected-popover-body-padding);overflow-y:auto;max-height:var(--ms-selected-popover-body-max-height);scrollbar-width:thin;scrollbar-color:var(--ms-scrollbar-thumb-bg) var(--ms-scrollbar-track-bg)}.ms__selected-popover-body::-webkit-scrollbar{width:var(--ms-scrollbar-width)}.ms__selected-popover-body::-webkit-scrollbar-track{background:var(--ms-scrollbar-track-bg)}.ms__selected-popover-body::-webkit-scrollbar-thumb{background:var(--ms-scrollbar-thumb-bg);border-radius:var(--ms-scrollbar-thumb-border-radius)}.ms__selected-popover-body::-webkit-scrollbar-thumb:hover{background:var(--ms-scrollbar-thumb-bg-hover)}.ms__selected-popover-body .ms__badge{width:100%;min-height:fit-content;line-height:var(--ms-line-height-relaxed)}.ms__selected-popover-body .ms__badge-text{flex:1;min-width:0;white-space:normal;word-wrap:break-word}.ms__selected-popover-body--virtual{display:block;max-height:none;padding:0}.ms__selected-popover-body--virtual .ms__badge{height:var(--ms-badge-height-virtual, 36px);min-height:var(--ms-badge-height-virtual, 36px);max-height:var(--ms-badge-height-virtual, 36px);margin-bottom:var(--ms-selected-popover-body-gap);overflow:hidden;box-sizing:border-box}.ms__selected-popover-body--virtual .ms__badge-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ms--rtl .ms__input-wrapper{direction:rtl}.ms--rtl .ms__input{text-align:right;padding-left:var(--ms-input-padding-right);padding-right:var(--ms-input-padding-h)}.ms--rtl .ms__toggle{left:var(--ms-toggle-right)!important;right:auto!important}.ms--rtl .ms__counter{left:var(--ms-counter-offset)!important;right:auto!important}.ms--rtl .ms__dropdown{direction:rtl;text-align:right}.ms--rtl .ms__option{flex-direction:row-reverse}.ms--rtl .ms__checkbox{margin-left:var(--ms-spacing-sm);margin-right:0}.ms--rtl .ms__option-content{text-align:right}.ms--rtl .ms__option-icon{margin-left:var(--ms-spacing-xs);margin-right:0}.ms--rtl .ms__badges{direction:rtl}.ms--rtl .ms__badges--right{margin-left:0;margin-right:var(--ms-badges-margin-right)}.ms--rtl .ms__badges--left{margin-right:0;margin-left:var(--ms-badges-margin-left)}.ms--rtl .ms__badge{flex-direction:row-reverse}.ms--rtl .ms__badge-remove{border-radius:var(--ms-badge-border-radius) 0 0 var(--ms-badge-border-radius);border-left:var(--ms-badge-remove-border);border-right:none}.ms--rtl .ms__badge-text{border-radius:0 var(--ms-badge-border-radius) var(--ms-badge-border-radius) 0;border-right:var(--ms-badge-text-border);border-left:none}.ms--rtl .ms__count-display{direction:rtl}.ms--rtl .ms__count-display--right{margin-left:0;margin-right:var(--ms-count-display-margin-right)}.ms--rtl .ms__count-display--left{margin-right:0;margin-left:var(--ms-count-display-margin-left)}.ms--rtl .ms__counter-wrapper{flex-direction:row-reverse}.ms--rtl .ms__selected-popover{direction:rtl;text-align:right}.ms--rtl .ms__actions{direction:rtl}.ms--rtl .ms__group-label,.ms--rtl .ms__empty{text-align:right}.ms--rtl .ms__hint{direction:rtl;text-align:right}.ms--disabled .ms__input{opacity:var(--ms-disabled-input-opacity);cursor:not-allowed;background:var(--ms-input-bg-disabled)}.ms--disabled .ms__toggle{opacity:var(--ms-disabled-input-opacity)}.ms--no-checkboxes .ms__option{gap:0;padding-left:var(--ms-option-padding-h)}.ms--no-checkboxes .ms__option-content{padding-left:0}.ms-debug-info{margin-top:calc(.4 * var(--ms-rem));padding:calc(.4 * var(--ms-rem));background-color:#f9fafb;border:1px solid #e5e7eb;border-radius:calc(var(--base-border-radius-md, .6) * var(--ms-rem));font-size:calc(1.2 * var(--ms-rem));color:#111827}.ms-debug-info details summary{cursor:pointer;font-weight:600;color:#2563eb;-webkit-user-select:none;user-select:none;padding:calc(.4 * var(--ms-rem));border-radius:calc(var(--base-border-radius-sm, .4) * var(--ms-rem))}.ms-debug-info details summary:hover{background-color:#f3f4f6}.ms-debug-info details summary:focus{outline:2px solid #3b82f6;outline-offset:2px}.ms-debug-info .ms-debug-stats{display:flex;flex-direction:column;gap:calc(.4 * var(--ms-rem));margin-top:calc(.4 * var(--ms-rem));padding:calc(.4 * var(--ms-rem));background-color:#fff;border-radius:calc(var(--base-border-radius-sm, .4) * var(--ms-rem))}.ms-debug-info .ms-debug-stats span{display:flex;justify-content:space-between;padding:2px 4px;font-family:monospace;font-size:calc(1 * var(--ms-rem))}.ms-debug-info .ms-debug-stats span:before{content:"•";margin-right:calc(.4 * var(--ms-rem));color:#3b82f6}`, ys = typeof HTMLElement < "u" ? HTMLElement : class {
2453
+ }, Ce = [
2454
+ // Strings
2455
+ { attr: "search-hint", key: "searchHint", parser: "string-or-undefined" },
2456
+ { attr: "search-placeholder", key: "searchPlaceholder", parser: "string", default: "Search..." },
2457
+ { attr: "dropdown-min-width", key: "dropdownMinWidth", parser: "string-or-undefined" },
2458
+ { attr: "dropdown-max-width", key: "dropdownMaxWidth", parser: "string-or-undefined" },
2459
+ { attr: "max-height", key: "maxHeight", parser: "string", default: "20rem" },
2460
+ { attr: "empty-message", key: "emptyMessage", parser: "string", default: "No results found" },
2461
+ { attr: "loading-message", key: "loadingMessage", parser: "string", default: "Loading..." },
2462
+ { attr: "remove-button-tooltip-text", key: "removeButtonTooltipText", parser: "string-or-undefined" },
2463
+ { attr: "name", key: "formFieldId", parser: "string-or-undefined" },
2464
+ // Member properties (have programmatic fallback applied after parse)
2465
+ { attr: "value-member", key: "valueMember", parser: "string-or-undefined" },
2466
+ { attr: "display-value-member", key: "displayValueMember", parser: "string-or-undefined" },
2467
+ { attr: "search-value-member", key: "searchValueMember", parser: "string-or-undefined" },
2468
+ { attr: "icon-member", key: "iconMember", parser: "string-or-undefined" },
2469
+ { attr: "subtitle-member", key: "subtitleMember", parser: "string-or-undefined" },
2470
+ { attr: "group-member", key: "groupMember", parser: "string-or-undefined" },
2471
+ { attr: "disabled-member", key: "disabledMember", parser: "string-or-undefined" },
2472
+ // Enums
2473
+ {
2474
+ attr: "badges-display-mode",
2475
+ key: "badgesDisplayMode",
2476
+ parser: "enum",
2477
+ enumValues: ["badges", "count", "compact", "partial", "none"],
2478
+ default: "badges"
2479
+ },
2480
+ {
2481
+ attr: "badges-position",
2482
+ key: "badgesPosition",
2483
+ parser: "enum",
2484
+ enumValues: ["top", "bottom", "left", "right"],
2485
+ default: "bottom"
2486
+ },
2487
+ {
2488
+ attr: "badges-threshold-mode",
2489
+ key: "badgesThresholdMode",
2490
+ parser: "enum",
2491
+ enumValues: ["count", "partial"],
2492
+ default: "count"
2493
+ },
2494
+ {
2495
+ attr: "search-input-mode",
2496
+ key: "searchInputMode",
2497
+ parser: "enum",
2498
+ enumValues: ["normal", "readonly", "hidden"],
2499
+ default: "normal"
2500
+ },
2501
+ {
2502
+ attr: "search-mode",
2503
+ key: "searchMode",
2504
+ parser: "enum",
2505
+ enumValues: ["filter", "navigate"],
2506
+ default: "filter"
2507
+ },
2508
+ {
2509
+ attr: "actions-layout",
2510
+ key: "actionsLayout",
2511
+ parser: "enum",
2512
+ enumValues: ["nowrap", "wrap"],
2513
+ default: "nowrap"
2514
+ },
2515
+ {
2516
+ attr: "checkbox-align",
2517
+ key: "checkboxAlign",
2518
+ parser: "enum",
2519
+ enumValues: ["top", "center", "bottom"],
2520
+ default: "center"
2521
+ },
2522
+ {
2523
+ attr: "value-format",
2524
+ key: "valueFormat",
2525
+ parser: "enum",
2526
+ enumValues: ["json", "csv", "array"],
2527
+ default: "json"
2528
+ },
2529
+ {
2530
+ attr: "badge-tooltip-placement",
2531
+ key: "badgeTooltipPlacement",
2532
+ parser: "enum",
2533
+ enumValues: ["top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end", "right", "right-start", "right-end"],
2534
+ default: "top"
2535
+ },
2536
+ // Numbers
2537
+ { attr: "badges-threshold", key: "badgesThreshold", parser: "int" },
2538
+ { attr: "badges-max-visible", key: "badgesMaxVisible", parser: "int" },
2539
+ { attr: "min-search-length", key: "minSearchLength", parser: "int", default: 0 },
2540
+ { attr: "virtual-scroll-threshold", key: "virtualScrollThreshold", parser: "int", default: 100 },
2541
+ { attr: "option-height", key: "optionHeight", parser: "int", default: 50 },
2542
+ { attr: "badge-height", key: "badgeHeight", parser: "int", default: 36 },
2543
+ { attr: "virtual-scroll-buffer", key: "virtualScrollBuffer", parser: "int", default: 10 },
2544
+ { attr: "badge-tooltip-delay", key: "badgeTooltipDelay", parser: "int", default: 100 },
2545
+ { attr: "badge-tooltip-offset", key: "badgeTooltipOffset", parser: "int", default: 8 },
2546
+ // Booleans (default true: presence/empty = true; only 'false' negates)
2547
+ { attr: "multiple", key: "isMultipleEnabled", parser: "bool-default-true" },
2548
+ { attr: "allow-groups", key: "isGroupsAllowed", parser: "bool-default-true" },
2549
+ { attr: "show-checkboxes", key: "isCheckboxesShown", parser: "bool-default-true" },
2550
+ { attr: "sticky-actions", key: "isActionsSticky", parser: "bool-default-true" },
2551
+ { attr: "lock-placement", key: "isPlacementLocked", parser: "bool-default-true" },
2552
+ { attr: "enable-search", key: "isSearchEnabled", parser: "bool-default-true" },
2553
+ { attr: "keep-options-on-search", key: "isKeepOptionsOnSearch", parser: "bool-default-true" },
2554
+ { attr: "should-keep-search-on-close", key: "shouldKeepSearchOnClose", parser: "bool-default-true" },
2555
+ // Booleans (default false: only 'true' enables)
2556
+ { attr: "close-on-select", key: "isCloseOnSelect", parser: "bool-default-false" },
2557
+ { attr: "allow-add-new", key: "isAddNewAllowed", parser: "bool-default-false" },
2558
+ { attr: "show-counter", key: "isCounterShown", parser: "bool-default-false" },
2559
+ { attr: "enable-virtual-scroll", key: "isVirtualScrollEnabled", parser: "bool-default-false" },
2560
+ { attr: "enable-badge-tooltips", key: "isBadgeTooltipsEnabled", parser: "bool-default-false" }
2561
+ ], xs = new Map(Ce.map((s) => [s.attr, s])), je = [
2562
+ { key: "valueMember", field: "_valueMember" },
2563
+ { key: "displayValueMember", field: "_displayValueMember" },
2564
+ { key: "searchValueMember", field: "_searchValueMember" },
2565
+ { key: "iconMember", field: "_iconMember" },
2566
+ { key: "subtitleMember", field: "_subtitleMember" },
2567
+ { key: "groupMember", field: "_groupMember" },
2568
+ { key: "disabledMember", field: "_disabledMember" }
2569
+ ];
2570
+ function Ge(s, e) {
2571
+ if (e === null || e === "")
2572
+ switch (s.parser) {
2573
+ case "bool-default-true":
2574
+ return !0;
2575
+ case "bool-default-false":
2576
+ return !1;
2577
+ default:
2578
+ return s.default;
2579
+ }
2580
+ switch (s.parser) {
2581
+ case "string":
2582
+ case "string-or-undefined":
2583
+ return e;
2584
+ case "enum":
2585
+ return s.enumValues.includes(e) ? e : s.default;
2586
+ case "int": {
2587
+ const t = parseInt(e);
2588
+ return isNaN(t) ? s.default : t;
2589
+ }
2590
+ case "bool-default-true":
2591
+ return e !== "false";
2592
+ case "bool-default-false":
2593
+ return e === "true";
2472
2594
  }
2473
2595
  }
2474
- const gs = ':host{--ms-rem: 10px;font-family:var(--ms-font-family, var(--base-font-family, inherit));display:block;--ms-accent-color: var(--base-accent-color, #3b82f6);--ms-accent-color-hover: var(--base-accent-color-hover, #2563eb);--ms-accent-color-active: var(--base-accent-color-active, #1d4ed8);--ms-accent-color-light: var(--base-accent-color-light, #eff6ff);--ms-accent-color-light-hover: var(--base-accent-color-light-hover, #e0f2fe);--ms-text-color-1: var(--base-text-color-1, #111827);--ms-text-color-2: var(--base-text-color-2, #353b47);--ms-text-color-3: var(--base-text-color-3, #6b7280);--ms-text-color-4: var(--base-text-color-4, #a0a3a9);--ms-text-color-on-accent: var(--base-text-color-on-accent, #ffffff);--ms-text-primary: var(--ms-text-color-1);--ms-text-secondary: var(--ms-text-color-3);--ms-primary-bg: var(--base-main-bg, #f3f4f6);--ms-primary-bg-hover: var(--base-hover-bg, #e5e7eb);--ms-border-color: var(--base-border-color, #e5e7eb);--ms-border: var(--base-border, 1px solid var(--ms-border-color));--ms-input-bg: var(--base-input-bg, #ffffff);--ms-input-color: var(--base-input-color, var(--ms-text-color-1));--ms-input-border: var(--base-input-border, 1px solid var(--ms-border-color));--ms-input-border-hover: var(--base-input-border-hover, 1px solid var(--ms-accent-color));--ms-input-border-focus: var(--base-input-border-focus, 1px solid var(--ms-accent-color));--ms-input-placeholder-color: var(--base-input-placeholder-color, var(--ms-text-color-4));--ms-input-bg-disabled: var(--base-input-bg-disabled, rgba(107, 114, 128, .05));--ms-toggle-icon-color: var(--ms-text-color-3);--ms-toggle-icon-color-open: var(--ms-text-color-3);--ms-counter-badge-bg: var(--ms-accent-color);--ms-counter-badge-bg-hover: var(--ms-accent-color-hover);--ms-counter-badge-color: var(--ms-text-color-on-accent);--ms-hint-bg: var(--base-main-bg, #ffffff);--ms-hint-color: var(--ms-text-color-4);--ms-hint-border-color: var(--ms-border-color);--ms-dropdown-bg: var(--base-dropdown-bg, #ffffff);--ms-dropdown-text-color: var(--ms-text-color-1);--ms-dropdown-border-color: var(--ms-border-color);--ms-dropdown-box-shadow-semantic: var(--base-dropdown-box-shadow, 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1));--ms-actions-bg: var(--base-main-bg, #ffffff);--ms-actions-border-color: var(--ms-border-color);--ms-action-button-bg: transparent;--ms-action-button-bg-hover: var(--ms-primary-bg);--ms-action-button-border-color: var(--ms-border-color);--ms-action-button-border-color-hover: var(--ms-accent-color);--ms-action-button-color: var(--ms-text-color-1);--ms-group-border-color: var(--ms-border-color);--ms-option-text-color: var(--ms-text-color-1);--ms-option-color-hover: inherit;--ms-option-color-focused: inherit;--ms-option-outline-color-focused: var(--ms-accent-color);--ms-option-color-matched: inherit;--ms-option-border-matched-color: color-mix(in srgb, var(--ms-accent-color) 40%, transparent);--ms-option-title-color: var(--ms-text-color-1);--ms-option-subtitle-color: var(--ms-text-color-3);--ms-loading-color: var(--ms-text-color-3);--ms-badge-bg-hover: var(--base-hover-bg, var(--ms-input-bg));--ms-badge-text-bg-hover: var(--base-hover-bg, var(--ms-input-bg));--ms-badge-text-color-hover: var(--ms-badge-text-color);--ms-badge-counter-border-color: var(--ms-border-color);--ms-badge-counter-text-bg: var(--ms-primary-bg-hover);--ms-badge-counter-text-color: var(--ms-text-color-1);--ms-badge-counter-remove-bg: var(--ms-text-color-3);--ms-badge-counter-remove-bg-hover: var(--ms-text-color-1);--ms-badge-counter-remove-color: var(--ms-text-color-on-accent);--ms-counter-wrapper-border-color: var(--ms-border-color);--ms-count-clear-bg-hover: var(--ms-accent-color);--ms-tooltip-bg: var(--base-tooltip-bg, #333333);--ms-tooltip-text-color: var(--base-tooltip-text-color, #ffffff);--ms-selected-popover-bg: var(--base-dropdown-bg, #ffffff);--ms-selected-popover-border-color: var(--ms-border-color);--ms-selected-popover-header-border-color: var(--ms-border-color);--ms-selected-popover-close-bg-hover: var(--ms-accent-color);--ms-input-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-input-padding-right: calc(4 * var(--ms-rem));--ms-input-padding-h: calc(1.2 * var(--ms-rem));--ms-input-height: calc(var(--base-input-size-md-height, 3.5) * var(--ms-rem));--ms-input-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-input-border-width: 1px;--ms-input-border-radius: var(--ms-border-radius-md);--ms-input-text: var(--ms-text-color-1);--ms-input-bg-disabled: rgba(107, 114, 128, .05);--ms-input-size-xs-font: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-input-size-xs-padding-v: calc(.4 * var(--ms-rem));--ms-input-size-xs-padding-h: calc(.8 * var(--ms-rem));--ms-input-size-xs-height: calc(var(--base-input-size-xs-height, 3.1) * var(--ms-rem));--ms-input-size-sm-font: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-input-size-sm-padding-v: calc(.5 * var(--ms-rem));--ms-input-size-sm-padding-h: calc(1 * var(--ms-rem));--ms-input-size-sm-height: calc(var(--base-input-size-sm-height, 3.3) * var(--ms-rem));--ms-input-size-md-font: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-input-size-md-padding-v: calc(.8 * var(--ms-rem));--ms-input-size-md-padding-h: calc(1.2 * var(--ms-rem));--ms-input-size-md-height: calc(var(--base-input-size-md-height, 3.5) * var(--ms-rem));--ms-input-size-lg-font: calc(var(--base-font-size-base, 1.6) * var(--ms-rem));--ms-input-size-lg-padding-v: calc(1 * var(--ms-rem));--ms-input-size-lg-padding-h: calc(1.4 * var(--ms-rem));--ms-input-size-lg-height: calc(var(--base-input-size-lg-height, 3.8) * var(--ms-rem));--ms-input-size-xl-font: calc(var(--base-font-size-lg, 1.8) * var(--ms-rem));--ms-input-size-xl-padding-v: calc(1.2 * var(--ms-rem));--ms-input-size-xl-padding-h: calc(1.6 * var(--ms-rem));--ms-input-size-xl-height: calc(var(--base-input-size-xl-height, 4.1) * var(--ms-rem));--ms-toggle-right: calc(1.2 * var(--ms-rem));--ms-toggle-color: var(--ms-text-color-3);--ms-transform-center-y: translateY(-50%);--ms-transform-rotate-180: 180deg;--ms-counter-offset: calc(3.2 * var(--ms-rem));--ms-counter-padding: calc(.2 * var(--ms-rem)) calc(.4 * var(--ms-rem));--ms-counter-bg: var(--ms-accent-color);--ms-counter-color: var(--ms-text-color-on-accent);--ms-counter-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-counter-font-weight: var(--base-font-weight-semibold, 600);--ms-counter-border-radius: var(--ms-border-radius-sm);--ms-counter-bg-hover: var(--ms-accent-color-hover);--ms-transform-scale-hover: 1.1;--ms-hint-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-hint-border: var(--ms-border);--ms-hint-border-radius: var(--ms-border-radius-lg);--ms-hint-box-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--ms-hint-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-dropdown-border: var(--base-dropdown-border, 1px solid var(--ms-border-color));--ms-dropdown-border-radius: var(--ms-border-radius-lg);--ms-dropdown-box-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--ms-options-max-height: calc(32 * var(--ms-rem));--ms-option-color: var(--ms-text-color-1);--ms-z-index-dropdown: 9999;--ms-z-index-sticky: 1;--ms-actions-gap: calc(.4 * var(--ms-rem));--ms-actions-padding: calc(.8 * var(--ms-rem));--ms-actions-border-bottom: var(--ms-border);--ms-action-btn-padding: calc(.4 * var(--ms-rem)) calc(.8 * var(--ms-rem));--ms-action-btn-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-action-btn-border: var(--ms-border);--ms-action-btn-border-radius: var(--ms-border-radius-sm);--ms-action-btn-bg: transparent;--ms-action-btn-color: inherit;--ms-action-btn-bg-hover: var(--ms-primary-bg);--ms-action-btn-border-color-hover: var(--ms-accent-color);--ms-transform-scale-active: .98;--ms-options-padding: 0;--ms-group-border-top: var(--ms-border);--ms-group-margin-top: calc(.4 * var(--ms-rem));--ms-group-padding-top: calc(.4 * var(--ms-rem));--ms-group-label-padding: calc(.4 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-group-label-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-group-label-font-weight: var(--base-font-weight-semibold, 600);--ms-group-label-color: var(--ms-text-color-3);--ms-group-label-transform: uppercase;--ms-group-label-letter-spacing: .05em;--ms-option-gap: calc(.8 * var(--ms-rem));--ms-option-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-option-padding-h: calc(1.2 * var(--ms-rem));--ms-option-bg: transparent;--ms-option-bg-hover: var(--ms-primary-bg);--ms-option-bg-focused: var(--ms-primary-bg);--ms-option-outline-focused: 2px solid var(--ms-accent-color);--ms-option-focus-outline-offset: -2px;--ms-option-bg-matched: color-mix(in srgb, var(--ms-accent-color) 8%, transparent);--ms-option-border-matched: 3px solid color-mix(in srgb, var(--ms-accent-color) 40%, transparent);--ms-option-bg-selected: color-mix(in srgb, var(--ms-accent-color) 10%, transparent);--ms-option-bg-focused-hover: var(--ms-primary-bg);--ms-option-bg-matched-hover: color-mix(in srgb, var(--ms-accent-color) 12%, transparent);--ms-option-bg-selected-focused: color-mix(in srgb, var(--ms-accent-color) 15%, transparent);--ms-option-bg-selected-matched: color-mix(in srgb, var(--ms-accent-color) 15%, transparent);--ms-option-disabled-bg: var(--base-disabled-bg, transparent);--ms-option-bg-disabled-selected: color-mix(in srgb, var(--ms-accent-color) 10%, transparent);--ms-disabled-opacity: .5;--ms-option-content-gap: calc(.8 * var(--ms-rem));--ms-option-icon-size: calc(2 * var(--ms-rem));--ms-option-icon-font-size: calc(var(--base-font-size-base, 1.6) * var(--ms-rem));--ms-option-title-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-option-mark-bg: color-mix(in srgb, var(--ms-accent-color) 20%, transparent);--ms-option-mark-color: inherit;--ms-option-mark-font-weight: var(--base-font-weight-semibold, 600);--ms-option-subtitle-margin-top: calc(.4 * var(--ms-rem));--ms-option-subtitle-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-option-subtitle-line-height: var(--base-line-height-tight, 1.25);--ms-checkbox-margin-top: calc(.2 * var(--ms-rem));--ms-checkbox-margin-right: 0;--ms-checkbox-margin-bottom: 0;--ms-checkbox-margin-left: 0;--ms-checkbox-size: calc(1.6 * var(--ms-rem));--ms-checkbox-scale: 1;--ms-checkbox-align: center;--ms-checkbox-bg: var(--ms-input-bg);--ms-checkbox-border: var(--ms-border);--ms-checkbox-border-radius: calc(.3 * var(--ms-rem));--ms-checkbox-checked-bg: var(--ms-accent-color);--ms-checkbox-checked-border: 1px solid var(--ms-accent-color);--ms-checkbox-checkmark-color: var(--ms-text-color-on-accent);--ms-checkbox-hover-border-color: var(--ms-accent-color);--ms-checkbox-disabled-bg: var(--ms-primary-bg);--ms-checkbox-disabled-border: var(--ms-border);--ms-checkbox-checked-bg-hover: var(--ms-accent-color-hover);--ms-checkbox-checked-border-color-hover: var(--ms-accent-color-hover);--ms-empty-padding: calc(1.6 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-empty-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-empty-color: var(--ms-text-color-3);--ms-loader-padding: calc(1.6 * var(--ms-rem));--ms-loader-gap: calc(.8 * var(--ms-rem));--ms-loading-text-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-loading-text-color: var(--ms-text-color-3);--ms-badges-gap: calc(.8 * var(--ms-rem));--ms-badges-margin-bottom: calc(.8 * var(--ms-rem));--ms-badges-margin-top: calc(.8 * var(--ms-rem));--ms-badges-margin-left: calc(.4 * var(--ms-rem));--ms-badges-margin-right: calc(.4 * var(--ms-rem));--ms-inline-align: center;--ms-badge-gap: calc(.8 * var(--ms-rem));--ms-badge-height: calc(2.7 * var(--ms-rem));--ms-badge-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-badge-font-weight: var(--base-font-weight-semibold, 600);--ms-badge-border-radius: var(--ms-border-radius-sm);--ms-badge-bg: var(--ms-accent-color-light);--ms-badge-bg-hover: var(--ms-badge-bg-hover);--ms-badge-bg-active: var(--ms-accent-color-light-hover);--ms-order-first: -1;--ms-badge-text-padding: 0 calc(.8 * var(--ms-rem));--ms-badge-text-bg: var(--ms-accent-color-light);--ms-badge-text-color: var(--ms-accent-color);--ms-badge-text-border: none;--ms-badge-remove-width: calc(2.7 * var(--ms-rem));--ms-badge-remove-bg: var(--ms-accent-color);--ms-badge-remove-color: var(--ms-text-color-on-accent);--ms-badge-remove-border: none;--ms-badge-remove-font-size: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-badge-remove-bg-hover: var(--ms-accent-color-hover);--ms-badge-remove-box-shadow-focus: 0 0 0 2px color-mix(in srgb, var(--ms-accent-color) 50%, transparent);--ms-icon-remove: "×";--ms-badge-counter-bg: transparent;--ms-badge-counter-border: var(--ms-border);--ms-badge-counter-border-radius: var(--ms-border-radius-sm);--ms-more-badge-bg: var(--ms-accent-color-light);--ms-more-badge-hover-bg: var(--ms-badge-bg-hover);--ms-more-badge-active-bg: var(--ms-accent-color-light-hover);--ms-count-display-margin-bottom: calc(.8 * var(--ms-rem));--ms-count-display-margin-top: calc(.8 * var(--ms-rem));--ms-count-display-margin-left: calc(.8 * var(--ms-rem));--ms-count-display-margin-right: calc(.8 * var(--ms-rem));--ms-counter-wrapper-bg: transparent;--ms-counter-wrapper-border: var(--ms-border);--ms-counter-wrapper-border-radius: var(--ms-border-radius-sm);--ms-counter-wrapper-padding: calc(.4 * var(--ms-rem)) calc(.8 * var(--ms-rem));--ms-counter-wrapper-gap: calc(.4 * var(--ms-rem));--ms-counter-wrapper-bg-hover: var(--ms-primary-bg);--ms-counter-wrapper-border-color-hover: var(--ms-accent-color);--ms-count-text-bg: transparent;--ms-count-text-border: none;--ms-count-text-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-count-text-color: var(--ms-text-color-1);--ms-count-clear-size: calc(1.6 * var(--ms-rem));--ms-count-clear-bg: transparent;--ms-count-clear-color: var(--ms-text-color-3);--ms-count-clear-font-size: calc(var(--base-font-size-lg, 1.8) * var(--ms-rem));--ms-count-clear-border-radius: 50%;--ms-count-clear-bg-hover: color-mix(in srgb, var(--ms-accent-color) 20%, transparent);--ms-count-clear-color-hover: var(--ms-accent-color);--ms-icon-clear: "×";--ms-tooltip-color: var(--ms-tooltip-text-color);--ms-tooltip-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-tooltip-border-radius: var(--ms-border-radius-lg);--ms-tooltip-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-tooltip-max-width: calc(32 * var(--ms-rem));--ms-tooltip-shadow: 0 2px 8px rgba(0, 0, 0, .15);--ms-tooltip-z-index: 10000;--ms-z-index-popover: 10000;--ms-selected-popover-width: calc(32 * var(--ms-rem));--ms-selected-popover-max-height: calc(32 * var(--ms-rem));--ms-selected-popover-border: var(--ms-border);--ms-selected-popover-border-radius: var(--ms-border-radius-lg);--ms-selected-popover-box-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--ms-selected-popover-header-padding: calc(.8 * var(--ms-rem)) calc(1.2 * var(--ms-rem));--ms-selected-popover-header-bg: color-mix(in srgb, var(--ms-accent-color) 10%, transparent);--ms-selected-popover-header-border-bottom: var(--ms-border);--ms-selected-popover-header-font-size: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-selected-popover-header-font-weight: var(--base-font-weight-semibold, 600);--ms-selected-popover-header-color: var(--ms-text-color-1);--ms-popover-close-size: calc(2.4 * var(--ms-rem));--ms-selected-popover-close-bg: transparent;--ms-selected-popover-close-color: var(--ms-text-color-3);--ms-selected-popover-close-font-size: calc(var(--base-font-size-xl, 2) * var(--ms-rem));--ms-selected-popover-close-border-radius: 50%;--ms-selected-popover-close-bg-hover: color-mix(in srgb, var(--ms-accent-color) 20%, transparent);--ms-selected-popover-close-color-hover: var(--ms-accent-color);--ms-selected-popover-body-gap: calc(.4 * var(--ms-rem));--ms-selected-popover-body-padding: calc(.8 * var(--ms-rem));--ms-selected-popover-body-max-height: calc(28.8 * var(--ms-rem));--ms-font-size-2xs: calc(var(--base-font-size-2xs, 1) * var(--ms-rem));--ms-font-size-xs: calc(var(--base-font-size-xs, 1.2) * var(--ms-rem));--ms-font-size-sm: calc(var(--base-font-size-sm, 1.4) * var(--ms-rem));--ms-font-size-base: calc(var(--base-font-size-base, 1.6) * var(--ms-rem));--ms-font-size-lg: calc(var(--base-font-size-lg, 1.8) * var(--ms-rem));--ms-font-weight-normal: var(--base-font-weight-normal, 400);--ms-font-weight-medium: var(--base-font-weight-medium, 500);--ms-font-weight-semibold: var(--base-font-weight-semibold, 600);--ms-line-height-none: 1;--ms-line-height-tight: var(--base-line-height-tight, 1.25);--ms-line-height-normal: var(--base-line-height-normal, 1.5);--ms-line-height-relaxed: var(--base-line-height-relaxed, 1.75);--ms-border-radius-sm: calc(var(--base-border-radius-sm, .4) * var(--ms-rem));--ms-border-radius-md: calc(var(--base-border-radius-md, .6) * var(--ms-rem));--ms-border-radius-lg: calc(var(--base-border-radius-lg, .8) * var(--ms-rem));--ms-border-radius: var(--ms-border-radius-md);--ms-spacing-xs: calc(.4 * var(--ms-rem));--ms-spacing-sm: calc(.8 * var(--ms-rem));--ms-spacing-md: calc(1.2 * var(--ms-rem));--ms-spacing-lg: calc(1.6 * var(--ms-rem));--ms-transition-fast: .15s;--ms-transition-normal: .2s;--ms-easing-snappy: cubic-bezier(.4, 0, .2, 1);--ms-placeholder-opacity: .6;--ms-disabled-input-opacity: .6;--ms-scrollbar-width: 8px;--ms-scrollbar-track-bg: transparent;--ms-scrollbar-thumb-bg: var(--ms-border-color);--ms-scrollbar-thumb-bg-hover: var(--ms-text-color-3);--ms-scrollbar-thumb-border-radius: 4px}multi-select:not(:defined){display:block;min-height:calc(3.5 * var(--ms-rem));color:transparent!important;background:transparent}.ms-wrapper{display:flex;flex-direction:column;align-items:stretch}.ms-wrapper--inline{flex-direction:row;align-items:var(--ms-inline-align, center)}.ms{position:relative;width:100%}.ms__input-wrapper{position:relative;display:flex;align-items:center}.ms__input{box-sizing:border-box;width:100%;font-family:inherit;height:var(--ms-input-height);padding:var(--ms-input-padding);padding-right:var(--ms-input-padding-right);font-size:var(--ms-input-font-size);border:var(--ms-input-border);border-radius:var(--ms-input-border-radius);background:var(--ms-input-bg);color:var(--ms-input-color);cursor:pointer;transition:border var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__input:hover:not(:focus):not(:disabled){border:var(--ms-input-border-hover)}.ms__input:focus{outline:none;border:var(--ms-input-border-focus)}.ms__input::placeholder{color:var(--ms-input-placeholder-color);opacity:0;transition:opacity var(--ms-transition-fast) var(--ms-easing-snappy)}:host([data-ready]) .ms__input::placeholder{opacity:var(--ms-placeholder-opacity)}.ms__input.ms__input--xs{font-size:var(--ms-input-size-xs-font);padding:var(--ms-input-size-xs-padding-v) var(--ms-input-size-xs-padding-h);padding-right:calc(var(--ms-input-size-xs-padding-h) * 2.5);height:var(--ms-input-size-xs-height)}.ms__input.ms__input--sm{font-size:var(--ms-input-size-sm-font);padding:var(--ms-input-size-sm-padding-v) var(--ms-input-size-sm-padding-h);padding-right:calc(var(--ms-input-size-sm-padding-h) * 2.5);height:var(--ms-input-size-sm-height)}.ms__input.ms__input--lg{font-size:var(--ms-input-size-lg-font);padding:var(--ms-input-size-lg-padding-v) var(--ms-input-size-lg-padding-h);padding-right:calc(var(--ms-input-size-lg-padding-h) * 2.5);height:var(--ms-input-size-lg-height)}.ms__input.ms__input--xl{font-size:var(--ms-input-size-xl-font);padding:var(--ms-input-size-xl-padding-v) var(--ms-input-size-xl-padding-h);padding-right:calc(var(--ms-input-size-xl-padding-h) * 2.5);height:var(--ms-input-size-xl-height)}.ms__toggle{position:absolute;right:var(--ms-toggle-right);top:50%;transform:var(--ms-transform-center-y);pointer-events:none;color:var(--ms-toggle-icon-color);transition:transform var(--ms-transition-fast) var(--ms-easing-snappy)}.ms--open .ms__toggle{transform:var(--ms-transform-center-y) rotate(var(--ms-transform-rotate-180));color:var(--ms-toggle-icon-color-open)}.ms__counter{position:absolute;right:var(--ms-counter-offset);top:50%;transform:var(--ms-transform-center-y);padding:var(--ms-counter-padding);background:var(--ms-counter-badge-bg);color:var(--ms-counter-badge-color);font-size:var(--ms-counter-font-size);font-weight:var(--ms-counter-font-weight);border-radius:var(--ms-counter-border-radius);cursor:pointer;transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__counter:hover{background:var(--ms-counter-badge-bg-hover);transform:var(--ms-transform-center-y) scale(var(--ms-transform-scale-hover))}.ms__hint{display:none;position:absolute;z-index:var(--ms-z-index-popover);padding:var(--ms-hint-padding);background:var(--ms-hint-bg);border:var(--ms-hint-border);border-radius:var(--ms-hint-border-radius);box-shadow:var(--ms-hint-box-shadow);font-size:var(--ms-hint-font-size);color:var(--ms-hint-color);line-height:var(--ms-line-height-relaxed);max-width:100%}.ms__hint--visible{display:block}.ms__dropdown{display:none;position:absolute;font-family:inherit;z-index:var(--ms-z-index-dropdown);background:var(--ms-dropdown-bg);border:var(--ms-dropdown-border);border-radius:var(--ms-dropdown-border-radius);box-shadow:var(--ms-dropdown-box-shadow);max-height:var(--ms-options-max-height);overflow:hidden;color:var(--ms-dropdown-text-color)}.ms__dropdown--visible{display:flex;flex-direction:column}.ms__dropdown-inner{flex:1;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:var(--ms-scrollbar-thumb-bg) var(--ms-scrollbar-track-bg)}.ms__dropdown-inner::-webkit-scrollbar{width:var(--ms-scrollbar-width)}.ms__dropdown-inner::-webkit-scrollbar-track{background:var(--ms-scrollbar-track-bg)}.ms__dropdown-inner::-webkit-scrollbar-thumb{background:var(--ms-scrollbar-thumb-bg);border-radius:var(--ms-scrollbar-thumb-border-radius)}.ms__dropdown-inner::-webkit-scrollbar-thumb:hover{background:var(--ms-scrollbar-thumb-bg-hover)}.ms__dropdown--virtual{max-height:none}.ms__dropdown--virtual .ms__dropdown-inner{overflow-y:visible}.ms__actions{display:flex;flex-wrap:nowrap;gap:var(--ms-actions-gap);padding:var(--ms-actions-padding);border-bottom:var(--ms-actions-border-bottom)}.ms__actions--wrap{flex-wrap:wrap}.ms__actions--sticky{position:sticky;top:0;z-index:var(--ms-z-index-sticky);background:var(--ms-actions-bg)}.ms__action-btn{flex:1;font-family:inherit;padding:var(--ms-action-btn-padding);font-size:var(--ms-action-btn-font-size);border:var(--ms-action-btn-border);border-radius:var(--ms-action-btn-border-radius);background:var(--ms-action-button-bg);color:var(--ms-action-button-color);cursor:pointer;transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__action-btn:hover{background:var(--ms-action-button-bg-hover);border-color:var(--ms-action-button-border-color-hover)}.ms__action-btn:active{transform:scale(var(--ms-transform-scale-active))}.ms__action-btn:disabled,.ms__action-btn[disabled]{opacity:var(--ms-disabled-opacity);cursor:not-allowed;pointer-events:none}.ms__options{padding:var(--ms-options-padding);scrollbar-width:thin;scrollbar-color:var(--ms-scrollbar-thumb-bg) var(--ms-scrollbar-track-bg)}.ms__options::-webkit-scrollbar{width:var(--ms-scrollbar-width)}.ms__options::-webkit-scrollbar-track{background:var(--ms-scrollbar-track-bg)}.ms__options::-webkit-scrollbar-thumb{background:var(--ms-scrollbar-thumb-bg);border-radius:var(--ms-scrollbar-thumb-border-radius)}.ms__options::-webkit-scrollbar-thumb:hover{background:var(--ms-scrollbar-thumb-bg-hover)}.ms__options--virtual .ms__option{height:var(--ms-option-height, 50px);min-height:var(--ms-option-height, 50px);max-height:var(--ms-option-height, 50px);overflow:hidden;box-sizing:border-box}.ms__group+.ms__group{border-top:var(--ms-group-border-top);margin-top:var(--ms-group-margin-top);padding-top:var(--ms-group-padding-top)}.ms__group-label{padding:var(--ms-group-label-padding);font-size:var(--ms-group-label-font-size);font-weight:var(--ms-group-label-font-weight);color:var(--ms-group-label-color);text-transform:var(--ms-group-label-transform);letter-spacing:var(--ms-group-label-letter-spacing)}.ms__option{display:flex;align-items:var(--ms-checkbox-align, center);gap:var(--ms-option-gap);padding:var(--ms-option-padding);color:var(--ms-option-text-color);background:var(--ms-option-bg);cursor:pointer}.ms__option:hover{background:var(--ms-option-bg-hover);color:var(--ms-option-color-hover, inherit)}.ms__option--focused{background:var(--ms-option-bg-focused);color:var(--ms-option-color-focused, inherit);outline:var(--ms-option-outline-focused);outline-offset:var(--ms-option-focus-outline-offset)}.ms__option--matched{background:var(--ms-option-bg-matched);color:var(--ms-option-color-matched, inherit);border-left:var(--ms-option-border-matched)}.ms__option--selected{background:var(--ms-option-bg-selected)}.ms__option--selected:hover{background:var(--ms-option-bg-selected-hover, var(--ms-option-bg-selected))}.ms__option--disabled{opacity:var(--ms-disabled-opacity);cursor:not-allowed;background:var(--ms-option-disabled-bg)}.ms__option--disabled:hover{background:var(--ms-option-disabled-bg)}.ms__option--focused:hover{background:var(--ms-option-bg-focused-hover);color:var(--ms-option-color-focused-hover, var(--ms-option-color-focused, var(--ms-option-text-color)))}.ms__option--matched:hover{background:var(--ms-option-bg-matched-hover);color:var(--ms-option-color-matched-hover, var(--ms-option-color-matched, var(--ms-option-text-color)))}.ms__option--selected.ms__option--focused{background:var(--ms-option-bg-selected-focused);outline:var(--ms-option-outline-focused);outline-offset:var(--ms-option-focus-outline-offset)}.ms__option--selected.ms__option--matched{background:var(--ms-option-bg-selected-matched);border-left:var(--ms-option-border-matched)}.ms__option--disabled.ms__option--selected{background:var(--ms-option-bg-disabled-selected)}.ms__option--disabled.ms__option--focused{outline:none}.ms__option[data-checkbox-align=top]{--ms-checkbox-align: flex-start}.ms__option[data-checkbox-align=bottom]{--ms-checkbox-align: flex-end}.ms__checkbox{appearance:none;-webkit-appearance:none;-moz-appearance:none;flex-shrink:0;position:relative;margin-top:var(--ms-checkbox-margin-top);margin-right:var(--ms-checkbox-margin-right);margin-bottom:var(--ms-checkbox-margin-bottom);margin-left:var(--ms-checkbox-margin-left);width:var(--ms-checkbox-size);height:var(--ms-checkbox-size);transform:scale(var(--ms-checkbox-scale));transform-origin:top left;cursor:pointer;background:var(--ms-checkbox-bg);border:var(--ms-checkbox-border);border-radius:var(--ms-checkbox-border-radius);transition:background-color .15s ease,border-color .15s ease}.ms__checkbox:after{content:"";position:absolute;display:none;left:50%;top:40%;width:30%;height:55%;transform:translate(-50%,-50%) rotate(45deg);border:solid var(--ms-checkbox-checkmark-color);border-width:0 2px 2px 0}.ms__checkbox:hover:not(:disabled){border-color:var(--ms-checkbox-hover-border-color)}.ms__checkbox:checked{background:var(--ms-checkbox-checked-bg);border:var(--ms-checkbox-checked-border)}.ms__checkbox:checked:after{display:block}.ms__checkbox:checked:hover:not(:disabled){background:var(--ms-checkbox-checked-bg-hover);border-color:var(--ms-checkbox-checked-border-color-hover)}.ms__checkbox:focus-visible{outline:2px solid var(--ms-checkbox-checked-bg);outline-offset:2px}.ms__checkbox:disabled{cursor:not-allowed;background:var(--ms-checkbox-disabled-bg);border:var(--ms-checkbox-disabled-border);opacity:.6}.ms__checkbox:disabled:checked{background:var(--ms-checkbox-disabled-bg)}.ms__option--disabled .ms__checkbox{cursor:not-allowed}.ms__option-content{flex:1;display:flex;align-items:center;gap:var(--ms-option-content-gap);min-width:0}.ms__option-icon{flex-shrink:0;width:var(--ms-option-icon-size);height:var(--ms-option-icon-size);display:flex;align-items:center;justify-content:center;font-size:var(--ms-option-icon-font-size)}.ms__option-icon svg{width:100%;height:100%;fill:currentColor}.ms__option-text{flex:1;min-width:0}.ms__option-title{font-size:var(--ms-option-title-font-size);color:var(--ms-option-title-color);line-height:var(--ms-line-height-relaxed)}.ms__option:hover .ms__option-title{color:var(--ms-option-title-color-hover, var(--ms-option-title-color))}.ms__option--selected .ms__option-title{color:var(--ms-option-title-color-selected, var(--ms-option-title-color))}.ms__option--selected:hover .ms__option-title{color:var(--ms-option-title-color-selected-hover, var(--ms-option-title-color-selected, var(--ms-option-title-color)))}.ms__option-title mark{background:var(--ms-option-mark-bg);color:var(--ms-option-mark-color);font-weight:var(--ms-option-mark-font-weight)}.ms__option-subtitle{margin-top:var(--ms-option-subtitle-margin-top);font-size:var(--ms-option-subtitle-font-size);color:var(--ms-option-subtitle-color);line-height:var(--ms-option-subtitle-line-height)}.ms__option:hover .ms__option-subtitle{color:var(--ms-option-subtitle-color-hover, var(--ms-option-subtitle-color))}.ms__option--selected .ms__option-subtitle{color:var(--ms-option-subtitle-color-selected, var(--ms-option-subtitle-color))}.ms__option--selected:hover .ms__option-subtitle{color:var(--ms-option-subtitle-color-selected-hover, var(--ms-option-subtitle-color-selected, var(--ms-option-subtitle-color)))}.ms__empty{padding:var(--ms-empty-padding);text-align:center;font-size:var(--ms-empty-font-size);color:var(--ms-empty-color)}.ms__loader{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--ms-loader-padding);gap:var(--ms-loader-gap)}.ms__loading-text{font-size:var(--ms-loading-text-font-size);color:var(--ms-loading-color)}.ms__badges{display:flex;flex-wrap:wrap;gap:var(--ms-badges-gap);padding:0}.ms__badges:empty{display:none}.ms__badges--bottom{margin-top:var(--ms-badges-margin-bottom)}.ms__badges--top{margin-bottom:var(--ms-badges-margin-top);order:var(--ms-order-first)}.ms__badges--left{order:var(--ms-order-first);margin-right:var(--ms-badges-margin-left);justify-content:flex-end}.ms__badges--right{margin-left:var(--ms-badges-margin-right);justify-content:flex-start}.ms__count-display{display:flex;align-items:center}.ms__count-display:empty{display:none}.ms__count-display--bottom{margin-top:var(--ms-count-display-margin-bottom)}.ms__count-display--top{margin-bottom:var(--ms-count-display-margin-top);order:var(--ms-order-first)}.ms__count-display--left{order:var(--ms-order-first);margin-right:var(--ms-count-display-margin-left);justify-content:flex-start}.ms__count-display--right{margin-left:var(--ms-count-display-margin-right);justify-content:flex-end}.ms__counter-wrapper{display:inline-flex;align-items:center;gap:var(--ms-counter-wrapper-gap);background:var(--ms-counter-wrapper-bg);border:var(--ms-counter-wrapper-border);border-radius:var(--ms-counter-wrapper-border-radius);padding:var(--ms-counter-wrapper-padding);transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__counter-wrapper:hover{background:var(--ms-counter-wrapper-bg-hover);border-color:var(--ms-counter-wrapper-border-color-hover)}.ms__count-text{display:inline-flex;align-items:center;background:var(--ms-count-text-bg);border:var(--ms-count-text-border);padding:0;font-size:var(--ms-count-text-font-size);color:var(--ms-count-text-color);cursor:pointer;transition:color var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__count-clear{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:var(--ms-count-clear-size);height:var(--ms-count-clear-size);padding:0;border:none;background:var(--ms-count-clear-bg);color:var(--ms-count-clear-color);font-size:var(--ms-count-clear-font-size);line-height:var(--ms-line-height-none);cursor:pointer;border-radius:var(--ms-count-clear-border-radius);transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__count-clear:hover{background:var(--ms-count-clear-bg-hover);color:var(--ms-count-clear-color-hover)}.ms__count-clear:before{content:var(--ms-icon-clear)}.ms__badge{display:inline-flex;align-items:center;height:var(--ms-badge-height);font-size:var(--ms-badge-font-size);font-weight:var(--ms-badge-font-weight);line-height:var(--ms-line-height-none);border-radius:var(--ms-badge-border-radius);overflow:hidden;max-width:100%}.ms__badge-text{display:flex;align-items:center;box-sizing:border-box;height:100%;padding:var(--ms-badge-text-padding);background:var(--ms-badge-text-bg);color:var(--ms-badge-text-color);border:var(--ms-badge-text-border);border-right:none;border-radius:var(--ms-badge-border-radius) 0 0 var(--ms-badge-border-radius);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:background-color var(--ms-transition-normal) ease,color var(--ms-transition-normal) ease}.ms__badge:hover .ms__badge-text{background:var(--ms-badge-text-bg-hover, var(--ms-badge-text-bg));color:var(--ms-badge-text-color-hover, var(--ms-badge-text-color))}.ms__badge-remove{display:flex;align-items:center;justify-content:center;box-sizing:border-box;font-family:inherit;width:var(--ms-badge-remove-width);height:100%;flex-shrink:0;background:var(--ms-badge-remove-bg);color:var(--ms-badge-remove-color);border:var(--ms-badge-remove-border);border-left:none;border-radius:0 var(--ms-badge-border-radius) var(--ms-badge-border-radius) 0;cursor:pointer;transition:background-color var(--ms-transition-normal) ease;font-size:var(--ms-badge-remove-font-size)}.ms__badge-remove:hover{background:var(--ms-badge-remove-bg-hover)}.ms__badge-remove:focus{outline:none;box-shadow:var(--ms-badge-remove-box-shadow-focus)}.ms__badge-remove:before{content:var(--ms-icon-remove);font-size:var(--ms-font-size-base);line-height:var(--ms-line-height-none)}.ms__badge--counter{cursor:pointer}.ms__badge--counter .ms__badge-text{background:var(--ms-badge-counter-text-bg);color:var(--ms-badge-counter-text-color);border:var(--ms-badge-counter-border);border-right:none}.ms__badge--counter .ms__badge-remove{background:var(--ms-badge-counter-remove-bg);color:var(--ms-badge-counter-remove-color);border:var(--ms-badge-counter-border);border-left:none}.ms__badge--counter .ms__badge-remove:hover{background:var(--ms-badge-counter-remove-bg-hover)}.ms__badge--more{cursor:pointer}.ms__badge-tooltip{position:fixed;z-index:var(--ms-tooltip-z-index);opacity:0;visibility:hidden;transition:opacity var(--ms-transition-normal) ease,visibility var(--ms-transition-normal) ease;background:var(--ms-tooltip-bg);color:var(--ms-tooltip-text-color);padding:var(--ms-tooltip-padding);border-radius:var(--ms-tooltip-border-radius);font-size:var(--ms-tooltip-font-size);line-height:var(--ms-line-height-relaxed);max-width:var(--ms-tooltip-max-width);word-wrap:break-word;white-space:pre-wrap;box-shadow:var(--ms-tooltip-shadow);pointer-events:none}.ms__badge-tooltip--visible{opacity:1;visibility:visible}.ms__selected-popover{display:none;position:absolute;z-index:var(--ms-z-index-popover);background:var(--ms-selected-popover-bg);border:var(--ms-selected-popover-border);border-radius:var(--ms-selected-popover-border-radius);box-shadow:var(--ms-selected-popover-box-shadow);width:var(--ms-selected-popover-width);max-height:var(--ms-selected-popover-max-height);overflow:hidden}.ms__selected-popover--visible{display:flex;flex-direction:column}.ms__selected-popover--virtual{display:block;overflow:visible;max-height:none}.ms__selected-popover-header{display:flex;align-items:center;justify-content:space-between;padding:var(--ms-selected-popover-header-padding);background:var(--ms-selected-popover-header-bg);border-bottom:var(--ms-selected-popover-header-border-bottom);font-size:var(--ms-selected-popover-header-font-size);font-weight:var(--ms-selected-popover-header-font-weight);color:var(--ms-selected-popover-header-color)}.ms__selected-popover-close{display:flex;align-items:center;justify-content:center;width:var(--ms-popover-close-size);height:var(--ms-popover-close-size);padding:0;border:none;background:var(--ms-selected-popover-close-bg);color:var(--ms-selected-popover-close-color);font-size:var(--ms-selected-popover-close-font-size);line-height:var(--ms-line-height-none);cursor:pointer;border-radius:var(--ms-selected-popover-close-border-radius);transition:all var(--ms-transition-fast) var(--ms-easing-snappy)}.ms__selected-popover-close:hover{background:var(--ms-selected-popover-close-bg-hover);color:var(--ms-selected-popover-close-color-hover)}.ms__selected-popover-body{display:flex;flex-direction:column;gap:var(--ms-selected-popover-body-gap);padding:var(--ms-selected-popover-body-padding);overflow-y:auto;max-height:var(--ms-selected-popover-body-max-height);scrollbar-width:thin;scrollbar-color:var(--ms-scrollbar-thumb-bg) var(--ms-scrollbar-track-bg)}.ms__selected-popover-body::-webkit-scrollbar{width:var(--ms-scrollbar-width)}.ms__selected-popover-body::-webkit-scrollbar-track{background:var(--ms-scrollbar-track-bg)}.ms__selected-popover-body::-webkit-scrollbar-thumb{background:var(--ms-scrollbar-thumb-bg);border-radius:var(--ms-scrollbar-thumb-border-radius)}.ms__selected-popover-body::-webkit-scrollbar-thumb:hover{background:var(--ms-scrollbar-thumb-bg-hover)}.ms__selected-popover-body .ms__badge{width:100%;min-height:fit-content;line-height:var(--ms-line-height-relaxed)}.ms__selected-popover-body .ms__badge-text{flex:1;min-width:0;white-space:normal;word-wrap:break-word}.ms__selected-popover-body--virtual{display:block;max-height:none;padding:0}.ms__selected-popover-body--virtual .ms__badge{height:var(--ms-badge-height-virtual, 36px);min-height:var(--ms-badge-height-virtual, 36px);max-height:var(--ms-badge-height-virtual, 36px);margin-bottom:var(--ms-selected-popover-body-gap);overflow:hidden;box-sizing:border-box}.ms__selected-popover-body--virtual .ms__badge-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ms--rtl .ms__input-wrapper{direction:rtl}.ms--rtl .ms__input{text-align:right;padding-left:var(--ms-input-padding-right);padding-right:var(--ms-input-padding-h)}.ms--rtl .ms__toggle{left:var(--ms-toggle-right)!important;right:auto!important}.ms--rtl .ms__counter{left:var(--ms-counter-offset)!important;right:auto!important}.ms--rtl .ms__dropdown{direction:rtl;text-align:right}.ms--rtl .ms__option{flex-direction:row-reverse}.ms--rtl .ms__checkbox{margin-left:var(--ms-spacing-sm);margin-right:0}.ms--rtl .ms__option-content{text-align:right}.ms--rtl .ms__option-icon{margin-left:var(--ms-spacing-xs);margin-right:0}.ms--rtl .ms__badges{direction:rtl}.ms--rtl .ms__badges--right{margin-left:0;margin-right:var(--ms-badges-margin-right)}.ms--rtl .ms__badges--left{margin-right:0;margin-left:var(--ms-badges-margin-left)}.ms--rtl .ms__badge{flex-direction:row-reverse}.ms--rtl .ms__badge-remove{border-radius:var(--ms-badge-border-radius) 0 0 var(--ms-badge-border-radius);border-left:var(--ms-badge-remove-border);border-right:none}.ms--rtl .ms__badge-text{border-radius:0 var(--ms-badge-border-radius) var(--ms-badge-border-radius) 0;border-right:var(--ms-badge-text-border);border-left:none}.ms--rtl .ms__count-display{direction:rtl}.ms--rtl .ms__count-display--right{margin-left:0;margin-right:var(--ms-count-display-margin-right)}.ms--rtl .ms__count-display--left{margin-right:0;margin-left:var(--ms-count-display-margin-left)}.ms--rtl .ms__counter-wrapper{flex-direction:row-reverse}.ms--rtl .ms__selected-popover{direction:rtl;text-align:right}.ms--rtl .ms__actions{direction:rtl}.ms--rtl .ms__group-label,.ms--rtl .ms__empty{text-align:right}.ms--rtl .ms__hint{direction:rtl;text-align:right}.ms--disabled .ms__input{opacity:var(--ms-disabled-input-opacity);cursor:not-allowed;background:var(--ms-input-bg-disabled)}.ms--disabled .ms__toggle{opacity:var(--ms-disabled-input-opacity)}.ms--no-checkboxes .ms__option{gap:0;padding-left:var(--ms-option-padding-h)}.ms--no-checkboxes .ms__option-content{padding-left:0}.ms-debug-info{margin-top:calc(.4 * var(--ms-rem));padding:calc(.4 * var(--ms-rem));background-color:#f9fafb;border:1px solid #e5e7eb;border-radius:calc(var(--base-border-radius-md, .6) * var(--ms-rem));font-size:calc(1.2 * var(--ms-rem));color:#111827}.ms-debug-info details summary{cursor:pointer;font-weight:600;color:#2563eb;-webkit-user-select:none;user-select:none;padding:calc(.4 * var(--ms-rem));border-radius:calc(var(--base-border-radius-sm, .4) * var(--ms-rem))}.ms-debug-info details summary:hover{background-color:#f3f4f6}.ms-debug-info details summary:focus{outline:2px solid #3b82f6;outline-offset:2px}.ms-debug-info .ms-debug-stats{display:flex;flex-direction:column;gap:calc(.4 * var(--ms-rem));margin-top:calc(.4 * var(--ms-rem));padding:calc(.4 * var(--ms-rem));background-color:#fff;border-radius:calc(var(--base-border-radius-sm, .4) * var(--ms-rem))}.ms-debug-info .ms-debug-stats span{display:flex;justify-content:space-between;padding:2px 4px;font-family:monospace;font-size:calc(1 * var(--ms-rem))}.ms-debug-info .ms-debug-stats span:before{content:"•";margin-right:calc(.4 * var(--ms-rem));color:#3b82f6}', bs = typeof HTMLElement < "u" ? HTMLElement : class {
2475
- }, Se = /* @__PURE__ */ new Set();
2476
- function rt() {
2596
+ const Se = /* @__PURE__ */ new Set();
2597
+ function lt() {
2477
2598
  return Array.from(Se);
2478
2599
  }
2479
- class nt extends bs {
2600
+ class Ae extends ys {
2480
2601
  constructor() {
2481
2602
  super();
2482
- m(this, "picker");
2483
- m(this, "containerElement");
2484
- m(this, "shadow");
2603
+ d(this, "picker");
2604
+ d(this, "containerElement");
2605
+ d(this, "shadow");
2606
+ d(this, "internals");
2485
2607
  // Properties for complex data (not attributes)
2486
- m(this, "_options");
2608
+ d(this, "_options");
2487
2609
  // Member/Callback properties
2488
- m(this, "_valueMember");
2489
- m(this, "_getValueCallback");
2490
- m(this, "_displayValueMember");
2491
- m(this, "_getDisplayValueCallback");
2492
- m(this, "_getBadgeDisplayCallback");
2493
- m(this, "_getBadgeClassCallback");
2494
- m(this, "_customStylesCallback");
2495
- m(this, "_searchValueMember");
2496
- m(this, "_getSearchValueCallback");
2497
- m(this, "_iconMember");
2498
- m(this, "_getIconCallback");
2499
- m(this, "_subtitleMember");
2500
- m(this, "_getSubtitleCallback");
2501
- m(this, "_groupMember");
2502
- m(this, "_getGroupCallback");
2503
- m(this, "_renderGroupLabelContentCallback");
2504
- m(this, "_disabledMember");
2505
- m(this, "_getDisabledCallback");
2610
+ d(this, "_valueMember");
2611
+ d(this, "_getValueCallback");
2612
+ d(this, "_displayValueMember");
2613
+ d(this, "_getDisplayValueCallback");
2614
+ d(this, "_getBadgeDisplayCallback");
2615
+ d(this, "_getBadgeClassCallback");
2616
+ d(this, "_customStylesCallback");
2617
+ d(this, "_searchValueMember");
2618
+ d(this, "_getSearchValueCallback");
2619
+ d(this, "_iconMember");
2620
+ d(this, "_getIconCallback");
2621
+ d(this, "_subtitleMember");
2622
+ d(this, "_getSubtitleCallback");
2623
+ d(this, "_groupMember");
2624
+ d(this, "_getGroupCallback");
2625
+ d(this, "_renderGroupLabelContentCallback");
2626
+ d(this, "_disabledMember");
2627
+ d(this, "_getDisabledCallback");
2506
2628
  // Value formatting callbacks
2507
- m(this, "_getValueFormatCallback");
2629
+ d(this, "_getValueFormatCallback");
2508
2630
  // Tooltip callbacks
2509
- m(this, "_getBadgeTooltipCallback");
2510
- m(this, "_getRemoveButtonTooltipCallback");
2631
+ d(this, "_getBadgeTooltipCallback");
2632
+ d(this, "_getRemoveButtonTooltipCallback");
2511
2633
  // Custom rendering callbacks
2512
- m(this, "_renderOptionContentCallback");
2513
- m(this, "_renderBadgeContentCallback");
2514
- m(this, "_renderSelectedItemContentCallback");
2515
- m(this, "_getSelectedItemClassCallback");
2516
- m(this, "_renderSelectedContentCallback");
2634
+ d(this, "_renderOptionContentCallback");
2635
+ d(this, "_renderBadgeContentCallback");
2636
+ d(this, "_renderSelectedItemContentCallback");
2637
+ d(this, "_getSelectedItemClassCallback");
2638
+ d(this, "_renderSelectedContentCallback");
2517
2639
  // Count badge callback
2518
- m(this, "_getCounterCallback");
2640
+ d(this, "_getCounterCallback");
2519
2641
  // Action buttons
2520
- m(this, "_actionButtons");
2642
+ d(this, "_actionButtons");
2521
2643
  // Event callbacks
2522
- m(this, "_beforeSearchCallback");
2523
- m(this, "_searchCallback");
2524
- m(this, "_addNewCallback");
2525
- m(this, "_selectCallback");
2526
- m(this, "_deselectCallback");
2527
- m(this, "_changeCallback");
2528
- m(this, "_declarativeSelectedValues");
2529
- this.shadow = this.attachShadow({ mode: "open" });
2644
+ d(this, "_beforeSearchCallback");
2645
+ d(this, "_searchCallback");
2646
+ d(this, "_addNewCallback");
2647
+ d(this, "_selectCallback");
2648
+ d(this, "_deselectCallback");
2649
+ d(this, "_changeCallback");
2650
+ d(this, "_declarativeSelectedValues");
2651
+ if (this.shadow = this.attachShadow({ mode: "open" }), typeof this.attachInternals == "function")
2652
+ try {
2653
+ this.internals = this.attachInternals();
2654
+ } catch {
2655
+ }
2530
2656
  const t = document.createElement("style");
2531
- t.textContent = gs, this.shadow.appendChild(t), requestAnimationFrame(() => {
2657
+ t.textContent = ks, this.shadow.appendChild(t), requestAnimationFrame(() => {
2532
2658
  this.setAttribute("data-ready", "");
2533
2659
  });
2534
2660
  }
2535
2661
  static get observedAttributes() {
2536
2662
  return [
2537
- // Existing attributes (external names - standard/familiar)
2538
- "search-hint",
2539
- "search-placeholder",
2540
- "multiple",
2541
- "allow-groups",
2542
- "show-checkboxes",
2543
- "sticky-actions",
2544
- "close-on-select",
2545
- "lock-placement",
2546
- "dropdown-min-width",
2547
- "dropdown-max-width",
2548
- "badges-display-mode",
2549
- "badges-threshold",
2550
- "badges-max-visible",
2551
- "badges-threshold-mode",
2552
- "badges-position",
2553
- "show-counter",
2554
- "keep-options-on-search",
2555
- "should-keep-search-on-close",
2556
- "max-height",
2557
- "empty-message",
2558
- "loading-message",
2559
- "min-search-length",
2560
- "enable-search",
2561
- "search-input-mode",
2562
- "search-mode",
2563
- "actions-layout",
2564
- "allow-add-new",
2663
+ ...Ce.map((t) => t.attr),
2664
+ // Out-of-table attributes (handled by special-case logic in attributeChangedCallback)
2565
2665
  "initial-values",
2566
- // Virtual scroll options
2567
- "enable-virtual-scroll",
2568
- "virtual-scroll-threshold",
2569
- "option-height",
2570
- "badge-height",
2571
- "virtual-scroll-buffer",
2572
- // New member properties
2573
- "value-member",
2574
- "display-value-member",
2575
- "search-value-member",
2576
- "icon-member",
2577
- "subtitle-member",
2578
- "group-member",
2579
- "disabled-member",
2580
- // Form integration
2581
- "name",
2582
- "value-format",
2583
- // Tooltip options
2584
- "enable-badge-tooltips",
2585
- "badge-tooltip-placement",
2586
- "remove-button-tooltip-text",
2587
- // Debug
2588
2666
  "show-debug-info"
2589
2667
  ];
2590
2668
  }
2669
+ /**
2670
+ * Called by the browser when the surrounding <form> is reset. Clears the
2671
+ * picker's selection so the multiselect actually participates in the
2672
+ * standard reset lifecycle. (Before form-association, reset was a no-op
2673
+ * because the hidden inputs were re-stamped from internal state on every
2674
+ * render.)
2675
+ */
2676
+ formResetCallback() {
2677
+ var t;
2678
+ (t = this.picker) == null || t.clearAll();
2679
+ }
2591
2680
  connectedCallback() {
2592
2681
  Se.add(this), this.render();
2593
2682
  const t = this.parseDeclarativeOptions();
2594
- t && (this._options && this._options.length > 0 && S.warn("[MultiSelectElement] Both declarative <option> elements and programmatic .options detected. Using declarative options."), this._options = t), this.initializePicker();
2683
+ t && (this._options && this._options.length > 0 && x.warn("[MultiSelectElement] Both declarative <option> elements and programmatic .options detected. Using declarative options."), this._options = t), this.initializePicker();
2595
2684
  }
2596
2685
  disconnectedCallback() {
2597
2686
  Se.delete(this), this.picker && this.picker.destroy();
2598
2687
  }
2599
- attributeChangedCallback(t, s, i) {
2600
- s !== i && this.picker && t !== "initial-values" && (this.picker.destroy(), this.initializePicker());
2688
+ attributeChangedCallback(t, o, i) {
2689
+ var n;
2690
+ if (o === i || !this.picker || t === "initial-values") return;
2691
+ if (t === "show-debug-info") {
2692
+ const a = this.shadow.querySelector(".ms-debug-info");
2693
+ a && a.remove(), i === "true" && this.renderDebugInfo();
2694
+ return;
2695
+ }
2696
+ const r = xs.get(t);
2697
+ if (r) {
2698
+ const a = Ge(r, i), l = (n = je.find((u) => u.key === r.key)) == null ? void 0 : n.field, c = a === void 0 && l ? this[l] : a, h = { [r.key]: c };
2699
+ if (this.picker.updateOptions(h)) return;
2700
+ }
2701
+ this.reinitialize();
2601
2702
  }
2602
2703
  render() {
2603
2704
  this.containerElement = document.createElement("div"), this.containerElement.setAttribute("data-multiselect", ""), this.className && (this.containerElement.className = this.className), this.shadow.appendChild(this.containerElement), this.getAttribute("show-debug-info") === "true" && this.renderDebugInfo();
@@ -2605,26 +2706,26 @@ class nt extends bs {
2605
2706
  renderDebugInfo() {
2606
2707
  const t = this.shadow.querySelector(".ms-debug-info");
2607
2708
  t && t.remove();
2608
- const s = document.createElement("div");
2609
- s.className = "ms-debug-info";
2709
+ const o = document.createElement("div");
2710
+ o.className = "ms-debug-info";
2610
2711
  const i = document.createElement("details"), r = document.createElement("summary");
2611
2712
  r.textContent = "Debug Info";
2612
2713
  const n = document.createElement("div");
2613
- n.className = "ms-debug-stats", i.appendChild(r), i.appendChild(n), s.appendChild(i), this.shadow.appendChild(s), this.updateDebugInfo();
2714
+ n.className = "ms-debug-stats", i.appendChild(r), i.appendChild(n), o.appendChild(i), this.shadow.appendChild(o), this.updateDebugInfo();
2614
2715
  }
2615
2716
  updateDebugInfo() {
2616
- var h, g;
2717
+ var m, g;
2617
2718
  const t = this.shadow.querySelector(".ms-debug-stats");
2618
2719
  if (!t || !this.picker) return;
2619
- const s = "1.8.6", i = rt().length, n = this.picker.getSelected().length, a = ((h = this._options) == null ? void 0 : h.length) || 0, l = this.picker, c = l.isOpen || !1, d = l.searchTerm || "", p = l.isLoading || !1, u = ((g = l.filteredOptions) == null ? void 0 : g.length) || 0;
2720
+ const o = "1.10.0", i = lt().length, n = this.picker.getSelected().length, a = ((m = this._options) == null ? void 0 : m.length) || 0, l = this.picker, c = l.isOpen || !1, h = l.searchTerm || "", p = l.isLoading || !1, u = ((g = l.filteredOptions) == null ? void 0 : g.length) || 0;
2620
2721
  t.innerHTML = `
2621
- <span>Version: ${s}</span>
2722
+ <span>Version: ${o}</span>
2622
2723
  <span>Total Instances: ${i}</span>
2623
2724
  <span>Options: ${a}</span>
2624
2725
  <span>Filtered: ${u}</span>
2625
2726
  <span>Selected: ${n}</span>
2626
2727
  <span>Dropdown: ${c ? "Open" : "Closed"}</span>
2627
- <span>Search: ${d || "none"}</span>
2728
+ <span>Search: ${h || "none"}</span>
2628
2729
  <span>Loading: ${p ? "Yes" : "No"}</span>
2629
2730
  `, setTimeout(() => {
2630
2731
  this.getAttribute("show-debug-info") === "true" && this.updateDebugInfo();
@@ -2636,96 +2737,68 @@ class nt extends bs {
2636
2737
  */
2637
2738
  parseDeclarativeOptions() {
2638
2739
  var r, n, a, l;
2639
- const t = [], s = Array.from(this.children);
2640
- if (s.length === 0)
2740
+ const t = [], o = Array.from(this.children);
2741
+ if (o.length === 0)
2641
2742
  return null;
2642
2743
  let i = !1;
2643
- for (const c of s)
2744
+ for (const c of o)
2644
2745
  if (c.tagName === "OPTION") {
2645
- const d = c, p = {
2646
- value: d.value || ((r = d.textContent) == null ? void 0 : r.trim()) || "",
2647
- label: ((n = d.textContent) == null ? void 0 : n.trim()) || d.value || ""
2746
+ const h = c, p = {
2747
+ value: h.value || ((r = h.textContent) == null ? void 0 : r.trim()) || "",
2748
+ label: ((n = h.textContent) == null ? void 0 : n.trim()) || h.value || ""
2648
2749
  };
2649
- d.hasAttribute("selected") && (this._declarativeSelectedValues || (this._declarativeSelectedValues = []), this._declarativeSelectedValues.push(p.value)), d.hasAttribute("disabled") && (p.disabled = !0), d.hasAttribute("data-icon") && (p.icon = d.getAttribute("data-icon")), d.hasAttribute("data-subtitle") && (p.subtitle = d.getAttribute("data-subtitle")), t.push(p), i = !0;
2750
+ h.hasAttribute("selected") && (this._declarativeSelectedValues || (this._declarativeSelectedValues = []), this._declarativeSelectedValues.push(p.value)), h.hasAttribute("disabled") && (p.disabled = !0), h.hasAttribute("data-icon") && (p.icon = h.getAttribute("data-icon")), h.hasAttribute("data-subtitle") && (p.subtitle = h.getAttribute("data-subtitle")), t.push(p), i = !0;
2650
2751
  } else if (c.tagName === "OPTGROUP") {
2651
- const d = c, p = d.label || d.getAttribute("label") || "Group", u = Array.from(d.querySelectorAll("option"));
2652
- for (const h of u) {
2752
+ const h = c, p = h.label || h.getAttribute("label") || "Group", u = Array.from(h.querySelectorAll("option"));
2753
+ for (const m of u) {
2653
2754
  const g = {
2654
- value: h.value || ((a = h.textContent) == null ? void 0 : a.trim()) || "",
2655
- label: ((l = h.textContent) == null ? void 0 : l.trim()) || h.value || "",
2755
+ value: m.value || ((a = m.textContent) == null ? void 0 : a.trim()) || "",
2756
+ label: ((l = m.textContent) == null ? void 0 : l.trim()) || m.value || "",
2656
2757
  group: p
2657
2758
  };
2658
- h.hasAttribute("selected") && (this._declarativeSelectedValues || (this._declarativeSelectedValues = []), this._declarativeSelectedValues.push(g.value)), h.hasAttribute("disabled") && (g.disabled = !0), h.hasAttribute("data-icon") && (g.icon = h.getAttribute("data-icon")), h.hasAttribute("data-subtitle") && (g.subtitle = h.getAttribute("data-subtitle")), t.push(g), i = !0;
2759
+ m.hasAttribute("selected") && (this._declarativeSelectedValues || (this._declarativeSelectedValues = []), this._declarativeSelectedValues.push(g.value)), m.hasAttribute("disabled") && (g.disabled = !0), m.hasAttribute("data-icon") && (g.icon = m.getAttribute("data-icon")), m.hasAttribute("data-subtitle") && (g.subtitle = m.getAttribute("data-subtitle")), t.push(g), i = !0;
2659
2760
  }
2660
2761
  }
2661
- return i ? (S.debug(`[MultiSelectElement] Parsed ${t.length} declarative options from Light DOM`), s.forEach((c) => {
2762
+ return i ? (x.debug(`[MultiSelectElement] Parsed ${t.length} declarative options from Light DOM`), o.forEach((c) => {
2662
2763
  (c.tagName === "OPTION" || c.tagName === "OPTGROUP") && c.remove();
2663
2764
  }), t) : null;
2664
2765
  }
2766
+ /** Parse all observed attributes via ATTRIBUTE_TABLE into a partial config object. */
2767
+ parseAttributesFromTable() {
2768
+ const t = {};
2769
+ for (const o of Ce) {
2770
+ const i = Ge(o, this.getAttribute(o.attr));
2771
+ i !== void 0 && (t[o.key] = i);
2772
+ }
2773
+ return t;
2774
+ }
2665
2775
  initializePicker() {
2666
2776
  if (!this.containerElement) return;
2667
2777
  let t;
2778
+ const o = this.getAttribute("data-options");
2779
+ if (o && this._options === void 0)
2780
+ try {
2781
+ t = JSON.parse(o);
2782
+ } catch (n) {
2783
+ x.error("[MultiSelectElement] Failed to parse data-options:", n);
2784
+ }
2785
+ let i;
2668
2786
  if (this._declarativeSelectedValues && this._declarativeSelectedValues.length > 0)
2669
- t = this._declarativeSelectedValues, S.debug(`[MultiSelectElement] Using ${t.length} declaratively selected values`);
2787
+ i = this._declarativeSelectedValues, x.debug(`[MultiSelectElement] Using ${i.length} declaratively selected values`);
2670
2788
  else {
2671
- const i = this.getAttribute("initial-values");
2672
- if (i)
2789
+ const n = this.getAttribute("initial-values");
2790
+ if (n)
2673
2791
  try {
2674
- t = JSON.parse(i);
2675
- } catch (r) {
2676
- S.error("[MultiSelectElement] Failed to parse initial-values:", r);
2792
+ i = JSON.parse(n);
2793
+ } catch (a) {
2794
+ x.error("[MultiSelectElement] Failed to parse initial-values:", a);
2677
2795
  }
2678
2796
  }
2679
- const s = {
2680
- // String options
2681
- searchHint: this.getAttribute("search-hint") || void 0,
2682
- searchPlaceholder: this.getAttribute("search-placeholder") || "Search...",
2683
- dropdownMinWidth: this.getAttribute("dropdown-min-width") || void 0,
2684
- dropdownMaxWidth: this.getAttribute("dropdown-max-width") || void 0,
2685
- badgesDisplayMode: this.getAttribute("badges-display-mode") || "badges",
2686
- badgesPosition: this.getAttribute("badges-position") || "bottom",
2687
- badgesThresholdMode: this.getAttribute("badges-threshold-mode") || "count",
2688
- maxHeight: this.getAttribute("max-height") || "20rem",
2689
- emptyMessage: this.getAttribute("empty-message") || "No results found",
2690
- loadingMessage: this.getAttribute("loading-message") || "Loading...",
2691
- searchInputMode: this.getAttribute("search-input-mode") || "normal",
2692
- searchMode: this.getAttribute("search-mode") || "filter",
2693
- actionsLayout: this.getAttribute("actions-layout") || "nowrap",
2694
- // Number options
2695
- badgesThreshold: this.getAttribute("badges-threshold") ? parseInt(this.getAttribute("badges-threshold")) : void 0,
2696
- badgesMaxVisible: this.getAttribute("badges-max-visible") ? parseInt(this.getAttribute("badges-max-visible")) : void 0,
2697
- minSearchLength: this.getAttribute("min-search-length") ? parseInt(this.getAttribute("min-search-length")) : 0,
2698
- // Boolean options (map external to internal with 'is' prefix)
2699
- isMultipleEnabled: this.getAttribute("multiple") !== "false",
2700
- isGroupsAllowed: this.getAttribute("allow-groups") !== "false",
2701
- isCheckboxesShown: this.getAttribute("show-checkboxes") !== "false",
2702
- isActionsSticky: this.getAttribute("sticky-actions") !== "false",
2703
- isCloseOnSelect: this.getAttribute("close-on-select") === "true",
2704
- isPlacementLocked: this.getAttribute("lock-placement") !== "false",
2705
- isSearchEnabled: this.getAttribute("enable-search") !== "false",
2706
- isAddNewAllowed: this.getAttribute("allow-add-new") === "true",
2707
- isCounterShown: this.getAttribute("show-counter") === "true",
2708
- isKeepOptionsOnSearch: this.getAttribute("keep-options-on-search") !== "false",
2709
- shouldKeepSearchOnClose: this.getAttribute("should-keep-search-on-close") !== "false",
2710
- isVirtualScrollEnabled: this.getAttribute("enable-virtual-scroll") === "true",
2711
- // Action buttons
2797
+ const r = this.parseAttributesFromTable();
2798
+ for (const { key: n, field: a } of je)
2799
+ r[n] === void 0 && (r[n] = this[a]);
2800
+ if (Object.assign(r, {
2712
2801
  actionButtons: this._actionButtons,
2713
- // Checkbox options
2714
- checkboxAlign: this.getAttribute("checkbox-align") || "center",
2715
- // Virtual scroll options
2716
- virtualScrollThreshold: this.getAttribute("virtual-scroll-threshold") ? parseInt(this.getAttribute("virtual-scroll-threshold")) : 100,
2717
- optionHeight: this.getAttribute("option-height") ? parseInt(this.getAttribute("option-height")) : 50,
2718
- badgeHeight: this.getAttribute("badge-height") ? parseInt(this.getAttribute("badge-height")) : 36,
2719
- virtualScrollBuffer: this.getAttribute("virtual-scroll-buffer") ? parseInt(this.getAttribute("virtual-scroll-buffer")) : 10,
2720
- // Member properties
2721
- valueMember: this.getAttribute("value-member") || this._valueMember,
2722
- displayValueMember: this.getAttribute("display-value-member") || this._displayValueMember,
2723
- searchValueMember: this.getAttribute("search-value-member") || this._searchValueMember,
2724
- iconMember: this.getAttribute("icon-member") || this._iconMember,
2725
- subtitleMember: this.getAttribute("subtitle-member") || this._subtitleMember,
2726
- groupMember: this.getAttribute("group-member") || this._groupMember,
2727
- disabledMember: this.getAttribute("disabled-member") || this._disabledMember,
2728
- // Callback properties (JavaScript only)
2729
2802
  getValueCallback: this._getValueCallback,
2730
2803
  getDisplayValueCallback: this._getDisplayValueCallback,
2731
2804
  getBadgeDisplayCallback: this._getBadgeDisplayCallback,
@@ -2737,68 +2810,44 @@ class nt extends bs {
2737
2810
  getGroupCallback: this._getGroupCallback,
2738
2811
  renderGroupLabelContentCallback: this._renderGroupLabelContentCallback,
2739
2812
  getDisabledCallback: this._getDisabledCallback,
2740
- // Custom rendering callbacks
2741
2813
  renderOptionContentCallback: this._renderOptionContentCallback,
2742
2814
  renderBadgeContentCallback: this._renderBadgeContentCallback,
2743
2815
  renderSelectedItemContentCallback: this._renderSelectedItemContentCallback,
2744
2816
  getSelectedItemClassCallback: this._getSelectedItemClassCallback,
2745
2817
  renderSelectedContentCallback: this._renderSelectedContentCallback,
2746
- // Form integration & value formatting
2747
- formFieldId: this.getAttribute("name") || void 0,
2748
- valueFormat: this.getAttribute("value-format") || "json",
2749
2818
  getValueFormatCallback: this._getValueFormatCallback,
2750
- // Tooltip options
2751
- isBadgeTooltipsEnabled: this.getAttribute("enable-badge-tooltips") === "true",
2752
2819
  getBadgeTooltipCallback: this._getBadgeTooltipCallback,
2753
2820
  getRemoveButtonTooltipCallback: this._getRemoveButtonTooltipCallback,
2754
- removeButtonTooltipText: this.getAttribute("remove-button-tooltip-text") || void 0,
2755
- badgeTooltipPlacement: this.getAttribute("badge-tooltip-placement") || "top",
2756
- badgeTooltipDelay: parseInt(this.getAttribute("badge-tooltip-delay") || "100"),
2757
- badgeTooltipOffset: parseInt(this.getAttribute("badge-tooltip-offset") || "8"),
2758
- // Count badge callback
2759
- getCounterCallback: this._getCounterCallback || ((i, r) => r !== void 0 ? `+${r} more` : `${i} selected`),
2760
- // Data and callbacks
2761
- options: this._options,
2821
+ getCounterCallback: this._getCounterCallback || ((n, a) => a !== void 0 ? `+${a} more` : `${n} selected`),
2822
+ options: this._options ?? t,
2762
2823
  beforeSearchCallback: this._beforeSearchCallback,
2763
2824
  searchCallback: this._searchCallback,
2764
2825
  addNewCallback: this._addNewCallback,
2765
- selectCallback: (i) => {
2766
- var r;
2767
- this._selectCallback && this._selectCallback(i), this.dispatchEvent(new CustomEvent("select", {
2826
+ selectCallback: (n) => {
2827
+ var a;
2828
+ this._selectCallback && this._selectCallback(n), this.dispatchEvent(new CustomEvent("select", {
2768
2829
  detail: {
2769
- option: i,
2770
- selectedOptions: (r = this.picker) == null ? void 0 : r.getSelected(),
2771
- selectedValues: (() => {
2772
- var a;
2773
- const n = (a = this.picker) == null ? void 0 : a.getValue();
2774
- return n == null ? [] : Array.isArray(n) ? n : [n];
2775
- })()
2830
+ option: n,
2831
+ selectedOptions: (a = this.picker) == null ? void 0 : a.getSelected(),
2832
+ selectedValues: this.collectSelectedValues()
2776
2833
  }
2777
2834
  }));
2778
2835
  },
2779
- deselectCallback: (i) => {
2780
- var r;
2781
- this._deselectCallback && this._deselectCallback(i), this.dispatchEvent(new CustomEvent("deselect", {
2836
+ deselectCallback: (n) => {
2837
+ var a;
2838
+ this._deselectCallback && this._deselectCallback(n), this.dispatchEvent(new CustomEvent("deselect", {
2782
2839
  detail: {
2783
- option: i,
2784
- selectedOptions: (r = this.picker) == null ? void 0 : r.getSelected(),
2785
- selectedValues: (() => {
2786
- var a;
2787
- const n = (a = this.picker) == null ? void 0 : a.getValue();
2788
- return n == null ? [] : Array.isArray(n) ? n : [n];
2789
- })()
2840
+ option: n,
2841
+ selectedOptions: (a = this.picker) == null ? void 0 : a.getSelected(),
2842
+ selectedValues: this.collectSelectedValues()
2790
2843
  }
2791
2844
  }));
2792
2845
  },
2793
- changeCallback: (i) => {
2794
- this._changeCallback && this._changeCallback(i), this.dispatchEvent(new CustomEvent("change", {
2846
+ changeCallback: (n) => {
2847
+ this._changeCallback && this._changeCallback(n), this.dispatchEvent(new CustomEvent("change", {
2795
2848
  detail: {
2796
- selectedOptions: i,
2797
- selectedValues: (() => {
2798
- var n;
2799
- const r = (n = this.picker) == null ? void 0 : n.getValue();
2800
- return r == null ? [] : Array.isArray(r) ? r : [r];
2801
- })()
2849
+ selectedOptions: n,
2850
+ selectedValues: this.collectSelectedValues()
2802
2851
  }
2803
2852
  }));
2804
2853
  },
@@ -2806,18 +2855,32 @@ class nt extends bs {
2806
2855
  container: this.shadow,
2807
2856
  // Pass host element (this) for hidden inputs in light DOM
2808
2857
  hostElement: this
2809
- };
2810
- if (t && (this.containerElement.dataset.initialValues = JSON.stringify(t)), this.picker = new us(this.containerElement, s), this._customStylesCallback) {
2811
- const i = this._customStylesCallback();
2812
- if (i) {
2813
- const r = document.createElement("style");
2814
- r.className = "ms-custom-styles", r.textContent = i, this.shadow.insertBefore(r, this.shadow.firstChild);
2858
+ }), i && (this.containerElement.dataset.initialValues = JSON.stringify(i)), this.picker = new _s(this.containerElement, r), this._customStylesCallback) {
2859
+ const n = this._customStylesCallback();
2860
+ if (n) {
2861
+ const a = document.createElement("style");
2862
+ a.className = "ms-custom-styles", a.textContent = n, this.shadow.insertBefore(a, this.shadow.firstChild);
2815
2863
  }
2816
2864
  }
2817
2865
  }
2818
2866
  reinitialize() {
2819
2867
  this.picker && (this.picker.destroy(), this.initializePicker());
2820
2868
  }
2869
+ /**
2870
+ * Apply a partial config update to the live picker. Falls back to a full reinit if the
2871
+ * picker can't apply the change in place (e.g. adding/removing the `searchHint` element).
2872
+ * No-op if the picker hasn't been initialized yet — the next `initializePicker` will pick
2873
+ * up the new programmatic state.
2874
+ */
2875
+ updatePicker(t) {
2876
+ this.picker && (this.picker.updateOptions(t) || this.reinitialize());
2877
+ }
2878
+ /** Normalize the picker's getValue() return into the array form expected by event detail. */
2879
+ collectSelectedValues() {
2880
+ var o;
2881
+ const t = (o = this.picker) == null ? void 0 : o.getValue();
2882
+ return t == null ? [] : Array.isArray(t) ? t : [t];
2883
+ }
2821
2884
  // ========================================================================
2822
2885
  // PUBLIC API - PROPERTIES
2823
2886
  // ========================================================================
@@ -2826,7 +2889,7 @@ class nt extends bs {
2826
2889
  return this._options;
2827
2890
  }
2828
2891
  set options(t) {
2829
- this._options = t, this.reinitialize();
2892
+ this._options = t, this.updatePicker({ options: t });
2830
2893
  }
2831
2894
  // Member properties (can also be set via attributes)
2832
2895
  set valueMember(t) {
@@ -2873,37 +2936,37 @@ class nt extends bs {
2873
2936
  }
2874
2937
  // Callback properties (JavaScript only - no attributes)
2875
2938
  set getValueCallback(t) {
2876
- this._getValueCallback = t, this.reinitialize();
2939
+ this._getValueCallback = t, this.updatePicker({ getValueCallback: t });
2877
2940
  }
2878
2941
  get getValueCallback() {
2879
2942
  return this._getValueCallback;
2880
2943
  }
2881
2944
  set getDisplayValueCallback(t) {
2882
- this._getDisplayValueCallback = t, this.reinitialize();
2945
+ this._getDisplayValueCallback = t, this.updatePicker({ getDisplayValueCallback: t });
2883
2946
  }
2884
2947
  get getDisplayValueCallback() {
2885
2948
  return this._getDisplayValueCallback;
2886
2949
  }
2887
2950
  set getBadgeDisplayCallback(t) {
2888
- this._getBadgeDisplayCallback = t, this.reinitialize();
2951
+ this._getBadgeDisplayCallback = t, this.updatePicker({ getBadgeDisplayCallback: t });
2889
2952
  }
2890
2953
  get getBadgeDisplayCallback() {
2891
2954
  return this._getBadgeDisplayCallback;
2892
2955
  }
2893
2956
  set getBadgeClassCallback(t) {
2894
- this._getBadgeClassCallback = t, this.reinitialize();
2957
+ this._getBadgeClassCallback = t, this.updatePicker({ getBadgeClassCallback: t });
2895
2958
  }
2896
2959
  get getBadgeClassCallback() {
2897
2960
  return this._getBadgeClassCallback;
2898
2961
  }
2899
2962
  set customStylesCallback(t) {
2900
2963
  if (this._customStylesCallback = t, this.picker && t) {
2901
- const s = t();
2902
- if (s) {
2964
+ const o = t();
2965
+ if (o) {
2903
2966
  const i = this.shadow.querySelector("style.ms-custom-styles");
2904
2967
  i && i.remove();
2905
2968
  const r = document.createElement("style");
2906
- r.className = "ms-custom-styles", r.textContent = s, this.shadow.appendChild(r), this.picker.renderBadges();
2969
+ r.className = "ms-custom-styles", r.textContent = o, this.shadow.appendChild(r), this.picker.renderBadges();
2907
2970
  }
2908
2971
  }
2909
2972
  }
@@ -2911,68 +2974,68 @@ class nt extends bs {
2911
2974
  return this._customStylesCallback;
2912
2975
  }
2913
2976
  set getSearchValueCallback(t) {
2914
- this._getSearchValueCallback = t, this.reinitialize();
2977
+ this._getSearchValueCallback = t, this.updatePicker({ getSearchValueCallback: t });
2915
2978
  }
2916
2979
  get getSearchValueCallback() {
2917
2980
  return this._getSearchValueCallback;
2918
2981
  }
2919
2982
  set getIconCallback(t) {
2920
- this._getIconCallback = t, this.reinitialize();
2983
+ this._getIconCallback = t, this.updatePicker({ getIconCallback: t });
2921
2984
  }
2922
2985
  get getIconCallback() {
2923
2986
  return this._getIconCallback;
2924
2987
  }
2925
2988
  set getSubtitleCallback(t) {
2926
- this._getSubtitleCallback = t, this.reinitialize();
2989
+ this._getSubtitleCallback = t, this.updatePicker({ getSubtitleCallback: t });
2927
2990
  }
2928
2991
  get getSubtitleCallback() {
2929
2992
  return this._getSubtitleCallback;
2930
2993
  }
2931
2994
  set getGroupCallback(t) {
2932
- this._getGroupCallback = t, this.reinitialize();
2995
+ this._getGroupCallback = t, this.updatePicker({ getGroupCallback: t });
2933
2996
  }
2934
2997
  get getGroupCallback() {
2935
2998
  return this._getGroupCallback;
2936
2999
  }
2937
3000
  set renderGroupLabelContentCallback(t) {
2938
- this._renderGroupLabelContentCallback = t, this.reinitialize();
3001
+ this._renderGroupLabelContentCallback = t, this.updatePicker({ renderGroupLabelContentCallback: t });
2939
3002
  }
2940
3003
  get renderGroupLabelContentCallback() {
2941
3004
  return this._renderGroupLabelContentCallback;
2942
3005
  }
2943
3006
  set getDisabledCallback(t) {
2944
- this._getDisabledCallback = t, this.reinitialize();
3007
+ this._getDisabledCallback = t, this.updatePicker({ getDisabledCallback: t });
2945
3008
  }
2946
3009
  get getDisabledCallback() {
2947
3010
  return this._getDisabledCallback;
2948
3011
  }
2949
3012
  // Custom rendering callbacks
2950
3013
  set renderOptionContentCallback(t) {
2951
- this._renderOptionContentCallback = t, this.reinitialize();
3014
+ this._renderOptionContentCallback = t, this.updatePicker({ renderOptionContentCallback: t });
2952
3015
  }
2953
3016
  get renderOptionContentCallback() {
2954
3017
  return this._renderOptionContentCallback;
2955
3018
  }
2956
3019
  set renderBadgeContentCallback(t) {
2957
- this._renderBadgeContentCallback = t, this.reinitialize();
3020
+ this._renderBadgeContentCallback = t, this.updatePicker({ renderBadgeContentCallback: t });
2958
3021
  }
2959
3022
  get renderBadgeContentCallback() {
2960
3023
  return this._renderBadgeContentCallback;
2961
3024
  }
2962
3025
  set renderSelectedItemContentCallback(t) {
2963
- this._renderSelectedItemContentCallback = t, this.reinitialize();
3026
+ this._renderSelectedItemContentCallback = t, this.updatePicker({ renderSelectedItemContentCallback: t });
2964
3027
  }
2965
3028
  get renderSelectedItemContentCallback() {
2966
3029
  return this._renderSelectedItemContentCallback;
2967
3030
  }
2968
3031
  set getSelectedItemClassCallback(t) {
2969
- this._getSelectedItemClassCallback = t, this.reinitialize();
3032
+ this._getSelectedItemClassCallback = t, this.updatePicker({ getSelectedItemClassCallback: t });
2970
3033
  }
2971
3034
  get getSelectedItemClassCallback() {
2972
3035
  return this._getSelectedItemClassCallback;
2973
3036
  }
2974
3037
  set renderSelectedContentCallback(t) {
2975
- this._renderSelectedContentCallback = t, this.reinitialize();
3038
+ this._renderSelectedContentCallback = t, this.updatePicker({ renderSelectedContentCallback: t });
2976
3039
  }
2977
3040
  get renderSelectedContentCallback() {
2978
3041
  return this._renderSelectedContentCallback;
@@ -2991,7 +3054,7 @@ class nt extends bs {
2991
3054
  return this.getAttribute("value-format");
2992
3055
  }
2993
3056
  set getValueFormatCallback(t) {
2994
- this._getValueFormatCallback = t, this.reinitialize();
3057
+ this._getValueFormatCallback = t, this.updatePicker({ getValueFormatCallback: t });
2995
3058
  }
2996
3059
  get getValueFormatCallback() {
2997
3060
  return this._getValueFormatCallback;
@@ -3031,13 +3094,13 @@ class nt extends bs {
3031
3094
  return this.getAttribute("badge-tooltip-placement");
3032
3095
  }
3033
3096
  set getBadgeTooltipCallback(t) {
3034
- this._getBadgeTooltipCallback = t, this.reinitialize();
3097
+ this._getBadgeTooltipCallback = t, this.updatePicker({ getBadgeTooltipCallback: t });
3035
3098
  }
3036
3099
  get getBadgeTooltipCallback() {
3037
3100
  return this._getBadgeTooltipCallback;
3038
3101
  }
3039
3102
  set getRemoveButtonTooltipCallback(t) {
3040
- this._getRemoveButtonTooltipCallback = t, this.reinitialize();
3103
+ this._getRemoveButtonTooltipCallback = t, this.updatePicker({ getRemoveButtonTooltipCallback: t });
3041
3104
  }
3042
3105
  get getRemoveButtonTooltipCallback() {
3043
3106
  return this._getRemoveButtonTooltipCallback;
@@ -3049,7 +3112,7 @@ class nt extends bs {
3049
3112
  return this.getAttribute("remove-button-tooltip-text");
3050
3113
  }
3051
3114
  set getCounterCallback(t) {
3052
- this._getCounterCallback = t, this.reinitialize();
3115
+ this._getCounterCallback = t, this.updatePicker({ getCounterCallback: t });
3053
3116
  }
3054
3117
  get getCounterCallback() {
3055
3118
  return this._getCounterCallback;
@@ -3059,19 +3122,19 @@ class nt extends bs {
3059
3122
  return this._beforeSearchCallback;
3060
3123
  }
3061
3124
  set beforeSearchCallback(t) {
3062
- this._beforeSearchCallback = t, this.reinitialize();
3125
+ this._beforeSearchCallback = t, this.updatePicker({ beforeSearchCallback: t });
3063
3126
  }
3064
3127
  get searchCallback() {
3065
3128
  return this._searchCallback;
3066
3129
  }
3067
3130
  set searchCallback(t) {
3068
- this._searchCallback = t, this.reinitialize();
3131
+ this._searchCallback = t, this.updatePicker({ searchCallback: t });
3069
3132
  }
3070
3133
  get addNewCallback() {
3071
3134
  return this._addNewCallback;
3072
3135
  }
3073
3136
  set addNewCallback(t) {
3074
- this._addNewCallback = t, this.reinitialize();
3137
+ this._addNewCallback = t, this.updatePicker({ addNewCallback: t });
3075
3138
  }
3076
3139
  get selectCallback() {
3077
3140
  return this._selectCallback;
@@ -3096,7 +3159,7 @@ class nt extends bs {
3096
3159
  return this._actionButtons;
3097
3160
  }
3098
3161
  set actionButtons(t) {
3099
- this._actionButtons = t, this.reinitialize();
3162
+ this._actionButtons = t, this.updatePicker({ actionButtons: t });
3100
3163
  }
3101
3164
  // New public properties
3102
3165
  get selectedValue() {
@@ -3123,39 +3186,44 @@ class nt extends bs {
3123
3186
  this.picker && this.picker.destroy();
3124
3187
  }
3125
3188
  }
3126
- typeof window < "u" && typeof customElements < "u" && (customElements.get("web-multiselect") || customElements.define("web-multiselect", nt));
3189
+ // Opt into the form-associated custom element lifecycle. This is what
3190
+ // makes `form.reset()`, `form.elements`, and (in the future) constraint
3191
+ // validation actually do something. Without this flag the element is
3192
+ // invisible to the form lifecycle even when it has a `name`.
3193
+ d(Ae, "formAssociated", !0);
3194
+ typeof window < "u" && typeof customElements < "u" && (customElements.get("web-multiselect") || customElements.define("web-multiselect", Ae));
3127
3195
  typeof window < "u" && (window.components = window.components || {}, window.components["web-multiselect"] = {
3128
- version: () => "1.8.6",
3196
+ version: () => "1.10.0",
3129
3197
  config: {
3130
3198
  name: "@keenmate/web-multiselect",
3131
- version: "1.8.6",
3199
+ version: "1.10.0",
3132
3200
  author: "Keenmate",
3133
3201
  license: "MIT",
3134
3202
  repository: "git+https://github.com/keenmate/web-multiselect.git",
3135
- homepage: "https://github.com/keenmate/web-multiselect#readme"
3203
+ homepage: "https://web-multiselect.keenmate.dev"
3136
3204
  },
3137
3205
  logging: {
3138
- enableLogging: ds,
3139
- disableLogging: hs,
3140
- setLogLevel: ms,
3141
- setCategoryLevel: ps,
3142
- getCategories: () => [...cs]
3206
+ enableLogging: gs,
3207
+ disableLogging: bs,
3208
+ setLogLevel: fs,
3209
+ setCategoryLevel: vs,
3210
+ getCategories: () => [...us]
3143
3211
  },
3144
3212
  register: () => {
3145
- typeof customElements < "u" && !customElements.get("web-multiselect") && customElements.define("web-multiselect", nt);
3213
+ typeof customElements < "u" && !customElements.get("web-multiselect") && customElements.define("web-multiselect", Ae);
3146
3214
  },
3147
- getInstances: () => rt()
3215
+ getInstances: () => lt()
3148
3216
  });
3149
3217
  export {
3150
- cs as LOGGING_CATEGORIES,
3151
- nt as MultiSelectElement,
3152
- us as WebMultiSelect,
3153
- S as dataLogger,
3154
- hs as disableLogging,
3155
- ds as enableLogging,
3156
- le as initLogger,
3157
- T as interactionLogger,
3158
- ps as setCategoryLevel,
3159
- ms as setLogLevel,
3160
- v as uiLogger
3218
+ us as LOGGING_CATEGORIES,
3219
+ Ae as MultiSelectElement,
3220
+ _s as WebMultiSelect,
3221
+ x as dataLogger,
3222
+ bs as disableLogging,
3223
+ gs as enableLogging,
3224
+ oe as initLogger,
3225
+ S as interactionLogger,
3226
+ vs as setCategoryLevel,
3227
+ fs as setLogLevel,
3228
+ M as uiLogger
3161
3229
  };