@florid-kit/components 3.1.3 → 3.1.5

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,31 +1,31 @@
1
- import { E as p, i as C, a as x, m as S, x as h, t as B } from "../performance-mixin-D7YmSeqN.mjs";
2
- import { n as r } from "../property-S_Y9cb04.mjs";
3
- import { f as w } from "../css-C8WrrxT-.mjs";
1
+ import { E as p, i as k, a as g, m as C, x as h, t as S } from "../performance-mixin-D7YmSeqN.mjs";
2
+ import { n as s } from "../property-S_Y9cb04.mjs";
3
+ import { f as m } from "../css-C8WrrxT-.mjs";
4
4
  import { i as E, m as P } from "../element-internals-Dw7LndlH.mjs";
5
- import { e as $, o as _, a as I } from "../icons-registry.mjs";
6
- import { g as z } from "../svg-utils-DOL__czZ.mjs";
5
+ import { e as x, o as A, a as _ } from "../icons-registry.mjs";
6
+ import { g as I } from "../svg-utils-DOL__czZ.mjs";
7
7
  import { o as F } from "../unsafe-svg-BipL_msF.mjs";
8
8
  import "./icon-button.mjs";
9
- import { i as O, t as L, e as R } from "../directive-oAbCiebi.mjs";
10
- import { f as q } from "../directive-helpers-BHuwIghp.mjs";
9
+ import { i as z, t as L, e as O } from "../directive-oAbCiebi.mjs";
10
+ import { f as R } from "../directive-helpers-BHuwIghp.mjs";
11
11
  /**
12
12
  * @license
13
13
  * Copyright 2023 Google LLC
14
14
  * SPDX-License-Identifier: Apache-2.0
15
15
  */
