chop-logic-components 0.4.0 → 0.5.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/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import qe, { useState as ee, useEffect as Er, useRef as wr } from "react";
2
- var ve = { exports: {} }, I = {};
1
+ import Be, { useState as G, useEffect as re, useRef as wr } from "react";
2
+ var he = { exports: {} }, I = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.min.js
@@ -9,23 +9,23 @@ var ve = { exports: {} }, I = {};
9
9
  * This source code is licensed under the MIT license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
- var Ue;
12
+ var qe;
13
13
  function Rr() {
14
- if (Ue)
14
+ if (qe)
15
15
  return I;
16
- Ue = 1;
17
- var n = qe, f = Symbol.for("react.element"), o = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, l = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, b = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function p(m, d, y) {
19
- var c, R = {}, C = null, g = null;
16
+ qe = 1;
17
+ var r = Be, c = Symbol.for("react.element"), a = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, s = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function h(_, d, y) {
19
+ var u, R = {}, C = null, g = null;
20
20
  y !== void 0 && (C = "" + y), d.key !== void 0 && (C = "" + d.key), d.ref !== void 0 && (g = d.ref);
21
- for (c in d)
22
- s.call(d, c) && !b.hasOwnProperty(c) && (R[c] = d[c]);
23
- if (m && m.defaultProps)
24
- for (c in d = m.defaultProps, d)
25
- R[c] === void 0 && (R[c] = d[c]);
26
- return { $$typeof: f, type: m, key: C, ref: g, props: R, _owner: l.current };
21
+ for (u in d)
22
+ i.call(d, u) && !v.hasOwnProperty(u) && (R[u] = d[u]);
23
+ if (_ && _.defaultProps)
24
+ for (u in d = _.defaultProps, d)
25
+ R[u] === void 0 && (R[u] = d[u]);
26
+ return { $$typeof: c, type: _, key: C, ref: g, props: R, _owner: s.current };
27
27
  }
28
- return I.Fragment = o, I.jsx = p, I.jsxs = p, I;
28
+ return I.Fragment = a, I.jsx = h, I.jsxs = h, I;
29
29
  }
30
30
  var J = {};
31
31
  /**
@@ -40,88 +40,88 @@ var J = {};
40
40
  var Ve;
41
41
  function Cr() {
42
42
  return Ve || (Ve = 1, process.env.NODE_ENV !== "production" && function() {
43
- var n = qe, f = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), m = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), g = Symbol.for("react.offscreen"), k = Symbol.iterator, N = "@@iterator";
44
- function M(e) {
43
+ var r = Be, c = Symbol.for("react.element"), a = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), _ = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), g = Symbol.for("react.offscreen"), k = Symbol.iterator, N = "@@iterator";
44
+ function $(e) {
45
45
  if (e === null || typeof e != "object")
46
46
  return null;
47
- var r = k && e[k] || e[N];
48
- return typeof r == "function" ? r : null;
47
+ var t = k && e[k] || e[N];
48
+ return typeof t == "function" ? t : null;
49
49
  }
50
- var S = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
- function E(e) {
50
+ var S = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
+ function x(e) {
52
52
  {
53
- for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++)
54
- t[a - 1] = arguments[a];
55
- re("error", e, t);
53
+ for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), o = 1; o < t; o++)
54
+ n[o - 1] = arguments[o];
55
+ te("error", e, n);
56
56
  }
57
57
  }
58
- function re(e, r, t) {
58
+ function te(e, t, n) {
59
59
  {
60
- var a = S.ReactDebugCurrentFrame, _ = a.getStackAddendum();
61
- _ !== "" && (r += "%s", t = t.concat([_]));
62
- var v = t.map(function(u) {
63
- return String(u);
60
+ var o = S.ReactDebugCurrentFrame, p = o.getStackAddendum();
61
+ p !== "" && (t += "%s", n = n.concat([p]));
62
+ var b = n.map(function(f) {
63
+ return String(f);
64
64
  });
65
- v.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, v);
65
+ b.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, b);
66
66
  }
67
67
  }
68
- var ne = !1, G = !1, te = !1, Ke = !1, Ie = !1, be;
69
- be = Symbol.for("react.module.reference");
70
- function Je(e) {
71
- return !!(typeof e == "string" || typeof e == "function" || e === s || e === b || Ie || e === l || e === y || e === c || Ke || e === g || ne || G || te || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === R || e.$$typeof === p || e.$$typeof === m || e.$$typeof === d || // This needs to include all possible module reference object
68
+ var ne = !1, X = !1, ae = !1, Ie = !1, Je = !1, me;
69
+ me = Symbol.for("react.module.reference");
70
+ function Ge(e) {
71
+ return !!(typeof e == "string" || typeof e == "function" || e === i || e === v || Je || e === s || e === y || e === u || Ie || e === g || ne || X || ae || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === R || e.$$typeof === h || e.$$typeof === _ || e.$$typeof === d || // This needs to include all possible module reference object
72
72
  // types supported by any Flight configuration anywhere since
73
73
  // we don't know which Flight build this will end up being used
74
74
  // with.
75
- e.$$typeof === be || e.getModuleId !== void 0));
75
+ e.$$typeof === me || e.getModuleId !== void 0));
76
76
  }
77
- function Ge(e, r, t) {
78
- var a = e.displayName;
79
- if (a)
80
- return a;
81
- var _ = r.displayName || r.name || "";
82
- return _ !== "" ? t + "(" + _ + ")" : t;
77
+ function Xe(e, t, n) {
78
+ var o = e.displayName;
79
+ if (o)
80
+ return o;
81
+ var p = t.displayName || t.name || "";
82
+ return p !== "" ? n + "(" + p + ")" : n;
83
83
  }
84
- function me(e) {
84
+ function ge(e) {
85
85
  return e.displayName || "Context";
86
86
  }
87
87
  function D(e) {
88
88
  if (e == null)
89
89
  return null;
90
- if (typeof e.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
90
+ if (typeof e.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
91
91
  return e.displayName || e.name || null;
92
92
  if (typeof e == "string")
93
93
  return e;
94
94
  switch (e) {
95
- case s:
95
+ case i:
96
96
  return "Fragment";
97
- case o:
97
+ case a:
98
98
  return "Portal";
99
- case b:
99
+ case v:
100
100
  return "Profiler";
101
- case l:
101
+ case s:
102
102
  return "StrictMode";
103
103
  case y:
104
104
  return "Suspense";
105
- case c:
105
+ case u:
106
106
  return "SuspenseList";
107
107
  }
108
108
  if (typeof e == "object")
109
109
  switch (e.$$typeof) {
110
- case m:
111
- var r = e;
112
- return me(r) + ".Consumer";
113
- case p:
110
+ case _:
114
111
  var t = e;
115
- return me(t._context) + ".Provider";
112
+ return ge(t) + ".Consumer";
113
+ case h:
114
+ var n = e;
115
+ return ge(n._context) + ".Provider";
116
116
  case d:
117
- return Ge(e, e.render, "ForwardRef");
117
+ return Xe(e, e.render, "ForwardRef");
118
118
  case R:
119
- var a = e.displayName || null;
120
- return a !== null ? a : D(e.type) || "Memo";
119
+ var o = e.displayName || null;
120
+ return o !== null ? o : D(e.type) || "Memo";
121
121
  case C: {
122
- var _ = e, v = _._payload, u = _._init;
122
+ var p = e, b = p._payload, f = p._init;
123
123
  try {
124
- return D(u(v));
124
+ return D(f(b));
125
125
  } catch {
126
126
  return null;
127
127
  }
@@ -129,18 +129,18 @@ function Cr() {
129
129
  }
130
130
  return null;
131
131
  }
132
- var $ = Object.assign, B = 0, ge, ye, xe, Ee, we, Re, Ce;
133
- function ke() {
132
+ var A = Object.assign, V = 0, ye, Ee, xe, we, Re, Ce, ke;
133
+ function je() {
134
134
  }
135
- ke.__reactDisabledLog = !0;
136
- function Xe() {
135
+ je.__reactDisabledLog = !0;
136
+ function ze() {
137
137
  {
138
- if (B === 0) {
139
- ge = console.log, ye = console.info, xe = console.warn, Ee = console.error, we = console.group, Re = console.groupCollapsed, Ce = console.groupEnd;
138
+ if (V === 0) {
139
+ ye = console.log, Ee = console.info, xe = console.warn, we = console.error, Re = console.group, Ce = console.groupCollapsed, ke = console.groupEnd;
140
140
  var e = {
141
141
  configurable: !0,
142
142
  enumerable: !0,
143
- value: ke,
143
+ value: je,
144
144
  writable: !0
145
145
  };
146
146
  Object.defineProperties(console, {
@@ -153,336 +153,336 @@ function Cr() {
153
153
  groupEnd: e
154
154
  });
155
155
  }
156
- B++;
156
+ V++;
157
157
  }
158
158
  }
159
- function ze() {
159
+ function He() {
160
160
  {
161
- if (B--, B === 0) {
161
+ if (V--, V === 0) {
162
162
  var e = {
163
163
  configurable: !0,
164
164
  enumerable: !0,
165
165
  writable: !0
166
166
  };
167
167
  Object.defineProperties(console, {
168
- log: $({}, e, {
169
- value: ge
170
- }),
171
- info: $({}, e, {
168
+ log: A({}, e, {
172
169
  value: ye
173
170
  }),
174
- warn: $({}, e, {
175
- value: xe
176
- }),
177
- error: $({}, e, {
171
+ info: A({}, e, {
178
172
  value: Ee
179
173
  }),
180
- group: $({}, e, {
174
+ warn: A({}, e, {
175
+ value: xe
176
+ }),
177
+ error: A({}, e, {
181
178
  value: we
182
179
  }),
183
- groupCollapsed: $({}, e, {
180
+ group: A({}, e, {
184
181
  value: Re
185
182
  }),
186
- groupEnd: $({}, e, {
183
+ groupCollapsed: A({}, e, {
187
184
  value: Ce
185
+ }),
186
+ groupEnd: A({}, e, {
187
+ value: ke
188
188
  })
189
189
  });
190
190
  }
191
- B < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
191
+ V < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
192
  }
193
193
  }
194
- var ae = S.ReactCurrentDispatcher, oe;
195
- function X(e, r, t) {
194
+ var oe = S.ReactCurrentDispatcher, ie;
195
+ function z(e, t, n) {
196
196
  {
197
- if (oe === void 0)
197
+ if (ie === void 0)
198
198
  try {
199
199
  throw Error();
200
- } catch (_) {
201
- var a = _.stack.trim().match(/\n( *(at )?)/);
202
- oe = a && a[1] || "";
200
+ } catch (p) {
201
+ var o = p.stack.trim().match(/\n( *(at )?)/);
202
+ ie = o && o[1] || "";
203
203
  }
204
204
  return `
205
- ` + oe + e;
205
+ ` + ie + e;
206
206
  }
207
207
  }
208
- var ie = !1, z;
208
+ var se = !1, H;
209
209
  {
210
- var He = typeof WeakMap == "function" ? WeakMap : Map;
211
- z = new He();
210
+ var Ze = typeof WeakMap == "function" ? WeakMap : Map;
211
+ H = new Ze();
212
212
  }
213
- function je(e, r) {
214
- if (!e || ie)
213
+ function Te(e, t) {
214
+ if (!e || se)
215
215
  return "";
216
216
  {
217
- var t = z.get(e);
218
- if (t !== void 0)
219
- return t;
217
+ var n = H.get(e);
218
+ if (n !== void 0)
219
+ return n;
220
220
  }
221
- var a;
222
- ie = !0;
223
- var _ = Error.prepareStackTrace;
221
+ var o;
222
+ se = !0;
223
+ var p = Error.prepareStackTrace;
224
224
  Error.prepareStackTrace = void 0;
225
- var v;
226
- v = ae.current, ae.current = null, Xe();
225
+ var b;
226
+ b = oe.current, oe.current = null, ze();
227
227
  try {
228
- if (r) {
229
- var u = function() {
228
+ if (t) {
229
+ var f = function() {
230
230
  throw Error();
231
231
  };
232
- if (Object.defineProperty(u.prototype, "props", {
232
+ if (Object.defineProperty(f.prototype, "props", {
233
233
  set: function() {
234
234
  throw Error();
235
235
  }
236
236
  }), typeof Reflect == "object" && Reflect.construct) {
237
237
  try {
238
- Reflect.construct(u, []);
238
+ Reflect.construct(f, []);
239
239
  } catch (T) {
240
- a = T;
240
+ o = T;
241
241
  }
242
- Reflect.construct(e, [], u);
242
+ Reflect.construct(e, [], f);
243
243
  } else {
244
244
  try {
245
- u.call();
245
+ f.call();
246
246
  } catch (T) {
247
- a = T;
247
+ o = T;
248
248
  }
249
- e.call(u.prototype);
249
+ e.call(f.prototype);
250
250
  }
251
251
  } else {
252
252
  try {
253
253
  throw Error();
254
254
  } catch (T) {
255
- a = T;
255
+ o = T;
256
256
  }
257
257
  e();
258
258
  }
259
259
  } catch (T) {
260
- if (T && a && typeof T.stack == "string") {
261
- for (var i = T.stack.split(`
262
- `), j = a.stack.split(`
263
- `), x = i.length - 1, w = j.length - 1; x >= 1 && w >= 0 && i[x] !== j[w]; )
260
+ if (T && o && typeof T.stack == "string") {
261
+ for (var l = T.stack.split(`
262
+ `), j = o.stack.split(`
263
+ `), E = l.length - 1, w = j.length - 1; E >= 1 && w >= 0 && l[E] !== j[w]; )
264
264
  w--;
265
- for (; x >= 1 && w >= 0; x--, w--)
266
- if (i[x] !== j[w]) {
267
- if (x !== 1 || w !== 1)
265
+ for (; E >= 1 && w >= 0; E--, w--)
266
+ if (l[E] !== j[w]) {
267
+ if (E !== 1 || w !== 1)
268
268
  do
269
- if (x--, w--, w < 0 || i[x] !== j[w]) {
269
+ if (E--, w--, w < 0 || l[E] !== j[w]) {
270
270
  var O = `
271
- ` + i[x].replace(" at new ", " at ");
272
- return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && z.set(e, O), O;
271
+ ` + l[E].replace(" at new ", " at ");
272
+ return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && H.set(e, O), O;
273
273
  }
274
- while (x >= 1 && w >= 0);
274
+ while (E >= 1 && w >= 0);
275
275
  break;
276
276
  }
277
277
  }
278
278
  } finally {
279
- ie = !1, ae.current = v, ze(), Error.prepareStackTrace = _;
279
+ se = !1, oe.current = b, He(), Error.prepareStackTrace = p;
280
280
  }
281
- var Y = e ? e.displayName || e.name : "", A = Y ? X(Y) : "";
282
- return typeof e == "function" && z.set(e, A), A;
281
+ var U = e ? e.displayName || e.name : "", L = U ? z(U) : "";
282
+ return typeof e == "function" && H.set(e, L), L;
283
283
  }
284
- function Ze(e, r, t) {
285
- return je(e, !1);
284
+ function Qe(e, t, n) {
285
+ return Te(e, !1);
286
286
  }
287
- function Qe(e) {
288
- var r = e.prototype;
289
- return !!(r && r.isReactComponent);
287
+ function er(e) {
288
+ var t = e.prototype;
289
+ return !!(t && t.isReactComponent);
290
290
  }
291
- function H(e, r, t) {
291
+ function Z(e, t, n) {
292
292
  if (e == null)
293
293
  return "";
294
294
  if (typeof e == "function")
295
- return je(e, Qe(e));
295
+ return Te(e, er(e));
296
296
  if (typeof e == "string")
297
- return X(e);
297
+ return z(e);
298
298
  switch (e) {
299
299
  case y:
300
- return X("Suspense");
301
- case c:
302
- return X("SuspenseList");
300
+ return z("Suspense");
301
+ case u:
302
+ return z("SuspenseList");
303
303
  }
304
304
  if (typeof e == "object")
305
305
  switch (e.$$typeof) {
306
306
  case d:
307
- return Ze(e.render);
307
+ return Qe(e.render);
308
308
  case R:
309
- return H(e.type, r, t);
309
+ return Z(e.type, t, n);
310
310
  case C: {
311
- var a = e, _ = a._payload, v = a._init;
311
+ var o = e, p = o._payload, b = o._init;
312
312
  try {
313
- return H(v(_), r, t);
313
+ return Z(b(p), t, n);
314
314
  } catch {
315
315
  }
316
316
  }
317
317
  }
318
318
  return "";
319
319
  }
320
- var q = Object.prototype.hasOwnProperty, Te = {}, Se = S.ReactDebugCurrentFrame;
321
- function Z(e) {
320
+ var K = Object.prototype.hasOwnProperty, Se = {}, Oe = S.ReactDebugCurrentFrame;
321
+ function Q(e) {
322
322
  if (e) {
323
- var r = e._owner, t = H(e.type, e._source, r ? r.type : null);
324
- Se.setExtraStackFrame(t);
323
+ var t = e._owner, n = Z(e.type, e._source, t ? t.type : null);
324
+ Oe.setExtraStackFrame(n);
325
325
  } else
326
- Se.setExtraStackFrame(null);
326
+ Oe.setExtraStackFrame(null);
327
327
  }
328
- function er(e, r, t, a, _) {
328
+ function rr(e, t, n, o, p) {
329
329
  {
330
- var v = Function.call.bind(q);
331
- for (var u in e)
332
- if (v(e, u)) {
333
- var i = void 0;
330
+ var b = Function.call.bind(K);
331
+ for (var f in e)
332
+ if (b(e, f)) {
333
+ var l = void 0;
334
334
  try {
335
- if (typeof e[u] != "function") {
336
- var j = Error((a || "React class") + ": " + t + " type `" + u + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[u] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
335
+ if (typeof e[f] != "function") {
336
+ var j = Error((o || "React class") + ": " + n + " type `" + f + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[f] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
337
  throw j.name = "Invariant Violation", j;
338
338
  }
339
- i = e[u](r, u, a, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
- } catch (x) {
341
- i = x;
339
+ l = e[f](t, f, o, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
+ } catch (E) {
341
+ l = E;
342
342
  }
343
- i && !(i instanceof Error) && (Z(_), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", a || "React class", t, u, typeof i), Z(null)), i instanceof Error && !(i.message in Te) && (Te[i.message] = !0, Z(_), E("Failed %s type: %s", t, i.message), Z(null));
343
+ l && !(l instanceof Error) && (Q(p), x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", o || "React class", n, f, typeof l), Q(null)), l instanceof Error && !(l.message in Se) && (Se[l.message] = !0, Q(p), x("Failed %s type: %s", n, l.message), Q(null));
344
344
  }
345
345
  }
346
346
  }
347
- var rr = Array.isArray;
348
- function se(e) {
349
- return rr(e);
347
+ var tr = Array.isArray;
348
+ function ce(e) {
349
+ return tr(e);
350
350
  }
351
351
  function nr(e) {
352
352
  {
353
- var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
354
- return t;
353
+ var t = typeof Symbol == "function" && Symbol.toStringTag, n = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
354
+ return n;
355
355
  }
356
356
  }
357
- function tr(e) {
357
+ function ar(e) {
358
358
  try {
359
- return Oe(e), !1;
359
+ return Pe(e), !1;
360
360
  } catch {
361
361
  return !0;
362
362
  }
363
363
  }
364
- function Oe(e) {
364
+ function Pe(e) {
365
365
  return "" + e;
366
366
  }
367
- function Pe(e) {
368
- if (tr(e))
369
- return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", nr(e)), Oe(e);
367
+ function De(e) {
368
+ if (ar(e))
369
+ return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", nr(e)), Pe(e);
370
370
  }
371
- var K = S.ReactCurrentOwner, ar = {
371
+ var B = S.ReactCurrentOwner, or = {
372
372
  key: !0,
373
373
  ref: !0,
374
374
  __self: !0,
375
375
  __source: !0
376
- }, De, Fe, ce;
377
- ce = {};
378
- function or(e) {
379
- if (q.call(e, "ref")) {
380
- var r = Object.getOwnPropertyDescriptor(e, "ref").get;
381
- if (r && r.isReactWarning)
376
+ }, Fe, Ne, le;
377
+ le = {};
378
+ function ir(e) {
379
+ if (K.call(e, "ref")) {
380
+ var t = Object.getOwnPropertyDescriptor(e, "ref").get;
381
+ if (t && t.isReactWarning)
382
382
  return !1;
383
383
  }
384
384
  return e.ref !== void 0;
385
385
  }
386
- function ir(e) {
387
- if (q.call(e, "key")) {
388
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
389
- if (r && r.isReactWarning)
386
+ function sr(e) {
387
+ if (K.call(e, "key")) {
388
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
389
+ if (t && t.isReactWarning)
390
390
  return !1;
391
391
  }
392
392
  return e.key !== void 0;
393
393
  }
394
- function sr(e, r) {
395
- if (typeof e.ref == "string" && K.current && r && K.current.stateNode !== r) {
396
- var t = D(K.current.type);
397
- ce[t] || (E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', D(K.current.type), e.ref), ce[t] = !0);
394
+ function cr(e, t) {
395
+ if (typeof e.ref == "string" && B.current && t && B.current.stateNode !== t) {
396
+ var n = D(B.current.type);
397
+ le[n] || (x('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', D(B.current.type), e.ref), le[n] = !0);
398
398
  }
399
399
  }
400
- function cr(e, r) {
400
+ function lr(e, t) {
401
401
  {
402
- var t = function() {
403
- De || (De = !0, E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
402
+ var n = function() {
403
+ Fe || (Fe = !0, x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
404
404
  };
405
- t.isReactWarning = !0, Object.defineProperty(e, "key", {
406
- get: t,
405
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
406
+ get: n,
407
407
  configurable: !0
408
408
  });
409
409
  }
410
410
  }
411
- function lr(e, r) {
411
+ function ur(e, t) {
412
412
  {
413
- var t = function() {
414
- Fe || (Fe = !0, E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
413
+ var n = function() {
414
+ Ne || (Ne = !0, x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
415
415
  };
416
- t.isReactWarning = !0, Object.defineProperty(e, "ref", {
417
- get: t,
416
+ n.isReactWarning = !0, Object.defineProperty(e, "ref", {
417
+ get: n,
418
418
  configurable: !0
419
419
  });
420
420
  }
421
421
  }
422
- var ur = function(e, r, t, a, _, v, u) {
423
- var i = {
422
+ var fr = function(e, t, n, o, p, b, f) {
423
+ var l = {
424
424
  // This tag allows us to uniquely identify this as a React Element
425
- $$typeof: f,
425
+ $$typeof: c,
426
426
  // Built-in properties that belong on the element
427
427
  type: e,
428
- key: r,
429
- ref: t,
430
- props: u,
428
+ key: t,
429
+ ref: n,
430
+ props: f,
431
431
  // Record the component responsible for creating this element.
432
- _owner: v
432
+ _owner: b
433
433
  };
434
- return i._store = {}, Object.defineProperty(i._store, "validated", {
434
+ return l._store = {}, Object.defineProperty(l._store, "validated", {
435
435
  configurable: !1,
436
436
  enumerable: !1,
437
437
  writable: !0,
438
438
  value: !1
439
- }), Object.defineProperty(i, "_self", {
439
+ }), Object.defineProperty(l, "_self", {
440
440
  configurable: !1,
441
441
  enumerable: !1,
442
442
  writable: !1,
443
- value: a
444
- }), Object.defineProperty(i, "_source", {
443
+ value: o
444
+ }), Object.defineProperty(l, "_source", {
445
445
  configurable: !1,
446
446
  enumerable: !1,
447
447
  writable: !1,
448
- value: _
449
- }), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
448
+ value: p
449
+ }), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
450
450
  };
451
- function fr(e, r, t, a, _) {
451
+ function dr(e, t, n, o, p) {
452
452
  {
453
- var v, u = {}, i = null, j = null;
454
- t !== void 0 && (Pe(t), i = "" + t), ir(r) && (Pe(r.key), i = "" + r.key), or(r) && (j = r.ref, sr(r, _));
455
- for (v in r)
456
- q.call(r, v) && !ar.hasOwnProperty(v) && (u[v] = r[v]);
453
+ var b, f = {}, l = null, j = null;
454
+ n !== void 0 && (De(n), l = "" + n), sr(t) && (De(t.key), l = "" + t.key), ir(t) && (j = t.ref, cr(t, p));
455
+ for (b in t)
456
+ K.call(t, b) && !or.hasOwnProperty(b) && (f[b] = t[b]);
457
457
  if (e && e.defaultProps) {
458
- var x = e.defaultProps;
459
- for (v in x)
460
- u[v] === void 0 && (u[v] = x[v]);
458
+ var E = e.defaultProps;
459
+ for (b in E)
460
+ f[b] === void 0 && (f[b] = E[b]);
461
461
  }
462
- if (i || j) {
462
+ if (l || j) {
463
463
  var w = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
464
- i && cr(u, w), j && lr(u, w);
464
+ l && lr(f, w), j && ur(f, w);
465
465
  }
466
- return ur(e, i, j, _, a, K.current, u);
466
+ return fr(e, l, j, p, o, B.current, f);
467
467
  }
468
468
  }
469
- var le = S.ReactCurrentOwner, Ne = S.ReactDebugCurrentFrame;
470
- function W(e) {
469
+ var ue = S.ReactCurrentOwner, $e = S.ReactDebugCurrentFrame;
470
+ function Y(e) {
471
471
  if (e) {
472
- var r = e._owner, t = H(e.type, e._source, r ? r.type : null);
473
- Ne.setExtraStackFrame(t);
472
+ var t = e._owner, n = Z(e.type, e._source, t ? t.type : null);
473
+ $e.setExtraStackFrame(n);
474
474
  } else
475
- Ne.setExtraStackFrame(null);
475
+ $e.setExtraStackFrame(null);
476
476
  }
477
- var ue;
478
- ue = !1;
479
- function fe(e) {
480
- return typeof e == "object" && e !== null && e.$$typeof === f;
477
+ var fe;
478
+ fe = !1;
479
+ function de(e) {
480
+ return typeof e == "object" && e !== null && e.$$typeof === c;
481
481
  }
482
- function $e() {
482
+ function Ae() {
483
483
  {
484
- if (le.current) {
485
- var e = D(le.current.type);
484
+ if (ue.current) {
485
+ var e = D(ue.current.type);
486
486
  if (e)
487
487
  return `
488
488
 
@@ -491,462 +491,496 @@ Check the render method of \`` + e + "`.";
491
491
  return "";
492
492
  }
493
493
  }
494
- function dr(e) {
494
+ function _r(e) {
495
495
  return "";
496
496
  }
497
- var Ae = {};
498
- function _r(e) {
497
+ var Le = {};
498
+ function pr(e) {
499
499
  {
500
- var r = $e();
501
- if (!r) {
502
- var t = typeof e == "string" ? e : e.displayName || e.name;
503
- t && (r = `
500
+ var t = Ae();
501
+ if (!t) {
502
+ var n = typeof e == "string" ? e : e.displayName || e.name;
503
+ n && (t = `
504
504
 
505
- Check the top-level render call using <` + t + ">.");
505
+ Check the top-level render call using <` + n + ">.");
506
506
  }
507
- return r;
507
+ return t;
508
508
  }
509
509
  }
510
- function Le(e, r) {
510
+ function Me(e, t) {
511
511
  {
512
512
  if (!e._store || e._store.validated || e.key != null)
513
513
  return;
514
514
  e._store.validated = !0;
515
- var t = _r(r);
516
- if (Ae[t])
515
+ var n = pr(t);
516
+ if (Le[n])
517
517
  return;
518
- Ae[t] = !0;
519
- var a = "";
520
- e && e._owner && e._owner !== le.current && (a = " It was passed a child from " + D(e._owner.type) + "."), W(e), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, a), W(null);
518
+ Le[n] = !0;
519
+ var o = "";
520
+ e && e._owner && e._owner !== ue.current && (o = " It was passed a child from " + D(e._owner.type) + "."), Y(e), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, o), Y(null);
521
521
  }
522
522
  }
523
- function Me(e, r) {
523
+ function We(e, t) {
524
524
  {
525
525
  if (typeof e != "object")
526
526
  return;
527
- if (se(e))
528
- for (var t = 0; t < e.length; t++) {
529
- var a = e[t];
530
- fe(a) && Le(a, r);
527
+ if (ce(e))
528
+ for (var n = 0; n < e.length; n++) {
529
+ var o = e[n];
530
+ de(o) && Me(o, t);
531
531
  }
532
- else if (fe(e))
532
+ else if (de(e))
533
533
  e._store && (e._store.validated = !0);
534
534
  else if (e) {
535
- var _ = M(e);
536
- if (typeof _ == "function" && _ !== e.entries)
537
- for (var v = _.call(e), u; !(u = v.next()).done; )
538
- fe(u.value) && Le(u.value, r);
535
+ var p = $(e);
536
+ if (typeof p == "function" && p !== e.entries)
537
+ for (var b = p.call(e), f; !(f = b.next()).done; )
538
+ de(f.value) && Me(f.value, t);
539
539
  }
540
540
  }
541
541
  }
542
- function pr(e) {
542
+ function vr(e) {
543
543
  {
544
- var r = e.type;
545
- if (r == null || typeof r == "string")
544
+ var t = e.type;
545
+ if (t == null || typeof t == "string")
546
546
  return;
547
- var t;
548
- if (typeof r == "function")
549
- t = r.propTypes;
550
- else if (typeof r == "object" && (r.$$typeof === d || // Note: Memo only checks outer props here.
547
+ var n;
548
+ if (typeof t == "function")
549
+ n = t.propTypes;
550
+ else if (typeof t == "object" && (t.$$typeof === d || // Note: Memo only checks outer props here.
551
551
  // Inner props are checked in the reconciler.
552
- r.$$typeof === R))
553
- t = r.propTypes;
552
+ t.$$typeof === R))
553
+ n = t.propTypes;
554
554
  else
555
555
  return;
556
- if (t) {
557
- var a = D(r);
558
- er(t, e.props, "prop", a, e);
559
- } else if (r.PropTypes !== void 0 && !ue) {
560
- ue = !0;
561
- var _ = D(r);
562
- E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _ || "Unknown");
556
+ if (n) {
557
+ var o = D(t);
558
+ rr(n, e.props, "prop", o, e);
559
+ } else if (t.PropTypes !== void 0 && !fe) {
560
+ fe = !0;
561
+ var p = D(t);
562
+ x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
563
563
  }
564
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
564
+ typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
565
565
  }
566
566
  }
567
- function vr(e) {
567
+ function hr(e) {
568
568
  {
569
- for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
570
- var a = r[t];
571
- if (a !== "children" && a !== "key") {
572
- W(e), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", a), W(null);
569
+ for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
570
+ var o = t[n];
571
+ if (o !== "children" && o !== "key") {
572
+ Y(e), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), Y(null);
573
573
  break;
574
574
  }
575
575
  }
576
- e.ref !== null && (W(e), E("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
576
+ e.ref !== null && (Y(e), x("Invalid attribute `ref` supplied to `React.Fragment`."), Y(null));
577
577
  }
578
578
  }
579
- var We = {};
580
- function Ye(e, r, t, a, _, v) {
579
+ var Ye = {};
580
+ function Ue(e, t, n, o, p, b) {
581
581
  {
582
- var u = Je(e);
583
- if (!u) {
584
- var i = "";
585
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
586
- var j = dr();
587
- j ? i += j : i += $e();
588
- var x;
589
- e === null ? x = "null" : se(e) ? x = "array" : e !== void 0 && e.$$typeof === f ? (x = "<" + (D(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : x = typeof e, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", x, i);
582
+ var f = Ge(e);
583
+ if (!f) {
584
+ var l = "";
585
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (l += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
586
+ var j = _r();
587
+ j ? l += j : l += Ae();
588
+ var E;
589
+ e === null ? E = "null" : ce(e) ? E = "array" : e !== void 0 && e.$$typeof === c ? (E = "<" + (D(e.type) || "Unknown") + " />", l = " Did you accidentally export a JSX literal instead of a component?") : E = typeof e, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", E, l);
590
590
  }
591
- var w = fr(e, r, t, _, v);
591
+ var w = dr(e, t, n, p, b);
592
592
  if (w == null)
593
593
  return w;
594
- if (u) {
595
- var O = r.children;
594
+ if (f) {
595
+ var O = t.children;
596
596
  if (O !== void 0)
597
- if (a)
598
- if (se(O)) {
599
- for (var Y = 0; Y < O.length; Y++)
600
- Me(O[Y], e);
597
+ if (o)
598
+ if (ce(O)) {
599
+ for (var U = 0; U < O.length; U++)
600
+ We(O[U], e);
601
601
  Object.freeze && Object.freeze(O);
602
602
  } else
603
- E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
603
+ x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
604
604
  else
605
- Me(O, e);
605
+ We(O, e);
606
606
  }
607
- if (q.call(r, "key")) {
608
- var A = D(e), T = Object.keys(r).filter(function(xr) {
607
+ if (K.call(t, "key")) {
608
+ var L = D(e), T = Object.keys(t).filter(function(xr) {
609
609
  return xr !== "key";
610
- }), de = T.length > 0 ? "{key: someKey, " + T.join(": ..., ") + ": ...}" : "{key: someKey}";
611
- if (!We[A + de]) {
612
- var yr = T.length > 0 ? "{" + T.join(": ..., ") + ": ...}" : "{}";
613
- E(`A props object containing a "key" prop is being spread into JSX:
610
+ }), _e = T.length > 0 ? "{key: someKey, " + T.join(": ..., ") + ": ...}" : "{key: someKey}";
611
+ if (!Ye[L + _e]) {
612
+ var Er = T.length > 0 ? "{" + T.join(": ..., ") + ": ...}" : "{}";
613
+ x(`A props object containing a "key" prop is being spread into JSX:
614
614
  let props = %s;
615
615
  <%s {...props} />
616
616
  React keys must be passed directly to JSX without using spread:
617
617
  let props = %s;
618
- <%s key={someKey} {...props} />`, de, A, yr, A), We[A + de] = !0;
618
+ <%s key={someKey} {...props} />`, _e, L, Er, L), Ye[L + _e] = !0;
619
619
  }
620
620
  }
621
- return e === s ? vr(w) : pr(w), w;
621
+ return e === i ? hr(w) : vr(w), w;
622
622
  }
623
623
  }
624
- function hr(e, r, t) {
625
- return Ye(e, r, t, !0);
624
+ function br(e, t, n) {
625
+ return Ue(e, t, n, !0);
626
626
  }
627
- function br(e, r, t) {
628
- return Ye(e, r, t, !1);
627
+ function mr(e, t, n) {
628
+ return Ue(e, t, n, !1);
629
629
  }
630
- var mr = br, gr = hr;
631
- J.Fragment = s, J.jsx = mr, J.jsxs = gr;
630
+ var gr = mr, yr = br;
631
+ J.Fragment = i, J.jsx = gr, J.jsxs = yr;
632
632
  }()), J;
633
633
  }
634
- process.env.NODE_ENV === "production" ? ve.exports = Rr() : ve.exports = Cr();
635
- var h = ve.exports;
636
- const kr = "_button_rrb70_1", jr = "_text_rrb70_21", Tr = "_primary_rrb70_26", Sr = "_danger_rrb70_27", Or = "_secondary_rrb70_50", Pr = "_disabled_rrb70_66", U = {
634
+ process.env.NODE_ENV === "production" ? he.exports = Rr() : he.exports = Cr();
635
+ var m = he.exports;
636
+ const kr = "_button_11cqj_1", jr = "_text_11cqj_21", Tr = "_primary_11cqj_26", Sr = "_danger_11cqj_27", Or = "_secondary_11cqj_50", Pr = "_icon_11cqj_66", Dr = "_disabled_11cqj_80", M = {
637
637
  button: kr,
638
638
  text: jr,
639
639
  primary: Tr,
640
640
  danger: Sr,
641
641
  secondary: Or,
642
- disabled: Pr
642
+ icon: Pr,
643
+ disabled: Dr
643
644
  };
644
- function P(n) {
645
- return n.map((o) => {
646
- if (typeof o == "string")
647
- return o.trim();
648
- if (typeof o == "object") {
649
- const s = [];
650
- for (const l in o)
651
- o[l] && s.push(l.trim());
652
- return s.join(" ");
653
- }
654
- }).filter((o) => !!o).join(" ");
645
+ function P(r) {
646
+ return r.map((a) => {
647
+ if (typeof a == "string")
648
+ return a.trim();
649
+ if (typeof a == "object") {
650
+ const i = [];
651
+ for (const s in a)
652
+ a[s] && i.push(s.trim());
653
+ return i.join(" ");
654
+ }
655
+ }).filter((a) => !!a).join(" ");
655
656
  }
656
- const ln = ({ disabled: n, onClick: f, text: o = "Ok", type: s = "button", view: l = "primary", icon: b, ...p }) => {
657
- const m = P([
658
- U.button,
659
- p == null ? void 0 : p.className,
657
+ const ut = ({ disabled: r, onClick: c, text: a, type: i = "button", view: s = "primary", icon: v, label: h, ..._ }) => {
658
+ const d = P([
659
+ M.button,
660
+ _ == null ? void 0 : _.className,
660
661
  {
661
- [U.primary]: l === "primary",
662
- [U.secondary]: l === "secondary",
663
- [U.danger]: l === "danger",
664
- [U.disabled]: !!n
662
+ [M.primary]: s === "primary",
663
+ [M.secondary]: s === "secondary",
664
+ [M.danger]: s === "danger",
665
+ [M.icon]: s === "icon",
666
+ [M.disabled]: !!r
665
667
  }
666
668
  ]);
667
- return /* @__PURE__ */ h.jsxs("button", { type: s, className: m, onClick: n ? void 0 : f, disabled: n, ...p, children: [
668
- b && /* @__PURE__ */ h.jsx("span", { className: b, "aria-hidden": "true" }),
669
- /* @__PURE__ */ h.jsx("span", { className: U.text, children: o })
669
+ return /* @__PURE__ */ m.jsxs("button", { "aria-label": h, type: i, className: d, onClick: r ? void 0 : c, disabled: r, ..._, children: [
670
+ v && /* @__PURE__ */ m.jsx("span", { className: v, "aria-hidden": "true" }),
671
+ s !== "icon" && /* @__PURE__ */ m.jsx("span", { className: M.text, children: a })
670
672
  ] });
671
- }, Dr = "_container_b5mrn_1", Fr = "_wrapper_b5mrn_7", Nr = "_input_b5mrn_21", $r = "_invalid_b5mrn_27", Ar = "_error_b5mrn_47", Lr = "_disabled_b5mrn_51", L = {
672
- container: Dr,
673
- wrapper: Fr,
674
- input: Nr,
675
- invalid: $r,
676
- error: Ar,
677
- disabled: Lr
678
- }, Mr = "_label_16gin_1", Wr = "_text_16gin_10", Yr = "_required_16gin_16", _e = {
679
- label: Mr,
680
- text: Wr,
681
- required: Yr
682
- }, he = ({
683
- label: n,
684
- required: f,
685
- inputId: o,
686
- className: s,
687
- isTextHidden: l = !1
688
- }) => /* @__PURE__ */ h.jsxs("label", { htmlFor: o, className: P([_e.label, s]), children: [
689
- !l && /* @__PURE__ */ h.jsx("span", { className: _e.text, children: n }),
690
- f && /* @__PURE__ */ h.jsx("abbr", { title: "required", className: _e.required, children: "*" })
691
- ] }), Ur = "_message_1ly5l_1", Vr = "_visible_1ly5l_8", Be = {
692
- message: Ur,
673
+ }, Fr = "_container_b5mrn_1", Nr = "_wrapper_b5mrn_7", $r = "_input_b5mrn_21", Ar = "_invalid_b5mrn_27", Lr = "_error_b5mrn_47", Mr = "_disabled_b5mrn_51", W = {
674
+ container: Fr,
675
+ wrapper: Nr,
676
+ input: $r,
677
+ invalid: Ar,
678
+ error: Lr,
679
+ disabled: Mr
680
+ }, Wr = "_label_16gin_1", Yr = "_text_16gin_10", Ur = "_required_16gin_16", pe = {
681
+ label: Wr,
682
+ text: Yr,
683
+ required: Ur
684
+ }, be = ({
685
+ label: r,
686
+ required: c,
687
+ inputId: a,
688
+ className: i,
689
+ isTextHidden: s = !1
690
+ }) => /* @__PURE__ */ m.jsxs("label", { htmlFor: a, className: P([pe.label, i]), children: [
691
+ !s && /* @__PURE__ */ m.jsx("span", { className: pe.text, children: r }),
692
+ c && /* @__PURE__ */ m.jsx("abbr", { title: "required", className: pe.required, children: "*" })
693
+ ] }), qr = "_message_1ly5l_1", Vr = "_visible_1ly5l_8", Ke = {
694
+ message: qr,
693
695
  visible: Vr
694
- }, Br = ({
695
- errorId: n,
696
- message: f = "Invalid input",
697
- className: o,
698
- visible: s = !1
699
- }) => /* @__PURE__ */ h.jsx("span", { id: n, className: P([Be.message, o, { [Be.visible]: s }]), children: f }), un = ({
700
- id: n,
701
- name: f,
702
- label: o,
703
- disabled: s,
704
- placeholder: l = "Type here...",
705
- valid: b = !0,
706
- required: p = !1,
707
- errorMessage: m,
696
+ }, Kr = ({
697
+ errorId: r,
698
+ message: c = "Invalid input",
699
+ className: a,
700
+ visible: i = !1
701
+ }) => /* @__PURE__ */ m.jsx("span", { id: r, className: P([Ke.message, a, { [Ke.visible]: i }]), children: c }), ft = ({
702
+ id: r,
703
+ name: c,
704
+ label: a,
705
+ disabled: i,
706
+ placeholder: s = "Type here...",
707
+ valid: v = !0,
708
+ required: h = !1,
709
+ errorMessage: _,
708
710
  defaultValue: d,
709
711
  onChange: y,
710
- ...c
712
+ ...u
711
713
  }) => {
712
- const [R, C] = ee(typeof d == "string" ? d : ""), g = `${n}_error`, k = P([L.container, c == null ? void 0 : c.className]), N = P([
713
- L.wrapper,
714
+ const [R, C] = G(typeof d == "string" ? d : ""), g = `${r}_error`, k = P([W.container, u == null ? void 0 : u.className]), N = P([
715
+ W.wrapper,
714
716
  {
715
- [L.disabled]: !!s,
716
- [L.invalid]: !b
717
+ [W.disabled]: !!i,
718
+ [W.invalid]: !v
717
719
  }
718
- ]), M = (S) => {
719
- const { value: E = "" } = S.target;
720
- C(E), y && y(S);
720
+ ]), $ = (S) => {
721
+ const { value: x = "" } = S.target;
722
+ C(x), y && y(S);
721
723
  };
722
- return /* @__PURE__ */ h.jsxs("div", { className: k, children: [
723
- /* @__PURE__ */ h.jsxs("div", { className: N, children: [
724
- /* @__PURE__ */ h.jsx(he, { label: o, required: p, inputId: n, className: L.label }),
725
- /* @__PURE__ */ h.jsx(
724
+ return /* @__PURE__ */ m.jsxs("div", { className: k, children: [
725
+ /* @__PURE__ */ m.jsxs("div", { className: N, children: [
726
+ /* @__PURE__ */ m.jsx(be, { label: a, required: h, inputId: r, className: W.label }),
727
+ /* @__PURE__ */ m.jsx(
726
728
  "input",
727
729
  {
728
- id: n,
729
- name: f,
730
+ id: r,
731
+ name: c,
730
732
  type: "text",
731
- className: L.input,
732
- disabled: s,
733
- placeholder: l,
734
- required: p,
735
- "aria-invalid": !b,
733
+ className: W.input,
734
+ disabled: i,
735
+ placeholder: s,
736
+ required: h,
737
+ "aria-invalid": !v,
736
738
  "aria-errormessage": g,
737
739
  value: R,
738
- onChange: M,
739
- ...c
740
+ onChange: $,
741
+ ...u
740
742
  }
741
743
  )
742
744
  ] }),
743
- /* @__PURE__ */ h.jsx(Br, { errorId: g, message: m, className: L.error, visible: !b })
745
+ /* @__PURE__ */ m.jsx(Kr, { errorId: g, message: _, className: W.error, visible: !v })
744
746
  ] });
745
- }, qr = "_wrapper_gevmw_1", Kr = "_combobox_gevmw_17", Ir = "_combobox_label_gevmw_42", Jr = "_dropdown_gevmw_47", Gr = "_dropdown_opened_gevmw_68", Xr = "_option_gevmw_73", zr = "_active_gevmw_82", Hr = "_disabled_gevmw_91", Zr = "_icon_gevmw_97", F = {
746
- wrapper: qr,
747
- combobox: Kr,
748
- combobox_label: Ir,
749
- dropdown: Jr,
750
- dropdown_opened: Gr,
751
- option: Xr,
752
- active: zr,
753
- disabled: Hr,
754
- icon: Zr
755
- }, Qr = ({ ref: n, onClickOutsideHandler: f, dependentRef: o }) => {
756
- Er(() => {
757
- const s = (l) => {
758
- const b = (n == null ? void 0 : n.current) && !n.current.contains(l.target), p = o != null && o.current ? !o.current.contains(l.target) : !0;
759
- b && p && f();
747
+ }, Br = "_wrapper_gevmw_1", Ir = "_combobox_gevmw_17", Jr = "_combobox_label_gevmw_42", Gr = "_dropdown_gevmw_47", Xr = "_dropdown_opened_gevmw_68", zr = "_option_gevmw_73", Hr = "_active_gevmw_82", Zr = "_disabled_gevmw_91", Qr = "_icon_gevmw_97", F = {
748
+ wrapper: Br,
749
+ combobox: Ir,
750
+ combobox_label: Jr,
751
+ dropdown: Gr,
752
+ dropdown_opened: Xr,
753
+ option: zr,
754
+ active: Hr,
755
+ disabled: Zr,
756
+ icon: Qr
757
+ }, et = ({ ref: r, onClickOutsideHandler: c, dependentRef: a }) => {
758
+ re(() => {
759
+ const i = (s) => {
760
+ const v = (r == null ? void 0 : r.current) && !r.current.contains(s.target), h = a != null && a.current ? !a.current.contains(s.target) : !0;
761
+ v && h && c();
760
762
  };
761
- return document.addEventListener("mousedown", s), () => {
762
- document.removeEventListener("mousedown", s);
763
+ return document.addEventListener("mousedown", i), () => {
764
+ document.removeEventListener("mousedown", i);
763
765
  };
764
- }, [n, o, f]);
766
+ }, [r, a, c]);
765
767
  };
766
- var V = /* @__PURE__ */ ((n) => (n.CheckMark = "chop-icon__check", n.Home = "chop-icon__home", n.Menu = "chop-icon__menu", n.Enlarge = "chop-icon__enlarge2", n.Shrink = "chop-icon__shrink2", n.Settings = "chop-icon__cog", n.Delete = "chop-icon__bin2", n.Up = "chop-icon__circle-up", n.Down = "chop-icon__circle-down", n.Right = "chop-icon__circle-right", n.Left = "chop-icon__circle-left", n.Sound = "chop-icon__volume-medium", n.NoSound = "chop-icon__volume-mute2", n.LightMode = "chop-icon__sun", n.DarkMode = "chop-icon__contrast", n.Cancel = "chop-icon__close", n.Sidebar = "chop-icon__magic-wand", n.Telegram = "chop-icon__telegram", n.Github = "chop-icon__github", n.Mail = "chop-icon__mail4", n.Propositions = "chop-icon__cube", n.Resolution = "chop-icon__libreoffice", n.Predicates = "chop-icon__cubes", n.TruthTables = "chop-icon__delicious", n.Syllogisms = "chop-icon__dice", n.English = "chop-icon__english-lang", n.Russian = "chop-icon__russian-lang", n.Required = "chop-icon__fire", n.Checked = "chop-icon__checkbox-checked", n.Unchecked = "chop-icon__checkbox-unchecked", n.Info = "chop-icon__exclamation-triangle", n.LinkedIn = "chop-icon__linkedin-square", n.File = "chop-icon__file-empty", n.Files = "chop-icon__files-empty", n.Facebook = "chop-icon__facebook2", n.CaretUp = "chop-icon__caret-up", n.CaretDown = "chop-icon__caret-down", n.SavePDF = "chop-icon__file-pdf", n.ExportXML = "chop-icon__download", n.ImportXML = "chop-icon__upload", n.Copy = "chop-icon__copy", n.Paste = "chop-icon__paste", n.Cut = "chop-icon__scissors", n.Reset = "chop-icon__trash", n.Clear = "chop-icon__cross", n))(V || {});
767
- const en = ({
768
- isOpened: n,
769
- onClick: f,
770
- comboboxId: o,
771
- dropdownId: s,
772
- selected: l,
773
- name: b,
774
- placeholder: p,
775
- disabled: m,
768
+ var q = /* @__PURE__ */ ((r) => (r.CheckMark = "chop-icon__check", r.Home = "chop-icon__home", r.Menu = "chop-icon__menu", r.Enlarge = "chop-icon__enlarge2", r.Shrink = "chop-icon__shrink2", r.Settings = "chop-icon__cog", r.Delete = "chop-icon__bin2", r.Up = "chop-icon__circle-up", r.Down = "chop-icon__circle-down", r.Right = "chop-icon__circle-right", r.Left = "chop-icon__circle-left", r.Sound = "chop-icon__volume-medium", r.NoSound = "chop-icon__volume-mute2", r.LightMode = "chop-icon__sun", r.DarkMode = "chop-icon__contrast", r.Cancel = "chop-icon__close", r.Sidebar = "chop-icon__magic-wand", r.Telegram = "chop-icon__telegram", r.Github = "chop-icon__github", r.Mail = "chop-icon__mail4", r.Propositions = "chop-icon__cube", r.Resolution = "chop-icon__libreoffice", r.Predicates = "chop-icon__cubes", r.TruthTables = "chop-icon__delicious", r.Syllogisms = "chop-icon__dice", r.English = "chop-icon__english-lang", r.Russian = "chop-icon__russian-lang", r.Required = "chop-icon__fire", r.Checked = "chop-icon__checkbox-checked", r.Unchecked = "chop-icon__checkbox-unchecked", r.Info = "chop-icon__exclamation-triangle", r.LinkedIn = "chop-icon__linkedin-square", r.File = "chop-icon__file-empty", r.Files = "chop-icon__files-empty", r.Facebook = "chop-icon__facebook2", r.CaretUp = "chop-icon__caret-up", r.CaretDown = "chop-icon__caret-down", r.SavePDF = "chop-icon__file-pdf", r.ExportXML = "chop-icon__download", r.ImportXML = "chop-icon__upload", r.Copy = "chop-icon__copy", r.Paste = "chop-icon__paste", r.Cut = "chop-icon__scissors", r.Reset = "chop-icon__trash", r.Clear = "chop-icon__cross", r))(q || {});
769
+ const rt = ({
770
+ isOpened: r,
771
+ onClick: c,
772
+ comboboxId: a,
773
+ dropdownId: i,
774
+ selected: s,
775
+ name: v,
776
+ placeholder: h,
777
+ disabled: _,
776
778
  required: d
777
779
  }) => {
778
- const y = P([F.icon, { [V.CaretUp]: n, [V.CaretDown]: !n }]);
779
- return /* @__PURE__ */ h.jsxs(
780
+ const y = P([F.icon, { [q.CaretUp]: r, [q.CaretDown]: !r }]);
781
+ return /* @__PURE__ */ m.jsxs(
780
782
  "button",
781
783
  {
782
784
  type: "button",
783
- name: b,
784
- value: l == null ? void 0 : l.id,
785
+ name: v,
786
+ value: s == null ? void 0 : s.id,
785
787
  role: "combobox",
786
788
  "aria-haspopup": "listbox",
787
- "aria-expanded": n,
788
- "aria-controls": s,
789
- id: o,
789
+ "aria-expanded": r,
790
+ "aria-controls": i,
791
+ id: a,
790
792
  className: F.combobox,
791
- onClick: f,
792
- disabled: m,
793
+ onClick: c,
794
+ disabled: _,
793
795
  "aria-required": d,
794
796
  children: [
795
- /* @__PURE__ */ h.jsx("span", { className: F.combobox_label, children: (l == null ? void 0 : l.label) ?? p }),
796
- /* @__PURE__ */ h.jsx("span", { className: y, "aria-hidden": "true" })
797
+ /* @__PURE__ */ m.jsx("span", { className: F.combobox_label, children: (s == null ? void 0 : s.label) ?? h }),
798
+ /* @__PURE__ */ m.jsx("span", { className: y, "aria-hidden": "true" })
797
799
  ]
798
800
  }
799
801
  );
800
802
  };
801
- function pe(n) {
802
- const f = document.getElementById(n);
803
- f && f.focus();
803
+ function ve(r) {
804
+ const c = document.getElementById(r);
805
+ c && c.focus();
804
806
  }
805
- const rn = ({ value: n, isSelected: f, onSelect: o }) => {
806
- const { id: s, label: l } = n, b = P([F.icon, V.CheckMark]), p = (m) => (d) => {
807
+ const tt = ({ value: r, isSelected: c, onSelect: a }) => {
808
+ const { id: i, label: s } = r, v = P([F.icon, q.CheckMark]), h = (_) => (d) => {
807
809
  switch (d.key) {
808
810
  case " ":
809
811
  case "SpaceBar":
810
812
  case "Enter":
811
- d.preventDefault(), o(m);
813
+ d.preventDefault(), a(_);
812
814
  break;
813
815
  }
814
816
  };
815
- return /* @__PURE__ */ h.jsxs(
817
+ return /* @__PURE__ */ m.jsxs(
816
818
  "li",
817
819
  {
818
- id: s,
820
+ id: i,
819
821
  role: "option",
820
822
  className: F.option,
821
- "aria-selected": f,
823
+ "aria-selected": c,
822
824
  tabIndex: 0,
823
- onKeyDown: p(s),
824
- onClick: () => o(s),
825
+ onKeyDown: h(i),
826
+ onClick: () => a(i),
825
827
  children: [
826
- /* @__PURE__ */ h.jsx("span", { children: l }),
827
- f && /* @__PURE__ */ h.jsx("span", { className: b, "aria-hidden": "true" })
828
+ /* @__PURE__ */ m.jsx("span", { children: s }),
829
+ c && /* @__PURE__ */ m.jsx("span", { className: v, "aria-hidden": "true" })
828
830
  ]
829
831
  }
830
832
  );
831
- }, nn = ({ values: n, isOpened: f, onClose: o, onSelect: s, dropdownId: l, comboboxId: b, selected: p }) => {
832
- const m = P([F.dropdown, { [F.dropdown_opened]: f }]), d = (c) => {
833
- s(c), o(), pe(b);
834
- }, y = (c) => {
833
+ }, nt = ({ values: r, isOpened: c, onClose: a, onSelect: i, dropdownId: s, comboboxId: v, selected: h }) => {
834
+ const _ = P([F.dropdown, { [F.dropdown_opened]: c }]), d = (u) => {
835
+ i(u), a(), ve(v);
836
+ }, y = (u) => {
835
837
  let R = "";
836
- n.forEach((g) => {
838
+ r.forEach((g) => {
837
839
  document.getElementById(g.id) === document.activeElement && (R = g.id);
838
840
  });
839
- const C = n.findIndex((g) => g.id === R);
840
- switch (c.key) {
841
+ const C = r.findIndex((g) => g.id === R);
842
+ switch (u.key) {
841
843
  case "Escape":
842
- c.preventDefault(), o();
844
+ u.preventDefault(), a();
843
845
  break;
844
846
  case "ArrowUp": {
845
- c.preventDefault();
846
- const g = C - 1 >= 0 ? C - 1 : n.length - 1, k = n[g];
847
- k && pe(k.id);
847
+ u.preventDefault();
848
+ const g = C - 1 >= 0 ? C - 1 : r.length - 1, k = r[g];
849
+ k && ve(k.id);
848
850
  break;
849
851
  }
850
852
  case "ArrowDown":
851
853
  case "Tab": {
852
- c.preventDefault();
853
- const g = C === n.length - 1 ? 0 : C + 1, k = n[g];
854
- k && pe(k.id);
854
+ u.preventDefault();
855
+ const g = C === r.length - 1 ? 0 : C + 1, k = r[g];
856
+ k && ve(k.id);
855
857
  break;
856
858
  }
857
859
  }
858
860
  };
859
- return /* @__PURE__ */ h.jsx("ul", { className: m, role: "listbox", id: l, tabIndex: -1, onKeyDown: y, children: n.map((c) => /* @__PURE__ */ h.jsx(rn, { value: c, onSelect: () => d(c.id), isSelected: c.id === (p == null ? void 0 : p.id) }, c.id)) });
860
- }, fn = ({
861
- id: n,
862
- values: f,
863
- onSelectChange: o,
864
- name: s,
865
- label: l,
866
- required: b = !1,
867
- placeholder: p = "Not selected",
868
- disabled: m = !1,
861
+ return /* @__PURE__ */ m.jsx("ul", { className: _, role: "listbox", id: s, tabIndex: -1, onKeyDown: y, children: r.map((u) => /* @__PURE__ */ m.jsx(tt, { value: u, onSelect: () => d(u.id), isSelected: u.id === (h == null ? void 0 : h.id) }, u.id)) });
862
+ }, at = ({ ref: r, keyCode: c, onKeyPress: a }) => {
863
+ re(() => {
864
+ const i = (s) => {
865
+ (s == null ? void 0 : s.code) === c && (r != null && r.current) && a();
866
+ };
867
+ return document.addEventListener("keydown", i, !1), () => {
868
+ document.removeEventListener("keydown", i, !1);
869
+ };
870
+ }, [r, c, a]);
871
+ }, dt = ({
872
+ id: r,
873
+ values: c,
874
+ onSelectChange: a,
875
+ name: i,
876
+ label: s,
877
+ required: v = !1,
878
+ placeholder: h = "Not selected",
879
+ disabled: _ = !1,
869
880
  ...d
870
881
  }) => {
871
- const [y, c] = ee(!1), [R, C] = ee(), g = `${n}_combobox`, k = `${n}_dropdown`, N = P([F.wrapper, d == null ? void 0 : d.className, { [F.disabled]: m }]), M = wr(null), S = () => c(!1), E = () => c(!y), re = (ne) => {
872
- const G = f.find((te) => te.id === ne);
873
- C(G), o == null || o(G);
882
+ const [y, u] = G(!1), [R, C] = G(), g = `${r}_combobox`, k = `${r}_dropdown`, N = P([F.wrapper, d == null ? void 0 : d.className, { [F.disabled]: _ }]), $ = wr(null), S = () => u(!1), x = () => u(!y), te = (ne) => {
883
+ const X = c.find((ae) => ae.id === ne);
884
+ C(X), a == null || a(X);
874
885
  };
875
- return Qr({ ref: M, onClickOutsideHandler: S }), /* @__PURE__ */ h.jsxs("div", { className: N, ref: M, children: [
876
- /* @__PURE__ */ h.jsx(he, { label: l, required: b, inputId: g, className: F.label }),
877
- /* @__PURE__ */ h.jsx(
878
- en,
886
+ return et({ ref: $, onClickOutsideHandler: S }), at({ keyCode: "Escape", ref: $, onKeyPress: S }), /* @__PURE__ */ m.jsxs("div", { className: N, ref: $, children: [
887
+ /* @__PURE__ */ m.jsx(be, { label: s, required: v, inputId: g, className: F.label }),
888
+ /* @__PURE__ */ m.jsx(
889
+ rt,
879
890
  {
880
- name: s,
891
+ name: i,
881
892
  isOpened: y,
882
893
  comboboxId: g,
883
894
  dropdownId: k,
884
- onClick: E,
895
+ onClick: x,
885
896
  selected: R,
886
- placeholder: p,
887
- disabled: m,
888
- required: b
897
+ placeholder: h,
898
+ disabled: _,
899
+ required: v
889
900
  }
890
901
  ),
891
- /* @__PURE__ */ h.jsx(
892
- nn,
902
+ /* @__PURE__ */ m.jsx(
903
+ nt,
893
904
  {
894
- values: f,
905
+ values: c,
895
906
  selected: R,
896
907
  isOpened: y,
897
908
  onClose: S,
898
909
  dropdownId: k,
899
910
  comboboxId: g,
900
- onSelect: re
911
+ onSelect: te
901
912
  }
902
913
  )
903
914
  ] });
904
- }, tn = "_wrapper_1ab48_1", an = "_input_1ab48_9", on = "_label_1ab48_23", sn = "_disabled_1ab48_38", Q = {
905
- wrapper: tn,
906
- input: an,
907
- label: on,
908
- disabled: sn
909
- }, dn = ({
910
- id: n,
911
- name: f,
912
- label: o,
913
- disabled: s,
914
- required: l = !1,
915
- onChange: b,
916
- isLabelHidden: p,
917
- className: m,
915
+ }, ot = "_wrapper_1ab48_1", it = "_input_1ab48_9", st = "_label_1ab48_23", ct = "_disabled_1ab48_38", ee = {
916
+ wrapper: ot,
917
+ input: it,
918
+ label: st,
919
+ disabled: ct
920
+ }, _t = ({
921
+ id: r,
922
+ name: c,
923
+ label: a,
924
+ disabled: i,
925
+ required: s = !1,
926
+ onChange: v,
927
+ isLabelHidden: h,
928
+ className: _,
918
929
  ...d
919
930
  }) => {
920
- const [y, c] = ee(!1), R = P([Q.wrapper, m, { [Q.disabled]: !!s }]), C = P([Q.label, { [V.Checked]: y, [V.Unchecked]: !y }]), g = (k) => {
921
- if (s)
931
+ const [y, u] = G(!1), R = P([ee.wrapper, _, { [ee.disabled]: !!i }]), C = P([ee.label, { [q.Checked]: y, [q.Unchecked]: !y }]), g = (k) => {
932
+ if (i)
922
933
  return;
923
934
  const N = k.target.checked;
924
- c(N), b && b(k);
935
+ u(N), v && v(k);
925
936
  };
926
- return /* @__PURE__ */ h.jsxs("div", { className: R, children: [
927
- /* @__PURE__ */ h.jsx(
937
+ return /* @__PURE__ */ m.jsxs("div", { className: R, children: [
938
+ /* @__PURE__ */ m.jsx(
928
939
  "input",
929
940
  {
930
- id: n,
931
- name: f,
941
+ id: r,
942
+ name: c,
932
943
  type: "checkbox",
933
- className: Q.input,
934
- disabled: s,
935
- required: l,
944
+ className: ee.input,
945
+ disabled: i,
946
+ required: s,
936
947
  checked: y,
937
948
  onChange: g,
938
- "aria-label": p ? o : void 0,
949
+ "aria-label": h ? a : void 0,
939
950
  ...d
940
951
  }
941
952
  ),
942
- /* @__PURE__ */ h.jsx(he, { label: o, required: l, inputId: n, className: C, isTextHidden: p })
953
+ /* @__PURE__ */ m.jsx(be, { label: a, required: s, inputId: r, className: C, isTextHidden: h })
943
954
  ] });
955
+ }, pt = (r, c = 300) => {
956
+ const [a, i] = G(!1);
957
+ return re(() => {
958
+ r && !a ? i(!0) : !r && a && setTimeout(() => {
959
+ i(!1);
960
+ }, c);
961
+ }, [r]), a;
962
+ }, vt = ({ modalRef: r, isOpened: c }) => {
963
+ re(() => {
964
+ const a = r.current;
965
+ if (!c || !a)
966
+ return;
967
+ const i = a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'), s = i[0], v = i[i.length - 1], h = (_) => {
968
+ _.key === "Tab" && (_.shiftKey && document.activeElement === s ? (_.preventDefault(), v.focus()) : !_.shiftKey && document.activeElement === v && (_.preventDefault(), s.focus()));
969
+ };
970
+ return a.addEventListener("keydown", h), () => {
971
+ a.removeEventListener("keydown", h);
972
+ };
973
+ }, [r, c]);
944
974
  };
945
975
  export {
946
- V as ChopIcon,
947
- ln as ChopLogicButton,
948
- dn as ChopLogicCheckbox,
949
- fn as ChopLogicSelect,
950
- un as ChopLogicTextInput
976
+ q as ChopIcon,
977
+ ut as ChopLogicButton,
978
+ _t as ChopLogicCheckbox,
979
+ dt as ChopLogicSelect,
980
+ ft as ChopLogicTextInput,
981
+ et as useClickOutside,
982
+ at as useKeyPress,
983
+ vt as useModalFocusTrap,
984
+ pt as useMount
951
985
  };
952
986
  //# sourceMappingURL=index.es.js.map