powell-react 0.0.30 → 0.0.31

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.
Files changed (67) hide show
  1. package/dist/assets/style-nnktSJs6.css +1163 -0
  2. package/dist/index.cjs.js +2495 -0
  3. package/dist/index.cjs.js.map +1 -0
  4. package/dist/index.es.js +1842 -0
  5. package/dist/index.es.js.map +1 -0
  6. package/dist/types/index.d.ts +1 -0
  7. package/package.json +46 -31
  8. package/dist/index.d.mts +0 -564
  9. package/dist/index.mjs +0 -932
  10. package/dist/index.mjs.map +0 -1
  11. package/dist/powell/styles/global.scss +0 -1460
  12. package/dist/powell/themes/arya-blue.css +0 -1
  13. package/dist/powell/themes/arya-green.css +0 -1
  14. package/dist/powell/themes/arya-orange.css +0 -1
  15. package/dist/powell/themes/arya-purple.css +0 -1
  16. package/dist/powell/themes/bootstrap4-dark-blue.css +0 -1
  17. package/dist/powell/themes/bootstrap4-dark-purple.css +0 -1
  18. package/dist/powell/themes/bootstrap4-light-blue.css +0 -1
  19. package/dist/powell/themes/bootstrap4-light-purple.css +0 -1
  20. package/dist/powell/themes/fluent-light.css +0 -1
  21. package/dist/powell/themes/lara-dark-amber.css +0 -1
  22. package/dist/powell/themes/lara-dark-blue.css +0 -1
  23. package/dist/powell/themes/lara-dark-cyan.css +0 -1
  24. package/dist/powell/themes/lara-dark-green.css +0 -1
  25. package/dist/powell/themes/lara-dark-indigo.css +0 -1
  26. package/dist/powell/themes/lara-dark-pink.css +0 -1
  27. package/dist/powell/themes/lara-dark-purple.css +0 -1
  28. package/dist/powell/themes/lara-dark-teal.css +0 -1
  29. package/dist/powell/themes/lara-light-amber.css +0 -1
  30. package/dist/powell/themes/lara-light-blue.css +0 -1
  31. package/dist/powell/themes/lara-light-cyan.css +0 -1
  32. package/dist/powell/themes/lara-light-green.css +0 -1
  33. package/dist/powell/themes/lara-light-indigo.css +0 -1
  34. package/dist/powell/themes/lara-light-pink.css +0 -1
  35. package/dist/powell/themes/lara-light-purple.css +0 -1
  36. package/dist/powell/themes/lara-light-teal.css +0 -1
  37. package/dist/powell/themes/luna-amber.css +0 -1
  38. package/dist/powell/themes/luna-blue.css +0 -1
  39. package/dist/powell/themes/luna-green.css +0 -1
  40. package/dist/powell/themes/luna-pink.css +0 -1
  41. package/dist/powell/themes/md-dark-deeppurple.css +0 -1
  42. package/dist/powell/themes/md-dark-indigo.css +0 -1
  43. package/dist/powell/themes/md-light-deeppurple.css +0 -1
  44. package/dist/powell/themes/md-light-indigo.css +0 -1
  45. package/dist/powell/themes/mdc-dark-deeppurple.css +0 -1
  46. package/dist/powell/themes/mdc-dark-indigo.css +0 -1
  47. package/dist/powell/themes/mdc-light-deeppurple.css +0 -1
  48. package/dist/powell/themes/mdc-light-indigo.css +0 -1
  49. package/dist/powell/themes/mira.css +0 -1
  50. package/dist/powell/themes/nano.css +0 -1
  51. package/dist/powell/themes/nova-accent.css +0 -1
  52. package/dist/powell/themes/nova-alt.css +0 -1
  53. package/dist/powell/themes/nova.css +0 -1
  54. package/dist/powell/themes/rhea.css +0 -1
  55. package/dist/powell/themes/saga-blue.css +0 -1
  56. package/dist/powell/themes/saga-green.css +0 -1
  57. package/dist/powell/themes/saga-orange.css +0 -1
  58. package/dist/powell/themes/saga-purple.css +0 -1
  59. package/dist/powell/themes/soho-dark.css +0 -1
  60. package/dist/powell/themes/soho-light.css +0 -1
  61. package/dist/powell/themes/tailwind-light.css +0 -1
  62. package/dist/powell/themes/vela-blue.css +0 -1
  63. package/dist/powell/themes/vela-green.css +0 -1
  64. package/dist/powell/themes/vela-orange.css +0 -1
  65. package/dist/powell/themes/vela-purple.css +0 -1
  66. package/dist/powell/themes/viva-dark.css +0 -1
  67. package/dist/powell/themes/viva-light.css +0 -1
