@sps-woodland/buttons 8.2.2 → 8.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.es.js CHANGED
@@ -1,256 +1,266 @@
1
1
  import * as d from "react";
2
- import ce, { useRef as j, useCallback as K, useEffect as ue, useState as Ve, useMemo as Ge, useContext as De } from "react";
3
- import { I18nContext as We, Icon as He, Spinner as je, cl as ze, Metadata as Ye } from "@sps-woodland/core";
2
+ import de, { useRef as X, useCallback as K, useEffect as pe, useState as ze, useMemo as Ye, useContext as De } from "react";
3
+ import { I18nContext as Xe, Icon as qe, Spinner as Je, cl as Qe, Metadata as Ze } from "@sps-woodland/core";
4
4
  import { code as g } from "@spscommerce/utils";
5
5
  function Oe(e) {
6
- var t, n, o = "";
6
+ var t, n, r = "";
7
7
  if (typeof e == "string" || typeof e == "number")
8
- o += e;
8
+ r += e;
9
9
  else if (typeof e == "object")
10
- if (Array.isArray(e))
11
- for (t = 0; t < e.length; t++)
12
- e[t] && (n = Oe(e[t])) && (o && (o += " "), o += n);
13
- else
14
- for (t in e)
15
- e[t] && (o && (o += " "), o += t);
16
- return o;
17
- }
18
- function Xe() {
19
- for (var e, t, n = 0, o = ""; n < arguments.length; )
20
- (e = arguments[n++]) && (t = Oe(e)) && (o && (o += " "), o += t);
21
- return o;
22
- }
23
- const de = typeof document < "u" ? ce.useLayoutEffect : () => {
10
+ if (Array.isArray(e)) {
11
+ var s = e.length;
12
+ for (t = 0; t < s; t++)
13
+ e[t] && (n = Oe(e[t])) && (r && (r += " "), r += n);
14
+ } else
15
+ for (n in e)
16
+ e[n] && (r && (r += " "), r += n);
17
+ return r;
18
+ }
19
+ function et() {
20
+ for (var e, t, n = 0, r = "", s = arguments.length; n < s; n++)
21
+ (e = arguments[n]) && (t = Oe(e)) && (r && (r += " "), r += t);
22
+ return r;
23
+ }
24
+ const fe = typeof document < "u" ? de.useLayoutEffect : () => {
24
25
  };
