@rubenpazch/autocomplete 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/Autocomplete.d.ts +43 -0
- package/dist/Autocomplete.d.ts.map +1 -0
- package/dist/index.cjs.js +1141 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +1139 -0
- package/package.json +45 -0
|
@@ -0,0 +1,1141 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var require$$0 = require('react');
|
|
4
|
+
|
|
5
|
+
var jsxRuntime$1 = {exports: {}};
|
|
6
|
+
|
|
7
|
+
var reactJsxRuntime_production$1 = {};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
var hasRequiredReactJsxRuntime_production$1;
|
|
20
|
+
|
|
21
|
+
function requireReactJsxRuntime_production$1 () {
|
|
22
|
+
if (hasRequiredReactJsxRuntime_production$1) return reactJsxRuntime_production$1;
|
|
23
|
+
hasRequiredReactJsxRuntime_production$1 = 1;
|
|
24
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
25
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
26
|
+
function jsxProd(type, config, maybeKey) {
|
|
27
|
+
var key = null;
|
|
28
|
+
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
29
|
+
void 0 !== config.key && (key = "" + config.key);
|
|
30
|
+
if ("key" in config) {
|
|
31
|
+
maybeKey = {};
|
|
32
|
+
for (var propName in config)
|
|
33
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
34
|
+
} else maybeKey = config;
|
|
35
|
+
config = maybeKey.ref;
|
|
36
|
+
return {
|
|
37
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
38
|
+
type: type,
|
|
39
|
+
key: key,
|
|
40
|
+
ref: void 0 !== config ? config : null,
|
|
41
|
+
props: maybeKey
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
reactJsxRuntime_production$1.Fragment = REACT_FRAGMENT_TYPE;
|
|
45
|
+
reactJsxRuntime_production$1.jsx = jsxProd;
|
|
46
|
+
reactJsxRuntime_production$1.jsxs = jsxProd;
|
|
47
|
+
return reactJsxRuntime_production$1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var reactJsxRuntime_development$1 = {};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @license React
|
|
54
|
+
* react-jsx-runtime.development.js
|
|
55
|
+
*
|
|
56
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the MIT license found in the
|
|
59
|
+
* LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
var hasRequiredReactJsxRuntime_development$1;
|
|
63
|
+
|
|
64
|
+
function requireReactJsxRuntime_development$1 () {
|
|
65
|
+
if (hasRequiredReactJsxRuntime_development$1) return reactJsxRuntime_development$1;
|
|
66
|
+
hasRequiredReactJsxRuntime_development$1 = 1;
|
|
67
|
+
"production" !== process.env.NODE_ENV &&
|
|
68
|
+
(function () {
|
|
69
|
+
function getComponentNameFromType(type) {
|
|
70
|
+
if (null == type) return null;
|
|
71
|
+
if ("function" === typeof type)
|
|
72
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE
|
|
73
|
+
? null
|
|
74
|
+
: type.displayName || type.name || null;
|
|
75
|
+
if ("string" === typeof type) return type;
|
|
76
|
+
switch (type) {
|
|
77
|
+
case REACT_FRAGMENT_TYPE:
|
|
78
|
+
return "Fragment";
|
|
79
|
+
case REACT_PROFILER_TYPE:
|
|
80
|
+
return "Profiler";
|
|
81
|
+
case REACT_STRICT_MODE_TYPE:
|
|
82
|
+
return "StrictMode";
|
|
83
|
+
case REACT_SUSPENSE_TYPE:
|
|
84
|
+
return "Suspense";
|
|
85
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
86
|
+
return "SuspenseList";
|
|
87
|
+
case REACT_ACTIVITY_TYPE:
|
|
88
|
+
return "Activity";
|
|
89
|
+
}
|
|
90
|
+
if ("object" === typeof type)
|
|
91
|
+
switch (
|
|
92
|
+
("number" === typeof type.tag &&
|
|
93
|
+
console.error(
|
|
94
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
95
|
+
),
|
|
96
|
+
type.$$typeof)
|
|
97
|
+
) {
|
|
98
|
+
case REACT_PORTAL_TYPE:
|
|
99
|
+
return "Portal";
|
|
100
|
+
case REACT_CONTEXT_TYPE:
|
|
101
|
+
return type.displayName || "Context";
|
|
102
|
+
case REACT_CONSUMER_TYPE:
|
|
103
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
104
|
+
case REACT_FORWARD_REF_TYPE:
|
|
105
|
+
var innerType = type.render;
|
|
106
|
+
type = type.displayName;
|
|
107
|
+
type ||
|
|
108
|
+
((type = innerType.displayName || innerType.name || ""),
|
|
109
|
+
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
|
|
110
|
+
return type;
|
|
111
|
+
case REACT_MEMO_TYPE:
|
|
112
|
+
return (
|
|
113
|
+
(innerType = type.displayName || null),
|
|
114
|
+
null !== innerType
|
|
115
|
+
? innerType
|
|
116
|
+
: getComponentNameFromType(type.type) || "Memo"
|
|
117
|
+
);
|
|
118
|
+
case REACT_LAZY_TYPE:
|
|
119
|
+
innerType = type._payload;
|
|
120
|
+
type = type._init;
|
|
121
|
+
try {
|
|
122
|
+
return getComponentNameFromType(type(innerType));
|
|
123
|
+
} catch (x) {}
|
|
124
|
+
}
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
function testStringCoercion(value) {
|
|
128
|
+
return "" + value;
|
|
129
|
+
}
|
|
130
|
+
function checkKeyStringCoercion(value) {
|
|
131
|
+
try {
|
|
132
|
+
testStringCoercion(value);
|
|
133
|
+
var JSCompiler_inline_result = !1;
|
|
134
|
+
} catch (e) {
|
|
135
|
+
JSCompiler_inline_result = true;
|
|
136
|
+
}
|
|
137
|
+
if (JSCompiler_inline_result) {
|
|
138
|
+
JSCompiler_inline_result = console;
|
|
139
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
140
|
+
var JSCompiler_inline_result$jscomp$0 =
|
|
141
|
+
("function" === typeof Symbol &&
|
|
142
|
+
Symbol.toStringTag &&
|
|
143
|
+
value[Symbol.toStringTag]) ||
|
|
144
|
+
value.constructor.name ||
|
|
145
|
+
"Object";
|
|
146
|
+
JSCompiler_temp_const.call(
|
|
147
|
+
JSCompiler_inline_result,
|
|
148
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
149
|
+
JSCompiler_inline_result$jscomp$0
|
|
150
|
+
);
|
|
151
|
+
return testStringCoercion(value);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function getTaskName(type) {
|
|
155
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
156
|
+
if (
|
|
157
|
+
"object" === typeof type &&
|
|
158
|
+
null !== type &&
|
|
159
|
+
type.$$typeof === REACT_LAZY_TYPE
|
|
160
|
+
)
|
|
161
|
+
return "<...>";
|
|
162
|
+
try {
|
|
163
|
+
var name = getComponentNameFromType(type);
|
|
164
|
+
return name ? "<" + name + ">" : "<...>";
|
|
165
|
+
} catch (x) {
|
|
166
|
+
return "<...>";
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function getOwner() {
|
|
170
|
+
var dispatcher = ReactSharedInternals.A;
|
|
171
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
172
|
+
}
|
|
173
|
+
function UnknownOwner() {
|
|
174
|
+
return Error("react-stack-top-frame");
|
|
175
|
+
}
|
|
176
|
+
function hasValidKey(config) {
|
|
177
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
178
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
179
|
+
if (getter && getter.isReactWarning) return false;
|
|
180
|
+
}
|
|
181
|
+
return void 0 !== config.key;
|
|
182
|
+
}
|
|
183
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
184
|
+
function warnAboutAccessingKey() {
|
|
185
|
+
specialPropKeyWarningShown ||
|
|
186
|
+
((specialPropKeyWarningShown = true),
|
|
187
|
+
console.error(
|
|
188
|
+
"%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://react.dev/link/special-props)",
|
|
189
|
+
displayName
|
|
190
|
+
));
|
|
191
|
+
}
|
|
192
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
193
|
+
Object.defineProperty(props, "key", {
|
|
194
|
+
get: warnAboutAccessingKey,
|
|
195
|
+
configurable: true
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
199
|
+
var componentName = getComponentNameFromType(this.type);
|
|
200
|
+
didWarnAboutElementRef[componentName] ||
|
|
201
|
+
((didWarnAboutElementRef[componentName] = true),
|
|
202
|
+
console.error(
|
|
203
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
204
|
+
));
|
|
205
|
+
componentName = this.props.ref;
|
|
206
|
+
return void 0 !== componentName ? componentName : null;
|
|
207
|
+
}
|
|
208
|
+
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
209
|
+
var refProp = props.ref;
|
|
210
|
+
type = {
|
|
211
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
212
|
+
type: type,
|
|
213
|
+
key: key,
|
|
214
|
+
props: props,
|
|
215
|
+
_owner: owner
|
|
216
|
+
};
|
|
217
|
+
null !== (void 0 !== refProp ? refProp : null)
|
|
218
|
+
? Object.defineProperty(type, "ref", {
|
|
219
|
+
enumerable: false,
|
|
220
|
+
get: elementRefGetterWithDeprecationWarning
|
|
221
|
+
})
|
|
222
|
+
: Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
223
|
+
type._store = {};
|
|
224
|
+
Object.defineProperty(type._store, "validated", {
|
|
225
|
+
configurable: false,
|
|
226
|
+
enumerable: false,
|
|
227
|
+
writable: true,
|
|
228
|
+
value: 0
|
|
229
|
+
});
|
|
230
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
231
|
+
configurable: false,
|
|
232
|
+
enumerable: false,
|
|
233
|
+
writable: true,
|
|
234
|
+
value: null
|
|
235
|
+
});
|
|
236
|
+
Object.defineProperty(type, "_debugStack", {
|
|
237
|
+
configurable: false,
|
|
238
|
+
enumerable: false,
|
|
239
|
+
writable: true,
|
|
240
|
+
value: debugStack
|
|
241
|
+
});
|
|
242
|
+
Object.defineProperty(type, "_debugTask", {
|
|
243
|
+
configurable: false,
|
|
244
|
+
enumerable: false,
|
|
245
|
+
writable: true,
|
|
246
|
+
value: debugTask
|
|
247
|
+
});
|
|
248
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
249
|
+
return type;
|
|
250
|
+
}
|
|
251
|
+
function jsxDEVImpl(
|
|
252
|
+
type,
|
|
253
|
+
config,
|
|
254
|
+
maybeKey,
|
|
255
|
+
isStaticChildren,
|
|
256
|
+
debugStack,
|
|
257
|
+
debugTask
|
|
258
|
+
) {
|
|
259
|
+
var children = config.children;
|
|
260
|
+
if (void 0 !== children)
|
|
261
|
+
if (isStaticChildren)
|
|
262
|
+
if (isArrayImpl(children)) {
|
|
263
|
+
for (
|
|
264
|
+
isStaticChildren = 0;
|
|
265
|
+
isStaticChildren < children.length;
|
|
266
|
+
isStaticChildren++
|
|
267
|
+
)
|
|
268
|
+
validateChildKeys(children[isStaticChildren]);
|
|
269
|
+
Object.freeze && Object.freeze(children);
|
|
270
|
+
} else
|
|
271
|
+
console.error(
|
|
272
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
273
|
+
);
|
|
274
|
+
else validateChildKeys(children);
|
|
275
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
276
|
+
children = getComponentNameFromType(type);
|
|
277
|
+
var keys = Object.keys(config).filter(function (k) {
|
|
278
|
+
return "key" !== k;
|
|
279
|
+
});
|
|
280
|
+
isStaticChildren =
|
|
281
|
+
0 < keys.length
|
|
282
|
+
? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
|
|
283
|
+
: "{key: someKey}";
|
|
284
|
+
didWarnAboutKeySpread[children + isStaticChildren] ||
|
|
285
|
+
((keys =
|
|
286
|
+
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
|
|
287
|
+
console.error(
|
|
288
|
+
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
289
|
+
isStaticChildren,
|
|
290
|
+
children,
|
|
291
|
+
keys,
|
|
292
|
+
children
|
|
293
|
+
),
|
|
294
|
+
(didWarnAboutKeySpread[children + isStaticChildren] = true));
|
|
295
|
+
}
|
|
296
|
+
children = null;
|
|
297
|
+
void 0 !== maybeKey &&
|
|
298
|
+
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
|
|
299
|
+
hasValidKey(config) &&
|
|
300
|
+
(checkKeyStringCoercion(config.key), (children = "" + config.key));
|
|
301
|
+
if ("key" in config) {
|
|
302
|
+
maybeKey = {};
|
|
303
|
+
for (var propName in config)
|
|
304
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
305
|
+
} else maybeKey = config;
|
|
306
|
+
children &&
|
|
307
|
+
defineKeyPropWarningGetter(
|
|
308
|
+
maybeKey,
|
|
309
|
+
"function" === typeof type
|
|
310
|
+
? type.displayName || type.name || "Unknown"
|
|
311
|
+
: type
|
|
312
|
+
);
|
|
313
|
+
return ReactElement(
|
|
314
|
+
type,
|
|
315
|
+
children,
|
|
316
|
+
maybeKey,
|
|
317
|
+
getOwner(),
|
|
318
|
+
debugStack,
|
|
319
|
+
debugTask
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
function validateChildKeys(node) {
|
|
323
|
+
isValidElement(node)
|
|
324
|
+
? node._store && (node._store.validated = 1)
|
|
325
|
+
: "object" === typeof node &&
|
|
326
|
+
null !== node &&
|
|
327
|
+
node.$$typeof === REACT_LAZY_TYPE &&
|
|
328
|
+
("fulfilled" === node._payload.status
|
|
329
|
+
? isValidElement(node._payload.value) &&
|
|
330
|
+
node._payload.value._store &&
|
|
331
|
+
(node._payload.value._store.validated = 1)
|
|
332
|
+
: node._store && (node._store.validated = 1));
|
|
333
|
+
}
|
|
334
|
+
function isValidElement(object) {
|
|
335
|
+
return (
|
|
336
|
+
"object" === typeof object &&
|
|
337
|
+
null !== object &&
|
|
338
|
+
object.$$typeof === REACT_ELEMENT_TYPE
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
var React = require$$0,
|
|
342
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
343
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
344
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
345
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
|
346
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
|
|
347
|
+
REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
|
348
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
349
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
350
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
351
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
352
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
353
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
354
|
+
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
|
|
355
|
+
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
356
|
+
ReactSharedInternals =
|
|
357
|
+
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
358
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
359
|
+
isArrayImpl = Array.isArray,
|
|
360
|
+
createTask = console.createTask
|
|
361
|
+
? console.createTask
|
|
362
|
+
: function () {
|
|
363
|
+
return null;
|
|
364
|
+
};
|
|
365
|
+
React = {
|
|
366
|
+
react_stack_bottom_frame: function (callStackForError) {
|
|
367
|
+
return callStackForError();
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
var specialPropKeyWarningShown;
|
|
371
|
+
var didWarnAboutElementRef = {};
|
|
372
|
+
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
|
|
373
|
+
React,
|
|
374
|
+
UnknownOwner
|
|
375
|
+
)();
|
|
376
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
377
|
+
var didWarnAboutKeySpread = {};
|
|
378
|
+
reactJsxRuntime_development$1.Fragment = REACT_FRAGMENT_TYPE;
|
|
379
|
+
reactJsxRuntime_development$1.jsx = function (type, config, maybeKey) {
|
|
380
|
+
var trackActualOwner =
|
|
381
|
+
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
382
|
+
return jsxDEVImpl(
|
|
383
|
+
type,
|
|
384
|
+
config,
|
|
385
|
+
maybeKey,
|
|
386
|
+
false,
|
|
387
|
+
trackActualOwner
|
|
388
|
+
? Error("react-stack-top-frame")
|
|
389
|
+
: unknownOwnerDebugStack,
|
|
390
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
391
|
+
);
|
|
392
|
+
};
|
|
393
|
+
reactJsxRuntime_development$1.jsxs = function (type, config, maybeKey) {
|
|
394
|
+
var trackActualOwner =
|
|
395
|
+
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
396
|
+
return jsxDEVImpl(
|
|
397
|
+
type,
|
|
398
|
+
config,
|
|
399
|
+
maybeKey,
|
|
400
|
+
true,
|
|
401
|
+
trackActualOwner
|
|
402
|
+
? Error("react-stack-top-frame")
|
|
403
|
+
: unknownOwnerDebugStack,
|
|
404
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
405
|
+
);
|
|
406
|
+
};
|
|
407
|
+
})();
|
|
408
|
+
return reactJsxRuntime_development$1;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
var hasRequiredJsxRuntime$1;
|
|
412
|
+
|
|
413
|
+
function requireJsxRuntime$1 () {
|
|
414
|
+
if (hasRequiredJsxRuntime$1) return jsxRuntime$1.exports;
|
|
415
|
+
hasRequiredJsxRuntime$1 = 1;
|
|
416
|
+
|
|
417
|
+
if (process.env.NODE_ENV === 'production') {
|
|
418
|
+
jsxRuntime$1.exports = requireReactJsxRuntime_production$1();
|
|
419
|
+
} else {
|
|
420
|
+
jsxRuntime$1.exports = requireReactJsxRuntime_development$1();
|
|
421
|
+
}
|
|
422
|
+
return jsxRuntime$1.exports;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
var jsxRuntimeExports$1 = requireJsxRuntime$1();
|
|
426
|
+
|
|
427
|
+
var r,s={exports:{}},o={};var t,l,n={};
|
|
428
|
+
/**
|
|
429
|
+
* @license React
|
|
430
|
+
* react-jsx-runtime.development.js
|
|
431
|
+
*
|
|
432
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
433
|
+
*
|
|
434
|
+
* This source code is licensed under the MIT license found in the
|
|
435
|
+
* LICENSE file in the root directory of this source tree.
|
|
436
|
+
*/function a(){return t||(t=1,"production"!==process.env.NODE_ENV&&function(){function r(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===$?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case x:return "Fragment";case v:return "Profiler";case p:return "StrictMode";case k:return "Suspense";case y:return "SuspenseList";case C:return "Activity"}if("object"==typeof e)switch("number"==typeof e.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case u:return "Portal";case g:return e.displayName||"Context";case f:return (e._context.displayName||"Context")+".Consumer";case j:var s=e.render;return (e=e.displayName)||(e=""!==(e=s.displayName||s.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case L:return null!==(s=e.displayName||null)?s:r(e.type)||"Memo";case N:s=e._payload,e=e._init;try{return r(e(s))}catch(e){}}return null}function s(e){return ""+e}function o(e){try{s(e);var r=!1;}catch(e){r=true;}if(r){var o=(r=console).error,t="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",t),s(e)}}function t(e){if(e===x)return "<>";if("object"==typeof e&&null!==e&&e.$$typeof===N)return "<...>";try{var s=r(e);return s?"<"+s+">":"<...>"}catch(e){return "<...>"}}function l(){return Error("react-stack-top-frame")}function a(){var e=r(this.type);return W[e]||(W[e]=true,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(e=this.props.ref)?e:null}function i(e,s,t,l,n,i){var h,m=s.children;if(void 0!==m)if(l)if(M(m)){for(l=0;l<m.length;l++)c(m[l]);Object.freeze&&Object.freeze(m);}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else c(m);if(z.call(s,"key")){m=r(e);var u=Object.keys(s).filter(function(e){return "key"!==e});l=0<u.length?"{key: someKey, "+u.join(": ..., ")+": ...}":"{key: someKey}",V[m+l]||(u=0<u.length?"{"+u.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',l,m,u,m),V[m+l]=true);}if(m=null,void 0!==t&&(o(t),m=""+t),function(e){if(z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return false}return void 0!==e.key}(s)&&(o(s.key),m=""+s.key),"key"in s)for(var x in t={},s)"key"!==x&&(t[x]=s[x]);else t=s;return m&&function(e,r){function s(){d||(d=true,console.error("%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://react.dev/link/special-props)",r));}s.isReactWarning=true,Object.defineProperty(e,"key",{get:s,configurable:true});}(t,"function"==typeof e?e.displayName||e.name||"Unknown":e),function(e,r,s,o,t,l){var n=s.ref;return e={$$typeof:w,type:e,key:r,props:s,_owner:o},null!==(void 0!==n?n:null)?Object.defineProperty(e,"ref",{enumerable:false,get:a}):Object.defineProperty(e,"ref",{enumerable:false,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:false,enumerable:false,writable:true,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:false,enumerable:false,writable:true,value:null}),Object.defineProperty(e,"_debugStack",{configurable:false,enumerable:false,writable:true,value:t}),Object.defineProperty(e,"_debugTask",{configurable:false,enumerable:false,writable:true,value:l}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(e,m,t,null===(h=b.A)?null:h.getOwner(),n,i)}function c(e){h(e)?e._store&&(e._store.validated=1):"object"==typeof e&&null!==e&&e.$$typeof===N&&("fulfilled"===e._payload.status?h(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1));}function h(e){return "object"==typeof e&&null!==e&&e.$$typeof===w}var d,m=require$$0,w=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),g=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),$=Symbol.for("react.client.reference"),b=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,M=Array.isArray,B=console.createTask?console.createTask:function(){return null},W={},_=(m={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(m,l)(),H=B(t(l)),V={};n.Fragment=x,n.jsx=function(e,r,s){var o=1e4>b.recentlyCreatedOwnerStacks++;return i(e,r,s,false,o?Error("react-stack-top-frame"):_,o?B(t(e)):H)},n.jsxs=function(e,r,s){var o=1e4>b.recentlyCreatedOwnerStacks++;return i(e,r,s,true,o?Error("react-stack-top-frame"):_,o?B(t(e)):H)};}()),n}var i=(l||(l=1,"production"===process.env.NODE_ENV?s.exports=function(){if(r)return o;r=1;var e=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function t(r,s,o){var t=null;if(void 0!==o&&(t=""+o),void 0!==s.key&&(t=""+s.key),"key"in s)for(var l in o={},s)"key"!==l&&(o[l]=s[l]);else o=s;return s=o.ref,{$$typeof:e,type:r,key:t,ref:void 0!==s?s:null,props:o}}return o.Fragment=s,o.jsx=t,o.jsxs=t,o}():s.exports=a()),s.exports);function m({className:e="",size:r="md"}){const s=`${{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[r]} ${e}`;return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:s,"aria-label":"Check",children:i.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})}const u=({className:e="",size:r="md",color:s="currentColor",direction:o="down"})=>i.jsx("svg",{className:`${{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[r]} ${{up:"rotate-180",down:"",left:"rotate-90",right:"-rotate-90"}[o]} ${e}`,fill:"none",stroke:s,viewBox:"0 0 24 24",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M6 9l6 6 6-6"})});function g({className:e="",size:r="md",color:s="currentColor"}){return i.jsx("svg",{className:`${{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[r]} ${e}`,fill:"none",stroke:s,viewBox:"0 0 24 24",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M6 18L18 6M6 6l12 12"})})}
|
|
437
|
+
|
|
438
|
+
var jsxRuntime = {exports: {}};
|
|
439
|
+
|
|
440
|
+
var reactJsxRuntime_production = {};
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* @license React
|
|
444
|
+
* react-jsx-runtime.production.js
|
|
445
|
+
*
|
|
446
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
447
|
+
*
|
|
448
|
+
* This source code is licensed under the MIT license found in the
|
|
449
|
+
* LICENSE file in the root directory of this source tree.
|
|
450
|
+
*/
|
|
451
|
+
|
|
452
|
+
var hasRequiredReactJsxRuntime_production;
|
|
453
|
+
|
|
454
|
+
function requireReactJsxRuntime_production () {
|
|
455
|
+
if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
|
|
456
|
+
hasRequiredReactJsxRuntime_production = 1;
|
|
457
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
458
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
459
|
+
function jsxProd(type, config, maybeKey) {
|
|
460
|
+
var key = null;
|
|
461
|
+
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
462
|
+
void 0 !== config.key && (key = "" + config.key);
|
|
463
|
+
if ("key" in config) {
|
|
464
|
+
maybeKey = {};
|
|
465
|
+
for (var propName in config)
|
|
466
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
467
|
+
} else maybeKey = config;
|
|
468
|
+
config = maybeKey.ref;
|
|
469
|
+
return {
|
|
470
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
471
|
+
type: type,
|
|
472
|
+
key: key,
|
|
473
|
+
ref: void 0 !== config ? config : null,
|
|
474
|
+
props: maybeKey
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
|
|
478
|
+
reactJsxRuntime_production.jsx = jsxProd;
|
|
479
|
+
reactJsxRuntime_production.jsxs = jsxProd;
|
|
480
|
+
return reactJsxRuntime_production;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
var reactJsxRuntime_development = {};
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* @license React
|
|
487
|
+
* react-jsx-runtime.development.js
|
|
488
|
+
*
|
|
489
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
490
|
+
*
|
|
491
|
+
* This source code is licensed under the MIT license found in the
|
|
492
|
+
* LICENSE file in the root directory of this source tree.
|
|
493
|
+
*/
|
|
494
|
+
|
|
495
|
+
var hasRequiredReactJsxRuntime_development;
|
|
496
|
+
|
|
497
|
+
function requireReactJsxRuntime_development () {
|
|
498
|
+
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
499
|
+
hasRequiredReactJsxRuntime_development = 1;
|
|
500
|
+
"production" !== process.env.NODE_ENV &&
|
|
501
|
+
(function () {
|
|
502
|
+
function getComponentNameFromType(type) {
|
|
503
|
+
if (null == type) return null;
|
|
504
|
+
if ("function" === typeof type)
|
|
505
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE
|
|
506
|
+
? null
|
|
507
|
+
: type.displayName || type.name || null;
|
|
508
|
+
if ("string" === typeof type) return type;
|
|
509
|
+
switch (type) {
|
|
510
|
+
case REACT_FRAGMENT_TYPE:
|
|
511
|
+
return "Fragment";
|
|
512
|
+
case REACT_PROFILER_TYPE:
|
|
513
|
+
return "Profiler";
|
|
514
|
+
case REACT_STRICT_MODE_TYPE:
|
|
515
|
+
return "StrictMode";
|
|
516
|
+
case REACT_SUSPENSE_TYPE:
|
|
517
|
+
return "Suspense";
|
|
518
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
519
|
+
return "SuspenseList";
|
|
520
|
+
case REACT_ACTIVITY_TYPE:
|
|
521
|
+
return "Activity";
|
|
522
|
+
}
|
|
523
|
+
if ("object" === typeof type)
|
|
524
|
+
switch (
|
|
525
|
+
("number" === typeof type.tag &&
|
|
526
|
+
console.error(
|
|
527
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
528
|
+
),
|
|
529
|
+
type.$$typeof)
|
|
530
|
+
) {
|
|
531
|
+
case REACT_PORTAL_TYPE:
|
|
532
|
+
return "Portal";
|
|
533
|
+
case REACT_CONTEXT_TYPE:
|
|
534
|
+
return type.displayName || "Context";
|
|
535
|
+
case REACT_CONSUMER_TYPE:
|
|
536
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
537
|
+
case REACT_FORWARD_REF_TYPE:
|
|
538
|
+
var innerType = type.render;
|
|
539
|
+
type = type.displayName;
|
|
540
|
+
type ||
|
|
541
|
+
((type = innerType.displayName || innerType.name || ""),
|
|
542
|
+
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
|
|
543
|
+
return type;
|
|
544
|
+
case REACT_MEMO_TYPE:
|
|
545
|
+
return (
|
|
546
|
+
(innerType = type.displayName || null),
|
|
547
|
+
null !== innerType
|
|
548
|
+
? innerType
|
|
549
|
+
: getComponentNameFromType(type.type) || "Memo"
|
|
550
|
+
);
|
|
551
|
+
case REACT_LAZY_TYPE:
|
|
552
|
+
innerType = type._payload;
|
|
553
|
+
type = type._init;
|
|
554
|
+
try {
|
|
555
|
+
return getComponentNameFromType(type(innerType));
|
|
556
|
+
} catch (x) {}
|
|
557
|
+
}
|
|
558
|
+
return null;
|
|
559
|
+
}
|
|
560
|
+
function testStringCoercion(value) {
|
|
561
|
+
return "" + value;
|
|
562
|
+
}
|
|
563
|
+
function checkKeyStringCoercion(value) {
|
|
564
|
+
try {
|
|
565
|
+
testStringCoercion(value);
|
|
566
|
+
var JSCompiler_inline_result = !1;
|
|
567
|
+
} catch (e) {
|
|
568
|
+
JSCompiler_inline_result = true;
|
|
569
|
+
}
|
|
570
|
+
if (JSCompiler_inline_result) {
|
|
571
|
+
JSCompiler_inline_result = console;
|
|
572
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
573
|
+
var JSCompiler_inline_result$jscomp$0 =
|
|
574
|
+
("function" === typeof Symbol &&
|
|
575
|
+
Symbol.toStringTag &&
|
|
576
|
+
value[Symbol.toStringTag]) ||
|
|
577
|
+
value.constructor.name ||
|
|
578
|
+
"Object";
|
|
579
|
+
JSCompiler_temp_const.call(
|
|
580
|
+
JSCompiler_inline_result,
|
|
581
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
582
|
+
JSCompiler_inline_result$jscomp$0
|
|
583
|
+
);
|
|
584
|
+
return testStringCoercion(value);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
function getTaskName(type) {
|
|
588
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
589
|
+
if (
|
|
590
|
+
"object" === typeof type &&
|
|
591
|
+
null !== type &&
|
|
592
|
+
type.$$typeof === REACT_LAZY_TYPE
|
|
593
|
+
)
|
|
594
|
+
return "<...>";
|
|
595
|
+
try {
|
|
596
|
+
var name = getComponentNameFromType(type);
|
|
597
|
+
return name ? "<" + name + ">" : "<...>";
|
|
598
|
+
} catch (x) {
|
|
599
|
+
return "<...>";
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
function getOwner() {
|
|
603
|
+
var dispatcher = ReactSharedInternals.A;
|
|
604
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
605
|
+
}
|
|
606
|
+
function UnknownOwner() {
|
|
607
|
+
return Error("react-stack-top-frame");
|
|
608
|
+
}
|
|
609
|
+
function hasValidKey(config) {
|
|
610
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
611
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
612
|
+
if (getter && getter.isReactWarning) return false;
|
|
613
|
+
}
|
|
614
|
+
return void 0 !== config.key;
|
|
615
|
+
}
|
|
616
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
617
|
+
function warnAboutAccessingKey() {
|
|
618
|
+
specialPropKeyWarningShown ||
|
|
619
|
+
((specialPropKeyWarningShown = true),
|
|
620
|
+
console.error(
|
|
621
|
+
"%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://react.dev/link/special-props)",
|
|
622
|
+
displayName
|
|
623
|
+
));
|
|
624
|
+
}
|
|
625
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
626
|
+
Object.defineProperty(props, "key", {
|
|
627
|
+
get: warnAboutAccessingKey,
|
|
628
|
+
configurable: true
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
632
|
+
var componentName = getComponentNameFromType(this.type);
|
|
633
|
+
didWarnAboutElementRef[componentName] ||
|
|
634
|
+
((didWarnAboutElementRef[componentName] = true),
|
|
635
|
+
console.error(
|
|
636
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
637
|
+
));
|
|
638
|
+
componentName = this.props.ref;
|
|
639
|
+
return void 0 !== componentName ? componentName : null;
|
|
640
|
+
}
|
|
641
|
+
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
642
|
+
var refProp = props.ref;
|
|
643
|
+
type = {
|
|
644
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
645
|
+
type: type,
|
|
646
|
+
key: key,
|
|
647
|
+
props: props,
|
|
648
|
+
_owner: owner
|
|
649
|
+
};
|
|
650
|
+
null !== (void 0 !== refProp ? refProp : null)
|
|
651
|
+
? Object.defineProperty(type, "ref", {
|
|
652
|
+
enumerable: false,
|
|
653
|
+
get: elementRefGetterWithDeprecationWarning
|
|
654
|
+
})
|
|
655
|
+
: Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
656
|
+
type._store = {};
|
|
657
|
+
Object.defineProperty(type._store, "validated", {
|
|
658
|
+
configurable: false,
|
|
659
|
+
enumerable: false,
|
|
660
|
+
writable: true,
|
|
661
|
+
value: 0
|
|
662
|
+
});
|
|
663
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
664
|
+
configurable: false,
|
|
665
|
+
enumerable: false,
|
|
666
|
+
writable: true,
|
|
667
|
+
value: null
|
|
668
|
+
});
|
|
669
|
+
Object.defineProperty(type, "_debugStack", {
|
|
670
|
+
configurable: false,
|
|
671
|
+
enumerable: false,
|
|
672
|
+
writable: true,
|
|
673
|
+
value: debugStack
|
|
674
|
+
});
|
|
675
|
+
Object.defineProperty(type, "_debugTask", {
|
|
676
|
+
configurable: false,
|
|
677
|
+
enumerable: false,
|
|
678
|
+
writable: true,
|
|
679
|
+
value: debugTask
|
|
680
|
+
});
|
|
681
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
682
|
+
return type;
|
|
683
|
+
}
|
|
684
|
+
function jsxDEVImpl(
|
|
685
|
+
type,
|
|
686
|
+
config,
|
|
687
|
+
maybeKey,
|
|
688
|
+
isStaticChildren,
|
|
689
|
+
debugStack,
|
|
690
|
+
debugTask
|
|
691
|
+
) {
|
|
692
|
+
var children = config.children;
|
|
693
|
+
if (void 0 !== children)
|
|
694
|
+
if (isStaticChildren)
|
|
695
|
+
if (isArrayImpl(children)) {
|
|
696
|
+
for (
|
|
697
|
+
isStaticChildren = 0;
|
|
698
|
+
isStaticChildren < children.length;
|
|
699
|
+
isStaticChildren++
|
|
700
|
+
)
|
|
701
|
+
validateChildKeys(children[isStaticChildren]);
|
|
702
|
+
Object.freeze && Object.freeze(children);
|
|
703
|
+
} else
|
|
704
|
+
console.error(
|
|
705
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
706
|
+
);
|
|
707
|
+
else validateChildKeys(children);
|
|
708
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
709
|
+
children = getComponentNameFromType(type);
|
|
710
|
+
var keys = Object.keys(config).filter(function (k) {
|
|
711
|
+
return "key" !== k;
|
|
712
|
+
});
|
|
713
|
+
isStaticChildren =
|
|
714
|
+
0 < keys.length
|
|
715
|
+
? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
|
|
716
|
+
: "{key: someKey}";
|
|
717
|
+
didWarnAboutKeySpread[children + isStaticChildren] ||
|
|
718
|
+
((keys =
|
|
719
|
+
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
|
|
720
|
+
console.error(
|
|
721
|
+
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
722
|
+
isStaticChildren,
|
|
723
|
+
children,
|
|
724
|
+
keys,
|
|
725
|
+
children
|
|
726
|
+
),
|
|
727
|
+
(didWarnAboutKeySpread[children + isStaticChildren] = true));
|
|
728
|
+
}
|
|
729
|
+
children = null;
|
|
730
|
+
void 0 !== maybeKey &&
|
|
731
|
+
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
|
|
732
|
+
hasValidKey(config) &&
|
|
733
|
+
(checkKeyStringCoercion(config.key), (children = "" + config.key));
|
|
734
|
+
if ("key" in config) {
|
|
735
|
+
maybeKey = {};
|
|
736
|
+
for (var propName in config)
|
|
737
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
738
|
+
} else maybeKey = config;
|
|
739
|
+
children &&
|
|
740
|
+
defineKeyPropWarningGetter(
|
|
741
|
+
maybeKey,
|
|
742
|
+
"function" === typeof type
|
|
743
|
+
? type.displayName || type.name || "Unknown"
|
|
744
|
+
: type
|
|
745
|
+
);
|
|
746
|
+
return ReactElement(
|
|
747
|
+
type,
|
|
748
|
+
children,
|
|
749
|
+
maybeKey,
|
|
750
|
+
getOwner(),
|
|
751
|
+
debugStack,
|
|
752
|
+
debugTask
|
|
753
|
+
);
|
|
754
|
+
}
|
|
755
|
+
function validateChildKeys(node) {
|
|
756
|
+
isValidElement(node)
|
|
757
|
+
? node._store && (node._store.validated = 1)
|
|
758
|
+
: "object" === typeof node &&
|
|
759
|
+
null !== node &&
|
|
760
|
+
node.$$typeof === REACT_LAZY_TYPE &&
|
|
761
|
+
("fulfilled" === node._payload.status
|
|
762
|
+
? isValidElement(node._payload.value) &&
|
|
763
|
+
node._payload.value._store &&
|
|
764
|
+
(node._payload.value._store.validated = 1)
|
|
765
|
+
: node._store && (node._store.validated = 1));
|
|
766
|
+
}
|
|
767
|
+
function isValidElement(object) {
|
|
768
|
+
return (
|
|
769
|
+
"object" === typeof object &&
|
|
770
|
+
null !== object &&
|
|
771
|
+
object.$$typeof === REACT_ELEMENT_TYPE
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
var React = require$$0,
|
|
775
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
776
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
777
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
778
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
|
779
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
|
|
780
|
+
REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
|
781
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
782
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
783
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
784
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
785
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
786
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
787
|
+
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
|
|
788
|
+
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
789
|
+
ReactSharedInternals =
|
|
790
|
+
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
791
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
792
|
+
isArrayImpl = Array.isArray,
|
|
793
|
+
createTask = console.createTask
|
|
794
|
+
? console.createTask
|
|
795
|
+
: function () {
|
|
796
|
+
return null;
|
|
797
|
+
};
|
|
798
|
+
React = {
|
|
799
|
+
react_stack_bottom_frame: function (callStackForError) {
|
|
800
|
+
return callStackForError();
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
var specialPropKeyWarningShown;
|
|
804
|
+
var didWarnAboutElementRef = {};
|
|
805
|
+
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
|
|
806
|
+
React,
|
|
807
|
+
UnknownOwner
|
|
808
|
+
)();
|
|
809
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
810
|
+
var didWarnAboutKeySpread = {};
|
|
811
|
+
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
812
|
+
reactJsxRuntime_development.jsx = function (type, config, maybeKey) {
|
|
813
|
+
var trackActualOwner =
|
|
814
|
+
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
815
|
+
return jsxDEVImpl(
|
|
816
|
+
type,
|
|
817
|
+
config,
|
|
818
|
+
maybeKey,
|
|
819
|
+
false,
|
|
820
|
+
trackActualOwner
|
|
821
|
+
? Error("react-stack-top-frame")
|
|
822
|
+
: unknownOwnerDebugStack,
|
|
823
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
824
|
+
);
|
|
825
|
+
};
|
|
826
|
+
reactJsxRuntime_development.jsxs = function (type, config, maybeKey) {
|
|
827
|
+
var trackActualOwner =
|
|
828
|
+
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
829
|
+
return jsxDEVImpl(
|
|
830
|
+
type,
|
|
831
|
+
config,
|
|
832
|
+
maybeKey,
|
|
833
|
+
true,
|
|
834
|
+
trackActualOwner
|
|
835
|
+
? Error("react-stack-top-frame")
|
|
836
|
+
: unknownOwnerDebugStack,
|
|
837
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
838
|
+
);
|
|
839
|
+
};
|
|
840
|
+
})();
|
|
841
|
+
return reactJsxRuntime_development;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
var hasRequiredJsxRuntime;
|
|
845
|
+
|
|
846
|
+
function requireJsxRuntime () {
|
|
847
|
+
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
848
|
+
hasRequiredJsxRuntime = 1;
|
|
849
|
+
|
|
850
|
+
if (process.env.NODE_ENV === 'production') {
|
|
851
|
+
jsxRuntime.exports = requireReactJsxRuntime_production();
|
|
852
|
+
} else {
|
|
853
|
+
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
854
|
+
}
|
|
855
|
+
return jsxRuntime.exports;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
var jsxRuntimeExports = requireJsxRuntime();
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* LoadingSpinner component
|
|
862
|
+
* Displays a loading indicator with multiple style variants
|
|
863
|
+
*
|
|
864
|
+
* @param variant - 'spinner' (default circular spinner), 'dots' (three bouncing dots), 'pulse' (pulsing circle), 'ring' (rotating ring)
|
|
865
|
+
* @param inline - If true, removes centering and margins for inline use (e.g., in buttons or inputs)
|
|
866
|
+
* @param color - Color scheme: 'blue' (default), 'gray', 'white'
|
|
867
|
+
*/
|
|
868
|
+
const LoadingSpinner = ({ message, size = "md", className = "", variant = "spinner", inline = false, color = "blue", }) => {
|
|
869
|
+
const sizeClasses = {
|
|
870
|
+
sm: "h-4 w-4",
|
|
871
|
+
md: "h-8 w-8",
|
|
872
|
+
lg: "h-12 w-12",
|
|
873
|
+
};
|
|
874
|
+
const colorClasses = {
|
|
875
|
+
blue: "border-blue-600",
|
|
876
|
+
gray: "border-gray-600",
|
|
877
|
+
white: "border-white",
|
|
878
|
+
};
|
|
879
|
+
const dotColorClasses = {
|
|
880
|
+
blue: "bg-blue-600",
|
|
881
|
+
gray: "bg-gray-600",
|
|
882
|
+
white: "bg-white",
|
|
883
|
+
};
|
|
884
|
+
const dotSizeClasses = {
|
|
885
|
+
sm: "h-1.5 w-1.5",
|
|
886
|
+
md: "h-2.5 w-2.5",
|
|
887
|
+
lg: "h-3.5 w-3.5",
|
|
888
|
+
};
|
|
889
|
+
// Spinner variant (circular border)
|
|
890
|
+
if (variant === "spinner") {
|
|
891
|
+
return (jsxRuntimeExports.jsx("div", { className: inline ? className : `flex justify-center items-center ${className}`, children: jsxRuntimeExports.jsxs("div", { className: inline ? "" : "text-center", children: [jsxRuntimeExports.jsx("div", { className: `animate-spin rounded-full border-2 ${colorClasses[color]} ${sizeClasses[size]} ${inline ? "" : "mx-auto mb-4"}`, style: {
|
|
892
|
+
borderTopColor: "transparent",
|
|
893
|
+
borderRightColor: "transparent",
|
|
894
|
+
} }), message && jsxRuntimeExports.jsx("p", { className: "text-gray-600 text-sm mt-2", children: message })] }) }));
|
|
895
|
+
}
|
|
896
|
+
// Dots variant (three bouncing dots)
|
|
897
|
+
if (variant === "dots") {
|
|
898
|
+
return (jsxRuntimeExports.jsx("div", { className: inline ? className : `flex justify-center items-center ${className}`, children: jsxRuntimeExports.jsxs("div", { className: inline ? "flex gap-1" : "text-center", children: [jsxRuntimeExports.jsxs("div", { className: `flex gap-1 ${inline ? "" : "mx-auto mb-4"}`, children: [jsxRuntimeExports.jsx("div", { className: `${dotSizeClasses[size]} ${dotColorClasses[color]} rounded-full animate-bounce`, style: { animationDelay: "0ms" } }), jsxRuntimeExports.jsx("div", { className: `${dotSizeClasses[size]} ${dotColorClasses[color]} rounded-full animate-bounce`, style: { animationDelay: "150ms" } }), jsxRuntimeExports.jsx("div", { className: `${dotSizeClasses[size]} ${dotColorClasses[color]} rounded-full animate-bounce`, style: { animationDelay: "300ms" } })] }), message && jsxRuntimeExports.jsx("p", { className: "text-gray-600 text-sm mt-2", children: message })] }) }));
|
|
899
|
+
}
|
|
900
|
+
// Pulse variant (pulsing circle)
|
|
901
|
+
if (variant === "pulse") {
|
|
902
|
+
return (jsxRuntimeExports.jsx("div", { className: inline ? className : `flex justify-center items-center ${className}`, children: jsxRuntimeExports.jsxs("div", { className: inline ? "" : "text-center", children: [jsxRuntimeExports.jsx("div", { className: `${sizeClasses[size]} ${dotColorClasses[color]} rounded-full animate-pulse ${inline ? "" : "mx-auto mb-4"}` }), message && jsxRuntimeExports.jsx("p", { className: "text-gray-600 text-sm mt-2", children: message })] }) }));
|
|
903
|
+
}
|
|
904
|
+
// Ring variant (rotating ring with gradient)
|
|
905
|
+
if (variant === "ring") {
|
|
906
|
+
const ringColorMap = {
|
|
907
|
+
blue: "border-blue-600",
|
|
908
|
+
gray: "border-gray-600",
|
|
909
|
+
white: "border-white",
|
|
910
|
+
};
|
|
911
|
+
return (jsxRuntimeExports.jsx("div", { className: inline ? className : `flex justify-center items-center ${className}`, children: jsxRuntimeExports.jsxs("div", { className: inline ? "" : "text-center", children: [jsxRuntimeExports.jsxs("div", { className: `relative ${sizeClasses[size]} ${inline ? "" : "mx-auto mb-4"}`, children: [jsxRuntimeExports.jsx("div", { className: `absolute inset-0 rounded-full border-2 ${colorClasses[color]} opacity-25` }), jsxRuntimeExports.jsx("div", { className: `absolute inset-0 rounded-full border-2 border-transparent ${ringColorMap[color]} animate-spin`, style: {
|
|
912
|
+
borderTopColor: "currentColor",
|
|
913
|
+
borderRightColor: "transparent",
|
|
914
|
+
borderBottomColor: "transparent",
|
|
915
|
+
borderLeftColor: "transparent",
|
|
916
|
+
} })] }), message && jsxRuntimeExports.jsx("p", { className: "text-gray-600 text-sm mt-2", children: message })] }) }));
|
|
917
|
+
}
|
|
918
|
+
return null;
|
|
919
|
+
};
|
|
920
|
+
|
|
921
|
+
// Helper function to highlight matching text
|
|
922
|
+
const highlightMatchText = (text, search, shouldHighlight = true) => {
|
|
923
|
+
if (!shouldHighlight || !search || !text)
|
|
924
|
+
return text;
|
|
925
|
+
const regex = new RegExp(`(${search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "gi");
|
|
926
|
+
const parts = text.split(regex);
|
|
927
|
+
return (jsxRuntimeExports$1.jsx(jsxRuntimeExports$1.Fragment, { children: parts.map((part, index) => regex.test(part) ? (jsxRuntimeExports$1.jsx("mark", { className: "bg-yellow-200 font-semibold text-gray-900", children: part }, index)) : (jsxRuntimeExports$1.jsx("span", { children: part }, index))) }));
|
|
928
|
+
};
|
|
929
|
+
const Autocomplete = ({ label, value, onChange, options = [], placeholder = "Search or select...", error, warning, hint, required = false, disabled = false, loading = false, searchable = true, clearable = true, icon, className = "", maxHeight = "300px", onCreate, onSearch, readOnly = false, renderOption, onBlur, onFocus, createLabel = "Create", noResultsText = "No results found", loadingText = "Loading...", highlightMatch = true, minSearchLength = 0, debounceMs = 300, keepListOpen = false, position = "bottom", }) => {
|
|
930
|
+
const [isOpen, setIsOpen] = require$$0.useState(false);
|
|
931
|
+
const [searchTerm, setSearchTerm] = require$$0.useState("");
|
|
932
|
+
const [highlightedIndex, setHighlightedIndex] = require$$0.useState(-1);
|
|
933
|
+
const [isFocused, setIsFocused] = require$$0.useState(false);
|
|
934
|
+
const containerRef = require$$0.useRef(null);
|
|
935
|
+
const inputRef = require$$0.useRef(null);
|
|
936
|
+
const dropdownRef = require$$0.useRef(null);
|
|
937
|
+
const optionRefs = require$$0.useRef([]);
|
|
938
|
+
// Get selected option
|
|
939
|
+
const selectedOption = options.find((opt) => opt.value === value);
|
|
940
|
+
// Filter options based on search
|
|
941
|
+
const filteredOptions = require$$0.useMemo(() => {
|
|
942
|
+
// When using external search (onSearch provided), don't filter locally
|
|
943
|
+
// The parent component is responsible for filtering via onSearch callback
|
|
944
|
+
if (onSearch)
|
|
945
|
+
return options;
|
|
946
|
+
if (!searchable || searchTerm.length < minSearchLength)
|
|
947
|
+
return options;
|
|
948
|
+
const lowerSearch = searchTerm.toLowerCase();
|
|
949
|
+
return options.filter((opt) => opt.label.toLowerCase().includes(lowerSearch) ||
|
|
950
|
+
opt.description?.toLowerCase().includes(lowerSearch));
|
|
951
|
+
}, [options, searchTerm, searchable, minSearchLength, onSearch]);
|
|
952
|
+
// Display value in input
|
|
953
|
+
const displayValue = require$$0.useMemo(() => {
|
|
954
|
+
if (searchable && isOpen)
|
|
955
|
+
return searchTerm;
|
|
956
|
+
return selectedOption?.label || "";
|
|
957
|
+
}, [isOpen, searchable, searchTerm, selectedOption]);
|
|
958
|
+
// Call onSearch with debounce
|
|
959
|
+
require$$0.useEffect(() => {
|
|
960
|
+
if (!onSearch || searchTerm.length < minSearchLength)
|
|
961
|
+
return;
|
|
962
|
+
const timer = setTimeout(() => {
|
|
963
|
+
onSearch(searchTerm);
|
|
964
|
+
}, debounceMs);
|
|
965
|
+
return () => clearTimeout(timer);
|
|
966
|
+
}, [searchTerm, onSearch, debounceMs, minSearchLength]);
|
|
967
|
+
// Close dropdown on outside click
|
|
968
|
+
require$$0.useEffect(() => {
|
|
969
|
+
const handleClickOutside = (event) => {
|
|
970
|
+
if (containerRef.current &&
|
|
971
|
+
!containerRef.current.contains(event.target)) {
|
|
972
|
+
setIsOpen(false);
|
|
973
|
+
setIsFocused(false);
|
|
974
|
+
if (!keepListOpen) {
|
|
975
|
+
setSearchTerm("");
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
};
|
|
979
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
980
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
981
|
+
}, [keepListOpen]);
|
|
982
|
+
// Scroll highlighted option into view
|
|
983
|
+
require$$0.useEffect(() => {
|
|
984
|
+
if (highlightedIndex >= 0 && optionRefs.current[highlightedIndex]) {
|
|
985
|
+
optionRefs.current[highlightedIndex]?.scrollIntoView({
|
|
986
|
+
block: "nearest",
|
|
987
|
+
behavior: "smooth",
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
}, [highlightedIndex]);
|
|
991
|
+
const handleInputChange = (e) => {
|
|
992
|
+
const newValue = e.target.value;
|
|
993
|
+
setSearchTerm(newValue);
|
|
994
|
+
if (!isOpen) {
|
|
995
|
+
setIsOpen(true);
|
|
996
|
+
}
|
|
997
|
+
setHighlightedIndex(-1);
|
|
998
|
+
};
|
|
999
|
+
const handleInputFocus = () => {
|
|
1000
|
+
if (disabled || readOnly)
|
|
1001
|
+
return;
|
|
1002
|
+
setIsFocused(true);
|
|
1003
|
+
setIsOpen(true);
|
|
1004
|
+
onFocus?.();
|
|
1005
|
+
};
|
|
1006
|
+
const handleInputBlur = () => {
|
|
1007
|
+
// Delay to allow click on dropdown
|
|
1008
|
+
setTimeout(() => {
|
|
1009
|
+
if (!containerRef.current?.contains(document.activeElement)) {
|
|
1010
|
+
setIsFocused(false);
|
|
1011
|
+
if (!keepListOpen) {
|
|
1012
|
+
setSearchTerm("");
|
|
1013
|
+
}
|
|
1014
|
+
onBlur?.();
|
|
1015
|
+
}
|
|
1016
|
+
}, 200);
|
|
1017
|
+
};
|
|
1018
|
+
const handleSelect = (option) => {
|
|
1019
|
+
if (option.disabled)
|
|
1020
|
+
return;
|
|
1021
|
+
onChange(option.value, option);
|
|
1022
|
+
setSearchTerm("");
|
|
1023
|
+
setHighlightedIndex(-1);
|
|
1024
|
+
if (!keepListOpen) {
|
|
1025
|
+
setIsOpen(false);
|
|
1026
|
+
}
|
|
1027
|
+
inputRef.current?.blur();
|
|
1028
|
+
};
|
|
1029
|
+
const handleClear = (e) => {
|
|
1030
|
+
e.stopPropagation();
|
|
1031
|
+
onChange(null);
|
|
1032
|
+
setSearchTerm("");
|
|
1033
|
+
setIsOpen(false);
|
|
1034
|
+
inputRef.current?.focus();
|
|
1035
|
+
};
|
|
1036
|
+
const handleToggle = () => {
|
|
1037
|
+
if (disabled || readOnly)
|
|
1038
|
+
return;
|
|
1039
|
+
const newIsOpen = !isOpen;
|
|
1040
|
+
setIsOpen(newIsOpen);
|
|
1041
|
+
if (newIsOpen) {
|
|
1042
|
+
inputRef.current?.focus();
|
|
1043
|
+
}
|
|
1044
|
+
};
|
|
1045
|
+
const handleKeyDown = (e) => {
|
|
1046
|
+
if (disabled || readOnly)
|
|
1047
|
+
return;
|
|
1048
|
+
switch (e.key) {
|
|
1049
|
+
case "ArrowDown":
|
|
1050
|
+
e.preventDefault();
|
|
1051
|
+
if (!isOpen) {
|
|
1052
|
+
setIsOpen(true);
|
|
1053
|
+
}
|
|
1054
|
+
else {
|
|
1055
|
+
setHighlightedIndex((prev) => prev < filteredOptions.length - 1 ? prev + 1 : prev);
|
|
1056
|
+
}
|
|
1057
|
+
break;
|
|
1058
|
+
case "ArrowUp":
|
|
1059
|
+
e.preventDefault();
|
|
1060
|
+
if (isOpen) {
|
|
1061
|
+
setHighlightedIndex((prev) => (prev > 0 ? prev - 1 : -1));
|
|
1062
|
+
}
|
|
1063
|
+
break;
|
|
1064
|
+
case "Enter":
|
|
1065
|
+
e.preventDefault();
|
|
1066
|
+
if (isOpen &&
|
|
1067
|
+
highlightedIndex >= 0 &&
|
|
1068
|
+
filteredOptions[highlightedIndex]) {
|
|
1069
|
+
handleSelect(filteredOptions[highlightedIndex]);
|
|
1070
|
+
}
|
|
1071
|
+
else if (isOpen && onCreate && searchTerm.trim()) {
|
|
1072
|
+
onCreate(searchTerm.trim());
|
|
1073
|
+
setIsOpen(false);
|
|
1074
|
+
setSearchTerm("");
|
|
1075
|
+
}
|
|
1076
|
+
break;
|
|
1077
|
+
case "Escape":
|
|
1078
|
+
e.preventDefault();
|
|
1079
|
+
setIsOpen(false);
|
|
1080
|
+
setSearchTerm("");
|
|
1081
|
+
inputRef.current?.blur();
|
|
1082
|
+
break;
|
|
1083
|
+
case "Tab":
|
|
1084
|
+
setIsOpen(false);
|
|
1085
|
+
setSearchTerm("");
|
|
1086
|
+
break;
|
|
1087
|
+
}
|
|
1088
|
+
};
|
|
1089
|
+
const getBorderColor = () => {
|
|
1090
|
+
if (error) {
|
|
1091
|
+
return "border-red-500 focus:border-red-500 focus:ring-2 focus:ring-red-200";
|
|
1092
|
+
}
|
|
1093
|
+
if (warning) {
|
|
1094
|
+
return "border-yellow-500 focus:border-yellow-500 focus:ring-2 focus:ring-yellow-200";
|
|
1095
|
+
}
|
|
1096
|
+
if (isFocused) {
|
|
1097
|
+
return "border-blue-500 focus:ring-2 focus:ring-blue-200";
|
|
1098
|
+
}
|
|
1099
|
+
return "border-gray-300 hover:border-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-200";
|
|
1100
|
+
};
|
|
1101
|
+
return (jsxRuntimeExports$1.jsxs("div", { className: `flex flex-col gap-2 ${className}`, children: [label && (jsxRuntimeExports$1.jsxs("label", { className: "block text-sm font-medium text-gray-700", children: [label, required && jsxRuntimeExports$1.jsx("span", { className: "text-red-500 ml-1", children: "*" })] })), jsxRuntimeExports$1.jsxs("div", { ref: containerRef, className: "relative", children: [icon && (jsxRuntimeExports$1.jsx("div", { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 pointer-events-none flex items-center", children: icon })), jsxRuntimeExports$1.jsx("input", { ref: inputRef, type: "text", value: displayValue, onChange: handleInputChange, onFocus: handleInputFocus, onBlur: handleInputBlur, onKeyDown: handleKeyDown, placeholder: placeholder, disabled: disabled, readOnly: readOnly || !searchable, className: `
|
|
1102
|
+
w-full px-4 py-2 rounded-lg border-2 transition-all outline-none
|
|
1103
|
+
font-medium text-gray-900 placeholder-gray-400
|
|
1104
|
+
disabled:bg-gray-100 disabled:text-gray-500 disabled:cursor-not-allowed
|
|
1105
|
+
${icon ? "pl-10" : ""}
|
|
1106
|
+
${clearable && value ? "pr-20" : "pr-12"}
|
|
1107
|
+
${getBorderColor()}
|
|
1108
|
+
${readOnly ? "bg-gray-50 cursor-default" : ""}
|
|
1109
|
+
`, "data-testid": "autocomplete-input" }), jsxRuntimeExports$1.jsxs("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2 flex items-center gap-2", children: [loading && jsxRuntimeExports$1.jsx(LoadingSpinner, { size: "sm", variant: "dots", inline: true }), clearable && value && !loading && !disabled && (jsxRuntimeExports$1.jsx("button", { type: "button", onClick: handleClear, className: "text-gray-400 hover:text-gray-600 transition-colors", "data-testid": "autocomplete-clear", "aria-label": "Clear selection", children: jsxRuntimeExports$1.jsx(g, { className: "w-4 h-4" }) })), jsxRuntimeExports$1.jsx("button", { type: "button", onClick: handleToggle, className: `text-gray-400 transition-all ${disabled || readOnly
|
|
1110
|
+
? "cursor-not-allowed opacity-50"
|
|
1111
|
+
: "hover:text-gray-600"}`, disabled: disabled, "data-testid": "autocomplete-toggle", "aria-label": isOpen ? "Close dropdown" : "Open dropdown", children: jsxRuntimeExports$1.jsx(u, { className: `w-5 h-5 transition-transform duration-200 ${isOpen ? "rotate-180" : ""}` }) })] }), isOpen && !disabled && !readOnly && (jsxRuntimeExports$1.jsxs("div", { ref: dropdownRef, className: `
|
|
1112
|
+
absolute z-50 left-0 right-0 mt-1
|
|
1113
|
+
bg-white border-2 border-gray-200 rounded-lg shadow-lg
|
|
1114
|
+
overflow-hidden
|
|
1115
|
+
${position === "top" ? "bottom-full mb-1" : "top-full"}
|
|
1116
|
+
`, style: { maxHeight }, "data-testid": "autocomplete-dropdown", children: [loading && filteredOptions.length === 0 && (jsxRuntimeExports$1.jsxs("div", { className: "px-4 py-3 text-center text-gray-500", children: [jsxRuntimeExports$1.jsx(LoadingSpinner, { size: "sm", variant: "spinner", className: "mx-auto" }), jsxRuntimeExports$1.jsx("span", { className: "block mt-2 text-sm", children: loadingText })] })), jsxRuntimeExports$1.jsx("div", { className: "overflow-y-auto max-h-full", children: !loading && filteredOptions.length > 0 && (jsxRuntimeExports$1.jsx(jsxRuntimeExports$1.Fragment, { children: filteredOptions.map((option, index) => {
|
|
1117
|
+
const isSelected = option.value === value;
|
|
1118
|
+
const isHighlighted = index === highlightedIndex;
|
|
1119
|
+
return (jsxRuntimeExports$1.jsx("div", { ref: (el) => {
|
|
1120
|
+
optionRefs.current[index] = el;
|
|
1121
|
+
}, onClick: () => handleSelect(option), onMouseEnter: () => setHighlightedIndex(index), className: `
|
|
1122
|
+
px-4 py-3 cursor-pointer transition-colors flex items-center justify-between
|
|
1123
|
+
${option.disabled ? "opacity-50 cursor-not-allowed bg-gray-50" : ""}
|
|
1124
|
+
${isHighlighted && !option.disabled ? "bg-blue-50" : ""}
|
|
1125
|
+
${isSelected && !option.disabled ? "bg-blue-100" : ""}
|
|
1126
|
+
${!isHighlighted && !isSelected && !option.disabled ? "hover:bg-gray-50" : ""}
|
|
1127
|
+
`, "data-testid": `autocomplete-option-${option.value}`, children: renderOption ? (renderOption(option, isSelected)) : (jsxRuntimeExports$1.jsxs(jsxRuntimeExports$1.Fragment, { children: [jsxRuntimeExports$1.jsxs("div", { className: "flex-1", children: [jsxRuntimeExports$1.jsx("div", { className: "font-medium text-gray-900", children: highlightMatchText(option.label, searchTerm, highlightMatch) }), option.description && (jsxRuntimeExports$1.jsx("div", { className: "text-xs text-gray-500 mt-0.5", children: option.description }))] }), isSelected && (jsxRuntimeExports$1.jsx(m, { className: "w-5 h-5 text-blue-600 flex-shrink-0" }))] })) }, option.value));
|
|
1128
|
+
}) })) }), onCreate && searchTerm && (jsxRuntimeExports$1.jsxs("div", { onClick: () => {
|
|
1129
|
+
onCreate(searchTerm.trim());
|
|
1130
|
+
setIsOpen(false);
|
|
1131
|
+
setSearchTerm("");
|
|
1132
|
+
}, className: `
|
|
1133
|
+
px-4 py-3 cursor-pointer
|
|
1134
|
+
flex items-center gap-2
|
|
1135
|
+
${filteredOptions.length > 0 ? "border-t border-gray-200" : ""}
|
|
1136
|
+
transition-colors
|
|
1137
|
+
${highlightedIndex === filteredOptions.length ? "bg-blue-50" : "hover:bg-gray-50"}
|
|
1138
|
+
`, "data-testid": "autocomplete-create", children: [jsxRuntimeExports$1.jsx("span", { className: "text-blue-600 font-medium", children: "+" }), jsxRuntimeExports$1.jsxs("span", { className: "text-gray-900", children: [createLabel, " \"", searchTerm, "\""] })] })), !loading && filteredOptions.length === 0 && !onCreate && (jsxRuntimeExports$1.jsx("div", { className: "px-4 py-3 text-center text-gray-500 text-sm", children: noResultsText }))] }))] }), hint && !error && !warning && (jsxRuntimeExports$1.jsx("p", { className: "text-xs text-gray-500", children: hint })), warning && !error && (jsxRuntimeExports$1.jsxs("p", { className: "text-xs text-yellow-600 flex items-center gap-1", children: [jsxRuntimeExports$1.jsx("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20", children: jsxRuntimeExports$1.jsx("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }), warning] })), error && (jsxRuntimeExports$1.jsxs("p", { className: "text-xs text-red-600 flex items-center gap-1", children: [jsxRuntimeExports$1.jsx("svg", { className: "w-4 h-4", fill: "currentColor", viewBox: "0 0 20 20", children: jsxRuntimeExports$1.jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }) }), error] }))] }));
|
|
1139
|
+
};
|
|
1140
|
+
|
|
1141
|
+
module.exports = Autocomplete;
|