@@ -0,0 +1,1842 @@
1
+ import require$$0, { useState, useLayoutEffect, useEffect, useRef, useContext, forwardRef, createContext } from 'react';
2
+ import { Formik, Form, FormikContext, useFormikContext } from 'formik';
3
+ export { ErrorMessage as $ErrorMessage, FastField as $FastField, Field as $Field, FieldArray as $FieldArray, Form as $Form, Formik as $Formik, FormikConsumer as $FormikConsumer, FormikContext as $FormikContext, FormikProvider as $FormikProvider, connect as $connect, getActiveElement as $getActiveElement, getIn as $getIn, insert as $insert, isEmptyArray as $isEmptyArray, isEmptyChildren as $isEmptyChildren, isFunction as $isFunction, isInputEvent as $isInputEvent, isInteger as $isInteger, isNaN as $isNaN, isObject as $isObject, isPromise as $isPromise, isString as $isString, move as $move, prepareDataForValidation as $prepareDataForValidation, replace as $replace, setIn as $setIn, setNestedObjectValues as $setNestedObjectValues, swap as $swap, useField as $useField, useFormik as $useFormik, useFormikContext as $useFormikContext, validateYupSchema as $validateYupSchema, withFormik as $withFormik, yupToFormErrors as $yupToFormErrors } from 'formik';
4
+ import * as yup from 'yup';
5
+ export { yup as $Yup };
6
+ export { AutoComplete as $AutoComplete } from 'primereact/autocomplete';
7
+ export { Calendar as $Calendar } from 'primereact/calendar';
8
+ export { CascadeSelect as $CascadeSelect } from 'primereact/cascadeselect';
9
+ export { Checkbox as $Checkbox } from 'primereact/checkbox';
10
+ export { Chips as $Chips } from 'primereact/chips';
11
+ export { ColorPicker as $ColorPicker } from 'primereact/colorpicker';
12
+ export { Dropdown as $Dropdown } from 'primereact/dropdown';
13
+ export { Editor as $Editor } from 'primereact/editor';
14
+ export { FloatLabel as $FloatLabel } from 'primereact/floatlabel';
15
+ export { InputIcon as $InputIcon } from 'primereact/inputicon';
16
+ export { IconField as $IconField } from 'primereact/iconfield';
17
+ export { InputMask as $InputMask } from 'primereact/inputmask';
18
+ export { InputSwitch as $InputSwitch } from 'primereact/inputswitch';
19
+ export { InputNumber as $InputNumber } from 'primereact/inputnumber';
20
+ export { InputOtp as $InputOtp } from 'primereact/inputotp';
21
+ export { InputText as $InputText } from 'primereact/inputtext';
22
+ export { InputTextarea as $InputTextarea } from 'primereact/inputtextarea';
23
+ export { Knob as $Knob } from 'primereact/knob';
24
+ export { ListBox as $ListBox } from 'primereact/listbox';
25
+ export { Mention as $Mention } from 'primereact/mention';
26
+ export { MultiSelect as $MultiSelect } from 'primereact/multiselect';
27
+ export { MultiStateCheckbox as $MultiStateCheckbox } from 'primereact/multistatecheckbox';
28
+ export { Password as $Password } from 'primereact/password';
29
+ export { RadioButton as $RadioButton } from 'primereact/radiobutton';
30
+ export { Rating as $Rating } from 'primereact/rating';
31
+ export { SelectButton as $SelectButton } from 'primereact/selectbutton';
32
+ export { Slider as $Slider } from 'primereact/slider';
33
+ export { TreeSelect as $TreeSelect } from 'primereact/treeselect';
34
+ export { TriStateCheckbox as $TriStateCheckbox } from 'primereact/tristatecheckbox';
35
+ export { ToggleButton as $ToggleButton } from 'primereact/togglebutton';
36
+ import { Button as Button$1 } from 'primereact/button';
37
+ export { Button as $Button } from 'primereact/button';
38
+ export { SpeedDial as $SpeedDial } from 'primereact/speeddial';
39
+ export { SplitButton as $SplitButton } from 'primereact/splitbutton';
40
+ export { DataTable as $DataTable } from 'primereact/datatable';
41
+ export { DataView as $DataView, DataViewLayoutOptions as $DataViewLayoutOptions } from 'primereact/dataview';
42
+ export { DataScroller as $DataScroller } from 'primereact/datascroller';
43
+ export { OrderList as $OrderList } from 'primereact/orderlist';
44
+ export { OrganizationChart as $OrganizationChart } from 'primereact/organizationchart';
45
+ export { Paginator as $Paginator } from 'primereact/paginator';
46
+ export { PickList as $PickList } from 'primereact/picklist';
47
+ export { Tree as $Tree } from 'primereact/tree';
48
+ export { TreeTable as $TreeTable } from 'primereact/treetable';
49
+ export { Timeline as $Timeline } from 'primereact/timeline';
50
+ export { VirtualScroller as $VirtualScroller } from 'primereact/virtualscroller';
51
+ export { Accordion as $Accordion, AccordionTab as $AccordionTab } from 'primereact/accordion';
52
+ export { Card as $Card } from 'primereact/card';
53
+ export { DeferredContent as $DeferredContent } from 'primereact/deferredcontent';
54
+ export { Divider as $Divider } from 'primereact/divider';
55
+ export { Fieldset as $Fieldset } from 'primereact/fieldset';
56
+ export { Panel as $Panel } from 'primereact/panel';
57
+ export { ScrollPanel as $ScrollPanel } from 'primereact/scrollpanel';
58
+ export { Splitter as $Splitter, SplitterPanel as $SplitterPanel } from 'primereact/splitter';
59
+ export { Stepper as $Stepper } from 'primereact/stepper';
60
+ export { TabPanel as $TabPanel, TabView as $TabView } from 'primereact/tabview';
61
+ export { Toolbar as $Toolbar } from 'primereact/toolbar';
62
+ import { ConfirmDialog } from 'primereact/confirmdialog';
63
+ export { ConfirmDialog as $ConfirmDialog, confirmDialog as $confirmDialog } from 'primereact/confirmdialog';
64
+ import { ConfirmPopup } from 'primereact/confirmpopup';
65
+ export { ConfirmPopup as $ConfirmPopup, confirmPopup as $confirmPopup } from 'primereact/confirmpopup';
66
+ export { Dialog as $Dialog } from 'primereact/dialog';
67
+ export { OverlayPanel as $OverlayPanel } from 'primereact/overlaypanel';
68
+ export { Sidebar as $Sidebar } from 'primereact/sidebar';
69
+ export { Tooltip as $Tooltip } from 'primereact/tooltip';
70
+ export { FileUpload as $FileUpload } from 'primereact/fileupload';
71
+ export { BreadCrumb as $BreadCrumb } from 'primereact/breadcrumb';
72
+ export { ContextMenu as $ContextMenu } from 'primereact/contextmenu';
73
+ export { Dock as $Dock } from 'primereact/dock';
74
+ export { MegaMenu as $MegaMenu } from 'primereact/megamenu';
75
+ export { Menu as $Menu } from 'primereact/menu';
76
+ export { Menubar as $Menubar } from 'primereact/menubar';
77
+ export { PanelMenu as $PanelMenu } from 'primereact/panelmenu';
78
+ export { Steps as $Steps } from 'primereact/steps';
79
+ export { TabMenu as $TabMenu } from 'primereact/tabmenu';
80
+ export { TieredMenu as $TieredMenu } from 'primereact/tieredmenu';
81
+ export { Message as $Message } from 'primereact/message';
82
+ export { Messages as $Messages } from 'primereact/messages';
83
+ import { Toast as Toast$1 } from 'primereact/toast';
84
+ export { Toast as $Toast } from 'primereact/toast';
85
+ export { Carousel as $Carousel } from 'primereact/carousel';
86
+ export { Galleria as $Galleria } from 'primereact/galleria';
87
+ export { Image as $Image } from 'primereact/image';
88
+ export { Avatar as $Avatar } from 'primereact/avatar';
89
+ export { Badge as $Badge } from 'primereact/badge';
90
+ export { BlockUI as $BlockUI } from 'primereact/blockui';
91
+ export { Chip as $Chip } from 'primereact/chip';
92
+ export { Inplace as $Inplace, InplaceContent as $InplaceContent, InplaceDisplay as $InplaceDisplay } from 'primereact/inplace';
93
+ export { MeterGroup as $MeterGroup } from 'primereact/metergroup';
94
+ export { ScrollTop as $ScrollTop } from 'primereact/scrolltop';
95
+ export { Skeleton as $Skeleton } from 'primereact/skeleton';
96
+ export { ProgressBar as $ProgressBar } from 'primereact/progressbar';
97
+ export { ProgressSpinner as $ProgressSpinner } from 'primereact/progressspinner';
98
+ export { Ripple as $Ripple } from 'primereact/ripple';
99
+ export { StyleClass as $StyleClass } from 'primereact/styleclass';
100
+ export { Tag as $Tag } from 'primereact/tag';
101
+ export { Terminal as $Terminal } from 'primereact/terminal';
102
+ import { PrimeReactContext, PrimeReactProvider } from 'primereact/api';
103
+ export { FilterMatchMode as $FilterMatchMode, FilterOperator as $FilterOperator, FilterService as $FilterService, MessageSeverity as $MessageSeverity, PrimeIcons as $PrimeIcons, PrimeReactContext as $PrimeReactContext, PrimeReactProvider as $PrimeReactProvider, addLocale as $addLocale, ariaLabel as $ariaLabel, locale as $locale, localeOption as $localeOption, localeOptions as $localeOptions, updateLocaleOption as $updateLocaleOption, updateLocaleOptions as $updateLocaleOptions } from 'primereact/api';
104
+ import { classNames } from 'primereact/utils';
105
+ export { DomHandler as $DomHandler, EventBus as $EventBus, IconUtils as $IconUtils, ObjectUtils as $ObjectUtils, UniqueComponentId as $UniqueComponentId, ZIndexUtils as $ZIndexUtils, classNames as $classNames, mask as $mask, mergeProps as $mergeProps } from 'primereact/utils';
106
+
107
+ var jsxRuntime = {exports: {}};
108
+
109
+ var reactJsxRuntime_production_min = {};
110
+
111
+ /**
112
+ * @license React
113
+ * react-jsx-runtime.production.min.js
114
+ *
115
+ * Copyright (c) Facebook, Inc. and its affiliates.
116
+ *
117
+ * This source code is licensed under the MIT license found in the
118
+ * LICENSE file in the root directory of this source tree.
119
+ */
120
+
121
+ var hasRequiredReactJsxRuntime_production_min;
122
+
123
+ function requireReactJsxRuntime_production_min () {
124
+ if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
125
+ hasRequiredReactJsxRuntime_production_min = 1;
126
+ var f=require$$0,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:true,ref:true,__self:true,__source:true};
127
+ function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a) void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
128
+ return reactJsxRuntime_production_min;
129
+ }
130
+
131
+ var reactJsxRuntime_development = {};
132
+
133
+ /**
134
+ * @license React
135
+ * react-jsx-runtime.development.js
136
+ *
137
+ * Copyright (c) Facebook, Inc. and its affiliates.
138
+ *
139
+ * This source code is licensed under the MIT license found in the
140
+ * LICENSE file in the root directory of this source tree.
141
+ */
142
+
143
+ var hasRequiredReactJsxRuntime_development;
144
+
145
+ function requireReactJsxRuntime_development () {
146
+ if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
147
+ hasRequiredReactJsxRuntime_development = 1;
148
+
149
+ if (process.env.NODE_ENV !== "production") {
150
+ (function() {
151
+
152
+ var React = require$$0;
153
+
154
+ // ATTENTION
155
+ // When adding new symbols to this file,
156
+ // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
157
+ // The Symbol used to tag the ReactElement-like types.
158
+ var REACT_ELEMENT_TYPE = Symbol.for('react.element');
159
+ var REACT_PORTAL_TYPE = Symbol.for('react.portal');
160
+ var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
161
+ var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
162
+ var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
163
+ var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
164
+ var REACT_CONTEXT_TYPE = Symbol.for('react.context');
165
+ var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
166
+ var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
167
+ var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
168
+ var REACT_MEMO_TYPE = Symbol.for('react.memo');
169
+ var REACT_LAZY_TYPE = Symbol.for('react.lazy');
170
+ var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
171
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
172
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
173
+ function getIteratorFn(maybeIterable) {
174
+ if (maybeIterable === null || typeof maybeIterable !== 'object') {
175
+ return null;
176
+ }
177
+
178
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
179
+
180
+ if (typeof maybeIterator === 'function') {
181
+ return maybeIterator;
182
+ }
183
+
184
+ return null;
185
+ }
186
+
187
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
188
+
189
+ function error(format) {
190
+ {
191
+ {
192
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
193
+ args[_key2 - 1] = arguments[_key2];
194
+ }
195
+
196
+ printWarning('error', format, args);
197
+ }
198
+ }
199
+ }
200
+
201
+ function printWarning(level, format, args) {
202
+ // When changing this logic, you might want to also
203
+ // update consoleWithStackDev.www.js as well.
204
+ {
205
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
206
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
207
+
208
+ if (stack !== '') {
209
+ format += '%s';
210
+ args = args.concat([stack]);
211
+ } // eslint-disable-next-line react-internal/safe-string-coercion
212
+
213
+
214
+ var argsWithFormat = args.map(function (item) {
215
+ return String(item);
216
+ }); // Careful: RN currently depends on this prefix
217
+
218
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
219
+ // breaks IE9: https://github.com/facebook/react/issues/13610
220
+ // eslint-disable-next-line react-internal/no-production-logging
221
+
222
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
223
+ }
224
+ }
225
+
226
+ // -----------------------------------------------------------------------------
227
+
228
+ var enableScopeAPI = false; // Experimental Create Event Handle API.
229
+ var enableCacheElement = false;
230
+ var enableTransitionTracing = false; // No known bugs, but needs performance testing
231
+
232
+ var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
233
+ // stuff. Intended to enable React core members to more easily debug scheduling
234
+ // issues in DEV builds.
235
+
236
+ var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
237
+
238
+ var REACT_MODULE_REFERENCE;
239
+
240
+ {
241
+ REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
242
+ }
243
+
244
+ function isValidElementType(type) {
245
+ if (typeof type === 'string' || typeof type === 'function') {
246
+ return true;
247
+ } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
248
+
249
+
250
+ if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
251
+ return true;
252
+ }
253
+
254
+ if (typeof type === 'object' && type !== null) {
255
+ if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
256
+ // types supported by any Flight configuration anywhere since
257
+ // we don't know which Flight build this will end up being used
258
+ // with.
259
+ type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
260
+ return true;
261
+ }
262
+ }
263
+
264
+ return false;
265
+ }
266
+
267
+ function getWrappedName(outerType, innerType, wrapperName) {
268
+ var displayName = outerType.displayName;
269
+
270
+ if (displayName) {
271
+ return displayName;
272
+ }
273
+
274
+ var functionName = innerType.displayName || innerType.name || '';
275
+ return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
276
+ } // Keep in sync with react-reconciler/getComponentNameFromFiber
277
+
278
+
279
+ function getContextName(type) {
280
+ return type.displayName || 'Context';
281
+ } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
282
+
283
+
284
+ function getComponentNameFromType(type) {
285
+ if (type == null) {
286
+ // Host root, text node or just invalid type.
287
+ return null;
288
+ }
289
+
290
+ {
291
+ if (typeof type.tag === 'number') {
292
+ error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
293
+ }
294
+ }
295
+
296
+ if (typeof type === 'function') {
297
+ return type.displayName || type.name || null;
298
+ }
299
+
300
+ if (typeof type === 'string') {
301
+ return type;
302
+ }
303
+
304
+ switch (type) {
305
+ case REACT_FRAGMENT_TYPE:
306
+ return 'Fragment';
307
+
308
+ case REACT_PORTAL_TYPE:
309
+ return 'Portal';
310
+
311
+ case REACT_PROFILER_TYPE:
312
+ return 'Profiler';
313
+
314
+ case REACT_STRICT_MODE_TYPE:
315
+ return 'StrictMode';
316
+
317
+ case REACT_SUSPENSE_TYPE:
318
+ return 'Suspense';
319
+
320
+ case REACT_SUSPENSE_LIST_TYPE:
321
+ return 'SuspenseList';
322
+
323
+ }
324
+
325
+ if (typeof type === 'object') {
326
+ switch (type.$$typeof) {
327
+ case REACT_CONTEXT_TYPE:
328
+ var context = type;
329
+ return getContextName(context) + '.Consumer';
330
+
331
+ case REACT_PROVIDER_TYPE:
332
+ var provider = type;
333
+ return getContextName(provider._context) + '.Provider';
334
+
335
+ case REACT_FORWARD_REF_TYPE:
336
+ return getWrappedName(type, type.render, 'ForwardRef');
337
+
338
+ case REACT_MEMO_TYPE:
339
+ var outerName = type.displayName || null;
340
+
341
+ if (outerName !== null) {
342
+ return outerName;
343
+ }
344
+
345
+ return getComponentNameFromType(type.type) || 'Memo';
346
+
347
+ case REACT_LAZY_TYPE:
348
+ {
349
+ var lazyComponent = type;
350
+ var payload = lazyComponent._payload;
351
+ var init = lazyComponent._init;
352
+
353
+ try {
354
+ return getComponentNameFromType(init(payload));
355
+ } catch (x) {
356
+ return null;
357
+ }
358
+ }
359
+
360
+ // eslint-disable-next-line no-fallthrough
361
+ }
362
+ }
363
+
364
+ return null;
365
+ }
366
+
367
+ var assign = Object.assign;
368
+
369
+ // Helpers to patch console.logs to avoid logging during side-effect free
370
+ // replaying on render function. This currently only patches the object
371
+ // lazily which won't cover if the log function was extracted eagerly.
372
+ // We could also eagerly patch the method.
373
+ var disabledDepth = 0;
374
+ var prevLog;
375
+ var prevInfo;
376
+ var prevWarn;
377
+ var prevError;
378
+ var prevGroup;
379
+ var prevGroupCollapsed;
380
+ var prevGroupEnd;
381
+
382
+ function disabledLog() {}
383
+
384
+ disabledLog.__reactDisabledLog = true;
385
+ function disableLogs() {
386
+ {
387
+ if (disabledDepth === 0) {
388
+ /* eslint-disable react-internal/no-production-logging */
389
+ prevLog = console.log;
390
+ prevInfo = console.info;
391
+ prevWarn = console.warn;
392
+ prevError = console.error;
393
+ prevGroup = console.group;
394
+ prevGroupCollapsed = console.groupCollapsed;
395
+ prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
396
+
397
+ var props = {
398
+ configurable: true,
399
+ enumerable: true,
400
+ value: disabledLog,
401
+ writable: true
402
+ }; // $FlowFixMe Flow thinks console is immutable.
403
+
404
+ Object.defineProperties(console, {
405
+ info: props,
406
+ log: props,
407
+ warn: props,
408
+ error: props,
409
+ group: props,
410
+ groupCollapsed: props,
411
+ groupEnd: props
412
+ });
413
+ /* eslint-enable react-internal/no-production-logging */
414
+ }
415
+
416
+ disabledDepth++;
417
+ }
418
+ }
419
+ function reenableLogs() {
420
+ {
421
+ disabledDepth--;
422
+
423
+ if (disabledDepth === 0) {
424
+ /* eslint-disable react-internal/no-production-logging */
425
+ var props = {
426
+ configurable: true,
427
+ enumerable: true,
428
+ writable: true
429
+ }; // $FlowFixMe Flow thinks console is immutable.
430
+
431
+ Object.defineProperties(console, {
432
+ log: assign({}, props, {
433
+ value: prevLog
434
+ }),
435
+ info: assign({}, props, {
436
+ value: prevInfo
437
+ }),
438
+ warn: assign({}, props, {
439
+ value: prevWarn
440
+ }),
441
+ error: assign({}, props, {
442
+ value: prevError
443
+ }),
444
+ group: assign({}, props, {
445
+ value: prevGroup
446
+ }),
447
+ groupCollapsed: assign({}, props, {
448
+ value: prevGroupCollapsed
449
+ }),
450
+ groupEnd: assign({}, props, {
451
+ value: prevGroupEnd
452
+ })
453
+ });
454
+ /* eslint-enable react-internal/no-production-logging */
455
+ }
456
+
457
+ if (disabledDepth < 0) {
458
+ error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
459
+ }
460
+ }
461
+ }
462
+
463
+ var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
464
+ var prefix;
465
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
466
+ {
467
+ if (prefix === undefined) {
468
+ // Extract the VM specific prefix used by each line.
469
+ try {
470
+ throw Error();
471
+ } catch (x) {
472
+ var match = x.stack.trim().match(/\n( *(at )?)/);
473
+ prefix = match && match[1] || '';
474
+ }
475
+ } // We use the prefix to ensure our stacks line up with native stack frames.
476
+
477
+
478
+ return '\n' + prefix + name;
479
+ }
480
+ }
481
+ var reentry = false;
482
+ var componentFrameCache;
483
+
484
+ {
485
+ var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
486
+ componentFrameCache = new PossiblyWeakMap();
487
+ }
488
+
489
+ function describeNativeComponentFrame(fn, construct) {
490
+ // If something asked for a stack inside a fake render, it should get ignored.
491
+ if ( !fn || reentry) {
492
+ return '';
493
+ }
494
+
495
+ {
496
+ var frame = componentFrameCache.get(fn);
497
+
498
+ if (frame !== undefined) {
499
+ return frame;
500
+ }
501
+ }
502
+
503
+ var control;
504
+ reentry = true;
505
+ var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
506
+
507
+ Error.prepareStackTrace = undefined;
508
+ var previousDispatcher;
509
+
510
+ {
511
+ previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
512
+ // for warnings.
513
+
514
+ ReactCurrentDispatcher.current = null;
515
+ disableLogs();
516
+ }
517
+
518
+ try {
519
+ // This should throw.
520
+ if (construct) {
521
+ // Something should be setting the props in the constructor.
522
+ var Fake = function () {
523
+ throw Error();
524
+ }; // $FlowFixMe
525
+
526
+
527
+ Object.defineProperty(Fake.prototype, 'props', {
528
+ set: function () {
529
+ // We use a throwing setter instead of frozen or non-writable props
530
+ // because that won't throw in a non-strict mode function.
531
+ throw Error();
532
+ }
533
+ });
534
+
535
+ if (typeof Reflect === 'object' && Reflect.construct) {
536
+ // We construct a different control for this case to include any extra
537
+ // frames added by the construct call.
538
+ try {
539
+ Reflect.construct(Fake, []);
540
+ } catch (x) {
541
+ control = x;
542
+ }
543
+
544
+ Reflect.construct(fn, [], Fake);
545
+ } else {
546
+ try {
547
+ Fake.call();
548
+ } catch (x) {
549
+ control = x;
550
+ }
551
+
552
+ fn.call(Fake.prototype);
553
+ }
554
+ } else {
555
+ try {
556
+ throw Error();
557
+ } catch (x) {
558
+ control = x;
559
+ }
560
+
561
+ fn();
562
+ }
563
+ } catch (sample) {
564
+ // This is inlined manually because closure doesn't do it for us.
565
+ if (sample && control && typeof sample.stack === 'string') {
566
+ // This extracts the first frame from the sample that isn't also in the control.
567
+ // Skipping one frame that we assume is the frame that calls the two.
568
+ var sampleLines = sample.stack.split('\n');
569
+ var controlLines = control.stack.split('\n');
570
+ var s = sampleLines.length - 1;
571
+ var c = controlLines.length - 1;
572
+
573
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
574
+ // We expect at least one stack frame to be shared.
575
+ // Typically this will be the root most one. However, stack frames may be
576
+ // cut off due to maximum stack limits. In this case, one maybe cut off
577
+ // earlier than the other. We assume that the sample is longer or the same
578
+ // and there for cut off earlier. So we should find the root most frame in
579
+ // the sample somewhere in the control.
580
+ c--;
581
+ }
582
+
583
+ for (; s >= 1 && c >= 0; s--, c--) {
584
+ // Next we find the first one that isn't the same which should be the
585
+ // frame that called our sample function and the control.
586
+ if (sampleLines[s] !== controlLines[c]) {
587
+ // In V8, the first line is describing the message but other VMs don't.
588
+ // If we're about to return the first line, and the control is also on the same
589
+ // line, that's a pretty good indicator that our sample threw at same line as
590
+ // the control. I.e. before we entered the sample frame. So we ignore this result.
591
+ // This can happen if you passed a class to function component, or non-function.
592
+ if (s !== 1 || c !== 1) {
593
+ do {
594
+ s--;
595
+ c--; // We may still have similar intermediate frames from the construct call.
596
+ // The next one that isn't the same should be our match though.
597
+
598
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
599
+ // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
600
+ var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
601
+ // but we have a user-provided "displayName"
602
+ // splice it in to make the stack more readable.
603
+
604
+
605
+ if (fn.displayName && _frame.includes('<anonymous>')) {
606
+ _frame = _frame.replace('<anonymous>', fn.displayName);
607
+ }
608
+
609
+ {
610
+ if (typeof fn === 'function') {
611
+ componentFrameCache.set(fn, _frame);
612
+ }
613
+ } // Return the line we found.
614
+
615
+
616
+ return _frame;
617
+ }
618
+ } while (s >= 1 && c >= 0);
619
+ }
620
+
621
+ break;
622
+ }
623
+ }
624
+ }
625
+ } finally {
626
+ reentry = false;
627
+
628
+ {
629
+ ReactCurrentDispatcher.current = previousDispatcher;
630
+ reenableLogs();
631
+ }
632
+
633
+ Error.prepareStackTrace = previousPrepareStackTrace;
634
+ } // Fallback to just using the name if we couldn't make it throw.
635
+
636
+
637
+ var name = fn ? fn.displayName || fn.name : '';
638
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
639
+
640
+ {
641
+ if (typeof fn === 'function') {
642
+ componentFrameCache.set(fn, syntheticFrame);
643
+ }
644
+ }
645
+
646
+ return syntheticFrame;
647
+ }
648
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
649
+ {
650
+ return describeNativeComponentFrame(fn, false);
651
+ }
652
+ }
653
+
654
+ function shouldConstruct(Component) {
655
+ var prototype = Component.prototype;
656
+ return !!(prototype && prototype.isReactComponent);
657
+ }
658
+
659
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
660
+
661
+ if (type == null) {
662
+ return '';
663
+ }
664
+
665
+ if (typeof type === 'function') {
666
+ {
667
+ return describeNativeComponentFrame(type, shouldConstruct(type));
668
+ }
669
+ }
670
+
671
+ if (typeof type === 'string') {
672
+ return describeBuiltInComponentFrame(type);
673
+ }
674
+
675
+ switch (type) {
676
+ case REACT_SUSPENSE_TYPE:
677
+ return describeBuiltInComponentFrame('Suspense');
678
+
679
+ case REACT_SUSPENSE_LIST_TYPE:
680
+ return describeBuiltInComponentFrame('SuspenseList');
681
+ }
682
+
683
+ if (typeof type === 'object') {
684
+ switch (type.$$typeof) {
685
+ case REACT_FORWARD_REF_TYPE:
686
+ return describeFunctionComponentFrame(type.render);
687
+
688
+ case REACT_MEMO_TYPE:
689
+ // Memo may contain any component type so we recursively resolve it.
690
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
691
+
692
+ case REACT_LAZY_TYPE:
693
+ {
694
+ var lazyComponent = type;
695
+ var payload = lazyComponent._payload;
696
+ var init = lazyComponent._init;
697
+
698
+ try {
699
+ // Lazy may contain any component type so we recursively resolve it.
700
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
701
+ } catch (x) {}
702
+ }
703
+ }
704
+ }
705
+
706
+ return '';
707
+ }
708
+
709
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
710
+
711
+ var loggedTypeFailures = {};
712
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
713
+
714
+ function setCurrentlyValidatingElement(element) {
715
+ {
716
+ if (element) {
717
+ var owner = element._owner;
718
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
719
+ ReactDebugCurrentFrame.setExtraStackFrame(stack);
720
+ } else {
721
+ ReactDebugCurrentFrame.setExtraStackFrame(null);
722
+ }
723
+ }
724
+ }
725
+
726
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
727
+ {
728
+ // $FlowFixMe This is okay but Flow doesn't know it.
729
+ var has = Function.call.bind(hasOwnProperty);
730
+
731
+ for (var typeSpecName in typeSpecs) {
732
+ if (has(typeSpecs, typeSpecName)) {
733
+ var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
734
+ // fail the render phase where it didn't fail before. So we log it.
735
+ // After these have been cleaned up, we'll let them throw.
736
+
737
+ try {
738
+ // This is intentionally an invariant that gets caught. It's the same
739
+ // behavior as without this statement except with a better message.
740
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
741
+ // eslint-disable-next-line react-internal/prod-error-codes
742
+ var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
743
+ err.name = 'Invariant Violation';
744
+ throw err;
745
+ }
746
+
747
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
748
+ } catch (ex) {
749
+ error$1 = ex;
750
+ }
751
+
752
+ if (error$1 && !(error$1 instanceof Error)) {
753
+ setCurrentlyValidatingElement(element);
754
+
755
+ error('%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).', componentName || 'React class', location, typeSpecName, typeof error$1);
756
+
757
+ setCurrentlyValidatingElement(null);
758
+ }
759
+
760
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
761
+ // Only monitor this failure once because there tends to be a lot of the
762
+ // same error.
763
+ loggedTypeFailures[error$1.message] = true;
764
+ setCurrentlyValidatingElement(element);
765
+
766
+ error('Failed %s type: %s', location, error$1.message);
767
+
768
+ setCurrentlyValidatingElement(null);
769
+ }
770
+ }
771
+ }
772
+ }
773
+ }
774
+
775
+ var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
776
+
777
+ function isArray(a) {
778
+ return isArrayImpl(a);
779
+ }
780
+
781
+ /*
782
+ * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
783
+ * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
784
+ *
785
+ * The functions in this module will throw an easier-to-understand,
786
+ * easier-to-debug exception with a clear errors message message explaining the
787
+ * problem. (Instead of a confusing exception thrown inside the implementation
788
+ * of the `value` object).
789
+ */
790
+ // $FlowFixMe only called in DEV, so void return is not possible.
791
+ function typeName(value) {
792
+ {
793
+ // toStringTag is needed for namespaced types like Temporal.Instant
794
+ var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
795
+ var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
796
+ return type;
797
+ }
798
+ } // $FlowFixMe only called in DEV, so void return is not possible.
799
+
800
+
801
+ function willCoercionThrow(value) {
802
+ {
803
+ try {
804
+ testStringCoercion(value);
805
+ return false;
806
+ } catch (e) {
807
+ return true;
808
+ }
809
+ }
810
+ }
811
+
812
+ function testStringCoercion(value) {
813
+ // If you ended up here by following an exception call stack, here's what's
814
+ // happened: you supplied an object or symbol value to React (as a prop, key,
815
+ // DOM attribute, CSS property, string ref, etc.) and when React tried to
816
+ // coerce it to a string using `'' + value`, an exception was thrown.
817
+ //
818
+ // The most common types that will cause this exception are `Symbol` instances
819
+ // and Temporal objects like `Temporal.Instant`. But any object that has a
820
+ // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
821
+ // exception. (Library authors do this to prevent users from using built-in
822
+ // numeric operators like `+` or comparison operators like `>=` because custom
823
+ // methods are needed to perform accurate arithmetic or comparison.)
824
+ //
825
+ // To fix the problem, coerce this object or symbol value to a string before
826
+ // passing it to React. The most reliable way is usually `String(value)`.
827
+ //
828
+ // To find which value is throwing, check the browser or debugger console.
829
+ // Before this exception was thrown, there should be `console.error` output
830
+ // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
831
+ // problem and how that type was used: key, atrribute, input value prop, etc.
832
+ // In most cases, this console output also shows the component and its
833
+ // ancestor components where the exception happened.
834
+ //
835
+ // eslint-disable-next-line react-internal/safe-string-coercion
836
+ return '' + value;
837
+ }
838
+ function checkKeyStringCoercion(value) {
839
+ {
840
+ if (willCoercionThrow(value)) {
841
+ error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
842
+
843
+ return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
844
+ }
845
+ }
846
+ }
847
+
848
+ var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
849
+ var RESERVED_PROPS = {
850
+ key: true,
851
+ ref: true,
852
+ __self: true,
853
+ __source: true
854
+ };
855
+ var specialPropKeyWarningShown;
856
+ var specialPropRefWarningShown;
857
+
858
+ function hasValidRef(config) {
859
+ {
860
+ if (hasOwnProperty.call(config, 'ref')) {
861
+ var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
862
+
863
+ if (getter && getter.isReactWarning) {
864
+ return false;
865
+ }
866
+ }
867
+ }
868
+
869
+ return config.ref !== undefined;
870
+ }
871
+
872
+ function hasValidKey(config) {
873
+ {
874
+ if (hasOwnProperty.call(config, 'key')) {
875
+ var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
876
+
877
+ if (getter && getter.isReactWarning) {
878
+ return false;
879
+ }
880
+ }
881
+ }
882
+
883
+ return config.key !== undefined;
884
+ }
885
+
886
+ function warnIfStringRefCannotBeAutoConverted(config, self) {
887
+ {
888
+ if (typeof config.ref === 'string' && ReactCurrentOwner.current && self) ;
889
+ }
890
+ }
891
+
892
+ function defineKeyPropWarningGetter(props, displayName) {
893
+ {
894
+ var warnAboutAccessingKey = function () {
895
+ if (!specialPropKeyWarningShown) {
896
+ specialPropKeyWarningShown = true;
897
+
898
+ 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://reactjs.org/link/special-props)', displayName);
899
+ }
900
+ };
901
+
902
+ warnAboutAccessingKey.isReactWarning = true;
903
+ Object.defineProperty(props, 'key', {
904
+ get: warnAboutAccessingKey,
905
+ configurable: true
906
+ });
907
+ }
908
+ }
909
+
910
+ function defineRefPropWarningGetter(props, displayName) {
911
+ {
912
+ var warnAboutAccessingRef = function () {
913
+ if (!specialPropRefWarningShown) {
914
+ specialPropRefWarningShown = true;
915
+
916
+ error('%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)', displayName);
917
+ }
918
+ };
919
+
920
+ warnAboutAccessingRef.isReactWarning = true;
921
+ Object.defineProperty(props, 'ref', {
922
+ get: warnAboutAccessingRef,
923
+ configurable: true
924
+ });
925
+ }
926
+ }
927
+ /**
928
+ * Factory method to create a new React element. This no longer adheres to
929
+ * the class pattern, so do not use new to call it. Also, instanceof check
930
+ * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
931
+ * if something is a React Element.
932
+ *
933
+ * @param {*} type
934
+ * @param {*} props
935
+ * @param {*} key
936
+ * @param {string|object} ref
937
+ * @param {*} owner
938
+ * @param {*} self A *temporary* helper to detect places where `this` is
939
+ * different from the `owner` when React.createElement is called, so that we
940
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
941
+ * functions, and as long as `this` and owner are the same, there will be no
942
+ * change in behavior.
943
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
944
+ * indicating filename, line number, and/or other information.
945
+ * @internal
946
+ */
947
+
948
+
949
+ var ReactElement = function (type, key, ref, self, source, owner, props) {
950
+ var element = {
951
+ // This tag allows us to uniquely identify this as a React Element
952
+ $$typeof: REACT_ELEMENT_TYPE,
953
+ // Built-in properties that belong on the element
954
+ type: type,
955
+ key: key,
956
+ ref: ref,
957
+ props: props,
958
+ // Record the component responsible for creating this element.
959
+ _owner: owner
960
+ };
961
+
962
+ {
963
+ // The validation flag is currently mutative. We put it on
964
+ // an external backing store so that we can freeze the whole object.
965
+ // This can be replaced with a WeakMap once they are implemented in
966
+ // commonly used development environments.
967
+ element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
968
+ // the validation flag non-enumerable (where possible, which should
969
+ // include every environment we run tests in), so the test framework
970
+ // ignores it.
971
+
972
+ Object.defineProperty(element._store, 'validated', {
973
+ configurable: false,
974
+ enumerable: false,
975
+ writable: true,
976
+ value: false
977
+ }); // self and source are DEV only properties.
978
+
979
+ Object.defineProperty(element, '_self', {
980
+ configurable: false,
981
+ enumerable: false,
982
+ writable: false,
983
+ value: self
984
+ }); // Two elements created in two different places should be considered
985
+ // equal for testing purposes and therefore we hide it from enumeration.
986
+
987
+ Object.defineProperty(element, '_source', {
988
+ configurable: false,
989
+ enumerable: false,
990
+ writable: false,
991
+ value: source
992
+ });
993
+
994
+ if (Object.freeze) {
995
+ Object.freeze(element.props);
996
+ Object.freeze(element);
997
+ }
998
+ }
999
+
1000
+ return element;
1001
+ };
1002
+ /**
1003
+ * https://github.com/reactjs/rfcs/pull/107
1004
+ * @param {*} type
1005
+ * @param {object} props
1006
+ * @param {string} key
1007
+ */
1008
+
1009
+ function jsxDEV(type, config, maybeKey, source, self) {
1010
+ {
1011
+ var propName; // Reserved names are extracted
1012
+
1013
+ var props = {};
1014
+ var key = null;
1015
+ var ref = null; // Currently, key can be spread in as a prop. This causes a potential
1016
+ // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
1017
+ // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
1018
+ // but as an intermediary step, we will use jsxDEV for everything except
1019
+ // <div {...props} key="Hi" />, because we aren't currently able to tell if
1020
+ // key is explicitly declared to be undefined or not.
1021
+
1022
+ if (maybeKey !== undefined) {
1023
+ {
1024
+ checkKeyStringCoercion(maybeKey);
1025
+ }
1026
+
1027
+ key = '' + maybeKey;
1028
+ }
1029
+
1030
+ if (hasValidKey(config)) {
1031
+ {
1032
+ checkKeyStringCoercion(config.key);
1033
+ }
1034
+
1035
+ key = '' + config.key;
1036
+ }
1037
+
1038
+ if (hasValidRef(config)) {
1039
+ ref = config.ref;
1040
+ warnIfStringRefCannotBeAutoConverted(config, self);
1041
+ } // Remaining properties are added to a new props object
1042
+
1043
+
1044
+ for (propName in config) {
1045
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
1046
+ props[propName] = config[propName];
1047
+ }
1048
+ } // Resolve default props
1049
+
1050
+
1051
+ if (type && type.defaultProps) {
1052
+ var defaultProps = type.defaultProps;
1053
+
1054
+ for (propName in defaultProps) {
1055
+ if (props[propName] === undefined) {
1056
+ props[propName] = defaultProps[propName];
1057
+ }
1058
+ }
1059
+ }
1060
+
1061
+ if (key || ref) {
1062
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
1063
+
1064
+ if (key) {
1065
+ defineKeyPropWarningGetter(props, displayName);
1066
+ }
1067
+
1068
+ if (ref) {
1069
+ defineRefPropWarningGetter(props, displayName);
1070
+ }
1071
+ }
1072
+
1073
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
1074
+ }
1075
+ }
1076
+
1077
+ var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
1078
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
1079
+
1080
+ function setCurrentlyValidatingElement$1(element) {
1081
+ {
1082
+ if (element) {
1083
+ var owner = element._owner;
1084
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
1085
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
1086
+ } else {
1087
+ ReactDebugCurrentFrame$1.setExtraStackFrame(null);
1088
+ }
1089
+ }
1090
+ }
1091
+
1092
+ var propTypesMisspellWarningShown;
1093
+
1094
+ {
1095
+ propTypesMisspellWarningShown = false;
1096
+ }
1097
+ /**
1098
+ * Verifies the object is a ReactElement.
1099
+ * See https://reactjs.org/docs/react-api.html#isvalidelement
1100
+ * @param {?object} object
1101
+ * @return {boolean} True if `object` is a ReactElement.
1102
+ * @final
1103
+ */
1104
+
1105
+
1106
+ function isValidElement(object) {
1107
+ {
1108
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1109
+ }
1110
+ }
1111
+
1112
+ function getDeclarationErrorAddendum() {
1113
+ {
1114
+ if (ReactCurrentOwner$1.current) {
1115
+ var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
1116
+
1117
+ if (name) {
1118
+ return '\n\nCheck the render method of `' + name + '`.';
1119
+ }
1120
+ }
1121
+
1122
+ return '';
1123
+ }
1124
+ }
1125
+
1126
+ function getSourceInfoErrorAddendum(source) {
1127
+ {
1128
+
1129
+ return '';
1130
+ }
1131
+ }
1132
+ /**
1133
+ * Warn if there's no key explicitly set on dynamic arrays of children or
1134
+ * object keys are not valid. This allows us to keep track of children between
1135
+ * updates.
1136
+ */
1137
+
1138
+
1139
+ var ownerHasKeyUseWarning = {};
1140
+
1141
+ function getCurrentComponentErrorInfo(parentType) {
1142
+ {
1143
+ var info = getDeclarationErrorAddendum();
1144
+
1145
+ if (!info) {
1146
+ var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
1147
+
1148
+ if (parentName) {
1149
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
1150
+ }
1151
+ }
1152
+
1153
+ return info;
1154
+ }
1155
+ }
1156
+ /**
1157
+ * Warn if the element doesn't have an explicit key assigned to it.
1158
+ * This element is in an array. The array could grow and shrink or be
1159
+ * reordered. All children that haven't already been validated are required to
1160
+ * have a "key" property assigned to it. Error statuses are cached so a warning
1161
+ * will only be shown once.
1162
+ *
1163
+ * @internal
1164
+ * @param {ReactElement} element Element that requires a key.
1165
+ * @param {*} parentType element's parent's type.
1166
+ */
1167
+
1168
+
1169
+ function validateExplicitKey(element, parentType) {
1170
+ {
1171
+ if (!element._store || element._store.validated || element.key != null) {
1172
+ return;
1173
+ }
1174
+
1175
+ element._store.validated = true;
1176
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1177
+
1178
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
1179
+ return;
1180
+ }
1181
+
1182
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
1183
+ // property, it may be the creator of the child that's responsible for
1184
+ // assigning it a key.
1185
+
1186
+ var childOwner = '';
1187
+
1188
+ if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
1189
+ // Give the component that originally created this child.
1190
+ childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
1191
+ }
1192
+
1193
+ setCurrentlyValidatingElement$1(element);
1194
+
1195
+ error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
1196
+
1197
+ setCurrentlyValidatingElement$1(null);
1198
+ }
1199
+ }
1200
+ /**
1201
+ * Ensure that every element either is passed in a static location, in an
1202
+ * array with an explicit keys property defined, or in an object literal
1203
+ * with valid key property.
1204
+ *
1205
+ * @internal
1206
+ * @param {ReactNode} node Statically passed child of any type.
1207
+ * @param {*} parentType node's parent's type.
1208
+ */
1209
+
1210
+
1211
+ function validateChildKeys(node, parentType) {
1212
+ {
1213
+ if (typeof node !== 'object') {
1214
+ return;
1215
+ }
1216
+
1217
+ if (isArray(node)) {
1218
+ for (var i = 0; i < node.length; i++) {
1219
+ var child = node[i];
1220
+
1221
+ if (isValidElement(child)) {
1222
+ validateExplicitKey(child, parentType);
1223
+ }
1224
+ }
1225
+ } else if (isValidElement(node)) {
1226
+ // This element was passed in a valid location.
1227
+ if (node._store) {
1228
+ node._store.validated = true;
1229
+ }
1230
+ } else if (node) {
1231
+ var iteratorFn = getIteratorFn(node);
1232
+
1233
+ if (typeof iteratorFn === 'function') {
1234
+ // Entry iterators used to provide implicit keys,
1235
+ // but now we print a separate warning for them later.
1236
+ if (iteratorFn !== node.entries) {
1237
+ var iterator = iteratorFn.call(node);
1238
+ var step;
1239
+
1240
+ while (!(step = iterator.next()).done) {
1241
+ if (isValidElement(step.value)) {
1242
+ validateExplicitKey(step.value, parentType);
1243
+ }
1244
+ }
1245
+ }
1246
+ }
1247
+ }
1248
+ }
1249
+ }
1250
+ /**
1251
+ * Given an element, validate that its props follow the propTypes definition,
1252
+ * provided by the type.
1253
+ *
1254
+ * @param {ReactElement} element
1255
+ */
1256
+
1257
+
1258
+ function validatePropTypes(element) {
1259
+ {
1260
+ var type = element.type;
1261
+
1262
+ if (type === null || type === undefined || typeof type === 'string') {
1263
+ return;
1264
+ }
1265
+
1266
+ var propTypes;
1267
+
1268
+ if (typeof type === 'function') {
1269
+ propTypes = type.propTypes;
1270
+ } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
1271
+ // Inner props are checked in the reconciler.
1272
+ type.$$typeof === REACT_MEMO_TYPE)) {
1273
+ propTypes = type.propTypes;
1274
+ } else {
1275
+ return;
1276
+ }
1277
+
1278
+ if (propTypes) {
1279
+ // Intentionally inside to avoid triggering lazy initializers:
1280
+ var name = getComponentNameFromType(type);
1281
+ checkPropTypes(propTypes, element.props, 'prop', name, element);
1282
+ } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
1283
+ propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
1284
+
1285
+ var _name = getComponentNameFromType(type);
1286
+
1287
+ error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
1288
+ }
1289
+
1290
+ if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
1291
+ error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
1292
+ }
1293
+ }
1294
+ }
1295
+ /**
1296
+ * Given a fragment, validate that it can only be provided with fragment props
1297
+ * @param {ReactElement} fragment
1298
+ */
1299
+
1300
+
1301
+ function validateFragmentProps(fragment) {
1302
+ {
1303
+ var keys = Object.keys(fragment.props);
1304
+
1305
+ for (var i = 0; i < keys.length; i++) {
1306
+ var key = keys[i];
1307
+
1308
+ if (key !== 'children' && key !== 'key') {
1309
+ setCurrentlyValidatingElement$1(fragment);
1310
+
1311
+ error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
1312
+
1313
+ setCurrentlyValidatingElement$1(null);
1314
+ break;
1315
+ }
1316
+ }
1317
+
1318
+ if (fragment.ref !== null) {
1319
+ setCurrentlyValidatingElement$1(fragment);
1320
+
1321
+ error('Invalid attribute `ref` supplied to `React.Fragment`.');
1322
+
1323
+ setCurrentlyValidatingElement$1(null);
1324
+ }
1325
+ }
1326
+ }
1327
+
1328
+ var didWarnAboutKeySpread = {};
1329
+ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
1330
+ {
1331
+ var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
1332
+ // succeed and there will likely be errors in render.
1333
+
1334
+ if (!validType) {
1335
+ var info = '';
1336
+
1337
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1338
+ info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
1339
+ }
1340
+
1341
+ var sourceInfo = getSourceInfoErrorAddendum();
1342
+
1343
+ if (sourceInfo) {
1344
+ info += sourceInfo;
1345
+ } else {
1346
+ info += getDeclarationErrorAddendum();
1347
+ }
1348
+
1349
+ var typeString;
1350
+
1351
+ if (type === null) {
1352
+ typeString = 'null';
1353
+ } else if (isArray(type)) {
1354
+ typeString = 'array';
1355
+ } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
1356
+ typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
1357
+ info = ' Did you accidentally export a JSX literal instead of a component?';
1358
+ } else {
1359
+ typeString = typeof type;
1360
+ }
1361
+
1362
+ error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
1363
+ }
1364
+
1365
+ var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
1366
+ // TODO: Drop this when these are no longer allowed as the type argument.
1367
+
1368
+ if (element == null) {
1369
+ return element;
1370
+ } // Skip key warning if the type isn't valid since our key validation logic
1371
+ // doesn't expect a non-string/function type and can throw confusing errors.
1372
+ // We don't want exception behavior to differ between dev and prod.
1373
+ // (Rendering will throw with a helpful message and as soon as the type is
1374
+ // fixed, the key warnings will appear.)
1375
+
1376
+
1377
+ if (validType) {
1378
+ var children = props.children;
1379
+
1380
+ if (children !== undefined) {
1381
+ if (isStaticChildren) {
1382
+ if (isArray(children)) {
1383
+ for (var i = 0; i < children.length; i++) {
1384
+ validateChildKeys(children[i], type);
1385
+ }
1386
+
1387
+ if (Object.freeze) {
1388
+ Object.freeze(children);
1389
+ }
1390
+ } else {
1391
+ 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.');
1392
+ }
1393
+ } else {
1394
+ validateChildKeys(children, type);
1395
+ }
1396
+ }
1397
+ }
1398
+
1399
+ {
1400
+ if (hasOwnProperty.call(props, 'key')) {
1401
+ var componentName = getComponentNameFromType(type);
1402
+ var keys = Object.keys(props).filter(function (k) {
1403
+ return k !== 'key';
1404
+ });
1405
+ var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
1406
+
1407
+ if (!didWarnAboutKeySpread[componentName + beforeExample]) {
1408
+ var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
1409
+
1410
+ error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
1411
+
1412
+ didWarnAboutKeySpread[componentName + beforeExample] = true;
1413
+ }
1414
+ }
1415
+ }
1416
+
1417
+ if (type === REACT_FRAGMENT_TYPE) {
1418
+ validateFragmentProps(element);
1419
+ } else {
1420
+ validatePropTypes(element);
1421
+ }
1422
+
1423
+ return element;
1424
+ }
1425
+ } // These two functions exist to still get child warnings in dev
1426
+ // even with the prod transform. This means that jsxDEV is purely
1427
+ // opt-in behavior for better messages but that we won't stop
1428
+ // giving you warnings if you use production apis.
1429
+
1430
+ function jsxWithValidationStatic(type, props, key) {
1431
+ {
1432
+ return jsxWithValidation(type, props, key, true);
1433
+ }
1434
+ }
1435
+ function jsxWithValidationDynamic(type, props, key) {
1436
+ {
1437
+ return jsxWithValidation(type, props, key, false);
1438
+ }
1439
+ }
1440
+
1441
+ var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
1442
+ // for now we can ship identical prod functions
1443
+
1444
+ var jsxs = jsxWithValidationStatic ;
1445
+
1446
+ reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
1447
+ reactJsxRuntime_development.jsx = jsx;
1448
+ reactJsxRuntime_development.jsxs = jsxs;
1449
+ })();
1450
+ }
1451
+ return reactJsxRuntime_development;
1452
+ }
1453
+
1454
+ if (process.env.NODE_ENV === 'production') {
1455
+ jsxRuntime.exports = requireReactJsxRuntime_production_min();
1456
+ } else {
1457
+ jsxRuntime.exports = requireReactJsxRuntime_development();
1458
+ }
1459
+
1460
+ var jsxRuntimeExports = jsxRuntime.exports;
1461
+
1462
+ const useIsomorphicLayoutEffect = typeof window !== "undefined" || typeof document !== "undefined" ? useLayoutEffect : useEffect;
1463
+ const equ = (a, b) => a === b;
1464
+ const FR = {};
1465
+ function useComparator(v, c = equ) {
1466
+ const f = useRef(FR);
1467
+ let nv = f.current;
1468
+ useIsomorphicLayoutEffect(() => {
1469
+ f.current = nv;
1470
+ });
1471
+ if (f.current === FR || !c(v, f.current)) {
1472
+ nv = v;
1473
+ }
1474
+ return nv;
1475
+ }
1476
+ function globalState(initialValue, options) {
1477
+ let sb = [];
1478
+ let v = initialValue;
1479
+ function set(newValue, callback) {
1480
+ const pv = v;
1481
+ v = newValue instanceof Function ? newValue(v) : newValue;
1482
+ setTimeout(() => {
1483
+ sb.forEach((c) => c(v, pv));
1484
+ callback?.(v, pv);
1485
+ options?.onSet?.(v, pv);
1486
+ });
1487
+ }
1488
+ function subscribe(subscriber) {
1489
+ sb.push(subscriber);
1490
+ return () => {
1491
+ sb = sb.filter((f) => f !== subscriber);
1492
+ };
1493
+ }
1494
+ function useSubscription(subscriber) {
1495
+ useIsomorphicLayoutEffect(() => subscribe(subscriber), [subscriber]);
1496
+ }
1497
+ function use() {
1498
+ const [l, s] = useState(v);
1499
+ useSubscription(s);
1500
+ return [l, set];
1501
+ }
1502
+ function useSelector(selector, comparator = equ) {
1503
+ const [rv] = use();
1504
+ return useComparator(selector(rv), comparator);
1505
+ }
1506
+ return {
1507
+ use,
1508
+ useSelector,
1509
+ useValue: () => use()[0],
1510
+ get: () => v,
1511
+ set,
1512
+ reset: () => set(initialValue),
1513
+ subscribe
1514
+ };
1515
+ }
1516
+
1517
+ const configService = globalState({});
1518
+
1519
+ const powellDefaults = {
1520
+ theme: "lara-light-cyan",
1521
+ rtl: false,
1522
+ showRequiredStar: true,
1523
+ ripple: true,
1524
+ inputSize: "medium",
1525
+ inputStyle: "outlined",
1526
+ labelPosition: "top",
1527
+ fixLabelPosition: "side",
1528
+ injectDirectionToRoot: false
1529
+ };
1530
+
1531
+ class OverlayEmitter {
1532
+ listeners = {};
1533
+ on(event, listener) {
1534
+ if (!this.listeners[event]) {
1535
+ this.listeners[event] = [];
1536
+ }
1537
+ this.listeners[event].push(listener);
1538
+ }
1539
+ emit(event, data) {
1540
+ if (this.listeners[event]) {
1541
+ this.listeners[event].forEach((listener) => listener(data));
1542
+ }
1543
+ }
1544
+ off(event, listener) {
1545
+ if (!this.listeners[event]) return;
1546
+ this.listeners[event] = this.listeners[event].filter((l) => l !== listener);
1547
+ }
1548
+ }
1549
+ const overlayEmitter = new OverlayEmitter();
1550
+
1551
+ const Toast = (prop) => {
1552
+ const toast = useRef(null);
1553
+ const isRendered = useRef(false);
1554
+ useEffect(() => {
1555
+ if (isRendered.current) {
1556
+ return;
1557
+ }
1558
+ isRendered.current = true;
1559
+ overlayEmitter.on("toast", (options) => {
1560
+ toast.current?.show(options);
1561
+ });
1562
+ }, []);
1563
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Toast$1, { ...prop, ref: toast });
1564
+ };
1565
+
1566
+ const usePowellConfig = () => {
1567
+ const [powellConfig, setPowellConfig] = configService.use();
1568
+ const {
1569
+ setPt,
1570
+ setFilterMatchModeOptions,
1571
+ setLocale,
1572
+ setNonce,
1573
+ setHideOverlaysOnDocumentScrolling,
1574
+ setRipple,
1575
+ setCssTransition,
1576
+ setStyleContainer,
1577
+ setInputStyle,
1578
+ setNullSortOrder,
1579
+ setZIndex,
1580
+ setAutoZIndex,
1581
+ setAppendTo,
1582
+ changeTheme,
1583
+ ...restPrimeConfig
1584
+ } = useContext(PrimeReactContext);
1585
+ const configAction = {
1586
+ pt: setPt,
1587
+ filterMatchModeOptions: setFilterMatchModeOptions,
1588
+ locale: setLocale,
1589
+ nonce: setNonce,
1590
+ hideOverlaysOnDocumentScrolling: setHideOverlaysOnDocumentScrolling,
1591
+ ripple: setRipple,
1592
+ cssTransition: setCssTransition,
1593
+ styleContainer: setStyleContainer,
1594
+ inputStyle: setInputStyle,
1595
+ nullSortOrder: setNullSortOrder,
1596
+ zIndex: setZIndex,
1597
+ autoZIndex: setAutoZIndex,
1598
+ appendTo: setAppendTo,
1599
+ theme: (v) => changeTheme?.(powellConfig.theme, v.theme, "powell-theme-link")
1600
+ };
1601
+ const updateConfig = (c) => {
1602
+ for (const key in c) {
1603
+ if (key in configAction) {
1604
+ configAction[key]?.(c);
1605
+ }
1606
+ applyConfigToDom({ ...c, injectDirectionToRoot: powellConfig.injectDirectionToRoot });
1607
+ setPowellConfig((prev) => ({ ...prev, ...c }));
1608
+ }
1609
+ };
1610
+ return [{ ...powellConfig, ...restPrimeConfig }, updateConfig];
1611
+ };
1612
+ const applyConfigToDom = (config) => {
1613
+ handleBodyClasses(config);
1614
+ if ("rtl" in config && config.injectDirectionToRoot) {
1615
+ document.documentElement.setAttribute("dir", config.rtl ? "rtl" : "ltr");
1616
+ } else {
1617
+ document.documentElement.removeAttribute("dir");
1618
+ }
1619
+ };
1620
+ const kebabCase = (str) => str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
1621
+ const handleBodyClasses = (config) => {
1622
+ const specialBodyClassRules = {
1623
+ ripple: [
1624
+ {
1625
+ condition: (v) => v === false,
1626
+ className: "p-ripple-disabled"
1627
+ }
1628
+ ],
1629
+ inputStyle: [
1630
+ {
1631
+ condition: (v) => v === "filled",
1632
+ className: "p-input-filled"
1633
+ }
1634
+ ]
1635
+ };
1636
+ for (const key in config) {
1637
+ const value = config[key];
1638
+ if (value === void 0) continue;
1639
+ const rules = specialBodyClassRules[key];
1640
+ if (rules && rules.length) {
1641
+ for (const rule of rules) {
1642
+ const shouldApply = rule.condition(value);
1643
+ document.body.classList.toggle(rule.className, shouldApply);
1644
+ }
1645
+ } else {
1646
+ const prefix = `powell-${kebabCase(key)}-`;
1647
+ document.body.classList.forEach((cls) => {
1648
+ if (cls.startsWith(prefix)) {
1649
+ document.body.classList.remove(cls);
1650
+ }
1651
+ });
1652
+ const finalValue = typeof value === "boolean" ? value ? "enabled" : "disabled" : value;
1653
+ document.body.classList.add(`${prefix}${finalValue}`);
1654
+ }
1655
+ }
1656
+ };
1657
+
1658
+ const splitProps = (props, groups) => {
1659
+ const result = {};
1660
+ const rest = {};
1661
+ const assigned = {};
1662
+ const restEligible = {};
1663
+ for (const groupName in groups) {
1664
+ for (const descriptor of groups[groupName]) {
1665
+ const key = typeof descriptor === "string" ? descriptor : descriptor.key;
1666
+ const alias = typeof descriptor === "string" ? void 0 : descriptor.alias;
1667
+ const defaultValue = typeof descriptor === "string" ? void 0 : descriptor.defaultValue;
1668
+ const keepInRest = typeof descriptor === "string" ? false : descriptor.keepInRest ?? false;
1669
+ if (!result[groupName]) {
1670
+ result[groupName] = {};
1671
+ }
1672
+ const value = key in props ? props[key] : typeof defaultValue === "function" ? defaultValue() : defaultValue;
1673
+ result[groupName][alias ?? key] = value;
1674
+ assigned[key] = true;
1675
+ if (keepInRest) {
1676
+ restEligible[key] = true;
1677
+ }
1678
+ }
1679
+ }
1680
+ for (const key in props) {
1681
+ const typedKey = key;
1682
+ if (!assigned[typedKey] || restEligible[typedKey]) {
1683
+ rest[typedKey] = props[typedKey];
1684
+ }
1685
+ }
1686
+ result.rest = rest;
1687
+ return result;
1688
+ };
1689
+ const useApplyConfig = (props, options) => {
1690
+ const [config] = usePowellConfig();
1691
+ const { sizable = true, isFixLabel = false, groups = {} } = options;
1692
+ const result = {
1693
+ ...props,
1694
+ rtl: props.rtl ?? config.rtl,
1695
+ showRequiredStar: props.showRequiredStar ?? config.showRequiredStar,
1696
+ labelPosition: props.labelPosition ?? (isFixLabel ? config.fixLabelPosition : config.labelPosition),
1697
+ ..."variant" in props ? { variant: props.variant ?? config.inputStyle } : {}
1698
+ };
1699
+ if (sizable) {
1700
+ result.inputSize = props.inputSize ?? config.inputSize;
1701
+ }
1702
+ return splitProps(result, groups);
1703
+ };
1704
+
1705
+ const FormContent = (props) => {
1706
+ const { children, onInit } = props;
1707
+ const formikContext = useSafeFormikContext();
1708
+ const initialized = useRef(false);
1709
+ useEffect(() => {
1710
+ if (!initialized.current) {
1711
+ onInit?.(formikContext);
1712
+ initialized.current = true;
1713
+ }
1714
+ }, [formikContext, onInit]);
1715
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children });
1716
+ };
1717
+ forwardRef((props, ref) => {
1718
+ const { children, onInit, className, ...rest } = props;
1719
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Formik, { ...rest, children: (context) => /* @__PURE__ */ jsxRuntimeExports.jsx(FormProvider, { ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Form, { ref, className, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FormContent, { onInit, children: typeof children === "function" ? children(context) : children }) }) }) });
1720
+ });
1721
+
1722
+ const FormContext = createContext(void 0);
1723
+ const FormProvider = (props) => {
1724
+ const { children, ...rest } = props;
1725
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(FormContext.Provider, { value: rest, children: /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children }) });
1726
+ };
1727
+
1728
+ const useFormContext = () => {
1729
+ const context = useContext(FormContext);
1730
+ const formikContext = useSafeFormikContext();
1731
+ if (!context || !formikContext) {
1732
+ return null;
1733
+ }
1734
+ return { ...context, ...formikContext };
1735
+ };
1736
+ function useSafeFormikContext() {
1737
+ const context = useContext(FormikContext);
1738
+ try {
1739
+ if (context) {
1740
+ return useFormikContext();
1741
+ }
1742
+ return void 0;
1743
+ } catch {
1744
+ return void 0;
1745
+ }
1746
+ }
1747
+
1748
+ const createThemeLink = () => {
1749
+ const headEl = document.head;
1750
+ const linkEl = document.createElement("link");
1751
+ linkEl.rel = "stylesheet";
1752
+ linkEl.type = "text/css";
1753
+ linkEl.id = "powell-theme-link";
1754
+ headEl.appendChild(linkEl);
1755
+ return linkEl;
1756
+ };
1757
+ const applyTheme = (theme) => {
1758
+ let themeEl = document.getElementById("powell-theme-link");
1759
+ if (!themeEl) {
1760
+ themeEl = createThemeLink();
1761
+ }
1762
+ themeEl.setAttribute("href", `/themes/${theme}.css`);
1763
+ };
1764
+ const PowellProvider = (props) => {
1765
+ const { children, config } = props;
1766
+ const defaultConfig = {
1767
+ ...powellDefaults,
1768
+ ...config
1769
+ };
1770
+ configService.set(defaultConfig);
1771
+ applyConfigToDom(defaultConfig);
1772
+ applyTheme(defaultConfig.theme);
1773
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(PrimeReactProvider, { value: defaultConfig, children: [
1774
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Toast, {}),
1775
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ConfirmDialog, {}),
1776
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ConfirmPopup, {}),
1777
+ children
1778
+ ] });
1779
+ };
1780
+
1781
+ const Button = (props) => {
1782
+ const {
1783
+ async,
1784
+ onClickAsync,
1785
+ onClick,
1786
+ nextLabel,
1787
+ nextIcon,
1788
+ nextRaised,
1789
+ nextSeverity,
1790
+ nextAppearance,
1791
+ state = "default",
1792
+ onStateChange,
1793
+ type = "button",
1794
+ ...rest
1795
+ } = props;
1796
+ const [_state, _setState] = useState(state);
1797
+ const getButtonTempProps = (newState) => {
1798
+ return {
1799
+ label: newState === "default" ? rest.label : nextLabel ?? rest.label,
1800
+ icon: newState === "default" ? rest.icon : nextIcon ?? rest.icon,
1801
+ appearance: newState === "default" ? rest.appearance : nextAppearance ?? rest.appearance,
1802
+ raised: newState === "default" ? rest.raised : nextRaised ?? rest.raised,
1803
+ severity: newState === "default" ? rest.severity : nextSeverity ?? rest.severity
1804
+ };
1805
+ };
1806
+ const tempProps = useRef(getButtonTempProps(state));
1807
+ const handleClick = (event) => {
1808
+ if (async) {
1809
+ onClickAsync?.({ event, loadingCallback: removeLoading });
1810
+ _setState("loading");
1811
+ onStateChange?.("loading");
1812
+ } else {
1813
+ onClick?.(event);
1814
+ }
1815
+ };
1816
+ const removeLoading = (toggleState) => {
1817
+ const newState = toggleState ? "next" : "default";
1818
+ tempProps.current = getButtonTempProps(newState);
1819
+ _setState(newState);
1820
+ onStateChange?.(newState);
1821
+ };
1822
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1823
+ Button$1,
1824
+ {
1825
+ type,
1826
+ ...rest,
1827
+ onClick: handleClick,
1828
+ label: async ? tempProps.current.label : rest.label,
1829
+ icon: async ? tempProps.current.icon : rest.icon,
1830
+ severity: async ? tempProps.current.severity : rest.severity,
1831
+ raised: async ? tempProps.current.raised : rest.raised,
1832
+ text: async ? tempProps.current.appearance === "text" : rest.appearance === "text",
1833
+ outlined: async ? tempProps.current.appearance === "outlined" : rest.appearance === "outlined",
1834
+ link: async ? tempProps.current.appearance === "link" : rest.appearance === "link",
1835
+ loading: _state === "loading",
1836
+ className: classNames(rest.className, `state-${_state}`)
1837
+ }
1838
+ );
1839
+ };
1840
+
1841
+ export { Button, PowellProvider, applyConfigToDom, configService, globalState, powellDefaults, useApplyConfig, useFormContext, usePowellConfig, useSafeFormikContext };
1842
+ //# sourceMappingURL=index.es.js.map