25
- function R(e) {
26
- const t = j(null);
27
- return de(() => {
26
+ function U(e) {
27
+ const t = X(null);
28
+ return fe(() => {
28
29
  t.current = e;
29
30
  }, [
30
31
  e
31
32
  ]), K((...n) => {
32
- const o = t.current;
33
- return o(...n);
33
+ const r = t.current;
34
+ return r == null ? void 0 : r(...n);
34
35
  }, []);
35
36
  }
36
- let ge = /* @__PURE__ */ new Map();
37
- function qe(e, t) {
37
+ let ye = /* @__PURE__ */ new Map();
38
+ function tt(e, t) {
38
39
  if (e === t)
39
40
  return e;
40
- let n = ge.get(e);
41
+ let n = ye.get(e);
41
42
  if (n)
42
43
  return n(t), t;
43
- let o = ge.get(t);
44
- return o ? (o(e), e) : t;
44
+ let r = ye.get(t);
45
+ return r ? (r(e), e) : t;
45
46
  }
46
- function Je(...e) {
47
+ function Ce(...e) {
47
48
  return (...t) => {
48
49
  for (let n of e)
49
50
  typeof n == "function" && n(...t);
50
51
  };
51
52
  }
52
- const N = (e) => {
53
+ const x = (e) => {
53
54
  var t;
54
55
  return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document;
55
- }, oe = (e) => e && "window" in e && e.window === e ? e : N(e).defaultView || window;
56
- function G(...e) {
56
+ }, W = (e) => e && "window" in e && e.window === e ? e : x(e).defaultView || window;
57
+ function H(...e) {
57
58
  let t = {
58
59
  ...e[0]
59
60
  };
60
61
  for (let n = 1; n < e.length; n++) {
61
- let o = e[n];
62
- for (let s in o) {
63
- let u = t[s], c = o[s];
64
- typeof u == "function" && typeof c == "function" && s[0] === "o" && s[1] === "n" && s.charCodeAt(2) >= 65 && s.charCodeAt(2) <= 90 ? t[s] = Je(u, c) : (s === "className" || s === "UNSAFE_className") && typeof u == "string" && typeof c == "string" ? t[s] = Xe(u, c) : s === "id" && u && c ? t.id = qe(u, c) : t[s] = c !== void 0 ? c : u;
62
+ let r = e[n];
63
+ for (let s in r) {
64
+ let l = t[s], c = r[s];
65
+ typeof l == "function" && typeof c == "function" && s[0] === "o" && s[1] === "n" && s.charCodeAt(2) >= 65 && s.charCodeAt(2) <= 90 ? t[s] = Ce(l, c) : (s === "className" || s === "UNSAFE_className") && typeof l == "string" && typeof c == "string" ? t[s] = et(l, c) : s === "id" && l && c ? t.id = tt(l, c) : t[s] = c !== void 0 ? c : l;
65
66
  }
66
67
  }
67
68
  return t;
68
69
  }
69
- const Qe = /* @__PURE__ */ new Set([
70
+ const nt = /* @__PURE__ */ new Set([
70
71
  "id"
71
- ]), Ze = /* @__PURE__ */ new Set([
72
+ ]), rt = /* @__PURE__ */ new Set([
72
73
  "aria-label",
73
74
  "aria-labelledby",
74
75
  "aria-describedby",
75
76
  "aria-details"
76
- ]), et = /* @__PURE__ */ new Set([
77
+ ]), ot = /* @__PURE__ */ new Set([
77
78
  "href",
78
79
  "target",
79
80
  "rel",
80
81
  "download",
81
82
  "ping",
82
83
  "referrerPolicy"
83
- ]), tt = /^(data-.*)$/;
84
- function nt(e, t = {}) {
85
- let { labelable: n, isLink: o, propNames: s } = t, u = {};
84
+ ]), st = /^(data-.*)$/;
85
+ function at(e, t = {}) {
86
+ let { labelable: n, isLink: r, propNames: s } = t, l = {};
86
87
  for (const c in e)
87
- Object.prototype.hasOwnProperty.call(e, c) && (Qe.has(c) || n && Ze.has(c) || o && et.has(c) || (s == null ? void 0 : s.has(c)) || tt.test(c)) && (u[c] = e[c]);
88
- return u;
88
+ Object.prototype.hasOwnProperty.call(e, c) && (nt.has(c) || n && rt.has(c) || r && ot.has(c) || (s == null ? void 0 : s.has(c)) || st.test(c)) && (l[c] = e[c]);
89
+ return l;
89
90
  }
90
91
  function _(e) {
91
- if (rt())
92
+ if (it())
92
93
  e.focus({
93
94
  preventScroll: !0
94
95
  });
95
96
  else {
96
- let t = ot(e);
97
- e.focus(), st(t);
97
+ let t = lt(e);
98
+ e.focus(), ct(t);
98
99
  }
99
100
  }
100
- let X = null;
101
- function rt() {
102
- if (X == null) {
103
- X = !1;
101
+ let Q = null;
102
+ function it() {
103
+ if (Q == null) {
104
+ Q = !1;
104
105
  try {
105
- var e = document.createElement("div");
106
- e.focus({
106
+ document.createElement("div").focus({
107
107
  get preventScroll() {
108
- return X = !0, !0;
108
+ return Q = !0, !0;
109
109
  }
110
110
  });
111
111
  } catch {
112
112
  }
113
113
  }
114
- return X;
114
+ return Q;
115
115
  }
116
- function ot(e) {
117
- for (var t = e.parentNode, n = [], o = document.scrollingElement || document.documentElement; t instanceof HTMLElement && t !== o; )
116
+ function lt(e) {
117
+ let t = e.parentNode, n = [], r = document.scrollingElement || document.documentElement;
118
+ for (; t instanceof HTMLElement && t !== r; )
118
119
  (t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && n.push({
119
120
  element: t,
120
121
  scrollTop: t.scrollTop,
121
122
  scrollLeft: t.scrollLeft
122
123
  }), t = t.parentNode;
123
- return o instanceof HTMLElement && n.push({
124
- element: o,
125
- scrollTop: o.scrollTop,
126
- scrollLeft: o.scrollLeft
124
+ return r instanceof HTMLElement && n.push({
125
+ element: r,
126
+ scrollTop: r.scrollTop,
127
+ scrollLeft: r.scrollLeft
127
128
  }), n;
128
129
  }
129
- function st(e) {
130
- for (let { element: t, scrollTop: n, scrollLeft: o } of e)
131
- t.scrollTop = n, t.scrollLeft = o;
130
+ function ct(e) {
131
+ for (let { element: t, scrollTop: n, scrollLeft: r } of e)
132
+ t.scrollTop = n, t.scrollLeft = r;
132
133
  }
133
- function ee(e) {
134
+ function oe(e) {
134
135
  var t;
135
136
  return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((n) => e.test(n.brand))) || e.test(window.navigator.userAgent);
136
137
  }
137
- function pe(e) {
138
+ function me(e) {
138
139
  var t;
139
140
  return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1;
140
141
  }
141
- function W() {
142
- return pe(/^Mac/i);
142
+ function z() {
143
+ return me(/^Mac/i);
143
144
  }
144
- function at() {
145
- return pe(/^iPhone/i);
145
+ function ut() {
146
+ return me(/^iPhone/i);
146
147
  }
147
- function Ce() {
148
- return pe(/^iPad/i) || W() && navigator.maxTouchPoints > 1;
148
+ function Le() {
149
+ return me(/^iPad/i) || z() && navigator.maxTouchPoints > 1;
149
150
  }
150
151
  function _e() {
151
- return at() || Ce();
152
+ return ut() || Le();
152
153
  }
153
- function it() {
154
- return ee(/AppleWebKit/i) && !lt();
154
+ function dt() {
155
+ return oe(/AppleWebKit/i) && !pt();
155
156
  }
156
- function lt() {
157
- return ee(/Chrome/i);
157
+ function pt() {
158
+ return oe(/Chrome/i);
158
159
  }
159
160
  function Ke() {
160
- return ee(/Android/i);
161
+ return oe(/Android/i);
161
162
  }
162
- function ct() {
163
- return ee(/Firefox/i);
163
+ function ft() {
164
+ return oe(/Firefox/i);
164
165
  }
165
- function H(e, t, n = !0) {
166
- var o, s;
167
- let { metaKey: u, ctrlKey: c, altKey: m, shiftKey: p } = t;
168
- ct() && ((s = window.event) === null || s === void 0 || (o = s.type) === null || o === void 0 ? void 0 : o.startsWith("key")) && e.target === "_blank" && (W() ? u = !0 : c = !0);
169
- let y = it() && W() && !Ce() ? new KeyboardEvent("keydown", {
166
+ function Y(e, t, n = !0) {
167
+ var r, s;
168
+ let { metaKey: l, ctrlKey: c, altKey: m, shiftKey: p } = t;
169
+ ft() && ((s = window.event) === null || s === void 0 || (r = s.type) === null || r === void 0 ? void 0 : r.startsWith("key")) && e.target === "_blank" && (z() ? l = !0 : c = !0);
170
+ let h = dt() && z() && !Le() ? new KeyboardEvent("keydown", {
170
171
  keyIdentifier: "Enter",
171
- metaKey: u,
172
+ metaKey: l,
172
173
  ctrlKey: c,
173
174
  altKey: m,
174
175
  shiftKey: p
175
176
  }) : new MouseEvent("click", {
176
- metaKey: u,
177
+ metaKey: l,
177
178
  ctrlKey: c,
178
179
  altKey: m,
179
180
  shiftKey: p,
180
181
  bubbles: !0,
181
182
  cancelable: !0
182
183
  });
183
- H.isOpening = n, _(e), e.dispatchEvent(y), H.isOpening = !1;
184
+ Y.isOpening = n, _(e), e.dispatchEvent(h), Y.isOpening = !1;
184
185
  }
185
- H.isOpening = !1;
186
- let U = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Set();
187
- function ve() {
186
+ Y.isOpening = !1;
187
+ let V = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Set();
188
+ function he() {
188
189
  if (typeof window > "u")
189
190
  return;
190
- let e = (n) => {
191
- let o = U.get(n.target);
192
- o || (o = /* @__PURE__ */ new Set(), U.set(n.target, o), n.target.addEventListener("transitioncancel", t)), o.add(n.propertyName);
193
- }, t = (n) => {
194
- let o = U.get(n.target);
195
- if (!!o && (o.delete(n.propertyName), o.size === 0 && (n.target.removeEventListener("transitioncancel", t), U.delete(n.target)), U.size === 0)) {
196
- for (let s of se)
197
- s();
198
- se.clear();
191
+ function e(r) {
192
+ return "propertyName" in r;
193
+ }
194
+ let t = (r) => {
195
+ if (!e(r) || !r.target)
196
+ return;
197
+ let s = V.get(r.target);
198
+ s || (s = /* @__PURE__ */ new Set(), V.set(r.target, s), r.target.addEventListener("transitioncancel", n, {
199
+ once: !0
200
+ })), s.add(r.propertyName);
201
+ }, n = (r) => {
202
+ if (!e(r) || !r.target)
203
+ return;
204
+ let s = V.get(r.target);
205
+ if (!!s && (s.delete(r.propertyName), s.size === 0 && (r.target.removeEventListener("transitioncancel", n), V.delete(r.target)), V.size === 0)) {
206
+ for (let l of ie)
207
+ l();
208
+ ie.clear();
199
209
  }
200
210
  };
201
- document.body.addEventListener("transitionrun", e), document.body.addEventListener("transitionend", t);
211
+ document.body.addEventListener("transitionrun", t), document.body.addEventListener("transitionend", n);
202
212
  }
203
- typeof document < "u" && (document.readyState !== "loading" ? ve() : document.addEventListener("DOMContentLoaded", ve));
204
- function Le(e) {
213
+ typeof document < "u" && (document.readyState !== "loading" ? he() : document.addEventListener("DOMContentLoaded", he));
214
+ function Ie(e) {
205
215
  requestAnimationFrame(() => {
206
- U.size === 0 ? e() : se.add(e);
216
+ V.size === 0 ? e() : ie.add(e);
207
217
  });
208
218
  }
209
- function ut() {
210
- let e = j(/* @__PURE__ */ new Map()), t = K((s, u, c, m) => {
211
- let p = m != null && m.once ? (...y) => {
212
- e.current.delete(c), c(...y);
219
+ function mt() {
220
+ let e = X(/* @__PURE__ */ new Map()), t = K((s, l, c, m) => {
221
+ let p = m != null && m.once ? (...h) => {
222
+ e.current.delete(c), c(...h);
213
223
  } : c;
214
224
  e.current.set(c, {
215
- type: u,
225
+ type: l,
216
226
  eventTarget: s,
217
227
  fn: p,
218
228
  options: m
219
- }), s.addEventListener(u, c, m);
220
- }, []), n = K((s, u, c, m) => {
229
+ }), s.addEventListener(l, c, m);
230
+ }, []), n = K((s, l, c, m) => {
221
231
  var p;
222
- let y = ((p = e.current.get(c)) === null || p === void 0 ? void 0 : p.fn) || c;
223
- s.removeEventListener(u, y, m), e.current.delete(c);
224
- }, []), o = K(() => {
225
- e.current.forEach((s, u) => {
226
- n(s.eventTarget, s.type, u, s.options);
232
+ let h = ((p = e.current.get(c)) === null || p === void 0 ? void 0 : p.fn) || c;
233
+ s.removeEventListener(l, h, m), e.current.delete(c);
234
+ }, []), r = K(() => {
235
+ e.current.forEach((s, l) => {
236
+ n(s.eventTarget, s.type, l, s.options);
227
237
  });
228
238
  }, [
229
239
  n
230
240
  ]);
231
- return ue(() => o, [
232
- o
241
+ return pe(() => r, [
242
+ r
233
243
  ]), {
234
244
  addGlobalListener: t,
235
245
  removeGlobalListener: n,
236
- removeAllGlobalListeners: o
246
+ removeAllGlobalListeners: r
237
247
  };
238
248
  }
239
- function Ie(e, t) {
240
- de(() => {
249
+ function Me(e, t) {
250
+ fe(() => {
241
251
  if (e && e.ref && t)
242
252
  return e.ref.current = t.current, () => {
243
- e.ref.current = null;
253
+ e.ref && (e.ref.current = null);
244
254
  };
245
255
  });
246
256
  }
247
- function ae(e) {
257
+ function le(e) {
248
258
  return e.mozInputSource === 0 && e.isTrusted ? !0 : Ke() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
249
259
  }
250
- function dt(e) {
260
+ function bt(e) {
251
261
  return !Ke() && e.width === 0 && e.height === 0 || e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse";
252
262
  }
253
- function pt(e, t) {
263
+ function gt(e, t) {
254
264
  return t.get ? t.get.call(e) : t.value;
255
265
  }
256
266
  function Ae(e, t, n) {
@@ -258,18 +268,18 @@ function Ae(e, t, n) {
258
268
  throw new TypeError("attempted to " + n + " private field on non-instance");
259
269
  return t.get(e);
260
270
  }
261
- function ft(e, t) {
271
+ function vt(e, t) {
262
272
  var n = Ae(e, t, "get");
263
- return pt(e, n);
273
+ return gt(e, n);
264
274
  }
265
- function mt(e, t) {
275
+ function yt(e, t) {
266
276
  if (t.has(e))
267
277
  throw new TypeError("Cannot initialize the same private elements twice on an object");
268
278
  }
269
- function bt(e, t, n) {
270
- mt(e, t), t.set(e, n);
279
+ function ht(e, t, n) {
280
+ yt(e, t), t.set(e, n);
271
281
  }
272
- function gt(e, t, n) {
282
+ function $t(e, t, n) {
273
283
  if (t.set)
274
284
  t.set.call(e, n);
275
285
  else {
@@ -278,82 +288,82 @@ function gt(e, t, n) {
278
288
  t.value = n;
279
289
  }
280
290
  }
281
- function ye(e, t, n) {
282
- var o = Ae(e, t, "set");
283
- return gt(e, o, n), n;
291
+ function $e(e, t, n) {
292
+ var r = Ae(e, t, "set");
293
+ return $t(e, r, n), n;
284
294
  }
285
- let V = "default", ie = "", Z = /* @__PURE__ */ new WeakMap();
286
- function he(e) {
295
+ let G = "default", ce = "", ne = /* @__PURE__ */ new WeakMap();
296
+ function ke(e) {
287
297
  if (_e()) {
288
- if (V === "default") {
289
- const t = N(e);
290
- ie = t.documentElement.style.webkitUserSelect, t.documentElement.style.webkitUserSelect = "none";
298
+ if (G === "default") {
299
+ const t = x(e);
300
+ ce = t.documentElement.style.webkitUserSelect, t.documentElement.style.webkitUserSelect = "none";
291
301
  }
292
- V = "disabled";
302
+ G = "disabled";
293
303
  } else
294
- (e instanceof HTMLElement || e instanceof SVGElement) && (Z.set(e, e.style.userSelect), e.style.userSelect = "none");
304
+ (e instanceof HTMLElement || e instanceof SVGElement) && (ne.set(e, e.style.userSelect), e.style.userSelect = "none");
295
305
  }
296
- function q(e) {
306
+ function Z(e) {
297
307
  if (_e()) {
298
- if (V !== "disabled")
308
+ if (G !== "disabled")
299
309
  return;
300
- V = "restoring", setTimeout(() => {
301
- Le(() => {
302
- if (V === "restoring") {
303
- const t = N(e);
304
- t.documentElement.style.webkitUserSelect === "none" && (t.documentElement.style.webkitUserSelect = ie || ""), ie = "", V = "default";
310
+ G = "restoring", setTimeout(() => {
311
+ Ie(() => {
312
+ if (G === "restoring") {
313
+ const t = x(e);
314
+ t.documentElement.style.webkitUserSelect === "none" && (t.documentElement.style.webkitUserSelect = ce || ""), ce = "", G = "default";
305
315
  }
306
316
  });
307
317
  }, 300);
308
- } else if ((e instanceof HTMLElement || e instanceof SVGElement) && e && Z.has(e)) {
309
- let t = Z.get(e);
310
- e.style.userSelect === "none" && t && (e.style.userSelect = t), e.getAttribute("style") === "" && e.removeAttribute("style"), Z.delete(e);
318
+ } else if ((e instanceof HTMLElement || e instanceof SVGElement) && e && ne.has(e)) {
319
+ let t = ne.get(e);
320
+ e.style.userSelect === "none" && (e.style.userSelect = t), e.getAttribute("style") === "" && e.removeAttribute("style"), ne.delete(e);
311
321
  }
312
322
  }
313
- const Me = ce.createContext({
323
+ const Fe = de.createContext({
314
324
  register: () => {
315
325
  }
316
326
  });
317
- Me.displayName = "PressResponderContext";
318
- function vt(e) {
319
- let t = De(Me);
327
+ Fe.displayName = "PressResponderContext";
328
+ function kt(e) {
329
+ let t = De(Fe);
320
330
  if (t) {
321
- let { register: n, ...o } = t;
322
- e = G(o, e), n();
331
+ let { register: n, ...r } = t;
332
+ e = H(r, e), n();
323
333
  }
324
- return Ie(t, e.ref), e;
334
+ return Me(t, e.ref), e;
325
335
  }
326
- var J = /* @__PURE__ */ new WeakMap();
327
- class Q {
336
+ var ee = /* @__PURE__ */ new WeakMap();
337
+ class te {
328
338
  continuePropagation() {
329
- ye(this, J, !1);
339
+ $e(this, ee, !1);
330
340
  }
331
341
  get shouldStopPropagation() {
332
- return ft(this, J);
342
+ return vt(this, ee);
333
343
  }
334
- constructor(t, n, o) {
335
- bt(this, J, {
344
+ constructor(t, n, r) {
345
+ ht(this, ee, {
336
346
  writable: !0,
337
347
  value: void 0
338
- }), ye(this, J, !0), this.type = t, this.pointerType = n, this.target = o.currentTarget, this.shiftKey = o.shiftKey, this.metaKey = o.metaKey, this.ctrlKey = o.ctrlKey, this.altKey = o.altKey;
348
+ }), $e(this, ee, !0), this.type = t, this.pointerType = n, this.target = r.currentTarget, this.shiftKey = r.shiftKey, this.metaKey = r.metaKey, this.ctrlKey = r.ctrlKey, this.altKey = r.altKey;
339
349
  }
340
350
  }
341
- const $e = Symbol("linkClicked");
342
- function yt(e) {
351
+ const we = Symbol("linkClicked");
352
+ function wt(e) {
343
353
  let {
344
354
  onPress: t,
345
355
  onPressChange: n,
346
- onPressStart: o,
356
+ onPressStart: r,
347
357
  onPressEnd: s,
348
- onPressUp: u,
358
+ onPressUp: l,
349
359
  isDisabled: c,
350
360
  isPressed: m,
351
361
  preventFocusOnPress: p,
352
- shouldCancelOnPointerExit: y,
362
+ shouldCancelOnPointerExit: h,
353
363
  allowTextSelectionOnPress: $,
354
- ref: I,
355
- ...D
356
- } = vt(e), [O, A] = Ve(!1), T = j({
364
+ ref: M,
365
+ ...O
366
+ } = kt(e), [C, A] = ze(!1), E = X({
357
367
  isPressed: !1,
358
368
  ignoreEmulatedMouseEvents: !1,
359
369
  ignoreClickAfterPress: !1,
@@ -363,174 +373,178 @@ function yt(e) {
363
373
  target: null,
364
374
  isOverTarget: !1,
365
375
  pointerType: null
366
- }), { addGlobalListener: k, removeAllGlobalListeners: x } = ut(), w = R((r, f) => {
367
- let E = T.current;
368
- if (c || E.didFirePressStart)
376
+ }), { addGlobalListener: k, removeAllGlobalListeners: N } = mt(), w = U((o, f) => {
377
+ let S = E.current;
378
+ if (c || S.didFirePressStart)
369
379
  return !1;
370
- let l = !0;
371
- if (E.isTriggeringEvent = !0, o) {
372
- let b = new Q("pressstart", f, r);
373
- o(b), l = b.shouldStopPropagation;
380
+ let u = !0;
381
+ if (S.isTriggeringEvent = !0, r) {
382
+ let b = new te("pressstart", f, o);
383
+ r(b), u = b.shouldStopPropagation;
374
384
  }
375
- return n && n(!0), E.isTriggeringEvent = !1, E.didFirePressStart = !0, A(!0), l;
376
- }), v = R((r, f, E = !0) => {
377
- let l = T.current;
378
- if (!l.didFirePressStart)
385
+ return n && n(!0), S.isTriggeringEvent = !1, S.didFirePressStart = !0, A(!0), u;
386
+ }), v = U((o, f, S = !0) => {
387
+ let u = E.current;
388
+ if (!u.didFirePressStart)
379
389
  return !1;
380
- l.ignoreClickAfterPress = !0, l.didFirePressStart = !1, l.isTriggeringEvent = !0;
390
+ u.ignoreClickAfterPress = !0, u.didFirePressStart = !1, u.isTriggeringEvent = !0;
381
391
  let b = !0;
382
392
  if (s) {
383
- let a = new Q("pressend", f, r);
393
+ let a = new te("pressend", f, o);
384
394
  s(a), b = a.shouldStopPropagation;
385
395
  }
386
- if (n && n(!1), A(!1), t && E && !c) {
387
- let a = new Q("press", f, r);
396
+ if (n && n(!1), A(!1), t && S && !c) {
397
+ let a = new te("press", f, o);
388
398
  t(a), b && (b = a.shouldStopPropagation);
389
399
  }
390
- return l.isTriggeringEvent = !1, b;
391
- }), B = R((r, f) => {
392
- let E = T.current;
400
+ return u.isTriggeringEvent = !1, b;
401
+ }), T = U((o, f) => {
402
+ let S = E.current;
393
403
  if (c)
394
404
  return !1;
395
- if (u) {
396
- E.isTriggeringEvent = !0;
397
- let l = new Q("pressup", f, r);
398
- return u(l), E.isTriggeringEvent = !1, l.shouldStopPropagation;
405
+ if (l) {
406
+ S.isTriggeringEvent = !0;
407
+ let u = new te("pressup", f, o);
408
+ return l(u), S.isTriggeringEvent = !1, u.shouldStopPropagation;
399
409
  }
400
410
  return !0;
401
- }), P = R((r) => {
402
- let f = T.current;
403
- f.isPressed && f.target && (f.isOverTarget && f.pointerType != null && v(S(f.target, r), f.pointerType, !1), f.isPressed = !1, f.isOverTarget = !1, f.activePointerId = null, f.pointerType = null, x(), $ || q(f.target));
404
- }), C = R((r) => {
405
- y && P(r);
406
- }), Ue = Ge(() => {
407
- let r = T.current, f = {
408
- onKeyDown(l) {
409
- if (ne(l.nativeEvent, l.currentTarget) && l.currentTarget.contains(l.target)) {
411
+ }), B = U((o) => {
412
+ let f = E.current;
413
+ f.isPressed && f.target && (f.isOverTarget && f.pointerType != null && v(D(f.target, o), f.pointerType, !1), f.isPressed = !1, f.isOverTarget = !1, f.activePointerId = null, f.pointerType = null, N(), $ || Z(f.target));
414
+ }), L = U((o) => {
415
+ h && B(o);
416
+ }), je = Ye(() => {
417
+ let o = E.current, f = {
418
+ onKeyDown(u) {
419
+ if (se(u.nativeEvent, u.currentTarget) && u.currentTarget.contains(u.target)) {
410
420
  var b;
411
- we(l.target, l.key) && l.preventDefault();
421
+ Te(u.target, u.key) && u.preventDefault();
412
422
  let a = !0;
413
- !r.isPressed && !l.repeat && (r.target = l.currentTarget, r.isPressed = !0, a = w(l, "keyboard"), k(N(l.currentTarget), "keyup", E, !1)), a && l.stopPropagation(), l.metaKey && W() && ((b = r.metaKeyEvents) === null || b === void 0 || b.set(l.key, l.nativeEvent));
423
+ if (!o.isPressed && !u.repeat) {
424
+ o.target = u.currentTarget, o.isPressed = !0, a = w(u, "keyboard");
425
+ let i = u.currentTarget, y = (F) => {
426
+ se(F, i) && !F.repeat && i.contains(F.target) && o.target && T(D(o.target, F), "keyboard");
427
+ };
428
+ k(x(u.currentTarget), "keyup", Ce(y, S), !0);
429
+ }
430
+ a && u.stopPropagation(), u.metaKey && z() && ((b = o.metaKeyEvents) === null || b === void 0 || b.set(u.key, u.nativeEvent));
414
431
  } else
415
- l.key === "Meta" && (r.metaKeyEvents = /* @__PURE__ */ new Map());
432
+ u.key === "Meta" && (o.metaKeyEvents = /* @__PURE__ */ new Map());
416
433
  },
417
- onKeyUp(l) {
418
- ne(l.nativeEvent, l.currentTarget) && !l.repeat && l.currentTarget.contains(l.target) && r.target && B(S(r.target, l), "keyboard");
419
- },
420
- onClick(l) {
421
- if (!(l && !l.currentTarget.contains(l.target)) && l && l.button === 0 && !r.isTriggeringEvent && !H.isOpening) {
434
+ onClick(u) {
435
+ if (!(u && !u.currentTarget.contains(u.target)) && u && u.button === 0 && !o.isTriggeringEvent && !Y.isOpening) {
422
436
  let b = !0;
423
- if (c && l.preventDefault(), !r.ignoreClickAfterPress && !r.ignoreEmulatedMouseEvents && !r.isPressed && (r.pointerType === "virtual" || ae(l.nativeEvent))) {
424
- !c && !p && _(l.currentTarget);
425
- let a = w(l, "virtual"), i = B(l, "virtual"), h = v(l, "virtual");
426
- b = a && i && h;
437
+ if (c && u.preventDefault(), !o.ignoreClickAfterPress && !o.ignoreEmulatedMouseEvents && !o.isPressed && (o.pointerType === "virtual" || le(u.nativeEvent))) {
438
+ !c && !p && _(u.currentTarget);
439
+ let a = w(u, "virtual"), i = T(u, "virtual"), y = v(u, "virtual");
440
+ b = a && i && y;
427
441
  }
428
- r.ignoreEmulatedMouseEvents = !1, r.ignoreClickAfterPress = !1, b && l.stopPropagation();
442
+ o.ignoreEmulatedMouseEvents = !1, o.ignoreClickAfterPress = !1, b && u.stopPropagation();
429
443
  }
430
444
  }
431
- }, E = (l) => {
445
+ }, S = (u) => {
432
446
  var b;
433
- if (r.isPressed && r.target && ne(l, r.target)) {
447
+ if (o.isPressed && o.target && se(u, o.target)) {
434
448
  var a;
435
- we(l.target, l.key) && l.preventDefault();
436
- let h = l.target, te = v(S(r.target, l), "keyboard", r.target.contains(h));
437
- x(), te && l.stopPropagation(), l.key !== "Enter" && fe(r.target) && r.target.contains(h) && !l[$e] && (l[$e] = !0, H(r.target, l, !1)), r.isPressed = !1, (a = r.metaKeyEvents) === null || a === void 0 || a.delete(l.key);
438
- } else if (l.key === "Meta" && ((b = r.metaKeyEvents) === null || b === void 0 ? void 0 : b.size)) {
449
+ Te(u.target, u.key) && u.preventDefault();
450
+ let y = u.target;
451
+ v(D(o.target, u), "keyboard", o.target.contains(y)), N(), u.key !== "Enter" && be(o.target) && o.target.contains(y) && !u[we] && (u[we] = !0, Y(o.target, u, !1)), o.isPressed = !1, (a = o.metaKeyEvents) === null || a === void 0 || a.delete(u.key);
452
+ } else if (u.key === "Meta" && ((b = o.metaKeyEvents) === null || b === void 0 ? void 0 : b.size)) {
439
453
  var i;
440
- let h = r.metaKeyEvents;
441
- r.metaKeyEvents = void 0;
442
- for (let te of h.values())
443
- (i = r.target) === null || i === void 0 || i.dispatchEvent(new KeyboardEvent("keyup", te));
454
+ let y = o.metaKeyEvents;
455
+ o.metaKeyEvents = void 0;
456
+ for (let F of y.values())
457
+ (i = o.target) === null || i === void 0 || i.dispatchEvent(new KeyboardEvent("keyup", F));
444
458
  }
445
459
  };
446
460
  if (typeof PointerEvent < "u") {
447
461
  f.onPointerDown = (i) => {
448
462
  if (i.button !== 0 || !i.currentTarget.contains(i.target))
449
463
  return;
450
- if (dt(i.nativeEvent)) {
451
- r.pointerType = "virtual";
464
+ if (bt(i.nativeEvent)) {
465
+ o.pointerType = "virtual";
452
466
  return;
453
467
  }
454
- re(i.currentTarget) && i.preventDefault(), r.pointerType = i.pointerType;
455
- let h = !0;
456
- r.isPressed || (r.isPressed = !0, r.isOverTarget = !0, r.activePointerId = i.pointerId, r.target = i.currentTarget, !c && !p && _(i.currentTarget), $ || he(r.target), h = w(i, r.pointerType), k(N(i.currentTarget), "pointermove", l, !1), k(N(i.currentTarget), "pointerup", b, !1), k(N(i.currentTarget), "pointercancel", a, !1)), h && i.stopPropagation();
468
+ ae(i.currentTarget) && i.preventDefault(), o.pointerType = i.pointerType;
469
+ let y = !0;
470
+ o.isPressed || (o.isPressed = !0, o.isOverTarget = !0, o.activePointerId = i.pointerId, o.target = i.currentTarget, !c && !p && _(i.currentTarget), $ || ke(o.target), y = w(i, o.pointerType), k(x(i.currentTarget), "pointermove", u, !1), k(x(i.currentTarget), "pointerup", b, !1), k(x(i.currentTarget), "pointercancel", a, !1)), y && i.stopPropagation();
457
471
  }, f.onMouseDown = (i) => {
458
- !i.currentTarget.contains(i.target) || i.button === 0 && (re(i.currentTarget) && i.preventDefault(), i.stopPropagation());
472
+ !i.currentTarget.contains(i.target) || i.button === 0 && (ae(i.currentTarget) && i.preventDefault(), i.stopPropagation());
459
473
  }, f.onPointerUp = (i) => {
460
- !i.currentTarget.contains(i.target) || r.pointerType === "virtual" || i.button === 0 && M(i, i.currentTarget) && B(i, r.pointerType || i.pointerType);
474
+ !i.currentTarget.contains(i.target) || o.pointerType === "virtual" || i.button === 0 && R(i, i.currentTarget) && T(i, o.pointerType || i.pointerType);
461
475
  };
462
- let l = (i) => {
463
- i.pointerId === r.activePointerId && (r.target && M(i, r.target) ? !r.isOverTarget && r.pointerType != null && (r.isOverTarget = !0, w(S(r.target, i), r.pointerType)) : r.target && r.isOverTarget && r.pointerType != null && (r.isOverTarget = !1, v(S(r.target, i), r.pointerType, !1), C(i)));
476
+ let u = (i) => {
477
+ i.pointerId === o.activePointerId && (o.target && R(i, o.target) ? !o.isOverTarget && o.pointerType != null && (o.isOverTarget = !0, w(D(o.target, i), o.pointerType)) : o.target && o.isOverTarget && o.pointerType != null && (o.isOverTarget = !1, v(D(o.target, i), o.pointerType, !1), L(i)));
464
478
  }, b = (i) => {
465
- i.pointerId === r.activePointerId && r.isPressed && i.button === 0 && r.target && (M(i, r.target) && r.pointerType != null ? v(S(r.target, i), r.pointerType) : r.isOverTarget && r.pointerType != null && v(S(r.target, i), r.pointerType, !1), r.isPressed = !1, r.isOverTarget = !1, r.activePointerId = null, r.pointerType = null, x(), $ || q(r.target));
479
+ i.pointerId === o.activePointerId && o.isPressed && i.button === 0 && o.target && (R(i, o.target) && o.pointerType != null ? v(D(o.target, i), o.pointerType) : o.isOverTarget && o.pointerType != null && v(D(o.target, i), o.pointerType, !1), o.isPressed = !1, o.isOverTarget = !1, o.activePointerId = null, o.pointerType = null, N(), $ || Z(o.target));
466
480
  }, a = (i) => {
467
- P(i);
481
+ B(i);
468
482
  };
469
483
  f.onDragStart = (i) => {
470
- !i.currentTarget.contains(i.target) || P(i);
484
+ !i.currentTarget.contains(i.target) || B(i);
471
485
  };
472
486
  } else {
473
487
  f.onMouseDown = (a) => {
474
488
  if (a.button !== 0 || !a.currentTarget.contains(a.target))
475
489
  return;
476
- if (re(a.currentTarget) && a.preventDefault(), r.ignoreEmulatedMouseEvents) {
490
+ if (ae(a.currentTarget) && a.preventDefault(), o.ignoreEmulatedMouseEvents) {
477
491
  a.stopPropagation();
478
492
  return;
479
493
  }
480
- r.isPressed = !0, r.isOverTarget = !0, r.target = a.currentTarget, r.pointerType = ae(a.nativeEvent) ? "virtual" : "mouse", !c && !p && _(a.currentTarget), w(a, r.pointerType) && a.stopPropagation(), k(N(a.currentTarget), "mouseup", l, !1);
494
+ o.isPressed = !0, o.isOverTarget = !0, o.target = a.currentTarget, o.pointerType = le(a.nativeEvent) ? "virtual" : "mouse", !c && !p && _(a.currentTarget), w(a, o.pointerType) && a.stopPropagation(), k(x(a.currentTarget), "mouseup", u, !1);
481
495
  }, f.onMouseEnter = (a) => {
482
496
  if (!a.currentTarget.contains(a.target))
483
497
  return;
484
498
  let i = !0;
485
- r.isPressed && !r.ignoreEmulatedMouseEvents && r.pointerType != null && (r.isOverTarget = !0, i = w(a, r.pointerType)), i && a.stopPropagation();
499
+ o.isPressed && !o.ignoreEmulatedMouseEvents && o.pointerType != null && (o.isOverTarget = !0, i = w(a, o.pointerType)), i && a.stopPropagation();
486
500
  }, f.onMouseLeave = (a) => {
487
501
  if (!a.currentTarget.contains(a.target))
488
502
  return;
489
503
  let i = !0;
490
- r.isPressed && !r.ignoreEmulatedMouseEvents && r.pointerType != null && (r.isOverTarget = !1, i = v(a, r.pointerType, !1), C(a)), i && a.stopPropagation();
504
+ o.isPressed && !o.ignoreEmulatedMouseEvents && o.pointerType != null && (o.isOverTarget = !1, i = v(a, o.pointerType, !1), L(a)), i && a.stopPropagation();
491
505
  }, f.onMouseUp = (a) => {
492
- !a.currentTarget.contains(a.target) || !r.ignoreEmulatedMouseEvents && a.button === 0 && B(a, r.pointerType || "mouse");
506
+ !a.currentTarget.contains(a.target) || !o.ignoreEmulatedMouseEvents && a.button === 0 && T(a, o.pointerType || "mouse");
493
507
  };
494
- let l = (a) => {
508
+ let u = (a) => {
495
509
  if (a.button === 0) {
496
- if (r.isPressed = !1, x(), r.ignoreEmulatedMouseEvents) {
497
- r.ignoreEmulatedMouseEvents = !1;
510
+ if (o.isPressed = !1, N(), o.ignoreEmulatedMouseEvents) {
511
+ o.ignoreEmulatedMouseEvents = !1;
498
512
  return;
499
513
  }
500
- r.target && M(a, r.target) && r.pointerType != null ? v(S(r.target, a), r.pointerType) : r.target && r.isOverTarget && r.pointerType != null && v(S(r.target, a), r.pointerType, !1), r.isOverTarget = !1;
514
+ o.target && R(a, o.target) && o.pointerType != null ? v(D(o.target, a), o.pointerType) : o.target && o.isOverTarget && o.pointerType != null && v(D(o.target, a), o.pointerType, !1), o.isOverTarget = !1;
501
515
  }
502
516
  };
503
517
  f.onTouchStart = (a) => {
504
518
  if (!a.currentTarget.contains(a.target))
505
519
  return;
506
- let i = ht(a.nativeEvent);
520
+ let i = Et(a.nativeEvent);
507
521
  if (!i)
508
522
  return;
509
- r.activePointerId = i.identifier, r.ignoreEmulatedMouseEvents = !0, r.isOverTarget = !0, r.isPressed = !0, r.target = a.currentTarget, r.pointerType = "touch", !c && !p && _(a.currentTarget), $ || he(r.target), w(a, r.pointerType) && a.stopPropagation(), k(oe(a.currentTarget), "scroll", b, !0);
523
+ o.activePointerId = i.identifier, o.ignoreEmulatedMouseEvents = !0, o.isOverTarget = !0, o.isPressed = !0, o.target = a.currentTarget, o.pointerType = "touch", !c && !p && _(a.currentTarget), $ || ke(o.target), w(a, o.pointerType) && a.stopPropagation(), k(W(a.currentTarget), "scroll", b, !0);
510
524
  }, f.onTouchMove = (a) => {
511
525
  if (!a.currentTarget.contains(a.target))
512
526
  return;
513
- if (!r.isPressed) {
527
+ if (!o.isPressed) {
514
528
  a.stopPropagation();
515
529
  return;
516
530
  }
517
- let i = ke(a.nativeEvent, r.activePointerId), h = !0;
518
- i && M(i, a.currentTarget) ? !r.isOverTarget && r.pointerType != null && (r.isOverTarget = !0, h = w(a, r.pointerType)) : r.isOverTarget && r.pointerType != null && (r.isOverTarget = !1, h = v(a, r.pointerType, !1), C(a)), h && a.stopPropagation();
531
+ let i = Ee(a.nativeEvent, o.activePointerId), y = !0;
532
+ i && R(i, a.currentTarget) ? !o.isOverTarget && o.pointerType != null && (o.isOverTarget = !0, y = w(a, o.pointerType)) : o.isOverTarget && o.pointerType != null && (o.isOverTarget = !1, y = v(a, o.pointerType, !1), L(a)), y && a.stopPropagation();
519
533
  }, f.onTouchEnd = (a) => {
520
534
  if (!a.currentTarget.contains(a.target))
521
535
  return;
522
- if (!r.isPressed) {
536
+ if (!o.isPressed) {
523
537
  a.stopPropagation();
524
538
  return;
525
539
  }
526
- let i = ke(a.nativeEvent, r.activePointerId), h = !0;
527
- i && M(i, a.currentTarget) && r.pointerType != null ? (B(a, r.pointerType), h = v(a, r.pointerType)) : r.isOverTarget && r.pointerType != null && (h = v(a, r.pointerType, !1)), h && a.stopPropagation(), r.isPressed = !1, r.activePointerId = null, r.isOverTarget = !1, r.ignoreEmulatedMouseEvents = !0, r.target && !$ && q(r.target), x();
540
+ let i = Ee(a.nativeEvent, o.activePointerId), y = !0;
541
+ i && R(i, a.currentTarget) && o.pointerType != null ? (T(a, o.pointerType), y = v(a, o.pointerType)) : o.isOverTarget && o.pointerType != null && (y = v(a, o.pointerType, !1)), y && a.stopPropagation(), o.isPressed = !1, o.activePointerId = null, o.isOverTarget = !1, o.ignoreEmulatedMouseEvents = !0, o.target && !$ && Z(o.target), N();
528
542
  }, f.onTouchCancel = (a) => {
529
- !a.currentTarget.contains(a.target) || (a.stopPropagation(), r.isPressed && P(a));
543
+ !a.currentTarget.contains(a.target) || (a.stopPropagation(), o.isPressed && B(a));
530
544
  };
531
545
  let b = (a) => {
532
- r.isPressed && a.target.contains(r.target) && P({
533
- currentTarget: r.target,
546
+ o.isPressed && a.target.contains(o.target) && B({
547
+ currentTarget: o.target,
534
548
  shiftKey: !1,
535
549
  ctrlKey: !1,
536
550
  metaKey: !1,
@@ -538,7 +552,7 @@ function yt(e) {
538
552
  });
539
553
  };
540
554
  f.onDragStart = (a) => {
541
- !a.currentTarget.contains(a.target) || P(a);
555
+ !a.currentTarget.contains(a.target) || B(a);
542
556
  };
543
557
  }
544
558
  return f;
@@ -546,45 +560,45 @@ function yt(e) {
546
560
  k,
547
561
  c,
548
562
  p,
549
- x,
563
+ N,
550
564
  $,
551
- P,
552
- C,
565
+ B,
566
+ L,
553
567
  v,
554
568
  w,
555
- B
569
+ T
556
570
  ]);
557
- return ue(() => () => {
558
- var r;
559
- $ || q((r = T.current.target) !== null && r !== void 0 ? r : void 0);
571
+ return pe(() => () => {
572
+ var o;
573
+ $ || Z((o = E.current.target) !== null && o !== void 0 ? o : void 0);
560
574
  }, [
561
575
  $
562
576
  ]), {
563
- isPressed: m || O,
564
- pressProps: G(D, Ue)
577
+ isPressed: m || C,
578
+ pressProps: H(O, je)
565
579
  };
566
580
  }
567
- function fe(e) {
581
+ function be(e) {
568
582
  return e.tagName === "A" && e.hasAttribute("href");
569
583
  }
570
- function ne(e, t) {
571
- const { key: n, code: o } = e, s = t, u = s.getAttribute("role");
572
- return (n === "Enter" || n === " " || n === "Spacebar" || o === "Space") && !(s instanceof oe(s).HTMLInputElement && !Fe(s, n) || s instanceof oe(s).HTMLTextAreaElement || s.isContentEditable) && !((u === "link" || !u && fe(s)) && n !== "Enter");
584
+ function se(e, t) {
585
+ const { key: n, code: r } = e, s = t, l = s.getAttribute("role");
586
+ return (n === "Enter" || n === " " || n === "Spacebar" || r === "Space") && !(s instanceof W(s).HTMLInputElement && !Re(s, n) || s instanceof W(s).HTMLTextAreaElement || s.isContentEditable) && !((l === "link" || !l && be(s)) && n !== "Enter");
573
587
  }
574
- function ht(e) {
588
+ function Et(e) {
575
589
  const { targetTouches: t } = e;
576
590
  return t.length > 0 ? t[0] : null;
577
591
  }
578
- function ke(e, t) {
592
+ function Ee(e, t) {
579
593
  const n = e.changedTouches;
580
- for (let o = 0; o < n.length; o++) {
581
- const s = n[o];
594
+ for (let r = 0; r < n.length; r++) {
595
+ const s = n[r];
582
596
  if (s.identifier === t)
583
597
  return s;
584
598
  }
585
599
  return null;
586
600
  }
587
- function S(e, t) {
601
+ function D(e, t) {
588
602
  return {
589
603
  currentTarget: e,
590
604
  shiftKey: t.shiftKey,
@@ -593,7 +607,7 @@ function S(e, t) {
593
607
  altKey: t.altKey
594
608
  };
595
609
  }
596
- function $t(e) {
610
+ function Tt(e) {
597
611
  let t = 0, n = 0;
598
612
  return e.width !== void 0 ? t = e.width / 2 : e.radiusX !== void 0 && (t = e.radiusX), e.height !== void 0 ? n = e.height / 2 : e.radiusY !== void 0 && (n = e.radiusY), {
599
613
  top: e.clientY - n,
@@ -602,20 +616,20 @@ function $t(e) {
602
616
  left: e.clientX - t
603
617
  };
604
618
  }
605
- function kt(e, t) {
619
+ function Bt(e, t) {
606
620
  return !(e.left > t.right || t.left > e.right || e.top > t.bottom || t.top > e.bottom);
607
621
  }
608
- function M(e, t) {
609
- let n = t.getBoundingClientRect(), o = $t(e);
610
- return kt(n, o);
622
+ function R(e, t) {
623
+ let n = t.getBoundingClientRect(), r = Tt(e);
624
+ return Bt(n, r);
611
625
  }
612
- function re(e) {
626
+ function ae(e) {
613
627
  return !(e instanceof HTMLElement) || !e.hasAttribute("draggable");
614
628
  }
615
- function we(e, t) {
616
- return e instanceof HTMLInputElement ? !Fe(e, t) : e instanceof HTMLButtonElement ? e.type !== "submit" && e.type !== "reset" : !fe(e);
629
+ function Te(e, t) {
630
+ return e instanceof HTMLInputElement ? !Re(e, t) : e instanceof HTMLButtonElement ? e.type !== "submit" && e.type !== "reset" : !be(e);
617
631
  }
618
- const wt = /* @__PURE__ */ new Set([
632
+ const Pt = /* @__PURE__ */ new Set([
619
633
  "checkbox",
620
634
  "radio",
621
635
  "range",
@@ -626,10 +640,10 @@ const wt = /* @__PURE__ */ new Set([
626
640
  "submit",
627
641
  "reset"
628
642
  ]);
629
- function Fe(e, t) {
630
- return e.type === "checkbox" || e.type === "radio" ? t === " " : wt.has(e.type);
643
+ function Re(e, t) {
644
+ return e.type === "checkbox" || e.type === "radio" ? t === " " : Pt.has(e.type);
631
645
  }
632
- class Tt {
646
+ class xt {
633
647
  isDefaultPrevented() {
634
648
  return this.nativeEvent.defaultPrevented;
635
649
  }
@@ -648,27 +662,27 @@ class Tt {
648
662
  this.nativeEvent = n, this.target = n.target, this.currentTarget = n.currentTarget, this.relatedTarget = n.relatedTarget, this.bubbles = n.bubbles, this.cancelable = n.cancelable, this.defaultPrevented = n.defaultPrevented, this.eventPhase = n.eventPhase, this.isTrusted = n.isTrusted, this.timeStamp = n.timeStamp, this.type = t;
649
663
  }
650
664
  }
651
- function Bt(e) {
652
- let t = j({
665
+ function St(e) {
666
+ let t = X({
653
667
  isFocused: !1,
654
668
  observer: null
655
669
  });
656
- de(() => {
657
- const o = t.current;
670
+ fe(() => {
671
+ const r = t.current;
658
672
  return () => {
659
- o.observer && (o.observer.disconnect(), o.observer = null);
673
+ r.observer && (r.observer.disconnect(), r.observer = null);
660
674
  };
661
675
  }, []);
662
- let n = R((o) => {
663
- e == null || e(o);
676
+ let n = U((r) => {
677
+ e == null || e(r);
664
678
  });
665
- return K((o) => {
666
- if (o.target instanceof HTMLButtonElement || o.target instanceof HTMLInputElement || o.target instanceof HTMLTextAreaElement || o.target instanceof HTMLSelectElement) {
679
+ return K((r) => {
680
+ if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) {
667
681
  t.current.isFocused = !0;
668
- let s = o.target, u = (c) => {
669
- t.current.isFocused = !1, s.disabled && n(new Tt("blur", c)), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
682
+ let s = r.target, l = (c) => {
683
+ t.current.isFocused = !1, s.disabled && n(new xt("blur", c)), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
670
684
  };
671
- s.addEventListener("focusout", u, {
685
+ s.addEventListener("focusout", l, {
672
686
  once: !0
673
687
  }), t.current.observer = new MutationObserver(() => {
674
688
  if (t.current.isFocused && s.disabled) {
@@ -693,15 +707,15 @@ function Bt(e) {
693
707
  n
694
708
  ]);
695
709
  }
696
- function Pt(e) {
697
- let { isDisabled: t, onFocus: n, onBlur: o, onFocusChange: s } = e;
698
- const u = K((p) => {
710
+ function Nt(e) {
711
+ let { isDisabled: t, onFocus: n, onBlur: r, onFocusChange: s } = e;
712
+ const l = K((p) => {
699
713
  if (p.target === p.currentTarget)
700
- return o && o(p), s && s(!1), !0;
714
+ return r && r(p), s && s(!1), !0;
701
715
  }, [
702
- o,
716
+ r,
703
717
  s
704
- ]), c = Bt(u), m = K((p) => {
718
+ ]), c = St(l), m = K((p) => {
705
719
  p.target === p.currentTarget && document.activeElement === p.target && (n && n(p), s && s(!0), c(p));
706
720
  }, [
707
721
  s,
@@ -710,52 +724,70 @@ function Pt(e) {
710
724
  ]);
711
725
  return {
712
726
  focusProps: {
713
- onFocus: !t && (n || s || o) ? m : void 0,
714
- onBlur: !t && (o || s) ? u : void 0
727
+ onFocus: !t && (n || s || r) ? m : void 0,
728
+ onBlur: !t && (r || s) ? l : void 0
715
729
  }
716
730
  };
717
731
  }
718
- let z = null, Et = /* @__PURE__ */ new Set(), Te = !1, L = !1, le = !1;
719
- function me(e, t) {
720
- for (let n of Et)
732
+ let q = null, Dt = /* @__PURE__ */ new Set(), j = /* @__PURE__ */ new Map(), I = !1, ue = !1;
733
+ function ge(e, t) {
734
+ for (let n of Dt)
721
735
  n(e, t);
722
736
  }
723
- function xt(e) {
724
- return !(e.metaKey || !W() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
737
+ function Ot(e) {
738
+ return !(e.metaKey || !z() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
725
739
  }
726
- function Be(e) {
727
- L = !0, xt(e) && (z = "keyboard", me("keyboard", e));
740
+ function re(e) {
741
+ I = !0, Ot(e) && (q = "keyboard", ge("keyboard", e));
728
742
  }
729
- function F(e) {
730
- z = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (L = !0, me("pointer", e));
743
+ function P(e) {
744
+ q = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (I = !0, ge("pointer", e));
731
745
  }
732
- function St(e) {
733
- ae(e) && (L = !0, z = "virtual");
746
+ function Ue(e) {
747
+ le(e) && (I = !0, q = "virtual");
734
748
  }
735
- function Nt(e) {
736
- e.target === window || e.target === document || (!L && !le && (z = "virtual", me("virtual", e)), L = !1, le = !1);
749
+ function Ve(e) {
750
+ e.target === window || e.target === document || (!I && !ue && (q = "virtual", ge("virtual", e)), I = !1, ue = !1);
737
751
  }
738
- function Dt() {
739
- L = !1, le = !0;
752
+ function Ge() {
753
+ I = !1, ue = !0;
740
754
  }
741
- function Pe() {
742
- if (typeof window > "u" || Te)
755
+ function Be(e) {
756
+ if (typeof window > "u" || j.get(W(e)))
743
757
  return;
744
- let e = HTMLElement.prototype.focus;
745
- HTMLElement.prototype.focus = function() {
746
- L = !0, e.apply(this, arguments);
747
- }, document.addEventListener("keydown", Be, !0), document.addEventListener("keyup", Be, !0), document.addEventListener("click", St, !0), window.addEventListener("focus", Nt, !0), window.addEventListener("blur", Dt, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown", F, !0), document.addEventListener("pointermove", F, !0), document.addEventListener("pointerup", F, !0)) : (document.addEventListener("mousedown", F, !0), document.addEventListener("mousemove", F, !0), document.addEventListener("mouseup", F, !0)), Te = !0;
758
+ const t = W(e), n = x(e);
759
+ let r = t.HTMLElement.prototype.focus;
760
+ t.HTMLElement.prototype.focus = function() {
761
+ I = !0, r.apply(this, arguments);
762
+ }, n.addEventListener("keydown", re, !0), n.addEventListener("keyup", re, !0), n.addEventListener("click", Ue, !0), t.addEventListener("focus", Ve, !0), t.addEventListener("blur", Ge, !1), typeof PointerEvent < "u" ? (n.addEventListener("pointerdown", P, !0), n.addEventListener("pointermove", P, !0), n.addEventListener("pointerup", P, !0)) : (n.addEventListener("mousedown", P, !0), n.addEventListener("mousemove", P, !0), n.addEventListener("mouseup", P, !0)), t.addEventListener("beforeunload", () => {
763
+ We(e);
764
+ }, {
765
+ once: !0
766
+ }), j.set(t, {
767
+ focus: r
768
+ });
748
769
  }
749
- typeof document < "u" && (document.readyState !== "loading" ? Pe() : document.addEventListener("DOMContentLoaded", Pe));
750
- function Ot() {
751
- return z;
770
+ const We = (e, t) => {
771
+ const n = W(e), r = x(e);
772
+ t && r.removeEventListener("DOMContentLoaded", t), j.has(n) && (n.HTMLElement.prototype.focus = j.get(n).focus, r.removeEventListener("keydown", re, !0), r.removeEventListener("keyup", re, !0), r.removeEventListener("click", Ue, !0), n.removeEventListener("focus", Ve, !0), n.removeEventListener("blur", Ge, !1), typeof PointerEvent < "u" ? (r.removeEventListener("pointerdown", P, !0), r.removeEventListener("pointermove", P, !0), r.removeEventListener("pointerup", P, !0)) : (r.removeEventListener("mousedown", P, !0), r.removeEventListener("mousemove", P, !0), r.removeEventListener("mouseup", P, !0)), j.delete(n));
773
+ };
774
+ function Ct(e) {
775
+ const t = x(e);
776
+ let n;
777
+ return t.readyState !== "loading" ? Be(e) : (n = () => {
778
+ Be(e);
779
+ }, t.addEventListener("DOMContentLoaded", n)), () => We(e, n);
780
+ }
781
+ typeof document < "u" && Ct();
782
+ function Lt() {
783
+ return q;
752
784
  }
753
- function Ee(e) {
785
+ function Pe(e) {
754
786
  if (!e)
755
787
  return;
756
788
  let t = !0;
757
789
  return (n) => {
758
- let o = {
790
+ let r = {
759
791
  ...n,
760
792
  preventDefault() {
761
793
  n.preventDefault();
@@ -770,44 +802,45 @@ function Ee(e) {
770
802
  t = !1;
771
803
  }
772
804
  };
773
- e(o), t && n.stopPropagation();
805
+ e(r), t && n.stopPropagation();
774
806
  };
775
807
  }
776
- function Ct(e) {
808
+ function _t(e) {
777
809
  return {
778
810
  keyboardProps: e.isDisabled ? {} : {
779
- onKeyDown: Ee(e.onKeyDown),
780
- onKeyUp: Ee(e.onKeyUp)
811
+ onKeyDown: Pe(e.onKeyDown),
812
+ onKeyUp: Pe(e.onKeyUp)
781
813
  }
782
814
  };
783
815
  }
784
- function _t(e) {
785
- if (Ot() === "virtual") {
786
- let t = document.activeElement;
787
- Le(() => {
788
- document.activeElement === t && document.contains(e) && _(e);
816
+ function Kt(e) {
817
+ const t = x(e);
818
+ if (Lt() === "virtual") {
819
+ let n = t.activeElement;
820
+ Ie(() => {
821
+ t.activeElement === n && e.isConnected && _(e);
789
822
  });
790
823
  } else
791
824
  _(e);
792
825
  }
793
- function Kt(e, t) {
826
+ function It(e, t) {
794
827
  return !e || !t ? !1 : t.some((n) => n.contains(e));
795
828
  }
796
- class be {
829
+ class ve {
797
830
  get size() {
798
831
  return this.fastMap.size;
799
832
  }
800
833
  getTreeNode(t) {
801
834
  return this.fastMap.get(t);
802
835
  }
803
- addTreeNode(t, n, o) {
836
+ addTreeNode(t, n, r) {
804
837
  let s = this.fastMap.get(n != null ? n : null);
805
838
  if (!s)
806
839
  return;
807
- let u = new xe({
840
+ let l = new xe({
808
841
  scopeRef: t
809
842
  });
810
- s.addChild(u), u.parent = s, this.fastMap.set(t, u), o && (u.nodeToRestore = o);
843
+ s.addChild(l), l.parent = s, this.fastMap.set(t, l), r && (l.nodeToRestore = r);
811
844
  }
812
845
  addNode(t) {
813
846
  this.fastMap.set(t.scopeRef, t);
@@ -818,11 +851,11 @@ class be {
818
851
  let n = this.fastMap.get(t);
819
852
  if (!n)
820
853
  return;
821
- let o = n.parent;
822
- for (let u of this.traverse())
823
- u !== n && n.nodeToRestore && u.nodeToRestore && n.scopeRef && n.scopeRef.current && Kt(u.nodeToRestore, n.scopeRef.current) && (u.nodeToRestore = n.nodeToRestore);
854
+ let r = n.parent;
855
+ for (let l of this.traverse())
856
+ l !== n && n.nodeToRestore && l.nodeToRestore && n.scopeRef && n.scopeRef.current && It(l.nodeToRestore, n.scopeRef.current) && (l.nodeToRestore = n.nodeToRestore);
824
857
  let s = n.children;
825
- o && (o.removeChild(n), s.size > 0 && s.forEach((u) => o && o.addChild(u))), this.fastMap.delete(n.scopeRef);
858
+ r && (r.removeChild(n), s.size > 0 && s.forEach((l) => r && r.addChild(l))), this.fastMap.delete(n.scopeRef);
826
859
  }
827
860
  *traverse(t = this.root) {
828
861
  if (t.scopeRef != null && (yield t), t.children.size > 0)
@@ -831,10 +864,10 @@ class be {
831
864
  }
832
865
  clone() {
833
866
  var t;
834
- let n = new be();
835
- var o;
867
+ let n = new ve();
868
+ var r;
836
869
  for (let s of this.traverse())
837
- n.addTreeNode(s.scopeRef, (o = (t = s.parent) === null || t === void 0 ? void 0 : t.scopeRef) !== null && o !== void 0 ? o : null, s.nodeToRestore);
870
+ n.addTreeNode(s.scopeRef, (r = (t = s.parent) === null || t === void 0 ? void 0 : t.scopeRef) !== null && r !== void 0 ? r : null, s.nodeToRestore);
838
871
  return n;
839
872
  }
840
873
  constructor() {
@@ -854,85 +887,85 @@ class xe {
854
887
  this.children = /* @__PURE__ */ new Set(), this.contain = !1, this.scopeRef = t.scopeRef;
855
888
  }
856
889
  }
857
- new be();
858
- let Lt = /* @__PURE__ */ ce.createContext(null);
859
- function It(e) {
860
- let t = De(Lt) || {};
861
- Ie(t, e);
862
- let { ref: n, ...o } = t;
863
- return o;
864
- }
865
- function At(e, t) {
866
- let { focusProps: n } = Pt(e), { keyboardProps: o } = Ct(e), s = G(n, o), u = It(t), c = e.isDisabled ? {} : u, m = j(e.autoFocus);
867
- return ue(() => {
868
- m.current && t.current && _t(t.current), m.current = !1;
890
+ new ve();
891
+ let Mt = /* @__PURE__ */ de.createContext(null);
892
+ function At(e) {
893
+ let t = De(Mt) || {};
894
+ Me(t, e);
895
+ let { ref: n, ...r } = t;
896
+ return r;
897
+ }
898
+ function Ft(e, t) {
899
+ let { focusProps: n } = Nt(e), { keyboardProps: r } = _t(e), s = H(n, r), l = At(t), c = e.isDisabled ? {} : l, m = X(e.autoFocus);
900
+ return pe(() => {
901
+ m.current && t.current && Kt(t.current), m.current = !1;
869
902
  }, [
870
903
  t
871
904
  ]), {
872
- focusableProps: G({
905
+ focusableProps: H({
873
906
  ...s,
874
907
  tabIndex: e.excludeFromTabOrder && !e.isDisabled ? -1 : void 0
875
908
  }, c)
876
909
  };
877
910
  }
878
- function Mt(e, t) {
911
+ function Rt(e, t) {
879
912
  let {
880
913
  elementType: n = "button",
881
- isDisabled: o,
914
+ isDisabled: r,
882
915
  onPress: s,
883
- onPressStart: u,
916
+ onPressStart: l,
884
917
  onPressEnd: c,
885
918
  onPressUp: m,
886
919
  onPressChange: p,
887
- preventFocusOnPress: y,
920
+ preventFocusOnPress: h,
888
921
  allowFocusWhenDisabled: $,
889
- onClick: I,
890
- href: D,
891
- target: O,
922
+ onClick: M,
923
+ href: O,
924
+ target: C,
892
925
  rel: A,
893
- type: T = "button"
926
+ type: E = "button"
894
927
  } = e, k;
895
928
  n === "button" ? k = {
896
- type: T,
897
- disabled: o
929
+ type: E,
930
+ disabled: r
898
931
  } : k = {
899
932
  role: "button",
900
- tabIndex: o ? void 0 : 0,
901
- href: n === "a" && o ? void 0 : D,
902
- target: n === "a" ? O : void 0,
903
- type: n === "input" ? T : void 0,
904
- disabled: n === "input" ? o : void 0,
905
- "aria-disabled": !o || n === "input" ? void 0 : o,
933
+ tabIndex: r ? void 0 : 0,
934
+ href: n === "a" && r ? void 0 : O,
935
+ target: n === "a" ? C : void 0,
936
+ type: n === "input" ? E : void 0,
937
+ disabled: n === "input" ? r : void 0,
938
+ "aria-disabled": !r || n === "input" ? void 0 : r,
906
939
  rel: n === "a" ? A : void 0
907
940
  };
908
- let { pressProps: x, isPressed: w } = yt({
909
- onPressStart: u,
941
+ let { pressProps: N, isPressed: w } = wt({
942
+ onPressStart: l,
910
943
  onPressEnd: c,
911
944
  onPressChange: p,
912
945
  onPress: s,
913
946
  onPressUp: m,
914
- isDisabled: o,
915
- preventFocusOnPress: y,
947
+ isDisabled: r,
948
+ preventFocusOnPress: h,
916
949
  ref: t
917
- }), { focusableProps: v } = At(e, t);
918
- $ && (v.tabIndex = o ? -1 : v.tabIndex);
919
- let B = G(v, x, nt(e, {
950
+ }), { focusableProps: v } = Ft(e, t);
951
+ $ && (v.tabIndex = r ? -1 : v.tabIndex);
952
+ let T = H(v, N, at(e, {
920
953
  labelable: !0
921
954
  }));
922
955
  return {
923
956
  isPressed: w,
924
- buttonProps: G(k, B, {
957
+ buttonProps: H(k, T, {
925
958
  "aria-haspopup": e["aria-haspopup"],
926
959
  "aria-expanded": e["aria-expanded"],
927
960
  "aria-controls": e["aria-controls"],
928
961
  "aria-pressed": e["aria-pressed"],
929
- onClick: (P) => {
930
- I && (I(P), console.warn("onClick is deprecated, please use onPress"));
962
+ onClick: (B) => {
963
+ M && (M(B), console.warn("onClick is deprecated, please use onPress"));
931
964
  }
932
965
  })
933
966
  };
934
967
  }
935
- function Ft(e, t, n) {
968
+ function Ut(e, t, n) {
936
969
  return t in e ? Object.defineProperty(e, t, {
937
970
  value: n,
938
971
  enumerable: !0,
@@ -943,35 +976,35 @@ function Ft(e, t, n) {
943
976
  function Se(e, t) {
944
977
  var n = Object.keys(e);
945
978
  if (Object.getOwnPropertySymbols) {
946
- var o = Object.getOwnPropertySymbols(e);
947
- t && (o = o.filter(function(s) {
979
+ var r = Object.getOwnPropertySymbols(e);
980
+ t && (r = r.filter(function(s) {
948
981
  return Object.getOwnPropertyDescriptor(e, s).enumerable;
949
- })), n.push.apply(n, o);
982
+ })), n.push.apply(n, r);
950
983
  }
951
984
  return n;
952
985
  }
953
986
  function Ne(e) {
954
987
  for (var t = 1; t < arguments.length; t++) {
955
988
  var n = arguments[t] != null ? arguments[t] : {};
956
- t % 2 ? Se(Object(n), !0).forEach(function(o) {
957
- Ft(e, o, n[o]);
958
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Se(Object(n)).forEach(function(o) {
959
- Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(n, o));
989
+ t % 2 ? Se(Object(n), !0).forEach(function(r) {
990
+ Ut(e, r, n[r]);
991
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Se(Object(n)).forEach(function(r) {
992
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
960
993
  });
961
994
  }
962
995
  return e;
963
996
  }
964
- var Rt = (e, t, n) => {
965
- for (var o of Object.keys(e)) {
997
+ var Vt = (e, t, n) => {
998
+ for (var r of Object.keys(e)) {
966
999
  var s;
967
- if (e[o] !== ((s = t[o]) !== null && s !== void 0 ? s : n[o]))
1000
+ if (e[r] !== ((s = t[r]) !== null && s !== void 0 ? s : n[r]))
968
1001
  return !1;
969
1002
  }
970
1003
  return !0;
971
- }, Y = (e) => (t) => {
972
- var n = e.defaultClassName, o = Ne(Ne({}, e.defaultVariants), t);
973
- for (var s in o) {
974
- var u, c = (u = o[s]) !== null && u !== void 0 ? u : e.defaultVariants[s];
1004
+ }, J = (e) => (t) => {
1005
+ var n = e.defaultClassName, r = Ne(Ne({}, e.defaultVariants), t);
1006
+ for (var s in r) {
1007
+ var l, c = (l = r[s]) !== null && l !== void 0 ? l : e.defaultVariants[s];
975
1008
  if (c != null) {
976
1009
  var m = c;
977
1010
  typeof m == "boolean" && (m = m === !0 ? "true" : "false");
@@ -979,62 +1012,70 @@ var Rt = (e, t, n) => {
979
1012
  p && (n += " " + p);
980
1013
  }
981
1014
  }
982
- for (var [y, $] of e.compoundVariants)
983
- Rt(y, o, e.defaultVariants) && (n += " " + $);
1015
+ for (var [h, $] of e.compoundVariants)
1016
+ Vt(h, r, e.defaultVariants) && (n += " " + $);
984
1017
  return n;
985
- }, Ut = Y({ defaultClassName: "_125pcxy0", variantClassNames: { disabled: { true: "_125pcxy1", false: "_125pcxy2" }, kind: { default: "_125pcxy3", link: "_125pcxy4", confirm: "_125pcxy5", delete: "_125pcxy6", key: "_125pcxy7", icon: "_125pcxy8" }, spinning: { true: "_125pcxy9", false: "_125pcxya" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [[{ kind: "icon", spinning: !0 }, "_125pcxyb"], [{ kind: "default", spinning: !0 }, "_125pcxyc"], [{ kind: "confirm", spinning: !0 }, "_125pcxyd"], [{ kind: "delete", spinning: !0 }, "_125pcxye"], [{ kind: "key", spinning: !0 }, "_125pcxyf"], [{ disabled: !0, spinning: !1 }, "_125pcxyg"]] }), Vt = Y({ defaultClassName: "_125pcxyh", variantClassNames: { disabled: { true: "_125pcxyi", false: "_125pcxyj" }, kind: { icon: "_125pcxyk", default: "_125pcxyl", delete: "_125pcxym", key: "_125pcxyn", confirm: "_125pcxyo", link: "_125pcxyp" }, spinning: { true: "_125pcxyq", false: "_125pcxyr" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [] }), Gt = Y({ defaultClassName: "_125pcxyv", variantClassNames: { kind: { icon: "_125pcxyw", default: "_125pcxyx", key: "_125pcxyy", delete: "_125pcxyz", confirm: "_125pcxy10", link: "_125pcxy11" } }, defaultVariants: { kind: "default" }, compoundVariants: [] }), Wt = Y({ defaultClassName: "_125pcxy12", variantClassNames: { spinning: { true: "_125pcxy13", false: "_125pcxy14" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] }), Ht = Y({ defaultClassName: "_125pcxys", variantClassNames: { spinning: { true: "_125pcxyt", false: "_125pcxyu" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] });
986
- const Re = d.forwardRef(
1018
+ }, Gt = J({ defaultClassName: "_125pcxy0", variantClassNames: { disabled: { true: "_125pcxy1", false: "_125pcxy2" }, kind: { default: "_125pcxy3", link: "_125pcxy4", confirm: "_125pcxy5", delete: "_125pcxy6", key: "_125pcxy7", icon: "_125pcxy8" }, spinning: { true: "_125pcxy9", false: "_125pcxya" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [[{ kind: "icon", spinning: !0 }, "_125pcxyb"], [{ kind: "default", spinning: !0 }, "_125pcxyc"], [{ kind: "confirm", spinning: !0 }, "_125pcxyd"], [{ kind: "delete", spinning: !0 }, "_125pcxye"], [{ kind: "key", spinning: !0 }, "_125pcxyf"], [{ disabled: !0, spinning: !1 }, "_125pcxyg"]] }), Wt = J({ defaultClassName: "_125pcxyh", variantClassNames: { disabled: { true: "_125pcxyi", false: "_125pcxyj" }, kind: { icon: "_125pcxyk", default: "_125pcxyl", delete: "_125pcxym", key: "_125pcxyn", confirm: "_125pcxyo", link: "_125pcxyp" }, spinning: { true: "_125pcxyq", false: "_125pcxyr" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [] }), Ht = J({ defaultClassName: "_125pcxyv", variantClassNames: { kind: { icon: "_125pcxyw", default: "_125pcxyx", key: "_125pcxyy", delete: "_125pcxyz", confirm: "_125pcxy10", link: "_125pcxy11" } }, defaultVariants: { kind: "default" }, compoundVariants: [] }), jt = J({ defaultClassName: "_125pcxy12", variantClassNames: { spinning: { true: "_125pcxy13", false: "_125pcxy14" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] }), zt = J({ defaultClassName: "_125pcxys", variantClassNames: { spinning: { true: "_125pcxyt", false: "_125pcxyu" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] });
1019
+ const He = d.forwardRef(
987
1020
  ({
988
1021
  onClick: e,
989
1022
  onPress: t,
990
1023
  children: n,
991
- className: o,
1024
+ className: r,
992
1025
  isDisabled: s,
993
- disabled: u,
1026
+ disabled: l,
994
1027
  href: c,
995
1028
  icon: m,
996
1029
  kind: p = "default",
997
- spinning: y,
1030
+ spinning: h,
998
1031
  spinningTitle: $,
999
- title: I,
1000
- ...D
1001
- }, O) => {
1002
- var C;
1032
+ title: M,
1033
+ ...O
1034
+ }, C) => {
1035
+ var L;
1003
1036
  const A = {
1004
1037
  onPress: t != null ? t : e,
1005
- isDisabled: (C = u != null ? u : s) != null ? C : y,
1006
- ...D
1007
- }, { "data-testid": T } = D, k = O != null ? O : d.useRef(null), { buttonProps: x } = Mt(A, k), { t: w } = d.useContext(We), v = m && /* @__PURE__ */ d.createElement(He, {
1008
- className: Gt({ kind: p }),
1009
- icon: m,
1010
- "aria-hidden": "true",
1011
- "data-testid": `${T}__${m}-icon`
1012
- });
1013
- let B;
1014
- p === "default" || p === "icon" || p === "link" ? B = "dark" : B = "light";
1015
- const P = y && /* @__PURE__ */ d.createElement(je, {
1016
- color: B,
1017
- className: Wt({ spinning: y }),
1018
- title: $ || w("design-system:button.spinningTitle"),
1019
- "data-testid": `${T}__spinner`
1020
- });
1021
- return /* @__PURE__ */ d.createElement("div", {
1022
- className: ze(Ut({ disabled: s || u, kind: p, spinning: y }), o)
1023
- }, c ? /* @__PURE__ */ d.createElement("a", {
1024
- className: Ht({ spinning: y }),
1025
- ...D,
1026
- href: c,
1027
- title: I
1028
- }, v, n, P) : /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("button", {
1029
- className: Vt({ disabled: s || u, kind: p, spinning: y }),
1030
- disabled: s,
1031
- ...x,
1032
- ref: k,
1033
- title: I
1034
- }, v, n, P)));
1038
+ isDisabled: (L = l != null ? l : s) != null ? L : h,
1039
+ ...O
1040
+ }, { "data-testid": E } = O, k = C != null ? C : d.useRef(null), { buttonProps: N } = Rt(A, k), { t: w } = d.useContext(Xe), v = m && /* @__PURE__ */ d.createElement(qe, { className: Ht({ kind: p }), icon: m, "aria-hidden": "true", "data-testid": `${E}__${m}-icon` });
1041
+ let T;
1042
+ p === "default" || p === "icon" || p === "link" ? T = "dark" : T = "light";
1043
+ const B = h && /* @__PURE__ */ d.createElement(
1044
+ Je,
1045
+ {
1046
+ color: T,
1047
+ className: jt({ spinning: h }),
1048
+ title: $ || w("design-system:button.spinningTitle"),
1049
+ "data-testid": `${E}__spinner`
1050
+ }
1051
+ );
1052
+ return /* @__PURE__ */ d.createElement("div", { className: Qe(Gt({ disabled: s || l, kind: p, spinning: h }), r) }, c ? /* @__PURE__ */ d.createElement(
1053
+ "a",
1054
+ {
1055
+ className: zt({ spinning: h }),
1056
+ ...O,
1057
+ href: c,
1058
+ title: M
1059
+ },
1060
+ v,
1061
+ n,
1062
+ B
1063
+ ) : /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement(
1064
+ "button",
1065
+ {
1066
+ className: Wt({ disabled: s || l, kind: p, spinning: h }),
1067
+ disabled: s,
1068
+ ...N,
1069
+ ref: k,
1070
+ title: M
1071
+ },
1072
+ v,
1073
+ n,
1074
+ B
1075
+ )));
1035
1076
  }
1036
1077
  );
1037
- Ye.set(Re, {
1078
+ Ze.set(He, {
1038
1079
  name: "Buttons",
1039
1080
  props: {
1040
1081
  disabled: "boolean",
@@ -1049,41 +1090,13 @@ Ye.set(Re, {
1049
1090
  type: { type: '"button" | "submit"', default: '"button"' }
1050
1091
  }
1051
1092
  });
1052
- const jt = {
1053
- components: [Re],
1054
- description: () => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("div", {
1055
- className: "sps-body-14"
1056
- }, "Buttons are used to initiate events or actions. The labels and/or icons describe what the button will do."), /* @__PURE__ */ d.createElement("br", null), /* @__PURE__ */ d.createElement("h5", null, "Variants"), /* @__PURE__ */ d.createElement("div", {
1057
- className: "sps-body-14"
1058
- }, /* @__PURE__ */ d.createElement("span", {
1059
- className: "sps-text-semibold"
1060
- }, "Default: "), "For tertiary actions or actions of lower importance on a page."), /* @__PURE__ */ d.createElement("div", {
1061
- className: "sps-body-14"
1062
- }, /* @__PURE__ */ d.createElement("span", {
1063
- className: "sps-text-semibold"
1064
- }, "Key: "), "For primary or important actions on a page."), /* @__PURE__ */ d.createElement("div", {
1065
- className: "sps-body-14"
1066
- }, /* @__PURE__ */ d.createElement("span", {
1067
- className: "sps-text-semibold"
1068
- }, "Confirm: "), "For the main call to action on a page. There should only be one Confirm button per screen."), /* @__PURE__ */ d.createElement("div", {
1069
- className: "sps-body-14"
1070
- }, /* @__PURE__ */ d.createElement("span", {
1071
- className: "sps-text-semibold"
1072
- }, "Delete: "), "For deleting information or another destructive action. These should always be paired with a Delete Confirmation Modal."), /* @__PURE__ */ d.createElement("div", {
1073
- className: "sps-body-14"
1074
- }, /* @__PURE__ */ d.createElement("span", {
1075
- className: "sps-text-semibold"
1076
- }, "Disabled: "), "For actions that are not permitted in a particular state. These can be accompanied by a Tooltip on hover describing why it\u2019s disabled."), /* @__PURE__ */ d.createElement("div", {
1077
- className: "sps-body-14"
1078
- }, /* @__PURE__ */ d.createElement("span", {
1079
- className: "sps-text-semibold"
1080
- }, "With an Icon: "), "For further illustrating the action. Example: Pencil icon in an Edit button. There can also be Icon Buttons without text.")),
1093
+ const Yt = {
1094
+ components: [He],
1095
+ description: () => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("div", { className: "sps-body-14" }, "Buttons are used to initiate events or actions. The labels and/or icons describe what the button will do."), /* @__PURE__ */ d.createElement("br", null), /* @__PURE__ */ d.createElement("h5", null, "Variants"), /* @__PURE__ */ d.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ d.createElement("span", { className: "sps-text-semibold" }, "Default: "), "For tertiary actions or actions of lower importance on a page."), /* @__PURE__ */ d.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ d.createElement("span", { className: "sps-text-semibold" }, "Key: "), "For primary or important actions on a page."), /* @__PURE__ */ d.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ d.createElement("span", { className: "sps-text-semibold" }, "Confirm: "), "For the main call to action on a page. There should only be one Confirm button per screen."), /* @__PURE__ */ d.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ d.createElement("span", { className: "sps-text-semibold" }, "Delete: "), "For deleting information or another destructive action. These should always be paired with a Delete Confirmation Modal."), /* @__PURE__ */ d.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ d.createElement("span", { className: "sps-text-semibold" }, "Disabled: "), "For actions that are not permitted in a particular state. These can be accompanied by a Tooltip on hover describing why it\u2019s disabled."), /* @__PURE__ */ d.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ d.createElement("span", { className: "sps-text-semibold" }, "With an Icon: "), "For further illustrating the action. Example: Pencil icon in an Edit button. There can also be Icon Buttons without text.")),
1081
1096
  examples: {
1082
1097
  basic: {
1083
1098
  label: "Basic Buttons",
1084
- description: ({ NavigateTo: e }) => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("p", null, "The most common type of button that can be used in most cases. Example: Basic Buttons in a ", /* @__PURE__ */ d.createElement(e, {
1085
- to: "modals"
1086
- }, "Modal"), ".")),
1099
+ description: ({ NavigateTo: e }) => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("p", null, "The most common type of button that can be used in most cases. Example: Basic Buttons in a ", /* @__PURE__ */ d.createElement(e, { to: "modals" }, "Modal"), ".")),
1087
1100
  examples: {
1088
1101
  withoutIcons: {
1089
1102
  description: "Without Icons",
@@ -1358,11 +1371,7 @@ const jt = {
1358
1371
  },
1359
1372
  iconButtons: {
1360
1373
  label: "Icon Buttons",
1361
- description: ({ NavigateTo: e, Link: t }) => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("p", null, "Use these for quick actions that can clearly be articulated by the use of an icon. Example: A Print button in the", " ", /* @__PURE__ */ d.createElement(e, {
1362
- to: "list-action-bar"
1363
- }, "List Action Bar"), ". Do not use an icon that doesn't have a universally understood meaning; instead use a Basic Button or a Basic Button with an icon. ", /* @__PURE__ */ d.createElement(t, {
1364
- to: "/style-and-layout/icons/"
1365
- }, "View All Icons"))),
1374
+ description: ({ NavigateTo: e, Link: t }) => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("p", null, "Use these for quick actions that can clearly be articulated by the use of an icon. Example: A Print button in the", " ", /* @__PURE__ */ d.createElement(e, { to: "list-action-bar" }, "List Action Bar"), ". Do not use an icon that doesn't have a universally understood meaning; instead use a Basic Button or a Basic Button with an icon. ", /* @__PURE__ */ d.createElement(t, { to: "/style-and-layout/icons/" }, "View All Icons"))),
1366
1375
  examples: {
1367
1376
  standard: {
1368
1377
  description: "Standard Icon Buttons",
@@ -1388,9 +1397,7 @@ const jt = {
1388
1397
  `
1389
1398
  },
1390
1399
  dropdown: {
1391
- description: ({ NavigateTo: e }) => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("h5", null, "Dropdown Icon Buttons"), /* @__PURE__ */ d.createElement("p", null, "Use these when there are several options available for action. Example: Dropdown Icon Button in a ", /* @__PURE__ */ d.createElement(e, {
1392
- to: "content-rows"
1393
- }, "Content Row"), ".")),
1400
+ description: ({ NavigateTo: e }) => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("h5", null, "Dropdown Icon Buttons"), /* @__PURE__ */ d.createElement("p", null, "Use these when there are several options available for action. Example: Dropdown Icon Button in a ", /* @__PURE__ */ d.createElement(e, { to: "content-rows" }, "Content Row"), ".")),
1394
1401
  react: g`
1395
1402
  import { SpsDropdown } from "@spscommerce/ds-react";
1396
1403
 
@@ -1425,9 +1432,7 @@ const jt = {
1425
1432
  },
1426
1433
  textButtons: {
1427
1434
  label: "Text Buttons",
1428
- description: ({ NavigateTo: e }) => /* @__PURE__ */ d.createElement("p", null, "Use for less important actions, or ones that aren't taken as frequently. They should not appear inline with other copy. Example: Advanced Search button in the", " ", /* @__PURE__ */ d.createElement(e, {
1429
- to: "list-toolbar"
1430
- }, "List Toolbar")),
1435
+ description: ({ NavigateTo: e }) => /* @__PURE__ */ d.createElement("p", null, "Use for less important actions, or ones that aren't taken as frequently. They should not appear inline with other copy. Example: Advanced Search button in the", " ", /* @__PURE__ */ d.createElement(e, { to: "list-toolbar" }, "List Toolbar")),
1431
1436
  examples: {
1432
1437
  withoutIcons: {
1433
1438
  description: "Without Icons",
@@ -1481,9 +1486,7 @@ const jt = {
1481
1486
  },
1482
1487
  submitButtons: {
1483
1488
  label: "Submit Buttons",
1484
- description: ({ NavigateTo: e }) => /* @__PURE__ */ d.createElement("p", null, "Use to submit a form. There can be a number of visual variations, for example a", " ", /* @__PURE__ */ d.createElement(e, {
1485
- to: "modals"
1486
- }, "Modal"), " uses Basic Button (Key) as its Submit Button."),
1489
+ description: ({ NavigateTo: e }) => /* @__PURE__ */ d.createElement("p", null, "Use to submit a form. There can be a number of visual variations, for example a", " ", /* @__PURE__ */ d.createElement(e, { to: "modals" }, "Modal"), " uses Basic Button (Key) as its Submit Button."),
1487
1490
  examples: {
1488
1491
  basic: {
1489
1492
  react: g`
@@ -1532,9 +1535,7 @@ const jt = {
1532
1535
  },
1533
1536
  buttonGroups: {
1534
1537
  label: "Button Groups",
1535
- description: ({ NavigateTo: e }) => /* @__PURE__ */ d.createElement("p", null, "Use button groups when there are a number of actions that can be taken in a view. When there are multiple button types in a group, they are separated using dividers. Example: Button groups in ", /* @__PURE__ */ d.createElement(e, {
1536
- to: "List Action Bar"
1537
- }, "List Action Bar"), "."),
1538
+ description: ({ NavigateTo: e }) => /* @__PURE__ */ d.createElement("p", null, "Use button groups when there are a number of actions that can be taken in a view. When there are multiple button types in a group, they are separated using dividers. Example: Button groups in ", /* @__PURE__ */ d.createElement(e, { to: "List Action Bar" }, "List Action Bar"), "."),
1538
1539
  examples: {
1539
1540
  basic: {
1540
1541
  description: "Basic Button Groups",
@@ -1653,10 +1654,10 @@ const jt = {
1653
1654
  }
1654
1655
  }
1655
1656
  }
1656
- }, qt = {
1657
- Buttons: jt
1657
+ }, Qt = {
1658
+ Buttons: Yt
1658
1659
  };
1659
1660
  export {
1660
- Re as Button,
1661
- qt as MANIFEST
1661
+ He as Button,
1662
+ Qt as MANIFEST
1662
1663
  };