16
- function T(e) {
17
- e.addInitializer((t) => {
18
- const o = t;
16
+ function T(t) {
17
+ t.addInitializer((e) => {
18
+ const o = e;
19
19
  o.addEventListener("click", async (i) => {
20
- const { type: n, [E]: s } = o, { form: a } = s;
21
- if (!(!a || n === "button") && (await new Promise((b) => {
20
+ const { type: n, [E]: r } = o, { form: l } = r;
21
+ if (!(!l || n === "button") && (await new Promise((b) => {
22
22
  setTimeout(b);
23
23
  }), !i.defaultPrevented)) {
24
24
  if (n === "reset") {
25
- a.reset();
25
+ l.reset();
26
26
  return;
27
27
  }
28
- a.addEventListener(
28
+ l.addEventListener(
29
29
  "submit",
30
30
  (b) => {
31
31
  Object.defineProperty(b, "submitter", {
@@ -35,7 +35,7 @@ function T(e) {
35
35
  });
36
36
  },
37
37
  { capture: !0, once: !0 }
38
- ), s.setFormValue(o.value), a.requestSubmit();
38
+ ), r.setFormValue(o.value), l.requestSubmit();
39
39
  }
40
40
  });
41
41
  });
@@ -45,54 +45,54 @@ function T(e) {
45
45
  * Copyright 2017 Google LLC
46
46
  * SPDX-License-Identifier: BSD-3-Clause
47
47
  */
48
- const y = (e, t) => {
48
+ const v = (t, e) => {
49
49
  var i;
50
- const o = e._$AN;
50
+ const o = t._$AN;
51
51
  if (o === void 0) return !1;
52
- for (const n of o) (i = n._$AO) == null || i.call(n, t, !1), y(n, t);
52
+ for (const n of o) (i = n._$AO) == null || i.call(n, e, !1), v(n, e);
53
53
  return !0;
54
- }, m = (e) => {
55
- let t, o;
54
+ }, y = (t) => {
55
+ let e, o;
56
56
  do {
57
- if ((t = e._$AM) === void 0) break;
58
- o = t._$AN, o.delete(e), e = t;
57
+ if ((e = t._$AM) === void 0) break;
58
+ o = e._$AN, o.delete(t), t = e;
59
59
  } while ((o == null ? void 0 : o.size) === 0);
60
- }, D = (e) => {
61
- for (let t; t = e._$AM; e = t) {
62
- let o = t._$AN;
63
- if (o === void 0) t._$AN = o = /* @__PURE__ */ new Set();
64
- else if (o.has(e)) break;
65
- o.add(e), j(t);
60
+ }, B = (t) => {
61
+ for (let e; e = t._$AM; t = e) {
62
+ let o = e._$AN;
63
+ if (o === void 0) e._$AN = o = /* @__PURE__ */ new Set();
64
+ else if (o.has(t)) break;
65
+ o.add(t), M(e);
66
66
  }
67
67
  };
68
- function H(e) {
69
- this._$AN !== void 0 ? (m(this), this._$AM = e, D(this)) : this._$AM = e;
68
+ function q(t) {
69
+ this._$AN !== void 0 ? (y(this), this._$AM = t, B(this)) : this._$AM = t;
70
70
  }
71
- function M(e, t = !1, o = 0) {
71
+ function H(t, e = !1, o = 0) {
72
72
  const i = this._$AH, n = this._$AN;
73
- if (n !== void 0 && n.size !== 0) if (t) if (Array.isArray(i)) for (let s = o; s < i.length; s++) y(i[s], !1), m(i[s]);
74
- else i != null && (y(i, !1), m(i));
75
- else y(this, e);
73
+ if (n !== void 0 && n.size !== 0) if (e) if (Array.isArray(i)) for (let r = o; r < i.length; r++) v(i[r], !1), y(i[r]);
74
+ else i != null && (v(i, !1), y(i));
75
+ else v(this, t);
76
76
  }
77
- const j = (e) => {
78
- e.type == L.CHILD && (e._$AP ?? (e._$AP = M), e._$AQ ?? (e._$AQ = H));
77
+ const M = (t) => {
78
+ t.type == L.CHILD && (t._$AP ?? (t._$AP = H), t._$AQ ?? (t._$AQ = q));
79
79
  };
80
- class K extends O {
80
+ class K extends z {
81
81
  constructor() {
82
82
  super(...arguments), this._$AN = void 0;
83
83
  }
84
- _$AT(t, o, i) {
85
- super._$AT(t, o, i), D(this), this.isConnected = t._$AU;
84
+ _$AT(e, o, i) {
85
+ super._$AT(e, o, i), B(this), this.isConnected = e._$AU;
86
86
  }
87
- _$AO(t, o = !0) {
87
+ _$AO(e, o = !0) {
88
88
  var i, n;
89
- t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (n = this.disconnected) == null || n.call(this)), o && (y(this, t), m(this));
89
+ e !== this.isConnected && (this.isConnected = e, e ? (i = this.reconnected) == null || i.call(this) : (n = this.disconnected) == null || n.call(this)), o && (v(this, e), y(this));
90
90
  }
91
- setValue(t) {
92
- if (q(this._$Ct)) this._$Ct._$AI(t, this);
91
+ setValue(e) {
92
+ if (R(this._$Ct)) this._$Ct._$AI(e, this);
93
93
  else {
94
94
  const o = [...this._$Ct._$AH];
95
- o[this._$Ci] = t, this._$Ct._$AI(o, this, 0);
95
+ o[this._$Ci] = e, this._$Ct._$AI(o, this, 0);
96
96
  }
97
97
  }
98
98
  disconnected() {
@@ -100,118 +100,118 @@ class K extends O {
100
100
  reconnected() {
101
101
  }
102
102
  }
103
- class N extends K {
103
+ class j extends K {
104
104
  constructor() {
105
105
  super(...arguments), this.prevData = {};
106
106
  }
107
- render(t) {
107
+ render(e) {
108
108
  return p;
109
109
  }
110
- update(t, [o]) {
110
+ update(e, [o]) {
111
111
  var i;
112
- this.element !== t.element && (this.element = t.element), this.host = ((i = t.options) === null || i === void 0 ? void 0 : i.host) || this.element, this.apply(o), this.groom(o), this.prevData = { ...o };
112
+ this.element !== e.element && (this.element = e.element), this.host = ((i = e.options) === null || i === void 0 ? void 0 : i.host) || this.element, this.apply(o), this.groom(o), this.prevData = { ...o };
113
113
  }
114
- apply(t) {
115
- if (!t)
114
+ apply(e) {
115
+ if (!e)
116
116
  return;
117
117
  const { prevData: o, element: i } = this;
118
- for (const n in t) {
119
- const s = t[n];
120
- s !== o[n] && (i[n] = s);
118
+ for (const n in e) {
119
+ const r = e[n];
120
+ r !== o[n] && (i[n] = r);
121
121
  }
122
122
  }
123
- groom(t) {
123
+ groom(e) {
124
124
  const { prevData: o, element: i } = this;
125
125
  if (o)
126
126
  for (const n in o)
127
- (!t || !(n in t) && i[n] === o[n]) && (i[n] = void 0);
127
+ (!e || !(n in e) && i[n] === o[n]) && (i[n] = void 0);
128
128
  }
129
129
  }
130
- class V extends N {
130
+ class N extends j {
131
131
  constructor() {
132
132
  super(...arguments), this.eventData = {};
133
133
  }
134
- apply(t) {
135
- if (t)
136
- for (const o in t) {
137
- const i = t[o];
134
+ apply(e) {
135
+ if (e)
136
+ for (const o in e) {
137
+ const i = e[o];
138
138
  i !== this.eventData[o] && this.applyEvent(o, i);
139
139
  }
140
140
  }
141
- applyEvent(t, o) {
141
+ applyEvent(e, o) {
142
142
  const { prevData: i, element: n } = this;
143
- this.eventData[t] = o, i[t] && n.removeEventListener(t, this, o), n.addEventListener(t, this, o);
143
+ this.eventData[e] = o, i[e] && n.removeEventListener(e, this, o), n.addEventListener(e, this, o);
144
144
  }
145
- groom(t) {
145
+ groom(e) {
146
146
  const { prevData: o, element: i } = this;
147
147
  if (o)
148
148
  for (const n in o)
149
- (!t || !(n in t) && i[n] === o[n]) && this.groomEvent(n, o[n]);
149
+ (!e || !(n in e) && i[n] === o[n]) && this.groomEvent(n, o[n]);
150
150
  }
151
- groomEvent(t, o) {
151
+ groomEvent(e, o) {
152
152
  const { element: i } = this;
153
- delete this.eventData[t], i.removeEventListener(t, this, o);
153
+ delete this.eventData[e], i.removeEventListener(e, this, o);
154
154
  }
155
- handleEvent(t) {
156
- const o = this.eventData[t.type];
157
- typeof o == "function" ? o.call(this.host, t) : o.handleEvent(t);
155
+ handleEvent(e) {
156
+ const o = this.eventData[e.type];
157
+ typeof o == "function" ? o.call(this.host, e) : o.handleEvent(e);
158
158
  }
159
159
  disconnected() {
160
- const { eventData: t, element: o } = this;
161
- for (const i in t) {
162
- const n = i.slice(1), s = t[i];
163
- o.removeEventListener(n, this, s);
160
+ const { eventData: e, element: o } = this;
161
+ for (const i in e) {
162
+ const n = i.slice(1), r = e[i];
163
+ o.removeEventListener(n, this, r);
164
164
  }
165
165
  }
166
166
  reconnected() {
167
- const { eventData: t, element: o } = this;
168
- for (const i in t) {
169
- const n = i.slice(1), s = t[i];
170
- o.addEventListener(n, this, s);
167
+ const { eventData: e, element: o } = this;
168
+ for (const i in e) {
169
+ const n = i.slice(1), r = e[i];
170
+ o.addEventListener(n, this, r);
171
171
  }
172
172
  }
173
173
  }
174
- class X extends V {
175
- apply(t) {
176
- if (!t)
174
+ class V extends N {
175
+ apply(e) {
176
+ if (!e)
177
177
  return;
178
178
  const { prevData: o, element: i } = this;
179
- for (const n in t) {
180
- const s = t[n];
181
- if (s === o[n])
179
+ for (const n in e) {
180
+ const r = e[n];
181
+ if (r === o[n])
182
182
  continue;
183
- const a = n.slice(1);
183
+ const l = n.slice(1);
184
184
  switch (n[0]) {
185
185
  case "@":
186
- this.eventData[a] = s, this.applyEvent(a, s);
186
+ this.eventData[l] = r, this.applyEvent(l, r);
187
187
  break;
188
188
  case ".":
189
- i[a] = s;
189
+ i[l] = r;
190
190
  break;
191
191
  case "?":
192
- s ? i.setAttribute(a, "") : i.removeAttribute(a);
192
+ r ? i.setAttribute(l, "") : i.removeAttribute(l);
193
193
  break;
194
194
  default:
195
- s != null ? i.setAttribute(n, String(s)) : i.removeAttribute(n);
195
+ r != null ? i.setAttribute(n, String(r)) : i.removeAttribute(n);
196
196
  break;
197
197
  }
198
198
  }
199
199
  }
200
- groom(t) {
200
+ groom(e) {
201
201
  const { prevData: o, element: i } = this;
202
202
  if (o)
203
203
  for (const n in o) {
204
- const s = n.slice(1);
205
- if (!t || !(n in t) && i[s] === o[n])
204
+ const r = n.slice(1);
205
+ if (!e || !(n in e) && i[r] === o[n])
206
206
  switch (n[0]) {
207
207
  case "@":
208
- this.groomEvent(s, o[n]);
208
+ this.groomEvent(r, o[n]);
209
209
  break;
210
210
  case ".":
211
- i[s] = void 0;
211
+ i[r] = void 0;
212
212
  break;
213
213
  case "?":
214
- i.removeAttribute(s);
214
+ i.removeAttribute(r);
215
215
  break;
216
216
  default:
217
217
  i.removeAttribute(n);
@@ -220,29 +220,29 @@ class X extends V {
220
220
  }
221
221
  }
222
222
  }
223
- const k = R(X);
224
- var U = Object.defineProperty, W = Object.getOwnPropertyDescriptor, c = (e, t, o, i) => {
225
- for (var n = i > 1 ? void 0 : i ? W(t, o) : t, s = e.length - 1, a; s >= 0; s--)
226
- (a = e[s]) && (n = (i ? a(t, o, n) : a(n)) || n);
227
- return i && n && U(t, o, n), n;
223
+ const $ = O(V);
224
+ var X = Object.defineProperty, U = Object.getOwnPropertyDescriptor, c = (t, e, o, i) => {
225
+ for (var n = i > 1 ? void 0 : i ? U(e, o) : e, r = t.length - 1, l; r >= 0; r--)
226
+ (l = t[r]) && (n = (i ? l(e, o, n) : l(n)) || n);
227
+ return i && n && X(e, o, n), n;
228
228
  };
229
- let l = class extends S(x) {
229
+ let a = class extends C(g) {
230
230
  constructor() {
231
- super(...arguments), this.open = !1, this.showHeader = !0, this.showFooter = !1, this.showHeaderStartIcon = !1, this.headerTitle = "", this.headerTitleClassName = "panel-title", this.labelDialog = "", this.labelAriaDialogPanel = "", this.addToBagProductCount = "", this.closeButtonLabel = "Close the modal", this.goBackButtonLabel = "Go back to", this.firstButtonLabel = "Close", this.firstButtonVariant = "primary", this.firstButtonProps = {}, this.onFirstButtonClickClose = !1, this.secondButtonLabel = "", this.secondButtonVariant = "secondary", this.secondButtonProps = {}, this.onSecondButtonClickClose = !1, this.stickyFooter = !1, this.disablePortal = !1, this.zIndex = 99, this.initialized = !1, this.showDetail = !1, this.isHidingDetail = !1, this.previousFocusedElement = null, this.previousFocusedSelector = null, this._hideTimeout = null, this._onOpenDetail = async (e) => {
231
+ super(...arguments), this.open = !1, this.showHeader = !0, this.showFooter = !1, this.showHeaderStartIcon = !1, this.headerTitle = "", this.headerTitleClassName = "panel-title", this.labelDialog = "", this.labelAriaDialogPanel = "", this.addToBagProductCount = "", this.closeButtonLabel = "Close the modal", this.goBackButtonLabel = "Go back to", this.firstButtonLabel = "Close", this.firstButtonVariant = "primary", this.firstButtonProps = {}, this.onFirstButtonClickClose = !1, this.secondButtonLabel = "", this.secondButtonVariant = "secondary", this.secondButtonProps = {}, this.onSecondButtonClickClose = !1, this.stickyFooter = !1, this.disablePortal = !1, this.zIndex = 99, this.initialized = !1, this.showDetail = !1, this.isHidingDetail = !1, this.previousFocusedElement = null, this.previousFocusedSelector = null, this._hideTimeout = null, this._onOpenDetail = async (t) => {
232
232
  var o, i;
233
- const t = ((o = e.detail) == null ? void 0 : o.origin) ?? document.activeElement;
234
- if (this._detailOriginEl = t, this._detailOriginClass = (t == null ? void 0 : t.className) ?? "", this.showDetail = !0, this.showHeaderStartIcon = !0, await this.updateComplete, this._detailOriginClass) {
233
+ const e = ((o = t.detail) == null ? void 0 : o.origin) ?? document.activeElement;
234
+ if (this._detailOriginEl = e, this._detailOriginClass = (e == null ? void 0 : e.className) ?? "", this.showDetail = !0, this.showHeaderStartIcon = !0, await this.updateComplete, this._detailOriginClass) {
235
235
  const n = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".detail-view");
236
236
  n && n.setAttribute("fromelement", this._detailOriginClass);
237
237
  }
238
238
  await this.focusDetailReturnBtn();
239
- }, this._detailOriginEl = null, this._detailOriginClass = "", this.handleKeyDown = (e) => {
240
- this.open && (e.key === "Escape" ? this.closePanel() : e.key === "Tab" && this.trapFocus(e));
241
- }, this.handleClosePanel = (e) => {
242
- if (e instanceof KeyboardEvent && e.key !== "Enter" && e.key !== " ")
239
+ }, this._detailOriginEl = null, this._detailOriginClass = "", this.handleKeyDown = (t) => {
240
+ this.open && (t.key === "Escape" ? this.closePanel() : t.key === "Tab" && this.trapFocus(t));
241
+ }, this.handleClosePanel = (t) => {
242
+ if (t instanceof KeyboardEvent && t.key !== "Enter" && t.key !== " ")
243
243
  return;
244
- e.preventDefault(), e.stopPropagation();
245
- const t = e.currentTarget, o = (t == null ? void 0 : t.getAttribute("data-role")) === "back";
244
+ t.preventDefault(), t.stopPropagation();
245
+ const e = t.currentTarget, o = (e == null ? void 0 : e.getAttribute("data-role")) === "back";
246
246
  if (this.showDetail && o) {
247
247
  this.isHidingDetail = !0;
248
248
  const i = this.renderRoot.querySelector(".content"), n = async () => {
@@ -250,10 +250,10 @@ let l = class extends S(x) {
250
250
  };
251
251
  if (i) {
252
252
  this.showHeaderStartIcon = !1;
253
- const s = () => {
254
- this.showDetail = !1, this.isHidingDetail = !1, i.removeEventListener("animationend", s), n();
253
+ const r = () => {
254
+ this.showDetail = !1, this.isHidingDetail = !1, i.removeEventListener("animationend", r), n();
255
255
  };
256
- i.addEventListener("animationend", s);
256
+ i.addEventListener("animationend", r);
257
257
  } else
258
258
  this.showDetail = !1, this.isHidingDetail = !1, this.showHeaderStartIcon = !1;
259
259
  return;
@@ -262,121 +262,131 @@ let l = class extends S(x) {
262
262
  };
263
263
  }
264
264
  focusFirstInPanel() {
265
- var t, o, i;
266
- (i = this.getFocusableElements().map((n) => this.resolveFocusable(n)).filter((n) => !!n && !n.hasAttribute("disabled"))[0] ?? ((t = this.shadowRoot) == null ? void 0 : t.querySelector(".close-btn")) ?? ((o = this.shadowRoot) == null ? void 0 : o.querySelector(".panel"))) == null || i.focus({ preventScroll: !0 });
265
+ var e, o, i;
266
+ (i = this.getFocusableElements().filter((n) => !!n && !n.hasAttribute("disabled"))[0] ?? ((e = this.shadowRoot) == null ? void 0 : e.querySelector(".close-btn")) ?? ((o = this.shadowRoot) == null ? void 0 : o.querySelector(".panel"))) == null || i.focus({ preventScroll: !0 });
267
267
  }
268
- resolveFocusable(e) {
268
+ resolveFocusable(t) {
269
269
  var o;
270
- const t = e.tagName.toLowerCase();
271
- return t === "o-icon-button" || t === "o-button" ? ((o = e.shadowRoot) == null ? void 0 : o.querySelector("button, .button")) ?? e : e;
270
+ const e = t.tagName.toLowerCase();
271
+ return e === "o-icon-button" || e === "o-button" ? ((o = t.shadowRoot) == null ? void 0 : o.querySelector("button, .button")) ?? t : t;
272
272
  }
273
273
  connectedCallback() {
274
274
  super.connectedCallback(), !this.disablePortal && this.parentElement !== document.body && document.body.appendChild(this), this.addEventListener("keydown", this.handleKeyDown), this.updateComplete.then(() => {
275
275
  this.initialized = !0;
276
- }), this.addEventListener("open-detail", this._onOpenDetail), this.addEventListener("focusin", (e) => {
277
- e.composedPath()[0] === this && this.focusFirstInPanel();
276
+ }), this.addEventListener("open-detail", this._onOpenDetail), this.addEventListener("focusin", (t) => {
277
+ t.composedPath()[0] === this && this.focusFirstInPanel();
278
278
  });
279
279
  }
280
280
  disconnectedCallback() {
281
281
  document.body.style.overflow = "", document.body.removeAttribute("data-side-panel"), this.removeEventListener("keydown", this.handleKeyDown), super.disconnectedCallback(), this.removeEventListener("open-detail", this._onOpenDetail);
282
282
  }
283
283
  async focusDetailReturnBtn() {
284
- var n, s, a, b, f;
284
+ var n, r, l, b, f;
285
285
  await this.updateComplete;
286
- const e = this.getDeepActiveElement(document);
287
- if (e && e !== document.body)
286
+ const t = this.getDeepActiveElement(document);
287
+ if (t && t !== document.body)
288
288
  try {
289
- e.blur();
289
+ t.blur();
290
290
  } catch {
291
291
  }
292
292
  await new Promise(requestAnimationFrame);
293
- const t = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".detail-view .return-btn");
294
- if (!t) return;
295
- t.updateComplete && await t.updateComplete, (b = (a = ((s = t.shadowRoot) == null ? void 0 : s.querySelector("button")) ?? t) == null ? void 0 : a.focus) == null || b.call(a, { preventScroll: !0 });
293
+ const e = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".detail-view .return-btn");
294
+ if (!e) return;
295
+ e.updateComplete && await e.updateComplete, (b = (l = ((r = e.shadowRoot) == null ? void 0 : r.querySelector("button")) ?? e) == null ? void 0 : l.focus) == null || b.call(l, { preventScroll: !0 });
296
296
  const i = (f = this.shadowRoot) == null ? void 0 : f.querySelector('.panel[role="dialog"]');
297
297
  i && i.setAttribute("aria-label", this.labelAriaDialogPanel || "panel-title");
298
298
  }
299
299
  _restoreFocusToOrigin() {
300
- var t, o;
301
- const e = this._detailOriginEl;
302
- !e || !document.contains(e) || ((o = (t = document.activeElement) == null ? void 0 : t.blur) == null || o.call(t), requestAnimationFrame(() => {
300
+ var e, o;
301
+ const t = this._detailOriginEl;
302
+ !t || !document.contains(t) || ((o = (e = document.activeElement) == null ? void 0 : e.blur) == null || o.call(e), requestAnimationFrame(() => {
303
303
  var n;
304
- e.classList.add("a--tabfocus"), (((n = e.shadowRoot) == null ? void 0 : n.querySelector('button, .button, [tabindex]:not([tabindex="-1"])')) ?? null ?? e).focus({ preventScroll: !0 });
304
+ t.classList.add("a--tabfocus"), (((n = t.shadowRoot) == null ? void 0 : n.querySelector('button, .button, [tabindex]:not([tabindex="-1"])')) ?? null ?? t).focus({ preventScroll: !0 });
305
305
  }));
306
306
  }
307
- getDeepActiveElement(e = this.shadowRoot) {
308
- let t = e.activeElement;
309
- for (; t && t.shadowRoot && t.shadowRoot.activeElement; )
310
- t = t.shadowRoot.activeElement;
311
- return t;
307
+ getDeepActiveElement(t = this.shadowRoot) {
308
+ let e = t.activeElement;
309
+ for (; e && e.shadowRoot && e.shadowRoot.activeElement; )
310
+ e = e.shadowRoot.activeElement;
311
+ return e;
312
312
  }
313
- trapFocus(e) {
314
- var s;
315
- if (e.key !== "Tab") return;
316
- const t = this.shadowRoot;
317
- if (!t) return;
318
- const o = this.getDeepActiveElement();
313
+ wrapFocus(t, e, o) {
314
+ var r;
315
+ if (!o.length) {
316
+ t.preventDefault(), t.stopPropagation(), (r = this.renderRoot.querySelector(".panel")) == null || r.focus({ preventScroll: !0 });
317
+ return;
318
+ }
319
+ const i = o[0], n = o[o.length - 1];
320
+ !e || !o.includes(e) ? (t.preventDefault(), t.stopPropagation(), (t.shiftKey ? n : i).focus({ preventScroll: !0 })) : !t.shiftKey && e === n ? (t.preventDefault(), t.stopPropagation(), i.focus({ preventScroll: !0 })) : t.shiftKey && e === i && (t.preventDefault(), t.stopPropagation(), n.focus({ preventScroll: !0 }));
321
+ }
322
+ trapFocus(t) {
323
+ if (t.key !== "Tab") return;
324
+ const e = this.shadowRoot;
325
+ if (!e) return;
326
+ const o = t.composedPath()[0] ?? this.getDeepActiveElement(document);
319
327
  if (this.showDetail) {
320
- const a = t.querySelector(".detail-view .return-btn"), b = t.querySelector(".detail-view .close-btn"), f = a ? this.resolveFocusable(a) : null, v = b ? this.resolveFocusable(b) : null;
321
- if (e.shiftKey && f && o === f && v) {
322
- e.preventDefault(), e.stopPropagation(), v.focus({ preventScroll: !0 });
323
- return;
324
- }
325
- if (!e.shiftKey && v && o === v) {
326
- e.preventDefault(), e.stopPropagation(), (((s = t.querySelector(".detail-scroller")) == null ? void 0 : s.querySelector(
327
- l.focusablesSelector
328
- )) ?? f ?? v).focus({ preventScroll: !0 });
329
- return;
330
- }
328
+ this.wrapFocus(t, o, this.getFocusableElements());
329
+ return;
331
330
  }
332
331
  if (document.querySelector("#refineandsortpopin")) {
333
- const a = t.querySelector(".close-btn"), b = a ? this.resolveFocusable(a) : null, f = t.querySelector(".js-clear-refinements"), v = f ? this.resolveFocusable(f) : null, g = (A) => {
334
- e.preventDefault(), e.stopPropagation(), A.focus();
332
+ const r = e.querySelector(".close-btn"), l = r ? this.resolveFocusable(r) : null, b = e.querySelector(".js-clear-refinements"), f = b ? this.resolveFocusable(b) : null, w = (D) => {
333
+ t.preventDefault(), t.stopPropagation(), D.focus();
335
334
  };
336
- if (b && v) {
337
- if (!e.shiftKey && o === v) return g(b);
338
- if (e.shiftKey && o === b) return g(v);
335
+ if (l && f) {
336
+ if (!t.shiftKey && o === f) return w(l);
337
+ if (t.shiftKey && o === l) return w(f);
339
338
  }
340
339
  }
341
340
  const n = this.renderRoot.querySelector(".close-btn");
342
- if (!e.shiftKey && n && n.contains(o)) {
343
- e.preventDefault();
344
- const a = this.renderRoot.querySelector(
341
+ if (!t.shiftKey && n && n.contains(o)) {
342
+ t.preventDefault();
343
+ const r = this.renderRoot.querySelector(
345
344
  ".o-whats-inside--content p"
346
345
  );
347
- a == null || a.focus();
346
+ if (r) {
347
+ r.focus();
348
+ return;
349
+ }
348
350
  }
351
+ this.wrapFocus(t, o, this.getFocusableElements());
352
+ }
353
+ isUnavailableElement(t) {
354
+ if (!(t instanceof HTMLElement)) return !1;
355
+ if (t.disabled || t.hasAttribute("disabled") || t.getAttribute("tabindex") === "-1" || t.closest("[hidden], [inert], [aria-hidden='true']")) return !0;
356
+ const e = t.ownerDocument.defaultView, o = e == null ? void 0 : e.getComputedStyle(t);
357
+ return (o == null ? void 0 : o.display) === "none" || (o == null ? void 0 : o.visibility) === "hidden" || (o == null ? void 0 : o.visibility) === "collapse";
349
358
  }
350
359
  getFocusableElements() {
351
- const e = this.renderRoot.querySelector(".panel");
352
- if (!e) return [];
353
- function t(n) {
354
- return !(n.disabled || n.hasAttribute("disabled") || n.hasAttribute("tabindex") && n.getAttribute("tabindex") === "-1");
355
- }
356
- function o(n) {
357
- var a;
358
- const s = [n.matches(l.focusablesSelector) ? n : []];
359
- if (!["o-icon-button", "o-button"].includes(n.tagName.toLowerCase())) {
360
- const b = Array.from(
361
- n instanceof HTMLSlotElement ? n.assignedElements({ flatten: !0 }) : []
362
- ).filter(t).flatMap(o), f = Array.from(
363
- ((a = n.shadowRoot) == null ? void 0 : a.querySelectorAll("*")) || []
364
- ).filter(t).flatMap(o);
365
- s.push(...b, ...f);
360
+ const t = this.showDetail ? this.renderRoot.querySelector(".detail-view") : this.renderRoot.querySelector(".panel");
361
+ if (!t) return [];
362
+ const e = (r) => this.isUnavailableElement(r) ? !1 : r.matches(a.focusablesSelector), o = [], i = /* @__PURE__ */ new Set(), n = (r) => {
363
+ if (i.has(r) || (i.add(r), r instanceof HTMLElement && r.closest("[hidden], [inert], [aria-hidden='true']"))) return;
364
+ if (e(r)) {
365
+ const f = this.resolveFocusable(r);
366
+ f && !this.isUnavailableElement(f) && o.push(f);
366
367
  }
367
- return s.flat();
368
- }
369
- return Array.from(e.querySelectorAll("*")).filter(t).flatMap(o);
368
+ const l = r.tagName.toLowerCase();
369
+ if (l === "o-icon-button" || l === "o-button") return;
370
+ if (r instanceof HTMLSlotElement) {
371
+ r.assignedElements({ flatten: !0 }).forEach(n);
372
+ return;
373
+ }
374
+ const b = r.shadowRoot;
375
+ b && Array.from(b.children).forEach(n), Array.from(r.children).forEach(n);
376
+ };
377
+ return n(t), o;
370
378
  }
371
379
  openPanel() {
372
- var t;
373
- this.removeAttribute("hidden"), this.getBoundingClientRect(), this.previousFocusedElement = document.activeElement, this.previousFocusedSelector = (t = this.previousFocusedElement) == null ? void 0 : t.getAttribute("paneltarget"), this.open = !0, document.body.style.overflow = "hidden", document.body.setAttribute("data-side-panel", "open");
374
- const e = this.renderRoot.querySelector(".panel");
375
- e && e.setAttribute("aria-modal", "true"), this.updateComplete.then(() => {
380
+ var e;
381
+ this.removeAttribute("hidden"), this.getBoundingClientRect(), this.previousFocusedElement = document.activeElement, this.previousFocusedSelector = (e = this.previousFocusedElement) == null ? void 0 : e.getAttribute("paneltarget"), this.open = !0, document.body.style.overflow = "hidden", document.body.setAttribute("data-side-panel", "open");
382
+ const t = this.renderRoot.querySelector(".panel");
383
+ t && t.setAttribute("aria-modal", "true"), this.updateComplete.then(async () => {
376
384
  var o, i;
377
385
  if (this.showHeader) {
378
- const n = (o = this.shadowRoot) == null ? void 0 : o.querySelector(".panel .close-btn"), s = this.resolveFocusable(n);
379
- (i = s == null ? void 0 : s.focus) == null || i.call(s, { preventScroll: !0 });
386
+ const n = (o = this.shadowRoot) == null ? void 0 : o.querySelector(".panel .close-btn");
387
+ n != null && n.updateComplete && await n.updateComplete;
388
+ const r = this.resolveFocusable(n);
389
+ (i = r == null ? void 0 : r.focus) == null || i.call(r, { preventScroll: !0 });
380
390
  } else
381
391
  this.focusFirstInPanel();
382
392
  }), this.dispatchEvent(
@@ -386,35 +396,35 @@ let l = class extends S(x) {
386
396
  closePanel() {
387
397
  var o, i, n;
388
398
  this.open = !1, this.showDetail = !1, document.body.style.overflow = "", document.body.removeAttribute("data-side-panel");
389
- let e = this.previousFocusedElement;
390
- e != null && e.isConnected || (e = document.querySelector(`[paneltarget="${this.previousFocusedSelector}"]`)), (e == null ? void 0 : e.tagName.toLowerCase()) === "o-button" ? (n = (i = (o = e.shadowRoot) == null ? void 0 : o.querySelector(".button")) == null ? void 0 : i.focus) == null || n.call(i) : e == null || e.focus();
391
- const t = this.renderRoot.querySelector(".panel");
392
- t && t.removeAttribute("aria-modal"), this.dispatchEvent(
399
+ let t = this.previousFocusedElement;
400
+ t != null && t.isConnected || (t = document.querySelector(`[paneltarget="${this.previousFocusedSelector}"]`)), (t == null ? void 0 : t.tagName.toLowerCase()) === "o-button" ? (n = (i = (o = t.shadowRoot) == null ? void 0 : o.querySelector(".button")) == null ? void 0 : i.focus) == null || n.call(i) : t == null || t.focus();
401
+ const e = this.renderRoot.querySelector(".panel");
402
+ e && e.removeAttribute("aria-modal"), this.dispatchEvent(
393
403
  new CustomEvent("close", { bubbles: !0, composed: !0 })
394
404
  );
395
405
  }
396
- handleFirstClick(e) {
397
- e instanceof KeyboardEvent && e.key !== "Enter" && e.key !== " " || (e.preventDefault(), e.stopPropagation(), this.onFirstButtonClickClose && this.closePanel(), this.dispatchEvent(
406
+ handleFirstClick(t) {
407
+ t instanceof KeyboardEvent && t.key !== "Enter" && t.key !== " " || (t.preventDefault(), t.stopPropagation(), this.onFirstButtonClickClose && this.closePanel(), this.dispatchEvent(
398
408
  new CustomEvent("firstbuttonclick", {
399
409
  bubbles: !0,
400
410
  composed: !0,
401
411
  cancelable: !0,
402
412
  detail: {
403
413
  button: "first",
404
- target: e.target
414
+ target: t.target
405
415
  }
406
416
  })
407
417
  ));
408
418
  }
409
- handleSecondClick(e) {
410
- e instanceof KeyboardEvent && e.key !== "Enter" && e.key !== " " || (e.preventDefault(), e.stopPropagation(), this.onSecondButtonClickClose && this.closePanel(), this.dispatchEvent(
419
+ handleSecondClick(t) {
420
+ t instanceof KeyboardEvent && t.key !== "Enter" && t.key !== " " || (t.preventDefault(), t.stopPropagation(), this.onSecondButtonClickClose && this.closePanel(), this.dispatchEvent(
411
421
  new CustomEvent("secondbuttonclick", {
412
422
  bubbles: !0,
413
423
  composed: !0,
414
424
  cancelable: !0,
415
425
  detail: {
416
426
  button: "second",
417
- target: e.target
427
+ target: t.target
418
428
  }
419
429
  })
420
430
  ));
@@ -425,7 +435,7 @@ let l = class extends S(x) {
425
435
  }, 500);
426
436
  }
427
437
  render() {
428
- const e = this.showHeader ? h`
438
+ const t = this.showHeader ? h`
429
439
  <div tabindex="-1" part="header" class="header ${this.showDetail ? "detail-view-header" : ""}">
430
440
  ${this.showHeaderStartIcon ? h`
431
441
  <o-icon-button
@@ -458,14 +468,14 @@ let l = class extends S(x) {
458
468
  aria-describedby="panel-title"
459
469
  ></o-icon-button>
460
470
  </div>
461
- ` : null, t = this.showFooter ? h`
471
+ ` : null, e = this.showFooter ? h`
462
472
  <div class="footer" part="footer">
463
473
  ${this.firstButtonVariant && this.firstButtonLabel ? h`
464
474
  <o-button
465
475
  .variant=${this.firstButtonVariant}
466
476
  @click=${this.handleFirstClick}
467
477
  @keydown=${this.handleFirstClick}
468
- ${k(this.firstButtonProps)}
478
+ ${$(this.firstButtonProps)}
469
479
  >
470
480
  ${this.firstButtonLabel}
471
481
  </o-button>
@@ -475,7 +485,7 @@ let l = class extends S(x) {
475
485
  .variant=${this.secondButtonVariant}
476
486
  @click=${this.handleSecondClick}
477
487
  @keydown=${this.handleSecondClick}
478
- ${k(this.secondButtonProps)}
488
+ ${$(this.secondButtonProps)}
479
489
  >
480
490
  ${this.secondButtonLabel}
481
491
  </o-button>
@@ -493,13 +503,13 @@ let l = class extends S(x) {
493
503
  tabindex="-1"
494
504
  >
495
505
  <div role="document">
496
- ${e}
506
+ ${t}
497
507
 
498
508
  <div part="content" class="content ${this.isHidingDetail ? "slide-out-right" : ""} ${this.showDetail ? "with-detail" : ""}">
499
509
 
500
510
  ${this.showDetail ? h`
501
511
  <div class="detail-view">
502
- ${e}
512
+ ${t}
503
513
  <div class="detail-content">
504
514
  <div class="detail-scroller">
505
515
  <slot name="detail"></slot>
@@ -509,14 +519,14 @@ let l = class extends S(x) {
509
519
  ` : h`<slot></slot>`}
510
520
  </div>
511
521
 
512
- ${this.stickyFooter ? null : t}
522
+ ${this.stickyFooter ? null : e}
513
523
  </div>
514
- ${this.stickyFooter ? t : null}
524
+ ${this.stickyFooter ? e : null}
515
525
  </div>
516
526
  `;
517
527
  }
518
528
  };
519
- l.styles = C`
529
+ a.styles = k`
520
530
  :host {
521
531
  --z-overlay: 99;
522
532
  --z-panel: 100;
@@ -658,7 +668,7 @@ l.styles = C`
658
668
 
659
669
  .panel:focus-visible,
660
670
  .close-btn:focus-visible {
661
- ${w}
671
+ ${m}
662
672
  }
663
673
 
664
674
  [role="document"] {
@@ -759,114 +769,114 @@ l.styles = C`
759
769
  box-sizing: border-box;
760
770
  }
761
771
  `;
762
- l.focusablesSelector = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]), o-icon-button, o-button';
763
- l.focusablesCustomElementsSelector = "o-icon-button, o-button";
764
- l.shadowRootOptions = {
765
- ...x.shadowRootOptions,
772
+ a.focusablesSelector = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]), o-icon-button, o-button';
773
+ a.focusablesCustomElementsSelector = "o-icon-button, o-button";
774
+ a.shadowRootOptions = {
775
+ ...g.shadowRootOptions,
766
776
  // This helps send focus into the first focusable in shadow when host is focused
767
777
  delegatesFocus: !0
768
778
  };
769
779
  c([
770
- r({ type: Boolean, reflect: !0 })
771
- ], l.prototype, "open", 2);
780
+ s({ type: Boolean, reflect: !0 })
781
+ ], a.prototype, "open", 2);
772
782
  c([
773
- r({ type: Boolean })
774
- ], l.prototype, "showHeader", 2);
783
+ s({ type: Boolean })
784
+ ], a.prototype, "showHeader", 2);
775
785
  c([
776
- r({ type: Boolean })
777
- ], l.prototype, "showFooter", 2);
786
+ s({ type: Boolean })
787
+ ], a.prototype, "showFooter", 2);
778
788
  c([
779
- r({ type: Boolean })
780
- ], l.prototype, "showHeaderStartIcon", 2);
789
+ s({ type: Boolean })
790
+ ], a.prototype, "showHeaderStartIcon", 2);
781
791
  c([
782
- r({ type: String })
783
- ], l.prototype, "headerTitle", 2);
792
+ s({ type: String })
793
+ ], a.prototype, "headerTitle", 2);
784
794
  c([
785
- r({ type: String })
786
- ], l.prototype, "headerTitleClassName", 2);
795
+ s({ type: String })
796
+ ], a.prototype, "headerTitleClassName", 2);
787
797
  c([
788
- r({ type: String })
789
- ], l.prototype, "labelDialog", 2);
798
+ s({ type: String })
799
+ ], a.prototype, "labelDialog", 2);
790
800
  c([
791
- r({ type: String })
792
- ], l.prototype, "labelAriaDialogPanel", 2);
801
+ s({ type: String })
802
+ ], a.prototype, "labelAriaDialogPanel", 2);
793
803
  c([
794
- r({ type: String })
795
- ], l.prototype, "addToBagProductCount", 2);
804
+ s({ type: String })
805
+ ], a.prototype, "addToBagProductCount", 2);
796
806
  c([
797
- r({ type: String })
798
- ], l.prototype, "closeButtonLabel", 2);
807
+ s({ type: String })
808
+ ], a.prototype, "closeButtonLabel", 2);
799
809
  c([
800
- r({ type: String })
801
- ], l.prototype, "goBackButtonLabel", 2);
810
+ s({ type: String })
811
+ ], a.prototype, "goBackButtonLabel", 2);
802
812
  c([
803
- r({ type: String })
804
- ], l.prototype, "firstButtonLabel", 2);
813
+ s({ type: String })
814
+ ], a.prototype, "firstButtonLabel", 2);
805
815
  c([
806
- r({ type: String })
807
- ], l.prototype, "firstButtonVariant", 2);
816
+ s({ type: String })
817
+ ], a.prototype, "firstButtonVariant", 2);
808
818
  c([
809
- r({ type: Object })
810
- ], l.prototype, "firstButtonProps", 2);
819
+ s({ type: Object })
820
+ ], a.prototype, "firstButtonProps", 2);
811
821
  c([
812
- r({ type: Boolean })
813
- ], l.prototype, "onFirstButtonClickClose", 2);
822
+ s({ type: Boolean })
823
+ ], a.prototype, "onFirstButtonClickClose", 2);
814
824
  c([
815
- r({ type: String })
816
- ], l.prototype, "secondButtonLabel", 2);
825
+ s({ type: String })
826
+ ], a.prototype, "secondButtonLabel", 2);
817
827
  c([
818
- r({ type: String })
819
- ], l.prototype, "secondButtonVariant", 2);
828
+ s({ type: String })
829
+ ], a.prototype, "secondButtonVariant", 2);
820
830
  c([
821
- r({ type: Object })
822
- ], l.prototype, "secondButtonProps", 2);
831
+ s({ type: Object })
832
+ ], a.prototype, "secondButtonProps", 2);
823
833
  c([
824
- r({ type: Boolean })
825
- ], l.prototype, "onSecondButtonClickClose", 2);
834
+ s({ type: Boolean })
835
+ ], a.prototype, "onSecondButtonClickClose", 2);
826
836
  c([
827
- r({ type: Boolean, reflect: !0 })
828
- ], l.prototype, "stickyFooter", 2);
837
+ s({ type: Boolean, reflect: !0 })
838
+ ], a.prototype, "stickyFooter", 2);
829
839
  c([
830
- r({ type: Boolean })
831
- ], l.prototype, "disablePortal", 2);
840
+ s({ type: Boolean })
841
+ ], a.prototype, "disablePortal", 2);
832
842
  c([
833
- r({ type: Number })
834
- ], l.prototype, "zIndex", 2);
843
+ s({ type: Number })
844
+ ], a.prototype, "zIndex", 2);
835
845
  c([
836
- r({ type: Boolean, reflect: !0 })
837
- ], l.prototype, "initialized", 2);
846
+ s({ type: Boolean, reflect: !0 })
847
+ ], a.prototype, "initialized", 2);
838
848
  c([
839
- r({ type: Boolean })
840
- ], l.prototype, "showDetail", 2);
849
+ s({ type: Boolean })
850
+ ], a.prototype, "showDetail", 2);
841
851
  c([
842
- r({ type: Boolean })
843
- ], l.prototype, "isHidingDetail", 2);
844
- l = c([
845
- B("o-side-panel")
846
- ], l);
847
- var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, u = (e, t, o, i) => {
848
- for (var n = i > 1 ? void 0 : i ? Q(t, o) : t, s = e.length - 1, a; s >= 0; s--)
849
- (a = e[s]) && (n = (i ? a(t, o, n) : a(n)) || n);
850
- return i && n && G(t, o, n), n;
852
+ s({ type: Boolean })
853
+ ], a.prototype, "isHidingDetail", 2);
854
+ a = c([
855
+ S("o-side-panel")
856
+ ], a);
857
+ var W = Object.defineProperty, G = Object.getOwnPropertyDescriptor, u = (t, e, o, i) => {
858
+ for (var n = i > 1 ? void 0 : i ? G(e, o) : e, r = t.length - 1, l; r >= 0; r--)
859
+ (l = t[r]) && (n = (i ? l(e, o, n) : l(n)) || n);
860
+ return i && n && W(e, o, n), n;
851
861
  };
852
- const J = S(P(x)), lt = ["primary", "secondary", "ghost", "tertiary", "link"];
853
- let d = class extends J {
862
+ const Q = C(P(g)), at = ["primary", "secondary", "ghost", "tertiary", "link"];
863
+ let d = class extends Q {
854
864
  constructor() {
855
865
  super(...arguments), this.type = "submit", this.value = "", this.variant = "primary", this.text = "", this.textsecond = "", this.fullwidth = !1, this.disabled = !1, this.startIconModel = "", this.endIconModel = "", this.startIcon = !1, this.endIcon = !1, this.panelTarget = "", this.href = "", this.target = "", this.underlined = !1, this.withbadge = !1, this.hideRoleButton = !1, this.describedBy = null, this.ariaExpanded = null;
856
866
  }
857
867
  get name() {
858
868
  return this.getAttribute("name") ?? "";
859
869
  }
860
- set name(e) {
861
- this.setAttribute("name", e);
870
+ set name(t) {
871
+ this.setAttribute("name", t);
862
872
  }
863
873
  get form() {
864
874
  return this[E].form;
865
875
  }
866
- handleClick(e) {
867
- if (!(e instanceof KeyboardEvent && !["Enter", " "].includes(e.key)) && this.panelTarget) {
868
- const t = document.getElementById(this.panelTarget);
869
- t instanceof l && (t != null && t.openPanel) && typeof t.openPanel == "function" ? (e.preventDefault(), t.openPanel()) : console.warn(`[o-button] No side panel with id="${this.panelTarget}" found or it does not have an openPanel method.`);
876
+ handleClick(t) {
877
+ if (!(t instanceof KeyboardEvent && !["Enter", " "].includes(t.key)) && this.panelTarget) {
878
+ const e = document.getElementById(this.panelTarget);
879
+ e instanceof a && (e != null && e.openPanel) && typeof e.openPanel == "function" ? (t.preventDefault(), e.openPanel()) : console.warn(`[o-button] No side panel with id="${this.panelTarget}" found or it does not have an openPanel method.`);
870
880
  }
871
881
  }
872
882
  render() {
@@ -875,28 +885,28 @@ let d = class extends J {
875
885
  connectedCallback() {
876
886
  var o, i;
877
887
  super.connectedCallback();
878
- const e = (o = this.startIconModel) == null ? void 0 : o.startsWith("occ-"), t = (i = this.endIconModel) == null ? void 0 : i.startsWith("occ-");
879
- (e || t) && (e && $(this.startIconModel), t && $(this.endIconModel), this._unsubOcc = _(() => this.requestUpdate()));
888
+ const t = (o = this.startIconModel) == null ? void 0 : o.startsWith("occ-"), e = (i = this.endIconModel) == null ? void 0 : i.startsWith("occ-");
889
+ (t || e) && (t && x(this.startIconModel), e && x(this.endIconModel), this._unsubOcc = A(() => this.requestUpdate()));
880
890
  }
881
891
  disconnectedCallback() {
882
- var e;
883
- (e = this._unsubOcc) == null || e.call(this), super.disconnectedCallback();
892
+ var t;
893
+ (t = this._unsubOcc) == null || t.call(this), super.disconnectedCallback();
884
894
  }
885
- renderIcon(e) {
886
- const t = e === "start" ? this.startIconModel : this.endIconModel;
887
- if (!t) return p;
888
- const o = I[t] ?? "";
895
+ renderIcon(t) {
896
+ const e = t === "start" ? this.startIconModel : this.endIconModel;
897
+ if (!e) return p;
898
+ const o = _[e] ?? "";
889
899
  if (!o) return p;
890
- const i = z(o);
891
- return h`<span class="${e === "start" ? "icon-start" : "icon-end"}">${F(i)}</span>`;
900
+ const i = I(o);
901
+ return h`<span class="${t === "start" ? "icon-start" : "icon-end"}">${F(i)}</span>`;
892
902
  }
893
903
  renderButton() {
894
- const e = this.text || this.textsecond;
904
+ const t = this.text || this.textsecond;
895
905
  return h`
896
906
  <button type=${this.type} class="button" ?disabled=${this.disabled} @click=${this.handleClick} @keydown=${this.handleClick}
897
907
  aria-describedby=${this.describedBy || p} aria-expanded=${this.ariaExpanded || p} >
898
908
  ${this.startIcon ? this.renderIcon("start") : p}
899
- ${e ? h`
909
+ ${t ? h`
900
910
  ${this.text ? h`<span class="text">${this.text}</span>` : p}
901
911
  ${this.textsecond ? h`<span class="text">${this.textsecond}</span>` : p}
902
912
  ${this.withbadge ? h`<slot></slot>` : p}
@@ -906,7 +916,7 @@ let d = class extends J {
906
916
  `;
907
917
  }
908
918
  renderLink() {
909
- const e = this.text || this.textsecond;
919
+ const t = this.text || this.textsecond;
910
920
  return h`
911
921
  <a
912
922
  href=${this.href}
@@ -919,7 +929,7 @@ let d = class extends J {
919
929
  aria-describedby=${this.describedBy || p}
920
930
  >
921
931
  ${this.startIcon ? this.renderIcon("start") : p}
922
- ${e ? h`
932
+ ${t ? h`
923
933
  ${this.text ? h`<span>${this.text}</span>` : p}
924
934
  ${this.textsecond ? h`<span>${this.textsecond}</span>` : p}
925
935
  ` : h`<slot></slot>`}
@@ -930,7 +940,7 @@ let d = class extends J {
930
940
  };
931
941
  T(d);
932
942
  d.formAssociated = !0;
933
- d.styles = C`
943
+ d.styles = k`
934
944
  :host {
935
945
  --button-border: transparent;
936
946
  --badge-outer-width: 19px;
@@ -943,7 +953,7 @@ d.styles = C`
943
953
  }
944
954
 
945
955
  :host(.a--tabfocus) .button {
946
- ${w};
956
+ ${m};
947
957
  }
948
958
 
949
959
  :host([fullwidth]) {
@@ -1094,7 +1104,7 @@ d.styles = C`
1094
1104
  }
1095
1105
 
1096
1106
  .button:focus-visible {
1097
- ${w};
1107
+ ${m};
1098
1108
  }
1099
1109
 
1100
1110
  span.text + span.text::before {
@@ -1186,67 +1196,67 @@ d.styles = C`
1186
1196
  }
1187
1197
  `;
1188
1198
  u([
1189
- r()
1199
+ s()
1190
1200
  ], d.prototype, "type", 2);
1191
1201
  u([
1192
- r()
1202
+ s()
1193
1203
  ], d.prototype, "value", 2);
1194
1204
  u([
1195
- r({ type: String, reflect: !0 })
1205
+ s({ type: String, reflect: !0 })
1196
1206
  ], d.prototype, "variant", 2);
1197
1207
  u([
1198
- r({ type: String })
1208
+ s({ type: String })
1199
1209
  ], d.prototype, "text", 2);
1200
1210
  u([
1201
- r({ type: String })
1211
+ s({ type: String })
1202
1212
  ], d.prototype, "textsecond", 2);
1203
1213
  u([
1204
- r({ type: Boolean, reflect: !0 })
1214
+ s({ type: Boolean, reflect: !0 })
1205
1215
  ], d.prototype, "fullwidth", 2);
1206
1216
  u([
1207
- r({ type: Boolean, reflect: !0 })
1217
+ s({ type: Boolean, reflect: !0 })
1208
1218
  ], d.prototype, "disabled", 2);
1209
1219
  u([
1210
- r({ type: String })
1220
+ s({ type: String })
1211
1221
  ], d.prototype, "startIconModel", 2);
1212
1222
  u([
1213
- r({ type: String })
1223
+ s({ type: String })
1214
1224
  ], d.prototype, "endIconModel", 2);
1215
1225
  u([
1216
- r({ type: Boolean, reflect: !0, attribute: "starticon" })
1226
+ s({ type: Boolean, reflect: !0, attribute: "starticon" })
1217
1227
  ], d.prototype, "startIcon", 2);
1218
1228
  u([
1219
- r({ type: Boolean, reflect: !0, attribute: "endicon" })
1229
+ s({ type: Boolean, reflect: !0, attribute: "endicon" })
1220
1230
  ], d.prototype, "endIcon", 2);
1221
1231
  u([
1222
- r({ type: String, attribute: "paneltarget" })
1232
+ s({ type: String, attribute: "paneltarget" })
1223
1233
  ], d.prototype, "panelTarget", 2);
1224
1234
  u([
1225
- r({ type: String })
1235
+ s({ type: String })
1226
1236
  ], d.prototype, "href", 2);
1227
1237
  u([
1228
- r({ type: String })
1238
+ s({ type: String })
1229
1239
  ], d.prototype, "target", 2);
1230
1240
  u([
1231
- r({ type: Boolean, reflect: !0 })
1241
+ s({ type: Boolean, reflect: !0 })
1232
1242
  ], d.prototype, "underlined", 2);
1233
1243
  u([
1234
- r({ type: Boolean, reflect: !0 })
1244
+ s({ type: Boolean, reflect: !0 })
1235
1245
  ], d.prototype, "withbadge", 2);
1236
1246
  u([
1237
- r({ type: Boolean, reflect: !0 })
1247
+ s({ type: Boolean, reflect: !0 })
1238
1248
  ], d.prototype, "hideRoleButton", 2);
1239
1249
  u([
1240
- r({ reflect: !0, attribute: "describedby" })
1250
+ s({ reflect: !0, attribute: "describedby" })
1241
1251
  ], d.prototype, "describedBy", 2);
1242
1252
  u([
1243
- r({ reflect: !0, attribute: "expanded" })
1253
+ s({ reflect: !0, attribute: "expanded" })
1244
1254
  ], d.prototype, "ariaExpanded", 2);
1245
1255
  d = u([
1246
- B("o-button")
1256
+ S("o-button")
1247
1257
  ], d);
1248
1258
  export {
1249
1259
  d as O,
1250
- l as OccitaneSidePanel,
1251
- lt as v
1260
+ a as OccitaneSidePanel,
1261
+ at as v
1252
1262
  };